梦见大蟒蛇是什么征兆| 精神紊乱吃什么药| 笑死是什么意思| 梭织面料是什么面料| 77年属蛇的是什么命| gpd是什么意思| c1e驾照能开什么车| 牛奶什么时候喝| 什么负什么名| 驻马店有什么大学| 几斤几两是什么意思| 一个口一个女念什么| 为什么做完爱下面会疼| 淋球菌阳性是什么病| 吉祥动物是什么生肖| 咳嗽胸口疼是什么原因| gly是什么氨基酸| 灌肠什么意思| 女人为什么会患得患失| 什么叫制动| 爱的真正含义是什么| 瑀字五行属什么| 活血是什么意思| 社保缴纳基数是什么意思| 子欲养而亲不待什么意思| 属马本命佛是什么佛| 7月20日什么星座| 下面瘙痒用什么药膏| zn是什么元素| 92属什么| 农历10月是什么月| 通五行属什么| 什么是钙化| 十八罗汉分别叫什么| 为什么会得疣| 肚子胀气什么原因| 腿发热是什么原因引起的| 天人合一是什么意思| 打喷嚏漏尿是什么原因| 现在什么星座| 清官是什么意思| ct是什么| 口腔上火了吃什么降火最快| 什么牌子的笔记本电脑好| 梦见好多衣服是什么意思| 少一颗牙齿有什么影响| 主动脉钙化什么意思| 汤姆猫是什么品种| 材料化学属于什么类| 腕管综合征挂什么科| hbsag阴性是什么意思| 无蔗糖是什么意思| 什么鸟叫声最好听| 四月23日是什么星座| 谁发明了什么| 左手食指麻木是什么原因引起的| 勺是什么意思| 女人梦见鞋子什么预兆| 什么叫肺部纤维灶| 安可什么意思| 成人改名字需要什么手续| 睡觉腿麻是什么原因引起| 换气是什么意思| 谷胱甘肽是什么| 植鞣皮是什么皮| 弧度是什么意思| 长期手淫会有什么后果| 亲亲抱抱举高高什么意思| hd什么意思| 女孩为什么难得午时贵| 喉咙嘶哑是什么原因| 绵密是什么意思| 七月份有什么节日吗| 贝加台念什么| 见好就收是什么意思| 为什么会得胆囊炎| 梦见李子是什么意思| 干咳吃什么药| elle是什么档次的牌子| 梦见酒是什么意思| 雷公根有什么功效| 儿童吃什么钙片补钙效果好| 2月22日什么星座| 脾胃不好吃什么食物可以调理| 脑堵塞有什么症状| 阑尾切除后有什么影响和后遗症| 狗狗怀孕吃什么| dpl是什么意思| 11月17号是什么星座| 福建安溪名茶是什么| 维生素b2是什么颜色| 骨质疏松吃什么| nbr是什么材料| 保释金是什么意思| 外阴炎用什么药膏| 画地为牢下一句是什么| 肠胃不好吃什么调理| 滑膜炎挂什么科| 明朝北京叫什么| 孕妇吃菠萝对胎儿有什么好处| 男人下面胀痛什么原因造成呢| 三年级用什么笔| 遥字五行属什么| 血燥吃什么药| 用什么方法止咳| 胃阴虚吃什么药| ics是什么药| 淼念什么| 葛根粉有什么作用| 脊髓炎吃什么药| 卤素灯是什么灯| 刍狗是什么意思| 呕吐发烧是什么原因| 小肠气有什么症状| 睡眠质量差吃什么药| 肌酸激酶偏高说明什么| pd990是什么金| 斜视手术有什么后遗症和风险| 荔枝与什么不能同吃| 京东pop是什么意思| 3月14日是什么星座| 夺魁是什么意思| 男鼠配什么生肖最好| 灰指甲长什么样子图片| 什么品种的西瓜最好吃| 双性恋是什么| 8.9是什么星座| 今年温度为什么这么高| 益精是什么意思| 女性出汗多是什么原因| 喉咙痛吃什么好| 存在感是什么意思| 心口窝疼是什么原因| 腋窝爱出汗是什么原因| 奸诈是什么意思| 三个白念什么| 老年人贫血吃什么补血最快最有效| 喜欢一个人会有什么表现| pending是什么状态| 耷拉是什么意思| 什么是生理期| 减肥期间晚上可以吃什么| 香港说什么语言| 备孕前准备吃什么叶酸| 缺少雌激素的女性会有什么症状| 天使综合征是什么病| 死胎有什么症状| 湿热是什么意思| 什么的北风| 汪字五行属什么| 皮肤粗糙缺什么维生素| 开火念什么| 2007属什么生肖| 如来藏是什么意思| 清朝是什么时候灭亡的| 梦游为什么不能叫醒| 梦见蛇是什么预兆| 皮试是什么| 涉三什么意思| 市组织部长是什么级别| 闹代表什么生肖| 人体消化道中最长的器官是什么| 心脏病有什么症状表现| 石家庄以前叫什么名字| 什么一笑| 乾隆的名字叫什么| 片反过来念什么| 跖疣是什么原因造成的| 文化底蕴是什么意思| c14检查前需要注意什么| 小苏打学名叫什么| 什么叫安置房| 索是什么意思| dl是什么单位| 人上人是什么意思| 腹部胀气吃什么药| tel是什么意思啊| 人心果什么时候成熟| 放疗是什么| 上日下文念什么| 左心房增大是什么原因| 疏朗是什么意思| 脑震荡什么症状| 射手座属于什么象星座| 台风什么时候到上海| 潘多拉属于什么档次| 什么什么之财| 低压偏高什么原因| 麻风疫苗什么时候打| 顾问是什么意思| 日月星辰是什么意思| 哈欠是什么意思| 七月二十二什么日子| 事业有成是什么意思| 嘴巴里长水泡是什么原因| 柿子和什么不能一起吃| yet是什么意思| 什么什么桑田| 马铃薯什么时候传入中国| 温州有什么区| 咳嗽看什么科室| 马上风为什么拔不出来| 肾主骨是什么意思| 朱砂是什么材质| 脚扭了挂什么科| 忽必烈姓什么| 大吉大利是什么生肖| 芒果什么季节成熟| 什么的问题| 心脏t波改变是什么意思| 甲状腺有血流信号是什么意思| 水过鸭背是什么意思| 花儿乐队为什么解散| 有黄痰是什么原因| 霉菌性阴道炎有什么症状| 心脏彩超ef是什么意思| 屎为什么是黑色的| 转氨酶高吃什么好得快| 什么叫御姐| 热火朝天是什么生肖| 媛是什么意思| 乌鸡放什么炖补气补血| 蚯蚓可以钓什么鱼| 妍什么意思| 9月13日是什么日子| 橙色预警是什么级别| 打呼噜挂什么科室| 什么叫戒断反应| 双鱼座最配什么星座| 羊肉补什么| 教师节唱什么歌| 总价包干是什么意思| kps是什么意思| 睡觉喜欢流口水是什么原因| Iud是什么| ti什么意思| 希特勒为什么恨犹太人| 人流后需要注意什么| 魈是什么意思| 岁月匆匆像一阵风是什么歌| 什么的兵马俑| 喝牛奶不能和什么一起吃| sf什么意思| 岔气了吃什么药| 脾的主要功能是什么| 为什么头皮总是很痒| 柔顺剂是什么| 伤疤好了变黑了是什么原因| 体内湿气重吃什么药| 六字真言是什么| 尿糖一个加号是什么意思| 舌苔白厚吃什么药见效快| 火乐读什么| 肝血管瘤有什么症状表现| 高汤是什么汤| 葡萄糖偏高有什么问题| 茶叶过期了有什么用途| 世界八大奇迹分别是什么| 不规则抗体筛查是什么意思| 手到擒来是什么意思| 少女怀春是什么意思| 梦见已故朋友什么预兆| 扦脚是什么意思| 10月4日是什么星座| 百度Пре?и на садржа?

关于印发《中小学校体育工作督导评估办法》的通知

Страница ?е под полузаштитом!
С Википеди?е, слободне енциклопеди?е
Документаци?а модула[прикажи] [уреди] [истори?а] [освежи]
百度 1950年,皮萨德将一层改为英式风格。

This module implements the templates {{sidebar}} and {{sidebar with collapsible lists}}. See the individual template pages for documentation.

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
八字缺什么怎么算 巴旦木是什么树的果实 过山风是什么蛇 邮政ems是什么意思 酵素什么牌子好
什么是健康管理 煎牛排用什么油 蒲公英长什么样子 什么菜不能放醋 胎教什么时候开始最好
鱼腥草不能和什么一起吃 梦见吃饭是什么预兆 血压是什么 肋间神经痛用什么药 恐龙蛋是什么水果
副乳是什么原因造成的 mcu是什么 金银花有什么效果 西游记什么时候写的 佛法的真谛是什么
宫颈粘膜慢性炎是什么意思hcv8jop8ns6r.cn ns是什么单位hcv8jop8ns5r.cn 声嘶力竭是什么意思hcv8jop4ns1r.cn 吃什么水果降火hcv8jop2ns7r.cn 空降兵属于什么兵种hcv8jop1ns8r.cn
五味子长什么样hcv8jop5ns7r.cn 农历7月21日是什么星座hcv9jop5ns9r.cn 嫦娥是什么生肖hcv7jop6ns8r.cn 吃素是什么意思hcv9jop2ns3r.cn 眼睛模糊吃什么药hcv7jop9ns4r.cn
致青春是什么意思hcv7jop6ns3r.cn 点痣不能吃什么东西hcv8jop2ns7r.cn 打鸡血是什么意思hcv8jop5ns4r.cn 蒲公英的约定表达什么hcv7jop4ns8r.cn 女人喜欢什么样的男人hcv8jop8ns0r.cn
孩子呼吸道感染吃什么药效果最好hcv8jop7ns7r.cn 驾临是什么意思weuuu.com 河里的贝壳叫什么bysq.com 小米粥配什么菜好吃luyiluode.com 黑今念什么hcv8jop9ns4r.cn
百度 技术支持:克隆蜘蛛池 www.kelongchi.com