Content deleted Content added
narrow API, construct boxArgs with 3 items directly |
Fixed |
||
(5 intermediate revisions by the same user not shown) | |||
Line 77:
local tsTitleObj = mw.title.new(ts)
local tsProt = tsTitleObj.protectionLevels["edit"] and tsTitleObj.protectionLevels["edit"][1] or nil
if cfg['protection_conflict_category'] and tsProt ~= currentProt and not addedLevelCat then▼
addedLevelCat = true▼
cats[#cats + 1] = cfg['protection_conflict_category']▼
end▼
if cfg['padlock_pattern'] and tsProt and not addedPadlockCat then
local content = tsTitleObj:getContent()
Line 86 ⟶ 82:
cats[#cats + 1] = cfg['missing_padlock_category']
addedPadlockCat = true
end
▲ end
▲ if cfg['protection_conflict_category'] and currentProt and tsProt ~= currentProt and not addedLevelCat then
currentProt = cfg['protection_hierarchy'][currentProt] or 0
tsProt = cfg['protection_hierarchy'][tsProt] or 0
if tsProt < currentProt then
▲ addedLevelCat = true
▲ cats[#cats + 1] = cfg['protection_conflict_category']
end
end
Line 97 ⟶ 101:
end
function p._main(args
local cfg = getConfig()
if #args == 0 then
local prefixed = mw.title.getCurrentTitle().prefixedText
prefixed = prefixed:gsub("/doc","")
args[1] = prefixed .. "/" .. cfg["default_subpage_name"]
end
local tStyles = mTableTools.compressSparseArray(args)
local box = renderBox(tStyles)
|