1'use strict'; 2/** 3 * R[|[gTCgONÝèJS 4 * »ÝÌURLÉîâÄAKC_XEVbvÌURLNð®IÉÏXµÜ· 5 * 6 * »ÝÌURLÆAlinkiMap.json Éè`³ê½NæURLðärµÄA 7 * àÁÆàߢè`ðKpµÜ·BY·éà̪©Â©çȯêÎAN/AðèÄÜ·B 8 * 9 */ 10$(function(){ 11 var CURRENT_PATH = (location.hostname + location.pathname).replace(/\.(html|php|shtml|htm)$/, '/').replace('stg-', ''), 12 NA = 'N/A', 13 AJAX_URL = '/common/system/linkSetting/linkMap.json'; 14 15 // è`t@Cðæ¾µANðÝè·é 16 // ¦æ¾É¸sµÄàAG[µ¢É͵Ȣ 17 $.ajax({ 18 url: AJAX_URL, 19 dataType: 'json', 20 cache: false, 21 }) 22 .done(function(result){ 23 // è`îñ 24 var _data = formatData(result), 25 // Næ 26 _link = getLink(CURRENT_PATH, _data), 27 // ià¾ïN 28 _guidanceLink = _link.guidance, 29 // VbvNi¢ÝèÌêÍgbvy[WNðwèj 30 _onlineLink = _link.online ? _link.online : _data[NA].online; 31 32 // ià¾ï 33 $('.gui a, .guiBtn').attr('href', _guidanceLink); 34 // Vbv 35 $('.navOls a, .olsBtn').attr('href', _onlineLink); 36 }); 37 38 /** 39 * è`ÏÝîñÌ®` 40 * 41 * @param {object} orgData ³f[^ 42 * @return {object} ®`ÏÝf[^ 43 */ 44 function formatData(orgData){ 45 var _ret = {}; 46 for(var key in orgData){ 47 if (orgData.hasOwnProperty(key)) { 48 _ret[key] = orgData[key]; 49 } 50 } 51 return _ret; 52 } 53 /** 54 * IuWFNgðõµANæðæ¾·é 55 * 56 * @param {string} path pX 57 * @param {object} data Næè`îñ 58 * @return {string} pXÉRtNæ 59 */ 60 function getLink(path, data){ 61 if(data[path]){ 62 // ià¾ïÌNª¶ÝµÈ¢êA 63 // ãÊpXðõµÄÝè·é 64 data[path].guidance = _getGuidanceLink(path, data); 65 // øÉRtlðÔp 66 return data[path]; 67 } else { 68 // æ¾Å«ÈêÎãÊpXðØèo· 69 var _upperPath = path.substring(0, path.search(/[a-zA-Z0-9- ._?%&=]+\/$/)); 70 if(_upperPath) { 71 // ãÊpXª êÎAÄA·é 72 return getLink(_upperPath, data); 73 } else { 74 // ãÊpXªÈ¯êÎAuYȵvðÔp·é 75 return data[NA]; 76 } 77 } 78 /** 79 * IuWFNgðõµAià¾ïNðæ¾·é 80 * 81 * @param {string} path pX 82 * @param {object} data Næè`îñ 83 * @return {string} pXÉRtià¾ïN 84 */ 85 function _getGuidanceLink(path, data){ 86 if(data[path] && data[path].guidance){ 87 return data[path].guidance; 88 } else { 89 var _upperPath = path.substring(0, path.search(/[a-zA-Z0-9- ._?%&=]+\/$/)); 90 if(_upperPath) { 91 // ãÊpXª êÎAÄA·é 92 return _getGuidanceLink(_upperPath, data); 93 } else { 94 // ãÊpXªÈ¯êÎAuYȵvÌNðÔp·é 95 return data[NA].guidance; 96 } 97 } 98 } 99 } 100});
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.