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 Holds information about a braille table. | 6 * @fileoverview Holds information about a braille table. |
7 */ | 7 */ |
8 | 8 |
9 goog.provide('cvox.BrailleTable'); | 9 goog.provide('cvox.BrailleTable'); |
10 | 10 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 }; | 69 }; |
70 | 70 |
71 | 71 |
72 /** | 72 /** |
73 * Finds a table in a list of tables by id. | 73 * Finds a table in a list of tables by id. |
74 * @param {!Array<cvox.BrailleTable.Table>} tables tables to search in. | 74 * @param {!Array<cvox.BrailleTable.Table>} tables tables to search in. |
75 * @param {string} id id of table to find. | 75 * @param {string} id id of table to find. |
76 * @return {cvox.BrailleTable.Table} The found table, or null if not found. | 76 * @return {cvox.BrailleTable.Table} The found table, or null if not found. |
77 */ | 77 */ |
78 cvox.BrailleTable.forId = function(tables, id) { | 78 cvox.BrailleTable.forId = function(tables, id) { |
79 return tables.filter(function(table) { return table.id === id })[0] || null; | 79 return tables.filter(function(table) { return table.id === id; })[0] || null; |
80 }; | 80 }; |
81 | 81 |
82 | 82 |
83 /** | 83 /** |
84 * Returns an uncontracted braille table corresponding to another, possibly | 84 * Returns an uncontracted braille table corresponding to another, possibly |
85 * contracted, table. If {@code table} is the lowest-grade table for its | 85 * contracted, table. If {@code table} is the lowest-grade table for its |
86 * locale and dot count, {@code table} itself is returned. | 86 * locale and dot count, {@code table} itself is returned. |
87 * @param {!Array<cvox.BrailleTable.Table>} tables tables to search in. | 87 * @param {!Array<cvox.BrailleTable.Table>} tables tables to search in. |
88 * @param {!cvox.BrailleTable.Table} table Table to match. | 88 * @param {!cvox.BrailleTable.Table} table Table to match. |
89 * @return {!cvox.BrailleTable.Table} Corresponding uncontracted table, | 89 * @return {!cvox.BrailleTable.Table} Corresponding uncontracted table, |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 return Msgs.getMsg('braille_table_name_with_grade', | 123 return Msgs.getMsg('braille_table_name_with_grade', |
124 [localeName, table.grade]); | 124 [localeName, table.grade]); |
125 } else if (!table.grade && table.variant) { | 125 } else if (!table.grade && table.variant) { |
126 return Msgs.getMsg('braille_table_name_with_variant', | 126 return Msgs.getMsg('braille_table_name_with_variant', |
127 [localeName, table.variant]); | 127 [localeName, table.variant]); |
128 } else { | 128 } else { |
129 return Msgs.getMsg('braille_table_name_with_variant_and_grade', | 129 return Msgs.getMsg('braille_table_name_with_variant_and_grade', |
130 [localeName, table.variant, table.grade]); | 130 [localeName, table.variant, table.grade]); |
131 } | 131 } |
132 }; | 132 }; |
OLD | NEW |