1function convertToUnsign(str) { 2 str = str.replace(/à |á|ạ|ả|ã|â|ầ|ấ|áº|ẩ|ẫ|Ä|ằ|ắ|ặ|ẳ|ẵ/g, "a"); 3 str = str.replace(/è|é|ẹ|ẻ|ẽ|ê|á»|ế|á»|á»|á» /g, "e"); 4 str = str.replace(/ì|Ã|á»|á»|Ä©/g, "i"); 5 str = str.replace(/ò|ó|á»|á»|õ|ô|á»|á»|á»|á»|á»|Æ¡|á»|á»|ợ|á»|ỡ/g, "o"); 6 str = str.replace(/ù|ú|ụ|á»§|Å©|ư|ừ|ứ|á»±|á»|ữ/g, "u"); 7 str = str.replace(/ỳ|ý|ỵ|á»·|ỹ/g, "y"); 8 str = str.replace(/Ä/g, "d"); 9 str = str.replace(/Ã|Ã|Ạ|Ả|Ã|Ã|Ầ|Ấ|Ậ|Ẩ|Ẫ|Ä|Ằ|Ắ|Ặ|Ẳ|Ẵ/g, "A"); 10 str = str.replace(/Ã|Ã|Ẹ|Ẻ|Ẽ|Ã|á»|Ế|á»|á»|á»/g, "E"); 11 str = str.replace(/Ã|Ã|á»|á»|Ĩ/g, "I"); 12 str = str.replace(/Ã|Ã|á»|á»|Ã|Ã|á»|á»|á»|á»|á»|Æ |á»|á»|Ợ|á»|á» /g, "O"); 13 str = str.replace(/Ã|Ã|Ụ|Ủ|Ũ|Ư|Ừ|Ứ|á»°|Ử|á»®/g, "U"); 14 str = str.replace(/Ỳ|Ã|á»´|á»¶|Ỹ/g, "Y"); 15 str = str.replace(/Ä/g, "D"); 16 // Some system encode vietnamese combining accent as individual utf-8 characters 17 // Má»t và i bá» encode coi các dấu mÅ©, dấu chữ như má»t kà tá»± riêng biá»t nên thêm hai dòng nà y 18 str = str.replace(/\u0300|\u0301|\u0303|\u0309|\u0323/g, ""); // Ì Ì Ì Ì Ì£ huyá»n, sắc, ngã, há»i, nặng 19 str = str.replace(/\u02C6|\u0306|\u031B/g, ""); // Ë Ì Ì Ã, Ã, Ä, Æ , Ư 20 // Remove extra spaces 21 // Bá» các khoảng trắng liá»n nhau 22 str = str.replace(/ + /g, " "); 23 str = str.trim(); 24 // Remove punctuations 25 // Bá» dấu câu, kà tá»± Äặc biá»t 26 str = str.replace(/!|@|%|\^|\*|\(|\)|\+|\=|\<|\>|\?|\/|,|\.|\:|\;|\'|\"|\&|\#|\[|\]|~|\$|_|`|-|{|}|\||\\/g, " "); 27 return str; 28} 29function getUrl() { 30 // gen keyword 31 let keyword = $('#search-keyword').val() 32 if (!keyword) { 33 keyword = "viec-lam" 34 } else { 35 keyword = convertToUnsign(keyword).toLowerCase().replace(' ','-') 36 } 37 // category 38 let category = $('#select-business').find(':selected').data('slug') 39 if (!category) { 40 category = '' 41 } else { 42 category = '-' + category 43 } 44 // district 45 let district = $('#select-location').find(':selected').data('slug') 46 if (!district) { 47 district = '' 48 } else { 49 district = '-tai-' + district 50 } 51 // 52 let salary = $('#select-salary').find(':selected').data('slug') 53 if (!salary) { 54 salary = '' 55 } else { 56 salary = '-' + salary 57 } 58 // 59 const url = '/tim-kiem/'+keyword + category + district + salary 60 $('.form-search').attr('action', url) 61} 62$(document).ready(function () { 63 $('#search-keyword').keyup(function (evt) { 64 getUrl() 65 }) 66 $('#select-business').change(function (evt) { 67 getUrl() 68 }) 69 $('#select-location').change(function (evt) { 70 getUrl() 71 }) 72 $('#select-salary').change(function (evt) { 73 getUrl() 74 }) 75 $('.form-search').submit(function (evt) { 76 getUrl() 77 }) 78 $('.order-option').change(function () { 79 const val = $(this).val() 80 window.location.href = val 81 }) 82})
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.