From 8c15e53feba08cb68b1d002975555fa62df486d8 Mon Sep 17 00:00:00 2001 From: Christopher Joe Date: Thu, 20 Oct 2016 10:08:17 +1300 Subject: [PATCH] Update devtools code to reflect the new API --- admin/client/dist/js/bundle.js | 159 +++++++++++++++++---------------- admin/client/src/boot/index.js | 17 +++- 2 files changed, 96 insertions(+), 80 deletions(-) diff --git a/admin/client/dist/js/bundle.js b/admin/client/dist/js/bundle.js index d983dedfd..cb61fcde6 100644 --- a/admin/client/dist/js/bundle.js +++ b/admin/client/dist/js/bundle.js @@ -58,64 +58,69 @@ return this.fetch(e,{method:"put",credentials:"same-origin",body:s(t),headers:n} return this.fetch(e,{method:"delete",credentials:"same-origin",body:s(t),headers:n}).then(a)}}]),e}(),O=new P t["default"]=O},function(e,t,n){n(8),e.exports=self.fetch.bind(self)},function(e,t){!function(e){"use strict" function t(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name") -return e.toLowerCase()}function n(e){return"string"!=typeof e&&(e=String(e)),e}function i(e){this.map={},e instanceof i?e.forEach(function(e,t){this.append(t,e)},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){ -this.append(t,e[t])},this)}function r(e){return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function o(e){return new Promise(function(t,n){e.onload=function(){t(e.result) +return e.toLowerCase()}function n(e){return"string"!=typeof e&&(e=String(e)),e}function i(e){var t={next:function(){var t=e.shift() +return{done:void 0===t,value:t}}} +return m.iterable&&(t[Symbol.iterator]=function(){return t}),t}function r(e){this.map={},e instanceof r?e.forEach(function(e,t){this.append(t,e)},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){ +this.append(t,e[t])},this)}function o(e){return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function a(e){return new Promise(function(t,n){e.onload=function(){t(e.result) -},e.onerror=function(){n(e.error)}})}function a(e){var t=new FileReader -return t.readAsArrayBuffer(e),o(t)}function s(e){var t=new FileReader -return t.readAsText(e),o(t)}function l(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,"string"==typeof e)this._bodyText=e -else if(h.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e -else if(h.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e -else if(e){if(!h.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e))throw new Error("unsupported BodyInit type")}else this._bodyText="" -this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type&&this.headers.set("content-type",this._bodyBlob.type)) +},e.onerror=function(){n(e.error)}})}function s(e){var t=new FileReader +return t.readAsArrayBuffer(e),a(t)}function l(e){var t=new FileReader +return t.readAsText(e),a(t)}function u(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,"string"==typeof e)this._bodyText=e +else if(m.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e +else if(m.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e +else if(m.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString() +else if(e){if(!m.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e))throw new Error("unsupported BodyInit type")}else this._bodyText="" +this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):m.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8")) -},h.blob?(this.blob=function(){var e=r(this) +},m.blob?(this.blob=function(){var e=o(this) if(e)return e if(this._bodyBlob)return Promise.resolve(this._bodyBlob) if(this._bodyFormData)throw new Error("could not read FormData body as blob") -return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(a)},this.text=function(){var e=r(this) +return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(s)},this.text=function(){var e=o(this) if(e)return e -if(this._bodyBlob)return s(this._bodyBlob) +if(this._bodyBlob)return l(this._bodyBlob) if(this._bodyFormData)throw new Error("could not read FormData body as text") -return Promise.resolve(this._bodyText)}):this.text=function(){var e=r(this) -return e?e:Promise.resolve(this._bodyText)},h.formData&&(this.formData=function(){return this.text().then(d)}),this.json=function(){return this.text().then(JSON.parse)},this}function u(e){var t=e.toUpperCase() +return Promise.resolve(this._bodyText)}):this.text=function(){var e=o(this) +return e?e:Promise.resolve(this._bodyText)},m.formData&&(this.formData=function(){return this.text().then(f)}),this.json=function(){return this.text().then(JSON.parse)},this}function c(e){var t=e.toUpperCase() -return m.indexOf(t)>-1?t:e}function c(e,t){t=t||{} +return g.indexOf(t)>-1?t:e}function d(e,t){t=t||{} var n=t.body -if(c.prototype.isPrototypeOf(e)){if(e.bodyUsed)throw new TypeError("Already read") -this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new i(e.headers)),this.method=e.method,this.mode=e.mode,n||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=e -if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new i(t.headers)),this.method=u(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null, +if(d.prototype.isPrototypeOf(e)){if(e.bodyUsed)throw new TypeError("Already read") +this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new r(e.headers)),this.method=e.method,this.mode=e.mode,n||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=e +if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new r(t.headers)),this.method=c(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null, ("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests") -this._initBody(n)}function d(e){var t=new FormData +this._initBody(n)}function f(e){var t=new FormData return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),i=n.shift().replace(/\+/g," "),r=n.join("=").replace(/\+/g," ") -t.append(decodeURIComponent(i),decodeURIComponent(r))}}),t}function f(e){var t=new i,n=e.getAllResponseHeaders().trim().split("\n") +t.append(decodeURIComponent(i),decodeURIComponent(r))}}),t}function p(e){var t=new r,n=(e.getAllResponseHeaders()||"").trim().split("\n") return n.forEach(function(e){var n=e.trim().split(":"),i=n.shift().trim(),r=n.join(":").trim() -t.append(i,r)}),t}function p(e,t){t||(t={}),this.type="default",this.status=t.status,this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText,this.headers=t.headers instanceof i?t.headers:new i(t.headers), -this.url=t.url||"",this._initBody(e)}if(!e.fetch){i.prototype.append=function(e,i){e=t(e),i=n(i) +t.append(i,r)}),t}function h(e,t){t||(t={}),this.type="default",this.status=t.status,this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText,this.headers=t.headers instanceof r?t.headers:new r(t.headers), +this.url=t.url||"",this._initBody(e)}if(!e.fetch){var m={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob, +!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e} +r.prototype.append=function(e,i){e=t(e),i=n(i) var r=this.map[e] -r||(r=[],this.map[e]=r),r.push(i)},i.prototype["delete"]=function(e){delete this.map[t(e)]},i.prototype.get=function(e){var n=this.map[t(e)] -return n?n[0]:null},i.prototype.getAll=function(e){return this.map[t(e)]||[]},i.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},i.prototype.set=function(e,i){this.map[t(e)]=[n(i)]},i.prototype.forEach=function(e,t){ -Object.getOwnPropertyNames(this.map).forEach(function(n){this.map[n].forEach(function(i){e.call(t,i,n,this)},this)},this)} -var h={blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e},m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"] - - -c.prototype.clone=function(){return new c(this)},l.call(c.prototype),l.call(p.prototype),p.prototype.clone=function(){return new p(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new i(this.headers), -url:this.url})},p.error=function(){var e=new p(null,{status:0,statusText:""}) +r||(r=[],this.map[e]=r),r.push(i)},r.prototype["delete"]=function(e){delete this.map[t(e)]},r.prototype.get=function(e){var n=this.map[t(e)] +return n?n[0]:null},r.prototype.getAll=function(e){return this.map[t(e)]||[]},r.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},r.prototype.set=function(e,i){this.map[t(e)]=[n(i)]},r.prototype.forEach=function(e,t){ +Object.getOwnPropertyNames(this.map).forEach(function(n){this.map[n].forEach(function(i){e.call(t,i,n,this)},this)},this)},r.prototype.keys=function(){var e=[] +return this.forEach(function(t,n){e.push(n)}),i(e)},r.prototype.values=function(){var e=[] +return this.forEach(function(t){e.push(t)}),i(e)},r.prototype.entries=function(){var e=[] +return this.forEach(function(t,n){e.push([n,t])}),i(e)},m.iterable&&(r.prototype[Symbol.iterator]=r.prototype.entries) +var g=["DELETE","GET","HEAD","OPTIONS","POST","PUT"] +d.prototype.clone=function(){return new d(this)},u.call(d.prototype),u.call(h.prototype),h.prototype.clone=function(){return new h(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new r(this.headers), +url:this.url})},h.error=function(){var e=new h(null,{status:0,statusText:""}) return e.type="error",e} -var g=[301,302,303,307,308] -p.redirect=function(e,t){if(g.indexOf(t)===-1)throw new RangeError("Invalid status code") -return new p(null,{status:t,headers:{location:e}})},e.Headers=i,e.Request=c,e.Response=p,e.fetch=function(e,t){return new Promise(function(n,i){function r(){return"responseURL"in a?a.responseURL:/^X-Request-URL:/m.test(a.getAllResponseHeaders())?a.getResponseHeader("X-Request-URL"):void 0 +var v=[301,302,303,307,308] +h.redirect=function(e,t){if(v.indexOf(t)===-1)throw new RangeError("Invalid status code") +return new h(null,{status:t,headers:{location:e}})},e.Headers=r,e.Request=d,e.Response=h,e.fetch=function(e,t){return new Promise(function(n,i){function r(){return"responseURL"in a?a.responseURL:/^X-Request-URL:/m.test(a.getAllResponseHeaders())?a.getResponseHeader("X-Request-URL"):void 0 }var o -o=c.prototype.isPrototypeOf(e)&&!t?e:new c(e,t) +o=d.prototype.isPrototypeOf(e)&&!t?e:new d(e,t) var a=new XMLHttpRequest -a.onload=function(){var e=1223===a.status?204:a.status -if(e<100||e>599)return void i(new TypeError("Network request failed")) -var t={status:e,statusText:a.statusText,headers:f(a),url:r()},o="response"in a?a.response:a.responseText -n(new p(o,t))},a.onerror=function(){i(new TypeError("Network request failed"))},a.open(o.method,o.url,!0),"include"===o.credentials&&(a.withCredentials=!0),"responseType"in a&&h.blob&&(a.responseType="blob"), -o.headers.forEach(function(e,t){a.setRequestHeader(t,e)}),a.send("undefined"==typeof o._bodyInit?null:o._bodyInit)})},e.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)},function(e,t,n){var i;(function(t,r){ -!function(t,n){e.exports=n()}(this,function(){"use strict" +a.onload=function(){var e={status:a.status,statusText:a.statusText,headers:p(a),url:r()},t="response"in a?a.response:a.responseText +n(new h(t,e))},a.onerror=function(){i(new TypeError("Network request failed"))},a.ontimeout=function(){i(new TypeError("Network request failed"))},a.open(o.method,o.url,!0),"include"===o.credentials&&(a.withCredentials=!0), +"responseType"in a&&m.blob&&(a.responseType="blob"),o.headers.forEach(function(e,t){a.setRequestHeader(t,e)}),a.send("undefined"==typeof o._bodyInit?null:o._bodyInit)})},e.fetch.polyfill=!0}}("undefined"!=typeof self?self:this) + +},function(e,t,n){var i;(function(t,r){!function(t,n){e.exports=n()}(this,function(){"use strict" function e(e){return"function"==typeof e||"object"==typeof e&&null!==e}function o(e){return"function"==typeof e}function a(e){K=e}function s(e){Y=e}function l(){return function(){return t.nextTick(p)}} function u(){return function(){Q(p)}}function c(){var e=0,t=new ee(p),n=document.createTextNode("") return t.observe(n,{characterData:!0}),function(){n.data=e=++e%2}}function d(){var e=new MessageChannel @@ -126,7 +131,7 @@ return Q=t.runOnLoop||t.runOnContext,u()}catch(r){return f()}}function m(e,t){va void 0===r[oe]&&M(r) var o=i._state return o?!function(){var e=n[o-1] -Y(function(){return I(o,r,e,i._result)})}():j(i,r,e,t),r}function g(e){var t=this +Y(function(){return A(o,r,e,i._result)})}():j(i,r,e,t),r}function g(e){var t=this if(e&&"object"==typeof e&&e.constructor===t)return e var n=new t(v) return P(n,e),n}function v(){}function y(){return new TypeError("You cannot resolve a promise with itself")}function b(){return new TypeError("A promises callback cannot return that same promise.")}function w(e){ @@ -137,9 +142,9 @@ i||(i=!0,S(e,t))},"Settle: "+(e._label||" unknown promise")) }function P(t,n){t===n?S(t,y()):e(n)?E(t,n,w(n)):k(t,n)}function O(e){e._onerror&&e._onerror(e._result),x(e)}function k(e,t){e._state===ae&&(e._result=t,e._state=se,0!==e._subscribers.length&&Y(x,e))}function S(e,t){ e._state===ae&&(e._state=le,e._result=t,Y(O,e))}function j(e,t,n,i){var r=e._subscribers,o=r.length e._onerror=null,r[o]=t,r[o+se]=n,r[o+le]=i,0===o&&e._state&&Y(x,e)}function x(e){var t=e._subscribers,n=e._state -if(0!==t.length){for(var i=void 0,r=void 0,o=e._result,a=0;a127?"x":F[M] -if(!D.match(b)){var U=A.slice(0,k),L=A.slice(k+1),B=F.match(w) +if(!D.match(b)){var U=I.slice(0,k),L=I.slice(k+1),B=F.match(w) B&&(U.push(B[1]),L.unshift(B[2])),L.length&&(s="/"+L.join(".")+s),this.hostname=U.join(".") break}}}this.hostname.length>y?this.hostname="":this.hostname=this.hostname.toLowerCase(),R||(this.hostname=l.toASCII(this.hostname)) var H=this.port?":"+this.port:"",$=this.hostname||"" -this.host=$+H,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!_[h])for(var k=0,I=m.length;k1&&(i=n[0]+"@",e=n[1]),e=e.replace(I,".") +n.length>1&&(i=n[0]+"@",e=n[1]),e=e.replace(A,".") var r=e.split("."),o=s(r,t).join(".") return i+o}function u(e){for(var t=[],n=0,i=e.length,r,o;n=55296&&r<=56319&&nC-o&&a("overflow"),o+=M(r/i),r%=i,t.splice(r for(e=u(e),v=e.length,t=j,n=0,o=S,s=0;s=t&&mM((C-n)/y)&&a("overflow"),n+=(l-t)*y,t=l,s=0;sC&&a("overflow"),m==t){for(c=n,d=T;h=d<=o?E:d>=o+P?P:d-o,!(c= 0x80 (not a basic code point)", +var _,C=2147483647,T=36,E=1,P=26,O=38,k=700,S=72,j=128,x="-",R=/^xn--/,I=/[^\x20-\x7E]/,A=/[\x2E\u3002\uFF0E\uFF61]/g,F={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)", "invalid-input":"Invalid input"},D=T-E,M=Math.floor,N=String.fromCharCode,U _={version:"1.3.2",ucs2:{decode:u,encode:c},decode:h,encode:m,toASCII:v,toUnicode:g},i=function(){return _}.call(t,n,t,e),!(void 0!==i&&(e.exports=i))}(this)}).call(t,n(17)(e),function(){return this}()) @@ -1150,7 +1155,7 @@ t.length&&t.remove(),n=$.path.addSearchParams(n,{tempid:e,BackURL:window.locatio }}),$(".leftandmain-logindialog").entwine({onmatch:function j(){this._super(),this.ssdialog({iframeUrl:this.data("url"),dialogClass:"leftandmain-logindialog-dialog",autoOpen:!0,minWidth:500,maxWidth:500, minHeight:370,maxHeight:400,closeOnEscape:!1,open:function e(){$(".ui-widget-overlay").addClass("leftandmain-logindialog-overlay")},close:function t(){$(".ui-widget-overlay").removeClass("leftandmain-logindialog-overlay") -}})},onunmatch:function x(){this._super()},open:function R(){this.ssdialog("open")},close:function A(){this.ssdialog("close")},toggle:function I(e){this.is(":visible")?this.close():this.open()},reauthenticate:function F(e){ +}})},onunmatch:function x(){this._super()},open:function R(){this.ssdialog("open")},close:function I(){this.ssdialog("close")},toggle:function A(e){this.is(":visible")?this.close():this.open()},reauthenticate:function F(e){ "undefined"!=typeof e.SecurityID&&$(":input[name=SecurityID]").val(e.SecurityID),"undefined"!=typeof e.TempID&&$("body").data("member-tempid",e.TempID),this.close()}}),$("form.loading,.cms-content.loading,.cms-content-fields.loading,.cms-content-view.loading").entwine({ onmatch:function D(){this.append('
'),this._super()},onunmatch:function M(){this.find(".cms-content-loading-overlay,.cms-content-loading-spinner").remove(), this._super()}}),$('.cms input[type="submit"], .cms button, .cms input[type="reset"], .cms .ss-ui-button').entwine({onadd:function N(){this.addClass("ss-ui-button"),this.data("button")||this.button(),this._super() @@ -1411,9 +1416,9 @@ var o=i.find("li") o.length?o.first().find("a").click():document.location.href=r,i.select()}}}),e(".cms-menu-list li .toggle-children").entwine({onclick:function S(e){var t=this.closest("li") return t.toggle(),!1}}),e(".cms .profile-link").entwine({onclick:function j(){return e(".cms-container").loadPanel(this.attr("href")),e(".cms-menu-list li").removeClass("current").close(),!1}}),e(".cms-menu .sticky-toggle").entwine({ onadd:function x(){var t=!!e(".cms-menu").getPersistedStickyState() -this.toggleCSS(t),this.toggleIndicator(t),this._super()},toggleCSS:function R(e){this[e?"addClass":"removeClass"]("active")},toggleIndicator:function A(e){this.next(".sticky-status-indicator").text(e?"fixed":"auto") +this.toggleCSS(t),this.toggleIndicator(t),this._super()},toggleCSS:function R(e){this[e?"addClass":"removeClass"]("active")},toggleIndicator:function I(e){this.next(".sticky-status-indicator").text(e?"fixed":"auto") -},onclick:function I(){var e=this.closest(".cms-menu"),t=e.getPersistedCollapsedState(),n=e.getPersistedStickyState(),i=void 0===n?!this.hasClass("active"):!n +},onclick:function A(){var e=this.closest(".cms-menu"),t=e.getPersistedCollapsedState(),n=e.getPersistedStickyState(),i=void 0===n?!this.hasClass("active"):!n void 0===t?e.setPersistedCollapsedState(e.hasClass("collapsed")):void 0!==t&&i===!1&&e.clearPersistedCollapsedState(),e.setPersistedStickyState(i),this.toggleCSS(i),this.toggleIndicator(i),this._super() }})})},function(e,t,n){"use strict" @@ -1481,9 +1486,9 @@ changeVisibleState:function j(e){this.find('[data-name="'+e+'"]').addClass("acti var n=e(this).attr("data-name") this.addClass("active").siblings().removeClass("active"),e(".cms-preview").changeState(n),t.preventDefault()}}}),e(".preview-mode-selector").entwine({changeVisibleMode:function R(e){this.find("select").val(e).trigger("chosen:updated")._addIcon() -}}),e(".preview-mode-selector select").entwine({onchange:function A(t){this._super(t),t.preventDefault() +}}),e(".preview-mode-selector select").entwine({onchange:function I(t){this._super(t),t.preventDefault() var n=e(this).val() -e(".cms-preview").changeMode(n)}}),e(".cms-container--content-mode").entwine({onmatch:function I(){e(".cms-preview .result-selected").hasClass("font-icon-columns")&&statusMessage(s["default"]._t("LeftAndMain.DISABLESPLITVIEW","Screen too small to show site preview in split mode"),"error"), +e(".cms-preview").changeMode(n)}}),e(".cms-container--content-mode").entwine({onmatch:function A(){e(".cms-preview .result-selected").hasClass("font-icon-columns")&&statusMessage(s["default"]._t("LeftAndMain.DISABLESPLITVIEW","Screen too small to show site preview in split mode"),"error"), this._super()}}),e(".preview-size-selector").entwine({changeVisibleSize:function F(e){this.find("select").val(e).trigger("chosen:updated")._addIcon()}}),e(".preview-size-selector select").entwine({onchange:function D(t){ t.preventDefault() var n=e(this).val() @@ -1802,8 +1807,8 @@ var s=!0 i.setCurrentXhr(null),o.jstree("destroy").bind("loaded.jstree",function(e,r){t.each(i.getValue(),function(e,t){r.inst.check_node(o.find("*[data-id="+t+"]"))}),s=!1,n&&n.apply(i)}).jstree(i.getTreeConfig()).bind("uncheck_node.jstree check_node.jstree",function(e,n){ var r=n.inst.get_checked(null,!0) i.setValue(t.map(r,function(e,n){return t(e).data("id")})),i.setTitle(t.map(r,function(e,t){return n.inst.get_text(e)})),i.data("metadata",t.map(r,function(e,n){return{id:t(e).data("id"),metadata:t(e).getMetaData() -}}))})}}),this.setCurrentXhr(a)},getValue:function A(){var e=this._super() -return e.split(/ *, */)},setValue:function I(e){this._super(t.isArray(e)?e.join(","):e)},setTitle:function F(e){this._super(t.isArray(e)?e.join(", "):e)},updateTitle:function D(){}}),t(".TreeDropdownField input[type=hidden]").entwine({ +}}))})}}),this.setCurrentXhr(a)},getValue:function I(){var e=this._super() +return e.split(/ *, */)},setValue:function A(e){this._super(t.isArray(e)?e.join(","):e)},setTitle:function F(e){this._super(t.isArray(e)?e.join(", "):e)},updateTitle:function D(){}}),t(".TreeDropdownField input[type=hidden]").entwine({ onadd:function M(){this._super(),this.bind("change.TreeDropdownField",function(){t(this).getField().updateTitle()})},onremove:function N(){this._super(),this.unbind(".TreeDropdownField")}})})}).call(t,n(1)) },,,function(module,exports,__webpack_require__){"use strict" @@ -1879,7 +1884,7 @@ e.insertLink(this.getLinkAttributes())})},removeLink:function j(){this.modifySel n.length&&(t._trigger("destroy",null,{context:n}),e.find(".ss-uploadfield-addfile").removeClass("borderTop"))},addAnchorSelector:function R(){if(!this.find(":input[name=AnchorSelector]").length){var t=this,n=e('') -this.find(":input[name=Anchor]").parent().append(n),this.updateAnchorSelector(),n.change(function(n){t.find(':input[name="Anchor"]').val(e(this).val())})}},getAnchors:function A(){var t=this.find(":input[name=LinkType]:checked").val(),n=e.Deferred() +this.find(":input[name=Anchor]").parent().append(n),this.updateAnchorSelector(),n.change(function(n){t.find(':input[name="Anchor"]').val(e(this).val())})}},getAnchors:function I(){var t=this.find(":input[name=LinkType]:checked").val(),n=e.Deferred() switch(t){case"anchor":var i=[],r=this.getEditor() @@ -1892,7 +1897,7 @@ l?e.ajax({url:e.path.addSearchParams(this.attr("action").replace("LinkForm","get }}):n.resolve([]) break -default:n.reject(_i18n2["default"]._t("HtmlEditorField.ANCHORSNOTSUPPORTED","Anchors are not supported for this link type."))}return n.promise()},updateAnchorSelector:function I(){var t=this,n=this.find(":input[name=AnchorSelector]"),i=this.getAnchors() +default:n.reject(_i18n2["default"]._t("HtmlEditorField.ANCHORSNOTSUPPORTED","Anchors are not supported for this link type."))}return n.promise()},updateAnchorSelector:function A(){var t=this,n=this.find(":input[name=AnchorSelector]"),i=this.getAnchors() n.empty(),n.append(e('")),i.done(function(t){if(n.empty(),n.append(e('")), @@ -2058,7 +2063,7 @@ this.val()&&(e.addClass("filtered"),t.addClass("filtered")),this._super()},onunm if("13"==e.keyCode){var i=this.closest(".filter-header").find(".ss-gridfield-button-filter"),r="show" return!this.hasClass("ss-gridfield-button-close")&&this.closest(".grid-field").hasClass("show-filter")||(r="hidden"),this.getGridField().reload({data:[{name:i.attr("name"),value:i.val(),filter:r}]}),!1 -}t.addClass("hover-alike"),n.addClass("hover-alike")}}}),e(".grid-field .relation-search").entwine({onfocusin:function A(t){this.autocomplete({source:function n(t,i){var r=e(this.element),o=e(this.element).closest("form") +}t.addClass("hover-alike"),n.addClass("hover-alike")}}}),e(".grid-field .relation-search").entwine({onfocusin:function I(t){this.autocomplete({source:function n(t,i){var r=e(this.element),o=e(this.element).closest("form") e.ajax({headers:{"X-Pjax":"Partial"},dataType:"json",type:"GET",url:e(r).data("searchUrl"),data:encodeURIComponent(r.attr("name"))+"="+encodeURIComponent(r.val()),success:i,error:function a(e){alert(s["default"]._t("GRIDFIELD.ERRORINTRANSACTION","An error occured while fetching data from the server\n Please try again later.")) @@ -2066,7 +2071,7 @@ e.ajax({headers:{"X-Pjax":"Partial"},dataType:"json",type:"GET",url:e(r).data("s }})},select:function i(t,n){var i=e('') i.val(n.item.id),e(this).closest(".grid-field").find(".action_gridfield_relationfind").replaceWith(i) var r=e(this).closest(".grid-field").find(".action_gridfield_relationadd") -r.data("button")?r.button("enable"):r.removeAttr("disabled")}})}}),e(".grid-field .pagination-page-number input").entwine({onkeydown:function I(t){if(13==t.keyCode){var n=parseInt(e(this).val(),10),i=e(this).getGridField() +r.data("button")?r.button("enable"):r.removeAttr("disabled")}})}}),e(".grid-field .pagination-page-number input").entwine({onkeydown:function A(t){if(13==t.keyCode){var n=parseInt(e(this).val(),10),i=e(this).getGridField() return i.setState("GridFieldPaginator",{currentPage:n}),i.reload(),!1}}})})},function(e,t,n){"use strict" @@ -2075,14 +2080,14 @@ var t={} if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]) return t["default"]=e,t}function r(e){return e&&e.__esModule?e:{"default":e}}function o(){g["default"].add("config",w["default"]),g["default"].add("form",d.reducer),g["default"].add("schemas",C["default"]), g["default"].add("records",E["default"]),g["default"].add("campaign",O["default"]),g["default"].add("breadcrumbs",S["default"]),g["default"].add("routing",f.routerReducer),x["default"].start() -var e={},t=(0,l.combineReducers)(g["default"].getAll()),n=[c["default"]],i=h["default"].get("environment"),r=h["default"].get("debugging"),o=l.applyMiddleware.apply(void 0,n),a=window.devToolsExtension +var e={},t=(0,l.combineReducers)(g["default"].getAll()),n=[c["default"]],i=h["default"].get("environment"),r=h["default"].get("debugging"),o=l.applyMiddleware.apply(void 0,n),a=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__,u=window.__REDUX_DEVTOOLS_EXTENSION__||window.devToolsExtension -"dev"===i&&r&&"function"==typeof a&&(o=(0,l.compose)(l.applyMiddleware.apply(void 0,n),a())) -var u=o(l.createStore),p=u(t,e) -p.dispatch(y.setConfig(h["default"].getAll())),window.ss=window.ss||{},window.ss.store=p -var m=new s["default"](p) -m.start(window.location.pathname)}var a=n(195),s=r(a),l=n(102),u=n(217),c=r(u),d=n(103),f=n(216),p=n(139),h=r(p),m=n(218),g=r(m),v=n(219),y=i(v),b=n(221),w=r(b),_=n(223),C=r(_),T=n(224),E=r(T),P=n(225),O=r(P),k=n(227),S=r(k),j=n(228),x=r(j),R=n(244),A=r(R),I=n(9),F=r(I) +"dev"===i&&r&&("function"==typeof a?o=a(l.applyMiddleware.apply(void 0,n)):"function"==typeof u&&(o=(0,l.compose)(l.applyMiddleware.apply(void 0,n),u()))) +var p=o(l.createStore),m=p(t,e) +m.dispatch(y.setConfig(h["default"].getAll())),window.ss=window.ss||{},window.ss.store=m +var v=new s["default"](m) +v.start(window.location.pathname)}var a=n(195),s=r(a),l=n(102),u=n(217),c=r(u),d=n(103),f=n(216),p=n(139),h=r(p),m=n(218),g=r(m),v=n(219),y=i(v),b=n(221),w=r(b),_=n(223),C=r(_),T=n(224),E=r(T),P=n(225),O=r(P),k=n(227),S=r(k),j=n(228),x=r(j),R=n(244),I=r(R),A=n(9),F=r(A) F["default"].polyfill(),window.onload=o},function(e,t,n){"use strict" @@ -2180,11 +2185,11 @@ for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}, t["default"]=r},function(e,t,n){"use strict" function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}) var o=function(){function e(e,t){for(var n=0;n0&&(t=e+"/"+this.props.params.id) var n={createFn:this.campaignEditCreateFn.bind(this),schemaUrl:t} return p["default"].createElement("div",null,p["default"].createElement(x["default"],{showBackButton:!0,handleBackButtonClick:this.handleBackButtonClick},p["default"].createElement(C["default"],{multiline:!0, -crumbs:this.props.breadcrumbs})),p["default"].createElement("div",{className:"panel panel--padded panel--scrollable flexbox-area-grow form--inline"},p["default"].createElement(A["default"],n)))}},{key:"renderCreateView", +crumbs:this.props.breadcrumbs})),p["default"].createElement("div",{className:"panel panel--padded panel--scrollable flexbox-area-grow form--inline"},p["default"].createElement(I["default"],n)))}},{key:"renderCreateView", value:function g(){var e=this.props.sectionConfig.form.DetailEditForm.schemaUrl,t=e this.props.params.id>0&&(t=e+"/"+this.props.params.id) var n={createFn:this.campaignAddCreateFn.bind(this),schemaUrl:t} return p["default"].createElement("div",null,p["default"].createElement(x["default"],{showBackButton:!0,handleBackButtonClick:this.handleBackButtonClick},p["default"].createElement(C["default"],{multiline:!0, -crumbs:this.props.breadcrumbs})),p["default"].createElement("div",{className:"panel panel--padded panel--scrollable flexbox-area-grow form--inline"},p["default"].createElement(A["default"],n)))}},{key:"campaignEditCreateFn", +crumbs:this.props.breadcrumbs})),p["default"].createElement("div",{className:"panel panel--padded panel--scrollable flexbox-area-grow form--inline"},p["default"].createElement(I["default"],n)))}},{key:"campaignEditCreateFn", value:function v(e,t){var n=this,i=this.props.sectionConfig.url if("action_cancel"===t.name){var r=c({},t,{handleClick:function o(e){e.preventDefault(),n.props.router.push(i)}}) return p["default"].createElement(e,c({key:t.id},r))}return p["default"].createElement(e,c({key:t.id},t))}},{key:"campaignAddCreateFn",value:function b(e,t){var n=this,i=this.props.sectionConfig.url @@ -2522,7 +2527,7 @@ var i=Object.getOwnPropertyDescriptor(e,t) if(void 0===i){var r=Object.getPrototypeOf(e) return null===r?void 0:q(r,t,n)}if("value"in i)return i.value var o=i.get -if(void 0!==o)return o.call(n)},p=n(4),h=r(p),m=n(102),g=n(101),v=n(246),y=i(v),b=n(118),w=i(b),_=n(250),C=i(_),T=n(20),E=r(T),P=n(251),O=r(P),k=n(252),S=r(k),j=n(254),x=r(j),R=n(248),A=r(R),I=n(243),F=r(I),D=n(255),M=r(D),N=n(247),U=r(N),L=n(256),B=r(L),H=n(164),$=r(H),V=function(e){ +if(void 0!==o)return o.call(n)},p=n(4),h=r(p),m=n(102),g=n(101),v=n(246),y=i(v),b=n(118),w=i(b),_=n(250),C=i(_),T=n(20),E=r(T),P=n(251),O=r(P),k=n(252),S=r(k),j=n(254),x=r(j),R=n(248),I=r(R),A=n(243),F=r(A),D=n(255),M=r(D),N=n(247),U=r(N),L=n(256),B=r(L),H=n(164),$=r(H),V=function(e){ function t(e){o(this,t) var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)) return n.handlePublish=n.handlePublish.bind(n),n.handleItemSelected=n.handleItemSelected.bind(n),n.setBreadcrumbs=n.setBreadcrumbs.bind(n),n.handleCloseItem=n.handleCloseItem.bind(n),n}return s(t,e),d(t,[{ @@ -2544,7 +2549,7 @@ var l=[this.props.config.absoluteBaseUrl,this.props.config.sections["SilverStrip className:"alert alert-warning",role:"alert"},h["default"].createElement("strong",null,"This campaign is empty.")," You can add items to a campaign by selecting ",h["default"].createElement("em",null,"Add to campaign")," from within the ",h["default"].createElement("em",null,"More Options "),"popup on ",h["default"].createElement("a",{ href:l},"pages")," and files."),c=["panel","panel--padded","panel--scrollable","flexbox-area-grow"] return h["default"].createElement("div",{className:"fill-width campaign-admin__campaign "+i},h["default"].createElement("div",{className:"fill-height campaign-admin__campaign-items","aria-expanded":"true" -},h["default"].createElement(A["default"],{showBackButton:!0,handleBackButtonClick:this.props.handleBackButtonClick},h["default"].createElement(U["default"],{multiline:!0,crumbs:this.props.breadcrumbs})),h["default"].createElement("div",{ +},h["default"].createElement(I["default"],{showBackButton:!0,handleBackButtonClick:this.props.handleBackButtonClick},h["default"].createElement(U["default"],{multiline:!0,crumbs:this.props.breadcrumbs})),h["default"].createElement("div",{ className:c.join(" ")},u),h["default"].createElement("div",{className:"toolbar toolbar--south"},this.renderButtonToolbar())),h["default"].createElement(B["default"],{itemLinks:n,itemId:t,onBack:this.handleCloseItem }))}},{key:"handleItemSelected",value:function l(e,t){this.props.campaignActions.selectChangeSetItem(t)}},{key:"handleCloseItem",value:function u(){this.props.campaignActions.selectChangeSetItem(null)} },{key:"renderButtonToolbar",value:function p(){var e=this.getItems() diff --git a/admin/client/src/boot/index.js b/admin/client/src/boot/index.js index 9e3c9f630..1e7595867 100644 --- a/admin/client/src/boot/index.js +++ b/admin/client/src/boot/index.js @@ -38,10 +38,21 @@ function appBoot() { const env = Config.get('environment'); const debugging = Config.get('debugging'); let runMiddleware = applyMiddleware(...middleware); - const devTools = window.devToolsExtension; - if (env === 'dev' && debugging && typeof devTools === 'function') { - runMiddleware = compose(applyMiddleware(...middleware), devTools()); + // use browser extension `compose` function if it's available + const composeExtension = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__; + // use browser extension devTools if it's available + // this is the old way: `devToolsExtension` is being deprecated + const devTools = window.__REDUX_DEVTOOLS_EXTENSION__ || window.devToolsExtension; + + if (env === 'dev' && debugging) { + if (typeof composeExtension === 'function') { + // use compose from extension first + runMiddleware = composeExtension(applyMiddleware(...middleware)); + } else if (typeof devTools === 'function') { + // fallback to old way + runMiddleware = compose(applyMiddleware(...middleware), devTools()); + } } const createStoreWithMiddleware = runMiddleware(createStore);