1var isMobile = window.matchMedia('only screen and (max-width: 767px)'); 2 3function onElementInserted(containerSelector, elementSelector, callback) { 4 var onMutationsObserved = function(mutations) { 5 mutations.forEach(function(mutation) { 6 if (mutation.addedNodes.length) { 7 var elements = jQuery(mutation.addedNodes).find(elementSelector); 8 for (var i = 0, len = elements.length; i < len; i++) { 9 callback(elements[i]); 10 } 11 } 12 }); 13 }; 14 15 var target = jQuery(containerSelector)[0]; 16 var config = { childList: true, subtree: true }; 17 var MutationObserver = window.MutationObserver || window.WebKitMutationObserver; 18 var observer = new MutationObserver(onMutationsObserved); 19 observer.observe(target, config); 20} 21 22function search_data() { 23 document.getElementById('searchform_new').submit(); 24} 25 26function getParameterByName(name, url) { 27 if (!url) url = window.location.href; 28 name = name.replace(/[\[\]]/g, "\\$&"); 29 var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), 30 results = regex.exec(url); 31 if (!results) return null; 32 if (!results[2]) return ''; 33 return decodeURIComponent(results[2].replace(/\+/g, " ")); 34} 35 36function touchHandlerTouchEventsToMouseEvents(event) { 37 var touch = event.changedTouches[0]; 38 39 var simulatedEvent = document.createEvent("MouseEvent"); 40 simulatedEvent.initMouseEvent({ 41 touchstart: "mousedown", 42 touchmove: "mousemove", 43 touchend: "mouseup" 44 }[event.type], true, true, window, 1, 45 touch.screenX, touch.screenY, 46 touch.clientX, touch.clientY, false, 47 false, false, false, 0, null); 48 49 touch.target.dispatchEvent(simulatedEvent); 50 event.preventDefault(); 51} 52 53function addTouchEventsToMouseEvents() { 54 document.addEventListener("touchstart", touchHandlerTouchEventsToMouseEvents, true); 55 document.addEventListener("touchmove", touchHandlerTouchEventsToMouseEvents, true); 56 document.addEventListener("touchend", touchHandlerTouchEventsToMouseEvents, true); 57 document.addEventListener("touchcancel", touchHandlerTouchEventsToMouseEvents, true); 58} 59 60function removeTouchEventsToMouseEvents() { 61 document.removeEventListener("touchstart", touchHandlerTouchEventsToMouseEvents, true); 62 document.removeEventListener("touchmove", touchHandlerTouchEventsToMouseEvents, true); 63 document.removeEventListener("touchend", touchHandlerTouchEventsToMouseEvents, true); 64 document.removeEventListener("touchcancel", touchHandlerTouchEventsToMouseEvents, true); 65} 66 67function getPostArticle(search, response) { 68 jQuery('.bh-symbol-loading-popular').show(); 69 jQuery.get('/wp-admin/admin-ajax.php?action=bh_article_post&search='+search).done(function(rsp) { 70 jQuery('.bh-symbol-loading-popular').hide(); 71 response(rsp.data); 72 }).fail(function(xhr, textStatus, e) { 73 console.log(xhr.responseText); 74 }); 75} 76 77function getPostArticlePartners(search, response) { 78 jQuery('.bh-symbol-loading-related').show(); 79 jQuery.get('https://banyanhillweb.com/contextual-web/?search='+search).done(function(rsp) { 80 jQuery('.bh-symbol-loading-related').hide(); 81 response(rsp.data.body.value); 82 }).fail(function(xhr, textStatus, e) { 83 console.log(xhr.responseText); 84 }); 85} 86 87function upsertStockTickerSearch(s) { 88 jQuery.post('/wp-admin/admin-ajax.php', { 89 action: 'bh_ajax_company_ticker_tracker', 90 search: s, 91 }).done(function(rsp) { 92 //continue 93 }).fail(function(xhr, textStatus, e) { 94 console.log(xhr.responseText); 95 }); 96} 97 98function getStockTicker(search, response, limit) { 99 jQuery.post('/wp-admin/admin-ajax.php', { 100 action: 'bh_ajax_company_ticker', 101 search: search, 102 }).done(function(rsp) { 103 if(rsp.data.values.length === 0) { 104 response([{ 105 label: "No matches found for " + search, 106 name: "Nothing Found", 107 value: "" 108 }]); 109 } else { 110 response(rsp.data.values.slice(0, limit)); 111 } 112 }).fail(function(xhr, textStatus, e) { 113 console.log(xhr.responseText); 114 }); 115} 116 117jQuery(document).on('click', '.bh-rating-expand-action-close', function (){ 118 jQuery(this).parent().toggle(); 119 jQuery(this).parent().siblings('.bh-rating-expand').toggle(); 120 jQuery(this).parent().siblings('.bh-rating-desc').slideToggle(); 121}); 122 123jQuery(document).on('click', '.bh-rating-expand-action-open', function (){ 124 jQuery(this).parent().toggle(); 125 jQuery(this).parent().siblings('.bh-rating-expand').toggle(); 126 jQuery(this).parent().siblings('.bh-rating-desc').slideToggle(); 127}); 128 129jQuery(document).on('click', '.bh-symbol-action-add-watchlist', function (){ 130 jQuery(this).html('<i class="fa fa-check"></i> Added To Watchlist'); 131 132 if(jQuery(this).attr('data-logged-in') == '1') { 133 if (typeof bhSendWatchlist !== "undefined") { 134 bhSendWatchlist(0, 'upsert', jQuery(this).attr('data-symbol'), jQuery(this).attr('data-name'), null, false); 135 } 136 } else { 137 jQuery("#modal-login").modal({fadeDuration: 250,fadeDelay: 0.80}); 138 } 139}); 140 141jQuery(document).on('click', '.bh-symbol-action-rating-list', function (){ 142 if(jQuery(this).attr('data-logged-in') == '1') { 143 location.href = '/stock-rating-list/'; 144 } else { 145 jQuery("#modal-login").modal({fadeDuration: 250,fadeDelay: 0.80}); 146 } 147}); 148 149jQuery(document).ready(function($){ 150 if($('.bh-symbol-load-data-async').length > 0){ 151 $('.bh-symbol-load-data-async').each(function (){ 152 var $thisElem = $(this); 153 $.post('/wp-admin/admin-ajax.php', { 154 action: 'bh_symbol', 155 symbol: $(this).attr('data-symbol'), 156 }).done(function(rsp) { 157 var $raw = jQuery(rsp.data.raw); 158 $thisElem.attr('data-name', $raw.find('.header').text().toLowerCase().replace(/(^\w{1})|(\s{1}\w{1})/g, match => match.toUpperCase())); 159 }); 160 }); 161 } 162});
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.