<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.slipshine.net/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AShortcut</id>
		<title>Module:Shortcut - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.slipshine.net/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AShortcut"/>
		<link rel="alternate" type="text/html" href="http://wiki.slipshine.net/w/index.php?title=Module:Shortcut&amp;action=history"/>
		<updated>2026-04-17T23:08:21Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>http://wiki.slipshine.net/w/index.php?title=Module:Shortcut&amp;diff=168&amp;oldid=prev</id>
		<title>SuperHappy: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="http://wiki.slipshine.net/w/index.php?title=Module:Shortcut&amp;diff=168&amp;oldid=prev"/>
				<updated>2016-01-30T14:00:56Z</updated>
		
		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 14:00, 30 January 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan='2' style='text-align: center;' lang='en'&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>SuperHappy</name></author>	</entry>

	<entry>
		<id>http://wiki.slipshine.net/w/index.php?title=Module:Shortcut&amp;diff=167&amp;oldid=prev</id>
		<title>Mr. Stradivarius: Protected Module:Shortcut: High-risk Lua module ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and admins] (indefinite))</title>
		<link rel="alternate" type="text/html" href="http://wiki.slipshine.net/w/index.php?title=Module:Shortcut&amp;diff=167&amp;oldid=prev"/>
				<updated>2014-12-17T12:23:32Z</updated>
		
		<summary type="html">&lt;p&gt;Protected Module:Shortcut: &lt;a href=&quot;/w/index.php?title=WP:High-risk_templates&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;WP:High-risk templates (page does not exist)&quot;&gt;High-risk Lua module&lt;/a&gt; ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and admins] (indefinite))&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module implements {{shortcut}}.&lt;br /&gt;
&lt;br /&gt;
-- Set constants&lt;br /&gt;
local CONFIG_MODULE = 'Module:Shortcut/config'&lt;br /&gt;
&lt;br /&gt;
-- Load required modules&lt;br /&gt;
local checkType = require('libraryUtil').checkType&lt;br /&gt;
local yesno = require('Module:Yesno')&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local function message(msg, ...)&lt;br /&gt;
	return mw.message.newRawMessage(msg, ...):plain()&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function makeCategoryLink(cat)&lt;br /&gt;
	return string.format('[[%s:%s]]', mw.site.namespaces[14].name, cat)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(shortcuts, options, frame, cfg)&lt;br /&gt;
	checkType('_main', 1, shortcuts, 'table')&lt;br /&gt;
	checkType('_main', 2, options, 'table', true)&lt;br /&gt;
	options = options or {}&lt;br /&gt;
	frame = frame or mw.getCurrentFrame()&lt;br /&gt;
	cfg = cfg or mw.loadData(CONFIG_MODULE)&lt;br /&gt;
	local isCategorized = yesno(options.category) ~= false&lt;br /&gt;
&lt;br /&gt;
	-- Validate shortcuts&lt;br /&gt;
	for i, shortcut in ipairs(shortcuts) do&lt;br /&gt;
		if type(shortcut) ~= 'string' or #shortcut &amp;lt; 1 then&lt;br /&gt;
			error(message(cfg['invalid-shortcut-error'], i), 2)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Make the list items. These are the shortcuts plus any extra lines such&lt;br /&gt;
	-- as options.msg.&lt;br /&gt;
	local listItems = {}&lt;br /&gt;
	for i, shortcut in ipairs(shortcuts) do&lt;br /&gt;
		listItems[i] = string.format('[[%s]]', shortcut)&lt;br /&gt;
	end&lt;br /&gt;
	table.insert(listItems, options.msg)&lt;br /&gt;
&lt;br /&gt;
	-- Return an error if we have nothing to display&lt;br /&gt;
	if #listItems &amp;lt; 1 then&lt;br /&gt;
		local msg = cfg['no-content-error']&lt;br /&gt;
		msg = string.format('&amp;lt;strong class=&amp;quot;error&amp;quot;&amp;gt;%s&amp;lt;/strong&amp;gt;', msg)&lt;br /&gt;
		if isCategorized and cfg['no-content-error-category'] then&lt;br /&gt;
			msg = msg .. makeCategoryLink(cfg['no-content-error-category'])&lt;br /&gt;
		end&lt;br /&gt;
		return msg&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local root = mw.html.create()&lt;br /&gt;
&lt;br /&gt;
	-- Anchors&lt;br /&gt;
	local anchorDiv = root&lt;br /&gt;
		:tag('div')&lt;br /&gt;
			:css('position', 'relative')&lt;br /&gt;
			:css('top', '-3em')&lt;br /&gt;
	for i, shortcut in ipairs(shortcuts) do&lt;br /&gt;
		local anchor = mw.uri.anchorEncode(shortcut)&lt;br /&gt;
		anchorDiv:tag('span'):attr('id', anchor)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	root:newline() -- To match the old [[Template:Shortcut]]&lt;br /&gt;
&lt;br /&gt;
	-- Shortcut heading&lt;br /&gt;
	local shortcutHeading&lt;br /&gt;
	do&lt;br /&gt;
		local nShortcuts = #shortcuts&lt;br /&gt;
		if nShortcuts &amp;gt; 0 then&lt;br /&gt;
			shortcutHeading = message(cfg['shortcut-heading'], nShortcuts)&lt;br /&gt;
			shortcutHeading = frame:preprocess(shortcutHeading)&lt;br /&gt;
			shortcutHeading = shortcutHeading .. '\n'&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Shortcut box&lt;br /&gt;
	local shortcutList = root&lt;br /&gt;
		:tag('table')&lt;br /&gt;
			:addClass('shortcutbox noprint')&lt;br /&gt;
			:css('float', 'right')&lt;br /&gt;
			:css('border', '1px solid #aaa')&lt;br /&gt;
			:css('background', '#fff')&lt;br /&gt;
			:css('margin', '.3em .3em .3em 1em')&lt;br /&gt;
			:css('padding', '3px')&lt;br /&gt;
			:css('text-align', 'center')&lt;br /&gt;
				:tag('tr')&lt;br /&gt;
					:tag('th')&lt;br /&gt;
						:addClass('plainlist')&lt;br /&gt;
						:css('border', 'none')&lt;br /&gt;
						:css('background', 'transparent')&lt;br /&gt;
						:tag('small')&lt;br /&gt;
							:wikitext(shortcutHeading)&lt;br /&gt;
							:tag('ul')&lt;br /&gt;
	for i, item in ipairs(listItems) do&lt;br /&gt;
		shortcutList:tag('li'):wikitext(item)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Output an error category if the first shortcut doesn't exist&lt;br /&gt;
	if isCategorized&lt;br /&gt;
		and shortcuts[1]&lt;br /&gt;
		and cfg['first-parameter-error-category']&lt;br /&gt;
	then&lt;br /&gt;
		local title = mw.title.new(shortcuts[1])&lt;br /&gt;
		if not title or not title.exists then&lt;br /&gt;
			root:wikitext(makeCategoryLink(cfg['first-parameter-error-category']))&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return tostring(root)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = require('Module:Arguments').getArgs(frame, {&lt;br /&gt;
		wrappers = 'Template:Shortcut'&lt;br /&gt;
	})&lt;br /&gt;
&lt;br /&gt;
	-- Separate shortcuts from options&lt;br /&gt;
	local shortcuts, options = {}, {}&lt;br /&gt;
	for k, v in pairs(args) do&lt;br /&gt;
		if type(k) == 'number' then&lt;br /&gt;
			shortcuts[k] = v&lt;br /&gt;
		else&lt;br /&gt;
			options[k] = v&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Compress the shortcut array, which may contain nils.&lt;br /&gt;
	local function compressArray(t)&lt;br /&gt;
		local nums, ret = {}, {}&lt;br /&gt;
		for k in pairs(t) do&lt;br /&gt;
			nums[#nums + 1] = k&lt;br /&gt;
		end&lt;br /&gt;
		table.sort(nums)&lt;br /&gt;
		for i, num in ipairs(nums) do&lt;br /&gt;
			ret[i] = t[num]&lt;br /&gt;
		end&lt;br /&gt;
		return ret&lt;br /&gt;
	end&lt;br /&gt;
	shortcuts = compressArray(shortcuts)&lt;br /&gt;
&lt;br /&gt;
	return p._main(shortcuts, options, frame)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Mr. Stradivarius</name></author>	</entry>

	</feed>