1jQuery( document ).ready( function( $ ) { 2 3 var _f = $( '#esdc_time_from' ), 4 _t = $( '#esdc_time_to' ), 5 tabs = $( '.nav-tab'), 6 tabbed = $( '#tabbed' ), 7 sfield = $( '#searchfield' ), 8 srch = sfield.find( '#esdc-search' ), 9 tracked = $.parseJSON( ESDC_JS.tracked ), 10 selector = ''; 11 12 ts(); 13 function ts() { 14 var _ts = []; 15 for( var tr in tracked ) { 16 _ts[tr] = 'a[href$=".' + tracked[tr] + '"]'; 17 } 18 selector = _ts.join(','); 19 } 20 21 $(selector).click( function( e ) { 22 e.preventDefault(); 23 var pn_splode = $(this)[0].pathname.split( '/' ); 24 var fn = pn_splode[ pn_splode.length-1 ]; 25 payload = { 26 action: 'esdc_addtocount', 27 filename: fn, 28 cnonce: ESDC_JS.count_nonce 29 }; 30 31 ajax( payload, this ); 32 return false; 33 34 }); 35 _f.datepicker({ 36 dateFormat: 'yy-mm-dd', 37 onSelect: function( e, f ) { 38 if( f.id === "esdc_time_from" ) { 39 _t.datepicker( "option", "minDate", e ); 40 } 41 } 42 }); 43 _t.datepicker({ 44 dateFormat: 'yy-mm-dd' 45 }); 46 tabs.click( function() { 47 var id = '.' + $(this).attr( 'id' ); 48 tabbed.find( '.esdc-container' ).removeClass( 'active' ); 49 tabs.removeClass( 'nav-tab-active' ); 50 $(this).addClass( 'nav-tab-active' ); 51 tabbed.find( id ).addClass( 'active' ); 52 }); 53 srch.click( function() { 54 var _from = sfield.find( '#esdc_time_from' ).val(), 55 _to = sfield.find( '#esdc_time_to' ).val(), 56 payload = { 57 action: 'esdc_search_dates', 58 from: _f.val(), 59 to: _t.val(), 60 snonce: ESDC_JS.ds_nonce 61 }; 62 ajax( payload ); 63 }); 64 function ajax( payload, f ) { 65 $.ajax({ 66 url: ESDC_JS.ajax_url, 67 data: payload, 68 success: function( e ) { 69 if( payload.action === 'esdc_search_dates' ) { 70 $( '#esdc-search-results' ).html( e ); 71 } else if( payload.action === 'esdc_addtocount' ) { 72 window.location = f; 73 } 74 } 75 }); 76 } 77});
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.