买什么| 嘴巴干是什么原因| 什么级别| 肚子大腿细是什么原因| 6月12日是什么节日| 葡萄糖偏低是什么意思| 小孩腹泻吃什么药好得快| 食物中毒拉肚子吃什么药| 中医学专业学什么| esd手术是什么意思| 汕头市花是什么花| 乘字五行属什么| 五岳是什么| 丑时属什么生肖| 标王是什么意思| 梦见小黑蛇是什么预兆| 口干是什么原因呢| 为什么胸部会胀痛| 肠道长息肉是什么原因造成的| 小猫的耳朵像什么| 碧玺是什么| 校长是什么级别| 流清鼻涕吃什么药好| 特效是什么意思| 挖坑是什么意思| 张国立老婆叫什么名字| 血糖低吃什么| 末梢血是什么意思| 主胰管不扩张是什么意思| ua是什么意思| 鼻窦炎挂什么科| 一凉就咳嗽是什么原因| 眉头下方有痣代表什么| 除夕是什么意思| 痢疾是什么病| 营养心脏最好的药是什么药| 过什么不什么| 钓鱼执法是什么意思| 什么的寒冷| 爱彼手表什么档次| 为什么喝牛奶会长痘| 外阴起红点是什么病| cta是什么意思| 屁股上有痣代表什么| 血清果糖胺测定是什么| 山药对人体有什么好处| 一年四季是什么生肖| 八月二十五是什么星座| 什么是肿瘤| 为什么蚊子要吸血| 什么风呼啸| 粑粑是什么意思| 双侧基底节区腔隙灶是什么意思| 又拉肚子又呕吐是什么原因| 为什么会停电| 梦见血是什么预兆| 农历五月二十四是什么日子| 政协主席什么级别| 被毒蛇咬了有什么症状| 韭黄是什么| 脚上有痣代表什么| 为什么会尿频| 胆汁有什么作用| 孕酮低吃什么补得快| 1.25是什么星座| 生性是什么意思| 儿童水杯什么材质好| 1997年出生的属什么| 溥仪为什么没有生育能力| 心脏供血不足用什么药| 头痛头晕挂什么科| 落选是什么意思| 干咳无痰吃什么药效果最好| 矿物油是什么油| 里正是什么官| 沙里瓦是什么意思| 宝宝肌张力高会有什么影响| 特别容易出汗是什么原因| 人生得意须尽欢是什么意思| 兵马俑什么时候发现的| 纹身的人是什么心理| 小儿咳嗽吃什么药好| 五福临门是什么意思| 割包皮有什么用| 福建岩茶属于什么茶| 索是什么意思| 天蝎座是什么象星座| polo衫配什么裤子好看| 心律不齐吃什么药效果好| 壬申日是什么意思| tags是什么意思| 胃窦糜烂是什么意思严重吗| 爱叶有什么作用和功效| 腹泻便溏是什么意思| 贾宝玉的玉是什么来历| 木危读什么| 为什么一同房就出血| 干燥综合症挂什么科| 自信过头叫什么| 水痘挂什么科| 心电图hr是什么意思| 心律不齐吃什么药好| 天贵星是什么意思| 孕妇梦见洪水是什么意思| 什么是早恋| 拉新是什么意思| 忘不了鱼在中国叫什么| 今天买什么股票| 拉不出大便吃什么药| 同房是什么意思| 小孩白头发是什么原因引起的| 胸口疼痛挂什么科| 牙齿脱矿是什么原因| 甲胎蛋白是什么意思| 用什么| 小孩记忆力差什么原因| 脚趾长痣代表什么意思| 梦到别人怀孕了是什么意思| 如你所愿是什么意思| 鸡飞狗跳的意思是什么| 手臂发麻是什么原因引起的| 脚底发红是什么原因| 属马的本命佛是什么佛| 六月五日是什么日子| 为什么牛肝便宜没人吃| 铁为什么会生锈| 9月是什么星座的| 扁桃体发炎可以吃什么水果| 天秤座是什么星座| 肺炎吃什么水果| 贫血挂什么科| 吃桃子对身体有什么好处| 吃小米粥有什么好处| 吃什么能解决便秘| 舌苔发黄是什么原因| 远水解不了近渴什么意思| xl代表什么尺码| 巴马汤泡脚有什么功效| 日柱灾煞是什么意思| 什么是生活| 胆脂瘤是什么病| 脾肾两虚吃什么中成药最好| 丑指什么生肖| 9月26号是什么星座| gdp指的是什么| 女人的排卵期一般是什么时候| 常务副县长什么级别| 7月5号什么星座| 皇协军是什么意思| 孩子为什么有胎记| 三代试管是什么意思| 墨鱼和鱿鱼有什么区别| 没有斗代表什么| 苏州秋裤楼叫什么| 脑卒中是什么意思| 防冻液红色和绿色有什么区别| 鹿晗和邓超什么关系| 脊髓炎是什么病| ck香水属于什么档次| 耄耋之年是什么意思| 王维字什么| 昆仑玉是什么玉| 斜视是什么意思| 池字五行属什么| 二次元是什么| 七月十三日是什么日子| 玳瑁色是什么颜色| 湿疹为什么要查肝功能| 舌头干涩是什么病前兆| hm是什么| 乳腺属于什么科室| 白带发黄用什么药| 坐骨神经痛吃什么药好| 十二月六号是什么星座| hpv31阳性是什么意思| 罗字五行属什么| 咽拭子是检查什么的| 小孩流鼻涕咳嗽吃什么药| 翘首企盼是什么意思| 防蓝光眼镜有什么好处| 银色五行属什么| 清歌是什么意思| 咀嚼什么意思| 唇周发黑是什么原因| 什么是有机奶粉| 50年属什么生肖| 韭菜花炒什么好吃| btc是什么货币| 什么什么迷人的成语| 蒲公英有什么好处| 金鱼吃什么食物| 海贼王什么时候出的| 胶水用什么能洗掉| 脑管瘤的症状是什么| 猪蹄子炖什么好吃| 国民党为什么会失败| 脑梗是什么症状| 老头疼是什么原因导致的| 流产的血是什么颜色| 河南南阳产什么玉| 老花镜是什么镜| 轻度三尖瓣反流是什么| 做梦结婚是什么征兆| 谢霆锋什么学历| 榴莲树长什么样| 结膜炎什么症状| 甘油三酯偏高是什么意思| 7月初是什么星座| 多饮多尿可能是什么病| 胎儿左心室灶状强回声是什么意思| 什么息| 不禁是什么意思| 壁虎属于什么类动物| 肠炎可以吃什么食物| 宝宝什么时候开始长牙| 身份证后六位代表什么| 尿维生素c阳性是什么意思| 曲率是什么意思| 相见恨晚是什么意思| 梦见自己结婚了是什么意思| 许莫氏结节是什么| 打喷嚏鼻塞吃什么药| 不什么其什么的成语| 为什么叫梅雨季节| 聊表心意什么意思| 身体皮肤痒是什么原因| 胃酸的主要成分是什么| 上尉军衔是什么级别| 经常腿抽筋是什么原因| 手背发麻是什么原因| 小孩手指脱皮是什么原因| 副乳是什么意思| 爱爱是什么感觉| 慧眼识珠是什么意思| 梦见针是什么意思| 抽筋什么原因| 耐人寻味什么意思| 脚气应该挂什么科| 伏地魔是什么意思| 做梦梦到狗是什么征兆| pt是什么时间| 高血压药什么时候吃最好| 02年是什么生肖| 营卫不和吃什么中成药| 心火旺吃什么| 什么人容易得眩晕症| 上传下达什么意思| 什么药可以延长射精| 三只手是什么意思| 健脾吃什么食物| 8月31日什么星座| 花椰菜是什么菜| 蛇为什么怕鹅| 为什么身上一热就痒| 谷氨酸高是什么原因| 环切手术是什么| 妲己是什么生肖| 梦到自己孩子死了是什么征兆| 空窗期什么意思| 闹肚子吃什么药| 无创什么时候做| 什么叫应届毕业生| 什么是生化妊娠| 阴道有褐色分泌物是什么原因| 百度Jump to content

生蚝有什么功效与作用

Permanently protected module
From Wikipedia, the free encyclopedia

require('strict')
local cfg = mw.loadData('Module:Sidebar/configuration')

local p = {}

local getArgs = require('Module:Arguments').getArgs

--[[
Categorizes calling templates and modules with a 'style' parameter of any sort
for tracking to convert to TemplateStyles.

TODO after a long cleanup: Catch sidebars in other namespaces than Template and Module.
TODO would probably want to remove /log and /archive as CS1 does
]]
local function categorizeTemplatesWithInlineStyles(args)
	local title = mw.title.getCurrentTitle()
	if title.namespace ~= 10 and title.namespace ~= 828 then return '' end
	for _, pattern in ipairs (cfg.i18n.pattern.uncategorized_conversion_titles) do
		if title.text:match(pattern) then return '' end
	end
	
	for key, _ in pairs(args) do
		if mw.ustring.find(key, cfg.i18n.pattern.style_conversion) or key == 'width' then
			return cfg.i18n.category.conversion
		end
	end
end

--[[
For compatibility with the original {{sidebar with collapsible lists}}
implementation, which passed some parameters through {{#if}} to trim their
whitespace. This also triggered the automatic newline behavior.
]]
-- See ([[meta:Help:Newlines and spaces#Automatic newline]])
local function trimAndAddAutomaticNewline(s)
	s = mw.ustring.gsub(s, "^%s*(.-)%s*$", "%1")
	if mw.ustring.find(s, '^[#*:;]') or mw.ustring.find(s, '^{|') then
		return '\n' .. s
	else
		return s
	end
end

--[[
Finds whether a sidebar has a subgroup sidebar.
]]
local function hasSubgroup(s)
	if mw.ustring.find(s, cfg.i18n.pattern.subgroup) then
		return true
	else
		return false
	end
end

local function has_navbar(navbar_mode, sidebar_name)
	return navbar_mode ~= cfg.i18n.navbar_none and
		navbar_mode ~= cfg.i18n.navbar_off and
		(
			sidebar_name or
			mw.getCurrentFrame():getParent():getTitle():gsub(cfg.i18n.pattern.sandbox, '') ~=
			cfg.i18n.title_not_to_add_navbar
		)
end

local function has_list_class(args, htmlclass)
	local patterns = {
		'^' .. htmlclass .. '$',
		'%s' .. htmlclass .. '$',
		'^' .. htmlclass .. '%s',
		'%s' .. htmlclass .. '%s'
	}
	
	for arg, value in pairs(args) do
		if type(arg) == 'string' and mw.ustring.find(arg, 'class') then
			for _, pattern in ipairs(patterns) do
				if mw.ustring.find(args[arg] or '', pattern) then
					return true
				end
			end
		end
	end
	return false
end

-- there are a lot of list classes in the wild, so we add their TemplateStyles
local function add_list_styles(args)
	local frame = mw.getCurrentFrame()
	local function add_list_templatestyles(htmlclass, templatestyles)
		if has_list_class(args, htmlclass) then
			return frame:extensionTag{
				name = 'templatestyles', args = { src = templatestyles }
			}
		else
			return ''
		end
	end
	
	local plainlist_styles = add_list_templatestyles('plainlist', cfg.i18n.plainlist_templatestyles)
	local hlist_styles = add_list_templatestyles('hlist', cfg.i18n.hlist_templatestyles)
	
	-- a second workaround for [[phab:T303378]]
	-- when that issue is fixed, we can actually use has_navbar not to emit the
	-- tag here if we want
	if has_navbar(args.navbar, args.name) and hlist_styles == '' then
		hlist_styles = frame:extensionTag{
			name = 'templatestyles', args = { src = cfg.i18n.hlist_templatestyles}
		}
	end

	-- hlist -> plainlist is best-effort to preserve old Common.css ordering. [hlist_note]
	return hlist_styles .. plainlist_styles
end

-- work around [[phab:T303378]]
-- for each arg: find all the templatestyles strip markers, insert them into a
-- table. then remove all templatestyles markers from the arg
local function move_hiding_templatestyles(args)
	local gfind = string.gfind
	local gsub = string.gsub
	local templatestyles_markers = {}
	local strip_marker_pattern = '(\127[^\127]*UNIQ%-%-templatestyles%-%x+%-QINU[^\127]*\127)'
	for k, arg in pairs(args) do
		for marker in gfind(arg, strip_marker_pattern) do
			table.insert(templatestyles_markers, marker)
		end
		args[k] = gsub(arg, strip_marker_pattern, '')
	end
	return templatestyles_markers
end

--[[
Main sidebar function. Takes the frame, args, and an optional collapsibleClass.
The collapsibleClass is and should be used only for sidebars with collapsible
lists, as in p.collapsible.
]]
function p.sidebar(frame, args, collapsibleClass)
	if not args then
		args = getArgs(frame)
	end
	local hiding_templatestyles = table.concat(move_hiding_templatestyles(args))
	local root = mw.html.create()
	local child = args.child and mw.text.trim(args.child) == cfg.i18n.child_yes

	root = root:tag('table')
	if not child then
		root 
			:addClass(cfg.i18n.class.sidebar)
			-- force collapsibleclass to be sidebar-collapse otherwise output nothing
			:addClass(collapsibleClass == cfg.i18n.class.collapse and cfg.i18n.class.collapse or nil)
			:addClass('nomobile')
			:addClass(args.float == cfg.i18n.float_none and cfg.i18n.class.float_none or nil)
			:addClass(args.float == cfg.i18n.float_left and cfg.i18n.class.float_left or nil)
			:addClass(args.wraplinks ~= cfg.i18n.wrap_true and cfg.i18n.class.wraplinks or nil)
			:addClass(args.bodyclass or args.class)
			:css('width', args.width or nil)
			:cssText(args.bodystyle or args.style)

		if args.outertitle then
			root
				:tag('caption')
					:addClass(cfg.i18n.class.outer_title)
					:addClass(args.outertitleclass)
					:cssText(args.outertitlestyle)
					:wikitext(args.outertitle)
		end

		if args.topimage then
			local imageCell = root:tag('tr'):tag('td')

			imageCell
				:addClass(cfg.i18n.class.top_image)
				:addClass(args.topimageclass)
				:cssText(args.topimagestyle)
				:wikitext(args.topimage)

			if args.topcaption then
				imageCell
					:tag('div')
						:addClass(cfg.i18n.class.top_caption)
						:cssText(args.topcaptionstyle)
						:wikitext(args.topcaption)
			end
		end

		if args.pretitle then
			root
				:tag('tr')
					:tag('td')
						:addClass(args.topimage and cfg.i18n.class.pretitle_with_top_image
							or cfg.i18n.class.pretitle)
						:addClass(args.pretitleclass)
						:cssText(args.basestyle)
						:cssText(args.pretitlestyle)
						:wikitext(args.pretitle)
		end
	else
		root
			:addClass(cfg.i18n.class.subgroup)
			:addClass(args.bodyclass or args.class)
			:cssText(args.bodystyle or args.style)
	end

	if args.title then
		if child then
			root
				:wikitext(args.title)
		else
			root
				:tag('tr')
					:tag('th')
						:addClass(args.pretitle and cfg.i18n.class.title_with_pretitle
							or cfg.i18n.class.title)
						:addClass(args.titleclass)
						:cssText(args.basestyle)
						:cssText(args.titlestyle)
						:wikitext(args.title)
		end
	end

	if args.image then
		local imageCell = root:tag('tr'):tag('td')

		imageCell
			:addClass(cfg.i18n.class.image)
			:addClass(args.imageclass)
			:cssText(args.imagestyle)
			:wikitext(args.image)

		if args.caption then
			imageCell
				:tag('div')
					:addClass(cfg.i18n.class.caption)
					:cssText(args.captionstyle)
					:wikitext(args.caption)
		end
	end

	if args.above then
		root
			:tag('tr')
				:tag('td')
					:addClass(cfg.i18n.class.above)
					:addClass(args.aboveclass)
					:cssText(args.abovestyle)
					:newline() -- newline required for bullet-points to work
					:wikitext(args.above)
	end

	local rowNums = {}
	for k, v in pairs(args) do
		k = '' .. k
		local num = k:match('^heading(%d+)$') or k:match('^content(%d+)$')
		if num then table.insert(rowNums, tonumber(num)) end
	end
	table.sort(rowNums)
	-- remove duplicates from the list (e.g. 3 will be duplicated if both heading3
	-- and content3 are specified)
	for i = #rowNums, 1, -1 do
		if rowNums[i] == rowNums[i - 1] then
			table.remove(rowNums, i)
		end
	end

	for i, num in ipairs(rowNums) do
		local heading = args['heading' .. num]
		if heading then
			root
				:tag('tr')
					:tag('th')
						:addClass(cfg.i18n.class.heading)
						:addClass(args.headingclass)
						:addClass(args['heading' .. num .. 'class'])
						:cssText(args.basestyle)
						:cssText(args.headingstyle)
						:cssText(args['heading' .. num .. 'style'])
						:newline()
						:wikitext(heading)
		end

		local content = args['content' .. num]
		if content then
			root
				:tag('tr')
					:tag('td')
						:addClass(hasSubgroup(content) and cfg.i18n.class.content_with_subgroup
							or cfg.i18n.class.content)
						:addClass(args.contentclass)
						:addClass(args['content' .. num .. 'class'])
						:cssText(args.contentstyle)
						:cssText(args['content' .. num .. 'style'])
						:newline()
						:wikitext(content)
						:done()
					 -- Without a linebreak after the </td>, a nested list like
					 -- "* {{hlist| ...}}" doesn't parse correctly.
					:newline()
		end
	end

	if args.below then
		root
			:tag('tr')
				:tag('td')
					:addClass(cfg.i18n.class.below)
					:addClass(args.belowclass)
					:cssText(args.belowstyle)
					:newline()
					:wikitext(args.below)
	end

	if not child and has_navbar(args.navbar, args.name) then
		root
			:tag('tr')
				:tag('td')
					:addClass(cfg.i18n.class.navbar)
					:cssText(args.navbarstyle)
					:wikitext(require('Module:Navbar')._navbar{
						args.name,
						mini = 1,
						fontstyle = args.navbarfontstyle
					})
	end
	
	local base_templatestyles = frame:extensionTag{
		name = 'templatestyles', args = { src = cfg.i18n.templatestyles }
	}
	
	local templatestyles = ''
	if args['templatestyles'] and args['templatestyles'] ~= '' then
		templatestyles = frame:extensionTag{
			name = 'templatestyles', args = { src = args['templatestyles'] }
		}
	end
	
	local child_templatestyles = ''
	if args['child templatestyles'] and args['child templatestyles'] ~= '' then
		child_templatestyles = frame:extensionTag{
			name = 'templatestyles', args = { src = args['child templatestyles'] }
		}
	end
	
	local grandchild_templatestyles = ''
	if args['grandchild templatestyles'] and args['grandchild templatestyles'] ~= '' then
		grandchild_templatestyles = frame:extensionTag{
			name = 'templatestyles', args = { src = args['grandchild templatestyles'] }
		}
	end

	return table.concat({
		add_list_styles(args), -- see [hlist_note] above about ordering
		base_templatestyles,
		templatestyles,
		child_templatestyles,
		grandchild_templatestyles,
		hiding_templatestyles,
		tostring(root),
		(child and cfg.i18n.category.child or ''),
		categorizeTemplatesWithInlineStyles(args)
	})
end

local function list_title(args, is_centered_list_titles, num)
	
	local title_text = trimAndAddAutomaticNewline(args['list' .. num .. 'title']
		or cfg.i18n.default_list_title)

	local title
	if is_centered_list_titles then
		-- collapsible can be finicky, so provide some CSS/HTML to support
		title = mw.html.create('div')
			:addClass(cfg.i18n.class.list_title_centered)
			:wikitext(title_text)
	else
		title = mw.html.create()
			:wikitext(title_text)
	end
		
	local title_container = mw.html.create('div')
		:addClass(cfg.i18n.class.list_title)
		-- don't /need/ a listnumtitleclass because you can do
		-- .templateclass .listnumclass .sidebar-list-title
		:addClass(args.listtitleclass)
		:cssText(args.basestyle)
		:cssText(args.listtitlestyle)
		:cssText('color: var(--color-base)')
		:cssText(args['list' .. num .. 'titlestyle'])
		:node(title)
		:done()
	
	return title_container
end

--[[
Main entry point for sidebar with collapsible lists.
Does the work of creating the collapsible lists themselves and including them
into the args.
]]
function p.collapsible(frame)
	local args = getArgs(frame)
	if not args.name and
		frame:getParent():getTitle():gsub(cfg.i18n.pattern.collapse_sandbox, '') ==
		cfg.i18n.collapse_title_not_to_add_navbar then
		args.navbar = cfg.i18n.navbar_none
	end

	local contentArgs = {}
	
	local is_centered_list_titles = false
	if args['centered list titles'] and args['centered list titles'] ~= '' then
		is_centered_list_titles = true
	end

	for k, v in pairs(args) do
		local num = string.match(k, '^list(%d+)$')
		if num then
			local expand = args.expanded and
				(args.expanded == 'all' or args.expanded == args['list' .. num .. 'name'])
			local row = mw.html.create('div')
			row
				:addClass(cfg.i18n.class.list)
				:addClass('mw-collapsible')
				:addClass((not expand) and 'mw-collapsed' or nil)
				:addClass(args['list' .. num .. 'class'])
				:cssText(args.listframestyle)
				:cssText(args['list' .. num .. 'framestyle'])
				:node(list_title(args, is_centered_list_titles, num))
				:tag('div')
					:addClass(cfg.i18n.class.list_content)
					:addClass('mw-collapsible-content')
					-- don't /need/ a listnumstyleclass because you can do
					-- .templatename .listnumclass .sidebar-list
					:addClass(args.listclass)
					:cssText(args.liststyle)
					:cssText(args['list' .. num .. 'style'])
					:wikitext(trimAndAddAutomaticNewline(args['list' .. num]))

			contentArgs['content' .. num] = tostring(row)
		end
	end

	for k, v in pairs(contentArgs) do
		args[k] = v
	end

	return p.sidebar(frame, args, cfg.i18n.class.collapse)
end

return p
梦见女婴儿是什么意思 为什么会得人乳头瘤病毒 10.21是什么星座 汗疱疹吃什么药 头晕目眩挂什么科
吃什么会变丑脑筋急转弯 太阳出来我爬山坡是什么歌 变性淀粉是什么 女性的排卵期是什么时候 什么中药可以降糖
什么是匝道 trendiano什么牌子 什么体投地 为什么鼻子无缘无故流鼻血 抽烟对女生有什么危害
男朋友过生日送什么礼物最有意义 同病相怜什么意思 什么时候种大白菜 冬瓜什么季节吃最好 潘多拉魔盒是什么意思
磨砂膏有什么作用hcv9jop2ns5r.cn 龚自珍是什么朝代的gangsutong.com 梦见到处都是蛇预示着什么hcv8jop4ns9r.cn 请佛容易送佛难什么意思mmeoe.com boxing是什么意思hcv8jop0ns2r.cn
母亲节送什么颜色的康乃馨helloaicloud.com 1996是什么年hcv9jop4ns9r.cn 胃热吃什么药hcv9jop3ns7r.cn 画蛇添足告诉我们什么道理hcv7jop6ns3r.cn 什么东西吃了壮阳inbungee.com
稳是什么意思hcv8jop3ns3r.cn 小孩头发黄是什么原因hcv8jop2ns2r.cn 喝蛋白粉有什么副作用jiuxinfghf.com 减脂晚上吃什么好hcv7jop6ns9r.cn 舌头发麻是什么原因引起的hcv8jop7ns9r.cn
揩油是什么意思hcv7jop7ns3r.cn 没吃多少东西但肚子很胀是什么hcv9jop1ns8r.cn 高什么远什么hcv8jop8ns4r.cn 内眼角越揉越痒用什么眼药水hcv7jop7ns1r.cn 反讽是什么意思huizhijixie.com
百度