Vés al contingut

Mòdul:Wikidades i Mòdul:Wikidades/proves: Diferència entre les pàgines

(Diferència entre pàgines)
Pàgina 1
Pàgina 2
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 20230810 from master @cawiki
-- 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:Wikidata/i18n]]
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 whitelist[j] and whitelist[j][valueq or ""] then
if valueq then
rowlist[#values] = true
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] = false
rowlist[#values] = true
elseif ignorevalue[j] and ignorevalue[j][valueq or ""] then
end
values[#values]["col" .. j] = nil
end
elseif selectvalue[j] and not selectvalue[j][valueq or ""] then
values[#values]["col" .. j] = nil
elseif blacklist[j] then
for k, v in pairs(blacklist[j]) do
if v and string.find(valueq, k, 1, true) then
rowlist[#values] = false
end
end
elseif ignorevalue[j] then
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
elseif selectvalue[j] then
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
values[#values]["col" .. j] = nil
end
end
end
end
end
end