Home
Random
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Sandbox/Deryck Chan/rfdt
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 rfd = {} function rfd.test1 (frame) local test_string1 = frame.args[1] return test_string1 end function rfd.test2 (frame) --this bit dumps a noinclude into the final output local test_string11 = frame.args[1] local test_string12 = frame.args[2] return test_string11 .. '<noinclude>' .. test_string12 .. '</noinclude>' end function rfd.test3(frame) --this bit literally just dumps a human understandable safesubst string local linkstring = '[[{{ {{{|safesubst:}}}FULLPAGENAME}}#{{ {{{|safesubst:}}}CURRENTTIMESTAMP}}]]' local anchorstring = '<span id="{{ {{{|safesubst:}}}CURRENTTIMESTAMP}}"></span>' return linkstring end function rfd.test4(frame) return mw.title.getCurrentTitle() end function rfd.rfdt_collapsebox(frame) --this bit creates the "closed discussion" notice local message_string1 = '<includeonly>[[File:Symbol move vote.svg|16px|link=|alt=]] ' .. "'''Closed discussion''', click " local link_string = "[[{{ {{{|safesubst:}}}FULLPAGENAME}}#{{ {{{|safesubst:}}}CURRENTTIMESTAMP}}|here]]" local message_string2 = ' to view full discussion.' local result_string = '' if (frame.args[1]) then --this line doesn't work yet because Lua evaluates an empty string as true result_string = ' Result was: ' .. frame.args[1] end local end_string = '</includeonly><noinclude>' return message_string1 .. link_string .. message_string2 .. result_string .. end_string end function rfd.rfdb_noinclude(frame) return '</noinclude>' end function rfd.generate_icon(frame) local function match_result(result_parameter) local find_count = 0 local result_match = '' local parameter_lower = result_parameter:lower() if (parameter_lower:find('keep')) then result_match = 'Keep' find_count = find_count + 1 end if (parameter_lower:find('delete')) then result_match = 'Delete' find_count = find_count + 1 end if (parameter_lower:find('retarget')) then result_match = 'Retarget' find_count = find_count + 1 end if (parameter_lower:find('disambiguate') or parameter_lower:find('dab') or parameter_lower:find('sia') or parameter_lower:find('set index')) then result_match = 'Disambiguate' find_count = find_count + 1 end if find_count >= 2 then result_match = 'Multiple' elseif find_count <= 0 then result_match = 'None' end return result_match, 'lalala' end local result_string1, result_string2 = match_result(frame.args[1]) return result_string1 .. 'abcd' .. result_string2 end return rfd
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:Sandbox/Deryck Chan/rfdt/doc
(
edit
)