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

Side by Side Diff: lib/typoRules.js

Issue 8948027: Ported changes from Adblock Plus integration back into URL Fixer (Closed)
Patch Set: Created Jan. 14, 2013, 10:03 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/typoNetError.js ('k') | lib/typoSurvey.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of the URL Fixer, 2 * This file is part of the URL Fixer,
3 * Copyright (C) 2006-2012 Eyeo GmbH 3 * Copyright (C) 2006-2012 Eyeo GmbH
4 * 4 *
5 * URL Fixer is free software: you can redistribute it and/or modify 5 * URL Fixer is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * URL Fixer is distributed in the hope that it will be useful, 9 * URL Fixer is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 catch (e) 87 catch (e)
88 { 88 {
89 if (e.result != Cr.NS_ERROR_FILE_NOT_FOUND) 89 if (e.result != Cr.NS_ERROR_FILE_NOT_FOUND)
90 Cu.reportError(e); 90 Cu.reportError(e);
91 callback(false); 91 callback(false);
92 } 92 }
93 } 93 }
94 94
95 function getRuleFile() 95 function getRuleFile()
96 { 96 {
97 let result = FileUtils.getFile("ProfD", ["url-fixer-rules.json"]); 97 let result = FileUtils.getFile("ProfD", [require("info").addonName + "-rules.j son"]);
98 98
99 getRuleFile = function() result; 99 getRuleFile = function() result;
100 return getRuleFile(); 100 return getRuleFile();
101 } 101 }
102 102
103 function addCustomRules() 103 function addCustomRules()
104 { 104 {
105 for (let domain in Prefs.whitelist) 105 for (let domain in Prefs.whitelist)
106 onWhitelistEntryAdded(domain); 106 onWhitelistEntryAdded(domain);
107 } 107 }
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 bestSuggestionDistance = distance; 413 bestSuggestionDistance = distance;
414 bestSuggestionMatched = matchedLen; 414 bestSuggestionMatched = matchedLen;
415 bestSuggestionPriority = priority; 415 bestSuggestionPriority = priority;
416 } 416 }
417 } 417 }
418 if (bestSuggestion) 418 if (bestSuggestion)
419 return input.substr(0, input.length - bestSuggestionMatched) + bestSuggestio n; 419 return input.substr(0, input.length - bestSuggestionMatched) + bestSuggestio n;
420 else 420 else
421 return input; 421 return input;
422 } 422 }
OLDNEW
« no previous file with comments | « lib/typoNetError.js ('k') | lib/typoSurvey.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld