Editing Module:Param Parse
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 180: | Line 180: | ||
size = '|x'..height..'px' |
size = '|x'..height..'px' |
||
end |
end |
||
if name and mw.smw.ask('[['..name..']]|?Modification date=data')[1].data==nil then |
|||
imagecheck = imagecheck~=nil and imagecheck[1]~=nil and imagecheck[1].data~=nil |
|||
if name and imagecheck then |
|||
⚫ | |||
⚫ | |||
return '[['..name..size..']][[Category:Needs image]]' |
return '[['..name..size..']][[Category:Needs image]]' |
||
⚫ | |||
⚫ | |||
end |
end |
||
return nil |
return nil |
||
Line 213: | Line 211: | ||
-- Episode |
-- Episode |
||
local valid_episodes = { |
local valid_episodes = { |
||
['none'] = |
['none'] = 'None', |
||
['hopeport'] = |
['hopeport'] = 'Hopeport', |
||
['hopeforest'] = |
['hopeforest'] = 'Hopeforest', |
||
['mine of mantuban'] = |
['mine of mantuban'] = 'Mine of Mantuban', |
||
['crenopolis'] = |
['crenopolis'] = 'Crenopolis', |
||
['stonemaw hill'] = |
['stonemaw hill'] = 'Stonemaw Hill', |
||
['bleakholm crags'] = |
['bleakholm crags'] = 'Bleakholm Crags' |
||
} |
} |
||
function parse.episode_func(episode) |
function parse.episode_func(episode) |
||
local valid_episode = valid_episodes[string.lower(episode or '')] |
local valid_episode = valid_episodes[string.lower(episode or '')] |
||
if valid_episode then |
if valid_episode then |
||
⚫ | |||
local sort = valid_episode[1] |
|||
return '[[File:Unknown episode icon.png|18px|link=]] None' |
|||
local name = valid_episode[2] |
|||
else |
|||
local link = name |
|||
return '[[File:'..valid_episode..' episode icon.png|18px|link='..valid_episode..']] [['..valid_episode..']]' |
|||
local label = '[[' .. name .. ']]' |
|||
⚫ | |||
name = 'Unknown' |
|||
link = '' |
|||
label = 'None' |
|||
end |
end |
||
return ('<span data-sort-value="%s">[[File:%s episode icon.png|18px|link=%s]] %s</span>'):format(sort, name, link, label) |
|||
end |
end |
||
return nil |
return nil |
||
Line 240: | Line 233: | ||
local valid_episode = valid_episodes[string.lower(episode or '')] |
local valid_episode = valid_episodes[string.lower(episode or '')] |
||
if valid_episode then |
if valid_episode then |
||
return valid_episode |
return valid_episode |
||
end |
end |
||
return nil |
return nil |
||
Line 553: | Line 546: | ||
['monster'] = 'Monster', |
['monster'] = 'Monster', |
||
['skill node'] = 'Skill node', |
['skill node'] = 'Skill node', |
||
['venture'] = 'Venture' |
['venture'] = 'Venture' |
||
['bounty'] = 'Bounty' |
|||
} |
} |
||
function parse.variant_type_func(type) |
function parse.variant_type_func(type) |