bedrock_sass 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/assets/_vendor/tinymce/plugins/advlist/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/advlist/plugin.js +428 -0
- data/assets/_vendor/tinymce/plugins/advlist/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/anchor/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/anchor/plugin.js +338 -0
- data/assets/_vendor/tinymce/plugins/anchor/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/autolink/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/autolink/plugin.js +404 -0
- data/assets/_vendor/tinymce/plugins/autolink/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/autoresize/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/autoresize/plugin.js +451 -0
- data/assets/_vendor/tinymce/plugins/autoresize/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/autosave/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/autosave/plugin.js +608 -0
- data/assets/_vendor/tinymce/plugins/autosave/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/bbcode/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/bbcode/plugin.js +264 -0
- data/assets/_vendor/tinymce/plugins/bbcode/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/charmap/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/charmap/plugin.js +850 -0
- data/assets/_vendor/tinymce/plugins/charmap/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/code/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/code/plugin.js +338 -0
- data/assets/_vendor/tinymce/plugins/code/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/codesample/css/prism.css +138 -0
- data/assets/_vendor/tinymce/plugins/codesample/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/codesample/plugin.js +1582 -0
- data/assets/_vendor/tinymce/plugins/codesample/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/colorpicker/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/colorpicker/plugin.js +272 -0
- data/assets/_vendor/tinymce/plugins/colorpicker/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/contextmenu/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/contextmenu/plugin.js +496 -0
- data/assets/_vendor/tinymce/plugins/contextmenu/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/directionality/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/directionality/plugin.js +270 -0
- data/assets/_vendor/tinymce/plugins/directionality/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-cool.gif +0 -0
- data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-cry.gif +0 -0
- data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-embarassed.gif +0 -0
- data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-foot-in-mouth.gif +0 -0
- data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-frown.gif +0 -0
- data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-innocent.gif +0 -0
- data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-kiss.gif +0 -0
- data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-laughing.gif +0 -0
- data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-money-mouth.gif +0 -0
- data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-sealed.gif +0 -0
- data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-smile.gif +0 -0
- data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-surprised.gif +0 -0
- data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-tongue-out.gif +0 -0
- data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-undecided.gif +0 -0
- data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-wink.gif +0 -0
- data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-yell.gif +0 -0
- data/assets/_vendor/tinymce/plugins/emoticons/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/emoticons/plugin.js +256 -0
- data/assets/_vendor/tinymce/plugins/emoticons/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/fullpage/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/fullpage/plugin.js +962 -0
- data/assets/_vendor/tinymce/plugins/fullpage/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/fullscreen/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/fullscreen/plugin.js +455 -0
- data/assets/_vendor/tinymce/plugins/fullscreen/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/help/img/logo.png +0 -0
- data/assets/_vendor/tinymce/plugins/help/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/help/plugin.js +1527 -0
- data/assets/_vendor/tinymce/plugins/help/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/hr/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/hr/plugin.js +195 -0
- data/assets/_vendor/tinymce/plugins/hr/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/image/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/image/plugin.js +1572 -0
- data/assets/_vendor/tinymce/plugins/image/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/imagetools/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/imagetools/plugin.js +4444 -0
- data/assets/_vendor/tinymce/plugins/imagetools/plugin.min.js +2 -0
- data/assets/_vendor/tinymce/plugins/importcss/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/importcss/plugin.js +577 -0
- data/assets/_vendor/tinymce/plugins/importcss/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/insertdatetime/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/insertdatetime/plugin.js +482 -0
- data/assets/_vendor/tinymce/plugins/insertdatetime/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/legacyoutput/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/legacyoutput/plugin.js +395 -0
- data/assets/_vendor/tinymce/plugins/legacyoutput/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/link/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/link/plugin.js +1231 -0
- data/assets/_vendor/tinymce/plugins/link/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/lists/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/lists/plugin.js +1985 -0
- data/assets/_vendor/tinymce/plugins/lists/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/media/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/media/plugin.js +2026 -0
- data/assets/_vendor/tinymce/plugins/media/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/nonbreaking/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/nonbreaking/plugin.js +313 -0
- data/assets/_vendor/tinymce/plugins/nonbreaking/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/noneditable/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/noneditable/plugin.js +316 -0
- data/assets/_vendor/tinymce/plugins/noneditable/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/pagebreak/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/pagebreak/plugin.js +354 -0
- data/assets/_vendor/tinymce/plugins/pagebreak/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/paste/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/paste/plugin.js +2935 -0
- data/assets/_vendor/tinymce/plugins/paste/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/preview/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/preview/plugin.js +410 -0
- data/assets/_vendor/tinymce/plugins/preview/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/print/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/print/plugin.js +194 -0
- data/assets/_vendor/tinymce/plugins/print/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/save/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/save/plugin.js +370 -0
- data/assets/_vendor/tinymce/plugins/save/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/searchreplace/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/searchreplace/plugin.js +977 -0
- data/assets/_vendor/tinymce/plugins/searchreplace/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/spellchecker/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/spellchecker/plugin.js +1419 -0
- data/assets/_vendor/tinymce/plugins/spellchecker/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/tabfocus/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/tabfocus/plugin.js +419 -0
- data/assets/_vendor/tinymce/plugins/tabfocus/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/table/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/table/plugin.js +15527 -0
- data/assets/_vendor/tinymce/plugins/table/plugin.min.js +5 -0
- data/assets/_vendor/tinymce/plugins/template/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/template/plugin.js +807 -0
- data/assets/_vendor/tinymce/plugins/template/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/textcolor/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/textcolor/plugin.js +619 -0
- data/assets/_vendor/tinymce/plugins/textcolor/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/textpattern/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/textpattern/plugin.js +718 -0
- data/assets/_vendor/tinymce/plugins/textpattern/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/toc/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/toc/plugin.js +559 -0
- data/assets/_vendor/tinymce/plugins/toc/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/visualblocks/css/visualblocks.css +154 -0
- data/assets/_vendor/tinymce/plugins/visualblocks/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/visualblocks/plugin.js +459 -0
- data/assets/_vendor/tinymce/plugins/visualblocks/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/visualchars/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/visualchars/plugin.js +1325 -0
- data/assets/_vendor/tinymce/plugins/visualchars/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/wordcount/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/wordcount/plugin.js +735 -0
- data/assets/_vendor/tinymce/plugins/wordcount/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/skins/lightgray/content.inline.min.css +1 -0
- data/assets/_vendor/tinymce/skins/lightgray/content.min.css +1 -0
- data/assets/_vendor/tinymce/skins/lightgray/content.mobile.min.css +1 -0
- data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce-mobile.woff +0 -0
- data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce-small.eot +0 -0
- data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce-small.svg +63 -0
- data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce-small.ttf +0 -0
- data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce-small.woff +0 -0
- data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce.eot +0 -0
- data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce.svg +131 -0
- data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce.ttf +0 -0
- data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce.woff +0 -0
- data/assets/_vendor/tinymce/skins/lightgray/img/anchor.gif +0 -0
- data/assets/_vendor/tinymce/skins/lightgray/img/loader.gif +0 -0
- data/assets/_vendor/tinymce/skins/lightgray/img/object.gif +0 -0
- data/assets/_vendor/tinymce/skins/lightgray/img/trans.gif +0 -0
- data/assets/_vendor/tinymce/skins/lightgray/skin.min.css +1 -0
- data/assets/_vendor/tinymce/skins/lightgray/skin.mobile.min.css +2 -0
- data/assets/_vendor/tinymce/themes/inlite/index.js +7 -0
- data/assets/_vendor/tinymce/themes/inlite/theme.js +18787 -0
- data/assets/_vendor/tinymce/themes/inlite/theme.min.js +5 -0
- data/assets/_vendor/tinymce/themes/mobile/index.js +7 -0
- data/assets/_vendor/tinymce/themes/mobile/theme.js +23384 -0
- data/assets/_vendor/tinymce/themes/mobile/theme.min.js +8 -0
- data/assets/_vendor/tinymce/themes/modern/index.js +7 -0
- data/assets/_vendor/tinymce/themes/modern/theme.js +18311 -0
- data/assets/_vendor/tinymce/themes/modern/theme.min.js +5 -0
- data/assets/_vendor/tinymce/tinymce.js +44399 -0
- data/assets/bedrock/js/bedrock.js +16587 -6193
- data/assets/bedrock/scss/_bedrock-components.scss +16 -0
- data/assets/bedrock/scss/_bedrock-settings.scss +15 -0
- data/assets/bedrock/scss/components/attachments-grid.scss +138 -0
- data/assets/bedrock/scss/components/dropzone-upload.scss +158 -0
- data/assets/bedrock/scss/components/global.scss +16 -8
- data/assets/bedrock/scss/components/helper-classes.scss +59 -0
- data/assets/bedrock/scss/components/inline-edit-box.scss +80 -0
- data/assets/bedrock/scss/components/login-box.scss +48 -0
- data/assets/bedrock/scss/components/no-content.scss +31 -0
- data/assets/bedrock/scss/components/off-canvas-menu.scss +1 -1
- data/assets/bedrock/scss/components/page-content.scss +51 -0
- data/assets/bedrock/scss/components/reveal-panel.scss +89 -0
- data/assets/bedrock/scss/components/select-box.scss +332 -0
- data/assets/bedrock/scss/components/tiny-mce-editor.scss +14 -7
- data/lib/bedrock_sass.rb +6 -0
- data/lib/bedrock_sass/engine.rb +8 -0
- data/lib/bedrock_sass/version.rb +1 -1
- data/lib/tasks/before_assets_precompile.rake +11 -0
- metadata +188 -2
@@ -0,0 +1,2 @@
|
|
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[f]=d(a[f]);b.apply(null,e)},f={};f.bolt={module:{api:{define:c,require:e,demand:d}}};var g=c,h=function(a,b){g(a,[],function(){return b})};g("1",[],function(){var a=function(b){var c=b,d=function(){return c},e=function(a){c=a},f=function(){return a(d())};return{get:d,set:e,clone:f}};return a}),h("7",tinymce.util.Tools.resolve),g("2",["7"],function(a){return a("tinymce.PluginManager")}),g("8",["7"],function(a){return a("tinymce.util.Tools")}),g("13",[],function(){function a(a,b){return e(document.createElement("canvas"),a,b)}function b(b){var d,e;return d=a(b.width,b.height),e=c(d),e.drawImage(b,0,0),d}function c(a){return a.getContext("2d")}function d(a){var b=null;try{b=a.getContext("webgl")||a.getContext("experimental-webgl")}catch(a){}return b||(b=null),b}function e(a,b,c){return a.width=b,a.height=c,a}return{create:a,clone:b,resize:e,get2dContext:c,get3dContext:d}}),g("14",[],function(){function a(a){return a.naturalWidth||a.width}function b(a){return a.naturalHeight||a.height}return{getWidth:a,getHeight:b}}),g("15",[],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}),h("f",Array),h("g",Error),g("a",["f","g"],function(a,b){var c=function(){},d=function(a){return function(){return a()}},e=function(a,b){return function(){return a(b.apply(null,arguments))}},f=function(a){return function(){return a}},g=function(a){return a},h=function(a,b){return a===b},i=function(b){for(var c=new a(arguments.length-1),d=1;d<arguments.length;d++)c[d-1]=arguments[d];return function(){for(var d=new a(arguments.length),e=0;e<d.length;e++)d[e]=arguments[e];var f=c.concat(d);return b.apply(null,f)}},j=function(a){return function(){return!a.apply(null,arguments)}},k=function(a){return function(){throw new b(a)}},l=function(a){return a()},m=function(a){a()},n=f(!1),o=f(!0);return{noop:c,noarg:d,compose:e,constant:f,identity:g,tripleEquals:h,curry:i,not:j,die:k,apply:l,call:m,never:n,always:o}}),h("16",Object),g("q",["a","16"],function(a,b){var c=a.never,d=a.always,e=function(){return f},f=function(){var f=function(a){return a.isNone()},g=function(a){return a()},h=function(a){return a},i=function(){},j={fold:function(a,b){return a()},is:c,isSome:c,isNone:d,getOr:h,getOrThunk:g,getOrDie:function(a){throw new Error(a||"error: getOrDie called on none.")},or:h,orThunk:g,map:e,ap:e,each:i,bind:e,flatten:e,exists:c,forall:d,filter:e,equals:f,equals_:f,toArray:function(){return[]},toString:a.constant("none()")};return b.freeze&&b.freeze(j),j}(),g=function(a){var b=function(){return a},h=function(){return k},i=function(b){return g(b(a))},j=function(b){return b(a)},k={fold:function(b,c){return c(a)},is:function(b){return a===b},isSome:d,isNone:c,getOr:b,getOrThunk:b,getOrDie:b,or:h,orThunk:h,map:i,ap:function(b){return b.fold(e,function(b){return g(b(a))})},each:function(b){b(a)},bind:j,flatten:b,exists:j,forall:j,filter:function(b){return b(a)?k:f},equals:function(b){return b.is(a)},equals_:function(b,d){return b.fold(c,function(b){return d(a,b)})},toArray:function(){return[a]},toString:function(){return"some("+a+")"}};return k},h=function(a){return null===a||void 0===a?f:g(a)};return{some:g,none:e,from:h}}),g("1l",[],function(){var a="undefined"!=typeof window?window:Function("return this;")();return a}),g("1d",["1l"],function(a){var b=function(b,c){for(var d=void 0!==c?c:a,e=0;e<b.length&&void 0!==d&&null!==d;++e)d=d[b[e]];return d},c=function(a,c){var d=a.split(".");return b(d,c)},d=function(a,b){return void 0!==a[b]&&null!==a[b]||(a[b]={}),a[b]},e=function(b,c){for(var e=void 0!==c?c:a,f=0;f<b.length;++f)e=d(e,b[f]);return e},f=function(a,b){var c=a.split(".");return e(c,b)};return{path:b,resolve:c,forge:e,namespace:f}}),g("u",["1d"],function(a){var b=function(b,c){return a.resolve(b,c)},c=function(a,c){var d=b(a,c);if(void 0===d)throw a+" not available on this browser";return d};return{getOrDie:c}}),g("17",["u"],function(a){return function(b,c){var d=a.getOrDie("Blob");return new d(b,c)}}),g("18",["u"],function(a){return function(){var b=a.getOrDie("FileReader");return new b}}),g("19",["u"],function(a){return function(b){var c=a.getOrDie("Uint8Array");return new c(b)}}),g("1a",["u"],function(a){var b=function(b){var c=a.getOrDie("requestAnimationFrame");c(b)},c=function(b){var c=a.getOrDie("atob");return c(b)};return{atob:c,requestAnimationFrame:b}}),h("x",Math),g("p",["13","14","15","q","17","18","19","1a","f","x"],function(a,b,c,d,e,f,g,h,i,j){function k(a){return new c(function(b){function c(){a.removeEventListener("load",c),b(a)}a.complete?b(a):a.addEventListener("load",c)})}function l(a){return k(a).then(function(a){var b=a.src;return 0===b.indexOf("blob:")?n(b):0===b.indexOf("data:")?p(b):n(b)})}function m(a){return new c(function(b,c){function d(){h(),b(g)}function e(){h(),c("Unable to load data of type "+a.type+": "+f)}var f=URL.createObjectURL(a),g=new Image,h=function(){g.removeEventListener("load",d),g.removeEventListener("error",e)};g.addEventListener("load",d),g.addEventListener("error",e),g.src=f,g.complete&&d()})}function n(a){return new c(function(b){var c=new XMLHttpRequest;c.open("GET",a,!0),c.responseType="blob",c.onload=function(){200==this.status&&b(this.response)},c.send()})}function o(a){var b=a.split(","),c=/data:([^;]+)/.exec(b[0]);if(!c)return d.none();for(var f=c[1],k=b[1],l=1024,m=h.atob(k),n=m.length,o=j.ceil(n/l),p=new i(o),q=0;q<o;++q){for(var r=q*l,s=j.min(r+l,n),t=new i(s-r),u=r,v=0;u<s;++v,++u)t[v]=m[u].charCodeAt(0);p[q]=g(t)}return d.some(e(p,{type:f}))}function p(a){return new c(function(b,c){o(a).fold(function(){c("uri is not base64: "+a)},b)})}function q(a){return 0===a.indexOf("blob:")?n(a):0===a.indexOf("data:")?p(a):null}function r(a,b,d){return b=b||"image/png",HTMLCanvasElement.prototype.toBlob?new c(function(c){a.toBlob(function(a){c(a)},b,d)}):p(a.toDataURL(b,d))}function s(a,b,c){return b=b||"image/png",a.then(function(a){return a.toDataURL(b,c)})}function t(c){return m(c).then(function(c){w(c);var d,e;return e=a.create(b.getWidth(c),b.getHeight(c)),d=a.get2dContext(e),d.drawImage(c,0,0),e})}function u(a){return new c(function(b){var c=new f;c.onloadend=function(){b(c.result)},c.readAsDataURL(a)})}function v(a){return u(a).then(function(a){return a.split(",")[1]})}function w(a){URL.revokeObjectURL(a.src)}return{blobToImage:m,imageToBlob:l,blobToDataUri:u,blobToBase64:v,dataUriToBlobSync:o,canvasToBlob:r,canvasToDataURL:s,blobToCanvas:t,uriToBlob:q}}),g("c",["p","q"],function(a,b){var c=function(b){return a.blobToImage(b)},d=function(b){return a.imageToBlob(b)},e=function(b){return a.blobToDataUri(b)},f=function(b){return a.blobToBase64(b)},g=function(b){return a.dataUriToBlobSync(b)},h=function(c){return b.from(a.uriToBlob(c))};return{blobToImage:c,imageToBlob:d,blobToDataUri:e,blobToBase64:f,dataUriToBlobSync:g,uriToBlob:h}}),g("t",["13","p","15","a"],function(a,b,c,d){function e(e,f,g){function h(){return c.resolve(f)}function i(){return g}function j(){return g.split(",")[1]}function k(a,c){return e.then(function(d){return b.canvasToBlob(d,a,c)})}function l(a,c){return e.then(function(d){return b.canvasToDataURL(d,a,c)})}function m(a,b){return l(a,b).then(function(a){return a.split(",")[1]})}function n(){return e.then(a.clone)}var o=f.type,p=d.constant(o);return{getType:p,toBlob:h,toDataURL:i,toBase64:j,toAdjustedBlob:k,toAdjustedDataURL:l,toAdjustedBase64:m,toCanvas:n}}function f(a){return b.blobToDataUri(a).then(function(c){return e(b.blobToCanvas(a),a,c)})}function g(a,d){return b.canvasToBlob(a,d).then(function(b){return e(c.resolve(a),b,a.toDataURL())})}function h(a){return b.imageToBlob(a).then(function(a){return f(a)})}var i=function(a,c){return e(b.blobToCanvas(a),a,c)};return{fromBlob:f,fromCanvas:g,fromImage:h,fromBlobAndUrlSync:i}}),g("1b",[],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("r",["13","t","1b"],function(a,b,c){function d(a,b){return a.toCanvas().then(function(c){return e(c,a.getType(),b)})}function e(c,d,e){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.get2dContext(c);return g=f(h.getImageData(0,0,c.width,c.height),e),h.putImageData(g,0,0),b.fromCanvas(c,d)}function f(a,b){return a.toCanvas().then(function(c){return g(c,a.getType(),b)})}function g(c,d,e){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.get2dContext(c);return g=i.getImageData(0,0,c.width,c.height),h=i.getImageData(0,0,c.width,c.height),h=f(g,h,e),i.putImageData(h,0,0),b.fromCanvas(c,d)}function h(c){var d=function(d,e,f){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.get2dContext(d),k=new Array(256);for(i=0;i<k.length;i++)k[i]=c(i,f);return h=g(j.getImageData(0,0,d.width,d.height),k),j.putImageData(h,0,0),b.fromCanvas(d,e)};return function(a,b){return a.toCanvas().then(function(c){return d(c,a.getType(),b)})}}function i(a){return function(b,e){return d(b,a(c.identity(),e))}}function j(a){return function(b){return d(b,a)}}function k(a){return function(b){return f(b,a)}}return{invert:j([-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0]),brightness:i(c.adjustBrightness),hue:i(c.adjustHue),saturate:i(c.adjustSaturation),contrast:i(c.adjustContrast),grayscale:i(c.adjustGrayscale),sepia:i(c.adjustSepia),colorize:function(a,b,e,f){return d(a,c.adjustColors(c.identity(),b,e,f))},sharpen:k([0,-1,0,-1,5,-1,0,-1,0]),emboss:k([-2,-1,0,-1,1,1,0,1,2]),gamma:h(function(a,b){return 255*Math.pow(a/255,1-b)}),exposure:h(function(a,b){return 255*(1-Math.exp(-(a/255)*b))}),colorFilter:d,convoluteFilter:f}}),g("1c",["13","14","15"],function(a,b,c){function d(a,c,f){var g=b.getWidth(a),h=b.getHeight(a),i=c/g,j=f/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=e(a,i,j);return k?l.then(function(a){return d(a,c,f)}):l}function e(d,e,f){return new c(function(c){var g=b.getWidth(d),h=b.getHeight(d),i=Math.floor(g*e),j=Math.floor(h*f),k=a.create(i,j),l=a.get2dContext(k);l.drawImage(d,0,0,g,h,0,0,i,j),c(k)})}return{scale:d}}),g("s",["13","t","1c"],function(a,b,c){function d(a,b){return a.toCanvas().then(function(c){return e(c,a.getType(),b)})}function e(c,d,e){var f=a.create(c.width,c.height),g=a.get2dContext(f),h=0,i=0;return e=e<0?360+e:e,90!=e&&270!=e||a.resize(f,f.height,f.width),90!=e&&180!=e||(h=f.width),270!=e&&180!=e||(i=f.height),g.translate(h,i),g.rotate(e*Math.PI/180),g.drawImage(c,0,0),b.fromCanvas(f,d)}function f(a,b){return a.toCanvas().then(function(c){return g(c,a.getType(),b)})}function g(c,d,e){var f=a.create(c.width,c.height),g=a.get2dContext(f);return"v"==e?(g.scale(1,-1),g.drawImage(c,0,-f.height)):(g.scale(-1,1),g.drawImage(c,-f.width,0)),b.fromCanvas(f,d)}function h(a,b,c,d,e){return a.toCanvas().then(function(f){return i(f,a.getType(),b,c,d,e)})}function i(c,d,e,f,g,h){var i=a.create(g,h),j=a.get2dContext(i);return j.drawImage(c,-e,-f),b.fromCanvas(i,d)}function j(a,d,e){return a.toCanvas().then(function(f){return c.scale(f,d,e).then(function(c){return b.fromCanvas(c,a.getType())})})}return{rotate:d,flip:f,crop:h,resize:j}}),g("d",["r","s"],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("e",["t"],function(a){var b=function(b){return a.fromBlob(b)},c=function(b,c){return a.fromBlobAndUrlSync(b,c)},d=function(b){return a.fromImage(b)},e=function(a,b,c){return void 0===b&&void 0===c?f(a):a.toAdjustedBlob(b,c)},f=function(a){return a.toBlob()},g=function(a){return a.toDataURL()};return{blobToImageResult:b,fromBlobAndUrlSync:c,imageToImageResult:d,imageResultToBlob:e,imageResultToOriginalBlob:f,imageResultToDataURL:g}}),g("h",["u"],function(a){var b=function(){return a.getOrDie("URL")},c=function(a){return b().createObjectURL(a)},d=function(a){b().revokeObjectURL(a)};return{createObjectURL:c,revokeObjectURL:d}}),h("i",clearTimeout),g("j",["7"],function(a){return a("tinymce.util.Delay")}),g("k",["7"],function(a){return a("tinymce.util.Promise")}),g("l",["7"],function(a){return a("tinymce.util.URI")}),g("b",[],function(){var a=function(a){return a.getParam("imagetools_toolbar","rotateleft rotateright | flipv fliph | crop editimage imageoptions")},b=function(a){return a.getParam("imagetools_proxy")};return{getToolbarItems:a,getProxyUrl:b}}),g("m",[],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}}),h("1m",String),g("1e",["q","f","g","1m"],function(a,b,c,d){var e=function(){var a=b.prototype.indexOf,c=function(b,c){return a.call(b,c)},d=function(a,b){return u(a,b)};return void 0===a?d:c}(),f=function(b,c){var d=e(b,c);return d===-1?a.none():a.some(d)},g=function(a,b){return e(a,b)>-1},h=function(a,b){return t(a,b).isSome()},i=function(a,b){for(var c=[],d=0;d<a;d++)c.push(b(d));return c},j=function(a,b){for(var c=[],d=0;d<a.length;d+=b){var e=a.slice(d,d+b);c.push(e)}return c},k=function(a,c){for(var d=a.length,e=new b(d),f=0;f<d;f++){var g=a[f];e[f]=c(g,f,a)}return e},l=function(a,b){for(var c=0,d=a.length;c<d;c++){var e=a[c];b(e,c,a)}},m=function(a,b){for(var c=a.length-1;c>=0;c--){var d=a[c];b(d,c,a)}},n=function(a,b){for(var c=[],d=[],e=0,f=a.length;e<f;e++){var g=a[e],h=b(g,e,a)?c:d;h.push(g)}return{pass:c,fail:d}},o=function(a,b){for(var c=[],d=0,e=a.length;d<e;d++){var f=a[d];b(f,d,a)&&c.push(f)}return c},p=function(a,b){if(0===a.length)return[];for(var c=b(a[0]),d=[],e=[],f=0,g=a.length;f<g;f++){var h=a[f],i=b(h);i!==c&&(d.push(e),e=[]),c=i,e.push(h)}return 0!==e.length&&d.push(e),d},q=function(a,b,c){return m(a,function(a){c=b(c,a)}),c},r=function(a,b,c){return l(a,function(a){c=b(c,a)}),c},s=function(b,c){for(var d=0,e=b.length;d<e;d++){var f=b[d];if(c(f,d,b))return a.some(f)}return a.none()},t=function(b,c){for(var d=0,e=b.length;d<e;d++){var f=b[d];if(c(f,d,b))return a.some(d)}return a.none()},u=function(a,b){for(var c=0,d=a.length;c<d;++c)if(a[c]===b)return c;return-1},v=b.prototype.push,w=function(a){for(var d=[],e=0,f=a.length;e<f;++e){if(!b.prototype.isPrototypeOf(a[e]))throw new c("Arr.flatten item "+e+" was not an array, input: "+a);v.apply(d,a[e])}return d},x=function(a,b){var c=k(a,b);return w(c)},y=function(a,b){for(var c=0,d=a.length;c<d;++c){var e=a[c];if(b(e,c,a)!==!0)return!1}return!0},z=function(a,b){return a.length===b.length&&y(a,function(a,c){return a===b[c]})},A=b.prototype.slice,B=function(a){var b=A.call(a,0);return b.reverse(),b},C=function(a,b){return o(a,function(a){return!g(b,a)})},D=function(a,b){for(var c={},e=0,f=a.length;e<f;e++){var g=a[e];c[d(g)]=b(g,e)}return c},E=function(a){return[a]},F=function(a,b){var c=A.call(a,0);return c.sort(b),c},G=function(b){return 0===b.length?a.none():a.some(b[0])},H=function(b){return 0===b.length?a.none():a.some(b[b.length-1])};return{map:k,each:l,eachr:m,partition:n,filter:o,groupBy:p,indexOf:f,foldr:q,foldl:r,find:s,findIndex:t,flatten:w,bind:x,forall:y,exists:h,contains:g,equal:z,reverse:B,chunk:j,difference:C,mapToObject:D,pure:E,sort:F,range:i,head:G,last:H}}),g("1f",["u"],function(a){return function(){var b=a.getOrDie("XMLHttpRequest");return new b}}),g("w",["18","1f","k","8"],function(a,b,c,d){var e=function(a){return null!==a&&void 0!==a},f=function(a,b){var c;return c=b.reduce(function(a,b){return e(a)?a[b]:void 0},a),e(c)?c:null},g=function(a,e){return new c(function(c){var f;f=new b,f.onreadystatechange=function(){4===f.readyState&&c({status:f.status,blob:this.response})},f.open("GET",a,!0),d.each(e,function(a,b){f.setRequestHeader(b,a)}),f.responseType="blob",f.send()})},h=function(b){return new c(function(c){var d=new a;d.onload=function(a){var b=a.target;c(b.result)},d.readAsText(b)})},i=function(a){var b;try{b=JSON.parse(a)}catch(a){}return b};return{traverse:f,readBlob:h,requestUrlAsBlob:g,parseJson:i}}),g("v",["1e","a","k","w"],function(a,b,c,d){var e=[{code:404,message:"Could not find Image Proxy"},{code:403,message:"Rejected request"},{code:0,message:"Incorrect Image Proxy URL"}],f=[{type:"key_missing",message:"The request did not include an api key."},{type:"key_not_found",message:"The provided api key could not be found."},{type:"domain_not_trusted",message:"The api key is not valid for the request origins."}],g=function(a){return 400===a||403===a||500===a},h=function(c){var d=a.find(e,function(a){return c===a.code}).fold(b.constant("Unknown ImageProxy error"),function(a){return a.message});return"ImageProxy HTTP error: "+d},i=function(a){var b=h(a);return c.reject(b)},j=function(c){return a.find(f,function(a){return a.type===c}).fold(b.constant("Unknown service error"),function(a){return a.message})},k=function(a){var b=d.parseJson(a),c=d.traverse(b,["error","type"]),e=c?j(c):"Invalid JSON in service error message";return"ImageProxy Service error: "+e},l=function(a,b){return d.readBlob(b).then(function(a){var b=k(a);return c.reject(b)})},m=function(a,b){return g(a)?l(a,b):i(a)};return{handleServiceErrorResponse:m,handleHttpError:i,getHttpErrorMsg:h,getServiceErrorMsg:j}}),g("n",["k","8","v","w"],function(a,b,c,d){function e(b){return d.requestUrlAsBlob(b,{}).then(function(b){return b.status<200||b.status>=300?c.handleHttpError(b.status):a.resolve(b.blob)})}var f=function(a,b){var c=a.indexOf("?")===-1?"?":"&";return/[?&]apiKey=/.test(a)||!b?a:a+c+"apiKey="+encodeURIComponent(b)},g=function(b,e){return d.requestUrlAsBlob(f(b,e),{"Content-Type":"application/json;charset=UTF-8","tiny-api-key":e}).then(function(b){return b.status<200||b.status>=300?c.handleServiceErrorResponse(b.status,b.blob):a.resolve(b.blob)})},h=function(a,b){return b?g(a,b):e(a)};return{getUrl:h}}),h("y",setTimeout),g("z",["7"],function(a){return a("tinymce.dom.DOMUtils")}),g("10",["7"],function(a){return a("tinymce.ui.Factory")}),g("11",[],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}}}),h("1g",document),h("1h",Image),g("1i",["7"],function(a){return a("tinymce.geom.Rect")}),g("1j",["k"],function(a){var b=function(b){return new a(function(a){var c=function(){b.removeEventListener("load",c),a(b)};b.complete?a(b):b.addEventListener("load",c)})};return{loadImage:b}}),g("1n",["7"],function(a){return a("tinymce.dom.DomQuery")}),g("1o",["7"],function(a){return a("tinymce.util.Observable")}),g("1p",["7"],function(a){return a("tinymce.util.VK")}),g("1k",["1n","1i","10","1o","8","1p"],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,c,d,e){var f,g,i,k,l;f=c.x,g=c.y,i=c.w,k=c.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=b.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 b(a){var b,d=c.get("DragHelper");return new d(D,{document:k.ownerDocument,handle:D+"-"+a.name,start:function(){b=h},drag:function(c){p(a,b,c.deltaX,c.deltaY)}})}a('<div id="'+D+'" class="'+C+'croprect-container" role="grid" aria-dropeffect="execute">').appendTo(k),e.each(B,function(b){a("#"+D,k).append('<div id="'+D+"-"+b+'"class="'+C+'croprect-block" style="display: none" data-mce-bogus="all">')}),e.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=e.map(z,b),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(e.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=e.map(z,function(a){return"#"+D+"-"+a.name}).concat(e.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})}e.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(){e.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=e.extend({toggleVisibility:r,setClampRect:w,setRect:t,getInnerRect:o,setInnerRect:v,setViewPortRect:u,destroy:x},d)}}),g("12",["1g","1h","1i","10","k","8","1j","1k"],function(a,b,c,d,e,f,g,h){var i=function(e){var f=d.get("Control"),i=f.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(d){var e=this,f=new b;f.src=d,g.loadImage(f).then(function(){var b,d,g=e.state.get("viewRect");if(d=e.$el.find("img"),d[0])d.replaceWith(f);else{var h=a.createElement("div");h.className="mce-imagepanel-bg",e.getEl().appendChild(h),e.getEl().appendChild(f)}b={x:0,y:0,w:f.naturalWidth,h:f.naturalHeight},e.state.set("viewRect",b),e.state.set("rect",c.inflate(b,-20,-20)),g&&g.w===b.w&&g.h===b.h||e.zoomFit(),e.repaintImage(),e.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 h(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)})}});return new i(e)};return{create:i}}),g("o",["d","e","h","x","y","z","10","k","8","11","12"],function(a,b,c,d,e,f,g,h,i,j,k){function l(a){return{blob:a,url:c.createObjectURL(a)}}function m(a){a&&c.revokeObjectURL(a.url)}function n(a){i.each(a,m)}function o(c,h,o,p){function q(a){var b,c,e,f;b=O.find("#w")[0],c=O.find("#h")[0],e=parseInt(b.value(),10),f=parseInt(c.value(),10),O.find("#constrain")[0].checked()&&ja&&ka&&e&&f&&("w"===a.control.settings.name?(f=d.round(e*la),c.value(f)):(e=d.round(f*ma),b.value(e))),ja=e,ka=f}function r(a){return d.round(100*a)+"%"}function s(){O.find("#undo").disabled(!na.canUndo()),O.find("#redo").disabled(!na.canRedo()),O.statusbar.find("#save").disabled(!na.canUndo())}function t(){O.find("#undo").disabled(!0),O.find("#redo").disabled(!0)}function u(a){a&&V.imageSrc(a.url)}function v(a){return function(){var b=i.grep(ia,function(b){return b.settings.name!==a});i.each(b,function(a){a.hide()}),a.show(),a.focus()}}function w(a){R=l(a),u(R)}function x(a){h=l(a),u(h),n(na.add(h).removed),s()}function y(){var c=V.selection();b.blobToImageResult(h.blob).then(function(b){a.crop(b,c.x,c.y,c.w,c.h).then(oa).then(function(a){x(a),B()})})}function z(a){var c=[].slice.call(arguments,1);return function(){var d=R||h;b.blobToImageResult(d.blob).then(function(b){a.apply(this,[b].concat(c)).then(oa).then(w)})}}function A(a){var c=[].slice.call(arguments,1);
|
2
|
+
return function(){b.blobToImageResult(h.blob).then(function(b){a.apply(this,[b].concat(c)).then(oa).then(x)})}}function B(){u(h),m(R),v(P)(),s()}function C(a,b){R?b():e(function(){a-- >0?C(a,b):c.windowManager.alert("Error: failed to apply image operation.")},10)}function D(){R?(x(R.blob),B()):C(100,D)}function E(){var a=V.zoom();a<2&&(a+=.1),V.zoom(a)}function F(){var a=V.zoom();a>.1&&(a-=.1),V.zoom(a)}function G(){h=na.undo(),u(h),s()}function H(){h=na.redo(),u(h),s()}function I(){o(h.blob),O.close()}function J(a){return g.create("Form",{layout:"flex",direction:"row",labelGap:5,border:"0 0 1 0",align:"center",pack:"center",padding:"0 10 0 10",spacing:5,flex:0,minHeight:60,defaults:{classes:"imagetool",type:"button"},items:a})}function K(a,c){return J([{text:"Back",onclick:B},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:D}]).hide().on("show",function(){t(),b.blobToImageResult(h.blob).then(function(a){return c(a)}).then(oa).then(function(a){var b=l(a);u(b),m(R),R=b})})}function L(a,c,d,e,f){function g(a){b.blobToImageResult(h.blob).then(function(b){return c(b,a)}).then(oa).then(function(a){var b=l(a);u(b),m(R),R=b})}return J([{text:"Back",onclick:B},{type:"spacer",flex:1},{type:"slider",flex:1,ondragend:function(a){g(a.value)},minValue:e,maxValue:f,value:d,previewFilter:r},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:D}]).hide().on("show",function(){this.find("slider").value(d),t()})}function M(a,c){function d(){var a,d,e;a=O.find("#r")[0].value(),d=O.find("#g")[0].value(),e=O.find("#b")[0].value(),b.blobToImageResult(h.blob).then(function(b){return c(b,a,d,e)}).then(oa).then(function(a){var b=l(a);u(b),m(R),R=b})}return J([{text:"Back",onclick:B},{type:"spacer",flex:1},{type:"slider",label:"R",name:"r",minValue:0,value:1,maxValue:2,ondragend:d,previewFilter:r},{type:"slider",label:"G",name:"g",minValue:0,value:1,maxValue:2,ondragend:d,previewFilter:r},{type:"slider",label:"B",name:"b",minValue:0,value:1,maxValue:2,ondragend:d,previewFilter:r},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:D}]).hide().on("show",function(){O.find("#r,#g,#b").value(1),t()})}function N(a){a.control.value()===!0&&(la=ka/ja,ma=ja/ka)}var O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka,la,ma,na=new j,oa=function(a){return a.toBlob()};S=J([{text:"Back",onclick:B},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:y}]).hide().on("show hide",function(a){V.toggleCropRect("show"===a.type)}).on("show",t),T=J([{text:"Back",onclick:B},{type:"spacer",flex:1},{type:"textbox",name:"w",label:"Width",size:4,onkeyup:q},{type:"textbox",name:"h",label:"Height",size:4,onkeyup:q},{type:"checkbox",name:"constrain",text:"Constrain proportions",checked:!0,onchange:N},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:"submit"}]).hide().on("submit",function(b){var c=parseInt(O.find("#w").value(),10),d=parseInt(O.find("#h").value(),10);b.preventDefault(),A(a.resize,c,d)(),B()}).on("show",t),U=J([{text:"Back",onclick:B},{type:"spacer",flex:1},{icon:"fliph",tooltip:"Flip horizontally",onclick:z(a.flip,"h")},{icon:"flipv",tooltip:"Flip vertically",onclick:z(a.flip,"v")},{icon:"rotateleft",tooltip:"Rotate counterclockwise",onclick:z(a.rotate,-90)},{icon:"rotateright",tooltip:"Rotate clockwise",onclick:z(a.rotate,90)},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:D}]).hide().on("show",t),Y=K("Invert",a.invert),ea=K("Sharpen",a.sharpen),fa=K("Emboss",a.emboss),Z=L("Brightness",a.brightness,0,-1,1),$=L("Hue",a.hue,180,0,360),_=L("Saturate",a.saturate,0,-1,1),aa=L("Contrast",a.contrast,0,-1,1),ba=L("Grayscale",a.grayscale,0,0,1),ca=L("Sepia",a.sepia,0,0,1),da=M("Colorize",a.colorize),ga=L("Gamma",a.gamma,0,-1,1),ha=L("Exposure",a.exposure,1,0,2),Q=J([{text:"Back",onclick:B},{type:"spacer",flex:1},{text:"hue",icon:"hue",onclick:v($)},{text:"saturate",icon:"saturate",onclick:v(_)},{text:"sepia",icon:"sepia",onclick:v(ca)},{text:"emboss",icon:"emboss",onclick:v(fa)},{text:"exposure",icon:"exposure",onclick:v(ha)},{type:"spacer",flex:1}]).hide(),P=J([{tooltip:"Crop",icon:"crop",onclick:v(S)},{tooltip:"Resize",icon:"resize2",onclick:v(T)},{tooltip:"Orientation",icon:"orientation",onclick:v(U)},{tooltip:"Brightness",icon:"sun",onclick:v(Z)},{tooltip:"Sharpen",icon:"sharpen",onclick:v(ea)},{tooltip:"Contrast",icon:"contrast",onclick:v(aa)},{tooltip:"Color levels",icon:"drop",onclick:v(da)},{tooltip:"Gamma",icon:"gamma",onclick:v(ga)},{tooltip:"Invert",icon:"invert",onclick:v(Y)}]),V=k.create({flex:1,imageSrc:h.url}),W=g.create("Container",{layout:"flex",direction:"column",border:"0 1 0 0",padding:5,spacing:5,items:[{type:"button",icon:"undo",tooltip:"Undo",name:"undo",onclick:G},{type:"button",icon:"redo",tooltip:"Redo",name:"redo",onclick:H},{type:"button",icon:"zoomin",tooltip:"Zoom in",onclick:E},{type:"button",icon:"zoomout",tooltip:"Zoom out",onclick:F}]}),X=g.create("Container",{type:"container",layout:"flex",direction:"row",align:"stretch",flex:1,items:[W,V]}),ia=[P,S,T,U,Q,Y,Z,$,_,aa,ba,ca,da,ea,fa,ga,ha],O=c.windowManager.open({layout:"flex",direction:"column",align:"stretch",minWidth:d.min(f.DOM.getViewPort().w,800),minHeight:d.min(f.DOM.getViewPort().h,650),title:"Edit image",items:ia.concat([X]),buttons:[{text:"Save",name:"save",subtype:"primary",onclick:I},{text:"Cancel",onclick:"close"}]}),O.on("close",function(){p(),n(na.data),na=null,R=null}),na.add(h),s(),V.on("load",function(){ja=V.imageSize().w,ka=V.imageSize().h,la=ka/ja,ma=ja/ka,O.find("#w").value(ja),O.find("#h").value(ka)}),V.on("crop",y)}function p(a,b){return new h(function(c,d){return b.toBlob().then(function(b){o(a,l(b),c,d)})})}return{edit:p}}),g("9",["c","d","e","a","h","i","j","k","8","l","b","m","n","o"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){var o=0,p=function(a,b){var c=a.dom.is(b,"img:not([data-mce-object],[data-mce-placeholder])");return c&&(u(a,b)||v(a,b)||a.settings.imagetools_proxy)},q=function(a,b){a.notificationManager.open({text:b,type:"error"})},r=function(a){return a.selection.getNode()},s=function(a,b){var c=b.match(/\/([^\/\?]+)?\.(?:jpeg|jpg|png|gif)(?:\?|$)/i);return c?a.dom.encode(c[1]):null},t=function(){return"imagetools"+o++},u=function(a,b){var c=b.src;return 0===c.indexOf("data:")||0===c.indexOf("blob:")||new j(c).host===a.documentBaseURI.host},v=function(a,b){return i.inArray(a.settings.imagetools_cors_hosts,new j(b.src).host)!==-1},w=function(a){return a.settings.api_key||a.settings.imagetools_api_key},x=function(b,c){var d,e=c.src;return v(b,c)?m.getUrl(c.src,null):u(b,c)?a.imageToBlob(c):(e=k.getProxyUrl(b),e+=(e.indexOf("?")===-1?"?":"&")+"url="+encodeURIComponent(c.src),d=w(b),m.getUrl(e,d))},y=function(a){var b;return b=a.editorUpload.blobCache.getByUri(r(a).src),b?h.resolve(b.blob()):x(a,r(a))},z=function(a,b){var c=g.setEditorTimeout(a,function(){a.editorUpload.uploadImagesAuto()},a.settings.images_upload_timeout||3e4);b.set(c)},A=function(a){f(a.get())},B=function(a,b,c,d){return b.toBlob().then(function(e){var f,g,h,i,j;return h=a.editorUpload.blobCache,j=r(a),f=j.src,a.settings.images_reuse_filename&&(i=h.getByUri(f),i?(f=i.uri(),g=i.name()):g=s(a,f)),i=h.create({id:t(),blob:e,base64:b.toBase64(),uri:f,name:g}),h.add(i),a.undoManager.transact(function(){function b(){a.$(j).off("load",b),a.nodeChanged(),c?a.editorUpload.uploadImagesAuto():(A(d),z(a,d))}a.$(j).on("load",b),a.$(j).attr({src:i.blobUri()}).removeAttr("data-mce-src")}),i})},C=function(a,b,e){return function(){return a._scanForImages().then(d.curry(y,a)).then(c.blobToImageResult).then(e).then(function(c){return B(a,c,!1,b)},function(b){q(a,b)})}},D=function(a,c,d){return function(){return C(a,c,function(c){var e=l.getImageSize(r(a));return e&&l.setImageSize(r(a),{w:e.h,h:e.w}),b.rotate(c,d)})()}},E=function(a,c,d){return function(){return C(a,c,function(a){return b.flip(a,d)})()}},F=function(b,f){return function(){var g=r(b),i=l.getNaturalImageSize(g),j=function(b){return new h(function(c){a.blobToImage(b).then(function(a){var d=l.getNaturalImageSize(a);i.w===d.w&&i.h===d.h||l.getImageSize(g)&&l.setImageSize(g,d),e.revokeObjectURL(a.src),c(b)})})},k=function(a,b){return n.edit(a,b).then(j).then(c.blobToImageResult).then(function(b){return B(a,b,!0,f)},function(){})};y(b).then(c.blobToImageResult).then(d.curry(k,b),function(a){q(b,a)})}};return{rotate:D,flip:E,editImageDialog:F,isEditableImage:p,cancelTimedUpload:A}}),g("3",["8","9"],function(a,b){var c=function(c,d){a.each({mceImageRotateLeft:b.rotate(c,d,-90),mceImageRotateRight:b.rotate(c,d,90),mceImageFlipVertical:b.flip(c,d,"v"),mceImageFlipHorizontal:b.flip(c,d,"h"),mceEditImage:b.editImageDialog(c,d)},function(a,b){c.addCommand(b,a)})};return{register:c}}),g("4",["9"],function(a){var b=function(b,c,d){b.on("NodeChange",function(e){var f=d.get();f&&f.src!==e.element.src&&(a.cancelTimedUpload(c),b.editorUpload.uploadImagesAuto(),d.set(null)),a.isEditableImage(b,e.element)&&d.set(e.element)})};return{setup:b}}),g("5",[],function(){var a=function(a){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"})};return{register:a}}),g("6",["a","b","9"],function(a,b,c){var d=function(d){d.addContextToolbar(a.curry(c.isEditableImage,d),b.getToolbarItems(d))};return{register:d}}),g("0",["1","2","3","4","5","6"],function(a,b,c,d,e,f){return b.add("imagetools",function(b){var g=a(0),h=a(null);c.register(b,g),e.register(b),f.register(b),d.setup(b,g,h)}),function(){}}),d("0")()}();
|
@@ -0,0 +1,577 @@
|
|
1
|
+
(function () {
|
2
|
+
|
3
|
+
var defs = {}; // id -> {dependencies, definition, instance (possibly undefined)}
|
4
|
+
|
5
|
+
// Used when there is no 'main' module.
|
6
|
+
// The name is probably (hopefully) unique so minification removes for releases.
|
7
|
+
var register_3795 = function (id) {
|
8
|
+
var module = dem(id);
|
9
|
+
var fragments = id.split('.');
|
10
|
+
var target = Function('return this;')();
|
11
|
+
for (var i = 0; i < fragments.length - 1; ++i) {
|
12
|
+
if (target[fragments[i]] === undefined)
|
13
|
+
target[fragments[i]] = {};
|
14
|
+
target = target[fragments[i]];
|
15
|
+
}
|
16
|
+
target[fragments[fragments.length - 1]] = module;
|
17
|
+
};
|
18
|
+
|
19
|
+
var instantiate = function (id) {
|
20
|
+
var actual = defs[id];
|
21
|
+
var dependencies = actual.deps;
|
22
|
+
var definition = actual.defn;
|
23
|
+
var len = dependencies.length;
|
24
|
+
var instances = new Array(len);
|
25
|
+
for (var i = 0; i < len; ++i)
|
26
|
+
instances[i] = dem(dependencies[i]);
|
27
|
+
var defResult = definition.apply(null, instances);
|
28
|
+
if (defResult === undefined)
|
29
|
+
throw 'module [' + id + '] returned undefined';
|
30
|
+
actual.instance = defResult;
|
31
|
+
};
|
32
|
+
|
33
|
+
var def = function (id, dependencies, definition) {
|
34
|
+
if (typeof id !== 'string')
|
35
|
+
throw 'module id must be a string';
|
36
|
+
else if (dependencies === undefined)
|
37
|
+
throw 'no dependencies for ' + id;
|
38
|
+
else if (definition === undefined)
|
39
|
+
throw 'no definition function for ' + id;
|
40
|
+
defs[id] = {
|
41
|
+
deps: dependencies,
|
42
|
+
defn: definition,
|
43
|
+
instance: undefined
|
44
|
+
};
|
45
|
+
};
|
46
|
+
|
47
|
+
var dem = function (id) {
|
48
|
+
var actual = defs[id];
|
49
|
+
if (actual === undefined)
|
50
|
+
throw 'module [' + id + '] was undefined';
|
51
|
+
else if (actual.instance === undefined)
|
52
|
+
instantiate(id);
|
53
|
+
return actual.instance;
|
54
|
+
};
|
55
|
+
|
56
|
+
var req = function (ids, callback) {
|
57
|
+
var len = ids.length;
|
58
|
+
var instances = new Array(len);
|
59
|
+
for (var i = 0; i < len; ++i)
|
60
|
+
instances[i] = dem(ids[i]);
|
61
|
+
callback.apply(null, instances);
|
62
|
+
};
|
63
|
+
|
64
|
+
var ephox = {};
|
65
|
+
|
66
|
+
ephox.bolt = {
|
67
|
+
module: {
|
68
|
+
api: {
|
69
|
+
define: def,
|
70
|
+
require: req,
|
71
|
+
demand: dem
|
72
|
+
}
|
73
|
+
}
|
74
|
+
};
|
75
|
+
|
76
|
+
var define = def;
|
77
|
+
var require = req;
|
78
|
+
var demand = dem;
|
79
|
+
// this helps with minification when using a lot of global references
|
80
|
+
var defineGlobal = function (id, ref) {
|
81
|
+
define(id, [], function () { return ref; });
|
82
|
+
};
|
83
|
+
/*jsc
|
84
|
+
["tinymce.plugins.importcss.Plugin","tinymce.core.PluginManager","tinymce.plugins.importcss.api.Api","tinymce.plugins.importcss.core.ImportCss","global!tinymce.util.Tools.resolve","tinymce.core.dom.DOMUtils","tinymce.core.EditorManager","tinymce.core.Env","tinymce.core.util.Tools","tinymce.plugins.importcss.api.Settings"]
|
85
|
+
jsc*/
|
86
|
+
defineGlobal("global!tinymce.util.Tools.resolve", tinymce.util.Tools.resolve);
|
87
|
+
/**
|
88
|
+
* ResolveGlobal.js
|
89
|
+
*
|
90
|
+
* Released under LGPL License.
|
91
|
+
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
92
|
+
*
|
93
|
+
* License: http://www.tinymce.com/license
|
94
|
+
* Contributing: http://www.tinymce.com/contributing
|
95
|
+
*/
|
96
|
+
|
97
|
+
define(
|
98
|
+
'tinymce.core.PluginManager',
|
99
|
+
[
|
100
|
+
'global!tinymce.util.Tools.resolve'
|
101
|
+
],
|
102
|
+
function (resolve) {
|
103
|
+
return resolve('tinymce.PluginManager');
|
104
|
+
}
|
105
|
+
);
|
106
|
+
|
107
|
+
/**
|
108
|
+
* ResolveGlobal.js
|
109
|
+
*
|
110
|
+
* Released under LGPL License.
|
111
|
+
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
112
|
+
*
|
113
|
+
* License: http://www.tinymce.com/license
|
114
|
+
* Contributing: http://www.tinymce.com/contributing
|
115
|
+
*/
|
116
|
+
|
117
|
+
define(
|
118
|
+
'tinymce.core.dom.DOMUtils',
|
119
|
+
[
|
120
|
+
'global!tinymce.util.Tools.resolve'
|
121
|
+
],
|
122
|
+
function (resolve) {
|
123
|
+
return resolve('tinymce.dom.DOMUtils');
|
124
|
+
}
|
125
|
+
);
|
126
|
+
|
127
|
+
/**
|
128
|
+
* ResolveGlobal.js
|
129
|
+
*
|
130
|
+
* Released under LGPL License.
|
131
|
+
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
132
|
+
*
|
133
|
+
* License: http://www.tinymce.com/license
|
134
|
+
* Contributing: http://www.tinymce.com/contributing
|
135
|
+
*/
|
136
|
+
|
137
|
+
define(
|
138
|
+
'tinymce.core.EditorManager',
|
139
|
+
[
|
140
|
+
'global!tinymce.util.Tools.resolve'
|
141
|
+
],
|
142
|
+
function (resolve) {
|
143
|
+
return resolve('tinymce.EditorManager');
|
144
|
+
}
|
145
|
+
);
|
146
|
+
|
147
|
+
/**
|
148
|
+
* ResolveGlobal.js
|
149
|
+
*
|
150
|
+
* Released under LGPL License.
|
151
|
+
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
152
|
+
*
|
153
|
+
* License: http://www.tinymce.com/license
|
154
|
+
* Contributing: http://www.tinymce.com/contributing
|
155
|
+
*/
|
156
|
+
|
157
|
+
define(
|
158
|
+
'tinymce.core.Env',
|
159
|
+
[
|
160
|
+
'global!tinymce.util.Tools.resolve'
|
161
|
+
],
|
162
|
+
function (resolve) {
|
163
|
+
return resolve('tinymce.Env');
|
164
|
+
}
|
165
|
+
);
|
166
|
+
|
167
|
+
/**
|
168
|
+
* ResolveGlobal.js
|
169
|
+
*
|
170
|
+
* Released under LGPL License.
|
171
|
+
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
172
|
+
*
|
173
|
+
* License: http://www.tinymce.com/license
|
174
|
+
* Contributing: http://www.tinymce.com/contributing
|
175
|
+
*/
|
176
|
+
|
177
|
+
define(
|
178
|
+
'tinymce.core.util.Tools',
|
179
|
+
[
|
180
|
+
'global!tinymce.util.Tools.resolve'
|
181
|
+
],
|
182
|
+
function (resolve) {
|
183
|
+
return resolve('tinymce.util.Tools');
|
184
|
+
}
|
185
|
+
);
|
186
|
+
|
187
|
+
/**
|
188
|
+
* Settings.js
|
189
|
+
*
|
190
|
+
* Released under LGPL License.
|
191
|
+
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
192
|
+
*
|
193
|
+
* License: http://www.tinymce.com/license
|
194
|
+
* Contributing: http://www.tinymce.com/contributing
|
195
|
+
*/
|
196
|
+
|
197
|
+
define(
|
198
|
+
'tinymce.plugins.importcss.api.Settings',
|
199
|
+
[
|
200
|
+
],
|
201
|
+
function () {
|
202
|
+
var shouldMergeClasses = function (editor) {
|
203
|
+
return editor.getParam('importcss_merge_classes');
|
204
|
+
};
|
205
|
+
|
206
|
+
var shouldImportExclusive = function (editor) {
|
207
|
+
return editor.getParam('importcss_exclusive');
|
208
|
+
};
|
209
|
+
|
210
|
+
var getSelectorConverter = function (editor) {
|
211
|
+
return editor.getParam('importcss_selector_converter');
|
212
|
+
};
|
213
|
+
|
214
|
+
var getSelectorFilter = function (editor) {
|
215
|
+
return editor.getParam('importcss_selector_filter');
|
216
|
+
};
|
217
|
+
|
218
|
+
var getCssGroups = function (editor) {
|
219
|
+
return editor.getParam('importcss_groups');
|
220
|
+
};
|
221
|
+
|
222
|
+
var shouldAppend = function (editor) {
|
223
|
+
return editor.getParam('importcss_append');
|
224
|
+
};
|
225
|
+
|
226
|
+
var getFileFilter = function (editor) {
|
227
|
+
return editor.getParam('importcss_file_filter');
|
228
|
+
};
|
229
|
+
|
230
|
+
return {
|
231
|
+
shouldMergeClasses: shouldMergeClasses,
|
232
|
+
shouldImportExclusive: shouldImportExclusive,
|
233
|
+
getSelectorConverter: getSelectorConverter,
|
234
|
+
getSelectorFilter: getSelectorFilter,
|
235
|
+
getCssGroups: getCssGroups,
|
236
|
+
shouldAppend: shouldAppend,
|
237
|
+
getFileFilter: getFileFilter
|
238
|
+
};
|
239
|
+
}
|
240
|
+
);
|
241
|
+
/**
|
242
|
+
* ImportCss.js
|
243
|
+
*
|
244
|
+
* Released under LGPL License.
|
245
|
+
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
246
|
+
*
|
247
|
+
* License: http://www.tinymce.com/license
|
248
|
+
* Contributing: http://www.tinymce.com/contributing
|
249
|
+
*/
|
250
|
+
|
251
|
+
define(
|
252
|
+
'tinymce.plugins.importcss.core.ImportCss',
|
253
|
+
[
|
254
|
+
'tinymce.core.dom.DOMUtils',
|
255
|
+
'tinymce.core.EditorManager',
|
256
|
+
'tinymce.core.Env',
|
257
|
+
'tinymce.core.util.Tools',
|
258
|
+
'tinymce.plugins.importcss.api.Settings'
|
259
|
+
],
|
260
|
+
function (DOMUtils, EditorManager, Env, Tools, Settings) {
|
261
|
+
var removeCacheSuffix = function (url) {
|
262
|
+
var cacheSuffix = Env.cacheSuffix;
|
263
|
+
|
264
|
+
if (typeof url === 'string') {
|
265
|
+
url = url.replace('?' + cacheSuffix, '').replace('&' + cacheSuffix, '');
|
266
|
+
}
|
267
|
+
|
268
|
+
return url;
|
269
|
+
};
|
270
|
+
|
271
|
+
var isSkinContentCss = function (editor, href) {
|
272
|
+
var settings = editor.settings, skin = settings.skin !== false ? settings.skin || 'lightgray' : false;
|
273
|
+
|
274
|
+
if (skin) {
|
275
|
+
var skinUrl = settings.skin_url ? editor.documentBaseURI.toAbsolute(settings.skin_url) : EditorManager.baseURL + '/skins/' + skin;
|
276
|
+
return href === skinUrl + '/content' + (editor.inline ? '.inline' : '') + '.min.css';
|
277
|
+
}
|
278
|
+
|
279
|
+
return false;
|
280
|
+
};
|
281
|
+
|
282
|
+
var compileFilter = function (filter) {
|
283
|
+
if (typeof filter === "string") {
|
284
|
+
return function (value) {
|
285
|
+
return value.indexOf(filter) !== -1;
|
286
|
+
};
|
287
|
+
} else if (filter instanceof RegExp) {
|
288
|
+
return function (value) {
|
289
|
+
return filter.test(value);
|
290
|
+
};
|
291
|
+
}
|
292
|
+
|
293
|
+
return filter;
|
294
|
+
};
|
295
|
+
|
296
|
+
var getSelectors = function (editor, doc, fileFilter) {
|
297
|
+
var selectors = [], contentCSSUrls = {};
|
298
|
+
|
299
|
+
function append(styleSheet, imported) {
|
300
|
+
var href = styleSheet.href, rules;
|
301
|
+
|
302
|
+
href = removeCacheSuffix(href);
|
303
|
+
|
304
|
+
if (!href || !fileFilter(href, imported) || isSkinContentCss(editor, href)) {
|
305
|
+
return;
|
306
|
+
}
|
307
|
+
|
308
|
+
Tools.each(styleSheet.imports, function (styleSheet) {
|
309
|
+
append(styleSheet, true);
|
310
|
+
});
|
311
|
+
|
312
|
+
try {
|
313
|
+
rules = styleSheet.cssRules || styleSheet.rules;
|
314
|
+
} catch (e) {
|
315
|
+
// Firefox fails on rules to remote domain for example:
|
316
|
+
// @import url(//fonts.googleapis.com/css?family=Pathway+Gothic+One);
|
317
|
+
}
|
318
|
+
|
319
|
+
Tools.each(rules, function (cssRule) {
|
320
|
+
if (cssRule.styleSheet) {
|
321
|
+
append(cssRule.styleSheet, true);
|
322
|
+
} else if (cssRule.selectorText) {
|
323
|
+
Tools.each(cssRule.selectorText.split(','), function (selector) {
|
324
|
+
selectors.push(Tools.trim(selector));
|
325
|
+
});
|
326
|
+
}
|
327
|
+
});
|
328
|
+
}
|
329
|
+
|
330
|
+
Tools.each(editor.contentCSS, function (url) {
|
331
|
+
contentCSSUrls[url] = true;
|
332
|
+
});
|
333
|
+
|
334
|
+
if (!fileFilter) {
|
335
|
+
fileFilter = function (href, imported) {
|
336
|
+
return imported || contentCSSUrls[href];
|
337
|
+
};
|
338
|
+
}
|
339
|
+
|
340
|
+
try {
|
341
|
+
Tools.each(doc.styleSheets, function (styleSheet) {
|
342
|
+
append(styleSheet);
|
343
|
+
});
|
344
|
+
} catch (e) {
|
345
|
+
// Ignore
|
346
|
+
}
|
347
|
+
|
348
|
+
return selectors;
|
349
|
+
};
|
350
|
+
|
351
|
+
var defaultConvertSelectorToFormat = function (editor, selectorText) {
|
352
|
+
var format;
|
353
|
+
|
354
|
+
// Parse simple element.class1, .class1
|
355
|
+
var selector = /^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(selectorText);
|
356
|
+
if (!selector) {
|
357
|
+
return;
|
358
|
+
}
|
359
|
+
|
360
|
+
var elementName = selector[1];
|
361
|
+
var classes = selector[2].substr(1).split('.').join(' ');
|
362
|
+
var inlineSelectorElements = Tools.makeMap('a,img');
|
363
|
+
|
364
|
+
// element.class - Produce block formats
|
365
|
+
if (selector[1]) {
|
366
|
+
format = {
|
367
|
+
title: selectorText
|
368
|
+
};
|
369
|
+
|
370
|
+
if (editor.schema.getTextBlockElements()[elementName]) {
|
371
|
+
// Text block format ex: h1.class1
|
372
|
+
format.block = elementName;
|
373
|
+
} else if (editor.schema.getBlockElements()[elementName] || inlineSelectorElements[elementName.toLowerCase()]) {
|
374
|
+
// Block elements such as table.class and special inline elements such as a.class or img.class
|
375
|
+
format.selector = elementName;
|
376
|
+
} else {
|
377
|
+
// Inline format strong.class1
|
378
|
+
format.inline = elementName;
|
379
|
+
}
|
380
|
+
} else if (selector[2]) {
|
381
|
+
// .class - Produce inline span with classes
|
382
|
+
format = {
|
383
|
+
inline: 'span',
|
384
|
+
title: selectorText.substr(1),
|
385
|
+
classes: classes
|
386
|
+
};
|
387
|
+
}
|
388
|
+
|
389
|
+
// Append to or override class attribute
|
390
|
+
if (Settings.shouldMergeClasses(editor) !== false) {
|
391
|
+
format.classes = classes;
|
392
|
+
} else {
|
393
|
+
format.attributes = { "class": classes };
|
394
|
+
}
|
395
|
+
|
396
|
+
return format;
|
397
|
+
};
|
398
|
+
|
399
|
+
var getGroupsBySelector = function (groups, selector) {
|
400
|
+
return Tools.grep(groups, function (group) {
|
401
|
+
return !group.filter || group.filter(selector);
|
402
|
+
});
|
403
|
+
};
|
404
|
+
|
405
|
+
var compileUserDefinedGroups = function (groups) {
|
406
|
+
return Tools.map(groups, function (group) {
|
407
|
+
return Tools.extend({}, group, {
|
408
|
+
original: group,
|
409
|
+
selectors: {},
|
410
|
+
filter: compileFilter(group.filter),
|
411
|
+
item: {
|
412
|
+
text: group.title,
|
413
|
+
menu: []
|
414
|
+
}
|
415
|
+
});
|
416
|
+
});
|
417
|
+
};
|
418
|
+
|
419
|
+
var isExclusiveMode = function (editor, group) {
|
420
|
+
// Exclusive mode can only be disabled when there are groups allowing the same style to be present in multiple groups
|
421
|
+
return group === null || Settings.shouldImportExclusive(editor) !== false;
|
422
|
+
};
|
423
|
+
|
424
|
+
var isUniqueSelector = function (editor, selector, group, globallyUniqueSelectors) {
|
425
|
+
return !(isExclusiveMode(editor, group) ? selector in globallyUniqueSelectors : selector in group.selectors);
|
426
|
+
};
|
427
|
+
|
428
|
+
var markUniqueSelector = function (editor, selector, group, globallyUniqueSelectors) {
|
429
|
+
if (isExclusiveMode(editor, group)) {
|
430
|
+
globallyUniqueSelectors[selector] = true;
|
431
|
+
} else {
|
432
|
+
group.selectors[selector] = true;
|
433
|
+
}
|
434
|
+
};
|
435
|
+
|
436
|
+
var convertSelectorToFormat = function (editor, plugin, selector, group) {
|
437
|
+
var selectorConverter;
|
438
|
+
|
439
|
+
if (group && group.selector_converter) {
|
440
|
+
selectorConverter = group.selector_converter;
|
441
|
+
} else if (Settings.getSelectorConverter(editor)) {
|
442
|
+
selectorConverter = Settings.getSelectorConverter(editor);
|
443
|
+
} else {
|
444
|
+
selectorConverter = function () {
|
445
|
+
return defaultConvertSelectorToFormat(editor, selector, group);
|
446
|
+
};
|
447
|
+
}
|
448
|
+
|
449
|
+
return selectorConverter.call(plugin, selector, group);
|
450
|
+
};
|
451
|
+
|
452
|
+
var setup = function (editor) {
|
453
|
+
editor.on('renderFormatsMenu', function (e) {
|
454
|
+
var globallyUniqueSelectors = {};
|
455
|
+
var selectorFilter = compileFilter(Settings.getSelectorFilter(editor)), ctrl = e.control;
|
456
|
+
var groups = compileUserDefinedGroups(Settings.getCssGroups(editor));
|
457
|
+
|
458
|
+
var processSelector = function (selector, group) {
|
459
|
+
if (isUniqueSelector(editor, selector, group, globallyUniqueSelectors)) {
|
460
|
+
markUniqueSelector(editor, selector, group, globallyUniqueSelectors);
|
461
|
+
|
462
|
+
var format = convertSelectorToFormat(editor, editor.plugins.importcss, selector, group);
|
463
|
+
if (format) {
|
464
|
+
var formatName = format.name || DOMUtils.DOM.uniqueId();
|
465
|
+
editor.formatter.register(formatName, format);
|
466
|
+
|
467
|
+
return Tools.extend({}, ctrl.settings.itemDefaults, {
|
468
|
+
text: format.title,
|
469
|
+
format: formatName
|
470
|
+
});
|
471
|
+
}
|
472
|
+
}
|
473
|
+
|
474
|
+
return null;
|
475
|
+
};
|
476
|
+
|
477
|
+
if (!Settings.shouldAppend(editor)) {
|
478
|
+
ctrl.items().remove();
|
479
|
+
}
|
480
|
+
|
481
|
+
Tools.each(getSelectors(editor, e.doc || editor.getDoc(), compileFilter(Settings.getFileFilter(editor))), function (selector) {
|
482
|
+
if (selector.indexOf('.mce-') === -1) {
|
483
|
+
if (!selectorFilter || selectorFilter(selector)) {
|
484
|
+
var selectorGroups = getGroupsBySelector(groups, selector);
|
485
|
+
|
486
|
+
if (selectorGroups.length > 0) {
|
487
|
+
Tools.each(selectorGroups, function (group) {
|
488
|
+
var menuItem = processSelector(selector, group);
|
489
|
+
if (menuItem) {
|
490
|
+
group.item.menu.push(menuItem);
|
491
|
+
}
|
492
|
+
});
|
493
|
+
} else {
|
494
|
+
var menuItem = processSelector(selector, null);
|
495
|
+
if (menuItem) {
|
496
|
+
ctrl.add(menuItem);
|
497
|
+
}
|
498
|
+
}
|
499
|
+
}
|
500
|
+
}
|
501
|
+
});
|
502
|
+
|
503
|
+
Tools.each(groups, function (group) {
|
504
|
+
if (group.item.menu.length > 0) {
|
505
|
+
ctrl.add(group.item);
|
506
|
+
}
|
507
|
+
});
|
508
|
+
|
509
|
+
e.control.renderNew();
|
510
|
+
});
|
511
|
+
};
|
512
|
+
|
513
|
+
return {
|
514
|
+
defaultConvertSelectorToFormat: defaultConvertSelectorToFormat,
|
515
|
+
setup: setup
|
516
|
+
};
|
517
|
+
}
|
518
|
+
);
|
519
|
+
/**
|
520
|
+
* Api.js
|
521
|
+
*
|
522
|
+
* Released under LGPL License.
|
523
|
+
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
524
|
+
*
|
525
|
+
* License: http://www.tinymce.com/license
|
526
|
+
* Contributing: http://www.tinymce.com/contributing
|
527
|
+
*/
|
528
|
+
|
529
|
+
define(
|
530
|
+
'tinymce.plugins.importcss.api.Api',
|
531
|
+
[
|
532
|
+
'tinymce.plugins.importcss.core.ImportCss'
|
533
|
+
],
|
534
|
+
function (ImportCss) {
|
535
|
+
var get = function (editor) {
|
536
|
+
var convertSelectorToFormat = function (selectorText) {
|
537
|
+
return ImportCss.defaultConvertSelectorToFormat(editor, selectorText);
|
538
|
+
};
|
539
|
+
|
540
|
+
return {
|
541
|
+
convertSelectorToFormat: convertSelectorToFormat
|
542
|
+
};
|
543
|
+
};
|
544
|
+
|
545
|
+
return {
|
546
|
+
get: get
|
547
|
+
};
|
548
|
+
}
|
549
|
+
);
|
550
|
+
/**
|
551
|
+
* Plugin.js
|
552
|
+
*
|
553
|
+
* Released under LGPL License.
|
554
|
+
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
555
|
+
*
|
556
|
+
* License: http://www.tinymce.com/license
|
557
|
+
* Contributing: http://www.tinymce.com/contributing
|
558
|
+
*/
|
559
|
+
|
560
|
+
define(
|
561
|
+
'tinymce.plugins.importcss.Plugin',
|
562
|
+
[
|
563
|
+
'tinymce.core.PluginManager',
|
564
|
+
'tinymce.plugins.importcss.api.Api',
|
565
|
+
'tinymce.plugins.importcss.core.ImportCss'
|
566
|
+
],
|
567
|
+
function (PluginManager, Api, ImportCss) {
|
568
|
+
PluginManager.add('importcss', function (editor) {
|
569
|
+
ImportCss.setup(editor);
|
570
|
+
return Api.get(editor);
|
571
|
+
});
|
572
|
+
|
573
|
+
return function () { };
|
574
|
+
}
|
575
|
+
);
|
576
|
+
dem('tinymce.plugins.importcss.Plugin')();
|
577
|
+
})();
|