You are not logged in.
I was wondering if anyone figured out a solution to the spacing problem. I know I need to put requests into a ticket, but I thought I would write to see if anyone has the solution. I have tried replacing the <p></p> with a <br> on the server side but that does not work for multiple reasons. If anyone has a way to fix the issue of rending the <p> tag every time an enter button is clicked, Id appreciate the help.
Offline
I was wondering if anyone figured out a solution to the spacing problem. I know I need to put requests into a ticket, but I thought I would write to see if anyone has the solution. I have tried replacing the <p></p> with a <br> on the server side but that does not work for multiple reasons. If anyone has a way to fix the issue of rending the <p> tag every time an enter button is clicked, Id appreciate the help.
Check htmlarea.js around line 197:
this.mozParaHandler = 'built-in'
You should probably set it on the calling page which, in the full-example_body.html file in STEP 2 should be
xinha_config.mozParaHandler = 'built-in';
But unfortunately that is not working for me. Haven't tracked down why yet, so I just changed htmlarea.js for the time being.
I dont' yet understand the full side-effects of using <br>'s. The "correct" thing is to use the paragraph tags (and possibly a stylesheet entry?) but users want the newline behavior the expect.
-----------------------------------------------------------------------------------------
Content Management with Business Intelligence [url]http://www.formvista.com[/url]
Offline
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)
Offline
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)
How do you configure the editor to not have a margin for the <p> tag. Also, doesnt this eleminate spacing all together?
Offline
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
Offline
to remove the margin for p-tags you need this:
xinha_config.pageStyle = "p { margin:0; }";
(+ like adamp and the page/area that's then going to display the text)
Niko
Offline
Check htmlarea.js around line 197:
this.mozParaHandler = 'built-in'
Does this not work in IE. It works nicely in Netscape and Firefox
Offline
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.
Offline
We should really do away with linebreaks, though.
It can be argued that a linebreak has some semantic value (i.e., it further defines what is being written), but most authors use it in an entirely subjective fashion. They add breaks according to what feels right at the time. Usually they will do this based on the current display, which we as developers know changes drastically with different operating systems, browsers, font sizes, and screen resolutions.
Back in the days of the typewriter, authors had to backup one space and strike a key in order to bold a particular letter. This of course was a very time consuming process. To make things easier, the underscore was invented. This allowed certain words to be emphasized with greater ease. However, this convention is still being used today, despite the fact that there is no reason for it.
Underscoring is UGLY!
Like the underscore, the linebreak is a holdover from the days of the typewriter. Using that technology, which is restricted to output on paper, it makes good sense to speak of linebreaks, since the author is working within a well-defined set of constraints, typically 8 x 11. They can see all of the important aspects of the design right there in front of them.
When we're working with a WYSIWYG editor, we usually assume the same thing, even though publishing electronically is something quite different indeed. It's not well-defined. There is no such thing as a "page." These are old constructs... residual mind-garbage. We should dump that mode of backwards thinking.
We should simply tell users that this is a new medium and it doesn't work the same way as a typewriter, rather than caving into the caveman-demands of "ME WANT LINEBREAK! OOGA BOOGA!"
Learn how to astral project: [url]http://gnosticweb.org[/url]
Offline
xinha_config.pageStyle = "p { margin:0; }";
The problem here is one of configuration because you're got to remember to do this for <p> tags in the generated HTML where you're using it.
What would be cool is to be able to set the style of <p> tags that the editor outputs automatically .. both in the iframe and in the generated text; so you don't have to do a global <p> tag margin style.
What if we did a
config.EnterParagraphs.pStyle = "margin: 0;";
or some such so we could change the behavior of the <p> tag from the configuration?
-----------------------------------------------------------------------------------------
Content Management with Business Intelligence [url]http://www.formvista.com[/url]
Offline
When we're working with a WYSIWYG editor, we usually assume the same thing, even though publishing electronically is something quite different indeed. It's not well-defined. There is no such thing as a "page." These are old constructs... residual mind-garbage. We should dump that mode of backwards thinking.
We should simply tell users that this is a new medium and it doesn't work the same way as a typewriter, rather than caving into the caveman-demands of "ME WANT LINEBREAK! OOGA BOOGA!"
You have to give customers what they want. I agree that doing away with linebreaks is probably the technically correct thing to do, but it is nevertheless not what customers want. A customer wants to hit "ENTER" and have it act like a word processor. The people who actually use Xinha in real life applications typically have no markup background whatsoever ... for instance my users typically have a little word processing experience and little else. I receive alot of complaints and questions about the "double newline problem".
-----------------------------------------------------------------------------------------
Content Management with Business Intelligence [url]http://www.formvista.com[/url]
Offline
What if we did a
config.EnterParagraphs.pStyle = "margin: 0;";
or some such so we could change the behavior of the <p> tag from the configuration?
i don't see the difference, you have to remember again to do this for <p> tags in the generated HTML where you're using it!
Niko
Offline
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
Offline
i really don't have a problem with defining a p { margin: 0; }
i do even use the same css-file for Xinha and my frontend...
imho <p style="margin: 0;"> is ugly
but if others would prefer it....
Niko
Offline
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.
Offline
You have to give customers what they want.
This is true in some cases, where it is not in opposition to an important design goal.
Educating them is another option (and better imho). It really doesn't take that much effort.
Anyway, as with all things, to each their own.
Learn how to astral project: [url]http://gnosticweb.org[/url]
Offline
You have to give customers what they want.
This is true in some cases, where it is not in opposition to an important design goal.
Educating them is another option (and better imho). It really doesn't take that much effort.
When there are enough 0's involved, customers no longer want to be educated. They just want it to work the way they are used to. All a matter of context I guess. Xinha needs to be able to accomodate both contexts.
In that vein, I was thinking <p> tags generated by EnterParagraphs should optionally include a class name, which we can then define in the calling page. This way you don't have to modify the style of <p> tags globally, which might break your design. In addition, it lets you have technically correct html while giving users the appearance they are used to.
I've got it mostly working in a hardcoded test case here ...
Last edited by Yermo (2005-03-16 15:00:45)
-----------------------------------------------------------------------------------------
Content Management with Business Intelligence [url]http://www.formvista.com[/url]
Offline
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.
What I'm working on now instead is changing it to:
<p class="someClass">...</p>
and then defining it in the stylesheet. The stylesheet entry needs to be loaded in two places, once in the editor and then on the page where the content is being used. But this seems to give us the best of both worlds.
I have it mostly working in a test case here ...
Do you see any problems with this approach? (I'm still new at all this DOM javascript stuff .. the biggest problem I'm having coming up to speed is seeing all the contexts and consequences to given choices ...)
-----------------------------------------------------------------------------------------
Content Management with Business Intelligence [url]http://www.formvista.com[/url]
Offline
I am just wondering how you are going to handle the 2 cases (when to insert that class and when not to insert that class). Is the [shift]+[enter] going to insert the class while just hitting [enter] does not?
I most definately agree that we need to give the customer what they want. With that said, im wondering if there can be a config option to alter the functionality of the [enter] vs the [shift]+[enter]. As previously mentioned, most people are used to word processor behavior and that is what they would like this to be. Therefore, I think it would be easier on my clients to hit [enter] and get the <br> or the new proposed <p class="some class"> and then have them get the unstyled <p> tag with a [shift]+[enter].
Just a thought, not sure if anyone is in agreement or even if its a good idea.
Offline
I am just wondering how you are going to handle the 2 cases (when to insert that class and when not to insert that class). Is the [shift]+[enter] going to insert the class while just hitting [enter]does not?
SHIFT-ENTER inserts a break, at least in FireFox. I believe it works the same way in MSIE. If it doesn't, it's easy enough to define two classes. (i.e. ENTER => <p class="class1"> SHIFT-ENTER => <p class="class2">)
I most definately agree that we need to give the customer what they want. With that said, im wondering if there can be a config option to alter the functionality of the [enter] vs the [shift]+[enter]. As previously mentioned, most people are used to word processor behavior and that is what they would like this to be. Therefore, I think it would be easier on my clients to hit [enter] and get the <br> or the new proposed <p class="some class"> and then have them get the unstyled <p> tag with a [shift]+[enter].
Just a thought, not sure if anyone is in agreement or even if its a good idea.
The core of the problem seems to be that MSIE by default inserts <p> tags. For reasons I don't understand, inserting <p> tags is the "correct" thing to do; maybe because it's more XMLish than the BR tags.
I don't know if anything else (other plugins) breaks if you have <br> tags by default on ENTER.
Originally I wanted to switch the behavior to ENTER == "br", but it seems to me that optionally including a class parameter might be a better solution. That way you can have "correct" HTML while still having the presentation be what users expect.
What do you think?
-----------------------------------------------------------------------------------------
Content Management with Business Intelligence [url]http://www.formvista.com[/url]
Offline
If it doesn't, it's easy enough to define two classes. (i.e. ENTER => <p class="class1"> SHIFT-ENTER => <p class="class2">)
If you are going to define 2 classes that can be configured to the users liking, I think that would be great. So I guess I am wondering if what you are suggesting is the following:
User 1 wants enter==<p class1> and shit+enter==<p class2> but user 2 wants enter==<p class2> and shit+enter==<p class1>
Is that along the ideas of your suggestion. Basically, we have the 2 classes and we can set them however we want to enter and shit+enter? This would allow us to give the <br> like behavior on the enter, and the regular <p> behavior on the shift+enter or visa versa.
Offline
If you are going to define 2 classes that can be configured to the users liking, I think that would be great. So I guess I am wondering if what you are suggesting is the following:
User 1 wants enter==<p class1> and shit+enter==<p class2> but user 2 wants enter==<p class2> and shit+enter==<p class1>
Is that along the ideas of your suggestion. Basically, we have the 2 classes and we can set them however we want to enter and shit+enter? This would allow us to give the <br> like behavior on the enter, and the regular <p> behavior on the shift+enter or visa versa.
As I am very fond of saying, Ayup.
I'm imagining two /optional/ config values for the EnterParagraphs plugins
xinha_config.EnterParagraphs.enterStyle = "somestylename";
xinha_config.EnterParagraphs.shiftEnterStyle = "someotherstyle";
Since the default behavior for SHIFT_ENTER is <br> right now it would require some hacking in htmlarea.js ... so for a first pass I'll probably only support the first option. Might have to get some input from gogo on what the best way to do this would be and whether or not changing the behavior of SHIFT-ENTER to a <p class=....> would break anything else.
-----------------------------------------------------------------------------------------
Content Management with Business Intelligence [url]http://www.formvista.com[/url]
Offline
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.
Offline
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.
Gotcha. Makes sense. As far as the code goes Xinha intercepts ENTER keypresses in firefox .. so in order for this to work it would have to intercept both enter and shift-enter on both browsers. The EnterParagraphs plugins, which is already automatically loaded, is where the actual work of adding the class attributes goes.
I've got a test case working but still have to track down a few things.
-----------------------------------------------------------------------------------------
Content Management with Business Intelligence [url]http://www.formvista.com[/url]
Offline
dhscompguy wrote:When we're working with a WYSIWYG editor, we usually assume the same thing, even though publishing electronically is something quite different indeed. It's not well-defined. There is no such thing as a "page." These are old constructs... residual mind-garbage. We should dump that mode of backwards thinking.
We should simply tell users that this is a new medium and it doesn't work the same way as a typewriter, rather than caving into the caveman-demands of "ME WANT LINEBREAK! OOGA BOOGA!"
You have to give customers what they want. I agree that doing away with linebreaks is probably the technically correct thing to do, but it is nevertheless not what customers want. A customer wants to hit "ENTER" and have it act like a word processor. The people who actually use Xinha in real life applications typically have no markup background whatsoever ... for instance my users typically have a little word processing experience and little else. I receive alot of complaints and questions about the "double newline problem".
Sorry Yermo, I disagree. I've never had a problem teaching users to do "shift-enter" to get a line break. Certainly (in my case) the majority of users understand that they are on a computer, not a type writer, and a minor concession is not a problem.
On the other hand, I can appreciate your point. All I would ask is that _if_ it's decided that <enter> should do a line break instead of a new paragraph, that I have the ability to turn this off (to stay very consistent).
Offline