| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | 4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| 5 <link rel="stylesheet" href="/i/{{master_name}}/default.css" type="text/css"
> | 5 <link rel="stylesheet" href="/i/{{master_name}}/default.css" type="text/css"
> |
| 6 <style> | 6 <style> |
| 7 table, th, td { | 7 table, th, td { |
| 8 border: 1px solid black; | 8 border: 1px solid black; |
| 9 border-collapse: collapse; | 9 border-collapse: collapse; |
| 10 } | 10 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 } | 28 } |
| 29 td a:hover { | 29 td a:hover { |
| 30 text-decoration: underline; | 30 text-decoration: underline; |
| 31 cursor: pointer; | 31 cursor: pointer; |
| 32 } | 32 } |
| 33 tr:hover { | 33 tr:hover { |
| 34 background-color: #F6F6F6; | 34 background-color: #F6F6F6; |
| 35 } | 35 } |
| 36 </style> | 36 </style> |
| 37 <script type="text/javascript"> | 37 <script type="text/javascript"> |
| 38 function showTestsOfOneSuiteOnly(suite_name) { |
| 39 var testTableRows = document.getElementsByClassName( |
| 40 'test-table-body-row'); |
| 41 Array.prototype.slice.call(testTableRows) |
| 42 .forEach(function(row) { |
| 43 var testCasePath = row.getElementsByClassName( |
| 44 'test-table-body-column-0')[0].innerText.trim(); |
| 45 if (testCasePath.startsWith(suite_name)) { |
| 46 row.style.display = 'table-row'; |
| 47 } else { |
| 48 row.style.display = 'none'; |
| 49 } |
| 50 } |
| 51 ); |
| 52 } |
| 53 |
| 54 function showAllTests() { |
| 55 var testTableRows = document.getElementsByClassName( |
| 56 'test-table-body-row'); |
| 57 Array.prototype.slice.call(testTableRows) |
| 58 .forEach(function(row) { |
| 59 row.style.display = 'table-row'; |
| 60 } |
| 61 ); |
| 62 } |
| 63 |
| 38 function sortByColumn(head) { | 64 function sortByColumn(head) { |
| 39 var tbody = head.parentNode.parentNode.nextElementSibling; | 65 var tbody = head.parentNode.parentNode.nextElementSibling; |
| 40 var rows = tbody.rows; | 66 var rows = tbody.rows; |
| 41 | 67 |
| 42 // Put 'tr' in rows to an array. | 68 // Put 'tr' in rows to an array. |
| 43 var arr = Array.prototype.slice.call(rows); | 69 var arr = Array.prototype.slice.call(rows); |
| 44 | 70 |
| 45 // Determine whether to asc or desc and set arrows. | 71 // Determine whether to asc or desc and set arrows. |
| 46 var headers = head.parentNode.getElementsByTagName('th'); | 72 var headers = head.parentNode.getElementsByTagName('th'); |
| 47 var headIndex = Array.prototype.slice.call(headers).indexOf(head); | 73 var headIndex = Array.prototype.slice.call(headers).indexOf(head); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 67 if (asc == 1) { | 93 if (asc == 1) { |
| 68 headers[headIndex].getElementsByClassName('up')[0] | 94 headers[headIndex].getElementsByClassName('up')[0] |
| 69 .style.display = 'inline'; | 95 .style.display = 'inline'; |
| 70 } else { | 96 } else { |
| 71 headers[headIndex].getElementsByClassName('down')[0] | 97 headers[headIndex].getElementsByClassName('down')[0] |
| 72 .style.display = 'inline'; | 98 .style.display = 'inline'; |
| 73 } | 99 } |
| 74 | 100 |
| 75 // Sort the array by the specified column number (col) and order (asc). | 101 // Sort the array by the specified column number (col) and order (asc). |
| 76 arr.sort(function (a, b) { | 102 arr.sort(function (a, b) { |
| 77 var aInnerHTML = a.getElementsByClassName(headIndex)[0].innerHTML; | 103 var aInnerHTML = a.children[headIndex].innerHTML; |
| 78 var bInnerHTML = b.getElementsByClassName(headIndex)[0].innerHTML; | 104 var bInnerHTML = b.children[headIndex].innerHTML; |
| 79 if (head.className == "number") { | 105 if (head.className == "number") { |
| 80 var avalue = Number(aInnerHTML); | 106 var avalue = Number(aInnerHTML); |
| 81 var bvalue = Number(bInnerHTML); | 107 var bvalue = Number(bInnerHTML); |
| 82 } else if (head.className == "text") { | 108 } else if (head.className == "text") { |
| 83 var avalue = aInnerHTML; | 109 var avalue = aInnerHTML; |
| 84 var bvalue = bInnerHTML; | 110 var bvalue = bInnerHTML; |
| 85 } | 111 } |
| 86 return (avalue == bvalue) ? 0 : ((avalue > bvalue) ? asc : -1 * asc); | 112 return (avalue == bvalue) ? 0 : ((avalue > bvalue) ? asc : -1 * asc); |
| 87 }); | 113 }); |
| 88 | 114 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 99 {% for tb_value in tb_values %} | 125 {% for tb_value in tb_values %} |
| 100 {% include 'template/table.html' %} | 126 {% include 'template/table.html' %} |
| 101 <br> | 127 <br> |
| 102 <br> | 128 <br> |
| 103 <br> | 129 <br> |
| 104 {% endfor %} | 130 {% endfor %} |
| 105 </div> | 131 </div> |
| 106 </body> | 132 </body> |
| 107 <script> | 133 <script> |
| 108 Array.prototype.slice.call(document.getElementsByTagName('th')) | 134 Array.prototype.slice.call(document.getElementsByTagName('th')) |
| 109 .forEach(function(head, _) { | 135 .forEach(function(head) { |
| 110 head.addEventListener( | 136 head.addEventListener( |
| 111 "click", | 137 "click", |
| 112 function() { sortByColumn(head); }, | 138 function() { sortByColumn(head); }, |
| 113 false | 139 false |
| 114 ); | 140 ); |
| 115 } | 141 } |
| 116 ); | 142 ); |
| 143 Array.prototype.slice.call( |
| 144 document.getElementsByClassName('suite-table-summary-column-0')) |
| 145 .forEach(function(summaryTotal) { |
| 146 summaryTotal.addEventListener( |
| 147 "click", |
| 148 function() { showAllTests(); }, |
| 149 false |
| 150 ); |
| 151 } |
| 152 ); |
| 153 Array.prototype.slice.call( |
| 154 document.getElementsByClassName('suite-table-body-column-0')) |
| 155 .forEach(function(suiteName) { |
| 156 suiteName.addEventListener( |
| 157 "click", |
| 158 function() { showTestsOfOneSuiteOnly(suiteName.innerText); }, |
| 159 false |
| 160 ); |
| 161 } |
| 162 ); |
| 117 </script> | 163 </script> |
| 118 </html> | 164 </html> |
| OLD | NEW |