Шитпостинг

Информация о пользователе

Привет, Гость! Войдите или зарегистрируйтесь.


Вы здесь » Шитпостинг » Обои для рабочего стола » Авиация


Авиация

Сообщений 11 страница 20 из 135

11

Код:
function fastTrackIsOn() {
if (document.querySelector('#icd').checked) {
document.querySelector(".chx-pulsating-circle").style.display = "block";
document.querySelector("#false_shoutbox_name").style.paddingRight = "15px";
}
}

12

function chatxVisibility() {
    var resizeActivated;
    var resizeTimer;
    jQuery(window).on("load resize", function() {
        if (!jQuery('.chx-container').visible() && jQuery('#chatx').hasClass('expanded') && !resizeActivated) {

            let keysToRemove = ["chx-container", "chat_custom_position"];
            resizeActivated = true;
            for (key of keysToRemove) {
                localStorage.removeItem(key);
            }
            jQuery('#chatx').animate({
                top: '15px',
                left: '15px'
            }, 500);
            jQuery("#chatx.expanded .chx-container").animate({
                height: "360px"
            }, 500);
            clearTimeout(resizeTimer);
            resizeTimer = setTimeout(function() {
                resizeActivated = false
            }, 200);
        }
    });
}

13

function chatxVisibility() {
var resizeActivated;
var resizeTimer;
window.addEventListener("load", function() {
window.addEventListener("resize", function() {
if (!document.querySelector('.chx-container').classList.contains("visible") && document.querySelector('#chatx').classList.contains("expanded") && !resizeActivated) {
            let keysToRemove = ["chx-container", "chat_custom_position"];
            resizeActivated = true;
            for (let key of keysToRemove) {
                localStorage.removeItem(key);
            }
            document.querySelector('#chatx').animate({
                top: '15px',
                left: '15px'
            }, 500);
            document.querySelector("#chatx.expanded .chx-container").animate({
                height: "360px"
            }, 500);
            clearTimeout(resizeTimer);
            resizeTimer = setTimeout(function() {
                resizeActivated = false
            }, 200);
        }
    });
});
}

14

Код:
let options = {
    root: null, // It can be null if you want to check visibility relative to the viewport
    rootMargin: "0px", // margins around the root.
    threshold: 1.0 // fully visible
}

let observer = new IntersectionObserver(handleIntersect, options);

function handleIntersect(entries, observer) {
    entries.forEach(entry => {
        if (entry.isIntersecting) {
            console.log("Div is fully visible");
        }
    });
}

observer.observe(document.getElementById("myDiv"));

15

Код:
jQuery(document).ready(function() {
    jQuery("#shoutbox-comment").on("keypress", function(event) {
        if ((event.keyCode == 10 || event.keyCode == 13)) {
            event.preventDefault();
            chatSubmit();
        }
    });
});

16

Код:
document.addEventListener("DOMContentLoaded", function() {
    const shoutboxComment = document.getElementById("shoutbox-comment");
    shoutboxComment.addEventListener("keypress", function(event) {
        if (event.keyCode === 10 || event.keyCode === 13) {
            event.preventDefault();
            chatSubmit();
        }
    });
});

17

Код:
function pushNotification() {
    if (window.Notification) {
        var a = document.querySelector(".chx-push-notific chx_i");
        ntfDisb = 'chxicon-notification-disabled';
        ntfSubs = 'chxicon-notification-subscribed';
        if (Notification.permission === 'denied' || localStorage.getItem('notificationDisabled') === '1') {
            a.className = '';
            a.classList.add(ntfDisb);
            if (Notification.permission !== 'denied') {
                a.addEventListener('click', function() {
                    if (a.classList.contains(ntfSubs)) {
                        a.className = '';
                        a.classList.add(ntfDisb);
                        localStorage.setItem('notificationDisabled', '1');
                    } else {
                        a.className = '';
                        a.classList.add(ntfSubs);
                        localStorage.removeItem('notificationDisabled');

                    }
                });
            }
        } else {
            if (Notification.permission === 'default') {
                document.querySelector(".chxicon-notification-default").addEventListener('click', function() {
                    Notification.requestPermission();
                });
            } else {
                a.className = '';
                a.classList.add(ntfSubs);
                a.addEventListener('click', function() {
                    if (a.classList.contains(ntfSubs)) {
                        a.className = '';
                        a.classList.add(ntfDisb);
                        localStorage.setItem('notificationDisabled', '1');
                    } else {
                        a.className = '';
                        a.classList.add(ntfSubs);
                        localStorage.removeItem('notificationDisabled');

                    }
                });

            }

        }
    }
}
pushNotification();

18

Код:
const pushNotification = () => {
  if (window.Notification) {
    const icon = document.querySelector(".chx-push-notific chx_i");
    const ntfDisb = 'chxicon-notification-disabled';
    const ntfSubs = 'chxicon-notification-subscribed';
    const permission = Notification.permission;
    const disabled = localStorage.getItem('notificationDisabled');
    if (permission === 'denied' || disabled === '1') {
      icon.className = '';
      icon.classList.add(ntfDisb);
      if (permission !== 'denied') {
        icon.addEventListener('click', () => {
          icon.classList.contains(ntfSubs)
            ? (localStorage.setItem('notificationDisabled', '1'), icon.classList.replace(ntfSubs, ntfDisb))
            : (localStorage.removeItem('notificationDisabled'), icon.classList.replace(ntfDisb, ntfSubs));
        });
      }
    } else {
      if (permission === 'default') {
        document.querySelector(".chxicon-notification-default").addEventListener('click', () => {
          Notification.requestPermission();
        });
      } else {
        icon.className = '';
        icon.classList.add(ntfSubs);
        icon.addEventListener('click', () => {
          icon.classList.contains(ntfSubs)
            ? (localStorage.setItem('notificationDisabled', '1'), icon.classList.replace(ntfSubs, ntfDisb))
            : (localStorage.removeItem('notificationDisabled'), icon.classList.replace(ntfDisb, ntfSubs));
        });
      }
    }
  }
}
pushNotification();

19

Код:
function processExtImg() {
    imgLink = {
        'urlToImg': jQuery("input[name='url_to_img']").val()
    };
    let url = chatx_server + "imgur_uploader.php";
    jQuery.ajax({
        url: url,
        type: "POST",
        data: imgLink,
        success: function(res) {
            generateImageTagAndSend(res);
        }
    });
}

20

Код:
function processExtImg() {
    const imgLink = {
        'urlToImg': document.querySelector("input[name='url_to_img']").value
    };
    const url = chatx_server + "imgur_uploader.php";

    const xhr = new XMLHttpRequest();
    xhr.open("POST", url);
    xhr.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
    xhr.onload = function () {
        if (xhr.status === 200) {
            generateImageTagAndSend(xhr.response);
        }
    };
    xhr.send(JSON.stringify(imgLink));
}

Быстрый ответ

Напишите ваше сообщение и нажмите «Отправить»



Вы здесь » Шитпостинг » Обои для рабочего стола » Авиация