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

Unified Diff: lib/typoFixer.js

Issue 6695604965081088: Issue 2549 - Fix documentation generation for URL Fixer (Closed)
Patch Set: Created May 18, 2015, 7:46 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') | lib/typoRules.js » ('j') | 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,44 +27,44 @@ 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;
-
+
appIntegration.applyToWindow(window, correctURL);
},
removeFromWindow: function(window)
{
if (!appIntegration.isKnownWindow(window))
return;
-
+
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,17 +169,17 @@ 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 = [
{
@@ -222,11 +222,11 @@ function getInfobarTexts()
if (!stringBundle)
stringBundle = Services.strings.createBundle("chrome://" + require("info").addonName + "/locale/typo.properties?" + Math.random());
let result = [
stringBundle.GetStringFromName("urlfixer.isItCorrect"),
stringBundle.GetStringFromName("urlfixer.yes"),
stringBundle.GetStringFromName("urlfixer.no")
];
- getInfobarTexts = function() result;
+ getInfobarTexts = () => result;
return getInfobarTexts();
}
« no previous file with comments | « lib/typoAppIntegration.js ('k') | lib/typoRules.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld