--- /dev/null
+/**\r
+ * Charmap plugin\r
+ * by Christophe Dolivet\r
+ * v0.1 (2006/09/22)\r
+ * \r
+ * \r
+ * This plugin allow to use a visual keyboard allowing to insert any UTF-8 characters in the text.\r
+ * \r
+ * - plugin name to add to the plugin list: "charmap"\r
+ * - plugin name to add to the toolbar list: "charmap" \r
+ * - possible parameters to add to EditAreaLoader.init(): \r
+ * "charmap_default": (String) define the name of the default character range displayed on popup display\r
+ * (default: "arrows")\r
+ * \r
+ * \r
+ */\r
+ \r
+var EditArea_charmap= {\r
+ /**\r
+ * Get called once this file is loaded (editArea still not initialized)\r
+ *\r
+ * @return nothing \r
+ */ \r
+ init: function(){ \r
+ this.default_language="Arrows";\r
+ }\r
+ \r
+ /**\r
+ * Returns the HTML code for a specific control string or false if this plugin doesn't have that control.\r
+ * A control can be a button, select list or any other HTML item to present in the EditArea user interface.\r
+ * Language variables such as {$lang_somekey} will also be replaced with contents from\r
+ * the language packs.\r
+ * \r
+ * @param {string} ctrl_name: the name of the control to add \r
+ * @return HTML code for a specific control or false.\r
+ * @type string or boolean\r
+ */ \r
+ ,get_control_html: function(ctrl_name){\r
+ switch(ctrl_name){\r
+ case "charmap":\r
+ // Control id, button img, command\r
+ return parent.editAreaLoader.get_button_html('charmap_but', 'charmap.gif', 'charmap_press', false, this.baseURL);\r
+ }\r
+ return false;\r
+ }\r
+ /**\r
+ * Get called once EditArea is fully loaded and initialised\r
+ * \r
+ * @return nothing\r
+ */ \r
+ ,onload: function(){ \r
+ if(editArea.settings["charmap_default"] && editArea.settings["charmap_default"].length>0)\r
+ this.default_language= editArea.settings["charmap_default"];\r
+ }\r
+ \r
+ /**\r
+ * Is called each time the user touch a keyboard key.\r
+ * \r
+ * @param (event) e: the keydown event\r
+ * @return true - pass to next handler in chain, false - stop chain execution\r
+ * @type boolean \r
+ */\r
+ ,onkeydown: function(e){\r
+ \r
+ }\r
+ \r
+ /**\r
+ * Executes a specific command, this function handles plugin commands.\r
+ *\r
+ * @param {string} cmd: the name of the command being executed\r
+ * @param {unknown} param: the parameter of the command \r
+ * @return true - pass to next handler in chain, false - stop chain execution\r
+ * @type boolean \r
+ */\r
+ ,execCommand: function(cmd, param){\r
+ // Handle commands\r
+ switch(cmd){\r
+ case "charmap_press":\r
+ win= window.open(this.baseURL+"popup.html", "charmap", "width=500,height=270,scrollbars=yes,resizable=yes");\r
+ win.focus();\r
+ return false;\r
+ }\r
+ // Pass to next handler in chain\r
+ return true;\r
+ }\r
+ \r
+};\r
+\r
+// Adds the plugin class to the list of available EditArea plugins\r
+editArea.add_plugin("charmap", EditArea_charmap);\r