Difference between revisions of "Gadget-Login.js"
From ACES
Line 10: | Line 10: | ||
var linkEntry = $("<li></li>").addClass("cosmos-footerLinks-listItem"); | var linkEntry = $("<li></li>").addClass("cosmos-footerLinks-listItem"); | ||
var linkEle = $("<a></a>").text("Login") | var linkEle = $("<a></a>") | ||
.text("Login") | |||
.attr("href", wgArticlePath.replace("Special:UserLogin")); | |||
linkEntry.append(linkEle); | linkEntry.append(linkEle); | ||
Revision as of 22:15, 1 September 2021
$(function () {
"use strict";
if (window.LoginLink) {
return;
}
window.LoginLink = true;
mw.hook("wikipage.content").add(function ($content) {
mw.loader.using("mediawiki.api", function () {
var wgArticlePath = mw.config.get("wgArticlePath");
var linkEntry = $("<li></li>").addClass("cosmos-footerLinks-listItem");
var linkEle = $("<a></a>")
.text("Login")
.attr("href", wgArticlePath.replace("Special:UserLogin"));
linkEntry.append(linkEle);
$("#cosmos-footerLinks-places").append(linkEntry);
});
});
});