4561,5023c4561
< dom.setStyle(b, 'width', t.getStyle('width', 1));
< dom.setStyle(b, 'height', t.getStyle('height', 1));
< dom.setStyle(b, 'display', t.getStyle('display', 1));
< dom.setStyle(b, 'zIndex', parseInt(t.getStyle('zIndex', 1) || 0) - 1);
< }
< }
<
< });
< })(tinymce);
< (function(tinymce) {
< function trimNl(s) {
< return s.replace(/[\n\r]+/g, '');
< };
<
< // Shorten names
< var is = tinymce.is, isIE = tinymce.isIE, each = tinymce.each;
<
< tinymce.create('tinymce.dom.Selection', {
< Selection : function(dom, win, serializer) {
< var t = this;
<
< t.dom = dom;
< t.win = win;
< t.serializer = serializer;
<
< // Add events
< each([
< 'onBeforeSetContent',
< 'onBeforeGetContent',
< 'onSetContent',
< 'onGetContent'
< ], function(e) {
< t[e] = new tinymce.util.Dispatcher(t);
< });
<
< // No W3C Range support
< if (!t.win.getSelection)
< t.tridentSel = new tinymce.dom.TridentSelection(t);
<
< // Prevent leaks
< tinymce.addUnload(t.destroy, t);
< },
<
< getContent : function(s) {
< var t = this, r = t.getRng(), e = t.dom.create("body"), se = t.getSel(), wb, wa, n;
<
< s = s || {};
< wb = wa = '';
< s.get = true;
< s.format = s.format || 'html';
< t.onBeforeGetContent.dispatch(t, s);
<
< if (s.format == 'text')
< return t.isCollapsed() ? '' : (r.text || (se.toString ? se.toString() : ''));
<
< if (r.cloneContents) {
< n = r.cloneContents();
<
< if (n)
< e.appendChild(n);
< } else if (is(r.item) || is(r.htmlText))
< e.innerHTML = r.item ? r.item(0).outerHTML : r.htmlText;
< else
< e.innerHTML = r.toString();
<
< // Keep whitespace before and after
< if (/^\s/.test(e.innerHTML))
< wb = ' ';
<
< if (/\s+$/.test(e.innerHTML))
< wa = ' ';
<
< s.getInner = true;
<
< s.content = t.isCollapsed() ? '' : wb + t.serializer.serialize(e, s) + wa;
< t.onGetContent.dispatch(t, s);
<
< return s.content;
< },
<
< setContent : function(h, s) {
< var t = this, r = t.getRng(), c, d = t.win.document;
<
< s = s || {format : 'html'};
< s.set = true;
< h = s.content = t.dom.processHTML(h);
<
< // Dispatch before set content event
< t.onBeforeSetContent.dispatch(t, s);
< h = s.content;
<
< if (r.insertNode) {
< // Make caret marker since insertNode places the caret in the beginning of text after insert
< h += '_';
<
< // Delete and insert new node
< r.deleteContents();
< r.insertNode(t.getRng().createContextualFragment(h));
<
< // Move to caret marker
< c = t.dom.get('__caret');
<
< // Make sure we wrap it compleatly, Opera fails with a simple select call
< r = d.createRange();
< r.setStartBefore(c);
< r.setEndAfter(c);
< t.setRng(r);
<
< // Delete the marker, and hopefully the caret gets placed in the right location
< // Removed this since it seems to remove in FF and simply deleting it
< // doesn't seem to affect the caret position in any browser
< //d.execCommand('Delete', false, null);
<
< // Remove the caret position
< t.dom.remove('__caret');
< } else {
< if (r.item) {
< // Delete content and get caret text selection
< d.execCommand('Delete', false, null);
< r = t.getRng();
< }
<
< r.pasteHTML(h);
< }
<
< // Dispatch set content event
< t.onSetContent.dispatch(t, s);
< },
<
< getStart : function() {
< var t = this, r = t.getRng(), e;
<
< if (isIE) {
< if (r.item)
< return r.item(0);
<
< r = r.duplicate();
< r.collapse(1);
< e = r.parentElement();
<
< if (e && e.nodeName == 'BODY')
< return e.firstChild;
<
< return e;
< } else {
< e = r.startContainer;
<
< if (e.nodeName == 'BODY')
< return e.firstChild;
<
< return t.dom.getParent(e, '*');
< }
< },
<
< getEnd : function() {
< var t = this, r = t.getRng(), e;
<
< if (isIE) {
< if (r.item)
< return r.item(0);
<
< r = r.duplicate();
< r.collapse(0);
< e = r.parentElement();
<
< if (e && e.nodeName == 'BODY')
< return e.lastChild;
<
< return e;
< } else {
< e = r.endContainer;
<
< if (e.nodeName == 'BODY')
< return e.lastChild;
<
< return t.dom.getParent(e, '*');
< }
< },
<
< getBookmark : function(si) {
< var t = this, r = t.getRng(), tr, sx, sy, vp = t.dom.getViewPort(t.win), e, sp, bp, le, c = -0xFFFFFF, s, ro = t.dom.getRoot(), wb = 0, wa = 0, nv;
< sx = vp.x;
< sy = vp.y;
<
< // Simple bookmark fast but not as persistent
< if (si == 'simple')
< return {rng : r, scrollX : sx, scrollY : sy};
<
< // Handle IE
< if (isIE) {
< // Control selection
< if (r.item) {
< e = r.item(0);
<
< each(t.dom.select(e.nodeName), function(n, i) {
< if (e == n) {
< sp = i;
< return false;
< }
< });
<
< return {
< tag : e.nodeName,
< index : sp,
< scrollX : sx,
< scrollY : sy
< };
< }
<
< // Text selection
< tr = t.dom.doc.body.createTextRange();
< tr.moveToElementText(ro);
< tr.collapse(true);
< bp = Math.abs(tr.move('character', c));
<
< tr = r.duplicate();
< tr.collapse(true);
< sp = Math.abs(tr.move('character', c));
<
< tr = r.duplicate();
< tr.collapse(false);
< le = Math.abs(tr.move('character', c)) - sp;
<
< return {
< start : sp - bp,
< length : le,
< scrollX : sx,
< scrollY : sy
< };
< }
<
< // Handle W3C
< e = t.getNode();
< s = t.getSel();
<
< if (!s)
< return null;
<
< // Image selection
< if (e && e.nodeName == 'IMG') {
< return {
< scrollX : sx,
< scrollY : sy
< };
< }
<
< // Text selection
<
< function getPos(r, sn, en) {
< var w = t.dom.doc.createTreeWalker(r, NodeFilter.SHOW_TEXT, null, false), n, p = 0, d = {};
<
< while ((n = w.nextNode()) != null) {
< if (n == sn)
< d.start = p;
<
< if (n == en) {
< d.end = p;
< return d;
< }
<
< p += trimNl(n.nodeValue || '').length;
< }
<
< return null;
< };
<
< // Caret or selection
< if (s.anchorNode == s.focusNode && s.anchorOffset == s.focusOffset) {
< e = getPos(ro, s.anchorNode, s.focusNode);
<
< if (!e)
< return {scrollX : sx, scrollY : sy};
<
< // Count whitespace before
< trimNl(s.anchorNode.nodeValue || '').replace(/^\s+/, function(a) {wb = a.length;});
<
< return {
< start : Math.max(e.start + s.anchorOffset - wb, 0),
< end : Math.max(e.end + s.focusOffset - wb, 0),
< scrollX : sx,
< scrollY : sy,
< beg : s.anchorOffset - wb == 0
< };
< } else {
< e = getPos(ro, r.startContainer, r.endContainer);
<
< // Count whitespace before start and end container
< //(r.startContainer.nodeValue || '').replace(/^\s+/, function(a) {wb = a.length;});
< //(r.endContainer.nodeValue || '').replace(/^\s+/, function(a) {wa = a.length;});
<
< if (!e)
< return {scrollX : sx, scrollY : sy};
<
< return {
< start : Math.max(e.start + r.startOffset - wb, 0),
< end : Math.max(e.end + r.endOffset - wa, 0),
< scrollX : sx,
< scrollY : sy,
< beg : r.startOffset - wb == 0
< };
< }
< },
<
< moveToBookmark : function(b) {
< var t = this, r = t.getRng(), s = t.getSel(), ro = t.dom.getRoot(), sd, nvl, nv;
<
< function getPos(r, sp, ep) {
< var w = t.dom.doc.createTreeWalker(r, NodeFilter.SHOW_TEXT, null, false), n, p = 0, d = {}, o, v, wa, wb;
<
< while ((n = w.nextNode()) != null) {
< wa = wb = 0;
<
< nv = n.nodeValue || '';
< //nv.replace(/^\s+[^\s]/, function(a) {wb = a.length - 1;});
< //nv.replace(/[^\s]\s+$/, function(a) {wa = a.length - 1;});
<
< nvl = trimNl(nv).length;
< p += nvl;
<
< if (p >= sp && !d.startNode) {
< o = sp - (p - nvl);
<
< // Fix for odd quirk in FF
< if (b.beg && o >= nvl)
< continue;
<
< d.startNode = n;
< d.startOffset = o + wb;
< }
<
< if (p >= ep) {
< d.endNode = n;
< d.endOffset = ep - (p - nvl) + wb;
< return d;
< }
< }
<
< return null;
< };
<
< if (!b)
< return false;
<
< t.win.scrollTo(b.scrollX, b.scrollY);
<
< // Handle explorer
< if (isIE) {
< // Handle simple
< if (r = b.rng) {
< try {
< r.select();
< } catch (ex) {
< // Ignore
< }
<
< return true;
< }
<
< t.win.focus();
<
< // Handle control bookmark
< if (b.tag) {
< r = ro.createControlRange();
<
< each(t.dom.select(b.tag), function(n, i) {
< if (i == b.index)
< r.addElement(n);
< });
< } else {
< // Try/catch needed since this operation breaks when TinyMCE is placed in hidden divs/tabs
< try {
< // Incorrect bookmark
< if (b.start < 0)
< return true;
<
< r = s.createRange();
< r.moveToElementText(ro);
< r.collapse(true);
< r.moveStart('character', b.start);
< r.moveEnd('character', b.length);
< } catch (ex2) {
< return true;
< }
< }
<
< try {
< r.select();
< } catch (ex) {
< // Needed for some odd IE bug #1843306
< }
<
< return true;
< }
<
< // Handle W3C
< if (!s)
< return false;
<
< // Handle simple
< if (b.rng) {
< s.removeAllRanges();
< s.addRange(b.rng);
< } else {
< if (is(b.start) && is(b.end)) {
< try {
< sd = getPos(ro, b.start, b.end);
<
< if (sd) {
< r = t.dom.doc.createRange();
< r.setStart(sd.startNode, sd.startOffset);
< r.setEnd(sd.endNode, sd.endOffset);
< s.removeAllRanges();
< s.addRange(r);
< }
<
< if (!tinymce.isOpera)
< t.win.focus();
< } catch (ex) {
< // Ignore
< }
< }
< }
< },
<
< select : function(n, c) {
< var t = this, r = t.getRng(), s = t.getSel(), b, fn, ln, d = t.win.document;
<
< function find(n, start) {
< var walker, o;
<
< if (n) {
< walker = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false);
<
< // Find first/last non empty text node
< while (n = walker.nextNode()) {
< o = n;
<
< if (tinymce.trim(n.nodeValue).length != 0) {
< if (start)
< return n;
< else
< o = n;
< }
< }
< }
<
< return o;
< };
<
< if (isIE) {
< try {
< b = d.body;
<
< if (/^(IMG|TABLE)$/.test(n.nodeName)) {
< r = b.createControlRange();
< r.addElement(n);
< } else {
< r = b.createTextRange();
< r.moveToElementText(n);
< }
<
< r.select();
< } catch (ex) {
---
> dom.setSh (ex) {
5326,5328c4864
< this.inAttr = true;
< this.count++;
< this.elementCount = this.count;
---
> this.inAttr = true;rn this.editors[id];
5331,5334c4867,4868
< writeAttribute : function(n, v) {
< var t = this;
<
< t.writeRaw(" " + t.encode(n) + '="' + t.encode(v) + '"');
---
> getInstanceById : function(id) {
> return this.get(id);
5337,5344c4871,4873
< writeEndElement : function() {
< var n;
<
< if (this.tags.length > 0) {
< n = this.tags.pop();
<
< if (this._writeAttributesEnd(1))
< this.writeRaw('' + n + '>');
---
> add : function(e) {
> this.editors[e.id] = e;
> this._setActive(e);
5346,5348c4875
< if (this.settings.indentation > 0)
< this.writeRaw('\n');
< }
---
> return e;
5351,5357c4878,4881
< writeFullEndElement : function() {
< if (this.tags.length > 0) {
< this._writeAttributesEnd();
< this.writeRaw('' + this.tags.pop() + '>');
<
< if (this.settings.indentation > 0)
< this.writeRaw('\n');
---
> remove : function(e) {
> var t = this
@
@`?`@+ etActive(e);
> return false; // Break
> });
5359d4882
< },
5361,5365c4884
< writeText : function(v) {
< this._writeAttributesEnd();
< this.writeRaw(this.encode(v));
< this.count++;
< },
---
> e.destroy();
5367,5370c4886
< writeCDATA : function(v) {
< this._writeAttributesEnd();
< this.writeRaw('');
< this.count++;
---
> return e;
5373,5377c4889,4890
< writeComment : function(v) {
< this._writeAttributesEnd();
< this.writeRaw('');
< this.count++;
< },
---
> execCommand : function(c, u, v) {
> var t = this, ed = t.get(v), w;
5379,5381c4892,4896
< writeRaw : function(v) {
< this.str += v;
< },
---
> // Manager commands
> switch (c) {
> case "mceFocus":
> ed.focus();
> return true;
5383,5387c4898,4901
< encode : function(s) {
< return s.replace(/[<>&"]/g, function(v) {
< switch (v) {
< case '<':
< return '<';
---
> case "mceAddEditor":
> case "mceAddControl":
> if (!t.get(v))
> new tinymce.Editor(v, t.settings).render();
5389,5390c4903,5369
< case '>':
< return '>';
---
> return true;
>
> case "mceAddFrameControl":
> w = v.window;
>
> // Add tinyMCE global instance and tinymce namespace to specified window
> w.tinyMCE = tinyMCE;
> w.tinymce = tinymce;
>
> tinymce.DOM.doc = w.document;
> tinymce.DOM.win = w;
>
> ed = new tinymce.Editor(v.element_id, v);
> ed.render();
>
> // Fix IE memory leaks
> if (tinymce.isIE) {
> function clr() {
> ed.destroy();
> w.detachEvent('onunload', clr);
> w = w.tinyMCE = w.tinymce = null; // IE leak
> };
>
> w.attachEvent('onunload', clr);
> }
>
> v.page_window = null;
>
> return true;
>
> case "mceRemoveEditor":
> case "mceRemoveControl":
> if (ed)
> ed.remove();
>
> return true;
>
> case 'mceToggleEditor':
> if (!ed) {
> t.execCommand('mceAddControl', 0, v);
> return true;
> }
>
> if (ed.isHidden())
> ed.show();
> else
> ed.hide();
>
> return true;
> }
>
> // Run command on active editor
> if (t.activeEditor)
> return t.activeEditor.execCommand(c, u, v);
>
> return false;
> },
>
> execInstanceCommand : function(id, c, u, v) {
> var ed = this.get(id);
>
> if (ed)
> return ed.execCommand(c, u, v);
>
> return false;
> },
>
> triggerSave : function() {
> each(this.editors, function(e) {
> e.save();
> });
> },
>
> addI18n : function(p, o) {
> var lo, i18n = this.i18n;
>
> if (!tinymce.is(p, 'string')) {
> each(p, function(o, lc) {
> each(o, function(o, g) {
> each(o, function(o, k) {
> if (g === 'common')
> i18n[lc + '.' + k] = o;
> else
> i18n[lc + '.' + g + '.' + k] = o;
> });
> });
> });
> } else {
> each(o, function(o, k) {
> i18n[p + '.' + k] = o;
> });
> }
> },
>
> // Private methods
>
> _setActive : function(e) {
> this.selectedInstance = this.activeEditor = e;
> }
>
> });
>
> tinymce.EditorManager.preInit();
> })(tinymce);
>
> // Short for editor manager window.tinyMCE is needed when TinyMCE gets loaded though a XHR call
> var tinyMCE = window.tinyMCE = tinymce.EditorManager;
> (function(tinymce) {
> var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, Dispatcher = tinymce.util.Dispatcher;
> var each = tinymce.each, isGecko = tinymce.isGecko, isIE = tinymce.isIE, isWebKit = tinymce.isWebKit;
> var is = tinymce.is, ThemeManager = tinymce.ThemeManager, PluginManager = tinymce.PluginManager, EditorManager = tinymce.EditorManager;
> var inArray = tinymce.inArray, grep = tinymce.grep, explode = tinymce.explode;
>
> tinymce.create('tinymce.Editor', {
> Editor : function(id, s) {
> var t = this;
>
> t.id = t.editorId = id;
> t.execCommands = {};
> t.queryStateCommands = {};
> t.queryValueCommands = {};
> t.plugins = {};
>
> // Add events to the editor
> each([
> 'onPreInit',
> 'onBeforeRenderUI',
> 'onPostRender',
> 'onInit',
> 'onRemove',
> 'onActivate',
> 'onDeactivate',
> 'onClick',
> 'onEvent',
> 'onMouseUp',
> 'onMouseDown',
> 'onDblClick',
> 'onKeyDown',
> 'onKeyUp',
> 'onKeyPress',
> 'onContextMenu',
> 'onSubmit',
> 'onReset',
> 'onPaste',
> 'onPreProcess',
> 'onPostProcess',
> 'onBeforeSetContent',
> 'onBeforeGetContent',
> 'onSetContent',
> 'onGetContent',
> 'onLoadContent',
> 'onSaveContent',
> 'onNodeChange',
> 'onChange',
> 'onBeforeExecCommand',
> 'onExecCommand',
> 'onUndo',
> 'onRedo',
> 'onVisualAid',
> 'onSetProgressState'
> ], function(e) {
> t[e] = new Dispatcher(t);
> });
>
> // Default editor config
> t.settings = s = extend({
> id : id,
> language : 'en',
> docs_language : 'en',
> theme : 'simple',
> skin : 'default',
> delta_width : 0,
> delta_height : 0,
> popup_css : '',
> plugins : '',
> document_base_url : tinymce.documentBaseURL,
> add_form_submit_trigger : 1,
> submit_patch : 1,
> add_unload_trigger : 1,
> convert_urls : 1,
> relative_urls : 1,
> remove_script_host : 1,
> table_inline_editing : 0,
> object_resizing : 1,
> cleanup : 1,
> accessibility_focus : 1,
> custom_shortcuts : 1,
> custom_undo_redo_keyboard_shortcuts : 1,
> custom_undo_redo_restore_selection : 1,
> custom_undo_redo : 1,
> doctype : '',
> visual_table_class : 'mceItemTable',
> visual : 1,
> inline_styles : true,
> convert_fonts_to_spans : true,
> font_size_style_values : 'xx-small,x-small,small,medium,large,x-large,xx-large',
> apply_source_formatting : 1,
> directionality : 'ltr',
> forced_root_block : 'p',
> valid_elements : '@[id|class|style|title|dir
Content
') : val; --- > function set(e) { > each(v, function(v, k) { > ed.dom.setAttrib(e, k, v); > }); > }; 10411,10412c10379,10390 < if (val.indexOf('<') == -1) < val = '<' + val + '>'; --- > if (!e) { > ed.execCommand('CreateLink', false, 'javascript:mctmp(0);'); > each(ed.dom.select('a[href=javascript:mctmp(0);]'), function(e) { > set(e); > }); > } else { > if (v.href) > set(e); > else > ed.dom.remove(e, 1); > } > }, 10414,10415c10392,10393 < if (tinymce.isGecko) < val = val.replace(/<(div|blockquote|code|dt|dd|dl|samp)>/gi, '$1'); --- > UnLink : function() { > var ed = this.editor, s = ed.selection; 10417,10418c10395,10396 < ed.getDoc().execCommand('FormatBlock', false, val); < }, --- > if (s.isCollapsed()) > s.select(s.getNode()); 10420,10423c10398,10399 < mceCleanup : function() { < var ed = this.editor, s = ed.selection, b = s.getBookmark(); < ed.setContent(ed.getContent()); < s.moveToBookmark(b); --- > ed.getDoc().execCommand('unlink', false, null); > s.collapse(0); 10426,10431c10402,10403 < mceRemoveNode : function(ui, val) { < var ed = this.editor, s = ed.selection, b, n = val || s.getNode(); < < // Make sure that the body node isn't removed < if (n == ed.getBody()) < return; --- > FontName : function(u, v) { > var t = this, ed = t.editor, s = ed.selection, e; 10433,10436c10405,10413 < b = s.getBookmark(); < ed.dom.remove(n, 1); < s.moveToBookmark(b); < ed.nodeChanged(); --- > if (!v) { > if (s.isCollapsed()) > s.select(s.getNode()); > } else { > if (ed.settings.convert_fonts_to_spans) > t._applyInlineStyle('span', {style : {fontFamily : v}}); > else > ed.getDoc().execCommand('FontName', false, v); > } 10439,10440c10416,10417 < mceSelectNodeDepth : function(ui, val) { < var ed = this.editor, s = ed.selection, c = 0; --- > FontSize : function(u, v) { > var ed = this.editor, s = ed.settings, fc, fs; 10442,10449c10419,10428 < ed.dom.getParent(s.getNode(), function(n) { < if (n.nodeType == 1 && c++ == val) { < s.select(n); < ed.nodeChanged(); < return false; < } < }, ed.getBody()); < }, --- > // Use style options instead > if (s.convert_fonts_to_spans && v >= 1 && v <= 7) { > fs = tinymce.explode(s.font_size_style_values); > fc = tinymce.explode(s.font_size_classes); > > if (fc) > v = fc[v - 1] || v; > else > v = fs[v - 1] || v; > } 10451,10452c10430,10433 < mceSelectNode : function(u, v) { < this.editor.selection.select(v); --- > if (v >= 1 && v <= 7) > ed.getDoc().execCommand('FontSize', false, v); > else > this._applyInlineStyle('span', {style : {fontSize : v}}); 10455,10456c10436,10442 < mceInsertContent : function(ui, val) { < this.editor.selection.setContent(val); --- > queryCommandValue : function(c) { > var f = this['queryValue' + c]; > > if (f) > return f.call(this, c); > > return false; 10459,10460c10445,10446 < mceInsertRawHTML : function(ui, val) { < var ed = this.editor; --- > queryCommandState : function(cmd) { > var f; 10462,10463c10448,10452 < ed.selection.setContent('tiny_mce_marker'); < ed.setContent(ed.getContent().replace(/tiny_mce_marker/g, val)); --- > switch (cmd) { > // Bundle these together > case 'JustifyLeft': > case 'JustifyCenter': > etContent().replace(/tiny_mce_marker/g, val)); 10501,10502c10490,10619 < if ((n = ed.dom.getParent(ed.selection.getEnd(), ed.dom.isBlock)) && parseInt(n.style.paddingLeft) > 0) < return true; --- > if ((n = ed.dom.getParent(ed.selection.getEnd(), ed.dom.isBlock)) && parseInt(n.style.paddingLeft) > 0) > return true; > } > > return this.queryStateInsertUnorderedList() || this.queryStateInsertOrderedList() || (!ed.settings.inline_styles && !!ed.dom.getParent(ed.selection.getNode(), 'BLOCKQUOTE')); > }, > > queryStateInsertUnorderedList : function() { > return this.editor.dom.getParent(this.editor.selection.getNode(), 'UL'); > }, > > queryStateInsertOrderedList : function() { > return this.editor.dom.getParent(this.editor.selection.getNode(), 'OL'); > }, > > queryStatemceBlockQuote : function() { > return !!this.editor.dom.getParent(this.editor.selection.getStart(), function(n) {return n.nodeName === 'BLOCKQUOTE';}); > }, > > _applyInlineStyle : function(na, at, op) { > var t = this, ed = t.editor, dom = ed.dom, bm, lo = {}, kh, found; > > na = na.toUpperCase(); > > if (op && op.check_classes && at['class']) > op.check_classes.push(at['class']); > > function removeEmpty() { > each(dom.select(na).reverse(), function(n) { > var c = 0; > > // Check if there is any attributes > each(dom.getAttribs(n), function(an) { > if (an.nodeName.substring(0, 1) != '_' && dom.getAttrib(n, an.nodeName) != '') { > //console.log(dom.getOuterHTML(n), dom.getAttrib(n, an.nodeName)); > c++; > } > }); > > // No attributes then remove the element and keep the children > if (c == 0) > dom.remove(n, 1); > }); > }; > > function replaceFonts() { > var bm; > > each(dom.select('span,font'), function(n) { > if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline') { > if (!bm) > bm = ed.selection.getBookmark(); > > at._mce_new = '1'; > dom.replace(dom.create(na, at), n, 1); > } > }); > > // Remove redundant elements > each(dom.select(na + '[_mce_new]'), function(n) { > function removeStyle(n) { > if (n.nodeType == 1) { > each(at.style, function(v, k) { > dom.setStyle(n, k, ''); > }); > > // Remove spans with the same class or marked classes > if (at['class'] && n.className && op) { > each(op.check_classes, function(c) { > if (dom.hasClass(n, c)) > dom.removeClass(n, c); > }); > } > } > }; > > // Remove specified style information from child elements > each(dom.select(na, n), removeStyle); > > // Remove the specified style information on parent if current node is only child (IE) > if (n.parentNode && n.parentNode.nodeType == 1 && n.parentNode.childNodes.length == 1) > removeStyle(n.parentNode); > > // Remove the child elements style info if a parent already has it > dom.getParent(n.parentNode, function(pn) { > if (pn.nodeType == 1) { > if (at.style) { > each(at.style, function(v, k) { > var sv; > > if (!lo[k] && (sv = dom.getStyle(pn, k))) { > if (sv === v) > dom.setStyle(n, k, ''); > > lo[k] = 1; > } > }); > } > > // Remove spans with the same class or marked classes > if (at['class'] && pn.className && op) { > each(op.check_classes, function(c) { > if (dom.hasClass(pn, c)) > dom.removeClass(n, c); > }); > } > } > > return false; > }); > > n.removeAttribute('_mce_new'); > }); > > removeEmpty(); > ed.selection.moveToBookmark(bm); > > return !!bm; > }; > > // Create inline elements > ed.focus(); > ed.getDoc().execCommand('FontName', false, 'mceinline'); > replaceFonts(); > > if (kh = t._applyInlineStyle.keyhandler) { > ed.onKeyUp.remove(kh); > ed.onKeyPress.remove(kh); > ed.onKeyDown.remove(kh); > ed.onSetContent.remove(t._applyInlineStyle.chandler); 10505,10506c10622,10627 < return this.queryStateInsertUnorderedList() || this.queryStateInsertOrderedList() || (!ed.settings.inline_styles && !!ed.dom.getParent(ed.selection.getNode(), 'BLOCKQUOTE')); < }, --- > if (ed.selection.isCollapsed()) { > // IE will format the current word so this code can't be executed on that browser > if (!isIE) { > each(dom.getParents(ed.selection.getNode(), 'span'), function(n) { > each(at.style, function(v, k) { > var kv; 10508,10510c10629,10634 < queryStateInsertUnorderedList : function() { < return this.editor.dom.getParent(this.editor.selection.getNode(), 'UL'); < }, --- > if (kv = dom.getStyle(n, k)) { > if (kv == v) { > dom.setStyle(n, k, ''); > found = 2; > return false; > } 10512,10514c10636,10639 < queryStateInsertOrderedList : function() { < return this.editor.dom.getParent(this.editor.selection.getNode(), 'OL'); < }, --- > found = 1; > return false; > } > }); 10516,10517c10641,10642 < queryStatemceBlockQuote : function() { < return !!this.editor.dom.getParent(this.editor.selection.getStart(), function(n) {return n.nodeName === 'BLOCKQUOTE';}); --- > if (found) > entNode; 10520,10530c10645,10646 < _applyInlineStyle : function(na, at, op) { < var t = this, ed = t.editor, dom = ed.dom, bm, lo = {}, kh, found; < < na = na.toUpperCase(); < < if (op && op.check_classes && at['class']) < op.check_classes.push(at['class']); < < function removeEmpty() { < each(dom.select(na).reverse(), function(n) { < var c = 0; --- > writeFullEndElement : function() { > var t = this, n = t.node; 10532,10536c10648,10650 < // Check if there is any attributes < each(dom.getAttribs(n), function(an) { < if (an.nodeName.substring(0, 1) != '_' && dom.getAttrib(n, an.nodeName) != '') { < //console.log(dom.getOuterHTML(n), dom.getAttrib(n, an.nodeName)); < c++ DOM.setAttrib(e, 'id', v); --- > n.appendChild(t.doc.createTextNode("")); > )@``@W`@createCDATA(v)); > }, 10538,10541c10652,10655 < ed = new tinymce.Editor(v, s); < el.push(ed); < ed.rendei@`` : DOM.hasClass(n, c); < }; --- > writeComment : function(v) { > // Fix for bug #2035694 > if (tinymce.isIE) > v = v.replace(/^\-|\-$/g, ' '); 10543,10545c10657,10658 < each(DOM.select('textarea'), function(v) { < if (s.editor_deselector && hasClass(v, s.editor_deselector)) < return; --- > this.node.appendChild(this.doc.createComment(v.replace(/\-\-/g, ' '))); > }, 10547,10551c10660,10661 < if (!s.editor_selector || hasClass(v, s.editor_selector)) { < // Can we use the name < e = DOM.get(v.name); < if (!v.id && !e) < v.id = v.name; --- > getContent : function() { > var h; 10553,10555c10663,10665 < // Generate unique name if missing or already exists < if (!v.id || t.get(v.id)) < v.id = DOM.uniqueId(); --- > h = this.doc.xml || new XMLSerializer().serializeToString(this.doc); > h = h.replace(/<\?[^?]+\?>||<\/html>|
|]+>/g, ''); > h = h.replace(/ ?\/>/g, ' />'); 10557,10563c10667,10668 < ed = new tinymce.Editor(v.id, s); < el.push(ed); < ed.render(1); < } < }); < break; < } --- > if (this.valid) > h = h.replace(/\%MCGT%/g, '>'); 10565,10567c10670,10671 < // Call onInit when all editors are initialized < if (s.oninit) { < l = co = 0; --- > return h; > } 10569,10570c10673,10681 < each (el, function(ed) { < co++; --- > }); > })(tinymce); > (function(tinymce) { > tinymce.create('tinymce.dom.StringWriter', { > str : null, > tags : null, > count : 0, > settings : null, > indent : null, 10572,10575c10683,10687 < if (!ed.initialized) { < // Wait for it < ed.onInit.add(function() { < l++; --- > StringWriter : function(s) { > this.settings = tinymce.extend({ > indent_char : ' ', > indentation : 1 > }, s); 10577,10582c10689,10690 < // All done < if (l == co) < execCallback(s, 'oninit'); < }); < } else < l++; --- > this.reset(); > }, 10584,10589c10692,10696 < // All done < if (l == co) < execCallback(s, 'oninit'); < }); < } < }); --- > reset : function() { > this.indent = ''; > this.str = ""; > this.tags = []; > this.count = 0; 10592,10593c10699,10703 < get : function(id) { < return this.editors[id]; --- > writeStartElement : function(n) { > this._writeAttributesEnd(); > this.writeRaw('<' + n); > this.tags.push(n); > this.inAttr = true;rn this.editors[id]; 10608,10619c10718 < var t = this; < < // Not in the collection < if (!t.editors[e.id]) < return null; < < delete t.editors[e.id]; < < // Select another editor since the active one was removed < if (t.activeEditor == e) { < each(t.editors, function(e) { < t._setActive(e); --- > var t = this @ @`?`@+ etActive(e); 10810,10964c10909,10941 < language : 'en', < docs_language : 'en', < theme : 'simple', < skin : 'default', < delta_width : 0, < delta_height : 0, < popup_css : '', < plugins : '', < document_base_url : tinymce.documentBaseURL, < add_form_submit_trigger : 1, < submit_patch : 1, < add_unload_trigger : 1, < convert_urls : 1, < relative_urls : 1, < remove_script_host : 1, < table_inline_editing : 0, < object_resizing : 1, < cleanup : 1, < accessibility_focus : 1, < custom_shortcuts : 1, < custom_undo_redo_keyboard_shortcuts : 1, < custom_undo_redo_restore_selection : 1, < custom_undo_redo : 1, < doctype : '', < visual_table_class : 'mceItemTable', < visual : 1, < inline_styles : true, < convert_fonts_to_spans : true, < font_size_style_values : 'xx-small,x-small,small,medium,large,x-large,xx-large', < apply_source_formatting : 1, < directionality : 'ltr', < forced_root_block : 'p', < valid_elements : '@[id|class|style|title|dirContent
< // FF and Opera doesn't change parent DIV elements if you switch format < if (bl) { < if ((isIE && isBlock(bl.parentNode)) || bl.nodeName == 'DIV') { < // Rename block element < nb = ed.dom.create(val); < < each(dom.getAttribs(bl), function(v) { < dom.setAttrib(nb, v.nodeName, dom.getAttrib(bl, v.nodeName)); < }); < < b = s.getBookmark(); < dom.replace(nb, bl, 1); < s.moveToBookmark(b); < ed.nodeChanged(); < return; < } < } < < val = ed.settings.forced_root_block ? (val || '') : val;
<
< if (val.indexOf('<') == -1)
< val = '<' + val + '>';
<
< if (tinymce.isGecko)
< val = val.replace(/<(div|blockquote|code|dt|dd|dl|samp)>/gi, '$1');
<
< ed.getDoc().execCommand('FormatBlock', false, val);
< },
<
< mceCleanup : function() {
< var ed = this.editor, s = ed.selection, b = s.getBookmark();
< ed.setContent(ed.getContent());
< s.moveToBookmark(b);
< },
<
< mceRemoveNode : function(ui, val) {
< var ed = this.editor, s = ed.selection, b, n = val || s.getNode();
<
< // Make sure that the body node isn't removed
< if (n == ed.getBody())
< return;
<
< b = s.getBookmark();
< ed.dom.remove(n, 1);
< s.moveToBookmark(b);
< ed.nodeChanged();
< },
<
< mceSelectNodeDepth : function(ui, val) {
< var ed = this.editor, s = ed.selection, c = 0;
<
< ed.dom.getParent(s.getNode(), function(n) {
< if (n.nodeType == 1 && c++ == val) {
< s.select(n);
< ed.nodeChanged();
< return false;
< }
< }, ed.getBody());
< },
<
< mceSelectNode : function(u, v) {
< this.editor.selection.select(v);
< },
<
< mceInsertContent : function(ui, val) {
< this.editor.selection.setContent(val);
< },
<
< mceInsertRawHTML : function(ui, val) {
< var ed = this.editor;
<
< ed.selection.setContent('tiny_mce_marker');
< ed.setContent(ed.getContent().replace(/tiny_mce_marker/g, val));
< },
<
< mceRepaint : function() {
< var s, b, e = this.editor;
<
< if (tinymce.isGecko) {
< try {
< s = e.selection;
< b = s.getBookmark(true);
<
< if (s.getSel())
< s.getSel().selectAllChildren(e.getBody());
<
< s.collapse(true);
< s.moveToBookmark(b);
< } catch (ex) {
< // Ignore
< }
< }
< },
<
< queryStateUnderline : function() {
< var ed = this.editor, n = ed.selection.getNode();
<
< if (n && n.nodeName == 'A')
< return false;
<
< return this._queryState('Underline');
< },
<
< queryStateOutdent : function() {
< var ed = this.editor, n;
<
< if (ed.settings.inline_styles) {
< if ((n = ed.dom.getParent(ed.selection.getStart(), ed.dom.isBlock)) && parseInt(n.style.paddingLeft) > 0)
---
> language : 'en',
> docs_language : 'en',
> theme : 'simple',
> skin : 'default',
> delta_width : 0,
> delta_height : 0,
> popup_css : '',
> plugins : '',
> document_base_url : tinymce.documentBaseURL,
> add_form_submit_trigger : 1,
> submit_patch : 1,
> add_unload_trigger : 1,
> convert_urls : 1,
> relative_urls : 1,
> remove_script_host : 1,
> table_inline_editing : 0,
> object_resizing : 1,
> cleanup : 1,
> accessibility_focus : 1,
> custom_shortcuts : 1,
> custom_undo_redo_keyboard_shortcuts : 1,
> custom_undo_redo_restore_selection : 1,
> custom_undo_redo : 1,
> doctype : '',
> visual_table_class : 'mceItemTable',
> visual : 1,
> inline_styles : true,
> convert_fonts_to_spans : true,
> font_size_style_values : 'xx-small,x-small,small,medium,large,x-large,xx-large',
> apply_source_formatting : 1,
> directionality : 'ltr',
> forced_root_block : 'p',
> valid_elements : '@[id|class|style|title|dir ]+)><\\\/p>| ]+)\\\/>| ]+)>\\s+<\\\/p>| <\\\/p>| \\s+<\\\/p>'.replace(/p/g, elm), 'gi');
< t.reNbsp2BR1 = new RegExp(' ]+)>[\\s\\u00a0]+<\\\/p>| [\\s\\u00a0]+<\\\/p>'.replace(/p/g, elm), 'gi');
< t.reNbsp2BR2 = new RegExp('<%p()([^>]+)>( | )<\\\/%p>|<%p>( | )<\\\/%p>'.replace(/%p/g, elm), 'gi');
< t.reBR2Nbsp = new RegExp(' ]+)>\\s* \\s*
\\s*<\\\/p>|
\\s*<\\\/p>'.replace(/p/g, elm), 'gi');
< t.reTrailBr = new RegExp('\\s*
\\s*<\\\/p>'.replace(/p/g, elm), 'gi');
<
< function padd(ed, o) {
< if (isOpera)
< o.content = o.content.replace(t.reOpera, '' + elm + '>');
<
< o.content = o.content.replace(t.rePadd, '<' + elm + '$1$2$3$4$5$6>\u00a0' + elm + '>');
<
< if (!isIE && !isOpera && o.set) {
< // Use instead of BR in padded paragraphs
< o.content = o.content.replace(t.reNbsp2BR1, '<' + elm + '$1$2>
' + elm + '>');
< o.content = o.content.replace(t.reNbsp2BR2, '<' + elm + '$1$2>
' + elm + '>');
< } else {
< o.content = o.content.replace(t.reBR2Nbsp, '<' + elm + '$1$2>\u00a0' + elm + '>');
< o.content = o.content.replace(t.reTrailBr, '' + elm + '>');
< }
< };
---
> // Is header and cursor is at the end, then force paragraph under
> if (/^(H[1-6])$/.test(bn) && sn.nodeValue && so == sn.nodeValue.length)
> aft = ed.dom.create(se.element);
>
> // Find start chop node
> n = sc = sn;
> do {
> if (n == b || n.nodeType == 9 || t.dom.isBlock(n) || /(TD|TABLE|TH|CAPTION)/.test(n.nodeName))
> break;
>
> sc = n;
> } while ((n = n.previousSibling ? n.previousSibling : n.parentNode));
>
> // Find end chop node
> n = ec = en;
> do {
> if (n == b || n.nodeType == 9 || t.dom.isBlock(n) || /(TD|TABLE|TH|CAPTION)/.test(n.nodeName))
> break;
11346,11347c11305,11312
< ed.onBeforeSetContent.add(padd);
< ed.onPostProcess.add(padd);
---
> ec = n;
> } while ((n = n.nextSibling ? n.nextSibling : n.parentNode));
>
> // Place first chop part into before block element
> if (sc.nodeName == bn)
> rb.setStart(sc, 0);
> else
> rb.setStartBefore(sc);
11349,11352c11314,11321
< if (s.forced_root_block) {
< ed.onInit.add(t.forceRoots, t);
< ed.onSetContent.add(t.forceRoots, t);
< ed.onBeforeGetContent.add(t.forceRoots, t);
---
> rb.setEnd(sn, so);
> bef.appendChild(rb.cloneContents() || d.createTextNode('')); // Empty text node needed for Safari
>
> // Place secnd chop part within new block element
> try {
> ra.setEndAfter(ec);
> } catch(ex) {
> //console.debug(s.focusNode, s.focusOffset);
11354d11322
< },
11356,11357c11324,11325
< setup : function() {
< var t = this, ed = t.editor, s = ed.settings;
---
> ra.setStart(en, eo);
> aft.appendChild(ra.cloneContents() || d.createTextNode('')); // Empty text node needed for Safari
11359,11362c11327,11335
< // Force root blocks when typing and when getting output
< if (s.forced_root_block) {
< ed.onKeyUp.add(t.forceRoots, t);
< ed.onPreProcess.add(t.forceRoots, t);
---
> // Create range around everything
> r = d.createRange();
> if (!sc.previousSibling && sc.parentNode.nodeName == bn) {
> r.setStartBefore(sc.parentNode);
> } else {
> if (rb.startContainer.nodeName == bn && rb.startOffset == 0)
> r.setStartBefore(rb.startContainer);
> else
> r.setStart(rb.startContainer, rb.startOffset);
11365,11369c11338,11341
< if (s.force_br_newlines) {
< // Force IE to produce BRs on enter
< if (isIE) {
< ed.onKeyPress.add(function(ed, e) {
< var n, s = ed.selection;
---
> if (!ec.nextSibling && ec.parentNode.nodeName == bn)
> r.setEndAfter(ec.parentNode);
> else
> r.setEnd(ra.endContainer, ra.endOffset);
11371,11377c11343,11373
< if (e.keyCode == 13 && s.getNode().nodeName != 'LI') {
< s.setContent('
', {format : 'raw'});
< n = ed.dom.get('__');
< n.removeAttribute('id');
< s.select(n);
< s.collapse();
< return Event.cancel(e);
---
> // Delete and replace it with new block elements
> r.deleteContents();
>
> if (isOpera)
> ed.getWin().scrollTo(0, vp.y);
>
> // Never wrap blocks in blocks
> if (bef.firstChild && bef.firstChild.nodeName == bn)
> bef.innerHTML = bef.firstChild.innerHTML;
>
> if (aft.firstChild && aft.firstChild.nodeName == bn)
> aft.innerHTML = aft.firstChild.innerHTML;
>
> // Padd empty blocks
> if (isEmpty(bef))
> bef.innerHTML = '
';
>
> function appendStyles(e, en) {
> var nl = [], nn, n, i;
>
> e.innerHTML = '';
>
> // Make clones of style elements
> if (se.keep_styles) {
> n = en;
> do {
> // We only want style specific elements
> if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(n.nodeName)) {
> nn = n.cloneNode(false);
> dom.setAttrib(nn, 'id', ''); // Remove ID since it needs to be unique
> nl.push(nn);
11379c11375
< });
---
> } while (n = n.parentNode);
11382,11383c11378,11495
< return;
< }
---
> // Append style elements to aft
> if (nl.length > 0) {
> for (i = nl.length - 1, nn = e; i >= 0; i--)
> nn = nn.appendChild(nl[i]);
>
> // Padd most inner style element
> nl[0].innerHTML = isOpera ? ' ' : '
'; // Extra space for Opera so that the caret can move there
> return nl[0]; // Move caret to most inner element
> } else
> e.innerHTML = isOpera ? ' ' : '
'; // Extra space for Opera so that the caret can move there
> };
>
> // Fill empty afterblook with current style
> if (isEmpty(aft))
> car = appendStyles(aft, en);
>
> // Opera needs this one backwards for older versions
> if (isOpera && parseFloat(opera.version()) < 9.5) {
> r.insertNode(bef);
> r.insertNode(aft);
> } else {
> r.insertNode(aft);
> r.insertNode(bef);
> }
>
> // Normalize
> aft.normalize();
> bef.normalize();
>
> function first(n) {
> return d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false).nextNode() || n;
> };
>
> // Move cursor and scroll into view
> r = d.createRange();
> r.selectNodeContents(isGecko ? first(car || aft) : car || aft);
> r.collapse(1);
> s.removeAllRanges();
> s.addRange(r);
>
> // scrollIntoView seems to scroll the parent window in most browsers now including FF 3.0b4 so it's time to stop using it and do it our selfs
> y = ed.dom.getPos(aft).y;
> ch = aft.clientHeight;
>
> // Is element within viewport
> if (y < vp.y || y + ch > vp.y + vp.h) {
> ed.getWin().scrollTo(0, y < vp.y ? y : y - vp.h + 25); // Needs to be hardcoded to roughly one line of text if a huge text block is broken into two blocks
> //console.debug('SCROLentNode;
> },
>
> writeFullEndElement : function() {
> var t = this, n = t.node;
>
> n.appendChild(t.doc.createTextNode(""));
> @iU``q@*^@og@o@j,createCDATA(v));
> },
>
> writeComment : function(v) {
> // Fix for bug #2035694
> if (tinymce.isIE)
> v = v.replace(/^\-|\-$/g, ' ');
>
> this.node.appendChild(this.doc.createComment(v.replace(/\-\-/g, ' ')));
> },
>
> getContent : function() {
> var h;
>
> h = this.doc.xml || new XMLSerializer().serializeToString(this.doc);
> h = h.replace(/<\?[^?]+\?>||<\/html>|
');
< aft = ed.dom.add(sn, se.element, null, '
');
<
< // Move caret into the last one
< r = d.createRange();
< r.selectNodeContents(aft);
< r.collapse(1);
< ed.selection.setRng(r);
---
> // Private methods
11647,11648c11621,11623
< return false;
< }
---
> _setActive : function(e) {
> this.selectedInstance = this.activeEditor = e;
> }
11650,11669c11625
< // If the caret is in an invalid location in FF we need to move it into the first block
< if (sn == b && en == b && b.firstChild && ed.dom.isBlock(b.firstChild)) {
< sn = en = sn.firstChild;
< so = eo = 0;
< rb = d.createRange();
< rb.setStart(sn, 0);
< ra = d.createRange();
< ra.setStart(en, 0);
< }
<
< // Never use body as start or end node
< sn = sn.nodeName == "HTML" ? d.body : sn; // Fix for Opera bug: https://bugs.opera.com/show_bug.cgi?id=273224&comments=yes
< sn = sn.nodeName == "BODY" ? sn.firstChild : sn;
< en = en.nodeName == "HTML" ? d.body : en; // Fix for Opera bug: https://bugs.opera.com/show_bug.cgi?id=273224&comments=yes
< en = en.nodeName == "BODY" ? en.firstChild : en;
<
< // Get start and end blocks
< sb = t.getParentBlock(sn);
< eb = t.getParentBlock(en);
< bn = sb ? sb.nodeName : se.element; // Get block name to create
---
> });
11671,11673c11627,11628
< // Return inside list use default browser behavior
< if (t.dom.getParent(sb, 'OL,UL,PRE'))
< return true;
---
> tinymce.EditorManager.preInit();
> })(tinymce);
11675,11679c11630,11636
< // If caption or absolute layers then always generate new blocks within
< if (sb && (sb.nodeName == 'CAPTION' || /absolute|relative|fixed/gi.test(dom.getStyle(sb, 'position', 1)))) {
< bn = se.element;
< sb = null;
< }
---
> // Short for editor manager window.tinyMCE is needed when TinyMCE gets loaded though a XHR call
> var tinyMCE = window.tinyMCE = tinymce.EditorManager;
> (function(tinymce) {
> var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, Dispatcher = tinymce.util.Dispatcher;
> var each = tinymce.each, isGecko = tinymce.isGecko, isIE = tinymce.isIE, isWebKit = tinymce.isWebKit;
> var is = tinymce.is, ThemeManager = tinymce.ThemeManager, PluginManager = tinymce.PluginManager, EditorManager = tinymce.EditorManager;
> var inArray = tinymce.inArray, grep = tinymce.grep, explode = tinymce.explode;
11681,11685c11638,11640
< // If caption or absolute layers then always generate new blocks within
< if (eb && (eb.nodeName == 'CAPTION' || /absolute|relative|fixed/gi.test(dom.getStyle(sb, 'position', 1)))) {
< bn = se.element;
< eb = null;
< }
---
> tinymce.create('tinymce.Editor', {
> Editor : function(id, s) {
> var t = this;
11687,11691c11642,11646
< // Use P instead
< if (/(TD|TABLE|TH|CAPTION)/.test(bn) || (sb && bn == "DIV" && /left|right/gi.test(dom.getStyle(sb, 'float', 1)))) {
< bn = se.element;
< sb = eb = null;
< }
---
> t.id = t.editorId = id;
> t.execCommands = {};
> t.queryStateCommands = {};
> t.queryValueCommands = {};
> t.plugins = {};
11693,11695c11648,11724
< // Setup new before and after blocks
< bef = (sb && sb.nodeName == bn) ? sb.cloneNode(0) : ed.dom.create(bn);
< aft = (eb && eb.nodeName == bn) ? eb.cloneNode(0) : ed.dom.create(bn);
---
> // Add events to the editor
> each([
> 'onPreInit',
> 'onBeforeRenderUI',
> 'onPostRender',
> 'onInit',
> 'onRemove',
> 'onActivate',
> 'onDeactivate',
> 'onClick',
> 'onEvent',
> 'onMouseUp',
> 'onMouseDown',
> 'onDblClick',
> 'onKeyDown',
> 'onKeyUp',
> 'onKeyPress',
> 'onContextMenu',
> 'onSubmit',
> 'onReset',
> 'onPaste',
> 'onPreProcess',
> 'onPostProcess',
> 'onBeforeSetContent',
> 'onBeforeGetContent',
> 'onSetContent',
> 'onGetContent',
> 'onLoadContent',
> 'onSaveContent',
> 'onNodeChange',
> 'onChange',
> 'onBeforeExecCommand',
> 'onExecCommand',
> 'onUndo',
> 'onRedo',
> 'onVisualAid',
> 'onSetProgressState'
> ], function(e) {
> t[e] = new Dispatcher(t);
> });
>
> // Default editor config
> t.settings = s = extend({
> id : id,
> language : 'en',
> docs_language : 'en',
> theme : 'simple',
> skin : 'default',
> delta_width : 0,
> delta_height : 0,
> popup_css : '',
> plugins : '',
> document_base_url : tinymce.documentBaseURL,
> add_form_submit_trigger : 1,
> submit_patch : 1,
> add_unload_trigger : 1,
> convert_urls : 1,
> relative_urls : 1,
> remove_script_host : 1,
> table_inline_editing : 0,
> object_resizing : 1,
> cleanup : 1,
> accessibility_focus : 1,
> custom_shortcuts : 1,
> custom_undo_redo_keyboard_shortcuts : 1,
> custom_undo_redo_restore_selection : 1,
> custom_undo_redo : 1,
> doctype : '',
> visual_table_class : 'mceItemTable',
> visual : 1,
> inline_styles : true,
> convert_fonts_to_spans : true,
> font_size_style_values : 'xx-small,x-small,small,medium,large,x-large,xx-large',
> apply_source_formatting : 1,
> directionality : 'ltr',
> forced_root_block : 'p',
> valid_elements : '@[id|class|style|title|dir