+ $$('[name=user.reflink]').each(function(e) {
+ e.href = baseURL + '/#/ref/' + this.username;
+ }.bind(this));
+ $('usercontrols').show();
+
+ if (this.permalink && this.pageStart >= 0) {
+ this.showRecord(this.pageStart);
+ } else if (this.pageStart >= 0) {
+ this.showPageAt(this.pageStart);
+ } else {
+ this.reload();
+ }
+}
+
+User.prototype.hide = function() {
+ Pager.prototype.hide.call(this);
+ $('signup').hide();
+ $('rss').hide();
+ $('usercontrols').hide();
+}
+
+User.prototype.reload = function() {
+ this.pageStart = null;
+
+ $$('[name=user.subscribelink]').each(Element.hide);
+ $$('[name=user.unsubscribelink]').each(Element.hide);
+
+ if (loginStatus.loggedIn) {
+ new Ajax.Request(baseURL + '/feedinfo/' + this.username, {
+ method: 'post',
+ parameters: {
+ username: loginStatus.username
+ },
+ onSuccess: function(r) {
+ var json = r.responseText.evalJSON();
+ if (json.subscribed) {
+ $$('[name=user.subscribelink]').each(Element.hide);
+ $$('[name=user.unsubscribelink]').each(Element.show);
+ } else {
+ $$('[name=user.subscribelink]').each(Element.show);
+ $$('[name=user.unsubscribelink]').each(Element.hide);
+ }
+ }
+ });
+ }
+
+ new Ajax.Request(baseURL + '/info/' + this.username, {
+ method: 'get',
+ onSuccess: function(r) {
+ var response = r.responseText.evalJSON();
+ if (response) {
+ this.itemCount = parseInt(response.record_count);
+ this.showPageAt(this.itemCount - 1);
+ }
+ }.bind(this)
+ });