1(function($) { 2 'use strict'; 3 4 window.eaelLoadMore = function( options, settings ) { 5 6 // Default Values for Load More Js 7 var optionsValue = { 8 totalPosts: options.totalPosts, 9 loadMoreBtn: options.loadMoreBtn, 10 postContainer: $(options.postContainer), 11 postStyle: options.postStyle, // block, grid, timeline, 12 } 13 14 // Settings Values 15 var settingsValue = { 16 postType: settings.postType, 17 perPage: settings.perPage, 18 postOrder: settings.postOrder, 19 orderBy: settings.orderBy, 20 showImage: settings.showImage, 21 showTitle: settings.showTitle, 22 showExcerpt: settings.showExcerpt, 23 showMeta: settings.showMeta, 24 imageSize: settings.imageSize, 25 metaPosition: settings.metaPosition, 26 excerptLength: settings.excerptLength, 27 btnText: settings.btnText, 28 29 tax_query: settings.tax_query, 30 31 post__in: settings.post__in, 32 excludePosts: settings.exclude_posts, 33 offset: parseInt( settings.offset , 10 ), 34 grid_style: settings.grid_style || '', 35 hover_animation: settings.hover_animation, 36 hover_icon: settings.hover_icon 37 } 38 39 var offset = settingsValue.offset + settingsValue.perPage; 40 41 optionsValue.loadMoreBtn.on( 'click', function( e ) { 42 e.preventDefault(); 43 44 $(this).addClass( 'button--loading' ); 45 $(this).find( 'span' ).html( 'Loading...' ); 46 47 $.ajax( { 48 url: eaelPostGrid.ajaxurl, 49 type: 'post', 50 data: { 51 action: 'load_more', 52 post_style: optionsValue.postStyle, 53 eael_show_image : settingsValue.showImage, 54 image_size : settingsValue.imageSize, 55 eael_show_title : settingsValue.showTitle, 56 eael_show_meta : settingsValue.showMeta, 57 meta_position : settingsValue.metaPosition, 58 59 eael_show_excerpt : settingsValue.showExcerpt, 60 eael_excerpt_length : settingsValue.excerptLength, 61 62 post_type: settingsValue.postType, 63 posts_per_page : settingsValue.perPage, 64 offset : offset, 65 66 tax_query: settingsValue.tax_query, 67 68 post__not_in: settingsValue.excludePosts, 69 70 post__in: settingsValue.post__in, 71 72 orderby: settingsValue.orderBy, 73 order: settingsValue.postOrder, 74 grid_style: settingsValue.grid_style, 75 eael_post_grid_hover_animation: settingsValue.hover_animation, 76 eael_post_grid_bg_hover_icon: settingsValue.hover_icon 77 }, 78 beforeSend: function() { 79 // _this.html('<i class="fa fa-spinner fa-spin"></i> Saving Data..'); 80 }, 81 success: function( response ) { 82 var $content = $( response ); 83 if( optionsValue.postStyle === 'grid' ) { 84 setTimeout(function() { 85 optionsValue.postContainer.masonry(); 86 optionsValue.postContainer.append( $content ).masonry( 'appended', $content ); 87 optionsValue.postContainer.masonry({ 88 itemSelector: '.eael-grid-post', 89 percentPosition: true, 90 columnWidth: '.eael-post-grid-column' 91 }); 92 }, 100); 93 } else { 94 optionsValue.postContainer.append( $content ); 95 } 96 optionsValue.loadMoreBtn.removeClass( 'button--loading' ); 97 optionsValue.loadMoreBtn.find( 'span' ).html( settingsValue.btnText ); 98 99 offset = offset + settingsValue.perPage; 100 101 if( offset >= optionsValue.totalPosts ) { 102 optionsValue.loadMoreBtn.remove(); 103 } 104 105 }, 106 error: function() { 107 108 } 109 } ); 110 } ); 111 }; // end of eaelLoadMore 112 113 114})(jQuery);
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.