diff --git a/client/dist/js/TinyMCE_sslink-file.js b/client/dist/js/TinyMCE_sslink-file.js index 23d80710a..21ca617a2 100644 --- a/client/dist/js/TinyMCE_sslink-file.js +++ b/client/dist/js/TinyMCE_sslink-file.js @@ -1 +1 @@ -!function(e){function o(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,o),s.l=!0,s.exports}var t={};o.m=e,o.c=t,o.i=function(e){return e},o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},o.p="",o(o.s="./client/src/entwine/TinyMCE_sslink-file.js")}({"./client/src/entwine/TinyMCE_sslink-file.js":function(e,o,t){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(o,"__esModule",{value:!0});var s=t(2),r=n(s),a=t(30),d=n(a),l=t(0),i=n(l),u=t(6),_=n(u),c=t(7),h=n(c),f=t(10),p=n(f),m=t(12),j=n(m),v=t(3),y=n(v),g=t("./client/src/state/modal/ModalActions.js"),b=function(e){if(e&&e.__esModule)return e;var o={};if(null!=e)for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(o[t]=e[t]);return o.default=e,o}(g);d.default.addAction("sslink",{text:r.default._t("AssetAdmin.LINKLABEL_FILE","Link to a file"),onclick:function(e){return e.execCommand("sslinkfile")},priority:80},editorIdentifier).addCommandWithUrlTest("sslinkfile",/^\[file_link/);var S={init:function(e){e.addCommand("sslinkfile",function(){(0,h.default)("#"+e.id).entwine("ss").openLinkFileDialog()})}},x="insert-link__dialog-wrapper--file",C=(0,v.loadComponent)(j.default);h.default.entwine("ss",function(e){e(".insert-link__dialog-wrapper--internal .nav-link, .insert-media-react__dialog-wrapper .breadcrumb__container a").entwine({onclick:function(e){return e.preventDefault()}}),e("textarea.htmleditor").entwine({openLinkFileDialog:function(){var o=e("#"+x);o.length||(o=e('
'),e("body").append(o)),o.addClass("insert-link__dialog-wrapper"),o.setElement(this),o.open()}}),e(".js-injector-boot #"+x).entwine({renderModal:function(e){var o=this,t=y.default.reducer.store.dispatch;t(b.initFormStack("insert-link","admin"));var n=function(){t(b.reset()),o.close()},s=function(){return o.handleInsert.apply(o,arguments)},r=this.getOriginalAttributes(),a=tinymce.activeEditor.selection,d=a.getContent()||"",l=a.getNode().tagName,u="A"!==l&&""===d.trim();_.default.render(i.default.createElement(C,{isOpen:e,type:"insert-link",onInsert:s,onClosed:n,title:!1,bodyClassName:"modal__dialog",className:"insert-link__dialog-wrapper--internal",fileAttributes:r,requireLinkText:u}),this[0])},buildAttributes:function(e){return{href:p.default.serialise({name:"file_link",properties:{id:e.ID}},!0)+(e.Anchor&&e.Anchor.length?"#"+e.Anchor:""),target:e.TargetBlank?"_blank":"",title:e.Description}},getOriginalAttributes:function(){var o=this.getElement().getEditor(),t=e(o.getSelectedNode()),n=(t.attr("href")||"").split("#");if(!n[0])return{};var s=p.default.match("file_link",!1,n[0]);return s?{ID:s.properties.id?parseInt(s.properties.id,10):0,Anchor:n[1]||"",Description:t.attr("title"),TargetBlank:!!t.attr("target")}:{}}})}),tinymce.PluginManager.add("sslinkfile",function(e){return S.init(e)}),o.default=S},"./client/src/state/modal/ModalActionTypes.js":function(e,o,t){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.default={DEFINE_IMAGE_SIZE_PRESETS:"DEFINE_IMAGE_SIZE_PRESETS",INIT_FORM_SCHEMA_STACK:"INIT_FORM_SCHEMA_STACK",POP_FORM_SCHEMA:"POP_FORM_SCHEMA",PUSH_FORM_SCHEMA:"PUSH_FORM_SCHEMA",RESET:"RESET",RESET_FORM_STACK:"RESET_FORM_STACK"}},"./client/src/state/modal/ModalActions.js":function(e,o,t){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function s(e){return{type:c.default.DEFINE_IMAGE_SIZE_PRESETS,payload:{imageSizePresets:e}}}function r(e,o){return function(t,n){var s=n(),r=(0,f.default)(s.form.formState,e+".values"),a=(0,f.default)(s.form.formSchemas,o+".schema.fields");if(r){var d=Object.keys(r).filter(function(e){return null!==r[e]&&(0,j.default)(e,a)}).map(function(e){return{name:e,value:r[e]}});t((0,p.setSchemaStateOverrides)(o,{fields:d}))}}}function a(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return{type:c.default.PUSH_FORM_SCHEMA,payload:{formSchema:{type:e,nextType:o}}}}function d(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return{type:c.default.INIT_FORM_SCHEMA_STACK,payload:{formSchema:{type:e,nextType:o}}}}function l(){return{type:c.default.POP_FORM_SCHEMA}}function i(){return{type:c.default.RESET}}function u(){return{type:c.default.RESET_FORM_STACK}}Object.defineProperty(o,"__esModule",{value:!0}),o.defineImageSizePresets=s,o.stashFormValues=r,o.pushFormStackEntry=a,o.initFormStack=d,o.popFormStackEntry=l,o.reset=i,o.resetFormStack=u;var _=t("./client/src/state/modal/ModalActionTypes.js"),c=n(_),h=t("./node_modules/redux-form/lib/structure/plain/getIn.js"),f=n(h),p=t(8),m=t("./client/src/state/modal/helpers.js"),j=n(m)},"./client/src/state/modal/helpers.js":function(e,o,t){"use strict";function n(e,o){var t=void 0;for(t=0;t-1}var s=t("./node_modules/lodash/_assocIndexOf.js");e.exports=n},"./node_modules/lodash/_listCacheSet.js":function(e,o,t){function n(e,o){var t=this.__data__,n=s(t,e);return n<0?(++this.size,t.push([e,o])):t[n][1]=o,this}var s=t("./node_modules/lodash/_assocIndexOf.js");e.exports=n},"./node_modules/lodash/_mapCacheClear.js":function(e,o,t){function n(){this.size=0,this.__data__={hash:new s,map:new(a||r),string:new s}}var s=t("./node_modules/lodash/_Hash.js"),r=t("./node_modules/lodash/_ListCache.js"),a=t("./node_modules/lodash/_Map.js");e.exports=n},"./node_modules/lodash/_mapCacheDelete.js":function(e,o,t){function n(e){var o=s(this,e).delete(e);return this.size-=o?1:0,o}var s=t("./node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/lodash/_mapCacheGet.js":function(e,o,t){function n(e){return s(this,e).get(e)}var s=t("./node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/lodash/_mapCacheHas.js":function(e,o,t){function n(e){return s(this,e).has(e)}var s=t("./node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/lodash/_mapCacheSet.js":function(e,o,t){function n(e,o){var t=s(this,e),n=t.size;return t.set(e,o),this.size+=t.size==n?0:1,this}var s=t("./node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/lodash/_memoizeCapped.js":function(e,o,t){function n(e){var o=s(e,function(e){return t.size===r&&t.clear(),e}),t=o.cache;return o}var s=t("./node_modules/lodash/memoize.js"),r=500;e.exports=n},"./node_modules/lodash/_nativeCreate.js":function(e,o,t){var n=t("./node_modules/lodash/_getNative.js"),s=n(Object,"create");e.exports=s},"./node_modules/lodash/_objectToString.js":function(e,o){function t(e){return s.call(e)}var n=Object.prototype,s=n.toString;e.exports=t},"./node_modules/lodash/_root.js":function(e,o,t){var n=t("./node_modules/lodash/_freeGlobal.js"),s="object"==typeof self&&self&&self.Object===Object&&self,r=n||s||Function("return this")();e.exports=r},"./node_modules/lodash/_stringToPath.js":function(e,o,t){var n=t("./node_modules/lodash/_memoizeCapped.js"),s=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,a=n(function(e){var o=[];return 46===e.charCodeAt(0)&&o.push(""),e.replace(s,function(e,t,n,s){o.push(n?s.replace(r,"$1"):t||e)}),o});e.exports=a},"./node_modules/lodash/_toKey.js":function(e,o,t){function n(e){if("string"==typeof e||s(e))return e;var o=e+"";return"0"==o&&1/e==-r?"-0":o}var s=t("./node_modules/lodash/isSymbol.js"),r=1/0;e.exports=n},"./node_modules/lodash/_toSource.js":function(e,o){function t(e){if(null!=e){try{return s.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var n=Function.prototype,s=n.toString;e.exports=t},"./node_modules/lodash/eq.js":function(e,o){function t(e,o){return e===o||e!==e&&o!==o}e.exports=t},"./node_modules/lodash/isArray.js":function(e,o){var t=Array.isArray;e.exports=t},"./node_modules/lodash/isFunction.js":function(e,o,t){function n(e){if(!r(e))return!1;var o=s(e);return o==d||o==l||o==a||o==i}var s=t("./node_modules/lodash/_baseGetTag.js"),r=t("./node_modules/lodash/isObject.js"),a="[object AsyncFunction]",d="[object Function]",l="[object GeneratorFunction]",i="[object Proxy]";e.exports=n},"./node_modules/lodash/isObject.js":function(e,o){function t(e){var o=typeof e;return null!=e&&("object"==o||"function"==o)}e.exports=t},"./node_modules/lodash/isObjectLike.js":function(e,o){function t(e){return null!=e&&"object"==typeof e}e.exports=t},"./node_modules/lodash/isSymbol.js":function(e,o,t){function n(e){return"symbol"==typeof e||r(e)&&s(e)==a}var s=t("./node_modules/lodash/_baseGetTag.js"),r=t("./node_modules/lodash/isObjectLike.js"),a="[object Symbol]";e.exports=n},"./node_modules/lodash/memoize.js":function(e,o,t){function n(e,o){if("function"!=typeof e||null!=o&&"function"!=typeof o)throw new TypeError(r);var t=function(){var n=arguments,s=o?o.apply(this,n):n[0],r=t.cache;if(r.has(s))return r.get(s);var a=e.apply(this,n);return t.cache=r.set(s,a)||r,a};return t.cache=new(n.Cache||s),t}var s=t("./node_modules/lodash/_MapCache.js"),r="Expected a function";n.Cache=s,e.exports=n},"./node_modules/lodash/toPath.js":function(e,o,t){function n(e){return a(e)?s(e,i):d(e)?[e]:r(l(u(e)))}var s=t("./node_modules/lodash/_arrayMap.js"),r=t("./node_modules/lodash/_copyArray.js"),a=t("./node_modules/lodash/isArray.js"),d=t("./node_modules/lodash/isSymbol.js"),l=t("./node_modules/lodash/_stringToPath.js"),i=t("./node_modules/lodash/_toKey.js"),u=t("./node_modules/lodash/toString.js");e.exports=n},"./node_modules/lodash/toString.js":function(e,o,t){function n(e){return null==e?"":s(e)}var s=t("./node_modules/lodash/_baseToString.js");e.exports=n},"./node_modules/redux-form/lib/structure/plain/getIn.js":function(e,o,t){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var n=t("./node_modules/lodash/toPath.js"),s=function(e){return e&&e.__esModule?e:{default:e}}(n),r=function(e,o){if(!e)return e;var t=(0,s.default)(o),n=t.length;if(n){for(var r=e,a=0;a'),e("body").append(o)),o.addClass("insert-link__dialog-wrapper"),o.setElement(this),o.open()}}),e(".js-injector-boot #"+x).entwine({renderModal:function(e){var o=this,t=y.default.reducer.store.dispatch;t(b.initFormStack("insert-link","admin"));var n=function(){t(b.reset()),o.close()},s=function(){return o.handleInsert.apply(o,arguments)},r=this.getOriginalAttributes(),a=tinymce.activeEditor.selection,d=a.getContent()||"",l=a.getNode().tagName,u="A"!==l&&""===d.trim();_.default.render(i.default.createElement(C,{isOpen:e,type:"insert-link",onInsert:s,onClosed:n,title:!1,bodyClassName:"modal__dialog",className:"insert-link__dialog-wrapper--internal",fileAttributes:r,requireLinkText:u}),this[0])},buildAttributes:function(e){return{href:p.default.serialise({name:"file_link",properties:{id:e.ID}},!0)+(e.Anchor&&e.Anchor.length?"#"+e.Anchor:""),target:e.TargetBlank?"_blank":"",title:e.Description}},getOriginalAttributes:function(){var o=this.getElement().getEditor(),t=e(o.getSelectedNode()),n=(t.attr("href")||"").split("#");if(!n[0])return{};var s=p.default.match("file_link",!1,n[0]);return s?{ID:s.properties.id?parseInt(s.properties.id,10):0,Anchor:n[1]||"",Description:t.attr("title"),TargetBlank:!!t.attr("target")}:{}}})}),tinymce.PluginManager.add("sslinkfile",function(e){return S.init(e)}),o.default=S},"./client/src/state/modal/ModalActionTypes.js":function(e,o,t){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.default={DEFINE_IMAGE_SIZE_PRESETS:"DEFINE_IMAGE_SIZE_PRESETS",INIT_FORM_SCHEMA_STACK:"INIT_FORM_SCHEMA_STACK",POP_FORM_SCHEMA:"POP_FORM_SCHEMA",PUSH_FORM_SCHEMA:"PUSH_FORM_SCHEMA",RESET:"RESET",RESET_FORM_STACK:"RESET_FORM_STACK"}},"./client/src/state/modal/ModalActions.js":function(e,o,t){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function s(e){return{type:c.default.DEFINE_IMAGE_SIZE_PRESETS,payload:{imageSizePresets:e}}}function r(e,o){return function(t,n){var s=n(),r=(0,f.default)(s.form.formState,e+".values"),a=(0,f.default)(s.form.formSchemas,o+".schema.fields");if(r){var d=Object.keys(r).filter(function(e){return null!==r[e]&&(0,j.default)(e,a)}).map(function(e){return{name:e,value:r[e]}});t((0,p.setSchemaStateOverrides)(o,{fields:d}))}}}function a(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return{type:c.default.PUSH_FORM_SCHEMA,payload:{formSchema:{type:e,nextType:o}}}}function d(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return{type:c.default.INIT_FORM_SCHEMA_STACK,payload:{formSchema:{type:e,nextType:o}}}}function l(){return{type:c.default.POP_FORM_SCHEMA}}function i(){return{type:c.default.RESET}}function u(){return{type:c.default.RESET_FORM_STACK}}Object.defineProperty(o,"__esModule",{value:!0}),o.defineImageSizePresets=s,o.stashFormValues=r,o.pushFormStackEntry=a,o.initFormStack=d,o.popFormStackEntry=l,o.reset=i,o.resetFormStack=u;var _=t("./client/src/state/modal/ModalActionTypes.js"),c=n(_),h=t("./node_modules/redux-form/lib/structure/plain/getIn.js"),f=n(h),p=t(8),m=t("./client/src/state/modal/helpers.js"),j=n(m)},"./client/src/state/modal/helpers.js":function(e,o,t){"use strict";function n(e,o){var t=void 0;for(t=0;t-1}var s=t("./node_modules/lodash/_assocIndexOf.js");e.exports=n},"./node_modules/lodash/_listCacheSet.js":function(e,o,t){function n(e,o){var t=this.__data__,n=s(t,e);return n<0?(++this.size,t.push([e,o])):t[n][1]=o,this}var s=t("./node_modules/lodash/_assocIndexOf.js");e.exports=n},"./node_modules/lodash/_mapCacheClear.js":function(e,o,t){function n(){this.size=0,this.__data__={hash:new s,map:new(a||r),string:new s}}var s=t("./node_modules/lodash/_Hash.js"),r=t("./node_modules/lodash/_ListCache.js"),a=t("./node_modules/lodash/_Map.js");e.exports=n},"./node_modules/lodash/_mapCacheDelete.js":function(e,o,t){function n(e){var o=s(this,e).delete(e);return this.size-=o?1:0,o}var s=t("./node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/lodash/_mapCacheGet.js":function(e,o,t){function n(e){return s(this,e).get(e)}var s=t("./node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/lodash/_mapCacheHas.js":function(e,o,t){function n(e){return s(this,e).has(e)}var s=t("./node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/lodash/_mapCacheSet.js":function(e,o,t){function n(e,o){var t=s(this,e),n=t.size;return t.set(e,o),this.size+=t.size==n?0:1,this}var s=t("./node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/lodash/_memoizeCapped.js":function(e,o,t){function n(e){var o=s(e,function(e){return t.size===r&&t.clear(),e}),t=o.cache;return o}var s=t("./node_modules/lodash/memoize.js"),r=500;e.exports=n},"./node_modules/lodash/_nativeCreate.js":function(e,o,t){var n=t("./node_modules/lodash/_getNative.js"),s=n(Object,"create");e.exports=s},"./node_modules/lodash/_objectToString.js":function(e,o){function t(e){return s.call(e)}var n=Object.prototype,s=n.toString;e.exports=t},"./node_modules/lodash/_root.js":function(e,o,t){var n=t("./node_modules/lodash/_freeGlobal.js"),s="object"==typeof self&&self&&self.Object===Object&&self,r=n||s||Function("return this")();e.exports=r},"./node_modules/lodash/_stringToPath.js":function(e,o,t){var n=t("./node_modules/lodash/_memoizeCapped.js"),s=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,a=n(function(e){var o=[];return 46===e.charCodeAt(0)&&o.push(""),e.replace(s,function(e,t,n,s){o.push(n?s.replace(r,"$1"):t||e)}),o});e.exports=a},"./node_modules/lodash/_toKey.js":function(e,o,t){function n(e){if("string"==typeof e||s(e))return e;var o=e+"";return"0"==o&&1/e==-r?"-0":o}var s=t("./node_modules/lodash/isSymbol.js"),r=1/0;e.exports=n},"./node_modules/lodash/_toSource.js":function(e,o){function t(e){if(null!=e){try{return s.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var n=Function.prototype,s=n.toString;e.exports=t},"./node_modules/lodash/eq.js":function(e,o){function t(e,o){return e===o||e!==e&&o!==o}e.exports=t},"./node_modules/lodash/isArray.js":function(e,o){var t=Array.isArray;e.exports=t},"./node_modules/lodash/isFunction.js":function(e,o,t){function n(e){if(!r(e))return!1;var o=s(e);return o==d||o==l||o==a||o==i}var s=t("./node_modules/lodash/_baseGetTag.js"),r=t("./node_modules/lodash/isObject.js"),a="[object AsyncFunction]",d="[object Function]",l="[object GeneratorFunction]",i="[object Proxy]";e.exports=n},"./node_modules/lodash/isObject.js":function(e,o){function t(e){var o=typeof e;return null!=e&&("object"==o||"function"==o)}e.exports=t},"./node_modules/lodash/isObjectLike.js":function(e,o){function t(e){return null!=e&&"object"==typeof e}e.exports=t},"./node_modules/lodash/isSymbol.js":function(e,o,t){function n(e){return"symbol"==typeof e||r(e)&&s(e)==a}var s=t("./node_modules/lodash/_baseGetTag.js"),r=t("./node_modules/lodash/isObjectLike.js"),a="[object Symbol]";e.exports=n},"./node_modules/lodash/memoize.js":function(e,o,t){function n(e,o){if("function"!=typeof e||null!=o&&"function"!=typeof o)throw new TypeError(r);var t=function(){var n=arguments,s=o?o.apply(this,n):n[0],r=t.cache;if(r.has(s))return r.get(s);var a=e.apply(this,n);return t.cache=r.set(s,a)||r,a};return t.cache=new(n.Cache||s),t}var s=t("./node_modules/lodash/_MapCache.js"),r="Expected a function";n.Cache=s,e.exports=n},"./node_modules/lodash/toPath.js":function(e,o,t){function n(e){return a(e)?s(e,i):d(e)?[e]:r(l(u(e)))}var s=t("./node_modules/lodash/_arrayMap.js"),r=t("./node_modules/lodash/_copyArray.js"),a=t("./node_modules/lodash/isArray.js"),d=t("./node_modules/lodash/isSymbol.js"),l=t("./node_modules/lodash/_stringToPath.js"),i=t("./node_modules/lodash/_toKey.js"),u=t("./node_modules/lodash/toString.js");e.exports=n},"./node_modules/lodash/toString.js":function(e,o,t){function n(e){return null==e?"":s(e)}var s=t("./node_modules/lodash/_baseToString.js");e.exports=n},"./node_modules/redux-form/lib/structure/plain/getIn.js":function(e,o,t){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var n=t("./node_modules/lodash/toPath.js"),s=function(e){return e&&e.__esModule?e:{default:e}}(n),r=function(e,o){if(!e)return e;var t=(0,s.default)(o),n=t.length;if(n){for(var r=e,a=0;a=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}var s=o(7),r=n(s),i=o(2),d=n(i),l=o(0),u=n(l),c=o(6),_=n(c),h=o(3),f=n(h),m=o(12),p=n(m),v=o(10),g=n(v),j=o("./client/src/entwine/TinyMCE_ssmedia_sizepressets.js"),y=o("./client/src/state/modal/ModalActions.js"),b=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t}(y),x=(0,h.loadComponent)(p.default),S='img[data-shortcode="image"]';!function(){var e={init:function(e){var t=d.default._t("AssetAdmin.INSERT_FROM_FILES","Insert from Files"),o=d.default._t("AssetAdmin.EDIT_IMAGE","Edit image"),n=d.default._t("AssetAdmin.FILE","File");e.addButton("ssmedia",{title:t,icon:"image",cmd:"ssmedia",stateSelector:S}),e.addMenuItem("ssmedia",{text:n,icon:"image",cmd:"ssmedia"}),e.addButton("ssmediaedit",{title:o,icon:"editimage",cmd:"ssmedia"});var a=e.getParam("image_size_presets"),s=[];a&&(s=(0,j.imageSizePresetButtons)(e,a)),e.addContextToolbar(function(t){return e.dom.is(t,S)},s.join(" ")+" | ssmediaedit"),e.addCommand("ssmedia",function(){(0,r.default)("#"+e.id).entwine("ss").openMediaDialog()}),e.on("BeforeExecCommand",function(t){var o=t.command,n=t.ui,a=t.value;"mceAdvImage"!==o&&"mceImage"!==o||(t.preventDefault(),e.execCommand("ssmedia",n,a))}),e.on("SaveContent",function(e){var t=(0,r.default)(e.content);t.find(S).add(t.filter(S)).each(function(){var e=(0,r.default)(this),t={src:e.attr("src"),id:e.data("id"),width:e.attr("width"),height:e.attr("height"),class:e.attr("class"),title:e.attr("title"),alt:e.attr("alt"),loading:e.data("loading")},o=g.default.serialise({name:"image",properties:(0,v.sanitiseShortCodeProperties)(t),wrapped:!1});e.replaceWith(o)}),e.content="",t.each(function(){void 0!==this.outerHTML&&(e.content+=this.outerHTML)})}),e.on("BeforeSetContent",function(e){for(var t=e.content,o=g.default.match("image",!1,t);o;){var n=o.properties,a=(0,r.default)("").attr(Object.assign({},n,{id:void 0,"data-id":n.id,"data-shortcode":"image","data-loading":n.loading})).addClass("ss-htmleditorfield-file image");t=t.replace(o.original,(0,r.default)("
").append(a).html()),o=g.default.match("image",!1,t)}e.content=t})}};tinymce.PluginManager.add("ssmedia",function(t){return e.init(t)})}(),r.default.entwine("ss",function(e){e(".insert-media-react__dialog-wrapper .nav-link, .insert-media-react__dialog-wrapper .breadcrumb__container a").entwine({onclick:function(e){return e.preventDefault()}}),e(".js-injector-boot #insert-media-react__dialog-wrapper").entwine({Element:null,Data:{},onunmatch:function(){this._clearModal()},_clearModal:function(){_.default.unmountComponentAtNode(this[0])},open:function(){var e=f.default.reducer.store.dispatch;e(b.initFormStack("insert-media","admin"));var t=tinymce.activeEditor.getParam("image_size_presets");e(b.defineImageSizePresets(t)),this._renderModal(!0)},close:function(){(0,f.default.reducer.store.dispatch)(b.reset()),this._renderModal(!1)},_renderModal:function(e){var t=this,o=function(){return t.close()},n=function(){return t._handleInsert.apply(t,arguments)},s=this.getOriginalAttributes(),r=(s.url,a(s,["url"])),i=r.hasOwnProperty("ID")&&null!==r.ID,d=this.getFolderId(),l=tinymce.activeEditor.selection,c=l.getContent()||"",h=l.getNode().tagName,f="A"!==h&&("IMG"===h||""===c.trim());_.default.render(u.default.createElement(x,{title:!1,isOpen:e,folderId:d,onInsert:n,onClosed:o,bodyClassName:"modal__dialog",className:"insert-media-react__dialog-wrapper",requireLinkText:f,fileAttributes:r,fileSelected:i}),this[0])},_handleInsert:function(e,t){var o=!1;this.setData(Object.assign({},e,t));try{switch(t?t.category:"image"){case"image":o=this.insertImage();break;default:o=this.insertFile()}}catch(e){this.statusMessage(e,"bad")}return o&&this.close(),Promise.resolve()},getFolderId:function(){var e=this.getElement();if(!e)return null;var t=Number(e.data("config").upload_folder_id);return isNaN(t)?null:t},getOriginalAttributes:function(){var t=this.getElement();if(!t)return{};var o=t.getEditor().getSelectedNode();if(!o)return{};var n=e(o),a=(n.attr("href")||"").split("#");if(a[0]){var s=g.default.match("file_link",!1,a[0]);if(s)return{ID:s.properties.id?parseInt(s.properties.id,10):0,Anchor:a[1]||"",Description:n.attr("title"),TargetBlank:!!n.attr("target")}}var r=n.parent(".captionImage").find(".caption"),i={url:n.attr("src"),AltText:n.attr("alt"),Width:n.attr("width"),Height:n.attr("height"),Loading:n.attr("data-loading"),TitleTooltip:n.attr("title"),Alignment:this.findPosition(n.attr("class")),Caption:r.text(),ID:n.attr("data-id")};return["Width","Height","ID"].forEach(function(e){i[e]="string"==typeof i[e]?parseInt(i[e],10):null}),i},findPosition:function(e){var t=["leftAlone","center","rightAlone","left","right"];if("string"!=typeof e)return"";var o=e.split(" ");return t.find(function(e){return o.indexOf(e)>-1})},getAttributes:function(){var e=this.getData();return{src:e.url,alt:e.AltText,width:e.Width,height:e.Height,title:e.TitleTooltip,class:e.Alignment,"data-id":e.ID,"data-shortcode":"image","data-loading":e.Loading}},getExtraData:function(){var e=this.getData();return{CaptionText:e&&e.Caption}},insertFile:function(){var t=this.getData(),o=this.getElement().getEditor(),n=e(o.getSelectedNode()),a=g.default.serialise({name:"file_link",properties:{id:t.ID}},!0),s=tinymce.activeEditor.selection,r=s.getContent()||"",i=r||t.Text||t.filename;n.is("a")&&n.html()&&(i="");var d={href:a,target:t.TargetBlank?"_blank":"",title:t.Description};if(n.is("img")){i=t.Text||t.filename;var l=e("").attr(d).text(i);n.replaceWith(l),o.addUndo(),o.repaint()}else this.insertLinkInEditor(d,i);return!0},insertImage:function(){var t=this.getElement();if(!t)return!1;var o=t.getEditor();if(!o)return!1;var n=e(o.getSelectedNode()),a=this.getAttributes(),s=this.getExtraData(),r=n&&n.is("img,a")?n:null;r&&r.parent().is(".captionImage")&&(r=r.parent());var i=n&&n.is("img")?n:e("");i.attr(a).addClass("ss-htmleditorfield-file image");var d=i.parent(".captionImage"),l=d.find(".caption");s.CaptionText?(d.length||(d=e("
")),d.attr("class","captionImage "+a.class).removeAttr("data-mce-style").width(a.width),l.length||(l=e('

').appendTo(d)),l.attr("class","caption "+a.class).text(s.CaptionText)):(d=null,l=null);var u=d||i;return r&&r.not(u).length&&r.replaceWith(u),d&&d.prepend(i),r||(o.repaint(),o.insertContent(e("
").append(u).html(),{skip_undo:1})),o.addUndo(),o.repaint(),!0},statusMessage:function(t,o){var n=e("
").text(t).html();e.noticeAdd({text:n,type:o,stayTime:5e3,inEffect:{left:"0",opacity:"show"}})}})})},"./client/src/entwine/TinyMCE_ssmedia_sizepressets.js":function(e,t,o){"use strict";function n(e,t){var o=t.name,n=t.width,a=t.text,s="ssmedia"+o;e.on("init",function(){e.formatter.register(s,{selector:"img",attributes:{width:n?n.toString():""}})});var r=function(){var t=e.selection.getNode();return t&&"IMG"===t.tagName?t:void 0},i=function(e){var t=r();e.disabled(!(!t||!n)&&t.naturalWidth1&&void 0!==arguments[1]?arguments[1]:void 0;return{type:_.default.PUSH_FORM_SCHEMA,payload:{formSchema:{type:e,nextType:t}}}}function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return{type:_.default.INIT_FORM_SCHEMA_STACK,payload:{formSchema:{type:e,nextType:t}}}}function d(){return{type:_.default.POP_FORM_SCHEMA}}function l(){return{type:_.default.RESET}}function u(){return{type:_.default.RESET_FORM_STACK}}Object.defineProperty(t,"__esModule",{value:!0}),t.defineImageSizePresets=a,t.stashFormValues=s,t.pushFormStackEntry=r,t.initFormStack=i,t.popFormStackEntry=d,t.reset=l,t.resetFormStack=u;var c=o("./client/src/state/modal/ModalActionTypes.js"),_=n(c),h=o("./node_modules/redux-form/lib/structure/plain/getIn.js"),f=n(h),m=o(8),p=o("./client/src/state/modal/helpers.js"),v=n(p)},"./client/src/state/modal/helpers.js":function(e,t,o){"use strict";function n(e,t){var o=void 0;for(o=0;o-1}var a=o("./node_modules/lodash/_assocIndexOf.js");e.exports=n},"./node_modules/lodash/_listCacheSet.js":function(e,t,o){function n(e,t){var o=this.__data__,n=a(o,e);return n<0?(++this.size,o.push([e,t])):o[n][1]=t,this}var a=o("./node_modules/lodash/_assocIndexOf.js");e.exports=n},"./node_modules/lodash/_mapCacheClear.js":function(e,t,o){function n(){this.size=0,this.__data__={hash:new a,map:new(r||s),string:new a}}var a=o("./node_modules/lodash/_Hash.js"),s=o("./node_modules/lodash/_ListCache.js"),r=o("./node_modules/lodash/_Map.js");e.exports=n},"./node_modules/lodash/_mapCacheDelete.js":function(e,t,o){function n(e){var t=a(this,e).delete(e);return this.size-=t?1:0,t}var a=o("./node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/lodash/_mapCacheGet.js":function(e,t,o){function n(e){return a(this,e).get(e)}var a=o("./node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/lodash/_mapCacheHas.js":function(e,t,o){function n(e){return a(this,e).has(e)}var a=o("./node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/lodash/_mapCacheSet.js":function(e,t,o){function n(e,t){var o=a(this,e),n=o.size;return o.set(e,t),this.size+=o.size==n?0:1,this}var a=o("./node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/lodash/_memoizeCapped.js":function(e,t,o){function n(e){var t=a(e,function(e){return o.size===s&&o.clear(),e}),o=t.cache;return t}var a=o("./node_modules/lodash/memoize.js"),s=500;e.exports=n},"./node_modules/lodash/_nativeCreate.js":function(e,t,o){var n=o("./node_modules/lodash/_getNative.js"),a=n(Object,"create");e.exports=a},"./node_modules/lodash/_objectToString.js":function(e,t){function o(e){return a.call(e)}var n=Object.prototype,a=n.toString;e.exports=o},"./node_modules/lodash/_root.js":function(e,t,o){var n=o("./node_modules/lodash/_freeGlobal.js"),a="object"==typeof self&&self&&self.Object===Object&&self,s=n||a||Function("return this")();e.exports=s},"./node_modules/lodash/_stringToPath.js":function(e,t,o){var n=o("./node_modules/lodash/_memoizeCapped.js"),a=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,s=/\\(\\)?/g,r=n(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(a,function(e,o,n,a){t.push(n?a.replace(s,"$1"):o||e)}),t});e.exports=r},"./node_modules/lodash/_toKey.js":function(e,t,o){function n(e){if("string"==typeof e||a(e))return e;var t=e+"";return"0"==t&&1/e==-s?"-0":t}var a=o("./node_modules/lodash/isSymbol.js"),s=1/0;e.exports=n},"./node_modules/lodash/_toSource.js":function(e,t){function o(e){if(null!=e){try{return a.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var n=Function.prototype,a=n.toString;e.exports=o},"./node_modules/lodash/eq.js":function(e,t){function o(e,t){return e===t||e!==e&&t!==t}e.exports=o},"./node_modules/lodash/isArray.js":function(e,t){var o=Array.isArray;e.exports=o},"./node_modules/lodash/isFunction.js":function(e,t,o){function n(e){if(!s(e))return!1;var t=a(e);return t==i||t==d||t==r||t==l}var a=o("./node_modules/lodash/_baseGetTag.js"),s=o("./node_modules/lodash/isObject.js"),r="[object AsyncFunction]",i="[object Function]",d="[object GeneratorFunction]",l="[object Proxy]";e.exports=n},"./node_modules/lodash/isObject.js":function(e,t){function o(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=o},"./node_modules/lodash/isObjectLike.js":function(e,t){function o(e){return null!=e&&"object"==typeof e}e.exports=o},"./node_modules/lodash/isSymbol.js":function(e,t,o){function n(e){return"symbol"==typeof e||s(e)&&a(e)==r}var a=o("./node_modules/lodash/_baseGetTag.js"),s=o("./node_modules/lodash/isObjectLike.js"),r="[object Symbol]";e.exports=n},"./node_modules/lodash/memoize.js":function(e,t,o){function n(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(s);var o=function(){var n=arguments,a=t?t.apply(this,n):n[0],s=o.cache;if(s.has(a))return s.get(a);var r=e.apply(this,n);return o.cache=s.set(a,r)||s,r};return o.cache=new(n.Cache||a),o}var a=o("./node_modules/lodash/_MapCache.js"),s="Expected a function";n.Cache=a,e.exports=n},"./node_modules/lodash/toPath.js":function(e,t,o){function n(e){return r(e)?a(e,l):i(e)?[e]:s(d(u(e)))}var a=o("./node_modules/lodash/_arrayMap.js"),s=o("./node_modules/lodash/_copyArray.js"),r=o("./node_modules/lodash/isArray.js"),i=o("./node_modules/lodash/isSymbol.js"),d=o("./node_modules/lodash/_stringToPath.js"),l=o("./node_modules/lodash/_toKey.js"),u=o("./node_modules/lodash/toString.js");e.exports=n},"./node_modules/lodash/toString.js":function(e,t,o){function n(e){return null==e?"":a(e)}var a=o("./node_modules/lodash/_baseToString.js");e.exports=n},"./node_modules/redux-form/lib/structure/plain/getIn.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o("./node_modules/lodash/toPath.js"),a=function(e){return e&&e.__esModule?e:{default:e}}(n),s=function(e,t){if(!e)return e;var o=(0,a.default)(t),n=o.length;if(n){for(var s=e,r=0;r=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}var a=o(7),r=n(a),i=o(2),d=n(i),l=o(0),u=n(l),c=o(6),_=n(c),h=o(3),f=n(h),m=o(12),p=n(m),v=o(10),g=n(v),j=o("./client/src/entwine/TinyMCE_ssmedia_sizepressets.js"),y=o("./client/src/state/modal/ModalActions.js"),b=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t}(y),x=(0,h.loadComponent)(p.default),S='img[data-shortcode="image"]';!function(){var e={init:function(e){var t=d.default._t("AssetAdmin.INSERT_FROM_FILES","Insert from Files"),o=d.default._t("AssetAdmin.EDIT_IMAGE","Edit image"),n=d.default._t("AssetAdmin.FILE","File");e.addButton("ssmedia",{title:t,icon:"image",cmd:"ssmedia",stateSelector:S}),e.addMenuItem("ssmedia",{text:n,icon:"image",cmd:"ssmedia"}),e.addButton("ssmediaedit",{title:o,icon:"editimage",cmd:"ssmedia"});var s=e.getParam("image_size_presets"),a=[];s&&(a=(0,j.imageSizePresetButtons)(e,s)),e.addContextToolbar(function(t){return e.dom.is(t,S)},a.join(" ")+" | ssmediaedit"),e.addCommand("ssmedia",function(){(0,r.default)("#"+e.id).entwine("ss").openMediaDialog()}),e.on("BeforeExecCommand",function(t){var o=t.command,n=t.ui,s=t.value;"mceAdvImage"!==o&&"mceImage"!==o||(t.preventDefault(),e.execCommand("ssmedia",n,s))}),e.on("SaveContent",function(e){var t=(0,r.default)(e.content);t.find(S).add(t.filter(S)).each(function(){var e=(0,r.default)(this),t={src:e.attr("src"),id:e.data("id"),width:e.attr("width"),height:e.attr("height"),class:e.attr("class"),title:e.attr("title"),alt:e.attr("alt"),loading:e.data("loading")},o=g.default.serialise({name:"image",properties:(0,v.sanitiseShortCodeProperties)(t),wrapped:!1});e.replaceWith(o)}),e.content="",t.each(function(){void 0!==this.outerHTML&&(e.content+=this.outerHTML)})}),e.on("BeforeSetContent",function(e){for(var t=e.content,o=g.default.match("image",!1,t);o;){var n=o.properties,s=(0,r.default)("").attr(Object.assign({},n,{id:void 0,"data-id":n.id,"data-shortcode":"image","data-loading":n.loading})).addClass("ss-htmleditorfield-file image");t=t.replace(o.original,(0,r.default)("
").append(s).html()),o=g.default.match("image",!1,t)}e.content=t})}};tinymce.PluginManager.add("ssmedia",function(t){return e.init(t)})}(),r.default.entwine("ss",function(e){e(".js-injector-boot #insert-media-react__dialog-wrapper").entwine({Element:null,Data:{},onunmatch:function(){this._clearModal()},_clearModal:function(){_.default.unmountComponentAtNode(this[0])},open:function(){var e=f.default.reducer.store.dispatch;e(b.initFormStack("insert-media","admin"));var t=tinymce.activeEditor.getParam("image_size_presets");e(b.defineImageSizePresets(t)),this._renderModal(!0)},close:function(){(0,f.default.reducer.store.dispatch)(b.reset()),this._renderModal(!1)},_renderModal:function(e){var t=this,o=function(){return t.close()},n=function(){return t._handleInsert.apply(t,arguments)},a=this.getOriginalAttributes(),r=(a.url,s(a,["url"])),i=r.hasOwnProperty("ID")&&null!==r.ID,d=this.getFolderId(),l=tinymce.activeEditor.selection,c=l.getContent()||"",h=l.getNode().tagName,f="A"!==h&&("IMG"===h||""===c.trim());_.default.render(u.default.createElement(x,{title:!1,isOpen:e,folderId:d,onInsert:n,onClosed:o,bodyClassName:"modal__dialog",className:"insert-media-react__dialog-wrapper",requireLinkText:f,fileAttributes:r,fileSelected:i}),this[0])},_handleInsert:function(e,t){var o=!1;this.setData(Object.assign({},e,t));try{switch(t?t.category:"image"){case"image":o=this.insertImage();break;default:o=this.insertFile()}}catch(e){this.statusMessage(e,"bad")}return o&&this.close(),Promise.resolve()},getFolderId:function(){var e=this.getElement();if(!e)return null;var t=Number(e.data("config").upload_folder_id);return isNaN(t)?null:t},getOriginalAttributes:function(){var t=this.getElement();if(!t)return{};var o=t.getEditor().getSelectedNode();if(!o)return{};var n=e(o),s=(n.attr("href")||"").split("#");if(s[0]){var a=g.default.match("file_link",!1,s[0]);if(a)return{ID:a.properties.id?parseInt(a.properties.id,10):0,Anchor:s[1]||"",Description:n.attr("title"),TargetBlank:!!n.attr("target")}}var r=n.parent(".captionImage").find(".caption"),i={url:n.attr("src"),AltText:n.attr("alt"),Width:n.attr("width"),Height:n.attr("height"),Loading:n.attr("data-loading"),TitleTooltip:n.attr("title"),Alignment:this.findPosition(n.attr("class")),Caption:r.text(),ID:n.attr("data-id")};return["Width","Height","ID"].forEach(function(e){i[e]="string"==typeof i[e]?parseInt(i[e],10):null}),i},findPosition:function(e){var t=["leftAlone","center","rightAlone","left","right"];if("string"!=typeof e)return"";var o=e.split(" ");return t.find(function(e){return o.indexOf(e)>-1})},getAttributes:function(){var e=this.getData();return{src:e.url,alt:e.AltText,width:e.Width,height:e.Height,title:e.TitleTooltip,class:e.Alignment,"data-id":e.ID,"data-shortcode":"image","data-loading":e.Loading}},getExtraData:function(){var e=this.getData();return{CaptionText:e&&e.Caption}},insertFile:function(){var t=this.getData(),o=this.getElement().getEditor(),n=e(o.getSelectedNode()),s=g.default.serialise({name:"file_link",properties:{id:t.ID}},!0),a=tinymce.activeEditor.selection,r=a.getContent()||"",i=r||t.Text||t.filename;n.is("a")&&n.html()&&(i="");var d={href:s,target:t.TargetBlank?"_blank":"",title:t.Description};if(n.is("img")){i=t.Text||t.filename;var l=e("").attr(d).text(i);n.replaceWith(l),o.addUndo(),o.repaint()}else this.insertLinkInEditor(d,i);return!0},insertImage:function(){var t=this.getElement();if(!t)return!1;var o=t.getEditor();if(!o)return!1;var n=e(o.getSelectedNode()),s=this.getAttributes(),a=this.getExtraData(),r=n&&n.is("img,a")?n:null;r&&r.parent().is(".captionImage")&&(r=r.parent());var i=n&&n.is("img")?n:e("");i.attr(s).addClass("ss-htmleditorfield-file image");var d=i.parent(".captionImage"),l=d.find(".caption");a.CaptionText?(d.length||(d=e("
")),d.attr("class","captionImage "+s.class).removeAttr("data-mce-style").width(s.width),l.length||(l=e('

').appendTo(d)),l.attr("class","caption "+s.class).text(a.CaptionText)):(d=null,l=null);var u=d||i;return r&&r.not(u).length&&r.replaceWith(u),d&&d.prepend(i),r||(o.repaint(),o.insertContent(e("
").append(u).html(),{skip_undo:1})),o.addUndo(),o.repaint(),!0},statusMessage:function(t,o){var n=e("
").text(t).html();e.noticeAdd({text:n,type:o,stayTime:5e3,inEffect:{left:"0",opacity:"show"}})}})})},"./client/src/entwine/TinyMCE_ssmedia_sizepressets.js":function(e,t,o){"use strict";function n(e,t){var o=t.name,n=t.width,s=t.text,a="ssmedia"+o;e.on("init",function(){e.formatter.register(a,{selector:"img",attributes:{width:n?n.toString():""}})});var r=function(){var t=e.selection.getNode();return t&&"IMG"===t.tagName?t:void 0},i=function(e){var t=r();e.disabled(!(!t||!n)&&t.naturalWidth1&&void 0!==arguments[1]?arguments[1]:void 0;return{type:_.default.PUSH_FORM_SCHEMA,payload:{formSchema:{type:e,nextType:t}}}}function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return{type:_.default.INIT_FORM_SCHEMA_STACK,payload:{formSchema:{type:e,nextType:t}}}}function d(){return{type:_.default.POP_FORM_SCHEMA}}function l(){return{type:_.default.RESET}}function u(){return{type:_.default.RESET_FORM_STACK}}Object.defineProperty(t,"__esModule",{value:!0}),t.defineImageSizePresets=s,t.stashFormValues=a,t.pushFormStackEntry=r,t.initFormStack=i,t.popFormStackEntry=d,t.reset=l,t.resetFormStack=u;var c=o("./client/src/state/modal/ModalActionTypes.js"),_=n(c),h=o("./node_modules/redux-form/lib/structure/plain/getIn.js"),f=n(h),m=o(8),p=o("./client/src/state/modal/helpers.js"),v=n(p)},"./client/src/state/modal/helpers.js":function(e,t,o){"use strict";function n(e,t){var o=void 0;for(o=0;o-1}var s=o("./node_modules/lodash/_assocIndexOf.js");e.exports=n},"./node_modules/lodash/_listCacheSet.js":function(e,t,o){function n(e,t){var o=this.__data__,n=s(o,e);return n<0?(++this.size,o.push([e,t])):o[n][1]=t,this}var s=o("./node_modules/lodash/_assocIndexOf.js");e.exports=n},"./node_modules/lodash/_mapCacheClear.js":function(e,t,o){function n(){this.size=0,this.__data__={hash:new s,map:new(r||a),string:new s}}var s=o("./node_modules/lodash/_Hash.js"),a=o("./node_modules/lodash/_ListCache.js"),r=o("./node_modules/lodash/_Map.js");e.exports=n},"./node_modules/lodash/_mapCacheDelete.js":function(e,t,o){function n(e){var t=s(this,e).delete(e);return this.size-=t?1:0,t}var s=o("./node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/lodash/_mapCacheGet.js":function(e,t,o){function n(e){return s(this,e).get(e)}var s=o("./node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/lodash/_mapCacheHas.js":function(e,t,o){function n(e){return s(this,e).has(e)}var s=o("./node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/lodash/_mapCacheSet.js":function(e,t,o){function n(e,t){var o=s(this,e),n=o.size;return o.set(e,t),this.size+=o.size==n?0:1,this}var s=o("./node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/lodash/_memoizeCapped.js":function(e,t,o){function n(e){var t=s(e,function(e){return o.size===a&&o.clear(),e}),o=t.cache;return t}var s=o("./node_modules/lodash/memoize.js"),a=500;e.exports=n},"./node_modules/lodash/_nativeCreate.js":function(e,t,o){var n=o("./node_modules/lodash/_getNative.js"),s=n(Object,"create");e.exports=s},"./node_modules/lodash/_objectToString.js":function(e,t){function o(e){return s.call(e)}var n=Object.prototype,s=n.toString;e.exports=o},"./node_modules/lodash/_root.js":function(e,t,o){var n=o("./node_modules/lodash/_freeGlobal.js"),s="object"==typeof self&&self&&self.Object===Object&&self,a=n||s||Function("return this")();e.exports=a},"./node_modules/lodash/_stringToPath.js":function(e,t,o){var n=o("./node_modules/lodash/_memoizeCapped.js"),s=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,r=n(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(s,function(e,o,n,s){t.push(n?s.replace(a,"$1"):o||e)}),t});e.exports=r},"./node_modules/lodash/_toKey.js":function(e,t,o){function n(e){if("string"==typeof e||s(e))return e;var t=e+"";return"0"==t&&1/e==-a?"-0":t}var s=o("./node_modules/lodash/isSymbol.js"),a=1/0;e.exports=n},"./node_modules/lodash/_toSource.js":function(e,t){function o(e){if(null!=e){try{return s.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var n=Function.prototype,s=n.toString;e.exports=o},"./node_modules/lodash/eq.js":function(e,t){function o(e,t){return e===t||e!==e&&t!==t}e.exports=o},"./node_modules/lodash/isArray.js":function(e,t){var o=Array.isArray;e.exports=o},"./node_modules/lodash/isFunction.js":function(e,t,o){function n(e){if(!a(e))return!1;var t=s(e);return t==i||t==d||t==r||t==l}var s=o("./node_modules/lodash/_baseGetTag.js"),a=o("./node_modules/lodash/isObject.js"),r="[object AsyncFunction]",i="[object Function]",d="[object GeneratorFunction]",l="[object Proxy]";e.exports=n},"./node_modules/lodash/isObject.js":function(e,t){function o(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=o},"./node_modules/lodash/isObjectLike.js":function(e,t){function o(e){return null!=e&&"object"==typeof e}e.exports=o},"./node_modules/lodash/isSymbol.js":function(e,t,o){function n(e){return"symbol"==typeof e||a(e)&&s(e)==r}var s=o("./node_modules/lodash/_baseGetTag.js"),a=o("./node_modules/lodash/isObjectLike.js"),r="[object Symbol]";e.exports=n},"./node_modules/lodash/memoize.js":function(e,t,o){function n(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(a);var o=function(){var n=arguments,s=t?t.apply(this,n):n[0],a=o.cache;if(a.has(s))return a.get(s);var r=e.apply(this,n);return o.cache=a.set(s,r)||a,r};return o.cache=new(n.Cache||s),o}var s=o("./node_modules/lodash/_MapCache.js"),a="Expected a function";n.Cache=s,e.exports=n},"./node_modules/lodash/toPath.js":function(e,t,o){function n(e){return r(e)?s(e,l):i(e)?[e]:a(d(u(e)))}var s=o("./node_modules/lodash/_arrayMap.js"),a=o("./node_modules/lodash/_copyArray.js"),r=o("./node_modules/lodash/isArray.js"),i=o("./node_modules/lodash/isSymbol.js"),d=o("./node_modules/lodash/_stringToPath.js"),l=o("./node_modules/lodash/_toKey.js"),u=o("./node_modules/lodash/toString.js");e.exports=n},"./node_modules/lodash/toString.js":function(e,t,o){function n(e){return null==e?"":s(e)}var s=o("./node_modules/lodash/_baseToString.js");e.exports=n},"./node_modules/redux-form/lib/structure/plain/getIn.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o("./node_modules/lodash/toPath.js"),s=function(e){return e&&e.__esModule?e:{default:e}}(n),a=function(e,t){if(!e)return e;var o=(0,s.default)(t),n=o.length;if(n){for(var a=e,r=0;r { - // this is required because the React version of e.preventDefault() doesn't work - // this is to stop React Tabs from navigating the page - $('.insert-link__dialog-wrapper--internal .nav-link, ' + - '.insert-media-react__dialog-wrapper .breadcrumb__container a').entwine({ - onclick: (e) => e.preventDefault(), - }); - $('textarea.htmleditor').entwine({ openLinkFileDialog() { let dialog = $(`#${modalId}`); diff --git a/client/src/entwine/TinyMCE_ssmedia.js b/client/src/entwine/TinyMCE_ssmedia.js index b4bd62633..1589429a8 100644 --- a/client/src/entwine/TinyMCE_ssmedia.js +++ b/client/src/entwine/TinyMCE_ssmedia.js @@ -144,13 +144,6 @@ const filter = 'img[data-shortcode="image"]'; })(); jQuery.entwine('ss', ($) => { - // this is required because the React version of e.preventDefault() doesn't work - // this is to stop React Tabs from navigating the page - $('.insert-media-react__dialog-wrapper .nav-link, ' + - '.insert-media-react__dialog-wrapper .breadcrumb__container a').entwine({ - onclick: (e) => e.preventDefault(), - }); - $('.js-injector-boot #insert-media-react__dialog-wrapper').entwine({ Element: null, diff --git a/tests/behat/features/insert-an-image.feature b/tests/behat/features/insert-an-image.feature index 8bc3519fd..47900b6fa 100644 --- a/tests/behat/features/insert-an-image.feature +++ b/tests/behat/features/insert-an-image.feature @@ -8,6 +8,7 @@ Feature: Insert an image into a page Given a "page" "About Us" has the "Content" "

My awesome content

" And a "image" "folder1/file1.jpg" And a "image" "folder1/file2.jpg" + And a "folder" "folder1/folder1-1" And I am logged in with "ADMIN" permissions And I go to "/admin/pages" And I click on "About Us" in the tree @@ -36,6 +37,24 @@ Feature: Insert an image into a page # Required to avoid "unsaved changed" browser dialog And I press the "Save" button + Scenario: I can use modal breadcrumbs to navigate up levels + When I press the "Insert from Files" HTML field button + And I select the file named "folder1" in the gallery + And I select the file named "folder1-1" in the gallery + Then I should see the breadcrumb link "Files" + And I should see the breadcrumb link "folder1" + And I should not see the breadcrumb link "folder1-1" + When I click on the breadcrumb link "folder1" + Then I should see the file named "folder1-1" in the gallery + And I should not see the breadcrumb link "folder1" + # Validate that we haven't navigated away from the pages admin + And I can see the preview panel + When I click on the breadcrumb link "Files" + Then I should see the file named "folder1" in the gallery + And I should not see the breadcrumb link "Files" + # Validate that we haven't navigated away from the pages admin + And I can see the preview panel + Scenario: I can edit an image in the file modal When I press the "Insert from Files" HTML field button And I select the file named "folder1" in the gallery diff --git a/tests/behat/features/manage-files.feature b/tests/behat/features/manage-files.feature index bf0c1cb76..c6d384695 100644 --- a/tests/behat/features/manage-files.feature +++ b/tests/behat/features/manage-files.feature @@ -27,6 +27,25 @@ Feature: Manage files And I should see the file named "folder1-1" in the gallery And I should not see the file named "file2" in the gallery + Scenario: I can use breadcrumbs to navigate up levels + When I click on the file named "folder1" in the gallery + And I click on the file named "folder1-1" in the gallery + Then I should see the breadcrumb link "Files" + And I should see the breadcrumb link "folder1" + And I should not see the breadcrumb link "folder1-1" + When I click on the breadcrumb link "folder1" + Then I should see the file named "folder1-1" in the gallery + And I should not see the breadcrumb link "folder1" + # Validate that the ways we're confirming we're not navigated away in other tests are valid + And I should not see an ".uploadfield" element + And I should not see an ".cms-preview" element + When I click on the breadcrumb link "Files" + Then I should see the file named "folder1" in the gallery + And I should not see the breadcrumb link "Files" + # Validate that the ways we're confirming we're not navigated away in other tests are valid + And I should not see an ".uploadfield" element + And I should not see an ".cms-preview" element + Scenario: I can upload a file to a folder When I click on the file named "folder1" in the gallery And I attach the file "testfile.jpg" to dropzone "gallery-container" diff --git a/tests/behat/features/single-file-upload-field.feature b/tests/behat/features/single-file-upload-field.feature index a9b6adad8..f49fd3e5b 100644 --- a/tests/behat/features/single-file-upload-field.feature +++ b/tests/behat/features/single-file-upload-field.feature @@ -7,6 +7,7 @@ Feature: Single file Upload field Given a "page" "About Us" has the "Content" "

My awesome content

" And a "image" "folder1/file1.jpg" And a "image" "folder1/file2.jpg" + And a "folder" "folder1/folder1-1" And a "employee" "Allen" And I am logged in with "ADMIN" permissions And I go to "/admin/test/SilverStripe-FrameworkTest-Model-Employee" @@ -57,3 +58,22 @@ Feature: Single file Upload field Then I should see "file2" in the ".uploadfield-item__title" element # Required to avoid "unsaved changed" browser dialog Then I press the "Save" button + + Scenario: I can use modal breadcrumbs to navigate up levels + When I click "Choose existing" in the ".uploadfield" element + And I press the "Back" HTML field button + And I select the file named "folder1" in the gallery + And I select the file named "folder1-1" in the gallery + Then I should see the breadcrumb link "Files" + And I should see the breadcrumb link "folder1" + And I should not see the breadcrumb link "folder1-1" + When I click on the breadcrumb link "folder1" + Then I should see the file named "folder1-1" in the gallery + And I should not see the breadcrumb link "folder1" + # Validate that we haven't navigated away from the pages admin + And I should see an ".uploadfield" element + When I click on the breadcrumb link "Files" + Then I should see the file named "folder1" in the gallery + And I should not see the breadcrumb link "Files" + # Validate that we haven't navigated away from the pages admin + And I should see an ".uploadfield" element diff --git a/tests/behat/src/FixtureContext.php b/tests/behat/src/FixtureContext.php index c90cb37a2..c9fc24f65 100644 --- a/tests/behat/src/FixtureContext.php +++ b/tests/behat/src/FixtureContext.php @@ -132,6 +132,38 @@ public function iShouldNotSeeTheFileStatusIconWithTheClass($id) Assert::assertNull($icon, "File status icon '$id' was found"); } + + /** + * @Given /^I click on the breadcrumb link "([^"]+)"$/ + * @param string $name + */ + public function stepIClickBreadcrumbLink($name) + { + $link = $this->getBreadcrumbLink($name); + Assert::assertNotNull($link, "Breadcrumb link named '$name' could not be found"); + $link->click(); + } + + /** + * @Then /^I should see the breadcrumb link "([^"]*)"/ + * @param string $name + */ + public function iShouldSeeTheBreadcrumbLink($name) + { + $link = $this->getBreadcrumbLink($name); + Assert::assertNotNull($link, "Breadcrumb link named '$name' could not be found"); + } + + /** + * @Then /^I should not see the breadcrumb link "([^"]*)"/ + * @param string $name + */ + public function iShouldNotSeeTheBreadcrumbLink($name) + { + $link = $this->getBreadcrumbLink($name); + Assert::assertNull($link, "Breadcrumb link named '$name' was found when it should not be visible"); + } + /** * @Given /^I click on the latest history item$/ */ @@ -249,6 +281,23 @@ protected function getGalleryItem($name, $timeout = 3) return null; } + /** + * Helper for finding breadcrumb links + * + * @param string $name Title of item + * @return NodeElement + */ + protected function getBreadcrumbLink(string $name): ?NodeElement + { + /** @var DocumentElement $page */ + $page = $this->getMainContext()->getSession()->getPage(); + $link = $page->find( + 'xpath', + "//li[contains(@class, 'breadcrumb__item')]//a[contains(@class, 'breadcrumb__item-title')][text()='$name']" + ); + return $link; + } + /** * Helper for finding items in the visible table gallery view by its order *