applied my changes - initial import
[boxroom-stian.git] / public / javascripts / tiny_mce / plugins / zoom / editor_plugin_src.js
blob8cc6ff07b17832dff117dd047c5a5b31fafda38e
1 /**\r
2  * $Id: editor_plugin_src.js 126 2006-10-22 16:19:55Z spocke $\r
3  *\r
4  * @author Moxiecode\r
5  * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.\r
6  */\r
7 \r
8 var TinyMCE_ZoomPlugin = {\r
9         getInfo : function() {\r
10                 return {\r
11                         longname : 'Zoom',\r
12                         author : 'Moxiecode Systems AB',\r
13                         authorurl : 'http://tinymce.moxiecode.com',\r
14                         infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_zoom.html',\r
15                         version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion\r
16                 };\r
17         },\r
19         /**\r
20          * Returns the HTML contents of the zoom control.\r
21          */\r
22         getControlHTML : function(control_name) {\r
23                 if (!tinyMCE.isMSIE || tinyMCE.isMSIE5_0 || tinyMCE.isOpera)\r
24                         return "";\r
26                 switch (control_name) {\r
27                         case "zoom":\r
28                                 return '<select id="{$editor_id}_zoomSelect" 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
29                                                 '<option value="100%">+ 100%</option>' + \r
30                                                 '<option value="150%">+ 150%</option>' + \r
31                                                 '<option value="200%">+ 200%</option>' + \r
32                                                 '<option value="250%">+ 250%</option>' + \r
33                                                 '</select>';\r
34                 }\r
36                 return "";\r
37         },\r
39         /**\r
40          * Executes the mceZoom command.\r
41          */\r
42         execCommand : function(editor_id, element, command, user_interface, value) {\r
43                 // Handle commands\r
44                 switch (command) {\r
45                         case "mceZoom":\r
46                                 tinyMCE.getInstanceById(editor_id).contentDocument.body.style.zoom = value;\r
47                                 tinyMCE.getInstanceById(editor_id).contentDocument.body.style.mozZoom = value;\r
48                                 return true;\r
49                 }\r
51                 // Pass to next handler in chain\r
52                 return false;\r
53         }\r
54 };\r
56 tinyMCE.addPlugin("zoom", TinyMCE_ZoomPlugin);\r