Skip to content

Commit 82b89fe

Browse files
committed
更新[BoxJs TF]: 新增一键清空会话数据,优化图标字体颜色
1 parent 81e8a49 commit 82b89fe

3 files changed

Lines changed: 38 additions & 17 deletions

File tree

‎box/chavy.boxjs.html‎

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta charset="utf-8" />
66
<meta name="apple-mobile-web-app-capable" content="yes" />
77
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
8-
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover"" />
8+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover" />
99
<link rel="Bookmark" href="https://raw.githubusercontent.com/chavyleung/scripts/master/BOXJS.png" />
1010
<link rel="shortcut icon" href="https://raw.githubusercontent.com/chavyleung/scripts/master/BOXJS.png" />
1111
<link rel="apple-touch-icon" href="https://raw.githubusercontent.com/chavyleung/scripts/master/BOXJS.png" />
@@ -28,8 +28,6 @@
2828
box-sizing: content-box;
2929
padding-top: constant(safe-area-inset-top);
3030
padding-top: env(safe-area-inset-top);
31-
margin-bottom: calc(48px + constant(safe-area-inset-bottom));
32-
margin-bottom: calc(48px + env(safe-area-inset-bottom));
3331
}
3432
.v-app-bar .v-autocomplete {
3533
box-sizing: border-box;
@@ -63,7 +61,7 @@
6361
</head>
6462
<body>
6563
<div id="app" v-cloak>
66-
<v-app v-if="box" :style="appStyle">
64+
<v-app v-if="box" :style="appViewStyle">
6765
<v-snackbar top app v-model="ui.snackbar.show" v-bind="ui.snackbar">{{ui.snackbar.msg}}</v-snackbar>
6866
<!-- 头部 -->
6967
<v-app-bar app dense :color="isDarkMode || !isWebApp ? undefined : 'primary'">
@@ -332,6 +330,7 @@
332330
<v-avatar size="32"><v-icon>mdi-language-html5</v-icon></v-avatar>
333331
</v-btn>
334332
</v-list-item>
333+
<v-list-item class="mt-4"></v-list-item>
335334
</v-list>
336335
</v-navigation-drawer>
337336
<!-- 主页 -->
@@ -356,11 +355,7 @@
356355
:src="app.icon"
357356
></v-img>
358357
<p class="text-center ma-0">
359-
<span
360-
:color="isWallpaper ? '#fff' : ''"
361-
class="d-inline-block text-truncate font-weight-bold"
362-
style="font-size: 10px; max-width: 58px;"
363-
>
358+
<span class="d-inline-block text-truncate font-weight-bold" :style="appIconFontStyle">
364359
{{app.name}}
365360
</span>
366361
</p>
@@ -525,7 +520,7 @@ <h2>{{curapp.name}}</h2>
525520
<v-subheader>
526521
应用设置 ({{curapp.settings.length}})
527522
</v-subheader>
528-
<v-form class="pl-4 pr-4">
523+
<v-form class="pl-4 pr-4 pb-4">
529524
<template v-for="(setting, settingIdx) in curapp.settings">
530525
<v-slider
531526
v-model="setting.val"
@@ -667,6 +662,10 @@ <h2>{{curapp.name}}</h2>
667662
</v-card-actions>
668663
</v-card>
669664
</v-dialog>
665+
<v-divider></v-divider>
666+
<v-list-item @click="clearAppDatas()">
667+
<v-list-item-title>清空数据</v-list-item-title>
668+
</v-list-item>
670669
</v-list>
671670
</v-menu>
672671
</v-subheader>
@@ -1214,7 +1213,7 @@ <h2 :class="version === ver.version ? 'primary--text' : undefined">v{{ver.versio
12141213
return items
12151214
},
12161215
// 样式
1217-
appStyle() {
1216+
appViewStyle() {
12181217
if (this.path !== '/') {
12191218
return null
12201219
}
@@ -1227,6 +1226,16 @@ <h2 :class="version === ver.version ? 'primary--text' : undefined">v{{ver.versio
12271226
}
12281227
return style
12291228
},
1229+
appIconFontStyle() {
1230+
const style = {
1231+
'font-size': '10px',
1232+
'max-width': '58px'
1233+
}
1234+
if (this.isWallpaper) {
1235+
style['color'] = '#fff'
1236+
}
1237+
return style
1238+
},
12301239
// 是否保存用户偏好
12311240
isSaveUserCfgs: {
12321241
set(val) {
@@ -1728,8 +1737,12 @@ <h2 :class="version === ver.version ? 'primary--text' : undefined">v{{ver.versio
17281737
// 保存应用数据
17291738
clearAppDatas(key) {
17301739
const datas = this.curapp.datas
1731-
const data = datas.find((data) => data.key === key)
1732-
data.val = ''
1740+
if (key) {
1741+
const data = datas.find((data) => data.key === key)
1742+
data.val = ''
1743+
} else {
1744+
datas.forEach((data) => (data.val = ''))
1745+
}
17331746
axios.post('/api/save', datas).then((resp) => {
17341747
if (this.curapp.id === 'BoxSetting') {
17351748
this.isSaveUserCfgs = false

‎box/chavy.boxjs.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const $ = new Env('BoxJs')
22

3-
$.version = '0.7.20'
3+
$.version = '0.7.21'
44
$.versionType = 'beta'
55

66
/**

‎box/release/box.release.tf.json‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,33 @@
11
{
22
"releases": [
33
{
4-
"version": "0.7.20",
4+
"version": "0.7.21",
55
"tags": ["beta"],
66
"author": "@chavyleung",
77
"icon": "https://avatars3.githubusercontent.com/u/29748519",
88
"repo": "https://github.com/chavyleung",
99
"notes": [
10+
{
11+
"name": "新增",
12+
"descs": ["一键清空会话数据"]
13+
},
1014
{
1115
"name": "优化",
12-
"descs": ["勿扰模式下, 不再忽略手动执行脚本时发出的系统通知"]
16+
"descs": ["壁纸状态下图标字体颜色为白色", "其他样式优化"]
1317
}
1418
]
1519
},
1620
{
17-
"version": "0.7.19",
21+
"version": "0.7.20",
1822
"tags": ["beta"],
1923
"author": "@chavyleung",
2024
"icon": "https://avatars3.githubusercontent.com/u/29748519",
2125
"repo": "https://github.com/chavyleung",
2226
"notes": [
27+
{
28+
"name": "优化",
29+
"descs": ["勿扰模式下, 不再忽略手动执行脚本时发出的系统通知"]
30+
},
2331
{
2432
"name": "新增",
2533
"descs": ["可以设置多张壁纸 (偏好设置)"]

0 commit comments

Comments
 (0)