annotate WebContent/jscripts/tiny_mce/plugins/style/editor_plugin_src.js @ 10:0bdfe01e30b5

checking auth token works now.
author casties
date Tue, 20 Mar 2012 15:55:51 +0100
parents 0be9d53a6967
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.StylePlugin', {
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('mceStyleProps', function() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
16 ed.windowManager.open({
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
17 file : url + '/props.htm',
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
18 width : 480 + parseInt(ed.getLang('style.delta_width', 0)),
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
19 height : 320 + parseInt(ed.getLang('style.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 style_text : ed.selection.getNode().style.cssText
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
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
27 ed.addCommand('mceSetElementStyle', function(ui, v) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
28 if (e = ed.selection.getNode()) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
29 ed.dom.setAttrib(e, 'style', v);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
30 ed.execCommand('mceRepaint');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
31 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
32 });
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
33
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
34 ed.onNodeChange.add(function(ed, cm, n) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
35 cm.setDisabled('styleprops', n.nodeName === 'BODY');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
36 });
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
37
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
38 // Register buttons
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
39 ed.addButton('styleprops', {title : 'style.desc', cmd : 'mceStyleProps'});
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
40 },
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
41
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
42 getInfo : function() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
43 return {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
44 longname : 'Style',
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
45 author : 'Moxiecode Systems AB',
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
46 authorurl : 'http://tinymce.moxiecode.com',
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
47 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style',
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
48 version : tinymce.majorVersion + "." + tinymce.minorVersion
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
49 };
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
50 }
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 // Register plugin
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
54 tinymce.PluginManager.add('style', tinymce.plugins.StylePlugin);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
55 })();