adding all weblabels from weblabels.fsf.org
[weblabels.fsf.org.git] / www.fsf.org / 20131028 / files / plugins / ploneimage / editor_plugin.js
CommitLineData
5a920362 1/**\r
2 * Plone image plugin based on advimage plugin.\r
3 *\r
4 * @author Rob Gietema\r
5 */\r
6\r
7(function() {\r
8 tinymce.create('tinymce.plugins.PloneImagePlugin', {\r
9 init : function(ed, url) {\r
10 // Register commands\r
11 ed.addCommand('mcePloneImage', function() {\r
12 // Internal image object like a flash placeholder\r
13 if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1)\r
14 return;\r
15\r
16 ed.windowManager.open({\r
17 file : url + '/ploneimage.htm',\r
18 width : 820 + parseInt(ed.getLang('ploneimage.delta_width', 0)),\r
19 height : 500 + parseInt(ed.getLang('ploneimage.delta_height', 0)),\r
20 inline : 1\r
21 }, {\r
22 plugin_url : url\r
23 });\r
24 });\r
25\r
26 // Register buttons\r
27 ed.addButton('image', {\r
28 title : 'advanced.image_desc',\r
29 cmd : 'mcePloneImage'\r
30 });\r
31 },\r
32\r
33 getInfo : function() {\r
34 return {\r
35 longname : 'Plone image',\r
36 author : 'Rob Gietema',\r
37 authorurl : 'http://plone.org',\r
38 infourl : 'http://plone.org/products/tinymce',\r
39 version : tinymce.majorVersion + "." + tinymce.minorVersion\r
40 };\r
41 }\r
42 });\r
43\r
44 // Register plugin\r
45 tinymce.PluginManager.add('ploneimage', tinymce.plugins.PloneImagePlugin);\r
46})();