PageRenderTime 82ms CodeModel.GetById 40ms app.highlight 4ms RepoModel.GetById 37ms app.codeStats 0ms

/static/scripts/tiny_mce/plugins/advimage/editor_plugin_src.js

http://n23.googlecode.com/
JavaScript | 47 lines | 32 code | 5 blank | 10 comment | 2 complexity | 4c15525a256e0fb08f378423611efe4f MD5 | raw file
 1/**
 2 * $Id: editor_plugin_src.js 677 2008-03-07 13:52:41Z spocke $
 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})();