//
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10628 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -96,7 +96,7 @@
|
|||||||
<img id="ajax-loader" src="../img/loader.gif" style="float:left;margin:2px 0 0 5px;display:none">
|
<img id="ajax-loader" src="../img/loader.gif" style="float:left;margin:2px 0 0 5px;display:none">
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div id="lost"><a href="#" onclick="$('#error').hide();$('#login').revertFlip();return false;">{l s='Back to login'}</a></div>
|
<div id="lost"><a href="#" onclick="displayLogin();return false;">{l s='Back to login'}</a></div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<h2><a href="http://www.prestashop.com">© Copyright by PrestaShop. all rights reserved.</a></h2>
|
<h2><a href="http://www.prestashop.com">© Copyright by PrestaShop. all rights reserved.</a></h2>
|
||||||
|
|||||||
+42
-52
@@ -1,46 +1,46 @@
|
|||||||
$(document).ready(function(){
|
$(document).ready(function() {
|
||||||
if (document.getElementById('email'))
|
if (document.getElementById('email')) document.getElementById('email').focus();
|
||||||
document.getElementById('email').focus();
|
//$("#login").effect( "slide", { direction: "up" }, 1000 );
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function displayForgotPassword() {
|
||||||
function displayForgotPassword()
|
|
||||||
{
|
|
||||||
$('#error').hide();
|
$('#error').hide();
|
||||||
$("#login").flip({
|
$("#login").flip({
|
||||||
direction:'tb',
|
direction: 'tb',
|
||||||
color : '#FFF',
|
color: '#FFF',
|
||||||
content: $('#forgot_password')
|
content: $('#forgot_password')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
function displayLogin() {
|
||||||
function doAjaxLogin()
|
|
||||||
{
|
|
||||||
$('#error').hide();
|
$('#error').hide();
|
||||||
$('#ajax-loader').fadeIn('slow', function () {
|
$('#login').revertFlip();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
function doAjaxLogin() {
|
||||||
|
$('#error').hide();
|
||||||
|
$('#ajax-loader').fadeIn('slow', function() {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type:"POST",
|
type: "POST",
|
||||||
url: "ajax-tab.php",
|
url: "ajax-tab.php",
|
||||||
async: true,
|
async: true,
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
data : {
|
data: {
|
||||||
ajax: "1",
|
ajax: "1",
|
||||||
token: "",
|
token: "",
|
||||||
controller: "AdminLogin",
|
controller: "AdminLogin",
|
||||||
submitLogin: "1",
|
submitLogin: "1",
|
||||||
passwd : $('#passwd').val(),
|
passwd: $('#passwd').val(),
|
||||||
email : $('#email').val()
|
email: $('#email').val()
|
||||||
},
|
},
|
||||||
success : function(jsonData)
|
success: function(jsonData) {
|
||||||
{
|
if (jsonData.hasErrors) {
|
||||||
if (jsonData.hasErrors)
|
|
||||||
{
|
|
||||||
displayErrors(jsonData.errors);
|
displayErrors(jsonData.errors);
|
||||||
$('#login').effect("shake", { times:3 }, 300);
|
} else {
|
||||||
}
|
$("#login").effect("slide", {
|
||||||
else
|
direction: "up"
|
||||||
{
|
}, 1000, function() {
|
||||||
window.location.href = jsonData.redirect;
|
window.location.href = jsonData.redirect;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function(XMLHttpRequest, textStatus, errorThrown) {
|
error: function(XMLHttpRequest, textStatus, errorThrown) {
|
||||||
@@ -50,34 +50,26 @@ function doAjaxLogin()
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
function doAjaxForgot() {
|
||||||
function doAjaxForgot()
|
|
||||||
{
|
|
||||||
$('#error').hide();
|
$('#error').hide();
|
||||||
$('#ajax-loader').fadeIn('slow', function () {
|
$('#ajax-loader').fadeIn('slow', function() {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type:"POST",
|
type: "POST",
|
||||||
url: "ajax-tab.php",
|
url: "ajax-tab.php",
|
||||||
async: true,
|
async: true,
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
data : {
|
data: {
|
||||||
ajax: "1",
|
ajax: "1",
|
||||||
token: "",
|
token: "",
|
||||||
controller: "AdminLogin",
|
controller: "AdminLogin",
|
||||||
submitForgot: "1",
|
submitForgot: "1",
|
||||||
email_forgot: $('#email_forgot').val()
|
email_forgot: $('#email_forgot').val()
|
||||||
},
|
},
|
||||||
success : function(jsonData)
|
success: function(jsonData) {
|
||||||
{
|
if (jsonData.hasErrors) {
|
||||||
if (jsonData.hasErrors)
|
|
||||||
{
|
|
||||||
displayErrors(jsonData.errors);
|
displayErrors(jsonData.errors);
|
||||||
$('#login').effect("shake", { times:3 }, 300);
|
} else {
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
window.location.href = jsonData.redirect;
|
window.location.href = jsonData.redirect;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -89,16 +81,14 @@ function doAjaxForgot()
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
function displayErrors(errors) {
|
||||||
function displayErrors(errors)
|
str_errors = '<h3>' + (errors.length > 1 ? there_are : there_is) + ' ' + errors.length + ' ' + (errors.length > 1 ? label_errors : label_error) + '</h3><ol>';
|
||||||
{
|
for (error in errors) //IE6 bug fix
|
||||||
str_errors = '<h3>'+(errors.length > 1 ? there_are : there_is )+' '+errors.length+' '+(errors.length > 1 ? label_errors : label_error )+'</h3><ol>';
|
if (error != 'indexOf') str_errors += '<li>' + errors[error] + '</li>';
|
||||||
for(error in errors)
|
|
||||||
//IE6 bug fix
|
|
||||||
if(error != 'indexOf')
|
|
||||||
str_errors += '<li>'+errors[error] + '</li>';
|
|
||||||
$('#ajax-loader').fadeOut('slow');
|
$('#ajax-loader').fadeOut('slow');
|
||||||
$('#error').html(str_errors+'</ol>');
|
$('#error').html(str_errors + '</ol>');
|
||||||
$('#error').fadeIn();
|
$('#error').fadeIn();
|
||||||
|
$("#login").effect("shake", {
|
||||||
|
times: 4
|
||||||
|
}, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user