From 8ec128121f862ca6a4b387d48d14518d6c46914c Mon Sep 17 00:00:00 2001 From: PiEgg Date: Wed, 19 Dec 2018 11:52:27 +0800 Subject: [PATCH] Added: pasteStyle handler in gallery page --- package.json | 4 +- src/main/index.js | 2 - src/main/utils/picgoCoreIPC.js | 1 - src/renderer/pages/Gallery.vue | 88 ++++++++++++++++++++++++---------- src/renderer/pages/Upload.vue | 2 +- yarn.lock | 14 +++--- 6 files changed, 75 insertions(+), 36 deletions(-) diff --git a/package.json b/package.json index 861d9bf..3aa335b 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "dependencies": { "axios": "^0.16.1", "dateformat": "^3.0.3", - "element-ui": "^2.0.5", + "element-ui": "^2.4.11", "fs-extra": "^4.0.2", "image-size": "^0.6.1", "keycode": "^2.1.9", @@ -81,7 +81,7 @@ "lowdb": "^1.0.0", "md5": "^2.2.1", "melody.css": "^1.0.2", - "picgo": "^1.1.10", + "picgo": "^1.1.11", "qiniu": "^7.1.1", "request": "^2.83.0", "request-promise": "^4.2.2", diff --git a/src/main/index.js b/src/main/index.js index ce87202..93ffab3 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -512,8 +512,6 @@ if (process.env.XDG_CURRENT_DESKTOP && process.env.XDG_CURRENT_DESKTOP.includes( app.on('ready', () => { createWindow() createSettingWindow() - // reset localstorage state - settingWindow.webContents.executeJavaScript(`localStorage.setItem('plugins', '')`) if (process.platform === 'darwin' || process.platform === 'win32') { createTray() } diff --git a/src/main/utils/picgoCoreIPC.js b/src/main/utils/picgoCoreIPC.js index b81ab46..c6b1037 100644 --- a/src/main/utils/picgoCoreIPC.js +++ b/src/main/utils/picgoCoreIPC.js @@ -37,7 +37,6 @@ const handleGetPluginList = (ipcMain, STORE_PATH, CONFIG_PATH) => { ipcMain.on('getPluginList', event => { const picgo = new PicGo(CONFIG_PATH) const pluginList = picgo.pluginLoader.getList() - // console.log(pluginList.length) const list = [] for (let i in pluginList) { const plugin = picgo.pluginLoader.getPlugin(pluginList[i]) diff --git a/src/renderer/pages/Gallery.vue b/src/renderer/pages/Gallery.vue index e68ef3a..f50ba0b 100644 --- a/src/renderer/pages/Gallery.vue +++ b/src/renderer/pages/Gallery.vue @@ -3,29 +3,58 @@
相册 - {{ filterList.length }}
- + - + - -
- {{ item.name }} -
+ + + + + + + + + + +
- + -
+
批量复制
-
+
批量删除
@@ -98,7 +127,15 @@ export default { choosedList: {}, choosedPicBed: [], searchText: '', - handleBarActive: false + handleBarActive: false, + pasteStyle: '', + pasteStyleMap: { + Markdown: 'markdown', + HTML: 'HTML', + URL: 'URL', + UBB: 'UBB', + Custom: 'Custom' + } } }, created () { @@ -108,6 +145,7 @@ export default { this.filterList = this.getGallery() }) }) + this.getPasteStyle() }, computed: { filterList: { @@ -282,6 +320,14 @@ export default { }, toggleHandleBar () { this.handleBarActive = !this.handleBarActive + }, + getPasteStyle () { + this.pasteStyle = this.$db.read().get('settings.pasteStyle').value() || 'markdown' + }, + handlePasteStyleChange (val) { + this.$db.read().set('settings.pasteStyle', val) + .write() + this.pasteStyle = val } }, beforeDestroy () { @@ -305,11 +351,12 @@ export default { .item-base background #2E2E2E text-align center - margin-bottom 10px padding 5px 0 cursor pointer font-size 13px transition all .2s ease-in-out + height: 28px + box-sizing: border-box &.copy cursor not-allowed background #49B1F5 @@ -324,10 +371,10 @@ export default { cursor pointer background #F15140 color #fff -.long-list - width: calc(83.3333333% - 6px) #gallery-view position relative + .round + border-radius 14px .pull-right float right .gallery-list @@ -341,8 +388,8 @@ export default { transition all .2s ease-in-out .1s width 100% &.small - height: 245px - top: 152px + height: 287px + top: 113px &__img height 150px position relative @@ -382,14 +429,7 @@ export default { color #F15140 .handle-bar color #ddd - .pic-bed-item - @extend .item-base - &:hover - background #A4D8FA - color #fff - &.active - background #49B1F5 - color #fff + margin-bottom 10px .el-input__inner - border-radius 0 + border-radius 14px \ No newline at end of file diff --git a/src/renderer/pages/Upload.vue b/src/renderer/pages/Upload.vue index d226ae0..a3a355e 100644 --- a/src/renderer/pages/Upload.vue +++ b/src/renderer/pages/Upload.vue @@ -25,7 +25,7 @@ :show-text="false" class="upload-progress" :class="{ 'show': showProgress }" - :status="showError ? 'exception' : ''" + :status="showError ? 'exception' : 'text'" >
diff --git a/yarn.lock b/yarn.lock index 86b4f15..4bcc9ed 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3058,9 +3058,10 @@ electron@1.8.8: electron-download "^3.0.1" extract-zip "^1.0.3" -element-ui@^2.0.5: - version "2.4.7" - resolved "https://registry.yarnpkg.com/element-ui/-/element-ui-2.4.7.tgz#073b404222815c08ba2e68b39ec8e6ff7b7b13e0" +element-ui@^2.4.11: + version "2.4.11" + resolved "https://registry.yarnpkg.com/element-ui/-/element-ui-2.4.11.tgz#db6a2d37001b8fe5fff9f176fb58bb3908cfa9c9" + integrity sha512-RtgK0t840NAFTajGMWvylzZRSX1EkZ7V4YgAoBxhv4TtkeMscLuk/IdYOzPdlQq6IN0byx1YVBxCX+u4yYkGvw== dependencies: async-validator "~1.8.1" babel-helper-vue-jsx-merge-props "^2.0.0" @@ -6196,9 +6197,10 @@ performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" -picgo@^1.1.10: - version "1.1.10" - resolved "https://registry.yarnpkg.com/picgo/-/picgo-1.1.10.tgz#a80ab4f95059e05d96e7bf9ecef9074202539f87" +picgo@^1.1.11: + version "1.1.11" + resolved "https://registry.yarnpkg.com/picgo/-/picgo-1.1.11.tgz#a79067e37bfab84d557a7dfe51a733a63ccf7d8f" + integrity sha512-J4igRhH3eRHf7MrgV9eLF+nwABCQyfuKQwtRvKkJXyTiDTuhvfpjv4WOBcW5ilqWUAsgwIP/rXaw1mxxQ5bQbQ== dependencies: chalk "^2.4.1" commander "^2.17.0"