Difference between revisions of "Gadget-Login.js"
From ACES
(fix) |
|||
Line 12: | Line 12: | ||
var linkEle = $("<a></a>") | var linkEle = $("<a></a>") | ||
.text("Login") | .text("Login") | ||
.attr("href", wgArticlePath.replace("Special:UserLogin")); | .attr("href", wgArticlePath.replace("$1", "Special:UserLogin")); | ||
linkEntry.append(linkEle); | linkEntry.append(linkEle); | ||
Latest revision as of 22:16, 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("$1", "Special:UserLogin"));
linkEntry.append(linkEle);
$("#cosmos-footerLinks-places").append(linkEntry);
});
});
});