// JavaScript Document function scroll_page_all_projects(){ if(($('#page_all_projects').length) && ($(window).scrollTop() > $(document).height() - $(window).height()*1.5)) { // ajax call get data from server and append to the div page_all_projects_load_data(); } // if(($('#page_all_projects').length) && ($(window).scrollTop() > $(document).height() - $(window).height()*1.5)) { } function init_page_all_projects(){ page_all_projects_load_data(); init_page_all_project_events(); } function init_page_all_project_events(){ if($('#page_all_projects').length || $('#page_all_projects').length){ $('.project_box').each(function(){ $(this).unbind(); if($('#m').val() != '' && $('#m').val() == 'V8xsMwCKkh_aE8_tljc7cQ'){ $(this).click(function(e){ //alert($(this).data('url')); $(location).attr('href', $(this).data('url')); }); } else { $(this).hover(function(e){ $(this).find('.title a').animate({ 'color':'#39B5AA' }, 200); $(this).find('.location').animate({ 'color':'#646464' }, 200); $(this).find('.date').animate({ 'color':'#646464' }, 200); $(this).find('.project_organizer a').animate({ 'color':'#99999' }, 200); $(this).find('.project_amount').hide(); $(this).find('.ticket_containner').delay(20).fadeIn(250); $(this).find('.project_wrapper').animate({ 'margin-top':'-10px', 'height':'212px' }, 250); $(this).find('.project_heart_container').animate({ 'height':'210px' }, 200); $(this).find('.highlight_img_frontground').animate({ 'margin-top':'140px' }, 200); $(this).find('.highlight_img').animate({ 'height':'210px !important', 'background-size':'cover !important' }, 200); }, function(e){ $(this).find('.title a').animate({ 'color':'#404D57' }, 200); $(this).find('.location').animate({ 'color':'#aaaaaa' }, 200); $(this).find('.date').animate({ 'color':'#aaaaaa' }, 200); $(this).find('.project_organizer a').animate({ 'color':'#646464' }, 200); $(this).find('.project_amount').show(); $(this).find('.ticket_containner').fadeOut(200); $(this).find('.project_wrapper').animate({ 'margin-top':'0px', 'height':'202px' }, 200); $(this).find('.project_heart_container').animate({ 'height':'200px' }, 200); $(this).find('.highlight_img_frontground').animate({ 'margin-top':'130px' }, 200); $(this).find('.highlight_img').animate({ 'height':'200px !important', 'background-size':'cover !important' }, 200); }); } // if($('#m').val() == ''){ // ----- Heart Button ----- $(this).find('.project_highlight_heart').parent().unbind(); if($('#m').val() == ''){ $(this).find('.project_highlight_heart').parent().hover(function(e){ if($(this).attr("class") == 'color'){ $(this).find('img').attr("src", local_url+'lib/img/projects/project_highlight_title_btn_heart_saved_grey_all.png'); } else { $(this).find('img').attr("src", local_url+'lib/img/projects/project_highlight_title_btn_heart_all_over.png'); } }, function(e){ if($(this).attr("class") == 'color'){ $(this).find('img').attr("src", local_url+'lib/img/projects/project_highlight_title_btn_heart_all_saved.png'); } else { $(this).find('img').attr("src", local_url+'lib/img/projects/project_highlight_title_btn_heart_all.png'); } }); } $(this).find('.project_highlight_heart').parent().click(function(e){ var removeBoo = false; if($(this).attr("class") == 'color'){ $(this).switchClass('color', 'noclass', 0); removeBoo = true; $(this).find('img').stop().attr("src", local_url+'lib/img/projects/project_highlight_title_btn_heart_all.png'); } else { $(this).switchClass('noclass', 'color', 0); $(this).find('img').stop().attr("src", local_url+'lib/img/projects/project_highlight_title_btn_heart_all_saved.png'); } if($(this).parent().find('a').attr('href') == 'javascript:void(0);'){ // -------- AJAX ------ $.ajax({ headers: { 'X-Etickets-Key': $('#h').val() }, url: local_url+'lib/ajax/userheart/?puid='+$(this).parent().find('a').attr('data-p')+'&r='+((removeBoo) ?1:0), data: $('form').serialize(), type:"POST", dataType:'json', beforeSend: function(msg){ // }, complete: function(msg){ // }, success: function(json_data){ // //alert(json_data.status); }, error:function(xhr, ajaxOptions, thrownError){ // } }); // -- END --- AJAX ---- } }); // === END ===== Heart Button ----- }); } // if($('#page_all_projects').length || $('#page_all_projects').length){ } function page_all_projects_load_data(){ if($('#page_all_projects').length){ if(!$('#loading_data').length && ($('#t').val() != $('#page_all_projects .project_box').length)){ // -------- AJAX ------ if($('#loadingBoo').val() == 0){ $('#loadingBoo').val(1); $('#b').val( ( ($('#u').val() >= 0) ? (($('#page_all_projects .project_box').length == 0 && $('#page_all_projects .project_box').length-1 != $('#t').val() ) ? 1 : 0) : 0 ) ); $.ajax({ url: local_url+'lib/ajax/all/', headers: { 'X-Etickets-Key': $('#h').val() }, data: $('form').serialize(), type:"POST", dataType:'json', beforeSend: function(msg){ if($('#page_all_projects .project_box').length == 0){ ajax_show_loading_mask(true); } else { $('#page_all_projects').append('
'); } }, complete: function(msg){ setTimeout(function() { ajax_show_loading_mask(false); init_page_all_project_events(); $('#loadingBoo').val(0); }, ($('#page_all_projects .project_box').length == 0) ? 500 : 600); }, success: function(json_data){ //alert('status '+json_data.status); //alert('last '+json_data.html.last); //alert('b '+json_data.xx); //return; if(json_data.status == 1){ $('#u').val(json_data.html.last); $('#t').val(json_data.html.t); $('#loadingBoo').val(json_data.html.loadingBoo); setTimeout(function() { $('#loading_data').remove(); $('#page_all_projects').append(json_data.html.content); }, ($('#page_all_projects .project_box').length == 0) ? 10 : 600); } }, error:function(xhr, ajaxOptions, thrownError){ //alert('error: '+xhr.responseText); } }); } // if($('#loadingBoo').val() == 0){ // -- END --- AJAX ---- } // if(!$('#loading_data').length){ } // if($('#page_all_projects').length){ }