tinymce-rails 4.9.11.1 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -6
- data/app/assets/source/tinymce/tinymce.js +14735 -15357
- data/lib/tinymce/rails/asset_installer/compile.rb +2 -2
- data/lib/tinymce/rails/asset_installer.rb +1 -1
- data/lib/tinymce/rails/asset_manifest.rb +4 -9
- data/lib/tinymce/rails/configuration.rb +2 -2
- data/lib/tinymce/rails/configuration_file.rb +3 -4
- data/lib/tinymce/rails/engine.rb +1 -5
- data/lib/tinymce/rails/helper.rb +1 -1
- data/lib/tinymce/rails/version.rb +2 -2
- data/vendor/assets/javascripts/tinymce/jquery.tinymce.js +92 -1
- data/vendor/assets/javascripts/tinymce/plugins/advlist/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/anchor/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/autolink/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/autoresize/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/autosave/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/bbcode/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/charmap/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/code/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/codesample/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/colorpicker/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/contextmenu/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/directionality/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/js/emojis.js +2 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/fullpage/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/fullscreen/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/hr/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/image/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/imagetools/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/importcss/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/insertdatetime/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/legacyoutput/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/link/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/lists/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/media/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/nonbreaking/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/noneditable/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/pagebreak/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/paste/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/preview/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/print/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/quickbars/plugin.js +9 -0
- data/vendor/assets/javascripts/tinymce/plugins/save/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/searchreplace/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/spellchecker/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/tabfocus/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/table/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/template/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/textcolor/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/textpattern/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/toc/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/visualblocks/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/visualchars/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/plugins/wordcount/plugin.js +9 -1
- data/vendor/assets/javascripts/tinymce/skins/content/default/content.css +44 -0
- data/vendor/assets/javascripts/tinymce/skins/content/default/content.min.css +8 -0
- data/vendor/assets/javascripts/tinymce/skins/content/document/content.css +48 -0
- data/vendor/assets/javascripts/tinymce/skins/content/document/content.min.css +8 -0
- data/vendor/assets/javascripts/tinymce/skins/content/writer/content.css +45 -0
- data/vendor/assets/javascripts/tinymce/skins/content/writer/content.min.css +8 -0
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.inline.min.css +8 -0
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.min.css +8 -0
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.min.css +8 -0
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.mobile.min.css +2 -0
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.inline.min.css +8 -0
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.min.css +8 -0
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.min.css +8 -0
- data/vendor/assets/javascripts/tinymce/themes/mobile/theme.js +9 -1
- data/vendor/assets/javascripts/tinymce/themes/silver/theme.js +9 -0
- data/vendor/assets/javascripts/tinymce/tinymce.js +9 -2
- metadata +24 -46
- data/vendor/assets/config/tinymce-rails.manifest.js +0 -8
- data/vendor/assets/javascripts/tinymce/plugins/codesample/css/prism.css +0 -138
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-cool.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-cry.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-embarassed.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-foot-in-mouth.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-frown.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-innocent.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-kiss.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-laughing.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-money-mouth.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-sealed.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-smile.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-surprised.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-tongue-out.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-undecided.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-wink.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/img/smiley-yell.gif +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/help/img/logo.png +0 -0
- data/vendor/assets/javascripts/tinymce/plugins/visualblocks/css/visualblocks.css +0 -154
- data/vendor/assets/javascripts/tinymce/skins/lightgray/content.inline.min.css +0 -1
- data/vendor/assets/javascripts/tinymce/skins/lightgray/content.min.css +0 -1
- data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/tinymce-small.eot +0 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/tinymce-small.svg +0 -63
- data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/tinymce-small.ttf +0 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/tinymce-small.woff +0 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/tinymce.eot +0 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/tinymce.svg +0 -132
- data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/tinymce.ttf +0 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/tinymce.woff +0 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/img/anchor.gif +0 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/img/loader.gif +0 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/img/object.gif +0 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/img/trans.gif +0 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/skin.min.css +0 -1
- data/vendor/assets/javascripts/tinymce/skins/lightgray/skin.mobile.min.css +0 -2
- data/vendor/assets/javascripts/tinymce/themes/inlite/theme.js +0 -1
- data/vendor/assets/javascripts/tinymce/themes/modern/theme.js +0 -1
- /data/vendor/assets/javascripts/tinymce/skins/{lightgray → ui/oxide}/content.mobile.min.css +0 -0
- /data/vendor/assets/javascripts/tinymce/skins/{lightgray → ui/oxide}/fonts/tinymce-mobile.woff +0 -0
@@ -1 +1,9 @@
|
|
1
|
-
|
1
|
+
/**
|
2
|
+
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
|
3
|
+
* Licensed under the LGPL or a commercial license.
|
4
|
+
* For LGPL see License.txt in the project root for license information.
|
5
|
+
* For commercial licenses see https://www.tiny.cloud/
|
6
|
+
*
|
7
|
+
* Version: 5.0.0-1 (2019-02-04)
|
8
|
+
*/
|
9
|
+
!function(){"use strict";var n,t,e,r,o,i=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t]},c=function(n){return function(){return n}},a=function(n){return n},l=c(!1),f=c(!0),s=l,d=f,m=function(){return g},g=(r={fold:function(n,t){return n()},is:s,isSome:s,isNone:d,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:m,ap:m,each:function(){},bind:m,flatten:m,exists:s,forall:d,filter:m,equals:n=function(n){return n.isNone()},equals_:n,toArray:function(){return[]},toString:c("none()")},Object.freeze&&Object.freeze(r),r),y=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:d,isNone:s,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:t,orThunk:t,map:function(n){return y(n(e))},ap:function(n){return n.fold(m,function(n){return y(n(e))})},each:function(n){n(e)},bind:r,flatten:n,exists:r,forall:r,filter:function(n){return n(e)?o:g},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(s,function(n){return t(e,n)})},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},p={some:y,none:m,from:function(n){return null===n||n===undefined?g:y(n)}},h=(o="function",function(n){return function(n){if(null===n)return"null";var t=typeof n;return"object"===t&&Array.prototype.isPrototypeOf(n)?"array":"object"===t&&String.prototype.isPrototypeOf(n)?"string":t}(n)===o}),v=function(n,t){for(var e=0,r=n.length;e<r;e++)if(t(n[e],e,n))return p.some(e);return p.none()},O=(Array.prototype.slice,h(Array.from)&&Array.from,function(n,t){return-1!==n.indexOf(t)}),b=function(n,t){return O(n.title.toLowerCase(),t)||(e=n.keywords,v(e,function(n){return O(n.toLowerCase(),t)}).isSome());var e},w=function(n,t,e){for(var r=[],o=t.toLowerCase(),i=e.fold(function(){return l},function(t){return function(n){return t<=n}}),u=0;u<n.length&&(0!==t.length&&!b(n[u],o)||(r.push({value:n[u]["char"],text:n[u].title,icon:n[u]["char"]}),!i(r.length)));u++);return r},A=function(n,t){return 0===n.startOffset||/\s/.test(t.charAt(n.startOffset-1))},k=function(n){var t=n,e=function(){return t};return{get:e,set:function(n){t=n},clone:function(){return k(e())}}},C="undefined"!=typeof window?window:Function("return this;")(),T=Object.keys,j=Object.hasOwnProperty,S=function(e){return{is:function(n){return e===n},isValue:f,isError:l,getOr:c(e),getOrThunk:c(e),getOrDie:c(e),or:function(n){return S(e)},orThunk:function(n){return S(e)},fold:function(n,t){return t(e)},map:function(n){return S(n(e))},mapError:function(n){return S(e)},each:function(n){n(e)},bind:function(n){return n(e)},exists:function(n){return n(e)},forall:function(n){return n(e)},toOption:function(){return p.some(e)}}},x=function(e){return{is:l,isValue:l,isError:f,getOr:a,getOrThunk:function(n){return n()},getOrDie:function(){return n=String(e),function(){throw new Error(n)}();var n},or:function(n){return n},orThunk:function(n){return n()},fold:function(n,t){return n(e)},map:function(n){return x(e)},mapError:function(n){return x(n(e))},each:u,bind:function(n){return x(e)},exists:l,forall:f,toOption:p.none}},L={value:S,error:x},_=tinymce.util.Tools.resolve("tinymce.dom.ScriptLoader"),D=tinymce.util.Tools.resolve("tinymce.util.Promise"),E="All",P={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"},F="emoticons_plugin_database",N=function(n){return t=P,e=n,j.call(t,e)?P[n]:n;var t,e},q=function(n,u){var e=k(p.none()),t=k(p.none());n.on("init",function(){_.ScriptLoader.loadScript(u,function(){var o={},i=[];(function(n){if(C.tinymce[F]){var t=L.value(C.tinymce[F]);return delete C.tinymce[F],t}return L.error("URL "+n+" did not contain the expected format for emoticons")})(u).fold(function(n){console.log(n),e.set(p.some({})),t.set(p.some([]))},function(n){!function(n,t){for(var e=T(n),r=0,o=e.length;r<o;r++){var i=e[r];t(n[i],i,n)}}(n,function(n,t){var e={title:t,keywords:n.keywords,"char":n["char"],category:N(n.category)},r=o[e.category]!==undefined?o[e.category]:[];o[e.category]=r.concat([e]),i.push(e)}),e.set(p.some(o)),t.set(p.some(i))})},function(){})});var r=function(){return t.get().getOr([])},o=function(){return e.get().isSome()&&t.get().isSome()};return{listCategories:function(){return[E].concat(T(e.get().getOr({})))},hasLoaded:o,waitForLoad:function(){return o()?D.resolve(!0):new D(function(n,t){var e=3,r=setInterval(function(){o()?(clearInterval(r),n(!0)):--e<0&&(console.log("Could not load emojis from url: "+u),clearInterval(r),t(!1))},500)})},listAll:r,listCategory:function(t){return t===E?r():e.get().bind(function(n){return p.from(n[t])}).getOr([])}}},I="pattern",z=function(o,c){var e,r,i,n={pattern:"",results:w(c.listAll(),"",p.some(300))},u=(e=function(n){var t,e,r,o,i,u=a.get();e=u,r=(t=n).getData(),o=c.listCategory(e),i=w(o,r[I],e===E?p.some(300):p.none()),t.setData({results:i})},r=200,i=null,{cancel:function(){null!==i&&(clearTimeout(i),i=null)},throttle:function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];null!==i&&clearTimeout(i),i=setTimeout(function(){e.apply(null,n),i=null},r)}}),a=k(E),t={label:"Search",type:"input",name:I},l={type:"collection",name:"results"},f=function(){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,n)}return r}(c.listCategories(),function(n){return{title:n,items:[t,l]}})},initialData:n,onTabChange:function(n,t){a.set(t),u.throttle(n)},onChange:u.throttle,onAction:function(n,t){var e,r;"results"===t.name&&(e=o,r=t.value,e.insertContent(r),n.close())},buttons:[{type:"cancel",text:"Close",primary:!0}]}},s=o.windowManager.open(f());s.focus(I),c.hasLoaded()||(s.block("Loading emoticons..."),c.waitForLoad().then(function(){s.redial(f()),u.throttle(s),s.focus(I),s.unblock()})["catch"](function(n){s.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:[]}}),s.focus(I),s.unblock()}))},M=function(n,t){var e=function(){return z(n,t)};n.ui.registry.addButton("emoticons",{tooltip:"Emoticons",icon:"emoji",onAction:e}),n.ui.registry.addMenuItem("emoticons",{text:"Emoticons...",icon:"emoji",onAction:e})},U=function(n,t){return n.getParam("emoticons_database_url",t+"/js/emojis"+n.suffix+".js")};i.add("emoticons",function(n,t){var r,o,e=U(n,t),i=q(n,e);M(n,i),o=i,(r=n).ui.registry.addAutocompleter("emoticons",{ch:":",columns:"auto",minChars:2,matches:A,fetch:function(t,e){return o.waitForLoad().then(function(){var n=o.listAll();return w(n,t,p.some(e))})},onAction:function(n,t,e){r.selection.setRng(t),r.insertContent(e),n.hide()}})}),function R(){}}();
|
@@ -1 +1,9 @@
|
|
1
|
-
|
1
|
+
/**
|
2
|
+
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
|
3
|
+
* Licensed under the LGPL or a commercial license.
|
4
|
+
* For LGPL see License.txt in the project root for license information.
|
5
|
+
* For commercial licenses see https://www.tiny.cloud/
|
6
|
+
*
|
7
|
+
* Version: 5.0.0-1 (2019-02-04)
|
8
|
+
*/
|
9
|
+
!function(){"use strict";var o,l=function(t){var e=t,n=function(){return e};return{get:n,set:function(t){e=t},clone:function(){return l(n())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),m=tinymce.util.Tools.resolve("tinymce.util.Tools"),e=tinymce.util.Tools.resolve("tinymce.html.DomParser"),f=tinymce.util.Tools.resolve("tinymce.html.Node"),g=tinymce.util.Tools.resolve("tinymce.html.Serializer"),p=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")},s=function(t){return t.getParam("fullpage_default_font_size")},u=function(t){return t.getParam("fullpage_default_text_color")},d=function(t){return t.getParam("fullpage_default_title")},y=function(t){return t.getParam("fullpage_default_doctype","<!DOCTYPE html>")},h=function(t){return e({validate:!1,root_name:"#document"}).parse(t)},v=h,n=function(t,e){var n,l,i=h(e),r={};function o(t,e){return t.attr(e)||""}return r.fontface=c(t),r.fontsize=s(t),7===(n=i.firstChild).type&&(r.xml_pi=!0,(l=/encoding="([^"]+)"/.exec(n.value))&&(r.docencoding=l[1])),(n=i.getAll("#doctype")[0])&&(r.doctype="<!DOCTYPE"+n.value+">"),(n=i.getAll("title")[0])&&n.firstChild&&(r.title=n.firstChild.value),m.each(i.getAll("meta"),function(t){var e,n=t.attr("name"),l=t.attr("http-equiv");n?r[n.toLowerCase()]=t.attr("content"):"Content-Type"===l&&(e=/charset\s*=\s*(.*)\s*/gi.exec(t.attr("content")))&&(r.docencoding=e[1])}),(n=i.getAll("html")[0])&&(r.langcode=o(n,"lang")||o(n,"xml:lang")),r.stylesheets=[],m.each(i.getAll("link"),function(t){"stylesheet"===t.attr("rel")&&r.stylesheets.push(t.attr("href"))}),(n=i.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},_=function(t,r,e){var o,n,l,a,i,c=t.dom;function s(t,e,n){t.attr(e,n||undefined)}function u(t){n.firstChild?n.insert(t,n.firstChild):n.append(t)}o=h(e),(n=o.getAll("head")[0])||(a=o.getAll("html")[0],n=new f("head",1),a.firstChild?a.insert(n,a.firstChild,!0):a.append(n)),a=o.firstChild,r.xml_pi?(i='version="1.0"',r.docencoding&&(i+=' encoding="'+r.docencoding+'"'),7!==a.type&&(a=new f("xml",7),o.insert(a,o.firstChild,!0)),a.value=i):a&&7===a.type&&a.remove(),a=o.getAll("#doctype")[0],r.doctype?(a||(a=new f("#doctype",10),r.xml_pi?o.insert(a,o.firstChild):u(a)),a.value=r.doctype.substring(9,r.doctype.length-1)):a&&a.remove(),a=null,m.each(o.getAll("meta"),function(t){"Content-Type"===t.attr("http-equiv")&&(a=t)}),r.docencoding?(a||((a=new f("meta",1)).attr("http-equiv","Content-Type"),a.shortEnded=!0,u(a)),a.attr("content","text/html; charset="+r.docencoding)):a&&a.remove(),a=o.getAll("title")[0],r.title?(a?a.empty():u(a=new f("title",1)),a.append(new f("#text",3)).value=r.title):a&&a.remove(),m.each("keywords,description,author,copyright,robots".split(","),function(t){var e,n,l=o.getAll("meta"),i=r[t];for(e=0;e<l.length;e++)if((n=l[e]).attr("name")===t)return void(i?n.attr("content",i):n.remove());i&&((a=new f("meta",1)).attr("name",t),a.attr("content",i),a.shortEnded=!0,u(a))});var d={};return m.each(o.getAll("link"),function(t){"stylesheet"===t.attr("rel")&&(d[t.attr("href")]=t)}),m.each(r.stylesheets,function(t){d[t]||((a=new f("link",1)).attr({rel:"stylesheet",text:"text/css",href:t}),a.shortEnded=!0,u(a)),delete d[t]}),m.each(d,function(t){t.remove()}),(a=o.getAll("body")[0])&&(s(a,"dir",r.langdir),s(a,"style",r.style),s(a,"vlink",r.visited_color),s(a,"link",r.link_color),s(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])&&(s(a,"lang",r.langcode),s(a,"xml:lang",r.langcode)),n.firstChild||n.remove(),(l=g({validate:!1,indent:!0,apply_source_formatting:!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,l.indexOf("</body>"))},b=Object.prototype.hasOwnProperty,x=(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={},l=0;l<t.length;l++){var i=t[l];for(var r in i)b.call(i,r)&&(n[r]=o(n[r],i[r]))}return n}),i=function(l,i){var r=n(l,i.get()),t=x({title:"",keywords:"",description:"",robots:"",author:"",docencoding:""},r);l.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=_(l,m.extend(r,e),i.get());i.set(n),t.close()}})},k=function(t,e){t.addCommand("mceFullPageProperties",function(){i(t,e)})},C=function(t,e){return m.each(t,function(t){e=e.replace(t,function(t){return"\x3c!--mce:protected "+escape(t)+"--\x3e"})}),e},A=function(t){return t.replace(/<!--mce:protected ([\s\S]*?)-->/g,function(t,e){return unescape(e)})},w=m.each,P=function(t){return t.replace(/<\/?[A-Z]+/g,function(t){return t.toLowerCase()})},T=function(t){var e,n="",l="";if(r(t)){var i=a(t);n+='<?xml version="1.0" encoding="'+(i||"ISO-8859-1")+'" ?>\n'}return n+=y(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))&&(l+="font-family: "+e+";"),(e=s(t))&&(l+="font-size: "+e+";"),(e=u(t))&&(l+="color: "+e+";"),n+="</head>\n<body"+(l?' style="'+l+'"':"")+">\n"},O=function(r,o,a){r.on("BeforeSetContent",function(t){!function(t,e,n,l){var i,r,o,a,c,s="",u=t.dom;if(!(l.selection||(o=C(t.settings.protect,l.content),"raw"===l.format&&e.get()||l.source_view&&p(t)))){0!==o.length||l.source_view||(o=m.trim(e.get())+"\n"+m.trim(o)+"\n"+m.trim(n.get())),-1!==(i=(o=o.replace(/<(\/?)BODY/gi,"<$1body")).indexOf("<body"))?(i=o.indexOf(">",i),e.set(P(o.substring(0,i+1))),-1===(r=o.indexOf("</body",i))&&(r=o.length),l.content=m.trim(o.substring(i+1,r)),n.set(P(o.substring(r)))):(e.set(T(t)),n.set("\n</body>\n</html>")),a=v(e.get()),w(a.getAll("style"),function(t){t.firstChild&&(s+=t.firstChild.value)}),(c=a.getAll("body")[0])&&u.setAttribs(t.getBody(),{style:c.attr("style")||"",dir:c.attr("dir")||"",vLink:c.attr("vlink")||"",link:c.attr("link")||"",aLink:c.attr("alink")||""}),u.remove("fullpage_styles");var d=t.getDoc().getElementsByTagName("head")[0];s&&(u.add(d,"style",{id:"fullpage_styles"},s),(c=u.get("fullpage_styles")).styleSheet&&(c.styleSheet.cssText=s));var f={};m.each(d.getElementsByTagName("link"),function(t){"stylesheet"===t.rel&&t.getAttribute("data-mce-fullpage")&&(f[t.href]=t)}),m.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]}),m.each(f,function(t){t.parentNode.removeChild(t)})}}(r,o,a,t)}),r.on("GetContent",function(t){var e,n,l,i;e=r,n=o.get(),l=a.get(),(i=t).selection||i.source_view&&p(e)||(i.content=A(m.trim(n)+"\n"+m.trim(i.content)+"\n"+m.trim(l)))})},D=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")}})};t.add("fullpage",function(t){var e=l(""),n=l("");k(t,e),D(t),O(t,e,n)}),function E(){}}();
|
@@ -1 +1,9 @@
|
|
1
|
-
|
1
|
+
/**
|
2
|
+
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
|
3
|
+
* Licensed under the LGPL or a commercial license.
|
4
|
+
* For LGPL see License.txt in the project root for license information.
|
5
|
+
* For commercial licenses see https://www.tiny.cloud/
|
6
|
+
*
|
7
|
+
* Version: 5.0.0-1 (2019-02-04)
|
8
|
+
*/
|
9
|
+
!function(){"use strict";var i=function(e){var n=e,t=function(){return n};return{get:t,set:function(e){n=e},clone:function(){return i(t())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(e){return{isFullscreen:function(){return null!==e.get()}}},n=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),g=function(e,n){e.fire("FullscreenStateChanged",{state:n})},m=n.DOM,r=function(e,n){var t,r,o,i,l,c,u=document.body,s=document.documentElement,d=n.get(),a=function(){var e,n,t,i;m.setStyle(o,"height",(t=window,i=document.body,i.offsetWidth&&(e=i.offsetWidth,n=i.offsetHeight),t.innerWidth&&t.innerHeight&&(e=t.innerWidth,n=t.innerHeight),{w:e,h:n}).h-(r.clientHeight-o.clientHeight))},f=function(){m.unbind(window,"resize",a)};if(t=(r=e.getContainer()).style,i=(o=e.getContentAreaContainer().firstChild).style,d)i.width=d.iframeWidth,i.height=d.iframeHeight,d.containerWidth&&(t.width=d.containerWidth),d.containerHeight&&(t.height=d.containerHeight),m.removeClass(u,"tox-fullscreen"),m.removeClass(s,"tox-fullscreen"),m.removeClass(r,"tox-fullscreen"),l=d.scrollPos,window.scrollTo(l.x,l.y),m.unbind(window,"resize",d.resizeHandler),e.off("remove",d.removeHandler),n.set(null),g(e,!1);else{var h={scrollPos:(c=m.getViewPort(),{x:c.x,y:c.y}),containerWidth:t.width,containerHeight:t.height,iframeWidth:i.width,iframeHeight:i.height,resizeHandler:a,removeHandler:f};i.width=i.height="100%",t.width=t.height="",m.addClass(u,"tox-fullscreen"),m.addClass(s,"tox-fullscreen"),m.addClass(r,"tox-fullscreen"),m.bind(window,"resize",a),e.on("remove",f),a(),n.set(h),g(e,!0)}},o=function(e,n){e.addCommand("mceFullScreen",function(){r(e,n)})},l=function(t,i){return function(n){n.setActive(null!==i.get());var e=function(e){return n.setActive(e.state)};return t.on("FullscreenStateChanged",e),function(){return t.off("FullscreenStateChanged",e)}}},c=function(e,n){e.ui.registry.addToggleMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Meta+Shift+F",onAction:function(){return e.execCommand("mceFullScreen")},onSetup:l(e,n)}),e.ui.registry.addToggleButton("fullscreen",{tooltip:"Fullscreen",icon:"fullscreen",onAction:function(){return e.execCommand("mceFullScreen")},onSetup:l(e,n)})};e.add("fullscreen",function(e){var n=i(null);return e.settings.inline||(o(e,n),c(e,n),e.addShortcut("Meta+Shift+F","","mceFullScreen")),t(n)}),function u(){}}();
|
@@ -1 +1,9 @@
|
|
1
|
-
|
1
|
+
/**
|
2
|
+
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
|
3
|
+
* Licensed under the LGPL or a commercial license.
|
4
|
+
* For LGPL see License.txt in the project root for license information.
|
5
|
+
* For commercial licenses see https://www.tiny.cloud/
|
6
|
+
*
|
7
|
+
* Version: 5.0.0-1 (2019-02-04)
|
8
|
+
*/
|
9
|
+
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(e){return function(){return e}};function d(r){for(var o=[],e=1;e<arguments.length;e++)o[e-1]=arguments[e];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=o.concat(e);return r.apply(null,n)}}var n,r,o,a,i,u,c=t(!1),l=t(!0),s=c,m=l,f=function(){return p},p=(a={fold:function(e,t){return e()},is:s,isSome:s,isNone:m,getOr:o=function(e){return e},getOrThunk:r=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:o,orThunk:r,map:f,ap:f,each:function(){},bind:f,flatten:f,exists:s,forall:m,filter:f,equals:n=function(e){return e.isNone()},equals_:n,toArray:function(){return[]},toString:t("none()")},Object.freeze&&Object.freeze(a),a),y=function(n){var e=function(){return n},t=function(){return o},r=function(e){return e(n)},o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:m,isNone:s,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return y(e(n))},ap:function(e){return e.fold(f,function(e){return y(e(n))})},each:function(e){e(n)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(n)?o:p},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(s,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},h={some:y,none:f,from:function(e){return null===e||e===undefined?p:y(e)}},k=(i="function",function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&Array.prototype.isPrototypeOf(e)?"array":"object"===t&&String.prototype.isPrototypeOf(e)?"string":t}(e)===i}),g=(u=Array.prototype.indexOf)===undefined?function(e,t){return A(e,t)}:function(e,t){return u.call(e,t)},v=function(e,t){return-1<g(e,t)},b=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var a=e[o];r[o]=t(a,o,e)}return r},A=function(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n]===t)return n;return-1},C=(Array.prototype.slice,k(Array.from)&&Array.from,[{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:["Ctrl + Alt + 1"],action:"Header 1"},{shortcuts:["Ctrl + Alt + 2"],action:"Header 2"},{shortcuts:["Ctrl + Alt + 3"],action:"Header 3"},{shortcuts:["Ctrl + Alt + 4"],action:"Header 4"},{shortcuts:["Ctrl + Alt + 5"],action:"Header 5"},{shortcuts:["Ctrl + Alt + 6"],action:"Header 6"},{shortcuts:["Ctrl + Alt + 7"],action:"Paragraph"},{shortcuts:["Ctrl + Alt + 8"],action:"Div"},{shortcuts:["Ctrl + Alt + 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"}]),M=Object.keys,O=Object.hasOwnProperty,S=tinymce.util.Tools.resolve("tinymce.Env"),w=function(e){var o=S.mac?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘"}:{meta:"Ctrl "},t=e.split("+"),n=b(t,function(e){var t,n,r=e.toLowerCase().trim();return t=o,n=r,O.call(t,n)?o[r]:e});return S.mac?n.join("").replace(/\s/,""):n.join("+")},P=function(){return{title:"Handy Shortcuts",items:[{type:"table",header:["Action","Shortcut"],cells:b(C,function(e){var t=b(e.shortcuts,w).join(" or ");return[e.action,t]})}]}},T=function(e,o){return e.replace(/\$\{([^{}]*)\}/g,function(e,t){var n,r=o[t];return"string"==(n=typeof r)||"number"===n?r.toString():e})},x=tinymce.util.Tools.resolve("tinymce.util.I18n"),_=[{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*"}],F=function(e){var t,n,r,o,a,i,u,c,l,s,m=d(T,'<a href="${url}" target="_blank" rel="noopener">${name}</a>'),f=function(t,n){return function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n,e))return h.some(o)}return h.none()}(_,function(e){return e.key===n}).fold(function(){var e=t.plugins[n].getMetadata;return"function"==typeof e?m(e()):n},function(e){return m({name:e.name,url:"https://www.tiny.cloud/docs/plugins/"+e.key})})};return{title:"Plugins",items:[{type:"htmlpanel",html:[(n=e,null==n?"":'<div data-mce-tabstop="1" tabindex="-1">'+(r=n,i=M((o=r).plugins),u=o.settings.forced_plugins===undefined?i:function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var a=e[r];t(a,r,e)&&n.push(a)}return n}(i,(a=d(v,o.settings.forced_plugins),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!a.apply(null,e)})),c=b(u,function(e){return"<li>"+f(r,e)+"</li>"}),l=c.length,s=c.join(""),"<p><b>"+x.translate(["Plugins installed ({0}):",l])+"</b></p><ul>"+s+"</ul>")+"</div>"),(t=b(["Accessibility Checker","Advanced Code Editor","Tiny Comments","Tiny Drive","Enhanced Media Embed","Format Painter","Link Checker","Mentions","MoxieManager","PowerPaste","Spell Checker Pro"],function(e){return"<li>"+x.translate(e)+"</li>"}).join(""),'<div data-mce-tabstop="1" tabindex="-1"><p><b>'+x.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">'+x.translate("Learn more...")+"</a></li></ul></div>")].join("")}]}},H=tinymce.util.Tools.resolve("tinymce.EditorManager"),j=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=H.majorVersion,t=H.minorVersion,0===e.indexOf("@")?"X.X.X":e+"."+t)+"</a>";return{title:"Version",items:[{type:"htmlpanel",html:"<p>"+x.translate(["You are using {0}",n])+"</p>"}]}},E=function(t){return function(){var e={type:"tabpanel",tabs:[P(),F(t),j()]};t.windowManager.open({title:"Help",size:"medium",body:e,buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{}})}},D=function(e){e.addCommand("mceHelp",E(e))},I=function(e){e.ui.registry.addButton("help",{icon:"help",tooltip:"Help",onAction:E(e)}),e.ui.registry.addMenuItem("help",{text:"Help",icon:"help",shortcut:"Alt+0",onAction:E(e)})};e.add("help",function(e){I(e),D(e),e.shortcuts.add("Alt+0","Open help dialog","mceHelp")}),function L(){}}();
|
@@ -1 +1,9 @@
|
|
1
|
-
|
1
|
+
/**
|
2
|
+
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
|
3
|
+
* Licensed under the LGPL or a commercial license.
|
4
|
+
* For LGPL see License.txt in the project root for license information.
|
5
|
+
* For commercial licenses see https://www.tiny.cloud/
|
6
|
+
*
|
7
|
+
* Version: 5.0.0-1 (2019-02-04)
|
8
|
+
*/
|
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")}})};n.add("hr",function(n){o(n),t(n)}),function e(){}}();
|
@@ -1 +1,9 @@
|
|
1
|
-
!function(l){"use strict";var i,e=tinymce.util.Tools.resolve("tinymce.PluginManager"),d=function(e){return!1!==e.settings.image_dimensions},u=function(e){return!0===e.settings.image_advtab},m=function(e){return e.getParam("image_prepend_url","")},n=function(e){return e.getParam("image_class_list")},r=function(e){return!1!==e.settings.image_description},a=function(e){return!0===e.settings.image_title},o=function(e){return!0===e.settings.image_caption},c=function(e){return e.getParam("image_list",!1)},s=function(e){return e.getParam("images_upload_url",!1)},g=function(e){return e.getParam("images_upload_handler",!1)},f=function(e){return e.getParam("images_upload_url")},p=function(e){return e.getParam("images_upload_handler")},h=function(e){return e.getParam("images_upload_base_path")},v=function(e){return e.getParam("images_upload_credentials")},b="undefined"!=typeof l.window?l.window:Function("return this;")(),y=function(e,t){return function(e,t){for(var n=t!==undefined&&null!==t?t:b,r=0;r<e.length&&n!==undefined&&null!==n;++r)n=n[e[r]];return n}(e.split("."),t)},x={getOrDie:function(e,t){var n=y(e,t);if(n===undefined||null===n)throw new Error(e+" not available on this browser");return n}},w=tinymce.util.Tools.resolve("tinymce.util.Promise"),C=tinymce.util.Tools.resolve("tinymce.util.Tools"),S=tinymce.util.Tools.resolve("tinymce.util.XHR"),N=function(e,t){return Math.max(parseInt(e,10),parseInt(t,10))},_=function(e,n){var r=l.document.createElement("img");function t(e,t){r.parentNode&&r.parentNode.removeChild(r),n({width:e,height:t})}r.onload=function(){t(N(r.width,r.clientWidth),N(r.height,r.clientHeight))},r.onerror=function(){t(0,0)};var a=r.style;a.visibility="hidden",a.position="fixed",a.bottom=a.left="0px",a.width=a.height="auto",l.document.body.appendChild(r),r.src=e},T=function(e,a,t){return function n(e,r){return r=r||[],C.each(e,function(e){var t={text:e.text||e.title};e.menu?t.menu=n(e.menu):(t.value=e.value,a(t)),r.push(t)}),r}(e,t||[])},A=function(e){return e&&(e=e.replace(/px$/,"")),e},R=function(e){return 0<e.length&&/^[0-9]+$/.test(e)&&(e+="px"),e},I=function(e){if(e.margin){var t=e.margin.split(" ");switch(t.length){case 1:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[0],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[0];break;case 2:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[1];break;case 3:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[1];break;case 4:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[3]}delete e.margin}return e},t=function(e,t){var n=c(e);"string"==typeof n?S.send({url:n,success:function(e){t(JSON.parse(e))}}):"function"==typeof n?n(t):t(n)},O=function(e,t,n){function r(){n.onload=n.onerror=null,e.selection&&(e.selection.select(n),e.nodeChanged())}n.onload=function(){t.width||t.height||!d(e)||e.dom.setAttribs(n,{width:n.clientWidth,height:n.clientHeight}),r()},n.onerror=r},L=function(r){return new w(function(e,t){var n=new(x.getOrDie("FileReader"));n.onload=function(){e(n.result)},n.onerror=function(){t(n.error.message)},n.readAsDataURL(r)})},P=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),U=Object.prototype.hasOwnProperty,E=(i=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 n={},r=0;r<e.length;r++){var a=e[r];for(var o in a)U.call(a,o)&&(n[o]=i(n[o],a[o]))}return n}),k=P.DOM,M=function(e){return e.style.marginLeft&&e.style.marginRight&&e.style.marginLeft===e.style.marginRight?A(e.style.marginLeft):""},D=function(e){return e.style.marginTop&&e.style.marginBottom&&e.style.marginTop===e.style.marginBottom?A(e.style.marginTop):""},z=function(e){return e.style.borderWidth?A(e.style.borderWidth):""},B=function(e,t){return e.hasAttribute(t)?e.getAttribute(t):""},H=function(e,t){return e.style[t]?e.style[t]:""},j=function(e){return null!==e.parentNode&&"FIGURE"===e.parentNode.nodeName},F=function(e,t,n){e.setAttribute(t,n)},W=function(e){var t,n,r,a;j(e)?(a=(r=e).parentNode,k.insertAfter(r,a),k.remove(a)):(t=e,n=k.create("figure",{"class":"image"}),k.insertAfter(n,t),n.appendChild(t),n.appendChild(k.create("figcaption",{contentEditable:!0},"Caption")),n.contentEditable="false")},J=function(e,t){var n=e.getAttribute("style"),r=t(null!==n?n:"");0<r.length?(e.setAttribute("style",r),e.setAttribute("data-mce-style",r)):e.removeAttribute("style")},V=function(e,r){return function(e,t,n){e.style[t]?(e.style[t]=R(n),J(e,r)):F(e,t,n)}},G=function(e,t){return e.style[t]?A(e.style[t]):B(e,t)},$=function(e,t){var n=R(t);e.style.marginLeft=n,e.style.marginRight=n},X=function(e,t){var n=R(t);e.style.marginTop=n,e.style.marginBottom=n},q=function(e,t){var n=R(t);e.style.borderWidth=n},K=function(e,t){e.style.borderStyle=t},Q=function(e){return"FIGURE"===e.nodeName},Y=function(e,t){var n=l.document.createElement("img");return F(n,"style",t.style),(M(n)||""!==t.hspace)&&$(n,t.hspace),(D(n)||""!==t.vspace)&&X(n,t.vspace),(z(n)||""!==t.border)&&q(n,t.border),(H(n,"borderStyle")||""!==t.borderStyle)&&K(n,t.borderStyle),e(n.getAttribute("style"))},Z=function(e,t){return{src:B(t,"src"),alt:B(t,"alt"),title:B(t,"title"),width:G(t,"width"),height:G(t,"height"),"class":B(t,"class"),style:e(B(t,"style")),caption:j(t),hspace:M(t),vspace:D(t),border:z(t),borderStyle:H(t,"borderStyle")}},ee=function(e,t,n,r,a){n[r]!==t[r]&&a(e,r,n[r])},te=function(r,a){return function(e,t,n){r(e,n),J(e,a)}},ne=function(e,t,n){var r=Z(e,n);ee(n,r,t,"caption",function(e,t,n){return W(e)}),ee(n,r,t,"src",F),ee(n,r,t,"alt",F),ee(n,r,t,"title",F),ee(n,r,t,"width",V(0,e)),ee(n,r,t,"height",V(0,e)),ee(n,r,t,"class",F),ee(n,r,t,"style",te(function(e,t){return F(e,"style",t)},e)),ee(n,r,t,"hspace",te($,e)),ee(n,r,t,"vspace",te(X,e)),ee(n,r,t,"border",te(q,e)),ee(n,r,t,"borderStyle",te(K,e))},re=function(e,t){var n=e.dom.styles.parse(t),r=I(n),a=e.dom.styles.parse(e.dom.styles.serialize(r));return e.dom.styles.serialize(a)},ae=function(e){var t=e.selection.getNode(),n=e.dom.getParent(t,"figure.image");return n?e.dom.select("img",n)[0]:t&&("IMG"!==t.nodeName||t.getAttribute("data-mce-object")||t.getAttribute("data-mce-placeholder"))?null:t},oe=function(t,e){var n=t.dom,r=n.getParent(e.parentNode,function(e){return t.schema.getTextBlockElements()[e.nodeName]},t.getBody());return r?n.split(r,e):e},ie=function(t){var e=ae(t);return e?Z(function(e){return re(t,e)},e):{src:"",alt:"",title:"",width:"",height:"","class":"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:""}},le=function(t,e){var n=function(e,t){var n=l.document.createElement("img");if(ne(e,E(t,{caption:!1}),n),F(n,"alt",t.alt),t.caption){var r=k.create("figure",{"class":"image"});return r.appendChild(n),r.appendChild(k.create("figcaption",{contentEditable:!0},"Caption")),r.contentEditable="false",r}return n}(function(e){return re(t,e)},e);t.dom.setAttrib(n,"data-mce-id","__mcenew"),t.focus(),t.selection.setContent(n.outerHTML);var r=t.dom.select('*[data-mce-id="__mcenew"]')[0];if(t.dom.setAttrib(r,"data-mce-id",null),Q(r)){var a=oe(t,r);t.selection.select(a)}else t.selection.select(r)},ue=function(e,t){var n=ae(e);n?t.src?function(t,e){var n,r=ae(t);if(ne(function(e){return re(t,e)},e,r),n=r,t.dom.setAttrib(n,"src",n.getAttribute("src")),Q(r.parentNode)){var a=r.parentNode;oe(t,a),t.selection.select(r.parentNode)}else t.selection.select(r),O(t,e,r)}(e,t):function(e,t){if(t){var n=e.dom.is(t.parentNode,"figure.image")?t.parentNode:t;e.dom.remove(n),e.focus(),e.nodeChanged(),e.dom.isEmpty(e.getBody())&&(e.setContent(""),e.selection.setCursorLocation())}}(e,n):t.src&&le(e,t)},ce=function(n,r){r.find("#style").each(function(e){var t=Y(function(e){return re(n,e)},E({src:"",alt:"",title:"",width:"",height:"","class":"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:""},r.toJSON()));e.value(t)})},se=function(t){return{title:"Advanced",type:"form",pack:"start",items:[{label:"Style",name:"style",type:"textbox",onchange:(o=t,function(e){var t=o.dom,n=e.control.rootControl;if(u(o)){var r=n.toJSON(),a=t.parseStyle(r.style);n.find("#vspace").value(""),n.find("#hspace").value(""),((a=I(a))["margin-top"]&&a["margin-bottom"]||a["margin-right"]&&a["margin-left"])&&(a["margin-top"]===a["margin-bottom"]?n.find("#vspace").value(A(a["margin-top"])):n.find("#vspace").value(""),a["margin-right"]===a["margin-left"]?n.find("#hspace").value(A(a["margin-right"])):n.find("#hspace").value("")),a["border-width"]?n.find("#border").value(A(a["border-width"])):n.find("#border").value(""),a["border-style"]?n.find("#borderStyle").value(a["border-style"]):n.find("#borderStyle").value(""),n.find("#style").value(t.serializeStyle(t.parseStyle(t.serializeStyle(a))))}})},{type:"form",layout:"grid",packV:"start",columns:2,padding:0,defaults:{type:"textbox",maxWidth:50,onchange:function(e){ce(t,e.control.rootControl)}},items:[{label:"Vertical space",name:"vspace"},{label:"Border width",name:"border"},{label:"Horizontal space",name:"hspace"},{label:"Border style",type:"listbox",name:"borderStyle",width:90,maxWidth:90,onselect:function(e){ce(t,e.control.rootControl)},values:[{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"}]}]}]};var o},de=function(e,t){e.state.set("oldVal",e.value()),t.state.set("oldVal",t.value())},me=function(e,t){var n=e.find("#width")[0],r=e.find("#height")[0],a=e.find("#constrain")[0];n&&r&&a&&t(n,r,a.checked())},ge=function(e,t,n){var r=e.state.get("oldVal"),a=t.state.get("oldVal"),o=e.value(),i=t.value();n&&r&&a&&o&&i&&(o!==r?(i=Math.round(o/r*i),isNaN(i)||t.value(i)):(o=Math.round(i/a*o),isNaN(o)||e.value(o))),de(e,t)},fe=function(e){me(e,ge)},pe=function(){var e=function(e){fe(e.control.rootControl)};return{type:"container",label:"Dimensions",layout:"flex",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:5,size:5,onchange:e,ariaLabel:"Width"},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:5,size:5,onchange:e,ariaLabel:"Height"},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}},he=function(e){me(e,de)},ve=fe,be=function(e){e.meta=e.control.rootControl.toJSON()},ye=function(s,e){var t=[{name:"src",type:"filepicker",filetype:"image",label:"Source",autofocus:!0,onchange:function(e){var t,n,r,a,o,i,l,u,c;n=s,i=(t=e).meta||{},l=t.control,u=l.rootControl,(c=u.find("#image-list")[0])&&c.value(n.convertURL(l.value(),"src")),C.each(i,function(e,t){u.find("#"+t).value(e)}),i.width||i.height||(r=n.convertURL(l.value(),"src"),a=m(n),o=new RegExp("^(?:[a-z]+:)?//","i"),a&&!o.test(r)&&r.substring(0,a.length)!==a&&(r=a+r),l.value(r),_(n.documentBaseURI.toAbsolute(l.value()),function(e){e.width&&e.height&&d(n)&&(u.find("#width").value(e.width),u.find("#height").value(e.height),he(u))}))},onbeforecall:be},e];return r(s)&&t.push({name:"alt",type:"textbox",label:"Image description"}),a(s)&&t.push({name:"title",type:"textbox",label:"Image Title"}),d(s)&&t.push(pe()),n(s)&&t.push({name:"class",type:"listbox",label:"Class",values:T(n(s),function(e){e.value&&(e.textStyle=function(){return s.formatter.getCssText({inline:"img",classes:[e.value]})})})}),o(s)&&t.push({name:"caption",type:"checkbox",label:"Caption"}),t},xe=function(e,t){return{title:"General",type:"form",items:ye(e,t)}},we=ye,Ce=function(){return x.getOrDie("URL")},Se=function(e){return Ce().createObjectURL(e)},Ne=function(e){Ce().revokeObjectURL(e)},_e=tinymce.util.Tools.resolve("tinymce.ui.Factory"),Te=function(){};function Ae(i){var t=function(e,r,a,t){var o,n;(o=new(x.getOrDie("XMLHttpRequest"))).open("POST",i.url),o.withCredentials=i.credentials,o.upload.onprogress=function(e){t(e.loaded/e.total*100)},o.onerror=function(){a("Image upload failed due to a XHR Transport error. Code: "+o.status)},o.onload=function(){var e,t,n;o.status<200||300<=o.status?a("HTTP Error: "+o.status):(e=JSON.parse(o.responseText))&&"string"==typeof e.location?r((t=i.basePath,n=e.location,t?t.replace(/\/$/,"")+"/"+n.replace(/^\//,""):n)):a("Invalid JSON: "+o.responseText)},(n=new l.FormData).append("file",e.blob(),e.filename()),o.send(n)};return i=C.extend({credentials:!1,handler:t},i),{upload:function(e){return i.url||i.handler!==t?(r=e,a=i.handler,new w(function(e,t){try{a(r,e,t,Te)}catch(n){t(n.message)}})):w.reject("Upload url missing from the settings.");var r,a}}}var Re=function(u){return function(e){var t=_e.get("Throbber"),n=e.control.rootControl,r=new t(n.getEl()),a=e.control.value(),o=Se(a),i=Ae({url:f(u),basePath:h(u),credentials:v(u),handler:p(u)}),l=function(){r.hide(),Ne(o)};return r.show(),L(a).then(function(e){var t=u.editorUpload.blobCache.create({blob:a,blobUri:o,name:a.name?a.name.replace(/\.[^\.]+$/,""):null,base64:e.split(",")[1]});return i.upload(t).then(function(e){var t=n.find("#src");return t.value(e),n.find("tabpanel")[0].activateTab(0),t.fire("change"),l(),e})})["catch"](function(e){u.windowManager.alert(e),l()})}},Ie=".jpg,.jpeg,.png,.gif",Oe=function(e){return{title:"Upload",type:"form",layout:"flex",direction:"column",align:"stretch",padding:"20 20 20 20",items:[{type:"container",layout:"flex",direction:"column",align:"center",spacing:10,items:[{text:"Browse for an image",type:"browsebutton",accept:Ie,onchange:Re(e)},{text:"OR",type:"label"}]},{text:"Drop an image here",type:"dropzone",accept:Ie,height:100,onchange:Re(e)}]}};function Le(r){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 r.apply(null,n)}}var Pe=function(t,e){var n=e.control.getRoot();ve(n),t.undoManager.transact(function(){var e=E(ie(t),n.toJSON());ue(t,e)}),t.editorUpload.uploadImagesAuto()};function Ue(o){function e(e){var n,t,r=ie(o);if(e&&(t={type:"listbox",label:"Image list",name:"image-list",values:T(e,function(e){e.value=o.convertURL(e.value||e.url,"src")},[{text:"None",value:""}]),value:r.src&&o.convertURL(r.src,"src"),onselect:function(e){var t=n.find("#alt");(!t.value()||e.lastControl&&t.value()===e.lastControl.text())&&t.value(e.control.text()),n.find("#src").value(e.control.value()).fire("change")},onPostRender:function(){t=this}}),u(o)||s(o)||g(o)){var a=[xe(o,t)];u(o)&&a.push(se(o)),(s(o)||g(o))&&a.push(Oe(o)),n=o.windowManager.open({title:"Insert/edit image",data:r,bodyType:"tabpanel",body:a,onSubmit:Le(Pe,o)})}else n=o.windowManager.open({title:"Insert/edit image",data:r,body:we(o,t),onSubmit:Le(Pe,o)});he(n)}return{open:function(){t(o,e)}}}var Ee=function(e){e.addCommand("mceImage",Ue(e).open)},ke=function(o){return function(e){for(var t,n,r=e.length,a=function(e){e.attr("contenteditable",o?"true":null)};r--;)t=e[r],(n=t.attr("class"))&&/\bimage\b/.test(n)&&(t.attr("contenteditable",o?"false":null),C.each(t.getAll("figcaption"),a))}},Me=function(e){e.on("preInit",function(){e.parser.addNodeFilter("figure",ke(!0)),e.serializer.addNodeFilter("figure",ke(!1))})},De=function(e){e.addButton("image",{icon:"image",tooltip:"Insert/edit image",onclick:Ue(e).open,stateSelector:"img:not([data-mce-object],[data-mce-placeholder]),figure.image"}),e.addMenuItem("image",{icon:"image",text:"Image",onclick:Ue(e).open,context:"insert",prependToContext:!0})};e.add("image",function(e){Me(e),De(e),Ee(e)})}(window);
|
1
|
+
/**
|
2
|
+
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
|
3
|
+
* Licensed under the LGPL or a commercial license.
|
4
|
+
* For LGPL see License.txt in the project root for license information.
|
5
|
+
* For commercial licenses see https://www.tiny.cloud/
|
6
|
+
*
|
7
|
+
* Version: 5.0.0-1 (2019-02-04)
|
8
|
+
*/
|
9
|
+
!function(){"use strict";var e,n,t,r,i=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n]},h=function(e){return function(){return e}},a=function(e){return e},u=h(!1),s=h(!0),c=u,l=s,f=function(){return d},d=(r={fold:function(e,n){return e()},is:c,isSome:c,isNone:l,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:f,ap:f,each:function(){},bind:f,flatten:f,exists:c,forall:l,filter:f,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:h("none()")},Object.freeze&&Object.freeze(r),r),m=function(t){var e=function(){return t},n=function(){return i},r=function(e){return e(t)},i={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:l,isNone:c,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(f,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)?i:d},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(c,function(e){return n(t,e)})},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return i},y={some:m,none:f,from:function(e){return null===e||e===undefined?d:m(e)}},g=function(n){return function(e){return function(e){if(null===e)return"null";var n=typeof e;return"object"===n&&Array.prototype.isPrototypeOf(e)?"array":"object"===n&&String.prototype.isPrototypeOf(e)?"string":n}(e)===n}},w=g("string"),p=g("object"),v=g("function"),b=g("number"),O=function(e,n){for(var t=0,r=e.length;t<r;t++)n(e[t],t,e)},S=Array.prototype.push,N=function(e){for(var n=[],t=0,r=e.length;t<r;++t){if(!Array.prototype.isPrototypeOf(e[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+e);S.apply(n,e[t])}return n},x=(Array.prototype.slice,v(Array.from)&&Array.from,function(){return(x=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e}).apply(this,arguments)}),T=function(e){var t=y.none(),n=[],r=function(e){i()?a(e):n.push(e)},i=function(){return t.isSome()},o=function(e){O(e,a)},a=function(n){t.each(function(e){setTimeout(function(){n(e)},0)})};return e(function(e){t=y.some(e),o(n),n=[]}),{get:r,map:function(t){return T(function(n){r(function(e){n(t(e))})})},isReady:i}},E={nu:T,pure:function(n){return T(function(e){e(n)})}},D=function(n){var e=function(e){var r;n((r=e,function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=this;setTimeout(function(){r.apply(t,e)},0)}))},t=function(){return E.nu(e)};return{map:function(r){return D(function(t){e(function(e){var n=r(e);t(n)})})},bind:function(t){return D(function(n){e(function(e){t(e).get(n)})})},anonBind:function(t){return D(function(n){e(function(e){t.get(n)})})},toLazy:t,toCached:function(){var n=null;return D(function(e){null===n&&(n=t()),n.get(e)})},get:e}},A={nu:D,pure:function(n){return D(function(e){e(n)})}},C=function(t){return{is:function(e){return t===e},isValue:s,isError:u,getOr:h(t),getOrThunk:h(t),getOrDie:h(t),or:function(e){return C(t)},orThunk:function(e){return C(t)},fold:function(e,n){return n(t)},map:function(e){return C(e(t))},mapError:function(e){return C(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOption:function(){return y.some(t)}}},_=function(t){return{is:u,isValue:u,isError:s,getOr:a,getOrThunk:function(e){return e()},getOrDie:function(){return e=String(t),function(){throw new Error(e)}();var e},or:function(e){return e},orThunk:function(e){return e()},fold:function(e,n){return e(t)},map:function(e){return _(t)},mapError:function(e){return _(e(t))},each:o,bind:function(e){return _(t)},exists:u,forall:s,toOption:y.none}},I={value:C,error:_},R=function(o){return x({},o,{toCached:function(){return R(o.toCached())},bindFuture:function(n){return R(o.bind(function(e){return e.fold(function(e){return A.pure(I.error(e))},function(e){return n(e)})}))},bindResult:function(n){return R(o.map(function(e){return e.bind(n)}))},mapResult:function(n){return R(o.map(function(e){return e.map(n)}))},mapError:function(n){return R(o.map(function(e){return e.mapError(n)}))},foldResult:function(n,t){return o.map(function(e){return e.fold(n,t)})},withTimeout:function(e,i){return R(A.nu(function(n){var t=!1,r=window.setTimeout(function(){t=!0,n(I.error(i()))},e);o.get(function(e){t||(window.clearTimeout(r),n(e))})}))}})},L=function(e){return R(A.nu(e))},U=L,P=Object.prototype.hasOwnProperty,k=function(a){return 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 i=e[r];for(var o in i)P.call(i,o)&&(t[o]=a(t[o],i[o]))}return t}},M=k(function(e,n){return p(e)&&p(n)?M(e,n):n}),j=k(function(e,n){return n}),z="undefined"!=typeof window?window:Function("return this;")(),B=function(e,n){return function(e,n){for(var t=n!==undefined&&null!==n?n:z,r=0;r<e.length&&t!==undefined&&null!==t;++r)t=t[e[r]];return t}(e.split("."),n)},F={getOrDie:function(e,n){var t=B(e,n);if(t===undefined||null===t)throw e+" not available on this browser";return t}},H=function(){return F.getOrDie("URL")},W=function(e){return H().createObjectURL(e)},G=function(e){H().revokeObjectURL(e)},X=function(e){var n=e.imageList.map(function(e){return{name:"images",type:"selectbox",label:"Image list",items:e}}),t=e.classList.map(function(e){return{name:"classes",type:"selectbox",label:"Class",items:e}});return N([[{name:"src",type:"urlinput",filetype:"image",label:"Source"}],n.toArray(),e.hasDescription?[{name:"alt",type:"input",label:"Image description"}]:[],e.hasImageTitle?[{name:"title",type:"input",label:"Image title"}]:[],e.hasDimensions?[{name:"dimensions",type:"sizeinput"}]:[],[{type:"grid",columns:2,items:N([t.toArray(),e.hasImageCaption?[{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[]])}]])},$=function(e){return{title:"General",items:X(e)}},q=X,V=tinymce.util.Tools.resolve("tinymce.util.Promise"),J=tinymce.util.Tools.resolve("tinymce.util.Tools"),Y=tinymce.util.Tools.resolve("tinymce.util.XHR"),Z=function(e){return!1!==e.settings.image_dimensions},K=function(e){return!0===e.settings.image_advtab},Q=function(e){return e.getParam("image_prepend_url","")},ee=function(e){return e.getParam("image_class_list")},ne=function(e){return!1!==e.settings.image_description},te=function(e){return!0===e.settings.image_title},re=function(e){return!0===e.settings.image_caption},ie=function(e){return e.getParam("image_list",!1)},oe=function(e){return!!e.getParam("images_upload_url",!1)},ae=function(e){return!!e.getParam("images_upload_handler",!1)},ue=function(e){return e.getParam("images_upload_url")},se=function(e){return e.getParam("images_upload_handler")},ce=function(e){return e.getParam("images_upload_base_path")},le=function(e){return e.getParam("images_upload_credentials")},fe=function(e,n){return Math.max(parseInt(e,10),parseInt(n,10))},de=function(e,n){var t=document.createElement("img");function r(e){t.parentNode&&t.parentNode.removeChild(t),n(e)}t.onload=function(){var e={width:fe(t.width,t.clientWidth),height:fe(t.height,t.clientHeight)};r(I.value(e))},t.onerror=function(){r(I.error(undefined))};var i=t.style;i.visibility="hidden",i.position="fixed",i.bottom=i.left="0px",i.width=i.height="auto",document.body.appendChild(t),t.src=e},me=function(e){return e&&(e=e.replace(/px$/,"")),e},ge=function(e){return 0<e.length&&/^[0-9]+$/.test(e)&&(e+="px"),e},pe=function(e){if(e.margin){var n=String(e.margin).split(" ");switch(n.length){case 1:e["margin-top"]=e["margin-top"]||n[0],e["margin-right"]=e["margin-right"]||n[0],e["margin-bottom"]=e["margin-bottom"]||n[0],e["margin-left"]=e["margin-left"]||n[0];break;case 2:e["margin-top"]=e["margin-top"]||n[0],e["margin-right"]=e["margin-right"]||n[1],e["margin-bottom"]=e["margin-bottom"]||n[0],e["margin-left"]=e["margin-left"]||n[1];break;case 3:e["margin-top"]=e["margin-top"]||n[0],e["margin-right"]=e["margin-right"]||n[1],e["margin-bottom"]=e["margin-bottom"]||n[2],e["margin-left"]=e["margin-left"]||n[1];break;case 4:e["margin-top"]=e["margin-top"]||n[0],e["margin-right"]=e["margin-right"]||n[1],e["margin-bottom"]=e["margin-bottom"]||n[2],e["margin-left"]=e["margin-left"]||n[3]}delete e.margin}return e},he=function(e,n){var t=ie(e);"string"==typeof t?Y.send({url:t,success:function(e){n(JSON.parse(e))}}):"function"==typeof t?t(n):n(t)},ve=function(e,n,t){function r(){t.onload=t.onerror=null,e.selection&&(e.selection.select(t),e.nodeChanged())}t.onload=function(){n.width||n.height||!Z(e)||e.dom.setAttribs(t,{width:t.clientWidth,height:t.clientHeight}),r()},t.onerror=r},be=function(i){return new V(function(e,n){var t=function r(){return new(F.getOrDie("FileReader"))}();t.onload=function(){e(t.result)},t.onerror=function(){n(t.error.message)},t.readAsDataURL(i)})},ye=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils").DOM,we=function(e){return e.style.marginLeft&&e.style.marginRight&&e.style.marginLeft===e.style.marginRight?me(e.style.marginLeft):""},Oe=function(e){return e.style.marginTop&&e.style.marginBottom&&e.style.marginTop===e.style.marginBottom?me(e.style.marginTop):""},Se=function(e){return e.style.borderWidth?me(e.style.borderWidth):""},Ne=function(e,n){return e.hasAttribute(n)?e.getAttribute(n):""},xe=function(e,n){return e.style[n]?e.style[n]:""},Te=function(e){return null!==e.parentNode&&"FIGURE"===e.parentNode.nodeName},Ee=function(e,n,t){e.setAttribute(n,t)},De=function(e){var n,t,r,i;Te(e)?(i=(r=e).parentNode,ye.insertAfter(r,i),ye.remove(i)):(n=e,t=ye.create("figure",{"class":"image"}),ye.insertAfter(t,n),t.appendChild(n),t.appendChild(ye.create("figcaption",{contentEditable:!0},"Caption")),t.contentEditable="false")},Ae=function(e,n){var t=e.getAttribute("style"),r=n(null!==t?t:"");0<r.length?(e.setAttribute("style",r),e.setAttribute("data-mce-style",r)):e.removeAttribute("style")},Ce=function(e,r){return function(e,n,t){e.style[n]?(e.style[n]=ge(t),Ae(e,r)):Ee(e,n,t)}},_e=function(e,n){return e.style[n]?me(e.style[n]):Ne(e,n)},Ie=function(e,n){var t=ge(n);e.style.marginLeft=t,e.style.marginRight=t},Re=function(e,n){var t=ge(n);e.style.marginTop=t,e.style.marginBottom=t},Le=function(e,n){var t=ge(n);e.style.borderWidth=t},Ue=function(e,n){e.style.borderStyle=n},Pe=function(e){return"FIGURE"===e.nodeName},ke=function(e,n){var t=document.createElement("img");return Ee(t,"style",n.style),(we(t)||""!==n.hspace)&&Ie(t,n.hspace),(Oe(t)||""!==n.vspace)&&Re(t,n.vspace),(Se(t)||""!==n.border)&&Le(t,n.border),(xe(t,"borderStyle")||""!==n.borderStyle)&&Ue(t,n.borderStyle),e(t.getAttribute("style"))},Me=function(e,n){return{src:Ne(n,"src"),alt:Ne(n,"alt"),title:Ne(n,"title"),width:_e(n,"width"),height:_e(n,"height"),"class":Ne(n,"class"),style:e(Ne(n,"style")),caption:Te(n),hspace:we(n),vspace:Oe(n),border:Se(n),borderStyle:xe(n,"borderStyle")}},je=function(e,n,t,r,i){t[r]!==n[r]&&i(e,r,t[r])},ze=function(r,i){return function(e,n,t){r(e,t),Ae(e,i)}},Be=function(e,n,t){var r=Me(e,t);je(t,r,n,"caption",function(e,n,t){return De(e)}),je(t,r,n,"src",Ee),je(t,r,n,"alt",Ee),je(t,r,n,"title",Ee),je(t,r,n,"width",Ce(0,e)),je(t,r,n,"height",Ce(0,e)),je(t,r,n,"class",Ee),je(t,r,n,"style",ze(function(e,n){return Ee(e,"style",n)},e)),je(t,r,n,"hspace",ze(Ie,e)),je(t,r,n,"vspace",ze(Re,e)),je(t,r,n,"border",ze(Le,e)),je(t,r,n,"borderStyle",ze(Ue,e))},Fe=function(e,n){var t=e.dom.styles.parse(n),r=pe(t),i=e.dom.styles.parse(e.dom.styles.serialize(r));return e.dom.styles.serialize(i)},He=function(e){var n=e.selection.getNode(),t=e.dom.getParent(n,"figure.image");return t?e.dom.select("img",t)[0]:n&&("IMG"!==n.nodeName||n.getAttribute("data-mce-object")||n.getAttribute("data-mce-placeholder"))?null:n},We=function(n,e){var t=n.dom,r=t.getParent(e.parentNode,function(e){return n.schema.getTextBlockElements()[e.nodeName]},n.getBody());return r?t.split(r,e):e},Ge=function(n,e){var t=function(e,n){var t=document.createElement("img");if(Be(e,j(n,{caption:!1}),t),Ee(t,"alt",n.alt),n.caption){var r=ye.create("figure",{"class":"image"});return r.appendChild(t),r.appendChild(ye.create("figcaption",{contentEditable:!0},"Caption")),r.contentEditable="false",r}return t}(function(e){return Fe(n,e)},e);n.dom.setAttrib(t,"data-mce-id","__mcenew"),n.focus(),n.selection.setContent(t.outerHTML);var r=n.dom.select('*[data-mce-id="__mcenew"]')[0];if(n.dom.setAttrib(r,"data-mce-id",null),Pe(r)){var i=We(n,r);n.selection.select(i)}else n.selection.select(r)},Xe=function(e,n){var t=He(e);t?n.src?function(n,e){var t,r=He(n);if(Be(function(e){return Fe(n,e)},e,r),t=r,n.dom.setAttrib(t,"src",t.getAttribute("src")),Pe(r.parentNode)){var i=r.parentNode;We(n,i),n.selection.select(r.parentNode)}else n.selection.select(r),ve(n,e,r)}(e,n):function(e,n){if(n){var t=e.dom.is(n.parentNode,"figure.image")?n.parentNode:n;e.dom.remove(t),e.focus(),e.nodeChanged(),e.dom.isEmpty(e.getBody())&&(e.setContent(""),e.selection.setCursorLocation())}}(e,t):n.src&&Ge(e,n)},$e=function(e){return w(e.value)?e.value:""},qe=function(e,i){var o=[];return J.each(e,function(e){var n=w(e.text)?e.text:w(e.title)?e.title:"";if(e.menu!==undefined){var t=qe(e.menu,i);o.push({text:n,items:t})}else{var r=i(e);o.push({text:n,value:r})}}),o},Ve=function(n){return void 0===n&&(n=$e),function(e){return e?y.from(e).map(function(e){return qe(e,n)}):y.none()}},Je=function(e,t){return function(e,n){for(var t=0;t<e.length;t++){var r=n(e[t],t);if(r.isSome())return r}return y.none()}(e,function(e){return n=e,Object.prototype.hasOwnProperty.call(n,"items")?Je(e.items,t):e.value===t?y.some(e):y.none();var n})},Ye=Ve,Ze=function(e){return Ve($e)(e)},Ke=function(e,n){return e.bind(function(e){return Je(e,n)})},Qe=function(){};function en(u){var n=function(e,r,i,n){var o,t;(o=function a(){return new(F.getOrDie("XMLHttpRequest"))}()).open("POST",u.url),o.withCredentials=u.credentials,o.upload.onprogress=function(e){n(e.loaded/e.total*100)},o.onerror=function(){i("Image upload failed due to a XHR Transport error. Code: "+o.status)},o.onload=function(){var e,n,t;o.status<200||300<=o.status?i("HTTP Error: "+o.status):(e=JSON.parse(o.responseText))&&"string"==typeof e.location?r((n=u.basePath,t=e.location,n?n.replace(/\/$/,"")+"/"+t.replace(/^\//,""):t)):i("Invalid JSON: "+o.responseText)},(t=new FormData).append("file",e.blob(),e.filename()),o.send(t)};return u=J.extend({credentials:!1,handler:n},u),{upload:function(e){return u.url||u.handler!==n?(r=e,i=u.handler,new V(function(e,n){try{i(r,e,n,Qe)}catch(t){n(t.message)}})):V.reject("Upload url missing from the settings.");var r,i}}}var nn,tn,rn,on=function(e){return{title:"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"}]}]}]}},an=function(t){var n,e,r=Ye(function(e){return t.convertURL(e.value||e.url,"src")}),i=A.nu(function(n){he(t,function(e){n(r(e).map(function(e){return N([[{text:"None",value:""}],e])}))})}),o=Ze(ee(t)),a=K(t),u=oe(t),s=ae(t),c=(e=He(n=t))?Me(function(e){return Fe(n,e)},e):{src:"",alt:"",title:"",width:"",height:"","class":"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:""},l=ne(t),f=te(t),d=Z(t),m=re(t),g=ue(t),p=ce(t),h=le(t),v=se(t),b=y.some(Q(t)).filter(function(e){return w(e)&&0<e.length});return i.map(function(e){return{image:c,imageList:e,classList:o,hasAdvTab:a,hasUploadUrl:u,hasUploadHandler:s,hasDescription:l,hasImageTitle:f,hasDimensions:d,hasImageCaption:m,url:g,basePath:p,credentials:h,handler:v,prependURL:b}})},un=function(e){return{title:"Upload",items:[{type:"dropzone",name:"fileinput"}]}},sn=function(e){return{src:{value:e.src,meta:{}},images:e.src,alt:e.alt,title:e.title,dimensions:{width:e.width,height:e.height},classes:e["class"],caption:e.caption,style:e.style,vspace:e.vspace,border:e.border,hspace:e.hspace,borderstyle:e.borderStyle,fileinput:[]}},cn=function(e){return{src:e.src.value,alt:e.alt,title:e.title,width:e.dimensions.width,height:e.dimensions.height,"class":e.classes,style:e.style,caption:e.caption,hspace:e.hspace,vspace:e.vspace,border:e.border,borderStyle:e.borderstyle}},ln=function(e,n){var t,r,i=n.getData();(t=e,r=i.src.value,/^(?:[a-zA-Z]+:)?\/\//.test(r)?y.none():t.prependURL.bind(function(e){return r.substring(0,e.length)!==e?y.some(e+r):y.none()})).each(function(e){n.setData({src:{value:e,meta:i.src.meta}})})},fn=function(e,n){(function(e,n){var t=n.src.meta;if(t===undefined)return y.none();var r=M({},n);return e.hasDescription&&w(t.alt)&&(r.alt=t.alt),e.hasImageTitle&&w(t.title)&&(r.title=t.title),e.hasDimensions&&(w(t.width)&&(r.dimensions.width=t.width),w(t.height)&&(r.dimensions.height=t.height)),w(t["class"])&&Ke(e.classList,t["class"]).each(function(e){r.classes=e.value}),e.hasAdvTab&&(w(t.vspace)&&(r.vspace=t.vspace),w(t.border)&&(r.border=t.border),w(t.hspace)&&(r.hspace=t.hspace),w(t.borderstyle)&&(r.borderstyle=t.borderstyle)),y.some(r)})(e,n.getData()).each(function(e){return n.setData(e)})},dn=function(e,n,t,r){var i,o,a,u,s,c,l,f,d,m,g,p;ln(n,r),fn(n,r),i=e,o=n,a=t,s=(u=r).getData(),c=s.src.value,(l=s.src.meta||{}).width||l.height||!o.hasDimensions||i.imageSize(c).get(function(e){e.each(function(e){a.open&&u.setData({dimensions:e})})}),f=n,d=t,g=(m=r).getData(),p=Ke(f.imageList,g.src.value),d.prevImage=p,m.setData({images:p.map(function(e){return e.value}).getOr("")})},mn=function(e,n,t){var r,i,o,a,u,s=pe(e(t.style)),c=M({},t);return c.vspace=(r=s)["margin-top"]&&r["margin-bottom"]&&r["margin-top"]===r["margin-bottom"]?me(String(r["margin-top"])):"",c.hspace=(i=s)["margin-right"]&&i["margin-left"]&&i["margin-right"]===i["margin-left"]?me(String(i["margin-right"])):"",c.border=(o=s)["border-width"]?me(String(o["border-width"])):"",c.borderstyle=(a=s)["border-style"]?String(a["border-style"]):"",c.style=(u=n)(e(u(s))),c},gn=function(h,v,b){return function(e,n){var t,r,i,o,a,u,s,c,l,f,d,m,g,p;"src"===n.name?dn(h,v,b,e):"images"===n.name?(l=h,f=v,d=b,g=(m=e).getData(),(p=Ke(f.imageList,g.images)).each(function(e){""===g.alt||d.prevImage.map(function(e){return e.text===g.alt}).getOr(!1)?""===e.value?m.setData({src:e,alt:d.prevAlt}):m.setData({src:e,alt:e.text}):m.setData({src:e})}),d.prevImage=p,dn(l,f,d,m)):"alt"===n.name?b.prevAlt=e.getData().alt:"style"===n.name?(a=h,s=(u=e).getData(),c=mn(a.parseStyle,a.serializeStyle,s),u.setData(c)):"vspace"===n.name||"hspace"===n.name||"border"===n.name||"borderstyle"===n.name?(t=h,r=e,i=M(sn(v.image),r.getData()),o=ke(t.normalizeCss,cn(i)),r.setData({style:o})):"fileinput"===n.name&&function(t,r,i,o){var e=o.getData();o.block("Uploading image");var a=e.fileinput[0],u=W(a),s=en({url:r.url,basePath:r.basePath,credentials:r.credentials,handler:r.handler}),c=function(){o.unblock(),G(u)};be(a).then(function(e){var n=t.createBlobCache(a,u,e);s.upload(n).then(function(e){o.setData({src:{value:e,meta:{}}}),o.showTab("General"),dn(t,r,i,o),c()})["catch"](function(e){c(),t.alertErr(o,e)})})}(h,v,b,e)}},pn=function(o){return function(e){var n,t,r,i={prevImage:Ke((n=e).imageList,n.image.src),prevAlt:n.image.alt,open:!0};return{title:"Insert/Edit Image",size:"normal",body:(r=e,r.hasAdvTab||r.hasUploadUrl||r.hasUploadHandler?{type:"tabpanel",tabs:N([[$(r)],r.hasAdvTab?[on(r)]:[],r.hasUploadUrl||r.hasUploadHandler?[un(r)]:[]])}:{type:"panel",items:q(r)}),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:sn(e.image),onSubmit:o.onSubmit(e),onChange:gn(o,e,i),onClose:(t=i,function(){t.open=!1})}}},hn=function(n){var t,r,i,o,a,u,s,e={onSubmit:(s=n,function(t){return function(e){var n=M(sn(t.image),e.getData());s.undoManager.transact(function(){Xe(s,cn(n))}),s.editorUpload.uploadImagesAuto(),e.close()}}),imageSize:(u=n,function(e){return U(function(t){de(u.documentBaseURI.toAbsolute(e),function(e){var n=e.bind(function(e){return(w(e.width)||b(e.width))&&(w(e.height)||b(e.height))?I.value({width:String(e.width),height:String(e.height)}):I.error(undefined)});t(n)})})}),createBlobCache:(a=n,function(e,n,t){return a.editorUpload.blobCache.create({blob:e,blobUri:n,name:e.name?e.name.replace(/\.[^\.]+$/,""):null,base64:t.split(",")[1]})}),alertErr:(o=n,function(e,n){o.windowManager.alert(n,e.close)}),normalizeCss:(i=n,function(e){return Fe(i,e)}),parseStyle:(r=n,function(e){return r.dom.parseStyle(e)}),serializeStyle:(t=n,function(e,n){return t.dom.serializeStyle(e,n)})};return{open:function(){return an(n).map(pn(e)).get(function(e){n.windowManager.open(e)})}}},vn=function(e){e.addCommand("mceImage",hn(e).open)},bn=function(o){return function(e){for(var n,t,r=e.length,i=function(e){e.attr("contenteditable",o?"true":null)};r--;)n=e[r],(t=n.attr("class"))&&/\bimage\b/.test(t)&&(n.attr("contenteditable",o?"false":null),J.each(n.getAll("figcaption"),i))}},yn=function(e){e.on("preInit",function(){e.parser.addNodeFilter("figure",bn(!0)),e.serializer.addNodeFilter("figure",bn(!1))})},wn=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:h(e)}},On={fromHtml:function(e,n){var t=(n||document).createElement("div");if(t.innerHTML=e,!t.hasChildNodes()||1<t.childNodes.length)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return wn(t.childNodes[0])},fromTag:function(e,n){var t=(n||document).createElement(e);return wn(t)},fromText:function(e,n){var t=(n||document).createTextNode(e);return wn(t)},fromDom:wn,fromPoint:function(e,n,t){var r=e.dom();return y.from(r.elementFromPoint(n,t)).map(wn)}},Sn=(Node.ATTRIBUTE_NODE,Node.CDATA_SECTION_NODE,Node.COMMENT_NODE,Node.DOCUMENT_NODE,Node.DOCUMENT_TYPE_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE,Node.TEXT_NODE,Node.PROCESSING_INSTRUCTION_NODE,Node.ENTITY_REFERENCE_NODE,Node.ENTITY_NODE,Node.NOTATION_NODE,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 xn(r(1),r(2))}),Nn=function(){return xn(0,0)},xn=function(e,n){return{major:e,minor:n}},Tn={nu:xn,detect:function(e,n){var t=String(n).toLowerCase();return 0===e.length?Nn():Sn(e,t)},unknown:Nn},En="Firefox",Dn=function(e,n){return function(){return n===e}},An=function(e){var n=e.current;return{current:n,version:e.version,isEdge:Dn("Edge",n),isChrome:Dn("Chrome",n),isIE:Dn("IE",n),isOpera:Dn("Opera",n),isFirefox:Dn(En,n),isSafari:Dn("Safari",n)}},Cn={unknown:function(){return An({current:undefined,version:Tn.unknown()})},nu:An,edge:h("Edge"),chrome:h("Chrome"),ie:h("IE"),opera:h("Opera"),firefox:h(En),safari:h("Safari")},_n="Windows",In="Android",Rn="Solaris",Ln="FreeBSD",Un=function(e,n){return function(){return n===e}},Pn=function(e){var n=e.current;return{current:n,version:e.version,isWindows:Un(_n,n),isiOS:Un("iOS",n),isAndroid:Un(In,n),isOSX:Un("OSX",n),isLinux:Un("Linux",n),isSolaris:Un(Rn,n),isFreeBSD:Un(Ln,n)}},kn={unknown:function(){return Pn({current:undefined,version:Tn.unknown()})},nu:Pn,windows:h(_n),ios:h("iOS"),android:h(In),linux:h("Linux"),osx:h("OSX"),solaris:h(Rn),freebsd:h(Ln)},Mn=function(e,n){var t=String(n).toLowerCase();return function(e,n){for(var t=0,r=e.length;t<r;t++){var i=e[t];if(n(i,t,e))return y.some(i)}return y.none()}(e,function(e){return e.search(t)})},jn=function(e,t){return Mn(e,t).map(function(e){var n=Tn.detect(e.versionRegexes,t);return{current:e.name,version:n}})},zn=function(e,t){return Mn(e,t).map(function(e){var n=Tn.detect(e.versionRegexes,t);return{current:e.name,version:n}})},Bn=function(e,n){return-1!==e.indexOf(n)},Fn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Hn=function(n){return function(e){return Bn(e,n)}},Wn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return Bn(e,"edge/")&&Bn(e,"chrome")&&Bn(e,"safari")&&Bn(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Fn],search:function(e){return Bn(e,"chrome")&&!Bn(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return Bn(e,"msie")||Bn(e,"trident")}},{name:"Opera",versionRegexes:[Fn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Hn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Hn("firefox")},{name:"Safari",versionRegexes:[Fn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(Bn(e,"safari")||Bn(e,"mobile/"))&&Bn(e,"applewebkit")}}],Gn=[{name:"Windows",search:Hn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return Bn(e,"iphone")||Bn(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Hn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Hn("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Hn("linux"),versionRegexes:[]},{name:"Solaris",search:Hn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Hn("freebsd"),versionRegexes:[]}],Xn={browsers:h(Wn),oses:h(Gn)},$n=function(e){var n,t,r,i,o,a,u,s,c,l,f,d=Xn.browsers(),m=Xn.oses(),g=jn(d,e).fold(Cn.unknown,Cn.nu),p=zn(m,e).fold(kn.unknown,kn.nu);return{browser:g,os:p,deviceType:(t=g,r=e,i=(n=p).isiOS()&&!0===/ipad/i.test(r),o=n.isiOS()&&!i,a=n.isAndroid()&&3===n.version.major,u=n.isAndroid()&&4===n.version.major,s=i||a||u&&!0===/mobile/i.test(r),c=n.isiOS()||n.isAndroid(),l=c&&!s,f=t.isSafari()&&n.isiOS()&&!1===/safari/i.test(r),{isiPad:h(i),isiPhone:h(o),isTablet:h(s),isPhone:h(l),isTouch:h(c),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:h(f)})}},qn=((nn=function(){var e=navigator.userAgent;return $n(e)},rn=!1,function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return rn||(rn=!0,tn=nn.apply(null,e)),tn}()).browser.isIE(),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n]}("element","offset"),function(o){o.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:hn(o).open,onSetup:function(e){return o.selection.selectorChangedWithUnbind("img:not([data-mce-object],[data-mce-placeholder]),figure.image",e.setActive).unbind}}),o.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:hn(o).open}),o.ui.registry.addContextMenu("image",{update:function(e){return Pe(e)||"IMG"===e.nodeName?[(i=e,{text:"Image",icon:"image",onAction:function(){var e,n,t,r=((nn=function(){var e=navigator.userAgent;return $n(e)},rn=!1,function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return rn||(rn=!0,tn=nn.apply(null,e)),tn}()).browser.isIE(),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n]}("element","offset"),e=On.fromDom(i),(n=e,t=n.dom(),y.from(t.parentNode).map(On.fromDom)).filter(function(e){return"figure"===e.dom().nodeName.toLowerCase()}).getOr(e));o.selection.select(r.dom()),hn(o).open()}})]:[];var i}})});i.add("image",function(e){yn(e),qn(e),vn(e)}),function Vn(){}}();
|
@@ -1 +1,9 @@
|
|
1
|
-
!function(m){"use strict";var r=function(t){var e=t,n=function(){return e};return{get:n,set:function(t){e=t},clone:function(){return r(n())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),G=tinymce.util.Tools.resolve("tinymce.util.Tools"),e=function(){},i=function(t){return function(){return t}};function a(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)}}var n,o,c,u,l=i(!1),f=i(!0),s=function(){return d},d=(n=function(t){return t.isNone()},u={fold:function(t,e){return t()},is:l,isSome:l,isNone:f,getOr:c=function(t){return t},getOrThunk:o=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(undefined),or:c,orThunk:o,map:s,each:e,bind:s,exists:l,forall:f,filter:s,equals:n,equals_:n,toArray:function(){return[]},toString:i("none()")},Object.freeze&&Object.freeze(u),u),h=function(n){var t=i(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:f,isNone:l,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:e,orThunk:e,map:function(t){return h(t(n))},each:function(t){t(n)},bind:r,exists:r,forall:r,filter:function(t){return t(n)?o:d},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(t){return t.is(n)},equals_:function(t,e){return t.fold(l,function(t){return e(n,t)})}};return o},g={some:h,none:s,from:function(t){return null===t||t===undefined?d:h(t)}};function p(t,e){return w(m.document.createElement("canvas"),t,e)}function v(t){var e=p(t.width,t.height);return y(e).drawImage(t,0,0),e}function y(t){return t.getContext("2d")}function w(t,e,n){return t.width=e,t.height=n,t}function b(t){return t.naturalWidth||t.width}function x(t){return t.naturalHeight||t.height}var k=window.Promise?window.Promise:function(){var i=function(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=null,this._value=null,this._deferreds=[],f(t,r(o,this),r(c,this))},t=i.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(t){m.setTimeout(t,1)};function r(t,e){return function(){return t.apply(e,arguments)}}var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function a(r){var o=this;null!==this._state?t(function(){var t=o._state?r.onFulfilled:r.onRejected;if(null!==t){var e;try{e=t(o._value)}catch(n){return void r.reject(n)}r.resolve(e)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function o(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void f(r(e,t),r(o,this),r(c,this))}this._state=!0,this._value=t,u.call(this)}catch(n){c.call(this,n)}}function c(t){this._state=!1,this._value=t,u.call(this)}function u(){for(var t=0,e=this._deferreds;t<e.length;t++){var n=e[t];a.call(this,n)}this._deferreds=[]}function l(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function f(t,e,n){var r=!1;try{t(function(t){r||(r=!0,e(t))},function(t){r||(r=!0,n(t))})}catch(o){if(r)return;r=!0,n(o)}}return i.prototype["catch"]=function(t){return this.then(null,t)},i.prototype.then=function(n,r){var o=this;return new i(function(t,e){a.call(o,new l(n,r,t,e))})},i.all=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var u=Array.prototype.slice.call(1===t.length&&n(t[0])?t[0]:t);return new i(function(o,i){if(0===u.length)return o([]);var a=u.length;function c(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){c(e,t)},i)}u[e]=t,0==--a&&o(u)}catch(r){i(r)}}for(var t=0;t<u.length;t++)c(t,u[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;n<r.length;n++)r[n].then(t,e)})},i}();function R(t){var r,e=t.src;return 0===e.indexOf("data:")?M(e):(r=e,new k(function(t,n){var e=new m.XMLHttpRequest;e.open("GET",r,!0),e.responseType="blob",e.onload=function(){200===this.status&&t(this.response)},e.onerror=function(){var t,e=this;n(0===this.status?((t=new Error("No access to download image")).code=18,t.name="SecurityError",t):new Error("Error "+e.status+" downloading image"))},e.send()}))}function I(c){return new k(function(t,e){var n=m.URL.createObjectURL(c),r=new m.Image,o=function(){r.removeEventListener("load",i),r.removeEventListener("error",a)};function i(){o(),t(r)}function a(){o(),e("Unable to load data of type "+c.type+": "+n)}r.addEventListener("load",i),r.addEventListener("error",a),r.src=n,r.complete&&i()})}function M(n){return new k(function(t,e){(function(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return g.none();for(var r=n[1],o=e[1],i=m.atob(o),a=i.length,c=Math.ceil(a/1024),u=new Array(c),l=0;l<c;++l){for(var f=1024*l,s=Math.min(f+1024,a),d=new Array(s-f),h=f,p=0;h<s;++p,++h)d[p]=i[h].charCodeAt(0);u[l]=new Uint8Array(d)}return g.some(new m.Blob(u,{type:r}))})(n).fold(function(){e("uri is not base64: "+n)},t)})}function T(t,r,o){return r=r||"image/png",m.HTMLCanvasElement.prototype.toBlob?new k(function(e,n){t.toBlob(function(t){t?e(t):n()},r,o)}):M(t.toDataURL(r,o))}function U(t){return I(t).then(function(t){var e;e=t,m.URL.revokeObjectURL(e.src);var n=p(b(t),x(t));return y(n).drawImage(t,0,0),n})}function C(t,e,n){var r=e.type;function o(r,o){return t.then(function(t){return n=o,e=(e=r)||"image/png",t.toDataURL(e,n);var e,n})}return{getType:i(r),toBlob:function(){return k.resolve(e)},toDataURL:function(){return n},toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(e,n){return t.then(function(t){return T(t,e,n)})},toAdjustedDataURL:o,toAdjustedBase64:function(t,e){return o(t,e).then(function(t){return t.split(",")[1]})},toCanvas:function(){return t.then(v)}}}function A(e){return(n=e,new k(function(t){var e=new m.FileReader;e.onloadend=function(){t(e.result)},e.readAsDataURL(n)})).then(function(t){return C(U(e),e,t)});var n}function E(e,t){return T(e,t).then(function(t){return C(k.resolve(e),t,e.toDataURL())})}function O(t,e,n){var r="string"==typeof t?parseFloat(t):t;return n<r?r=n:r<e&&(r=e),r}var _=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10];function j(t,e){for(var n,r=[],o=new Array(25),i=0;i<5;i++){for(var a=0;a<5;a++)r[a]=e[a+5*i];for(a=0;a<5;a++){for(var c=n=0;c<5;c++)n+=t[a+5*c]*r[c];o[a+5*i]=n}}return o}function z(t,n){return n=O(n,0,1),t.map(function(t,e){return e%6==0?t=1-(1-t)*n:t*=n,O(t,0,1)})}function L(a,c){return a.toCanvas().then(function(t){return e=t,n=a.getType(),r=c,o=y(e),i=function(t,e){for(var n,r,o,i,a=t.data,c=e[0],u=e[1],l=e[2],f=e[3],s=e[4],d=e[5],h=e[6],p=e[7],m=e[8],g=e[9],v=e[10],y=e[11],w=e[12],b=e[13],x=e[14],k=e[15],R=e[16],I=e[17],M=e[18],T=e[19],U=0;U<a.length;U+=4)n=a[U],r=a[U+1],o=a[U+2],i=a[U+3],a[U]=n*c+r*u+o*l+i*f+s,a[U+1]=n*d+r*h+o*p+i*m+g,a[U+2]=n*v+r*y+o*w+i*b+x,a[U+3]=n*k+r*R+o*I+i*M+T;return t}(o.getImageData(0,0,e.width,e.height),r),o.putImageData(i,0,0),E(e,n);var e,n,r,o,i})}function B(c,u){return c.toCanvas().then(function(t){return e=t,n=c.getType(),r=u,o=y(e),i=o.getImageData(0,0,e.width,e.height),a=o.getImageData(0,0,e.width,e.height),a=function(t,e,n){function r(t,e,n){return n<t?t=n:t<e&&(t=e),t}for(var o=Math.round(Math.sqrt(n.length)),i=Math.floor(o/2),a=t.data,c=e.data,u=t.width,l=t.height,f=0;f<l;f++)for(var s=0;s<u;s++){for(var d=0,h=0,p=0,m=0;m<o;m++)for(var g=0;g<o;g++){var v=r(s+g-i,0,u-1),y=r(f+m-i,0,l-1),w=4*(y*u+v),b=n[m*o+g];d+=a[w]*b,h+=a[w+1]*b,p+=a[w+2]*b}var x=4*(f*u+s);c[x]=r(d,0,255),c[x+1]=r(h,0,255),c[x+2]=r(p,0,255)}return e}(i,a,r),o.putImageData(a,0,0),E(e,n);var e,n,r,o,i,a})}function S(c){return function(e,n){return e.toCanvas().then(function(t){return function(t,e,n){for(var r=y(t),o=new Array(256),i=0;i<o.length;i++)o[i]=c(i,n);var a=function(t,e){for(var n=t.data,r=0;r<n.length;r+=4)n[r]=e[n[r]],n[r+1]=e[n[r+1]],n[r+2]=e[n[r+2]];return t}(r.getImageData(0,0,t.width,t.height),o);return r.putImageData(a,0,0),E(t,e)}(t,e.getType(),n)})}}function P(n){return function(t,e){return L(t,n([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],e))}}function H(e){return function(t){return B(t,e)}}var D,F=(D=[-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0,0,0,0,0,1],function(t){return L(t,D)}),V=P(function(t,e){return j(t,[1,0,0,0,e=O(255*e,-255,255),0,1,0,0,e,0,0,1,0,e,0,0,0,1,0,0,0,0,0,1])}),W=P(function(t,e){e=O(e,-180,180)/180*Math.PI;var n=Math.cos(e),r=Math.sin(e),o=.213,i=.715,a=.072;return j(t,[o+.787*n+r*-o,i+n*-i+r*-i,a+n*-a+.928*r,0,0,o+n*-o+.143*r,i+n*(1-i)+.14*r,a+n*-a+-.283*r,0,0,o+n*-o+-.787*r,i+n*-i+r*i,a+.928*n+r*a,0,0,0,0,0,1,0,0,0,0,0,1])}),N=P(function(t,e){var n=1+(0<(e=O(e,-1,1))?3*e:e);return j(t,[.3086*(1-n)+n,.6094*(1-n),.082*(1-n),0,0,.3086*(1-n),.6094*(1-n)+n,.082*(1-n),0,0,.3086*(1-n),.6094*(1-n),.082*(1-n)+n,0,0,0,0,0,1,0,0,0,0,0,1])}),q=P(function(t,e){var n;return e=O(e,-1,1),j(t,[(n=(e*=100)<0?127+e/100*127:127*(n=0==(n=e%1)?_[e]:_[Math.floor(e)]*(1-n)+_[Math.floor(e)+1]*n)+127)/127,0,0,0,.5*(127-n),0,n/127,0,0,.5*(127-n),0,0,n/127,0,.5*(127-n),0,0,0,1,0,0,0,0,0,1])}),$=P(function(t,e){return j(t,z([.33,.34,.33,0,0,.33,.34,.33,0,0,.33,.34,.33,0,0,0,0,0,1,0,0,0,0,0,1],e=O(e,0,1)))}),X=P(function(t,e){return j(t,z([.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0,0,0,0,0,1],e=O(e,0,1)))}),Y=function(t,e,n,r){return L(t,(o=n,i=r,j([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],[O(e,0,2),0,0,0,0,0,o=O(o,0,2),0,0,0,0,0,i=O(i,0,2),0,0,0,0,0,1,0,0,0,0,0,1])));var o,i},K=H([0,-1,0,-1,5,-1,0,-1,0]),J=H([-2,-1,0,-1,1,1,0,1,2]),Z=S(function(t,e){return 255*Math.pow(t/255,1-e)}),Q=S(function(t,e){return 255*(1-Math.exp(-t/255*e))});function tt(t,e,n){var r=b(t),o=x(t),i=e/r,a=n/o,c=!1;(i<.5||2<i)&&(i=i<.5?.5:2,c=!0),(a<.5||2<a)&&(a=a<.5?.5:2,c=!0);var u,l,f,s=(u=t,l=i,f=a,new k(function(t){var e=b(u),n=x(u),r=Math.floor(e*l),o=Math.floor(n*f),i=p(r,o),a=y(i);a.drawImage(u,0,0,e,n,0,0,r,o),t(i)}));return c?s.then(function(t){return tt(t,e,n)}):s}function et(u,l){return u.toCanvas().then(function(t){return e=t,n=u.getType(),r=l,o=p(e.width,e.height),i=y(o),90!==(r=r<(c=a=0)?360+r:r)&&270!==r||w(o,o.height,o.width),90!==r&&180!==r||(a=o.width),270!==r&&180!==r||(c=o.height),i.translate(a,c),i.rotate(r*Math.PI/180),i.drawImage(e,0,0),E(o,n);var e,n,r,o,i,a,c})}function nt(a,c){return a.toCanvas().then(function(t){return e=t,n=a.getType(),r=c,o=p(e.width,e.height),i=y(o),"v"===r?(i.scale(1,-1),i.drawImage(e,0,-o.height)):(i.scale(-1,1),i.drawImage(e,-o.width,0)),E(o,n);var e,n,r,o,i})}function rt(a,c,u,l,f){return a.toCanvas().then(function(t){return e=t,n=a.getType(),r=c,o=u,y(i=p(l,f)).drawImage(e,-r,-o),E(i,n);var e,n,r,o,i})}var ot=function(t){return F(t)},it=function(t){return K(t)},at=function(t){return J(t)},ct=function(t,e){return Z(t,e)},ut=function(t,e){return Q(t,e)},lt=function(t,e,n,r){return Y(t,e,n,r)},ft=function(t,e){return V(t,e)},st=function(t,e){return W(t,e)},dt=function(t,e){return N(t,e)},ht=function(t,e){return q(t,e)},pt=function(t,e){return $(t,e)},mt=function(t,e){return X(t,e)},gt=function(t,e){return nt(t,e)},vt=function(t,e,n,r,o){return rt(t,e,n,r,o)},yt=function(t,e,n){return o=e,i=n,(r=t).toCanvas().then(function(t){return tt(t,o,i).then(function(t){return E(t,r.getType())})});var r,o,i},wt=function(t,e){return et(t,e)},bt=function(t){return A(t)},xt="undefined"!=typeof m.window?m.window:Function("return this;")(),kt=function(t,e){return function(t,e){for(var n=e!==undefined&&null!==e?e:xt,r=0;r<t.length&&n!==undefined&&null!==n;++r)n=n[t[r]];return n}(t.split("."),e)},Rt=function(t,e){var n=kt(t,e);if(n===undefined||null===n)throw new Error(t+" not available on this browser");return n},It=function(){return Rt("URL")},Mt={createObjectURL:function(t){return It().createObjectURL(t)},revokeObjectURL:function(t){It().revokeObjectURL(t)}},Tt=tinymce.util.Tools.resolve("tinymce.util.Delay"),Ut=tinymce.util.Tools.resolve("tinymce.util.Promise"),Ct=tinymce.util.Tools.resolve("tinymce.util.URI"),At=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Et=tinymce.util.Tools.resolve("tinymce.ui.Factory"),Ot=tinymce.util.Tools.resolve("tinymce.geom.Rect"),_t=function(n){return new Ut(function(t){var e=function(){n.removeEventListener("load",e),t(n)};n.complete?t(n):n.addEventListener("load",e)})},jt=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),zt=tinymce.util.Tools.resolve("tinymce.util.Observable"),Lt=tinymce.util.Tools.resolve("tinymce.util.VK"),Bt=0,St={create:function(t){return new(Et.get("Control").extend({Defaults:{classes:"imagepanel"},selection:function(t){return arguments.length?(this.state.set("rect",t),this):this.state.get("rect")},imageSize:function(){var t=this.state.get("viewRect");return{w:t.w,h:t.h}},toggleCropRect:function(t){this.state.set("cropEnabled",t)},imageSrc:function(t){var o=this,i=new m.Image;i.src=t,_t(i).then(function(){var t,e,n=o.state.get("viewRect");if((e=o.$el.find("img"))[0])e.replaceWith(i);else{var r=m.document.createElement("div");r.className="mce-imagepanel-bg",o.getEl().appendChild(r),o.getEl().appendChild(i)}t={x:0,y:0,w:i.naturalWidth,h:i.naturalHeight},o.state.set("viewRect",t),o.state.set("rect",Ot.inflate(t,-20,-20)),n&&n.w===t.w&&n.h===t.h||o.zoomFit(),o.repaintImage(),o.fire("load")})},zoom:function(t){return arguments.length?(this.state.set("zoom",t),this):this.state.get("zoom")},postRender:function(){return this.imageSrc(this.settings.imageSrc),this._super()},zoomFit:function(){var t,e,n,r,o,i;t=this.$el.find("img"),e=this.getEl().clientWidth,n=this.getEl().clientHeight,r=t[0].naturalWidth,o=t[0].naturalHeight,1<=(i=Math.min((e-10)/r,(n-10)/o))&&(i=1),this.zoom(i)},repaintImage:function(){var t,e,n,r,o,i,a,c,u,l,f;f=this.getEl(),u=this.zoom(),l=this.state.get("rect"),a=this.$el.find("img"),c=this.$el.find(".mce-imagepanel-bg"),o=f.offsetWidth,i=f.offsetHeight,n=a[0].naturalWidth*u,r=a[0].naturalHeight*u,t=Math.max(0,o/2-n/2),e=Math.max(0,i/2-r/2),a.css({left:t,top:e,width:n,height:r}),c.css({left:t,top:e,width:n,height:r}),this.cropRect&&(this.cropRect.setRect({x:l.x*u+t,y:l.y*u+e,w:l.w*u,h:l.h*u}),this.cropRect.setClampRect({x:t,y:e,w:n,h:r}),this.cropRect.setViewPortRect({x:0,y:0,w:o,h:i}))},bindStates:function(){var r=this;function n(t){r.cropRect=function(l,n,f,r,o){var s,a,t,i,e="mce-",c=e+"crid-"+Bt++;function d(t,e){return{x:e.x-t.x,y:e.y-t.y,w:e.w,h:e.h}}function u(t,e,n,r){var o,i,a,c,u;o=e.x,i=e.y,a=e.w,c=e.h,o+=n*t.deltaX,i+=r*t.deltaY,(a+=n*t.deltaW)<20&&(a=20),(c+=r*t.deltaH)<20&&(c=20),u=l=Ot.clamp({x:o,y:i,w:a,h:c},f,"move"===t.name),u=d(f,u),s.fire("updateRect",{rect:u}),m(u)}function h(e){function t(t,e){e.h<0&&(e.h=0),e.w<0&&(e.w=0),jt("#"+c+"-"+t,r).css({left:e.x,top:e.y,width:e.w,height:e.h})}G.each(a,function(t){jt("#"+c+"-"+t.name,r).css({left:e.w*t.xMul+e.x,top:e.h*t.yMul+e.y})}),t("top",{x:n.x,y:n.y,w:n.w,h:e.y-n.y}),t("right",{x:e.x+e.w,y:e.y,w:n.w-e.x-e.w+n.x,h:e.h}),t("bottom",{x:n.x,y:e.y+e.h,w:n.w,h:n.h-e.y-e.h+n.y}),t("left",{x:n.x,y:e.y,w:e.x-n.x,h:e.h}),t("move",e)}function p(t){h(l=t)}function m(t){var e,n;p((e=f,{x:(n=t).x+e.x,y:n.y+e.y,w:n.w,h:n.h}))}return a=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}],i=["top","right","bottom","left"],jt('<div id="'+c+'" class="'+e+'croprect-container" role="grid" aria-dropeffect="execute">').appendTo(r),G.each(i,function(t){jt("#"+c,r).append('<div id="'+c+"-"+t+'"class="'+e+'croprect-block" style="display: none" data-mce-bogus="all">')}),G.each(a,function(t){jt("#"+c,r).append('<div id="'+c+"-"+t.name+'" class="'+e+"croprect-handle "+e+"croprect-handle-"+t.name+'"style="display: none" data-mce-bogus="all" role="gridcell" tabindex="-1" aria-label="'+t.label+'" aria-grabbed="false">')}),t=G.map(a,function(e){var n;return new(Et.get("DragHelper"))(c,{document:r.ownerDocument,handle:c+"-"+e.name,start:function(){n=l},drag:function(t){u(e,n,t.deltaX,t.deltaY)}})}),h(l),jt(r).on("focusin focusout",function(t){jt(t.target).attr("aria-grabbed","focus"===t.type)}),jt(r).on("keydown",function(e){var i;function t(t,e,n,r,o){t.stopPropagation(),t.preventDefault(),u(i,n,r,o)}switch(G.each(a,function(t){if(e.target.id===c+"-"+t.name)return i=t,!1}),e.keyCode){case Lt.LEFT:t(e,0,l,-10,0);break;case Lt.RIGHT:t(e,0,l,10,0);break;case Lt.UP:t(e,0,l,0,-10);break;case Lt.DOWN:t(e,0,l,0,10);break;case Lt.ENTER:case Lt.SPACEBAR:e.preventDefault(),o()}}),s=G.extend({toggleVisibility:function(t){var e;e=G.map(a,function(t){return"#"+c+"-"+t.name}).concat(G.map(i,function(t){return"#"+c+"-"+t})).join(","),t?jt(e,r).show():jt(e,r).hide()},setClampRect:function(t){f=t,h(l)},setRect:p,getInnerRect:function(){return d(f,l)},setInnerRect:m,setViewPortRect:function(t){n=t,h(l)},destroy:function(){G.each(t,function(t){t.destroy()}),t=[]}},zt)}(t,r.state.get("viewRect"),r.state.get("viewRect"),r.getEl(),function(){r.fire("crop")}),r.cropRect.on("updateRect",function(t){var e=t.rect,n=r.zoom();e={x:Math.round(e.x/n),y:Math.round(e.y/n),w:Math.round(e.w/n),h:Math.round(e.h/n)},r.state.set("rect",e)}),r.on("remove",r.cropRect.destroy)}r.state.on("change:cropEnabled",function(t){r.cropRect.toggleVisibility(t.value),r.repaintImage()}),r.state.on("change:zoom",function(){r.repaintImage()}),r.state.on("change:rect",function(t){var e=t.value;r.cropRect||n(e),r.cropRect.setRect(e)})}}))(t)}};function Pt(t){return{blob:t,url:Mt.createObjectURL(t)}}function Ht(t){t&&Mt.revokeObjectURL(t.url)}function Dt(t){G.each(t,Ht)}function Ft(i,a,t,e){var c,n,r,u,o,l,f,s,d,h,p,m,g,v,y,w,b,x,k,R,I,M,T,U,C,A,E,O=function(){var n=[],r=-1;function t(){return 0<r}function e(){return-1!==r&&r<n.length-1}return{data:n,add:function(t){var e;return e=n.splice(++r),n.push(t),{state:t,removed:e}},undo:function(){if(t())return n[--r]},redo:function(){if(e())return n[++r]},canUndo:t,canRedo:e}}(),_=function(t){return i.rtl?t.reverse():t};function j(t){var e,n,r,o;e=c.find("#w")[0],n=c.find("#h")[0],r=parseInt(e.value(),10),o=parseInt(n.value(),10),c.find("#constrain")[0].checked()&&U&&C&&r&&o&&("w"===t.control.settings.name?(o=Math.round(r*A),n.value(o)):(r=Math.round(o*E),e.value(r))),U=r,C=o}function z(t){return Math.round(100*t)+"%"}function L(){c.find("#undo").disabled(!O.canUndo()),c.find("#redo").disabled(!O.canRedo()),c.statusbar.find("#save").disabled(!O.canUndo())}function B(){c.find("#undo").disabled(!0),c.find("#redo").disabled(!0)}function S(t){t&&s.imageSrc(t.url)}function P(e){return function(){var t=G.grep(T,function(t){return t.settings.name!==e});G.each(t,function(t){t.hide()}),e.show(),e.focus()}}function H(t){S(u=Pt(t))}function D(t){S(a=Pt(t)),Dt(O.add(a).removed),L()}function F(){var e=s.selection();bt(a.blob).then(function(t){vt(t,e.x,e.y,e.w,e.h).then($).then(function(t){D(t),W()})})}var V=function(e){var n=[].slice.call(arguments,1);return function(){bt((u||a).blob).then(function(t){e.apply(this,[t].concat(n)).then($).then(H)})}};function W(){S(a),Ht(u),P(n)(),L()}function N(){u?(D(u.blob),W()):function t(e,n){u?n():setTimeout(function(){0<e--?t(e,n):i.windowManager.alert("Error: failed to apply image operation.")},10)}(100,N)}function q(t){return Et.create("Form",{layout:"flex",direction:"row",labelGap:5,border:"0 0 1 0",align:"center",pack:"center",padding:"0 10 0 10",spacing:5,flex:0,minHeight:60,defaults:{classes:"imagetool",type:"button"},items:t})}var $=function(t){return t.toBlob()};function X(t,e){return q(_([{text:"Back",onclick:W},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:N}])).hide().on("show",function(){B(),bt(a.blob).then(function(t){return e(t)}).then($).then(function(t){var e=Pt(t);S(e),Ht(u),u=e})})}function Y(t,n,e,r,o){return q(_([{text:"Back",onclick:W},{type:"spacer",flex:1},{type:"slider",flex:1,ondragend:function(t){var e;e=t.value,bt(a.blob).then(function(t){return n(t,e)}).then($).then(function(t){var e=Pt(t);S(e),Ht(u),u=e})},minValue:i.rtl?o:r,maxValue:i.rtl?r:o,value:e,previewFilter:z},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:N}])).hide().on("show",function(){this.find("slider").value(e),B()})}o=q(_([{text:"Back",onclick:W},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:F}])).hide().on("show hide",function(t){s.toggleCropRect("show"===t.type)}).on("show",B),l=q(_([{text:"Back",onclick:W},{type:"spacer",flex:1},{type:"textbox",name:"w",label:"Width",size:4,onkeyup:j},{type:"textbox",name:"h",label:"Height",size:4,onkeyup:j},{type:"checkbox",name:"constrain",text:"Constrain proportions",checked:!0,onchange:function(t){!0===t.control.value()&&(A=C/U,E=U/C)}},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:"submit"}])).hide().on("submit",function(t){var e=parseInt(c.find("#w").value(),10),n=parseInt(c.find("#h").value(),10);t.preventDefault(),function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=[].slice.call(arguments,1);return function(){bt(a.blob).then(function(t){e.apply(this,[t].concat(r)).then($).then(D)})}}(yt,e,n)(),W()}).on("show",B),f=q(_([{text:"Back",onclick:W},{type:"spacer",flex:1},{icon:"fliph",tooltip:"Flip horizontally",onclick:V(gt,"h")},{icon:"flipv",tooltip:"Flip vertically",onclick:V(gt,"v")},{icon:"rotateleft",tooltip:"Rotate counterclockwise",onclick:V(wt,-90)},{icon:"rotateright",tooltip:"Rotate clockwise",onclick:V(wt,90)},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:N}])).hide().on("show",B),p=X(0,ot),k=X(0,it),R=X(0,at),m=Y(0,ft,0,-1,1),g=Y(0,st,180,0,360),v=Y(0,dt,0,-1,1),y=Y(0,ht,0,-1,1),w=Y(0,pt,0,0,1),b=Y(0,mt,0,0,1),x=function(t,o){function e(){var e,n,r;e=c.find("#r")[0].value(),n=c.find("#g")[0].value(),r=c.find("#b")[0].value(),bt(a.blob).then(function(t){return o(t,e,n,r)}).then($).then(function(t){var e=Pt(t);S(e),Ht(u),u=e})}var n=i.rtl?2:0,r=i.rtl?0:2;return q(_([{text:"Back",onclick:W},{type:"spacer",flex:1},{type:"slider",label:"R",name:"r",minValue:n,value:1,maxValue:r,ondragend:e,previewFilter:z},{type:"slider",label:"G",name:"g",minValue:n,value:1,maxValue:r,ondragend:e,previewFilter:z},{type:"slider",label:"B",name:"b",minValue:n,value:1,maxValue:r,ondragend:e,previewFilter:z},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:N}])).hide().on("show",function(){c.find("#r,#g,#b").value(1),B()})}(0,lt),I=Y(0,ct,0,-1,1),M=Y(0,ut,1,0,2),r=q(_([{text:"Back",onclick:W},{type:"spacer",flex:1},{text:"hue",icon:"hue",onclick:P(g)},{text:"saturate",icon:"saturate",onclick:P(v)},{text:"sepia",icon:"sepia",onclick:P(b)},{text:"emboss",icon:"emboss",onclick:P(R)},{text:"exposure",icon:"exposure",onclick:P(M)},{type:"spacer",flex:1}])).hide(),n=q(_([{tooltip:"Crop",icon:"crop",onclick:P(o)},{tooltip:"Resize",icon:"resize2",onclick:P(l)},{tooltip:"Orientation",icon:"orientation",onclick:P(f)},{tooltip:"Brightness",icon:"sun",onclick:P(m)},{tooltip:"Sharpen",icon:"sharpen",onclick:P(k)},{tooltip:"Contrast",icon:"contrast",onclick:P(y)},{tooltip:"Color levels",icon:"drop",onclick:P(x)},{tooltip:"Gamma",icon:"gamma",onclick:P(I)},{tooltip:"Invert",icon:"invert",onclick:P(p)}])),s=St.create({flex:1,imageSrc:a.url}),d=Et.create("Container",{layout:"flex",direction:"column",pack:"start",border:"0 1 0 0",padding:5,spacing:5,items:[{type:"button",icon:"undo",tooltip:"Undo",name:"undo",onclick:function(){S(a=O.undo()),L()}},{type:"button",icon:"redo",tooltip:"Redo",name:"redo",onclick:function(){S(a=O.redo()),L()}},{type:"button",icon:"zoomin",tooltip:"Zoom in",onclick:function(){var t=s.zoom();t<2&&(t+=.1),s.zoom(t)}},{type:"button",icon:"zoomout",tooltip:"Zoom out",onclick:function(){var t=s.zoom();.1<t&&(t-=.1),s.zoom(t)}}]}),h=Et.create("Container",{type:"container",layout:"flex",direction:"row",align:"stretch",flex:1,items:_([d,s])}),T=[n,o,l,f,r,p,m,g,v,y,w,b,x,k,R,I,M],(c=i.windowManager.open({layout:"flex",direction:"column",align:"stretch",minWidth:Math.min(At.DOM.getViewPort().w,800),minHeight:Math.min(At.DOM.getViewPort().h,650),title:"Edit image",items:T.concat([h]),buttons:_([{text:"Save",name:"save",subtype:"primary",onclick:function(){t(a.blob),c.close()}},{text:"Cancel",onclick:"close"}])})).on("close",function(){e(),Dt(O.data),u=O=null}),O.add(a),L(),s.on("load",function(){U=s.imageSize().w,C=s.imageSize().h,A=C/U,E=U/C,c.find("#w").value(U),c.find("#h").value(C)}),s.on("crop",F)}var Vt,Wt={edit:function(r,t){return new Ut(function(e,n){return t.toBlob().then(function(t){Ft(r,Pt(t),e,n)})})}},Nt={getImageSize:function(t){var e,n;function r(t){return/^[0-9\.]+px$/.test(t)}return e=t.style.width,n=t.style.height,e||n?r(e)&&r(n)?{w:parseInt(e,10),h:parseInt(n,10)}:null:(e=t.width,n=t.height,e&&n?{w:parseInt(e,10),h:parseInt(n,10)}:null)},setImageSize:function(t,e){var n,r;e&&(n=t.style.width,r=t.style.height,(n||r)&&(t.style.width=e.w+"px",t.style.height=e.h+"px",t.removeAttribute("data-mce-style")),n=t.width,r=t.height,(n||r)&&(t.setAttribute("width",e.w),t.setAttribute("height",e.h)))},getNaturalImageSize:function(t){return{w:t.naturalWidth,h:t.naturalHeight}}},qt=(Vt="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)===Vt}),$t=(Array.prototype.slice,function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];if(e(o,n))return g.some(o)}return g.none()});qt(Array.from)&&Array.from;var Xt=function(t){return null!==t&&t!==undefined},Yt=function(t,e){var n;return n=e.reduce(function(t,e){return Xt(t)?t[e]:undefined},t),Xt(n)?n:null},Gt=function(e){return new Ut(function(n){var t=new(Rt("FileReader"));t.onload=function(t){var e=t.target;n(e.result)},t.readAsText(e)})},Kt=function(e,r,o){return new Ut(function(t){var n;(n=new(Rt("XMLHttpRequest"))).onreadystatechange=function(){4===n.readyState&&t({status:n.status,blob:this.response})},n.open("GET",e,!0),n.withCredentials=o,G.each(r,function(t,e){n.setRequestHeader(e,t)}),n.responseType="blob",n.send()})},Jt=function(t){var e;try{e=JSON.parse(t)}catch(n){}return e},Zt=[{code:404,message:"Could not find Image Proxy"},{code:403,message:"Rejected request"},{code:0,message:"Incorrect Image Proxy URL"}],Qt=[{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."}],te=function(e){return"ImageProxy HTTP error: "+$t(Zt,function(t){return e===t.code}).fold(i("Unknown ImageProxy error"),function(t){return t.message})},ee=function(t){var e=te(t);return Ut.reject(e)},ne=function(e){return $t(Qt,function(t){return t.type===e}).fold(i("Unknown service error"),function(t){return t.message})},re=function(t,e){return Gt(e).then(function(t){var e,n,r=(e=Jt(t),"ImageProxy Service error: "+((n=Yt(e,["error","type"]))?ne(n):"Invalid JSON in service error message"));return Ut.reject(r)})},oe=function(t,e){return 400===(n=t)||403===n||500===n?re(0,e):ee(t);var n},ie=ee,ae=function(t,e){var n,r,o,i={"Content-Type":"application/json;charset=UTF-8","tiny-api-key":e};return Kt((n=t,r=e,o=-1===n.indexOf("?")?"?":"&",/[?&]apiKey=/.test(n)||!r?n:n+o+"apiKey="+encodeURIComponent(r)),i,!1).then(function(t){return t.status<200||300<=t.status?oe(t.status,t.blob):Ut.resolve(t.blob)})},ce=function(t,e,n){return e?ae(t,e):Kt(t,{},n).then(function(t){return t.status<200||300<=t.status?ie(t.status):Ut.resolve(t.blob)})},ue=0,le=function(t,e){t.notificationManager.open({text:e,type:"error"})},fe=function(t){return t.selection.getNode()},se=function(t,e){var n=e.src;return 0===n.indexOf("data:")||0===n.indexOf("blob:")||new Ct(n).host===t.documentBaseURI.host},de=function(t,e){return-1!==G.inArray(t.getParam("imagetools_cors_hosts",[],"string[]"),new Ct(e.src).host)},he=function(t,e){var n,r,o,i,a=e.src;return de(t,e)?ce(e.src,null,(r=t,o=e,-1!==G.inArray(r.getParam("imagetools_credentials_hosts",[],"string[]"),new Ct(o.src).host))):se(t,e)?R(e):(a=t.getParam("imagetools_proxy"),a+=(-1===a.indexOf("?")?"?":"&")+"url="+encodeURIComponent(e.src),n=(i=t).getParam("api_key",i.getParam("imagetools_api_key","","string"),"string"),ce(a,n,!1))},pe=function(t){var e;return(e=t.editorUpload.blobCache.getByUri(fe(t).src))?Ut.resolve(e.blob()):he(t,fe(t))},me=function(t){clearTimeout(t.get())},ge=function(u,l,f,s,d){return l.toBlob().then(function(t){var e,n,r,o,i,a,c;return r=u.editorUpload.blobCache,e=(i=fe(u)).src,u.getParam("images_reuse_filename",!1,"boolean")&&((o=r.getByUri(e))?(e=o.uri(),n=o.name()):(a=u,n=(c=e.match(/\/([^\/\?]+)?\.(?:jpeg|jpg|png|gif)(?:\?|$)/i))?a.dom.encode(c[1]):null)),o=r.create({id:"imagetools"+ue++,blob:t,base64:l.toBase64(),uri:e,name:n}),r.add(o),u.undoManager.transact(function(){u.$(i).on("load",function t(){var e,n,r;u.$(i).off("load",t),u.nodeChanged(),f?u.editorUpload.uploadImagesAuto():(me(s),e=u,n=s,r=Tt.setEditorTimeout(e,function(){e.editorUpload.uploadImagesAuto()},e.getParam("images_upload_timeout",3e4,"number")),n.set(r))}),d&&u.$(i).attr({width:d.w,height:d.h}),u.$(i).attr({src:o.blobUri()}).removeAttr("data-mce-src")}),o})},ve=function(e,n,t,r){return function(){return e._scanForImages().then(a(pe,e)).then(bt).then(t).then(function(t){return ge(e,t,!1,n,r)},function(t){le(e,t)})}},ye=function(n,r,o){return function(){var t=Nt.getImageSize(fe(n)),e=t?{w:t.h,h:t.w}:null;return ve(n,r,function(t){return wt(t,o)},e)()}},we=function(t,e,n){return function(){return ve(t,e,function(t){return gt(t,n)})()}},be=function(e,r){return function(){var o=fe(e),i=Nt.getNaturalImageSize(o),n=function(r){return new Ut(function(n){var t;(t=r,I(t)).then(function(t){var e=Nt.getNaturalImageSize(t);i.w===e.w&&i.h===e.h||Nt.getImageSize(o)&&Nt.setImageSize(o,e),Mt.revokeObjectURL(t.src),n(r)})})};pe(e).then(bt).then(a(function(e,t){return Wt.edit(e,t).then(n).then(bt).then(function(t){return ge(e,t,!0,r)},function(){})},e),function(t){le(e,t)})}},xe=function(t,e){return t.dom.is(e,"img:not([data-mce-object],[data-mce-placeholder])")&&(se(t,e)||de(t,e)||t.settings.imagetools_proxy)},ke=me,Re=function(n,t){G.each({mceImageRotateLeft:ye(n,t,-90),mceImageRotateRight:ye(n,t,90),mceImageFlipVertical:we(n,t,"v"),mceImageFlipHorizontal:we(n,t,"h"),mceEditImage:be(n,t)},function(t,e){n.addCommand(e,t)})},Ie=function(n,r,o){n.on("NodeChange",function(t){var e=o.get();e&&e.src!==t.element.src&&(ke(r),n.editorUpload.uploadImagesAuto(),o.set(null)),xe(n,t.element)&&o.set(t.element)})},Me=function(t){t.addButton("rotateleft",{title:"Rotate counterclockwise",cmd:"mceImageRotateLeft"}),t.addButton("rotateright",{title:"Rotate clockwise",cmd:"mceImageRotateRight"}),t.addButton("flipv",{title:"Flip vertically",cmd:"mceImageFlipVertical"}),t.addButton("fliph",{title:"Flip horizontally",cmd:"mceImageFlipHorizontal"}),t.addButton("editimage",{title:"Edit image",cmd:"mceEditImage"}),t.addButton("imageoptions",{title:"Image options",icon:"options",cmd:"mceImage"})},Te=function(t){t.addContextToolbar(a(xe,t),t.getParam("imagetools_toolbar","rotateleft rotateright | flipv fliph | crop editimage imageoptions"))};t.add("imagetools",function(t){var e=r(0),n=r(null);Re(t,e),Me(t),Te(t),Ie(t,e,n)})}(window);
|
1
|
+
/**
|
2
|
+
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
|
3
|
+
* Licensed under the LGPL or a commercial license.
|
4
|
+
* For LGPL see License.txt in the project root for license information.
|
5
|
+
* For commercial licenses see https://www.tiny.cloud/
|
6
|
+
*
|
7
|
+
* Version: 5.0.0-1 (2019-02-04)
|
8
|
+
*/
|
9
|
+
!function(){"use strict";var r=function(t){var e=t,n=function(){return e};return{get:n,set:function(t){e=t},clone:function(){return r(n())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.util.Tools");function n(t,e){return i(document.createElement("canvas"),t,e)}function o(t){return t.getContext("2d")}function i(t,e,n){return t.width=e,t.height=n,t}var e,u,c,s,l={create:n,clone:function Re(t){var e;return o(e=n(t.width,t.height)).drawImage(t,0,0),e},resize:i,get2dContext:o,get3dContext:function De(t){var e=null;try{e=t.getContext("webgl")||t.getContext("experimental-webgl")}catch(n){}return e||(e=null),e}},d={getWidth:function je(t){return t.naturalWidth||t.width},getHeight:function Ue(t){return t.naturalHeight||t.height}},h=window.Promise?window.Promise:function(){var t=function(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=null,this._value=null,this._deferreds=[],s(t,r(o,this),r(u,this))},e=t.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(t){setTimeout(t,1)};function r(t,e){return function(){t.apply(e,arguments)}}var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(r){var o=this;null!==this._state?e(function(){var t=o._state?r.onFulfilled:r.onRejected;if(null!==t){var e;try{e=t(o._value)}catch(n){return void r.reject(n)}r.resolve(e)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function o(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void s(r(e,t),r(o,this),r(u,this))}this._state=!0,this._value=t,a.call(this)}catch(n){u.call(this,n)}}function u(t){this._state=!1,this._value=t,a.call(this)}function a(){for(var t=0,e=this._deferreds.length;t<e;t++)i.call(this,this._deferreds[t]);this._deferreds=null}function c(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function s(t,e,n){var r=!1;try{t(function(t){r||(r=!0,e(t))},function(t){r||(r=!0,n(t))})}catch(o){if(r)return;r=!0,n(o)}}return t.prototype["catch"]=function(t){return this.then(null,t)},t.prototype.then=function(n,r){var o=this;return new t(function(t,e){i.call(o,new c(n,r,t,e))})},t.all=function(){var c=Array.prototype.slice.call(1===arguments.length&&n(arguments[0])?arguments[0]:arguments);return new t(function(o,i){if(0===c.length)return o([]);var u=c.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)}c[e]=t,0==--u&&o(c)}catch(r){i(r)}}for(var t=0;t<c.length;t++)a(t,c[t])})},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t(function(t){t(e)})},t.reject=function(n){return new t(function(t,e){e(n)})},t.race=function(o){return new t(function(t,e){for(var n=0,r=o.length;n<r;n++)o[n].then(t,e)})},t}(),v=function(t){return function(){return t}},f=v(!1),m=v(!0),g=f,p=m,y=function(){return w},w=(s={fold:function(t,e){return t()},is:g,isSome:g,isNone:p,getOr:c=function(t){return t},getOrThunk:u=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:c,orThunk:u,map:y,ap:y,each:function(){},bind:y,flatten:y,exists:g,forall:p,filter:y,equals:e=function(t){return t.isNone()},equals_:e,toArray:function(){return[]},toString:v("none()")},Object.freeze&&Object.freeze(s),s),b=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:p,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)?o:w},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 o},T={some:b,none:y,from:function(t){return null===t||t===undefined?w:b(t)}},O="undefined"!=typeof window?window:Function("return this;")(),I=function(t,e){return function(t,e){for(var n=e!==undefined&&null!==e?e:O,r=0;r<t.length&&n!==undefined&&null!==n;++r)n=n[t[r]];return n}(t.split("."),e)},x={getOrDie:function(t,e){var n=I(t,e);if(n===undefined||null===n)throw t+" not available on this browser";return n}};function C(){return new(x.getOrDie("FileReader"))}var E={atob:function(t){return x.getOrDie("atob")(t)},requestAnimationFrame:function(t){x.getOrDie("requestAnimationFrame")(t)}};function S(a){return new h(function(t,e){var n=URL.createObjectURL(a),r=new Image,o=function(){r.removeEventListener("load",i),r.removeEventListener("error",u)};function i(){o(),t(r)}function u(){o(),e("Unable to load data of type "+a.type+": "+n)}r.addEventListener("load",i),r.addEventListener("error",u),r.src=n,r.complete&&i()})}function N(r){return new h(function(t,n){var e=new XMLHttpRequest;e.open("GET",r,!0),e.responseType="blob",e.onload=function(){200==this.status&&t(this.response)},e.onerror=function(){var t,e=this;n(0===this.status?((t=new Error("No access to download image")).code=18,t.name="SecurityError",t):new Error("Error "+e.status+" downloading image"))},e.send()})}function A(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return T.none();for(var r,o=n[1],i=e[1],u=E.atob(i),a=u.length,c=Math.ceil(a/1024),s=new Array(c),f=0;f<c;++f){for(var l=1024*f,d=Math.min(l+1024,a),h=new Array(d-l),m=l,g=0;m<d;++g,++m)h[g]=u[m].charCodeAt(0);s[f]=(r=h,new(x.getOrDie("Uint8Array"))(r))}return T.some(function v(t,e){return new(x.getOrDie("Blob"))(t,e)}(s,{type:o}))}function _(n){return new h(function(t,e){A(n).fold(function(){e("uri is not base64: "+n)},t)})}function R(n){return new h(function(t){var e=C();e.onloadend=function(){t(e.result)},e.readAsDataURL(n)})}var D={blobToImage:S,imageToBlob:function Be(t){var e=t.src;return 0===e.indexOf("data:")?_(e):N(e)},blobToArrayBuffer:function Me(n){return new h(function(t){var e=C();e.onloadend=function(){t(e.result)},e.readAsArrayBuffer(n)})},blobToDataUri:R,blobToBase64:function Le(t){return R(t).then(function(t){return t.split(",")[1]})},dataUriToBlobSync:A,canvasToBlob:function ke(t,n,r){return n=n||"image/png",HTMLCanvasElement.prototype.toBlob?new h(function(e){t.toBlob(function(t){e(t)},n,r)}):_(t.toDataURL(n,r))},canvasToDataURL:function Pe(t,e,n){return e=e||"image/png",t.then(function(t){return t.toDataURL(e,n)})},blobToCanvas:function Fe(t){return S(t).then(function(t){var e;return function n(t){URL.revokeObjectURL(t.src)}(t),e=l.create(d.getWidth(t),d.getHeight(t)),l.get2dContext(e).drawImage(t,0,0),e})},uriToBlob:function He(t){return 0===t.indexOf("blob:")?N(t):0===t.indexOf("data:")?_(t):null}},j=function(t){return D.blobToImage(t)},U=function(t){return D.imageToBlob(t)};function B(t,e,n){var r=e.type;function o(e,n){return t.then(function(t){return D.canvasToDataURL(t,e,n)})}return{getType:v(r),toBlob:function i(){return h.resolve(e)},toDataURL:function u(){return n},toBase64:function a(){return n.split(",")[1]},toAdjustedBlob:function c(e,n){return t.then(function(t){return D.canvasToBlob(t,e,n)})},toAdjustedDataURL:o,toAdjustedBase64:function s(t,e){return o(t,e).then(function(t){return t.split(",")[1]})},toCanvas:function f(){return t.then(l.clone)}}}function M(e){return D.blobToDataUri(e).then(function(t){return B(D.blobToCanvas(e),e,t)})}var L={fromBlob:M,fromCanvas:function ze(e,t){return D.canvasToBlob(e,t).then(function(t){return B(h.resolve(e),t,e.toDataURL())})},fromImage:function qe(t){return D.imageToBlob(t).then(function(t){return M(t)})},fromBlobAndUrlSync:function(t,e){return B(D.blobToCanvas(t),t,e)}};function k(t,e,n){return n<(t=parseFloat(t))?t=n:t<e&&(t=e),t}var P=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10];function F(t,e){var n,r,o,i,u=[],a=new Array(10);for(n=0;n<5;n++){for(r=0;r<5;r++)u[r]=e[r+5*n];for(r=0;r<5;r++){for(o=i=0;o<5;o++)i+=t[r+5*o]*u[o];a[r+5*n]=i}}return a}function H(t,n){return n=k(n,0,1),t.map(function(t,e){return e%6==0?t=1-(1-t)*n:t*=n,k(t,0,1)})}var z={identity:function Ge(){return[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1]},adjust:H,multiply:F,adjustContrast:function We(t,e){var n;return e=k(e,-1,1),F(t,[(n=(e*=100)<0?127+e/100*127:127*(n=0==(n=e%1)?P[e]:P[Math.floor(e)]*(1-n)+P[Math.floor(e)+1]*n)+127)/127,0,0,0,.5*(127-n),0,n/127,0,0,.5*(127-n),0,0,n/127,0,.5*(127-n),0,0,0,1,0,0,0,0,0,1])},adjustBrightness:function $e(t,e){return F(t,[1,0,0,0,e=k(255*e,-255,255),0,1,0,0,e,0,0,1,0,e,0,0,0,1,0,0,0,0,0,1])},adjustSaturation:function Xe(t,e){var n;return F(t,[.3086*(1-(n=1+(0<(e=k(e,-1,1))?3*e:e)))+n,.6094*(1-n),.082*(1-n),0,0,.3086*(1-n),.6094*(1-n)+n,.082*(1-n),0,0,.3086*(1-n),.6094*(1-n),.082*(1-n)+n,0,0,0,0,0,1,0,0,0,0,0,1])},adjustHue:function Ve(t,e){var n,r,o,i,u;return e=k(e,-180,180)/180*Math.PI,F(t,[(o=.213)+.787*(n=Math.cos(e))+(r=Math.sin(e))*-o,(i=.715)+n*-i+r*-i,(u=.072)+n*-u+.928*r,0,0,o+n*-o+.143*r,i+n*(1-i)+.14*r,u+n*-u+-.283*r,0,0,o+n*-o+-.787*r,i+n*-i+r*i,u+.928*n+r*u,0,0,0,0,0,1,0,0,0,0,0,1])},adjustColors:function Ye(t,e,n,r){return F(t,[e=k(e,0,2),0,0,0,0,0,n=k(n,0,2),0,0,0,0,0,r=k(r,0,2),0,0,0,0,0,1,0,0,0,0,0,1])},adjustSepia:function Je(t,e){return F(t,H([.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0,0,0,0,0,1],e=k(e,0,1)))},adjustGrayscale:function Ke(t,e){return F(t,H([.33,.34,.33,0,0,.33,.34,.33,0,0,.33,.34,.33,0,0,0,0,0,1,0,0,0,0,0,1],e=k(e,0,1)))}};function q(e,n){return e.toCanvas().then(function(t){return function i(t,e,n){var r,o=l.get2dContext(t);return r=function N(t,e){var n,r,o,i,u,a=t.data,c=e[0],s=e[1],f=e[2],l=e[3],d=e[4],h=e[5],m=e[6],g=e[7],v=e[8],p=e[9],y=e[10],w=e[11],b=e[12],T=e[13],O=e[14],I=e[15],x=e[16],C=e[17],E=e[18],S=e[19];for(u=0;u<a.length;u+=4)n=a[u],r=a[u+1],o=a[u+2],i=a[u+3],a[u]=n*c+r*s+o*f+i*l+d,a[u+1]=n*h+r*m+o*g+i*v+p,a[u+2]=n*y+r*w+o*b+i*T+O,a[u+3]=n*I+r*x+o*C+i*E+S;return t}(o.getImageData(0,0,t.width,t.height),n),o.putImageData(r,0,0),L.fromCanvas(t,e)}(t,e.getType(),n)})}function G(e,n){return e.toCanvas().then(function(t){return function u(t,e,n){var r,o,i=l.get2dContext(t);return r=i.getImageData(0,0,t.width,t.height),o=i.getImageData(0,0,t.width,t.height),o=function T(t,e,n){var r,o,i,u,a,c,s,f,l,d,h,m,g,v,p,y,w;function b(t,e,n){return n<t?t=n:t<e&&(t=e),t}for(i=Math.round(Math.sqrt(n.length)),u=Math.floor(i/2),r=t.data,o=e.data,y=t.width,w=t.height,c=0;c<w;c++)for(a=0;a<y;a++){for(s=f=l=0,h=0;h<i;h++)for(d=0;d<i;d++)m=b(a+d-u,0,y-1),g=b(c+h-u,0,w-1),v=4*(g*y+m),p=n[h*i+d],s+=r[v]*p,f+=r[v+1]*p,l+=r[v+2]*p;o[v=4*(c*y+a)]=b(s,0,255),o[v+1]=b(f,0,255),o[v+2]=b(l,0,255)}return e}(r,o,n),i.putImageData(o,0,0),L.fromCanvas(t,e)}(t,e.getType(),n)})}function W(c){return function(e,n){return e.toCanvas().then(function(t){return function(t,e,n){var r,o,i=l.get2dContext(t),u=new Array(256);for(o=0;o<u.length;o++)u[o]=c(o,n);return r=function a(t,e){var n,r=t.data;for(n=0;n<r.length;n+=4)r[n]=e[r[n]],r[n+1]=e[r[n+1]],r[n+2]=e[r[n+2]];return t}(i.getImageData(0,0,t.width,t.height),u),i.putImageData(r,0,0),L.fromCanvas(t,e)}(t,e.getType(),n)})}}function $(n){return function(t,e){return q(t,n(z.identity(),e))}}function X(e){return function(t){return G(t,e)}}(function Qe(e){return function(t){return q(t,e)}})([-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0]),$(z.adjustBrightness),$(z.adjustHue),$(z.adjustSaturation),$(z.adjustContrast),$(z.adjustGrayscale),$(z.adjustSepia),X([0,-1,0,-1,5,-1,0,-1,0]),X([-2,-1,0,-1,1,1,0,1,2]),W(function(t,e){return 255*Math.pow(t/255,1-e)}),W(function(t,e){return 255*(1-Math.exp(-t/255*e))});var V,Y={scale:function Ze(t,e,n){var r=d.getWidth(t),o=d.getHeight(t),i=e/r,u=n/o,a=!1;(i<.5||2<i)&&(i=i<.5?.5:2,a=!0),(u<.5||2<u)&&(u=u<.5?.5:2,a=!0);var c=function f(a,c,s){return new h(function(t){var e=d.getWidth(a),n=d.getHeight(a),r=Math.floor(e*c),o=Math.floor(n*s),i=l.create(r,o),u=l.get2dContext(i);u.drawImage(a,0,0,e,n,0,0,r,o),t(i)})}(t,i,u);return a?c.then(function(t){return Ze(t,e,n)}):c}},J={rotate:function tn(e,n){return e.toCanvas().then(function(t){return function a(t,e,n){var r=l.create(t.width,t.height),o=l.get2dContext(r),i=0,u=0;return 90!=(n=n<0?360+n:n)&&270!=n||l.resize(r,r.height,r.width),90!=n&&180!=n||(i=r.width),270!=n&&180!=n||(u=r.height),o.translate(i,u),o.rotate(n*Math.PI/180),o.drawImage(t,0,0),L.fromCanvas(r,e)}(t,e.getType(),n)})},flip:function en(e,n){return e.toCanvas().then(function(t){return function i(t,e,n){var r=l.create(t.width,t.height),o=l.get2dContext(r);return"v"==n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),L.fromCanvas(r,e)}(t,e.getType(),n)})},crop:function nn(e,n,r,o,i){return e.toCanvas().then(function(t){return function a(t,e,n,r,o,i){var u=l.create(o,i);return l.get2dContext(u).drawImage(t,-n,-r),L.fromCanvas(u,e)}(t,e.getType(),n,r,o,i)})},resize:function rn(e,n,r){return e.toCanvas().then(function(t){return Y.scale(t,n,r).then(function(t){return L.fromCanvas(t,e.getType())})})}},K=(function(){function t(t){this.littleEndian=!1,this._dv=new DataView(t)}t.prototype.readByteAt=function(t){return this._dv.getUint8(t)},t.prototype.read=function(t,e){if(t+e>this.length())return null;for(var n=this.littleEndian?0:-8*(e-1),r=0,o=0;r<e;r++)o|=this.readByteAt(t+r)<<Math.abs(n+8*r);return o},t.prototype.BYTE=function(t){return this.read(t,1)},t.prototype.SHORT=function(t){return this.read(t,2)},t.prototype.LONG=function(t){return this.read(t,4)},t.prototype.SLONG=function(t){var e=this.read(t,4);return 2147483647<e?e-4294967296:e},t.prototype.CHAR=function(t){return String.fromCharCode(this.read(t,1))},t.prototype.STRING=function(t,e){return this.asArray("CHAR",t,e).join("")},t.prototype.SEGMENT=function(t,e){var n=this._dv.buffer;switch(arguments.length){case 2:return n.slice(t,t+e);case 1:return n.slice(t);default:return n}},t.prototype.asArray=function(t,e,n){for(var r=[],o=0;o<n;o++)r[o]=this[t](e+o);return r},t.prototype.length=function(){return this._dv?this._dv.byteLength:0}}(),function(t,e){return J.rotate(t,e)}),Q=function(t,e){return J.flip(t,e)},Z=K,tt=function(t){return L.fromBlob(t)},et=function(){return x.getOrDie("URL")},nt=function(t){return et().createObjectURL(t)},rt=function(t){et().revokeObjectURL(t)},ot=tinymce.util.Tools.resolve("tinymce.util.Delay"),it=tinymce.util.Tools.resolve("tinymce.util.Promise"),ut=tinymce.util.Tools.resolve("tinymce.util.URI"),at={getImageSize:function on(t){var e,n;function r(t){return/^[0-9\.]+px$/.test(t)}return e=t.style.width,n=t.style.height,e||n?r(e)&&r(n)?{w:parseInt(e,10),h:parseInt(n,10)}:null:(e=t.width,n=t.height,e&&n?{w:parseInt(e,10),h:parseInt(n,10)}:null)},setImageSize:function un(t,e){var n,r;e&&(n=t.style.width,r=t.style.height,(n||r)&&(t.style.width=e.w+"px",t.style.height=e.h+"px",t.removeAttribute("data-mce-style")),n=t.width,r=t.height,(n||r)&&(t.setAttribute("width",e.w),t.setAttribute("height",e.h)))},getNaturalImageSize:function an(t){return{w:t.naturalWidth,h:t.naturalHeight}}},ct=(V="function",function(t){return function(t){if(null===t)return"null";var e=typeof t;return"object"===e&&Array.prototype.isPrototypeOf(t)?"array":"object"===e&&String.prototype.isPrototypeOf(t)?"string":e}(t)===V}),st=function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];if(e(o,n,t))return T.some(o)}return T.none()};Array.prototype.slice;ct(Array.from)&&Array.from;var ft,lt,dt,ht=function(t){return null!==t&&t!==undefined},mt=function(t,e){var n;return n=e.reduce(function(t,e){return ht(t)?t[e]:undefined},t),ht(n)?n:null},gt=function(e){return new it(function(n){var t=C();t.onload=function(t){var e=t.target;n(e.result)},t.readAsText(e)})},vt=function(r,o,i){return new it(function(t){var n;(n=function e(){return new(x.getOrDie("XMLHttpRequest"))}()).onreadystatechange=function(){4===n.readyState&&t({status:n.status,blob:this.response})},n.open("GET",r,!0),n.withCredentials=i,a.each(o,function(t,e){n.setRequestHeader(e,t)}),n.responseType="blob",n.send()})},pt=function(t){var e;try{e=JSON.parse(t)}catch(n){}return e},yt=[{code:404,message:"Could not find Image Proxy"},{code:403,message:"Rejected request"},{code:0,message:"Incorrect Image Proxy URL"}],wt=[{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."}],bt=function(e){return"ImageProxy HTTP error: "+st(yt,function(t){return e===t.code}).fold(v("Unknown ImageProxy error"),function(t){return t.message})},Tt=function(t){var e=bt(t);return it.reject(e)},Ot=function(e){return st(wt,function(t){return t.type===e}).fold(v("Unknown service error"),function(t){return t.message})},It=function(t,e){return gt(e).then(function(t){var e,n,r=(e=pt(t),"ImageProxy Service error: "+((n=mt(e,["error","type"]))?Ot(n):"Invalid JSON in service error message"));return it.reject(r)})},xt=function(t,e){return 400===(n=t)||403===n||500===n?It(0,e):Tt(t);var n},Ct=Tt,Et=function(t,e){var n,r,o,i={"Content-Type":"application/json;charset=UTF-8","tiny-api-key":e};return vt((n=t,r=e,o=-1===n.indexOf("?")?"?":"&",/[?&]apiKey=/.test(n)||!r?n:n+o+"apiKey="+encodeURIComponent(r)),i,!1).then(function(t){return t.status<200||300<=t.status?xt(t.status,t.blob):it.resolve(t.blob)})},St=function(t,e,n){return e?Et(t,e):function r(t,e){return vt(t,{},e).then(function(t){return t.status<200||300<=t.status?Ct(t.status):it.resolve(t.blob)})}(t,n)},Nt=function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}return undefined}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return _t(r(1),r(2))},At=function(){return _t(0,0)},_t=function(t,e){return{major:t,minor:e}},Rt={nu:_t,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?At():Nt(t,n)},unknown:At},Dt="Firefox",jt=function(t,e){return function(){return e===t}},Ut=function(t){var e=t.current;return{current:e,version:t.version,isEdge:jt("Edge",e),isChrome:jt("Chrome",e),isIE:jt("IE",e),isOpera:jt("Opera",e),isFirefox:jt(Dt,e),isSafari:jt("Safari",e)}},Bt={unknown:function(){return Ut({current:undefined,version:Rt.unknown()})},nu:Ut,edge:v("Edge"),chrome:v("Chrome"),ie:v("IE"),opera:v("Opera"),firefox:v(Dt),safari:v("Safari")},Mt="Windows",Lt="Android",kt="Solaris",Pt="FreeBSD",Ft=function(t,e){return function(){return e===t}},Ht=function(t){var e=t.current;return{current:e,version:t.version,isWindows:Ft(Mt,e),isiOS:Ft("iOS",e),isAndroid:Ft(Lt,e),isOSX:Ft("OSX",e),isLinux:Ft("Linux",e),isSolaris:Ft(kt,e),isFreeBSD:Ft(Pt,e)}},zt={unknown:function(){return Ht({current:undefined,version:Rt.unknown()})},nu:Ht,windows:v(Mt),ios:v("iOS"),android:v(Lt),linux:v("Linux"),osx:v("OSX"),solaris:v(kt),freebsd:v(Pt)},qt=function(t,e){var n=String(e).toLowerCase();return st(t,function(t){return t.search(n)})},Gt=function(t,n){return qt(t,n).map(function(t){var e=Rt.detect(t.versionRegexes,n);return{current:t.name,version:e}})},Wt=function(t,n){return qt(t,n).map(function(t){var e=Rt.detect(t.versionRegexes,n);return{current:t.name,version:e}})},$t=function(t,e){return-1!==t.indexOf(e)},Xt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Vt=function(e){return function(t){return $t(t,e)}},Yt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return $t(t,"edge/")&&$t(t,"chrome")&&$t(t,"safari")&&$t(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Xt],search:function(t){return $t(t,"chrome")&&!$t(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return $t(t,"msie")||$t(t,"trident")}},{name:"Opera",versionRegexes:[Xt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Vt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Vt("firefox")},{name:"Safari",versionRegexes:[Xt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return($t(t,"safari")||$t(t,"mobile/"))&&$t(t,"applewebkit")}}],Jt=[{name:"Windows",search:Vt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return $t(t,"iphone")||$t(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Vt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Vt("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Vt("linux"),versionRegexes:[]},{name:"Solaris",search:Vt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Vt("freebsd"),versionRegexes:[]}],Kt={browsers:v(Yt),oses:v(Jt)},Qt=function(t){var e,n,r,o,i,u,a,c,s,f,l,d=Kt.browsers(),h=Kt.oses(),m=Gt(d,t).fold(Bt.unknown,Bt.nu),g=Wt(h,t).fold(zt.unknown,zt.nu);return{browser:m,os:g,deviceType:(n=m,r=t,o=(e=g).isiOS()&&!0===/ipad/i.test(r),i=e.isiOS()&&!o,u=e.isAndroid()&&3===e.version.major,a=e.isAndroid()&&4===e.version.major,c=o||u||a&&!0===/mobile/i.test(r),s=e.isiOS()||e.isAndroid(),f=s&&!c,l=n.isSafari()&&e.isiOS()&&!1===/safari/i.test(r),{isiPad:v(o),isiPhone:v(i),isTablet:v(c),isPhone:v(f),isTouch:v(s),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:v(l)})}},Zt={detect:(ft=function(){var t=navigator.userAgent;return Qt(t)},dt=!1,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return dt||(dt=!0,lt=ft.apply(null,t)),lt})},te=function(t){if(null===t||t===undefined)throw new Error("Node cannot be null or undefined");return{dom:v(t)}},ee={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return te(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return te(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return te(n)},fromDom:te,fromPoint:function(t,e,n){var r=t.dom();return T.from(r.elementFromPoint(e,n)).map(te)}},ne=(Node.ATTRIBUTE_NODE,Node.CDATA_SECTION_NODE,Node.COMMENT_NODE,Node.DOCUMENT_NODE,Node.DOCUMENT_TYPE_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE),re=(Node.TEXT_NODE,Node.PROCESSING_INSTRUCTION_NODE,Node.ENTITY_REFERENCE_NODE,Node.ENTITY_NODE,Node.NOTATION_NODE,ne),oe=(Zt.detect().browser.isIE(),0),ie=function(t){return Zt.detect().browser.isIE(),e=ee.fromDom(t),n="img",r=function(t){return function(t,e){var n=t.dom();if(n.nodeType!==re)return!1;if(n.matches!==undefined)return n.matches(e);if(n.msMatchesSelector!==undefined)return n.msMatchesSelector(e);if(n.webkitMatchesSelector!==undefined)return n.webkitMatchesSelector(e);if(n.mozMatchesSelector!==undefined)return n.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")}(t,n)},st(e.dom().childNodes,(o=r,i=ee.fromDom,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return o(i.apply(null,t))})).map(ee.fromDom);var e,n,r,o,i},ue=function(t,e){return t.dom.is(e,"figure")},ae=function(t,e){t.notificationManager.open({text:e,type:"error"})},ce=function(t){var e=t.selection.getNode();return ue(t,e)?ie(e):T.some(ee.fromDom(e))},se=function(t,e){var n=e.src;return 0===n.indexOf("data:")||0===n.indexOf("blob:")||new ut(n).host===t.documentBaseURI.host},fe=function(t,e){return-1!==a.inArray(t.getParam("imagetools_cors_hosts",[],"string[]"),new ut(e.src).host)},le=function(t,e){var n,r,o,i,u=e.src;return fe(t,e)?St(e.src,null,(r=t,o=e,-1!==a.inArray(r.getParam("imagetools_credentials_hosts",[],"string[]"),new ut(o.src).host))):se(t,e)?U(e):(u=t.getParam("imagetools_proxy"),u+=(-1===u.indexOf("?")?"?":"&")+"url="+encodeURIComponent(e.src),n=(i=t).getParam("api_key",i.getParam("imagetools_api_key","","string"),"string"),St(u,n,!1))},de=function(t,e){var n;return(n=t.editorUpload.blobCache.getByUri(e.src))?it.resolve(n.blob()):le(t,e)},he=function(t){clearTimeout(t.get())},me=function(a,c,s,f,l,d){return c.toBlob().then(function(t){var e,n,r,o,i,u;return r=a.editorUpload.blobCache,e=l.src,a.getParam("images_reuse_filename",!1,"boolean")&&(n=(o=r.getByUri(e))?(e=o.uri(),o.name()):(i=a,(u=e.match(/\/([^\/\?]+)?\.(?:jpeg|jpg|png|gif)(?:\?|$)/i))?i.dom.encode(u[1]):null)),o=r.create({id:"imagetools"+oe++,blob:t,base64:c.toBase64(),uri:e,name:n}),r.add(o),a.undoManager.transact(function(){a.$(l).on("load",function r(){var t,e,n;a.$(l).off("load",r),a.nodeChanged(),s?a.editorUpload.uploadImagesAuto():(he(f),t=a,e=f,n=ot.setEditorTimeout(t,function(){t.editorUpload.uploadImagesAuto()},t.getParam("images_upload_timeout",3e4,"number")),e.set(n))}),d&&a.$(l).attr({width:d.w,height:d.h}),a.$(l).attr({src:o.blobUri()}).removeAttr("data-mce-src")}),o})},ge=function(n,r,t,o){return function(){return ce(n).fold(function(){ae(n,"Could not find selected image")},function(e){return n._scanForImages().then(function(){return de(n,e.dom())}).then(tt).then(t).then(function(t){return me(n,t,!1,r,e.dom(),o)},function(t){ae(n,t)})})}},ve=function(e,n,r){return function(){var t=ce(e).fold(function(){return null},function(t){var e=at.getImageSize(t.dom());return e?{w:e.h,h:e.w}:null});return ge(e,n,function(t){return Z(t,r)},t)()}},pe=function(t,e,n){return function(){return ge(t,e,function(t){return Q(t,n)})()}},ye=function(n,t){var e=function(t){return e=t,n.dom.is(e,"img:not([data-mce-object],[data-mce-placeholder])")&&(se(n,t)||fe(n,t)||n.settings.imagetools_proxy);var e};return ue(n,t)?ie(t).map(function(t){return e(t.dom())?T.some(t.dom()):T.none()}):e(t)?T.some(t):T.none()},we=he,be=de,Te=ce,Oe=function(e,n,r,o,i){return new it(function(t){j(i).then(function(t){var e=at.getNaturalImageSize(t);return o.w===e.w&&o.h===e.h||at.getImageSize(r)&&at.setImageSize(r,e),rt(t.src),i}).then(tt).then(function(t){return me(e,t,!0,n,r)},function(){})})},Ie=v("save-state"),xe=v("disable"),Ce=v("enable"),Ee=function(i,u){return function(){var r=Te(i),o=r.map(function(t){return at.getNaturalImageSize(t.dom())});Te(i).each(function(e){ye(i,e.dom()).each(function(t){be(i,e.dom()).then(function(t){var e,n={blob:e=t,url:nt(e)};i.windowManager.open({title:"Edit Image",size:"large",body:{type:"panel",items:[{type:"imagetools",name:"imagetools",label:"Edit Image",currentState:n}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0,disabled:!0}],onSubmit:function(t){var n=t.getData().imagetools.blob;r.each(function(e){o.each(function(t){Oe(i,u,e.dom(),t,n)})}),t.close()},onCancel:function(){},onAction:function(t,e){switch(e.name){case Ie():e.value?t.enable("save"):t.disable("save");break;case xe():t.disable("save"),t.disable("cancel");break;case Ce():t.enable("cancel")}}})})})})}},Se=function(n,t){a.each({mceImageRotateLeft:ve(n,t,-90),mceImageRotateRight:ve(n,t,90),mceImageFlipVertical:pe(n,t,"v"),mceImageFlipHorizontal:pe(n,t,"h"),mceEditImage:Ee(n,t)},function(t,e){n.addCommand(e,t)})},Ne=function(n,r,o){n.on("NodeChange",function(t){var e=o.get();e&&e.src!==t.element.src&&(we(r),n.editorUpload.uploadImagesAuto(),o.set(null)),ye(n,t.element).each(o.set)})},Ae=function(r){var e=function(t){return function(){return r.execCommand(t)}};r.ui.registry.addButton("rotateleft",{tooltip:"Rotate counterclockwise",icon:"rotate-left",onAction:e("mceImageRotateLeft")}),r.ui.registry.addButton("rotateright",{tooltip:"Rotate clockwise",icon:"rotate-right",onAction:e("mceImageRotateRight")}),r.ui.registry.addButton("flipv",{tooltip:"Flip vertically",icon:"flip-vertically",onAction:e("mceImageFlipVertical")}),r.ui.registry.addButton("fliph",{tooltip:"Flip horizontally",icon:"flip-horizontally",onAction:e("mceImageFlipHorizontal")}),r.ui.registry.addButton("editimage",{tooltip:"Edit image",icon:"edit-image",onAction:e("mceEditImage"),onSetup:function(n){var t=function(){Te(r).each(function(t){var e=ye(r,t.dom()).isNone();n.setDisabled(e)})};return r.on("NodeChange",t),function(){r.off("NodeChange",t)}}}),r.ui.registry.addButton("imageoptions",{tooltip:"Image options",icon:"image-options",onAction:e("mceImage")}),r.ui.registry.addContextMenu("imagetools",{update:function(t){return ye(r,t).fold(function(){return[]},function(t){return[{text:"Edit image",icon:"edit-image",onAction:e("mceEditImage")}]})}})},_e=function(e){var t;e.ui.registry.addContextToolbar("imagetools",{items:(t=e,t.getParam("imagetools_toolbar","rotateleft rotateright flipv fliph editimage imageoptions")),predicate:function(t){return ye(e,t).isSome()},position:"node",scope:"node"})};t.add("imagetools",function(t){var e=r(0),n=r(null);Se(t,e),Ae(t),_e(t),Ne(t,e,n)}),function cn(){}}();
|
@@ -1 +1,9 @@
|
|
1
|
-
|
1
|
+
/**
|
2
|
+
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
|
3
|
+
* Licensed under the LGPL or a commercial license.
|
4
|
+
* For LGPL see License.txt in the project root for license information.
|
5
|
+
* For commercial licenses see https://www.tiny.cloud/
|
6
|
+
*
|
7
|
+
* Version: 5.0.0-1 (2019-02-04)
|
8
|
+
*/
|
9
|
+
!function(){"use strict";var t,e,n,r,i,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),d=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),f=tinymce.util.Tools.resolve("tinymce.EditorManager"),m=tinymce.util.Tools.resolve("tinymce.Env"),v=tinymce.util.Tools.resolve("tinymce.util.Tools"),c=function(t){return t.getParam("importcss_merge_classes")},u=function(t){return t.getParam("importcss_exclusive")},h=function(t){return t.getParam("importcss_selector_converter")},l=function(t){return t.getParam("importcss_selector_filter")},p=function(t){return t.getParam("importcss_groups")},_=function(t){return t.getParam("importcss_append")},O=function(t){return t.getParam("importcss_file_filter")},s=function(t){return function(){return t}},a=s(!1),y=s(!0),g=function(){return x},x=(r={fold:function(t,e){return t()},is:a,isSome:a,isNone:y,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:g,ap:g,each:function(){},bind:g,flatten:g,exists:a,forall:y,filter:g,equals:t=function(t){return t.isNone()},equals_:t,toArray:function(){return[]},toString:s("none()")},Object.freeze&&Object.freeze(r),r),T=(i="function",function(t){return function(t){if(null===t)return"null";var e=typeof t;return"object"===e&&Array.prototype.isPrototypeOf(t)?"array":"object"===e&&String.prototype.isPrototypeOf(t)?"string":e}(t)===i}),b=Array.prototype.push,k=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!Array.prototype.isPrototypeOf(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);b.apply(e,t[n])}return e}(function(t,e){for(var n=t.length,r=new Array(n),i=0;i<n;i++){var o=t[i];r[i]=e(o,i,t)}return r}(t,e))},P=(Array.prototype.slice,T(Array.from)&&Array.from,function(e){return"string"==typeof e?function(t){return-1!==t.indexOf(e)}:e instanceof RegExp?function(t){return e.test(t)}:e}),S=function(c,t,s){var a=[],n={};function l(t,e){var n,r,i,o=t.href;if(r=o,i=m.cacheSuffix,"string"==typeof r&&(r=r.replace("?"+i,"").replace("&"+i,"")),(o=r)&&s(o,e)&&!function(t,e){var n=t.settings,r=!1!==n.skin&&(n.skin||"oxide");if(r){var i=n.skin_url?t.documentBaseURI.toAbsolute(n.skin_url):f.baseURL+"/skins/ui/"+r,o=f.baseURL+"/skins/content/";return e===i+"/content"+(t.inline?".inline":"")+".min.css"||-1!==e.indexOf(o)}return!1}(c,o)){v.each(t.imports,function(t){l(t,!0)});try{n=t.cssRules||t.rules}catch(u){}v.each(n,function(t){t.styleSheet?l(t.styleSheet,!0):t.selectorText&&v.each(t.selectorText.split(","),function(t){a.push(v.trim(t))})})}}v.each(c.contentCSS,function(t){n[t]=!0}),s||(s=function(t,e){return e||n[t]});try{v.each(t.styleSheets,function(t){l(t)})}catch(e){}return a},A=function(t,e){var n,r=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(e);if(r){var i=r[1],o=r[2].substr(1).split(".").join(" "),u=v.makeMap("a,img");return r[1]?(n={title:e},t.schema.getTextBlockElements()[i]?n.block=i:t.schema.getBlockElements()[i]||u[i.toLowerCase()]?n.selector=i:n.inline=i):r[2]&&(n={inline:"span",title:e.substr(1),classes:o}),!1!==c(t)?n.classes=o:n.attributes={"class":o},n}},w=function(t,e){return null===e||!1!==u(t)},E=A,I=function(g){g.on("init",function(t){var e,n,r,i,o=(e=[],n=[],r={},{addItemToGroup:function(t,e){r[t]?r[t].push(e):(n.push(t),r[t]=[e])},addItem:function(t){e.push(t)},toFormats:function(){return k(n,function(t){var e=r[t];return 0===e.length?[]:[{title:t,items:e}]}).concat(e)}}),y={},u=P(l(g)),c=(i=p(g),v.map(i,function(t){return v.extend({},t,{original:t,selectors:{},filter:P(t.filter),item:{text:t.title,menu:[]}})})),s=function(t,e){if(f=t,p=y,!(w(g,m=e)?f in p:f in m.selectors)){s=t,l=y,w(g,a=e)?l[s]=!0:a.selectors[s]=!0;var n=(o=(i=g).plugins.importcss,u=t,((c=e)&&c.selector_converter?c.selector_converter:h(i)?h(i):function(){return A(i,u)}).call(o,u,c));if(n){var r=n.name||d.DOM.uniqueId();return g.formatter.register(r,n),v.extend({},{title:n.title,format:r})}}var i,o,u,c,s,a,l,f,m,p;return null};v.each(S(g,t.doc||g.getDoc(),P(O(g))),function(n){if(-1===n.indexOf(".mce-")&&(!u||u(n))){var t=(r=c,i=n,v.grep(r,function(t){return!t.filter||t.filter(i)}));if(0<t.length)v.each(t,function(t){var e=s(n,t);e&&o.addItemToGroup(t.title,e)});else{var e=s(n,null);e&&o.addItem(e)}}var r,i});var a=o.toFormats();g.fire("addStyleModifications",{items:a,replace:!_(g)})})},M=function(e){return{convertSelectorToFormat:function(t){return E(e,t)}}};o.add("importcss",function(t){return I(t),M(t)}),function j(){}}();
|
@@ -1 +1,9 @@
|
|
1
|
-
|
1
|
+
/**
|
2
|
+
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
|
3
|
+
* Licensed under the LGPL or a commercial license.
|
4
|
+
* For LGPL see License.txt in the project root for license information.
|
5
|
+
* For commercial licenses see https://www.tiny.cloud/
|
6
|
+
*
|
7
|
+
* Version: 5.0.0-1 (2019-02-04)
|
8
|
+
*/
|
9
|
+
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(e){return e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S"))},r=function(e){return e.getParam("insertdatetime_formats",["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"])},t=function(e){return e.getParam("insertdatetime_dateformat",e.translate("%Y-%m-%d"))},a=n,i=r,o=function(e){var t=r(e);return 0<t.length?t[0]:n(e)},l=function(e){return e.getParam("insertdatetime_element",!1)},u="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),c="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),m="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),s="January February March April May June July August September October November December".split(" "),d=function(e,t){if((e=""+e).length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e},f=function(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",d(n.getMonth()+1,2))).replace("%d",d(n.getDate(),2))).replace("%H",""+d(n.getHours(),2))).replace("%M",""+d(n.getMinutes(),2))).replace("%S",""+d(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(s[n.getMonth()]))).replace("%b",""+e.translate(m[n.getMonth()]))).replace("%A",""+e.translate(c[n.getDay()]))).replace("%a",""+e.translate(u[n.getDay()]))).replace("%%","%")},p=function(e,t){if(l(e)){var n=f(e,t),r=void 0;r=/%[HMSIp]/.test(t)?f(e,"%Y-%m-%dT%H:%M"):f(e,"%Y-%m-%d");var a=e.dom.getParent(e.selection.getStart(),"time");a?(o=a,u=r,c=n,m=(i=e).dom.create("time",{datetime:u},c),o.parentNode.insertBefore(m,o),i.dom.remove(o),i.selection.select(m,!0),i.selection.collapse(!1)):e.insertContent('<time datetime="'+r+'">'+n+"</time>")}else e.insertContent(f(e,t));var i,o,u,c,m},g=f,y=function(e){e.addCommand("mceInsertDate",function(){p(e,t(e))}),e.addCommand("mceInsertTime",function(){p(e,a(e))})},M=tinymce.util.Tools.resolve("tinymce.util.Tools"),S=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return S(n())}}},v=function(n){var t=i(n),r=S(o(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:(t=e,function(){r.set(t),p(n,t)})};var t})}})};e.add("insertdatetime",function(e){y(e),v(e)}),function h(){}}();
|
@@ -1 +1,9 @@
|
|
1
|
-
|
1
|
+
/**
|
2
|
+
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
|
3
|
+
* Licensed under the LGPL or a commercial license.
|
4
|
+
* For LGPL see License.txt in the project root for license information.
|
5
|
+
* For commercial licenses see https://www.tiny.cloud/
|
6
|
+
*
|
7
|
+
* Version: 5.0.0-1 (2019-02-04)
|
8
|
+
*/
|
9
|
+
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=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},s=function(e,t){e.settings.font_formats=t},o=function(e){return e.getParam("font_size_style_values")},r=function(e,t){e.settings.inline_styles=t},a=function(a){var e;r(e=a,!1),i(e)||n(e,"8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7"),t(e)||s(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"),a.on("init",function(){return e=a,t="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",i=l.explode(o(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",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(e){return l.inArray(i,e.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}}),l.each("b,i,u,strike".split(","),function(e){n.addValidElements(e+"[*]")}),n.getElementRule("font")||n.addValidElements("font[face|size|color|style]"),void l.each(t.split(","),function(e){var t=n.getElementRule(e);t&&(t.attributes.align||(t.attributes.align={},t.attributesOrder.push("align")))});var e,t,i,n})};e.add("legacyoutput",function(e){a(e)}),function c(){}}();
|