function fastTrackIsOn() {
if (document.querySelector('#icd').checked) {
document.querySelector(".chx-pulsating-circle").style.display = "block";
document.querySelector("#false_shoutbox_name").style.paddingRight = "15px";
}
}
Авиация
Сообщений 11 страница 20 из 134
Поделиться112023-01-17 05:11 pm
Поделиться122023-01-17 05:16 pm
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);
}
});
}
Поделиться132023-01-17 05:18 pm
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);
}
});
});
}
Поделиться142023-01-18 02:52 pm
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"));
Поделиться152023-01-18 03:25 pm
jQuery(document).ready(function() {
jQuery("#shoutbox-comment").on("keypress", function(event) {
if ((event.keyCode == 10 || event.keyCode == 13)) {
event.preventDefault();
chatSubmit();
}
});
});
Поделиться162023-01-18 03:29 pm
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();
}
});
});
Поделиться172023-01-18 03:37 pm
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();
Поделиться182023-01-18 03:41 pm
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();
Поделиться192023-01-18 04:56 pm
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);
}
});
}
Поделиться202023-01-18 05:14 pm
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));
}
Быстрый ответ
Похожие темы
| Космос | Обои для рабочего стола | 2025-01-03 |