PageRenderTime 25ms CodeModel.GetById 20ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://n23.googlecode.com/
JavaScript | 54 lines | 38 code | 7 blank | 9 comment | 2 complexity | 5f1de09b4eaa80923857093fe1fe0c5a MD5 | raw file
 1/**
 2 * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z 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.AdvancedHRPlugin', {
10		init : function(ed, url) {
11			// Register commands
12			ed.addCommand('mceAdvancedHr', function() {
13				ed.windowManager.open({
14					file : url + '/rule.htm',
15					width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)),
16					height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)),
17					inline : 1
18				}, {
19					plugin_url : url
20				});
21			});
22
23			// Register buttons
24			ed.addButton('advhr', {
25				title : 'advhr.advhr_desc',
26				cmd : 'mceAdvancedHr'
27			});
28
29			ed.onNodeChange.add(function(ed, cm, n) {
30				cm.setActive('advhr', n.nodeName == 'HR');
31			});
32
33			ed.onClick.add(function(ed, e) {
34				e = e.target;
35
36				if (e.nodeName === 'HR')
37					ed.selection.select(e);
38			});
39		},
40
41		getInfo : function() {
42			return {
43				longname : 'Advanced HR',
44				author : 'Moxiecode Systems AB',
45				authorurl : 'http://tinymce.moxiecode.com',
46				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',
47				version : tinymce.majorVersion + "." + tinymce.minorVersion
48			};
49		}
50	});
51
52	// Register plugin
53	tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin);
54})();