Content deleted Content added
No edit summary Tags: Mobile edit Mobile web edit |
No edit summary |
||
Line 17:
};
$(function()
{
if(mw.config.get("wgCanonicalNamespace") == "Special")
{
switch(mw.config.get("wgCanonicalSpecialPageName"))
{
case "Contributions":
$(".mw-contributions-list").children().each(function()
{
break;
case "Userrights":
$("ul").children().each(function()
{
$(this).html(regexpReplace($(this).html(), 1, 5));
});
break;
case "Project":
// TODO
break;
}
}
else if(mw.config.get("wgCanonicalNamespace") == "File")
{
// Modify time in file history table.
$("td > a").each(function()
{
var text = $(this).text();
if(index > -1)
{
var time = text.substr(index - 2, 6);
// Will convert anything in a table matching the pattern "dd:dd," where d is a digit.
if(time.match(/\d\d:\d\d,/)) { $(this).text(partition(text)); }
}
});
}
switch(mw.config.get("wgAction"))
{
case "history":
$("span.mw-history-histlinks ~ a").each(function()
{
{
}
});
case "view":
if(document.title.indexOf("Difference between revisions") > -1)
{
var comp = "#mw-diff-ntitle1 > strong > a";
for(i = 0; i < 2; i++)
{
$(comp).html($(comp).html().replace(/(\d\d:\d\d)/g, convert(temp.substr(temp.indexOf(":") - 2, 5))));
comp = "#mw-diff-otitle1 > strong > a";
}
$(".diff-currentversion-title").html(partition($(".diff-currentversion-title").text()));
}
break;
case "edit":
// Modify time in the "This page has been moved or deleted" banner.
if($("div").hasClass("mw-warning-with-logexcerpt mw-content-ltr"))
{
$(".mw-logline-delete").html(regexpReplace($(".mw-logline-delete").html(), 1, 5));
}
}
// Modify the time in the footer of most pages.
if($("#footer-info-lastmod").length)
{
$("#footer-info-lastmod").text(partition($("#footer-info-lastmod").text()));
}
});
function partition(text)
{
var front = text.substr(0, text.indexOf(":") - 2);
var time = convert(text.substr(text.indexOf(":") - 2, 5));
var end = text.substr(text.indexOf(":") + 3, text.length);
return
}
function regexpReplace(
{
}
Line 150 ⟶ 122:
var hour = parseFloat(time.substr(0, 2));
if(hour >= 12
{
if(hour !=
{
hour = hour - 12;
}
}
if(hour === 0)
{
hour = 12;
}
return (hour + time.substr(2, 5) + " AM");
}
|