Difference between revisions of "Gadget-Login.js"
From ACES
(Created page with "$(function () { "use strict"; if (window.LoginLink) { return; } window.LoginLink = true; mw.hook("wikipage.content").add(function ($content) { $("#cosmos-foo...") |
|||
Line 6: | Line 6: | ||
window.LoginLink = true; | window.LoginLink = true; | ||
mw.hook("wikipage.content").add(function ($content) { | mw.hook("wikipage.content").add(function ($content) { | ||
$("#cosmos-footerLinks-places"). | 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"); | |||
linkEle.href = wgArticlePath.replace("Special:UserLogin"); | |||
linkEntry.append(linkEle); | |||
$("#cosmos-footerLinks-places").append(linkEntry); | |||
}); | |||
}); | }); | ||
}); | }); |
Revision as of 22:12, 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");
linkEle.href = wgArticlePath.replace("Special:UserLogin");
linkEntry.append(linkEle);
$("#cosmos-footerLinks-places").append(linkEntry);
});
});
});