「モジュール:Information」の版間の差分
ナビゲーションに移動
検索に移動
Deploy templatestyles
細 (1版 をインポートしました) |
bsd>TheDJ (Deploy templatestyles) |
||
17行目: | 17行目: | ||
-- === Dependencies ====================== | -- === Dependencies ====================== | ||
-- ======================================= | -- ======================================= | ||
require(' | require('strict') -- used for debugging purposes as it detects cases of unintended global variables | ||
local ISOdate = require('Module:ISOdate')._ISOdate -- date localization | local ISOdate = require('Module:ISOdate')._ISOdate -- date localization | ||
local core = require('Module:Core') | local core = require('Module:Core') | ||
91行目: | 91行目: | ||
cell1 = mw.ustring.format('<td %sclass="fileinfo-paramfield" lang="%s">%s</td>\n', id or '', lang, tag) | cell1 = mw.ustring.format('<td %sclass="fileinfo-paramfield" lang="%s">%s</td>\n', id or '', lang, tag) | ||
cell2 = mw.ustring.format('<td %s>\n%s</td>', param.td or '', field or '') | cell2 = mw.ustring.format('<td %s>\n%s</td>', param.td or '', field or '') | ||
field = mw.ustring.format('<tr | field = mw.ustring.format('<tr>\n%s%s\n</tr>\n\n', cell1, cell2) | ||
end | end | ||
end | end | ||
table.insert(results, field) | table.insert(results, field) | ||
end | end | ||
local templatestyles = mw.getCurrentFrame():extensionTag{ | |||
name = 'templatestyles', args = { src = 'Module:Information/styles.css' } | |||
} | |||
-- add table and outer layers | -- add table and outer layers | ||
local style = mw.ustring.format('class="fileinfotpl-type-information | local style = mw.ustring.format('class="fileinfotpl-type-information vevent '.. | ||
'mw-content-%s" style=" | 'mw-content-%s" style="direction: %s;"', dir, dir) | ||
results = mw.ustring.format('<table %s>\n\n%s\n</table>\n', style, table.concat(results)) | results = mw.ustring.format('<table %s>\n\n%s\n</table>\n', style, table.concat(results)) | ||
results = mw.ustring.format('<div class="hproduct commons-file-information-table">\n%s\n</div>', results) | results = mw.ustring.format('<div class="hproduct commons-file-information-table">\n%s\n%s\n</div>', templatestyles, results) | ||
return results | return results | ||
end | end |