92 lines
3.8 KiB
JavaScript
92 lines
3.8 KiB
JavaScript
|
$(function(){//123
|
|||
|
|
|||
|
//function $_GET(key) {
|
|||
|
// var p = window.location.search;
|
|||
|
// p = p.match(new RegExp(key + '=([^&=]+)'));
|
|||
|
// return p ? p[1] : false;
|
|||
|
//}
|
|||
|
|
|||
|
//alert($_GET['id']);
|
|||
|
|
|||
|
$("a.ancLinks").click(function(){
|
|||
|
var elementClick=$(this).attr("href");
|
|||
|
var destination=$(elementClick).offset().top;
|
|||
|
$('html,body').animate({scrollTop:destination},3000);
|
|||
|
return false;});
|
|||
|
|
|||
|
$("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})}})
|
|||
|
|
|||
|
$("#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;})
|
|||
|
|
|||
|
|
|||
|
//$('#div_administracia').load('/mini_page/11');
|
|||
|
/*Загружаем популярные страницы*/
|
|||
|
$('#reyt_page').load('/reyt_page/');
|
|||
|
|
|||
|
|
|||
|
$("#form_find_click").click(function(event){
|
|||
|
var a=$("#input-find").val();
|
|||
|
location.replace("/find/" + a);
|
|||
|
|
|||
|
//$("#form_find").submit();
|
|||
|
})
|
|||
|
/*
|
|||
|
$("#form_find").submit(function(event){
|
|||
|
event.preventDefault();
|
|||
|
var a=$("#input-find").val();
|
|||
|
location.replace("/find/" + a);
|
|||
|
}
|
|||
|
*/
|
|||
|
/* автоматическое присвоение классов */
|
|||
|
$("input[type=email], input[type=password], input[type=text], textarea").addClass("form-control");
|
|||
|
//$("input[type=submit]").addClass("btn btn-dark");
|
|||
|
//убираем закругления у кнопок
|
|||
|
|
|||
|
//$("button").css("border-radius", "0");
|
|||
|
//$(".btn").css("border-radius", "0");
|
|||
|
|
|||
|
|
|||
|
/*$('table.table_cat img.thumbnail').BlackAndWhite({
|
|||
|
hoverEffect: true;
|
|||
|
});*/
|
|||
|
$(".lazy").lazyload({ placeholder : "/img/grey.gif", effect : "fadeIn", failure_limit : 2, threshold : 10 });
|
|||
|
|
|||
|
|
|||
|
$("#a_change_city").click(function(){
|
|||
|
$('#modal_change_city').modal('show');
|
|||
|
$("div#div_city_list").load('/jchangecity/');
|
|||
|
return false;
|
|||
|
})
|
|||
|
|
|||
|
//редактор хтмл
|
|||
|
$("#a_edit_html").click(function(){
|
|||
|
$('#modal_edit_html').modal('show');
|
|||
|
return false;
|
|||
|
})
|
|||
|
|
|||
|
|
|||
|
//var editor = ace.edit("textarea_edit_html");
|
|||
|
|
|||
|
|
|||
|
/* добавлялка в избранное */
|
|||
|
$("#a_to_favorite").click(function(){
|
|||
|
var mod = $(this).data('mod');
|
|||
|
var mod_id = $(this).data('modid');
|
|||
|
$.ajax({
|
|||
|
type:"POST",
|
|||
|
url:'/act/ajax',
|
|||
|
data:"act=add_to_favorite&mod=" + mod + "&mod_id=" + mod_id
|
|||
|
});
|
|||
|
$(this).css('color', 'red');
|
|||
|
})
|
|||
|
|
|||
|
|
|||
|
$('body').append('<link rel="stylesheet" href="/api/fontawesome/5.8.1/css/all.css"><link rel="stylesheet" type="text/css" href="/assets/css/colors/yellow.css" media="all" />');
|
|||
|
|
|||
|
});
|