الفرق بين المراجعتين لصفحة: «وحدة:Lua banner»

تم حذف المحتوى تمت إضافة المحتوى
لا ملخص تعديل
لا ملخص تعديل
سطر 1:
-- This module implements the {{lua}} template.
 
local yesno = require('Module:Yesno')
local mListyesno = require('Moduleوحدة:ListYesno')
local mTableToolsmList = require('Moduleوحدة:TableToolsList')
local mMessageBoxmTableTools = require('Moduleوحدة:Message boxTableTools')
local yesnomMessageBox = require('Moduleوحدة:YesnoMessage box')
 
local p = {}
السطر 23 ⟵ 24:
local box = p.renderBox(modules)
local trackingCategories = p.renderTrackingCategories(args, modules)
if args.nocat and args.nocat ~= '' then
return box .. trackingCategories
end
if trackingCategories and trackingCategories ~= "" then
trackingCategories = mw.getCurrentFrame():preprocess('{{#تبديل:{{SUBPAGENAME}}|ملعب|ملعب2|doc|مختبر|نسخة|تجربة|شرح=|#default='.. trackingCategories .. "}}")
end
return box .. (trackingCategories or '')
end
 
السطر 29 ⟵ 35:
local boxArgs = {}
if #modules < 1 then
boxArgs.text = '<strong class="error">Errorخطأ: noلم modulesتذكر specifiedأي وحدة</strong>'
else
local moduleLinks = {}
السطر 36 ⟵ 42:
end
local moduleList = mList.makeList('bulleted', moduleLinks)
boxArgs.text = 'Thisهذا القالب يستعمل [[ ويكيبيديا:لوا|لوا]]:\n' .. moduleList
(mw.title.getCurrentTitle():inNamespaces(828,829) and 'module' or 'template') ..
' uses [[Wikipedia:Lua|Lua]]:\n' .. moduleList
end
boxArgs.type = 'notice'
boxArgs.small = true
boxArgs.image = '[[File:Lua-logo-nolabel.svg|30px|alt=Lua logo|link= ويكيبيديا:لوا]]'
return mMessageBox.main('mbox', boxArgs)
end
السطر 57 ⟵ 61:
cats[#cats + 1] = 'Lua templates with errors'
end
local protLevelscategories = {
['Module:String'] = 'قوالب تستند على وحدة String',
['Module:Math'] = 'Templatesقوالب basedتستند onعلى theوحدة Math Lua module',
['Module:BaseConvert'] = 'Templatesقوالب basedتستند onعلى theوحدة BaseConvert Lua module',
['Module:Citation'] = 'قوالب استشهاد تستند على وحدة لوا',
['Module:Citation/CS1'] = 'قوالب استشهاد تستند على وحدة لوا',
['وحدة:تحويلات بلدان'] = 'قوالب تستخدم وحدة تحويلات بلدان',
 
['وحدة:Flagg'] = 'قوالب تستخدم وحدة:Flagg',
['Module:Flagg'] = 'قوالب تستخدم وحدة:Flagg'
}
 
-- Lua templates category
titleObj = titleObj or mw.title.getCurrentTitle()
local subpageBlacklist = {
['doc'] = true,
sandbox['شرح'] = true,
sandbox2['sandbox'] = true,
testcases['ملعب'] = true,
['sandbox2'] = true,
['testcases'] = true,
['مختبر'] = true
}
if titleObj.namespace == 10
and not subpageBlacklist[titleObj.subpageText]
then
for i, moduleModule in ipairs(modules) do
local category = args.category
mw.log( Module )
if not category then
local categoriescate = {categories[ Module ]
if not cate and mw.ustring.find( Module , "وحدة:ب.ص.م", 1, true ) then
['Module:String'] = 'Lua String-based templates',
cate = "قوالب وحدة:ب.ص.م"
['Module:Math'] = 'Templates based on the Math Lua module',
}end
['Module:BaseConvert'] = 'Templates based on the BaseConvert Lua module',
if not cate and mw.ustring.find( Module , "Flagg", 1, true ) then
['Module:Citation'] = 'Lua-based citation templates'
cate = 'قوالب تستخدم وحدة:Flagg'
}
end
categories['Module:Citation/CS1'] = categories['Module:Citation']
if cate and cate ~= "" then
category = modules[1] and categories[modules[1]]
cats[#cats + 1] = categorycate
category = category or 'Lua-based templates'
end
cats[#cats + 1] = category
local protLevels = {
autoconfirmed = 1,
extendedconfirmed = 2,
templateeditor = 3,
sysop = 4
}
local currentProt = titleObj.protectionLevels["edit"][1]
if currentProt == nil then currentProt = 0 else currentProt = protLevels[currentProt] end
for i, module in ipairs(modules) do
local moduleProt = mw.title.new(module).protectionLevels["edit"][1]
if moduleProt == nil then moduleProt = 0 else moduleProt = protLevels[moduleProt] end
if moduleProt < currentProt then
cats[#cats + 1] = "Templates using under-protected Lua modules"
break
end
end
end
if #cats < 1 then
cats[#cats + 1] = 'قوالب تستند على وحدات لوا'
end