跳转到内容
主菜单
主菜单
移至侧栏
隐藏
导航
首页
最近更改
随机页面
MediaWiki帮助
MalacoKnowledge
搜索
搜索
登录
个人工具
登录
查看“模块:Clade/gallery”的源代码
模块
讨论
English
阅读
查看源代码
查看历史
工具
工具
移至侧栏
隐藏
操作
阅读
查看源代码
查看历史
常规
链入页面
相关更改
特殊页面
页面信息
←
模块:Clade/gallery
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
local p = {} -- display a gallery of cladograms using floating div elements function p.gallery(frame) local params = mw.getCurrentFrame():getParent().args local outerBorders = false if params['caption'] or params['footer'] then outerBorders = true end -- the gallery container local gallery = mw.html.create('div'):addClass('clade-gallery'):css('float',params['align']) -- main caption for gallery if there is one if params['main-caption'] then gallery:tag('div'):wikitext(params['main-caption']):addClass('main-caption') end -- a gallery of floating divs with content local shading = '' if params['shading'] then shading = 'wikitable' end -- class for shading local vertical = '' -- defaults to horizontal if params['vertical'] then vertical = 'vertical' end -- class for vertical display local styleAll = params['style'] or '' -- style for all elements local mainBorders = '' local elementBorders = '' if not params['main-borders'] or params['main-borders'] == "no" then mainBorders = 'no-border' end if params['borders'] == "no" then elementBorders = 'no-border' end -- the gallery contents local content = gallery:tag('div'):addClass('main-content') :addClass(mainBorders) --:css('height',params['height']) local i=0 while i<15 do i=i+1 local caption = params['caption'..i] --or '' local header = params['header'..i] --or '' local footer = params['footer'..i] --or '' local style = params['style'..i] or styleAll local width = params['width'..i] or params['width'] -- for each gallery element containing a cladogram if params['cladogram'..i] then local cladogramTable = content:tag('table') :addClass(elementBorders) :addClass(shading):addClass('gallery-element') :addClass(vertical) :css('width',width) :css('height',params['height']) :cssText(style) if caption then cladogramTable:tag('caption'):wikitext(caption):addClass('caption') end if header then local row = cladogramTable:tag('tr'):addClass('header') row:tag('th'):wikitext(header) end -- if params['cladogram'..i] already checked local row = cladogramTable:tag('tr') row:tag('td') :wikitext("\n" .. params['cladogram'..i]) :addClass('cladogram') --:css("padding", "20px") -- :css('width',params['cladogram-width']) --:css('height',params['cladogram-height']) :css('height',params['height']) if footer then local row = cladogramTable:tag('tr') row:tag('td'):wikitext(footer):addClass('footer'):addClass(shading) end --[[DIV VERSION - different browsers behave differently -- the div containing each element in the gallery local div = content:tag('div'):addClass('gallery-element'):addClass(direction) :css('width',params['width']) :css('height',params['height']) -- the caption, header, content and footer for each element if caption then div:tag('div'):wikitext(caption):addClass('caption'):addClass(shading) end if header then div:tag('div'):wikitext(header):addClass('header'):addClass(shading) end div:tag('div'):wikitext(params['cladogram'..i]):addClass('cladogram'):addClass(shading) :css('width',params['cladogram-width']) :css('height',params['cladogram-height']) if footer then div:tag('div'):wikitext(footer):addClass('footer'):addClass(shading) end END DIV VERSION--]] else --break -- either break or comment out to allow gaps in sequence end end -- main footer if params['main-footer'] then gallery:tag('div'):wikitext(params['main-footer']):addClass('main-footer'):addClass(noborder) end -- TemplateStyles file local src = "Template:Clade gallery/styles.css" return p.templateStyle( frame, src ) .. tostring(gallery) end function p.templateStyle( frame, src ) return frame:extensionTag( 'templatestyles', '', { src = src } ); end -- this must be at end return p
返回
模块:Clade/gallery
。
开关有限宽度模式