Jump to content

User:Stumblean/common.js

From Domination Earth
Revision as of 01:11, 27 June 2025 by Stumblean (talk | contribs)

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
(function () {
  const iconURL = "https://files.catbox.moe/wk78nl.jpg";

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

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

  const leftIcon = document.createElement("img");
  leftIcon.src = iconURL;
  leftIcon.width = 15;
  leftIcon.height = 15;

  const rightIcon = document.createElement("img");
  rightIcon.src = iconURL;
  rightIcon.width = 15;
  rightIcon.height = 15;

  const title = document.createElement("span");
  title.textContent = "Mahito Menu";

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

  const undoBtn = document.createElement("button");
  undoBtn.textContent = "Mass undo";
  undoBtn.onclick = async () => {
    const text = "mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Alexis_Jazz/Kill-It-With-Fire.js&action=raw&ctype=text/javascript');";
    try {
      await navigator.clipboard.writeText(text);
      alert("Go to your common.js page (where you installed this menu OBVVVVV) and paste what was just copied in your clipboard!");
    } catch (e) {
      alert("Clipboard failed: " + e.message);
    }
  };

  const explanationBtn = document.createElement("button");
  explanationBtn.textContent = "Open Explanation";
  explanationBtn.onclick = () => alert("Explanation placeholder!");

  undoBtn.style.marginBottom = "6px";
  menu.appendChild(undoBtn);
  menu.appendChild(explanationBtn);

  document.body.appendChild(menu);
})();
Cookies help us deliver our services. By using our services, you agree to our use of cookies.