mirror of
https://github.com/Molunerfinn/PicGo.git
synced 2024-04-21 10:31:33 +00:00
+1
-1
@@ -31,7 +31,7 @@
|
||||
"lodash-id": "^0.14.0",
|
||||
"lowdb": "^1.0.0",
|
||||
"mitt": "^3.0.0",
|
||||
"picgo": "^1.5.0",
|
||||
"picgo": "^1.5.1",
|
||||
"qrcode.vue": "^3.3.3",
|
||||
"shell-path": "2.1.0",
|
||||
"uuidv4": "^6.2.11",
|
||||
|
||||
@@ -113,6 +113,7 @@ SETTINGS_CHOOSE_LANGUAGE: Choose Language
|
||||
UPLOADER_CONFIG_NAME: Configuration Name
|
||||
UPLOADER_CONFIG_PLACEHOLDER: Please Enter Configuration Name
|
||||
SELECTED_SETTING_HINT: Selected
|
||||
SETTINGS_ENCODE_OUTPUT_URL: Encode Output(or Copyed) URL
|
||||
|
||||
# shortcut-page
|
||||
|
||||
|
||||
@@ -114,6 +114,7 @@ BUILTIN_CLIPBOARD_TIPS: 使用内置剪贴板函数而不是调用脚本获取
|
||||
UPLOADER_CONFIG_NAME: 图床配置名
|
||||
UPLOADER_CONFIG_PLACEHOLDER: 请输入配置名称
|
||||
SELECTED_SETTING_HINT: 已选中
|
||||
SETTINGS_ENCODE_OUTPUT_URL: 输出(复制) URL 时进行转义
|
||||
|
||||
# shortcut-page
|
||||
|
||||
|
||||
@@ -114,6 +114,7 @@ BUILTIN_CLIPBOARD_TIPS: 使用內建剪貼簿函數而不是調用腳本取得
|
||||
UPLOADER_CONFIG_NAME: 圖床配置名
|
||||
UPLOADER_CONFIG_PLACEHOLDER: 請輸入配置名稱
|
||||
SELECTED_SETTING_HINT: 已選中
|
||||
SETTINGS_ENCODE_OUTPUT_URL: 輸出(複製) URL 時進行轉義
|
||||
|
||||
# shortcut-page
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { IPasteStyle } from '#/types/enum'
|
||||
import db from 'apis/core/datastore'
|
||||
import { handleUrlEncode } from '~/universal/utils/common'
|
||||
|
||||
const formatCustomLink = (customLink: string, item: ImgInfo) => {
|
||||
const fileName = item.fileName!.replace(new RegExp(`\\${item.extname}$`), '')
|
||||
@@ -20,7 +22,10 @@ const formatCustomLink = (customLink: string, item: ImgInfo) => {
|
||||
}
|
||||
|
||||
export default (style: IPasteStyle, item: ImgInfo, customLink: string | undefined) => {
|
||||
const url = item.url || item.imgUrl
|
||||
let url = item.url || item.imgUrl
|
||||
if (db.get('settings.encodeOutputURL') !== false) {
|
||||
url = handleUrlEncode(url)
|
||||
}
|
||||
const _customLink = customLink || '$url'
|
||||
const tpl = {
|
||||
markdown: ``,
|
||||
|
||||
@@ -232,6 +232,16 @@
|
||||
@change="useBuiltinClipboardChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$T('SETTINGS_ENCODE_OUTPUT_URL')"
|
||||
>
|
||||
<el-switch
|
||||
v-model="form.encodeOutputURL"
|
||||
:active-text="$T('SETTINGS_OPEN')"
|
||||
:inactive-text="$T('SETTINGS_CLOSE')"
|
||||
@change="handleEncodeOutputURL"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:style="{ marginRight: '-64px' }"
|
||||
:label="$T('CHOOSE_SHOWED_PICBED')"
|
||||
@@ -558,7 +568,8 @@ const form = reactive<ISettingForm>({
|
||||
checkBetaUpdate: true,
|
||||
useBuiltinClipboard: false,
|
||||
language: 'zh-CN',
|
||||
logFileSizeLimit: 10
|
||||
logFileSizeLimit: 10,
|
||||
encodeOutputURL: true
|
||||
})
|
||||
|
||||
const languageList = i18nManager.languageList.map(item => ({
|
||||
@@ -643,6 +654,7 @@ async function initData () {
|
||||
form.checkBetaUpdate = settings.checkBetaUpdate === undefined ? true : settings.checkBetaUpdate
|
||||
form.useBuiltinClipboard = settings.useBuiltinClipboard === undefined ? false : settings.useBuiltinClipboard
|
||||
form.language = settings.language ?? 'zh-CN'
|
||||
form.encodeOutputURL = settings.encodeOutputURL === undefined ? true : settings.encodeOutputURL
|
||||
currentLanguage.value = settings.language ?? 'zh-CN'
|
||||
customLink.value = settings.customLink || '$url'
|
||||
shortKey.upload = settings.shortKey.upload
|
||||
@@ -814,6 +826,16 @@ function handleAutoCopyUrl (val: ICheckBoxValueType) {
|
||||
}
|
||||
}
|
||||
|
||||
function handleEncodeOutputURL (val: ICheckBoxValueType) {
|
||||
saveConfig('settings.encodeOutputURL', val)
|
||||
const successNotification = new Notification($T('SETTINGS_ENCODE_OUTPUT_URL'), {
|
||||
body: $T('TIPS_SET_SUCCEED')
|
||||
})
|
||||
successNotification.onclick = () => {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
function confirmLogLevelSetting () {
|
||||
if (form.logLevel.length === 0) {
|
||||
return $message.error($T('TIPS_PLEASE_CHOOSE_LOG_LEVEL'))
|
||||
|
||||
Vendored
+1
@@ -109,6 +109,7 @@ interface ILocales {
|
||||
UPLOADER_CONFIG_NAME: string
|
||||
UPLOADER_CONFIG_PLACEHOLDER: string
|
||||
SELECTED_SETTING_HINT: string
|
||||
SETTINGS_ENCODE_OUTPUT_URL: string
|
||||
SHORTCUT_NAME: string
|
||||
SHORTCUT_BIND: string
|
||||
SHORTCUT_STATUS: string
|
||||
|
||||
Vendored
+1
@@ -12,6 +12,7 @@ interface ISettingForm {
|
||||
useBuiltinClipboard: boolean
|
||||
language: string
|
||||
logFileSizeLimit: number
|
||||
encodeOutputURL: boolean
|
||||
}
|
||||
|
||||
interface IShortKeyMap {
|
||||
|
||||
@@ -5,7 +5,7 @@ export const isUrlEncode = (url: string): boolean => {
|
||||
return url !== decodeURI(url)
|
||||
} catch (e) {
|
||||
// if some error caught, try to let it go
|
||||
return true
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9737,10 +9737,10 @@ pend@~1.2.0:
|
||||
resolved "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50"
|
||||
integrity sha1-elfrVQpng/kRUzH89GY9XI4AelA=
|
||||
|
||||
picgo@^1.5.0:
|
||||
version "1.5.0"
|
||||
resolved "https://registry.npmjs.org/picgo/-/picgo-1.5.0.tgz#c7ac682253580148c8748efd54b788f98f939d39"
|
||||
integrity sha512-4OB5s9ywXbY+ipjV1Rmb4mzvtrIEaU9c/ZdVFHM0cfLhQBJD3ghYbn6lWI3qtrC/ScJvnrCo7f8fCAFzFvH2NQ==
|
||||
picgo@^1.5.1:
|
||||
version "1.5.1"
|
||||
resolved "https://registry.npmmirror.com/picgo/-/picgo-1.5.1.tgz#38fa6310fea6ec95964a82cb6e4bceb3704f08e8"
|
||||
integrity sha512-rPtz7ADsBDRwBVXo3gfKli9COgawFIfqb4TkAdT0z5oYbBjLE8qGoX6D+h9SuCcsD2KNQ/B4l6fk13nSRSCxIQ==
|
||||
dependencies:
|
||||
"@picgo/i18n" "^1.0.0"
|
||||
"@picgo/store" "^2.0.2"
|
||||
|
||||
Reference in New Issue
Block a user