new Ajax.Request(baseURL + '/login', {
parameters: {
username: username,
- password: password,
+ password: password
},
onSuccess: function(r) {
var j = r.responseText.evalJSON();
LoginStatus.prototype.logout = function() {
new Ajax.Request(baseURL + '/logout', {
parameters: {
- username: this.username,
+ username: this.username
},
onSuccess: function(r) {
this.loggedIn = false;
document.cookie = "auth=; expires=1-Jan-1970 00:00:00 GMT";
this.update();
- }.bind(this),
+ }.bind(this)
});
document.cookie = "username=; expires=1-Jan-1970 00:00:00 GMT";
}
this.itemCount = parseInt(j.record_count);
this.displayItems();
}
- }.bind(this),
+ }.bind(this)
});
}
User.prototype = new Pager();
// Turn markdown links into links
record.data = record.data.replace(/(\s|^)\[([^\]]+)\]\((https?:\/\/[a-zA-Z0-9.-]*[a-zA-Z0-9](\/[^)]*?)?)\)/, '$1<a href="$3">$2</a>');
+ // Turn *foo* into italics and **foo** into bold
+ record.data = record.data.replace(/(\s)\*\*([^*]+)\*\*(\s)/, '$1<b>$2</b>$3');
+ record.data = record.data.replace(/(\s)\*([^*]+)\*(\s)/, '$1<i>$2</i>$3');
+
// Turn refs and tags into links
record.data = record.data.replace(/(\s|^)#(\w+)/g, '$1<a href="#tag/$2">#$2</a>');
record.data = record.data.replace(/(\s|^)@(\w+)/g, '$1<a href="#$2">@$2</a>');
new Ajax.Request(baseURL + '/create', {
parameters: {
username: username,
- password: password,
+ password: password
},
onSuccess: function(r) {
$('signup').hide();
event.stop();
}
});
+ $('post.content').addEventListener('keyup', function(event) {
+ event.stopPropagation();
+ }, true);
}