Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/typoFixer.js

Issue 9276041: Fixed: bogus access keys in typo correction message (Closed)
Patch Set: Created Jan. 29, 2013, 2:32 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/typoAppIntegration.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/typoFixer.js
===================================================================
--- a/lib/typoFixer.js
+++ b/lib/typoFixer.js
@@ -27,47 +27,47 @@ let netError = require("typoNetError");
let typoWindowObserver = null;
exports.attachWindowObserver = attachWindowObserver;
function attachWindowObserver()
{
if (typoWindowObserver)
return;
-
+
// Attach our handlers to all browser windows
typoWindowObserver = new WindowObserver(
{
applyToWindow: function(window)
{
if (!appIntegration.isKnownWindow(window))
return;
-
+
netError.applyToWindow(window);
appIntegration.applyToWindow(window, correctURL);
},
removeFromWindow: function(window)
{
if (!appIntegration.isKnownWindow(window))
return;
-
+
netError.removeFromWindow(window);
appIntegration.removeFromWindow(window);
}
});
}
attachWindowObserver();
exports.detachWindowObserver = detachWindowObserver;
function detachWindowObserver()
{
if (!typoWindowObserver)
return;
-
+
// Detach our handlers from all browser windows
typoWindowObserver.shutdown();
typoWindowObserver = null;
}
function parseURL(url)
{
if (/^\s*((?:\w+:)?\/*(?:[^\/#]*@)?)([^\/:#]*)/.test(url))
@@ -169,35 +169,35 @@ function correctURL(window, value)
suffix += anchor;
}
}
}
if (!hasCorrection)
return null;
-
+
if (!appIntegration.isTypoCorrectionEnabled(window, prefix, domain, suffix))
return null;
// Show infobar to inform and ask about correction
let [message, yes, no] = getInfobarTexts();
message = message.replace(/\?1\?/g, prefix+domain);
let buttons = [
{
label: yes,
- accessKey: null,
+ accessKey: "",
callback: function()
{
// Yes: Do nothing
}
},
{
label: no,
- accessKey: null,
+ accessKey: "",
callback: function()
{
// No: Add to list of corrections (ignore)
let entry = oldDomain.replace(/^www\./, "");
Prefs.whitelist[entry] = true;
onWhitelistEntryAdded(entry);
Prefs.whitelist = JSON.parse(JSON.stringify(Prefs.whitelist));
« no previous file with comments | « lib/typoAppIntegration.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld