<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh">
	<id>https://zybkcn.com/w/index.php?action=history&amp;feed=atom&amp;title=MediaWiki%3AGadget-collapsibleTables.js</id>
	<title>MediaWiki:Gadget-collapsibleTables.js - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://zybkcn.com/w/index.php?action=history&amp;feed=atom&amp;title=MediaWiki%3AGadget-collapsibleTables.js"/>
	<link rel="alternate" type="text/html" href="https://zybkcn.com/w/index.php?title=MediaWiki:Gadget-collapsibleTables.js&amp;action=history"/>
	<updated>2026-05-09T22:13:06Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://zybkcn.com/w/index.php?title=MediaWiki:Gadget-collapsibleTables.js&amp;diff=23404&amp;oldid=prev</id>
		<title>入我相思门：​创建页面，内容为“/**  * Collapsible tables  *  * Allows tables to be collapsed, showing only the header. See Wikipedia:NavFrame.  *  * @version 2.0.3 (2014-03-14)  * @source https://www.mediawiki.org/wiki/MediaWiki:Gadget-collapsibleTables.js  * @author User:R. Koot  * @author User:Krinkle  * @deprecated Since MediaWiki 1.20: Use class=&quot;mw-collapsible&quot; instead which  * is supported in MediaWiki core.  */ (function($, mw) { 	var autoCollapse = 2; 	var collapseCaption…”</title>
		<link rel="alternate" type="text/html" href="https://zybkcn.com/w/index.php?title=MediaWiki:Gadget-collapsibleTables.js&amp;diff=23404&amp;oldid=prev"/>
		<updated>2022-04-30T14:58:39Z</updated>

		<summary type="html">&lt;p&gt;创建页面，内容为“&lt;span class=&quot;autocomment&quot;&gt;*  * Collapsible tables  *  * Allows tables to be collapsed, showing only the header. See &lt;a href=&quot;https://en.wikipedia.org/wiki/NavFrame&quot; class=&quot;extiw&quot; title=&quot;wikipedia:NavFrame&quot;&gt;Wikipedia:NavFrame&lt;/a&gt;.  *  * @version 2.0.3 (2014-03-14)  * @source https://www.mediawiki.org/wiki/MediaWiki:Gadget-collapsibleTables.js  * @author &lt;a href=&quot;/w/index.php?title=User:R._Koot&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User:R. Koot（页面不存在）&quot;&gt;User:R. Koot&lt;/a&gt;  * @author &lt;a href=&quot;/w/index.php?title=User:Krinkle&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User:Krinkle（页面不存在）&quot;&gt;User:Krinkle&lt;/a&gt;  * @deprecated Since MediaWiki 1.20: Use class=&amp;quot;mw-collapsible&amp;quot; instead which  * is supported in MediaWiki core.：​&lt;/span&gt; (function($, mw) { 	var autoCollapse = 2; 	var collapseCaption…”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;/**&lt;br /&gt;
 * Collapsible tables&lt;br /&gt;
 *&lt;br /&gt;
 * Allows tables to be collapsed, showing only the header. See [[Wikipedia:NavFrame]].&lt;br /&gt;
 *&lt;br /&gt;
 * @version 2.0.3 (2014-03-14)&lt;br /&gt;
 * @source https://www.mediawiki.org/wiki/MediaWiki:Gadget-collapsibleTables.js&lt;br /&gt;
 * @author [[User:R. Koot]]&lt;br /&gt;
 * @author [[User:Krinkle]]&lt;br /&gt;
 * @deprecated Since MediaWiki 1.20: Use class=&amp;quot;mw-collapsible&amp;quot; instead which&lt;br /&gt;
 * is supported in MediaWiki core.&lt;br /&gt;
 */&lt;br /&gt;
(function($, mw) {&lt;br /&gt;
	var autoCollapse = 2;&lt;br /&gt;
	var collapseCaption = wgULS(&amp;#039;隐藏&amp;#039;, &amp;#039;隱藏&amp;#039;);&lt;br /&gt;
	var expandCaption = wgULS(&amp;#039;显示&amp;#039;, &amp;#039;顯示&amp;#039;);&lt;br /&gt;
	var tableIndex = 0;&lt;br /&gt;
&lt;br /&gt;
	function collapseTable(tableIndex) {&lt;br /&gt;
		var Button = document.getElementById(&amp;#039;collapseButton&amp;#039; + tableIndex);&lt;br /&gt;
		var Table = document.getElementById(&amp;#039;collapsibleTable&amp;#039; + tableIndex);&lt;br /&gt;
		if (!Table || !Button) return false;&lt;br /&gt;
&lt;br /&gt;
		var Rows = Table.rows;&lt;br /&gt;
		var i;&lt;br /&gt;
		if (Button.firstChild.data === collapseCaption) {&lt;br /&gt;
			for (i = 1; i &amp;lt; Rows.length; i++) {&lt;br /&gt;
				Rows[i].style.display = &amp;#039;none&amp;#039;&lt;br /&gt;
			}&lt;br /&gt;
			Button.firstChild.data = expandCaption;&lt;br /&gt;
		} else {&lt;br /&gt;
			for (i = 1; i &amp;lt; Rows.length; i++) {&lt;br /&gt;
				Rows[i].style.display = Rows[0].style.display&lt;br /&gt;
			}&lt;br /&gt;
			Button.firstChild.data = collapseCaption&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	function createClickHandler(tableIndex) {&lt;br /&gt;
		return function(e) {&lt;br /&gt;
			e.preventDefault();&lt;br /&gt;
			collapseTable(tableIndex)&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	function createCollapseButtons($content) {&lt;br /&gt;
		var NavigationBoxes = {};&lt;br /&gt;
		var $Tables = $content.find(&amp;#039;table&amp;#039;);&lt;br /&gt;
		var i;&lt;br /&gt;
&lt;br /&gt;
		$Tables.each(function(i, table) {&lt;br /&gt;
			if ($(table).hasClass(&amp;#039;collapsible&amp;#039;)) {&lt;br /&gt;
&lt;br /&gt;
				/* only add button and increment count if there is a header row to work with */&lt;br /&gt;
				var HeaderRow = table.getElementsByTagName(&amp;#039;tr&amp;#039;)[0];&lt;br /&gt;
				if (!HeaderRow) return;&lt;br /&gt;
				var Header = table.getElementsByTagName(&amp;#039;th&amp;#039;)[0];&lt;br /&gt;
				if (!Header) return;&lt;br /&gt;
&lt;br /&gt;
				NavigationBoxes[tableIndex] = table;&lt;br /&gt;
				table.setAttribute(&amp;#039;id&amp;#039;, &amp;#039;collapsibleTable&amp;#039; + tableIndex);&lt;br /&gt;
&lt;br /&gt;
				var Button = document.createElement(&amp;#039;span&amp;#039;);&lt;br /&gt;
				var ButtonLink = document.createElement(&amp;#039;a&amp;#039;);&lt;br /&gt;
				var ButtonText = document.createTextNode(collapseCaption);&lt;br /&gt;
				// Styles are declared in [[MediaWiki:Common.css]]&lt;br /&gt;
				Button.className = &amp;#039;collapseButton&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
				ButtonLink.style.color = Header.style.color;&lt;br /&gt;
				ButtonLink.setAttribute(&amp;#039;id&amp;#039;, &amp;#039;collapseButton&amp;#039; + tableIndex);&lt;br /&gt;
				ButtonLink.setAttribute(&amp;#039;href&amp;#039;, &amp;#039;#&amp;#039;);&lt;br /&gt;
				$(ButtonLink).on(&amp;#039;click&amp;#039;, createClickHandler(tableIndex));&lt;br /&gt;
				ButtonLink.appendChild(ButtonText);&lt;br /&gt;
&lt;br /&gt;
				Button.appendChild(document.createTextNode(&amp;#039;[&amp;#039;));&lt;br /&gt;
				Button.appendChild(ButtonLink);&lt;br /&gt;
				Button.appendChild(document.createTextNode(&amp;#039;]&amp;#039;));&lt;br /&gt;
&lt;br /&gt;
				Header.insertBefore(Button, Header.firstChild);&lt;br /&gt;
				tableIndex++&lt;br /&gt;
			}&lt;br /&gt;
		});&lt;br /&gt;
&lt;br /&gt;
		for (i = 0; i &amp;lt; tableIndex; i++) {&lt;br /&gt;
			if ($(NavigationBoxes[i]).hasClass(&amp;#039;collapsed&amp;#039;) ||&lt;br /&gt;
				(tableIndex &amp;gt;= autoCollapse &amp;amp;&amp;amp; $(NavigationBoxes[i]).hasClass(&amp;#039;autocollapse&amp;#039;))) {&lt;br /&gt;
				collapseTable(i)&lt;br /&gt;
			} else if ($(NavigationBoxes[i]).hasClass(&amp;#039;innercollapse&amp;#039;)) {&lt;br /&gt;
				var element = NavigationBoxes[i];&lt;br /&gt;
				while ((element = element.parentNode)) {&lt;br /&gt;
					if ($(element).hasClass(&amp;#039;outercollapse&amp;#039;)) {&lt;br /&gt;
						collapseTable(i);&lt;br /&gt;
						break&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	mw.hook(&amp;#039;wikipage.content&amp;#039;).add(createCollapseButtons);&lt;br /&gt;
&lt;br /&gt;
})(jQuery, mw);&lt;/div&gt;</summary>
		<author><name>入我相思门</name></author>
	</entry>
</feed>