mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-26 10:46:10 +01:00
Login form working in jQuery
This commit is contained in:
parent
35c9f55553
commit
4c68144c93
3 changed files with 15 additions and 14 deletions
|
|
@ -4,6 +4,7 @@
|
|||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<%= stylesheet_link_tag "scaffold" %>
|
||||
<%= javascript_include_tag :defaults %>
|
||||
<%= javascript_include_tag 'jquery.cookie' %>
|
||||
|
||||
<title><%= @page_title -%></title>
|
||||
|
||||
|
|
|
|||
|
|
@ -74,5 +74,5 @@ function showPreferredAuth() {
|
|||
Login.showOpenid();
|
||||
}
|
||||
}
|
||||
Event.observe(window, 'load', showPreferredAuth);
|
||||
</script>
|
||||
$(document).ready(showPreferredAuth);
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,21 +1,21 @@
|
|||
var Login = {
|
||||
showOpenid: function() {
|
||||
if ($('database_auth_form')) $('database_auth_form').hide();
|
||||
if ($('openid_auth_form')) $('openid_auth_form').show();
|
||||
if ($('alternate_auth_openid')) $('alternate_auth_openid').hide();
|
||||
if ($('alternate_auth_database')) $('alternate_auth_database').show();
|
||||
if ($('openid_url')) $('openid_url').focus();
|
||||
if ($('openid_url')) $('openid_url').select();
|
||||
$('#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) {
|
||||
if ($('openid_auth_form')) $('openid_auth_form').hide();
|
||||
if ($('database_auth_form')) $('database_auth_form').show();
|
||||
if ($('alternate_auth_database')) $('alternate_auth_database').hide();
|
||||
if ($('alternate_auth_openid')) $('alternate_auth_openid').show();
|
||||
if ($('user_login')) $('user_login').focus();
|
||||
if ($('user_login')) $('user_login').select();
|
||||
$('#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');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue