You are not logged in.
I'd say the class definition is going to be the best way to go.
The reason <br>s are 'bad' (although not that bad) XHTML is that the HTML should define structure only, while CSS defines the formatting/presentation. Line breaks are a presentational construct done for effect rather than to start a new body of text, so they're not wholly structural and therefore not 'good' XHTML.
Hopefully gogo will include this as a default part of the Xinha code as it's not worth a plug-in and changing htmlarea.js isn't too good an idea for being able to update later.
I agree <p style="margin:0;"> is ugly and I'd personally use the style sheet definition if people get that upset at the use of paragraphs. I was just listing some of the options others may want to use.
I'm not sure it's possible to insert code away from the focus without writing a different function to do so specifically (though I'm no javascript expert).
The built-in functions like insertHTML and surroundHTML rely on focus to determine where to insert/what to surround afaik.
A solution may be to have a handler function to check where the focus is when the button is clicked. If it's not in the right area, move the focus. But as I said I'm no javascript guru, so there may be a simpler answer ![]()
OK, as you said you didn't want a CMS I presumed you didn't want a PHP-based script, as basically any script that edits files is a simple CMS.
Check out somewhere like hotscripts.com - there's bound to be something there that meets your needs.
You could just add some more code in scan.php to check which page is currently using xinha and build the list based on that information (e.g. the referring file is /somedir/editor.php so you can build a list relative to that).
If you want a WYSIWYG for editing normal, non-dynamic HTML files then you're unlikely to use a solution involving a browser-based editor (how would it write to the files?).
Stuff like Dreamweaver, FrontPage, etc. are all designed specifically for editing normal HTML files in a WYSIWYG environment and will have a lot more functionality.
I think Yermo is suggesting that by adding that new value it would then insert any new paragraphs in Xinha as
<p style="[style you entered here]">...</p>so the above would become
<p style="margin:0;">...</p>It would of course savetime for the developer as you don't have to set a style in two places, but it's not so good for the maintenance of the site. The point of CSS is to separate style and content, which this doesn't do.
We'll all have to make some trade-off with this - give in and let them use line breaks; set inline styles to hide the fact it's a <p> tag but lose separation of style and content; set styles externally but spend the little bit of extra time to do it in two places. I guess it's down to each webmaster's needs and choice ![]()
It won't work in IE because technically the correct way is for it to use <p> tags, which IE uses. Firefox by default uses <br> tags, which is fixed by that option, though can be turned back off again.
Rather than writing reverse code to make IE use br tags or playing with the styling of paragraphs, it may be easier just to put a note above the editor frame that shift+enter will create a line break.
Paragraphs have margins above and below that create the separation you want rid of, so setting the margin to 0 makes them look like they've just been separated by <br /> tags. If you want to keep a certain amount of spacing, you can always set margin-top and/or margin-bottom to something greater than 0 for p elements.
If you're using the Stylist plugin, you can set the style by including a .css file with the style I gave earlier (as well as any other styling you want).
Alternatively, you can try editing the default CSS as below:
config.pageStyle = 'p { margin:0; } ';and then applying config to your HTMLArea when you generate it. I'm not sure if the above still works in Xinha, but it did with HTMLArea.
Hope that helps ![]()
If you want to keep the <p> tags but have it look like line breaks, just set a style
p { margin:0; }for the editor pane (and the page/area that's then going to display the text)