Line # Revision Author
1 3 ahitrov@rambler.ru /**
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.AdvancedHRPlugin', {
13 init : function(ed, url) {
14 // Register commands
15 ed.addCommand('mceAdvancedHr', function() {
16 ed.windowManager.open({
17 file : url + '/rule.htm',
18 width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)),
19 height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)),
20 inline : 1
21 }, {
22 plugin_url : url
23 });
24 });
25
26 // Register buttons
27 ed.addButton('advhr', {
28 title : 'advhr.advhr_desc',
29 cmd : 'mceAdvancedHr'
30 });
31
32 ed.onNodeChange.add(function(ed, cm, n) {
33 cm.setActive('advhr', n.nodeName == 'HR');
34 });
35
36 ed.onClick.add(function(ed, e) {
37 e = e.target;
38
39 if (e.nodeName === 'HR')
40 ed.selection.select(e);
41 });
42 },
43
44 getInfo : function() {
45 return {
46 longname : 'Advanced HR',
47 author : 'Moxiecode Systems AB',
48 authorurl : 'http://tinymce.moxiecode.com',
49 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',
50 version : tinymce.majorVersion + "." + tinymce.minorVersion
51 };
52 }
53 });
54
55 // Register plugin
56 tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin);
57 })();