词条 | Module: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 = , text = string.format( "Click [%s here to start a horizontal timeline], or [%s here for a vertical one].\\Once you've finished, save this article page; your timeline will be included here!\\For more details, visit {{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 |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。