1var fillMap = {}; 2var fillIsVoice = true; 3 4function getChineseFirstLetter(str) { 5 var pinyin = ''; 6 for (var i = 0; i < str.length; i++) { 7 var char = str.charAt(i); 8 var charCode = char.charCodeAt(0); 9 if (charCode >= 0 && charCode <= 128) { 10 pinyin += char; 11 } else { 12 pinyin += convertToFirstLetter(char); 13 } 14 } 15 return pinyin; 16} 17 18function convertToFirstLetter(char) { 19 var firstLetter = ''; 20 var pinyin = new Pinyin(); 21 if (pinyinDict[char]) { 22 firstLetter = pinyinDict[char].substring(0, 1); 23 } 24 return firstLetter; 25} 26function redKeyWord(data) { 27 console.log(data); 28 var html = ""; 29 var keyWord = $("#keyWord").val().trim(); 30 keyWord = keyWord.replace(/\s/g, ""); 31 var fillMapTemp = {}; 32 jQuery.each(data.result.fillQuestions, function (i, item) { 33 var _questionAll = item.knTitle.replace(/\n/g, "<br>").replace(/\r/g, "<br>"); 34 fillMapTemp[_questionAll] = item; 35 var text = _questionAll; 36 var outStr = ""; 37 for (var j = 0; j < text.length; j++) { 38 var each = text.substr(j, 1); 39 var isCharInKeyword = keyWord.indexOf(each) != -1; 40 if (isCharInKeyword) { 41 outStr += "<span style='color: #2e89e1;'>" + each + "</span>" 42 } else { 43 if (data.result.matchSentence.indexOf(each)!=-1) { 44 outStr += "<span style='color: #2e89e1;'>" + each + "</span>" 45 }else{ 46 outStr += each; 47 } 48 } 49 } 50 51 if(braceMatch(item.content)) 52 { 53 html += " <li onclick=\"fillToIframe(\'" + _questionAll + "\',1)\" style='cursor: pointer;' > " + outStr + "</li>" 54 }else{ 55 html += " <li onclick=\"fillToTextarea(\'" + _questionAll + "\')\" style='cursor: pointer;' > " + outStr + "</li>" 56 } 57 }); 58 // fillMap = Object.assign({}, fillMapTemp); 59 fillMap = JSON.parse(JSON.stringify(fillMapTemp)); 60 61 if ($("#keyWord").val()) { 62 $("#completionQues").html(html); 63 index = -1; 64 size = $("#completionQues").find("li").length; 65 if (size > 0) { 66 $("#tc_Big_box").show(); 67 $("#textTag").show(); 68 } else { 69 $("#tc_Big_box").hide(); 70 $("#textTag").hide(); 71 } 72 } 73} 74 75//çæ¿åºè¡¥å ¨é®é¢ï¼å 嫿®éé®çãç«æ é®çï¼ 76function redKeyWord2(data, windowNum) { 77 var html = ""; 78 var keyWord = $("#keyWord"+windowNum).val().trim(); 79 keyWord = keyWord.replace(/\s/g, ""); 80 var fillMapTemp = {}; 81 jQuery.each(data.result.fillQuestions, function (i, item) { 82 var _questionAll = item.knTitle.replace(/\n/g, "<br>").replace(/\r/g, "<br>"); 83 fillMapTemp[_questionAll] = item; 84 var text = _questionAll; 85 var outStr = ""; 86 for (var j = 0; j < text.length; j++) { 87 var each = text.substr(j, 1); 88 if (keyWord.indexOf(each) != -1) { 89 outStr += "<span style='color: #2e89e1;'>" + each + "</span>" 90 } else { 91 outStr += each; 92 } 93 } 94 if(braceMatch(item.content)) 95 { 96 html += " <li onclick=\"fillToIframe(\'" + _questionAll + "\',1)\" style='cursor: pointer;' > " + outStr + "</li>" 97 }else{ 98 html += " <li onclick=\"fillToTextarea(\'" + _questionAll + "\')\" style='cursor: pointer;' > " + outStr + "</li>" 99 } 100 101 102 }); 103 // fillMap = Object.assign({}, fillMapTemp); 104 fillMap = JSON.parse(JSON.stringify(fillMapTemp)); 105 106 if ($("#keyWord"+windowNum).val()) { 107 $("#completionQues"+windowNum).html(html); 108 index = -1; 109 size = $("#completionQues"+windowNum).find("li").length; 110 if (size > 0) { 111 // $("#tc_Big_box").show(); 112 $("#textTag"+windowNum).show(); 113 } else { 114 // $("#tc_Big_box").hide(); 115 $("#textTag"+windowNum).hide(); 116 } 117 } 118} 119 120 121/** 122 * å¹é iframeæ ç¾ åå¨iframeUuidå¼ 123 * 124 * return @Parame true å¹é å° false æªéè¿å¹é 125 */ 126 function braceMatch(result) 127 { 128 var str1=false; 129 130 if(result!="" && result.indexOf("iframeUuid")!=-1 && result.indexOf("iframe")!=-1) 131 { 132 str1= true; 133 } 134 return str1; 135 } 136//é设iframe é«åº¦ 137function setIframeHeight(iframe) { 138 if (iframe) { 139 // è·¨å请æ±
140 var iframeSrc = iframe.src; 141 var iframeDomain = iframeSrc.split(/\/+/); 142 var domain = window.location.host; 143 var iframeWin = iframe.contentWindow; 144 // è·¨å夿 145 if(iframeDomain[1] && domain != iframeDomain[1] || (iframeDomain[0] != window.location.protocol && domain == iframeDomain[1])) { 146 iframeWin.postMessage('getHeight', '*') 147 window.onmessage = function(e) { 148 var obj = e.data; 149 iframe.height = obj.height; 150 } 151 } else { 152 if (iframeWin && iframeWin.document && iframeWin.document.body) { 153 // iframe.height = iframeWin.document.body.scrollHeight+10; 154 iframe.height = iframeWin.document.body.scrollHeight; 155 } 156 } 157 158 } 159 }; 160// iframe 宿¶ä»»å¡ 161function setIframeCheck(iframe){ 162 (function () { 163 setInterval(function () { 164 setIframeHeight(iframe); 165 }, 200) 166 })(iframe) 167} 168function setCheck(){ 169 $(".flexiframe").each(function (index) {//iframeå ¬ç¨ç±»åï¼flexiframe 170 var that = $(this); 171 (function () { 172 setInterval(function () { 173 setIframeHeight(that[0]) 174 }, 200) 175 })(that) 176 }); 177} 178// 对Dateçæ©å±ï¼å° Date 转å为æå®æ ¼å¼çString 179// æ(M)ãæ¥(d)ãå°æ¶(h)ãå(m)ãç§(s)ãå£åº¦(q) å¯ä»¥ç¨ 1-2 个å ä½ç¬¦ï¼ 180// å¹´(y)å¯ä»¥ç¨ 1-4 个å ä½ç¬¦ï¼æ¯«ç§(S)åªè½ç¨ 1 个å ä½ç¬¦(æ¯ 1-3 ä½çæ°å) 181// ä¾åï¼ 182// (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423 183// (new Date()).Format("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18 184/** 185 * å®ä¾ 186 * 187//ä½¿ç¨æ¹æ³ 188var now = new Date(); 189var nowStr = now.format("yyyy-MM-dd hh:mm:ss"); 190//ä½¿ç¨æ¹æ³2: 191var testDate = new Date(); 192var testStr = testDate.format("YYYYå¹´MMæddæ¥hhå°æ¶mmåssç§"); 193alert(testStr); 194//示ä¾ï¼ 195alert(new Date().format("yyyyå¹´MMæddæ¥")); 196alert(new Date().format("MM/dd/yyyy"));
197alert(new Date().format("yyyyMMdd")); 198alert(new Date().format("yyyy-MM-dd hh:mm:ss")); 199 */ 200Date.prototype.Format = function(fmt) 201{ //author: meizz 202 var o = { 203 "M+" : this.getMonth()+1, //æä»½ 204 "d+" : this.getDate(), //æ¥ 205 "h+" : this.getHours(), //å°æ¶ 206 "m+" : this.getMinutes(), //å 207 "s+" : this.getSeconds(), //ç§ 208 "q+" : Math.floor((this.getMonth()+3)/3), //å£åº¦ 209 "S" : this.getMilliseconds() //æ¯«ç§ 210 }; 211 if(/(y+)/.test(fmt)) 212 fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length)); 213 for(var k in o) 214 if(new RegExp("("+ k +")").test(fmt)) 215 fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length))); 216 return fmt; 217} 218 219function videoShow(uu) 220{ 221 var vcls=$("#"+uu).closest(".znwd_con3").find(".vclsplay"); 222 223 if(vcls.length>0) 224 { 225 var vsource=vcls.find("source").attr("src"); 226 //èªå¨ææ¾ 227 vcls[0].play(); 228 vcls.unbind("ended").bind("ended",function(){ 229 //éæ°å è½½èµæºï¼è¾¾å°å°é¢çææ 230 $(this).css("display","block"); 231 $(this).attr("src",vsource); 232 }) 233 } 234 235 236} 237//è·åurlåæ° 238function getUrlParams(name) { 239 var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); 240 var r = window.location.search.substr(1).match(reg); 241 if (r != null) return unescape(r[2]); 242 return null; 243}
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.