同步插件源代码并补齐标准项目文件

This commit is contained in:
XIGE
2026-11-26 15:05:05 +08:00
commit cdbe60b5fe
37 changed files with 1738 additions and 0 deletions

29
.gitignore vendored Normal file
View File

@@ -0,0 +1,29 @@
# Dependencies and build output
node_modules/
vendor/
dist/
build/
out/
main.js
*.apk
# Build tools and IDE
.gradle/
.idea/
*.iml
gradle/
gradlew
gradlew.bat
# Environment and secrets
.env
.env.*
keystore.properties
*.jks
credentials*.json
# Runtime data and backups
data/
备份/
*.log
.DS_Store

7
CHANGELOG.md Normal file
View File

@@ -0,0 +1,7 @@
# 变更记录
## 2026-11-26 · 初始同步
- 同步插件源代码到新 Gitea 仓库。
- 补齐 README、LICENSE、.gitignore、CONTRIBUTING 等标准项目文件。
- 本仓库仅包含插件实现代码与必要资源,排除依赖、构建工具、编译产物、环境配置与备份数据。

19
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,19 @@
# 贡献指南
欢迎对本插件提出改进建议或提交代码。
## 提交前检查
- 仅提交插件实现代码、资源与必要文档,不提交依赖目录、编译产物、运行时数据或备份文件。
- 保持现有目录结构;如新增平台适配代码,请在 `README.md` 的目录结构中说明。
- 涉及对外服务或凭据的配置不要写入代码或文档。
## 提交流程
1. Fork 仓库并创建功能分支。
2. 完成修改后提交 Pull Request,说明改动目的与影响范围。
3. 重要功能变更请同步更新 `CHANGELOG.md`。
## 问题反馈
请通过仓库 Issue 反馈问题,并尽可能提供插件类型、版本与复现步骤。

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021 Shoujian Zheng
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

31
README.md Normal file
View File

@@ -0,0 +1,31 @@
# Qiniu Image Uploader
> 仓库:`Qiniu` · 类型:Obsidian 插件 · 版本:`1.1.5` · 作者:Jade Zheng
将剪贴板图片上传到七牛云并插入 Obsidian 笔记。
本仓库同步自本地插件源码,**仅包含插件实现代码与必要资源**;不包含依赖、构建工具、编译产物、环境配置或备份数据。
## 目录结构
- `manifest.json`
- `src/`
- `styles.css`
## 安装与使用
1. 本仓库仅包含插件源代码,未包含依赖与构建工具;请先按 Obsidian 插件标准流程构建生成 `main.js`。
2. 将 `manifest.json`、构建后的 `main.js`、`styles.css` 及源码目录放入 `<Vault>/.obsidian/plugins/<插件 id>/`。
3. 在 Obsidian「设置 → 第三方插件」中启用该插件。
## 开发与贡献
详见 [CONTRIBUTING.md](CONTRIBUTING.md)。
## 授权
授权条款见 [LICENSE](LICENSE)(MIT License)。第三方组件版权归各自作者所有。
## 变更记录
详见 [CHANGELOG.md](CHANGELOG.md)。

10
manifest.json Normal file
View File

@@ -0,0 +1,10 @@
{
"id": "qiniu-image-uploader",
"name": "Qiniu Image Uploader",
"version": "1.1.5",
"minAppVersion": "0.15.0",
"description": "Uploads images from your clipboard to qiniu.com and embeds uploaded image to your note.",
"author": "Jade Zheng",
"authorUrl": "https://github.com/jianzs",
"isDesktopOnly": false
}

13
src/lang/README.md Normal file
View File

@@ -0,0 +1,13 @@
## Localization
The plugin has full localization support, and will attempt to load the current Obsidian locale. If one does not exist, it will fall back to English.
### Adding a new Locale
New locales can be added by creating a pull request. Two things should be done in this pull request:
1. Create the locale in the `locales` folder by copying the `en.ts` file. This file should be given a name matching the string returned by `moment.locale()`.
2. Create the translation by editing the value of each property.
3. Add the import in `locales.ts`.
4. Add the language to the `localeMap` variable.

57
src/lang/helpers.ts Normal file
View File

@@ -0,0 +1,57 @@
import { moment } from 'obsidian';
import ar from './locale/ar';
import cz from './locale/cz';
import da from './locale/da';
import de from './locale/de';
import en from './locale/en';
import enGB from './locale/en-gb';
import es from './locale/es';
import fr from './locale/fr';
import hi from './locale/hi';
import id from './locale/id';
import it from './locale/it';
import ja from './locale/ja';
import ko from './locale/ko';
import nl from './locale/nl';
import no from './locale/no';
import pl from './locale/pl';
import pt from './locale/pt';
import ptBR from './locale/pt-br';
import ro from './locale/ro';
import ru from './locale/ru';
import tr from './locale/tr';
import zhCN from './locale/zh-cn';
import zhTW from './locale/zh-tw';
const localeMap: { [k: string]: Partial<typeof en> } = {
ar,
cs: cz,
da,
de,
en,
'en-gb': enGB,
es,
fr,
hi,
id,
it,
ja,
ko,
nl,
nn: no,
pl,
pt,
'pt-br': ptBR,
ro,
ru,
tr,
'zh-cn': zhCN,
'zh-tw': zhTW,
};
const locale = localeMap[moment.locale()];
export function t(str: keyof typeof en): string {
return (locale && locale[str]) || en[str];
}

3
src/lang/locale/ar.ts Normal file
View File

@@ -0,0 +1,3 @@
// العربية
export default {};

3
src/lang/locale/cz.ts Normal file
View File

@@ -0,0 +1,3 @@
// čeština
export default {};

3
src/lang/locale/da.ts Normal file
View File

@@ -0,0 +1,3 @@
// Dansk
export default {};

3
src/lang/locale/de.ts Normal file
View File

@@ -0,0 +1,3 @@
// Deutsch
export default {};

3
src/lang/locale/en-gb.ts Normal file
View File

@@ -0,0 +1,3 @@
// British English
export default {};

42
src/lang/locale/en.ts Normal file
View File

@@ -0,0 +1,42 @@
// English
export default {
// settings.ts
"Access Key": "Access key",
"Access Key Desc": "You can get key from key management from Qiniu personal center.",
"Access Key Input": "Enter your access key",
"Access Secret Key": "Access secret key",
"Access Secret Key Desc": "You can get key from key management from Qiniu personal center.",
"Access Secret Key Input": "Enter your access secret key",
"Bucket Name": "Bucket name",
"Bucket Name Desc": "Please indicate the bucket where you would like to upload the image.",
"Bucket Name Input": "The specific bucket",
"Domain": "Domain",
"Domain Desc": "Go to the Qiniu bucket settings to configure the external link domain name, and enter the domain here.",
"Domain Input": "The external link domain name of above bucket",
"Name Prefix": "Name prefix",
"Name Prefix Desc": "The uploaded filename's prefix in Qiniu, the uploaded filename will be: {{prefix}}{{timestamp}}.",
"Name Prefix Input": "The image's prefix",
"Time Format": "Time format",
"Time Format Desc": "The time format in the configuration file name, the default is the timestamp format, and you can configure the format according to the [document](https://github.com/date-fns/date-fns/blob/main/docs/unicodeTokens.md), for example: yyMMdd-HHmmss.",
"Time Format Input": "Time format",
"Region": "Region",
"Region Desc": "The region in which the bucket is located.",
"North China - Hebei": "North China - Hebei",
"East China - Zhejiang": "East China - Zhejiang",
"East China - Zhejiang 2": "East China - Zhejiang 2",
"South China - Guangdong": "South China - Guangdong",
"North America - Los Angeles": "North America - Los Angeles",
"Asia Pacific - Singapore (formerly Southeast Asia)": "Asia Pacific - Singapore (formerly Southeast Asia)",
"HTTPS": "HTTPS",
"HTTPS Desc": "Whether to use HTTPS protocol",
"YES": "Yes",
"NO": "No",
};

3
src/lang/locale/es.ts Normal file
View File

@@ -0,0 +1,3 @@
// Español
export default {};

3
src/lang/locale/fr.ts Normal file
View File

@@ -0,0 +1,3 @@
// français
export default {};

3
src/lang/locale/hi.ts Normal file
View File

@@ -0,0 +1,3 @@
// हिन्दी
export default {};

3
src/lang/locale/id.ts Normal file
View File

@@ -0,0 +1,3 @@
// Bahasa Indonesia
export default {};

3
src/lang/locale/it.ts Normal file
View File

@@ -0,0 +1,3 @@
// Italiano
export default {};

3
src/lang/locale/ja.ts Normal file
View File

@@ -0,0 +1,3 @@
// 日本語
export default {};

3
src/lang/locale/ko.ts Normal file
View File

@@ -0,0 +1,3 @@
// 한국어
export default {};

3
src/lang/locale/nl.ts Normal file
View File

@@ -0,0 +1,3 @@
// Nederlands
export default {};

3
src/lang/locale/no.ts Normal file
View File

@@ -0,0 +1,3 @@
// Norsk
export default {};

3
src/lang/locale/pl.ts Normal file
View File

@@ -0,0 +1,3 @@
// język polski
export default {};

4
src/lang/locale/pt-br.ts Normal file
View File

@@ -0,0 +1,4 @@
// Português do Brasil
// Brazilian Portuguese
export default {};

3
src/lang/locale/pt.ts Normal file
View File

@@ -0,0 +1,3 @@
// Português
export default {};

3
src/lang/locale/ro.ts Normal file
View File

@@ -0,0 +1,3 @@
// Română
export default {};

3
src/lang/locale/ru.ts Normal file
View File

@@ -0,0 +1,3 @@
// русский
export default {};

3
src/lang/locale/tr.ts Normal file
View File

@@ -0,0 +1,3 @@
// Türkçe
export default {};

42
src/lang/locale/zh-cn.ts Normal file
View File

@@ -0,0 +1,42 @@
// 简体中文
export default {
// settings.ts
"Access Key": "Access Key",
"Access Key Desc": "从七牛云/个人中心/密钥管理获取 Access Key",
"Access Key Input": "请输入 Access Key",
"Access Secret Key": "Access Secret Key",
"Access Secret Key Desc": "从七牛云/个人中心/密钥管理获取Access Secret Key",
"Access Secret Key Input": "请输入 Access Secret Key",
"Bucket Name": "空间名称",
"Bucket Name Desc": "指定你要上传到哪个存储空间",
"Bucket Name Input": "指定的空间名称",
"Domain": "外链域名",
"Domain Desc": "七牛云需要配置外链域名才能外部访问,在存储空间配置后,将配置域名输入在这里",
"Domain Input": "存储空间对应的外链域名",
"Name Prefix": "文件名前缀",
"Name Prefix Desc": "配置上传文件的前缀,文件名将为:前缀{{timestamp}}",
"Name Prefix Input": "上传后的文件前缀",
"Time Format": "时间格式",
"Time Format Desc": "配置文件名中时间的格式,默认为时间戳格式,可按[文档](https://github.com/date-fns/date-fns/blob/main/docs/unicodeTokens.md)配置,例如:yyMMdd-HHmmss",
"Time Format Input": "时间格式",
"Region": "区域",
"Region Desc": "指明桶所在的区域",
"North China - Hebei": "华北-河北",
"East China - Zhejiang": "华东-浙江",
"East China - Zhejiang 2": "华东-浙江2",
"South China - Guangdong": "华南-广东",
"North America - Los Angeles": "北美-洛杉矶",
"Asia Pacific - Singapore (formerly Southeast Asia)": "亚太-新加坡(原东南亚)",
"HTTPS": "HTTPS",
"HTTPS Desc": "是否使用HTTPS协议",
"YES": "是",
"NO": "否",
};

Some files were not shown because too many files have changed in this diff Show More