1/*Ajax function*/ 2function postcs_getdata(paged, id, ajaxprocessfs) { 3 var ajaxprocess = 0; 4 if(ajaxprocessfs === 0) { 5 ajaxprocess = ajaxprocessfs; 6 } 7 if(ajaxprocess == 0) { 8 ajaxprocess = 1; 9 /*Loading*/ 10 if(jQuery('#post-cs[data-id="'+id+'"]').hasClass('loading') == false) { 11 jQuery('#post-cs[data-id="'+id+'"]').addClass('loading'); 12 jQuery('#post-cs[data-id="'+id+'"]').append('<div class="loading-box"><span></span></div>'); 13 } 14 15 var data = { 16 'action': 'postcs_getdata', 17 'data': {'paged':paged, 'id':id}, 18 }; 19 20 jQuery.post(ajaxurl, data, function(response) { 21 if(response == 0) { 22 /*No more data*/ 23 if(jQuery('#post-cs').attr('data-il') == 1) { 24 if(jQuery('#post-cs[data-id="'+id+'"] .nodata').length < 1) { 25 jQuery('#post-cs[data-id="'+id+'"]').prepend('<div class="nodata">No more data...</div>'); 26 setTimeout(function() { 27 jQuery('#post-cs[data-id="'+id+'"] .nodata').remove(); 28 }, 1000); 29 } 30 } else { 31 ajaxprocess = 0; 32 postcs_getdata(1, id); 33 return false; 34 } 35 /*Remove loading*/ 36 jQuery('#post-cs[data-id="'+id+'"]').removeClass('loading'); 37 jQuery('#post-cs[data-id="'+id+'"] .loading-box').remove(); 38 } else { 39 jQuery('#post-cs[data-id="'+id+'"]').html(response).removeClass('loading'); 40 var min_height = jQuery('#post-cs[data-id="'+id+'"]').css('min-height'); 41 min_height = min_height.replace('px', ''); 42 min_height = parseInt(min_height, 10); 43 setTimeout(function() { 44 var outer_height = jQuery('#post-cs[data-id="'+id+'"]').outerHeight(); 45 if(outer_height > min_height) { 46 jQuery('#post-cs[data-id="'+id+'"]').css('min-height',outer_height); 47 } 48 }, 1000); 49 jQuery('#post-cs[data-id="'+id+'"] .loading-box').remove(); 50 if(jQuery('#post-cs[data-id="'+id+'"] .ps-prev').attr('data-paged')) { 51 jQuery('#post-cs[data-id="'+id+'"] .ps-prev').show(); 52 } else { 53 if(jQuery('#post-cs').attr('data-il') == 1) { 54 jQuery('#post-cs[data-id="'+id+'"] .ps-prev').hide(); 55 } 56 } 57 } 58 ajaxprocess = 0; 59 }); 60 } 61} 62 63/*If #post-cs exist*/ 64if(jQuery('div#post-cs').length > 0) { 65 jQuery('div#post-cs').each(function() { 66 var get_id = jQuery(this).attr('data-id'); 67 /*Get slider data*/ 68 postcs_getdata(1, get_id, 0); 69 }); 70} 71 72/*Next, Prev click*/ 73jQuery(document).on( 'click', '#post-cs .ps-prev, #post-cs .ps-next, #post-cs .ps-pagi a', function() { 74 var get_paged = jQuery(this).attr('data-paged'); 75 var get_id = jQuery(this).closest('#post-cs').attr('data-id'); 76 if(jQuery(this).hasClass('ps-prev')) { 77 if(!get_paged) { 78 get_paged = jQuery(this).attr('data-total'); 79 } 80 } 81 /*Get slider data*/ 82 postcs_getdata(get_paged, get_id); 83}); 84 85jQuery('#post-cs').each(function() { 86 /*Mousewheel JS*/ 87 var _this = jQuery(this); 88 if(_this.attr('data-mw') == 1) { 89 /*Stop default scroll*/ 90 _this.on( 'mousewheel DOMMouseScroll', function (e) { 91 var e0 = e.originalEvent; 92 var delta = e0.wheelDelta || -e0.detail; 93 this.scrollTop += ( delta < 0 ? 1 : -1 ) * 30; 94 e.preventDefault(); 95 }); 96 _this.on( 'mousewheel', function(event) { 97 if(event.deltaY == 1) { 98 _this.find('.ps-prev').trigger('click'); 99 } else { 100 _this.find('.ps-next').trigger('click'); 101 } 102 }); 103 } 104 /*Touch Swipe JS*/ 105 if(_this.attr('data-ts') == 1) { 106 jQuery(function() { 107 _this.swipe( { 108 swipe:function(event, direction, distance, duration, fingerCount, fingerData) { 109 if(direction == 'left') { 110 _this.find('.ps-next').trigger('click'); 111 } else if(direction == 'right') { 112 _this.find('.ps-prev').trigger('click'); 113 } 114 } 115 }); 116 }); 117 } 118}); 119 120/*wp-dmin*/ 121/*Design Option : Add class on click*/ 122if(jQuery('.design-option label').length > 0) { 123 jQuery('.design-option label').on('click', function() { 124 jQuery('.design-option label').removeClass('checked'); 125 jQuery(this).addClass('checked'); 126 }); 127}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.