Large diffs are not rendered by default.

@@ -4,7 +4,7 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.2 (2020-06-10)
* Version: 5.4.0 (2020-06-30)
*/
(function (domGlobals) {
'use strict';
@@ -655,10 +655,9 @@

var ELEMENT = 1;

var ELEMENT$1 = ELEMENT;
var is = function (element, selector) {
var dom = element.dom();
if (dom.nodeType !== ELEMENT$1) {
if (dom.nodeType !== ELEMENT) {
return false;
} else {
var elem = dom;
@@ -711,6 +710,22 @@
return Element.fromDom(fragment);
};

var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')();

var name = function (element) {
var r = element.dom().nodeName;
return r.toLowerCase();
};
var type = function (element) {
return element.dom().nodeType;
};
var isType$1 = function (t) {
return function (element) {
return type(element) === t;
};
};
var isElement = isType$1(ELEMENT);

var parent = function (element) {
return Option.from(element.dom().parentNode).map(Element.fromDom);
};
@@ -763,8 +778,6 @@
});
};

var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')();

var global$4 = tinymce.util.Tools.resolve('tinymce.dom.DomQuery');

var global$5 = tinymce.util.Tools.resolve('tinymce.util.Tools');
@@ -973,20 +986,6 @@
return t;
};

var name = function (element) {
var r = element.dom().nodeName;
return r.toLowerCase();
};
var type = function (element) {
return element.dom().nodeType;
};
var isType$1 = function (t) {
return function (element) {
return type(element) === t;
};
};
var isElement = isType$1(ELEMENT);

var rawSet = function (dom, key, value) {
if (isString(value) || isBoolean(value) || isNumber(value)) {
dom.setAttribute(key, value + '');
@@ -1012,6 +1011,8 @@
return dom.style !== undefined && isFunction(dom.style.getPropertyValue);
};

var supported = isFunction(domGlobals.Element.prototype.attachShadow) && isFunction(domGlobals.Node.prototype.getRootNode);

var internalSet = function (dom, property, value) {
if (!isString(value)) {
domGlobals.console.error('Invalid call to CSS.set. Property ', property, ':: Value ', value, ':: Element ', dom);
@@ -1308,20 +1309,19 @@

var DOM = global$6.DOM;
var splitList = function (editor, ul, li) {
var tmpRng, fragment, bookmarks, node, newBlock;
var removeAndKeepBookmarks = function (targetNode) {
global$5.each(bookmarks, function (node) {
targetNode.parentNode.insertBefore(node, li.parentNode);
});
DOM.remove(targetNode);
};
bookmarks = DOM.select('span[data-mce-type="bookmark"]', ul);
newBlock = createTextBlock(editor, li);
tmpRng = DOM.createRng();
var bookmarks = DOM.select('span[data-mce-type="bookmark"]', ul);
var newBlock = createTextBlock(editor, li);
var tmpRng = DOM.createRng();
tmpRng.setStartAfter(li);
tmpRng.setEndAfter(ul);
fragment = tmpRng.extractContents();
for (node = fragment.firstChild; node; node = node.firstChild) {
var fragment = tmpRng.extractContents();
for (var node = fragment.firstChild; node; node = node.firstChild) {
if (node.nodeName === 'LI' && editor.dom.isEmpty(node)) {
DOM.remove(node);
break;
@@ -1502,6 +1502,17 @@
return normalizeRange(rng);
};

var listToggleActionFromListName = function (listName) {
switch (listName) {
case 'UL':
return 'ToggleUlList';
case 'OL':
return 'ToggleOlList';
case 'DL':
return 'ToggleDLList';
}
};

var isCustomList = function (list) {
return /\btox\-/.test(list.className);
};
@@ -1520,17 +1531,6 @@
};
};

var listToggleActionFromListName = function (listName) {
switch (listName) {
case 'UL':
return 'ToggleUlList';
case 'OL':
return 'ToggleOlList';
case 'DL':
return 'ToggleDLList';
}
};

var updateListStyle = function (dom, el, detail) {
var type = detail['list-style-type'] ? detail['list-style-type'] : null;
dom.setStyle(el, 'list-style-type', type);
@@ -1557,9 +1557,8 @@
});
};
var getEndPointNode = function (editor, rng, start, root) {
var container, offset;
container = rng[start ? 'startContainer' : 'endContainer'];
offset = rng[start ? 'startOffset' : 'endOffset'];
var container = rng[start ? 'startContainer' : 'endContainer'];
var offset = rng[start ? 'startOffset' : 'endOffset'];
if (container.nodeType === 1) {
container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container;
}
@@ -1628,8 +1627,7 @@
if (detail === void 0) {
detail = {};
}
var rng = editor.selection.getRng(true);
var bookmark;
var rng = editor.selection.getRng();
var listItemName = 'LI';
var root = getClosestListRootElm(editor, editor.selection.getStart(true));
var dom = editor.dom;
@@ -1640,10 +1638,10 @@
if (listName === 'DL') {
listItemName = 'DT';
}
bookmark = createBookmark(rng);
var bookmark = createBookmark(rng);
global$5.each(getSelectedTextBlocks(editor, rng, root), function (block) {
var listBlock, sibling;
sibling = block.previousSibling;
var listBlock;
var sibling = block.previousSibling;
if (sibling && isListNode(sibling) && sibling.nodeName === listName && hasCompatibleStyle(dom, sibling, detail)) {
listBlock = sibling;
block = dom.rename(block, listItemName);
@@ -1823,8 +1821,8 @@
}
};
var moveChildren = function (dom, fromElm, toElm) {
var node, targetElm;
targetElm = hasOnlyOneBlockChild(dom, toElm) ? toElm.firstChild : toElm;
var node;
var targetElm = hasOnlyOneBlockChild(dom, toElm) ? toElm.firstChild : toElm;
unwrapSingleBlockChild(dom, fromElm);
if (!isEmpty(dom, fromElm, true)) {
while (node = fromElm.firstChild) {
@@ -1833,7 +1831,7 @@
}
};
var mergeLiElements = function (dom, fromElm, toElm) {
var node, listNode;
var listNode;
var ul = fromElm.parentNode;
if (!isChildOfBody(dom, fromElm) || !isChildOfBody(dom, toElm)) {
return;
@@ -1846,7 +1844,7 @@
dom.remove(ul.previousSibling);
}
}
node = toElm.lastChild;
var node = toElm.lastChild;
if (node && isBr(node) && fromElm.hasChildNodes()) {
dom.remove(node);
}
@@ -2068,7 +2066,7 @@
};

var hasRtcPlugin = function (editor) {
if (/(^|[ ,])rtc([, ]|$)/.test(editor.settings.plugins) && global.get('rtc')) {
if (/(^|[ ,])rtc([, ]|$)/.test(editor.getParam('plugins', '', 'string')) && global.get('rtc')) {
return true;
} else {
return false;
@@ -2096,7 +2094,7 @@

var register$1 = function (editor) {
var hasPlugin = function (editor, plugin) {
var plugins = editor.settings.plugins ? editor.settings.plugins : '';
var plugins = editor.getParam('plugins', '', 'string');
return global$5.inArray(plugins.split(/[ ,]/), plugin) !== -1;
};
var exec = function (command) {

Large diffs are not rendered by default.

@@ -4,7 +4,7 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.2 (2020-06-10)
* Version: 5.4.0 (2020-06-30)
*/
(function () {
'use strict';
@@ -1043,9 +1043,8 @@
};

var createPlaceholderNode = function (editor, node) {
var placeHolder;
var name = node.name;
placeHolder = new global$7('img', 1);
var placeHolder = new global$7('img', 1);
placeHolder.shortEnded = true;
retainAttributesAndInnerHtml(editor, node, placeHolder);
placeHolder.attr({
@@ -1059,19 +1058,16 @@
return placeHolder;
};
var createPreviewIframeNode = function (editor, node) {
var previewWrapper;
var previewNode;
var shimNode;
var name = node.name;
previewWrapper = new global$7('span', 1);
var previewWrapper = new global$7('span', 1);
previewWrapper.attr({
'contentEditable': 'false',
'style': node.attr('style'),
'data-mce-object': name,
'class': 'mce-preview-object mce-object-' + name
});
retainAttributesAndInnerHtml(editor, node, previewWrapper);
previewNode = new global$7(name, 1);
var previewNode = new global$7(name, 1);
previewNode.attr({
src: node.attr('src'),
allowfullscreen: node.attr('allowfullscreen'),
@@ -1081,7 +1077,7 @@
height: node.attr('height'),
frameborder: '0'
});
shimNode = new global$7('span', 1);
var shimNode = new global$7('span', 1);
shimNode.attr('class', 'mce-shim');
previewWrapper.append(previewNode);
previewWrapper.append(shimNode);
@@ -1090,10 +1086,8 @@
var retainAttributesAndInnerHtml = function (editor, sourceNode, targetNode) {
var attrName;
var attrValue;
var attribs;
var ai;
var innerHtml;
attribs = sourceNode.attributes;
var attribs = sourceNode.attributes;
ai = attribs.length;
while (ai--) {
attrName = attribs[ai].name;
@@ -1105,7 +1099,7 @@
targetNode.attr('data-mce-p-' + attrName, attrValue);
}
}
innerHtml = sourceNode.firstChild && sourceNode.firstChild.value;
var innerHtml = sourceNode.firstChild && sourceNode.firstChild.value;
if (innerHtml) {
targetNode.attr('data-mce-html', escape(sanitize(editor, innerHtml)));
targetNode.firstChild = null;

Large diffs are not rendered by default.

@@ -4,7 +4,7 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.2 (2020-06-10)
* Version: 5.4.0 (2020-06-30)
*/
(function () {
'use strict';
@@ -4,7 +4,7 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.2 (2020-06-10)
* Version: 5.4.0 (2020-06-30)
*/
(function () {
'use strict';
@@ -63,10 +63,9 @@
e.content = content;
};
var setup = function (editor) {
var editClass, nonEditClass;
var contentEditableAttrName = 'contenteditable';
editClass = ' ' + global$1.trim(getEditableClass(editor)) + ' ';
nonEditClass = ' ' + global$1.trim(getNonEditableClass(editor)) + ' ';
var editClass = ' ' + global$1.trim(getEditableClass(editor)) + ' ';
var nonEditClass = ' ' + global$1.trim(getNonEditableClass(editor)) + ' ';
var hasEditClass = hasClass(editClass);
var hasNonEditClass = hasClass(nonEditClass);
var nonEditableRegExps = getNonEditableRegExps(editor);
@@ -4,7 +4,7 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.2 (2020-06-10)
* Version: 5.4.0 (2020-06-30)
*/
(function () {
'use strict';
@@ -60,7 +60,7 @@

var register = function (editor) {
editor.addCommand('mcePageBreak', function () {
if (editor.settings.pagebreak_split_block) {
if (shouldSplitBlock(editor)) {
editor.insertContent('<p>' + getPlaceholderHtml() + '</p>');
} else {
editor.insertContent(getPlaceholderHtml());
@@ -4,7 +4,7 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.2 (2020-06-10)
* Version: 5.4.0 (2020-06-30)
*/
(function (domGlobals) {
'use strict';
@@ -26,7 +26,7 @@
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');

var hasProPlugin = function (editor) {
if (/(^|[ ,])powerpaste([, ]|$)/.test(editor.settings.plugins) && global.get('powerpaste')) {
if (/(^|[ ,])powerpaste([, ]|$)/.test(editor.getParam('plugins')) && global.get('powerpaste')) {
if (typeof domGlobals.window.console !== 'undefined' && domGlobals.window.console.log) {
domGlobals.window.console.log('PowerPaste is incompatible with Paste plugin! Remove \'paste\' from the \'plugins\' option.');
}
@@ -339,6 +339,8 @@

var global$8 = tinymce.util.Tools.resolve('tinymce.html.Serializer');

var nbsp = '\xA0';

var global$9 = tinymce.util.Tools.resolve('tinymce.html.Node');

var global$a = tinymce.util.Tools.resolve('tinymce.html.Schema');
@@ -386,8 +388,27 @@
var shouldUseDefaultFilters = function (editor) {
return editor.getParam('paste_enable_default_filters', true);
};

var nbsp = '\xA0';
var getValidate = function (editor) {
return editor.getParam('validate');
};
var getAllowHtmlDataUrls = function (editor) {
return editor.getParam('allow_html_data_urls', false, 'boolean');
};
var getPasteDataImages = function (editor) {
return editor.getParam('paste_data_images', false, 'boolean');
};
var getImagesDataImgFilter = function (editor) {
return editor.getParam('images_dataimg_filter');
};
var getImagesReuseFilename = function (editor) {
return editor.getParam('images_reuse_filename');
};
var getForcedRootBlock = function (editor) {
return editor.getParam('forced_root_block');
};
var getForcedRootBlockAttrs = function (editor) {
return editor.getParam('forced_root_block_attrs');
};

function filter$1(content, items) {
global$4.each(items, function (v) {
@@ -476,8 +497,8 @@
return /<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(content) || /class="OutlineElement/.test(content) || /id="?docs\-internal\-guid\-/.test(content);
}
function isNumericList(text) {
var found, patterns;
patterns = [
var found;
var patterns = [
/^[IVXLMCD]{1,2}\.[ \u00a0]/,
/^[ivxlmcd]{1,2}\.[ \u00a0]/,
/^[a-z]{1,2}[\.\)][ \u00a0]/,
@@ -678,8 +699,8 @@
return null;
}
var filterWordContent = function (editor, content) {
var retainStyleProperties, validStyles;
retainStyleProperties = getRetainStyleProps(editor);
var validStyles;
var retainStyleProperties = getRetainStyleProps(editor);
if (retainStyleProperties) {
validStyles = global$4.makeMap(retainStyleProperties.split(/[, ]/));
}
@@ -780,7 +801,7 @@
if (shouldConvertWordFakeLists(editor)) {
convertFakeListsToProperLists(rootNode);
}
content = global$8({ validate: editor.settings.validate }, schema).serialize(rootNode);
content = global$8({ validate: getValidate(editor) }, schema).serialize(rootNode);
return content;
};
var preProcess = function (editor, content) {
@@ -798,7 +819,7 @@
forced_root_block: false,
isRootContent: true
});
return global$8({ validate: editor.settings.validate }, editor.schema).serialize(fragment);
return global$8({ validate: getValidate(editor) }, editor.schema).serialize(fragment);
};
var processResult = function (content, cancelled) {
return {
@@ -927,7 +948,7 @@
var pasteText = function (editor, text) {
var encodedText = editor.dom.encode(text).replace(/\r\n/g, '\n');
var normalizedText = normalizeWhitespace(encodedText);
var html = convert(normalizedText, editor.settings.forced_root_block, editor.settings.forced_root_block_attrs);
var html = convert(normalizedText, getForcedRootBlock(editor), getForcedRootBlockAttrs(editor));
doPaste(editor, html, false, true);
};
var getDataTransferItems = function (dataTransfer) {
@@ -979,8 +1000,9 @@
};
}
};
var isValidDataUriImage = function (settings, imgElm) {
return settings.images_dataimg_filter ? settings.images_dataimg_filter(imgElm) : true;
var isValidDataUriImage = function (editor, imgElm) {
var filter = getImagesDataImgFilter(editor);
return filter ? filter(imgElm) : true;
};
var extractFilename = function (editor, str) {
var m = str.match(/([\s\S]+?)\.(?:jpeg|jpg|png|gif)$/i);
@@ -990,10 +1012,10 @@
var pasteImage = function (editor, imageItem) {
var _a = parseDataUri(imageItem.uri), base64 = _a.data, type = _a.type;
var id = uniqueId();
var name = editor.settings.images_reuse_filename && imageItem.blob.name ? extractFilename(editor, imageItem.blob.name) : id;
var name = getImagesReuseFilename(editor) && imageItem.blob.name ? extractFilename(editor, imageItem.blob.name) : id;
var img = new domGlobals.Image();
img.src = imageItem.uri;
if (isValidDataUriImage(editor.settings, img)) {
if (isValidDataUriImage(editor, img)) {
var blobCache = editor.editorUpload.blobCache;
var blobInfo = void 0;
var existingBlobInfo = blobCache.getByData(base64, type);
@@ -1038,7 +1060,7 @@
};
var pasteImageData = function (editor, e, rng) {
var dataTransfer = isClipboardEvent(e) ? e.clipboardData : e.dataTransfer;
if (editor.settings.paste_data_images && dataTransfer) {
if (getPasteDataImages(editor) && dataTransfer) {
var images = getImagesFromDataTransfer(dataTransfer);
if (images.length > 0) {
e.preventDefault();
@@ -1095,7 +1117,7 @@
}
});
function insertClipboardContent(clipboardContent, isKeyBoardPaste, plainTextMode, internal) {
var content, isPlainTextHtml, isImage;
var content;
if (hasContentType(clipboardContent, 'text/html')) {
content = clipboardContent['text/html'];
} else {
@@ -1107,8 +1129,8 @@
}
content = trimHtml(content);
pasteBin.remove();
isPlainTextHtml = internal === false && isPlainText(content);
isImage = isImageUrl(content);
var isPlainTextHtml = internal === false && isPlainText(content);
var isImage = isImageUrl(content);
if (!content.length || isPlainTextHtml && !isImage) {
plainTextMode = true;
}
@@ -1190,7 +1212,7 @@
var isDataUri = function (src) {
return src.indexOf('data:') === 0;
};
if (!editor.settings.paste_data_images && isPasteInsert(args)) {
if (!getPasteDataImages(editor) && isPasteInsert(args)) {
var i = nodes.length;
while (i--) {
src = nodes[i].attr('src');
@@ -1199,7 +1221,7 @@
}
if (isWebKitFakeUrl(src)) {
remove(nodes[i]);
} else if (!editor.settings.allow_html_data_urls && isDataUri(src)) {
} else if (!getAllowHtmlDataUrls(editor) && isDataUri(src)) {
remove(nodes[i]);
}
}
@@ -1224,9 +1246,8 @@
};
var create = function (editor, lastRngCell, pasteBinDefaultContent) {
var dom = editor.dom, body = editor.getBody();
var pasteBinElm;
lastRngCell.set(editor.selection.getRng());
pasteBinElm = editor.dom.add(getPasteBinParent(editor), 'div', {
var pasteBinElm = editor.dom.add(getPasteBinParent(editor), 'div', {
'id': 'mcepastebin',
'class': 'mce-pastebin',
'contentEditable': true,
@@ -1261,21 +1282,20 @@
return editor.dom.get('mcepastebin');
};
var getHtml = function (editor) {
var pasteBinElm, pasteBinClones, i, dirtyWrappers, cleanWrapper;
var copyAndRemove = function (toElm, fromElm) {
toElm.appendChild(fromElm);
editor.dom.remove(fromElm, true);
};
pasteBinClones = global$4.grep(getPasteBinParent(editor).childNodes, function (elm) {
var pasteBinClones = global$4.grep(getPasteBinParent(editor).childNodes, function (elm) {
return elm.id === 'mcepastebin';
});
pasteBinElm = pasteBinClones.shift();
var pasteBinElm = pasteBinClones.shift();
global$4.each(pasteBinClones, function (pasteBinClone) {
copyAndRemove(pasteBinElm, pasteBinClone);
});
dirtyWrappers = editor.dom.select('div[id=mcepastebin]', pasteBinElm);
for (i = dirtyWrappers.length - 1; i >= 0; i--) {
cleanWrapper = editor.dom.create('div');
var dirtyWrappers = editor.dom.select('div[id=mcepastebin]', pasteBinElm);
for (var i = dirtyWrappers.length - 1; i >= 0; i--) {
var cleanWrapper = editor.dom.create('div');
pasteBinElm.insertBefore(cleanWrapper, dirtyWrappers[i]);
copyAndRemove(cleanWrapper, dirtyWrappers[i]);
}
@@ -1470,12 +1490,11 @@
});
}
editor.on('drop', function (e) {
var dropContent, rng;
rng = getCaretRangeFromEvent(editor, e);
var rng = getCaretRangeFromEvent(editor, e);
if (e.isDefaultPrevented() || draggingInternallyState.get()) {
return;
}
dropContent = clipboard.getDataTransferItems(e.dataTransfer);
var dropContent = clipboard.getDataTransferItems(e.dataTransfer);
var internal = clipboard.hasContentType(dropContent, internalHtmlMime());
if ((!clipboard.hasHtmlOrText(dropContent) || isPlainTextFileUrl(dropContent)) && clipboard.pasteImageData(e, rng)) {
return;

Large diffs are not rendered by default.

@@ -4,23 +4,47 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.2 (2020-06-10)
* Version: 5.4.0 (2020-06-30)
*/
(function () {
'use strict';

var global = tinymce.util.Tools.resolve('tinymce.PluginManager');

var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var global$1 = tinymce.util.Tools.resolve('tinymce.Env');

var global$2 = tinymce.util.Tools.resolve('tinymce.util.Tools');

var getContentStyle = function (editor) {
return editor.getParam('content_style', '');
};
var shouldUseContentCssCors = function (editor) {
return editor.getParam('content_css_cors', false, 'boolean');
};

var global$2 = tinymce.util.Tools.resolve('tinymce.Env');
var getBodyClassByHash = function (editor) {
var bodyClass = editor.getParam('body_class', '', 'hash');
return bodyClass[editor.id] || '';
};
var getBodyClass = function (editor) {
var bodyClass = editor.getParam('body_class', '', 'string');
if (bodyClass.indexOf('=') === -1) {
return bodyClass;
} else {
return getBodyClassByHash(editor);
}
};
var getBodyIdByHash = function (editor) {
var bodyId = editor.getParam('body_id', '', 'hash');
return bodyId[editor.id] || bodyId;
};
var getBodyId = function (editor) {
var bodyId = editor.getParam('body_id', 'tinymce', 'string');
if (bodyId.indexOf('=') === -1) {
return bodyId;
} else {
return getBodyIdByHash(editor);
}
};

var getPreviewHtml = function (editor) {
var headHtml = '';
@@ -31,20 +55,12 @@
headHtml += '<style type="text/css">' + contentStyle + '</style>';
}
var cors = shouldUseContentCssCors(editor) ? ' crossorigin="anonymous"' : '';
global$1.each(editor.contentCSS, function (url) {
global$2.each(editor.contentCSS, function (url) {
headHtml += '<link type="text/css" rel="stylesheet" href="' + encode(editor.documentBaseURI.toAbsolute(url)) + '"' + cors + '>';
});
var bodyId = editor.settings.body_id || 'tinymce';
if (bodyId.indexOf('=') !== -1) {
bodyId = editor.getParam('body_id', '', 'hash');
bodyId = bodyId[editor.id] || bodyId;
}
var bodyClass = editor.settings.body_class || '';
if (bodyClass.indexOf('=') !== -1) {
bodyClass = editor.getParam('body_class', '', 'hash');
bodyClass = bodyClass[editor.id] || '';
}
var isMetaKeyPressed = global$2.mac ? 'e.metaKey' : 'e.ctrlKey && !e.altKey';
var bodyId = getBodyId(editor);
var bodyClass = getBodyClass(editor);
var isMetaKeyPressed = global$1.mac ? 'e.metaKey' : 'e.ctrlKey && !e.altKey';
var preventClicksOnLinksScript = '<script>' + 'document.addEventListener && document.addEventListener("click", function(e) {' + 'for (var elm = e.target; elm; elm = elm.parentNode) {' + 'if (elm.nodeName === "A" && !(' + isMetaKeyPressed + ')) {' + 'e.preventDefault();' + '}' + '}' + '}, false);' + '</script> ';
var directionality = editor.getBody().dir;
var dirAttr = directionality ? ' dir="' + encode(directionality) + '"' : '';
@@ -4,7 +4,7 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.2 (2020-06-10)
* Version: 5.4.0 (2020-06-30)
*/
(function () {
'use strict';
@@ -4,6 +4,6 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.2 (2020-06-10)
* Version: 5.4.0 (2020-06-30)
*/
!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.Env");!function t(){n.add("print",function(n){var t,i;(t=n).addCommand("mcePrint",function(){e.browser.isIE()?t.getDoc().execCommand("print",!1,null):t.getWin().print()}),(i=n).ui.registry.addButton("print",{icon:"print",tooltip:"Print",onAction:function(){return i.execCommand("mcePrint")}}),i.ui.registry.addMenuItem("print",{text:"Print...",icon:"print",onAction:function(){return i.execCommand("mcePrint")}}),n.addShortcut("Meta+P","","mcePrint")})}()}();
@@ -4,7 +4,7 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.2 (2020-06-10)
* Version: 5.4.0 (2020-06-30)
*/
(function (domGlobals) {
'use strict';
@@ -41,21 +41,19 @@
};
var insertTableHtml = function (editor, cols, rows) {
editor.undoManager.transact(function () {
var tableElm, cellElm;
editor.insertContent(createTableHtml(cols, rows));
tableElm = getInsertedElement(editor);
var tableElm = getInsertedElement(editor);
tableElm.removeAttribute('data-mce-id');
cellElm = editor.dom.select('td,th', tableElm);
var cellElm = editor.dom.select('td,th', tableElm);
editor.selection.setCursorLocation(cellElm[0], 0);
});
};
var insertTable = function (editor, cols, rows) {
editor.plugins.table ? editor.plugins.table.insertTable(cols, rows) : insertTableHtml(editor, cols, rows);
};
var insertBlob = function (editor, base64, blob) {
var blobCache, blobInfo;
blobCache = editor.editorUpload.blobCache;
blobInfo = blobCache.create(generate('mceu'), blob, base64);
var blobCache = editor.editorUpload.blobCache;
var blobInfo = blobCache.create(generate('mceu'), blob, base64);
blobCache.add(blobInfo);
editor.insertContent(editor.dom.createHTML('img', { src: blobInfo.blobUri() }));
};
@@ -332,10 +330,9 @@
return is(scope, a) ? Option.some(scope) : isFunction(isRoot) && isRoot(scope) ? Option.none() : ancestor(scope, a, isRoot);
}

var ELEMENT$1 = ELEMENT;
var is = function (element, selector) {
var dom = element.dom();
if (dom.nodeType !== ELEMENT$1) {
if (dom.nodeType !== ELEMENT) {
return false;
} else {
var elem = dom;
@@ -353,6 +350,8 @@
}
};

var supported = isFunction(domGlobals.Element.prototype.attachShadow) && isFunction(domGlobals.Node.prototype.getRootNode);

var ancestor = function (scope, predicate, isRoot) {
var element = scope.dom();
var stop = isFunction(isRoot) ? isRoot : constant(false);
@@ -4,7 +4,7 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.2 (2020-06-10)
* Version: 5.4.0 (2020-06-30)
*/
(function () {
'use strict';
@@ -32,8 +32,7 @@
});
};
var save = function (editor) {
var formObj;
formObj = global$1.DOM.getParent(editor.id, 'form');
var formObj = global$1.DOM.getParent(editor.id, 'form');
if (enableWhenDirty(editor) && !editor.isDirty()) {
return;
}
@@ -4,7 +4,7 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.2 (2020-06-10)
* Version: 5.4.0 (2020-06-30)
*/
(function (domGlobals) {
'use strict';
@@ -187,6 +187,7 @@
var isString = isType('string');
var isArray = isType('array');
var isBoolean = isSimpleType('boolean');
var isFunction = isSimpleType('function');
var isNumber = isSimpleType('number');

var nativeSlice = Array.prototype.slice;
@@ -268,6 +269,7 @@
var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')();

var DOCUMENT = 9;
var DOCUMENT_FRAGMENT = 11;
var ELEMENT = 1;
var TEXT = 3;

@@ -338,10 +340,8 @@
return compareDocumentPosition(a, b, domGlobals.Node.DOCUMENT_POSITION_PRECEDING);
};

var ELEMENT$1 = ELEMENT;
var DOCUMENT$1 = DOCUMENT;
var bypassSelector = function (dom) {
return dom.nodeType !== ELEMENT$1 && dom.nodeType !== DOCUMENT$1 || dom.childElementCount === 0;
return dom.nodeType !== ELEMENT && dom.nodeType !== DOCUMENT && dom.nodeType !== DOCUMENT_FRAGMENT || dom.childElementCount === 0;
};
var all = function (selector, scope) {
var base = scope === undefined ? domGlobals.document : scope.dom();
@@ -407,6 +407,8 @@
return api.get(element);
};

var supported = isFunction(domGlobals.Element.prototype.attachShadow) && isFunction(domGlobals.Node.prototype.getRootNode);

var descendants = function (scope, selector) {
return all(selector, scope);
};
@@ -671,10 +673,9 @@
return value;
};
var markAllMatches = function (editor, currentSearchState, pattern, inSelection) {
var node, marker;
marker = editor.dom.create('span', { 'data-mce-bogus': 1 });
var marker = editor.dom.create('span', { 'data-mce-bogus': 1 });
marker.className = 'mce-match-marker';
node = editor.getBody();
var node = editor.getBody();
done(editor, currentSearchState, false);
if (inSelection) {
return findAndMarkInSelection(editor.dom, pattern, editor.selection, marker);
@@ -690,9 +691,8 @@
node.parentNode.removeChild(node);
};
var findSpansByIndex = function (editor, index) {
var nodes;
var spans = [];
nodes = global$1.toArray(editor.getBody().getElementsByTagName('span'));
var nodes = global$1.toArray(editor.getBody().getElementsByTagName('span'));
if (nodes.length) {
for (var i = 0; i < nodes.length; i++) {
var nodeIndex = getElmIndex(nodes[i]);
@@ -780,13 +780,13 @@
var replace = function (editor, currentSearchState, text, forward, all) {
var searchState = currentSearchState.get();
var currentIndex = searchState.index;
var i, nodes, node, matchIndex, currentMatchIndex, nextIndex = currentIndex;
var currentMatchIndex, nextIndex = currentIndex;
forward = forward !== false;
node = editor.getBody();
nodes = global$1.grep(global$1.toArray(node.getElementsByTagName('span')), isMatchSpan);
for (i = 0; i < nodes.length; i++) {
var node = editor.getBody();
var nodes = global$1.grep(global$1.toArray(node.getElementsByTagName('span')), isMatchSpan);
for (var i = 0; i < nodes.length; i++) {
var nodeIndex = getElmIndex(nodes[i]);
matchIndex = currentMatchIndex = parseInt(nodeIndex, 10);
var matchIndex = currentMatchIndex = parseInt(nodeIndex, 10);
if (all || matchIndex === searchState.index) {
if (text.length) {
nodes[i].firstChild.nodeValue = text;
@@ -822,9 +822,9 @@
return !all && currentSearchState.get().count > 0;
};
var done = function (editor, currentSearchState, keepEditorSelection) {
var i, nodes, startContainer, endContainer;
var i, startContainer, endContainer;
var searchState = currentSearchState.get();
nodes = global$1.toArray(editor.getBody().getElementsByTagName('span'));
var nodes = global$1.toArray(editor.getBody().getElementsByTagName('span'));
for (i = 0; i < nodes.length; i++) {
var nodeIndex = getElmIndex(nodes[i]);
if (nodeIndex !== null && nodeIndex.length) {

Large diffs are not rendered by default.

@@ -4,7 +4,7 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.2 (2020-06-10)
* Version: 5.4.0 (2020-06-30)
*/
(function (domGlobals) {
'use strict';
@@ -26,7 +26,7 @@
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');

var hasProPlugin = function (editor) {
if (/(^|[ ,])tinymcespellchecker([, ]|$)/.test(editor.settings.plugins) && global.get('tinymcespellchecker')) {
if (/(^|[ ,])tinymcespellchecker([, ]|$)/.test(editor.getParam('plugins')) && global.get('tinymcespellchecker')) {
if (typeof domGlobals.window.console !== 'undefined' && domGlobals.window.console.log) {
domGlobals.window.console.log('Spell Checker Pro is incompatible with Spell Checker plugin! ' + 'Remove \'spellchecker\' from the \'plugins\' option.');
}
@@ -36,6 +36,16 @@
}
};

var hasOwnProperty = Object.hasOwnProperty;
var isEmpty = function (r) {
for (var x in r) {
if (hasOwnProperty.call(r, x)) {
return false;
}
}
return true;
};

var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');

var global$2 = tinymce.util.Tools.resolve('tinymce.util.URI');
@@ -72,12 +82,11 @@
return node && node.nodeType === 1 && node.contentEditable === 'false';
}
var DomTextMatcher = function (node, editor) {
var m, matches = [], text;
var m, matches = [];
var dom = editor.dom;
var blockElementsMap, hiddenTextElementsMap, shortEndedElementsMap;
blockElementsMap = editor.schema.getBlockElements();
hiddenTextElementsMap = editor.schema.getWhiteSpaceElements();
shortEndedElementsMap = editor.schema.getShortEndedElements();
var blockElementsMap = editor.schema.getBlockElements();
var hiddenTextElementsMap = editor.schema.getWhiteSpaceElements();
var shortEndedElementsMap = editor.schema.getShortEndedElements();
function createMatch(m, data) {
if (!m[0]) {
throw new Error('findAndReplaceDOMText cannot handle zero-length matches');
@@ -341,7 +350,7 @@
unwrap();
return this;
}
text = getText(node);
var text = getText(node);
return {
text: text,
matches: matches,
@@ -360,16 +369,6 @@
};
};

var hasOwnProperty = Object.hasOwnProperty;
var isEmpty = function (r) {
for (var x in r) {
if (hasOwnProperty.call(r, x)) {
return false;
}
}
return true;
};

var getTextMatcher = function (editor, textMatcherState) {
if (!textMatcherState.get()) {
var textMatcher = DomTextMatcher(editor.getBody(), editor);
@@ -489,9 +488,8 @@
return value;
};
var findSpansByIndex = function (editor, index) {
var nodes;
var spans = [];
nodes = global$1.toArray(editor.getBody().getElementsByTagName('span'));
var nodes = global$1.toArray(editor.getBody().getElementsByTagName('span'));
if (nodes.length) {
for (var i = 0; i < nodes.length; i++) {
var nodeIndex = getElmIndex(nodes[i]);

Large diffs are not rendered by default.

@@ -4,7 +4,7 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.2 (2020-06-10)
* Version: 5.4.0 (2020-06-30)
*/
(function (domGlobals) {
'use strict';
@@ -38,7 +38,7 @@
};
var setup = function (editor) {
function tabHandler(e) {
var x, el, v, i;
var x, el, i;
if (e.keyCode !== global$6.TAB || e.ctrlKey || e.altKey || e.metaKey || e.isDefaultPrevented()) {
return;
}
@@ -71,7 +71,7 @@
}
return null;
}
v = global$5.explode(getTabFocus(editor));
var v = global$5.explode(getTabFocus(editor));
if (v.length === 1) {
v[1] = v[0];
v[0] = ':prev';

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -4,7 +4,7 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.2 (2020-06-10)
* Version: 5.4.0 (2020-06-30)
*/
(function () {
'use strict';
@@ -54,15 +54,27 @@
var getTemplateReplaceValues = function (editor) {
return editor.getParam('template_replace_values');
};
var getTemplates = function (editorSettings) {
return editorSettings.templates;
var getTemplates = function (editor) {
return editor.getParam('templates');
};
var getCdateFormat = function (editor) {
return editor.getParam('template_cdate_format', editor.translate('%Y-%m-%d'));
};
var getMdateFormat = function (editor) {
return editor.getParam('template_mdate_format', editor.translate('%Y-%m-%d'));
};
var getBodyClassFromHash = function (editor) {
var bodyClass = editor.getParam('body_class', '', 'hash');
return bodyClass[editor.id] || '';
};
var getBodyClass = function (editor) {
var bodyClass = editor.getParam('body_class', '', 'string');
if (bodyClass.indexOf('=') === -1) {
return bodyClass;
} else {
return getBodyClassFromHash(editor);
}
};

var addZeros = function (value, len) {
value = '' + value;
@@ -98,9 +110,9 @@
return fmt;
};

var createTemplateList = function (editorSettings, callback) {
var createTemplateList = function (editor, callback) {
return function () {
var templateList = getTemplates(editorSettings);
var templateList = getTemplates(editor);
if (typeof templateList === 'function') {
templateList(callback);
return;
@@ -143,12 +155,11 @@
};
var insertTemplate = function (editor, ui, html) {
var el;
var n;
var dom = editor.dom;
var sel = editor.selection.getContent();
html = replaceTemplateValues(html, getTemplateReplaceValues(editor));
el = dom.create('div', null, html);
n = dom.select('.mceTmpl', el);
var n = dom.select('.mceTmpl', el);
if (n && n.length > 0) {
el = dom.create('div', null);
el.appendChild(n[0].cloneNode(true));
@@ -179,7 +190,7 @@
global$1.each(dom.select('div', o.node), function (e) {
if (dom.hasClass(e, 'mceTmpl')) {
global$1.each(dom.select('*', e), function (e) {
if (dom.hasClass(e, editor.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) {
if (dom.hasClass(e, getModificationDateClasses(editor).replace(/\s+/g, '|'))) {
e.innerHTML = getDateTime(editor, dateFormat);
}
});
@@ -348,11 +359,7 @@
global$1.each(editor.contentCSS, function (url) {
contentCssLinks_1 += '<link type="text/css" rel="stylesheet" href="' + editor.documentBaseURI.toAbsolute(url) + '">';
});
var bodyClass = editor.settings.body_class || '';
if (bodyClass.indexOf('=') !== -1) {
bodyClass = editor.getParam('body_class', '', 'hash');
bodyClass = bodyClass[editor.id] || '';
}
var bodyClass = getBodyClass(editor);
var encode = editor.dom.encode;
var directionality = editor.getBody().dir;
var dirAttr = directionality ? ' dir="' + encode(directionality) + '"' : '';
@@ -533,12 +540,12 @@
editor.ui.registry.addButton('template', {
icon: 'template',
tooltip: 'Insert template',
onAction: createTemplateList(editor.settings, showDialog(editor))
onAction: createTemplateList(editor, showDialog(editor))
});
editor.ui.registry.addMenuItem('template', {
icon: 'template',
text: 'Insert template...',
onAction: createTemplateList(editor.settings, showDialog(editor))
onAction: createTemplateList(editor, showDialog(editor))
});
};

@@ -4,7 +4,7 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.2 (2020-06-10)
* Version: 5.4.0 (2020-06-30)
*/
(function (domGlobals) {
'use strict';
@@ -4,6 +4,6 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.2 (2020-06-10)
* Version: 5.4.0 (2020-06-30)
*/
!function(o){"use strict";var i=tinymce.util.Tools.resolve("tinymce.PluginManager");!function n(){i.add("textcolor",function(){o.console.warn("Text color plugin is now built in to the core editor, please remove it from your editor configuration")})}()}(window);
@@ -4,7 +4,7 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.2 (2020-06-10)
* Version: 5.4.0 (2020-06-30)
*/
(function (domGlobals) {
'use strict';
@@ -276,9 +276,6 @@

var keys = Object.keys;
var hasOwnProperty = Object.hasOwnProperty;
var get = function (obj, key) {
return has(obj, key) ? Option.from(obj[key]) : Option.none();
};
var has = function (obj, key) {
return hasOwnProperty.call(obj, key);
};
@@ -656,7 +653,7 @@
};
};

var get$1 = function (patternsState) {
var get = function (patternsState) {
var setPatterns = function (newPatterns) {
var normalized = partition(map(newPatterns, normalizePattern));
if (normalized.errors.length > 0) {
@@ -738,8 +735,8 @@
cmd: 'InsertUnorderedList'
}
];
var getPatternSet = function (editorSettings) {
var patterns = get(editorSettings, 'textpattern_patterns').getOr(defaultPatterns);
var getPatternSet = function (editor) {
var patterns = editor.getParam('textpattern_patterns', defaultPatterns, 'array');
if (!isArray(patterns)) {
error$1('The setting textpattern_patterns should be an array');
return {
@@ -1384,9 +1381,9 @@

function Plugin () {
global.add('textpattern', function (editor) {
var patternsState = Cell(getPatternSet(editor.settings));
var patternsState = Cell(getPatternSet(editor));
setup(editor, patternsState);
return get$1(patternsState);
return get(patternsState);
});
}

Large diffs are not rendered by default.

@@ -4,7 +4,7 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.2 (2020-06-10)
* Version: 5.4.0 (2020-06-30)
*/
(function () {
'use strict';
@@ -4,7 +4,7 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.2 (2020-06-10)
* Version: 5.4.0 (2020-06-30)
*/
(function () {
'use strict';
@@ -57,9 +57,6 @@
toggleVisualBlocks(editor, pluginUrl, enabledState);
}
});
editor.on('remove', function () {
editor.dom.removeClass(editor.getBody(), 'mce-visualblocks');
});
};

var toggleActiveState = function (editor, enabledState) {
@@ -4,7 +4,7 @@
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.2 (2020-06-10)
* Version: 5.4.0 (2020-06-30)
*/
(function (domGlobals) {
'use strict';
@@ -447,10 +447,9 @@
var toggleVisualChars = function (editor, toggleState) {
var body = editor.getBody();
var selection = editor.selection;
var bookmark;
toggleState.set(!toggleState.get());
fireVisualChars(editor, toggleState.get());
bookmark = selection.getBookmark();
var bookmark = selection.getBookmark();
if (toggleState.get() === true) {
show(editor, body);
} else {
@@ -467,11 +466,18 @@

var global$1 = tinymce.util.Tools.resolve('tinymce.util.Delay');

var isEnabledByDefault = function (editor) {
return editor.getParam('visualchars_default_state', false);
};
var hasForcedRootBlock = function (editor) {
return editor.getParam('forced_root_block') !== false;
};

var setup = function (editor, toggleState) {
var debouncedToggle = global$1.debounce(function () {
toggle(editor);
}, 300);
if (editor.settings.forced_root_block !== false) {
if (hasForcedRootBlock(editor)) {
editor.on('keydown', function (e) {
if (toggleState.get() === true) {
e.keyCode === 13 ? toggle(editor) : debouncedToggle();
@@ -480,10 +486,6 @@
}
};

var isEnabledByDefault = function (editor) {
return editor.getParam('visualchars_default_state', false);
};

var setup$1 = function (editor, toggleState) {
editor.on('init', function () {
var valueForToggling = !isEnabledByDefault(editor);