Шитпостинг

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

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


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


Авиация

Сообщений 71 страница 80 из 134

71

jQuery('#chatx').addClass(localStorage.toggled);

jQuery('.chxicon-unmute, .chxicon-mute').on('click', function() {
    jQuery(this).toggleClass("chxicon-unmute chxicon-mute");
    if (jQuery(this).hasClass('chxicon-mute')) {
        localStorage.setItem('soundMuted', '1');
    } else {
        localStorage.removeItem('soundMuted');
    }
});

72

document.querySelector('#chatx').classList.add(localStorage.toggled);

document.querySelectorAll('.chxicon-unmute, .chxicon-mute').forEach(el => {
    el.addEventListener('click', function() {
        this.classList.toggle("chxicon-unmute");
        this.classList.toggle("chxicon-mute");
        if (this.classList.contains('chxicon-mute')) {
            localStorage.setItem('soundMuted', '1');
        } else {
            localStorage.removeItem('soundMuted');
        }
    });
});

73

jQuery(document).ready(function() {
    jQuery(window).unload(saveNickname);
});

function loadNickname() {
    if (!sessionName) {
        jQuery('#false_shoutbox_name').val(localStorage.nameElement);
    }
}

function saveNickname() {
    localStorage.nameElement = jQuery('#false_shoutbox_name').val();
}

74

document.addEventListener("DOMContentLoaded", function() {
    window.addEventListener("beforeunload", saveNickname);
});

function loadNickname() {
    if (!sessionName) {
        document.querySelector('#false_shoutbox_name').value = localStorage.nameElement;
    }
}

function saveNickname() {
    localStorage.nameElement = document.querySelector('#false_shoutbox_name').value;
}

75

document.addEventListener("DOMContentLoaded", () => window.addEventListener("beforeunload", saveNickname));

const loadNickname = () => !sessionName && (document.querySelector('#false_shoutbox_name').value = localStorage.nameElement);
const saveNickname = () => localStorage.nameElement = document.querySelector('#false_shoutbox_name').value;

76

const textarea = document.getElementById('shoutbox-comment');

textarea.addEventListener('input', function() {
    this.rows = 2;
    this.rows = countRows(this.scrollHeight);

    if (this.rows >= 6) {
        jQuery('.chx-pre-textarea, #chx-new-message').addClass("scrollable");
    } else {
        jQuery('.chx-pre-textarea, #chx-new-message').removeClass("scrollable");
    }
    if (!jQuery('.shoutbox-form').visible()) {
        if (jQuery('.chx-container').height() > 360) {
            let calcFormHeight = jQuery('.chx-container').height() - 18;
            jQuery('.chx-container').css("height", calcFormHeight + "px");
            localStorage.setItem(chx_resize, '{"height":"' + calcFormHeight + 'px"}');
        } else {
            let top = parseInt(jQuery('#chatx').css('top'), 10);
            jQuery('#chatx').css('top', top - 18 + 'px')

        }
    }
});

77

Код:
const textarea = document.getElementById('shoutbox-comment');

textarea.addEventListener('input', function() {
    this.rows = 2;
    this.rows = countRows(this.scrollHeight);

    const elements = document.querySelectorAll('.chx-pre-textarea, #chx-new-message');
    if (this.rows >= 6) {
        elements.forEach(el => el.classList.add("scrollable"));
    } else {
        elements.forEach(el => el.classList.remove("scrollable"));
    }
    if (!document.querySelector('.shoutbox-form').visible()) {
        if (document.querySelector('.chx-container').clientHeight > 360) {
            let calcFormHeight = document.querySelector('.chx-container').clientHeight - 18;
            document.querySelector('.chx-container').style.height = calcFormHeight + "px";
            localStorage.setItem(chx_resize, '{"height":"' + calcFormHeight + 'px"}');
        } else {
            let top = parseInt(document.querySelector('#chatx').style.top, 10);
            document.querySelector('#chatx').style.top = top - 18 + 'px';
        }
    }
});

78

const isVisible = (elem) => !!elem && !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );

if (!isVisible(document.querySelector('.shoutbox-form'))) {
  //rest of the code
}

79

const textarea = document.getElementById('shoutbox-comment');

textarea.addEventListener('input', function() {
    this.rows = 2;
    this.rows = countRows(this.scrollHeight);

    const elements = document.querySelectorAll('.chx-pre-textarea, #chx-new-message');
    if (this.rows >= 6) {
        elements.forEach(el => el.classList.add("scrollable"));
    } else {
        elements.forEach(el => el.classList.remove("scrollable"));
    }

    if (!isVisible(document.querySelector('.shoutbox-form'))) {
        if (document.querySelector('.chx-container').clientHeight > 360) {
            let calcFormHeight = document.querySelector('.chx-container').clientHeight - 18;
            document.querySelector('.chx-container').style.height = calcFormHeight + "px";
            localStorage.setItem(chx_resize, '{"height":"' + calcFormHeight + 'px"}');
        } else {
            let top = parseInt(document.querySelector('#chatx').style.top, 10);
            document.querySelector('#chatx').style.top = top - 18 + 'px';
        }
    }
});

80

const isVisible = (elem) => !!(elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length);

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

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


Похожие темы


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