$(".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");
});
Авиация
Сообщений 111 страница 120 из 134
Поделиться1112023-03-31 04:05 pm
Поделиться1122023-03-31 04:57 pm
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";
});
Поделиться1132023-04-15 01:40 am
$.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"); });
Поделиться1142023-04-15 01:44 am
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();
Поделиться1152023-04-15 02:32 am
<div class=\"private\"
Поделиться1162023-04-16 11:40 pm
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); }
Поделиться1172023-04-16 11:43 pm
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', ]); }
Поделиться1192023-04-23 06:59 pm
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.
Поделиться1202023-04-23 10:31 pm
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();
Быстрый ответ
Похожие темы
Космос | Обои для рабочего стола | 2025-01-03 |