Mòdul:Wikidades i Mòdul:Wikidades/proves: Diferència entre les pàgines
(Diferència entre pàgines)
Contingut suprimit Contingut afegit
https://ca.wikipedia.org/w/index.php?title=Tema:Xnwrepjvjyhh317p&topic_showPostId=xnwzp8e2s1cjmu8m#flow-post-xnwzp8e2s1cjmu8m |
m corr. com. |
||
Línia 1: | Línia 1: | ||
-- version |
-- version 20231204 from master @cawiki |
||
-- changes from previous version: whitelist, blacklist, ignorevalue and selectvalue work with multivalue qualifiers |
|||
local p = {} |
local p = {} |
||
-- Initialization of variables -------------------- |
-- Initialization of variables -------------------- |
||
local i18n = { -- internationalisation at [[Module: |
local i18n = { -- internationalisation at [[Module:Wikidades/i18n]] |
||
["errors"] = { |
["errors"] = { |
||
["property-not-found"] = "Property not found.", |
["property-not-found"] = "Property not found.", |
||
Línia 1.440: | Línia 1.439: | ||
sortkeys[#sortkeys]["col" .. j] = sortkeyq or valueq |
sortkeys[#sortkeys]["col" .. j] = sortkeyq or valueq |
||
if whitelist[j] or blacklist[j] or ignorevalue[j] or selectvalue[j] then |
if whitelist[j] or blacklist[j] or ignorevalue[j] or selectvalue[j] then |
||
valueq = valueraw or getValueOfClaim(claim, qual, {["formatting"]="raw", ["lang"]=params.lang}) |
valueq = valueraw or getValueOfClaim(claim, qual, {["formatting"]="raw", ["lang"]=params.lang, ["list"]=params.list}) |
||
if |
if valueq then |
||
if whitelist[j] then |
|||
for k, v in pairs(whitelist[j]) do |
|||
elseif blacklist[j] and blacklist[j][valueq or ""] then |
|||
if v and string.find(valueq, k, 1, true) then |
|||
⚫ | |||
rowlist[#values] = true |
|||
⚫ | |||
end |
|||
⚫ | |||
end |
|||
⚫ | |||
elseif blacklist[j] then |
|||
for k, v in pairs(blacklist[j]) do |
|||
if v and string.find(valueq, k, 1, true) then |
|||
⚫ | |||
end |
|||
end |
|||
⚫ | |||
for k, v in pairs(ignorevalue[j]) do |
|||
if v and string.find(valueq, k, 1, true) then |
|||
values[#values]["col" .. j] = nil |
|||
end |
|||
end |
|||
⚫ | |||
local selected |
|||
for k, v in pairs(selectvalue[j]) do |
|||
if v and string.find(valueq, k, 1, true) then |
|||
selected = true |
|||
end |
|||
end |
|||
if selected == nil then |
|||
⚫ | |||
end |
|||
end |
|||
end |
end |
||
end |
end |