Remove ads on 1v1.LOL
This commit is contained in:
parent
ac7cc48119
commit
91e44ce19a
|
@ -13,7 +13,6 @@
|
|||
<script>
|
||||
var gameLoaded = false;
|
||||
window.addEventListener("beforeunload", function (e) {
|
||||
if (adsVisible || !gameLoaded || !lockedOccured) return null;
|
||||
var confirmationMessage = "Are you sure you want to leave? ";
|
||||
(e || window.event).returnValue = confirmationMessage; //Gecko + IE
|
||||
return confirmationMessage; //Gecko + Webkit, Safari, Chrome etc.
|
||||
|
@ -86,52 +85,10 @@
|
|||
},
|
||||
});
|
||||
</script>
|
||||
<!-- MIDROLL/INTERSTITIAL VIDEO API -->
|
||||
<script src="js/cpmstar.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="ads">
|
||||
<div class="ad-smallscreen">
|
||||
<div class="ad ad-rectangle-bottom"></div>
|
||||
</div>
|
||||
<div class="ad ad-rectangle-upper" id="adRectangleUpper">
|
||||
<!-- 300X250B PLACEMENT TAG - PLACE INTO BODY (ZONE TAG REQUIRED) -->
|
||||
<script>
|
||||
(function (w, pid) {
|
||||
var r = function (c, m) {
|
||||
c = c.split("").reduce(function (a, b) {
|
||||
return ((a << 5) - a + b.charCodeAt(0)) >>> m;
|
||||
}, 0);
|
||||
return (10 + ((c * 7) % 26)).toString(36) + c.toString(36);
|
||||
},
|
||||
y = r(w.location.href.split("#")[0], 1),
|
||||
c = r(w.location.href.split("#")[0] + pid, 0);
|
||||
w.document.write('<div style="width:300px;height:250px" class="' + c + '"></div>');
|
||||
})(window, 83023);
|
||||
</script>
|
||||
</div>
|
||||
<div class="ad-largescreen">
|
||||
<div class="ad ad-leaderboard-bottom">
|
||||
<!-- 300X600B PLACEMENT TAG - PLACE INTO BODY (ZONE TAG REQUIRED) -->
|
||||
<script>
|
||||
(function (w, pid) {
|
||||
var r = function (c, m) {
|
||||
c = c.split("").reduce(function (a, b) {
|
||||
return ((a << 5) - a + b.charCodeAt(0)) >>> m;
|
||||
}, 0);
|
||||
return (10 + ((c * 7) % 26)).toString(36) + c.toString(36);
|
||||
},
|
||||
y = r(w.location.href.split("#")[0], 1),
|
||||
c = r(w.location.href.split("#")[0] + pid, 0);
|
||||
w.document.write('<div style="width:300px;height:600px" class="' + c + '"></div>');
|
||||
})(window, 85420);
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div id="interAdsContainer" style="display: none;"></div> -->
|
||||
<div id="gameContainer"></div>
|
||||
<div id="loader">
|
||||
<img class="logo" src="logo.png" />
|
||||
|
@ -222,55 +179,6 @@
|
|||
|
||||
var refreshNextTime = true;
|
||||
|
||||
function showAds() {
|
||||
document.getElementsByClassName("ad-rectangle-bottom")[0].style.display = "block";
|
||||
document.getElementsByClassName("ad-leaderboard-bottom")[0].style.display = "block";
|
||||
document.getElementById("adRectangleUpper").style.display = "block";
|
||||
|
||||
if (typeof counter === "undefined") {
|
||||
startCounter();
|
||||
resumeCounter();
|
||||
} else {
|
||||
resumeCounter();
|
||||
refresh();
|
||||
}
|
||||
}
|
||||
|
||||
function hideAds() {
|
||||
document.getElementsByClassName("ad-rectangle-bottom")[0].style.display = "none";
|
||||
document.getElementsByClassName("ad-leaderboard-bottom")[0].style.display = "none";
|
||||
document.getElementById("adRectangleUpper").style.display = "none";
|
||||
|
||||
pauseCounter();
|
||||
}
|
||||
|
||||
// hide ads
|
||||
hideAds();
|
||||
|
||||
function refresh() {
|
||||
//console.log("time since ads refresh = " + timeSinceRefresh + " seconds");
|
||||
//console.log("time ads visible = " + timeAdsVisible + " seconds");
|
||||
|
||||
if (timeSinceRefresh <= 30 || timeAdsVisible <= 2) {
|
||||
//console.log("don't refresh");
|
||||
return;
|
||||
}
|
||||
|
||||
if (document.getElementById("adRectangleBottom") != null && window.getComputedStyle(document.getElementsByClassName("ad-smallscreen")[0]).display != "none") {
|
||||
cpmstarAPI({ kind: "adcmd", module: "POOL 83023", command: "refresh" });
|
||||
}
|
||||
|
||||
if (document.getElementById("adLeaderboardBottom") != null && window.getComputedStyle(document.getElementsByClassName("ad-largescreen")[0]).display != "none") {
|
||||
cpmstarAPI({ kind: "adcmd", module: "POOL 85420", command: "refresh" });
|
||||
}
|
||||
|
||||
cpmstarAPI({ kind: "adcmd", module: "POOL 83025", command: "refresh" });
|
||||
|
||||
timeSinceRefresh = 0;
|
||||
timeAdsVisible = 0;
|
||||
//console.log("refresh ads");
|
||||
}
|
||||
|
||||
window.onfocus = function () {
|
||||
//console.log("onfocus");
|
||||
resumeCounter();
|
||||
|
@ -283,26 +191,16 @@
|
|||
};
|
||||
|
||||
var timeSinceRefresh = 0;
|
||||
var timeAdsVisible = 0;
|
||||
var counter;
|
||||
var adsVisible = false;
|
||||
|
||||
function startCounter() {
|
||||
timeSinceRefresh++;
|
||||
if (adsVisible) timeAdsVisible++;
|
||||
|
||||
counter = setTimeout(function () {
|
||||
startCounter();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
function resumeCounter() {
|
||||
adsVisible = true;
|
||||
}
|
||||
|
||||
function pauseCounter() {
|
||||
adsVisible = false;
|
||||
}
|
||||
</script>
|
||||
<!-- Firebase App (the core Firebase SDK) is always required and must be listed first -->
|
||||
<script src="firebase/firebase-app.js"></script>
|
||||
|
@ -341,4 +239,4 @@
|
|||
fixMacUserAgent();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user