From 1943b7e613f208ce6ed03c7b82d21e98c5b7de8a Mon Sep 17 00:00:00 2001 From: Gustavo Cruz Date: Thu, 14 Feb 2013 11:29:38 -0400 Subject: [PATCH] Fix the appearing of an empty dropdown inside the image popup in IE8 (TinyMCE editor) --- .../tinymce/jscripts/tiny_mce/tiny_mce_src.js | 370 +++++++++--------- 1 file changed, 186 insertions(+), 184 deletions(-) diff --git a/gulliver/js/tinymce/jscripts/tiny_mce/tiny_mce_src.js b/gulliver/js/tinymce/jscripts/tiny_mce/tiny_mce_src.js index 693546b38..16b9c5f03 100644 --- a/gulliver/js/tinymce/jscripts/tiny_mce/tiny_mce_src.js +++ b/gulliver/js/tinymce/jscripts/tiny_mce/tiny_mce_src.js @@ -34,7 +34,7 @@ t.isAir = /adobeair/i.test(ua); t.isIDevice = /(iPad|iPhone)/.test(ua); - + t.isIOS5 = t.isIDevice && ua.match(/AppleWebKit\/(\d*)/)[1]>=534; // TinyMCE .NET webcontrol might be setting the values for TinyMCE @@ -554,7 +554,7 @@ tinymce.create('tinymce.util.Dispatcher', { var self = this, returnValue, args = arguments, i, listeners = self.listeners, listener; self.inDispatch = true; - + // Needs to be a real loop since the listener count might change while looping // And this is also more efficient for (i = 0; i < listeners.length; i++) { @@ -663,7 +663,7 @@ tinymce.create('tinymce.util.Dispatcher', { return u.getURI(); var tu = t.getURI(), uu = u.getURI(); - + // Allow usage of the base_uri when relative_urls = true if(tu == uu || (tu.charAt(tu.length - 1) == "/" && tu.substr(0, tu.length - 1) == uu)) return tu; @@ -680,7 +680,7 @@ tinymce.create('tinymce.util.Dispatcher', { return o; }, - + toAbsolute : function(u, nh) { u = new tinymce.util.URI(u, {base_uri : this}); @@ -1175,7 +1175,7 @@ tinymce.util.Quirks = function(editor) { editor.addCommand('Delete', function() {removeMergedFormatSpans();}); }; - + function emptyEditorWhenDeleting() { function serializeRng(rng) { var body = dom.create("body"); @@ -2303,7 +2303,7 @@ tinymce.html.Styles = function(settings, schema) { if (name === 'font-weight' && value === '700') value = 'bold'; else if (name === 'color' || name === 'background-color') // Lowercase colors like RED - value = value.toLowerCase(); + value = value.toLowerCase(); // Convert RGB colors to HEX value = value.replace(rgbRegExp, toHex); @@ -2569,89 +2569,89 @@ tinymce.html.Styles = function(settings, schema) { C : 'onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup', B : 'lang|xml:lang|dir', A : 'id|class|style|title' - }, 'script[id|charset|type|language|src|defer|xml:space][]' + - 'style[B|id|type|media|title|xml:space][]' + - 'object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]' + - 'param[id|name|value|valuetype|type][]' + - 'p[E|align][#|S]' + - 'a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]' + - 'br[A|clear][]' + - 'span[E][#|S]' + - 'bdo[A|C|B][#|S]' + - 'applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]' + - 'h1[E|align][#|S]' + - 'img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]' + - 'map[B|C|A|name][X|form|Q|area]' + - 'h2[E|align][#|S]' + - 'iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]' + - 'h3[E|align][#|S]' + - 'tt[E][#|S]' + - 'i[E][#|S]' + - 'b[E][#|S]' + - 'u[E][#|S]' + - 's[E][#|S]' + - 'strike[E][#|S]' + - 'big[E][#|S]' + - 'small[E][#|S]' + - 'font[A|B|size|color|face][#|S]' + - 'basefont[id|size|color|face][]' + - 'em[E][#|S]' + - 'strong[E][#|S]' + - 'dfn[E][#|S]' + - 'code[E][#|S]' + - 'q[E|cite][#|S]' + - 'samp[E][#|S]' + - 'kbd[E][#|S]' + - 'var[E][#|S]' + - 'cite[E][#|S]' + - 'abbr[E][#|S]' + - 'acronym[E][#|S]' + - 'sub[E][#|S]' + - 'sup[E][#|S]' + - 'input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]' + - 'select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]' + - 'optgroup[E|disabled|label][option]' + - 'option[E|selected|disabled|label|value][]' + - 'textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]' + - 'label[E|for|accesskey|onfocus|onblur][#|S]' + - 'button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]' + - 'h4[E|align][#|S]' + - 'ins[E|cite|datetime][#|Y]' + - 'h5[E|align][#|S]' + - 'del[E|cite|datetime][#|Y]' + - 'h6[E|align][#|S]' + - 'div[E|align][#|Y]' + - 'ul[E|type|compact][li]' + - 'li[E|type|value][#|Y]' + - 'ol[E|type|compact|start][li]' + - 'dl[E|compact][dt|dd]' + - 'dt[E][#|S]' + - 'dd[E][#|Y]' + - 'menu[E|compact][li]' + - 'dir[E|compact][li]' + - 'pre[E|width|xml:space][#|ZA]' + - 'hr[E|align|noshade|size|width][]' + - 'blockquote[E|cite][#|Y]' + - 'address[E][#|S|p]' + - 'center[E][#|Y]' + - 'noframes[E][#|Y]' + - 'isindex[A|B|prompt][]' + - 'fieldset[E][#|legend|Y]' + - 'legend[E|accesskey|align][#|S]' + - 'table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]' + - 'caption[E|align][#|S]' + - 'col[ZG][]' + - 'colgroup[ZG][col]' + - 'thead[ZF][tr]' + - 'tr[ZF|bgcolor][th|td]' + - 'th[E|ZE][#|Y]' + - 'form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]' + - 'noscript[E][#|Y]' + - 'td[E|ZE][#|Y]' + - 'tfoot[ZF][tr]' + - 'tbody[ZF][tr]' + - 'area[E|D|shape|coords|href|nohref|alt|target][]' + - 'base[id|href|target][]' + + }, 'script[id|charset|type|language|src|defer|xml:space][]' + + 'style[B|id|type|media|title|xml:space][]' + + 'object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]' + + 'param[id|name|value|valuetype|type][]' + + 'p[E|align][#|S]' + + 'a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]' + + 'br[A|clear][]' + + 'span[E][#|S]' + + 'bdo[A|C|B][#|S]' + + 'applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]' + + 'h1[E|align][#|S]' + + 'img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]' + + 'map[B|C|A|name][X|form|Q|area]' + + 'h2[E|align][#|S]' + + 'iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]' + + 'h3[E|align][#|S]' + + 'tt[E][#|S]' + + 'i[E][#|S]' + + 'b[E][#|S]' + + 'u[E][#|S]' + + 's[E][#|S]' + + 'strike[E][#|S]' + + 'big[E][#|S]' + + 'small[E][#|S]' + + 'font[A|B|size|color|face][#|S]' + + 'basefont[id|size|color|face][]' + + 'em[E][#|S]' + + 'strong[E][#|S]' + + 'dfn[E][#|S]' + + 'code[E][#|S]' + + 'q[E|cite][#|S]' + + 'samp[E][#|S]' + + 'kbd[E][#|S]' + + 'var[E][#|S]' + + 'cite[E][#|S]' + + 'abbr[E][#|S]' + + 'acronym[E][#|S]' + + 'sub[E][#|S]' + + 'sup[E][#|S]' + + 'input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]' + + 'select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]' + + 'optgroup[E|disabled|label][option]' + + 'option[E|selected|disabled|label|value][]' + + 'textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]' + + 'label[E|for|accesskey|onfocus|onblur][#|S]' + + 'button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]' + + 'h4[E|align][#|S]' + + 'ins[E|cite|datetime][#|Y]' + + 'h5[E|align][#|S]' + + 'del[E|cite|datetime][#|Y]' + + 'h6[E|align][#|S]' + + 'div[E|align][#|Y]' + + 'ul[E|type|compact][li]' + + 'li[E|type|value][#|Y]' + + 'ol[E|type|compact|start][li]' + + 'dl[E|compact][dt|dd]' + + 'dt[E][#|S]' + + 'dd[E][#|Y]' + + 'menu[E|compact][li]' + + 'dir[E|compact][li]' + + 'pre[E|width|xml:space][#|ZA]' + + 'hr[E|align|noshade|size|width][]' + + 'blockquote[E|cite][#|Y]' + + 'address[E][#|S|p]' + + 'center[E][#|Y]' + + 'noframes[E][#|Y]' + + 'isindex[A|B|prompt][]' + + 'fieldset[E][#|legend|Y]' + + 'legend[E|accesskey|align][#|S]' + + 'table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]' + + 'caption[E|align][#|S]' + + 'col[ZG][]' + + 'colgroup[ZG][col]' + + 'thead[ZF][tr]' + + 'tr[ZF|bgcolor][th|td]' + + 'th[E|ZE][#|Y]' + + 'form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]' + + 'noscript[E][#|Y]' + + 'td[E|ZE][#|Y]' + + 'tfoot[ZF][tr]' + + 'tbody[ZF][tr]' + + 'area[E|D|shape|coords|href|nohref|alt|target][]' + + 'base[id|href|target][]' + 'body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]' ); } @@ -2708,9 +2708,9 @@ tinymce.html.Styles = function(settings, schema) { shortEndedElementsMap = createLookupTable('short_ended_elements', 'area base basefont br col frame hr img input isindex link meta param embed source wbr'); boolAttrMap = createLookupTable('boolean_attributes', 'checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls'); nonEmptyElementsMap = createLookupTable('non_empty_elements', 'td th iframe video audio object', shortEndedElementsMap); - textBlockElementsMap = createLookupTable('text_block_elements', 'h1 h2 h3 h4 h5 h6 p div address pre form ' + + textBlockElementsMap = createLookupTable('text_block_elements', 'h1 h2 h3 h4 h5 h6 p div address pre form ' + 'blockquote center dir fieldset header footer article section hgroup aside nav figure'); - blockElementsMap = createLookupTable('block_elements', 'hr table tbody thead tfoot ' + + blockElementsMap = createLookupTable('block_elements', 'hr table tbody thead tfoot ' + 'th tr td li ol ul caption dl dt dd noscript menu isindex samp option datalist select optgroup', textBlockElementsMap); // Converts a wildcard expression string to a regexp for example *a will become /.*a/. @@ -3073,7 +3073,7 @@ tinymce.html.Styles = function(settings, schema) { // No match return false; }; - + self.getElementRule = getElementRule; self.getCustomElements = function() { @@ -3121,7 +3121,7 @@ tinymce.html.Styles = function(settings, schema) { pos = stack.length; while (pos--) { if (stack[pos].name === name) - break; + break; } // Found parent @@ -3681,7 +3681,7 @@ tinymce.html.Styles = function(settings, schema) { // Keep comments if (node.type === 8) return false; - + // Keep non whitespace text nodes if ((node.type === 3 && !whiteSpaceRegExp.test(node.value))) return false; @@ -4022,7 +4022,7 @@ tinymce.html.Styles = function(settings, schema) { doctype: function(text) { var newNode; - + newNode = node.append(createNode('#doctype', 10)); newNode.value = text; removeWhitespaceBefore(node); @@ -4213,15 +4213,15 @@ tinymce.html.Styles = function(settings, schema) { } } } - - + + for (i = 0, l = list.length; i < l; i++){ // ProcessMaker: conditional statemets created in order to assure the compatibility with maborak if(name!='toStr'&&name!='concat'&&name!='get_by_key'&&name!='expand'&&name!='setParent'&&name!='isset_key'&&name!='toJSONString'){ list[i](nodes, name, args); } } - + } // Run attribute filters @@ -4239,15 +4239,15 @@ tinymce.html.Styles = function(settings, schema) { // if (!nodes[fi].parent){ nodes.splice(fi, 1); // } - } + } } for (fi = 0, fl = list.callbacks.length; fi < fl; fi++){ // ProcessMaker: conditional statemets created in order to assure the compatibility with maborak if(list.name!='toStr'&&list.name!='concat'&&list.name!='get_by_key'&&list.name!='expand'&&list.name!='setParent'&&list.name!='isset_key'){ list.callbacks[fi](nodes, list.name, args); - } - } + } + } } } } @@ -4283,7 +4283,7 @@ tinymce.html.Styles = function(settings, schema) { // Found a non BR element if (prevName !== "br") break; - + // Found another br it's a

structure then don't remove anything if (prevName === 'br') { node = null; @@ -4311,7 +4311,7 @@ tinymce.html.Styles = function(settings, schema) { } } } else { - // Replaces BR elements inside inline elements like


so they become

 

+ // Replaces BR elements inside inline elements like


so they become

 

lastParent = node; while (parent.firstChild === lastParent && parent.lastChild === lastParent) { lastParent = parent; @@ -4745,7 +4745,7 @@ tinymce.dom = {}; if (callbackList) { for (i = 0, l = callbackList.length; i < l; i++) { callback = callbackList[i]; - + // Check if callback exists might be removed if a unbind is called inside the callback if (callback && callback.func.call(callback.scope, evt) === false) { evt.preventDefault(); @@ -4980,7 +4980,7 @@ tinymce.dom = {}; self.clean = function(target) { var i, children, unbind = self.unbind; - + // Don't bind to text nodes or comments if (!target || target.nodeType === 3 || target.nodeType === 8) { return self; @@ -5214,7 +5214,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { keep_values : false, hex_colors : 1 }, s); - + t.schema = s.schema; t.styles = new tinymce.html.Styles({ url_converter : s.url_converter, @@ -5558,7 +5558,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { case 'float': isIE ? s.styleFloat = v : s.cssFloat = v; break; - + default: s[na] = v || ''; } @@ -6687,17 +6687,17 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { // Check START_TO_START if (h === 0) return _compareBoundaryPoints(sc, so, rsc, rso); - + // Check START_TO_END if (h === 1) return _compareBoundaryPoints(ec, eo, rsc, rso); - + // Check END_TO_END if (h === 2) return _compareBoundaryPoints(ec, eo, rec, reo); - + // Check END_TO_START - if (h === 3) + if (h === 3) return _compareBoundaryPoints(sc, so, rec, reo); }; @@ -6790,7 +6790,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { function _compareBoundaryPoints(containerA, offsetA, containerB, offsetB) { var c, offsetC, n, cmnRoot, childA, childB; - + // In the first case the boundary-points have the same container. A is before B // if its offset is less than the offset of B, A is equal to B if its offset is // equal to the offset of B, and A is after B if its offset is greater than the @@ -7271,7 +7271,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { function toStringIE() { return dom.create('body', null, cloneContents()).outerText; } - + return t; }; @@ -7597,7 +7597,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { return node; }; - + function setBookmarkEndPoint(start) { var endPoint = bookmark[start ? 'start' : 'end'], moveLeft, moveRng, undef; @@ -8002,6 +8002,7 @@ Sizzle.filter = function( expr, set, inplace, not ) { while ( expr && set.length ) { for ( type in Expr.filter ) { + if(type!='toStr'&&type!='concat'&&type!='get_by_key'&&type!='expand'&&type!='setParent'&&type!='isset_key'&&type!='toJSONString'&&type!='isObject'&&type!='isArray'&&type!='isObjectStrict'){ if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { filter = Expr.filter[ type ]; left = match[1]; @@ -8065,6 +8066,7 @@ Sizzle.filter = function( expr, set, inplace, not ) { break; } } + } } // Improper expression @@ -9213,9 +9215,9 @@ window.tinymce.dom.Sizzle = Sizzle; el = dom.get(t.id); tinymce.each( - ('getPos,getRect,getParent,add,setStyle,getStyle,setStyles,' + - 'setAttrib,setAttribs,getAttrib,addClass,removeClass,' + - 'hasClass,getOuterHTML,setOuterHTML,remove,show,hide,' + + ('getPos,getRect,getParent,add,setStyle,getStyle,setStyles,' + + 'setAttrib,setAttribs,getAttrib,addClass,removeClass,' + + 'hasClass,getOuterHTML,setOuterHTML,remove,show,hide,' + 'isHidden,setHTML,get').split(/,/), function(k) { t[k] = function() { var a = [id], i; @@ -10271,7 +10273,7 @@ window.tinymce.dom.Sizzle = Sizzle; // Normalize only on non IE browsers for now if (tinymce.isIE) return; - + rng = self.getRng(); collapsed = rng.collapsed; @@ -10410,7 +10412,7 @@ window.tinymce.dom.Sizzle = Sizzle; // Make HTML element unselectable since we are going to handle selection by hand doc.documentElement.unselectable = true; - + // Detect when user selects outside BODY dom.bind(doc, ['mousedown', 'contextmenu'], function(e) { if (e.target.nodeName === 'HTML') { @@ -10735,7 +10737,7 @@ window.tinymce.dom.Sizzle = Sizzle; callback(); }; - + function error() { // Report the error so it's easier for people to spot loading errors if (typeof(console) !== "undefined" && console.log) @@ -10771,7 +10773,7 @@ window.tinymce.dom.Sizzle = Sizzle; done(); }, - + error : error }); @@ -11005,7 +11007,7 @@ window.tinymce.dom.Sizzle = Sizzle; // Find common ancestor and end points ancestor = dom.findCommonAncestor(startContainer, endContainer); - + // Process left side for (node = startContainer; node; node = node.parentNode) { if (node === endContainer) @@ -11130,17 +11132,17 @@ window.tinymce.dom.Sizzle = Sizzle; itemFocussed = function(evt) { focussedId = evt.target.id; }; - + itemBlurred = function(evt) { dom.setAttrib(evt.target.id, 'tabindex', '-1'); }; - + rootFocussed = function(evt) { var item = dom.get(focussedId); dom.setAttrib(item, 'tabindex', '0'); item.focus(); }; - + t.focus = function() { dom.get(focussedId).focus(); }; @@ -11160,7 +11162,7 @@ window.tinymce.dom.Sizzle = Sizzle; items = dom = root = t.focus = itemFocussed = itemBlurred = rootKeydown = rootFocussed = null; t.destroy = function() {}; }; - + t.moveFocus = function(dir, evt) { var idx = -1, controls = t.controls, newFocus; @@ -11180,7 +11182,7 @@ window.tinymce.dom.Sizzle = Sizzle; } else if (idx >= items.length) { idx = 0; } - + newFocus = items[idx]; dom.setAttrib(focussedId, 'tabindex', '-1'); dom.setAttrib(newFocus.id, 'tabindex', '0'); @@ -11193,19 +11195,19 @@ window.tinymce.dom.Sizzle = Sizzle; if (evt) Event.cancel(evt); }; - + rootKeydown = function(evt) { var DOM_VK_LEFT = 37, DOM_VK_RIGHT = 39, DOM_VK_UP = 38, DOM_VK_DOWN = 40, DOM_VK_ESCAPE = 27, DOM_VK_ENTER = 14, DOM_VK_RETURN = 13, DOM_VK_SPACE = 32; - + switch (evt.keyCode) { case DOM_VK_LEFT: if (enableLeftRight) t.moveFocus(-1); break; - + case DOM_VK_RIGHT: if (enableLeftRight) t.moveFocus(1); break; - + case DOM_VK_UP: if (enableUpDown) t.moveFocus(-1); break; @@ -11252,7 +11254,7 @@ window.tinymce.dom.Sizzle = Sizzle; elm.setAttribute('tabindex', tabindex); dom.bind(elm, 'focus', itemFocussed); }); - + // Setup initial state for root element. if (items[0]){ focussedId = items[0].id; @@ -11284,14 +11286,14 @@ window.tinymce.dom.Sizzle = Sizzle; this.active = 0; this.editor = editor; }, - + setAriaProperty : function(property, value) { var element = DOM.get(this.id + '_aria') || DOM.get(this.id); if (element) { DOM.setAttrib(element, 'aria-' + property, !!value); } }, - + focus : function() { DOM.get(this.id).focus(); }, @@ -11426,7 +11428,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { postRender : function() { var t = this; - + t.parent(); // Set pending state @@ -11571,7 +11573,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { return m; }, - + focus : function() { var t = this; if (t.keyboardNav) { @@ -11701,13 +11703,13 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { } }); } - + Event.add(co, 'keydown', t._keyHandler, t); t.onShowMenu.dispatch(t); - if (s.keyboard_focus) { - t._setupKeyboardNav(); + if (s.keyboard_focus) { + t._setupKeyboardNav(); } }, @@ -11802,7 +11804,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { // Internal functions _setupKeyboardNav : function(){ - var contextMenu, menuItems, t=this; + var contextMenu, menuItems, t=this; contextMenu = DOM.get('menu_' + t.id); menuItems = DOM.select('a[role=option]', 'menu_' + t.id); menuItems.splice(0,0,contextMenu); @@ -11908,7 +11910,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { else h += '' + (l ? '' + l + '' : ''); - h += ''; + h += ''; h += ''; return h; }, @@ -12050,7 +12052,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { var h = '', t = this, s = t.settings, cp = t.classPrefix; h = ''; - h += ''; h += ''; h += ''; @@ -12364,7 +12366,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { if (tinymce.isWebKit && (e.keyCode==37 ||e.keyCode==39)) { return Event.prevent(e); } - + if (e.keyCode == 13 || e.keyCode == 32) { onChange(e); return Event.cancel(e); @@ -12490,7 +12492,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { h1 += DOM.createHTML('span', {'class': 'mceVoiceLabel mceIconOnly', id: t.id + '_voice', style: 'display:none;'}, s.title); h += '' + DOM.createHTML('a', {role: 'button', id : t.id + '_action', tabindex: '-1', href : 'javascript:;', 'class' : 'mceAction ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + ''; - + h1 = DOM.createHTML('span', {'class' : 'mceOpen ' + s['class']}, ''); h += '' + DOM.createHTML('a', {role: 'button', id : t.id + '_open', tabindex: '-1', href : 'javascript:;', 'class' : 'mceOpen ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + ''; @@ -12730,7 +12732,7 @@ tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { this.hideMenu(); this.settings.onselect(c); }, - + displayColor : function(c) { var t = this; @@ -12782,12 +12784,12 @@ tinymce.create('tinymce.ui.ToolbarGroup:tinymce.ui.Container', { return h.join(''); }, - + focus : function() { var t = this; dom.get(t.id).focus(); }, - + postRender : function() { var t = this, items = []; @@ -12812,7 +12814,7 @@ tinymce.create('tinymce.ui.ToolbarGroup:tinymce.ui.Container', { excludeFromTabOrder: !t.settings.tab_focus_toolbar }); }, - + destroy : function() { var self = this; @@ -12944,7 +12946,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { addComponents: function(pluginName, scripts) { var pluginUrl = this.urls[pluginName]; tinymce.each(scripts, function(script){ - tinymce.ScriptLoader.add(pluginUrl+"/"+script); + tinymce.ScriptLoader.add(pluginUrl+"/"+script); }); }, @@ -13032,11 +13034,11 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { function createId(elm) { var id = elm.id; - + // Use element id, or unique name or generate a unique id if (!id) { id = elm.name; - + if (id && !DOM.get(id)) { id = elm.name; } else { @@ -13118,7 +13120,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { } }); break; - + default: if (s.types) { // Process type specific selector @@ -13160,7 +13162,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { // All done if (l == co) - execCallback(s, 'oninit'); + execCallback(s, 'oninit'); }); } }); @@ -13436,7 +13438,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (!t.getElement()) return; - // Is a iPad/iPhone and not on iOS5, then skip initialization. We need to sniff + // Is a iPad/iPhone and not on iOS5, then skip initialization. We need to sniff // here since the browser says it has contentEditable support but there is no visible caret. if (tinymce.isIDevice && !tinymce.isIOS5) return; @@ -13581,7 +13583,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { } } } - + // Create all plugins each(explode(s.plugins.replace(/\-/g, '')), initPlugin); @@ -13730,7 +13732,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { // Create iframe // TODO: ACC add the appropriate description on this. - n = DOM.add(o.iframeContainer, 'iframe', { + n = DOM.add(o.iframeContainer, 'iframe', { id : t.id + "_ifr", src : u || 'javascript:""', // Workaround for HTTPS warning in IE6/7 frameBorder : '0', @@ -13818,7 +13820,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { internalName = 'data-mce-' + name; // Add internal attribute if we need to we don't on a refresh of the document - if (!node.attributes.map[internalName]) { + if (!node.attributes.map[internalName]) { if (name === "style") node.attr(internalName, dom.serializeStyle(dom.parseStyle(value), node.name)); else @@ -14356,7 +14358,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (!o.no_events) t.onLoadContent.dispatch(t, o); - + o.element = e = null; return h; @@ -14412,7 +14414,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { // Do preprocessing if (!args.no_events) self.onBeforeSetContent.dispatch(self, args); - + content = args.content; // Padd empty content in Gecko and Safari. Commands will otherwise fail on the content @@ -14808,7 +14810,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (o.set) o.content = ed.execCallback('cleanup_callback', 'insert_to_editor', o.content, o); - if (o.get) + if (o.get) o.content = ed.execCallback('cleanup_callback', 'get_from_editor', o.content, o); }); } @@ -15451,7 +15453,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { // Remove existing links if there could be child links or that the href isn't specified if (!anchor || !value.href) { formatter.remove('link'); - } + } // Apply new link to selection if (value.href) { @@ -15510,7 +15512,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { 'InsertUnorderedList,InsertOrderedList' : function(command) { var list = dom.getParent(selection.getNode(), 'ul,ol'); - return list && + return list && (command === 'insertunorderedlist' && list.tagName === 'UL' || command === 'insertorderedlist' && list.tagName === 'OL'); } @@ -15654,7 +15656,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { data : data, typing : false, - + onBeforeAdd: onBeforeAdd, onAdd : onAdd, @@ -15672,7 +15674,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { level = level || {}; level.content = getContent(); - + self.onBeforeAdd.dispatch(self, level); // Add undo level if needed @@ -16231,16 +16233,16 @@ tinymce.ForceBlocks = function(editor) { return t.add(c); }, - + createToolbarGroup : function(id, s, cc) { var c, t = this, cls; id = t.prefix + id; cls = cc || this._cls.toolbarGroup || tinymce.ui.ToolbarGroup; c = new cls(id, s, t.editor); - + if (t.get(id)) return null; - + return t.add(c); }, @@ -16253,7 +16255,7 @@ tinymce.ForceBlocks = function(editor) { setControlType : function(n, c) { return this._cls[n.toLowerCase()] = c; }, - + destroy : function() { each(this.controls, function(c) { c.destroy(); @@ -16630,10 +16632,10 @@ tinymce.ForceBlocks = function(editor) { return rng; } - + function applyStyleToList(node, bookmark, wrapElm, newWrappers, process){ var nodes = [], listIndex = -1, list, startIndex = -1, endIndex = -1, currentWrapElm; - + // find the index of the first child list. each(node.childNodes, function(n, index) { if (n.nodeName === "UL" || n.nodeName === "OL") { @@ -16642,7 +16644,7 @@ tinymce.ForceBlocks = function(editor) { return false; } }); - + // get the index of the bookmarks each(node.childNodes, function(n, index) { if (n.nodeName === "SPAN" && dom.getAttrib(n, "data-mce-type") == "bookmark") { @@ -16653,7 +16655,7 @@ tinymce.ForceBlocks = function(editor) { } } }); - + // if the selection spans across an embedded list, or there isn't an embedded list - handle processing normally if (listIndex <= 0 || (startIndex < listIndex && endIndex > listIndex)) { each(tinymce.grep(node.childNodes), process); @@ -16664,7 +16666,7 @@ tinymce.ForceBlocks = function(editor) { // create a list of the nodes on the same side of the list as the selection each(tinymce.grep(node.childNodes), function(n, index) { if ((startIndex < listIndex && index < listIndex) || (startIndex > listIndex && index > listIndex)) { - nodes.push(n); + nodes.push(n); n.parentNode.removeChild(n); } }); @@ -16675,7 +16677,7 @@ tinymce.ForceBlocks = function(editor) { } else if (startIndex > listIndex) { node.insertBefore(currentWrapElm, list.nextSibling); } - + // add the new nodes to the list. newWrappers.push(currentWrapElm); @@ -16778,7 +16780,7 @@ tinymce.ForceBlocks = function(editor) { } else { // Start a new wrapper for possible children currentWrapElm = 0; - + each(tinymce.grep(node.childNodes), process); if (hasContentEditableState) { @@ -16819,7 +16821,7 @@ tinymce.ForceBlocks = function(editor) { } // Cleanup - + each(newWrappers, function(node) { var childCount; @@ -16988,7 +16990,7 @@ tinymce.ForceBlocks = function(editor) { // Process the children if (format.deep) { - if (children.length) { + if (children.length) { for (i = 0, l = children.length; i < l; i++) process(children[i]); @@ -18099,7 +18101,7 @@ tinymce.ForceBlocks = function(editor) { return true; }; - + // Returns any parent caret container element function getParentCaretContainer(node) { while (node) { @@ -18161,7 +18163,7 @@ tinymce.ForceBlocks = function(editor) { selection.setRng(rng); } }; - + // Applies formatting to the caret postion function applyCaretFormat() { var rng, caretContainer, textNode, offset, bookmark, container, text; @@ -18462,7 +18464,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) { return node && dom.isBlock(node) && !/^(TD|TH|CAPTION|FORM)$/.test(node.nodeName) && - !/^(fixed|absolute)/i.test(node.style.position) && + !/^(fixed|absolute)/i.test(node.style.position) && dom.getContentEditable(node) !== "true"; }; @@ -18507,7 +18509,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) { } } }; - + // Moves the caret to a suitable position within the root for example in the first non pure whitespace text node or before an image function moveToCaretPosition(root) { var walker, node, rng, y, viewPort, lastNode = root, tempElm; @@ -18638,7 +18640,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) { // Walk the DOM and look for text nodes or non empty elements walker = new TreeWalker(container, parentBlock); - + // If caret is in beginning or end of a text block then jump to the next/previous node if (container.nodeType == 3) { if (start && offset == 0) { @@ -18779,7 +18781,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) { node = walker.next(); } } - + // Inserts a BR element if the forced_root_block option is set to false or empty string function insertBr() { var brElm, extraBr; @@ -18838,7 +18840,7 @@ tinymce.onAddEditor.add(function(tinymce, ed) { parent = parent.parentNode; } - + return parent !== root ? editableRoot : root; };