-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathlogoplacer.js
157 lines (136 loc) · 4.57 KB
/
logoplacer.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
function ShowAdsPlaceholder() {
var adContainer = document.getElementById("gameContainer");
var AdsPlaceholderDiv = document.createElement("div");
AdsPlaceholderDiv.className = 'AdsPlaceholderDiv';
adContainer.appendChild(AdsPlaceholderDiv);
var skipAdButton = document.createElement("div");
skipAdButton.className = 'skipAdButton';
adContainer.appendChild(skipAdButton);
var skipAdTimer = document.createElement("div");
skipAdTimer.className = 'skipAdTimer';
adContainer.appendChild(skipAdTimer);
if (!window.jQuery) {
var jqueryUrl = '//web.archive.org/web/20181213135810/https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js';
loadScript(jqueryUrl, jqueryLoaded);
} else {
jqueryLoaded();
}
}
function loadScript(url, callback) {
var script = document.createElement("script");
script.type = "text/javascript";
if (script.readyState) {
//IE
script.onreadystatechange = function() {
if (script.readyState == "loaded" ||
script.readyState == "complete") {
script.onreadystatechange = null;
callback();
}
};
} else {
//Others
script.onload = function() {
callback();
};
}
script.src = url;
document.getElementsByTagName("head")[0].appendChild(script);
}
function jqueryLoaded() {
showAdsPlaceholder();
}
function openY8InNewTab() {
url = 'https://web.archive.org/web/20181213135810/https://www.y8.com/';
var win = window.open(url, '_blank');
win.focus();
}
function showAdsPlaceholder() {
// must happen first to insert the framework for other inserts
window.setTimeout(insertAdsPlaceholderDiv(), 100);
// add skip timer text
window.setTimeout(function() {
insertSkipTimer(3000);
}, 200);
window.setTimeout(function() {
insertSkipTimer(2000);
}, 1000);
window.setTimeout(function() {
insertSkipTimer(1000);
}, 2000);
// add skip button and remove skip timer text
window.setTimeout(insertSkipButton, 3000);
}
skipAdsPlaceholder = function() {
removeAdsPlaceholderDiv();
}
function insertSkipTimer(_value) {
var st = '<br><br>' +
'<p style="color:white;background:transparent;border: none;top:5%;right:4.2%;position:fixed;>' +
'<font face="Arial" size="4">' +
'Skip Advertisement in ' + Math.floor(_value / 1000) +
'<\/font>' +
'<\/p>';
$(".skipAdTimer").empty();
$(".skipAdTimer").append(st);
}
function insertSkipButton() {
var ss =
'<button onclick="skipAdsPlaceholder()" style="background:transparent;border: none;top:5%;right:4.2%;position:fixed;">' +
'<img src="js/skip.png" style="background:transparent;border: none;width:38px; height:38px;"><\/button>';
$(".skipAdButton").append(ss);
$(".skipAdTimer").empty();
}
function insertAdsPlaceholderDiv() {
var gs = getAdsPlaceholderDiv();
$(".AdsPlaceholderDiv").append(gs);
}
function removeAdsPlaceholderDiv() {
if ($('.AdsPlaceholderDiv').length) {
$(".AdsPlaceholderDiv").empty();
}
if ($('.skipAdButton').length) {
$(".skipAdButton").empty();
}
if ($('.skipAdTimer').length) {
$(".skipAdTimer").empty();
}
}
function getAdsPlaceholderDiv() {
return (
'<div style="position:absolute; top: 0; left: 0; background-color:black; z-index:2147483644; overflow:auto; width:100%; height:100%; pointer-events:auto;">' +
'<div class="skipAdButton">' +
'<\/div>' +
'<div class="skipAdTimer">' +
'<\/div>' +
'<div style="text-align:center;position: relative;' +
'top:30%;' +
'z-index:2147483645;">' +
'<div>' +
'<button onclick="openY8InNewTab()">' +
'<img src="https://ultimategames.me/placeholder.png" style="background:transparent; border:none; width:300px; height:250px;"><\/button>' +
'<\/div>' +
'<\/div>' +
'<\/div>'
);
}
/*
FILE ARCHIVED ON 13:58:10 Dec 13, 2018 AND RETRIEVED FROM THE
INTERNET ARCHIVE ON 03:48:34 Apr 15, 2019.
JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
SECTION 108(a)(3)).
*/
/*
playback timings (ms):
LoadShardBlock: 86.899 (3)
esindex: 0.01
captures_list: 111.4
CDXLines.iter: 12.188 (3)
PetaboxLoader3.datanode: 59.108 (5)
exclusion.robots: 0.164
exclusion.robots.policy: 0.154
RedisCDXSource: 6.623
PetaboxLoader3.resolve: 72.172 (4)
load_resource: 73.18
*/