1/* 2wp-tab-widget.js 3*/ 4 5function wpt_loadTabContent(tab_name, page_num, container, args_obj) { 6 7 var container = jQuery(container); 8 var tab_content = container.find('#'+tab_name+'-tab-content'); 9 10 // only load content if it wasn't already loaded 11 var isLoaded = tab_content.data('loaded'); 12 13 if (!isLoaded || page_num != 1) { 14 if (!container.hasClass('wpt-loading')) { 15 container.addClass('wpt-loading'); 16 17 tab_content.load(wpt.ajax_url, { 18 action: 'liveride_widget_content', 19 tab: tab_name, 20 page: page_num, 21 args: args_obj 22 }, function() { 23 container.removeClass('wpt-loading'); 24 tab_content.data('loaded', 1).hide().fadeIn().siblings().hide(); 25 } 26 ); 27 } 28 } else { 29 tab_content.fadeIn().siblings().hide(); 30 } 31} 32 33jQuery(document).ready(function() { 34 jQuery('.liveride_widget_content').each(function() { 35 var $this = jQuery(this); 36 var widget_id = this.id; 37 var args = $this.data('args'); 38 39 // load tab content on click 40 $this.find('.wpt-tabs a').click(function(e) { 41 e.preventDefault(); 42 jQuery(this).parent().addClass('selected').siblings().removeClass('selected'); 43 var tab_name = this.id.slice(0, -4); // -tab 44 wpt_loadTabContent(tab_name, 1, $this, args); 45 }); 46 47 // pagination 48 $this.on('click', '.wpt-pagination a', function(e) { 49 e.preventDefault(); 50 var $this_a = jQuery(this); 51 var tab_name = $this_a.closest('.tab-content').attr('id').slice(0, -12); // -tab-content 52 var page_num = parseInt($this_a.closest('.tab-content').children('.page_num').val()); 53 54 if ($this_a.hasClass('next')) { 55 wpt_loadTabContent(tab_name, page_num + 1, $this, args); 56 } else { 57 $this.find('#'+tab_name+'-tab-content').data('loaded', 0); 58 wpt_loadTabContent(tab_name, page_num - 1, $this, args); 59 } 60 61 }); 62 63 // load first tab now 64 $this.find('.wpt-tabs a').first().click(); 65 }); 66 67});
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.