tinymce-rails 4.4.3 → 4.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/source/tinymce/tinymce.js +2044 -391
- data/lib/tinymce/rails/version.rb +2 -2
- data/vendor/assets/javascripts/tinymce/jquery.tinymce.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/advlist/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/anchor/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/autolink/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/autoresize/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/autosave/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/charmap/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/codesample/plugin.dev.js +141 -0
- data/vendor/assets/javascripts/tinymce/plugins/codesample/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/contextmenu/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/fullpage/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/fullscreen/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/image/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/imagetools/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/importcss/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/insertdatetime/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/legacyoutput/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/link/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/lists/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/media/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/nonbreaking/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/noneditable/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/pagebreak/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/paste/plugin.dev.js +143 -0
- data/vendor/assets/javascripts/tinymce/plugins/paste/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/preview/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/save/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/searchreplace/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/spellchecker/plugin.dev.js +139 -0
- data/vendor/assets/javascripts/tinymce/plugins/spellchecker/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/tabfocus/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/table/plugin.dev.js +143 -0
- data/vendor/assets/javascripts/tinymce/plugins/table/plugin.js +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/template/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/textpattern/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/toc/plugin.js +1 -0
- data/vendor/assets/javascripts/tinymce/plugins/visualchars/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/wordcount/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/skins/lightgray/AbsoluteLayout.less +17 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/Animations.less +10 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/Arrows.less +115 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/Button.less +175 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/ButtonGroup.less +71 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/Checkbox.less +49 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/ColorBox.less +6 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/ColorButton.less +72 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/ColorPicker.less +80 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/ComboBox.less +97 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/Container.less +9 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/Content.Inline.less +4 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/Content.Objects.less +178 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/Content.less +27 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/CropRect.less +62 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/FieldSet.less +15 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/FitLayout.less +9 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/FloatPanel.less +69 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/FlowLayout.less +36 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/Icons.Ie7.less +136 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/Icons.less +182 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/Iframe.less +6 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/ImagePanel.less +25 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/InfoBox.less +71 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/Label.less +38 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/ListBox.less +26 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/Menu.less +34 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/MenuBar.less +32 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/MenuButton.less +34 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/MenuItem.less +176 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/Mixins.less +54 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/Notification.less +142 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/Panel.less +7 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/Path.less +45 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/Progress.less +34 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/Radio.less +1 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/Reset.less +32 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/ResizeHandle.less +18 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/Scrollable.less +44 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/SelectBox.less +6 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/Sidebar.less +49 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/Slider.less +33 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/Spacer.less +5 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/SplitButton.less +49 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/StackLayout.less +5 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/TabPanel.less +44 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/TextBox.less +41 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/Throbber.less +19 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/TinyMCE.less +159 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/ToolTip.less +133 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/Variables.less +218 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/Window.less +127 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/content.inline.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/lightgray/content.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/tinymce.eot +0 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/fonts/tinymce.svg +2 -0
- 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/skin.dev.less +48 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/skin.ie7.dev.less +47 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/skin.ie7.less +2777 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/skin.ie7.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/lightgray/skin.less +2874 -0
- data/vendor/assets/javascripts/tinymce/skins/lightgray/skin.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/themes/inlite/theme.js +1 -1
- data/vendor/assets/javascripts/tinymce/themes/modern/theme.js +1 -1
- data/vendor/assets/javascripts/tinymce/tinymce.js +14 -14
- metadata +65 -4
- data/vendor/assets/javascripts/tinymce/plugins/media/moxieplayer.swf +0 -0
@@ -1 +1 @@
|
|
1
|
-
!function(a){function b(){function b(a){"remove"===a&&this.each(function(a,b){var c=e(b);c&&c.remove()}),this.find("span.mceEditor,div.mceEditor").each(function(a,b){var c=tinymce.get(b.id.replace(/_parent$/,""));c&&c.remove()})}function d(a){var c,d=this;if(null!=a)b.call(d),d.each(function(b,c){var d;(d=tinymce.get(c.id))&&d.setContent(a)});else if(d.length>0&&(c=tinymce.get(d[0].id)))return c.getContent()}function e(a){var b=null;return a&&a.id&&g.tinymce&&(b=tinymce.get(a.id)),b}function f(a){return!!(a&&a.length&&g.tinymce&&a.is(":tinymce"))}var h={};a.each(["text","html","val"],function(b,g){var i=h[g]=a.fn[g],j="text"===g;a.fn[g]=function(b){var g=this;if(!f(g))return i.apply(g,arguments);if(b!==c)return d.call(g.filter(":tinymce"),b),i.apply(g.not(":tinymce"),arguments),g;var h="",k=arguments;return(j?g:g.eq(0)).each(function(b,c){var d=e(c);h+=d?j?d.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):d.getContent({save:!0}):i.apply(a(c),k)}),h}}),a.each(["append","prepend"],function(b,d){var g=h[d]=a.fn[d],i="prepend"===d;a.fn[d]=function(a){var b=this;return f(b)?a!==c?("string"==typeof a&&b.filter(":tinymce").each(function(b,c){var d=e(c);d&&d.setContent(i?a+d.getContent():d.getContent()+a)}),g.apply(b.not(":tinymce"),arguments),b):void 0:g.apply(b,arguments)}}),a.each(["remove","replaceWith","replaceAll","empty"],function(c,d){var e=h[d]=a.fn[d];a.fn[d]=function(){return b.call(this,d),e.apply(this,arguments)}}),h.attr=a.fn.attr,a.fn.attr=function(b,g){var i=this,j=arguments;if(!b||"value"!==b||!f(i))return g!==c?h.attr.apply(i,j):h.attr.apply(i,j);if(g!==c)return d.call(i.filter(":tinymce"),g),h.attr.apply(i.not(":tinymce"),j),i;var k=i[0],l=e(k);return l?l.getContent({save:!0}):h.attr.apply(a(k),j)}}var c,d,e,f=[],g=window;a.fn.tinymce=function(c){function h(){var d=[],f=0;e||(b(),e=!0),l.each(function(a,b){var e,g=b.id,h=c.oninit;g||(b.id=g=tinymce.DOM.uniqueId()),tinymce.get(g)||(e=new tinymce.Editor(g,c,tinymce.EditorManager),d.push(e),e.on("init",function(){var a,b=h;l.css("visibility",""),h&&++f==d.length&&("string"==typeof b&&(a
|
1
|
+
!function(a){function b(){function b(a){"remove"===a&&this.each(function(a,b){var c=e(b);c&&c.remove()}),this.find("span.mceEditor,div.mceEditor").each(function(a,b){var c=tinymce.get(b.id.replace(/_parent$/,""));c&&c.remove()})}function d(a){var c,d=this;if(null!=a)b.call(d),d.each(function(b,c){var d;(d=tinymce.get(c.id))&&d.setContent(a)});else if(d.length>0&&(c=tinymce.get(d[0].id)))return c.getContent()}function e(a){var b=null;return a&&a.id&&g.tinymce&&(b=tinymce.get(a.id)),b}function f(a){return!!(a&&a.length&&g.tinymce&&a.is(":tinymce"))}var h={};a.each(["text","html","val"],function(b,g){var i=h[g]=a.fn[g],j="text"===g;a.fn[g]=function(b){var g=this;if(!f(g))return i.apply(g,arguments);if(b!==c)return d.call(g.filter(":tinymce"),b),i.apply(g.not(":tinymce"),arguments),g;var h="",k=arguments;return(j?g:g.eq(0)).each(function(b,c){var d=e(c);h+=d?j?d.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):d.getContent({save:!0}):i.apply(a(c),k)}),h}}),a.each(["append","prepend"],function(b,d){var g=h[d]=a.fn[d],i="prepend"===d;a.fn[d]=function(a){var b=this;return f(b)?a!==c?("string"==typeof a&&b.filter(":tinymce").each(function(b,c){var d=e(c);d&&d.setContent(i?a+d.getContent():d.getContent()+a)}),g.apply(b.not(":tinymce"),arguments),b):void 0:g.apply(b,arguments)}}),a.each(["remove","replaceWith","replaceAll","empty"],function(c,d){var e=h[d]=a.fn[d];a.fn[d]=function(){return b.call(this,d),e.apply(this,arguments)}}),h.attr=a.fn.attr,a.fn.attr=function(b,g){var i=this,j=arguments;if(!b||"value"!==b||!f(i))return g!==c?h.attr.apply(i,j):h.attr.apply(i,j);if(g!==c)return d.call(i.filter(":tinymce"),g),h.attr.apply(i.not(":tinymce"),j),i;var k=i[0],l=e(k);return l?l.getContent({save:!0}):h.attr.apply(a(k),j)}}var c,d,e,f=[],g=window;a.fn.tinymce=function(c){function h(){var d=[],f=0;e||(b(),e=!0),l.each(function(a,b){var e,g=b.id,h=c.oninit;g||(b.id=g=tinymce.DOM.uniqueId()),tinymce.get(g)||(e=new tinymce.Editor(g,c,tinymce.EditorManager),d.push(e),e.on("init",function(){var a,b=h;l.css("visibility",""),h&&++f==d.length&&("string"==typeof b&&(a=b.indexOf(".")===-1?null:tinymce.resolve(b.replace(/\.\w+$/,"")),b=tinymce.resolve(b)),b.apply(a||tinymce,d))}))}),a.each(d,function(a,b){b.render()})}var i,j,k,l=this,m="";if(!l.length)return l;if(!c)return window.tinymce?tinymce.get(l[0].id):null;if(l.css("visibility","hidden"),g.tinymce||d||!(i=c.script_url))1===d?f.push(h):h();else{d=1,j=i.substring(0,i.lastIndexOf("/")),i.indexOf(".min")!=-1&&(m=".min"),g.tinymce=g.tinyMCEPreInit||{base:j,suffix:m},i.indexOf("gzip")!=-1&&(k=c.language||"en",i=i+(/\?/.test(i)?"&":"?")+"js=true&core=true&suffix="+escape(m)+"&themes="+escape(c.theme||"modern")+"&plugins="+escape(c.plugins||"")+"&languages="+(k||""),g.tinyMCE_GZ||(g.tinyMCE_GZ={start:function(){function b(a){tinymce.ScriptLoader.markDone(tinymce.baseURI.toAbsolute(a))}b("langs/"+k+".js"),b("themes/"+c.theme+"/theme"+m+".js"),b("themes/"+c.theme+"/langs/"+k+".js"),a.each(c.plugins.split(","),function(a,c){c&&(b("plugins/"+c+"/plugin"+m+".js"),b("plugins/"+c+"/langs/"+k+".js"))})},end:function(){}}));var n=document.createElement("script");n.type="text/javascript",n.onload=n.onreadystatechange=function(b){b=b||window.event,2===d||"load"!=b.type&&!/complete|loaded/.test(n.readyState)||(tinymce.dom.Event.domLoaded=1,d=2,c.script_loaded&&c.script_loaded(),h(),a.each(f,function(a,b){b()}))},n.src=i,document.body.appendChild(n)}return l},a.extend(a.expr[":"],{tinymce:function(a){var b;return!!(a.id&&"tinymce"in window&&(b=tinymce.get(a.id),b&&b.editorManager===tinymce))}})}(jQuery);
|
@@ -1 +1 @@
|
|
1
|
-
tinymce.PluginManager.add("advlist",function(a){function b(a,b){var c=[];return tinymce.each(b.split(/[ ,]/),function(a){c.push({text:a.replace(/\-/g," ").replace(/\b\w/g,function(a){return a.toUpperCase()}),data:"default"==a?"":a})}),c}function
|
1
|
+
tinymce.PluginManager.add("advlist",function(a){function b(b){return a.$.contains(a.getBody(),b)}function c(a){return a&&/^(OL|UL|DL)$/.test(a.nodeName)&&b(a)}function d(a,b){var c=[];return tinymce.each(b.split(/[ ,]/),function(a){c.push({text:a.replace(/\-/g," ").replace(/\b\w/g,function(a){return a.toUpperCase()}),data:"default"==a?"":a})}),c}function e(b,c){a.undoManager.transact(function(){var d,e=a.dom,f=a.selection;if(d=e.getParent(f.getNode(),"ol,ul"),!d||d.nodeName!=b||c===!1){var g={"list-style-type":c?c:""};a.execCommand("UL"==b?"InsertUnorderedList":"InsertOrderedList",!1,g)}d=e.getParent(f.getNode(),"ol,ul"),d&&tinymce.util.Tools.each(e.select("ol,ul",d).concat([d]),function(a){a.nodeName!==b&&c!==!1&&(a=e.rename(a,b)),e.setStyle(a,"listStyleType",c?c:null),a.removeAttribute("data-mce-style")}),a.focus()})}function f(b){var c=a.dom.getStyle(a.dom.getParent(a.selection.getNode(),"ol,ul"),"listStyleType")||"";b.control.items().each(function(a){a.active(a.settings.data===c)})}var g,h;g=d("OL",a.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman")),h=d("UL",a.getParam("advlist_bullet_styles","default,circle,disc,square"));var i=function(b){return function(){var d=this;a.on("NodeChange",function(a){var e=tinymce.util.Tools.grep(a.parents,c);d.active(e.length>0&&e[0].nodeName===b)})}};tinymce.PluginManager.get("lists")&&(a.addCommand("ApplyUnorderedListStyle",function(a,b){e("UL",b["list-style-type"])}),a.addCommand("ApplyOrderedListStyle",function(a,b){e("OL",b["list-style-type"])}),a.addButton("numlist",{type:"splitbutton",tooltip:"Numbered list",menu:g,onPostRender:i("OL"),onshow:f,onselect:function(a){e("OL",a.control.settings.data)},onclick:function(){e("OL",!1)}}),a.addButton("bullist",{type:"splitbutton",tooltip:"Bullet list",onPostRender:i("UL"),menu:h,onshow:f,onselect:function(a){e("UL",a.control.settings.data)},onclick:function(){e("UL",!1)}}))});
|
@@ -1 +1 @@
|
|
1
|
-
tinymce.PluginManager.add("anchor",function(a){function b(){var b=a.selection.getNode(),c="",d="A"==b.tagName&&""===a.dom.getAttrib(b,"href");d&&(c=b.name||b.id||""),a.windowManager.open({title:"Anchor",body:{type:"textbox",name:"name",size:40,label:"Name",value:c},onsubmit:function(c){var e=c.data.name;d?b.id=e:(a.selection.collapse(!0),a.execCommand("mceInsertContent",!1,a.dom.createHTML("a",{id:e})))}})}a.addCommand("mceAnchor",
|
1
|
+
tinymce.PluginManager.add("anchor",function(a){var b=function(a){return!a.attr("href")&&(a.attr("id")||a.attr("name"))&&!a.firstChild},c=function(a){return function(c){for(var d=0;d<c.length;d++)b(c[d])&&c[d].attr("contenteditable",a)}},d=function(){var b=a.selection.getNode(),c="",d="A"==b.tagName&&""===a.dom.getAttrib(b,"href");d&&(c=b.name||b.id||""),a.windowManager.open({title:"Anchor",body:{type:"textbox",name:"name",size:40,label:"Name",value:c},onsubmit:function(c){var e=c.data.name;d?b.id=e:(a.selection.collapse(!0),a.execCommand("mceInsertContent",!1,a.dom.createHTML("a",{id:e})))}})};tinymce.Env.ceFalse&&a.on("PreInit",function(){a.parser.addNodeFilter("a",c("false")),a.serializer.addNodeFilter("a",c(null))}),a.addCommand("mceAnchor",d),a.addButton("anchor",{icon:"anchor",tooltip:"Anchor",onclick:d,stateSelector:"a:not([href])"}),a.addMenuItem("anchor",{icon:"anchor",text:"Anchor",context:"insert",onclick:d})});
|
@@ -1 +1 @@
|
|
1
|
-
tinymce.PluginManager.add("autolink",function(a){function b(a){e(a,-1,"(",!0)}function c(a){e(a,0,"",!0)}function d(a){e(a,-1,"",!1)}function e(a,b,c){function d(a,b){if(0
|
1
|
+
tinymce.PluginManager.add("autolink",function(a){function b(a){e(a,-1,"(",!0)}function c(a){e(a,0,"",!0)}function d(a){e(a,-1,"",!1)}function e(a,b,c){function d(a,b){if(b<0&&(b=0),3==a.nodeType){var c=a.data.length;b>c&&(b=c)}return b}function e(a,b){1!=a.nodeType||a.hasChildNodes()?h.setStart(a,d(a,b)):h.setStartBefore(a)}function f(a,b){1!=a.nodeType||a.hasChildNodes()?h.setEnd(a,d(a,b)):h.setEndAfter(a)}var h,i,j,k,l,m,n,o,p,q;if("A"!=a.selection.getNode().tagName){if(h=a.selection.getRng(!0).cloneRange(),h.startOffset<5){if(o=h.endContainer.previousSibling,!o){if(!h.endContainer.firstChild||!h.endContainer.firstChild.nextSibling)return;o=h.endContainer.firstChild.nextSibling}if(p=o.length,e(o,p),f(o,p),h.endOffset<5)return;i=h.endOffset,k=o}else{if(k=h.endContainer,3!=k.nodeType&&k.firstChild){for(;3!=k.nodeType&&k.firstChild;)k=k.firstChild;3==k.nodeType&&(e(k,0),f(k,k.nodeValue.length))}i=1==h.endOffset?2:h.endOffset-1-b}j=i;do e(k,i>=2?i-2:0),f(k,i>=1?i-1:0),i-=1,q=h.toString();while(" "!=q&&""!==q&&160!=q.charCodeAt(0)&&i-2>=0&&q!=c);h.toString()==c||160==h.toString().charCodeAt(0)?(e(k,i),f(k,j),i+=1):0===h.startOffset?(e(k,0),f(k,j)):(e(k,i),f(k,j)),m=h.toString(),"."==m.charAt(m.length-1)&&f(k,j-1),m=h.toString(),n=m.match(g),n&&("www."==n[1]?n[1]="http://www.":/@$/.test(n[1])&&!/^mailto:/.test(n[1])&&(n[1]="mailto:"+n[1]),l=a.selection.getBookmark(),a.selection.setRng(h),a.execCommand("createlink",!1,n[1]+n[2]),a.selection.moveToBookmark(l),a.nodeChanged())}}var f,g=/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i;return a.settings.autolink_pattern&&(g=a.settings.autolink_pattern),a.on("keydown",function(b){if(13==b.keyCode)return d(a)}),tinymce.Env.ie?void a.on("focus",function(){if(!f){f=!0;try{a.execCommand("AutoUrlDetect",!1,!0)}catch(a){}}}):(a.on("keypress",function(c){if(41==c.keyCode)return b(a)}),void a.on("keyup",function(b){if(32==b.keyCode)return c(a)}))});
|
@@ -1 +1 @@
|
|
1
|
-
tinymce.PluginManager.add("autoresize",function(a){function b(){return a.plugins.fullscreen&&a.plugins.fullscreen.isFullscreen()}function c(d){var g,h,i,j,k,l,m,n,o,p,q,r,s=tinymce.DOM;if(h=a.getDoc()){if(i=h.body,j=h.documentElement,k=e.autoresize_min_height,!i||d&&"setcontent"===d.type&&d.initial||b())return void(i&&j&&(i.style.overflowY="auto",j.style.overflowY="auto"));m=a.dom.getStyle(i,"margin-top",!0),n=a.dom.getStyle(i,"margin-bottom",!0),o=a.dom.getStyle(i,"padding-top",!0),p=a.dom.getStyle(i,"padding-bottom",!0),q=a.dom.getStyle(i,"border-top-width",!0),r=a.dom.getStyle(i,"border-bottom-width",!0),l=i.offsetHeight+parseInt(m,10)+parseInt(n,10)+parseInt(o,10)+parseInt(p,10)+parseInt(q,10)+parseInt(r,10),(isNaN(l)||0
|
1
|
+
tinymce.PluginManager.add("autoresize",function(a){function b(){return a.plugins.fullscreen&&a.plugins.fullscreen.isFullscreen()}function c(d){var g,h,i,j,k,l,m,n,o,p,q,r,s=tinymce.DOM;if(h=a.getDoc()){if(i=h.body,j=h.documentElement,k=e.autoresize_min_height,!i||d&&"setcontent"===d.type&&d.initial||b())return void(i&&j&&(i.style.overflowY="auto",j.style.overflowY="auto"));m=a.dom.getStyle(i,"margin-top",!0),n=a.dom.getStyle(i,"margin-bottom",!0),o=a.dom.getStyle(i,"padding-top",!0),p=a.dom.getStyle(i,"padding-bottom",!0),q=a.dom.getStyle(i,"border-top-width",!0),r=a.dom.getStyle(i,"border-bottom-width",!0),l=i.offsetHeight+parseInt(m,10)+parseInt(n,10)+parseInt(o,10)+parseInt(p,10)+parseInt(q,10)+parseInt(r,10),(isNaN(l)||l<=0)&&(l=tinymce.Env.ie?i.scrollHeight:tinymce.Env.webkit&&0===i.clientHeight?0:i.offsetHeight),l>e.autoresize_min_height&&(k=l),e.autoresize_max_height&&l>e.autoresize_max_height?(k=e.autoresize_max_height,i.style.overflowY="auto",j.style.overflowY="auto"):(i.style.overflowY="hidden",j.style.overflowY="hidden",i.scrollTop=0),k!==f&&(g=k-f,s.setStyle(a.iframeElement,"height",k+"px"),f=k,tinymce.isWebKit&&g<0&&c(d))}}function d(b,e,f){tinymce.util.Delay.setEditorTimeout(a,function(){c({}),b--?d(b,e,f):f&&f()},e)}var e=a.settings,f=0;a.settings.inline||(e.autoresize_min_height=parseInt(a.getParam("autoresize_min_height",a.getElement().offsetHeight),10),e.autoresize_max_height=parseInt(a.getParam("autoresize_max_height",0),10),a.on("init",function(){var b,c;b=a.getParam("autoresize_overflow_padding",1),c=a.getParam("autoresize_bottom_margin",50),b!==!1&&a.dom.setStyles(a.getBody(),{paddingLeft:b,paddingRight:b}),c!==!1&&a.dom.setStyles(a.getBody(),{paddingBottom:c})}),a.on("nodechange setcontent keyup FullscreenStateChanged",c),a.getParam("autoresize_on_init",!0)&&a.on("init",function(){d(20,100,function(){d(5,1e3)})}),a.addCommand("mceAutoResize",c))});
|
@@ -1 +1 @@
|
|
1
|
-
tinymce._beforeUnloadHandler=function(){var a;return tinymce.each(tinymce.editors,function(b){b.plugins.autosave&&b.plugins.autosave.storeDraft(),!a&&b.isDirty()&&b.getParam("autosave_ask_before_unload",!0)&&(a=b.translate("You have unsaved changes are you sure you want to navigate away?"))}),a},tinymce.PluginManager.add("autosave",function(a){function b(a,b){var c={s:1e3,m:6e4};return a=/^(\d+)([ms]?)$/.exec(""+(a||b)),(a[2]?c[a[2]]:1)*parseInt(a,10)}function c(){var a=parseInt(n.getItem(k+"time"),10)||0;return(new Date).getTime()-a>m.autosave_retention
|
1
|
+
tinymce._beforeUnloadHandler=function(){var a;return tinymce.each(tinymce.editors,function(b){b.plugins.autosave&&b.plugins.autosave.storeDraft(),!a&&b.isDirty()&&b.getParam("autosave_ask_before_unload",!0)&&(a=b.translate("You have unsaved changes are you sure you want to navigate away?"))}),a},tinymce.PluginManager.add("autosave",function(a){function b(a,b){var c={s:1e3,m:6e4};return a=/^(\d+)([ms]?)$/.exec(""+(a||b)),(a[2]?c[a[2]]:1)*parseInt(a,10)}function c(){var a=parseInt(n.getItem(k+"time"),10)||0;return!((new Date).getTime()-a>m.autosave_retention)||(d(!1),!1)}function d(b){n.removeItem(k+"draft"),n.removeItem(k+"time"),b!==!1&&a.fire("RemoveDraft")}function e(){!j()&&a.isDirty()&&(n.setItem(k+"draft",a.getContent({format:"raw",no_events:!0})),n.setItem(k+"time",(new Date).getTime()),a.fire("StoreDraft"))}function f(){c()&&(a.setContent(n.getItem(k+"draft"),{format:"raw"}),a.fire("RestoreDraft"))}function g(){l||(setInterval(function(){a.removed||e()},m.autosave_interval),l=!0)}function h(){var b=this;b.disabled(!c()),a.on("StoreDraft RestoreDraft RemoveDraft",function(){b.disabled(!c())}),g()}function i(){a.undoManager.beforeChange(),f(),d(),a.undoManager.add()}function j(b){var c=a.settings.forced_root_block;return b=tinymce.trim("undefined"==typeof b?a.getBody().innerHTML:b),""===b||new RegExp("^<"+c+"[^>]*>((\xa0| |[ \t]|<br[^>]*>)+?|)</"+c+">|<br>$","i").test(b)}var k,l,m=a.settings,n=tinymce.util.LocalStorage;k=m.autosave_prefix||"tinymce-autosave-{path}{query}-{id}-",k=k.replace(/\{path\}/g,document.location.pathname),k=k.replace(/\{query\}/g,document.location.search),k=k.replace(/\{id\}/g,a.id),m.autosave_interval=b(m.autosave_interval,"30s"),m.autosave_retention=b(m.autosave_retention,"20m"),a.addButton("restoredraft",{title:"Restore last draft",onclick:i,onPostRender:h}),a.addMenuItem("restoredraft",{text:"Restore last draft",onclick:i,onPostRender:h,context:"file"}),a.settings.autosave_restore_when_empty!==!1&&(a.on("init",function(){c()&&j()&&f()}),a.on("saveContent",function(){d()})),window.onbeforeunload=tinymce._beforeUnloadHandler,this.hasDraft=c,this.storeDraft=e,this.restoreDraft=f,this.removeDraft=d,this.isEmpty=j});
|
@@ -1 +1 @@
|
|
1
|
-
tinymce.PluginManager.add("charmap",function(a){function b(){return[["160","no-break space"],["173","soft hyphen"],["34","quotation mark"],["162","cent sign"],["8364","euro sign"],["163","pound sign"],["165","yen sign"],["169","copyright sign"],["174","registered sign"],["8482","trade mark sign"],["8240","per mille sign"],["181","micro sign"],["183","middle dot"],["8226","bullet"],["8230","three dot leader"],["8242","minutes / feet"],["8243","seconds / inches"],["167","section sign"],["182","paragraph sign"],["223","sharp s / ess-zed"],["8249","single left-pointing angle quotation mark"],["8250","single right-pointing angle quotation mark"],["171","left pointing guillemet"],["187","right pointing guillemet"],["8216","left single quotation mark"],["8217","right single quotation mark"],["8220","left double quotation mark"],["8221","right double quotation mark"],["8218","single low-9 quotation mark"],["8222","double low-9 quotation mark"],["60","less-than sign"],["62","greater-than sign"],["8804","less-than or equal to"],["8805","greater-than or equal to"],["8211","en dash"],["8212","em dash"],["175","macron"],["8254","overline"],["164","currency sign"],["166","broken bar"],["168","diaeresis"],["161","inverted exclamation mark"],["191","turned question mark"],["710","circumflex accent"],["732","small tilde"],["176","degree sign"],["8722","minus sign"],["177","plus-minus sign"],["247","division sign"],["8260","fraction slash"],["215","multiplication sign"],["185","superscript one"],["178","superscript two"],["179","superscript three"],["188","fraction one quarter"],["189","fraction one half"],["190","fraction three quarters"],["402","function / florin"],["8747","integral"],["8721","n-ary sumation"],["8734","infinity"],["8730","square root"],["8764","similar to"],["8773","approximately equal to"],["8776","almost equal to"],["8800","not equal to"],["8801","identical to"],["8712","element of"],["8713","not an element of"],["8715","contains as member"],["8719","n-ary product"],["8743","logical and"],["8744","logical or"],["172","not sign"],["8745","intersection"],["8746","union"],["8706","partial differential"],["8704","for all"],["8707","there exists"],["8709","diameter"],["8711","backward difference"],["8727","asterisk operator"],["8733","proportional to"],["8736","angle"],["180","acute accent"],["184","cedilla"],["170","feminine ordinal indicator"],["186","masculine ordinal indicator"],["8224","dagger"],["8225","double dagger"],["192","A - grave"],["193","A - acute"],["194","A - circumflex"],["195","A - tilde"],["196","A - diaeresis"],["197","A - ring above"],["256","A - macron"],["198","ligature AE"],["199","C - cedilla"],["200","E - grave"],["201","E - acute"],["202","E - circumflex"],["203","E - diaeresis"],["274","E - macron"],["204","I - grave"],["205","I - acute"],["206","I - circumflex"],["207","I - diaeresis"],["298","I - macron"],["208","ETH"],["209","N - tilde"],["210","O - grave"],["211","O - acute"],["212","O - circumflex"],["213","O - tilde"],["214","O - diaeresis"],["216","O - slash"],["332","O - macron"],["338","ligature OE"],["352","S - caron"],["217","U - grave"],["218","U - acute"],["219","U - circumflex"],["220","U - diaeresis"],["362","U - macron"],["221","Y - acute"],["376","Y - diaeresis"],["562","Y - macron"],["222","THORN"],["224","a - grave"],["225","a - acute"],["226","a - circumflex"],["227","a - tilde"],["228","a - diaeresis"],["229","a - ring above"],["257","a - macron"],["230","ligature ae"],["231","c - cedilla"],["232","e - grave"],["233","e - acute"],["234","e - circumflex"],["235","e - diaeresis"],["275","e - macron"],["236","i - grave"],["237","i - acute"],["238","i - circumflex"],["239","i - diaeresis"],["299","i - macron"],["240","eth"],["241","n - tilde"],["242","o - grave"],["243","o - acute"],["244","o - circumflex"],["245","o - tilde"],["246","o - diaeresis"],["248","o slash"],["333","o macron"],["339","ligature oe"],["353","s - caron"],["249","u - grave"],["250","u - acute"],["251","u - circumflex"],["252","u - diaeresis"],["363","u - macron"],["253","y - acute"],["254","thorn"],["255","y - diaeresis"],["563","y - macron"],["913","Alpha"],["914","Beta"],["915","Gamma"],["916","Delta"],["917","Epsilon"],["918","Zeta"],["919","Eta"],["920","Theta"],["921","Iota"],["922","Kappa"],["923","Lambda"],["924","Mu"],["925","Nu"],["926","Xi"],["927","Omicron"],["928","Pi"],["929","Rho"],["931","Sigma"],["932","Tau"],["933","Upsilon"],["934","Phi"],["935","Chi"],["936","Psi"],["937","Omega"],["945","alpha"],["946","beta"],["947","gamma"],["948","delta"],["949","epsilon"],["950","zeta"],["951","eta"],["952","theta"],["953","iota"],["954","kappa"],["955","lambda"],["956","mu"],["957","nu"],["958","xi"],["959","omicron"],["960","pi"],["961","rho"],["962","final sigma"],["963","sigma"],["964","tau"],["965","upsilon"],["966","phi"],["967","chi"],["968","psi"],["969","omega"],["8501","alef symbol"],["982","pi symbol"],["8476","real part symbol"],["978","upsilon - hook symbol"],["8472","Weierstrass p"],["8465","imaginary part"],["8592","leftwards arrow"],["8593","upwards arrow"],["8594","rightwards arrow"],["8595","downwards arrow"],["8596","left right arrow"],["8629","carriage return"],["8656","leftwards double arrow"],["8657","upwards double arrow"],["8658","rightwards double arrow"],["8659","downwards double arrow"],["8660","left right double arrow"],["8756","therefore"],["8834","subset of"],["8835","superset of"],["8836","not a subset of"],["8838","subset of or equal to"],["8839","superset of or equal to"],["8853","circled plus"],["8855","circled times"],["8869","perpendicular"],["8901","dot operator"],["8968","left ceiling"],["8969","right ceiling"],["8970","left floor"],["8971","right floor"],["9001","left-pointing angle bracket"],["9002","right-pointing angle bracket"],["9674","lozenge"],["9824","black spade suit"],["9827","black club suit"],["9829","black heart suit"],["9830","black diamond suit"],["8194","en space"],["8195","em space"],["8201","thin space"],["8204","zero width non-joiner"],["8205","zero width joiner"],["8206","left-to-right mark"],["8207","right-to-left mark"]]}function c(a){return tinymce.util.Tools.grep(a,function(a){return i(a)&&2==a.length})}function d(a){return i(a)?[].concat(c(a)):"function"==typeof a?a():[]}function e(b){var c=a.settings;return c.charmap&&(b=d(c.charmap)),c.charmap_append?[].concat(b).concat(d(c.charmap_append)):b}function f(){return e(b())}function g(b){a.fire("insertCustomChar",{chr:b}).chr,a.execCommand("mceInsertContent",!1,b)}function h(){function b(a){for(;a;){if("TD"==a.nodeName)return a;a=a.parentNode}}var c,d,e,h;c='<table role="presentation" cellspacing="0" class="mce-charmap"><tbody>';var i=f(),j=Math.min(i.length,25),k=Math.ceil(i.length/j);for(e=0;k
|
1
|
+
tinymce.PluginManager.add("charmap",function(a){function b(){return[["160","no-break space"],["173","soft hyphen"],["34","quotation mark"],["162","cent sign"],["8364","euro sign"],["163","pound sign"],["165","yen sign"],["169","copyright sign"],["174","registered sign"],["8482","trade mark sign"],["8240","per mille sign"],["181","micro sign"],["183","middle dot"],["8226","bullet"],["8230","three dot leader"],["8242","minutes / feet"],["8243","seconds / inches"],["167","section sign"],["182","paragraph sign"],["223","sharp s / ess-zed"],["8249","single left-pointing angle quotation mark"],["8250","single right-pointing angle quotation mark"],["171","left pointing guillemet"],["187","right pointing guillemet"],["8216","left single quotation mark"],["8217","right single quotation mark"],["8220","left double quotation mark"],["8221","right double quotation mark"],["8218","single low-9 quotation mark"],["8222","double low-9 quotation mark"],["60","less-than sign"],["62","greater-than sign"],["8804","less-than or equal to"],["8805","greater-than or equal to"],["8211","en dash"],["8212","em dash"],["175","macron"],["8254","overline"],["164","currency sign"],["166","broken bar"],["168","diaeresis"],["161","inverted exclamation mark"],["191","turned question mark"],["710","circumflex accent"],["732","small tilde"],["176","degree sign"],["8722","minus sign"],["177","plus-minus sign"],["247","division sign"],["8260","fraction slash"],["215","multiplication sign"],["185","superscript one"],["178","superscript two"],["179","superscript three"],["188","fraction one quarter"],["189","fraction one half"],["190","fraction three quarters"],["402","function / florin"],["8747","integral"],["8721","n-ary sumation"],["8734","infinity"],["8730","square root"],["8764","similar to"],["8773","approximately equal to"],["8776","almost equal to"],["8800","not equal to"],["8801","identical to"],["8712","element of"],["8713","not an element of"],["8715","contains as member"],["8719","n-ary product"],["8743","logical and"],["8744","logical or"],["172","not sign"],["8745","intersection"],["8746","union"],["8706","partial differential"],["8704","for all"],["8707","there exists"],["8709","diameter"],["8711","backward difference"],["8727","asterisk operator"],["8733","proportional to"],["8736","angle"],["180","acute accent"],["184","cedilla"],["170","feminine ordinal indicator"],["186","masculine ordinal indicator"],["8224","dagger"],["8225","double dagger"],["192","A - grave"],["193","A - acute"],["194","A - circumflex"],["195","A - tilde"],["196","A - diaeresis"],["197","A - ring above"],["256","A - macron"],["198","ligature AE"],["199","C - cedilla"],["200","E - grave"],["201","E - acute"],["202","E - circumflex"],["203","E - diaeresis"],["274","E - macron"],["204","I - grave"],["205","I - acute"],["206","I - circumflex"],["207","I - diaeresis"],["298","I - macron"],["208","ETH"],["209","N - tilde"],["210","O - grave"],["211","O - acute"],["212","O - circumflex"],["213","O - tilde"],["214","O - diaeresis"],["216","O - slash"],["332","O - macron"],["338","ligature OE"],["352","S - caron"],["217","U - grave"],["218","U - acute"],["219","U - circumflex"],["220","U - diaeresis"],["362","U - macron"],["221","Y - acute"],["376","Y - diaeresis"],["562","Y - macron"],["222","THORN"],["224","a - grave"],["225","a - acute"],["226","a - circumflex"],["227","a - tilde"],["228","a - diaeresis"],["229","a - ring above"],["257","a - macron"],["230","ligature ae"],["231","c - cedilla"],["232","e - grave"],["233","e - acute"],["234","e - circumflex"],["235","e - diaeresis"],["275","e - macron"],["236","i - grave"],["237","i - acute"],["238","i - circumflex"],["239","i - diaeresis"],["299","i - macron"],["240","eth"],["241","n - tilde"],["242","o - grave"],["243","o - acute"],["244","o - circumflex"],["245","o - tilde"],["246","o - diaeresis"],["248","o slash"],["333","o macron"],["339","ligature oe"],["353","s - caron"],["249","u - grave"],["250","u - acute"],["251","u - circumflex"],["252","u - diaeresis"],["363","u - macron"],["253","y - acute"],["254","thorn"],["255","y - diaeresis"],["563","y - macron"],["913","Alpha"],["914","Beta"],["915","Gamma"],["916","Delta"],["917","Epsilon"],["918","Zeta"],["919","Eta"],["920","Theta"],["921","Iota"],["922","Kappa"],["923","Lambda"],["924","Mu"],["925","Nu"],["926","Xi"],["927","Omicron"],["928","Pi"],["929","Rho"],["931","Sigma"],["932","Tau"],["933","Upsilon"],["934","Phi"],["935","Chi"],["936","Psi"],["937","Omega"],["945","alpha"],["946","beta"],["947","gamma"],["948","delta"],["949","epsilon"],["950","zeta"],["951","eta"],["952","theta"],["953","iota"],["954","kappa"],["955","lambda"],["956","mu"],["957","nu"],["958","xi"],["959","omicron"],["960","pi"],["961","rho"],["962","final sigma"],["963","sigma"],["964","tau"],["965","upsilon"],["966","phi"],["967","chi"],["968","psi"],["969","omega"],["8501","alef symbol"],["982","pi symbol"],["8476","real part symbol"],["978","upsilon - hook symbol"],["8472","Weierstrass p"],["8465","imaginary part"],["8592","leftwards arrow"],["8593","upwards arrow"],["8594","rightwards arrow"],["8595","downwards arrow"],["8596","left right arrow"],["8629","carriage return"],["8656","leftwards double arrow"],["8657","upwards double arrow"],["8658","rightwards double arrow"],["8659","downwards double arrow"],["8660","left right double arrow"],["8756","therefore"],["8834","subset of"],["8835","superset of"],["8836","not a subset of"],["8838","subset of or equal to"],["8839","superset of or equal to"],["8853","circled plus"],["8855","circled times"],["8869","perpendicular"],["8901","dot operator"],["8968","left ceiling"],["8969","right ceiling"],["8970","left floor"],["8971","right floor"],["9001","left-pointing angle bracket"],["9002","right-pointing angle bracket"],["9674","lozenge"],["9824","black spade suit"],["9827","black club suit"],["9829","black heart suit"],["9830","black diamond suit"],["8194","en space"],["8195","em space"],["8201","thin space"],["8204","zero width non-joiner"],["8205","zero width joiner"],["8206","left-to-right mark"],["8207","right-to-left mark"]]}function c(a){return tinymce.util.Tools.grep(a,function(a){return i(a)&&2==a.length})}function d(a){return i(a)?[].concat(c(a)):"function"==typeof a?a():[]}function e(b){var c=a.settings;return c.charmap&&(b=d(c.charmap)),c.charmap_append?[].concat(b).concat(d(c.charmap_append)):b}function f(){return e(b())}function g(b){a.fire("insertCustomChar",{chr:b}).chr,a.execCommand("mceInsertContent",!1,b)}function h(){function b(a){for(;a;){if("TD"==a.nodeName)return a;a=a.parentNode}}var c,d,e,h;c='<table role="presentation" cellspacing="0" class="mce-charmap"><tbody>';var i=f(),j=Math.min(i.length,25),k=Math.ceil(i.length/j);for(e=0;e<k;e++){for(c+="<tr>",d=0;d<j;d++){var l=e*j+d;if(l<i.length){var m=i[l],n=m?String.fromCharCode(parseInt(m[0],10)):" ";c+='<td title="'+m[1]+'"><div tabindex="-1" title="'+m[1]+'" role="button" data-chr="'+n+'">'+n+"</div></td>"}else c+="<td />"}c+="</tr>"}c+="</tbody></table>";var o={type:"container",html:c,onclick:function(a){var c=a.target;/^(TD|DIV)$/.test(c.nodeName)&&b(c).firstChild&&(g(c.getAttribute("data-chr")),a.ctrlKey||h.close())},onmouseover:function(a){var c=b(a.target);c&&c.firstChild?(h.find("#preview").text(c.firstChild.firstChild.data),h.find("#previewTitle").text(c.title)):(h.find("#preview").text(" "),h.find("#previewTitle").text(" "))}};h=a.windowManager.open({title:"Special character",spacing:10,padding:10,items:[o,{type:"container",layout:"flex",direction:"column",align:"center",spacing:5,minWidth:160,minHeight:160,items:[{type:"label",name:"preview",text:" ",style:"font-size: 40px; text-align: center",border:1,minWidth:140,minHeight:80},{type:"label",name:"previewTitle",text:" ",style:"text-align: center",border:1,minWidth:140,minHeight:80}]}],buttons:[{text:"Close",onclick:function(){h.close()}}]})}var i=tinymce.util.Tools.isArray;return a.addCommand("mceShowCharmap",h),a.addButton("charmap",{icon:"charmap",tooltip:"Special character",cmd:"mceShowCharmap"}),a.addMenuItem("charmap",{icon:"charmap",text:"Special character",cmd:"mceShowCharmap",context:"insert"}),{getCharMap:f,insertChar:g}});
|
@@ -0,0 +1,141 @@
|
|
1
|
+
/**
|
2
|
+
* Inline development version. Only to be used while developing since it uses document.write to load scripts.
|
3
|
+
*/
|
4
|
+
|
5
|
+
/*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */
|
6
|
+
/*globals $code */
|
7
|
+
|
8
|
+
(function(exports) {
|
9
|
+
"use strict";
|
10
|
+
|
11
|
+
var html = "", baseDir;
|
12
|
+
var modules = {}, exposedModules = [], moduleCount = 0;
|
13
|
+
|
14
|
+
var scripts = document.getElementsByTagName('script');
|
15
|
+
for (var i = 0; i < scripts.length; i++) {
|
16
|
+
var src = scripts[i].src;
|
17
|
+
|
18
|
+
if (src.indexOf('/plugin.dev.js') != -1) {
|
19
|
+
baseDir = src.substring(0, src.lastIndexOf('/'));
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
function require(ids, callback) {
|
24
|
+
var module, defs = [];
|
25
|
+
|
26
|
+
for (var i = 0; i < ids.length; ++i) {
|
27
|
+
module = modules[ids[i]] || resolve(ids[i]);
|
28
|
+
if (!module) {
|
29
|
+
throw 'module definition dependecy not found: ' + ids[i];
|
30
|
+
}
|
31
|
+
|
32
|
+
defs.push(module);
|
33
|
+
}
|
34
|
+
|
35
|
+
callback.apply(null, defs);
|
36
|
+
}
|
37
|
+
|
38
|
+
function resolve(id) {
|
39
|
+
if (exports.privateModules && id in exports.privateModules) {
|
40
|
+
return;
|
41
|
+
}
|
42
|
+
|
43
|
+
var target = exports;
|
44
|
+
var fragments = id.split(/[.\/]/);
|
45
|
+
|
46
|
+
for (var fi = 0; fi < fragments.length; ++fi) {
|
47
|
+
if (!target[fragments[fi]]) {
|
48
|
+
return;
|
49
|
+
}
|
50
|
+
|
51
|
+
target = target[fragments[fi]];
|
52
|
+
}
|
53
|
+
|
54
|
+
return target;
|
55
|
+
}
|
56
|
+
|
57
|
+
function register(id) {
|
58
|
+
var target = exports;
|
59
|
+
var fragments = id.split(/[.\/]/);
|
60
|
+
|
61
|
+
for (var fi = 0; fi < fragments.length - 1; ++fi) {
|
62
|
+
if (target[fragments[fi]] === undefined) {
|
63
|
+
target[fragments[fi]] = {};
|
64
|
+
}
|
65
|
+
|
66
|
+
target = target[fragments[fi]];
|
67
|
+
}
|
68
|
+
|
69
|
+
target[fragments[fragments.length - 1]] = modules[id];
|
70
|
+
}
|
71
|
+
|
72
|
+
function define(id, dependencies, definition) {
|
73
|
+
var privateModules, i;
|
74
|
+
|
75
|
+
if (typeof id !== 'string') {
|
76
|
+
throw 'invalid module definition, module id must be defined and be a string';
|
77
|
+
}
|
78
|
+
|
79
|
+
if (dependencies === undefined) {
|
80
|
+
throw 'invalid module definition, dependencies must be specified';
|
81
|
+
}
|
82
|
+
|
83
|
+
if (definition === undefined) {
|
84
|
+
throw 'invalid module definition, definition function must be specified';
|
85
|
+
}
|
86
|
+
|
87
|
+
require(dependencies, function() {
|
88
|
+
modules[id] = definition.apply(null, arguments);
|
89
|
+
});
|
90
|
+
|
91
|
+
if (--moduleCount === 0) {
|
92
|
+
for (i = 0; i < exposedModules.length; i++) {
|
93
|
+
register(exposedModules[i]);
|
94
|
+
}
|
95
|
+
}
|
96
|
+
|
97
|
+
// Expose private modules for unit tests
|
98
|
+
if (exports.AMDLC_TESTS) {
|
99
|
+
privateModules = exports.privateModules || {};
|
100
|
+
|
101
|
+
for (id in modules) {
|
102
|
+
privateModules[id] = modules[id];
|
103
|
+
}
|
104
|
+
|
105
|
+
for (i = 0; i < exposedModules.length; i++) {
|
106
|
+
delete privateModules[exposedModules[i]];
|
107
|
+
}
|
108
|
+
|
109
|
+
exports.privateModules = privateModules;
|
110
|
+
}
|
111
|
+
|
112
|
+
}
|
113
|
+
|
114
|
+
function expose(ids) {
|
115
|
+
exposedModules = ids;
|
116
|
+
}
|
117
|
+
|
118
|
+
function writeScripts() {
|
119
|
+
document.write(html);
|
120
|
+
}
|
121
|
+
|
122
|
+
function load(path) {
|
123
|
+
html += '<script type="text/javascript" src="' + baseDir + '/' + path + '"></script>\n';
|
124
|
+
moduleCount++;
|
125
|
+
}
|
126
|
+
|
127
|
+
// Expose globally
|
128
|
+
exports.define = define;
|
129
|
+
exports.require = require;
|
130
|
+
|
131
|
+
expose(["tinymce/codesampleplugin/Prism","tinymce/codesampleplugin/Utils","tinymce/codesampleplugin/Dialog","tinymce/codesampleplugin/Plugin"]);
|
132
|
+
|
133
|
+
load('classes/Prism.js');
|
134
|
+
load('classes/Utils.js');
|
135
|
+
load('classes/Dialog.js');
|
136
|
+
load('classes/Plugin.js');
|
137
|
+
|
138
|
+
writeScripts();
|
139
|
+
})(this);
|
140
|
+
|
141
|
+
// $hash: 1bc9e2cf126c72c5c46d6fb4921fad5d
|
@@ -1 +1 @@
|
|
1
|
-
!function(a,b){"use strict";function c(a,b){for(var c,d=[],f=0;f<a.length;++f){if(c=g[a[f]]||e(a[f]),!c)throw"module definition dependecy not found: "+a[f];d.push(c)}b.apply(null,d)}function d(a,d,e){if("string"!=typeof a)throw"invalid module definition, module id must be defined and be a string";if(d===b)throw"invalid module definition, dependencies must be specified";if(e===b)throw"invalid module definition, definition function must be specified";c(d,function(){g[a]=e.apply(null,arguments)})}function e(b){for(var c=a,d=b.split(/[.\/]/),e=0;e<d.length;++e){if(!c[d[e]])return;c=c[d[e]]}return c}function f(c){var d,e,f,h,i;for(d=0;d<c.length;d++){e=a,f=c[d],h=f.split(/[.\/]/);for(var j=0;j<h.length-1;++j)e[h[j]]===b&&(e[h[j]]={}),e=e[h[j]];e[h[h.length-1]]=g[f]}if(a.AMDLC_TESTS){i=a.privateModules||{};for(f in g)i[f]=g[f];for(d=0;d<c.length;d++)delete i[c[d]];a.privateModules=i}}var g={};d("tinymce/codesampleplugin/Prism",[],function(){var a={},b="undefined"!=typeof a?a:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},c=function(){var a=/\blang(?:uage)?-(?!\*)(\w+)\b/i,c=b.Prism={util:{encode:function(a){return a instanceof d?new d(a.type,c.util.encode(a.content),a.alias):"Array"===c.util.type(a)?a.map(c.util.encode):a.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(a){return Object.prototype.toString.call(a).match(/\[object (\w+)\]/)[1]},clone:function(a){var b=c.util.type(a);switch(b){case"Object":var d={};for(var e in a)a.hasOwnProperty(e)&&(d[e]=c.util.clone(a[e]));return d;case"Array":return a.map&&a.map(function(a){return c.util.clone(a)})}return a}},languages:{extend:function(a,b){var d=c.util.clone(c.languages[a]);for(var e in b)d[e]=b[e];return d},insertBefore:function(a,b,d,e){e=e||c.languages;var f=e[a];if(2==arguments.length){d=arguments[1];for(var g in d)d.hasOwnProperty(g)&&(f[g]=d[g]);return f}var h={};for(var i in f)if(f.hasOwnProperty(i)){if(i==b)for(var g in d)d.hasOwnProperty(g)&&(h[g]=d[g]);h[i]=f[i]}return c.languages.DFS(c.languages,function(b,c){c===e[a]&&b!=a&&(this[b]=h)}),e[a]=h},DFS:function(a,b,d){for(var e in a)a.hasOwnProperty(e)&&(b.call(a,e,a[e],d||e),"Object"===c.util.type(a[e])?c.languages.DFS(a[e],b):"Array"===c.util.type(a[e])&&c.languages.DFS(a[e],b,e))}},plugins:{},highlightAll:function(a,b){for(var d,e=document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'),f=0;d=e[f++];)c.highlightElement(d,a===!0,b)},highlightElement:function(d,e,f){for(var g,h,i=d;i&&!a.test(i.className);)i=i.parentNode;i&&(g=(i.className.match(a)||[,""])[1],h=c.languages[g]),d.className=d.className.replace(a,"").replace(/\s+/g," ")+" language-"+g,i=d.parentNode,/pre/i.test(i.nodeName)&&(i.className=i.className.replace(a,"").replace(/\s+/g," ")+" language-"+g);var j=d.textContent,k={element:d,language:g,grammar:h,code:j};if(!j||!h)return void c.hooks.run("complete",k);if(c.hooks.run("before-highlight",k),e&&b.Worker){var l=new Worker(c.filename);l.onmessage=function(a){k.highlightedCode=a.data,c.hooks.run("before-insert",k),k.element.innerHTML=k.highlightedCode,f&&f.call(k.element),c.hooks.run("after-highlight",k),c.hooks.run("complete",k)},l.postMessage(JSON.stringify({language:k.language,code:k.code,immediateClose:!0}))}else k.highlightedCode=c.highlight(k.code,k.grammar,k.language),c.hooks.run("before-insert",k),k.element.innerHTML=k.highlightedCode,f&&f.call(d),c.hooks.run("after-highlight",k),c.hooks.run("complete",k)},highlight:function(a,b,e){var f=c.tokenize(a,b);return d.stringify(c.util.encode(f),e)},tokenize:function(a,b,d){var e=c.Token,f=[a],g=b.rest;if(g){for(var h in g)b[h]=g[h];delete b.rest}a:for(var h in b)if(b.hasOwnProperty(h)&&b[h]){var i=b[h];i="Array"===c.util.type(i)?i:[i];for(var j=0;j<i.length;++j){var k=i[j],l=k.inside,m=!!k.lookbehind,n=0,o=k.alias;k=k.pattern||k;for(var p=0;p<f.length;p++){var q=f[p];if(f.length>a.length)break a;if(!(q instanceof e)){k.lastIndex=0;var r=k.exec(q);if(r){m&&(n=r[1].length);var s=r.index-1+n,r=r[0].slice(n),t=r.length,u=s+t,v=q.slice(0,s+1),w=q.slice(u+1),x=[p,1];v&&x.push(v);var y=new e(h,l?c.tokenize(r,l):r,o);x.push(y),w&&x.push(w),Array.prototype.splice.apply(f,x)}}}}}return f},hooks:{all:{},add:function(a,b){var d=c.hooks.all;d[a]=d[a]||[],d[a].push(b)},run:function(a,b){var d=c.hooks.all[a];if(d&&d.length)for(var e,f=0;e=d[f++];)e(b)}}},d=c.Token=function(a,b,c){this.type=a,this.content=b,this.alias=c};return d.stringify=function(a,b,e){if("string"==typeof a)return a;if("Array"===c.util.type(a))return a.map(function(c){return d.stringify(c,b,a)}).join("");var f={type:a.type,content:d.stringify(a.content,b,e),tag:"span",classes:["token",a.type],attributes:{},language:b,parent:e};if("comment"==f.type&&(f.attributes.spellcheck="true"),a.alias){var g="Array"===c.util.type(a.alias)?a.alias:[a.alias];Array.prototype.push.apply(f.classes,g)}c.hooks.run("wrap",f);var h="";for(var i in f.attributes)h+=(h?" ":"")+i+'="'+(f.attributes[i]||"")+'"';return"<"+f.tag+' class="'+f.classes.join(" ")+'" '+h+">"+f.content+"</"+f.tag+">"},b.document?void 0:b.addEventListener?(b.addEventListener("message",function(a){var d=JSON.parse(a.data),e=d.language,f=d.code,g=d.immediateClose;b.postMessage(c.highlight(f,c.languages[e],e)),g&&b.close()},!1),b.Prism):b.Prism}();return"undefined"!=typeof module&&module.exports&&(module.exports=c),"undefined"!=typeof global&&(global.Prism=c),c.languages.markup={comment:/<!--[\w\W]*?-->/,prolog:/<\?[\w\W]+?\?>/,doctype:/<!DOCTYPE[\w\W]+?>/,cdata:/<!\[CDATA\[[\w\W]*?]]>/i,tag:{pattern:/<\/?[^\s>\/=.]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/[=>"']/}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},c.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))}),c.languages.xml=c.languages.markup,c.languages.html=c.languages.markup,c.languages.mathml=c.languages.markup,c.languages.svg=c.languages.markup,c.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},c.languages.css.atrule.inside.rest=c.util.clone(c.languages.css),c.languages.markup&&(c.languages.insertBefore("markup","tag",{style:{pattern:/<style[\w\W]*?>[\w\W]*?<\/style>/i,inside:{tag:{pattern:/<style[\w\W]*?>|<\/style>/i,inside:c.languages.markup.tag.inside},rest:c.languages.css},alias:"language-css"}}),c.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|').*?\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:c.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:c.languages.css}},alias:"language-css"}},c.languages.markup.tag)),c.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:/(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,"boolean":/\b(true|false)\b/,"function":/[a-z0-9_]+(?=\()/i,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/},c.languages.javascript=c.languages.extend("clike",{keyword:/\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/,number:/\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/,"function":/[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i}),c.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^\/])\/(?!\/)(\[.+?]|\\.|[^\/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0}}),c.languages.insertBefore("javascript","class-name",{"template-string":{pattern:/`(?:\\`|\\?[^`])*`/,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:c.languages.javascript}},string:/[\s\S]+/}}}),c.languages.markup&&c.languages.insertBefore("markup","tag",{script:{pattern:/<script[\w\W]*?>[\w\W]*?<\/script>/i,inside:{tag:{pattern:/<script[\w\W]*?>|<\/script>/i,inside:c.languages.markup.tag.inside},rest:c.languages.javascript},alias:"language-javascript"}}),c.languages.js=c.languages.javascript,c.languages.c=c.languages.extend("clike",{keyword:/\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,operator:/\-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*\/]/,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)[ful]*\b/i}),c.languages.insertBefore("c","string",{macro:{pattern:/(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im,lookbehind:!0,alias:"property",inside:{string:{pattern:/(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3)/,lookbehind:!0}}}}),delete c.languages.c["class-name"],delete c.languages.c["boolean"],c.languages.csharp=c.languages.extend("clike",{keyword:/\b(abstract|as|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|async|await|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b/,string:[/@("|')(\1\1|\\\1|\\?(?!\1)[\s\S])*\1/,/("|')(\\?.)*?\1/],number:/\b-?(0x[\da-f]+|\d*\.?\d+)\b/i}),c.languages.insertBefore("csharp","keyword",{preprocessor:{pattern:/(^\s*)#.*/m,lookbehind:!0}}),c.languages.cpp=c.languages.extend("c",{keyword:/\b(alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,"boolean":/\b(true|false)\b/,operator:/[-+]{1,2}|!=?|<{1,2}=?|>{1,2}=?|\->|:{1,2}|={1,2}|\^|~|%|&{1,2}|\|?\||\?|\*|\/|\b(and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/}),c.languages.insertBefore("cpp","keyword",{"class-name":{pattern:/(class\s+)[a-z0-9_]+/i,lookbehind:!0}}),c.languages.java=c.languages.extend("clike",{keyword:/\b(abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while)\b/,number:/\b0b[01]+\b|\b0x[\da-f]*\.?[\da-fp\-]+\b|\b\d*\.?\d+(?:e[+-]?\d+)?[df]?\b/i,operator:{pattern:/(^|[^.])(?:\+[+=]?|-[-=]?|!=?|<<?=?|>>?>?=?|==?|&[&=]?|\|[|=]?|\*=?|\/=?|%=?|\^=?|[?:~])/m,lookbehind:!0}}),c.languages.php=c.languages.extend("clike",{keyword:/\b(and|or|xor|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|for|foreach|function|include|include_once|global|if|new|return|static|switch|use|require|require_once|var|while|abstract|interface|public|implements|private|protected|parent|throw|null|echo|print|trait|namespace|final|yield|goto|instanceof|finally|try|catch)\b/i,constant:/\b[A-Z0-9_]{2,}\b/,comment:{pattern:/(^|[^\\])(?:\/\*[\w\W]*?\*\/|\/\/.*)/,lookbehind:!0}}),c.languages.insertBefore("php","class-name",{"shell-comment":{pattern:/(^|[^\\])#.*/,lookbehind:!0,alias:"comment"}}),c.languages.insertBefore("php","keyword",{delimiter:/\?>|<\?(?:php)?/i,variable:/\$\w+\b/i,"package":{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/,lookbehind:!0,inside:{punctuation:/\\/}}}),c.languages.insertBefore("php","operator",{property:{pattern:/(->)[\w]+/,lookbehind:!0}}),c.languages.markup&&(c.hooks.add("before-highlight",function(a){"php"===a.language&&(a.tokenStack=[],a.backupCode=a.code,a.code=a.code.replace(/(?:<\?php|<\?)[\w\W]*?(?:\?>)/gi,function(b){return a.tokenStack.push(b),"{{{PHP"+a.tokenStack.length+"}}}"}))}),c.hooks.add("before-insert",function(a){"php"===a.language&&(a.code=a.backupCode,delete a.backupCode)}),c.hooks.add("after-highlight",function(a){if("php"===a.language){for(var b,d=0;b=a.tokenStack[d];d++)a.highlightedCode=a.highlightedCode.replace("{{{PHP"+(d+1)+"}}}",c.highlight(b,a.grammar,"php").replace(/\$/g,"$$$$"));a.element.innerHTML=a.highlightedCode}}),c.hooks.add("wrap",function(a){"php"===a.language&&"markup"===a.type&&(a.content=a.content.replace(/(\{\{\{PHP[0-9]+\}\}\})/g,'<span class="token php">$1</span>'))}),c.languages.insertBefore("php","comment",{markup:{pattern:/<[^?]\/?(.*?)>/,inside:c.languages.markup},php:/\{\{\{PHP[0-9]+\}\}\}/})),c.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},string:/"""[\s\S]+?"""|'''[\s\S]+?'''|("|')(?:\\?.)*?\1/,"function":{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_][a-zA-Z0-9_]*(?=\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)[a-z0-9_]+/i,lookbehind:!0},keyword:/\b(?:as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|with|yield)\b/,"boolean":/\b(?:True|False)\b/,number:/\b-?(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not)\b/,punctuation:/[{}[\];(),.:]/},function(a){a.languages.ruby=a.languages.extend("clike",{comment:/#(?!\{[^\r\n]*?\}).*/,keyword:/\b(alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|raise|redo|require|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/});var b={pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"tag"},rest:a.util.clone(a.languages.ruby)}};a.languages.insertBefore("ruby","keyword",{regex:[{pattern:/%r([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1[gim]{0,3}/,inside:{interpolation:b}},{pattern:/%r\((?:[^()\\]|\\[\s\S])*\)[gim]{0,3}/,inside:{interpolation:b}},{pattern:/%r\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}[gim]{0,3}/,inside:{interpolation:b}},{pattern:/%r\[(?:[^\[\]\\]|\\[\s\S])*\][gim]{0,3}/,inside:{interpolation:b}},{pattern:/%r<(?:[^<>\\]|\\[\s\S])*>[gim]{0,3}/,inside:{interpolation:b}},{pattern:/(^|[^\/])\/(?!\/)(\[.+?]|\\.|[^\/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0}],variable:/[@$]+[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/,symbol:/:[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/}),a.languages.insertBefore("ruby","number",{builtin:/\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|Fload|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,constant:/\b[A-Z][a-zA-Z_0-9]*(?:[?!]|\b)/}),a.languages.ruby.string=[{pattern:/%[qQiIwWxs]?([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1/,inside:{interpolation:b}},{pattern:/%[qQiIwWxs]?\((?:[^()\\]|\\[\s\S])*\)/,inside:{interpolation:b}},{pattern:/%[qQiIwWxs]?\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/,inside:{interpolation:b}},{pattern:/%[qQiIwWxs]?\[(?:[^\[\]\\]|\\[\s\S])*\]/,inside:{interpolation:b}},{pattern:/%[qQiIwWxs]?<(?:[^<>\\]|\\[\s\S])*>/,inside:{interpolation:b}},{pattern:/("|')(#\{[^}]+\}|\\(?:\r?\n|\r)|\\?.)*?\1/,inside:{interpolation:b}}]}(c),c}),d("tinymce/codesampleplugin/Utils",[],function(){function a(a){return a&&"PRE"==a.nodeName&&-1!==a.className.indexOf("language-")}function b(a){return function(b,c){return a(c)}}return{isCodeSample:a,trimArg:b}}),d("tinymce/codesampleplugin/Dialog",["tinymce/dom/DOMUtils","tinymce/codesampleplugin/Utils","tinymce/codesampleplugin/Prism"],function(a,b,c){function d(a){var b=[{text:"HTML/XML",value:"markup"},{text:"JavaScript",value:"javascript"},{text:"CSS",value:"css"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"}],c=a.settings.codesample_languages;return c?c:b}function e(a,b,d){a.undoManager.transact(function(){var e=f(a);d=i.encode(d),e?(a.dom.setAttrib(e,"class","language-"+b),e.innerHTML=d,c.highlightElement(e),a.selection.select(e)):(a.insertContent('<pre id="__new" class="language-'+b+'">'+d+"</pre>"),a.selection.select(a.$("#__new").removeAttr("id")[0]))})}function f(a){var c=a.selection.getNode();return b.isCodeSample(c)?c:null}function g(a){var b=f(a);return b?b.textContent:""}function h(a){var b,c=f(a);return c?(b=c.className.match(/language-(\w+)/),b?b[1]:""):""}var i=a.DOM;return{open:function(a){a.windowManager.open({title:"Insert/Edit code sample",minWidth:Math.min(i.getViewPort().w,a.getParam("codesample_dialog_width",800)),minHeight:Math.min(i.getViewPort().h,a.getParam("codesample_dialog_height",650)),layout:"flex",direction:"column",align:"stretch",body:[{type:"listbox",name:"language",label:"Language",maxWidth:200,value:h(a),values:d(a)},{type:"textbox",name:"code",multiline:!0,spellcheck:!1,ariaLabel:"Code view",flex:1,style:"direction: ltr; text-align: left",classes:"monospace",value:g(a),autofocus:!0}],onSubmit:function(b){e(a,b.data.language,b.data.code)}})}}}),d("tinymce/codesampleplugin/Plugin",["tinymce/Env","tinymce/PluginManager","tinymce/codesampleplugin/Prism","tinymce/codesampleplugin/Dialog","tinymce/codesampleplugin/Utils"],function(a,b,c,d,e){var f,g=e.trimArg;b.add("codesample",function(b,h){function i(){var a;b.inline&&f||!b.inline&&j||(b.inline?f=!0:j=!0,a=b.dom.create("link",{rel:"stylesheet",href:h+"/css/prism.css"}),b.getDoc().getElementsByTagName("head")[0].appendChild(a))}var j,k=b.$;a.ceFalse&&(b.on("PreProcess",function(a){k("pre[contenteditable=false]",a.node).filter(g(e.isCodeSample)).each(function(a,b){var c=k(b),d=b.textContent;c.attr("class",k.trim(c.attr("class"))),c.removeAttr("contentEditable"),c.empty().append(k("<code></code>").each(function(){this.textContent=d}))})}),b.on("SetContent",function(){var a=k("pre").filter(g(e.isCodeSample)).filter(function(a,b){return"false"!==b.contentEditable});a.length&&b.undoManager.transact(function(){a.each(function(a,d){k(d).find("br").each(function(a,c){c.parentNode.replaceChild(b.getDoc().createTextNode("\n"),c)}),d.contentEditable=!1,d.innerHTML=b.dom.encode(d.textContent),c.highlightElement(d),d.className=k.trim(d.className)})})}),b.addCommand("codesample",function(){d.open(b)}),b.addButton("codesample",{cmd:"codesample",title:"Insert/Edit code sample"}),b.on("init",i))})}),f(["tinymce/codesampleplugin/Prism","tinymce/codesampleplugin/Utils","tinymce/codesampleplugin/Dialog","tinymce/codesampleplugin/Plugin"])}(this);
|
1
|
+
!function(a,b){"use strict";function c(a,b){for(var c,d=[],f=0;f<a.length;++f){if(c=g[a[f]]||e(a[f]),!c)throw"module definition dependecy not found: "+a[f];d.push(c)}b.apply(null,d)}function d(a,d,e){if("string"!=typeof a)throw"invalid module definition, module id must be defined and be a string";if(d===b)throw"invalid module definition, dependencies must be specified";if(e===b)throw"invalid module definition, definition function must be specified";c(d,function(){g[a]=e.apply(null,arguments)})}function e(b){for(var c=a,d=b.split(/[.\/]/),e=0;e<d.length;++e){if(!c[d[e]])return;c=c[d[e]]}return c}function f(c){var d,e,f,h,i;for(d=0;d<c.length;d++){e=a,f=c[d],h=f.split(/[.\/]/);for(var j=0;j<h.length-1;++j)e[h[j]]===b&&(e[h[j]]={}),e=e[h[j]];e[h[h.length-1]]=g[f]}if(a.AMDLC_TESTS){i=a.privateModules||{};for(f in g)i[f]=g[f];for(d=0;d<c.length;d++)delete i[c[d]];a.privateModules=i}}var g={};d("tinymce/codesampleplugin/Prism",[],function(){var a={},b="undefined"!=typeof a?a:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},c=function(){var a=/\blang(?:uage)?-(?!\*)(\w+)\b/i,c=b.Prism={util:{encode:function(a){return a instanceof d?new d(a.type,c.util.encode(a.content),a.alias):"Array"===c.util.type(a)?a.map(c.util.encode):a.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(a){return Object.prototype.toString.call(a).match(/\[object (\w+)\]/)[1]},clone:function(a){var b=c.util.type(a);switch(b){case"Object":var d={};for(var e in a)a.hasOwnProperty(e)&&(d[e]=c.util.clone(a[e]));return d;case"Array":return a.map&&a.map(function(a){return c.util.clone(a)})}return a}},languages:{extend:function(a,b){var d=c.util.clone(c.languages[a]);for(var e in b)d[e]=b[e];return d},insertBefore:function(a,b,d,e){e=e||c.languages;var f=e[a];if(2==arguments.length){d=arguments[1];for(var g in d)d.hasOwnProperty(g)&&(f[g]=d[g]);return f}var h={};for(var i in f)if(f.hasOwnProperty(i)){if(i==b)for(var g in d)d.hasOwnProperty(g)&&(h[g]=d[g]);h[i]=f[i]}return c.languages.DFS(c.languages,function(b,c){c===e[a]&&b!=a&&(this[b]=h)}),e[a]=h},DFS:function(a,b,d){for(var e in a)a.hasOwnProperty(e)&&(b.call(a,e,a[e],d||e),"Object"===c.util.type(a[e])?c.languages.DFS(a[e],b):"Array"===c.util.type(a[e])&&c.languages.DFS(a[e],b,e))}},plugins:{},highlightAll:function(a,b){for(var d,e=document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'),f=0;d=e[f++];)c.highlightElement(d,a===!0,b)},highlightElement:function(d,e,f){for(var g,h,i=d;i&&!a.test(i.className);)i=i.parentNode;i&&(g=(i.className.match(a)||[,""])[1],h=c.languages[g]),d.className=d.className.replace(a,"").replace(/\s+/g," ")+" language-"+g,i=d.parentNode,/pre/i.test(i.nodeName)&&(i.className=i.className.replace(a,"").replace(/\s+/g," ")+" language-"+g);var j=d.textContent,k={element:d,language:g,grammar:h,code:j};if(!j||!h)return void c.hooks.run("complete",k);if(c.hooks.run("before-highlight",k),e&&b.Worker){var l=new Worker(c.filename);l.onmessage=function(a){k.highlightedCode=a.data,c.hooks.run("before-insert",k),k.element.innerHTML=k.highlightedCode,f&&f.call(k.element),c.hooks.run("after-highlight",k),c.hooks.run("complete",k)},l.postMessage(JSON.stringify({language:k.language,code:k.code,immediateClose:!0}))}else k.highlightedCode=c.highlight(k.code,k.grammar,k.language),c.hooks.run("before-insert",k),k.element.innerHTML=k.highlightedCode,f&&f.call(d),c.hooks.run("after-highlight",k),c.hooks.run("complete",k)},highlight:function(a,b,e){var f=c.tokenize(a,b);return d.stringify(c.util.encode(f),e)},tokenize:function(a,b,d){var e=c.Token,f=[a],g=b.rest;if(g){for(var h in g)b[h]=g[h];delete b.rest}a:for(var h in b)if(b.hasOwnProperty(h)&&b[h]){var i=b[h];i="Array"===c.util.type(i)?i:[i];for(var j=0;j<i.length;++j){var k=i[j],l=k.inside,m=!!k.lookbehind,n=0,o=k.alias;k=k.pattern||k;for(var p=0;p<f.length;p++){var q=f[p];if(f.length>a.length)break a;if(!(q instanceof e)){k.lastIndex=0;var r=k.exec(q);if(r){m&&(n=r[1].length);var s=r.index-1+n,r=r[0].slice(n),t=r.length,u=s+t,v=q.slice(0,s+1),w=q.slice(u+1),x=[p,1];v&&x.push(v);var y=new e(h,l?c.tokenize(r,l):r,o);x.push(y),w&&x.push(w),Array.prototype.splice.apply(f,x)}}}}}return f},hooks:{all:{},add:function(a,b){var d=c.hooks.all;d[a]=d[a]||[],d[a].push(b)},run:function(a,b){var d=c.hooks.all[a];if(d&&d.length)for(var e,f=0;e=d[f++];)e(b)}}},d=c.Token=function(a,b,c){this.type=a,this.content=b,this.alias=c};if(d.stringify=function(a,b,e){if("string"==typeof a)return a;if("Array"===c.util.type(a))return a.map(function(c){return d.stringify(c,b,a)}).join("");var f={type:a.type,content:d.stringify(a.content,b,e),tag:"span",classes:["token",a.type],attributes:{},language:b,parent:e};if("comment"==f.type&&(f.attributes.spellcheck="true"),a.alias){var g="Array"===c.util.type(a.alias)?a.alias:[a.alias];Array.prototype.push.apply(f.classes,g)}c.hooks.run("wrap",f);var h="";for(var i in f.attributes)h+=(h?" ":"")+i+'="'+(f.attributes[i]||"")+'"';return"<"+f.tag+' class="'+f.classes.join(" ")+'" '+h+">"+f.content+"</"+f.tag+">"},!b.document)return b.addEventListener?(b.addEventListener("message",function(a){var d=JSON.parse(a.data),e=d.language,f=d.code,g=d.immediateClose;b.postMessage(c.highlight(f,c.languages[e],e)),g&&b.close()},!1),b.Prism):b.Prism}();return"undefined"!=typeof module&&module.exports&&(module.exports=c),"undefined"!=typeof global&&(global.Prism=c),c.languages.markup={comment:/<!--[\w\W]*?-->/,prolog:/<\?[\w\W]+?\?>/,doctype:/<!DOCTYPE[\w\W]+?>/,cdata:/<!\[CDATA\[[\w\W]*?]]>/i,tag:{pattern:/<\/?[^\s>\/=.]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/[=>"']/}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},c.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))}),c.languages.xml=c.languages.markup,c.languages.html=c.languages.markup,c.languages.mathml=c.languages.markup,c.languages.svg=c.languages.markup,c.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,function:/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},c.languages.css.atrule.inside.rest=c.util.clone(c.languages.css),c.languages.markup&&(c.languages.insertBefore("markup","tag",{style:{pattern:/<style[\w\W]*?>[\w\W]*?<\/style>/i,inside:{tag:{pattern:/<style[\w\W]*?>|<\/style>/i,inside:c.languages.markup.tag.inside},rest:c.languages.css},alias:"language-css"}}),c.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|').*?\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:c.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:c.languages.css}},alias:"language-css"}},c.languages.markup.tag)),c.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:/(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(true|false)\b/,function:/[a-z0-9_]+(?=\()/i,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/},c.languages.javascript=c.languages.extend("clike",{keyword:/\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/,number:/\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/,function:/[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i}),c.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^\/])\/(?!\/)(\[.+?]|\\.|[^\/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0}}),c.languages.insertBefore("javascript","class-name",{"template-string":{pattern:/`(?:\\`|\\?[^`])*`/,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:c.languages.javascript}},string:/[\s\S]+/}}}),c.languages.markup&&c.languages.insertBefore("markup","tag",{script:{pattern:/<script[\w\W]*?>[\w\W]*?<\/script>/i,inside:{tag:{pattern:/<script[\w\W]*?>|<\/script>/i,inside:c.languages.markup.tag.inside},rest:c.languages.javascript},alias:"language-javascript"}}),c.languages.js=c.languages.javascript,c.languages.c=c.languages.extend("clike",{keyword:/\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,operator:/\-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*\/]/,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)[ful]*\b/i}),c.languages.insertBefore("c","string",{macro:{pattern:/(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im,lookbehind:!0,alias:"property",inside:{string:{pattern:/(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3)/,lookbehind:!0}}}}),delete c.languages.c["class-name"],delete c.languages.c.boolean,c.languages.csharp=c.languages.extend("clike",{keyword:/\b(abstract|as|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|async|await|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b/,string:[/@("|')(\1\1|\\\1|\\?(?!\1)[\s\S])*\1/,/("|')(\\?.)*?\1/],number:/\b-?(0x[\da-f]+|\d*\.?\d+)\b/i}),c.languages.insertBefore("csharp","keyword",{preprocessor:{pattern:/(^\s*)#.*/m,lookbehind:!0}}),c.languages.cpp=c.languages.extend("c",{keyword:/\b(alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,boolean:/\b(true|false)\b/,operator:/[-+]{1,2}|!=?|<{1,2}=?|>{1,2}=?|\->|:{1,2}|={1,2}|\^|~|%|&{1,2}|\|?\||\?|\*|\/|\b(and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/}),c.languages.insertBefore("cpp","keyword",{"class-name":{pattern:/(class\s+)[a-z0-9_]+/i,lookbehind:!0}}),c.languages.java=c.languages.extend("clike",{keyword:/\b(abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while)\b/,number:/\b0b[01]+\b|\b0x[\da-f]*\.?[\da-fp\-]+\b|\b\d*\.?\d+(?:e[+-]?\d+)?[df]?\b/i,operator:{pattern:/(^|[^.])(?:\+[+=]?|-[-=]?|!=?|<<?=?|>>?>?=?|==?|&[&=]?|\|[|=]?|\*=?|\/=?|%=?|\^=?|[?:~])/m,lookbehind:!0}}),c.languages.php=c.languages.extend("clike",{keyword:/\b(and|or|xor|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|for|foreach|function|include|include_once|global|if|new|return|static|switch|use|require|require_once|var|while|abstract|interface|public|implements|private|protected|parent|throw|null|echo|print|trait|namespace|final|yield|goto|instanceof|finally|try|catch)\b/i,constant:/\b[A-Z0-9_]{2,}\b/,comment:{pattern:/(^|[^\\])(?:\/\*[\w\W]*?\*\/|\/\/.*)/,lookbehind:!0}}),c.languages.insertBefore("php","class-name",{"shell-comment":{pattern:/(^|[^\\])#.*/,lookbehind:!0,alias:"comment"}}),c.languages.insertBefore("php","keyword",{delimiter:/\?>|<\?(?:php)?/i,variable:/\$\w+\b/i,package:{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/,lookbehind:!0,inside:{punctuation:/\\/}}}),c.languages.insertBefore("php","operator",{property:{pattern:/(->)[\w]+/,lookbehind:!0}}),c.languages.markup&&(c.hooks.add("before-highlight",function(a){"php"===a.language&&(a.tokenStack=[],a.backupCode=a.code,a.code=a.code.replace(/(?:<\?php|<\?)[\w\W]*?(?:\?>)/gi,function(b){return a.tokenStack.push(b),"{{{PHP"+a.tokenStack.length+"}}}"}))}),c.hooks.add("before-insert",function(a){"php"===a.language&&(a.code=a.backupCode,delete a.backupCode)}),c.hooks.add("after-highlight",function(a){if("php"===a.language){for(var b,d=0;b=a.tokenStack[d];d++)a.highlightedCode=a.highlightedCode.replace("{{{PHP"+(d+1)+"}}}",c.highlight(b,a.grammar,"php").replace(/\$/g,"$$$$"));a.element.innerHTML=a.highlightedCode}}),c.hooks.add("wrap",function(a){"php"===a.language&&"markup"===a.type&&(a.content=a.content.replace(/(\{\{\{PHP[0-9]+\}\}\})/g,'<span class="token php">$1</span>'))}),c.languages.insertBefore("php","comment",{markup:{pattern:/<[^?]\/?(.*?)>/,inside:c.languages.markup},php:/\{\{\{PHP[0-9]+\}\}\}/})),c.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},string:/"""[\s\S]+?"""|'''[\s\S]+?'''|("|')(?:\\?.)*?\1/,function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_][a-zA-Z0-9_]*(?=\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)[a-z0-9_]+/i,lookbehind:!0},keyword:/\b(?:as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|with|yield)\b/,boolean:/\b(?:True|False)\b/,number:/\b-?(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not)\b/,punctuation:/[{}[\];(),.:]/},function(a){a.languages.ruby=a.languages.extend("clike",{comment:/#(?!\{[^\r\n]*?\}).*/,keyword:/\b(alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|raise|redo|require|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/});var b={pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"tag"},rest:a.util.clone(a.languages.ruby)}};a.languages.insertBefore("ruby","keyword",{regex:[{pattern:/%r([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1[gim]{0,3}/,inside:{interpolation:b}},{pattern:/%r\((?:[^()\\]|\\[\s\S])*\)[gim]{0,3}/,inside:{interpolation:b}},{pattern:/%r\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}[gim]{0,3}/,inside:{interpolation:b}},{pattern:/%r\[(?:[^\[\]\\]|\\[\s\S])*\][gim]{0,3}/,inside:{interpolation:b}},{pattern:/%r<(?:[^<>\\]|\\[\s\S])*>[gim]{0,3}/,inside:{interpolation:b}},{pattern:/(^|[^\/])\/(?!\/)(\[.+?]|\\.|[^\/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0}],variable:/[@$]+[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/,symbol:/:[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/}),a.languages.insertBefore("ruby","number",{builtin:/\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|Fload|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,constant:/\b[A-Z][a-zA-Z_0-9]*(?:[?!]|\b)/}),a.languages.ruby.string=[{pattern:/%[qQiIwWxs]?([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1/,inside:{interpolation:b}},{pattern:/%[qQiIwWxs]?\((?:[^()\\]|\\[\s\S])*\)/,inside:{interpolation:b}},{pattern:/%[qQiIwWxs]?\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/,inside:{interpolation:b}},{pattern:/%[qQiIwWxs]?\[(?:[^\[\]\\]|\\[\s\S])*\]/,inside:{interpolation:b}},{pattern:/%[qQiIwWxs]?<(?:[^<>\\]|\\[\s\S])*>/,inside:{interpolation:b}},{pattern:/("|')(#\{[^}]+\}|\\(?:\r?\n|\r)|\\?.)*?\1/,inside:{interpolation:b}}]}(c),c}),d("tinymce/codesampleplugin/Utils",[],function(){function a(a){return a&&"PRE"==a.nodeName&&a.className.indexOf("language-")!==-1}function b(a){return function(b,c){return a(c)}}return{isCodeSample:a,trimArg:b}}),d("tinymce/codesampleplugin/Dialog",["tinymce/dom/DOMUtils","tinymce/codesampleplugin/Utils","tinymce/codesampleplugin/Prism"],function(a,b,c){function d(a){var b=[{text:"HTML/XML",value:"markup"},{text:"JavaScript",value:"javascript"},{text:"CSS",value:"css"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"}],c=a.settings.codesample_languages;return c?c:b}function e(a,b,d){a.undoManager.transact(function(){var e=f(a);d=i.encode(d),e?(a.dom.setAttrib(e,"class","language-"+b),e.innerHTML=d,c.highlightElement(e),a.selection.select(e)):(a.insertContent('<pre id="__new" class="language-'+b+'">'+d+"</pre>"),a.selection.select(a.$("#__new").removeAttr("id")[0]))})}function f(a){var c=a.selection.getNode();return b.isCodeSample(c)?c:null}function g(a){var b=f(a);return b?b.textContent:""}function h(a){var b,c=f(a);return c?(b=c.className.match(/language-(\w+)/),b?b[1]:""):""}var i=a.DOM;return{open:function(a){a.windowManager.open({title:"Insert/Edit code sample",minWidth:Math.min(i.getViewPort().w,a.getParam("codesample_dialog_width",800)),minHeight:Math.min(i.getViewPort().h,a.getParam("codesample_dialog_height",650)),layout:"flex",direction:"column",align:"stretch",body:[{type:"listbox",name:"language",label:"Language",maxWidth:200,value:h(a),values:d(a)},{type:"textbox",name:"code",multiline:!0,spellcheck:!1,ariaLabel:"Code view",flex:1,style:"direction: ltr; text-align: left",classes:"monospace",value:g(a),autofocus:!0}],onSubmit:function(b){e(a,b.data.language,b.data.code)}})}}}),d("tinymce/codesampleplugin/Plugin",["tinymce/Env","tinymce/PluginManager","tinymce/codesampleplugin/Prism","tinymce/codesampleplugin/Dialog","tinymce/codesampleplugin/Utils"],function(a,b,c,d,e){var f,g=e.trimArg;b.add("codesample",function(b,h){function i(){var a,c=b.settings.codesample_content_css;b.inline&&f||!b.inline&&j||(b.inline?f=!0:j=!0,c!==!1&&(a=b.dom.create("link",{rel:"stylesheet",href:c?c:h+"/css/prism.css"}),b.getDoc().getElementsByTagName("head")[0].appendChild(a)))}var j,k=b.$;a.ceFalse&&(b.on("PreProcess",function(a){k("pre[contenteditable=false]",a.node).filter(g(e.isCodeSample)).each(function(a,b){var c=k(b),d=b.textContent;c.attr("class",k.trim(c.attr("class"))),c.removeAttr("contentEditable"),c.empty().append(k("<code></code>").each(function(){this.textContent=d}))})}),b.on("SetContent",function(){var a=k("pre").filter(g(e.isCodeSample)).filter(function(a,b){return"false"!==b.contentEditable});a.length&&b.undoManager.transact(function(){a.each(function(a,d){k(d).find("br").each(function(a,c){c.parentNode.replaceChild(b.getDoc().createTextNode("\n"),c)}),d.contentEditable=!1,d.innerHTML=b.dom.encode(d.textContent),c.highlightElement(d),d.className=k.trim(d.className)})})}),b.addCommand("codesample",function(){b.selection.isCollapsed()?d.open(b):b.formatter.toggle("code")}),b.addButton("codesample",{cmd:"codesample",title:"Insert/Edit code sample"}),b.on("init",i))})}),f(["tinymce/codesampleplugin/Prism","tinymce/codesampleplugin/Utils","tinymce/codesampleplugin/Dialog","tinymce/codesampleplugin/Plugin"])}(this);
|
@@ -1 +1 @@
|
|
1
|
-
tinymce.PluginManager.add("contextmenu",function(a){var b,c=a.settings.contextmenu_never_use_native,
|
1
|
+
tinymce.PluginManager.add("contextmenu",function(a){var b,c,d=a.settings.contextmenu_never_use_native,e=function(a){return a.ctrlKey&&!d},f=function(){return tinymce.Env.mac&&tinymce.Env.webkit},g=function(){return c===!0};return a.on("mousedown",function(b){f()&&2===b.button&&!e(b)&&a.selection.isCollapsed()&&a.once("contextmenu",function(b){a.selection.placeCaretAt(b.clientX,b.clientY)})}),a.on("contextmenu",function(d){var f;if(!e(d)){if(d.preventDefault(),f=a.settings.contextmenu||"link openlink image inserttable | cell row column deletetable",b)b.show();else{var g=[];tinymce.each(f.split(/[ ,]/),function(b){var c=a.menuItems[b];"|"==b&&(c={text:b}),c&&(c.shortcut="",g.push(c))});for(var h=0;h<g.length;h++)"|"==g[h].text&&(0!==h&&h!=g.length-1||g.splice(h,1));b=new tinymce.ui.Menu({items:g,context:"contextmenu",classes:"contextmenu"}).renderTo(),b.on("hide",function(a){a.control===this&&(c=!1)}),a.on("remove",function(){b.remove(),b=null})}var i={x:d.pageX,y:d.pageY};a.inline||(i=tinymce.DOM.getPos(a.getContentAreaContainer()),i.x+=d.clientX,i.y+=d.clientY),b.moveTo(i.x,i.y),c=!0}}),{isContextMenuVisible:g}});
|
@@ -1 +1 @@
|
|
1
|
-
tinymce.PluginManager.add("fullpage",function(a){function b(){var b=c();a.windowManager.open({title:"Document properties",data:b,defaults:{type:"textbox",size:40},body:[{name:"title",label:"Title"},{name:"keywords",label:"Keywords"},{name:"description",label:"Description"},{name:"robots",label:"Robots"},{name:"author",label:"Author"},{name:"docencoding",label:"Encoding"}],onSubmit:function(a){d(tinymce.extend(b,a.data))}})}function c(){function b(a,b){var c=a.attr(b);return c||""}var c,d,f=e(),g={};return g.fontface=a.getParam("fullpage_default_fontface",""),g.fontsize=a.getParam("fullpage_default_fontsize",""),c=f.firstChild,7==c.type&&(g.xml_pi=!0,d=/encoding="([^"]+)"/.exec(c.value),d&&(g.docencoding=d[1])),c=f.getAll("#doctype")[0],c&&(g.doctype="<!DOCTYPE"+c.value+">"),c=f.getAll("title")[0],c&&c.firstChild&&(g.title=c.firstChild.value),k(f.getAll("meta"),function(a){var b,c=a.attr("name"),d=a.attr("http-equiv");c?g[c.toLowerCase()]=a.attr("content"):"Content-Type"==d&&(b=/charset\s*=\s*(.*)\s*/gi.exec(a.attr("content")),b&&(g.docencoding=b[1]))}),c=f.getAll("html")[0],c&&(g.langcode=b(c,"lang")||b(c,"xml:lang")),g.stylesheets=[],tinymce.each(f.getAll("link"),function(a){"stylesheet"==a.attr("rel")&&g.stylesheets.push(a.attr("href"))}),c=f.getAll("body")[0],c&&(g.langdir=b(c,"dir"),g.style=b(c,"style"),g.visited_color=b(c,"vlink"),g.link_color=b(c,"link"),g.active_color=b(c,"alink")),g}function d(b){function c(a,b,c){a.attr(b,c?c:void 0)}function d(a){g.firstChild?g.insert(a,g.firstChild):g.append(a)}var f,g,h,j,m,n=a.dom;f=e(),g=f.getAll("head")[0],g||(j=f.getAll("html")[0],g=new l("head",1),j.firstChild?j.insert(g,j.firstChild,!0):j.append(g)),j=f.firstChild,b.xml_pi?(m='version="1.0"',b.docencoding&&(m+=' encoding="'+b.docencoding+'"'),7!=j.type&&(j=new l("xml",7),f.insert(j,f.firstChild,!0)),j.value=m):j&&7==j.type&&j.remove(),j=f.getAll("#doctype")[0],b.doctype?(j||(j=new l("#doctype",10),b.xml_pi?f.insert(j,f.firstChild):d(j)),j.value=b.doctype.substring(9,b.doctype.length-1)):j&&j.remove(),j=null,k(f.getAll("meta"),function(a){"Content-Type"==a.attr("http-equiv")&&(j=a)}),b.docencoding?(j||(j=new l("meta",1),j.attr("http-equiv","Content-Type"),j.shortEnded=!0,d(j)),j.attr("content","text/html; charset="+b.docencoding)):j&&j.remove(),j=f.getAll("title")[0],b.title?(j?j.empty():(j=new l("title",1),d(j)),j.append(new l("#text",3)).value=b.title):j&&j.remove(),k("keywords,description,author,copyright,robots".split(","),function(a){var c,e,g=f.getAll("meta"),h=b[a];for(c=0;c<g.length;c++)if(e=g[c],e.attr("name")==a)return void(h?e.attr("content",h):e.remove());h&&(j=new l("meta",1),j.attr("name",a),j.attr("content",h),j.shortEnded=!0,d(j))});var o={};tinymce.each(f.getAll("link"),function(a){"stylesheet"==a.attr("rel")&&(o[a.attr("href")]=a)}),tinymce.each(b.stylesheets,function(a){o[a]||(j=new l("link",1),j.attr({rel:"stylesheet",text:"text/css",href:a}),j.shortEnded=!0,d(j)),delete o[a]}),tinymce.each(o,function(a){a.remove()}),j=f.getAll("body")[0],j&&(c(j,"dir",b.langdir),c(j,"style",b.style),c(j,"vlink",b.visited_color),c(j,"link",b.link_color),c(j,"alink",b.active_color),n.setAttribs(a.getBody(),{style:b.style,dir:b.dir,vLink:b.visited_color,link:b.link_color,aLink:b.active_color})),j=f.getAll("html")[0],j&&(c(j,"lang",b.langcode),c(j,"xml:lang",b.langcode)),g.firstChild||g.remove(),h=new tinymce.html.Serializer({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(f),i=h.substring(0,h.indexOf("</body>"))}function e(){return new tinymce.html.DomParser({validate:!1,root_name:"#document"}).parse(i)}function f(b){function c(a){return a.replace(/<\/?[A-Z]+/g,function(a){return a.toLowerCase()})}var d,f,h,l,m=b.content,n="",o=a.dom;if(!b.selection&&!("raw"==b.format&&i||b.source_view&&a.getParam("fullpage_hide_in_source_view"))){0!==m.length||b.source_view||(m=tinymce.trim(i)+"\n"+tinymce.trim(m)+"\n"+tinymce.trim(j)),m=m.replace(/<(\/?)BODY/gi,"<$1body"),d=m.indexOf("<body")
|
1
|
+
tinymce.PluginManager.add("fullpage",function(a){function b(){var b=c();a.windowManager.open({title:"Document properties",data:b,defaults:{type:"textbox",size:40},body:[{name:"title",label:"Title"},{name:"keywords",label:"Keywords"},{name:"description",label:"Description"},{name:"robots",label:"Robots"},{name:"author",label:"Author"},{name:"docencoding",label:"Encoding"}],onSubmit:function(a){d(tinymce.extend(b,a.data))}})}function c(){function b(a,b){var c=a.attr(b);return c||""}var c,d,f=e(),g={};return g.fontface=a.getParam("fullpage_default_fontface",""),g.fontsize=a.getParam("fullpage_default_fontsize",""),c=f.firstChild,7==c.type&&(g.xml_pi=!0,d=/encoding="([^"]+)"/.exec(c.value),d&&(g.docencoding=d[1])),c=f.getAll("#doctype")[0],c&&(g.doctype="<!DOCTYPE"+c.value+">"),c=f.getAll("title")[0],c&&c.firstChild&&(g.title=c.firstChild.value),k(f.getAll("meta"),function(a){var b,c=a.attr("name"),d=a.attr("http-equiv");c?g[c.toLowerCase()]=a.attr("content"):"Content-Type"==d&&(b=/charset\s*=\s*(.*)\s*/gi.exec(a.attr("content")),b&&(g.docencoding=b[1]))}),c=f.getAll("html")[0],c&&(g.langcode=b(c,"lang")||b(c,"xml:lang")),g.stylesheets=[],tinymce.each(f.getAll("link"),function(a){"stylesheet"==a.attr("rel")&&g.stylesheets.push(a.attr("href"))}),c=f.getAll("body")[0],c&&(g.langdir=b(c,"dir"),g.style=b(c,"style"),g.visited_color=b(c,"vlink"),g.link_color=b(c,"link"),g.active_color=b(c,"alink")),g}function d(b){function c(a,b,c){a.attr(b,c?c:void 0)}function d(a){g.firstChild?g.insert(a,g.firstChild):g.append(a)}var f,g,h,j,m,n=a.dom;f=e(),g=f.getAll("head")[0],g||(j=f.getAll("html")[0],g=new l("head",1),j.firstChild?j.insert(g,j.firstChild,!0):j.append(g)),j=f.firstChild,b.xml_pi?(m='version="1.0"',b.docencoding&&(m+=' encoding="'+b.docencoding+'"'),7!=j.type&&(j=new l("xml",7),f.insert(j,f.firstChild,!0)),j.value=m):j&&7==j.type&&j.remove(),j=f.getAll("#doctype")[0],b.doctype?(j||(j=new l("#doctype",10),b.xml_pi?f.insert(j,f.firstChild):d(j)),j.value=b.doctype.substring(9,b.doctype.length-1)):j&&j.remove(),j=null,k(f.getAll("meta"),function(a){"Content-Type"==a.attr("http-equiv")&&(j=a)}),b.docencoding?(j||(j=new l("meta",1),j.attr("http-equiv","Content-Type"),j.shortEnded=!0,d(j)),j.attr("content","text/html; charset="+b.docencoding)):j&&j.remove(),j=f.getAll("title")[0],b.title?(j?j.empty():(j=new l("title",1),d(j)),j.append(new l("#text",3)).value=b.title):j&&j.remove(),k("keywords,description,author,copyright,robots".split(","),function(a){var c,e,g=f.getAll("meta"),h=b[a];for(c=0;c<g.length;c++)if(e=g[c],e.attr("name")==a)return void(h?e.attr("content",h):e.remove());h&&(j=new l("meta",1),j.attr("name",a),j.attr("content",h),j.shortEnded=!0,d(j))});var o={};tinymce.each(f.getAll("link"),function(a){"stylesheet"==a.attr("rel")&&(o[a.attr("href")]=a)}),tinymce.each(b.stylesheets,function(a){o[a]||(j=new l("link",1),j.attr({rel:"stylesheet",text:"text/css",href:a}),j.shortEnded=!0,d(j)),delete o[a]}),tinymce.each(o,function(a){a.remove()}),j=f.getAll("body")[0],j&&(c(j,"dir",b.langdir),c(j,"style",b.style),c(j,"vlink",b.visited_color),c(j,"link",b.link_color),c(j,"alink",b.active_color),n.setAttribs(a.getBody(),{style:b.style,dir:b.dir,vLink:b.visited_color,link:b.link_color,aLink:b.active_color})),j=f.getAll("html")[0],j&&(c(j,"lang",b.langcode),c(j,"xml:lang",b.langcode)),g.firstChild||g.remove(),h=new tinymce.html.Serializer({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(f),i=h.substring(0,h.indexOf("</body>"))}function e(){return new tinymce.html.DomParser({validate:!1,root_name:"#document"}).parse(i)}function f(b){function c(a){return a.replace(/<\/?[A-Z]+/g,function(a){return a.toLowerCase()})}var d,f,h,l,m=b.content,n="",o=a.dom;if(!b.selection&&!("raw"==b.format&&i||b.source_view&&a.getParam("fullpage_hide_in_source_view"))){0!==m.length||b.source_view||(m=tinymce.trim(i)+"\n"+tinymce.trim(m)+"\n"+tinymce.trim(j)),m=m.replace(/<(\/?)BODY/gi,"<$1body"),d=m.indexOf("<body"),d!=-1?(d=m.indexOf(">",d),i=c(m.substring(0,d+1)),f=m.indexOf("</body",d),f==-1&&(f=m.length),b.content=m.substring(d+1,f),j=c(m.substring(f))):(i=g(),j="\n</body>\n</html>"),h=e(),k(h.getAll("style"),function(a){a.firstChild&&(n+=a.firstChild.value)}),l=h.getAll("body")[0],l&&o.setAttribs(a.getBody(),{style:l.attr("style")||"",dir:l.attr("dir")||"",vLink:l.attr("vlink")||"",link:l.attr("link")||"",aLink:l.attr("alink")||""}),o.remove("fullpage_styles");var p=a.getDoc().getElementsByTagName("head")[0];n&&(o.add(p,"style",{id:"fullpage_styles"},n),l=o.get("fullpage_styles"),l.styleSheet&&(l.styleSheet.cssText=n));var q={};tinymce.each(p.getElementsByTagName("link"),function(a){"stylesheet"==a.rel&&a.getAttribute("data-mce-fullpage")&&(q[a.href]=a)}),tinymce.each(h.getAll("link"),function(a){var b=a.attr("href");return!b||(q[b]||"stylesheet"!=a.attr("rel")||o.add(p,"link",{rel:"stylesheet",text:"text/css",href:b,"data-mce-fullpage":"1"}),void delete q[b])}),tinymce.each(q,function(a){a.parentNode.removeChild(a)})}}function g(){var b,c="",d="";return a.getParam("fullpage_default_xml_pi")&&(c+='<?xml version="1.0" encoding="'+a.getParam("fullpage_default_encoding","ISO-8859-1")+'" ?>\n'),c+=a.getParam("fullpage_default_doctype","<!DOCTYPE html>"),c+="\n<html>\n<head>\n",(b=a.getParam("fullpage_default_title"))&&(c+="<title>"+b+"</title>\n"),(b=a.getParam("fullpage_default_encoding"))&&(c+='<meta http-equiv="Content-Type" content="text/html; charset='+b+'" />\n'),(b=a.getParam("fullpage_default_font_family"))&&(d+="font-family: "+b+";"),(b=a.getParam("fullpage_default_font_size"))&&(d+="font-size: "+b+";"),(b=a.getParam("fullpage_default_text_color"))&&(d+="color: "+b+";"),c+="</head>\n<body"+(d?' style="'+d+'"':"")+">\n"}function h(b){b.selection||b.source_view&&a.getParam("fullpage_hide_in_source_view")||(b.content=tinymce.trim(i)+"\n"+tinymce.trim(b.content)+"\n"+tinymce.trim(j))}var i,j,k=tinymce.each,l=tinymce.html.Node;a.addCommand("mceFullPageProperties",b),a.addButton("fullpage",{title:"Document properties",cmd:"mceFullPageProperties"}),a.addMenuItem("fullpage",{text:"Document properties",cmd:"mceFullPageProperties",context:"file"}),a.on("BeforeSetContent",f),a.on("GetContent",h)});
|
@@ -1 +1 @@
|
|
1
|
-
tinymce.PluginManager.add("fullscreen",function(a){function b(){var a,b,c=window,d=document,e=d.body;return e.offsetWidth&&(a=e.offsetWidth,b=e.offsetHeight),c.innerWidth&&c.innerHeight&&(a=c.innerWidth,b=c.innerHeight),{w:a,h:b}}function c(){var a=tinymce.DOM.getViewPort();return{x:a.x,y:a.y}}function d(a){scrollTo(a.x,a.y)}function e(){function e(){m.setStyle(p,"height",b().h-(o.clientHeight-p.clientHeight))}var n,o,p,q,r=document.body,s=document.documentElement;l=!l,o=a.getContainer(),n=o.style,p=a.getContentAreaContainer().firstChild,q=p.style,l?(k=c(),f=q.width,g=q.height,q.width=q.height="100%",i=n.width,j=n.height,n.width=n.height="",m.addClass(r,"mce-fullscreen"),m.addClass(s,"mce-fullscreen"),m.addClass(o,"mce-fullscreen"),m.bind(window,"resize",e),e(),h=e):(q.width=f,q.height=g,i&&(n.width=i),j&&(n.height=j),m.removeClass(r,"mce-fullscreen"),m.removeClass(s,"mce-fullscreen"),m.removeClass(o,"mce-fullscreen"),m.unbind(window,"resize",h),d(k)),a.fire("FullscreenStateChanged",{state:l})}var f,g,h,i,j,k,l=!1,m=tinymce.DOM;
|
1
|
+
tinymce.PluginManager.add("fullscreen",function(a){function b(){var a,b,c=window,d=document,e=d.body;return e.offsetWidth&&(a=e.offsetWidth,b=e.offsetHeight),c.innerWidth&&c.innerHeight&&(a=c.innerWidth,b=c.innerHeight),{w:a,h:b}}function c(){var a=tinymce.DOM.getViewPort();return{x:a.x,y:a.y}}function d(a){scrollTo(a.x,a.y)}function e(){function e(){m.setStyle(p,"height",b().h-(o.clientHeight-p.clientHeight))}var n,o,p,q,r=document.body,s=document.documentElement;l=!l,o=a.getContainer(),n=o.style,p=a.getContentAreaContainer().firstChild,q=p.style,l?(k=c(),f=q.width,g=q.height,q.width=q.height="100%",i=n.width,j=n.height,n.width=n.height="",m.addClass(r,"mce-fullscreen"),m.addClass(s,"mce-fullscreen"),m.addClass(o,"mce-fullscreen"),m.bind(window,"resize",e),e(),h=e):(q.width=f,q.height=g,i&&(n.width=i),j&&(n.height=j),m.removeClass(r,"mce-fullscreen"),m.removeClass(s,"mce-fullscreen"),m.removeClass(o,"mce-fullscreen"),m.unbind(window,"resize",h),d(k)),a.fire("FullscreenStateChanged",{state:l})}var f,g,h,i,j,k,l=!1,m=tinymce.DOM;if(!a.settings.inline)return a.on("init",function(){a.addShortcut("Ctrl+Shift+F","",e)}),a.on("remove",function(){h&&m.unbind(window,"resize",h)}),a.addCommand("mceFullScreen",e),a.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Ctrl+Shift+F",selectable:!0,onClick:function(){e(),a.focus()},onPostRender:function(){var b=this;a.on("FullscreenStateChanged",function(a){b.active(a.state)})},context:"view"}),a.addButton("fullscreen",{tooltip:"Fullscreen",shortcut:"Ctrl+Shift+F",onClick:e,onPostRender:function(){var b=this;a.on("FullscreenStateChanged",function(a){b.active(a.state)})}}),{isFullscreen:function(){return l}}});
|
@@ -1 +1 @@
|
|
1
|
-
tinymce.PluginManager.add("image",function(a){function b(a,b){function c(a,c){d.parentNode&&d.parentNode.removeChild(d),b({width:a,height:c})}var d=document.createElement("img");d.onload=function(){c(Math.max(d.width,d.clientWidth),Math.max(d.height,d.clientHeight))},d.onerror=function(){c()};var e=d.style;e.visibility="hidden",e.position="fixed",e.bottom=e.left=0,e.width=e.height="auto",document.body.appendChild(d),d.src=a}function c(a,b,c){function d(a,c){return c=c||[],tinymce.each(a,function(a){var e={text:a.text||a.title};a.menu?e.menu=d(a.menu):(e.value=a.value,b(e)),c.push(e)}),c}return d(a,c||[])}function d(b){return function(){var c=a.settings.image_list;"string"==typeof c?tinymce.util.XHR.send({url:c,success:function(a){b(tinymce.util.JSON.parse(a))}}):"function"==typeof c?c(b):b(c)}}function e(d){function e(){var a,b,c,d;a=
|
1
|
+
tinymce.PluginManager.add("image",function(a){function b(a,b){function c(a,c){d.parentNode&&d.parentNode.removeChild(d),b({width:a,height:c})}var d=document.createElement("img");d.onload=function(){c(Math.max(d.width,d.clientWidth),Math.max(d.height,d.clientHeight))},d.onerror=function(){c()};var e=d.style;e.visibility="hidden",e.position="fixed",e.bottom=e.left=0,e.width=e.height="auto",document.body.appendChild(d),d.src=a}function c(a,b,c){function d(a,c){return c=c||[],tinymce.each(a,function(a){var e={text:a.text||a.title};a.menu?e.menu=d(a.menu):(e.value=a.value,b(e)),c.push(e)}),c}return d(a,c||[])}function d(b){return function(){var c=a.settings.image_list;"string"==typeof c?tinymce.util.XHR.send({url:c,success:function(a){b(tinymce.util.JSON.parse(a))}}):"function"==typeof c?c(b):b(c)}}function e(d){function e(){var a,b,c,d;a=m.find("#width")[0],b=m.find("#height")[0],a&&b&&(c=a.value(),d=b.value(),m.find("#constrain")[0].checked()&&p&&q&&c&&d&&(p!=c?(d=Math.round(c/p*d),isNaN(d)||b.value(d)):(c=Math.round(d/q*c),isNaN(c)||a.value(c))),p=c,q=d)}function f(){function b(b){function c(){b.onload=b.onerror=null,a.selection&&(a.selection.select(b),a.nodeChanged())}b.onload=function(){t.width||t.height||!v||u.setAttribs(b,{width:b.clientWidth,height:b.clientHeight}),c()},b.onerror=c}var c,d;k(),e(),t=tinymce.extend(t,m.toJSON()),t.alt||(t.alt=""),t.title||(t.title=""),""===t.width&&(t.width=null),""===t.height&&(t.height=null),t.style||(t.style=null),t={src:t.src,alt:t.alt,title:t.title,width:t.width,height:t.height,style:t.style,caption:t.caption,class:t.class},a.undoManager.transact(function(){function e(b){return a.schema.getTextBlockElements()[b.nodeName]}if(!t.src)return void(n&&(u.remove(n),a.focus(),a.nodeChanged()));if(""===t.title&&(t.title=null),n?u.setAttribs(n,t):(t.id="__mcenew",a.focus(),a.selection.setContent(u.createHTML("img",t)),n=u.get("__mcenew"),u.setAttrib(n,"id",null)),a.editorUpload.uploadImagesAuto(),t.caption===!1&&u.is(n.parentNode,"figure.image")&&(c=n.parentNode,u.insertAfter(n,c),u.remove(c)),t.caption!==!0)b(n);else if(!u.is(n.parentNode,"figure.image")){d=n,n=n.cloneNode(!0),c=u.create("figure",{class:"image"}),c.appendChild(n),c.appendChild(u.create("figcaption",{contentEditable:!0},"Caption")),c.contentEditable=!1;var f=u.getParent(d,e);f?u.split(f,d,c):u.replace(c,d),a.selection.select(c)}})}function g(a){return a&&(a=a.replace(/px$/,"")),a}function h(c){var d,e,f,g=c.meta||{};r&&r.value(a.convertURL(this.value(),"src")),tinymce.each(g,function(a,b){m.find("#"+b).value(a)}),g.width||g.height||(d=a.convertURL(this.value(),"src"),e=a.settings.image_prepend_url,f=new RegExp("^(?:[a-z]+:)?//","i"),e&&!f.test(d)&&d.substring(0,e.length)!==e&&(d=e+d),this.value(d),b(a.documentBaseURI.toAbsolute(this.value()),function(a){a.width&&a.height&&v&&(p=a.width,q=a.height,m.find("#width").value(p),m.find("#height").value(q))}))}function i(a){a.meta=m.toJSON()}function j(a){if(a.margin){var b=a.margin.split(" ");switch(b.length){case 1:a["margin-top"]=a["margin-top"]||b[0],a["margin-right"]=a["margin-right"]||b[0],a["margin-bottom"]=a["margin-bottom"]||b[0],a["margin-left"]=a["margin-left"]||b[0];break;case 2:a["margin-top"]=a["margin-top"]||b[0],a["margin-right"]=a["margin-right"]||b[1],a["margin-bottom"]=a["margin-bottom"]||b[0],a["margin-left"]=a["margin-left"]||b[1];break;case 3:a["margin-top"]=a["margin-top"]||b[0],a["margin-right"]=a["margin-right"]||b[1],a["margin-bottom"]=a["margin-bottom"]||b[2],a["margin-left"]=a["margin-left"]||b[1];break;case 4:a["margin-top"]=a["margin-top"]||b[0],a["margin-right"]=a["margin-right"]||b[1],a["margin-bottom"]=a["margin-bottom"]||b[2],a["margin-left"]=a["margin-left"]||b[3]}delete a.margin}return a}function k(){function b(a){return a.length>0&&/^[0-9]+$/.test(a)&&(a+="px"),a}if(a.settings.image_advtab){var c=m.toJSON(),d=u.parseStyle(c.style);d=j(d),c.vspace&&(d["margin-top"]=d["margin-bottom"]=b(c.vspace)),c.hspace&&(d["margin-left"]=d["margin-right"]=b(c.hspace)),c.border&&(d["border-width"]=b(c.border)),m.find("#style").value(u.serializeStyle(u.parseStyle(u.serializeStyle(d))))}}function l(){if(a.settings.image_advtab){var b=m.toJSON(),c=u.parseStyle(b.style);m.find("#vspace").value(""),m.find("#hspace").value(""),c=j(c),(c["margin-top"]&&c["margin-bottom"]||c["margin-right"]&&c["margin-left"])&&(c["margin-top"]===c["margin-bottom"]?m.find("#vspace").value(g(c["margin-top"])):m.find("#vspace").value(""),c["margin-right"]===c["margin-left"]?m.find("#hspace").value(g(c["margin-right"])):m.find("#hspace").value("")),c["border-width"]&&m.find("#border").value(g(c["border-width"])),m.find("#style").value(u.serializeStyle(u.parseStyle(u.serializeStyle(c))))}}var m,n,o,p,q,r,s,t={},u=a.dom,v=a.settings.image_dimensions!==!1;n=a.selection.getNode(),o=u.getParent(n,"figure.image"),o&&(n=u.select("img",o)[0]),n&&("IMG"!=n.nodeName||n.getAttribute("data-mce-object")||n.getAttribute("data-mce-placeholder"))&&(n=null),n&&(p=u.getAttrib(n,"width"),q=u.getAttrib(n,"height"),t={src:u.getAttrib(n,"src"),alt:u.getAttrib(n,"alt"),title:u.getAttrib(n,"title"),class:u.getAttrib(n,"class"),width:p,height:q,caption:!!o}),d&&(r={type:"listbox",label:"Image list",values:c(d,function(b){b.value=a.convertURL(b.value||b.url,"src")},[{text:"None",value:""}]),value:t.src&&a.convertURL(t.src,"src"),onselect:function(a){var b=m.find("#alt");(!b.value()||a.lastControl&&b.value()==a.lastControl.text())&&b.value(a.control.text()),m.find("#src").value(a.control.value()).fire("change")},onPostRender:function(){r=this}}),a.settings.image_class_list&&(s={name:"class",type:"listbox",label:"Class",values:c(a.settings.image_class_list,function(b){b.value&&(b.textStyle=function(){return a.formatter.getCssText({inline:"img",classes:[b.value]})})})});var w=[{name:"src",type:"filepicker",filetype:"image",label:"Source",autofocus:!0,onchange:h,onbeforecall:i},r];a.settings.image_description!==!1&&w.push({name:"alt",type:"textbox",label:"Image description"}),a.settings.image_title&&w.push({name:"title",type:"textbox",label:"Image Title"}),v&&w.push({type:"container",label:"Dimensions",layout:"flex",direction:"row",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:5,size:3,onchange:e,ariaLabel:"Width"},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:5,size:3,onchange:e,ariaLabel:"Height"},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}),w.push(s),a.settings.image_caption&&tinymce.Env.ceFalse&&w.push({name:"caption",type:"checkbox",label:"Caption"}),a.settings.image_advtab?(n&&(n.style.marginLeft&&n.style.marginRight&&n.style.marginLeft===n.style.marginRight&&(t.hspace=g(n.style.marginLeft)),n.style.marginTop&&n.style.marginBottom&&n.style.marginTop===n.style.marginBottom&&(t.vspace=g(n.style.marginTop)),n.style.borderWidth&&(t.border=g(n.style.borderWidth)),t.style=a.dom.serializeStyle(a.dom.parseStyle(a.dom.getAttrib(n,"style")))),m=a.windowManager.open({title:"Insert/edit image",data:t,bodyType:"tabpanel",body:[{title:"General",type:"form",items:w},{title:"Advanced",type:"form",pack:"start",items:[{label:"Style",name:"style",type:"textbox",onchange:l},{type:"form",layout:"grid",packV:"start",columns:2,padding:0,alignH:["left","right"],defaults:{type:"textbox",maxWidth:50,onchange:k},items:[{label:"Vertical space",name:"vspace"},{label:"Horizontal space",name:"hspace"},{label:"Border",name:"border"}]}]}],onSubmit:f})):m=a.windowManager.open({title:"Insert/edit image",data:t,body:w,onSubmit:f})}a.on("preInit",function(){function b(a){var b=a.attr("class");return b&&/\bimage\b/.test(b)}function c(a){return function(c){function d(b){b.attr("contenteditable",a?"true":null)}for(var e,f=c.length;f--;)e=c[f],b(e)&&(e.attr("contenteditable",a?"false":null),tinymce.each(e.getAll("figcaption"),d))}}a.parser.addNodeFilter("figure",c(!0)),a.serializer.addNodeFilter("figure",c(!1))}),a.addButton("image",{icon:"image",tooltip:"Insert/edit image",onclick:d(e),stateSelector:"img:not([data-mce-object],[data-mce-placeholder]),figure.image"}),a.addMenuItem("image",{icon:"image",text:"Image",onclick:d(e),context:"insert",prependToContext:!0}),a.addCommand("mceImage",d(e))});
|
@@ -1 +1 @@
|
|
1
|
-
!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;g>i;++i)h[i]=d(e[i]);var j=f.apply(null,h);if(void 0===j)throw"module ["+b+"] returned undefined";c.instance=j},c=function(b,c,d){if("string"!=typeof b)throw"module id must be a string";if(void 0===c)throw"no dependencies for "+b;if(void 0===d)throw"no definition function for "+b;a[b]={deps:c,defn:d,instance:void 0}},d=function(c){var d=a[c];if(void 0===d)throw"module ["+c+"] was undefined";return void 0===d.instance&&b(c),d.instance},e=function(a,b){for(var c=a.length,e=new Array(c),f=0;c>f;++f)e.push(d(a[f]));b.apply(null,b)},f={};f.bolt={module:{api:{define:c,require:e,demand:d}}};var g=c,h=function(a,b){g(a,[],function(){return b})};h("1",tinymce.PluginManager),h("2",tinymce.Env),h("3",tinymce.util.Promise),h("4",tinymce.util.URI),h("5",tinymce.util.Tools),h("6",tinymce.util.Delay),g("m",[],function(){function a(a,b){return d(document.createElement("canvas"),a,b)}function b(a){return a.getContext("2d")}function c(a){var b=null;try{b=a.getContext("webgl")||a.getContext("experimental-webgl")}catch(c){}return b||(b=null),b}function d(a,b,c){return a.width=b,a.height=c,a}return{create:a,resize:d,get2dContext:b,get3dContext:c}}),g("n",[],function(){function a(a){return a.naturalWidth||a.width}function b(a){return a.naturalHeight||a.height}return{getWidth:a,getHeight:b}}),g("o",[],function(){function a(a,b){return function(){a.apply(b,arguments)}}function b(b){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof b)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],h(b,a(d,this),a(e,this))}function c(a){var b=this;return null===this._state?void this._deferreds.push(a):void i(function(){var c=b._state?a.onFulfilled:a.onRejected;if(null===c)return void(b._state?a.resolve:a.reject)(b._value);var d;try{d=c(b._value)}catch(e){return void a.reject(e)}a.resolve(d)})}function d(b){try{if(b===this)throw new TypeError("A promise cannot be resolved with itself.");if(b&&("object"==typeof b||"function"==typeof b)){var c=b.then;if("function"==typeof c)return void h(a(c,b),a(d,this),a(e,this))}this._state=!0,this._value=b,f.call(this)}catch(g){e.call(this,g)}}function e(a){this._state=!1,this._value=a,f.call(this)}function f(){for(var a=0,b=this._deferreds.length;b>a;a++)c.call(this,this._deferreds[a]);this._deferreds=null}function g(a,b,c,d){this.onFulfilled="function"==typeof a?a:null,this.onRejected="function"==typeof b?b:null,this.resolve=c,this.reject=d}function h(a,b,c){var d=!1;try{a(function(a){d||(d=!0,b(a))},function(a){d||(d=!0,c(a))})}catch(e){if(d)return;d=!0,c(e)}}if(window.Promise)return window.Promise;var i=b.immediateFn||"function"==typeof setImmediate&&setImmediate||function(a){setTimeout(a,1)},j=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)};return b.prototype["catch"]=function(a){return this.then(null,a)},b.prototype.then=function(a,d){var e=this;return new b(function(b,f){c.call(e,new g(a,d,b,f))})},b.all=function(){var a=Array.prototype.slice.call(1===arguments.length&&j(arguments[0])?arguments[0]:arguments);return new b(function(b,c){function d(f,g){try{if(g&&("object"==typeof g||"function"==typeof g)){var h=g.then;if("function"==typeof h)return void h.call(g,function(a){d(f,a)},c)}a[f]=g,0===--e&&b(a)}catch(i){c(i)}}if(0===a.length)return b([]);for(var e=a.length,f=0;f<a.length;f++)d(f,a[f])})},b.resolve=function(a){return a&&"object"==typeof a&&a.constructor===b?a:new b(function(b){b(a)})},b.reject=function(a){return new b(function(b,c){c(a)})},b.race=function(a){return new b(function(b,c){for(var d=0,e=a.length;e>d;d++)a[d].then(b,c)})},b}),g("p",[],function(){function a(a){var b=document.createElement("a");return b.href=a,b.pathname}function b(b){var c=a(b).split("."),d=c[c.length-1],e={jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png"};return d&&(d=d.toLowerCase()),e[d]}return{guessMimeType:b}}),g("e",["o","m","p","n"],function(a,b,c,d){function e(b){return new a(function(a){function c(){b.removeEventListener("load",c),a(b)}b.complete?a(b):b.addEventListener("load",c)})}function f(a){return e(a).then(function(a){var c,e;return e=b.create(d.getWidth(a),d.getHeight(a)),c=b.get2dContext(e),c.drawImage(a,0,0),e})}function g(a){return e(a).then(function(a){var b=a.src;return 0===b.indexOf("blob:")?i(b):0===b.indexOf("data:")?j(b):f(a).then(function(a){return j(a.toDataURL(c.guessMimeType(b)))})})}function h(b){return new a(function(a){function c(){d.removeEventListener("load",c),a(d)}var d=new Image;d.addEventListener("load",c),d.src=URL.createObjectURL(b),d.complete&&c()})}function i(b){return new a(function(a){var c=new XMLHttpRequest;c.open("GET",b,!0),c.responseType="blob",c.onload=function(){200==this.status&&a(this.response)},c.send()})}function j(b){return new a(function(a){var c,d,e,f,g,h;if(b=b.split(","),f=/data:([^;]+)/.exec(b[0]),f&&(g=f[1]),c=atob(b[1]),window.WebKitBlobBuilder){for(h=new WebKitBlobBuilder,d=new ArrayBuffer(c.length),e=0;e<d.length;e++)d[e]=c.charCodeAt(e);return h.append(d),void a(h.getBlob(g))}for(d=new Uint8Array(c.length),e=0;e<d.length;e++)d[e]=c.charCodeAt(e);a(new Blob([d],{type:g}))})}function k(a){return 0===a.indexOf("blob:")?i(a):0===a.indexOf("data:")?j(a):null}function l(a,b){return j(a.toDataURL(b))}function m(b){return new a(function(a){var c=new FileReader;c.onloadend=function(){a(c.result)},c.readAsDataURL(b)})}function n(a){return m(a).then(function(a){return a.split(",")[1]})}function o(a){URL.revokeObjectURL(a.src)}return{blobToImage:h,imageToBlob:g,blobToDataUri:m,blobToBase64:n,imageToCanvas:f,canvasToBlob:l,revokeImageUrl:o,uriToBlob:k}}),g("q",[],function(){function a(a,b,c){return a=parseFloat(a),a>c?a=c:b>a&&(a=b),a}function b(){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]}function c(a,b){var c,d,e,f,g=[],h=new Array(10);for(c=0;5>c;c++){for(d=0;5>d;d++)g[d]=b[d+5*c];for(d=0;5>d;d++){for(f=0,e=0;5>e;e++)f+=a[d+5*e]*g[e];h[d+5*c]=f}}return h}function d(b,c){return c=a(c,0,1),b.map(function(b,d){return d%6===0?b=1-(1-b)*c:b*=c,a(b,0,1)})}function e(b,d){var e;return d=a(d,-1,1),d*=100,0>d?e=127+d/100*127:(e=d%1,e=0===e?l[d]:l[Math.floor(d)]*(1-e)+l[Math.floor(d)+1]*e,e=127*e+127),c(b,[e/127,0,0,0,.5*(127-e),0,e/127,0,0,.5*(127-e),0,0,e/127,0,.5*(127-e),0,0,0,1,0,0,0,0,0,1])}function f(b,d){var e,f,g,h;return d=a(d,-1,1),e=1+(d>0?3*d:d),f=.3086,g=.6094,h=.082,c(b,[f*(1-e)+e,g*(1-e),h*(1-e),0,0,f*(1-e),g*(1-e)+e,h*(1-e),0,0,f*(1-e),g*(1-e),h*(1-e)+e,0,0,0,0,0,1,0,0,0,0,0,1])}function g(b,d){var e,f,g,h,i;return d=a(d,-180,180)/180*Math.PI,e=Math.cos(d),f=Math.sin(d),g=.213,h=.715,i=.072,c(b,[g+e*(1-g)+f*-g,h+e*-h+f*-h,i+e*-i+f*(1-i),0,0,g+e*-g+.143*f,h+e*(1-h)+.14*f,i+e*-i+f*-.283,0,0,g+e*-g+f*-(1-g),h+e*-h+f*h,i+e*(1-i)+f*i,0,0,0,0,0,1,0,0,0,0,0,1])}function h(b,d){return d=a(255*d,-255,255),c(b,[1,0,0,0,d,0,1,0,0,d,0,0,1,0,d,0,0,0,1,0,0,0,0,0,1])}function i(b,d,e,f){return d=a(d,0,2),e=a(e,0,2),f=a(f,0,2),c(b,[d,0,0,0,0,0,e,0,0,0,0,0,f,0,0,0,0,0,1,0,0,0,0,0,1])}function j(b,e){return e=a(e,0,1),c(b,d([.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))}function k(b,e){return e=a(e,0,1),c(b,d([.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))}var l=[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];return{identity:b,adjust:d,multiply:c,adjustContrast:e,adjustBrightness:h,adjustSaturation:f,adjustHue:g,adjustColors:i,adjustSepia:j,adjustGrayscale:k}}),g("c",["m","n","e","q"],function(a,b,c,d){function e(d,e){return c.blobToImage(d).then(function(d){function f(a,b){var c,d,e,f,g,h=a.data,i=b[0],j=b[1],k=b[2],l=b[3],m=b[4],n=b[5],o=b[6],p=b[7],q=b[8],r=b[9],s=b[10],t=b[11],u=b[12],v=b[13],w=b[14],x=b[15],y=b[16],z=b[17],A=b[18],B=b[19];for(g=0;g<h.length;g+=4)c=h[g],d=h[g+1],e=h[g+2],f=h[g+3],h[g]=c*i+d*j+e*k+f*l+m,h[g+1]=c*n+d*o+e*p+f*q+r,h[g+2]=c*s+d*t+e*u+f*v+w,h[g+3]=c*x+d*y+e*z+f*A+B;return a}var g,h=a.create(b.getWidth(d),b.getHeight(d)),i=a.get2dContext(h);return i.drawImage(d,0,0),k(d),g=f(i.getImageData(0,0,h.width,h.height),e),i.putImageData(g,0,0),c.canvasToBlob(h)})}function f(d,e){return c.blobToImage(d).then(function(d){function f(a,b,c){function d(a,b,c){return a>c?a=c:b>a&&(a=b),a}var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;for(g=Math.round(Math.sqrt(c.length)),h=Math.floor(g/2),e=a.data,f=b.data,t=a.width,u=a.height,j=0;u>j;j++)for(i=0;t>i;i++){for(k=l=m=0,o=0;g>o;o++)for(n=0;g>n;n++)p=d(i+n-h,0,t-1),q=d(j+o-h,0,u-1),r=4*(q*t+p),s=c[o*g+n],k+=e[r]*s,l+=e[r+1]*s,m+=e[r+2]*s;r=4*(j*t+i),f[r]=d(k,0,255),f[r+1]=d(l,0,255),f[r+2]=d(m,0,255)}return b}var g,h,i=a.create(b.getWidth(d),b.getHeight(d)),j=a.get2dContext(i);return j.drawImage(d,0,0),k(d),g=j.getImageData(0,0,i.width,i.height),h=j.getImageData(0,0,i.width,i.height),h=f(g,h,e),j.putImageData(h,0,0),c.canvasToBlob(i)})}function g(d){return function(e,f){return c.blobToImage(e).then(function(e){function g(a,b){var c,d=a.data;for(c=0;c<d.length;c+=4)d[c]=b[d[c]],d[c+1]=b[d[c+1]],d[c+2]=b[d[c+2]];return a}var h,i,j=a.create(b.getWidth(e),b.getHeight(e)),l=a.get2dContext(j),m=new Array(256);for(i=0;i<m.length;i++)m[i]=d(i,f);return l.drawImage(e,0,0),k(e),h=g(l.getImageData(0,0,j.width,j.height),m),l.putImageData(h,0,0),c.canvasToBlob(j)})}}function h(a){return function(b,c){return e(b,a(d.identity(),c))}}function i(a){return function(b){return e(b,a)}}function j(a){return function(b){return f(b,a)}}var k=c.revokeImageUrl;return{invert:i([-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0]),brightness:h(d.adjustBrightness),hue:h(d.adjustHue),saturate:h(d.adjustSaturation),contrast:h(d.adjustContrast),grayscale:h(d.adjustGrayscale),sepia:h(d.adjustSepia),colorize:function(a,b,c,f){return e(a,d.adjustColors(d.identity(),b,c,f))},sharpen:j([0,-1,0,-1,5,-1,0,-1,0]),emboss:j([-2,-1,0,-1,1,1,0,1,2]),gamma:g(function(a,b){return 255*Math.pow(a/255,1-b)}),exposure:g(function(a,b){return 255*(1-Math.exp(-(a/255)*b))}),colorFilter:e,convoluteFilter:f}}),g("r",["o","e","m","n"],function(a,b,c,d){function e(a,b,c){var g=d.getWidth(a),h=d.getHeight(a),i=b/g,j=c/h,k=!1;(.5>i||i>2)&&(i=.5>i?.5:2,k=!0),(.5>j||j>2)&&(j=.5>j?.5:2,k=!0);var l=f(a,i,j);return k?l.then(function(a){return e(a,b,c)}):l}function f(b,e,f){return new a(function(a){var g=d.getWidth(b),h=d.getHeight(b),i=Math.floor(g*e),j=Math.floor(h*f),k=c.create(i,j),l=c.get2dContext(k);l.drawImage(b,0,0,g,h,0,0,i,j),a(k)})}return{scale:e}}),g("d",["e","m","n","r"],function(a,b,c,d){function e(d,e){return a.blobToImage(d).then(function(f){var g=b.create(c.getWidth(f),c.getHeight(f)),h=b.get2dContext(g),j=0,k=0;return e=0>e?360+e:e,90!=e&&270!=e||b.resize(g,g.height,g.width),90!=e&&180!=e||(j=g.width),270!=e&&180!=e||(k=g.height),h.translate(j,k),h.rotate(e*Math.PI/180),h.drawImage(f,0,0),i(f),a.canvasToBlob(g,d.type)})}function f(d,e){return a.blobToImage(d).then(function(d){var f=b.create(c.getWidth(d),c.getHeight(d)),g=b.get2dContext(f);return"v"==e?(g.scale(1,-1),g.drawImage(d,0,-f.height)):(g.scale(-1,1),g.drawImage(d,-f.width,0)),i(d),a.canvasToBlob(f)})}function g(c,d,e,f,g){return a.blobToImage(c).then(function(c){var h=b.create(f,g),j=b.get2dContext(h);return j.drawImage(c,-d,-e),i(c),a.canvasToBlob(h)})}function h(b,c,e){return a.blobToImage(b).then(function(f){var g;return g=d.scale(f,c,e).then(function(c){return a.canvasToBlob(c,b.type)}).then(j(f))["catch"](j(f))})}var i=a.revokeImageUrl,j=function(a){return function(b){return i(a),b}};return{rotate:e,flip:f,crop:g,resize:h}}),g("7",["c","d"],function(a,b){var c=function(b){return a.invert(b)},d=function(b){return a.sharpen(b)},e=function(b){return a.emboss(b)},f=function(b,c){return a.gamma(b,c)},g=function(b,c){return a.exposure(b,c)},h=function(b,c,d,e){return a.colorize(b,c,d,e)},i=function(b,c){return a.brightness(b,c)},j=function(b,c){return a.hue(b,c)},k=function(b,c){return a.saturate(b,c)},l=function(b,c){return a.contrast(b,c)},m=function(b,c){return a.grayscale(b,c)},n=function(b,c){return a.sepia(b,c)},o=function(a,c){return b.flip(a,c)},p=function(a,c,d,e,f){return b.crop(a,c,d,e,f)},q=function(a,c,d){return b.resize(a,c,d)},r=function(a,c){return b.rotate(a,c)};return{invert:c,sharpen:d,emboss:e,brightness:i,hue:j,saturate:k,contrast:l,grayscale:m,sepia:n,colorize:h,gamma:f,exposure:g,flip:o,crop:p,resize:q,rotate:r}}),g("8",["e"],function(a){var b=function(b){return a.blobToImage(b)},c=function(b){return a.imageToBlob(b)},d=function(b){return a.blobToDataUri(b)},e=function(b){return a.blobToBase64(b)};return{blobToImage:b,imageToBlob:c,blobToDataUri:d,blobToBase64:e}}),h("f",tinymce.dom.DOMUtils),h("g",tinymce.ui.Factory),h("h",tinymce.ui.Form),h("i",tinymce.ui.Container),h("s",tinymce.ui.Control),h("t",tinymce.ui.DragHelper),h("u",tinymce.geom.Rect),h("w",tinymce.dom.DomQuery),h("x",tinymce.util.Observable),h("y",tinymce.util.VK),g("v",["w","t","u","5","x","y"],function(a,b,c,d,e,f){var g=0;return function(h,i,j,k,l){function m(a,b){return{x:b.x+a.x,y:b.y+a.y,w:b.w,h:b.h}}function n(a,b){return{x:b.x-a.x,y:b.y-a.y,w:b.w,h:b.h}}function o(){return n(j,h)}function p(a,b,d,e){var f,g,i,k,l;f=b.x,g=b.y,i=b.w,k=b.h,f+=d*a.deltaX,g+=e*a.deltaY,i+=d*a.deltaW,k+=e*a.deltaH,20>i&&(i=20),20>k&&(k=20),l=h=c.clamp({x:f,y:g,w:i,h:k},j,"move"==a.name),l=n(j,l),y.fire("updateRect",{rect:l}),v(l)}function q(){function c(a){var c;return new b(D,{document:k.ownerDocument,handle:D+"-"+a.name,start:function(){c=h},drag:function(b){p(a,c,b.deltaX,b.deltaY)}})}a('<div id="'+D+'" class="'+C+'croprect-container" role="grid" aria-dropeffect="execute">').appendTo(k),d.each(B,function(b){a("#"+D,k).append('<div id="'+D+"-"+b+'"class="'+C+'croprect-block" style="display: none" data-mce-bogus="all">')}),d.each(z,function(b){a("#"+D,k).append('<div id="'+D+"-"+b.name+'" class="'+C+"croprect-handle "+C+"croprect-handle-"+b.name+'"style="display: none" data-mce-bogus="all" role="gridcell" tabindex="-1" aria-label="'+b.label+'" aria-grabbed="false">')}),A=d.map(z,c),s(h),a(k).on("focusin focusout",function(b){a(b.target).attr("aria-grabbed","focus"===b.type)}),a(k).on("keydown",function(a){function b(a,b,d,e,f){a.stopPropagation(),a.preventDefault(),p(c,d,e,f)}var c;switch(d.each(z,function(b){return a.target.id==D+"-"+b.name?(c=b,!1):void 0}),a.keyCode){case f.LEFT:b(a,c,h,-10,0);break;case f.RIGHT:b(a,c,h,10,0);break;case f.UP:b(a,c,h,0,-10);break;case f.DOWN:b(a,c,h,0,10);break;case f.ENTER:case f.SPACEBAR:a.preventDefault(),l()}})}function r(b){var c;c=d.map(z,function(a){return"#"+D+"-"+a.name}).concat(d.map(B,function(a){return"#"+D+"-"+a})).join(","),b?a(c,k).show():a(c,k).hide()}function s(b){function c(b,c){c.h<0&&(c.h=0),c.w<0&&(c.w=0),a("#"+D+"-"+b,k).css({left:c.x,top:c.y,width:c.w,height:c.h})}d.each(z,function(c){a("#"+D+"-"+c.name,k).css({left:b.w*c.xMul+b.x,top:b.h*c.yMul+b.y})}),c("top",{x:i.x,y:i.y,w:i.w,h:b.y-i.y}),c("right",{x:b.x+b.w,y:b.y,w:i.w-b.x-b.w+i.x,h:b.h}),c("bottom",{x:i.x,y:b.y+b.h,w:i.w,h:i.h-b.y-b.h+i.y}),c("left",{x:i.x,y:b.y,w:b.x-i.x,h:b.h}),c("move",b)}function t(a){h=a,s(h)}function u(a){i=a,s(h)}function v(a){t(m(j,a))}function w(a){j=a,s(h)}function x(){d.each(A,function(a){a.destroy()}),A=[]}var y,z,A,B,C="mce-",D=C+"crid-"+g++;return z=[{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"}],B=["top","right","bottom","left"],q(k),y=d.extend({toggleVisibility:r,setClampRect:w,setRect:t,getInnerRect:o,setInnerRect:v,setViewPortRect:u,destroy:x},e)}}),g("j",["s","t","u","5","3","v"],function(a,b,c,d,e,f){function g(a){return new e(function(b){function c(){a.removeEventListener("load",c),b(a)}a.complete?b(a):a.addEventListener("load",c)})}return a.extend({Defaults:{classes:"imagepanel"},selection:function(a){return arguments.length?(this.state.set("rect",a),this):this.state.get("rect")},imageSize:function(){var a=this.state.get("viewRect");return{w:a.w,h:a.h}},toggleCropRect:function(a){this.state.set("cropEnabled",a)},imageSrc:function(a){var b=this,d=new Image;d.src=a,g(d).then(function(){var a,e,f=b.state.get("viewRect");e=b.$el.find("img"),e[0]?e.replaceWith(d):b.getEl().appendChild(d),a={x:0,y:0,w:d.naturalWidth,h:d.naturalHeight},b.state.set("viewRect",a),b.state.set("rect",c.inflate(a,-20,-20)),f&&f.w==a.w&&f.h==a.h||b.zoomFit(),b.repaintImage(),b.fire("load")})},zoom:function(a){return arguments.length?(this.state.set("zoom",a),this):this.state.get("zoom")},postRender:function(){return this.imageSrc(this.settings.imageSrc),this._super()},zoomFit:function(){var a,b,c,d,e,f,g,h=this;g=10,a=h.$el.find("img"),b=h.getEl().clientWidth,c=h.getEl().clientHeight,d=a[0].naturalWidth,e=a[0].naturalHeight,f=Math.min((b-g)/d,(c-g)/e),f>=1&&(f=1),h.zoom(f)},repaintImage:function(){var a,b,c,d,e,f,g,h,i,j;j=this.getEl(),h=this.zoom(),i=this.state.get("rect"),g=this.$el.find("img"),e=j.offsetWidth,f=j.offsetHeight,c=g[0].naturalWidth*h,d=g[0].naturalHeight*h,a=Math.max(0,e/2-c/2),b=Math.max(0,f/2-d/2),g.css({left:a,top:b,width:c,height:d}),this.cropRect&&(this.cropRect.setRect({x:i.x*h+a,y:i.y*h+b,w:i.w*h,h:i.h*h}),this.cropRect.setClampRect({x:a,y:b,w:c,h:d}),this.cropRect.setViewPortRect({x:0,y:0,w:e,h:f}))},bindStates:function(){function a(a){b.cropRect=new f(a,b.state.get("viewRect"),b.state.get("viewRect"),b.getEl(),function(){b.fire("crop")}),b.cropRect.on("updateRect",function(a){var c=a.rect,d=b.zoom();c={x:Math.round(c.x/d),y:Math.round(c.y/d),w:Math.round(c.w/d),h:Math.round(c.h/d)},b.state.set("rect",c)}),b.on("remove",b.cropRect.destroy)}var b=this;b.state.on("change:cropEnabled",function(a){b.cropRect.toggleVisibility(a.value),b.repaintImage()}),b.state.on("change:zoom",function(){b.repaintImage()}),b.state.on("change:rect",function(c){var d=c.value;b.cropRect||a(d),b.cropRect.setRect(d)})}})}),g("k",[],function(){return function(){function a(a){var b;return b=f.splice(++g),f.push(a),{state:a,removed:b}}function b(){return d()?f[--g]:void 0}function c(){return e()?f[++g]:void 0}function d(){return g>0}function e(){return-1!=g&&g<f.length-1}var f=[],g=-1;return{data:f,add:a,undo:b,redo:c,canUndo:d,canRedo:e}}}),g("9",["f","5","3","g","h","i","j","7","8","k"],function(a,b,c,d,e,f,g,h,i,j){function k(a){return{blob:a,url:URL.createObjectURL(a)}}function l(a){a&&URL.revokeObjectURL(a.url)}function m(a){b.each(a,l)}function n(c,i,n){function o(a){var b,c,d,e;b=L.find("#w")[0],c=L.find("#h")[0],d=parseInt(b.value(),10),e=parseInt(c.value(),10),L.find("#constrain")[0].checked()&&ga&&ha&&d&&e&&("w"==a.control.settings.name?(e=Math.round(d*ia),c.value(e)):(d=Math.round(e*ja),b.value(d))),ga=d,ha=e}function p(a){return Math.round(100*a)+"%"}function q(){L.find("#undo").disabled(!ka.canUndo()),L.find("#redo").disabled(!ka.canRedo()),L.statusbar.find("#save").disabled(!ka.canUndo())}function r(){L.find("#undo").disabled(!0),L.find("#redo").disabled(!0)}function s(a){a&&S.imageSrc(a.url)}function t(a){return function(){var c=b.grep(fa,function(b){return b.settings.name!=a});b.each(c,function(a){a.hide()}),a.show(),a.focus()}}function u(a){O=k(a),s(O)}function v(a){c=k(a),s(c),m(ka.add(c).removed),q()}function w(){var a=S.selection();h.crop(c.blob,a.x,a.y,a.w,a.h).then(function(a){v(a),z()})}function x(a){var b=[].slice.call(arguments,1);return function(){var d=O||c;a.apply(this,[d.blob].concat(b)).then(u)}}function y(a){var b=[].slice.call(arguments,1);return function(){a.apply(this,[c.blob].concat(b)).then(v)}}function z(){s(c),l(O),t(M)(),q()}function A(){O&&(v(O.blob),z())}function B(){var a=S.zoom();2>a&&(a+=.1),S.zoom(a)}function C(){var a=S.zoom();a>.1&&(a-=.1),S.zoom(a)}function D(){c=ka.undo(),s(c),q()}function E(){c=ka.redo(),s(c),q()}function F(){i(c.blob),L.close()}function G(a){return new e({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:a})}function H(a,b){return G([{text:"Back",onclick:z},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:A}]).hide().on("show",function(){r(),b(c.blob).then(function(a){var b=k(a);s(b),l(O),O=b})})}function I(a,b,d,e,f){function g(a){b(c.blob,a).then(function(a){var b=k(a);s(b),l(O),O=b})}return G([{text:"Back",onclick:z},{type:"spacer",flex:1},{type:"slider",flex:1,ondragend:function(a){g(a.value)},minValue:e,maxValue:f,value:d,previewFilter:p},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:A}]).hide().on("show",function(){this.find("slider").value(d),r()})}function J(a,b){function d(){var a,d,e;a=L.find("#r")[0].value(),d=L.find("#g")[0].value(),e=L.find("#b")[0].value(),b(c.blob,a,d,e).then(function(a){var b=k(a);s(b),l(O),O=b})}return G([{text:"Back",onclick:z},{type:"spacer",flex:1},{type:"slider",label:"R",name:"r",minValue:0,value:1,maxValue:2,ondragend:d,previewFilter:p},{type:"slider",label:"G",name:"g",minValue:0,value:1,maxValue:2,ondragend:d,previewFilter:p},{type:"slider",label:"B",name:"b",minValue:0,value:1,maxValue:2,ondragend:d,previewFilter:p},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:A}]).hide().on("show",function(){L.find("#r,#g,#b").value(1),r()})}function K(a){a.control.value()===!0&&(ia=ha/ga,ja=ga/ha)}var L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka=new j;P=G([{text:"Back",onclick:z},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:w}]).hide().on("show hide",function(a){S.toggleCropRect("show"==a.type)}).on("show",r),Q=G([{text:"Back",onclick:z},{type:"spacer",flex:1},{type:"textbox",name:"w",label:"Width",size:4,onkeyup:o},{type:"textbox",name:"h",label:"Height",size:4,onkeyup:o},{type:"checkbox",name:"constrain",text:"Constrain proportions",checked:!0,onchange:K},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:"submit"}]).hide().on("submit",function(a){var b=parseInt(L.find("#w").value(),10),c=parseInt(L.find("#h").value(),10);a.preventDefault(),y(h.resize,b,c)(),z()}).on("show",r),R=G([{text:"Back",onclick:z},{type:"spacer",flex:1},{icon:"fliph",tooltip:"Flip horizontally",onclick:x(h.flip,"h")},{icon:"flipv",tooltip:"Flip vertically",onclick:x(h.flip,"v")},{icon:"rotateleft",tooltip:"Rotate counterclockwise",onclick:x(h.rotate,-90)},{icon:"rotateright",tooltip:"Rotate clockwise",onclick:x(h.rotate,90)},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:A}]).hide().on("show",r),V=H("Invert",h.invert),ba=H("Sharpen",h.sharpen),ca=H("Emboss",h.emboss),W=I("Brightness",h.brightness,0,-1,1),X=I("Hue",h.hue,180,0,360),Y=I("Saturate",h.saturate,0,-1,1),Z=I("Contrast",h.contrast,0,-1,1),$=I("Grayscale",h.grayscale,0,0,1),_=I("Sepia",h.sepia,0,0,1),aa=J("Colorize",h.colorize),da=I("Gamma",h.gamma,0,-1,1),ea=I("Exposure",h.exposure,1,0,2),N=G([{text:"Back",onclick:z},{type:"spacer",flex:1},{text:"hue",icon:"hue",onclick:t(X)},{text:"saturate",icon:"saturate",onclick:t(Y)},{text:"sepia",icon:"sepia",onclick:t(_)},{text:"emboss",icon:"emboss",onclick:t(ca)},{text:"exposure",icon:"exposure",onclick:t(ea)},{type:"spacer",flex:1}]).hide(),M=G([{tooltip:"Crop",icon:"crop",onclick:t(P)},{tooltip:"Resize",icon:"resize2",onclick:t(Q)},{tooltip:"Orientation",icon:"orientation",onclick:t(R)},{tooltip:"Brightness",icon:"sun",onclick:t(W)},{tooltip:"Sharpen",icon:"sharpen",onclick:t(ba)},{tooltip:"Contrast",icon:"contrast",onclick:t(Z)},{tooltip:"Color levels",icon:"drop",onclick:t(aa)},{tooltip:"Gamma",icon:"gamma",onclick:t(da)},{tooltip:"Invert",icon:"invert",onclick:t(V)}]),S=new g({flex:1,imageSrc:c.url}),T=new f({layout:"flex",direction:"column",border:"0 1 0 0",padding:5,spacing:5,items:[{type:"button",icon:"undo",tooltip:"Undo",name:"undo",onclick:D},{type:"button",icon:"redo",tooltip:"Redo",name:"redo",onclick:E},{type:"button",icon:"zoomin",tooltip:"Zoom in",onclick:B},{type:"button",icon:"zoomout",tooltip:"Zoom out",onclick:C}]}),U=new f({type:"container",layout:"flex",direction:"row",align:"stretch",flex:1,items:[T,S]}),fa=[M,P,Q,R,N,V,W,X,Y,Z,$,_,aa,ba,ca,da,ea],L=d.create("window",{layout:"flex",direction:"column",align:"stretch",minWidth:Math.min(a.DOM.getViewPort().w,800),minHeight:Math.min(a.DOM.getViewPort().h,650),title:"Edit image",items:fa.concat([U]),buttons:[{text:"Save",name:"save",subtype:"primary",onclick:F},{text:"Cancel",onclick:"close"}]}),L.renderTo(document.body).reflow(),L.on("close",function(){n(),m(ka.data),ka=null,O=null}),ka.add(c),q(),S.on("load",function(){ga=S.imageSize().w,ha=S.imageSize().h,ia=ha/ga,ja=ga/ha,L.find("#w").value(ga),L.find("#h").value(ha)}),S.on("crop",w)}function o(a){return new c(function(b,c){n(k(a),b,c)})}return{edit:o}}),g("a",[],function(){function a(a){function b(a){return/^[0-9\.]+px$/.test(a)}var c,d;return c=a.style.width,d=a.style.height,c||d?b(c)&&b(d)?{w:parseInt(c,10),h:parseInt(d,10)}:null:(c=a.width,d=a.height,c&&d?{w:parseInt(c,10),h:parseInt(d,10)}:null)}function b(a,b){var c,d;b&&(c=a.style.width,d=a.style.height,(c||d)&&(a.style.width=b.w+"px",a.style.height=b.h+"px",a.removeAttribute("data-mce-style")),c=a.width,d=a.height,(c||d)&&(a.setAttribute("width",b.w),a.setAttribute("height",b.h)))}function c(a){return{w:a.naturalWidth,h:a.naturalHeight}}return{getImageSize:a,setImageSize:b,getNaturalImageSize:c}}),g("l",["3","5"],function(a,b){var c=function(a){return null!==a&&void 0!==a},d=function(a,b){var d;return d=b.reduce(function(a,b){return c(a)?a[b]:void 0},a),c(d)?d:null},e=function(c,d){return new a(function(a){var e;e=new XMLHttpRequest,e.onreadystatechange=function(){4===e.readyState&&a({status:e.status,blob:this.response})},e.open("GET",c,!0),b.each(d,function(a,b){e.setRequestHeader(b,a)}),e.responseType="blob",e.send()})},f=function(b){return new a(function(a){var c=new FileReader;c.onload=function(b){var c=b.target;a(c.result)},c.readAsText(b)})},g=function(a){var b;try{b=JSON.parse(a)}catch(c){}return b};return{traverse:d,readBlob:f,requestUrlAsBlob:e,parseJson:g}}),g("b",["3","5","l"],function(a,b,c){function d(b){return c.requestUrlAsBlob(b,{}).then(function(b){return b.status>=400?f(b.status):a.resolve(b.blob)})}var e=function(a){return 400===a||403===a||500===a},f=function(b){return a.reject("ImageProxy HTTP error: "+b)},g=function(b){a.reject("ImageProxy Service error: "+b)},h=function(a,b){return c.readBlob(b).then(function(a){var b=c.parseJson(a),d=c.traverse(b,["error","type"]);return g(d?d:"Invalid JSON")})},i=function(a,b){return e(a)?h(a,b):f(a)},j=function(b,d){return c.requestUrlAsBlob(b,{"Content-Type":"application/json;charset=UTF-8","tiny-api-key":d}).then(function(b){return b.status>=400?i(b.status,b.blob):a.resolve(b.blob)})},k=function(a,b){return b?j(a,b):d(a)};return{getUrl:k}}),g("0",["1","2","3","4","5","6","7","8","9","a","b"],function(a,b,c,d,e,f,g,h,i,j,k){var l=function(a){function l(b){a.notificationManager.open({text:b,type:"error"})}function m(){return a.selection.getNode()}function n(){return"imagetools"+G++}function o(b){var c=b.src;return 0===c.indexOf("data:")||0===c.indexOf("blob:")||new d(c).host===a.documentBaseURI.host}function p(b){return-1!==e.inArray(a.settings.imagetools_cors_hosts,new d(b.src).host)}function q(){return a.settings.api_key||a.settings.imagetools_api_key}function r(b){var c,d=b.src;return p(b)?k.getUrl(b.src,null):o(b)?h.imageToBlob(b):(d=a.settings.imagetools_proxy,d+=(-1===d.indexOf("?")?"?":"&")+"url="+encodeURIComponent(b.src),c=q(),k.getUrl(d,c))}function s(){var b;return b=a.editorUpload.blobCache.getByUri(m().src),b?b.blob():r(m())}function t(){E=f.setEditorTimeout(a,function(){a.editorUpload.uploadImagesAuto()},3e4)}function u(){clearTimeout(E)}function v(b,c){return h.blobToDataUri(b).then(function(e){var f,g,h,i,j;return j=m(),f=n(),h=a.editorUpload.blobCache,g=d.parseDataUri(e).data,i=h.create(f,b,g),h.add(i),a.undoManager.transact(function(){function b(){a.$(j).off("load",b),a.nodeChanged(),c?a.editorUpload.uploadImagesAuto():(u(),t())}a.$(j).on("load",b),a.$(j).attr({src:i.blobUri()}).removeAttr("data-mce-src")}),i})}function w(b){return function(){return a._scanForImages().then(s).then(b).then(v,l)}}function x(a){return function(){return w(function(b){var c=j.getImageSize(m());return c&&j.setImageSize(m(),{w:c.h,h:c.w}),g.rotate(b,a)})()}}function y(a){return function(){return w(function(b){return g.flip(b,a)})()}}function z(){var a=m(),b=j.getNaturalImageSize(a),d=function(d){return new c(function(c){h.blobToImage(d).then(function(e){var f=j.getNaturalImageSize(e);b.w==f.w&&b.h==f.h||j.getImageSize(a)&&j.setImageSize(a,f),URL.revokeObjectURL(e.src),c(d)})})},e=function(a){return i.edit(a).then(d).then(function(a){v(a,!0)},function(){})};a&&r(a).then(e,l)}function A(){a.addButton("rotateleft",{title:"Rotate counterclockwise",onclick:x(-90)}),a.addButton("rotateright",{title:"Rotate clockwise",onclick:x(90)}),a.addButton("flipv",{title:"Flip vertically",onclick:y("v")}),a.addButton("fliph",{title:"Flip horizontally",onclick:y("h")}),a.addButton("editimage",{title:"Edit image",onclick:z}),a.addButton("imageoptions",{title:"Image options",icon:"options",cmd:"mceImage"})}function B(){a.on("NodeChange",function(b){F&&F.src!=b.element.src&&(u(),a.editorUpload.uploadImagesAuto(),F=void 0),C(b.element)&&(F=b.element)})}function C(b){var c=a.dom.is(b,"img:not([data-mce-object],[data-mce-placeholder])");return c&&(o(b)||p(b)||a.settings.imagetools_proxy)}function D(){var b=a.settings.imagetools_toolbar;b||(b="rotateleft rotateright | flipv fliph | crop editimage imageoptions"),a.addContextToolbar(C,b)}var E,F,G=0;b.fileApi&&(A(),D(),B(),a.addCommand("mceEditImage",z))};return a.add("imagetools",l),function(){}}),d("0")()}();
|
1
|
+
!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i<g;++i)h[i]=d(e[i]);var j=f.apply(null,h);if(void 0===j)throw"module ["+b+"] returned undefined";c.instance=j},c=function(b,c,d){if("string"!=typeof b)throw"module id must be a string";if(void 0===c)throw"no dependencies for "+b;if(void 0===d)throw"no definition function for "+b;a[b]={deps:c,defn:d,instance:void 0}},d=function(c){var d=a[c];if(void 0===d)throw"module ["+c+"] was undefined";return void 0===d.instance&&b(c),d.instance},e=function(a,b){for(var c=a.length,e=new Array(c),f=0;f<c;++f)e.push(d(a[f]));b.apply(null,b)},f={};f.bolt={module:{api:{define:c,require:e,demand:d}}};var g=c,h=function(a,b){g(a,[],function(){return b})};h("1",tinymce.PluginManager),h("2",tinymce.Env),h("3",tinymce.util.Promise),h("4",tinymce.util.URI),h("5",tinymce.util.Tools),h("6",tinymce.util.Delay),g("m",[],function(){function a(a,b){return d(document.createElement("canvas"),a,b)}function b(a){return a.getContext("2d")}function c(a){var b=null;try{b=a.getContext("webgl")||a.getContext("experimental-webgl")}catch(a){}return b||(b=null),b}function d(a,b,c){return a.width=b,a.height=c,a}return{create:a,resize:d,get2dContext:b,get3dContext:c}}),g("n",[],function(){function a(a){return a.naturalWidth||a.width}function b(a){return a.naturalHeight||a.height}return{getWidth:a,getHeight:b}}),g("o",[],function(){function a(a,b){return function(){a.apply(b,arguments)}}function b(b){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof b)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],h(b,a(d,this),a(e,this))}function c(a){var b=this;return null===this._state?void this._deferreds.push(a):void i(function(){var c=b._state?a.onFulfilled:a.onRejected;if(null===c)return void(b._state?a.resolve:a.reject)(b._value);var d;try{d=c(b._value)}catch(b){return void a.reject(b)}a.resolve(d)})}function d(b){try{if(b===this)throw new TypeError("A promise cannot be resolved with itself.");if(b&&("object"==typeof b||"function"==typeof b)){var c=b.then;if("function"==typeof c)return void h(a(c,b),a(d,this),a(e,this))}this._state=!0,this._value=b,f.call(this)}catch(a){e.call(this,a)}}function e(a){this._state=!1,this._value=a,f.call(this)}function f(){for(var a=0,b=this._deferreds.length;a<b;a++)c.call(this,this._deferreds[a]);this._deferreds=null}function g(a,b,c,d){this.onFulfilled="function"==typeof a?a:null,this.onRejected="function"==typeof b?b:null,this.resolve=c,this.reject=d}function h(a,b,c){var d=!1;try{a(function(a){d||(d=!0,b(a))},function(a){d||(d=!0,c(a))})}catch(a){if(d)return;d=!0,c(a)}}if(window.Promise)return window.Promise;var i=b.immediateFn||"function"==typeof setImmediate&&setImmediate||function(a){setTimeout(a,1)},j=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)};return b.prototype.catch=function(a){return this.then(null,a)},b.prototype.then=function(a,d){var e=this;return new b(function(b,f){c.call(e,new g(a,d,b,f))})},b.all=function(){var a=Array.prototype.slice.call(1===arguments.length&&j(arguments[0])?arguments[0]:arguments);return new b(function(b,c){function d(f,g){try{if(g&&("object"==typeof g||"function"==typeof g)){var h=g.then;if("function"==typeof h)return void h.call(g,function(a){d(f,a)},c)}a[f]=g,0===--e&&b(a)}catch(a){c(a)}}if(0===a.length)return b([]);for(var e=a.length,f=0;f<a.length;f++)d(f,a[f])})},b.resolve=function(a){return a&&"object"==typeof a&&a.constructor===b?a:new b(function(b){b(a)})},b.reject=function(a){return new b(function(b,c){c(a)})},b.race=function(a){return new b(function(b,c){for(var d=0,e=a.length;d<e;d++)a[d].then(b,c)})},b}),g("p",[],function(){function a(a){var b=document.createElement("a");return b.href=a,b.pathname}function b(b){var c=a(b).split("."),d=c[c.length-1],e={jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png"};return d&&(d=d.toLowerCase()),e[d]}return{guessMimeType:b}}),g("e",["o","m","p","n"],function(a,b,c,d){function e(b){return new a(function(a){function c(){b.removeEventListener("load",c),a(b)}b.complete?a(b):b.addEventListener("load",c)})}function f(a){return e(a).then(function(a){var c,e;return e=b.create(d.getWidth(a),d.getHeight(a)),c=b.get2dContext(e),c.drawImage(a,0,0),e})}function g(a){return e(a).then(function(a){var b=a.src;return 0===b.indexOf("blob:")?i(b):0===b.indexOf("data:")?j(b):f(a).then(function(a){return j(a.toDataURL(c.guessMimeType(b)))})})}function h(b){return new a(function(a){function c(){d.removeEventListener("load",c),a(d)}var d=new Image;d.addEventListener("load",c),d.src=URL.createObjectURL(b),d.complete&&c()})}function i(b){return new a(function(a){var c=new XMLHttpRequest;c.open("GET",b,!0),c.responseType="blob",c.onload=function(){200==this.status&&a(this.response)},c.send()})}function j(b){return new a(function(a){var c,d,e,f,g,h;if(b=b.split(","),f=/data:([^;]+)/.exec(b[0]),f&&(g=f[1]),c=atob(b[1]),window.WebKitBlobBuilder){for(h=new WebKitBlobBuilder,d=new ArrayBuffer(c.length),e=0;e<d.length;e++)d[e]=c.charCodeAt(e);return h.append(d),void a(h.getBlob(g))}for(d=new Uint8Array(c.length),e=0;e<d.length;e++)d[e]=c.charCodeAt(e);a(new Blob([d],{type:g}))})}function k(a){return 0===a.indexOf("blob:")?i(a):0===a.indexOf("data:")?j(a):null}function l(a,b){return j(a.toDataURL(b))}function m(b){return new a(function(a){var c=new FileReader;c.onloadend=function(){a(c.result)},c.readAsDataURL(b)})}function n(a){return m(a).then(function(a){return a.split(",")[1]})}function o(a){URL.revokeObjectURL(a.src)}return{blobToImage:h,imageToBlob:g,blobToDataUri:m,blobToBase64:n,imageToCanvas:f,canvasToBlob:l,revokeImageUrl:o,uriToBlob:k}}),g("q",[],function(){function a(a,b,c){return a=parseFloat(a),a>c?a=c:a<b&&(a=b),a}function b(){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]}function c(a,b){var c,d,e,f,g=[],h=new Array(10);for(c=0;c<5;c++){for(d=0;d<5;d++)g[d]=b[d+5*c];for(d=0;d<5;d++){for(f=0,e=0;e<5;e++)f+=a[d+5*e]*g[e];h[d+5*c]=f}}return h}function d(b,c){return c=a(c,0,1),b.map(function(b,d){return d%6===0?b=1-(1-b)*c:b*=c,a(b,0,1)})}function e(b,d){var e;return d=a(d,-1,1),d*=100,d<0?e=127+d/100*127:(e=d%1,e=0===e?l[d]:l[Math.floor(d)]*(1-e)+l[Math.floor(d)+1]*e,e=127*e+127),c(b,[e/127,0,0,0,.5*(127-e),0,e/127,0,0,.5*(127-e),0,0,e/127,0,.5*(127-e),0,0,0,1,0,0,0,0,0,1])}function f(b,d){var e,f,g,h;return d=a(d,-1,1),e=1+(d>0?3*d:d),f=.3086,g=.6094,h=.082,c(b,[f*(1-e)+e,g*(1-e),h*(1-e),0,0,f*(1-e),g*(1-e)+e,h*(1-e),0,0,f*(1-e),g*(1-e),h*(1-e)+e,0,0,0,0,0,1,0,0,0,0,0,1])}function g(b,d){var e,f,g,h,i;return d=a(d,-180,180)/180*Math.PI,e=Math.cos(d),f=Math.sin(d),g=.213,h=.715,i=.072,c(b,[g+e*(1-g)+f*-g,h+e*-h+f*-h,i+e*-i+f*(1-i),0,0,g+e*-g+.143*f,h+e*(1-h)+.14*f,i+e*-i+f*-.283,0,0,g+e*-g+f*-(1-g),h+e*-h+f*h,i+e*(1-i)+f*i,0,0,0,0,0,1,0,0,0,0,0,1])}function h(b,d){return d=a(255*d,-255,255),c(b,[1,0,0,0,d,0,1,0,0,d,0,0,1,0,d,0,0,0,1,0,0,0,0,0,1])}function i(b,d,e,f){return d=a(d,0,2),e=a(e,0,2),f=a(f,0,2),c(b,[d,0,0,0,0,0,e,0,0,0,0,0,f,0,0,0,0,0,1,0,0,0,0,0,1])}function j(b,e){return e=a(e,0,1),c(b,d([.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))}function k(b,e){return e=a(e,0,1),c(b,d([.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))}var l=[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];return{identity:b,adjust:d,multiply:c,adjustContrast:e,adjustBrightness:h,adjustSaturation:f,adjustHue:g,adjustColors:i,adjustSepia:j,adjustGrayscale:k}}),g("c",["m","n","e","q"],function(a,b,c,d){function e(d,e){return c.blobToImage(d).then(function(d){function f(a,b){var c,d,e,f,g,h=a.data,i=b[0],j=b[1],k=b[2],l=b[3],m=b[4],n=b[5],o=b[6],p=b[7],q=b[8],r=b[9],s=b[10],t=b[11],u=b[12],v=b[13],w=b[14],x=b[15],y=b[16],z=b[17],A=b[18],B=b[19];for(g=0;g<h.length;g+=4)c=h[g],d=h[g+1],e=h[g+2],f=h[g+3],h[g]=c*i+d*j+e*k+f*l+m,h[g+1]=c*n+d*o+e*p+f*q+r,h[g+2]=c*s+d*t+e*u+f*v+w,h[g+3]=c*x+d*y+e*z+f*A+B;return a}var g,h=a.create(b.getWidth(d),b.getHeight(d)),i=a.get2dContext(h);return i.drawImage(d,0,0),k(d),g=f(i.getImageData(0,0,h.width,h.height),e),i.putImageData(g,0,0),c.canvasToBlob(h)})}function f(d,e){return c.blobToImage(d).then(function(d){function f(a,b,c){function d(a,b,c){return a>c?a=c:a<b&&(a=b),a}var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;for(g=Math.round(Math.sqrt(c.length)),h=Math.floor(g/2),e=a.data,f=b.data,t=a.width,u=a.height,j=0;j<u;j++)for(i=0;i<t;i++){for(k=l=m=0,o=0;o<g;o++)for(n=0;n<g;n++)p=d(i+n-h,0,t-1),q=d(j+o-h,0,u-1),r=4*(q*t+p),s=c[o*g+n],k+=e[r]*s,l+=e[r+1]*s,m+=e[r+2]*s;r=4*(j*t+i),f[r]=d(k,0,255),f[r+1]=d(l,0,255),f[r+2]=d(m,0,255)}return b}var g,h,i=a.create(b.getWidth(d),b.getHeight(d)),j=a.get2dContext(i);return j.drawImage(d,0,0),k(d),g=j.getImageData(0,0,i.width,i.height),h=j.getImageData(0,0,i.width,i.height),h=f(g,h,e),j.putImageData(h,0,0),c.canvasToBlob(i)})}function g(d){return function(e,f){return c.blobToImage(e).then(function(e){function g(a,b){var c,d=a.data;for(c=0;c<d.length;c+=4)d[c]=b[d[c]],d[c+1]=b[d[c+1]],d[c+2]=b[d[c+2]];return a}var h,i,j=a.create(b.getWidth(e),b.getHeight(e)),l=a.get2dContext(j),m=new Array(256);for(i=0;i<m.length;i++)m[i]=d(i,f);return l.drawImage(e,0,0),k(e),h=g(l.getImageData(0,0,j.width,j.height),m),l.putImageData(h,0,0),c.canvasToBlob(j)})}}function h(a){return function(b,c){return e(b,a(d.identity(),c))}}function i(a){return function(b){return e(b,a)}}function j(a){return function(b){return f(b,a)}}var k=c.revokeImageUrl;return{invert:i([-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0]),brightness:h(d.adjustBrightness),hue:h(d.adjustHue),saturate:h(d.adjustSaturation),contrast:h(d.adjustContrast),grayscale:h(d.adjustGrayscale),sepia:h(d.adjustSepia),colorize:function(a,b,c,f){return e(a,d.adjustColors(d.identity(),b,c,f))},sharpen:j([0,-1,0,-1,5,-1,0,-1,0]),emboss:j([-2,-1,0,-1,1,1,0,1,2]),gamma:g(function(a,b){return 255*Math.pow(a/255,1-b)}),exposure:g(function(a,b){return 255*(1-Math.exp(-(a/255)*b))}),colorFilter:e,convoluteFilter:f}}),g("r",["o","e","m","n"],function(a,b,c,d){function e(a,b,c){var g=d.getWidth(a),h=d.getHeight(a),i=b/g,j=c/h,k=!1;(i<.5||i>2)&&(i=i<.5?.5:2,k=!0),(j<.5||j>2)&&(j=j<.5?.5:2,k=!0);var l=f(a,i,j);return k?l.then(function(a){return e(a,b,c)}):l}function f(b,e,f){return new a(function(a){var g=d.getWidth(b),h=d.getHeight(b),i=Math.floor(g*e),j=Math.floor(h*f),k=c.create(i,j),l=c.get2dContext(k);l.drawImage(b,0,0,g,h,0,0,i,j),a(k)})}return{scale:e}}),g("d",["e","m","n","r"],function(a,b,c,d){function e(d,e){return a.blobToImage(d).then(function(f){var g=b.create(c.getWidth(f),c.getHeight(f)),h=b.get2dContext(g),j=0,k=0;return e=e<0?360+e:e,90!=e&&270!=e||b.resize(g,g.height,g.width),90!=e&&180!=e||(j=g.width),270!=e&&180!=e||(k=g.height),h.translate(j,k),h.rotate(e*Math.PI/180),h.drawImage(f,0,0),i(f),a.canvasToBlob(g,d.type)})}function f(d,e){return a.blobToImage(d).then(function(d){var f=b.create(c.getWidth(d),c.getHeight(d)),g=b.get2dContext(f);return"v"==e?(g.scale(1,-1),g.drawImage(d,0,-f.height)):(g.scale(-1,1),g.drawImage(d,-f.width,0)),i(d),a.canvasToBlob(f)})}function g(c,d,e,f,g){return a.blobToImage(c).then(function(c){var h=b.create(f,g),j=b.get2dContext(h);return j.drawImage(c,-d,-e),i(c),a.canvasToBlob(h)})}function h(b,c,e){return a.blobToImage(b).then(function(f){var g;return g=d.scale(f,c,e).then(function(c){return a.canvasToBlob(c,b.type)}).then(j(f)).catch(j(f))})}var i=a.revokeImageUrl,j=function(a){return function(b){return i(a),b}};return{rotate:e,flip:f,crop:g,resize:h}}),g("7",["c","d"],function(a,b){var c=function(b){return a.invert(b)},d=function(b){return a.sharpen(b)},e=function(b){return a.emboss(b)},f=function(b,c){return a.gamma(b,c)},g=function(b,c){return a.exposure(b,c)},h=function(b,c,d,e){return a.colorize(b,c,d,e)},i=function(b,c){return a.brightness(b,c)},j=function(b,c){return a.hue(b,c)},k=function(b,c){return a.saturate(b,c)},l=function(b,c){return a.contrast(b,c)},m=function(b,c){return a.grayscale(b,c)},n=function(b,c){return a.sepia(b,c)},o=function(a,c){return b.flip(a,c)},p=function(a,c,d,e,f){return b.crop(a,c,d,e,f)},q=function(a,c,d){return b.resize(a,c,d)},r=function(a,c){return b.rotate(a,c)};return{invert:c,sharpen:d,emboss:e,brightness:i,hue:j,saturate:k,contrast:l,grayscale:m,sepia:n,colorize:h,gamma:f,exposure:g,flip:o,crop:p,resize:q,rotate:r}}),g("8",["e"],function(a){var b=function(b){return a.blobToImage(b)},c=function(b){return a.imageToBlob(b)},d=function(b){return a.blobToDataUri(b)},e=function(b){return a.blobToBase64(b)};return{blobToImage:b,imageToBlob:c,blobToDataUri:d,blobToBase64:e}}),h("f",tinymce.dom.DOMUtils),h("g",tinymce.ui.Factory),h("h",tinymce.ui.Form),h("i",tinymce.ui.Container),h("s",tinymce.ui.Control),h("t",tinymce.ui.DragHelper),h("u",tinymce.geom.Rect),h("w",tinymce.dom.DomQuery),h("x",tinymce.util.Observable),h("y",tinymce.util.VK),g("v",["w","t","u","5","x","y"],function(a,b,c,d,e,f){var g=0;return function(h,i,j,k,l){function m(a,b){return{x:b.x+a.x,y:b.y+a.y,w:b.w,h:b.h}}function n(a,b){return{x:b.x-a.x,y:b.y-a.y,w:b.w,h:b.h}}function o(){return n(j,h)}function p(a,b,d,e){var f,g,i,k,l;f=b.x,g=b.y,i=b.w,k=b.h,f+=d*a.deltaX,g+=e*a.deltaY,i+=d*a.deltaW,k+=e*a.deltaH,i<20&&(i=20),k<20&&(k=20),l=h=c.clamp({x:f,y:g,w:i,h:k},j,"move"==a.name),l=n(j,l),y.fire("updateRect",{rect:l}),v(l)}function q(){function c(a){var c;return new b(D,{document:k.ownerDocument,handle:D+"-"+a.name,start:function(){c=h},drag:function(b){p(a,c,b.deltaX,b.deltaY)}})}a('<div id="'+D+'" class="'+C+'croprect-container" role="grid" aria-dropeffect="execute">').appendTo(k),d.each(B,function(b){a("#"+D,k).append('<div id="'+D+"-"+b+'"class="'+C+'croprect-block" style="display: none" data-mce-bogus="all">')}),d.each(z,function(b){a("#"+D,k).append('<div id="'+D+"-"+b.name+'" class="'+C+"croprect-handle "+C+"croprect-handle-"+b.name+'"style="display: none" data-mce-bogus="all" role="gridcell" tabindex="-1" aria-label="'+b.label+'" aria-grabbed="false">')}),A=d.map(z,c),s(h),a(k).on("focusin focusout",function(b){a(b.target).attr("aria-grabbed","focus"===b.type)}),a(k).on("keydown",function(a){function b(a,b,d,e,f){a.stopPropagation(),a.preventDefault(),p(c,d,e,f)}var c;switch(d.each(z,function(b){if(a.target.id==D+"-"+b.name)return c=b,!1}),a.keyCode){case f.LEFT:b(a,c,h,-10,0);break;case f.RIGHT:b(a,c,h,10,0);break;case f.UP:b(a,c,h,0,-10);break;case f.DOWN:b(a,c,h,0,10);break;case f.ENTER:case f.SPACEBAR:a.preventDefault(),l()}})}function r(b){var c;c=d.map(z,function(a){return"#"+D+"-"+a.name}).concat(d.map(B,function(a){return"#"+D+"-"+a})).join(","),b?a(c,k).show():a(c,k).hide()}function s(b){function c(b,c){c.h<0&&(c.h=0),c.w<0&&(c.w=0),a("#"+D+"-"+b,k).css({left:c.x,top:c.y,width:c.w,height:c.h})}d.each(z,function(c){a("#"+D+"-"+c.name,k).css({left:b.w*c.xMul+b.x,top:b.h*c.yMul+b.y})}),c("top",{x:i.x,y:i.y,w:i.w,h:b.y-i.y}),c("right",{x:b.x+b.w,y:b.y,w:i.w-b.x-b.w+i.x,h:b.h}),c("bottom",{x:i.x,y:b.y+b.h,w:i.w,h:i.h-b.y-b.h+i.y}),c("left",{x:i.x,y:b.y,w:b.x-i.x,h:b.h}),c("move",b)}function t(a){h=a,s(h)}function u(a){i=a,s(h)}function v(a){t(m(j,a))}function w(a){j=a,s(h)}function x(){d.each(A,function(a){a.destroy()}),A=[]}var y,z,A,B,C="mce-",D=C+"crid-"+g++;return z=[{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"}],B=["top","right","bottom","left"],q(k),y=d.extend({toggleVisibility:r,setClampRect:w,setRect:t,getInnerRect:o,setInnerRect:v,setViewPortRect:u,destroy:x},e)}}),g("j",["s","t","u","5","3","v"],function(a,b,c,d,e,f){function g(a){return new e(function(b){function c(){a.removeEventListener("load",c),b(a)}a.complete?b(a):a.addEventListener("load",c)})}return a.extend({Defaults:{classes:"imagepanel"},selection:function(a){return arguments.length?(this.state.set("rect",a),this):this.state.get("rect")},imageSize:function(){var a=this.state.get("viewRect");return{w:a.w,h:a.h}},toggleCropRect:function(a){this.state.set("cropEnabled",a)},imageSrc:function(a){var b=this,d=new Image;d.src=a,g(d).then(function(){var a,e,f=b.state.get("viewRect");if(e=b.$el.find("img"),e[0])e.replaceWith(d);else{var g=document.createElement("div");g.className="mce-imagepanel-bg",b.getEl().appendChild(g),b.getEl().appendChild(d)}a={x:0,y:0,w:d.naturalWidth,h:d.naturalHeight},b.state.set("viewRect",a),b.state.set("rect",c.inflate(a,-20,-20)),f&&f.w==a.w&&f.h==a.h||b.zoomFit(),b.repaintImage(),b.fire("load")})},zoom:function(a){return arguments.length?(this.state.set("zoom",a),this):this.state.get("zoom")},postRender:function(){return this.imageSrc(this.settings.imageSrc),this._super()},zoomFit:function(){var a,b,c,d,e,f,g,h=this;g=10,a=h.$el.find("img"),b=h.getEl().clientWidth,c=h.getEl().clientHeight,d=a[0].naturalWidth,e=a[0].naturalHeight,f=Math.min((b-g)/d,(c-g)/e),f>=1&&(f=1),h.zoom(f)},repaintImage:function(){var a,b,c,d,e,f,g,h,i,j,k;k=this.getEl(),i=this.zoom(),j=this.state.get("rect"),g=this.$el.find("img"),h=this.$el.find(".mce-imagepanel-bg"),e=k.offsetWidth,f=k.offsetHeight,c=g[0].naturalWidth*i,d=g[0].naturalHeight*i,a=Math.max(0,e/2-c/2),b=Math.max(0,f/2-d/2),g.css({left:a,top:b,width:c,height:d}),h.css({left:a,top:b,width:c,height:d}),this.cropRect&&(this.cropRect.setRect({x:j.x*i+a,y:j.y*i+b,w:j.w*i,h:j.h*i}),this.cropRect.setClampRect({x:a,y:b,w:c,h:d}),this.cropRect.setViewPortRect({x:0,y:0,w:e,h:f}))},bindStates:function(){function a(a){b.cropRect=new f(a,b.state.get("viewRect"),b.state.get("viewRect"),b.getEl(),function(){b.fire("crop")}),b.cropRect.on("updateRect",function(a){var c=a.rect,d=b.zoom();c={x:Math.round(c.x/d),y:Math.round(c.y/d),w:Math.round(c.w/d),h:Math.round(c.h/d)},b.state.set("rect",c)}),b.on("remove",b.cropRect.destroy)}var b=this;b.state.on("change:cropEnabled",function(a){b.cropRect.toggleVisibility(a.value),b.repaintImage()}),b.state.on("change:zoom",function(){b.repaintImage()}),b.state.on("change:rect",function(c){var d=c.value;b.cropRect||a(d),b.cropRect.setRect(d)})}})}),g("k",[],function(){return function(){function a(a){var b;return b=f.splice(++g),f.push(a),{state:a,removed:b}}function b(){if(d())return f[--g]}function c(){if(e())return f[++g]}function d(){return g>0}function e(){return g!=-1&&g<f.length-1}var f=[],g=-1;return{data:f,add:a,undo:b,redo:c,canUndo:d,canRedo:e}}}),g("9",["f","5","3","g","h","i","j","7","8","k"],function(a,b,c,d,e,f,g,h,i,j){function k(a){return{blob:a,url:URL.createObjectURL(a)}}function l(a){a&&URL.revokeObjectURL(a.url)}function m(a){b.each(a,l)}function n(c,i,n){function o(a){var b,c,d,e;b=L.find("#w")[0],c=L.find("#h")[0],d=parseInt(b.value(),10),e=parseInt(c.value(),10),L.find("#constrain")[0].checked()&&ga&&ha&&d&&e&&("w"==a.control.settings.name?(e=Math.round(d*ia),c.value(e)):(d=Math.round(e*ja),b.value(d))),ga=d,ha=e}function p(a){return Math.round(100*a)+"%"}function q(){L.find("#undo").disabled(!ka.canUndo()),L.find("#redo").disabled(!ka.canRedo()),L.statusbar.find("#save").disabled(!ka.canUndo())}function r(){L.find("#undo").disabled(!0),L.find("#redo").disabled(!0)}function s(a){a&&S.imageSrc(a.url)}function t(a){return function(){var c=b.grep(fa,function(b){return b.settings.name!=a});b.each(c,function(a){a.hide()}),a.show(),a.focus()}}function u(a){O=k(a),s(O)}function v(a){c=k(a),s(c),m(ka.add(c).removed),q()}function w(){var a=S.selection();h.crop(c.blob,a.x,a.y,a.w,a.h).then(function(a){v(a),z()})}function x(a){var b=[].slice.call(arguments,1);return function(){var d=O||c;a.apply(this,[d.blob].concat(b)).then(u)}}function y(a){var b=[].slice.call(arguments,1);return function(){a.apply(this,[c.blob].concat(b)).then(v)}}function z(){s(c),l(O),t(M)(),q()}function A(){O&&(v(O.blob),z())}function B(){var a=S.zoom();a<2&&(a+=.1),S.zoom(a)}function C(){var a=S.zoom();a>.1&&(a-=.1),S.zoom(a)}function D(){c=ka.undo(),s(c),q()}function E(){c=ka.redo(),s(c),q()}function F(){i(c.blob),L.close()}function G(a){return new e({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:a})}function H(a,b){return G([{text:"Back",onclick:z},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:A}]).hide().on("show",function(){r(),b(c.blob).then(function(a){var b=k(a);s(b),l(O),O=b})})}function I(a,b,d,e,f){function g(a){b(c.blob,a).then(function(a){var b=k(a);s(b),l(O),O=b})}return G([{text:"Back",onclick:z},{type:"spacer",flex:1},{type:"slider",flex:1,ondragend:function(a){g(a.value)},minValue:e,maxValue:f,value:d,previewFilter:p},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:A}]).hide().on("show",function(){this.find("slider").value(d),r()})}function J(a,b){function d(){var a,d,e;a=L.find("#r")[0].value(),d=L.find("#g")[0].value(),e=L.find("#b")[0].value(),b(c.blob,a,d,e).then(function(a){var b=k(a);s(b),l(O),O=b})}return G([{text:"Back",onclick:z},{type:"spacer",flex:1},{type:"slider",label:"R",name:"r",minValue:0,value:1,maxValue:2,ondragend:d,previewFilter:p},{type:"slider",label:"G",name:"g",minValue:0,value:1,maxValue:2,ondragend:d,previewFilter:p},{type:"slider",label:"B",name:"b",minValue:0,value:1,maxValue:2,ondragend:d,previewFilter:p},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:A}]).hide().on("show",function(){L.find("#r,#g,#b").value(1),r()})}function K(a){a.control.value()===!0&&(ia=ha/ga,ja=ga/ha)}var L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka=new j;P=G([{text:"Back",onclick:z},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:w}]).hide().on("show hide",function(a){S.toggleCropRect("show"==a.type)}).on("show",r),Q=G([{text:"Back",onclick:z},{type:"spacer",flex:1},{type:"textbox",name:"w",label:"Width",size:4,onkeyup:o},{type:"textbox",name:"h",label:"Height",size:4,onkeyup:o},{type:"checkbox",name:"constrain",text:"Constrain proportions",checked:!0,onchange:K},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:"submit"}]).hide().on("submit",function(a){var b=parseInt(L.find("#w").value(),10),c=parseInt(L.find("#h").value(),10);a.preventDefault(),y(h.resize,b,c)(),z()}).on("show",r),R=G([{text:"Back",onclick:z},{type:"spacer",flex:1},{icon:"fliph",tooltip:"Flip horizontally",onclick:x(h.flip,"h")},{icon:"flipv",tooltip:"Flip vertically",onclick:x(h.flip,"v")},{icon:"rotateleft",tooltip:"Rotate counterclockwise",onclick:x(h.rotate,-90)},{icon:"rotateright",tooltip:"Rotate clockwise",onclick:x(h.rotate,90)},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:A}]).hide().on("show",r),V=H("Invert",h.invert),ba=H("Sharpen",h.sharpen),ca=H("Emboss",h.emboss),W=I("Brightness",h.brightness,0,-1,1),X=I("Hue",h.hue,180,0,360),Y=I("Saturate",h.saturate,0,-1,1),Z=I("Contrast",h.contrast,0,-1,1),$=I("Grayscale",h.grayscale,0,0,1),_=I("Sepia",h.sepia,0,0,1),aa=J("Colorize",h.colorize),da=I("Gamma",h.gamma,0,-1,1),ea=I("Exposure",h.exposure,1,0,2),N=G([{text:"Back",onclick:z},{type:"spacer",flex:1},{text:"hue",icon:"hue",onclick:t(X)},{text:"saturate",icon:"saturate",onclick:t(Y)},{text:"sepia",icon:"sepia",onclick:t(_)},{text:"emboss",icon:"emboss",onclick:t(ca)},{text:"exposure",icon:"exposure",onclick:t(ea)},{type:"spacer",flex:1}]).hide(),M=G([{tooltip:"Crop",icon:"crop",onclick:t(P)},{tooltip:"Resize",icon:"resize2",onclick:t(Q)},{tooltip:"Orientation",icon:"orientation",onclick:t(R)},{tooltip:"Brightness",icon:"sun",onclick:t(W)},{tooltip:"Sharpen",icon:"sharpen",onclick:t(ba)},{tooltip:"Contrast",icon:"contrast",onclick:t(Z)},{tooltip:"Color levels",icon:"drop",onclick:t(aa)},{tooltip:"Gamma",icon:"gamma",onclick:t(da)},{tooltip:"Invert",icon:"invert",onclick:t(V)}]),S=new g({flex:1,imageSrc:c.url}),T=new f({layout:"flex",direction:"column",border:"0 1 0 0",padding:5,spacing:5,items:[{type:"button",icon:"undo",tooltip:"Undo",name:"undo",onclick:D},{type:"button",icon:"redo",tooltip:"Redo",name:"redo",onclick:E},{type:"button",icon:"zoomin",tooltip:"Zoom in",onclick:B},{type:"button",icon:"zoomout",tooltip:"Zoom out",onclick:C}]}),U=new f({type:"container",layout:"flex",direction:"row",align:"stretch",flex:1,items:[T,S]}),fa=[M,P,Q,R,N,V,W,X,Y,Z,$,_,aa,ba,ca,da,ea],L=d.create("window",{layout:"flex",direction:"column",align:"stretch",minWidth:Math.min(a.DOM.getViewPort().w,800),minHeight:Math.min(a.DOM.getViewPort().h,650),title:"Edit image",items:fa.concat([U]),buttons:[{text:"Save",name:"save",subtype:"primary",onclick:F},{text:"Cancel",onclick:"close"}]}),L.renderTo(document.body).reflow(),L.on("close",function(){n(),m(ka.data),ka=null,O=null}),ka.add(c),q(),S.on("load",function(){ga=S.imageSize().w,ha=S.imageSize().h,ia=ha/ga,ja=ga/ha,L.find("#w").value(ga),L.find("#h").value(ha)}),S.on("crop",w)}function o(a){return new c(function(b,c){n(k(a),b,c)})}return{edit:o}}),g("a",[],function(){function a(a){function b(a){return/^[0-9\.]+px$/.test(a)}var c,d;return c=a.style.width,d=a.style.height,c||d?b(c)&&b(d)?{w:parseInt(c,10),h:parseInt(d,10)}:null:(c=a.width,d=a.height,c&&d?{w:parseInt(c,10),h:parseInt(d,10)}:null)}function b(a,b){var c,d;b&&(c=a.style.width,d=a.style.height,(c||d)&&(a.style.width=b.w+"px",a.style.height=b.h+"px",a.removeAttribute("data-mce-style")),c=a.width,d=a.height,(c||d)&&(a.setAttribute("width",b.w),a.setAttribute("height",b.h)))}function c(a){return{w:a.naturalWidth,h:a.naturalHeight}}return{getImageSize:a,setImageSize:b,getNaturalImageSize:c}}),g("l",["3","5"],function(a,b){var c=function(a){return null!==a&&void 0!==a},d=function(a,b){var d;return d=b.reduce(function(a,b){return c(a)?a[b]:void 0},a),c(d)?d:null},e=function(c,d){return new a(function(a){var e;e=new XMLHttpRequest,e.onreadystatechange=function(){4===e.readyState&&a({status:e.status,blob:this.response})},e.open("GET",c,!0),b.each(d,function(a,b){e.setRequestHeader(b,a)}),e.responseType="blob",e.send()})},f=function(b){return new a(function(a){var c=new FileReader;c.onload=function(b){var c=b.target;a(c.result)},c.readAsText(b)})},g=function(a){var b;try{b=JSON.parse(a)}catch(a){}return b};return{traverse:d,readBlob:f,requestUrlAsBlob:e,parseJson:g}}),g("b",["3","5","l"],function(a,b,c){function d(b){return c.requestUrlAsBlob(b,{}).then(function(b){return b.status>=400?f(b.status):a.resolve(b.blob)})}var e=function(a){return 400===a||403===a||500===a},f=function(b){return a.reject("ImageProxy HTTP error: "+b)},g=function(b){a.reject("ImageProxy Service error: "+b)},h=function(a,b){return c.readBlob(b).then(function(a){var b=c.parseJson(a),d=c.traverse(b,["error","type"]);return g(d?d:"Invalid JSON")})},i=function(a,b){return e(a)?h(a,b):f(a)},j=function(b,d){return c.requestUrlAsBlob(b,{"Content-Type":"application/json;charset=UTF-8","tiny-api-key":d}).then(function(b){return b.status>=400?i(b.status,b.blob):a.resolve(b.blob)})},k=function(a,b){return b?j(a,b):d(a)};return{getUrl:k}}),g("0",["1","2","3","4","5","6","7","8","9","a","b"],function(a,b,c,d,e,f,g,h,i,j,k){var l=function(a){function l(b){a.notificationManager.open({text:b,type:"error"})}function m(){return a.selection.getNode()}function n(b){var c=b.match(/\/([^\/\?]+)?\.(?:jpeg|jpg|png|gif)(?:\?|$)/i);return c?a.dom.encode(c[1]):null}function o(){return"imagetools"+H++}function p(b){var c=b.src;return 0===c.indexOf("data:")||0===c.indexOf("blob:")||new d(c).host===a.documentBaseURI.host}function q(b){return e.inArray(a.settings.imagetools_cors_hosts,new d(b.src).host)!==-1}function r(){return a.settings.api_key||a.settings.imagetools_api_key}function s(b){var c,d=b.src;return q(b)?k.getUrl(b.src,null):p(b)?h.imageToBlob(b):(d=a.settings.imagetools_proxy,d+=(d.indexOf("?")===-1?"?":"&")+"url="+encodeURIComponent(b.src),c=r(),k.getUrl(d,c))}function t(){var b;return b=a.editorUpload.blobCache.getByUri(m().src),b?b.blob():s(m())}function u(){F=f.setEditorTimeout(a,function(){a.editorUpload.uploadImagesAuto()},a.settings.images_upload_timeout||3e4)}function v(){clearTimeout(F)}function w(b,c){return h.blobToDataUri(b).then(function(e){var f,g,h,i,j,k;return k=m(),i=a.editorUpload.blobCache,j=i.getByUri(k.src),h=d.parseDataUri(e).data,f=o(),a.settings.images_reuse_filename&&(g=j?j.filename():n(k.src)),j&&i.removeByUri(j.blobUri()),j=i.create(f,b,h,g),i.add(j),a.undoManager.transact(function(){function b(){a.$(k).off("load",b),a.nodeChanged(),c?a.editorUpload.uploadImagesAuto():(v(),u())}a.$(k).on("load",b),a.$(k).attr({src:j.blobUri()}).removeAttr("data-mce-src")}),j})}function x(b){return function(){return a._scanForImages().then(t).then(b).then(w,l)}}function y(a){return function(){return x(function(b){var c=j.getImageSize(m());return c&&j.setImageSize(m(),{w:c.h,h:c.w}),g.rotate(b,a)})()}}function z(a){return function(){return x(function(b){return g.flip(b,a)})()}}function A(){var a=m(),b=j.getNaturalImageSize(a),d=function(d){return new c(function(c){h.blobToImage(d).then(function(e){var f=j.getNaturalImageSize(e);b.w==f.w&&b.h==f.h||j.getImageSize(a)&&j.setImageSize(a,f),URL.revokeObjectURL(e.src),c(d)})})},e=function(a){return i.edit(a).then(d).then(function(a){w(a,!0)},function(){})};a&&s(a).then(e,l)}function B(){a.addButton("rotateleft",{title:"Rotate counterclockwise",cmd:"mceImageRotateLeft"}),a.addButton("rotateright",{title:"Rotate clockwise",cmd:"mceImageRotateRight"}),a.addButton("flipv",{title:"Flip vertically",cmd:"mceImageFlipVertical"}),a.addButton("fliph",{title:"Flip horizontally",cmd:"mceImageFlipHorizontal"}),a.addButton("editimage",{title:"Edit image",cmd:"mceEditImage"}),a.addButton("imageoptions",{title:"Image options",icon:"options",cmd:"mceImage"})}function C(){a.on("NodeChange",function(b){G&&G.src!=b.element.src&&(v(),a.editorUpload.uploadImagesAuto(),G=void 0),D(b.element)&&(G=b.element)})}function D(b){var c=a.dom.is(b,"img:not([data-mce-object],[data-mce-placeholder])");return c&&(p(b)||q(b)||a.settings.imagetools_proxy)}function E(){var b=a.settings.imagetools_toolbar;b||(b="rotateleft rotateright | flipv fliph | crop editimage imageoptions"),a.addContextToolbar(D,b)}var F,G,H=0;b.fileApi&&(e.each({mceImageRotateLeft:y(-90),mceImageRotateRight:y(90),mceImageFlipVertical:z("v"),mceImageFlipHorizontal:z("h"),mceEditImage:A},function(b,c){a.addCommand(c,b)}),B(),E(),C())};return a.add("imagetools",l),function(){}}),d("0")()}();
|
@@ -1 +1 @@
|
|
1
|
-
tinymce.PluginManager.add("importcss",function(a){function b(a){var b=tinymce.Env.cacheSuffix;return"string"==typeof a&&(a=a.replace("?"+b,"").replace("&"+b,"")),a}function c(b){var c=a.settings,d=c.skin!==!1
|
1
|
+
tinymce.PluginManager.add("importcss",function(a){function b(a){var b=tinymce.Env.cacheSuffix;return"string"==typeof a&&(a=a.replace("?"+b,"").replace("&"+b,"")),a}function c(b){var c=a.settings,d=c.skin!==!1&&(c.skin||"lightgray");if(d){var e=c.skin_url;return e=e?a.documentBaseURI.toAbsolute(e):tinymce.baseURL+"/skins/"+d,b===e+"/content"+(a.inline?".inline":"")+".min.css"}return!1}function d(a){return"string"==typeof a?function(b){return b.indexOf(a)!==-1}:a instanceof RegExp?function(b){return a.test(b)}:a}function e(d,e){function f(a,d){var h,i=a.href;if(i=b(i),i&&e(i,d)&&!c(i)){n(a.imports,function(a){f(a,!0)});try{h=a.cssRules||a.rules}catch(a){}n(h,function(a){a.styleSheet?f(a.styleSheet,!0):a.selectorText&&n(a.selectorText.split(","),function(a){g.push(tinymce.trim(a))})})}}var g=[],h={};n(a.contentCSS,function(a){h[a]=!0}),e||(e=function(a,b){return b||h[a]});try{n(d.styleSheets,function(a){f(a)})}catch(a){}return g}function f(b){var c,d=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(b);if(d){var e=d[1],f=d[2].substr(1).split(".").join(" "),g=tinymce.makeMap("a,img");return d[1]?(c={title:b},a.schema.getTextBlockElements()[e]?c.block=e:a.schema.getBlockElements()[e]||g[e.toLowerCase()]?c.selector=e:c.inline=e):d[2]&&(c={inline:"span",title:b.substr(1),classes:f}),a.settings.importcss_merge_classes!==!1?c.classes=f:c.attributes={class:f},c}}function g(a,b){return tinymce.util.Tools.grep(a,function(a){return!a.filter||a.filter(b)})}function h(a){return tinymce.util.Tools.map(a,function(a){return tinymce.util.Tools.extend({},a,{original:a,selectors:{},filter:d(a.filter),item:{text:a.title,menu:[]}})})}function i(a,b){return null===b||a.settings.importcss_exclusive!==!1}function j(b,c,d){return!(i(a,c)?b in d:b in c.selectors)}function k(b,c,d){i(a,c)?d[b]=!0:c.selectors[b]=!0}function l(b,c,d){var e,g=a.settings;return e=d&&d.selector_converter?d.selector_converter:g.importcss_selector_converter?g.importcss_selector_converter:f,e.call(b,c,d)}var m=this,n=tinymce.each;a.on("renderFormatsMenu",function(b){var c=a.settings,f={},i=d(c.importcss_selector_filter),o=b.control,p=h(c.importcss_groups),q=function(b,c){if(j(b,c,f)){k(b,c,f);var d=l(m,b,c);if(d){var e=d.name||tinymce.DOM.uniqueId();return a.formatter.register(e,d),tinymce.extend({},o.settings.itemDefaults,{text:d.title,format:e})}}return null};a.settings.importcss_append||o.items().remove(),n(e(b.doc||a.getDoc(),d(c.importcss_file_filter)),function(a){if(a.indexOf(".mce-")===-1&&(!i||i(a))){var b=g(p,a);if(b.length>0)tinymce.util.Tools.each(b,function(b){var c=q(a,b);c&&b.item.menu.push(c)});else{var c=q(a,null);c&&o.add(c)}}}),n(p,function(a){a.item.menu.length>0&&o.add(a.item)}),b.control.renderNew()}),m.convertSelectorToFormat=f});
|
@@ -1 +1 @@
|
|
1
|
-
tinymce.PluginManager.add("insertdatetime",function(a){function b(b,c){function d(a,b){if(a=""+a,a.length<b)for(var c=0;c<b-a.length;c++)a="0"+a;return a}return c=c||new Date,b=b.replace("%D","%m/%d/%Y"),b=b.replace("%r","%I:%M:%S %p"),b=b.replace("%Y",""+c.getFullYear()),b=b.replace("%y",""+c.getYear()),b=b.replace("%m",d(c.getMonth()+1,2)),b=b.replace("%d",d(c.getDate(),2)),b=b.replace("%H",""+d(c.getHours(),2)),b=b.replace("%M",""+d(c.getMinutes(),2)),b=b.replace("%S",""+d(c.getSeconds(),2)),b=b.replace("%I",""+((c.getHours()+11)%12+1)),b=b.replace("%p",""+(c.getHours()<12?"AM":"PM")),b=b.replace("%B",""+a.translate(i[c.getMonth()])),b=b.replace("%b",""+a.translate(h[c.getMonth()])),b=b.replace("%A",""+a.translate(g[c.getDay()])),b=b.replace("%a",""+a.translate(f[c.getDay()])),b=b.replace("%%","%")}function c(c){var d=b(c);if(a.settings.insertdatetime_element){var e;e=b(/%[HMSIp]/.test(c)?"%Y-%m-%dT%H:%M":"%Y-%m-%d"),d='<time datetime="'+e+'">'+d+"</time>";var f=a.dom.getParent(a.selection.getStart(),"time");if(f)return void a.dom.setOuterHTML(f,d)}a.insertContent(d)}var d,e,f="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),g="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),h="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),i="January February March April May June July August September October November December".split(" "),j=[];a.addCommand("mceInsertDate",function(){c(a.getParam("insertdatetime_dateformat",a.translate("%Y-%m-%d")))}),a.addCommand("mceInsertTime",function(){c(a.getParam("insertdatetime_timeformat",a.translate("%H:%M:%S")))}),a.addButton("insertdatetime",{type:"splitbutton",title:"Insert date/time",onclick:function(){c(d||e)},menu:j}),tinymce.each(a.settings.insertdatetime_formats||["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"],function(a){e||(e=a),j.push({text:b(a),onclick:function(){d=a,c(a)}})}),a.addMenuItem("insertdatetime",{icon:"date",text:"
|
1
|
+
tinymce.PluginManager.add("insertdatetime",function(a){function b(b,c){function d(a,b){if(a=""+a,a.length<b)for(var c=0;c<b-a.length;c++)a="0"+a;return a}return c=c||new Date,b=b.replace("%D","%m/%d/%Y"),b=b.replace("%r","%I:%M:%S %p"),b=b.replace("%Y",""+c.getFullYear()),b=b.replace("%y",""+c.getYear()),b=b.replace("%m",d(c.getMonth()+1,2)),b=b.replace("%d",d(c.getDate(),2)),b=b.replace("%H",""+d(c.getHours(),2)),b=b.replace("%M",""+d(c.getMinutes(),2)),b=b.replace("%S",""+d(c.getSeconds(),2)),b=b.replace("%I",""+((c.getHours()+11)%12+1)),b=b.replace("%p",""+(c.getHours()<12?"AM":"PM")),b=b.replace("%B",""+a.translate(i[c.getMonth()])),b=b.replace("%b",""+a.translate(h[c.getMonth()])),b=b.replace("%A",""+a.translate(g[c.getDay()])),b=b.replace("%a",""+a.translate(f[c.getDay()])),b=b.replace("%%","%")}function c(c){var d=b(c);if(a.settings.insertdatetime_element){var e;e=b(/%[HMSIp]/.test(c)?"%Y-%m-%dT%H:%M":"%Y-%m-%d"),d='<time datetime="'+e+'">'+d+"</time>";var f=a.dom.getParent(a.selection.getStart(),"time");if(f)return void a.dom.setOuterHTML(f,d)}a.insertContent(d)}var d,e,f="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),g="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),h="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),i="January February March April May June July August September October November December".split(" "),j=[];a.addCommand("mceInsertDate",function(){c(a.getParam("insertdatetime_dateformat",a.translate("%Y-%m-%d")))}),a.addCommand("mceInsertTime",function(){c(a.getParam("insertdatetime_timeformat",a.translate("%H:%M:%S")))}),a.addButton("insertdatetime",{type:"splitbutton",title:"Insert date/time",onclick:function(){c(d||e)},menu:j}),tinymce.each(a.settings.insertdatetime_formats||["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"],function(a){e||(e=a),j.push({text:b(a),onclick:function(){d=a,c(a)}})}),a.addMenuItem("insertdatetime",{icon:"date",text:"Date/time",menu:j,context:"insert"})});
|
@@ -1 +1 @@
|
|
1
|
-
!function(a){a.PluginManager.add("legacyoutput",function(b,c,d){b.settings.inline_styles=!1,b.on("init",function(){var c="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",d=a.explode(b.settings.font_size_style_values),e=b.schema;b.formatter.register({alignleft:{selector:c,attributes:{align:"left"}},aligncenter:{selector:c,attributes:{align:"center"}},alignright:{selector:c,attributes:{align:"right"}},alignjustify:{selector:c,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(b){return a.inArray(d,b.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}}),a.each("b,i,u,strike".split(","),function(a){e.addValidElements(a+"[*]")}),e.getElementRule("font")||e.addValidElements("font[face|size|color|style]"),a.each(c.split(","),function(a){var b=e.getElementRule(a);b&&(b.attributes.align||(b.attributes.align={},b.attributesOrder.push("align")))})}),b.addButton("fontsizeselect",function(){var a=[],c="8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7",d=b.settings.fontsize_formats||c;return b.$.each(d.split(" "),function(b,c){var d=c,e=c,f=c.split("=");f.length>1&&(d=f[0],e=f[1]),a.push({text:d,value:e})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:a,fixedWidth:!0,onPostRender:function(){var a=this;b.on("NodeChange",function(){var c;c=b.dom.getParent(b.selection.getNode(),"font"),c?a.value(c.size):a.value("")})},onclick:function(a){a.control.settings.value&&b.execCommand("FontSize",!1,a.control.settings.value)}}}),b.addButton("fontselect",function(){function a(a){a=a.replace(/;$/,"").split(";");for(var b=a.length;b--;)a[b]=a[b].split("=");return a}var c="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",e=[],f=a(b.settings.font_formats||c);return d.each(f,function(a,b){e.push({text:{raw:b[0]},value:b[1],textStyle
|
1
|
+
!function(a){a.PluginManager.add("legacyoutput",function(b,c,d){b.settings.inline_styles=!1,b.on("init",function(){var c="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",d=a.explode(b.settings.font_size_style_values),e=b.schema;b.formatter.register({alignleft:{selector:c,attributes:{align:"left"}},aligncenter:{selector:c,attributes:{align:"center"}},alignright:{selector:c,attributes:{align:"right"}},alignjustify:{selector:c,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(b){return a.inArray(d,b.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}}),a.each("b,i,u,strike".split(","),function(a){e.addValidElements(a+"[*]")}),e.getElementRule("font")||e.addValidElements("font[face|size|color|style]"),a.each(c.split(","),function(a){var b=e.getElementRule(a);b&&(b.attributes.align||(b.attributes.align={},b.attributesOrder.push("align")))})}),b.addButton("fontsizeselect",function(){var a=[],c="8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7",d=b.settings.fontsize_formats||c;return b.$.each(d.split(" "),function(b,c){var d=c,e=c,f=c.split("=");f.length>1&&(d=f[0],e=f[1]),a.push({text:d,value:e})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:a,fixedWidth:!0,onPostRender:function(){var a=this;b.on("NodeChange",function(){var c;c=b.dom.getParent(b.selection.getNode(),"font"),c?a.value(c.size):a.value("")})},onclick:function(a){a.control.settings.value&&b.execCommand("FontSize",!1,a.control.settings.value)}}}),b.addButton("fontselect",function(){function a(a){a=a.replace(/;$/,"").split(";");for(var b=a.length;b--;)a[b]=a[b].split("=");return a}var c="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",e=[],f=a(b.settings.font_formats||c);return d.each(f,function(a,b){e.push({text:{raw:b[0]},value:b[1],textStyle:b[1].indexOf("dings")==-1?"font-family:"+b[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:e,fixedWidth:!0,onPostRender:function(){var a=this;b.on("NodeChange",function(){var c;c=b.dom.getParent(b.selection.getNode(),"font"),c?a.value(c.face):a.value("")})},onselect:function(a){a.control.settings.value&&b.execCommand("FontName",!1,a.control.settings.value)}}})})}(tinymce);
|
@@ -1 +1 @@
|
|
1
|
-
tinymce.PluginManager.add("link",function(a){function b(b){return function(){var c=a.settings.link_list;"string"==typeof c?tinymce.util.XHR.send({url:c,success:function(a){b(tinymce.util.JSON.parse(a))}}):"function"==typeof c?c(b):b(c)}}function
|
1
|
+
tinymce.PluginManager.add("link",function(a){function b(a){return a&&"A"===a.nodeName&&a.href}function c(a){return tinymce.util.Tools.grep(a,b).length>0}function d(b){return a.dom.getParent(b,"a[href]")}function e(){return d(a.selection.getStart())}function f(a){var b=a.getAttribute("data-mce-href");return b?b:a.getAttribute("href")}function g(){var b=a.plugins.contextmenu;return!!b&&b.isContextMenuVisible()}function h(c){var d,e,f;return!!(a.settings.link_context_toolbar&&!g()&&b(c)&&(d=a.selection,e=d.getRng(),f=e.startContainer,3==f.nodeType&&d.isCollapsed()&&e.startOffset>0&&e.startOffset<f.data.length))}function i(a){if(!tinymce.Env.ie||tinymce.Env.ie>10){var b=document.createElement("a");b.target="_blank",b.href=a,b.rel="noreferrer noopener";var c=document.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,window,!0,0,0,0,0,!1,!1,!1,!1,0,null),b.dispatchEvent(c)}else{var d=window.open("","_blank");if(d){d.opener=null;var e=d.document;e.open(),e.write('<meta http-equiv="refresh" content="0; url='+tinymce.DOM.encode(a)+'">'),e.close()}}}function j(b){if(b){var c=f(b);if(/^#/.test(c)){var d=a.$(c);d.length&&a.selection.scrollIntoView(d[0],!0)}else i(b.href)}}function k(){j(e())}function l(){var b=this,d=function(a){c(a.parents)?b.show():b.hide()};c(a.dom.getParents(a.selection.getStart()))||b.hide(),a.on("nodechange",d),b.on("remove",function(){a.off("nodechange",d)})}function m(b){return function(){var c=a.settings.link_list;"string"==typeof c?tinymce.util.XHR.send({url:c,success:function(a){b(tinymce.util.JSON.parse(a))}}):"function"==typeof c?c(b):b(c)}}function n(a,b,c){function d(a,c){return c=c||[],tinymce.each(a,function(a){var e={text:a.text||a.title};a.menu?e.menu=d(a.menu):(e.value=a.value,b&&b(e)),c.push(e)}),c}return d(a,c||[])}function o(b){function c(a){var b=l.find("#text");(!b.value()||a.lastControl&&b.value()==a.lastControl.text())&&b.value(a.control.text()),l.find("#href").value(a.control.value())}function d(b){var d=[];if(tinymce.each(a.dom.select("a:not([href])"),function(a){var c=a.name||a.id;c&&d.push({text:c,value:"#"+c,selected:b.indexOf("#"+c)!=-1})}),d.length)return d.unshift({text:"None",value:""}),{name:"anchor",type:"listbox",label:"Anchors",values:d,onselect:c}}function e(){!k&&0===w.text.length&&m&&this.parent().parent().find("#text")[0].value(this.value())}function f(b){var c=b.meta||{};q&&q.value(a.convertURL(this.value(),"href")),tinymce.each(b.meta,function(a,b){var c=l.find("#"+b);"text"===b?0===k.length&&(c.value(a),w.text=a):c.value(a)}),c.attach&&(p={href:this.value(),attach:c.attach}),c.text||e.call(this)}function g(a){var b=x.getContent();if(/</.test(b)&&(!/^<a [^>]+>[^<]+<\/a>$/.test(b)||b.indexOf("href=")==-1))return!1;if(a){var c,d=a.childNodes;if(0===d.length)return!1;for(c=d.length-1;c>=0;c--)if(3!=d[c].nodeType)return!1}return!0}function h(a){a.meta=l.toJSON()}var i,j,k,l,m,o,q,r,s,t,u,v,w={},x=a.selection,y=a.dom;i=x.getNode(),j=y.getParent(i,"a[href]"),m=g(),w.text=k=j?j.innerText||j.textContent:x.getContent({format:"text"}),w.href=j?y.getAttrib(j,"href"):"",j?w.target=y.getAttrib(j,"target"):a.settings.default_link_target&&(w.target=a.settings.default_link_target),(v=y.getAttrib(j,"rel"))&&(w.rel=v),(v=y.getAttrib(j,"class"))&&(w.class=v),(v=y.getAttrib(j,"title"))&&(w.title=v),m&&(o={name:"text",type:"textbox",size:40,label:"Text to display",onchange:function(){w.text=this.value()}}),b&&(q={type:"listbox",label:"Link list",values:n(b,function(b){b.value=a.convertURL(b.value||b.url,"href")},[{text:"None",value:""}]),onselect:c,value:a.convertURL(w.href,"href"),onPostRender:function(){q=this}}),a.settings.target_list!==!1&&(a.settings.target_list||(a.settings.target_list=[{text:"None",value:""},{text:"New window",value:"_blank"}]),s={name:"target",type:"listbox",label:"Target",values:n(a.settings.target_list)}),a.settings.rel_list&&(r={name:"rel",type:"listbox",label:"Rel",values:n(a.settings.rel_list)}),a.settings.link_class_list&&(t={name:"class",type:"listbox",label:"Class",values:n(a.settings.link_class_list,function(b){b.value&&(b.textStyle=function(){return a.formatter.getCssText({inline:"a",classes:[b.value]})})})}),a.settings.link_title!==!1&&(u={name:"title",type:"textbox",label:"Title",value:w.title}),l=a.windowManager.open({title:"Insert link",data:w,body:[{name:"href",type:"filepicker",filetype:"file",size:40,autofocus:!0,label:"Url",onchange:f,onkeyup:e,onbeforecall:h},o,u,d(w.href),q,r,s,t],onSubmit:function(b){function c(b,c){var d=a.selection.getRng();tinymce.util.Delay.setEditorTimeout(a,function(){a.windowManager.confirm(b,function(b){a.selection.setRng(d),c(b)})})}function d(a,b){function c(a){return a=d(a),a?[a,e].join(" "):e}function d(a){var b=new RegExp("("+e.replace(" ","|")+")","g");return a&&(a=tinymce.trim(a.replace(b,""))),a?a:null}var e="noopener noreferrer";return b?c(a):d(a)}function e(){var b={href:g,target:w.target?w.target:null,rel:w.rel?w.rel:null,class:w.class?w.class:null,title:w.title?w.title:null};a.settings.allow_unsafe_link_target||(b.rel=d(b.rel,"_blank"==b.target)),g===p.href&&(p.attach(),p={}),j?(a.focus(),m&&w.text!=k&&("innerText"in j?j.innerText=w.text:j.textContent=w.text),y.setAttribs(j,b),x.select(j),a.undoManager.add()):m?a.insertContent(y.createHTML("a",b,y.encode(w.text))):a.execCommand("mceInsertLink",!1,b)}function f(){a.undoManager.transact(e)}var g;return w=tinymce.extend(w,b.data),(g=w.href)?g.indexOf("@")>0&&g.indexOf("//")==-1&&g.indexOf("mailto:")==-1?void c("The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",function(a){a&&(g="mailto:"+g),f()}):a.settings.link_assume_external_targets&&!/^\w+:/i.test(g)||!a.settings.link_assume_external_targets&&/^\s*www[\.|\d\.]/i.test(g)?void c("The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",function(a){a&&(g="http://"+g),f()}):void f():void a.execCommand("unlink")}})}var p={},q=function(a){return a.altKey===!0&&a.shiftKey===!1&&a.ctrlKey===!1&&a.metaKey===!1};a.addButton("link",{icon:"link",tooltip:"Insert/edit link",shortcut:"Meta+K",onclick:m(o),stateSelector:"a[href]"}),a.addButton("unlink",{icon:"unlink",tooltip:"Remove link",cmd:"unlink",stateSelector:"a[href]"}),a.addContextToolbar&&(a.addButton("openlink",{icon:"newtab",tooltip:"Open link",onclick:k}),a.addContextToolbar(h,"openlink | link unlink")),a.addShortcut("Meta+K","",m(o)),a.addCommand("mceLink",m(o)),a.on("click",function(a){var b=d(a.target);b&&tinymce.util.VK.metaKeyPressed(a)&&(a.preventDefault(),j(b))}),a.on("keydown",function(a){var b=e();b&&13===a.keyCode&&q(a)&&(a.preventDefault(),j(b))}),this.showDialog=o,a.addMenuItem("openlink",{text:"Open link",icon:"newtab",onclick:k,onPostRender:l,prependToContext:!0}),a.addMenuItem("link",{icon:"link",text:"Link",shortcut:"Meta+K",onclick:m(o),stateSelector:"a[href]",context:"insert",prependToContext:!0})});
|
@@ -1 +1 @@
|
|
1
|
-
tinymce.PluginManager.add("lists",function(a){function b(b){return a.$.contains(a.getBody(),b)}function c(a){return a&&"BR"==a.nodeName}function d(a){return a&&/^(OL|UL|DL)$/.test(a.nodeName)&&b(a)}function e(a){return a&&/^(LI|DT|DD)$/.test(a.nodeName)}function f(a){return a.parentNode.firstChild==a}function g(a){return a.parentNode.lastChild==a}function h(b){return b&&!!a.schema.getTextBlockElements()[b.nodeName]}function i(b){return b===a.getBody()}function j(a){return a&&3===a.nodeType}function k(a,b){var c=tinymce.dom.RangeUtils.getNode(a,b);if(e(a)&&j(c)){var d=b>=a.childNodes.length?c.data.length:0;return{container:c,offset:d}}return{container:a,offset:b}}function l(a){var b=a.cloneRange(),c=k(a.startContainer,a.startOffset);b.setStart(c.container,c.offset);var d=k(a.endContainer,a.endOffset);return b.setEnd(d.container,d.offset),b}var m=this;a.on("init",function(){function j(a,b){var c=H.isEmpty(a);return b&&H.select("span[data-mce-type=bookmark]").length>0?!1:c}function k(a){function b(b){var d,e,f;e=a[b?"startContainer":"endContainer"],f=a[b?"startOffset":"endOffset"],1==e.nodeType&&(d=H.create("span",{"data-mce-type":"bookmark"}),e.hasChildNodes()?(f=Math.min(f,e.childNodes.length-1),b?e.insertBefore(d,e.childNodes[f]):H.insertAfter(d,e.childNodes[f])):e.appendChild(d),e=d,f=0),c[b?"startContainer":"endContainer"]=e,c[b?"startOffset":"endOffset"]=f}var c={};return b(!0),a.collapsed||b(),c}function n(a){function b(b){function c(a){for(var b=a.parentNode.firstChild,c=0;b;){if(b==a)return c;1==b.nodeType&&"bookmark"==b.getAttribute("data-mce-type")||c++,b=b.nextSibling}return-1}var d,e,f;d=f=a[b?"startContainer":"endContainer"],e=a[b?"startOffset":"endOffset"],d&&(1==d.nodeType&&(e=c(d),d=d.parentNode,H.remove(f)),a[b?"startContainer":"endContainer"]=d,a[b?"startOffset":"endOffset"]=e)}b(!0),b();var c=H.createRng();c.setStart(a.startContainer,a.startOffset),a.endContainer&&c.setEnd(a.endContainer,a.endOffset),I.setRng(l(c))}function o(b,c){var d,e,f,g=H.createFragment(),h=a.schema.getBlockElements();if(a.settings.forced_root_block&&(c=c||a.settings.forced_root_block),c&&(e=H.create(c),e.tagName===a.settings.forced_root_block&&H.setAttribs(e,a.settings.forced_root_block_attrs),g.appendChild(e)),b)for(;d=b.firstChild;){var i=d.nodeName;f||"SPAN"==i&&"bookmark"==d.getAttribute("data-mce-type")||(f=!0),h[i]?(g.appendChild(d),e=null):c?(e||(e=H.create(c),g.appendChild(e)),e.appendChild(d)):g.appendChild(d)}return a.settings.forced_root_block?f||tinymce.Env.ie&&!(tinymce.Env.ie>10)||e.appendChild(H.create("br",{"data-mce-bogus":"1"})):g.appendChild(H.create("br")),g}function p(){return tinymce.grep(I.getSelectedBlocks(),function(a){return e(a)})}function q(a,b,c){function d(a){tinymce.each(g,function(c){a.parentNode.insertBefore(c,b.parentNode)}),H.remove(a)}var e,f,g,h;for(g=H.select('span[data-mce-type="bookmark"]',a),c=c||o(b),e=H.createRng(),e.setStartAfter(b),e.setEndAfter(a),f=e.extractContents(),h=f.firstChild;h;h=h.firstChild)if("LI"==h.nodeName&&H.isEmpty(h)){H.remove(h);break}H.isEmpty(f)||H.insertAfter(f,a),H.insertAfter(c,a),j(b.parentNode)&&d(b.parentNode),H.remove(b),j(a)&&H.remove(a)}function r(a){var b,c;if(b=a.nextSibling,b&&d(b)&&b.nodeName==a.nodeName&&J(a,b)){for(;c=b.firstChild;)a.appendChild(c);H.remove(b)}if(b=a.previousSibling,b&&d(b)&&b.nodeName==a.nodeName&&J(a,b)){for(;c=b.firstChild;)a.insertBefore(c,a.firstChild);H.remove(b)}}function s(a){tinymce.each(tinymce.grep(H.select("ol,ul",a)),t)}function t(a){var b,c=a.parentNode;"LI"==c.nodeName&&c.firstChild==a&&(b=c.previousSibling,b&&"LI"==b.nodeName?(b.appendChild(a),j(c)&&H.remove(c)):H.setStyle(c,"listStyleType","none")),d(c)&&(b=c.previousSibling,b&&"LI"==b.nodeName&&b.appendChild(a))}function u(a){function b(a){j(a)&&H.remove(a)}var c,e=a.parentNode,h=e.parentNode;return i(e)?!0:"DD"==a.nodeName?(H.rename(a,"DT"),!0):f(a)&&g(a)?("LI"==h.nodeName?(H.insertAfter(a,h),b(h),H.remove(e)):d(h)?H.remove(e,!0):(h.insertBefore(o(a),e),H.remove(e)),!0):f(a)?("LI"==h.nodeName?(H.insertAfter(a,h),a.appendChild(e),b(h)):d(h)?h.insertBefore(a,e):(h.insertBefore(o(a),e),H.remove(a)),!0):g(a)?("LI"==h.nodeName?H.insertAfter(a,h):d(h)?H.insertAfter(a,e):(H.insertAfter(o(a),e),H.remove(a)),!0):("LI"==h.nodeName?(e=h,c=o(a,"LI")):c=d(h)?o(a,"LI"):o(a),q(e,a,c),s(e.parentNode),!0)}function v(a){function b(b,c){var e;if(d(b)){for(;e=a.lastChild.firstChild;)c.appendChild(e);H.remove(b)}}var c,e,f;return"DT"==a.nodeName?(H.rename(a,"DD"),!0):(c=a.previousSibling,c&&d(c)?(c.appendChild(a),!0):c&&"LI"==c.nodeName&&d(c.lastChild)?(c.lastChild.appendChild(a),b(a.lastChild,c.lastChild),!0):(c=a.nextSibling,c&&d(c)?(c.insertBefore(a,c.firstChild),!0):(c=a.previousSibling,c&&"LI"==c.nodeName?(e=H.create(a.parentNode.nodeName),f=H.getStyle(a.parentNode,"listStyleType"),f&&H.setStyle(e,"listStyleType",f),c.appendChild(e),e.appendChild(a),b(a.lastChild,e),!0):!1)))}function w(){var b=p();if(b.length){for(var c=k(I.getRng(!0)),d=0;d<b.length&&(v(b[d])||0!==d);d++);return n(c),a.nodeChanged(),!0}}function x(){var b=p();if(b.length){var c,d,e=k(I.getRng(!0)),f=a.getBody();for(c=b.length;c--;)for(var g=b[c].parentNode;g&&g!=f;){for(d=b.length;d--;)if(b[d]===g){b.splice(c,1);break}g=g.parentNode}for(c=0;c<b.length&&(u(b[c])||0!==c);c++);return n(e),a.nodeChanged(),!0}}function y(b,e){function f(){function b(a){var b,c;for(b=i[a?"startContainer":"endContainer"],c=i[a?"startOffset":"endOffset"],1==b.nodeType&&(b=b.childNodes[Math.min(c,b.childNodes.length-1)]||b);b.parentNode!=f;){if(h(b))return b;if(/^(TD|TH)$/.test(b.parentNode.nodeName))return b;b=b.parentNode}return b}for(var d,e=[],f=a.getBody(),g=b(!0),j=b(),k=[],l=g;l&&(k.push(l),l!=j);l=l.nextSibling);return tinymce.each(k,function(a){if(h(a))return e.push(a),void(d=null);if(H.isBlock(a)||c(a))return c(a)&&H.remove(a),void(d=null);var b=a.nextSibling;return tinymce.dom.BookmarkManager.isBookmarkNode(a)&&(h(b)||!b&&a.parentNode==f)?void(d=null):(d||(d=H.create("p"),a.parentNode.insertBefore(d,a),e.push(d)),void d.appendChild(a))}),e}var g,i=I.getRng(!0),j="LI";"false"!==H.getContentEditable(I.getNode())&&(b=b.toUpperCase(),"DL"==b&&(j="DT"),g=k(i),tinymce.each(f(),function(a){var c,f,g=function(a){var b=H.getStyle(a,"list-style-type"),c=e?e["list-style-type"]:"";return c=null===c?"":c,b===c};f=a.previousSibling,f&&d(f)&&f.nodeName==b&&g(f)?(c=f,a=H.rename(a,j),f.appendChild(a)):(c=H.create(b),a.parentNode.insertBefore(c,a),c.appendChild(a),a=H.rename(a,j)),K(c,e),r(c)}),n(g))}function z(){var b=k(I.getRng(!0)),c=a.getBody();tinymce.each(p(),function(a){var b,e;if(!i(a.parentNode)){if(j(a))return void u(a);for(b=a;b&&b!=c;b=b.parentNode)d(b)&&(e=b);q(e,a),s(e.parentNode)}}),n(b)}function A(a,b){var c=H.getParent(I.getStart(),"OL,UL,DL");if(!i(c))if(c)if(c.nodeName==a)z(a);else{var d=k(I.getRng(!0));K(c,b),r(H.rename(c,a)),n(d)}else y(a,b)}function B(b){return function(){var c=H.getParent(a.selection.getStart(),"UL,OL,DL");return c&&c.nodeName==b}}function C(a){return c(a)?!(!H.isBlock(a.nextSibling)||c(a.previousSibling)):!1}function D(b,c){var d,e,f=b.startContainer,g=b.startOffset;if(3==f.nodeType&&(c?g<f.data.length:g>0))return f;for(d=a.schema.getNonEmptyElements(),1==f.nodeType&&(f=tinymce.dom.RangeUtils.getNode(f,g)),e=new tinymce.dom.TreeWalker(f,a.getBody()),c&&C(f)&&e.next();f=e[c?"next":"prev2"]();){if("LI"==f.nodeName&&!f.hasChildNodes())return f;if(d[f.nodeName])return f;if(3==f.nodeType&&f.data.length>0)return f}}function E(a,e){var f,g,h=a.parentNode;if(b(a)&&b(e)){if(d(e.lastChild)&&(g=e.lastChild),h==e.lastChild&&c(h.previousSibling)&&H.remove(h.previousSibling),f=e.lastChild,f&&c(f)&&a.hasChildNodes()&&H.remove(f),j(e,!0)&&H.$(e).empty(),!j(a,!0))for(;f=a.firstChild;)e.appendChild(f);g&&e.appendChild(g),H.remove(a),j(h)&&!i(h)&&H.remove(h)}}function F(a){var b,c,d,e=H.getParent(I.getStart(),"LI");if(e){if(b=e.parentNode,i(b)&&H.isEmpty(b))return!0;if(c=l(I.getRng(!0)),d=H.getParent(D(c,a),"LI"),d&&d!=e){var f=k(c);return a?E(d,e):E(e,d),n(f),!0}if(!d&&!a&&z(b.nodeName))return!0}}function G(){var b=a.dom.getParent(a.selection.getStart(),"LI,DT,DD");return b||p().length>0?(a.undoManager.transact(function(){a.execCommand("Delete"),s(a.getBody())}),!0):!1}var H=a.dom,I=a.selection,J=function(b,c){var d=a.dom.getStyle(b,"list-style-type",!0),e=a.dom.getStyle(c,"list-style-type",!0);return d===e},K=function(a,b){H.setStyle(a,"list-style-type",b?b["list-style-type"]:null)};m.backspaceDelete=function(a){return I.isCollapsed()?F(a):G()},a.on("BeforeExecCommand",function(b){var c,d=b.command.toLowerCase();return"indent"==d?w()&&(c=!0):"outdent"==d&&x()&&(c=!0),c?(a.fire("ExecCommand",{command:b.command}),b.preventDefault(),!0):void 0}),a.addCommand("InsertUnorderedList",function(a,b){A("UL",b)}),a.addCommand("InsertOrderedList",function(a,b){A("OL",b)}),a.addCommand("InsertDefinitionList",function(a,b){A("DL",b)}),a.addQueryStateHandler("InsertUnorderedList",B("UL")),a.addQueryStateHandler("InsertOrderedList",B("OL")),a.addQueryStateHandler("InsertDefinitionList",B("DL")),a.on("keydown",function(b){9!=b.keyCode||tinymce.util.VK.metaKeyPressed(b)||a.dom.getParent(a.selection.getStart(),"LI,DT,DD")&&(b.preventDefault(),b.shiftKey?x():w())})}),a.addButton("indent",{icon:"indent",title:"Increase indent",cmd:"Indent",onPostRender:function(){var b=this;a.on("nodechange",function(){for(var c=a.selection.getSelectedBlocks(),d=!1,e=0,g=c.length;!d&&g>e;e++){var h=c[e].nodeName;d="LI"==h&&f(c[e])||"UL"==h||"OL"==h||"DD"==h}b.disabled(d)})}}),a.on("keydown",function(a){a.keyCode==tinymce.util.VK.BACKSPACE?m.backspaceDelete()&&a.preventDefault():a.keyCode==tinymce.util.VK.DELETE&&m.backspaceDelete(!0)&&a.preventDefault()})});
|
1
|
+
tinymce.PluginManager.add("lists",function(a){function b(b){return a.$.contains(a.getBody(),b)}function c(a){return a&&"BR"==a.nodeName}function d(a){return a&&/^(OL|UL|DL)$/.test(a.nodeName)&&b(a)}function e(a){return a&&/^(LI|DT|DD)$/.test(a.nodeName)}function f(a){return a.parentNode.firstChild==a}function g(a){return a.parentNode.lastChild==a}function h(b){return b&&!!a.schema.getTextBlockElements()[b.nodeName]}function i(b){return b===a.getBody()}function j(a){return a&&3===a.nodeType}function k(a,b){var c=tinymce.dom.RangeUtils.getNode(a,b);if(e(a)&&j(c)){var d=b>=a.childNodes.length?c.data.length:0;return{container:c,offset:d}}return{container:a,offset:b}}function l(a){var b=a.cloneRange(),c=k(a.startContainer,a.startOffset);b.setStart(c.container,c.offset);var d=k(a.endContainer,a.endOffset);return b.setEnd(d.container,d.offset),b}var m=this;a.on("init",function(){function j(a,b){var c=H.isEmpty(a);return!(b&&H.select("span[data-mce-type=bookmark]").length>0)&&c}function k(a){function b(b){var d,e,f;e=a[b?"startContainer":"endContainer"],f=a[b?"startOffset":"endOffset"],1==e.nodeType&&(d=H.create("span",{"data-mce-type":"bookmark"}),e.hasChildNodes()?(f=Math.min(f,e.childNodes.length-1),b?e.insertBefore(d,e.childNodes[f]):H.insertAfter(d,e.childNodes[f])):e.appendChild(d),e=d,f=0),c[b?"startContainer":"endContainer"]=e,c[b?"startOffset":"endOffset"]=f}var c={};return b(!0),a.collapsed||b(),c}function n(a){function b(b){function c(a){for(var b=a.parentNode.firstChild,c=0;b;){if(b==a)return c;1==b.nodeType&&"bookmark"==b.getAttribute("data-mce-type")||c++,b=b.nextSibling}return-1}var d,e,f;d=f=a[b?"startContainer":"endContainer"],e=a[b?"startOffset":"endOffset"],d&&(1==d.nodeType&&(e=c(d),d=d.parentNode,H.remove(f)),a[b?"startContainer":"endContainer"]=d,a[b?"startOffset":"endOffset"]=e)}b(!0),b();var c=H.createRng();c.setStart(a.startContainer,a.startOffset),a.endContainer&&c.setEnd(a.endContainer,a.endOffset),I.setRng(l(c))}function o(b,c){var d,e,f,g=H.createFragment(),h=a.schema.getBlockElements();if(a.settings.forced_root_block&&(c=c||a.settings.forced_root_block),c&&(e=H.create(c),e.tagName===a.settings.forced_root_block&&H.setAttribs(e,a.settings.forced_root_block_attrs),g.appendChild(e)),b)for(;d=b.firstChild;){var i=d.nodeName;f||"SPAN"==i&&"bookmark"==d.getAttribute("data-mce-type")||(f=!0),h[i]?(g.appendChild(d),e=null):c?(e||(e=H.create(c),g.appendChild(e)),e.appendChild(d)):g.appendChild(d)}return a.settings.forced_root_block?f||tinymce.Env.ie&&!(tinymce.Env.ie>10)||e.appendChild(H.create("br",{"data-mce-bogus":"1"})):g.appendChild(H.create("br")),g}function p(){return tinymce.grep(I.getSelectedBlocks(),function(a){return e(a)})}function q(a,b,c){function d(a){tinymce.each(g,function(c){a.parentNode.insertBefore(c,b.parentNode)}),H.remove(a)}var e,f,g,h;for(g=H.select('span[data-mce-type="bookmark"]',a),c=c||o(b),e=H.createRng(),e.setStartAfter(b),e.setEndAfter(a),f=e.extractContents(),h=f.firstChild;h;h=h.firstChild)if("LI"==h.nodeName&&H.isEmpty(h)){H.remove(h);break}H.isEmpty(f)||H.insertAfter(f,a),H.insertAfter(c,a),j(b.parentNode)&&d(b.parentNode),H.remove(b),j(a)&&H.remove(a)}function r(a){var b,c;if(b=a.nextSibling,b&&d(b)&&b.nodeName==a.nodeName&&J(a,b)){for(;c=b.firstChild;)a.appendChild(c);H.remove(b)}if(b=a.previousSibling,b&&d(b)&&b.nodeName==a.nodeName&&J(a,b)){for(;c=b.lastChild;)a.insertBefore(c,a.firstChild);H.remove(b)}}function s(a){tinymce.each(tinymce.grep(H.select("ol,ul",a)),t)}function t(a){var b,c=a.parentNode;"LI"==c.nodeName&&c.firstChild==a&&(b=c.previousSibling,b&&"LI"==b.nodeName?(b.appendChild(a),j(c)&&H.remove(c)):H.setStyle(c,"listStyleType","none")),d(c)&&(b=c.previousSibling,b&&"LI"==b.nodeName&&b.appendChild(a))}function u(a){function b(a){j(a)&&H.remove(a)}var c,e=a.parentNode,h=e.parentNode;return!!i(e)||("DD"==a.nodeName?(H.rename(a,"DT"),!0):f(a)&&g(a)?("LI"==h.nodeName?(H.insertAfter(a,h),b(h),H.remove(e)):d(h)?H.remove(e,!0):(h.insertBefore(o(a),e),H.remove(e)),!0):f(a)?("LI"==h.nodeName?(H.insertAfter(a,h),a.appendChild(e),b(h)):d(h)?h.insertBefore(a,e):(h.insertBefore(o(a),e),H.remove(a)),!0):g(a)?("LI"==h.nodeName?H.insertAfter(a,h):d(h)?H.insertAfter(a,e):(H.insertAfter(o(a),e),H.remove(a)),!0):("LI"==h.nodeName?(e=h,c=o(a,"LI")):c=d(h)?o(a,"LI"):o(a),q(e,a,c),s(e.parentNode),!0))}function v(a){function b(b,c){var e;if(d(b)){for(;e=a.lastChild.firstChild;)c.appendChild(e);H.remove(b)}}var c,e,f;return"DT"==a.nodeName?(H.rename(a,"DD"),!0):(c=a.previousSibling,c&&d(c)?(c.appendChild(a),!0):c&&"LI"==c.nodeName&&d(c.lastChild)?(c.lastChild.appendChild(a),b(a.lastChild,c.lastChild),!0):(c=a.nextSibling,c&&d(c)?(c.insertBefore(a,c.firstChild),!0):(c=a.previousSibling,!(!c||"LI"!=c.nodeName)&&(e=H.create(a.parentNode.nodeName),f=H.getStyle(a.parentNode,"listStyleType"),f&&H.setStyle(e,"listStyleType",f),c.appendChild(e),e.appendChild(a),b(a.lastChild,e),!0))))}function w(){var b=p();if(b.length){for(var c=k(I.getRng(!0)),d=0;d<b.length&&(v(b[d])||0!==d);d++);return n(c),a.nodeChanged(),!0}}function x(){var b=p();if(b.length){var c,d,e=k(I.getRng(!0)),f=a.getBody();for(c=b.length;c--;)for(var g=b[c].parentNode;g&&g!=f;){for(d=b.length;d--;)if(b[d]===g){b.splice(c,1);break}g=g.parentNode}for(c=0;c<b.length&&(u(b[c])||0!==c);c++);return n(e),a.nodeChanged(),!0}}function y(b,e){function f(){function b(a){var b,c;for(b=i[a?"startContainer":"endContainer"],c=i[a?"startOffset":"endOffset"],1==b.nodeType&&(b=b.childNodes[Math.min(c,b.childNodes.length-1)]||b);b.parentNode!=f;){if(h(b))return b;if(/^(TD|TH)$/.test(b.parentNode.nodeName))return b;b=b.parentNode}return b}for(var d,e=[],f=a.getBody(),g=b(!0),j=b(),k=[],l=g;l&&(k.push(l),l!=j);l=l.nextSibling);return tinymce.each(k,function(a){if(h(a))return e.push(a),void(d=null);if(H.isBlock(a)||c(a))return c(a)&&H.remove(a),void(d=null);var b=a.nextSibling;return tinymce.dom.BookmarkManager.isBookmarkNode(a)&&(h(b)||!b&&a.parentNode==f)?void(d=null):(d||(d=H.create("p"),a.parentNode.insertBefore(d,a),e.push(d)),void d.appendChild(a))}),e}var g,i=I.getRng(!0),j="LI";"false"!==H.getContentEditable(I.getNode())&&(b=b.toUpperCase(),"DL"==b&&(j="DT"),g=k(i),tinymce.each(f(),function(a){var c,f,g=function(a){var b=H.getStyle(a,"list-style-type"),c=e?e["list-style-type"]:"";return c=null===c?"":c,b===c};f=a.previousSibling,f&&d(f)&&f.nodeName==b&&g(f)?(c=f,a=H.rename(a,j),f.appendChild(a)):(c=H.create(b),a.parentNode.insertBefore(c,a),c.appendChild(a),a=H.rename(a,j)),K(c,e),r(c)}),n(g))}function z(){var b=k(I.getRng(!0)),c=a.getBody();tinymce.each(p(),function(a){var b,e;if(!i(a.parentNode)){if(j(a))return void u(a);for(b=a;b&&b!=c;b=b.parentNode)d(b)&&(e=b);q(e,a),s(e.parentNode)}}),n(b)}function A(a,b){var c=H.getParent(I.getStart(),"OL,UL,DL");if(!i(c))if(c)if(c.nodeName==a)z(a);else{var d=k(I.getRng(!0));K(c,b),r(H.rename(c,a)),n(d)}else y(a,b)}function B(b){return function(){var c=H.getParent(a.selection.getStart(),"UL,OL,DL");return c&&c.nodeName==b}}function C(a){return!!c(a)&&!(!H.isBlock(a.nextSibling)||c(a.previousSibling))}function D(b,c){var d,e,f=b.startContainer,g=b.startOffset;if(3==f.nodeType&&(c?g<f.data.length:g>0))return f;for(d=a.schema.getNonEmptyElements(),1==f.nodeType&&(f=tinymce.dom.RangeUtils.getNode(f,g)),e=new tinymce.dom.TreeWalker(f,a.getBody()),c&&C(f)&&e.next();f=e[c?"next":"prev2"]();){if("LI"==f.nodeName&&!f.hasChildNodes())return f;if(d[f.nodeName])return f;if(3==f.nodeType&&f.data.length>0)return f}}function E(a,e){var f,g,h=a.parentNode;if(b(a)&&b(e)){if(d(e.lastChild)&&(g=e.lastChild),h==e.lastChild&&c(h.previousSibling)&&H.remove(h.previousSibling),f=e.lastChild,f&&c(f)&&a.hasChildNodes()&&H.remove(f),j(e,!0)&&H.$(e).empty(),!j(a,!0))for(;f=a.firstChild;)e.appendChild(f);g&&e.appendChild(g),H.remove(a),j(h)&&!i(h)&&H.remove(h)}}function F(a){var b,c,d,e=H.getParent(I.getStart(),"LI");if(e){if(b=e.parentNode,i(b)&&H.isEmpty(b))return!0;if(c=l(I.getRng(!0)),d=H.getParent(D(c,a),"LI"),d&&d!=e){var f=k(c);return a?E(d,e):E(e,d),n(f),!0}if(!d&&!a&&z(b.nodeName))return!0}}function G(){var b=a.dom.getParent(a.selection.getStart(),"LI,DT,DD");return!!(b||p().length>0)&&(a.undoManager.transact(function(){a.execCommand("Delete"),s(a.getBody())}),!0)}var H=a.dom,I=a.selection,J=function(b,c){var d=a.dom.getStyle(b,"list-style-type",!0),e=a.dom.getStyle(c,"list-style-type",!0);return d===e},K=function(a,b){H.setStyle(a,"list-style-type",b?b["list-style-type"]:null)};m.backspaceDelete=function(a){return I.isCollapsed()?F(a):G()},a.on("BeforeExecCommand",function(b){var c,d=b.command.toLowerCase();if("indent"==d?w()&&(c=!0):"outdent"==d&&x()&&(c=!0),c)return a.fire("ExecCommand",{command:b.command}),b.preventDefault(),!0}),a.addCommand("InsertUnorderedList",function(a,b){A("UL",b)}),a.addCommand("InsertOrderedList",function(a,b){A("OL",b)}),a.addCommand("InsertDefinitionList",function(a,b){A("DL",b)}),a.addQueryStateHandler("InsertUnorderedList",B("UL")),a.addQueryStateHandler("InsertOrderedList",B("OL")),a.addQueryStateHandler("InsertDefinitionList",B("DL")),a.on("keydown",function(b){9!=b.keyCode||tinymce.util.VK.metaKeyPressed(b)||a.dom.getParent(a.selection.getStart(),"LI,DT,DD")&&(b.preventDefault(),b.shiftKey?x():w())})});var n=function(b){return function(){var c=this;a.on("NodeChange",function(a){var e=tinymce.util.Tools.grep(a.parents,d);c.active(e.length>0&&e[0].nodeName===b)})}};tinymce.PluginManager.get("advlist")||(a.addButton("numlist",{title:"Numbered list",cmd:"InsertOrderedList",onPostRender:n("OL")}),a.addButton("bullist",{title:"Bullet list",cmd:"InsertUnorderedList",onPostRender:n("UL")})),a.addButton("indent",{icon:"indent",title:"Increase indent",cmd:"Indent",onPostRender:function(){var b=this;a.on("nodechange",function(){for(var c=a.selection.getSelectedBlocks(),d=!1,e=0,g=c.length;!d&&e<g;e++){var h=c[e].nodeName;d="LI"==h&&f(c[e])||"UL"==h||"OL"==h||"DD"==h}b.disabled(d)})}}),a.on("keydown",function(a){a.keyCode==tinymce.util.VK.BACKSPACE?m.backspaceDelete()&&a.preventDefault():a.keyCode==tinymce.util.VK.DELETE&&m.backspaceDelete(!0)&&a.preventDefault()})});
|
@@ -1 +1 @@
|
|
1
|
-
tinymce.PluginManager.add("media",function(a,b){function c(a){return a=a.toLowerCase(),-1!=a.indexOf(".mp3")?"audio/mpeg":-1!=a.indexOf(".wav")?"audio/wav":-1!=a.indexOf(".mp4")?"video/mp4":-1!=a.indexOf(".webm")?"video/webm":-1!=a.indexOf(".ogg")?"video/ogg":-1!=a.indexOf(".swf")?"application/x-shockwave-flash":""}function d(b){var c=a.settings.media_scripts;if(c)for(var d=0;d<c.length;d++)if(-1!==b.indexOf(c[d].filter))return c[d]}function e(){function b(a){var b,c,f,g;b=d.find("#width")[0],c=d.find("#height")[0],f=b.value(),g=c.value(),d.find("#constrain")[0].checked()&&e&&j&&f&&g&&(a.control==b?(g=Math.round(f/e*g),isNaN(g)||c.value(g)):(f=Math.round(g/j*f),isNaN(f)||b.value(f))),e=f,j=g}function c(){k=h(this.value()),this.parent().parent().fromJSON(k)}var d,e,j,k,l=[{name:"source1",type:"filepicker",filetype:"media",size:40,autofocus:!0,label:"Source",onchange:function(a){tinymce.each(a.meta,function(a,b){d.find("#"+b).value(a)})}}];a.settings.media_alt_source!==!1&&l.push({name:"source2",type:"filepicker",filetype:"media",size:40,label:"Alternative source"}),a.settings.media_poster!==!1&&l.push({name:"poster",type:"filepicker",filetype:"image",size:40,label:"Poster"}),a.settings.media_dimensions!==!1&&l.push({type:"container",label:"Dimensions",layout:"flex",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:5,size:3,onchange:b,ariaLabel:"Width"},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:5,size:3,onchange:b,ariaLabel:"Height"},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}),k=i(a.selection.getNode()),e=k.width,j=k.height;var m={id:"mcemediasource",type:"textbox",flex:1,name:"embed",value:f(),multiline:!0,label:"Source"};m[p]=c,d=a.windowManager.open({title:"Insert/edit video",data:k,bodyType:"tabpanel",body:[{title:"General",type:"form",onShowTab:function(){k=h(this.next().find("#embed").value()),this.fromJSON(k)},items:l},{title:"Embed",type:"container",layout:"flex",direction:"column",align:"stretch",padding:10,spacing:10,onShowTab:function(){this.find("#embed").value(g(this.parent().toJSON()))},items:[{type:"label",text:"Paste your embed code below:",forId:"mcemediasource"},m]}],onSubmit:function(){var b,c,d,e;for(b=a.dom.select("img[data-mce-object]"),a.insertContent(g(this.toJSON())),c=a.dom.select("img[data-mce-object]"),d=0;d<b.length;d++)for(e=c.length-1;e>=0;e--)b[d]==c[e]&&c.splice(e,1);a.selection.select(c[0]),a.nodeChanged()}})}function f(){var b=a.selection.getNode();return b.getAttribute("data-mce-object")?a.selection.getContent():void 0}function g(e){var f="";if(!e.source1&&(tinymce.extend(e,h(e.embed)),!e.source1))return"";if(e.source2||(e.source2=""),e.poster||(e.poster=""),e.source1=a.convertURL(e.source1,"source"),e.source2=a.convertURL(e.source2,"source"),e.source1mime=c(e.source1),e.source2mime=c(e.source2),e.poster=a.convertURL(e.poster,"poster"),e.flashPlayerUrl=a.convertURL(b+"/moxieplayer.swf","movie"),tinymce.each(o,function(a){var b,c,d;if(b=a.regex.exec(e.source1)){for(d=a.url,c=0;b[c];c++)d=d.replace("$"+c,function(){return b[c]});e.source1=d,e.type=a.type,e.allowFullscreen=a.allowFullscreen,e.width=e.width||a.w,e.height=e.height||a.h}}),e.embed)f=k(e.embed,e,!0);else{var g=d(e.source1);if(g&&(e.type="script",e.width=g.width,e.height=g.height),e.width=e.width||300,e.height=e.height||150,tinymce.each(e,function(b,c){e[c]=a.dom.encode(b)}),"iframe"==e.type){var i=e.allowFullscreen?' allowFullscreen="1"':"";f+='<iframe src="'+e.source1+'" width="'+e.width+'" height="'+e.height+'"'+i+"></iframe>"}else"application/x-shockwave-flash"==e.source1mime?(f+='<object data="'+e.source1+'" width="'+e.width+'" height="'+e.height+'" type="application/x-shockwave-flash">',e.poster&&(f+='<img src="'+e.poster+'" width="'+e.width+'" height="'+e.height+'" />'),f+="</object>"):-1!=e.source1mime.indexOf("audio")?a.settings.audio_template_callback?f=a.settings.audio_template_callback(e):f+='<audio controls="controls" src="'+e.source1+'">'+(e.source2?'\n<source src="'+e.source2+'"'+(e.source2mime?' type="'+e.source2mime+'"':"")+" />\n":"")+"</audio>":"script"==e.type?f+='<script src="'+e.source1+'"></script>':f=a.settings.video_template_callback?a.settings.video_template_callback(e):'<video width="'+e.width+'" height="'+e.height+'"'+(e.poster?' poster="'+e.poster+'"':"")+' controls="controls">\n<source src="'+e.source1+'"'+(e.source1mime?' type="'+e.source1mime+'"':"")+" />\n"+(e.source2?'<source src="'+e.source2+'"'+(e.source2mime?' type="'+e.source2mime+'"':"")+" />\n":"")+"</video>"}return f}function h(a){var b={};return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!0,special:"script,noscript",start:function(a,c){if(b.source1||"param"!=a||(b.source1=c.map.movie),"iframe"!=a&&"object"!=a&&"embed"!=a&&"video"!=a&&"audio"!=a||(b.type||(b.type=a),b=tinymce.extend(c.map,b)),"script"==a){var e=d(c.map.src);if(!e)return;b={type:"script",source1:c.map.src,width:e.width,height:e.height}}"source"==a&&(b.source1?b.source2||(b.source2=c.map.src):b.source1=c.map.src),"img"!=a||b.poster||(b.poster=c.map.src)}}).parse(a),b.source1=b.source1||b.src||b.data,b.source2=b.source2||"",b.poster=b.poster||"",b}function i(b){return b.getAttribute("data-mce-object")?h(a.serializer.serialize(b,{selection:!0})):{}}function j(b){if(a.settings.media_filter_html===!1)return b;var c,d=new tinymce.html.Writer;return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!1,special:"script,noscript",comment:function(a){d.comment(a)},cdata:function(a){d.cdata(a)},text:function(a,b){d.text(a,b)},start:function(b,e,f){if(c=!0,"script"!=b&&"noscript"!=b){for(var g=0;g<e.length;g++){if(0===e[g].name.indexOf("on"))return;"style"==e[g].name&&(e[g].value=a.dom.serializeStyle(a.dom.parseStyle(e[g].value),b))}d.start(b,e,f),c=!1}},end:function(a){c||d.end(a)}},new tinymce.html.Schema({})).parse(b),d.getContent()}function k(a,b,c){function d(a,b){var c,d,e,f;for(c in b)if(e=""+b[c],a.map[c])for(d=a.length;d--;)f=a[d],f.name==c&&(e?(a.map[c]=e,f.value=e):(delete a.map[c],a.splice(d,1)));else e&&(a.push({name:c,value:e}),a.map[c]=e)}var e,f=new tinymce.html.Writer,g=0;return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!0,special:"script,noscript",comment:function(a){f.comment(a)},cdata:function(a){f.cdata(a)},text:function(a,b){f.text(a,b)},start:function(a,h,i){switch(a){case"video":case"object":case"embed":case"img":case"iframe":d(h,{width:b.width,height:b.height})}if(c)switch(a){case"video":d(h,{poster:b.poster,src:""}),b.source2&&d(h,{src:""});break;case"iframe":d(h,{src:b.source1});break;case"source":if(g++,2>=g&&(d(h,{src:b["source"+g],type:b["source"+g+"mime"]}),!b["source"+g]))return;break;case"img":if(!b.poster)return;e=!0}f.start(a,h,i)},end:function(a){if("video"==a&&c)for(var h=1;2>=h;h++)if(b["source"+h]){var i=[];i.map={},h>g&&(d(i,{src:b["source"+h],type:b["source"+h+"mime"]}),f.start("source",i,!0))}if(b.poster&&"object"==a&&c&&!e){var j=[];j.map={},d(j,{src:b.poster,width:b.width,height:b.height}),f.start("img",j,!0)}f.end(a)}},new tinymce.html.Schema({})).parse(a),f.getContent()}function l(b,c){var d,e,f,g,h;for(f=b.attributes,g=f.length;g--;)d=f[g].name,e=f[g].value,"width"!==d&&"height"!==d&&"style"!==d&&("data"!=d&&"src"!=d||(e=a.convertURL(e,d)),c.attr("data-mce-p-"+d,e));h=b.firstChild&&b.firstChild.value,h&&(c.attr("data-mce-html",escape(h)),c.firstChild=null)}function m(a){var b,c=a.name;return b=new tinymce.html.Node("img",1),b.shortEnded=!0,l(a,b),b.attr({width:a.attr("width")||"300",height:a.attr("height")||("audio"==c?"30":"150"),style:a.attr("style"),src:tinymce.Env.transparentSrc,"data-mce-object":c,"class":"mce-object mce-object-"+c}),b}function n(a){var b,c,d,e=a.name;return b=new tinymce.html.Node("span",1),b.attr({contentEditable:"false",style:a.attr("style"),"data-mce-object":e,"class":"mce-preview-object mce-object-"+e}),l(a,b),c=new tinymce.html.Node(e,1),c.attr({src:a.attr("src"),allowfullscreen:a.attr("allowfullscreen"),width:a.attr("width")||"300",height:a.attr("height")||("audio"==e?"30":"150"),frameborder:"0"}),d=new tinymce.html.Node("span",1),d.attr("class","mce-shim"),b.append(c),b.append(d),b}var o=[{regex:/youtu\.be\/([\w\-.]+)/,type:"iframe",w:560,h:314,url:"//www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/youtube\.com(.+)v=([^&]+)/,type:"iframe",w:560,h:314,url:"//www.youtube.com/embed/$2",allowFullscreen:!0},{regex:/youtube.com\/embed\/([a-z0-9\-_]+(?:\?.+)?)/i,type:"iframe",w:560,h:314,url:"//www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc",allowfullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$2?title=0&byline=0",allowfullscreen:!0},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'//maps.google.com/maps/ms?msid=$2&output=embed"',allowFullscreen:!1},{regex:/dailymotion\.com\/video\/([^_]+)/,type:"iframe",w:480,h:270,url:"//www.dailymotion.com/embed/video/$1",allowFullscreen:!0}],p=tinymce.Env.ie&&tinymce.Env.ie<=8?"onChange":"onInput";a.on("ResolveName",function(a){var b;1==a.target.nodeType&&(b=a.target.getAttribute("data-mce-object"))&&(a.name=b)}),a.on("preInit",function(){var b=a.schema.getSpecialElements();tinymce.each("video audio iframe object".split(" "),function(a){b[a]=new RegExp("</"+a+"[^>]*>","gi")});var c=a.schema.getBoolAttrs();tinymce.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),function(a){c[a]={}}),a.parser.addNodeFilter("iframe,video,audio,object,embed,script",function(b){for(var c,e,f,g=b.length;g--;)c=b[g],c.parent&&(c.parent.attr("data-mce-object")||("script"!=c.name||(f=d(c.attr("src"))))&&(f&&(f.width&&c.attr("width",f.width.toString()),f.height&&c.attr("height",f.height.toString())),e="iframe"==c.name&&a.settings.media_live_embeds!==!1&&tinymce.Env.ceFalse?n(c):m(c),c.replace(e)))}),a.serializer.addAttributeFilter("data-mce-object",function(a,b){for(var c,d,e,f,g,h,i,k,l=a.length;l--;)if(c=a[l],c.parent){for(i=c.attr(b),d=new tinymce.html.Node(i,1),"audio"!=i&&"script"!=i&&(k=c.attr("class"),k&&-1!==k.indexOf("mce-preview-object")?d.attr({width:c.firstChild.attr("width"),height:c.firstChild.attr("height")}):d.attr({width:c.attr("width"),height:c.attr("height")})),d.attr({style:c.attr("style")}),f=c.attributes,e=f.length;e--;){var m=f[e].name;0===m.indexOf("data-mce-p-")&&d.attr(m.substr(11),f[e].value)}"script"==i&&d.attr("type","text/javascript"),g=c.attr("data-mce-html"),g&&(h=new tinymce.html.Node("#text",3),h.raw=!0,h.value=j(unescape(g)),d.append(h)),c.replace(d)}})}),a.on("click keyup",function(){var b=a.selection.getNode();b&&a.dom.hasClass(b,"mce-preview-object")&&a.dom.getAttrib(b,"data-mce-selected")&&b.setAttribute("data-mce-selected","2")}),a.on("ObjectSelected",function(a){var b=a.target.getAttribute("data-mce-object");"audio"!=b&&"script"!=b||a.preventDefault()}),a.on("objectResized",function(a){var b,c=a.target;c.getAttribute("data-mce-object")&&(b=c.getAttribute("data-mce-html"),b&&(b=unescape(b),c.setAttribute("data-mce-html",escape(k(b,{width:a.width,height:a.height})))))}),a.addButton("media",{tooltip:"Insert/edit video",onclick:e,stateSelector:["img[data-mce-object]","span[data-mce-object]"]}),a.addMenuItem("media",{icon:"media",text:"Insert/edit video",onclick:e,context:"insert",prependToContext:!0}),a.on("setContent",function(){a.$("span.mce-preview-object").each(function(b,c){var d=a.$(c);0===d.find("span.mce-shim",c).length&&d.append('<span class="mce-shim"></span>')})}),a.addCommand("mceMedia",e),this.showDialog=e});
|
1
|
+
!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i<g;++i)h[i]=d(e[i]);var j=f.apply(null,h);if(void 0===j)throw"module ["+b+"] returned undefined";c.instance=j},c=function(b,c,d){if("string"!=typeof b)throw"module id must be a string";if(void 0===c)throw"no dependencies for "+b;if(void 0===d)throw"no definition function for "+b;a[b]={deps:c,defn:d,instance:void 0}},d=function(c){var d=a[c];if(void 0===d)throw"module ["+c+"] was undefined";return void 0===d.instance&&b(c),d.instance},e=function(a,b){for(var c=a.length,e=new Array(c),f=0;f<c;++f)e.push(d(a[f]));b.apply(null,b)},f={};f.bolt={module:{api:{define:c,require:e,demand:d}}};var g=c,h=function(a,b){g(a,[],function(){return b})};h("1",tinymce.PluginManager),h("6",tinymce.util.Delay),h("c",tinymce.util.Tools),h("9",tinymce.html.SaxParser),h("a",tinymce.html.Schema),g("e",[],function(){var a=function(a,b){if(a)for(var c=0;c<a.length;c++)if(b.indexOf(a[c].filter)!==-1)return a[c]};return{getVideoScriptMatch:a}}),g("7",["c","9","a","e"],function(a,b,c,d){var e=function(c,e){var f={};return new b({validate:!1,allow_conditional_comments:!0,special:"script,noscript",start:function(b,e){f.source1||"param"!==b||(f.source1=e.map.movie);var g=e.map["data-ephox-embed-iri"];if(g&&(f.type="ephox-embed-iri",f.source1=g),"iframe"!==b&&"object"!==b&&"embed"!==b&&"video"!==b&&"audio"!==b||(f.type||(f.type=b),f=a.extend(e.map,f)),"script"===b){var h=d.getVideoScriptMatch(c,e.map.src);if(!h)return;f={type:"script",source1:e.map.src,width:h.width,height:h.height}}"source"===b&&(f.source1?f.source2||(f.source2=e.map.src):f.source1=e.map.src),"img"!==b||f.poster||(f.poster=e.map.src)}}).parse(e),f.source1=f.source1||f.src||f.data,f.source2=f.source2||"",f.poster=f.poster||"","ephox-embed-iri"===f.type?a.extend({},{type:f.type,source1:f.source1,source2:"",poster:"",width:f.width,height:f.height}):f};return{htmlToData:e}}),h("8",tinymce.html.Writer),g("4",["8","9","a"],function(a,b,c){var d=function(a,b){var c,d,e,f;for(c in b)if(e=""+b[c],a.map[c])for(d=a.length;d--;)f=a[d],f.name===c&&(e?(a.map[c]=e,f.value=e):(delete a.map[c],a.splice(d,1)));else e&&(a.push({name:c,value:e}),a.map[c]=e)},e=function(e,f,g){var h,i=new a,j=0;return new b({validate:!1,allow_conditional_comments:!0,special:"script,noscript",comment:function(a){i.comment(a)},cdata:function(a){i.cdata(a)},text:function(a,b){i.text(a,b)},start:function(a,b,c){switch(a){case"video":case"object":case"embed":case"img":case"iframe":d(b,{width:f.width,height:f.height})}if(g)switch(a){case"video":d(b,{poster:f.poster,src:""}),f.source2&&d(b,{src:""});break;case"iframe":d(b,{src:f.source1});break;case"source":if(j++,j<=2&&(d(b,{src:f["source"+j],type:f["source"+j+"mime"]}),!f["source"+j]))return;break;case"img":if(!f.poster)return;h=!0}i.start(a,b,c)},end:function(a){if("video"===a&&g)for(var b=1;b<=2;b++)if(f["source"+b]){var c=[];c.map={},j<b&&(d(c,{src:f["source"+b],type:f["source"+b+"mime"]}),i.start("source",c,!0))}if(f.poster&&"object"===a&&g&&!h){var e=[];e.map={},d(e,{src:f.poster,width:f.width,height:f.height}),i.start("img",e,!0)}i.end(a)}},new c({})).parse(e),i.getContent()};return{updateHtml:e}}),g("i",[],function(){var a=function(a){var b={mp3:"audio/mpeg",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"},c=a.toLowerCase().split(".").pop(),d=b[c];return d?d:""};return{guess:a}}),g("j",[],function(){var a=[{regex:/youtu\.be\/([\w\-.]+)/,type:"iframe",w:560,h:314,url:"//www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/youtube\.com(.+)v=([^&]+)/,type:"iframe",w:560,h:314,url:"//www.youtube.com/embed/$2",allowFullscreen:!0},{regex:/youtube.com\/embed\/([a-z0-9\-_]+(?:\?.+)?)/i,type:"iframe",w:560,h:314,url:"//www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc",allowfullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$2?title=0&byline=0",allowfullscreen:!0},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'//maps.google.com/maps/ms?msid=$2&output=embed"',allowFullscreen:!1},{regex:/dailymotion\.com\/video\/([^_]+)/,type:"iframe",w:480,h:270,url:"//www.dailymotion.com/embed/video/$1",allowFullscreen:!0}];return{urlPatterns:a}}),g("g",["i","7","j","e","4","c"],function(a,b,c,d,e,f){var g=function(g,h){var i="",j=f.extend({},h);if(!j.source1&&(f.extend(j,b.htmlToData(g.settings.media_scripts,j.embed)),!j.source1))return"";if(j.source2||(j.source2=""),j.poster||(j.poster=""),j.source1=g.convertURL(j.source1,"source"),j.source2=g.convertURL(j.source2,"source"),j.source1mime=a.guess(j.source1),j.source2mime=a.guess(j.source2),j.poster=g.convertURL(j.poster,"poster"),f.each(c.urlPatterns,function(a){var b,c,d=a.regex.exec(j.source1);if(d){for(c=a.url,b=0;d[b];b++)c=c.replace("$"+b,function(){return d[b]});j.source1=c,j.type=a.type,j.allowFullscreen=a.allowFullscreen,j.width=j.width||a.w,j.height=j.height||a.h}}),j.embed)i=e.updateHtml(j.embed,j,!0);else{var k=d.getVideoScriptMatch(g.settings.media_scripts,j.source1);if(k&&(j.type="script",j.width=k.width,j.height=k.height),j.width=j.width||300,j.height=j.height||150,f.each(j,function(a,b){j[b]=g.dom.encode(a)}),"iframe"===j.type){var l=j.allowFullscreen?' allowFullscreen="1"':"";i+='<iframe src="'+j.source1+'" width="'+j.width+'" height="'+j.height+'"'+l+"></iframe>"}else"application/x-shockwave-flash"===j.source1mime?(i+='<object data="'+j.source1+'" width="'+j.width+'" height="'+j.height+'" type="application/x-shockwave-flash">',j.poster&&(i+='<img src="'+j.poster+'" width="'+j.width+'" height="'+j.height+'" />'),i+="</object>"):j.source1mime.indexOf("audio")!==-1?g.settings.audio_template_callback?i=g.settings.audio_template_callback(j):i+='<audio controls="controls" src="'+j.source1+'">'+(j.source2?'\n<source src="'+j.source2+'"'+(j.source2mime?' type="'+j.source2mime+'"':"")+" />\n":"")+"</audio>":"script"===j.type?i+='<script src="'+j.source1+'"></script>':i=g.settings.video_template_callback?g.settings.video_template_callback(j):'<video width="'+j.width+'" height="'+j.height+'"'+(j.poster?' poster="'+j.poster+'"':"")+' controls="controls">\n<source src="'+j.source1+'"'+(j.source1mime?' type="'+j.source1mime+'"':"")+" />\n"+(j.source2?'<source src="'+j.source2+'"'+(j.source2mime?' type="'+j.source2mime+'"':"")+" />\n":"")+"</video>"}return i};return{dataToHtml:g}}),h("h",tinymce.util.Promise),g("b",["g","h"],function(a,b){var c=function(a,c,d){var e={};return new b(function(b,f){var g=function(d){return d.html&&(e[a.source1]=d),b({url:a.source1,html:d.html?d.html:c(a)})};e[a.source1]?g(e[a.source1]):d({url:a.source1},g,f)})},d=function(a,c){return new b(function(b){b({html:c(a),url:a.source1})})},e=function(b){return function(c){return a.dataToHtml(b,c)}},f=function(a,b){var f=a.settings.media_url_resolver;return f?c(b,e(a),f):d(b,e(a))};return{getEmbedHtml:f}}),h("d",tinymce.Env),g("2",["6","7","4","b","c","d"],function(a,b,c,d,e,f){var g=f.ie&&f.ie<=8?"onChange":"onInput",h=function(a){return function(b){var c=b&&b.msg?"Media embed handler error: "+b.msg:"Media embed handler threw unknown error.";a.notificationManager.open({type:"error",text:c})}},i=function(a){var c=a.selection.getNode(),d=c.getAttribute("data-ephox-embed-iri");return d?{source1:d,"data-ephox-embed-iri":d}:c.getAttribute("data-mce-object")?b.htmlToData(a.settings.media_scripts,a.serializer.serialize(c,{selection:!0})):{}},j=function(a){var b=a.selection.getNode();if(b.getAttribute("data-mce-object"))return a.selection.getContent()},k=function(a,c){return function(d){var f=d.html;a.find("#embed").value(f);var g=e.extend(b.htmlToData(c.settings.media_scripts,f),{source1:d.url});a.fromJSON(g),n(a)}},l=function(a,b){var c,d,e=a.dom.select("img[data-mce-object]");for(c=0;c<b.length;c++)for(d=e.length-1;d>=0;d--)b[c]===e[d]&&e.splice(d,1);a.selection.select(e[0])},m=function(a){return function(){var b=this.toJSON();d.getEmbedHtml(a,b).then(function(c){var d=a.dom.select("img[data-mce-object]"),e=b.embed?b.embed:c.html;a.insertContent(e),l(a,d),a.nodeChanged()}).catch(h(a))}},n=function(a){var b=a.find("#width")[0],c=a.find("#height")[0];b&&c&&(b.state.set("oldVal",b.value()),c.state.set("oldVal",c.value()))},o=function(a,b){e.each(b,function(b,c){a.find("#"+c).value(b)})},p=function(a){var f,l,p=[{name:"source1",type:"filepicker",filetype:"media",size:40,autofocus:!0,label:"Source",onpaste:function(){setTimeout(function(){d.getEmbedHtml(a,f.toJSON()).then(k(f,a)).catch(h(a))},1)},onchange:function(b){d.getEmbedHtml(a,f.toJSON()).then(k(f,a)).catch(h(a)),o(f,b.meta)},onbeforecall:function(a){a.meta=f.toJSON()}}],q=function(a){var b=f.find("#width")[0],d=f.find("#height")[0],e=b.state.get("oldVal"),g=d.state.get("oldVal"),h=b.value(),i=d.value();f.find("#constrain")[0].checked()&&e&&g&&h&&i&&(a.control.name()===b.name()?(i=Math.round(h/e*i),isNaN(i)||d.value(i)):(h=Math.round(i/g*h),isNaN(h)||b.value(h))),l=f.toJSON(),f.find("#embed").value(c.updateHtml(l.embed,l)),n(f)};a.settings.media_alt_source!==!1&&p.push({name:"source2",type:"filepicker",filetype:"media",size:40,label:"Alternative source"}),a.settings.media_poster!==!1&&p.push({name:"poster",type:"filepicker",filetype:"image",size:40,label:"Poster"}),a.settings.media_dimensions!==!1&&p.push({type:"container",label:"Dimensions",layout:"flex",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:5,size:3,onchange:q,ariaLabel:"Width"},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:5,size:3,onchange:q,ariaLabel:"Height"},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}),l=i(a);var r={id:"mcemediasource",type:"textbox",flex:1,name:"embed",value:j(a),multiline:!0,label:"Source"},s=function(){l=e.extend({},b.htmlToData(a.settings.media_scripts,this.value())),this.parent().parent().fromJSON(l)};r[g]=s,f=a.windowManager.open({title:"Insert/edit video",data:l,bodyType:"tabpanel",body:[{title:"General",type:"form",items:p},{title:"Embed",type:"container",layout:"flex",direction:"column",align:"stretch",padding:10,spacing:10,items:[{type:"label",text:"Paste your embed code below:",forId:"mcemediasource"},r]}],onSubmit:m(a)}),n(f)};return{showDialog:p}}),g("3",["c","8","9","a"],function(a,b,c,d){var e=function(a,e){if(a.settings.media_filter_html===!1)return e;var f,g=new b;return new c({validate:!1,allow_conditional_comments:!1,special:"script,noscript",comment:function(a){g.comment(a)},cdata:function(a){g.cdata(a)},text:function(a,b){g.text(a,b)},start:function(b,c,d){if(f=!0,"script"!==b&&"noscript"!==b){for(var e=0;e<c.length;e++){if(0===c[e].name.indexOf("on"))return;"style"===c[e].name&&(c[e].value=a.dom.serializeStyle(a.dom.parseStyle(c[e].value),b))}g.start(b,c,d),f=!1}},end:function(a){f||g.end(a)}},new d({})).parse(e),g.getContent()};return{sanitize:e}}),h("f",tinymce.html.Node),g("5",["3","e","f","d"],function(a,b,c,d){var e=function(a,b){var e,f=b.name;return e=new c("img",1),e.shortEnded=!0,g(a,b,e),e.attr({width:b.attr("width")||"300",height:b.attr("height")||("audio"===f?"30":"150"),style:b.attr("style"),src:d.transparentSrc,"data-mce-object":f,class:"mce-object mce-object-"+f}),e},f=function(a,b){var d,e,f,h=b.name;return d=new c("span",1),d.attr({contentEditable:"false",style:b.attr("style"),"data-mce-object":h,class:"mce-preview-object mce-object-"+h}),g(a,b,d),e=new c(h,1),e.attr({src:b.attr("src"),allowfullscreen:b.attr("allowfullscreen"),width:b.attr("width")||"300",height:b.attr("height")||("audio"===h?"30":"150"),frameborder:"0"}),f=new c("span",1),f.attr("class","mce-shim"),d.append(e),d.append(f),d},g=function(b,c,d){var e,f,g,h,i;for(g=c.attributes,h=g.length;h--;)e=g[h].name,f=g[h].value,"width"!==e&&"height"!==e&&"style"!==e&&("data"!==e&&"src"!==e||(f=b.convertURL(f,e)),d.attr("data-mce-p-"+e,f));i=c.firstChild&&c.firstChild.value,i&&(d.attr("data-mce-html",escape(a.sanitize(b,i))),d.firstChild=null)},h=function(a){return function(c){for(var g,h,i,j=c.length;j--;)g=c[j],g.parent&&(g.parent.attr("data-mce-object")||("script"!==g.name||(i=b.getVideoScriptMatch(a.settings.media_scripts,g.attr("src"))))&&(i&&(i.width&&g.attr("width",i.width.toString()),i.height&&g.attr("height",i.height.toString())),h="iframe"===g.name&&a.settings.media_live_embeds!==!1&&d.ceFalse?f(a,g):e(a,g),g.replace(h)))}};return{createPreviewNode:f,createPlaceholderNode:e,placeHolderConverter:h}}),g("0",["1","2","3","4","5"],function(a,b,c,d,e){var f=function(a){a.on("ResolveName",function(a){var b;1===a.target.nodeType&&(b=a.target.getAttribute("data-mce-object"))&&(a.name=b)}),a.on("preInit",function(){var b=a.schema.getSpecialElements();tinymce.each("video audio iframe object".split(" "),function(a){b[a]=new RegExp("</"+a+"[^>]*>","gi")});var d=a.schema.getBoolAttrs();tinymce.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),function(a){d[a]={}}),a.parser.addNodeFilter("iframe,video,audio,object,embed,script",e.placeHolderConverter(a)),a.serializer.addAttributeFilter("data-mce-object",function(b,d){for(var e,f,g,h,i,j,k,l,m=b.length;m--;)if(e=b[m],e.parent){for(k=e.attr(d),f=new tinymce.html.Node(k,1),"audio"!==k&&"script"!==k&&(l=e.attr("class"),l&&l.indexOf("mce-preview-object")!==-1?f.attr({width:e.firstChild.attr("width"),height:e.firstChild.attr("height")}):f.attr({width:e.attr("width"),height:e.attr("height")})),f.attr({style:e.attr("style")}),h=e.attributes,g=h.length;g--;){var n=h[g].name;0===n.indexOf("data-mce-p-")&&f.attr(n.substr(11),h[g].value)}"script"===k&&f.attr("type","text/javascript"),i=e.attr("data-mce-html"),i&&(j=new tinymce.html.Node("#text",3),j.raw=!0,j.value=c.sanitize(a,unescape(i)),f.append(j)),e.replace(f)}})}),a.on("click keyup",function(){var b=a.selection.getNode();b&&a.dom.hasClass(b,"mce-preview-object")&&a.dom.getAttrib(b,"data-mce-selected")&&b.setAttribute("data-mce-selected","2")}),a.on("ObjectSelected",function(a){var b=a.target.getAttribute("data-mce-object");"audio"!==b&&"script"!==b||a.preventDefault()}),a.on("objectResized",function(a){var b,c=a.target;c.getAttribute("data-mce-object")&&(b=c.getAttribute("data-mce-html"),b&&(b=unescape(b),c.setAttribute("data-mce-html",escape(d.updateHtml(b,{width:a.width,height:a.height})))))}),this.showDialog=function(){b.showDialog(a)},a.addButton("media",{tooltip:"Insert/edit video",onclick:this.showDialog,stateSelector:["img[data-mce-object]","span[data-mce-object]","div[data-ephox-embed-iri]"]}),a.addMenuItem("media",{icon:"media",text:"Media",onclick:this.showDialog,context:"insert",prependToContext:!0}),a.on("setContent",function(){a.$("span.mce-preview-object").each(function(b,c){var d=a.$(c);0===d.find("span.mce-shim",c).length&&d.append('<span class="mce-shim"></span>')})}),a.addCommand("mceMedia",this.showDialog)};return a.add("media",f),function(){}}),d("0")()}();
|
@@ -1 +1 @@
|
|
1
|
-
tinymce.PluginManager.add("nonbreaking",function(a){var b=a.getParam("nonbreaking_force_tab");if(a.addCommand("mceNonBreaking",function(){a.insertContent(a.plugins.visualchars&&a.plugins.visualchars.state?'<span class="mce-nbsp"> </span>':" "),a.dom.setAttrib(a.dom.select("span.mce-nbsp"),"data-mce-bogus","1")}),a.addButton("nonbreaking",{title:"Nonbreaking space",cmd:"mceNonBreaking"}),a.addMenuItem("nonbreaking",{text:"Nonbreaking space",cmd:"mceNonBreaking",context:"insert"}),b){var c=+b>1?+b:3;a.on("keydown",function(b){if(9==b.keyCode){if(b.shiftKey)return;b.preventDefault();for(var d=0;c
|
1
|
+
tinymce.PluginManager.add("nonbreaking",function(a){var b=a.getParam("nonbreaking_force_tab");if(a.addCommand("mceNonBreaking",function(){a.insertContent(a.plugins.visualchars&&a.plugins.visualchars.state?'<span class="mce-nbsp"> </span>':" "),a.dom.setAttrib(a.dom.select("span.mce-nbsp"),"data-mce-bogus","1")}),a.addButton("nonbreaking",{title:"Nonbreaking space",cmd:"mceNonBreaking"}),a.addMenuItem("nonbreaking",{text:"Nonbreaking space",cmd:"mceNonBreaking",context:"insert"}),b){var c=+b>1?+b:3;a.on("keydown",function(b){if(9==b.keyCode){if(b.shiftKey)return;b.preventDefault();for(var d=0;d<c;d++)a.execCommand("mceNonBreaking")}})}});
|
@@ -1 +1 @@
|
|
1
|
-
tinymce.PluginManager.add("noneditable",function(a){function b(a){return function(b){return
|
1
|
+
tinymce.PluginManager.add("noneditable",function(a){function b(a){return function(b){return(" "+b.attr("class")+" ").indexOf(a)!==-1}}function c(b){function c(b){var c=arguments,d=c[c.length-2],e=d>0?g.charAt(d-1):"";if('"'===e)return b;if(">"===e){var f=g.lastIndexOf("<",d);if(f!==-1){var i=g.substring(f,d);if(i.indexOf('contenteditable="false"')!==-1)return b}}return'<span class="'+h+'" data-mce-content="'+a.dom.encode(c[0])+'">'+a.dom.encode("string"==typeof c[1]?c[1]:c[0])+"</span>"}var d=f.length,g=b.content,h=tinymce.trim(e);if("raw"!=b.format){for(;d--;)g=g.replace(f[d],c);b.content=g}}var d,e,f,g="contenteditable";d=" "+tinymce.trim(a.getParam("noneditable_editable_class","mceEditable"))+" ",e=" "+tinymce.trim(a.getParam("noneditable_noneditable_class","mceNonEditable"))+" ";var h=b(d),i=b(e);f=a.getParam("noneditable_regexp"),f&&!f.length&&(f=[f]),a.on("PreInit",function(){f&&a.on("BeforeSetContent",c),a.parser.addAttributeFilter("class",function(a){for(var b,c=a.length;c--;)b=a[c],h(b)?b.attr(g,"true"):i(b)&&b.attr(g,"false")}),a.serializer.addAttributeFilter(g,function(a){for(var b,c=a.length;c--;)b=a[c],(h(b)||i(b))&&(f&&b.attr("data-mce-content")?(b.name="#text",b.type=3,b.raw=!0,b.value=b.attr("data-mce-content")):b.attr(g,null))})})});
|
@@ -1 +1 @@
|
|
1
|
-
tinymce.PluginManager.add("pagebreak",function(a){var b="mce-pagebreak",c=a.getParam("pagebreak_separator","<!-- pagebreak -->"),d=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(a){return"\\"+a}),"gi"),e='<img src="'+tinymce.Env.transparentSrc+'" class="'+b+'" data-mce-resize="false" data-mce-placeholder />';a.addCommand("mcePageBreak",function(){a.settings.pagebreak_split_block?a.insertContent("<p>"+e+"</p>"):a.insertContent(e)}),a.addButton("pagebreak",{title:"Page break",cmd:"mcePageBreak"}),a.addMenuItem("pagebreak",{text:"Page break",icon:"pagebreak",cmd:"mcePageBreak",context:"insert"}),a.on("ResolveName",function(c){"IMG"==c.target.nodeName&&a.dom.hasClass(c.target,b)&&(c.name="pagebreak")}),a.on("click",function(c){c=c.target,"IMG"===c.nodeName&&a.dom.hasClass(c,b)&&a.selection.select(c)}),a.on("BeforeSetContent",function(a){a.content=a.content.replace(d,e)}),a.on("PreInit",function(){a.serializer.addNodeFilter("img",function(b){for(var d,e,f=b.length;f--;)if(d=b[f],e=d.attr("class"),e
|
1
|
+
tinymce.PluginManager.add("pagebreak",function(a){var b="mce-pagebreak",c=a.getParam("pagebreak_separator","<!-- pagebreak -->"),d=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(a){return"\\"+a}),"gi"),e='<img src="'+tinymce.Env.transparentSrc+'" class="'+b+'" data-mce-resize="false" data-mce-placeholder />';a.addCommand("mcePageBreak",function(){a.settings.pagebreak_split_block?a.insertContent("<p>"+e+"</p>"):a.insertContent(e)}),a.addButton("pagebreak",{title:"Page break",cmd:"mcePageBreak"}),a.addMenuItem("pagebreak",{text:"Page break",icon:"pagebreak",cmd:"mcePageBreak",context:"insert"}),a.on("ResolveName",function(c){"IMG"==c.target.nodeName&&a.dom.hasClass(c.target,b)&&(c.name="pagebreak")}),a.on("click",function(c){c=c.target,"IMG"===c.nodeName&&a.dom.hasClass(c,b)&&a.selection.select(c)}),a.on("BeforeSetContent",function(a){a.content=a.content.replace(d,e)}),a.on("PreInit",function(){a.serializer.addNodeFilter("img",function(b){for(var d,e,f=b.length;f--;)if(d=b[f],e=d.attr("class"),e&&e.indexOf("mce-pagebreak")!==-1){var g=d.parent;if(a.schema.getBlockElements()[g.name]&&a.settings.pagebreak_split_block){g.type=3,g.value=c,g.raw=!0,d.remove();continue}d.type=3,d.value=c,d.raw=!0}})})});
|
@@ -0,0 +1,143 @@
|
|
1
|
+
/**
|
2
|
+
* Inline development version. Only to be used while developing since it uses document.write to load scripts.
|
3
|
+
*/
|
4
|
+
|
5
|
+
/*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */
|
6
|
+
/*globals $code */
|
7
|
+
|
8
|
+
(function(exports) {
|
9
|
+
"use strict";
|
10
|
+
|
11
|
+
var html = "", baseDir;
|
12
|
+
var modules = {}, exposedModules = [], moduleCount = 0;
|
13
|
+
|
14
|
+
var scripts = document.getElementsByTagName('script');
|
15
|
+
for (var i = 0; i < scripts.length; i++) {
|
16
|
+
var src = scripts[i].src;
|
17
|
+
|
18
|
+
if (src.indexOf('/plugin.dev.js') != -1) {
|
19
|
+
baseDir = src.substring(0, src.lastIndexOf('/'));
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
function require(ids, callback) {
|
24
|
+
var module, defs = [];
|
25
|
+
|
26
|
+
for (var i = 0; i < ids.length; ++i) {
|
27
|
+
module = modules[ids[i]] || resolve(ids[i]);
|
28
|
+
if (!module) {
|
29
|
+
throw 'module definition dependecy not found: ' + ids[i];
|
30
|
+
}
|
31
|
+
|
32
|
+
defs.push(module);
|
33
|
+
}
|
34
|
+
|
35
|
+
callback.apply(null, defs);
|
36
|
+
}
|
37
|
+
|
38
|
+
function resolve(id) {
|
39
|
+
if (exports.privateModules && id in exports.privateModules) {
|
40
|
+
return;
|
41
|
+
}
|
42
|
+
|
43
|
+
var target = exports;
|
44
|
+
var fragments = id.split(/[.\/]/);
|
45
|
+
|
46
|
+
for (var fi = 0; fi < fragments.length; ++fi) {
|
47
|
+
if (!target[fragments[fi]]) {
|
48
|
+
return;
|
49
|
+
}
|
50
|
+
|
51
|
+
target = target[fragments[fi]];
|
52
|
+
}
|
53
|
+
|
54
|
+
return target;
|
55
|
+
}
|
56
|
+
|
57
|
+
function register(id) {
|
58
|
+
var target = exports;
|
59
|
+
var fragments = id.split(/[.\/]/);
|
60
|
+
|
61
|
+
for (var fi = 0; fi < fragments.length - 1; ++fi) {
|
62
|
+
if (target[fragments[fi]] === undefined) {
|
63
|
+
target[fragments[fi]] = {};
|
64
|
+
}
|
65
|
+
|
66
|
+
target = target[fragments[fi]];
|
67
|
+
}
|
68
|
+
|
69
|
+
target[fragments[fragments.length - 1]] = modules[id];
|
70
|
+
}
|
71
|
+
|
72
|
+
function define(id, dependencies, definition) {
|
73
|
+
var privateModules, i;
|
74
|
+
|
75
|
+
if (typeof id !== 'string') {
|
76
|
+
throw 'invalid module definition, module id must be defined and be a string';
|
77
|
+
}
|
78
|
+
|
79
|
+
if (dependencies === undefined) {
|
80
|
+
throw 'invalid module definition, dependencies must be specified';
|
81
|
+
}
|
82
|
+
|
83
|
+
if (definition === undefined) {
|
84
|
+
throw 'invalid module definition, definition function must be specified';
|
85
|
+
}
|
86
|
+
|
87
|
+
require(dependencies, function() {
|
88
|
+
modules[id] = definition.apply(null, arguments);
|
89
|
+
});
|
90
|
+
|
91
|
+
if (--moduleCount === 0) {
|
92
|
+
for (i = 0; i < exposedModules.length; i++) {
|
93
|
+
register(exposedModules[i]);
|
94
|
+
}
|
95
|
+
}
|
96
|
+
|
97
|
+
// Expose private modules for unit tests
|
98
|
+
if (exports.AMDLC_TESTS) {
|
99
|
+
privateModules = exports.privateModules || {};
|
100
|
+
|
101
|
+
for (id in modules) {
|
102
|
+
privateModules[id] = modules[id];
|
103
|
+
}
|
104
|
+
|
105
|
+
for (i = 0; i < exposedModules.length; i++) {
|
106
|
+
delete privateModules[exposedModules[i]];
|
107
|
+
}
|
108
|
+
|
109
|
+
exports.privateModules = privateModules;
|
110
|
+
}
|
111
|
+
|
112
|
+
}
|
113
|
+
|
114
|
+
function expose(ids) {
|
115
|
+
exposedModules = ids;
|
116
|
+
}
|
117
|
+
|
118
|
+
function writeScripts() {
|
119
|
+
document.write(html);
|
120
|
+
}
|
121
|
+
|
122
|
+
function load(path) {
|
123
|
+
html += '<script type="text/javascript" src="' + baseDir + '/' + path + '"></script>\n';
|
124
|
+
moduleCount++;
|
125
|
+
}
|
126
|
+
|
127
|
+
// Expose globally
|
128
|
+
exports.define = define;
|
129
|
+
exports.require = require;
|
130
|
+
|
131
|
+
expose(["tinymce/pasteplugin/Utils"]);
|
132
|
+
|
133
|
+
load('classes/Utils.js');
|
134
|
+
load('classes/SmartPaste.js');
|
135
|
+
load('classes/Clipboard.js');
|
136
|
+
load('classes/WordFilter.js');
|
137
|
+
load('classes/Quirks.js');
|
138
|
+
load('classes/Plugin.js');
|
139
|
+
|
140
|
+
writeScripts();
|
141
|
+
})(this);
|
142
|
+
|
143
|
+
// $hash: f991045b4dd37405c0ee4fc0d6f2269c
|
@@ -1 +1 @@
|
|
1
|
-
!function(a,b){"use strict";function c(a,b){for(var c,d=[],f=0;f<a.length;++f){if(c=g[a[f]]||e(a[f]),!c)throw"module definition dependecy not found: "+a[f];d.push(c)}b.apply(null,d)}function d(a,d,e){if("string"!=typeof a)throw"invalid module definition, module id must be defined and be a string";if(d===b)throw"invalid module definition, dependencies must be specified";if(e===b)throw"invalid module definition, definition function must be specified";c(d,function(){g[a]=e.apply(null,arguments)})}function e(b){for(var c=a,d=b.split(/[.\/]/),e=0;e<d.length;++e){if(!c[d[e]])return;c=c[d[e]]}return c}function f(c){var d,e,f,h,i;for(d=0;d<c.length;d++){e=a,f=c[d],h=f.split(/[.\/]/);for(var j=0;j<h.length-1;++j)e[h[j]]===b&&(e[h[j]]={}),e=e[h[j]];e[h[h.length-1]]=g[f]}if(a.AMDLC_TESTS){i=a.privateModules||{};for(f in g)i[f]=g[f];for(d=0;d<c.length;d++)delete i[c[d]];a.privateModules=i}}var g={};d("tinymce/pasteplugin/Utils",["tinymce/util/Tools","tinymce/html/DomParser","tinymce/html/Schema"],function(a,b,c){function d(b,c){return a.each(c,function(a){b=a.constructor==RegExp?b.replace(a,""):b.replace(a[0],a[1])}),b}function e(e){function f(a){var b=a.name,c=a;if("br"===b)return void(i+="\n");if(j[b]&&(i+=" "),k[b])return void(i+=" ");if(3==a.type&&(i+=a.value),!a.shortEnded&&(a=a.firstChild))do f(a);while(a=a.next);l[b]&&c.next&&(i+="\n","p"==b&&(i+="\n"))}var g=new c,h=new b({},g),i="",j=g.getShortEndedElements(),k=a.makeMap("script noscript style textarea video audio iframe object"," "),l=g.getBlockElements();return e=d(e,[/<!\[[^\]]+\]>/g]),f(h.parse(e)),i}function f(a){function b(a,b,c){return b||c?"\xa0":" "}return a=d(a,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,b],/<br class="Apple-interchange-newline">/g,/<br>$/i])}function g(a){var b=0;return function(){return a+b++}}return{filter:d,innerText:e,trimHtml:f,createIdGenerator:g}}),d("tinymce/pasteplugin/SmartPaste",["tinymce/util/Tools"],function(a){var b=function(a){return/^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(a)},c=function(a){return b(a)&&/.(gif|jpe?g|png)$/.test(a)},d=function(a,b,c){return a.undoManager.extra(function(){c(a,b)},function(){a.insertContent('<img src="'+b+'">')}),!0},e=function(a,b,c){return a.undoManager.extra(function(){c(a,b)},function(){a.execCommand("mceInsertLink",!1,b)}),!0},f=function(a,c,d){return a.selection.isCollapsed()===!1&&b(c)?e(a,c,d):!1},g=function(a,b,e){return c(b)?d(a,b,e):!1},h=function(a,b){return a.insertContent(b,{merge:a.settings.paste_merge_formats!==!1,paste:!0}),!0},i=function(b,c){a.each([f,g,h],function(a){return a(b,c,h)!==!0})},j=function(a,b){a.settings.smart_paste===!1?h(a,b):i(a,b)};return{isImageUrl:c,isAbsoluteUrl:b,insertContent:j}}),d("tinymce/pasteplugin/Clipboard",["tinymce/Env","tinymce/dom/RangeUtils","tinymce/util/VK","tinymce/pasteplugin/Utils","tinymce/pasteplugin/SmartPaste","tinymce/util/Delay"],function(a,b,c,d,e,f){return function(g){function h(a){var b,c=g.dom;if(b=g.fire("BeforePastePreProcess",{content:a}),b=g.fire("PastePreProcess",b),a=b.content,!b.isDefaultPrevented()){if(g.hasEventListeners("PastePostProcess")&&!b.isDefaultPrevented()){var d=c.add(g.getBody(),"div",{style:"display:none"},a);b=g.fire("PastePostProcess",{node:d}),c.remove(d),a=b.node.innerHTML}b.isDefaultPrevented()||e.insertContent(g,a)}}function i(a){a=g.dom.encode(a).replace(/\r\n/g,"\n");var b,c=g.dom.getParent(g.selection.getStart(),g.dom.isBlock),e=g.settings.forced_root_block;e&&(b=g.dom.createHTML(e,g.settings.forced_root_block_attrs),b=b.substr(0,b.length-3)+">"),c&&/^(PRE|DIV)$/.test(c.nodeName)||!e?a=d.filter(a,[[/\n/g,"<br>"]]):(a=d.filter(a,[[/\n\n/g,"</p>"+b],[/^(.*<\/p>)(<p>)$/,b+"$1"],[/\n/g,"<br />"]]),-1!=a.indexOf("<p>")&&(a=b+a)),h(a)}function j(){function b(a){var b,c,e,f=a.startContainer;if(b=a.getClientRects(),b.length)return b[0];if(a.collapsed&&1==f.nodeType){for(e=f.childNodes[z.startOffset];e&&3==e.nodeType&&!e.data.length;)e=e.nextSibling;if(e)return"BR"==e.tagName&&(c=d.doc.createTextNode("\ufeff"),e.parentNode.insertBefore(c,e),a=d.createRng(),a.setStartBefore(c),a.setEndAfter(c),b=a.getClientRects(),d.remove(c)),b.length?b[0]:void 0}}var c,d=g.dom,e=g.getBody(),f=g.dom.getViewPort(g.getWin()),h=f.y,i=20;if(z=g.selection.getRng(),g.inline&&(c=g.selection.getScrollContainer(),c&&c.scrollTop>0&&(h=c.scrollTop)),z.getClientRects){var j=b(z);if(j)i=h+(j.top-d.getPos(e).y);else{i=h;var k=z.startContainer;k&&(3==k.nodeType&&k.parentNode!=e&&(k=k.parentNode),1==k.nodeType&&(i=d.getPos(k,c||e).y))}}y=d.add(g.getBody(),"div",{id:"mcepastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: absolute; top: "+i+"px;width: 10px; height: 10px; overflow: hidden; opacity: 0"},E),(a.ie||a.gecko)&&d.setStyle(y,"left","rtl"==d.getStyle(e,"direction",!0)?65535:-65535),d.bind(y,"beforedeactivate focusin focusout",function(a){a.stopPropagation()}),y.focus(),g.selection.select(y,!0)}function k(){if(y){for(var a;a=g.dom.get("mcepastebin");)g.dom.remove(a),g.dom.unbind(a);z&&g.selection.setRng(z)}y=z=null}function l(){var a,b,c,d,e="";for(a=g.dom.select("div[id=mcepastebin]"),b=0;b<a.length;b++)c=a[b],c.firstChild&&"mcepastebin"==c.firstChild.id&&(c=c.firstChild),d=c.innerHTML,e!=E&&(e+=d);return e}function m(a){var b={};if(a){if(a.getData){var c=a.getData("Text");c&&c.length>0&&-1==c.indexOf(F)&&(b["text/plain"]=c)}if(a.types)for(var d=0;d<a.types.length;d++){var e=a.types[d];b[e]=a.getData(e)}}return b}function n(a){return m(a.clipboardData||g.getDoc().dataTransfer)}function o(a){return v(a,"text/html")||v(a,"text/plain")}function p(a){var b;return b=a.indexOf(","),-1!==b?a.substr(b+1):null}function q(a,b){return a.images_dataimg_filter?a.images_dataimg_filter(b):!0}function r(a,b,c){a&&(g.selection.setRng(a),a=null);var d=b.result,e=p(d),f=new Image;if(f.src=d,q(g.settings,f)){var i,j,k=g.editorUpload.blobCache;j=k.findFirst(function(a){return a.base64()===e}),j?i=j:(i=k.create(G(),c,e),k.add(i)),h('<img src="'+i.blobUri()+'">')}else h('<img src="'+d+'">')}function s(a,b){function c(c){var d,e,f,g=!1;if(c)for(d=0;d<c.length;d++)if(e=c[d],/^image\/(jpeg|png|gif|bmp)$/.test(e.type)){var h=e.getAsFile?e.getAsFile():e;f=new FileReader,f.onload=r.bind(null,b,f,h),f.readAsDataURL(h),a.preventDefault(),g=!0}return g}var d=a.clipboardData||a.dataTransfer;return g.settings.paste_data_images&&d?c(d.items)||c(d.files):void 0}function t(a){var b=a.clipboardData;return-1!=navigator.userAgent.indexOf("Android")&&b&&b.items&&0===b.items.length}function u(a){return b.getCaretRangeFromPoint(a.clientX,a.clientY,g.getDoc())}function v(a,b){return b in a&&a[b].length>0}function w(a){return c.metaKeyPressed(a)&&86==a.keyCode||a.shiftKey&&45==a.keyCode}function x(){function b(a,b,c){var e;return v(a,"text/html")?e=a["text/html"]:(e=l(),e==E&&(c=!0)),e=d.trimHtml(e),y&&y.firstChild&&"mcepastebin"===y.firstChild.id&&(c=!0),k(),e.length||(c=!0),c&&(e=v(a,"text/plain")&&-1==e.indexOf("</p>")?a["text/plain"]:d.innerText(e)),e==E?void(b||g.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents.")):void(c?i(e):h(e))}function c(a){return 0===a["text/plain"].indexOf("file://")}g.on("keydown",function(b){function c(a){w(a)&&!a.isDefaultPrevented()&&k()}if(w(b)&&!b.isDefaultPrevented()){if(A=b.shiftKey&&86==b.keyCode,A&&a.webkit&&-1!=navigator.userAgent.indexOf("Version/"))return;if(b.stopImmediatePropagation(),C=(new Date).getTime(),a.ie&&A)return b.preventDefault(),void g.fire("paste",{ieFake:!0});k(),j(),g.once("keyup",c),g.once("paste",function(){g.off("keyup",c)})}});var e=function(){return z||g.selection.getRng()};g.on("paste",function(c){var d=(new Date).getTime(),h=n(c),i=(new Date).getTime()-d,m=(new Date).getTime()-C-i<1e3,p="text"==B.pasteFormat||A;return A=!1,c.isDefaultPrevented()||t(c)?void k():!o(h)&&s(c,e())?void k():(m||c.preventDefault(),!a.ie||m&&!c.ieFake||(j(),g.dom.bind(y,"paste",function(a){a.stopPropagation()}),g.getDoc().execCommand("Paste",!1,null),h["text/html"]=l()),void(v(h,"text/html")?(c.preventDefault(),b(h,m,p)):f.setEditorTimeout(g,function(){b(h,m,p)},0)))}),g.on("dragstart dragend",function(a){D="dragstart"==a.type}),g.on("drop",function(a){var b,e;if(e=u(a),!a.isDefaultPrevented()&&!D&&(b=m(a.dataTransfer),(o(b)&&!c(b)||!s(a,e))&&e&&g.settings.paste_filter_drop!==!1)){var j=b["mce-internal"]||b["text/html"]||b["text/plain"];j&&(a.preventDefault(),f.setEditorTimeout(g,function(){g.undoManager.transact(function(){b["mce-internal"]&&g.execCommand("Delete"),g.selection.setRng(e),j=d.trimHtml(j),b["text/html"]?h(j):i(j)})}))}}),g.on("dragover dragend",function(a){g.settings.paste_data_images&&a.preventDefault()})}var y,z,A,B=this,C=0,D=!1,E="%MCEPASTEBIN%",F="data:text/mce-internal,",G=d.createIdGenerator("mceclip");B.pasteHtml=h,B.pasteText=i,B.pasteImageData=s,g.on("preInit",function(){x(),g.parser.addNodeFilter("img",function(b,c,d){function e(a){return a.data&&a.data.paste===!0}function f(b){b.attr("data-mce-object")||k===a.transparentSrc||b.remove()}function h(a){return 0===a.indexOf("webkit-fake-url")}function i(a){return 0===a.indexOf("data:")}if(!g.settings.paste_data_images&&e(d))for(var j=b.length;j--;){var k=b[j].attributes.map.src;k&&(h(k)?f(b[j]):!g.settings.allow_html_data_urls&&i(k)&&f(b[j]))}})})}}),d("tinymce/pasteplugin/WordFilter",["tinymce/util/Tools","tinymce/html/DomParser","tinymce/html/Schema","tinymce/html/Serializer","tinymce/html/Node","tinymce/pasteplugin/Utils"],function(a,b,c,d,e,f){function g(a){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(a)||/class="OutlineElement/.test(a)||/id="?docs\-internal\-guid\-/.test(a)}function h(b){var c,d;return d=[/^[IVXLMCD]{1,2}\.[ \u00a0]/,/^[ivxlmcd]{1,2}\.[ \u00a0]/,/^[a-z]{1,2}[\.\)][ \u00a0]/,/^[A-Z]{1,2}[\.\)][ \u00a0]/,/^[0-9]+\.[ \u00a0]/,/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/],b=b.replace(/^[\u00a0 ]+/,""),a.each(d,function(a){return a.test(b)?(c=!0,!1):void 0}),c}function i(a){return/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(a)}function j(j){var k=j.settings;j.on("BeforePastePreProcess",function(l){function m(a){function b(a){var c="";if(3===a.type)return a.value;if(a=a.firstChild)do c+=b(a);while(a=a.next);return c}function c(a,b){if(3===a.type&&b.test(a.value))return a.value=a.value.replace(b,""),!1;if(a=a.firstChild)do if(!c(a,b))return!1;while(a=a.next);return!0}function d(a){if(a._listIgnore)return void a.remove();if(a=a.firstChild)do d(a);while(a=a.next)}function f(a,b,f){var h=a._listLevel||k;h!=k&&(k>h?g&&(g=g.parent.parent):(j=g,g=null)),g&&g.name==b?g.append(a):(j=j||g,g=new e(b,1),f>1&&g.attr("start",""+f),a.wrap(g)),a.name="li",h>k&&j&&j.lastChild.append(g),k=h,d(a),c(a,/^\u00a0+/),c(a,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),c(a,/^\u00a0+/)}for(var g,j,k=1,l=[],m=a.firstChild;"undefined"!=typeof m&&null!==m;)if(l.push(m),m=m.walk(),null!==m)for(;"undefined"!=typeof m&&m.parent!==a;)m=m.walk();for(var n=0;n<l.length;n++)if(a=l[n],"p"==a.name&&a.firstChild){var o=b(a);if(i(o)){f(a,"ul");continue}if(h(o)){var p=/([0-9]+)\./.exec(o),q=1;p&&(q=parseInt(p[1],10)),f(a,"ol",q);continue}if(a._listLevel){f(a,"ul",1);continue}g=null}else j=g,g=null}function n(b,c){var d,f={},g=j.dom.parseStyle(c);return a.each(g,function(a,e){switch(e){case"mso-list":d=/\w+ \w+([0-9]+)/i.exec(c),d&&(b._listLevel=parseInt(d[1],10)),/Ignore/i.test(a)&&b.firstChild&&(b._listIgnore=!0,b.firstChild._listIgnore=!0);break;case"horiz-align":e="text-align";break;case"vert-align":e="vertical-align";break;case"font-color":case"mso-foreground":e="color";break;case"mso-background":case"mso-highlight":e="background";break;case"font-weight":case"font-style":return void("normal"!=a&&(f[e]=a));case"mso-element":if(/^(comment|comment-list)$/i.test(a))return void b.remove()}return 0===e.indexOf("mso-comment")?void b.remove():void(0!==e.indexOf("mso-")&&("all"==o||p&&p[e])&&(f[e]=a))}),/(bold)/i.test(f["font-weight"])&&(delete f["font-weight"],b.wrap(new e("b",1))),/(italic)/i.test(f["font-style"])&&(delete f["font-style"],b.wrap(new e("i",1))),f=j.dom.serializeStyle(f,b.name),f?f:null}var o,p,q=l.content;if(q=q.replace(/<b[^>]+id="?docs-internal-[^>]*>/gi,""),q=q.replace(/<br class="?Apple-interchange-newline"?>/gi,""),o=k.paste_retain_style_properties,o&&(p=a.makeMap(o.split(/[, ]/))),k.paste_enable_default_filters!==!1&&g(l.content)){l.wordContent=!0,q=f.filter(q,[/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\xa0"],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(a,b){return b.length>0?b.replace(/./," ").slice(Math.floor(b.length/2)).split("").join("\xa0"):""}]]);var r=k.paste_word_valid_elements;r||(r="-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody");var s=new c({valid_elements:r,valid_children:"-li[p]"});a.each(s.elements,function(a){a.attributes["class"]||(a.attributes["class"]={},a.attributesOrder.push("class")),a.attributes.style||(a.attributes.style={},a.attributesOrder.push("style"))});var t=new b({},s);t.addAttributeFilter("style",function(a){for(var b,c=a.length;c--;)b=a[c],b.attr("style",n(b,b.attr("style"))),"span"==b.name&&b.parent&&!b.attributes.length&&b.unwrap()}),t.addAttributeFilter("class",function(a){for(var b,c,d=a.length;d--;)b=a[d],c=b.attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(c)&&b.remove(),b.attr("class",null)}),t.addNodeFilter("del",function(a){for(var b=a.length;b--;)a[b].remove()}),t.addNodeFilter("a",function(a){for(var b,c,d,e=a.length;e--;)if(b=a[e],c=b.attr("href"),d=b.attr("name"),c&&-1!=c.indexOf("#_msocom_"))b.remove();else if(c&&0===c.indexOf("file://")&&(c=c.split("#")[1],c&&(c="#"+c)),c||d){if(d&&!/^_?(?:toc|edn|ftn)/i.test(d)){b.unwrap();continue}b.attr({href:c,name:d})}else b.unwrap()});var u=t.parse(q);k.paste_convert_word_fake_lists!==!1&&m(u),l.content=new d({validate:k.validate},s).serialize(u)}})}return j.isWordContent=g,j}),d("tinymce/pasteplugin/Quirks",["tinymce/Env","tinymce/util/Tools","tinymce/pasteplugin/WordFilter","tinymce/pasteplugin/Utils"],function(a,b,c,d){return function(e){function f(a){e.on("BeforePastePreProcess",function(b){b.content=a(b.content)})}function g(a){if(!c.isWordContent(a))return a;var f=[];b.each(e.schema.getBlockElements(),function(a,b){f.push(b)});var g=new RegExp("(?:<br> [\\s\\r\\n]+|<br>)*(<\\/?("+f.join("|")+")[^>]*>)(?:<br> [\\s\\r\\n]+|<br>)*","g");return a=d.filter(a,[[g,"$1"]]),a=d.filter(a,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function h(a){if(c.isWordContent(a))return a;var b=e.settings.paste_webkit_styles;if(e.settings.paste_remove_styles_if_webkit===!1||"all"==b)return a;if(b&&(b=b.split(/[, ]/)),b){var d=e.dom,f=e.selection.getNode();a=a.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(a,c,e,g){var h=d.parseStyle(e,"span"),i={};if("none"===b)return c+g;for(var j=0;j<b.length;j++){var k=h[b[j]],l=d.getStyle(f,b[j],!0);/color/.test(b[j])&&(k=d.toHex(k),l=d.toHex(l)),l!=k&&(i[b[j]]=k)}return i=d.serializeStyle(i,"span"),i?c+' style="'+i+'"'+g:c+g})}else a=a.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return a=a.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(a,b,c,d){return b+' style="'+c+'"'+d})}a.webkit&&f(h),a.ie&&f(g)}}),d("tinymce/pasteplugin/Plugin",["tinymce/PluginManager","tinymce/pasteplugin/Clipboard","tinymce/pasteplugin/WordFilter","tinymce/pasteplugin/Quirks"],function(a,b,c,d){var e;a.add("paste",function(f){function g(){return e||f.settings.paste_plaintext_inform===!1}function h(){if("text"==i.pasteFormat)this.active(!1),i.pasteFormat="html",f.fire("PastePlainTextToggle",{state:!1});else if(i.pasteFormat="text",this.active(!0),!g()){var a=f.translate("Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.");f.notificationManager.open({text:a,type:"info"}),e=!0,f.fire("PastePlainTextToggle",{state:!0})}f.focus()}var i,j=this,k=f.settings;return/(^|[ ,])powerpaste([, ]|$)/.test(k.plugins)&&a.get("powerpaste")?void("undefined"!=typeof console&&console.log&&console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option.")):(j.clipboard=i=new b(f),j.quirks=new d(f),j.wordFilter=new c(f),f.settings.paste_as_text&&(j.clipboard.pasteFormat="text"),k.paste_preprocess&&f.on("PastePreProcess",function(a){k.paste_preprocess.call(j,j,a)}),k.paste_postprocess&&f.on("PastePostProcess",function(a){k.paste_postprocess.call(j,j,a)}),f.addCommand("mceInsertClipboardContent",function(a,b){b.content&&j.clipboard.pasteHtml(b.content),b.text&&j.clipboard.pasteText(b.text)}),f.settings.paste_block_drop&&f.on("dragend dragover draggesture dragdrop drop drag",function(a){a.preventDefault(),a.stopPropagation()}),f.settings.paste_data_images||f.on("drop",function(a){var b=a.dataTransfer;b&&b.files&&b.files.length>0&&a.preventDefault()}),f.addButton("pastetext",{icon:"pastetext",tooltip:"Paste as text",onclick:h,active:"text"==j.clipboard.pasteFormat}),void f.addMenuItem("pastetext",{text:"Paste as text",selectable:!0,active:i.pasteFormat,onclick:h}))})}),f(["tinymce/pasteplugin/Utils"])}(this);
|
1
|
+
!function(a,b){"use strict";function c(a,b){for(var c,d=[],f=0;f<a.length;++f){if(c=g[a[f]]||e(a[f]),!c)throw"module definition dependecy not found: "+a[f];d.push(c)}b.apply(null,d)}function d(a,d,e){if("string"!=typeof a)throw"invalid module definition, module id must be defined and be a string";if(d===b)throw"invalid module definition, dependencies must be specified";if(e===b)throw"invalid module definition, definition function must be specified";c(d,function(){g[a]=e.apply(null,arguments)})}function e(b){for(var c=a,d=b.split(/[.\/]/),e=0;e<d.length;++e){if(!c[d[e]])return;c=c[d[e]]}return c}function f(c){var d,e,f,h,i;for(d=0;d<c.length;d++){e=a,f=c[d],h=f.split(/[.\/]/);for(var j=0;j<h.length-1;++j)e[h[j]]===b&&(e[h[j]]={}),e=e[h[j]];e[h[h.length-1]]=g[f]}if(a.AMDLC_TESTS){i=a.privateModules||{};for(f in g)i[f]=g[f];for(d=0;d<c.length;d++)delete i[c[d]];a.privateModules=i}}var g={};d("tinymce/pasteplugin/Utils",["tinymce/util/Tools","tinymce/html/DomParser","tinymce/html/Schema"],function(a,b,c){function d(b,c){return a.each(c,function(a){b=a.constructor==RegExp?b.replace(a,""):b.replace(a[0],a[1])}),b}function e(e){function f(a){var b=a.name,c=a;if("br"===b)return void(i+="\n");if(j[b]&&(i+=" "),k[b])return void(i+=" ");if(3==a.type&&(i+=a.value),!a.shortEnded&&(a=a.firstChild))do f(a);while(a=a.next);l[b]&&c.next&&(i+="\n","p"==b&&(i+="\n"))}var g=new c,h=new b({},g),i="",j=g.getShortEndedElements(),k=a.makeMap("script noscript style textarea video audio iframe object"," "),l=g.getBlockElements();return e=d(e,[/<!\[[^\]]+\]>/g]),f(h.parse(e)),i}function f(a){function b(a,b,c){return b||c?"\xa0":" "}return a=d(a,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,b],/<br class="Apple-interchange-newline">/g,/<br>$/i])}function g(a){var b=0;return function(){return a+b++}}return{filter:d,innerText:e,trimHtml:f,createIdGenerator:g}}),d("tinymce/pasteplugin/SmartPaste",["tinymce/util/Tools"],function(a){var b=function(a){return/^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(a)},c=function(a){return b(a)&&/.(gif|jpe?g|png)$/.test(a)},d=function(a,b,c){return a.undoManager.extra(function(){c(a,b)},function(){a.insertContent('<img src="'+b+'">')}),!0},e=function(a,b,c){return a.undoManager.extra(function(){c(a,b)},function(){a.execCommand("mceInsertLink",!1,b)}),!0},f=function(a,c,d){return!(a.selection.isCollapsed()!==!1||!b(c))&&e(a,c,d)},g=function(a,b,e){return!!c(b)&&d(a,b,e)},h=function(a,b){return a.insertContent(b,{merge:a.settings.paste_merge_formats!==!1,paste:!0}),!0},i=function(b,c){a.each([f,g,h],function(a){return a(b,c,h)!==!0})},j=function(a,b){a.settings.smart_paste===!1?h(a,b):i(a,b)};return{isImageUrl:c,isAbsoluteUrl:b,insertContent:j}}),d("tinymce/pasteplugin/Clipboard",["tinymce/Env","tinymce/dom/RangeUtils","tinymce/util/VK","tinymce/pasteplugin/Utils","tinymce/pasteplugin/SmartPaste","tinymce/util/Delay"],function(a,b,c,d,e,f){return function(g){function h(a){var b,c=g.dom;if(b=g.fire("BeforePastePreProcess",{content:a}),b=g.fire("PastePreProcess",b),a=b.content,!b.isDefaultPrevented()){if(g.hasEventListeners("PastePostProcess")&&!b.isDefaultPrevented()){var d=c.add(g.getBody(),"div",{style:"display:none"},a);b=g.fire("PastePostProcess",{node:d}),c.remove(d),a=b.node.innerHTML}b.isDefaultPrevented()||e.insertContent(g,a)}}function i(a){a=g.dom.encode(a).replace(/\r\n/g,"\n");var b,c=g.dom.getParent(g.selection.getStart(),g.dom.isBlock),e=g.settings.forced_root_block;e&&(b=g.dom.createHTML(e,g.settings.forced_root_block_attrs),b=b.substr(0,b.length-3)+">"),c&&/^(PRE|DIV)$/.test(c.nodeName)||!e?a=d.filter(a,[[/\n/g,"<br>"]]):(a=d.filter(a,[[/\n\n/g,"</p>"+b],[/^(.*<\/p>)(<p>)$/,b+"$1"],[/\n/g,"<br />"]]),a.indexOf("<p>")!=-1&&(a=b+a)),h(a)}function j(){function b(a){var b,c,e,f=a.startContainer;if(b=a.getClientRects(),b.length)return b[0];if(a.collapsed&&1==f.nodeType){for(e=f.childNodes[z.startOffset];e&&3==e.nodeType&&!e.data.length;)e=e.nextSibling;if(e)return"BR"==e.tagName&&(c=d.doc.createTextNode("\ufeff"),e.parentNode.insertBefore(c,e),a=d.createRng(),a.setStartBefore(c),a.setEndAfter(c),b=a.getClientRects(),d.remove(c)),b.length?b[0]:void 0}}var c,d=g.dom,e=g.getBody(),f=g.dom.getViewPort(g.getWin()),h=f.y,i=20;if(z=g.selection.getRng(),g.inline&&(c=g.selection.getScrollContainer(),c&&c.scrollTop>0&&(h=c.scrollTop)),z.getClientRects){var j=b(z);if(j)i=h+(j.top-d.getPos(e).y);else{i=h;var k=z.startContainer;k&&(3==k.nodeType&&k.parentNode!=e&&(k=k.parentNode),1==k.nodeType&&(i=d.getPos(k,c||e).y))}}y=d.add(g.getBody(),"div",{id:"mcepastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: absolute; top: "+i+"px;width: 10px; height: 10px; overflow: hidden; opacity: 0"},E),(a.ie||a.gecko)&&d.setStyle(y,"left","rtl"==d.getStyle(e,"direction",!0)?65535:-65535),d.bind(y,"beforedeactivate focusin focusout",function(a){a.stopPropagation()}),y.focus(),g.selection.select(y,!0)}function k(){if(y){for(var a;a=g.dom.get("mcepastebin");)g.dom.remove(a),g.dom.unbind(a);z&&g.selection.setRng(z)}y=z=null}function l(){var a,b,c,d,e="";for(a=g.dom.select("div[id=mcepastebin]"),b=0;b<a.length;b++)c=a[b],c.firstChild&&"mcepastebin"==c.firstChild.id&&(c=c.firstChild),d=c.innerHTML,e!=E&&(e+=d);return e}function m(a){var b={};if(a){if(a.getData){var c=a.getData("Text");c&&c.length>0&&c.indexOf(F)==-1&&(b["text/plain"]=c)}if(a.types)for(var d=0;d<a.types.length;d++){var e=a.types[d];b[e]=a.getData(e)}}return b}function n(a){return m(a.clipboardData||g.getDoc().dataTransfer)}function o(a){return v(a,"text/html")||v(a,"text/plain")}function p(a){var b;return b=a.indexOf(","),b!==-1?a.substr(b+1):null}function q(a,b){return!a.images_dataimg_filter||a.images_dataimg_filter(b)}function r(a,b,c){a&&(g.selection.setRng(a),a=null);var d=b.result,e=p(d),f=new Image;if(f.src=d,q(g.settings,f)){var i,j,k=g.editorUpload.blobCache;j=k.findFirst(function(a){return a.base64()===e}),j?i=j:(i=k.create(G(),c,e),k.add(i)),h('<img src="'+i.blobUri()+'">')}else h('<img src="'+d+'">')}function s(a,b){function c(c){var d,e,f,g=!1;if(c)for(d=0;d<c.length;d++)if(e=c[d],/^image\/(jpeg|png|gif|bmp)$/.test(e.type)){var h=e.getAsFile?e.getAsFile():e;f=new FileReader,f.onload=r.bind(null,b,f,h),f.readAsDataURL(h),a.preventDefault(),g=!0}return g}var d=a.clipboardData||a.dataTransfer;if(g.settings.paste_data_images&&d)return c(d.items)||c(d.files)}function t(a){var b=a.clipboardData;return navigator.userAgent.indexOf("Android")!=-1&&b&&b.items&&0===b.items.length}function u(a){return b.getCaretRangeFromPoint(a.clientX,a.clientY,g.getDoc())}function v(a,b){return b in a&&a[b].length>0}function w(a){return c.metaKeyPressed(a)&&86==a.keyCode||a.shiftKey&&45==a.keyCode}function x(){function b(a,b,c){var e;return v(a,"text/html")?e=a["text/html"]:(e=l(),e==E&&(c=!0)),e=d.trimHtml(e),y&&y.firstChild&&"mcepastebin"===y.firstChild.id&&(c=!0),k(),e.length||(c=!0),c&&(e=v(a,"text/plain")&&e.indexOf("</p>")==-1?a["text/plain"]:d.innerText(e)),e==E?void(b||g.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents.")):void(c?i(e):h(e))}function c(a){var b=a["text/plain"];return!!b&&0===b.indexOf("file://")}g.on("keydown",function(b){function c(a){w(a)&&!a.isDefaultPrevented()&&k()}if(w(b)&&!b.isDefaultPrevented()){if(A=b.shiftKey&&86==b.keyCode,A&&a.webkit&&navigator.userAgent.indexOf("Version/")!=-1)return;if(b.stopImmediatePropagation(),C=(new Date).getTime(),a.ie&&A)return b.preventDefault(),void g.fire("paste",{ieFake:!0});k(),j(),g.once("keyup",c),g.once("paste",function(){g.off("keyup",c)})}});var e=function(){return z||g.selection.getRng()};g.on("paste",function(c){var d=(new Date).getTime(),h=n(c),i=(new Date).getTime()-d,m=(new Date).getTime()-C-i<1e3,p="text"==B.pasteFormat||A;return A=!1,c.isDefaultPrevented()||t(c)?void k():!o(h)&&s(c,e())?void k():(m||c.preventDefault(),!a.ie||m&&!c.ieFake||(j(),g.dom.bind(y,"paste",function(a){a.stopPropagation()}),g.getDoc().execCommand("Paste",!1,null),h["text/html"]=l()),void(v(h,"text/html")?(c.preventDefault(),b(h,m,p)):f.setEditorTimeout(g,function(){b(h,m,p)},0)))}),g.on("dragstart dragend",function(a){D="dragstart"==a.type}),g.on("drop",function(a){var b,e;if(e=u(a),!a.isDefaultPrevented()&&!D&&(b=m(a.dataTransfer),(o(b)&&!c(b)||!s(a,e))&&e&&g.settings.paste_filter_drop!==!1)){var j=b["mce-internal"]||b["text/html"]||b["text/plain"];j&&(a.preventDefault(),f.setEditorTimeout(g,function(){g.undoManager.transact(function(){b["mce-internal"]&&g.execCommand("Delete"),g.selection.setRng(e),j=d.trimHtml(j),b["text/html"]?h(j):i(j)})}))}}),g.on("dragover dragend",function(a){g.settings.paste_data_images&&a.preventDefault()})}var y,z,A,B=this,C=0,D=!1,E="%MCEPASTEBIN%",F="data:text/mce-internal,",G=d.createIdGenerator("mceclip");B.pasteHtml=h,B.pasteText=i,B.pasteImageData=s,g.on("preInit",function(){x(),g.parser.addNodeFilter("img",function(b,c,d){function e(a){return a.data&&a.data.paste===!0}function f(b){b.attr("data-mce-object")||k===a.transparentSrc||b.remove()}function h(a){return 0===a.indexOf("webkit-fake-url")}function i(a){return 0===a.indexOf("data:")}if(!g.settings.paste_data_images&&e(d))for(var j=b.length;j--;){var k=b[j].attributes.map.src;k&&(h(k)?f(b[j]):!g.settings.allow_html_data_urls&&i(k)&&f(b[j]))}})})}}),d("tinymce/pasteplugin/WordFilter",["tinymce/util/Tools","tinymce/html/DomParser","tinymce/html/Schema","tinymce/html/Serializer","tinymce/html/Node","tinymce/pasteplugin/Utils"],function(a,b,c,d,e,f){function g(a){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(a)||/class="OutlineElement/.test(a)||/id="?docs\-internal\-guid\-/.test(a)}function h(b){var c,d;return d=[/^[IVXLMCD]{1,2}\.[ \u00a0]/,/^[ivxlmcd]{1,2}\.[ \u00a0]/,/^[a-z]{1,2}[\.\)][ \u00a0]/,/^[A-Z]{1,2}[\.\)][ \u00a0]/,/^[0-9]+\.[ \u00a0]/,/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/],b=b.replace(/^[\u00a0 ]+/,""),a.each(d,function(a){if(a.test(b))return c=!0,!1}),c}function i(a){return/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(a)}function j(j){var k=j.settings;j.on("BeforePastePreProcess",function(l){function m(a){function b(a){var c="";if(3===a.type)return a.value;if(a=a.firstChild)do c+=b(a);while(a=a.next);return c}function c(a,b){if(3===a.type&&b.test(a.value))return a.value=a.value.replace(b,""),!1;if(a=a.firstChild)do if(!c(a,b))return!1;while(a=a.next);return!0}function d(a){if(a._listIgnore)return void a.remove();if(a=a.firstChild)do d(a);while(a=a.next)}function f(a,b,f){var h=a._listLevel||k;h!=k&&(h<k?g&&(g=g.parent.parent):(j=g,g=null)),g&&g.name==b?g.append(a):(j=j||g,g=new e(b,1),f>1&&g.attr("start",""+f),a.wrap(g)),a.name="li",h>k&&j&&j.lastChild.append(g),k=h,d(a),c(a,/^\u00a0+/),c(a,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),c(a,/^\u00a0+/)}for(var g,j,k=1,l=[],m=a.firstChild;"undefined"!=typeof m&&null!==m;)if(l.push(m),m=m.walk(),null!==m)for(;"undefined"!=typeof m&&m.parent!==a;)m=m.walk();for(var n=0;n<l.length;n++)if(a=l[n],"p"==a.name&&a.firstChild){var o=b(a);if(i(o)){f(a,"ul");continue}if(h(o)){var p=/([0-9]+)\./.exec(o),q=1;p&&(q=parseInt(p[1],10)),f(a,"ol",q);continue}if(a._listLevel){f(a,"ul",1);continue}g=null}else j=g,g=null}function n(b,c){var d,f={},g=j.dom.parseStyle(c);return a.each(g,function(a,e){switch(e){case"mso-list":d=/\w+ \w+([0-9]+)/i.exec(c),d&&(b._listLevel=parseInt(d[1],10)),/Ignore/i.test(a)&&b.firstChild&&(b._listIgnore=!0,b.firstChild._listIgnore=!0);break;case"horiz-align":e="text-align";break;case"vert-align":e="vertical-align";break;case"font-color":case"mso-foreground":e="color";break;case"mso-background":case"mso-highlight":e="background";break;case"font-weight":case"font-style":return void("normal"!=a&&(f[e]=a));case"mso-element":if(/^(comment|comment-list)$/i.test(a))return void b.remove()}return 0===e.indexOf("mso-comment")?void b.remove():void(0!==e.indexOf("mso-")&&("all"==o||p&&p[e])&&(f[e]=a))}),/(bold)/i.test(f["font-weight"])&&(delete f["font-weight"],b.wrap(new e("b",1))),/(italic)/i.test(f["font-style"])&&(delete f["font-style"],b.wrap(new e("i",1))),f=j.dom.serializeStyle(f,b.name),f?f:null}var o,p,q=l.content;if(q=q.replace(/<b[^>]+id="?docs-internal-[^>]*>/gi,""),q=q.replace(/<br class="?Apple-interchange-newline"?>/gi,""),o=k.paste_retain_style_properties,o&&(p=a.makeMap(o.split(/[, ]/))),k.paste_enable_default_filters!==!1&&g(l.content)){l.wordContent=!0,q=f.filter(q,[/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\xa0"],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(a,b){return b.length>0?b.replace(/./," ").slice(Math.floor(b.length/2)).split("").join("\xa0"):""}]]);var r=k.paste_word_valid_elements;r||(r="-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody");var s=new c({valid_elements:r,valid_children:"-li[p]"});a.each(s.elements,function(a){a.attributes.class||(a.attributes.class={},a.attributesOrder.push("class")),a.attributes.style||(a.attributes.style={},a.attributesOrder.push("style"))});var t=new b({},s);t.addAttributeFilter("style",function(a){for(var b,c=a.length;c--;)b=a[c],b.attr("style",n(b,b.attr("style"))),"span"==b.name&&b.parent&&!b.attributes.length&&b.unwrap()}),t.addAttributeFilter("class",function(a){for(var b,c,d=a.length;d--;)b=a[d],c=b.attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(c)&&b.remove(),b.attr("class",null)}),t.addNodeFilter("del",function(a){for(var b=a.length;b--;)a[b].remove()}),t.addNodeFilter("a",function(a){for(var b,c,d,e=a.length;e--;)if(b=a[e],c=b.attr("href"),d=b.attr("name"),c&&c.indexOf("#_msocom_")!=-1)b.remove();else if(c&&0===c.indexOf("file://")&&(c=c.split("#")[1],c&&(c="#"+c)),c||d){if(d&&!/^_?(?:toc|edn|ftn)/i.test(d)){b.unwrap();continue}b.attr({href:c,name:d})}else b.unwrap()});var u=t.parse(q);k.paste_convert_word_fake_lists!==!1&&m(u),l.content=new d({validate:k.validate},s).serialize(u)}})}return j.isWordContent=g,j}),d("tinymce/pasteplugin/Quirks",["tinymce/Env","tinymce/util/Tools","tinymce/pasteplugin/WordFilter","tinymce/pasteplugin/Utils"],function(a,b,c,d){return function(e){function f(a){e.on("BeforePastePreProcess",function(b){b.content=a(b.content)})}function g(a){if(!c.isWordContent(a))return a;var f=[];b.each(e.schema.getBlockElements(),function(a,b){f.push(b)});var g=new RegExp("(?:<br> [\\s\\r\\n]+|<br>)*(<\\/?("+f.join("|")+")[^>]*>)(?:<br> [\\s\\r\\n]+|<br>)*","g");return a=d.filter(a,[[g,"$1"]]),a=d.filter(a,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function h(a){if(c.isWordContent(a))return a;var b=e.settings.paste_webkit_styles;if(e.settings.paste_remove_styles_if_webkit===!1||"all"==b)return a;if(b&&(b=b.split(/[, ]/)),b){var d=e.dom,f=e.selection.getNode();a=a.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(a,c,e,g){var h=d.parseStyle(e,"span"),i={};if("none"===b)return c+g;for(var j=0;j<b.length;j++){var k=h[b[j]],l=d.getStyle(f,b[j],!0);/color/.test(b[j])&&(k=d.toHex(k),l=d.toHex(l)),l!=k&&(i[b[j]]=k)}return i=d.serializeStyle(i,"span"),i?c+' style="'+i+'"'+g:c+g})}else a=a.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return a=a.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(a,b,c,d){return b+' style="'+c+'"'+d})}a.webkit&&f(h),a.ie&&f(g)}}),d("tinymce/pasteplugin/Plugin",["tinymce/PluginManager","tinymce/pasteplugin/Clipboard","tinymce/pasteplugin/WordFilter","tinymce/pasteplugin/Quirks"],function(a,b,c,d){var e;a.add("paste",function(f){function g(){return e||f.settings.paste_plaintext_inform===!1}function h(){if("text"==j.pasteFormat)j.pasteFormat="html",f.fire("PastePlainTextToggle",{state:!1});else if(j.pasteFormat="text",f.fire("PastePlainTextToggle",{state:!0}),!g()){var a=f.translate("Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.");f.notificationManager.open({text:a,type:"info"}),e=!0}f.focus()}function i(){var a=this;a.active("text"===j.pasteFormat),f.on("PastePlainTextToggle",function(b){a.active(b.state)})}var j,k=this,l=f.settings;return/(^|[ ,])powerpaste([, ]|$)/.test(l.plugins)&&a.get("powerpaste")?void("undefined"!=typeof console&&console.log&&console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option.")):(k.clipboard=j=new b(f),k.quirks=new d(f),k.wordFilter=new c(f),f.settings.paste_as_text&&(k.clipboard.pasteFormat="text"),l.paste_preprocess&&f.on("PastePreProcess",function(a){l.paste_preprocess.call(k,k,a)}),l.paste_postprocess&&f.on("PastePostProcess",function(a){l.paste_postprocess.call(k,k,a)}),f.addCommand("mceInsertClipboardContent",function(a,b){b.content&&k.clipboard.pasteHtml(b.content),b.text&&k.clipboard.pasteText(b.text)}),f.settings.paste_block_drop&&f.on("dragend dragover draggesture dragdrop drop drag",function(a){a.preventDefault(),a.stopPropagation()}),f.settings.paste_data_images||f.on("drop",function(a){var b=a.dataTransfer;b&&b.files&&b.files.length>0&&a.preventDefault()}),f.addCommand("mceTogglePlainTextPaste",h),f.addButton("pastetext",{icon:"pastetext",tooltip:"Paste as text",onclick:h,onPostRender:i}),void f.addMenuItem("pastetext",{text:"Paste as text",selectable:!0,active:j.pasteFormat,onclick:h,onPostRender:i}))})}),f(["tinymce/pasteplugin/Utils"])}(this);
|
@@ -1 +1 @@
|
|
1
|
-
tinymce.PluginManager.add("preview",function(a){var b=a.settings,c=!tinymce.Env.ie;a.addCommand("mcePreview",function(){a.windowManager.open({title:"Preview",width:parseInt(a.getParam("plugin_preview_width","650"),10),height:parseInt(a.getParam("plugin_preview_height","500"),10),html:'<iframe src="javascript:\'\'" frameborder="0"'+(c?' sandbox="allow-scripts"':"")+"></iframe>",buttons:{text:"Close",onclick:function(){this.parent().parent().close()}},onPostRender:function(){var d,e="";e+='<base href="'+a.documentBaseURI.getURI()+'">',tinymce.each(a.contentCSS,function(b){e+='<link type="text/css" rel="stylesheet" href="'+a.documentBaseURI.toAbsolute(b)+'">'});var f=b.body_id||"tinymce"
|
1
|
+
tinymce.PluginManager.add("preview",function(a){var b=a.settings,c=!tinymce.Env.ie;a.addCommand("mcePreview",function(){a.windowManager.open({title:"Preview",width:parseInt(a.getParam("plugin_preview_width","650"),10),height:parseInt(a.getParam("plugin_preview_height","500"),10),html:'<iframe src="javascript:\'\'" frameborder="0"'+(c?' sandbox="allow-scripts"':"")+"></iframe>",buttons:{text:"Close",onclick:function(){this.parent().parent().close()}},onPostRender:function(){var d,e="";e+='<base href="'+a.documentBaseURI.getURI()+'">',tinymce.each(a.contentCSS,function(b){e+='<link type="text/css" rel="stylesheet" href="'+a.documentBaseURI.toAbsolute(b)+'">'});var f=b.body_id||"tinymce";f.indexOf("=")!=-1&&(f=a.getParam("body_id","","hash"),f=f[a.id]||f);var g=b.body_class||"";g.indexOf("=")!=-1&&(g=a.getParam("body_class","","hash"),g=g[a.id]||"");var h='<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A") {e.preventDefault();}}}, false);</script> ',i=a.settings.directionality?' dir="'+a.settings.directionality+'"':"";if(d="<!DOCTYPE html><html><head>"+e+'</head><body id="'+f+'" class="mce-content-body '+g+'"'+i+">"+a.getContent()+h+"</body></html>",c)this.getEl("body").firstChild.src="data:text/html;charset=utf-8,"+encodeURIComponent(d);else{var j=this.getEl("body").firstChild.contentWindow.document;j.open(),j.write(d),j.close()}}})}),a.addButton("preview",{title:"Preview",cmd:"mcePreview"}),a.addMenuItem("preview",{text:"Preview",cmd:"mcePreview",context:"view"})});
|
@@ -1 +1 @@
|
|
1
|
-
tinymce.PluginManager.add("save",function(a){function b(){var b;
|
1
|
+
tinymce.PluginManager.add("save",function(a){function b(){var b;if(b=tinymce.DOM.getParent(a.id,"form"),!a.getParam("save_enablewhendirty",!0)||a.isDirty())return tinymce.triggerSave(),a.getParam("save_onsavecallback")?(a.execCallback("save_onsavecallback",a),void a.nodeChanged()):void(b?(a.setDirty(!1),b.onsubmit&&!b.onsubmit()||("function"==typeof b.submit?b.submit():c(a.translate("Error: Form submit field collision."))),a.nodeChanged()):c(a.translate("Error: No form element found.")))}function c(b){a.notificationManager.open({text:b,type:"error"})}function d(){var b=tinymce.trim(a.startContent);return a.getParam("save_oncancelcallback")?void a.execCallback("save_oncancelcallback",a):(a.setContent(b),a.undoManager.clear(),void a.nodeChanged())}function e(){var b=this;a.on("nodeChange dirty",function(){b.disabled(a.getParam("save_enablewhendirty",!0)&&!a.isDirty())})}a.addCommand("mceSave",b),a.addCommand("mceCancel",d),a.addButton("save",{icon:"save",text:"Save",cmd:"mceSave",disabled:!0,onPostRender:e}),a.addButton("cancel",{text:"Cancel",icon:!1,cmd:"mceCancel",disabled:!0,onPostRender:e}),a.addShortcut("Meta+S","","mceSave")});
|
@@ -1 +1 @@
|
|
1
|
-
!function(){function a(a){return a&&1==a.nodeType&&"false"===a.contentEditable}function b(b,c,d,e,f){function g(a,b){if(b=b||0,!a[0])throw"findAndReplaceDOMText cannot handle zero-length matches";var c=a.index;if(b>0){var d=a[b];if(!d)throw"Invalid capture group";c+=a[0].indexOf(d),a[0]=d}return[c,c+a[0].length,[a[0]]]}function h(b){var c;if(3===b.nodeType)return b.data;if(o[b.nodeName]&&!n[b.nodeName])return"";if(c="",a(b))return"\n";if((n[b.nodeName]||p[b.nodeName])&&(c+="\n"),b=b.firstChild)do c+=h(b);while(b=b.nextSibling);return c}function i(b,c,d){var e,f,g,h,i=[],j=0,k=b,l=c.shift(),m=0;a:for(;;){if((n[k.nodeName]||p[k.nodeName]||a(k))&&j++,3===k.nodeType&&(!f&&k.length+j>=l[1]?(f=k,h=l[1]-j):e&&i.push(k),!e&&k.length+j>l[0]&&(e=k,g=l[0]-j),j+=k.length),e&&f){if(k=d({startNode:e,startNodeIndex:g,endNode:f,endNodeIndex:h,innerNodes:i,match:l[2],matchIndex:m}),j-=f.length-h,e=null,f=null,i=[],l=c.shift(),m++,!l)break}else if(o[k.nodeName]&&!n[k.nodeName]||!k.firstChild){if(k.nextSibling){k=k.nextSibling;continue}}else if(!a(k)){k=k.firstChild;continue}for(;;){if(k.nextSibling){k=k.nextSibling;break}if(k.parentNode===b)break a;k=k.parentNode}}}function j(a){var b;if("function"!=typeof a){var c=a.nodeType?a:m.createElement(a);b=function(a,b){var d=c.cloneNode(!1);return d.setAttribute("data-mce-index",b),a&&d.appendChild(m.createTextNode(a)),d}}else b=a;return function(a){var c,d,e,f=a.startNode,g=a.endNode,h=a.matchIndex;if(f===g){var i=f;e=i.parentNode,a.startNodeIndex>0&&(c=m.createTextNode(i.data.substring(0,a.startNodeIndex)),e.insertBefore(c,i));var j=b(a.match[0],h);return e.insertBefore(j,i),a.endNodeIndex<i.length&&(d=m.createTextNode(i.data.substring(a.endNodeIndex)),e.insertBefore(d,i)),i.parentNode.removeChild(i),j}c=m.createTextNode(f.data.substring(0,a.startNodeIndex)),d=m.createTextNode(g.data.substring(a.endNodeIndex));for(var k=b(f.data.substring(a.startNodeIndex),h),l=[],n=0,o=a.innerNodes.length;o
|
1
|
+
!function(){function a(a){return a&&1==a.nodeType&&"false"===a.contentEditable}function b(b,c,d,e,f){function g(a,b){if(b=b||0,!a[0])throw"findAndReplaceDOMText cannot handle zero-length matches";var c=a.index;if(b>0){var d=a[b];if(!d)throw"Invalid capture group";c+=a[0].indexOf(d),a[0]=d}return[c,c+a[0].length,[a[0]]]}function h(b){var c;if(3===b.nodeType)return b.data;if(o[b.nodeName]&&!n[b.nodeName])return"";if(c="",a(b))return"\n";if((n[b.nodeName]||p[b.nodeName])&&(c+="\n"),b=b.firstChild)do c+=h(b);while(b=b.nextSibling);return c}function i(b,c,d){var e,f,g,h,i=[],j=0,k=b,l=c.shift(),m=0;a:for(;;){if((n[k.nodeName]||p[k.nodeName]||a(k))&&j++,3===k.nodeType&&(!f&&k.length+j>=l[1]?(f=k,h=l[1]-j):e&&i.push(k),!e&&k.length+j>l[0]&&(e=k,g=l[0]-j),j+=k.length),e&&f){if(k=d({startNode:e,startNodeIndex:g,endNode:f,endNodeIndex:h,innerNodes:i,match:l[2],matchIndex:m}),j-=f.length-h,e=null,f=null,i=[],l=c.shift(),m++,!l)break}else if(o[k.nodeName]&&!n[k.nodeName]||!k.firstChild){if(k.nextSibling){k=k.nextSibling;continue}}else if(!a(k)){k=k.firstChild;continue}for(;;){if(k.nextSibling){k=k.nextSibling;break}if(k.parentNode===b)break a;k=k.parentNode}}}function j(a){var b;if("function"!=typeof a){var c=a.nodeType?a:m.createElement(a);b=function(a,b){var d=c.cloneNode(!1);return d.setAttribute("data-mce-index",b),a&&d.appendChild(m.createTextNode(a)),d}}else b=a;return function(a){var c,d,e,f=a.startNode,g=a.endNode,h=a.matchIndex;if(f===g){var i=f;e=i.parentNode,a.startNodeIndex>0&&(c=m.createTextNode(i.data.substring(0,a.startNodeIndex)),e.insertBefore(c,i));var j=b(a.match[0],h);return e.insertBefore(j,i),a.endNodeIndex<i.length&&(d=m.createTextNode(i.data.substring(a.endNodeIndex)),e.insertBefore(d,i)),i.parentNode.removeChild(i),j}c=m.createTextNode(f.data.substring(0,a.startNodeIndex)),d=m.createTextNode(g.data.substring(a.endNodeIndex));for(var k=b(f.data.substring(a.startNodeIndex),h),l=[],n=0,o=a.innerNodes.length;n<o;++n){var p=a.innerNodes[n],q=b(p.data,h);p.parentNode.replaceChild(q,p),l.push(q)}var r=b(g.data.substring(0,a.endNodeIndex),h);return e=f.parentNode,e.insertBefore(c,f),e.insertBefore(k,f),e.removeChild(f),e=g.parentNode,e.insertBefore(r,g),e.insertBefore(d,g),e.removeChild(g),r}}var k,l,m,n,o,p,q=[],r=0;if(m=c.ownerDocument,n=f.getBlockElements(),o=f.getWhiteSpaceElements(),p=f.getShortEndedElements(),l=h(c)){if(b.global)for(;k=b.exec(l);)q.push(g(k,e));else k=l.match(b),q.push(g(k,e));return q.length&&(r=q.length,i(c,q,j(d))),r}}function c(a){function c(){function b(){f.statusbar.find("#next").disabled(!g(l+1).length),f.statusbar.find("#prev").disabled(!g(l-1).length)}function c(){a.windowManager.alert("Could not find the specified string.",function(){f.find("#find")[0].focus()})}var d,e={};d=tinymce.trim(a.selection.getContent({format:"text"}));var f=a.windowManager.open({layout:"flex",pack:"center",align:"center",onClose:function(){a.focus(),k.done()},onSubmit:function(a){var d,h,i,j;return a.preventDefault(),h=f.find("#case").checked(),j=f.find("#words").checked(),i=f.find("#find").value(),i.length?e.text==i&&e.caseState==h&&e.wholeWord==j?0===g(l+1).length?void c():(k.next(),void b()):(d=k.find(i,h,j),d||c(),f.statusbar.items().slice(1).disabled(0===d),b(),void(e={text:i,caseState:h,wholeWord:j})):(k.done(!1),void f.statusbar.items().slice(1).disabled(!0))},buttons:[{text:"Find",subtype:"primary",onclick:function(){f.submit()}},{text:"Replace",disabled:!0,onclick:function(){k.replace(f.find("#replace").value())||(f.statusbar.items().slice(1).disabled(!0),l=-1,e={})}},{text:"Replace all",disabled:!0,onclick:function(){k.replace(f.find("#replace").value(),!0,!0),f.statusbar.items().slice(1).disabled(!0),e={}}},{type:"spacer",flex:1},{text:"Prev",name:"prev",disabled:!0,onclick:function(){k.prev(),b()}},{text:"Next",name:"next",disabled:!0,onclick:function(){k.next(),b()}}],title:"Find and replace",items:{type:"form",padding:20,labelGap:30,spacing:10,items:[{type:"textbox",name:"find",size:40,label:"Find",value:d},{type:"textbox",name:"replace",size:40,label:"Replace with"},{type:"checkbox",name:"case",text:"Match case",label:" "},{type:"checkbox",name:"words",text:"Whole words",label:" "}]}})}function d(a){var b=a.getAttribute("data-mce-index");return"number"==typeof b?""+b:b}function e(c){var d,e;return e=a.dom.create("span",{"data-mce-bogus":1}),e.className="mce-match-marker",d=a.getBody(),k.done(!1),b(c,d,e,!1,a.schema)}function f(a){var b=a.parentNode;a.firstChild&&b.insertBefore(a.firstChild,a),a.parentNode.removeChild(a)}function g(b){var c,e=[];if(c=tinymce.toArray(a.getBody().getElementsByTagName("span")),c.length)for(var f=0;f<c.length;f++){var g=d(c[f]);null!==g&&g.length&&g===b.toString()&&e.push(c[f])}return e}function h(b){var c=l,d=a.dom;b=b!==!1,b?c++:c--,d.removeClass(g(l),"mce-match-marker-selected");var e=g(c);return e.length?(d.addClass(g(c),"mce-match-marker-selected"),a.selection.scrollIntoView(e[0]),c):-1}function i(b){var c=a.dom,d=b.parentNode;c.remove(b),c.isEmpty(d)&&c.remove(d)}function j(a){var b=d(a);return null!==b&&b.length>0}var k=this,l=-1;k.init=function(a){a.addMenuItem("searchreplace",{text:"Find and replace",shortcut:"Meta+F",onclick:c,separator:"before",context:"edit"}),a.addButton("searchreplace",{tooltip:"Find and replace",shortcut:"Meta+F",onclick:c}),a.addCommand("SearchReplace",c),a.shortcuts.add("Meta+F","",c)},k.find=function(a,b,c){a=a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),a=c?"\\b"+a+"\\b":a;var d=e(new RegExp(a,b?"g":"gi"));return d&&(l=-1,l=h(!0)),d},k.next=function(){var a=h(!0);a!==-1&&(l=a)},k.prev=function(){var a=h(!1);a!==-1&&(l=a)},k.replace=function(b,c,e){var h,m,n,o,p,q,r=l;for(c=c!==!1,n=a.getBody(),m=tinymce.grep(tinymce.toArray(n.getElementsByTagName("span")),j),h=0;h<m.length;h++){var s=d(m[h]);if(o=p=parseInt(s,10),e||o===l){for(b.length?(m[h].firstChild.nodeValue=b,f(m[h])):i(m[h]);m[++h];){if(o=parseInt(d(m[h]),10),o!==p){h--;break}i(m[h])}c&&r--}else p>l&&m[h].setAttribute("data-mce-index",p-1)}return a.undoManager.add(),l=r,c?(q=g(r+1).length>0,k.next()):(q=g(r-1).length>0,k.prev()),!e&&q},k.done=function(b){var c,e,g,h;for(e=tinymce.toArray(a.getBody().getElementsByTagName("span")),c=0;c<e.length;c++){var i=d(e[c]);null!==i&&i.length&&(i===l.toString()&&(g||(g=e[c].firstChild),h=e[c].firstChild),f(e[c]))}if(g&&h){var j=a.dom.createRng();return j.setStart(g,0),j.setEnd(h,h.data.length),b!==!1&&a.selection.setRng(j),j}}}tinymce.PluginManager.add("searchreplace",c)}();
|
@@ -0,0 +1,139 @@
|
|
1
|
+
/**
|
2
|
+
* Inline development version. Only to be used while developing since it uses document.write to load scripts.
|
3
|
+
*/
|
4
|
+
|
5
|
+
/*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */
|
6
|
+
/*globals $code */
|
7
|
+
|
8
|
+
(function(exports) {
|
9
|
+
"use strict";
|
10
|
+
|
11
|
+
var html = "", baseDir;
|
12
|
+
var modules = {}, exposedModules = [], moduleCount = 0;
|
13
|
+
|
14
|
+
var scripts = document.getElementsByTagName('script');
|
15
|
+
for (var i = 0; i < scripts.length; i++) {
|
16
|
+
var src = scripts[i].src;
|
17
|
+
|
18
|
+
if (src.indexOf('/plugin.dev.js') != -1) {
|
19
|
+
baseDir = src.substring(0, src.lastIndexOf('/'));
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
function require(ids, callback) {
|
24
|
+
var module, defs = [];
|
25
|
+
|
26
|
+
for (var i = 0; i < ids.length; ++i) {
|
27
|
+
module = modules[ids[i]] || resolve(ids[i]);
|
28
|
+
if (!module) {
|
29
|
+
throw 'module definition dependecy not found: ' + ids[i];
|
30
|
+
}
|
31
|
+
|
32
|
+
defs.push(module);
|
33
|
+
}
|
34
|
+
|
35
|
+
callback.apply(null, defs);
|
36
|
+
}
|
37
|
+
|
38
|
+
function resolve(id) {
|
39
|
+
if (exports.privateModules && id in exports.privateModules) {
|
40
|
+
return;
|
41
|
+
}
|
42
|
+
|
43
|
+
var target = exports;
|
44
|
+
var fragments = id.split(/[.\/]/);
|
45
|
+
|
46
|
+
for (var fi = 0; fi < fragments.length; ++fi) {
|
47
|
+
if (!target[fragments[fi]]) {
|
48
|
+
return;
|
49
|
+
}
|
50
|
+
|
51
|
+
target = target[fragments[fi]];
|
52
|
+
}
|
53
|
+
|
54
|
+
return target;
|
55
|
+
}
|
56
|
+
|
57
|
+
function register(id) {
|
58
|
+
var target = exports;
|
59
|
+
var fragments = id.split(/[.\/]/);
|
60
|
+
|
61
|
+
for (var fi = 0; fi < fragments.length - 1; ++fi) {
|
62
|
+
if (target[fragments[fi]] === undefined) {
|
63
|
+
target[fragments[fi]] = {};
|
64
|
+
}
|
65
|
+
|
66
|
+
target = target[fragments[fi]];
|
67
|
+
}
|
68
|
+
|
69
|
+
target[fragments[fragments.length - 1]] = modules[id];
|
70
|
+
}
|
71
|
+
|
72
|
+
function define(id, dependencies, definition) {
|
73
|
+
var privateModules, i;
|
74
|
+
|
75
|
+
if (typeof id !== 'string') {
|
76
|
+
throw 'invalid module definition, module id must be defined and be a string';
|
77
|
+
}
|
78
|
+
|
79
|
+
if (dependencies === undefined) {
|
80
|
+
throw 'invalid module definition, dependencies must be specified';
|
81
|
+
}
|
82
|
+
|
83
|
+
if (definition === undefined) {
|
84
|
+
throw 'invalid module definition, definition function must be specified';
|
85
|
+
}
|
86
|
+
|
87
|
+
require(dependencies, function() {
|
88
|
+
modules[id] = definition.apply(null, arguments);
|
89
|
+
});
|
90
|
+
|
91
|
+
if (--moduleCount === 0) {
|
92
|
+
for (i = 0; i < exposedModules.length; i++) {
|
93
|
+
register(exposedModules[i]);
|
94
|
+
}
|
95
|
+
}
|
96
|
+
|
97
|
+
// Expose private modules for unit tests
|
98
|
+
if (exports.AMDLC_TESTS) {
|
99
|
+
privateModules = exports.privateModules || {};
|
100
|
+
|
101
|
+
for (id in modules) {
|
102
|
+
privateModules[id] = modules[id];
|
103
|
+
}
|
104
|
+
|
105
|
+
for (i = 0; i < exposedModules.length; i++) {
|
106
|
+
delete privateModules[exposedModules[i]];
|
107
|
+
}
|
108
|
+
|
109
|
+
exports.privateModules = privateModules;
|
110
|
+
}
|
111
|
+
|
112
|
+
}
|
113
|
+
|
114
|
+
function expose(ids) {
|
115
|
+
exposedModules = ids;
|
116
|
+
}
|
117
|
+
|
118
|
+
function writeScripts() {
|
119
|
+
document.write(html);
|
120
|
+
}
|
121
|
+
|
122
|
+
function load(path) {
|
123
|
+
html += '<script type="text/javascript" src="' + baseDir + '/' + path + '"></script>\n';
|
124
|
+
moduleCount++;
|
125
|
+
}
|
126
|
+
|
127
|
+
// Expose globally
|
128
|
+
exports.define = define;
|
129
|
+
exports.require = require;
|
130
|
+
|
131
|
+
expose(["tinymce/spellcheckerplugin/DomTextMatcher"]);
|
132
|
+
|
133
|
+
load('classes/DomTextMatcher.js');
|
134
|
+
load('classes/Plugin.js');
|
135
|
+
|
136
|
+
writeScripts();
|
137
|
+
})(this);
|
138
|
+
|
139
|
+
// $hash: a894b80e97e733310c550dadb509e87a
|