From 8f08591ab9aef61ed4f0d16117b77ba6c38c3472 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Fri, 19 Mar 2021 17:28:49 +1300 Subject: [PATCH 1/6] Add snippet for removing drop cap (aka fancy first letter). --- .../homebrew/editor/snippetbar/snippets/snippets.js | 9 +++++++++ .../editor/snippetbar/snippetsLegacy/snippets.js | 11 +++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippets/snippets.js b/client/homebrew/editor/snippetbar/snippets/snippets.js index 73246c5e3..4d55a7216 100644 --- a/client/homebrew/editor/snippetbar/snippets/snippets.js +++ b/client/homebrew/editor/snippetbar/snippets/snippets.js @@ -77,6 +77,15 @@ module.exports = [ icon : 'fas fa-book', gen : TableOfContentsGen }, + { + name : 'Remove Drop Cap', + icon : 'fas fa-remove-format', + gen : '' + }, ] }, diff --git a/client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js b/client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js index b8410bd9f..234b10fed 100644 --- a/client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js +++ b/client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js @@ -77,8 +77,15 @@ module.exports = [ icon : 'fas fa-book', gen : TableOfContentsGen }, - - + { + name : 'Remove Drop Cap', + icon : 'fas fa-remove-format', + gen : '' + }, ] }, From 7491f463b438138f39713d9aad7a9d17ac8c5c42 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Fri, 19 Mar 2021 17:32:27 +1300 Subject: [PATCH 2/6] Lint fixes. --- client/homebrew/editor/snippetbar/snippets/snippets.js | 2 +- client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippets/snippets.js b/client/homebrew/editor/snippetbar/snippets/snippets.js index 4d55a7216..3ad8783dd 100644 --- a/client/homebrew/editor/snippetbar/snippets/snippets.js +++ b/client/homebrew/editor/snippetbar/snippets/snippets.js @@ -80,7 +80,7 @@ module.exports = [ { name : 'Remove Drop Cap', icon : 'fas fa-remove-format', - gen : '' }, + { + name : 'Tweak Drop Cap', + icon : 'fas fa-sliders-h', + gen : '' + }, ] }, diff --git a/client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js b/client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js index 2d343a2f8..2d4e2d0e4 100644 --- a/client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js +++ b/client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js @@ -86,6 +86,20 @@ module.exports = [ ' }\n' + '' }, + { + name : 'Tweak Drop Cap', + icon : 'fas fa-sliders-h', + gen : '' + }, ] }, From a1dbf0f2e5643e0134879e76787de733a6cf5a59 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Sat, 20 Mar 2021 23:33:22 -0400 Subject: [PATCH 4/6] Popup warning when opening a trashed google brew --- client/homebrew/pages/editPage/editPage.jsx | 46 ++++++++++---------- client/homebrew/pages/editPage/editPage.less | 3 ++ server/googleActions.js | 3 +- shared/naturalcrit/nav/nav.less | 1 + 4 files changed, 28 insertions(+), 25 deletions(-) diff --git a/client/homebrew/pages/editPage/editPage.jsx b/client/homebrew/pages/editPage/editPage.jsx index 549e0412f..19a09c3fe 100644 --- a/client/homebrew/pages/editPage/editPage.jsx +++ b/client/homebrew/pages/editPage/editPage.jsx @@ -36,6 +36,7 @@ const EditPage = createClass({ createdAt : null, updatedAt : null, gDrive : false, + trashed : false, title : '', description : '', @@ -50,15 +51,15 @@ const EditPage = createClass({ getInitialState : function() { return { - brew : this.props.brew, - isSaving : false, - isPending : false, - alertRenderChange : false, - saveGoogle : this.props.brew.googleId ? true : false, - confirmGoogleTransfer : false, - errors : null, - htmlErrors : Markdown.validate(this.props.brew.text), - url : '' + brew : this.props.brew, + isSaving : false, + isPending : false, + alertTrashedGoogleBrew : this.props.brew.trashed, + saveGoogle : this.props.brew.googleId ? true : false, + confirmGoogleTransfer : false, + errors : null, + htmlErrors : Markdown.validate(this.props.brew.text), + url : '' }; }, savedBrew : null, @@ -105,11 +106,6 @@ const EditPage = createClass({ }, handleMetadataChange : function(metadata){ - if(metadata.renderer != this.savedBrew.renderer){ - this.setState({ - alertRenderChange : true - }); - } this.setState((prevState)=>({ brew : _.merge({}, prevState.brew, metadata), isPending : true, @@ -152,7 +148,7 @@ const EditPage = createClass({ closeAlerts : function(){ this.setState({ - alertRenderChange : false + alertTrashedGoogleBrew : false }); }, @@ -349,15 +345,6 @@ const EditPage = createClass({ } }, - // {this.state.alertRenderChange && - //
- // Rendering mode for this brew has been changed! Refresh the page to load the new renderer.
- //
- // OK - //
- //
- // } - processShareId : function() { return this.state.brew.googleId ? this.state.brew.googleId + this.state.brew.shareId : @@ -366,6 +353,16 @@ const EditPage = createClass({ renderNavbar : function(){ return + + {this.state.alertTrashedGoogleBrew && +
+ This brew is currently in your Trash folder on Google Drive!
If you want to keep it, make sure to move it before it is deleted permanently!
+
+ OK +
+
+ } + {this.state.brew.title} @@ -382,6 +379,7 @@ const EditPage = createClass({ +
; }, diff --git a/client/homebrew/pages/editPage/editPage.less b/client/homebrew/pages/editPage/editPage.less index b73467d50..5d0d21b64 100644 --- a/client/homebrew/pages/editPage/editPage.less +++ b/client/homebrew/pages/editPage/editPage.less @@ -41,6 +41,9 @@ border-radius : 5px; transform : translate(-50% + 3px, 10px); text-align : center; + font-size : 10px; + font-weight : 800; + text-transform : uppercase; a{ color : @teal; } diff --git a/server/googleActions.js b/server/googleActions.js index bd288ceea..33fc65791 100644 --- a/server/googleActions.js +++ b/server/googleActions.js @@ -244,7 +244,7 @@ GoogleActions = { const obj = await drive.files.get({ fileId : id, - fields : 'properties, createdTime, modifiedTime, description' + fields : 'properties, createdTime, modifiedTime, description, trashed' }) .catch((err)=>{ console.log('Error loading from Google'); @@ -291,6 +291,7 @@ GoogleActions = { systems : obj.data.properties.systems ? obj.data.properties.systems.split(',') : [], authors : [], published : obj.data.properties.published ? obj.data.properties.published == 'true' : false, + trashed : obj.data.trashed, createdAt : obj.data.createdTime, updatedAt : obj.data.modifiedTime, diff --git a/shared/naturalcrit/nav/nav.less b/shared/naturalcrit/nav/nav.less index f774158fa..fea60b53e 100644 --- a/shared/naturalcrit/nav/nav.less +++ b/shared/naturalcrit/nav/nav.less @@ -1,6 +1,7 @@ nav{ background-color : #333; .navContent{ + position : relative; display : flex; justify-content : space-between; } From 089414c9ffdff8e4ab1fd7ec1c3db3b4544e8e4a Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Sat, 20 Mar 2021 23:48:55 -0400 Subject: [PATCH 5/6] Fix v3 snippet --- client/homebrew/editor/snippetbar/snippets/snippets.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippets/snippets.js b/client/homebrew/editor/snippetbar/snippets/snippets.js index eaa831fb3..a4ff6d96a 100644 --- a/client/homebrew/editor/snippetbar/snippets/snippets.js +++ b/client/homebrew/editor/snippetbar/snippets/snippets.js @@ -81,7 +81,7 @@ module.exports = [ name : 'Remove Drop Cap', icon : 'fas fa-remove-format', gen : '' @@ -91,10 +91,10 @@ module.exports = [ icon : 'fas fa-sliders-h', gen : '