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:
How to add a custom 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.

 


spiralspy
New User

Feb 11, 2005, 1:33 AM

Post #1 of 4 (2652 views)
Shortcut
How to add a custom function? Can't Post

Hi guys,

I need to add a custom function that does very much the same as insertimage (which i customized). Do i need to change htmlarea.js to add a custom function, or is the a way to do this differently?
I am adding a button through

Code
registerButton

... please help!

Thanks

Tongue


miziomon
New User

Feb 11, 2005, 1:37 AM

Post #2 of 4 (2649 views)
Shortcut
Re: [spiralspy] How to add a custom function? [In reply to] Can't Post

 
try to write a plugin ...

in the plugin directory you can find very nice exsample ....


spiralspy
New User

Feb 11, 2005, 1:42 AM

Post #3 of 4 (2640 views)
Shortcut
Re: [miziomon] How to add a custom function? [In reply to] Can't Post

 ... and then? what function do i call?


Code
editor.config.registerButton("insertdoclink", "Insert a Document as link", "images/ed_killword.gif", false, function(editor) {});


tnx


miziomon
New User

Feb 11, 2005, 1:50 AM

Post #4 of 4 (2636 views)
Shortcut
Re: [spiralspy] How to add a custom function? [In reply to] Can't Post

this in yout custom plugin ...

Code
var cfg = editor.config; 
cfg.registerButton({
id : "openbutton",
tooltip : "Open",
image : editor.imgURL("ed_open.gif", "savebutton"),
textMode : false,
action : function(editor) {
self.open_buttonPress(editor);
}
})

var a, i, j, found = false;
for (i = 0; !found && i < toolbar.length; ++i) {
a = toolbar;
for (j = 0; j < a.length; ++j) {
if (a[j] == "justifyleft") {
found = true;
break;
}
}
}
if (found)
a.splice(j, 0, "separator","openbutton","separator");
//a.splice(j, 0, "openbutton");
else{
toolbar[1].splice(0, 0, "separator");
toolbar[1].splice(0, 0, "savebutton");
//toolbar[1].splice(0, 0, "openbutton");
}


and then your custom function

Code
savebutton.prototype.open_buttonPress = function(editor) { 
alert('this is my custom function')

}


you can see and try to modify in CharacterMap plugin ..
this add a button in tollbar and run custom function

good luck

 
 
 


Search for (options)