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:
Parent Object in Fullscreen


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.

 


DJFerrari
New User

Jan 3, 2005, 1:01 PM

Post #1 of 2 (2512 views)
Shortcut
Parent Object in Fullscreen Can't Post

I developed a CMS app for my company and released a beta to a few testers and the main complaint is that it is too slow. The problem is that the format of the CMS can have an unlimited number of textareas. To see an example of a page that gets created, go to: http://www.palmsource.com/interests/games/

There is one object of HtmlArea for each item there, so loading time gets bogged down. I've been trying to work out a way for the main page that lists all textareas to not create objects, but rather in fullscreen.html. I just want a link above each textarea to read 'Edit Text' and open up fullscreen.html with the editor. Naturally, the raw html would need to update in the parent textarea.

My guess is that I need to customize this line somehow:

parent_object = opener.HTMLArea._object;

Does anyone have an idea how to get parent_object without there being one on the opener? Any other ideas on how to go about this? Thanks in advance for any help.


enoor
New User

Feb 6, 2005, 2:27 PM

Post #2 of 2 (2407 views)
Shortcut
Re: [DJFerrari] Parent Object in Fullscreen [In reply to] Can't Post

I'm not sure I understand your question, but I think I faced the same issue today. Here's what I did:

In the parent:

Code
<html> 
<head>
<script language="javascript">
function setVal(i, v) {
var elt = document.getElementById(i);
elt.value = v;
}
</script>
</head>
<body>
<form>
<textarea rows=10 cols=80 id='i1' name='t1'>
Hello, world!
</textarea>
<a href="#" onclick="open('childurl.html?i1','editorw','resizable=yes,width=750,height=550');">Edit</a>
...


and in the child (which I copied from examples/empty.html):



Code
  <head> 
<title>HTMLArea 3.0 core test</title>
</head>
<body>
<textarea id="editor"
rows="20" cols="80"
style="width: 100%; height: 80%"></textarea>

<script type="text/javascript">
var from = location.search.substr(1); // get fld id
var eltf = opener.document.getElementById(from);
var eltt = document.getElementById("editor");
eltt.value=eltf.value;
</script>

<script type="text/javascript">
_editor_url = "/htmlarea/";
_editor_lang = "en";
</script>

<script type="text/javascript" src="/htmlarea/htmlarea.js"></script>
<script type="text/javascript">
var editor;
HTMLArea.loadPlugin("ContextMenu");
HTMLArea.onload = function() {
editor = new HTMLArea("editor");
editor.registerPlugin(ContextMenu);
editor.generate();
};
HTMLArea.init();
</script>

<a href="#" onClick="if (confirm('Are you sure?')) window.close()">Cancel</a>
or
<a href="#" onClick="opener.setVal(from, editor.getHTML()); window.close()">Save</a>
...


Note that in the child I moved the declaration of var editor to the global scope, so that the cancel and save links can use the variable. I also moved the required javascript out of the HEAD tag into the BODY right after the textarea definition. This is so that the javascript that immediately follows can refer to the textarea using getElementById().

Hope this helps...

Aijaz Ansari
http://www.enoor.com

 
 
 


Search for (options)