| OLD | NEW |
| 1 {% extends "announce.html" %} | 1 {% extends "announce.html" %} |
| 2 | 2 |
| 3 {% block head %} | 3 {% block head %} |
| 4 {{ super() }} | 4 {{ super() }} |
| 5 <script type='text/javascript'> | 5 <script type='text/javascript'> |
| 6 // <![CDATA[ | 6 // <![CDATA[ |
| 7 // | 7 // |
| 8 | 8 |
| 9 // | 9 // |
| 10 // Functions used to display the build status bubble on box click. | 10 // Functions used to display the build status bubble on box click. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // like in an empty table cell. | 64 // like in an empty table cell. |
| 65 function checkMouseLeave(element, event) { | 65 function checkMouseLeave(element, event) { |
| 66 if (element.contains && event.toElement) { | 66 if (element.contains && event.toElement) { |
| 67 return !element.contains(event.toElement); | 67 return !element.contains(event.toElement); |
| 68 } | 68 } |
| 69 else if (event.relatedTarget) { | 69 else if (event.relatedTarget) { |
| 70 return !containsDOM(element, event.relatedTarget); | 70 return !containsDOM(element, event.relatedTarget); |
| 71 } | 71 } |
| 72 } | 72 } |
| 73 | 73 |
| 74 // Returns the value of a GET parameter, or null if it does not exist. |
| 75 function readGetParameter(name) { |
| 76 var begin = name + '='; |
| 77 var data = location.search; |
| 78 if (data === '') { |
| 79 return null; |
| 80 } |
| 81 // Location starts with "?". |
| 82 data = data.substr(1); |
| 83 var parameters = data.split('&'); |
| 84 var foundElement = parameters.find( (parameter) => { |
| 85 return parameter.indexOf(begin) == 0; |
| 86 }); |
| 87 if (foundElement) { |
| 88 return decodeURIComponent(foundElement.substr(begin.length)); |
| 89 } |
| 90 return null; |
| 91 } |
| 92 |
| 74 // Creates a new cookie. | 93 // Creates a new cookie. |
| 75 function createCookie(name, value, day) { | 94 function createCookie(name, value, day) { |
| 76 var date = new Date(); | 95 var date = new Date(); |
| 77 date.setTime(date.getTime() + (day * 24 * 60 * 60 * 1000)); | 96 date.setTime(date.getTime() + (day * 24 * 60 * 60 * 1000)); |
| 78 var expires = "; expires=" + date.toGMTString(); | 97 var expires = "; expires=" + date.toGMTString(); |
| 79 document.cookie = name + "=" + value+expires + "; path=/"; | 98 document.cookie = name + "=" + value+expires + "; path=/"; |
| 80 } | 99 } |
| 81 | 100 |
| 82 // Returns the vaue of a cookie, or null if it does not exist. | 101 // Returns the value of a cookie, or null if it does not exist. |
| 83 function readCookie(name) { | 102 function readCookie(name) { |
| 84 var begin = name + "="; | 103 var begin = name + "="; |
| 85 var data = document.cookie.split(';'); | 104 var data = document.cookie.split(';'); |
| 86 for(var i = 0; i < data.length; i++) { | 105 for(var i = 0; i < data.length; i++) { |
| 87 var cookie = data[i]; | 106 var cookie = data[i]; |
| 88 while (cookie.charAt(0) == ' ') | 107 while (cookie.charAt(0) == ' ') |
| 89 cookie = cookie.substring(1, cookie.length); | 108 cookie = cookie.substring(1, cookie.length); |
| 90 if (cookie.indexOf(begin) == 0) | 109 if (cookie.indexOf(begin) == 0) |
| 91 return cookie.substring(begin.length, cookie.length); | 110 return cookie.substring(begin.length, cookie.length); |
| 92 } | 111 } |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 eraseCookie('merged') | 283 eraseCookie('merged') |
| 265 | 284 |
| 266 // Display the "merge" button. | 285 // Display the "merge" button. |
| 267 document.querySelectorAll('.merge')[0].style.display = 'inline' | 286 document.querySelectorAll('.merge')[0].style.display = 'inline' |
| 268 | 287 |
| 269 // Hide the "unmerge" button. | 288 // Hide the "unmerge" button. |
| 270 document.querySelectorAll('.unmerge')[0].style.display = 'none' | 289 document.querySelectorAll('.unmerge')[0].style.display = 'none' |
| 271 } | 290 } |
| 272 | 291 |
| 273 function SetupView() { | 292 function SetupView() { |
| 293 // Allow override cookies with Get parameters. |
| 294 var getMerged = readGetParameter('merged'); |
| 295 if (getMerged === 'true') { |
| 296 createCookie('merged', 'true', 30); |
| 297 } |
| 298 if (getMerged === 'false') { |
| 299 eraseCookie('merged'); |
| 300 } |
| 301 var getCollapsed = readGetParameter('collapsed'); |
| 302 if (getCollapsed === 'true') { |
| 303 createCookie('collapsed', 'true', 30); |
| 304 } |
| 305 if (getCollapsed === 'false') { |
| 306 eraseCookie('collapsed'); |
| 307 } |
| 308 |
| 274 if (readCookie('merged')) { | 309 if (readCookie('merged')) { |
| 275 merge(); | 310 merge(); |
| 276 } else if (readCookie('collapsed')) { | 311 } else if (readCookie('collapsed')) { |
| 277 collapse(); | 312 collapse(); |
| 278 } | 313 } |
| 279 } | 314 } |
| 280 | 315 |
| 281 document.addEventListener("DOMContentLoaded", SetupView, false); | 316 document.addEventListener("DOMContentLoaded", SetupView, false); |
| 282 | 317 |
| 283 // ]]> | 318 // ]]> |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 {% block footer %} | 505 {% block footer %} |
| 471 <div class="footer" style="clear:both"> | 506 <div class="footer" style="clear:both"> |
| 472 <hr/> | 507 <hr/> |
| 473 [ <a class='collapse' href='#' OnClick='collapse(); return false;'>collapse</a
> | 508 [ <a class='collapse' href='#' OnClick='collapse(); return false;'>collapse</a
> |
| 474 <a class='uncollapse' href='#' OnClick='uncollapse(); return false;'>un-collap
se</a> | 509 <a class='uncollapse' href='#' OnClick='uncollapse(); return false;'>un-collap
se</a> |
| 475 <a class='merge' href="#" OnClick="merge(); return false;">merge</a> | 510 <a class='merge' href="#" OnClick="merge(); return false;">merge</a> |
| 476 <a class='unmerge' style='display: none' href="#" OnClick="unmerge(); return f
alse;">un-merge</a> ] | 511 <a class='unmerge' style='display: none' href="#" OnClick="unmerge(); return f
alse;">un-merge</a> ] |
| 477 <p>Debug info: {{ debuginfo }}</p> | 512 <p>Debug info: {{ debuginfo }}</p> |
| 478 </div> | 513 </div> |
| 479 {% endblock %} | 514 {% endblock %} |
| OLD | NEW |