2022-12-11 13:55:49 +05:00
|
|
|
|
$(function() {
|
|
|
|
|
$("a.ancLinks").click(function() {
|
|
|
|
|
var elementClick = $(this).attr("href");
|
|
|
|
|
var destination = $(elementClick).offset().top;
|
|
|
|
|
$('html,body').animate({ scrollTop: destination }, 3000);
|
|
|
|
|
return false;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function init() {
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: "POST",
|
|
|
|
|
url: "/act/ajax",
|
|
|
|
|
data: "act=stat_mob&w=" + $(window).width() + "&h=" + $(window).height()
|
2023-01-24 15:51:26 +05:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
type:"POST",
|
|
|
|
|
url:'/act/admin',
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
data:"act=getPos",
|
|
|
|
|
|
|
|
|
|
success: function(data){
|
|
|
|
|
data.forEach(function(data) {
|
|
|
|
|
//alert(data.y);
|
|
|
|
|
|
|
|
|
|
$('[data-elem=' + data.elem + ']').css({'top': data.y + 'px'});
|
|
|
|
|
$('[data-elem=' + data.elem + ']').css({'left': data.x + 'px'});
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//success:function(data){/*alert(data)*/}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//alert($(['data-elem=zametka']).css());
|
|
|
|
|
|
2022-12-11 13:55:49 +05:00
|
|
|
|
// $("#wid").text(w_sreen);
|
|
|
|
|
}
|
|
|
|
|
init();
|
|
|
|
|
$("button").click(function(event) {
|
|
|
|
|
var link = $(this).data('link');
|
|
|
|
|
var ajax = $(this).data('ajax');
|
|
|
|
|
var txt = $(this).data('txt');
|
|
|
|
|
var modalid = $(this).data('modal');
|
|
|
|
|
// if (modalid)$('#' + modalid).modal('show');
|
|
|
|
|
if (link) document.location.href = link;
|
|
|
|
|
if (ajax) {
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: "POST",
|
|
|
|
|
url: ajax,
|
|
|
|
|
data: "txt=" + txt
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
$(".lazy").lazyload({ placeholder: "/img/grey.gif", effect: "fadeIn", failure_limit: 2, threshold: 10 });
|
|
|
|
|
|
|
|
|
|
$("#soc_btn a").click(function(event) {
|
|
|
|
|
var title = $("#soc_btn").attr('title');
|
|
|
|
|
var ss = $(this).data('ss');
|
|
|
|
|
var decription = $("#soc_btn").data('decription');
|
|
|
|
|
var url = $("#soc_btn").data('url');
|
|
|
|
|
var img = $("#soc_btn").data('img');
|
|
|
|
|
switch (ss) {
|
|
|
|
|
case 'vk.com':
|
|
|
|
|
window.open('//vk.com/share.php?url=http://b-install-nt.ru&title=' + title + '&description=' + decription + '&image=' + img, '_blank', 'scrollbars=0, resizable=1, menubar=0, left=100, top=100, width=550, height=440, toolbar=0, status=0');
|
|
|
|
|
break;
|
|
|
|
|
case 'ok.ru':
|
|
|
|
|
window.open('//ok.ru/dk?st.cmd=addShare&st._surl=' + url + '&title=' + title, '_blank', 'scrollbars=0, resizable=1, menubar=0, left=100, top=100, width=550, height=440, toolbar=0, status=0');
|
|
|
|
|
break;
|
|
|
|
|
case 'facebook.com':
|
|
|
|
|
window.open('//www.facebook.com/sharer/sharer.php?u=' + url, '_blank', 'scrollbars=0, resizable=1, menubar=0, left=100, top=100, width=550, height=440, toolbar=0, status=0');
|
|
|
|
|
break;
|
|
|
|
|
case 'mail.ru':
|
|
|
|
|
window.open('//connect.mail.ru/share?url=' + url + '&title=' + title + '&description=' + decription + '&imageurl=' + img, '_blank', 'scrollbars=0, resizable=1, menubar=0, left=100, top=100, width=550, height=440, toolbar=0, status=0');
|
|
|
|
|
break;
|
|
|
|
|
case 'google.com':
|
|
|
|
|
window.open('//plus.google.com/share?url=' + url, '_blank', 'scrollbars=0, resizable=1, menubar=0, left=100, top=100, width=550, height=440, toolbar=0, status=0');
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// $("body").append('<!-- link rel="stylesheet" href="/api/jquery/plugins/magnific-popup/1.1.0/magnific-popup.css" --><link rel="stylesheet" href="/api/jquery/plugins/shortcode/shortcodes.css"><!-- link rel="stylesheet" href="/api/fonts/montserrat/montserrat.css" --><link rel="stylesheet" href="/api/bootstrap/3.3.7/responsive.css"><!-- link rel="stylesheet" href="/api/fonts/eleganticons-fonts/eleganticons-fonts.css" -->' );
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
|
|
$('.am-container').montage({
|
|
|
|
|
liquid: false,
|
|
|
|
|
fillLastRow: true,
|
|
|
|
|
margin: 4,
|
|
|
|
|
fixedHeight: 260
|
|
|
|
|
});*/
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Открыть модальное окно
|
|
|
|
|
$(".modal_show").click(function(event) {
|
|
|
|
|
var modal_id = $(this).data("modal");
|
|
|
|
|
// alert (modal_id);
|
|
|
|
|
$(modal_id).modal("show");
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Открыть модальное окно
|
|
|
|
|
$(".modal_hide").click(function(event) {
|
|
|
|
|
var modal_id = $(this).data("modal");
|
|
|
|
|
$(modal_id).modal("hide");
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('#notifications').load('/notifications/');
|
|
|
|
|
|
|
|
|
|
$(".click-false").click(function(event) {
|
|
|
|
|
return false;
|
|
|
|
|
});
|
|
|
|
|
/*$('.popup-content').magnificPopup({
|
|
|
|
|
type: 'inline'
|
|
|
|
|
});*/
|
|
|
|
|
$(".form-submit").click(function(event) {
|
|
|
|
|
var id_form = $(this).data("id");
|
|
|
|
|
$(id_form).submit();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//показываем окошко для быстрого редактирования
|
|
|
|
|
$(".fast-edit-link").dblclick(function(event) {
|
|
|
|
|
var id = $(this).data("id");
|
|
|
|
|
//себя прячем
|
|
|
|
|
$(this).addClass("hidden");
|
|
|
|
|
$(".fast-edit[data-id=" + id + "]").removeClass("hidden");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//Поле которое надо быстро сохранить
|
|
|
|
|
$(".fast-edit").dblclick(function(event) {
|
|
|
|
|
var id = $(this).data("id");
|
|
|
|
|
var type_var = $(this).data("type");
|
|
|
|
|
var name_var = $(this).data("name");
|
|
|
|
|
var txt = $(this).val();
|
|
|
|
|
|
|
|
|
|
$(".fast-edit-link[data-id=" + id + "]").removeClass("hidden");
|
|
|
|
|
$(".fast-edit-link[data-id=" + id + "]").text(txt);
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: "POST",
|
|
|
|
|
url: '/fast-edit/',
|
|
|
|
|
data: "id=" + id + "&type=" + type_var + "&name=" + name_var + "&txt=" + txt
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(this).addClass("hidden");
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
//Поле которое надо быстро сохранить
|
|
|
|
|
$(".fast-edit").click(function(event) {
|
|
|
|
|
var id = $(this).data("id");
|
|
|
|
|
var type_var = $(this).data("type");
|
|
|
|
|
var name_var = $(this).data("name");
|
|
|
|
|
var txt = $(this).val();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: "POST",
|
|
|
|
|
url: '/fast-edit/',
|
|
|
|
|
data: "id=" + id + "&type=" + type_var + "&name=" + name_var + "&txt=" + txt
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
//Поле которое надо быстро сохранить
|
|
|
|
|
$(".fast-edit").keyup(function(event) {
|
|
|
|
|
var id = $(this).data("id");
|
|
|
|
|
var type_var = $(this).data("type");
|
|
|
|
|
var name_var = $(this).data("name");
|
|
|
|
|
var txt = $(this).val();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: "POST",
|
|
|
|
|
url: '/fast-edit/',
|
|
|
|
|
data: "id=" + id + "&type=" + type_var + "&name=" + name_var + "&txt=" + txt
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Этот код сохраняет настрокий модулей
|
|
|
|
|
$("#form_modal_mod_settings").submit(function(event) {
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
var formData = new FormData(this);
|
|
|
|
|
//alert(1);
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: 'POST', // Тип запроса
|
|
|
|
|
url: '/act/ajax', // Скрипт обработчика
|
|
|
|
|
data: formData, // Данные которые мы передаем
|
|
|
|
|
cache: false, // В запросах POST отключено по умолчанию, но перестрахуемся
|
|
|
|
|
contentType: false, // Тип кодирования данных мы задали в форме, это отключим
|
|
|
|
|
processData: false,
|
|
|
|
|
success: function(data) { /*alert(data);*/ },
|
|
|
|
|
error: function(data) {
|
|
|
|
|
console.log(data);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
$("#btn-save-mod-settings").click(function(event) {
|
|
|
|
|
// alert(1);
|
|
|
|
|
$("#form_modal_mod_settings").submit();
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
var tab = $('#tabs .tabs-items > div');
|
|
|
|
|
|
|
|
|
|
tab.hide().filter(':first').show();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Клики по вкладкам.
|
|
|
|
|
|
|
|
|
|
$('#tabs .tabs-nav a').click(function(){
|
|
|
|
|
tab.hide();
|
|
|
|
|
tab.filter(this.hash).show();
|
|
|
|
|
$('#tabs .tabs-nav a').removeClass('active');
|
|
|
|
|
$(this).addClass('active');
|
|
|
|
|
return false;
|
|
|
|
|
}).filter(':first').click();
|
|
|
|
|
// Клики по якорным ссылкам.
|
|
|
|
|
$('.tabs-target').click(function(){
|
|
|
|
|
$('#tabs .tabs-nav a[href=' + $(this).attr('href')+ ']').click();
|
|
|
|
|
});
|
|
|
|
|
// Отрытие вкладки из хеша URL
|
|
|
|
|
if(window.location.hash){
|
|
|
|
|
$('#tabs-nav a[href=' + window.location.hash + ']').click();
|
|
|
|
|
window.scrollTo(0, $("#" . window.location.hash).offset().top);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//$( "#tabs" ).tabs();
|