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