Skip to content

Commit dce0a6e

Browse files
committed
Fix: some bugs
1 parent 567fc01 commit dce0a6e

File tree

5 files changed

+28
-23
lines changed

5 files changed

+28
-23
lines changed

manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifest_version": 3,
33
"name": "uyou 新标签页",
44
"description": "这是一个很好看的新标签页!",
5-
"version": "1.2.7",
5+
"version": "1.2.8",
66
"icons": {
77
"128": "extension.png",
88
"48": "extension.png",

newPage/js/features/otherSetting.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ export default function otherFeatures() {
66
elemenetGetId('loadingAn').className = 'otherFeatures';
77
elemenetGetId('loadingAn').innerText = '显示';
88
elemenetGetId('loadingTimeBtn').style.display = '';
9-
elemenetGetClass('otherBtn')[0].style.borderRadius = '10px 10px 0px 0px';
10-
elemenetGetClass('otherBtn')[0].style.borderBottom = '1px solid #00000020';
9+
elemenetGetClass('otherBtn')[1].style.borderRadius = '10px 10px 0px 0px';
10+
elemenetGetClass('otherBtn')[1].style.borderBottom = '1px solid #00000020';
1111
chrome.storage.sync.get(['dlMode'], function (budget) {
1212
let dlMode = budget.dlMode;
1313
if (typeof (dlMode) == 'undefined') {
@@ -20,33 +20,33 @@ export default function otherFeatures() {
2020
elemenetGetClass('otherBtn')[0].style.backgroundColor = '#ffffff90';
2121
}
2222
} else if (dlMode == 'dark') {
23-
elemenetGetClass('otherBtn')[0].style.backgroundColor = '#44444490';
23+
elemenetGetClass('otherBtn')[1].style.backgroundColor = '#44444490';
2424
} else if (dlMode == 'light') {
25-
elemenetGetClass('otherBtn')[0].style.backgroundColor = '#ffffff90';
25+
elemenetGetClass('otherBtn')[1].style.backgroundColor = '#ffffff90';
2626
}
2727
})
2828
chrome.storage.local.set({ 'loadingAn': 'show' });
2929
} else {
3030
elemenetGetId('loadingAn').className = 'otherFeaturesBefore';
3131
elemenetGetId('loadingAn').innerText = '隐藏';
3232
elemenetGetId('loadingTimeBtn').style.display = 'none';
33-
elemenetGetClass('otherBtn')[0].style.borderRadius = '10px';
34-
elemenetGetClass('otherBtn')[0].style.borderBottom = '0px';
33+
elemenetGetClass('otherBtn')[1].style.borderRadius = '10px';
34+
elemenetGetClass('otherBtn')[1].style.borderBottom = '0px';
3535
chrome.storage.sync.get(['dlMode'], function (budget) {
3636
let dlMode = budget.dlMode;
3737
if (typeof (dlMode) == 'undefined') {
3838
dlMode = '';
3939
}
4040
if (dlMode == '') {
4141
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
42-
elemenetGetClass('otherBtn')[0].style.backgroundColor = '#44444450';
42+
elemenetGetClass('otherBtn')[1].style.backgroundColor = '#44444450';
4343
} else {
44-
elemenetGetClass('otherBtn')[0].style.backgroundColor = '#ffffff50';
44+
elemenetGetClass('otherBtn')[1].style.backgroundColor = '#ffffff50';
4545
}
4646
} else if (dlMode == 'dark') {
47-
elemenetGetClass('otherBtn')[0].style.backgroundColor = '#44444450';
47+
elemenetGetClass('otherBtn')[1].style.backgroundColor = '#44444450';
4848
} else if (dlMode == 'light') {
49-
elemenetGetClass('otherBtn')[0].style.backgroundColor = '#ffffff50';
49+
elemenetGetClass('otherBtn')[1].style.backgroundColor = '#ffffff50';
5050
}
5151
})
5252

newPage/js/features/search.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ export function searchChangeUse() {
360360
if (cus != undefined && engine == 'search.png') {
361361
window.open(cus + keywords, '_self');
362362
}
363-
if (!cus) {
363+
if (!cus && engine == 'search.png') {
364364
elemenetGetId('keywords').value = '未设置自定义的搜索引擎'
365365
setTimeout(() => {
366366
elemenetGetId('keywords').value = ''

newPage/js/main/dark2light.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ function dark(alpha) {
2525
elemenetGetClass('feaImg')[5].src = 'imgs/dark/down.png';
2626
elemenetGetClass('feaImg')[6].src = 'imgs/dark/info.png';
2727
elemenetGetId('dlAn').innerText = '暗色';
28-
elemenetGetClass('otherBtn')[1].style.background = '#44444470';
29-
elemenetGetClass('otherBtn')[1].style.borderRadius = '10px 10px 0px 0px';
30-
elemenetGetClass('otherBtn')[2].style.display = '';
28+
elemenetGetClass('otherBtn')[2].style.background = '#44444470';
29+
elemenetGetClass('otherBtn')[2].style.borderRadius = '10px 10px 0px 0px';
30+
elemenetGetClass('otherBtn')[3].style.display = '';
3131
}
3232

3333
//light mode to change style
@@ -55,9 +55,9 @@ function light() {
5555
elemenetGetClass('feaImg')[5].src = 'imgs/down.png';
5656
elemenetGetClass('feaImg')[6].src = 'imgs/info.png';
5757
elemenetGetId('dlAn').innerText = '亮色'
58-
elemenetGetClass('otherBtn')[1].style.background = '';
59-
elemenetGetClass('otherBtn')[1].style.borderRadius = '';
60-
elemenetGetClass('otherBtn')[2].style.display = 'none';
58+
elemenetGetClass('otherBtn')[2].style.background = '';
59+
elemenetGetClass('otherBtn')[2].style.borderRadius = '';
60+
elemenetGetClass('otherBtn')[3].style.display = 'none';
6161

6262
}
6363

@@ -118,19 +118,19 @@ export function dlUse() {
118118
elemenetGetId('otherSettings').style.background = '#ffffff70';
119119
chrome.storage.sync.set({ 'dlMode': 'light' });
120120
if (elemenetGetId('loadingAn').innerText == '隐藏') {
121-
elemenetGetClass('otherBtn')[0].style.background = '#ffffff50';
121+
elemenetGetClass('otherBtn')[1].style.background = '#ffffff50';
122122
} else {
123-
elemenetGetClass('otherBtn')[0].style.background = '#ffffff90';
123+
elemenetGetClass('otherBtn')[1].style.background = '#ffffff90';
124124
}
125125
elemenetGetId('colorMode').innerText = '亮色模式';
126126
} else {
127127
dark(elemenetGetId('click').className);
128128
elemenetGetId('otherSettings').style.background = '#44444470';
129129
chrome.storage.sync.set({ 'dlMode': 'dark' });
130130
if (elemenetGetId('loadingAn').innerText == '隐藏') {
131-
elemenetGetClass('otherBtn')[0].style.background = '#44444450';
131+
elemenetGetClass('otherBtn')[1].style.background = '#44444450';
132132
} else {
133-
elemenetGetClass('otherBtn')[0].style.background = '#44444490';
133+
elemenetGetClass('otherBtn')[1].style.background = '#44444490';
134134
}
135135
elemenetGetId('colorMode').innerText = '深色模式'
136136
}

popupPage/extension.html

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,17 @@ <h2>欢迎使用 uyou 新标签页</h2>
1515
<div id="web">前往官网</div>
1616
</div>
1717
<div class="Title new">当前版本:</div>
18+
<div class="message">
19+
<div class="v">版本:1.2.8</div>
20+
<div class="info">修复了搜索栏 Bug</div>
21+
<div class="info">修复了一些其他 Bug</div>
22+
</div>
23+
<div class="Title old">历史版本:</div>
1824
<div class="message">
1925
<div class="v">版本:1.2.7</div>
2026
<div class="info">更换默认背景加载逻辑</div>
2127
<div class="info">更换默认背景 API</div>
2228
</div>
23-
<div class="Title old">历史版本:</div>
2429
<div class="message">
2530
<div class="v">版本:1.2.6</div>
2631
<div class="info">修复背景加载</div>

0 commit comments

Comments
 (0)