webcit_before_automake is now the trunk
[citadel.git] / webcit / tiny_mce / plugins / zoom / editor_plugin_src.js
1 /* Import plugin specific language pack */\r
2 \r
3 function TinyMCE_zoom_getInfo() {\r
4         return {\r
5                 longname : 'Zoom',\r
6                 author : 'Moxiecode Systems',\r
7                 authorurl : 'http://tinymce.moxiecode.com',\r
8                 infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_zoom.html',\r
9                 version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion\r
10         };\r
11 };\r
12 \r
13 /**\r
14  * Returns the HTML contents of the zoom control.\r
15  */\r
16 function TinyMCE_zoom_getControlHTML(control_name) {\r
17         if (!tinyMCE.isMSIE || tinyMCE.isMSIE5_0 || tinyMCE.isOpera)\r
18                 return "";\r
19 \r
20         switch (control_name) {\r
21                 case "zoom":\r
22                         return '<select id="{$editor_id}_formatSelect" name="{$editor_id}_zoomSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceZoom\',false,this.options[this.selectedIndex].value);" class="mceSelectList">\\r
23                                         <option value="100%">+ 100%</option>\\r
24                                         <option value="150%">+ 150%</option>\\r
25                                         <option value="200%">+ 200%</option>\\r
26                                         <option value="250%">+ 250%</option>\\r
27                                         </select>';\r
28         }\r
29 \r
30         return "";\r
31 }\r
32 \r
33 /**\r
34  * Executes the mceZoom command.\r
35  */\r
36 function TinyMCE_zoom_execCommand(editor_id, element, command, user_interface, value) {\r
37         // Handle commands\r
38         switch (command) {\r
39                 case "mceZoom":\r
40                         tinyMCE.getInstanceById(editor_id).contentDocument.body.style.zoom = value;\r
41                         tinyMCE.getInstanceById(editor_id).contentDocument.body.style.mozZoom = value;\r
42                         return true;\r
43         }\r
44 \r
45         // Pass to next handler in chain\r
46         return false;\r
47 }\r