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

Delta Between Two Patch Sets: lib/survey.js

Issue 8382011: Applied changes from emailed code review (Closed)
Left Patch Set: Created Sept. 28, 2012, 11:09 a.m.
Right Patch Set: Created Sept. 28, 2012, 1:40 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « lib/rules.js ('k') | lib/typedItCollector.js » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 = null; //"http://urlfixer.org/usersurvey/..."; 10 let surveyUrl = null; //"http://urlfixer.org/usersurvey/...";
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 document.getElementById("mainPopupSet").appendChild(panel); 68 document.getElementById("mainPopupSet").appendChild(panel);
69 document.getElementById("url-fixer-icon").setAttribute("src", require("info" ).addonRoot + "icon64.png"); 69 document.getElementById("url-fixer-icon").setAttribute("src", require("info" ).addonRoot + "icon64.png");
70 document.getElementById("url-fixer-accept-button").addEventListener("command ", function() 70 document.getElementById("url-fixer-accept-button").addEventListener("command ", function()
71 { 71 {
72 openSurvey(); 72 openSurvey();
73 panel.hidePopup(); 73 panel.hidePopup();
74 }); 74 });
75 document.getElementById("url-fixer-cancel-button").addEventListener("command ", function() 75 document.getElementById("url-fixer-cancel-button").addEventListener("command ", function()
76 { 76 {
77 panel.hidePopup(); 77 panel.hidePopup();
78 }); 78 });
Wladimir Palant 2012/09/28 11:29:33 Forgot to mention in the previous review: you shou
79 panel.addEventListener("popuphidden", function()
80 {
81 panel.parentNode.removeChild(panel);
82 style.parentNode.removeChild(style);
83 });
79 84
80 let anchor = document.getElementById("identity-box"); 85 let anchor = document.getElementById("identity-box");
81 panel.openPopup(anchor, "after_start", 0, 0, false, true); 86 panel.openPopup(anchor, "after_start", 0, 0, false, true);
82 }, false); 87 }, false);
83 request.send(null); 88 request.send(null);
84 } 89 }
85 90
86 function openSurvey() 91 function openSurvey()
87 { 92 {
88 let window = Services.wm.getMostRecentWindow("navigator:browser"); 93 let window = Services.wm.getMostRecentWindow("navigator:browser");
89 if (window) 94 if (window)
90 { 95 {
91 let browser = require("appIntegration").getBrowser(window); 96 let browser = require("appIntegration").getBrowser(window);
92 browser.loadOneTab(surveyUrl + "&lang=" + surveyLang, { 97 browser.loadOneTab(surveyUrl + "&lang=" + surveyLang, {
93 referrerURI: Services.io.newURI("http://url.fixer/", null, null), 98 referrerURI: Services.io.newURI("http://url.fixer/", null, null),
94 inBackground: false 99 inBackground: false
95 }); 100 });
96 } 101 }
97 } 102 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld