annotate WebContent/jscripts/tiny_mce/plugins/advhr/editor_plugin_src.js @ 5:0be9d53a6967

editor for annotations
author dwinter
date Tue, 13 Dec 2011 17:43:46 +0100
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
1 /**
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
2 * editor_plugin_src.js
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
3 *
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
4 * Copyright 2009, Moxiecode Systems AB
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
5 * Released under LGPL License.
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
6 *
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
7 * License: http://tinymce.moxiecode.com/license
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
8 * Contributing: http://tinymce.moxiecode.com/contributing
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
9 */
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
10
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
11 (function() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
12 tinymce.create('tinymce.plugins.AdvancedHRPlugin', {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
13 init : function(ed, url) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
14 // Register commands
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
15 ed.addCommand('mceAdvancedHr', function() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
16 ed.windowManager.open({
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
17 file : url + '/rule.htm',
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
18 width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)),
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
19 height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)),
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
20 inline : 1
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
21 }, {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
22 plugin_url : url
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
23 });
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
24 });
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
25
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
26 // Register buttons
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
27 ed.addButton('advhr', {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
28 title : 'advhr.advhr_desc',
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
29 cmd : 'mceAdvancedHr'
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
30 });
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
31
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
32 ed.onNodeChange.add(function(ed, cm, n) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
33 cm.setActive('advhr', n.nodeName == 'HR');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
34 });
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
35
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
36 ed.onClick.add(function(ed, e) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
37 e = e.target;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
38
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
39 if (e.nodeName === 'HR')
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
40 ed.selection.select(e);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
41 });
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
42 },
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
43
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
44 getInfo : function() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
45 return {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
46 longname : 'Advanced HR',
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
47 author : 'Moxiecode Systems AB',
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
48 authorurl : 'http://tinymce.moxiecode.com',
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
49 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
50 version : tinymce.majorVersion + "." + tinymce.minorVersion
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
51 };
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
52 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
53 });
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
54
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
55 // Register plugin
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
56 tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
57 })();