JasonHK留言 | 贡献
导入1个版本
第1行: 第1行:
local p = {}
local p = {}
local cfg = mw.loadData('Module:Navbar/configuration')
local cfg = mw.loadData('Module:Navbar/configuration')
local function renderTrackingCategories(builder, cats)
    local title = mw.title.getCurrentTitle()
    if title.namespace ~= 10 then return end -- not in template space
    local subpage = title.subpageText
    if subpage == 'doc' or subpage == 'sandbox' or subpage == 'testcases' then return end
   
    for i, cat in ipairs(cats) do
        builder:wikitext('[[Category:' .. cat .. ']]')
    end
end


local function get_title_arg(is_collapsible, template)
local function get_title_arg(is_collapsible, template)
第52行: 第41行:
end
end
ul:tag('li')
ul:tag('li')
:addClass('nv-' .. link_description.full)
:addClass('nv-' .. link_description.html_class)
:wikitext(l[1] .. link_description.link .. l[2])
:wikitext(l[1] .. link_description.link .. l[2])
:tag(is_mini and 'abbr' or 'span')
:tag(is_mini and 'abbr' or 'span')
第75行: 第64行:
local link_descriptions = {
local link_descriptions = {
{ ['mini'] = '-{zh-hans:查;zh-hant:閱;}-', ['full'] = '-{zh-hans:查看;zh-hant:檢視;}-', ['html_title'] = '-{zh-hans:查看;zh-hant:檢視;}-该模板',
{ ['mini'] = '-{zh-hans:查;zh-hant:閱;}-', ['full'] = '-{zh-hans:查看;zh-hant:檢視;}-', ['html_title'] = '-{zh-hans:查看;zh-hant:檢視;}-该模板',
['link'] = title.fullText, ['url'] = false },
['html_class'] = 'view', ['link'] = title.fullText, ['url'] = false },
{ ['mini'] = '论', ['full'] = '讨论', ['html_title'] = '讨论该模板',
{ ['mini'] = '论', ['full'] = '讨论', ['html_title'] = '讨论该模板',
['link'] = talkpage, ['url'] = false },
['html_class'] = 'talk', ['link'] = talkpage, ['url'] = false },
{ ['mini'] = '编', ['full'] = '编辑', ['html_title'] = '编辑该模板',
{ ['mini'] = '编', ['full'] = '编辑', ['html_title'] = '编辑该模板',
['link'] = title:fullUrl('action=edit'), ['url'] = true },
['html_class'] = 'edit', ['link'] = 'Special:EditPage/' .. title.fullText, ['url'] = false },
{ ['mini'] = '史', ['full'] = '历史', ['html_title'] = '该模板的历史',
{ ['mini'] = '史', ['full'] = '历史', ['html_title'] = '该模板的历史',
['link'] = title:fullUrl('action=history'), ['url'] = true },
['html_class'] = 'hist', ['link'] = 'Special:PageHistory/' .. title.fullText, ['url'] = false },
{ ['mini'] = '移', ['full'] = '移动', ['html_title'] = '移动该模板',
{ ['mini'] = '移', ['full'] = '移动', ['html_title'] = '移动该模板',
['link'] = mw.title.new('Special:Movepage'):fullUrl('target='..title.fullText), ['url'] = true },
['html_class'] = 'move', ['link'] = mw.title.new('Special:Movepage'):fullUrl('target='..title.fullText), ['url'] = true },
{ ['mini'] = '监', ['full'] = '监视', ['html_title'] = '监视该模板',  
{ ['mini'] = '监', ['full'] = '监视', ['html_title'] = '监视该模板',  
['link'] = title:fullUrl('action=watch'), ['url'] = true }
['html_class'] = 'watch', ['link'] = title:fullUrl('action=watch'), ['url'] = true }
}
}