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

Unified Diff: lib/typoFixer.js

Issue 8450003: Reimplemented whitelist handling (Closed)
Patch Set: Created Sept. 25, 2012, 3:48 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
« lib/rules.js ('K') | « lib/rules.js ('k') | lib/updateRules.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
@@ -242,21 +242,20 @@ function correctURL(window, value)
}
},
{
label: no,
accessKey: null,
callback: function()
{
// No: Add to list of corrections (ignore)
- if (/^www\./.test(value))
- {
- value = value.substr(4);
- }
- Prefs.whitelist[value] = value;
+ let {onWhitelistEntryAdded} = require("rules");
+ let entry = oldDomain.replace(/^www\./, "");
+ Prefs.whitelist[entry] = true;
+ onWhitelistEntryAdded(entry);
Prefs.whitelist = JSON.parse(JSON.stringify(Prefs.whitelist));
require("appIntegration").loadURI(value);
processFalsePositive(oldDomain, domain);
}
}
];
require("appIntegration").openInfobar(window, "url-fixer-infobar-askafter", message, buttons, 1);
« lib/rules.js ('K') | « lib/rules.js ('k') | lib/updateRules.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld