PageSourceSearch

https://onlyuponline.io/themes/onlyuponline.io/rs/js/script.js

js onlyuponline.io collected 2026-10-04 13:26:36 UTC 9,870 bytes, 251 lines download raw bytes

1var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{
2let window = _____WB$wombat$assign$function_____("window");
3let self = _____WB$wombat$assign$function_____("self");
4let document = _____WB$wombat$assign$function_____("document");
5let location = _____WB$wombat$assign$function_____("location");
6let top = _____WB$wombat$assign$function_____("top");
7let parent = _____WB$wombat$assign$function_____("parent");
8let frames = _____WB$wombat$assign$function_____("frames");
9let opens = _____WB$wombat$assign$function_____("opens");
10$("#expand").on('click', function () {
11    $("#iframehtml5").addClass("force_full_screen");
12    $("#_exit_full_screen").removeClass('hidden');
13    requestFullScreen(document.body);
14});
15
16$("#_exit_full_screen").on('click', cancelFullScreen);
17
18function requestFullScreen(element) {
19    $(".header-game").removeClass("header_game_enable_half_full_screen");
20    $("#iframehtml5").removeClass("force_half_full_screen");
21    // Supports most browsers and their versions.
22    var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullScreen;
23    if (requestMethod) { // Native full screen.
24        requestMethod.call(element);
25    } else if (typeof window.ActiveXObject !== "undefined") { // Older IE.
26        var wscript = new ActiveXObject("WScript.Shell");
27        if (wscript !== null) {
28            wscript.SendKeys("{F11}");
29        }
30    }
31}
32
33function cancelFullScreen() {
34    $("#_exit_full_screen").addClass('hidden');
35    $("#iframehtml5").removeClass("force_full_screen");
36    $(".header-game").removeClass("force_full_screen header_game_enable_half_full_screen");
37    $("#iframehtml5").removeClass("force_half_full_screen");
38    var requestMethod = document.cancelFullScreen || document.webkitCancelFullScreen || document.mozCancelFullScreen || document.exitFullScreenBtn;
39    if (requestMethod) { // cancel full screen.
40        requestMethod.call(document);
41    } else if (typeof window.ActiveXObject !== "undefined") { // Older IE.
42        var wscript = new ActiveXObject("WScript.Shell");
43        if (wscript !== null) {
44            wscript.SendKeys("{F11}");
45        }
46    }
47}
48if (document.addEventListener) {
49    document.addEventListener('webkitfullscreenchange', exitHandler, false);
50    document.addEventListener('mozfullscreenchange', exitHandler, false);
51    document.addEventListener('fullscreenchange', exitHandler, false);
52    document.addEventListener('MSFullscreenChange', exitHandler, false);
53}
54
55function exitHandler() {
56    if (document.webkitIsFullScreen === false ||
57        document.mozFullScreen === false ||
58        document.msFullscreenElement === false) {
59        cancelFullScreen();
60    }
61}
62
63function theaterMode() {
64    let iframe = document.querySelector("#iframehtml5");
65    if (iframe.classList.contains("force_half_full_screen")) {
66        iframe.classList.remove("force_half_full_screen")
67        document.querySelector(".header-game").classList.remove("header_game_enable_half_full_screen")
68        return;
69    }
70    let above = 0;
71    let left = 0;
72    let below = $(".header-game").outerHeight();
73    // let right = 0;
74    // let width = window.innerWidth;
75    // let height = window.innerHeight;
76    if (!document.querySelector("#style-append")) {
77        let styleElement = document.createElement("style");
78        styleElement.type = "text/css";
79        styleElement.setAttribute('id', "style-append");
80        let cssCode = `
81    .force_half_full_screen{
82    position: fixed!important;
83    top: 0!important;
84    left: 0!important;
85    z-index: 887!important;
86    top:${above}px!important;
87    left:${left}px!important;
88    width:calc(100% - ${left}px)!important;
89    height:calc(100% - ${above + below}px)!important;
90    background-color:#000;
91    }
92    .header_game_enable_half_full_screen{
93        position:fixed;
94        left:${left}px!important;
95        bottom:0!important;
96        right:0!important;
97        z-index:887!important;
98        width:calc(100% - ${left}px)!important;
99        padding-left:10px;
100        padding-right:10px;
101        border-radius:0!important;
102    }
103    @media (max-width: 1364px){
104        .force_half_full_screen{
105            left:0!important;
106            width:100%!important;
107        }
108        .header_game_enable_half_full_screen{
109            width:100%!important;
110            left:0!important;
111        }
112    }`
113        styleElement.innerHTML = cssCode;
114        document.querySelector('head').appendChild(styleElement);
115    }
116    iframe.classList.add("force_half_full_screen")
117    document.querySelector(".header-game").classList.add("header_game_enable_half_full_screen")
118}
119
120// ============================ sidebar.php ================================= 
121$('.navbar-menu-li-dropdown').click(function () {
122    let id = $(this).attr('data-id');
123    for (let div of $(".navbar-menu-list")) {
124        let divid = [];
125        divid = div.id;
126        if (divid != id) {
127            $(div).animate({ height: 'hide' }, 250); //show/hide/toggle
128        }
129    }
130    $(`.navbar-menu-list[id="${id}"]`).slideToggle(250);
131})
132
133
134// btnroot: Open/Close sidebar
135$(".btnroot").click(function () {
136    let display = $('.navbar-game').css('display');
137    if (display == 'none') {
138        $('.navbar-game').animate({ width: 'toggle' }, 140);
139        $(this).html('<svg class="btnroot-icon" viewBox="0 0 24 24" focusable="false" aria-hidden="true"><path xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" d="M19 4C19.5523 4 20 3.55229 20 3C20 2.44772 19.5523 2 19 2L3 2C2.44772 2 2 2.44772 2 3C2 3.55228 2.44772 4 3 4L19 4ZM20.47 7.95628L15.3568 11.152C14.7301 11.5437 14.7301 12.4564 15.3568 12.848L20.47 16.0438C21.136 16.4601 22 15.9812 22 15.1958V8.80427C22 8.01884 21.136 7.54 20.47 7.95628ZM11 13C11.5523 13 12 12.5523 12 12C12 11.4477 11.5523 11 11 11L3 11C2.44771 11 2 11.4477 2 12C2 12.5523 2.44771 13 3 13L11 13ZM20 21C20 21.5523 19.5523 22 19 22L3 22C2.44771 22 2 21.5523 2 21C2 20.4477 2.44771 20 3 20L19 20C19.5523 20 20 20.4477 20 21Z"></path></svg>');
140    } else if (display == 'block') {
141        $('.navbar-game').animate({ width: 'toggle' }, 140);
142        $(this).html('<svg class="btnroot-icon" viewBox="0 0 24 24" focusable="false" aria-hidden="true"><path xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" d="M21 4C21.5523 4 22 3.55229 22 3C22 2.44772 21.5523 2 21 2L5 2C4.44772 2 4 2.44772 4 3C4 3.55228 4.44772 4 5 4L21 4ZM3.53 16.0438L8.6432 12.848C9.26987 12.4563 9.26987 11.5437 8.6432 11.152L3.53 7.95625C2.86395 7.53997 2 8.01881 2 8.80425V15.1958C2 15.9812 2.86395 16.46 3.53 16.0438ZM21 13C21.5523 13 22 12.5523 22 12C22 11.4477 21.5523 11 21 11L13 11C12.4477 11 12 11.4477 12 12C12 12.5523 12.4477 13 13 13L21 13ZM22 21C22 21.5523 21.5523 22 21 22L5 22C4.44771 22 4 21.5523 4 21C4 20.4477 4.44771 20 5 20L21 20C21.5523 20 22 20.4477 22 21Z"></path></svg>');
143    }
144})
145
146// ============================ search ================================= 
147$('.header-btn').on('click', function () {
148    gameSearch()
149})
150
151$('#myInput').on('keyup', function (e) {
152    if (e.key === 'Enter' || e.keyCode === 13) {
153        gameSearch()
154    }
155})
156function gameSearch() {
157    // console.log("OLD "+oldValue);
158    let keywords = $("#myInput").val();
159    var rex_rule = /[ \-\.?:\\\/\_\'\*]+/g;
160    var value1 = keywords.replace(rex_rule, "-").trim().toLowerCase();
161    var url = '/search/' + value1;
162    if (value1 && oldValue != value1) {
163        oldValue = value1;
164        window.location.href = url;
165    }
166}
167
168// ============================ click pagination.php + show gif loading 
169function paging(p) {
170    $(".loading_mask").removeClass("hidden-load");
171    if (!p) {
172        p = 1;
173    }
174    let url = "/paging.ajax";
175    $.ajax({
176        url: url,
177        type: "POST",
178        data: {
179            p: p,
180            keywords: keywords,
181            field_order: field_order,
182            order_type: order_type,
183            category_id: category_id,
184            // is_hot: is_hot,
185            // is_new: is_new,
186            tags_id: tags_id,
187            limit: limit,
188        },
189        success: function (response) {
190            $(".loading_mask").addClass("hidden-load");
191            $('html, body').animate({
192                scrollTop: $(".main-title").offset().top
193            }, 1000);
194            if (response) {
195                $("#ajax-append").html(response);
196            }
197        }
198    })
199}
200
201$(document).ready(function () {
202    addPlugin(); // ajax full_rate + comment
203
204
205    if (enable_ads) {
206        let head_tag = document.querySelector('head');
207        let css_ads = '<link rel="stylesheet" href="' + theme_url + 'rs/css/ads.css"></link>'
208        head_tag.insertAdjacentHTML("beforeend", css_ads);
209    }
210})
211
212// ajax full_rate + comment
213function addPlugin() {
214    if (!id_game && !url_game) {
215        return
216    }
217    let url = "/add-plugin.ajax";
218    $.ajax({
219        url: url,
220        type: "POST",
221        data: {
222            id_game: id_game,
223            url_game: url_game,
224        },
225        success: function (response) {
226            if (response) {
227                let data = JSON.parse(response);
228                $("#append-rate").html(data.rate);
229                $("#append-comment").html(data.comment);
230            }
231        }
232    })
233}
234
235// ================================= back-to-top 
236window.onload = function () {
237    $(window).scroll(function () {
238        if ($(this).scrollTop()) {
239            $('#back-to-top').fadeIn();
240
241        } else {
242            $('#back-to-top').fadeOut();
243        }
244    });
245    $("#back-to-top").click(function () {
246        $("html, body").animate({
247            scrollTop: 0
248        }, 300);
249    });
250}
251}

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.