Skip to content

Commit ebe1bb2

Browse files
shalldieRemhardt
andauthored
Feat folder - 添加对不同系统路径、以及文件夹的支持 (#557)
* feat: add folder support (#548) * fix: Fixed the window reloading logic. * feat: Added the imageFolders configuration option (#529) * restore 到原代码并调整字段 * feat: 获取图片换成 glob (#529) * feat: 去掉folder配置,images兼容更多种类路径,以及文件夹 (#529) * feat: images 支持多平台文件路径、文件夹 (#529, #532) * feat: 调整`images`配置说明 (#529, #532) * 更新版本、CHANGELOG (#557) * update docs、CHANGELOG (#557) * feat: 替换 glob 为 fast-glob (#557) --------- Co-authored-by: 蕾姆哈特丶 <[email protected]>
1 parent 58c7658 commit ebe1bb2

File tree

13 files changed

+291
-128
lines changed

13 files changed

+291
-128
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## v2.0.4 (2025/11/12)
2+
3+
1. Feat folder - Add support for different system paths and folders, support by @shalldie and @Remhardt in [#557](https://github.com/shalldie/vscode-background/pull/557)
4+
2. Add auxiliary bar support by @suiyun39 in [#544](https://github.com/shalldie/vscode-background/pull/544)
5+
6+
---
7+
8+
1. Feat folder - 添加对不同系统路径、以及文件夹的支持。By @shalldie and @Remhardt in [#557](https://github.com/shalldie/vscode-background/pull/557)
9+
2. 添加辅助面板配置 by @suiyun39 in [#544](https://github.com/shalldie/vscode-background/pull/544)
10+
11+
---
12+
113
## v2.0.3 (2024/11/14)
214

315
- add code-server support (添加了 code-server 支持) by @shalldie in [#498](https://github.com/shalldie/vscode-background/pull/498)

README.ja-JP.md

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@
6565

6666
エディタ部分の設定を行うには、`background.editor`を編集します.
6767

68-
| 設定 || デフォルト | 説明 |
69-
| :--------- | :--------: | :----------: | :---------------------------------------------------------------------------------------- |
70-
| `useFront` | `boolean` | `true` | 画像を最前面に表示するかどうかを制御します。 |
71-
| `style` | `object` | `{}` | 全ての画像に適応される CSS を制御します。 [MDN Reference][mdn-css] |
72-
| `styles` | `object[]` | `[{},{},{}]` | 個別の画像に適応される CSS を制御します。 |
73-
| `images` | `string[]` | `[]` | `https`または`file`プロトコルで画像のパスを指定してください。複数指定することもできます。 |
74-
| `interval` | `number` | `0` | 次の画像を表示するまでの秒数を制御します。`0`の場合、画像は変更されません。 |
75-
| `random` | `boolean` | `false` | 画像の表示順をランダムにするかを制御します。 |
68+
| 設定 || デフォルト | 説明 |
69+
| :--------- | :--------: | :----------: | :-------------------------------------------------------------------------- |
70+
| `useFront` | `boolean` | `true` | 画像を最前面に表示するかどうかを制御します。 |
71+
| `style` | `object` | `{}` | 全ての画像に適応される CSS を制御します。 [MDN Reference][mdn-css] |
72+
| `styles` | `object[]` | `[{},{},{}]` | 個別の画像に適応される CSS を制御します。 |
73+
| `images` | `string[]` | `[]` | カスタム画像に対応、オンライン画像やローカル画像、フォルダもサポート。 |
74+
| `interval` | `number` | `0` | 次の画像を表示するまでの秒数を制御します。`0`の場合、画像は変更されません。 |
75+
| `random` | `boolean` | `false` | 画像の表示順をランダムにするかを制御します。 |
7676

7777
[mdn-css]: https://developer.mozilla.org/docs/Web/CSS
7878

@@ -88,8 +88,18 @@
8888
"opacity": 0.6
8989
},
9090
"styles": [{}, {}, {}],
91-
// ローカルの画像へのfileプロトコルによるパスは、ブラウザにドラッグアンドドロップすることで簡単に取得できます
92-
"images": ["https://pathtoimage.png", "file:///path/to/local/file"],
91+
// `images`はオンライン画像、ローカル画像、およびフォルダをサポートしています。
92+
"images": [
93+
// オンライン画像については、`https`のみ許可されています。
94+
"https://hostname/online.jpg",
95+
// ローカル画像
96+
"file:///local/path/img.jpeg",
97+
"/home/xie/downloads/img.gif",
98+
"C:/Users/xie/img.bmp",
99+
"D:\\downloads\\images\\img.webp",
100+
// ローカルフォルダ
101+
"/home/xie/images"
102+
],
93103
"interval": 0,
94104
"random": false
95105
}
@@ -102,7 +112,7 @@
102112

103113
| 設定 || デフォルト | 説明 |
104114
| :--------- | :--------: | :--------: | :--------------------------------------------------------------------------------------------------------- |
105-
| `images` | `string[]` | `[]` | `https`または`file`プロトコルで画像のパスを指定してください。複数指定することもできます。 |
115+
| `images` | `string[]` | `[]` | カスタム画像に対応、オンライン画像やローカル画像、フォルダもサポート。 |
106116
| `opacity` | `number` | `0.1` | 画像の不透明度を制御します、[opacity][mdn-opacity]へのエイリアスです。推奨値 `0.1 ~ 0.3`|
107117
| `size` | `string` | `cover` | [background-size][mdn-background-size]へのエイリアスです。推奨 `cover`,縦横比を保ったまま領域を覆います。 |
108118
| `position` | `string` | `center` | [background-position][mdn-background-position]へのエイリアスです。デフォルト値は `center` です。 |
@@ -118,8 +128,18 @@ example:
118128
```json
119129
{
120130
"background.fullscreen": {
121-
// ローカルの画像へのfileプロトコルによるパスは、ブラウザにドラッグアンドドロップすることで簡単に取得できます
122-
"images": ["https://pathtoimage.png", "file:///path/to/local/file"],
131+
// `images`はオンライン画像、ローカル画像、およびフォルダをサポートしています。
132+
"images": [
133+
// オンライン画像については、`https`のみ許可されています。
134+
"https://hostname/online.jpg",
135+
// ローカル画像
136+
"file:///local/path/img.jpeg",
137+
"/home/xie/downloads/img.gif",
138+
"C:/Users/xie/img.bmp",
139+
"D:\\downloads\\images\\img.webp",
140+
// ローカルフォルダ
141+
"/home/xie/images"
142+
],
123143
"opacity": 0.1,
124144
"size": "cover",
125145
"position": "center",

README.md

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ User defined requirements can be met by changing the configuration(`settings.jso
6767

6868
Edit `background.editor` to config editor section.
6969

70-
| Name | Type | Default | Description |
71-
| :--------- | :--------: | :----------: | :--------------------------------------------------------- |
72-
| `useFront` | `boolean` | `true` | Place the image above or below the code. |
73-
| `style` | `object` | `{}` | Custom style for images. [MDN Reference][mdn-css] |
74-
| `styles` | `object[]` | `[{},{},{}]` | Each style of editor section image. |
75-
| `images` | `string[]` | `[]` | Your custom images, support `https` and `file` protocol. |
76-
| `interval` | `number` | `0` | Seconds of interval for carousel, default `0` to disabled. |
77-
| `random` | `boolean` | `false` | Whether to randomly display images. |
70+
| Name | Type | Default | Description |
71+
| :--------- | :--------: | :----------: | :------------------------------------------------------------------- |
72+
| `useFront` | `boolean` | `true` | Place the image above or below the code. |
73+
| `style` | `object` | `{}` | Custom style for images. [MDN Reference][mdn-css] |
74+
| `styles` | `object[]` | `[{},{},{}]` | Each style of editor section image. |
75+
| `images` | `string[]` | `[]` | Custom images, supports online and local images, as well as folders. |
76+
| `interval` | `number` | `0` | Seconds of interval for carousel, default `0` to disabled. |
77+
| `random` | `boolean` | `false` | Whether to randomly display images. |
7878

7979
[mdn-css]: https://developer.mozilla.org/docs/Web/CSS
8080

@@ -90,8 +90,18 @@ example:
9090
"opacity": 0.6
9191
},
9292
"styles": [{}, {}, {}],
93-
// Local images can be dragged into the browser to quickly get the file protocol address from the address bar
94-
"images": ["https://pathtoimage.png", "file:///path/to/local/file"],
93+
// `images` supports online and local images, as well as folders.
94+
"images": [
95+
// online images, only `https` is allowed.
96+
"https://hostname/online.jpg",
97+
// local images
98+
"file:///local/path/img.jpeg",
99+
"/home/xie/downloads/img.gif",
100+
"C:/Users/xie/img.bmp",
101+
"D:\\downloads\\images\\img.webp",
102+
// local folders
103+
"/home/xie/images"
104+
],
95105
"interval": 0,
96106
"random": false
97107
}
@@ -104,7 +114,7 @@ Edit `background.fullscreen`、`background.sidebar`、`background.auxiliarybar`
104114

105115
| Name | Type | Default | Description |
106116
| :--------- | :--------: | :------: | :--------------------------------------------------------------------------------------- |
107-
| `images` | `string[]` | `[]` | Your custom images, support `https` and `file` protocol. |
117+
| `images` | `string[]` | `[]` | Custom images, supports online and local images, as well as folders. |
108118
| `opacity` | `number` | `0.1` | Opacity of the images, alias to [opacity][mdn-opacity], `0.1 ~ 0.3` recommended. |
109119
| `size` | `string` | `cover` | Alias to [background-size][mdn-background-size], `cover` to self-adaption (recommended). |
110120
| `position` | `string` | `center` | Alias to [background-position][mdn-background-position], default `center`. |
@@ -120,8 +130,18 @@ example:
120130
```json
121131
{
122132
"background.fullscreen": {
123-
// Local images can be dragged into the browser to quickly get the file protocol address from the address bar
124-
"images": ["https://pathtoimage.png", "file:///path/to/local/file"],
133+
// `images` supports online and local images, as well as folders.
134+
"images": [
135+
// online images, only `https` is allowed.
136+
"https://hostname/online.jpg",
137+
// local images
138+
"file:///local/path/img.jpeg",
139+
"/home/xie/downloads/img.gif",
140+
"C:/Users/xie/img.bmp",
141+
"D:\\downloads\\images\\img.webp",
142+
// local folders
143+
"/home/xie/images"
144+
],
125145
"opacity": 0.1,
126146
"size": "cover",
127147
"position": "center",

README.zh-CN.md

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
| `useFront` | `boolean` | `true` | 把图片放在代码的上方或下方。 |
7171
| `style` | `object` | `{}` | 自定义图片样式。 [MDN Reference][mdn-css] |
7272
| `styles` | `object[]` | `[{},{},{}]` | 为每一个图片自定义样式。 |
73-
| `images` | `string[]` | `[]` | 自定义图片,支持 `https``file` 协议。 |
73+
| `images` | `string[]` | `[]` | 自定义图片,支持在线和本地图片,以及文件夹。 |
7474
| `interval` | `number` | `0` | 单位 ``,轮播时候图片切换间隔,默认 `0` 表示不开启。 |
7575
| `random` | `boolean` | `false` | 是否随机展示图片。 |
7676

@@ -88,8 +88,18 @@ example:
8888
"opacity": 0.6
8989
},
9090
"styles": [{}, {}, {}],
91-
// 本地图片可以拖到浏览器中,快速从地址栏得到file协议的地址
92-
"images": ["https://pathtoimage.png", "file:///path/to/local/file"],
91+
// `images` 支持在线和本地图片,以及文件夹。
92+
"images": [
93+
// 在线图片,只允许 `https` 协议
94+
"https://hostname/online.jpg",
95+
// 本地图片
96+
"file:///local/path/img.jpeg",
97+
"/home/xie/downloads/img.gif",
98+
"C:/Users/xie/img.bmp",
99+
"D:\\downloads\\images\\img.webp",
100+
// 文件夹
101+
"/home/xie/images"
102+
],
93103
"interval": 0,
94104
"random": false
95105
}
@@ -102,7 +112,7 @@ example:
102112

103113
| 名称 | 类型 | 默认值 | 描述 |
104114
| :--------- | :--------: | :------: | :--------------------------------------------------------------------------- |
105-
| `images` | `string[]` | `[]` | 自定义图片,支持 `https``file` 协议。 |
115+
| `images` | `string[]` | `[]` | 自定义图片,支持在线和本地图片,以及文件夹。 |
106116
| `opacity` | `number` | `0.1` | 透明度,等同 css [opacity][mdn-opacity],建议 `0.1 ~ 0.3`|
107117
| `size` | `string` | `cover` | 等同 css [background-size][mdn-background-size], 建议使用 `cover` 来自适应。 |
108118
| `position` | `string` | `center` | 等同 css [background-position][mdn-background-position], 默认值 `center`|
@@ -118,8 +128,18 @@ example:
118128
```json
119129
{
120130
"background.fullscreen": {
121-
// 本地图片可以拖到浏览器中,快速从地址栏得到file协议的地址
122-
"images": ["https://pathtoimage.png", "file:///path/to/local/file"],
131+
// `images` 支持在线和本地图片,以及文件夹。
132+
"images": [
133+
// 在线图片,只允许 `https` 协议
134+
"https://hostname/online.jpg",
135+
// 本地图片
136+
"file:///local/path/img.jpeg",
137+
"/home/xie/downloads/img.gif",
138+
"C:/Users/xie/img.bmp",
139+
"D:\\downloads\\images\\img.webp",
140+
// 文件夹
141+
"/home/xie/images"
142+
],
123143
"opacity": 0.1,
124144
"size": "cover",
125145
"position": "center",

docs/welcome.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@
22

33
Welcome to use `background@${VERSION}`, the new version has more features and will bring you a better coding experience!
44

5+
Different system paths and folders are supported in `images` now:
6+
7+
```json
8+
{
9+
"images": [
10+
// online images, only `https` is allowed.
11+
"https://hostname/online.jpg",
12+
// local images
13+
"file:///local/path/img.jpeg",
14+
"/home/xie/downloads/img.gif",
15+
"C:/Users/xie/img.bmp",
16+
"D:\\downloads\\images\\img.webp",
17+
// local folders
18+
"/home/xie/images"
19+
]
20+
}
21+
```
22+
523
## More configurable sections
624

725
Each section can be customized with features such as `custom images/styles``carousel``random display`...
@@ -14,10 +32,11 @@ Each section has independent configuration, see [README.md](https://github.com/s
1432

1533
```json
1634
{
17-
"background.sidebar": {...}, // sidebar
18-
"background.editor": {...}, // editor
19-
"background.panel": {...}, // panel
20-
"background.fullscreen": {...} // fullscreen
35+
"background.sidebar": {...}, // sidebar
36+
"background.editor": {...}, // editor
37+
"background.panel": {...}, // panel
38+
"background.fullscreen": {...}, // fullscreen
39+
"background.auxiliarybar": {...} // auxiliarybar
2140
}
2241
```
2342

docs/welcome.zh-CN.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@
22

33
欢迎使用 `background@${VERSION}`,新版本拥有更多的功能,会给你带来更好的编码体验!
44

5+
现在 `images` 支持了多系统格式的路径以及文件夹:
6+
7+
```json
8+
{
9+
"images": [
10+
// 在线图片,只允许 `https` 协议
11+
"https://hostname/online.jpg",
12+
// 本地图片
13+
"file:///local/path/img.jpeg",
14+
"/home/xie/downloads/img.gif",
15+
"C:/Users/xie/img.bmp",
16+
"D:\\downloads\\images\\img.webp",
17+
// 文件夹
18+
"/home/xie/images"
19+
]
20+
}
21+
```
22+
523
## 更多的可配置区域
624

725
每块区域都可以自定义 `图片/样式``轮播``随机展示` 等。
@@ -14,10 +32,11 @@
1432

1533
```json
1634
{
17-
"background.sidebar": {...}, // 侧边栏
18-
"background.editor": {...}, // 编辑器
19-
"background.panel": {...}, // 面板
20-
"background.fullscreen": {...} // 全屏
35+
"background.sidebar": {...}, // 侧边栏
36+
"background.editor": {...}, // 编辑器
37+
"background.panel": {...}, // 面板
38+
"background.fullscreen": {...}, // 全屏
39+
"background.auxiliarybar": {...} // 辅助栏
2140
}
2241
```
2342

0 commit comments

Comments
 (0)