| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 * @fileoverview The cvox.NodeState typedef. | 6 * @fileoverview The cvox.NodeState typedef. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 goog.provide('cvox.NodeState'); | 9 goog.provide('cvox.NodeState'); |
| 10 goog.provide('cvox.NodeStateUtil'); | 10 goog.provide('cvox.NodeStateUtil'); |
| 11 | 11 |
| 12 /** | 12 /** |
| 13 * Holds the state of a node. It is an Array or Arrays of strings and numbers. | 13 * Holds the state of a node. It is an Array or Arrays of strings and numbers. |
| 14 * Each sub array is in the format: | 14 * Each sub array is in the format: |
| 15 * [state, opt_arg, opt_arg, ...]. These sub arrays map directly to a | 15 * [state, opt_arg, opt_arg, ...]. These sub arrays map directly to a |
| 16 * cvox.ChromeVox.getMsg() call. For example [list_position, 3, 5] maps to | 16 * cvox.ChromeVox.getMsg() call. For example [list_position, 3, 5] maps to |
| 17 * getMsg('list_position', [3, 5]); | 17 * getMsg('list_position', [3, 5]); |
| 18 * | 18 * |
| 19 * @typedef {!Array.<!Array.<string|number>>} | 19 * @typedef {!Array<!Array<string|number>>} |
| 20 */ | 20 */ |
| 21 cvox.NodeState; | 21 cvox.NodeState; |
| 22 | 22 |
| 23 /** | 23 /** |
| 24 * Returns a localized, readable string with the NodeState. | 24 * Returns a localized, readable string with the NodeState. |
| 25 * | 25 * |
| 26 * NOTE(deboer): Once AriaUtil and DomUtil are using NodeState exclusively, this | 26 * NOTE(deboer): Once AriaUtil and DomUtil are using NodeState exclusively, this |
| 27 * function can be moved into DescriptionUtil, removing the cvox.ChromeVox | 27 * function can be moved into DescriptionUtil, removing the cvox.ChromeVox |
| 28 * dependency here. | 28 * dependency here. |
| 29 * | 29 * |
| (...skipping 11 matching lines...) Expand all Loading... |
| 41 return cvox.ChromeVox.msgs.getNumber(a); | 41 return cvox.ChromeVox.msgs.getNumber(a); |
| 42 } | 42 } |
| 43 return a; | 43 return a; |
| 44 }); | 44 }); |
| 45 return cvox.ChromeVox.msgs.getMsg(/** @type {string} */ (s[0]), args); | 45 return cvox.ChromeVox.msgs.getMsg(/** @type {string} */ (s[0]), args); |
| 46 }).join(' '); | 46 }).join(' '); |
| 47 } catch (e) { | 47 } catch (e) { |
| 48 throw new Error('error: ' + e + ' state: ' + state); | 48 throw new Error('error: ' + e + ' state: ' + state); |
| 49 } | 49 } |
| 50 }; | 50 }; |
| OLD | NEW |