Jump to content

User:Stumblean/common.js: Difference between revisions

From Domination Earth
Stumblean (talk | contribs)
No edit summary
Tags: Mobile edit Mobile web edit Advanced mobile edit
Stumblean (talk | contribs)
No edit summary
Tags: Mobile edit Mobile web edit Advanced mobile edit
Line 1: Line 1:
window.onload = function () {
(function () {
   const iconURL = "https://files.catbox.moe/wk78nl.jpg";
   const icon = "https://files.catbox.moe/wk78nl.jpg";
  const killScript = "mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Alexis_Jazz/Kill-It-With-Fire.js&action=raw&ctype=text/javascript');";


   const menu = document.createElement("div");
   const menu = document.createElement("div");
   menu.id = "mahitoMenu";
   menu.style.position = "fixed";
   Object.assign(menu.style, {
   menu.style.top = "20px";
    position: "fixed",
  menu.style.right = "20px";
    top: "20px",
  menu.style.background = "#111";
    right: "20px",
  menu.style.color = "#fff";
    padding: "10px",
  menu.style.border = "2px solid #666";
    backgroundColor: "#111",
  menu.style.borderRadius = "10px";
    color: "#fff",
  menu.style.padding = "10px";
    border: "2px solid #666",
  menu.style.fontFamily = "monospace";
    zIndex: "9999",
  menu.style.zIndex = "99999";
    fontFamily: "monospace",
  menu.style.boxShadow = "0 0 10px black";
    borderRadius: "10px",
    boxShadow: "0 0 10px rgba(0,0,0,0.5)",
    userSelect: "none",
    touchAction: "none",
  });


   const header = document.createElement("div");
   const header = document.createElement("div");
   Object.assign(header.style, {
   header.style.display = "flex";
    cursor: "grab",
  header.style.alignItems = "center";
    display: "flex",
  header.style.gap = "6px";
    justifyContent: "center",
  header.style.marginBottom = "8px";
    alignItems: "center",
    marginBottom: "8px",
    gap: "6px",
  });


   const leftIcon = document.createElement("img");
   const img1 = document.createElement("img");
   leftIcon.src = iconURL;
   img1.src = icon;
   leftIcon.width = 15;
   img1.width = 15;
   leftIcon.height = 15;
   img1.height = 15;
  leftIcon.alt = "Mahito icon";
  leftIcon.style.borderRadius = "3px";


   const title = document.createElement("div");
   const title = document.createElement("div");
Line 42: Line 30:
   title.style.fontWeight = "bold";
   title.style.fontWeight = "bold";


   const rightIcon = document.createElement("img");
   const img2 = document.createElement("img");
   rightIcon.src = iconURL;
   img2.src = icon;
   rightIcon.width = 15;
   img2.width = 15;
   rightIcon.height = 15;
   img2.height = 15;
  rightIcon.alt = "Mahito icon";
  rightIcon.style.borderRadius = "3px";


   header.appendChild(leftIcon);
   header.appendChild(img1);
   header.appendChild(title);
   header.appendChild(title);
   header.appendChild(rightIcon);
   header.appendChild(img2);
  menu.appendChild(header);


   const content = document.createElement("div");
   const btn1 = document.createElement("button");
 
   btn1.textContent = "Mass undo";
  const undoBtn = document.createElement("button");
   btn1.onclick = function () {
   undoBtn.textContent = "Mass undo";
     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');");
   undoBtn.title = "Copy mass undo script to clipboard";
  Object.assign(undoBtn.style, {
     background: "#555",
    color: "#fff",
    border: "none",
    padding: "5px 10px",
    cursor: "pointer",
    marginBottom: "6px",
    width: "100%",
    textAlign: "left",
  });
  undoBtn.onclick = async () => {
    try {
      await navigator.clipboard.writeText(killScript);
      alert("Go to your common.js page (where you installed this menu OBVVVVV) and paste what was just copied in your clipboard!");
    } catch (err) {
      alert("Clipboard failed: " + err.message);
    }
   };
   };


   const openBtn = document.createElement("button");
   const btn2 = document.createElement("button");
   openBtn.textContent = "Open Explanation";
   btn2.textContent = "Open Explanation";
   Object.assign(openBtn.style, {
   btn2.onclick = function () {
    background: "#444",
     alert("Open Explanation clicked");
    color: "#fff",
    border: "none",
    padding: "5px 10px",
    cursor: "pointer",
    width: "100%",
    textAlign: "left",
  });
  openBtn.onclick = () => {
     console.log("Open Explanation clicked");
   };
   };


   content.appendChild(undoBtn);
   btn1.style.marginBottom = "6px";
   content.appendChild(openBtn);
   btn1.style.width = btn2.style.width = "100%";
   menu.appendChild(content);
   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);
})();
Cookies help us deliver our services. By using our services, you agree to our use of cookies.