第7行: |
第7行: |
| | | |
| function p.display_title(type_flag, group_name, page_name) | | function p.display_title(type_flag, group_name, page_name) |
− | local node = mw.html.create("span") | + | local node = mw.html.create(nil) |
| if type_flag then | | if type_flag then |
| local type_name = PageName.type_name(type_flag) | | local type_name = PageName.type_name(type_flag) |
第39行: |
第39行: |
| end | | end |
| end | | end |
− | return node:done() | + | local code = node:done() |
| + | return { title = 'DISPLAYTITLE', args = { code } } |
| + | end |
| + | |
| + | function p.categorize(type_flag, group_name, page_name) |
| + | local temp, args, category |
| + | if type_flag == 'W' then |
| + | if page_name then |
| + | temp = "快速分类/世界观设定" |
| + | args = {['世界观'] = group_name} |
| + | else |
| + | temp = "快速分类/世界观介绍页" |
| + | args = {['世界观'] = group_name} |
| + | end |
| + | elseif type_flag == 'X' then |
| + | if page_name then |
| + | temp = "快速分类/联动/设定页" |
| + | args = {['联动'] = group_name} |
| + | else |
| + | temp = "快速分类/联动/首页" |
| + | args = {['联动'] = group_name} |
| + | end |
| + | else |
| + | temp = "快速分类/公共设定" |
| + | args = {} |
| + | end |
| + | return { title = temp, args = args } |
| end | | end |
| | | |
第46行: |
第72行: |
| local type_flag, group_name, page_name | | local type_flag, group_name, page_name |
| type_flag, group_name, page_name = PageName.parse(pagename) | | type_flag, group_name, page_name = PageName.parse(pagename) |
− | local title = p.display_title(type_flag, group_name, page_name) | + | local title = frame:expandTemplate(p.display_title(frame, type_flag, group_name, page_name)) |
− | return title | + | mw.smw.set({['设定标题']=pagename}) |
| + | local categorize = frame:expandTemplate(p.categorize(frame, type_flag, group_name, page_name)) |
| + | return title .. categorize |
| end | | end |
| | | |
| return p | | return p |