OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 /** | 5 /** |
6 * @param {string} toTest The string to be tested. | 6 * @param {string} toTest The string to be tested. |
7 * @return {boolean} True if |toTest| contains only digits. Leading and trailing | 7 * @return {boolean} True if |toTest| contains only digits. Leading and trailing |
8 * whitespace is allowed. | 8 * whitespace is allowed. |
9 */ | 9 */ |
10 function isInteger(toTest) { | 10 function isInteger(toTest) { |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 var tempFrom = pageSet[i]; | 180 var tempFrom = pageSet[i]; |
181 while (i + 1 < pageSet.length && pageSet[i + 1] == pageSet[i] + 1) | 181 while (i + 1 < pageSet.length && pageSet[i + 1] == pageSet[i] + 1) |
182 ++i; | 182 ++i; |
183 var tempTo = pageSet[i]; | 183 var tempTo = pageSet[i]; |
184 pageRanges.push({'from': tempFrom, 'to': tempTo}); | 184 pageRanges.push({'from': tempFrom, 'to': tempTo}); |
185 } | 185 } |
186 return pageRanges; | 186 return pageRanges; |
187 } | 187 } |
188 | 188 |
189 /** | 189 /** |
| 190 * @param {!HTMLElement} element Element to check for visibility. |
| 191 * @return {boolean} Whether the given element is visible. |
| 192 */ |
| 193 function getIsVisible(element) { |
| 194 return !element.hidden; |
| 195 } |
| 196 |
| 197 /** |
190 * Shows or hides an element. | 198 * Shows or hides an element. |
191 * @param {Element} element Element to show or hide. | 199 * @param {!HTMLElement} element Element to show or hide. |
192 * @param {boolean} isVisible Whether the element should be visible or not. | 200 * @param {boolean} isVisible Whether the element should be visible or not. |
193 */ | 201 */ |
194 function setIsVisible(element, isVisible) { | 202 function setIsVisible(element, isVisible) { |
195 element.hidden = !isVisible; | 203 element.hidden = !isVisible; |
196 } | 204 } |
197 | 205 |
198 /** | 206 /** |
199 * @param {!Array} array Array to check for item. | 207 * @param {!Array} array Array to check for item. |
200 * @param {*} item Item to look for in array. | 208 * @param {*} item Item to look for in array. |
201 * @return {boolean} Whether the item is in the array. | 209 * @return {boolean} Whether the item is in the array. |
202 */ | 210 */ |
203 function arrayContains(array, item) { | 211 function arrayContains(array, item) { |
204 return array.indexOf(item) != -1; | 212 return array.indexOf(item) != -1; |
205 } | 213 } |
OLD | NEW |