From 21e2a247f9359976f2bd0e13f104f79978ed2c94 Mon Sep 17 00:00:00 2001 From: Tomasz Dziuda Date: Fri, 22 Feb 2019 11:03:54 +0100 Subject: [PATCH 01/32] #351 - added intro page for the server settings --- app/back-end/builddata.json | 2 +- app/src/components/ServerSettings.vue | 32 +++++++++++++++++++++------ 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/app/back-end/builddata.json b/app/back-end/builddata.json index 68eccf82c..467ea7fc7 100644 --- a/app/back-end/builddata.json +++ b/app/back-end/builddata.json @@ -1 +1 @@ -{"version":"0.33.3","build":11538,"status":"Beta"} +{"version":"0.33.3","build":11544,"status":"Beta"} \ No newline at end of file diff --git a/app/src/components/ServerSettings.vue b/app/src/components/ServerSettings.vue index 4b27bee2e..5bec4d6e9 100644 --- a/app/src/components/ServerSettings.vue +++ b/app/src/components/ServerSettings.vue @@ -3,7 +3,9 @@ class="content" ref="content">
- + - +
+ INTRO + +
+ Select Github Pages +
+ +
+ Select S3 +
+
+ + @@ -680,7 +698,7 @@ - + @@ -748,12 +766,12 @@ export default { return this.$store.state.currentSite.config.domain.replace('http://', '').replace('https://', '').replace('file://', ''); }, currentHttpProtocol () { - if (this.$store.state.currentSite.config.domain.indexOf('https') === 0) { - return 'https'; + if (this.$store.state.currentSite.config.domain.indexOf('file') === 0) { + return 'file'; } else if (this.$store.state.currentSite.config.domain.indexOf('http') === 0) { return 'http'; } else { - return 'file'; + return 'https'; } }, siteIsOnline () { @@ -784,7 +802,7 @@ export default { mounted () { this.domain = this.currentDomain; this.httpProtocolSelected = this.currentHttpProtocol; - this.deploymentMethodSelected = this.$store.state.currentSite.config.deployment.protocol || 'github-pages'; + this.deploymentMethodSelected = this.$store.state.currentSite.config.deployment.protocol || ''; this.deploymentSettings = Utils.deepMerge(this.deploymentSettings, JSON.parse(JSON.stringify(this.$store.state.currentSite.config.deployment))); setTimeout(() => { From ee3e22fbdcbeead9c2d6f75603d7faa5dd1f9c1a Mon Sep 17 00:00:00 2001 From: Tomasz Dziuda Date: Mon, 4 Mar 2019 13:01:09 +0100 Subject: [PATCH 02/32] #358 - added support for @utils.currentYear --- app/back-end/modules/render-html/renderer-context.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/back-end/modules/render-html/renderer-context.js b/app/back-end/modules/render-html/renderer-context.js index 00354cbc6..df27a676b 100644 --- a/app/back-end/modules/render-html/renderer-context.js +++ b/app/back-end/modules/render-html/renderer-context.js @@ -236,7 +236,10 @@ class RendererContext { bodyCustomCode: this.siteConfig.advanced.customBodyCode || '', footerCustomCode: this.siteConfig.advanced.customFooterCode || '', footerAmpCustomCode: this.siteConfig.advanced.customFooterAmpCode || '', - customHTML: this.siteConfig.advanced.customHTML || false + customHTML: this.siteConfig.advanced.customHTML || false, + utils: { + currentYear: new Date().getFullYear() + } }; // In AMP mode create special global @amp variable From df88fbb590a4426df9d45b8a3e859b085eeecf58 Mon Sep 17 00:00:00 2001 From: Tomasz Dziuda Date: Mon, 4 Mar 2019 13:22:47 +0100 Subject: [PATCH 03/32] #353 - fixed issue with links on notifications --- app/back-end/builddata.json | 2 +- app/src/components/TopBarNotification.vue | 41 ++++++++++++++--------- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/app/back-end/builddata.json b/app/back-end/builddata.json index 467ea7fc7..c65681a7b 100644 --- a/app/back-end/builddata.json +++ b/app/back-end/builddata.json @@ -1 +1 @@ -{"version":"0.33.3","build":11544,"status":"Beta"} \ No newline at end of file +{"version":"0.33.3","build":11549,"status":"Beta"} \ No newline at end of file diff --git a/app/src/components/TopBarNotification.vue b/app/src/components/TopBarNotification.vue index 38b6c6731..e99342da9 100644 --- a/app/src/components/TopBarNotification.vue +++ b/app/src/components/TopBarNotification.vue @@ -4,7 +4,7 @@ v-if="notification.visible" :data-timestamp="notification.timestamp" > @@ -22,6 +22,11 @@ import { ipcRenderer, shell } from 'electron'; export default { name: 'topbar-notification', + data () { + return { + contentEventsAdded: false + } + }, computed: { notification: function() { return this.$store.state.app.notification; @@ -32,20 +37,6 @@ export default { }, mounted: function() { let self = this; - - setTimeout(() => { - if(!this.$refs.text) { - return; - } - - this.$refs.text.addEventListener('click', function(e) { - if(e.target.tagName === 'A') { - e.preventDefault(); - shell.openExternal(e.target.getAttribute('href')); - self.closeNotification(); - } - }); - }, 0); }, methods: { getNotifications() { @@ -95,6 +86,26 @@ export default { visible: false }); } + + setTimeout(() => { + if(!this.$refs.content) { + return; + } + + if (this.contentEventsAdded) { + return; + } + + this.$refs.content.addEventListener('click', function(e) { + if(e.target.tagName === 'A') { + e.preventDefault(); + shell.openExternal(e.target.getAttribute('href')); + self.closeNotification(); + } + }); + + this.contentEventsAdded = true; + }, 500); }, closeNotification(event) { localStorage.setItem('publii-notification-close-timestamp', this.notification.timestamp); From 9b33fd0d874625f4c4828c92b01e4338ee628edf Mon Sep 17 00:00:00 2001 From: Tomasz Dziuda Date: Mon, 4 Mar 2019 14:57:39 +0100 Subject: [PATCH 04/32] #353 - fixed issue with links on notifications p.2 --- app/back-end/builddata.json | 2 +- app/src/components/TopBarNotification.vue | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/back-end/builddata.json b/app/back-end/builddata.json index c65681a7b..9ee673865 100644 --- a/app/back-end/builddata.json +++ b/app/back-end/builddata.json @@ -1 +1 @@ -{"version":"0.33.3","build":11549,"status":"Beta"} \ No newline at end of file +{"version":"0.33.3","build":11552,"status":"Beta"} \ No newline at end of file diff --git a/app/src/components/TopBarNotification.vue b/app/src/components/TopBarNotification.vue index e99342da9..cd8e2fc10 100644 --- a/app/src/components/TopBarNotification.vue +++ b/app/src/components/TopBarNotification.vue @@ -96,11 +96,11 @@ export default { return; } - this.$refs.content.addEventListener('click', function(e) { + this.$refs.content.addEventListener('click', e => { if(e.target.tagName === 'A') { e.preventDefault(); shell.openExternal(e.target.getAttribute('href')); - self.closeNotification(); + this.closeNotification(); } }); From fb66195a578e29757f46858827ff8e8dcff86d01 Mon Sep 17 00:00:00 2001 From: Tomasz Dziuda Date: Mon, 4 Mar 2019 18:42:49 +0100 Subject: [PATCH 05/32] #328 - added possibility of multiple regeneration of thumbnails without leaving the tool --- app/back-end/builddata.json | 2 +- app/src/components/RegenerateThumbnails.vue | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/back-end/builddata.json b/app/back-end/builddata.json index 9ee673865..0e62ae982 100644 --- a/app/back-end/builddata.json +++ b/app/back-end/builddata.json @@ -1 +1 @@ -{"version":"0.33.3","build":11552,"status":"Beta"} \ No newline at end of file +{"version":"0.33.3","build":11555,"status":"Beta"} \ No newline at end of file diff --git a/app/src/components/RegenerateThumbnails.vue b/app/src/components/RegenerateThumbnails.vue index 4d6d1c157..ddb47480a 100644 --- a/app/src/components/RegenerateThumbnails.vue +++ b/app/src/components/RegenerateThumbnails.vue @@ -30,7 +30,7 @@

List of the regenerated files:

@@ -63,7 +63,8 @@ export default { ], data: function() { return { - regeneratingThumbnails: false, + regeneratingInProgress: false, + regeneratingStarted: false, resultLabel: '', resultCssClass: { 'error': false, @@ -83,12 +84,13 @@ export default { return filePath.replace(this.$store.state.currentSite.siteDir, ''); }, regenerate: function() { - if(this.regeneratingThumbnails) { + if(this.regeneratingInProgress) { return; } this.buttonStatus = 'disabled preloader'; - this.regeneratingThumbnails = true; + this.regeneratingInProgress = true; + this.regeneratingStarted = true; this.files = []; this.resultLabel = 'Regenerating thumbnails...'; this.resultCssClass = { @@ -97,6 +99,10 @@ export default { 'success': false }; + ipcRenderer.removeAllListeners('app-site-regenerate-thumbnails-error'); + ipcRenderer.removeAllListeners('app-site-regenerate-thumbnails-progress'); + ipcRenderer.removeAllListeners('app-site-regenerate-thumbnails-success'); + setTimeout(() => { ipcRenderer.send('app-site-regenerate-thumbnails', { name: this.$store.state.currentSite.config.name @@ -130,6 +136,7 @@ export default { }; this.resultLabel = 'All thumbnails have been created.'; this.buttonStatus = ''; + this.regeneratingInProgress = false; }); }, 350); } From 6b88ac4f2ab9c3bb50fa4031192061a4c07db4ed Mon Sep 17 00:00:00 2001 From: Tomasz Dziuda Date: Mon, 4 Mar 2019 18:53:26 +0100 Subject: [PATCH 06/32] #356 - improved process of canceling deployment process --- app/back-end/builddata.json | 2 +- app/back-end/events/deploy.js | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/back-end/builddata.json b/app/back-end/builddata.json index 0e62ae982..f37052f5e 100644 --- a/app/back-end/builddata.json +++ b/app/back-end/builddata.json @@ -1 +1 @@ -{"version":"0.33.3","build":11555,"status":"Beta"} \ No newline at end of file +{"version":"0.33.3","build":11557,"status":"Beta"} \ No newline at end of file diff --git a/app/back-end/events/deploy.js b/app/back-end/events/deploy.js index d3ff49fb0..92692c0a0 100644 --- a/app/back-end/events/deploy.js +++ b/app/back-end/events/deploy.js @@ -35,8 +35,14 @@ class DeployEvents { self.deploymentProcess.send({ type: 'abort' }); - } catch(e) { + setTimeout(() => { + if (this.deploymentProcess) { + this.deploymentProcess.kill(); + } + }, 2000); + } catch(e) { + } } From 3d27b37a8833e58af9a94f34b00b0b625bbd2d1b Mon Sep 17 00:00:00 2001 From: Tomasz Dziuda Date: Mon, 4 Mar 2019 19:00:09 +0100 Subject: [PATCH 07/32] #362 - set proper sync button state after canceling sync process --- app/back-end/builddata.json | 2 +- app/src/components/SyncPopup.vue | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/back-end/builddata.json b/app/back-end/builddata.json index f37052f5e..cf432b92b 100644 --- a/app/back-end/builddata.json +++ b/app/back-end/builddata.json @@ -1 +1 @@ -{"version":"0.33.3","build":11557,"status":"Beta"} \ No newline at end of file +{"version":"0.33.3","build":11558,"status":"Beta"} \ No newline at end of file diff --git a/app/src/components/SyncPopup.vue b/app/src/components/SyncPopup.vue index 588c370ba..030c3285c 100644 --- a/app/src/components/SyncPopup.vue +++ b/app/src/components/SyncPopup.vue @@ -413,6 +413,7 @@ export default { }); ipcRenderer.once('app-deploy-aborted', (event) => { + this.$store.commit('setSidebarStatus', 'not-synced'); this.close(); }); }, From 35a68909486e7597a36344722d8f545431c3ae1d Mon Sep 17 00:00:00 2001 From: Tomasz Dziuda Date: Mon, 4 Mar 2019 23:09:05 +0100 Subject: [PATCH 08/32] #338 - added limit of 220chars for the slug The 35 chars left for the `-copy` suffixes --- app/back-end/post.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/back-end/post.js b/app/back-end/post.js index b92c4a47b..800a7d7dd 100644 --- a/app/back-end/post.js +++ b/app/back-end/post.js @@ -474,7 +474,7 @@ class Post extends Model { * Check and prepare post slug */ checkAndPrepareSlug(suffix = 0) { - let postSlug = this.slug; + let postSlug = this.slug.substr(0, 220); let restrictedSlugs = []; if(this.application.sites[this.site].advanced.urls.cleanUrls) { From 5708f1a96c382fd86122e5ab5fd3fe99d73b0907 Mon Sep 17 00:00:00 2001 From: Tomasz Dziuda Date: Mon, 4 Mar 2019 23:19:59 +0100 Subject: [PATCH 09/32] #338 - added visual indicatior of the too long post slugs under post editor --- app/back-end/builddata.json | 2 +- app/back-end/post.js | 2 +- app/src/components/post-editor/Sidebar.vue | 26 +++++++++++++++++++++- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/app/back-end/builddata.json b/app/back-end/builddata.json index cf432b92b..cdeeec5b0 100644 --- a/app/back-end/builddata.json +++ b/app/back-end/builddata.json @@ -1 +1 @@ -{"version":"0.33.3","build":11558,"status":"Beta"} \ No newline at end of file +{"version":"0.33.3","build":11559,"status":"Beta"} \ No newline at end of file diff --git a/app/back-end/post.js b/app/back-end/post.js index 800a7d7dd..b92c4a47b 100644 --- a/app/back-end/post.js +++ b/app/back-end/post.js @@ -474,7 +474,7 @@ class Post extends Model { * Check and prepare post slug */ checkAndPrepareSlug(suffix = 0) { - let postSlug = this.slug.substr(0, 220); + let postSlug = this.slug; let restrictedSlugs = []; if(this.application.sites[this.site].advanced.urls.cleanUrls) { diff --git a/app/src/components/post-editor/Sidebar.vue b/app/src/components/post-editor/Sidebar.vue index a7547d3e6..9e43418dc 100644 --- a/app/src/components/post-editor/Sidebar.vue +++ b/app/src/components/post-editor/Sidebar.vue @@ -279,7 +279,15 @@ size="m" name="sidebar-seo"/> - SEO + + SEO + + + Post slug is too long + + + + The post slug longer than 250 characters can lead to creation of broken files during the website rendering. +