]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - include/javascript/tiny_mce/plugins/advimage/editor_plugin_src.js
Release 6.2.0beta4
[Github/sugarcrm.git] / include / javascript / tiny_mce / plugins / advimage / editor_plugin_src.js
1 /**
2
3  *
4  * @author Moxiecode
5  * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6  */
7
8 (function() {
9         tinymce.create('tinymce.plugins.AdvancedImagePlugin', {
10                 init : function(ed, url) {
11                         // Register commands
12                         ed.addCommand('mceAdvImage', function() {
13                                 // Internal image object like a flash placeholder
14                                 if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1)
15                                         return;
16
17                                 ed.windowManager.open({
18                                         file : url + '/image.htm',
19                                         width : 480 + parseInt(ed.getLang('advimage.delta_width', 0)),
20                                         height : 385 + parseInt(ed.getLang('advimage.delta_height', 0)),
21                                         inline : 1
22                                 }, {
23                                         plugin_url : url
24                                 });
25                         });
26
27                         // Register buttons
28                         ed.addButton('image', {
29                                 title : 'advimage.image_desc',
30                                 cmd : 'mceAdvImage'
31                         });
32                 },
33
34                 getInfo : function() {
35                         return {
36                                 longname : 'Advanced image',
37                                 author : 'Moxiecode Systems AB',
38                                 authorurl : 'http://tinymce.moxiecode.com',
39                                 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage',
40                                 version : tinymce.majorVersion + "." + tinymce.minorVersion
41                         };
42                 }
43         });
44
45         // Register plugin
46         tinymce.PluginManager.add('advimage', tinymce.plugins.AdvancedImagePlugin);
47 })();