app/assets/source/tinymce/tinymce.jquery.js in tinymce-rails-4.3.1 vs app/assets/source/tinymce/tinymce.jquery.js in tinymce-rails-4.3.2

- old
+ new

@@ -1,6 +1,6 @@ -// 4.3.1 (2015-11-30) +// 4.3.2 (2015-12-14) /** * Compiled inline version. (Library mode) */ @@ -1304,12 +1304,16 @@ * @class tinymce.Env * @static */ define("tinymce/Env", [], function() { var nav = navigator, userAgent = nav.userAgent; - var opera, webkit, ie, ie11, ie12, gecko, mac, iDevice, android, fileApi; + var opera, webkit, ie, ie11, ie12, gecko, mac, iDevice, android, fileApi, phone, tablet; + function matchMediaQuery(query) { + return "matchMedia" in window ? matchMedia(query).matches : false; + } + opera = window.opera && window.opera.buildNumber; android = /Android/.test(userAgent); webkit = /WebKit/.test(userAgent); ie = !webkit && !opera && (/MSIE/gi).test(userAgent) && (/Explorer/gi).test(nav.appName); ie = ie && /MSIE (\w+)\./.exec(userAgent)[1]; @@ -1318,10 +1322,12 @@ ie = ie || ie11 || ie12; gecko = !webkit && !ie11 && /Gecko/.test(userAgent); mac = userAgent.indexOf('Mac') != -1; iDevice = /(iPad|iPhone)/.test(userAgent); fileApi = "FormData" in window && "FileReader" in window && "URL" in window && !!URL.createObjectURL; + phone = matchMediaQuery("only screen and (max-device-width: 480px)") && (android || iDevice); + tablet = matchMediaQuery("only screen and (min-width: 800px)") && (android || iDevice); if (ie12) { webkit = false; } @@ -1448,11 +1454,13 @@ * Constant that is true if the browser supports contentEditable=false regions. * * @property ceFalse * @type Boolean */ - ceFalse: (ie === false || ie > 8) + ceFalse: (ie === false || ie > 8), + + desktop: !phone && !tablet }; }); // Included from: js/tinymce/classes/util/Arr.js @@ -19779,10 +19787,12 @@ if (dom.isEmpty(parentBlock)) { emptyBlock(parentBlock); } + newBlock.normalize(); + // New block might become empty if it's <p><b>a |</b></p> if (dom.isEmpty(newBlock)) { dom.remove(newBlock); insertNewBlockAfter(); } else { @@ -26970,11 +26980,11 @@ h: h }; $(window).trigger('resize'); } - }); + }, 100); function reposition() { var i, rect = DomUtils.getWindowSize(), layoutRect; for (i = 0; i < windows.length; i++) { @@ -32590,10 +32600,19 @@ state = {}; } editor.on('mousedown', start); + + // Blocks drop inside cE=false on IE + editor.on('drop', function(e) { + var realTarget = editor.getDoc().elementFromPoint(e.clientX, e.clientY); + + if (isContentEditableFalse(realTarget) || isContentEditableFalse(editor.dom.getContentEditableParent(realTarget))) { + e.preventDefault(); + } + }); } return { init: init }; @@ -32674,11 +32693,13 @@ return editor.dom.isBlock(node); } function setRange(range) { //console.log('setRange', range); - editor.selection.setRng(range); + if (range) { + editor.selection.setRng(range); + } } function getRange() { return editor.selection.getRng(); } @@ -32934,21 +32955,13 @@ setRange(getRange()); scrollIntoView(blockCaretContainer[0]); } } - function renderRangeCaret(range) { + function renderCaretAtRange(range) { var caretPosition; - if (!range) { - return range; - } - - if (!range.collapsed) { - return range; - } - range = CaretUtils.normalizeRange(1, rootNode, range); caretPosition = CaretPosition.fromRangeStart(range); if (isContentEditableFalse(caretPosition.getNode())) { return showCaret(1, caretPosition.getNode(), !caretPosition.isAtEnd()); @@ -32958,10 +32971,25 @@ return showCaret(1, caretPosition.getNode(true), false); } fakeCaret.hide(); + return null; + } + + function renderRangeCaret(range) { + var caretRange; + + if (!range || !range.collapsed) { + return range; + } + + caretRange = renderCaretAtRange(range); + if (caretRange) { + return caretRange; + } + return range; } function deleteContentEditableNode(node) { var nextCaretPosition, prevCaretPosition, prevCeFalseElm, nextElement; @@ -33067,11 +33095,11 @@ // Make sure we render the caret container in this case editor.on('mouseup', function() { var range = getRange(); if (range.collapsed) { - setRange(renderRangeCaret(range)); + setRange(renderCaretAtRange(range)); } }); editor.on('mousedown', function(e) { var contentEditableRoot; @@ -36096,18 +36124,18 @@ * Minor version of TinyMCE build. * * @property minorVersion * @type String */ - minorVersion: '3.1', + minorVersion: '3.2', /** * Release date of TinyMCE build. * * @property releaseDate * @type String */ - releaseDate: '2015-11-30', + releaseDate: '2015-12-14', /** * Collection of editor instances. * * @property editors \ No newline at end of file