* Re-added tiny_mce, this time with the language packs
[citadel.git] / webcit / tiny_mce / plugins / advlink / editor_plugin_src.js
blobfc5325a9677066a1cabb3ad64fdf481f9c2f056d
1 /**\r
2  * $Id: editor_plugin_src.js 539 2008-01-14 19:08:58Z spocke $\r
3  *\r
4  * @author Moxiecode\r
5  * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.\r
6  */\r
7 \r
8 (function() {\r
9         tinymce.create('tinymce.plugins.AdvancedLinkPlugin', {\r
10                 init : function(ed, url) {\r
11                         this.editor = ed;\r
13                         // Register commands\r
14                         ed.addCommand('mceAdvLink', function() {\r
15                                 var se = ed.selection;\r
17                                 // No selection and not in link\r
18                                 if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A'))\r
19                                         return;\r
21                                 ed.windowManager.open({\r
22                                         file : url + '/link.htm',\r
23                                         width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)),\r
24                                         height : 400 + parseInt(ed.getLang('advlink.delta_height', 0)),\r
25                                         inline : 1\r
26                                 }, {\r
27                                         plugin_url : url\r
28                                 });\r
29                         });\r
31                         // Register buttons\r
32                         ed.addButton('link', {\r
33                                 title : 'advlink.link_desc',\r
34                                 cmd : 'mceAdvLink'\r
35                         });\r
37                         ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink');\r
39                         ed.onNodeChange.add(function(ed, cm, n, co) {\r
40                                 cm.setDisabled('link', co && n.nodeName != 'A');\r
41                                 cm.setActive('link', n.nodeName == 'A' && !n.name);\r
42                         });\r
43                 },\r
45                 getInfo : function() {\r
46                         return {\r
47                                 longname : 'Advanced link',\r
48                                 author : 'Moxiecode Systems AB',\r
49                                 authorurl : 'http://tinymce.moxiecode.com',\r
50                                 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink',\r
51                                 version : tinymce.majorVersion + "." + tinymce.minorVersion\r
52                         };\r
53                 }\r
54         });\r
56         // Register plugin\r
57         tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin);\r
58 })();