Jump to content

Module:Archive list alpha and Module:Archive list alpha/sandbox: Difference between pages

(Difference between pages)
Page 1
Page 2
Content deleted Content added
m Protected "Module:Archive list alpha": High-risk template or module: 930 transclusions (more info) ([Edit=Require autoconfirmed or confirmed access] (indefinite))
 
Logic simplifications
 
Line 42: Line 42:
-- that the page doesn't exist.
-- that the page doesn't exist.
return false
return false
elseif titleObject then
return titleObject.exists
else
else
if titleObject then
return false -- Return false if given a bad title.
return titleObject.exists
else
return false -- Return false if given a bad title.
end
end
end
end
end
Line 129: Line 127:
lineNum = math.huge
lineNum = math.huge
end
end
elseif isLong==true then
lineNum = 3 -- Default to 3 links on long
else
else
lineNum = 10 -- Default to 10 on short
if isLong==true then
lineNum = 3 -- Default to 3 links on long
else
lineNum = 10 -- Default to 10 on short
end
end
end
return lineNum
return lineNum
Line 156: Line 152:
ret = 'Archive '
ret = 'Archive '
end
end
else --type is not long
elseif type(prefix) == 'string' then --type is not long
ret = prefix
if type(prefix) == 'string' then
ret = prefix
if space == 'yes' then
if space == 'yes' then
ret = ret .. ' '
ret = ret .. ' '
end
end
end
end
end
return ret
return ret
Line 170: Line 164:
local function getStart( start )
local function getStart( start )
start = processNumArg( start )
start = processNumArg( start )
if start then
return start or 1
return start
else
return 1
end
end
end


Line 278: Line 268:
-- Determine if format should be long
-- Determine if format should be long
local function findFormType( auto )
local function findFormType( auto )
if auto == nil or auto == '' then
return auto == 'long'
return false
elseif auto == 'long' then
return true
else
return false
end
end
end