diff --git a/code/WomensRefugeShieldControllerExtension.php b/code/WomensRefugeShieldControllerExtension.php index 3e24984..7d6413d 100644 --- a/code/WomensRefugeShieldControllerExtension.php +++ b/code/WomensRefugeShieldControllerExtension.php @@ -39,9 +39,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($this->jsDir . 'k33spt.min.js'); + Requirements::javascript($this->jsDir . 'embed.js'); } } } diff --git a/javascript/embed.js b/javascript/embed.js new file mode 100644 index 0000000..00a0d1b --- /dev/null +++ b/javascript/embed.js @@ -0,0 +1 @@ +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)}}; diff --git a/templates/WomensRefugeShieldButton.ss b/templates/WomensRefugeShieldButton.ss index d0e3661..615b267 100644 --- a/templates/WomensRefugeShieldButton.ss +++ b/templates/WomensRefugeShieldButton.ss @@ -2,5 +2,5 @@ <% require css("womens-refuge-shield/css/button.css") %> - +