PDA

View Full Version : WYSIWYG Buttons


austin322
07-28-03, 09:09 AM
I have built an online WYSIWYG HTML editor based on the execCommand script. All of my buttons work correctly but, for instance when you highlight some text and bold it, it bolds the text, but doesn't leave the bold button highlighted. Is there any scripting that I need to add, if so, then what?

Damian
07-28-03, 09:20 AM
use spaw... search for it on hotscripts.com... it's great.

austin322
07-28-03, 09:45 AM
I am not looking for a new editor, I am just needing the script to highlight the buttons, when they are selected.

nd2
07-29-03, 02:58 AM
use css with java script to highlight buttons.

austin322
07-29-03, 08:08 AM
I can already highlight the buttons when you move the the mouseover the buttons, but I need the buttons to be highlighted after they are selected and the mouse is not over the button. It would only need to be highlighted when the selected text has any formatting. (e.g., When you select something that has already been bolded the bold button would automatically highlight, but when you select text that is not bolded the bold button would not be highlighted.
THANKS

inkblot
08-05-03, 12:12 AM
I can't can't see that being possible with javascript alone (or at least not simply). You would have to maintain a dynamic list of what text has what formatting applied to it.
...A lot of text box searching. I'm not sure I've seen that done in any other WYSIWYG editor but if you see it, I'd search through their code :)

Mat
08-07-03, 05:39 AM
yes u would use css in this case.

-Mat

nd2
08-16-03, 07:23 AM
okay i think i understand a bit more, ive seen something like it done in ewe i think it was, im not sure how they pulled it of unless IE stores a array with propertys somewhere.