跳转到内容
打开/关闭搜索
搜索
打开/关闭菜单
389
文件
1
用户
6121
编辑
Gal中文百科
导航
首页
最近更改
随机页面
MediaWiki帮助
特殊页面
在其他项目中
打开/关闭外观设置菜单
无法加载偏好设置。请检查您的网络连接并重试。
重试
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。
user-interface-preferences
个人工具
讨论
贡献
创建账号
登录
编辑“︁
Module
:
TV program order
”︁
来自Gal中文百科
查看
阅读
编辑源代码
查看历史
associated-pages
模块
讨论
更多操作
更多
工具
链入页面
相关更改
页面信息
警告:
您没有登录。如果您进行任何编辑,您的IP地址会公开展示。如果您
登录
或
创建账号
,您的编辑会以您的用户名署名,此外还有其他益处。
反垃圾检查。
不要
加入这个!
local p = {} local yesno = require('Module:Yesno') local firstitem = false local function union(t1, t2, t3) local vals = {} for k, v in pairs(t1) do vals[v] = true end for k, v in pairs(t2) do vals[v] = true end for k, v in pairs(t3) do vals[v] = true end local ret = {} for k, v in pairs(vals) do table.insert(ret, k) end return ret end local function getArgNums(args, suffix) local nums = {} for k, v in pairs(args) do local num = mw.ustring.match(tostring(k), '^' .. '([1-9]%d*)' .. suffix .. '$') if num then table.insert(nums, tonumber(num)) end end table.sort(nums) return nums end local function makeTitle(rowArgs) if not rowArgs.title then return end local row = mw.html.create('tr') row:tag('th') :attr('colspan', 3) :wikitext(rowArgs.title) return row end local function makeNote(notes) if not notes.notea then return end local noteCell = mw.html.create('ul') noteCell :css('font-size', 'smaller') :css('font-weight', 'normal') :css('text-align', 'left') :tag('li') :wikitext(notes.notea) if notes.noteb then noteCell :tag('li') :wikitext(notes.noteb) end return noteCell end local function makeSimpleCell(cells) local dataCell = mw.html.create('td') if firstitem == true then dataCell :attr('rowspan', 2) :css('width', '33.33%') :css('font-weight', 'bold') end dataCell :cssText(cells.datastyle) :wikitext(cells.data) :node(makeNote({ notea = cells.notea, noteb = cells.noteb })) return dataCell end local function makeContentRow(contents) local row = mw.html.create('tr') row:node(makeSimpleCell({ data = contents.dataa, notea = contents.notea1, noteb = contents.noteb1 })) row:node(makeSimpleCell({ data = contents.datab, datastyle = 'font-weight:bold;', notea = contents.notea2, noteb = contents.noteb2 })) row:node(makeSimpleCell({ data = contents.datac, notea = contents.notea3, noteb = contents.noteb3 })) return row end function p._main(args) local root = mw.html.create() if args["hide"] then args["隐藏"] = args["hide"] elseif args["折叠"] then args["隐藏"] = args["折叠"] elseif args["折叠"] then args["隐藏"] = args["折叠"] elseif args["隐藏"] then args["隐藏"] = args["隐藏"] end if args["宽度"] then args["宽度"] = args["宽度"] end if args["电视台"] then args["电视台"] = args["电视台"] elseif args["电视台"] then args["电视台"] = args["电视台"] end if args["播放档次"] then args["播放档次"] = args["播放档次"] end if args["节目名称"] then args["节目名称"] = args["节目名称"] end if args["上一节目"] then args["上一节目"] = args["上一节目"] end if args["下一节目"] then args["下一节目"] = args["下一节目"] end if args["节目名称备注A"] then args["节目名称备注A"] = args["节目名称备注A"] end if args["节目名称备注B"] then args["节目名称备注B"] = args["节目名称备注B"] end if args["上一节目备注A"] then args["上一节目备注A"] = args["上一节目备注A"] end if args["上一节目备注B"] then args["上一节目备注B"] = args["上一节目备注B"] end if args["下一节目备注A"] then args["下一节目备注A"] = args["下一节目备注A"] end if args["下一节目备注B"] then args["下一节目备注B"] = args["下一节目备注B"] end args["隐藏"] = yesno(args["隐藏"], false) local tableRoot = root:tag('table') tableRoot :addClass('wikitable') :addClass(args["隐藏"] and 'mw-collapsible mw-collapsed' or nil) :css('margin', '1em auto') :css('font-size', '90%') :css('table-layout', 'fixed') :css('width', args["宽度"] or '598pt') :css('text-align', 'center') local s = '' if args["播放档次"] then s = args["播放档次"] end if args["电视台"] then s = args["电视台"] .. ' ' .. s end if s == '' then s = '{{{播放档次}}}' end tableRoot:node(makeTitle({ title = s })) local headerRow = tableRoot:tag('tr') local contentRow = tableRoot:tag('tr') firstitem = true headerRow :tag('th') :css('width', '33.33%') :wikitext('-{zh-hans:接档;zh-hant:上一节目;}-') headerRow:node(makeSimpleCell({ data = (args["节目名称"] or mw.title.getCurrentTitle().text), notea = args["节目名称备注A"], noteb = args["节目名称备注B"] })) headerRow :tag('th') :css('width', '33.33%') :wikitext('-{zh-hans:被接档;zh-hant:下一节目;}-') firstitem = false contentRow:node(makeSimpleCell({ data = (args["上一节目"] or '—'), notea = args["上一节目备注A"], noteb = args["上一节目备注B"] })) contentRow:node(makeSimpleCell({ data = (args["下一节目"] or '—'), notea = args["下一节目备注A"], noteb = args["下一节目备注B"] })) local nums = union(getArgNums(args, '播放[档档]次'), getArgNums(args, '上一[节节]目'), getArgNums(args, '下一[节节]目')) table.sort(nums) for _, num in ipairs(nums) do if tonumber(num) >=2 then if args[tostring(num) .. "电视台"] then args[tostring(num) .. "电视台"] = args[tostring(num) .. "电视台"] elseif args[tostring(num) .. "电视台"] then args[tostring(num) .. "电视台"] = args[tostring(num) .. "电视台"] end if args[tostring(num) .. "播放档次"] then args[tostring(num) .. "播放档次"] = args[tostring(num) .. "播放档次"] end if args[tostring(num) .. "节目名称"] then args[tostring(num) .. "节目名称"] = args[tostring(num) .. "节目名称"] end if args[tostring(num) .. "上一节目"] then args[tostring(num) .. "上一节目"] = args[tostring(num) .. "上一节目"] end if args[tostring(num) .. "下一节目"] then args[tostring(num) .. "下一节目"] = args[tostring(num) .. "下一节目"] end if args[tostring(num) .. "节目名称备注A"] then args[tostring(num) .. "节目名称备注A"] = args[tostring(num) .. "节目名称备注A"] end if args[tostring(num) .. "节目名称备注B"] then args[tostring(num) .. "节目名称备注B"] = args[tostring(num) .. "节目名称备注B"] end if args[tostring(num) .. "上一节目备注A"] then args[tostring(num) .. "上一节目备注A"] = args[tostring(num) .. "上一节目备注A"] end if args[tostring(num) .. "上一节目备注B"] then args[tostring(num) .. "上一节目备注B"] = args[tostring(num) .. "上一节目备注B"] end if args[tostring(num) .. "下一节目备注A"] then args[tostring(num) .. "下一节目备注A"] = args[tostring(num) .. "下一节目备注A"] end if args[tostring(num) .. "下一节目备注B"] then args[tostring(num) .. "下一节目备注B"] = args[tostring(num) .. "下一节目备注B"] end local sn = nil if args[tostring(num) .. '播放档次'] then sn = args[tostring(num) .. '播放档次'] if args[tostring(num) .. '电视台'] then sn = args[tostring(num) .. '电视台'] .. ' ' .. sn end end tableRoot:node(makeTitle({ title = sn })) tableRoot:node(makeContentRow({ dataa = (args[tostring(num) .. '上一节目'] or '—'), datab = (args[tostring(num) .. '节目名称'] or '第' .. tostring(num) .. '季'), datac = (args[tostring(num) .. '下一节目'] or '—'), notea1 = args[tostring(num) .. '上一节目备注A'], noteb1 = args[tostring(num) .. '上一节目备注B'], notea2 = args[tostring(num) .. '节目名称备注A'], noteb2 = args[tostring(num) .. '节目名称备注B'], notea3 = args[tostring(num) .. '下一节目备注A'], noteb3 = args[tostring(num) .. '下一节目备注B'] })) end end return tostring(root) end function p.main(frame) local args = require('Module:Arguments').getArgs(frame, { wrappers = 'Template:电视节目的变迁' }) return p._main(args) end return p
摘要:
请注意,所有对Gal中文百科的贡献均可能会被其他贡献者编辑、修改或删除。如果您不希望您的文字作品被随意编辑,请不要在此提交。
您同时也向我们承诺,您提交的内容为您自己所创作,或是复制自公共领域或类似自由来源(详情请见
Gal中文百科:著作权
)。
未经许可,请勿提交受著作权保护的作品!
取消
编辑帮助
(在新窗口中打开)
此页面嵌入的页面:
Module:TV program order/doc
(
编辑
)
编辑“︁
Module
:
TV program order
”︁
来自Gal中文百科