1// æ·»å çæ°éæ è®° 以å å½åè¡å ç´ æ è®° 2let count = 0 3 4/** 5 * åå§åå¨ææ°æ®è¿½å 彿° 6 * @param e å ç´ å®¹å¨ 7 * @param json { 8 * { 9 * id, title, sendDate, sendId, visibility, dataFSPath, imagesSrc, description, ip 10 * } 11 * } 12 * @param fun ç¹å»æ¤æ°æ®ä¹åçåè°å½æ° (卿çid) => void 13 * @param containAuthor æ¯å¦å å«ä½è ä¿¡æ¯ å¦æä¸å å«å°±åªå±ç¤ºæç« çæ é¢ 14 */ 15function append_data_listBlock(e = document.getElementsByClassName("container")[0], json, fun = undefined, containAuthor = true) { 16 17 // å¼å§è¿è¡å ç´ æå»ºå追å 18 const td = document.createElement("td"); 19 td.className = 'container_td'; 20 const a = document.createElement("a"); 21 a.className = 'container_a'; 22 a.href = '#'; 23 if (fun !== undefined) { 24 a.addEventListener("click", () => fun(json.id)); 25 } 26 // æ¥ç第ä¸ä¸ªå¾æ¯å¦æ¯ä¸ä¸ªå¾å 27 const FM = json.imagesSrc[0]; 28 const split = FM.split('.'); 29 const isVid = split.length > 1 && isVideoName(split[split.length - 1]); 30 const img = document.createElement(isVid ? "video" : "img"); 31 img.className = 'data_image_img_publicize'; 32 img.src = FM; 33 img.title = json.title; 34 img.loading = 'lazy'; 35 imgErrorFun(img); 36 a.appendChild(img); 37 const h3 = document.createElement("h3"); 38 h3.className = 'data_title_h'; 39 h3.innerText = json.title; 40 a.appendChild(h3); 41 const area_span = document.createElement("span"); 42 area_span.innerText = "î§§ " + json.ip 43 area_span.className = "area_span"; 44 area_span.href = 'https://www.baidu.com/s?ie=UTF-8&wd=' + json.ip; 45 if (containAuthor) { 46 const img2 = document.createElement("img"); 47 img2.className = 'headSculpture'; 48 img2.alt = '头å'; 49 imgErrorFun(img2, 'image/logo.svg'); 50 getUserConfById(json.sendId).then( 51 (res) => { 52 let userName; 53 if (res.tempName === undefined) { 54 userName = ":" + json.sendId + ":"; 55 } else { 56 userName = res.tempName[1]; 57 } 58 img2.src = res.headSculpture[1]; 59 a.appendChild(img2); 60 const span = document.createElement("span"); 61 span.className = 'headSculpture_span'; 62 span.innerText = userName; 63 a.appendChild(span); 64 const div2 = document.createElement("div"); 65 div2.className = 'data_create_date'; 66 const dateStr = timeDifference(json['sendDateMs'], -1); 67 div2.innerText = json.sendDate + (dateStr === '' ? '' : `ã${dateStr}åã`); 68 a.appendChild(div2); 69 const pre = document.createElement("pre"); 70 pre.innerText = json.description; 71 a.appendChild(pre); 72 a.appendChild(area_span); 73 } 74 ) 75 } else { 76 a.appendChild(area_span); 77 } 78 td.appendChild(a); 79 e.appendChild(td); 80} 81 82/** 83 * æ·»å ä¸ä¸ªææ¬å 84 * @param e éè¦è¢«æ·»å ç容å¨å ç´ 85 * @param textData ææ¬åä¸çææ¬æ°æ® 86 * @param blockColor ææ¬åçé¢è² 87 * @param fun ç¹å»ä¹åç彿° å¦ææ²¡æå¯ä»¥ä¸è¿è¡è®¾ç½® 88 * @param subE åæ ç¾å ç´ ä¹å°±æ¯ææ¬æ°æ®æ ç¾çåæ ç¾ é»è®¤ä¸º undefined 代表没æåå ç´ å¦æéè¦è®¾ç½®å¨è¿éåè¿è¡è®¾ç½® 89 * @param subForward 代表çå°±æ¯åå ç´ æ ç¾çä½ç½®ï¼å¦ææ¤å¼ä¸º true å代表åå ç´ æ ç¾å°ä¼è¢«æ·»å å°æåé¢ é»è®¤ä¸º false 代表åå ç´ æ ç¾å°ä¼è¢«æ·»å å°æå 90 * @param textStyle ææ¬åçæ ·å¼ æä»¬å 许å¤çè®¾ç½®ææ¬æ ·å¼ 91 */ 92function addTextBlock(e, textData, blockColor, fun = undefined, subE = undefined, subForward = false, textStyle = {}) { 93 // è®¾ç½®å¨æè¿½å æ°æ®è¡ç json 94 const a = document.createElement("a"); 95 if (subForward && subE !== undefined) { 96 a.appendChild(subE); 97 } 98 // ä½¿ç¨ææ¬èç¹è䏿¯ innerText æ¥é¿å ç§»é¤å·²æåèç¹ 99 const textNode = document.createElement("span"); 100 textNode.innerText = textData; 101 textNode.style.color = 'inherit'; 102 for (const key in textStyle) { 103 textNode.style[key] = textStyle[key]; 104 } 105 a.appendChild(textNode); // åæ·»å ææ¬ 106 a.className = 'container_a topicName_a'; 107 a.style.display = 'inline-block'; 108 a.style.width = '100%'; 109 a.style.height = '100%'; 110 a.href = '#'; 111 a.style.fontFamily = '"Arial Black", sans-serif, serif'; 112 a.style.textAlign = 'center'; 113 a.style.color = invertColor(blockColor); 114 a.style.fontFamily = 'inherit'; 115 if (!subForward && subE !== undefined) { 116 a.appendChild(subE); 117 } 118 const td = document.createElement("td"); 119 td.className = 'container_td'; 120 td.style.background = blockColor; 121 if (fun !== undefined) { 122 td.onclick = fun 123 } 124 td.appendChild(a) 125 return td; 126}
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.