# HG changeset patch # User Atul Varma # Date 1277575475 25200 # Node ID 2ba086ce137db609bafc9503ee63319f8e4dae18 # Parent 3930e19060b76880dc430d3e791ea8c1defe53ca Added interests section w/ lots of checkboxes. diff -r 3930e19060b7 -r 2ba086ce137d static-files/index.html --- a/static-files/index.html Sat Jun 26 10:32:59 2010 -0700 +++ b/static-files/index.html Sat Jun 26 11:04:35 2010 -0700 @@ -391,7 +391,53 @@

If you use bugzilla.mozilla.org, enter your Bugzilla email here.

- + +
+

Your Interests

+ +

Check everything you're interested in.

+
+
Great success! Your information has been updated.
diff -r 3930e19060b7 -r 2ba086ce137d static-files/index.js --- a/static-files/index.js Sat Jun 26 10:32:59 2010 -0700 +++ b/static-files/index.js Sat Jun 26 11:04:35 2010 -0700 @@ -166,11 +166,18 @@ var userInfo = Attendees.value[Config.value.userID]; if (!userInfo) userInfo = {}; + if (!(userInfo.interests && jQuery.isArray(userInfo.interests))) + userInfo.interests = []; $(".usr").each( function() { var prop = this.id.match(/usr_(.+)/)[1]; $(this).val(userInfo[prop] || ""); }); + $("#usr_interests input").each( + function() { + var label = $(this.parentNode).text().trim(); + this.checked = (userInfo.interests.indexOf(label) != -1); + }); } Attendees.observers.push(fillUserInfo); @@ -213,6 +220,14 @@ contents[prop] = this.value; }); + contents.interests = []; + + $("#usr_interests input").each( + function() { + if (this.checked) + contents.interests.push($(this.parentNode).text().trim()); + }); + jQuery.postJSON( "api/profile", {token: Config.value.token,