]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-includes/js/tinymce/plugins/wphelp/editor_plugin.js
Wordpress 2.0.2-scripts
[autoinstalls/wordpress.git] / wp-includes / js / tinymce / plugins / wphelp / editor_plugin.js
1 /* Import plugin specific language pack */\r
2 tinyMCE.importPluginLanguagePack('wphelp', '');\r
3 \r
4 function TinyMCE_wphelp_getControlHTML(control_name) {\r
5         switch (control_name) {\r
6                 case "wphelp":\r
7                         var titleHelp = tinyMCE.getLang('lang_help_button_title');\r
8                         var buttons = '<a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceWordPressHelp\')" target="_self" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceWordPressHelp\');return false;"><img id="{$editor_id}_help" src="{$pluginurl}/images/help.gif" title="'+titleHelp+'" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" /></a>';\r
9                         var hiddenControls = '<div class="zerosize">'\r
10                         + '<input type="button" accesskey="b" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Bold\',false);" />'\r
11                         + '<input type="button" accesskey="i" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Italic\',false);" />'\r
12                         + '<input type="button" accesskey="d" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Strikethrough\',false);" />'\r
13                         + '<input type="button" accesskey="l" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'InsertUnorderedList\',false);" />'\r
14                         + '<input type="button" accesskey="o" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'InsertOrderedList\',false);" />'\r
15                         + '<input type="button" accesskey="w" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Outdent\',false);" />'\r
16                         + '<input type="button" accesskey="q" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Indent\',false);" />'\r
17                         + '<input type="button" accesskey="f" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'JustifyLeft\',false);" />'\r
18                         + '<input type="button" accesskey="c" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'JustifyCenter\',false);" />'\r
19                         + '<input type="button" accesskey="r" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'JustifyRight\',false);" />'\r
20                         + '<input type="button" accesskey="a" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceLink\',true);" />'\r
21                         + '<input type="button" accesskey="s" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'unlink\',false);" />'\r
22                         + '<input type="button" accesskey="m" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceImage\',true);" />'\r
23                         + '<input type="button" accesskey="t" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpressmore\');" />'\r
24                         + '<input type="button" accesskey="u" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Undo\',false);" />'\r
25                         + '<input type="button" accesskey="y" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Redo\',false);" />'\r
26                         + '<input type="button" accesskey="e" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceCodeEditor\',false);" />'\r
27                         + '<input type="button" accesskey="h" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceWordPressHelp\',false);" />'\r
28                         + '</div>';\r
29                         return buttons+hiddenControls;\r
30     }\r
31 \r
32     return "";\r
33 }\r
34 \r
35 function TinyMCE_wphelp_execCommand(editor_id, element, command, user_interface, value) {\r
36 \r
37         // Handle commands\r
38         switch (command) {\r
39                 case "mceWordPressHelp":\r
40                         var template = new Array();\r
41 \r
42                         template['file']   = tinyMCE.baseURL + '/wp-mce-help.php';\r
43                         template['width']  = 480;\r
44                         template['height'] = 380;\r
45 \r
46                         args = {\r
47                                 resizable : 'yes',\r
48                                 scrollbars : 'yes'\r
49                         };\r
50 \r
51                         tinyMCE.openWindow(template, args);\r
52                         return true;\r
53         }\r
54 \r
55         // Pass to next handler in chain\r
56         return false;\r
57 }\r