Jump to content

MediaWiki:Common.js: Difference between revisions

From Seduction Wiki
Use the Wingman logo, with permission from the copyright holder
Tag: Replaced
Wiki header is not the Wingman mark
 
Line 1: Line 1:
(function () {
(function () {
  var icon = "https://looksmaxxing.wiki/images/b/b9/Wingman_mark.png";
  var word = "https://looksmaxxing.wiki/images/3/30/Wingman_wordmark.png";
  var fav = "https://looksmaxxing.wiki/images/3/32/Wingman_favicon.png";
   var logo = "https://looksmaxxing.wiki/images/5/5f/Wingman_logo.png";
   var logo = "https://looksmaxxing.wiki/images/5/5f/Wingman_logo.png";
   function apply() {
   function apply() {
    document.querySelectorAll(".mw-logo-icon").forEach(function (img) {
     if (mw.config.get("wgPageName") !== "Wingman") return;
      img.src = icon;
    var box = document.querySelector(".infobox-image");
      img.removeAttribute("srcset");
    if (box && !box.querySelector("img")) {
      img.alt = "Wingman";
      var shot = document.createElement("img");
      img.style.width = "40px";
      shot.src = logo;
      img.style.height = "40px";
      shot.alt = "Wingman logo";
      img.style.objectFit = "contain";
      shot.width = 220;
      img.style.background = "#000";
      box.insertBefore(shot, box.firstChild);
      img.style.borderRadius = "3px";
      box.querySelectorAll("a.new").forEach(function (a) { a.style.display = "none"; });
    });
    document.querySelectorAll(".mw-logo-wordmark").forEach(function (el) {
      if (el.dataset.brand === "wingman") return;
      el.dataset.brand = "wingman";
      if (el.tagName === "IMG") {
        el.src = word;
        el.removeAttribute("srcset");
        el.alt = "Wingman";
        el.style.height = "28px";
        el.style.background = "#000";
        return;
      }
      el.textContent = "";
      var im = document.createElement("img");
      im.src = word;
      im.alt = "Wingman";
      im.style.height = "28px";
      im.style.width = "auto";
      im.style.verticalAlign = "middle";
      im.style.background = "#000";
      el.appendChild(im);
    });
    var links = document.querySelectorAll("link[rel='icon'], link[rel='shortcut icon']");
    if (!links.length) {
      var created = document.createElement("link");
      created.rel = "icon";
      document.head.appendChild(created);
      links = [created];
    }
    Array.prototype.forEach.call(links, function (l) {
      l.href = fav;
      l.type = "image/png";
    });
     if (mw.config.get("wgPageName") === "Wingman") {
      var box = document.querySelector(".infobox-image");
      if (box && !box.querySelector("img")) {
        var shot = document.createElement("img");
        shot.src = logo;
        shot.alt = "Wingman logo";
        shot.width = 220;
        box.insertBefore(shot, box.firstChild);
        box.querySelectorAll("a.new").forEach(function (a) { a.style.display = "none"; });
      }
     }
     }
   }
   }

Latest revision as of 06:23, 25 September 2026

(function () {
  var logo = "https://looksmaxxing.wiki/images/5/5f/Wingman_logo.png";
  function apply() {
    if (mw.config.get("wgPageName") !== "Wingman") return;
    var box = document.querySelector(".infobox-image");
    if (box && !box.querySelector("img")) {
      var shot = document.createElement("img");
      shot.src = logo;
      shot.alt = "Wingman logo";
      shot.width = 220;
      box.insertBefore(shot, box.firstChild);
      box.querySelectorAll("a.new").forEach(function (a) { a.style.display = "none"; });
    }
  }
  if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", apply);
  else apply();
})();