2 * editor_template_src.js
4 * Copyright 2009, Moxiecode Systems AB
5 * Released under LGPL License.
7 * License: http://tinymce.moxiecode.com/license
8 * Contributing: http://tinymce.moxiecode.com/contributing
12 var DOM
= tinymce
.DOM
;
14 // Tell it to load theme specific language pack(s)
15 tinymce
.ThemeManager
.requireLangPack('simple');
17 tinymce
.create('tinymce.themes.SimpleTheme', {
18 init : function(ed
, url
) {
19 var t
= this, states
= ['Bold', 'Italic', 'Underline', 'Strikethrough', 'InsertUnorderedList', 'InsertOrderedList'], s
= ed
.settings
;
22 ed
.contentCSS
.push(url
+ "/skins/" + s
.skin
+ "/content.css");
24 ed
.onInit
.add(function() {
25 ed
.onNodeChange
.add(function(ed
, cm
) {
26 tinymce
.each(states
, function(c
) {
27 cm
.get(c
.toLowerCase()).setActive(ed
.queryCommandState(c
));
32 DOM
.loadCSS((s
.editor_css
? ed
.documentBaseURI
.toAbsolute(s
.editor_css
) : '') || url
+ "/skins/" + s
.skin
+ "/ui.css");
35 renderUI : function(o
) {
36 var t
= this, n
= o
.targetNode
, ic
, tb
, ed
= t
.editor
, cf
= ed
.controlManager
, sc
;
38 n
= DOM
.insertAfter(DOM
.create('span', {id
: ed
.id
+ '_container', 'class' : 'mceEditor ' + ed
.settings
.skin
+ 'SimpleSkin'}), n
);
39 n
= sc
= DOM
.add(n
, 'table', {cellPadding
: 0, cellSpacing
: 0, 'class' : 'mceLayout'});
40 n
= tb
= DOM
.add(n
, 'tbody');
42 // Create iframe container
43 n
= DOM
.add(tb
, 'tr');
44 n
= ic
= DOM
.add(DOM
.add(n
, 'td'), 'div', {'class' : 'mceIframeContainer'});
46 // Create toolbar container
47 n
= DOM
.add(DOM
.add(tb
, 'tr', {'class' : 'last'}), 'td', {'class' : 'mceToolbar mceLast', align
: 'center'});
50 tb
= t
.toolbar
= cf
.createToolbar("tools1");
51 tb
.add(cf
.createButton('bold', {title
: 'simple.bold_desc', cmd
: 'Bold'}));
52 tb
.add(cf
.createButton('italic', {title
: 'simple.italic_desc', cmd
: 'Italic'}));
53 tb
.add(cf
.createButton('underline', {title
: 'simple.underline_desc', cmd
: 'Underline'}));
54 tb
.add(cf
.createButton('strikethrough', {title
: 'simple.striketrough_desc', cmd
: 'Strikethrough'}));
55 tb
.add(cf
.createSeparator());
56 tb
.add(cf
.createButton('undo', {title
: 'simple.undo_desc', cmd
: 'Undo'}));
57 tb
.add(cf
.createButton('redo', {title
: 'simple.redo_desc', cmd
: 'Redo'}));
58 tb
.add(cf
.createSeparator());
59 tb
.add(cf
.createButton('cleanup', {title
: 'simple.cleanup_desc', cmd
: 'mceCleanup'}));
60 tb
.add(cf
.createSeparator());
61 tb
.add(cf
.createButton('insertunorderedlist', {title
: 'simple.bullist_desc', cmd
: 'InsertUnorderedList'}));
62 tb
.add(cf
.createButton('insertorderedlist', {title
: 'simple.numlist_desc', cmd
: 'InsertOrderedList'}));
67 editorContainer
: ed
.id
+ '_container',
73 getInfo : function() {
75 longname
: 'Simple theme',
76 author
: 'Moxiecode Systems AB',
77 authorurl
: 'http://tinymce.moxiecode.com',
78 version
: tinymce
.majorVersion
+ "." + tinymce
.minorVersion
83 tinymce
.ThemeManager
.add('simple', tinymce
.themes
.SimpleTheme
);