diff --git a/TinyMCEPlugin/data/System/TinyMCEPlugin.txt b/TinyMCEPlugin/data/System/TinyMCEPlugin.txt index c534abb788..b2dfc306fc 100644 --- a/TinyMCEPlugin/data/System/TinyMCEPlugin.txt +++ b/TinyMCEPlugin/data/System/TinyMCEPlugin.txt @@ -1,4 +1,4 @@ -%META:TOPICINFO{author="ProjectContributor" comment="" date="1516935577" format="1.1" version="1"}% +%META:TOPICINFO{author="ProjectContributor" comment="" date="1518053585" format="1.1" version="1"}% %META:TOPICPARENT{name="Plugins"}% ---+!! !TinyMCEPlugin   | +| 2.07 | Foswikitask:Item14323: Upgrade to TinyMCE 4.7,6, | | 2.06 | Foswikitask:Item14323: Upgrade to TinyMCE 4.7,5, | | 2.05 | Foswikitask:Item14323: Upgrade to TinyMCE 4.7,4, | | 2.04 | Foswikitask:Item14323: Upgrade to TinyMCE 4.7,3, | @@ -278,23 +279,23 @@ Many thanks to the following sponsors for supporting this work: %META:FIELD{name="License" title="License" value="[[http://www.gnu.org/licenses/gpl.html][GPL (Gnu General Public License)]]"}% %META:FIELD{name="Home" title="Home" value="Foswiki:Extensions.%25$ROOTMODULE%25"}% %META:FIELD{name="Support" title="Support" value="Foswiki:Support.%25$ROOTMODULE%25"}% -%META:FILEATTACHMENT{name="wysiwyg.css.gz" attr="h" comment="" date="1516935577" size="390" user="ProjectContributor" version="1"}% -%META:FILEATTACHMENT{name="foswiki_tiny.uncompressed.js" attr="h" comment="" date="1516935577" size="18556" user="ProjectContributor" version="1"}% -%META:FILEATTACHMENT{name="watermark_hidden_verbatim.gif" attr="h" comment="" date="1516935577" size="1654" user="ProjectContributor" version="1"}% -%META:FILEATTACHMENT{name="watermarks.psd" attr="h" comment="" date="1516935577" size="427691" user="ProjectContributor" version="1"}% -%META:FILEATTACHMENT{name="watermark_literal.gif" attr="h" comment="" date="1516935577" size="1029" user="ProjectContributor" version="1"}% -%META:FILEATTACHMENT{name="watermark_protect_on_save.gif" attr="h" comment="" date="1516935577" size="1492" user="ProjectContributor" version="1"}% -%META:FILEATTACHMENT{name="foswiki.uncompressed.js" attr="h" comment="" date="1516935577" size="4233" user="ProjectContributor" version="1"}% -%META:FILEATTACHMENT{name="foswiki_tiny.js.gz" attr="h" comment="" date="1516935577" size="2625" user="ProjectContributor" version="1"}% -%META:FILEATTACHMENT{name="wysiwyg_src.css" attr="h" comment="" date="1516935577" size="1007" user="ProjectContributor" version="1"}% -%META:FILEATTACHMENT{name="watermark_verbatim.gif" attr="h" comment="" date="1516935577" size="1181" user="ProjectContributor" version="1"}% -%META:FILEATTACHMENT{name="wysiwyg.css" attr="h" comment="" date="1516935577" size="827" user="ProjectContributor" version="1"}% -%META:FILEATTACHMENT{name="screenshot.png" attr="h" comment="" date="1516935577" size="30118" user="ProjectContributor" version="1"}% -%META:FILEATTACHMENT{name="watermark_hidden.gif" attr="h" comment="" date="1516935577" size="950" user="ProjectContributor" version="1"}% -%META:FILEATTACHMENT{name="foswiki.js" attr="h" comment="" date="1516935577" size="1847" user="ProjectContributor" version="1"}% -%META:FILEATTACHMENT{name="foswiki.js.gz" attr="h" comment="" date="1516935577" size="869" user="ProjectContributor" version="1"}% -%META:FILEATTACHMENT{name="watermark_protect_forever.gif" attr="h" comment="" date="1516935577" size="1494" user="ProjectContributor" version="1"}% -%META:FILEATTACHMENT{name="tinymce.gif" attr="h" date="1516935577" size="35155" user="ProjectContributor" version="1"}% -%META:FILEATTACHMENT{name="wikiringlogo20x20.png" attr="h" comment="" date="1516935577" size="1343" user="ProjectContributor" version="1"}% -%META:FILEATTACHMENT{name="foswiki_tiny.js" attr="h" comment="" date="1516935577" size="8435" user="ProjectContributor" version="1"}% -%META:FILEATTACHMENT{name="Makefile" attr="h" comment="" date="1516935577" size="147" user="ProjectContributor" version="1"}% +%META:FILEATTACHMENT{name="wysiwyg.css.gz" attr="h" comment="" date="1518053585" size="390" user="ProjectContributor" version="1"}% +%META:FILEATTACHMENT{name="foswiki_tiny.uncompressed.js" attr="h" comment="" date="1518053585" size="18556" user="ProjectContributor" version="1"}% +%META:FILEATTACHMENT{name="watermark_hidden_verbatim.gif" attr="h" comment="" date="1518053585" size="1654" user="ProjectContributor" version="1"}% +%META:FILEATTACHMENT{name="watermarks.psd" attr="h" comment="" date="1518053585" size="427691" user="ProjectContributor" version="1"}% +%META:FILEATTACHMENT{name="watermark_literal.gif" attr="h" comment="" date="1518053585" size="1029" user="ProjectContributor" version="1"}% +%META:FILEATTACHMENT{name="watermark_protect_on_save.gif" attr="h" comment="" date="1518053585" size="1492" user="ProjectContributor" version="1"}% +%META:FILEATTACHMENT{name="foswiki.uncompressed.js" attr="h" comment="" date="1518053585" size="4233" user="ProjectContributor" version="1"}% +%META:FILEATTACHMENT{name="foswiki_tiny.js.gz" attr="h" comment="" date="1518053585" size="2625" user="ProjectContributor" version="1"}% +%META:FILEATTACHMENT{name="wysiwyg_src.css" attr="h" comment="" date="1518053585" size="1007" user="ProjectContributor" version="1"}% +%META:FILEATTACHMENT{name="watermark_verbatim.gif" attr="h" comment="" date="1518053585" size="1181" user="ProjectContributor" version="1"}% +%META:FILEATTACHMENT{name="wysiwyg.css" attr="h" comment="" date="1518053585" size="827" user="ProjectContributor" version="1"}% +%META:FILEATTACHMENT{name="screenshot.png" attr="h" comment="" date="1518053585" size="30118" user="ProjectContributor" version="1"}% +%META:FILEATTACHMENT{name="watermark_hidden.gif" attr="h" comment="" date="1518053585" size="950" user="ProjectContributor" version="1"}% +%META:FILEATTACHMENT{name="foswiki.js" attr="h" comment="" date="1518053585" size="1847" user="ProjectContributor" version="1"}% +%META:FILEATTACHMENT{name="foswiki.js.gz" attr="h" comment="" date="1518053585" size="869" user="ProjectContributor" version="1"}% +%META:FILEATTACHMENT{name="watermark_protect_forever.gif" attr="h" comment="" date="1518053585" size="1494" user="ProjectContributor" version="1"}% +%META:FILEATTACHMENT{name="tinymce.gif" attr="h" date="1518053585" size="35155" user="ProjectContributor" version="1"}% +%META:FILEATTACHMENT{name="wikiringlogo20x20.png" attr="h" comment="" date="1518053585" size="1343" user="ProjectContributor" version="1"}% +%META:FILEATTACHMENT{name="foswiki_tiny.js" attr="h" comment="" date="1518053585" size="8435" user="ProjectContributor" version="1"}% +%META:FILEATTACHMENT{name="Makefile" attr="h" comment="" date="1518053585" size="147" user="ProjectContributor" version="1"}% diff --git a/TinyMCEPlugin/lib/Foswiki/Plugins/TinyMCEPlugin.pm b/TinyMCEPlugin/lib/Foswiki/Plugins/TinyMCEPlugin.pm index bff211f7b2..50ca275096 100644 --- a/TinyMCEPlugin/lib/Foswiki/Plugins/TinyMCEPlugin.pm +++ b/TinyMCEPlugin/lib/Foswiki/Plugins/TinyMCEPlugin.pm @@ -7,8 +7,8 @@ use warnings; use Assert; -our $VERSION = '2.06'; -our $RELEASE = '25 Jan 2018'; +our $VERSION = '2.07'; +our $RELEASE = '07 Feb 2018'; our $SHORTDESCRIPTION = 'Integration of the Tiny MCE WYSIWYG Editor'; our $NO_PREFS_IN_TOPIC = 1; diff --git a/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/changelog.txt b/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/changelog.txt index fbfb4e97a6..7b4256fac9 100644 --- a/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/changelog.txt +++ b/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/changelog.txt @@ -1,3 +1,11 @@ +Version 4.7.6 (2018-01-29) + Fixed a bug in the jquery integration where it threw an error saying that "global is not defined". + Fixed a bug where deleting a table cell whose previous sibling was set to contenteditable false would create a corrupted table. + Fixed a bug where highlighting text in an unfocused editor did not work correctly in IE11/Edge. + Fixed a bug where the table resize handles were not being repositioned when activating the Fullscreen Plugin. + Fixed a bug where the Imagetools Plugin dialog didn't honor editor RTL settings. + Fixed a bug where block elements weren't being merged correctly if you deleted from after a contenteditable false element to the beginning of another block element. + Fixed a bug where TinyMCE didn't work with module loaders like webpack. Version 4.7.5 (2018-01-22) Fixed bug with the Codesample Plugin where it wasn't possible to edit codesamples when the editor was in inline mode. Fixed bug where focusing on the status bar broke the keyboard navigation functionality. diff --git a/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/js/tinymce/jquery.tinymce.min.js b/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/js/tinymce/jquery.tinymce.min.js index 5e714e081c..1f92f83326 100644 --- a/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/js/tinymce/jquery.tinymce.min.js +++ b/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/js/tinymce/jquery.tinymce.min.js @@ -1 +1 @@ -!function(){var e,t,n,i,r,a=[];r=global||window;var c=function(){return r.tinymce};(i=r.jQuery).fn.tinymce=function(e){var l,u,s,f=this,p="";if(!f.length)return f;if(!e)return c()?c().get(f[0].id):null;f.css("visibility","hidden");var d=function(){var t=[],r=0;n||(o(),n=!0),f.each(function(n,i){var a,o=i.id,l=e.oninit;o||(i.id=o=c().DOM.uniqueId()),c().get(o)||(a=c().createEditor(o,e),t.push(a),a.on("init",function(){var e,n=l;f.css("visibility",""),l&&++r==t.length&&("string"==typeof n&&(e=-1===n.indexOf(".")?null:c().resolve(n.replace(/\.\w+$/,"")),n=c().resolve(n)),n.apply(e||c(),t))}))}),i.each(t,function(e,t){t.render()})};if(r.tinymce||t||!(l=e.script_url))1===t?a.push(d):d();else{t=1,u=l.substring(0,l.lastIndexOf("/")),-1!=l.indexOf(".min")&&(p=".min"),r.tinymce=r.tinyMCEPreInit||{base:u,suffix:p},-1!=l.indexOf("gzip")&&(s=e.language||"en",l=l+(/\?/.test(l)?"&":"?")+"js=true&core=true&suffix="+escape(p)+"&themes="+escape(e.theme||"modern")+"&plugins="+escape(e.plugins||"")+"&languages="+(s||""),r.tinyMCE_GZ||(r.tinyMCE_GZ={start:function(){var t=function(e){c().ScriptLoader.markDone(c().baseURI.toAbsolute(e))};t("langs/"+s+".js"),t("themes/"+e.theme+"/theme"+p+".js"),t("themes/"+e.theme+"/langs/"+s+".js"),i.each(e.plugins.split(","),function(e,n){n&&(t("plugins/"+n+"/plugin"+p+".js"),t("plugins/"+n+"/langs/"+s+".js"))})},end:function(){}}));var v=document.createElement("script");v.type="text/javascript",v.onload=v.onreadystatechange=function(n){n=n||window.event,2===t||"load"!=n.type&&!/complete|loaded/.test(v.readyState)||(c().dom.Event.domLoaded=1,t=2,e.script_loaded&&e.script_loaded(),d(),i.each(a,function(e,t){t()}))},v.src=l,document.body.appendChild(v)}return f},i.extend(i.expr[":"],{tinymce:function(e){var t;return!!(e.id&&"tinymce"in r&&(t=c().get(e.id))&&t.editorManager===c())}});var o=function(){var t=function(e){"remove"===e&&this.each(function(e,t){var n=a(t);n&&n.remove()}),this.find("span.mceEditor,div.mceEditor").each(function(e,t){var n=c().get(t.id.replace(/_parent$/,""));n&&n.remove()})},n=function(e){var n,i=this;if(null!=e)t.call(i),i.each(function(t,n){var i;(i=c().get(n.id))&&i.setContent(e)});else if(i.length>0&&(n=c().get(i[0].id)))return n.getContent()},a=function(e){var t=null;return e&&e.id&&r.tinymce&&(t=c().get(e.id)),t},o=function(e){return!!(e&&e.length&&r.tinymce&&e.is(":tinymce"))},l={};i.each(["text","html","val"],function(t,r){var c=l[r]=i.fn[r],u="text"===r;i.fn[r]=function(t){var r=this;if(!o(r))return c.apply(r,arguments);if(t!==e)return n.call(r.filter(":tinymce"),t),c.apply(r.not(":tinymce"),arguments),r;var l="",s=arguments;return(u?r:r.eq(0)).each(function(e,t){var n=a(t);l+=n?u?n.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):n.getContent({save:!0}):c.apply(i(t),s)}),l}}),i.each(["append","prepend"],function(t,n){var r=l[n]=i.fn[n],c="prepend"===n;i.fn[n]=function(t){var n=this;return o(n)?t!==e?("string"==typeof t&&n.filter(":tinymce").each(function(e,n){var i=a(n);i&&i.setContent(c?t+i.getContent():i.getContent()+t)}),r.apply(n.not(":tinymce"),arguments),n):void 0:r.apply(n,arguments)}}),i.each(["remove","replaceWith","replaceAll","empty"],function(e,n){var r=l[n]=i.fn[n];i.fn[n]=function(){return t.call(this,n),r.apply(this,arguments)}}),l.attr=i.fn.attr,i.fn.attr=function(t,r){var c=this,u=arguments;if(!t||"value"!==t||!o(c))return l.attr.apply(c,u);if(r!==e)return n.call(c.filter(":tinymce"),r),l.attr.apply(c.not(":tinymce"),u),c;var s=c[0],f=a(s);return f?f.getContent({save:!0}):l.attr.apply(i(s),u)}}}(); \ No newline at end of file +!function(){var e,t,n,i,r,a=[];r="undefined"!=typeof global?global:window;var c=function(){return r.tinymce};(i=r.jQuery).fn.tinymce=function(e){var l,u,s,f=this,p="";if(!f.length)return f;if(!e)return c()?c().get(f[0].id):null;f.css("visibility","hidden");var d=function(){var t=[],r=0;n||(o(),n=!0),f.each(function(n,i){var a,o=i.id,l=e.oninit;o||(i.id=o=c().DOM.uniqueId()),c().get(o)||(a=c().createEditor(o,e),t.push(a),a.on("init",function(){var e,n=l;f.css("visibility",""),l&&++r==t.length&&("string"==typeof n&&(e=-1===n.indexOf(".")?null:c().resolve(n.replace(/\.\w+$/,"")),n=c().resolve(n)),n.apply(e||c(),t))}))}),i.each(t,function(e,t){t.render()})};if(r.tinymce||t||!(l=e.script_url))1===t?a.push(d):d();else{t=1,u=l.substring(0,l.lastIndexOf("/")),-1!=l.indexOf(".min")&&(p=".min"),r.tinymce=r.tinyMCEPreInit||{base:u,suffix:p},-1!=l.indexOf("gzip")&&(s=e.language||"en",l=l+(/\?/.test(l)?"&":"?")+"js=true&core=true&suffix="+escape(p)+"&themes="+escape(e.theme||"modern")+"&plugins="+escape(e.plugins||"")+"&languages="+(s||""),r.tinyMCE_GZ||(r.tinyMCE_GZ={start:function(){var t=function(e){c().ScriptLoader.markDone(c().baseURI.toAbsolute(e))};t("langs/"+s+".js"),t("themes/"+e.theme+"/theme"+p+".js"),t("themes/"+e.theme+"/langs/"+s+".js"),i.each(e.plugins.split(","),function(e,n){n&&(t("plugins/"+n+"/plugin"+p+".js"),t("plugins/"+n+"/langs/"+s+".js"))})},end:function(){}}));var v=document.createElement("script");v.type="text/javascript",v.onload=v.onreadystatechange=function(n){n=n||window.event,2===t||"load"!=n.type&&!/complete|loaded/.test(v.readyState)||(c().dom.Event.domLoaded=1,t=2,e.script_loaded&&e.script_loaded(),d(),i.each(a,function(e,t){t()}))},v.src=l,document.body.appendChild(v)}return f},i.extend(i.expr[":"],{tinymce:function(e){var t;return!!(e.id&&"tinymce"in r&&(t=c().get(e.id))&&t.editorManager===c())}});var o=function(){var t=function(e){"remove"===e&&this.each(function(e,t){var n=a(t);n&&n.remove()}),this.find("span.mceEditor,div.mceEditor").each(function(e,t){var n=c().get(t.id.replace(/_parent$/,""));n&&n.remove()})},n=function(e){var n,i=this;if(null!=e)t.call(i),i.each(function(t,n){var i;(i=c().get(n.id))&&i.setContent(e)});else if(i.length>0&&(n=c().get(i[0].id)))return n.getContent()},a=function(e){var t=null;return e&&e.id&&r.tinymce&&(t=c().get(e.id)),t},o=function(e){return!!(e&&e.length&&r.tinymce&&e.is(":tinymce"))},l={};i.each(["text","html","val"],function(t,r){var c=l[r]=i.fn[r],u="text"===r;i.fn[r]=function(t){var r=this;if(!o(r))return c.apply(r,arguments);if(t!==e)return n.call(r.filter(":tinymce"),t),c.apply(r.not(":tinymce"),arguments),r;var l="",s=arguments;return(u?r:r.eq(0)).each(function(e,t){var n=a(t);l+=n?u?n.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):n.getContent({save:!0}):c.apply(i(t),s)}),l}}),i.each(["append","prepend"],function(t,n){var r=l[n]=i.fn[n],c="prepend"===n;i.fn[n]=function(t){var n=this;return o(n)?t!==e?("string"==typeof t&&n.filter(":tinymce").each(function(e,n){var i=a(n);i&&i.setContent(c?t+i.getContent():i.getContent()+t)}),r.apply(n.not(":tinymce"),arguments),n):void 0:r.apply(n,arguments)}}),i.each(["remove","replaceWith","replaceAll","empty"],function(e,n){var r=l[n]=i.fn[n];i.fn[n]=function(){return t.call(this,n),r.apply(this,arguments)}}),l.attr=i.fn.attr,i.fn.attr=function(t,r){var c=this,u=arguments;if(!t||"value"!==t||!o(c))return l.attr.apply(c,u);if(r!==e)return n.call(c.filter(":tinymce"),r),l.attr.apply(c.not(":tinymce"),u),c;var s=c[0],f=a(s);return f?f.getContent({save:!0}):l.attr.apply(i(s),u)}}}(); \ No newline at end of file diff --git a/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/js/tinymce/plugins/image/plugin.min.js b/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/js/tinymce/plugins/image/plugin.min.js index a73388be1f..b06bc395ab 100644 --- a/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/js/tinymce/plugins/image/plugin.min.js +++ b/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/js/tinymce/plugins/image/plugin.min.js @@ -1 +1 @@ -!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.util.Tools"),n={hasDimensions:function(e){return!1!==e.settings.image_dimensions},hasAdvTab:function(e){return!0===e.settings.image_advtab},getPrependUrl:function(e){return e.getParam("image_prepend_url","")},getClassList:function(e){return e.getParam("image_class_list")},hasDescription:function(e){return!1!==e.settings.image_description},hasImageTitle:function(e){return!0===e.settings.image_title},hasImageCaption:function(e){return!0===e.settings.image_caption},getImageList:function(e){return e.getParam("image_list",!1)},hasUploadUrl:function(e){return e.getParam("images_upload_url",!1)},hasUploadHandler:function(e){return e.getParam("images_upload_handler",!1)},getUploadUrl:function(e){return e.getParam("images_upload_url")},getUploadHandler:function(e){return e.getParam("images_upload_handler")},getUploadBasePath:function(e){return e.getParam("images_upload_base_path")},getUploadCredentials:function(e){return e.getParam("images_upload_credentials")}},a="undefined"!=typeof window?window:Function("return this;")(),i=function(e,t){for(var n=t!==undefined&&null!==t?t:a,i=0;i0&&/^[0-9]+$/.test(e)&&(e+="px"),e},mergeMargins: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},createImageList:function(e,t){var a=n.getImageList(e);"string"==typeof a?c.send({url:a,success:function(e){t(JSON.parse(e))}}):"function"==typeof a?a(t):t(a)},waitLoadImage:function(e,t,a){function i(){a.onload=a.onerror=null,e.selection&&(e.selection.select(a),e.nodeChanged())}a.onload=function(){t.width||t.height||!n.hasDimensions(e)||e.dom.setAttribs(a,{width:a.clientWidth,height:a.clientHeight}),i()},a.onerror=i},blobToDataUri:function(e){return new s(function(t,n){var a=new l;a.onload=function(){t(a.result)},a.onerror=function(){n(l.error.message)},a.readAsDataURL(e)})}},d={makeTab:function(e,t){return{title:"Advanced",type:"form",pack:"start",items:[{label:"Style",name:"style",type:"textbox",onchange:(a=e,function(e){var t=a.dom,i=e.control.rootControl;if(n.hasAdvTab(a)){var r=i.toJSON(),o=t.parseStyle(r.style);i.find("#vspace").value(""),i.find("#hspace").value(""),((o=g.mergeMargins(o))["margin-top"]&&o["margin-bottom"]||o["margin-right"]&&o["margin-left"])&&(o["margin-top"]===o["margin-bottom"]?i.find("#vspace").value(g.removePixelSuffix(o["margin-top"])):i.find("#vspace").value(""),o["margin-right"]===o["margin-left"]?i.find("#hspace").value(g.removePixelSuffix(o["margin-right"])):i.find("#hspace").value("")),o["border-width"]&&i.find("#border").value(g.removePixelSuffix(o["border-width"])),i.find("#style").value(t.serializeStyle(t.parseStyle(t.serializeStyle(o))))}})},{type:"form",layout:"grid",packV:"start",columns:2,padding:0,alignH:["left","right"],defaults:{type:"textbox",maxWidth:50,onchange:function(n){t(e,n.control.rootControl)}},items:[{label:"Vertical space",name:"vspace"},{label:"Horizontal space",name:"hspace"},{label:"Border",name:"border"}]}]};var a}},m=function(e,t){e.state.set("oldVal",e.value()),t.state.set("oldVal",t.value())},f=function(e,t){var n=e.find("#width")[0],a=e.find("#height")[0],i=e.find("#constrain")[0];n&&a&&i&&t(n,a,i.checked())},p=function(e,t,n){var a=e.state.get("oldVal"),i=t.state.get("oldVal"),r=e.value(),o=t.value();n&&a&&i&&r&&o&&(r!==a?(o=Math.round(r/a*o),isNaN(o)||t.value(o)):(r=Math.round(o/i*r),isNaN(r)||e.value(r))),m(e,t)},h=function(e){f(e,p)},b={createUi:function(){var e=function(e){h(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"}]}},syncSize:function(e){f(e,m)},updateSize:h},v=function(e){e.meta=e.control.rootControl.toJSON()},y=function(e,a){var i=[{name:"src",type:"filepicker",filetype:"image",label:"Source",autofocus:!0,onchange:function(a){var i,r,o,l,s,c,u,d,m;r=e,c=(i=a).meta||{},u=i.control,d=u.rootControl,(m=d.find("#image-list")[0])&&m.value(r.convertURL(u.value(),"src")),t.each(c,function(e,t){d.find("#"+t).value(e)}),c.width||c.height||(o=r.convertURL(u.value(),"src"),l=n.getPrependUrl(r),s=new RegExp("^(?:[a-z]+:)?//","i"),l&&!s.test(o)&&o.substring(0,l.length)!==l&&(o=l+o),u.value(o),g.getImageSize(r.documentBaseURI.toAbsolute(u.value()),function(e){e.width&&e.height&&n.hasDimensions(r)&&(d.find("#width").value(e.width),d.find("#height").value(e.height),b.updateSize(d))}))},onbeforecall:v},a];return n.hasDescription(e)&&i.push({name:"alt",type:"textbox",label:"Image description"}),n.hasImageTitle(e)&&i.push({name:"title",type:"textbox",label:"Image Title"}),n.hasDimensions(e)&&i.push(b.createUi()),n.getClassList(e)&&i.push({name:"class",type:"listbox",label:"Class",values:g.buildListItems(n.getClassList(e),function(t){t.value&&(t.textStyle=function(){return e.formatter.getCssText({inline:"img",classes:[t.value]})})})}),n.hasImageCaption(e)&&i.push({name:"caption",type:"checkbox",label:"Caption"}),i},x={makeTab:function(e,t){return{title:"General",type:"form",items:y(e,t)}},getGeneralItems:y},w=function(){return o("URL")},S=function(e){return w().createObjectURL(e)},U=function(e){w().revokeObjectURL(e)},T=tinymce.util.Tools.resolve("tinymce.ui.Factory"),C=function(){},I=function(e){var n=function(t,n,a,i){var r,l;(r=new function(){return new(o("XMLHttpRequest"))}).open("POST",e.url),r.withCredentials=e.credentials,r.upload.onprogress=function(e){i(e.loaded/e.total*100)},r.onerror=function(){a("Image upload failed due to a XHR Transport error. Code: "+r.status)},r.onload=function(){var t,i,o;r.status<200||r.status>=300?a("HTTP Error: "+r.status):(t=JSON.parse(r.responseText))&&"string"==typeof t.location?n((i=e.basePath,o=t.location,i?i.replace(/\/$/,"")+"/"+o.replace(/^\//,""):o)):a("Invalid JSON: "+r.responseText)},(l=new FormData).append("file",t.blob(),t.filename()),r.send(l)};return e=t.extend({credentials:!1,handler:n},e),{upload:function(t){return e.url||e.handler!==n?(a=t,i=e.handler,new s(function(e,t){try{i(a,e,t,C)}catch(n){t(n.message)}})):s.reject("Upload url missing from the settings.");var a,i}}},P=function(e){return function(t){var a=T.get("Throbber"),i=t.control.rootControl,r=new a(i.getEl()),o=t.control.value(),l=S(o),s=I({url:n.getUploadUrl(e),basePath:n.getUploadBasePath(e),credentials:n.getUploadCredentials(e),handler:n.getUploadHandler(e)}),c=function(){r.hide(),U(l)};return r.show(),g.blobToDataUri(o).then(function(t){var n=e.editorUpload.blobCache.create({blob:o,blobUri:l,name:o.name?o.name.replace(/\.[^\.]+$/,""):null,base64:t.split(",")[1]});return s.upload(n).then(function(e){var t=i.find("#src");return t.value(e),i.find("tabpanel")[0].activateTab(0),t.fire("change"),c(),e})})["catch"](function(t){e.windowManager.alert(t),c()})}},L=".jpg,.jpeg,.png,.gif",_={makeTab: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:L,onchange:P(e)},{text:"OR",type:"label"}]},{text:"Drop an image here",type:"dropzone",accept:L,height:100,onchange:P(e)}]}}},N=function(e){var a=function(e,t){if(n.hasAdvTab(e)){var a=e.dom,i=t.toJSON(),r=a.parseStyle(i.style);r=g.mergeMargins(r),i.vspace&&(r["margin-top"]=r["margin-bottom"]=g.addPixelSuffix(i.vspace)),i.hspace&&(r["margin-left"]=r["margin-right"]=g.addPixelSuffix(i.hspace)),i.border&&(r["border-width"]=g.addPixelSuffix(i.border)),t.find("#style").value(a.serializeStyle(a.parseStyle(a.serializeStyle(r))))}};function i(i){var r,o,l,s,c={},u=e.dom;function m(){var n,i;b.updateSize(r),a(e,r),(c=t.extend(c,r.toJSON())).alt||(c.alt=""),c.title||(c.title=""),""===c.width&&(c.width=null),""===c.height&&(c.height=null),c.style||(c.style=null),c={src:c.src,alt:c.alt,title:c.title,width:c.width,height:c.height,style:c.style,caption:c.caption,"class":c["class"]},e.undoManager.transact(function(){if(c.src){if(""===c.title&&(c.title=null),o?u.setAttribs(o,c):(c.id="__mcenew",e.focus(),e.selection.setContent(u.createHTML("img",c)),o=u.get("__mcenew"),u.setAttrib(o,"id",null)),e.editorUpload.uploadImagesAuto(),!1===c.caption&&u.is(o.parentNode,"figure.image")&&(n=o.parentNode,u.insertAfter(o,n),u.remove(n)),!0!==c.caption)g.waitLoadImage(e,c,o);else if(!u.is(o.parentNode,"figure.image")){i=o,o=o.cloneNode(!0),(n=u.create("figure",{"class":"image"})).appendChild(o),n.appendChild(u.create("figcaption",{contentEditable:!0},"Caption")),n.contentEditable=!1;var t=u.getParent(i,function(t){return e.schema.getTextBlockElements()[t.nodeName]});t?u.split(t,i,n):u.replace(n,i),e.selection.select(n)}}else if(o){var a=u.is(o.parentNode,"figure.image")?o.parentNode:o;u.remove(a),e.focus(),e.nodeChanged(),u.isEmpty(e.getBody())&&(e.setContent(""),e.selection.setCursorLocation())}})}if(o=e.selection.getNode(),(l=u.getParent(o,"figure.image"))&&(o=u.select("img",l)[0]),o&&("IMG"!==o.nodeName||o.getAttribute("data-mce-object")||o.getAttribute("data-mce-placeholder"))&&(o=null),o&&(c={src:u.getAttrib(o,"src"),alt:u.getAttrib(o,"alt"),title:u.getAttrib(o,"title"),"class":u.getAttrib(o,"class"),width:u.getAttrib(o,"width"),height:u.getAttrib(o,"height"),caption:!!l}),i&&(s={type:"listbox",label:"Image list",name:"image-list",values:g.buildListItems(i,function(t){t.value=e.convertURL(t.value||t.url,"src")},[{text:"None",value:""}]),value:c.src&&e.convertURL(c.src,"src"),onselect:function(e){var t=r.find("#alt");(!t.value()||e.lastControl&&t.value()===e.lastControl.text())&&t.value(e.control.text()),r.find("#src").value(e.control.value()).fire("change")},onPostRender:function(){s=this}}),n.hasAdvTab(e)||n.hasUploadUrl(e)||n.hasUploadHandler(e)){var f=[x.makeTab(e,s)];n.hasAdvTab(e)&&(o&&(o.style.marginLeft&&o.style.marginRight&&o.style.marginLeft===o.style.marginRight&&(c.hspace=g.removePixelSuffix(o.style.marginLeft)),o.style.marginTop&&o.style.marginBottom&&o.style.marginTop===o.style.marginBottom&&(c.vspace=g.removePixelSuffix(o.style.marginTop)),o.style.borderWidth&&(c.border=g.removePixelSuffix(o.style.borderWidth)),c.style=e.dom.serializeStyle(e.dom.parseStyle(e.dom.getAttrib(o,"style")))),f.push(d.makeTab(e,a))),(n.hasUploadUrl(e)||n.hasUploadHandler(e))&&f.push(_.makeTab(e)),r=e.windowManager.open({title:"Insert/edit image",data:c,bodyType:"tabpanel",body:f,onSubmit:m})}else r=e.windowManager.open({title:"Insert/edit image",data:c,body:x.getGeneralItems(e,s),onSubmit:m});b.syncSize(r)}return{open:function(){g.createImageList(e,i)}}},A=function(e){e.addCommand("mceImage",N(e).open)},k=function(e){return function(n){for(var a,i,r=n.length,o=function(t){t.attr("contenteditable",e?"true":null)};r--;)a=n[r],(i=a.attr("class"))&&/\bimage\b/.test(i)&&(a.attr("contenteditable",e?"false":null),t.each(a.getAll("figcaption"),o))}},z=function(e){e.on("preInit",function(){e.parser.addNodeFilter("figure",k(!0)),e.serializer.addNodeFilter("figure",k(!1))})},R=function(e){e.addButton("image",{icon:"image",tooltip:"Insert/edit image",onclick:N(e).open,stateSelector:"img:not([data-mce-object],[data-mce-placeholder]),figure.image"}),e.addMenuItem("image",{icon:"image",text:"Image",onclick:N(e).open,context:"insert",prependToContext:!0})};e.add("image",function(e){z(e),R(e),A(e)})}(); \ No newline at end of file +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.util.Tools"),n={hasDimensions:function(e){return!1!==e.settings.image_dimensions},hasAdvTab:function(e){return!0===e.settings.image_advtab},getPrependUrl:function(e){return e.getParam("image_prepend_url","")},getClassList:function(e){return e.getParam("image_class_list")},hasDescription:function(e){return!1!==e.settings.image_description},hasImageTitle:function(e){return!0===e.settings.image_title},hasImageCaption:function(e){return!0===e.settings.image_caption},getImageList:function(e){return e.getParam("image_list",!1)},hasUploadUrl:function(e){return e.getParam("images_upload_url",!1)},hasUploadHandler:function(e){return e.getParam("images_upload_handler",!1)},getUploadUrl:function(e){return e.getParam("images_upload_url")},getUploadHandler:function(e){return e.getParam("images_upload_handler")},getUploadBasePath:function(e){return e.getParam("images_upload_base_path")},getUploadCredentials:function(e){return e.getParam("images_upload_credentials")}},a="undefined"!=typeof window?window:Function("return this;")(),i=function(e,t){for(var n=t!==undefined&&null!==t?t:a,i=0;i0&&/^[0-9]+$/.test(e)&&(e+="px"),e},mergeMargins: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},createImageList:function(e,t){var a=n.getImageList(e);"string"==typeof a?c.send({url:a,success:function(e){t(JSON.parse(e))}}):"function"==typeof a?a(t):t(a)},waitLoadImage:function(e,t,a){function i(){a.onload=a.onerror=null,e.selection&&(e.selection.select(a),e.nodeChanged())}a.onload=function(){t.width||t.height||!n.hasDimensions(e)||e.dom.setAttribs(a,{width:a.clientWidth,height:a.clientHeight}),i()},a.onerror=i},blobToDataUri:function(e){return new s(function(t,n){var a=new l;a.onload=function(){t(a.result)},a.onerror=function(){n(l.error.message)},a.readAsDataURL(e)})}},d={makeTab:function(e,t){return{title:"Advanced",type:"form",pack:"start",items:[{label:"Style",name:"style",type:"textbox",onchange:(a=e,function(e){var t=a.dom,i=e.control.rootControl;if(n.hasAdvTab(a)){var r=i.toJSON(),o=t.parseStyle(r.style);i.find("#vspace").value(""),i.find("#hspace").value(""),((o=g.mergeMargins(o))["margin-top"]&&o["margin-bottom"]||o["margin-right"]&&o["margin-left"])&&(o["margin-top"]===o["margin-bottom"]?i.find("#vspace").value(g.removePixelSuffix(o["margin-top"])):i.find("#vspace").value(""),o["margin-right"]===o["margin-left"]?i.find("#hspace").value(g.removePixelSuffix(o["margin-right"])):i.find("#hspace").value("")),o["border-width"]&&i.find("#border").value(g.removePixelSuffix(o["border-width"])),i.find("#style").value(t.serializeStyle(t.parseStyle(t.serializeStyle(o))))}})},{type:"form",layout:"grid",packV:"start",columns:2,padding:0,alignH:["left","right"],defaults:{type:"textbox",maxWidth:50,onchange:function(n){t(e,n.control.rootControl)}},items:[{label:"Vertical space",name:"vspace"},{label:"Horizontal space",name:"hspace"},{label:"Border",name:"border"}]}]};var a}},m=function(e,t){e.state.set("oldVal",e.value()),t.state.set("oldVal",t.value())},f=function(e,t){var n=e.find("#width")[0],a=e.find("#height")[0],i=e.find("#constrain")[0];n&&a&&i&&t(n,a,i.checked())},p=function(e,t,n){var a=e.state.get("oldVal"),i=t.state.get("oldVal"),r=e.value(),o=t.value();n&&a&&i&&r&&o&&(r!==a?(o=Math.round(r/a*o),isNaN(o)||t.value(o)):(r=Math.round(o/i*r),isNaN(r)||e.value(r))),m(e,t)},h=function(e){f(e,p)},b={createUi:function(){var e=function(e){h(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"}]}},syncSize:function(e){f(e,m)},updateSize:h},v=function(e){e.meta=e.control.rootControl.toJSON()},y=function(e,a){var i=[{name:"src",type:"filepicker",filetype:"image",label:"Source",autofocus:!0,onchange:function(a){var i,r,o,l,s,c,u,d,m;r=e,c=(i=a).meta||{},u=i.control,d=u.rootControl,(m=d.find("#image-list")[0])&&m.value(r.convertURL(u.value(),"src")),t.each(c,function(e,t){d.find("#"+t).value(e)}),c.width||c.height||(o=r.convertURL(u.value(),"src"),l=n.getPrependUrl(r),s=new RegExp("^(?:[a-z]+:)?//","i"),l&&!s.test(o)&&o.substring(0,l.length)!==l&&(o=l+o),u.value(o),g.getImageSize(r.documentBaseURI.toAbsolute(u.value()),function(e){e.width&&e.height&&n.hasDimensions(r)&&(d.find("#width").value(e.width),d.find("#height").value(e.height),b.updateSize(d))}))},onbeforecall:v},a];return n.hasDescription(e)&&i.push({name:"alt",type:"textbox",label:"Image description"}),n.hasImageTitle(e)&&i.push({name:"title",type:"textbox",label:"Image Title"}),n.hasDimensions(e)&&i.push(b.createUi()),n.getClassList(e)&&i.push({name:"class",type:"listbox",label:"Class",values:g.buildListItems(n.getClassList(e),function(t){t.value&&(t.textStyle=function(){return e.formatter.getCssText({inline:"img",classes:[t.value]})})})}),n.hasImageCaption(e)&&i.push({name:"caption",type:"checkbox",label:"Caption"}),i},x={makeTab:function(e,t){return{title:"General",type:"form",items:y(e,t)}},getGeneralItems:y},w=function(){return o.getOrDie("URL")},S=function(e){return w().createObjectURL(e)},U=function(e){w().revokeObjectURL(e)},T=tinymce.util.Tools.resolve("tinymce.ui.Factory"),C=function(){},I=function(e,t){return e?e.replace(/\/$/,"")+"/"+t.replace(/^\//,""):t};function P(e){var n=function(t,n,a,i){var r,l;(r=new function(){return new(o.getOrDie("XMLHttpRequest"))}).open("POST",e.url),r.withCredentials=e.credentials,r.upload.onprogress=function(e){i(e.loaded/e.total*100)},r.onerror=function(){a("Image upload failed due to a XHR Transport error. Code: "+r.status)},r.onload=function(){var t;r.status<200||r.status>=300?a("HTTP Error: "+r.status):(t=JSON.parse(r.responseText))&&"string"==typeof t.location?n(I(e.basePath,t.location)):a("Invalid JSON: "+r.responseText)},(l=new FormData).append("file",t.blob(),t.filename()),r.send(l)};return e=t.extend({credentials:!1,handler:n},e),{upload:function(t){return e.url||e.handler!==n?(a=t,i=e.handler,new s(function(e,t){try{i(a,e,t,C)}catch(n){t(n.message)}})):s.reject("Upload url missing from the settings.");var a,i}}}var L=function(e){return function(t){var a=T.get("Throbber"),i=t.control.rootControl,r=new a(i.getEl()),o=t.control.value(),l=S(o),s=P({url:n.getUploadUrl(e),basePath:n.getUploadBasePath(e),credentials:n.getUploadCredentials(e),handler:n.getUploadHandler(e)}),c=function(){r.hide(),U(l)};return r.show(),g.blobToDataUri(o).then(function(t){var n=e.editorUpload.blobCache.create({blob:o,blobUri:l,name:o.name?o.name.replace(/\.[^\.]+$/,""):null,base64:t.split(",")[1]});return s.upload(n).then(function(e){var t=i.find("#src");return t.value(e),i.find("tabpanel")[0].activateTab(0),t.fire("change"),c(),e})})["catch"](function(t){e.windowManager.alert(t),c()})}},_=".jpg,.jpeg,.png,.gif",N={makeTab: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:_,onchange:L(e)},{text:"OR",type:"label"}]},{text:"Drop an image here",type:"dropzone",accept:_,height:100,onchange:L(e)}]}}};function A(e){var a=function(e,t){if(n.hasAdvTab(e)){var a=e.dom,i=t.toJSON(),r=a.parseStyle(i.style);r=g.mergeMargins(r),i.vspace&&(r["margin-top"]=r["margin-bottom"]=g.addPixelSuffix(i.vspace)),i.hspace&&(r["margin-left"]=r["margin-right"]=g.addPixelSuffix(i.hspace)),i.border&&(r["border-width"]=g.addPixelSuffix(i.border)),t.find("#style").value(a.serializeStyle(a.parseStyle(a.serializeStyle(r))))}};function i(i){var r,o,l,s,c={},u=e.dom;function m(){var n,i;b.updateSize(r),a(e,r),(c=t.extend(c,r.toJSON())).alt||(c.alt=""),c.title||(c.title=""),""===c.width&&(c.width=null),""===c.height&&(c.height=null),c.style||(c.style=null),c={src:c.src,alt:c.alt,title:c.title,width:c.width,height:c.height,style:c.style,caption:c.caption,"class":c["class"]},e.undoManager.transact(function(){if(c.src){if(""===c.title&&(c.title=null),o?u.setAttribs(o,c):(c.id="__mcenew",e.focus(),e.selection.setContent(u.createHTML("img",c)),o=u.get("__mcenew"),u.setAttrib(o,"id",null)),e.editorUpload.uploadImagesAuto(),!1===c.caption&&u.is(o.parentNode,"figure.image")&&(n=o.parentNode,u.insertAfter(o,n),u.remove(n)),!0!==c.caption)g.waitLoadImage(e,c,o);else if(!u.is(o.parentNode,"figure.image")){i=o,o=o.cloneNode(!0),(n=u.create("figure",{"class":"image"})).appendChild(o),n.appendChild(u.create("figcaption",{contentEditable:!0},"Caption")),n.contentEditable=!1;var t=u.getParent(i,function(t){return e.schema.getTextBlockElements()[t.nodeName]});t?u.split(t,i,n):u.replace(n,i),e.selection.select(n)}}else if(o){var a=u.is(o.parentNode,"figure.image")?o.parentNode:o;u.remove(a),e.focus(),e.nodeChanged(),u.isEmpty(e.getBody())&&(e.setContent(""),e.selection.setCursorLocation())}})}if(o=e.selection.getNode(),(l=u.getParent(o,"figure.image"))&&(o=u.select("img",l)[0]),o&&("IMG"!==o.nodeName||o.getAttribute("data-mce-object")||o.getAttribute("data-mce-placeholder"))&&(o=null),o&&(c={src:u.getAttrib(o,"src"),alt:u.getAttrib(o,"alt"),title:u.getAttrib(o,"title"),"class":u.getAttrib(o,"class"),width:u.getAttrib(o,"width"),height:u.getAttrib(o,"height"),caption:!!l}),i&&(s={type:"listbox",label:"Image list",name:"image-list",values:g.buildListItems(i,function(t){t.value=e.convertURL(t.value||t.url,"src")},[{text:"None",value:""}]),value:c.src&&e.convertURL(c.src,"src"),onselect:function(e){var t=r.find("#alt");(!t.value()||e.lastControl&&t.value()===e.lastControl.text())&&t.value(e.control.text()),r.find("#src").value(e.control.value()).fire("change")},onPostRender:function(){s=this}}),n.hasAdvTab(e)||n.hasUploadUrl(e)||n.hasUploadHandler(e)){var f=[x.makeTab(e,s)];n.hasAdvTab(e)&&(o&&(o.style.marginLeft&&o.style.marginRight&&o.style.marginLeft===o.style.marginRight&&(c.hspace=g.removePixelSuffix(o.style.marginLeft)),o.style.marginTop&&o.style.marginBottom&&o.style.marginTop===o.style.marginBottom&&(c.vspace=g.removePixelSuffix(o.style.marginTop)),o.style.borderWidth&&(c.border=g.removePixelSuffix(o.style.borderWidth)),c.style=e.dom.serializeStyle(e.dom.parseStyle(e.dom.getAttrib(o,"style")))),f.push(d.makeTab(e,a))),(n.hasUploadUrl(e)||n.hasUploadHandler(e))&&f.push(N.makeTab(e)),r=e.windowManager.open({title:"Insert/edit image",data:c,bodyType:"tabpanel",body:f,onSubmit:m})}else r=e.windowManager.open({title:"Insert/edit image",data:c,body:x.getGeneralItems(e,s),onSubmit:m});b.syncSize(r)}return{open:function(){g.createImageList(e,i)}}}var k=function(e){e.addCommand("mceImage",A(e).open)},z=function(e){return function(n){for(var a,i,r=n.length,o=function(t){t.attr("contenteditable",e?"true":null)};r--;)a=n[r],(i=a.attr("class"))&&/\bimage\b/.test(i)&&(a.attr("contenteditable",e?"false":null),t.each(a.getAll("figcaption"),o))}},R=function(e){e.on("preInit",function(){e.parser.addNodeFilter("figure",z(!0)),e.serializer.addNodeFilter("figure",z(!1))})},D=function(e){e.addButton("image",{icon:"image",tooltip:"Insert/edit image",onclick:A(e).open,stateSelector:"img:not([data-mce-object],[data-mce-placeholder]),figure.image"}),e.addMenuItem("image",{icon:"image",text:"Image",onclick:A(e).open,context:"insert",prependToContext:!0})};e.add("image",function(e){R(e),D(e),k(e)})}(); \ No newline at end of file diff --git a/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/js/tinymce/plugins/imagetools/plugin.min.js b/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/js/tinymce/plugins/imagetools/plugin.min.js index 53fe3f0dcf..7d89afc1c6 100644 --- a/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/js/tinymce/plugins/imagetools/plugin.min.js +++ b/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/js/tinymce/plugins/imagetools/plugin.min.js @@ -1 +1 @@ -!function(){"use strict";var t=function(e){var n=e,o=function(){return n};return{get:o,set:function(t){n=t},clone:function(){return t(o())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.util.Tools");function o(t,e){return i(document.createElement("canvas"),t,e)}function r(t){return t.getContext("2d")}function i(t,e,n){return t.width=e,t.height=n,t}var a,u,c,l,s={create:o,clone:function(t){var e;return r(e=o(t.width,t.height)).drawImage(t,0,0),e},resize:i,get2dContext:r,get3dContext:function(t){var e=null;try{e=t.getContext("webgl")||t.getContext("experimental-webgl")}catch(n){}return e||(e=null),e}},f={getWidth:function(t){return t.naturalWidth||t.width},getHeight:function(t){return t.naturalHeight||t.height}},d=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=[],c(t,n(i,this),n(a,this))},e=t.immediateFn||"function"==typeof setImmediate&&setImmediate||function(t){setTimeout(t,1)};function n(t,e){return function(){t.apply(e,arguments)}}var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function r(t){var n=this;null!==this._state?e(function(){var e=n._state?t.onFulfilled:t.onRejected;if(null!==e){var o;try{o=e(n._value)}catch(r){return void t.reject(r)}t.resolve(o)}else(n._state?t.resolve:t.reject)(n._value)}):this._deferreds.push(t)}function i(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 c(n(e,t),n(i,this),n(a,this))}this._state=!0,this._value=t,u.call(this)}catch(o){a.call(this,o)}}function a(t){this._state=!1,this._value=t,u.call(this)}function u(){for(var t=0,e=this._deferreds.length;tn?t=n:t0?3*e:e)))+n,(r=.6094)*(1-n),.082*(1-n),0,0,o*(1-n),r*(1-n)+n,.082*(1-n),0,0,o*(1-n),r*(1-n),.082*(1-n)+n,0,0,0,0,0,1,0,0,0,0,0,1])},adjustHue:function(t,e){var n,o,r,i,a;return e=F(e,-180,180)/180*Math.PI,n=Math.cos(e),o=Math.sin(e),W(t,[(r=.213)+.787*n+o*-r,(i=.715)+n*-i+o*-i,(a=.072)+n*-a+.928*o,0,0,r+n*-r+.143*o,i+n*(1-i)+.14*o,a+n*-a+-.283*o,0,0,r+n*-r+-.787*o,i+n*-i+o*i,a+.928*n+o*a,0,0,0,0,0,1,0,0,0,0,0,1])},adjustColors:function(t,e,n,o){return W(t,[e=F(e,0,2),0,0,0,0,0,n=F(n,0,2),0,0,0,0,0,o=F(o,0,2),0,0,0,0,0,1,0,0,0,0,0,1])},adjustSepia:function(t,e){return W(t,q([.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=F(e,0,1)))},adjustGrayscale:function(t,e){return W(t,q([.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=F(e,0,1)))}};function N(t,e){return t.toCanvas().then(function(n){return o=n,r=t.getType(),i=e,u=s.get2dContext(o),a=function(t,e){var n,o,r,i,a,u=t.data,c=e[0],l=e[1],s=e[2],f=e[3],d=e[4],h=e[5],p=e[6],m=e[7],g=e[8],v=e[9],y=e[10],b=e[11],w=e[12],x=e[13],R=e[14],I=e[15],T=e[16],k=e[17],C=e[18],B=e[19];for(a=0;an?t=n:t2)&&(i=i<.5?.5:2,u=!0),(a<.5||a>2)&&(a=a<.5?.5:2,u=!0);var c,l,h,p=(c=t,l=i,h=a,new d(function(t){var e=f.getWidth(c),n=f.getHeight(c),o=Math.floor(e*l),r=Math.floor(n*h),i=s.create(o,r),a=s.get2dContext(i);a.drawImage(c,0,0,e,n,0,0,o,r),t(i)}));return u?p.then(function(t){return te(t,e,n)}):p}},Q={rotate:function(t,e){return t.toCanvas().then(function(n){return o=n,r=t.getType(),i=e,a=s.create(o.width,o.height),u=s.get2dContext(a),c=0,l=0,90!=(i=i<0?360+i:i)&&270!=i||s.resize(a,a.height,a.width),90!=i&&180!=i||(c=a.width),270!=i&&180!=i||(l=a.height),u.translate(c,l),u.rotate(i*Math.PI/180),u.drawImage(o,0,0),D.fromCanvas(a,r);var o,r,i,a,u,c,l})},flip:function(t,e){return t.toCanvas().then(function(n){return o=n,r=t.getType(),i=e,a=s.create(o.width,o.height),u=s.get2dContext(a),"v"==i?(u.scale(1,-1),u.drawImage(o,0,-a.height)):(u.scale(-1,1),u.drawImage(o,-a.width,0)),D.fromCanvas(a,r);var o,r,i,a,u})},crop:function(t,e,n,o,r){return t.toCanvas().then(function(i){return a=i,u=t.getType(),c=e,l=n,f=o,d=r,h=s.create(f,d),s.get2dContext(h).drawImage(a,-c,-l),D.fromCanvas(h,u);var a,u,c,l,f,d,h})},resize:function(t,e,n){return t.toCanvas().then(function(o){return Z.scale(o,e,n).then(function(e){return D.fromCanvas(e,t.getType())})})}},tt={invert:function(t){return K.invert(t)},sharpen:function(t){return K.sharpen(t)},emboss:function(t){return K.emboss(t)},brightness:function(t,e){return K.brightness(t,e)},hue:function(t,e){return K.hue(t,e)},saturate:function(t,e){return K.saturate(t,e)},contrast:function(t,e){return K.contrast(t,e)},grayscale:function(t,e){return K.grayscale(t,e)},sepia:function(t,e){return K.sepia(t,e)},colorize:function(t,e,n,o){return K.colorize(t,e,n,o)},gamma:function(t,e){return K.gamma(t,e)},exposure:function(t,e){return K.exposure(t,e)},flip:function(t,e){return Q.flip(t,e)},crop:function(t,e,n,o,r){return Q.crop(t,e,n,o,r)},resize:function(t,e,n){return Q.resize(t,e,n)},rotate:function(t,e){return Q.rotate(t,e)}},et=function(t){return t.toBlob()},nt={blobToImageResult:function(t){return D.fromBlob(t)},fromBlobAndUrlSync:function(t,e){return D.fromBlobAndUrlSync(t,e)},imageToImageResult:function(t){return D.fromImage(t)},imageResultToBlob:function(t,e,n){return e===undefined&&n===undefined?et(t):t.toAdjustedBlob(e,n)},imageResultToOriginalBlob:et,imageResultToDataURL:function(t){return t.toDataURL()}},ot=function(){return T("URL")},rt={createObjectURL:function(t){return ot().createObjectURL(t)},revokeObjectURL:function(t){ot().revokeObjectURL(t)}},it=tinymce.util.Tools.resolve("tinymce.util.Delay"),at=tinymce.util.Tools.resolve("tinymce.util.Promise"),ut=tinymce.util.Tools.resolve("tinymce.util.URI"),ct=function(t){return t.getParam("imagetools_toolbar","rotateleft rotateright | flipv fliph | crop editimage imageoptions")},lt=function(t){return t.getParam("imagetools_proxy")},st={getImageSize:function(t){var e,n;function o(t){return/^[0-9\.]+px$/.test(t)}return e=t.style.width,n=t.style.height,e||n?o(e)&&o(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,o;e&&(n=t.style.width,o=t.style.height,(n||o)&&(t.style.width=e.w+"px",t.style.height=e.h+"px",t.removeAttribute("data-mce-style")),n=t.width,o=t.height,(n||o)&&(t.setAttribute("width",e.w),t.setAttribute("height",e.h)))},getNaturalImageSize:function(t){return{w:t.naturalWidth,h:t.naturalHeight}}},ft=(Array.prototype.indexOf,undefined,Array.prototype.push,Array.prototype.slice,function(t,e){for(var n=0,o=t.length;n=300?wt.handleServiceErrorResponse(t.status,t.blob):at.resolve(t.blob)});var n,o,r},Rt=function(t,e){return e?xt(t,e):(n=t,ht.requestUrlAsBlob(n,{}).then(function(t){return t.status<200||t.status>=300?wt.handleHttpError(t.status):at.resolve(t.blob)}));var n},It=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Tt=tinymce.util.Tools.resolve("tinymce.ui.Factory"),kt=function(){var t=[],e=-1;function n(){return e>0}function o(){return-1!==e&&e').appendTo(r),n.each(l,function(t){Ut("#"+f,r).append('