X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=www%2Fjs%2Fblerg.js;h=8cb5bab3d07fbb5854a92eebd016f9aa9df32931;hb=929a369550b4a40b743e7e30746b6cf575760fe3;hp=83483fa4b0e4ec671fa2ea6afb5030642cfe3a49;hpb=481423bac9915a431020b5e5e7672300d4adb3b0;p=blerg.git diff --git a/www/js/blerg.js b/www/js/blerg.js index 83483fa..8cb5bab 100644 --- a/www/js/blerg.js +++ b/www/js/blerg.js @@ -401,7 +401,7 @@ function mangleRecord(record, template) { l = l.replace(/&/g, '&').replace(//g, '>'); // Turn HTTP URLs into links - l = l.replace(/(\s|^)(https?:\/\/[a-zA-Z0-9.-]*[a-zA-Z0-9](\/([^\s"]*[^.!,;?()\s])?)?)/g, '$1$2'); + l = l.replace(/(\s[()\[\]{}]?|^)(https?:\/\/[a-zA-Z0-9.-]*[a-zA-Z0-9](\/([^\s"]*[^.!,;?()\s])?)?)/g, '$1$2'); // Turn markdown links into links var re; @@ -647,6 +647,36 @@ function signup_cancel() { urlSwitch(); } +function passwd() { + var old_password = $('passwd.old_password').value; + var new_password = $('passwd.new_password').value; + + new Ajax.Request(baseURL + '/passwd', { + parameters: { + username: loginStatus.username, + password: old_password, + new_password: new_password + }, + onSuccess: function(r) { + if (r.responseJSON.status == 'success') { + alert('Password changed'); + passwd_cancel(); + } else { + alert('Password change failed. Your password has NOT been changed.'); + } + }, + onFailure: function(r) { + alert('Password change error'); + } + }); +} + +function passwd_cancel() { + $('passwd').hide(); + $('navigation').show(); + urlSwitch(); +} + function subscribe() { new Ajax.Request(baseURL + '/subscribe/' + currentPager.username, { method: 'post', @@ -814,6 +844,10 @@ Welcome.prototype.hide = function() { $('welcome').hide(); } +Welcome.prototype.updateState = function() { + this.show(); +} + function ExternalURLPost(m) { this.title = decodeURIComponent(m[1]).replace(']','').replace('[',''); this.url = decodeURIComponent(m[2]);