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:
ContextMenu: disbale options in


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.

 


Spliffster
Novice

Apr 28, 2004, 9:27 AM

Post #1 of 3 (10663 views)
Shortcut
ContextMenu: disbale options in Can't Post

hi all,

Is it possible to disable certain options in the context menu (options i have removed from the toolbar should not show up in the context menu).

any idea ?

Cheers,
Simon


hubertus
User

Apr 29, 2004, 3:28 AM

Post #2 of 3 (10650 views)
Shortcut
Re: [Spliffster] ContextMenu: disbale options in [In reply to] Can't Post

Hi,

you can test if the toolbar option exists:

Code
 if(editor._toolbarObjects['button-name'])....

you can test if the toolbar option is enabled:

Code
 if(editor._toolbarObjects['button-name'].enabled)....


Example for cut copy paste:
old:

Code
	if (selection) 
menu.push([ i18n["Cut"], function() { editor.execCommand("cut"); }, null, config.btnList["cut"][1] ],
[ i18n["Copy"], function() { editor.execCommand("copy"); }, null, config.btnList["copy"][1] ]);
menu.push([ i18n["Paste"], function() { editor.execCommand("paste"); }, null, config.btnList["paste"][1] ]);

new:

Code
	if (selection) { 
if(editor._toolbarObjects['cut']&&editor._toolbarObjects['cut'].enabled)menu.push([ i18n_n["cut"], function() { editor.execCommand("cut"); }, null, config.btnList["cut"][1] ]);
if(editor._toolbarObjects['copy']&&editor._toolbarObjects['copy'].enabled)menu.push([ i18n_n["copy"], function() { editor.execCommand("copy"); }, null, config.btnList["copy"][1] ]);
}
if(editor._toolbarObjects['paste']&&editor._toolbarObjects['paste'].enabled)menu.push([ i18n_n["paste"], function() { editor.execCommand("paste"); }, null, config.btnList["paste"][1] ]);


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


Spliffster
Novice

Apr 29, 2004, 6:33 AM

Post #3 of 3 (10647 views)
Shortcut
Re: [hubertus] ContextMenu: disbale options in [In reply to] Can't Post

Hubertus,

you are the man ;) Herzlichen Dank!

couldn't this be an option that should go into the context menu by default (or optionally configurable simmilar to the way HTMLArea.Config works)?

Cheers from switzerland,
Simon

 
 
 


Search for (options)