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 - Add-Ons:
Template function


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.

 


kneten
Novice

Apr 17, 2004, 4:33 AM

Post #1 of 8 (23394 views)
Shortcut
Template function Can't Post

Ive switched from htmlarea 2.03 to 3.0 rct version because it also works with mozilla.

I have one problem though....im looking for a function thats makes it possible to insert empty templates. I had a function like that to v2.03 but i havent found one yet for v3.0!!!!

If someone has that function please share it with me!!!


kimss
User

Apr 17, 2004, 7:11 AM

Post #2 of 8 (23386 views)
Shortcut
Re: [kneten] Template function [In reply to] Can't Post

You probably know this, but you could easilly make this function with the insertHTML function which already exists in the V3 system. You could probably port the system from V2 to V3 easilly (for IE that is). If youre looking for a finnished one Im sure someone will create one sooner or later.

Kim Steinhaug
kim-at-steinhaug-dot-com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Norwegian office : +47 88 00 92 45, Swedish office : +46 31 704 43 40
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


kneten
Novice

Apr 18, 2004, 2:17 PM

Post #3 of 8 (23364 views)
Shortcut
Re: [kimss] Template function [In reply to] Can't Post

Hello again... im trying to imply the template function from v2.03 to v3.0. And everything works fine until im choosing template. When i click on a template i get

error: object expected

The code im implyed in htmlarea.js is this:


Code
   case "template": { 
window.clipboardData.clearData();
this._doc.execCommand('SelectAll');
this._doc.execCommand('cut');
var objname = location.search.substring(1,location.search.length);
var myTitle = "";
var myText = showModalDialog(_editor_url + "popups/insert_template.shtml?"+objname,myTitle,"resizable: yes; help: no; status: no; scroll: no; ");
if (myText) { editor_insertHTML(objname, unescape( myText) );
nullBorders(editor_obj.contentWindow.document,'show');
config.showborders = true;
}
else this._doc.execCommand('paste');
}
break;

the error message is caused by either of the boldmarked rows in the code.....do anyone know what im doing wrong???


hubertus
User

Apr 19, 2004, 1:41 AM

Post #4 of 8 (23349 views)
Shortcut
Re: [kneten] Template function [In reply to] Can't Post

Hi,


Code
  if (myText) { editor_insertHTML(objname, unescape( myText) );

There is no function editor_insertHTML in v3.0
if objname is an editor-object call the function as:

Code
  objname.insertHTML(unescape( myText));



Code
   nullBorders(editor_obj.contentWindow.document,'show');

Up to this time there is no function nullBorders in v3.0

Hubertus
----------------------
CMS with HTMLArea (Username: testuser Password: test):
http://www.sundes.de/sundes_wcg/
HTMLArea direct(choose "Textinhalt"):
http://www.sundes.de/cgi-bin/sundes_wcg/egert.pl?layout&kundendir=gastzugang&idlog=RMNaNcMRMcLa2NP

http://www.sundes.de - http://www.hubertus-egert.de


kneten
Novice

Apr 19, 2004, 4:02 AM

Post #5 of 8 (23344 views)
Shortcut
Re: [hubertus] Template function [In reply to] Can't Post

hi....thanks for your help! i solved it by implying this code in htmlarea.js


Code
   case "template": { 
window.clipboardData.clearData();
this._doc.execCommand('SelectAll');
this._doc.execCommand('cut');
var objname = location.search.substring(1,location.search.length);
var myTitle = "";
var myText = showModalDialog(_editor_url + "popups/insert_template.shtml",myTitle,"resizable: yes; help: no; status: no; scroll: no; ");
if (myText) { this.insertHTML(unescape( myText) );

this.showborders = true;
}
else this._doc.execCommand('paste');
}
break;

maybe not the best solution but it works!!!! Now i can insert templates in htmlarea v3.0


hubertus
User

Apr 19, 2004, 4:45 AM

Post #6 of 8 (23338 views)
Shortcut
Re: [kneten] Template function [In reply to] Can't Post

Hi again,

ok thats fine, but now I don't see the usage of objname and of this.showborders.
I also think it must be this.config.showborders.

Hubertus
----------------------
CMS with HTMLArea (Username: testuser Password: test):
http://www.sundes.de/sundes_wcg/
HTMLArea direct(choose "Textinhalt"):
http://www.sundes.de/cgi-bin/sundes_wcg/egert.pl?layout&kundendir=gastzugang&idlog=RMNaNcMRMcLa2NP

http://www.sundes.de - http://www.hubertus-egert.de


kneten
Novice

Apr 19, 2004, 4:54 AM

Post #7 of 8 (23336 views)
Shortcut
Re: [hubertus] Template function [In reply to] Can't Post

hi again!!! your right....i didnt think of deleting useless code! so this is the new code!


Code
   case "template": { 
window.clipboardData.clearData();
this._doc.execCommand('SelectAll');
this._doc.execCommand('cut');
var myTitle = "";
var myText = showModalDialog(_editor_url + "popups/insert_template.shtml",myTitle,"resizable: yes; help: no; status: no; scroll: no; ");
if (myText) { this.insertHTML(unescape( myText) );
}
else this._doc.execCommand('paste');
}
break;

if you notice more code that is useless...please let me know! Javascript is not my strongest area Wink


sulleleven
Novice

Aug 2, 2004, 11:41 AM

Post #8 of 8 (22765 views)
Shortcut
Re: [kneten] Template function [In reply to] Can't Post

is this template solution for version3 based on what is implemented here?

http://www.webstationone.com/test/htmlarea/

I would like to get the insert template (html) function going in htmlarea3 as well.

thanks.

 
 
 


Search for (options)