/* Adds a link to the toolbox to display the logs for a page. To remove ambiguity, it renames the existing link titled "Logs" that appears on user pa
/*
Adds a link to the toolbox to display the logs for a page.
To remove ambiguity, it renames the existing link titled "Logs" that appears
on user pages to "User logs".
Though both titles can be changed using:
DatRoot.LogLink.pageLogTitle = "Logs";
DatRoot.LogLink.userLogTitle = "User logs";
By default the link is added before the link "What links here".
To add before a different link use:
DatRoot.LogLink.addBefore =
Supplying the id of the element;
*/
importScript("User:DatRoot/Scripts/Common.js");
$(function(){ DatRoot.LogLink = function()
{
var obj = {};
if(wgNamespaceNumber >= 0) DatRoot.addOnloadHook(function()
{
var refElem = document.getElementById(obj.addBefore)
|| document.getElementById("t-whatlinkshere");
if(refElem)
{
// Add the new log link before given element
var htmlStrings = [
'<a', ' title="View the list of actions to this page"',
' href="/w/index.php?title=Special:Log&page=', wgPageName, '"',
'>', obj.pageLogTitle, '</a>' ];
var logLink = DatRoot.createElement("li", "t-pagelog", "", htmlStrings.join(""));
refElem.parentNode.insertBefore(logLink, refElem);
}
// If logs link for user exists, rename to "User logs"
var userLogLink = document.getElementById("t-log");
if(userLogLink) userLogLink.firstChild.innerHTML = obj.userLogTitle;
});
obj.addBefore = "t-whatlinkshere";
obj.pageLogTitle = "Logs";
obj.userLogTitle = "User logs";
return obj;
}();});
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.