Minor refactoring to fix login

This commit is contained in:
Eric Allen 2009-10-18 18:23:33 -04:00
parent f9d37d1d90
commit bb0b602b6c
3 changed files with 24 additions and 23 deletions

View file

@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<%= stylesheet_link_tag "scaffold" %> <%= stylesheet_link_tag "scaffold" %>
<%= javascript_include_tag :defaults %> <%= javascript_include_tag 'jquery' %>
<%= javascript_include_tag 'jquery.cookie' %> <%= javascript_include_tag 'jquery.cookie' %>
<title><%= @page_title -%></title> <title><%= @page_title -%></title>

View file

@ -75,4 +75,27 @@ function showPreferredAuth() {
} }
} }
$(document).ready(showPreferredAuth); $(document).ready(showPreferredAuth);
var Login = {
showOpenid: function() {
$('#database_auth_form').hide();
$('#openid_auth_form').show();
$('#alternate_auth_openid').hide();
$('#alternate_auth_database').show();
$('#openid_url').focus();
$('#openid_url').select();
$.cookie('preferred_auth', 'openid');
},
showDatabase: function(container) {
$('#openid_auth_form').hide();
$('#database_auth_form').show();
$('#alternate_auth_database').hide();
$('#alternate_auth_openid').show();
$('#user_login').focus();
$('#user_login').select();
$.cookie('preferred_auth', 'database');
}
}
</script> </script>

View file

@ -1,25 +1,3 @@
var Login = {
showOpenid: function() {
$('#database_auth_form').hide();
$('#openid_auth_form').show();
$('#alternate_auth_openid').hide();
$('#alternate_auth_database').show();
$('#openid_url').focus();
$('#openid_url').select();
$.cookie('preferred_auth', 'openid');
},
showDatabase: function(container) {
$('#openid_auth_form').hide();
$('#database_auth_form').show();
$('#alternate_auth_database').hide();
$('#alternate_auth_openid').show();
$('#user_login').focus();
$('#user_login').select();
$.cookie('preferred_auth', 'database');
}
}
var TracksForm = { var TracksForm = {
toggle: function(toggleDivId, formContainerId, formId, hideLinkText, hideLinkTitle, showLinkText, showLinkTitle) { toggle: function(toggleDivId, formContainerId, formId, hideLinkText, hideLinkTitle, showLinkText, showLinkTitle) {
$('#'+formContainerId).toggle(); $('#'+formContainerId).toggle();