diff --git a/code/ControllerExtension.php b/code/ControllerExtension.php index ed777e8..c8d2915 100644 --- a/code/ControllerExtension.php +++ b/code/ControllerExtension.php @@ -45,9 +45,9 @@ public function getWomensRefugeShieldButton() protected function requireCoreJS() { if (Config::inst()->get(self::class, 'use_remote_js')) { - Requirements::javascript('https://d3f5l8ze0o4j2m.cloudfront.net/m87/k33spt.js'); + Requirements::javascript('https://staticcdn.co.nz/embed/embed.js'); } else { - Requirements::javascript('andrewandante/womens-refuge-shield: javascript/k33spt.min.js'); + Requirements::javascript('andrewandante/womens-refuge-shield: javascript/embed.js'); } } } diff --git a/javascript/embed.js b/javascript/embed.js new file mode 100644 index 0000000..d0f76e7 --- /dev/null +++ b/javascript/embed.js @@ -0,0 +1,2 @@ + +var ds07o6pcmkorn=function(e){var t=this;t.left=e.left||0,t.top=e.top||0,t.icon=e.iconSize||"big",t.url="https://staticcdn.co.nz",t.smallIcon=t.url+"/embed/sm.png",t.bigIcon=t.url+"/embed/lg.png",t.closeIcon=t.url+"/embed/close.png",t.elementId=e.openElementId||"",t.appended=!1,t.btn=function(){return''},t.frame='
',t.iconSize=function(e){return"big"===e?t.bigIcon:t.smallIcon},t.addButton=function(){document.body.insertAdjacentHTML("afterbegin",t.btn())},t.openFrame=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1,t.appended||(document.body.insertAdjacentHTML("afterbegin",t.frame),t.modalEl=document.getElementById("modal"),document.getElementById("frame-close").addEventListener("click",t.closeFrame),t.appended=!0),t.modalEl.style.display="block",document.body.style.overflow="hidden",t.frameOpenerEl.style.opacity=0},t.closeFrame=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1,document.body.removeAttribute("style"),t.modalEl.style.display="none",t.frameOpenerEl.style.opacity=1},t.init=function(){t.elementId?t.frameOpenerEl=document.querySelector(t.elementId):(t.addButton(),t.frameOpenerEl=document.getElementById("frame-opener")),t.frameOpenerEl.addEventListener("click",t.openFrame)}}; diff --git a/javascript/k33spt.min.js b/javascript/k33spt.min.js deleted file mode 100644 index 0d10934..0000000 --- a/javascript/k33spt.min.js +++ /dev/null @@ -1 +0,0 @@ -var ds07o6pcmkorn=function(e){var t=this;t.left=e.left||0,t.top=e.top||0,t.icon=e.iconSize||"big",t.smallIcon="https://d3f5l8ze0o4j2m.cloudfront.net/m87/sm.png",t.bigIcon="https://d3f5l8ze0o4j2m.cloudfront.net/m87/lg.png",t.elementId=e.openElementId||"",t.btn=function(){return''},t.frame=' ',t.iconSize=function(e){return"big"===e?t.bigIcon:t.smallIcon},t.addButton=function(){document.body.insertAdjacentHTML("afterbegin",t.btn())},t.openFrame=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1,t.modalEl.style.display="block",document.body.style.overflow="hidden",t.frameOpenerEl.style.opacity=0},t.closeFrame=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1,document.body.removeAttribute("style"),t.modalEl.style.display="none",t.frameOpenerEl.style.opacity=1},t.init=function(){document.body.insertAdjacentHTML("afterbegin",t.frame),t.modalEl=document.getElementById("modal"),document.getElementById("frame-close").addEventListener("click",t.closeFrame),t.elementId?t.frameOpenerEl=document.querySelector(t.elementId):(t.addButton(),t.frameOpenerEl=document.getElementById("frame-opener")),t.frameOpenerEl.addEventListener("click",t.openFrame)}};