|
62 | 62 | font-size: 22px;
|
63 | 63 | }
|
64 | 64 |
|
| 65 | + #search-content { |
| 66 | + margin-top: 16px; |
| 67 | + } |
| 68 | + |
65 | 69 | #filters-content .section-heading {
|
66 | 70 | font-size: 18px;
|
67 | 71 | }
|
|
75 | 79 | border: 1px black;
|
76 | 80 | border-style: dotted;
|
77 | 81 | margin: 16px 0px;
|
| 82 | + border-radius: 10px; |
78 | 83 | }
|
79 | 84 |
|
80 | 85 | #settings input {
|
|
132 | 137 | opacity: 1;
|
133 | 138 | }
|
134 | 139 | </style>
|
135 |
| - <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script> |
136 | 140 | </head>
|
137 | 141 |
|
138 | 142 | <body class="container" style="max-width:800px">
|
|
141 | 145 | <a href="status.html">status</a>, <a href="help.html">help</a>.
|
142 | 146 | </div>
|
143 | 147 | <br />
|
| 148 | + <h1>Comparing <span id="stat-header">instructions:u</span> between <span id="before">???</span> and <span |
| 149 | + id="after">???</span></h1> |
144 | 150 | <form id="settings" action="">
|
145 |
| - <fieldset id="commits"> |
146 |
| - <legend class="section-heading">Commits</legend> |
147 |
| - <div style="display: flex; width: 100%; justify-content: space-around;"> |
148 |
| - <div class="commit-input"> |
149 |
| - <label for="start-bound">Before</label> |
150 |
| - <input width="100em" placeholder="YYYY-MM-DD or Commit SHA" id="start-bound" /><br> |
| 151 | + <div id="search-toggle" class="section-heading">Compare Other Commits<span id="search-toggle-indicator"></span> |
| 152 | + </div> |
| 153 | + <div id="search-content"> |
| 154 | + <fieldset id="commits"> |
| 155 | + <legend class="section-heading">Commits</legend> |
| 156 | + <div style="display: flex; width: 100%; justify-content: space-around;"> |
| 157 | + <div class="commit-input"> |
| 158 | + <label for="start-bound">Before</label> |
| 159 | + <input width="100em" placeholder="YYYY-MM-DD or Commit SHA" id="start-bound" /><br> |
| 160 | + </div> |
| 161 | + <div class="commit-input"> |
| 162 | + <label for="end-bound">After</label> |
| 163 | + <input width="100em" placeholder="YYYY-MM-DD or Commit SHA" id="end-bound" /><br> |
| 164 | + </div> |
151 | 165 | </div>
|
152 |
| - <div class="commit-input"> |
153 |
| - <label for="end-bound">After</label> |
154 |
| - <input width="100em" placeholder="YYYY-MM-DD or Commit SHA" id="end-bound" /><br> |
| 166 | + </fieldset> |
| 167 | + <div id="metric" style="position: relative;height: 60px;"> |
| 168 | + <label class="section-heading" for="stats">Metric</label> |
| 169 | + <div style="width: 100%; position: absolute; top:0; display: flex; justify-content: center;"> |
| 170 | + <select id='stats' name="stat"></select> |
155 | 171 | </div>
|
156 | 172 | </div>
|
157 |
| - </fieldset> |
158 |
| - <div id="metric" style="position: relative;height: 60px;"> |
159 |
| - <label class="section-heading" for="stats">Metric</label> |
160 |
| - <div style="width: 100%; position: absolute; top:0; display: flex; justify-content: center;"> |
161 |
| - <select id='stats' name="stat"></select> |
162 |
| - </div> |
| 173 | + <input id="submit" type="submit" value="Submit" onclick="submit_settings(); return false;"> |
163 | 174 | </div>
|
164 |
| - <input id="submit" type="submit" value="Submit" onclick="submit_settings(); return false;"> |
165 | 175 | </form>
|
166 | 176 | <div id="filters">
|
167 | 177 | <div id="filters-toggle" class="section-heading">Filters<span id="filters-toggle-indicator"></span></div>
|
|
219 | 229 | <script src="https://cdnjs.cloudflare.com/ajax/libs/msgpack-lite/0.1.26/msgpack.min.js"></script>
|
220 | 230 | <script src="shared.js"></script>
|
221 | 231 | <script>
|
222 |
| - function toggle_filters() { |
223 |
| - let styles = document.getElementById("filters-content").style; |
224 |
| - let indicator = document.getElementById("filters-toggle-indicator"); |
| 232 | + function toggle_filters(id, toggle) { |
| 233 | + let styles = document.getElementById(id).style; |
| 234 | + let indicator = document.getElementById(toggle); |
225 | 235 | if (styles.display != "none") {
|
226 | 236 | indicator.innerHTML = "⯈"
|
227 | 237 | styles.display = "none";
|
|
230 | 240 | styles.display = "block";
|
231 | 241 | }
|
232 | 242 | }
|
233 |
| - toggle_filters(); |
| 243 | + toggle_filters("filters-content", "filters-toggle-indicator"); |
| 244 | + toggle_filters("search-content", "search-toggle-indicator"); |
234 | 245 |
|
235 | 246 | document.getElementById("filters-toggle").onclick = (e) => {
|
236 |
| - toggle_filters(); |
| 247 | + toggle_filters("filters-content", "filters-toggle-indicator"); |
| 248 | + }; |
| 249 | + document.getElementById("search-toggle").onclick = (e) => { |
| 250 | + toggle_filters("search-content", "search-toggle-indicator"); |
237 | 251 | };
|
238 | 252 |
|
239 | 253 |
|
|
641 | 655 | }, state);
|
642 | 656 | make_request("/get", values).then(function (data) {
|
643 | 657 | DATA = data;
|
| 658 | + update_header(data.a.commit, data.b.commit); |
644 | 659 | populate_data(data);
|
645 | 660 | });
|
646 | 661 | }
|
647 | 662 |
|
| 663 | + function update_header(a, b, stat) { |
| 664 | + let shorten = (text) => { |
| 665 | + return text.substring(0, 7); |
| 666 | + } |
| 667 | + a && (document.getElementById("before").innerHTML = shorten(a)); |
| 668 | + b && (document.getElementById("after").innerHTML = shorten(b)); |
| 669 | + stat && (document.getElementById("stat-header").innerHTML = stat); |
| 670 | + } |
| 671 | + function findQueryParam(name) { |
| 672 | + let urlParams = window.location.search.substring(1).split("&").map(x => x.split("=")); |
| 673 | + let pair = urlParams.find(x => x[0] === name) |
| 674 | + if (pair) { |
| 675 | + return unescape(pair[1]); |
| 676 | + } |
| 677 | + } |
| 678 | + let start = findQueryParam("start"); |
| 679 | + let end = findQueryParam("end"); |
| 680 | + let stat = findQueryParam("stat") |
| 681 | + update_header(start, end, stat); |
| 682 | + |
648 | 683 | function submit_settings() {
|
649 | 684 | let start = document.getElementById("start-bound").value;
|
650 | 685 | let end = document.getElementById("end-bound").value;
|
|
0 commit comments