PageRenderTime 36ms CodeModel.GetById 26ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/BlogEngine/BlogEngine.NET/editors/tiny_mce_3_4_3_1/plugins/advimage/editor_plugin_src.js

#
JavaScript | 50 lines | 32 code | 5 blank | 13 comment | 2 complexity | 5134485db327459f7b10de273b50a5e8 MD5 | raw file
 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})();