| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 function toggleHelpBox() { | 5 function toggleHelpBox() { |
| 6 var helpBoxOuter = document.getElementById('help-box-outer'); | 6 var helpBoxOuter = document.getElementById('help-box-outer'); |
| 7 helpBoxOuter.classList.toggle('hidden'); | 7 helpBoxOuter.classList.toggle('hidden'); |
| 8 var moreLessButton = document.getElementById('more-less-button'); | 8 var moreLessButton = document.getElementById('more-less-button'); |
| 9 if (helpBoxOuter.classList.contains('hidden')) { | 9 if (helpBoxOuter.classList.contains('hidden')) { |
| 10 moreLessButton.innerText = moreLessButton.moreText; | 10 moreLessButton.innerText = moreLessButton.moreText; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 return; | 46 return; |
| 47 } | 47 } |
| 48 | 48 |
| 49 classList.add(newClass); | 49 classList.add(newClass); |
| 50 if (oldClass !== undefined) | 50 if (oldClass !== undefined) |
| 51 classList.remove(oldClass); | 51 classList.remove(oldClass); |
| 52 | 52 |
| 53 classList['last_icon_class'] = newClass; | 53 classList['last_icon_class'] = newClass; |
| 54 } | 54 } |
| 55 | 55 |
| 56 // Does a search using |baseSearchUrl| and the text in the search box. |
| 57 function search(baseSearchUrl) { |
| 58 var searchTextNode = document.getElementById('search-box'); |
| 59 document.location = baseSearchUrl + searchTextNode.value; |
| 60 return false; |
| 61 } |
| 62 |
| 56 <if expr="is_macosx or is_ios or is_linux or is_android"> | 63 <if expr="is_macosx or is_ios or is_linux or is_android"> |
| 57 // Re-orders buttons. Used on Mac, Linux, and Android, where reload should go | 64 // Re-orders buttons. Used on Mac, Linux, and Android, where reload should go |
| 58 // on the right. | 65 // on the right. |
| 59 function swapButtonOrder() { | 66 function swapButtonOrder() { |
| 60 reloadButton = document.getElementById('reload-button'); | 67 reloadButton = document.getElementById('reload-button'); |
| 61 moreLessButton = document.getElementById('more-less-button'); | 68 moreLessButton = document.getElementById('more-less-button'); |
| 62 reloadButton.parentNode.insertBefore(moreLessButton, reloadButton); | 69 reloadButton.parentNode.insertBefore(moreLessButton, reloadButton); |
| 63 } | 70 } |
| 64 document.addEventListener("DOMContentLoaded", swapButtonOrder); | 71 document.addEventListener("DOMContentLoaded", swapButtonOrder); |
| 65 </if> | 72 </if> |
| OLD | NEW |