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

Side by Side Diff: lib/survey.js

Issue 8433028: added hook function to appIntegration to handle function-overwrites from other extensions (Closed)
Patch Set: applied code review changes Created Sept. 28, 2012, 8:01 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
OLDNEW
1 /* This Source Code Form is subject to the terms of the Mozilla Public 1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file, 2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */ 3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
4 4
5 Cu.import("resource://gre/modules/Services.jsm"); 5 Cu.import("resource://gre/modules/Services.jsm");
6 6
7 let {Prefs} = require("prefs"); 7 let {Prefs} = require("prefs");
8 8
9 let surveyLang = null; 9 let surveyLang = null;
10 let surveyUrl = "http://urlfixer.org"; //"http://adblockplus.org/usersurvey/inde x.php?sid=68316"; 10 let surveyUrl = null; //"http://urlfixer.org/usersurvey/...";
11 11
12 exports.incrementCorrectionsCounter = incrementCorrectionsCounter; 12 exports.incrementCorrectionsCounter = incrementCorrectionsCounter;
13 function incrementCorrectionsCounter() 13 function incrementCorrectionsCounter()
14 { 14 {
15 // Only if survey exists
16 if (!surveyUrl)
17 return;
18
15 // Only users with 5 URL corrections 19 // Only users with 5 URL corrections
16 if (++Prefs.corrections_count == 5) 20 if (++Prefs.corrections_count == 5)
17 { 21 {
18 initSurvey(); 22 initSurvey();
19 } 23 }
20 } 24 }
21 25
22 function initSurvey() 26 function initSurvey()
23 { 27 {
24 // Don't ask after 2012-10-15 28 // Don't ask after 2012-10-15
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 request.send(null); 90 request.send(null);
87 } 91 }
88 92
89 function openSurvey() 93 function openSurvey()
90 { 94 {
91 require("appIntegration").getBrowser(Services.wm.getMostRecentWindow("navigato r:browser")).loadOneTab(surveyUrl + "&lang=" + surveyLang, { 95 require("appIntegration").getBrowser(Services.wm.getMostRecentWindow("navigato r:browser")).loadOneTab(surveyUrl + "&lang=" + surveyLang, {
92 referrerURI: Services.io.newURI("http://url.fixer/", null, null), 96 referrerURI: Services.io.newURI("http://url.fixer/", null, null),
93 inBackground: false 97 inBackground: false
94 }); 98 });
95 } 99 }
OLDNEW
« lib/appIntegration.js ('K') | « lib/rules.js ('k') | lib/typoFixer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld