http://wiki.naturalphilosophy.org/index.php?title=Module:Navbar&feed=atom&action=history
Module:Navbar - Revision history
2024-03-28T13:44:52Z
Revision history for this page on the wiki
MediaWiki 1.34.0
http://wiki.naturalphilosophy.org/index.php?title=Module:Navbar&diff=277106&oldid=prev
DeHilster: 1 revision imported
2018-05-10T02:06:42Z
<p>1 revision imported</p>
<p><b>New page</b></p><div>local p = {}<br />
<br />
local getArgs<br />
local ul<br />
<br />
function p.addItem (mini, full, link, descrip, args, url)<br />
local l<br />
if url then<br />
l = {'[', '', ']'}<br />
else<br />
l = {'[[', '|', ']]'}<br />
end<br />
ul:tag('li')<br />
:addClass('nv-'..full)<br />
:wikitext(l[1] .. link .. l[2])<br />
:tag(args.mini and 'abbr' or 'span')<br />
:attr('title', descrip..' this template')<br />
:cssText(args.fontstyle)<br />
:wikitext(args.mini and mini or full)<br />
:done()<br />
:wikitext(l[3])<br />
end<br />
<br />
function p.brackets (position, c, args, div)<br />
if args.brackets then<br />
div<br />
:tag('span')<br />
:css('margin-'..position, '-0.125em')<br />
:cssText(args.fontstyle)<br />
:wikitext(c)<br />
end<br />
end<br />
<br />
function p._navbar(args)<br />
local show = {true, true, true, false, false, false}<br />
local titleArg = 1<br />
<br />
if args.collapsible then<br />
titleArg = 2<br />
if not args.plain then args.mini = 1 end<br />
if args.fontcolor then<br />
args.fontstyle = 'color:' .. args.fontcolor .. ';'<br />
end<br />
args.style = 'float:left; text-align:left'<br />
end<br />
<br />
if args.template then<br />
titleArg = 'template'<br />
show = {true, false, false, false, false, false}<br />
local index = {t = 2, d = 2, e = 3, h = 4, m = 5, w = 6, talk = 2, edit = 3, hist = 4, move = 5, watch = 6}<br />
for k,v in ipairs(require ('Module:TableTools').compressSparseArray(args)) do<br />
local num = index[v]<br />
if num then show[num] = true end<br />
end<br />
end<br />
<br />
if args.noedit then show[3] = false end<br />
<br />
local titleText = args[titleArg] or (':' .. mw.getCurrentFrame():getParent():getTitle())<br />
local title = mw.title.new(mw.text.trim(titleText), 'Template')<br />
if not title then<br />
error('Invalid title ' .. titleText)<br />
end<br />
local talkpage = title.talkPageTitle and title.talkPageTitle.fullText or ''<br />
<br />
local div = mw.html.create():tag('div')<br />
div<br />
:addClass('plainlinks')<br />
:addClass('hlist')<br />
:addClass('navbar')<br />
:cssText(args.style)<br />
<br />
if args.mini then div:addClass('mini') end<br />
<br />
if not (args.mini or args.plain) then<br />
div<br />
:tag('span')<br />
:css('word-spacing', 0)<br />
:cssText(args.fontstyle)<br />
:wikitext(args.text or 'This box:')<br />
:wikitext(' ')<br />
end<br />
<br />
p.brackets('right', '&#91; ', args, div)<br />
<br />
ul = div:tag('ul')<br />
if show[1] then p.addItem('v', 'view', title.fullText, 'View', args) end<br />
if show[2] then p.addItem('t', 'talk', talkpage, 'Discuss', args) end<br />
if show[3] then p.addItem('e', 'edit', title:fullUrl('action=edit'), 'Edit', args, true) end<br />
if show[4] then p.addItem('h', 'hist', title:fullUrl('action=history'), 'History of', args, true) end<br />
if show[5] then<br />
local move = mw.title.new ('Special:Movepage')<br />
p.addItem('m', 'move', move:fullUrl('target='..title.fullText), 'Move', args, true) end<br />
if show[6] then p.addItem('w', 'watch', title:fullUrl('action=watch'), 'Watch', args, true) end<br />
<br />
p.brackets('left', ' &#93;', args, div)<br />
<br />
if args.collapsible then<br />
div<br />
:done()<br />
:tag('div')<br />
:css('font-size', '114%')<br />
:css('margin', args.mini and '0 4em' or '0 7em')<br />
:cssText(args.fontstyle)<br />
:wikitext(args[1])<br />
end<br />
<br />
return tostring(div:done())<br />
end<br />
<br />
function p.navbar(frame)<br />
if not getArgs then<br />
getArgs = require('Module:Arguments').getArgs<br />
end<br />
return p._navbar(getArgs(frame))<br />
end<br />
<br />
return p</div>
DeHilster
http://wiki.naturalphilosophy.org/index.php?title=Module:Navbar&diff=28997&oldid=prev
NickPercival: 1 revision imported
2017-07-05T18:14:53Z
<p>1 revision imported</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 18:14, 5 July 2017</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l49" >Line 49:</td>
<td colspan="2" class="diff-lineno">Line 49:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> :css('margin-right', '-0.125em')</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> :css('margin-right', '-0.125em')</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> :cssText(args.fontstyle)</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> :cssText(args.fontstyle)</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> :wikitext('&#91;')</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> :wikitext('&#91; ')</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline"> :newline();</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l94" >Line 94:</td>
<td colspan="2" class="diff-lineno">Line 93:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> :css('margin-left', '-0.125em')</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> :css('margin-left', '-0.125em')</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> :cssText(args.fontstyle)</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> :cssText(args.fontstyle)</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> :wikitext('&#93;')</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> :wikitext(' &#93;')</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline"> :newline();</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
</table>
NickPercival
http://wiki.naturalphilosophy.org/index.php?title=Module:Navbar&diff=28757&oldid=prev
DeHilster: 1 revision imported
2017-03-25T01:33:16Z
<p>1 revision imported</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 01:33, 25 March 2017</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l14" >Line 14:</td>
<td colspan="2" class="diff-lineno">Line 14:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> args.fontstyle = 'color:' .. args.fontcolor .. ';'</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> args.fontstyle = 'color:' .. args.fontcolor .. ';'</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> args.style = 'float:left; text-align:left<del class="diffchange diffchange-inline">; width:6em;</del>'</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> args.style = 'float:left; text-align:left'</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l101" >Line 101:</td>
<td colspan="2" class="diff-lineno">Line 101:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> div</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> div</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> :done()</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> :done()</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> :tag('<del class="diffchange diffchange-inline">span</del>')</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> :tag('<ins class="diffchange diffchange-inline">div</ins>')</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> :css('font-size', '<del class="diffchange diffchange-inline">110</del>%')</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> :css('font-size', '<ins class="diffchange diffchange-inline">114</ins>%<ins class="diffchange diffchange-inline">')</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> :css('margin', args.mini and '0 4em' or '0 7em</ins>')</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> :cssText(args.fontstyle)</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> :cssText(args.fontstyle)</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> :wikitext(args[1])</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> :wikitext(args[1])</div></td></tr>
</table>
DeHilster
http://wiki.naturalphilosophy.org/index.php?title=Module:Navbar&diff=31&oldid=prev
Admin: 1 revision imported
2016-12-28T04:20:19Z
<p>1 revision imported</p>
<p><b>New page</b></p><div>local p = {}<br />
<br />
local getArgs<br />
<br />
function p._navbar(args)<br />
local titleArg = 1<br />
<br />
if args.collapsible then<br />
titleArg = 2<br />
if not args.plain then<br />
args.mini = 1<br />
end<br />
if args.fontcolor then<br />
args.fontstyle = 'color:' .. args.fontcolor .. ';'<br />
end<br />
args.style = 'float:left; text-align:left; width:6em;'<br />
end<br />
<br />
local titleText = args[titleArg] or (':' .. mw.getCurrentFrame():getParent():getTitle())<br />
local title = mw.title.new(mw.text.trim(titleText), 'Template');<br />
<br />
if not title then<br />
error('Invalid title ' .. titleText)<br />
end<br />
<br />
local talkpage = title.talkPageTitle and title.talkPageTitle.fullText or '';<br />
<br />
local div = mw.html.create():tag('div')<br />
div<br />
:addClass('plainlinks')<br />
:addClass('hlist')<br />
:addClass('navbar')<br />
:cssText(args.style)<br />
<br />
if args.mini then div:addClass('mini') end<br />
<br />
if not (args.mini or args.plain) then<br />
div<br />
:tag('span')<br />
:css('word-spacing', 0)<br />
:cssText(args.fontstyle)<br />
:wikitext(args.text or 'This box:')<br />
:wikitext(' ')<br />
end<br />
<br />
if args.brackets then<br />
div<br />
:tag('span')<br />
:css('margin-right', '-0.125em')<br />
:cssText(args.fontstyle)<br />
:wikitext('&#91;')<br />
:newline();<br />
end<br />
<br />
local ul = div:tag('ul');<br />
<br />
ul<br />
:tag('li')<br />
:addClass('nv-view')<br />
:wikitext('[[' .. title.fullText .. '|')<br />
:tag(args.mini and 'abbr' or 'span')<br />
:attr('title', 'View this template')<br />
:cssText(args.fontstyle)<br />
:wikitext(args.mini and 'v' or 'view')<br />
:done()<br />
:wikitext(']]')<br />
:done()<br />
:tag('li')<br />
:addClass('nv-talk')<br />
:wikitext('[[' .. talkpage .. '|')<br />
:tag(args.mini and 'abbr' or 'span')<br />
:attr('title', 'Discuss this template')<br />
:cssText(args.fontstyle)<br />
:wikitext(args.mini and 't' or 'talk')<br />
:done()<br />
:wikitext(']]');<br />
<br />
if not args.noedit then<br />
ul<br />
:tag('li')<br />
:addClass('nv-edit')<br />
:wikitext('[' .. title:fullUrl('action=edit') .. ' ')<br />
:tag(args.mini and 'abbr' or 'span')<br />
:attr('title', 'Edit this template')<br />
:cssText(args.fontstyle)<br />
:wikitext(args.mini and 'e' or 'edit')<br />
:done()<br />
:wikitext(']');<br />
end<br />
<br />
if args.brackets then<br />
div<br />
:tag('span')<br />
:css('margin-left', '-0.125em')<br />
:cssText(args.fontstyle)<br />
:wikitext('&#93;')<br />
:newline();<br />
end<br />
<br />
if args.collapsible then<br />
div<br />
:done()<br />
:tag('span')<br />
:css('font-size', '110%')<br />
:cssText(args.fontstyle)<br />
:wikitext(args[1])<br />
end<br />
<br />
return tostring(div:done())<br />
end<br />
<br />
function p.navbar(frame)<br />
if not getArgs then<br />
getArgs = require('Module:Arguments').getArgs<br />
end<br />
return p._navbar(getArgs(frame))<br />
end<br />
<br />
return p</div>
Admin