User:Stumblean/common.js: Difference between revisions
Appearance
No edit summary Tags: Mobile edit Mobile web edit Advanced mobile edit |
No edit summary Tags: Mobile edit Mobile web edit Advanced mobile edit |
||
Line 1: | Line 1: | ||
(function () { | |||
const | const icon = "https://files.catbox.moe/wk78nl.jpg"; | ||
const menu = document.createElement("div"); | const menu = document.createElement("div"); | ||
menu. | menu.style.position = "fixed"; | ||
menu.style.top = "20px"; | |||
menu.style.right = "20px"; | |||
menu.style.background = "#111"; | |||
menu.style.color = "#fff"; | |||
menu.style.border = "2px solid #666"; | |||
menu.style.borderRadius = "10px"; | |||
menu.style.padding = "10px"; | |||
menu.style.fontFamily = "monospace"; | |||
menu.style.zIndex = "99999"; | |||
menu.style.boxShadow = "0 0 10px black"; | |||
const header = document.createElement("div"); | const header = document.createElement("div"); | ||
header.style.display = "flex"; | |||
header.style.alignItems = "center"; | |||
header.style.gap = "6px"; | |||
header.style.marginBottom = "8px"; | |||
const | const img1 = document.createElement("img"); | ||
img1.src = icon; | |||
img1.width = 15; | |||
img1.height = 15; | |||
const title = document.createElement("div"); | const title = document.createElement("div"); | ||
Line 42: | Line 30: | ||
title.style.fontWeight = "bold"; | title.style.fontWeight = "bold"; | ||
const | const img2 = document.createElement("img"); | ||
img2.src = icon; | |||
img2.width = 15; | |||
img2.height = 15; | |||
header.appendChild( | header.appendChild(img1); | ||
header.appendChild(title); | header.appendChild(title); | ||
header.appendChild( | header.appendChild(img2); | ||
const | const btn1 = document.createElement("button"); | ||
btn1.textContent = "Mass undo"; | |||
btn1.onclick = function () { | |||
prompt("Copy this into your common.js:", "mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Alexis_Jazz/Kill-It-With-Fire.js&action=raw&ctype=text/javascript');"); | |||
}; | }; | ||
const | const btn2 = document.createElement("button"); | ||
btn2.textContent = "Open Explanation"; | |||
btn2.onclick = function () { | |||
alert("Open Explanation clicked"); | |||
}; | }; | ||
btn1.style.marginBottom = "6px"; | |||
btn1.style.width = btn2.style.width = "100%"; | |||
btn1.style.cursor = btn2.style.cursor = "pointer"; | |||
menu.appendChild(header); | |||
menu.appendChild(btn1); | |||
menu.appendChild(btn2); | |||
document.body.appendChild(menu); | document.body.appendChild(menu); | ||
}; | })(); |
Revision as of 01:13, 27 June 2025
(function () {
const icon = "https://files.catbox.moe/wk78nl.jpg";
const menu = document.createElement("div");
menu.style.position = "fixed";
menu.style.top = "20px";
menu.style.right = "20px";
menu.style.background = "#111";
menu.style.color = "#fff";
menu.style.border = "2px solid #666";
menu.style.borderRadius = "10px";
menu.style.padding = "10px";
menu.style.fontFamily = "monospace";
menu.style.zIndex = "99999";
menu.style.boxShadow = "0 0 10px black";
const header = document.createElement("div");
header.style.display = "flex";
header.style.alignItems = "center";
header.style.gap = "6px";
header.style.marginBottom = "8px";
const img1 = document.createElement("img");
img1.src = icon;
img1.width = 15;
img1.height = 15;
const title = document.createElement("div");
title.textContent = "Mahito Menu";
title.style.fontWeight = "bold";
const img2 = document.createElement("img");
img2.src = icon;
img2.width = 15;
img2.height = 15;
header.appendChild(img1);
header.appendChild(title);
header.appendChild(img2);
const btn1 = document.createElement("button");
btn1.textContent = "Mass undo";
btn1.onclick = function () {
prompt("Copy this into your common.js:", "mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Alexis_Jazz/Kill-It-With-Fire.js&action=raw&ctype=text/javascript');");
};
const btn2 = document.createElement("button");
btn2.textContent = "Open Explanation";
btn2.onclick = function () {
alert("Open Explanation clicked");
};
btn1.style.marginBottom = "6px";
btn1.style.width = btn2.style.width = "100%";
btn1.style.cursor = btn2.style.cursor = "pointer";
menu.appendChild(header);
menu.appendChild(btn1);
menu.appendChild(btn2);
document.body.appendChild(menu);
})();