X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=www%2Fjssrc%2Fblerg%2FControls.js;h=529df1e1f64326462621e0d7aeff230de0c90829;hb=6eee0074c07ce85359975621ff832943d320493a;hp=480e5520ffe8fd4090acd37c760d8eba0edc4fc9;hpb=3e5f69d01b9488475413d4ecce8161ab7a889ca2;p=blerg.git diff --git a/www/jssrc/blerg/Controls.js b/www/jssrc/blerg/Controls.js index 480e552..529df1e 100644 --- a/www/jssrc/blerg/Controls.js +++ b/www/jssrc/blerg/Controls.js @@ -10,7 +10,8 @@ enyo.kind({ handlers: { onLogin: "login", onLogout: "logout", - onPostVisibility: "postVisibilityUpdate" + onPostVisibility: "postVisibilityUpdate", + onClearFeedStatus: "clearFeedStatus" }, components: [ {name: "loggedOutControls", components: [ @@ -32,14 +33,11 @@ enyo.kind({ {name: "userlink", tag: "a"}, {tag: null, content: ". "}, {kind: "blerg.Link", content: "Logout", onNavigate: "logoutClicked"}, + {tag: null, content: "."}, + {tag: "br"}, + {kind: "blerg.Link", content: "Change Password", onNavigate: "changePasswordClicked"}, {tag: null, content: "."} ]}, - {components: [ - {name: "rssButton", kind: "blerg.Link", showing: false, components: [ - {kind: "Image", src: "/images/rss.png", width: 16, height: 16}, - {tag: null, content: " RSS"} - ]} - ]}, {classes: "blerg-controls-toolbar", components: [ {kind: "onyx.Button", content: "Feed Your Vanity", onclick: "chatterClicked"}, {name: "feedButton", kind: "onyx.Button", classes: "feed-button", content: "Stalk Your Victims", onclick: "feedClicked"}, @@ -85,15 +83,18 @@ enyo.kind({ this.$.userlink.setContent('@' + inEvent.username); this.username = inEvent.username; - this.$.api.getFeedInfo(); + this.updateFeedInfo(); this.feedStatusUpdateInterval = setInterval(function() { - this.$.api.getFeedInfo(); + this.updateFeedInfo(); }.bind(this), 900000); }, logout: function(inSender, inEvent) { this.setLoggedIn(false); clearInterval(this.feedStatusUpdateInterval); }, + changePasswordClicked: function() { + this.bubble('onShowChangePassword'); + }, spewToggle: function(inSender, inEvent) { this.postShowing = !this.postShowing; this.bubble('onPostVisibility', {showing: this.postShowing}); @@ -102,6 +103,9 @@ enyo.kind({ this.postShowing = inEvent.showing; this.$.spewButton.addRemoveClass('active', inEvent.showing); }, + updateFeedInfo: function() { + this.$.api.getFeedInfo(); + }, gotFeedInfo: function(inSender, inEvent) { this.$.feedButton.addRemoveClass('new', inEvent.new > 0); if (inEvent.new > 0) { @@ -117,5 +121,8 @@ enyo.kind({ feedClicked: function() { window.location.href = '/#/feed'; this.bubble('onNavigate'); + }, + clearFeedStatus: function() { + this.gotFeedInfo(this, {new: 0}); } });