1/** 2 * Custom Ajax Functionality for Extra Tabs 3 * Created by Jonathan Bossenger on 2017/01/20. 4 */ 5 6// @todo install minifiers 7jQuery(document).ready(function ($) { 8 9 /** 10 * Previous link inside tabbed area click 11 * Currently this will override all tabbed lists 12 */ 13 $('.et_pb_tab_content').on('click', '.nav-previous a', function (event){ 14 event.preventDefault(); 15 get_scanner_feed_items($(this)); 16 }); 17 18 /** 19 * Next link inside tabbed area click 20 * Currently this will override all tabbed lists 21 */ 22 $('.et_pb_tab_content').on('click', '.nav-next a', function (event){ 23 event.preventDefault(); 24 get_scanner_feed_items($(this)); 25 }); 26 27 /** 28 * Runs ajax to get feed items based on page/paged variable 29 * Updates parent et_pb_tab_content div 30 * @param this_nav_link 31 */ 32 function get_scanner_feed_items(this_nav_link){ 33 34 var this_container = this_nav_link.parents('.et_pb_tab_content'); 35 this_container.addClass('ajax-loading'); 36 var current_url = this_nav_link.attr('href'); 37 var current_url_parts = current_url.split('/'); 38 39 var this_rss_aggregator_ul = this_container.children('.rss-aggregator'); 40 var rss_category = this_rss_aggregator_ul.data('category'); 41 42 var page = '1'; 43 if ( 6 == current_url_parts.length ){ //home page url 44 page = current_url_parts[4]; 45 }else { // ajaxed urls 46 page_url = current_url_parts[4]; 47 page = page_url.replace('admin-ajax.php?paged=', ''); 48 } 49 50 $.post( 51 ajax_object.ajax_url, 52 { 53 'action': 'get_scanner_feed_items', 54 'page': page, 55 'category': rss_category, 56 }, 57 function( response ) { 58 if( response ) { 59 this_container.removeClass('ajax-loading'); 60 this_container.html(response); 61 } 62 }, 63 'html' 64 ); 65 } 66 67 /** 68 * When a scanner feed item is clicked, this will display the hidden excerpt div 69 * Clicking on the same link will close the excerpt 70 */ 71 $('.et_pb_tab_content').on('click', '#feed-item-title .feed-item-url a', function (event){ 72 event.preventDefault(); 73 var $feed_title_anchor = $(this); 74 if ($feed_title_anchor.hasClass('open')){ 75 $(this).parents('.scanner-row').children('.feed-item-excerpt').hide(); 76 $feed_title_anchor.removeClass('open'); 77 }else { 78 $feed_title_anchor.addClass('open'); 79 $('.feed-item-excerpt').hide(); 80 $(this).parents('.scanner-row').children('.feed-item-excerpt').show(); 81 } 82 }); 83 84 /** 85 * Clicking on the read more link disables the click event handler on its excerpt 86 */ 87 $('.et_pb_tab_content').on('click', '.feed-item-excerpt .feed-item-excerpt-read-more', function (event){ 88 event.preventDefault(); 89 $('.et_pb_tab_content').off('click', '.feed-item-excerpt'); 90 window.open( 91 $(this).attr('href'), 92 '_blank' // <- This is what makes it open in a new window. 93 ); 94 }); 95 96 /** 97 * Clicking on the excerpt closes the excerpt 98 */ 99 $('.et_pb_tab_content').on('click', '.feed-item-excerpt', function (event){ 100 event.preventDefault(); 101 $('#feed-item-title .feed-item-url a').removeClass('open'); 102 $(this).hide(); 103 }); 104 105});
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.