1 function validate(evt) { 2 var theEvent = evt || window.event; 3 var key = theEvent.keyCode || theEvent.which; 4 // console.log(key); 5 key = String.fromCharCode( key ); 6 var regex = /[0-9\+\()]|\./; 7 if( !regex.test(key)) { 8 theEvent.returnValue = false; 9 if(theEvent.preventDefault) theEvent.preventDefault(); 10 } 11 } 12 13 $("a.btn-adaptive").click(function() { 14 var a = $(this).attr("href"); 15 OpenWindow(a, 350, 568, "media"); 16 return false 17 }); 18 19function OpenWindow(b, d, a, c) { 20 if (!c) { 21 c = window 22 } 23 if (!d) { 24 d = 800 25 } 26 if (!a) { 27 a = 600 28 } 29 var f = (screen.width - d) / 2; 30 var e = window.open(b, c, "left=" + f + ",top=100,width=" + d + ",height=" + a + ",directories=no,menubar=no,status=yes,resizable=yes,scrollbars=yes,toolbar=no"); 31 if (e.opener == null) { 32 e.opener = self 33 } 34 e.focus() 35} 36 37 38// SEARCH BAR STARTS HERE 39 40 41 var search_timer = false; 42$(document).ready(function() { 43 $(document).on('click', '.search-toggle', function(e) { 44 e.stopPropagation(); 45 var parent = $(this).parent(); 46 $('body').addClass('thim-search-active'); 47 setTimeout(function() { 48 parent.find('.thim-s').focus(); 49 }, 500); 50 }); 51 $(document).on('click', '.search-popup-bg', function() { 52 var parent = $(this).parent(); 53 window.clearTimeout(search_timer); 54 parent.find('.courses-list-search').empty(); 55 parent.find('.thim-s').val(''); 56 $('body').removeClass('thim-search-active'); 57 }); 58 $(document).on('keyup', '.courses-search-input', function(event) { 59 clearTimeout($.data(this, 'search_timer')); 60 var contain = $(this).parents('.courses-searching'), 61 list_search = contain.find('.courses-list-search'), 62 item_search = list_search.find('>li'); 63 if (event.which == 13) { 64 event.preventDefault(); 65 $(this).stop(); 66 } else if (event.which == 38) { 67 if (navigator.userAgent.indexOf('Chrome') != -1 && parseFloat(navigator.userAgent.
67substring(navigator.userAgent.indexOf('Chrome') + 7).split(' ')[0]) >= 15) { 68 var selected = item_search.filter(".ob-selected"); 69 if (item_search.length > 1) { 70 item_search.removeClass("ob-selected"); 71 if (selected.prev().length == 0) { 72 selected.siblings().last().addClass("ob-selected"); 73 } else { 74 selected.prev().addClass("ob-selected"); 75 } 76 } 77 } 78 } else if (event.which == 40) { 79 if (navigator.userAgent.indexOf('Chrome') != -1 && parseFloat(navigator.userAgent.substring(navigator.userAgent.indexOf('Chrome') + 7).split(' ')[0]) >= 15) { 80 var selected = item_search.filter(".ob-selected"); 81 if (item_search.length > 1) { 82 item_search.removeClass("ob-selected"); 83 if (selected.next().length == 0) { 84 selected.siblings().first().addClass("ob-selected"); 85 } else { 86 selected.next().addClass("ob-selected"); 87 } 88 } 89 } 90 } else if (event.which == 27) { 91 if ($('body').hasClass('thim-search-active')) { 92 $('body').removeClass('thim-search-active'); 93 } 94 list_search.html(''); 95 $(this).val(''); 96 $(this).stop(); 97 } else { 98 var search_timer = setTimeout(function() { 99 thimlivesearch(contain); 100 }, 500); 101 $(this).data('search_timer', search_timer); 102 } 103 }); 104 $(document).on('keypress', '.courses-search-input', function(event) { 105 var item_search = $(this).parents('.courses-searching').find('.courses-list-search>li'); 106 if (event.keyCode == 13) { 107 var selected = $(".ob-selected"); 108 if (selected.length > 0) { 109 var ob_href = selected.find('a').first().attr('href'); 110 window.location.href = ob_href; 111 } 112 event.preventDefault(); 113 } 114 if (event.keyCode == 27) { 115 if ($('body').hasClass('thim-search-active')) { 116 $('body').removeClass('thim-search-active'); 117 } 118 $('.courses-list-search').html(''); 119 $(this).val(''); 120 $(this).stop(); 121 } 122 if (event.keyCode == 38) { 123 var selected = item_search.filter(".ob-selected"); 124 if (item_search.length > 1) { 125 item_search.removeClass("ob-selected"); 126 if (selected.prev().length == 0) { 127 selected.siblings().last().addClass("ob-selected"); 128 } else { 129 selected.prev().addClass("ob-selected"); 130 } 131 } 132 } 133 if (event.keyCode == 40) { 134 var selected = item_search.filter(".ob-selected"); 135 if (item_search.length > 1) { 136 item_search.removeClass("ob-selected"); 137 if (selected.next().length == 0) { 138 selected.siblings().first().addClass("ob-selected"); 139 } else { 140 selected.next().addClass("ob-selected"); 141 } 142 } 143 } 144 }); 145 $(document).on('click', '.courses-list-search, .courses-search-input', function(event) { 146 event.stopPropagation(); 147 }); 148 $(document).on('click', 'body', function() { 149 if (!$('body').hasClass('course-scroll-remove')) { 150 $('body').addClass('course-scroll-remove'); 151 } 152 }); 153 $(window).scroll(function() { 154 if ($('body').hasClass('course-scroll-remove') && $(".courses-list-search li").length > 0) { 155 $(".courses-searching .courses-list-search").empty(); 156 $(".courses-searching .thim-s").val(''); 157 } 158 }); 159 $(document).on('focus', '.courses-search-input', function() { 160 if ($('body').hasClass('course-scroll-remove')) { 161 $('body').removeClass('course-scroll-remove'); 162 } 163 }); 164 165 166 167 168 });
169 170 171// SEARCH BAR ENDSD HERE
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.