Module:Navbar

From The Pinched Universe
Jump to navigation Jump to search

The documentation for this module is not intended to be hosted on this wiki.

However, you might be able to find it at one of the following locations:

local a={}local b=mw.loadData('Module:Navbar/configuration')local function c(d,e)local f=1;if d then f=2 end;if e then f='template'end;return f end;local function g(e,h)local i={true,true,true,false,false,false}if e then i[2]=false;i[3]=false;local j={t=2,d=2,e=3,h=4,m=5,w=6,talk=2,edit=3,hist=4,move=5,watch=6}for k,l in ipairs(require('Module:TableTools').compressSparseArray(h))do local m=j[l]if m then i[m]=true end end end;local n=h.noedit;if n then i[3]=false end;return i end;local function o(p,q,r,s)local t;if p.url then t={'[','',']'}else t={'[[','|',']]'}end;q:tag('li'):addClass('nv-'..p.full):wikitext(t[1]..p.link..t[2]):tag(r and'abbr'or'span'):attr('title',p.html_title):cssText(s):wikitext(r and p.mini or p.full):done():wikitext(t[3]):done()end;local function u(v,w,x,r,s)local y=mw.title.new(mw.text.trim(v),b.title_namespace)if not y then error(b.invalid_title..v)end;local z=y.talkPageTitle and y.talkPageTitle.fullText or''local A={{['mini']='v',['full']='view',['html_title']='View this template',['link']=y.fullText,['url']=false},{['mini']='t',['full']='talk',['html_title']='Discuss this template',['link']=z,['url']=false},{['mini']='e',['full']='edit',['html_title']='Edit this template',['link']=y:fullUrl('action=edit'),['url']=true},{['mini']='h',['full']='hist',['html_title']='History of this template',['link']=y:fullUrl('action=history'),['url']=true},{['mini']='m',['full']='move',['html_title']='Move this template',['link']=mw.title.new('Special:Movepage'):fullUrl('target='..y.fullText),['url']=true},{['mini']='w',['full']='watch',['html_title']='Watch this template',['link']=y:fullUrl('action=watch'),['url']=true}}local q=mw.html.create('ul')if w then q:addClass(b.classes.brackets):cssText(s)end;for B,k in ipairs(x)do if x[B]then o(A[B],q,r,s)end end;return q:done()end;function a._navbar(h)local s=h.fontstyle;local C=h.fontcolor;local d=h.collapsible;local r=h.mini;local D=h.plain;local E=nil;if d then E=b.classes.collapsible;if not D then r=1 end;if C then s=(s or'')..'; color: '..C..';'end end;local F=h.style;local G=mw.html.create():tag('div')G:addClass(b.classes.navbar):addClass(b.classes.plainlinks):addClass(b.classes.horizontal_list):addClass(E):cssText(F)if r then G:addClass(b.classes.mini)end;local H=(h.text or b.box_text)..' 'if not(r or D)then G:tag('span'):addClass(b.classes.box_text):cssText(s):wikitext(H)end;local e=h.template;local x=g(e,h)local w=h.brackets;local f=c(d,e)local v=h[f]or':'..mw.getCurrentFrame():getParent():getTitle()local I=u(v,w,x,r,s)G:node(I)if d then local J;if r then J=b.classes.collapsible_title_mini else J=b.classes.collapsible_title_full end;G:done():tag('div'):addClass(J):cssText(s):wikitext(h[1])end;local K=mw.getCurrentFrame()return K:extensionTag{name='templatestyles',args={src=b.hlist_templatestyles}}..K:extensionTag{name='templatestyles',args={src=b.templatestyles}}..tostring(G:done())end;function a.navbar(K)return a._navbar(require('Module:Arguments').getArgs(K))end;return a