Content deleted Content added
rename class to portalbox so that it will work on mobile |
add two entry points to simplify Module:Portal bar, clean up tracking logic. No behavior changes. |
||
Line 50:
-- Check whether to do tracking in this namespace
-- Returns true unless the page is one of the banned namespaces
local function checkTrackingNamespace(title)
local thisPage = title or mw.title.getCurrentTitle()
or (thisPage.namespace == 2) -- User
or (thisPage.namespace == 3) -- User talk
Line 63:
or (thisPage.namespace == 118) -- Draft
or (thisPage.namespace == 119) -- Draft talk
or (thisPage.namespace == 829)) -- Module talk
end▼
end
Line 73 ⟶ 69:
-- Returns false if the page title matches one of the banned strings
-- Otherwise returns true
local function checkTrackingPagename(title)
local thisPage = title or mw.title.getCurrentTitle()
local thisPageLC = mw.ustring.lower(thisPage.text)
end▼
▲ if (string.match(thisPageLC, "/doc") ~= nil) then
▲ if (string.match(thisPageLC, "/test") ~= nil) then
end
--Entry point to check if page should be category tracked
--Arguments:
-- title (optional): mw.title.Title object to evaluate. Defaults to current page
--Returns:
-- bool whether page should be tracked
function p._checkTracking(title)
title = title or mw.title.getCurrentTitle()
return checkTrackingNamespace(title) and checkTrackingPagename(title)
local function matchImagePage(s)
Line 290 ⟶ 288:
end
return portals, namedArgs
-- Entry point for sorting portals from other named arguments
function p._processPortalArgs(args)
return processPortalArgs(args)
end
|