@adlad/plugin-coolmathgames
Advanced tools
@@ -1,1 +0,1 @@ | ||
| function coolmathGamesPlugin(){let e=!1,t=!1;const a=new Set;let s,n=!1;function o(){n?parent.cmgGameEvent("replay",s):parent.cmgGameEvent("start",s)}return{name:"coolmathgames",async initialize(s){if(e)throw new Error("CoolmathGames plugin is being initialized more than once");e=!0,document.addEventListener("adBreakStart",(()=>{s.setNeedsPause(!0),s.setNeedsMute(!0),t=!0})),document.addEventListener("adBreakComplete",(()=>{s.setNeedsPause(!1),s.setNeedsMute(!1),a.forEach((e=>e())),a.clear()})),await s.loadScriptTag("https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"),await s.loadScriptTag("https://www.coolmathgames.com/sites/default/files/cmg-ads.js")},manualNeedsPause:!0,manualNeedsMute:!0,async gameplayStart(){o()},async showFullScreenAd(){t=!1;const e=new Promise((e=>{a.add(e)}));cmgAdBreak();const s=document.querySelector(".ads-popup");return s instanceof HTMLElement&&(s.style.overflow="hidden"),await e,t?{didShowAd:!0,errorReason:null}:{didShowAd:!1,errorReason:"time-constraint"}},customRequests:{setCurrentLevel(e,t){s=e,n=t,o()}}}}export{coolmathGamesPlugin}; | ||
| function coolmathGamesPlugin(){let e=!1,a=!1;const t=new Set;let s,n=!1;function o(){n?parent.cmgGameEvent("replay",s):parent.cmgGameEvent("start",s)}return{name:"coolmathgames",async initialize(s){if(e)throw new Error("CoolmathGames plugin is being initialized more than once");e=!0,document.addEventListener("adBreakStart",(()=>{s.setNeedsPause(!0),s.setNeedsMute(!0),a=!0})),document.addEventListener("adBreakComplete",(()=>{s.setNeedsPause(!1),s.setNeedsMute(!1),t.forEach((e=>e())),t.clear()})),await s.loadScriptTag("https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"),await s.loadScriptTag("https://www.coolmathgames.com/sites/default/files/cmg-ads.js")},manualNeedsPause:!0,manualNeedsMute:!0,async gameplayStart(){o()},async showFullScreenAd(){a=!1;const e=new Promise((e=>{t.add(e)}));cmgAdBreak();const s=document.querySelector(".ads-popup");return s instanceof HTMLElement&&(s.style.overflow="hidden"),await e,a?{didShowAd:!0,errorReason:null}:{didShowAd:!1,errorReason:"time-constraint"}},customRequests:{setCurrentLevel(e,a){s=e,n=a,o()}}}}export{coolmathGamesPlugin,coolmathGamesPlugin as default}; |
+1
-0
| export * from "./src/mod.js"; | ||
| export { default } from "./src/mod.js"; |
+1
-1
| { | ||
| "name": "@adlad/plugin-coolmathgames", | ||
| "version": "0.3.1", | ||
| "version": "0.3.2", | ||
| "description": "AdLad plugin for the Coolmath Games sdk.", | ||
@@ -5,0 +5,0 @@ "main": "mod.js", |
7512
0.95%150
0.67%