Module:If preview/sandbox: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 1:
local p = {}
p._counter = 1
local cfg = mw.loadData('Module:If preview/configuration')
 
Line 28 ⟶ 27:
function p.pmain(frame)
return p.main(frame:getParent())
end
 
function p.consoleWarning(frame)
mw.addWarning("[" .. p._counter .. "] " .. frame.args[1])
p._counter = p._counter + 1
return ''
end
 
Line 53 ⟶ 46:
if not cfg.preview then return '' end
return warning_text(warning) .. mw.getCurrentFrame():preprocess("{{safesubst:#invoke:If preview/sandbox|consoleWarning|1=" .. warning .. "}}")
end
 
Line 61 ⟶ 54:
This function returns a "preview warning", which is the first argument marked
up with HTML and some supporting text, depending on whether the page is being previewed.
 
disabled since we'll implement the template version in general
 
]]
--function p.warning(frame)
-- return p mw._warningaddWarning(frame.args[1])
return p._warning(frame.args)
--end
end
 
--[[
Line 73 ⟶ 65:
]]
function p.pwarning(frame)
mw.addWarning("[" .. p._counter .. "] " .. frame.args[1])
return p._warning(frame:getParent().args)
end