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() $(function () {
{ var jProfiler = $('#profileInfo').first();
var jProfiler = $('#profileInfo').first();
var isOpened = false; var isOpened = false;
var flag = false; var flag = false;
// Показ профиля при нажатии // Показ профиля при нажатии
$('#settingsButton').click(function () $('#settingsButton').click(function () {
{ $.get(URLdir + "window/settings", function (data) {
$.get(URLdir + "window/settings", function(data){
wnd.open(JSON.parse(data)); wnd.open(JSON.parse(data));
}); });
}); });
$(document).click(function() { $(document).click(function () {
if (flag === true) { if (flag === true) {
flag = false; flag = false;
} else if (isOpened === true) { } else if (isOpened === true) {
jProfiler.slideUp(200);//css('display', 'none'); jProfiler.slideUp(200);//css('display', 'none');
isOpened = false; isOpened = false;
} }
}); });
$(".profile_wrapper").click(function() { $(".profile_wrapper").click(function () {
flag = true; flag = true;
}); });
$('#username').click(function() { $('#username').click(function () {
flag = true; flag = true;
if(isOpened) if (isOpened) {
{
jProfiler.slideUp(200);//css('display', 'none'); jProfiler.slideUp(200);//css('display', 'none');
isOpened = false; isOpened = false;
} }
else else {
{
jProfiler.slideDown(200);//css('display', 'block'); jProfiler.slideDown(200);//css('display', 'block');
isOpened = true; isOpened = true;
} }
...@@ -44,29 +40,28 @@ $(function() ...@@ -44,29 +40,28 @@ $(function()
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: URLdir + "handler/Session/closeSession", url: URLdir + "handler/Session/closeSession",
success: function(data) { success: function (data) {
$('.popup_overlay').css('display', 'block'); $('.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() ...@@ -74,25 +69,24 @@ $(function()
function setSessionTimer(time) { function setSessionTimer(time) {
timer = setTimeout(function() { timer = setTimeout(function () {
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: URLdir + "handler/Session/getSessionTime", url: URLdir + "handler/Session/getSessionTime",
success: function(data) success: function (data) {
{
data = $.parseJSON(data); data = $.parseJSON(data);
wait = parseInt(data, 10); wait = parseInt(data, 10);
if (wait <= 10) { if (wait <= 10) {
closeSession(); closeSession();
return; return;
} else { } else {
setSessionTimer(wait-10); setSessionTimer(wait - 10);
} }
} }
}); });
}, 1000*time); }, 1000 * time);
} }
setSessionTimer(1); 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