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

Delta Between Two Patch Sets: chrome/content/ui/sendReport.js

Issue 8937025: Encourage user to set email in issue reporter (Closed)
Left Patch Set: Created Nov. 22, 2012, 1:54 p.m.
Right Patch Set: Encourage user to set email in issue reporter Created Nov. 23, 2012, 6:31 a.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 | « no previous file | chrome/content/ui/sendReport.xul » ('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 /* 1 /*
2 * This file is part of the Adblock Plus, 2 * This file is part of the Adblock Plus,
3 * Copyright (C) 2006-2012 Eyeo GmbH 3 * Copyright (C) 2006-2012 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus 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 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus 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 1305 matching lines...) Expand 10 before | Expand all | Expand 10 after
1316 textElement.abpInitialized = true; 1316 textElement.abpInitialized = true;
1317 } 1317 }
1318 1318
1319 function updateTypeWarningOverride() 1319 function updateTypeWarningOverride()
1320 { 1320 {
1321 document.documentElement.canAdvance = E("typeWarningOverride").checked; 1321 document.documentElement.canAdvance = E("typeWarningOverride").checked;
1322 } 1322 }
1323 1323
1324 function initScreenshotPage() 1324 function initScreenshotPage()
1325 { 1325 {
1326 document.documentElement.canAdvance = true; 1326 document.documentElement.canAdvance = true;
Wladimir Palant 2012/11/22 14:16:29 I am mostly sure that canAdvance = true is set aut
Andrey Novikov 2012/11/22 14:44:15 It stays disabled in my case when I press Back on
1327 1327
1328 E("progressBar").activeItem = E("screenshotHeader"); 1328 E("progressBar").activeItem = E("screenshotHeader");
1329 } 1329 }
1330 1330
1331 function initCommentPage() 1331 function initCommentPage()
1332 { 1332 {
1333 document.documentElement.canAdvance = false;
1334
1335 E("progressBar").activeItem = E("commentPageHeader"); 1333 E("progressBar").activeItem = E("commentPageHeader");
1336 1334
1337 updateEmail(); 1335 updateEmail();
Wladimir Palant 2012/11/22 14:16:29 This will already set the canAdvance property, I d
Andrey Novikov 2012/11/22 14:44:15 Done.
1338 1336
1339 screenshotDataSource.exportData(); 1337 screenshotDataSource.exportData();
1340 updateDataField(); 1338 updateDataField();
1341 } 1339 }
1342 1340
1343 function showDataField() 1341 function showDataField()
1344 { 1342 {
1345 E('dataDeck').selectedIndex = 1; 1343 E('dataDeck').selectedIndex = 1;
1346 updateDataField(); 1344 updateDataField();
1347 E('data').focus(); 1345 E('data').focus();
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1379 let value = E("comment").value; 1377 let value = E("comment").value;
1380 appendElement(reportData.documentElement, "comment", null, value.substr(0, 100 0)); 1378 appendElement(reportData.documentElement, "comment", null, value.substr(0, 100 0));
1381 E("commentLengthWarning").setAttribute("visible", value.length > 1000); 1379 E("commentLengthWarning").setAttribute("visible", value.length > 1000);
1382 updateDataField(); 1380 updateDataField();
1383 } 1381 }
1384 1382
1385 function updateEmail() 1383 function updateEmail()
1386 { 1384 {
1387 removeReportElement("email"); 1385 removeReportElement("email");
1388 1386
1387 let anonymous = E("anonymousCheckbox").checked;
1388
1389 let value = E("email").value; 1389 let value = E("email").value;
1390 E("email").setAttribute("value", value); // https://bugzilla.mozilla.org/show_ bug.cgi?id=111486 1390
Wladimir Palant 2012/11/22 14:16:29 Please add a proper comment - the bug link is addi
Andrey Novikov 2012/11/22 14:44:15 Done.
1391 appendElement(reportData.documentElement, "email", null, value); 1391 // required for persist to work on textbox, see: https://bugzilla.mozilla.org/ show_bug.cgi?id=111486
1392 updateDataField(); 1392 E("email").setAttribute("value", value);
1393 1393
1394 document.documentElement.canAdvance = /\S/.test(value);
1395 }
1396
1397 function updateAnonymity(anonymous)
1398 {
1399 if (anonymous)
1400 {
1401 E("email").value = "";
1402 updateEmail();
1403 }
1404 E("email").disabled = anonymous; 1394 E("email").disabled = anonymous;
1405 E("emailLabel").disabled = anonymous; 1395 E("emailLabel").disabled = anonymous;
Wladimir Palant 2012/11/22 14:16:29 I don't think we ever disable labels.
Andrey Novikov 2012/11/22 14:44:15 It looks much more user friendly in UI, have a try
1406 E("anonymityWarning").setAttribute("visible", anonymous); 1396 E("anonymityWarning").setAttribute("visible", anonymous);
1407 1397
1408 document.documentElement.canAdvance = anonymous; 1398 if (!anonymous)
1399 appendElement(reportData.documentElement, "email", null, value);
1400
1401 updateDataField();
1402
1403 document.documentElement.canAdvance = anonymous || /\S/.test(value);
1409 } 1404 }
Wladimir Palant 2012/11/22 14:16:29 The interaction of these two functions is pretty c
Andrey Novikov 2012/11/22 14:44:15 It sends empty value in that case. Redesigned it.
1410 1405
1411 function updateExtensions(attach) 1406 function updateExtensions(attach)
1412 { 1407 {
1413 extensionsDataSource.exportData(attach); 1408 extensionsDataSource.exportData(attach);
1414 updateDataField(); 1409 updateDataField();
1415 } 1410 }
1416 1411
1417 function initSendPage() 1412 function initSendPage()
1418 { 1413 {
1419 E("progressBar").activeItem = E("sendPageHeader"); 1414 E("progressBar").activeItem = E("sendPageHeader");
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1564 1559
1565 function censorURL(url) 1560 function censorURL(url)
1566 { 1561 {
1567 return url.replace(/([?;&\/#][^?;&\/#]+?=)[^?;&\/#]+/g, "$1*"); 1562 return url.replace(/([?;&\/#][^?;&\/#]+?=)[^?;&\/#]+/g, "$1*");
1568 } 1563 }
1569 1564
1570 function encodeHTML(str) 1565 function encodeHTML(str)
1571 { 1566 {
1572 return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"). replace(/"/g, "&quot;"); 1567 return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"). replace(/"/g, "&quot;");
1573 } 1568 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld