From 67839d5a6256236357758bb1ccdaee0e01eb42dd Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Wed, 24 Jun 2020 22:04:36 +0000 Subject: [PATCH] TinyMCE: Update to 4.9.10. Changelog: https://www.tiny.cloud/docs-4x/changelog/#version4910april232020. Props hareesh-pillai, azaozz. Fixes #50431. git-svn-id: https://develop.svn.wordpress.org/trunk@48158 602fd350-edb4-49c9-b593-d223f7449a82 --- .../tinymce/plugins/compat3x/css/dialog.css | 5 + .../vendor/tinymce/plugins/compat3x/plugin.js | 2 +- .../vendor/tinymce/plugins/lists/plugin.js | 106 +- .../tinymce/plugins/lists/plugin.min.js | 2 +- .../vendor/tinymce/plugins/media/plugin.js | 492 +++++---- .../tinymce/plugins/media/plugin.min.js | 2 +- .../vendor/tinymce/plugins/paste/plugin.js | 128 ++- .../tinymce/plugins/paste/plugin.min.js | 2 +- .../skins/lightgray/content.inline.min.css | 2 +- .../tinymce/skins/lightgray/content.min.css | 2 +- .../tinymce/skins/lightgray/skin.min.css | 2 +- .../vendor/tinymce/themes/inlite/theme.js | 130 +-- .../vendor/tinymce/themes/inlite/theme.min.js | 2 +- .../vendor/tinymce/themes/modern/theme.js | 131 +-- .../vendor/tinymce/themes/modern/theme.min.js | 2 +- src/js/_enqueues/vendor/tinymce/tinymce.js | 953 +++++++++--------- .../_enqueues/vendor/tinymce/tinymce.min.js | 4 +- src/wp-includes/version.php | 2 +- 18 files changed, 1012 insertions(+), 957 deletions(-) diff --git a/src/js/_enqueues/vendor/tinymce/plugins/compat3x/css/dialog.css b/src/js/_enqueues/vendor/tinymce/plugins/compat3x/css/dialog.css index 0aacc8b3e8..e75543a18e 100644 --- a/src/js/_enqueues/vendor/tinymce/plugins/compat3x/css/dialog.css +++ b/src/js/_enqueues/vendor/tinymce/plugins/compat3x/css/dialog.css @@ -1,3 +1,8 @@ +/* + * Edited for compatibility with old TinyMCE 3.x plugins in WordPress. + * More info: https://core.trac.wordpress.org/ticket/31596#comment:10 + */ + /* Generic */ body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; diff --git a/src/js/_enqueues/vendor/tinymce/plugins/compat3x/plugin.js b/src/js/_enqueues/vendor/tinymce/plugins/compat3x/plugin.js index 9be24f3e1a..92d433edcd 100644 --- a/src/js/_enqueues/vendor/tinymce/plugins/compat3x/plugin.js +++ b/src/js/_enqueues/vendor/tinymce/plugins/compat3x/plugin.js @@ -44,7 +44,7 @@ this.add = function (callback, scope, prepend) { log('.on' + newEventName + ".add(..)"); - // Convert callback({arg1:x, arg2:x}) -> callback(arg1, arg2). + // Convert callback({arg1:x, arg2:x}) -> callback(arg1, arg2) function patchedEventCallback(e) { var callbackArgs = []; diff --git a/src/js/_enqueues/vendor/tinymce/plugins/lists/plugin.js b/src/js/_enqueues/vendor/tinymce/plugins/lists/plugin.js index b79a08cdc5..ed26968b74 100644 --- a/src/js/_enqueues/vendor/tinymce/plugins/lists/plugin.js +++ b/src/js/_enqueues/vendor/tinymce/plugins/lists/plugin.js @@ -204,6 +204,8 @@ var lists = (function (domGlobals) { resolveBookmark: resolveBookmark }; + var noop = function () { + }; var constant = function (value) { return function () { return value; @@ -221,8 +223,6 @@ var lists = (function (domGlobals) { var never = constant(false); var always = constant(true); - var never$1 = never; - var always$1 = always; var none = function () { return NONE; }; @@ -236,37 +236,27 @@ var lists = (function (domGlobals) { var id = function (n) { return n; }; - var noop = function () { - }; - var nul = function () { - return null; - }; - var undef = function () { - return undefined; - }; var me = { fold: function (n, s) { return n(); }, - is: never$1, - isSome: never$1, - isNone: always$1, + is: never, + isSome: never, + isNone: always, getOr: id, getOrThunk: call, getOrDie: function (msg) { throw new Error(msg || 'error: getOrDie called on none.'); }, - getOrNull: nul, - getOrUndefined: undef, + getOrNull: constant(null), + getOrUndefined: constant(undefined), or: id, orThunk: call, map: none, - ap: none, each: noop, bind: none, - flatten: none, - exists: never$1, - forall: always$1, + exists: never, + forall: always, filter: none, equals: eq, equals_: eq, @@ -281,15 +271,10 @@ var lists = (function (domGlobals) { return me; }(); var some = function (a) { - var constant_a = function () { - return a; - }; + var constant_a = constant(a); var self = function () { return me; }; - var map = function (f) { - return some(f(a)); - }; var bind = function (f) { return f(a); }; @@ -300,8 +285,8 @@ var lists = (function (domGlobals) { is: function (v) { return a === v; }, - isSome: always$1, - isNone: never$1, + isSome: always, + isNone: never, getOr: constant_a, getOrThunk: constant_a, getOrDie: constant_a, @@ -309,35 +294,31 @@ var lists = (function (domGlobals) { getOrUndefined: constant_a, or: self, orThunk: self, - map: map, - ap: function (optfab) { - return optfab.fold(none, function (fab) { - return some(fab(a)); - }); + map: function (f) { + return some(f(a)); }, each: function (f) { f(a); }, bind: bind, - flatten: constant_a, exists: bind, forall: bind, filter: function (f) { return f(a) ? me : NONE; }, - equals: function (o) { - return o.is(a); - }, - equals_: function (o, elementEq) { - return o.fold(never$1, function (b) { - return elementEq(a, b); - }); - }, toArray: function () { return [a]; }, toString: function () { return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); } }; return me; @@ -375,27 +356,28 @@ var lists = (function (domGlobals) { var isFunction = isType('function'); var isNumber = isType('number'); - var slice = Array.prototype.slice; + var nativeSlice = Array.prototype.slice; + var nativePush = Array.prototype.push; var map = function (xs, f) { var len = xs.length; var r = new Array(len); for (var i = 0; i < len; i++) { var x = xs[i]; - r[i] = f(x, i, xs); + r[i] = f(x, i); } return r; }; var each = function (xs, f) { for (var i = 0, len = xs.length; i < len; i++) { var x = xs[i]; - f(x, i, xs); + f(x, i); } }; var filter = function (xs, pred) { var r = []; for (var i = 0, len = xs.length; i < len; i++) { var x = xs[i]; - if (pred(x, i, xs)) { + if (pred(x, i)) { r.push(x); } } @@ -433,20 +415,19 @@ var lists = (function (domGlobals) { var find = function (xs, pred) { for (var i = 0, len = xs.length; i < len; i++) { var x = xs[i]; - if (pred(x, i, xs)) { + if (pred(x, i)) { return Option.some(x); } } return Option.none(); }; - var push = Array.prototype.push; var flatten = function (xs) { var r = []; for (var i = 0, len = xs.length; i < len; ++i) { if (!isArray(xs[i])) { throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); } - push.apply(r, xs[i]); + nativePush.apply(r, xs[i]); } return r; }; @@ -455,7 +436,7 @@ var lists = (function (domGlobals) { return flatten(output); }; var reverse = function (xs) { - var r = slice.call(xs, 0); + var r = nativeSlice.call(xs, 0); r.reverse(); return r; }; @@ -466,7 +447,7 @@ var lists = (function (domGlobals) { return xs.length === 0 ? Option.none() : Option.some(xs[xs.length - 1]); }; var from$1 = isFunction(Array.from) ? Array.from : function (x) { - return slice.call(x); + return nativeSlice.call(x); }; var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')(); @@ -621,17 +602,8 @@ var lists = (function (domGlobals) { fromPoint: fromPoint }; - var liftN = function (arr, f) { - var r = []; - for (var i = 0; i < arr.length; i++) { - var x = arr[i]; - if (x.isSome()) { - r.push(x.getOrDie()); - } else { - return Option.none(); - } - } - return Option.some(f.apply(null, r)); + var lift2 = function (oa, ob, f) { + return oa.isSome() && ob.isSome() ? Option.some(f(oa.getOrDie(), ob.getOrDie())) : Option.none(); }; var fromElements = function (elements, scope) { @@ -670,7 +642,7 @@ var lists = (function (domGlobals) { for (var k = 0, len = props.length; k < len; k++) { var i = props[k]; var x = obj[i]; - f(x, i, obj); + f(x, i); } }; @@ -1197,10 +1169,7 @@ var lists = (function (domGlobals) { } }; var appendSegments = function (head$1, tail) { - liftN([ - last(head$1), - head(tail) - ], joinSegment); + lift2(last(head$1), head(tail), joinSegment); }; var createSegment = function (scope, listType) { var segment = { @@ -1497,10 +1466,7 @@ var lists = (function (domGlobals) { }; var getItemSelection = function (editor) { var selectedListItems = map(Selection.getSelectedListItems(editor), Element.fromDom); - return liftN([ - find(selectedListItems, not(hasFirstChildList)), - find(reverse(selectedListItems), not(hasFirstChildList)) - ], function (start, end) { + return lift2(find(selectedListItems, not(hasFirstChildList)), find(reverse(selectedListItems), not(hasFirstChildList)), function (start, end) { return { start: start, end: end diff --git a/src/js/_enqueues/vendor/tinymce/plugins/lists/plugin.min.js b/src/js/_enqueues/vendor/tinymce/plugins/lists/plugin.min.js index e177a332a0..d92fc6df35 100644 --- a/src/js/_enqueues/vendor/tinymce/plugins/lists/plugin.min.js +++ b/src/js/_enqueues/vendor/tinymce/plugins/lists/plugin.min.js @@ -1 +1 @@ -!function(u){"use strict";var e,n,t,r,o,i,a,s,c,f=tinymce.util.Tools.resolve("tinymce.PluginManager"),d=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),l=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),m=tinymce.util.Tools.resolve("tinymce.util.VK"),p=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),v=tinymce.util.Tools.resolve("tinymce.util.Tools"),g=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),h=function(e){return e&&"BR"===e.nodeName},y=function(e){return e&&3===e.nodeType},N=function(e){return e&&/^(OL|UL|DL)$/.test(e.nodeName)},S=function(e){return e&&/^(OL|UL)$/.test(e.nodeName)},C=function(e){return e&&/^(DT|DD)$/.test(e.nodeName)},O=function(e){return e&&/^(LI|DT|DD)$/.test(e.nodeName)},b=function(e){return e&&/^(TH|TD)$/.test(e.nodeName)},T=h,E=function(e,n){return n&&!!e.schema.getTextBlockElements()[n.nodeName]},L=function(e,n){return e&&e.nodeName in n},D=function(e,n){return!!h(n)&&!(!e.isBlock(n.nextSibling)||h(n.previousSibling))},w=function(e,n,t){var r=e.isEmpty(n);return!(t&&0=e.childNodes.length?t.data.length:0}:t.previousSibling&&y(t.previousSibling)?{container:t.previousSibling,offset:t.previousSibling.data.length}:t.nextSibling&&y(t.nextSibling)?{container:t.nextSibling,offset:0}:{container:e,offset:n}},x=function(e){var n=e.cloneRange(),t=A(e.startContainer,e.startOffset);n.setStart(t.container,t.offset);var r=A(e.endContainer,e.endOffset);return n.setEnd(r.container,r.offset),n},R=g.DOM,I=function(o){var i={},e=function(e){var n,t,r;t=o[e?"startContainer":"endContainer"],r=o[e?"startOffset":"endOffset"],1===t.nodeType&&(n=R.create("span",{"data-mce-type":"bookmark"}),t.hasChildNodes()?(r=Math.min(r,t.childNodes.length-1),e?t.insertBefore(n,t.childNodes[r]):R.insertAfter(n,t.childNodes[r])):t.appendChild(n),t=n,r=0),i[e?"startContainer":"endContainer"]=t,i[e?"startOffset":"endOffset"]=r};return e(!0),o.collapsed||e(),i},_=function(o){function e(e){var n,t,r;n=r=o[e?"startContainer":"endContainer"],t=o[e?"startOffset":"endOffset"],n&&(1===n.nodeType&&(t=function(e){for(var n=e.parentNode.firstChild,t=0;n;){if(n===e)return t;1===n.nodeType&&"bookmark"===n.getAttribute("data-mce-type")||t++,n=n.nextSibling}return-1}(n),n=n.parentNode,R.remove(r),!n.hasChildNodes()&&R.isBlock(n)&&n.appendChild(R.create("br"))),o[e?"startContainer":"endContainer"]=n,o[e?"startOffset":"endOffset"]=t)}e(!0),e();var n=R.createRng();return n.setStart(o.startContainer,o.startOffset),o.endContainer&&n.setEnd(o.endContainer,o.endOffset),x(n)},B=function(e){return function(){return e}},P=function(t){return function(){for(var e=[],n=0;ne.length?Cn(t,e,n):Sn(t,e,n)},[]),ie(o).map(function(e){return e.list})).toArray();var t,r,o},Mn=function(e){var n,t,r=J(he.getSelectedListItems(e),Ne.fromDom);return Se([te(r,P(bn)),te((n=r,t=G.call(n,0),t.reverse(),t),P(bn))],function(e,n){return{start:e,end:n}})},Un=function(a,e,s){var n,t,r,o=(n=e,t=Mn(a),r=An(!1),J(n,function(e){return{sourceList:e,entries:Rn(0,t,r,e)}}));Z(o,function(e){var n,t,r,o,i,u;n=e.entries,t=s,Z(ee(n,En),function(e){return function(e,n){switch(e){case"Indent":n.depth++;break;case"Outdent":n.depth--;break;case"Flatten":n.depth=0}}(t,e)}),r=e.sourceList,i=a,u=e.entries,o=oe(function(e,n){if(0===e.length)return[];for(var t=n(e[0]),r=[],o=[],i=0,u=e.length;i=e.childNodes.length?t.data.length:0}:t.previousSibling&&y(t.previousSibling)?{container:t.previousSibling,offset:t.previousSibling.data.length}:t.nextSibling&&y(t.nextSibling)?{container:t.nextSibling,offset:0}:{container:e,offset:n}},x=function(e){var n=e.cloneRange(),t=A(e.startContainer,e.startOffset);n.setStart(t.container,t.offset);var r=A(e.endContainer,e.endOffset);return n.setEnd(r.container,r.offset),n},R=g.DOM,I=function(o){var i={},e=function(e){var n,t,r;t=o[e?"startContainer":"endContainer"],r=o[e?"startOffset":"endOffset"],1===t.nodeType&&(n=R.create("span",{"data-mce-type":"bookmark"}),t.hasChildNodes()?(r=Math.min(r,t.childNodes.length-1),e?t.insertBefore(n,t.childNodes[r]):R.insertAfter(n,t.childNodes[r])):t.appendChild(n),t=n,r=0),i[e?"startContainer":"endContainer"]=t,i[e?"startOffset":"endOffset"]=r};return e(!0),o.collapsed||e(),i},_=function(o){function e(e){var n,t,r;n=r=o[e?"startContainer":"endContainer"],t=o[e?"startOffset":"endOffset"],n&&(1===n.nodeType&&(t=function(e){for(var n=e.parentNode.firstChild,t=0;n;){if(n===e)return t;1===n.nodeType&&"bookmark"===n.getAttribute("data-mce-type")||t++,n=n.nextSibling}return-1}(n),n=n.parentNode,R.remove(r),!n.hasChildNodes()&&R.isBlock(n)&&n.appendChild(R.create("br"))),o[e?"startContainer":"endContainer"]=n,o[e?"startOffset":"endOffset"]=t)}e(!0),e();var n=R.createRng();return n.setStart(o.startContainer,o.startOffset),o.endContainer&&n.setEnd(o.endContainer,o.endOffset),x(n)},B=function(){},P=function(e){return function(){return e}},M=function(t){return function(){for(var e=[],n=0;ne.length?Sn(t,e,n):Nn(t,e,n)},[]),oe(o).map(function(e){return e.list})).toArray();var t,r,o},Pn=function(e){var n,t,r=J(ve.getSelectedListItems(e),ye.fromDom);return Ne(te(r,M(On)),te((n=r,(t=Y.call(n,0)).reverse(),t),M(On)),function(e,n){return{start:e,end:n}})},Mn=function(s,e,a){var n,t,r,o=(n=e,t=Pn(s),r=kn(!1),J(n,function(e){return{sourceList:e,entries:xn(0,t,r,e)}}));Z(o,function(e){var n,t,r,o,i,u;n=e.entries,t=a,Z(ee(n,Tn),function(e){return function(e,n){switch(e){case"Indent":n.depth++;break;case"Outdent":n.depth--;break;case"Flatten":n.depth=0}}(t,e)}),r=e.sourceList,i=s,u=e.entries,o=re(function(e,n){if(0===e.length)return[];for(var t=n(e[0]),r=[],o=[],i=0,u=e.length;i= 0; i--) { + var attrName = attrs[i].name; + if (attrName.indexOf('on') === 0) { + delete attrs.map[attrName]; + attrs.splice(i, 1); } - if (attrs[i].name === 'style') { + if (attrName === 'style') { attrs[i].value = editor.dom.serializeStyle(editor.dom.parseStyle(attrs[i].value), name); } } @@ -884,7 +1024,7 @@ var media = (function () { } writer.end(name); } - }, global$7({})).parse(html); + }, global$6({})).parse(html); return writer.getContent(); }; var Sanitize = { sanitize: sanitize }; diff --git a/src/js/_enqueues/vendor/tinymce/plugins/media/plugin.min.js b/src/js/_enqueues/vendor/tinymce/plugins/media/plugin.min.js index 0dd06ba681..e78d8efc11 100644 --- a/src/js/_enqueues/vendor/tinymce/plugins/media/plugin.min.js +++ b/src/js/_enqueues/vendor/tinymce/plugins/media/plugin.min.js @@ -1 +1 @@ -!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.Env"),v=tinymce.util.Tools.resolve("tinymce.util.Tools"),w=function(e){return e.getParam("media_scripts")},b=function(e){return e.getParam("audio_template_callback")},y=function(e){return e.getParam("video_template_callback")},n=function(e){return e.getParam("media_live_embeds",!0)},t=function(e){return e.getParam("media_filter_html",!0)},s=function(e){return e.getParam("media_url_resolver")},m=function(e){return e.getParam("media_alt_source",!0)},d=function(e){return e.getParam("media_poster",!0)},h=function(e){return e.getParam("media_dimensions",!0)},p=tinymce.util.Tools.resolve("tinymce.html.SaxParser"),r=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),x=function(e,t){if(e)for(var r=0;r"):"application/x-shockwave-flash"===i.source1mime?(d='',m.poster&&(d+=''),d+=""):-1!==i.source1mime.indexOf("audio")?(u=i,(l=f)?l(u):'"):"script"===i.type?'