XIONPLAY | Linky.ph window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-LZC8Z9TRCY');


/* Internal tracking for biolink links */ $('[data-location-url]').on('click', event => { let base_url = $('[name="url"]').val(); let url = $(event.currentTarget).data('location-url'); $.ajax(`${base_url}${url}?no_redirect`); }); $('#close-ads').on('click', event => { console.log('close'); $('.div-ads').removeClass('fadeInUp delay-1s').addClass('fadeOutDown'); }); (function($) { $.fn.visible = function(partial, hidden) { var $t = $(this).eq(0), t = $t.get(0), $w = $(window), viewTop = $w.scrollTop(), viewBottom = viewTop + $w.height(), _top = $t.offset().top, _bottom = _top + $t.height(), compareTop = partial === true ? _bottom : _top, compareBottom = partial === true ? _top : _bottom, clientSize = hidden === true ? t.offsetWidth * t.offsetHeight : true; return !!clientSize && ((compareBottom <= viewBottom) && (compareTop >= viewTop)); }; })(jQuery); $(window).on('resize scroll', function () { loadLazy() }); loadLazy(); function loadLazy() { $('#links img').each(function () { var elem = $(this) if(elem.closest('._srch').data('hide')) return if (!elem.visible(true)) return if (!elem.data('src')) return if (elem.attr('src')) return; console.log('test'); elem.attr('src', elem.data('src')); }); } function throttle(f, delay){ var timer = null; return function(){ var context = this, args = arguments; clearTimeout(timer); timer = window.setTimeout(function(){ f.apply(context, args); }, delay || 500); }; } $('.srchtxt').keyup(throttle(function(){ let fil = $(this).val(); count = 0; $('#links ._srch').each(function() { let def = $(this).data('text') ?? ''; let val = $(this).text()+def; val = val.normalize('NFKC'); if (val.search(new RegExp(fil, "i")) < 0) { $(this).hide(); // MY CHANGE $(this).data('hide', true); } else { $(this).show(); // MY CHANG $(this).data('hide', false); count++; } }); //search only show loadLazy(); })); /* Go over all mail buttons to make sure the user can still submit mail */ $('form[id^="mail_"]').each((index, element) => { let link_id = $(element).find('input[name="link_id"]').val(); let is_converted = localStorage.getItem(`mail_${link_id}`); if(is_converted) { /* Set the submit button to disabled */ $(element).find('button[type="submit"]').attr('disabled', 'disabled'); } }); /* Form handling for mail submissions if any */ $('form[id^="mail_"]').on('submit', event => { let base_url = $('[name="url"]').val(); let link_id = $(event.currentTarget).find('input[name="link_id"]').val(); let is_converted = localStorage.getItem(`mail_${link_id}`); if(!is_converted) { $.ajax({ type: 'POST', url: `${base_url}link-ajax`, data: $(event.currentTarget).serialize(), success: (data) => { let notification_container = $(event.currentTarget).find('.notification-container'); if (data.status == 'error') { notification_container.html(''); display_notifications(data.message, 'error', notification_container); } else if (data.status == 'success') { display_notifications(data.message, 'success', notification_container); setTimeout(() => { /* Hide modal */ $(event.currentTarget).closest('.modal').modal('hide'); /* Remove the notification */ notification_container.html(''); /* Set the localstorage to mention that the user was converted */ localStorage.setItem(`mail_${link_id}`, true); /* Set the submit button to disabled */ $(event.currentTarget).find('button[type="submit"]').attr('disabled', 'disabled'); }, 1000); } }, dataType: 'json' }); } event.preventDefault(); }) var currentFull = $('._url').attr('href'); $('._discb').on('click', function(e) { e.preventDefault(); let modal = $('#_discmodal'); modal.modal('toggle'); modal.find('h5').html($(this).data('name')); modal.find('p').html($(this).data('txt')); modal.find('input[name=discount_code]').val($(this).data('code')); if(!$(this).data('img')) modal.find('img').hide(); modal.find('img').attr('src',($(this).data('img'))); modal.find('button').data('url', $(this).data('url')); modal.find('button').data('location-url', $(this).data('location')); }); $('._disc').on('click', function(){ this.select(); document.execCommand('copy'); $(this).attr('data-original-title', 'Text copied!').tooltip('update').tooltip('show'); }); $('._dcgo').on('click', function(e) { e.preventDefault(); $('._disc').trigger('click'); let loc = $(this).data('url'); $(this).attr('disabled', true); setTimeout(() => { window.open(loc, '_blank'); $(this).attr('disabled', false) }, 500); }); $('._share').on('click', function(e){ e.preventDefault(); let modal = $('#_sharem'); modal.modal('toggle'); modal.find('._titlem').html($('._ctitl').html()); modal.find('._linkurl').html(currentFull.replace("https://", "")); modal.find('._imageshr').attr('src',($('.link-image').attr('src'))); }); $('.shareToCopy').on('click', event => { console.log('click'); if (navigator.share !== undefined) { navigator.share({ url : currentFull }) } else { copyToClipboard($(this),currentFull); } }); function copyToClipboard(element,value) { var $temp = $("<input>"); $("body").append($temp); $temp.val(value).select(); document.execCommand("copy"); $temp.remove(); }
x server