tinymce-rails 5.0.15 → 5.0.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/source/tinymce/tinymce.js +5723 -5757
- data/lib/tinymce/rails/configuration.rb +1 -1
- data/lib/tinymce/rails/version.rb +2 -2
- data/vendor/assets/javascripts/tinymce/jquery.tinymce.js +15 -16
- data/vendor/assets/javascripts/tinymce/plugins/advlist/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/anchor/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/autolink/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/autoresize/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/autosave/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/bbcode/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/charmap/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/code/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/codesample/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/colorpicker/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/contextmenu/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/directionality/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/fullpage/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/fullscreen/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/help/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/hr/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/image/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/imagetools/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/importcss/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/insertdatetime/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/legacyoutput/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/link/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/lists/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/media/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/nonbreaking/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/noneditable/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/pagebreak/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/paste/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/preview/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/print/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/quickbars/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/save/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/searchreplace/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/spellchecker/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/tabfocus/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/table/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/template/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/textcolor/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/textpattern/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/toc/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/visualblocks/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/visualchars/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/wordcount/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.mobile.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.mobile.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.mobile.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.mobile.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/themes/mobile/theme.js +2 -2
- data/vendor/assets/javascripts/tinymce/themes/silver/theme.js +2 -2
- data/vendor/assets/javascripts/tinymce/tinymce.js +2 -2
- metadata +2 -2
@@ -48,7 +48,7 @@ module TinyMCE::Rails
|
|
48
48
|
# Check for files provided in the content_css option to replace them with their actual path.
|
49
49
|
# If no corresponding stylesheet is found for a file, it will remain unchanged.
|
50
50
|
"content_css" => ->(value) {
|
51
|
-
helpers = ActionView::Base.new
|
51
|
+
helpers = ActionView::Base.new(ActionView::LookupContext.new([]))
|
52
52
|
separator = OPTION_SEPARATORS["content_css"]
|
53
53
|
|
54
54
|
value.split(separator).map { |file|
|
@@ -10,15 +10,14 @@
|
|
10
10
|
* @class tinymce.core.JqueryIntegration
|
11
11
|
* @private
|
12
12
|
*/
|
13
|
-
!function(){var f,c,u,p,d,s=[];d="undefined"!=typeof global?global:window,p=d.jQuery;
|
13
|
+
!function(){var f,c,u,p,d,s=[];d="undefined"!=typeof global?global:window,p=d.jQuery;function v(){
|
14
14
|
// Reference to tinymce needs to be lazily evaluated since tinymce
|
15
15
|
// might be loaded through the compressor or other means
|
16
|
-
return d.tinymce}
|
16
|
+
return d.tinymce}p.fn.tinymce=function(o){var e,t,i,l=this,r="";
|
17
17
|
// No match then just ignore the call
|
18
18
|
if(!l.length)return l;
|
19
19
|
// Get editor instance
|
20
|
-
if(!o)return v()?v().get(l[0].id):null;l.css("visibility","hidden")
|
21
|
-
var n=function(){var a=[],c=0;
|
20
|
+
if(!o)return v()?v().get(l[0].id):null;l.css("visibility","hidden");function n(){var a=[],c=0;
|
22
21
|
// Apply patches to the jQuery object, only once
|
23
22
|
u||(m(),u=!0),
|
24
23
|
// Create an editor instance for each matched node
|
@@ -37,7 +36,7 @@ r&&++c==a.length&&("string"==typeof t&&(e=-1===t.indexOf(".")?null:v().resolve(t
|
|
37
36
|
t.apply(e||v(),a))}))}),
|
38
37
|
// Render the editor instances in a separate loop since we
|
39
38
|
// need to have the full editors array used in the onInit calls
|
40
|
-
p.each(a,function(e,t){t.render()})}
|
39
|
+
p.each(a,function(e,t){t.render()})}
|
41
40
|
// Load TinyMCE on demand, if we need to
|
42
41
|
if(d.tinymce||c||!(e=o.script_url))
|
43
42
|
// Delay the init call until tinymce is loaded
|
@@ -52,7 +51,7 @@ d.tinymce=d.tinyMCEPreInit||{base:t,suffix:r},
|
|
52
51
|
// url contains gzip then we assume it's a compressor
|
53
52
|
-1!=e.indexOf("gzip")&&(i=o.language||"en",e=e+(/\?/.test(e)?"&":"?")+"js=true&core=true&suffix="+escape(r)+"&themes="+escape(o.theme||"modern")+"&plugins="+escape(o.plugins||"")+"&languages="+(i||""),
|
54
53
|
// Check if compressor script is already loaded otherwise setup a basic one
|
55
|
-
d.tinyMCE_GZ||(d.tinyMCE_GZ={start:function(){
|
54
|
+
d.tinyMCE_GZ||(d.tinyMCE_GZ={start:function(){function n(e){v().ScriptLoader.markDone(v().baseURI.toAbsolute(e))}
|
56
55
|
// Add core languages
|
57
56
|
n("langs/"+i+".js"),
|
58
57
|
// Add themes with languages
|
@@ -67,26 +66,26 @@ p.extend(p.expr[":"],{tinymce:function(e){var t;return!!(e.id&&"tinymce"in d&&(t
|
|
67
66
|
// This function patches internal jQuery functions so that if
|
68
67
|
// you for example remove an div element containing an editor it's
|
69
68
|
// automatically destroyed by the TinyMCE API
|
70
|
-
var m=function(){
|
71
|
-
// Removes any child editor instances by looking for editor wrapper elements
|
72
|
-
var r=function(e){
|
69
|
+
var m=function(){function r(e){
|
73
70
|
// If the function is remove
|
74
|
-
"remove"===e&&this.each(function(e,t){var n=
|
71
|
+
"remove"===e&&this.each(function(e,t){var n=u(t);n&&n.remove()}),this.find("span.mceEditor,div.mceEditor").each(function(e,t){var n=v().get(t.id.replace(/_parent$/,""));n&&n.remove()})}function o(i){var e,t=this;
|
75
72
|
// Handle set value
|
76
73
|
/*jshint eqnull:true */if(null!=i)r.call(t),
|
77
74
|
// Saves the contents before get/set value of textarea/div
|
78
|
-
t.each(function(e,t){var n;(n=v().get(t.id))&&n.setContent(i)});else if(0<t.length&&(e=v().get(t[0].id)))return e.getContent()}
|
75
|
+
t.each(function(e,t){var n;(n=v().get(t.id))&&n.setContent(i)});else if(0<t.length&&(e=v().get(t[0].id)))return e.getContent()}function l(e){return!!(e&&e.length&&d.tinymce&&e.is(":tinymce"))}
|
76
|
+
// Removes any child editor instances by looking for editor wrapper elements
|
77
|
+
var u=function(e){var t=null;return e&&e.id&&d.tinymce&&(t=v().get(e.id)),t},s={};
|
79
78
|
// Loads or saves contents from/to textarea if the value
|
80
79
|
// argument is defined it will set the TinyMCE internal contents
|
81
80
|
// Patch some setter/getter functions these will
|
82
81
|
// now be able to set/get the contents of editor instances for
|
83
82
|
// example $('#editorid').html('Content'); will update the TinyMCE iframe instance
|
84
|
-
p.each(["text","html","val"],function(e,t){var a=s[t]=p.fn[t],c="text"===t;p.fn[t]=function(e){var t=this;if(!
|
85
|
-
var i="",r=arguments;return(c?t:t.eq(0)).each(function(e,t){var n=
|
83
|
+
p.each(["text","html","val"],function(e,t){var a=s[t]=p.fn[t],c="text"===t;p.fn[t]=function(e){var t=this;if(!l(t))return a.apply(t,arguments);if(e!==f)return o.call(t.filter(":tinymce"),e),a.apply(t.not(":tinymce"),arguments),t;// return original set for chaining
|
84
|
+
var i="",r=arguments;return(c?t:t.eq(0)).each(function(e,t){var n=u(t);i+=n?c?n.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):n.getContent({save:!0}):a.apply(p(t),r)}),i}}),
|
86
85
|
// Makes it possible to use $('#id').append("content"); to append contents to the TinyMCE editor iframe
|
87
|
-
p.each(["append","prepend"],function(e,t){var n=s[t]=p.fn[t],r="prepend"===t;p.fn[t]=function(i){var e=this;return
|
86
|
+
p.each(["append","prepend"],function(e,t){var n=s[t]=p.fn[t],r="prepend"===t;p.fn[t]=function(i){var e=this;return l(e)?i!==f?("string"==typeof i&&e.filter(":tinymce").each(function(e,t){var n=u(t);n&&n.setContent(r?i+n.getContent():n.getContent()+i)}),n.apply(e.not(":tinymce"),arguments),e):void 0:n.apply(e,arguments)}}),
|
88
87
|
// Makes sure that the editor instance gets properly destroyed when the parent element is removed
|
89
88
|
p.each(["remove","replaceWith","replaceAll","empty"],function(e,t){var n=s[t]=p.fn[t];p.fn[t]=function(){return r.call(this,t),n.apply(this,arguments)}}),s.attr=p.fn.attr,
|
90
89
|
// Makes sure that $('#tinymce_id').attr('value') gets the editors current HTML contents
|
91
|
-
p.fn.attr=function(e,t){var n=this,i=arguments;if(!e||"value"!==e||!
|
92
|
-
var r=n[0],a=
|
90
|
+
p.fn.attr=function(e,t){var n=this,i=arguments;if(!e||"value"!==e||!l(n))return s.attr.apply(n,i);if(t!==f)return o.call(n.filter(":tinymce"),t),s.attr.apply(n.not(":tinymce"),i),n;// return original set for chaining
|
91
|
+
var r=n[0],a=u(r);return a?a.getContent({save:!0}):s.attr.apply(p(r),i)}}}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
|
-
!function(){"use strict";
|
9
|
+
!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,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
|
-
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),
|
9
|
+
!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,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
|
-
!function(){"use strict";
|
9
|
+
!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.ie&&o.ie<=11?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,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
|
-
!function(){"use strict";var
|
9
|
+
!function(){"use strict";function m(e,t){var n=e.getBody();n&&(n.style.overflowY=t?"":"hidden",t||(n.scrollTop=0))}function d(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"),h=tinymce.util.Tools.resolve("tinymce.Env"),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),v=function(e){return e.fire("ResizeEditor")},y=function(e){return e.getParam("min_height",e.getElement().offsetHeight,"number")},p=function(e){return e.getParam("max_height",0,"number")},o=function(e){return e.getParam("autoresize_overflow_padding",1,"number")},z=function(e){return e.getParam("autoresize_bottom_margin",50,"number")},u=function(e){return e.getParam("autoresize_on_init",!0,"boolean")},a=function(e,t,n,i,o){r.setEditorTimeout(e,function(){C(e,t),n--?a(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))m(e,!0);else{var a=u.documentElement,s=z(e);i=y(e);var f=d(r,a,"margin-top",!0),c=d(r,a,"margin-bottom",!0);(o=a.offsetHeight+f+c+s)<0&&(o=0);var g=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight;o+g>y(e)&&(i=o+g);var l=p(e);l&&l<i?(i=l,m(e,!0)):m(e,!1),i!==t.get()&&(n=i-t.get(),r.setStyle(e.getContainer(),"height",i+"px"),t.set(i),v(e),h.webkit&&n<0&&C(e,t))}},n={setup:function(t,n){t.on("init",function(){var e=o(t);t.dom.setStyles(t.getBody(),{paddingLeft:e,paddingRight:e,"min-height":0})}),t.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",function(e){C(t,n)}),u(t)&&t.on("init",function(){a(t,n,20,100,function(){a(t,n,5,1e3)})})},resize:C},s=function(e,t){e.addCommand("mceAutoResize",function(){n.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);s(e,t),n.setup(e,t)}})}()}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
|
-
!function(
|
9
|
+
!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,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
|
-
!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);
|
9
|
+
!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,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
|
-
!function(l){"use strict";var n,e,r,t,a=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(n,e){return n.fire("insertCustomChar",{chr:e})},f=function(n,e){var r=i(n,e).chr;n.execCommand("mceInsertContent",!1,r)},o=tinymce.util.Tools.resolve("tinymce.util.Tools"),c=function(n){return n.settings.charmap},u=function(n){return n.settings.charmap_append},s=function(n){return function(){return n}},g=s(!1),m=s(!0),h=g,d=m,p=function(){return y},y=(t={fold:function(n,e){return n()},is:h,isSome:h,isNone:d,getOr:r=function(n){return n},getOrThunk:e=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:r,orThunk:e,map:p,ap:p,each:function(){},bind:p,flatten:p,exists:h,forall:d,filter:p,equals:n=function(n){return n.isNone()},equals_:n,toArray:function(){return[]},toString:s("none()")},Object.freeze&&Object.freeze(t),t),w=function(r){var n=function(){return r},e=function(){return a},t=function(n){return n(r)},a={fold:function(n,e){return e(r)},is:function(n){return r===n},isSome:d,isNone:h,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:e,orThunk:e,map:function(n){return w(n(r))},ap:function(n){return n.fold(p,function(n){return w(n(r))})},each:function(n){n(r)},bind:t,flatten:n,exists:t,forall:t,filter:function(n){return n(r)?a:y},equals:function(n){return n.is(r)},equals_:function(n,e){return n.fold(h,function(n){return e(r,n)})},toArray:function(){return[r]},toString:function(){return"some("+r+")"}};return a},b={some:w,none:p,from:function(n){return null===n||n===undefined?y:w(n)}},v=function(e){return function(n){return function(n){if(null===n)return"null";var e=typeof n;return"object"===e&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":e}(n)===e}},k=v("array"),C=v("function"),A=Array.prototype.slice,O=function(n,e){for(var r=n.length,t=new Array(r),a=0;a<r;a++){var i=n[a];t[a]=e(i,a,n)}return t},x=Array.prototype.push,q=function(n,e){return function(n){for(var e=[],r=0,t=n.length;r<t;++r){if(!k(n[r]))throw new Error("Arr.flatten item "+r+" was not an array, input: "+n);x.apply(e,n[r])}return e}(O(n,e))},S=(C(Array.from)&&Array.from,o.isArray),T="User Defined",E=function(n){return S(n)?[].concat((e=n,o.grep(e,function(n){return S(n)&&2===n.length}))):"function"==typeof n?n():[];var e},z=function(n){var e=function(n,e){var r=c(n);r&&(e=[{name:T,characters:E(r)}]);var t=u(n);if(t){var a=o.grep(e,function(n){return n.name===T});return a.length?(a[0].characters=[].concat(a[0].characters).concat(E(t)),e):[].concat(e).concat({name:T,characters:E(t)})}return e}(n,[{name:"Currency",characters:[[36,"dollar sign"],[162,"cent sign"],[8364,"euro sign"],[163,"pound sign"],[165,"yen sign"],[164,"currency sign"],[8352,"euro-currency sign"],[8353,"colon sign"],[8354,"cruzeiro sign"],[8355,"french franc sign"],[8356,"lira sign"],[8357,"mill sign"],[8358,"naira sign"],[8359,"peseta sign"],[8360,"rupee sign"],[8361,"won sign"],[8362,"new sheqel sign"],[8363,"dong sign"],[8365,"kip sign"],[8366,"tugrik sign"],[8367,"drachma sign"],[8368,"german penny symbol"],[8369,"peso sign"],[8370,"guarani sign"],[8371,"austral sign"],[8372,"hryvnia sign"],[8373,"cedi sign"],[8374,"livre tournois sign"],[8375,"spesmilo sign"],[8376,"tenge sign"],[8377,"indian rupee sign"],[8378,"turkish lira sign"],[8379,"nordic mark sign"],[8380,"manat sign"],[8381,"ruble sign"],[20870,"yen character"],[20803,"yuan character"],[22291,"yuan character, in hong kong and taiwan"],[22278,"yen/yuan character variant one"]]},{name:"Text",characters:[[169,"copyright sign"],[174,"registered sign"],[8482,"trade mark sign"],[8240,"per mille sign"],[181,"micro sign"],[183,"middle dot"],[8226,"bullet"],[8230,"three dot leader"],[8242,"minutes / feet"],[8243,"seconds / inches"],[167,"section sign"],[182,"paragraph sign"],[223,"sharp s / ess-zed"]]},{name:"Quotations",characters:[[8249,"single left-pointing angle quotation mark"],[8250,"single right-pointing angle quotation mark"],[171,"left pointing guillemet"],[187,"right pointing guillemet"],[8216,"left single quotation mark"],[8217,"right single quotation mark"],[8220,"left double quotation mark"],[8221,"right double quotation mark"],[8218,"single low-9 quotation mark"],[8222,"double low-9 quotation mark"],[60,"less-than sign"],[62,"greater-than sign"],[8804,"less-than or equal to"],[8805,"greater-than or equal to"],[8211,"en dash"],[8212,"em dash"],[175,"macron"],[8254,"overline"],[164,"currency sign"],[166,"broken bar"],[168,"diaeresis"],[161,"inverted exclamation mark"],[191,"turned question mark"],[710,"circumflex accent"],[732,"small tilde"],[176,"degree sign"],[8722,"minus sign"],[177,"plus-minus sign"],[247,"division sign"],[8260,"fraction slash"],[215,"multiplication sign"],[185,"superscript one"],[178,"superscript two"],[179,"superscript three"],[188,"fraction one quarter"],[189,"fraction one half"],[190,"fraction three quarters"]]},{name:"Mathematical",characters:[[402,"function / florin"],[8747,"integral"],[8721,"n-ary sumation"],[8734,"infinity"],[8730,"square root"],[8764,"similar to"],[8773,"approximately equal to"],[8776,"almost equal to"],[8800,"not equal to"],[8801,"identical to"],[8712,"element of"],[8713,"not an element of"],[8715,"contains as member"],[8719,"n-ary product"],[8743,"logical and"],[8744,"logical or"],[172,"not sign"],[8745,"intersection"],[8746,"union"],[8706,"partial differential"],[8704,"for all"],[8707,"there exists"],[8709,"diameter"],[8711,"backward difference"],[8727,"asterisk operator"],[8733,"proportional to"],[8736,"angle"]]},{name:"Extended Latin",characters:[[192,"A - grave"],[193,"A - acute"],[194,"A - circumflex"],[195,"A - tilde"],[196,"A - diaeresis"],[197,"A - ring above"],[256,"A - macron"],[198,"ligature AE"],[199,"C - cedilla"],[200,"E - grave"],[201,"E - acute"],[202,"E - circumflex"],[203,"E - diaeresis"],[274,"E - macron"],[204,"I - grave"],[205,"I - acute"],[206,"I - circumflex"],[207,"I - diaeresis"],[298,"I - macron"],[208,"ETH"],[209,"N - tilde"],[210,"O - grave"],[211,"O - acute"],[212,"O - circumflex"],[213,"O - tilde"],[214,"O - diaeresis"],[216,"O - slash"],[332,"O - macron"],[338,"ligature OE"],[352,"S - caron"],[217,"U - grave"],[218,"U - acute"],[219,"U - circumflex"],[220,"U - diaeresis"],[362,"U - macron"],[221,"Y - acute"],[376,"Y - diaeresis"],[562,"Y - macron"],[222,"THORN"],[224,"a - grave"],[225,"a - acute"],[226,"a - circumflex"],[227,"a - tilde"],[228,"a - diaeresis"],[229,"a - ring above"],[257,"a - macron"],[230,"ligature ae"],[231,"c - cedilla"],[232,"e - grave"],[233,"e - acute"],[234,"e - circumflex"],[235,"e - diaeresis"],[275,"e - macron"],[236,"i - grave"],[237,"i - acute"],[238,"i - circumflex"],[239,"i - diaeresis"],[299,"i - macron"],[240,"eth"],[241,"n - tilde"],[242,"o - grave"],[243,"o - acute"],[244,"o - circumflex"],[245,"o - tilde"],[246,"o - diaeresis"],[248,"o slash"],[333,"o macron"],[339,"ligature oe"],[353,"s - caron"],[249,"u - grave"],[250,"u - acute"],[251,"u - circumflex"],[252,"u - diaeresis"],[363,"u - macron"],[253,"y - acute"],[254,"thorn"],[255,"y - diaeresis"],[563,"y - macron"],[913,"Alpha"],[914,"Beta"],[915,"Gamma"],[916,"Delta"],[917,"Epsilon"],[918,"Zeta"],[919,"Eta"],[920,"Theta"],[921,"Iota"],[922,"Kappa"],[923,"Lambda"],[924,"Mu"],[925,"Nu"],[926,"Xi"],[927,"Omicron"],[928,"Pi"],[929,"Rho"],[931,"Sigma"],[932,"Tau"],[933,"Upsilon"],[934,"Phi"],[935,"Chi"],[936,"Psi"],[937,"Omega"],[945,"alpha"],[946,"beta"],[947,"gamma"],[948,"delta"],[949,"epsilon"],[950,"zeta"],[951,"eta"],[952,"theta"],[953,"iota"],[954,"kappa"],[955,"lambda"],[956,"mu"],[957,"nu"],[958,"xi"],[959,"omicron"],[960,"pi"],[961,"rho"],[962,"final sigma"],[963,"sigma"],[964,"tau"],[965,"upsilon"],[966,"phi"],[967,"chi"],[968,"psi"],[969,"omega"]]},{name:"Symbols",characters:[[8501,"alef symbol"],[982,"pi symbol"],[8476,"real part symbol"],[978,"upsilon - hook symbol"],[8472,"Weierstrass p"],[8465,"imaginary part"]]},{name:"Arrows",characters:[[8592,"leftwards arrow"],[8593,"upwards arrow"],[8594,"rightwards arrow"],[8595,"downwards arrow"],[8596,"left right arrow"],[8629,"carriage return"],[8656,"leftwards double arrow"],[8657,"upwards double arrow"],[8658,"rightwards double arrow"],[8659,"downwards double arrow"],[8660,"left right double arrow"],[8756,"therefore"],[8834,"subset of"],[8835,"superset of"],[8836,"not a subset of"],[8838,"subset of or equal to"],[8839,"superset of or equal to"],[8853,"circled plus"],[8855,"circled times"],[8869,"perpendicular"],[8901,"dot operator"],[8968,"left ceiling"],[8969,"right ceiling"],[8970,"left floor"],[8971,"right floor"],[9001,"left-pointing angle bracket"],[9002,"right-pointing angle bracket"],[9674,"lozenge"],[9824,"black spade suit"],[9827,"black club suit"],[9829,"black heart suit"],[9830,"black diamond suit"],[8194,"en space"],[8195,"em space"],[8201,"thin space"],[8204,"zero width non-joiner"],[8205,"zero width joiner"],[8206,"left-to-right mark"],[8207,"right-to-left mark"]]}]);return 1<e.length?[{name:"All",characters:q(e,function(n){return n.characters})}].concat(e):e},N=function(e){return{getCharMap:function(){return z(e)},insertChar:function(n){f(e,n)}}},U=function(n){var e=n,r=function(){return e};return{get:r,set:function(n){e=n},clone:function(){return U(r())}}},D=function(n,e){return-1!==n.indexOf(e)},I=function(n,e){var a=[],i=e.toLowerCase();return function(n,e){for(var r=0,t=n.length;r<t;r++)e(n[r],r,n)}(n.characters,function(n){var e,r,t;e=n[0],r=n[1],t=i,(D(String.fromCharCode(e).toLowerCase(),t)||D(r.toLowerCase(),t)||D(r.toLowerCase().replace(/\s+/g,""),t))&&a.push(n)}),O(a,function(n){return{text:n[1],value:String.fromCharCode(n[0]),icon:String.fromCharCode(n[0])}})},P="pattern",j=function(r,n){var t,a,i,e=function(){return[{label:"Search",type:"input",name:P},{type:"collection",name:"results"}]},o=1===n.length?U(T):U("All"),c=function(r,t){(function(n,e){for(var r=0,t=n.length;r<t;r++){var a=n[r];if(e(a,r,n))return b.some(a)}return b.none()})(n,function(n){return n.name===o.get()}).each(function(n){var e=I(n,t);r.setData({results:e})})},u=(t=function(n){var e=n.getData().pattern;c(n,e)},a=40,i=null,{cancel:function(){null!==i&&(l.clearTimeout(i),i=null)},throttle:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];null!==i&&l.clearTimeout(i),i=l.setTimeout(function(){t.apply(null,n),i=null},a)}}),s={title:"Special Character",size:"normal",body:1===n.length?{type:"panel",items:e()}:{type:"tabpanel",tabs:O(n,function(n){return{title:n.name,name:n.name,items:e()}})},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{pattern:"",results:I(n[0],"")},onAction:function(n,e){"results"===e.name&&(f(r,e.value),n.close())},onTabChange:function(n,e){o.set(e.newTabName),u.throttle(n)},onChange:function(n,e){e.name===P&&u.throttle(n)}};r.windowManager.open(s)},L=function(n,e){n.addCommand("mceShowCharmap",function(){j(n,e)})},M=tinymce.util.Tools.resolve("tinymce.util.Promise"),R=function(n){n.ui.registry.addButton("charmap",{icon:"insert-character",tooltip:"Special character",onAction:function(){return n.execCommand("mceShowCharmap")}}),n.ui.registry.addMenuItem("charmap",{icon:"insert-character",text:"Special character...",onAction:function(){return n.execCommand("mceShowCharmap")}})};!function Y(){a.add("charmap",function(n){var t,a,e=z(n);return L(n,e),R(n),t=n,a=e[0],t.ui.registry.addAutocompleter("charmap",{ch:":",columns:"auto",minChars:2,fetch:function(r,n){return new M(function(n,e){n(I(a,r))})},onAction:function(n,e,r){t.selection.setRng(e),t.insertContent(r),n.hide()}}),N(n)})}()}(window);
|
9
|
+
!function(c){"use strict";function n(){}function i(n){return function(){return n}}function e(){return m}var r,t=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(n,e){return n.fire("insertCustomChar",{chr:e})},u=function(n,e){var r=a(n,e).chr;n.execCommand("mceInsertContent",!1,r)},o=tinymce.util.Tools.resolve("tinymce.util.Tools"),s=function(n){return n.settings.charmap},l=function(n){return n.settings.charmap_append},f=i(!1),g=i(!0),m=(r={fold:function(n,e){return n()},is:f,isSome:f,isNone:g,getOr:p,getOrThunk:d,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(undefined),or:p,orThunk:d,map:e,each:n,bind:e,exists:f,forall:g,filter:e,equals:h,equals_:h,toArray:function(){return[]},toString:i("none()")},Object.freeze&&Object.freeze(r),r);function h(n){return n.isNone()}function d(n){return n()}function p(n){return n}function y(e){return function(n){return function(n){if(null===n)return"null";var e=typeof n;return"object"==e&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==e&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":e}(n)===e}}function w(n,e){for(var r=n.length,t=new Array(r),a=0;a<r;a++){var i=n[a];t[a]=e(i,a)}return t}function b(n,e){return function(n){for(var e=[],r=0,t=n.length;r<t;++r){if(!O(n[r]))throw new Error("Arr.flatten item "+r+" was not an array, input: "+n);S.apply(e,n[r])}return e}(w(n,e))}function v(n){return T(n)?[].concat(function(n){return o.grep(n,function(n){return T(n)&&2===n.length})}(n)):"function"==typeof n?n():[]}function k(n,e){return-1!==n.indexOf(e)}var C=function(r){function n(){return a}function e(n){return n(r)}var t=i(r),a={fold:function(n,e){return e(r)},is:function(n){return r===n},isSome:g,isNone:f,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(n){return C(n(r))},each:function(n){n(r)},bind:e,exists:e,forall:e,filter:function(n){return n(r)?a:m},toArray:function(){return[r]},toString:function(){return"some("+r+")"},equals:function(n){return n.is(r)},equals_:function(n,e){return n.fold(f,function(n){return e(r,n)})}};return a},A={some:C,none:e,from:function(n){return null===n||n===undefined?m:C(n)}},O=y("array"),x=y("function"),q=Array.prototype.slice,S=Array.prototype.push,T=(x(Array.from)&&Array.from,o.isArray),E="User Defined",z=function(n){var e=function(n,e){var r=s(n);r&&(e=[{name:E,characters:v(r)}]);var t=l(n);if(t){var a=o.grep(e,function(n){return n.name===E});return a.length?(a[0].characters=[].concat(a[0].characters).concat(v(t)),e):[].concat(e).concat({name:E,characters:v(t)})}return e}(n,[{name:"Currency",characters:[[36,"dollar sign"],[162,"cent sign"],[8364,"euro sign"],[163,"pound sign"],[165,"yen sign"],[164,"currency sign"],[8352,"euro-currency sign"],[8353,"colon sign"],[8354,"cruzeiro sign"],[8355,"french franc sign"],[8356,"lira sign"],[8357,"mill sign"],[8358,"naira sign"],[8359,"peseta sign"],[8360,"rupee sign"],[8361,"won sign"],[8362,"new sheqel sign"],[8363,"dong sign"],[8365,"kip sign"],[8366,"tugrik sign"],[8367,"drachma sign"],[8368,"german penny symbol"],[8369,"peso sign"],[8370,"guarani sign"],[8371,"austral sign"],[8372,"hryvnia sign"],[8373,"cedi sign"],[8374,"livre tournois sign"],[8375,"spesmilo sign"],[8376,"tenge sign"],[8377,"indian rupee sign"],[8378,"turkish lira sign"],[8379,"nordic mark sign"],[8380,"manat sign"],[8381,"ruble sign"],[20870,"yen character"],[20803,"yuan character"],[22291,"yuan character, in hong kong and taiwan"],[22278,"yen/yuan character variant one"]]},{name:"Text",characters:[[169,"copyright sign"],[174,"registered sign"],[8482,"trade mark sign"],[8240,"per mille sign"],[181,"micro sign"],[183,"middle dot"],[8226,"bullet"],[8230,"three dot leader"],[8242,"minutes / feet"],[8243,"seconds / inches"],[167,"section sign"],[182,"paragraph sign"],[223,"sharp s / ess-zed"]]},{name:"Quotations",characters:[[8249,"single left-pointing angle quotation mark"],[8250,"single right-pointing angle quotation mark"],[171,"left pointing guillemet"],[187,"right pointing guillemet"],[8216,"left single quotation mark"],[8217,"right single quotation mark"],[8220,"left double quotation mark"],[8221,"right double quotation mark"],[8218,"single low-9 quotation mark"],[8222,"double low-9 quotation mark"],[60,"less-than sign"],[62,"greater-than sign"],[8804,"less-than or equal to"],[8805,"greater-than or equal to"],[8211,"en dash"],[8212,"em dash"],[175,"macron"],[8254,"overline"],[164,"currency sign"],[166,"broken bar"],[168,"diaeresis"],[161,"inverted exclamation mark"],[191,"turned question mark"],[710,"circumflex accent"],[732,"small tilde"],[176,"degree sign"],[8722,"minus sign"],[177,"plus-minus sign"],[247,"division sign"],[8260,"fraction slash"],[215,"multiplication sign"],[185,"superscript one"],[178,"superscript two"],[179,"superscript three"],[188,"fraction one quarter"],[189,"fraction one half"],[190,"fraction three quarters"]]},{name:"Mathematical",characters:[[402,"function / florin"],[8747,"integral"],[8721,"n-ary sumation"],[8734,"infinity"],[8730,"square root"],[8764,"similar to"],[8773,"approximately equal to"],[8776,"almost equal to"],[8800,"not equal to"],[8801,"identical to"],[8712,"element of"],[8713,"not an element of"],[8715,"contains as member"],[8719,"n-ary product"],[8743,"logical and"],[8744,"logical or"],[172,"not sign"],[8745,"intersection"],[8746,"union"],[8706,"partial differential"],[8704,"for all"],[8707,"there exists"],[8709,"diameter"],[8711,"backward difference"],[8727,"asterisk operator"],[8733,"proportional to"],[8736,"angle"]]},{name:"Extended Latin",characters:[[192,"A - grave"],[193,"A - acute"],[194,"A - circumflex"],[195,"A - tilde"],[196,"A - diaeresis"],[197,"A - ring above"],[256,"A - macron"],[198,"ligature AE"],[199,"C - cedilla"],[200,"E - grave"],[201,"E - acute"],[202,"E - circumflex"],[203,"E - diaeresis"],[274,"E - macron"],[204,"I - grave"],[205,"I - acute"],[206,"I - circumflex"],[207,"I - diaeresis"],[298,"I - macron"],[208,"ETH"],[209,"N - tilde"],[210,"O - grave"],[211,"O - acute"],[212,"O - circumflex"],[213,"O - tilde"],[214,"O - diaeresis"],[216,"O - slash"],[332,"O - macron"],[338,"ligature OE"],[352,"S - caron"],[217,"U - grave"],[218,"U - acute"],[219,"U - circumflex"],[220,"U - diaeresis"],[362,"U - macron"],[221,"Y - acute"],[376,"Y - diaeresis"],[562,"Y - macron"],[222,"THORN"],[224,"a - grave"],[225,"a - acute"],[226,"a - circumflex"],[227,"a - tilde"],[228,"a - diaeresis"],[229,"a - ring above"],[257,"a - macron"],[230,"ligature ae"],[231,"c - cedilla"],[232,"e - grave"],[233,"e - acute"],[234,"e - circumflex"],[235,"e - diaeresis"],[275,"e - macron"],[236,"i - grave"],[237,"i - acute"],[238,"i - circumflex"],[239,"i - diaeresis"],[299,"i - macron"],[240,"eth"],[241,"n - tilde"],[242,"o - grave"],[243,"o - acute"],[244,"o - circumflex"],[245,"o - tilde"],[246,"o - diaeresis"],[248,"o slash"],[333,"o macron"],[339,"ligature oe"],[353,"s - caron"],[249,"u - grave"],[250,"u - acute"],[251,"u - circumflex"],[252,"u - diaeresis"],[363,"u - macron"],[253,"y - acute"],[254,"thorn"],[255,"y - diaeresis"],[563,"y - macron"],[913,"Alpha"],[914,"Beta"],[915,"Gamma"],[916,"Delta"],[917,"Epsilon"],[918,"Zeta"],[919,"Eta"],[920,"Theta"],[921,"Iota"],[922,"Kappa"],[923,"Lambda"],[924,"Mu"],[925,"Nu"],[926,"Xi"],[927,"Omicron"],[928,"Pi"],[929,"Rho"],[931,"Sigma"],[932,"Tau"],[933,"Upsilon"],[934,"Phi"],[935,"Chi"],[936,"Psi"],[937,"Omega"],[945,"alpha"],[946,"beta"],[947,"gamma"],[948,"delta"],[949,"epsilon"],[950,"zeta"],[951,"eta"],[952,"theta"],[953,"iota"],[954,"kappa"],[955,"lambda"],[956,"mu"],[957,"nu"],[958,"xi"],[959,"omicron"],[960,"pi"],[961,"rho"],[962,"final sigma"],[963,"sigma"],[964,"tau"],[965,"upsilon"],[966,"phi"],[967,"chi"],[968,"psi"],[969,"omega"]]},{name:"Symbols",characters:[[8501,"alef symbol"],[982,"pi symbol"],[8476,"real part symbol"],[978,"upsilon - hook symbol"],[8472,"Weierstrass p"],[8465,"imaginary part"]]},{name:"Arrows",characters:[[8592,"leftwards arrow"],[8593,"upwards arrow"],[8594,"rightwards arrow"],[8595,"downwards arrow"],[8596,"left right arrow"],[8629,"carriage return"],[8656,"leftwards double arrow"],[8657,"upwards double arrow"],[8658,"rightwards double arrow"],[8659,"downwards double arrow"],[8660,"left right double arrow"],[8756,"therefore"],[8834,"subset of"],[8835,"superset of"],[8836,"not a subset of"],[8838,"subset of or equal to"],[8839,"superset of or equal to"],[8853,"circled plus"],[8855,"circled times"],[8869,"perpendicular"],[8901,"dot operator"],[8968,"left ceiling"],[8969,"right ceiling"],[8970,"left floor"],[8971,"right floor"],[9001,"left-pointing angle bracket"],[9002,"right-pointing angle bracket"],[9674,"lozenge"],[9824,"black spade suit"],[9827,"black club suit"],[9829,"black heart suit"],[9830,"black diamond suit"],[8194,"en space"],[8195,"em space"],[8201,"thin space"],[8204,"zero width non-joiner"],[8205,"zero width joiner"],[8206,"left-to-right mark"],[8207,"right-to-left mark"]]}]);return 1<e.length?[{name:"All",characters:b(e,function(n){return n.characters})}].concat(e):e},N=function(e){return{getCharMap:function(){return z(e)},insertChar:function(n){u(e,n)}}},U=function(n){function e(){return r}var r=n;return{get:e,set:function(n){r=n},clone:function(){return U(e())}}},D=function(n,e){var r=[],t=e.toLowerCase();return function(n,e){for(var r=0,t=n.length;r<t;r++){e(n[r],r)}}(n.characters,function(n){!function(n,e,r){return!!k(String.fromCharCode(n).toLowerCase(),r)||(k(e.toLowerCase(),r)||k(e.toLowerCase().replace(/\s+/g,""),r))}(n[0],n[1],t)||r.push(n)}),w(r,function(n){return{text:n[1],value:String.fromCharCode(n[0]),icon:String.fromCharCode(n[0])}})},I="pattern",P=function(r,n){function e(){return[{label:"Search",type:"input",name:I},{type:"collection",name:"results"}]}function t(r,t){(function(n,e){for(var r=0,t=n.length;r<t;r++){var a=n[r];if(e(a,r))return A.some(a)}return A.none()})(n,function(n){return n.name===a.get()}).each(function(n){var e=D(n,t);r.setData({results:e})})}var a=1===n.length?U(E):U("All"),i=function(r,t){var a=null;return{cancel:function(){null!==a&&(c.clearTimeout(a),a=null)},throttle:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];null!==a&&c.clearTimeout(a),a=c.setTimeout(function(){r.apply(null,n),a=null},t)}}}(function(n){var e=n.getData().pattern;t(n,e)},40),o={title:"Special Character",size:"normal",body:1===n.length?{type:"panel",items:e()}:{type:"tabpanel",tabs:w(n,function(n){return{title:n.name,name:n.name,items:e()}})},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{pattern:"",results:D(n[0],"")},onAction:function(n,e){"results"===e.name&&(u(r,e.value),n.close())},onTabChange:function(n,e){a.set(e.newTabName),i.throttle(n)},onChange:function(n,e){e.name===I&&i.throttle(n)}};r.windowManager.open(o)},j=function(n,e){n.addCommand("mceShowCharmap",function(){P(n,e)})},L=tinymce.util.Tools.resolve("tinymce.util.Promise"),M=function(n){n.ui.registry.addButton("charmap",{icon:"insert-character",tooltip:"Special character",onAction:function(){return n.execCommand("mceShowCharmap")}}),n.ui.registry.addMenuItem("charmap",{icon:"insert-character",text:"Special character...",onAction:function(){return n.execCommand("mceShowCharmap")}})};!function R(){t.add("charmap",function(n){var e=z(n);return j(n,e),M(n),function(t,a){t.ui.registry.addAutocompleter("charmap",{ch:":",columns:"auto",minChars:2,fetch:function(r,n){return new L(function(n,e){n(D(a,r))})},onAction:function(n,e,r){t.selection.setRng(e),t.insertContent(r),n.hide()}})}(n,e[0]),N(n)})}()}(window);
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
9
|
!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),{}})}()}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
|
-
!function(c){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),t={},n=t,g=void 0!==t?t:"undefined"!=typeof WorkerGlobalScope&&c.self instanceof WorkerGlobalScope?c.self:{},i=function(){var u=/\blang(?:uage)?-(?!\*)(\w+)\b/i,S=g.Prism={util:{encode:function(e){return e instanceof s?new s(e.type,S.util.encode(e.content),e.alias):"Array"===S.util.type(e)?e.map(S.util.encode):e.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},clone:function(e){switch(S.util.type(e)){case"Object":var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=S.util.clone(e[n]));return t;case"Array":return e.map&&e.map(function(e){return S.util.clone(e)})}return e}},languages:{extend:function(e,t){var n=S.util.clone(S.languages[e]);for(var a in t)n[a]=t[a];return n},insertBefore:function(n,e,t,a){var r=(a=a||S.languages)[n];if(2===arguments.length){for(var i in t=e)t.hasOwnProperty(i)&&(r[i]=t[i]);return r}var o={};for(var s in r)if(r.hasOwnProperty(s)){if(s===e)for(var i in t)t.hasOwnProperty(i)&&(o[i]=t[i]);o[s]=r[s]}return S.languages.DFS(S.languages,function(e,t){t===a[n]&&e!==n&&(this[e]=o)}),a[n]=o},DFS:function(e,t,n){for(var a in e)e.hasOwnProperty(a)&&(t.call(e,a,e[a],n||a),"Object"===S.util.type(e[a])?S.languages.DFS(e[a],t):"Array"===S.util.type(e[a])&&S.languages.DFS(e[a],t,a))}},plugins:{},highlightAll:function(e,t){for(var n=c.document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'),a=0,r=void 0;r=n[a++];)S.highlightElement(r,!0===e,t)},highlightElement:function(e,t,n){for(var a,r,i=e;i&&!u.test(i.className);)i=i.parentNode;i&&(a=(i.className.match(u)||[,""])[1],r=S.languages[a]),e.className=e.className.replace(u,"").replace(/\s+/g," ")+" language-"+a,i=e.parentNode,/pre/i.test(i.nodeName)&&(i.className=i.className.replace(u,"").replace(/\s+/g," ")+" language-"+a);var o=e.textContent,s={element:e,language:a,grammar:r,code:o};if(o&&r)if(S.hooks.run("before-highlight",s),t&&g.Worker){var l=new c.Worker(S.filename);l.onmessage=function(e){s.highlightedCode=e.data,S.hooks.run("before-insert",s),s.element.innerHTML=s.highlightedCode,n&&n.call(s.element),S.hooks.run("after-highlight",s),S.hooks.run("complete",s)},l.postMessage(JSON.stringify({language:s.language,code:s.code,immediateClose:!0}))}else s.highlightedCode=S.highlight(s.code,s.grammar,s.language),S.hooks.run("before-insert",s),s.element.innerHTML=s.highlightedCode,n&&n.call(e),S.hooks.run("after-highlight",s),S.hooks.run("complete",s);else S.hooks.run("complete",s)},highlight:function(e,t,n){var a=S.tokenize(e,t);return s.stringify(S.util.encode(a),n)},tokenize:function(e,t,n){var a=S.Token,r=[e],i=t.rest;if(i){for(var o in i)t[o]=i[o];delete t.rest}e:for(var o in t)if(t.hasOwnProperty(o)&&t[o]){var s=t[o];s="Array"===S.util.type(s)?s:[s];for(var l=0;l<s.length;++l){var u=s[l],c=u.inside,g=!!u.lookbehind,d=0,p=u.alias;u=u.pattern||u;for(var f=0;f<r.length;f++){var h=r[f];if(r.length>e.length)break e;if(!(h instanceof a)){u.lastIndex=0;var m=u.exec(h);if(m){g&&(d=m[1].length);var b=m.index-1+d,y=b+(m=m[0].slice(d)).length,v=h.slice(0,b+1),k=h.slice(y+1),w=[f,1];v&&w.push(v);var x=new a(o,c?S.tokenize(m,c):m,p);w.push(x),k&&w.push(k),Array.prototype.splice.apply(r,w)}}}}}return r},hooks:{all:{},add:function(e,t){var n=S.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=S.hooks.all[e];if(n&&n.length)for(var a=0,r=void 0;r=n[a++];)r(t)}}},s=S.Token=function(e,t,n){this.type=e,this.content=t,this.alias=n};if(s.stringify=function(t,n,e){if("string"==typeof t)return t;if("Array"===S.util.type(t))return t.map(function(e){return s.stringify(e,n,t)}).join("");var a={type:t.type,content:s.stringify(t.content,n,e),tag:"span",classes:["token",t.type],attributes:{},language:n,parent:e};if("comment"===a.type&&(a.attributes.spellcheck="true"),t.alias){var r="Array"===S.util.type(t.alias)?t.alias:[t.alias];Array.prototype.push.apply(a.classes,r)}S.hooks.run("wrap",a);var i="";for(var o in a.attributes)i+=(i?" ":"")+o+'="'+(a.attributes[o]||"")+'"';return"<"+a.tag+' class="'+a.classes.join(" ")+'" '+i+">"+a.content+"</"+a.tag+">"},!g.document)return g.addEventListener&&g.addEventListener("message",function(e){var t=JSON.parse(e.data),n=t.language,a=t.code,r=t.immediateClose;g.postMessage(S.highlight(a,S.languages[n],n)),r&&g.close()},!1),g.Prism}();void 0!==n&&(n.Prism=i),i.languages.markup={comment:/<!--[\w\W]*?-->/,prolog:/<\?[\w\W]+?\?>/,doctype:/<!DOCTYPE[\w\W]+?>/,cdata:/<!\[CDATA\[[\w\W]*?]]>/i,tag:{pattern:/<\/?[^\s>\/=.]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/[=>"']/}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},i.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))}),i.languages.xml=i.languages.markup,i.languages.html=i.languages.markup,i.languages.mathml=i.languages.markup,i.languages.svg=i.languages.markup,i.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},i.languages.css.atrule.inside.rest=i.util.clone(i.languages.css),i.languages.markup&&(i.languages.insertBefore("markup","tag",{style:{pattern:/<style[\w\W]*?>[\w\W]*?<\/style>/i,inside:{tag:{pattern:/<style[\w\W]*?>|<\/style>/i,inside:i.languages.markup.tag.inside},rest:i.languages.css},alias:"language-css"}}),i.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|').*?\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:i.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:i.languages.css}},alias:"language-css"}},i.languages.markup.tag)),i.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:/(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,"boolean":/\b(true|false)\b/,"function":/[a-z0-9_]+(?=\()/i,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/},i.languages.javascript=i.languages.extend("clike",{keyword:/\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/,number:/\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/,"function":/[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i}),i.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0}}),i.languages.insertBefore("javascript","class-name",{"template-string":{pattern:/`(?:\\`|\\?[^`])*`/,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:i.languages.javascript}},string:/[\s\S]+/}}}),i.languages.markup&&i.languages.insertBefore("markup","tag",{script:{pattern:/<script[\w\W]*?>[\w\W]*?<\/script>/i,inside:{tag:{pattern:/<script[\w\W]*?>|<\/script>/i,inside:i.languages.markup.tag.inside},rest:i.languages.javascript},alias:"language-javascript"}}),i.languages.js=i.languages.javascript,i.languages.c=i.languages.extend("clike",{keyword:/\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,operator:/\-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*\/]/,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)[ful]*\b/i}),i.languages.insertBefore("c","string",{macro:{pattern:/(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im,lookbehind:!0,alias:"property",inside:{string:{pattern:/(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3)/,lookbehind:!0}}}}),delete i.languages.c["class-name"],delete i.languages.c["boolean"],i.languages.csharp=i.languages.extend("clike",{keyword:/\b(abstract|as|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|async|await|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b/,string:[/@("|')(\1\1|\\\1|\\?(?!\1)[\s\S])*\1/,/("|')(\\?.)*?\1/],number:/\b-?(0x[\da-f]+|\d*\.?\d+)\b/i}),i.languages.insertBefore("csharp","keyword",{preprocessor:{pattern:/(^\s*)#.*/m,lookbehind:!0}}),i.languages.cpp=i.languages.extend("c",{keyword:/\b(alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,"boolean":/\b(true|false)\b/,operator:/[-+]{1,2}|!=?|<{1,2}=?|>{1,2}=?|\->|:{1,2}|={1,2}|\^|~|%|&{1,2}|\|?\||\?|\*|\/|\b(and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/}),i.languages.insertBefore("cpp","keyword",{"class-name":{pattern:/(class\s+)[a-z0-9_]+/i,lookbehind:!0}}),i.languages.java=i.languages.extend("clike",{keyword:/\b(abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while)\b/,number:/\b0b[01]+\b|\b0x[\da-f]*\.?[\da-fp\-]+\b|\b\d*\.?\d+(?:e[+-]?\d+)?[df]?\b/i,operator:{pattern:/(^|[^.])(?:\+[+=]?|-[-=]?|!=?|<<?=?|>>?>?=?|==?|&[&=]?|\|[|=]?|\*=?|\/=?|%=?|\^=?|[?:~])/m,lookbehind:!0}}),i.languages.php=i.languages.extend("clike",{keyword:/\b(and|or|xor|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|for|foreach|function|include|include_once|global|if|new|return|static|switch|use|require|require_once|var|while|abstract|interface|public|implements|private|protected|parent|throw|null|echo|print|trait|namespace|final|yield|goto|instanceof|finally|try|catch)\b/i,constant:/\b[A-Z0-9_]{2,}\b/,comment:{pattern:/(^|[^\\])(?:\/\*[\w\W]*?\*\/|\/\/.*)/,lookbehind:!0}}),i.languages.insertBefore("php","class-name",{"shell-comment":{pattern:/(^|[^\\])#.*/,lookbehind:!0,alias:"comment"}}),i.languages.insertBefore("php","keyword",{delimiter:/\?>|<\?(?:php)?/i,variable:/\$\w+\b/i,"package":{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/,lookbehind:!0,inside:{punctuation:/\\/}}}),i.languages.insertBefore("php","operator",{property:{pattern:/(->)[\w]+/,lookbehind:!0}}),i.languages.markup&&(i.hooks.add("before-highlight",function(t){"php"===t.language&&(t.tokenStack=[],t.backupCode=t.code,t.code=t.code.replace(/(?:<\?php|<\?)[\w\W]*?(?:\?>)/gi,function(e){return t.tokenStack.push(e),"{{{PHP"+t.tokenStack.length+"}}}"}))}),i.hooks.add("before-insert",function(e){"php"===e.language&&(e.code=e.backupCode,delete e.backupCode)}),i.hooks.add("after-highlight",function(e){if("php"===e.language){for(var t=0,n=void 0;n=e.tokenStack[t];t++)e.highlightedCode=e.highlightedCode.replace("{{{PHP"+(t+1)+"}}}",i.highlight(n,e.grammar,"php").replace(/\$/g,"$$$$"));e.element.innerHTML=e.highlightedCode}}),i.hooks.add("wrap",function(e){"php"===e.language&&"markup"===e.type&&(e.content=e.content.replace(/(\{\{\{PHP[0-9]+\}\}\})/g,'<span class="token php">$1</span>'))}),i.languages.insertBefore("php","comment",{markup:{pattern:/<[^?]\/?(.*?)>/,inside:i.languages.markup},php:/\{\{\{PHP[0-9]+\}\}\}/})),i.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},string:/"""[\s\S]+?"""|'''[\s\S]+?'''|("|')(?:\\?.)*?\1/,"function":{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_][a-zA-Z0-9_]*(?=\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)[a-z0-9_]+/i,lookbehind:!0},keyword:/\b(?:as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|with|yield)\b/,"boolean":/\b(?:True|False)\b/,number:/\b-?(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not)\b/,punctuation:/[{}[\];(),.:]/},function(e){e.languages.ruby=e.languages.extend("clike",{comment:/#(?!\{[^\r\n]*?\}).*/,keyword:/\b(alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|raise|redo|require|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/});var t={pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"tag"},rest:e.util.clone(e.languages.ruby)}};e.languages.insertBefore("ruby","keyword",{regex:[{pattern:/%r([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1[gim]{0,3}/,inside:{interpolation:t}},{pattern:/%r\((?:[^()\\]|\\[\s\S])*\)[gim]{0,3}/,inside:{interpolation:t}},{pattern:/%r\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}[gim]{0,3}/,inside:{interpolation:t}},{pattern:/%r\[(?:[^\[\]\\]|\\[\s\S])*\][gim]{0,3}/,inside:{interpolation:t}},{pattern:/%r<(?:[^<>\\]|\\[\s\S])*>[gim]{0,3}/,inside:{interpolation:t}},{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0}],variable:/[@$]+[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/,symbol:/:[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/}),e.languages.insertBefore("ruby","number",{builtin:/\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|Fload|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,constant:/\b[A-Z][a-zA-Z_0-9]*(?:[?!]|\b)/}),e.languages.ruby.string=[{pattern:/%[qQiIwWxs]?([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1/,inside:{interpolation:t}},{pattern:/%[qQiIwWxs]?\((?:[^()\\]|\\[\s\S])*\)/,inside:{interpolation:t}},{pattern:/%[qQiIwWxs]?\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/,inside:{interpolation:t}},{pattern:/%[qQiIwWxs]?\[(?:[^\[\]\\]|\\[\s\S])*\]/,inside:{interpolation:t}},{pattern:/%[qQiIwWxs]?<(?:[^<>\\]|\\[\s\S])*>/,inside:{interpolation:t}},{pattern:/("|')(#\{[^}]+\}|\\(?:\r?\n|\r)|\\?.)*?\1/,inside:{interpolation:t}}]}(i);var a,o,s,l,u,d={isCodeSample:function M(e){return e&&"PRE"===e.nodeName&&-1!==e.className.indexOf("language-")},trimArg:function F(n){return function(e,t){return n(t)}}},p=function(e){return function(){return e}},f=p(!1),h=p(!0),m=f,b=h,y=function(){return v},v=(l={fold:function(e,t){return e()},is:m,isSome:m,isNone:b,getOr:s=function(e){return e},getOrThunk:o=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:s,orThunk:o,map:y,ap:y,each:function(){},bind:y,flatten:y,exists:m,forall:b,filter:y,equals:a=function(e){return e.isNone()},equals_:a,toArray:function(){return[]},toString:p("none()")},Object.freeze&&Object.freeze(l),l),k=function(n){var e=function(){return n},t=function(){return r},a=function(e){return e(n)},r={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:b,isNone:m,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return k(e(n))},ap:function(e){return e.fold(y,function(e){return k(e(n))})},each:function(e){e(n)},bind:a,flatten:e,exists:a,forall:a,filter:function(e){return e(n)?r:v},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(m,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return r},w={some:k,none:y,from:function(e){return null===e||e===undefined?v:k(e)}},x=function(e){var t=e.selection?e.selection.getNode():null;return d.isCodeSample(t)?w.some(t):w.none()},S=x,A=function(t,n,a){t.undoManager.transact(function(){var e=x(t);return a=r.DOM.encode(a),e.fold(function(){t.insertContent('<pre id="__new" class="language-'+n+'">'+a+"</pre>"),t.selection.select(t.$("#__new").removeAttr("id")[0])},function(e){t.dom.setAttrib(e,"class","language-"+n),e.innerHTML=a,i.highlightElement(e),t.selection.select(e)})})},C=function(e){return x(e).fold(function(){return""},function(e){return e.textContent})},_=function(e){return e.settings.codesample_languages},N=function(e){var t=_(e);return t||[{text:"HTML/XML",value:"markup"},{text:"JavaScript",value:"javascript"},{text:"CSS",value:"css"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"}]},O=function(e,n){return S(e).fold(function(){return n},function(e){var t=e.className.match(/language-(\w+)/);return t?t[1]:n})},z=(u="function",function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(e)===u}),P=Array.prototype.slice,W=(z(Array.from)&&Array.from,function(n){var e,t=N(n),a=(e=t,0===e.length?w.none():w.some(e[0])).fold(function(){return""},function(e){return e.value}),r=O(n,a),i=C(n);n.windowManager.open({title:"Insert/Edit Code Sample",size:"large",body:{type:"panel",items:[{type:"selectbox",name:"language",label:"Language",items:t},{type:"textarea",name:"code",label:"Code view"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{language:r,code:i},onSubmit:function(e){var t=e.getData();A(n,t.language,t.code),e.close()}})}),j=function(t){t.addCommand("codesample",function(){var e=t.selection.getNode();t.selection.isCollapsed()||d.isCodeSample(e)?W(t):t.formatter.toggle("code")})},T=function(n){var r=n.$;n.on("PreProcess",function(e){r("pre[contenteditable=false]",e.node).filter(d.trimArg(d.isCodeSample)).each(function(e,t){var n=r(t),a=t.textContent;n.attr("class",r.trim(n.attr("class"))),n.removeAttr("contentEditable"),n.empty().append(r("<code></code>").each(function(){this.textContent=a}))})}),n.on("SetContent",function(){var e=r("pre").filter(d.trimArg(d.isCodeSample)).filter(function(e,t){return"false"!==t.contentEditable});e.length&&n.undoManager.transact(function(){e.each(function(e,t){r(t).find("br").each(function(e,t){t.parentNode.replaceChild(n.getDoc().createTextNode("\n"),t)}),t.contentEditable="false",t.innerHTML=n.dom.encode(t.textContent),i.highlightElement(t),t.className=r.trim(t.className)})})})},B=function(a){a.ui.registry.addToggleButton("codesample",{icon:"code-sample",tooltip:"Insert/edit code sample",onAction:function(){return W(a)},onSetup:function(n){var e=function(){var e,t;n.setActive((t=(e=a).selection.getStart(),e.dom.is(t,"pre.language-markup")))};return a.on("NodeChange",e),function(){return a.off("NodeChange",e)}}}),a.ui.registry.addMenuItem("codesample",{text:"Code sample...",icon:"code-sample",onAction:function(){return W(a)}})};!function $(){e.add("codesample",function(t){T(t),B(t),j(t),t.on("dblclick",function(e){d.isCodeSample(e.target)&&W(t)})})}()}(window);
|
9
|
+
!function(c){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),t={},n=t,g=void 0!==t?t:"undefined"!=typeof WorkerGlobalScope&&c.self instanceof WorkerGlobalScope?c.self:{},i=function(){var u=/\blang(?:uage)?-(?!\*)(\w+)\b/i,S=g.Prism={util:{encode:function(e){return e instanceof s?new s(e.type,S.util.encode(e.content),e.alias):"Array"===S.util.type(e)?e.map(S.util.encode):e.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},clone:function(e){switch(S.util.type(e)){case"Object":var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=S.util.clone(e[n]));return t;case"Array":return e.map&&e.map(function(e){return S.util.clone(e)})}return e}},languages:{extend:function(e,t){var n=S.util.clone(S.languages[e]);for(var a in t)n[a]=t[a];return n},insertBefore:function(n,e,t,a){var r=(a=a||S.languages)[n];if(2===arguments.length){for(var i in t=e)t.hasOwnProperty(i)&&(r[i]=t[i]);return r}var o={};for(var s in r)if(r.hasOwnProperty(s)){if(s===e)for(var i in t)t.hasOwnProperty(i)&&(o[i]=t[i]);o[s]=r[s]}return S.languages.DFS(S.languages,function(e,t){t===a[n]&&e!==n&&(this[e]=o)}),a[n]=o},DFS:function(e,t,n){for(var a in e)e.hasOwnProperty(a)&&(t.call(e,a,e[a],n||a),"Object"===S.util.type(e[a])?S.languages.DFS(e[a],t):"Array"===S.util.type(e[a])&&S.languages.DFS(e[a],t,a))}},plugins:{},highlightAll:function(e,t){for(var n=c.document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'),a=0,r=void 0;r=n[a++];)S.highlightElement(r,!0===e,t)},highlightElement:function(e,t,n){for(var a,r,i=e;i&&!u.test(i.className);)i=i.parentNode;i&&(a=(i.className.match(u)||[,""])[1],r=S.languages[a]),e.className=e.className.replace(u,"").replace(/\s+/g," ")+" language-"+a,i=e.parentNode,/pre/i.test(i.nodeName)&&(i.className=i.className.replace(u,"").replace(/\s+/g," ")+" language-"+a);var o=e.textContent,s={element:e,language:a,grammar:r,code:o};if(o&&r)if(S.hooks.run("before-highlight",s),t&&g.Worker){var l=new c.Worker(S.filename);l.onmessage=function(e){s.highlightedCode=e.data,S.hooks.run("before-insert",s),s.element.innerHTML=s.highlightedCode,n&&n.call(s.element),S.hooks.run("after-highlight",s),S.hooks.run("complete",s)},l.postMessage(JSON.stringify({language:s.language,code:s.code,immediateClose:!0}))}else s.highlightedCode=S.highlight(s.code,s.grammar,s.language),S.hooks.run("before-insert",s),s.element.innerHTML=s.highlightedCode,n&&n.call(e),S.hooks.run("after-highlight",s),S.hooks.run("complete",s);else S.hooks.run("complete",s)},highlight:function(e,t,n){var a=S.tokenize(e,t);return s.stringify(S.util.encode(a),n)},tokenize:function(e,t,n){var a=S.Token,r=[e],i=t.rest;if(i){for(var o in i)t[o]=i[o];delete t.rest}e:for(var o in t)if(t.hasOwnProperty(o)&&t[o]){var s=t[o];s="Array"===S.util.type(s)?s:[s];for(var l=0;l<s.length;++l){var u=s[l],c=u.inside,g=!!u.lookbehind,d=0,p=u.alias;u=u.pattern||u;for(var f=0;f<r.length;f++){var h=r[f];if(r.length>e.length)break e;if(!(h instanceof a)){u.lastIndex=0;var m=u.exec(h);if(m){g&&(d=m[1].length);var b=m.index-1+d,y=b+(m=m[0].slice(d)).length,v=h.slice(0,b+1),k=h.slice(y+1),w=[f,1];v&&w.push(v);var x=new a(o,c?S.tokenize(m,c):m,p);w.push(x),k&&w.push(k),Array.prototype.splice.apply(r,w)}}}}}return r},hooks:{all:{},add:function(e,t){var n=S.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=S.hooks.all[e];if(n&&n.length)for(var a=0,r=void 0;r=n[a++];)r(t)}}},s=S.Token=function(e,t,n){this.type=e,this.content=t,this.alias=n};if(s.stringify=function(t,n,e){if("string"==typeof t)return t;if("Array"===S.util.type(t))return t.map(function(e){return s.stringify(e,n,t)}).join("");var a={type:t.type,content:s.stringify(t.content,n,e),tag:"span",classes:["token",t.type],attributes:{},language:n,parent:e};if("comment"===a.type&&(a.attributes.spellcheck="true"),t.alias){var r="Array"===S.util.type(t.alias)?t.alias:[t.alias];Array.prototype.push.apply(a.classes,r)}S.hooks.run("wrap",a);var i="";for(var o in a.attributes)i+=(i?" ":"")+o+'="'+(a.attributes[o]||"")+'"';return"<"+a.tag+' class="'+a.classes.join(" ")+'" '+i+">"+a.content+"</"+a.tag+">"},!g.document)return g.addEventListener&&g.addEventListener("message",function(e){var t=JSON.parse(e.data),n=t.language,a=t.code,r=t.immediateClose;g.postMessage(S.highlight(a,S.languages[n],n)),r&&g.close()},!1),g.Prism}();void 0!==n&&(n.Prism=i),i.languages.markup={comment:/<!--[\w\W]*?-->/,prolog:/<\?[\w\W]+?\?>/,doctype:/<!DOCTYPE[\w\W]+?>/,cdata:/<!\[CDATA\[[\w\W]*?]]>/i,tag:{pattern:/<\/?[^\s>\/=.]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/[=>"']/}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},i.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))}),i.languages.xml=i.languages.markup,i.languages.html=i.languages.markup,i.languages.mathml=i.languages.markup,i.languages.svg=i.languages.markup,i.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},i.languages.css.atrule.inside.rest=i.util.clone(i.languages.css),i.languages.markup&&(i.languages.insertBefore("markup","tag",{style:{pattern:/<style[\w\W]*?>[\w\W]*?<\/style>/i,inside:{tag:{pattern:/<style[\w\W]*?>|<\/style>/i,inside:i.languages.markup.tag.inside},rest:i.languages.css},alias:"language-css"}}),i.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|').*?\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:i.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:i.languages.css}},alias:"language-css"}},i.languages.markup.tag)),i.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:/(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,"boolean":/\b(true|false)\b/,"function":/[a-z0-9_]+(?=\()/i,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/},i.languages.javascript=i.languages.extend("clike",{keyword:/\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/,number:/\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/,"function":/[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i}),i.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0}}),i.languages.insertBefore("javascript","class-name",{"template-string":{pattern:/`(?:\\`|\\?[^`])*`/,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:i.languages.javascript}},string:/[\s\S]+/}}}),i.languages.markup&&i.languages.insertBefore("markup","tag",{script:{pattern:/<script[\w\W]*?>[\w\W]*?<\/script>/i,inside:{tag:{pattern:/<script[\w\W]*?>|<\/script>/i,inside:i.languages.markup.tag.inside},rest:i.languages.javascript},alias:"language-javascript"}}),i.languages.js=i.languages.javascript,i.languages.c=i.languages.extend("clike",{keyword:/\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,operator:/\-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*\/]/,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)[ful]*\b/i}),i.languages.insertBefore("c","string",{macro:{pattern:/(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im,lookbehind:!0,alias:"property",inside:{string:{pattern:/(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3)/,lookbehind:!0}}}}),delete i.languages.c["class-name"],delete i.languages.c["boolean"],i.languages.csharp=i.languages.extend("clike",{keyword:/\b(abstract|as|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|async|await|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b/,string:[/@("|')(\1\1|\\\1|\\?(?!\1)[\s\S])*\1/,/("|')(\\?.)*?\1/],number:/\b-?(0x[\da-f]+|\d*\.?\d+)\b/i}),i.languages.insertBefore("csharp","keyword",{preprocessor:{pattern:/(^\s*)#.*/m,lookbehind:!0}}),i.languages.cpp=i.languages.extend("c",{keyword:/\b(alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,"boolean":/\b(true|false)\b/,operator:/[-+]{1,2}|!=?|<{1,2}=?|>{1,2}=?|\->|:{1,2}|={1,2}|\^|~|%|&{1,2}|\|?\||\?|\*|\/|\b(and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/}),i.languages.insertBefore("cpp","keyword",{"class-name":{pattern:/(class\s+)[a-z0-9_]+/i,lookbehind:!0}}),i.languages.java=i.languages.extend("clike",{keyword:/\b(abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while)\b/,number:/\b0b[01]+\b|\b0x[\da-f]*\.?[\da-fp\-]+\b|\b\d*\.?\d+(?:e[+-]?\d+)?[df]?\b/i,operator:{pattern:/(^|[^.])(?:\+[+=]?|-[-=]?|!=?|<<?=?|>>?>?=?|==?|&[&=]?|\|[|=]?|\*=?|\/=?|%=?|\^=?|[?:~])/m,lookbehind:!0}}),i.languages.php=i.languages.extend("clike",{keyword:/\b(and|or|xor|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|for|foreach|function|include|include_once|global|if|new|return|static|switch|use|require|require_once|var|while|abstract|interface|public|implements|private|protected|parent|throw|null|echo|print|trait|namespace|final|yield|goto|instanceof|finally|try|catch)\b/i,constant:/\b[A-Z0-9_]{2,}\b/,comment:{pattern:/(^|[^\\])(?:\/\*[\w\W]*?\*\/|\/\/.*)/,lookbehind:!0}}),i.languages.insertBefore("php","class-name",{"shell-comment":{pattern:/(^|[^\\])#.*/,lookbehind:!0,alias:"comment"}}),i.languages.insertBefore("php","keyword",{delimiter:/\?>|<\?(?:php)?/i,variable:/\$\w+\b/i,"package":{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/,lookbehind:!0,inside:{punctuation:/\\/}}}),i.languages.insertBefore("php","operator",{property:{pattern:/(->)[\w]+/,lookbehind:!0}}),i.languages.markup&&(i.hooks.add("before-highlight",function(t){"php"===t.language&&(t.tokenStack=[],t.backupCode=t.code,t.code=t.code.replace(/(?:<\?php|<\?)[\w\W]*?(?:\?>)/gi,function(e){return t.tokenStack.push(e),"{{{PHP"+t.tokenStack.length+"}}}"}))}),i.hooks.add("before-insert",function(e){"php"===e.language&&(e.code=e.backupCode,delete e.backupCode)}),i.hooks.add("after-highlight",function(e){if("php"===e.language){for(var t=0,n=void 0;n=e.tokenStack[t];t++)e.highlightedCode=e.highlightedCode.replace("{{{PHP"+(t+1)+"}}}",i.highlight(n,e.grammar,"php").replace(/\$/g,"$$$$"));e.element.innerHTML=e.highlightedCode}}),i.hooks.add("wrap",function(e){"php"===e.language&&"markup"===e.type&&(e.content=e.content.replace(/(\{\{\{PHP[0-9]+\}\}\})/g,'<span class="token php">$1</span>'))}),i.languages.insertBefore("php","comment",{markup:{pattern:/<[^?]\/?(.*?)>/,inside:i.languages.markup},php:/\{\{\{PHP[0-9]+\}\}\}/})),i.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},string:/"""[\s\S]+?"""|'''[\s\S]+?'''|("|')(?:\\?.)*?\1/,"function":{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_][a-zA-Z0-9_]*(?=\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)[a-z0-9_]+/i,lookbehind:!0},keyword:/\b(?:as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|with|yield)\b/,"boolean":/\b(?:True|False)\b/,number:/\b-?(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not)\b/,punctuation:/[{}[\];(),.:]/},function(e){e.languages.ruby=e.languages.extend("clike",{comment:/#(?!\{[^\r\n]*?\}).*/,keyword:/\b(alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|raise|redo|require|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/});var t={pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"tag"},rest:e.util.clone(e.languages.ruby)}};e.languages.insertBefore("ruby","keyword",{regex:[{pattern:/%r([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1[gim]{0,3}/,inside:{interpolation:t}},{pattern:/%r\((?:[^()\\]|\\[\s\S])*\)[gim]{0,3}/,inside:{interpolation:t}},{pattern:/%r\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}[gim]{0,3}/,inside:{interpolation:t}},{pattern:/%r\[(?:[^\[\]\\]|\\[\s\S])*\][gim]{0,3}/,inside:{interpolation:t}},{pattern:/%r<(?:[^<>\\]|\\[\s\S])*>[gim]{0,3}/,inside:{interpolation:t}},{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0}],variable:/[@$]+[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/,symbol:/:[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/}),e.languages.insertBefore("ruby","number",{builtin:/\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|Fload|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,constant:/\b[A-Z][a-zA-Z_0-9]*(?:[?!]|\b)/}),e.languages.ruby.string=[{pattern:/%[qQiIwWxs]?([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1/,inside:{interpolation:t}},{pattern:/%[qQiIwWxs]?\((?:[^()\\]|\\[\s\S])*\)/,inside:{interpolation:t}},{pattern:/%[qQiIwWxs]?\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/,inside:{interpolation:t}},{pattern:/%[qQiIwWxs]?\[(?:[^\[\]\\]|\\[\s\S])*\]/,inside:{interpolation:t}},{pattern:/%[qQiIwWxs]?<(?:[^<>\\]|\\[\s\S])*>/,inside:{interpolation:t}},{pattern:/("|')(#\{[^}]+\}|\\(?:\r?\n|\r)|\\?.)*?\1/,inside:{interpolation:t}}]}(i);function a(){}function o(e){return function(){return e}}function s(){return f}var l,u={isCodeSample:function B(e){return e&&"PRE"===e.nodeName&&-1!==e.className.indexOf("language-")},trimArg:function M(n){return function(e,t){return n(t)}}},d=o(!1),p=o(!0),f=(l={fold:function(e,t){return e()},is:d,isSome:d,isNone:p,getOr:b,getOrThunk:m,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:o(null),getOrUndefined:o(undefined),or:b,orThunk:m,map:s,each:a,bind:s,exists:d,forall:p,filter:s,equals:h,equals_:h,toArray:function(){return[]},toString:o("none()")},Object.freeze&&Object.freeze(l),l);function h(e){return e.isNone()}function m(e){return e()}function b(e){return e}function y(e){var t=e.selection?e.selection.getNode():null;return u.isCodeSample(t)?w.some(t):w.none()}var v,k=function(n){function e(){return r}function t(e){return e(n)}var a=o(n),r={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:p,isNone:d,getOr:a,getOrThunk:a,getOrDie:a,getOrNull:a,getOrUndefined:a,or:e,orThunk:e,map:function(e){return k(e(n))},each:function(e){e(n)},bind:t,exists:t,forall:t,filter:function(e){return e(n)?r:f},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(d,function(e){return t(n,e)})}};return r},w={some:k,none:s,from:function(e){return null===e||e===undefined?f:k(e)}},x=y,S=function(t,n,a){t.undoManager.transact(function(){var e=y(t);return a=r.DOM.encode(a),e.fold(function(){t.insertContent('<pre id="__new" class="language-'+n+'">'+a+"</pre>"),t.selection.select(t.$("#__new").removeAttr("id")[0])},function(e){t.dom.setAttrib(e,"class","language-"+n),e.innerHTML=a,i.highlightElement(e),t.selection.select(e)})})},A=function(e){return y(e).fold(function(){return""},function(e){return e.textContent})},C=function(e){return e.settings.codesample_languages},_=function(e){var t=C(e);return t||[{text:"HTML/XML",value:"markup"},{text:"JavaScript",value:"javascript"},{text:"CSS",value:"css"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"}]},N=function(e,n){return x(e).fold(function(){return n},function(e){var t=e.className.match(/language-(\w+)/);return t?t[1]:n})},O=(v="function",function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"==t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(e)===v}),z=Array.prototype.slice,P=(O(Array.from)&&Array.from,function(n){var e=_(n),t=function(e){return 0===e.length?w.none():w.some(e[0])}(e).fold(function(){return""},function(e){return e.value}),a=N(n,t),r=A(n);n.windowManager.open({title:"Insert/Edit Code Sample",size:"large",body:{type:"panel",items:[{type:"selectbox",name:"language",label:"Language",items:e},{type:"textarea",name:"code",label:"Code view"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{language:a,code:r},onSubmit:function(e){var t=e.getData();S(n,t.language,t.code),e.close()}})}),W=function(t){t.addCommand("codesample",function(){var e=t.selection.getNode();t.selection.isCollapsed()||u.isCodeSample(e)?P(t):t.formatter.toggle("code")})},j=function(n){var r=n.$;n.on("PreProcess",function(e){r("pre[contenteditable=false]",e.node).filter(u.trimArg(u.isCodeSample)).each(function(e,t){var n=r(t),a=t.textContent;n.attr("class",r.trim(n.attr("class"))),n.removeAttr("contentEditable"),n.empty().append(r("<code></code>").each(function(){this.textContent=a}))})}),n.on("SetContent",function(){var e=r("pre").filter(u.trimArg(u.isCodeSample)).filter(function(e,t){return"false"!==t.contentEditable});e.length&&n.undoManager.transact(function(){e.each(function(e,t){r(t).find("br").each(function(e,t){t.parentNode.replaceChild(n.getDoc().createTextNode("\n"),t)}),t.contentEditable="false",t.innerHTML=n.dom.encode(t.textContent),i.highlightElement(t),t.className=r.trim(t.className)})})})},T=function(n){n.ui.registry.addToggleButton("codesample",{icon:"code-sample",tooltip:"Insert/edit code sample",onAction:function(){return P(n)},onSetup:function(e){function t(){e.setActive(function(e){var t=e.selection.getStart();return e.dom.is(t,"pre.language-markup")}(n))}return n.on("NodeChange",t),function(){return n.off("NodeChange",t)}}}),n.ui.registry.addMenuItem("codesample",{text:"Code sample...",icon:"code-sample",onAction:function(){return P(n)}})};!function F(){e.add("codesample",function(t){j(t),T(t),W(t),t.on("dblclick",function(e){u.isCodeSample(e.target)&&P(t)})})}()}(window);
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
9
|
!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,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
9
|
!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,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
|
-
!function(
|
9
|
+
!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,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
|
-
!function(
|
9
|
+
!function(l){"use strict";function n(){}function i(n){return function(){return n}}function t(){return a}var e,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=i(!1),u=i(!0),a=(e={fold:function(n,t){return n()},is:c,isSome:c,isNone:u,getOr:f,getOrThunk:s,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(undefined),or:f,orThunk:s,map:t,each:n,bind:t,exists:c,forall:u,filter:t,equals:o,equals_:o,toArray:function(){return[]},toString:i("none()")},Object.freeze&&Object.freeze(e),e);function o(n){return n.isNone()}function s(n){return n()}function f(n){return n}function m(n,t){return-1!==n.indexOf(t)}function g(n,t){return m(n.title.toLowerCase(),t)||function(n,t){for(var e=0,r=n.length;e<r;e++){if(t(n[e],e))return!0}return!1}(n.keywords,function(n){return m(n.toLowerCase(),t)})}function d(n,t,e){for(var r=[],o=t.toLowerCase(),i=e.fold(function(){return c},function(t){return function(n){return t<=n}}),u=0;u<n.length&&(0!==t.length&&!g(n[u],o)||(r.push({value:n[u]["char"],text:n[u].title,icon:n[u]["char"]}),!i(r.length)));u++);return r}function y(n,t){for(var e=P(n),r=0,o=e.length;r<o;r++){var i=e[r];t(n[i],i)}}function p(n,t){return function(n,t){return D.call(n,t)}(n,t)?n[t]:t}function v(n){return function(n,e){return S(n,function(n,t){return{k:t,v:e(n,t)}})}(q(n),function(n){return _({keywords:[],category:"user"},n)})}function h(e,o,n){var r=k(A.none()),u=k(A.none());e.on("init",function(){x.load(n,o).then(function(n){var t=v(e);!function(n){var o={},i=[];y(n,function(n,t){var e={title:t,keywords:n.keywords,"char":n["char"],category:p(I,n.category)},r=o[e.category]!==undefined?o[e.category]:[];o[e.category]=r.concat([e]),i.push(e)}),r.set(A.some(o)),u.set(A.some(i))}(_(n,t))},function(n){l.console.log("Failed to load emoticons: "+n),r.set(A.some({})),u.set(A.some([]))})});var i=function(){return u.get().getOr([])},c=function(){return r.get().isSome()&&u.get().isSome()};return{listCategories:function(){return[z].concat(P(r.get().getOr({})))},hasLoaded:c,waitForLoad:function(){return c()?N.resolve(!0):new N(function(n,t){var e=15,r=L.setInterval(function(){c()?(L.clearInterval(r),n(!0)):--e<0&&(l.console.log("Could not load emojis from url: "+o),L.clearInterval(r),t(!1))},100)})},listAll:i,listCategory:function(t){return t===z?i():r.get().bind(function(n){return A.from(n[t])}).getOr([])}}}var b,w,O=function(e){function n(){return o}function t(n){return n(e)}var r=i(e),o={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:u,isNone:c,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:n,orThunk:n,map:function(n){return O(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(c,function(n){return t(e,n)})}};return o},A={some:O,none:t,from:function(n){return null===n||n===undefined?a:O(n)}},j=(b="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)===b}),C=Array.prototype.slice,k=(j(Array.from)&&Array.from,function(n){function t(){return e}var e=n;return{get:t,set:function(n){e=n},clone:function(){return k(t())}}}),T=Object.prototype.hasOwnProperty,_=(w=function(n,t){return t},function(){for(var n=new Array(arguments.length),t=0;t<n.length;t++)n[t]=arguments[t];if(0===n.length)throw new Error("Can't merge zero objects");for(var e={},r=0;r<n.length;r++){var o=n[r];for(var i in o)T.call(o,i)&&(e[i]=w(e[i],o[i]))}return e}),P=Object.keys,D=Object.hasOwnProperty,S=function(n,r){var o={};return y(n,function(n,t){var e=r(n,t);o[e.k]=e.v}),o},x=tinymce.util.Tools.resolve("tinymce.Resource"),L=tinymce.util.Tools.resolve("tinymce.util.Delay"),N=tinymce.util.Tools.resolve("tinymce.util.Promise"),E=function(n,t){return n.getParam("emoticons_database_url",t+"/js/emojis"+n.suffix+".js")},F=function(n){return n.getParam("emoticons_database_id","tinymce.plugins.emoticons","string")},q=function(n){return n.getParam("emoticons_append",{},"object")},z="All",I={symbols:"Symbols",people:"People",animals_and_nature:"Animals and Nature",food_and_drink:"Food and Drink",activity:"Activity",travel_and_places:"Travel and Places",objects:"Objects",flags:"Flags",user:"User Defined"},M="pattern",U=function(e,i){function n(){return{title:"Emoticons",size:"normal",body:{type:"tabpanel",tabs:function(n,t){for(var e=n.length,r=new Array(e),o=0;o<e;o++){var i=n[o];r[o]=t(i,o)}return r}(i.listCategories(),function(n){return{title:n,name:n,items:[o,c]}})},initialData:t,onTabChange:function(n,t){u.set(t.newTabName),r.throttle(n)},onChange:r.throttle,onAction:function(n,t){"results"===t.name&&(function(n,t){n.insertContent(t)}(e,t.value),n.close())},buttons:[{type:"cancel",text:"Close",primary:!0}]}}var t={pattern:"",results:d(i.listAll(),"",A.some(300))},u=k(z),r=function(e,r){var o=null;return{cancel:function(){null!==o&&(l.clearTimeout(o),o=null)},throttle:function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];null!==o&&l.clearTimeout(o),o=l.setTimeout(function(){e.apply(null,n),o=null},r)}}}(function(n){!function(n){var t=n.getData(),e=u.get(),r=i.listCategory(e),o=d(r,t[M],e===z?A.some(300):A.none());n.setData({results:o})}(n)},200),o={label:"Search",type:"input",name:M},c={type:"collection",name:"results"},a=e.windowManager.open(n());a.focus(M),i.hasLoaded()||(a.block("Loading emoticons..."),i.waitForLoad().then(function(){a.redial(n()),r.throttle(a),a.focus(M),a.unblock()})["catch"](function(n){a.redial({title:"Emoticons",body:{type:"panel",items:[{type:"alertbanner",level:"error",icon:"warning",text:"<p>Could not load emoticons</p>"}]},buttons:[{type:"cancel",text:"Close",primary:!0}],initialData:{pattern:"",results:[]}}),a.focus(M),a.unblock()}))},R=function(n,t){function e(){return U(n,t)}n.ui.registry.addButton("emoticons",{tooltip:"Emoticons",icon:"emoji",onAction:e}),n.ui.registry.addMenuItem("emoticons",{text:"Emoticons...",icon:"emoji",onAction:e})};!function B(){r.add("emoticons",function(n,t){var e=E(n,t),r=F(n),o=h(n,e,r);R(n,o),function(r,o){r.ui.registry.addAutocompleter("emoticons",{ch:":",columns:"auto",minChars:2,fetch:function(t,e){return o.waitForLoad().then(function(){var n=o.listAll();return d(n,t,A.some(e))})},onAction:function(n,t,e){r.selection.setRng(t),r.insertContent(e),n.hide()}})}(n,o)})}()}(window);
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
|
-
!function(m){"use strict";var o,i=function(
|
9
|
+
!function(m){"use strict";function f(t){return e({validate:!1,root_name:"#document"}).parse(t)}function g(t){return t.replace(/<\/?[A-Z]+/g,function(t){return t.toLowerCase()})}var o,i=function(t){function e(){return n}var n=t;return{get:e,set:function(t){n=t},clone:function(){return i(e())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),p=tinymce.util.Tools.resolve("tinymce.util.Tools"),e=tinymce.util.Tools.resolve("tinymce.html.DomParser"),h=tinymce.util.Tools.resolve("tinymce.html.Node"),y=tinymce.util.Tools.resolve("tinymce.html.Serializer"),v=function(t){return t.getParam("fullpage_hide_in_source_view")},r=function(t){return t.getParam("fullpage_default_xml_pi")},a=function(t){return t.getParam("fullpage_default_encoding")},c=function(t){return t.getParam("fullpage_default_font_family")},u=function(t){return t.getParam("fullpage_default_font_size")},s=function(t){return t.getParam("fullpage_default_text_color")},d=function(t){return t.getParam("fullpage_default_title")},_=function(t){return t.getParam("fullpage_default_doctype","<!DOCTYPE html>")},b=f,n=function(t,e){var n,i,l=f(e),r={};function o(t,e){return t.attr(e)||""}return r.fontface=c(t),r.fontsize=u(t),7===(n=l.firstChild).type&&(r.xml_pi=!0,(i=/encoding="([^"]+)"/.exec(n.value))&&(r.docencoding=i[1])),(n=l.getAll("#doctype")[0])&&(r.doctype="<!DOCTYPE"+n.value+">"),(n=l.getAll("title")[0])&&n.firstChild&&(r.title=n.firstChild.value),p.each(l.getAll("meta"),function(t){var e,n=t.attr("name"),i=t.attr("http-equiv");n?r[n.toLowerCase()]=t.attr("content"):"Content-Type"===i&&(e=/charset\s*=\s*(.*)\s*/gi.exec(t.attr("content")))&&(r.docencoding=e[1])}),(n=l.getAll("html")[0])&&(r.langcode=o(n,"lang")||o(n,"xml:lang")),r.stylesheets=[],p.each(l.getAll("link"),function(t){"stylesheet"===t.attr("rel")&&r.stylesheets.push(t.attr("href"))}),(n=l.getAll("body")[0])&&(r.langdir=o(n,"dir"),r.style=o(n,"style"),r.visited_color=o(n,"vlink"),r.link_color=o(n,"link"),r.active_color=o(n,"alink")),r},x=function(t,r,e){var o,n,i,a,l,c=t.dom;function u(t,e,n){t.attr(e,n||undefined)}function s(t){n.firstChild?n.insert(t,n.firstChild):n.append(t)}o=f(e),(n=o.getAll("head")[0])||(a=o.getAll("html")[0],n=new h("head",1),a.firstChild?a.insert(n,a.firstChild,!0):a.append(n)),a=o.firstChild,r.xml_pi?(l='version="1.0"',r.docencoding&&(l+=' encoding="'+r.docencoding+'"'),7!==a.type&&(a=new h("xml",7),o.insert(a,o.firstChild,!0)),a.value=l):a&&7===a.type&&a.remove(),a=o.getAll("#doctype")[0],r.doctype?(a||(a=new h("#doctype",10),r.xml_pi?o.insert(a,o.firstChild):s(a)),a.value=r.doctype.substring(9,r.doctype.length-1)):a&&a.remove(),a=null,p.each(o.getAll("meta"),function(t){"Content-Type"===t.attr("http-equiv")&&(a=t)}),r.docencoding?(a||((a=new h("meta",1)).attr("http-equiv","Content-Type"),a.shortEnded=!0,s(a)),a.attr("content","text/html; charset="+r.docencoding)):a&&a.remove(),a=o.getAll("title")[0],r.title?(a?a.empty():s(a=new h("title",1)),a.append(new h("#text",3)).value=r.title):a&&a.remove(),p.each("keywords,description,author,copyright,robots".split(","),function(t){var e,n,i=o.getAll("meta"),l=r[t];for(e=0;e<i.length;e++)if((n=i[e]).attr("name")===t)return void(l?n.attr("content",l):n.remove());l&&((a=new h("meta",1)).attr("name",t),a.attr("content",l),a.shortEnded=!0,s(a))});var d={};return p.each(o.getAll("link"),function(t){"stylesheet"===t.attr("rel")&&(d[t.attr("href")]=t)}),p.each(r.stylesheets,function(t){d[t]||((a=new h("link",1)).attr({rel:"stylesheet",text:"text/css",href:t}),a.shortEnded=!0,s(a)),delete d[t]}),p.each(d,function(t){t.remove()}),(a=o.getAll("body")[0])&&(u(a,"dir",r.langdir),u(a,"style",r.style),u(a,"vlink",r.visited_color),u(a,"link",r.link_color),u(a,"alink",r.active_color),c.setAttribs(t.getBody(),{style:r.style,dir:r.dir,vLink:r.visited_color,link:r.link_color,aLink:r.active_color})),(a=o.getAll("html")[0])&&(u(a,"lang",r.langcode),u(a,"xml:lang",r.langcode)),n.firstChild||n.remove(),(i=y({validate:!1,indent:!0,indent_before:"head,html,body,meta,title,script,link,style",indent_after:"head,html,body,meta,title,script,link,style"}).serialize(o)).substring(0,i.indexOf("</body>"))},C=Object.prototype.hasOwnProperty,k=(o=function(t,e){return e},function(){for(var t=new Array(arguments.length),e=0;e<t.length;e++)t[e]=arguments[e];if(0===t.length)throw new Error("Can't merge zero objects");for(var n={},i=0;i<t.length;i++){var l=t[i];for(var r in l)C.call(l,r)&&(n[r]=o(n[r],l[r]))}return n}),l=function(i,l){var r=n(i,l.get()),t=k({title:"",keywords:"",description:"",robots:"",author:"",docencoding:""},r);i.windowManager.open({title:"Metadata and Document Properties",size:"normal",body:{type:"panel",items:[{name:"title",type:"input",label:"Title"},{name:"keywords",type:"input",label:"Keywords"},{name:"description",type:"input",label:"Description"},{name:"robots",type:"input",label:"Robots"},{name:"author",type:"input",label:"Author"},{name:"docencoding",type:"input",label:"Encoding"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:t,onSubmit:function(t){var e=t.getData(),n=x(i,p.extend(r,e),l.get());l.set(n),t.close()}})},w=function(t,e){t.addCommand("mceFullPageProperties",function(){l(t,e)})},A=function(t,e){return p.each(t,function(t){e=e.replace(t,function(t){return"\x3c!--mce:protected "+escape(t)+"--\x3e"})}),e},P=function(t){return t.replace(/<!--mce:protected ([\s\S]*?)-->/g,function(t,e){return unescape(e)})},T=p.each,O=function(t){var e,n="",i="";if(r(t)){var l=a(t);n+='<?xml version="1.0" encoding="'+(l||"ISO-8859-1")+'" ?>\n'}return n+=_(t),n+="\n<html>\n<head>\n",(e=d(t))&&(n+="<title>"+e+"</title>\n"),(e=a(t))&&(n+='<meta http-equiv="Content-Type" content="text/html; charset='+e+'" />\n'),(e=c(t))&&(i+="font-family: "+e+";"),(e=u(t))&&(i+="font-size: "+e+";"),(e=s(t))&&(i+="color: "+e+";"),n+="</head>\n<body"+(i?' style="'+i+'"':"")+">\n"},D=function(e,n,i){e.on("BeforeSetContent",function(t){!function(t,e,n,i){var l,r,o,a,c="",u=t.dom;if(!(i.selection||(o=A(t.settings.protect,i.content),"raw"===i.format&&e.get()||i.source_view&&v(t)))){0!==o.length||i.source_view||(o=p.trim(e.get())+"\n"+p.trim(o)+"\n"+p.trim(n.get())),-1!==(l=(o=o.replace(/<(\/?)BODY/gi,"<$1body")).indexOf("<body"))?(l=o.indexOf(">",l),e.set(g(o.substring(0,l+1))),-1===(r=o.indexOf("</body",l))&&(r=o.length),i.content=p.trim(o.substring(l+1,r)),n.set(g(o.substring(r)))):(e.set(O(t)),n.set("\n</body>\n</html>")),a=b(e.get()),T(a.getAll("style"),function(t){t.firstChild&&(c+=t.firstChild.value)});var s=a.getAll("body")[0];s&&u.setAttribs(t.getBody(),{style:s.attr("style")||"",dir:s.attr("dir")||"",vLink:s.attr("vlink")||"",link:s.attr("link")||"",aLink:s.attr("alink")||""}),u.remove("fullpage_styles");var d=t.getDoc().getElementsByTagName("head")[0];if(c)u.add(d,"style",{id:"fullpage_styles"}).appendChild(m.document.createTextNode(c));var f={};p.each(d.getElementsByTagName("link"),function(t){"stylesheet"===t.rel&&t.getAttribute("data-mce-fullpage")&&(f[t.href]=t)}),p.each(a.getAll("link"),function(t){var e=t.attr("href");if(!e)return!0;f[e]||"stylesheet"!==t.attr("rel")||u.add(d,"link",{rel:"stylesheet",text:"text/css",href:e,"data-mce-fullpage":"1"}),delete f[e]}),p.each(f,function(t){t.parentNode.removeChild(t)})}}(e,n,i,t)}),e.on("GetContent",function(t){!function(t,e,n,i){i.selection||i.source_view&&v(t)||(i.content=P(p.trim(e)+"\n"+p.trim(i.content)+"\n"+p.trim(n)))}(e,n.get(),i.get(),t)})},E=function(t){t.ui.registry.addButton("fullpage",{tooltip:"Metadata and document properties",icon:"document-properties",onAction:function(){t.execCommand("mceFullPageProperties")}}),t.ui.registry.addMenuItem("fullpage",{text:"Metadata and document properties",icon:"document-properties",onAction:function(){t.execCommand("mceFullPageProperties")}})};!function z(){t.add("fullpage",function(t){var e=i(""),n=i("");w(t,e),E(t),D(t,e,n)})}()}(window);
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
|
-
!function(
|
9
|
+
!function(a){"use strict";function e(){}function d(e){return function(){return e}}function n(){return c}var r,t=function(e){function n(){return r}var r=e;return{get:n,set:function(e){r=e},clone:function(){return t(n())}}},o=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(e){return{isFullscreen:function(){return null!==e.get()}}},u=d(!1),s=d(!0),c=(r={fold:function(e,n){return e()},is:u,isSome:u,isNone:s,getOr:m,getOrThunk:l,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:d(null),getOrUndefined:d(undefined),or:m,orThunk:l,map:n,each:e,bind:n,exists:u,forall:s,filter:n,equals:f,equals_:f,toArray:function(){return[]},toString:d("none()")},Object.freeze&&Object.freeze(r),r);function f(e){return e.isNone()}function l(e){return e()}function m(e){return e}function h(n){return function(e){return function(e){if(null===e)return"null";var n=typeof e;return"object"==n&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":n}(e)===n}}function g(e,n){return-1!==e.indexOf(n)}function v(e,n,r){if(!D(r))throw a.console.error("Invalid call to CSS.set. Property ",n,":: Value ",r,":: Element ",e),new Error("CSS value must be a string: "+r);!function(e){return e.style!==undefined&&F(e.style.getPropertyValue)}(e)||e.style.setProperty(n,r)}function O(e,n){var r=e.dom();!function(e,n){for(var r=R(e),t=0,o=r.length;t<o;t++){var i=r[t];n(e[i],i)}}(n,function(e,n){v(r,n,e)})}function S(e,n){var r=function(e,n){for(var r=0;r<e.length;r++){var t=e[r];if(t.test(n))return t}return undefined}(e,n);if(!r)return{major:0,minor:0};function t(e){return Number(n.replace(r,"$"+e))}return j(t(1),t(2))}function w(e,n){return function(){return n===e}}function x(e,n){return function(){return n===e}}function E(e,n){var r=String(n).toLowerCase();return function(e,n){for(var r=0,t=e.length;r<t;r++){var o=e[r];if(n(o,r))return A.some(o)}return A.none()}(e,function(e){return e.search(r)})}function p(n){return function(e){return g(e,n)}}var N,T,y,C,b=function(r){function e(){return o}function n(e){return e(r)}var t=d(r),o={fold:function(e,n){return n(r)},is:function(e){return r===e},isSome:s,isNone:u,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:e,orThunk:e,map:function(e){return b(e(r))},each:function(e){e(r)},bind:n,exists:n,forall:n,filter:function(e){return e(r)?o:c},toArray:function(){return[r]},toString:function(){return"some("+r+")"},equals:function(e){return e.is(r)},equals_:function(e,n){return e.fold(u,function(e){return n(r,e)})}};return o},A={some:b,none:n,from:function(e){return null===e||e===undefined?c:b(e)}},D=h("string"),F=h("function"),_=Array.prototype.slice,R=(F(Array.from)&&Array.from,Object.keys),M=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:d(e)}},P={fromHtml:function(e,n){var r=(n||a.document).createElement("div");if(r.innerHTML=e,!r.hasChildNodes()||1<r.childNodes.length)throw a.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return M(r.childNodes[0])},fromTag:function(e,n){var r=(n||a.document).createElement(e);return M(r)},fromText:function(e,n){var r=(n||a.document).createTextNode(e);return M(r)},fromDom:M,fromPoint:function(e,n,r){var t=e.dom();return A.from(t.elementFromPoint(n,r)).map(M)}},L=(a.Node.ATTRIBUTE_NODE,a.Node.CDATA_SECTION_NODE,a.Node.COMMENT_NODE,a.Node.DOCUMENT_NODE,a.Node.DOCUMENT_TYPE_NODE,a.Node.DOCUMENT_FRAGMENT_NODE,a.Node.ELEMENT_NODE,a.Node.TEXT_NODE,a.Node.PROCESSING_INSTRUCTION_NODE,a.Node.ENTITY_REFERENCE_NODE,a.Node.ENTITY_NODE,a.Node.NOTATION_NODE,"undefined"!=typeof a.window?a.window:Function("return this;")(),tinymce.util.Tools.resolve("tinymce.dom.DOMUtils")),k=function(e,n){e.fire("FullscreenStateChanged",{state:n})},I=function(){return j(0,0)},j=function(e,n){return{major:e,minor:n}},H={nu:j,detect:function(e,n){var r=String(n).toLowerCase();return 0===e.length?I():S(e,r)},unknown:I},W="Firefox",U=function(e){var n=e.current;return{current:n,version:e.version,isEdge:w("Edge",n),isChrome:w("Chrome",n),isIE:w("IE",n),isOpera:w("Opera",n),isFirefox:w(W,n),isSafari:w("Safari",n)}},q={unknown:function(){return U({current:undefined,version:H.unknown()})},nu:U,edge:d("Edge"),chrome:d("Chrome"),ie:d("IE"),opera:d("Opera"),firefox:d(W),safari:d("Safari")},B="Windows",V="Android",X="Solaris",z="FreeBSD",Y=function(e){var n=e.current;return{current:n,version:e.version,isWindows:x(B,n),isiOS:x("iOS",n),isAndroid:x(V,n),isOSX:x("OSX",n),isLinux:x("Linux",n),isSolaris:x(X,n),isFreeBSD:x(z,n)}},G={unknown:function(){return Y({current:undefined,version:H.unknown()})},nu:Y,windows:d(B),ios:d("iOS"),android:d(V),linux:d("Linux"),osx:d("OSX"),solaris:d(X),freebsd:d(z)},$=function(e,r){return E(e,r).map(function(e){var n=H.detect(e.versionRegexes,r);return{current:e.name,version:n}})},J=function(e,r){return E(e,r).map(function(e){var n=H.detect(e.versionRegexes,r);return{current:e.name,version:n}})},K=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Q=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return g(e,"edge/")&&g(e,"chrome")&&g(e,"safari")&&g(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,K],search:function(e){return g(e,"chrome")&&!g(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return g(e,"msie")||g(e,"trident")}},{name:"Opera",versionRegexes:[K,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:p("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:p("firefox")},{name:"Safari",versionRegexes:[K,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(g(e,"safari")||g(e,"mobile/"))&&g(e,"applewebkit")}}],Z=[{name:"Windows",search:p("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return g(e,"iphone")||g(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:p("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:p("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:p("linux"),versionRegexes:[]},{name:"Solaris",search:p("sunos"),versionRegexes:[]},{name:"FreeBSD",search:p("freebsd"),versionRegexes:[]}],ee={browsers:d(Q),oses:d(Z)},ne=function(e){var n=ee.browsers(),r=ee.oses(),t=$(n,e).fold(q.unknown,q.nu),o=J(r,e).fold(G.unknown,G.nu);return{browser:t,os:o,deviceType:function(e,n,r){var t=e.isiOS()&&!0===/ipad/i.test(r),o=e.isiOS()&&!t,i=e.isAndroid()&&3===e.version.major,u=e.isAndroid()&&4===e.version.major,s=t||i||u&&!0===/mobile/i.test(r),c=e.isiOS()||e.isAndroid(),a=c&&!s,f=n.isSafari()&&e.isiOS()&&!1===/safari/i.test(r);return{isiPad:d(t),isiPhone:d(o),isTablet:d(s),isPhone:d(a),isTouch:d(c),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:d(f)}}(o,t,e)}},re={detect:(y=!(N=function(){var e=a.navigator.userAgent;return ne(e)}),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return y||(y=!0,T=N.apply(null,e)),T})},te=L.DOM,oe=a.window.visualViewport,ie=re.detect().browser.isSafari()&&oe!==undefined?(C=function(){var n=t(A.none());return{clear:function(){n.set(A.none())},set:function(e){n.set(A.some(e))},isSet:function(){return n.get().isSome()},on:function(e){n.get().each(e)}}}(),{bind:function(e){C.set(e),ue(),oe.addEventListener("resize",ue),oe.addEventListener("scroll",ue)},unbind:function(){C.on(function(){oe.removeEventListener("scroll",ue),oe.removeEventListener("resize",ue)}),C.clear()}}):{bind:e,unbind:e};function ue(){a.window.requestAnimationFrame(function(){C.on(function(e){return O(e,{top:oe.offsetTop+"px",left:oe.offsetLeft+"px",height:oe.height+"px",width:oe.width+"px"})})})}function se(r,t){return function(n){n.setActive(null!==t.get());function e(e){return n.setActive(e.state)}return r.on("FullscreenStateChanged",e),function(){return r.off("FullscreenStateChanged",e)}}}var ce=function(e,n){var r,t,o,i=a.document.body,u=a.document.documentElement,s=n.get();if(r=(t=e.getContainer()).style,o=e.getContentAreaContainer().firstChild.style,s)o.width=s.iframeWidth,o.height=s.iframeHeight,s.containerWidth&&(r.width=s.containerWidth),s.containerHeight&&(r.height=s.containerHeight),te.removeClass(i,"tox-fullscreen"),te.removeClass(u,"tox-fullscreen"),te.removeClass(t,"tox-fullscreen"),function(e){a.window.scrollTo(e.x,e.y)}(s.scrollPos),n.set(null),k(e,!1),ie.unbind(),e.off("remove",ie.unbind);else{var c={scrollPos:function(){var e=te.getViewPort();return{x:e.x,y:e.y}}(),containerWidth:r.width,containerHeight:r.height,iframeWidth:o.width,iframeHeight:o.height};o.width=o.height="100%",r.width=r.height="",te.addClass(i,"tox-fullscreen"),te.addClass(u,"tox-fullscreen"),te.addClass(t,"tox-fullscreen"),ie.bind(P.fromDom(t)),e.on("remove",ie.unbind),n.set(c),k(e,!0)}},ae=function(e,n){e.addCommand("mceFullScreen",function(){ce(e,n)})},fe=function(e,n){e.ui.registry.addToggleMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Meta+Shift+F",onAction:function(){return e.execCommand("mceFullScreen")},onSetup:se(e,n)}),e.ui.registry.addToggleButton("fullscreen",{tooltip:"Fullscreen",icon:"fullscreen",onAction:function(){return e.execCommand("mceFullScreen")},onSetup:se(e,n)})};!function de(){o.add("fullscreen",function(e){var n=t(null);return e.settings.inline||(ae(e,n),fe(e,n),e.addShortcut("Meta+Shift+F","","mceFullScreen")),i(n)})}()}(window);
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
|
-
!function(){"use strict";var r=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return r(n())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(e,t){e.addCommand("mceHelp",t)},s=function(e,t){e.ui.registry.addButton("help",{icon:"help",tooltip:"Help",onAction:t}),e.ui.registry.addMenuItem("help",{text:"Help",icon:"help",shortcut:"Alt+0",onAction:t})},l=function(){return(l=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},t=function(e){return function(){return e}};function p(o){for(var a=[],e=1;e<arguments.length;e++)a[e-1]=arguments[e];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=a.concat(e);return o.apply(null,n)}}var n,o,a,c,u,h,m=t(!1),d=t(!0),f=m,g=d,y=function(){return b},b=(c={fold:function(e,t){return e()},is:f,isSome:f,isNone:g,getOr:a=function(e){return e},getOrThunk:o=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:a,orThunk:o,map:y,ap:y,each:function(){},bind:y,flatten:y,exists:f,forall:g,filter:y,equals:n=function(e){return e.isNone()},equals_:n,toArray:function(){return[]},toString:t("none()")},Object.freeze&&Object.freeze(c),c),k=function(n){var e=function(){return n},t=function(){return a},o=function(e){return e(n)},a={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:g,isNone:f,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return k(e(n))},ap:function(e){return e.fold(y,function(e){return k(e(n))})},each:function(e){e(n)},bind:o,flatten:e,exists:o,forall:o,filter:function(e){return e(n)?a:b},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(f,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return a},v={some:k,none:y,from:function(e){return null===e||e===undefined?b:k(e)}},w=(u="function",function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(e)===u}),A=Array.prototype.slice,C=(h=Array.prototype.indexOf)===undefined?function(e,t){return P(e,t)}:function(e,t){return h.call(e,t)},T=function(e,t){return-1<C(e,t)},x=function(e,t){for(var n=e.length,o=new Array(n),a=0;a<n;a++){var r=e[a];o[a]=t(r,a,e)}return o},P=function(e,t){for(var n=0,o=e.length;n<o;++n)if(e[n]===t)return n;return-1},M=(w(Array.from)&&Array.from,Object.keys),O=Object.hasOwnProperty,F=function(e,t){return O.call(e,t)},S=[{shortcuts:["Meta + B"],action:"Bold"},{shortcuts:["Meta + I"],action:"Italic"},{shortcuts:["Meta + U"],action:"Underline"},{shortcuts:["Meta + A"],action:"Select all"},{shortcuts:["Meta + Y","Meta + Shift + Z"],action:"Redo"},{shortcuts:["Meta + Z"],action:"Undo"},{shortcuts:["Access + 1"],action:"Header 1"},{shortcuts:["Access + 2"],action:"Header 2"},{shortcuts:["Access + 3"],action:"Header 3"},{shortcuts:["Access + 4"],action:"Header 4"},{shortcuts:["Access + 5"],action:"Header 5"},{shortcuts:["Access + 6"],action:"Header 6"},{shortcuts:["Access + 7"],action:"Paragraph"},{shortcuts:["Access + 8"],action:"Div"},{shortcuts:["Access + 9"],action:"Address"},{shortcuts:["Alt + 0"],action:"Open help dialog"},{shortcuts:["Alt + F9"],action:"Focus to menubar"},{shortcuts:["Alt + F10"],action:"Focus to toolbar"},{shortcuts:["Alt + F11"],action:"Focus to element path"},{shortcuts:["Ctrl + F9"],action:"Focus to contextual toolbar"},{shortcuts:["Shift + Enter"],action:"Open popup menu for split buttons"},{shortcuts:["Meta + K"],action:"Insert link (if link plugin activated)"},{shortcuts:["Meta + S"],action:"Save (if save plugin activated)"},{shortcuts:["Meta + F"],action:"Find (if searchreplace plugin activated)"},{shortcuts:["Meta + Shift + F"],action:"Switch to or from fullscreen mode"}],E=tinymce.util.Tools.resolve("tinymce.Env"),I=function(e){var n=E.mac?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl ",access:"Shift + Alt "},t=e.split("+"),o=x(t,function(e){var t=e.toLowerCase().trim();return F(n,t)?n[t]:e});return E.mac?o.join("").replace(/\s/,""):o.join("+")},_=function(){return{name:"shortcuts",title:"Handy Shortcuts",items:[{type:"table",header:["Action","Shortcut"],cells:x(S,function(e){var t=x(e.shortcuts,I).join(" or ");return[e.action,t]})}]}},j=function(e,a){return e.replace(/\$\{([^{}]*)\}/g,function(e,t){var n,o=a[t];return"string"===(n=typeof o)||"number"===n?o.toString():e})},H=tinymce.util.Tools.resolve("tinymce.util.I18n"),U=[{key:"advlist",name:"Advanced List"},{key:"anchor",name:"Anchor"},{key:"autolink",name:"Autolink"},{key:"autoresize",name:"Autoresize"},{key:"autosave",name:"Autosave"},{key:"bbcode",name:"BBCode"},{key:"charmap",name:"Character Map"},{key:"code",name:"Code"},{key:"codesample",name:"Code Sample"},{key:"colorpicker",name:"Color Picker"},{key:"directionality",name:"Directionality"},{key:"emoticons",name:"Emoticons"},{key:"fullpage",name:"Full Page"},{key:"fullscreen",name:"Full Screen"},{key:"help",name:"Help"},{key:"hr",name:"Horizontal Rule"},{key:"image",name:"Image"},{key:"imagetools",name:"Image Tools"},{key:"importcss",name:"Import CSS"},{key:"insertdatetime",name:"Insert Date/Time"},{key:"legacyoutput",name:"Legacy Output"},{key:"link",name:"Link"},{key:"lists",name:"Lists"},{key:"media",name:"Media"},{key:"nonbreaking",name:"Nonbreaking"},{key:"noneditable",name:"Noneditable"},{key:"pagebreak",name:"Page Break"},{key:"paste",name:"Paste"},{key:"preview",name:"Preview"},{key:"print",name:"Print"},{key:"save",name:"Save"},{key:"searchreplace",name:"Search and Replace"},{key:"spellchecker",name:"Spell Checker"},{key:"tabfocus",name:"Tab Focus"},{key:"table",name:"Table"},{key:"template",name:"Template"},{key:"textcolor",name:"Text Color"},{key:"textpattern",name:"Text Pattern"},{key:"toc",name:"Table of Contents"},{key:"visualblocks",name:"Visual Blocks"},{key:"visualchars",name:"Visual Characters"},{key:"wordcount",name:"Word Count"},{key:"advcode",name:"Advanced Code Editor*"},{key:"formatpainter",name:"Format Painter*"},{key:"powerpaste",name:"PowerPaste*"},{key:"tinydrive",name:"Tiny Drive*"},{key:"tinymcespellchecker",name:"Spell Checker Pro*"},{key:"a11ychecker",name:"Accessibility Checker*"},{key:"linkchecker",name:"Link Checker*"},{key:"mentions",name:"Mentions*"},{key:"mediaembed",name:"Enhanced Media Embed*"},{key:"checklist",name:"Checklist*"},{key:"casechange",name:"Case Change*"},{key:"permanentpen",name:"Permanent Pen*"},{key:"pageembed",name:"Page Embed*"},{key:"tinycomments",name:"Tiny Comments*"}],W=function(e){var t,n,o=p(j,'<a href="${url}" target="_blank" rel="noopener">${name}</a>'),a=function(t,n){return function(e,t){for(var n=0,o=e.length;n<o;n++){var a=e[n];if(t(a,n,e))return v.some(a)}return v.none()}(U,function(e){return e.key===n}).fold(function(){var e=t.plugins[n].getMetadata;return"function"==typeof e?o(e()):n},function(e){return o({name:e.name,url:"https://www.tiny.cloud/docs/plugins/"+e.key})})};return{name:"plugins",title:"Plugins",items:[{type:"htmlpanel",presets:"document",html:[(n=e,null==n?"":'<div data-mce-tabstop="1" tabindex="-1">'+(r=n,c=M((i=r).plugins),l=i.settings.forced_plugins===undefined?c:function(e,t){for(var n=[],o=0,a=e.length;o<a;o++){var r=e[o];t(r,o,e)&&n.push(r)}return n}(c,(s=p(T,i.settings.forced_plugins),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!s.apply(null,e)})),u=x(l,function(e){return"<li>"+a(r,e)+"</li>"}),h=u.length,m=u.join(""),"<p><b>"+H.translate(["Plugins installed ({0}):",h])+"</b></p><ul>"+m+"</ul>")+"</div>"),(t=x(["Accessibility Checker","Advanced Code Editor","Case Change","Checklist","Tiny Comments","Tiny Drive","Enhanced Media Embed","Format Painter","Link Checker","Mentions","MoxieManager","Page Embed","Permanent Pen","PowerPaste","Spell Checker Pro"],function(e){return"<li>"+H.translate(e)+"</li>"}).join(""),'<div data-mce-tabstop="1" tabindex="-1"><p><b>'+H.translate("Premium plugins:")+"</b></p><ul>"+t+'<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">'+H.translate("Learn more...")+"</a></li></ul></div>")].join("")}]};var r,i,s,c,l,u,h,m},D=tinymce.util.Tools.resolve("tinymce.EditorManager"),N=function(){var e,t,n='<a href="https://www.tinymce.com/docs/changelog/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">TinyMCE '+(e=D.majorVersion,t=D.minorVersion,0===e.indexOf("@")?"X.X.X":e+"."+t)+"</a>";return{name:"versions",title:"Version",items:[{type:"htmlpanel",html:"<p>"+H.translate(["You are using {0}",n])+"</p>",presets:"document"}]}},L=function(){return{name:"keyboardnav",title:"Keyboard Navigation",items:[{type:"htmlpanel",html:"<h1>Editor UI keyboard navigation</h1>\n\n<h2>Activating keyboard navigation</h2>\n\n<p>The sections of the outer UI of the editor - the menubar, toolbar, sidebar and footer - are all keyboard navigable. As such, there are multiple ways to activate keyboard navigation:</p>\n<ul>\n <li>Focus the menubar: Alt + F9 (Windows) or ⌥F9 (MacOS)</li>\n <li>Focus the toolbar: Alt + F10 (Windows) or ⌥F10 (MacOS)</li>\n <li>Focus the footer: Alt + F11 (Windows) or ⌥F11 (MacOS)</li>\n</ul>\n\n<p>Focusing the menubar or toolbar will start keyboard navigation at the first item in the menubar or toolbar, which will be highlighted with a gray background. Focusing the footer will start keyboard navigation at the first item in the element path, which will be highlighted with an underline. </p>\n\n<h2>Moving between UI sections</h2>\n\n<p>When keyboard navigation is active, pressing tab will move the focus to the next major section of the UI, where applicable. These sections are:</p>\n<ul>\n <li>the menubar</li>\n <li>each group of the toolbar </li>\n <li>the sidebar</li>\n <li>the element path in the footer </li>\n <li>the wordcount toggle button in the footer </li>\n <li>the branding link in the footer </li>\n</ul>\n\n<p>Pressing shift + tab will move backwards through the same sections, except when moving from the footer to the toolbar. Focusing the element path then pressing shift + tab will move focus to the first toolbar group, not the last.</p>\n\n<h2>Moving within UI sections</h2>\n\n<p>Keyboard navigation within UI sections can usually be achieved using the left and right arrow keys. This includes:</p>\n<ul>\n <li>moving between menus in the menubar</li>\n <li>moving between buttons in a toolbar group</li>\n <li>moving between items in the element path</li>\n</ul>\n\n<p>In all these UI sections, keyboard navigation will cycle within the section. For example, focusing the last button in a toolbar group then pressing right arrow will move focus to the first item in the same toolbar group. </p>\n\n<h1>Executing buttons</h1>\n\n<p>To execute a button, navigate the selection to the desired button and hit space or enter.</p>\n\n<h1>Opening, navigating and closing menus</h1>\n\n<p>When focusing a menubar button or a toolbar button with a menu, pressing space, enter or down arrow will open the menu. When the menu opens the first item will be selected. To move up or down the menu, press the up or down arrow key respectively. This is the same for submenus, which can also be opened and closed using the left and right arrow keys.</p>\n\n<p>To close any active menu, hit the escape key. When a menu is closed the selection will be restored to its previous selection. This also works for closing submenus.</p>\n\n<h1>Context toolbars and menus</h1>\n\n<p>To focus an open context toolbar such as the table context toolbar, press Ctrl + F9 (Windows) or ⌃F9 (MacOS).</p>\n\n<p>Context toolbar navigation is the same as toolbar navigation, and context menu navigation is the same as standard menu navigation.</p>\n\n<h1>Dialog navigation</h1>\n\n<p>There are two types of dialog UIs in TinyMCE: tabbed dialogs and non-tabbed dialogs.</p>\n\n<p>When a non-tabbed dialog is opened, the first interactive component in the dialog will be focused. Users can navigate between interactive components by pressing tab. This includes any footer buttons. Navigation will cycle back to the first dialog component if tab is pressed while focusing the last component in the dialog. Pressing shift + tab will navigate backwards.</p>\n\n<p>When a tabbed dialog is opened, the first button in the tab menu is focused. Pressing tab will navigate to the first interactive component in that tab, and will cycle through the tab\u2019s components, the footer buttons, then back to the tab button. To switch to another tab, focus the tab button for the current tab, then use the arrow keys to cycle through the tab buttons.</p>"}]}},B=function(e){var t,n=M(e);return(-1===(t=C(n,"versions"))?v.none():v.some(t)).each(function(e){n.splice(e,1),n.push("versions")}),{tabs:e,names:n}},z=function(e,t){var n,o,a=_(),r=L(),i=W(e),s=N(),c=l(((n={})[a.name]=a,n[r.name]=r,n[i.name]=i,n[s.name]=s,n),t.get());return(o=e,v.from(o.getParam("help_tabs"))).fold(function(){return B(c)},function(e){return t=c,n={},o=x(e,function(e){return"string"==typeof e?(F(t,e)&&(n[e]=t[e]),e):(n[e.name]=e).name}),{tabs:n,names:o};var t,n,o})},V=function(a,r){return function(){var e=z(a,r),o=e.tabs,t=e.names,n={type:"tabpanel",tabs:function(e){for(var t=[],n=function(e){t.push(e)},o=0;o<e.length;o++)e[o].each(n);return t}(x(t,function(e){return F(t=o,n=e)?v.from(t[n]):v.none();var t,n}))};a.windowManager.open({title:"Help",size:"medium",body:n,buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{}})}};!function q(){e.add("help",function(e){var n,t=r({}),o=(n=t,{addTab:function(e){var t=n.get();t[e.name]=e,n.set(t)}}),a=V(e,t);return s(e,a),i(e,a),e.shortcuts.add("Alt+0","Open help dialog","mceHelp"),o})}()}();
|
9
|
+
!function(){"use strict";function e(){}function a(e){return function(){return e}}var r=function(e){function t(){return n}var n=e;return{get:t,set:function(e){n=e},clone:function(){return r(t())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(e,t){e.addCommand("mceHelp",t)},s=function(e,t){e.ui.registry.addButton("help",{icon:"help",tooltip:"Help",onAction:t}),e.ui.registry.addMenuItem("help",{text:"Help",icon:"help",shortcut:"Alt+0",onAction:t})},c=function(){return(c=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function l(o){for(var r=[],e=1;e<arguments.length;e++)r[e-1]=arguments[e];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=r.concat(e);return o.apply(null,n)}}function n(){return m}var o,u=a(!1),h=a(!0),m=(o={fold:function(e,t){return e()},is:u,isSome:u,isNone:h,getOr:f,getOrThunk:d,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:a(null),getOrUndefined:a(undefined),or:f,orThunk:d,map:n,each:e,bind:n,exists:u,forall:h,filter:n,equals:p,equals_:p,toArray:function(){return[]},toString:a("none()")},Object.freeze&&Object.freeze(o),o);function p(e){return e.isNone()}function d(e){return e()}function f(e){return e}function g(e,t){return O.call(e,t)}function y(e,t){return-1<g(e,t)}function b(e,t){for(var n=e.length,o=new Array(n),r=0;r<n;r++){var a=e[r];o[r]=t(a,r)}return o}function k(e,o){return e.replace(/\$\{([^{}]*)\}/g,function(e,t){var n=o[t];return function(e){var t=typeof e;return"string"==t||"number"==t}(n)?n.toString():e})}function v(e){var t=F(e);return function(e,t){var n=g(e,t);return-1===n?x.none():x.some(n)}(t,"versions").each(function(e){t.splice(e,1),t.push("versions")}),{tabs:e,names:t}}function w(e,t){var n,o=H(),r=B(),a=D(e),i=L(),s=c(((n={})[o.name]=o,n[r.name]=r,n[a.name]=a,n[i.name]=i,n),t.get());return function(e){return x.from(e.getParam("help_tabs"))}(e).fold(function(){return v(s)},function(e){return function(e,t){var n={},o=b(e,function(e){return"string"==typeof e?(E(t,e)&&(n[e]=t[e]),e):(n[e.name]=e).name});return{tabs:n,names:o}}(e,s)})}function A(r,a){return function(){var e=w(r,a),t=e.tabs,n=e.names,o={type:"tabpanel",tabs:function(e){for(var t=[],n=function(e){t.push(e)},o=0;o<e.length;o++)e[o].each(n);return t}(b(n,function(e){return function(e,t){return E(e,t)?x.from(e[t]):x.none()}(t,e)}))};r.windowManager.open({title:"Help",size:"medium",body:o,buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{}})}}var C,T=function(n){function e(){return r}function t(e){return e(n)}var o=a(n),r={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:h,isNone:u,getOr:o,getOrThunk:o,getOrDie:o,getOrNull:o,getOrUndefined:o,or:e,orThunk:e,map:function(e){return T(e(n))},each:function(e){e(n)},bind:t,exists:t,forall:t,filter:function(e){return e(n)?r:m},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(u,function(e){return t(n,e)})}};return r},x={some:T,none:n,from:function(e){return null===e||e===undefined?m:T(e)}},P=(C="function",function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"==t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(e)===C}),M=Array.prototype.slice,O=Array.prototype.indexOf,F=(P(Array.from)&&Array.from,Object.keys),S=Object.hasOwnProperty,E=function(e,t){return S.call(e,t)},I=[{shortcuts:["Meta + B"],action:"Bold"},{shortcuts:["Meta + I"],action:"Italic"},{shortcuts:["Meta + U"],action:"Underline"},{shortcuts:["Meta + A"],action:"Select all"},{shortcuts:["Meta + Y","Meta + Shift + Z"],action:"Redo"},{shortcuts:["Meta + Z"],action:"Undo"},{shortcuts:["Access + 1"],action:"Header 1"},{shortcuts:["Access + 2"],action:"Header 2"},{shortcuts:["Access + 3"],action:"Header 3"},{shortcuts:["Access + 4"],action:"Header 4"},{shortcuts:["Access + 5"],action:"Header 5"},{shortcuts:["Access + 6"],action:"Header 6"},{shortcuts:["Access + 7"],action:"Paragraph"},{shortcuts:["Access + 8"],action:"Div"},{shortcuts:["Access + 9"],action:"Address"},{shortcuts:["Alt + 0"],action:"Open help dialog"},{shortcuts:["Alt + F9"],action:"Focus to menubar"},{shortcuts:["Alt + F10"],action:"Focus to toolbar"},{shortcuts:["Alt + F11"],action:"Focus to element path"},{shortcuts:["Ctrl + F9"],action:"Focus to contextual toolbar"},{shortcuts:["Shift + Enter"],action:"Open popup menu for split buttons"},{shortcuts:["Meta + K"],action:"Insert link (if link plugin activated)"},{shortcuts:["Meta + S"],action:"Save (if save plugin activated)"},{shortcuts:["Meta + F"],action:"Find (if searchreplace plugin activated)"},{shortcuts:["Meta + Shift + F"],action:"Switch to or from fullscreen mode"}],_=tinymce.util.Tools.resolve("tinymce.Env"),j=function(e){var n=_.mac?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl ",access:"Shift + Alt "},t=e.split("+"),o=b(t,function(e){var t=e.toLowerCase().trim();return E(n,t)?n[t]:e});return _.mac?o.join("").replace(/\s/,""):o.join("+")},H=function(){return{name:"shortcuts",title:"Handy Shortcuts",items:[{type:"table",header:["Action","Shortcut"],cells:b(I,function(e){var t=b(e.shortcuts,j).join(" or ");return[e.action,t]})}]}},U=tinymce.util.Tools.resolve("tinymce.util.I18n"),W=[{key:"advlist",name:"Advanced List"},{key:"anchor",name:"Anchor"},{key:"autolink",name:"Autolink"},{key:"autoresize",name:"Autoresize"},{key:"autosave",name:"Autosave"},{key:"bbcode",name:"BBCode"},{key:"charmap",name:"Character Map"},{key:"code",name:"Code"},{key:"codesample",name:"Code Sample"},{key:"colorpicker",name:"Color Picker"},{key:"directionality",name:"Directionality"},{key:"emoticons",name:"Emoticons"},{key:"fullpage",name:"Full Page"},{key:"fullscreen",name:"Full Screen"},{key:"help",name:"Help"},{key:"hr",name:"Horizontal Rule"},{key:"image",name:"Image"},{key:"imagetools",name:"Image Tools"},{key:"importcss",name:"Import CSS"},{key:"insertdatetime",name:"Insert Date/Time"},{key:"legacyoutput",name:"Legacy Output"},{key:"link",name:"Link"},{key:"lists",name:"Lists"},{key:"media",name:"Media"},{key:"nonbreaking",name:"Nonbreaking"},{key:"noneditable",name:"Noneditable"},{key:"pagebreak",name:"Page Break"},{key:"paste",name:"Paste"},{key:"preview",name:"Preview"},{key:"print",name:"Print"},{key:"save",name:"Save"},{key:"searchreplace",name:"Search and Replace"},{key:"spellchecker",name:"Spell Checker"},{key:"tabfocus",name:"Tab Focus"},{key:"table",name:"Table"},{key:"template",name:"Template"},{key:"textcolor",name:"Text Color"},{key:"textpattern",name:"Text Pattern"},{key:"toc",name:"Table of Contents"},{key:"visualblocks",name:"Visual Blocks"},{key:"visualchars",name:"Visual Characters"},{key:"wordcount",name:"Word Count"},{key:"advcode",name:"Advanced Code Editor*"},{key:"formatpainter",name:"Format Painter*"},{key:"powerpaste",name:"PowerPaste*"},{key:"tinydrive",name:"Tiny Drive*"},{key:"tinymcespellchecker",name:"Spell Checker Pro*"},{key:"a11ychecker",name:"Accessibility Checker*"},{key:"linkchecker",name:"Link Checker*"},{key:"mentions",name:"Mentions*"},{key:"mediaembed",name:"Enhanced Media Embed*"},{key:"checklist",name:"Checklist*"},{key:"casechange",name:"Case Change*"},{key:"permanentpen",name:"Permanent Pen*"},{key:"pageembed",name:"Page Embed*"},{key:"tinycomments",name:"Tiny Comments*"}],D=function(e){function a(t,n){return function(e,t){for(var n=0,o=e.length;n<o;n++){var r=e[n];if(t(r,n))return x.some(r)}return x.none()}(W,function(e){return e.key===n}).fold(function(){var e=t.plugins[n].getMetadata;return"function"==typeof e?o(e()):n},function(e){return o({name:e.name,url:"https://www.tiny.cloud/docs/plugins/"+e.key})})}var t,n,o=l(k,'<a href="${url}" target="_blank" rel="noopener">${name}</a>');return{name:"plugins",title:"Plugins",items:[{type:"htmlpanel",presets:"document",html:[(n=e,null==n?"":'<div data-mce-tabstop="1" tabindex="-1">'+function(t){var e=function(e){var t=F(e.plugins);return e.settings.forced_plugins===undefined?t:function(e,t){for(var n=[],o=0,r=e.length;o<r;o++){var a=e[o];t(a,o)&&n.push(a)}return n}(t,function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!n.apply(null,e)}}(l(y,e.settings.forced_plugins)))}(t),n=b(e,function(e){return"<li>"+a(t,e)+"</li>"}),o=n.length,r=n.join("");return"<p><b>"+U.translate(["Plugins installed ({0}):",o])+"</b></p><ul>"+r+"</ul>"}(n)+"</div>"),(t=b(["Accessibility Checker","Advanced Code Editor","Case Change","Checklist","Tiny Comments","Tiny Drive","Enhanced Media Embed","Format Painter","Link Checker","Mentions","MoxieManager","Page Embed","Permanent Pen","PowerPaste","Spell Checker Pro"],function(e){return"<li>"+U.translate(e)+"</li>"}).join(""),'<div data-mce-tabstop="1" tabindex="-1"><p><b>'+U.translate("Premium plugins:")+"</b></p><ul>"+t+'<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">'+U.translate("Learn more...")+"</a></li></ul></div>")].join("")}]}},N=tinymce.util.Tools.resolve("tinymce.EditorManager"),L=function(){var e,t,n='<a href="https://www.tinymce.com/docs/changelog/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">TinyMCE '+(e=N.majorVersion,t=N.minorVersion,0===e.indexOf("@")?"X.X.X":e+"."+t)+"</a>";return{name:"versions",title:"Version",items:[{type:"htmlpanel",html:"<p>"+U.translate(["You are using {0}",n])+"</p>",presets:"document"}]}},B=function(){return{name:"keyboardnav",title:"Keyboard Navigation",items:[{type:"htmlpanel",html:"<h1>Editor UI keyboard navigation</h1>\n\n<h2>Activating keyboard navigation</h2>\n\n<p>The sections of the outer UI of the editor - the menubar, toolbar, sidebar and footer - are all keyboard navigable. As such, there are multiple ways to activate keyboard navigation:</p>\n<ul>\n <li>Focus the menubar: Alt + F9 (Windows) or ⌥F9 (MacOS)</li>\n <li>Focus the toolbar: Alt + F10 (Windows) or ⌥F10 (MacOS)</li>\n <li>Focus the footer: Alt + F11 (Windows) or ⌥F11 (MacOS)</li>\n</ul>\n\n<p>Focusing the menubar or toolbar will start keyboard navigation at the first item in the menubar or toolbar, which will be highlighted with a gray background. Focusing the footer will start keyboard navigation at the first item in the element path, which will be highlighted with an underline. </p>\n\n<h2>Moving between UI sections</h2>\n\n<p>When keyboard navigation is active, pressing tab will move the focus to the next major section of the UI, where applicable. These sections are:</p>\n<ul>\n <li>the menubar</li>\n <li>each group of the toolbar </li>\n <li>the sidebar</li>\n <li>the element path in the footer </li>\n <li>the wordcount toggle button in the footer </li>\n <li>the branding link in the footer </li>\n</ul>\n\n<p>Pressing shift + tab will move backwards through the same sections, except when moving from the footer to the toolbar. Focusing the element path then pressing shift + tab will move focus to the first toolbar group, not the last.</p>\n\n<h2>Moving within UI sections</h2>\n\n<p>Keyboard navigation within UI sections can usually be achieved using the left and right arrow keys. This includes:</p>\n<ul>\n <li>moving between menus in the menubar</li>\n <li>moving between buttons in a toolbar group</li>\n <li>moving between items in the element path</li>\n</ul>\n\n<p>In all these UI sections, keyboard navigation will cycle within the section. For example, focusing the last button in a toolbar group then pressing right arrow will move focus to the first item in the same toolbar group. </p>\n\n<h1>Executing buttons</h1>\n\n<p>To execute a button, navigate the selection to the desired button and hit space or enter.</p>\n\n<h1>Opening, navigating and closing menus</h1>\n\n<p>When focusing a menubar button or a toolbar button with a menu, pressing space, enter or down arrow will open the menu. When the menu opens the first item will be selected. To move up or down the menu, press the up or down arrow key respectively. This is the same for submenus, which can also be opened and closed using the left and right arrow keys.</p>\n\n<p>To close any active menu, hit the escape key. When a menu is closed the selection will be restored to its previous selection. This also works for closing submenus.</p>\n\n<h1>Context toolbars and menus</h1>\n\n<p>To focus an open context toolbar such as the table context toolbar, press Ctrl + F9 (Windows) or ⌃F9 (MacOS).</p>\n\n<p>Context toolbar navigation is the same as toolbar navigation, and context menu navigation is the same as standard menu navigation.</p>\n\n<h1>Dialog navigation</h1>\n\n<p>There are two types of dialog UIs in TinyMCE: tabbed dialogs and non-tabbed dialogs.</p>\n\n<p>When a non-tabbed dialog is opened, the first interactive component in the dialog will be focused. Users can navigate between interactive components by pressing tab. This includes any footer buttons. Navigation will cycle back to the first dialog component if tab is pressed while focusing the last component in the dialog. Pressing shift + tab will navigate backwards.</p>\n\n<p>When a tabbed dialog is opened, the first button in the tab menu is focused. Pressing tab will navigate to the first interactive component in that tab, and will cycle through the tab\u2019s components, the footer buttons, then back to the tab button. To switch to another tab, focus the tab button for the current tab, then use the arrow keys to cycle through the tab buttons.</p>"}]}};!function z(){t.add("help",function(e){var t=r({}),n=function(n){return{addTab:function(e){var t=n.get();t[e.name]=e,n.set(t)}}}(t),o=A(e,t);return s(e,o),i(e,o),e.shortcuts.add("Alt+0","Open help dialog","mceHelp"),n})}()}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
9
|
!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,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
|
-
!function(s){"use strict";var t,e,n,r,i,o,a,f,u=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=function(){},l=function(t){return function(){return t}},d=function(t){return t},m=l(!1),p=l(!0),g=m,h=p,y=function(){return v},v=(r={fold:function(t,e){return t()},is:g,isSome:g,isNone:h,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:n,orThunk:e,map:y,ap:y,each:function(){},bind:y,flatten:y,exists:g,forall:h,filter:y,equals:t=function(t){return t.isNone()},equals_:t,toArray:function(){return[]},toString:l("none()")},Object.freeze&&Object.freeze(r),r),b=function(n){var t=function(){return n},e=function(){return i},r=function(t){return t(n)},i={fold:function(t,e){return e(n)},is:function(t){return n===t},isSome:h,isNone:g,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:e,orThunk:e,map:function(t){return b(t(n))},ap:function(t){return t.fold(y,function(t){return b(t(n))})},each:function(t){t(n)},bind:r,flatten:t,exists:r,forall:r,filter:function(t){return t(n)?i:v},equals:function(t){return t.is(n)},equals_:function(t,e){return t.fold(g,function(t){return e(n,t)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return i},w={some:b,none:y,from:function(t){return null===t||t===undefined?v:b(t)}},T=function(e){return function(t){return function(t){if(null===t)return"null";var e=typeof t;return"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e}(t)===e}},_=T("string"),U=T("object"),x=T("array"),A=T("boolean"),I=T("function"),S=Array.prototype.slice,D=Array.prototype.push,O=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!x(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);D.apply(e,t[n])}return e},C=(I(Array.from)&&Array.from,function(){return(C=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)}),P={},E={exports:P};i=undefined,o=P,a=E,f=undefined,function(t){"object"==typeof o&&void 0!==a?a.exports=t():"function"==typeof i&&i.amd?i([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=t()}(function(){return function s(o,a,u){function c(e,t){if(!a[e]){if(!o[e]){var n="function"==typeof f&&f;if(!t&&n)return n(e,!0);if(l)return l(e,!0);var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}var i=a[e]={exports:{}};o[e][0].call(i.exports,function(t){return c(o[e][1][t]||t)},i,i.exports,s,o,a,u)}return a[e].exports}for(var l="function"==typeof f&&f,t=0;t<u.length;t++)c(u[t]);return c}({1:[function(t,e,n){var r,i,o=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function c(t){if(r===setTimeout)return setTimeout(t,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(t){r=a}try{i="function"==typeof clearTimeout?clearTimeout:u}catch(t){i=u}}();var l,s=[],f=!1,d=-1;function m(){f&&l&&(f=!1,l.length?s=l.concat(s):d=-1,s.length&&p())}function p(){if(!f){var t=c(m);f=!0;for(var e=s.length;e;){for(l=s,s=[];++d<e;)l&&l[d].run();d=-1,e=s.length}l=null,f=!1,function n(t){if(i===clearTimeout)return clearTimeout(t);if((i===u||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{return i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function g(t,e){this.fun=t,this.array=e}function h(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(new g(t,e)),1!==s.length||f||c(p)},g.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=h,o.addListener=h,o.once=h,o.off=h,o.removeListener=h,o.removeAllListeners=h,o.emit=h,o.prependListener=h,o.prependOnceListener=h,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],2:[function(t,f,e){(function(n){!function(t){var e=setTimeout;function r(){}function o(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=undefined,this._deferreds=[],s(t,this)}function i(r,i){for(;3===r._state;)r=r._value;0!==r._state?(r._handled=!0,o._immediateFn(function(){var t=1===r._state?i.onFulfilled:i.onRejected;if(null!==t){var e;try{e=t(r._value)}catch(n){return void u(i.promise,n)}a(i.promise,e)}else(1===r._state?a:u)(i.promise,r._value)})):r._deferreds.push(i)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof o)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void s(function r(t,e){return function(){t.apply(e,arguments)}}(n,e),t)}t._state=1,t._value=e,c(t)}catch(i){u(t,i)}}function u(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&o._immediateFn(function(){t._handled||o._unhandledRejectionFn(t._value)});for(var e=0,n=t._deferreds.length;e<n;e++)i(t,t._deferreds[e]);t._deferreds=null}function l(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function s(t,e){var n=!1;try{t(function(t){n||(n=!0,a(e,t))},function(t){n||(n=!0,u(e,t))})}catch(r){if(n)return;n=!0,u(e,r)}}o.prototype["catch"]=function(t){return this.then(null,t)},o.prototype.then=function(t,e){var n=new this.constructor(r);return i(this,new l(t,e,n)),n},o.all=function(t){var c=Array.prototype.slice.call(t);return new o(function(i,o){if(0===c.length)return i([]);var a=c.length;function u(e,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void n.call(t,function(t){u(e,t)},o)}c[e]=t,0==--a&&i(c)}catch(r){o(r)}}for(var t=0;t<c.length;t++)u(t,c[t])})},o.resolve=function(e){return e&&"object"==typeof e&&e.constructor===o?e:new o(function(t){t(e)})},o.reject=function(n){return new o(function(t,e){e(n)})},o.race=function(i){return new o(function(t,e){for(var n=0,r=i.length;n<r;n++)i[n].then(t,e)})},o._immediateFn="function"==typeof n?function(t){n(t)}:function(t){e(t,0)},o._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},o._setImmediateFn=function(t){o._immediateFn=t},o._setUnhandledRejectionFn=function(t){o._unhandledRejectionFn=t},void 0!==f&&f.exports?f.exports=o:t.Promise||(t.Promise=o)}(this)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(c,t,l){(function(t,e){var r=c("process/browser.js").nextTick,n=Function.prototype.apply,i=Array.prototype.slice,o={},a=0;function u(t,e){this._id=t,this._clearFn=e}l.setTimeout=function(){return new u(n.call(setTimeout,window,arguments),clearTimeout)},l.setInterval=function(){return new u(n.call(setInterval,window,arguments),clearInterval)},l.clearTimeout=l.clearInterval=function(t){t.close()},u.prototype.unref=u.prototype.ref=function(){},u.prototype.close=function(){this._clearFn.call(window,this._id)},l.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},l.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},l._unrefActive=l.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;0<=e&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},l.setImmediate="function"==typeof t?t:function(t){var e=a++,n=!(arguments.length<2)&&i.call(arguments,1);return o[e]=!0,r(function(){o[e]&&(n?t.apply(null,n):t.call(null),l.clearImmediate(e))}),e},l.clearImmediate="function"==typeof e?e:function(t){delete o[t]}}).call(this,c("timers").setImmediate,c("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,e,n){var r=t("promise-polyfill"),i="undefined"!=typeof window?window:Function("return this;")();e.exports={boltExport:i.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)});var L=E.exports.boltExport,N=function(t){var n=w.none(),e=[],r=function(t){i()?a(t):e.push(t)},i=function(){return n.isSome()},o=function(t){!function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n,t)}(t,a)},a=function(e){n.each(function(t){s.setTimeout(function(){e(t)},0)})};return t(function(t){n=w.some(t),o(e),e=[]}),{get:r,map:function(n){return N(function(e){r(function(t){e(n(t))})})},isReady:i}},j={nu:N,pure:function(e){return N(function(t){t(e)})}},R=function(t){s.setTimeout(function(){throw t},0)},F=function(n){var t=function(t){n().then(t,R)};return{map:function(t){return F(function(){return n().then(t)})},bind:function(e){return F(function(){return n().then(function(t){return e(t).toPromise()})})},anonBind:function(t){return F(function(){return n().then(function(){return t.toPromise()})})},toLazy:function(){return j.nu(t)},toCached:function(){var t=null;return F(function(){return null===t&&(t=n()),t})},toPromise:n,get:t}},k=function(t){return F(function(){return new L(t)})},z=function(t){return F(function(){return L.resolve(t)})},H=function(n){return{is:function(t){return n===t},isValue:p,isError:m,getOr:l(n),getOrThunk:l(n),getOrDie:l(n),or:function(t){return H(n)},orThunk:function(t){return H(n)},fold:function(t,e){return e(n)},map:function(t){return H(t(n))},mapError:function(t){return H(n)},each:function(t){t(n)},bind:function(t){return t(n)},exists:function(t){return t(n)},forall:function(t){return t(n)},toOption:function(){return w.some(n)}}},B=function(n){return{is:m,isValue:m,isError:p,getOr:d,getOrThunk:function(t){return t()},getOrDie:function(){return t=String(n),function(){throw new Error(t)}();var t},or:function(t){return t},orThunk:function(t){return t()},fold:function(t,e){return t(n)},map:function(t){return B(n)},mapError:function(t){return B(t(n))},each:c,bind:function(t){return B(n)},exists:m,forall:p,toOption:w.none}},M={value:H,error:B,fromOption:function(t,e){return t.fold(function(){return B(e)},H)}},G=function(o){return C({},o,{toCached:function(){return G(o.toCached())},bindFuture:function(e){return G(o.bind(function(t){return t.fold(function(t){return z(M.error(t))},function(t){return e(t)})}))},bindResult:function(e){return G(o.map(function(t){return t.bind(e)}))},mapResult:function(e){return G(o.map(function(t){return t.map(e)}))},mapError:function(e){return G(o.map(function(t){return t.mapError(e)}))},foldResult:function(e,n){return o.map(function(t){return t.fold(e,n)})},withTimeout:function(t,i){return G(k(function(e){var n=!1,r=s.setTimeout(function(){n=!0,e(M.error(i()))},t);o.get(function(t){n||(s.clearTimeout(r),e(t))})}))}})},W=function(t){return G(k(t))},q=W,$=Object.prototype.hasOwnProperty,J=function(a){return function(){for(var t=new Array(arguments.length),e=0;e<t.length;e++)t[e]=arguments[e];if(0===t.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<t.length;r++){var i=t[r];for(var o in i)$.call(i,o)&&(n[o]=a(n[o],i[o]))}return n}},V=J(function(t,e){return U(t)&&U(e)?V(t,e):e}),X=J(function(t,e){return e}),Z=function(t){var e=t.imageList.map(function(t){return{name:"images",type:"selectbox",label:"Image list",items:t}}),n=t.classList.map(function(t){return{name:"classes",type:"selectbox",label:"Class",items:t}});return O([[{name:"src",type:"urlinput",filetype:"image",label:"Source"}],e.toArray(),t.hasDescription?[{name:"alt",type:"input",label:"Image description"}]:[],t.hasImageTitle?[{name:"title",type:"input",label:"Image title"}]:[],t.hasDimensions?[{name:"dimensions",type:"sizeinput"}]:[],[{type:"grid",columns:2,items:O([n.toArray(),t.hasImageCaption?[{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[]])}]])},K=function(t){return{title:"General",name:"general",items:Z(t)}},Q=Z,Y=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),tt=tinymce.util.Tools.resolve("tinymce.util.Promise"),et=tinymce.util.Tools.resolve("tinymce.util.XHR"),nt=function(t){return t.getParam("images_upload_url","","string")},rt=function(t){return t.getParam("images_upload_handler",undefined,"function")},it={hasDimensions:function(t){return t.getParam("image_dimensions",!0,"boolean")},hasUploadTab:function(t){return t.getParam("image_uploadtab",!0,"boolean")},hasAdvTab:function(t){return t.getParam("image_advtab",!1,"boolean")},getPrependUrl:function(t){return t.getParam("image_prepend_url","","string")},getClassList:function(t){return t.getParam("image_class_list")},hasDescription:function(t){return t.getParam("image_description",!0,"boolean")},hasImageTitle:function(t){return t.getParam("image_title",!1,"boolean")},hasImageCaption:function(t){return t.getParam("image_caption",!1,"boolean")},getImageList:function(t){return t.getParam("image_list",!1)},hasUploadUrl:function(t){return!!nt(t)},hasUploadHandler:function(t){return!!rt(t)},getUploadUrl:nt,getUploadHandler:rt,getUploadBasePath:function(t){return t.getParam("images_upload_base_path",undefined,"string")},getUploadCredentials:function(t){return t.getParam("images_upload_credentials",!1,"boolean")}},ot=function(t,e){return Math.max(parseInt(t,10),parseInt(e,10))},at=function(t,e){var n=s.document.createElement("img"),r=function(t){n.parentNode&&n.parentNode.removeChild(n),e(t)};n.onload=function(){var t={width:ot(n.width,n.clientWidth),height:ot(n.height,n.clientHeight)};r(M.value(t))},n.onerror=function(){r(M.error("Failed to get image dimensions for: "+t))};var i=n.style;i.visibility="hidden",i.position="fixed",i.bottom=i.left="0px",i.width=i.height="auto",s.document.body.appendChild(n),n.src=t},ut=function(t){return t&&(t=t.replace(/px$/,"")),t},ct=function(t){return 0<t.length&&/^[0-9]+$/.test(t)&&(t+="px"),t},lt=function(t){if(t.margin){var e=String(t.margin).split(" ");switch(e.length){case 1:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[0],t["margin-bottom"]=t["margin-bottom"]||e[0],t["margin-left"]=t["margin-left"]||e[0];break;case 2:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[0],t["margin-left"]=t["margin-left"]||e[1];break;case 3:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[2],t["margin-left"]=t["margin-left"]||e[1];break;case 4:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[2],t["margin-left"]=t["margin-left"]||e[3]}delete t.margin}return t},st=function(t,e){var n=it.getImageList(t);"string"==typeof n?et.send({url:n,success:function(t){e(JSON.parse(t))}}):"function"==typeof n?n(e):e(n)},ft=function(t,e,n){var r=function(){n.onload=n.onerror=null,t.selection&&(t.selection.select(n),t.nodeChanged())};n.onload=function(){e.width||e.height||!it.hasDimensions(t)||t.dom.setAttribs(n,{width:String(n.clientWidth),height:String(n.clientHeight)}),r()},n.onerror=r},dt=function(r){return new tt(function(t,e){var n=new s.FileReader;n.onload=function(){t(n.result)},n.onerror=function(){e(n.error.message)},n.readAsDataURL(r)})},mt=function(t){return"IMG"===t.nodeName&&(t.hasAttribute("data-mce-object")||t.hasAttribute("data-mce-placeholder"))},pt=Y.DOM,gt=function(t){return t.style.marginLeft&&t.style.marginRight&&t.style.marginLeft===t.style.marginRight?ut(t.style.marginLeft):""},ht=function(t){return t.style.marginTop&&t.style.marginBottom&&t.style.marginTop===t.style.marginBottom?ut(t.style.marginTop):""},yt=function(t){return t.style.borderWidth?ut(t.style.borderWidth):""},vt=function(t,e){return t.hasAttribute(e)?t.getAttribute(e):""},bt=function(t,e){return t.style[e]?t.style[e]:""},wt=function(t){return null!==t.parentNode&&"FIGURE"===t.parentNode.nodeName},Tt=function(t,e,n){t.setAttribute(e,n)},_t=function(t){var e,n,r,i;wt(t)?(i=(r=t).parentNode,pt.insertAfter(r,i),pt.remove(i)):(e=t,n=pt.create("figure",{"class":"image"}),pt.insertAfter(n,e),n.appendChild(e),n.appendChild(pt.create("figcaption",{contentEditable:"true"},"Caption")),n.contentEditable="false")},Ut=function(t,e){var n=t.getAttribute("style"),r=e(null!==n?n:"");0<r.length?(t.setAttribute("style",r),t.setAttribute("data-mce-style",r)):t.removeAttribute("style")},xt=function(t,r){return function(t,e,n){t.style[e]?(t.style[e]=ct(n),Ut(t,r)):Tt(t,e,n)}},At=function(t,e){return t.style[e]?ut(t.style[e]):vt(t,e)},It=function(t,e){var n=ct(e);t.style.marginLeft=n,t.style.marginRight=n},St=function(t,e){var n=ct(e);t.style.marginTop=n,t.style.marginBottom=n},Dt=function(t,e){var n=ct(e);t.style.borderWidth=n},Ot=function(t,e){t.style.borderStyle=e},Ct=function(t){return"FIGURE"===t.nodeName},Pt=function(t,e){var n=s.document.createElement("img");return Tt(n,"style",e.style),(gt(n)||""!==e.hspace)&&It(n,e.hspace),(ht(n)||""!==e.vspace)&&St(n,e.vspace),(yt(n)||""!==e.border)&&Dt(n,e.border),(bt(n,"borderStyle")||""!==e.borderStyle)&&Ot(n,e.borderStyle),t(n.getAttribute("style"))},Et=function(t,e){return{src:vt(e,"src"),alt:vt(e,"alt"),title:vt(e,"title"),width:At(e,"width"),height:At(e,"height"),"class":vt(e,"class"),style:t(vt(e,"style")),caption:wt(e),hspace:gt(e),vspace:ht(e),border:yt(e),borderStyle:bt(e,"borderStyle")}},Lt=function(t,e,n,r,i){n[r]!==e[r]&&i(t,r,n[r])},Nt=function(r,i){return function(t,e,n){r(t,n),Ut(t,i)}},jt=function(t,e,n){var r=Et(t,n);Lt(n,r,e,"caption",function(t,e,n){return _t(t)}),Lt(n,r,e,"src",Tt),Lt(n,r,e,"alt",Tt),Lt(n,r,e,"title",Tt),Lt(n,r,e,"width",xt(0,t)),Lt(n,r,e,"height",xt(0,t)),Lt(n,r,e,"class",Tt),Lt(n,r,e,"style",Nt(function(t,e){return Tt(t,"style",e)},t)),Lt(n,r,e,"hspace",Nt(It,t)),Lt(n,r,e,"vspace",Nt(St,t)),Lt(n,r,e,"border",Nt(Dt,t)),Lt(n,r,e,"borderStyle",Nt(Ot,t))},Rt=function(t,e){var n=t.dom.styles.parse(e),r=lt(n),i=t.dom.styles.parse(t.dom.styles.serialize(r));return t.dom.styles.serialize(i)},Ft=function(t){var e=t.selection.getNode(),n=t.dom.getParent(e,"figure.image");return n?t.dom.select("img",n)[0]:e&&("IMG"!==e.nodeName||mt(e))?null:e},kt=function(e,t){var n=e.dom,r=n.getParent(t.parentNode,function(t){return e.schema.getTextBlockElements()[t.nodeName]},e.getBody());return r?n.split(r,t):t},zt=function(e,t){var n=function(t,e){var n=s.document.createElement("img");if(jt(t,X(e,{caption:!1}),n),Tt(n,"alt",e.alt),e.caption){var r=pt.create("figure",{"class":"image"});return r.appendChild(n),r.appendChild(pt.create("figcaption",{contentEditable:"true"},"Caption")),r.contentEditable="false",r}return n}(function(t){return Rt(e,t)},t);e.dom.setAttrib(n,"data-mce-id","__mcenew"),e.focus(),e.selection.setContent(n.outerHTML);var r=e.dom.select('*[data-mce-id="__mcenew"]')[0];if(e.dom.setAttrib(r,"data-mce-id",null),Ct(r)){var i=kt(e,r);e.selection.select(i)}else e.selection.select(r)},Ht=function(t,e){var n=Ft(t);n?e.src?function(e,t){var n,r=Ft(e);if(jt(function(t){return Rt(e,t)},t,r),n=r,e.dom.setAttrib(n,"src",n.getAttribute("src")),Ct(r.parentNode)){var i=r.parentNode;kt(e,i),e.selection.select(r.parentNode)}else e.selection.select(r),ft(e,t,r)}(t,e):function(t,e){if(e){var n=t.dom.is(e.parentNode,"figure.image")?e.parentNode:e;t.dom.remove(n),t.focus(),t.nodeChanged(),t.dom.isEmpty(t.getBody())&&(t.setContent(""),t.selection.setCursorLocation())}}(t,n):e.src&&zt(t,e)},Bt=tinymce.util.Tools.resolve("tinymce.util.Tools"),Mt=function(t){return _(t.value)?t.value:""},Gt=function(t,i){var o=[];return Bt.each(t,function(t){var e=_(t.text)?t.text:_(t.title)?t.title:"";if(t.menu!==undefined){var n=Gt(t.menu,i);o.push({text:e,items:n})}else{var r=i(t);o.push({text:e,value:r})}}),o},Wt=function(e){return void 0===e&&(e=Mt),function(t){return t?w.from(t).map(function(t){return Gt(t,e)}):w.none()}},qt=function(t,n){return function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return w.none()}(t,function(t){return e=t,Object.prototype.hasOwnProperty.call(e,"items")?qt(t.items,n):t.value===n?w.some(t):w.none();var e})},$t=Wt,Jt=function(t){return Wt(Mt)(t)},Vt=function(t,e){return t.bind(function(t){return qt(t,e)})};function Xt(a){var e=function(t,r,i,e){var o,n;(o=new s.XMLHttpRequest).open("POST",a.url),o.withCredentials=a.credentials,o.upload.onprogress=function(t){e(t.loaded/t.total*100)},o.onerror=function(){i("Image upload failed due to a XHR Transport error. Code: "+o.status)},o.onload=function(){var t,e,n;o.status<200||300<=o.status?i("HTTP Error: "+o.status):(t=JSON.parse(o.responseText))&&"string"==typeof t.location?r((e=a.basePath,n=t.location,e?e.replace(/\/$/,"")+"/"+n.replace(/^\//,""):n)):i("Invalid JSON: "+o.responseText)},(n=new s.FormData).append("file",t.blob(),t.filename()),o.send(n)};return a=Bt.extend({credentials:!1,handler:e},a),{upload:function(t){return a.url||a.handler!==e?(r=t,i=a.handler,new tt(function(t,e){try{i(r,t,e,c)}catch(n){e(n.message)}})):tt.reject("Upload url missing from the settings.");var r,i}}}var Zt=function(t){return{title:"Advanced",name:"advanced",items:[{type:"input",label:"Style",name:"style"},{type:"grid",columns:2,items:[{type:"input",label:"Vertical space",name:"vspace"},{type:"input",label:"Horizontal space",name:"hspace"},{type:"input",label:"Border width",name:"border"},{type:"selectbox",name:"borderstyle",label:"Border style",items:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]}]}]}},Kt=function(n){var e,t,r=$t(function(t){return n.convertURL(t.value||t.url,"src")}),i=k(function(e){st(n,function(t){e(r(t).map(function(t){return O([[{text:"None",value:""}],t])}))})}),o=Jt(it.getClassList(n)),a=it.hasAdvTab(n),u=it.hasUploadTab(n),c=it.hasUploadUrl(n),l=it.hasUploadHandler(n),s=(t=Ft(e=n))?Et(function(t){return Rt(e,t)},t):{src:"",alt:"",title:"",width:"",height:"","class":"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:""},f=it.hasDescription(n),d=it.hasImageTitle(n),m=it.hasDimensions(n),p=it.hasImageCaption(n),g=it.getUploadUrl(n),h=it.getUploadBasePath(n),y=it.getUploadCredentials(n),v=it.getUploadHandler(n),b=w.some(it.getPrependUrl(n)).filter(function(t){return _(t)&&0<t.length});return i.map(function(t){return{image:s,imageList:t,classList:o,hasAdvTab:a,hasUploadTab:u,hasUploadUrl:c,hasUploadHandler:l,hasDescription:f,hasImageTitle:d,hasDimensions:m,hasImageCaption:p,url:g,basePath:h,credentials:y,handler:v,prependURL:b}})},Qt=function(t){return{title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput"}]}},Yt=function(t){return{src:{value:t.src,meta:{}},images:t.src,alt:t.alt,title:t.title,dimensions:{width:t.width,height:t.height},classes:t["class"],caption:t.caption,style:t.style,vspace:t.vspace,border:t.border,hspace:t.hspace,borderstyle:t.borderStyle,fileinput:[]}},te=function(t){return{src:t.src.value,alt:t.alt,title:t.title,width:t.dimensions.width,height:t.dimensions.height,"class":t.classes,style:t.style,caption:t.caption,hspace:t.hspace,vspace:t.vspace,border:t.border,borderStyle:t.borderstyle}},ee=function(t,e){var n,r,i=e.getData();(n=t,r=i.src.value,/^(?:[a-zA-Z]+:)?\/\//.test(r)?w.none():n.prependURL.bind(function(t){return r.substring(0,t.length)!==t?w.some(t+r):w.none()})).each(function(t){e.setData({src:{value:t,meta:i.src.meta}})})},ne=function(t,e){var n,r,i,o=e.getData(),a=o.src.meta;if(a!==undefined){var u=V({},o);r=u,i=a,(n=t).hasDescription&&_(i.alt)&&(r.alt=i.alt),n.hasImageTitle&&_(i.title)&&(r.title=i.title),n.hasDimensions&&(_(i.width)&&(r.dimensions.width=i.width),_(i.height)&&(r.dimensions.height=i.height)),_(i["class"])&&Vt(n.classList,i["class"]).each(function(t){r.classes=t.value}),n.hasImageCaption&&A(i.caption)&&(r.caption=i.caption),n.hasAdvTab&&(_(i.vspace)&&(r.vspace=i.vspace),_(i.border)&&(r.border=i.border),_(i.hspace)&&(r.hspace=i.hspace),_(i.borderstyle)&&(r.borderstyle=i.borderstyle)),e.setData(u)}},re=function(t,e,n,r){var i,o,a,u,c,l,s,f,d,m,p,g;ee(e,r),ne(e,r),i=t,o=e,a=n,c=(u=r).getData(),l=c.src.value,(s=c.src.meta||{}).width||s.height||!o.hasDimensions||i.imageSize(l).get(function(t){t.each(function(t){a.open&&u.setData({dimensions:t})})}),f=e,d=n,p=(m=r).getData(),g=Vt(f.imageList,p.src.value),d.prevImage=g,m.setData({images:g.map(function(t){return t.value}).getOr("")})},ie=function(t,e,n){var r,i,o,a,u,c=lt(t(n.style)),l=V({},n);return l.vspace=(r=c)["margin-top"]&&r["margin-bottom"]&&r["margin-top"]===r["margin-bottom"]?ut(String(r["margin-top"])):"",l.hspace=(i=c)["margin-right"]&&i["margin-left"]&&i["margin-right"]===i["margin-left"]?ut(String(i["margin-right"])):"",l.border=(o=c)["border-width"]?ut(String(o["border-width"])):"",l.borderstyle=(a=c)["border-style"]?String(a["border-style"]):"",l.style=(u=e)(t(u(c))),l},oe=function(a,u,c,l){var t,e=l.getData();l.block("Uploading image"),(t=e.fileinput,0===t.length?w.none():w.some(t[0])).fold(function(){l.unblock()},function(n){var r=s.URL.createObjectURL(n),i=Xt({url:u.url,basePath:u.basePath,credentials:u.credentials,handler:u.handler}),o=function(){l.unblock(),s.URL.revokeObjectURL(r)};dt(n).then(function(t){var e=a.createBlobCache(n,r,t);i.upload(e).then(function(t){l.setData({src:{value:t,meta:{}}}),l.showTab("general"),re(a,u,c,l),o()})["catch"](function(t){o(),a.alertErr(l,t)})})})},ae=function(h,y,v){return function(t,e){var n,r,i,o,a,u,c,l,s,f,d,m,p,g;"src"===e.name?re(h,y,v,t):"images"===e.name?(s=h,f=y,d=v,p=(m=t).getData(),(g=Vt(f.imageList,p.images)).each(function(t){""===p.alt||d.prevImage.map(function(t){return t.text===p.alt}).getOr(!1)?""===t.value?m.setData({src:t,alt:d.prevAlt}):m.setData({src:t,alt:t.text}):m.setData({src:t})}),d.prevImage=g,re(s,f,d,m)):"alt"===e.name?v.prevAlt=t.getData().alt:"style"===e.name?(a=h,c=(u=t).getData(),l=ie(a.parseStyle,a.serializeStyle,c),u.setData(l)):"vspace"===e.name||"hspace"===e.name||"border"===e.name||"borderstyle"===e.name?(n=h,r=t,i=V(Yt(y.image),r.getData()),o=Pt(n.normalizeCss,te(i)),r.setData({style:o})):"fileinput"===e.name&&oe(h,y,v,t)}},ue=function(o){return function(t){var e,n,r,i={prevImage:Vt((e=t).imageList,e.image.src),prevAlt:e.image.alt,open:!0};return{title:"Insert/Edit Image",size:"normal",body:(r=t,r.hasAdvTab||r.hasUploadUrl||r.hasUploadHandler?{type:"tabpanel",tabs:O([[K(r)],r.hasAdvTab?[Zt(r)]:[],r.hasUploadTab&&(r.hasUploadUrl||r.hasUploadHandler)?[Qt(r)]:[]])}:{type:"panel",items:Q(r)}),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Yt(t.image),onSubmit:o.onSubmit(t),onChange:ae(o,t,i),onClose:(n=i,function(){n.open=!1})}}},ce=function(e){var n,r,i,o,a,u,c,t={onSubmit:(c=e,function(n){return function(t){var e=V(Yt(n.image),t.getData());c.undoManager.transact(function(){Ht(c,te(e))}),c.editorUpload.uploadImagesAuto(),t.close()}}),imageSize:(u=e,function(t){return q(function(n){at(u.documentBaseURI.toAbsolute(t),function(t){var e=t.map(function(t){return{width:String(t.width),height:String(t.height)}});n(e)})})}),createBlobCache:(a=e,function(t,e,n){return a.editorUpload.blobCache.create({blob:t,blobUri:e,name:t.name?t.name.replace(/\.[^\.]+$/,""):null,base64:n.split(",")[1]})}),alertErr:(o=e,function(t,e){o.windowManager.alert(e,t.close)}),normalizeCss:(i=e,function(t){return Rt(i,t)}),parseStyle:(r=e,function(t){return r.dom.parseStyle(t)}),serializeStyle:(n=e,function(t,e){return n.dom.serializeStyle(t,e)})};return{open:function(){return Kt(e).map(ue(t)).get(function(t){e.windowManager.open(t)})}}},le=function(t){t.addCommand("mceImage",ce(t).open)},se=function(o){return function(t){for(var e,n=t.length,r=function(t){t.attr("contenteditable",o?"true":null)};n--;){var i=t[n];void 0,(e=i.attr("class"))&&/\bimage\b/.test(e)&&(i.attr("contenteditable",o?"false":null),Bt.each(i.getAll("figcaption"),r))}}},fe=function(t){t.on("PreInit",function(){t.parser.addNodeFilter("figure",se(!0)),t.serializer.addNodeFilter("figure",se(!1))})},de=function(e){e.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:ce(e).open,onSetup:function(t){return e.selection.selectorChangedWithUnbind("img:not([data-mce-object],[data-mce-placeholder]),figure.image",t.setActive).unbind}}),e.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:ce(e).open}),e.ui.registry.addContextMenu("image",{update:function(t){return Ct(t)||"IMG"===t.nodeName&&!mt(t)?["image"]:[]}})};!function me(){u.add("image",function(t){fe(t),de(t),le(t)})}()}(window);
|
9
|
+
!function(s){"use strict";function o(){}function a(t){return function(){return t}}function t(t){return t}function e(){return l}var n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=a(!1),c=a(!0),l=(n={fold:function(t,e){return t()},is:u,isSome:u,isNone:c,getOr:d,getOrThunk:f,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:a(null),getOrUndefined:a(undefined),or:d,orThunk:f,map:e,each:o,bind:e,exists:u,forall:c,filter:e,equals:i,equals_:i,toArray:function(){return[]},toString:a("none()")},Object.freeze&&Object.freeze(n),n);function i(t){return t.isNone()}function f(t){return t()}function d(t){return t}function m(e){return function(t){return function(t){if(null===t)return"null";var e=typeof t;return"object"==e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e}(t)===e}}function v(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!U(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);S.apply(e,t[n])}return e}var p,g,h,y,b=function(n){function t(){return i}function e(t){return t(n)}var r=a(n),i={fold:function(t,e){return e(n)},is:function(t){return n===t},isSome:c,isNone:u,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:t,orThunk:t,map:function(t){return b(t(n))},each:function(t){t(n)},bind:e,exists:e,forall:e,filter:function(t){return t(n)?i:l},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(t){return t.is(n)},equals_:function(t,e){return t.fold(u,function(t){return e(n,t)})}};return i},w={some:b,none:e,from:function(t){return null===t||t===undefined?l:b(t)}},T=m("string"),_=m("object"),U=m("array"),x=m("boolean"),A=m("function"),I=Array.prototype.slice,S=Array.prototype.push,D=(A(Array.from)&&Array.from,function(){return(D=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)}),O={},C={exports:O};p=undefined,g=O,h=C,y=undefined,function(t){"object"==typeof g&&void 0!==h?h.exports=t():"function"==typeof p&&p.amd?p([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=t()}(function(){return function s(o,a,u){function c(e,t){if(!a[e]){if(!o[e]){var n="function"==typeof y&&y;if(!t&&n)return n(e,!0);if(l)return l(e,!0);var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}var i=a[e]={exports:{}};o[e][0].call(i.exports,function(t){return c(o[e][1][t]||t)},i,i.exports,s,o,a,u)}return a[e].exports}for(var l="function"==typeof y&&y,t=0;t<u.length;t++)c(u[t]);return c}({1:[function(t,e,n){var r,i,o=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function c(t){if(r===setTimeout)return setTimeout(t,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(t){r=a}try{i="function"==typeof clearTimeout?clearTimeout:u}catch(t){i=u}}();var l,s=[],f=!1,d=-1;function m(){f&&l&&(f=!1,l.length?s=l.concat(s):d=-1,s.length&&p())}function p(){if(!f){var t=c(m);f=!0;for(var e=s.length;e;){for(l=s,s=[];++d<e;)l&&l[d].run();d=-1,e=s.length}l=null,f=!1,function n(t){if(i===clearTimeout)return clearTimeout(t);if((i===u||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{return i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function g(t,e){this.fun=t,this.array=e}function h(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(new g(t,e)),1!==s.length||f||c(p)},g.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=h,o.addListener=h,o.once=h,o.off=h,o.removeListener=h,o.removeAllListeners=h,o.emit=h,o.prependListener=h,o.prependOnceListener=h,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],2:[function(t,f,e){(function(e){function r(){}function o(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=undefined,this._deferreds=[],s(t,this)}function i(r,i){for(;3===r._state;)r=r._value;0!==r._state?(r._handled=!0,o._immediateFn(function(){var t=1===r._state?i.onFulfilled:i.onRejected;if(null!==t){var e;try{e=t(r._value)}catch(n){return void u(i.promise,n)}a(i.promise,e)}else(1===r._state?a:u)(i.promise,r._value)})):r._deferreds.push(i)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof o)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void s(function r(t,e){return function(){t.apply(e,arguments)}}(n,e),t)}t._state=1,t._value=e,c(t)}catch(i){u(t,i)}}function u(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&o._immediateFn(function(){t._handled||o._unhandledRejectionFn(t._value)});for(var e=0,n=t._deferreds.length;e<n;e++)i(t,t._deferreds[e]);t._deferreds=null}function l(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function s(t,e){var n=!1;try{t(function(t){n||(n=!0,a(e,t))},function(t){n||(n=!0,u(e,t))})}catch(r){if(n)return;n=!0,u(e,r)}}var t,n;t=this,n=setTimeout,o.prototype["catch"]=function(t){return this.then(null,t)},o.prototype.then=function(t,e){var n=new this.constructor(r);return i(this,new l(t,e,n)),n},o.all=function(t){var c=Array.prototype.slice.call(t);return new o(function(i,o){if(0===c.length)return i([]);var a=c.length;function u(e,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void n.call(t,function(t){u(e,t)},o)}c[e]=t,0==--a&&i(c)}catch(r){o(r)}}for(var t=0;t<c.length;t++)u(t,c[t])})},o.resolve=function(e){return e&&"object"==typeof e&&e.constructor===o?e:new o(function(t){t(e)})},o.reject=function(n){return new o(function(t,e){e(n)})},o.race=function(i){return new o(function(t,e){for(var n=0,r=i.length;n<r;n++)i[n].then(t,e)})},o._immediateFn="function"==typeof e?function(t){e(t)}:function(t){n(t,0)},o._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},o._setImmediateFn=function(t){o._immediateFn=t},o._setUnhandledRejectionFn=function(t){o._unhandledRejectionFn=t},void 0!==f&&f.exports?f.exports=o:t.Promise||(t.Promise=o)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(c,t,l){(function(t,e){var r=c("process/browser.js").nextTick,n=Function.prototype.apply,i=Array.prototype.slice,o={},a=0;function u(t,e){this._id=t,this._clearFn=e}l.setTimeout=function(){return new u(n.call(setTimeout,window,arguments),clearTimeout)},l.setInterval=function(){return new u(n.call(setInterval,window,arguments),clearInterval)},l.clearTimeout=l.clearInterval=function(t){t.close()},u.prototype.unref=u.prototype.ref=function(){},u.prototype.close=function(){this._clearFn.call(window,this._id)},l.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},l.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},l._unrefActive=l.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;0<=e&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},l.setImmediate="function"==typeof t?t:function(t){var e=a++,n=!(arguments.length<2)&&i.call(arguments,1);return o[e]=!0,r(function(){o[e]&&(n?t.apply(null,n):t.call(null),l.clearImmediate(e))}),e},l.clearImmediate="function"==typeof e?e:function(t){delete o[t]}}).call(this,c("timers").setImmediate,c("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,e,n){var r=t("promise-polyfill"),i="undefined"!=typeof window?window:Function("return this;")();e.exports={boltExport:i.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)});function P(t){s.setTimeout(function(){throw t},0)}function E(t){return vt(mt(t))}function L(a){return function(){for(var t=new Array(arguments.length),e=0;e<t.length;e++)t[e]=arguments[e];if(0===t.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<t.length;r++){var i=t[r];for(var o in i)wt.call(i,o)&&(n[o]=a(n[o],i[o]))}return n}}function N(t){var e=t.imageList.map(function(t){return{name:"images",type:"selectbox",label:"Image list",items:t}}),n=t.classList.map(function(t){return{name:"classes",type:"selectbox",label:"Class",items:t}});return v([[{name:"src",type:"urlinput",filetype:"image",label:"Source"}],e.toArray(),t.hasDescription?[{name:"alt",type:"input",label:"Image description"}]:[],t.hasImageTitle?[{name:"title",type:"input",label:"Image title"}]:[],t.hasDimensions?[{name:"dimensions",type:"sizeinput"}]:[],[{type:"grid",columns:2,items:v([n.toArray(),t.hasImageCaption?[{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[]])}]])}function j(t,e){return Math.max(parseInt(t,10),parseInt(e,10))}function R(t){return t.style.marginLeft&&t.style.marginRight&&t.style.marginLeft===t.style.marginRight?Et(t.style.marginLeft):""}function F(t){return t.style.marginTop&&t.style.marginBottom&&t.style.marginTop===t.style.marginBottom?Et(t.style.marginTop):""}function k(t){return t.style.borderWidth?Et(t.style.borderWidth):""}function z(t,e){return t.hasAttribute(e)?t.getAttribute(e):""}function H(t,e){return t.style[e]?t.style[e]:""}function B(t){return null!==t.parentNode&&"FIGURE"===t.parentNode.nodeName}function M(t,e,n){t.setAttribute(e,n)}function G(t){B(t)?function(t){var e=t.parentNode;zt.insertAfter(t,e),zt.remove(e)}(t):function(t){var e=zt.create("figure",{"class":"image"});zt.insertAfter(e,t),e.appendChild(t),e.appendChild(zt.create("figcaption",{contentEditable:"true"},"Caption")),e.contentEditable="false"}(t)}function W(t,e){var n=t.getAttribute("style"),r=e(null!==n?n:"");0<r.length?(t.setAttribute("style",r),t.setAttribute("data-mce-style",r)):t.removeAttribute("style")}function q(t,r){return function(t,e,n){t.style[e]?(t.style[e]=Lt(n),W(t,r)):M(t,e,n)}}function $(t,e){return t.style[e]?Et(t.style[e]):z(t,e)}function J(t,e){var n=Lt(e);t.style.marginLeft=n,t.style.marginRight=n}function V(t,e){var n=Lt(e);t.style.marginTop=n,t.style.marginBottom=n}function X(t,e){var n=Lt(e);t.style.borderWidth=n}function Z(t,e){t.style.borderStyle=e}function K(t){return"FIGURE"===t.nodeName}function Q(t,e){var n=s.document.createElement("img");return M(n,"style",e.style),!R(n)&&""===e.hspace||J(n,e.hspace),!F(n)&&""===e.vspace||V(n,e.vspace),!k(n)&&""===e.border||X(n,e.border),!function(t){return H(t,"borderStyle")}(n)&&""===e.borderStyle||Z(n,e.borderStyle),t(n.getAttribute("style"))}function Y(t,e){return{src:z(e,"src"),alt:z(e,"alt"),title:z(e,"title"),width:$(e,"width"),height:$(e,"height"),"class":z(e,"class"),style:t(z(e,"style")),caption:B(e),hspace:R(e),vspace:F(e),border:k(e),borderStyle:H(e,"borderStyle")}}function tt(t,e,n,r,i){n[r]!==e[r]&&i(t,r,n[r])}function et(r,i){return function(t,e,n){r(t,n),W(t,i)}}function nt(t,e){var n=t.dom.styles.parse(e),r=Nt(n),i=t.dom.styles.parse(t.dom.styles.serialize(r));return t.dom.styles.serialize(i)}function rt(t){var e=t.selection.getNode(),n=t.dom.getParent(e,"figure.image");return n?t.dom.select("img",n)[0]:e&&("IMG"!==e.nodeName||kt(e))?null:e}function it(e,t){var n=e.dom,r=n.getParent(t.parentNode,function(t){return e.schema.getTextBlockElements()[t.nodeName]},e.getBody());return r?n.split(r,t):t}function ot(e,t){var n=function(t,e){var n=s.document.createElement("img");if(Ht(t,_t(e,{caption:!1}),n),M(n,"alt",e.alt),e.caption){var r=zt.create("figure",{"class":"image"});return r.appendChild(n),r.appendChild(zt.create("figcaption",{contentEditable:"true"},"Caption")),r.contentEditable="false",r}return n}(function(t){return nt(e,t)},t);e.dom.setAttrib(n,"data-mce-id","__mcenew"),e.focus(),e.selection.setContent(n.outerHTML);var r=e.dom.select('*[data-mce-id="__mcenew"]')[0];if(e.dom.setAttrib(r,"data-mce-id",null),K(r)){var i=it(e,r);e.selection.select(i)}else e.selection.select(r)}function at(t,e){var n=rt(t);n?e.src?function(e,t){var n=rt(e);if(Ht(function(t){return nt(e,t)},t,n),function(t,e){t.dom.setAttrib(e,"src",e.getAttribute("src"))}(e,n),K(n.parentNode)){var r=n.parentNode;it(e,r),e.selection.select(n.parentNode)}else e.selection.select(n),Rt(e,t,n)}(t,e):function(t,e){if(e){var n=t.dom.is(e.parentNode,"figure.image")?e.parentNode:e;t.dom.remove(n),t.focus(),t.nodeChanged(),t.dom.isEmpty(t.getBody())&&(t.setContent(""),t.selection.setCursorLocation())}}(t,n):e.src&&ot(t,e)}function ut(t){return T(t.value)?t.value:""}function ct(e){return void 0===e&&(e=ut),function(t){return t?w.from(t).map(function(t){return Mt(t,e)}):w.none()}}var lt=C.exports.boltExport,st=function(t){var n=w.none(),e=[],r=function(t){i()?a(t):e.push(t)},i=function(){return n.isSome()},o=function(t){!function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}}(t,a)},a=function(e){n.each(function(t){s.setTimeout(function(){e(t)},0)})};return t(function(t){n=w.some(t),o(e),e=[]}),{get:r,map:function(n){return st(function(e){r(function(t){e(n(t))})})},isReady:i}},ft={nu:st,pure:function(e){return st(function(t){t(e)})}},dt=function(n){function t(t){n().then(t,P)}return{map:function(t){return dt(function(){return n().then(t)})},bind:function(e){return dt(function(){return n().then(function(t){return e(t).toPromise()})})},anonBind:function(t){return dt(function(){return n().then(function(){return t.toPromise()})})},toLazy:function(){return ft.nu(t)},toCached:function(){var t=null;return dt(function(){return null===t&&(t=n()),t})},toPromise:n,get:t}},mt=function(t){return dt(function(){return new lt(t)})},pt=function(t){return dt(function(){return lt.resolve(t)})},gt=function(n){return{is:function(t){return n===t},isValue:c,isError:u,getOr:a(n),getOrThunk:a(n),getOrDie:a(n),or:function(t){return gt(n)},orThunk:function(t){return gt(n)},fold:function(t,e){return e(n)},map:function(t){return gt(t(n))},mapError:function(t){return gt(n)},each:function(t){t(n)},bind:function(t){return t(n)},exists:function(t){return t(n)},forall:function(t){return t(n)},toOption:function(){return w.some(n)}}},ht=function(n){return{is:u,isValue:u,isError:c,getOr:t,getOrThunk:function(t){return t()},getOrDie:function(){return function(t){return function(){throw new Error(t)}}(String(n))()},or:function(t){return t},orThunk:function(t){return t()},fold:function(t,e){return t(n)},map:function(t){return ht(n)},mapError:function(t){return ht(t(n))},each:o,bind:function(t){return ht(n)},exists:u,forall:c,toOption:w.none}},yt={value:gt,error:ht,fromOption:function(t,e){return t.fold(function(){return ht(e)},gt)}},vt=function(o){return D(D({},o),{toCached:function(){return vt(o.toCached())},bindFuture:function(e){return vt(o.bind(function(t){return t.fold(function(t){return pt(yt.error(t))},function(t){return e(t)})}))},bindResult:function(e){return vt(o.map(function(t){return t.bind(e)}))},mapResult:function(e){return vt(o.map(function(t){return t.map(e)}))},mapError:function(e){return vt(o.map(function(t){return t.mapError(e)}))},foldResult:function(e,n){return o.map(function(t){return t.fold(e,n)})},withTimeout:function(t,i){return vt(mt(function(e){var n=!1,r=s.setTimeout(function(){n=!0,e(yt.error(i()))},t);o.get(function(t){n||(s.clearTimeout(r),e(t))})}))}})},bt=E,wt=Object.prototype.hasOwnProperty,Tt=L(function(t,e){return _(t)&&_(e)?Tt(t,e):e}),_t=L(function(t,e){return e}),Ut=function(t){return{title:"General",name:"general",items:N(t)}},xt=N,At=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),It=tinymce.util.Tools.resolve("tinymce.util.Promise"),St=tinymce.util.Tools.resolve("tinymce.util.XHR"),Dt=function(t){return t.getParam("images_upload_url","","string")},Ot=function(t){return t.getParam("images_upload_handler",undefined,"function")},Ct={hasDimensions:function(t){return t.getParam("image_dimensions",!0,"boolean")},hasUploadTab:function(t){return t.getParam("image_uploadtab",!0,"boolean")},hasAdvTab:function(t){return t.getParam("image_advtab",!1,"boolean")},getPrependUrl:function(t){return t.getParam("image_prepend_url","","string")},getClassList:function(t){return t.getParam("image_class_list")},hasDescription:function(t){return t.getParam("image_description",!0,"boolean")},hasImageTitle:function(t){return t.getParam("image_title",!1,"boolean")},hasImageCaption:function(t){return t.getParam("image_caption",!1,"boolean")},getImageList:function(t){return t.getParam("image_list",!1)},hasUploadUrl:function(t){return!!Dt(t)},hasUploadHandler:function(t){return!!Ot(t)},getUploadUrl:Dt,getUploadHandler:Ot,getUploadBasePath:function(t){return t.getParam("images_upload_base_path",undefined,"string")},getUploadCredentials:function(t){return t.getParam("images_upload_credentials",!1,"boolean")}},Pt=function(t,e){function n(t){r.parentNode&&r.parentNode.removeChild(r),e(t)}var r=s.document.createElement("img");r.onload=function(){var t={width:j(r.width,r.clientWidth),height:j(r.height,r.clientHeight)};n(yt.value(t))},r.onerror=function(){n(yt.error("Failed to get image dimensions for: "+t))};var i=r.style;i.visibility="hidden",i.position="fixed",i.bottom=i.left="0px",i.width=i.height="auto",s.document.body.appendChild(r),r.src=t},Et=function(t){return t=t&&t.replace(/px$/,"")},Lt=function(t){return 0<t.length&&/^[0-9]+$/.test(t)&&(t+="px"),t},Nt=function(t){if(t.margin){var e=String(t.margin).split(" ");switch(e.length){case 1:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[0],t["margin-bottom"]=t["margin-bottom"]||e[0],t["margin-left"]=t["margin-left"]||e[0];break;case 2:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[0],t["margin-left"]=t["margin-left"]||e[1];break;case 3:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[2],t["margin-left"]=t["margin-left"]||e[1];break;case 4:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[2],t["margin-left"]=t["margin-left"]||e[3]}delete t.margin}return t},jt=function(t,e){var n=Ct.getImageList(t);"string"==typeof n?St.send({url:n,success:function(t){e(JSON.parse(t))}}):"function"==typeof n?n(e):e(n)},Rt=function(t,e,n){function r(){n.onload=n.onerror=null,t.selection&&(t.selection.select(n),t.nodeChanged())}n.onload=function(){e.width||e.height||!Ct.hasDimensions(t)||t.dom.setAttribs(n,{width:String(n.clientWidth),height:String(n.clientHeight)}),r()},n.onerror=r},Ft=function(r){return new It(function(t,e){var n=new s.FileReader;n.onload=function(){t(n.result)},n.onerror=function(){e(n.error.message)},n.readAsDataURL(r)})},kt=function(t){return"IMG"===t.nodeName&&(t.hasAttribute("data-mce-object")||t.hasAttribute("data-mce-placeholder"))},zt=At.DOM,Ht=function(t,e,n){var r=Y(t,n);tt(n,r,e,"caption",function(t,e,n){return G(t)}),tt(n,r,e,"src",M),tt(n,r,e,"alt",M),tt(n,r,e,"title",M),tt(n,r,e,"width",q(0,t)),tt(n,r,e,"height",q(0,t)),tt(n,r,e,"class",M),tt(n,r,e,"style",et(function(t,e){return M(t,"style",e)},t)),tt(n,r,e,"hspace",et(J,t)),tt(n,r,e,"vspace",et(V,t)),tt(n,r,e,"border",et(X,t)),tt(n,r,e,"borderStyle",et(Z,t))},Bt=tinymce.util.Tools.resolve("tinymce.util.Tools"),Mt=function(t,i){var o=[];return Bt.each(t,function(t){var e=T(t.text)?t.text:T(t.title)?t.title:"";if(t.menu!==undefined){var n=Mt(t.menu,i);o.push({text:e,items:n})}else{var r=i(t);o.push({text:e,value:r})}}),o},Gt=function(t,e){return function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return w.none()}(t,function(t){return function(t){return Object.prototype.hasOwnProperty.call(t,"items")}(t)?Gt(t.items,e):t.value===e?w.some(t):w.none()})},Wt=ct,qt=function(t){return ct(ut)(t)},$t=function(t,e){return t.bind(function(t){return Gt(t,e)})};function Jt(a){function e(t,e,n,r){var i,o;(i=new s.XMLHttpRequest).open("POST",a.url),i.withCredentials=a.credentials,i.upload.onprogress=function(t){r(t.loaded/t.total*100)},i.onerror=function(){n("Image upload failed due to a XHR Transport error. Code: "+i.status)},i.onload=function(){var t;i.status<200||300<=i.status?n("HTTP Error: "+i.status):(t=JSON.parse(i.responseText))&&"string"==typeof t.location?e(function(t,e){return t?t.replace(/\/$/,"")+"/"+e.replace(/^\//,""):e}(a.basePath,t.location)):n("Invalid JSON: "+i.responseText)},(o=new s.FormData).append("file",t.blob(),t.filename()),i.send(o)}return a=Bt.extend({credentials:!1,handler:e},a),{upload:function(t){return!a.url&&function(t){return t===e}(a.handler)?It.reject("Upload url missing from the settings."):function(r,i){return new It(function(t,e){try{i(r,t,e,o)}catch(n){e(n.message)}})}(t,a.handler)}}}function Vt(n){var r=Wt(function(t){return n.convertURL(t.value||t.url,"src")}),t=mt(function(e){jt(n,function(t){e(r(t).map(function(t){return v([[{text:"None",value:""}],t])}))})}),e=qt(Ct.getClassList(n)),i=Ct.hasAdvTab(n),o=Ct.hasUploadTab(n),a=Ct.hasUploadUrl(n),u=Ct.hasUploadHandler(n),c=function(e){var t=rt(e);return t?Y(function(t){return nt(e,t)},t):{src:"",alt:"",title:"",width:"",height:"","class":"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:""}}(n),l=Ct.hasDescription(n),s=Ct.hasImageTitle(n),f=Ct.hasDimensions(n),d=Ct.hasImageCaption(n),m=Ct.getUploadUrl(n),p=Ct.getUploadBasePath(n),g=Ct.getUploadCredentials(n),h=Ct.getUploadHandler(n),y=w.some(Ct.getPrependUrl(n)).filter(function(t){return T(t)&&0<t.length});return t.map(function(t){return{image:c,imageList:t,classList:e,hasAdvTab:i,hasUploadTab:o,hasUploadUrl:a,hasUploadHandler:u,hasDescription:l,hasImageTitle:s,hasDimensions:f,hasImageCaption:d,url:m,basePath:p,credentials:g,handler:h,prependURL:y}})}function Xt(t){return{src:{value:t.src,meta:{}},images:t.src,alt:t.alt,title:t.title,dimensions:{width:t.width,height:t.height},classes:t["class"],caption:t.caption,style:t.style,vspace:t.vspace,border:t.border,hspace:t.hspace,borderstyle:t.borderStyle,fileinput:[]}}function Zt(t){return{src:t.src.value,alt:t.alt,title:t.title,width:t.dimensions.width,height:t.dimensions.height,"class":t.classes,style:t.style,caption:t.caption,hspace:t.hspace,vspace:t.vspace,border:t.border,borderStyle:t.borderstyle}}function Kt(t,e){var n=e.getData();(function(t,e){return/^(?:[a-zA-Z]+:)?\/\//.test(e)?w.none():t.prependURL.bind(function(t){return e.substring(0,t.length)!==t?w.some(t+e):w.none()})})(t,n.src.value).each(function(t){e.setData({src:{value:t,meta:n.src.meta}})})}function Qt(t,e){var n=e.getData(),r=n.src.meta;if(r!==undefined){var i=Tt({},n);!function(t,e,n){t.hasDescription&&T(n.alt)&&(e.alt=n.alt),t.hasImageTitle&&T(n.title)&&(e.title=n.title),t.hasDimensions&&(T(n.width)&&(e.dimensions.width=n.width),T(n.height)&&(e.dimensions.height=n.height)),T(n["class"])&&$t(t.classList,n["class"]).each(function(t){e.classes=t.value}),t.hasImageCaption&&x(n.caption)&&(e.caption=n.caption),t.hasAdvTab&&(T(n.vspace)&&(e.vspace=n.vspace),T(n.border)&&(e.border=n.border),T(n.hspace)&&(e.hspace=n.hspace),T(n.borderstyle)&&(e.borderstyle=n.borderstyle))}(t,i,r),e.setData(i)}}function Yt(t,e,n,r){Kt(e,r),Qt(e,r),function(t,e,n,r){var i=r.getData(),o=i.src.value,a=i.src.meta||{};a.width||a.height||!e.hasDimensions||t.imageSize(o).get(function(t){t.each(function(t){n.open&&r.setData({dimensions:t})})})}(t,e,n,r),function(t,e,n){var r=n.getData(),i=$t(t.imageList,r.src.value);e.prevImage=i,n.setData({images:i.map(function(t){return t.value}).getOr("")})}(e,n,r)}function te(t,e,n){var r=Nt(t(n.style)),i=Tt({},n);return i.vspace=function(t){return t["margin-top"]&&t["margin-bottom"]&&t["margin-top"]===t["margin-bottom"]?Et(String(t["margin-top"])):""}(r),i.hspace=function(t){return t["margin-right"]&&t["margin-left"]&&t["margin-right"]===t["margin-left"]?Et(String(t["margin-right"])):""}(r),i.border=function(t){return t["border-width"]?Et(String(t["border-width"])):""}(r),i.borderstyle=function(t){return t["border-style"]?String(t["border-style"]):""}(r),i.style=function(t,e,n){return e(t(e(n)))}(t,e,r),i}function ee(a,u,c,l){var t=l.getData();l.block("Uploading image"),function(t){return 0===t.length?w.none():w.some(t[0])}(t.fileinput).fold(function(){l.unblock()},function(n){function r(){l.unblock(),s.URL.revokeObjectURL(i)}var i=s.URL.createObjectURL(n),o=Jt({url:u.url,basePath:u.basePath,credentials:u.credentials,handler:u.handler});Ft(n).then(function(t){var e=a.createBlobCache(n,i,t);o.upload(e).then(function(t){l.setData({src:{value:t,meta:{}}}),l.showTab("general"),Yt(a,u,c,l),r()})["catch"](function(t){r(),a.alertErr(l,t)})})})}function ne(n,r,i){return function(t,e){"src"===e.name?Yt(n,r,i,t):"images"===e.name?function(t,e,n,r){var i=r.getData(),o=$t(e.imageList,i.images);o.each(function(t){""===i.alt||n.prevImage.map(function(t){return t.text===i.alt}).getOr(!1)?""===t.value?r.setData({src:t,alt:n.prevAlt}):r.setData({src:t,alt:t.text}):r.setData({src:t})}),n.prevImage=o,Yt(t,e,n,r)}(n,r,i,t):"alt"===e.name?i.prevAlt=t.getData().alt:"style"===e.name?function(t,e){var n=e.getData(),r=te(t.parseStyle,t.serializeStyle,n);e.setData(r)}(n,t):"vspace"===e.name||"hspace"===e.name||"border"===e.name||"borderstyle"===e.name?function(t,e,n){var r=Tt(Xt(e.image),n.getData()),i=Q(t.normalizeCss,Zt(r));n.setData({style:i})}(n,r,t):"fileinput"===e.name&&ee(n,r,i,t)}}function re(n){return function(t){var e=function(t){return{prevImage:$t(t.imageList,t.image.src),prevAlt:t.image.alt,open:!0}}(t);return{title:"Insert/Edit Image",size:"normal",body:function(t){return t.hasAdvTab||t.hasUploadUrl||t.hasUploadHandler?{type:"tabpanel",tabs:v([[Ut(t)],t.hasAdvTab?[ae(t)]:[],t.hasUploadTab&&(t.hasUploadUrl||t.hasUploadHandler)?[ue(t)]:[]])}:{type:"panel",items:xt(t)}}(t),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Xt(t.image),onSubmit:n.onSubmit(t),onChange:ne(n,t,e),onClose:function(t){return function(){t.open=!1}}(e)}}}function ie(e){var t={onSubmit:function(r){return function(n){return function(t){var e=Tt(Xt(n.image),t.getData());r.undoManager.transact(function(){at(r,Zt(e))}),r.editorUpload.uploadImagesAuto(),t.close()}}}(e),imageSize:function(e){return function(t){return bt(function(n){Pt(e.documentBaseURI.toAbsolute(t),function(t){var e=t.map(function(t){return{width:String(t.width),height:String(t.height)}});n(e)})})}}(e),createBlobCache:function(r){return function(t,e,n){return r.editorUpload.blobCache.create({blob:t,blobUri:e,name:t.name?t.name.replace(/\.[^\.]+$/,""):null,base64:n.split(",")[1]})}}(e),alertErr:function(n){return function(t,e){n.windowManager.alert(e,t.close)}}(e),normalizeCss:function(e){return function(t){return nt(e,t)}}(e),parseStyle:function(e){return function(t){return e.dom.parseStyle(t)}}(e),serializeStyle:function(n){return function(t,e){return n.dom.serializeStyle(t,e)}}(e)};return{open:function(){return Vt(e).map(re(t)).get(function(t){e.windowManager.open(t)})}}}function oe(o){return function(t){for(var e,n=t.length,r=function(t){t.attr("contenteditable",o?"true":null)};n--;){var i=t[n];void 0,(e=i.attr("class"))&&/\bimage\b/.test(e)&&(i.attr("contenteditable",o?"false":null),Bt.each(i.getAll("figcaption"),r))}}}var ae=function(t){return{title:"Advanced",name:"advanced",items:[{type:"input",label:"Style",name:"style"},{type:"grid",columns:2,items:[{type:"input",label:"Vertical space",name:"vspace"},{type:"input",label:"Horizontal space",name:"hspace"},{type:"input",label:"Border width",name:"border"},{type:"selectbox",name:"borderstyle",label:"Border style",items:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]}]}]}},ue=function(t){return{title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput"}]}},ce=function(t){t.addCommand("mceImage",ie(t).open)},le=function(t){t.on("PreInit",function(){t.parser.addNodeFilter("figure",oe(!0)),t.serializer.addNodeFilter("figure",oe(!1))})},se=function(e){e.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:ie(e).open,onSetup:function(t){return e.selection.selectorChangedWithUnbind("img:not([data-mce-object],[data-mce-placeholder]),figure.image",t.setActive).unbind}}),e.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:ie(e).open}),e.ui.registry.addContextMenu("image",{update:function(t){return K(t)||function(t){return"IMG"===t.nodeName}(t)&&!kt(t)?["image"]:[]}})};!function fe(){r.add("image",function(t){le(t),se(t),ce(t)})}()}(window);
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
|
-
!function(v){"use strict";var e,n,t,r,o=function(e){var n=e,t=function(){return n};return{get:t,set:function(e){n=e},clone:function(){return o(t())}}},i=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.util.Tools"),p=function(e){return function(){return e}},u=p(!1),c=p(!0),s=u,f=c,l=function(){return d},d=(r={fold:function(e,n){return e()},is:s,isSome:s,isNone:f,getOr:t=function(e){return e},getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:t,orThunk:n,map:l,ap:l,each:function(){},bind:l,flatten:l,exists:s,forall:f,filter:l,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:p("none()")},Object.freeze&&Object.freeze(r),r),m=function(t){var e=function(){return t},n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:f,isNone:s,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return m(e(t))},ap:function(e){return e.fold(l,function(e){return m(e(t))})},each:function(e){e(t)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(t)?o:d},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(s,function(e){return n(t,e)})},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},y={some:m,none:l,from:function(e){return null===e||e===undefined?d:m(e)}};function h(e,n){return b(v.document.createElement("canvas"),e,n)}function g(e){var n=h(e.width,e.height);return w(n).drawImage(e,0,0),n}function w(e){return e.getContext("2d")}function b(e,n,t){return e.width=n,e.height=t,e}var E=window.Promise?window.Promise:function(){var i=function(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],f(e,r(o,this),r(a,this))},e=i.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(e){v.setTimeout(e,1)};function r(e,n){return function(){return e.apply(n,arguments)}}var t=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function u(r){var o=this;null!==this._state?e(function(){var e=o._state?r.onFulfilled:r.onRejected;if(null!==e){var n;try{n=e(o._value)}catch(t){return void r.reject(t)}r.resolve(n)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function o(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void f(r(n,e),r(o,this),r(a,this))}this._state=!0,this._value=e,c.call(this)}catch(t){a.call(this,t)}}function a(e){this._state=!1,this._value=e,c.call(this)}function c(){for(var e=0,n=this._deferreds;e<n.length;e++){var t=n[e];u.call(this,t)}this._deferreds=[]}function s(e,n,t,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof n?n:null,this.resolve=t,this.reject=r}function f(e,n,t){var r=!1;try{e(function(e){r||(r=!0,n(e))},function(e){r||(r=!0,t(e))})}catch(o){if(r)return;r=!0,t(o)}}return i.prototype["catch"]=function(e){return this.then(null,e)},i.prototype.then=function(t,r){var o=this;return new i(function(e,n){u.call(o,new s(t,r,e,n))})},i.all=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var c=Array.prototype.slice.call(1===e.length&&t(e[0])?e[0]:e);return new i(function(o,i){if(0===c.length)return o([]);var u=c.length;function a(n,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var t=e.then;if("function"==typeof t)return void t.call(e,function(e){a(n,e)},i)}c[n]=e,0==--u&&o(c)}catch(r){i(r)}}for(var e=0;e<c.length;e++)a(e,c[e])})},i.resolve=function(n){return n&&"object"==typeof n&&n.constructor===i?n:new i(function(e){e(n)})},i.reject=function(t){return new i(function(e,n){n(t)})},i.race=function(o){return new i(function(e,n){for(var t=0,r=o;t<r.length;t++)r[t].then(e,n)})},i}();function O(e){var n=e.src;return 0===n.indexOf("data:")?I(n):function t(r){return new E(function(e,t){var n=new v.XMLHttpRequest;n.open("GET",r,!0),n.responseType="blob",n.onload=function(){200===this.status&&e(this.response)},n.onerror=function(){var e,n=this;t(0===this.status?((e=new Error("No access to download image")).code=18,e.name="SecurityError",e):new Error("Error "+n.status+" downloading image"))},n.send()})}(n)}function T(a){return new E(function(e,n){var t=v.URL.createObjectURL(a),r=new v.Image,o=function(){r.removeEventListener("load",i),r.removeEventListener("error",u)};function i(){o(),e(r)}function u(){o(),n("Unable to load data of type "+a.type+": "+t)}r.addEventListener("load",i),r.addEventListener("error",u),r.src=t,r.complete&&i()})}function I(t){return new E(function(e,n){(function g(e){var n=e.split(","),t=/data:([^;]+)/.exec(n[0]);if(!t)return y.none();for(var r=t[1],o=n[1],i=v.atob(o),u=i.length,a=Math.ceil(u/1024),c=new Array(a),s=0;s<a;++s){for(var f=1024*s,l=Math.min(f+1024,u),d=new Array(l-f),m=f,h=0;m<l;++h,++m)d[h]=i[m].charCodeAt(0);c[s]=new Uint8Array(d)}return y.some(new v.Blob(c,{type:r}))})(t).fold(function(){n("uri is not base64: "+t)},e)})}function N(e,r,o){return r=r||"image/png",v.HTMLCanvasElement.prototype.toBlob?new E(function(n,t){e.toBlob(function(e){e?n(e):t()},r,o)}):I(e.toDataURL(r,o))}function S(e){return T(e).then(function(e){!function t(e){v.URL.revokeObjectURL(e.src)}(e);var n=h(function r(e){return e.naturalWidth||e.width}(e),function o(e){return e.naturalHeight||e.height}(e));return w(n).drawImage(e,0,0),n})}function _(e,n,t){var r=n.type;function o(n,t){return e.then(function(e){return function r(e,n,t){return n=n||"image/png",e.toDataURL(n,t)}(e,n,t)})}return{getType:p(r),toBlob:function i(){return E.resolve(n)},toDataURL:function u(){return t},toBase64:function a(){return t.split(",")[1]},toAdjustedBlob:function c(n,t){return e.then(function(e){return N(e,n,t)})},toAdjustedDataURL:o,toAdjustedBase64:function s(e,n){return o(e,n).then(function(e){return e.split(",")[1]})},toCanvas:function f(){return e.then(g)}}}function x(n){return function e(t){return new E(function(e){var n=new v.FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)})}(n).then(function(e){return _(S(n),n,e)})}function R(n,e){return N(n,e).then(function(e){return _(E.resolve(n),e,n.toDataURL())})}function A(n,t){return n.toCanvas().then(function(e){return function a(e,n,t){var r=h(e.width,e.height),o=w(r),i=0,u=0;90!==(t=t<0?360+t:t)&&270!==t||b(r,r.height,r.width);90!==t&&180!==t||(i=r.width);270!==t&&180!==t||(u=r.height);return o.translate(i,u),o.rotate(t*Math.PI/180),o.drawImage(e,0,0),R(r,n)}(e,n.getType(),t)})}function C(n,t){return n.toCanvas().then(function(e){return function i(e,n,t){var r=h(e.width,e.height),o=w(r);"v"===t?(o.scale(1,-1),o.drawImage(e,0,-r.height)):(o.scale(-1,1),o.drawImage(e,-r.width,0));return R(r,n)}(e,n.getType(),t)})}var U=function(e){return x(e)},D=tinymce.util.Tools.resolve("tinymce.util.Delay"),j=tinymce.util.Tools.resolve("tinymce.util.Promise"),L=tinymce.util.Tools.resolve("tinymce.util.URI");var k,P={getImageSize:function mn(e){var n,t;function r(e){return/^[0-9\.]+px$/.test(e)}return n=e.style.width,t=e.style.height,n||t?r(n)&&r(t)?{w:parseInt(n,10),h:parseInt(t,10)}:null:(n=e.width,t=e.height,n&&t?{w:parseInt(n,10),h:parseInt(t,10)}:null)},setImageSize:function hn(e,n){var t,r;n&&(t=e.style.width,r=e.style.height,(t||r)&&(e.style.width=n.w+"px",e.style.height=n.h+"px",e.removeAttribute("data-mce-style")),t=e.width,r=e.height,(t||r)&&(e.setAttribute("width",n.w),e.setAttribute("height",n.h)))},getNaturalImageSize:function gn(e){return{w:e.naturalWidth,h:e.naturalHeight}}},M=(k="function",function(e){return function(e){if(null===e)return"null";var n=typeof e;return"object"===n&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===n&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":n}(e)===k}),B=Array.prototype.slice,F=function(e,n){for(var t=0,r=e.length;t<r;t++){var o=e[t];if(n(o,t,e))return y.some(o)}return y.none()},z=(M(Array.from)&&Array.from,function(e){return null!==e&&e!==undefined}),H=function(e,n){var t;return t=n.reduce(function(e,n){return z(e)?e[n]:undefined},e),z(t)?t:null},q=function(n){return new j(function(t){var e=new v.FileReader;e.onload=function(e){var n=e.target;t(n.result)},e.readAsText(n)})},$=function(n,r,o){return new j(function(e){var t;(t=new v.XMLHttpRequest).onreadystatechange=function(){4===t.readyState&&e({status:t.status,blob:this.response})},t.open("GET",n,!0),t.withCredentials=o,a.each(r,function(e,n){t.setRequestHeader(n,e)}),t.responseType="blob",t.send()})},X=function(e){var n;try{n=JSON.parse(e)}catch(t){}return n},W=[{code:404,message:"Could not find Image Proxy"},{code:403,message:"Rejected request"},{code:0,message:"Incorrect Image Proxy URL"}],G=[{type:"key_missing",message:"The request did not include an api key."},{type:"key_not_found",message:"The provided api key could not be found."},{type:"domain_not_trusted",message:"The api key is not valid for the request origins."}],Y=function(n){return"ImageProxy HTTP error: "+F(W,function(e){return n===e.code}).fold(p("Unknown ImageProxy error"),function(e){return e.message})},V=function(e){var n=Y(e);return j.reject(n)},J=function(n){return F(G,function(e){return e.type===n}).fold(p("Unknown service error"),function(e){return e.message})},K=function(e,n){return q(n).then(function(e){var n,t,r=(n=X(e),"ImageProxy Service error: "+((t=H(n,["error","type"]))?J(t):"Invalid JSON in service error message"));return j.reject(r)})},Q=function(e,n){return 400===(t=e)||403===t||500===t?K(0,n):V(e);var t},Z=V,ee=function(e,n){var t,r,o,i={"Content-Type":"application/json;charset=UTF-8","tiny-api-key":n};return $((t=e,r=n,o=-1===t.indexOf("?")?"?":"&",/[?&]apiKey=/.test(t)||!r?t:t+o+"apiKey="+encodeURIComponent(r)),i,!1).then(function(e){return e.status<200||300<=e.status?Q(e.status,e.blob):j.resolve(e.blob)})};var ne,te,re,oe=function(e,n,t){return n?ee(e,n):function r(e,n){return $(e,{},n).then(function(e){return e.status<200||300<=e.status?Z(e.status):j.resolve(e.blob)})}(e,t)},ie=function(e,n,t){return 0!=(e.compareDocumentPosition(n)&t)},ue=function(e,n){return ie(e,n,v.Node.DOCUMENT_POSITION_CONTAINED_BY)},ae=function(e,n){var t=function(e,n){for(var t=0;t<e.length;t++){var r=e[t];if(r.test(n))return r}return undefined}(e,n);if(!t)return{major:0,minor:0};var r=function(e){return Number(n.replace(t,"$"+e))};return se(r(1),r(2))},ce=function(){return se(0,0)},se=function(e,n){return{major:e,minor:n}},fe={nu:se,detect:function(e,n){var t=String(n).toLowerCase();return 0===e.length?ce():ae(e,t)},unknown:ce},le="Firefox",de=function(e,n){return function(){return n===e}},me=function(e){var n=e.current;return{current:n,version:e.version,isEdge:de("Edge",n),isChrome:de("Chrome",n),isIE:de("IE",n),isOpera:de("Opera",n),isFirefox:de(le,n),isSafari:de("Safari",n)}},he={unknown:function(){return me({current:undefined,version:fe.unknown()})},nu:me,edge:p("Edge"),chrome:p("Chrome"),ie:p("IE"),opera:p("Opera"),firefox:p(le),safari:p("Safari")},ge="Windows",ve="Android",pe="Solaris",ye="FreeBSD",we=function(e,n){return function(){return n===e}},be=function(e){var n=e.current;return{current:n,version:e.version,isWindows:we(ge,n),isiOS:we("iOS",n),isAndroid:we(ve,n),isOSX:we("OSX",n),isLinux:we("Linux",n),isSolaris:we(pe,n),isFreeBSD:we(ye,n)}},Ee={unknown:function(){return be({current:undefined,version:fe.unknown()})},nu:be,windows:p(ge),ios:p("iOS"),android:p(ve),linux:p("Linux"),osx:p("OSX"),solaris:p(pe),freebsd:p(ye)},Oe=function(e,n){var t=String(n).toLowerCase();return F(e,function(e){return e.search(t)})},Te=function(e,t){return Oe(e,t).map(function(e){var n=fe.detect(e.versionRegexes,t);return{current:e.name,version:n}})},Ie=function(e,t){return Oe(e,t).map(function(e){var n=fe.detect(e.versionRegexes,t);return{current:e.name,version:n}})},Ne=function(e,n){return-1!==e.indexOf(n)},Se=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,_e=function(n){return function(e){return Ne(e,n)}},xe=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return Ne(e,"edge/")&&Ne(e,"chrome")&&Ne(e,"safari")&&Ne(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Se],search:function(e){return Ne(e,"chrome")&&!Ne(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return Ne(e,"msie")||Ne(e,"trident")}},{name:"Opera",versionRegexes:[Se,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:_e("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:_e("firefox")},{name:"Safari",versionRegexes:[Se,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(Ne(e,"safari")||Ne(e,"mobile/"))&&Ne(e,"applewebkit")}}],Re=[{name:"Windows",search:_e("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return Ne(e,"iphone")||Ne(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:_e("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:_e("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:_e("linux"),versionRegexes:[]},{name:"Solaris",search:_e("sunos"),versionRegexes:[]},{name:"FreeBSD",search:_e("freebsd"),versionRegexes:[]}],Ae={browsers:p(xe),oses:p(Re)},Ce=function(e){var n,t,r,o,i,u,a,c,s,f,l,d=Ae.browsers(),m=Ae.oses(),h=Te(d,e).fold(he.unknown,he.nu),g=Ie(m,e).fold(Ee.unknown,Ee.nu);return{browser:h,os:g,deviceType:(t=h,r=e,o=(n=g).isiOS()&&!0===/ipad/i.test(r),i=n.isiOS()&&!o,u=n.isAndroid()&&3===n.version.major,a=n.isAndroid()&&4===n.version.major,c=o||u||a&&!0===/mobile/i.test(r),s=n.isiOS()||n.isAndroid(),f=s&&!c,l=t.isSafari()&&n.isiOS()&&!1===/safari/i.test(r),{isiPad:p(o),isiPhone:p(i),isTablet:p(c),isPhone:p(f),isTouch:p(s),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:p(l)})}},Ue={detect:(re=!(ne=function(){var e=v.navigator.userAgent;return Ce(e)}),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return re||(re=!0,te=ne.apply(null,e)),te})},De=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:p(e)}},je={fromHtml:function(e,n){var t=(n||v.document).createElement("div");if(t.innerHTML=e,!t.hasChildNodes()||1<t.childNodes.length)throw v.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return De(t.childNodes[0])},fromTag:function(e,n){var t=(n||v.document).createElement(e);return De(t)},fromText:function(e,n){var t=(n||v.document).createTextNode(e);return De(t)},fromDom:De,fromPoint:function(e,n,t){var r=e.dom();return y.from(r.elementFromPoint(n,t)).map(De)}},Le=(v.Node.ATTRIBUTE_NODE,v.Node.CDATA_SECTION_NODE,v.Node.COMMENT_NODE,v.Node.DOCUMENT_NODE,v.Node.DOCUMENT_TYPE_NODE,v.Node.DOCUMENT_FRAGMENT_NODE,v.Node.ELEMENT_NODE),ke=(v.Node.TEXT_NODE,v.Node.PROCESSING_INSTRUCTION_NODE,v.Node.ENTITY_REFERENCE_NODE,v.Node.ENTITY_NODE,v.Node.NOTATION_NODE,Le),Pe=(Ue.detect().browser.isIE(),"undefined"!=typeof v.window?v.window:Function("return this;")(),function(e,n){return t=function(e){return function(e,n){var t=e.dom();if(t.nodeType!==ke)return!1;var r=t;if(r.matches!==undefined)return r.matches(n);if(r.msMatchesSelector!==undefined)return r.msMatchesSelector(n);if(r.webkitMatchesSelector!==undefined)return r.webkitMatchesSelector(n);if(r.mozMatchesSelector!==undefined)return r.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")}(e,n)},F(e.dom().childNodes,function(e){return t(je.fromDom(e))}).map(je.fromDom);var t}),Me=0,Be=function(e){return Pe(je.fromDom(e),"img")},Fe=function(e,n){return e.dom.is(n,"figure")},ze=function(e,n){e.notificationManager.open({text:n,type:"error"})},He=function(e){var n=e.selection.getNode();return Fe(e,n)?Be(n):y.some(je.fromDom(n))},qe=function(e,n){var t=n.src;return 0===t.indexOf("data:")||0===t.indexOf("blob:")||new L(t).host===e.documentBaseURI.host},$e=function(e,n){return-1!==a.inArray(e.getParam("imagetools_cors_hosts",[],"string[]"),new L(n.src).host)},Xe=function(e,n){var t,r,o,i,u=n.src;return $e(e,n)?oe(n.src,null,(r=e,o=n,-1!==a.inArray(r.getParam("imagetools_credentials_hosts",[],"string[]"),new L(o.src).host))):qe(e,n)?O(n):(u=e.getParam("imagetools_proxy"),u+=(-1===u.indexOf("?")?"?":"&")+"url="+encodeURIComponent(n.src),t=(i=e).getParam("api_key",i.getParam("imagetools_api_key","","string"),"string"),oe(u,t,!1))},We=function(e,n){return(t=e,y.from(t.getParam("imagetools_fetch_image",null,"function"))).fold(function(){return Xe(e,n)},function(e){return e(n)});var t},Ge=function(e,n){var t;return(t=e.editorUpload.blobCache.getByUri(n.src))?j.resolve(t.blob()):We(e,n)},Ye=function(e){D.clearTimeout(e.get())},Ve=function(a,c,s,f,l,d){return c.toBlob().then(function(e){var n,t,r,o,i,u;return r=a.editorUpload.blobCache,n=l.src,a.getParam("images_reuse_filename",!1,"boolean")&&(t=(o=r.getByUri(n))?(n=o.uri(),o.name()):(i=a,(u=n.match(/\/([^\/\?]+)?\.(?:jpeg|jpg|png|gif)(?:\?|$)/i))?i.dom.encode(u[1]):null)),o=r.create({id:"imagetools"+Me++,blob:e,base64:c.toBase64(),uri:n,name:t}),r.add(o),a.undoManager.transact(function(){a.$(l).on("load",function r(){var e,n,t;a.$(l).off("load",r),a.nodeChanged(),s?a.editorUpload.uploadImagesAuto():(Ye(f),e=a,n=f,t=D.setEditorTimeout(e,function(){e.editorUpload.uploadImagesAuto()},e.getParam("images_upload_timeout",3e4,"number")),n.set(t))}),d&&a.$(l).attr({width:d.w,height:d.h}),a.$(l).attr({src:o.blobUri()}).removeAttr("data-mce-src")}),o})},Je=function(t,r,e,o){return function(){return He(t).fold(function(){ze(t,"Could not find selected image")},function(n){return t._scanForImages().then(function(){return Ge(t,n.dom())}).then(U).then(e).then(function(e){return Ve(t,e,!1,r,n.dom(),o)},function(e){ze(t,e)})})}},Ke=function(n,t,r){return function(){var e=He(n).fold(function(){return null},function(e){var n=P.getImageSize(e.dom());return n?{w:n.h,h:n.w}:null});return Je(n,t,function(e){return A(e,r)},e)()}},Qe=function(e,n,t){return function(){return Je(e,n,function(e){return C(e,t)})()}},Ze=function(t,e){var n=function(e){return n=e,t.dom.is(n,"img:not([data-mce-object],[data-mce-placeholder])")&&(qe(t,e)||$e(t,e)||t.settings.imagetools_proxy);var n};return Fe(t,e)?Be(e).map(function(e){return n(e.dom())?y.some(e.dom()):y.none()}):n(e)?y.some(e):y.none()},en=Ye,nn=Ge,tn=He,rn=function(t,r,o,i,u){return new j(function(e){var n;(n=u,T(n)).then(function(e){var n=P.getNaturalImageSize(e);return i.w===n.w&&i.h===n.h||P.getImageSize(o)&&P.setImageSize(o,n),v.URL.revokeObjectURL(e.src),u}).then(U).then(function(e){return Ve(t,e,!0,r,o)},function(){})})},on=p("save-state"),un=p("disable"),an=p("enable"),cn=function(i,u){return function(){var r=tn(i),o=r.map(function(e){return P.getNaturalImageSize(e.dom())});tn(i).each(function(n){Ze(i,n.dom()).each(function(e){nn(i,n.dom()).then(function(e){var n,t={blob:n=e,url:v.URL.createObjectURL(n)};i.windowManager.open({title:"Edit Image",size:"large",body:{type:"panel",items:[{type:"imagetools",name:"imagetools",label:"Edit Image",currentState:t}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0,disabled:!0}],onSubmit:function(e){var t=e.getData().imagetools.blob;r.each(function(n){o.each(function(e){rn(i,u,n.dom(),e,t)})}),e.close()},onCancel:function(){},onAction:function(e,n){switch(n.name){case on():n.value?e.enable("save"):e.disable("save");break;case un():e.disable("save"),e.disable("cancel");break;case an():e.enable("cancel")}}})})})})}},sn=function(t,e){a.each({mceImageRotateLeft:Ke(t,e,-90),mceImageRotateRight:Ke(t,e,90),mceImageFlipVertical:Qe(t,e,"v"),mceImageFlipHorizontal:Qe(t,e,"h"),mceEditImage:cn(t,e)},function(e,n){t.addCommand(n,e)})},fn=function(t,r,o){t.on("NodeChange",function(e){var n=o.get();n&&n.src!==e.element.src&&(en(r),t.editorUpload.uploadImagesAuto(),o.set(null)),Ze(t,e.element).each(o.set)})},ln=function(r){var n=function(e){return function(){return r.execCommand(e)}};r.ui.registry.addButton("rotateleft",{tooltip:"Rotate counterclockwise",icon:"rotate-left",onAction:n("mceImageRotateLeft")}),r.ui.registry.addButton("rotateright",{tooltip:"Rotate clockwise",icon:"rotate-right",onAction:n("mceImageRotateRight")}),r.ui.registry.addButton("flipv",{tooltip:"Flip vertically",icon:"flip-vertically",onAction:n("mceImageFlipVertical")}),r.ui.registry.addButton("fliph",{tooltip:"Flip horizontally",icon:"flip-horizontally",onAction:n("mceImageFlipHorizontal")}),r.ui.registry.addButton("editimage",{tooltip:"Edit image",icon:"edit-image",onAction:n("mceEditImage"),onSetup:function(t){var e=function(){tn(r).each(function(e){var n=Ze(r,e.dom()).isNone();t.setDisabled(n)})};return r.on("NodeChange",e),function(){r.off("NodeChange",e)}}}),r.ui.registry.addButton("imageoptions",{tooltip:"Image options",icon:"image-options",onAction:n("mceImage")}),r.ui.registry.addContextMenu("imagetools",{update:function(e){return Ze(r,e).fold(function(){return[]},function(e){return[{text:"Edit image",icon:"edit-image",onAction:n("mceEditImage")}]})}})},dn=function(n){var e;n.ui.registry.addContextToolbar("imagetools",{items:(e=n,e.getParam("imagetools_toolbar","rotateleft rotateright flipv fliph editimage imageoptions")),predicate:function(e){return Ze(n,e).isSome()},position:"node",scope:"node"})};!function vn(){i.add("imagetools",function(e){var n=o(0),t=o(null);sn(e,n),ln(e),dn(e),fn(e,n,t)})}()}(window);
|
9
|
+
!function(v){"use strict";function e(){}function n(){return c}var t,r=function(e){function n(){return t}var t=e;return{get:n,set:function(e){t=e},clone:function(){return r(n())}}},o=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),l=function(e){return function(){return e}},u=l(!1),a=l(!0),c=(t={fold:function(e,n){return e()},is:u,isSome:u,isNone:a,getOr:d,getOrThunk:f,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:l(null),getOrUndefined:l(undefined),or:d,orThunk:f,map:n,each:e,bind:n,exists:u,forall:a,filter:n,equals:s,equals_:s,toArray:function(){return[]},toString:l("none()")},Object.freeze&&Object.freeze(t),t);function s(e){return e.isNone()}function f(e){return e()}function d(e){return e}var m=function(t){function e(){return o}function n(e){return e(t)}var r=l(t),o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:a,isNone:u,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:e,orThunk:e,map:function(e){return m(e(t))},each:function(e){e(t)},bind:n,exists:n,forall:n,filter:function(e){return e(t)?o:c},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(u,function(e){return n(t,e)})}};return o},p={some:m,none:n,from:function(e){return null===e||e===undefined?c:m(e)}};function h(e,n){return w(v.document.createElement("canvas"),e,n)}function g(e){var n=h(e.width,e.height);return y(n).drawImage(e,0,0),n}function y(e){return e.getContext("2d")}function w(e,n,t){return e.width=n,e.height=t,e}var b,E,O=window.Promise?window.Promise:(b=T.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(e){v.setTimeout(e,1)},E=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},T.prototype["catch"]=function(e){return this.then(null,e)},T.prototype.then=function(t,r){var o=this;return new T(function(e,n){N.call(o,new R(t,r,e,n))})},T.all=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var c=Array.prototype.slice.call(1===e.length&&E(e[0])?e[0]:e);return new T(function(o,i){if(0===c.length)return o([]);var u=c.length;function a(n,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var t=e.then;if("function"==typeof t)return void t.call(e,function(e){a(n,e)},i)}c[n]=e,0==--u&&o(c)}catch(r){i(r)}}for(var e=0;e<c.length;e++)a(e,c[e])})},T.resolve=function(n){return n&&"object"==typeof n&&n.constructor===T?n:new T(function(e){e(n)})},T.reject=function(t){return new T(function(e,n){n(t)})},T.race=function(o){return new T(function(e,n){for(var t=0,r=o;t<r.length;t++)r[t].then(e,n)})},T);function T(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],A(e,I(S,this),I(_,this))}function I(e,n){return function(){return e.apply(n,arguments)}}function N(r){var o=this;null!==this._state?b(function(){var e=o._state?r.onFulfilled:r.onRejected;if(null!==e){var n;try{n=e(o._value)}catch(t){return void r.reject(t)}r.resolve(n)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function S(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void A(I(n,e),I(S,this),I(_,this))}this._state=!0,this._value=e,x.call(this)}catch(t){_.call(this,t)}}function _(e){this._state=!1,this._value=e,x.call(this)}function x(){for(var e=0,n=this._deferreds;e<n.length;e++){var t=n[e];N.call(this,t)}this._deferreds=[]}function R(e,n,t,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof n?n:null,this.resolve=t,this.reject=r}function A(e,n,t){var r=!1;try{e(function(e){r||(r=!0,n(e))},function(e){r||(r=!0,t(e))})}catch(o){if(r)return;r=!0,t(o)}}function C(e){var n=e.src;return 0===n.indexOf("data:")?D(n):function t(r){return new O(function(e,t){var n=new v.XMLHttpRequest;n.open("GET",r,!0),n.responseType="blob",n.onload=function(){200===this.status&&e(this.response)},n.onerror=function(){var e,n=this;t(0===this.status?((e=new Error("No access to download image")).code=18,e.name="SecurityError",e):new Error("Error "+n.status+" downloading image"))},n.send()})}(n)}function U(a){return new O(function(e,n){var t=v.URL.createObjectURL(a),r=new v.Image,o=function(){r.removeEventListener("load",i),r.removeEventListener("error",u)};function i(){o(),e(r)}function u(){o(),n("Unable to load data of type "+a.type+": "+t)}r.addEventListener("load",i),r.addEventListener("error",u),r.src=t,r.complete&&i()})}function D(t){return new O(function(e,n){(function g(e){var n=e.split(","),t=/data:([^;]+)/.exec(n[0]);if(!t)return p.none();for(var r=t[1],o=n[1],i=v.atob(o),u=i.length,a=Math.ceil(u/1024),c=new Array(a),s=0;s<a;++s){for(var f=1024*s,l=Math.min(1024+f,u),d=new Array(l-f),m=f,h=0;m<l;++h,++m)d[h]=i[m].charCodeAt(0);c[s]=new Uint8Array(d)}return p.some(new v.Blob(c,{type:r}))})(t).fold(function(){n("uri is not base64: "+t)},e)})}function j(e,r,o){return r=r||"image/png",v.HTMLCanvasElement.prototype.toBlob?new O(function(n,t){e.toBlob(function(e){e?n(e):t()},r,o)}):D(e.toDataURL(r,o))}function L(e){return U(e).then(function(e){!function t(e){v.URL.revokeObjectURL(e.src)}(e);var n=h(function r(e){return e.naturalWidth||e.width}(e),function o(e){return e.naturalHeight||e.height}(e));return y(n).drawImage(e,0,0),n})}function k(e,n,t){var r=n.type;function o(n,t){return e.then(function(e){return function r(e,n,t){return n=n||"image/png",e.toDataURL(n,t)}(e,n,t)})}return{getType:l(r),toBlob:function i(){return O.resolve(n)},toDataURL:function u(){return t},toBase64:function a(){return t.split(",")[1]},toAdjustedBlob:function c(n,t){return e.then(function(e){return j(e,n,t)})},toAdjustedDataURL:o,toAdjustedBase64:function s(e,n){return o(e,n).then(function(e){return e.split(",")[1]})},toCanvas:function f(){return e.then(g)}}}function P(n){return function e(t){return new O(function(e){var n=new v.FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)})}(n).then(function(e){return k(L(n),n,e)})}function M(n,e){return j(n,e).then(function(e){return k(O.resolve(n),e,n.toDataURL())})}function B(n,t){return n.toCanvas().then(function(e){return function a(e,n,t){var r=h(e.width,e.height),o=y(r),i=0,u=0;90!==(t=t<0?360+t:t)&&270!==t||w(r,r.height,r.width);90!==t&&180!==t||(i=r.width);270!==t&&180!==t||(u=r.height);return o.translate(i,u),o.rotate(t*Math.PI/180),o.drawImage(e,0,0),M(r,n)}(e,n.getType(),t)})}function F(n,t){return n.toCanvas().then(function(e){return function i(e,n,t){var r=h(e.width,e.height),o=y(r);"v"===t?(o.scale(1,-1),o.drawImage(e,0,-r.height)):(o.scale(-1,1),o.drawImage(e,-r.width,0));return M(r,n)}(e,n.getType(),t)})}function z(e){return P(e)}var H=tinymce.util.Tools.resolve("tinymce.util.Delay"),q=tinymce.util.Tools.resolve("tinymce.util.Promise"),$=tinymce.util.Tools.resolve("tinymce.util.URI");function X(e,n){for(var t=0,r=e.length;t<r;t++){var o=e[t];if(n(o,t))return p.some(o)}return p.none()}function W(e){return null!==e&&e!==undefined}function G(n){return"ImageProxy HTTP error: "+X(ue,function(e){return n===e.code}).fold(l("Unknown ImageProxy error"),function(e){return e.message})}function Y(e){var n=G(e);return q.reject(n)}function V(n){return X(ae,function(e){return e.type===n}).fold(l("Unknown service error"),function(e){return e.message})}function J(e,n){return re(n).then(function(e){var n=function(e){var n=ie(e),t=te(n,["error","type"]);return"ImageProxy Service error: "+(t?V(t):"Invalid JSON in service error message")}(e);return q.reject(n)})}function K(e,n){var t={"Content-Type":"application/json;charset=UTF-8","tiny-api-key":n};return oe(function(e,n){var t=-1===e.indexOf("?")?"?":"&";return/[?&]apiKey=/.test(e)||!n?e:e+t+"apiKey="+encodeURIComponent(n)}(e,n),t,!1).then(function(e){return e.status<200||300<=e.status?ce(e.status,e.blob):q.resolve(e.blob)})}var Q,Z={getImageSize:function On(e){var n,t;function r(e){return/^[0-9\.]+px$/.test(e)}return n=e.style.width,t=e.style.height,n||t?r(n)&&r(t)?{w:parseInt(n,10),h:parseInt(t,10)}:null:(n=e.width,t=e.height,n&&t?{w:parseInt(n,10),h:parseInt(t,10)}:null)},setImageSize:function Tn(e,n){var t,r;n&&(t=e.style.width,r=e.style.height,(t||r)&&(e.style.width=n.w+"px",e.style.height=n.h+"px",e.removeAttribute("data-mce-style")),t=e.width,r=e.height,(t||r)&&(e.setAttribute("width",n.w),e.setAttribute("height",n.h)))},getNaturalImageSize:function In(e){return{w:e.naturalWidth,h:e.naturalHeight}}},ee=(Q="function",function(e){return function(e){if(null===e)return"null";var n=typeof e;return"object"==n&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":n}(e)===Q}),ne=Array.prototype.slice,te=(ee(Array.from)&&Array.from,function(e,n){var t;return t=n.reduce(function(e,n){return W(e)?e[n]:undefined},e),W(t)?t:null}),re=function(n){return new q(function(t){var e=new v.FileReader;e.onload=function(e){var n=e.target;t(n.result)},e.readAsText(n)})},oe=function(n,r,o){return new q(function(e){var t;(t=new v.XMLHttpRequest).onreadystatechange=function(){4===t.readyState&&e({status:t.status,blob:this.response})},t.open("GET",n,!0),t.withCredentials=o,i.each(r,function(e,n){t.setRequestHeader(n,e)}),t.responseType="blob",t.send()})},ie=function(e){var n;try{n=JSON.parse(e)}catch(t){}return n},ue=[{code:404,message:"Could not find Image Proxy"},{code:403,message:"Rejected request"},{code:0,message:"Incorrect Image Proxy URL"}],ae=[{type:"key_missing",message:"The request did not include an api key."},{type:"key_not_found",message:"The provided api key could not be found."},{type:"domain_not_trusted",message:"The api key is not valid for the request origins."}],ce=function(e,n){return function(e){return 400===e||403===e||500===e}(e)?J(0,n):Y(e)},se=Y;function fe(e,n,t){return n?K(e,n):function r(e,n){return oe(e,{},n).then(function(e){return e.status<200||300<=e.status?se(e.status):q.resolve(e.blob)})}(e,t)}function le(e,n,t){return 0!=(e.compareDocumentPosition(n)&t)}function de(e,n){var t=function(e,n){for(var t=0;t<e.length;t++){var r=e[t];if(r.test(n))return r}return undefined}(e,n);if(!t)return{major:0,minor:0};function r(e){return Number(n.replace(t,"$"+e))}return je(r(1),r(2))}function me(e,n){return function(){return n===e}}function he(e,n){return function(){return n===e}}function ge(e,n){var t=String(n).toLowerCase();return X(e,function(e){return e.search(t)})}function ve(e,n){return-1!==e.indexOf(n)}function pe(n){return function(e){return ve(e,n)}}function ye(e,n){return function(e,n){return X(e.dom().childNodes,function(e){return n(en.fromDom(e))}).map(en.fromDom)}(e,function(e){return function(e,n){var t=e.dom();if(t.nodeType!==tn)return!1;var r=t;if(r.matches!==undefined)return r.matches(n);if(r.msMatchesSelector!==undefined)return r.msMatchesSelector(n);if(r.webkitMatchesSelector!==undefined)return r.webkitMatchesSelector(n);if(r.mozMatchesSelector!==undefined)return r.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")}(e,n)})}function we(e){return ye(en.fromDom(e),"img")}function be(e,n){return e.dom.is(n,"figure")}function Ee(e,n){e.notificationManager.open({text:n,type:"error"})}function Oe(e){var n=e.selection.getNode();return be(e,n)?we(n):p.some(en.fromDom(n))}function Te(e,n){var t,r=n.src;return un(e,n)?fe(n.src,null,function(e,n){return-1!==i.inArray(function(e){return e.getParam("imagetools_credentials_hosts",[],"string[]")}(e),new $(n.src).host)}(e,n)):on(e,n)?function(e){return C(e)}(n):(r=function(e){return e.getParam("imagetools_proxy")}(e),r+=(-1===r.indexOf("?")?"?":"&")+"url="+encodeURIComponent(n.src),t=function(e){return e.getParam("api_key",e.getParam("imagetools_api_key","","string"),"string")}(e),fe(r,t,!1))}function Ie(e,n){return function(e){return p.from(e.getParam("imagetools_fetch_image",null,"function"))}(e).fold(function(){return Te(e,n)},function(e){return e(n)})}function Ne(e,n){var t;return(t=e.editorUpload.blobCache.getByUri(n.src))?q.resolve(t.blob()):Ie(e,n)}function Se(e){H.clearTimeout(e.get())}function _e(i,u,a,c,s,f){return u.toBlob().then(function(e){var n,t,r,o;return r=i.editorUpload.blobCache,n=s.src,function(e){return e.getParam("images_reuse_filename",!1,"boolean")}(i)&&(t=(o=r.getByUri(n))?(n=o.uri(),o.name()):function(e,n){var t=n.match(/\/([^\/\?]+)?\.(?:jpeg|jpg|png|gif)(?:\?|$)/i);return t?e.dom.encode(t[1]):null}(i,n)),o=r.create({id:"imagetools"+rn++,blob:e,base64:u.toBase64(),uri:n,name:t}),r.add(o),i.undoManager.transact(function(){i.$(s).on("load",function e(){i.$(s).off("load",e),i.nodeChanged(),a?i.editorUpload.uploadImagesAuto():(Se(c),function(e,n){var t=H.setEditorTimeout(e,function(){e.editorUpload.uploadImagesAuto()},function(e){return e.getParam("images_upload_timeout",3e4,"number")}(e));n.set(t)}(i,c))}),f&&i.$(s).attr({width:f.w,height:f.h}),i.$(s).attr({src:o.blobUri()}).removeAttr("data-mce-src")}),o})}function xe(t,r,e,o){return function(){return Oe(t).fold(function(){Ee(t,"Could not find selected image")},function(n){return t._scanForImages().then(function(){return Ne(t,n.dom())}).then(z).then(e).then(function(e){return _e(t,e,!1,r,n.dom(),o)},function(e){Ee(t,e)})})}}var Re,Ae,Ce,Ue=function(e,n){return le(e,n,v.Node.DOCUMENT_POSITION_CONTAINED_BY)},De=function(){return je(0,0)},je=function(e,n){return{major:e,minor:n}},Le={nu:je,detect:function(e,n){var t=String(n).toLowerCase();return 0===e.length?De():de(e,t)},unknown:De},ke="Firefox",Pe=function(e){var n=e.current;return{current:n,version:e.version,isEdge:me("Edge",n),isChrome:me("Chrome",n),isIE:me("IE",n),isOpera:me("Opera",n),isFirefox:me(ke,n),isSafari:me("Safari",n)}},Me={unknown:function(){return Pe({current:undefined,version:Le.unknown()})},nu:Pe,edge:l("Edge"),chrome:l("Chrome"),ie:l("IE"),opera:l("Opera"),firefox:l(ke),safari:l("Safari")},Be="Windows",Fe="Android",ze="Solaris",He="FreeBSD",qe=function(e){var n=e.current;return{current:n,version:e.version,isWindows:he(Be,n),isiOS:he("iOS",n),isAndroid:he(Fe,n),isOSX:he("OSX",n),isLinux:he("Linux",n),isSolaris:he(ze,n),isFreeBSD:he(He,n)}},$e={unknown:function(){return qe({current:undefined,version:Le.unknown()})},nu:qe,windows:l(Be),ios:l("iOS"),android:l(Fe),linux:l("Linux"),osx:l("OSX"),solaris:l(ze),freebsd:l(He)},Xe=function(e,t){return ge(e,t).map(function(e){var n=Le.detect(e.versionRegexes,t);return{current:e.name,version:n}})},We=function(e,t){return ge(e,t).map(function(e){var n=Le.detect(e.versionRegexes,t);return{current:e.name,version:n}})},Ge=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Ye=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return ve(e,"edge/")&&ve(e,"chrome")&&ve(e,"safari")&&ve(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Ge],search:function(e){return ve(e,"chrome")&&!ve(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return ve(e,"msie")||ve(e,"trident")}},{name:"Opera",versionRegexes:[Ge,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:pe("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:pe("firefox")},{name:"Safari",versionRegexes:[Ge,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(ve(e,"safari")||ve(e,"mobile/"))&&ve(e,"applewebkit")}}],Ve=[{name:"Windows",search:pe("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return ve(e,"iphone")||ve(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:pe("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:pe("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:pe("linux"),versionRegexes:[]},{name:"Solaris",search:pe("sunos"),versionRegexes:[]},{name:"FreeBSD",search:pe("freebsd"),versionRegexes:[]}],Je={browsers:l(Ye),oses:l(Ve)},Ke=function(e){var n=Je.browsers(),t=Je.oses(),r=Xe(n,e).fold(Me.unknown,Me.nu),o=We(t,e).fold($e.unknown,$e.nu);return{browser:r,os:o,deviceType:function(e,n,t){var r=e.isiOS()&&!0===/ipad/i.test(t),o=e.isiOS()&&!r,i=e.isAndroid()&&3===e.version.major,u=e.isAndroid()&&4===e.version.major,a=r||i||u&&!0===/mobile/i.test(t),c=e.isiOS()||e.isAndroid(),s=c&&!a,f=n.isSafari()&&e.isiOS()&&!1===/safari/i.test(t);return{isiPad:l(r),isiPhone:l(o),isTablet:l(a),isPhone:l(s),isTouch:l(c),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:l(f)}}(o,r,e)}},Qe={detect:(Ce=!(Re=function(){var e=v.navigator.userAgent;return Ke(e)}),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return Ce||(Ce=!0,Ae=Re.apply(null,e)),Ae})},Ze=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:l(e)}},en={fromHtml:function(e,n){var t=(n||v.document).createElement("div");if(t.innerHTML=e,!t.hasChildNodes()||1<t.childNodes.length)throw v.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return Ze(t.childNodes[0])},fromTag:function(e,n){var t=(n||v.document).createElement(e);return Ze(t)},fromText:function(e,n){var t=(n||v.document).createTextNode(e);return Ze(t)},fromDom:Ze,fromPoint:function(e,n,t){var r=e.dom();return p.from(r.elementFromPoint(n,t)).map(Ze)}},nn=(v.Node.ATTRIBUTE_NODE,v.Node.CDATA_SECTION_NODE,v.Node.COMMENT_NODE,v.Node.DOCUMENT_NODE,v.Node.DOCUMENT_TYPE_NODE,v.Node.DOCUMENT_FRAGMENT_NODE,v.Node.ELEMENT_NODE),tn=(v.Node.TEXT_NODE,v.Node.PROCESSING_INSTRUCTION_NODE,v.Node.ENTITY_REFERENCE_NODE,v.Node.ENTITY_NODE,v.Node.NOTATION_NODE,nn),rn=(Qe.detect().browser.isIE(),"undefined"!=typeof v.window?v.window:Function("return this;")(),0),on=function(e,n){var t=n.src;return 0===t.indexOf("data:")||0===t.indexOf("blob:")||new $(t).host===e.documentBaseURI.host},un=function(e,n){return-1!==i.inArray(function(e){return e.getParam("imagetools_cors_hosts",[],"string[]")}(e),new $(n.src).host)},an=function(n,t,r){return function(){var e=Oe(n).fold(function(){return null},function(e){var n=Z.getImageSize(e.dom());return n?{w:n.h,h:n.w}:null});return xe(n,t,function(e){return function(e,n){return B(e,n)}(e,r)},e)()}},cn=function(e,n,t){return function(){return xe(e,n,function(e){return function(e,n){return F(e,n)}(e,t)})()}},sn=function(n,e){function t(e){return function(e){return n.dom.is(e,"img:not([data-mce-object],[data-mce-placeholder])")}(e)&&(on(n,e)||un(n,e)||n.settings.imagetools_proxy)}return be(n,e)?we(e).map(function(e){return t(e.dom())?p.some(e.dom()):p.none()}):t(e)?p.some(e):p.none()},fn=Se,ln=Ne,dn=Oe,mn=function(n,t,r,o,i){return new q(function(e){(function(e){return U(e)})(i).then(function(e){var n=Z.getNaturalImageSize(e);return o.w===n.w&&o.h===n.h||Z.getImageSize(r)&&Z.setImageSize(r,n),v.URL.revokeObjectURL(e.src),i}).then(z).then(function(e){return _e(n,e,!0,t,r)},function(){})})},hn=l("save-state"),gn=l("disable"),vn=l("enable"),pn=function(i,u){return function(){var r=dn(i),o=r.map(function(e){return Z.getNaturalImageSize(e.dom())});dn(i).each(function(n){sn(i,n.dom()).each(function(e){ln(i,n.dom()).then(function(e){var n=function(e){return{blob:e,url:v.URL.createObjectURL(e)}}(e);i.windowManager.open(function(e){return{title:"Edit Image",size:"large",body:{type:"panel",items:[{type:"imagetools",name:"imagetools",label:"Edit Image",currentState:e}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0,disabled:!0}],onSubmit:function(e){var t=e.getData().imagetools.blob;r.each(function(n){o.each(function(e){mn(i,u,n.dom(),e,t)})}),e.close()},onCancel:function(){},onAction:function(e,n){switch(n.name){case hn():n.value?e.enable("save"):e.disable("save");break;case gn():e.disable("save"),e.disable("cancel");break;case vn():e.enable("cancel")}}}}(n))})})})}},yn=function(t,e){i.each({mceImageRotateLeft:an(t,e,-90),mceImageRotateRight:an(t,e,90),mceImageFlipVertical:cn(t,e,"v"),mceImageFlipHorizontal:cn(t,e,"h"),mceEditImage:pn(t,e)},function(e,n){t.addCommand(n,e)})},wn=function(t,r,o){t.on("NodeChange",function(e){var n=o.get();n&&n.src!==e.element.src&&(fn(r),t.editorUpload.uploadImagesAuto(),o.set(null)),sn(t,e.element).each(o.set)})},bn=function(r){function n(e){return function(){return r.execCommand(e)}}r.ui.registry.addButton("rotateleft",{tooltip:"Rotate counterclockwise",icon:"rotate-left",onAction:n("mceImageRotateLeft")}),r.ui.registry.addButton("rotateright",{tooltip:"Rotate clockwise",icon:"rotate-right",onAction:n("mceImageRotateRight")}),r.ui.registry.addButton("flipv",{tooltip:"Flip vertically",icon:"flip-vertically",onAction:n("mceImageFlipVertical")}),r.ui.registry.addButton("fliph",{tooltip:"Flip horizontally",icon:"flip-horizontally",onAction:n("mceImageFlipHorizontal")}),r.ui.registry.addButton("editimage",{tooltip:"Edit image",icon:"edit-image",onAction:n("mceEditImage"),onSetup:function(t){function e(){dn(r).each(function(e){var n=sn(r,e.dom()).isNone();t.setDisabled(n)})}return r.on("NodeChange",e),function(){r.off("NodeChange",e)}}}),r.ui.registry.addButton("imageoptions",{tooltip:"Image options",icon:"image-options",onAction:n("mceImage")}),r.ui.registry.addContextMenu("imagetools",{update:function(e){return sn(r,e).fold(function(){return[]},function(e){return[{text:"Edit image",icon:"edit-image",onAction:n("mceEditImage")}]})}})},En=function(n){n.ui.registry.addContextToolbar("imagetools",{items:function(e){return e.getParam("imagetools_toolbar","rotateleft rotateright flipv fliph editimage imageoptions")}(n),predicate:function(e){return sn(n,e).isSome()},position:"node",scope:"node"})};!function Nn(){o.add("imagetools",function(e){var n=r(0),t=r(null);yn(e,n),bn(e),En(e),wn(e,n,t)})}()}(window);
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
|
-
!function(){"use strict";
|
9
|
+
!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,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
|
-
!function(){"use strict";
|
9
|
+
!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,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
|
-
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),
|
9
|
+
!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")},o=function(e,t){e.settings.inline_styles=t},r=function(e){!function(e){o(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("init",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){r(e)})}()}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
|
-
!function(c){"use strict";var n,t,e,r,o,i,u,a,s,l=tinymce.util.Tools.resolve("tinymce.PluginManager"),f=tinymce.util.Tools.resolve("tinymce.util.VK"),d=function(t){return 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)===t}},m=d("string"),h=d("array"),p=d("boolean"),g=d("function"),v=function(n){var t=n.getParam("link_assume_external_targets",!1);return p(t)&&t?1:!m(t)||"http"!==t&&"https"!==t?0:t},y=function(n){return n.getParam("link_context_toolbar",!1,"boolean")},w=function(n){return n.getParam("link_list")},x=function(n){return n.getParam("default_link_target")},k=function(n){return n.getParam("target_list",!0)},b=function(n){return n.getParam("rel_list",[],"array")},_=function(n){return n.getParam("link_class_list",[],"array")},T=function(n){return n.getParam("link_title",!0,"boolean")},O=function(n){return n.getParam("allow_unsafe_link_target",!1,"boolean")},A=function(n){return n.getParam("link_quicklink",!1,"boolean")},C=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),P=tinymce.util.Tools.resolve("tinymce.Env"),N=function(n){if(!P.ie||10<P.ie){var t=c.document.createElement("a");t.target="_blank",t.href=n,t.rel="noreferrer noopener";var e=c.document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,c.window,0,0,0,0,0,!1,!1,!1,!1,0,null),i=t,u=e,c.document.body.appendChild(i),i.dispatchEvent(u),c.document.body.removeChild(i)}else{var r=c.window.open("","_blank");if(r){r.opener=null;var o=r.document;o.open(),o.write('<meta http-equiv="refresh" content="0; url='+C.DOM.encode(n)+'">'),o.close()}}var i,u},E=function(){},I=function(n){return function(){return n}},j=I(!1),S=I(!0),F=j,L=S,R=function(){return D},D=(r={fold:function(n,t){return n()},is:F,isSome:F,isNone:L,getOr:e=function(n){return n},getOrThunk:t=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:e,orThunk:t,map:R,ap:R,each:function(){},bind:R,flatten:R,exists:F,forall:L,filter:R,equals:n=function(n){return n.isNone()},equals_:n,toArray:function(){return[]},toString:I("none()")},Object.freeze&&Object.freeze(r),r),U=function(e){var n=function(){return e},t=function(){return o},r=function(n){return n(e)},o={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:L,isNone:F,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:t,orThunk:t,map:function(n){return U(n(e))},ap:function(n){return n.fold(R,function(n){return U(n(e))})},each:function(n){n(e)},bind:r,flatten:n,exists:r,forall:r,filter:function(n){return n(e)?o:D},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(F,function(n){return t(e,n)})},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},M={some:U,none:R,from:function(n){return null===n||n===undefined?D:U(n)}},z=Array.prototype.slice,q=(o=Array.prototype.indexOf)===undefined?function(n,t){return B(n,t)}:function(n,t){return o.call(n,t)},K=function(n,t){for(var e=0,r=n.length;e<r;e++){t(n[e],e,n)}},B=function(n,t){for(var e=0,r=n.length;e<r;++e)if(n[e]===t)return e;return-1},V=Array.prototype.push,W=function(n){for(var t=[],e=0,r=n.length;e<r;++e){if(!h(n[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+n);V.apply(t,n[e])}return t},H=function(n,t){var e=function(n,t){for(var e=n.length,r=new Array(e),o=0;o<e;o++){var i=n[o];r[o]=t(i,o,n)}return r}(n,t);return W(e)},$=(g(Array.from)&&Array.from,tinymce.util.Tools.resolve("tinymce.util.Tools")),G=function(n){return/^\w+:/i.test(n)},J=function(n,t){var e,r,o=["noopener"],i=n?n.split(/\s+/):[],u=function(n){return n.filter(function(n){return-1===$.inArray(o,n)})},c=t?0<(e=u(e=i)).length?e.concat(o):o:u(i);return 0<c.length?(r=c,$.trim(r.sort().join(" "))):""},X=function(n,t){return t=t||n.selection.getNode(),Y(t)?n.dom.select("a[href]",t)[0]:n.dom.getParent(t,"a[href]")},Q=function(n){return n&&"A"===n.nodeName&&!!n.href},Y=function(n){return n&&"FIGURE"===n.nodeName&&/\bimage\b/i.test(n.className)},Z=function(n){return t=["title","rel","class","target"],e=function(t,e){return n[e].each(function(n){t[e]=0<n.length?n:null}),t},r={href:n.href},K(t,function(n){r=e(r,n)}),r;var t,e,r},nn=function(n,t){var e=n.dom.select("img",t)[0];if(e){var r=n.dom.getParents(e,"a[href]",t)[0];r&&(r.parentNode.insertBefore(e,r),n.dom.remove(r))}},tn=function(n,t,e){var r=n.dom.select("img",t)[0];if(r){var o=n.dom.create("a",e);r.parentNode.insertBefore(o,r),o.appendChild(r)}},en=function(h,p,g){h.undoManager.transact(function(){var n,t,e,r,o,i,u,c,a,l,f=h.selection.getNode(),s=X(h,f),d=Z(g);if(!(0<b(h).length)&&!1===O(h)){var m=J(d.rel,"_blank"===d.target);d.rel=m||null}M.from(d.target).isNone()&&(d.target=x(h)),d.href=(n=d.href,"http"!==(t=v(h))&&"https"!==t||G(n)?n:t+"://"+n),g.href===p.href&&p.attach(),s?(h.focus(),u=h,c=s,a=g.text,l=d,a.each(function(n){c.hasOwnProperty("innerText")?c.innerText=n:c.textContent=n}),u.dom.setAttribs(c,l),u.selection.select(c)):(e=h,r=f,o=g.text,i=d,Y(r)?tn(e,r,i):o.fold(function(){e.execCommand("mceInsertLink",!1,i)},function(n){e.insertContent(e.dom.createHTML("a",i,e.dom.encode(n)))}))})},rn=function(e){e.undoManager.transact(function(){var n=e.selection.getNode();if(Y(n))nn(e,n);else{var t=e.dom.getParent(n,"a[href]",e.getBody());t&&e.dom.remove(t,!0)}e.focus()})},on=function(n){return 0<$.grep(n,Q).length},un=function(n){var t=n.getAttribute("data-mce-href");return t||n.getAttribute("href")},cn=function(n){return!(/</.test(n)&&(!/^<a [^>]+>[^<]+<\/a>$/.test(n)||-1===n.indexOf("href=")))},an=X,ln=function(n,t){var e=t?t.innerText||t.textContent:n.getContent({format:"text"});return e.replace(/\uFEFF/g,"")},fn=J,sn=G,dn=function(n,t){for(var e=0;e<n.length;e++){var r=t(n[e],e);if(r.isSome())return r}return M.none()},mn=function(n){return m(n.value)?n.value:""},hn=function(e){return void 0===e&&(e=mn),function(n){return M.from(n).map(function(n){return t=n,r=e,o=[],$.each(t,function(n){var t=m(n.text)?n.text:m(n.title)?n.title:"";if(n.menu!==undefined);else{var e=r(n);o.push({text:t,value:e})}}),o;var t,r,o})}},pn={sanitize:function(n){return hn(mn)(n)},sanitizeWith:hn,createUi:function(t,e){return function(n){return{name:t,type:"selectbox",label:e,items:n}}},getValue:mn},gn=function(n){var t=n,e=function(){return t};return{get:e,set:function(n){t=n},clone:function(){return gn(e())}}},vn=function(t,n,e,r){var o,i,u=r[n],c=0<t.length;return u!==undefined?(o=u,i=e,dn(i,function(n){return M.some(n).filter(function(n){return n.value===o})})).map(function(n){return{url:{value:n.value,meta:{text:c?t:n.text,attach:E}},text:c?t:n.text}}):M.none()},yn=function(n,i){var u=gn(n.text),o=function(n,t){var e,r,o=(e=i,r=t.name,"link"===r?e.catalogs.link:"anchor"===r?e.catalogs.anchor:M.none()).getOr([]);return vn(u.get(),t.name,o,n)};return{onChange:function(n,t){return"url"===t.name?function(n){if(u.get().length<=0){var t=n.url.meta.text!==undefined?n.url.meta.text:n.url.value;return M.some({text:t})}return M.none()}(n()):(e=["anchor","link"],r=t.name,-1<q(e,r)?o(n(),t):("text"===t.name&&u.set(n().text),M.none()));var e,r}}},wn=function(){return(wn=Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}).apply(this,arguments)},xn={},kn={exports:xn};i=undefined,u=xn,a=kn,s=undefined,function(n){"object"==typeof u&&void 0!==a?a.exports=n():"function"==typeof i&&i.amd?i([],n):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=n()}(function(){return function f(i,u,c){function a(t,n){if(!u[t]){if(!i[t]){var e="function"==typeof s&&s;if(!n&&e)return e(t,!0);if(l)return l(t,!0);var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}var o=u[t]={exports:{}};i[t][0].call(o.exports,function(n){return a(i[t][1][n]||n)},o,o.exports,f,i,u,c)}return u[t].exports}for(var l="function"==typeof s&&s,n=0;n<c.length;n++)a(c[n]);return a}({1:[function(n,t,e){var r,o,i=t.exports={};function u(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function a(n){if(r===setTimeout)return setTimeout(n,0);if((r===u||!r)&&setTimeout)return r=setTimeout,setTimeout(n,0);try{return r(n,0)}catch(t){try{return r.call(null,n,0)}catch(t){return r.call(this,n,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:u}catch(n){r=u}try{o="function"==typeof clearTimeout?clearTimeout:c}catch(n){o=c}}();var l,f=[],s=!1,d=-1;function m(){s&&l&&(s=!1,l.length?f=l.concat(f):d=-1,f.length&&h())}function h(){if(!s){var n=a(m);s=!0;for(var t=f.length;t;){for(l=f,f=[];++d<t;)l&&l[d].run();d=-1,t=f.length}l=null,s=!1,function e(n){if(o===clearTimeout)return clearTimeout(n);if((o===c||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(n);try{return o(n)}catch(t){try{return o.call(null,n)}catch(t){return o.call(this,n)}}}(n)}}function p(n,t){this.fun=n,this.array=t}function g(){}i.nextTick=function(n){var t=new Array(arguments.length-1);if(1<arguments.length)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];f.push(new p(n,t)),1!==f.length||s||a(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(n){return[]},i.binding=function(n){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(n){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(n,s,t){(function(e){!function(n){var t=setTimeout;function r(){}function i(n){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof n)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=undefined,this._deferreds=[],f(n,this)}function o(r,o){for(;3===r._state;)r=r._value;0!==r._state?(r._handled=!0,i._immediateFn(function(){var n=1===r._state?o.onFulfilled:o.onRejected;if(null!==n){var t;try{t=n(r._value)}catch(e){return void c(o.promise,e)}u(o.promise,t)}else(1===r._state?u:c)(o.promise,r._value)})):r._deferreds.push(o)}function u(n,t){try{if(t===n)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if(t instanceof i)return n._state=3,n._value=t,void a(n);if("function"==typeof e)return void f(function r(n,t){return function(){n.apply(t,arguments)}}(e,t),n)}n._state=1,n._value=t,a(n)}catch(o){c(n,o)}}function c(n,t){n._state=2,n._value=t,a(n)}function a(n){2===n._state&&0===n._deferreds.length&&i._immediateFn(function(){n._handled||i._unhandledRejectionFn(n._value)});for(var t=0,e=n._deferreds.length;t<e;t++)o(n,n._deferreds[t]);n._deferreds=null}function l(n,t,e){this.onFulfilled="function"==typeof n?n:null,this.onRejected="function"==typeof t?t:null,this.promise=e}function f(n,t){var e=!1;try{n(function(n){e||(e=!0,u(t,n))},function(n){e||(e=!0,c(t,n))})}catch(r){if(e)return;e=!0,c(t,r)}}i.prototype["catch"]=function(n){return this.then(null,n)},i.prototype.then=function(n,t){var e=new this.constructor(r);return o(this,new l(n,t,e)),e},i.all=function(n){var a=Array.prototype.slice.call(n);return new i(function(o,i){if(0===a.length)return o([]);var u=a.length;function c(t,n){try{if(n&&("object"==typeof n||"function"==typeof n)){var e=n.then;if("function"==typeof e)return void e.call(n,function(n){c(t,n)},i)}a[t]=n,0==--u&&o(a)}catch(r){i(r)}}for(var n=0;n<a.length;n++)c(n,a[n])})},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i(function(n){n(t)})},i.reject=function(e){return new i(function(n,t){t(e)})},i.race=function(o){return new i(function(n,t){for(var e=0,r=o.length;e<r;e++)o[e].then(n,t)})},i._immediateFn="function"==typeof e?function(n){e(n)}:function(n){t(n,0)},i._unhandledRejectionFn=function(n){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",n)},i._setImmediateFn=function(n){i._immediateFn=n},i._setUnhandledRejectionFn=function(n){i._unhandledRejectionFn=n},void 0!==s&&s.exports?s.exports=i:n.Promise||(n.Promise=i)}(this)}).call(this,n("timers").setImmediate)},{timers:3}],3:[function(a,n,l){(function(n,t){var r=a("process/browser.js").nextTick,e=Function.prototype.apply,o=Array.prototype.slice,i={},u=0;function c(n,t){this._id=n,this._clearFn=t}l.setTimeout=function(){return new c(e.call(setTimeout,window,arguments),clearTimeout)},l.setInterval=function(){return new c(e.call(setInterval,window,arguments),clearInterval)},l.clearTimeout=l.clearInterval=function(n){n.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},l.enroll=function(n,t){clearTimeout(n._idleTimeoutId),n._idleTimeout=t},l.unenroll=function(n){clearTimeout(n._idleTimeoutId),n._idleTimeout=-1},l._unrefActive=l.active=function(n){clearTimeout(n._idleTimeoutId);var t=n._idleTimeout;0<=t&&(n._idleTimeoutId=setTimeout(function(){n._onTimeout&&n._onTimeout()},t))},l.setImmediate="function"==typeof n?n:function(n){var t=u++,e=!(arguments.length<2)&&o.call(arguments,1);return i[t]=!0,r(function(){i[t]&&(e?n.apply(null,e):n.call(null),l.clearImmediate(t))}),t},l.clearImmediate="function"==typeof t?t:function(n){delete i[n]}}).call(this,a("timers").setImmediate,a("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(n,t,e){var r=n("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();t.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)});var bn=kn.exports.boltExport,_n=function(n){var e=M.none(),t=[],r=function(n){o()?u(n):t.push(n)},o=function(){return e.isSome()},i=function(n){K(n,u)},u=function(t){e.each(function(n){c.setTimeout(function(){t(n)},0)})};return n(function(n){e=M.some(n),i(t),t=[]}),{get:r,map:function(e){return _n(function(t){r(function(n){t(e(n))})})},isReady:o}},Tn={nu:_n,pure:function(t){return _n(function(n){n(t)})}},On=function(n){c.setTimeout(function(){throw n},0)},An=function(e){var n=function(n){e().then(n,On)};return{map:function(n){return An(function(){return e().then(n)})},bind:function(t){return An(function(){return e().then(function(n){return t(n).toPromise()})})},anonBind:function(n){return An(function(){return e().then(function(){return n.toPromise()})})},toLazy:function(){return Tn.nu(n)},toCached:function(){var n=null;return An(function(){return null===n&&(n=e()),n})},toPromise:e,get:n}},Cn=function(n){return An(function(){return new bn(n)})},Pn=function(n){return An(function(){return bn.resolve(n)})},Nn=tinymce.util.Tools.resolve("tinymce.util.Delay"),En=function(n){var t=n.href;return 0<t.indexOf("@")&&-1===t.indexOf("//")&&-1===t.indexOf("mailto:")?M.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:function(n){return wn({},n,{href:"mailto:"+t})}}):M.none()},In=function(u,n,c){return dn([En,(e=n,function(n){var t=n.href;return 1===e&&!sn(t)||0===e&&/^\s*www[\.|\d\.]/i.test(t)?M.some({message:"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",preprocess:function(n){return wn({},n,{href:"http://"+t})}}):M.none()})],function(n){return n(c)}).fold(function(){return Pn(c)},function(i){return Cn(function(t){var e,n,r,o;e=u,n=i.message,r=function(n){t(n?i.preprocess(c):c)},o=e.selection.getRng(),Nn.setEditorTimeout(e,function(){e.windowManager.confirm(n,function(n){e.selection.setRng(o),r(n)})})})});var e},jn=function(n){var t=n.dom.select("a:not([href])"),e=H(t,function(n){var t=n.name||n.id;return t?[{text:t,value:"#"+t}]:[]});return 0<e.length?M.some([{text:"None",value:""}].concat(e)):M.none()},Sn=function(n){var t=_(n);return 0<t.length?pn.sanitize(t):M.none()},Fn=tinymce.util.Tools.resolve("tinymce.util.XHR"),Ln=function(t){var e=function(n){return t.convertURL(n.value||n.url,"href")},n=w(t);return Cn(function(t){m(n)?Fn.send({url:n,success:function(n){return t(function(n){try{return M.some(JSON.parse(n))}catch(t){return M.none()}}(n))},error:function(n){return t(M.none())}}):g(n)?n(function(n){return t(M.some(n))}):t(M.from(n))}).map(function(n){return n.bind(pn.sanitizeWith(e)).map(function(n){return 0<n.length?[{text:"None",value:""}].concat(n):n})})},Rn=function(n,t){var e=b(n);if(0<e.length){var r=t.is("_blank");return(!1===O(n)?pn.sanitizeWith(function(n){return fn(pn.getValue(n),r)}):pn.sanitize)(e)}return M.none()},Dn=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],Un=function(n){var t=k(n);return h(t)?pn.sanitize(t).orThunk(function(){return M.some(Dn)}):!1===t?M.none():M.some(Dn)},Mn=function(n,t,e){var r=n.getAttrib(t,e);return null!==r&&0<r.length?M.some(r):M.none()},zn=function(f,s){return Ln(f).map(function(n){var t,e,r,o,i,u,c,a,l=(e=s,r=(t=f).dom,o=cn(t.selection.getContent())?M.some(ln(t.selection,e)):M.none(),i=e?M.some(r.getAttrib(e,"href")):M.none(),u=e?M.from(r.getAttrib(e,"target")):M.none(),c=Mn(r,e,"rel"),a=Mn(r,e,"class"),{url:i,text:o,title:Mn(r,e,"title"),target:u,rel:c,linkClass:a});return{anchor:l,catalogs:{targets:Un(f),rels:Rn(f,l.target),classes:Sn(f),anchor:jn(f),link:n},optNode:M.from(s),flags:{titleEnabled:T(f)}}})},qn=function(g){var n,t;(t=an(n=g),zn(n,t)).map(function(n){var i,u,c,t,e,r,o,a,l,f,s,d,m,h,p=(u=n,c=v(i=g),function(n){var e=n.getData();if(!e.url.value)return rn(i),void n.close();var t=function(t){return M.from(e[t]).filter(function(n){return!u.anchor[t].is(n)})},r={href:e.url.value,text:t("text"),target:t("target"),rel:t("rel"),"class":t("linkClass"),title:t("title")},o={href:e.url.value,attach:e.url.meta!==undefined&&e.url.meta.attach?e.url.meta.attach:function(){}};In(i,c,r).get(function(n){en(i,o,n)}),n.close()});return e=p,r=g,l=(t=n).anchor.text.map(function(){return{name:"text",type:"input",label:"Text to display"}}).toArray(),f=t.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],s=M.from(x(r)),a=s,d={url:{value:(o=t).anchor.url.getOr(""),meta:{attach:function(){},text:o.anchor.url.fold(function(){return""},function(){return o.anchor.text.getOr("")}),original:{value:o.anchor.url.getOr("")}}},text:o.anchor.text.getOr(""),title:o.anchor.title.getOr(""),anchor:o.anchor.url.getOr(""),link:o.anchor.url.getOr(""),rel:o.anchor.rel.getOr(""),target:o.anchor.target.or(a).getOr(""),linkClass:o.anchor.linkClass.getOr("")},m=yn(d,t),h=t.catalogs,{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:W([[{name:"url",type:"urlinput",filetype:"file",label:"URL"}],l,f,function(n){for(var t=[],e=function(n){t.push(n)},r=0;r<n.length;r++)n[r].each(e);return t}([h.anchor.map(pn.createUi("anchor","Anchors")),h.rels.map(pn.createUi("rel","Rel")),h.targets.map(pn.createUi("target","Open link in...")),h.link.map(pn.createUi("link","Link list")),h.classes.map(pn.createUi("linkClass","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:d,onChange:function(t,n){var e=n.name;m.onChange(t.getData,{name:e}).each(function(n){t.setData(n)})},onSubmit:e}}).get(function(n){g.windowManager.open(n)})},Kn=function(n,t){return n.dom.getParent(t,"a[href]")},Bn=function(n){return Kn(n,n.selection.getStart())},Vn=function(n,t){if(t){var e=un(t);if(/^#/.test(e)){var r=n.$(e);r.length&&n.selection.scrollIntoView(r[0],!0)}else N(t.href)}},Wn=function(n){return function(){qn(n)}},Hn=function(n){return function(){Vn(n,Bn(n))}},$n=function(r){r.on("click",function(n){var t=Kn(r,n.target);t&&f.metaKeyPressed(n)&&(n.preventDefault(),Vn(r,t))}),r.on("keydown",function(n){var t,e=Bn(r);e&&13===n.keyCode&&!0===(t=n).altKey&&!1===t.shiftKey&&!1===t.ctrlKey&&!1===t.metaKey&&(n.preventDefault(),Vn(r,e))})},Gn=function(e){return function(t){var n=function(n){return t.setActive(!e.readonly&&!!an(e,n.element))};return e.on("NodeChange",n),function(){return e.off("NodeChange",n)}}},Jn=function(e){return function(t){t.setDisabled(!on(e.dom.getParents(e.selection.getStart())));var n=function(n){return t.setDisabled(!on(n.parents))};return e.on("NodeChange",n),function(){return e.off("NodeChange",n)}}},Xn=function(n){n.addCommand("mceLink",function(){A(n)?n.fire("contexttoolbar-show",{toolbarKey:"quicklink"}):Wn(n)()})},Qn=function(n){n.addShortcut("Meta+K","",function(){n.execCommand("mceLink")})},Yn=function(n){n.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:Wn(n),onSetup:Gn(n)}),n.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:function(){return rn(n)},onSetup:Jn(n)})},Zn=function(n){n.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:Hn(n),onSetup:Jn(n)}),n.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:Wn(n)}),n.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:function(){return rn(n)},onSetup:Jn(n)})},nt=function(t){t.ui.registry.addContextMenu("link",{update:function(n){return on(t.dom.getParents(n,"a"))?"link unlink openlink":"link"}})},tt=function(i){var n=function(n){var t=i.selection.getNode();return n.setDisabled(!an(i,t)),function(){}};i.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:Gn(i)},label:"Link",predicate:function(n){return!!an(i,n)&&y(i)},initValue:function(){var n=an(i);return n?un(n):""},commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:function(n){var t=i.selection.getNode();return n.setActive(!!an(i,t)),Gn(i)(n)},onAction:function(n){var t=an(i),e=n.getValue();if(t)i.dom.setAttrib(t,"href",e),i.selection.collapse(!1),n.hide();else{var r={href:e,attach:function(){}},o=cn(i.selection.getContent())?M.some(ln(i.selection,t)).filter(function(n){return 0<n.length}).or(M.from(e)):M.none();en(i,r,{href:e,text:o,title:M.none(),rel:M.none(),target:M.none(),"class":M.none()}),n.hide()}}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:n,onAction:function(n){rn(i),n.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:n,onAction:function(n){Hn(i)(),n.hide()}}]})};!function et(){l.add("link",function(n){Yn(n),Zn(n),nt(n),tt(n),$n(n),Xn(n),Qn(n)})}()}(window);
|
9
|
+
!function(c){"use strict";function n(t){return 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)===t}}function u(){}function i(n){return function(){return n}}function t(){return C}var e,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.util.VK"),a=n("string"),f=n("array"),l=n("boolean"),s=n("function"),d=function(n){var t=n.getParam("link_assume_external_targets",!1);return l(t)&&t?1:!a(t)||"http"!==t&&"https"!==t?0:t},m=function(n){return n.getParam("link_context_toolbar",!1,"boolean")},h=function(n){return n.getParam("link_list")},p=function(n){return n.getParam("default_link_target")},g=function(n){return n.getParam("target_list",!0)},v=function(n){return n.getParam("rel_list",[],"array")},y=function(n){return n.getParam("link_class_list",[],"array")},w=function(n){return n.getParam("link_title",!0,"boolean")},k=function(n){return n.getParam("allow_unsafe_link_target",!1,"boolean")},x=function(n){return n.getParam("link_quicklink",!1,"boolean")},b=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),_=tinymce.util.Tools.resolve("tinymce.Env"),T=function(n){if(!_.ie||10<_.ie){var t=c.document.createElement("a");t.target="_blank",t.href=n,t.rel="noreferrer noopener";var e=c.document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,c.window,0,0,0,0,0,!1,!1,!1,!1,0,null),function(n,t){c.document.body.appendChild(n),n.dispatchEvent(t),c.document.body.removeChild(n)}(t,e)}else{var r=c.window.open("","_blank");if(r){r.opener=null;var o=r.document;o.open(),o.write('<meta http-equiv="refresh" content="0; url='+b.DOM.encode(n)+'">'),o.close()}}},O=i(!1),A=i(!0),C=(e={fold:function(n,t){return n()},is:O,isSome:O,isNone:A,getOr:E,getOrThunk:N,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(undefined),or:E,orThunk:N,map:t,each:u,bind:t,exists:O,forall:A,filter:t,equals:P,equals_:P,toArray:function(){return[]},toString:i("none()")},Object.freeze&&Object.freeze(e),e);function P(n){return n.isNone()}function N(n){return n()}function E(n){return n}function I(n,t){return-1<function(n,t){return Q.call(n,t)}(n,t)}function S(n,t){for(var e=0,r=n.length;e<r;e++){t(n[e],e)}}function j(n){for(var t=[],e=0,r=n.length;e<r;++e){if(!f(n[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+n);Y.apply(t,n[e])}return t}function F(n,t){var e=function(n,t){for(var e=n.length,r=new Array(e),o=0;o<e;o++){var i=n[o];r[o]=t(i,o)}return r}(n,t);return j(e)}function L(n){return/^\w+:/i.test(n)}function R(n,t){var e,r,o=["noopener"],i=n?n.split(/\s+/):[],u=function(n){return n.filter(function(n){return-1===Z.inArray(o,n)})},c=t?0<(e=u(e=i)).length?e.concat(o):o:u(i);return 0<c.length?(r=c,Z.trim(r.sort().join(" "))):""}function D(n,t){return t=t||n.selection.getNode(),nn(t)?n.dom.select("a[href]",t)[0]:n.dom.getParent(t,"a[href]")}function U(n){return n&&"A"===n.nodeName&&!!n.href}function M(n){return function(n,t,e){return S(n,function(n){e=t(e,n)}),e}(["title","rel","class","target"],function(t,e){return n[e].each(function(n){t[e]=0<n.length?n:null}),t},{href:n.href})}function z(n,t){for(var e=0;e<n.length;e++){var r=t(n[e],e);if(r.isSome())return r}return J.none()}function q(n){return a(n.value)?n.value:""}function K(t){return void 0===t&&(t=q),function(n){return J.from(n).map(function(n){return function(n,r){var o=[];return Z.each(n,function(n){var t=a(n.text)?n.text:a(n.title)?n.title:"";if(n.menu!==undefined);else{var e=r(n);o.push({text:t,value:e})}}),o}(n,t)})}}function B(t,n,e,r){var o=r[n],i=0<t.length;return o!==undefined?function(t,n){return z(n,function(n){return J.some(n).filter(function(n){return n.value===t})})}(o,e).map(function(n){return{url:{value:n.value,meta:{text:i?t:n.text,attach:u}},text:i?t:n.text}}):J.none()}var V,W,H,$,G=function(e){function n(){return o}function t(n){return n(e)}var r=i(e),o={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:A,isNone:O,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:n,orThunk:n,map:function(n){return G(n(e))},each:function(n){n(e)},bind:t,exists:t,forall:t,filter:function(n){return n(e)?o:C},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(O,function(n){return t(e,n)})}};return o},J={some:G,none:t,from:function(n){return null===n||n===undefined?C:G(n)}},X=Array.prototype.slice,Q=Array.prototype.indexOf,Y=Array.prototype.push,Z=(s(Array.from)&&Array.from,tinymce.util.Tools.resolve("tinymce.util.Tools")),nn=function(n){return n&&"FIGURE"===n.nodeName&&/\bimage\b/i.test(n.className)},tn=function(n,t){var e=n.dom.select("img",t)[0];if(e){var r=n.dom.getParents(e,"a[href]",t)[0];r&&(r.parentNode.insertBefore(e,r),n.dom.remove(r))}},en=function(n,t,e){var r=n.dom.select("img",t)[0];if(r){var o=n.dom.create("a",e);r.parentNode.insertBefore(o,r),o.appendChild(r)}},rn=function(o,i,u){o.undoManager.transact(function(){var n=o.selection.getNode(),t=D(o,n),e=M(u);if(!(0<v(o).length)&&!1===k(o)){var r=R(e.rel,"_blank"===e.target);e.rel=r||null}J.from(e.target).isNone()&&(e.target=p(o)),e.href=function(n,t){return"http"!==t&&"https"!==t||L(n)?n:t+"://"+n}(e.href,d(o)),u.href===i.href&&i.attach(),t?(o.focus(),function(n,t,e,r){e.each(function(n){t.hasOwnProperty("innerText")?t.innerText=n:t.textContent=n}),n.dom.setAttribs(t,r),n.selection.select(t)}(o,t,u.text,e)):function(t,n,e,r){nn(n)?en(t,n,r):e.fold(function(){t.execCommand("mceInsertLink",!1,r)},function(n){t.insertContent(t.dom.createHTML("a",r,t.dom.encode(n)))})}(o,n,u.text,e)})},on=function(e){e.undoManager.transact(function(){var n=e.selection.getNode();if(nn(n))tn(e,n);else{var t=e.dom.getParent(n,"a[href]",e.getBody());t&&e.dom.remove(t,!0)}e.focus()})},un=function(n){return 0<Z.grep(n,U).length},cn=function(n){var t=n.getAttribute("data-mce-href");return t||n.getAttribute("href")},an=function(n){return!(/</.test(n)&&(!/^<a [^>]+>[^<]+<\/a>$/.test(n)||-1===n.indexOf("href=")))},fn=D,ln=function(n,t){return function(n){return n.replace(/\uFEFF/g,"")}(t?t.innerText||t.textContent:n.getContent({format:"text"}))},sn=R,dn=L,mn={sanitize:function(n){return K(q)(n)},sanitizeWith:K,createUi:function(t,e){return function(n){return{name:t,type:"selectbox",label:e,items:n}}},getValue:q},hn=function(n){function t(){return e}var e=n;return{get:t,set:function(n){e=n},clone:function(){return hn(t())}}},pn=function(n,r){function e(n,t){var e=function(n,t){return"link"===t?n.catalogs.link:"anchor"===t?n.catalogs.anchor:J.none()}(r,t.name).getOr([]);return B(o.get(),t.name,e,n)}var o=hn(n.text);return{onChange:function(n,t){return"url"===t.name?function(n){if(o.get().length<=0){var t=n.url.meta.text!==undefined?n.url.meta.text:n.url.value;return J.some({text:t})}return J.none()}(n()):I(["anchor","link"],t.name)?e(n(),t):("text"===t.name&&o.set(n().text),J.none())}}},gn=function(){return(gn=Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}).apply(this,arguments)},vn={},yn={exports:vn};V=undefined,W=vn,H=yn,$=undefined,function(n){"object"==typeof W&&void 0!==H?H.exports=n():"function"==typeof V&&V.amd?V([],n):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=n()}(function(){return function l(i,u,c){function a(t,n){if(!u[t]){if(!i[t]){var e="function"==typeof $&&$;if(!n&&e)return e(t,!0);if(f)return f(t,!0);var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}var o=u[t]={exports:{}};i[t][0].call(o.exports,function(n){return a(i[t][1][n]||n)},o,o.exports,l,i,u,c)}return u[t].exports}for(var f="function"==typeof $&&$,n=0;n<c.length;n++)a(c[n]);return a}({1:[function(n,t,e){var r,o,i=t.exports={};function u(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function a(n){if(r===setTimeout)return setTimeout(n,0);if((r===u||!r)&&setTimeout)return r=setTimeout,setTimeout(n,0);try{return r(n,0)}catch(t){try{return r.call(null,n,0)}catch(t){return r.call(this,n,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:u}catch(n){r=u}try{o="function"==typeof clearTimeout?clearTimeout:c}catch(n){o=c}}();var f,l=[],s=!1,d=-1;function m(){s&&f&&(s=!1,f.length?l=f.concat(l):d=-1,l.length&&h())}function h(){if(!s){var n=a(m);s=!0;for(var t=l.length;t;){for(f=l,l=[];++d<t;)f&&f[d].run();d=-1,t=l.length}f=null,s=!1,function e(n){if(o===clearTimeout)return clearTimeout(n);if((o===c||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(n);try{return o(n)}catch(t){try{return o.call(null,n)}catch(t){return o.call(this,n)}}}(n)}}function p(n,t){this.fun=n,this.array=t}function g(){}i.nextTick=function(n){var t=new Array(arguments.length-1);if(1<arguments.length)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];l.push(new p(n,t)),1!==l.length||s||a(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(n){return[]},i.binding=function(n){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(n){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(n,s,t){(function(t){function r(){}function i(n){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof n)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=undefined,this._deferreds=[],l(n,this)}function o(r,o){for(;3===r._state;)r=r._value;0!==r._state?(r._handled=!0,i._immediateFn(function(){var n=1===r._state?o.onFulfilled:o.onRejected;if(null!==n){var t;try{t=n(r._value)}catch(e){return void c(o.promise,e)}u(o.promise,t)}else(1===r._state?u:c)(o.promise,r._value)})):r._deferreds.push(o)}function u(n,t){try{if(t===n)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if(t instanceof i)return n._state=3,n._value=t,void a(n);if("function"==typeof e)return void l(function r(n,t){return function(){n.apply(t,arguments)}}(e,t),n)}n._state=1,n._value=t,a(n)}catch(o){c(n,o)}}function c(n,t){n._state=2,n._value=t,a(n)}function a(n){2===n._state&&0===n._deferreds.length&&i._immediateFn(function(){n._handled||i._unhandledRejectionFn(n._value)});for(var t=0,e=n._deferreds.length;t<e;t++)o(n,n._deferreds[t]);n._deferreds=null}function f(n,t,e){this.onFulfilled="function"==typeof n?n:null,this.onRejected="function"==typeof t?t:null,this.promise=e}function l(n,t){var e=!1;try{n(function(n){e||(e=!0,u(t,n))},function(n){e||(e=!0,c(t,n))})}catch(r){if(e)return;e=!0,c(t,r)}}var n,e;n=this,e=setTimeout,i.prototype["catch"]=function(n){return this.then(null,n)},i.prototype.then=function(n,t){var e=new this.constructor(r);return o(this,new f(n,t,e)),e},i.all=function(n){var a=Array.prototype.slice.call(n);return new i(function(o,i){if(0===a.length)return o([]);var u=a.length;function c(t,n){try{if(n&&("object"==typeof n||"function"==typeof n)){var e=n.then;if("function"==typeof e)return void e.call(n,function(n){c(t,n)},i)}a[t]=n,0==--u&&o(a)}catch(r){i(r)}}for(var n=0;n<a.length;n++)c(n,a[n])})},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i(function(n){n(t)})},i.reject=function(e){return new i(function(n,t){t(e)})},i.race=function(o){return new i(function(n,t){for(var e=0,r=o.length;e<r;e++)o[e].then(n,t)})},i._immediateFn="function"==typeof t?function(n){t(n)}:function(n){e(n,0)},i._unhandledRejectionFn=function(n){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",n)},i._setImmediateFn=function(n){i._immediateFn=n},i._setUnhandledRejectionFn=function(n){i._unhandledRejectionFn=n},void 0!==s&&s.exports?s.exports=i:n.Promise||(n.Promise=i)}).call(this,n("timers").setImmediate)},{timers:3}],3:[function(a,n,f){(function(n,t){var r=a("process/browser.js").nextTick,e=Function.prototype.apply,o=Array.prototype.slice,i={},u=0;function c(n,t){this._id=n,this._clearFn=t}f.setTimeout=function(){return new c(e.call(setTimeout,window,arguments),clearTimeout)},f.setInterval=function(){return new c(e.call(setInterval,window,arguments),clearInterval)},f.clearTimeout=f.clearInterval=function(n){n.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},f.enroll=function(n,t){clearTimeout(n._idleTimeoutId),n._idleTimeout=t},f.unenroll=function(n){clearTimeout(n._idleTimeoutId),n._idleTimeout=-1},f._unrefActive=f.active=function(n){clearTimeout(n._idleTimeoutId);var t=n._idleTimeout;0<=t&&(n._idleTimeoutId=setTimeout(function(){n._onTimeout&&n._onTimeout()},t))},f.setImmediate="function"==typeof n?n:function(n){var t=u++,e=!(arguments.length<2)&&o.call(arguments,1);return i[t]=!0,r(function(){i[t]&&(e?n.apply(null,e):n.call(null),f.clearImmediate(t))}),t},f.clearImmediate="function"==typeof t?t:function(n){delete i[n]}}).call(this,a("timers").setImmediate,a("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(n,t,e){var r=n("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();t.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)});function wn(n){c.setTimeout(function(){throw n},0)}function kn(n){var t=n.href;return 0<t.indexOf("@")&&-1===t.indexOf("//")&&-1===t.indexOf("mailto:")?J.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:function(n){return gn(gn({},n),{href:"mailto:"+t})}}):J.none()}function xn(n,t,e){var r=n.getAttrib(t,e);return null!==r&&0<r.length?J.some(r):J.none()}function bn(n,t){return n.dom.getParent(t,"a[href]")}function _n(n){return bn(n,n.selection.getStart())}function Tn(n,t){if(t){var e=cn(t);if(/^#/.test(e)){var r=n.$(e);r.length&&n.selection.scrollIntoView(r[0],!0)}else T(t.href)}}var On=yn.exports.boltExport,An=function(n){var e=J.none(),t=[],r=function(n){o()?u(n):t.push(n)},o=function(){return e.isSome()},i=function(n){S(n,u)},u=function(t){e.each(function(n){c.setTimeout(function(){t(n)},0)})};return n(function(n){e=J.some(n),i(t),t=[]}),{get:r,map:function(e){return An(function(t){r(function(n){t(e(n))})})},isReady:o}},Cn={nu:An,pure:function(t){return An(function(n){n(t)})}},Pn=function(e){function n(n){e().then(n,wn)}return{map:function(n){return Pn(function(){return e().then(n)})},bind:function(t){return Pn(function(){return e().then(function(n){return t(n).toPromise()})})},anonBind:function(n){return Pn(function(){return e().then(function(){return n.toPromise()})})},toLazy:function(){return Cn.nu(n)},toCached:function(){var n=null;return Pn(function(){return null===n&&(n=e()),n})},toPromise:e,get:n}},Nn=function(n){return Pn(function(){return new On(n)})},En=function(n){return Pn(function(){return On.resolve(n)})},In=tinymce.util.Tools.resolve("tinymce.util.Delay"),Sn=function(n,t,r){return z([kn,function(e){return function(n){var t=n.href;return 1===e&&!dn(t)||0===e&&/^\s*www[\.|\d\.]/i.test(t)?J.some({message:"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",preprocess:function(n){return gn(gn({},n),{href:"http://"+t})}}):J.none()}}(t)],function(n){return n(r)}).fold(function(){return En(r)},function(e){return Nn(function(t){!function(t,n,e){var r=t.selection.getRng();In.setEditorTimeout(t,function(){t.windowManager.confirm(n,function(n){t.selection.setRng(r),e(n)})})}(n,e.message,function(n){t(n?e.preprocess(r):r)})})})},jn=function(n){var t=n.dom.select("a:not([href])"),e=F(t,function(n){var t=n.name||n.id;return t?[{text:t,value:"#"+t}]:[]});return 0<e.length?J.some([{text:"None",value:""}].concat(e)):J.none()},Fn=function(n){var t=y(n);return 0<t.length?mn.sanitize(t):J.none()},Ln=tinymce.util.Tools.resolve("tinymce.util.XHR"),Rn=function(t){function e(n){return t.convertURL(n.value||n.url,"href")}var n=h(t);return Nn(function(t){a(n)?Ln.send({url:n,success:function(n){return t(function(n){try{return J.some(JSON.parse(n))}catch(t){return J.none()}}(n))},error:function(n){return t(J.none())}}):s(n)?n(function(n){return t(J.some(n))}):t(J.from(n))}).map(function(n){return n.bind(mn.sanitizeWith(e)).map(function(n){return 0<n.length?[{text:"None",value:""}].concat(n):n})})},Dn=function(n,t){var e=v(n);if(0<e.length){var r=t.is("_blank");return(!1===k(n)?mn.sanitizeWith(function(n){return sn(mn.getValue(n),r)}):mn.sanitize)(e)}return J.none()},Un=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],Mn=function(n){var t=g(n);return f(t)?mn.sanitize(t).orThunk(function(){return J.some(Un)}):!1===t?J.none():J.some(Un)},zn=function(e,r){return Rn(e).map(function(n){var t=function(n,t){var e=n.dom,r=an(n.selection.getContent())?J.some(ln(n.selection,t)):J.none(),o=t?J.some(e.getAttrib(t,"href")):J.none(),i=t?J.from(e.getAttrib(t,"target")):J.none(),u=xn(e,t,"rel"),c=xn(e,t,"class");return{url:o,text:r,title:xn(e,t,"title"),target:i,rel:u,linkClass:c}}(e,r);return{anchor:t,catalogs:{targets:Mn(e),rels:Dn(e,t.target),classes:Fn(e),anchor:jn(e),link:n},optNode:J.from(r),flags:{titleEnabled:w(e)}}})},qn=function(t){(function(n){var t=fn(n);return zn(n,t)})(t).map(function(n){return function(n,t,e){var r=n.anchor.text.map(function(){return{name:"text",type:"input",label:"Text to display"}}).toArray(),o=n.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],i=function(n,t){return{url:{value:n.anchor.url.getOr(""),meta:{attach:function(){},text:n.anchor.url.fold(function(){return""},function(){return n.anchor.text.getOr("")}),original:{value:n.anchor.url.getOr("")}}},text:n.anchor.text.getOr(""),title:n.anchor.title.getOr(""),anchor:n.anchor.url.getOr(""),link:n.anchor.url.getOr(""),rel:n.anchor.rel.getOr(""),target:n.anchor.target.or(t).getOr(""),linkClass:n.anchor.linkClass.getOr("")}}(n,J.from(p(e))),u=pn(i,n),c=n.catalogs;return{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:j([[{name:"url",type:"urlinput",filetype:"file",label:"URL"}],r,o,function(n){for(var t=[],e=function(n){t.push(n)},r=0;r<n.length;r++)n[r].each(e);return t}([c.anchor.map(mn.createUi("anchor","Anchors")),c.rels.map(mn.createUi("rel","Rel")),c.targets.map(mn.createUi("target","Open link in...")),c.link.map(mn.createUi("link","Link list")),c.classes.map(mn.createUi("linkClass","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:i,onChange:function(t,n){var e=n.name;u.onChange(t.getData,{name:e}).each(function(n){t.setData(n)})},onSubmit:t}}(n,function(i,u,c){return function(n){var e=n.getData();if(!e.url.value)return on(i),void n.close();function t(t){return J.from(e[t]).filter(function(n){return!u.anchor[t].is(n)})}var r={href:e.url.value,text:t("text"),target:t("target"),rel:t("rel"),"class":t("linkClass"),title:t("title")},o={href:e.url.value,attach:e.url.meta!==undefined&&e.url.meta.attach?e.url.meta.attach:function(){}};Sn(i,c,r).get(function(n){rn(i,o,n)}),n.close()}}(t,n,d(t)),t)}).get(function(n){t.windowManager.open(n)})},Kn=function(n){return function(){qn(n)}},Bn=function(n){return function(){Tn(n,_n(n))}},Vn=function(e){e.on("click",function(n){var t=bn(e,n.target);t&&o.metaKeyPressed(n)&&(n.preventDefault(),Tn(e,t))}),e.on("keydown",function(n){var t=_n(e);t&&13===n.keyCode&&function(n){return!0===n.altKey&&!1===n.shiftKey&&!1===n.ctrlKey&&!1===n.metaKey}(n)&&(n.preventDefault(),Tn(e,t))})},Wn=function(e){return function(t){function n(n){return t.setActive(!e.readonly&&!!fn(e,n.element))}return e.on("NodeChange",n),function(){return e.off("NodeChange",n)}}},Hn=function(e){return function(t){t.setDisabled(!un(e.dom.getParents(e.selection.getStart())));function n(n){return t.setDisabled(!un(n.parents))}return e.on("NodeChange",n),function(){return e.off("NodeChange",n)}}},$n=function(n){n.addCommand("mceLink",function(){x(n)?n.fire("contexttoolbar-show",{toolbarKey:"quicklink"}):Kn(n)()})},Gn=function(n){n.addShortcut("Meta+K","",function(){n.execCommand("mceLink")})},Jn=function(n){n.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:Kn(n),onSetup:Wn(n)}),n.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:Bn(n),onSetup:Hn(n)}),n.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:function(){return on(n)},onSetup:Hn(n)})},Xn=function(n){n.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:Bn(n),onSetup:Hn(n)}),n.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:Kn(n)}),n.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:function(){return on(n)},onSetup:Hn(n)})},Qn=function(t){t.ui.registry.addContextMenu("link",{update:function(n){return un(t.dom.getParents(n,"a"))?"link unlink openlink":"link"}})},Yn=function(i){function n(n){var t=i.selection.getNode();return n.setDisabled(!fn(i,t)),function(){}}i.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:Wn(i)},label:"Link",predicate:function(n){return!!fn(i,n)&&m(i)},initValue:function(){var n=fn(i);return n?cn(n):""},commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:function(n){var t=i.selection.getNode();return n.setActive(!!fn(i,t)),Wn(i)(n)},onAction:function(n){var t=fn(i),e=n.getValue();if(t)i.dom.setAttrib(t,"href",e),function(n){n.selection.collapse(!1)}(i),n.hide();else{var r={href:e,attach:function(){}},o=an(i.selection.getContent())?J.some(ln(i.selection,t)).filter(function(n){return 0<n.length}).or(J.from(e)):J.none();rn(i,r,{href:e,text:o,title:J.none(),rel:J.none(),target:J.none(),"class":J.none()}),n.hide()}}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:n,onAction:function(n){on(i),n.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:n,onAction:function(n){Bn(i)(),n.hide()}}]})};!function Zn(){r.add("link",function(n){Jn(n),Xn(n),Qn(n),Yn(n),Vn(n),$n(n),Gn(n)})}()}(window);
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
|
-
!function(u){"use strict";var e,n,t,r,o,i,a,s,c,f=tinymce.util.Tools.resolve("tinymce.PluginManager"),v=function(e){return function(){return e}},d=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return!t.apply(null,e)}},l=v(!1),m=v(!0),g=l,p=m,h=function(){return y},y=(r={fold:function(e,n){return e()},is:g,isSome:g,isNone:p,getOr:t=function(e){return e},getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:t,orThunk:n,map:h,ap:h,each:function(){},bind:h,flatten:h,exists:g,forall:p,filter:h,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:v("none()")},Object.freeze&&Object.freeze(r),r),N=function(t){var e=function(){return t},n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:p,isNone:g,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return N(e(t))},ap:function(e){return e.fold(h,function(e){return N(e(t))})},each:function(e){e(t)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(t)?o:y},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(g,function(e){return n(t,e)})},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},S={some:N,none:h,from:function(e){return null===e||e===undefined?y:N(e)}},O=function(n){return function(e){return function(e){if(null===e)return"null";var n=typeof e;return"object"===n&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===n&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":n}(e)===n}},C=O("string"),b=O("array"),L=O("boolean"),T=O("function"),E=O("number"),D=Array.prototype.slice,w=function(e,n){for(var t=e.length,r=new Array(t),o=0;o<t;o++){var i=e[o];r[o]=n(i,o,e)}return r},k=function(e,n){for(var t=0,r=e.length;t<r;t++){n(e[t],t,e)}},A=function(e,n){for(var t=[],r=0,o=e.length;r<o;r++){var i=e[r];n(i,r,e)&&t.push(i)}return t},x=function(e,n,t){return k(e,function(e){t=n(t,e)}),t},R=function(e,n){for(var t=0,r=e.length;t<r;t++){var o=e[t];if(n(o,t,e))return S.some(o)}return S.none()},I=Array.prototype.push,_=function(e,n){return function(e){for(var n=[],t=0,r=e.length;t<r;++t){if(!b(e[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+e);I.apply(n,e[t])}return n}(w(e,n))},B=function(e){return 0===e.length?S.none():S.some(e[0])},P=function(e){return 0===e.length?S.none():S.some(e[e.length-1])},M=(T(Array.from)&&Array.from,function(e,n,t){return 0!=(e.compareDocumentPosition(n)&t)}),U=function(e,n){return M(e,n,u.Node.DOCUMENT_POSITION_CONTAINED_BY)},F=function(e,n){var t=function(e,n){for(var t=0;t<e.length;t++){var r=e[t];if(r.test(n))return r}return undefined}(e,n);if(!t)return{major:0,minor:0};var r=function(e){return Number(n.replace(t,"$"+e))};return H(r(1),r(2))},j=function(){return H(0,0)},H=function(e,n){return{major:e,minor:n}},$={nu:H,detect:function(e,n){var t=String(n).toLowerCase();return 0===e.length?j():F(e,t)},unknown:j},q="Edge",W="Chrome",V="Opera",z="Firefox",K="Safari",X=function(e,n){return function(){return n===e}},Q=function(e){var n=e.current;return{current:n,version:e.version,isEdge:X(q,n),isChrome:X(W,n),isIE:X("IE",n),isOpera:X(V,n),isFirefox:X(z,n),isSafari:X(K,n)}},Y={unknown:function(){return Q({current:undefined,version:$.unknown()})},nu:Q,edge:v(q),chrome:v(W),ie:v("IE"),opera:v(V),firefox:v(z),safari:v(K)},G="Windows",J="Android",Z="Solaris",ee="FreeBSD",ne=function(e,n){return function(){return n===e}},te=function(e){var n=e.current;return{current:n,version:e.version,isWindows:ne(G,n),isiOS:ne("iOS",n),isAndroid:ne(J,n),isOSX:ne("OSX",n),isLinux:ne("Linux",n),isSolaris:ne(Z,n),isFreeBSD:ne(ee,n)}},re={unknown:function(){return te({current:undefined,version:$.unknown()})},nu:te,windows:v(G),ios:v("iOS"),android:v(J),linux:v("Linux"),osx:v("OSX"),solaris:v(Z),freebsd:v(ee)},oe=function(e,n){var t=String(n).toLowerCase();return R(e,function(e){return e.search(t)})},ie=function(e,t){return oe(e,t).map(function(e){var n=$.detect(e.versionRegexes,t);return{current:e.name,version:n}})},ue=function(e,t){return oe(e,t).map(function(e){var n=$.detect(e.versionRegexes,t);return{current:e.name,version:n}})},ae=function(e,n){return-1!==e.indexOf(n)},se=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,ce=function(n){return function(e){return ae(e,n)}},fe=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return ae(e,"edge/")&&ae(e,"chrome")&&ae(e,"safari")&&ae(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,se],search:function(e){return ae(e,"chrome")&&!ae(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return ae(e,"msie")||ae(e,"trident")}},{name:"Opera",versionRegexes:[se,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:ce("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:ce("firefox")},{name:"Safari",versionRegexes:[se,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(ae(e,"safari")||ae(e,"mobile/"))&&ae(e,"applewebkit")}}],de=[{name:"Windows",search:ce("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return ae(e,"iphone")||ae(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:ce("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:ce("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:ce("linux"),versionRegexes:[]},{name:"Solaris",search:ce("sunos"),versionRegexes:[]},{name:"FreeBSD",search:ce("freebsd"),versionRegexes:[]}],le={browsers:v(fe),oses:v(de)},me=function(e){var n,t,r,o,i,u,a,s,c,f,d,l=le.browsers(),m=le.oses(),g=ie(l,e).fold(Y.unknown,Y.nu),p=ue(m,e).fold(re.unknown,re.nu);return{browser:g,os:p,deviceType:(t=g,r=e,o=(n=p).isiOS()&&!0===/ipad/i.test(r),i=n.isiOS()&&!o,u=n.isAndroid()&&3===n.version.major,a=n.isAndroid()&&4===n.version.major,s=o||u||a&&!0===/mobile/i.test(r),c=n.isiOS()||n.isAndroid(),f=c&&!s,d=t.isSafari()&&n.isiOS()&&!1===/safari/i.test(r),{isiPad:v(o),isiPhone:v(i),isTablet:v(s),isPhone:v(f),isTouch:v(c),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:v(d)})}},ge={detect:(a=!(o=function(){var e=u.navigator.userAgent;return me(e)}),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return a||(a=!0,i=o.apply(null,e)),i})},pe=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:v(e)}},ve={fromHtml:function(e,n){var t=(n||u.document).createElement("div");if(t.innerHTML=e,!t.hasChildNodes()||1<t.childNodes.length)throw u.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return pe(t.childNodes[0])},fromTag:function(e,n){var t=(n||u.document).createElement(e);return pe(t)},fromText:function(e,n){var t=(n||u.document).createTextNode(e);return pe(t)},fromDom:pe,fromPoint:function(e,n,t){var r=e.dom();return S.from(r.elementFromPoint(n,t)).map(pe)}},he=(u.Node.ATTRIBUTE_NODE,u.Node.CDATA_SECTION_NODE,u.Node.COMMENT_NODE,u.Node.DOCUMENT_NODE,u.Node.DOCUMENT_TYPE_NODE,u.Node.DOCUMENT_FRAGMENT_NODE,u.Node.ELEMENT_NODE),ye=(u.Node.TEXT_NODE,u.Node.PROCESSING_INSTRUCTION_NODE,u.Node.ENTITY_REFERENCE_NODE,u.Node.ENTITY_NODE,u.Node.NOTATION_NODE,he),Ne=function(e,n){return e.dom()===n.dom()},Se=ge.detect().browser.isIE()?function(e,n){return U(e.dom(),n.dom())}:function(e,n){var t=e.dom(),r=n.dom();return t!==r&&t.contains(r)},Oe=function(e,n){var t=e.dom();if(t.nodeType!==ye)return!1;var r=t;if(r.matches!==undefined)return r.matches(n);if(r.msMatchesSelector!==undefined)return r.msMatchesSelector(n);if(r.webkitMatchesSelector!==undefined)return r.webkitMatchesSelector(n);if(r.mozMatchesSelector!==undefined)return r.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")},Ce=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),be=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),Le=tinymce.util.Tools.resolve("tinymce.util.VK"),Te=function(e,n){for(var t=[],r=0;r<e.length;r++){var o=e[r];if(!o.isSome())return S.none();t.push(o.getOrDie())}return S.some(n.apply(null,t))},Ee=Object.keys,De=function(e){return S.from(e.dom().parentNode).map(ve.fromDom)},we=function(e){return w(e.dom().childNodes,ve.fromDom)},ke=function(e,n){var t=e.dom().childNodes;return S.from(t[n]).map(ve.fromDom)},Ae=function(e){return ke(e,0)},xe=function(e){return ke(e,e.dom().childNodes.length-1)},Re=(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n]}("element","offset"),function(n,t){De(n).each(function(e){e.dom().insertBefore(t.dom(),n.dom())})}),Ie=function(e,n){e.dom().appendChild(n.dom())},_e=function(n,e){k(e,function(e){Ie(n,e)})},Be=function(e){var n=e.dom();null!==n.parentNode&&n.parentNode.removeChild(n)},Pe=function(e,n,t){return e.fire("ListMutation",{action:n,element:t})},Me="undefined"!=typeof u.window?u.window:Function("return this;")(),Ue=function(e,n){return function(e,n){for(var t=n!==undefined&&null!==n?n:Me,r=0;r<e.length&&t!==undefined&&null!==t;++r)t=t[e[r]];return t}(e.split("."),n)},Fe=function(e,n){var t=Ue(e,n);if(t===undefined||null===t)throw new Error(e+" not available on this browser");return t},je=function(e){var n,t=Ue("ownerDocument.defaultView",e);return(n=t,Fe("HTMLElement",n)).prototype.isPrototypeOf(e)},He=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),$e=tinymce.util.Tools.resolve("tinymce.util.Tools"),qe=function(e){return e&&"BR"===e.nodeName},We=function(e){return e&&3===e.nodeType},Ve=function(e){return e&&/^(OL|UL|DL)$/.test(e.nodeName)},ze=function(e){return e&&/^(OL|UL)$/.test(e.nodeName)},Ke=function(e){return e&&/^(DT|DD)$/.test(e.nodeName)},Xe=function(e){return e&&/^(LI|DT|DD)$/.test(e.nodeName)},Qe=function(e){return e&&/^(TH|TD)$/.test(e.nodeName)},Ye=qe,Ge=function(e){return e.parentNode.firstChild===e},Je=function(e,n){return n&&!!e.schema.getTextBlockElements()[n.nodeName]},Ze=function(e,n){return e&&e.nodeName in n},en=function(e,n){return!!qe(n)&&!(!e.isBlock(n.nextSibling)||qe(n.previousSibling))},nn=function(e,n,t){var r=e.isEmpty(n);return!(t&&0<e.select("span[data-mce-type=bookmark]",n).length)&&r},tn=function(e,n){return e.isChildOf(n,e.getRoot())},rn=function(e){var n=e.selection.getStart(!0);return e.dom.getParent(n,"OL,UL,DL",un(e,n))},on=function(e){var t,n,r,o=e.selection.getSelectedBlocks();return $e.grep((t=e,n=o,r=$e.map(n,function(e){var n=t.dom.getParent(e,"li,dd,dt",un(t,e));return n||e}),He.unique(r)),function(e){return Xe(e)})},un=function(e,n){var t=e.dom.getParents(n,"TD,TH");return 0<t.length?t[0]:e.getBody()},an=function(e,n){var t=e.dom.getParents(n,"ol,ul",un(e,n));return P(t)},sn=function(n,e){var t=w(e,function(e){return an(n,e).getOr(e)});return He.unique(t)},cn={isList:function(e){var n=rn(e);return je(n)},getParentList:rn,getSelectedSubLists:function(e){var n,t,r,o=rn(e),i=e.selection.getSelectedBlocks();return r=i,(t=o)&&1===r.length&&r[0]===t?(n=o,$e.grep(n.querySelectorAll("ol,ul,dl"),function(e){return Ve(e)})):$e.grep(i,function(e){return Ve(e)&&o!==e})},getSelectedListItems:on,getClosestListRootElm:un,getSelectedDlItems:function(e){return A(on(e),Ke)},getSelectedListRoots:function(e){var n,t,r,o=(t=an(n=e,n.selection.getStart()),r=A(n.selection.getSelectedBlocks(),ze),t.toArray().concat(r));return sn(e,o)}},fn=tinymce.util.Tools.resolve("tinymce.Env"),dn=function(e,n){var t,r,o,i,u=e.dom,a=e.schema.getBlockElements(),s=u.createFragment();if(e.settings.forced_root_block&&(o=e.settings.forced_root_block),o&&((r=u.create(o)).tagName===e.settings.forced_root_block&&u.setAttribs(r,e.settings.forced_root_block_attrs),Ze(n.firstChild,a)||s.appendChild(r)),n)for(;t=n.firstChild;){var c=t.nodeName;i||"SPAN"===c&&"bookmark"===t.getAttribute("data-mce-type")||(i=!0),Ze(t,a)?(s.appendChild(t),r=null):o?(r||(r=u.create(o),s.appendChild(r)),r.appendChild(t)):s.appendChild(t)}return e.settings.forced_root_block?i||fn.ie&&!(10<fn.ie)||r.appendChild(u.create("br",{"data-mce-bogus":"1"})):s.appendChild(u.create("br")),s},ln=function(e){return e.dom().nodeName.toLowerCase()},mn=(s=he,function(e){return e.dom().nodeType===s}),gn=function(e,n){var t=e.dom();!function(e,n){for(var t=Ee(e),r=0,o=t.length;r<o;r++){var i=t[r];n(e[i],i,e)}}(n,function(e,n){!function(e,n,t){if(!(C(t)||L(t)||E(t)))throw u.console.error("Invalid call to Attr.set. Key ",n,":: Value ",t,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(n,t+"")}(t,n,e)})},pn=function(e){return x(e.dom().attributes,function(e,n){return e[n.name]=n.value,e},{})},vn=function(e,n,t){if(!C(t))throw u.console.error("Invalid call to CSS.set. Property ",n,":: Value ",t,":: Element ",e),new Error("CSS value must be a string: "+t);var r;(r=e).style!==undefined&&T(r.style.getPropertyValue)&&e.style.setProperty(n,t)},hn=function(e){return n=e,t=!0,ve.fromDom(n.dom().cloneNode(t));var n,t},yn=function(e,n){var t,r,o,i,u=(t=e,r=n,o=ve.fromTag(r),i=pn(t),gn(o,i),o);Re(e,u);var a=we(e);return _e(u,a),Be(e),u},Nn=function(e,n){Ie(e.item,n.list)},Sn=function(f,e,d){var n=e.slice(0,d.depth);return P(n).each(function(e){var n,t,r,o,i,u,a,s,c=(n=f,t=d.itemAttributes,r=d.content,o=ve.fromTag("li",n),gn(o,t),_e(o,r),o);u=c,Ie((i=e).list,u),i.item=u,s=d,ln((a=e).list)!==s.listType&&(a.list=yn(a.list,s.listType)),gn(a.list,s.listAttributes)}),n},On=function(e,n,t){var r,o=function(e,n,t){for(var r,o,i,u=[],a=0;a<t;a++)u.push((r=e,o=n.listType,i={list:ve.fromTag(o,r),item:ve.fromTag("li",r)},Ie(i.list,i.item),i));return u}(e,t,t.depth-n.length);return function(e){for(var n=1;n<e.length;n++)Nn(e[n-1],e[n])}(o),function(e,n){for(var t=0;t<e.length-1;t++)r=e[t].item,o="list-style-type",i="none",u=r.dom(),vn(u,o,i);var r,o,i,u;P(e).each(function(e){gn(e.list,n.listAttributes),gn(e.item,n.itemAttributes),_e(e.item,n.content)})}(o,t),r=o,Te([P(n),B(r)],Nn),n.concat(o)},Cn=function(e){return Oe(e,"OL,UL")},bn=function(e){return Ae(e).map(Cn).getOr(!1)},Ln=function(e){return 0<e.depth},Tn=function(e){return e.isSelected},En=function(e){var n=we(e),t=xe(e).map(Cn).getOr(!1)?n.slice(0,-1):n;return w(t,hn)},Dn=Object.prototype.hasOwnProperty,wn=(c=function(e,n){return n},function(){for(var e=new Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var t={},r=0;r<e.length;r++){var o=e[r];for(var i in o)Dn.call(o,i)&&(t[i]=c(t[i],o[i]))}return t}),kn=function(n){k(n,function(r,e){(function(e,n){for(var t=e[n].depth,r=n-1;0<=r;r--){if(e[r].depth===t)return S.some(e[r]);if(e[r].depth<t)break}return S.none()})(n,e).each(function(e){var n,t;t=e,(n=r).listType=t.listType,n.listAttributes=wn({},t.listAttributes)})})},An=function(e){var n=e,t=function(){return n};return{get:t,set:function(e){n=e},clone:function(){return An(t())}}},xn=function(i,u,a,s){return Ae(s).filter(Cn).fold(function(){u.each(function(e){Ne(e.start,s)&&a.set(!0)});var n,t,r,e=(n=s,t=i,r=a.get(),De(n).filter(mn).map(function(e){return{depth:t,isSelected:r,content:En(n),itemAttributes:pn(n),listAttributes:pn(e),listType:ln(e)}}));u.each(function(e){Ne(e.end,s)&&a.set(!1)});var o=xe(s).filter(Cn).map(function(e){return Rn(i,u,a,e)}).getOr([]);return e.toArray().concat(o)},function(e){return Rn(i,u,a,e)})},Rn=function(n,t,r,e){return _(we(e),function(e){return(Cn(e)?Rn:xn)(n+1,t,r,e)})},In=function(i,e){return w(e,function(e){var n,t,r,o=(n=e.content,r=(t||u.document).createDocumentFragment(),k(n,function(e){r.appendChild(e.dom())}),ve.fromDom(r));return ve.fromDom(dn(i,o.dom()))})},_n=function(e,n){return kn(n),(t=e.contentDocument,r=n,o=x(r,function(e,n){return n.depth>e.length?On(t,e,n):Sn(t,e,n)},[]),B(o).map(function(e){return e.list})).toArray();var t,r,o},Bn=function(e){var n,t,r=w(cn.getSelectedListItems(e),ve.fromDom);return Te([R(r,d(bn)),R((n=r,t=D.call(n,0),t.reverse(),t),d(bn))],function(e,n){return{start:e,end:n}})},Pn=function(a,e,s){var n,t,r,o=(n=e,t=Bn(a),r=An(!1),w(n,function(e){return{sourceList:e,entries:Rn(0,t,r,e)}}));k(o,function(e){var n,t;n=e.entries,t=s,k(A(n,Tn),function(e){return function(e,n){switch(e){case"Indent":n.depth++;break;case"Outdent":n.depth--;break;case"Flatten":n.depth=0}}(t,e)});var r,o,i,u=(r=a,o=e.entries,_(function(e,n){if(0===e.length)return[];for(var t=n(e[0]),r=[],o=[],i=0,u=e.length;i<u;i++){var a=e[i],s=n(a);s!==t&&(r.push(o),o=[]),t=s,o.push(a)}return 0!==o.length&&r.push(o),r}(o,Ln),function(e){return B(e).map(Ln).getOr(!1)?_n(r,e):In(r,e)}));k(u,function(e){Pe(a,"Indent"===s?"IndentList":"OutdentList",e.dom())}),i=e.sourceList,k(u,function(e){Re(i,e)}),Be(e.sourceList)})},Mn=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Un=Mn.DOM,Fn=function(e,n,t){var r,o,i,u,a,s;for(i=Un.select('span[data-mce-type="bookmark"]',n),a=dn(e,t),(r=Un.createRng()).setStartAfter(t),r.setEndAfter(n),u=(o=r.extractContents()).firstChild;u;u=u.firstChild)if("LI"===u.nodeName&&e.dom.isEmpty(u)){Un.remove(u);break}e.dom.isEmpty(o)||Un.insertAfter(o,n),Un.insertAfter(a,n),nn(e.dom,t.parentNode)&&(s=t.parentNode,$e.each(i,function(e){s.parentNode.insertBefore(e,t.parentNode)}),Un.remove(s)),Un.remove(t),nn(e.dom,n)&&Un.remove(n)},jn=function(e){Oe(e,"dt")&&yn(e,"dd")},Hn=function(r,e,n){k(n,"Indent"===e?jn:function(e){return n=r,void(Oe(t=e,"dd")?yn(t,"dt"):Oe(t,"dt")&&De(t).each(function(e){return Fn(n,e.dom(),t.dom())}));var n,t})},$n=function(e,n){if(We(e))return{container:e,offset:n};var t=Ce.getNode(e,n);return We(t)?{container:t,offset:n>=e.childNodes.length?t.data.length:0}:t.previousSibling&&We(t.previousSibling)?{container:t.previousSibling,offset:t.previousSibling.data.length}:t.nextSibling&&We(t.nextSibling)?{container:t.nextSibling,offset:0}:{container:e,offset:n}},qn=function(e){var n=e.cloneRange(),t=$n(e.startContainer,e.startOffset);n.setStart(t.container,t.offset);var r=$n(e.endContainer,e.endOffset);return n.setEnd(r.container,r.offset),n},Wn=function(e,n){var t=w(cn.getSelectedListRoots(e),ve.fromDom),r=w(cn.getSelectedDlItems(e),ve.fromDom),o=!1;if(t.length||r.length){var i=e.selection.getBookmark();Pn(e,t,n),Hn(e,n,r),e.selection.moveToBookmark(i),e.selection.setRng(qn(e.selection.getRng())),e.nodeChanged(),o=!0}return o},Vn=function(e){return Wn(e,"Indent")},zn=function(e){return Wn(e,"Outdent")},Kn=function(e){return Wn(e,"Flatten")},Xn=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),Qn=Mn.DOM,Yn=function(o){var i={},e=function(e){var n,t,r;t=o[e?"startContainer":"endContainer"],r=o[e?"startOffset":"endOffset"],1===t.nodeType&&(n=Qn.create("span",{"data-mce-type":"bookmark"}),t.hasChildNodes()?(r=Math.min(r,t.childNodes.length-1),e?t.insertBefore(n,t.childNodes[r]):Qn.insertAfter(n,t.childNodes[r])):t.appendChild(n),t=n,r=0),i[e?"startContainer":"endContainer"]=t,i[e?"startOffset":"endOffset"]=r};return e(!0),o.collapsed||e(),i},Gn=function(o){function e(e){var n,t,r;n=r=o[e?"startContainer":"endContainer"],t=o[e?"startOffset":"endOffset"],n&&(1===n.nodeType&&(t=function(e){for(var n=e.parentNode.firstChild,t=0;n;){if(n===e)return t;1===n.nodeType&&"bookmark"===n.getAttribute("data-mce-type")||t++,n=n.nextSibling}return-1}(n),n=n.parentNode,Qn.remove(r),!n.hasChildNodes()&&Qn.isBlock(n)&&n.appendChild(Qn.create("br"))),o[e?"startContainer":"endContainer"]=n,o[e?"startOffset":"endOffset"]=t)}e(!0),e();var n=Qn.createRng();return n.setStart(o.startContainer,o.startOffset),o.endContainer&&n.setEnd(o.endContainer,o.endOffset),qn(n)},Jn=function(e){return/\btox\-/.test(e.className)},Zn=function(e){switch(e){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},et=function(t,e){$e.each(e,function(e,n){t.setAttribute(n,e)})},nt=function(e,n,t){var r,o,i,u,a,s,c;r=e,o=n,u=(i=t)["list-style-type"]?i["list-style-type"]:null,r.setStyle(o,"list-style-type",u),a=e,et(s=n,(c=t)["list-attributes"]),$e.each(a.select("li",s),function(e){et(e,c["list-item-attributes"])})},tt=function(e,n,t,r){var o,i;for(o=n[t?"startContainer":"endContainer"],i=n[t?"startOffset":"endOffset"],1===o.nodeType&&(o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o),!t&&Ye(o.nextSibling)&&(o=o.nextSibling);o.parentNode!==r;){if(Je(e,o))return o;if(/^(TD|TH)$/.test(o.parentNode.nodeName))return o;o=o.parentNode}return o},rt=function(f,d,l){void 0===l&&(l={});var e,n=f.selection.getRng(!0),m="LI",t=cn.getClosestListRootElm(f,f.selection.getStart(!0)),g=f.dom;"false"!==g.getContentEditable(f.selection.getNode())&&("DL"===(d=d.toUpperCase())&&(m="DT"),e=Yn(n),$e.each(function(t,e,r){for(var o,i=[],u=t.dom,n=tt(t,e,!0,r),a=tt(t,e,!1,r),s=[],c=n;c&&(s.push(c),c!==a);c=c.nextSibling);return $e.each(s,function(e){if(Je(t,e))return i.push(e),void(o=null);if(u.isBlock(e)||Ye(e))return Ye(e)&&u.remove(e),void(o=null);var n=e.nextSibling;Xn.isBookmarkNode(e)&&(Je(t,n)||!n&&e.parentNode===r)?o=null:(o||(o=u.create("p"),e.parentNode.insertBefore(o,e),i.push(o)),o.appendChild(e))}),i}(f,n,t),function(e){var n,t,r,o,i,u,a,s,c;(t=e.previousSibling)&&Ve(t)&&t.nodeName===d&&(r=t,o=l,i=g.getStyle(r,"list-style-type"),u=o?o["list-style-type"]:"",i===(u=null===u?"":u))?(n=t,e=g.rename(e,m),t.appendChild(e)):(n=g.create(d),e.parentNode.insertBefore(n,e),n.appendChild(e),e=g.rename(e,m)),a=g,s=e,c=["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"],$e.each(c,function(e){var n;return a.setStyle(s,((n={})[e]="",n))}),nt(g,n,l),it(f.dom,n)}),f.selection.setRng(Gn(e)))},ot=function(e,n,t){return s=t,(a=n)&&s&&Ve(a)&&a.nodeName===s.nodeName&&(i=n,u=t,(o=e).getStyle(i,"list-style-type",!0)===o.getStyle(u,"list-style-type",!0))&&(r=t,n.className===r.className);var r,o,i,u,a,s},it=function(e,n){var t,r;if(t=n.nextSibling,ot(e,n,t)){for(;r=t.firstChild;)n.appendChild(r);e.remove(t)}if(t=n.previousSibling,ot(e,n,t)){for(;r=t.lastChild;)n.insertBefore(r,n.firstChild);e.remove(t)}},ut=function(n,e,t,r,o){if(e.nodeName!==r||at(o)){var i=Yn(n.selection.getRng(!0));$e.each([e].concat(t),function(e){!function(e,n,t,r){if(n.nodeName!==t){var o=e.dom.rename(n,t);nt(e.dom,o,r),Pe(e,Zn(t),o)}else nt(e.dom,n,r),Pe(e,Zn(t),n)}(n,e,r,o)}),n.selection.setRng(Gn(i))}else Kn(n)},at=function(e){return"list-style-type"in e},st={toggleList:function(e,n,t){var r=cn.getParentList(e),o=cn.getSelectedSubLists(e);t=t||{},r&&0<o.length?ut(e,r,o,n,t):function(e,n,t,r){if(n!==e.getBody())if(n)if(n.nodeName!==t||at(r)||Jn(n)){var o=Yn(e.selection.getRng(!0));nt(e.dom,n,r);var i=e.dom.rename(n,t);it(e.dom,i),e.selection.setRng(Gn(o)),Pe(e,Zn(t),i)}else Kn(e);else rt(e,t,r),Pe(e,Zn(t),n)}(e,r,n,t)},mergeWithAdjacentLists:it},ct=Mn.DOM,ft=function(e,n){var t,r=n.parentNode;"LI"===r.nodeName&&r.firstChild===n&&((t=r.previousSibling)&&"LI"===t.nodeName?(t.appendChild(n),nn(e,r)&&ct.remove(r)):ct.setStyle(r,"listStyleType","none")),Ve(r)&&(t=r.previousSibling)&&"LI"===t.nodeName&&t.appendChild(n)},dt=function(n,e){$e.each($e.grep(n.select("ol,ul",e)),function(e){ft(n,e)})},lt=function(e,n,t,r){var o=n.startContainer,i=n.startOffset;if(We(o)&&(t?i<o.data.length:0<i))return o;var u=e.schema.getNonEmptyElements();1===o.nodeType&&(o=Ce.getNode(o,i));var a=new be(o,r);for(t&&en(e.dom,o)&&a.next();o=a[t?"next":"prev2"]();){if("LI"===o.nodeName&&!o.hasChildNodes())return o;if(u[o.nodeName])return o;if(We(o)&&0<o.data.length)return o}},mt=function(e,n){var t=n.childNodes;return 1===t.length&&!Ve(t[0])&&e.isBlock(t[0])},gt=function(e,n,t){var r,o,i,u;if(o=mt(e,t)?t.firstChild:t,mt(i=e,u=n)&&i.remove(u.firstChild,!0),!nn(e,n,!0))for(;r=n.firstChild;)o.appendChild(r)},pt=function(n,e,t){var r,o,i=e.parentNode;if(tn(n,e)&&tn(n,t)){Ve(t.lastChild)&&(o=t.lastChild),i===t.lastChild&&Ye(i.previousSibling)&&n.remove(i.previousSibling),(r=t.lastChild)&&Ye(r)&&e.hasChildNodes()&&n.remove(r),nn(n,t,!0)&&n.$(t).empty(),gt(n,e,t),o&&t.appendChild(o);var u=Se(ve.fromDom(t),ve.fromDom(e))?n.getParents(e,Ve,t):[];n.remove(e),k(u,function(e){nn(n,e)&&e!==n.getRoot()&&n.remove(e)})}},vt=function(e,n,t,r){var o,i,u,a=e.dom;if(a.isEmpty(r))i=t,u=r,(o=e).dom.$(u).empty(),pt(o.dom,i,u),o.selection.setCursorLocation(u);else{var s=Yn(n);pt(a,t,r),e.selection.setRng(Gn(s))}},ht=function(e,n){var t=e.dom,r=e.selection,o=r.getStart(),i=cn.getClosestListRootElm(e,o),u=t.getParent(r.getStart(),"LI",i);if(u){var a=u.parentNode;if(a===e.getBody()&&nn(t,a))return!0;var s=qn(r.getRng()),c=t.getParent(lt(e,s,n,i),"LI",i);if(c&&c!==u)return e.undoManager.transact(function(){n?vt(e,s,c,u):Ge(u)?zn(e):function(e,n,t,r){var o=Yn(n);pt(e.dom,t,r);var i=Gn(o);e.selection.setRng(i)}(e,s,u,c)}),!0;if(!c&&!n&&0===s.startOffset&&0===s.endOffset)return e.undoManager.transact(function(){Kn(e)}),!0}return!1},yt=function(e,n){return ht(e,n)||function(o,i){var u=o.dom,e=o.selection.getStart(),a=cn.getClosestListRootElm(o,e),s=u.getParent(e,u.isBlock,a);if(s&&u.isEmpty(s)){var n=qn(o.selection.getRng()),c=u.getParent(lt(o,n,i,a),"LI",a);if(c)return o.undoManager.transact(function(){var e,n,t,r;n=s,t=a,r=(e=u).getParent(n.parentNode,e.isBlock,t),e.remove(n),r&&e.isEmpty(r)&&e.remove(r),st.mergeWithAdjacentLists(u,c.parentNode),o.selection.select(c,!0),o.selection.collapse(i)}),!0}return!1}(e,n)},Nt=function(e,n){return e.selection.isCollapsed()?yt(e,n):(r=(t=e).selection.getStart(),o=cn.getClosestListRootElm(t,r),!!(t.dom.getParent(r,"LI,DT,DD",o)||0<cn.getSelectedListItems(t).length)&&(t.undoManager.transact(function(){t.execCommand("Delete"),dt(t.dom,t.getBody())}),!0));var t,r,o},St=function(n){n.on("keydown",function(e){e.keyCode===Le.BACKSPACE?Nt(n,!1)&&e.preventDefault():e.keyCode===Le.DELETE&&Nt(n,!0)&&e.preventDefault()})},Ot=Nt,Ct=function(n){return{backspaceDelete:function(e){Ot(n,e)}}},bt=function(n,t){return function(){var e=n.dom.getParent(n.selection.getStart(),"UL,OL,DL");return e&&e.nodeName===t}},Lt=function(t){t.on("BeforeExecCommand",function(e){var n=e.command.toLowerCase();"indent"===n?Vn(t):"outdent"===n&&zn(t)}),t.addCommand("InsertUnorderedList",function(e,n){st.toggleList(t,"UL",n)}),t.addCommand("InsertOrderedList",function(e,n){st.toggleList(t,"OL",n)}),t.addCommand("InsertDefinitionList",function(e,n){st.toggleList(t,"DL",n)}),t.addCommand("RemoveList",function(){Kn(t)}),t.addQueryStateHandler("InsertUnorderedList",bt(t,"UL")),t.addQueryStateHandler("InsertOrderedList",bt(t,"OL")),t.addQueryStateHandler("InsertDefinitionList",bt(t,"DL"))},Tt=function(e){return e.getParam("lists_indent_on_tab",!0)},Et=function(e){var n;Tt(e)&&(n=e).on("keydown",function(e){e.keyCode!==Le.TAB||Le.metaKeyPressed(e)||n.undoManager.transact(function(){(e.shiftKey?zn(n):Vn(n))&&e.preventDefault()})}),St(e)},Dt=function(n,i){return function(o){var e=function(e){var n=function(e,n){for(var t=0;t<e.length;t++)if(n(e[t]))return t;return-1}(e.parents,Qe),t=-1!==n?e.parents.slice(0,n):e.parents,r=$e.grep(t,Ve);o.setActive(0<r.length&&r[0].nodeName===i&&!Jn(r[0]))};return n.on("NodeChange",e),function(){return n.off("NodeChange",e)}}},wt=function(n){var e,t,r,o=function(e){return function(){return n.execCommand(e)}};t="advlist",r=(e=n).settings.plugins?e.settings.plugins:"",-1===$e.inArray(r.split(/[ ,]/),t)&&(n.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:o("InsertOrderedList"),onSetup:Dt(n,"OL")}),n.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:o("InsertUnorderedList"),onSetup:Dt(n,"UL")}))};!function kt(){f.add("lists",function(e){return Et(e),wt(e),Lt(e),Ct(e)})}()}(window);
|
9
|
+
!function(r){"use strict";function e(){}function d(e){return function(){return e}}function t(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return!t.apply(null,e)}}function n(){return a}var o,i=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=d(!1),s=d(!0),a=(o={fold:function(e,n){return e()},is:u,isSome:u,isNone:s,getOr:l,getOrThunk:f,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:d(null),getOrUndefined:d(undefined),or:l,orThunk:f,map:n,each:e,bind:n,exists:u,forall:s,filter:n,equals:c,equals_:c,toArray:function(){return[]},toString:d("none()")},Object.freeze&&Object.freeze(o),o);function c(e){return e.isNone()}function f(e){return e()}function l(e){return e}function m(n){return function(e){return function(e){if(null===e)return"null";var n=typeof e;return"object"==n&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":n}(e)===n}}function g(e,n){for(var t=e.length,r=new Array(t),o=0;o<t;o++){var i=e[o];r[o]=n(i,o)}return r}function p(e,n){for(var t=0,r=e.length;t<r;t++){n(e[t],t)}}function v(e,n){for(var t=[],r=0,o=e.length;r<o;r++){var i=e[r];n(i,r)&&t.push(i)}return t}function h(e,n,t){return p(e,function(e){t=n(t,e)}),t}function y(e,n){for(var t=0,r=e.length;t<r;t++){var o=e[t];if(n(o,t))return Ve.some(o)}return Ve.none()}function N(e,n){return function(e){for(var n=[],t=0,r=e.length;t<r;++t){if(!Ke(e[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+e);Je.apply(n,e[t])}return n}(g(e,n))}function S(e){return 0===e.length?Ve.none():Ve.some(e[0])}function O(e){return 0===e.length?Ve.none():Ve.some(e[e.length-1])}function C(e,n,t){return 0!=(e.compareDocumentPosition(n)&t)}function b(e,n){var t=function(e,n){for(var t=0;t<e.length;t++){var r=e[t];if(r.test(n))return r}return undefined}(e,n);if(!t)return{major:0,minor:0};function r(e){return Number(n.replace(t,"$"+e))}return nn(r(1),r(2))}function L(e,n){return function(){return n===e}}function T(e,n){return function(){return n===e}}function E(e,n){var t=String(n).toLowerCase();return y(e,function(e){return e.search(t)})}function D(e,n){return-1!==e.indexOf(n)}function w(n){return function(e){return D(e,n)}}function k(e,n){return e.dom()===n.dom()}function A(e,n,t){return e.isSome()&&n.isSome()?Ve.some(t(e.getOrDie(),n.getOrDie())):Ve.none()}function x(e){return Ve.from(e.dom().parentNode).map(En.fromDom)}function R(e){return g(e.dom().childNodes,En.fromDom)}function I(e,n){var t=e.dom().childNodes;return Ve.from(t[n]).map(En.fromDom)}function _(e){return I(e,0)}function B(e){return I(e,e.dom().childNodes.length-1)}function P(n,t){x(n).each(function(e){e.dom().insertBefore(t.dom(),n.dom())})}function M(e,n){e.dom().appendChild(n.dom())}function U(n,e){p(e,function(e){M(n,e)})}function F(e){var n=e.dom();null!==n.parentNode&&n.parentNode.removeChild(n)}function j(e,n,t){return e.fire("ListMutation",{action:n,element:t})}function H(e,n){return function(e,n){for(var t=n!==undefined&&null!==n?n:Bn,r=0;r<e.length&&t!==undefined&&null!==t;++r)t=t[e[r]];return t}(e.split("."),n)}function $(e){return e&&"BR"===e.nodeName}function q(e){var n=e.selection.getStart(!0);return e.dom.getParent(n,"OL,UL,DL",Zn(e,n))}function W(e){var n=e.selection.getSelectedBlocks();return Fn.grep(function(t,e){var n=Fn.map(e,function(e){var n=t.dom.getParent(e,"li,dd,dt",Zn(t,e));return n||e});return Un.unique(n)}(e,n),function(e){return Wn(e)})}function V(e,n){var t=e.dom.getParents(n,"ol,ul",Zn(e,n));return O(t)}function z(e,n){var t,r,o,i,u=e.dom,s=e.schema.getBlockElements(),a=u.createFragment();if(e.settings.forced_root_block&&(o=e.settings.forced_root_block),o&&((r=u.create(o)).tagName===e.settings.forced_root_block&&u.setAttribs(r,e.settings.forced_root_block_attrs),Qn(n.firstChild,s)||a.appendChild(r)),n)for(;t=n.firstChild;){var c=t.nodeName;i||"SPAN"===c&&"bookmark"===t.getAttribute("data-mce-type")||(i=!0),Qn(t,s)?(a.appendChild(t),r=null):o?(r||(r=u.create(o),a.appendChild(r)),r.appendChild(t)):a.appendChild(t)}return e.settings.forced_root_block?i||tt.ie&&!(10<tt.ie)||r.appendChild(u.create("br",{"data-mce-bogus":"1"})):a.appendChild(u.create("br")),a}function K(e){return e.dom().nodeName.toLowerCase()}function X(e,n){var t=e.dom();!function(e,n){for(var t=_n(e),r=0,o=t.length;r<o;r++){var i=t[r];n(e[i],i)}}(n,function(e,n){!function(e,n,t){if(!(ze(t)||Xe(t)||Ye(t)))throw r.console.error("Invalid call to Attr.set. Key ",n,":: Value ",t,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(n,t+"")}(t,n,e)})}function Q(e){return h(e.dom().attributes,function(e,n){return e[n.name]=n.value,e},{})}function Y(e,n,t){if(!ze(t))throw r.console.error("Invalid call to CSS.set. Property ",n,":: Value ",t,":: Element ",e),new Error("CSS value must be a string: "+t);!function(e){return e.style!==undefined&&Qe(e.style.getPropertyValue)}(e)||e.style.setProperty(n,t)}function G(e){return function(e,n){return En.fromDom(e.dom().cloneNode(n))}(e,!0)}function J(e,n){var t=function(e,n){var t=En.fromTag(n),r=Q(e);return X(t,r),t}(e,n);P(e,t);var r=R(e);return U(t,r),F(e),t}function Z(e,n){M(e.item,n.list)}function ee(n,e,t){var r=e.slice(0,t.depth);return O(r).each(function(e){!function(e,n){M(e.list,n),e.item=n}(e,function(e,n,t){var r=En.fromTag("li",e);return X(r,n),U(r,t),r}(n,t.itemAttributes,t.content)),function(e,n){K(e.list)!==n.listType&&(e.list=J(e.list,n.listType)),X(e.list,n.listAttributes)}(e,t)}),r}function ne(e,n,t){var r=function(e,n,t){for(var r,o,i,u=[],s=0;s<t;s++)u.push((r=e,o=n.listType,void 0,i={list:En.fromTag(o,r),item:En.fromTag("li",r)},M(i.list,i.item),i));return u}(e,t,t.depth-n.length);return function(e){for(var n=1;n<e.length;n++)Z(e[n-1],e[n])}(r),function(e,n){for(var t=0;t<e.length-1;t++)r=e[t].item,o="list-style-type",i="none",void 0,u=r.dom(),Y(u,o,i);var r,o,i,u;O(e).each(function(e){X(e.list,n.listAttributes),X(e.item,n.itemAttributes),U(e.item,n.content)})}(r,t),function(e,n){A(O(e),S(n),Z)}(n,r),n.concat(r)}function te(e){return An(e,"OL,UL")}function re(e){return _(e).map(te).getOr(!1)}function oe(e){return 0<e.depth}function ie(e){return e.isSelected}function ue(e){var n=R(e),t=function(e){return B(e).map(te).getOr(!1)}(e)?n.slice(0,-1):n;return g(t,G)}function se(t){p(t,function(n,e){(function(e,n){for(var t=e[n].depth,r=n-1;0<=r;r--){if(e[r].depth===t)return Ve.some(e[r]);if(e[r].depth<t)break}return Ve.none()})(t,e).each(function(e){!function(e,n){e.listType=n.listType,e.listAttributes=it({},n.listAttributes)}(n,e)})})}function ae(t,r,o,i){return _(i).filter(te).fold(function(){r.each(function(e){k(e.start,i)&&o.set(!0)});var e=function(n,t,r){return x(n).filter(rt).map(function(e){return{depth:t,isSelected:r,content:ue(n),itemAttributes:Q(n),listAttributes:Q(e),listType:K(e)}})}(i,t,o.get());r.each(function(e){k(e.end,i)&&o.set(!1)});var n=B(i).filter(te).map(function(e){return st(t,r,o,e)}).getOr([]);return e.toArray().concat(n)},function(e){return st(t,r,o,e)})}function ce(t,e){return g(e,function(e){var n=function(e,n){var t=(n||r.document).createDocumentFragment();return p(e,function(e){t.appendChild(e.dom())}),En.fromDom(t)}(e.content);return En.fromDom(z(t,n.dom()))})}function fe(e,n){return se(n),function(t,e){var n=h(e,function(e,n){return n.depth>e.length?ne(t,e,n):ee(t,e,n)},[]);return S(n).map(function(e){return e.list})}(e.contentDocument,n).toArray()}function de(e){var n=g(nt.getSelectedListItems(e),En.fromDom);return A(y(n,t(re)),y(function(e){var n=Ge.call(e,0);return n.reverse(),n}(n),t(re)),function(e,n){return{start:e,end:n}})}function le(t,e,r){var n=function(e,n){var t=ut(!1);return g(e,function(e){return{sourceList:e,entries:st(0,n,t,e)}})}(e,de(t));p(n,function(e){!function(e,n){p(v(e,ie),function(e){return function(e,n){switch(e){case"Indent":n.depth++;break;case"Outdent":n.depth--;break;case"Flatten":n.depth=0}}(n,e)})}(e.entries,r);var n=function(n,e){return N(function(e,n){if(0===e.length)return[];for(var t=n(e[0]),r=[],o=[],i=0,u=e.length;i<u;i++){var s=e[i],a=n(s);a!==t&&(r.push(o),o=[]),t=a,o.push(s)}return 0!==o.length&&r.push(o),r}(e,oe),function(e){return S(e).map(oe).getOr(!1)?fe(n,e):ce(n,e)})}(t,e.entries);p(n,function(e){j(t,"Indent"===r?"IndentList":"OutdentList",e.dom())}),function(n,e){p(e,function(e){P(n,e)})}(e.sourceList,n),F(e.sourceList)})}function me(e){An(e,"dt")&&J(e,"dd")}function ge(n,e,t){p(t,"Indent"===e?me:function(e){return function(n,t){An(t,"dd")?J(t,"dt"):An(t,"dt")&&x(t).each(function(e){return ft(n,e.dom(),t.dom())})}(n,e)})}function pe(e,n){if(jn(e))return{container:e,offset:n};var t=xn.getNode(e,n);return jn(t)?{container:t,offset:n>=e.childNodes.length?t.data.length:0}:t.previousSibling&&jn(t.previousSibling)?{container:t.previousSibling,offset:t.previousSibling.data.length}:t.nextSibling&&jn(t.nextSibling)?{container:t.nextSibling,offset:0}:{container:e,offset:n}}function ve(e,n){var t=g(nt.getSelectedListRoots(e),En.fromDom),r=g(nt.getSelectedDlItems(e),En.fromDom),o=!1;if(t.length||r.length){var i=e.selection.getBookmark();le(e,t,n),ge(e,n,r),e.selection.moveToBookmark(i),e.selection.setRng(dt(e.selection.getRng())),e.nodeChanged(),o=!0}return o}function he(e){return ve(e,"Indent")}function ye(e){return ve(e,"Outdent")}function Ne(e){return ve(e,"Flatten")}function Se(e){return/\btox\-/.test(e.className)}function Oe(e){switch(e){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}}function Ce(t,e){Fn.each(e,function(e,n){t.setAttribute(n,e)})}function be(e,n,t){!function(e,n,t){var r=t["list-style-type"]?t["list-style-type"]:null;e.setStyle(n,"list-style-type",r)}(e,n,t),function(e,n,t){Ce(n,t["list-attributes"]),Fn.each(e.select("li",n),function(e){Ce(e,t["list-item-attributes"])})}(e,n,t)}function Le(e,n,t,r){var o,i;for(o=n[t?"startContainer":"endContainer"],i=n[t?"startOffset":"endOffset"],1===o.nodeType&&(o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o),!t&&zn(o.nextSibling)&&(o=o.nextSibling);o.parentNode!==r;){if(Xn(e,o))return o;if(/^(TD|TH)$/.test(o.parentNode.nodeName))return o;o=o.parentNode}return o}function Te(r,o,i){void 0===i&&(i={});var e,n=r.selection.getRng(!0),u="LI",t=nt.getClosestListRootElm(r,r.selection.getStart(!0)),s=r.dom;"false"!==s.getContentEditable(r.selection.getNode())&&("DL"===(o=o.toUpperCase())&&(u="DT"),e=gt(n),Fn.each(function(t,e,r){for(var o,i=[],u=t.dom,n=Le(t,e,!0,r),s=Le(t,e,!1,r),a=[],c=n;c&&(a.push(c),c!==s);c=c.nextSibling);return Fn.each(a,function(e){if(Xn(t,e))return i.push(e),void(o=null);if(u.isBlock(e)||zn(e))return zn(e)&&u.remove(e),void(o=null);var n=e.nextSibling;lt.isBookmarkNode(e)&&(Xn(t,n)||!n&&e.parentNode===r)?o=null:(o||(o=u.create("p"),e.parentNode.insertBefore(o,e),i.push(o)),o.appendChild(e))}),i}(r,n,t),function(e){var n,t;(t=e.previousSibling)&&Hn(t)&&t.nodeName===o&&function(e,n,t){var r=e.getStyle(n,"list-style-type"),o=t?t["list-style-type"]:"";return r===(o=null===o?"":o)}(s,t,i)?(n=t,e=s.rename(e,u),t.appendChild(e)):(n=s.create(o),e.parentNode.insertBefore(n,e),n.appendChild(e),e=s.rename(e,u)),function(t,r,e){Fn.each(e,function(e){var n;return t.setStyle(r,((n={})[e]="",n))})}(s,e,["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"]),be(s,n,i),vt(r.dom,n)}),r.selection.setRng(pt(e)))}function Ee(e,n,t){return function(e,n){return e&&n&&Hn(e)&&e.nodeName===n.nodeName}(n,t)&&function(e,n,t){return e.getStyle(n,"list-style-type",!0)===e.getStyle(t,"list-style-type",!0)}(e,n,t)&&function(e,n){return e.className===n.className}(n,t)}function De(n,e,t,r,o){if(e.nodeName!==r||ht(o)){var i=gt(n.selection.getRng(!0));Fn.each([e].concat(t),function(e){!function(e,n,t,r){if(n.nodeName!==t){var o=e.dom.rename(n,t);be(e.dom,o,r),j(e,Oe(t),o)}else be(e.dom,n,r),j(e,Oe(t),n)}(n,e,r,o)}),n.selection.setRng(pt(i))}else Ne(n)}function we(e,n){var t,r=n.parentNode;"LI"===r.nodeName&&r.firstChild===n&&((t=r.previousSibling)&&"LI"===t.nodeName?(t.appendChild(n),Gn(e,r)&&Nt.remove(r)):Nt.setStyle(r,"listStyleType","none")),Hn(r)&&(t=r.previousSibling)&&"LI"===t.nodeName&&t.appendChild(n)}function ke(e,n,t,r){var o=n.startContainer,i=n.startOffset;if(jn(o)&&(t?i<o.data.length:0<i))return o;var u=e.schema.getNonEmptyElements();1===o.nodeType&&(o=xn.getNode(o,i));var s=new Rn(o,r);for(t&&Yn(e.dom,o)&&s.next();o=s[t?"next":"prev2"]();){if("LI"===o.nodeName&&!o.hasChildNodes())return o;if(u[o.nodeName])return o;if(jn(o)&&0<o.data.length)return o}}function Ae(e,n){var t=n.childNodes;return 1===t.length&&!Hn(t[0])&&e.isBlock(t[0])}function xe(e,n,t){var r,o;if(o=Ae(e,t)?t.firstChild:t,function(e,n){Ae(e,n)&&e.remove(n.firstChild,!0)}(e,n),!Gn(e,n,!0))for(;r=n.firstChild;)o.appendChild(r)}function Re(n,e,t){var r,o,i=e.parentNode;if(Jn(n,e)&&Jn(n,t)){Hn(t.lastChild)&&(o=t.lastChild),i===t.lastChild&&zn(i.previousSibling)&&n.remove(i.previousSibling),(r=t.lastChild)&&zn(r)&&e.hasChildNodes()&&n.remove(r),Gn(n,t,!0)&&n.$(t).empty(),xe(n,e,t),o&&t.appendChild(o);var u=kn(En.fromDom(t),En.fromDom(e))?n.getParents(e,Hn,t):[];n.remove(e),p(u,function(e){Gn(n,e)&&e!==n.getRoot()&&n.remove(e)})}}function Ie(e,n,t,r){var o=e.dom;if(o.isEmpty(r))!function(e,n,t){e.dom.$(t).empty(),Re(e.dom,n,t),e.selection.setCursorLocation(t)}(e,t,r);else{var i=gt(n);Re(o,t,r),e.selection.setRng(pt(i))}}function _e(e,n){var t=e.dom,r=e.selection,o=r.getStart(),i=nt.getClosestListRootElm(e,o),u=t.getParent(r.getStart(),"LI",i);if(u){var s=u.parentNode;if(s===e.getBody()&&Gn(t,s))return!0;var a=dt(r.getRng()),c=t.getParent(ke(e,a,n,i),"LI",i);if(c&&c!==u)return e.undoManager.transact(function(){n?Ie(e,a,c,u):Kn(u)?ye(e):function(e,n,t,r){var o=gt(n);Re(e.dom,t,r);var i=pt(o);e.selection.setRng(i)}(e,a,u,c)}),!0;if(!c&&!n&&0===a.startOffset&&0===a.endOffset)return e.undoManager.transact(function(){Ne(e)}),!0}return!1}function Be(e,n){return _e(e,n)||function(e,n){var t=e.dom,r=e.selection.getStart(),o=nt.getClosestListRootElm(e,r),i=t.getParent(r,t.isBlock,o);if(i&&t.isEmpty(i)){var u=dt(e.selection.getRng()),s=t.getParent(ke(e,u,n,o),"LI",o);if(s)return e.undoManager.transact(function(){!function(e,n,t){var r=e.getParent(n.parentNode,e.isBlock,t);e.remove(n),r&&e.isEmpty(r)&&e.remove(r)}(t,i,o),yt.mergeWithAdjacentLists(t,s.parentNode),e.selection.select(s,!0),e.selection.collapse(n)}),!0}return!1}(e,n)}function Pe(e,n){return e.selection.isCollapsed()?Be(e,n):function(e){var n=e.selection.getStart(),t=nt.getClosestListRootElm(e,n);return!!(e.dom.getParent(n,"LI,DT,DD",t)||0<nt.getSelectedListItems(e).length)&&(e.undoManager.transact(function(){e.execCommand("Delete"),St(e.dom,e.getBody())}),!0)}(e)}function Me(n,t){return function(){var e=n.dom.getParent(n.selection.getStart(),"UL,OL,DL");return e&&e.nodeName===t}}function Ue(n,i){return function(o){function e(e){var n=function(e,n){for(var t=0;t<e.length;t++){if(n(e[t]))return t}return-1}(e.parents,Vn),t=-1!==n?e.parents.slice(0,n):e.parents,r=Fn.grep(t,Hn);o.setActive(0<r.length&&r[0].nodeName===i&&!Se(r[0]))}return n.on("NodeChange",e),function(){return n.off("NodeChange",e)}}}var Fe,je,He,$e,qe,We=function(t){function e(){return o}function n(e){return e(t)}var r=d(t),o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:s,isNone:u,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:e,orThunk:e,map:function(e){return We(e(t))},each:function(e){e(t)},bind:n,exists:n,forall:n,filter:function(e){return e(t)?o:a},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(u,function(e){return n(t,e)})}};return o},Ve={some:We,none:n,from:function(e){return null===e||e===undefined?a:We(e)}},ze=m("string"),Ke=m("array"),Xe=m("boolean"),Qe=m("function"),Ye=m("number"),Ge=Array.prototype.slice,Je=Array.prototype.push,Ze=(Qe(Array.from)&&Array.from,function(e,n){return C(e,n,r.Node.DOCUMENT_POSITION_CONTAINED_BY)}),en=function(){return nn(0,0)},nn=function(e,n){return{major:e,minor:n}},tn={nu:nn,detect:function(e,n){var t=String(n).toLowerCase();return 0===e.length?en():b(e,t)},unknown:en},rn="Edge",on="Chrome",un="Opera",sn="Firefox",an="Safari",cn=function(e){var n=e.current;return{current:n,version:e.version,isEdge:L(rn,n),isChrome:L(on,n),isIE:L("IE",n),isOpera:L(un,n),isFirefox:L(sn,n),isSafari:L(an,n)}},fn={unknown:function(){return cn({current:undefined,version:tn.unknown()})},nu:cn,edge:d(rn),chrome:d(on),ie:d("IE"),opera:d(un),firefox:d(sn),safari:d(an)},dn="Windows",ln="Android",mn="Solaris",gn="FreeBSD",pn=function(e){var n=e.current;return{current:n,version:e.version,isWindows:T(dn,n),isiOS:T("iOS",n),isAndroid:T(ln,n),isOSX:T("OSX",n),isLinux:T("Linux",n),isSolaris:T(mn,n),isFreeBSD:T(gn,n)}},vn={unknown:function(){return pn({current:undefined,version:tn.unknown()})},nu:pn,windows:d(dn),ios:d("iOS"),android:d(ln),linux:d("Linux"),osx:d("OSX"),solaris:d(mn),freebsd:d(gn)},hn=function(e,t){return E(e,t).map(function(e){var n=tn.detect(e.versionRegexes,t);return{current:e.name,version:n}})},yn=function(e,t){return E(e,t).map(function(e){var n=tn.detect(e.versionRegexes,t);return{current:e.name,version:n}})},Nn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Sn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return D(e,"edge/")&&D(e,"chrome")&&D(e,"safari")&&D(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Nn],search:function(e){return D(e,"chrome")&&!D(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return D(e,"msie")||D(e,"trident")}},{name:"Opera",versionRegexes:[Nn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:w("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:w("firefox")},{name:"Safari",versionRegexes:[Nn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(D(e,"safari")||D(e,"mobile/"))&&D(e,"applewebkit")}}],On=[{name:"Windows",search:w("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return D(e,"iphone")||D(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:w("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:w("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:w("linux"),versionRegexes:[]},{name:"Solaris",search:w("sunos"),versionRegexes:[]},{name:"FreeBSD",search:w("freebsd"),versionRegexes:[]}],Cn={browsers:d(Sn),oses:d(On)},bn=function(e){var n=Cn.browsers(),t=Cn.oses(),r=hn(n,e).fold(fn.unknown,fn.nu),o=yn(t,e).fold(vn.unknown,vn.nu);return{browser:r,os:o,deviceType:function(e,n,t){var r=e.isiOS()&&!0===/ipad/i.test(t),o=e.isiOS()&&!r,i=e.isAndroid()&&3===e.version.major,u=e.isAndroid()&&4===e.version.major,s=r||i||u&&!0===/mobile/i.test(t),a=e.isiOS()||e.isAndroid(),c=a&&!s,f=n.isSafari()&&e.isiOS()&&!1===/safari/i.test(t);return{isiPad:d(r),isiPhone:d(o),isTablet:d(s),isPhone:d(c),isTouch:d(a),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:d(f)}}(o,r,e)}},Ln={detect:(He=!(Fe=function(){var e=r.navigator.userAgent;return bn(e)}),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return He||(He=!0,je=Fe.apply(null,e)),je})},Tn=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:d(e)}},En={fromHtml:function(e,n){var t=(n||r.document).createElement("div");if(t.innerHTML=e,!t.hasChildNodes()||1<t.childNodes.length)throw r.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return Tn(t.childNodes[0])},fromTag:function(e,n){var t=(n||r.document).createElement(e);return Tn(t)},fromText:function(e,n){var t=(n||r.document).createTextNode(e);return Tn(t)},fromDom:Tn,fromPoint:function(e,n,t){var r=e.dom();return Ve.from(r.elementFromPoint(n,t)).map(Tn)}},Dn=(r.Node.ATTRIBUTE_NODE,r.Node.CDATA_SECTION_NODE,r.Node.COMMENT_NODE,r.Node.DOCUMENT_NODE,r.Node.DOCUMENT_TYPE_NODE,r.Node.DOCUMENT_FRAGMENT_NODE,r.Node.ELEMENT_NODE),wn=(r.Node.TEXT_NODE,r.Node.PROCESSING_INSTRUCTION_NODE,r.Node.ENTITY_REFERENCE_NODE,r.Node.ENTITY_NODE,r.Node.NOTATION_NODE,Dn),kn=Ln.detect().browser.isIE()?function(e,n){return Ze(e.dom(),n.dom())}:function(e,n){var t=e.dom(),r=n.dom();return t!==r&&t.contains(r)},An=function(e,n){var t=e.dom();if(t.nodeType!==wn)return!1;var r=t;if(r.matches!==undefined)return r.matches(n);if(r.msMatchesSelector!==undefined)return r.msMatchesSelector(n);if(r.webkitMatchesSelector!==undefined)return r.webkitMatchesSelector(n);if(r.mozMatchesSelector!==undefined)return r.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")},xn=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),Rn=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),In=tinymce.util.Tools.resolve("tinymce.util.VK"),_n=Object.keys,Bn=(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n]}("element","offset"),"undefined"!=typeof r.window?r.window:Function("return this;")()),Pn=function(e,n){var t=function(e,n){return H(e,n)}(e,n);if(t===undefined||null===t)throw new Error(e+" not available on this browser");return t},Mn=function(e){return function(e){return Pn("HTMLElement",e)}(H("ownerDocument.defaultView",e)).prototype.isPrototypeOf(e)},Un=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),Fn=tinymce.util.Tools.resolve("tinymce.util.Tools"),jn=function(e){return e&&3===e.nodeType},Hn=function(e){return e&&/^(OL|UL|DL)$/.test(e.nodeName)},$n=function(e){return e&&/^(OL|UL)$/.test(e.nodeName)},qn=function(e){return e&&/^(DT|DD)$/.test(e.nodeName)},Wn=function(e){return e&&/^(LI|DT|DD)$/.test(e.nodeName)},Vn=function(e){return e&&/^(TH|TD)$/.test(e.nodeName)},zn=$,Kn=function(e){return e.parentNode.firstChild===e},Xn=function(e,n){return n&&!!e.schema.getTextBlockElements()[n.nodeName]},Qn=function(e,n){return e&&e.nodeName in n},Yn=function(e,n){return!!$(n)&&!(!e.isBlock(n.nextSibling)||$(n.previousSibling))},Gn=function(e,n,t){var r=e.isEmpty(n);return!(t&&0<e.select("span[data-mce-type=bookmark]",n).length)&&r},Jn=function(e,n){return e.isChildOf(n,e.getRoot())},Zn=function(e,n){var t=e.dom.getParents(n,"TD,TH");return 0<t.length?t[0]:e.getBody()},et=function(n,e){var t=g(e,function(e){return V(n,e).getOr(e)});return Un.unique(t)},nt={isList:function(e){var n=q(e);return Mn(n)},getParentList:q,getSelectedSubLists:function(e){var n=q(e),t=e.selection.getSelectedBlocks();return function(e,n){return e&&1===n.length&&n[0]===e}(n,t)?function(e){return Fn.grep(e.querySelectorAll("ol,ul,dl"),function(e){return Hn(e)})}(n):Fn.grep(t,function(e){return Hn(e)&&n!==e})},getSelectedListItems:W,getClosestListRootElm:Zn,getSelectedDlItems:function(e){return v(W(e),qn)},getSelectedListRoots:function(e){var n=function(e){var n=V(e,e.selection.getStart()),t=v(e.selection.getSelectedBlocks(),$n);return n.toArray().concat(t)}(e);return et(e,n)}},tt=tinymce.util.Tools.resolve("tinymce.Env"),rt=($e=Dn,function(e){return function(e){return e.dom().nodeType}(e)===$e}),ot=Object.prototype.hasOwnProperty,it=(qe=function(e,n){return n},function(){for(var e=new Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var t={},r=0;r<e.length;r++){var o=e[r];for(var i in o)ot.call(o,i)&&(t[i]=qe(t[i],o[i]))}return t}),ut=function(e){function n(){return t}var t=e;return{get:n,set:function(e){t=e},clone:function(){return ut(n())}}},st=function(n,t,r,e){return N(R(e),function(e){return(te(e)?st:ae)(n+1,t,r,e)})},at=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),ct=at.DOM,ft=function(e,n,t){var r,o,i,u,s,a;for(i=ct.select('span[data-mce-type="bookmark"]',n),s=z(e,t),(r=ct.createRng()).setStartAfter(t),r.setEndAfter(n),u=(o=r.extractContents()).firstChild;u;u=u.firstChild)if("LI"===u.nodeName&&e.dom.isEmpty(u)){ct.remove(u);break}e.dom.isEmpty(o)||ct.insertAfter(o,n),ct.insertAfter(s,n),Gn(e.dom,t.parentNode)&&(a=t.parentNode,Fn.each(i,function(e){a.parentNode.insertBefore(e,t.parentNode)}),ct.remove(a)),ct.remove(t),Gn(e.dom,n)&&ct.remove(n)},dt=function(e){var n=e.cloneRange(),t=pe(e.startContainer,e.startOffset);n.setStart(t.container,t.offset);var r=pe(e.endContainer,e.endOffset);return n.setEnd(r.container,r.offset),n},lt=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),mt=at.DOM,gt=function(o){function e(e){var n,t,r;t=o[e?"startContainer":"endContainer"],r=o[e?"startOffset":"endOffset"],1===t.nodeType&&(n=mt.create("span",{"data-mce-type":"bookmark"}),t.hasChildNodes()?(r=Math.min(r,t.childNodes.length-1),e?t.insertBefore(n,t.childNodes[r]):mt.insertAfter(n,t.childNodes[r])):t.appendChild(n),t=n,r=0),i[e?"startContainer":"endContainer"]=t,i[e?"startOffset":"endOffset"]=r}var i={};return e(!0),o.collapsed||e(),i},pt=function(o){function e(e){var n,t,r;n=r=o[e?"startContainer":"endContainer"],t=o[e?"startOffset":"endOffset"],n&&(1===n.nodeType&&(t=function(e){for(var n=e.parentNode.firstChild,t=0;n;){if(n===e)return t;1===n.nodeType&&"bookmark"===n.getAttribute("data-mce-type")||t++,n=n.nextSibling}return-1}(n),n=n.parentNode,mt.remove(r),!n.hasChildNodes()&&mt.isBlock(n)&&n.appendChild(mt.create("br"))),o[e?"startContainer":"endContainer"]=n,o[e?"startOffset":"endOffset"]=t)}e(!0),e();var n=mt.createRng();return n.setStart(o.startContainer,o.startOffset),o.endContainer&&n.setEnd(o.endContainer,o.endOffset),dt(n)},vt=function(e,n){var t,r;if(t=n.nextSibling,Ee(e,n,t)){for(;r=t.firstChild;)n.appendChild(r);e.remove(t)}if(t=n.previousSibling,Ee(e,n,t)){for(;r=t.lastChild;)n.insertBefore(r,n.firstChild);e.remove(t)}},ht=function(e){return"list-style-type"in e},yt={toggleList:function(e,n,t){var r=nt.getParentList(e),o=nt.getSelectedSubLists(e);t=t||{},r&&0<o.length?De(e,r,o,n,t):function(e,n,t,r){if(n!==e.getBody())if(n)if(n.nodeName!==t||ht(r)||Se(n)){var o=gt(e.selection.getRng(!0));be(e.dom,n,r);var i=e.dom.rename(n,t);vt(e.dom,i),e.selection.setRng(pt(o)),j(e,Oe(t),i)}else Ne(e);else Te(e,t,r),j(e,Oe(t),n)}(e,r,n,t)},mergeWithAdjacentLists:vt},Nt=at.DOM,St=function(n,e){Fn.each(Fn.grep(n.select("ol,ul",e)),function(e){we(n,e)})},Ot=function(n){n.on("keydown",function(e){e.keyCode===In.BACKSPACE?Pe(n,!1)&&e.preventDefault():e.keyCode===In.DELETE&&Pe(n,!0)&&e.preventDefault()})},Ct=Pe,bt=function(n){return{backspaceDelete:function(e){Ct(n,e)}}},Lt=function(t){t.on("BeforeExecCommand",function(e){var n=e.command.toLowerCase();"indent"===n?he(t):"outdent"===n&&ye(t)}),t.addCommand("InsertUnorderedList",function(e,n){yt.toggleList(t,"UL",n)}),t.addCommand("InsertOrderedList",function(e,n){yt.toggleList(t,"OL",n)}),t.addCommand("InsertDefinitionList",function(e,n){yt.toggleList(t,"DL",n)}),t.addCommand("RemoveList",function(){Ne(t)}),t.addQueryStateHandler("InsertUnorderedList",Me(t,"UL")),t.addQueryStateHandler("InsertOrderedList",Me(t,"OL")),t.addQueryStateHandler("InsertDefinitionList",Me(t,"DL"))},Tt=function(e){return e.getParam("lists_indent_on_tab",!0)},Et=function(e){Tt(e)&&function(n){n.on("keydown",function(e){e.keyCode!==In.TAB||In.metaKeyPressed(e)||n.undoManager.transact(function(){(e.shiftKey?ye(n):he(n))&&e.preventDefault()})})}(e),Ot(e)},Dt=function(n){function e(e){return function(){return n.execCommand(e)}}var t,r,o;r="advlist",o=(t=n).settings.plugins?t.settings.plugins:"",-1===Fn.inArray(o.split(/[ ,]/),r)&&(n.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:e("InsertOrderedList"),onSetup:Ue(n,"OL")}),n.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:e("InsertUnorderedList"),onSetup:Ue(n,"UL")}))};!function wt(){i.add("lists",function(e){return Et(e),Dt(e),Lt(e),bt(e)})}()}(window);
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
|
-
!function(){"use strict";var e,t,r,n,a,i=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=function(){return(c=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},o=function(e){return function(){return e}},u=o(!1),s=o(!0),l=u,m=s,d=function(){return f},f=(n={fold:function(e,t){return e()},is:l,isSome:l,isNone:m,getOr:r=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:r,orThunk:t,map:d,ap:d,each:function(){},bind:d,flatten:d,exists:l,forall:m,filter:d,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:o("none()")},Object.freeze&&Object.freeze(n),n),h=function(r){var e=function(){return r},t=function(){return i},n=function(e){return e(r)},i={fold:function(e,t){return t(r)},is:function(e){return r===e},isSome:m,isNone:l,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return h(e(r))},ap:function(e){return e.fold(d,function(e){return h(e(r))})},each:function(e){e(r)},bind:n,flatten:e,exists:n,forall:n,filter:function(e){return e(r)?i:f},equals:function(e){return e.is(r)},equals_:function(e,t){return e.fold(l,function(e){return t(r,e)})},toArray:function(){return[r]},toString:function(){return"some("+r+")"}};return i},p=d,g=function(e){return null===e||e===undefined?f:h(e)},v=function(t){return function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(e)===t}},w=v("string"),b=v("array"),y=v("function"),x=Array.prototype.slice,j=function(e,t){for(var r=0,n=e.length;r<n;r++){t(e[r],r,e)}},O=Array.prototype.push,A=(y(Array.from)&&Array.from,function(e){var t=e,r=function(){return t};return{get:r,set:function(e){t=e},clone:function(){return A(r())}}}),S=Object.prototype.hasOwnProperty,_=(a=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},n=0;n<e.length;n++){var i=e[n];for(var o in i)S.call(i,o)&&(r[o]=a(r[o],i[o]))}return r}),C=Object.hasOwnProperty,M=function(e,t){return F(e,t)?g(e[t]):p()},F=function(e,t){return C.call(e,t)},P=function(e){return e.getParam("media_scripts")},k=function(e){return e.getParam("audio_template_callback")},T=function(e){return e.getParam("video_template_callback")},$=function(e){return e.getParam("media_live_embeds",!0)},z=function(e){return e.getParam("media_filter_html",!0)},D=function(e){return e.getParam("media_url_resolver")},E=function(e){return e.getParam("media_alt_source",!0)},N=function(e){return e.getParam("media_poster",!0)},U=function(e){return e.getParam("media_dimensions",!0)},R=tinymce.util.Tools.resolve("tinymce.util.Tools"),L=tinymce.util.Tools.resolve("tinymce.html.SaxParser"),W=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),H=function(t){return function(e){return e?e.style[t].replace(/px$/,""):""}},I=function(n){return function(e,t){var r;e&&(e.style[n]=/^[0-9.]+$/.test(r=t)?r+"px":r)}},q={getMaxWidth:H("maxWidth"),getMaxHeight:H("maxHeight"),setMaxWidth:I("maxWidth"),setMaxHeight:I("maxHeight")},B=function(e,t){if(e)for(var r=0;r<e.length;r++)if(-1!==t.indexOf(e[r].filter))return e[r]},G=W.DOM,J=function(e){return G.getAttrib(e,"data-ephox-embed-iri")},K=function(e,t){return c=t,u=G.createFragment(c),""!==J(u.firstChild)?(o=t,a=G.createFragment(o).firstChild,{type:"ephox-embed-iri",source1:J(a),source2:"",poster:"",width:q.getMaxWidth(a),height:q.getMaxHeight(a)}):(n=e,r=t,L({validate:!(i={}),allow_conditional_comments:!0,start:function(e,t){if(i.source1||"param"!==e||(i.source1=t.map.movie),"iframe"!==e&&"object"!==e&&"embed"!==e&&"video"!==e&&"audio"!==e||(i.type||(i.type=e),i=R.extend(t.map,i)),"script"===e){var r=B(n,t.map.src);if(!r)return;i={type:"script",source1:t.map.src,width:String(r.width),height:String(r.height)}}"source"===e&&(i.source1?i.source2||(i.source2=t.map.src):i.source1=t.map.src),"img"!==e||i.poster||(i.poster=t.map.src)}}).parse(r),i.source1=i.source1||i.src||i.data,i.source2=i.source2||"",i.poster=i.poster||"",i);var n,r,i,o,a,c,u},Q=tinymce.util.Tools.resolve("tinymce.util.Promise"),V=function(e){var t={mp3:"audio/mpeg",m4a:"audio/x-m4a",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"}[e.toLowerCase().split(".").pop()];return t||""},X=tinymce.util.Tools.resolve("tinymce.html.Writer"),Y=tinymce.util.Tools.resolve("tinymce.html.Schema"),Z=W.DOM,ee=function(e,t){var r,n,i,o;for(r in t)if(i=""+t[r],e.map[r])for(n=e.length;n--;)(o=e[n]).name===r&&(i?(e.map[r]=i,o.value=i):(delete e.map[r],e.splice(n,1)));else i&&(e.push({name:r,value:i}),e.map[r]=i)},te=function(e,t){var r,n,i=Z.createFragment(e).firstChild;return q.setMaxWidth(i,t.width),q.setMaxHeight(i,t.height),r=i.outerHTML,n=X(),L(n).parse(r),n.getContent()},re=function(e,t,r){return s=e,l=Z.createFragment(s),""!==Z.getAttrib(l.firstChild,"data-ephox-embed-iri")?te(e,t):(n=e,i=t,o=r,c=X(),L({validate:!1,allow_conditional_comments:!(u=0),comment:function(e){c.comment(e)},cdata:function(e){c.cdata(e)},text:function(e,t){c.text(e,t)},start:function(e,t,r){switch(e){case"video":case"object":case"embed":case"img":case"iframe":i.height!==undefined&&i.width!==undefined&&ee(t,{width:i.width,height:i.height})}if(o)switch(e){case"video":ee(t,{poster:i.poster,src:""}),i.source2&&ee(t,{src:""});break;case"iframe":ee(t,{src:i.source1});break;case"source":if(++u<=2&&(ee(t,{src:i["source"+u],type:i["source"+u+"mime"]}),!i["source"+u]))return;break;case"img":if(!i.poster)return;a=!0}c.start(e,t,r)},end:function(e){if("video"===e&&o)for(var t=1;t<=2;t++)if(i["source"+t]){var r=[];r.map={},u<t&&(ee(r,{src:i["source"+t],type:i["source"+t+"mime"]}),c.start("source",r,!0))}if(i.poster&&"object"===e&&o&&!a){var n=[];n.map={},ee(n,{src:i.poster,width:i.width,height:i.height}),c.start("img",n,!0)}c.end(e)}},Y({})).parse(n),c.getContent());var n,i,o,a,c,u,s,l},ne=[{regex:/youtu\.be\/([\w\-_\?&=.]+)/i,type:"iframe",w:560,h:314,url:"//www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?/i,type:"iframe",w:560,h:314,url:"//www.youtube.com/embed/$2?$4",allowFullscreen:!0},{regex:/youtube.com\/embed\/([a-z0-9\?&=\-_]+)/i,type:"iframe",w:560,h:314,url:"//www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc",allowFullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$2?title=0&byline=0",allowFullscreen:!0},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'//maps.google.com/maps/ms?msid=$2&output=embed"',allowFullscreen:!1},{regex:/dailymotion\.com\/video\/([^_]+)/,type:"iframe",w:480,h:270,url:"//www.dailymotion.com/embed/video/$1",allowFullscreen:!0},{regex:/dai\.ly\/([^_]+)/,type:"iframe",w:480,h:270,url:"//www.dailymotion.com/embed/video/$1",allowFullscreen:!0}],ie=function(r,e){var n=R.extend({},e);if(!n.source1&&(R.extend(n,K(P(r),n.embed)),!n.source1))return"";n.source2||(n.source2=""),n.poster||(n.poster=""),n.source1=r.convertURL(n.source1,"source"),n.source2=r.convertURL(n.source2,"source"),n.source1mime=V(n.source1),n.source2mime=V(n.source2),n.poster=r.convertURL(n.poster,"poster");var t,i,o=(t=n.source1,0<(i=ne.filter(function(e){return e.regex.test(t)})).length?R.extend({},i[0],{url:function(e,t){for(var r=e.regex.exec(t),n=e.url,i=function(e){n=n.replace("$"+e,function(){return r[e]?r[e]:""})},o=0;o<r.length;o++)i(o);return n.replace(/\?$/,"")}(i[0],t)}):null);if(o&&(n.source1=o.url,n.type=o.type,n.allowFullscreen=o.allowFullscreen,n.width=n.width||String(o.w),n.height=n.height||String(o.h)),n.embed)return re(n.embed,n,!0);var a=B(P(r),n.source1);a&&(n.type="script",n.width=String(a.width),n.height=String(a.height));var c,u,s,l,m,d,f,h,p=k(r),g=T(r);return n.width=n.width||"300",n.height=n.height||"150",R.each(n,function(e,t){n[t]=r.dom.encode(""+e)}),"iframe"===n.type?(h=(f=n).allowFullscreen?' allowFullscreen="1"':"",'<iframe src="'+f.source1+'" width="'+f.width+'" height="'+f.height+'"'+h+"></iframe>"):"application/x-shockwave-flash"===n.source1mime?(d='<object data="'+(m=n).source1+'" width="'+m.width+'" height="'+m.height+'" type="application/x-shockwave-flash">',m.poster&&(d+='<img src="'+m.poster+'" width="'+m.width+'" height="'+m.height+'" />'),d+="</object>"):-1!==n.source1mime.indexOf("audio")?(s=n,(l=p)?l(s):'<audio controls="controls" src="'+s.source1+'">'+(s.source2?'\n<source src="'+s.source2+'"'+(s.source2mime?' type="'+s.source2mime+'"':"")+" />\n":"")+"</audio>"):"script"===n.type?'<script src="'+n.source1+'"><\/script>':(c=n,(u=g)?u(c):'<video width="'+c.width+'" height="'+c.height+'"'+(c.poster?' poster="'+c.poster+'"':"")+' controls="controls">\n<source src="'+c.source1+'"'+(c.source1mime?' type="'+c.source1mime+'"':"")+" />\n"+(c.source2?'<source src="'+c.source2+'"'+(c.source2mime?' type="'+c.source2mime+'"':"")+" />\n":"")+"</video>")},oe={},ae=function(t){return function(e){return ie(t,e)}},ce=function(e,t){var r,n,i,o,a,c=D(e);return c?(i=t,o=ae(e),a=c,new Q(function(t,e){var r=function(e){return e.html&&(oe[i.source1]=e),t({url:i.source1,html:e.html?e.html:o(i)})};oe[i.source1]?r(oe[i.source1]):a({url:i.source1},r,e)})):(r=t,n=ae(e),new Q(function(e){e({html:n(r),url:r.source1})}))},ue=function(e){return oe.hasOwnProperty(e)},se=function(e){var r=_(e,{source1:e.source1.value,source2:M(e,"source2").bind(function(e){return M(e,"value")}).getOr(""),poster:M(e,"poster").bind(function(e){return M(e,"value")}).getOr("")});return M(e,"dimensions").each(function(e){j(["width","height"],function(t){M(e,t).each(function(e){return r[t]=e})})}),r},le=function(e){var n=_(e,{source1:{value:M(e,"source1").getOr("")},source2:{value:M(e,"source2").getOr("")},poster:{value:M(e,"poster").getOr("")}});return j(["width","height"],function(r){M(e,r).each(function(e){var t=n.dimensions||{};t[r]=e,n.dimensions=t})}),n},me=function(r){return function(e){var t=e&&e.msg?"Media embed handler error: "+e.msg:"Media embed handler threw unknown error.";r.notificationManager.open({type:"error",text:t})}},de=function(e,t){return K(P(e),t)},fe=function(i,o){return function(e){if(w(e.url)&&0<e.url.trim().length){var t=e.html,r=de(o,t),n=c({},r,{source1:e.url,embed:t});i.setData(le(n))}}},he=function(e,t){var r=e.dom.select("img[data-mce-object]");e.insertContent(t),function(e,t){for(var r=e.dom.select("img[data-mce-object]"),n=0;n<t.length;n++)for(var i=r.length-1;0<=i;i--)t[n]===r[i]&&r.splice(i,1);e.selection.select(r[0])}(e,r),e.nodeChanged()},pe=function(c){var e,t,r,n,i=(r=(e=c).selection.getNode(),n=(t=r).getAttribute("data-mce-object")||t.getAttribute("data-ephox-embed-iri")?e.serializer.serialize(r,{selection:!0}):"",_({embed:n},K(P(e),n))),u=A(i),o=le(i),s=function(e){return se(e.getData())},a={title:"General",name:"general",items:function(e){for(var t=[],r=0,n=e.length;r<n;++r){if(!b(e[r]))throw new Error("Arr.flatten item "+r+" was not an array, input: "+e);O.apply(t,e[r])}return t}([[{name:"source1",type:"urlinput",filetype:"media",label:"Source"}],U(c)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[]])},l={title:"Embed",items:[{type:"textarea",name:"embed",label:"Paste your embed code below:"}]},m=[];E(c)&&m.push({name:"source2",type:"urlinput",filetype:"media",label:"Alternative source URL"}),N(c)&&m.push({name:"poster",type:"urlinput",filetype:"image",label:"Media poster (Image URL)"});var d={title:"Advanced",name:"advanced",items:m},f=[a,l];0<m.length&&f.push(d);var h={type:"tabpanel",tabs:f},p=c.windowManager.open({title:"Insert/Edit Media",size:"normal",body:h,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(e){var t,r,n,i=s(e);t=u.get(),n=c,(r=i).embed=re(r.embed,r),r.embed&&(t.source1===r.source1||ue(r.source1))?he(n,r.embed):ce(n,r).then(function(e){he(n,e.html)})["catch"](me(n)),e.close()},onChange:function(e,t){switch(t.name){case"source1":o=u.get(),a=s(e),o.source1!==a.source1&&(fe(p,c)({url:a.source1,html:""}),ce(c,a).then(fe(p,c))["catch"](me(c)));break;case"embed":n=se((r=e).getData()),i=de(c,n.embed),r.setData(le(i))}var r,n,i,o,a;u.set(s(e))},initialData:o})},ge=function(e){return{showDialog:function(){pe(e)}}},ve=function(e){e.addCommand("mceMedia",function(){pe(e)})},we=tinymce.util.Tools.resolve("tinymce.html.Node"),be=tinymce.util.Tools.resolve("tinymce.Env"),ye=function(i,e){if(!1===z(i))return e;var o,a=X();return L({validate:!1,allow_conditional_comments:!1,comment:function(e){a.comment(e)},cdata:function(e){a.cdata(e)},text:function(e,t){a.text(e,t)},start:function(e,t,r){if(o=!0,"script"!==e&&"noscript"!==e){for(var n=0;n<t.length;n++){if(0===t[n].name.indexOf("on"))return;"style"===t[n].name&&(t[n].value=i.dom.serializeStyle(i.dom.parseStyle(t[n].value),e))}a.start(e,t,r),o=!1}},end:function(e){o||a.end(e)}},Y({})).parse(e),a.getContent()},xe=function(e,t){var r,n=t.name;return(r=new we("img",1)).shortEnded=!0,Oe(e,t,r),r.attr({width:t.attr("width")||"300",height:t.attr("height")||("audio"===n?"30":"150"),style:t.attr("style"),src:be.transparentSrc,"data-mce-object":n,"class":"mce-object mce-object-"+n}),r},je=function(e,t){var r,n,i,o=t.name;return(r=new we("span",1)).attr({contentEditable:"false",style:t.attr("style"),"data-mce-object":o,"class":"mce-preview-object mce-object-"+o}),Oe(e,t,r),(n=new we(o,1)).attr({src:t.attr("src"),allowfullscreen:t.attr("allowfullscreen"),style:t.attr("style"),"class":t.attr("class"),width:t.attr("width"),height:t.attr("height"),frameborder:"0"}),(i=new we("span",1)).attr("class","mce-shim"),r.append(n),r.append(i),r},Oe=function(e,t,r){var n,i,o,a,c;for(a=(o=t.attributes).length;a--;)n=o[a].name,i=o[a].value,"width"!==n&&"height"!==n&&"style"!==n&&("data"!==n&&"src"!==n||(i=e.convertURL(i,n)),r.attr("data-mce-p-"+n,i));(c=t.firstChild&&t.firstChild.value)&&(r.attr("data-mce-html",escape(ye(e,c))),r.firstChild=null)},Ae=function(e){for(;e=e.parent;)if(e.attr("data-ephox-embed-iri")||(void 0,(t=e.attr("class"))&&/\btiny-pageembed\b/.test(t)))return!0;var t;return!1},Se=function(i){return function(e){for(var t,r,n=e.length;n--;)(t=e[n]).parent&&(t.parent.attr("data-mce-object")||("script"!==t.name||(r=B(P(i),t.attr("src"))))&&(r&&(r.width&&t.attr("width",r.width.toString()),r.height&&t.attr("height",r.height.toString())),"iframe"===t.name&&$(i)&&be.ceFalse?Ae(t)||t.replace(je(i,t)):Ae(t)||t.replace(xe(i,t))))}},_e=function(d){d.on("preInit",function(){var t=d.schema.getSpecialElements();R.each("video audio iframe object".split(" "),function(e){t[e]=new RegExp("</"+e+"[^>]*>","gi")});var r=d.schema.getBoolAttrs();R.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),function(e){r[e]={}}),d.parser.addNodeFilter("iframe,video,audio,object,embed,script",Se(d)),d.serializer.addAttributeFilter("data-mce-object",function(e,t){for(var r,n,i,o,a,c,u,s,l=e.length;l--;)if((r=e[l]).parent){for(u=r.attr(t),n=new we(u,1),"audio"!==u&&"script"!==u&&((s=r.attr("class"))&&-1!==s.indexOf("mce-preview-object")?n.attr({width:r.firstChild.attr("width"),height:r.firstChild.attr("height")}):n.attr({width:r.attr("width"),height:r.attr("height")})),n.attr({style:r.attr("style")}),i=(o=r.attributes).length;i--;){var m=o[i].name;0===m.indexOf("data-mce-p-")&&n.attr(m.substr(11),o[i].value)}"script"===u&&n.attr("type","text/javascript"),(a=r.attr("data-mce-html"))&&((c=new we("#text",3)).raw=!0,c.value=ye(d,unescape(a)),n.append(c)),r.replace(n)}})}),d.on("SetContent",function(){d.$("span.mce-preview-object").each(function(e,t){var r=d.$(t);0===r.find("span.mce-shim").length&&r.append('<span class="mce-shim"></span>')})})},Ce=function(e){e.on("ResolveName",function(e){var t;1===e.target.nodeType&&(t=e.target.getAttribute("data-mce-object"))&&(e.name=t)})},Me=function(t){t.on("click keyup",function(){var e=t.selection.getNode();e&&t.dom.hasClass(e,"mce-preview-object")&&t.dom.getAttrib(e,"data-mce-selected")&&e.setAttribute("data-mce-selected","2")}),t.on("ObjectSelected",function(e){var t=e.target.getAttribute("data-mce-object");"audio"!==t&&"script"!==t||e.preventDefault()}),t.on("ObjectResized",function(e){var t,r=e.target;r.getAttribute("data-mce-object")&&(t=r.getAttribute("data-mce-html"))&&(t=unescape(t),r.setAttribute("data-mce-html",escape(re(t,{width:String(e.width),height:String(e.height)}))))})},Fe=function(e){var t,r;e.ui.registry.addToggleButton("media",{tooltip:"Insert/edit media",icon:"embed",onAction:function(){e.execCommand("mceMedia")},onSetup:(t=e,r=["img[data-mce-object]","span[data-mce-object]","div[data-ephox-embed-iri]"],function(e){return t.selection.selectorChangedWithUnbind(r.join(","),e.setActive).unbind})}),e.ui.registry.addMenuItem("media",{icon:"embed",text:"Media...",onAction:function(){e.execCommand("mceMedia")}})};!function Pe(){i.add("media",function(e){return ve(e),Fe(e),Ce(e),_e(e),Me(e),ge(e)})}()}();
|
9
|
+
!function(){"use strict";function e(){}function o(e){return function(){return e}}function t(){return u}var r,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),d=function(){return(d=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},a=o(!1),c=o(!0),u=(r={fold:function(e,t){return e()},is:a,isSome:a,isNone:c,getOr:l,getOrThunk:s,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:o(null),getOrUndefined:o(undefined),or:l,orThunk:s,map:t,each:e,bind:t,exists:a,forall:c,filter:t,equals:i,equals_:i,toArray:function(){return[]},toString:o("none()")},Object.freeze&&Object.freeze(r),r);function i(e){return e.isNone()}function s(e){return e()}function l(e){return e}function m(t){return function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"==t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(e)===t}}function f(e,t){for(var r=0,n=e.length;r<n;r++){t(e[r],r)}}function h(e,t){return G(e,t)?E(e[t]):D()}function p(t){return function(e){return e?function(e){return e.replace(/px$/,"")}(e.style[t]):""}}function g(r){return function(e,t){e&&(e.style[r]=function(e){return/^[0-9.]+$/.test(e)?e+"px":e}(t))}}function v(e,t){if(e)for(var r=0;r<e.length;r++)if(-1!==t.indexOf(e[r].filter))return e[r]}function b(e){return ae.getAttrib(e,"data-ephox-embed-iri")}function w(e,t){return function(e){var t=ae.createFragment(e);return""!==b(t.firstChild)}(t)?function(e){var t=ae.createFragment(e).firstChild;return{type:"ephox-embed-iri",source1:b(t),source2:"",poster:"",width:oe.getMaxWidth(t),height:oe.getMaxHeight(t)}}(t):function(n,e){var i={};return ne({validate:!1,allow_conditional_comments:!0,start:function(e,t){if(i.source1||"param"!==e||(i.source1=t.map.movie),"iframe"!==e&&"object"!==e&&"embed"!==e&&"video"!==e&&"audio"!==e||(i.type||(i.type=e),i=re.extend(t.map,i)),"script"===e){var r=v(n,t.map.src);if(!r)return;i={type:"script",source1:t.map.src,width:String(r.width),height:String(r.height)}}"source"===e&&(i.source1?i.source2||(i.source2=t.map.src):i.source1=t.map.src),"img"!==e||i.poster||(i.poster=t.map.src)}}).parse(e),i.source1=i.source1||i.src||i.data,i.source2=i.source2||"",i.poster=i.poster||"",i}(e,t)}function y(e,t){var r,n,i,o;for(r in t)if(i=""+t[r],e.map[r])for(n=e.length;n--;)(o=e[n]).name===r&&(i?(e.map[r]=i,o.value=i):(delete e.map[r],e.splice(n,1)));else i&&(e.push({name:r,value:i}),e.map[r]=i)}function x(e,t){var r=me.createFragment(e).firstChild;return oe.setMaxWidth(r,t.width),oe.setMaxHeight(r,t.height),function(e){var t=se();return ne(t).parse(e),t.getContent()}(r.outerHTML)}function j(r,e){var n=re.extend({},e);if(!n.source1&&(re.extend(n,w(J(r),n.embed)),!n.source1))return"";n.source2||(n.source2=""),n.poster||(n.poster=""),n.source1=r.convertURL(n.source1,"source"),n.source2=r.convertURL(n.source2,"source"),n.source1mime=ue(n.source1),n.source2mime=ue(n.source2),n.poster=r.convertURL(n.poster,"poster");var t=function(t){var e=fe.filter(function(e){return e.regex.test(t)});return 0<e.length?re.extend({},e[0],{url:function(e,t){for(var r=e.regex.exec(t),n=e.url,i=function(e){n=n.replace("$"+e,function(){return r[e]?r[e]:""})},o=0;o<r.length;o++)i(o);return n.replace(/\?$/,"")}(e[0],t)}):null}(n.source1);if(t&&(n.source1=t.url,n.type=t.type,n.allowFullscreen=t.allowFullscreen,n.width=n.width||String(t.w),n.height=n.height||String(t.h)),n.embed)return de(n.embed,n,!0);var i=v(J(r),n.source1);i&&(n.type="script",n.width=String(i.width),n.height=String(i.height));var o=K(r),a=Q(r);return n.width=n.width||"300",n.height=n.height||"150",re.each(n,function(e,t){n[t]=r.dom.encode(""+e)}),"iframe"===n.type?function(e){var t=e.allowFullscreen?' allowFullscreen="1"':"";return'<iframe src="'+e.source1+'" width="'+e.width+'" height="'+e.height+'"'+t+"></iframe>"}(n):"application/x-shockwave-flash"===n.source1mime?function(e){var t='<object data="'+e.source1+'" width="'+e.width+'" height="'+e.height+'" type="application/x-shockwave-flash">';return e.poster&&(t+='<img src="'+e.poster+'" width="'+e.width+'" height="'+e.height+'" />'),t+="</object>"}(n):-1!==n.source1mime.indexOf("audio")?function(e,t){return t?t(e):'<audio controls="controls" src="'+e.source1+'">'+(e.source2?'\n<source src="'+e.source2+'"'+(e.source2mime?' type="'+e.source2mime+'"':"")+" />\n":"")+"</audio>"}(n,o):"script"===n.type?function(e){return'<script src="'+e.source1+'"><\/script>'}(n):function(e,t){return t?t(e):'<video width="'+e.width+'" height="'+e.height+'"'+(e.poster?' poster="'+e.poster+'"':"")+' controls="controls">\n<source src="'+e.source1+'"'+(e.source1mime?' type="'+e.source1mime+'"':"")+" />\n"+(e.source2?'<source src="'+e.source2+'"'+(e.source2mime?' type="'+e.source2mime+'"':"")+" />\n":"")+"</video>"}(n,a)}function O(t){return function(e){return j(t,e)}}function A(e){var r=q(e,{source1:e.source1.value,source2:h(e,"source2").bind(function(e){return h(e,"value")}).getOr(""),poster:h(e,"poster").bind(function(e){return h(e,"value")}).getOr("")});return h(e,"dimensions").each(function(e){f(["width","height"],function(t){h(e,t).each(function(e){return r[t]=e})})}),r}function S(e){var n=q(e,{source1:{value:h(e,"source1").getOr("")},source2:{value:h(e,"source2").getOr("")},poster:{value:h(e,"poster").getOr("")}});return f(["width","height"],function(r){h(e,r).each(function(e){var t=n.dimensions||{};t[r]=e,n.dimensions=t})}),n}function _(r){return function(e){var t=e&&e.msg?"Media embed handler error: "+e.msg:"Media embed handler threw unknown error.";r.notificationManager.open({type:"error",text:t})}}function C(e,t){return w(J(e),t)}function M(i,o){return function(e){if(N(e.url)&&0<e.url.trim().length){var t=e.html,r=C(o,t),n=d(d({},r),{source1:e.url,embed:t});i.setData(S(n))}}}function F(e,t){var r=e.dom.select("img[data-mce-object]");e.insertContent(t),function(e,t){for(var r=e.dom.select("img[data-mce-object]"),n=0;n<t.length;n++)for(var i=r.length-1;0<=i;i--)t[n]===r[i]&&r.splice(i,1);e.selection.select(r[0])}(e,r),e.nodeChanged()}function P(e,t){var r,n=t.name;return(r=new ye("img",1)).shortEnded=!0,Oe(e,t,r),r.attr({width:t.attr("width")||"300",height:t.attr("height")||("audio"===n?"30":"150"),style:t.attr("style"),src:xe.transparentSrc,"data-mce-object":n,"class":"mce-object mce-object-"+n}),r}function k(e,t){var r,n,i,o=t.name;return(r=new ye("span",1)).attr({contentEditable:"false",style:t.attr("style"),"data-mce-object":o,"class":"mce-preview-object mce-object-"+o}),Oe(e,t,r),(n=new ye(o,1)).attr({src:t.attr("src"),allowfullscreen:t.attr("allowfullscreen"),style:t.attr("style"),"class":t.attr("class"),width:t.attr("width"),height:t.attr("height"),frameborder:"0"}),(i=new ye("span",1)).attr("class","mce-shim"),r.append(n),r.append(i),r}function T(e){for(;e=e.parent;)if(e.attr("data-ephox-embed-iri")||(void 0,(t=e.attr("class"))&&/\btiny-pageembed\b/.test(t)))return!0;var t;return!1}var $,z=function(r){function e(){return i}function t(e){return e(r)}var n=o(r),i={fold:function(e,t){return t(r)},is:function(e){return r===e},isSome:c,isNone:a,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:e,orThunk:e,map:function(e){return z(e(r))},each:function(e){e(r)},bind:t,exists:t,forall:t,filter:function(e){return e(r)?i:u},toArray:function(){return[r]},toString:function(){return"some("+r+")"},equals:function(e){return e.is(r)},equals_:function(e,t){return e.fold(a,function(e){return t(r,e)})}};return i},D=t,E=function(e){return null===e||e===undefined?u:z(e)},N=m("string"),U=m("array"),R=m("function"),L=Array.prototype.slice,W=Array.prototype.push,H=(R(Array.from)&&Array.from,function(e){function t(){return r}var r=e;return{get:t,set:function(e){r=e},clone:function(){return H(t())}}}),I=Object.prototype.hasOwnProperty,q=($=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},n=0;n<e.length;n++){var i=e[n];for(var o in i)I.call(i,o)&&(r[o]=$(r[o],i[o]))}return r}),B=Object.hasOwnProperty,G=function(e,t){return B.call(e,t)},J=function(e){return e.getParam("media_scripts")},K=function(e){return e.getParam("audio_template_callback")},Q=function(e){return e.getParam("video_template_callback")},V=function(e){return e.getParam("media_live_embeds",!0)},X=function(e){return e.getParam("media_filter_html",!0)},Y=function(e){return e.getParam("media_url_resolver")},Z=function(e){return e.getParam("media_alt_source",!0)},ee=function(e){return e.getParam("media_poster",!0)},te=function(e){return e.getParam("media_dimensions",!0)},re=tinymce.util.Tools.resolve("tinymce.util.Tools"),ne=tinymce.util.Tools.resolve("tinymce.html.SaxParser"),ie=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),oe={getMaxWidth:p("maxWidth"),getMaxHeight:p("maxHeight"),setMaxWidth:g("maxWidth"),setMaxHeight:g("maxHeight")},ae=ie.DOM,ce=tinymce.util.Tools.resolve("tinymce.util.Promise"),ue=function(e){var t={mp3:"audio/mpeg",m4a:"audio/x-m4a",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"}[e.toLowerCase().split(".").pop()];return t||""},se=tinymce.util.Tools.resolve("tinymce.html.Writer"),le=tinymce.util.Tools.resolve("tinymce.html.Schema"),me=ie.DOM,de=function(e,t,r){return function(e){var t=me.createFragment(e);return""!==me.getAttrib(t.firstChild,"data-ephox-embed-iri")}(e)?x(e,t):function(e,i,o){var a,c=se(),u=0;return ne({validate:!1,allow_conditional_comments:!0,comment:function(e){c.comment(e)},cdata:function(e){c.cdata(e)},text:function(e,t){c.text(e,t)},start:function(e,t,r){switch(e){case"video":case"object":case"embed":case"img":case"iframe":i.height!==undefined&&i.width!==undefined&&y(t,{width:i.width,height:i.height})}if(o)switch(e){case"video":y(t,{poster:i.poster,src:""}),i.source2&&y(t,{src:""});break;case"iframe":y(t,{src:i.source1});break;case"source":if(++u<=2&&(y(t,{src:i["source"+u],type:i["source"+u+"mime"]}),!i["source"+u]))return;break;case"img":if(!i.poster)return;a=!0}c.start(e,t,r)},end:function(e){if("video"===e&&o)for(var t=1;t<=2;t++)if(i["source"+t]){var r=[];r.map={},u<t&&(y(r,{src:i["source"+t],type:i["source"+t+"mime"]}),c.start("source",r,!0))}if(i.poster&&"object"===e&&o&&!a){var n=[];n.map={},y(n,{src:i.poster,width:i.width,height:i.height}),c.start("img",n,!0)}c.end(e)}},le({})).parse(e),c.getContent()}(e,t,r)},fe=[{regex:/youtu\.be\/([\w\-_\?&=.]+)/i,type:"iframe",w:560,h:314,url:"//www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?/i,type:"iframe",w:560,h:314,url:"//www.youtube.com/embed/$2?$4",allowFullscreen:!0},{regex:/youtube.com\/embed\/([a-z0-9\?&=\-_]+)/i,type:"iframe",w:560,h:314,url:"//www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc",allowFullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$2?title=0&byline=0",allowFullscreen:!0},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'//maps.google.com/maps/ms?msid=$2&output=embed"',allowFullscreen:!1},{regex:/dailymotion\.com\/video\/([^_]+)/,type:"iframe",w:480,h:270,url:"//www.dailymotion.com/embed/video/$1",allowFullscreen:!0},{regex:/dai\.ly\/([^_]+)/,type:"iframe",w:480,h:270,url:"//www.dailymotion.com/embed/video/$1",allowFullscreen:!0}],he={},pe=function(e,t){var r=Y(e);return r?function(n,i,o){return new ce(function(t,e){function r(e){return e.html&&(he[n.source1]=e),t({url:n.source1,html:e.html?e.html:i(n)})}he[n.source1]?r(he[n.source1]):o({url:n.source1},r,e)})}(t,O(e),r):function(t,r){return new ce(function(e){e({html:r(t),url:t.source1})})}(t,O(e))},ge=function(e){return he.hasOwnProperty(e)},ve=function(n){function i(e){return A(e.getData())}var e=function(e){var t=e.selection.getNode(),r=function(e){return e.getAttribute("data-mce-object")||e.getAttribute("data-ephox-embed-iri")}(t)?e.serializer.serialize(t,{selection:!0}):"";return q({embed:r},w(J(e),r))}(n),r=H(e),t=S(e),o={title:"General",name:"general",items:function(e){for(var t=[],r=0,n=e.length;r<n;++r){if(!U(e[r]))throw new Error("Arr.flatten item "+r+" was not an array, input: "+e);W.apply(t,e[r])}return t}([[{name:"source1",type:"urlinput",filetype:"media",label:"Source"}],te(n)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[]])},a={title:"Embed",items:[{type:"textarea",name:"embed",label:"Paste your embed code below:"}]},c=[];Z(n)&&c.push({name:"source2",type:"urlinput",filetype:"media",label:"Alternative source URL"}),ee(n)&&c.push({name:"poster",type:"urlinput",filetype:"image",label:"Media poster (Image URL)"});var u={title:"Advanced",name:"advanced",items:c},s=[o,a];0<c.length&&s.push(u);var l={type:"tabpanel",tabs:s},m=n.windowManager.open({title:"Insert/Edit Media",size:"normal",body:l,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(e){var t=i(e);!function(e,t,r){t.embed=de(t.embed,t),t.embed&&(e.source1===t.source1||ge(t.source1))?F(r,t.embed):pe(r,t).then(function(e){F(r,e.html)})["catch"](_(r))}(r.get(),t,n),e.close()},onChange:function(e,t){switch(t.name){case"source1":!function(e,t){var r=i(t);e.source1!==r.source1&&(M(m,n)({url:r.source1,html:""}),pe(n,r).then(M(m,n))["catch"](_(n)))}(r.get(),e);break;case"embed":!function(e){var t=A(e.getData()),r=C(n,t.embed);e.setData(S(r))}(e);break;case"dimensions":case"poster":!function(e){var t=i(e),r=j(n,t);e.setData(S(d(d({},t),{embed:r})))}(e)}r.set(i(e))},initialData:t})},be=function(e){return{showDialog:function(){ve(e)}}},we=function(e){e.addCommand("mceMedia",function(){ve(e)})},ye=tinymce.util.Tools.resolve("tinymce.html.Node"),xe=tinymce.util.Tools.resolve("tinymce.Env"),je=function(i,e){if(!1===X(i))return e;var o,a=se();return ne({validate:!1,allow_conditional_comments:!1,comment:function(e){a.comment(e)},cdata:function(e){a.cdata(e)},text:function(e,t){a.text(e,t)},start:function(e,t,r){if(o=!0,"script"!==e&&"noscript"!==e){for(var n=0;n<t.length;n++){if(0===t[n].name.indexOf("on"))return;"style"===t[n].name&&(t[n].value=i.dom.serializeStyle(i.dom.parseStyle(t[n].value),e))}a.start(e,t,r),o=!1}},end:function(e){o||a.end(e)}},le({})).parse(e),a.getContent()},Oe=function(e,t,r){var n,i,o,a,c;for(a=(o=t.attributes).length;a--;)n=o[a].name,i=o[a].value,"width"!==n&&"height"!==n&&"style"!==n&&("data"!==n&&"src"!==n||(i=e.convertURL(i,n)),r.attr("data-mce-p-"+n,i));(c=t.firstChild&&t.firstChild.value)&&(r.attr("data-mce-html",escape(je(e,c))),r.firstChild=null)},Ae=function(i){return function(e){for(var t,r,n=e.length;n--;)(t=e[n]).parent&&(t.parent.attr("data-mce-object")||"script"===t.name&&!(r=v(J(i),t.attr("src")))||(r&&(r.width&&t.attr("width",r.width.toString()),r.height&&t.attr("height",r.height.toString())),"iframe"===t.name&&V(i)&&xe.ceFalse?T(t)||t.replace(k(i,t)):T(t)||t.replace(P(i,t))))}},Se=function(d){d.on("preInit",function(){var t=d.schema.getSpecialElements();re.each("video audio iframe object".split(" "),function(e){t[e]=new RegExp("</"+e+"[^>]*>","gi")});var r=d.schema.getBoolAttrs();re.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),function(e){r[e]={}}),d.parser.addNodeFilter("iframe,video,audio,object,embed,script",Ae(d)),d.serializer.addAttributeFilter("data-mce-object",function(e,t){for(var r,n,i,o,a,c,u,s,l=e.length;l--;)if((r=e[l]).parent){for(u=r.attr(t),n=new ye(u,1),"audio"!==u&&"script"!==u&&((s=r.attr("class"))&&-1!==s.indexOf("mce-preview-object")?n.attr({width:r.firstChild.attr("width"),height:r.firstChild.attr("height")}):n.attr({width:r.attr("width"),height:r.attr("height")})),n.attr({style:r.attr("style")}),i=(o=r.attributes).length;i--;){var m=o[i].name;0===m.indexOf("data-mce-p-")&&n.attr(m.substr(11),o[i].value)}"script"===u&&n.attr("type","text/javascript"),(a=r.attr("data-mce-html"))&&((c=new ye("#text",3)).raw=!0,c.value=je(d,unescape(a)),n.append(c)),r.replace(n)}})}),d.on("SetContent",function(){d.$("span.mce-preview-object").each(function(e,t){var r=d.$(t);0===r.find("span.mce-shim").length&&r.append('<span class="mce-shim"></span>')})})},_e=function(e){e.on("ResolveName",function(e){var t;1===e.target.nodeType&&(t=e.target.getAttribute("data-mce-object"))&&(e.name=t)})},Ce=function(t){t.on("click keyup",function(){var e=t.selection.getNode();e&&t.dom.hasClass(e,"mce-preview-object")&&t.dom.getAttrib(e,"data-mce-selected")&&e.setAttribute("data-mce-selected","2")}),t.on("ObjectSelected",function(e){var t=e.target.getAttribute("data-mce-object");"audio"!==t&&"script"!==t||e.preventDefault()}),t.on("ObjectResized",function(e){var t,r=e.target;r.getAttribute("data-mce-object")&&(t=r.getAttribute("data-mce-html"))&&(t=unescape(t),r.setAttribute("data-mce-html",escape(de(t,{width:String(e.width),height:String(e.height)}))))})},Me=function(e){e.ui.registry.addToggleButton("media",{tooltip:"Insert/edit media",icon:"embed",onAction:function(){e.execCommand("mceMedia")},onSetup:function(t,r){return function(e){return t.selection.selectorChangedWithUnbind(r.join(","),e.setActive).unbind}}(e,["img[data-mce-object]","span[data-mce-object]","div[data-ephox-embed-iri]"])}),e.ui.registry.addMenuItem("media",{icon:"embed",text:"Media...",onAction:function(){e.execCommand("mceMedia")}})};!function Fe(){n.add("media",function(e){return we(e),Me(e),_e(e),Se(e),Ce(e),be(e)})}()}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
|
-
!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),
|
9
|
+
!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,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
|
-
!function(){"use strict";
|
9
|
+
!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,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
|
-
!function(){"use strict";
|
9
|
+
!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,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
|
-
!function(h){"use strict";var t,e,n,r,o,i,a,u,f,p=function(t){var e=t,n=function(){return e};return{get:n,set:function(t){e=t},clone:function(){return p(n())}}},s=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=function(t){return!(!/(^|[ ,])powerpaste([, ]|$)/.test(t.settings.plugins)||!s.get("powerpaste")||("undefined"!=typeof h.window.console&&h.window.console.log&&h.window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),0))},l=function(t,e){return{clipboard:t,quirks:e}},d=function(t,e,n,r){return t.fire("PastePreProcess",{content:e,internal:n,wordContent:r})},m=function(t,e,n,r){return t.fire("PastePostProcess",{node:e,internal:n,wordContent:r})},g=function(t,e){return t.fire("PastePlainTextToggle",{state:e})},v=function(t,e){return t.fire("paste",{ieFake:e})},y=function(t,e){"text"===e.pasteFormat.get()?(e.pasteFormat.set("html"),g(t,!1)):(e.pasteFormat.set("text"),g(t,!0)),t.focus()},b=function(t,n){t.addCommand("mceTogglePlainTextPaste",function(){y(t,n)}),t.addCommand("mceInsertClipboardContent",function(t,e){e.content&&n.pasteHtml(e.content,e.internal),e.text&&n.pasteText(e.text)})},w=function(t){return function(){return t}},x=w(!1),_=w(!0),P=x,T=_,D=function(){return C},C=(r={fold:function(t,e){return t()},is:P,isSome:P,isNone:T,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:n,orThunk:e,map:D,ap:D,each:function(){},bind:D,flatten:D,exists:P,forall:T,filter:D,equals:t=function(t){return t.isNone()},equals_:t,toArray:function(){return[]},toString:w("none()")},Object.freeze&&Object.freeze(r),r),k=function(n){var t=function(){return n},e=function(){return o},r=function(t){return t(n)},o={fold:function(t,e){return e(n)},is:function(t){return n===t},isSome:T,isNone:P,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:e,orThunk:e,map:function(t){return k(t(n))},ap:function(t){return t.fold(D,function(t){return k(t(n))})},each:function(t){t(n)},bind:r,flatten:t,exists:r,forall:r,filter:function(t){return t(n)?o:C},equals:function(t){return t.is(n)},equals_:function(t,e){return t.fold(P,function(t){return e(n,t)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},S={some:k,none:D,from:function(t){return null===t||t===undefined?C:k(t)}},F=(o="function",function(t){return function(t){if(null===t)return"null";var e=typeof t;return"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e}(t)===o}),I=Array.prototype.slice,E=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o,t)}return r},O=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n,t)}},R=F(Array.from)?Array.from:function(t){return I.call(t)},A={},j={exports:A};i=undefined,a=A,u=j,f=undefined,function(t){"object"==typeof a&&void 0!==u?u.exports=t():"function"==typeof i&&i.amd?i([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=t()}(function(){return function l(i,a,u){function s(e,t){if(!a[e]){if(!i[e]){var n="function"==typeof f&&f;if(!t&&n)return n(e,!0);if(c)return c(e,!0);var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}var o=a[e]={exports:{}};i[e][0].call(o.exports,function(t){return s(i[e][1][t]||t)},o,o.exports,l,i,a,u)}return a[e].exports}for(var c="function"==typeof f&&f,t=0;t<u.length;t++)s(u[t]);return s}({1:[function(t,e,n){var r,o,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(t){r=a}try{o="function"==typeof clearTimeout?clearTimeout:u}catch(t){o=u}}();var c,l=[],f=!1,d=-1;function m(){f&&c&&(f=!1,c.length?l=c.concat(l):d=-1,l.length&&p())}function p(){if(!f){var t=s(m);f=!0;for(var e=l.length;e;){for(c=l,l=[];++d<e;)c&&c[d].run();d=-1,e=l.length}c=null,f=!1,function n(t){if(o===clearTimeout)return clearTimeout(t);if((o===u||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{return o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function g(t,e){this.fun=t,this.array=e}function h(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new g(t,e)),1!==l.length||f||s(p)},g.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=h,i.addListener=h,i.once=h,i.off=h,i.removeListener=h,i.removeAllListeners=h,i.emit=h,i.prependListener=h,i.prependOnceListener=h,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(t,f,e){(function(n){!function(t){var e=setTimeout;function r(){}function i(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=undefined,this._deferreds=[],l(t,this)}function o(r,o){for(;3===r._state;)r=r._value;0!==r._state?(r._handled=!0,i._immediateFn(function(){var t=1===r._state?o.onFulfilled:o.onRejected;if(null!==t){var e;try{e=t(r._value)}catch(n){return void u(o.promise,n)}a(o.promise,e)}else(1===r._state?a:u)(o.promise,r._value)})):r._deferreds.push(o)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void s(t);if("function"==typeof n)return void l(function r(t,e){return function(){t.apply(e,arguments)}}(n,e),t)}t._state=1,t._value=e,s(t)}catch(o){u(t,o)}}function u(t,e){t._state=2,t._value=e,s(t)}function s(t){2===t._state&&0===t._deferreds.length&&i._immediateFn(function(){t._handled||i._unhandledRejectionFn(t._value)});for(var e=0,n=t._deferreds.length;e<n;e++)o(t,t._deferreds[e]);t._deferreds=null}function c(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function l(t,e){var n=!1;try{t(function(t){n||(n=!0,a(e,t))},function(t){n||(n=!0,u(e,t))})}catch(r){if(n)return;n=!0,u(e,r)}}i.prototype["catch"]=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=new this.constructor(r);return o(this,new c(t,e,n)),n},i.all=function(t){var s=Array.prototype.slice.call(t);return new i(function(o,i){if(0===s.length)return o([]);var a=s.length;function u(e,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void n.call(t,function(t){u(e,t)},i)}s[e]=t,0==--a&&o(s)}catch(r){i(r)}}for(var t=0;t<s.length;t++)u(t,s[t])})},i.resolve=function(e){return e&&"object"==typeof e&&e.constructor===i?e:new i(function(t){t(e)})},i.reject=function(n){return new i(function(t,e){e(n)})},i.race=function(o){return new i(function(t,e){for(var n=0,r=o.length;n<r;n++)o[n].then(t,e)})},i._immediateFn="function"==typeof n?function(t){n(t)}:function(t){e(t,0)},i._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},i._setImmediateFn=function(t){i._immediateFn=t},i._setUnhandledRejectionFn=function(t){i._unhandledRejectionFn=t},void 0!==f&&f.exports?f.exports=i:t.Promise||(t.Promise=i)}(this)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(s,t,c){(function(t,e){var r=s("process/browser.js").nextTick,n=Function.prototype.apply,o=Array.prototype.slice,i={},a=0;function u(t,e){this._id=t,this._clearFn=e}c.setTimeout=function(){return new u(n.call(setTimeout,window,arguments),clearTimeout)},c.setInterval=function(){return new u(n.call(setInterval,window,arguments),clearInterval)},c.clearTimeout=c.clearInterval=function(t){t.close()},u.prototype.unref=u.prototype.ref=function(){},u.prototype.close=function(){this._clearFn.call(window,this._id)},c.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},c.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},c._unrefActive=c.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;0<=e&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},c.setImmediate="function"==typeof t?t:function(t){var e=a++,n=!(arguments.length<2)&&o.call(arguments,1);return i[e]=!0,r(function(){i[e]&&(n?t.apply(null,n):t.call(null),c.clearImmediate(e))}),e},c.clearImmediate="function"==typeof e?e:function(t){delete i[t]}}).call(this,s("timers").setImmediate,s("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,e,n){var r=t("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();e.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)});var M=j.exports.boltExport,L=function(t){var n=S.none(),e=[],r=function(t){o()?a(t):e.push(t)},o=function(){return n.isSome()},i=function(t){O(t,a)},a=function(e){n.each(function(t){h.setTimeout(function(){e(t)},0)})};return t(function(t){n=S.some(t),i(e),e=[]}),{get:r,map:function(n){return L(function(e){r(function(t){e(n(t))})})},isReady:o}},N={nu:L,pure:function(e){return L(function(t){t(e)})}},B=function(t){h.setTimeout(function(){throw t},0)},H=function(n){var t=function(t){n().then(t,B)};return{map:function(t){return H(function(){return n().then(t)})},bind:function(e){return H(function(){return n().then(function(t){return e(t).toPromise()})})},anonBind:function(t){return H(function(){return n().then(function(){return t.toPromise()})})},toLazy:function(){return N.nu(t)},toCached:function(){var t=null;return H(function(){return null===t&&(t=n()),t})},toPromise:n,get:t}},$=function(t){return H(function(){return new M(t)})},W=function(a,t){return t(function(r){var o=[],i=0;0===a.length?r([]):O(a,function(t,e){var n;t.get((n=e,function(t){o[n]=t,++i>=a.length&&r(o)}))})})},U=function(t,e){var n=E(t,e);return W(n,$)},z=tinymce.util.Tools.resolve("tinymce.Env"),V=tinymce.util.Tools.resolve("tinymce.util.Delay"),q=tinymce.util.Tools.resolve("tinymce.util.Tools"),K=tinymce.util.Tools.resolve("tinymce.util.VK"),G="x-tinymce/html",X="\x3c!-- "+G+" --\x3e",Y=function(t){return X+t},Z=function(t){return t.replace(X,"")},J=function(t){return-1!==t.indexOf(X)},Q=function(){return G},tt=tinymce.util.Tools.resolve("tinymce.html.Entities"),et=function(t){return t.replace(/\r?\n/g,"<br>")},nt=function(t,e,n){var r=t.split(/\n\n/),o=function(t,e){var n,r=[],o="<"+t;if("object"==typeof e){for(n in e)e.hasOwnProperty(n)&&r.push(n+'="'+tt.encodeAllRaw(e[n])+'"');r.length&&(o+=" "+r.join(" "))}return o+">"}(e,n),i="</"+e+">",a=q.map(r,function(t){return t.split(/\n/).join("<br />")});return 1===a.length?a[0]:q.map(a,function(t){return o+t+i}).join("")},rt=function(t){return!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(t)},ot=function(t,e,n){return e?nt(t,!0===e?"p":e,n):et(t)},it=tinymce.util.Tools.resolve("tinymce.html.DomParser"),at=tinymce.util.Tools.resolve("tinymce.html.Node"),ut=tinymce.util.Tools.resolve("tinymce.html.Schema"),st=tinymce.util.Tools.resolve("tinymce.html.Serializer"),ct={shouldBlockDrop:function(t){return t.getParam("paste_block_drop",!1)},shouldPasteDataImages:function(t){return t.getParam("paste_data_images",!1)},shouldFilterDrop:function(t){return t.getParam("paste_filter_drop",!0)},getPreProcess:function(t){return t.getParam("paste_preprocess")},getPostProcess:function(t){return t.getParam("paste_postprocess")},getWebkitStyles:function(t){return t.getParam("paste_webkit_styles")},shouldRemoveWebKitStyles:function(t){return t.getParam("paste_remove_styles_if_webkit",!0)},shouldMergeFormats:function(t){return t.getParam("paste_merge_formats",!0)},isSmartPasteEnabled:function(t){return t.getParam("smart_paste",!0)},isPasteAsTextEnabled:function(t){return t.getParam("paste_as_text",!1)},getRetainStyleProps:function(t){return t.getParam("paste_retain_style_properties")},getWordValidElements:function(t){return t.getParam("paste_word_valid_elements","-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody")},shouldConvertWordFakeLists:function(t){return t.getParam("paste_convert_word_fake_lists",!0)},shouldUseDefaultFilters:function(t){return t.getParam("paste_enable_default_filters",!0)}};function lt(e,t){return q.each(t,function(t){e=t.constructor===RegExp?e.replace(t,""):e.replace(t[0],t[1])}),e}var ft={filter:lt,innerText:function se(t){var e=ut(),n=it({},e),r="",o=e.getShortEndedElements(),i=q.makeMap("script noscript style textarea video audio iframe object"," "),a=e.getBlockElements();return t=lt(t,[/<!\[[^\]]+\]>/g]),function u(t){var e=t.name,n=t;if("br"!==e){if("wbr"!==e)if(o[e]&&(r+=" "),i[e])r+=" ";else{if(3===t.type&&(r+=t.value),!t.shortEnded&&(t=t.firstChild))for(;u(t),t=t.next;);a[e]&&n.next&&(r+="\n","p"===e&&(r+="\n"))}}else r+="\n"}(n.parse(t)),r},trimHtml:function ce(t){return t=lt(t,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,function r(t,e,n){return e||n?"\xa0":" "}],/<br class="Apple-interchange-newline">/g,/<br>$/i])},createIdGenerator:function le(t){var e=0;return function(){return t+e++}},isMsEdge:function(){return-1!==h.navigator.userAgent.indexOf(" Edge/")}};function dt(e){var n,t;return t=[/^[IVXLMCD]{1,2}\.[ \u00a0]/,/^[ivxlmcd]{1,2}\.[ \u00a0]/,/^[a-z]{1,2}[\.\)][ \u00a0]/,/^[A-Z]{1,2}[\.\)][ \u00a0]/,/^[0-9]+\.[ \u00a0]/,/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/],e=e.replace(/^[\u00a0 ]+/,""),q.each(t,function(t){if(t.test(e))return!(n=!0)}),n}function mt(t){var i,a,u=1;function n(t){var e="";if(3===t.type)return t.value;if(t=t.firstChild)for(;e+=n(t),t=t.next;);return e}function s(t,e){if(3===t.type&&e.test(t.value))return t.value=t.value.replace(e,""),!1;if(t=t.firstChild)do{if(!s(t,e))return!1}while(t=t.next);return!0}function e(t,e,n){var r=t._listLevel||u;r!==u&&(r<u?i&&(i=i.parent.parent):(a=i,i=null)),i&&i.name===e?i.append(t):(a=a||i,i=new at(e,1),1<n&&i.attr("start",""+n),t.wrap(i)),t.name="li",u<r&&a&&a.lastChild.append(i),u=r,function o(t){if(t._listIgnore)t.remove();else if(t=t.firstChild)for(;o(t),t=t.next;);}(t),s(t,/^\u00a0+/),s(t,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),s(t,/^\u00a0+/)}for(var r=[],o=t.firstChild;null!=o;)if(r.push(o),null!==(o=o.walk()))for(;void 0!==o&&o.parent!==t;)o=o.walk();for(var c=0;c<r.length;c++)if("p"===(t=r[c]).name&&t.firstChild){var l=n(t);if(/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(l)){e(t,"ul");continue}if(dt(l)){var f=/([0-9]+)\./.exec(l),d=1;f&&(d=parseInt(f[1],10)),e(t,"ol",d);continue}if(t._listLevel){e(t,"ul",1);continue}i=null}else a=i,i=null}function pt(n,r,o,i){var a,u={},t=n.dom.parseStyle(i);return q.each(t,function(t,e){switch(e){case"mso-list":(a=/\w+ \w+([0-9]+)/i.exec(i))&&(o._listLevel=parseInt(a[1],10)),/Ignore/i.test(t)&&o.firstChild&&(o._listIgnore=!0,o.firstChild._listIgnore=!0);break;case"horiz-align":e="text-align";break;case"vert-align":e="vertical-align";break;case"font-color":case"mso-foreground":e="color";break;case"mso-background":case"mso-highlight":e="background";break;case"font-weight":case"font-style":return void("normal"!==t&&(u[e]=t));case"mso-element":if(/^(comment|comment-list)$/i.test(t))return void o.remove()}0!==e.indexOf("mso-comment")?0!==e.indexOf("mso-")&&("all"===ct.getRetainStyleProps(n)||r&&r[e])&&(u[e]=t):o.remove()}),/(bold)/i.test(u["font-weight"])&&(delete u["font-weight"],o.wrap(new at("b",1))),/(italic)/i.test(u["font-style"])&&(delete u["font-style"],o.wrap(new at("i",1))),(u=n.dom.serializeStyle(u,o.name))||null}var gt={preProcess:function(t,e){return ct.shouldUseDefaultFilters(t)?function(r,t){var e,o;(e=ct.getRetainStyleProps(r))&&(o=q.makeMap(e.split(/[, ]/))),t=ft.filter(t,[/<br class="?Apple-interchange-newline"?>/gi,/<b[^>]+id="?docs-internal-[^>]*>/gi,/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\xa0"],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(t,e){return 0<e.length?e.replace(/./," ").slice(Math.floor(e.length/2)).split("").join("\xa0"):""}]]);var n=ct.getWordValidElements(r),i=ut({valid_elements:n,valid_children:"-li[p]"});q.each(i.elements,function(t){t.attributes["class"]||(t.attributes["class"]={},t.attributesOrder.push("class")),t.attributes.style||(t.attributes.style={},t.attributesOrder.push("style"))});var a=it({},i);a.addAttributeFilter("style",function(t){for(var e,n=t.length;n--;)(e=t[n]).attr("style",pt(r,o,e,e.attr("style"))),"span"===e.name&&e.parent&&!e.attributes.length&&e.unwrap()}),a.addAttributeFilter("class",function(t){for(var e,n,r=t.length;r--;)n=(e=t[r]).attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(n)&&e.remove(),e.attr("class",null)}),a.addNodeFilter("del",function(t){for(var e=t.length;e--;)t[e].remove()}),a.addNodeFilter("a",function(t){for(var e,n,r,o=t.length;o--;)if(n=(e=t[o]).attr("href"),r=e.attr("name"),n&&-1!==n.indexOf("#_msocom_"))e.remove();else if(n&&0===n.indexOf("file://")&&(n=n.split("#")[1])&&(n="#"+n),n||r){if(r&&!/^_?(?:toc|edn|ftn)/i.test(r)){e.unwrap();continue}e.attr({href:n,name:r})}else e.unwrap()});var u=a.parse(t);return ct.shouldConvertWordFakeLists(r)&&mt(u),t=st({validate:r.settings.validate},i).serialize(u)}(t,e):e},isWordContent:function fe(t){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(t)||/class="OutlineElement/.test(t)||/id="?docs\-internal\-guid\-/.test(t)}},ht=function(t,e){return{content:t,cancelled:e}},vt=function(t,e,n,r){var o,i,a,u,s,c,l=d(t,e,n,r);return t.hasEventListeners("PastePostProcess")&&!l.isDefaultPrevented()?(o=t,i=l.content,a=n,u=r,s=o.dom.create("div",{style:"display:none"},i),c=m(o,s,a,u),ht(c.node.innerHTML,c.isDefaultPrevented())):ht(l.content,l.isDefaultPrevented())},yt=function(t,e,n){var r=gt.isWordContent(e),o=r?gt.preProcess(t,e):e;return vt(t,o,n,r)},bt=function(t,e){var n,r;return t.insertContent((n=e,r=t.dom.create("body",{},n),q.each(r.querySelectorAll("meta"),function(t){return t.parentNode.removeChild(t)}),r.innerHTML),{merge:ct.shouldMergeFormats(t),paste:!0}),!0},wt=function(t){return/^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(t)},xt=function(t){return wt(t)&&/.(gif|jpe?g|png)$/.test(t)},_t=function(t,e,n){return!(!1!==t.selection.isCollapsed()||!wt(e))&&(o=e,i=n,(r=t).undoManager.extra(function(){i(r,o)},function(){r.execCommand("mceInsertLink",!1,o)}),!0);var r,o,i},Pt=function(t,e,n){return!!xt(e)&&(o=e,i=n,(r=t).undoManager.extra(function(){i(r,o)},function(){r.insertContent('<img src="'+o+'">')}),!0);var r,o,i},Tt=function(t,e){var n,r;!1===ct.isSmartPasteEnabled(t)?bt(t,e):(n=t,r=e,q.each([_t,Pt,bt],function(t){return!0!==t(n,r,bt)}))},Dt=function(t){return"\n"===t||"\r"===t},Ct=function(o){var e,n;return(n={pcIsSpace:!(e=function(t,e){return-1!==" \f\t\x0B".indexOf(e)||"\xa0"===e?t.pcIsSpace||""===t.str||t.str.length===o.length-1||(n=o,(r=t.str.length+1)<n.length&&0<=r&&Dt(n[r]))?{pcIsSpace:!1,str:t.str+"\xa0"}:{pcIsSpace:!0,str:t.str+" "}:{pcIsSpace:Dt(e),str:t.str+e};var n,r}),str:""},O(o,function(t){n=e(n,t)}),n).str},kt=function(t,e,n){var r=n||J(e),o=yt(t,Z(e),r);!1===o.cancelled&&Tt(t,o.content)},St=function(t,e){var n=t.dom.encode(e).replace(/\r\n/g,"\n"),r=Ct(n),o=ot(r,t.settings.forced_root_block,t.settings.forced_root_block_attrs);kt(t,o,!1)},Ft=function(t){var e={};if(t){if(t.getData){var n=t.getData("Text");n&&0<n.length&&-1===n.indexOf("data:text/mce-internal,")&&(e["text/plain"]=n)}if(t.types)for(var r=0;r<t.types.length;r++){var o=t.types[r];try{e[o]=t.getData(o)}catch(i){e[o]=""}}}return e},It=function(t,e){return e in t&&0<t[e].length},Et=function(t){return It(t,"text/html")||It(t,"text/plain")},Ot=ft.createIdGenerator("mceclip"),Rt=function(e,t,n){var r,o,i,a,u="paste"===t.type?t.clipboardData:t.dataTransfer;if(e.settings.paste_data_images&&u){var s=(i=(o=u).items?E(R(o.items),function(t){return t.getAsFile()}):[],a=o.files?R(o.files):[],function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r,t)&&n.push(i)}return n}(0<i.length?i:a,function(t){return/^image\/(jpeg|png|gif|bmp)$/.test(t.type)}));if(0<s.length)return t.preventDefault(),(r=s,U(r,function(r){return $(function(t){var e=r.getAsFile?r.getAsFile():r,n=new window.FileReader;n.onload=function(){t({blob:e,uri:n.result})},n.readAsDataURL(e)})})).get(function(t){n&&e.selection.setRng(n),O(t,function(t){!function(t,e){var n,r,o,i,a,u,s,c=(n=e.uri,-1!==(r=n.indexOf(","))?n.substr(r+1):null),l=Ot(),f=t.settings.images_reuse_filename&&e.blob.name?(o=t,i=e.blob.name,(a=i.match(/([\s\S]+?)\.(?:jpeg|jpg|png|gif)$/i))?o.dom.encode(a[1]):null):l,d=new h.Image;if(d.src=e.uri,u=t.settings,s=d,!u.images_dataimg_filter||u.images_dataimg_filter(s)){var m,p=t.editorUpload.blobCache,g=void 0;(m=p.findFirst(function(t){return t.base64()===c}))?g=m:(g=p.create(l,e.blob,c,f),p.add(g)),kt(t,'<img src="'+g.blobUri()+'">',!1)}else kt(t,'<img src="'+e.uri+'">',!1)}(e,t)})}),!0}return!1},At=function(t){return K.metaKeyPressed(t)&&86===t.keyCode||t.shiftKey&&45===t.keyCode},jt=function(s,c,l){var e,f,d=(e=p(S.none()),{clear:function(){e.set(S.none())},set:function(t){e.set(S.some(t))},isSet:function(){return e.get().isSome()},on:function(t){e.get().each(t)}});function m(t,e,n,r){var o,i;It(t,"text/html")?o=t["text/html"]:(o=c.getHtml(),r=r||J(o),c.isDefaultContent(o)&&(n=!0)),o=ft.trimHtml(o),c.remove(),i=!1===r&&rt(o),o.length&&!i||(n=!0),n&&(o=It(t,"text/plain")&&i?t["text/plain"]:ft.innerText(o)),c.isDefaultContent(o)?e||s.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):n?St(s,o):kt(s,o,r)}s.on("keydown",function(t){function e(t){At(t)&&!t.isDefaultPrevented()&&c.remove()}if(At(t)&&!t.isDefaultPrevented()){if((f=t.shiftKey&&86===t.keyCode)&&z.webkit&&-1!==h.navigator.userAgent.indexOf("Version/"))return;if(t.stopImmediatePropagation(),d.set(t),window.setTimeout(function(){d.clear()},100),z.ie&&f)return t.preventDefault(),void v(s,!0);c.remove(),c.create(),s.once("keyup",e),s.once("paste",function(){s.off("keyup",e)})}});s.on("paste",function(t){var e,n,r,o=d.isSet(),i=(e=s,n=Ft(t.clipboardData||e.getDoc().dataTransfer),ft.isMsEdge()?q.extend(n,{"text/html":""}):n),a="text"===l.get()||f,u=It(i,Q());(f=!1,t.isDefaultPrevented()||(r=t.clipboardData,-1!==h.navigator.userAgent.indexOf("Android")&&r&&r.items&&0===r.items.length))?c.remove():Et(i)||!Rt(s,t,c.getLastRng()||s.selection.getRng())?(o||t.preventDefault(),!z.ie||o&&!t.ieFake||It(i,"text/html")||(c.create(),s.dom.bind(c.getEl(),"paste",function(t){t.stopPropagation()}),s.getDoc().execCommand("Paste",!1,null),i["text/html"]=c.getHtml()),It(i,"text/html")?(t.preventDefault(),u||(u=J(i["text/html"])),m(i,o,a,u)):V.setEditorTimeout(s,function(){m(i,o,a,u)},0)):c.remove()})},Mt=function(t){return z.ie&&t.inline?h.document.body:t.getBody()},Lt=function(e,t,n){var r;Mt(r=e)!==r.getBody()&&e.dom.bind(t,"paste keyup",function(t){Ht(e,n)||e.fire("paste")})},Nt=function(t){return t.dom.get("mcepastebin")},Bt=function(t,e){return e===t},Ht=function(t,e){var n,r=Nt(t);return(n=r)&&"mcepastebin"===n.id&&Bt(e,r.innerHTML)},$t=function(a){var u=p(null),s="%MCEPASTEBIN%";return{create:function(){return e=u,n=s,o=(t=a).dom,i=t.getBody(),e.set(t.selection.getRng()),r=t.dom.add(Mt(t),"div",{id:"mcepastebin","class":"mce-pastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0"},n),(z.ie||z.gecko)&&o.setStyle(r,"left","rtl"===o.getStyle(i,"direction",!0)?65535:-65535),o.bind(r,"beforedeactivate focusin focusout",function(t){t.stopPropagation()}),Lt(t,r,n),r.focus(),void t.selection.select(r,!0);var t,e,n,r,o,i},remove:function(){return function(t,e){if(Nt(t)){for(var n=void 0,r=e.get();n=t.dom.get("mcepastebin");)t.dom.remove(n),t.dom.unbind(n);r&&t.selection.setRng(r)}e.set(null)}(a,u)},getEl:function(){return Nt(a)},getHtml:function(){return function(n){var e,t,r,o,i,a=function(t,e){t.appendChild(e),n.dom.remove(e,!0)};for(t=q.grep(Mt(n).childNodes,function(t){return"mcepastebin"===t.id}),e=t.shift(),q.each(t,function(t){a(e,t)}),r=(o=n.dom.select("div[id=mcepastebin]",e)).length-1;0<=r;r--)i=n.dom.create("div"),e.insertBefore(i,o[r]),a(i,o[r]);return e?e.innerHTML:""}(a)},getLastRng:function(){return u.get()},isDefault:function(){return Ht(a,s)},isDefaultContent:function(t){return Bt(s,t)}}},Wt=function(n,t){var e=$t(n);return n.on("PreInit",function(){return jt(a=n,e,t),void a.parser.addNodeFilter("img",function(t,e,n){var r,o=function(t){t.attr("data-mce-object")||u===z.transparentSrc||t.remove()};if(!a.settings.paste_data_images&&(r=n).data&&!0===r.data.paste)for(var i=t.length;i--;)(u=t[i].attr("src"))&&(0===u.indexOf("webkit-fake-url")?o(t[i]):a.settings.allow_html_data_urls||0!==u.indexOf("data:")||o(t[i]))});var a,u}),{pasteFormat:t,pasteHtml:function(t,e){return kt(n,t,e)},pasteText:function(t){return St(n,t)},pasteImageData:function(t,e){return Rt(n,t,e)},getDataTransferItems:Ft,hasHtmlOrText:Et,hasContentType:It}},Ut=function(){},zt=function(t,e,n){if(r=t,!1!==z.iOS||r===undefined||"function"!=typeof r.setData||!0===ft.isMsEdge())return!1;try{return t.clearData(),t.setData("text/html",e),t.setData("text/plain",n),t.setData(Q(),e),!0}catch(o){return!1}var r},Vt=function(t,e,n,r){zt(t.clipboardData,e.html,e.text)?(t.preventDefault(),r()):n(e.html,r)},qt=function(u){return function(t,e){var n=Y(t),r=u.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),o=u.dom.create("div",{contenteditable:"true"},n);u.dom.setStyles(r,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),r.appendChild(o),u.dom.add(u.getBody(),r);var i=u.selection.getRng();o.focus();var a=u.dom.createRng();a.selectNodeContents(o),u.selection.setRng(a),V.setTimeout(function(){u.selection.setRng(i),r.parentNode.removeChild(r),e()},0)}},Kt=function(t){return{html:t.selection.getContent({contextual:!0}),text:t.selection.getContent({format:"text"})}},Gt=function(t){return!t.selection.isCollapsed()||!!(e=t).dom.getParent(e.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",e.getBody());var e},Xt=function(t){var e,n;t.on("cut",(e=t,function(t){Gt(e)&&Vt(t,Kt(e),qt(e),function(){V.setTimeout(function(){e.execCommand("Delete")},0)})})),t.on("copy",(n=t,function(t){Gt(n)&&Vt(t,Kt(n),qt(n),Ut)}))},Yt=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),Zt=function(t,e){return Yt.getCaretRangeFromPoint(e.clientX,e.clientY,t.getDoc())},Jt=function(t,e){t.focus(),t.selection.setRng(e)},Qt=function(a,u,s){ct.shouldBlockDrop(a)&&a.on("dragend dragover draggesture dragdrop drop drag",function(t){t.preventDefault(),t.stopPropagation()}),ct.shouldPasteDataImages(a)||a.on("drop",function(t){var e=t.dataTransfer;e&&e.files&&0<e.files.length&&t.preventDefault()}),a.on("drop",function(t){var e,n;if(n=Zt(a,t),!t.isDefaultPrevented()&&!s.get()){e=u.getDataTransferItems(t.dataTransfer);var r,o=u.hasContentType(e,Q());if((u.hasHtmlOrText(e)&&(!(r=e["text/plain"])||0!==r.indexOf("file://"))||!u.pasteImageData(t,n))&&n&&ct.shouldFilterDrop(a)){var i=e["mce-internal"]||e["text/html"]||e["text/plain"];i&&(t.preventDefault(),V.setEditorTimeout(a,function(){a.undoManager.transact(function(){e["mce-internal"]&&a.execCommand("Delete"),Jt(a,n),i=ft.trimHtml(i),e["text/html"]?u.pasteHtml(i,o):u.pasteText(i)})}))}}}),a.on("dragstart",function(t){s.set(!0)}),a.on("dragover dragend",function(t){ct.shouldPasteDataImages(a)&&!1===s.get()&&(t.preventDefault(),Jt(a,Zt(a,t))),"dragend"===t.type&&s.set(!1)})},te=function(t){var e=t.plugins.paste,n=ct.getPreProcess(t);n&&t.on("PastePreProcess",function(t){n.call(e,e,t)});var r=ct.getPostProcess(t);r&&t.on("PastePostProcess",function(t){r.call(e,e,t)})};function ee(e,n){e.on("PastePreProcess",function(t){t.content=n(e,t.content,t.internal,t.wordContent)})}function ne(t,e){if(!gt.isWordContent(e))return e;var n=[];q.each(t.schema.getBlockElements(),function(t,e){n.push(e)});var r=new RegExp("(?:<br> [\\s\\r\\n]+|<br>)*(<\\/?("+n.join("|")+")[^>]*>)(?:<br> [\\s\\r\\n]+|<br>)*","g");return e=ft.filter(e,[[r,"$1"]]),e=ft.filter(e,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function re(t,e,n,r){if(r||n)return e;var c,o=ct.getWebkitStyles(t);if(!1===ct.shouldRemoveWebKitStyles(t)||"all"===o)return e;if(o&&(c=o.split(/[, ]/)),c){var l=t.dom,f=t.selection.getNode();e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(t,e,n,r){var o=l.parseStyle(l.decode(n)),i={};if("none"===c)return e+r;for(var a=0;a<c.length;a++){var u=o[c[a]],s=l.getStyle(f,c[a],!0);/color/.test(c[a])&&(u=l.toHex(u),s=l.toHex(s)),s!==u&&(i[c[a]]=u)}return(i=l.serializeStyle(i,"span"))?e+' style="'+i+'"'+r:e+r})}else e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return e=e.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(t,e,n,r){return e+' style="'+n+'"'+r})}function oe(n,t){n.$("a",t).find("font,u").each(function(t,e){n.dom.remove(e,!0)})}var ie=function(t){z.webkit&&ee(t,re),z.ie&&(ee(t,ne),function r(e,n){e.on("PastePostProcess",function(t){n(e,t.node)})}(t,oe))},ae=function(n,r){return function(e){e.setActive("text"===r.pasteFormat.get());var t=function(t){return e.setActive(t.state)};return n.on("PastePlainTextToggle",t),function(){return n.off("PastePlainTextToggle",t)}}},ue=function(t,e){t.ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:ae(t,e)}),t.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:ae(t,e)})};!function de(){s.add("paste",function(t){if(!1===c(t)){var e=p(!1),n=p(ct.isPasteAsTextEnabled(t)?"text":"html"),r=Wt(t,n),o=ie(t);return ue(t,r),b(t,r),te(t),Xt(t),Qt(t,r,e),l(r,o)}})}()}(window);
|
9
|
+
!function(f){"use strict";function t(){}function i(t){return function(){return t}}function e(){return v}var n,d=function(t){function e(){return n}var n=t;return{get:e,set:function(t){n=t},clone:function(){return d(e())}}},r=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(t){return!(!/(^|[ ,])powerpaste([, ]|$)/.test(t.settings.plugins)||!r.get("powerpaste"))&&("undefined"!=typeof f.window.console&&f.window.console.log&&f.window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),!0)},a=function(t,e){return{clipboard:t,quirks:e}},s=function(t,e,n,r){return t.fire("PastePreProcess",{content:e,internal:n,wordContent:r})},c=function(t,e,n,r){return t.fire("PastePostProcess",{node:e,internal:n,wordContent:r})},o=function(t,e){return t.fire("PastePlainTextToggle",{state:e})},m=function(t,e){return t.fire("paste",{ieFake:e})},l=function(t,e){"text"===e.pasteFormat.get()?(e.pasteFormat.set("html"),o(t,!1)):(e.pasteFormat.set("text"),o(t,!0)),t.focus()},p=function(t,n){t.addCommand("mceTogglePlainTextPaste",function(){l(t,n)}),t.addCommand("mceInsertClipboardContent",function(t,e){e.content&&n.pasteHtml(e.content,e.internal),e.text&&n.pasteText(e.text)})},g=i(!1),h=i(!0),v=(n={fold:function(t,e){return t()},is:g,isSome:g,isNone:h,getOr:w,getOrThunk:b,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(undefined),or:w,orThunk:b,map:e,each:t,bind:e,exists:g,forall:h,filter:e,equals:y,equals_:y,toArray:function(){return[]},toString:i("none()")},Object.freeze&&Object.freeze(n),n);function y(t){return t.isNone()}function b(t){return t()}function w(t){return t}function x(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r}function _(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}}var P,T,D,C,k,S=function(n){function t(){return o}function e(t){return t(n)}var r=i(n),o={fold:function(t,e){return e(n)},is:function(t){return n===t},isSome:h,isNone:g,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:t,orThunk:t,map:function(t){return S(t(n))},each:function(t){t(n)},bind:e,exists:e,forall:e,filter:function(t){return t(n)?o:v},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(t){return t.is(n)},equals_:function(t,e){return t.fold(g,function(t){return e(n,t)})}};return o},F={some:S,none:e,from:function(t){return null===t||t===undefined?v:S(t)}},I=(P="function",function(t){return function(t){if(null===t)return"null";var e=typeof t;return"object"==e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e}(t)===P}),E=Array.prototype.slice,O=I(Array.from)?Array.from:function(t){return E.call(t)},R={},A={exports:R};T=undefined,D=R,C=A,k=undefined,function(t){"object"==typeof D&&void 0!==C?C.exports=t():"function"==typeof T&&T.amd?T([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=t()}(function(){return function l(i,u,a){function s(e,t){if(!u[e]){if(!i[e]){var n="function"==typeof k&&k;if(!t&&n)return n(e,!0);if(c)return c(e,!0);var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}var o=u[e]={exports:{}};i[e][0].call(o.exports,function(t){return s(i[e][1][t]||t)},o,o.exports,l,i,u,a)}return u[e].exports}for(var c="function"==typeof k&&k,t=0;t<a.length;t++)s(a[t]);return s}({1:[function(t,e,n){var r,o,i=e.exports={};function u(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===u||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:u}catch(t){r=u}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(t){o=a}}();var c,l=[],f=!1,d=-1;function m(){f&&c&&(f=!1,c.length?l=c.concat(l):d=-1,l.length&&p())}function p(){if(!f){var t=s(m);f=!0;for(var e=l.length;e;){for(c=l,l=[];++d<e;)c&&c[d].run();d=-1,e=l.length}c=null,f=!1,function n(t){if(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{return o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function g(t,e){this.fun=t,this.array=e}function h(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new g(t,e)),1!==l.length||f||s(p)},g.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=h,i.addListener=h,i.once=h,i.off=h,i.removeListener=h,i.removeAllListeners=h,i.emit=h,i.prependListener=h,i.prependOnceListener=h,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(t,f,e){(function(e){function r(){}function i(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=undefined,this._deferreds=[],l(t,this)}function o(r,o){for(;3===r._state;)r=r._value;0!==r._state?(r._handled=!0,i._immediateFn(function(){var t=1===r._state?o.onFulfilled:o.onRejected;if(null!==t){var e;try{e=t(r._value)}catch(n){return void a(o.promise,n)}u(o.promise,e)}else(1===r._state?u:a)(o.promise,r._value)})):r._deferreds.push(o)}function u(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void s(t);if("function"==typeof n)return void l(function r(t,e){return function(){t.apply(e,arguments)}}(n,e),t)}t._state=1,t._value=e,s(t)}catch(o){a(t,o)}}function a(t,e){t._state=2,t._value=e,s(t)}function s(t){2===t._state&&0===t._deferreds.length&&i._immediateFn(function(){t._handled||i._unhandledRejectionFn(t._value)});for(var e=0,n=t._deferreds.length;e<n;e++)o(t,t._deferreds[e]);t._deferreds=null}function c(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function l(t,e){var n=!1;try{t(function(t){n||(n=!0,u(e,t))},function(t){n||(n=!0,a(e,t))})}catch(r){if(n)return;n=!0,a(e,r)}}var t,n;t=this,n=setTimeout,i.prototype["catch"]=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=new this.constructor(r);return o(this,new c(t,e,n)),n},i.all=function(t){var s=Array.prototype.slice.call(t);return new i(function(o,i){if(0===s.length)return o([]);var u=s.length;function a(e,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void n.call(t,function(t){a(e,t)},i)}s[e]=t,0==--u&&o(s)}catch(r){i(r)}}for(var t=0;t<s.length;t++)a(t,s[t])})},i.resolve=function(e){return e&&"object"==typeof e&&e.constructor===i?e:new i(function(t){t(e)})},i.reject=function(n){return new i(function(t,e){e(n)})},i.race=function(o){return new i(function(t,e){for(var n=0,r=o.length;n<r;n++)o[n].then(t,e)})},i._immediateFn="function"==typeof e?function(t){e(t)}:function(t){n(t,0)},i._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},i._setImmediateFn=function(t){i._immediateFn=t},i._setUnhandledRejectionFn=function(t){i._unhandledRejectionFn=t},void 0!==f&&f.exports?f.exports=i:t.Promise||(t.Promise=i)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(s,t,c){(function(t,e){var r=s("process/browser.js").nextTick,n=Function.prototype.apply,o=Array.prototype.slice,i={},u=0;function a(t,e){this._id=t,this._clearFn=e}c.setTimeout=function(){return new a(n.call(setTimeout,window,arguments),clearTimeout)},c.setInterval=function(){return new a(n.call(setInterval,window,arguments),clearInterval)},c.clearTimeout=c.clearInterval=function(t){t.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(window,this._id)},c.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},c.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},c._unrefActive=c.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;0<=e&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},c.setImmediate="function"==typeof t?t:function(t){var e=u++,n=!(arguments.length<2)&&o.call(arguments,1);return i[e]=!0,r(function(){i[e]&&(n?t.apply(null,n):t.call(null),c.clearImmediate(e))}),e},c.clearImmediate="function"==typeof e?e:function(t){delete i[t]}}).call(this,s("timers").setImmediate,s("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,e,n){var r=t("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();e.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)});function j(t){f.setTimeout(function(){throw t},0)}function M(i,t){return t(function(n){var r=[],o=0;0===i.length?n([]):_(i,function(t,e){t.get(function(e){return function(t){r[e]=t,++o>=i.length&&n(r)}}(e))})})}function L(t,e){return function(t){return M(t,z)}(x(t,e))}function N(t){return t.replace(/\r?\n/g,"<br>")}function B(t,e,n){var r=t.split(/\n\n/),o=function(t,e){var n,r=[],o="<"+t;if("object"==typeof e){for(n in e)e.hasOwnProperty(n)&&r.push(n+'="'+et.encodeAllRaw(e[n])+'"');r.length&&(o+=" "+r.join(" "))}return o+">"}(e,n),i="</"+e+">",u=K.map(r,function(t){return t.split(/\n/).join("<br />")});return 1===u.length?u[0]:K.map(u,function(t){return o+t+i}).join("")}var H=A.exports.boltExport,$=function(t){var n=F.none(),e=[],r=function(t){o()?u(t):e.push(t)},o=function(){return n.isSome()},i=function(t){_(t,u)},u=function(e){n.each(function(t){f.setTimeout(function(){e(t)},0)})};return t(function(t){n=F.some(t),i(e),e=[]}),{get:r,map:function(n){return $(function(e){r(function(t){e(n(t))})})},isReady:o}},W={nu:$,pure:function(e){return $(function(t){t(e)})}},U=function(n){function t(t){n().then(t,j)}return{map:function(t){return U(function(){return n().then(t)})},bind:function(e){return U(function(){return n().then(function(t){return e(t).toPromise()})})},anonBind:function(t){return U(function(){return n().then(function(){return t.toPromise()})})},toLazy:function(){return W.nu(t)},toCached:function(){var t=null;return U(function(){return null===t&&(t=n()),t})},toPromise:n,get:t}},z=function(t){return U(function(){return new H(t)})},V=tinymce.util.Tools.resolve("tinymce.Env"),q=tinymce.util.Tools.resolve("tinymce.util.Delay"),K=tinymce.util.Tools.resolve("tinymce.util.Tools"),G=tinymce.util.Tools.resolve("tinymce.util.VK"),X="x-tinymce/html",Y="\x3c!-- "+X+" --\x3e",Z=function(t){return Y+t},J=function(t){return t.replace(Y,"")},Q=function(t){return-1!==t.indexOf(Y)},tt=function(){return X},et=tinymce.util.Tools.resolve("tinymce.html.Entities"),nt=function(t){return!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(t)},rt=function(t,e,n){return e?B(t,!0===e?"p":e,n):N(t)},ot=tinymce.util.Tools.resolve("tinymce.html.DomParser"),it=tinymce.util.Tools.resolve("tinymce.html.Node"),ut=tinymce.util.Tools.resolve("tinymce.html.Schema"),at=tinymce.util.Tools.resolve("tinymce.html.Serializer"),st={shouldBlockDrop:function(t){return t.getParam("paste_block_drop",!1)},shouldPasteDataImages:function(t){return t.getParam("paste_data_images",!1)},shouldFilterDrop:function(t){return t.getParam("paste_filter_drop",!0)},getPreProcess:function(t){return t.getParam("paste_preprocess")},getPostProcess:function(t){return t.getParam("paste_postprocess")},getWebkitStyles:function(t){return t.getParam("paste_webkit_styles")},shouldRemoveWebKitStyles:function(t){return t.getParam("paste_remove_styles_if_webkit",!0)},shouldMergeFormats:function(t){return t.getParam("paste_merge_formats",!0)},isSmartPasteEnabled:function(t){return t.getParam("smart_paste",!0)},isPasteAsTextEnabled:function(t){return t.getParam("paste_as_text",!1)},getRetainStyleProps:function(t){return t.getParam("paste_retain_style_properties")},getWordValidElements:function(t){return t.getParam("paste_word_valid_elements","-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody")},shouldConvertWordFakeLists:function(t){return t.getParam("paste_convert_word_fake_lists",!0)},shouldUseDefaultFilters:function(t){return t.getParam("paste_enable_default_filters",!0)}};function ct(e,t){return K.each(t,function(t){e=t.constructor===RegExp?e.replace(t,""):e.replace(t[0],t[1])}),e}var lt={filter:ct,innerText:function ae(t){var e=ut(),n=ot({},e),r="",o=e.getShortEndedElements(),i=K.makeMap("script noscript style textarea video audio iframe object"," "),u=e.getBlockElements();return t=ct(t,[/<!\[[^\]]+\]>/g]),function a(t){var e=t.name,n=t;if("br"!==e){if("wbr"!==e)if(o[e]&&(r+=" "),i[e])r+=" ";else{if(3===t.type&&(r+=t.value),!t.shortEnded&&(t=t.firstChild))for(;a(t),t=t.next;);u[e]&&n.next&&(r+="\n","p"===e&&(r+="\n"))}}else r+="\n"}(n.parse(t)),r},trimHtml:function se(t){return t=ct(t,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,function r(t,e,n){return e||n?"\xa0":" "}],/<br class="Apple-interchange-newline">/g,/<br>$/i])},createIdGenerator:function ce(t){var e=0;return function(){return t+e++}},isMsEdge:function(){return-1!==f.navigator.userAgent.indexOf(" Edge/")}};function ft(e){var n,t;return t=[/^[IVXLMCD]{1,2}\.[ \u00a0]/,/^[ivxlmcd]{1,2}\.[ \u00a0]/,/^[a-z]{1,2}[\.\)][ \u00a0]/,/^[A-Z]{1,2}[\.\)][ \u00a0]/,/^[0-9]+\.[ \u00a0]/,/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/],e=e.replace(/^[\u00a0 ]+/,""),K.each(t,function(t){if(t.test(e))return!(n=!0)}),n}function dt(t){var i,u,a=1;function n(t){var e="";if(3===t.type)return t.value;if(t=t.firstChild)for(;e+=n(t),t=t.next;);return e}function s(t,e){if(3===t.type&&e.test(t.value))return t.value=t.value.replace(e,""),!1;if(t=t.firstChild)do{if(!s(t,e))return!1}while(t=t.next);return!0}function e(t,e,n){var r=t._listLevel||a;r!==a&&(i=r<a?i&&i.parent.parent:(u=i,null)),i&&i.name===e?i.append(t):(u=u||i,i=new it(e,1),1<n&&i.attr("start",""+n),t.wrap(i)),t.name="li",a<r&&u&&u.lastChild.append(i),a=r,function o(t){if(t._listIgnore)t.remove();else if(t=t.firstChild)for(;o(t),t=t.next;);}(t),s(t,/^\u00a0+/),s(t,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),s(t,/^\u00a0+/)}for(var r=[],o=t.firstChild;null!=o;)if(r.push(o),null!==(o=o.walk()))for(;void 0!==o&&o.parent!==t;)o=o.walk();for(var c=0;c<r.length;c++)if("p"===(t=r[c]).name&&t.firstChild){var l=n(t);if(/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(l)){e(t,"ul");continue}if(ft(l)){var f=/([0-9]+)\./.exec(l),d=1;f&&(d=parseInt(f[1],10)),e(t,"ol",d);continue}if(t._listLevel){e(t,"ul",1);continue}i=null}else u=i,i=null}function mt(n,r,o,i){var u,a={},t=n.dom.parseStyle(i);return K.each(t,function(t,e){switch(e){case"mso-list":(u=/\w+ \w+([0-9]+)/i.exec(i))&&(o._listLevel=parseInt(u[1],10)),/Ignore/i.test(t)&&o.firstChild&&(o._listIgnore=!0,o.firstChild._listIgnore=!0);break;case"horiz-align":e="text-align";break;case"vert-align":e="vertical-align";break;case"font-color":case"mso-foreground":e="color";break;case"mso-background":case"mso-highlight":e="background";break;case"font-weight":case"font-style":return void("normal"!==t&&(a[e]=t));case"mso-element":if(/^(comment|comment-list)$/i.test(t))return void o.remove()}0!==e.indexOf("mso-comment")?0!==e.indexOf("mso-")&&("all"===st.getRetainStyleProps(n)||r&&r[e])&&(a[e]=t):o.remove()}),/(bold)/i.test(a["font-weight"])&&(delete a["font-weight"],o.wrap(new it("b",1))),/(italic)/i.test(a["font-style"])&&(delete a["font-style"],o.wrap(new it("i",1))),(a=n.dom.serializeStyle(a,o.name))||null}function pt(t,e){return{content:t,cancelled:e}}function gt(t,e,n,r){var o=s(t,e,n,r);return t.hasEventListeners("PastePostProcess")&&!o.isDefaultPrevented()?function(t,e,n,r){var o=t.dom.create("div",{style:"display:none"},e),i=c(t,o,n,r);return pt(i.node.innerHTML,i.isDefaultPrevented())}(t,o.content,n,r):pt(o.content,o.isDefaultPrevented())}function ht(t,e){return t.insertContent(function(t,e){var n=t.dom.create("body",{},e);return K.each(n.querySelectorAll("meta"),function(t){return t.parentNode.removeChild(t)}),n.innerHTML}(t,e),{merge:st.shouldMergeFormats(t),paste:!0}),!0}function vt(t){return/^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(t)}function yt(t){return vt(t)&&/.(gif|jpe?g|png)$/.test(t)}function bt(t,e,n){return!(!1!==t.selection.isCollapsed()||!vt(e))&&function(t,e,n){return t.undoManager.extra(function(){n(t,e)},function(){t.execCommand("mceInsertLink",!1,e)}),!0}(t,e,n)}function wt(t,e,n){return!!yt(e)&&function(t,e,n){return t.undoManager.extra(function(){n(t,e)},function(){t.insertContent('<img src="'+e+'">')}),!0}(t,e,n)}function xt(t){return"\n"===t||"\r"===t}function _t(n){return function(t,e,n){return _(t,function(t){n=e(n,t)}),n}(n,function(t,e){return function(t){return-1!==" \f\t\x0B".indexOf(t)}(e)||"\xa0"===e?t.pcIsSpace||""===t.str||t.str.length===n.length-1||function(t,e){return e<t.length&&0<=e&&xt(t[e])}(n,t.str.length+1)?{pcIsSpace:!1,str:t.str+"\xa0"}:{pcIsSpace:!0,str:t.str+" "}:{pcIsSpace:xt(e),str:t.str+e}},{pcIsSpace:!1,str:""}).str}function Pt(t,e,n){var r=n||Q(e),o=Vt(t,J(e),r);!1===o.cancelled&&qt(t,o.content)}function Tt(t,e){var n=t.dom.encode(e).replace(/\r\n/g,"\n"),r=_t(n),o=rt(r,t.settings.forced_root_block,t.settings.forced_root_block_attrs);Pt(t,o,!1)}function Dt(t){var e={};if(t){if(t.getData){var n=t.getData("Text");n&&0<n.length&&-1===n.indexOf("data:text/mce-internal,")&&(e["text/plain"]=n)}if(t.types)for(var r=0;r<t.types.length;r++){var o=t.types[r];try{e[o]=t.getData(o)}catch(i){e[o]=""}}}return e}function Ct(t,e){return e in t&&0<t[e].length}function kt(t){return Ct(t,"text/html")||Ct(t,"text/plain")}function St(e,t,n){var r=function(t){return"paste"===t.type}(t)?t.clipboardData:t.dataTransfer;if(e.settings.paste_data_images&&r){var o=function(t){var e=t.items?x(O(t.items),function(t){return t.getAsFile()}):[],n=t.files?O(t.files):[];return function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n}(0<e.length?e:n,function(t){return/^image\/(jpeg|png|gif|bmp)$/.test(t.type)})}(r);if(0<o.length)return t.preventDefault(),function(t){return L(t,function(r){return z(function(t){var e=r.getAsFile?r.getAsFile():r,n=new window.FileReader;n.onload=function(){t({blob:e,uri:n.result})},n.readAsDataURL(e)})})}(o).get(function(t){n&&e.selection.setRng(n),_(t,function(t){!function(t,e){var n=function(t){var e;return-1!==(e=t.indexOf(","))?t.substr(e+1):null}(e.uri),r=Kt(),o=t.settings.images_reuse_filename&&e.blob.name?function(t,e){var n=e.match(/([\s\S]+?)\.(?:jpeg|jpg|png|gif)$/i);return n?t.dom.encode(n[1]):null}(t,e.blob.name):r,i=new f.Image;if(i.src=e.uri,function(t,e){return!t.images_dataimg_filter||t.images_dataimg_filter(e)}(t.settings,i)){var u,a=t.editorUpload.blobCache,s=void 0;(u=a.findFirst(function(t){return t.base64()===n}))?s=u:(s=a.create(r,e.blob,n,o),a.add(s)),Pt(t,'<img src="'+s.blobUri()+'">',!1)}else Pt(t,'<img src="'+e.uri+'">',!1)}(e,t)})}),!0}return!1}function Ft(t){return G.metaKeyPressed(t)&&86===t.keyCode||t.shiftKey&&45===t.keyCode}function It(u,a,i){var s,c=function(){var e=d(F.none());return{clear:function(){e.set(F.none())},set:function(t){e.set(F.some(t))},isSet:function(){return e.get().isSome()},on:function(t){e.get().each(t)}}}();function l(t,e,n,r){var o,i;Ct(t,"text/html")?o=t["text/html"]:(o=a.getHtml(),r=r||Q(o),a.isDefaultContent(o)&&(n=!0)),o=lt.trimHtml(o),a.remove(),i=!1===r&&nt(o),o.length&&!i||(n=!0),n&&(o=Ct(t,"text/plain")&&i?t["text/plain"]:lt.innerText(o)),a.isDefaultContent(o)?e||u.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):n?Tt(u,o):Pt(u,o,r)}u.on("keydown",function(t){function e(t){Ft(t)&&!t.isDefaultPrevented()&&a.remove()}if(Ft(t)&&!t.isDefaultPrevented()){if((s=t.shiftKey&&86===t.keyCode)&&V.webkit&&-1!==f.navigator.userAgent.indexOf("Version/"))return;if(t.stopImmediatePropagation(),c.set(t),window.setTimeout(function(){c.clear()},100),V.ie&&s)return t.preventDefault(),void m(u,!0);a.remove(),a.create(),u.once("keyup",e),u.once("paste",function(){u.off("keyup",e)})}}),u.on("paste",function(t){var e=c.isSet(),n=function(t,e){var n=Dt(e.clipboardData||t.getDoc().dataTransfer);return lt.isMsEdge()?K.extend(n,{"text/html":""}):n}(u,t),r="text"===i.get()||s,o=Ct(n,tt());s=!1,t.isDefaultPrevented()||function(t){var e=t.clipboardData;return-1!==f.navigator.userAgent.indexOf("Android")&&e&&e.items&&0===e.items.length}(t)?a.remove():kt(n)||!St(u,t,a.getLastRng()||u.selection.getRng())?(e||t.preventDefault(),!V.ie||e&&!t.ieFake||Ct(n,"text/html")||(a.create(),u.dom.bind(a.getEl(),"paste",function(t){t.stopPropagation()}),u.getDoc().execCommand("Paste",!1,null),n["text/html"]=a.getHtml()),Ct(n,"text/html")?(t.preventDefault(),o=o||Q(n["text/html"]),l(n,e,r,o)):q.setEditorTimeout(u,function(){l(n,e,r,o)},0)):a.remove()})}function Et(t){return V.ie&&t.inline?f.document.body:t.getBody()}function Ot(e,t,n){!function(t){return Et(t)!==t.getBody()}(e)||e.dom.bind(t,"paste keyup",function(t){Xt(e,n)||e.fire("paste")})}function Rt(t,e){return e===t}function At(t){var e=d(null),n="%MCEPASTEBIN%";return{create:function(){return function(t,e,n){var r,o=t.dom,i=t.getBody();e.set(t.selection.getRng()),r=t.dom.add(Et(t),"div",{id:"mcepastebin","class":"mce-pastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0"},n),(V.ie||V.gecko)&&o.setStyle(r,"left","rtl"===o.getStyle(i,"direction",!0)?65535:-65535),o.bind(r,"beforedeactivate focusin focusout",function(t){t.stopPropagation()}),Ot(t,r,n),r.focus(),t.selection.select(r,!0)}(t,e,n)},remove:function(){return function(t,e){if(Gt(t)){for(var n=void 0,r=e.get();n=t.dom.get("mcepastebin");)t.dom.remove(n),t.dom.unbind(n);r&&t.selection.setRng(r)}e.set(null)}(t,e)},getEl:function(){return Gt(t)},getHtml:function(){return function(n){function e(t,e){t.appendChild(e),n.dom.remove(e,!0)}var r,t,o,i,u;for(t=K.grep(Et(n).childNodes,function(t){return"mcepastebin"===t.id}),r=t.shift(),K.each(t,function(t){e(r,t)}),o=(i=n.dom.select("div[id=mcepastebin]",r)).length-1;0<=o;o--)u=n.dom.create("div"),r.insertBefore(u,i[o]),e(u,i[o]);return r?r.innerHTML:""}(t)},getLastRng:function(){return function(t){return t.get()}(e)},isDefault:function(){return Xt(t,n)},isDefaultContent:function(t){return Rt(n,t)}}}function jt(n,t){var e=At(n);return n.on("PreInit",function(){return function(u,t,e){var a;It(u,t,e),u.parser.addNodeFilter("img",function(t,e,n){function r(t){t.attr("data-mce-object")||a===V.transparentSrc||t.remove()}var o;if(!u.settings.paste_data_images&&((o=n).data&&!0===o.data.paste))for(var i=t.length;i--;)(a=t[i].attr("src"))&&(0===a.indexOf("webkit-fake-url")?r(t[i]):u.settings.allow_html_data_urls||0!==a.indexOf("data:")||r(t[i]))})}(n,e,t)}),{pasteFormat:t,pasteHtml:function(t,e){return Pt(n,t,e)},pasteText:function(t){return Tt(n,t)},pasteImageData:function(t,e){return St(n,t,e)},getDataTransferItems:Dt,hasHtmlOrText:kt,hasContentType:Ct}}function Mt(){}function Lt(t,e,n){if(!function(t){return!1===V.iOS&&t!==undefined&&"function"==typeof t.setData&&!0!==lt.isMsEdge()}(t))return!1;try{return t.clearData(),t.setData("text/html",e),t.setData("text/plain",n),t.setData(tt(),e),!0}catch(r){return!1}}function Nt(t,e,n,r){Lt(t.clipboardData,e.html,e.text)?(t.preventDefault(),r()):n(e.html,r)}function Bt(a){return function(t,e){var n=Z(t),r=a.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),o=a.dom.create("div",{contenteditable:"true"},n);a.dom.setStyles(r,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),r.appendChild(o),a.dom.add(a.getBody(),r);var i=a.selection.getRng();o.focus();var u=a.dom.createRng();u.selectNodeContents(o),a.selection.setRng(u),q.setTimeout(function(){a.selection.setRng(i),r.parentNode.removeChild(r),e()},0)}}function Ht(t){return{html:t.selection.getContent({contextual:!0}),text:t.selection.getContent({format:"text"})}}function $t(t){return!t.selection.isCollapsed()||function(t){return!!t.dom.getParent(t.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",t.getBody())}(t)}function Wt(t,e){return Zt.getCaretRangeFromPoint(e.clientX,e.clientY,t.getDoc())}function Ut(t,e){t.focus(),t.selection.setRng(e)}var zt={preProcess:function(t,e){return st.shouldUseDefaultFilters(t)?function(r,t){var e,o;(e=st.getRetainStyleProps(r))&&(o=K.makeMap(e.split(/[, ]/))),t=lt.filter(t,[/<br class="?Apple-interchange-newline"?>/gi,/<b[^>]+id="?docs-internal-[^>]*>/gi,/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\xa0"],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(t,e){return 0<e.length?e.replace(/./," ").slice(Math.floor(e.length/2)).split("").join("\xa0"):""}]]);var n=st.getWordValidElements(r),i=ut({valid_elements:n,valid_children:"-li[p]"});K.each(i.elements,function(t){t.attributes["class"]||(t.attributes["class"]={},t.attributesOrder.push("class")),t.attributes.style||(t.attributes.style={},t.attributesOrder.push("style"))});var u=ot({},i);u.addAttributeFilter("style",function(t){for(var e,n=t.length;n--;)(e=t[n]).attr("style",mt(r,o,e,e.attr("style"))),"span"===e.name&&e.parent&&!e.attributes.length&&e.unwrap()}),u.addAttributeFilter("class",function(t){for(var e,n,r=t.length;r--;)n=(e=t[r]).attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(n)&&e.remove(),e.attr("class",null)}),u.addNodeFilter("del",function(t){for(var e=t.length;e--;)t[e].remove()}),u.addNodeFilter("a",function(t){for(var e,n,r,o=t.length;o--;)if(n=(e=t[o]).attr("href"),r=e.attr("name"),n&&-1!==n.indexOf("#_msocom_"))e.remove();else if(n&&0===n.indexOf("file://")&&(n=(n=n.split("#")[1])&&"#"+n),n||r){if(r&&!/^_?(?:toc|edn|ftn)/i.test(r)){e.unwrap();continue}e.attr({href:n,name:r})}else e.unwrap()});var a=u.parse(t);return st.shouldConvertWordFakeLists(r)&&dt(a),t=at({validate:r.settings.validate},i).serialize(a)}(t,e):e},isWordContent:function le(t){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(t)||/class="OutlineElement/.test(t)||/id="?docs\-internal\-guid\-/.test(t)}},Vt=function(t,e,n){var r=zt.isWordContent(e),o=r?zt.preProcess(t,e):e;return gt(t,o,n,r)},qt=function(t,e){!1===st.isSmartPasteEnabled(t)?ht(t,e):function(e,n){K.each([bt,wt,ht],function(t){return!0!==t(e,n,ht)})}(t,e)},Kt=lt.createIdGenerator("mceclip"),Gt=function(t){return t.dom.get("mcepastebin")},Xt=function(t,e){var n=Gt(t);return function(t){return t&&"mcepastebin"===t.id}(n)&&Rt(e,n.innerHTML)},Yt=function(t){t.on("cut",function(e){return function(t){$t(e)&&Nt(t,Ht(e),Bt(e),function(){q.setTimeout(function(){e.execCommand("Delete")},0)})}}(t)),t.on("copy",function(e){return function(t){$t(e)&&Nt(t,Ht(e),Bt(e),Mt)}}(t))},Zt=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),Jt=function(i,u,a){st.shouldBlockDrop(i)&&i.on("dragend dragover draggesture dragdrop drop drag",function(t){t.preventDefault(),t.stopPropagation()}),st.shouldPasteDataImages(i)||i.on("drop",function(t){var e=t.dataTransfer;e&&e.files&&0<e.files.length&&t.preventDefault()}),i.on("drop",function(t){var e,n;if(n=Wt(i,t),!t.isDefaultPrevented()&&!a.get()){e=u.getDataTransferItems(t.dataTransfer);var r=u.hasContentType(e,tt());if((u.hasHtmlOrText(e)&&!function(t){var e=t["text/plain"];return!!e&&0===e.indexOf("file://")}(e)||!u.pasteImageData(t,n))&&n&&st.shouldFilterDrop(i)){var o=e["mce-internal"]||e["text/html"]||e["text/plain"];o&&(t.preventDefault(),q.setEditorTimeout(i,function(){i.undoManager.transact(function(){e["mce-internal"]&&i.execCommand("Delete"),Ut(i,n),o=lt.trimHtml(o),e["text/html"]?u.pasteHtml(o,r):u.pasteText(o)})}))}}}),i.on("dragstart",function(t){a.set(!0)}),i.on("dragover dragend",function(t){st.shouldPasteDataImages(i)&&!1===a.get()&&(t.preventDefault(),Ut(i,Wt(i,t))),"dragend"===t.type&&a.set(!1)})},Qt=function(t){var e=t.plugins.paste,n=st.getPreProcess(t);n&&t.on("PastePreProcess",function(t){n.call(e,e,t)});var r=st.getPostProcess(t);r&&t.on("PastePostProcess",function(t){r.call(e,e,t)})};function te(e,n){e.on("PastePreProcess",function(t){t.content=n(e,t.content,t.internal,t.wordContent)})}function ee(t,e){if(!zt.isWordContent(e))return e;var n=[];K.each(t.schema.getBlockElements(),function(t,e){n.push(e)});var r=new RegExp("(?:<br> [\\s\\r\\n]+|<br>)*(<\\/?("+n.join("|")+")[^>]*>)(?:<br> [\\s\\r\\n]+|<br>)*","g");return e=lt.filter(e,[[r,"$1"]]),e=lt.filter(e,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function ne(t,e,n,r){if(r||n)return e;var c,o=st.getWebkitStyles(t);if(!1===st.shouldRemoveWebKitStyles(t)||"all"===o)return e;if(o&&(c=o.split(/[, ]/)),c){var l=t.dom,f=t.selection.getNode();e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(t,e,n,r){var o=l.parseStyle(l.decode(n)),i={};if("none"===c)return e+r;for(var u=0;u<c.length;u++){var a=o[c[u]],s=l.getStyle(f,c[u],!0);/color/.test(c[u])&&(a=l.toHex(a),s=l.toHex(s)),s!==a&&(i[c[u]]=a)}return(i=l.serializeStyle(i,"span"))?e+' style="'+i+'"'+r:e+r})}else e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return e=e.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(t,e,n,r){return e+' style="'+n+'"'+r})}function re(n,t){n.$("a",t).find("font,u").each(function(t,e){n.dom.remove(e,!0)})}function oe(n,r){return function(e){e.setActive("text"===r.pasteFormat.get());function t(t){return e.setActive(t.state)}return n.on("PastePlainTextToggle",t),function(){return n.off("PastePlainTextToggle",t)}}}var ie=function(t){V.webkit&&te(t,ne),V.ie&&(te(t,ee),function r(e,n){e.on("PastePostProcess",function(t){n(e,t.node)})}(t,re))},ue=function(t,e){t.ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:oe(t,e)}),t.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:oe(t,e)})};!function fe(){r.add("paste",function(t){if(!1===u(t)){var e=d(!1),n=d(st.isPasteAsTextEnabled(t)?"text":"html"),r=jt(t,n),o=ie(t);return ue(t,r),p(t,r),Qt(t),Yt(t),Jt(t,r,e),a(r,o)}})}()}(window);
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
|
-
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),d=tinymce.util.Tools.resolve("tinymce.util.Tools"),l=function(e){return e.getParam("content_style","")},m=function(e){return e.getParam("content_css_cors",!1,"boolean")},
|
9
|
+
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),d=tinymce.util.Tools.resolve("tinymce.util.Tools"),l=function(e){return e.getParam("content_style","")},m=function(e){return e.getParam("content_css_cors",!1,"boolean")},n=function(t){var n="",i=t.dom.encode,e=l(t);n+='<base href="'+i(t.documentBaseURI.getURI())+'">',e&&(n+='<style type="text/css">'+e+"</style>");var o=m(t)?' crossorigin="anonymous"':"";d.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=t.getBody().dir,s=c?' dir="'+i(c)+'"':"";return"<!DOCTYPE html><html><head>"+n+'</head><body id="'+i(r)+'" class="mce-content-body '+i(a)+'"'+s+">"+t.getContent()+'<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A") {e.preventDefault();}}}, false);<\/script> </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,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
9
|
!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.ie&&t.ie<=11?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,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
|
-
!function(t){"use strict";var e,n,r,o,i=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=0,u=function(e,n,r){var t,o,i;e.plugins.table?e.plugins.table.insertTable(n,r):(o=n,i=r,(t=e).undoManager.transact(function(){var e,n;t.insertContent(function(e,n){var r,t,o;for(o='<table data-mce-id="mce" style="width: 100%">',o+="<tbody>",t=0;t<n;t++){for(o+="<tr>",r=0;r<e;r++)o+="<td><br></td>";o+="</tr>"}return o+="</tbody>",o+="</table>"}(o,i)),(e=t.dom.select("*[data-mce-id]")[0]).removeAttribute("data-mce-id"),n=t.dom.select("td,th",e),t.selection.setCursorLocation(n[0],0)}))},s=function(e,n,r){var t,o,i,u;o=(t=e.editorUpload.blobCache).create((i="mceu",u=(new Date).getTime(),i+"_"+Math.floor(1e9*Math.random())+ ++a+String(u)),r,n),t.add(o),e.insertContent(e.dom.createHTML("img",{src:o.blobUri()}))},c=tinymce.util.Tools.resolve("tinymce.util.Promise"),f=function(r){return new c(function(e){var n=new t.FileReader;n.onloadend=function(){e(n.result.split(",")[1])},n.readAsDataURL(r)})},d=function(){return new c(function(n){var e;(e=t.document.createElement("input")).type="file",e.style.position="fixed",e.style.left=0,e.style.top=0,e.style.opacity=.001,t.document.body.appendChild(e),e.onchange=function(e){n(Array.prototype.slice.call(e.target.files))},e.click(),e.parentNode.removeChild(e)})},l=function(r){r.ui.registry.addButton("quickimage",{icon:"image",tooltip:"Insert image",onAction:function(){d().then(function(e){var n=e[0];f(n).then(function(e){s(r,e,n)})})}}),r.ui.registry.addButton("quicktable",{icon:"table",tooltip:"Insert table",onAction:function(){u(r,2,2)}})},v=function(e){return function(){return e}},m=v(!1),g=v(!0),h=m,p=g,N=function(){return O},O=(o={fold:function(e,n){return e()},is:h,isSome:h,isNone:p,getOr:r=function(e){return e},getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:r,orThunk:n,map:N,ap:N,each:function(){},bind:N,flatten:N,exists:h,forall:p,filter:N,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:v("none()")},Object.freeze&&Object.freeze(o),o),b=function(r){var e=function(){return r},n=function(){return o},t=function(e){return e(r)},o={fold:function(e,n){return n(r)},is:function(e){return r===e},isSome:p,isNone:h,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return b(e(r))},ap:function(e){return e.fold(N,function(e){return b(e(r))})},each:function(e){e(r)},bind:t,flatten:e,exists:t,forall:t,filter:function(e){return e(r)?o:O},equals:function(e){return e.is(r)},equals_:function(e,n){return e.fold(h,function(e){return n(r,e)})},toArray:function(){return[r]},toString:function(){return"some("+r+")"}};return o},E={some:b,none:N,from:function(e){return null===e||e===undefined?O:b(e)}},w=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:v(e)}},T={fromHtml:function(e,n){var r=(n||t.document).createElement("div");if(r.innerHTML=e,!r.hasChildNodes()||1<r.childNodes.length)throw t.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return w(r.childNodes[0])},fromTag:function(e,n){var r=(n||t.document).createElement(e);return w(r)},fromText:function(e,n){var r=(n||t.document).createTextNode(e);return w(r)},fromDom:w,fromPoint:function(e,n,r){var t=e.dom();return E.from(t.elementFromPoint(n,r)).map(w)}},S=(t.Node.ATTRIBUTE_NODE,t.Node.CDATA_SECTION_NODE,t.Node.COMMENT_NODE,t.Node.DOCUMENT_NODE,t.Node.DOCUMENT_TYPE_NODE,t.Node.DOCUMENT_FRAGMENT_NODE,t.Node.ELEMENT_NODE),y=(t.Node.TEXT_NODE,t.Node.PROCESSING_INSTRUCTION_NODE,t.Node.ENTITY_REFERENCE_NODE,t.Node.ENTITY_NODE,t.Node.NOTATION_NODE,"undefined"!=typeof t.window?t.window:Function("return this;")(),function(n){return function(e){return function(e){if(null===e)return"null";var n=typeof e;return"object"===n&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===n&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":n}(e)===n}}),x=y("string"),k=y("object"),D=y("array"),_=y("boolean"),C=y("undefined"),A=y("function"),R=Array.prototype.slice;A(Array.from)&&Array.from;function I(e,n,r,t,o){return e(r,t)?E.some(r):A(o)&&o(r)?E.none():n(r,t,o)}var M,q,L,P,F=function(e,n,r){return 0!=(e.compareDocumentPosition(n)&r)},U=function(e,n){return F(e,n,t.Node.DOCUMENT_POSITION_CONTAINED_BY)},B=function(e,n){var r=function(e,n){for(var r=0;r<e.length;r++){var t=e[r];if(t.test(n))return t}return undefined}(e,n);if(!r)return{major:0,minor:0};var t=function(e){return Number(n.replace(r,"$"+e))};return H(t(1),t(2))},j=function(){return H(0,0)},H=function(e,n){return{major:e,minor:n}},X={nu:H,detect:function(e,n){var r=String(n).toLowerCase();return 0===e.length?j():B(e,r)},unknown:j},z="Firefox",G=function(e,n){return function(){return n===e}},W=function(e){var n=e.current;return{current:n,version:e.version,isEdge:G("Edge",n),isChrome:G("Chrome",n),isIE:G("IE",n),isOpera:G("Opera",n),isFirefox:G(z,n),isSafari:G("Safari",n)}},Y={unknown:function(){return W({current:undefined,version:X.unknown()})},nu:W,edge:v("Edge"),chrome:v("Chrome"),ie:v("IE"),opera:v("Opera"),firefox:v(z),safari:v("Safari")},$="Windows",V="Android",J="Solaris",K="FreeBSD",Q=function(e,n){return function(){return n===e}},Z=function(e){var n=e.current;return{current:n,version:e.version,isWindows:Q($,n),isiOS:Q("iOS",n),isAndroid:Q(V,n),isOSX:Q("OSX",n),isLinux:Q("Linux",n),isSolaris:Q(J,n),isFreeBSD:Q(K,n)}},ee={unknown:function(){return Z({current:undefined,version:X.unknown()})},nu:Z,windows:v($),ios:v("iOS"),android:v(V),linux:v("Linux"),osx:v("OSX"),solaris:v(J),freebsd:v(K)},ne=function(e,n){var r=String(n).toLowerCase();return function(e,n){for(var r=0,t=e.length;r<t;r++){var o=e[r];if(n(o,r,e))return E.some(o)}return E.none()}(e,function(e){return e.search(r)})},re=function(e,r){return ne(e,r).map(function(e){var n=X.detect(e.versionRegexes,r);return{current:e.name,version:n}})},te=function(e,r){return ne(e,r).map(function(e){var n=X.detect(e.versionRegexes,r);return{current:e.name,version:n}})},oe=function(e,n){return-1!==e.indexOf(n)},ie=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,ue=function(n){return function(e){return oe(e,n)}},ae=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return oe(e,"edge/")&&oe(e,"chrome")&&oe(e,"safari")&&oe(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,ie],search:function(e){return oe(e,"chrome")&&!oe(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return oe(e,"msie")||oe(e,"trident")}},{name:"Opera",versionRegexes:[ie,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:ue("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:ue("firefox")},{name:"Safari",versionRegexes:[ie,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(oe(e,"safari")||oe(e,"mobile/"))&&oe(e,"applewebkit")}}],se=[{name:"Windows",search:ue("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return oe(e,"iphone")||oe(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:ue("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:ue("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:ue("linux"),versionRegexes:[]},{name:"Solaris",search:ue("sunos"),versionRegexes:[]},{name:"FreeBSD",search:ue("freebsd"),versionRegexes:[]}],ce={browsers:v(ae),oses:v(se)},fe=function(e){var n,r,t,o,i,u,a,s,c,f,d,l=ce.browsers(),m=ce.oses(),g=re(l,e).fold(Y.unknown,Y.nu),h=te(m,e).fold(ee.unknown,ee.nu);return{browser:g,os:h,deviceType:(r=g,t=e,o=(n=h).isiOS()&&!0===/ipad/i.test(t),i=n.isiOS()&&!o,u=n.isAndroid()&&3===n.version.major,a=n.isAndroid()&&4===n.version.major,s=o||u||a&&!0===/mobile/i.test(t),c=n.isiOS()||n.isAndroid(),f=c&&!s,d=r.isSafari()&&n.isiOS()&&!1===/safari/i.test(t),{isiPad:v(o),isiPhone:v(i),isTablet:v(s),isPhone:v(f),isTouch:v(c),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:v(d)})}},de=(L=!(M=function(){var e=t.navigator.userAgent;return fe(e)}),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return L||(L=!0,q=M.apply(null,e)),q}),le=S,me=function(e,n){var r=e.dom();if(r.nodeType!==le)return!1;var t=r;if(t.matches!==undefined)return t.matches(n);if(t.msMatchesSelector!==undefined)return t.msMatchesSelector(n);if(t.webkitMatchesSelector!==undefined)return t.webkitMatchesSelector(n);if(t.mozMatchesSelector!==undefined)return t.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")},ge=({detect:de}.detect().browser.isIE(),function(e,n,r){for(var t=e.dom(),o=A(r)?r:v(!1);t.parentNode;){t=t.parentNode;var i=T.fromDom(t);if(n(i))return E.some(i);if(o(i))break}return E.none()}),he=function(e,n,r){return ge(e,function(e){return me(e,n)},r)},ve={getToolbarItemsOr:(P=x,function(e,n,r){return function(e,n){if(!n(e))throw new Error("Default value doesn't match requested type.")}(r,P),function(e,n){if(D(e)||k(e))throw new Error("expected a string but found: "+e);return C(e)?n:_(e)?!1===e?"":n:e}(e.getParam(n,r),r)})},pe=function(e){return ve.getToolbarItemsOr(e,"quickbars_selection_toolbar","bold italic | quicklink h2 h3 blockquote")},Ne=function(e){return ve.getToolbarItemsOr(e,"quickbars_insert_toolbar","quickimage quicktable")},Oe=function(a){var e=Ne(a);0<e.trim().length&&a.ui.registry.addContextToolbar("quickblock",{predicate:function(e){var n,r,t,o=T.fromDom(e),i=a.schema.getTextBlockElements(),u=function(e){return e.dom()===a.getBody()};return(n=o,r="table",t=u,I(me,he,n,r,t)).fold(function(){return(e=o,n=function(e){return e.dom().nodeName.toLowerCase()in i&&a.dom.isEmpty(e.dom())},r=u,I(function(e,n){return n(e)},ge,e,n,r)).isSome();var e,n,r},function(){return!1})},items:e,position:"line",scope:"editor"})},be=function(n){n.ui.registry.addContextToolbar("imageselection",{predicate:function(e){return"IMG"===e.nodeName||"FIGURE"===e.nodeName&&/image/i.test(e.className)},items:"alignleft aligncenter alignright",position:"node"});var e=pe(n);0<e.trim().length&&n.ui.registry.addContextToolbar("textselection",{predicate:function(e){return!n.selection.isCollapsed()},items:e,position:"selection"})};!function Ee(){i.add("quickbars",function(e){l(e),Oe(e),be(e)})}()}(window);
|
9
|
+
!function(t){"use strict";function e(){}function d(e){return function(){return e}}function n(){return h}var r,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=0,u=function(e,n,r){e.plugins.table?e.plugins.table.insertTable(n,r):function(r,t,o){r.undoManager.transact(function(){var e,n;r.insertContent(function(e,n){var r,t,o;for(o='<table data-mce-id="mce" style="width: 100%">',o+="<tbody>",t=0;t<n;t++){for(o+="<tr>",r=0;r<e;r++)o+="<td><br></td>";o+="</tr>"}return o+="</tbody>",o+="</table>"}(t,o)),(e=function(e){return e.dom.select("*[data-mce-id]")[0]}(r)).removeAttribute("data-mce-id"),n=r.dom.select("td,th",e),r.selection.setCursorLocation(n[0],0)})}(e,n,r)},a=function(e,n,r){var t,o;o=(t=e.editorUpload.blobCache).create(function(e){var n=(new Date).getTime();return e+"_"+Math.floor(1e9*Math.random())+ ++i+String(n)}("mceu"),r,n),t.add(o),e.insertContent(e.dom.createHTML("img",{src:o.blobUri()}))},s=tinymce.util.Tools.resolve("tinymce.util.Promise"),c=function(r){return new s(function(e){var n=new t.FileReader;n.onloadend=function(){e(n.result.split(",")[1])},n.readAsDataURL(r)})},f=function(){return new s(function(n){var e;(e=t.document.createElement("input")).type="file",e.style.position="fixed",e.style.left=0,e.style.top=0,e.style.opacity=.001,t.document.body.appendChild(e),e.onchange=function(e){n(Array.prototype.slice.call(e.target.files))},e.click(),e.parentNode.removeChild(e)})},l=function(r){r.ui.registry.addButton("quickimage",{icon:"image",tooltip:"Insert image",onAction:function(){f().then(function(e){var n=e[0];c(n).then(function(e){a(r,e,n)})})}}),r.ui.registry.addButton("quicktable",{icon:"table",tooltip:"Insert table",onAction:function(){u(r,2,2)}})},m=d(!1),g=d(!0),h=(r={fold:function(e,n){return e()},is:m,isSome:m,isNone:g,getOr:N,getOrThunk:p,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:d(null),getOrUndefined:d(undefined),or:N,orThunk:p,map:n,each:e,bind:n,exists:m,forall:g,filter:n,equals:v,equals_:v,toArray:function(){return[]},toString:d("none()")},Object.freeze&&Object.freeze(r),r);function v(e){return e.isNone()}function p(e){return e()}function N(e){return e}function O(n){return function(e){return function(e){if(null===e)return"null";var n=typeof e;return"object"==n&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":n}(e)===n}}var b=function(r){function e(){return o}function n(e){return e(r)}var t=d(r),o={fold:function(e,n){return n(r)},is:function(e){return r===e},isSome:g,isNone:m,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:e,orThunk:e,map:function(e){return b(e(r))},each:function(e){e(r)},bind:n,exists:n,forall:n,filter:function(e){return e(r)?o:h},toArray:function(){return[r]},toString:function(){return"some("+r+")"},equals:function(e){return e.is(r)},equals_:function(e,n){return e.fold(m,function(e){return n(r,e)})}};return o},E={some:b,none:n,from:function(e){return null===e||e===undefined?h:b(e)}},w=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:d(e)}},T={fromHtml:function(e,n){var r=(n||t.document).createElement("div");if(r.innerHTML=e,!r.hasChildNodes()||1<r.childNodes.length)throw t.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return w(r.childNodes[0])},fromTag:function(e,n){var r=(n||t.document).createElement(e);return w(r)},fromText:function(e,n){var r=(n||t.document).createTextNode(e);return w(r)},fromDom:w,fromPoint:function(e,n,r){var t=e.dom();return E.from(t.elementFromPoint(n,r)).map(w)}},S=(t.Node.ATTRIBUTE_NODE,t.Node.CDATA_SECTION_NODE,t.Node.COMMENT_NODE,t.Node.DOCUMENT_NODE,t.Node.DOCUMENT_TYPE_NODE,t.Node.DOCUMENT_FRAGMENT_NODE,t.Node.ELEMENT_NODE),y=(t.Node.TEXT_NODE,t.Node.PROCESSING_INSTRUCTION_NODE,t.Node.ENTITY_REFERENCE_NODE,t.Node.ENTITY_NODE,t.Node.NOTATION_NODE,"undefined"!=typeof t.window?t.window:Function("return this;")(),O("string")),x=O("object"),k=O("array"),D=O("boolean"),_=O("undefined"),C=O("function"),A=Array.prototype.slice;C(Array.from)&&Array.from;function R(e,n,r,t,o){return e(r,t)?E.some(r):C(o)&&o(r)?E.none():n(r,t,o)}function I(e,n,r){return 0!=(e.compareDocumentPosition(n)&r)}function M(e,n){var r=function(e,n){for(var r=0;r<e.length;r++){var t=e[r];if(t.test(n))return t}return undefined}(e,n);if(!r)return{major:0,minor:0};function t(e){return Number(n.replace(r,"$"+e))}return V(t(1),t(2))}function q(e,n){return function(){return n===e}}function L(e,n){return function(){return n===e}}function P(e,n){var r=String(n).toLowerCase();return function(e,n){for(var r=0,t=e.length;r<t;r++){var o=e[r];if(n(o,r))return E.some(o)}return E.none()}(e,function(e){return e.search(r)})}function F(e,n){return-1!==e.indexOf(n)}function U(n){return function(e){return F(e,n)}}function B(e,n){var r=e.dom();if(r.nodeType!==ge)return!1;var t=r;if(t.matches!==undefined)return t.matches(n);if(t.msMatchesSelector!==undefined)return t.msMatchesSelector(n);if(t.webkitMatchesSelector!==undefined)return t.webkitMatchesSelector(n);if(t.mozMatchesSelector!==undefined)return t.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")}function j(e,n,r){for(var t=e.dom(),o=C(r)?r:d(!1);t.parentNode;){t=t.parentNode;var i=T.fromDom(t);if(n(i))return E.some(i);if(o(i))break}return E.none()}function H(e,n,r){return j(e,function(e){return B(e,n)},r)}var X,z,G,W,Y=function(e,n){return I(e,n,t.Node.DOCUMENT_POSITION_CONTAINED_BY)},$=function(){return V(0,0)},V=function(e,n){return{major:e,minor:n}},J={nu:V,detect:function(e,n){var r=String(n).toLowerCase();return 0===e.length?$():M(e,r)},unknown:$},K="Firefox",Q=function(e){var n=e.current;return{current:n,version:e.version,isEdge:q("Edge",n),isChrome:q("Chrome",n),isIE:q("IE",n),isOpera:q("Opera",n),isFirefox:q(K,n),isSafari:q("Safari",n)}},Z={unknown:function(){return Q({current:undefined,version:J.unknown()})},nu:Q,edge:d("Edge"),chrome:d("Chrome"),ie:d("IE"),opera:d("Opera"),firefox:d(K),safari:d("Safari")},ee="Windows",ne="Android",re="Solaris",te="FreeBSD",oe=function(e){var n=e.current;return{current:n,version:e.version,isWindows:L(ee,n),isiOS:L("iOS",n),isAndroid:L(ne,n),isOSX:L("OSX",n),isLinux:L("Linux",n),isSolaris:L(re,n),isFreeBSD:L(te,n)}},ie={unknown:function(){return oe({current:undefined,version:J.unknown()})},nu:oe,windows:d(ee),ios:d("iOS"),android:d(ne),linux:d("Linux"),osx:d("OSX"),solaris:d(re),freebsd:d(te)},ue=function(e,r){return P(e,r).map(function(e){var n=J.detect(e.versionRegexes,r);return{current:e.name,version:n}})},ae=function(e,r){return P(e,r).map(function(e){var n=J.detect(e.versionRegexes,r);return{current:e.name,version:n}})},se=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,ce=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return F(e,"edge/")&&F(e,"chrome")&&F(e,"safari")&&F(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,se],search:function(e){return F(e,"chrome")&&!F(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return F(e,"msie")||F(e,"trident")}},{name:"Opera",versionRegexes:[se,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:U("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:U("firefox")},{name:"Safari",versionRegexes:[se,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(F(e,"safari")||F(e,"mobile/"))&&F(e,"applewebkit")}}],fe=[{name:"Windows",search:U("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return F(e,"iphone")||F(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:U("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:U("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:U("linux"),versionRegexes:[]},{name:"Solaris",search:U("sunos"),versionRegexes:[]},{name:"FreeBSD",search:U("freebsd"),versionRegexes:[]}],de={browsers:d(ce),oses:d(fe)},le=function(e){var n=de.browsers(),r=de.oses(),t=ue(n,e).fold(Z.unknown,Z.nu),o=ae(r,e).fold(ie.unknown,ie.nu);return{browser:t,os:o,deviceType:function(e,n,r){var t=e.isiOS()&&!0===/ipad/i.test(r),o=e.isiOS()&&!t,i=e.isAndroid()&&3===e.version.major,u=e.isAndroid()&&4===e.version.major,a=t||i||u&&!0===/mobile/i.test(r),s=e.isiOS()||e.isAndroid(),c=s&&!a,f=n.isSafari()&&e.isiOS()&&!1===/safari/i.test(r);return{isiPad:d(t),isiPhone:d(o),isTablet:d(a),isPhone:d(c),isTouch:d(s),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:d(f)}}(o,t,e)}},me=(G=!(X=function(){var e=t.navigator.userAgent;return le(e)}),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return G||(G=!0,z=X.apply(null,e)),z}),ge=S,he=({detect:me}.detect().browser.isIE(),{getToolbarItemsOr:(W=y,function(e,n,r){return function(e,n){if(!n(e))throw new Error("Default value doesn't match requested type.")}(r,W),function(e,n){if(k(e)||x(e))throw new Error("expected a string but found: "+e);return _(e)?n:D(e)?!1===e?"":n:e}(e.getParam(n,r),r)})}),ve=function(e){return he.getToolbarItemsOr(e,"quickbars_selection_toolbar","bold italic | quicklink h2 h3 blockquote")},pe=function(e){return he.getToolbarItemsOr(e,"quickbars_insert_toolbar","quickimage quicktable")},Ne=function(o){var e=pe(o);0<e.trim().length&&o.ui.registry.addContextToolbar("quickblock",{predicate:function(e){function n(e){return e.dom()===o.getBody()}var r=T.fromDom(e),t=o.schema.getTextBlockElements();return function(e,n,r){return R(B,H,e,n,r)}(r,"table",n).fold(function(){return function(e,n,r){return R(function(e,n){return n(e)},j,e,n,r)}(r,function(e){return function(e){return e.dom().nodeName.toLowerCase()}(e)in t&&o.dom.isEmpty(e.dom())},n).isSome()},function(){return!1})},items:e,position:"line",scope:"editor"})},Oe=function(n){n.ui.registry.addContextToolbar("imageselection",{predicate:function(e){return"IMG"===e.nodeName||"FIGURE"===e.nodeName&&/image/i.test(e.className)},items:"alignleft aligncenter alignright",position:"node"});var e=ve(n);0<e.trim().length&&n.ui.registry.addContextToolbar("textselection",{predicate:function(e){return!n.selection.isCollapsed()},items:e,position:"selection"})};!function be(){o.add("quickbars",function(e){l(e),Ne(e),Oe(e)})}()}(window);
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
|
-
!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),
|
9
|
+
!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,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
|
-
!function(){"use strict";var
|
9
|
+
!function(){"use strict";var l=function(e){function t(){return n}var n=e;return{get:t,set:function(e){n=e},clone:function(){return l(t())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),g=function(){return(g=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},p=tinymce.util.Tools.resolve("tinymce.util.Tools");function x(e){return e&&1===e.nodeType&&"false"===e.contentEditable}function h(e){var t=e.getAttribute("data-mce-index");return"number"==typeof t?""+t:t}function v(e){var t=e.parentNode;e.firstChild&&t.insertBefore(e.firstChild,e),e.parentNode.removeChild(e)}function c(e,t){var n,r=[];if((n=p.toArray(e.getBody().getElementsByTagName("span"))).length)for(var o=0;o<n.length;o++){var a=h(n[o]);null!==a&&a.length&&a===t.toString()&&r.push(n[o])}return r}function u(e,t,n){var r=t.get(),o=r.index,a=e.dom;(n=!1!==n)?o+1===r.count?o=0:o++:o-1==-1?o=r.count-1:o--,a.removeClass(c(e,r.index),"mce-match-marker-selected");var i=c(e,o);return i.length?(a.addClass(c(e,o),"mce-match-marker-selected"),e.selection.scrollIntoView(i[0]),o):-1}function b(e,t){var n=t.parentNode;e.remove(t),e.isEmpty(n)&&e.remove(n)}function s(e,t,n,r,o){n=(n=n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")).replace(/\s/g,"[^\\S\\r\\n]"),n=o?"\\b"+n+"\\b":n;var a=function(e,t,n){var r,o;return(o=e.dom.create("span",{"data-mce-bogus":1})).className="mce-match-marker",r=e.getBody(),m(e,t,!1),d.findAndReplaceDOMText(n,r,o,!1,e.schema)}(e,t,new RegExp(n,r?"g":"gi"));if(a){var i=u(e,t,!0);t.set({index:i,count:a,text:n,matchCase:r,wholeWord:o})}return a}function y(e,t){var n=u(e,t,!0);t.set(g(g({},t.get()),{index:n}))}function N(e,t){var n=u(e,t,!1);t.set(g(g({},t.get()),{index:n}))}function w(e){var t=h(e);return null!==t&&0<t.length}function f(e,t,n,r,o){var a,i,c,u,d,l=t.get(),s=l.index,f=s;for(r=!1!==r,c=e.getBody(),i=p.grep(p.toArray(c.getElementsByTagName("span")),w),a=0;a<i.length;a++){var m=h(i[a]);if(u=d=parseInt(m,10),o||u===l.index){for(n.length?(i[a].firstChild.nodeValue=n,v(i[a])):b(e.dom,i[a]);i[++a];){if((u=parseInt(h(i[a]),10))!==d){a--;break}b(e.dom,i[a])}r&&f--}else s<d&&i[a].setAttribute("data-mce-index",String(d-1))}return t.set(g(g({},l),{count:o?0:l.count-1,index:f})),r?y(e,t):N(e,t),!o&&0<t.get().count}function t(){}function a(e){return function(){return e}}function n(){return O}var r,d={findAndReplaceDOMText:function P(e,t,n,r,o){var a,i,h,f,m,g,c=[],u=0;function d(e,t){if(t=t||0,!e[0])throw new Error("findAndReplaceDOMText cannot handle zero-length matches");var n=e.index;if(0<t){var r=e[t];if(!r)throw new Error("Invalid capture group");n+=e[0].indexOf(r),e[0]=r}return[n,n+e[0].length,[e[0]]]}if(h=t.ownerDocument,f=o.getBlockElements(),m=o.getWhiteSpaceElements(),g=o.getShortEndedElements(),i=function l(e){var t;if(3===e.nodeType)return e.data;if(m[e.nodeName]&&!f[e.nodeName])return"";if(t="",x(e))return"\n";if((f[e.nodeName]||g[e.nodeName])&&(t+="\n"),e=e.firstChild)for(;t+=l(e),e=e.nextSibling;);return t}(t)){if(e.global)for(;a=e.exec(i);)c.push(d(a,r));else a=i.match(e),c.push(d(a,r));return c.length&&(u=c.length,function p(e,t,n){var r,o,a,i,c=[],u=0,d=e,l=t.shift(),s=0;e:for(;;){if((f[d.nodeName]||g[d.nodeName]||x(d))&&u++,3===d.nodeType&&(!o&&d.length+u>=l[1]?(o=d,i=l[1]-u):r&&c.push(d),!r&&d.length+u>l[0]&&(r=d,a=l[0]-u),u+=d.length),r&&o){if(d=n({startNode:r,startNodeIndex:a,endNode:o,endNodeIndex:i,innerNodes:c,match:l[2],matchIndex:s}),u-=o.length-i,o=r=null,c=[],s++,!(l=t.shift()))break}else if(m[d.nodeName]&&!f[d.nodeName]||!d.firstChild){if(d.nextSibling){d=d.nextSibling;continue}}else if(!x(d)){d=d.firstChild;continue}for(;;){if(d.nextSibling){d=d.nextSibling;break}if(d.parentNode===e)break e;d=d.parentNode}}}(t,c,function s(e){var p;if("function"!=typeof e){var r=e.nodeType?e:h.createElement(e);p=function(e,t){var n=r.cloneNode(!1);return n.setAttribute("data-mce-index",t),e&&n.appendChild(h.createTextNode(e)),n}}else p=e;return function(e){var t,n,r,o=e.startNode,a=e.endNode,i=e.matchIndex;if(o===a){var c=o;r=c.parentNode,0<e.startNodeIndex&&(t=h.createTextNode(c.data.substring(0,e.startNodeIndex)),r.insertBefore(t,c));var u=p(e.match[0],i);return r.insertBefore(u,c),e.endNodeIndex<c.length&&(n=h.createTextNode(c.data.substring(e.endNodeIndex)),r.insertBefore(n,c)),c.parentNode.removeChild(c),u}t=h.createTextNode(o.data.substring(0,e.startNodeIndex)),n=h.createTextNode(a.data.substring(e.endNodeIndex));for(var d=p(o.data.substring(e.startNodeIndex),i),l=0,s=e.innerNodes.length;l<s;++l){var f=e.innerNodes[l],m=p(f.data,i);f.parentNode.replaceChild(m,f)}var g=p(a.data.substring(0,e.endNodeIndex),i);return(r=o.parentNode).insertBefore(t,o),r.insertBefore(d,o),r.removeChild(o),(r=a.parentNode).insertBefore(g,a),r.insertBefore(n,a),r.removeChild(a),g}}(n))),u}}},m=function(e,t,n){var r,o,a,i,c=t.get();for(o=p.toArray(e.getBody().getElementsByTagName("span")),r=0;r<o.length;r++){var u=h(o[r]);null!==u&&u.length&&(u===c.index.toString()&&(a=a||o[r].firstChild,i=o[r].firstChild),v(o[r]))}if(t.set(g(g({},c),{index:-1,count:0,text:""})),a&&i){var d=e.dom.createRng();return d.setStart(a,0),d.setEnd(i,i.data.length),!1!==n&&e.selection.setRng(d),d}},o=function(r,o){return{done:function(e){return m(r,o,e)},find:function(e,t,n){return s(r,o,e,t,n)},next:function(){return y(r,o)},prev:function(){return N(r,o)},replace:function(e,t,n){return f(r,o,e,t,n)}}},i=a(!1),C=a(!0),O=(r={fold:function(e,t){return e()},is:i,isSome:i,isNone:C,getOr:A,getOrThunk:T,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:a(null),getOrUndefined:a(undefined),or:A,orThunk:T,map:n,each:t,bind:n,exists:i,forall:C,filter:n,equals:S,equals_:S,toArray:function(){return[]},toString:a("none()")},Object.freeze&&Object.freeze(r),r);function S(e){return e.isNone()}function T(e){return e()}function A(e){return e}function B(e,t){return function(){D(e,t)}}var I,k=function(n){function e(){return o}function t(e){return e(n)}var r=a(n),o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:C,isNone:i,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:e,orThunk:e,map:function(e){return k(e(n))},each:function(e){e(n)},bind:t,exists:t,forall:t,filter:function(e){return e(n)?o:O},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(i,function(e){return t(n,e)})}};return o},E={some:k,none:n,from:function(e){return null===e||e===undefined?O:k(e)}},M=(I="function",function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"==t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(e)===I}),R=Array.prototype.slice,D=(M(Array.from)&&Array.from,function(a,i){var e=function(){var t=l(E.none());return{clear:function(){t.set(E.none())},set:function(e){t.set(E.some(e))},isSet:function(){return t.get().isSome()},on:function(e){t.get().each(e)}}}();a.undoManager.add();var t=p.trim(a.selection.getContent({format:"text"}));function c(e){(function(e,t){return 1<t.get().count}(0,i)?e.enable:e.disable)("next"),(function(e,t){return 1<t.get().count}(0,i)?e.enable:e.disable)("prev")}function u(e,t){!function(e,t){for(var n=0,r=e.length;n<r;n++){t(e[n],n)}}(["replace","replaceall","prev","next"],t?e.disable:e.enable)}function d(e){m(a,i,!1),u(e,!0),c(e)}function r(e){var t=e.getData(),n=i.get();if(t.findtext.length){if(n.text===t.findtext&&n.matchCase===t.matchcase&&n.wholeWord===t.wholewords)y(a,i);else{var r=s(a,i,t.findtext,t.matchcase,t.wholewords);r<=0&&!function o(e){a.windowManager.alert("Could not find the specified string.",function(){e.focus("findtext")})}(e),u(e,0===r)}c(e)}else d(e)}var n=i.get(),o={title:"Find and Replace",size:"normal",body:{type:"panel",items:[{type:"bar",items:[{type:"input",name:"findtext",placeholder:"Find",maximized:!0},{type:"button",name:"prev",text:"Previous",icon:"action-prev",disabled:!0,borderless:!0},{type:"button",name:"next",text:"Next",icon:"action-next",disabled:!0,borderless:!0}]},{type:"input",name:"replacetext",placeholder:"Replace with"}]},buttons:[{type:"menu",name:"options",icon:"preferences",tooltip:"Preferences",align:"start",items:[{type:"togglemenuitem",name:"matchcase",text:"Match case"},{type:"togglemenuitem",name:"wholewords",text:"Find whole words only"}]},{type:"custom",name:"find",text:"Find",primary:!0},{type:"custom",name:"replace",text:"Replace",disabled:!0},{type:"custom",name:"replaceall",text:"Replace All",disabled:!0}],initialData:{findtext:t,replacetext:"",wholewords:n.wholeWord,matchcase:n.matchCase},onChange:function(e,t){"findtext"===t.name&&0<i.get().count&&d(e)},onAction:function(e,t){var n=e.getData();switch(t.name){case"find":r(e);break;case"replace":f(a,i,n.replacetext)?c(e):d(e);break;case"replaceall":f(a,i,n.replacetext,!0,!0),d(e);break;case"prev":N(a,i),c(e);break;case"next":y(a,i),c(e)}},onSubmit:r,onClose:function(){a.focus(),m(a,i),a.undoManager.add()}};e.set(a.windowManager.open(o,{inline:"toolbar"}))}),F=function(e,t){e.addCommand("SearchReplace",function(){D(e,t)})},j=function(e,t){e.ui.registry.addMenuItem("searchreplace",{text:"Find and replace...",shortcut:"Meta+F",onAction:B(e,t),icon:"search"}),e.ui.registry.addButton("searchreplace",{tooltip:"Find and replace",onAction:B(e,t),icon:"search"}),e.shortcuts.add("Meta+F","",B(e,t))};!function z(){e.add("searchreplace",function(e){var t=l({index:-1,count:0,text:"",matchCase:!1,wholeWord:!1});return F(e,t),j(e,t),o(e,t)})}()}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.0.
|
7
|
+
* Version: 5.0.16 (2019-09-24)
|
8
8
|
*/
|
9
|
-
!function(t){"use strict";var a=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return a(n())}}},n=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=function(e){return!(!/(^|[ ,])tinymcespellchecker([, ]|$)/.test(e.settings.plugins)||!n.get("tinymcespellchecker")||("undefined"!=typeof t.window.console&&t.window.console.log&&t.window.console.log("Spell Checker Pro is incompatible with Spell Checker plugin! Remove 'spellchecker' from the 'plugins' option."),0))},N=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=tinymce.util.Tools.resolve("tinymce.util.URI"),f=tinymce.util.Tools.resolve("tinymce.util.XHR"),l=function(e){return e.fire("SpellcheckStart")},o=function(e){return e.fire("SpellcheckEnd")},g=function(e){return e.getParam("spellchecker_languages","English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr_FR,German=de,Italian=it,Polish=pl,Portuguese=pt_BR,Spanish=es,Swedish=sv")},s=function(e){var t=e.getParam("language","en");return e.getParam("spellchecker_language",t)},h=function(e){return e.getParam("spellchecker_rpc_url")},p=function(e){return e.getParam("spellchecker_callback")},u=function(e){var t=new RegExp('[^\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`\xa7\xa9\xab\xae\xb1\xb6\xb7\xb8\xbb\xbc\xbd\xbe\xbf\xd7\xf7\xa4\u201d\u201c\u201e\xa0\u2002\u2003\u2009]+',"g");return e.getParam("spellchecker_wordchar_pattern",t)};function b(e){return e&&1===e.nodeType&&"false"===e.contentEditable}var r=function(a,r){var n,o,g,h,p,i=[],v=r.dom;function c(e,t){if(!e[0])throw new Error("findAndReplaceDOMText cannot handle zero-length matches");return{start:e.index,end:e.index+e[0].length,text:e[0],data:t}}function s(e){var t=a.getElementsByTagName("*"),n=[];e="number"==typeof e?""+e:null;for(var r=0;r<t.length;r++){var o=t[r],i=o.getAttribute("data-mce-index");null!==i&&i.length&&-1!==o.className.indexOf("mce-spellchecker-word")&&(i!==e&&null!==e||n.push(o))}return n}function l(e){for(var t=i.length;t--;)if(i[t]===e)return t;return-1}function e(e){for(var t=0,n=i.length;t<n&&!1!==e(i[t],t);t++);return this}function t(e){var t,n,r=s(e?l(e):null);for(t=r.length;t--;)(n=r[t]).parentNode.insertBefore(n.firstChild,n),n.parentNode.removeChild(n);return this}function u(e){var t=s(l(e)),n=r.dom.createRng();return n.setStartBefore(t[0]),n.setEndAfter(t[t.length-1]),n}return g=r.schema.getBlockElements(),h=r.schema.getWhiteSpaceElements(),p=r.schema.getShortEndedElements(),{text:o=function d(e){var t;if(3===e.nodeType)return e.data;if(h[e.nodeName]&&!g[e.nodeName])return"";if(b(e))return"\n";if(t="",(g[e.nodeName]||p[e.nodeName])&&(t+="\n"),e=e.firstChild)for(;t+=d(e),e=e.nextSibling;);return t}(a),matches:i,each:e,filter:function f(n){var r=[];return e(function(e,t){n(e,t)&&r.push(e)}),i=r,this},reset:function m(){return i.splice(0,i.length),t(),this},matchFromElement:function x(e){return i[e.getAttribute("data-mce-index")]},elementFromMatch:function k(e){return s(l(e))[0]},find:function N(e,t){if(o&&e.global)for(;n=e.exec(o);)i.push(c(n,t));return this},add:function y(e,t,n){return i.push({start:e,end:e+t,text:o.substr(e,t),data:n}),this},wrap:function S(e){return i.length&&function f(e,t,n){var r,o,i,a,c,s=[],l=0,u=e,d=0;(t=t.slice(0)).sort(function(e,t){return e.start-t.start}),c=t.shift();e:for(;;){if((g[u.nodeName]||p[u.nodeName]||b(u))&&l++,3===u.nodeType&&(!o&&u.length+l>=c.end?(o=u,a=c.end-l):r&&s.push(u),!r&&u.length+l>c.start&&(r=u,i=c.start-l),l+=u.length),r&&o){if(u=n({startNode:r,startNodeIndex:i,endNode:o,endNodeIndex:a,innerNodes:s,match:c.text,matchIndex:d}),l-=o.length-a,o=r=null,s=[],d++,!(c=t.shift()))break}else if(h[u.nodeName]&&!g[u.nodeName]||!u.firstChild){if(u.nextSibling){u=u.nextSibling;continue}}else if(!b(u)){u=u.firstChild;continue}for(;;){if(u.nextSibling){u=u.nextSibling;break}if(u.parentNode===e)break e;u=u.parentNode}}}(a,i,function t(o){function m(e,t){var n=i[t];n.stencil||(n.stencil=o(n));var r=n.stencil.cloneNode(!1);return r.setAttribute("data-mce-index",t),e&&r.appendChild(v.doc.createTextNode(e)),r}return function(e){var t,n,r,o=e.startNode,i=e.endNode,a=e.matchIndex,c=v.doc;if(o===i){var s=o;r=s.parentNode,0<e.startNodeIndex&&(t=c.createTextNode(s.data.substring(0,e.startNodeIndex)),r.insertBefore(t,s));var l=m(e.match,a);return r.insertBefore(l,s),e.endNodeIndex<s.length&&(n=c.createTextNode(s.data.substring(e.endNodeIndex)),r.insertBefore(n,s)),s.parentNode.removeChild(s),l}t=c.createTextNode(o.data.substring(0,e.startNodeIndex)),n=c.createTextNode(i.data.substring(e.endNodeIndex));for(var u=m(o.data.substring(e.startNodeIndex),a),d=0,f=e.innerNodes.length;d<f;++d){var g=e.innerNodes[d],h=m(g.data,a);g.parentNode.replaceChild(h,g)}var p=m(i.data.substring(0,e.endNodeIndex),a);return(r=o.parentNode).insertBefore(t,o),r.insertBefore(u,o),r.removeChild(o),(r=i.parentNode).insertBefore(p,i),r.insertBefore(n,i),r.removeChild(i),p}}(e)),this},unwrap:t,replace:function w(e,t){var n=u(e);return n.deleteContents(),0<t.length&&n.insertNode(r.dom.doc.createTextNode(t)),n},rangeFromMatch:u,indexOf:l}},m=function(e,t){if(!t.get()){var n=r(e.getBody(),e);t.set(n)}return t.get()},v=function(e,t,n,r,o,i,a){var c,s,l,u=p(e);(u||(c=e,s=t,l=n,function(e,t,r,o){var n={method:e,lang:l.get()},i="";n["addToDictionary"===e?"word":"text"]=t,N.each(n,function(e,t){i&&(i+="&"),i+=t+"="+encodeURIComponent(e)}),f.send({url:new d(s).toAbsolute(h(c)),type:"post",content_type:"application/x-www-form-urlencoded",data:i,success:function(e){var t=JSON.parse(e);if(t)t.error?o(t.error):r(t);else{var n=c.translate("Server response wasn't proper JSON.");o(n)}},error:function(){var e=c.translate("The spelling service was not found: (")+h(c)+c.translate(")");o(e)}})})).call(e.plugins.spellchecker,r,o,i,a)},x=function(e,t,n){e.dom.select("span.mce-spellchecker-word").length||k(e,t,n)},k=function(e,t,n){var r=e.selection.getBookmark();if(m(e,n).reset(),e.selection.moveToBookmark(r),n.set(null),t.get())return t.set(!1),o(e),!0},y=function(e){var t=e.getAttribute("data-mce-index");return"number"==typeof t?""+t:t},S=function(t,e,n,r,o){var i=!!o.dictionary,a=o.words;if(t.setProgressState(!1),function(e){for(var t in e)return!1;return!0}(a)){var c=t.translate("No misspellings found.");return t.notificationManager.open({text:c,type:"info"}),void e.set(!1)}r.set({suggestions:a,hasDictionarySupport:i});var s=t.selection.getBookmark();m(t,n).find(u(t)).filter(function(e){return!!a[e.text]}).wrap(function(e){return t.dom.create("span",{"class":"mce-spellchecker-word","aria-invalid":"spelling","data-mce-bogus":1,"data-mce-word":e.text})}),t.selection.moveToBookmark(s),e.set(!0),l(t)},w={spellcheck:function(t,e,n,r,o,i){k(t,n,r)||(t.setProgressState(!0),v(t,e,i,"spellcheck",m(t,r).text,function(e){S(t,n,r,o,e)},function(e){t.notificationManager.open({text:e,type:"error"}),t.setProgressState(!1),k(t,n,r)}),t.focus())},checkIfFinished:x,addToDictionary:function(t,e,n,r,o,i,a){t.setProgressState(!0),v(t,e,o,"addToDictionary",i,function(){t.setProgressState(!1),t.dom.remove(a,!0),x(t,n,r)},function(e){t.notificationManager.open({text:e,type:"error"}),t.setProgressState(!1)})},ignoreWord:function(t,e,n,r,o,i){t.selection.collapse(),i?N.each(t.dom.select("span.mce-spellchecker-word"),function(e){e.getAttribute("data-mce-word")===r&&t.dom.remove(e,!0)}):t.dom.remove(o,!0),x(t,e,n)},findSpansByIndex:function(e,t){var n,r=[];if((n=N.toArray(e.getBody().getElementsByTagName("span"))).length)for(var o=0;o<n.length;o++){var i=y(n[o]);null!==i&&i.length&&i===t.toString()&&r.push(n[o])}return r},getElmIndex:y,markErrors:S},T=function(t,n,r,o,e,i){return{getTextMatcher:function(){return o.get()},getWordCharPattern:function(){return u(t)},markErrors:function(e){w.markErrors(t,n,o,r,e)},getLanguage:function(){return e.get()}}},I=function(e,t,n,r,o,i){e.addCommand("mceSpellCheck",function(){w.spellcheck(e,t,n,r,o,i)})},B=function(){return(B=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},A="SpellcheckStart SpellcheckEnd",E=function(n,e,r,t,o,i){var a,c,s,l=(s=n,a=N.map(g(s).split(","),function(e){return{name:(e=e.split("="))[0],value:e[1]}}),c=[],N.each(a,function(e){c.push({selectable:!0,text:e.name,data:e.value})}),c),u=function(){w.spellcheck(n,e,r,t,i,o)},d={tooltip:"Spellcheck",onAction:u,icon:"spell-check",onSetup:function(e){var t=function(){e.setActive(r.get())};return n.on(A,t),function(){n.off(A,t)}}},f=B({},d,{type:"splitbutton",select:function(e){return e===o.get()},fetch:function(e){e(N.map(l,function(e){return{type:"choiceitem",value:e.data,text:e.text}}))},onItemAction:function(e,t){o.set(t)}});1<l.length?n.ui.registry.addSplitButton("spellchecker",f):n.ui.registry.addToggleButton("spellchecker",d),n.ui.registry.addToggleMenuItem("spellchecker",{text:"Spellcheck",onSetup:function(e){e.setActive(r.get());var t=function(){e.setActive(r.get())};return n.on(A,t),function(){n.off(A,t)}},onAction:u})},C=function(h,p,m,v,x,k){h.ui.registry.addContextMenu("spellchecker",{update:function(e){var t=e;if("mce-spellchecker-word"!==t.className)return[];var n,r,o,i,a,c,s,l,u,d,f=w.findSpansByIndex(h,w.getElmIndex(t));if(0<f.length){var g=h.dom.createRng();return g.setStartBefore(f[0]),g.setEndAfter(f[f.length-1]),h.selection.setRng(g),n=h,r=p,o=m,i=v,a=x,c=k,s=t.getAttribute("data-mce-word"),l=f,u=[],d=o.get().suggestions[s],N.each(d,function(e){u.push({text:e,onAction:function(){n.insertContent(n.dom.encode(e)),n.dom.remove(l),w.checkIfFinished(n,i,a)}})}),o.get().hasDictionarySupport&&(u.push({type:"separator"}),u.push({text:"Add to dictionary",onAction:function(){w.addToDictionary(n,r,i,a,c,s,l)}})),u.push.apply(u,[{type:"separator"},{text:"Ignore",onAction:function(){w.ignoreWord(n,i,a,s,l)}},{text:"Ignore all",onAction:function(){w.ignoreWord(n,i,a,s,l,!0)}}]),u}}})};!function e(){n.add("spellchecker",function(e,t){if(!1===c(e)){var n=a(!1),r=a(s(e)),o=a(null),i=a(null);return E(e,t,n,o,r,i),C(e,t,i,n,o,r),I(e,t,n,o,i,r),T(e,n,i,o,r,t)}})}()}(window);
|
9
|
+
!function(t){"use strict";var a=function(e){function t(){return n}var n=e;return{get:t,set:function(e){n=e},clone:function(){return a(t())}}},n=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=function(e){return!(!/(^|[ ,])tinymcespellchecker([, ]|$)/.test(e.settings.plugins)||!n.get("tinymcespellchecker"))&&("undefined"!=typeof t.window.console&&t.window.console.log&&t.window.console.log("Spell Checker Pro is incompatible with Spell Checker plugin! Remove 'spellchecker' from the 'plugins' option."),!0)},l=tinymce.util.Tools.resolve("tinymce.util.Tools"),u=tinymce.util.Tools.resolve("tinymce.util.URI"),d=tinymce.util.Tools.resolve("tinymce.util.XHR"),f=function(e){return e.fire("SpellcheckStart")},o=function(e){return e.fire("SpellcheckEnd")},g=function(e){return e.getParam("spellchecker_languages","English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr_FR,German=de,Italian=it,Polish=pl,Portuguese=pt_BR,Spanish=es,Swedish=sv")},s=function(e){var t=e.getParam("language","en");return e.getParam("spellchecker_language",t)},h=function(e){return e.getParam("spellchecker_rpc_url")},p=function(e){return e.getParam("spellchecker_callback")},m=function(e){var t=new RegExp('[^\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`\xa7\xa9\xab\xae\xb1\xb6\xb7\xb8\xbb\xbc\xbd\xbe\xbf\xd7\xf7\xa4\u201d\u201c\u201e\xa0\u2002\u2003\u2009]+',"g");return e.getParam("spellchecker_wordchar_pattern",t)};function b(e){return e&&1===e.nodeType&&"false"===e.contentEditable}function r(a,r){var n,o,g,h,p,i=[],v=r.dom;function c(e,t){if(!e[0])throw new Error("findAndReplaceDOMText cannot handle zero-length matches");return{start:e.index,end:e.index+e[0].length,text:e[0],data:t}}function s(e){var t=a.getElementsByTagName("*"),n=[];e="number"==typeof e?""+e:null;for(var r=0;r<t.length;r++){var o=t[r],i=o.getAttribute("data-mce-index");null!==i&&i.length&&-1!==o.className.indexOf("mce-spellchecker-word")&&(i!==e&&null!==e||n.push(o))}return n}function u(e){for(var t=i.length;t--;)if(i[t]===e)return t;return-1}function e(e){for(var t=0,n=i.length;t<n&&!1!==e(i[t],t);t++);return this}function t(e){var t,n,r=s(e?u(e):null);for(t=r.length;t--;)(n=r[t]).parentNode.insertBefore(n.firstChild,n),n.parentNode.removeChild(n);return this}function l(e){var t=s(u(e)),n=r.dom.createRng();return n.setStartBefore(t[0]),n.setEndAfter(t[t.length-1]),n}return g=r.schema.getBlockElements(),h=r.schema.getWhiteSpaceElements(),p=r.schema.getShortEndedElements(),{text:o=function d(e){var t;if(3===e.nodeType)return e.data;if(h[e.nodeName]&&!g[e.nodeName])return"";if(b(e))return"\n";if(t="",(g[e.nodeName]||p[e.nodeName])&&(t+="\n"),e=e.firstChild)for(;t+=d(e),e=e.nextSibling;);return t}(a),matches:i,each:e,filter:function f(n){var r=[];return e(function(e,t){n(e,t)&&r.push(e)}),i=r,this},reset:function m(){return i.splice(0,i.length),t(),this},matchFromElement:function x(e){return i[e.getAttribute("data-mce-index")]},elementFromMatch:function k(e){return s(u(e))[0]},find:function N(e,t){if(o&&e.global)for(;n=e.exec(o);)i.push(c(n,t));return this},add:function y(e,t,n){return i.push({start:e,end:e+t,text:o.substr(e,t),data:n}),this},wrap:function S(e){return i.length&&function f(e,t,n){var r,o,i,a,c,s=[],u=0,l=e,d=0;(t=t.slice(0)).sort(function(e,t){return e.start-t.start}),c=t.shift();e:for(;;){if((g[l.nodeName]||p[l.nodeName]||b(l))&&u++,3===l.nodeType&&(!o&&l.length+u>=c.end?(o=l,a=c.end-u):r&&s.push(l),!r&&l.length+u>c.start&&(r=l,i=c.start-u),u+=l.length),r&&o){if(l=n({startNode:r,startNodeIndex:i,endNode:o,endNodeIndex:a,innerNodes:s,match:c.text,matchIndex:d}),u-=o.length-a,o=r=null,s=[],d++,!(c=t.shift()))break}else if(h[l.nodeName]&&!g[l.nodeName]||!l.firstChild){if(l.nextSibling){l=l.nextSibling;continue}}else if(!b(l)){l=l.firstChild;continue}for(;;){if(l.nextSibling){l=l.nextSibling;break}if(l.parentNode===e)break e;l=l.parentNode}}}(a,i,function t(o){function m(e,t){var n=i[t];n.stencil||(n.stencil=o(n));var r=n.stencil.cloneNode(!1);return r.setAttribute("data-mce-index",t),e&&r.appendChild(v.doc.createTextNode(e)),r}return function(e){var t,n,r,o=e.startNode,i=e.endNode,a=e.matchIndex,c=v.doc;if(o===i){var s=o;r=s.parentNode,0<e.startNodeIndex&&(t=c.createTextNode(s.data.substring(0,e.startNodeIndex)),r.insertBefore(t,s));var u=m(e.match,a);return r.insertBefore(u,s),e.endNodeIndex<s.length&&(n=c.createTextNode(s.data.substring(e.endNodeIndex)),r.insertBefore(n,s)),s.parentNode.removeChild(s),u}t=c.createTextNode(o.data.substring(0,e.startNodeIndex)),n=c.createTextNode(i.data.substring(e.endNodeIndex));for(var l=m(o.data.substring(e.startNodeIndex),a),d=0,f=e.innerNodes.length;d<f;++d){var g=e.innerNodes[d],h=m(g.data,a);g.parentNode.replaceChild(h,g)}var p=m(i.data.substring(0,e.endNodeIndex),a);return(r=o.parentNode).insertBefore(t,o),r.insertBefore(l,o),r.removeChild(o),(r=i.parentNode).insertBefore(p,i),r.insertBefore(n,i),r.removeChild(i),p}}(e)),this},unwrap:t,replace:function w(e,t){var n=l(e);return n.deleteContents(),0<t.length&&n.insertNode(r.dom.doc.createTextNode(t)),n},rangeFromMatch:l,indexOf:u}}function v(e,t){if(!t.get()){var n=r(e.getBody(),e);t.set(n)}return t.get()}function x(e,t,n,r,o,i,a){var c=p(e);(c||function(a,c,s){return function(e,t,r,o){var n={method:e,lang:s.get()},i="";n["addToDictionary"===e?"word":"text"]=t,l.each(n,function(e,t){i&&(i+="&"),i+=t+"="+encodeURIComponent(e)}),d.send({url:new u(c).toAbsolute(h(a)),type:"post",content_type:"application/x-www-form-urlencoded",data:i,success:function(e){var t=JSON.parse(e);if(t)t.error?o(t.error):r(t);else{var n=a.translate("Server response wasn't proper JSON.");o(n)}},error:function(){var e=a.translate("The spelling service was not found: (")+h(a)+a.translate(")");o(e)}})}}(e,t,n)).call(e.plugins.spellchecker,r,o,i,a)}function k(e,t,n){e.dom.select("span.mce-spellchecker-word").length||y(e,t,n)}function N(e){var t=e.getAttribute("data-mce-index");return"number"==typeof t?""+t:t}var y=function(e,t,n){var r=e.selection.getBookmark();if(v(e,n).reset(),e.selection.moveToBookmark(r),n.set(null),t.get())return t.set(!1),o(e),!0},S=function(t,e,n,r,o){var i=!!o.dictionary,a=o.words;if(t.setProgressState(!1),function(e){for(var t in e)return!1;return!0}(a)){var c=t.translate("No misspellings found.");return t.notificationManager.open({text:c,type:"info"}),void e.set(!1)}r.set({suggestions:a,hasDictionarySupport:i});var s=t.selection.getBookmark();v(t,n).find(m(t)).filter(function(e){return!!a[e.text]}).wrap(function(e){return t.dom.create("span",{"class":"mce-spellchecker-word","aria-invalid":"spelling","data-mce-bogus":1,"data-mce-word":e.text})}),t.selection.moveToBookmark(s),e.set(!0),f(t)},w={spellcheck:function(t,e,n,r,o,i){if(!y(t,n,r)){t.setProgressState(!0),x(t,e,i,"spellcheck",v(t,r).text,function(e){S(t,n,r,o,e)},function(e){t.notificationManager.open({text:e,type:"error"}),t.setProgressState(!1),y(t,n,r)}),t.focus()}},checkIfFinished:k,addToDictionary:function(t,e,n,r,o,i,a){t.setProgressState(!0),x(t,e,o,"addToDictionary",i,function(){t.setProgressState(!1),t.dom.remove(a,!0),k(t,n,r)},function(e){t.notificationManager.open({text:e,type:"error"}),t.setProgressState(!1)})},ignoreWord:function(t,e,n,r,o,i){t.selection.collapse(),i?l.each(t.dom.select("span.mce-spellchecker-word"),function(e){e.getAttribute("data-mce-word")===r&&t.dom.remove(e,!0)}):t.dom.remove(o,!0),k(t,e,n)},findSpansByIndex:function(e,t){var n,r=[];if((n=l.toArray(e.getBody().getElementsByTagName("span"))).length)for(var o=0;o<n.length;o++){var i=N(n[o]);null!==i&&i.length&&i===t.toString()&&r.push(n[o])}return r},getElmIndex:N,markErrors:S},T=function(t,n,r,o,e,i){return{getTextMatcher:function(){return o.get()},getWordCharPattern:function(){return m(t)},markErrors:function(e){w.markErrors(t,n,o,r,e)},getLanguage:function(){return e.get()}}},I=function(e,t,n,r,o,i){e.addCommand("mceSpellCheck",function(){w.spellcheck(e,t,n,r,o,i)})},B=function(){return(B=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},A="SpellcheckStart SpellcheckEnd",E=function(n,e,r,t,o,i){function a(){w.spellcheck(n,e,r,t,i,o)}var c=function(e,t){var n=[];return l.each(t,function(e){n.push({selectable:!0,text:e.name,data:e.value})}),n}(0,function(e){return l.map(g(e).split(","),function(e){return{name:(e=e.split("="))[0],value:e[1]}})}(n)),s={tooltip:"Spellcheck",onAction:a,icon:"spell-check",onSetup:function(e){function t(){e.setActive(r.get())}return n.on(A,t),function(){n.off(A,t)}}},u=B(B({},s),{type:"splitbutton",select:function(e){return e===o.get()},fetch:function(e){e(l.map(c,function(e){return{type:"choiceitem",value:e.data,text:e.text}}))},onItemAction:function(e,t){o.set(t)}});1<c.length?n.ui.registry.addSplitButton("spellchecker",u):n.ui.registry.addToggleButton("spellchecker",s),n.ui.registry.addToggleMenuItem("spellchecker",{text:"Spellcheck",onSetup:function(e){e.setActive(r.get());function t(){e.setActive(r.get())}return n.on(A,t),function(){n.off(A,t)}},onAction:a})},C=function(o,i,a,c,s,u){o.ui.registry.addContextMenu("spellchecker",{update:function(e){var t=e;if("mce-spellchecker-word"!==t.className)return[];var n=w.findSpansByIndex(o,w.getElmIndex(t));if(0<n.length){var r=o.dom.createRng();return r.setStartBefore(n[0]),r.setEndAfter(n[n.length-1]),o.selection.setRng(r),function(t,e,n,r,o,i,a,c){var s=[],u=n.get().suggestions[a];return l.each(u,function(e){s.push({text:e,onAction:function(){t.insertContent(t.dom.encode(e)),t.dom.remove(c),w.checkIfFinished(t,r,o)}})}),n.get().hasDictionarySupport&&(s.push({type:"separator"}),s.push({text:"Add to dictionary",onAction:function(){w.addToDictionary(t,e,r,o,i,a,c)}})),s.push.apply(s,[{type:"separator"},{text:"Ignore",onAction:function(){w.ignoreWord(t,r,o,a,c)}},{text:"Ignore all",onAction:function(){w.ignoreWord(t,r,o,a,c,!0)}}]),s}(o,i,a,c,s,u,t.getAttribute("data-mce-word"),n)}}})};!function e(){n.add("spellchecker",function(e,t){if(!1===c(e)){var n=a(!1),r=a(s(e)),o=a(null),i=a(null);return E(e,t,n,o,r,i),C(e,t,i,n,o,r),I(e,t,n,o,i,r),T(e,n,i,o,r,t)}})}()}(window);
|