X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;ds=sidebyside;f=www%2Fjs%2Fblerg.js;fp=www%2Fjs%2Fblerg.js;h=2ef48d94dca48183e5b6cab10326f3d95dfd303c;hb=25d05f5f2c444ca67199b7108fe74fb728cf8554;hp=83483fa4b0e4ec671fa2ea6afb5030642cfe3a49;hpb=4d157537c34bdc5576b449d0a632841dc5237aab;p=blerg.git diff --git a/www/js/blerg.js b/www/js/blerg.js index 83483fa..2ef48d9 100644 --- a/www/js/blerg.js +++ b/www/js/blerg.js @@ -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]);