Modul:Infobox: Pabidaan ralatan
Konten dihapus Konten ditambahkan
Kadada kasimpulan babakan |
Kadada kasimpulan babakan |
||
Baris 13:
local marker = '<span class=special_infobox_marker>'
local s = sval
-- start moving templatestyles and categories inside of table rows
local slast = ''
while slast ~= s do
slast = s
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*%]%])', '%2%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(\127[^\127]*UNIQ%-%-templatestyles%-%x+%-QINU[^\127]*\127)', '%2%1')
end
-- end moving templatestyles and categories inside of table rows
s = mw.ustring.gsub(s, '(<%s*[Tt][Rr])', marker .. '%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>)', '%1' .. marker)
Baris 119 ⟶ 127:
if rowArgs.data then
root:wikitext(
'[[Category:Pages
)
end
elseif rowArgs.data and rowArgs.data:gsub(
category_in_empty_row_pattern, ''
):match('^%S') then
has_rows = true
Baris 375 ⟶ 383:
if args.title then
root:wikitext(
'[[Category:Pages
)
end
elseif #(getArgNums('data')) == 0 and mw.title.getCurrentTitle().namespace == 0 then
root:wikitext('[[Category:Articles
end
end
Baris 386 ⟶ 394:
Loads the templatestyles for the infobox.
TODO:
When we do this we should clean up the inline CSS below too.
Will have to do some bizarre conversion category like with sidebar.
]=]
local function loadTemplateStyles()
local frame = mw.getCurrentFrame()
-- See function description
local templatestyles = ''
if args['templatestyles'] then templatestyles = frame:extensionTag{
Baris 420 ⟶ 428:
return table.concat({
templatestyles,
child_templatestyles,
grandchild_templatestyles
})
end
-- common functions between the child and non child cases
local function structure_infobox_common()
renderSubheaders()▼
renderImages()▼
preprocessRows()▼
renderRows()▼
renderBelowRow()▼
renderNavBar()▼
renderItalicTitle()▼
renderEmptyRowCategories()▼
renderTrackingCategories()▼
cleanInfobox()▼
end
Baris 448 ⟶ 469:
:wikitext(args.title)
end
structure_infobox_common()
▲ renderSubheaders()
▲ renderImages()
▲ preprocessRows()
▲ renderRows()
▲ renderBelowRow()
▲ renderNavBar()
▲ renderItalicTitle()
▲ renderEmptyRowCategories()
▲ renderTrackingCategories()
▲ cleanInfobox()
return loadTemplateStyles() .. root
end
|