mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-18 08:10:13 +01:00
Minor refactoring to fix login
This commit is contained in:
parent
f9d37d1d90
commit
bb0b602b6c
3 changed files with 24 additions and 23 deletions
|
|
@ -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>
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
|
|
@ -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();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue