Modulo:Documentation: differenze tra le versioni

m
una versione importata
m (una versione importata)
 
m (una versione importata)
 
(5 versioni intermedie di 4 utenti non mostrate)
Riga 139: Riga 139:
-- 'documentation-container'
-- 'documentation-container'
:addClass(message('container'))
:addClass(message('container'))
:attr('role', 'complementary')
:attr('aria-labelledby', args.heading ~= '' and 'documentation-heading' or nil)
:attr('aria-label', args.heading == '' and 'Documentation' or nil)
:newline()
:newline()
:tag('div')
:tag('div')
Riga 346: Riga 349:
--  
--  
-- Messages:
-- Messages:
-- 'sandbox-notice-image' --> '[[Image:Sandbox.svg|50px|alt=|link=]]'
-- 'sandbox-notice-image' --> '[[File:Sandbox.svg|50px|alt=|link=]]'
-- 'sandbox-notice-blurb' --> 'This is the $1 for $2.'
-- 'sandbox-notice-blurb' --> 'This is the $1 for $2.'
-- 'sandbox-notice-diff-blurb' --> 'This is the $1 for $2 ($3).'
-- 'sandbox-notice-diff-blurb' --> 'This is the $1 for $2 ($3).'
Riga 488: Riga 491:
-- 'history-link-display' --> 'history'
-- 'history-link-display' --> 'history'
-- 'purge-link-display' --> 'purge'
-- 'purge-link-display' --> 'purge'
-- 'file-docpage-preload' --> 'Template:Documentation/preload-filespace'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'module-preload' --> 'Template:Documentation/preload-module-doc'
-- 'docpage-preload' --> 'Template:Documentation/preload'
-- 'docpage-preload' --> 'Template:Documentation/preload'
Riga 514: Riga 516:
local preload = args.preload
local preload = args.preload
if not preload then
if not preload then
if subjectSpace == 6 then -- File namespace
if subjectSpace == 828 then -- Module namespace
preload = message('file-docpage-preload')
elseif subjectSpace == 828 then -- Module namespace
preload = message('module-preload')
preload = message('module-preload')
else
else
Riga 529: Riga 529:
function p.renderStartBoxLinks(data)
function p.renderStartBoxLinks(data)
--[[
--[[
-- Generates the [view][edit][history][purge] or [create] links from the data table.
-- Generates the [view][edit][history][purge] or [create][purge] links from the data table.
-- @data - a table of data generated by p.makeStartBoxLinksData
-- @data - a table of data generated by p.makeStartBoxLinksData
--]]
--]]
Riga 543: Riga 543:
local docTitle = data.docTitle
local docTitle = data.docTitle
local title = data.title
local title = data.title
local purgeLink = makeUrlLink(title:fullUrl{action = 'purge'}, data.purgeLinkDisplay)
if docTitle.exists then
if docTitle.exists then
local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)
local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)
local editLink = makeUrlLink(docTitle:fullUrl{action = 'edit'}, data.editLinkDisplay)
local editLink = makeUrlLink(docTitle:fullUrl{action = 'edit'}, data.editLinkDisplay)
local historyLink = makeUrlLink(docTitle:fullUrl{action = 'history'}, data.historyLinkDisplay)
local historyLink = makeUrlLink(docTitle:fullUrl{action = 'history'}, data.historyLinkDisplay)
local purgeLink = makeUrlLink(title:fullUrl{action = 'purge'}, data.purgeLinkDisplay)
ret = '[%s] [%s] [%s] [%s]'
ret = '[%s] [%s] [%s] [%s]'
ret = escapeBrackets(ret)
ret = escapeBrackets(ret)
Riga 553: Riga 553:
else
else
local createLink = makeUrlLink(docTitle:fullUrl{action = 'edit', preload = data.preload}, data.createLinkDisplay)
local createLink = makeUrlLink(docTitle:fullUrl{action = 'edit', preload = data.preload}, data.createLinkDisplay)
ret = '[%s]'
ret = '[%s] [%s]'
ret = escapeBrackets(ret)
ret = escapeBrackets(ret)
ret = mw.ustring.format(ret, createLink)
ret = mw.ustring.format(ret, createLink, purgeLink)
end
end
return ret
return ret
Riga 630: Riga 630:
:tag('span')
:tag('span')
:addClass(data.headingClass)
:addClass(data.headingClass)
:attr('id', 'documentation-heading')
:cssText(data.headingStyleText)
:cssText(data.headingStyleText)
:wikitext(data.heading)
:wikitext(data.heading)