From 3b11285bd553e2c29605b3e65d8e0ea4c06a34a4 Mon Sep 17 00:00:00 2001 From: Amir Eldor Date: Fri, 12 Oct 2018 20:15:07 +0300 Subject: [PATCH 01/22] Remove emacs keymap Ctrl-V binding to allow pasting Fixes #1406 --- browser/main/Main.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/browser/main/Main.js b/browser/main/Main.js index 0f31a591..0f695673 100644 --- a/browser/main/Main.js +++ b/browser/main/Main.js @@ -168,6 +168,8 @@ class Main extends React.Component { } }) + delete CodeMirror.keyMap.emacs["Ctrl-V"] + eventEmitter.on('editor:fullscreen', this.toggleFullScreen) } From 342d0862c6540f933a09108045e557d78b86721d Mon Sep 17 00:00:00 2001 From: Amir Eldor Date: Fri, 12 Oct 2018 20:31:48 +0300 Subject: [PATCH 02/22] Change to single-quotes --- browser/main/Main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser/main/Main.js b/browser/main/Main.js index 0f695673..26e5086a 100644 --- a/browser/main/Main.js +++ b/browser/main/Main.js @@ -168,7 +168,7 @@ class Main extends React.Component { } }) - delete CodeMirror.keyMap.emacs["Ctrl-V"] + delete CodeMirror.keyMap.emacs['Ctrl-V'] eventEmitter.on('editor:fullscreen', this.toggleFullScreen) } From 148feac43e8cedb51db70c9e297e83b4162c0d30 Mon Sep 17 00:00:00 2001 From: FabioRosado Date: Sat, 20 Oct 2018 15:03:07 +0100 Subject: [PATCH 03/22] Add translation to Portuguese from Portugal --- locales/pt-PT.json | 264 ++++++++++++++++++++++----------------------- 1 file changed, 132 insertions(+), 132 deletions(-) diff --git a/locales/pt-PT.json b/locales/pt-PT.json index 19fe0e94..dcd5b49c 100644 --- a/locales/pt-PT.json +++ b/locales/pt-PT.json @@ -1,155 +1,155 @@ { - "Notes": "Notes", - "Tags": "Tags", - "Preferences": "Preferences", - "Make a note": "Make a note", + "Notes": "Notas", + "Tags": "Etiquetas", + "Preferences": "Definiçōes", + "Make a note": "Criar nota", "Ctrl": "Ctrl", "Ctrl(^)": "Ctrl", - "to create a new note": "to create a new note", - "Toggle Mode": "Toggle Mode", - "Trash": "Trash", - "MODIFICATION DATE": "MODIFICATION DATE", - "Words": "Words", - "Letters": "Letters", - "STORAGE": "STORAGE", - "FOLDER": "FOLDER", - "CREATION DATE": "CREATION DATE", - "NOTE LINK": "NOTE LINK", + "to create a new note": "para creat uma nova nota", + "Toggle Mode": "Alternar Modo", + "Trash": "Lixo", + "MODIFICATION DATE": "DATA DE MODIFICAÇÃO", + "Words": "Palavras", + "Letters": "Letras", + "STORAGE": "ARMAZENAMENTO", + "FOLDER": "PASTA", + "CREATION DATE": "DATA DE CRIAÇÃO", + "NOTE LINK": "LINK DE NOTA", ".md": ".md", ".txt": ".txt", ".html": ".html", - "Print": "Print", - "Your preferences for Boostnote": "Your preferences for Boostnote", - "Storage Locations": "Storage Locations", - "Add Storage Location": "Add Storage Location", - "Add Folder": "Add Folder", - "Open Storage folder": "Open Storage folder", + "Print": "Imprimir", + "Your preferences for Boostnote": "As tuas definiçōes para Boostnote", + "Storage Locations": "Locais de Armazenamento", + "Add Storage Location": "Adicionar Local de Armazenamento", + "Add Folder": "Adicionar Pasta", + "Open Storage folder": "Abrir Local de Armazenamento", "Unlink": "Unlink", - "Edit": "Edit", - "Delete": "Delete", + "Edit": "Editar", + "Delete": "Apagar", "Interface": "Interface", - "Interface Theme": "Interface Theme", + "Interface Theme": "Tema", "Default": "Default", - "White": "White", + "White": "Branco", "Solarized Dark": "Solarized Dark", - "Dark": "Dark", - "Show a confirmation dialog when deleting notes": "Show a confirmation dialog when deleting notes", - "Editor Theme": "Editor Theme", - "Editor Font Size": "Editor Font Size", - "Editor Font Family": "Editor Font Family", - "Editor Indent Style": "Editor Indent Style", - "Spaces": "Spaces", + "Dark": "Escuro", + "Show a confirmation dialog when deleting notes": "Mostrar uma confirmação ao excluir notas", + "Editor Theme": "Tema do Editor", + "Editor Font Size": "Tamanho de Fonte do Editor", + "Editor Font Family": "Família de Fonte do Editor", + "Editor Indent Style": "Estílo de Identação do Editor", + "Spaces": "Espaços", "Tabs": "Tabs", - "Switch to Preview": "Switch to Preview", - "When Editor Blurred": "When Editor Blurred", - "When Editor Blurred, Edit On Double Click": "When Editor Blurred, Edit On Double Click", - "On Right Click": "On Right Click", - "Editor Keymap": "Editor Keymap", - "default": "default", + "Switch to Preview": "Mudar para Pré-Visualização", + "When Editor Blurred": "Quando o Editor Obscurece", + "When Editor Blurred, Edit On Double Click": "Quando o Editor Obscurece, Editar com Duplo Clique", + "On Right Click": "Ao Clicar Com o Botão Direito", + "Editor Keymap": "Mapa de Teclado do Editor", + "default": "padrão", "vim": "vim", "emacs": "emacs", - "⚠️ Please restart boostnote after you change the keymap": "⚠️ Please restart boostnote after you change the keymap", - "Show line numbers in the editor": "Show line numbers in the editor", - "Allow editor to scroll past the last line": "Allow editor to scroll past the last line", - "Bring in web page title when pasting URL on editor": "Bring in web page title when pasting URL on editor", - "Preview": "Preview", - "Preview Font Size": "Preview Font Size", - "Preview Font Family": "Preview Font Family", - "Code Block Theme": "Code Block Theme", - "Allow preview to scroll past the last line": "Allow preview to scroll past the last line", - "Show line numbers for preview code blocks": "Show line numbers for preview code blocks", - "LaTeX Inline Open Delimiter": "LaTeX Inline Open Delimiter", - "LaTeX Inline Close Delimiter": "LaTeX Inline Close Delimiter", - "LaTeX Block Open Delimiter": "LaTeX Block Open Delimiter", - "LaTeX Block Close Delimiter": "LaTeX Block Close Delimiter", + "⚠️ Please restart boostnote after you change the keymap": "⚠️ Por favor, reinicia o Boostnote depois de alterar o mapa de teclado.", + "Show line numbers in the editor": "Mostrar os números das linhas no editor", + "Allow editor to scroll past the last line": "Permitir que o editor faça scroll além da última linha", + "Bring in web page title when pasting URL on editor": "Trazer o título da página da Web ao colar o endereço no editor", + "Preview": "Pré-Visualização", + "Preview Font Size": "Tamanho da Fonte da Pré-Visualização", + "Preview Font Family": "Família da Fonte da Pré-Visualização", + "Code Block Theme": "Tema do Bloco de Código", + "Allow preview to scroll past the last line": "Permitir que se faça scroll além da última linha", + "Show line numbers for preview code blocks": "Mostrar os números das linhas na pré-visualização dos blocos de código", + "LaTeX Inline Open Delimiter": "Delimitador para Abrir Bloco LaTeX em Linha", + "LaTeX Inline Close Delimiter": "Delimitador para Fechar Bloco LaTeX em Linha", + "LaTeX Block Open Delimiter": "Delimitador para Abrir Bloco LaTeX", + "LaTeX Block Close Delimiter": "Delimitador para Fechar Bloco LaTeX", "PlantUML Server": "PlantUML Server", - "Community": "Community", - "Subscribe to Newsletter": "Subscribe to Newsletter", + "Community": "Comunidade", + "Subscribe to Newsletter": "Subscrever à Newsletter", "GitHub": "GitHub", "Blog": "Blog", - "Facebook Group": "Facebook Group", + "Facebook Group": "Grupo de Facebook", "Twitter": "Twitter", - "About": "About", + "About": "Sobre", "Boostnote": "Boostnote", - "An open source note-taking app made for programmers just like you.": "An open source note-taking app made for programmers just like you.", + "An open source note-taking app made for programmers just like you.": "Uma aplicação open source de bloco de notas feita para programadores como tu.", "Website": "Website", - "Development": "Development", - " : Development configurations for Boostnote.": " : Development configurations for Boostnote.", - "Copyright (C) 2017 - 2018 BoostIO": "Copyright (C) 2017 - 2018 BoostIO", - "License: GPL v3": "License: GPL v3", - "Analytics": "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.": "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 ": "You can see how it works on ", - "You can choose to enable or disable this option.": "You can choose to enable or disable this option.", - "Enable analytics to help improve Boostnote": "Enable analytics to help improve Boostnote", - "Crowdfunding": "Crowdfunding", - "Dear Boostnote users,": "Dear Boostnote users,", - "Thank you for using Boostnote!": "Thank you for using Boostnote!", - "Boostnote is used in about 200 different countries and regions by an awesome community of developers.": "Boostnote is used in about 200 different countries and regions by an awesome community of developers.", - "To support our growing userbase, and satisfy community expectations,": "To support our growing userbase, and satisfy community expectations,", - "we would like to invest more time and resources in this project.": "we would like to invest more time and resources in this project.", - "If you use Boostnote and see its potential, help us out by supporting the project on OpenCollective!": "If you use Boostnote and see its potential, help us out by supporting the project on OpenCollective!", - "Thanks,": "Thanks,", - "The Boostnote Team": "The Boostnote Team", - "Support via OpenCollective": "Support via OpenCollective", - "Language": "Language", - "English": "English", - "German": "German", - "French": "French", - "Show \"Saved to Clipboard\" notification when copying": "Show \"Saved to Clipboard\" notification when copying", - "All Notes": "All Notes", - "Starred": "Starred", - "Are you sure to ": "Are you sure to ", - " delete": " delete", - "this folder?": "this folder?", - "Confirm": "Confirm", - "Cancel": "Cancel", - "Markdown Note": "Markdown Note", - "This format is for creating text documents. Checklists, code blocks and Latex blocks are available.": "This format is for creating text documents. Checklists, code blocks and Latex blocks are available.", - "Snippet Note": "Snippet Note", - "This format is for creating code snippets. Multiple snippets can be grouped into a single note.": "This format is for creating code snippets. Multiple snippets can be grouped into a single note.", - "Tab to switch format": "Tab to switch format", - "Updated": "Updated", - "Created": "Created", - "Alphabetically": "Alphabetically", - "Default View": "Default View", - "Compressed View": "Compressed View", - "Search": "Search", - "Blog Type": "Blog Type", - "Blog Address": "Blog Address", - "Save": "Save", - "Auth": "Auth", - "Authentication Method": "Authentication Method", + "Development": "Desenvolvimento", + " : Development configurations for Boostnote.": " : Configurações de desenvolvimento para o Boostnote.", + "Copyright (C) 2017 - 2018 BoostIO": "Direitos de Autor (C) 2017 - 2018 BoostIO", + "License: GPL v3": "Licença: GPL v3", + "Analytics": "Analíse de Data", + "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.": "O Boostnote coleta dados anônimos com o único propósito de melhorar a aplicação e não adquire informação pessoal ou conteúdo das tuas notas.", + "You can see how it works on ": "Podes ver como funciona em ", + "You can choose to enable or disable this option.": "Podes optar por activar ou desactivar esta opção.", + "Enable analytics to help improve Boostnote": "Permitir recolha de data anônima para ajudar a melhorar o Boostnote", + "Crowdfunding": "Financiamento Coletivo", + "Dear Boostnote users,": "Caros(as),", + "Thank you for using Boostnote!": "Obrigado por usar o Boostnote!", + "Boostnote is used in about 200 different countries and regions by an awesome community of developers.": "O Boostnote é usado em cerca de 200 países e regiões diferentes por uma incrível comunidade de developers.", + "To support our growing userbase, and satisfy community expectations,": "Para continuar a apoiar o crescimento e satisfazer as expectativas da comunidade,", + "we would like to invest more time and resources in this project.": "gostaríamos de investir mais tempo e recursos neste projeto.", + "If you use Boostnote and see its potential, help us out by supporting the project on OpenCollective!": "Se gostas deste projeto e vês o seu potencial, podes ajudar-nos através de donativos no OpenCollective!", + "Thanks,": "Obrigado,", + "The Boostnote Team": "A Equipa de do Boostnote", + "Support via OpenCollective": "Suporte via OpenCollective", + "Language": "Idioma", + "English": "Inglês", + "German": "Alemão", + "French": "Francês", + "Show \"Saved to Clipboard\" notification when copying": "Mostrar a notificação \"Guardado na Área de Transferência\" ao copiar", + "All Notes": "Todas as Notas", + "Starred": "Com Estrela", + "Are you sure to ": "Tens a certeza que gostarias de ", + " delete": " apagar", + "this folder?": "esta pasta?", + "Confirm": "Confirmar", + "Cancel": "Cancelar", + "Markdown Note": "Nota em Markdown", + "This format is for creating text documents. Checklists, code blocks and Latex blocks are available.": "Este formato permite a criação de documentos de texto. Estão disponíveis: listas de verificação, blocos de código e blocos Latex.", + "Snippet Note": "Fragmento de Nota", + "This format is for creating code snippets. Multiple snippets can be grouped into a single note.": "Este formato permite a criação de fragmentos de notas. Vários fragmentos podem ser agrupados em uma única nota.", + "Tab to switch format": "Tab para mudar o formato", + "Updated": "Actualizado", + "Created": "Criado", + "Alphabetically": "Alfabeticamente", + "Default View": "Vista Padrão", + "Compressed View": "Vista Comprimida", + "Search": "Procurar", + "Blog Type": "Tipo de Blog", + "Blog Address": "Endereço do Blog", + "Save": "Guardar", + "Auth": "Autenticação", + "Authentication Method": "Método de Autenticação", "JWT": "JWT", "USER": "USER", "Token": "Token", - "Storage": "Storage", - "Hotkeys": "Hotkeys", - "Show/Hide Boostnote": "Show/Hide Boostnote", - "Restore": "Restore", - "Permanent Delete": "Permanent Delete", - "Confirm note deletion": "Confirm note deletion", - "This will permanently remove this note.": "This will permanently remove this note.", - "Successfully applied!": "Successfully applied!", - "Albanian": "Albanian", - "Chinese (zh-CN)": "Chinese (zh-CN)", - "Chinese (zh-TW)": "Chinese (zh-TW)", - "Danish": "Danish", - "Japanese": "Japanese", - "Korean": "Korean", - "Norwegian": "Norwegian", - "Polish": "Polish", - "Portuguese": "Portuguese", - "Spanish": "Spanish", - "Unsaved Changes!": "Unsaved Changes!", - "Russian": "Russian", - "Editor Rulers": "Editor Rulers", - "Enable": "Enable", - "Disable": "Disable", - "Sanitization": "Sanitization", - "Only allow secure html tags (recommended)": "Only allow secure html tags (recommended)", - "Allow styles": "Allow styles", - "Allow dangerous html tags": "Allow dangerous html tags", - "Convert textual arrows to beautiful signs. ⚠ This will interfere with using HTML comments in your Markdown.": "Convert textual arrows to beautiful signs. ⚠ This will interfere with using HTML comments in your Markdown.", - "⚠ You have pasted a link referring an attachment that could not be found in the storage location of this note. Pasting links referring attachments is only supported if the source and destination location is the same storage. Please Drag&Drop the attachment instead! ⚠": "⚠ You have pasted a link referring an attachment that could not be found in the storage location of this note. Pasting links referring attachments is only supported if the source and destination location is the same storage. Please Drag&Drop the attachment instead! ⚠" + "Storage": "Armazenamento", + "Hotkeys": "Teclas de Atalho", + "Show/Hide Boostnote": "Mostrar/Esconder Boostnote", + "Restore": "Restaurar", + "Permanent Delete": "Apagar Permanentemente", + "Confirm note deletion": "Confirmar o apagamento da nota", + "This will permanently remove this note.": "Isto irá remover permanentemente esta nota.", + "Successfully applied!": "Aplicado com Sucesso!", + "Albanian": "Albanês", + "Chinese (zh-CN)": "Chinês (zh-CN)", + "Chinese (zh-TW)": "Chinês (zh-TW)", + "Danish": "Dinamarquês", + "Japanese": "Japonês", + "Korean": "Coreano", + "Norwegian": "Norueguês", + "Polish": "Polaco", + "Portuguese": "Português (pt-PT)", + "Spanish": "Espanhol", + "Unsaved Changes!": "Alterações Não Guardadas!", + "Russian": "Russo", + "Editor Rulers": "Réguas do Editor", + "Enable": "Activar", + "Disable": "Desactivar", + "Sanitization": "Sanitização", + "Only allow secure html tags (recommended)": "Perminar somente tags html seguras (recomendado)", + "Allow styles": "Permitir Estilos", + "Allow dangerous html tags": "Permitir tags html perigosas", + "Convert textual arrows to beautiful signs. ⚠ This will interfere with using HTML comments in your Markdown.": "Converter setas de texto em simbolos. ⚠ Isto irá interferir no use de comentários em HTML em Markdown.", + "⚠ You have pasted a link referring an attachment that could not be found in the storage location of this note. Pasting links referring attachments is only supported if the source and destination location is the same storage. Please Drag&Drop the attachment instead! ⚠": "⚠ Você colou um link referente a um anexo que não pôde ser encontrado no local de armazenamento desta nota. A vinculação de anexos de referência de links só é suportada se o local de origem e de destino for o mesmo de armazenamento. Por favor, arraste e solte o anexo na nota! ⚠" } From f18e8c5a3836b49fcd5820c19d8e8df054d4bbc2 Mon Sep 17 00:00:00 2001 From: FabioRosado Date: Fri, 26 Oct 2018 17:25:38 +0100 Subject: [PATCH 04/22] Fix typo, change for suggested term --- locales/pt-PT.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locales/pt-PT.json b/locales/pt-PT.json index dcd5b49c..94f84a97 100644 --- a/locales/pt-PT.json +++ b/locales/pt-PT.json @@ -5,7 +5,7 @@ "Make a note": "Criar nota", "Ctrl": "Ctrl", "Ctrl(^)": "Ctrl", - "to create a new note": "para creat uma nova nota", + "to create a new note": "para criar uma nova nota", "Toggle Mode": "Alternar Modo", "Trash": "Lixo", "MODIFICATION DATE": "DATA DE MODIFICAÇÃO", @@ -14,7 +14,7 @@ "STORAGE": "ARMAZENAMENTO", "FOLDER": "PASTA", "CREATION DATE": "DATA DE CRIAÇÃO", - "NOTE LINK": "LINK DE NOTA", + "NOTE LINK": "ATALHO DE NOTA", ".md": ".md", ".txt": ".txt", ".html": ".html", @@ -24,7 +24,7 @@ "Add Storage Location": "Adicionar Local de Armazenamento", "Add Folder": "Adicionar Pasta", "Open Storage folder": "Abrir Local de Armazenamento", - "Unlink": "Unlink", + "Unlink": "Remover a ligação", "Edit": "Editar", "Delete": "Apagar", "Interface": "Interface", @@ -90,7 +90,7 @@ "we would like to invest more time and resources in this project.": "gostaríamos de investir mais tempo e recursos neste projeto.", "If you use Boostnote and see its potential, help us out by supporting the project on OpenCollective!": "Se gostas deste projeto e vês o seu potencial, podes ajudar-nos através de donativos no OpenCollective!", "Thanks,": "Obrigado,", - "The Boostnote Team": "A Equipa de do Boostnote", + "The Boostnote Team": "A Equipa do Boostnote", "Support via OpenCollective": "Suporte via OpenCollective", "Language": "Idioma", "English": "Inglês", From 07aa775de173d62915187ee280d7595872e24239 Mon Sep 17 00:00:00 2001 From: JianXu Date: Mon, 5 Nov 2018 00:39:27 +0800 Subject: [PATCH 05/22] Add vscode debug support --- .vscode/launch.json | 41 +++++++++++++++++++++++++++++++++++++++++ .vscode/tasks.json | 27 +++++++++++++++++++++++++++ package.json | 3 ++- webpack.config.js | 9 ++++++++- 4 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..a742a59e --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,41 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + + { + "type": "node", + "request": "launch", + "name": "BoostNote Main", + "protocol": "inspector", + "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron", + "runtimeArgs": [ + "--remote-debugging-port=9223", + "--hot", + "${workspaceFolder}/index.js" + ], + "windows": { + "runtimeExecutable": "${workspaceFolder}/node_modeules/.bin/electron.cmd" + } + }, + { + "type": "chrome", + "request": "attach", + "name": "BoostNote Renderer", + "port": 9223, + "webRoot": "${workspaceFolder}", + "sourceMapPathOverrides": { + "webpack:///./~/*": "${webRoot}/node_modules/*", + "webpack:///*": "${webRoot}/*" + } + } + ], + "compounds": [ + { + "name": "BostNote All", + "configurations": ["BoostNote Main", "BoostNote Renderer"] + } + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000..c6664225 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,27 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "Build Boostnote", + "group": "build", + "type": "npm", + "script": "watch", + "isBackground": true, + "presentation": { + "reveal": "always", + }, + "problemMatcher": { + "pattern":[ + { + "regexp": "^([^\\\\s].*)\\\\((\\\\d+,\\\\d+)\\\\):\\\\s*(.*)$", + "file": 1, + "location": 2, + "message": 3 + } + ] + } + } + ] +} \ No newline at end of file diff --git a/package.json b/package.json index e9ef0de0..a26e625e 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "jest": "jest", "fix": "eslint . --fix", "lint": "eslint .", - "dev": "node dev-scripts/dev.js" + "dev": "node dev-scripts/dev.js", + "watch": "webpack-dev-server --hot" }, "config": { "electron-version": "2.0.7" diff --git a/webpack.config.js b/webpack.config.js index 16b7fd73..6a05f231 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -28,7 +28,14 @@ var config = Object.assign({}, skeleton, { publicPath: 'http://localhost:8080/assets/' }, debug: true, - devtool: 'cheap-module-eval-source-map' + devtool: 'cheap-module-eval-source-map', + devServer: { + port: 8080, + hot: true, + inline: true, + quiet: true, + publicPath: 'http://localhost:8080/assets/' + } }) module.exports = config From fd2b438c67afd4e5d0544333c0868167abb45ec6 Mon Sep 17 00:00:00 2001 From: Arcturus Date: Wed, 7 Nov 2018 13:58:47 +0000 Subject: [PATCH 06/22] add language support for european portuguese --- browser/lib/Languages.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/browser/lib/Languages.js b/browser/lib/Languages.js index 1a798fdf..8c3747a9 100644 --- a/browser/lib/Languages.js +++ b/browser/lib/Languages.js @@ -48,9 +48,13 @@ const languages = [ locale: 'pl' }, { - name: 'Portuguese', + name: 'Portuguese (PT-BR)', locale: 'pt-BR' }, + { + name: 'Portuguese (PT-PT)', + locale: 'pt-PT' + }, { name: 'Russian', locale: 'ru' From e30727ab272ecc4832d630dd43ffbd9e19e0cc98 Mon Sep 17 00:00:00 2001 From: JianXu Date: Thu, 8 Nov 2018 13:47:34 +0800 Subject: [PATCH 07/22] Add detail mode support for vscode debug --- webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index 6a05f231..ad3c4f8b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -33,7 +33,7 @@ var config = Object.assign({}, skeleton, { port: 8080, hot: true, inline: true, - quiet: true, + quiet: false, publicPath: 'http://localhost:8080/assets/' } }) From 48c29dd7d9e645d29ee40bb4161427f56baf5c87 Mon Sep 17 00:00:00 2001 From: Baptiste Augrain Date: Thu, 8 Nov 2018 10:01:16 +0100 Subject: [PATCH 08/22] fix turndown --- browser/components/CodeEditor.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/browser/components/CodeEditor.js b/browser/components/CodeEditor.js index 41d71622..b4d10cb3 100644 --- a/browser/components/CodeEditor.js +++ b/browser/components/CodeEditor.js @@ -63,6 +63,8 @@ export default class CodeEditor extends React.Component { this.formatTable = () => this.handleFormatTable() this.editorActivityHandler = () => this.handleEditorActivity() + + this.turndownService = new TurndownService() } handleSearch (msg) { @@ -550,6 +552,7 @@ export default class CodeEditor extends React.Component { } const pastedHtml = clipboardData.getData('text/html') + console.log(pastedHtml) if (pastedHtml !== '') { this.handlePasteHtml(e, editor, pastedHtml) } else if (dataTransferItem.type.match('image')) { From 1e3cf6f37423d79e51a77173daed8a1290c14c8a Mon Sep 17 00:00:00 2001 From: Baptiste Augrain Date: Thu, 8 Nov 2018 10:10:45 +0100 Subject: [PATCH 09/22] remove console.log --- browser/components/CodeEditor.js | 1 - 1 file changed, 1 deletion(-) diff --git a/browser/components/CodeEditor.js b/browser/components/CodeEditor.js index b4d10cb3..a1c74c73 100644 --- a/browser/components/CodeEditor.js +++ b/browser/components/CodeEditor.js @@ -552,7 +552,6 @@ export default class CodeEditor extends React.Component { } const pastedHtml = clipboardData.getData('text/html') - console.log(pastedHtml) if (pastedHtml !== '') { this.handlePasteHtml(e, editor, pastedHtml) } else if (dataTransferItem.type.match('image')) { From 2a774d20f4652512d31f7e444445967ad9aa39dc Mon Sep 17 00:00:00 2001 From: Arcturus Date: Fri, 9 Nov 2018 12:21:00 +0000 Subject: [PATCH 10/22] fix issue 2530 --- browser/components/MarkdownEditor.js | 8 ++++---- browser/components/MarkdownSplitEditor.js | 10 +++++----- tests/lib/get-todo-status-test.js | 13 ++++++++++++- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/browser/components/MarkdownEditor.js b/browser/components/MarkdownEditor.js index 9c8a06d6..519e92f2 100644 --- a/browser/components/MarkdownEditor.js +++ b/browser/components/MarkdownEditor.js @@ -147,8 +147,8 @@ class MarkdownEditor extends React.Component { e.preventDefault() e.stopPropagation() const idMatch = /checkbox-([0-9]+)/ - const checkedMatch = /\[x\]/i - const uncheckedMatch = /\[ \]/ + const checkedMatch = /^\s*[\+\-\*] \[x\]/i + const uncheckedMatch = /^\s*[\+\-\*] \[ \]/ if (idMatch.test(e.target.getAttribute('id'))) { const lineIndex = parseInt(e.target.getAttribute('id').match(idMatch)[1], 10) - 1 const lines = this.refs.code.value @@ -157,10 +157,10 @@ class MarkdownEditor extends React.Component { const targetLine = lines[lineIndex] if (targetLine.match(checkedMatch)) { - lines[lineIndex] = targetLine.replace(checkedMatch, '[ ]') + lines[lineIndex] = targetLine.replace(checkedMatch, '- [ ]') } if (targetLine.match(uncheckedMatch)) { - lines[lineIndex] = targetLine.replace(uncheckedMatch, '[x]') + lines[lineIndex] = targetLine.replace(uncheckedMatch, '- [x]') } this.refs.code.setValue(lines.join('\n')) } diff --git a/browser/components/MarkdownSplitEditor.js b/browser/components/MarkdownSplitEditor.js index ca2d3108..22ccca56 100644 --- a/browser/components/MarkdownSplitEditor.js +++ b/browser/components/MarkdownSplitEditor.js @@ -77,9 +77,9 @@ class MarkdownSplitEditor extends React.Component { handleCheckboxClick (e) { e.preventDefault() e.stopPropagation() - const idMatch = /checkbox-([0-9]+)/ - const checkedMatch = /\[x\]/i - const uncheckedMatch = /\[ \]/ + const idMatch = /checkbox-([0-9]+)/ + const checkedMatch = /^\s*[\+\-\*] \[x\]/i + const uncheckedMatch = /^\s*[\+\-\*] \[ \]/ if (idMatch.test(e.target.getAttribute('id'))) { const lineIndex = parseInt(e.target.getAttribute('id').match(idMatch)[1], 10) - 1 const lines = this.refs.code.value @@ -88,10 +88,10 @@ class MarkdownSplitEditor extends React.Component { const targetLine = lines[lineIndex] if (targetLine.match(checkedMatch)) { - lines[lineIndex] = targetLine.replace(checkedMatch, '[ ]') + lines[lineIndex] = targetLine.replace(checkedMatch, '- [ ]') } if (targetLine.match(uncheckedMatch)) { - lines[lineIndex] = targetLine.replace(uncheckedMatch, '[x]') + lines[lineIndex] = targetLine.replace(uncheckedMatch, '- [x]') } this.refs.code.setValue(lines.join('\n')) } diff --git a/tests/lib/get-todo-status-test.js b/tests/lib/get-todo-status-test.js index ea07c03e..e00d7918 100644 --- a/tests/lib/get-todo-status-test.js +++ b/tests/lib/get-todo-status-test.js @@ -17,7 +17,18 @@ test('getTodoStatus should return a correct hash object', t => { ['+ [ ] a\n+ [xtest] a\n', { total: 1, completed: 0 }], ['+ [ ] a\n+ foo[x]bar a\n', { total: 1, completed: 0 }], ['+ [ ] a\n+ foo[x] bar a\n', { total: 1, completed: 0 }], - ['+ [ ] a\n+ foo [x]bar a\n', { total: 1, completed: 0 }] + ['+ [ ] a\n+ foo [x]bar a\n', { total: 1, completed: 0 }], + ['* [ ] `- [ ] a`\n', { total: 1, completed: 0 }], + ['+ [ ] `- [ ] a`\n', { total: 1, completed: 0 }], + ['- [ ] `- [ ] a`\n', { total: 1, completed: 0 }], + ['- [ ] `- [x] a`\n', { total: 1, completed: 0 }], + ['- [ ] `- [X] a`\n', { total: 1, completed: 0 }], + ['- [x] `- [ ] a`\n', { total: 1, completed: 1 }], + ['- [X] `- [ ] a`\n', { total: 1, completed: 1 }], + ['- [x] `- [x] a`\n', { total: 1, completed: 1 }], + ['- [X] `- [X] a`\n', { total: 1, completed: 1 }], + [' \t - [X] `- [X] a`\n', { total: 1, completed: 1 }], + [' \t - [X] `- [X] a`\n \t - [ ] `- [X] a`\n', { total: 2, completed: 1 }], ] testCases.forEach(testCase => { From 4a197a5c904e42762bd45fa82eb337611518b742 Mon Sep 17 00:00:00 2001 From: Arcturus Date: Fri, 9 Nov 2018 13:37:17 +0000 Subject: [PATCH 11/22] add confirmation dialog --- browser/main/SideNav/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/browser/main/SideNav/index.js b/browser/main/SideNav/index.js index 3e18095e..f1cd49f2 100644 --- a/browser/main/SideNav/index.js +++ b/browser/main/SideNav/index.js @@ -19,6 +19,7 @@ import {SortableContainer} from 'react-sortable-hoc' import i18n from 'browser/lib/i18n' import context from 'browser/lib/context' import { remote } from 'electron' +import { confirmDeleteNote } from 'browser/lib/confirmDeleteNote' function matchActiveTags (tags, activeTags) { return _.every(activeTags, v => tags.indexOf(v) >= 0) @@ -309,6 +310,8 @@ class SideNav extends React.Component { const deletionPromises = entries.map((note) => { return dataApi.deleteNote(note.storage, note.key) }) + const { confirmDeletion } = this.props.config.ui + if (!confirmDeleteNote(confirmDeletion, true)) return Promise.all(deletionPromises) .then((arrayOfStorageAndNoteKeys) => { arrayOfStorageAndNoteKeys.forEach(({ storageKey, noteKey }) => { From fa265d769cef38d7b032fbe155707d34a6c9239a Mon Sep 17 00:00:00 2001 From: Arcturus Date: Fri, 9 Nov 2018 13:40:45 +0000 Subject: [PATCH 12/22] fix multiple spaces issue --- browser/components/MarkdownSplitEditor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/browser/components/MarkdownSplitEditor.js b/browser/components/MarkdownSplitEditor.js index 22ccca56..4a08bf12 100644 --- a/browser/components/MarkdownSplitEditor.js +++ b/browser/components/MarkdownSplitEditor.js @@ -77,8 +77,8 @@ class MarkdownSplitEditor extends React.Component { handleCheckboxClick (e) { e.preventDefault() e.stopPropagation() - const idMatch = /checkbox-([0-9]+)/ - const checkedMatch = /^\s*[\+\-\*] \[x\]/i + const idMatch = /checkbox-([0-9]+)/ + const checkedMatch = /^\s*[\+\-\*] \[x\]/i const uncheckedMatch = /^\s*[\+\-\*] \[ \]/ if (idMatch.test(e.target.getAttribute('id'))) { const lineIndex = parseInt(e.target.getAttribute('id').match(idMatch)[1], 10) - 1 From 480c05650bee74fbe4d9e1a2d81ec783c082c355 Mon Sep 17 00:00:00 2001 From: Arcturus Date: Fri, 9 Nov 2018 13:58:54 +0000 Subject: [PATCH 13/22] fix linting issues --- browser/components/MarkdownEditor.js | 2 +- tests/lib/get-todo-status-test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/browser/components/MarkdownEditor.js b/browser/components/MarkdownEditor.js index 519e92f2..f3bb92bb 100644 --- a/browser/components/MarkdownEditor.js +++ b/browser/components/MarkdownEditor.js @@ -147,7 +147,7 @@ class MarkdownEditor extends React.Component { e.preventDefault() e.stopPropagation() const idMatch = /checkbox-([0-9]+)/ - const checkedMatch = /^\s*[\+\-\*] \[x\]/i + const checkedMatch = /^\s*[\+\-\*] \[x\]/i const uncheckedMatch = /^\s*[\+\-\*] \[ \]/ if (idMatch.test(e.target.getAttribute('id'))) { const lineIndex = parseInt(e.target.getAttribute('id').match(idMatch)[1], 10) - 1 diff --git a/tests/lib/get-todo-status-test.js b/tests/lib/get-todo-status-test.js index e00d7918..4e117aed 100644 --- a/tests/lib/get-todo-status-test.js +++ b/tests/lib/get-todo-status-test.js @@ -28,7 +28,7 @@ test('getTodoStatus should return a correct hash object', t => { ['- [x] `- [x] a`\n', { total: 1, completed: 1 }], ['- [X] `- [X] a`\n', { total: 1, completed: 1 }], [' \t - [X] `- [X] a`\n', { total: 1, completed: 1 }], - [' \t - [X] `- [X] a`\n \t - [ ] `- [X] a`\n', { total: 2, completed: 1 }], + [' \t - [X] `- [X] a`\n \t - [ ] `- [X] a`\n', { total: 2, completed: 1 }] ] testCases.forEach(testCase => { From 637225c2bc6b96e4eb1cea3ccb7119e3bd656ba8 Mon Sep 17 00:00:00 2001 From: Baptiste Augrain Date: Sat, 10 Nov 2018 11:18:44 +0100 Subject: [PATCH 14/22] fix cursor position after expending snippet --- browser/components/CodeEditor.js | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/browser/components/CodeEditor.js b/browser/components/CodeEditor.js index a1c74c73..22a08aae 100644 --- a/browser/components/CodeEditor.js +++ b/browser/components/CodeEditor.js @@ -317,22 +317,28 @@ export default class CodeEditor extends React.Component { const snippetLines = snippets[i].content.split('\n') let cursorLineNumber = 0 let cursorLinePosition = 0 + + let cursorIndex for (let j = 0; j < snippetLines.length; j++) { - const cursorIndex = snippetLines[j].indexOf(templateCursorString) + cursorIndex = snippetLines[j].indexOf(templateCursorString) + if (cursorIndex !== -1) { cursorLineNumber = j cursorLinePosition = cursorIndex - cm.replaceRange( - snippets[i].content.replace(templateCursorString, ''), - wordBeforeCursor.range.from, - wordBeforeCursor.range.to - ) - cm.setCursor({ - line: cursor.line + cursorLineNumber, - ch: cursorLinePosition - }) + + break } } + + cm.replaceRange( + snippets[i].content.replace(templateCursorString, ''), + wordBeforeCursor.range.from, + wordBeforeCursor.range.to + ) + cm.setCursor({ + line: cursor.line + cursorLineNumber, + ch: cursorLinePosition + cursor.ch - wordBeforeCursor.text.length + }) } else { cm.replaceRange( snippets[i].content, From 3df743f47bc783af177624a24e7ec75b3cd7557d Mon Sep 17 00:00:00 2001 From: richardtks Date: Sat, 10 Nov 2018 19:17:11 +0800 Subject: [PATCH 15/22] Change the selection behavior to the default behavior There are two behaviors being changed: 1. When user click on the notes a. Shift - It will select the notes among the first and the last note b. Ctrl - it will only select the selected note 2. When user uses the arrow keys a. Shift - it will extends the selection from the last selected note b. Ctrl - Nothing will happens --- browser/main/NoteList/index.js | 44 ++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/browser/main/NoteList/index.js b/browser/main/NoteList/index.js index 30ad93c3..77a8384e 100644 --- a/browser/main/NoteList/index.js +++ b/browser/main/NoteList/index.js @@ -84,7 +84,9 @@ class NoteList extends React.Component { // TODO: not Selected noteKeys but SelectedNote(for reusing) this.state = { + ctrlKeyDown: false, shiftKeyDown: false, + firstShiftSelectedNoteIndex: -1, selectedNoteKeys: [] } @@ -267,7 +269,7 @@ class NoteList extends React.Component { } handleNoteListKeyDown (e) { - if (e.metaKey || e.ctrlKey) return true + if (e.metaKey) return true // A key if (e.keyCode === 65 && !e.shiftKey) { @@ -307,6 +309,8 @@ class NoteList extends React.Component { if (e.shiftKey) { this.setState({ shiftKeyDown: true }) + } else if (e.ctrlKey) { + this.setState({ ctrlKeyDown: true }) } } @@ -314,6 +318,10 @@ class NoteList extends React.Component { if (!e.shiftKey) { this.setState({ shiftKeyDown: false }) } + + if (!e.ctrlKey) { + this.setState({ ctrlKeyDown: false }) + } } getNotes () { @@ -390,25 +398,51 @@ class NoteList extends React.Component { return pinnedNotes.concat(unpinnedNotes) } + getNoteIndexByKey (noteKey) { + return this.notes.findIndex((note) => { + if (!note) return -1 + + return note.key === noteKey + }) + } + handleNoteClick (e, uniqueKey) { const { router } = this.context const { location } = this.props let { selectedNoteKeys } = this.state - const { shiftKeyDown } = this.state + const { ctrlKeyDown, shiftKeyDown } = this.state + let firstShiftSelectedNoteIndex = -1 - if (shiftKeyDown && selectedNoteKeys.includes(uniqueKey)) { + if (ctrlKeyDown && selectedNoteKeys.includes(uniqueKey)) { const newSelectedNoteKeys = selectedNoteKeys.filter((noteKey) => noteKey !== uniqueKey) this.setState({ selectedNoteKeys: newSelectedNoteKeys }) return } - if (!shiftKeyDown) { + if (!ctrlKeyDown && !shiftKeyDown) { selectedNoteKeys = [] } selectedNoteKeys.push(uniqueKey) + + if (shiftKeyDown && selectedNoteKeys.length > 0) { + const firstSelectedNoteIndex = + Math.max(this.getNoteIndexByKey(selectedNoteKeys[0]), + this.state.firstShiftSelectedNoteIndex) + const lastSelectedNoteIndex = this.getNoteIndexByKey(uniqueKey) + const startIndex = Math.min(firstSelectedNoteIndex, lastSelectedNoteIndex) + const endIndex = Math.max(firstSelectedNoteIndex, lastSelectedNoteIndex) + selectedNoteKeys = [] + for (let i = startIndex; i <= endIndex; i++) { + selectedNoteKeys.push(this.notes[i].key) + } + + firstShiftSelectedNoteIndex = firstSelectedNoteIndex + } + this.setState({ - selectedNoteKeys + selectedNoteKeys, + firstShiftSelectedNoteIndex }) router.push({ From f1ca06daf5fc2447abe031fbfda6617586686832 Mon Sep 17 00:00:00 2001 From: Baptiste Augrain Date: Sat, 10 Nov 2018 12:33:07 +0100 Subject: [PATCH 16/22] fold markdown's headings --- lib/main.html | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/main.html b/lib/main.html index 64add406..c47da9e4 100644 --- a/lib/main.html +++ b/lib/main.html @@ -117,6 +117,7 @@ + From ad7b155a995f7afcd4bb56d0b164106e956a7bfd Mon Sep 17 00:00:00 2001 From: richardtks Date: Sat, 10 Nov 2018 19:39:44 +0800 Subject: [PATCH 17/22] Updated the condition with more appropriate naming --- 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 77a8384e..2ad529e2 100644 --- a/browser/main/NoteList/index.js +++ b/browser/main/NoteList/index.js @@ -412,6 +412,7 @@ class NoteList extends React.Component { let { selectedNoteKeys } = this.state const { ctrlKeyDown, shiftKeyDown } = this.state let firstShiftSelectedNoteIndex = -1 + const hasSelectedNoteKey = selectedNoteKeys.length > 0 if (ctrlKeyDown && selectedNoteKeys.includes(uniqueKey)) { const newSelectedNoteKeys = selectedNoteKeys.filter((noteKey) => noteKey !== uniqueKey) @@ -425,7 +426,7 @@ class NoteList extends React.Component { } selectedNoteKeys.push(uniqueKey) - if (shiftKeyDown && selectedNoteKeys.length > 0) { + if (shiftKeyDown && hasSelectedNoteKey) { const firstSelectedNoteIndex = Math.max(this.getNoteIndexByKey(selectedNoteKeys[0]), this.state.firstShiftSelectedNoteIndex) From aa56aad46e8a5c573236dc6ed17fedb736d84ea5 Mon Sep 17 00:00:00 2001 From: richardtks Date: Sat, 10 Nov 2018 20:29:24 +0800 Subject: [PATCH 18/22] Improvement on the code The improvement was suggested by github --- browser/main/NoteList/index.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/browser/main/NoteList/index.js b/browser/main/NoteList/index.js index 2ad529e2..af89f878 100644 --- a/browser/main/NoteList/index.js +++ b/browser/main/NoteList/index.js @@ -427,12 +427,14 @@ class NoteList extends React.Component { selectedNoteKeys.push(uniqueKey) if (shiftKeyDown && hasSelectedNoteKey) { - const firstSelectedNoteIndex = - Math.max(this.getNoteIndexByKey(selectedNoteKeys[0]), - this.state.firstShiftSelectedNoteIndex) + const firstSelectedNoteIndex = selectedNoteKeys[0] > this.state.firstShiftSelectedNoteIndex + ? selectedNoteKeys[0] : this.state.firstShiftSelectedNoteIndex const lastSelectedNoteIndex = this.getNoteIndexByKey(uniqueKey) - const startIndex = Math.min(firstSelectedNoteIndex, lastSelectedNoteIndex) - const endIndex = Math.max(firstSelectedNoteIndex, lastSelectedNoteIndex) + const startIndex = firstSelectedNoteIndex < lastSelectedNoteIndex + ? firstSelectedNoteIndex : lastSelectedNoteIndex + const endIndex = firstSelectedNoteIndex > lastSelectedNoteIndex + ? firstSelectedNoteIndex : lastSelectedNoteIndex + selectedNoteKeys = [] for (let i = startIndex; i <= endIndex; i++) { selectedNoteKeys.push(this.notes[i].key) From 82987cd53cb93b6632a2f3349a6bd4a2e4cd7b48 Mon Sep 17 00:00:00 2001 From: richardtks Date: Sat, 10 Nov 2018 21:23:56 +0800 Subject: [PATCH 19/22] Fix the variable name to more appropriate one --- browser/main/NoteList/index.js | 35 ++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/browser/main/NoteList/index.js b/browser/main/NoteList/index.js index af89f878..7219a27f 100644 --- a/browser/main/NoteList/index.js +++ b/browser/main/NoteList/index.js @@ -86,7 +86,7 @@ class NoteList extends React.Component { this.state = { ctrlKeyDown: false, shiftKeyDown: false, - firstShiftSelectedNoteIndex: -1, + prevShiftNoteIndex: -1, selectedNoteKeys: [] } @@ -409,9 +409,8 @@ class NoteList extends React.Component { handleNoteClick (e, uniqueKey) { const { router } = this.context const { location } = this.props - let { selectedNoteKeys } = this.state + let { selectedNoteKeys, prevShiftNoteIndex } = this.state const { ctrlKeyDown, shiftKeyDown } = this.state - let firstShiftSelectedNoteIndex = -1 const hasSelectedNoteKey = selectedNoteKeys.length > 0 if (ctrlKeyDown && selectedNoteKeys.includes(uniqueKey)) { @@ -424,28 +423,40 @@ class NoteList extends React.Component { if (!ctrlKeyDown && !shiftKeyDown) { selectedNoteKeys = [] } + + if (!shiftKeyDown) { + prevShiftNoteIndex = -1 + } + selectedNoteKeys.push(uniqueKey) if (shiftKeyDown && hasSelectedNoteKey) { - const firstSelectedNoteIndex = selectedNoteKeys[0] > this.state.firstShiftSelectedNoteIndex - ? selectedNoteKeys[0] : this.state.firstShiftSelectedNoteIndex - const lastSelectedNoteIndex = this.getNoteIndexByKey(uniqueKey) - const startIndex = firstSelectedNoteIndex < lastSelectedNoteIndex - ? firstSelectedNoteIndex : lastSelectedNoteIndex - const endIndex = firstSelectedNoteIndex > lastSelectedNoteIndex - ? firstSelectedNoteIndex : lastSelectedNoteIndex + let firstShiftNoteIndex = this.getNoteIndexByKey(selectedNoteKeys[0]) + // Shift selection can either start from first note in the exisiting selectedNoteKeys + // or previous first shift note index + firstShiftNoteIndex = firstShiftNoteIndex > prevShiftNoteIndex + ? firstShiftNoteIndex : prevShiftNoteIndex + + const lastShiftNoteIndex = this.getNoteIndexByKey(uniqueKey) + + const startIndex = firstShiftNoteIndex < lastShiftNoteIndex + ? firstShiftNoteIndex : lastShiftNoteIndex + const endIndex = firstShiftNoteIndex > lastShiftNoteIndex + ? firstShiftNoteIndex : lastShiftNoteIndex selectedNoteKeys = [] for (let i = startIndex; i <= endIndex; i++) { selectedNoteKeys.push(this.notes[i].key) } - firstShiftSelectedNoteIndex = firstSelectedNoteIndex + if (prevShiftNoteIndex < 0) { + prevShiftNoteIndex = firstShiftNoteIndex + } } this.setState({ selectedNoteKeys, - firstShiftSelectedNoteIndex + prevShiftNoteIndex }) router.push({ From 3864d73d1a400ef29dbe98b0101ad221c2abfb1c Mon Sep 17 00:00:00 2001 From: JianXu Date: Sun, 11 Nov 2018 14:49:48 +0800 Subject: [PATCH 20/22] Add vscode debug support doc --- docs/debug.md | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/docs/debug.md b/docs/debug.md index 78a71137..390dc5d3 100644 --- a/docs/debug.md +++ b/docs/debug.md @@ -1,22 +1,36 @@ -# How to debug Boostnote (Electron app) -This page is also available in [Japanese](https://github.com/BoostIO/Boostnote/blob/master/docs/jp/debug.md), [Korean](https://github.com/BoostIO/Boostnote/blob/master/docs/ko/debug.md), [Russain](https://github.com/BoostIO/Boostnote/blob/master/docs/ru/debug.md), [Simplified Chinese](https://github.com/BoostIO/Boostnote/blob/master/docs/zh_CN/debug.md), [French](https://github.com/BoostIO/Boostnote/blob/master/docs/fr/debug.md) and [German](https://github.com/BoostIO/Boostnote/blob/master/docs/de/debug.md). +# How to debug BoostNote (Electron app) +This page is also available in [Japanese](#)(https://github.com/BoostIO/Boostnote/blob/master/docs/jp/debug.md), [Korean](#)(https://github.com/BoostIO/Boostnote/blob/master/docs/ko/debug.md), [Russain](#)(https://github.com/BoostIO/Boostnote/blob/master/docs/ru/debug.md), [Simplified Chinese](#)(https://github.com/BoostIO/Boostnote/blob/master/docs/zh_CN/debug.md), [French](#)(https://github.com/BoostIO/Boostnote/blob/master/docs/fr/debug.md) and [German](#)(https://github.com/BoostIO/Boostnote/blob/master/docs/de/debug.md). + +## Debug with Google Chrome developer Tools Boostnote is an Electron app so it's based on Chromium; developers can use `Developer Tools` just like Google Chrome. You can toggle the `Developer Tools` like this: -![how_to_toggle_devTools](https://cloud.githubusercontent.com/assets/11307908/24343585/162187e2-127c-11e7-9c01-23578db03ecf.png) +![how_to_toggle_devTools](#)(https://cloud.githubusercontent.com/assets/11307908/24343585/162187e2-127c-11e7-9c01-23578db03ecf.png) The `Developer Tools` will look like this: -![Developer_Tools](https://cloud.githubusercontent.com/assets/11307908/24343545/eff9f3a6-127b-11e7-94cf-cb67bfda634a.png) +![Developer_Tools](#)(https://cloud.githubusercontent.com/assets/11307908/24343545/eff9f3a6-127b-11e7-94cf-cb67bfda634a.png) When errors occur, the error messages are displayed at the `console`. -## Debugging +### Debugging For example, you can use the `debugger` to set a breakpoint in the code like this: -![debugger](https://cloud.githubusercontent.com/assets/11307908/24343879/9459efea-127d-11e7-9943-f60bf7f66d4a.png) +![debugger](#)(https://cloud.githubusercontent.com/assets/11307908/24343879/9459efea-127d-11e7-9943-f60bf7f66d4a.png) This is just an illustrative example, you should find a way to debug which fits your style. -## References +### References * [Official document of Google Chrome about debugging](https://developer.chrome.com/devtools) + +## Debug with Visual Studio Code + +1. Install **[Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome "Install Debugger for Chrome")** plugin for Visual Studio Code. Then restart it. +2. Pressing **Shift+Command+B** or running ** Run Build Task** from the global **Terminal** menu, then pick the task named **Build Boostnote**. +3. When above task is running, open **Debug view** in **Activity Bar** on the side of VS Code or use shortcut **Shift+Command+D**. +4. Select the configuration named **Boostnote All** from the **Debug configuration**, then click the green arrow button or press **F5**. +5. Now you should find **Boostnote** is running. You will see two process is running, one named **Boostnote Main**,other named **Boostnote Renderer**. Now you can set **debug breakpoint** in vscode. If you find **breakpoints** is unverified, you need to switch process. + + ### References + * [Electron application debugging](https://electronjs.org/docs/tutorial/application-debugging) + * [Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome) \ No newline at end of file From d97bbe79185a584b8ab17c30e004aa85a784fe2d Mon Sep 17 00:00:00 2001 From: Baptiste Augrain Date: Sun, 11 Nov 2018 10:10:09 +0100 Subject: [PATCH 21/22] fix URI when selecting multiple tags --- browser/main/SideNav/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/browser/main/SideNav/index.js b/browser/main/SideNav/index.js index 3e18095e..636475b2 100644 --- a/browser/main/SideNav/index.js +++ b/browser/main/SideNav/index.js @@ -269,7 +269,7 @@ class SideNav extends React.Component { const tags = pathSegments[pathSegments.length - 1] return (tags === 'alltags') ? [] - : tags.split(' ').map(tag => decodeURIComponent(tag)) + : decodeURIComponent(tags).split(' ') } handleClickTagListItem (name) { @@ -301,7 +301,7 @@ class SideNav extends React.Component { } else { listOfTags.push(tag) } - router.push(`/tags/${listOfTags.map(tag => encodeURIComponent(tag)).join(' ')}`) + router.push(`/tags/${encodeURIComponent(listOfTags.join(' '))}`) } emptyTrash (entries) { From e100e080da2e7526dbdb8d3995936e31de9007a8 Mon Sep 17 00:00:00 2001 From: JianXu Date: Sun, 11 Nov 2018 21:19:38 +0800 Subject: [PATCH 22/22] fixed debug.md format error --- docs/debug.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/debug.md b/docs/debug.md index 390dc5d3..a84a6bba 100644 --- a/docs/debug.md +++ b/docs/debug.md @@ -1,22 +1,22 @@ -# How to debug BoostNote (Electron app) +# How to debug Boostnote (Electron app) -This page is also available in [Japanese](#)(https://github.com/BoostIO/Boostnote/blob/master/docs/jp/debug.md), [Korean](#)(https://github.com/BoostIO/Boostnote/blob/master/docs/ko/debug.md), [Russain](#)(https://github.com/BoostIO/Boostnote/blob/master/docs/ru/debug.md), [Simplified Chinese](#)(https://github.com/BoostIO/Boostnote/blob/master/docs/zh_CN/debug.md), [French](#)(https://github.com/BoostIO/Boostnote/blob/master/docs/fr/debug.md) and [German](#)(https://github.com/BoostIO/Boostnote/blob/master/docs/de/debug.md). +This page is also available in [Japanese](https://github.com/BoostIO/Boostnote/blob/master/docs/jp/debug.md), [Korean](https://github.com/BoostIO/Boostnote/blob/master/docs/ko/debug.md), [Russain](https://github.com/BoostIO/Boostnote/blob/master/docs/ru/debug.md), [Simplified Chinese](https://github.com/BoostIO/Boostnote/blob/master/docs/zh_CN/debug.md), [French](https://github.com/BoostIO/Boostnote/blob/master/docs/fr/debug.md) and [German](https://github.com/BoostIO/Boostnote/blob/master/docs/de/debug.md). ## Debug with Google Chrome developer Tools Boostnote is an Electron app so it's based on Chromium; developers can use `Developer Tools` just like Google Chrome. You can toggle the `Developer Tools` like this: -![how_to_toggle_devTools](#)(https://cloud.githubusercontent.com/assets/11307908/24343585/162187e2-127c-11e7-9c01-23578db03ecf.png) +![how_to_toggle_devTools](https://cloud.githubusercontent.com/assets/11307908/24343585/162187e2-127c-11e7-9c01-23578db03ecf.png) The `Developer Tools` will look like this: -![Developer_Tools](#)(https://cloud.githubusercontent.com/assets/11307908/24343545/eff9f3a6-127b-11e7-94cf-cb67bfda634a.png) +![Developer_Tools](https://cloud.githubusercontent.com/assets/11307908/24343545/eff9f3a6-127b-11e7-94cf-cb67bfda634a.png) When errors occur, the error messages are displayed at the `console`. ### Debugging For example, you can use the `debugger` to set a breakpoint in the code like this: -![debugger](#)(https://cloud.githubusercontent.com/assets/11307908/24343879/9459efea-127d-11e7-9943-f60bf7f66d4a.png) +![debugger](https://cloud.githubusercontent.com/assets/11307908/24343879/9459efea-127d-11e7-9943-f60bf7f66d4a.png) This is just an illustrative example, you should find a way to debug which fits your style. @@ -26,10 +26,10 @@ This is just an illustrative example, you should find a way to debug which fits ## Debug with Visual Studio Code 1. Install **[Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome "Install Debugger for Chrome")** plugin for Visual Studio Code. Then restart it. -2. Pressing **Shift+Command+B** or running ** Run Build Task** from the global **Terminal** menu, then pick the task named **Build Boostnote**. +2. Pressing **Shift+Command+B** or running **Run Build Task** from the global **Terminal** menu, then pick the task named **Build Boostnote**. Or run `yarn run watch` from the terminal. 3. When above task is running, open **Debug view** in **Activity Bar** on the side of VS Code or use shortcut **Shift+Command+D**. -4. Select the configuration named **Boostnote All** from the **Debug configuration**, then click the green arrow button or press **F5**. -5. Now you should find **Boostnote** is running. You will see two process is running, one named **Boostnote Main**,other named **Boostnote Renderer**. Now you can set **debug breakpoint** in vscode. If you find **breakpoints** is unverified, you need to switch process. +4. Select the configuration named **Boostnote All** from the **Debug configuration**, then click the green arrow button or press **F5** to start debugging. +5. Now you should find **Boostnote** is running. You will see two processes running, one named **Boostnote Main** and the other named **Boostnote Renderer**. Now you can set **debug breakpoints** in vscode. If you find your **breakpoints** is unverified, you need to switch to the appropriate process between **Boostnote Renderer** and **Boostnote Main**. ### References * [Electron application debugging](https://electronjs.org/docs/tutorial/application-debugging)