Add new account center and account recovery frontends
[blerg.git] / www / jssrc / blerg / Blerg.js
index 6eac0d8..4a95114 100644 (file)
@@ -1,21 +1,26 @@
+// Listen for onsubmit events
+enyo.dispatcher.listen(document, "submit");
+
 enyo.kind({
     name: "blerg.Blerg",
     kind: "Control",
     lastHash: null,
-    pathHandlers: [ blerg.User, blerg.Tag, blerg.Feed, blerg.ExternalURLPost, blerg.Welcome ],
+    pathHandlers: [ blerg.User, blerg.Tag, blerg.Feed, blerg.ExternalURLPost, blerg.Welcome, blerg.AccountCenter, blerg.Recovery ],
     handlers: {
         onStartSignup: "showSignupDialog",
         onTryLogin: "tryLogin",
         onTryLogout: "tryLogout",
         onSetTitle: "setTitle",
         onPostVisibility: "postVisibilityUpdate",
-        onReload: "sendReload"
+        onReload: "sendReload",
+        onShowChangePassword: "showChangePassword",
+        onAuthFailure: "authFailure"
     },
     components: [
         {classes: "blerg-header", components: [
             {name: "title", kind: "blerg.Title"},
             {name: "controls", kind: "blerg.Controls"},
-            {style: "clear: both"},
+            {style: "clear: both;"},
             {name: "post", kind: "blerg.Post", showing: false},
             {name: "help", kind: "blerg.Help"}
         ]},
@@ -92,5 +97,11 @@ enyo.kind({
     },
     sendReload: function() {
         this.$.main.waterfall('onReload');
+    },
+    showChangePassword: function() {
+        this.$.passwdDialog.show();
+    },
+    authFailure: function(inSender, inEvent) {
+        this.logout();
     }
 });