Skip to content

Commit

Permalink
feat: #319 PicGO图形化配置界面-0.7.0-beta1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Feb 8, 2023
1 parent 8a11a68 commit eb50672
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 13 deletions.
6 changes: 6 additions & 0 deletions components/picgo/PicgoIndex.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@

<template>
<div class="picgo-body">
<el-alert
:title="$t('setting.picgo.index.tip')"
type="warning"
:closable="false"
/>

<!-- 上传状态 -->
<div class="upload-status">
<el-button text :loading="picgoCommonData.isUploadLoading"
Expand Down
11 changes: 9 additions & 2 deletions composables/picgo/picgoUploadCom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,16 @@ export const usePicgoUpload = (props, deps, refs) => {
* @param imgInfos
*/
const doAfterUpload = (imgInfos) => {
picgoCommonData.loggerMsg = imgInfos
let imageJson
if (typeof imgInfos == "string") {
logger.warn("doAfterUpload返回的是字符串,需要解析")
imageJson = JSON.parse(imgInfos)
} else {
imageJson = imgInfos
}

const imageJson = JSON.parse(imgInfos)
picgoCommonData.loggerMsg = JSON.stringify(imgInfos)
logger.debug("doAfterUpload,imgInfos=>", imgInfos)

if (imageJson && imageJson.length > 0) {
imageJson.forEach((img) => {
Expand Down
2 changes: 2 additions & 0 deletions locales/en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,4 +444,6 @@ export default {
"setting.picgo.picbed.uploader.config.name": "Picbed config name",
"setting.picgo.picbed.uploader.config.name.placeholder":
"Please input config name",
"setting.picgo.index.tip":
"Note: The image uploaded here will not be automatically inserted into the document. Please manually click the copy button to copy the link, and then Ctrl+V to paste it into the document. This picture list only shows the pictures contained in this document.",
}
2 changes: 2 additions & 0 deletions locales/zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,4 +443,6 @@ export default {
"setting.picgo.picbed.current.tip": "当前默认图床是:",
"setting.picgo.picbed.uploader.config.name": "图床配置名",
"setting.picgo.picbed.uploader.config.name.placeholder": "请输入配置名称",
"setting.picgo.index.tip":
"注意:此处上传的图片不会自动插入文档中,请手动点击复制按钮复制链接,然后Ctrl+V粘贴到文档中。该图片列表仅展示此文档包含的图片。",
}
2 changes: 1 addition & 1 deletion pages/index/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const init = async () => {
if (isInSiyuanOrSiyuanNewWin()) {
if (isInSiyuan()) {
setTimeout(siyuanBrowserUtil.fitTheme, 1200)
setTimeout(siyuanBrowserUtil.fitTheme, 3500)
}
let postid
Expand Down
3 changes: 2 additions & 1 deletion public/lib/siyuan/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ const initTheme = () => {
const element = window.document.querySelector(".protyle")
const computedStyle = window.getComputedStyle(element)
const bgColor = computedStyle.getPropertyValue("background-color")
console.log("custom backgroundColor=>", bgColor)
window.customstyle.backgroundColor = bgColor

console.log("开始customstyle适配=>", window.customstyle)
}

module.exports = initTheme
2 changes: 1 addition & 1 deletion public/lib/siyuanhook.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ const initMethods = {
`${dataDir}/widgets/sy-post-publisher/lib/siyuan/theme.js`,
"自定义主题片段"
)
setTimeout(initTheme, 1000)
setTimeout(initTheme, 3000)
},

/**
Expand Down
2 changes: 1 addition & 1 deletion public/manifest.dev.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "开发版 - 思源笔记发布辅助工具",
"version": "0.7.0",
"version": "0.7.0-beta1",
"manifest_version": 3,
"author": "terwer",
"description": "思源笔记发布辅助工具,支持博客式只读浏览,多平台文章发布。",
Expand Down
2 changes: 1 addition & 1 deletion public/manifest.prod.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "思源笔记发布辅助工具",
"version": "0.7.0",
"version": "0.7.0-beta1",
"manifest_version": 3,
"author": "terwer",
"icons": {
Expand Down
2 changes: 1 addition & 1 deletion public/mv2/manifest-v2-for-firefox.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "开发版 - 思源笔记发布辅助工具",
"version": "0.7.0",
"version": "0.7.0-beta1",
"manifest_version": 2,
"author": "terwer",
"icons": {
Expand Down
2 changes: 1 addition & 1 deletion public/widget.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"name": "sy-post-publisher",
"author": "terwer",
"url": "https://github.com/terwer/src-sy-post-publisher",
"version": "0.7.0"
"version": "0.7.0-beta1"
}
9 changes: 5 additions & 4 deletions utils/otherlib/siyuanBrowserUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,11 @@ export const doCloseExportWin = () => {
* 打开的时候 syWin = window.parent
*/
export const doOpenExportWin = async (pageId, pageUrl) => {
const syWin = window.parent
if (syWin.terwer && syWin.terwer.renderPublishHelper) {
const syWin = getSiyuanWindow()

if (syWin.syp && syWin.syp.renderPublishHelper) {
// 打开弹窗
syWin.terwer.renderPublishHelper(pageId, pageUrl)
syWin.syp.renderPublishHelper(pageId, pageUrl)
} else {
ElMessage.warning(
"renderPublishHelper失败,未找到hook方法,请在自定义js片段添加 import('/widgets/sy-post-publisher/lib/siyuanhook.js') ,并重启思源笔记"
Expand Down Expand Up @@ -113,7 +114,7 @@ const fitTheme = () => {
"--custom-app-bg-color",
customstyle.backgroundColor
)
console.log("适配--custom-app-bg-color完成=>", customstyle.backgroundColor)
console.log("适配customstyle完成=>", customstyle)
}

// 统一访问入口
Expand Down

0 comments on commit eb50672

Please sign in to comment.