Difference between revisions of "Module:UserLinks/extra"
Jump to navigation
Jump to search
blackwiki>Mr. Stradivarius (add makeFullUrlLink function and beautify) |
blackwiki>Mr. Stradivarius (add a new message function) |
||
| Line 22: | Line 22: | ||
local linkFunctions = {} | local linkFunctions = {} | ||
| + | |||
| + | function linkFunctions.msg(snippets) | ||
| + | -- New message on user talk page | ||
| + | return makeFullUrlLink( | ||
| + | snippets.interwiki, | ||
| + | 3, | ||
| + | snippets.username, | ||
| + | { | ||
| + | action = 'edit', | ||
| + | section = 'new', | ||
| + | }, | ||
| + | 'message' | ||
| + | ) | ||
| + | end | ||
function linkFunctions.sbx(snippets) | function linkFunctions.sbx(snippets) | ||
Revision as of 11:53, 6 April 2014
Documentation for this module may be created at Module:UserLinks/extra/doc
--------------------------------------------------------------------------------
-- This module holds extra link functions for use with [[Module:UserLinks]].
--
-- It is intended for experimenting with new link functions that will eventually
-- be added to the main module code.
--
-- Since this module is transcluded in only a small number of pages, changes
-- should cause little server overhead and should propagate quickly.
--
-- Link functions using the same link code as a function in the main module will
-- be ignored; please give your function a unique code.
--------------------------------------------------------------------------------
-- Load shared helper functions
local mShared = require('Module:UserLinks/shared')
local raiseError = mShared.raiseError
local makeWikitextError = mShared.makeWikitextError
local makeWikilink = mShared.makeWikilink
local makeUrlLink = mShared.makeUrlLink
local makeFullUrlLink = mShared.makeFullUrlLink
local message = mShared.message
local linkFunctions = {}
function linkFunctions.msg(snippets)
-- New message on user talk page
return makeFullUrlLink(
snippets.interwiki,
3,
snippets.username,
{
action = 'edit',
section = 'new',
},
'message'
)
end
function linkFunctions.sbx(snippets)
-- User sandbox
return makeWikilink(
snippets.interwiki,
2,
snippets.username .. '/sandbox',
'sandbox'
)
end
return {linkFunctions = linkFunctions}