Редактирование: Модуль:Sidebar

Перейти к навигации Перейти к поиску

Примечание. Ваши правки будут показаны в статье только после их проверки участником с соответствующими правами.

Правка может быть отменена. Проверьте сравнение версий ниже и нажмите «Записать страницу».
Если отменяемые вами изменения не вандализм, пожалуйста, допишите причину в описании правки.

Текущая версия Ваш текст
Строка 1: Строка 1:
--
--
-- This module implements {{Sidebar}}
-- Этот модуль обеспечивает работу шаблона {{Sidebar}}
--
--
require('Module:No globals')
require('Модуль:No globals')


local p = {}
local p = {}


local getArgs = require('Module:Arguments').getArgs
local getArgs = require('Модуль:Arguments').getArgs
local navbar = require('Module:Navbar')._navbar
local navbar = require('Модуль:Navbar')._navbar


local function trimAndAddAutomaticNewline(s)
local function trimAndAddAutomaticNewline(s)
Строка 19: Строка 19:
else
else
return s
return s
end
end
local function hasSubgroup(s)
if mw.ustring.find(s, 'vertical%-navbox%-subgroup') then
return true
else
return false
end
end
end
end
Строка 37: Строка 29:
local child = args.child and mw.text.trim(args.child) == 'yes'
local child = args.child and mw.text.trim(args.child) == 'yes'


root = root:tag('table')
if not child then
if not child then
root  
root = root
:tag('table')
:addClass('vertical-navbox')
:addClass('vertical-navbox')
:addClass(args.wraplinks ~= 'true' and 'nowraplinks' or nil)
:addClass(args.wraplinks ~= 'true' and 'nowraplinks' or nil)
Строка 98: Строка 90:
:wikitext(args.pretitle)
:wikitext(args.pretitle)
end
end
else
 
root
:addClass('vertical-navbox-subgroup')
:css('width', '100%')
:css('margin', '0px')
:css('border-spacing', '0px')
:addClass(args.bodyclass or args.class)
:cssText(args.bodystyle or args.style)
end
end


Строка 112: Строка 97:
root
root
:wikitext(args.title)
:wikitext(args.title)
:wikitext('</th></tr>') -- @todo replace this with unclosed again once mw.html gets it
else
else
root
root
Строка 193: Строка 179:
:tag('td')
:tag('td')
:addClass(args.contentclass)
:addClass(args.contentclass)
:css('padding', hasSubgroup(content) and '0.1em 0 0.2em' or '0 0.1em 0.4em')
:css('padding', '0 0.1em 0.4em')
:cssText(args.contentstyle)
:cssText(args.contentstyle)
:cssText(args['content' .. num .. 'style'])
:cssText(args['content' .. num .. 'style'])
Строка 217: Строка 203:
if not child then
if not child then
local navbarArg = args.navbar or args.tnavbar
local navbarArg = args.navbar or args.tnavbar
if navbarArg ~= 'none' and navbarArg ~= 'off' and (args.name or frame:getParent():getTitle():gsub('/sandbox$', '') ~= 'Template:Sidebar') then
if navbarArg ~= 'none' and navbarArg ~= 'off' and (args.name or frame:getParent():getTitle():gsub('/sandbox$', '') ~= 'Шаблон:Sidebar') then
root
root
:tag('tr')
:tag('tr')
Строка 232: Строка 218:
end
end


return tostring(root) .. (child and '[[Category:Pages using sidebar with the child parameter]]' or '')
return tostring(root)
end
end


Строка 241: Строка 227:
args.belowstyle = 'border-top: 1px solid #aaa; border-bottom: 1px solid #aaa;' .. (args.belowstyle or '')
args.belowstyle = 'border-top: 1px solid #aaa; border-bottom: 1px solid #aaa;' .. (args.belowstyle or '')
args.navbarstyle = 'padding-top: 0.6em;' .. (args.navbarstyle or args.tnavbarstyle or '')
args.navbarstyle = 'padding-top: 0.6em;' .. (args.navbarstyle or args.tnavbarstyle or '')
if not args.name and frame:getParent():getTitle():gsub('/sandbox$', '') == 'Template:Sidebar with collapsible lists' then
if not args.name and frame:getParent():getTitle():gsub('/sandbox$', '') == 'Шаблон:Sidebar with collapsible lists' then
args.navbar = 'none'
args.navbar = 'none'
end
end

Быстрая вставка: «» „“ | {{}} [[]] [] [[|]] {{|}} {{подст:}} <br> &nbsp; #перенаправление [[]] [[Категория:]] {{DEFAULTSORT:}} [[Участник:]] {{u|}} {{userlinks|}} {{ping|}} {{pagelinks|}} {{D-|}} [[d:|]] ~~~~

__NOTOC__ __TOC__ __FORCETOC__   [[ ()|]] [[ (фильм)|]] {{commonscat|}} [[wikt:]] [[Special:Diff/|]] [[Special:Permalink/|]] [[Special:Contributions/]]

Теги: <></>   <!-- -->   <blockquote></blockquote>   <code></code>   <code><nowiki></nowiki></code>   <nowiki></nowiki>   <includeonly></includeonly>   <noinclude></noinclude>   <onlyinclude></onlyinclude>   <poem></poem>   <pre></pre>   <s></s>   <small></small>   <syntaxhighlight lang=""></syntaxhighlight>   <sub></sub>   <sup></sup>

Теги галереи файлов: <gallery></gallery>   <gallery class="center" caption=""></gallery>   <gallery mode="packed" heights="" caption=""></gallery>

Разделы: == ==   === ===   == См. также ==   == Примечания == {{примечания}}   == Литература ==   == Ссылки ==

Шаблоны: {{tl|}}   {{cl|}}   {{clear}}   {{lang-en|}}   {{ref-en}}   {{s|}}   {{неоднозначность}}   {{колонки}}{{колонки|конец}}   {{подст:L}}   {{начало цитаты}}{{конец цитаты|источник=}}   {{hello}}~~~~  

Источники: <ref></ref>   <ref name=""></ref>   <ref name="" />   <ref group=""></ref>   {{ref+||group=""}}  

Символы: Ё ё ~ # @ § · ¡ ¿ \ ½ ¼ ¾ ± × ÷ ° ^ ¹ ² ³ £ ¥ $ ¢ © ® {{подст:ударение}}

Греческий алфавит: Α α Β β Γ γ Δ δ Ε ε Ζ ζ Η η Θ θ Ι Ϊ ι ϊ Κ κ Λ λ Μ μ Ν ν Ξ ξ Ο ο Π π Ρ ρ Σ σ ς Τ τ Υ Ϋ υ ϋ Φ φ Χ χ Ψ ψ Ω ω