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 001/555] 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 83da07a9417e9c7eb3db3959b798c37f1a7dbd83 Mon Sep 17 00:00:00 2001 From: Nikolay Lopin Date: Sun, 17 Dec 2017 21:39:34 +0300 Subject: [PATCH 002/555] Export note with local images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Looks through the note and searches for local images. Copies them to ‘images’ folder in the export path and replaces affected links. #1261 --- browser/components/MarkdownPreview.js | 32 ----------- browser/main/Detail/MarkdownNoteDetail.js | 39 +++++++++++++ browser/main/lib/dataApi/exportImage.js | 37 +++++++++++++ browser/main/lib/dataApi/exportNote.js | 67 +++++++++++++++++++++++ 4 files changed, 143 insertions(+), 32 deletions(-) mode change 100644 => 100755 browser/components/MarkdownPreview.js mode change 100644 => 100755 browser/main/Detail/MarkdownNoteDetail.js create mode 100755 browser/main/lib/dataApi/exportImage.js create mode 100755 browser/main/lib/dataApi/exportNote.js diff --git a/browser/components/MarkdownPreview.js b/browser/components/MarkdownPreview.js old mode 100644 new mode 100755 index a3e7bb93..c2693312 --- a/browser/components/MarkdownPreview.js +++ b/browser/components/MarkdownPreview.js @@ -8,7 +8,6 @@ import Raphael from 'raphael' import flowchart from 'flowchart' import SequenceDiagram from 'js-sequence-diagrams' import eventEmitter from 'browser/main/lib/eventEmitter' -import fs from 'fs' import htmlTextHelper from 'browser/lib/htmlTextHelper' import copy from 'copy-to-clipboard' import mdurl from 'mdurl' @@ -116,8 +115,6 @@ export default class MarkdownPreview extends React.Component { this.mouseUpHandler = (e) => this.handleMouseUp(e) this.anchorClickHandler = (e) => this.handlePreviewAnchorClick(e) this.checkboxClickHandler = (e) => this.handleCheckboxClick(e) - this.saveAsTextHandler = () => this.handleSaveAsText() - this.saveAsMdHandler = () => this.handleSaveAsMd() this.printHandler = () => this.handlePrint() this.linkClickHandler = this.handlelinkClick.bind(this) @@ -165,35 +162,10 @@ export default class MarkdownPreview extends React.Component { if (this.props.onMouseUp != null) this.props.onMouseUp(e) } - handleSaveAsText () { - this.exportAsDocument('txt') - } - - handleSaveAsMd () { - this.exportAsDocument('md') - } - handlePrint () { this.refs.root.contentWindow.print() } - exportAsDocument (fileType) { - const options = { - filters: [ - { name: 'Documents', extensions: [fileType] } - ], - properties: ['openFile', 'createDirectory'] - } - dialog.showSaveDialog(remote.getCurrentWindow(), options, - (filename) => { - if (filename) { - fs.writeFile(filename, this.props.value, (err) => { - if (err) throw err - }) - } - }) - } - fixDecodedURI (node) { if (node && node.children.length === 1 && typeof node.children[0] === 'string') { const { innerText, href } = node @@ -221,8 +193,6 @@ export default class MarkdownPreview extends React.Component { this.refs.root.contentWindow.document.addEventListener('mouseup', this.mouseUpHandler) this.refs.root.contentWindow.document.addEventListener('drop', this.preventImageDroppedHandler) this.refs.root.contentWindow.document.addEventListener('dragover', this.preventImageDroppedHandler) - eventEmitter.on('export:save-text', this.saveAsTextHandler) - eventEmitter.on('export:save-md', this.saveAsMdHandler) eventEmitter.on('print', this.printHandler) } @@ -232,8 +202,6 @@ export default class MarkdownPreview extends React.Component { this.refs.root.contentWindow.document.removeEventListener('mouseup', this.mouseUpHandler) this.refs.root.contentWindow.document.removeEventListener('drop', this.preventImageDroppedHandler) this.refs.root.contentWindow.document.removeEventListener('dragover', this.preventImageDroppedHandler) - eventEmitter.off('export:save-text', this.saveAsTextHandler) - eventEmitter.off('export:save-md', this.saveAsMdHandler) eventEmitter.off('print', this.printHandler) } diff --git a/browser/main/Detail/MarkdownNoteDetail.js b/browser/main/Detail/MarkdownNoteDetail.js old mode 100644 new mode 100755 index 25c993d0..956efb63 --- a/browser/main/Detail/MarkdownNoteDetail.js +++ b/browser/main/Detail/MarkdownNoteDetail.js @@ -23,6 +23,7 @@ import InfoPanelTrashed from './InfoPanelTrashed' import { formatDate } from 'browser/lib/date-formatter' import { getTodoPercentageOfCompleted } from 'browser/lib/getTodoStatus' import striptags from 'striptags' +import exportNote from 'browser/main/lib/dataApi/exportNote' const electron = require('electron') const { remote } = electron @@ -44,6 +45,8 @@ class MarkdownNoteDetail extends React.Component { this.dispatchTimer = null this.toggleLockButton = this.handleToggleLockButton.bind(this) + this.saveAsText = this.handleSaveAsText.bind(this) + this.saveAsMd = this.handleSaveAsMd.bind(this) } focus () { @@ -52,6 +55,8 @@ class MarkdownNoteDetail extends React.Component { componentDidMount () { ee.on('topbar:togglelockbutton', this.toggleLockButton) + ee.on('export:save-text', this.saveAsText) + ee.on('export:save-md', this.saveAsMd) } componentWillReceiveProps (nextProps) { @@ -72,6 +77,8 @@ class MarkdownNoteDetail extends React.Component { componentDidUnmount () { ee.off('topbar:togglelockbutton', this.toggleLockButton) + ee.off('export:save-text', this.saveAsTextHandler) + ee.off('export:save-md', this.saveAsMdHandler) } handleChange (e) { @@ -170,6 +177,30 @@ class MarkdownNoteDetail extends React.Component { ee.emit('export:save-text') } + exportAsDocument (fileType) { + const options = { + filters: [ + { name: 'Documents', extensions: [fileType] } + ], + properties: ['openFile', 'createDirectory'] + } + + dialog.showSaveDialog(remote.getCurrentWindow(), options, + (filename) => { + if (filename) { + const note = this.props.note + + exportNote(note.storage, note.content, filename) + .then((res) => { + dialog.showMessageBox(remote.getCurrentWindow(), {type: 'info', message: `Exported to ${filename}`}) + }).catch((err) => { + dialog.showErrorBox('Export error', err ? err.message || err : 'Unexpected error during export') + throw err + }) + } + }) + } + handleTrashButtonClick (e) { const { note } = this.state const { isTrashed } = note @@ -207,6 +238,14 @@ class MarkdownNoteDetail extends React.Component { ee.emit('list:next') } + handleSaveAsText () { + this.exportAsDocument('txt') + } + + handleSaveAsMd () { + this.exportAsDocument('md') + } + handleUndoButtonClick (e) { const { note } = this.state diff --git a/browser/main/lib/dataApi/exportImage.js b/browser/main/lib/dataApi/exportImage.js new file mode 100755 index 00000000..a1c84390 --- /dev/null +++ b/browser/main/lib/dataApi/exportImage.js @@ -0,0 +1,37 @@ +const fs = require('fs') +const path = require('path') + +/** + * @description Export an image + * @param {String} storagePath + * @param {String} srcFilename + * @param {String} dstPath + * @param {String} dstFilename if not present, destination filename will be equal to srcFilename + * @return {Promise} an image path + */ +function exportImage (storagePath, srcFilename, dstPath, dstFilename = '') { + dstFilename = dstFilename || srcFilename + + const src = path.join(storagePath, 'images', srcFilename) + + if (!path.extname(dstFilename)) { + dstFilename += path.extname(srcFilename) + } + + const dstImagesFolder = path.join(dstPath, 'images') + const dst = path.join(dstImagesFolder, dstFilename) + + return new Promise((resolve, reject) => { + if (!fs.existsSync(dstImagesFolder)) fs.mkdirSync(dstImagesFolder) + + const input = fs.createReadStream(src) + const output = fs.createWriteStream(dst) + + output.on('error', reject) + input.on('error', reject) + input.on('end', resolve) + input.pipe(output) + }) +} + +module.exports = exportImage diff --git a/browser/main/lib/dataApi/exportNote.js b/browser/main/lib/dataApi/exportNote.js new file mode 100755 index 00000000..368b43ca --- /dev/null +++ b/browser/main/lib/dataApi/exportNote.js @@ -0,0 +1,67 @@ +import exportImage from 'browser/main/lib/dataApi/exportImage' +import {findStorage} from 'browser/lib/findStorage' + +const fs = require('fs') +const path = require('path') + +/** + * Export note together with images + * + * If images is stored in the storage, creates 'images' subfolder in target directory + * and copies images to it. Changes links to images in the content of the note + * + * @param {String} storageKey + * @param {String} noteContent Content to export + * @param {String} targetPath Path to exported file + * @return {Promise.<*[]>} + */ +function exportNote (storageKey, noteContent, targetPath) { + const targetStorage = findStorage(storageKey) + const storagedImagesRe = /!\[(.*?)\]\(\s*?\/:storage\/(.*\.\S*?)\)/gi + const exportTasks = [] + const images = [] + + const exportedData = noteContent.replace(storagedImagesRe, (match, dstFilename, srcFilename) => { + if (!path.extname(dstFilename)) { + dstFilename += path.extname(srcFilename) + } + const imagePath = path.join('images', dstFilename) + + exportTasks.push( + exportImage(targetStorage.path, srcFilename, path.dirname(targetPath), dstFilename) + ) + images.push(imagePath) + return `![${dstFilename}](${imagePath})` + }) + + exportTasks.push(exportFile(exportedData, targetPath)) + return Promise.all(exportTasks) + .catch((err) => { + rollbackExport(images) + throw err + }) +} + +function exportFile (data, filename) { + return new Promise((resolve, reject) => { + fs.writeFile(filename, data, (err) => { + if (err) throw err + + resolve(filename) + }) + }) +} + +/** + * Remove exported images + * @param imagesPaths + */ +function rollbackExport (imagesPaths) { + imagesPaths.forEach((path) => { + if (fs.existsSync(path)) { + fs.unlink(path) + } + }) +} + +export default exportNote 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 003/555] 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 {
- 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 009/555] 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 010/555] 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 011/555] 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 012/555] 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 013/555] 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 014/555] 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 015/555] 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 016/555] 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 017/555] 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 018/555] 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 019/555] 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 046/555] 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 047/555] 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 048/555] 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 049/555] 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 050/555] 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 051/555] 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 052/555] 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 053/555] 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 ( -
-
-