htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 3 (beta): htmlArea 2 & 3 archive (read only): htmlArea v3.0 - Discussion:
Still Need Help Making insert horizontal line XHTML validate


The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.

 


Randyd
Novice

Dec 17, 2004, 6:47 PM

Post #1 of 5 (2818 views)
Shortcut
Still Need Help Making insert horizontal line XHTML validate Can't Post

UnsureI am using htmlarea 3.0 3.0 rc-1 with Wordpress 1.2.1 and I want to add the insert horizontal line tool but when I do it will not validate as XHTML.

Where do I hack the code to make this happen?



Thanks for your help.


(This post was edited by Randyd on Dec 21, 2004, 4:25 PM)


iamdecal
Novice

Dec 20, 2004, 5:08 AM

Post #2 of 5 (2796 views)
Shortcut
Re: [Randyd] Making insert horizontal line XHTML validate [In reply to] Can't Post

it works fine for me, what version are you using ?


however if you create a new function


function inserthorizontalrule() {editor.insertHTML('<hr />'); }}



or register a whole new button


editor.config.registerButton("my-hrul", "horizontal line", "images/ed_horizontal line.gif", false,
function(editor) {
insertHTML('<hr />');
}
);



you wont be far wrong


Randyd
Novice

Dec 20, 2004, 1:06 PM

Post #3 of 5 (2780 views)
Shortcut
Re: [iamdecal] Making insert horizontal line XHTML validate [In reply to] Can't Post

Iamdecal

Thanks for your response. Please forgive my ignorance but I am pretty new to this and don't really understand where to do that. Should I add your code to the htmlarea.js file or some other file.

I need some more specifics.

Thanks for understanding and for your help.


blainegarrett
Novice

Dec 20, 2004, 6:49 PM

Post #4 of 5 (2769 views)
Shortcut
Re: [Randyd] Making insert horizontal line XHTML validate [In reply to] Can't Post

It depends on how you are initializing your HTMLArea.

Here is one method:

Code
function initEditor() { 
//...

myeditor = new HTMLArea("textarea");
// Add the new button to the toolbar
myeditor.config.registerButton(
"my-hrul",
"horizontal line",
"images/ed_horizontal line.gif",
false,
function(editor) {
insertHTML('<hr />');
}
);

//put any other stuff for this instance of HTMLArea here...
myeditor.generate();
}


That should do the trick.

Edited to add code tags.
Blaine Garrett
Chief Web Applications Developer
JR Computer Associates INC
http://jrcorps.com
http://blainegarrett.com

(This post was edited by blainegarrett on Dec 20, 2004, 6:50 PM)


Randyd
Novice

Dec 21, 2004, 8:56 AM

Post #5 of 5 (2743 views)
Shortcut
Re: [blainegarrett] Making insert horizontal line XHTML validate [In reply to] Can't Post

OK, I figured it out. For Wordpress 1.2.1 you have to add the following code to the edit-form-advanced.php file after the line <!-- load the main HTMLArea file -->

//Horizontal Line button
config.registerButton({
id : "horizontalrule", // the ID of your button
tooltip : "Insert More Marker", // the tooltip
image : "htmlarea/images/ed_hr.gif", // image to be displayed in the toolbar
textMode : false, // disabled in text mode
action : function(editor) { // called when the button is clicked
editor.insertHTML("<hr><p><p />");
},
context : "p" // will be disabled if outside a <p> element
});
//end Horizontal Line

_______

Then you have to add your id of the button "horizontalrule" to the line beginning with: config.toolbar = ...

What I have found in my browser (ie6) is that you can't use the hrizontal line tool to start a paragraph but with the code above, you can use it inbetween paragraphs and at the end of paragraphs for it to validate as XHTML.


(This post was edited by Randyd on Dec 22, 2004, 2:24 PM)

 
 
 


Search for (options)