1(function($){ 2 3$(function () { 4 searchWord = function(){ 5 var searchText = $(this).val().toKatakanaCase(), // æ¤ç´¢ããã¯ã¹ã«å ¥åãããå¤åå¾ã»å¤æ 6 targetText; 7 searchText = convertStr(searchText); 8 $('.brand', $(this).closest('.brandSearchWrap')).each(function() { 9 targetText = $.trim($(this).text()); 10 targetText = convertStr(targetText); 11 12 // æ¤ç´¢å¯¾è±¡ã¨ãªããªã¹ãã«å ¥åãããæååãåå¨ãããã©ããã夿 13 if (targetText.toLowerCase().toKatakanaCase().indexOf(searchText.toLowerCase()) != -1) { 14 $(this).removeClass('hidden'); 15 } else { 16 $(this).addClass('hidden'); 17 } 18 }); 19 }; 20 21 // searchWordã®å®è¡ 22 $('.brandSearchKeyword').on('input', searchWord); 23}); 24 25//ã²ãããªâã«ã¿ã«ã夿 26String.prototype.toKatakanaCase = function() { 27 var i, c, a = []; 28 for(i=this.length-1;0<=i;i--) { 29 c = this.charCodeAt(i); 30 a[i] = (0x3041 <= c && c <= 0x3096) ? c + 0x0060 : c; 31 }; 32 return String.fromCharCode.apply(null, a); 33}; 34 35//å ¨è§âåè§å¤æ 36function convertStr(str) { 37 var halfStr = str.replace(/ã/g," ").replace(/[ï¼-ï¼]/g, function(s) { 38 return String.fromCharCode(s.charCodeAt(0)-0xFEE0); 39 }); 40 return halfStr; 41} 42 43 44})(jQuery);
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.