X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=www%2Fjssrc%2Fblerg%2FTitle.js;h=a8282fba06b34c5d17b273dddc750decae28169f;hb=3e5f69d01b9488475413d4ecce8161ab7a889ca2;hp=8fa9dbca6af6b1b66cc2ac074f58ded2e0172e5a;hpb=21db04ef3e4f66d7b5c4c9be2be36703b18cbcaa;p=blerg.git diff --git a/www/jssrc/blerg/Title.js b/www/jssrc/blerg/Title.js index 8fa9dbc..a8282fb 100644 --- a/www/jssrc/blerg/Title.js +++ b/www/jssrc/blerg/Title.js @@ -1,57 +1,30 @@ enyo.kind({ - name: "blerg.Title", - kind: "Control", - style: "float: left; width: 40%", - published: { - subscribed: null, - section: "" - }, - components: [ - {kind: "Image", classes: "logo", src: "images/blerglogo.png", attributes: {width: 125, height: 122}}, - {tag: "h1", components: [ - {kind: "blerg.Link", content: "Blërg!"} - ]}, - {tag: "h2", components: [ - {name: "section", tag: "span"} - ]}, - {name: "userControls", showing: false, components: [ - {kind: "blerg.Link", onclick: "clickChatter", content: "[chatter]"}, - {name: "subscribeLink", kind: "blerg.Link", onclick: "clickSubscribe", showing: false, content: "[stalk]"}, - {name: "unsubscribeLink", kind: "blerg.Link", onclick: "clickUnsubscribe", showing: false, content: "[stop stalking]"} - ]} - ], - create: function() { - this.inherited(arguments); - this.subscribedChanged(); - }, - clickChatter: function() { - this.bubble("onChatter"); - }, - clickSubscribe: function() { - this.bubble("onSubscribe"); - }, - clickUnsubscribe: function() { - this.bubble("onUnsubscribe"); - }, - subscribedChanged: function() { - if (this.subscribed == null) { - this.$.subscribeLink.hide(); - this.$.unsubscribeLink.hide(); - } else if (this.subscribed) { - this.$.subscribeLink.hide(); - this.$.unsubscribeLink.show(); - } else { - this.$.subscribeLink.show(); - this.$.unsubscribeLink.hide(); - } - }, - sectionChanged: function() { - this.$.section.setContent(this.section); - }, - showControls: function() { - this.$.userControls.hide(); - }, - hideControls: function() { - this.$.userControls.hide(); - } + name: "blerg.Title", + kind: "Control", + style: "float: left; width: 40%;", + published: { + section: "" + }, + handlers: { + onSetTitle: "setTitle" + }, + components: [ + {kind: "Image", classes: "logo", src: "images/blerglogo.png", attributes: {width: 125, height: 122}}, + {tag: "h1", components: [ + {kind: "blerg.Link", href: "/#/", content: "Blërg!"} + ]}, + {tag: "h2", components: [ + {name: "section", tag: "span"} + ]} + ], + create: function() { + this.inherited(arguments); + }, + sectionChanged: function() { + this.$.section.setContent(this.section); + }, + setTitle: function(inSender, inEvent) { + if (inEvent.section) + this.setSection(inEvent.section); + } });