From c3a681abd13ea94a7ec8cb454c8a347a040cf7bd Mon Sep 17 00:00:00 2001 From: Peter Xiao Date: Mon, 12 Aug 2013 16:15:09 -0700 Subject: [PATCH] Less aggressive filter for speaking tokens, add some docs. --- lib/ace/ext/chromevox.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/ace/ext/chromevox.js b/lib/ace/ext/chromevox.js index 1f51530a..5ad8ba18 100644 --- a/lib/ace/ext/chromevox.js +++ b/lib/ace/ext/chromevox.js @@ -286,9 +286,9 @@ var speakLine = function(row, queue) { return; } var firstToken = tokens[0]; - /* Filter out first token and spaces. */ + /* Filter out first token. */ tokens = tokens.filter(function(token) { - return token !== firstToken && token.type !== 'text'; + return token !== firstToken; }); /* Speak first token separately to flush if queue. */ speakToken_(firstToken, queue); @@ -666,6 +666,12 @@ var initContextMenu = function() { body.addEventListener('ATCustomEvent', contextMenuHandler, true); }; +/** + * Event handler for find events. When there is a match, we want to speak the + * line we are now at. Otherwise, we want to notify the user there was no + * match + * @param {!Event} evt The event. + */ var onFindSearchbox = function(evt) { if (evt.match) { /* There is still a match! Speak the line. */ @@ -742,6 +748,7 @@ var SHORTCUTS = [ /** * Initialize the theme. + * @param {Object} editor Editor to use. */ var init = function(editor) { cvoxAce.editor = editor;