Left: | ||
Right: |
OLD | NEW |
---|---|
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 Loading... | |
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; | |
1327 | |
1326 E("progressBar").activeItem = E("screenshotHeader"); | 1328 E("progressBar").activeItem = E("screenshotHeader"); |
1327 } | 1329 } |
1328 | 1330 |
1329 function initCommentPage() | 1331 function initCommentPage() |
1330 { | 1332 { |
1331 E("progressBar").activeItem = E("commentPageHeader"); | 1333 E("progressBar").activeItem = E("commentPageHeader"); |
1332 | 1334 |
1335 updateEmail(); | |
1336 | |
1333 screenshotDataSource.exportData(); | 1337 screenshotDataSource.exportData(); |
1334 updateDataField(); | 1338 updateDataField(); |
1335 } | 1339 } |
1336 | 1340 |
1337 function showDataField() | 1341 function showDataField() |
1338 { | 1342 { |
1339 E('dataDeck').selectedIndex = 1; | 1343 E('dataDeck').selectedIndex = 1; |
1340 updateDataField(); | 1344 updateDataField(); |
1341 E('data').focus(); | 1345 E('data').focus(); |
1342 } | 1346 } |
(...skipping 29 matching lines...) Expand all Loading... | |
1372 | 1376 |
1373 let value = E("comment").value; | 1377 let value = E("comment").value; |
1374 appendElement(reportData.documentElement, "comment", null, value.substr(0, 100 0)); | 1378 appendElement(reportData.documentElement, "comment", null, value.substr(0, 100 0)); |
1375 E("commentLengthWarning").setAttribute("visible", value.length > 1000); | 1379 E("commentLengthWarning").setAttribute("visible", value.length > 1000); |
1376 updateDataField(); | 1380 updateDataField(); |
1377 } | 1381 } |
1378 | 1382 |
1379 function updateEmail() | 1383 function updateEmail() |
1380 { | 1384 { |
1381 removeReportElement("email"); | 1385 removeReportElement("email"); |
1382 appendElement(reportData.documentElement, "email", null, E("email").value.repl ace(/\@/g, " at ").replace(/\./g, " dot ")); | 1386 |
1387 let anonymous = E("anonymousCheckbox").checked; | |
1388 | |
1389 if (anonymous) | |
1390 E("email").value = ""; | |
Wladimir Palant
2012/11/22 15:08:21
Please don't do that, disabling it is sufficient -
Andrey Novikov
2012/11/23 06:32:16
It will be not obvious that nothing will be sent i
| |
1391 | |
1392 let value = E("email").value; | |
1393 E("email").setAttribute("value", value); // required for persist to work on te xtbox, see: https://bugzilla.mozilla.org/show_bug.cgi?id=111486 | |
Wladimir Palant
2012/11/22 15:08:21
Please put that comment on the line(s) before - we
Andrey Novikov
2012/11/23 06:32:16
Done.
| |
1394 | |
1395 E("email").disabled = anonymous; | |
1396 E("emailLabel").disabled = anonymous; | |
1397 E("anonymityWarning").setAttribute("visible", anonymous); | |
1398 | |
1399 if (!anonymous) | |
1400 appendElement(reportData.documentElement, "email", null, value); | |
1401 | |
1383 updateDataField(); | 1402 updateDataField(); |
1403 | |
1404 document.documentElement.canAdvance = anonymous || /\S/.test(value); | |
1384 } | 1405 } |
1385 | 1406 |
1386 function updateExtensions(attach) | 1407 function updateExtensions(attach) |
1387 { | 1408 { |
1388 extensionsDataSource.exportData(attach); | 1409 extensionsDataSource.exportData(attach); |
1389 updateDataField(); | 1410 updateDataField(); |
1390 } | 1411 } |
1391 | 1412 |
1392 function initSendPage() | 1413 function initSendPage() |
1393 { | 1414 { |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1539 | 1560 |
1540 function censorURL(url) | 1561 function censorURL(url) |
1541 { | 1562 { |
1542 return url.replace(/([?;&\/#][^?;&\/#]+?=)[^?;&\/#]+/g, "$1*"); | 1563 return url.replace(/([?;&\/#][^?;&\/#]+?=)[^?;&\/#]+/g, "$1*"); |
1543 } | 1564 } |
1544 | 1565 |
1545 function encodeHTML(str) | 1566 function encodeHTML(str) |
1546 { | 1567 { |
1547 return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"). replace(/"/g, """); | 1568 return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"). replace(/"/g, """); |
1548 } | 1569 } |
OLD | NEW |