mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-28 17:01:16 +00:00
Update tinyMCE to version 5.2.0
This commit is contained in:
+1
-1
@@ -40,6 +40,6 @@
|
||||
"normalize.css": "^8.0.1",
|
||||
"pace-js": "^1.0.2",
|
||||
"pnotify": "^4.0.0",
|
||||
"tinymce": "^5.1.6"
|
||||
"tinymce": "^5.2.0"
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
+1
-1
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
!function(){"use strict";function n(){}function o(n){return function(){return n}}function t(){return d}var e,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=tinymce.util.Tools.resolve("tinymce.util.Tools"),l=function(n,t,e){var r="UL"===t?"InsertUnorderedList":"InsertOrderedList";n.execCommand(r,!1,!1===e?null:{"list-style-type":e})},i=function(e){e.addCommand("ApplyUnorderedListStyle",function(n,t){l(e,"UL",t["list-style-type"])}),e.addCommand("ApplyOrderedListStyle",function(n,t){l(e,"OL",t["list-style-type"])})},c=function(n){var t=n.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");return t?t.split(/[ ,]/):[]},s=function(n){var t=n.getParam("advlist_bullet_styles","default,circle,square");return t?t.split(/[ ,]/):[]},f=o(!1),a=o(!0),d=(e={fold:function(n,t){return n()},is:f,isSome:f,isNone:a,getOr:m,getOrThunk:p,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:o(null),getOrUndefined:o(undefined),or:m,orThunk:p,map:t,each:n,bind:t,exists:f,forall:a,filter:t,equals:g,equals_:g,toArray:function(){return[]},toString:o("none()")},Object.freeze&&Object.freeze(e),e);function g(n){return n.isNone()}function p(n){return n()}function m(n){return n}function y(n,t,e){var r=function(n,t){for(var e=0;e<n.length;e++){if(t(n[e]))return e}return-1}(t.parents,L),i=-1!==r?t.parents.slice(0,r):t.parents,o=u.grep(i,N(n));return 0<o.length&&o[0].nodeName===e}function O(n,t,e,r,i,o){0<o.length?function(e,n,t,r,i,o){e.ui.registry.addSplitButton(n,{tooltip:t,icon:"OL"===i?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:function(n){n(u.map(o,function(n){return{type:"choiceitem",value:"default"===n?"":n,icon:"list-"+("OL"===i?"num":"bull")+"-"+("disc"===n||"decimal"===n?"default":n),text:function(n){return n.replace(/\-/g," ").replace(/\b\w/g,function(n){return n.toUpperCase()})}(n)}}))},onAction:function(){return e.execCommand(r)},onItemAction:function(n,t){l(e,i,t)},select:function(t){return S(e).map(function(n){return t===n}).getOr(!1)},onSetup:function(t){function n(n){t.setActive(y(e,n,i))}return e.on("NodeChange",n),function(){return e.off("NodeChange",n)}}})}(n,t,e,r,i,o):function(e,n,t,r,i){e.ui.registry.addToggleButton(n,{active:!1,tooltip:t,icon:"OL"===i?"ordered-list":"unordered-list",onSetup:function(t){function n(n){t.setActive(y(e,n,i))}return e.on("NodeChange",n),function(){return e.off("NodeChange",n)}},onAction:function(){return e.execCommand(r)}})}(n,t,e,r,i)}var v=function(e){function n(){return i}function t(n){return n(e)}var r=o(e),i={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:a,isNone:f,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:n,orThunk:n,map:function(n){return v(n(e))},each:function(n){n(e)},bind:t,exists:t,forall:t,filter:function(n){return n(e)?i:d},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(f,function(n){return t(e,n)})}};return i},h=function(n){return null===n||n===undefined?d:v(n)},L=function(n){return n&&/^(TH|TD)$/.test(n.nodeName)},N=function(t){return function(n){return n&&/^(OL|UL|DL)$/.test(n.nodeName)&&function(n,t){return n.$.contains(n.getBody(),t)}(t,n)}},S=function(n){var t=n.dom.getParent(n.selection.getNode(),"ol,ul"),e=n.dom.getStyle(t,"listStyleType");return h(e)},T=function(n){O(n,"numlist","Numbered list","InsertOrderedList","OL",c(n)),O(n,"bullist","Bullet list","InsertUnorderedList","UL",s(n))};!function b(){r.add("advlist",function(n){var t,e,r;e="lists",r=(t=n).settings.plugins?t.settings.plugins:"",-1!==u.inArray(r.split(/[ ,]/),e)&&(T(n),i(n))})}()}();
|
||||
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
+1
-1
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
!function(){"use strict";function e(o){return function(t){for(var e=0;e<t.length;e++)(n=t[e]).attr("href")||!n.attr("id")&&!n.attr("name")||n.firstChild||t[e].attr("contenteditable",o);var n}}var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(t){return/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(t)},o=function(t){var e=t.selection.getNode();return"A"===e.tagName&&""===t.dom.getAttrib(e,"href")?e.getAttribute("id")||e.getAttribute("name"):""},r=function(t,e){var n=t.selection.getNode();"A"===n.tagName&&""===t.dom.getAttrib(n,"href")?(n.removeAttribute("name"),n.id=e,t.undoManager.add()):(t.focus(),t.selection.collapse(!0),t.execCommand("mceInsertContent",!1,t.dom.createHTML("a",{id:e})))},a=function(e){var t=o(e);e.windowManager.open({title:"Anchor",size:"normal",body:{type:"panel",items:[{name:"id",type:"input",label:"ID",placeholder:"example"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{id:t},onSubmit:function(t){!function(t,e){return n(e)?(r(t,e),!1):(t.windowManager.alert("Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),!0)}(e,t.getData().id)&&t.close()}})},i=function(t){t.addCommand("mceAnchor",function(){a(t)})},c=function(t){t.on("PreInit",function(){t.parser.addNodeFilter("a",e("false")),t.serializer.addNodeFilter("a",e(null))})},d=function(e){e.ui.registry.addToggleButton("anchor",{icon:"bookmark",tooltip:"Anchor",onAction:function(){return e.execCommand("mceAnchor")},onSetup:function(t){return e.selection.selectorChangedWithUnbind("a:not([href])",t.setActive).unbind}}),e.ui.registry.addMenuItem("anchor",{icon:"bookmark",text:"Anchor...",onAction:function(){return e.execCommand("mceAnchor")}})};!function u(){t.add("anchor",function(t){c(t),i(t),d(t)})}()}();
|
||||
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
@@ -19,9 +19,13 @@
|
||||
var getDefaultLinkTarget = function (editor) {
|
||||
return editor.getParam('default_link_target', false);
|
||||
};
|
||||
var getDefaultLinkProtocol = function (editor) {
|
||||
return editor.getParam('link_default_protocol', 'http', 'string');
|
||||
};
|
||||
var Settings = {
|
||||
getAutoLinkPattern: getAutoLinkPattern,
|
||||
getDefaultLinkTarget: getDefaultLinkTarget
|
||||
getDefaultLinkTarget: getDefaultLinkTarget,
|
||||
getDefaultLinkProtocol: getDefaultLinkProtocol
|
||||
};
|
||||
|
||||
var rangeEqualsDelimiterOrSpace = function (rangeString, delimiter) {
|
||||
@@ -127,9 +131,10 @@
|
||||
}
|
||||
text = rng.toString().trim();
|
||||
matches = text.match(autoLinkPattern);
|
||||
var protocol = Settings.getDefaultLinkProtocol(editor);
|
||||
if (matches) {
|
||||
if (matches[1] === 'www.') {
|
||||
matches[1] = 'http://www.';
|
||||
matches[1] = protocol + '://www.';
|
||||
} else if (/@$/.test(matches[1]) && !/^mailto:/.test(matches[1])) {
|
||||
matches[1] = 'mailto:' + matches[1];
|
||||
}
|
||||
|
||||
+2
-2
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
!function(){"use strict";function i(t,e){if(e<0&&(e=0),3===t.nodeType){var n=t.data.length;n<e&&(e=n)}return e}function C(t,e,n){1!==e.nodeType||e.hasChildNodes()?t.setStart(e,i(e,n)):t.setStartBefore(e)}function m(t,e,n){1!==e.nodeType||e.hasChildNodes()?t.setEnd(e,i(e,n)):t.setEndAfter(e)}var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.Env"),y=function(t){return t.getParam("autolink_pattern",/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i)},k=function(t){return t.getParam("default_link_target",!1)},r=function(t,e,n){var i,o,r,f,a,s,d,c,l,u,g=y(t),h=k(t);if("A"!==t.selection.getNode().tagName){if((i=t.selection.getRng(!0).cloneRange()).startOffset<5){if(!(c=i.endContainer.previousSibling)){if(!i.endContainer.firstChild||!i.endContainer.firstChild.nextSibling)return;c=i.endContainer.firstChild.nextSibling}if(l=c.length,C(i,c,l),m(i,c,l),i.endOffset<5)return;o=i.endOffset,f=c}else{if(3!==(f=i.endContainer).nodeType&&f.firstChild){for(;3!==f.nodeType&&f.firstChild;)f=f.firstChild;3===f.nodeType&&(C(i,f,0),m(i,f,f.nodeValue.length))}o=1===i.endOffset?2:i.endOffset-1-e}for(r=o;C(i,f,2<=o?o-2:0),m(i,f,1<=o?o-1:0),o-=1," "!==(u=i.toString())&&""!==u&&160!==u.charCodeAt(0)&&0<=o-2&&u!==n;);!function(t,e){return t===e||" "===t||160===t.charCodeAt(0)}(i.toString(),n)?(0===i.startOffset?C(i,f,0):C(i,f,o),m(i,f,r)):(C(i,f,o),m(i,f,r),o+=1),"."===(s=i.toString()).charAt(s.length-1)&&m(i,f,r-1),(d=(s=i.toString().trim()).match(g))&&("www."===d[1]?d[1]="http://www.":/@$/.test(d[1])&&!/^mailto:/.test(d[1])&&(d[1]="mailto:"+d[1]),a=t.selection.getBookmark(),t.selection.setRng(i),t.execCommand("createlink",!1,d[1]+d[2]),!1!==h&&t.dom.setAttrib(t.selection.getNode(),"target",h),t.selection.moveToBookmark(a),t.nodeChanged())}},e=function(e){var n;e.on("keydown",function(t){if(13===t.keyCode)return function(t){r(t,-1,"")}(e)}),o.browser.isIE()?e.on("focus",function(){if(!n){n=!0;try{e.execCommand("AutoUrlDetect",!1,!0)}catch(t){}}}):(e.on("keypress",function(t){if(41===t.keyCode)return function(t){r(t,-1,"(")}(e)}),e.on("keyup",function(t){if(32===t.keyCode)return function(t){r(t,0,"")}(e)}))};!function n(){t.add("autolink",function(t){e(t)})}()}();
|
||||
!function(){"use strict";function i(t,e){if(e<0&&(e=0),3===t.nodeType){var n=t.data.length;n<e&&(e=n)}return e}function C(t,e,n){1!==e.nodeType||e.hasChildNodes()?t.setStart(e,i(e,n)):t.setStartBefore(e)}function y(t,e,n){1!==e.nodeType||e.hasChildNodes()?t.setEnd(e,i(e,n)):t.setEndAfter(e)}var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.Env"),k=function(t){return t.getParam("autolink_pattern",/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i)},p=function(t){return t.getParam("default_link_target",!1)},w=function(t){return t.getParam("link_default_protocol","http","string")},r=function(t,e,n){var i,o,r,f,a,s,d,l,c,u,g=k(t),h=p(t);if("A"!==t.selection.getNode().tagName){if((i=t.selection.getRng(!0).cloneRange()).startOffset<5){if(!(l=i.endContainer.previousSibling)){if(!i.endContainer.firstChild||!i.endContainer.firstChild.nextSibling)return;l=i.endContainer.firstChild.nextSibling}if(c=l.length,C(i,l,c),y(i,l,c),i.endOffset<5)return;o=i.endOffset,f=l}else{if(3!==(f=i.endContainer).nodeType&&f.firstChild){for(;3!==f.nodeType&&f.firstChild;)f=f.firstChild;3===f.nodeType&&(C(i,f,0),y(i,f,f.nodeValue.length))}o=1===i.endOffset?2:i.endOffset-1-e}for(r=o;C(i,f,2<=o?o-2:0),y(i,f,1<=o?o-1:0),o-=1," "!==(u=i.toString())&&""!==u&&160!==u.charCodeAt(0)&&0<=o-2&&u!==n;);!function(t,e){return t===e||" "===t||160===t.charCodeAt(0)}(i.toString(),n)?(0===i.startOffset?C(i,f,0):C(i,f,o),y(i,f,r)):(C(i,f,o),y(i,f,r),o+=1),"."===(s=i.toString()).charAt(s.length-1)&&y(i,f,r-1),d=(s=i.toString().trim()).match(g);var m=w(t);d&&("www."===d[1]?d[1]=m+"://www.":/@$/.test(d[1])&&!/^mailto:/.test(d[1])&&(d[1]="mailto:"+d[1]),a=t.selection.getBookmark(),t.selection.setRng(i),t.execCommand("createlink",!1,d[1]+d[2]),!1!==h&&t.dom.setAttrib(t.selection.getNode(),"target",h),t.selection.moveToBookmark(a),t.nodeChanged())}},e=function(e){var n;e.on("keydown",function(t){if(13===t.keyCode)return function(t){r(t,-1,"")}(e)}),o.browser.isIE()?e.on("focus",function(){if(!n){n=!0;try{e.execCommand("AutoUrlDetect",!1,!0)}catch(t){}}}):(e.on("keypress",function(t){if(41===t.keyCode)return function(t){r(t,-1,"(")}(e)}),e.on("keyup",function(t){if(32===t.keyCode)return function(t){r(t,0,"")}(e)}))};!function n(){t.add("autolink",function(t){e(t)})}()}();
|
||||
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
+1
-1
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
!function(){"use strict";function d(e,t){var n=e.getBody();n&&(n.style.overflowY=t?"":"hidden",t||(n.scrollTop=0))}function h(e,t,n,i){var o=parseInt(e.getStyle(t,n,i),10);return isNaN(o)?0:o}var i=function(e){function t(){return n}var n=e;return{get:t,set:function(e){n=e},clone:function(){return i(t())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),v=tinymce.util.Tools.resolve("tinymce.Env"),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),p=function(e){return e.fire("ResizeEditor")},y=function(e){return e.getParam("min_height",e.getElement().offsetHeight,"number")},z=function(e){return e.getParam("max_height",0,"number")},n=function(e){return e.getParam("autoresize_overflow_padding",1,"number")},b=function(e){return e.getParam("autoresize_bottom_margin",50,"number")},o=function(e){return e.getParam("autoresize_on_init",!0,"boolean")},u=function(e,t,n,i,o){r.setEditorTimeout(e,function(){C(e,t),n--?u(e,t,n,i,o):o&&o()},i)},C=function(e,t){var n,i,o,r=e.dom,u=e.getDoc();if(u)if(function(e){return e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen()}(e))d(e,!0);else{var s=u.documentElement,a=b(e);i=y(e);var f=h(r,s,"margin-top",!0),c=h(r,s,"margin-bottom",!0);(o=s.offsetHeight+f+c+a)<0&&(o=0);var g=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight;o+g>y(e)&&(i=o+g);var l=z(e);if(l&&l<i?(i=l,d(e,!0)):d(e,!1),i!==t.get()){if(n=i-t.get(),r.setStyle(e.getContainer(),"height",i+"px"),t.set(i),p(e),v.browser.isSafari()&&v.mac){var m=e.getWin();m.scrollTo(m.pageXOffset,m.pageYOffset)}e.hasFocus()&&e.selection.scrollIntoView(e.selection.getNode()),v.webkit&&n<0&&C(e,t)}}},s={setup:function(t,e){t.on("init",function(){var e=n(t);t.dom.setStyles(t.getBody(),{paddingLeft:e,paddingRight:e,"min-height":0})}),t.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",function(){C(t,e)}),o(t)&&t.on("init",function(){u(t,e,20,100,function(){u(t,e,5,1e3)})})},resize:C},a=function(e,t){e.addCommand("mceAutoResize",function(){s.resize(e,t)})};!function t(){e.add("autoresize",function(e){if(e.settings.hasOwnProperty("resize")||(e.settings.resize=!1),!e.inline){var t=i(0);a(e,t),s.setup(e,t)}})}()}();
|
||||
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function (domGlobals) {
|
||||
'use strict';
|
||||
|
||||
+1
-1
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
!function(n){"use strict";function r(t,e){var n=t||e,r=/^(\d+)([ms]?)$/.exec(""+n);return(r[2]?{s:1e3,m:6e4}[r[2]]:1)*parseInt(n,10)}function o(t){var e=t.getParam("autosave_prefix","tinymce-autosave-{path}{query}{hash}-{id}-");return e=(e=(e=(e=e.replace(/\{path\}/g,n.document.location.pathname)).replace(/\{query\}/g,n.document.location.search)).replace(/\{hash\}/g,n.document.location.hash)).replace(/\{id\}/g,t.id)}function a(t,e){var n=t.settings.forced_root_block;return""===(e=d.trim(void 0===e?t.getBody().innerHTML:e))||new RegExp("^<"+n+"[^>]*>((\xa0| |[ \t]|<br[^>]*>)+?|)</"+n+">|<br>$","i").test(e)}function i(t){var e=parseInt(v.getItem(o(t)+"time"),10)||0;return!((new Date).getTime()-e>function(t){return r(t.settings.autosave_retention,"20m")}(t))||(g(t,!1),!1)}function u(t){var e=o(t);!a(t)&&t.isDirty()&&(v.setItem(e+"draft",t.getContent({format:"raw",no_events:!0})),v.setItem(e+"time",(new Date).getTime().toString()),function(t){t.fire("StoreDraft")}(t))}function s(t){var e=o(t);i(t)&&(t.setContent(v.getItem(e+"draft"),{format:"raw"}),function(t){t.fire("RestoreDraft")}(t))}function c(t,e){var n=function(t){return r(t.settings.autosave_interval,"30s")}(t);e.get()||(m.setInterval(function(){t.removed||u(t)},n),e.set(!0))}function f(t){t.undoManager.transact(function(){s(t),g(t)}),t.focus()}var l=function(t){function e(){return n}var n=t;return{get:e,set:function(t){n=t},clone:function(){return l(e())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),m=tinymce.util.Tools.resolve("tinymce.util.Delay"),v=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),d=tinymce.util.Tools.resolve("tinymce.util.Tools"),g=function(t,e){var n=o(t);v.removeItem(n+"draft"),v.removeItem(n+"time"),!1!==e&&function(t){t.fire("RemoveDraft")}(t)};function y(r){for(var o=[],t=1;t<arguments.length;t++)o[t-1]=arguments[t];return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=o.concat(t);return r.apply(null,n)}}function p(n,t){return function(t){t.setDisabled(!i(n));function e(){return t.setDisabled(!i(n))}return n.on("StoreDraft RestoreDraft RemoveDraft",e),function(){return n.off("StoreDraft RestoreDraft RemoveDraft",e)}}}var D=tinymce.util.Tools.resolve("tinymce.EditorManager");!function e(){t.add("autosave",function(t){var e=l(!1);return function(t){t.editorManager.on("BeforeUnload",function(t){var e;d.each(D.get(),function(t){t.plugins.autosave&&t.plugins.autosave.storeDraft(),!e&&t.isDirty()&&function(t){return t.getParam("autosave_ask_before_unload",!0)}(t)&&(e=t.translate("You have unsaved changes are you sure you want to navigate away?"))}),e&&(t.preventDefault(),t.returnValue=e)})}(t),function(t,e){c(t,e),t.ui.registry.addButton("restoredraft",{tooltip:"Restore last draft",icon:"restore-draft",onAction:function(){f(t)},onSetup:p(t)}),t.ui.registry.addMenuItem("restoredraft",{text:"Restore last draft",icon:"restore-draft",onAction:function(){f(t)},onSetup:p(t)})}(t,e),t.on("init",function(){(function(t){return t.getParam("autosave_restore_when_empty",!1)})(t)&&t.dom.isEmpty(t.getBody())&&s(t)}),function(t){return{hasDraft:y(i,t),storeDraft:y(u,t),restoreDraft:y(s,t),removeDraft:y(g,t),isEmpty:y(a,t)}}(t)})}()}(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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
+1
-1
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
!function(){"use strict";var o=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=function(t){t=e.trim(t);function o(o,e){t=t.replace(o,e)}return o(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]"),o(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),o(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),o(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),o(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),o(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]"),o(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]"),o(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]"),o(/<font>(.*?)<\/font>/gi,"$1"),o(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]"),o(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]"),o(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]"),o(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"),o(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"),o(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"),o(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"),o(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"),o(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"),o(/<\/(strong|b)>/gi,"[/b]"),o(/<(strong|b)>/gi,"[b]"),o(/<\/(em|i)>/gi,"[/i]"),o(/<(em|i)>/gi,"[i]"),o(/<\/u>/gi,"[/u]"),o(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]"),o(/<u>/gi,"[u]"),o(/<blockquote[^>]*>/gi,"[quote]"),o(/<\/blockquote>/gi,"[/quote]"),o(/<br \/>/gi,"\n"),o(/<br\/>/gi,"\n"),o(/<br>/gi,"\n"),o(/<p>/gi,""),o(/<\/p>/gi,"\n"),o(/ |\u00a0/gi," "),o(/"/gi,'"'),o(/</gi,"<"),o(/>/gi,">"),o(/&/gi,"&"),t},i=function(t){t=e.trim(t);function o(o,e){t=t.replace(o,e)}return o(/\n/gi,"<br />"),o(/\[b\]/gi,"<strong>"),o(/\[\/b\]/gi,"</strong>"),o(/\[i\]/gi,"<em>"),o(/\[\/i\]/gi,"</em>"),o(/\[u\]/gi,"<u>"),o(/\[\/u\]/gi,"</u>"),o(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>'),o(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>'),o(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />'),o(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>'),o(/\[code\](.*?)\[\/code\]/gi,'<span class="codeStyle">$1</span> '),o(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span> '),t};!function n(){o.add("bbcode",function(o){o.on("BeforeSetContent",function(o){o.content=i(o.content)}),o.on("PostProcess",function(o){o.set&&(o.content=i(o.content)),o.get&&(o.content=t(o.content))})})}()}();
|
||||
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function (domGlobals) {
|
||||
'use strict';
|
||||
@@ -212,8 +212,7 @@
|
||||
return r;
|
||||
};
|
||||
var bind = function (xs, f) {
|
||||
var output = map(xs, f);
|
||||
return flatten(output);
|
||||
return flatten(map(xs, f));
|
||||
};
|
||||
var from$1 = isFunction(Array.from) ? Array.from : function (x) {
|
||||
return nativeSlice.call(x);
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
+1
-1
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(e,n){e.focus(),e.undoManager.transact(function(){e.setContent(n)}),e.selection.setCursorLocation(),e.nodeChanged()},o=function(e){return e.getContent({source_view:!0})},n=function(n){var e=o(n);n.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:e},onSubmit:function(e){t(n,e.getData().code),e.close()}})},c=function(e){e.addCommand("mceCodeEditor",function(){n(e)})},i=function(e){e.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:function(){return n(e)}}),e.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:function(){return n(e)}})};!function u(){e.add("code",function(e){return c(e),i(e),{}})}()}();
|
||||
File diff suppressed because it is too large
Load Diff
+2
-2
File diff suppressed because one or more lines are too long
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function (domGlobals) {
|
||||
'use strict';
|
||||
|
||||
+1
-1
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
!function(o){"use strict";var i=tinymce.util.Tools.resolve("tinymce.PluginManager");!function n(){i.add("colorpicker",function(){o.console.warn("Color picker 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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function (domGlobals) {
|
||||
'use strict';
|
||||
|
||||
+1
-1
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
!function(n){"use strict";var o=tinymce.util.Tools.resolve("tinymce.PluginManager");!function e(){o.add("contextmenu",function(){n.console.warn("Context menu 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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function (domGlobals) {
|
||||
'use strict';
|
||||
|
||||
+1
-1
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
!function(i){"use strict";function n(){}function u(n){return function(){return n}}function t(){return a}var e,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=tinymce.util.Tools.resolve("tinymce.util.Tools"),o=function(n,t){var e,r=n.dom,o=n.selection.getSelectedBlocks();o.length&&(e=r.getAttrib(o[0],"dir"),c.each(o,function(n){r.getParent(n.parentNode,'*[dir="'+t+'"]',r.getRoot())||r.setAttrib(n,"dir",e!==t?t:null)}),n.nodeChanged())},d=function(n){n.addCommand("mceDirectionLTR",function(){o(n,"ltr")}),n.addCommand("mceDirectionRTL",function(){o(n,"rtl")})},f=u(!1),l=u(!0),a=(e={fold:function(n,t){return n()},is:f,isSome:f,isNone:l,getOr:s,getOrThunk:N,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(undefined),or:s,orThunk:N,map:t,each:n,bind:t,exists:f,forall:l,filter:t,equals:m,equals_:m,toArray:function(){return[]},toString:u("none()")},Object.freeze&&Object.freeze(e),e);function m(n){return n.isNone()}function N(n){return n()}function s(n){return n}function g(n,t){var e=n.dom(),r=i.window.getComputedStyle(e).getPropertyValue(t),o=""!==r||function(n){var t=A(n)?n.dom().parentNode:n.dom();return t!==undefined&&null!==t&&t.ownerDocument.body.contains(t)}(n)?r:w(e,t);return null===o?undefined:o}function T(t,r){return function(e){function n(n){var t=p.fromDom(n.element);e.setActive(function(n){return"rtl"===g(n,"direction")?"rtl":"ltr"}(t)===r)}return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}}}var E,O,y=function(e){function n(){return o}function t(n){return n(e)}var r=u(e),o={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:l,isNone:f,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:n,orThunk:n,map:function(n){return y(n(e))},each:function(n){n(e)},bind:t,exists:t,forall:t,filter:function(n){return n(e)?o:a},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(f,function(n){return t(e,n)})}};return o},D=function(n){return null===n||n===undefined?a:y(n)},h=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:u(n)}},p={fromHtml:function(n,t){var e=(t||i.document).createElement("div");if(e.innerHTML=n,!e.hasChildNodes()||1<e.childNodes.length)throw i.console.error("HTML does not have a single root node",n),new Error("HTML must have a single root node");return h(e.childNodes[0])},fromTag:function(n,t){var e=(t||i.document).createElement(n);return h(e)},fromText:function(n,t){var e=(t||i.document).createTextNode(n);return h(e)},fromDom:h,fromPoint:function(n,t,e){var r=n.dom();return D(r.elementFromPoint(t,e)).map(h)}},_=(E="function",function(n){return function(n){if(null===n)return"null";var t=typeof n;return"object"==t&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":t}(n)===E}),v=Array.prototype.slice,C=(_(Array.from)&&Array.from,i.Node.ATTRIBUTE_NODE,i.Node.CDATA_SECTION_NODE,i.Node.COMMENT_NODE,i.Node.DOCUMENT_NODE,i.Node.DOCUMENT_TYPE_NODE,i.Node.DOCUMENT_FRAGMENT_NODE,i.Node.ELEMENT_NODE,i.Node.TEXT_NODE),A=(i.Node.PROCESSING_INSTRUCTION_NODE,i.Node.ENTITY_REFERENCE_NODE,i.Node.ENTITY_NODE,i.Node.NOTATION_NODE,"undefined"!=typeof i.window?i.window:Function("return this;")(),O=C,function(n){return function(n){return n.dom().nodeType}(n)===O}),w=function(n,t){return function(n){return n.style!==undefined&&_(n.style.getPropertyValue)}(n)?n.style.getPropertyValue(t):""},S=function(n){n.ui.registry.addToggleButton("ltr",{tooltip:"Left to right",icon:"ltr",onAction:function(){return n.execCommand("mceDirectionLTR")},onSetup:T(n,"ltr")}),n.ui.registry.addToggleButton("rtl",{tooltip:"Right to left",icon:"rtl",onAction:function(){return n.execCommand("mceDirectionRTL")},onSetup:T(n,"rtl")})};!function R(){r.add("directionality",function(n){d(n),S(n)})}()}(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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function (domGlobals) {
|
||||
'use strict';
|
||||
@@ -275,6 +275,19 @@
|
||||
editor.insertContent(ch);
|
||||
};
|
||||
|
||||
var __assign = function () {
|
||||
__assign = Object.assign || function __assign(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s)
|
||||
if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
|
||||
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
var shallow = function (old, nu) {
|
||||
return nu;
|
||||
@@ -372,7 +385,7 @@
|
||||
var getUserDefinedEmoticons = function (editor) {
|
||||
var userDefinedEmoticons = Settings.getAppendedEmoticons(editor);
|
||||
return map$1(userDefinedEmoticons, function (value) {
|
||||
return merge({
|
||||
return __assign({
|
||||
keywords: [],
|
||||
category: 'user'
|
||||
}, value);
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function (domGlobals) {
|
||||
'use strict';
|
||||
@@ -29,6 +29,19 @@
|
||||
|
||||
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
var __assign = function () {
|
||||
__assign = Object.assign || function __assign(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s)
|
||||
if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
||||
|
||||
var global$2 = tinymce.util.Tools.resolve('tinymce.html.DomParser');
|
||||
@@ -76,7 +89,7 @@
|
||||
return global$2({
|
||||
validate: false,
|
||||
root_name: '#document'
|
||||
}).parse(head);
|
||||
}).parse(head, { format: 'xhtml' });
|
||||
};
|
||||
var htmlToData = function (editor, head) {
|
||||
var headerFragment = parseHeader(head);
|
||||
@@ -300,33 +313,6 @@
|
||||
dataToHtml: dataToHtml
|
||||
};
|
||||
|
||||
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
var shallow = function (old, nu) {
|
||||
return nu;
|
||||
};
|
||||
var baseMerge = function (merger) {
|
||||
return function () {
|
||||
var objects = new Array(arguments.length);
|
||||
for (var i = 0; i < objects.length; i++) {
|
||||
objects[i] = arguments[i];
|
||||
}
|
||||
if (objects.length === 0) {
|
||||
throw new Error('Can\'t merge zero objects');
|
||||
}
|
||||
var ret = {};
|
||||
for (var j = 0; j < objects.length; j++) {
|
||||
var curObject = objects[j];
|
||||
for (var key in curObject) {
|
||||
if (hasOwnProperty.call(curObject, key)) {
|
||||
ret[key] = merger(ret[key], curObject[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
};
|
||||
var merge = baseMerge(shallow);
|
||||
|
||||
var open = function (editor, headState) {
|
||||
var data = Parser.htmlToData(editor, headState.get());
|
||||
var defaultData = {
|
||||
@@ -337,7 +323,7 @@
|
||||
author: '',
|
||||
docencoding: ''
|
||||
};
|
||||
var initialData = merge(defaultData, data);
|
||||
var initialData = __assign(__assign({}, defaultData), data);
|
||||
editor.windowManager.open({
|
||||
title: 'Metadata and Document Properties',
|
||||
size: 'normal',
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function (domGlobals) {
|
||||
'use strict';
|
||||
@@ -40,6 +40,15 @@
|
||||
|
||||
var noop = function () {
|
||||
};
|
||||
var compose = function (fa, fb) {
|
||||
return function () {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
return fa(fb.apply(null, args));
|
||||
};
|
||||
};
|
||||
var constant = function (value) {
|
||||
return function () {
|
||||
return value;
|
||||
@@ -157,6 +166,33 @@
|
||||
from: from
|
||||
};
|
||||
|
||||
var revocable = function (doRevoke) {
|
||||
var subject = Cell(Option.none());
|
||||
var revoke = function () {
|
||||
subject.get().each(doRevoke);
|
||||
};
|
||||
var clear = function () {
|
||||
revoke();
|
||||
subject.set(Option.none());
|
||||
};
|
||||
var set = function (s) {
|
||||
revoke();
|
||||
subject.set(Option.some(s));
|
||||
};
|
||||
var isSet = function () {
|
||||
return subject.get().isSome();
|
||||
};
|
||||
return {
|
||||
clear: clear,
|
||||
isSet: isSet,
|
||||
set: set
|
||||
};
|
||||
};
|
||||
var unbindable = function () {
|
||||
return revocable(function (s) {
|
||||
s.unbind();
|
||||
});
|
||||
};
|
||||
var value = function () {
|
||||
var subject = Cell(Option.none());
|
||||
var clear = function () {
|
||||
@@ -250,8 +286,7 @@
|
||||
return r;
|
||||
};
|
||||
var bind = function (xs, f) {
|
||||
var output = map(xs, f);
|
||||
return flatten(output);
|
||||
return flatten(map(xs, f));
|
||||
};
|
||||
var from$1 = isFunction(Array.from) ? Array.from : function (x) {
|
||||
return nativeSlice.call(x);
|
||||
@@ -388,6 +423,29 @@
|
||||
return isSupported(dom) ? dom.style.getPropertyValue(property) : '';
|
||||
};
|
||||
|
||||
var mkEvent = function (target, x, y, stop, prevent, kill, raw) {
|
||||
return {
|
||||
target: constant(target),
|
||||
x: constant(x),
|
||||
y: constant(y),
|
||||
stop: stop,
|
||||
prevent: prevent,
|
||||
kill: kill,
|
||||
raw: constant(raw)
|
||||
};
|
||||
};
|
||||
var fromRawEvent = function (rawEvent) {
|
||||
var target = Element.fromDom(rawEvent.target);
|
||||
var stop = function () {
|
||||
rawEvent.stopPropagation();
|
||||
};
|
||||
var prevent = function () {
|
||||
rawEvent.preventDefault();
|
||||
};
|
||||
var kill = compose(prevent, stop);
|
||||
return mkEvent(target, rawEvent.clientX, rawEvent.clientY, stop, prevent, kill, rawEvent);
|
||||
};
|
||||
|
||||
var firstMatch = function (regexes, s) {
|
||||
for (var i = 0; i < regexes.length; i++) {
|
||||
var x = regexes[i];
|
||||
@@ -836,6 +894,10 @@
|
||||
return Position(x, y);
|
||||
};
|
||||
|
||||
var get$4 = function (_win) {
|
||||
var win = _win === undefined ? domGlobals.window : _win;
|
||||
return Option.from(win['visualViewport']);
|
||||
};
|
||||
var bounds = function (x, y, width, height) {
|
||||
return {
|
||||
x: constant(x),
|
||||
@@ -850,21 +912,30 @@
|
||||
var win = _win === undefined ? domGlobals.window : _win;
|
||||
var doc = win.document;
|
||||
var scroll = get$3(Element.fromDom(doc));
|
||||
var visualViewport = win['visualViewport'];
|
||||
if (visualViewport !== undefined) {
|
||||
return bounds(Math.max(visualViewport.pageLeft, scroll.left()), Math.max(visualViewport.pageTop, scroll.top()), visualViewport.width, visualViewport.height);
|
||||
} else {
|
||||
var html = doc.documentElement;
|
||||
return get$4(win).fold(function () {
|
||||
var html = win.document.documentElement;
|
||||
var width = html.clientWidth;
|
||||
var height = html.clientHeight;
|
||||
return bounds(scroll.left(), scroll.top(), width, height);
|
||||
}
|
||||
}, function (visualViewport) {
|
||||
return bounds(Math.max(visualViewport.pageLeft, scroll.left()), Math.max(visualViewport.pageTop, scroll.top()), visualViewport.width, visualViewport.height);
|
||||
});
|
||||
};
|
||||
|
||||
var fireFullscreenStateChanged = function (editor, state) {
|
||||
editor.fire('FullscreenStateChanged', { state: state });
|
||||
var bind$1 = function (name, callback, _win) {
|
||||
return get$4(_win).map(function (visualViewport) {
|
||||
var handler = function (e) {
|
||||
return fromRawEvent(e);
|
||||
};
|
||||
visualViewport.addEventListener(name, handler);
|
||||
return {
|
||||
unbind: function () {
|
||||
return visualViewport.removeEventListener(name, handler);
|
||||
}
|
||||
};
|
||||
}).getOrThunk(function () {
|
||||
return { unbind: noop };
|
||||
});
|
||||
};
|
||||
var Events = { fireFullscreenStateChanged: fireFullscreenStateChanged };
|
||||
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
|
||||
|
||||
@@ -872,6 +943,11 @@
|
||||
|
||||
var global$3 = tinymce.util.Tools.resolve('tinymce.util.Delay');
|
||||
|
||||
var fireFullscreenStateChanged = function (editor, state) {
|
||||
editor.fire('FullscreenStateChanged', { state: state });
|
||||
};
|
||||
var Events = { fireFullscreenStateChanged: fireFullscreenStateChanged };
|
||||
|
||||
var ancestors = function (scope, predicate, isRoot) {
|
||||
return filter(parents(scope, isRoot), predicate);
|
||||
};
|
||||
@@ -903,10 +979,9 @@
|
||||
var color = get$2(editorBody, 'background-color');
|
||||
return color !== undefined && color !== '' ? 'background-color:' + color + '!important' : bgFallback;
|
||||
};
|
||||
var clobberStyles = function (container, editorBody) {
|
||||
var clobberStyles = function (dom, container, editorBody) {
|
||||
var gatherSibilings = function (element) {
|
||||
var siblings = siblings$2(element, '*:not(.tox-silver-sink)');
|
||||
return siblings;
|
||||
return siblings$2(element, '*:not(.tox-silver-sink)');
|
||||
};
|
||||
var clobber = function (clobberStyle) {
|
||||
return function (element) {
|
||||
@@ -916,7 +991,7 @@
|
||||
return;
|
||||
} else {
|
||||
set(element, attr, backup);
|
||||
set(element, 'style', clobberStyle);
|
||||
setAll(element, dom.parseStyle(clobberStyle));
|
||||
}
|
||||
};
|
||||
};
|
||||
@@ -928,12 +1003,12 @@
|
||||
var containerStyles = isAndroid === true ? '' : ancestorPosition;
|
||||
clobber(containerStyles + ancestorStyles + bgColor)(container);
|
||||
};
|
||||
var restoreStyles = function () {
|
||||
var restoreStyles = function (dom) {
|
||||
var clobberedEls = all$1('[' + attr + ']');
|
||||
each(clobberedEls, function (element) {
|
||||
var restore = get$1(element, attr);
|
||||
if (restore !== 'no-styles') {
|
||||
set(element, 'style', restore);
|
||||
setAll(element, dom.parseStyle(restore));
|
||||
} else {
|
||||
remove(element, 'style');
|
||||
}
|
||||
@@ -956,12 +1031,15 @@
|
||||
var setScrollPos = function (pos) {
|
||||
domGlobals.window.scrollTo(pos.x, pos.y);
|
||||
};
|
||||
var visualViewport = domGlobals.window['visualViewport'];
|
||||
var viewportUpdate = visualViewport === undefined ? {
|
||||
bind: noop,
|
||||
unbind: noop
|
||||
} : function () {
|
||||
var viewportUpdate = get$4().fold(function () {
|
||||
return {
|
||||
bind: noop,
|
||||
unbind: noop
|
||||
};
|
||||
}, function (visualViewport) {
|
||||
var editorContainer = value();
|
||||
var resizeBinder = unbindable();
|
||||
var scrollBinder = unbindable();
|
||||
var refreshScroll = function () {
|
||||
domGlobals.document.body.scrollTop = 0;
|
||||
domGlobals.document.documentElement.scrollTop = 0;
|
||||
@@ -985,13 +1063,13 @@
|
||||
var bind = function (element) {
|
||||
editorContainer.set(element);
|
||||
update();
|
||||
visualViewport.addEventListener('resize', update);
|
||||
visualViewport.addEventListener('scroll', update);
|
||||
resizeBinder.set(bind$1('resize'));
|
||||
scrollBinder.set(bind$1('scroll'));
|
||||
};
|
||||
var unbind = function () {
|
||||
editorContainer.on(function () {
|
||||
visualViewport.removeEventListener('scroll', update);
|
||||
visualViewport.removeEventListener('resize', update);
|
||||
resizeBinder.clear();
|
||||
scrollBinder.clear();
|
||||
});
|
||||
editorContainer.clear();
|
||||
};
|
||||
@@ -999,7 +1077,7 @@
|
||||
bind: bind,
|
||||
unbind: unbind
|
||||
};
|
||||
}();
|
||||
});
|
||||
var toggleFullscreen = function (editor, fullscreenState) {
|
||||
var body = domGlobals.document.body;
|
||||
var documentElement = domGlobals.document.documentElement;
|
||||
@@ -1024,7 +1102,7 @@
|
||||
iframeHeight: iframeStyle.height
|
||||
};
|
||||
if (isTouch) {
|
||||
Thor.clobberStyles(editorContainerS, editorBody);
|
||||
Thor.clobberStyles(editor.dom, editorContainerS, editorBody);
|
||||
}
|
||||
iframeStyle.width = iframeStyle.height = '100%';
|
||||
editorContainerStyle.width = editorContainerStyle.height = '';
|
||||
@@ -1043,7 +1121,7 @@
|
||||
editorContainerStyle.top = fullscreenInfo.containerTop;
|
||||
editorContainerStyle.left = fullscreenInfo.containerLeft;
|
||||
if (isTouch) {
|
||||
Thor.restoreStyles();
|
||||
Thor.restoreStyles(editor.dom);
|
||||
}
|
||||
DOM.removeClass(body, 'tox-fullscreen');
|
||||
DOM.removeClass(documentElement, 'tox-fullscreen');
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
@@ -728,7 +728,7 @@
|
||||
var premiumPluginList = map(premiumPlugins, function (plugin) {
|
||||
return '<li>' + global$2.translate(plugin) + '</li>';
|
||||
}).join('');
|
||||
return '<div data-mce-tabstop="1" tabindex="-1">' + '<p><b>' + global$2.translate('Premium plugins:') + '</b></p>' + '<ul>' + premiumPluginList + '<li style="list-style: none; margin-top: 1em;"><a href="https://www.tiny.cloud/pricing/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">' + global$2.translate('Learn more...') + '</a></li>' + '</ul>' + '</div>';
|
||||
return '<div data-mce-tabstop="1" tabindex="-1">' + '<p><b>' + global$2.translate('Premium plugins:') + '</b></p>' + '<ul>' + premiumPluginList + '<li class="tox-help__more-link" "><a href="https://www.tiny.cloud/pricing/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">' + global$2.translate('Learn more...') + '</a></li>' + '</ul>' + '</div>';
|
||||
};
|
||||
var makeLink = curry(supplant, '<a href="${url}" target="_blank" rel="noopener">${name}</a>');
|
||||
var maybeUrlize = function (editor, key) {
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
+1
-1
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(n){n.addCommand("InsertHorizontalRule",function(){n.execCommand("mceInsertContent",!1,"<hr />")})},t=function(n){n.ui.registry.addButton("hr",{icon:"horizontal-rule",tooltip:"Horizontal line",onAction:function(){return n.execCommand("InsertHorizontalRule")}}),n.ui.registry.addMenuItem("hr",{icon:"horizontal-rule",text:"Horizontal line",onAction:function(){return n.execCommand("InsertHorizontalRule")}})};!function e(){n.add("hr",function(n){o(n),t(n)})}()}();
|
||||
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function (domGlobals) {
|
||||
'use strict';
|
||||
@@ -161,6 +161,7 @@
|
||||
var isArray = isType('array');
|
||||
var isBoolean = isType('boolean');
|
||||
var isFunction = isType('function');
|
||||
var isNumber = isType('number');
|
||||
|
||||
var nativeSlice = Array.prototype.slice;
|
||||
var nativePush = Array.prototype.push;
|
||||
@@ -186,6 +187,15 @@
|
||||
var from$1 = isFunction(Array.from) ? Array.from : function (x) {
|
||||
return nativeSlice.call(x);
|
||||
};
|
||||
var findMap = function (arr, f) {
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
var r = f(arr[i], i);
|
||||
if (r.isSome()) {
|
||||
return r;
|
||||
}
|
||||
}
|
||||
return Option.none();
|
||||
};
|
||||
|
||||
var __assign = function () {
|
||||
__assign = Object.assign || function __assign(t) {
|
||||
@@ -1017,9 +1027,6 @@
|
||||
};
|
||||
|
||||
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
var shallow = function (old, nu) {
|
||||
return nu;
|
||||
};
|
||||
var deep = function (old, nu) {
|
||||
var bothObjects = isObject(old) && isObject(nu);
|
||||
return bothObjects ? deepMerge(old, nu) : nu;
|
||||
@@ -1046,7 +1053,71 @@
|
||||
};
|
||||
};
|
||||
var deepMerge = baseMerge(deep);
|
||||
var merge = baseMerge(shallow);
|
||||
|
||||
var ATTRIBUTE = domGlobals.Node.ATTRIBUTE_NODE;
|
||||
var CDATA_SECTION = domGlobals.Node.CDATA_SECTION_NODE;
|
||||
var COMMENT = domGlobals.Node.COMMENT_NODE;
|
||||
var DOCUMENT = domGlobals.Node.DOCUMENT_NODE;
|
||||
var DOCUMENT_TYPE = domGlobals.Node.DOCUMENT_TYPE_NODE;
|
||||
var DOCUMENT_FRAGMENT = domGlobals.Node.DOCUMENT_FRAGMENT_NODE;
|
||||
var ELEMENT = domGlobals.Node.ELEMENT_NODE;
|
||||
var TEXT = domGlobals.Node.TEXT_NODE;
|
||||
var PROCESSING_INSTRUCTION = domGlobals.Node.PROCESSING_INSTRUCTION_NODE;
|
||||
var ENTITY_REFERENCE = domGlobals.Node.ENTITY_REFERENCE_NODE;
|
||||
var ENTITY = domGlobals.Node.ENTITY_NODE;
|
||||
var NOTATION = domGlobals.Node.NOTATION_NODE;
|
||||
|
||||
var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')();
|
||||
|
||||
var rawSet = function (dom, key, value) {
|
||||
if (isString(value) || isBoolean(value) || isNumber(value)) {
|
||||
dom.setAttribute(key, value + '');
|
||||
} else {
|
||||
domGlobals.console.error('Invalid call to Attr.set. Key ', key, ':: Value ', value, ':: Element ', dom);
|
||||
throw new Error('Attribute value was not simple');
|
||||
}
|
||||
};
|
||||
var set = function (element, key, value) {
|
||||
rawSet(element.dom(), key, value);
|
||||
};
|
||||
|
||||
var fromHtml = function (html, scope) {
|
||||
var doc = scope || domGlobals.document;
|
||||
var div = doc.createElement('div');
|
||||
div.innerHTML = html;
|
||||
if (!div.hasChildNodes() || div.childNodes.length > 1) {
|
||||
domGlobals.console.error('HTML does not have a single root node', html);
|
||||
throw new Error('HTML must have a single root node');
|
||||
}
|
||||
return fromDom(div.childNodes[0]);
|
||||
};
|
||||
var fromTag = function (tag, scope) {
|
||||
var doc = scope || domGlobals.document;
|
||||
var node = doc.createElement(tag);
|
||||
return fromDom(node);
|
||||
};
|
||||
var fromText = function (text, scope) {
|
||||
var doc = scope || domGlobals.document;
|
||||
var node = doc.createTextNode(text);
|
||||
return fromDom(node);
|
||||
};
|
||||
var fromDom = function (node) {
|
||||
if (node === null || node === undefined) {
|
||||
throw new Error('Node cannot be null or undefined');
|
||||
}
|
||||
return { dom: constant(node) };
|
||||
};
|
||||
var fromPoint = function (docElm, x, y) {
|
||||
var doc = docElm.dom();
|
||||
return Option.from(doc.elementFromPoint(x, y)).map(fromDom);
|
||||
};
|
||||
var Element = {
|
||||
fromHtml: fromHtml,
|
||||
fromTag: fromTag,
|
||||
fromText: fromText,
|
||||
fromDom: fromDom,
|
||||
fromPoint: fromPoint
|
||||
};
|
||||
|
||||
var global$2 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
|
||||
|
||||
@@ -1099,6 +1170,9 @@
|
||||
var getUploadCredentials = function (editor) {
|
||||
return editor.getParam('images_upload_credentials', false, 'boolean');
|
||||
};
|
||||
var showAccessibilityOptions = function (editor) {
|
||||
return editor.getParam('a11y_advanced_options', false, 'boolean');
|
||||
};
|
||||
var isAutomaticUploadsEnabled = function (editor) {
|
||||
return editor.getParam('automatic_uploads', true, 'boolean');
|
||||
};
|
||||
@@ -1118,6 +1192,7 @@
|
||||
getUploadHandler: getUploadHandler,
|
||||
getUploadBasePath: getUploadBasePath,
|
||||
getUploadCredentials: getUploadCredentials,
|
||||
showAccessibilityOptions: showAccessibilityOptions,
|
||||
isAutomaticUploadsEnabled: isAutomaticUploadsEnabled
|
||||
};
|
||||
|
||||
@@ -1366,6 +1441,16 @@
|
||||
var isImage = function (elm) {
|
||||
return elm.nodeName === 'IMG';
|
||||
};
|
||||
var getIsDecorative = function (image) {
|
||||
return DOM.getAttrib(image, 'alt').length === 0 && DOM.getAttrib(image, 'role') === 'presentation';
|
||||
};
|
||||
var getAlt = function (image) {
|
||||
if (getIsDecorative(image)) {
|
||||
return '';
|
||||
} else {
|
||||
return getAttrib(image, 'alt');
|
||||
}
|
||||
};
|
||||
var defaultData = function () {
|
||||
return {
|
||||
src: '',
|
||||
@@ -1379,7 +1464,8 @@
|
||||
hspace: '',
|
||||
vspace: '',
|
||||
border: '',
|
||||
borderStyle: ''
|
||||
borderStyle: '',
|
||||
isDecorative: false
|
||||
};
|
||||
};
|
||||
var getStyleValue = function (normalizeCss, data) {
|
||||
@@ -1399,10 +1485,10 @@
|
||||
}
|
||||
return normalizeCss(image.getAttribute('style'));
|
||||
};
|
||||
var create = function (normalizeCss, data) {
|
||||
var create = function (normalizeCss, data, info) {
|
||||
var image = domGlobals.document.createElement('img');
|
||||
write(normalizeCss, merge(data, { caption: false }), image);
|
||||
setAttrib(image, 'alt', data.alt);
|
||||
write(normalizeCss, __assign(__assign({}, data), { caption: false }), image, info);
|
||||
setAlt(image, data.alt, data.isDecorative, info);
|
||||
if (data.caption) {
|
||||
var figure = DOM.create('figure', { class: 'image' });
|
||||
figure.appendChild(image);
|
||||
@@ -1416,7 +1502,7 @@
|
||||
var read = function (normalizeCss, image) {
|
||||
return {
|
||||
src: getAttrib(image, 'src'),
|
||||
alt: getAttrib(image, 'alt'),
|
||||
alt: getAlt(image),
|
||||
title: getAttrib(image, 'title'),
|
||||
width: getSize(image, 'width'),
|
||||
height: getSize(image, 'height'),
|
||||
@@ -1426,7 +1512,8 @@
|
||||
hspace: getHspace(image),
|
||||
vspace: getVspace(image),
|
||||
border: getBorder(image),
|
||||
borderStyle: getStyle(image, 'borderStyle')
|
||||
borderStyle: getStyle(image, 'borderStyle'),
|
||||
isDecorative: getIsDecorative(image)
|
||||
};
|
||||
};
|
||||
var updateProp = function (image, oldData, newData, name, set) {
|
||||
@@ -1434,19 +1521,40 @@
|
||||
set(image, name, newData[name]);
|
||||
}
|
||||
};
|
||||
var setAlt = function (image, alt, isDecorative, info) {
|
||||
if (isDecorative) {
|
||||
DOM.setAttrib(image, 'role', 'presentation');
|
||||
var sugarImage = Element.fromDom(image);
|
||||
set(sugarImage, 'alt', '');
|
||||
} else {
|
||||
if (info.hasAccessibilityOptions) {
|
||||
DOM.setAttrib(image, 'alt', alt);
|
||||
} else {
|
||||
var sugarImage = Element.fromDom(image);
|
||||
set(sugarImage, 'alt', alt);
|
||||
}
|
||||
if (DOM.getAttrib(image, 'role') === 'presentation') {
|
||||
DOM.setAttrib(image, 'role', '');
|
||||
}
|
||||
}
|
||||
};
|
||||
var updateAlt = function (image, oldData, newData, info) {
|
||||
if (newData.alt !== oldData.alt || newData.isDecorative !== oldData.isDecorative) {
|
||||
setAlt(image, newData.alt, newData.isDecorative, info);
|
||||
}
|
||||
};
|
||||
var normalized = function (set, normalizeCss) {
|
||||
return function (image, name, value) {
|
||||
set(image, value);
|
||||
normalizeStyle(image, normalizeCss);
|
||||
};
|
||||
};
|
||||
var write = function (normalizeCss, newData, image) {
|
||||
var write = function (normalizeCss, newData, image, info) {
|
||||
var oldData = read(normalizeCss, image);
|
||||
updateProp(image, oldData, newData, 'caption', function (image, _name, _value) {
|
||||
return toggleCaption(image);
|
||||
});
|
||||
updateProp(image, oldData, newData, 'src', setAttrib);
|
||||
updateProp(image, oldData, newData, 'alt', setAttrib);
|
||||
updateProp(image, oldData, newData, 'title', setAttrib);
|
||||
updateProp(image, oldData, newData, 'width', setSize('width', normalizeCss));
|
||||
updateProp(image, oldData, newData, 'height', setSize('height', normalizeCss));
|
||||
@@ -1458,6 +1566,7 @@
|
||||
updateProp(image, oldData, newData, 'vspace', normalized(setVspace, normalizeCss));
|
||||
updateProp(image, oldData, newData, 'border', normalized(setBorder, normalizeCss));
|
||||
updateProp(image, oldData, newData, 'borderStyle', normalized(setBorderStyle, normalizeCss));
|
||||
updateAlt(image, oldData, newData, info);
|
||||
};
|
||||
|
||||
var normalizeCss = function (editor, cssText) {
|
||||
@@ -1480,7 +1589,7 @@
|
||||
var splitTextBlock = function (editor, figure) {
|
||||
var dom = editor.dom;
|
||||
var textBlock = dom.getParent(figure.parentNode, function (node) {
|
||||
return editor.schema.getTextBlockElements()[node.nodeName];
|
||||
return !!editor.schema.getTextBlockElements()[node.nodeName];
|
||||
}, editor.getBody());
|
||||
if (textBlock) {
|
||||
return dom.split(textBlock, figure);
|
||||
@@ -1494,10 +1603,10 @@
|
||||
return normalizeCss(editor, css);
|
||||
}, image) : defaultData();
|
||||
};
|
||||
var insertImageAtCaret = function (editor, data) {
|
||||
var insertImageAtCaret = function (editor, data, info) {
|
||||
var elm = create(function (css) {
|
||||
return normalizeCss(editor, css);
|
||||
}, data);
|
||||
}, data, info);
|
||||
editor.dom.setAttrib(elm, 'data-mce-id', '__mcenew');
|
||||
editor.focus();
|
||||
editor.selection.setContent(elm.outerHTML);
|
||||
@@ -1525,11 +1634,11 @@
|
||||
}
|
||||
}
|
||||
};
|
||||
var writeImageDataToSelection = function (editor, data) {
|
||||
var writeImageDataToSelection = function (editor, data, info) {
|
||||
var image = getSelectedImage(editor);
|
||||
write(function (css) {
|
||||
return normalizeCss(editor, css);
|
||||
}, data, image);
|
||||
}, data, image, info);
|
||||
syncSrcAttr(editor, image);
|
||||
if (isFigure(image.parentNode)) {
|
||||
var figure = image.parentNode;
|
||||
@@ -1540,29 +1649,19 @@
|
||||
Utils.waitLoadImage(editor, data, image);
|
||||
}
|
||||
};
|
||||
var insertOrUpdateImage = function (editor, data) {
|
||||
var insertOrUpdateImage = function (editor, data, info) {
|
||||
var image = getSelectedImage(editor);
|
||||
if (image) {
|
||||
if (data.src) {
|
||||
writeImageDataToSelection(editor, data);
|
||||
writeImageDataToSelection(editor, data, info);
|
||||
} else {
|
||||
deleteImage(editor, image);
|
||||
}
|
||||
} else if (data.src) {
|
||||
insertImageAtCaret(editor, data);
|
||||
insertImageAtCaret(editor, data, info);
|
||||
}
|
||||
};
|
||||
|
||||
var findMap = function (arr, f) {
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
var r = f(arr[i], i);
|
||||
if (r.isSome()) {
|
||||
return r;
|
||||
}
|
||||
}
|
||||
return Option.none();
|
||||
};
|
||||
|
||||
var global$5 = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
||||
|
||||
var getValue = function (item) {
|
||||
@@ -1804,6 +1903,7 @@
|
||||
var hasImageTitle = Settings.hasImageTitle(editor);
|
||||
var hasDimensions = Settings.hasDimensions(editor);
|
||||
var hasImageCaption = Settings.hasImageCaption(editor);
|
||||
var hasAccessibilityOptions = Settings.showAccessibilityOptions(editor);
|
||||
var url = Settings.getUploadUrl(editor);
|
||||
var basePath = Settings.getUploadBasePath(editor);
|
||||
var credentials = Settings.getUploadCredentials(editor);
|
||||
@@ -1829,8 +1929,9 @@
|
||||
basePath: basePath,
|
||||
credentials: credentials,
|
||||
handler: handler,
|
||||
automaticUploads: automaticUploads,
|
||||
prependURL: prependURL
|
||||
prependURL: prependURL,
|
||||
hasAccessibilityOptions: hasAccessibilityOptions,
|
||||
automaticUploads: automaticUploads
|
||||
};
|
||||
});
|
||||
};
|
||||
@@ -1853,7 +1954,8 @@
|
||||
var imageDescription = {
|
||||
name: 'alt',
|
||||
type: 'input',
|
||||
label: 'Image description'
|
||||
label: 'Alternative description',
|
||||
disabled: info.hasAccessibilityOptions && info.image.isDecorative
|
||||
};
|
||||
var imageTitle = {
|
||||
name: 'title',
|
||||
@@ -1864,6 +1966,15 @@
|
||||
name: 'dimensions',
|
||||
type: 'sizeinput'
|
||||
};
|
||||
var isDecorative = {
|
||||
type: 'label',
|
||||
label: 'Accessibility',
|
||||
items: [{
|
||||
name: 'isDecorative',
|
||||
type: 'checkbox',
|
||||
label: 'Image is decorative'
|
||||
}]
|
||||
};
|
||||
var classList = info.classList.map(function (items) {
|
||||
return {
|
||||
name: 'classes',
|
||||
@@ -1884,6 +1995,7 @@
|
||||
return flatten([
|
||||
[imageUrl],
|
||||
imageList.toArray(),
|
||||
info.hasAccessibilityOptions && info.hasDescription ? [isDecorative] : [],
|
||||
info.hasDescription ? [imageDescription] : [],
|
||||
info.hasImageTitle ? [imageTitle] : [],
|
||||
info.hasDimensions ? [imageDimensions] : [],
|
||||
@@ -1949,7 +2061,8 @@
|
||||
border: image.border,
|
||||
hspace: image.hspace,
|
||||
borderstyle: image.borderStyle,
|
||||
fileinput: []
|
||||
fileinput: [],
|
||||
isDecorative: image.isDecorative
|
||||
};
|
||||
};
|
||||
var toImageData = function (data) {
|
||||
@@ -1965,7 +2078,8 @@
|
||||
hspace: data.hspace,
|
||||
vspace: data.vspace,
|
||||
border: data.border,
|
||||
borderStyle: data.borderstyle
|
||||
borderStyle: data.borderstyle,
|
||||
isDecorative: data.isDecorative
|
||||
};
|
||||
};
|
||||
var addPrependUrl2 = function (info, srcURL) {
|
||||
@@ -1994,6 +2108,9 @@
|
||||
if (info.hasDescription && isString(meta.alt)) {
|
||||
data.alt = meta.alt;
|
||||
}
|
||||
if (info.hasAccessibilityOptions) {
|
||||
data.isDecorative = meta.isDecorative || false;
|
||||
}
|
||||
if (info.hasImageTitle && isString(meta.title)) {
|
||||
data.title = meta.title;
|
||||
}
|
||||
@@ -2016,6 +2133,9 @@
|
||||
}
|
||||
}
|
||||
if (info.hasAdvTab) {
|
||||
if (isString(meta.style)) {
|
||||
data.style = meta.style;
|
||||
}
|
||||
if (isString(meta.vspace)) {
|
||||
data.vspace = meta.vspace;
|
||||
}
|
||||
@@ -2191,6 +2311,12 @@
|
||||
changeAStyle(helpers, info, api);
|
||||
} else if (evt.name === 'fileinput') {
|
||||
changeFileInput(helpers, info, state, api);
|
||||
} else if (evt.name === 'isDecorative') {
|
||||
if (api.getData().isDecorative) {
|
||||
api.disable('alt');
|
||||
} else {
|
||||
api.enable('alt');
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
@@ -2250,7 +2376,7 @@
|
||||
return function (api) {
|
||||
var data = deepMerge(fromImageData(info.image), api.getData());
|
||||
editor.undoManager.transact(function () {
|
||||
insertOrUpdateImage(editor, toImageData(data));
|
||||
insertOrUpdateImage(editor, toImageData(data), info);
|
||||
});
|
||||
editor.editorUpload.uploadImagesAuto();
|
||||
api.close();
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function (domGlobals) {
|
||||
'use strict';
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
@@ -151,8 +151,7 @@
|
||||
return r;
|
||||
};
|
||||
var bind = function (xs, f) {
|
||||
var output = map(xs, f);
|
||||
return flatten(output);
|
||||
return flatten(map(xs, f));
|
||||
};
|
||||
var from = isFunction(Array.from) ? Array.from : function (x) {
|
||||
return nativeSlice.call(x);
|
||||
|
||||
+1
-1
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
!function(){"use strict";function t(){}function n(t){return function(){return t}}function e(){return h}var r,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),f=tinymce.util.Tools.resolve("tinymce.EditorManager"),l=tinymce.util.Tools.resolve("tinymce.Env"),m=tinymce.util.Tools.resolve("tinymce.util.Tools"),c=function(t){return t.getParam("importcss_merge_classes")},i=function(t){return t.getParam("importcss_exclusive")},p=function(t){return t.getParam("importcss_selector_converter")},g=function(t){return t.getParam("importcss_selector_filter")},y=function(t){return t.getParam("importcss_groups")},v=function(t){return t.getParam("importcss_append")},d=function(t){return t.getParam("importcss_file_filter")},u=n(!1),s=n(!0),h=(r={fold:function(t,n){return t()},is:u,isSome:u,isNone:s,getOr:O,getOrThunk:x,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:n(null),getOrUndefined:n(undefined),or:O,orThunk:x,map:e,each:t,bind:e,exists:u,forall:s,filter:e,equals:_,equals_:_,toArray:function(){return[]},toString:n("none()")},Object.freeze&&Object.freeze(r),r);function _(t){return t.isNone()}function x(t){return t()}function O(t){return t}function T(n){return function(t){return function(t){if(null===t)return"null";var n=typeof t;return"object"==n&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":n}(t)===n}}function b(t,n){return function(t){for(var n=[],e=0,r=t.length;e<r;++e){if(!w(t[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+t);M.apply(n,t[e])}return n}(function(t,n){for(var e=t.length,r=new Array(e),o=0;o<e;o++){var i=t[o];r[o]=n(i,o)}return r}(t,n))}function k(n){return"string"==typeof n?function(t){return-1!==t.indexOf(n)}:n instanceof RegExp?function(t){return n.test(t)}:n}function S(i,t,u){var c=[],e={};function s(t,n){var e,r=t.href;if((r=function(t){var n=l.cacheSuffix;return"string"==typeof t&&(t=t.replace("?"+n,"").replace("&"+n,"")),t}(r))&&u(r,n)&&!function(t,n){var e=t.settings,r=!1!==e.skin&&(e.skin||"oxide");if(r){var o=e.skin_url?t.documentBaseURI.toAbsolute(e.skin_url):f.baseURL+"/skins/ui/"+r,i=f.baseURL+"/skins/content/";return n===o+"/content"+(t.inline?".inline":"")+".min.css"||-1!==n.indexOf(i)}return!1}(i,r)){m.each(t.imports,function(t){s(t,!0)});try{e=t.cssRules||t.rules}catch(o){}m.each(e,function(t){t.styleSheet?s(t.styleSheet,!0):t.selectorText&&m.each(t.selectorText.split(","),function(t){c.push(m.trim(t))})})}}m.each(i.contentCSS,function(t){e[t]=!0}),u=u||function(t,n){return n||e[t]};try{m.each(t.styleSheets,function(t){s(t)})}catch(n){}return c}function A(t,n){var e,r=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(n);if(r){var o=r[1],i=r[2].substr(1).split(".").join(" "),u=m.makeMap("a,img");return r[1]?(e={title:n},t.schema.getTextBlockElements()[o]?e.block=o:t.schema.getBlockElements()[o]||u[o.toLowerCase()]?e.selector=o:e.inline=o):r[2]&&(e={inline:"span",title:n.substr(1),classes:i}),!1!==c(t)?e.classes=i:e.attributes={"class":i},e}}function P(t,n){return null===n||!1!==i(t)}var w=T("array"),E=T("function"),I=Array.prototype.slice,M=Array.prototype.push,j=(E(Array.from)&&Array.from,A),D=function(s){s.on("init",function(t){function r(t,n){if(function(t,n,e,r){return!(P(t,e)?n in r:n in e.selectors)}(s,t,n,i)){!function(t,n,e,r){P(t,e)?r[n]=!0:e.selectors[n]=!0}(s,t,n,i);var e=function(t,n,e,r){return(r&&r.selector_converter?r.selector_converter:p(t)?p(t):function(){return A(t,e)}).call(n,e,r)}(s,s.plugins.importcss,t,n);if(e){var r=e.name||a.DOM.uniqueId();return s.formatter.register(r,e),m.extend({},{title:e.title,format:r})}}return null}var o=function(){var n=[],e=[],r={};return{addItemToGroup:function(t,n){r[t]?r[t].push(n):(e.push(t),r[t]=[n])},addItem:function(t){n.push(t)},toFormats:function(){return b(e,function(t){var n=r[t];return 0===n.length?[]:[{title:t,items:n}]}).concat(n)}}}(),i={},u=k(g(s)),c=function(t){return m.map(t,function(t){return m.extend({},t,{original:t,selectors:{},filter:k(t.filter),item:{text:t.title,menu:[]}})})}(y(s));m.each(S(s,s.getDoc(),k(d(s))),function(e){if(-1===e.indexOf(".mce-")&&(!u||u(e))){var t=function(t,n){return m.grep(t,function(t){return!t.filter||t.filter(n)})}(c,e);if(0<t.length)m.each(t,function(t){var n=r(e,t);n&&o.addItemToGroup(t.title,n)});else{var n=r(e,null);n&&o.addItem(n)}}});var n=o.toFormats();s.fire("addStyleModifications",{items:n,replace:!v(s)})})},R=function(n){return{convertSelectorToFormat:function(t){return j(n,t)}}};!function U(){o.add("importcss",function(t){return D(t),R(t)})}()}();
|
||||
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
+1
-1
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
!function(){"use strict";function n(e){return e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S"))}function r(e){return e.getParam("insertdatetime_formats",["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"])}function a(e,t){if((e=""+e).length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e}function i(e,t,n){return n=n||new Date,t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+n.getFullYear())).replace("%y",""+n.getYear())).replace("%m",a(n.getMonth()+1,2))).replace("%d",a(n.getDate(),2))).replace("%H",""+a(n.getHours(),2))).replace("%M",""+a(n.getMinutes(),2))).replace("%S",""+a(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(f[n.getMonth()]))).replace("%b",""+e.translate(d[n.getMonth()]))).replace("%A",""+e.translate(s[n.getDay()]))).replace("%a",""+e.translate(l[n.getDay()]))).replace("%%","%")}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(e){return e.getParam("insertdatetime_dateformat",e.translate("%Y-%m-%d"))},o=n,u=r,c=function(e){var t=r(e);return 0<t.length?t[0]:n(e)},m=function(e){return e.getParam("insertdatetime_element",!1)},l="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),s="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),d="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),f="January February March April May June July August September October November December".split(" "),p=function(e,t){if(m(e)){var n=i(e,t),r=void 0;r=/%[HMSIp]/.test(t)?i(e,"%Y-%m-%dT%H:%M"):i(e,"%Y-%m-%d");var a=e.dom.getParent(e.selection.getStart(),"time");a?function(e,t,n,r){var a=e.dom.create("time",{datetime:n},r);t.parentNode.insertBefore(a,t),e.dom.remove(t),e.selection.select(a,!0),e.selection.collapse(!1)}(e,a,r,n):e.insertContent('<time datetime="'+r+'">'+n+"</time>")}else e.insertContent(i(e,t))},g=i,y=function(e){e.addCommand("mceInsertDate",function(){p(e,t(e))}),e.addCommand("mceInsertTime",function(){p(e,o(e))})},M=tinymce.util.Tools.resolve("tinymce.util.Tools"),S=function(e){function t(){return n}var n=e;return{get:t,set:function(e){n=e},clone:function(){return S(t())}}},v=function(n){var t=u(n),r=S(c(n));n.ui.registry.addSplitButton("insertdatetime",{icon:"insert-time",tooltip:"Insert date/time",select:function(e){return e===r.get()},fetch:function(e){e(M.map(t,function(e){return{type:"choiceitem",text:g(n,e),value:e}}))},onAction:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];p(n,r.get())},onItemAction:function(e,t){r.set(t),p(n,t)}});n.ui.registry.addNestedMenuItem("insertdatetime",{icon:"insert-time",text:"Date/time",getSubmenuItems:function(){return M.map(t,function(e){return{type:"menuitem",text:g(n,e),onAction:function(e){return function(){r.set(e),p(n,e)}}(e)}})}})};!function h(){e.add("insertdatetime",function(e){y(e),v(e)})}()}();
|
||||
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
@@ -119,7 +119,7 @@
|
||||
toggle: false,
|
||||
attributes: {
|
||||
size: function (vars) {
|
||||
return global$1.inArray(fontSizes, vars.value) + 1;
|
||||
return String(global$1.inArray(fontSizes, vars.value) + 1);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
+2
-2
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=function(e){return e.getParam("font_formats")},i=function(e){return e.getParam("fontsize_formats")},n=function(e,t){e.settings.fontsize_formats=t},l=function(e,t){e.settings.font_formats=t},s=function(e){return e.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large")},r=function(e,t){e.settings.inline_styles=t},o=function(e){!function(e){r(e,!1),i(e)||n(e,"8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7"),t(e)||l(e,"Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats")}(e),e.on("PreInit",function(){return function(e){var t="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table",i=a.explode(s(e)),n=e.schema;e.formatter.register({alignleft:{selector:t,attributes:{align:"left"}},aligncenter:{selector:t,attributes:{align:"center"}},alignright:{selector:t,attributes:{align:"right"}},alignjustify:{selector:t,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",toggle:!1,attributes:{face:"%value"}},fontsize:{inline:"font",toggle:!1,attributes:{size:function(e){return a.inArray(i,e.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0}}),a.each("b,i,u,strike".split(","),function(e){n.addValidElements(e+"[*]")}),n.getElementRule("font")||n.addValidElements("font[face|size|color|style]"),a.each(t.split(","),function(e){var t=n.getElementRule(e);t&&(t.attributes.align||(t.attributes.align={},t.attributesOrder.push("align")))})}(e)})};!function c(){e.add("legacyoutput",function(e){o(e)})}()}();
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=function(e){return e.getParam("font_formats")},i=function(e){return e.getParam("fontsize_formats")},n=function(e,t){e.settings.fontsize_formats=t},l=function(e,t){e.settings.font_formats=t},s=function(e){return e.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large")},r=function(e,t){e.settings.inline_styles=t},o=function(e){!function(e){r(e,!1),i(e)||n(e,"8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7"),t(e)||l(e,"Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats")}(e),e.on("PreInit",function(){return function(e){var t="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table",i=a.explode(s(e)),n=e.schema;e.formatter.register({alignleft:{selector:t,attributes:{align:"left"}},aligncenter:{selector:t,attributes:{align:"center"}},alignright:{selector:t,attributes:{align:"right"}},alignjustify:{selector:t,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",toggle:!1,attributes:{face:"%value"}},fontsize:{inline:"font",toggle:!1,attributes:{size:function(e){return String(a.inArray(i,e.value)+1)}}},forecolor:{inline:"font",attributes:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0}}),a.each("b,i,u,strike".split(","),function(e){n.addValidElements(e+"[*]")}),n.getElementRule("font")||n.addValidElements("font[face|size|color|style]"),a.each(t.split(","),function(e){var t=n.getElementRule(e);t&&(t.attributes.align||(t.attributes.align={},t.attributesOrder.push("align")))})}(e)})};!function c(){e.add("legacyoutput",function(e){o(e)})}()}();
|
||||
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function (domGlobals) {
|
||||
'use strict';
|
||||
@@ -72,6 +72,9 @@
|
||||
var useQuickLink = function (editor) {
|
||||
return editor.getParam('link_quicklink', false, 'boolean');
|
||||
};
|
||||
var getDefaultLinkProtocol = function (editor) {
|
||||
return editor.getParam('link_default_protocol', 'http', 'string');
|
||||
};
|
||||
var Settings = {
|
||||
assumeExternalTargets: assumeExternalTargets,
|
||||
hasContextToolbar: hasContextToolbar,
|
||||
@@ -82,7 +85,8 @@
|
||||
getLinkClassList: getLinkClassList,
|
||||
shouldShowLinkTitle: shouldShowLinkTitle,
|
||||
allowUnsafeLinkTarget: allowUnsafeLinkTarget,
|
||||
useQuickLink: useQuickLink
|
||||
useQuickLink: useQuickLink,
|
||||
getDefaultLinkProtocol: getDefaultLinkProtocol
|
||||
};
|
||||
|
||||
var appendClickRemove = function (link, evt) {
|
||||
@@ -274,12 +278,20 @@
|
||||
return r;
|
||||
};
|
||||
var bind = function (xs, f) {
|
||||
var output = map(xs, f);
|
||||
return flatten(output);
|
||||
return flatten(map(xs, f));
|
||||
};
|
||||
var from$1 = isFunction(Array.from) ? Array.from : function (x) {
|
||||
return nativeSlice.call(x);
|
||||
};
|
||||
var findMap = function (arr, f) {
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
var r = f(arr[i], i);
|
||||
if (r.isSome()) {
|
||||
return r;
|
||||
}
|
||||
}
|
||||
return Option.none();
|
||||
};
|
||||
|
||||
var global$3 = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
||||
|
||||
@@ -462,15 +474,6 @@
|
||||
}
|
||||
return r;
|
||||
};
|
||||
var findMap = function (arr, f) {
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
var r = f(arr[i], i);
|
||||
if (r.isSome()) {
|
||||
return r;
|
||||
}
|
||||
}
|
||||
return Option.none();
|
||||
};
|
||||
|
||||
var getValue = function (item) {
|
||||
return isString(item.value) ? item.value : '';
|
||||
@@ -574,7 +577,11 @@
|
||||
var onUrlChange = function (data) {
|
||||
if (persistentText.get().length <= 0) {
|
||||
var urlText = data.url.meta.text !== undefined ? data.url.meta.text : data.url.value;
|
||||
return Option.some({ text: urlText });
|
||||
var urlTitle = data.url.meta.title !== undefined ? data.url.meta.title : '';
|
||||
return Option.some({
|
||||
text: urlText,
|
||||
title: urlTitle
|
||||
});
|
||||
} else {
|
||||
return Option.none();
|
||||
}
|
||||
@@ -1241,22 +1248,22 @@
|
||||
}
|
||||
}) : Option.none();
|
||||
};
|
||||
var tryProtocolTransform = function (assumeExternalTargets) {
|
||||
var tryProtocolTransform = function (assumeExternalTargets, defaultLinkProtocol) {
|
||||
return function (data) {
|
||||
var url = data.href;
|
||||
var suggestProtocol = assumeExternalTargets === 1 && !Utils.hasProtocol(url) || assumeExternalTargets === 0 && /^\s*www[\.|\d\.]/i.test(url);
|
||||
return suggestProtocol ? Option.some({
|
||||
message: 'The URL you entered seems to be an external link. Do you want to add the required http:// prefix?',
|
||||
message: 'The URL you entered seems to be an external link. Do you want to add the required ' + defaultLinkProtocol + ':// prefix?',
|
||||
preprocess: function (oldData) {
|
||||
return __assign(__assign({}, oldData), { href: 'http://' + url });
|
||||
return __assign(__assign({}, oldData), { href: defaultLinkProtocol + '://' + url });
|
||||
}
|
||||
}) : Option.none();
|
||||
};
|
||||
};
|
||||
var preprocess = function (editor, assumeExternalTargets, data) {
|
||||
var preprocess = function (editor, data) {
|
||||
return findMap([
|
||||
tryEmailTransform,
|
||||
tryProtocolTransform(assumeExternalTargets)
|
||||
tryProtocolTransform(Settings.assumeExternalTargets(editor), Settings.getDefaultLinkProtocol(editor))
|
||||
], function (f) {
|
||||
return f(data);
|
||||
}).fold(function () {
|
||||
@@ -1422,7 +1429,7 @@
|
||||
};
|
||||
var DialogInfo = { collect: collect };
|
||||
|
||||
var handleSubmit = function (editor, info, assumeExternalTargets) {
|
||||
var handleSubmit = function (editor, info) {
|
||||
return function (api) {
|
||||
var data = api.getData();
|
||||
if (!data.url.value) {
|
||||
@@ -1448,7 +1455,7 @@
|
||||
attach: data.url.meta !== undefined && data.url.meta.attach ? data.url.meta.attach : function () {
|
||||
}
|
||||
};
|
||||
DialogConfirms.preprocess(editor, assumeExternalTargets, changedData).get(function (pData) {
|
||||
DialogConfirms.preprocess(editor, changedData).get(function (pData) {
|
||||
Utils.link(editor, attachState, pData);
|
||||
});
|
||||
api.close();
|
||||
@@ -1550,7 +1557,7 @@
|
||||
var open$1 = function (editor) {
|
||||
var data = collectData(editor);
|
||||
data.map(function (info) {
|
||||
var onSubmit = handleSubmit(editor, info, Settings.assumeExternalTargets(editor));
|
||||
var onSubmit = handleSubmit(editor, info);
|
||||
return makeDialog(info, onSubmit, editor);
|
||||
}).get(function (spec) {
|
||||
editor.windowManager.open(spec);
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function (domGlobals) {
|
||||
'use strict';
|
||||
@@ -239,8 +239,7 @@
|
||||
return r;
|
||||
};
|
||||
var bind = function (xs, f) {
|
||||
var output = map(xs, f);
|
||||
return flatten(output);
|
||||
return flatten(map(xs, f));
|
||||
};
|
||||
var reverse = function (xs) {
|
||||
var r = nativeSlice.call(xs, 0);
|
||||
@@ -271,6 +270,19 @@
|
||||
documentPositionContainedBy: documentPositionContainedBy
|
||||
};
|
||||
|
||||
var __assign = function () {
|
||||
__assign = Object.assign || function __assign(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s)
|
||||
if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
|
||||
var Cell = function (initial) {
|
||||
var value = initial;
|
||||
var get = function () {
|
||||
@@ -986,18 +998,38 @@
|
||||
getSelectedListRoots: getSelectedListRoots
|
||||
};
|
||||
|
||||
var shouldIndentOnTab = function (editor) {
|
||||
return editor.getParam('lists_indent_on_tab', true);
|
||||
};
|
||||
var getForcedRootBlock = function (editor) {
|
||||
var block = editor.getParam('forced_root_block', 'p');
|
||||
if (block === false) {
|
||||
return '';
|
||||
} else if (block === true) {
|
||||
return 'p';
|
||||
} else {
|
||||
return block;
|
||||
}
|
||||
};
|
||||
var getForcedRootBlockAttrs = function (editor) {
|
||||
return editor.getParam('forced_root_block_attrs', {});
|
||||
};
|
||||
var Settings = {
|
||||
shouldIndentOnTab: shouldIndentOnTab,
|
||||
getForcedRootBlock: getForcedRootBlock,
|
||||
getForcedRootBlockAttrs: getForcedRootBlockAttrs
|
||||
};
|
||||
|
||||
var createTextBlock = function (editor, contentNode) {
|
||||
var dom = editor.dom;
|
||||
var blockElements = editor.schema.getBlockElements();
|
||||
var fragment = dom.createFragment();
|
||||
var node, textBlock, blockName, hasContentNode;
|
||||
if (editor.settings.forced_root_block) {
|
||||
blockName = editor.settings.forced_root_block;
|
||||
}
|
||||
var blockName = Settings.getForcedRootBlock(editor);
|
||||
var node, textBlock, hasContentNode;
|
||||
if (blockName) {
|
||||
textBlock = dom.create(blockName);
|
||||
if (textBlock.tagName === editor.settings.forced_root_block) {
|
||||
dom.setAttribs(textBlock, editor.settings.forced_root_block_attrs);
|
||||
if (textBlock.tagName === blockName.toUpperCase()) {
|
||||
dom.setAttribs(textBlock, Settings.getForcedRootBlockAttrs(editor));
|
||||
}
|
||||
if (!NodeType.isBlock(contentNode.firstChild, blockElements)) {
|
||||
fragment.appendChild(textBlock);
|
||||
@@ -1025,7 +1057,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!editor.settings.forced_root_block) {
|
||||
if (!blockName) {
|
||||
fragment.appendChild(dom.create('br'));
|
||||
} else {
|
||||
if (!hasContentNode) {
|
||||
@@ -1233,36 +1265,9 @@
|
||||
}
|
||||
};
|
||||
|
||||
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
var shallow = function (old, nu) {
|
||||
return nu;
|
||||
};
|
||||
var baseMerge = function (merger) {
|
||||
return function () {
|
||||
var objects = new Array(arguments.length);
|
||||
for (var i = 0; i < objects.length; i++) {
|
||||
objects[i] = arguments[i];
|
||||
}
|
||||
if (objects.length === 0) {
|
||||
throw new Error('Can\'t merge zero objects');
|
||||
}
|
||||
var ret = {};
|
||||
for (var j = 0; j < objects.length; j++) {
|
||||
var curObject = objects[j];
|
||||
for (var key in curObject) {
|
||||
if (hasOwnProperty.call(curObject, key)) {
|
||||
ret[key] = merger(ret[key], curObject[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
};
|
||||
var merge = baseMerge(shallow);
|
||||
|
||||
var cloneListProperties = function (target, source) {
|
||||
target.listType = source.listType;
|
||||
target.listAttributes = merge({}, source.listAttributes);
|
||||
target.listAttributes = __assign({}, source.listAttributes);
|
||||
};
|
||||
var previousSiblingEntry = function (entries, start) {
|
||||
var depth = entries[start].depth;
|
||||
@@ -2094,11 +2099,6 @@
|
||||
};
|
||||
var Commands = { register: register };
|
||||
|
||||
var shouldIndentOnTab = function (editor) {
|
||||
return editor.getParam('lists_indent_on_tab', true);
|
||||
};
|
||||
var Settings = { shouldIndentOnTab: shouldIndentOnTab };
|
||||
|
||||
var setupTabKey = function (editor) {
|
||||
editor.on('keydown', function (e) {
|
||||
if (e.keyCode !== global$3.TAB || global$3.metaKeyPressed(e)) {
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
@@ -162,6 +162,7 @@
|
||||
};
|
||||
};
|
||||
var isString = isType('string');
|
||||
var isObject = isType('object');
|
||||
var isArray = isType('array');
|
||||
var isFunction = isType('function');
|
||||
|
||||
@@ -205,39 +206,12 @@
|
||||
};
|
||||
};
|
||||
|
||||
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
var shallow = function (old, nu) {
|
||||
return nu;
|
||||
};
|
||||
var baseMerge = function (merger) {
|
||||
return function () {
|
||||
var objects = new Array(arguments.length);
|
||||
for (var i = 0; i < objects.length; i++) {
|
||||
objects[i] = arguments[i];
|
||||
}
|
||||
if (objects.length === 0) {
|
||||
throw new Error('Can\'t merge zero objects');
|
||||
}
|
||||
var ret = {};
|
||||
for (var j = 0; j < objects.length; j++) {
|
||||
var curObject = objects[j];
|
||||
for (var key in curObject) {
|
||||
if (hasOwnProperty.call(curObject, key)) {
|
||||
ret[key] = merger(ret[key], curObject[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
};
|
||||
var merge = baseMerge(shallow);
|
||||
|
||||
var hasOwnProperty$1 = Object.hasOwnProperty;
|
||||
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$1.call(obj, key);
|
||||
return hasOwnProperty.call(obj, key);
|
||||
};
|
||||
|
||||
var getScripts = function (editor) {
|
||||
@@ -334,8 +308,8 @@
|
||||
validate: false,
|
||||
allow_conditional_comments: true,
|
||||
start: function (name, attrs) {
|
||||
if (!data.source1 && name === 'param') {
|
||||
data.source1 = attrs.map.movie;
|
||||
if (!data.source && name === 'param') {
|
||||
data.source = attrs.map.movie;
|
||||
}
|
||||
if (name === 'iframe' || name === 'object' || name === 'embed' || name === 'video' || name === 'audio') {
|
||||
if (!data.type) {
|
||||
@@ -350,16 +324,16 @@
|
||||
}
|
||||
data = {
|
||||
type: 'script',
|
||||
source1: attrs.map.src,
|
||||
source: attrs.map.src,
|
||||
width: String(videoScript.width),
|
||||
height: String(videoScript.height)
|
||||
};
|
||||
}
|
||||
if (name === 'source') {
|
||||
if (!data.source1) {
|
||||
data.source1 = attrs.map.src;
|
||||
} else if (!data.source2) {
|
||||
data.source2 = attrs.map.src;
|
||||
if (!data.source) {
|
||||
data.source = attrs.map.src;
|
||||
} else if (!data.altsource) {
|
||||
data.altsource = attrs.map.src;
|
||||
}
|
||||
}
|
||||
if (name === 'img' && !data.poster) {
|
||||
@@ -367,8 +341,8 @@
|
||||
}
|
||||
}
|
||||
}).parse(html);
|
||||
data.source1 = data.source1 || data.src || data.data;
|
||||
data.source2 = data.source2 || '';
|
||||
data.source = data.source || data.src || data.data;
|
||||
data.altsource = data.altsource || '';
|
||||
data.poster = data.poster || '';
|
||||
return data;
|
||||
};
|
||||
@@ -377,8 +351,8 @@
|
||||
var div = fragment.firstChild;
|
||||
return {
|
||||
type: 'ephox-embed-iri',
|
||||
source1: getEphoxEmbedIri(div),
|
||||
source2: '',
|
||||
source: getEphoxEmbedIri(div),
|
||||
altsource: '',
|
||||
poster: '',
|
||||
width: Size.getMaxWidth(div),
|
||||
height: Size.getMaxHeight(div)
|
||||
@@ -388,8 +362,6 @@
|
||||
return isEphoxEmbed(html) ? ephoxEmbedHtmlToData(html) : htmlToDataSax(prefixes, html);
|
||||
};
|
||||
|
||||
var global$4 = tinymce.util.Tools.resolve('tinymce.util.Promise');
|
||||
|
||||
var guess = function (url) {
|
||||
var mimes = {
|
||||
mp3: 'audio/mpeg',
|
||||
@@ -406,9 +378,9 @@
|
||||
};
|
||||
var Mime = { guess: guess };
|
||||
|
||||
var global$5 = tinymce.util.Tools.resolve('tinymce.html.Writer');
|
||||
var global$4 = tinymce.util.Tools.resolve('tinymce.html.Writer');
|
||||
|
||||
var global$6 = tinymce.util.Tools.resolve('tinymce.html.Schema');
|
||||
var global$5 = tinymce.util.Tools.resolve('tinymce.html.Schema');
|
||||
|
||||
var DOM$1 = global$3.DOM;
|
||||
var setAttributes = function (attrs, updatedAttrs) {
|
||||
@@ -442,13 +414,17 @@
|
||||
}
|
||||
};
|
||||
var normalizeHtml = function (html) {
|
||||
var writer = global$5();
|
||||
var writer = global$4();
|
||||
var parser = global$2(writer);
|
||||
parser.parse(html);
|
||||
return writer.getContent();
|
||||
};
|
||||
var sources = [
|
||||
'source',
|
||||
'altsource'
|
||||
];
|
||||
var updateHtmlSax = function (html, data, updateAll) {
|
||||
var writer = global$5();
|
||||
var writer = global$4();
|
||||
var sourceCount = 0;
|
||||
var hasImage;
|
||||
global$2({
|
||||
@@ -485,24 +461,24 @@
|
||||
poster: data.poster,
|
||||
src: ''
|
||||
});
|
||||
if (data.source2) {
|
||||
if (data.altsource) {
|
||||
setAttributes(attrs, { src: '' });
|
||||
}
|
||||
break;
|
||||
case 'iframe':
|
||||
setAttributes(attrs, { src: data.source1 });
|
||||
setAttributes(attrs, { src: data.source });
|
||||
break;
|
||||
case 'source':
|
||||
sourceCount++;
|
||||
if (sourceCount <= 2) {
|
||||
if (sourceCount < 2) {
|
||||
setAttributes(attrs, {
|
||||
src: data['source' + sourceCount],
|
||||
type: data['source' + sourceCount + 'mime']
|
||||
src: data[sources[sourceCount]],
|
||||
type: data[sources[sourceCount] + 'mime']
|
||||
});
|
||||
if (!data['source' + sourceCount]) {
|
||||
if (!data[sources[sourceCount]]) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
sourceCount++;
|
||||
break;
|
||||
case 'img':
|
||||
if (!data.poster) {
|
||||
@@ -516,14 +492,14 @@
|
||||
},
|
||||
end: function (name) {
|
||||
if (name === 'video' && updateAll) {
|
||||
for (var index = 1; index <= 2; index++) {
|
||||
if (data['source' + index]) {
|
||||
for (var index = 0; index < 2; index++) {
|
||||
if (data[sources[index]]) {
|
||||
var attrs = [];
|
||||
attrs.map = {};
|
||||
if (sourceCount < index) {
|
||||
setAttributes(attrs, {
|
||||
src: data['source' + index],
|
||||
type: data['source' + index + 'mime']
|
||||
src: data[sources[index]],
|
||||
type: data[sources[index] + 'mime']
|
||||
});
|
||||
writer.start('source', attrs, true);
|
||||
}
|
||||
@@ -542,7 +518,7 @@
|
||||
}
|
||||
writer.end(name);
|
||||
}
|
||||
}, global$6({})).parse(html);
|
||||
}, global$5({})).parse(html);
|
||||
return writer.getContent();
|
||||
};
|
||||
var isEphoxEmbed$1 = function (html) {
|
||||
@@ -567,7 +543,7 @@
|
||||
type: 'iframe',
|
||||
w: 560,
|
||||
h: 314,
|
||||
url: '//www.youtube.com/embed/$1',
|
||||
url: 'www.youtube.com/embed/$1',
|
||||
allowFullscreen: true
|
||||
},
|
||||
{
|
||||
@@ -575,7 +551,7 @@
|
||||
type: 'iframe',
|
||||
w: 560,
|
||||
h: 314,
|
||||
url: '//www.youtube.com/embed/$2?$4',
|
||||
url: 'www.youtube.com/embed/$2?$4',
|
||||
allowFullscreen: true
|
||||
},
|
||||
{
|
||||
@@ -583,7 +559,7 @@
|
||||
type: 'iframe',
|
||||
w: 560,
|
||||
h: 314,
|
||||
url: '//www.youtube.com/embed/$1',
|
||||
url: 'www.youtube.com/embed/$1',
|
||||
allowFullscreen: true
|
||||
},
|
||||
{
|
||||
@@ -591,7 +567,7 @@
|
||||
type: 'iframe',
|
||||
w: 425,
|
||||
h: 350,
|
||||
url: '//player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc',
|
||||
url: 'player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc',
|
||||
allowFullscreen: true
|
||||
},
|
||||
{
|
||||
@@ -599,7 +575,7 @@
|
||||
type: 'iframe',
|
||||
w: 425,
|
||||
h: 350,
|
||||
url: '//player.vimeo.com/video/$2?title=0&byline=0',
|
||||
url: 'player.vimeo.com/video/$2?title=0&byline=0',
|
||||
allowFullscreen: true
|
||||
},
|
||||
{
|
||||
@@ -607,7 +583,7 @@
|
||||
type: 'iframe',
|
||||
w: 425,
|
||||
h: 350,
|
||||
url: '//maps.google.com/maps/ms?msid=$2&output=embed"',
|
||||
url: 'maps.google.com/maps/ms?msid=$2&output=embed"',
|
||||
allowFullscreen: false
|
||||
},
|
||||
{
|
||||
@@ -615,7 +591,7 @@
|
||||
type: 'iframe',
|
||||
w: 480,
|
||||
h: 270,
|
||||
url: '//www.dailymotion.com/embed/video/$1',
|
||||
url: 'www.dailymotion.com/embed/video/$1',
|
||||
allowFullscreen: true
|
||||
},
|
||||
{
|
||||
@@ -623,13 +599,22 @@
|
||||
type: 'iframe',
|
||||
w: 480,
|
||||
h: 270,
|
||||
url: '//www.dailymotion.com/embed/video/$1',
|
||||
url: 'www.dailymotion.com/embed/video/$1',
|
||||
allowFullscreen: true
|
||||
}
|
||||
];
|
||||
var getProtocol = function (url) {
|
||||
var protocolMatches = url.match(/^(https?:\/\/|www\.)(.+)$/i);
|
||||
if (protocolMatches && protocolMatches.length > 1) {
|
||||
return protocolMatches[1] === 'www.' ? 'https://' : protocolMatches[1];
|
||||
} else {
|
||||
return 'https://';
|
||||
}
|
||||
};
|
||||
var getUrl = function (pattern, url) {
|
||||
var protocol = getProtocol(url);
|
||||
var match = pattern.regex.exec(url);
|
||||
var newUrl = pattern.url;
|
||||
var newUrl = protocol + pattern.url;
|
||||
var _loop_1 = function (i) {
|
||||
newUrl = newUrl.replace('$' + i, function () {
|
||||
return match[i] ? match[i] : '';
|
||||
@@ -641,11 +626,11 @@
|
||||
return newUrl.replace(/\?$/, '');
|
||||
};
|
||||
var matchPattern = function (url) {
|
||||
var pattern = urlPatterns.filter(function (pattern) {
|
||||
var patterns = urlPatterns.filter(function (pattern) {
|
||||
return pattern.regex.test(url);
|
||||
});
|
||||
if (pattern.length > 0) {
|
||||
return global$1.extend({}, pattern[0], { url: getUrl(pattern[0], url) });
|
||||
if (patterns.length > 0) {
|
||||
return global$1.extend({}, patterns[0], { url: getUrl(patterns[0], url) });
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@@ -653,10 +638,10 @@
|
||||
|
||||
var getIframeHtml = function (data) {
|
||||
var allowFullscreen = data.allowFullscreen ? ' allowFullscreen="1"' : '';
|
||||
return '<iframe src="' + data.source1 + '" width="' + data.width + '" height="' + data.height + '"' + allowFullscreen + '></iframe>';
|
||||
return '<iframe src="' + data.source + '" width="' + data.width + '" height="' + data.height + '"' + allowFullscreen + '></iframe>';
|
||||
};
|
||||
var getFlashHtml = function (data) {
|
||||
var html = '<object data="' + data.source1 + '" width="' + data.width + '" height="' + data.height + '" type="application/x-shockwave-flash">';
|
||||
var html = '<object data="' + data.source + '" width="' + data.width + '" height="' + data.height + '" type="application/x-shockwave-flash">';
|
||||
if (data.poster) {
|
||||
html += '<img src="' + data.poster + '" width="' + data.width + '" height="' + data.height + '" />';
|
||||
}
|
||||
@@ -667,41 +652,41 @@
|
||||
if (audioTemplateCallback) {
|
||||
return audioTemplateCallback(data);
|
||||
} else {
|
||||
return '<audio controls="controls" src="' + data.source1 + '">' + (data.source2 ? '\n<source src="' + data.source2 + '"' + (data.source2mime ? ' type="' + data.source2mime + '"' : '') + ' />\n' : '') + '</audio>';
|
||||
return '<audio controls="controls" src="' + data.source + '">' + (data.altsource ? '\n<source src="' + data.altsource + '"' + (data.altsourcemime ? ' type="' + data.altsourcemime + '"' : '') + ' />\n' : '') + '</audio>';
|
||||
}
|
||||
};
|
||||
var getVideoHtml = function (data, videoTemplateCallback) {
|
||||
if (videoTemplateCallback) {
|
||||
return videoTemplateCallback(data);
|
||||
} else {
|
||||
return '<video width="' + data.width + '" height="' + data.height + '"' + (data.poster ? ' poster="' + data.poster + '"' : '') + ' controls="controls">\n' + '<source src="' + data.source1 + '"' + (data.source1mime ? ' type="' + data.source1mime + '"' : '') + ' />\n' + (data.source2 ? '<source src="' + data.source2 + '"' + (data.source2mime ? ' type="' + data.source2mime + '"' : '') + ' />\n' : '') + '</video>';
|
||||
return '<video width="' + data.width + '" height="' + data.height + '"' + (data.poster ? ' poster="' + data.poster + '"' : '') + ' controls="controls">\n' + '<source src="' + data.source + '"' + (data.sourcemime ? ' type="' + data.sourcemime + '"' : '') + ' />\n' + (data.altsource ? '<source src="' + data.altsource + '"' + (data.altsourcemime ? ' type="' + data.altsourcemime + '"' : '') + ' />\n' : '') + '</video>';
|
||||
}
|
||||
};
|
||||
var getScriptHtml = function (data) {
|
||||
return '<script src="' + data.source1 + '"></script>';
|
||||
return '<script src="' + data.source + '"></script>';
|
||||
};
|
||||
var dataToHtml = function (editor, dataIn) {
|
||||
var data = global$1.extend({}, dataIn);
|
||||
if (!data.source1) {
|
||||
if (!data.source) {
|
||||
global$1.extend(data, htmlToData(Settings.getScripts(editor), data.embed));
|
||||
if (!data.source1) {
|
||||
if (!data.source) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
if (!data.source2) {
|
||||
data.source2 = '';
|
||||
if (!data.altsource) {
|
||||
data.altsource = '';
|
||||
}
|
||||
if (!data.poster) {
|
||||
data.poster = '';
|
||||
}
|
||||
data.source1 = editor.convertURL(data.source1, 'source');
|
||||
data.source2 = editor.convertURL(data.source2, 'source');
|
||||
data.source1mime = Mime.guess(data.source1);
|
||||
data.source2mime = Mime.guess(data.source2);
|
||||
data.source = editor.convertURL(data.source, 'source');
|
||||
data.altsource = editor.convertURL(data.altsource, 'source');
|
||||
data.sourcemime = Mime.guess(data.source);
|
||||
data.altsourcemime = Mime.guess(data.altsource);
|
||||
data.poster = editor.convertURL(data.poster, 'poster');
|
||||
var pattern = matchPattern(data.source1);
|
||||
var pattern = matchPattern(data.source);
|
||||
if (pattern) {
|
||||
data.source1 = pattern.url;
|
||||
data.source = pattern.url;
|
||||
data.type = pattern.type;
|
||||
data.allowFullscreen = pattern.allowFullscreen;
|
||||
data.width = data.width || String(pattern.w);
|
||||
@@ -710,7 +695,7 @@
|
||||
if (data.embed) {
|
||||
return UpdateHtml.updateHtml(data.embed, data, true);
|
||||
} else {
|
||||
var videoScript = getVideoScriptMatch(Settings.getScripts(editor), data.source1);
|
||||
var videoScript = getVideoScriptMatch(Settings.getScripts(editor), data.source);
|
||||
if (videoScript) {
|
||||
data.type = 'script';
|
||||
data.width = String(videoScript.width);
|
||||
@@ -725,9 +710,9 @@
|
||||
});
|
||||
if (data.type === 'iframe') {
|
||||
return getIframeHtml(data);
|
||||
} else if (data.source1mime === 'application/x-shockwave-flash') {
|
||||
} else if (data.sourcemime === 'application/x-shockwave-flash') {
|
||||
return getFlashHtml(data);
|
||||
} else if (data.source1mime.indexOf('audio') !== -1) {
|
||||
} else if (data.sourcemime.indexOf('audio') !== -1) {
|
||||
return getAudioHtml(data, audioTemplateCallback);
|
||||
} else if (data.type === 'script') {
|
||||
return getScriptHtml(data);
|
||||
@@ -737,30 +722,32 @@
|
||||
}
|
||||
};
|
||||
|
||||
var global$6 = tinymce.util.Tools.resolve('tinymce.util.Promise');
|
||||
|
||||
var cache = {};
|
||||
var embedPromise = function (data, dataToHtml, handler) {
|
||||
return new global$4(function (res, rej) {
|
||||
return new global$6(function (res, rej) {
|
||||
var wrappedResolve = function (response) {
|
||||
if (response.html) {
|
||||
cache[data.source1] = response;
|
||||
cache[data.source] = response;
|
||||
}
|
||||
return res({
|
||||
url: data.source1,
|
||||
url: data.source,
|
||||
html: response.html ? response.html : dataToHtml(data)
|
||||
});
|
||||
};
|
||||
if (cache[data.source1]) {
|
||||
wrappedResolve(cache[data.source1]);
|
||||
if (cache[data.source]) {
|
||||
wrappedResolve(cache[data.source]);
|
||||
} else {
|
||||
handler({ url: data.source1 }, wrappedResolve, rej);
|
||||
handler({ url: data.source }, wrappedResolve, rej);
|
||||
}
|
||||
});
|
||||
};
|
||||
var defaultPromise = function (data, dataToHtml) {
|
||||
return new global$4(function (res) {
|
||||
return new global$6(function (res) {
|
||||
res({
|
||||
html: dataToHtml(data),
|
||||
url: data.source1
|
||||
url: data.source
|
||||
});
|
||||
});
|
||||
};
|
||||
@@ -781,32 +768,67 @@
|
||||
isCached: isCached
|
||||
};
|
||||
|
||||
var unwrap = function (data) {
|
||||
var unwrapped = merge(data, {
|
||||
source1: data.source1.value,
|
||||
source2: get(data, 'source2').bind(function (source2) {
|
||||
return get(source2, 'value');
|
||||
}).getOr(''),
|
||||
poster: get(data, 'poster').bind(function (poster) {
|
||||
return get(poster, 'value');
|
||||
}).getOr('')
|
||||
var extractMeta = function (sourceInput, data) {
|
||||
return get(data, sourceInput).bind(function (mainData) {
|
||||
return get(mainData, 'meta');
|
||||
});
|
||||
get(data, 'dimensions').each(function (dimensions) {
|
||||
};
|
||||
var getValue = function (data, metaData, sourceInput) {
|
||||
return function (prop) {
|
||||
var _a;
|
||||
var getFromData = function () {
|
||||
return get(data, prop);
|
||||
};
|
||||
var getFromMetaData = function () {
|
||||
return get(metaData, prop);
|
||||
};
|
||||
var getNonEmptyValue = function (c) {
|
||||
return get(c, 'value').bind(function (v) {
|
||||
return v.length > 0 ? Option.some(v) : Option.none();
|
||||
});
|
||||
};
|
||||
var getFromValueFirst = function () {
|
||||
return getFromData().bind(function (child) {
|
||||
return isObject(child) ? getNonEmptyValue(child).orThunk(getFromMetaData) : getFromMetaData().orThunk(function () {
|
||||
return Option.from(child);
|
||||
});
|
||||
});
|
||||
};
|
||||
var getFromMetaFirst = function () {
|
||||
return getFromMetaData().orThunk(function () {
|
||||
return getFromData().bind(function (child) {
|
||||
return isObject(child) ? getNonEmptyValue(child) : Option.from(child);
|
||||
});
|
||||
});
|
||||
};
|
||||
return _a = {}, _a[prop] = (prop === sourceInput ? getFromValueFirst() : getFromMetaFirst()).getOr(''), _a;
|
||||
};
|
||||
};
|
||||
var getDimensions = function (data, metaData) {
|
||||
var dimensions = {};
|
||||
get(data, 'dimensions').each(function (dims) {
|
||||
each([
|
||||
'width',
|
||||
'height'
|
||||
], function (prop) {
|
||||
get(dimensions, prop).each(function (value) {
|
||||
return unwrapped[prop] = value;
|
||||
get(metaData, prop).orThunk(function () {
|
||||
return get(dims, prop);
|
||||
}).each(function (value) {
|
||||
return dimensions[prop] = value;
|
||||
});
|
||||
});
|
||||
});
|
||||
return unwrapped;
|
||||
return dimensions;
|
||||
};
|
||||
var unwrap = function (data, sourceInput) {
|
||||
var metaData = sourceInput ? extractMeta(sourceInput, data).getOr({}) : {};
|
||||
var get = getValue(data, metaData, sourceInput);
|
||||
return __assign(__assign(__assign(__assign(__assign({}, get('source')), get('altsource')), get('poster')), get('embed')), getDimensions(data, metaData));
|
||||
};
|
||||
var wrap = function (data) {
|
||||
var wrapped = merge(data, {
|
||||
source1: { value: get(data, 'source1').getOr('') },
|
||||
source2: { value: get(data, 'source2').getOr('') },
|
||||
var wrapped = __assign(__assign({}, data), {
|
||||
source: { value: get(data, 'source').getOr('') },
|
||||
altsource: { value: get(data, 'altsource').getOr('') },
|
||||
poster: { value: get(data, 'poster').getOr('') }
|
||||
});
|
||||
each([
|
||||
@@ -839,7 +861,7 @@
|
||||
var getEditorData = function (editor) {
|
||||
var element = editor.selection.getNode();
|
||||
var snippet = isMediaElement(element) ? editor.serializer.serialize(element, { selection: true }) : '';
|
||||
return merge({ embed: snippet }, htmlToData(Settings.getScripts(editor), snippet));
|
||||
return __assign({ embed: snippet }, htmlToData(Settings.getScripts(editor), snippet));
|
||||
};
|
||||
var addEmbedHtml = function (api, editor) {
|
||||
return function (response) {
|
||||
@@ -847,7 +869,7 @@
|
||||
var html = response.html;
|
||||
var snippetData = snippetToData(editor, html);
|
||||
var nuData = __assign(__assign({}, snippetData), {
|
||||
source1: response.url,
|
||||
source: response.url,
|
||||
embed: html
|
||||
});
|
||||
api.setData(wrap(nuData));
|
||||
@@ -873,7 +895,7 @@
|
||||
};
|
||||
var submitForm = function (prevData, newData, editor) {
|
||||
newData.embed = UpdateHtml.updateHtml(newData.embed, newData);
|
||||
if (newData.embed && (prevData.source1 === newData.source1 || Service.isCached(newData.source1))) {
|
||||
if (newData.embed && (prevData.source === newData.source || Service.isCached(newData.source))) {
|
||||
handleInsert(editor, newData.embed);
|
||||
} else {
|
||||
Service.getEmbedHtml(editor, newData).then(function (response) {
|
||||
@@ -885,14 +907,11 @@
|
||||
var editorData = getEditorData(editor);
|
||||
var currentData = Cell(editorData);
|
||||
var initialData = wrap(editorData);
|
||||
var getSourceData = function (api) {
|
||||
return unwrap(api.getData());
|
||||
};
|
||||
var handleSource1 = function (prevData, api) {
|
||||
var serviceData = getSourceData(api);
|
||||
if (prevData.source1 !== serviceData.source1) {
|
||||
var handleSource = function (prevData, api) {
|
||||
var serviceData = unwrap(api.getData(), 'source');
|
||||
if (prevData.source !== serviceData.source) {
|
||||
addEmbedHtml(win, editor)({
|
||||
url: serviceData.source1,
|
||||
url: serviceData.source,
|
||||
html: ''
|
||||
});
|
||||
Service.getEmbedHtml(editor, serviceData).then(addEmbedHtml(win, editor)).catch(handleError(editor));
|
||||
@@ -903,13 +922,13 @@
|
||||
var dataFromEmbed = snippetToData(editor, data.embed);
|
||||
api.setData(wrap(dataFromEmbed));
|
||||
};
|
||||
var handleUpdate = function (api) {
|
||||
var data = getSourceData(api);
|
||||
var handleUpdate = function (api, sourceInput) {
|
||||
var data = unwrap(api.getData(), sourceInput);
|
||||
var embed = dataToHtml(editor, data);
|
||||
api.setData(wrap(__assign(__assign({}, data), { embed: embed })));
|
||||
};
|
||||
var mediaInput = [{
|
||||
name: 'source1',
|
||||
name: 'source',
|
||||
type: 'urlinput',
|
||||
filetype: 'media',
|
||||
label: 'Source'
|
||||
@@ -940,7 +959,7 @@
|
||||
var advancedFormItems = [];
|
||||
if (Settings.hasAltSource(editor)) {
|
||||
advancedFormItems.push({
|
||||
name: 'source2',
|
||||
name: 'altsource',
|
||||
type: 'urlinput',
|
||||
filetype: 'media',
|
||||
label: 'Alternative source URL'
|
||||
@@ -988,31 +1007,33 @@
|
||||
}
|
||||
],
|
||||
onSubmit: function (api) {
|
||||
var serviceData = getSourceData(api);
|
||||
var serviceData = unwrap(api.getData());
|
||||
submitForm(currentData.get(), serviceData, editor);
|
||||
api.close();
|
||||
},
|
||||
onChange: function (api, detail) {
|
||||
switch (detail.name) {
|
||||
case 'source1':
|
||||
handleSource1(currentData.get(), api);
|
||||
case 'source':
|
||||
handleSource(currentData.get(), api);
|
||||
break;
|
||||
case 'embed':
|
||||
handleEmbed(api);
|
||||
break;
|
||||
case 'dimensions':
|
||||
case 'altsource':
|
||||
case 'poster':
|
||||
handleUpdate(api);
|
||||
break;
|
||||
default:
|
||||
handleUpdate(api, detail.name);
|
||||
break;
|
||||
}
|
||||
currentData.set(getSourceData(api));
|
||||
currentData.set(unwrap(api.getData()));
|
||||
},
|
||||
initialData: initialData
|
||||
});
|
||||
};
|
||||
var Dialog = { showDialog: showDialog };
|
||||
var Dialog = {
|
||||
showDialog: showDialog,
|
||||
unwrap: unwrap
|
||||
};
|
||||
|
||||
var get$1 = function (editor) {
|
||||
var showDialog = function () {
|
||||
@@ -1038,7 +1059,7 @@
|
||||
if (Settings.shouldFilterHtml(editor) === false) {
|
||||
return html;
|
||||
}
|
||||
var writer = global$5();
|
||||
var writer = global$4();
|
||||
var blocked;
|
||||
global$2({
|
||||
validate: false,
|
||||
@@ -1074,7 +1095,7 @@
|
||||
}
|
||||
writer.end(name);
|
||||
}
|
||||
}, global$6({})).parse(html);
|
||||
}, global$5({})).parse(html);
|
||||
return writer.getContent();
|
||||
};
|
||||
var Sanitize = { sanitize: sanitize };
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
+1
-1
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
!function(){"use strict";function o(n,e){for(var t="",o=0;o<e;o++)t+=n;return t}var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(n){var e=n.getParam("nonbreaking_force_tab",0);return"boolean"==typeof e?!0===e?3:0:e},a=function(n){return n.getParam("nonbreaking_wrap",!0,"boolean")},r=function(n,e){var t=a(n)||n.plugins.visualchars?'<span class="'+(function(n){return!!n.plugins.visualchars&&n.plugins.visualchars.isEnabled()}(n)?"mce-nbsp-wrap mce-nbsp":"mce-nbsp-wrap")+'" contenteditable="false">'+o(" ",e)+"</span>":o(" ",e);n.undoManager.transact(function(){return n.insertContent(t)})},e=function(n){n.addCommand("mceNonBreaking",function(){r(n,1)})},c=tinymce.util.Tools.resolve("tinymce.util.VK"),t=function(e){var t=i(e);0<t&&e.on("keydown",function(n){if(n.keyCode===c.TAB&&!n.isDefaultPrevented()){if(n.shiftKey)return;n.preventDefault(),n.stopImmediatePropagation(),r(e,t)}})},u=function(n){n.ui.registry.addButton("nonbreaking",{icon:"non-breaking",tooltip:"Nonbreaking space",onAction:function(){return n.execCommand("mceNonBreaking")}}),n.ui.registry.addMenuItem("nonbreaking",{icon:"non-breaking",text:"Nonbreaking space",onAction:function(){return n.execCommand("mceNonBreaking")}})};!function s(){n.add("nonbreaking",function(n){e(n),u(n),t(n)})}()}();
|
||||
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
+1
-1
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
!function(){"use strict";function c(n){return function(t){return-1!==(" "+t.attr("class")+" ").indexOf(n)}}function l(i,o,c){return function(t){var n=arguments,e=n[n.length-2],r=0<e?o.charAt(e-1):"";if('"'===r)return t;if(">"===r){var a=o.lastIndexOf("<",e);if(-1!==a)if(-1!==o.substring(a,e).indexOf('contenteditable="false"'))return t}return'<span class="'+c+'" data-mce-content="'+i.dom.encode(n[0])+'">'+i.dom.encode("string"==typeof n[1]?n[1]:n[0])+"</span>"}}var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=tinymce.util.Tools.resolve("tinymce.util.Tools"),f=function(t){return t.getParam("noneditable_noneditable_class","mceNonEditable")},s=function(t){return t.getParam("noneditable_editable_class","mceEditable")},d=function(t){var n=t.getParam("noneditable_regexp",[]);return n&&n.constructor===RegExp?[n]:n},n=function(n){var t,e,r="contenteditable";t=" "+u.trim(s(n))+" ",e=" "+u.trim(f(n))+" ";var a=c(t),i=c(e),o=d(n);n.on("PreInit",function(){0<o.length&&n.on("BeforeSetContent",function(t){!function(t,n,e){var r=n.length,a=e.content;if("raw"!==e.format){for(;r--;)a=a.replace(n[r],l(t,a,f(t)));e.content=a}}(n,o,t)}),n.parser.addAttributeFilter("class",function(t){for(var n,e=t.length;e--;)n=t[e],a(n)?n.attr(r,"true"):i(n)&&n.attr(r,"false")}),n.serializer.addAttributeFilter(r,function(t){for(var n,e=t.length;e--;)n=t[e],(a(n)||i(n))&&(0<o.length&&n.attr("data-mce-content")?(n.name="#text",n.type=3,n.raw=!0,n.value=n.attr("data-mce-content")):n.attr(r,null))})})};!function e(){t.add("noneditable",function(t){n(t)})}()}();
|
||||
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
+1
-1
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
!function(){"use strict";function e(){return"mce-pagebreak"}function a(){return'<img src="'+t.transparentSrc+'" class="mce-pagebreak" data-mce-resize="false" data-mce-placeholder />'}var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env"),r=function(e){return e.getParam("pagebreak_separator","\x3c!-- pagebreak --\x3e")},i=function(e){return e.getParam("pagebreak_split_block",!1)},o=function(o){var c=r(o),n=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(e){return"\\"+e}),"gi");o.on("BeforeSetContent",function(e){e.content=e.content.replace(n,a())}),o.on("PreInit",function(){o.serializer.addNodeFilter("img",function(e){for(var n,a,t=e.length;t--;)if((a=(n=e[t]).attr("class"))&&-1!==a.indexOf("mce-pagebreak")){var r=n.parent;if(o.schema.getBlockElements()[r.name]&&i(o)){r.type=3,r.value=c,r.raw=!0,n.remove();continue}n.type=3,n.value=c,n.raw=!0}})})},c=a,u=e,g=function(e){e.addCommand("mcePageBreak",function(){e.settings.pagebreak_split_block?e.insertContent("<p>"+c()+"</p>"):e.insertContent(c())})},m=function(n){n.on("ResolveName",function(e){"IMG"===e.target.nodeName&&n.dom.hasClass(e.target,u())&&(e.name="pagebreak")})},s=function(e){e.ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:function(){return e.execCommand("mcePageBreak")}}),e.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:function(){return e.execCommand("mcePageBreak")}})};!function l(){n.add("pagebreak",function(e){g(e),s(e),o(e),m(e)})}()}();
|
||||
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function (domGlobals) {
|
||||
'use strict';
|
||||
@@ -1087,6 +1087,8 @@
|
||||
shouldUseDefaultFilters: shouldUseDefaultFilters
|
||||
};
|
||||
|
||||
var nbsp = '\xA0';
|
||||
|
||||
function filter$1(content, items) {
|
||||
global$4.each(items, function (v) {
|
||||
if (v.constructor === RegExp) {
|
||||
@@ -1146,7 +1148,7 @@
|
||||
if (!s1 && !s2) {
|
||||
return ' ';
|
||||
}
|
||||
return '\xA0';
|
||||
return nbsp;
|
||||
}
|
||||
html = filter$1(html, [
|
||||
/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/ig,
|
||||
@@ -1399,12 +1401,12 @@
|
||||
],
|
||||
[
|
||||
/ /gi,
|
||||
'\xA0'
|
||||
nbsp
|
||||
],
|
||||
[
|
||||
/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,
|
||||
function (str, spaces) {
|
||||
return spaces.length > 0 ? spaces.replace(/./, ' ').slice(Math.floor(spaces.length / 2)).split('').join('\xA0') : '';
|
||||
return spaces.length > 0 ? spaces.replace(/./, ' ').slice(Math.floor(spaces.length / 2)).split('').join(nbsp) : '';
|
||||
}
|
||||
]
|
||||
]);
|
||||
@@ -1604,11 +1606,11 @@
|
||||
};
|
||||
var normalizeWhitespace = function (text) {
|
||||
var result = foldl(text, function (acc, c) {
|
||||
if (isCollapsibleWhitespace(c) || c === '\xA0') {
|
||||
if (isCollapsibleWhitespace(c) || c === nbsp) {
|
||||
if (acc.pcIsSpace || acc.str === '' || acc.str.length === text.length - 1 || isNewline(text, acc.str.length + 1)) {
|
||||
return {
|
||||
pcIsSpace: false,
|
||||
str: acc.str + '\xA0'
|
||||
str: acc.str + nbsp
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
+1
-1
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=tinymce.util.Tools.resolve("tinymce.util.Tools"),m=function(e){return e.getParam("content_style","")},u=function(e){return e.getParam("content_css_cors",!1,"boolean")},y=tinymce.util.Tools.resolve("tinymce.Env"),n=function(t){var n="",i=t.dom.encode,e=m(t);n+='<base href="'+i(t.documentBaseURI.getURI())+'">',e&&(n+='<style type="text/css">'+e+"</style>");var o=u(t)?' crossorigin="anonymous"':"";l.each(t.contentCSS,function(e){n+='<link type="text/css" rel="stylesheet" href="'+i(t.documentBaseURI.toAbsolute(e))+'"'+o+">"});var r=t.settings.body_id||"tinymce";-1!==r.indexOf("=")&&(r=(r=t.getParam("body_id","","hash"))[t.id]||r);var a=t.settings.body_class||"";-1!==a.indexOf("=")&&(a=(a=t.getParam("body_class","","hash"))[t.id]||"");var c='<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A" && !('+(y.mac?"e.metaKey":"e.ctrlKey && !e.altKey")+")) {e.preventDefault();}}}, false);<\/script> ",s=t.getBody().dir,d=s?' dir="'+i(s)+'"':"";return"<!DOCTYPE html><html><head>"+n+'</head><body id="'+i(r)+'" class="mce-content-body '+i(a)+'"'+d+">"+t.getContent()+c+"</body></html>"},t=function(e){e.addCommand("mcePreview",function(){!function(e){var t=n(e);e.windowManager.open({title:"Preview",size:"large",body:{type:"panel",items:[{name:"preview",type:"iframe",sandboxed:!0}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{preview:t}}).focus("close")}(e)})},i=function(e){e.ui.registry.addButton("preview",{icon:"preview",tooltip:"Preview",onAction:function(){return e.execCommand("mcePreview")}}),e.ui.registry.addMenuItem("preview",{icon:"preview",text:"Preview",onAction:function(){return e.execCommand("mcePreview")}})};!function o(){e.add("preview",function(e){t(e),i(e)})}()}();
|
||||
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
+1
-1
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env"),i=function(n){n.addCommand("mcePrint",function(){t.browser.isIE()?n.getDoc().execCommand("print",!1,null):n.getWin().print()})},e=function(n){n.ui.registry.addButton("print",{icon:"print",tooltip:"Print",onAction:function(){return n.execCommand("mcePrint")}}),n.ui.registry.addMenuItem("print",{text:"Print...",icon:"print",onAction:function(){return n.execCommand("mcePrint")}})};!function o(){n.add("print",function(n){i(n),e(n),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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function (domGlobals) {
|
||||
'use strict';
|
||||
@@ -806,9 +806,13 @@
|
||||
var getInsertToolbarItems = function (editor) {
|
||||
return EditorSettings.getToolbarItemsOr(editor, 'quickbars_insert_toolbar', 'quickimage quicktable');
|
||||
};
|
||||
var getImageToolbarItems = function (editor) {
|
||||
return EditorSettings.getToolbarItemsOr(editor, 'quickbars_image_toolbar', 'alignleft aligncenter alignright');
|
||||
};
|
||||
var Settings = {
|
||||
getTextSelectionToolbarItems: getTextSelectionToolbarItems,
|
||||
getInsertToolbarItems: getInsertToolbarItems
|
||||
getInsertToolbarItems: getInsertToolbarItems,
|
||||
getImageToolbarItems: getImageToolbarItems
|
||||
};
|
||||
|
||||
var addToEditor = function (editor) {
|
||||
@@ -838,21 +842,29 @@
|
||||
var InsertToolbars = { addToEditor: addToEditor };
|
||||
|
||||
var addToEditor$1 = function (editor) {
|
||||
editor.ui.registry.addContextToolbar('imageselection', {
|
||||
predicate: function (node) {
|
||||
return node.nodeName === 'IMG' || node.nodeName === 'FIGURE' && /image/i.test(node.className);
|
||||
},
|
||||
items: 'alignleft aligncenter alignright',
|
||||
position: 'node'
|
||||
});
|
||||
var isEditable = function (node) {
|
||||
return editor.dom.getContentEditableParent(node) !== 'false';
|
||||
};
|
||||
var isImage = function (node) {
|
||||
return node.nodeName === 'IMG' || node.nodeName === 'FIGURE' && /image/i.test(node.className);
|
||||
};
|
||||
var imageToolbarItems = Settings.getImageToolbarItems(editor);
|
||||
if (imageToolbarItems.trim().length > 0) {
|
||||
editor.ui.registry.addContextToolbar('imageselection', {
|
||||
predicate: isImage,
|
||||
items: imageToolbarItems,
|
||||
position: 'node'
|
||||
});
|
||||
}
|
||||
var textToolbarItems = Settings.getTextSelectionToolbarItems(editor);
|
||||
if (textToolbarItems.trim().length > 0) {
|
||||
editor.ui.registry.addContextToolbar('textselection', {
|
||||
predicate: function (node) {
|
||||
return !editor.selection.isCollapsed();
|
||||
return !isImage(node) && !editor.selection.isCollapsed() && isEditable(node);
|
||||
},
|
||||
items: textToolbarItems,
|
||||
position: 'selection'
|
||||
position: 'selection',
|
||||
scope: 'editor'
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
+1
-1
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
!function(){"use strict";function t(n,e){n.notificationManager.open({text:e,type:"error"})}function e(t){return function(n){function e(){n.setDisabled(a(t)&&!t.isDirty())}return t.on("NodeChange dirty",e),function(){return t.off("NodeChange dirty",e)}}}var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=function(n){return n.getParam("save_enablewhendirty",!0)},c=function(n){return!!n.getParam("save_onsavecallback")},r=function(n){return!!n.getParam("save_oncancelcallback")},u=function(n){var e;if(e=o.DOM.getParent(n.id,"form"),!a(n)||n.isDirty()){if(n.save(),c(n))return n.execCallback("save_onsavecallback",n),void n.nodeChanged();e?(n.setDirty(!1),e.onsubmit&&!e.onsubmit()||("function"==typeof e.submit?e.submit():t(n,"Error: Form submit field collision.")),n.nodeChanged()):t(n,"Error: No form element found.")}},l=function(n){var e=i.trim(n.startContent);r(n)?n.execCallback("save_oncancelcallback",n):n.resetContent(e)},s=function(n){n.addCommand("mceSave",function(){u(n)}),n.addCommand("mceCancel",function(){l(n)})},d=function(n){n.ui.registry.addButton("save",{icon:"save",tooltip:"Save",disabled:!0,onAction:function(){return n.execCommand("mceSave")},onSetup:e(n)}),n.ui.registry.addButton("cancel",{icon:"cancel",tooltip:"Cancel",disabled:!0,onAction:function(){return n.execCommand("mceCancel")},onSetup:e(n)}),n.addShortcut("Meta+S","","mceSave")};!function m(){n.add("save",function(n){d(n),s(n)})}()}();
|
||||
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
@@ -807,8 +807,6 @@
|
||||
updateSearchState(api);
|
||||
reset(api);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
focusButtonIfRequired(api, details.name);
|
||||
},
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function (domGlobals) {
|
||||
'use strict';
|
||||
@@ -251,8 +251,10 @@
|
||||
}
|
||||
function unwrapElement(element) {
|
||||
var parentNode = element.parentNode;
|
||||
parentNode.insertBefore(element.firstChild, element);
|
||||
element.parentNode.removeChild(element);
|
||||
while (element.childNodes.length > 0) {
|
||||
parentNode.insertBefore(element.childNodes[0], element);
|
||||
}
|
||||
parentNode.removeChild(element);
|
||||
}
|
||||
function hasClass(elm) {
|
||||
return elm.className.indexOf('mce-spellchecker-word') !== -1;
|
||||
@@ -374,6 +376,74 @@
|
||||
};
|
||||
};
|
||||
|
||||
var noop = function () {
|
||||
};
|
||||
var constant = function (value) {
|
||||
return function () {
|
||||
return value;
|
||||
};
|
||||
};
|
||||
var never = constant(false);
|
||||
var always = constant(true);
|
||||
|
||||
var none = function () {
|
||||
return NONE;
|
||||
};
|
||||
var NONE = function () {
|
||||
var eq = function (o) {
|
||||
return o.isNone();
|
||||
};
|
||||
var call = function (thunk) {
|
||||
return thunk();
|
||||
};
|
||||
var id = function (n) {
|
||||
return n;
|
||||
};
|
||||
var me = {
|
||||
fold: function (n, s) {
|
||||
return n();
|
||||
},
|
||||
is: never,
|
||||
isSome: never,
|
||||
isNone: always,
|
||||
getOr: id,
|
||||
getOrThunk: call,
|
||||
getOrDie: function (msg) {
|
||||
throw new Error(msg || 'error: getOrDie called on none.');
|
||||
},
|
||||
getOrNull: constant(null),
|
||||
getOrUndefined: constant(undefined),
|
||||
or: id,
|
||||
orThunk: call,
|
||||
map: none,
|
||||
each: noop,
|
||||
bind: none,
|
||||
exists: never,
|
||||
forall: always,
|
||||
filter: none,
|
||||
equals: eq,
|
||||
equals_: eq,
|
||||
toArray: function () {
|
||||
return [];
|
||||
},
|
||||
toString: constant('none()')
|
||||
};
|
||||
if (Object.freeze) {
|
||||
Object.freeze(me);
|
||||
}
|
||||
return me;
|
||||
}();
|
||||
|
||||
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);
|
||||
@@ -381,12 +451,6 @@
|
||||
}
|
||||
return textMatcherState.get();
|
||||
};
|
||||
var isEmpty = function (obj) {
|
||||
for (var _ in obj) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
var defaultSpellcheckCallback = function (editor, pluginUrl, currentLanguageState) {
|
||||
return function (method, text, doneCallback, errorCallback) {
|
||||
var data = {
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function (domGlobals) {
|
||||
'use strict';
|
||||
|
||||
+1
-1
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
!function(c){"use strict";function t(e){e.keyCode!==d.TAB||e.ctrlKey||e.altKey||e.metaKey||e.preventDefault()}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),s=tinymce.util.Tools.resolve("tinymce.EditorManager"),a=tinymce.util.Tools.resolve("tinymce.Env"),y=tinymce.util.Tools.resolve("tinymce.util.Delay"),f=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=tinymce.util.Tools.resolve("tinymce.util.VK"),m=function(e){return e.getParam("tab_focus",function(e){return e.getParam("tabfocus_elements",":prev,:next")}(e))},v=n.DOM,i=function(r){function e(n){var i,o,e,l;if(!(n.keyCode!==d.TAB||n.ctrlKey||n.altKey||n.metaKey||n.isDefaultPrevented())&&(1===(e=f.explode(m(r))).length&&(e[1]=e[0],e[0]=":prev"),o=n.shiftKey?":prev"===e[0]?u(-1):v.get(e[0]):":next"===e[1]?u(1):v.get(e[1]))){var t=s.get(o.id||o.name);o.id&&t?t.focus():y.setTimeout(function(){a.webkit||c.window.focus(),o.focus()},10),n.preventDefault()}function u(e){function t(e){return/INPUT|TEXTAREA|BUTTON/.test(e.tagName)&&s.get(n.id)&&-1!==e.tabIndex&&function t(e){return"BODY"===e.nodeName||"hidden"!==e.type&&"none"!==e.style.display&&"hidden"!==e.style.visibility&&t(e.parentNode)}(e)}if(o=v.select(":input:enabled,*[tabindex]:not(iframe)"),f.each(o,function(e,t){if(e.id===r.id)return i=t,!1}),0<e){for(l=i+1;l<o.length;l++)if(t(o[l]))return o[l]}else for(l=i-1;0<=l;l--)if(t(o[l]))return o[l];return null}}r.on("init",function(){r.inline&&v.setAttrib(r.getBody(),"tabIndex",null),r.on("keyup",t),a.gecko?r.on("keypress keydown",e):r.on("keydown",e)})};!function o(){e.add("tabfocus",function(e){i(e)})}()}(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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function (domGlobals) {
|
||||
'use strict';
|
||||
@@ -302,8 +302,7 @@
|
||||
return r;
|
||||
};
|
||||
var bind = function (xs, f) {
|
||||
var output = map(xs, f);
|
||||
return flatten(output);
|
||||
return flatten(map(xs, f));
|
||||
};
|
||||
var forall = function (xs, pred) {
|
||||
for (var i = 0, len = xs.length; i < len; ++i) {
|
||||
@@ -325,6 +324,15 @@
|
||||
var from$1 = isFunction(Array.from) ? Array.from : function (x) {
|
||||
return nativeSlice.call(x);
|
||||
};
|
||||
var findMap = function (arr, f) {
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
var r = f(arr[i], i);
|
||||
if (r.isSome()) {
|
||||
return r;
|
||||
}
|
||||
}
|
||||
return Option.none();
|
||||
};
|
||||
|
||||
var keys = Object.keys;
|
||||
var hasOwnProperty = Object.hasOwnProperty;
|
||||
@@ -1553,6 +1561,8 @@
|
||||
};
|
||||
var CopySelected = { extract: extract };
|
||||
|
||||
var nbsp = '\xA0';
|
||||
|
||||
function NodeValue (is, name) {
|
||||
var get = function (element) {
|
||||
if (!is(element)) {
|
||||
@@ -1594,10 +1604,9 @@
|
||||
return v.length;
|
||||
});
|
||||
};
|
||||
var NBSP = '\xA0';
|
||||
var isTextNodeWithCursorPosition = function (el) {
|
||||
return getOption(el).filter(function (text) {
|
||||
return text.trim().length !== 0 || text.indexOf(NBSP) > -1;
|
||||
return text.trim().length !== 0 || text.indexOf(nbsp) > -1;
|
||||
}).isSome();
|
||||
};
|
||||
var elementsWithCursorPosition = [
|
||||
@@ -1927,6 +1936,9 @@
|
||||
'input'
|
||||
], name(element));
|
||||
};
|
||||
var isNonEditable = function (element) {
|
||||
return isElement(element) && get$1(element, 'contenteditable') === 'false';
|
||||
};
|
||||
var comparePosition = function (element, other) {
|
||||
return element.dom().compareDocumentPosition(other.dom());
|
||||
};
|
||||
@@ -1991,7 +2003,8 @@
|
||||
getText: get$3,
|
||||
setText: set$2,
|
||||
isBoundary: isBoundary,
|
||||
isEmptyTag: isEmptyTag
|
||||
isEmptyTag: isEmptyTag,
|
||||
isNonEditable: isNonEditable
|
||||
}),
|
||||
eq: eq,
|
||||
is: is$1
|
||||
@@ -2932,15 +2945,6 @@
|
||||
}
|
||||
return r;
|
||||
};
|
||||
var findMap = function (arr, f) {
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
var r = f(arr[i], i);
|
||||
if (r.isSome()) {
|
||||
return r;
|
||||
}
|
||||
}
|
||||
return Option.none();
|
||||
};
|
||||
|
||||
var setIfNot = function (element, property, value, ignore) {
|
||||
if (value === ignore) {
|
||||
@@ -5840,33 +5844,6 @@
|
||||
};
|
||||
var RowDialog = { open: open$1 };
|
||||
|
||||
var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
||||
var shallow$1 = function (old, nu) {
|
||||
return nu;
|
||||
};
|
||||
var baseMerge = function (merger) {
|
||||
return function () {
|
||||
var objects = new Array(arguments.length);
|
||||
for (var i = 0; i < objects.length; i++) {
|
||||
objects[i] = arguments[i];
|
||||
}
|
||||
if (objects.length === 0) {
|
||||
throw new Error('Can\'t merge zero objects');
|
||||
}
|
||||
var ret = {};
|
||||
for (var j = 0; j < objects.length; j++) {
|
||||
var curObject = objects[j];
|
||||
for (var key in curObject) {
|
||||
if (hasOwnProperty$1.call(curObject, key)) {
|
||||
ret[key] = merger(ret[key], curObject[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
};
|
||||
var merge$3 = baseMerge(shallow$1);
|
||||
|
||||
var global$2 = tinymce.util.Tools.resolve('tinymce.Env');
|
||||
|
||||
var DefaultRenderOptions = {
|
||||
@@ -6122,8 +6099,8 @@
|
||||
styles['border-color'] = data.bordercolor;
|
||||
styles['border-style'] = data.borderstyle;
|
||||
}
|
||||
attrs.style = dom.serializeStyle(merge$3(getDefaultStyles(editor), styles));
|
||||
dom.setAttribs(tableElm, merge$3(getDefaultAttributes(editor), attrs));
|
||||
attrs.style = dom.serializeStyle(__assign(__assign({}, getDefaultStyles(editor)), styles));
|
||||
dom.setAttribs(tableElm, __assign(__assign({}, getDefaultAttributes(editor)), attrs));
|
||||
};
|
||||
var onSubmitTableForm = function (editor, tableElm, api) {
|
||||
var dom = editor.dom;
|
||||
@@ -6146,7 +6123,7 @@
|
||||
}
|
||||
if (!captionElm && data.caption) {
|
||||
captionElm = dom.create('caption');
|
||||
captionElm.innerHTML = !global$2.ie ? '<br data-mce-bogus="1"/>' : '\xA0';
|
||||
captionElm.innerHTML = !global$2.ie ? '<br data-mce-bogus="1"/>' : nbsp;
|
||||
tableElm.insertBefore(captionElm, tableElm.firstChild);
|
||||
}
|
||||
if (data.align === '') {
|
||||
@@ -6516,7 +6493,7 @@
|
||||
var Styles$2 = { resolve: styles$1.resolve };
|
||||
|
||||
var Blocker = function (options) {
|
||||
var settings = merge$3({ layerClass: Styles$2.resolve('blocker') }, options);
|
||||
var settings = __assign({ layerClass: Styles$2.resolve('blocker') }, options);
|
||||
var div = Element.fromTag('div');
|
||||
set(div, 'role', 'presentation');
|
||||
setAll$1(div, {
|
||||
@@ -7393,6 +7370,8 @@
|
||||
}
|
||||
});
|
||||
};
|
||||
var ltr$2 = adt$4.ltr;
|
||||
var rtl$2 = adt$4.rtl;
|
||||
|
||||
var searchForPoint = function (rectForOffset, x, y, maxX, length) {
|
||||
if (length === 0) {
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
@@ -439,6 +439,11 @@
|
||||
return t.text === templateTitle;
|
||||
});
|
||||
};
|
||||
var loadFailedAlert = function (api) {
|
||||
editor.windowManager.alert('Could not load the specified template.', function () {
|
||||
return api.focus('template');
|
||||
});
|
||||
};
|
||||
var getTemplateContent = function (t) {
|
||||
return new global$3(function (resolve, reject) {
|
||||
t.value.url.fold(function () {
|
||||
@@ -464,7 +469,10 @@
|
||||
api.block('Loading...');
|
||||
getTemplateContent(t).then(function (previewHtml) {
|
||||
updateDialog(api, t, previewHtml);
|
||||
api.unblock();
|
||||
}).catch(function () {
|
||||
updateDialog(api, t, '');
|
||||
api.disable('save');
|
||||
loadFailedAlert(api);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -477,6 +485,9 @@
|
||||
getTemplateContent(t).then(function (previewHtml) {
|
||||
Templates.insertTemplate(editor, false, previewHtml);
|
||||
api.close();
|
||||
}).catch(function () {
|
||||
api.disable('save');
|
||||
loadFailedAlert(api);
|
||||
});
|
||||
});
|
||||
};
|
||||
@@ -544,6 +555,10 @@
|
||||
dialogApi.block('Loading...');
|
||||
getTemplateContent(templates[0]).then(function (previewHtml) {
|
||||
updateDialog(dialogApi, templates[0], previewHtml);
|
||||
}).catch(function () {
|
||||
updateDialog(dialogApi, templates[0], '');
|
||||
dialogApi.disable('save');
|
||||
loadFailedAlert(dialogApi);
|
||||
});
|
||||
};
|
||||
var optTemplates = createTemplates();
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function (domGlobals) {
|
||||
'use strict';
|
||||
|
||||
+1
-1
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
!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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function (domGlobals) {
|
||||
'use strict';
|
||||
@@ -776,22 +776,30 @@
|
||||
|
||||
var global$2 = tinymce.util.Tools.resolve('tinymce.util.VK');
|
||||
|
||||
var zeroWidth = function () {
|
||||
return '\uFEFF';
|
||||
};
|
||||
var zeroWidth = '\uFEFF';
|
||||
var nbsp = '\xA0';
|
||||
|
||||
var global$3 = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
||||
|
||||
var global$4 = tinymce.util.Tools.resolve('tinymce.dom.TreeWalker');
|
||||
var global$4 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
|
||||
|
||||
var global$5 = tinymce.util.Tools.resolve('tinymce.dom.TextSeeker');
|
||||
|
||||
var point = function (container, offset) {
|
||||
return {
|
||||
container: container,
|
||||
offset: offset
|
||||
};
|
||||
};
|
||||
|
||||
var isText = function (node) {
|
||||
return node.nodeType === domGlobals.Node.TEXT_NODE;
|
||||
};
|
||||
var cleanEmptyNodes = function (dom, node, isRoot) {
|
||||
if (node && dom.isEmpty(node) && !isRoot(node)) {
|
||||
var parent = node.parentNode;
|
||||
var parent_1 = node.parentNode;
|
||||
dom.remove(node);
|
||||
cleanEmptyNodes(dom, parent, isRoot);
|
||||
cleanEmptyNodes(dom, parent_1, isRoot);
|
||||
}
|
||||
};
|
||||
var deleteRng = function (dom, rng, isRoot, clean) {
|
||||
@@ -834,42 +842,39 @@
|
||||
}
|
||||
};
|
||||
|
||||
var point = function (element, offset) {
|
||||
return {
|
||||
element: element,
|
||||
offset: offset
|
||||
var DOM = global$4.DOM;
|
||||
var alwaysNext = function (startNode) {
|
||||
return function (node) {
|
||||
return startNode === node ? -1 : 0;
|
||||
};
|
||||
};
|
||||
|
||||
var TextWalker = function (startNode, rootNode) {
|
||||
var walker = new global$4(startNode, rootNode);
|
||||
var walk = function (direction) {
|
||||
var next = walker[direction]();
|
||||
while (next && next.nodeType !== domGlobals.Node.TEXT_NODE) {
|
||||
next = walker[direction]();
|
||||
}
|
||||
return next && next.nodeType === domGlobals.Node.TEXT_NODE ? Option.some(next) : Option.none();
|
||||
};
|
||||
return {
|
||||
next: function () {
|
||||
return walk('next');
|
||||
},
|
||||
prev: function () {
|
||||
return walk('prev');
|
||||
},
|
||||
prev2: function () {
|
||||
return walk('prev2');
|
||||
}
|
||||
var isBoundary = function (dom) {
|
||||
return function (node) {
|
||||
return dom.isBlock(node) || contains([
|
||||
'BR',
|
||||
'IMG',
|
||||
'HR',
|
||||
'INPUT'
|
||||
], node.nodeName) || dom.getContentEditable(node) === 'false';
|
||||
};
|
||||
};
|
||||
|
||||
var textBefore = function (node, offset, rootNode) {
|
||||
if (isText(node) && offset >= 0) {
|
||||
return Option.some(point(node, offset));
|
||||
} else {
|
||||
var textWalker = TextWalker(node, rootNode);
|
||||
return textWalker.prev().map(function (prev) {
|
||||
return point(prev, prev.data.length);
|
||||
var textSeeker = global$5(DOM);
|
||||
return Option.from(textSeeker.backwards(node, offset, alwaysNext(node), rootNode)).map(function (prev) {
|
||||
return point(prev.container, prev.container.data.length);
|
||||
});
|
||||
}
|
||||
};
|
||||
var textAfter = function (node, offset, rootNode) {
|
||||
if (isText(node) && offset >= node.length) {
|
||||
return Option.some(point(node, offset));
|
||||
} else {
|
||||
var textSeeker = global$5(DOM);
|
||||
return Option.from(textSeeker.forwards(node, offset, alwaysNext(node), rootNode)).map(function (prev) {
|
||||
return point(prev.container, 0);
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -881,10 +886,10 @@
|
||||
if (offset >= 0 && offset <= text.length) {
|
||||
return Option.some(point(node, offset));
|
||||
} else {
|
||||
var textWalker = TextWalker(node, rootNode);
|
||||
return textWalker.prev().bind(function (prev) {
|
||||
var prevText = prev.textContent;
|
||||
return scanLeft(prev, offset + prevText.length, rootNode);
|
||||
var textSeeker = global$5(DOM);
|
||||
return Option.from(textSeeker.backwards(node, offset, alwaysNext(node), rootNode)).bind(function (prev) {
|
||||
var prevText = prev.container.data;
|
||||
return scanLeft(prev.container, offset + prevText.length, rootNode);
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -896,56 +901,15 @@
|
||||
if (offset <= text.length) {
|
||||
return Option.some(point(node, offset));
|
||||
} else {
|
||||
var textWalker = TextWalker(node, rootNode);
|
||||
return textWalker.next().bind(function (next) {
|
||||
return scanRight(next, offset - text.length, rootNode);
|
||||
var textSeeker = global$5(DOM);
|
||||
return Option.from(textSeeker.forwards(node, offset, alwaysNext(node), rootNode)).bind(function (next) {
|
||||
return scanRight(next.container, offset - text.length, rootNode);
|
||||
});
|
||||
}
|
||||
};
|
||||
var isBoundary = function (dom, node) {
|
||||
return dom.isBlock(node) || contains([
|
||||
'BR',
|
||||
'IMG',
|
||||
'HR',
|
||||
'INPUT'
|
||||
], node.nodeName) || dom.getContentEditable(node) === 'false';
|
||||
};
|
||||
var outcome = Adt.generate([
|
||||
{ aborted: [] },
|
||||
{ edge: ['element'] },
|
||||
{ success: ['info'] }
|
||||
]);
|
||||
var phase = Adt.generate([
|
||||
{ abort: [] },
|
||||
{ kontinue: [] },
|
||||
{ finish: ['info'] }
|
||||
]);
|
||||
var repeat = function (dom, node, offset, process, walker, recent) {
|
||||
var terminate = function () {
|
||||
return recent.fold(outcome.aborted, outcome.edge);
|
||||
};
|
||||
var recurse = function () {
|
||||
var next = walker();
|
||||
if (next) {
|
||||
return repeat(dom, next, Option.none(), process, walker, Option.some(node));
|
||||
} else {
|
||||
return terminate();
|
||||
}
|
||||
};
|
||||
if (isBoundary(dom, node)) {
|
||||
return terminate();
|
||||
} else if (!isText(node)) {
|
||||
return recurse();
|
||||
} else {
|
||||
var text = node.textContent;
|
||||
return process(phase, node, text, offset).fold(outcome.aborted, function () {
|
||||
return recurse();
|
||||
}, outcome.success);
|
||||
}
|
||||
};
|
||||
var repeatLeft = function (dom, node, offset, process, rootNode) {
|
||||
var walker = new global$4(node, rootNode);
|
||||
return repeat(dom, node, Option.some(offset), process, walker.prev, Option.none());
|
||||
var search = global$5(dom, isBoundary(dom));
|
||||
return Option.from(search.backwards(node, offset, process, rootNode));
|
||||
};
|
||||
|
||||
var generatePath = function (root, node, offset) {
|
||||
@@ -955,14 +919,14 @@
|
||||
var p = [offset];
|
||||
var current = node;
|
||||
while (current !== root && current.parentNode) {
|
||||
var parent = current.parentNode;
|
||||
for (var i = 0; i < parent.childNodes.length; i++) {
|
||||
if (parent.childNodes[i] === current) {
|
||||
var parent_1 = current.parentNode;
|
||||
for (var i = 0; i < parent_1.childNodes.length; i++) {
|
||||
if (parent_1.childNodes[i] === current) {
|
||||
p.push(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
current = parent;
|
||||
current = parent_1;
|
||||
}
|
||||
return current === root ? p.reverse() : [];
|
||||
};
|
||||
@@ -1012,12 +976,13 @@
|
||||
};
|
||||
|
||||
var stripPattern = function (dom, block, pattern) {
|
||||
var firstTextNode = TextWalker(block, block).next();
|
||||
firstTextNode.each(function (node) {
|
||||
var firstTextNode = textAfter(block, 0, block);
|
||||
firstTextNode.each(function (spot) {
|
||||
var node = spot.container;
|
||||
scanRight(node, pattern.start.length, block).each(function (end) {
|
||||
var rng = dom.createRng();
|
||||
rng.setStart(node, 0);
|
||||
rng.setEnd(end.element, end.offset);
|
||||
rng.setEnd(end.container, end.offset);
|
||||
deleteRng(dom, rng, function (e) {
|
||||
return e === block;
|
||||
});
|
||||
@@ -1046,7 +1011,7 @@
|
||||
return true;
|
||||
};
|
||||
var findPattern = function (patterns, text) {
|
||||
var nuText = text.replace('\xA0', ' ');
|
||||
var nuText = text.replace(nbsp, ' ');
|
||||
return find(patterns, function (pattern) {
|
||||
if (text.indexOf(pattern.start) !== 0 && nuText.indexOf(pattern.start) !== 0) {
|
||||
return false;
|
||||
@@ -1138,37 +1103,45 @@
|
||||
cleanEmptyNodes(dom, dom.get(marker.prefix + '-start'), isRoot);
|
||||
};
|
||||
|
||||
var nodeMatchesPattern = function (dom, block, content) {
|
||||
return function (phase, element, text, optOffset) {
|
||||
if (element === block) {
|
||||
return phase.abort();
|
||||
}
|
||||
var searchText = text.substring(0, optOffset.getOr(text.length));
|
||||
var startEndIndex = searchText.lastIndexOf(content.charAt(content.length - 1));
|
||||
var startIndex = searchText.lastIndexOf(content);
|
||||
var matchesPattern = function (dom, block, patternContent) {
|
||||
return function (element, offset) {
|
||||
var text = element.data;
|
||||
var searchText = text.substring(0, offset);
|
||||
var startEndIndex = searchText.lastIndexOf(patternContent.charAt(patternContent.length - 1));
|
||||
var startIndex = searchText.lastIndexOf(patternContent);
|
||||
if (startIndex !== -1) {
|
||||
var rng = dom.createRng();
|
||||
rng.setStart(element, startIndex);
|
||||
rng.setEnd(element, startIndex + content.length);
|
||||
return phase.finish(rng);
|
||||
return startIndex + patternContent.length;
|
||||
} else if (startEndIndex !== -1) {
|
||||
return scanLeft(element, startEndIndex + 1 - content.length, block).fold(function () {
|
||||
return phase.kontinue();
|
||||
}, function (spot) {
|
||||
var rng = dom.createRng();
|
||||
rng.setStart(spot.element, spot.offset);
|
||||
rng.setEnd(element, startEndIndex + 1);
|
||||
if (rng.toString() === content) {
|
||||
return phase.finish(rng);
|
||||
} else {
|
||||
return phase.kontinue();
|
||||
}
|
||||
});
|
||||
return startEndIndex + 1;
|
||||
} else {
|
||||
return phase.kontinue();
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
};
|
||||
var findPatternStartFromSpot = function (dom, pattern, block, spot) {
|
||||
var startPattern = pattern.start;
|
||||
var startSpot = repeatLeft(dom, spot.container, spot.offset, matchesPattern(dom, block, startPattern), block);
|
||||
return startSpot.bind(function (spot) {
|
||||
if (spot.offset >= startPattern.length) {
|
||||
var rng = dom.createRng();
|
||||
rng.setStart(spot.container, spot.offset - startPattern.length);
|
||||
rng.setEnd(spot.container, spot.offset);
|
||||
return Option.some(rng);
|
||||
} else {
|
||||
var offset = spot.offset - startPattern.length;
|
||||
return scanLeft(spot.container, offset, block).map(function (nextSpot) {
|
||||
var rng = dom.createRng();
|
||||
rng.setStart(nextSpot.container, nextSpot.offset);
|
||||
rng.setEnd(spot.container, spot.offset);
|
||||
return rng;
|
||||
}).filter(function (rng) {
|
||||
return rng.toString() === startPattern;
|
||||
}).orThunk(function () {
|
||||
return findPatternStartFromSpot(dom, pattern, block, point(spot.container, 0));
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
var findPatternStart = function (dom, pattern, node, offset, block, requireGap) {
|
||||
if (requireGap === void 0) {
|
||||
requireGap = false;
|
||||
@@ -1180,11 +1153,10 @@
|
||||
return Option.some(rng);
|
||||
}
|
||||
return textBefore(node, offset, block).bind(function (spot) {
|
||||
var outcome = repeatLeft(dom, spot.element, spot.offset, nodeMatchesPattern(dom, block, pattern.start), block);
|
||||
var start = outcome.fold(Option.none, Option.none, Option.some);
|
||||
var start = findPatternStartFromSpot(dom, pattern, block, spot);
|
||||
return start.bind(function (startRange) {
|
||||
if (requireGap) {
|
||||
if (startRange.endContainer === spot.element && startRange.endOffset === spot.offset) {
|
||||
if (startRange.endContainer === spot.container && startRange.endOffset === spot.offset) {
|
||||
return Option.none();
|
||||
} else if (spot.offset === 0 && startRange.endContainer.textContent.length === startRange.endOffset) {
|
||||
return Option.none();
|
||||
@@ -1198,10 +1170,10 @@
|
||||
var dom = editor.dom;
|
||||
var root = dom.getRoot();
|
||||
var pattern = details.pattern;
|
||||
var endNode = details.position.element;
|
||||
var endNode = details.position.container;
|
||||
var endOffset = details.position.offset;
|
||||
return scanLeft(endNode, endOffset - details.pattern.end.length, block).bind(function (spot) {
|
||||
var endPathRng = generatePathRange(root, spot.element, spot.offset, endNode, endOffset);
|
||||
var endPathRng = generatePathRange(root, spot.container, spot.offset, endNode, endOffset);
|
||||
if (isReplacementPattern(pattern)) {
|
||||
return Option.some({
|
||||
matches: [{
|
||||
@@ -1212,13 +1184,13 @@
|
||||
position: spot
|
||||
});
|
||||
} else {
|
||||
var resultsOpt = findPatternsRec(editor, details.remainingPatterns, spot.element, spot.offset, block);
|
||||
var resultsOpt = findPatternsRec(editor, details.remainingPatterns, spot.container, spot.offset, block);
|
||||
var results_1 = resultsOpt.getOr({
|
||||
matches: [],
|
||||
position: spot
|
||||
});
|
||||
var pos = results_1.position;
|
||||
var start = findPatternStart(dom, pattern, pos.element, pos.offset, block, resultsOpt.isNone());
|
||||
var start = findPatternStart(dom, pattern, pos.container, pos.offset, block, resultsOpt.isNone());
|
||||
return start.map(function (startRng) {
|
||||
var startPathRng = generatePathRangeFromRange(root, startRng);
|
||||
return {
|
||||
@@ -1348,16 +1320,17 @@
|
||||
editor.undoManager.extra(function () {
|
||||
editor.execCommand('mceInsertNewLine');
|
||||
}, function () {
|
||||
editor.insertContent(zeroWidth());
|
||||
editor.insertContent(zeroWidth);
|
||||
applyMatches$1(editor, inlineMatches);
|
||||
applyMatches(editor, blockMatches);
|
||||
var range = editor.selection.getRng();
|
||||
var spot = textBefore(range.startContainer, range.startOffset, editor.dom.getRoot());
|
||||
editor.execCommand('mceInsertNewLine');
|
||||
spot.each(function (s) {
|
||||
if (s.element.data.charAt(s.offset - 1) === zeroWidth()) {
|
||||
s.element.deleteData(s.offset - 1, 1);
|
||||
cleanEmptyNodes(editor.dom, s.element.parentNode, function (e) {
|
||||
var node = s.container;
|
||||
if (node.data.charAt(s.offset - 1) === zeroWidth) {
|
||||
node.deleteData(s.offset - 1, 1);
|
||||
cleanEmptyNodes(editor.dom, node.parentNode, function (e) {
|
||||
return e === editor.dom.getRoot();
|
||||
});
|
||||
}
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
+1
-1
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
!function(){"use strict";function e(n){return function(t){function e(){return t.setDisabled(n.readonly||!v.hasHeaders(n))}return e(),n.on("LoadContent SetContent change",e),function(){return n.on("LoadContent SetContent change",e)}}}var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),l=tinymce.util.Tools.resolve("tinymce.util.I18n"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),c=function(t){return t.getParam("toc_class","mce-toc")},d=function(t){var e=t.getParam("toc_header","h2");return/^h[1-6]$/.test(e)?e:"h2"},a=function(t){var e=parseInt(t.getParam("toc_depth","3"),10);return 1<=e&&e<=9?e:3},s=function(e){var n=0;return function(){var t=(new Date).getTime().toString(32);return e+t+(n++).toString(32)}}("mcetoc_"),f=function f(t){var e,n=[];for(e=1;e<=t;e++)n.push("h"+e);return n.join(",")},m=function(n){var o=c(n),t=d(n),e=f(a(n)),r=n.$(e);return r.length&&/^h[1-9]$/i.test(t)&&(r=r.filter(function(t,e){return!n.dom.hasClass(e.parentNode,o)})),i.map(r,function(t){return{id:t.id?t.id:s(),level:parseInt(t.nodeName.replace(/^H/i,""),10),title:n.$.text(t),element:t}})},o=function(t){var e,n,o,r,i="",c=m(t),a=function(t){var e,n=9;for(e=0;e<t.length;e++)if(t[e].level<n&&(n=t[e].level),1===n)return n;return n}(c)-1;if(!c.length)return"";for(i+=function(t,e){var n="</"+t+">";return"<"+t+' contenteditable="true">'+u.DOM.encode(e)+n}(d(t),l.translate("Table of Contents")),e=0;e<c.length;e++){if((o=c[e]).element.id=o.id,r=c[e+1]&&c[e+1].level,a===o.level)i+="<li>";else for(n=a;n<o.level;n++)i+="<ul><li>";if(i+='<a href="#'+o.id+'">'+o.title+"</a>",r!==o.level&&r)for(n=o.level;r<n;n--)i+="</li></ul><li>";else i+="</li>",r||(i+="</ul>");a=o.level}return i},r=function(t){var e=c(t),n=t.$("."+e);n.length&&t.undoManager.transact(function(){n.html(o(t))})},v={hasHeaders:function(t){return 0<m(t).length},insertToc:function(t){var e=c(t),n=t.$("."+e);!function(t,e){return!e.length||0<t.dom.getParents(e[0],".mce-offscreen-selection").length}(t,n)?r(t):t.insertContent(function(t){var e=o(t);return'<div class="'+t.dom.encode(c(t))+'" contenteditable="false">'+e+"</div>"}(t))},updateToc:r},n=function(t){t.addCommand("mceInsertToc",function(){v.insertToc(t)}),t.addCommand("mceUpdateToc",function(){v.updateToc(t)})},g=function(t){var n=t.$,o=c(t);t.on("PreProcess",function(t){var e=n("."+o,t.node);e.length&&(e.removeAttr("contentEditable"),e.find("[contenteditable]").removeAttr("contentEditable"))}),t.on("SetContent",function(){var t=n("."+o);t.length&&(t.attr("contentEditable",!1),t.children(":first-child").attr("contentEditable",!0))})},h=function(t){t.ui.registry.addButton("toc",{icon:"toc",tooltip:"Table of contents",onAction:function(){return t.execCommand("mceInsertToc")},onSetup:e(t)}),t.ui.registry.addButton("tocupdate",{icon:"reload",tooltip:"Update",onAction:function(){return t.execCommand("mceUpdateToc")}}),t.ui.registry.addMenuItem("toc",{icon:"toc",text:"Table of contents",onAction:function(){return t.execCommand("mceInsertToc")},onSetup:e(t)}),t.ui.registry.addContextToolbar("toc",{items:"tocupdate",predicate:function(e){return function(t){return t&&e.dom.is(t,"."+c(e))&&e.getBody().contains(t)}}(t),scope:"node",position:"node"})};!function p(){t.add("toc",function(t){n(t),h(t),g(t)})}()}();
|
||||
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
+1
-1
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
!function(){"use strict";function n(n,e){return function(o){o.setActive(e.get());function t(t){return o.setActive(t.state)}return n.on("VisualBlocks",t),function(){return n.off("VisualBlocks",t)}}}var e=function(t){function o(){return n}var n=t;return{get:o,set:function(t){n=t},clone:function(){return e(o())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(t,o){t.fire("VisualBlocks",{state:o})},u=function(t,o,n){t.dom.toggleClass(t.getBody(),"mce-visualblocks"),n.set(!n.get()),i(t,n.get())},c=function(t,o,n){t.addCommand("mceVisualBlocks",function(){u(t,o,n)})},s=function(t){return t.getParam("visualblocks_default_state",!1,"boolean")},l=function(o,t,n){o.on("PreviewFormats AfterPreviewFormats",function(t){n.get()&&o.dom.toggleClass(o.getBody(),"mce-visualblocks","afterpreviewformats"===t.type)}),o.on("init",function(){s(o)&&u(o,t,n)}),o.on("remove",function(){o.dom.removeClass(o.getBody(),"mce-visualblocks")})},r=function(t,o){t.ui.registry.addToggleButton("visualblocks",{icon:"visualblocks",tooltip:"Show blocks",onAction:function(){return t.execCommand("mceVisualBlocks")},onSetup:n(t,o)}),t.ui.registry.addToggleMenuItem("visualblocks",{text:"Show blocks",onAction:function(){return t.execCommand("mceVisualBlocks")},onSetup:n(t,o)})};!function o(){t.add("visualblocks",function(t,o){var n=e(!1);c(t,o,n),r(t,n),l(t,o,n)})}()}();
|
||||
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function (domGlobals) {
|
||||
'use strict';
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -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.1.6 (2020-01-28)
|
||||
* Version: 5.2.0 (2020-02-13)
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
@@ -255,6 +255,8 @@
|
||||
return true;
|
||||
};
|
||||
|
||||
var zeroWidth = '\uFEFF';
|
||||
|
||||
var EMPTY_STRING$1 = EMPTY_STRING;
|
||||
var WHITESPACE$1 = WHITESPACE;
|
||||
var PUNCTUATION$1 = PUNCTUATION;
|
||||
@@ -311,7 +313,7 @@
|
||||
var extractedChars = [];
|
||||
for (var i = 0; i < chars.length; i++) {
|
||||
var ch = extract(chars[i]);
|
||||
if (ch !== '\uFEFF') {
|
||||
if (ch !== zeroWidth) {
|
||||
filteredChars.push(chars[i]);
|
||||
extractedChars.push(ch);
|
||||
}
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
+2
-2
File diff suppressed because one or more lines are too long
+2381
-2339
File diff suppressed because it is too large
Load Diff
+2
-2
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user