From 49c85c3dba5512af487d36a5378ceaea77a8eb2a Mon Sep 17 00:00:00 2001 From: Josh Crawford Date: Sun, 26 Jul 2020 22:36:53 +1000 Subject: [PATCH] Fix JS error in Safari --- src/resources/dist/js/smith.js | 2 +- src/resources/dist/js/smith.js.map | 2 +- src/resources/src/js/smith.js | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/resources/dist/js/smith.js b/src/resources/dist/js/smith.js index 1ad122b..cbdc84a 100644 --- a/src/resources/dist/js/smith.js +++ b/src/resources/dist/js/smith.js @@ -1,2 +1,2 @@ -void 0===Craft.Smith&&(Craft.Smith={}),function(t){Craft.Smith.Init=Garnish.Base.extend({init:function(a){Garnish.requestAnimationFrame(t.proxy((function(){for(var a=Garnish.$doc.find(".matrix-field"),e=0;e .blocks > .matrixblock"),s=0;s .blocks > .matrixblock"),n=t(a.$block),s,o=n.find(".actions .settings.menubtn").data("menubtn")||!1;o?new Craft.Smith.Menu(e,n,i,o):this.blockAdded(a)}),this))}}),Craft.Smith.Menu=Garnish.Base.extend({init:function(a,e,i,n){this.$matrixField=a,this.$matrixBlock=e,this.$matrixBlocks=i,this.menuBtn=n,this.menu=n.menu;var s=this.menu.$container.find('a[data-action="delete"]').parents("li");this.$copyBtn=t(''+Craft.t("app","Copy")+""),this.$pasteBtn=t(''+Craft.t("app","Paste")+""),this.$cloneBtn=t(''+Craft.t("app","Clone")+""),this.$copyBtn.insertBefore(s).wrap("
  • "),this.$pasteBtn.insertBefore(s).wrap("
  • "),this.$cloneBtn.insertBefore(s).wrap("
  • "),t('
    ').insertBefore(s),this.menu.addOptions(this.$copyBtn),this.menu.addOptions(this.$pasteBtn),this.menu.addOptions(this.$cloneBtn),this.menu.on("optionselect",t.proxy(this,"onOptionSelect")),this.menu.on("show",t.proxy(this,"onMenuShow")),this.checkPaste()},onMenuShow:function(t){this.checkPaste()},onOptionSelect:function(a){var e=t(a.selectedOption);e.hasClass("disabled")||e.hasClass("sel")||("copy"==e.data("action")&&this.copyBlock(a),"paste"==e.data("action")&&this.pasteBlock(a),"clone"==e.data("action")&&this.cloneBlock(a))},checkPaste:function(){var t=!1;try{var a=JSON.parse(localStorage.getItem("smith:block")),e=this.$matrixField.attr("id");a&&e.includes("fields-"+a.field)&&(t=!0)}catch(t){}t?this.$pasteBtn.enable():this.$pasteBtn.disable()},copyBlock:function(t){var a=this._serializeBlocks();localStorage.setItem("smith:block",JSON.stringify(a));var e=a.blocks.length,i=1==e?"1 block copied":"{n} blocks copied";Craft.cp.displayNotice(Craft.t("app",i,{n:e})),this.checkPaste()},pasteBlock:function(a,e){try{if(!e)var e=JSON.parse(localStorage.getItem("smith:block"));var i=this.$matrixField.find(".blocks"),n=t('
    ').insertAfter(this.$matrixBlock),s=this.$matrixField.data("matrix"),o=null;this.$matrixBlocks.each(t.proxy((function(a,e){if(this.$matrixBlock.data("id")==t(e).data("id")){var i=this.$matrixBlocks[a+1];if(i)return o=t(i)}}),this)),Craft.postActionRequest("smith/field/render-matrix-blocks",e,t.proxy((function(t,a){if("success"===a&&t.success)for(var e=0;e1){var c={};for(var l in s){var d=l.replace(/^fields.+?(?<=fields])/gm,"fields");t.namespace=l.match(/^fields.+?(?<=fields])/gm)[0],c[d]=s[l]}var h=Craft.expandPostArray(c)}else var h=Craft.expandPostArray(s);var p=h.fields;for(var f in p)for(var m in t.field=f,p[f].blocks){var k=p[f].blocks[m];t.blocks.push(k)}}return t}})}(jQuery); +void 0===Craft.Smith&&(Craft.Smith={}),function(t){Craft.Smith.Init=Garnish.Base.extend({init:function(a){Garnish.requestAnimationFrame(t.proxy((function(){for(var a=Garnish.$doc.find(".matrix-field"),e=0;e .blocks > .matrixblock"),s=0;s .blocks > .matrixblock"),n=t(a.$block),s,o=n.find(".actions .settings.menubtn").data("menubtn")||!1;o?new Craft.Smith.Menu(e,n,i,o):this.blockAdded(a)}),this))}}),Craft.Smith.Menu=Garnish.Base.extend({init:function(a,e,i,n){this.$matrixField=a,this.$matrixBlock=e,this.$matrixBlocks=i,this.menuBtn=n,this.menu=n.menu;var s=this.menu.$container.find('a[data-action="delete"]').parents("li");this.$copyBtn=t(''+Craft.t("app","Copy")+""),this.$pasteBtn=t(''+Craft.t("app","Paste")+""),this.$cloneBtn=t(''+Craft.t("app","Clone")+""),this.$copyBtn.insertBefore(s).wrap("
  • "),this.$pasteBtn.insertBefore(s).wrap("
  • "),this.$cloneBtn.insertBefore(s).wrap("
  • "),t('
    ').insertBefore(s),this.menu.addOptions(this.$copyBtn),this.menu.addOptions(this.$pasteBtn),this.menu.addOptions(this.$cloneBtn),this.menu.on("optionselect",t.proxy(this,"onOptionSelect")),this.menu.on("show",t.proxy(this,"onMenuShow")),this.checkPaste()},onMenuShow:function(t){this.checkPaste()},onOptionSelect:function(a){var e=t(a.selectedOption);e.hasClass("disabled")||e.hasClass("sel")||("copy"==e.data("action")&&this.copyBlock(a),"paste"==e.data("action")&&this.pasteBlock(a),"clone"==e.data("action")&&this.cloneBlock(a))},checkPaste:function(){var t=!1;try{var a=JSON.parse(localStorage.getItem("smith:block")),e=this.$matrixField.attr("id");a&&e.includes("fields-"+a.field)&&(t=!0)}catch(t){}t?this.$pasteBtn.enable():this.$pasteBtn.disable()},copyBlock:function(t){var a=this._serializeBlocks();localStorage.setItem("smith:block",JSON.stringify(a));var e=a.blocks.length,i=1==e?"1 block copied":"{n} blocks copied";Craft.cp.displayNotice(Craft.t("app",i,{n:e})),this.checkPaste()},pasteBlock:function(a,e){try{if(!e)var e=JSON.parse(localStorage.getItem("smith:block"));var i=this.$matrixField.find(".blocks"),n=t('
    ').insertAfter(this.$matrixBlock),s=this.$matrixField.data("matrix"),o=null;this.$matrixBlocks.each(t.proxy((function(a,e){if(this.$matrixBlock.data("id")==t(e).data("id")){var i=this.$matrixBlocks[a+1];if(i)return o=t(i)}}),this)),Craft.postActionRequest("smith/field/render-matrix-blocks",e,t.proxy((function(t,a){if("success"===a&&t.success)for(var e=0;e1){var c={};for(var l in s){console.log(l);var d=l.replace(/^fields.+?(fields])/gm,"fields");t.namespace=l.match(/^fields.+?(fields])/gm)[0],c[d]=s[l]}var h=Craft.expandPostArray(c)}else var h=Craft.expandPostArray(s);var p=h.fields;for(var f in p)for(var m in t.field=f,p[f].blocks){var k=p[f].blocks[m];t.blocks.push(k)}}return t}})}(jQuery); //# sourceMappingURL=smith.js.map \ No newline at end of file diff --git a/src/resources/dist/js/smith.js.map b/src/resources/dist/js/smith.js.map index 7436f5c..2f4012d 100644 --- a/src/resources/dist/js/smith.js.map +++ b/src/resources/dist/js/smith.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../src/js/smith.js"],"names":["Craft","Smith","$","Init","Garnish","Base","extend","init","options","requestAnimationFrame","proxy","$matrixFields","$doc","find","i","length","$matrixField","$matrixBlocks","j","$matrixBlock","$settingsBtn","menuBtn","data","Menu","on","MatrixInput","this","SuperTable","MatrixInputAlt","blockAdded","e","target","$container","$block","menu","$deleteOption","parents","$copyBtn","t","$pasteBtn","$cloneBtn","insertBefore","wrap","addOptions","checkPaste","onMenuShow","onOptionSelect","$option","selectedOption","hasClass","copyBlock","pasteBlock","cloneBlock","canPaste","JSON","parse","localStorage","getItem","fieldHandle","attr","includes","field","enable","disable","_serializeBlocks","setItem","stringify","count","blocks","message","cp","displayNotice","n","$blockContainer","$spinner","insertAfter","matrixField","$insertBefore","each","index","element","nextBlock","postActionRequest","response","textStatus","success","block","originalBlock","blockTypesByHandle","typeHandle","$newBlock","addBlock","remove","namespace","$selectedItems","blockSelect","$blockItem","postData","getPostData","levelsDeep","isNested","parsedPostData","paramHandle","parsedHandle","replace","match","params","expandPostArray","fields","blockId","push","jQuery"],"mappings":"KAO2B,IAAhBA,MAAMC,QACbD,MAAMC,MAAQ,IAGlB,SAAUC,GAEVF,MAAMC,MAAME,KAAOC,QAAQC,KAAKC,OAAO,CACnCC,KAAM,SAASC,GACXJ,QAAQK,sBAAsBP,EAAEQ,OAAM,WAGlC,IAFA,IAAIC,EAAgBP,QAAQQ,KAAKC,KAAK,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YAAYD,eAExCA,EAAe/E,SAChB+E,EAAiB,CAACpE,KAAKP,eAG3B,IAAK,IAAIL,EAAI,EAAGA,EAAIgF,EAAe/E,OAAQD,IAAK,CAC5C,IAAIkF,EAAaF,EAAehF,GAE5BmF,EAAW7F,QAAQ8F,YAAYF,GAK/BG,EACAC,EAEJ,GAHiBJ,EAAW5D,QAAQ,UAAUrB,OACjB,EAEf,CACV,IAAIsF,EAAiB,GAErB,IAAK,IAAIC,KAAeL,EAAU,CAC9B,IAAIM,EAAeD,EAAYE,QAAQ,2BAA4B,UAGnElF,EAAKuE,UAAYS,EAAYG,MAAM,4BAA4B,GAE/DJ,EAAeE,GAAgBN,EAASK,GAG5C,IAAII,EAAS1G,MAAM2G,gBAAgBN,QAEnC,IAAIK,EAAS1G,MAAM2G,gBAAgBV,GAGvC,IAAIW,EAASF,EAAOE,OAEpB,IAAK,IAAIlD,KAAekD,EAGpB,IAAK,IAAIC,KAFTvF,EAAKuC,MAAQH,EAEOkD,EAAOlD,GAAaU,OAAQ,CAC5C,IAAIkB,EAAQsB,EAAOlD,GAAaU,OAAOyC,GAEvCvF,EAAK8C,OAAO0C,KAAKxB,IAK7B,OAAOhE,KAnQf,CAyQGyF"} \ No newline at end of file +{"version":3,"sources":["../../src/js/smith.js"],"names":["Craft","Smith","$","Init","Garnish","Base","extend","init","options","requestAnimationFrame","proxy","$matrixFields","$doc","find","i","length","$matrixField","$matrixBlocks","j","$matrixBlock","$settingsBtn","menuBtn","data","Menu","on","MatrixInput","this","SuperTable","MatrixInputAlt","blockAdded","e","target","$container","$block","menu","$deleteOption","parents","$copyBtn","t","$pasteBtn","$cloneBtn","insertBefore","wrap","addOptions","checkPaste","onMenuShow","onOptionSelect","$option","selectedOption","hasClass","copyBlock","pasteBlock","cloneBlock","canPaste","JSON","parse","localStorage","getItem","fieldHandle","attr","includes","field","enable","disable","_serializeBlocks","setItem","stringify","count","blocks","message","cp","displayNotice","n","$blockContainer","$spinner","insertAfter","matrixField","$insertBefore","each","index","element","nextBlock","postActionRequest","response","textStatus","success","block","originalBlock","blockTypesByHandle","typeHandle","$newBlock","addBlock","remove","namespace","$selectedItems","blockSelect","$blockItem","postData","getPostData","levelsDeep","isNested","parsedPostData","paramHandle","console","log","parsedHandle","replace","match","params","expandPostArray","fields","blockId","push","jQuery"],"mappings":"KAO2B,IAAhBA,MAAMC,QACbD,MAAMC,MAAQ,IAGlB,SAAUC,GAEVF,MAAMC,MAAME,KAAOC,QAAQC,KAAKC,OAAO,CACnCC,KAAM,SAASC,GACXJ,QAAQK,sBAAsBP,EAAEQ,OAAM,WAGlC,IAFA,IAAIC,EAAgBP,QAAQQ,KAAKC,KAAK,iBAE7BC,EAAI,EAAGA,EAAIH,EAAcI,OAAQD,IAItC,IAHA,IAAIE,EAAed,EAAES,EAAcG,IAC/BG,EAAgBD,EAAaH,KAAK,4BAE7BK,EAAI,EAAGA,EAAID,EAAcF,OAAQG,IAAK,CAC3C,IAAIC,EAAejB,EAAEe,EAAcC,IAC/BE,EACAC,EADeF,EAAaN,KAAK,8BACVS,KAAK,aAAc,EAE9C,IAAKD,EACD,OAIJ,IAAIrB,MAAMC,MAAMsB,KAAKP,EAAcG,EAAcF,EAAeI,GAKxEjB,QAAQoB,GAAGxB,MAAMyB,YAAa,aAAcvB,EAAEQ,MAAMgB,KAAM,eAGtD1B,MAAM2B,YAAc3B,MAAM2B,WAAWC,gBACrCxB,QAAQoB,GAAGxB,MAAM2B,WAAWC,eAAgB,aAAc1B,EAAEQ,MAAMgB,KAAM,iBAE7EA,QAGPG,WAAY,SAASC,GACjB1B,QAAQK,sBAAsBP,EAAEQ,OAAM,WAClC,IAAIM,EAAec,EAAEC,OAAOC,WACxBf,EAAgBD,EAAaH,KAAK,4BAClCM,EAAejB,EAAE4B,EAAEG,QAEnBb,EACAC,EADeF,EAAaN,KAAK,8BACVS,KAAK,aAAc,EAGzCD,EAKL,IAAIrB,MAAMC,MAAMsB,KAAKP,EAAcG,EAAcF,EAAeI,GAJ5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/resources/src/js/smith.js index 1dd69dc..5a5a798 100644 --- a/src/resources/src/js/smith.js +++ b/src/resources/src/js/smith.js @@ -242,10 +242,11 @@ Craft.Smith.Menu = Garnish.Base.extend({ var parsedPostData = {}; for (var paramHandle in postData) { - var parsedHandle = paramHandle.replace(/^fields.+?(?<=fields])/mg, 'fields'); + console.log(paramHandle) + var parsedHandle = paramHandle.replace(/^fields.+?(fields])/mg, 'fields'); // Save the namespace for later; - data.namespace = paramHandle.match(/^fields.+?(?<=fields])/mg)[0]; + data.namespace = paramHandle.match(/^fields.+?(fields])/mg)[0]; parsedPostData[parsedHandle] = postData[paramHandle]; }