User:Mike Dillon/Scripts/recentpages.js: Difference between revisions

Content deleted Content added
mNo edit summary
mNo edit summary
Line 36:
// Prepend the current page to the list, remove duplicates, and control item count
if (wgIsArticle) {
var currentPage = wgPageNamehistoryItems.replaceunshift("_", " "wgPageName);
historyItems.unshift(currentPage);
for (var n = 1; n < historyItems.length; n++) {
if (historyItems[n] == currentPagewgPageName) {
historyItems.splice(n, 1);
}
Line 56 ⟶ 55:
var itemUrl = wgArticlePath.replace(/\$1/,
encodeURIComponent(historyItems[n]));
itemUrl = itemUrl.replace(/%2f/igi, "/");
var itemLabel = historyItems[n].replace(/_/g, " ");
var itemSlash = itemLabel.lastIndexOf("/");
if (itemSlash != -1) itemLabel = itemLabel.substr(itemSlash + 1);