From 7a4258bb208d43be80e575fe61c0a0a187811e3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Pavli=CC=81k?= Date: Wed, 20 Sep 2017 22:33:51 +0200 Subject: [PATCH 01/85] Make line numbers in the editor optional --- browser/components/CodeEditor.js | 6 +++++- browser/components/MarkdownEditor.js | 3 +++ browser/main/Detail/SnippetNoteDetail.js | 1 + browser/main/lib/ConfigManager.js | 1 + browser/main/modals/PreferencesModal/UiTab.js | 12 ++++++++++++ 5 files changed, 22 insertions(+), 1 deletion(-) diff --git a/browser/components/CodeEditor.js b/browser/components/CodeEditor.js index f00794bf..8378f493 100644 --- a/browser/components/CodeEditor.js +++ b/browser/components/CodeEditor.js @@ -50,7 +50,7 @@ export default class CodeEditor extends React.Component { this.value = this.props.value this.editor = CodeMirror(this.refs.root, { value: this.props.value, - lineNumbers: true, + lineNumbers: this.props.lineNumber, lineWrapping: true, theme: this.props.theme, indentUnit: this.props.indentSize, @@ -141,6 +141,10 @@ export default class CodeEditor extends React.Component { this.editor.setOption('indentWithTabs', this.props.indentType !== 'space') } + if (prevProps.lineNumber !== this.props.lineNumber) { + this.editor.setOption('lineNumbers', this.props.lineNumber) + } + if (needRefresh) { this.editor.refresh() } diff --git a/browser/components/MarkdownEditor.js b/browser/components/MarkdownEditor.js index f20ec087..e5b7287c 100644 --- a/browser/components/MarkdownEditor.js +++ b/browser/components/MarkdownEditor.js @@ -213,6 +213,8 @@ class MarkdownEditor extends React.Component { if (!(editorFontSize > 0 && editorFontSize < 101)) editorFontSize = 14 let editorIndentSize = parseInt(config.editor.indentSize, 10) if (!(editorFontSize > 0 && editorFontSize < 132)) editorIndentSize = 4 + let editorLineNumber = config.editor.lineNumber + if (editorLineNumber === undefined) editorLineNumber = true let previewStyle = {} if (this.props.ignorePreviewPointerEvents) previewStyle.pointerEvents = 'none' @@ -242,6 +244,7 @@ class MarkdownEditor extends React.Component { fontSize={editorFontSize} indentType={config.editor.indentType} indentSize={editorIndentSize} + lineNumber={editorLineNumber} storageKey={storageKey} onChange={(e) => this.handleChange(e)} onBlur={(e) => this.handleBlur(e)} diff --git a/browser/main/Detail/SnippetNoteDetail.js b/browser/main/Detail/SnippetNoteDetail.js index 5f767b70..a7b0a8b3 100644 --- a/browser/main/Detail/SnippetNoteDetail.js +++ b/browser/main/Detail/SnippetNoteDetail.js @@ -530,6 +530,7 @@ class SnippetNoteDetail extends React.Component { fontSize={editorFontSize} indentType={config.editor.indentType} indentSize={editorIndentSize} + lineNumber keyMap={config.editor.keyMap} onChange={(e) => this.handleCodeChange(index)(e)} ref={'code-' + index} diff --git a/browser/main/lib/ConfigManager.js b/browser/main/lib/ConfigManager.js index 543c7e5b..f87c1dc0 100644 --- a/browser/main/lib/ConfigManager.js +++ b/browser/main/lib/ConfigManager.js @@ -35,6 +35,7 @@ export const DEFAULT_CONFIG = { fontFamily: win ? 'Segoe UI' : 'Monaco, Consolas', indentType: 'space', indentSize: '2', + lineNumber: true, switchPreview: 'BLUR' // Available value: RIGHTCLICK, BLUR }, preview: { diff --git a/browser/main/modals/PreferencesModal/UiTab.js b/browser/main/modals/PreferencesModal/UiTab.js index 96c04ddf..bea6d28b 100644 --- a/browser/main/modals/PreferencesModal/UiTab.js +++ b/browser/main/modals/PreferencesModal/UiTab.js @@ -46,6 +46,7 @@ class UiTab extends React.Component { fontFamily: this.refs.editorFontFamily.value, indentType: this.refs.editorIndentType.value, indentSize: this.refs.editorIndentSize.value, + lineNumber: this.refs.editorLineNumber.checked, switchPreview: this.refs.editorSwitchPreview.value, keyMap: this.refs.editorKeyMap.value }, @@ -222,6 +223,17 @@ class UiTab extends React.Component { +
+ +
+
Preview
From 46d46f21e4300fdfaca781be1ab80c3703d2e15d Mon Sep 17 00:00:00 2001 From: Maurits Lourens Date: Mon, 11 Dec 2017 15:01:35 +0100 Subject: [PATCH 02/85] convert uml to utf8 before converting to base64 --- browser/lib/markdown.js | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/browser/lib/markdown.js b/browser/lib/markdown.js index da1330cc..031f9610 100644 --- a/browser/lib/markdown.js +++ b/browser/lib/markdown.js @@ -8,7 +8,7 @@ import ConfigManager from 'browser/main/lib/ConfigManager' const katex = window.katex const config = ConfigManager.get() -function createGutter (str) { +function createGutter(str) { const lc = (str.match(/\n/g) || []).length const lines = [] for (let i = 1; i <= lc; i++) { @@ -31,10 +31,10 @@ var md = markdownit({ return `
${str}
` } return '
' +
-    createGutter(str) +
-    '' +
-    str +
-    '
' + createGutter(str) + + '' + + str + + '' } }) md.use(emoji, { @@ -57,7 +57,7 @@ md.use(math, { blockRenderer: function (str) { let output = '' try { - output = katex.renderToString(str.trim(), {displayMode: true}) + output = katex.renderToString(str.trim(), { displayMode: true }) } catch (err) { output = `
${err.message}
` } @@ -76,7 +76,16 @@ md.use(require('markdown-it-named-headers'), { } }) md.use(require('markdown-it-kbd')) -md.use(require('markdown-it-plantuml')) +md.use(require("markdown-it-plantuml"), "", { + generateSource: function (umlCode) { + var deflate = require("markdown-it-plantuml/lib/deflate") + var s = unescape(encodeURIComponent(umlCode)) + var zippedCode = deflate.encode64( + deflate.zip_deflate("@startuml\n" + s + "\n@enduml", 9) + ); + return "http://www.plantuml.com/plantuml/svg/" + zippedCode + } +}) // Override task item md.block.ruler.at('paragraph', function (state, startLine/*, endLine */) { @@ -110,7 +119,7 @@ md.block.ruler.at('paragraph', function (state, startLine/*, endLine */) { state.line = nextLine token = state.push('paragraph_open', 'p', 1) - token.map = [ startLine, state.line ] + token.map = [startLine, state.line] if (state.parentType === 'list') { const match = content.match(/^\[( |x)\] ?(.+)/i) @@ -121,7 +130,7 @@ md.block.ruler.at('paragraph', function (state, startLine/*, endLine */) { token = state.push('inline', '', 0) token.content = content - token.map = [ startLine, state.line ] + token.map = [startLine, state.line] token.children = [] token = state.push('paragraph_close', 'p', -1) @@ -131,7 +140,7 @@ md.block.ruler.at('paragraph', function (state, startLine/*, endLine */) { // Add line number attribute for scrolling const originalRender = md.renderer.render -md.renderer.render = function render (tokens, options, env) { +md.renderer.render = function render(tokens, options, env) { tokens.forEach((token) => { switch (token.type) { case 'heading_open': @@ -147,12 +156,12 @@ md.renderer.render = function render (tokens, options, env) { // FIXME We should not depend on global variable. window.md = md -function normalizeLinkText (linkText) { +function normalizeLinkText(linkText) { return md.normalizeLinkText(linkText) } const markdown = { - render: function markdown (content) { + render: function markdown(content) { if (!_.isString(content)) content = '' const renderedContent = md.render(content) return renderedContent From 4cdfc738c0003f2145579f3bed3b2a813efcbed3 Mon Sep 17 00:00:00 2001 From: Maurits Lourens Date: Mon, 11 Dec 2017 15:14:02 +0100 Subject: [PATCH 03/85] forgot to run eslint (again) --- browser/lib/markdown.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/browser/lib/markdown.js b/browser/lib/markdown.js index 031f9610..99b9b2b2 100644 --- a/browser/lib/markdown.js +++ b/browser/lib/markdown.js @@ -8,7 +8,7 @@ import ConfigManager from 'browser/main/lib/ConfigManager' const katex = window.katex const config = ConfigManager.get() -function createGutter(str) { +function createGutter (str) { const lc = (str.match(/\n/g) || []).length const lines = [] for (let i = 1; i <= lc; i++) { @@ -76,14 +76,14 @@ md.use(require('markdown-it-named-headers'), { } }) md.use(require('markdown-it-kbd')) -md.use(require("markdown-it-plantuml"), "", { +md.use(require('markdown-it-plantuml'), '', { generateSource: function (umlCode) { - var deflate = require("markdown-it-plantuml/lib/deflate") + var deflate = require('markdown-it-plantuml/lib/deflate') var s = unescape(encodeURIComponent(umlCode)) var zippedCode = deflate.encode64( - deflate.zip_deflate("@startuml\n" + s + "\n@enduml", 9) - ); - return "http://www.plantuml.com/plantuml/svg/" + zippedCode + deflate.zip_deflate(`@startuml\n${s}\n@enduml`, 9) + ) + return `http://www.plantuml.com/plantuml/svg/${zippedCode}` } }) @@ -140,7 +140,7 @@ md.block.ruler.at('paragraph', function (state, startLine/*, endLine */) { // Add line number attribute for scrolling const originalRender = md.renderer.render -md.renderer.render = function render(tokens, options, env) { +md.renderer.render = function render (tokens, options, env) { tokens.forEach((token) => { switch (token.type) { case 'heading_open': @@ -156,12 +156,12 @@ md.renderer.render = function render(tokens, options, env) { // FIXME We should not depend on global variable. window.md = md -function normalizeLinkText(linkText) { +function normalizeLinkText (linkText) { return md.normalizeLinkText(linkText) } const markdown = { - render: function markdown(content) { + render: function markdown (content) { if (!_.isString(content)) content = '' const renderedContent = md.render(content) return renderedContent From 6906c0ab0de8d179865ddb9c3f122db2ed888edc Mon Sep 17 00:00:00 2001 From: Maurits Lourens Date: Wed, 13 Dec 2017 17:16:28 +0100 Subject: [PATCH 04/85] changed var into const --- browser/lib/markdown.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/browser/lib/markdown.js b/browser/lib/markdown.js index 99b9b2b2..ba5a3bc8 100644 --- a/browser/lib/markdown.js +++ b/browser/lib/markdown.js @@ -78,9 +78,9 @@ md.use(require('markdown-it-named-headers'), { md.use(require('markdown-it-kbd')) md.use(require('markdown-it-plantuml'), '', { generateSource: function (umlCode) { - var deflate = require('markdown-it-plantuml/lib/deflate') - var s = unescape(encodeURIComponent(umlCode)) - var zippedCode = deflate.encode64( + const deflate = require('markdown-it-plantuml/lib/deflate') + const s = unescape(encodeURIComponent(umlCode)) + const zippedCode = deflate.encode64( deflate.zip_deflate(`@startuml\n${s}\n@enduml`, 9) ) return `http://www.plantuml.com/plantuml/svg/${zippedCode}` From 3bba5442bdec1528256944ffef5a6a7907693842 Mon Sep 17 00:00:00 2001 From: Maurits Lourens Date: Thu, 21 Dec 2017 15:57:27 +0100 Subject: [PATCH 05/85] show delete confirmation dialog --- browser/main/Detail/MarkdownNoteDetail.js | 10 ++++++++++ browser/main/Detail/SnippetNoteDetail.js | 11 +++++++++++ browser/main/modals/PreferencesModal/UiTab.js | 13 ++++++++++++- 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/browser/main/Detail/MarkdownNoteDetail.js b/browser/main/Detail/MarkdownNoteDetail.js index 6b7b8fd4..a85cc12c 100644 --- a/browser/main/Detail/MarkdownNoteDetail.js +++ b/browser/main/Detail/MarkdownNoteDetail.js @@ -176,6 +176,7 @@ class MarkdownNoteDetail extends React.Component { handleTrashButtonClick (e) { const { note } = this.state const { isTrashed } = note + const { config } = this.props if (isTrashed) { const dialogueButtonIndex = dialog.showMessageBox(remote.getCurrentWindow(), { @@ -199,6 +200,15 @@ class MarkdownNoteDetail extends React.Component { ee.once('list:moved', dispatchHandler) }) } else { + if (config.ui.confirmDeletion) { + const dialogueButtonIndex = dialog.showMessageBox(remote.getCurrentWindow(), { + type: 'warning', + message: 'Confirm note deletion', + detail: 'Are you sure you want to move the note to the trash?', + buttons: ['Confirm', 'Cancel'] + }) + if (dialogueButtonIndex === 1) return + } note.isTrashed = true this.setState({ diff --git a/browser/main/Detail/SnippetNoteDetail.js b/browser/main/Detail/SnippetNoteDetail.js index bec6573b..8c5feac6 100644 --- a/browser/main/Detail/SnippetNoteDetail.js +++ b/browser/main/Detail/SnippetNoteDetail.js @@ -175,6 +175,7 @@ class SnippetNoteDetail extends React.Component { handleTrashButtonClick (e) { const { note } = this.state const { isTrashed } = note + const { config } = this.props if (isTrashed) { const dialogueButtonIndex = dialog.showMessageBox(remote.getCurrentWindow(), { @@ -198,6 +199,16 @@ class SnippetNoteDetail extends React.Component { ee.once('list:moved', dispatchHandler) }) } else { + if (config.ui.confirmDeletion) { + const dialogueButtonIndex = dialog.showMessageBox(remote.getCurrentWindow(), { + type: 'warning', + message: 'Confirm note deletion', + detail: 'Are you sure you want to move the note to the trash?', + buttons: ['Confirm', 'Cancel'] + }) + if (dialogueButtonIndex === 1) return + } + note.isTrashed = true this.setState({ diff --git a/browser/main/modals/PreferencesModal/UiTab.js b/browser/main/modals/PreferencesModal/UiTab.js index 42afd8f4..5ed77199 100644 --- a/browser/main/modals/PreferencesModal/UiTab.js +++ b/browser/main/modals/PreferencesModal/UiTab.js @@ -62,6 +62,7 @@ class UiTab extends React.Component { ui: { theme: this.refs.uiTheme.value, showCopyNotification: this.refs.showCopyNotification.checked, + confirmDeletion: this.refs.confirmDeletion.checked, disableDirectWrite: this.refs.uiD2w != null ? this.refs.uiD2w.checked : false @@ -161,6 +162,16 @@ class UiTab extends React.Component { Show "Saved to Clipboard" notification when copying
+
+ +
{ global.process.platform === 'win32' ?
@@ -170,7 +181,7 @@ class UiTab extends React.Component { refs='uiD2w' disabled={OSX} type='checkbox' - /> + />  Disable Direct Write(It will be applied after restarting)
From aabfe820acab178b58d1882f94efd3d875c1ad49 Mon Sep 17 00:00:00 2001 From: Maurits Lourens Date: Thu, 21 Dec 2017 17:41:08 +0100 Subject: [PATCH 06/85] refactored to prevent duplicate code --- browser/main/Detail/MarkdownNoteDetail.js | 63 ++++++++++------------- browser/main/Detail/SnippetNoteDetail.js | 61 +++++++++------------- browser/main/Detail/index.js | 22 ++++++++ 3 files changed, 73 insertions(+), 73 deletions(-) diff --git a/browser/main/Detail/MarkdownNoteDetail.js b/browser/main/Detail/MarkdownNoteDetail.js index a85cc12c..fbd8ce5c 100644 --- a/browser/main/Detail/MarkdownNoteDetail.js +++ b/browser/main/Detail/MarkdownNoteDetail.js @@ -176,46 +176,34 @@ class MarkdownNoteDetail extends React.Component { handleTrashButtonClick (e) { const { note } = this.state const { isTrashed } = note - const { config } = this.props + const { confirmDeletion } = this.props if (isTrashed) { - const dialogueButtonIndex = dialog.showMessageBox(remote.getCurrentWindow(), { - type: 'warning', - message: 'Confirm note deletion', - detail: 'This will permanently remove this note.', - buttons: ['Confirm', 'Cancel'] - }) - if (dialogueButtonIndex === 1) return - const { note, dispatch } = this.props - dataApi - .deleteNote(note.storage, note.key) - .then((data) => { - const dispatchHandler = () => { - dispatch({ - type: 'DELETE_NOTE', - storageKey: data.storageKey, - noteKey: data.noteKey - }) - } - ee.once('list:moved', dispatchHandler) - }) - } else { - if (config.ui.confirmDeletion) { - const dialogueButtonIndex = dialog.showMessageBox(remote.getCurrentWindow(), { - type: 'warning', - message: 'Confirm note deletion', - detail: 'Are you sure you want to move the note to the trash?', - buttons: ['Confirm', 'Cancel'] - }) - if (dialogueButtonIndex === 1) return + if (confirmDeletion(true)) { + const {note, dispatch} = this.props + dataApi + .deleteNote(note.storage, note.key) + .then((data) => { + const dispatchHandler = () => { + dispatch({ + type: 'DELETE_NOTE', + storageKey: data.storageKey, + noteKey: data.noteKey + }) + } + ee.once('list:moved', dispatchHandler) + }) } - note.isTrashed = true + } else { + if (confirmDeletion()) { + note.isTrashed = true - this.setState({ - note - }, () => { - this.save() - }) + this.setState({ + note + }, () => { + this.save() + }) + } } ee.emit('list:next') } @@ -457,7 +445,8 @@ MarkdownNoteDetail.propTypes = { style: PropTypes.shape({ left: PropTypes.number }), - ignorePreviewPointerEvents: PropTypes.bool + ignorePreviewPointerEvents: PropTypes.bool, + confirmDeletion: PropTypes.bool.isRequired } export default CSSModules(MarkdownNoteDetail, styles) diff --git a/browser/main/Detail/SnippetNoteDetail.js b/browser/main/Detail/SnippetNoteDetail.js index 8c5feac6..427a0381 100644 --- a/browser/main/Detail/SnippetNoteDetail.js +++ b/browser/main/Detail/SnippetNoteDetail.js @@ -175,47 +175,35 @@ class SnippetNoteDetail extends React.Component { handleTrashButtonClick (e) { const { note } = this.state const { isTrashed } = note - const { config } = this.props + const { confirmDeletion } = this.props if (isTrashed) { - const dialogueButtonIndex = dialog.showMessageBox(remote.getCurrentWindow(), { - type: 'warning', - message: 'Confirm note deletion', - detail: 'This will permanently remove this note.', - buttons: ['Confirm', 'Cancel'] - }) - if (dialogueButtonIndex === 1) return - const { note, dispatch } = this.props - dataApi - .deleteNote(note.storage, note.key) - .then((data) => { - const dispatchHandler = () => { - dispatch({ - type: 'DELETE_NOTE', - storageKey: data.storageKey, - noteKey: data.noteKey - }) - } - ee.once('list:moved', dispatchHandler) - }) + if (confirmDeletion(true)) { + const {note, dispatch} = this.props + dataApi + .deleteNote(note.storage, note.key) + .then((data) => { + const dispatchHandler = () => { + dispatch({ + type: 'DELETE_NOTE', + storageKey: data.storageKey, + noteKey: data.noteKey + }) + } + ee.once('list:moved', dispatchHandler) + }) + } } else { - if (config.ui.confirmDeletion) { - const dialogueButtonIndex = dialog.showMessageBox(remote.getCurrentWindow(), { - type: 'warning', - message: 'Confirm note deletion', - detail: 'Are you sure you want to move the note to the trash?', - buttons: ['Confirm', 'Cancel'] + if (confirmDeletion()) { + note.isTrashed = true + + this.setState({ + note + }, () => { + this.save() }) - if (dialogueButtonIndex === 1) return } - note.isTrashed = true - - this.setState({ - note - }, () => { - this.save() - }) } ee.emit('list:next') } @@ -740,7 +728,8 @@ SnippetNoteDetail.propTypes = { style: PropTypes.shape({ left: PropTypes.number }), - ignorePreviewPointerEvents: PropTypes.bool + ignorePreviewPointerEvents: PropTypes.bool, + confirmDeletion: PropTypes.bool.isRequired } export default CSSModules(SnippetNoteDetail, styles) diff --git a/browser/main/Detail/index.js b/browser/main/Detail/index.js index 70f37a41..a9a8e4f2 100644 --- a/browser/main/Detail/index.js +++ b/browser/main/Detail/index.js @@ -32,6 +32,26 @@ class Detail extends React.Component { ee.off('detail:delete', this.deleteHandler) } + confirmDeletion (permanent) { + if (this.props.config.ui.confirmDeletion || permanent) { + const electron = require('electron') + const { remote } = electron + const { dialog } = remote + + const alertConfig = { + type: 'warning', + message: 'Confirm note deletion', + detail: 'This will permanently remove this note.', + buttons: ['Confirm', 'Cancel'] + } + + const dialogueButtonIndex = dialog.showMessageBox(remote.getCurrentWindow(), alertConfig) + return dialogueButtonIndex === 0 + } + + return true + } + render () { const { location, data, config } = this.props let note = null @@ -64,6 +84,7 @@ class Detail extends React.Component { this.confirmDeletion(permanent)} ref='root' {..._.pick(this.props, [ 'dispatch', @@ -80,6 +101,7 @@ class Detail extends React.Component { this.confirmDeletion(permanent)} ref='root' {..._.pick(this.props, [ 'dispatch', From e262d2f19bd839c09bf322bb016c3167ee7b7e37 Mon Sep 17 00:00:00 2001 From: Maurits Lourens Date: Thu, 21 Dec 2017 19:15:34 +0100 Subject: [PATCH 07/85] fixed lint error --- browser/main/Detail/SnippetNoteDetail.js | 1 - 1 file changed, 1 deletion(-) diff --git a/browser/main/Detail/SnippetNoteDetail.js b/browser/main/Detail/SnippetNoteDetail.js index 427a0381..cae99a74 100644 --- a/browser/main/Detail/SnippetNoteDetail.js +++ b/browser/main/Detail/SnippetNoteDetail.js @@ -203,7 +203,6 @@ class SnippetNoteDetail extends React.Component { this.save() }) } - } ee.emit('list:next') } From 1f5f6c3b0ed912ced8bc6fa0e03d716db4bfa6cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Pavli=CC=81k?= Date: Sat, 23 Dec 2017 22:51:38 +0100 Subject: [PATCH 08/85] Rename 'lineNumber' to 'displayLineNumbers' --- browser/components/CodeEditor.js | 6 +++--- browser/components/MarkdownEditor.js | 4 +--- browser/main/Detail/SnippetNoteDetail.js | 2 +- browser/main/lib/ConfigManager.js | 2 +- browser/main/modals/PreferencesModal/UiTab.js | 6 +++--- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/browser/components/CodeEditor.js b/browser/components/CodeEditor.js index 8378f493..66e647d6 100644 --- a/browser/components/CodeEditor.js +++ b/browser/components/CodeEditor.js @@ -50,7 +50,7 @@ export default class CodeEditor extends React.Component { this.value = this.props.value this.editor = CodeMirror(this.refs.root, { value: this.props.value, - lineNumbers: this.props.lineNumber, + lineNumbers: this.props.displayLineNumbers, lineWrapping: true, theme: this.props.theme, indentUnit: this.props.indentSize, @@ -141,8 +141,8 @@ export default class CodeEditor extends React.Component { this.editor.setOption('indentWithTabs', this.props.indentType !== 'space') } - if (prevProps.lineNumber !== this.props.lineNumber) { - this.editor.setOption('lineNumbers', this.props.lineNumber) + if (prevProps.displayLineNumbers !== this.props.displayLineNumbers) { + this.editor.setOption('lineNumbers', this.props.displayLineNumbers) } if (needRefresh) { diff --git a/browser/components/MarkdownEditor.js b/browser/components/MarkdownEditor.js index e5b7287c..88485207 100644 --- a/browser/components/MarkdownEditor.js +++ b/browser/components/MarkdownEditor.js @@ -213,8 +213,6 @@ class MarkdownEditor extends React.Component { if (!(editorFontSize > 0 && editorFontSize < 101)) editorFontSize = 14 let editorIndentSize = parseInt(config.editor.indentSize, 10) if (!(editorFontSize > 0 && editorFontSize < 132)) editorIndentSize = 4 - let editorLineNumber = config.editor.lineNumber - if (editorLineNumber === undefined) editorLineNumber = true let previewStyle = {} if (this.props.ignorePreviewPointerEvents) previewStyle.pointerEvents = 'none' @@ -244,7 +242,7 @@ class MarkdownEditor extends React.Component { fontSize={editorFontSize} indentType={config.editor.indentType} indentSize={editorIndentSize} - lineNumber={editorLineNumber} + displayLineNumbers={config.editor.displayLineNumbers} storageKey={storageKey} onChange={(e) => this.handleChange(e)} onBlur={(e) => this.handleBlur(e)} diff --git a/browser/main/Detail/SnippetNoteDetail.js b/browser/main/Detail/SnippetNoteDetail.js index a7b0a8b3..2f5ba34f 100644 --- a/browser/main/Detail/SnippetNoteDetail.js +++ b/browser/main/Detail/SnippetNoteDetail.js @@ -530,7 +530,7 @@ class SnippetNoteDetail extends React.Component { fontSize={editorFontSize} indentType={config.editor.indentType} indentSize={editorIndentSize} - lineNumber + displayLineNumbers keyMap={config.editor.keyMap} onChange={(e) => this.handleCodeChange(index)(e)} ref={'code-' + index} diff --git a/browser/main/lib/ConfigManager.js b/browser/main/lib/ConfigManager.js index f87c1dc0..cdd7eb80 100644 --- a/browser/main/lib/ConfigManager.js +++ b/browser/main/lib/ConfigManager.js @@ -35,7 +35,7 @@ export const DEFAULT_CONFIG = { fontFamily: win ? 'Segoe UI' : 'Monaco, Consolas', indentType: 'space', indentSize: '2', - lineNumber: true, + displayLineNumbers: true, switchPreview: 'BLUR' // Available value: RIGHTCLICK, BLUR }, preview: { diff --git a/browser/main/modals/PreferencesModal/UiTab.js b/browser/main/modals/PreferencesModal/UiTab.js index bea6d28b..61aca0dc 100644 --- a/browser/main/modals/PreferencesModal/UiTab.js +++ b/browser/main/modals/PreferencesModal/UiTab.js @@ -46,7 +46,7 @@ class UiTab extends React.Component { fontFamily: this.refs.editorFontFamily.value, indentType: this.refs.editorIndentType.value, indentSize: this.refs.editorIndentSize.value, - lineNumber: this.refs.editorLineNumber.checked, + displayLineNumbers: this.refs.editorDisplayLineNumbers.checked, switchPreview: this.refs.editorSwitchPreview.value, keyMap: this.refs.editorKeyMap.value }, @@ -226,8 +226,8 @@ class UiTab extends React.Component {
diff --git a/browser/main/modals/NewNoteModal.js b/browser/main/modals/NewNoteModal.js index 346fe920..24b150cb 100644 --- a/browser/main/modals/NewNoteModal.js +++ b/browser/main/modals/NewNoteModal.js @@ -106,7 +106,7 @@ class NewNoteModal extends React.Component { onKeyDown={(e) => this.handleKeyDown(e)} >
-
Make a Note
+
Make a note
this.handleCloseButtonClick(e)} />
From e8b8272cf9bc7fa18cdd624eac33a14ee74b3348 Mon Sep 17 00:00:00 2001 From: Kazu Yokomizo Date: Mon, 15 Jan 2018 08:22:02 -0500 Subject: [PATCH 26/85] Fix #1409 - Fix the Solarized Dark Styling --- .../main/modals/PreferencesModal/StorageItem.styl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/browser/main/modals/PreferencesModal/StorageItem.styl b/browser/main/modals/PreferencesModal/StorageItem.styl index 13759007..29dfbd0b 100644 --- a/browser/main/modals/PreferencesModal/StorageItem.styl +++ b/browser/main/modals/PreferencesModal/StorageItem.styl @@ -84,3 +84,17 @@ body[data-theme="dark"] top 25px z-index 10 white-space nowrap + +body[data-theme="solarized-dark"] + .header + border-color $ui-solarized-dark-button-backgroundColor + + .header-label-path + color $ui-solarized-dark-text-color + .header-label-editButton + color $ui-solarized-dark-text-color + + .header-control-button + border-color $ui-solarized-dark-button-backgroundColor + background-color $ui-solarized-dark-button-backgroundColor + color $ui-solarized-dark-text-color \ No newline at end of file From 69c64434e3b5e41b09020e3d0aadf9ff061fc04b Mon Sep 17 00:00:00 2001 From: Kazu Yokomizo Date: Mon, 15 Jan 2018 08:33:23 -0500 Subject: [PATCH 27/85] Fix the folded layout on side bar --- browser/components/SideNavFilter.styl | 3 --- 1 file changed, 3 deletions(-) diff --git a/browser/components/SideNavFilter.styl b/browser/components/SideNavFilter.styl index 70bfbc97..8a9a350d 100644 --- a/browser/components/SideNavFilter.styl +++ b/browser/components/SideNavFilter.styl @@ -92,7 +92,6 @@ body[data-theme="white"] color $ui-inactive-text-color .menu-button--active - @extend .menu-button color #e74c3c background-color $ui-button--active-backgroundColor .menu-button-label @@ -109,7 +108,6 @@ body[data-theme="white"] color $ui-text-color .menu-button-star--active - @extend .menu-button color #F9BF3B background-color $ui-button--active-backgroundColor .menu-button-label @@ -126,7 +124,6 @@ body[data-theme="white"] color $ui-text-color .menu-button-trash--active - @extend .menu-button color #5D9E36 background-color $ui-button--active-backgroundColor .menu-button-label From 657489caf657b9a1dc538ab355f45653f11736e7 Mon Sep 17 00:00:00 2001 From: Maurits Lourens Date: Mon, 15 Jan 2018 21:01:18 +0100 Subject: [PATCH 28/85] added button for copy note link --- browser/main/Detail/InfoPanel.js | 157 ++++++++++++++++------------- browser/main/Detail/InfoPanel.styl | 15 ++- 2 files changed, 100 insertions(+), 72 deletions(-) diff --git a/browser/main/Detail/InfoPanel.js b/browser/main/Detail/InfoPanel.js index a5202e71..44b9f09a 100644 --- a/browser/main/Detail/InfoPanel.js +++ b/browser/main/Detail/InfoPanel.js @@ -2,82 +2,97 @@ import PropTypes from 'prop-types' import React from 'react' import CSSModules from 'browser/lib/CSSModules' import styles from './InfoPanel.styl' +import copy from 'copy-to-clipboard' -const InfoPanel = ({ - storageName, folderName, noteLink, updatedAt, createdAt, exportAsMd, exportAsTxt, exportAsHtml, wordCount, letterCount, type, print -}) => ( -
-
-

{updatedAt}

-

MODIFICATION DATE

-
+class InfoPanel extends React.Component { + copyNoteLink () { + const {noteLink} = this.props + this.refs.noteLink.select() + copy(noteLink) + } -
- - {type === 'SNIPPET_NOTE' - ? '' - :
-
-

{wordCount}

-

Words

+ render () { + const { + storageName, folderName, noteLink, updatedAt, createdAt, exportAsMd, exportAsTxt, exportAsHtml, wordCount, letterCount, type, print + } = this.props + return ( +
+
+

{updatedAt}

+

MODIFICATION DATE

-
-

{letterCount}

-

Letters

+ +
+ + {type === 'SNIPPET_NOTE' + ? '' + :
+
+

{wordCount}

+

Words

+
+
+

{letterCount}

+

Letters

+
+
+ } + + {type === 'SNIPPET_NOTE' + ? '' + :
+ } + +
+

{storageName}

+

STORAGE

+
+ +
+

{folderName}

+

FOLDER

+
+ +
+

{createdAt}

+

CREATION DATE

+
+ +
+ { e.target.select() }} /> + +

NOTE LINK

+
+ +
+ +
+ + + + + + +
- } - - {type === 'SNIPPET_NOTE' - ? '' - :
- } - -
-

{storageName}

-

STORAGE

-
- -
-

{folderName}

-

FOLDER

-
- -
-

{createdAt}

-

CREATION DATE

-
- -
- { e.target.select() }} /> -

NOTE LINK

-
- -
- -
- - - - - - - -
-
-) + ) + } +} InfoPanel.propTypes = { storageName: PropTypes.string.isRequired, diff --git a/browser/main/Detail/InfoPanel.styl b/browser/main/Detail/InfoPanel.styl index 72b07c87..3baa7e1a 100644 --- a/browser/main/Detail/InfoPanel.styl +++ b/browser/main/Detail/InfoPanel.styl @@ -15,7 +15,6 @@ position absolute padding 20px 25px 0 25px width 300px - height 350px overflow auto background-color $ui-noteList-backgroundColor box-shadow 2px 12px 15px 2px rgba(0, 0, 0, 0.1), 2px 1px 50px 2px rgba(0, 0, 0, 0.1) @@ -80,6 +79,20 @@ height 25px margin-bottom 6px +.infoPanel-copyButton + outline none + font-size 16px + color #A0A0A0 + background-color transparent + border none + margin 0 5px + border-radius 5px + cursor pointer + &:hover + transition 0.2s + background-color alpha($ui-button--hover-backgroundColor, 30%) + color $ui-inactive-text-color + .infoPanel-trash color #EA4447 font-weight 600 From 9c0e1f8f1a754da50edd4dff998d6978190e0338 Mon Sep 17 00:00:00 2001 From: Maurits Lourens Date: Mon, 15 Jan 2018 21:33:17 +0100 Subject: [PATCH 29/85] name note to imported file --- browser/main/NoteList/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/browser/main/NoteList/index.js b/browser/main/NoteList/index.js index 083eb75f..4af83062 100644 --- a/browser/main/NoteList/index.js +++ b/browser/main/NoteList/index.js @@ -11,6 +11,7 @@ import NoteItem from 'browser/components/NoteItem' import NoteItemSimple from 'browser/components/NoteItemSimple' import searchFromNotes from 'browser/lib/search' import fs from 'fs' +import path from 'path' import { hashHistory } from 'react-router' import markdown from 'browser/lib/markdownTextHelper' import { findNoteTitle } from 'browser/lib/findNoteTitle' @@ -582,7 +583,7 @@ class NoteList extends React.Component { const newNote = { content: content, folder: folder.key, - title: markdown.strip(findNoteTitle(content)), + title: path.basename(filepath, path.extname(filepath)), type: 'MARKDOWN_NOTE', createdAt: birthtime, updatedAt: mtime From 14318528b931097c1e61d4ece59f7e20ed42c048 Mon Sep 17 00:00:00 2001 From: Maurits Lourens Date: Mon, 15 Jan 2018 22:18:23 +0100 Subject: [PATCH 30/85] added encoding meta tag --- browser/components/MarkdownPreview.js | 1 + 1 file changed, 1 insertion(+) diff --git a/browser/components/MarkdownPreview.js b/browser/components/MarkdownPreview.js index c1be9ef1..711cabcd 100644 --- a/browser/components/MarkdownPreview.js +++ b/browser/components/MarkdownPreview.js @@ -226,6 +226,7 @@ export default class MarkdownPreview extends React.Component { + ` this.rewriteIframe() this.applyStyle() From 1cb4f37c95f449c3573b64314342fa26fc3a1784 Mon Sep 17 00:00:00 2001 From: Maurits Lourens Date: Mon, 15 Jan 2018 22:27:38 +0100 Subject: [PATCH 31/85] moved the import outside the use config section --- browser/lib/markdown.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/browser/lib/markdown.js b/browser/lib/markdown.js index ba5a3bc8..79383ca9 100644 --- a/browser/lib/markdown.js +++ b/browser/lib/markdown.js @@ -76,9 +76,10 @@ md.use(require('markdown-it-named-headers'), { } }) md.use(require('markdown-it-kbd')) + +const deflate = require('markdown-it-plantuml/lib/deflate') md.use(require('markdown-it-plantuml'), '', { generateSource: function (umlCode) { - const deflate = require('markdown-it-plantuml/lib/deflate') const s = unescape(encodeURIComponent(umlCode)) const zippedCode = deflate.encode64( deflate.zip_deflate(`@startuml\n${s}\n@enduml`, 9) From ecab68d676c864db5791c43f3c9686cfb7d61490 Mon Sep 17 00:00:00 2001 From: Maurits Lourens Date: Tue, 16 Jan 2018 10:09:02 +0100 Subject: [PATCH 32/85] removed unused imports --- browser/main/NoteList/index.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/browser/main/NoteList/index.js b/browser/main/NoteList/index.js index 4af83062..8adaf1a0 100644 --- a/browser/main/NoteList/index.js +++ b/browser/main/NoteList/index.js @@ -13,9 +13,6 @@ import searchFromNotes from 'browser/lib/search' import fs from 'fs' import path from 'path' import { hashHistory } from 'react-router' -import markdown from 'browser/lib/markdownTextHelper' -import { findNoteTitle } from 'browser/lib/findNoteTitle' -import store from 'browser/main/store' import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig' const { remote } = require('electron') From 6093f25f9adb7cdc9d7d49a14cfd08f672b9d51d Mon Sep 17 00:00:00 2001 From: Sosuke Suzuki Date: Tue, 16 Jan 2018 19:37:01 +0900 Subject: [PATCH 33/85] make save button position:fixed --- browser/main/modals/PreferencesModal/ConfigTab.styl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/browser/main/modals/PreferencesModal/ConfigTab.styl b/browser/main/modals/PreferencesModal/ConfigTab.styl index ea26af08..f6f7ace9 100644 --- a/browser/main/modals/PreferencesModal/ConfigTab.styl +++ b/browser/main/modals/PreferencesModal/ConfigTab.styl @@ -89,9 +89,9 @@ margin-right 10px .group-control-rightButton - position absolute - top 10px - right 20px + position fixed + top 80px + right 100px colorPrimaryButton() border none border-radius 2px From 8a0a118dbacf96531856c90828a1b5ad2f0d6136 Mon Sep 17 00:00:00 2001 From: yamash723 Date: Wed, 17 Jan 2018 16:32:43 +0900 Subject: [PATCH 34/85] Remove inline-style from markdown link list --- browser/components/markdown.styl | 1 - 1 file changed, 1 deletion(-) diff --git a/browser/components/markdown.styl b/browser/components/markdown.styl index 5ff05941..4938f243 100644 --- a/browser/components/markdown.styl +++ b/browser/components/markdown.styl @@ -105,7 +105,6 @@ a border-radius 5px margin -5px transition .1s - display inline-block img vertical-align sub &:hover From 5413647166738bed44aed440a28a1fd5de12df4f Mon Sep 17 00:00:00 2001 From: Kazz Yokomizo Date: Tue, 23 Jan 2018 11:46:22 -0500 Subject: [PATCH 35/85] Update readme --- readme.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/readme.md b/readme.md index 4b571fa0..40012652 100644 --- a/readme.md +++ b/readme.md @@ -10,7 +10,6 @@ ## Authors & Maintainers - [Rokt33r](https://github.com/rokt33r) -- [Kohei TAKATA](https://github.com/kohei-takata) - [Sosuke](https://github.com/sosukesuzuki) - [Kazz](https://github.com/kazup01) @@ -26,16 +25,17 @@ Boostnote is an open source project. It's an independent project with its ongoin ## Community - [Facebook Group](https://www.facebook.com/groups/boostnote/) - [Twitter](https://twitter.com/boostnoteapp) -- [Slack Group](https://join.slack.com/t/boostnote-group/shared_invite/enQtMjkxMzMwODYxMDI1LTgwZmRiODg0NzA5MWRmOTJjNzBjZjAwMmMyZGQ4Y2RkOGE0MDg0YjcyMjA5OGUzMmZhNmFiNTMzOTlkYWNlMTM) +- [Slack Group](https://join.slack.com/t/boostnote-group/shared_invite/enQtMzAzMjI1MTIyNTQ3LTc2MjNiYWU3NTc1YjZlMTk3NzFmOWE1ZWU1MGRhMzBkMGIwMWFjOWMxMDRiM2I2NzkzYzc4OGZhNmVhZjYzZTM) - [Blog](https://medium.com/boostnote) - [Reddit](https://www.reddit.com/r/Boostnote/) #### More Information -* [Website](https://boostnote.io) -* [Subscribe to the Newsletter](https://boostnote.io/#community): Get updates on Boostnote progress. No spam, ever :) +* Website: https://boostnote.io +* Newsletters: https://boostnote.io/#subscribe * [Development](https://github.com/BoostIO/Boostnote/blob/master/docs/build.md): Development configurations for Boostnote. -* Copyright (C) 2017 Maisin&Co. +* Copyright (C) 2016 - 2018 BoostIO, Inc. + #### License From 30f6f074344176d72008432fe4e4478a5d440156 Mon Sep 17 00:00:00 2001 From: Kazu Yokomizo Date: Tue, 23 Jan 2018 20:50:48 -0500 Subject: [PATCH 36/85] Fix info right buttons layout --- browser/main/Detail/MarkdownNoteDetail.styl | 2 -- browser/main/Detail/NoteDetailInfo.styl | 12 +++------ browser/main/Detail/TagSelect.styl | 3 ++- browser/main/Detail/ToggleModeButton.js | 4 +-- browser/main/Detail/ToggleModeButton.styl | 28 ++++++++++----------- browser/styles/index.styl | 1 - 6 files changed, 21 insertions(+), 29 deletions(-) diff --git a/browser/main/Detail/MarkdownNoteDetail.styl b/browser/main/Detail/MarkdownNoteDetail.styl index 25b6f2da..0cce76ea 100644 --- a/browser/main/Detail/MarkdownNoteDetail.styl +++ b/browser/main/Detail/MarkdownNoteDetail.styl @@ -12,11 +12,9 @@ padding-bottom 3px .control-lockButton - top 150px topBarButtonRight() .trashed-infopanel - top 40px position relative .body diff --git a/browser/main/Detail/NoteDetailInfo.styl b/browser/main/Detail/NoteDetailInfo.styl index 85bf1a12..84344ec6 100644 --- a/browser/main/Detail/NoteDetailInfo.styl +++ b/browser/main/Detail/NoteDetailInfo.styl @@ -1,6 +1,6 @@ @import('DetailVars') -$info-height = 50px +$info-height = 80px $info-margin-under-border = 30px .info @@ -8,11 +8,11 @@ $info-margin-under-border = 30px left 0 right 0 height $info-height - border-bottom 1px solid #eee background-color $ui-noteDetail-backgroundColor width 100% display flex align-items center + padding 0 20px .info-left padding 0 10px @@ -20,7 +20,6 @@ $info-margin-under-border = 30px display flex align-items center - .info-left-top-folderSelect display flex align-items center @@ -45,12 +44,9 @@ $info-margin-under-border = 30px color $ui-button--color .info-right - position absolute - right 40px - top 60px - bottom 1px - padding-left 30px z-index 101 + display inline-flex + margin-top 5px .undo-button width 34px diff --git a/browser/main/Detail/TagSelect.styl b/browser/main/Detail/TagSelect.styl index ddd8b0cd..2bccddc0 100644 --- a/browser/main/Detail/TagSelect.styl +++ b/browser/main/Detail/TagSelect.styl @@ -6,7 +6,8 @@ width 100% overflow-x scroll white-space nowrap - margin-right 10px + padding-top 80px + position absolute .root::-webkit-scrollbar display none diff --git a/browser/main/Detail/ToggleModeButton.js b/browser/main/Detail/ToggleModeButton.js index 5a78cc51..e2d143d4 100644 --- a/browser/main/Detail/ToggleModeButton.js +++ b/browser/main/Detail/ToggleModeButton.js @@ -8,10 +8,10 @@ const ToggleModeButton = ({ }) => (
onClick('SPLIT')}> - +
onClick('EDITOR_PREVIEW')}> - +
Toggle Mode
diff --git a/browser/main/Detail/ToggleModeButton.styl b/browser/main/Detail/ToggleModeButton.styl index b9d3cc6c..61a047d9 100644 --- a/browser/main/Detail/ToggleModeButton.styl +++ b/browser/main/Detail/ToggleModeButton.styl @@ -1,24 +1,28 @@ .control-toggleModeButton - border 1px solid #eee - height 34px + height 29px + border-radius 50px + background-color #F4F4F4 + width 67px display flex align-items center + position absolute + right 165px + .active + background-color #1EC38B + width 33px + height 30px + box-shadow 2px 0px 7px #eee + z-index 1 div width 40px height 100% - background-color #f9f9f9 + border-radius 50% display flex align-items center justify-content center cursor pointer - &:first-child - border-right 1px solid #eee - .active - background-color #fff - box-shadow 2px 0px 7px #eee - z-index 1 &:hover .tooltip opacity 1 @@ -40,22 +44,16 @@ body[data-theme="dark"] topBarButtonDark() .control-toggleModeButton - border 1px solid #444444 div background-color $ui-dark-noteDetail-backgroundColor - &:first-child - border-right 1px solid #444444 .active background-color #3A404C box-shadow 2px 0px 7px #444444 body[data-theme="solarized-dark"] .control-toggleModeButton - border 1px solid #586E75 div background-color $ui-solarized-dark-noteDetail-backgroundColor - &:first-child - border-right 1px solid #586E75 .active background-color #002B36 box-shadow 2px 0px 7px #222222 \ No newline at end of file diff --git a/browser/styles/index.styl b/browser/styles/index.styl index e8a70e1f..1bd183bf 100644 --- a/browser/styles/index.styl +++ b/browser/styles/index.styl @@ -188,7 +188,6 @@ modal() border-radius $modal-border-radius topBarButtonRight() - position absolute width 34px height 34px border-radius 17px From 747d3a8f13913921efd93eae1bd758a01caa7445 Mon Sep 17 00:00:00 2001 From: Kazu Yokomizo Date: Tue, 23 Jan 2018 20:55:29 -0500 Subject: [PATCH 37/85] Fix note detail width --- browser/main/Detail/MarkdownNoteDetail.styl | 2 +- browser/main/Detail/SnippetNoteDetail.styl | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/browser/main/Detail/MarkdownNoteDetail.styl b/browser/main/Detail/MarkdownNoteDetail.styl index 0cce76ea..1d3125e3 100644 --- a/browser/main/Detail/MarkdownNoteDetail.styl +++ b/browser/main/Detail/MarkdownNoteDetail.styl @@ -23,7 +23,7 @@ right 0 top $info-height + $info-margin-under-border bottom $statusBar-height - margin 0 45px + margin 0 30px .body-noteEditor absolute top bottom left right diff --git a/browser/main/Detail/SnippetNoteDetail.styl b/browser/main/Detail/SnippetNoteDetail.styl index 9823ff5b..f370afc8 100644 --- a/browser/main/Detail/SnippetNoteDetail.styl +++ b/browser/main/Detail/SnippetNoteDetail.styl @@ -9,8 +9,7 @@ .body absolute left right - left $snippet-note-detail-left-margin - right $snippet-note-detail-right-margin + margin 0 30px top $info-height + $info-margin-under-border bottom $statusBar-height background-color $ui-noteDetail-backgroundColor From 2b507e6e2072dc91a58880f75c1e09288ed1d6d5 Mon Sep 17 00:00:00 2001 From: Kazu Yokomizo Date: Tue, 23 Jan 2018 20:57:57 -0500 Subject: [PATCH 38/85] Zoom button to display none --- browser/main/StatusBar/StatusBar.styl | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/browser/main/StatusBar/StatusBar.styl b/browser/main/StatusBar/StatusBar.styl index 9f189fec..e055dc0d 100644 --- a/browser/main/StatusBar/StatusBar.styl +++ b/browser/main/StatusBar/StatusBar.styl @@ -21,19 +21,20 @@ color white .zoom - navButtonColor() - color rgba(0,0,0,.54) - height 20px - display flex - padding 0 - align-items center - background-color transparent - &:hover - color $ui-active-color - &:active - color $ui-active-color - span - margin-left 5px + display none + // navButtonColor() + // color rgba(0,0,0,.54) + // height 20px + // display flex + // padding 0 + // align-items center + // background-color transparent + // &:hover + // color $ui-active-color + // &:active + // color $ui-active-color + // span + // margin-left 5px .update navButtonColor() From 81265f1238a9aac4c7d1092341f589ab56623631 Mon Sep 17 00:00:00 2001 From: Kazu Yokomizo Date: Tue, 23 Jan 2018 21:02:19 -0500 Subject: [PATCH 39/85] Reorder of buttons --- browser/main/Detail/MarkdownNoteDetail.js | 8 ++++---- browser/main/Detail/SnippetNoteDetail.js | 9 +++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/browser/main/Detail/MarkdownNoteDetail.js b/browser/main/Detail/MarkdownNoteDetail.js index 21c9a53f..d64e1817 100644 --- a/browser/main/Detail/MarkdownNoteDetail.js +++ b/browser/main/Detail/MarkdownNoteDetail.js @@ -367,10 +367,6 @@ class MarkdownNoteDetail extends React.Component {
- this.handleInfoButtonClick(e)} - /> - this.handleStarButtonClick(e)} isActive={note.isStarred} @@ -395,6 +391,10 @@ class MarkdownNoteDetail extends React.Component { this.handleTrashButtonClick(e)} /> + this.handleInfoButtonClick(e)} + /> +
- this.handleInfoButtonClick(e)} - /> - this.handleStarButtonClick(e)} isActive={note.isStarred} @@ -641,6 +637,11 @@ class SnippetNoteDetail extends React.Component { this.handleTrashButtonClick(e)} /> + + this.handleInfoButtonClick(e)} + /> + Date: Wed, 24 Jan 2018 15:13:45 -0500 Subject: [PATCH 40/85] Fix tooltip --- browser/main/Detail/FullscreenButton.styl | 4 ++-- browser/main/Detail/InfoButton.styl | 4 ++-- browser/main/Detail/StarButton.styl | 6 +++--- browser/main/Detail/ToggleModeButton.styl | 5 +++-- browser/main/Detail/TrashButton.styl | 4 ++-- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/browser/main/Detail/FullscreenButton.styl b/browser/main/Detail/FullscreenButton.styl index 7cee4faa..132df2f8 100644 --- a/browser/main/Detail/FullscreenButton.styl +++ b/browser/main/Detail/FullscreenButton.styl @@ -8,8 +8,8 @@ tooltip() position absolute pointer-events none - top 26px - right 0 + top 65px + right 70px z-index 200 padding 5px line-height normal diff --git a/browser/main/Detail/InfoButton.styl b/browser/main/Detail/InfoButton.styl index a1c302f0..0e9a5af7 100644 --- a/browser/main/Detail/InfoButton.styl +++ b/browser/main/Detail/InfoButton.styl @@ -8,8 +8,8 @@ tooltip() position absolute pointer-events none - top 26px - right 0 + top 65px + right 20px z-index 200 padding 5px line-height normal diff --git a/browser/main/Detail/StarButton.styl b/browser/main/Detail/StarButton.styl index 647f3f23..ae161062 100644 --- a/browser/main/Detail/StarButton.styl +++ b/browser/main/Detail/StarButton.styl @@ -11,9 +11,9 @@ tooltip() position absolute pointer-events none - top 26px - right 0 - width 100% + top 65px + right 115px + width 40px z-index 200 padding 5px line-height normal diff --git a/browser/main/Detail/ToggleModeButton.styl b/browser/main/Detail/ToggleModeButton.styl index 61a047d9..76ec90a7 100644 --- a/browser/main/Detail/ToggleModeButton.styl +++ b/browser/main/Detail/ToggleModeButton.styl @@ -30,9 +30,10 @@ tooltip() position absolute pointer-events none - top 47px - right 11px + top 40px + left -3px z-index 200 + width 80px padding 5px line-height normal border-radius 2px diff --git a/browser/main/Detail/TrashButton.styl b/browser/main/Detail/TrashButton.styl index 455d36a6..da107ded 100644 --- a/browser/main/Detail/TrashButton.styl +++ b/browser/main/Detail/TrashButton.styl @@ -8,8 +8,8 @@ tooltip() position absolute pointer-events none - top 26px - right 0 + top 65px + right 50px z-index 200 padding 5px line-height normal From e9a126f58629941202be7ac40f311ac6bffaa180 Mon Sep 17 00:00:00 2001 From: Kazu Yokomizo Date: Wed, 24 Jan 2018 15:19:13 -0500 Subject: [PATCH 41/85] Fix multiple colors --- browser/main/Detail/ToggleModeButton.styl | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/browser/main/Detail/ToggleModeButton.styl b/browser/main/Detail/ToggleModeButton.styl index 76ec90a7..11f8cf87 100644 --- a/browser/main/Detail/ToggleModeButton.styl +++ b/browser/main/Detail/ToggleModeButton.styl @@ -45,16 +45,14 @@ body[data-theme="dark"] topBarButtonDark() .control-toggleModeButton - div - background-color $ui-dark-noteDetail-backgroundColor - .active background-color #3A404C + .active + background-color #1EC38B box-shadow 2px 0px 7px #444444 body[data-theme="solarized-dark"] .control-toggleModeButton - div - background-color $ui-solarized-dark-noteDetail-backgroundColor - .active background-color #002B36 + .active + background-color #1EC38B box-shadow 2px 0px 7px #222222 \ No newline at end of file From 8c3ba4ce48ba9fbfeafa1ece41db72e88993ca2b Mon Sep 17 00:00:00 2001 From: Kazu Yokomizo Date: Wed, 24 Jan 2018 15:26:45 -0500 Subject: [PATCH 42/85] Fix infopanel --- browser/main/Detail/InfoPanel.styl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/browser/main/Detail/InfoPanel.styl b/browser/main/Detail/InfoPanel.styl index 3baa7e1a..d90dea49 100644 --- a/browser/main/Detail/InfoPanel.styl +++ b/browser/main/Detail/InfoPanel.styl @@ -11,7 +11,7 @@ .control-infoButton-panel z-index 200 margin-top 0px - right 0 + right 25px position absolute padding 20px 25px 0 25px width 300px @@ -69,15 +69,16 @@ color $ui-text-color .infoPanel-sub - font-size 14px + font-size 12px + font-weight 600 color $ui-inactive-text-color padding-bottom 8px .infoPanel-noteLink padding-right 5px - width 200px + width 210px height 25px - margin-bottom 6px + margin 6px 0 .infoPanel-copyButton outline none From 7730b5e20bb53dc91baa28c4481d914aaaf2ebe6 Mon Sep 17 00:00:00 2001 From: Kazu Yokomizo Date: Wed, 24 Jan 2018 15:39:27 -0500 Subject: [PATCH 43/85] Change size of icons on note detail --- browser/main/Detail/SnippetNoteDetail.js | 2 +- resources/icon/icon-full.svg | 2 +- resources/icon/icon-info.svg | 2 +- resources/icon/icon-mode-markdown-off-active.svg | 2 +- resources/icon/icon-mode-split-on-active.svg | 2 +- resources/icon/icon-star.svg | 2 +- resources/icon/icon-starred.svg | 2 +- resources/icon/icon-trash.svg | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/browser/main/Detail/SnippetNoteDetail.js b/browser/main/Detail/SnippetNoteDetail.js index ac084379..2c6da41c 100644 --- a/browser/main/Detail/SnippetNoteDetail.js +++ b/browser/main/Detail/SnippetNoteDetail.js @@ -633,7 +633,7 @@ class SnippetNoteDetail extends React.Component { this.handleTrashButtonClick(e)} /> diff --git a/resources/icon/icon-full.svg b/resources/icon/icon-full.svg index 621ebacc..6943bd7c 100644 --- a/resources/icon/icon-full.svg +++ b/resources/icon/icon-full.svg @@ -1,5 +1,5 @@ - + icon-full Created with Sketch. diff --git a/resources/icon/icon-info.svg b/resources/icon/icon-info.svg index 253b8cab..12fa696e 100644 --- a/resources/icon/icon-info.svg +++ b/resources/icon/icon-info.svg @@ -1,5 +1,5 @@ - + icon-info Created with Sketch. diff --git a/resources/icon/icon-mode-markdown-off-active.svg b/resources/icon/icon-mode-markdown-off-active.svg index 0159836b..c8ba30ce 100644 --- a/resources/icon/icon-mode-markdown-off-active.svg +++ b/resources/icon/icon-mode-markdown-off-active.svg @@ -1,5 +1,5 @@ - + icon-mode-markdown-off Created with Sketch. diff --git a/resources/icon/icon-mode-split-on-active.svg b/resources/icon/icon-mode-split-on-active.svg index 338d2bd7..ffb62b7c 100644 --- a/resources/icon/icon-mode-split-on-active.svg +++ b/resources/icon/icon-mode-split-on-active.svg @@ -1,5 +1,5 @@ - + icon-mode-split-on Created with Sketch. diff --git a/resources/icon/icon-star.svg b/resources/icon/icon-star.svg index da4abb3d..b62b1f93 100644 --- a/resources/icon/icon-star.svg +++ b/resources/icon/icon-star.svg @@ -1,5 +1,5 @@ - + icon-star Created with Sketch. diff --git a/resources/icon/icon-starred.svg b/resources/icon/icon-starred.svg index 68eb6f07..195351cf 100644 --- a/resources/icon/icon-starred.svg +++ b/resources/icon/icon-starred.svg @@ -1,5 +1,5 @@ - + icon-starred Created with Sketch. diff --git a/resources/icon/icon-trash.svg b/resources/icon/icon-trash.svg index 64dedb87..53fc7571 100644 --- a/resources/icon/icon-trash.svg +++ b/resources/icon/icon-trash.svg @@ -1,5 +1,5 @@ - + icon-trash Created with Sketch. From f235d832d5c56d133a91ac02979ea6494ca032ab Mon Sep 17 00:00:00 2001 From: Kazu Yokomizo Date: Wed, 24 Jan 2018 16:03:50 -0500 Subject: [PATCH 44/85] Fix note detail layout --- browser/main/Detail/FolderSelect.styl | 8 +------- browser/main/Detail/NoteDetailInfo.styl | 2 +- browser/main/Detail/TagSelect.styl | 2 +- browser/main/Detail/ToggleModeButton.styl | 6 +++--- browser/main/global.styl | 2 +- 5 files changed, 7 insertions(+), 13 deletions(-) diff --git a/browser/main/Detail/FolderSelect.styl b/browser/main/Detail/FolderSelect.styl index 22b7b9b7..31930fe6 100644 --- a/browser/main/Detail/FolderSelect.styl +++ b/browser/main/Detail/FolderSelect.styl @@ -3,20 +3,14 @@ border solid 1px transparent vertical-align middle border-radius 2px + height 30px transition 0.15s user-select none margin-right 10px - &:hover - background-color $ui-button--hover-backgroundColor .root--search, .root--focus @extend .root - background-color $ui-noteDetail-backgroundColor = #fff border-color $ui-input--focus-borderColor - width 154px - height 30px - &:hover - border-color $ui-input--focus-borderColor = #fff .idle position relative diff --git a/browser/main/Detail/NoteDetailInfo.styl b/browser/main/Detail/NoteDetailInfo.styl index 84344ec6..4b96bd58 100644 --- a/browser/main/Detail/NoteDetailInfo.styl +++ b/browser/main/Detail/NoteDetailInfo.styl @@ -1,6 +1,6 @@ @import('DetailVars') -$info-height = 80px +$info-height = 60px $info-margin-under-border = 30px .info diff --git a/browser/main/Detail/TagSelect.styl b/browser/main/Detail/TagSelect.styl index 2bccddc0..18d4d2e0 100644 --- a/browser/main/Detail/TagSelect.styl +++ b/browser/main/Detail/TagSelect.styl @@ -6,7 +6,7 @@ width 100% overflow-x scroll white-space nowrap - padding-top 80px + margin-top 31px position absolute .root::-webkit-scrollbar diff --git a/browser/main/Detail/ToggleModeButton.styl b/browser/main/Detail/ToggleModeButton.styl index 11f8cf87..e48fe9dd 100644 --- a/browser/main/Detail/ToggleModeButton.styl +++ b/browser/main/Detail/ToggleModeButton.styl @@ -1,8 +1,8 @@ .control-toggleModeButton - height 29px + height 25px border-radius 50px background-color #F4F4F4 - width 67px + width 52px display flex align-items center position absolute @@ -10,7 +10,7 @@ .active background-color #1EC38B width 33px - height 30px + height 24px box-shadow 2px 0px 7px #eee z-index 1 diff --git a/browser/main/global.styl b/browser/main/global.styl index 27d1ae73..1b40587c 100644 --- a/browser/main/global.styl +++ b/browser/main/global.styl @@ -97,7 +97,7 @@ body[data-theme="dark"] .CodeMirror font-family inherit !important line-height 1.4em - height 96% + height 100% .CodeMirror > div > textarea margin-bottom -1em .CodeMirror-focused .CodeMirror-selected From e7e8f11a744ccc8533932aabd8d20b9812fe7375 Mon Sep 17 00:00:00 2001 From: Kazu Yokomizo Date: Wed, 24 Jan 2018 16:08:44 -0500 Subject: [PATCH 45/85] Fix tooltips position --- browser/main/Detail/FullscreenButton.styl | 2 +- browser/main/Detail/InfoButton.styl | 2 +- browser/main/Detail/StarButton.styl | 2 +- browser/main/Detail/ToggleModeButton.styl | 4 ++-- browser/main/Detail/TrashButton.styl | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/browser/main/Detail/FullscreenButton.styl b/browser/main/Detail/FullscreenButton.styl index 132df2f8..cc1a8dff 100644 --- a/browser/main/Detail/FullscreenButton.styl +++ b/browser/main/Detail/FullscreenButton.styl @@ -8,7 +8,7 @@ tooltip() position absolute pointer-events none - top 65px + top 50px right 70px z-index 200 padding 5px diff --git a/browser/main/Detail/InfoButton.styl b/browser/main/Detail/InfoButton.styl index 0e9a5af7..d2a84708 100644 --- a/browser/main/Detail/InfoButton.styl +++ b/browser/main/Detail/InfoButton.styl @@ -8,7 +8,7 @@ tooltip() position absolute pointer-events none - top 65px + top 50px right 20px z-index 200 padding 5px diff --git a/browser/main/Detail/StarButton.styl b/browser/main/Detail/StarButton.styl index ae161062..d5fd755b 100644 --- a/browser/main/Detail/StarButton.styl +++ b/browser/main/Detail/StarButton.styl @@ -11,7 +11,7 @@ tooltip() position absolute pointer-events none - top 65px + top 50px right 115px width 40px z-index 200 diff --git a/browser/main/Detail/ToggleModeButton.styl b/browser/main/Detail/ToggleModeButton.styl index e48fe9dd..c69401f8 100644 --- a/browser/main/Detail/ToggleModeButton.styl +++ b/browser/main/Detail/ToggleModeButton.styl @@ -30,8 +30,8 @@ tooltip() position absolute pointer-events none - top 40px - left -3px + top 33px + left -10px z-index 200 width 80px padding 5px diff --git a/browser/main/Detail/TrashButton.styl b/browser/main/Detail/TrashButton.styl index da107ded..7c7af878 100644 --- a/browser/main/Detail/TrashButton.styl +++ b/browser/main/Detail/TrashButton.styl @@ -8,7 +8,7 @@ tooltip() position absolute pointer-events none - top 65px + top 50px right 50px z-index 200 padding 5px From 7a116966fa9295411e8d18da19871f7d26f9dff4 Mon Sep 17 00:00:00 2001 From: Kazu Yokomizo Date: Wed, 24 Jan 2018 16:16:14 -0500 Subject: [PATCH 46/85] Add tooltip to full-screen-btn on the snippet note detail --- browser/main/Detail/NoteDetailInfo.styl | 2 +- browser/main/Detail/SnippetNoteDetail.js | 1 + browser/main/Detail/SnippetNoteDetail.styl | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/browser/main/Detail/NoteDetailInfo.styl b/browser/main/Detail/NoteDetailInfo.styl index 4b96bd58..bc3c9462 100644 --- a/browser/main/Detail/NoteDetailInfo.styl +++ b/browser/main/Detail/NoteDetailInfo.styl @@ -46,7 +46,7 @@ $info-margin-under-border = 30px .info-right z-index 101 display inline-flex - margin-top 5px + margin-top 3px .undo-button width 34px diff --git a/browser/main/Detail/SnippetNoteDetail.js b/browser/main/Detail/SnippetNoteDetail.js index 2c6da41c..af8c178e 100644 --- a/browser/main/Detail/SnippetNoteDetail.js +++ b/browser/main/Detail/SnippetNoteDetail.js @@ -634,6 +634,7 @@ class SnippetNoteDetail extends React.Component { + Fullscreen this.handleTrashButtonClick(e)} /> diff --git a/browser/main/Detail/SnippetNoteDetail.styl b/browser/main/Detail/SnippetNoteDetail.styl index f370afc8..e924ce2b 100644 --- a/browser/main/Detail/SnippetNoteDetail.styl +++ b/browser/main/Detail/SnippetNoteDetail.styl @@ -69,6 +69,21 @@ top 80px margin-bottom 10px topBarButtonRight() + &:hover .tooltip + opacity 1 + +.tooltip + tooltip() + position absolute + pointer-events none + top 50px + right 70px + z-index 200 + padding 5px + line-height normal + border-radius 2px + opacity 0 + transition 0.1s body[data-theme="white"] .root From 8b0b29c424f1f62ed2623c499e8bc3bce4cd9af1 Mon Sep 17 00:00:00 2001 From: cyalins Date: Thu, 25 Jan 2018 13:27:02 +1100 Subject: [PATCH 47/85] Improved clarity of wording --- browser/main/modals/PreferencesModal/StoragesTab.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/browser/main/modals/PreferencesModal/StoragesTab.js b/browser/main/modals/PreferencesModal/StoragesTab.js index 5c328f8a..6a14c067 100644 --- a/browser/main/modals/PreferencesModal/StoragesTab.js +++ b/browser/main/modals/PreferencesModal/StoragesTab.js @@ -78,7 +78,7 @@ class StoragesTab extends React.Component {
@@ -167,7 +167,7 @@ class StoragesTab extends React.Component {
- 3rd party cloud integration: + Setting up 3rd-party cloud storage integration: this.handleLinkClick(e)} >Cloud-Syncing-and-Backup From 01605aa221ec5cf2ab25eed6361b06427abc6a26 Mon Sep 17 00:00:00 2001 From: Steve Quinn Date: Thu, 25 Jan 2018 13:27:43 +1100 Subject: [PATCH 48/85] Allows keyboard text selection in Finder search box --- browser/finder/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser/finder/index.js b/browser/finder/index.js index af89147b..ee418f94 100644 --- a/browser/finder/index.js +++ b/browser/finder/index.js @@ -104,7 +104,7 @@ class FinderMain extends React.Component { hideFinder() e.preventDefault() } - if (e.keyCode === 91 || e.metaKey) { + if (e.keyCode === 91) { return } } From 9165f518a94eb7b0218326358dcabb15b6ec0667 Mon Sep 17 00:00:00 2001 From: cyalins Date: Thu, 25 Jan 2018 13:41:24 +1100 Subject: [PATCH 49/85] Improved wording of data collection --- browser/main/modals/PreferencesModal/InfoTab.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/browser/main/modals/PreferencesModal/InfoTab.js b/browser/main/modals/PreferencesModal/InfoTab.js index 2a1db828..a4ff1579 100644 --- a/browser/main/modals/PreferencesModal/InfoTab.js +++ b/browser/main/modals/PreferencesModal/InfoTab.js @@ -60,7 +60,8 @@ class InfoTab extends React.Component { }) } - infoMessage () { + + Message () { const { amaMessage } = this.state return amaMessage ?

{amaMessage}

: null } @@ -102,7 +103,7 @@ class InfoTab extends React.Component {
-
Info
+
About
@@ -137,17 +138,19 @@ class InfoTab extends React.Component {
-
Data collection policy
-
We collect only the number of DAU for Boostnote and **DO NOT collect** any detail information such as your note content.
+
Analytics
+
Boostnote collects anonymous data for the sole purpose of improving the application, and strictly does not collect any personal information such the contents of your notes.
You can see how it works on this.handleLinkClick(e)}>GitHub.
-
This data is only used for Boostnote improvements.
+
+
You can choose to enable or disable this option.
this.handleConfigChange(e)} checked={this.state.config.amaEnabled} ref='amaEnabled' type='checkbox' /> - Enable to send analytics to our servers
+ Enable analytics to help improve Boostnote
+
{this.infoMessage()}
) From f7bd52ac0c53f1b8213f10638c1890fccfe35b97 Mon Sep 17 00:00:00 2001 From: cyalins Date: Thu, 25 Jan 2018 13:46:08 +1100 Subject: [PATCH 50/85] Improved clarity of crowdfunding message --- browser/main/modals/PreferencesModal/Crowdfunding.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/browser/main/modals/PreferencesModal/Crowdfunding.js b/browser/main/modals/PreferencesModal/Crowdfunding.js index 3dccd27b..048520b0 100644 --- a/browser/main/modals/PreferencesModal/Crowdfunding.js +++ b/browser/main/modals/PreferencesModal/Crowdfunding.js @@ -22,18 +22,18 @@ class Crowdfunding extends React.Component { return (
Crowdfunding
-

Dear all,

+

Dear everyone,


-

Thanks for your using!

-

Boostnote is used in about 200 countries and regions, it is a awesome developer community.

+

Thank you for using Boostnote!

+

Boostnote is used in about 200 different countries and regions by an awesome community of developers.


To continue supporting this growth, and to satisfy community expectations,

-

we would like to invest more time in this project.

+

we would like to invest more time and resources in this project.


-

If you like this project and see its potential, you can help!

+

If you like this project and see its potential, you can help by supporting us on OpenCollective!


Thanks,

-

Boostnote maintainers.

+

Boostnote maintainers


-
+
{this.infoMessage()}
) diff --git a/browser/main/modals/PreferencesModal/StoragesTab.js b/browser/main/modals/PreferencesModal/StoragesTab.js index 76e69f87..f66a617e 100644 --- a/browser/main/modals/PreferencesModal/StoragesTab.js +++ b/browser/main/modals/PreferencesModal/StoragesTab.js @@ -167,7 +167,7 @@ class StoragesTab extends React.Component {
- Setting up 3rd-party cloud storage integration: + Setting up 3rd-party cloud storage integration:{' '} this.handleLinkClick(e)} >Cloud-Syncing-and-Backup diff --git a/browser/main/modals/PreferencesModal/index.js b/browser/main/modals/PreferencesModal/index.js index 228a08f4..574b5186 100644 --- a/browser/main/modals/PreferencesModal/index.js +++ b/browser/main/modals/PreferencesModal/index.js @@ -1,6 +1,5 @@ import PropTypes from 'prop-types' import React from 'react' -import ReactDOM from 'react-dom' import { connect } from 'react-redux' import HotkeyTab from './HotkeyTab' import UiTab from './UiTab' @@ -11,6 +10,7 @@ import ModalEscButton from 'browser/components/ModalEscButton' import CSSModules from 'browser/lib/CSSModules' import styles from './PreferencesModal.styl' import RealtimeNotification from 'browser/components/RealtimeNotification' +import _ from 'lodash' class Preferences extends React.Component { constructor (props) { @@ -94,8 +94,8 @@ class Preferences extends React.Component { } getContentBoundingBox () { - const node = ReactDOM.findDOMNode(this.refs.content) - return node.getBoundingClientRect() + console.log(this.refs.content.getBoundingClientRect()) + return this.refs.content.getBoundingClientRect() } haveToSaveNotif (type, message) { diff --git a/browser/main/store.js b/browser/main/store.js index 36e7850d..abd34889 100644 --- a/browser/main/store.js +++ b/browser/main/store.js @@ -355,11 +355,9 @@ function data (state = defaultDataMap(), action) { state.storageMap.set(action.storage.key, action.storage) return state case 'EXPORT_FOLDER': - { - state = Object.assign({}, state) - state.storageMap = new Map(state.storageMap) - state.storageMap.set(action.storage.key, action.storage) - } + state = Object.assign({}, state) + state.storageMap = new Map(state.storageMap) + state.storageMap.set(action.storage.key, action.storage) return state case 'DELETE_FOLDER': { From 7cad3d403b92be315c4911e6efd1fb05b10caa44 Mon Sep 17 00:00:00 2001 From: Junyoung Choi Date: Sat, 3 Feb 2018 15:00:06 +0900 Subject: [PATCH 74/85] Discard unnecessary logging --- browser/main/modals/PreferencesModal/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/browser/main/modals/PreferencesModal/index.js b/browser/main/modals/PreferencesModal/index.js index 574b5186..6cd5badc 100644 --- a/browser/main/modals/PreferencesModal/index.js +++ b/browser/main/modals/PreferencesModal/index.js @@ -94,7 +94,6 @@ class Preferences extends React.Component { } getContentBoundingBox () { - console.log(this.refs.content.getBoundingClientRect()) return this.refs.content.getBoundingClientRect() } From 69601bf15a1ab2f81cfd3ca4d59c43788b8446ce Mon Sep 17 00:00:00 2001 From: Junyoung Choi Date: Sat, 3 Feb 2018 15:02:26 +0900 Subject: [PATCH 75/85] Fix but: line numbers of editor isnt applied properly --- browser/components/CodeEditor.js | 5 +++-- browser/components/MarkdownSplitEditor.js | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/browser/components/CodeEditor.js b/browser/components/CodeEditor.js index cda37836..217a14b1 100644 --- a/browser/components/CodeEditor.js +++ b/browser/components/CodeEditor.js @@ -51,6 +51,7 @@ export default class CodeEditor extends React.Component { componentDidMount () { this.value = this.props.value + this.editor = CodeMirror(this.refs.root, { value: this.props.value, lineNumbers: this.props.displayLineNumbers, @@ -71,7 +72,7 @@ export default class CodeEditor extends React.Component { if (cm.somethingSelected()) cm.indentSelection('add') else { const tabs = cm.getOption('indentWithTabs') - if (line.trimLeft().match(/^(-|\*|\+) (\[( |x)\] )?$/)) { + if (line.trimLeft().match(/^(-|\*|\+) (\[( |x)] )?$/)) { cm.execCommand('goLineStart') if (tabs) { cm.execCommand('insertTab') @@ -234,7 +235,7 @@ export default class CodeEditor extends React.Component { if (!dataTransferItem.type.match('image')) return const blob = dataTransferItem.getAsFile() - const reader = new FileReader() + const reader = new window.FileReader() let base64data reader.readAsDataURL(blob) diff --git a/browser/components/MarkdownSplitEditor.js b/browser/components/MarkdownSplitEditor.js index d0a3eb27..2cf8e322 100644 --- a/browser/components/MarkdownSplitEditor.js +++ b/browser/components/MarkdownSplitEditor.js @@ -62,6 +62,7 @@ class MarkdownSplitEditor extends React.Component { keyMap={config.editor.keyMap} fontFamily={config.editor.fontFamily} fontSize={editorFontSize} + displayLineNumbers={config.editor.displayLineNumbers} indentType={config.editor.indentType} indentSize={editorIndentSize} scrollPastEnd={config.editor.scrollPastEnd} From 03be809ba923840dfd026f466b881b4db31a6d54 Mon Sep 17 00:00:00 2001 From: Junyoung Choi Date: Sat, 3 Feb 2018 15:03:33 +0900 Subject: [PATCH 76/85] Text stable version only The current version of boostnote doesn't support the latest stable version, v9.x --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 013169e8..9080f960 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ language: node_js node_js: - - stable - lts/* script: - npm run lint && npm run test From eb698a7430338d6b6d36c1aad5222f38ce54a5a2 Mon Sep 17 00:00:00 2001 From: Junyoung Choi Date: Sat, 3 Feb 2018 15:10:16 +0900 Subject: [PATCH 77/85] Fix lint error --- browser/main/modals/PreferencesModal/UiTab.js | 1 - 1 file changed, 1 deletion(-) diff --git a/browser/main/modals/PreferencesModal/UiTab.js b/browser/main/modals/PreferencesModal/UiTab.js index 6165480d..df35e260 100644 --- a/browser/main/modals/PreferencesModal/UiTab.js +++ b/browser/main/modals/PreferencesModal/UiTab.js @@ -327,7 +327,6 @@ class UiTab extends React.Component {
-
Preview
From 31da231c1c1105187a259d64b98475f5660347be Mon Sep 17 00:00:00 2001 From: Junyoung Choi Date: Sat, 3 Feb 2018 15:28:19 +0900 Subject: [PATCH 78/85] Rollback .travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 9080f960..013169e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,6 @@ language: node_js node_js: + - stable - lts/* script: - npm run lint && npm run test From ff67043210ef7ef8a2cb676be79c8656bd6fa806 Mon Sep 17 00:00:00 2001 From: Junyoung Choi Date: Sat, 3 Feb 2018 15:52:51 +0900 Subject: [PATCH 79/85] Bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d2340b65..57dc4ae7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "boost", "productName": "Boostnote", - "version": "0.8.20", + "version": "0.8.21", "main": "index.js", "description": "Boostnote", "license": "GPL-3.0", From ca282d5635ff40dbfff38306c4379673b58feb16 Mon Sep 17 00:00:00 2001 From: Kazu Yokomizo Date: Sat, 3 Feb 2018 16:32:02 +0900 Subject: [PATCH 80/85] Fix percentage bar in markdown preview --- browser/components/TodoListPercentage.styl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser/components/TodoListPercentage.styl b/browser/components/TodoListPercentage.styl index d4cb7485..329663f9 100644 --- a/browser/components/TodoListPercentage.styl +++ b/browser/components/TodoListPercentage.styl @@ -1,6 +1,6 @@ .percentageBar position absolute - top 50px + top 72px right 0px left 0px background-color #DADFE1 From 51a8c47afd2fc5f70f18e62a316868427f3a0c15 Mon Sep 17 00:00:00 2001 From: "Junyoung Choi (Sai)" Date: Sat, 3 Feb 2018 23:39:53 +0900 Subject: [PATCH 81/85] Discard finder (#1497) * Discard finder * Upgrade electron * Discard anything related with finder * Fix lint errors * Run test serial * Test on v6 * Test on v6 only --- .boostnoterc.sample | 1 - .travis.yml | 3 +- browser/finder/FinderMain.styl | 156 -------- browser/finder/NoteDetail.js | 211 ----------- browser/finder/NoteDetail.styl | 129 ------- browser/finder/NoteList.js | 90 ----- browser/finder/StorageSection.js | 77 ---- browser/finder/StorageSection.styl | 85 ----- browser/finder/index.js | 357 ------------------ browser/finder/ipcClient.js | 126 ------- browser/finder/store.js | 51 --- browser/main/lib/ConfigManager.js | 1 - browser/main/lib/ipcClient.js | 14 - .../main/modals/PreferencesModal/HotkeyTab.js | 12 - browser/styles/finder/index.styl | 129 ------- browser/styles/theme/dark.styl | 42 --- index.js | 11 +- lib/finder-app.js | 14 - lib/finder-window.js | 101 ----- lib/finder.html | 65 ---- lib/ipcServer.js | 23 -- lib/main-app.js | 18 - lib/main-window.js | 12 +- package.json | 6 +- tests/lib/boostnoterc/.boostnoterc.all | 1 - tests/lib/rc-parser-test.js | 2 +- webpack-skeleton.js | 3 +- yarn.lock | 6 +- 28 files changed, 14 insertions(+), 1732 deletions(-) delete mode 100644 browser/finder/FinderMain.styl delete mode 100644 browser/finder/NoteDetail.js delete mode 100644 browser/finder/NoteDetail.styl delete mode 100644 browser/finder/NoteList.js delete mode 100644 browser/finder/StorageSection.js delete mode 100644 browser/finder/StorageSection.styl delete mode 100644 browser/finder/index.js delete mode 100644 browser/finder/ipcClient.js delete mode 100644 browser/finder/store.js delete mode 100644 browser/styles/finder/index.styl delete mode 100755 lib/finder-app.js delete mode 100644 lib/finder-window.js delete mode 100644 lib/finder.html diff --git a/.boostnoterc.sample b/.boostnoterc.sample index 2caa2c1a..8419061d 100644 --- a/.boostnoterc.sample +++ b/.boostnoterc.sample @@ -10,7 +10,6 @@ "theme": "monokai" }, "hotkey": { - "toggleFinder": "Cmd + Alt + S", "toggleMain": "Cmd + Alt + L" }, "isSideNavFolded": false, diff --git a/.travis.yml b/.travis.yml index 013169e8..c68d1063 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: node_js node_js: - - stable - - lts/* + - 6 script: - npm run lint && npm run test - 'if [[ ${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH} = "master" ]]; then npm install -g grunt npm@5.2 && grunt pre-build; fi' diff --git a/browser/finder/FinderMain.styl b/browser/finder/FinderMain.styl deleted file mode 100644 index 8ba7c3b9..00000000 --- a/browser/finder/FinderMain.styl +++ /dev/null @@ -1,156 +0,0 @@ -$search-height = 50px -$nav-width = 175px -$list-width = 250px - -.root - absolute top left right bottom - -.search - height $search-height - padding 10px - box-sizing border-box - border-bottom $ui-border - text-align center - -.search-input - height 30px - width 100% - margin 0 auto - font-size 18px - border none - outline none - text-align center - background-color transparent - -.result - absolute left right bottom - top $search-height - background-color $ui-noteDetail-backgroundColor - -.result-nav - user-select none - absolute left top bottom - width $nav-width - background-color $ui-backgroundColor - -.result-nav-filter - margin-bottom 10px - -.result-nav-filter-option - height 25px - line-height 25px - padding 0 10px - label - cursor pointer - -.result-nav-menu - navButtonColor() - height 32px - padding 0 10px - font-size 14px - width 100% - outline none - text-align left - line-height 32px - box-sizing border-box - cursor pointer - -.result-nav-menu--active - @extend .result-nav-menu - background-color $ui-button--active-backgroundColor - color $ui-button--active-color - &:hover - background-color $ui-button--active-backgroundColor - -.result-nav-storageList - absolute bottom left right - top 110px + 32px + 10px + 10px + 20px - overflow-y auto - -.result-list - user-select none - absolute top bottom - left $nav-width - width $list-width - box-sizing border-box - overflow-y auto - box-shadow 2px 0 15px -8px #b1b1b1 - z-index 1 - -.result-detail - absolute top bottom right - left $nav-width + $list-width - background-color $ui-noteDetail-backgroundColor - -body[data-theme="dark"] - .root - background-color $ui-dark-backgroundColor - .search - border-color $ui-dark-borderColor - .search-input - color $ui-dark-text-color - - .result - background-color $ui-dark-noteList-backgroundColor - - .result-nav - background-color $ui-dark-backgroundColor - label - color $ui-dark-text-color - - .result-nav-menu - navDarkButtonColor() - - .result-nav-menu--active - background-color $ui-dark-button--active-backgroundColor - color $ui-dark-button--active-color - &:hover - background-color $ui-dark-button--active-backgroundColor - - .result-list - border-color $ui-dark-borderColor - box-shadow none - top 0 - - .result-detail - absolute top bottom right - left $nav-width + $list-width - background-color $ui-dark-noteDetail-backgroundColor - - - -body[data-theme="solarized-dark"] - .root - background-color $ui-solarized-dark-backgroundColor - .search - border-color $ui-solarized-dark-borderColor - .search-input - color $ui-dark-text-color - - .result - background-color $ui-solarized-dark-backgroundColor - - .result-nav - background-color $ui-solarized-dark-backgroundColor - label - color $ui-dark-text-color - - .result-nav-menu - navDarkButtonColor() - - .result-nav-menu--active - background-color $ui-solarized-dark-button-backgroundColor - color $ui-dark-button--active-color - &:hover - background-color $ui-dark-button--active-backgroundColor - - .result-list - border-color $ui-solarized-dark-borderColor - box-shadow none - top 0 - - .result-detail - absolute top bottom right - left $nav-width + $list-width - background-color $ui-solarized-dark-backgroundColor - diff --git a/browser/finder/NoteDetail.js b/browser/finder/NoteDetail.js deleted file mode 100644 index 3b9121d7..00000000 --- a/browser/finder/NoteDetail.js +++ /dev/null @@ -1,211 +0,0 @@ -import React from 'react' -import CSSModules from 'browser/lib/CSSModules' -import styles from './NoteDetail.styl' -import MarkdownPreview from 'browser/components/MarkdownPreview' -import MarkdownEditor from 'browser/components/MarkdownEditor' -import CodeEditor from 'browser/components/CodeEditor' -import CodeMirror from 'codemirror' -import 'codemirror-mode-elixir' -import { findStorage } from 'browser/lib/findStorage' - -const electron = require('electron') -const { clipboard } = electron -const path = require('path') - -function pass (name) { - switch (name) { - case 'ejs': - return 'Embedded Javascript' - case 'html_ruby': - return 'Embedded Ruby' - case 'objectivec': - return 'Objective C' - case 'text': - return 'Plain Text' - default: - return name - } -} -function notify (title, options) { - if (global.process.platform === 'win32') { - options.icon = path.join('file://', global.__dirname, '../../resources/app.png') - } - return new window.Notification(title, options) -} - -class NoteDetail extends React.Component { - constructor (props) { - super(props) - - this.state = { - snippetIndex: 0 - } - } - - componentWillReceiveProps (nextProps) { - if (nextProps.note !== this.props.note) { - this.setState({ - snippetIndex: 0 - }, () => { - if (nextProps.note.type === 'SNIPPET_NOTE') { - nextProps.note.snippets.forEach((snippet, index) => { - this.refs['code-' + index].reload() - }) - } - }) - } - } - - selectPriorSnippet () { - const { note } = this.props - if (note.type === 'SNIPPET_NOTE' && note.snippets.length > 1) { - this.setState({ - snippetIndex: (this.state.snippetIndex + note.snippets.length - 1) % note.snippets.length - }) - } - } - - selectNextSnippet () { - const { note } = this.props - if (note.type === 'SNIPPET_NOTE' && note.snippets.length > 1) { - this.setState({ - snippetIndex: (this.state.snippetIndex + 1) % note.snippets.length - }) - } - } - - saveToClipboard () { - const { note } = this.props - - if (note.type === 'MARKDOWN_NOTE') { - clipboard.writeText(note.content) - } else { - clipboard.writeText(note.snippets[this.state.snippetIndex].content) - } - - notify('Saved to Clipboard!', { - body: 'Paste it wherever you want!', - silent: true - }) - } - - handleTabButtonClick (e, index) { - this.setState({ - snippetIndex: index - }) - } - - render () { - const { note, config } = this.props - if (note == null) { - return ( -
- ) - } - - let editorFontSize = parseInt(config.editor.fontSize, 10) - if (!(editorFontSize > 0 && editorFontSize < 101)) editorFontSize = 14 - let editorIndentSize = parseInt(config.editor.indentSize, 10) - if (!(editorFontSize > 0 && editorFontSize < 132)) editorIndentSize = 4 - - const storage = findStorage(note.storage) - - if (note.type === 'SNIPPET_NOTE') { - const tabList = note.snippets.map((snippet, index) => { - const isActive = this.state.snippetIndex === index - return
- -
- }) - - const viewList = note.snippets.map((snippet, index) => { - const isActive = this.state.snippetIndex === index - - let syntax = CodeMirror.findModeByName(pass(snippet.mode)) - if (syntax == null) syntax = CodeMirror.findModeByName('Plain Text') - - return
- {snippet.mode === 'markdown' - ? - : - } -
- }) - - return ( -
-
-