Home
Random
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Sanctions/AlertHelper
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
local p = {} local getArgs = require('Module:Arguments').getArgs local checkIfValidTopic = require('Module:Sanctions').checkIfValidTopic local function tableContains(needle, haystack) for _, v in pairs(haystack) do if v == needle then return true end end return false end local function syntaxHelp() return [[<span class="error">{{para|topic}} not specified. Available options:</span><div style="border-left: 5px dashed black; border-right: 5px dashed black; border-bottom: 5px dashed black; padding-left: 0.5em; padding-right: 0.5em; padding-bottom: 0.5em;"> {{Ds/topics/table}} {{Gs/topics/table|subst=y}} </div>]] end function p.build(frame, args) local topic = args[1] or args['topic'] local args = { topic, args[2], sig = args['sig'] } if not topic then return frame:preprocess(syntaxHelp()) end if checkIfValidTopic(topic) then return frame:expandTemplate { title = 'Gs/alert', args = args } else -- return to ds template, let it error if not recognised return frame:expandTemplate { title = 'Ds/alert', args = args } end end function p.main(frame) local args = getArgs(frame, { wrappers = { 'Template:Alert', 'Template:Alert/sandbox' } }) return p.build(frame, args) end return p
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:Sanctions/AlertHelper/doc
(
edit
)