Шитпостинг

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

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


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


Авиация

Сообщений 111 страница 120 из 134

111

$(".email-signup").hide();
$("#signup-box-link").click(function(){
  $(".email-login").fadeOut(100);
  $(".email-signup").delay(100).fadeIn(100);
  $(".disabled").delay(100).fadeIn(100);
  $("#login-box-link").removeClass("active");
  $("#signup-box-link").addClass("active");
});
$("#login-box-link").click(function(){
  $(".email-login").delay(100).fadeIn(100);
  $(".email-signup").fadeOut(100);
  $(".disabled").fadeOut(100);
  $("#login-box-link").addClass("active");
  $("#signup-box-link").removeClass("active");
});

112

let signUpForm = document.querySelector(".email-signup");
            logInForm = document.querySelector(".email-login");
        signUpForm.style.display = "none";
        document.getElementById("signup-box-link").addEventListener('click', function () {
            logInForm.style.display = "none";
            signUpForm.style.display = "block";
        });
        document.getElementById("login-box-link").addEventListener('click', function () {
            signUpForm.style.display = "none";
            logInForm.style.display = "block";
           
        });

113

Код:
$.getJSON( "./array_history_moderator.php", function( data ) {
  var items = [];
  $.each( data, function() {
    items.push( "<article><div class=wrapper>" + "<div class=third-box><chx_li><chx_p class=shoutbox-comment><chx_span class=shoutbox-username><b data-loggedin=" + this.loggedIn + ">" + this.name + "</b></chx_span>" +  this.text + "</chx_p><chx_div class=shoutbox-comment-details><div class=first-box><input class=magic-checkbox type=checkbox name=deleteShout[] form=deleteShout value=" + this.id + "><label class=magic-label></label></div><chx_span class=shoutbox-comment-ago>" + this.timeAgo + "</chx_span></chx_div></chx_li></div></div></article>" );
  });
 
  $( "<main/>", {
    "class": "list",
    html: items.join( "" )
  }).appendTo( ".shoutbox-content" );

    $(".magic-checkbox").each(function(i) {
     $(this).attr("id", (i+1));
    });
    $(".magic-label").each(function(i) {
     $(this).attr("for", (i+1));
    });
    $(".chatx_img").removeAttr("height");
});

114

const xhr = new XMLHttpRequest();
xhr.open("GET", "./array_history_moderator.php");
xhr.onreadystatechange = function() {
  if (xhr.readyState === 4 && xhr.status === 200) {
    const data = JSON.parse(xhr.responseText);
    const items = [];
    data.forEach(function(item) {
      const html = `<article><div class="wrapper"><div class="third-box"><li class="chx_li"><p class="shoutbox-comment"><span class="shoutbox-username"><b data-loggedin="${item.loggedIn}">${item.name}</b></span>${item.text}</p><div class="shoutbox-comment-details"><div class="first-box"><input class="magic-checkbox" type="checkbox" name="deleteShout[]" form="deleteShout" value="${item.id}"><label class="magic-label"></label></div><span class="shoutbox-comment-ago">${item.timeAgo}</span></div></li></div></div></article>`;
      items.push(html);
    });
    const main = document.createElement("main");
    main.classList.add("list");
    main.innerHTML = items.join("");
    document.querySelector(".shoutbox-content").appendChild(main);
    document.querySelectorAll(".magic-checkbox").forEach(function(checkbox, i) {
      checkbox.id = i + 1;
    });
    document.querySelectorAll(".magic-label").forEach(function(label, i) {
      label.setAttribute("for", i + 1);
    });
    document.querySelectorAll(".chatx_img").forEach(function(img) {
      img.removeAttribute("height");
    });
  }
};
xhr.send();

115

<div class=\"private\"

116

Код:
    if($s_d) {
        if(isset($_GET['page-login'])) {
            setcookie("chx_authentication", $jwt_data, [
                'expires' => $expire,
                'path' => '/',
                /*'domain' => $_SERVER['HTTP_HOST'],*/
                'secure' => true,
                'httponly' => true,
                'samesite' => 'Strict',
            ]); // should not be written twice
        }
        $form_data = array('success' => true, 'jwt' => $jwt_data);
    } else {
        setcookie("chx_authentication", $jwt_data, [
            'expires' => $expire,
            'path' => '/',
            /*'domain' => $_SERVER['HTTP_HOST'],*/
            'secure' => true,
            'httponly' => true,
            'samesite' => 'Strict',
        ]);
        $form_data = array('success' => true);
    }

117

Код:
if ($s_d) {
    $form_data = array('success' => true, 'jwt' => $jwt_data);
} else {
    $form_data = array('success' => true);
}

// Set the cookie if the 'page-login' GET parameter is set
if (isset($_GET['page-login'])) {
    setcookie("chx_authentication", $jwt_data, [
        'expires' => $expire,
        'path' => '/',
        /*'domain' => $_SERVER['HTTP_HOST'],*/
        'secure' => true,
        'httponly' => true,
        'samesite' => 'Strict',
    ]);
}

118

119

To achieve this, you can use the GitHub API to fetch the latest release information and compare it with your current version. Here's a JavaScript code snippet that demonstrates how to do this:

```javascript
const axios = require('axios'); // You'll need to install axios: npm install axios

const currentVersion = '1.0.0'; // Replace this with your current version
const repoOwner = 'your-repo-owner'; // Replace this with the repository owner's username
const repoName = 'your-repo-name'; // Replace this with the repository name

async function checkForNewRelease() {
  try {
    const response = await axios.get(`https://api.github.com/repos/${repoOwner}/${repoName}/releases/latest`);
    const latestVersion = response.data.tag_name;

    if (compareVersions(currentVersion, latestVersion) === -1) {
      console.log(`New version available: ${latestVersion}`);
      // Show a notification or perform any other action you'd like
    } else {
      console.log('You are using the latest version.');
    }
  } catch (error) {
    console.error('Error fetching the latest release:', error);
  }
}

function compareVersions(version1, version2) {
  const v1 = version1.split('.').map(Number);
  const v2 = version2.split('.').map(Number);

  for (let i = 0; i < v1.length; i++) {
    if (v1[i] > v2[i]) {
      return 1;
    } else if (v1[i] < v2[i]) {
      return -1;
    }
  }

  return 0;
}

checkForNewRelease();
```

This code uses the `axios` library to make an HTTP request to the GitHub API. Make sure to replace the `currentVersion`, `repoOwner`, and `repoName` variables with your own values. The `compareVersions` function compares two version strings and returns `-1` if the first version is older, `1` if it's newer, and `0` if they're equal.

120

const currentVersion = '1.0.0'; // Replace this with your current version
const repoOwner = 'your-repo-owner'; // Replace this with the repository owner's username
const repoName = 'your-repo-name'; // Replace this with the repository name

async function checkForNewRelease() {
  try {
    const response = await fetch(`https://api.github.com/repos/${repoOwner}/${repoName}/releases/latest`);
    const data = await response.json();
    const latestVersion = data.tag_name;

    if (compareVersions(currentVersion, latestVersion) === -1) {
      console.log(`New version available: ${latestVersion}`);
      // Show a notification or perform any other action you'd like
    } else {
      console.log('You are using the latest version.');
    }
  } catch (error) {
    console.error('Error fetching the latest release:', error);
  }
}

function compareVersions(version1, version2) {
  const v1 = version1.split('.').map(Number);
  const v2 = version2.split('.').map(Number);

  for (let i = 0; i < v1.length; i++) {
    if (v1[i] > v2[i]) {
      return 1;
    } else if (v1[i] < v2[i]) {
      return -1;
    }
  }

  return 0;
}

checkForNewRelease();

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

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


Похожие темы


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