changeset 37:2ba086ce137d

Added interests section w/ lots of checkboxes.
author Atul Varma <avarma@mozilla.com>
date Sat, 26 Jun 2010 11:04:35 -0700
parents 3930e19060b7
children de4d2ba9eaae
files static-files/index.html static-files/index.js
diffstat 2 files changed, 62 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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 @@
       <p class="formHint">If you use 
       <code>bugzilla.mozilla.org</code>, enter your Bugzilla email here.</p>
     </div>
-   
+
+    <div class="ctrlHolder">
+      <p class="label">Your Interests</p>
+      <ul class="blockLabels" id="usr_interests">
+        <li><label for=""><input id="" name="" type="checkbox"> Firefox</label></li>
+        <li><label for=""><input id="" name=""
+        type="checkbox"> User Experience</label></li>
+        <li><label for=""><input id="" name=""
+        type="checkbox"> Platform (Gecko)</label></li>
+        <li><label for=""><input id="" name="" type="checkbox">
+        Platform (Web)</label></li>
+        <li><label for=""><input id="" name="" type="checkbox">
+        Messaging</label></li>
+      <li><label for=""><input id="" name="" type="checkbox">
+      Mobile</label></li>
+      <li><label for=""><input id="" name="" type="checkbox">
+      IT</label></li>
+      <li><label for=""><input id="" name="" type="checkbox">
+      Release Engineering</label></li>
+      <li><label for=""><input id="" name="" type="checkbox">
+      Quality Assurance</label></li>
+      <li><label for=""><input id="" name="" type="checkbox">
+      Automation and Tools</label></li>
+      <li><label for=""><input id="" name="" type="checkbox">
+      Security</label></li>
+      <li><label for=""><input id="" name="" type="checkbox">
+      Engagement</label></li>
+      <li><label for=""><input id="" name="" type="checkbox">
+      Support</label></li>
+      <li><label for=""><input id="" name="" type="checkbox">
+      Metrics</label></li>
+      <li><label for=""><input id="" name="" type="checkbox">
+      Evangelism</label></li>
+      <li><label for=""><input id="" name="" type="checkbox">
+      Labs</label></li>
+      <li><label for=""><input id="" name="" type="checkbox">
+      Developer Tools</label></li>
+      <li><label for=""><input id="" name="" type="checkbox">
+      Add-ons</label></li>
+      <li><label for=""><input id="" name="" type="checkbox">
+      Web Development</label></li>
+      <li><label for=""><input id="" name="" type="checkbox">
+      Localization</label></li>
+      </ul>
+      <p class="formHint">Check everything you're interested in.</p>
+    </div>
+
     <div class="success">
     Great success! Your information has been updated.
     </div>
--- 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,