Шитпостинг

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

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


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


Авиация

Сообщений 21 страница 30 из 135

21

Код:
function processExtImg() {
    var imgLink = document.querySelector("input[name='url_to_img']").value;
    var url = chatx_server + "imgur_uploader.php";
    var xhr = new XMLHttpRequest();
    xhr.open("POST", url, true);
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.onreadystatechange = function() {
        if (xhr.readyState === 4 && xhr.status === 200) {
            generateImageTagAndSend(xhr.responseText);
        }
    };
    xhr.send(JSON.stringify({ urlToImg: imgLink }));
}

22

Код:
function generateImageTagAndSend(res) {
    let data = JSON.parse(res);
    if (res !== '' && data.link !== null) {
        document.querySelector("#shoutbox-comment").value = "";
        jQuery('#shoutbox-comment').val(jQuery('#shoutbox-comment').val() + '[url=' + chatx_server + 'img_viewer.php?url=' + data.link + ']' + openDirectLink + '[/url][img h=' + data.clientHeight + ' d=' + data.link + ']' + data.thumbnail + '[/img] ');
        document.querySelector("input[name='url_to_img']").value = "";
        if (jQuery('#false_shoutbox_name').val() == '') {
            jQuery('#shoutbox-comment').attr('rows', 6);
            errorNameEmpty();

        } else {
            chatSubmit();
        }

    }
    document.querySelector('.loading-modal').remove();
}

23

Код:
function generateImageTagAndSend(res) {
    let data = JSON.parse(res);
    if (res !== "" && data.link !== null) {
        // update #shoutbox-comment value
        document.querySelector("#shoutbox-comment").value = "[url=" + chatx_server + "img_viewer.php?url=" + data.link + "]" + openDirectLink + "[/url][img h=" + data.clientHeight + " d=" + data.link + "]" + data.thumbnail + "[/img] ";
        document.querySelector("input[name='url_to_img']").value = "";
        // check if false_shoutbox_name is empty
        if (document.querySelector('#false_shoutbox_name').value === "") {
            document.querySelector('#shoutbox-comment').setAttribute('rows', 6);
            errorNameEmpty();
        } else {
            chatSubmit();
        }
    }
    document.querySelector('.loading-modal').remove();
}

24

Код:
function publicScenarioLoggingOut() {
    jQuery("#false_shoutbox_name").val(sessionName);
    jQuery("#false_shoutbox_name").prop("disabled", true);
    jQuery(".expanded .chx-login-form").hide();
    jQuery('.chatx_login').removeClass('chatx_login').addClass('chatx_logout').html("<chx_span></chx_span> <chx_i class='chxicon-logout'></chx_i>");
    ajaxLogOutClicked();
}

25

Код:

function publicScenarioLoggingOut() {
    const falseShoutboxName = document.querySelector("#false_shoutbox_name");
    falseShoutboxName.value = sessionName;
    falseShoutboxName.disabled = true;
    const loginForm = document.querySelector(".expanded .chx-login-form");
    loginForm.style.display = 'none';
    const chatxLoginEl = document.querySelector('.chatx_login');
    chatxLoginEl.classList.replace('chatx_login', 'chatx_logout');
    chatxLoginEl.innerHTML = "<chx_span></chx_span> <chx_i class='chxicon-logout'></chx_i>";
    ajaxLogOutClicked();
}

26

Код:
document.querySelector('.chxicon-expand').addEventListener('click', function() {
  loadInt = setInterval(load, (document.querySelector(icd).checked ? fastTrack : slowTrack));
  document.querySelector("#chatx").draggable = true;
  document.querySelector("#chatx").classList.remove("minimized");

  if (localStorage.toggled != "expanded") {
    document.querySelector('#chatx').classList.add("expanded", true);
    localStorage.toggled = "expanded";
  }
  localStorage.setItem('chx_id', document.querySelector("chx_li").lastElementChild.getAttribute('class'));
  document.querySelectorAll(".chx-bar").forEach(elem => elem.classList.remove("chx-new"));
  scrollBottom();
  if (isMobile) {
    document.querySelector("html").animate({
      scrollTop: 0
    }, 200); 
  }
});

Код:
const chxiconExpand = document.querySelector('.chxicon-expand');

const handleClick = () => {
  clearInterval(loadInt);
  const isChecked = document.querySelector(icd).checked;
  const interval = isChecked ? fastTrack : slowTrack;
  loadInt = setInterval(load, interval);

  const chatx = document.querySelector("#chatx");
  chatx.draggable = true;
  chatx.classList.remove("minimized");
  if (localStorage.toggled !== "expanded") {
    chatx.classList.add("expanded");
    localStorage.toggled = "expanded";
  }

  const chxLi = document.querySelector("chx_li");
  const lastChxLiClass = chxLi.lastElementChild.getAttribute('class');
  localStorage.setItem('chx_id', lastChxLiClass);

  const chxBarList = document.querySelectorAll(".chx-bar");
  chxBarList.forEach(elem => elem.classList.remove("chx-new"));

  scrollBottom();
  if (isMobile) {
    window.scrollTo({ top: 0, behavior: 'smooth' });
  }
};

chxiconExpand.addEventListener('click', handleClick);

27

Код:
        function publish(name, comment) {

            let published = jQuery.ajax({

                url: chatx_server + 'publish.php',
                type: "POST",
                crossDomain: true,
                dataType: "json",
                data: {
                    name: name,
                    comment: comment
                },
                xhrFields: {
                    withCredentials: true
                }

            });
            published.complete(function() {
                localStorage.setItem('nameElement', nameElement.val());
                commentElement.val("");
                load();
                if (sessionName) {
                    let src = chatx_server + 'assets/audio/1_1.ogg';
                    let audio = new Audio(src);
                    audio.play();
                }
            });
        }

28

Код:
function publish(name, comment) {
    let xhr = new XMLHttpRequest();
    xhr.open("POST", chatx_server + "publish.php", true);
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.withCredentials = true;
    xhr.send(JSON.stringify({ name: name, comment: comment }));
}

29

Код:
function publish(name, comment) {
    let xhr = new XMLHttpRequest();
    xhr.open("POST", chatx_server + "publish.php", true);
    xhr.setRequestHeader("Content-Type", "application/json");
    xhr.withCredentials = true;
    xhr.onload = function() {
        if (xhr.status === 200) {
            localStorage.setItem('nameElement', nameElement.value);
            commentElement.value = "";
            load();
            if (sessionName) {
                let src = chatx_server + 'assets/audio/1_1.ogg';
                let audio = new Audio(src);
                audio.play();
            }
        } else {
            console.log('Error: ' + xhr.status);
        }
    };
    xhr.send(JSON.stringify({ name: name, comment: comment }));
}

30

Код:
    jQuery.when(
        jQuery.getScript(chatx_server + 'assets/js/jquery-ui.min.js'),
        jQuery.getScript(chatx_server + 'assets/js/simplebar.js'),
        e_o === 1 ? jQuery.getScript('https://cdn.jsdelivr.net/npm/emojione@3.1.2/lib/js/emojione.min.js') : null
    ).done(function() {console.log('done');});

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

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



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