No edit summary
No edit summary
Line 118: Line 118:
     var d = Math.floor(h / 24);
     var d = Math.floor(h / 24);
     return d + "d ago";
     return d + "d ago";
  }
  function jakeInjectStyles() {
    if (document.getElementById("jake-rc-style")) return;
    var style = document.createElement("style");
    style.id = "jake-rc-style";
    style.textContent =
      "#p-jake-recentchanges .vector-menu-heading{display:flex;align-items:center;justify-content:space-between;}" +
      "#p-jake-recentchanges .jake-rc-dot{width:8px;height:8px;border-radius:50%;background:#2da44e;box-shadow:0 0 0 2px rgba(45,164,78,.18);flex:0 0 auto;}" +
      "#p-jake-recentchanges .vector-menu-heading{font-size:.95em;}" +
      "#p-jake-recentchanges .vector-menu-content{font-size:.92em;}" +
      "#p-jake-recentchanges .jake-rc-meta{font-size:.85em;opacity:.85;}";
    document.head.appendChild(style);
   }
   }


Line 127: Line 141:
     if (!menu) return null;
     if (!menu) return null;
     if (document.getElementById("p-jake-recentchanges")) return null;
     if (document.getElementById("p-jake-recentchanges")) return null;
    jakeInjectStyles();


     var portlet = document.createElement("div");
     var portlet = document.createElement("div");
Line 134: Line 150:
     var heading = document.createElement("div");
     var heading = document.createElement("div");
     heading.className = "vector-menu-heading";
     heading.className = "vector-menu-heading";
     heading.textContent = "Recent changes";
 
     var headingText = document.createElement("span");
    headingText.textContent = "Recent changes";
 
    var dot = document.createElement("span");
    dot.className = "jake-rc-dot";
    dot.setAttribute("aria-hidden", "true");
    dot.title = "Live";
 
    heading.appendChild(headingText);
    heading.appendChild(dot);


     var content = document.createElement("div");
     var content = document.createElement("div");
Line 337: Line 363:
     }
     }


     add("https://discord.gg/8w5rSNAXRf", "Discord");
     // add("https://discord.gg/8w5rSNAXRf", "Discord");
     add("https://www.linkedin.com/company/consumer-rights-wiki/", "LinkedIn");
     add("https://www.linkedin.com/company/consumer-rights-wiki/", "LinkedIn");
     add("https://www.reddit.com/user/ConsumerRightsWiki/", "Reddit");
     add("https://www.reddit.com/user/ConsumerRightsWiki/", "Reddit");