Модуль:Include timeline
Перейти до навігації
Перейти до пошуку
Документація модуля[створити]
Зараз цей модуль не має відповідної документації. Якщо вам відомі призначення та засади використання цього модуля, будь ласка, напишіть хоча б коротеньку документацію. |
Дописувачі можуть експериментувати на підсторінках пісочниця (створити | дзеркало) та тести (створити) цього модуля. Підсторінки цієї сторінки. |
local p = {}
function p.main(frame)
local pframe = frame:getParent()
local currentTitle = mw.title.getCurrentTitle()
local passedTitle = pframe and pframe.args[1]
local targetPage = mw.title.makeTitle(currentTitle.namespace == 2 and 2 or 10, (passedTitle or currentTitle.text) .. ' graphical timeline')
if targetPage.exists then
if mw.isSubsting() then
return '{{' .. (currentTitle.namespace == 2 and 'User:' or '') .. targetPage.text .. '}}'
else
return frame:expandTemplate{title = targetPage.prefixedText}
end
else
if mw.isSubsting() then
if passedTitle then
return '{{safesubst:Include timeline|1=' .. passedTitle .. '}}'
else
return '{{safesubst:Include timeline}}'
end
else
return require('Module:Message box').main('mbox', {
type = 'move',
image = '[[File:Splitsection.gif|40px|New article]]',
text = string.format(
"Натисніть [%s сюди, щоб розпочати '''горизонтальну''' часову шкалу] або [%s сюди для '''вертикальної'''].\n\nКоли ви завершите, збережіть цю сторінку статті; ваша часова шкала буде включена тут!\n\n''Детальніше, відвідайте {{[[Template:Include timeline|include timeline]]}}''",
targetPage:fullUrl('action=edit&editintro=Template%3AInclude_timeline%2Fhorizontal_instructions&preload=Template%3AInclude_timeline%2Fhorizontal_template'),
targetPage:fullUrl('action=edit&editintro=Template%3AInclude_timeline%2Fvertical_instructions&preload=Template%3AInclude_timeline%2Fvertical_template')
)
})
end
end
return ''
end
return p