پودمان:Infobox: تفاوت میان نسخه‌ها

۴۲۹ بایت اضافه‌شده ،  ‏۲۷ مارس ۲۰۲۰
جز
۱ نسخه واردشده
بدون خلاصۀ ویرایش
جز (۱ نسخه واردشده)
 
(۲۹ نسخهٔ میانی ویرایش شده توسط ۳ کاربر نشان داده نشد)
خط ۲: خط ۲:
-- This module implements {{Infobox}}
-- This module implements {{Infobox}}
--
--
 
local p = {}
local p = {}


خط ۴۹: خط ۴۹:
end
end
end
end
-- the next two lines add a newline at the end of lists for the PHP parser
-- https://www.iran-pedia.org/w/index.php?title=Template_talk:Infobox_musical_artist&oldid=849054481
-- remove when [[:phab:T191516]] is fixed or OBE
s = mw.ustring.gsub(s, '([\r\n][%*#;:][^\r\n]*)$', '%1\n')
s = mw.ustring.gsub(s, '^([%*#;:][^\r\n]*)$', '%1\n')
s = mw.ustring.gsub(s, '^([%*#;:])', '\n%1')
s = mw.ustring.gsub(s, '^(%{%|)', '\n%1')
return s
return s
else
else
خط ۱۲۹: خط ۱۳۶:
             :cssText(rowArgs.datastyle)
             :cssText(rowArgs.datastyle)
             :cssText(rowArgs.rowcellstyle)
             :cssText(rowArgs.rowcellstyle)
            :newline()
             :wikitext(fixChildBoxes(rowArgs.data, 'td'))
             :wikitext(fixChildBoxes(rowArgs.data, 'td'))
     end
     end
خط ۱۶۹: خط ۱۷۵:
                 :css('text-align', 'center')
                 :css('text-align', 'center')
                 :cssText(args.belowstyle)
                 :cssText(args.belowstyle)
                :newline()
                 :wikitext(fixChildBoxes(args.below,'td'))
                 :wikitext(fixChildBoxes(args.below,'td'))
end
end
خط ۱۸۴: خط ۱۸۹:
         addRow({
         addRow({
             data = args['subheader' .. tostring(num)],
             data = args['subheader' .. tostring(num)],
             datastyle = args.subheaderstyle or args['subheaderstyle' .. tostring(num)],
             datastyle = args.subheaderstyle,
            rowcellstyle = args['subheaderstyle' .. tostring(num)],
             class = args.subheaderclass,
             class = args.subheaderclass,
             rowclass = args['subheaderrowclass' .. tostring(num)]
             rowclass = args['subheaderrowclass' .. tostring(num)]
خط ۲۶۳: خط ۲۶۹:
local function renderTrackingCategories()
local function renderTrackingCategories()
     if args.decat ~= 'yes' then
     if args.decat ~= 'yes' then
         if #(getArgNums('data')) == 0 and mw.title.getCurrentTitle().namespace == 0 then
    if args.child == 'yes' then
        if args.title then
            root:wikitext('[[Category:Pages which use embedded infobox templates with the title parameter]]')
        end
         elseif #(getArgNums('data')) == 0 and mw.title.getCurrentTitle().namespace == 0 then
             root:wikitext('[[Category:Articles which use infobox templates with no data rows]]')
             root:wikitext('[[Category:Articles which use infobox templates with no data rows]]')
        end
        if args.child == 'yes' and args.title then
            root:wikitext('[[Category:Pages which use embedded infobox templates with the title parameter]]')
         end
         end
     end
     end
خط ۳۹۵: خط ۴۰۲:
     end
     end
      
      
     -- Parse the data parameters in the same order that the old {{Infobox}} did, so that
     -- Parse the data parameters in the same order that the old {{infobox}} did, so that
     -- references etc. will display in the expected places. Parameters that depend on
     -- references etc. will display in the expected places. Parameters that depend on
     -- another parameter are only processed if that parameter is present, to avoid
     -- another parameter are only processed if that parameter is present, to avoid