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 goog.provide('cvox.ChromeVoxEditableContentEditable'); | 5 goog.provide('cvox.ChromeVoxEditableContentEditable'); |
6 goog.provide('cvox.ChromeVoxEditableHTMLInput'); | 6 goog.provide('cvox.ChromeVoxEditableHTMLInput'); |
7 goog.provide('cvox.ChromeVoxEditableTextArea'); | 7 goog.provide('cvox.ChromeVoxEditableTextArea'); |
8 goog.provide('cvox.ChromeVoxEditableTextBase'); | 8 goog.provide('cvox.ChromeVoxEditableTextBase'); |
9 goog.provide('cvox.TextChangeEvent'); | 9 goog.provide('cvox.TextChangeEvent'); |
10 goog.provide('cvox.TextHandlerInterface'); | 10 goog.provide('cvox.TextHandlerInterface'); |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 * user action. | 337 * user action. |
338 * @param {Object=} opt_personality Personality used to speak text. | 338 * @param {Object=} opt_personality Personality used to speak text. |
339 */ | 339 */ |
340 cvox.ChromeVoxEditableTextBase.prototype.speak = | 340 cvox.ChromeVoxEditableTextBase.prototype.speak = |
341 function(str, opt_triggeredByUser, opt_personality) { | 341 function(str, opt_triggeredByUser, opt_personality) { |
342 // If there is a node associated with the editable text object, | 342 // If there is a node associated with the editable text object, |
343 // make sure that node has focus before speaking it. | 343 // make sure that node has focus before speaking it. |
344 if (this.node && (document.activeElement != this.node)) { | 344 if (this.node && (document.activeElement != this.node)) { |
345 return; | 345 return; |
346 } | 346 } |
347 var queueMode = cvox.AbstractTts.QUEUE_MODE_QUEUE; | 347 var queueMode = cvox.QueueMode.QUEUE; |
348 if (opt_triggeredByUser === true) { | 348 if (opt_triggeredByUser === true) { |
349 queueMode = cvox.AbstractTts.QUEUE_MODE_FLUSH; | 349 queueMode = cvox.QueueMode.FLUSH; |
350 } | 350 } |
351 this.tts.speak(str, queueMode, opt_personality || {}); | 351 this.tts.speak(str, queueMode, opt_personality || {}); |
352 }; | 352 }; |
353 | 353 |
354 | 354 |
355 /** | 355 /** |
356 * Update the state of the text and selection and describe any changes as | 356 * Update the state of the text and selection and describe any changes as |
357 * appropriate. | 357 * appropriate. |
358 * | 358 * |
359 * @param {cvox.TextChangeEvent} evt The text change event. | 359 * @param {cvox.TextChangeEvent} evt The text change event. |
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1322 // but there is still content after the new line (like the example | 1322 // but there is still content after the new line (like the example |
1323 // above after "Title"). In these cases, we "pretend" we're the | 1323 // above after "Title"). In these cases, we "pretend" we're the |
1324 // last character so we speak "blank". | 1324 // last character so we speak "blank". |
1325 return false; | 1325 return false; |
1326 } | 1326 } |
1327 | 1327 |
1328 // Otherwise, we should never speak "blank" no matter what (even if | 1328 // Otherwise, we should never speak "blank" no matter what (even if |
1329 // we're at the end of a content editable). | 1329 // we're at the end of a content editable). |
1330 return true; | 1330 return true; |
1331 }; | 1331 }; |
OLD | NEW |