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

صفحه‌ای تازه حاوی «local yesno = require('Module:Yesno') local mList = require('Module:List') local mTableTools = require('Module:TableTools') local mMessageB...» ایجاد کرد
fa>Wikivahdat
(Matching reality rather than 2018 me's wishful thinking)
 
(صفحه‌ای تازه حاوی «local yesno = require('Module:Yesno') local mList = require('Module:List') local mTableTools = require('Module:TableTools') local mMessageB...» ایجاد کرد)
خط ۱۹: خط ۱۹:
type = 'notice',
type = 'notice',
small = true,
small = true,
image = string.format('[[File:Farm-Fresh css add.svg|32px|alt=%s]]', format('logo-alt'))
image = mw.ustring.format('[[پرونده:Farm-Fresh css add.svg|32px|alt=%s]]', format('logo-alt'))
}
}
if #tStyles < 1 then
if #tStyles < 1 then
boxArgs.text = string.format('<strong class="error">%s</strong>', format('error-emptylist'))
boxArgs.text = mw.ustring.format('<strong class="error">%s</strong>', format('error-emptylist'))
else
else
local cfg = getConfig()
local cfg = getConfig()
local tStylesLinks = {}
local tStylesLinks = {}
for i, ts in ipairs(tStyles) do
for i, ts in ipairs(tStyles) do
local link = string.format('[[:%s]]', ts)
local link = mw.ustring.format('[[:%s]]', mw.ustring.gsub(mw.ustring.gsub(ts, "[Mm]odule:", "پودمان:"), "[Tt]emplate:", "الگو:"))
local sandboxLink = nil
local sandboxLink = nil
local tsTitle = mw.title.new(ts)
local tsTitle = mw.title.new(ts)
if tsTitle and cfg['sandbox_title'] then
if tsTitle and cfg['sandbox_title'] then
local tsSandboxTitle = mw.title.new(string.format(
local tsSandboxTitle = mw.title.new(mw.ustring.format(
'%s:%s/%s/%s', tsTitle.nsText, tsTitle.baseText, cfg['sandbox_title'], tsTitle.subpageText))
'%s:%s/%s/%s', tsTitle.nsText, tsTitle.baseText, cfg['sandbox_title'], tsTitle.subpageText))
if tsSandboxTitle and tsSandboxTitle.exists then
if tsSandboxTitle and tsSandboxTitle.exists then
خط ۴۸: خط ۴۸:


local function renderTrackingCategories(args, tStyles, titleObj)
local function renderTrackingCategories(args, tStyles, titleObj)
if yesno(args.nocat) then
if yesno(args.nocat or args['بی‌رده']) then
return ''
return ''
end
end
خط ۶۶: خط ۶۶:
and not cfg['subpage_blacklist'][titleObj.subpageText]
and not cfg['subpage_blacklist'][titleObj.subpageText]
then
then
local category = args.category or cfg['default_category']
local category = args.category or args['رده'] or cfg['default_category']
if category then
if category then
cats[#cats + 1] = category
cats[#cats + 1] = category
end
end
if not yesno(args.noprotcat) and (cfg['protection_conflict_category'] or cfg['padlock_pattern']) then
if not yesno(args.noprotcat or args['بدون رده محافظت']) and (cfg['protection_conflict_category'] or cfg['padlock_pattern']) then
local currentProt = titleObj.protectionLevels["edit"] and titleObj.protectionLevels["edit"][1] or nil
local currentProt = titleObj.protectionLevels["edit"] and titleObj.protectionLevels["edit"][1] or nil
local addedLevelCat = false
local addedLevelCat = false
خط ۹۶: خط ۹۶:
end
end
for i, cat in ipairs(cats) do
for i, cat in ipairs(cats) do
cats[i] = string.format('[[Category:%s]]', cat)
cats[i] = mw.ustring.format('[[رده:%s]]', cat)
end
end
return table.concat(cats)
return table.concat(cats)
خط ۱۱۲: خط ۱۱۲:
local args = {}
local args = {}
for k, v in pairs(origArgs) do
for k, v in pairs(origArgs) do
v = v:match('^%s*(.-)%s*$')
v = mw.ustring.match(v, '^%s*(.-)%s*$')
if v ~= '' then
if v ~= '' then
args[k] = v
args[k] = v
۸٬۱۲۶

ویرایش