Skip to content
Snippets Groups Projects
Commit 7021cb1c authored by xamgore's avatar xamgore
Browse files

Code format

parent d86ff7af
Branches
Tags
No related merge requests found
$(function()
{
var jProfiler = $('#profileInfo').first();
$(function () {
var jProfiler = $('#profileInfo').first();
var isOpened = false;
var flag = false;
// Показ профиля при нажатии
$('#settingsButton').click(function ()
{
$.get(URLdir + "window/settings", function(data){
$('#settingsButton').click(function () {
$.get(URLdir + "window/settings", function (data) {
wnd.open(JSON.parse(data));
});
});
$(document).click(function() {
if (flag === true) {
flag = false;
} else if (isOpened === true) {
jProfiler.slideUp(200);//css('display', 'none');
isOpened = false;
}
$(document).click(function () {
if (flag === true) {
flag = false;
} else if (isOpened === true) {
jProfiler.slideUp(200);//css('display', 'none');
isOpened = false;
}
});
$(".profile_wrapper").click(function() {
flag = true;
$(".profile_wrapper").click(function () {
flag = true;
});
$('#username').click(function() {
flag = true;
if(isOpened)
{
$('#username').click(function () {
flag = true;
if (isOpened) {
jProfiler.slideUp(200);//css('display', 'none');
isOpened = false;
}
else
{
else {
jProfiler.slideDown(200);//css('display', 'block');
isOpened = true;
}
......@@ -44,29 +40,28 @@ $(function()
$.ajax({
type: "POST",
url: URLdir + "handler/Session/closeSession",
success: function(data) {
success: function (data) {
$('.popup_overlay').css('display', 'block');
$('#signin_b').click(function()
{
$('#signin_b').click(function () {
$.post(URLdir + 'handler/sign/in', {
'login': $('#login').val(),
'password': $.sha1($('#password').val())
},
function (data) {
data = $.parseJSON(data);
if (data.success === true) {
$('.popup_overlay').css('display', 'none');
//location.reload();
setSessionTimer(15);
}
else {
$('.auth_error').show();
}
});
$.post(URLdir + 'handler/sign/in', {'login': $('#login').val(), 'password': $.sha1($('#password').val())},
function(data)
{
data = $.parseJSON(data);
if(data.success === true)
{
$('.popup_overlay').css('display', 'none');
//location.reload();
setSessionTimer(15);
}
else
{
$('.auth_error').show();
}
});
});
}
});
......@@ -74,25 +69,24 @@ $(function()
function setSessionTimer(time) {
timer = setTimeout(function() {
timer = setTimeout(function () {
$.ajax({
type: "POST",
url: URLdir + "handler/Session/getSessionTime",
success: function(data)
{
url: URLdir + "handler/Session/getSessionTime",
success: function (data) {
data = $.parseJSON(data);
wait = parseInt(data, 10);
if (wait <= 10) {
closeSession();
return;
} else {
setSessionTimer(wait-10);
setSessionTimer(wait - 10);
}
}
});
}, 1000*time);
});
}, 1000 * time);
}
setSessionTimer(1);
});
\ No newline at end of file
});
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment