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 } 37 38 var offset = settingsValue.offset + settingsValue.perPage; 39 40 optionsValue.loadMoreBtn.on( 'click', function( e ) { 41 e.preventDefault(); 42 43 $(this).addClass( 'button--loading' ); 44 $(this).find( 'span' ).html( 'Loading...' ); 45 46 $.ajax( { 47 url: eaelPostGrid.ajaxurl, 48 type: 'post', 49 data: { 50 action: 'load_more', 51 post_style: optionsValue.postStyle, 52 eael_show_image : settingsValue.showImage, 53 image_size : settingsValue.imageSize, 54 eael_show_title : settingsValue.showTitle, 55 eael_show_meta : settingsValue.showMeta, 56 meta_position : settingsValue.metaPosition, 57 58 eael_show_excerpt : settingsValue.showExcerpt, 59 eael_excerpt_length : settingsValue.excerptLength, 60 61 post_type: settingsValue.postType, 62 posts_per_page : settingsValue.perPage, 63 offset : offset, 64 65 tax_query: settingsValue.tax_query, 66 67 post__not_in: settingsValue.excludePosts, 68 69 post__in: settingsValue.post__in, 70 71 orderby: settingsValue.orderBy, 72 order: settingsValue.postOrder, 73 grid_style: settingsValue.grid_style, 74 eael_post_block_hover_animation: settingsValue.hover_animation 75 }, 76 beforeSend: function() { 77 // _this.html('<i class="fa fa-spinner fa-spin"></i> Saving Data..'); 78 }, 79 success: function( response ) { 80 var $content = $( response ); 81 if( optionsValue.postStyle === 'grid' ) { 82 setTimeout(function() { 83 optionsValue.postContainer.masonry(); 84 optionsValue.postContainer.append( $content ).masonry( 'appended', $content ); 85 optionsValue.postContainer.masonry({ 86 itemSelector: '.eael-grid-post', 87 percentPosition: true, 88 columnWidth: '.eael-post-grid-column' 89 }); 90 }, 100); 91 } else { 92 optionsValue.postContainer.append( $content ); 93 } 94 optionsValue.loadMoreBtn.removeClass( 'button--loading' ); 95 optionsValue.loadMoreBtn.find( 'span' ).html( settingsValue.btnText ); 96 97 offset = offset + settingsValue.perPage; 98 99 if( offset >= optionsValue.totalPosts ) { 100 optionsValue.loadMoreBtn.remove(); 101 } 102 103 }, 104 error: function() { 105 106 } 107 } ); 108 } ); 109 }; // end of eaelLoadMore 110 111 window.eaelDynamicGalleryLoadMore = function(options, settings, gallery) { 112 113 var options = { 114 totalPosts: options.totalPosts, 115 loadMoreBtn: options.loadMoreBtn, 116 postStyle: options.postStyle, 117 postContainer: options.postContainer, 118 gridStyle:options.gridStyle, 119 zoomIcon:options.zoomIcon, 120 linkIcon:options.linkIcon, 121 hoverStyle: options.hoverStyle, 122 popUp: options.popUp, 123 showPopupStyles: options.showPopupStyles 124 } 125 126 var gallerySettings = { 127 gallery: gallery, 128 postType: settings.postType, 129 perPage: settings.perPage, 130 postOrder: settings.postOrder, 131 orderBy: settings.orderBy, 132 offset: settings.offset, 133 btnText: settings.btn_text, 134 tax_query: settings.tax_query, 135 exclude_posts: settings.exclude_posts, 136 post__in: settings.post__in, 137 postExcerpt: settings.postExcerpt,
138 btnText: settings.btnText 139 } 140 141 var offset = settings.offset + settings.perPage; 142 143 options.loadMoreBtn.on('click', function(e) { 144 e.preventDefault(); 145 146 $(this).addClass( 'button--loading' ); 147 $(this).find( 'span' ).html( 'Loading...' ); 148 149 $.ajax({ 150 url: eaelPostGrid.ajaxurl, 151 type: 'post', 152 data: { 153 action: 'load_more', 154 post_type: gallerySettings.postType, 155 posts_per_page : gallerySettings.perPage, 156 post_style: options.postStyle, 157 offset : offset, 158 tax_query: gallerySettings.tax_query, 159 post__not_in: gallerySettings.excludePosts, 160 post__in: gallerySettings.post__in, 161 orderby: gallerySettings.orderBy, 162 eael_fg_grid_style: options.gridStyle, 163 eael_fg_grid_hover_style:options.hoverStyle, 164 eael_fg_show_popup: options.popUp, 165 eael_section_fg_zoom_icon: options.zoomIcon, 166 eael_section_fg_link_icon: options.linkIcon, 167 order: gallerySettings.postOrder, 168 eael_post_excerpt: gallerySettings.postExcerpt, 169 eael_fg_show_popup_styles: options.showPopupStyles 170 }, 171 beforeSend: function() { 172 // _this.html('<i class="fa fa-spinner fa-spin"></i> Saving Data..'); 173 }, 174 success: function( response ) { 175 var $content = $( response ); 176 177 setTimeout(function() { 178 gallerySettings.gallery.isotope('insert', $content); 179 options.loadMoreBtn.removeClass( 'button--loading' ); 180 options.loadMoreBtn.find( 'span' ).html( gallerySettings.btnText ); 181 }, 100); 182 183 offset = offset + gallerySettings.perPage; 184 if( offset >= options.totalPosts ) { 185 options.loadMoreBtn.remove(); 186 } 187 188 189 }, 190 error: function() { 191 192 } 193 }); 194 195 196 }); 197 198 199 200 } 201 202 203 204})(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.