published: {
username: "",
permalink: false,
- firstRecord: null,
+ record: null,
},
statics: {
locationDetect: function(l) {
- var m = l.hash.match(/^#([A-Za-z0-9_-]+)(?:\/(p)?(\d+))?$/);
+ var m = l.hash.match(/^#([A-Za-z0-9_-]+)(?:\/(\d+))?$/);
if (m) {
return {
kind: "blerg.User",
username: m[1],
- permalink: m[2] != 'p',
- firstRecord: parseInt(m[3])
+ permalink: m[2] != undefined,
+ record: parseInt(m[2])
};
}
}
this.bubble('onSetTitle', {section: '@' + this.username});
this.$.records.destroyComponents();
this.lastRecord = null;
- this.loadMore();
+ this.$.loadMoreButton.hide();
+ if (this.permalink) {
+ this.loadItems(this.record, this.record);
+ } else {
+ this.loadMore();
+ }
},
loadItems: function(from, to) {
this.inherited(arguments);
url: url
});
req.response(function(inSender, inResponse) {
+ if (this.permalink) {
+ this.$.loadMoreButton.hide();
+ } else {
+ this.$.loadMoreButton.show();
+ }
+
for (var i = 0; i < inResponse.length; i++) {
inResponse[i].author = this.username;
}
+
this.addItems(inResponse);
}.bind(this));
req.go();