6 onStartSignup: "showSignupDialog",
7 onTryLogin: "tryLogin",
11 {classes: "blerg-header", components: [
12 {kind: "blerg.Title"},
13 {kind: "blerg.Controls"},
14 {style: "clear: both"},
15 {name: "post", kind: "blerg.Post", showing: false},
16 {name: "help", kind: "blerg.Help"}
18 {name: "main", kind: "blerg.Main"},
19 {name: "signupDialog", kind: "blerg.SignupDialog"},
20 {name: "passwdDialog", kind: "blerg.PasswdDialog"}
23 ['search', /^\?post\/([^/]+)\/(.+)/, "blerg.ExternalURLPost"],
24 ['hash', /^#\/(ref|tag)\/([A-Za-z0-9_-]+)(?:\/p(\d+))?$/, "blerg.Tag"],
25 ['hash', /^#\/feed(?:\/p(\d+))?$/, "blerg.Feed"],
26 ['hash', /^#([A-Za-z0-9_-]+)(?:\/(p)?(\d+))?$/, "blerg.User"]
28 pathHandlers: [ blerg.Welcome ],
29 rendered: function() {
30 this.inherited(arguments);
32 this.lastHash = location.hash;
35 //setInterval(this.hashCheck.bind(this), 250);
37 document.body.addEventListener('keyup', function(event) {
38 if (event.shiftKey && event.keyCode == 32) {
40 event.stopPropagation();
44 hashCheck: function() {
45 if (location.hash != this.lastHash) {
46 this.lastHash = location.hash;
50 urlSwitch: function() {
54 for (var i = 0; i < this.pathHandlers.length; i++) {
55 var handler = this.pathHandlers[i];
56 objdef = handler.locationDetect(window.location);
61 objdef = {classes: "blerg-error", content: "No handler found"}
63 this.$.main.updateView(objdef);
65 showSignupDialog: function() {
66 this.$.signupDialog.show();
68 setTitle: function(inSender, inEvent) {
69 if (inEvent.section != undefined)
70 this.$.title.setSection(inEvent.section);
72 if (inEvent.subscribed != undefined)
73 this.$.title.setSubscribed(inEvent.subscribed);
75 if (inEvent.showControls)
76 this.$.title.showControls()
78 this.$.title.hideControls();
80 tryLogin: function(inSender, inEvent) {