差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
| programming:javascript [2008/11/12 23:35] – nakayama | programming:javascript [2019/05/18 02:23] (現在) – 外部編集 非ログインユーザー | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| < | < | ||
| - | 	<style type=" | + |    | 
| - | thead | + | table { | 
| - | { | + |        | 
| - | background: #aaf no-repeat right center; | + |       border: 1px solid black; border-collapse: | 
| - | } | + | font-size: small; | 
| - | tr.alternate * | + |       font-family: | 
| - | { | + | } | 
| - | 			background-color: | + | td, th { | 
| - | } | + |        | 
| - | 	</ | + | border: 1px solid silver; | 
| - | 	<table id="table_sort"  | + | } | 
| - | 		< | + | th { | 
| - | 			< | + | text-align: left; | 
| - | 				<td>.NET バージョン</ | + |       padding-right: | 
| - | 				<td> | + | cursor: default; | 
| - | 				<td> | + | } | 
| - | 		</ | + | |
| - | 		< | + |     thead th.sort-asc, | 
| - | 			< | + |        | 
| - | 				< | + | } | 
| - | 				< | + |     thead th.sort-desc { background-image: | 
| - | 				< | + |      | 
| - | 			</ | + |   </ | 
| - | 			<tr class=" | + |   <script type="text/ | 
| - | 				< | + |   <script type=" | 
| - | 				< | + | Element.addMethods({ | 
| - | 				< | + |   collectTextNodes: | 
| - | 			</ | + | return $A($(element).childNodes).collect( function(node) { | 
| - | 			< | + | return (node.nodeType==3 ? node.nodeValue : | 
| - | 				< | + |         (node.hasChildNodes() ? Element.collectTextNodes(node) : '' | 
| - | 				< | + |     }).flatten().join('' | 
| - | 				< | + | } | 
| - | 			</ | + | }); | 
| - | 			<tr class=" | + | |
| - | 				< | + | var TableSorter = Class.create({ | 
| - | 				< | + | initialize: function(element) { | 
| - | 				< | + |         this.element = $(element); | 
| - | 			</ | + | this.sortIndex = -1; | 
| - | 			< | + |         this.sortOrder = ' | 
| - | 				< | + |         this.initDOMReferences(); | 
| - | 				< | + |         this.initEventHandlers(); | 
| - | 				< | + | }, // initialize | 
| - | 			</ | + | |
| - | 			<tr class=" | + |       initDOMReferences: | 
| - | 				< | + |         var head = this.element.down(' | 
| - | 				< | + |         var body = this.element.down(' | 
| - | 				< | + | if (!head || !body) | 
| - | 			</ | + |           throw ' | 
| - | 			< | + |         this.headers = head.down(' | 
| - | 				< | + |         this.headers.each(function(e, | 
| - | 				< | + | e._colIndex = i; | 
| - | 				< | + | }); | 
| - | 			</ | + | this.body = body; | 
| - | 			<tr class=" | + | }, // initDOMReferences | 
| - | 				< | + | |
| - | 				< | + |       initEventHandlers: | 
| - | 				< | + |         this.handler = this.handleHeaderClick.bind(this); | 
| - | 			</ | + |         this.element.observe(' | 
| - | 			< | + | }, // initEventHandlers | 
| - | 				< | + | |
| - | 				< | + |       handleHeaderClick: | 
| - | 				< | + |         var element = e.element(); | 
| - | 			</ | + |         if (!(' | 
| - | 			<tr class=" | + | element = element.ancestors().find(function(elt) { | 
| - | 				< | + |             return ' | 
| - | 				< | + | }); | 
| - | 				< | + |           if (!((element) && ' | 
| - | 			</ | + | return; | 
| - | 			< | + | } | 
| - | 				< | + |         this.sort(element._colIndex); | 
| - | 				< | + | }, // handleHeaderClick | 
| - | 				< | + | |
| - | 			</ | + |       adjustSortMarkers: | 
| - | 			<tr class=" | + | if (this.sortIndex != -1) | 
| - | 				< | + |           this.headers[this.sortIndex].removeClassName(' | 
| - | 				< | + |             this.sortOrder); | 
| - | 				< | + | if (this.sortIndex != index) { | 
| - | 			</ | + |           this.sortOrder = ' | 
| - | 			< | + | this.sortIndex = index; | 
| - | 				< | + | } else | 
| - | 				< | + |           this.sortOrder = (' | 
| - | 				< | + |         this.headers[index].addClassName(' | 
| - | 			</ | + | }, // adjustSortMarkers | 
| - | 			<tr class=" | + | |
| - | 				< | + | sort: function(index) { | 
| - | 				< | + |         this.adjustSortMarkers(index); | 
| - | 				< | + |         var rows = this.body.childElements(); | 
| - | 			</ | + | rows = rows.sortBy(function(row) { | 
| - | 			< | + |           return row.childElements()[this.sortIndex].collectTextNodes(); | 
| - | 				< | + |         }.bind(this)); | 
| - | 				< | + |         if (' | 
| - | 				< | + |           rows.reverse(); | 
| - | 			</ | + |         rows.reverse().each(function(row, | 
| - | 			<tr class=" | + |           if (index  | 
| - | 				< | + |              | 
| - | 				< | + |         }.bind(this)); | 
| - | 				< | + |         rows.reverse().each(function(row, | 
| - | 			</ | + |           row[(1 == index % 2 ? ' | 
| - | 			< | + | }); | 
| - | 				< | + | } // sort | 
| - | 				< | + | }); // TableSorter | 
| - | 				< | + | |
| - | 			</ | + |     document.observe(' | 
| - | 			<tr class=" | + |       $$(' | 
| - | 				< | + | }); | 
| - | 				< | + |   </ | 
| - | 				< | + |   <table id=" | 
| - | 			</ | + |     < | 
| - | 			< | + |        | 
| - | 				< | + |         <th>.NET バージョン</ | 
| - | 				< | + |         <th> | 
| - | 				< | + |         <th> | 
| - | 			</ | + | </tr> | 
| - | 			<tr class=" | + |     </ | 
| - | 				< | + |     < | 
| - | 				< | + |       < | 
| - | 				< | + |         < | 
| - | 			</ | + |         < | 
| - | 			< | + |         < | 
| - | 				< | + |       </ | 
| - | 				< | + |       <tr class=" | 
| - | 				< | + |         < | 
| - | 			</ | + |         < | 
| - | 			<tr class=" | + |         < | 
| - | 				< | + |       </ | 
| - | 				< | + |       < | 
| - | 				< | + |         < | 
| - | 			</ | + |         < | 
| - | 		</ | + |         < | 
| - | 	</ | + |       </ | 
| + |       <tr class=" | ||
| + |         < | ||
| + |         < | ||
| + |         < | ||
| + |       </ | ||
| + |       < | ||
| + |         < | ||
| + |         < | ||
| + |         < | ||
| + |       </ | ||
| + |       <tr class=" | ||
| + |         < | ||
| + |         < | ||
| + |         < | ||
| + |       </ | ||
| + |       < | ||
| + |         < | ||
| + |         < | ||
| + |         < | ||
| + |       </ | ||
| + |       <tr class=" | ||
| + |         < | ||
| + |         < | ||
| + |         < | ||
| + |       </ | ||
| + |       < | ||
| + |         < | ||
| + |         < | ||
| + |         < | ||
| + |       </ | ||
| + |       <tr class=" | ||
| + |         < | ||
| + |         < | ||
| + |         < | ||
| + |       </ | ||
| + |       < | ||
| + |         < | ||
| + |         < | ||
| + |         < | ||
| + |       </ | ||
| + |       <tr class=" | ||
| + |         < | ||
| + |         < | ||
| + |         < | ||
| + |       </ | ||
| + |       < | ||
| + |         < | ||
| + |         < | ||
| + |         < | ||
| + |       </ | ||
| + |       <tr class=" | ||
| + |         < | ||
| + |         < | ||
| + |         < | ||
| + |       </ | ||
| + |       < | ||
| + |         < | ||
| + |         < | ||
| + |         < | ||
| + |       </ | ||
| + |       <tr class=" | ||
| + |         < | ||
| + |         < | ||
| + |         < | ||
| + |       </ | ||
| + |       < | ||
| + |         < | ||
| + |         < | ||
| + |         < | ||
| + |       </ | ||
| + |       <tr class=" | ||
| + |         < | ||
| + |         < | ||
| + |         < | ||
| + |       </ | ||
| + |       < | ||
| + |         < | ||
| + |         < | ||
| + |         < | ||
| + |       </ | ||
| + |       <tr class=" | ||
| + |         < | ||
| + |         < | ||
| + |         < | ||
| + |       </ | ||
| + |       < | ||
| + |         < | ||
| + |         < | ||
| + |         < | ||
| + |       </ | ||
| + |       <tr class=" | ||
| + |         < | ||
| + |         < | ||
| + |         < | ||
| + |       </ | ||
| + |     </ | ||
| + |   </ | ||
| + | <table id=" | ||
| + |     < | ||
| + |         < | ||
| + |             < | ||
| + |             < | ||
| + |             < | ||
| + |         </ | ||
| + |     </ | ||
| + |     < | ||
| + |         < | ||
| + |             < | ||
| + |             < | ||
| + |             < | ||
| + |         </ | ||
| + |         <tr class=" | ||
| + |             < | ||
| + |             < | ||
| + |             < | ||
| + | |||
| + |         </ | ||
| + |         < | ||
| + |             < | ||
| + |             < | ||
| + |             < | ||
| + |          | ||
| + |     </ | ||
| + | </ | ||
| </ | </ | ||