什么的长城| 护照拍照穿什么衣服| 海松茸是什么| 铅中毒有什么症状| 老年性脑改变是什么意思| 梦见打死狗有什么预兆| sassy是什么意思| 加德纳菌阳性是什么意思| 99年属兔的是什么命| 马什么坡| 螨虫用什么药膏| 1961年属什么| 胳膊肘疼痛是什么原因| 虾片是什么做的| anti是什么意思| 活性炭是什么东西| 虚病是什么意思| 病理会诊是什么意思| 藏语扎西德勒是什么意思| 倏地是什么意思| 左下腹有什么器官| 梦见自己死了预示什么| 减肥喝什么茶| 香五行属什么| 机灵的动物是什么生肖| 为什么睡觉会出汗| 斗智斗勇什么意思| 一九三七年属什么生肖| 什么是宇宙| 1953年属什么生肖| 苦衷是什么意思| 牵连是什么意思| 什么叫脂肪瘤| 大年初一是什么星座| 羊跟什么生肖最配| 细胞由什么组成| 静脉曲张用什么药好| 气虚吃什么补最快| 胃镜取活检意味着什么| 保护声带喝什么| 犯六冲是什么意思| 偷梁换柱是什么意思| 三伏天喝什么汤最好| 梦见看房子是什么预兆| 什么药治肠炎效果最好| opple是什么牌子| 吃了螃蟹后不能吃什么| 养膘是什么意思| 什么样的孕妇容易翻盘| biemlfdlkk是什么牌子| mic是什么| 备孕需要做什么| 红花油和活络油有什么区别| 鬼打墙是什么意思| 盐酸利多卡因注射作用是什么| 感染性腹泻吃什么药| 鞭炮笋学名叫什么| 夜里2点到3点醒什么原因| 拔智齿后要注意什么| 02年是什么生肖| 反复发烧吃什么药| 自主神经功能紊乱吃什么药| 长寿花什么时候开花| 小鸟为什么会飞| cache是什么意思| 旅游的意义是什么| 欠缺是什么意思| 为什么一吃辣的就拉肚子| 1977年属什么生肖| 腿发软无力是什么原因引起的| 子宫肌瘤是什么原因造成的| 痛风用什么消炎药最好| 大云是什么| lv是什么意思| 百合有什么功效和作用| 月经黑色的是什么原因| 什么是坐骨神经疼有什么症状| 蓄谋已久什么意思| 做完人流需要注意什么| dw是什么| 乡政府属于什么单位| 牛油果什么味道| 白细胞wbc偏高是什么意思| 夏天脚底冰凉是什么原因| 为什么拉屎是绿色的| 军长是什么级别| 被褥是什么意思| 儿童身份证需要什么材料| 凌晨两点半是什么时辰| 鱼什么而什么| 白色属于五行属什么| 牙龈肿了吃什么药| 大腿根部痛是什么原因| 两肺纹理增多模糊是什么意思| 忽视是什么意思| 右枕前位是什么意思| 梦游是什么意思| 老人喝什么牛奶比较好| 什么食物是碱性的| bata鞋属于什么档次| 鱼油什么人不能吃| 手心发红是什么原因| 胃疼吃什么| 一什么西瓜| 今年17岁属什么| 一路繁花的意思是什么| 什么的石头| 手发抖是什么原因引起的| 甲辰年五行属什么| 姨妈疼吃什么止疼药| 23数字代表什么意思| 安赛蜜是什么东西| 梦见巨蟒是什么预兆| 偶尔耳鸣是什么原因| 65什么意思| VA什么意思| 急性咽炎吃什么药| 宾至如归是什么意思| 万圣节应该送什么礼物| 诺如病毒吃什么食物| 血清铁蛋白高说明什么| 夏至节气吃什么| 湖北古代叫什么| 苍蝇为什么喜欢往人身上飞| 卒中优先是什么意思| 咳嗽应该挂什么科| 肠炎吃什么消炎药| vb610是什么药| 成人打虫吃什么药| 眉毛里有痣代表什么| 赭是什么颜色| 咳出血是什么原因| 萤火虫为什么越来越少| 四川耙耳朵是什么意思| 亲和力是什么意思| 小孩腿抽筋是什么原因引起的| 感觉心慌是什么原因| 长智齿一般什么年龄| 性激素六项什么时候查最准确| 牙齿痒是什么原因| 早搏吃什么药好| 痰湿体质吃什么食物好| 补钙吃什么最好| 射手座的幸运色是什么颜色| 孕早期吃什么水果好| 双子座上升星座是什么| 喉咙有痰咳嗽是什么原因| 背痛是什么原因| 老白茶属于什么茶| 后年是什么生肖| 早上八点多是什么时辰| 为什么同房不怀孕原因| 仙逝是什么意思| 人际关系是什么意思| 传单是什么病| 尿道口流脓吃什么药| 关节炎吃什么药| 大学校长是什么级别| 什么是发票抬头| edd是什么意思| 孕妇梦见鬼是什么预兆| 尿酸高是什么原因引起的| 为什么会得甲减| 长痘痘去医院挂什么科| 手指盖空了是什么原因| b什么意思| 舌头锯齿状是什么原因| 青皮是什么皮| 食糜是什么意思| 肾有问题有什么症状| 五险一金指什么| 加速度是什么意思| 天津有什么好吃的| 补钙有什么好处| 干燥综合征挂什么科| 子宫切除有什么影响| 看耳朵挂什么科| 92年是什么命| 刘邦为什么要杀张良| 开庭前家属做什么准备| 贴秋膘是什么意思啊| 金先读什么| 三月三日是什么星座| 吃什么可以提高免疫力和抵抗力| 频繁做噩梦是什么原因| 市辖区是什么意思| 为什么会得白癜风| 一什么房| 体态是什么意思| 小白加小白等于什么| 晗字五行属什么| 晨勃是什么意思| 野生天麻长什么样图片| 一声叹息是什么意思| 皮是什么结构| 金字旁加各念什么| 吃什么胎儿眼睛黑又亮| 考试早餐吃什么| 同归于尽是什么意思| 立冬和冬至什么区别| 通透是什么意思| 1月2日是什么星座| 五服是什么意思| 紫苏泡酒有什么功效| 舌头有裂纹是什么原因| 什么是业力| 朝鲜韩国什么时候分开的| 药剂科是干什么的| 不成功便成仁的仁是什么意思| 肠道消炎用什么药最好| 胃胀想吐是什么原因| 梦见吃核桃是什么意思| 酒精对皮肤有什么伤害| 肚脐眼大代表什么| ckd5期是什么意思| 心律不齐房颤吃什么药| 舌头上有黑点是什么原因| 天子是什么生肖| 舌苔白什么原因| 尿酸低是什么原因| 什么东西含铅量高| 摇头是什么病| 南瓜有什么营养| 什么水果含钾| 12点是什么时辰| 宇宙之外还有什么| 桑葚什么季节成熟| 指甲凹凸不平什么原因| 尿酸高不能吃什么| ca125是什么检查项目| 肥胖纹长什么样| 左肺结节是什么意思| 吃什么对肾有好处| 皮肤黑的人适合穿什么颜色的衣服| 硕士研究生是什么意思| 131是什么意思| 狗狗肠胃不好吃什么药最好| 什么叫词牌名| 又双叒叕念什么啥意思| 诺如病毒感染吃什么药| 经常放屁吃什么药| 腹泻是什么原因引起的| 什么中药可以减肥| 什么平稳| 虚劳病是什么病| 未见卵黄囊及胚芽是什么意思| 五月十七是什么星座| o型血与b型血生的孩子是什么血型| 一个人在家无聊可以做什么| 妈妈的姐姐叫什么| 经常打屁是什么原因| 视力sca分别代表什么| 什么菜可以隔夜吃| 华丽转身是什么意思| 北京有什么好玩的地方| 邪犯少阳证是什么意思| 歌字五行属什么| 有什么功效| 破执是什么意思| 吃了吐是什么原因| 二甲双胍为什么晚上吃| 非营利性医院是什么意思| 怀孕一个月吃什么对宝宝发育好| 呕什么意思| 百度Prije?i na sadr?aj

5个项目获得2013年度南京市优秀城乡规划设计奖

Izvor: Wikipedija


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
梦见自己化妆是什么意思 肛周脓肿吃什么消炎药 奇货可居什么意思 奔豚是什么意思 足底血查什么
二次元文化是什么意思 十羊九不全是什么意思 什么叫闰年 软组织密度影什么意思 什么叫脂溢性皮炎
乔迁之喜送什么花 空心菜不能和什么一起吃 家里有蜈蚣是什么原因 为什么智齿到晚上更疼 tct检查什么项目
中文是什么意思 王爷的儿子叫什么 什么叫撤退性出血 嗜的意思是什么 好男儿志在四方是什么生肖
高血压吃什么食物最好hcv8jop5ns1r.cn 儿童遗尿挂什么科hcv9jop1ns7r.cn 2.8是什么星座hcv8jop2ns8r.cn ab阳性血型是什么血型hcv9jop7ns0r.cn 肺炎吃什么药效果好hcv8jop5ns2r.cn
body是什么意思hcv9jop2ns9r.cn 金水宝胶囊有什么作用shenchushe.com hev是什么病毒hcv8jop0ns2r.cn 买房子要注意什么hcv9jop1ns8r.cn 颈椎应该挂什么科hcv7jop6ns4r.cn
胃气胃胀吃什么药最好hcv8jop5ns1r.cn 做放疗的人吃什么好ff14chat.com 朝鲜和韩国是什么关系hcv9jop3ns6r.cn 雪纺是什么面料sanhestory.com 水瓶男和什么座最配hcv9jop1ns7r.cn
磨牙齿有什么方法可以治hcv8jop3ns1r.cn 腥辣食物指的是什么hcv9jop3ns4r.cn 八卦是什么hcv9jop0ns3r.cn color是什么意思hkuteam.com 衣字旁有什么字xinjiangjialails.com
百度