From 6c49799deb6bf776d3765febeb9d7959e27af43d Mon Sep 17 00:00:00 2001 From: Jakob Kramer Date: Sat, 24 Mar 2012 17:36:12 +0100 Subject: Fill username automatically in (Forget Password) Fill the username automatically in the "Forget Password" form if the user already entered his username on the login page --- mediagoblin/static/js/autofilledin_password.js | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 mediagoblin/static/js/autofilledin_password.js (limited to 'mediagoblin/static/js') diff --git a/mediagoblin/static/js/autofilledin_password.js b/mediagoblin/static/js/autofilledin_password.js new file mode 100644 index 00000000..9513c273 --- /dev/null +++ b/mediagoblin/static/js/autofilledin_password.js @@ -0,0 +1,27 @@ +/** + * GNU MediaGoblin -- federated, autonomous media hosting + * Copyright (C) 2012 MediaGoblin contributors. See AUTHORS. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +$(document).ready(function(){ + $('#forgot_password').click(function(event){ + event.preventDefault(); + window.location.pathname = $(this).attr('href') + '?username=' + + $('#username').val(); + }); + + $('#username').val(window.location.search.match(/username=(.*)/)[1]); +}); -- cgit v1.2.3 From 952b97d5a0671e1b4a68692a3b5f8a696cd2ca5f Mon Sep 17 00:00:00 2001 From: Jakob Kramer Date: Sun, 25 Mar 2012 21:51:09 +0200 Subject: set username default server-side --- mediagoblin/static/js/autofilledin_password.js | 2 -- 1 file changed, 2 deletions(-) (limited to 'mediagoblin/static/js') diff --git a/mediagoblin/static/js/autofilledin_password.js b/mediagoblin/static/js/autofilledin_password.js index 9513c273..45e867fe 100644 --- a/mediagoblin/static/js/autofilledin_password.js +++ b/mediagoblin/static/js/autofilledin_password.js @@ -22,6 +22,4 @@ $(document).ready(function(){ window.location.pathname = $(this).attr('href') + '?username=' + $('#username').val(); }); - - $('#username').val(window.location.search.match(/username=(.*)/)[1]); }); -- cgit v1.2.3