3 * by Christophe Dolivet
\r
7 * This plugin allow to use a visual keyboard allowing to insert any UTF-8 characters in the text.
\r
9 * - plugin name to add to the plugin list: "charmap"
\r
10 * - plugin name to add to the toolbar list: "charmap"
\r
11 * - possible parameters to add to EditAreaLoader.init():
\r
12 * "charmap_default": (String) define the name of the default character range displayed on popup display
\r
13 * (default: "arrows")
\r
18 var EditArea_charmap= {
\r
20 * Get called once this file is loaded (editArea still not initialized)
\r
25 this.default_language="Arrows";
\r
29 * Returns the HTML code for a specific control string or false if this plugin doesn't have that control.
\r
30 * A control can be a button, select list or any other HTML item to present in the EditArea user interface.
\r
31 * Language variables such as {$lang_somekey} will also be replaced with contents from
\r
32 * the language packs.
\r
34 * @param {string} ctrl_name: the name of the control to add
\r
35 * @return HTML code for a specific control or false.
\r
36 * @type string or boolean
\r
38 ,get_control_html: function(ctrl_name){
\r
41 // Control id, button img, command
\r
42 return parent.editAreaLoader.get_button_html('charmap_but', 'charmap.gif', 'charmap_press', false, this.baseURL);
\r
47 * Get called once EditArea is fully loaded and initialised
\r
51 ,onload: function(){
\r
52 if(editArea.settings["charmap_default"] && editArea.settings["charmap_default"].length>0)
\r
53 this.default_language= editArea.settings["charmap_default"];
\r
57 * Is called each time the user touch a keyboard key.
\r
59 * @param (event) e: the keydown event
\r
60 * @return true - pass to next handler in chain, false - stop chain execution
\r
63 ,onkeydown: function(e){
\r
68 * Executes a specific command, this function handles plugin commands.
\r
70 * @param {string} cmd: the name of the command being executed
\r
71 * @param {unknown} param: the parameter of the command
\r
72 * @return true - pass to next handler in chain, false - stop chain execution
\r
75 ,execCommand: function(cmd, param){
\r
78 case "charmap_press":
\r
79 win= window.open(this.baseURL+"popup.html", "charmap", "width=500,height=270,scrollbars=yes,resizable=yes");
\r
83 // Pass to next handler in chain
\r
89 // Adds the plugin class to the list of available EditArea plugins
\r
90 editArea.add_plugin("charmap", EditArea_charmap);
\r