יחידה:Navbar: הבדלים בין גרסאות בדף
switch to mw.html and other cleanup from sandbox |
מ 2 גרסאות של הדף wikipedia:he:יחידה:Navbar יובאו |
||
| (17 גרסאות ביניים של 10 משתמשים אינן מוצגות) | |||
| שורה 5: | שורה 5: | ||
function p._navbar(args) | function p._navbar(args) | ||
local titleArg = 1 | local titleArg = 1 | ||
if args.collapsible then | if args.collapsible then | ||
titleArg = 2 | titleArg = 2 | ||
| שורה 16: | שורה 16: | ||
args.style = 'float:left; text-align:left; width:6em;' | args.style = 'float:left; text-align:left; width:6em;' | ||
end | end | ||
local titleText = args[titleArg] or (':' .. mw.getCurrentFrame():getParent():getTitle()) | local titleText = args[titleArg] or (':' .. mw.getCurrentFrame():getParent():getTitle()) | ||
local title = mw.title.new(mw.text.trim(titleText), 'Template'); | local title = mw.title.new(mw.text.trim(titleText), 'Template'); | ||
| שורה 59: | שורה 59: | ||
:addClass('nv-view') | :addClass('nv-view') | ||
:wikitext('[[' .. title.fullText .. '|') | :wikitext('[[' .. title.fullText .. '|') | ||
:tag('span') | :tag(args.mini and 'abbr' or 'span') | ||
:attr('title', ' | :attr('title', 'צפייה בתבנית זו') | ||
:cssText(args.fontstyle) | :cssText(args.fontstyle) | ||
:wikitext(args.mini and ' | :wikitext(args.mini and 'צ' or 'צפייה') | ||
:done() | :done() | ||
:wikitext(']]') | :wikitext(']]') | ||
| שורה 69: | שורה 69: | ||
:addClass('nv-talk') | :addClass('nv-talk') | ||
:wikitext('[[' .. talkpage .. '|') | :wikitext('[[' .. talkpage .. '|') | ||
:tag('span') | :tag(args.mini and 'abbr' or 'span') | ||
:attr('title', ' | :attr('title', 'שיחה על תבנית זו') | ||
:cssText(args.fontstyle) | :cssText(args.fontstyle) | ||
:wikitext(args.mini and ' | :wikitext(args.mini and 'ש' or 'שיחה') | ||
:done() | :done() | ||
:wikitext(']]'); | :wikitext(']]'); | ||
| שורה 81: | שורה 81: | ||
:addClass('nv-edit') | :addClass('nv-edit') | ||
:wikitext('[' .. title:fullUrl('action=edit') .. ' ') | :wikitext('[' .. title:fullUrl('action=edit') .. ' ') | ||
:tag('span') | :tag(args.mini and 'abbr' or 'span') | ||
:attr('title', ' | :attr('title', 'עריכת תבנית זו') | ||
:cssText(args.fontstyle) | :cssText(args.fontstyle) | ||
:wikitext(args.mini and ' | :wikitext(args.mini and 'ע' or 'עריכה') | ||
:done() | :done() | ||
:wikitext(']'); | :wikitext(']'); | ||
| שורה 97: | שורה 97: | ||
:newline(); | :newline(); | ||
end | end | ||
if args.collapsible then | if args.collapsible then | ||
div | div | ||
| שורה 106: | שורה 106: | ||
:wikitext(args[1]) | :wikitext(args[1]) | ||
end | end | ||
local templateStyle = mw.getCurrentFrame():extensionTag( 'templatestyles', '', { src = 'יחידה:Navbar/styles.css' } ); | |||
return tostring(div:done()) | return tostring(div:done()) .. templateStyle | ||
end | end | ||