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

Unified Diff: chrome/content/ui/sendReport.js

Issue 8937025: Encourage user to set email in issue reporter (Closed)
Patch Set: Encourage user to set email in issue reporter Created Nov. 23, 2012, 6:31 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/content/ui/sendReport.xul » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/content/ui/sendReport.js
===================================================================
--- a/chrome/content/ui/sendReport.js
+++ b/chrome/content/ui/sendReport.js
@@ -1323,6 +1323,8 @@
function initScreenshotPage()
{
+ document.documentElement.canAdvance = true;
+
E("progressBar").activeItem = E("screenshotHeader");
}
@@ -1330,6 +1332,8 @@
{
E("progressBar").activeItem = E("commentPageHeader");
+ updateEmail();
+
screenshotDataSource.exportData();
updateDataField();
}
@@ -1379,8 +1383,24 @@
function updateEmail()
{
removeReportElement("email");
- appendElement(reportData.documentElement, "email", null, E("email").value.replace(/\@/g, " at ").replace(/\./g, " dot "));
+
+ let anonymous = E("anonymousCheckbox").checked;
+
+ let value = E("email").value;
+
+ // required for persist to work on textbox, see: https://bugzilla.mozilla.org/show_bug.cgi?id=111486
+ E("email").setAttribute("value", value);
+
+ E("email").disabled = anonymous;
+ E("emailLabel").disabled = anonymous;
+ E("anonymityWarning").setAttribute("visible", anonymous);
+
+ if (!anonymous)
+ appendElement(reportData.documentElement, "email", null, value);
+
updateDataField();
+
+ document.documentElement.canAdvance = anonymous || /\S/.test(value);
}
function updateExtensions(attach)
« no previous file with comments | « no previous file | chrome/content/ui/sendReport.xul » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld