Jump to content

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

(Difference between pages)
Page 1
Page 2
Content deleted Content added
Add leavefirstcellblank per edit request
 
Heavily simplified a conditional snippet (the entire thing could be completely collapsed down into a single return statement)
 
Line 28: Line 28:
-- 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 114: Line 112:
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 141: Line 137:
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 262: Line 256:
-- 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