htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: WYSIWYG Forums: WYSIWYG Editor Discussion:
solution: getting rtl to inherit in htmlarea 3.0


 


siber
New User

Sep 26, 2008, 6:12 AM

Post #1 of 1 (33021 views)
Shortcut
solution: getting rtl to inherit in htmlarea 3.0 Can't Post

i know this is old unsupported tech, but those of us still having to maintain it might appreciate this text direction fix...

to inherit text direction from your hidden textarea:
where htmlarea makes the iframe contents, change line 732 from:


Code
			var html = "<html>\n"; 
html += "<head>\n";
html += "<style>" + editor.config.pageStyle + "</style>\n";
html += "</head>\n";
html += "<body>\n";
html += editor._textArea.value;
html += "</body>\n";
html += "</html>";


to:


Code
			var html = "<html>\n"; 
html += "<head>\n";
html += "<style>" + editor.config.pageStyle + "</style>\n";
html += "</head>\n";

// 2008.09.26 -- hack for rtl inheritance
if (editor._textArea.style.direction == "rtl") {
html += '<body style="direction:rtl">'+"\n";
} else {
html += "<body>\n";
}

html += editor._textArea.value;
html += "</body>\n";
html += "</html>";


now all you need to do to get rtl on queue is set your textarea style to 'direction:rtl' and htmlarea will insert it into your body style as required.

hope this helps someone!


(This post was edited by siber on Sep 26, 2008, 6:14 AM)

 
 
 


Search for (options)