1/*! fu_Accessibility v1.2 | 2019 | johnnyyang */ 2window.addEventListener('load', function () { 3 //Table è£IDãHeaders 4 var $page_content, th_col, th_row, col_count, col, row, $td, $th; 5 //if (0 < $("table").length) { 6 // var $table = $("table"); 7 // for (i = 0; i < $table.length; i++) 8 // if (void 0 == $table.eq(i).attr("id") && $table.eq(i).attr("id", "table_" + i), $th = $table.eq(i).find("th"), 0 == $th.length) 9 // for ($td = $table.eq(i).find("td"), j = 0; j < $td.length; j++) 10 // if (row = $td.eq(j).parent().index() + 1, col = $td.eq(j).index() + 1, col_count = 0, 1 == row) void 0 == $td.eq(j).attr("id") && $td.eq(j).attr("id", "table_" + i + "_" + j); 11 // else 12 // for (k = 0; k < $td.length; k++) { 13 // var td_row = $td.eq(k).parent().index() + 14 // 1, 15 // td_col = $td.eq(k).index() + 1; 16 // 1 == td_row && (col_count = void 0 == $td.eq(k).attr("colspan") ? Number(col_count) + Number(1) : Number(col_count) + Number($td.eq(k).attr("colspan"))); 17 // if (col_count >= col) { 18 // void 0 == $td.eq(j).attr("headers") && $td.eq(j).attr("headers", $td.eq(k).attr("id")); 19 // break 20 // } 21 // } else { 22 // void 0 == $table.eq(i).attr("id") && $table.eq(i).attr("id", "table_" + i); 23 // $th = $table.eq(i).find("th"); 24 // for (j = 0; j < $th.length; j++) void 0 == $th.eq(j).attr("id") && $th.eq(j).attr("id", "table_" + i + "_" + j); 25 // $td = $table.eq(i).find("td"); 26 // for (k = 27 // 0; k < $td.length; k++) { 28 // row = $td.eq(k).parent().index() + 1; 29 // col = $td.eq(k).index() + 1; 30 // var row_count = 0; 31 // for (l = col_count = 0; l < $th.length; l++) 32 // if (th_row = $th.eq(l).parent().index() + 1, th_col = $th.eq(l).index() + 1, 1 == th_row && (col_count = void 0 == $th.eq(l).attr("colspan") ? Number(col_count) + Number(1) : Number(col_count) + Number($th.eq(l).attr("colspan"))), col_count >= col) { 33 // void 0 == $td.eq(k).attr("headers") && $td.eq(k).attr("headers", $th.eq(l).attr("id")); 34 // break 35 // } 36 // for (l = 0; l < $th.length; l++) 37 // if (th_row = $th.eq(l).parent().index() + 1, th_col = 38 // $th.eq(l).index() + 1, 1 == th_col && (row_count = void 0 == $th.eq(l).attr("rowspan") ? Number(row_count) + Number(1) : Number(row_count) + Number($th.eq(l).attr("rowspan"))), row_count >= row) { 39 // var rowheaders = $td.eq(k).attr("headers"); 40 // void 0 == rowheaders ? void 0 == $td.eq(k).attr("headers") && $td.eq(k).attr("headers", $th.eq(l).attr("id")) : (rowheaders = rowheaders + " " + $th.eq(l).attr("id"), void 0 == $td.eq(k).attr("headers") && $td.eq(k).attr("headers", rowheaders)); 41 // break 42 // } 43 // } 44 // } 45 //} 46 47 48 var New_Windows_Title = "[å¦éæ°è¦çª]", New_Windows_LanguageSN = 12; 49 //åå¾èªç³» 50 function GetLanguage() { 51 try { 52 var domain = window.location.pathname.toLowerCase(); 53 if (domain.indexOf("/english") == -1 && domain.indexOf("/en") == -1) New_Windows_LanguageSN = 1; 54 else New_Windows_LanguageSN = 2 55 } catch (b) { 56 New_Windows_LanguageSN = 1 57 } 58 New_Windows_Title = 1 == New_Windows_LanguageSN ? "[å¦éæ°è¦çª]" : "[open a new window]" 59 } 60 GetLanguage(); 61 62 //夿·å¦éæ°è¦çªé輯 63 function CheckIndex(b) { 64 var a = b.indexOf("éå"); 65 if (-1 != a) return a; 66 var a = b.indexOf("è¦çª"); 67 if (-1 != a) return a; 68 a = b.indexOf("åé "); 69 if (-1 != a) return a; 70 a = b.indexOf("å¦é"); 71 if (-1 != a) return a; 72 a = b.indexOf("æ°çª"); 73 if (-1 != a) return a; 74 a = b.indexOf("new window"); 75 return -1 != a ? a : a = b.indexOf("window") 76 } 77 78 79 var h2value = $('title').html().trim(); 80 if (h2value == null || h2value == '' || h2value.length == 0) { 81 h2value = 'æ¨é¡é ç®'; 82 } 83 84 //æ²æåæ¨é¡çå°±å æ¨é¡ 85 $("img:not([alt])").each(function (index) { 86 $(this).attr("alt", h2value + "_" + index); 87 });
88 //妿æ¯null å°±å代çºç©ºå¼ 89 $("img[alt='null'], img[alt='Null'], img[alt='NULL'] , img[alt=' ']").each(function (index) { 90 $(this).attr("alt", ''); 91 }); 92 93 //æª¢æ¥ææé£çµ 94 $('a').each(function (index) { 95 //å å ¥title 96 var $atitle = $(this).attr('title'); 97 var titlevalue = ''; 98 if ($atitle == undefined || $atitle.length == 0) { 99 if ($(this).children().length > 0) { 100 titlevalue = $(this).text(); 101 if (titlevalue == '') titlevalue = h2value + "_" + index; 102 if (titlevalue == '') titlevalue = ' '; 103 } 104 else if ($(this).children().length == 0 && $(this).text() != '') { 105 titlevalue = $(this).text(); 106 } 107 else { 108 titlevalue = h2value + "_" + index; 109 } 110 if (titlevalue.trim() == '' && $(this).attr('name') != undefined) titlevalue = $(this).attr('name'); 111 $(this).attr('title', titlevalue.trim()); 112 } 113 114 //空<a>è£å §å®¹ 115 if ($(this).text() == '' && $(this).children().length == 0) { 116 $(this).append('<p style="font-size:0em; opacity:0;">' + DOMPurify.sanitize($(this).attr('title')) + '</p>'); 117 } 118 var domain = window.location.origin.toLowerCase(); 119 120 //å¤é£ç¶²åè£ target 121 if ($(this).attr('href') != null && $(this).attr('href').toLowerCase().startsWith('http') && $(this).attr('href').indexOf(domain) == -1 && $(this).attr('href') != '#') { 122 $(this).attr('target', "_blank"); 123 $(this).attr('rel', "noopener noreferrer"); 124 } 125 126 //æª¢æ¥æ¯å¦å å ¥æ°è¦çª 127 if ($(this).attr('target') == "_blank" && $(this).attr('data-noblank') != '1') { 128 if (CheckIndex($(this).attr('title')) == -1) { 129 $(this).attr('title', New_Windows_Title + $(this).attr('title')); 130 } 131 } 132 133 // <a> æ¨ç±¤å §ä¹ IMG æ¿ä»£æåçºç©ºå³å¯ (é輯:<a>å §æåçä¸åç¯é»>1orææå說ææï¼IMG乿¿ä»£æåçºç©º) 134 //if ($(this).find('img') != null && ($(this).children().length > 1) || $(this).text().trim() != '') { 135 // $(this).find('img').attr('alt', ''); 136 //} 137 138 139 ////<a>çé£çµå¼·è½https 140 //if ($(this).attr('ishttp') == undefined && $(this).attr('href') != null && $(this).attr('href').toLowerCase().startsWith('http') && !$(this).attr('href').toLowerCase().startsWith('https')) { 141 // var $href = $(this).attr('href'); 142 // $(this).attr('href', 'https' + $href.substring(4)); 143 //} 144 145 });//使 a contenté½å¡å ¥çä¸å°çæ±è¥¿ != empty 146 147 //妿æonkeypressé²è¡ç§»é¤ 148 $("a[onkeypress]").each(function (index) { 149 $(this).removeAttr("onkeypress"); 150 }); 151 152 //åå ±åé¡é±è 153 $(".btn-tool.btn-problem").each(function (index) { 154 $(this).attr("style", "display:none"); 155 }); 156 157 //ç§»é¤æ²ç¨çè¡åççh4 é ç®(æé²ç¤ç¡å¸³ç¤) 158 $('.base-mobile .search .in .hd .in h4').remove(); 159 160 //æ²æiframeæ²ææ¨é¡çå°±å æ¨é¡ 161 $("iframe").each(function (index) { 162 var title = 'å½±é³'; 163 //console.log($(this).attr("src")); 164 if ($('div[class="photoandtext"] h4').html() != "") title = $('div[class="photoandtext"] h4').html(); 165 if ($(this).attr("title") == null) $(this).attr("title", title); 166 //if ($(this).attr("title") == null && title == null && $(this).attr("src") != null && ($(this).attr("src").indexOf("youtu") > -1)) $(this).attr("title", 'youtube'); 167 if ($(this).attr("title") == null && title == null && $(this).attr("data-src") != null && ($(this).attr("data-src").indexOf("youtu") > -1)) $(this).attr("title", 'youtube'); 168 if ($(this).attr("title") == null && title == null && $(this).attr("data-src") != null && ($(this).attr("data-src").indexOf("Frame_PublicHearing") > -1)) $(this).attr("title", 'å ¬è½æ'); 169 if ($(this).attr("title") == null && title == null && $(this).attr("data-src") != null && ($(this).attr("data-src").indexOf("Frame_LiveVideo") > -1)) $(this).attr("title", 'è°æç´æ'); 170 if ($(this).attr("title") == null && title == null && $(this).attr("data-src") != null && ($(this).attr("data-src").indexOf("IframeDetail") > -1)) $(this).attr("title", 'æ¬æå°å'); 171 if ($(this).attr("title") == null && title == null) $(this).attr("title", 'Map'); 172 });
173 174 //<font>å代æ<span> 175 //$('font').each(function () { 176 // $(this).replaceWith('<span>' + $(this).html() + '</span>'); 177 //}); 178 179 180 181 182 //<center>å代æ<span> 183 //$('center').each(function () { 184 // $(this).replaceWith('<span style="text-align:center;">' + $(this).html() + '</span>'); 185 //}); 186 187 188 189 190 //attr 嫿 colspan è£ä¸scope 191 $('[colspan]').eq(0).attr('scope', 'col'); 192 193 //attr 嫿 rowspan è£ä¸scope 194 $('[rowspan]').eq(0).attr('scope', 'row'); 195 196 $('style[id*="isPasted"]').html(''); 197 198 //å §å®¹å px to em é è¨ 16px = 1em 199 function pxtoem(x) { 200 var y = 16; //é è¨ 16px = 1em 201 var result = "0"; 202 if (x) { 203 result = x / y; 204 } 205 var size = Math.pow(10, 4); 206 result = Math.round(result * size) / size; 207 result = result + "em"; 208 return result; 209 } 210 211 function checkstyle(x) { 212 return /font-size[\s]*:[^;]+px/.test(x); 213 } 214 215 //<span>å §ä¹ style font-size pxâem 216 if (0 < $("span").length) { 217 var $span = $("span"); 218 for (i = 0; i < $span.length; i++) { 219 if ($span.eq(i).attr('style') != null && $span.eq(i).attr('style').toLowerCase().indexOf('font-size') != -1 && checkstyle($span.eq(i).attr('style').toLowerCase())) { 220 var px = $span.eq(i).css('font-size').toLowerCase().replace('px', ''); 221 var em = pxtoem(px); 222 if (em != "0") $span.eq(i).css('font-size', em); 223 } 224 } 225 } 226 227 //<p>å §ä¹ style font-size pxâem 228 if (0 < $("p").length) { 229 var $p = $("p"); 230 for (i = 0; i < $p.length; i++) { 231 if ($p.eq(i).attr('style') != null && $p.eq(i).attr('style').toLowerCase().indexOf('font-size') != -1 && checkstyle($p.eq(i).attr('style').toLowerCase())) { 232 var px = $p.eq(i).css('font-size').toLowerCase().replace('px', ''); 233 var em = pxtoem(px); 234 if (em != "0") $p.eq(i).css('font-size', em); 235 } 236 } 237 } 238 239 //<div>å §ä¹ style font-size pxâem 240 if (0 < $("div").length) { 241 var $p = $("div"); 242 for (i = 0; i < $p.length; i++) { 243 if ($p.eq(i).attr('style') != null && $p.eq(i).attr('style').toLowerCase().indexOf('font-size') != -1 && checkstyle($p.eq(i).attr('style').toLowerCase())) { 244 var px = $p.eq(i).css('font-size').toLowerCase().replace('px', ''); 245 var em = pxtoem(px); 246 if (em != "0") $p.eq(i).css('font-size', em); 247 } 248 } 249 } 250 251 //<a>å §ä¹ style font-size pxâem 252 if (0 < $("a").length) { 253 var $p = $("a"); 254 for (i = 0; i < $p.length; i++) { 255 if ($p.eq(i).attr('style') != null && $p.eq(i).attr('style').toLowerCase().indexOf('font-size') != -1 && checkstyle($p.eq(i).attr('style').toLowerCase())) { 256 var px = $p.eq(i).css('font-size').toLowerCase().replace('px', ''); 257 var em = pxtoem(px); 258 if (em != "0") $p.eq(i).css('font-size', em); 259 } 260 } 261 } 262 263 //ä¸åè«èªè¡ç¢ºèªæ¯å¦ä½¿ç¨ 264 //<ul>å §ä¹ style font-size pxâem 265 if (0 < $("ul").length) { 266 var $p = $("ul"); 267 for (i = 0; i < $p.length; i++) { 268 if ($p.eq(i).attr('style') != null && $p.eq(i).attr('style').toLowerCase().indexOf('font-size') != -1 && checkstyle($p.eq(i).attr('style').toLowerCase())) { 269 var px = $p.eq(i).css('font-size').toLowerCase().replace('px', ''); 270 var em = pxtoem(px); 271 if (em != "0") $p.eq(i).css('font-size', em); 272 } 273 } 274 } 275 //<li>å §ä¹ style font-size pxâem 276 if (0 < $("li").length) { 277 var $p = $("li"); 278 for (i = 0; i < $p.length; i++) { 279 if ($p.eq(i).attr('style') != null && $p.eq(i).attr('style').toLowerCase().indexOf('font-size') != -1 && checkstyle($p.eq(i).attr('style').toLowerCase())) { 280 var px = $p.eq(i).css('font-size').toLowerCase().replace('px', ''); 281 var em = pxtoem(px); 282 if (em != "0") $p.eq(i).css('font-size', em); 283 } 284 } 285 } 286 //<dd>å §ä¹ style font-size pxâem 287 if (0 < $("dd").length) { 288 var $p = $("dd"); 289 for (i = 0; i < $p.length; i++) { 290 if ($p.eq(i).attr('style') != null && $p.eq(i).attr('style').toLowerCase().indexOf('font-size') != -1 && checkstyle($p.eq(i).attr('style').toLowerCase())) { 291 var px = $p.eq(i).css('font-size').toLowerCase().replace('px', ''); 292 var em = pxtoem(px); 293 if (em != "0") $p.eq(i).css('font-size', em); 294 } 295 } 296 } 297 //<dt>å §ä¹ style font-size pxâem 298 if (0 < $("dt").length) { 299 var $p = $("dt"); 300 for (i = 0; i < $p.length; i++) { 301 if ($p.eq(i).attr('style') != null && $p.eq(i).attr('style').toLowerCase().indexOf('font-size') != -1 && checkstyle($p.eq(i).attr('style').toLowerCase())) { 302 var px = $p.eq(i).css('font-size').toLowerCase().replace('px', ''); 303 var em = pxtoem(px); 304 if (em != "0") $p.eq(i).css('font-size', em); 305 } 306 } 307 } 308 //<br>å §ä¹ style font-size pxâem 309 if (0 < $("br").length) { 310 var $p = $("br"); 311 for (i = 0; i < $p.length; i++) { 312 if ($p.eq(i).attr('style') != null && $p.eq(i).attr('style').toLowerCase().indexOf('font-size') != -1 && checkstyle($p.eq(i).attr('style').toLowerCase())) { 313 var px = $p.eq(i).css('font-size').toLowerCase().replace('px', ''); 314 var em = pxtoem(px); 315 if (em != "0") $p.eq(i).css('font-size', em); 316 } 317 } 318 } 319 //<blockquote>å §ä¹ style font-size pxâem 320 if (0 < $("blockquote").length) { 321 var $p = $("blockquote"); 322 for (i = 0; i < $p.length; i++) { 323 if ($p.eq(i).attr('style') != null && $p.eq(i).attr('style').toLowerCase().indexOf('font-size') != -1 && checkstyle($p.eq(i).attr('style').toLowerCase())) { 324 var px = $p.eq(i).css('font-size').toLowerCase().replace('px', ''); 325 var em = pxtoem(px); 326 if (em != "0") $p.eq(i).css('font-size', em); 327 } 328 } 329 } 330 331 //<th>å §ä¹ style font-size pxâem 332 if (0 < $("th").length) { 333 var $p = $("th"); 334 for (i = 0; i < $p.length; i++) { 335 if ($p.eq(i).attr('style') != null && $p.eq(i).attr('style').toLowerCase().indexOf('font-size') != -1 && checkstyle($p.eq(i).attr('style').toLowerCase())) { 336 var px = $p.eq(i).css('font-size').toLowerCase().replace('px', ''); 337 var em = pxtoem(px); 338 if (em != "0") $p.eq(i).css('font-size', em); 339 } 340 } 341 } 342 343 //<pre>å §ä¹ style font-size pxâem 344 if (0 < $("pre").length) { 345 var $p = $("pre"); 346 for (i = 0; i < $p.length; i++) { 347 if ($p.eq(i).attr('style') != null && $p.eq(i).attr('style').toLowerCase().indexOf('font-size') != -1 && checkstyle($p.eq(i).attr('style').toLowerCase())) { 348 var px = $p.eq(i).css('font-size').toLowerCase().replace('px', ''); 349 var em = pxtoem(px); 350 if (em != "0") $p.eq(i).css('font-size', em); 351 } 352 } 353 } 354 355 //<style>å §ä¹ font-size éæ¿¾ 356 //if (0 < $("style").length) { 357 // var $p = $("style"); 358 // for (i = 0; i < $p.length; i++) { 359 // $p.eq(i).html($p.eq(i).html().replace(/font-size:.*?px/g, '')) 360 // } 361 //} 362 363 //æªæ¡è½æª(Temp) 364 $(".base-section > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) a").each(function () { 365 var a = DOMPurify.sanitize($(this).attr("href")); 366 if (null != a && -1 != a.indexOf('http')) 367 for (var c = ["doc", "xls", "ppt"], b = c.length - 1; 0 <= b; b--) - 1 != a.indexOf(c[b]) && $(".page-content > div:nth-child(1) > div:nth-child(1) > div:nth-child(1)").append('<a href="' + a.replace('docx', 'pdf').replace('doc', 'pdf').replace('xlsx', 'pdf').replace('xls', 'pdf').replace('pptx', 'pdf').replace('ppt', 'pdf') + '" style="font-size: 0em; opacity:0;">' + DOMPurify.sanitize($(this).text()) + "</a>") 368 });
vendor: 3 bytes, line 369
369});
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.