<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>https://wiki-data.rcsi.science/index.php?action=history&amp;feed=atom&amp;title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C%3AShortcut</id>
	<title>Модуль:Shortcut - История изменений</title>
	<link rel="self" type="application/atom+xml" href="https://wiki-data.rcsi.science/index.php?action=history&amp;feed=atom&amp;title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C%3AShortcut"/>
	<link rel="alternate" type="text/html" href="https://wiki-data.rcsi.science/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:Shortcut&amp;action=history"/>
	<updated>2026-04-03T19:22:25Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.36.1</generator>
	<entry>
		<id>https://wiki-data.rcsi.science/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:Shortcut&amp;diff=820&amp;oldid=prev</id>
		<title>Admin: 1 версия импортирована</title>
		<link rel="alternate" type="text/html" href="https://wiki-data.rcsi.science/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:Shortcut&amp;diff=820&amp;oldid=prev"/>
		<updated>2021-11-15T13:50:13Z</updated>

		<summary type="html">&lt;p&gt;1 версия импортирована&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Версия 13:50, 15 ноября 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://wiki-data.rcsi.science/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:Shortcut&amp;diff=819&amp;oldid=prev</id>
		<title>ru&gt;Jonesey95: attempt fix suggested in 2019 talk archive</title>
		<link rel="alternate" type="text/html" href="https://wiki-data.rcsi.science/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:Shortcut&amp;diff=819&amp;oldid=prev"/>
		<updated>2021-03-11T14:27:25Z</updated>

		<summary type="html">&lt;p&gt;attempt fix suggested in 2019 talk archive&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&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 templateMode = options.template and yesno(options.template)&lt;br /&gt;
	local redirectMode = options.redirect and yesno(options.redirect)&lt;br /&gt;
	local isCategorized = not options.category or 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;
		local templatePath, prefix&lt;br /&gt;
		if templateMode then&lt;br /&gt;
			-- Namespace detection&lt;br /&gt;
			local titleObj = mw.title.new(shortcut, 10)&lt;br /&gt;
			if titleObj.namespace == 10 then&lt;br /&gt;
				templatePath = titleObj.fullText&lt;br /&gt;
			else&lt;br /&gt;
				templatePath = shortcut&lt;br /&gt;
			end&lt;br /&gt;
			prefix = options['pre' .. i] or options.pre or ''&lt;br /&gt;
		end&lt;br /&gt;
		if options.target and yesno(options.target) then&lt;br /&gt;
			listItems[i] = templateMode&lt;br /&gt;
				and string.format(&amp;quot;&amp;amp;#123;&amp;amp;#123;%s[[%s|%s]]&amp;amp;#125;&amp;amp;#125;&amp;quot;, prefix, templatePath, shortcut)&lt;br /&gt;
				or string.format(&amp;quot;[[%s]]&amp;quot;, shortcut)&lt;br /&gt;
		else&lt;br /&gt;
			listItems[i] = frame:expandTemplate{&lt;br /&gt;
				title = 'No redirect',&lt;br /&gt;
				args = templateMode and {templatePath, shortcut} or {shortcut, shortcut}&lt;br /&gt;
			}&lt;br /&gt;
			if templateMode then&lt;br /&gt;
				listItems[i] = string.format(&amp;quot;&amp;amp;#123;&amp;amp;#123;%s%s&amp;amp;#125;&amp;amp;#125;&amp;quot;, prefix, listItems[i])&lt;br /&gt;
			end&lt;br /&gt;
		end&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;
	root:wikitext(frame:extensionTag{ name = 'templatestyles', args = { src = 'Shortcut/styles.css'} })&lt;br /&gt;
	-- Anchors&lt;br /&gt;
	local anchorDiv = root&lt;br /&gt;
		:tag('div')&lt;br /&gt;
			:addClass('module-shortcutanchordiv')&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;
	-- 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;
			local headingMsg = options['shortcut-heading'] or&lt;br /&gt;
				redirectMode and cfg['redirect-heading'] or&lt;br /&gt;
				cfg['shortcut-heading']&lt;br /&gt;
			shortcutHeading = message(headingMsg, nShortcuts)&lt;br /&gt;
			shortcutHeading = frame:preprocess(shortcutHeading)&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('div')&lt;br /&gt;
			:addClass('module-shortcutboxplain plainlist noprint')&lt;br /&gt;
			:attr('role', 'note')&lt;br /&gt;
	if options.float and options.float:lower() == 'left' then&lt;br /&gt;
		shortcutList:addClass('module-shortcutboxleft')&lt;br /&gt;
	end&lt;br /&gt;
	if options.clear and options.clear ~= '' then&lt;br /&gt;
		shortcutList:css('clear', options.clear)&lt;br /&gt;
	end&lt;br /&gt;
	if shortcutHeading then&lt;br /&gt;
		shortcutList&lt;br /&gt;
			:tag('div')&lt;br /&gt;
				:addClass('module-shortcutlist')&lt;br /&gt;
				:wikitext(shortcutHeading)&lt;br /&gt;
	end&lt;br /&gt;
	local list = shortcutList:tag('ul')&lt;br /&gt;
	for i, item in ipairs(listItems) do&lt;br /&gt;
		list:tag('li'):wikitext(item)&lt;br /&gt;
	end&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;
&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>ru&gt;Jonesey95</name></author>
	</entry>
</feed>