Wpis z mikrobloga

// 1. Apply CSS styles early
$("head").append(
<style>
s, s a:not(:hover) { color: white !important; }
img.youtube-thumbnail {
max-width: 240px;
cursor: pointer;
border: 1px solid #ddd;
transition: transform 0.2s ease;
}
img.youtube-thumbnail:hover {
transform: scale(1.05);
}
</style>
);

// 2. Delete cookies early
document.cookie.split("; ").forEach(cookie => {
const [name] = cookie.split("=");

if (name === "password") {
document.cookie = name + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
}
});

// 3. Remove reCAPTCHA token from localStorage
localStorage.removeItem("grecaptcha");

// 4. Replace specific words on keyup
$(document).ready(() => {
$("#postform textarea, .fastform textarea").on("keyup", ({ target }) => {

const replacements = {
"xd": "#gimbo",
"część": "[czesc]",
"prawniku": "prawiku",
"łódzki": "loszki",
"kul": "[cool]"
};

for (const [key, value] of Object.entries(replacements)) {
target.value = target.value.replace(new RegExp(key, "g"), value);
}

});
});
#karachan
  • 2
  • Odpowiedz
  • Otrzymuj powiadomienia
    o nowych komentarzach