|
|
(未显示同一用户的25个中间版本) |
第1行: |
第1行: |
| -- text.jsonEncode({sp=W.site.namespaces},W.text.JSON_PRETTY)
| | local p = {} |
| local p={} | | function p.len(frame) |
| p.filter={text=mw.text.encode,json=mw.text.jsonEncode,no=function (x)return x end}
| | return #frame.args.a |
| function p.label_text(text) | |
| return tostring(mw.html.create('span'):addClass('label-text'):wikitext(text))
| |
| end | | end |
| function p.tab_img(id, config) | | function p.explode(frame) |
| if id then | | return mw.dumpObject({mw.ustring.byte(frame.args.a,1,-1)}) |
| local container = mw.html.create('div'):addClass('container')
| |
| if type(config)=="string" then
| |
| container:wikitext('[[文件:Songs '..id..'.jpg|256px|none]]',p.label_text('画师'),config)
| |
| elseif type(config)=="table" then
| |
| local img_tab=container:tag('div'):addClass('img-tab')
| |
| for _, tab in ipairs(config) do
| |
| img_tab:tag('div'):addClass('img-tab-part'):addClass(tab.class):wikitext(tab.tab)
| |
| local figure=container:tag('div'):addClass('nodesktop'):wikitext('[[文件:Songs '..id..' '..tab.suffix..'.jpg|256px|none]]',p.label_text('画师'),tab.illust)
| |
| if tab.suffix=="" then figure:addClass('active') end
| |
| end
| |
| end
| |
| return tostring(container)
| |
| end
| |
| -- return '[[文件:Songs '..tostring(id) .. '.jpg|点此上传图片]]'
| |
| end
| |
| function p.direct(frame)
| |
| return p.filter[frame.args[3]](p.tab_img(frame.args[1],frame.args[2]))
| |
| end
| |
| function p.jsonmode(frame)
| |
| return p.filter[frame.args[3]](p.tab_img(frame.args[1],mw.text.jsonDecode(frame.args[2])))
| |
| end | | end |
| return p | | return p |