annotate WebContent/jscripts/tiny_mce/themes/simple/editor_template_src.js @ 6:5bb7cc86069c

restlet.jar
author dwinter
date Wed, 14 Mar 2012 16:21:45 +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_template_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 var DOM = tinymce.DOM;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
13
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
14 // Tell it to load theme specific language pack(s)
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
15 tinymce.ThemeManager.requireLangPack('simple');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
16
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
17 tinymce.create('tinymce.themes.SimpleTheme', {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
18 init : function(ed, url) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
19 var t = this, states = ['Bold', 'Italic', 'Underline', 'Strikethrough', 'InsertUnorderedList', 'InsertOrderedList'], s = ed.settings;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
20
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
21 t.editor = ed;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
22 ed.contentCSS.push(url + "/skins/" + s.skin + "/content.css");
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
23
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
24 ed.onInit.add(function() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
25 ed.onNodeChange.add(function(ed, cm) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
26 tinymce.each(states, function(c) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
27 cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
28 });
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
29 });
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 DOM.loadCSS((s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : '') || url + "/skins/" + s.skin + "/ui.css");
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
33 },
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
34
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
35 renderUI : function(o) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
36 var t = this, n = o.targetNode, ic, tb, ed = t.editor, cf = ed.controlManager, sc;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
37
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
38 n = DOM.insertAfter(DOM.create('span', {id : ed.id + '_container', 'class' : 'mceEditor ' + ed.settings.skin + 'SimpleSkin'}), n);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
39 n = sc = DOM.add(n, 'table', {cellPadding : 0, cellSpacing : 0, 'class' : 'mceLayout'});
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
40 n = tb = DOM.add(n, 'tbody');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
41
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
42 // Create iframe container
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
43 n = DOM.add(tb, 'tr');
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
44 n = ic = DOM.add(DOM.add(n, 'td'), 'div', {'class' : 'mceIframeContainer'});
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
45
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
46 // Create toolbar container
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
47 n = DOM.add(DOM.add(tb, 'tr', {'class' : 'last'}), 'td', {'class' : 'mceToolbar mceLast', align : 'center'});
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
48
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
49 // Create toolbar
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
50 tb = t.toolbar = cf.createToolbar("tools1");
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
51 tb.add(cf.createButton('bold', {title : 'simple.bold_desc', cmd : 'Bold'}));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
52 tb.add(cf.createButton('italic', {title : 'simple.italic_desc', cmd : 'Italic'}));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
53 tb.add(cf.createButton('underline', {title : 'simple.underline_desc', cmd : 'Underline'}));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
54 tb.add(cf.createButton('strikethrough', {title : 'simple.striketrough_desc', cmd : 'Strikethrough'}));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
55 tb.add(cf.createSeparator());
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
56 tb.add(cf.createButton('undo', {title : 'simple.undo_desc', cmd : 'Undo'}));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
57 tb.add(cf.createButton('redo', {title : 'simple.redo_desc', cmd : 'Redo'}));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
58 tb.add(cf.createSeparator());
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
59 tb.add(cf.createButton('cleanup', {title : 'simple.cleanup_desc', cmd : 'mceCleanup'}));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
60 tb.add(cf.createSeparator());
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
61 tb.add(cf.createButton('insertunorderedlist', {title : 'simple.bullist_desc', cmd : 'InsertUnorderedList'}));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
62 tb.add(cf.createButton('insertorderedlist', {title : 'simple.numlist_desc', cmd : 'InsertOrderedList'}));
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
63 tb.renderTo(n);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
64
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
65 return {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
66 iframeContainer : ic,
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
67 editorContainer : ed.id + '_container',
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
68 sizeContainer : sc,
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
69 deltaHeight : -20
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
70 };
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
71 },
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
72
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
73 getInfo : function() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
74 return {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
75 longname : 'Simple theme',
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
76 author : 'Moxiecode Systems AB',
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
77 authorurl : 'http://tinymce.moxiecode.com',
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
78 version : tinymce.majorVersion + "." + tinymce.minorVersion
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
79 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
80 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
81 });
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
82
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
83 tinymce.ThemeManager.add('simple', tinymce.themes.SimpleTheme);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
84 })();