equal
deleted
inserted
replaced
|
1 /** |
|
2 * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ |
|
3 * |
|
4 * @author Moxiecode |
|
5 * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved. |
|
6 */ |
|
7 |
|
8 /* Import theme specific language pack */ |
|
9 tinyMCE.importPluginLanguagePack('print'); |
|
10 |
|
11 var TinyMCE_PrintPlugin = { |
|
12 getInfo : function() { |
|
13 return { |
|
14 longname : 'Print', |
|
15 author : 'Moxiecode Systems AB', |
|
16 authorurl : 'http://tinymce.moxiecode.com', |
|
17 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print', |
|
18 version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion |
|
19 }; |
|
20 }, |
|
21 |
|
22 getControlHTML : function(cn) { |
|
23 switch (cn) { |
|
24 case "print": |
|
25 return tinyMCE.getButtonHTML(cn, 'lang_print_desc', '{$pluginurl}/images/print.gif', 'mcePrint'); |
|
26 } |
|
27 |
|
28 return ""; |
|
29 }, |
|
30 |
|
31 /** |
|
32 * Executes the search/replace commands. |
|
33 */ |
|
34 execCommand : function(editor_id, element, command, user_interface, value) { |
|
35 // Handle commands |
|
36 switch (command) { |
|
37 case "mcePrint": |
|
38 tinyMCE.getInstanceById(editor_id).contentWindow.print(); |
|
39 return true; |
|
40 } |
|
41 |
|
42 // Pass to next handler in chain |
|
43 return false; |
|
44 } |
|
45 }; |
|
46 |
|
47 tinyMCE.addPlugin("print", TinyMCE_PrintPlugin); |