1 2var check_cookie_show = 1; 3$(document).ready(function () { 4 expand(); 5 $(window).scroll(function () { 6 if ($(this).scrollTop()) { 7 $('.menu-icon').fadeOut(); 8 } else { 9// $('.menu-icon').fadeIn(); 10 $('.menu-icon').css({display: "flex"}); 11 } 12 }); 13 $(".icon_search").on('click', function (e) { 14 let status = $(".search-desktop").css('opacity'); 15 if (status == '0' || status == 0) { 16 $(".search-desktop").css({visibility: "visible", opacity: 1}); 17 } else { 18 $(".search-desktop").css({visibility: "hidden", opacity: 0}); 19 } 20 e.stopPropagation(); 21 }) 22 $(".search-desktop").on('click', function (e) { 23 e.stopPropagation(); 24 }) 25 $(document).on('click', function () { 26 $(".search-desktop").css({visibility: "hidden", opacity: 0}); 27 }) 28 $(".icon-menu-mobile").on('click', function () { 29 $(".mobile-dropdown").slideToggle(); 30 }) 31 $('.txt-search').on('keyup', function (e) { 32 let value = $(this).val(); 33 34 if (e.key === 'Enter' || e.keyCode === 13) { 35 if (value.length) { 36 let obj = {}; 37 obj.keywords = value; 38 callLink("search", "search", obj); 39 } 40 } 41 }) 42 43 $(".search-button").on('click', function () { 44 let value = $('.txt-search').val(); 45 if (value.length) { 46 let obj = {}; 47 obj.keywords = value; 48 callLink("search", "search", obj); 49 } 50 }) 51 $(window).on('popstate', function () { 52 let arr_path = ["about-us", "contact-us", "dmca", "error-404", "privacy-policy", "term-of-use"]; 53 let arr_menuheader = ["all-games", "new-games", "hot-games"]; 54 let path_name = location.pathname; 55 let type = ""; 56 let kw; 57 let slug = path_name.split("/")[path_name.split("/").length - 1]; 58 if (arr_path.indexOf(slug) >= 0) { 59 type = "footermenu"; 60 } else { 61 if (path_name == "/") { 62 type = ""; 63 slug = slug_home; 64 } else { 65 type = ""; 66 } 67 } 68 if (type) { 69 callLink(slug, type, object_data = null, false); 70 } else { 71 callGame(slug, false); 72 } 73 }); 74 add_plugin(); 75 76}) 77 78function add_plugin() { 79 let url = "/add-plugin.ajax"; 80 if (typeof id_game != 'undefined' && typeof url_game != 'undefined' && id_game != '' && url_game != '') { 81 $.ajax({ 82 type: "POST", 83 url: url, 84 data: {id: id_game, url: url_game}, 85 success: function (data) { 86 if (data) { 87 let html = JSON.parse(data); 88 if (html.html_rate) { 89 $("#append-rate").html(html.html_rate); 90 } 91 if (html.html_comment) { 92 $("#append-comment").html(html.html_comment); 93 } 94 } 95 } 96 }); 97 } 98} 99 100function expand() { 101 $("#expand").on('click', function () { 102 $("#_exit_full_screen").removeClass('hidden'); 103 $("#iframehtml5").addClass("force_full_screen"); 104 requestFullScreen(document.body); 105 }); 106 $("#_exit_full_screen").on('click', cancelFullScreen); 107} 108function paging(p) { 109 $(".gif").removeClass("hidden"); 110 let url = '/paging.ajax';
111 let current_url = location.origin + location.pathname; 112 $.ajax({ 113 type: "POST", 114 url: url, 115 data: { 116 page: p, 117 keywords: keywords, 118 tags_id: tag_id, 119 category_id: category_id, 120 field_order: field_order, 121 order_type: order_type, 122 is_hot: is_hot, 123 is_new: is_new, 124 limit: limit 125 }, 126 success: function (xxxx) { 127 $("html, body").animate({scrollTop: 0}, 0); 128 $(".gif").addClass("hidden"); 129 if (xxxx !== '') { 130 let data = JSON.parse(xxxx); 131 $("#ajax-append").html(data.content); 132 let site_title = $('title').text(); 133 let checkpage = site_title.search(/\d+/gi); 134 if (checkpage > 0) { 135 site_title = site_title.replace(/\d/gi, p); 136 } else if (p > 1) { 137 site_title += ' - Page ' + p; 138 } 139 $('meta[property="og:site_name"]').attr("content", site_title); 140 $('meta[name="twitter:title"]').attr("content", site_title); 141 $('meta[property="og:title"]').attr("content", site_title); 142 $('title').html(site_title); 143 $('meta[name="title"]').attr("content", site_title); 144 let new_url = current_url + data.url; 145 history.pushState(null, '', new_url); 146 if (ga) { 147 let url_push = new_url.replace(location.origin, ""); 148 if (!url_push) { 149 url_push = "/"; 150 } 151 ga('set', 'page', url_push); 152 ga('send', 'pageview'); 153 } 154 } 155 } 156 }); 157} 158function clickGame(event, game_slug) { 159 event.preventDefault(); 160 try { 161 callGame(game_slug); 162 return; 163 } catch (e) { 164 return; 165 } 166} 167 168function callGame(game_slug, flag = true) { 169 $(".layer-loading").removeClass('hidden'); 170 $.ajax({ 171 url: '/load_game.ajax', 172 type: "POST", 173 data: {slug: game_slug}, 174 success: async function (data, textStatus, jqXHR) { 175 $(".layer-loading").addClass('hidden'); 176 $("html, body").animate({scrollTop: 0}, 0); 177 if (data) { 178 let data_html = JSON.parse(data); 179 await $("#game-page").html(data_html.content); 180 changeMetaTag(data_html.metadata, flag); 181 expand(); 182 add_plugin(); 183 $(".mobile-dropdown").hide(); 184 if (window.__sharethis__) { 185 window.__sharethis__.initialize() 186 } 187 188 } 189 } 190 }) 191} 192 193function clickLink(event, slug, type, flag = true) { 194 event.preventDefault(); 195 try { 196 callLink(slug, type); 197 return true; 198 } catch (e) { 199 return true; 200} 201} 202 203function clickGame(event, game_slug) { 204 event.preventDefault(); 205 try { 206 callGame(game_slug); 207 return true; 208 } catch (e) { 209 return true; 210 } 211} 212 213 214function callLink(slug, type, obj = null, flag = true) { 215 $(".layer-loading").removeClass('hidden'); 216 let url = '/load_game_home.ajax'; 217 if (type == 'footermenu') { 218 url = '/load_footer_ajax.ajax'; 219 } 220 $.ajax({ 221 url: url, 222 type: "POST", 223 data: {slug: slug.toLowerCase(), type: type, object_data: obj}, 224 success: function (data, textStatus, jqXHR) { 225 $(".layer-loading").addClass('hidden'); 226 $("html, body").animate({scrollTop: 0}, 0); 227 if (data) { 228 let data_html = JSON.parse(data); 229 $("#game-page").html(data_html.content); 230 changeMetaTag(data_html.metadata, flag); 231 $(".mobile-dropdown").hide(); 232 if (slug == "contact-us") { 233 runValidate(); 234 } 235 expand(); 236 } 237 } 238 }) 239} 240function changeMetaTag(meta_object, flag = true) { 241 if (typeof meta_object != 'object') { 242 return; 243 } 244 $('title').html(meta_object.site_title); 245 $('meta[name="title"]').attr("content", meta_object.site_title); 246 $('meta[name="description"]').attr("content", meta_object.site_description); 247 $('meta[name="keywords"]').attr("content", meta_object.site_keywords); 248 $('meta[name="news_keywords"]').attr("content", meta_object.site_keywords); 249 $('link[rel="canonical"]').attr("href", meta_object.base_url); 250 $('meta[property="og:title"]').attr("content", meta_object.site_title); 251 $('meta[property="og:url"]').attr("content", meta_object.base_url); 252 $('meta[property="og:description"]').attr("content", meta_object.site_description); 253 $('meta[property="og:image"]').attr("content", meta_object.banner); 254 $('meta[property="og:site_name"]').attr("content", meta_object.site_title); 255 $('meta[name="twitter:title"]').attr("content", meta_object.site_title); 256 $('meta[name="twitter:url"]').attr("content", meta_object.base_url); 257 $('meta[name="twitter:image"]').attr("content", meta_object.banner); 258 $('meta[name="twitter:description"]').attr("content", meta_object.site_description); 259 if (typeof (ga) == 'function') { 260 let url_push = meta_object.base_url.replace(location.origin, ""); 261 if (!url_push) { 262 url_push = "/"; 263 } 264 ga('set', 'page', url_push); 265 ga('send', 'pageview'); 266 } 267 if (flag) 268 history.pushState(null, '', meta_object.base_url); 269} 270function runValidate() { 271 jQuery("#contact-form").validate({ 272 focusInvalid: false, 273 onfocusout: false, 274 ignore: ".ignore", 275 rules: { 276 Name: { 277 required: true,
278 maxlength: 255, 279 }, 280 Email: { 281 required: true, 282 email: true, 283 maxlength: 100 284 }, 285 Website: { 286 required: false, 287 maxlength: 255, 288 }, 289 Topic: { 290 required: false, 291 maxlength: 255, 292 }, 293 Message: { 294 required: true, 295 maxlength: 65525 296 }, 297 "hiddenRecaptcha": { 298 required: function () { 299 if (grecaptcha.getResponse() == '') { 300 return true; 301 } else { 302 return false; 303 } 304 } 305 } 306 }, 307 messages: { 308 Name: { 309 required: "Please type your name!", 310 maxlength: "255" 311 }, 312 Email: { 313 required: "Please type your email!", 314 email: "Please check a valid email!", 315 maxlength: "100" 316 }, 317 Message: { 318 required: "Please type your message!", 319 maxlength: "65525" 320 }, 321 "hiddenRecaptcha": { 322 required: "Please verify you are human!", 323 } 324 }, 325 submitHandler: function () { 326 $("#fcf-button").prop('disabled', true); 327 let question_ajax = "/make-contact.ajax"; 328 let name = jQuery("#Name").val(); 329 let email = jQuery("#Email").val(); 330 let website = jQuery("#Website").val(); 331 let subject = jQuery("#Topic").val(); 332 let message = jQuery("#Message").val(); 333 if (sessionStorage.getItem('contact_message') == message.trim()) { 334 alert("Message not sent with the same content."); 335 return; 336 } 337 let metadataload = {}; 338 metadataload.name = name; 339 metadataload.email = email; 340 metadataload.website = website; 341 metadataload.subject = subject; 342 metadataload.message = message; 343 sessionStorage.setItem('contact_message', message.trim()); 344 jQuery.ajax({ 345 url: question_ajax, 346 data: metadataload, 347 type: 'POST', 348 success: function (data) { 349 if (data != 0 || data != '0') { 350 showSuccessMessage(); 351 } 352 } 353 }); 354 } 355 }); 356} 357function scrollToDiv(element) { 358 if ($(element).length) { 359 $('html,body').animate({scrollTop: $(element).offset().top - 100}, 'slow'); 360 } 361} 362function closeBox() { 363 $(".close-sharing-box").hide(); 364 $(".clipboard-share").addClass("hide-zindex"); 365} 366 367function showSharingBox() { 368 $(".close-sharing-box").show(); 369 $(".clipboard-share").removeClass("hide-zindex"); 370} 371function showSuccessMessage(message) { 372 document.getElementById('fcf-status').innerHTML = ''; 373 document.getElementById('fcf-form').style.display = 'none'; 374 document.getElementById('fcf-thank-you').style.display = 'block'; 375} 376 377function resetFormDemo() { 378 document.getElementById('fcf-form').style.display = "block"; 379 document.getElementById('fcf-thank-you').style.display = "none"; 380} 381 382function copyToClipboard(element) { 383 var $temp = $("<input>"); 384 $("body").append($temp); 385 $temp.val($(element).attr('href')).select(); 386 document.execCommand("copy"); 387 $temp.remove(); 388} 389function requestFullScreen(element) { 390 // Supports most browsers and their versions. 391 var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullScreen; 392 393 if (requestMethod) { // Native full screen. 394 requestMethod.call(element); 395 } else if (typeof window.ActiveXObject !== "undefined") { // Older IE. 396 var wscript = new ActiveXObject("WScript.Shell"); 397 if (wscript !== null) { 398 wscript.SendKeys("{F11}"); 399 } 400 } 401} 402 403function cancelFullScreen() { 404 $("#_exit_full_screen").addClass('hidden'); 405 $("#iframehtml5").removeClass("force_full_screen"); 406 var requestMethod = document.cancelFullScreen || document.webkitCancelFullScreen || document.mozCancelFullScreen || document.exitFullScreenBtn; 407 if (requestMethod) { // cancel full screen. 408 requestMethod.call(document); 409 } else if (typeof window.ActiveXObject !== "undefined") { // Older IE. 410 var wscript = new ActiveXObject("WScript.Shell"); 411 if (wscript !== null) { 412 wscript.SendKeys("{F11}"); 413 } 414 } 415} 416 417if (document.addEventListener) { 418 document.addEventListener('webkitfullscreenchange', exitHandler, false); 419 document.addEventListener('mozfullscreenchange', exitHandler, false); 420 document.addEventListener('fullscreenchange', exitHandler, false); 421 document.addEventListener('MSFullscreenChange', exitHandler, false); 422} 423 424function exitHandler() { 425 if (document.webkitIsFullScreen === false 426 || document.mozFullScreen === false 427 || document.msFullscreenElement === false) { 428 cancelFullScreen(); 429 } 430}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.