Skip to content

Commit bc3e9a0

Browse files
committed
feat: 新增浏览器边缘触发设置按钮的范围设置 #273
1 parent 6fef9fd commit bc3e9a0

6 files changed

Lines changed: 78 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
- fix: 修复自定义快捷回复失效问题 #244
2-
- fix: 修复预览模态窗 bug #271
1+
- feat: 新增浏览器边缘触发设置按钮的范围设置 #273

entrypoints/App.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="linuxdoscripts-setting-wrap" v-show="!isShow">
2+
<div class="linuxdoscripts-setting-wrap" v-show="!isShow" :style="`height:${controlheight}vh`">
33
<button class="linuxdoscripts-setting" title="设置" type="button" @click="setting">
44
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-settings"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z"/><path d="M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0"/></svg>
55
</button>
@@ -83,6 +83,8 @@
8383
<div class="group-line">外观设置</div>
8484
<!-- 简洁模式 -->
8585
<MenuSimpleMode :sort="1" v-model="settingData.checked0" v-show="matchesSearch('简洁模式')"/>
86+
<!-- 浏览器边缘触发设置按钮的范围 -->
87+
<MenuControlHeight :sort="1.0" v-model="settingData.checked01" v-show="matchesSearch('按钮区域触发高度')"/>
8688
<!-- 智能限制楼层高度 -->
8789
<MenuFloorHeight :sort="2" v-model="settingData.checked10" v-show="matchesSearch('智能限制楼层高度')"/>
8890
<!-- 中英文混排优化显示 -->
@@ -246,6 +248,7 @@ import settingsManager from "./utilities/settingsManager.js";
246248
import packageJson from "../package.json";
247249
248250
import MenuSimpleMode from "./SettingComponents/BasicSettings/MenuSimpleMode.vue";
251+
import MenuControlHeight from "./SettingComponents/BasicSettings/MenuControlHeight.vue";
249252
import MenuOpenpostblank from "./SettingComponents/BasicSettings/MenuOpenpostblank.vue";
250253
import MenuNewtopicreminder from "./SettingComponents/BasicSettings/MenuNewtopicreminder.vue";
251254
import MenuAutoexpandreply from "./SettingComponents/BasicSettings/MenuAutoexpandreply.vue";
@@ -355,6 +358,7 @@ export default {
355358
Setting6,
356359
Setting7,
357360
MenuSimpleMode,
361+
MenuControlHeight,
358362
MenuOpenpostblank,
359363
MenuNewtopicreminder,
360364
MenuAutoexpandreply,
@@ -434,6 +438,7 @@ export default {
434438
data() {
435439
return {
436440
isShow: false,
441+
controlheight: 100,
437442
438443
opacity: false,
439444
showdialog: false,
@@ -447,6 +452,7 @@ export default {
447452
// 设置数据
448453
settingData: {
449454
checked0: false,
455+
checked01: 100,
450456
checked1: false,
451457
checked2: false,
452458
checked3: false,
@@ -731,6 +737,7 @@ export default {
731737
this.showbookmarkbtn = this.settingData.checked52;
732738
this.showbookmarkfolderbtn = this.settingData.checked53;
733739
this.showviewhistorylist = this.settingData.checked56;
740+
this.controlheight = this.settingData.checked01;
734741
735742
} else {
736743
// 如果没有现有数据,保存默认设置

entrypoints/DialogComponents/components/SettingMenu.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<a-divider />
1717

1818
<div class="item">
19-
<div class="label">1.开启该设置时,会“隐藏”论坛网站中的设置按钮。</div>
19+
<div class="label">1.开启该设置时,会“隐藏”论坛左侧触发的设置按钮。</div>
2020
<a-switch v-model="isShow" @change="ShowSettingConfig" />
2121
</div>
2222
<div style="height: 10px"></div>
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<template>
2+
<div class="item">
3+
<div class="tit">{{ sort }}. 浏览器边缘触发按钮的范围设置为从底部开始</div>
4+
<input
5+
type="number"
6+
:value="modelValue"
7+
min="10"
8+
max="100"
9+
@change="$emit('update:modelValue', $event.target.value)"
10+
@blur="handleBlur" />
11+
</div>
12+
</template>
13+
14+
<script>
15+
export default {
16+
props: ['modelValue', 'sort'],
17+
emits: ['update:modelValue'],
18+
created() {
19+
console.log(this.modelValue);
20+
},
21+
methods: {
22+
// 提示组件
23+
messageToast(message) {
24+
const messageElement = document.createElement('div');
25+
messageElement.className = 'messageToast-text';
26+
messageElement.innerText = message;
27+
document.getElementById('messageToast').appendChild(messageElement);
28+
setTimeout(() => {
29+
messageElement.remove();
30+
}, 3000);
31+
},
32+
handleBlur(event) {
33+
let value = parseInt(event.target.value);
34+
35+
// 如果输入的不是有效数字,设置为默认值10
36+
if (isNaN(value)) {
37+
value = 10;
38+
}
39+
40+
// 检查数值范围并修正
41+
if (value < 10) {
42+
value = 10;
43+
this.messageToast('填入的数字不可小于10!');
44+
} else if (value > 100) {
45+
value = 100;
46+
this.messageToast('填入的数字不可大于100!');
47+
}
48+
49+
// 如果值发生了变化,更新父组件
50+
if (value != event.target.value) {
51+
event.target.value = value;
52+
this.$emit('update:modelValue', value);
53+
}
54+
}
55+
}
56+
};
57+
</script>
58+
59+
<style lang="less" scoped>
60+
input {
61+
width: 100px !important;
62+
}
63+
</style>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "linuxdo-scripts",
33
"description": "manifest.json description",
44
"private": true,
5-
"version": "1.5.9",
5+
"version": "1.5.10",
66
"type": "module",
77
"scripts": {
88
"dev": "wxt",

version-log.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.5.10
2+
3+
- feat: 新增浏览器边缘触发设置按钮的范围设置 #273
4+
15
## 1.5.9
26

37
- fix: 修复自定义快捷回复失效问题 #244

0 commit comments

Comments
 (0)