الفرق بين الصفحتين: «وحدة:Check for unknown parameters» و«وحدة:Check for unknown parameters/ملعب»

(الفرق بين الصفحتين)
اذهب إلى التنقل اذهب إلى البحث
صفحة 1
صفحة 2
ط (غيّر إعدادات حماية »وحدة:Check for unknown parameters«: بوت: [https://w.wiki/7NGP تحسين مستوي الحماية] ([تعديل=السماح للمحررين فقط] (غير محدد) [النقل=السماح للمحررين فقط] (غير محدد)))
 
(..)
 
سطر 41: سطر 41:
end
end
local frame = mw.getCurrentFrame()
local frame = mw.getCurrentFrame()
local template = args['template']
    local template = args['template']
if template == '' then template = nil end
    if template == '' then template = nil end


-- create the list of known args, regular expressions, and the return string
-- create the list of known args, regular expressions, and the return string
سطر 88: سطر 88:
-- add results to the output tables
-- add results to the output tables
local res = {}
local res = {}
local category = {}
if #values > 0 then
if #values > 0 then
local unknown_text = args['unknown'] or ('[[تصنيف:صفحات تستخدم: '.. (template and ('قالب ' .. template) or 'قوالب ') ..' بوسائط غير معروفة|_VALUE_]]')
local unknown_text = args['unknown'] or ('[[تصنيف:صفحات تستخدم: '.. (template and ('قالب ' .. template) or 'قوالب ') ..' بوسائط غير معروفة|_VALUE_]]')


if frame:preprocess( "{{REVISIONID}}" ) == "" then
        if frame:preprocess( "{{REVISIONID}}" ) == "" then
local preview_text =  '<code style="color:#cc0000">| _VALUE_</code>' -- args['preview'] or ('الوسيط <span style="color:#cc0000"><strong>_VALUE_</strong></span>' .. (template and ('في [[قالب:' .. template .. ' ]]') or '') .. ' غير مدعوم')
            local preview_text =  '<code style="color:#cc0000">| _VALUE_</code>' -- args['preview'] or ('الوسيط <span style="color:#cc0000"><strong>_VALUE_</strong></span>' .. (template and ('في [[قالب:' .. template .. ' ]]') or '') .. ' غير مدعوم')
--# هذا القسم معطل لأجل تجميع الوسائط
            --# هذا القسم معطل لأجل تجميع الوسائط
-- if isnotempty(preview_text) then
            --     if isnotempty(preview_text) then
-- preview_text = require('Module:If preview')._warning({preview_text})
            -- preview_text = require('Module:If preview')._warning({preview_text})
-- elseif preview_text == nil then
            -- elseif preview_text == nil then
-- preview_text = unknown_text
            -- preview_text = unknown_text
-- end
            -- end
unknown_text = preview_text
            unknown_text = preview_text
end
end
for _, v in pairs(values) do
for _, v in pairs(values) do
--#Added fix new line
v =  v:gsub("\n*$", "")
-- Fix odd bug for | = which gets stripped to the empty string and
-- Fix odd bug for | = which gets stripped to the empty string and
-- breaks category links
-- breaks category links
if v == '' then v = ' ' end
v =  v:gsub("\n*$", "")
            if v == '' then v = ' ' end


-- avoid error with v = 'example%2' ("invalid capture index")
            -- avoid error with v = 'example%2' ("invalid capture index")
local r = unknown_text:gsub('_VALUE_', {_VALUE_ = v})
local r = unknown_text:gsub('_VALUE_', {_VALUE_ = v})
table.insert(res, r)
table.insert(res, r)
end
end
end
end
--#Added Block
 
if frame:preprocess( "{{REVISIONID}}" ) == "" then
if frame:preprocess( "{{REVISIONID}}" ) == "" then
local cac = table.concat(res, '\n*')
        local cac = table.concat(res, '\n*')
if cac ~= '' then
if cac then
if #res == 1 then
            if #res == 1 then
cac = 'الوسيط ' .. cac .. (template and ('في [[قالب:' .. template .. ' ]]') or '') .. ' غير مدعوم يجب تبديله أو حذفه، طالع صفحة توثيق القالب لمعرفة الوسائط البديلة.'
                cac = 'الوسيط ' .. cac .. (template and ('في [[قالب:' .. template .. ' ]]') or '') .. ' غير مدعوم يجب تبديله أو حذفه، طالع صفحة توثيق القالب لمعرفة الوسائط البديلة.'
else
            else
cac = 'الوسائط التالية ' .. (template and ('في [[قالب:' .. template .. ' ]]') or '') .. ' غير مدعومة ' .. '\n*' .. cac .. '\nيجب تبديلها أو حذفها، طالع صفحة توثيق القالب لمعرفة الوسائط البديلة.'
                cac = 'الوسائط التالية ' .. (template and ('في [[قالب:' .. template .. ' ]]') or '') .. ' غير مدعومة ' .. '\n*' .. cac .. '\nيجب تبديلها أو حذفها، طالع صفحة توثيق القالب لمعرفة الوسائط البديلة.'
end
            end
cac = require('Module:If preview')._warning({cac})
            cac = require('Module:If preview')._warning({cac})
end
        end
return cac
        return cac
else  
else  
return table.concat(res)
return table.concat(res)