|
|
|
|
@ -3061,56 +3061,56 @@ function mapInit() { |
|
|
|
|
} |
|
|
|
|
/* */ |
|
|
|
|
function addError(inputId, msg){ |
|
|
|
|
var $input = $('#reg_form '+ inputId); |
|
|
|
|
var $error = $("<div>").attr("class", "pwf-msg").append( |
|
|
|
|
$("<div>").attr("class", "msg-error").append(msg) |
|
|
|
|
); |
|
|
|
|
var $input = $('#reg_form '+ inputId); |
|
|
|
|
var $error = $("<div>").attr("class", "pwf-msg").append( |
|
|
|
|
$("<div>").attr("class", "msg-error").append(msg) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
$input.parent().parent().append($error) |
|
|
|
|
$input.parent().parent().append($error) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function placeInput(width){ |
|
|
|
|
$('#id_country').val('159').select2({ |
|
|
|
|
placeholder: "Ваша страна", |
|
|
|
|
width: width |
|
|
|
|
}); |
|
|
|
|
$('#id_country').val('159').select2({ |
|
|
|
|
placeholder: "Ваша страна", |
|
|
|
|
width: width |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$('#id_city').select2({ |
|
|
|
|
placeholder: "Ваш город", |
|
|
|
|
width: width, |
|
|
|
|
ajax: { |
|
|
|
|
|
|
|
|
|
url: "/city/get-city/", |
|
|
|
|
dataType: "json", |
|
|
|
|
quietMillis: 200, |
|
|
|
|
|
|
|
|
|
data: function(term, page, country){ |
|
|
|
|
var country = $('#id_country').val() |
|
|
|
|
return {term: term, |
|
|
|
|
page: page, |
|
|
|
|
country: country}; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
results: function (data) { |
|
|
|
|
var results = []; |
|
|
|
|
$.each(data, function(index, item){ |
|
|
|
|
results.push({ |
|
|
|
|
id: item.id, |
|
|
|
|
text: item.label |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
return {results: results}; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
initSelection : function(element, callback) { |
|
|
|
|
var id= $(element).val(); |
|
|
|
|
var text = $(element).attr('data-init-text'); |
|
|
|
|
callback({id: id, text:text}); |
|
|
|
|
$('#id_city').select2({ |
|
|
|
|
placeholder: "Ваш город", |
|
|
|
|
width: width, |
|
|
|
|
ajax: { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
url: "/city/get-city/", |
|
|
|
|
dataType: "json", |
|
|
|
|
quietMillis: 200, |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
data: function(term, page, country){ |
|
|
|
|
var country = $('#id_country').val() |
|
|
|
|
return {term: term, |
|
|
|
|
page: page, |
|
|
|
|
country: country}; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
results: function (data) { |
|
|
|
|
var results = []; |
|
|
|
|
$.each(data, function(index, item){ |
|
|
|
|
results.push({ |
|
|
|
|
id: item.id, |
|
|
|
|
text: item.label |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
return {results: results}; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
initSelection : function(element, callback) { |
|
|
|
|
var id= $(element).val(); |
|
|
|
|
var text = $(element).attr('data-init-text'); |
|
|
|
|
callback({id: id, text:text}); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -3136,35 +3136,10 @@ function placeInput(width){ |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
/* submiting registration form */ |
|
|
|
|
/* submiting registration form */ |
|
|
|
|
$(function () { |
|
|
|
|
|
|
|
|
|
$('#callback-form').on('submit', function(e){ |
|
|
|
|
e.preventDefault(); |
|
|
|
|
var $form = $(this); |
|
|
|
|
var url = $form.attr('action'); |
|
|
|
|
var formData = $(this).serialize(); |
|
|
|
|
|
|
|
|
|
$.get(url, formData, function(data){ |
|
|
|
|
if (data.success){ |
|
|
|
|
$.fancybox.close(); |
|
|
|
|
$('#callback-form').find('input:text').val(''); |
|
|
|
|
$('#callback-form').find('.required').removeClass('required err'); |
|
|
|
|
$("#callback-form .error").remove(); |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
// delete prvious error
|
|
|
|
|
$("#callback-form .error").remove(); |
|
|
|
|
|
|
|
|
|
var $input = $('#id_callback_phone') |
|
|
|
|
// generate new error
|
|
|
|
|
var $error = $("<div>").attr("class", "error").append(data.errors['callback_phone']); |
|
|
|
|
$input.parent().addClass('required err').prepend($error); |
|
|
|
|
console.log(data.errors) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
//alert(123);
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$('#send_message_form').on('submit', function(event){ |
|
|
|
|
event.preventDefault(); |
|
|
|
|
$this = $(this); |
|
|
|
|
@ -3194,105 +3169,105 @@ function placeInput(width){ |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$('.visit, .unvisit').on('click', function(event){ |
|
|
|
|
event.preventDefault(); |
|
|
|
|
var $this = $(this); |
|
|
|
|
var url = $(this).attr('href'); |
|
|
|
|
$.get(url, function(data){ |
|
|
|
|
if (data.not_authorized){ |
|
|
|
|
$.fancybox.open('#pw-login'); |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
if(data.success){ |
|
|
|
|
if(data.in){ |
|
|
|
|
if($this.hasClass('visit')){ |
|
|
|
|
$this.hide(); |
|
|
|
|
$this.siblings('.unvisit').show() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
if($this.hasClass('unvisit')){ |
|
|
|
|
$this.hide(); |
|
|
|
|
$this.siblings('.visit').show() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
$('#reg_form').on('submit', function(event){ |
|
|
|
|
event.preventDefault(); |
|
|
|
|
var formData = $(this).serialize(); |
|
|
|
|
var url = '/register/'; |
|
|
|
|
console.log(url); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.post(url, formData, function(data){ |
|
|
|
|
if(data.success){ |
|
|
|
|
//register success
|
|
|
|
|
|
|
|
|
|
// remove input values
|
|
|
|
|
$('#reg_form input').each(function(i){ |
|
|
|
|
$(this).val(""); |
|
|
|
|
}); |
|
|
|
|
// close popup
|
|
|
|
|
$.fancybox.open('#pw-reg-complete'); |
|
|
|
|
//$.fancybox.close();
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
console.log(data); |
|
|
|
|
// hide help messages
|
|
|
|
|
$("#reg_form .msg-help:visible").hide(); |
|
|
|
|
// delete previous errors
|
|
|
|
|
$("#reg_form .msg-error").parent().remove(); |
|
|
|
|
|
|
|
|
|
// generate new errors
|
|
|
|
|
var form_inputs = ['first_name', 'last_name', 'email', 'password1', 'password2'] |
|
|
|
|
for(var i= 0; i < form_inputs.length; i++){ |
|
|
|
|
if(form_inputs[i] in data){ |
|
|
|
|
var input_id = '#id_'+form_inputs[i]; |
|
|
|
|
addError(input_id, data[form_inputs[i]]) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
*/ |
|
|
|
|
/* submiting change password form */ |
|
|
|
|
$('#paswd_change').on('submit', function(event){ |
|
|
|
|
event.preventDefault(); |
|
|
|
|
var formData = $(this).serialize(); |
|
|
|
|
var url = '/profile/change-password/'; |
|
|
|
|
var $form = $(this); |
|
|
|
|
$.post(url, formData, function(data){ |
|
|
|
|
if (data.success){ |
|
|
|
|
$('#paswd_change .mf-success').fadeIn(300); |
|
|
|
|
setTimeout(function(){ |
|
|
|
|
$('#paswd_change .mf-success').fadeOut(300); |
|
|
|
|
}, 3000); |
|
|
|
|
$form.find('#id_old password').val('') |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
// remove previous error
|
|
|
|
|
$('#paswd_change .mf-error').parent().remove(); |
|
|
|
|
// add new error
|
|
|
|
|
var $element = $("<div>").attr("class", "mf-line").append( |
|
|
|
|
$("<div>").attr("class", "mf-error").append(data.errors[0])) |
|
|
|
|
$form.find('.mf-buttons-line').before($element); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
$('.reg').on('click', function(event){ |
|
|
|
|
event.preventDefault(); |
|
|
|
|
$('.register').click(); |
|
|
|
|
}); |
|
|
|
|
$('.visit, .unvisit').on('click', function(event){ |
|
|
|
|
event.preventDefault(); |
|
|
|
|
var $this = $(this); |
|
|
|
|
var url = $(this).attr('href'); |
|
|
|
|
$.get(url, function(data){ |
|
|
|
|
if (data.not_authorized){ |
|
|
|
|
$.fancybox.open('#pw-login'); |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
if(data.success){ |
|
|
|
|
if(data.in){ |
|
|
|
|
if($this.hasClass('visit')){ |
|
|
|
|
$this.hide(); |
|
|
|
|
$this.siblings('.unvisit').show() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
if($this.hasClass('unvisit')){ |
|
|
|
|
$this.hide(); |
|
|
|
|
$this.siblings('.visit').show() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
$('#reg_form').on('submit', function(event){ |
|
|
|
|
event.preventDefault(); |
|
|
|
|
var formData = $(this).serialize(); |
|
|
|
|
var url = '/register/'; |
|
|
|
|
console.log(url); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.post(url, formData, function(data){ |
|
|
|
|
if(data.success){ |
|
|
|
|
//register success
|
|
|
|
|
|
|
|
|
|
// remove input values
|
|
|
|
|
$('#reg_form input').each(function(i){ |
|
|
|
|
$(this).val(""); |
|
|
|
|
}); |
|
|
|
|
// close popup
|
|
|
|
|
$.fancybox.open('#pw-reg-complete'); |
|
|
|
|
//$.fancybox.close();
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
console.log(data); |
|
|
|
|
// hide help messages
|
|
|
|
|
$("#reg_form .msg-help:visible").hide(); |
|
|
|
|
// delete previous errors
|
|
|
|
|
$("#reg_form .msg-error").parent().remove(); |
|
|
|
|
|
|
|
|
|
// generate new errors
|
|
|
|
|
var form_inputs = ['first_name', 'last_name', 'email', 'password1', 'password2'] |
|
|
|
|
for(var i= 0; i < form_inputs.length; i++){ |
|
|
|
|
if(form_inputs[i] in data){ |
|
|
|
|
var input_id = '#id_'+form_inputs[i]; |
|
|
|
|
addError(input_id, data[form_inputs[i]]) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
*/ |
|
|
|
|
/* submiting change password form */ |
|
|
|
|
$('#paswd_change').on('submit', function(event){ |
|
|
|
|
event.preventDefault(); |
|
|
|
|
var formData = $(this).serialize(); |
|
|
|
|
var url = '/profile/change-password/'; |
|
|
|
|
var $form = $(this); |
|
|
|
|
$.post(url, formData, function(data){ |
|
|
|
|
if (data.success){ |
|
|
|
|
$('#paswd_change .mf-success').fadeIn(300); |
|
|
|
|
setTimeout(function(){ |
|
|
|
|
$('#paswd_change .mf-success').fadeOut(300); |
|
|
|
|
}, 3000); |
|
|
|
|
$form.find('#id_old password').val('') |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
// remove previous error
|
|
|
|
|
$('#paswd_change .mf-error').parent().remove(); |
|
|
|
|
// add new error
|
|
|
|
|
var $element = $("<div>").attr("class", "mf-line").append( |
|
|
|
|
$("<div>").attr("class", "mf-error").append(data.errors[0])) |
|
|
|
|
$form.find('.mf-buttons-line').before($element); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
$('.reg').on('click', function(event){ |
|
|
|
|
event.preventDefault(); |
|
|
|
|
$('.register').click(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* ******************************************* |
|
|
|
|
@ -3398,11 +3373,11 @@ function placeInput(width){ |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
$("select:not([multiple])").each(function () { |
|
|
|
|
var $el = $(this); |
|
|
|
|
if (!$el.hasClass('select2')) { |
|
|
|
|
$el.customSelect(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
var $el = $(this); |
|
|
|
|
if (!$el.hasClass('select2')) { |
|
|
|
|
$el.customSelect(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -3774,10 +3749,10 @@ function placeInput(width){ |
|
|
|
|
var $input = $(this); |
|
|
|
|
var $fLine = $input.closest(".pwf-line"); |
|
|
|
|
var $help = $fLine.find('div.msg-help'); |
|
|
|
|
var $error = $fLine.find('div.msg-error'); |
|
|
|
|
var $error2 = $(this).parent().parent().parent().find('.mf-error'); |
|
|
|
|
$error.parent().remove(); |
|
|
|
|
$error2.parent().remove(); |
|
|
|
|
var $error = $fLine.find('div.msg-error'); |
|
|
|
|
var $error2 = $(this).parent().parent().parent().find('.mf-error'); |
|
|
|
|
$error.parent().remove(); |
|
|
|
|
$error2.parent().remove(); |
|
|
|
|
|
|
|
|
|
if ($help.is(':hidden')) { |
|
|
|
|
$help.fadeIn(300); |
|
|
|
|
@ -3810,7 +3785,7 @@ function placeInput(width){ |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('div.scroll-container').each(function () { |
|
|
|
|
$('div.scroll-container').each(function () { |
|
|
|
|
var $scrollContainer = $(this); |
|
|
|
|
$scrollContainer.mCustomScrollbar(customScrollOptions); |
|
|
|
|
}); |
|
|
|
|
@ -4111,8 +4086,8 @@ function placeInput(width){ |
|
|
|
|
* Управление расписанием проведения выставки |
|
|
|
|
* */ |
|
|
|
|
|
|
|
|
|
/* Пeреключение между общим временем для всех дней и уникальным для каждого дня */ |
|
|
|
|
$('input[type="checkbox"].w-time-switcher').each(function () { |
|
|
|
|
/* Пeреключение между общим временем для всех дней и уникальным для каждого дня */ |
|
|
|
|
$('input[type="checkbox"].w-time-switcher').each(function () { |
|
|
|
|
var $switch = $(this); |
|
|
|
|
var $wTimeContainer = $switch.closest('.mf-field'); |
|
|
|
|
|
|
|
|
|
@ -4277,7 +4252,7 @@ function placeInput(width){ |
|
|
|
|
$check.on('change', checkState); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
//$('select.select2').select2();
|
|
|
|
|
//$('select.select2').select2();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------
|
|
|
|
|
|