Skip to content

Commit 737aad3

Browse files
committed
fix
1 parent c5fdce9 commit 737aad3

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

BingBgForBaidu/BingBgForBaidu.user.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// @name 百Bing图
33
// @name:en BingBgForBaidu
44
// @namespace hoothin
5-
// @version 2.3.5
5+
// @version 2.3.6
66
// @description 给百度首页换上Bing的背景图,并添加背景图链接与日历组件
77
// @description:en Just change the background image of baidu.com to bing.com
88
// @author hoothin
@@ -80,7 +80,7 @@
8080
var height=rili.height();
8181
iframe.width=width===0?538:width;
8282
iframe.height=height===0?370:height;
83-
var today=$(".op-calendar-new-table-today",iframe.contentDocument);
83+
var today=$(".op-calendar-new-table-border",iframe.contentDocument);
8484
var t;
8585
riliLink.innerHTML="<span class='title' style='text-decoration:overline;cursor:crosshair'>"+$(".op-calendar-new-right-date",iframe.contentDocument).html()+"</span>";
8686
riliLink.onmouseover=function(){
@@ -97,8 +97,9 @@
9797
$(iframe).hide(500);
9898
};
9999
if(today[0].classList.contains("op-calendar-new-table-festival")){
100-
riliLink.innerHTML+=today[0].title?" <font color='#FFFF66' style='background-color:#e02d2d;font-weight:bold'>("+today[0].title+")</font>":"";
101-
riliLink.title=today[0].title;
100+
var title=today[0].title || $(".op-calendar-new-table-almanac",today).text();
101+
riliLink.innerHTML+=title?" <font color='#FFFF66' style='background-color:#e02d2d;font-weight:bold'>("+title+")</font>":"";
102+
riliLink.title=title;
102103
}
103104
};
104105
var skinContainer=document.querySelector(".s-skin-container");
@@ -142,7 +143,7 @@
142143
bgUrl="url(\""+bgUrl+"\")";
143144
if(!bingImg)skinContainer.style.backgroundImage = bgUrl;
144145
var logo=document.querySelector("#s_lg_img");
145-
if(logo && logo.src)logo.src=logo.src.replace(/\/[^\/]+\.png$/,"/logo_white.png");
146+
if(logo && logo.src)logo.src=logo.src.replace(/\/bd_logo.*$/,"/logo_white.png");
146147
else{
147148
logo=document.querySelector("#lg>img");
148149
if(logo && logo.src)logo.src=logo.src.replace(/.*\/img\/bd_logo1\.png/,"//ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/logo/logo_white.png");

0 commit comments

Comments
 (0)