1$(function(){ 2 $(".listTable li").each(function(){ 3 var bshare_url = $(this).find(".share-box").attr("data-url"); 4 var bshare_title =$(this).find(".share-box").attr("data-title"); 5 var share_urls = 'https://service.weibo.com/share/share.php?type=4&site=sinaminiblog&url='+location.origin+''+ bshare_url + '&title=' + encodeURIComponent(bshare_title); 6 $(this).find("a.bds_tsina").off("click"); 7 8 $(this).find("a.bds_tsina").attr('href', share_urls) 9 10 $(this).find("a.bds_tsina").click(function(){ 11window.open(share_urls) 12 }); 13 }) ; 14 15 var os = function(){ 16 var ua = navigator.userAgent, 17 isWindowsPhone = /(?:Windows Phone)/.test(ua), 18 isSymbian = /(?:SymbianOS)/.test(ua) || isWindowsPhone, 19 isAndroid = /(?:Android)/.test(ua), 20 isFireFox = /(?:Firefox)/.test(ua), 21 isChrome = /(?:Chrome|CriOS)/.test(ua), 22 isTablet = /(?:iPad|PlayBook)/.test(ua) || (isAndroid && !/(?:Mobile)/.test(ua)) || (isFireFox && /(?:Tablet)/.test(ua)), 23 isPhone = /(?:iPhone)/.test(ua) && !isTablet, 24 isPc = !isPhone && !isAndroid && !isSymbian; 25 return { 26 isTablet: isTablet, 27 isPhone: isPhone, 28 isAndroid : isAndroid, 29 isPc : isPc 30 }; 31 }(); 32 33 /*主大å¾åæ¢*/ 34 $(".mbanner .focus").sudyfocus({ 35 p:2, 36 zWidth:1920, 37 zHeight:825, 38 title:{ 39 isAutoWidth: true, 40 active:true, 41 href: true 42 }, 43 text:{ 44 active: false, 45 isAutoHeight: false, 46 href: false 47 }, 48 response: true, 49 speed:700, 50 pagination: true, 51 navigation: true, 52 isNavHover: false, 53 href:true, 54 effect: 'fade' 55 }); 56 57 /*ä¸é¢ç½ç«tab忢*/ 58 $(".main .post-32").sudyTab({ 59 handle:".news_con .news_title", 60 content:".news_imgs a", 61 trigger:"mouseenter", 62 start:1, 63 autoPlay:{
64 active:false 65 } 66 }); 67 68 /*åæ é¾æ¥ä¸æ*/ 69 $(".botlinks").each(function(index, el){ 70 $(el).find(".links-wrap").hover(function(){ 71 $(this).addClass('wrap-open').children('.link-items').stop(true,true).slideDown(300); 72 },function(){ 73 $(this).removeClass('wrap-open').children('.link-items').stop(true,true).slideUp(100); 74 }); 75 }); 76 77 $(".main .post-21").find(".news").each(function(){ 78 var times = $(this).find(".news_date").data("times").split("-"); 79 $(this).find(".news_year").text(times[2]); 80 $(this).find(".news_days").text(getMonthEN(times[1])); 81 //$(this).find(".news_days").text(getMonthEN(marth).slice(0,3)); 82 }); 83 84 function getMonthEN(n){ 85 var num = parseInt(n, 10), 86 month = ""; 87 if (num == 1) { 88 month = "January" 89 } 90 if (num == 2) { 91 month = "February" 92 } 93 if (num == 3) { 94 month = "March" 95 } 96 if (num == 4) { 97 month = "April" 98 } 99 if (num == 5) { 100 month = "May" 101 } 102 if (num == 6) { 103 month = "June" 104 } 105 if (num == 7) { 106 month = "July" 107 } 108 if (num == 8) { 109 month = "August" 110 } 111 if (num == 9) { 112 month = "September" 113 } 114 if (num == 10) { 115 month = "October" 116 } 117 if (num == 11) { 118 month = "November" 119 } 120 if (num == 12) { 121 month = "December" 122 } 123 return month; 124 } 125 /*夿¦ç¾ç§*/ 126 if(os.isAndroid || os.isPhone || os.isTablet){ 127 var $box = $(".main .post-41").find(".boxm"); 128 $(".main .post-41").sudyTab({ 129 handle:".tit .title", 130 content:".con .boxm,.more_btn .more_text", 131 trigger:"click", 132 start:1, 133 autoPlay:{
134 active:false 135 }, 136 callback:function(index){ 137 $box.eq(index).find(".news_conbox .news_list").slick({ 138 dots: false, 139 infinite: true, 140 autoplay:false, 141 slide: 'li', 142 slidesToShow:1, 143 slidesToScroll:1, 144 responsive: [ 145 { 146 breakpoint: 999, 147 settings: { 148 slide: 'li', 149 slidesToShow: 1, 150 slidesToScroll: 1 151 } 152 }, 153 { 154 breakpoint: 600, 155 settings: { 156 slide: 'li', 157 slidesToShow:1, 158 slidesToScroll: 1 159 } 160 } 161 ] 162 163 }); 164 } 165 }); 166 }else{ 167 var $box = $(".main .post-41").find(".boxm"); 168 $(".main .post-41").sudyTab({ 169 handle:".tit .title", 170 content:".con .boxm,.more_btn .more_text", 171 trigger:"click", 172 start:1, 173 autoPlay:{ 174 active:false 175 }, 176 callback:function(index){ 177 //$box.eq(index).find(".news_conbox").unslick(); 178 $box.eq(index).find(".news_conbox").slick({ 179 dots: false, 180 infinite: true, 181 autoplay:false, 182 slide: 'div.news_con', 183 slidesToShow:1, 184 slidesToScroll:1, 185 responsive: [ 186 { 187 breakpoint: 1170, 188 settings: { 189 slide: 'div.news_con', 190 slidesToShow: 1, 191 slidesToScroll: 1, 192 infinite: true 193 194 } 195 }, 196 { 197 breakpoint: 999, 198 settings: { 199 slide: 'li', 200 slidesToShow: 1, 201 slidesToScroll: 1 202 } 203 }, 204 { 205 breakpoint: 600, 206 settings: { 207 slide: 'li', 208 slidesToShow:1, 209 slidesToScroll: 1 210 } 211 } 212 ] 213 214 }); 215 } 216 }); 217 } 218 219 $box.find('.news_con').each(function(){ 220 var _this = $(this); 221 _this.find(".news:first").addClass("active"); 222 _this.find(".news").hover(function(){ 223 $(this).siblings().removeClass("active"); 224 $(this).addClass("active"); 225 },function(){ 226 _this.find(".news:first").siblings().removeClass("active"); 227 _this.find(".news:first").addClass("active"); 228 }); 229 }); 230 231 /** 232 * å享 233 * @param node 234 * @param ask 235 * @param hide 236 */ 237 var shareFuc = function (node, ask, hide) { 238 var infoNode = ask ? $(node) : $(node).parents('#share_list'); 239 //var bshare_url = infoNode.attr("data-url") || window.location.href, 240 var bshare_url = infoNode.attr("data-url"), 241 bshare_title = infoNode.attr("data-title") || "", 242 bshare_summary = infoNode.attr("data-summary") || "", 243 type = $(node).attr('data-name'), 244 bshare_pic = infoNode.attr('data-pic') || ""; 245 var share_url = 'https://bshare.optimix.asia/barCode?site=' + type + '&url='+location.origin+''+ bshare_url + '&title=' + encodeURIComponent(bshare_title); 246 var share_urls = 'https://bshare.optimix.asia/bshare_redirect?type=4&site=' + type + '&url='+location.origin+''+ bshare_url + '&title=' + encodeURIComponent(bshare_title); 247 248 /*var share_url = 'http://api.bshare.cn/share/' + type + '?url=' + bshare_url + '&title=' + encodeURIComponent(bshare_title) + '&summary=' + encodeURIComponent(bshare_summary) + '&pic=' + bshare_pic;*/ 249 if (type == 'weixin') { 250 var weixin = $(node).parents('#share_list').find('.weixin-layer'); 251 var left = $(node).position().left - 10 - 35; 252 if (hide) { 253 weixin.hide(); 254 return; 255 } 256 weixin.find('img').attr({'src': share_url,}); 257 weixin.css('left', left); 258 weixin.fadeIn("fast"); 259 } else if (type == 'like') { 260 if ($(node).hasClass('haslike')) { 261 alert('æ¨å·²ç»å欢è¿äºï¼'); 262 } else { 263 var likeNum = parseInt($(node).find('span').text()); 264 $(node).addClass('haslike').find('span').text(likeNum + 1); 265 $('.share-layer').find('.like-share').addClass('haslike').find('span').text(likeNum + 1); 266 } 267 } else { 268 window.open(share_urls, '_blank'); 269 } 270 }; 271 272 var shareBind = function (nodelist){ 273 nodelist.each(function (idx, node){ 274 var type = $(node).attr('data-name'); 275 var ev = type == 'weixin' ? 'hover' : 'click'; 276 if (type == 'weixin') { 277 $(node).hover(function (){ 278 shareFuc(this); 279 }, function () { 280 shareFuc(this, null, true); 281 }) 282 } 283 else { 284 $(node).on('click', function (){ 285 shareFuc(this); 286 }) 287 } 288 }) 289 }; 290 291 var index = 0; 292 //////////////////////////////////////////////////////////////////////////////////////// 293 //var siteURL = (document.getElementById("version").src).match(/(.*)(?=\/fws_seach)/)[0]; 294 295 /*$(".main .post-11 .con.news_tu").fwsSearch({ 296 url:'/_wp3services/generalQuery?queryObj=articles', 297 siteId:3, 298 columnId:'1247', 299 rows:10, 300 displayType:'list', 301 field: [ 302 {title:"ç¶æ",children:"ç²¾å+ææ°+æç",type:"0"} 303 ], 304 conditFeild:[ 305 {type:"0", field:"f5", judge:"="} 306 ], 307 orderData:[ 308 {field: 'top', type: 'desc'}, 309 {field: "publishTime", type: "desc"} 310 ], 311 returnInfosdata:[ 312 {field: "title",pattern: [{name: "lp",value: "30"}], name: "title"}, 313 {field: "titles", name: "title"}, 314 {field: "publishTime",pattern: [{name: "d",value: "yyyy-MM-dd"}],name: "publishTime"}, 315 {field: "summary",name: "summary"}, 316 {field: "source",name: "source"}, 317 {field: "visitCount",name: "visitCount"}, 318 {field: "imgPath", name: "imgPath"}, 319 {field: "mircImgPath", name: "mircImgPath"}, 320 {field: "url", name: "url"}, 321 {field: "category",name: "category"}, 322 {field: "categoryId",name: "categoryId"}, 323 {field: "creator",name: "creator"}, 324 {field: "author",name: "author"}, 325 {field: "imgLogo",name: "imgLogo"}, 326 {field: "f5",name: "f5"}, 327 {field: "f6",name: "f6"} 328 ], 329 showType: null, 330 tpl:function(data){ 331 if((w1imgJsons.toString()).search(data.titles) == -1){ 332 index++; 333 var category = ''; 334 if(data.category !== undefined){ 335 category = data.category.split(',')[0]; 336 category = ''; 337 } 338 var random_bg = Math.floor(Math.random()*12+0); 339 var random_imgs = '/_upload/tpl/00/04/4/template4/random_imgs/'+random_bg+'.jpg'; 340 if(data.imgPath == '' || data.imgPath == undefined){ 341 data.imgPath = random_imgs; 342 } 343 if(index>6)return false; 344 return '<li class="news n2" style="opacity:0"><div class="news_box clearfix" href="' + data.url + '" target="_blank"><div class="news_imgs"><a class="imgs" href="' + data.url + '" target="_blank"><img src="' + data.imgPath + '" width="320"></a></div><div class="news_wz"><div class="news_con">' + category + '<div class="news_title"><a href="' + data.url + '" target="_blank">' + data.title + '</a></div><div class="news_text">' + data.summary+ '</div><div class="news_time"><span class="times">' + data.publishTime + '</span><span class="views">' + data.visitCount + '</span></div><span id="share_list" class="share-box" data-id="{æç« ID}" data-title="' + data.title + '" data-summary="' + data.summary+ '" data-pic="' + data.imgPath + '" data-url="' + data.url + '"><span class="share-title">å享å°</span><ul class="clearfix"><li class="weibo-share" data-name="weixin"><a href="javascript:void(0);"></a><span>微信好å</span></li><li class="friend-share" data-name="sinaminiblog"><a href="javascript:void(0);"></a><span>æ°æµªå¾®å</span></li><li class="weixin-share" data-name="qzone"><a href="javascript:void(0);"></a><span>QQ空é´</span></li><li class="qzone-share" data-name="weixin"><a href="javascript:void(0);"></a><span>微信æåå</span></li></ul><div class="weixin-layer"><img alt=""><div class="ico-inner ico-ewm-arr"></div></div></span></div></div></div></li>'; 345 } 346 }, 347 callback: function(){ 348 shareBind($('#share_list li')); 349 $("#container-1 .post-11 .news_list li").each(function(){ 350 $(this).hover(function(){ 351 $(this).find(".share-box").fadeIn(100); 352 },function(){ 353 $(this).find(".share-box").fadeOut(50); 354 }); 355 }); 356 357 } 358 });*/ 359
360 361 $(".main .post-11 .con.news_tu .news").each(function(index,el){ 362 var $img = $(this).find(".news_imgs img"); 363 var news_title = $(this).find(".news_title a").attr("title"); 364 var imgPath = $img.attr("src"); 365 var random_bg = Math.floor(Math.random()*12+0); 366 var random_imgs = '/_upload/tpl/00/04/4/template4/random_imgs/'+random_bg+'.jpg'; 367 if(imgPath == '' || imgPath == undefined){imgPath = random_imgs;} 368 $img.attr("src",imgPath); 369 if((w1imgJsons.toString()).search(news_title) == -1){ 370 $(this).addClass('show'); 371 } 372 }); 373 $(".main .post-11 .con.news_tu .news.show").each(function(index,el){ 374 if(index <= 5){ 375 $(this).show(); 376 }; 377 }); 378 shareBind($('#share_list li')); 379 $("#container-1 .post-11 .news_list li").each(function(){ 380 $(this).hover(function(){ 381 $(this).find(".share-box").fadeIn(100); 382 },function(){ 383 $(this).find(".share-box").fadeOut(50); 384 }); 385 }); 386 387 /** 388 *é¦é¡µæåæ¥åæåº 389 ***************************************************************/ 390 391 function transdate(endTime){ 392 var date=new Date(); 393 date.setFullYear(endTime.substring(0,4)); 394 date.setMonth(endTime.substring(5,7)-1); 395 date.setDate(endTime.substring(8,10)); 396 date.setHours(endTime.substring(11,13)); 397 date.setMinutes(endTime.substring(14,16)); 398 date.setSeconds(endTime.substring(17,19)); 399 return Date.parse(date)/1000; 400 } 401 402 Date.prototype.Format = function(fmt) 403 { //author: meizz 404 var o = { 405 "M+" : this.getMonth()+1, //æä»½ 406 "d+" : this.getDate(), //æ¥ 407 "h+" : this.getHours(), //å°æ¶ 408 "m+" : this.getMinutes(), //å 409 "s+" : this.getSeconds(), //ç§ 410 "q+" : Math.floor((this.getMonth()+3)/3), //å£åº¦ 411 "S" : this.getMilliseconds() //æ¯«ç§ 412 }; 413 if(/(y+)/.test(fmt)) 414 fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length)); 415 for(var k in o) 416 if(new RegExp("("+ k +")").test(fmt)) 417 fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length))); 418 return fmt; 419 } 420 421 var datas = [],datas1 = [],datas2 = [],datas3 = [],datas4 = []; 422 $(".main .post-21 .news_list").find(".topic-news").each(function(index){ 423 $(this).hide(); 424 var title = $(this).find(".news_title").text(); 425 var url = $(this).find("a").attr("href"); 426 var pre = $(this).find(".news_pre").text(); 427 var t1 = $(this).find(".t1").text(); 428 var t2 = $(this).find(".t2").text(); 429 var t3 = $(this).find(".t3").text(); 430 var times = $(this).find(".news_date").attr("data-times"); 431 var timeh = transdate(times)+index; 432 var years = (new Date(times)).Format("dd"); 433 var times = (new Date(times)).Format("MM");
434 datas.push({"timeh":timeh,"time":times,"years":years,"title":title,"url":url,"pre":pre,"t1":t1,"t2":t2,"t3":t3}); 435 datas1.push(timeh); 436 datas2.push(timeh); 437 }); 438 var newtime = transdate((new Date()).Format("yyyy-MM-dd 00:00:00")); 439 var i,j,nums = 0; 440 441 /* 坹忰æ®è¿è¡æåº å°å°å¤§ */ 442 datas1.sort(function(a,b){return a - b}); 443 for(j in datas1 ){ 444 if(newtime <= datas1[j]){ 445 datas3.push(datas1[j]); 446 } 447 } 448 /* å0å°3çå¼åè¿è¡æåº å°å°å¤§ */ 449 datas4 = datas3.slice(0,3); 450 //datas4 = datas3.sort(function(a,b){return b - a}); 451 for(j in datas4 ){ 452 for(i in datas ){ 453 if(newtime <= datas[i].timeh){ 454 if(datas4[j] == datas[i].timeh){ 455 $(".main .post-21 .news_list").find(".topic-news").parent().append('<li class="news n'+i+' add none"><div class="news_box clearfix"><div class="news_date" ><div class="news_year">'+datas[i].years+'</div><div class="news_days">'+getMonthEN(datas[i].time)+'</div><div class="news_pre">'+datas[i].pre+'</div></div><div class="news_wz"><div class="news_con"><div class="news_title"><a href="'+datas[i].url+'" target="_blank" title="'+datas[i].title+'">'+datas[i].title+'</a></div><div class="news_text"><p class="t1"><i></i>'+datas[i].t1+'</p><p class="t2"><i></i>'+datas[i].t2+'</p><p class="t3"><i></i>'+datas[i].t3+'</p></div></div></div></div></li>') 456 } 457 } 458 } 459 } 460 /* è¿æä¿¡æ¯çæåº 大å°å° */ 461 datas2.sort(function(a,b){return b - a}); 462 for(j in datas2 ){ 463 for(i in datas ){ 464 if(newtime > datas[i].timeh){ 465 if(datas2[j] == datas[i].timeh){ 466 $(".main .post-21 .news_list").find(".topic-news").parent().append('<li class="news n'+i+' add none"><div class="news_box clearfix"><div class="news_date" ><div class="news_year">'+datas[i].years+'</div><div class="news_days">'+getMonthEN(datas[i].time)+'</div><div class="news_pre">'+datas[i].pre+'</div></div><div class="news_wz"><div class="news_con"><div class="news_title"><a href="'+datas[i].url+'" target="_blank" title="'+datas[i].title+'">'+datas[i].title+'</a></div><div class="news_text"><p class="t1"><i></i>'+datas[i].t1+'</p><p class="t2"><i></i>'+datas[i].t2+'</p><p class="t3"><i></i>'+datas[i].t3+'</p></div></div></div></div></li>'); 467 } 468 } 469 } 470 } 471 472 $(".main .post-21 .news_list").find(".news.add").each(function(index,el){ 473 if(index<3){ 474 $(this).show(); 475 } 476 }); 477 478 /**10-11s***************/ 479 /* 坹忰æ®è¿è¡æåº 大å°å° */ 480 /*datas4 = datas1.sort(function(a,b){return b - a}).slice(0,3); 481 482 for(j in datas4 ){ 483 datas3.push(datas4[j]); 484 } 485 for(j in datas3 ){ 486 for(i in datas ){ 487 if(datas3[j]==datas[i].timeh){ 488 $(".main .post-21 .news_list").find(".topic-news").parent().append('<li class="news n'+i+'"><div class="news_box clearfix"><div class="news_date" ><div class="news_year">'+datas[i].years+'</div><div class="news_days">'+getMonthEN(datas[i].time)+'</div><div class="news_pre">'+datas[i].pre+'</div></div><div class="news_wz"><div class="news_con"><div class="news_title"><a href="'+datas[i].url+'" target="_blank" title="'+datas[i].title+'">'+datas[i].title+'</a></div><div class="news_text"><p class="t1"><i></i>'+datas[i].t1+'</p><p class="t2"><i></i>'+datas[i].t2+'</p><p class="t3"><i></i>'+datas[i].t3+'</p></div></div></div></div></li>'); 489 } 490 } 491 }*/ 492 /**10-11e***************/ 493 494 495 /** 496 *é¦é¡µç¹å»è§é¢ 497 ***************************************************************/ 498 var videoclip = ''; 499 var player = '',story_player = ''; 500 501 $(".video_link").hover(function(){ 502 videoclip = $(this).attr('href'); 503 $(this).attr({"href":"#video_box"}); 504 },function(){ 505 $(this).attr({"href":""+videoclip+""}); 506 }); 507 508 $(".video_link").fancybox({ 509 'padding':0, 510 'hideOnContentClick':false, 511 'overlayOpacity' :.6, 512 //'zoomSpeedOut' :400, 513 'easingIn' : 'easeOutBack', 514 'easingOut' : 'easeInBack', 515 'callbackOnShow' :function(){ 516 var player = videojs("fancy_div",{ 517 muted: false, 518 controls : true, 519 //height:300, 520 //width:300, 521 loop : true, 522 fluid : true 523 }).ready(function(){ 524 var clipwidth = document.body.clientWidth -60; 525 var clipheight= 520; 526 var pos = $.fn.fancybox.getViewport(); 527 if(os.isAndroid || os.isPhone || os.isTablet){ 528 $("#fancy_outer").css({width:clipwidth}); 529 $("#fancy_outer").css('left', ((clipwidth + 36) > pos[0] ? pos[2] : pos[2] + Math.round((pos[0] - clipwidth - 36) / 2)));
530 $("#fancy_outer").css('top', ((clipheight + 50) > pos[1] ? pos[3] : pos[3] + Math.round((pos[1] - clipheight - 50) / 2))); 531 } 532 var myPlayer = this; 533 myPlayer.src(videopath+videoclip+''); 534 myPlayer.play(); 535 }); 536 537 $('#fancy_close').click(function(){ 538 var player = videojs("fancy_div",{}).ready(function(){ 539 this.dispose(); 540 }); 541 $("#fancy_div").remove(); 542 }); 543 }, 544 'callbackOnClose':function(){ 545 $("#fancy_div_api").remove(); 546 } 547 }); 548 549 550});
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.