Current File : /home/users/barii/public_html/finansenl.com.pl/system.fotomagnesy.pl/js/funkcje.js
  
    
  $(document).bind('mousemove', function(e){             
        if(e.pageY<75 && e.pageY>50){
    if ($("#leftcol #tabs select:hover").length > 0) {
              $('#tail').css({
                 display: 'block', 
                   });
              }
              else{   
              $('#tail').css({
                 display: 'none'
                   });
              }    
        }
        
              else{   
              $('#tail').css({
                 display: 'none'
                   });
              }

});
  
$.noConflict();
jQuery( document ).ready(function($) {    


   
   
   <?php
    $s = getimagesize('img/dodatki/makiety/'.$_GET['wzor']);
    echo "init(".$s[0].",".$s[1].",'myCanvas');\n";
    ?>
        
    <?php if($_GET['wzor']){
        
        ?>
    
    try {
        <?php echo str_replace('_','',str_replace('.jpg','',str_replace('.png','',$_GET['plik'])));?>(1);
    }
    catch(err) {
        // Handle error(s) here
    }
        <?php
        
        
        echo "dodajNaklejke3('img/dodatki/makiety/".$_GET['wzor']."',1,0,0);";
        
    }                                                                         
    ?> 
                                                                           
    
    canvas.deactivateAll();                 
    $('#texteditor').hide();                            

    
    $('select.motywykat').change(function(){
    if($( this ).val() == 0){
          $('.dirnaklejki').show();
    }
    else{
          $('.dirnaklejki').hide();          
          $('.dirnaklejki.'+ $( this ).val()).show();
    }
    });     
    
    $('select.szablonykat').change(function() {
    if($( this ).val() == 0){
          $('.dirszablony').show();
    }
    else{
          $('.dirszablony').hide();          
          $('.dirszablony.'+ $( this ).val() ).show();
    }
    });  
       
    $('select.ozdobnikikat').change(function() {
    if($( this ).val() == 0){
          $('.dirozdobniki').show();
    }
    else{
          $('.dirozdobniki').hide();          
          $('.dirozdobniki.'+ $( this ).val() ).show();
    }
    });
    
    $('a.menutope').click( function() {
                  
			if($('a.menutope .material-icons').html()=='menu'){
        $('.menutope').animate({
        left: '+=250px'
        },500);
        
        $('a.menutope .material-icons').html('clear');
      }
      else{                
        $('.menutope').animate({
        left: '-=250px'
        },500);
        
        $('a.menutope .material-icons').html('menu');
      }
        
			return false;
		});
           
    
    $('li.usunelement a').click(function(){
        removeit();
    });
            
    $('a.add_cart').click(function(){
                
        $('div.overwhite').show();
                
                if (obj = canvas.getActiveObject()){
                canvas.getActiveObject().hasControls = canvas.getActiveObject().hasBorders = false; }
                canvas.renderAll();
                
                
          var rect = new fabric.Rect({ width: 1654, height: 2360, fill:'#fff'});
          rect.globalCompositeOperation = 'destination-over';
          canvas.add(rect);
          canvas.item(0).selectable = false;
                Zapisz();
                                
                var dataURL = canvas.toDataURL({
                    format: 'jpeg',
                    quality: 1,
                });                                        
                $.ajax({
                      url: "/add.php",
                      type: 'POST', 
                      data: { 
                         imgBase64: dataURL,  
                         w: <?php echo $s[0]?>,
                         h: <?php echo $s[1]?>,
                      },              
                      success: function(data)
                      {       
                            //console.log(data);
                            window.location.href = "/koszyk.php";
                      }
                    }).done(function(o) {
                      console.log("saved"); 
                    });
        });
    
        $("#tabs ul li a").click(function()
        {
        $("#tabs ul .active").removeClass("active");
        $(this).parent().addClass("active");
        var element_index = $("#tabs ul a").index(this);
        $("#content1>div:visible").hide();
        $("#content1 div.tabs-"+(element_index+1)).show();
        return false;
        });
        
  $(".pcien").hide();     
  
          
  $(".odc .przycisk").click( function() {
        if($("#bottomcol .material-icons").html()=="keyboard_arrow_down"){
              $("#bottomcol").animate({
                height: '0px'
              },500);
              $("#bottomcol .material-icons").html('keyboard_arrow_up');
        }else{
              $("#bottomcol").animate({
                height: '90%'
              },500);
              $("#bottomcol .material-icons").html('keyboard_arrow_down');
        }
  }); 
  
  
  $(".wybierzszablon").click( function() {
        $("#bottomcol").animate({
          height: '90%'
        },500);
        $("#bottomcol .material-icons").html('keyboard_arrow_down');
  }); 
                                   
    
});