source: trunk/plugins/LocalFilesEditor/editarea/plugins/charmap/charmap.js @ 5160

Last change on this file since 5160 was 5160, checked in by patdenice, 14 years ago

Editor
Update editarea to 0.8.2.
Remove CSS tab.
Fix jQuery path.

File size: 2.7 KB
Line 
1/**
2 * Charmap plugin
3 * by Christophe Dolivet
4 * v0.1 (2006/09/22)
5 *
6 *   
7 * This plugin allow to use a visual keyboard allowing to insert any UTF-8 characters in the text.
8 *
9 * - plugin name to add to the plugin list: "charmap"
10 * - plugin name to add to the toolbar list: "charmap"
11 * - possible parameters to add to EditAreaLoader.init():
12 *              "charmap_default": (String) define the name of the default character range displayed on popup display
13 *                                                      (default: "arrows")
14 *
15 *
16 */
17   
18var EditArea_charmap= {
19        /**
20         * Get called once this file is loaded (editArea still not initialized)
21         *
22         * @return nothing       
23         */                     
24        init: function(){       
25                this.default_language="Arrows";
26        }
27       
28        /**
29         * Returns the HTML code for a specific control string or false if this plugin doesn't have that control.
30         * A control can be a button, select list or any other HTML item to present in the EditArea user interface.
31         * Language variables such as {$lang_somekey} will also be replaced with contents from
32         * the language packs.
33         *
34         * @param {string} ctrl_name: the name of the control to add     
35         * @return HTML code for a specific control or false.
36         * @type string or boolean
37         */     
38        ,get_control_html: function(ctrl_name){
39                switch(ctrl_name){
40                        case "charmap":
41                                // Control id, button img, command
42                                return parent.editAreaLoader.get_button_html('charmap_but', 'charmap.gif', 'charmap_press', false, this.baseURL);
43                }
44                return false;
45        }
46        /**
47         * Get called once EditArea is fully loaded and initialised
48         *       
49         * @return nothing
50         */                     
51        ,onload: function(){ 
52                if(editArea.settings["charmap_default"] && editArea.settings["charmap_default"].length>0)
53                        this.default_language= editArea.settings["charmap_default"];
54        }
55       
56        /**
57         * Is called each time the user touch a keyboard key.
58         *       
59         * @param (event) e: the keydown event
60         * @return true - pass to next handler in chain, false - stop chain execution
61         * @type boolean         
62         */
63        ,onkeydown: function(e){
64               
65        }
66       
67        /**
68         * Executes a specific command, this function handles plugin commands.
69         *
70         * @param {string} cmd: the name of the command being executed
71         * @param {unknown} param: the parameter of the command 
72         * @return true - pass to next handler in chain, false - stop chain execution
73         * @type boolean       
74         */
75        ,execCommand: function(cmd, param){
76                // Handle commands
77                switch(cmd){
78                        case "charmap_press":
79                                win= window.open(this.baseURL+"popup.html", "charmap", "width=500,height=270,scrollbars=yes,resizable=yes");
80                                win.focus();
81                                return false;
82                }
83                // Pass to next handler in chain
84                return true;
85        }
86       
87};
88
89// Adds the plugin class to the list of available EditArea plugins
90editArea.add_plugin("charmap", EditArea_charmap);
Note: See TracBrowser for help on using the repository browser.