1let Path = { 2 theme: function (path) { 3 if (/^http/.test(path)) return path; 4 if (/^\//.test(path)) return path; 5 return '/' + path; 6 }, 7 translit: function (str) { 8 var ru = { 9 'а': 'a', 'б': 'b', 'в': 'v', 'г': 'g', 'д': 'd', 10 'е': 'e', 'Ñ': 'e', 'ж': 'j', 'з': 'z', 'и': 'i', 'й': 'y', 11 'к': 'k', 'л': 'l', 'м': 'm', 'н': 'n', 'о': 'o', 12 'п': 'p', 'Ñ': 'r', 'Ñ': 's', 'Ñ': 't', 'Ñ': 'u', 13 'Ñ': 'f', 'Ñ ': 'h', 'Ñ': 'c', 'Ñ': 'ch', 'Ñ': 'sh', 14 'Ñ': 'shch', 'Ñ': 'y', 'Ñ': 'e', 'Ñ': 'yu', 'Ñ': 'ya' 15 }, n_str = []; 16 17 str = str.replace(/[ÑÑ]+/g, ''); 18 19 for (var i = 0; i < str.length; ++i) { 20 n_str.push(ru[str[i]] || str[i]); 21 } 22 23 return n_str.join(''); 24 }, 25 encode: function (str, space) //forFS 26 { 27 //ÐпиÑание в php Ñайле 28 29 var conf = Config.get('path'); 30 str = str.replace(/[\+]/g, 'p'); 31 str = str.replace(/[\'\`"\.Ã,â%\*<>\â\-\â\'"\|\;\:\/\\\\#\!\?\$&\s]/g, ' '); 32 if (!conf.parenthesis) str = str.replace(/[\(\)]/g, ' '); 33 34 if (conf.encodelower || conf.translit) str = str.toLowerCase(); 35 if (conf.translit) str = Path.translit(str); 36 37 str = str.replace(/^\s+/g, ''); 38 str = str.replace(/\s+$/g, ''); 39 str = str.replace(/\s+/g, ' '); 40 41 var conf = Config.get('path'); 42 //if (!conf.space) 43 if (!space) str = str.replace(/\s/g, '-'); 44 45 if (!conf.translit && (str.lenght > conf.encodelimit)) console.error('СлиÑком Ð´Ð»Ð¸Ð½Ð½Ð°Ñ ÑÑÑока Path.encode', str); 46 return str; 47 } 48} 49window.Path = Path 50export { Path }
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.