Automoderated users, Autopatrolled users, Bureaucrats, Comment administrators, Confirmed users, Moderators, Rollbackers, Administrators
213,518
edits
mNo edit summary |
Tag: Undo |
||
(15 intermediate revisions by 2 users not shown) | |||
Line 9:
"Analysis", "Characters", "Laconic", "Recap", "Trivia", "Setting", "YMMV",
"Fridge", "Fanfic Recs", "Haiku", "Headscratchers", "Ho Yay", "Image Links",
"Memes", "Radar", "Quotes", "Reviews", "Source", "Useful Notes", "WMG"
},
["creator"] = {"YMMV", "Quotes", "Fanfic Recs", "Analysis", "Trivia", "WMG", "Image Links", "Haiku", "Laconic"}
Line 15:
local crowners = {
["trope"] = { "Animation", "Animated Films", "Anime", "Anime and Manga", "Board Games", "Comics", "Comic Books",
"Fan Works", "
"
"
"Opera", "Professional Wrestling", "Puppet Shows", "Radio", "Tabletop Games", "Tabletop RPGs",
"Television", "TV",
"Theatre", "Theater", "Toys",
"Webcomics", "Video Games", "Visual Art", "Visual Novels",
Line 34 ⟶ 36:
local insert = table.insert
local concat = table.concat
local find =
local len =
local sub =
local rep =
local listlevel = { '*', '**', '***', '****', '*****' }
Line 51 ⟶ 53:
if template == "index" then
template = "trope"
crowners["trope"] = {}
mainpage = ":" .. page
page = page:gsub("Category:", "", 1)
Line 62 ⟶ 65:
local tree = build_tree(page, subpage_list)
-- initialize result with Main link
Line 108 ⟶ 110:
local jsdata = '<div id="tm-data" style="display:none" '
.. 'data-toplevelpage="' .. page .. '" '
.. 'data-wanted="' .. concat( missingout, "
.. 'data-templatetype="' .. template .. '" '
.. '></div>'
Line 128 ⟶ 130:
.. '* <strong><span id="tm-New"></span>Create New</strong><ul id="tm-wantedpages"></ul>\n'
.. jsdata
end
function sp.tree ( frame )
local page = frame.args[1] or frame:callParserFunction('TOPLEVELPAGE')
local allsptxt = frame:callParserFunction('SUBPAGES', { page, sep = "|" })
local subpage_list = split(allsptxt, "|")
local tree = build_tree(page, subpage_list)
if page:match("^Category:") then page = ":"..page end
return "; [["..page.."]]\n" .. build_list( tree, page..'/', 1 )
end
Line 141 ⟶ 155:
for i, dir in ipairs(list) do
if lastdir[dir] == nil then lastdir[dir] = { } end
lastdir = lastdir[dir]
end
Line 152 ⟶ 166:
local ul = {}
for page, branch in pairs(tree) do▼
local ordered_sp = {}
insert(ordered_sp, page)
end
table.sort(ordered_sp)
for i = 1, #ordered_sp do
local page = ordered_sp[i]
local branch = tree[page]
local li
|