1var AWDATAFEED = { 2 init: function () { 3 this.loadVerticalFeed(); 4 this.loadHorizontalFeed(); 5 this.loadHorizontalFeedShortCode(); 6 this.togglePrceRangeInout(); 7 this.resetForm(); 8 this.displayAnalytics(); 9 this.processAnalytics(); 10 }, 11 12 loadHorizontalFeed: function(){ 13 jQuery("#nextHorizontal").on('click', function () { 14 jQuery.ajax({ 15 url: awindatafeed_params.ajaxurl, 16 data: 17 jQuery('form#swFeedHorizontal').serialize(), 18 success: function(response){ 19 jQuery('#ajaxResponseHorizontal').html(response); 20 jQuery("#nextHorizontal").show(); 21 jQuery("#nextHorizontal").html("»"); // » 22 AWDATAFEED.processAnalytics(); 23 }, 24 error: function(errorThrown) { 25 console.log(errorThrown); 26 } 27 }) 28 }); 29 30 jQuery('#nextHorizontal').trigger('click'); 31 }, 32 33 loadVerticalFeed: function() { 34 jQuery("#nextVertical").on('click', function () { 35 jQuery.ajax({ 36 url: awindatafeed_params.ajaxurl, 37 data: 38 jQuery('form#swFeedVertical').serialize(), 39 success: function(response){ 40 jQuery('#ajaxResponseVertical').html(response); 41 jQuery("#nextVertical").show(); 42 jQuery("#nextVertical").html('Next »') 43 AWDATAFEED.processAnalytics(); 44 }, 45 error: function(errorThrown){ 46 console.log(errorThrown); 47 } 48 }) 49 }); 50 51 jQuery('#nextVertical').trigger('click'); 52 }, 53 54 loadHorizontalFeedShortCode: function() { 55 jQuery("#nextHorizontalSc").on('click', function () { 56 57 jQuery.ajax({ 58 url: awindatafeed_params.ajaxurl, 59 data: 60 jQuery('form#swFeedHorizontalSc').serialize(), 61 success: function(response){ 62 jQuery('#ajaxResponseHorizontalSc').html(response); 63 jQuery("#nextHorizontalSc").show(); 64 jQuery("#nextHorizontalSc").html("»"); 65 AWDATAFEED.processAnalytics(); 66 }, 67 error: function(errorThrown){ 68 console.log(errorThrown); 69 } 70 }) 71 }); 72 73 jQuery('#nextHorizontalSc').trigger('click'); 74 }, 75 76 togglePrceRangeInout: function() { 77 if(jQuery("#maxPriceRange").is(':checked')) { 78 jQuery(".range").attr("readonly", false); 79 }; 80 jQuery("#maxPriceRange").focus(function () { 81 jQuery(".range").attr("readonly", false); 82 }); 83 jQuery(".maxPriceRadio").focus(function () { 84 jQuery(".range").attr("readonly", true); 85 }); 86 }, 87 88 processAnalytics: function () { 89 jQuery("a[class^='trackImage']").on('click', function(e){ 90 var feedId = getFeedId(this.className); 91 jQuery.ajax({ 92 url: awindatafeed_params.ajaxurl, 93 data: { 94 'action': 'track_user_click', 95 'feedId': feedId 96 }, 97 success: function(response){ 98 }, 99 error: function(errorThrown){ 100 console.log(errorThrown); 101 } 102 }) 103 }); 104 105 var getFeedId = function (classNameString) { 106 var id = classNameString.split("-"); 107 return id[1]; 108 } 109 }, 110 111 resetForm: function() { 112 jQuery("#resetFilters").on('click', function () { 113 var form = jQuery('form#swFilters'); 114 form.find('input:text, input:password, input:file, select, textarea').val(''); 115 form.find('input:radio, input:checkbox') 116 .removeAttr('checked').removeAttr('selected'); 117 }); 118 }, 119 120 displayAnalytics: function() { 121 jQuery( "#reportButton" ).click(function() {
122 jQuery( "#analytics" ).toggle('slow'); 123 }); 124 } 125}; 126 127jQuery(document).ready(function() { AWDATAFEED.init(); });
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.