1 | /**
|
---|
2 | * editor_plugin_src.js
|
---|
3 | *
|
---|
4 | * Copyright 2009, Moxiecode Systems AB
|
---|
5 | * Released under LGPL License.
|
---|
6 | *
|
---|
7 | * License: http://tinymce.moxiecode.com/license
|
---|
8 | * Contributing: http://tinymce.moxiecode.com/contributing
|
---|
9 | */
|
---|
10 |
|
---|
11 | (function() {
|
---|
12 | tinymce.create('tinymce.plugins.AdvancedImagePlugin', {
|
---|
13 | init : function(ed, url) {
|
---|
14 | // Register commands
|
---|
15 | ed.addCommand('mceAdvImage', function() {
|
---|
16 | // Internal image object like a flash placeholder
|
---|
17 | if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1)
|
---|
18 | return;
|
---|
19 |
|
---|
20 | ed.windowManager.open({
|
---|
21 | file : url + '/image.htm',
|
---|
22 | width : 480 + parseInt(ed.getLang('advimage.delta_width', 0)),
|
---|
23 | height : 385 + parseInt(ed.getLang('advimage.delta_height', 0)),
|
---|
24 | inline : 1
|
---|
25 | }, {
|
---|
26 | plugin_url : url
|
---|
27 | });
|
---|
28 | });
|
---|
29 |
|
---|
30 | // Register buttons
|
---|
31 | ed.addButton('image', {
|
---|
32 | title : 'advimage.image_desc',
|
---|
33 | cmd : 'mceAdvImage'
|
---|
34 | });
|
---|
35 | },
|
---|
36 |
|
---|
37 | getInfo : function() {
|
---|
38 | return {
|
---|
39 | longname : 'Advanced image',
|
---|
40 | author : 'Moxiecode Systems AB',
|
---|
41 | authorurl : 'http://tinymce.moxiecode.com',
|
---|
42 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage',
|
---|
43 | version : tinymce.majorVersion + "." + tinymce.minorVersion
|
---|
44 | };
|
---|
45 | }
|
---|
46 | });
|
---|
47 |
|
---|
48 | // Register plugin
|
---|
49 | tinymce.PluginManager.add('advimage', tinymce.plugins.AdvancedImagePlugin);
|
---|
50 | })(); |
---|