PageSourceSearch

https://www.naydizdes.com/user-content/uploads/cache/custom.js?v=1786206444

js naydizdes.com collected 2026-10-04 11:00:07 UTC 14,138 bytes, 387 lines download raw bytes

1function changeNzVids() {
2            // Select all matching divs and loop through them
3            const naydiDivs = document.getElementsByClassName('naydizdes-app-install');
4            for (const div of naydiDivs) {
5               div.innerHTML = '<video width="300" height="660" controls preload="none" poster="/user-content/my/naydizdes-app-intruksiya_1.png"><source src="/user-content/my/naydizdes-app-install.mp4" type="video/mp4">Your browser does not support the video tag.</video>'; 
6            }
7        }
8
9
10function showIsPWA(){
11return false;
12
13// 1. Create a new div element
14        const customDiv = document.createElement('div');
15
16        // 2. Customize the new div
17        customDiv.id = 'myCustomDiv';
18        customDiv.className = 'custom-style';
19        customDiv.textContent = 'isPWA:'+(isPWA()?'true':'false');
20
21        // 3. Append the new div to the body
22        document.body.appendChild(customDiv);
23
24}
25
26function isPWA() {
27  // Check for modern browsers with display-mode media feature
28  if (window.matchMedia('(display-mode: standalone)').matches) {
29console.log('isPWA:(display-mode: standalone):true');
30    return true;
31  }
32
33  // Check for older iOS Safari
34  if ('standalone' in navigator && navigator.standalone) {
35console.log('isPWA:navigator.standalone:true');
36    return true;
37  }
38
39  // Otherwise, not a PWA
40console.log('isPWA:no');
41  return false;
42}
43
44
45
46function setAnl() {
47    /* Google tag GA4 / UA(gtag.js) */
48    setTimeout(function () { /*var id='UA-264031-19';*/ var id = 'G-RNXRYBKX9Y';
49        var s = document.createElement('script');
50        s.type = 'text/javascript';
51        s.async = 'async ';
52        s.crossorigin = 'anonymous';
53        s.src = 'https://www.googletagmanager.com/gtag/js?id=' + id;
54        document.getElementsByTagName("head")[0].appendChild(s);
55        window.dataLayer = window.dataLayer || [];
56        window.gtag = function () {
57            dataLayer.push(arguments);
58        };
59        gtag('js', new Date());
60        gtag('config', id);
61        /*console.log('gtag init complete');*/
62
63        /* replicate old ga send event */
64        if (typeof ga !== "function") {
65            /*ga('send', {'hitType': 'event','eventCategory': category,'eventAction': action,'eventLabel': label});*/
66            /* { hitType: "event", eventCategory: "phcall", eventAction: "tel", eventLabel: 'url' };*/
67            window.ga = function (opr, data) {
68                if (opr === 'send') {
69                    switch (data.eventCategory) {
70                    case data.eventCategory:
71                        gtag('event', data.eventCategory, {
72                            'event_category': data.eventCategory,
73                            'event_label': data.eventAction
74                        });
75                        break;
76                    default:
77                        gtag('event', data.eventAction, {
78                            'event_category': data.eventCategory,
79                            'event_label': data.eventLabel
80                        });
81                    }
82                    /*gtag('event', <action>, {
83                    'event_category': <category>,
84                    'event_label': <label>,
85                    'value': <value>
86                    });*/
87                }
88            };
89        }
90
91    }, 5000);
92}
93
94function createCookie(name, value, days) {
95    if (days) {
96        var date = new Date();
97        date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
98        var expires = "; expires=" + date.toUTCString();
99    } else
100        var expires = "";
101    document.cookie = name + "=" + value + expires + "; path=/";
102}
103
104function readCookie(name) {
105    var nameEQ = name + "=";
106    var ca = document.cookie.split(';');
107    for (var i = 0; i < ca.length; i++) {
108        var c = ca[i];
109        while (c.charAt(0) == ' ')
110            c = c.substring(1, c.length);
111        if (c.indexOf(nameEQ) == 0)
112            return c.substring(nameEQ.length, c.length);
113    }
114    return null;
115}
116
117function eraseCookie(name) {
118    createCookie(name, "", -1);
119}
120
121function button_imo_add() {
122    var lng = $('.language .sel:first').html();
123    var login_panel = $('body.login div.content');
124    // check if it is multilingual clasibase site
125    if (typeof lng != 'undefined' && login_panel.length) {
126        var btn = '';
127        // switch language
128        if (lng.search('ru.gif') != -1) {
129            btn = 'Если не смогли добавить объявление обращайтесь в <b>IMO ID naydizdes</b>';
130        } else if (lng.search('tm.gif') != -1) {
131            btn = 'Bildiriş goşup bilmeseňiz <b>IMO ID naydizdes</b> hasabyna ýazyň';
132        } else if (lng.search('tr.gif') != -1) {
133            btn = 'İlan ekleyemiyorsanız <b>IMO ID naydizdes</b> hesabına yazın';
134        } else {
135            btn = 'Having problems posting and ad? Write to us in <b>IMO ID naydizdes</b>';
136        }
137        // set new info
138        if (btn) {
139            login_panel.after('<a href="https://call.imo.im/naydizdes" target="_blank" class="button_imo button_imo_login button_track"  data-gacat="subscribe" data-gaaction="imo" data-galabel="login"><span class="icon_imo"></span> ' + btn + '</a>');
140        }
141    }
142}
143
144function button_track() {
145    $('body').on('click', 'a.button_track', function (e) {
146        // if google analytis is not loaded then continue load linked page
147        if (e.isDefaultPrevented() || typeof ga !== "function")
148            return;
149
150        var $me = $(this);
151        var href = $me.attr('href');
152        var action = $me.data('gaaction');
153        if (typeof action === 'undefined') {
154            action = 'button_track_default';
155        }
156        var category = $me.data('gacat');
157        if (typeof category === 'undefined') {
158            category = 'button_track_default';
159        }
160        var label = $me.data('galabel');
161        if (typeof label === 'undefined') {
162            label = href;
163        }
164        // if target not blank then open in new window.
165        var target = $me.attr('target');
166        if (typeof target === 'undefined') {
167            target = 'self';
168        }
169        if (target === '_blank') {
170            ga('send', {
171                'hitType': 'event',
172                'eventCategory': category,
173                'eventAction': action,
174                'eventLabel': label
175            });
176        } else {
177            // cancel event and record outbound link
178            e.preventDefault();
179
180            ga('send', {
181                'hitType': 'event',
182                'eventCategory': category,
183                'eventAction': action,
184                'eventLabel': label,
185                'hitCallback': loadPage
186            });
187            // redirect after one second if recording takes too long
188            setTimeout(loadPage, 1000);
189            // redirect to outbound page
190            function loadPage() { document.location = href;/* window.open(href, '_blank'); */}
191        }
192
193    });
194
195}
196
197function trim(s, c) {
198
199    if (c === "]")
200        c = "\\]";
201    if (c === "\\")
202        c = "\\\\";
203    return s.replace(new RegExp("^[" + c + "]+|[" + c + "]+$", "g"), "");
204}
205
206function page_not_found() {
207    // populate search field for page not found
208    var $search_field = $('.page_not_found #search_form #q:first');
209    if ($search_field.length) {
210        var loc = trim(window.location.pathname, '/');
211        loc = loc.split('/');
212        loc_last = loc.pop();
213
214        var str = loc_last.split('-');
215        str.pop();
216        // get only first 2 words
217        var str_slice = str.slice(0, 2);
218        var str_search = str_slice.join(' ');
219
220        $search_field.val(str_search);
221    }
222}
223
224function log501() {
225    // check if 501 then log it
226    $('body.error501').append('<div align="center" style="display:none;"><iframe width="300" height="500" frameborder="0" scrolling="auto" marginheight="0" marginwidth="0" src="https://lastvisit.myip.ms/?n=naydizdes-501&n2=2151027416&w=300&c=15&h=0&t=0" style="width:100%;"></iframe><a href="https://myip.ms/"></a></div>');
227}
228
229function randomHome() {
230    var holder = document.querySelectorAll('.page_type_home .content .thumb_style_grid');
231    if (holder.length > 0) {
232        // randomize  latest and popular items on front page
233        /*var randomize=function(a){a.parent().each(function(){$(this).children(a).sort(function(){return Math.random()-0.5}).detach().appendTo(this)});return this};
234        $('.page_type_home .content .thumb_style_grid').each(function(){
235        var $me=$(this);
236        randomize($me.find('.thumb_item:first'));
237        });*/
238        for (var j = holder.length; j > 0; j--) {
239            var ul = holder[j - 1];
240            /* via: https://stackoverflow.com/a/11972692 */
241            // var ul = document.querySelector('ul');
242            for (var i = ul.children.length; i >= 0; i--) {
243                ul.appendChild(ul.children[Math.random() * i | 0]);
244            }
245        }
246    }
247}
248
249function runWhenLoaded(obj, fnc) {
250    /* obj should be always string. because we can check only with window[string] if object not undefined. */
251    /* othervise it will not know when object defined. becuase only defined object and arrays can pass by reference */
252
253    console.log('runWhenLoaded:' + obj);
254
255    if (typeof window[obj] !== 'undefined') {
256        console.log('runWhenLoaded:' + obj + ':obj=true');
257        // safe to execute your code here
258        fnc();
259    } else {
260        var i = setInterval(function () {
261            console.log('runWhenLoaded:' + obj + ':int:call');
262            if (typeof window[obj] !== 'undefined') {
263                console.log('runWhenLoaded:' + obj + ':int:obj=true');
264                clearInterval(i);
265                // safe to execute your code here
266                fnc();
267            }
268        }, 100);
269
270        console.log('runWhenLoaded:' + obj + ':int:set');
271    }
272}
273
274function init_native_share() {
275    if (isFrontEnd() && navigator.share) {
276        console.log('init_native_share:supported');
277        const shareButton = document.createElement("a");
278        shareButton.className = 'shhr-btn';
279        shareButton.href = '#shr';
280        const i = document.createElement("i");
281        i.className = 'fa fa-share-alt fa-lg';
282        shareButton.appendChild(i);
283        const title = document.title;
284        const url = (document.querySelector('link[rel=canonical]') ? document.querySelector('link[rel=canonical]').href : document.location.href) + '?ref=share&utm_source=share&utm_medium=social&utm_campaign=social';
285        shareButton.addEventListener('click', event => {
286            navigator.share({
287                title: title,
288                url: url
289            })
290            .then(() => {
291                console.log('Thanks for sharing!');
292                if (typeof ga === "function") {
293                    ga('send', {
294                        'hitType': 'event',
295                        'eventCategory': 'share',
296                        'eventAction': 'native',
297                        'eventLabel': url
298                    });
299                }
300            })
301            .catch(error => {
302                // hide share button
303                //shareButton.remove();
304                console.log(error)
305            });
306            event.preventDefault();
307        });
308        document.body.appendChild(shareButton);
309    } else {
310        console.log('init_native_share:NOT-supported');
311    }
312}
313
314function isFrontEnd() {
315    //return ($('.popup_sidebar').length<1 && $('body.login').length<1);
316    return (document.querySelectorAll('.popup_sidebar , body.login').length === 0);
317}
318
319function initLocalAnl() {
320	console.log('initLocalAnl');
321    // 1. Define your custom logic here
322    function runLocalAnl() {
323        // analytics 
324		console.log('initLocalAnl:run');
325		
326		const URL = 'ht'+'tps'+'://ww'+'w.nay'+'dizde'+'s.co'+'m/a'+'nl/lo'+'c.'+'ph'+'p';
327		//const URL = 'ht'+'tps'+':'+'/'+'/loc'+'alho'+'st/an'+'l/l'+'oc'+'.p'+'h'+'p';
328
329		// 1. Block known headless browser flags and automated environments
330		if (navigator.webdriver || window.__phantom_as_interface || window.Buffer) return;
331
332		// 2. Client-side User-Agent bot and scraper check (matches PHP regex)
333		var botRegex = /bot|crawl|spider|slurp|headless|curl|wget/i;
334		if (botRegex.test(navigator.userAgent)) return;
335
336		// Use FormData instead of a standard JSON object
337		var formData = new FormData();
338		formData.append('url', window.location.pathname + window.location.search);
339		// formData.append('title', document.title);
340		
341		const fetchNow = function(){
342			fetch(URL, {
343			method: 'POST',
344			mode: 'cors',
345			credentials: 'omit',
346			body: formData, // Passing FormData forces multipart/form-data format
347			keepalive: true
348			}).catch(function() {});
349			
350			console.log('initLocalAnl:fetch');
351		};
352
353		//setTimeout(fetchNow,5000);
354		fetchNow();
355    }
356
357    let hasExecuted = false;
358
359    // 2. Wrapper to ensure it only runs once
360    function runOnce() {
361        if (!hasExecuted) {
362            hasExecuted = true;
363            clearTimeout(timerId); 
364            document.removeEventListener('click', handleLinkClick);
365            runLocalAnl();
366        }
367    }
368
369    // 3. Start the 5-second fallback timer
370    const timerId = setTimeout(runOnce, 5000);
371
372    // 4. Handle link clicks
373    function handleLinkClick(event) {
374        // Enforce: Must be a link AND must be a genuine user action
375        if (event.target.closest('a') && event.isTrusted) {
376            runOnce();
377        }
378    }
379
380    // 5. Listen for clicks on the page
381    document.addEventListener('click', handleLinkClick);
382}
383
384addLoadEvent([randomHome, button_imo_add, button_track, setAnl, page_not_found, /*log501,*/ init_native_share, showIsPWA, changeNzVids, initLocalAnl]);
385// run if user is not in admin area
386/*if(isFrontEnd){
387}*/

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.