1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-14 18:26:26 +00:00

Compare commits

...

1726 Commits

Author SHA1 Message Date
Junyoung Choi
78c00b1722 v0.11.15 2019-02-08 20:33:20 +09:00
Junyoung Choi
2ff655d2dc Check update if the app is packaged 2019-02-08 19:30:46 +09:00
Junyoung Choi
e53717cd87 v0.11.14 2019-02-08 16:46:29 +09:00
Junyoung Choi
8b8d915ab7 Merge pull request #2642 from daiyam/drop-browser-image
handle all dropped images
2019-02-05 17:55:18 +09:00
Junyoung Choi
54de57ee7b Merge pull request #2863 from zzdjk6/master
FIX #2853 Allow "#" in title
2019-02-05 11:25:21 +09:00
Baptiste Augrain
e0d9cf7f5c fix dropping image from Firefox on Linux 2019-02-04 18:22:10 +01:00
Baptiste Augrain
10ea5d00eb avoid converting SVG 2019-02-04 14:09:11 +01:00
Baptiste Augrain
de76f55fe2 fix gif 2019-02-04 13:54:45 +01:00
Baptiste Augrain
cd301d514c Merge branch 'master' into drop-browser-image 2019-02-04 13:36:32 +01:00
Shenghan Chen
0f232b3d86 FIX #2853 Allow "#" in title
- Only strip the leading # in the title
- Make the finding title logic more straightforward
- Add unit test
2019-02-04 20:07:33 +13:00
Junyoung Choi
53ff693e95 Merge pull request #2852 from Aaron-Bird/bug-gif
[Fix] GIFs don't animate
2019-02-04 12:25:28 +09:00
Baptiste Augrain
215484c19a add tests 2019-02-01 16:27:47 +01:00
Junyoung Choi
885f656d34 Merge pull request #2856 from K-Sato1995/fix/grammer-error#2844
[Fix  #2844] Grammar Error In Notes
2019-02-01 16:44:12 +09:00
Baptiste Augrain
851d3ba159 fix image path when the dropped image's url contains a query 2019-01-31 23:26:31 +01:00
Katsuki
62ab444b29 Fix grammer error 2019-01-31 19:33:43 +09:00
Junyoung Choi
f1b929c13b Merge pull request #2848 from daiyam/fix-gallery
fix image path due to bad regex
2019-01-31 10:58:20 +09:00
Aaron-Bird
806139091c fix: GIFs don't animate 2019-01-31 01:08:07 +08:00
Junyoung Choi
6960c8b2d6 Merge pull request #2835 from ehhc/fix_broken_attachments
Strange url-handling reverted + tests modified so that they might fin…
2019-01-30 10:32:20 +09:00
Baptiste Augrain
b1c6c0442f fix guardrails errors 2019-01-29 16:49:51 +01:00
Baptiste Augrain
a85a27f225 - fix bad regex
- improve test
- fix missing 'e' in some functions name
2019-01-29 16:05:30 +01:00
Junyoung Choi
950d31ada8 Merge pull request #2809 from roottool/zoom-in-and-out-image#1448
Zoom in and out image #1448
2019-01-28 11:39:14 +09:00
Junyoung Choi
543c31cec6 Merge pull request #2831 from roottool/change_default_editor_font#1995
Change default editor font #1995
2019-01-28 10:02:19 +09:00
roottool
5e87ec2627 Specified MarkdownPreview class 2019-01-27 22:26:31 +09:00
ehhc
7165c4550b possibly fix for the broken test... 2019-01-26 18:16:39 +01:00
ehhc
472496d59c possibly fix for the broken test... 2019-01-26 17:53:31 +01:00
ehhc
127da40256 possibly fix for the broken test... 2019-01-26 17:37:04 +01:00
ehhc
a113b99de0 Strange url-handling reverted + tests modified so that they might find that issue in the future + test modified so that they both contain tests for posix and windows path separator -> fixes #2834 2019-01-26 17:21:53 +01:00
Junyoung Choi
74535c9cba Update yarn.lock 2019-01-26 12:30:22 +09:00
Junyoung Choi
79254a562f Update contributors 2019-01-26 12:29:20 +09:00
Junyoung Choi
4b1469748b v0.11.13 2019-01-26 12:25:05 +09:00
roottool
1683d63f33 Modified indent 2019-01-26 01:03:37 +09:00
roottool
4cce52f9ce changed default editor font #1995 2019-01-25 23:17:05 +09:00
roottool
33fb03066e Reduced the count of calculation 2019-01-25 20:06:43 +09:00
Junyoung Choi
a1deb15db8 Merge pull request #2651 from ZeroX-DG/fix-delete-note
Fixed delete note not navigating to the next note
2019-01-23 14:58:50 +09:00
Junyoung Choi
96ab8ec958 Merge pull request #2661 from miguelalexbt/bugfix-2121
Fixed lock button behavior and display
2019-01-23 14:50:08 +09:00
Junyoung Choi
c0f68dce25 Merge pull request #2798 from MiloTodt/disable-updates-in-dev
Disable updates in dev
2019-01-23 13:03:14 +09:00
Junyoung Choi
2b6c38083c Merge pull request #2774 from gurungrahul2/2194
#2194 - fixes Hotkey not working
2019-01-23 13:01:45 +09:00
Milo Todt
667ece7d3f Update main-app.js 2019-01-22 19:59:27 -08:00
Junyoung Choi
9270e59508 Merge pull request #2786 from Foo-x/2232
Fix bullet position of LaTeX equation in list
2019-01-22 18:09:09 +09:00
Nguyen Viet Hung
b32865488e fixed app body background (#2791) 2019-01-22 18:07:44 +09:00
Junyoung Choi
e43c7e9a6a Merge pull request #2598 from richardtks/fix-number-list
Fix the auto-updating numbered list to the middle of a list
2019-01-22 17:47:26 +09:00
Milo Todt
c3a980836a change to isDev 2019-01-20 21:04:56 -08:00
Junyoung Choi
304b83be89 Merge pull request #2801 from MiloTodt/issue-2799-add_storage
Removal of USB drive will no longer cause irreparable damage.
2019-01-21 09:53:14 +09:00
Milo Todt
eea01f10ac Added catch for exceptions, removed uneeded duplicate test. 2019-01-17 17:00:07 -08:00
Junyoung Choi
3d9b85dc6d Merge pull request #2811 from MiloTodt/Add_cheatsheets_to_menu
Added cheatsheets to menu
2019-01-17 17:40:05 +09:00
Junyoung Choi
743a9009de Merge pull request #2797 from MiloTodt/patch-1
Update copywrite year
2019-01-17 17:39:22 +09:00
Junyoung Choi
a0da4f9dd0 Merge pull request #2795 from MiloTodt/update-build.md
Updated build.md to include directions for checking out PRs
2019-01-17 17:38:57 +09:00
Milo Todt
3fe45e9cbb Added cheatsheets to menu 2019-01-16 16:09:07 -08:00
roottool
294bf742cd change variable name #1448 2019-01-16 23:14:21 +09:00
roottool
ea5970ab1c change a magnification by image size #1448 2019-01-16 22:47:42 +09:00
roottool
72df418953 DRY my code #1448 2019-01-16 18:10:28 +09:00
roottool
f566b567be add zoom-in and zoom-out action of images #1448 2019-01-16 01:54:54 +09:00
Milo Todt
8d817066e8 Added a few more checks in related methods to prevent simular errors 2019-01-13 18:35:24 -08:00
Milo Todt
99b53f4a55 added filter. 2019-01-13 18:21:12 -08:00
Milo Todt
038154c441 Removed uneeded "electron-is-dev" package 2019-01-13 17:21:30 -08:00
Milo Todt
951a126d63 Update LICENSE 2019-01-12 18:51:03 -08:00
Milo Todt
fa77cda0b4 whitespace 2019-01-12 17:59:04 -08:00
Milo Todt
a0bfd9e497 Disables updates in development mode 2019-01-12 17:58:19 -08:00
Milo Todt
a8e601e5e0 Update InfoTab.js 2019-01-12 16:09:25 -08:00
Milo Todt
47d7cef214 Update copywrite year
2018->2019
2019-01-12 15:50:33 -08:00
Milo Todt
e298739cb9 fixed typo 2019-01-12 12:34:25 -08:00
Milo Todt
6fb72bd44a minor typo 2019-01-12 09:46:51 -08:00
Milo Todt
7b8fb56440 fixed error in url 2019-01-12 08:38:18 -08:00
Milo Todt
5e9bd2fd2d escaped angle brackets 2019-01-12 08:34:14 -08:00
Milo Todt
aac13dcdca Updated build.md to include directions for checking out PRs 2019-01-12 08:26:31 -08:00
Foo-x
406e230ed3 Fix bullet position of LaTeX equation in list 2019-01-10 23:26:47 +09:00
Junyoung Choi
5a9de1a95d Merge pull request #2759 from richardtks/toggle-menu-bar-settings
allow menu bar visibility to be set in the settings
2019-01-08 08:27:41 +09:00
Junyoung Choi
0289caad67 Merge pull request #2712 from roottool/fix-issue#2644-and-#2662
fix issues #2644 and #2662
2019-01-07 14:15:48 +09:00
Junyoung Choi
99cb6fa9ed Merge pull request #2720 from richardtks/fix-tag-allow-overflow
show the scroll bar when the tag list is overflow
2019-01-07 14:15:21 +09:00
Junyoung Choi
fe011e87d1 Merge pull request #2758 from elfman/colorTag
add feature: colored tags
2019-01-07 14:14:40 +09:00
Junyoung Choi
5a5563f00a Merge pull request #2770 from vienai8d/update_snippet_note
Replace current fullscreen button of SnippetNote to FullscreenButton module
2019-01-07 14:12:15 +09:00
Junyoung Choi
5a8f076d85 Merge pull request #2762 from coliff/patch-1
Update mousetrap
2019-01-07 14:11:45 +09:00
Junyoung Choi
45deb5ba7f Merge pull request #2771 from caina/patch-1
typo on pt-BR.json
2019-01-07 14:11:24 +09:00
Junyoung Choi
bcea3eb7c1 Merge pull request #2764 from vienai8d/translate_ja
Add Japanese translation
2019-01-07 10:30:37 +09:00
Junyoung Choi
9ca5fa6144 Merge pull request #2761 from abnersajr/ptBr-translations
Pt br translations
2019-01-07 10:30:20 +09:00
Junyoung Choi
d9809318fc Merge pull request #2772 from vienai8d/localize_tooltips_ja
Localize tooltips for Japanese
2019-01-07 10:27:35 +09:00
Junyoung Choi
04ae8a81a5 Merge pull request #2768 from elfman/detect
new feature: auto detect snippet language
2019-01-06 09:58:13 +09:00
HarlanLuo
082a078b51 check config before auto detect language 2019-01-04 21:55:58 +08:00
Rahul Gurung
04fdb67fc9 #2194 - fixes Hotkey not working 2019-01-02 12:38:26 +05:30
vienai8d
e6a927e5af localize ToggleModeButton for Japanese 2019-01-02 11:10:07 +09:00
vienai8d
b05ba64db8 localize TrashButton for Japanese 2019-01-02 11:07:15 +09:00
vienai8d
d0f5ec8ada fix FullscreenButton 2019-01-02 11:03:40 +09:00
vienai8d
caa6c8d4b9 localize FullscreenButton for Japanese 2019-01-02 11:01:37 +09:00
vienai8d
5cf4a0e09d localize StarButton for Japanese 2019-01-02 10:59:06 +09:00
vienai8d
0a0c1c45a1 translate tooltip texts into Japanese 2019-01-02 10:56:27 +09:00
Douglas Caina
fce89fe8be Update pt-BR.json
## Description
There was a misspelling on the word "escluir", the correct one is "excluir", as you can see on [google translate](https://translate.google.com/?source=osdd#view=home&op=translate&sl=pt&tl=en&text=excluir)


## Type of changes

-  Bug fix (Change that fixed an issue)
-  Breaking change (Change that can cause existing functionality to change)
-  Improvement (Change that improves the code. Maybe performance or development improvement)
-  Feature (Change that adds new functionality)
-  Documentation change (Change that modifies documentation. Maybe typo fixes)

## Checklist:

-  My code follows [the project code style](docs/code_style.md)
-  I have written test for my code and it has been tested
-  All existing tests have been passed
-  I have attached a screenshot/video to visualize my change if possible
2019-01-01 22:20:23 +01:00
vienai8d
2bbe39120a use FullscreenButton instead of current button 2019-01-01 23:11:39 +09:00
vienai8d
2a5da746c7 add translation about content menu 2019-01-01 18:39:39 +09:00
HarlanLuo
deb2cd0156 new feature: auto detect snippet language
only try to detect after pasting and mode has not been set and default snippet language is "Auto Detect"
2019-01-01 17:01:49 +08:00
HarlanLuo
b4e4d7055f improve style of color-picker 2018-12-30 20:49:26 +08:00
HarlanLuo
a9feddf6f6 fix bug missing param colored tags in sorted list 2018-12-30 19:23:43 +08:00
tool root
071f7cb035 rewrote the function code to MarkdownPreview.js #2644 #2662 2018-12-30 16:20:19 +09:00
tool root
a11b0f1665 Merge branch 'master' into fix-issue#2644-and-#2662 2018-12-30 15:57:31 +09:00
HarlanLuo
39442bcafe invert icon-x color when tag text color is inverted 2018-12-29 22:23:48 +08:00
richardtks8@gmail.com
48a905bf6f decrease the height of tags scrollbar 2018-12-29 15:34:36 +08:00
vienai8d
440b50b4e8 add translation about interface in preferences 2018-12-29 15:08:03 +09:00
HarlanLuo
0cf6487cad invert text color in colored tags 2018-12-28 22:12:51 +08:00
Abner Soares Alves Junior
74825dddbf Minor tweaks on portuguese translation 2018-12-28 09:59:22 -02:00
HarlanLuo
699006a3e9 Improve ui of colored tags 2018-12-28 14:09:35 +08:00
HarlanLuo
6367be213f rename config.tag to config.coloredTags 2018-12-28 12:30:23 +08:00
Christian Oliff
4e97ac3b8c Update mousetrap 2018-12-28 10:11:44 +09:00
Abner Soares Alves Junior
57817fd90c Add pt_BR translation to debug documentation 2018-12-27 23:07:18 -02:00
Abner Soares Alves Junior
5b79d0439c Add pt_BR translation to build documentation 2018-12-27 22:43:17 -02:00
richardtks8@gmail.com
6d4cee0041 allow menu bar to be set in the settings 2018-12-28 02:15:24 +08:00
HarlanLuo
3e645db324 add feature: colored tags 2018-12-27 23:22:28 +08:00
Junyoung Choi
05da826c24 Merge pull request #2755 from empeje/patch-1
Create FAQ.md
2018-12-27 20:16:29 +09:00
Junyoung Choi
70e16d853e Replace heading 1 with heading 2 2018-12-27 15:36:20 +09:00
mpj
9ebf949890 Update FAQ.md 2018-12-27 13:20:44 +07:00
mpj
a06bdced8a Update FAQ.md 2018-12-27 13:19:54 +07:00
Junyoung Choi
3ab506ea94 Merge pull request #2756 from vienai8d/saveTagsAlphabetically
Fix feature 'saveTagsAlphabetically'
2018-12-27 13:45:28 +09:00
mpj
0340402dc1 Create FAQ.md 2018-12-27 11:12:36 +07:00
vienai8d
6e8fe7308c implement feature 'saveTagsAlphabeticall' 2018-12-27 12:09:56 +09:00
Junyoung Choi
13c2f471aa Merge pull request #2747 from daiyam/fix-paste-image
fix paste image
2018-12-25 01:07:37 +09:00
Junyoung Choi
604f17fbfd Merge pull request #2586 from GuilhermeJSilva/feature/autoBracketMatching
Feature/auto bracket matching
2018-12-25 00:24:37 +09:00
Baptiste Augrain
50669f65bb update preferences' labels 2018-12-24 11:04:17 +01:00
Guilherme Silva
21c61121b0 Fixing code style probllems 2018-12-24 09:46:25 +00:00
Baptiste Augrain
073a5d4d68 Ctrl+V can paste an image 2018-12-24 09:50:14 +01:00
Junyoung Choi
7a3cab8947 Merge pull request #2455 from daiyam/fix-notelist
fix scrolling in note list
2018-12-24 17:20:05 +09:00
Junyoung Choi
aec79c4eeb Merge pull request #2591 from daiyam/drop-image-preview
drag image into preview
2018-12-24 17:19:41 +09:00
Junyoung Choi
5f385e4c03 Merge pull request #2465 from daiyam/gallery
add image gallery
2018-12-24 17:19:03 +09:00
Junyoung Choi
b018502079 Merge pull request #2456 from daiyam/precommit-command
lint before commit
2018-12-24 17:17:53 +09:00
Junyoung Choi
47e0a82caf Merge pull request #2746 from BoostIO/fix-go-to-eol-on-mac
Fix Cmd+Left to go to end of line on Mac
2018-12-24 17:02:51 +09:00
Junyoung Choi
d848ee5d5f Merge pull request #2692 from Brunovsky/fix-2557
Fix issue 2557 katex alignment in display math
2018-12-24 17:00:11 +09:00
Junyoung Choi
2df0f1bcb8 Merge pull request #2682 from duartefrazao/master
Feature - Line highlighting within code block #2469
2018-12-24 16:56:59 +09:00
Junyoung Choi
1ae141492a Merge pull request #2743 from daiyam/fix-notelist-width
fix min width of note list
2018-12-24 16:54:37 +09:00
Junyoung Choi
7232d07b1c Merge pull request #2704 from jarvisuser90/Update-tabs-ui
Update tabs ui
2018-12-24 16:53:59 +09:00
Ryan Scott
64abd564b4 Fix Cmd+Left to go to end of line on Mac 2018-12-24 16:48:16 +09:00
Junyoung Choi
483ea77d14 Merge pull request #2710 from daiyam/fix-toc
fix toc
2018-12-24 16:41:41 +09:00
Junyoung Choi
cca5abdc8f Merge pull request #2741 from roottool/fix-issue#2729
fixed issue #2729
2018-12-24 16:38:35 +09:00
Junyoung Choi
17b3b02ac5 Merge pull request #2739 from coliff/patch-1
Https link to EditorConfig.org
2018-12-24 16:37:56 +09:00
Junyoung Choi
ce4e203c14 Merge pull request #2730 from joaocastro/vscode-debug-windows
Fixed windows debug path
2018-12-24 16:37:34 +09:00
Junyoung Choi
011defc1f7 Merge pull request #2745 from BoostIO/change-issuehunt-image
Change IssueHunt image
2018-12-24 15:03:01 +09:00
kazup01
5ccb9bde28 Change IssueHunt image 2018-12-24 14:10:52 +09:00
Baptiste Augrain
30e262d8ac fix min width of note list 2018-12-23 17:01:46 +01:00
roottool
692f6779d6 fixed the checkboxes are too far right #2729 2018-12-23 01:13:57 +09:00
duartefrazao
e93bf1cfe7 Removed bind in MarkdownEditor and MarkdownSplitEditor 2018-12-22 11:44:30 +00:00
Christian Oliff
8d769d4c4b Https link 2018-12-22 12:00:19 +09:00
MiguelPedrosa
b539ac6335 Fixed windows debug path 2018-12-19 20:57:27 +00:00
Duarte-Frazao
72906b3ee7 Corrections to make line highlighting robust, added tests
Lines now save correctly with different inputs, making sure that different inputs like enter, delete, paste and where it's deleted stay consistent when saving.
Included in the create/update  snippet/note tests the structure from lines highlighting saved to the files.
2018-12-19 16:34:16 +00:00
Miguel Teixeira
7f6d4acf90 Fixed lock button not appearing 2018-12-19 15:16:55 +00:00
richardtks
bb892f7e78 Updated the overflow-x to auto 2018-12-18 18:34:49 +08:00
Baptiste Augrain
ead6bb09dc Merge branch 'master' into fix-notelist 2018-12-18 11:07:49 +01:00
richardtks
0b1ec3f29f show the scroll bar when the tag list is overflow 2018-12-18 16:32:30 +08:00
Guilherme Silva
e77db372bd Merge branch 'master' into feature/autoBracketMatching 2018-12-17 15:39:03 +00:00
Junyoung Choi
64ca875cfd v0.11.12 2018-12-17 14:56:16 +09:00
Baptiste Augrain
256653677e fix lint errors and remove unused dependencies 2018-12-16 19:45:18 +01:00
Baptiste Augrain
b99980fda1 improve slug by replacing diacritics and removing unwanted characters 2018-12-16 19:38:04 +01:00
roottool
13857d4313 Modified position of escapeHtmlCharactersInCodeTag definition 2018-12-17 00:37:25 +09:00
roottool
fe1ab73818 fix #2644 and #2662 2018-12-16 22:08:55 +09:00
Baptiste Augrain
d5a2aa6d6d fix missing bullets 2018-12-15 10:41:47 +01:00
Baptiste Augrain
4f9b37433c fix toc by sharing slugify() 2018-12-15 10:11:04 +01:00
John Ciprian
ec506e71a4 Adding support for dracula interface theme 2018-12-13 20:56:47 -05:00
John Ciprian
cfcaa58b71 Optimizing css for dark and solarized-dark themes 2018-12-13 20:56:47 -05:00
John Ciprian
29cf4769f5 Adding support for monokai interface theme 2018-12-13 20:56:47 -05:00
John Ciprian
58fd2273ea Adding support for solarized-dark interface theme 2018-12-13 20:56:47 -05:00
John Ciprian
b52616c64d Changing tabs from material design to traditional
- Adding support for “default” interface theme.
- Adding support for “white” interface theme.
- Adding support for “dark” interface theme.
2018-12-13 20:56:47 -05:00
Duarte-Frazao
ac1ce6043b Fixed legacy default Markdown/Snippet notes bug
Fixed a bug where a note or snippet is created before the pull request and you ran Boostnote for the first time after the pr and you firstly created a note or markdown and only then returned to the old default notes and you couldn't highlight
2018-12-13 20:19:02 +00:00
Miguel Teixeira
6631f98c43 Removed debug log 2018-12-13 19:13:12 +00:00
Miguel Teixeira
37340d0445 Fixed issue with double and right click 2018-12-13 19:09:41 +00:00
Junyoung Choi
743c97940e Merge pull request #2641 from daiyam/fix-paste-code
fix pasting into fenced code block
2018-12-14 01:26:49 +09:00
Duarte-Frazao
f2a0f59b08 Fixed error on call to bind. 2018-12-13 13:27:20 +00:00
Duarte-Frazao
4fb11b68e4 Markdown functionality 2018-12-13 13:13:01 +00:00
Guilherme Silva
ed742c7e16 Merge branch 'master' into feature/autoBracketMatching 2018-12-13 11:58:45 +00:00
Miguel Teixeira
3b110bcd4b WIP 2018-12-13 11:55:04 +00:00
Baptiste Augrain
d4dd74e820 Merge branch 'master' into fix-paste-code 2018-12-13 08:20:36 +01:00
Junyoung Choi
3f77cb2214 Merge pull request #2684 from GuilhermeJSilva/fix/highlight-folder-on-hover
Dragged note highlighting
2018-12-13 13:59:10 +09:00
Junyoung Choi
7c839a1df9 Merge pull request #2685 from jhdcruz/patch-1
Fixed Build Badge Alignment w/ Fixed link
2018-12-13 13:58:29 +09:00
Miguel Teixeira
c5de940946 Fixed bug where icon was hidden 2018-12-12 18:19:41 +00:00
Miguel Teixeira
2943c5fafb Sync with upstream 2018-12-12 18:09:46 +00:00
Junyoung Choi
fddeaa966d Merge pull request #2690 from vienai8d/translate_ja
Add Japanese translation
2018-12-13 00:27:54 +09:00
Junyoung Choi
e706ec0ffe Merge pull request #2643 from daiyam/fix-contextmenu
fix editor's context menu
2018-12-13 00:26:05 +09:00
Brunovsky
e65c48be33 Fix issue 2557 katex alignment in display math 2018-12-11 00:41:51 +00:00
vienai8d
d44a76bae3 add translation about interface in preferences 2018-12-10 07:20:02 +09:00
vienai8d
4488de9add add translation about hotkeys in preferences 2018-12-09 10:58:06 +09:00
Duarte-Frazao
62609a2918 Fixed last nonfunctional changes made earlier
Now iterates in the SnippetNoteDetail constructor the snippets and if linesHighlighted is not defined assigns an empty array
2018-12-08 17:22:57 +00:00
Duarte-Frazao
492294e11d Reset of linesHighlighted 2018-12-08 12:19:42 +00:00
Duarte-Frazao
f483f8fdf0 Fix so that linesHighlighted defaults to [] when does't find it 2018-12-08 12:07:28 +00:00
Guilherme Silva
4061866042 Moving prevent default 2018-12-08 09:06:55 +00:00
Duarte-Frazao
191295b6de Added array of linesHighlighted to default snippet
This makes the default snippet also handle highlight on the lines, because this snippet is created in the code without the normal snippet constructor
2018-12-07 23:41:51 +00:00
Joshua Dela Cruz
6d4aa27e15 Fixed Build Badge Alignment w/ Fixed link
Related to PR #2584
2018-12-07 17:22:01 +08:00
Junyoung Choi
d70d3b439f Merge pull request #2672 from arkist/handle-encoded-uri-on-copyfile
Handle encoded uri path on `copyFile`
2018-12-07 14:30:35 +09:00
Junyoung Choi
56851eb91f Merge pull request #2666 from yougotwill/menu_items_overhaul
Menu items overhaul
2018-12-07 12:41:22 +09:00
Baptiste Augrain
2cfe8de030 Merge branch 'master' into precommit-command 2018-12-06 15:48:27 +01:00
Duarte-Frazao
b5604ba0a9 Changes to optimize initial highlighting
Now iterates over highlighted lines instead of all lines of the snippet
2018-12-06 13:23:23 +00:00
Duarte-Frazao
1a0e15e04c Fixed bug when switching to markdown notes 2018-12-05 14:12:29 +00:00
Junyoung Choi (Sai)
b224c72e98 Merge pull request #2637 from miguelalexbt/master
Warning when printing snippet
2018-12-03 17:16:50 +09:00
Junyoung Choi (Sai)
6c57ac8f01 Merge pull request #2383 from ehhc/exportMDexportsAttachments
export folder should also export the attachments -> fixes #2374
2018-12-03 17:15:02 +09:00
Jinwoo Oh
cf35dc5345 Handle encoded uri path on copyFile
fix #2578
2018-12-03 14:04:13 +09:00
William Grant
102d13bbae you can't have multiple accelerators on a single menu item. Bye bye delete key :( 2018-12-02 16:29:10 +02:00
William Grant
faf2aff959 added in the shift key for deleting a note based on https://github.com/BoostIO/Boostnote/pull/2452 2018-12-02 16:02:29 +02:00
William Grant
5d54ad3342 Cleaned up menu items ordering and separators, added clone note menu item and shortcut, updated focus note shortcut to be mac friendly, made delete note shortcut use either command+backspace or ctrl+backspace and the delete key on windows and linux machines 2018-12-02 15:59:47 +02:00
William Grant
0f5d753910 Removed the old ctrl+d shortcut for deleting a note since we now have the super+shift+backspace shortcut which can be changed in the hotkey settings 2018-12-02 15:21:01 +02:00
Duarte-Frazao
a9442a019f Changes to pass tests and lint code 2018-11-30 19:20:40 +00:00
Duarte-Frazao
1668ef6bb4 Small changes 2018-11-30 18:32:14 +00:00
Duarte-Frazao
45436f65af Issue #2469 almost done, missing refactor to reduce calls on code mirror 2018-11-30 18:03:23 +00:00
Guilherme Silva
b8a295713c Dragged note highlighting 2018-11-30 08:42:27 +00:00
Miguel Teixeira
aa20bc769c Fixed lock button behaviour and display 2018-11-29 17:06:28 +00:00
Guilherme Silva
9bc291e618 Merge branch 'master' into feature/autoBracketMatching 2018-11-29 11:47:07 +00:00
Baptiste Augrain
fdb54b5cdc fix expanding snippet 2018-11-28 16:47:19 +01:00
Baptiste Augrain
df20662005 remove console.log 2018-11-28 16:42:10 +01:00
Baptiste Augrain
900f20f164 handle all dropped images 2018-11-28 15:58:58 +01:00
Baptiste Augrain
df3b2cd8fe fix double paste when pasting attachement links 2018-11-28 15:12:18 +01:00
Baptiste Augrain
c2e4bae9dd fix regex to correctly match the src attribute when there is a data-src attribute 2018-11-28 15:00:29 +01:00
Miguel Teixeira
a39da481e0 Changed message. 2018-11-28 09:08:58 +00:00
Junyoung Choi (Sai)
830ade9596 Merge pull request #2399 from Pudge601/bug/2241
Clear search when a new note is created
2018-11-28 11:36:46 +09:00
Baptiste Augrain
2aa296ff33 fix lint error 2018-11-28 00:45:20 +01:00
Baptiste Augrain
9050035c74 - add option to enable/disable smart paste
- add shortcut to paste smartly
- use electron's clipboard
2018-11-28 00:44:15 +01:00
Miguel Teixeira
c245855bbf Improved messages. 2018-11-27 20:28:57 +00:00
Miguel Teixeira
ef66e71feb Solved some errors in identation 2018-11-27 18:02:59 +00:00
Miguel Teixeira
c33058ae2b Added custom warning messages. 2018-11-27 17:42:04 +00:00
Nguyễn Việt Hưng
629d4a82ae fixed delete note not navigate to next note 2018-11-27 13:58:06 +07:00
Baptiste Augrain
d95d282f39 disable editor's context menu when switch preview is using right click 2018-11-25 17:09:54 +01:00
Baptiste Augrain
64f7233bfc fix regex to match :storage reference, added comment to explain what it does. 2018-11-25 16:58:11 +01:00
Baptiste Augrain
9d81e4be2f undo change 2018-11-25 16:17:01 +01:00
Baptiste Augrain
0a1ee86baf Merge branch 'master' into gallery 2018-11-25 16:05:27 +01:00
Baptiste Augrain
2908884202 drag and drop image from browser 2018-11-25 15:56:11 +01:00
Baptiste Augrain
aac075be06 fix lint error 2018-11-25 14:57:03 +01:00
Baptiste Augrain
bf288fdaeb fix pasting into fenced code block 2018-11-25 14:55:29 +01:00
Junyoung Choi (Sai)
a6eddb5798 Merge pull request #2592 from enyaxu/bug-2581
Fixed duplicate TOC Title jump error
2018-11-25 15:49:06 +09:00
Junyoung Choi (Sai)
78ae7b847c Merge branch 'master' into bug-2581 2018-11-25 15:39:39 +09:00
Junyoung Choi (Sai)
c7bae93b48 Merge pull request #2601 from yougotwill/zoom_controls
Zoom Controls
2018-11-25 15:37:29 +09:00
Junyoung Choi (Sai)
938cf238ff Merge pull request #2604 from arcturus140/fixGUI
fix GUI style element for default theme
2018-11-25 15:36:17 +09:00
Junyoung Choi (Sai)
5188846e2e Merge pull request #2611 from gregueiras/issue2199
Ability to go from 'editor with preview' mode to 'preview' using mouse
2018-11-25 15:35:53 +09:00
Junyoung Choi (Sai)
d874a3a493 Merge pull request #2620 from arcturus140/fix2618
fix2618
2018-11-25 15:29:37 +09:00
Junyoung Choi (Sai)
f95284622e Merge pull request #2621 from mehr-licht/master
included shortcut for Info Panel (issue 2533)
2018-11-25 15:28:25 +09:00
Junyoung Choi (Sai)
0b6c0e6b94 Merge pull request #2622 from daiyam/fix-fence
fix code blocks
2018-11-25 15:26:48 +09:00
Junyoung Choi (Sai)
b021bb73ed Merge pull request #2498 from daiyam/create-note-with-tags
create note with selected tags
2018-11-25 15:23:04 +09:00
Junyoung Choi (Sai)
c76b653737 Merge pull request #2338 from ehhc/spellchecker
Spellchecker
2018-11-25 15:21:04 +09:00
Miguel Teixeira
3414e2daf0 Added warning when trying to print from InfoPanel 2018-11-22 12:22:49 +00:00
mehr-licht
92e2cd102e deleted ctr+l and ctrl+t 2018-11-19 19:00:51 +00:00
Junyoung Choi (Sai)
b703c42ee3 Merge pull request #2504 from ZeroX-DG/pr-template
Added PR Template and update docs
2018-11-19 15:14:02 +09:00
Baptiste Augrain
94f7533ee7 fix code blocks 2018-11-18 23:53:46 +01:00
mehr-licht
101e5d5035 included shortcut for Info Panel 2018-11-18 19:22:05 +00:00
Arcturus
ab78af0691 fix2618 2018-11-18 17:36:42 +00:00
Gonçalo Santos
af14b682b1 User can now go back to previous mode 2018-11-15 12:51:53 +00:00
Junyoung Choi
a26d4fb499 Update yarn.lock 2018-11-15 19:40:52 +09:00
Junyoung Choi
f644d21c61 v0.11.11 2018-11-15 19:24:56 +09:00
Junyoung Choi (Sai)
2af52c193c Merge pull request #2603 from jhit/master
Update electron framework to version 3.0.8
2018-11-13 08:33:40 +09:00
Arcturus
7717cda52a fix GUI style element for default theme 2018-11-12 20:50:09 +00:00
Baptiste Augrain
c13746f10e Merge branch 'master' into create-note-with-tags 2018-11-12 19:16:50 +01:00
ehhc
49abfac98e don't do spellcheck if disabled... 2018-11-12 17:47:45 +01:00
ehhc
aa26e5ac2a fix linter errors 2018-11-12 17:40:37 +01:00
ehhc
336f007fa1 Merge branch 'spellchecker' of https://github.com/ehhc/Boostnote into spellchecker 2018-11-12 17:36:36 +01:00
ehhc
a3e59d43a7 hiding spellcheck by default and adding a interface option to enable it 2018-11-12 17:35:33 +01:00
Junyoung Choi (Sai)
ae840ea689 Merge pull request #2492 from amireldor/fix-paste-with-emacs-keymap
Remove emacs keymap Ctrl-V binding to allow pasting
2018-11-13 00:40:48 +09:00
Junyoung Choi (Sai)
79ee674ad9 Merge pull request #2593 from daiyam/fix-snippet-cursor
fix cursor position after expending snippet
2018-11-13 00:35:46 +09:00
Junyoung Choi (Sai)
4d77053313 Merge pull request #2590 from arcturus140/improve2588
enhancement for #2588
2018-11-13 00:31:04 +09:00
Junyoung Choi (Sai)
235e88f115 Merge pull request #2571 from enyaxu/vscode-debug-support
Add vscode debug support
2018-11-13 00:30:32 +09:00
Junyoung Choi (Sai)
021bac5b68 Merge pull request #2589 from arcturus140/master
fix 2530
2018-11-13 00:29:27 +09:00
Junyoung Choi (Sai)
60c4cacfbc Merge pull request #2596 from richardtks/correct-shift-select-behavior
Fix the shift selection and ctrl selection in note list
2018-11-13 00:27:45 +09:00
Junyoung Choi (Sai)
30e6fc516b Merge pull request #2600 from daiyam/fix-taglist
fix route when selecting multiple tags
2018-11-13 00:26:10 +09:00
Jürgen Hörmann
1388e7d7f4 Missed to update config value for electron-version 2018-11-12 10:23:24 +01:00
Jürgen Hörmann
b79b123c65 Update electron framework to version 3.0.8
On Ubuntu 18.10 there is a issue with glibc versions below 2.28 see
[Prebuilt Electron binaries segfault at startup on Arch Linux with glibc 2.28 #13972](https://github.com/electron/electron/issues/13972)
2018-11-12 08:47:35 +01:00
William Grant
d3a6ff6b6a updated zoom out accelerator for consistency 2018-11-12 06:53:10 +02:00
Junyoung Choi (Sai)
10d3adbe40 Merge pull request #2595 from daiyam/fold-headings
fold headings
2018-11-12 11:14:43 +09:00
JianXu
e100e080da fixed debug.md format error 2018-11-11 21:19:38 +08:00
William Grant
e2c7a8c384 updated the zoom logic for the zoom in/out menu items so that if you zoom it reflects in the status bar and the config. Also added an actual size / zoom reset menu item for convenience. 2018-11-11 12:59:50 +02:00
Baptiste Augrain
d97bbe7918 fix URI when selecting multiple tags 2018-11-11 10:10:09 +01:00
JianXu
3864d73d1a Add vscode debug support doc 2018-11-11 14:49:48 +08:00
richardtks
01891d46b3 Added the auto-updating numbered list to the middle of a list 2018-11-11 00:15:22 +08:00
richardtks
82987cd53c Fix the variable name to more appropriate one 2018-11-10 21:23:56 +08:00
richardtks
aa56aad46e Improvement on the code
The improvement was suggested by github
2018-11-10 20:29:24 +08:00
richardtks
ad7b155a99 Updated the condition with more appropriate naming 2018-11-10 19:39:44 +08:00
Baptiste Augrain
f1ca06daf5 fold markdown's headings 2018-11-10 12:33:07 +01:00
richardtks
3df743f47b 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
2018-11-10 19:17:11 +08:00
Baptiste Augrain
637225c2bc fix cursor position after expending snippet 2018-11-10 11:18:44 +01:00
JianXu
849104f530 Update Snapshots test 2018-11-10 16:19:42 +08:00
JianXu
3a4bc33d53 Fixed duplicate TOC Title jump error 2018-11-10 15:56:21 +08:00
Baptiste Augrain
3679fbe3ea fix lint errors 2018-11-10 00:18:06 +01:00
Baptiste Augrain
b1d2c25ce5 when dropping an image, switch to editor and add it at the end of the file 2018-11-10 00:05:45 +01:00
Arcturus
480c05650b fix linting issues 2018-11-09 13:58:54 +00:00
Arcturus
fa265d769c fix multiple spaces issue 2018-11-09 13:40:45 +00:00
Arcturus
4a197a5c90 add confirmation dialog 2018-11-09 13:37:17 +00:00
Arcturus
23702056fd Merge branch 'hotfix/2530' 2018-11-09 12:21:31 +00:00
Arcturus
2a774d20f4 fix issue 2530 2018-11-09 12:21:00 +00:00
Baptiste Augrain
b1a7f0fd64 Merge branch 'master' into gallery 2018-11-08 23:52:31 +01:00
Baptiste Augrain
70b86907f3 Merge branch 'master' into create-note-with-tags 2018-11-08 18:31:32 +01:00
Baptiste Augrain
d0d813552c add option to tag the new notes with the filtering tags, or not... 2018-11-08 18:22:52 +01:00
Guilherme Silva
707dace3d0 removing spaces after = 2018-11-08 14:11:43 +00:00
Guilherme Silva
8361106660 Removing trailing spaces and added spaces in config 2018-11-08 14:07:35 +00:00
Guilherme Silva
a46c519459 Fixing indentations 2018-11-08 14:03:21 +00:00
Guilherme Silva
441c70b388 Removing checkmark and fixed Code Editor indentation 2018-11-08 13:25:22 +00:00
Guilherme Silva
ab65fb7a5c Choosing which characters to match and explode 2018-11-08 13:18:13 +00:00
Guilherme Silva
59d31c9a18 Deleted useless console log 2018-11-08 12:01:12 +00:00
Guilherme Silva
db97ab51ac Bracket matching option added to config 2018-11-08 11:44:03 +00:00
ehhc
c6f1f97a57 Merge branch 'master' into spellchecker 2018-11-08 11:19:46 +01:00
Junyoung Choi (Sai)
fdb1ef540d Merge pull request #2515 from FabioRosado/translation-pt
Add translation to Portuguese from Portugal
2018-11-08 19:14:47 +09:00
Junyoung Choi (Sai)
62a8ffb4ae Merge pull request #2579 from daiyam/fix-turndown
fix paste
2018-11-08 19:12:36 +09:00
Baptiste Augrain
1e3cf6f374 remove console.log 2018-11-08 10:10:45 +01:00
Baptiste Augrain
48c29dd7d9 fix turndown 2018-11-08 10:01:16 +01:00
JianXu
e30727ab27 Add detail mode support for vscode debug 2018-11-08 13:47:34 +08:00
Junyoung Choi (Sai)
157eb5f87b Merge pull request #2346 from daiyam/text-deflist
add support to abbreviations, definition lists and subscript/superscript text
2018-11-08 14:35:56 +09:00
Baptiste Augrain
8f290c2a6d rounding paddings 2018-11-08 06:22:12 +01:00
Baptiste Augrain
47f6a217e8 Merge branch 'master' into text-deflist 2018-11-08 05:24:57 +01:00
Junyoung Choi (Sai)
69691bdf2a Merge pull request #2448 from jacobherrington/alt-hotkey-bug
Fix bug caused by poor regex
2018-11-08 11:57:10 +09:00
Junyoung Choi (Sai)
522a37b8e3 Merge pull request #2451 from jacobherrington/improve-french-translations
Add French translations
2018-11-08 11:52:49 +09:00
Junyoung Choi (Sai)
53aa142d94 Merge pull request #2395 from daiyam/chart-yaml
add YAML for chart
2018-11-08 11:41:45 +09:00
Fábio Rosado
61bd591ee8 Merge pull request #1 from arcturus140/europeanPortuguese
add language support for european portuguese
2018-11-07 15:12:52 +00:00
Arcturus
fd2b438c67 add language support for european portuguese 2018-11-07 13:58:47 +00:00
jacob
5855cdfb26 Merge branch 'master' into improve-french-translations 2018-11-07 07:54:44 -06:00
Baptiste Augrain
a63266b0e9 Merge branch 'master' into chart-yaml 2018-11-06 11:33:11 +01:00
Fábio Rosado
fe19d96088 Merge branch 'master' into translation-pt 2018-11-06 09:06:01 +00:00
Junyoung Choi (Sai)
37933782d2 Merge pull request #2394 from daiyam/fence-attrs
add attributes to fence blocks
2018-11-06 17:48:29 +09:00
Junyoung Choi (Sai)
1dcc51e5a4 Merge pull request #2499 from daiyam/store-editor-status
store editor view into config
2018-11-06 17:47:42 +09:00
Baptiste Augrain
eb61ce2cf2 use config's local reference 2018-11-06 09:40:48 +01:00
Baptiste Augrain
c5bcfe6ab3 Merge branch 'master' into fence-attrs 2018-11-06 09:35:59 +01:00
ehhc
6c7ed82fa9 Merge branch 'master' into spellchecker 2018-11-06 08:36:59 +01:00
Junyoung Choi (Sai)
00ed0d79ec Merge pull request #2314 from daiyam/tags
tag enhancements
2018-11-06 16:09:26 +09:00
Junyoung Choi (Sai)
cfc84f3e78 Merge pull request #2434 from jacobherrington/chore-remove-console-logs
Remove console.logs
2018-11-06 15:49:07 +09:00
Junyoung Choi (Sai)
27e5010d8e Merge pull request #2430 from jacobherrington/hotkey-error-message-fix
Fix errors when saving a blank hotkey
2018-11-06 15:48:33 +09:00
Junyoung Choi (Sai)
efa00728d6 Merge pull request #2342 from daiyam/bug-1992
fixing inline html
2018-11-06 15:45:41 +09:00
Junyoung Choi (Sai)
106caf2b3e Merge pull request #2484 from crakoucas/fix-electron-glibc-segmentation-fault
fix segmentation fault with glibc 2.28
2018-11-06 15:39:28 +09:00
Junyoung Choi (Sai)
3dca6c1fd6 Merge pull request #2485 from ninearif/thai-local
add Thai locale
2018-11-06 15:22:25 +09:00
Junyoung Choi (Sai)
bd56055593 Merge pull request #2511 from nagledb/fix-blockquote-in-html-export
Fixed "Save as HTML" to respect blockquotes.
2018-11-06 15:18:59 +09:00
Junyoung Choi (Sai)
dbd2c7049e Merge pull request #2547 from mattkoskela/fix-storagelist-typo
fix: Fixed storageList typo (storgaeList).
2018-11-06 15:08:36 +09:00
JianXu
07aa775de1 Add vscode debug support 2018-11-05 00:39:27 +08:00
ehhc
88ac2a98e8 Merge branch 'master' into spellchecker 2018-11-02 10:41:30 +01:00
Junyoung Choi (Sai)
d0c5592855 Merge pull request #2278 from kiryanenko/master
Add support for converting to MD when paste HTML
2018-11-02 18:29:22 +09:00
Junyoung Choi (Sai)
b03ad0cfe0 Merge pull request #2452 from jacobherrington/add-delete-hotkey
Add delete hotkey
2018-11-02 18:28:09 +09:00
Junyoung Choi (Sai)
a43b0e6a57 Merge pull request #2542 from nagledb/optional-scroll-sync
Added option to disable scroll sync.
2018-11-02 18:27:30 +09:00
Junyoung Choi (Sai)
12176473ff Merge pull request #2549 from timarcosdias/localization
Fixed pt-BR locale
2018-11-02 18:24:59 +09:00
Kiryanenko Alexander
1614c1452f Merge branch 'master' into master 2018-10-29 21:25:11 +03:00
Marcos Dias da Conceição
d38f16d732 Fixed pt-BR locale
Added 'BR' to 'pt-BR' locale so the Brazilian Portuguese language can be shown
2018-10-28 01:55:45 -03:00
Matt Koskela
d7a2296909 fix: Fixed storageList typo (storgaeList). 2018-10-27 13:48:11 -07:00
Nguyễn Việt Hưng
4550d888bb updated code style with class property style 2018-10-27 09:47:15 +07:00
David Nagle
d62d1d670b Added option to disable scroll sync. 2018-10-26 11:17:06 -07:00
FabioRosado
f18e8c5a38 Fix typo, change for suggested term 2018-10-26 17:25:38 +01:00
Nguyễn Việt Hưng
6cb6cd3f26 updated docs and pull request template 2018-10-26 00:06:06 +07:00
Nguyễn Việt Hưng
c5554e8f1e update pull request template 2018-10-25 23:36:31 +07:00
David Nagle
5144c0ecdc Fixed "Save as HTML" to respect blockquotes.
When saving as HTML, the raw text was being HTML escaped prior to
running it through markdown. This was preventing blockquotes from
rendering because greater-than signs were escaped. The HTML escaping
seems unneeded since the markdown renderer already takes care of it,
and it also wasn't consistent with how markdown was being rendered
within the application.
2018-10-23 13:41:23 -07:00
jacob
642c62d8ce Merge branch 'master' into add-delete-hotkey 2018-10-23 09:16:29 -05:00
Junyoung Choi (Sai)
f92da16544 Merge pull request #2487 from daiyam/fix-task-config
fix error generated by toggling split editor
2018-10-23 18:30:41 +09:00
Junyoung Choi (Sai)
6e8b370e54 Merge pull request #2497 from daiyam/delete-tag
delete tag through context menu
2018-10-23 18:30:20 +09:00
Junyoung Choi (Sai)
1ecf1e0413 Merge pull request #2494 from intercloud/feat/link-to-a-line
feat(editor): add ability to jump to line
2018-10-23 18:25:36 +09:00
Junyoung Choi (Sai)
1ea1482aad Merge pull request #2474 from daiyam/fix-attachment-hyperlink
disable hyperlink for attachments
2018-10-23 18:00:03 +09:00
Junyoung Choi (Sai)
aeded9ac0e Merge pull request #2510 from nagledb/nagledb-front-matter-title
Title will now be extracted from front matter if title: is present.
2018-10-23 17:50:28 +09:00
Junyoung Choi (Sai)
1cec872273 Merge pull request #2503 from makibishi0212/uncheck-all-checkboxes
Add button clear all checkboxes
2018-10-23 17:48:33 +09:00
Junyoung Choi (Sai)
e550295644 Merge pull request #2506 from daiyam/fix-alt-color-table
fix color for even rows in table
2018-10-23 17:47:54 +09:00
Junyoung Choi (Sai)
70da43eeb7 Merge pull request #2512 from nagledb/fix-print-scroll-past-end
Prevent empty printed page with scroll-past-end
2018-10-23 17:20:35 +09:00
Junyoung Choi (Sai)
7e9fb6be32 Merge pull request #2518 from BoostIO/change-blog-url
Change blog url
2018-10-23 17:13:10 +09:00
Junyoung Choi (Sai)
258ed4e866 Merge pull request #2519 from BoostIO/fix-crowdfunding
Remove OpenCollective and add IssueHunt description
2018-10-23 17:12:52 +09:00
Junyoung Choi (Sai)
b8992362c2 Merge pull request #2524 from nagledb/custom-css
Moved custom CSS to bottom of style definitions so that it has higher precedence.
2018-10-23 17:11:45 +09:00
Baptiste Augrain
60fcf2734a Merge branch 'master' into text-deflist 2018-10-23 09:42:54 +02:00
Baptiste Augrain
ae9e83cf66 Merge branch 'master' into bug-1992 2018-10-23 09:34:26 +02:00
David Nagle
b8d1e37cce Moved custom CSS to bottom of style definitions so that it has higher precedence. 2018-10-22 10:47:47 -07:00
kazup01
6ecd1e5ea5 Remove OpenCollective and add IssueHunt description 2018-10-21 15:47:11 +09:00
kazup01
52956503f1 Change blog url 2018-10-21 15:18:28 +09:00
Nguyễn Việt Hưng
3b7bedbbe8 update pull request message 2018-10-21 10:25:28 +07:00
FabioRosado
148feac43e Add translation to Portuguese from Portugal 2018-10-20 15:03:07 +01:00
David Nagle
3272033c63 Added preferences to support toggling front matter title extraction on/off and to customize what field is used for the title. 2018-10-19 23:29:30 -07:00
David Nagle
73d1bdf84b Prevent empty printed page with scroll-past-end 2018-10-19 14:29:48 -07:00
David Nagle
0e38f61c85 Title will now be extracted from front matter if title: is present. 2018-10-19 10:59:37 -07:00
Baptiste Augrain
9d84fe7719 fix lint errors 2018-10-19 14:09:13 +02:00
Baptiste Augrain
5aaecfc0fe fix color for even rows in table 2018-10-19 14:06:21 +02:00
Junyoung Choi
ff3026686f v0.11.10 2018-10-19 19:04:53 +09:00
Nguyễn Việt Hưng
83243b61a6 smaller header font size 2018-10-18 12:39:57 +07:00
Nguyễn Việt Hưng
80c4601fdc fixed grammar in PR template 2018-10-18 12:36:21 +07:00
Nguyễn Việt Hưng
fa3700df7c updated pr template 2018-10-18 12:33:54 +07:00
Nguyễn Việt Hưng
6244e44033 added pr template 2018-10-18 12:29:47 +07:00
makibishi
d64dafc715 change prop name in TodoListPercentage 2018-10-18 03:11:44 +09:00
makibishi
9e67880456 Add button clear all checkboxes 2018-10-17 17:43:00 +09:00
Baptiste Augrain
7484f6e6a6 increase readability of the condition 2018-10-16 20:30:15 +02:00
Baptiste Augrain
d8d5810d7c avoid rerendering TagSelect when adding a tag 2018-10-15 15:29:24 +02:00
Baptiste Augrain
4a167aa3d7 update only if tags' length has been changed 2018-10-15 12:11:52 +02:00
Baptiste Augrain
ced3460673 store editor's status in config 2018-10-15 09:04:45 +02:00
Baptiste Augrain
d75dd874ca create note with selected tags 2018-10-15 08:24:21 +02:00
Baptiste Augrain
1da477d1d1 add context menu to delete tag 2018-10-15 08:09:50 +02:00
Baptiste Augrain
a4ad3896f0 Merge branch 'master' into fence-attrs 2018-10-14 15:21:27 +02:00
antogyn
e536d203d2 feat(editor): add ability to jump to line 2018-10-13 14:21:46 +02:00
jacob
ca038937e9 Update ConfigManager.js 2018-10-12 22:10:35 -05:00
Amir Eldor
342d0862c6 Change to single-quotes 2018-10-12 20:31:48 +03:00
Amir Eldor
3b11285bd5 Remove emacs keymap Ctrl-V binding to allow pasting
Fixes #1406
2018-10-12 20:15:07 +03:00
Baptiste Augrain
3c404f3678 remove unused method 2018-10-11 15:09:26 +02:00
Baptiste Augrain
eb37be1381 fix error generated by toggling split editor 2018-10-11 15:03:04 +02:00
Baptiste Augrain
c5f6ace332 Merge branch 'chart-yaml' into gallery 2018-10-11 12:59:53 +02:00
Baptiste Augrain
0e29e8ac76 Merge branch 'master' into chart-yaml 2018-10-11 12:48:40 +02:00
Junyoung Choi (Sai)
71ae42056f Merge pull request #2414 from yougotwill/dracula_theme
Dracula theme
2018-10-11 18:33:55 +09:00
Junyoung Choi (Sai)
a9bad53209 Merge pull request #2438 from jacobherrington/fix-type-error-on-snippets
Fix TypeError thrown on the Snippets page
2018-10-11 17:33:37 +09:00
Junyoung Choi (Sai)
eee340366e Merge pull request #2460 from ZeroX-DG/linethrough-checkbox
Added linethrough checkbox & make it optional
2018-10-11 17:32:57 +09:00
Junyoung Choi (Sai)
a2bc1a5d2d Merge pull request #2443 from daiyam/table-emoji
update codemirror to fix centered column as not emoji
2018-10-11 17:24:47 +09:00
Junyoung Choi (Sai)
3610d5ea93 Merge pull request #2462 from daiyam/fix-tag-autocomplete
fix small visual bug in tag autocomplete
2018-10-11 17:21:23 +09:00
Junyoung Choi (Sai)
a75f8e5fdf Merge pull request #2444 from daiyam/snippet-list
fix graphical bugs in snippet list
2018-10-11 17:02:46 +09:00
Junyoung Choi (Sai)
1821a5c678 Merge pull request #2445 from jacobherrington/snippet-copy-button
Add a Copy button the Snippets tab
2018-10-11 17:01:12 +09:00
Junyoung Choi (Sai)
5c3a62b9c5 Merge pull request #2449 from jacobherrington/patch-3
Update ISSUE_TEMPLATE.md
2018-10-11 16:49:22 +09:00
Junyoung Choi (Sai)
851f57c1f5 Merge pull request #2476 from daiyam/table-even-odd
alternate background color for table rows
2018-10-11 16:49:00 +09:00
Junyoung Choi (Sai)
2cd3f8c6ee Merge pull request #2477 from daiyam/fix-preview
fix visual bug with preview
2018-10-11 16:41:53 +09:00
Renaud R
a331d82cb5 Update Electon & Resize Bug
Electron to V 3.0.3
Electron-gh-release to V2.0.4
Fix Bug restore windows size
2018-10-11 09:40:05 +02:00
ninearif
6ef2ec4ed2 add Thai locale 2018-10-11 10:37:35 +07:00
renaud
29ed26a503 fix semgmentation fault with glibc 2.28 2018-10-10 11:19:00 +02:00
Sam Herrington
7b3d5ab1ae Update ConfigManager.js
Added console.log back per request.
2018-10-09 14:07:54 -05:00
Sam Herrington
6f2f6e9567 Update dev.js
Fixed console.log that is there by design
2018-10-09 11:00:18 -05:00
Baptiste Augrain
9a0bc984d4 fix preview 2018-10-09 10:38:19 +02:00
Baptiste Augrain
1922c8dbf8 add comment to the STORAGE_FOLDER_PLACEHOLDER variable 2018-10-09 10:15:30 +02:00
Baptiste Augrain
a841449771 fix lint error 2018-10-09 10:10:20 +02:00
Baptiste Augrain
ff4ef16375 update how to calculate alternative color 2018-10-09 10:07:00 +02:00
Baptiste Augrain
33f6926916 fix regex for windows' url 2018-10-09 09:35:10 +02:00
Baptiste Augrain
5d9b1abe82 allow markdown image syntax 2018-10-09 01:18:19 +02:00
Baptiste Augrain
7a5a821f8a fix failing test 2018-10-09 00:47:37 +02:00
Baptiste Augrain
0b9635c160 remove unused variable 2018-10-09 00:28:51 +02:00
Baptiste Augrain
555ae327b6 alternate background color for table rows 2018-10-09 00:25:04 +02:00
Baptiste Augrain
944c79ec61 disable hyperlink for attachments 2018-10-08 16:04:16 +02:00
Baptiste Augrain
39eaed260a display correctly attached image 2018-10-08 15:57:42 +02:00
Baptiste Augrain
f308836264 add new fenced block language: gallery 2018-10-02 23:48:07 +02:00
Baptiste Augrain
623688c28e move down the tag list of the autocomplete 2018-10-02 18:29:42 +02:00
Nguyễn Việt Hưng
8936d8b517 updated to code to pass test 2018-10-02 21:43:45 +07:00
Nguyễn Việt Hưng
14fec7473a added linethrough checkbox and make it optional 2018-10-02 20:52:51 +07:00
jacobherrington
33b40bf35f Add notification for copying snippets 2018-10-02 05:26:30 -05:00
Baptiste Augrain
e52bcf33c5 add precommit command 2018-10-01 18:54:50 +02:00
Baptiste Augrain
fa6c504b34 fix lint error 2018-10-01 18:42:18 +02:00
Baptiste Augrain
e9dac8c8f3 fix scrolling in note list 2018-10-01 18:16:26 +02:00
jacob
52bea8f808 Change French translations
Follow up on more PR feedback
2018-10-01 10:30:50 -05:00
jacob
39ce706f3e Change French translations
Following up on PR feedback
2018-10-01 09:48:16 -05:00
jacobherrington
d0171a8933 Remove package-lock.json 2018-10-01 09:27:22 -05:00
samherrington
9f75d2fe4b Resolve merge conflicts 2018-10-01 09:24:56 -05:00
Sam Herrington
9dfc6c2bc1 Update HotkeyTab.js to satisfy CI 2018-10-01 09:24:56 -05:00
Sam Herrington
025e778252 Update HotkeyTab.js
Saving a blank hotkey will now display a success message when the user saves the setting with the empty Show/Hide Boostnote hotkey.
2018-10-01 09:24:05 -05:00
Sam Herrington
c761f631a1 Update HotkeyTab.js to satisfy CI 2018-10-01 09:24:05 -05:00
samherrington
e173117a44 Fix errors when saving a blank hotkey
Saving a blank hotkey showed false error even though hotkey was
saved. This solution solves the issue as it stands, but I
would recommend looking into cleaning up the error handling
surrounding this functionality before adding any new hotkey
fields.
2018-10-01 09:24:05 -05:00
jacob
1ff4206bed Capitalize Boostnote 2018-10-01 00:14:44 -05:00
jacob
babc5626a9 Update ISSUE_TEMPLATE.md 2018-10-01 00:07:15 -05:00
jacobherrington
b624c9a4d2 Add French translations 2018-09-30 22:17:11 -05:00
jacobherrington
d83feafcb2 Add French translation of Delete Note 2018-09-30 21:10:47 -05:00
jacobherrington
cc1cb5fbc7 Add English translation for Delete Note 2018-09-30 21:02:41 -05:00
jacobherrington
80666fed1a Add UI to change deleteNote hotkey 2018-09-30 20:58:56 -05:00
jacobherrington
db2c6c99f7 Change default hotkeys
Setting the default hotkeys to be more consistent on OS X (using
the Alt notation as opposed to the Option notation).
2018-09-30 20:44:23 -05:00
jacobherrington
3f1fa44ee7 Add a default hotkey for deleteNote 2018-09-30 20:19:22 -05:00
jacobherrington
4717e4fe3f Add an event for deletion hotkey 2018-09-30 20:17:10 -05:00
jacobherrington
ffc390d49d Reset default hotkey on OS X
This shouldn't have been committed it was for testing. This commit
resets it to the original hotkey.
2018-09-30 18:30:34 -05:00
jacobherrington
002e7ab9dd Fix bug caused by poor regex 2018-09-30 18:26:36 -05:00
Sam Herrington
ca69bd69f2 Remove unnecessary conditional logic
In reference to PR feedback.
2018-09-30 17:46:38 -05:00
jacobherrington
3e2a366dc6 Add a Copy button the Snippets tab 2018-09-30 16:57:58 -05:00
Baptiste Augrain
d365aaf270 fix graphical bugs 2018-09-30 23:21:48 +02:00
Baptiste Augrain
818ee16e39 update codemirror 2018-09-30 22:41:49 +02:00
Baptiste Augrain
533caba717 Merge branch 'master' into text-deflist 2018-09-30 22:29:18 +02:00
Baptiste Augrain
cae6fd45b3 Merge branch 'master' into tags 2018-09-30 22:26:49 +02:00
William Grant
8c268be823 Merge branch 'master' into dracula_theme
# Conflicts:
#	browser/components/TodoListPercentage.styl
#	browser/main/Detail/TagSelect.styl
2018-09-30 22:16:25 +02:00
Baptiste Augrain
17845428bd Merge branch 'fence-attrs' into chart-yaml 2018-09-30 21:46:09 +02:00
Baptiste Augrain
efd1b3cd3c Merge branch 'master' into fence-attrs 2018-09-30 21:33:02 +02:00
Junyoung Choi (Sai)
2ccd00a378 Merge pull request #2322 from youngyou/fix-drop-image-rotate
Fix drop image rotate wrong
2018-10-01 03:48:54 +09:00
Junyoung Choi (Sai)
0123a99b5d Merge pull request #2428 from yougotwill/monokai_theme_fixes
Monokai theme fixes
2018-10-01 03:28:31 +09:00
Junyoung Choi (Sai)
ac744fbd90 Merge pull request #2435 from jacobherrington/handle-opt-in-hotkeys
Allow abbreviation for Option in hotkeys
2018-10-01 03:21:25 +09:00
Junyoung Choi (Sai)
10a1104073 Merge pull request #2436 from jacobherrington/bug-missing-relative-timestamp-inside-storages
Display timestamp on all notes
2018-10-01 03:04:13 +09:00
Junyoung Choi (Sai)
a39a856f69 Merge pull request #2439 from jacobherrington/patch-2
Bring readme up to date and fixup for grammar
2018-10-01 02:39:28 +09:00
Junyoung Choi (Sai)
e6e69b4fd2 Merge pull request #2442 from jacobherrington/unsaved-changes-copy
Change You Have to Save! copy to Unsaved Changes!
2018-10-01 02:35:54 +09:00
Junyoung Choi (Sai)
b4de1b49f2 Merge pull request #2431 from jacobherrington/tweak-the-crowdfunding-copy
Rewrite the crowdfunding copy
2018-10-01 02:23:06 +09:00
Junyoung Choi (Sai)
c47428b27f Merge pull request #2437 from jacobherrington/change-default-mac-hotkeys
Change Toggle Editor Mode hotkey on OS X
2018-10-01 02:14:43 +09:00
Junyoung Choi (Sai)
d267a78416 Merge pull request #2429 from jacobherrington/bug/capitalize-toggle-editor-mode
Capitalize settings labels
2018-10-01 02:13:49 +09:00
Junyoung Choi (Sai)
04bb04a6a9 Merge pull request #2418 from ehhc/right_click_preview
Implementing a context menu handler to show an attachment in the expl…
2018-10-01 02:13:20 +09:00
Junyoung Choi (Sai)
8eb535169f Merge pull request #2412 from brapifra/brais/folderitem-text-overflow
Add text-overflow: ellipsis to FolderItem
2018-10-01 01:59:15 +09:00
Junyoung Choi (Sai)
e0e0fbf739 Merge pull request #2410 from jacobherrington/chore/change-storage-header
change storage header from Storages to Storage Locations
2018-10-01 01:58:05 +09:00
Junyoung Choi (Sai)
4f8e8ae7b9 Merge pull request #2389 from ehhc/fix_admonitions
fix admonitions -> use the "legacy" types and pass them as options to…
2018-10-01 01:56:29 +09:00
Junyoung Choi (Sai)
15b77482ac Merge pull request #2406 from daiyam/fix-input-position
fix input position when going fullscreen or resizing splitEditor
2018-10-01 01:55:51 +09:00
Junyoung Choi (Sai)
7420363adf Merge pull request #2404 from jacobherrington/chore/improve-error-message-grammar
improve error message grammar
2018-10-01 01:51:42 +09:00
Junyoung Choi (Sai)
1666e3a58a Merge pull request #2403 from jacobherrington/patch-1
Clarify contributing.md
2018-10-01 01:51:26 +09:00
Junyoung Choi (Sai)
adbe85cc33 Merge pull request #2402 from jacobherrington/bug/right-click-should-not-copy-note
fix a bug causing right click to copy a note -- fixes #1833
2018-10-01 01:50:40 +09:00
Junyoung Choi (Sai)
89d8d36ec3 Merge pull request #2400 from daiyam/tag-autocomplete-snippet
fix tag autocomplete in snippet note
2018-10-01 01:50:00 +09:00
Junyoung Choi (Sai)
a631adacb5 Merge pull request #2386 from Rxbsxn/fix-notifaction-in-interface
Make notification sticky to the Save button
2018-10-01 01:07:13 +09:00
Junyoung Choi (Sai)
3384d1b7c3 Merge pull request #2371 from daiyam/tag-clickable
Tags over the editor are clickable
2018-10-01 01:06:27 +09:00
jacobherrington
f70de60672 Change You Have to Save! copy to Unsaved Changes! 2018-09-30 08:45:50 -05:00
jacob
cfd54c3f0e Bring readme up to date and fixup for grammar 2018-09-29 23:33:30 -05:00
jacobherrington
b29c0fe8cb Fix TypeError thrown on the Snippets page
This commit protects from a TypeError that is consistently
thrown on the Snippets page.
2018-09-29 23:17:19 -05:00
jacobherrington
5c1e5e0fcc Correct a typo in the crowdfunding copy 2018-09-29 22:44:55 -05:00
jacobherrington
8ec56390c4 Change Toggle Editor Mode hotkey on OS X
By default the Toggle Editor Mode hotkey was set to Command + M,
which is a great and mnemonic hotkey. Unfortunately that hotkey
is also the hotkey to minimize an application.

This commit changes the default Toggle Editor Mode hotkey to
Command + Option + M on OS X, which will not minimize the window
and maintains the mnemonic pattern.
2018-09-29 22:37:04 -05:00
samherrington
2ad27e175c Display timestamp on all notes
Notes inside My Storage did not display timestamp of last edit,
this commit makes the timestamp consistent across all notes in
all locations.
2018-09-29 18:25:00 -05:00
jacobherrington
da1bd3f1fd Allow abbreviation for Option in hotkeys
This commit allows a user to use 'Opt' as an abbreviation
for Option when setting a hotkey.
2018-09-29 16:54:22 -05:00
samherrington
dd913279d7 Fixup for errors 2018-09-29 15:57:02 -05:00
samherrington
1246a677d1 Remove console.logs
Using console in production is generally undesirable due to
performance loss and security concerns. Errors were changed
to console.error and console.logs were removed.
2018-09-29 15:50:32 -05:00
jacobherrington
43f2fc0740 Rewrite the crowdfunding copy
Some of the grammar needed to be revisted, and there were a
few opportunities to communicate a more genuine message.
2018-09-29 00:16:39 -05:00
jacobherrington
b821209807 Capitalize Code block Theme copy 2018-09-28 22:54:54 -05:00
jacobherrington
39fc5da98f Capitalize Toggle editor mode in preferences
All of the other options are in Title Case so it makes sense to
change this option's label to Title Case as well.
2018-09-28 21:32:59 -05:00
William Grant
504b6af3f6 fixed TodoListPercentage styling 2018-09-28 17:58:30 +02:00
William Grant
b3ede3230c Fixed the TodoListPercentage styling, reverted tag color back to the default button color 2018-09-28 17:53:13 +02:00
ehhc
7035503fa7 using file-to-uri to remove the 'file://'-prefix.. might solve the linux issues 2018-09-28 16:56:23 +02:00
ehhc
7d147fd040 Implementing a context menu handler to show an attachment in the explorer 2018-09-26 13:30:15 +02:00
William Grant
2a44e0b7eb updated the toggleModeButton styling 2018-09-24 17:52:26 +02:00
William Grant
686b9bc82c cleanup duplicated code 2018-09-24 17:46:31 +02:00
William Grant
0c1497a255 Updated NoteItem Styling, fixed NoteItemSimple styling, Changed the tag color based on the monokai color palette, 2018-09-24 17:45:28 +02:00
William Grant
496090610f updated tag color to cyan, fixed togglemodebutton styling 2018-09-24 17:20:01 +02:00
William Grant
16177754d5 fixed togglemodebutton styling 2018-09-24 17:16:56 +02:00
William Grant
f41f4939bc fix for the new folder modal 2018-09-23 17:10:39 +02:00
William Grant
610503472a finished styling 2018-09-23 16:35:26 +02:00
Brais Piñeiro
5dcd74b3b0 FolderItem/StorageItem: Use flex layout 2018-09-23 11:13:45 +01:00
samherrington
305825da78 Change My Storages to My Storage Location to mirror Add Storage Location option 2018-09-22 18:01:48 -05:00
William Grant
205451a31d initial work for dracula theme done 2018-09-22 17:17:22 +02:00
Brais Piñeiro
f1ae04fd07 Add text-overflow: ellipsi to FolderItem. Fixes #2409 2018-09-20 00:12:38 +01:00
jacobherrington
4ba82275b9 change storage header from Storages to Storage Locations 2018-09-18 10:17:14 -05:00
ehhc
093920173e Update markdown.js 2018-09-18 09:33:17 +02:00
ehhc
2c3d95a4db Merge branch 'master' into fix_admonitions 2018-09-18 09:29:53 +02:00
Baptiste Augrain
76928e43a3 - add data-line attribute to definition lists and lists
- add tests
2018-09-17 22:46:20 +02:00
Baptiste Augrain
a816c5dc23 fix test 2018-09-17 21:45:59 +02:00
Baptiste Augrain
5ef84e4bfc fix input position when going fullscreen or resizing splitEditor 2018-09-17 21:39:57 +02:00
Baptiste Augrain
fbdc9c9f8d add data-line attribute to fenced blocks 2018-09-17 17:25:37 +02:00
Martin Price
6510152138 Always redirect to /home when jumping to a note by hash
The note which we are jumping to may not be available in the note list for a number of reasons (e.g. if there is an active search, or if another storage folder is selected, or if the note list is showing starred notes).

This affects both when we are creating a new note (which may not match the current search criteria), and when jumping to a note via a link in another note (and the linked note may not be available for any of the above reasons).

2241
2018-09-17 11:55:01 +01:00
jacobherrington
df0c6a3b94 improve error message grammar 2018-09-16 11:58:20 -05:00
jacobherrington
dfe0d74845 remove code finding the selected note 2018-09-16 11:22:35 -05:00
jacob
b9edd0238d Clarify contributing.md
Improved some of the grammar mistakes and wording of the English portion. There are still a few things that are hard to understand.
2018-09-15 17:38:21 -05:00
jacobherrington
bf72237b38 fix a bug causing right click to copy a note 2018-09-15 17:12:54 -05:00
Baptiste Augrain
a24f6e80c7 fix styling of lineNumber and filename with big sized font 2018-09-15 18:57:31 +02:00
Baptiste Augrain
297c764fe1 - avoid logging to console, the error when the diagram syntax is bad
- fix line numbering of code blocks
2018-09-15 18:33:02 +02:00
Baptiste Augrain
b03c2a1f80 fix XSS bug 2018-09-15 15:24:59 +02:00
Baptiste Augrain
7af77384e7 Merge branch 'master' into fence-attrs 2018-09-15 15:04:55 +02:00
Baptiste Augrain
bacbfc8615 add test 2018-09-15 10:43:41 +02:00
Baptiste Augrain
c8466e9fa6 Merge branch 'master' into bug-1992 2018-09-15 10:27:21 +02:00
Baptiste Augrain
4a231d6fdb fix tag autocomplete in snippet 2018-09-15 10:24:31 +02:00
Baptiste Augrain
4e80e1dd03 Merge branch 'master' into tags 2018-09-15 10:05:38 +02:00
Baptiste Augrain
e0b18c6868 Merge branch 'master' into tag-clickable 2018-09-15 09:58:49 +02:00
Baptiste Augrain
15b9f8e13f Merge branch 'master' into text-deflist 2018-09-15 09:47:42 +02:00
Junyoung Choi (Sai)
03b8dbbc44 Merge pull request #2381 from Antogin/dev
Escape Pipe character when inserting a URL into a table
2018-09-15 13:26:02 +09:00
Junyoung Choi (Sai)
80af8dcf80 Merge pull request #2382 from daiyam/link-clickable
Links are clickable
2018-09-15 13:24:37 +09:00
Junyoung Choi (Sai)
62b2856d29 Merge pull request #2369 from daiyam/default-new-note
Implementing option `ui.defaultNote`
2018-09-15 13:04:02 +09:00
Junyoung Choi (Sai)
7ab3ce91a1 Merge pull request #2281 from mbarczak/features/toc_generator
Automatic table of contents generation for Markdown
2018-09-15 12:36:54 +09:00
Junyoung Choi (Sai)
e040aeef55 Merge pull request #2337 from daiyam/bug-2321
fixing bug #2321
2018-09-15 12:35:57 +09:00
Junyoung Choi (Sai)
46df5a8fa7 Merge pull request #2292 from zhoufeng1989/master
Export  all markdown files in a storage
2018-09-15 12:34:47 +09:00
Junyoung Choi (Sai)
f61fbbaead Merge pull request #2347 from daiyam/front-matter
add support to front-matter
2018-09-15 12:31:12 +09:00
Junyoung Choi (Sai)
480f515114 Merge pull request #2363 from Rxbsxn/add-polish-language
Add Polish translations
2018-09-15 12:30:38 +09:00
Junyoung Choi (Sai)
e206e6babf Merge pull request #2329 from owazae/patch-2
Update contributing.md
2018-09-15 12:26:44 +09:00
Junyoung Choi (Sai)
eae4b52aa1 Merge pull request #2364 from djdany01/master
Improved ES translations
2018-09-15 12:26:12 +09:00
Junyoung Choi (Sai)
933f75f1ee Merge pull request #2327 from mikaoelitiana/fix-1155
Add osx touchbar support
2018-09-15 12:22:42 +09:00
Junyoung Choi (Sai)
f3c72e561a Merge pull request #2320 from daiyam/tag-autocomplete
add tag autocomplete
2018-09-15 12:00:22 +09:00
Baptiste Augrain
44d6374cfe remove use of overlayMode to be able to detect YAML mode in chart code block 2018-09-14 16:25:52 +02:00
Baptiste Augrain
eba13800ff Merge branch 'master' into chart-yaml 2018-09-14 16:17:50 +02:00
Junyoung Choi (Sai)
3942492f32 Merge pull request #2398 from BoostIO/update-readme
Add IssueHunt badge on Readme
2018-09-14 17:29:23 +09:00
Junyoung Choi (Sai)
fe323d5764 Merge branch 'master' into tags 2018-09-14 17:16:55 +09:00
Kazz Yokomizo
4740edfb1f Add IssueHunt badge on Readme 2018-09-14 14:35:23 +09:00
Junyoung Choi (Sai)
671dff060d Merge pull request #2312 from daiyam/table-editor
add smart table editor
2018-09-14 12:25:15 +09:00
Baptiste Augrain
4b0dc08426 highlight code block for chart.js 2018-09-14 00:03:33 +02:00
Baptiste Augrain
10ffa35b29 Merge branch 'fence-attrs' into chart-yaml 2018-09-13 12:29:41 +02:00
Baptiste Augrain
57fadacda0 update ava snapshots 2018-09-13 12:17:59 +02:00
Baptiste Augrain
5c186f30a8 add yaml format for chart 2018-09-13 12:00:08 +02:00
Baptiste Augrain
0a205f77b0 fix diagram's alignment 2018-09-13 11:46:09 +02:00
Baptiste Augrain
75a0f4373c fix fileName styling 2018-09-13 11:34:29 +02:00
Baptiste Augrain
189b245b1d add attributes to fence blocks 2018-09-13 11:07:19 +02:00
ehhc
0eae47c8be fix admonitions -> use the "legacy" types and pass them as options to the plugin. should fix #2379 2018-09-11 16:59:10 +02:00
Robert Harężlak
00607cb704 Make notifaction sticky to the button 2018-09-10 19:00:03 +02:00
ehhc
d79b6e094a export folder should also export the attachments -> fixes #2374 2018-09-09 17:41:51 +02:00
Baptiste Augrain
f9d5c86245 display invalid front-matter 2018-09-09 11:24:54 +02:00
Baptiste Augrain
a6a1291d0e use Cmd key for only macOS 2018-09-09 11:12:47 +02:00
Baptiste Augrain
49db1c8244 fix style to match table padding 2018-09-08 19:28:06 +02:00
Baptiste Augrain
dbe1721d50 use mousedown instead of click event to fix double caret 2018-09-08 19:12:53 +02:00
Baptiste Augrain
b55420e935 remove xOffset 2018-09-08 18:47:48 +02:00
Baptiste Augrain
2706df2b24 fix styling 2018-09-08 18:14:41 +02:00
Baptiste Augrain
90f791de1b front-matter must be delimited by --- 2018-09-08 10:43:02 +02:00
antogyn
c9db3f98d1 Escape Pipe symbols to prevent tables from braking 2018-09-07 13:44:32 +02:00
Antogin
bdfe233472 Merge pull request #1 from BoostIO/master
Merge updated
2018-09-07 11:17:03 +02:00
Daniel J. Pérez Nieto
d340aeb77d Update es-ES.json 2018-09-06 15:10:29 +02:00
Baptiste Augrain
2da1105ff8 make markdown links clickable 2018-09-06 14:57:44 +02:00
Daniel J. Pérez Nieto
e6e5036474 Update es-ES.json 2018-09-06 08:12:14 +02:00
igorjuraszek
609a1709c5 apply feedback 2018-09-06 00:47:39 +02:00
Robert Harężlak
2bb9607eea Merge pull request #1 from Rxbsxn/add-polish-language-by-wucian
Add polish language by wucian
2018-09-05 23:44:57 +02:00
igorjuraszek
ca32d05bb2 Merge branch 'add-polish-language' into add-polish-language-by-wucian 2018-09-05 23:44:16 +02:00
igorjuraszek
67a016add0 further corrections 2018-09-05 23:37:20 +02:00
Robert Harężlak
ea41dbb3bc Add missing keys 2018-09-05 23:30:34 +02:00
igorjuraszek
637090d259 minor polish translation fixes 2018-09-05 22:44:29 +02:00
igorjuraszek
911d65131a fix conflicts 2018-09-05 22:42:44 +02:00
Robert Harężlak
f4203263bb update translations 2018-09-05 22:36:48 +02:00
Robert Harężlak
79df5249ef update translations 2018-09-05 21:34:04 +02:00
Baptiste Augrain
ac71093888 tags are clickable 2018-09-05 18:08:47 +02:00
Baptiste Augrain
d15e0f9fe5 remove unnecessary console.log 2018-09-05 17:31:27 +02:00
Baptiste Augrain
d3861caf28 add label style for Theme and Language 2018-09-05 17:13:41 +02:00
Baptiste Augrain
1c8e379fdd add option for default new note 2018-09-05 17:08:39 +02:00
Daniel J. Pérez Nieto
d9783490ec New phrase from last commit
Added the new phrase from last commit.
2018-09-05 08:48:43 +02:00
Daniel J. Pérez Nieto
bb32c3a8d3 Improved es-ES translation. 2018-09-05 08:41:06 +02:00
Baptiste Augrain
bab7ec388c Merge branch 'master' into bug-2321 2018-09-04 23:48:37 +02:00
Baptiste Augrain
e2957192d0 Merge branch 'master' into bug-2335 2018-09-04 23:46:34 +02:00
Baptiste Augrain
3994c78365 Merge branch 'master' into bug-1992 2018-09-04 23:41:11 +02:00
Baptiste Augrain
bfd4d7ffe1 Merge branch 'master' into front-matter 2018-09-04 23:39:27 +02:00
Baptiste Augrain
cb2f18c078 Merge branch 'master' into tag-autocomplete 2018-09-04 23:37:15 +02:00
Baptiste Augrain
69a032c1cf Merge branch 'master' into tags 2018-09-04 23:35:34 +02:00
Baptiste Augrain
a287afb3e9 Merge branch 'master' into text-deflist 2018-09-04 23:33:01 +02:00
Robert Harężlak
da81f10e04 Add Polish translations 2018-09-04 21:39:14 +02:00
ehhc
786675a99b Merge branch 'master' into spellchecker 2018-09-04 11:36:27 +02:00
Baptiste Augrain
6603f46678 Merge branch 'master' into table-editor 2018-09-04 10:54:49 +02:00
Junyoung Choi (Sai)
fdfa3bb8f5 Merge pull request #2355 from yougotwill/statusbar_fix
Statusbar height fix
2018-09-04 17:42:12 +09:00
Junyoung Choi (Sai)
da204a27c5 Merge pull request #2345 from hsiehjack/bug-2007
Fix scroll for long table
2018-09-04 17:41:28 +09:00
Junyoung Choi (Sai)
e11a68afba Merge pull request #2352 from daiyam/issue-2349
add default language for snippet note
2018-09-04 17:41:11 +09:00
Junyoung Choi (Sai)
168b0f82dd Merge pull request #2344 from hsiehjack/bug-2289
Fix text not readable for Monokai theme while creating new folder
2018-09-04 17:40:37 +09:00
Junyoung Choi (Sai)
6715a54da2 Merge pull request #2304 from amedora/feature/2069-monokai
add Monokai style for SnippetTab
2018-09-04 17:38:51 +09:00
Junyoung Choi (Sai)
6b32b3ae80 Merge pull request #2313 from daiyam/editorconfig
add EditorConfig
2018-09-04 17:37:41 +09:00
Junyoung Choi
6a2242725d v0.11.9 2018-09-04 16:11:27 +09:00
Maciek
e9070fadab Refactoring : use object destructuring to retain file code style 2018-09-02 19:38:15 +02:00
Junyoung Choi (Sai)
1117e1b724 Merge pull request #2357 from BoostIO/revert-flickering-fix
Revert flickering fix
2018-09-01 16:56:11 +09:00
Junyoung Choi
d015b18c66 Revert flickering fix 2018-09-01 16:50:52 +09:00
William Grant
01641b5af4 fixed 2018-09-01 12:54:48 +10:00
Baptiste Augrain
7c0c81207b add test 2018-08-31 10:27:02 +02:00
Baptiste Augrain
c844b60941 fix lint errors 2018-08-30 18:00:19 +02:00
Baptiste Augrain
9f8246a26a add default language for snippet note 2018-08-30 17:52:50 +02:00
Baptiste Augrain
6d5141b60f fix lint errors 2018-08-29 19:29:57 +02:00
Baptiste Augrain
8b4a9dd325 add saveTagsAlphabetically option 2018-08-29 19:28:09 +02:00
Baptiste Augrain
5006aaae38 fix live note counts when multiple tags are selected 2018-08-28 01:44:33 +02:00
Maciek
1bb841d5c5 Create Markdown TOC at current cursor position
If there is no TOC in the current document, it's created at current
cursor position. Subsequent generation calls update TOC at existing
position.

Add additional tests with CodeMirror editor mock.
2018-08-28 00:51:49 +02:00
Baptiste Augrain
f57c4f390d fix lint errors 2018-08-27 23:16:21 +02:00
Baptiste Augrain
646151e020 allows compact definition lists 2018-08-27 19:12:28 +02:00
Baptiste Augrain
20f573c477 - hide front-matter in preview
- skip front-matter when looking for note's title
2018-08-27 10:06:20 +02:00
Baptiste Augrain
094e4c5da8 add support to abbreviations, subscript text, superscript text and definition lists 2018-08-27 02:41:56 +02:00
Jack Hsieh
7716880a6c Fix scroll for long table 2018-08-26 16:47:22 -07:00
Jack Hsieh
71605fb8fe Fix text not readable for Monokai theme while creating new folder 2018-08-26 09:36:00 -07:00
Baptiste Augrain
fa9d8b8881 replace awesomplete with React component react-autosuggest 2018-08-26 15:48:41 +02:00
zhoufeng1989
aa0566b8ca Update test cases for export storage, check content of exported notes. 2018-08-26 21:15:20 +12:00
Baptiste Augrain
2a838ebb0b fixing single quoted attributes 2018-08-26 00:14:29 +02:00
Baptiste Augrain
fabc975b20 - fix lint errors
- correctly parse self-closed tag
- fix naughty functions
2018-08-25 23:36:43 +02:00
Baptiste Augrain
3bdc88cecb fixing sanitization of inline html like (<kbd>) #1992 2018-08-25 23:14:05 +02:00
Baptiste Augrain
a591001761 add parameter to specify the height of the diagram, fixing #2335 2018-08-25 20:18:59 +02:00
ehhc
54717ea6f2 linter errors fixed 2018-08-25 18:45:13 +02:00
ehhc
ceca4c98a3 linter errors fixed 2018-08-25 18:39:29 +02:00
ehhc
39b4287c5e linter errors fixed 2018-08-25 18:34:21 +02:00
Baptiste Augrain
53923c9c87 filtering out the note's tags 2018-08-25 18:22:40 +02:00
Maciek
ede733888d Code style: remove redundant brackets from lambda expression 2018-08-25 17:59:04 +02:00
Baptiste Augrain
a79db03093 enable/disable the table editor without restarting the app 2018-08-25 17:51:40 +02:00
Baptiste Augrain
5c8254a9c4 fixing bug #2321 due to the unescaped characters # or ? in the route 2018-08-24 23:48:26 +02:00
owazae
2f7b62f710 Update contributing.md
Adding french translation
2018-08-23 14:48:33 +02:00
Mika Andrianarijaona
a19c13eb3c remove unused spacing 2018-08-22 18:14:31 +02:00
Mika Andrianarijaona
64d4cd84af send events when user click touchbar buttons 2018-08-22 18:09:55 +02:00
ehhc
734db58d85 Spellcheck - first try to fix #2176 2018-08-22 16:48:10 +02:00
Keyon U
2bbcb8ca89 Add comments for the “rotate fix” 2018-08-22 18:03:02 +08:00
Mika Andrianarijaona
07e810a231 init touchbar menu 2018-08-22 10:58:53 +02:00
Keyon U
48beb184df Fix drop image rotate wrong
Fix drag-drop image rotate wrong, as Jordan Thornquest mentioned in slack
2018-08-22 12:23:45 +08:00
Baptiste Augrain
f195e87568 update background color of markers 2018-08-21 11:52:46 +02:00
Baptiste Augrain
13d44ae56a fix lint errors 2018-08-21 11:19:46 +02:00
Baptiste Augrain
00b4874d09 add tag autocomplete 2018-08-21 10:57:25 +02:00
Maciek
5bb90babbc Add tests for Markdown TOC generator 2018-08-21 01:03:53 +02:00
Baptiste Augrain
7cde30d352 fix lint errors 2018-08-21 00:24:03 +02:00
Baptiste Augrain
73fbf49ba4 - show tags of note in alphabetical order
- enable live count of notes
2018-08-21 00:19:26 +02:00
Baptiste Augrain
b39ef5948b add EditorConfig 2018-08-20 20:30:49 +02:00
Baptiste Augrain
7cf9dda821 fix lint errors 2018-08-20 20:29:10 +02:00
Baptiste Augrain
657806c8cf add smart table editor 2018-08-20 20:14:45 +02:00
Kiryanenko Alexander
d61a218808 Merge branch 'master' into master 2018-08-20 14:14:02 +03:00
Junyoung Choi
039f73711a Update yarn.lock 2018-08-20 15:22:28 +09:00
Junyoung Choi (Sai)
6e885acf8c Merge pull request #2311 from BoostIO/update-build-document
Update build documents
2018-08-20 15:20:31 +09:00
Junyoung Choi
9ef07cea7a Update build documents 2018-08-20 15:19:40 +09:00
Junyoung Choi (Sai)
9e3b321aaf Merge pull request #2216 from ZeroX-DG/improve-dev-script
Improved dev script
2018-08-20 15:05:21 +09:00
Junyoung Choi (Sai)
21560701ea Merge pull request #2303 from daiyam/update-electron
update electron version
2018-08-20 14:58:49 +09:00
Junyoung Choi (Sai)
4556375174 Merge pull request #2284 from mikaoelitiana/feat-933
Add per-folder sort
2018-08-20 13:46:03 +09:00
Junyoung Choi (Sai)
91b5398b5a Merge pull request #2307 from modmod24/fix-todo-percentage
update todo percentage correctly #2267
2018-08-20 12:00:42 +09:00
Junyoung Choi (Sai)
eeb8016992 Merge pull request #2302 from daiyam/window-position
restore window position
2018-08-20 11:57:47 +09:00
Junyoung Choi (Sai)
736106be3a Merge pull request #2283 from ZeroX-DG/fix-snippet-list-bug
Fixed snippet list bug
2018-08-20 10:35:06 +09:00
Junyoung Choi (Sai)
f400568dc0 Merge pull request #2272 from ZeroX-DG/improve-theme
Improve sideNav scroll bar color
2018-08-20 10:24:48 +09:00
Junyoung Choi (Sai)
0ca96cba6e Merge pull request #2074 from max-buranbaev/blinking-markdown-crunch-fix
Blinking markdown crunch fix
2018-08-20 10:05:06 +09:00
Unknown
df4d837026 add todo status test 2018-08-18 14:38:07 +01:00
Unknown
760f84d7fa fix for 2267
todo percentage not updated correctly
2018-08-18 14:30:23 +01:00
amedora
ab35c3557f add Monokai style for SnippetTab 2018-08-16 16:36:00 +09:00
Baptiste Augrain
174a315e3f update electron version 2018-08-16 01:23:35 +02:00
Baptiste Augrain
0834313456 restore window position 2018-08-16 01:06:13 +02:00
Maciek
ce3b29085f Change menu position and accelerator for TOC gen.
Due to the fact, that submenu "Edit" is visible only in macOS,
let's move TOC generator to "File" menu. Also, change
accelerator to SHIFT+CTRL+T which is working without conflicts
and problems on all platforms.
2018-08-14 23:24:41 +02:00
zhoufeng1989
b93d7a204f Fix 2207 and 2273, add export for storage. 2018-08-14 12:38:31 +12:00
Unknown
df931e10c0 Merge remote-tracking branch 'BoostIO/master' 2018-08-12 17:53:03 +01:00
Mika Andrianarijaona
9572cb2d33 Fix default value of config.sortBy 2018-08-12 09:21:46 +02:00
Max Buranbaev
51e836f32a code style 2018-08-11 16:17:56 +05:00
Max Buranbaev
7fefbd88d0 Resolving conflict 2018-08-11 11:13:04 +00:00
Mika Andrianarijaona
cb956c5508 Use default value config.sortBy
- for new folders
- for folders with no config set
2018-08-11 11:44:22 +02:00
Mika Andrianarijaona
47b0086bf8 Add per-folder sort
- save sort configuration in `config.[folderKey].sortBy`
- use lodash ` _.get(config, [folderKey, 'sortBy'])` to avoid error
2018-08-11 11:36:36 +02:00
Maciek
3c14cc219e ESLint: fix let -> const warnings 2018-08-11 10:09:22 +02:00
Nguyễn Việt Hưng
b8d66e4a95 fixed snippet list bug 2018-08-11 09:20:04 +07:00
Maciek
7804a22984 Automatic table of contents generation for Markdown
Adds table of contents for any Markdown note or
Markdown snippet.
Consequent generations update existing TOC.
Generated TOC is case sensitive to handle #2067

Shortcut : CommandOrControl+Alt+T
Menu : Edit/Generate/Update Markdown TOC
2018-08-10 23:20:56 +02:00
Max Buranbaev
bfc1c93153 Merge branch 'master' into blinking-markdown-crunch-fix 2018-08-10 19:02:43 +05:00
Alexander
5bf3824f28 Fix 2018-08-10 15:15:19 +03:00
Alexander
dac23e38d9 Add support for converting to MD when paste HTML 2018-08-10 13:27:17 +03:00
Nguyễn Việt Hưng
404faf8a0b limited style for just side nav 2018-08-09 22:59:40 +07:00
Nguyễn Việt Hưng
4a7b0f4711 improved scroll bar color for default theme 2018-08-09 22:57:16 +07:00
Nguyen Viet Hung
dd62fca45d change dev-start to dev 2018-08-09 16:21:27 +07:00
Junyoung Choi (Sai)
79fb04126c Merge pull request #2214 from cdayjr/master
Fix for BoostIO/Boostnote#2204
2018-08-09 18:15:20 +09:00
Junyoung Choi (Sai)
39c9574ae3 Merge pull request #2257 from ehhc/Attachments_in_markdown_export_#1786
might fixes #1786 --> export attachments for markdown notes
2018-08-09 18:10:48 +09:00
Junyoung Choi (Sai)
38af257adf Merge pull request #2253 from mbarczak/master
Fix for issue #2088 :  snippet notes are not displaying in markdown
2018-08-09 18:07:29 +09:00
Junyoung Choi (Sai)
5aae9a4722 Merge pull request #2231 from yougotwill/mermaid_dark_theme_fix
Mermaid dark theme rendering fix
2018-08-09 17:54:54 +09:00
Junyoung Choi (Sai)
cfe3cae88d Merge pull request #2226 from sklein12/addSnippetToSearchScope
Add code snippets to search scope
2018-08-09 17:54:28 +09:00
Junyoung Choi (Sai)
612de84ac6 Merge pull request #2208 from enyaxu/feature/2132
New Feature: Shortcuts for focusing tag editor(CmdOrControl+Shift+T)(#2132)
2018-08-09 17:53:54 +09:00
Nguyen Viet Hung
33be597ef0 Delete package-lock.json 2018-08-09 15:50:07 +07:00
Junyoung Choi (Sai)
cc26fd80d7 Merge pull request #2235 from amedora/feature/1454-ditaa
add Ditaa support
2018-08-09 17:47:37 +09:00
Junyoung Choi (Sai)
c227a1ffec Merge pull request #2171 from yamash723/fixbug-html-export
Fix search value for html export path
2018-08-09 17:43:56 +09:00
Nguyen Viet Hung
f0df787bbe Fix escape codeblock (#2230)
* updated package-lock

* added fix and test for escape html in code block

* fixed markdown preview render bug

* updated comment in escape function

* improved escape function

* Delete package-lock.json
2018-08-09 17:08:52 +09:00
ehhc
09188bed48 might fixes #1786 --> export attachments for markdown notes 2018-07-30 18:09:02 +02:00
Maciek
4a3bcaba06 BUG FIX: Change the way of checking for empty array
The original condition : attachments !== [] always returns true,
for empty array, as well as for array with elements.
2018-07-28 22:25:10 +02:00
Maciek
1d1ab65edd BUG FIX: snippet notes are not displaying in markdown #2088
Fix for issue https://github.com/BoostIo/Boostnote/issues/2088.
In specific situation, when all below conditions are met :
- one of the snippets notes tabs is a Markdown tab,
- the migrateAttachments code is called on a snippet note,
- historical attachments location '/images' exists in snippet storage
  folder

Following exception is being thrown :
path.js:28 Uncaught TypeError: Path must be a string. Received undefined
The exception is a result of an undefined noteKey variable
(which is defined only for Markdown notes).
The solution is to skip migration of attachments for notes without
noteKey (which wouldn't be possible anyway, since noteKey is a
necessary for creating folder for attachments).
2018-07-28 22:23:14 +02:00
Junyoung Choi (Sai)
7330cdaf1c Merge pull request #2209 from yougotwill/info_box_fix
Trash infoPanel Fix
2018-07-28 23:34:46 +09:00
Junyoung Choi (Sai)
050a1fb6cf Merge pull request #2239 from narukami894/improve_jp_build_md
add and improve translation, fix typo
2018-07-28 23:33:56 +09:00
narukami894
1e8397cf17 add and improve translation, fix typo 2018-07-24 16:01:41 +09:00
amedora
59b53ece2b add Ditaa support (resolve #1454) 2018-07-23 11:16:20 +09:00
William Grant
16c62cd46f changed double quotes to single quotes 2018-07-21 19:31:40 +10:00
William Grant
eff56c2514 mermaid diagram rendering for dark themes is now fixed 2018-07-21 19:20:20 +10:00
yamash723
ee6b9a223f Change output path format of html file by platform 2018-07-21 15:25:09 +09:00
Chad Wade Day, Jr
acc6ea434a Merge remote-tracking branch 'upstream/master' 2018-07-20 11:45:36 -07:00
Steve Klein
1e5a7356f4 Add code snippets to search scope 2018-07-20 02:00:11 -07:00
Nguyễn Việt Hưng
4c8342c19d updated dev script 2018-07-19 17:04:55 +07:00
Nguyễn Việt Hưng
dad5232ecb updated package-lock 2018-07-19 16:55:19 +07:00
Junyoung Choi
6cad2ab4df v0.11.8 2018-07-19 15:21:35 +09:00
Chad Wade Day, Jr
be972781ee Fix for BoostIO/Boostnote#2204 2018-07-18 11:58:54 -07:00
William Grant
58fbc298b1 Merge branch 'master' into info_box_fix 2018-07-17 14:41:45 +02:00
William Grant
7de7772339 Fixed infoButton panel in trash positioning 2018-07-17 14:41:22 +02:00
JianXu
ad847a2f5d New Feature: Shortcuts for focusing tag editor(CmdOrControl+T) 2018-07-17 17:19:03 +08:00
Junyoung Choi (Sai)
856d52891c Merge pull request #2205 from saaguero/fix-attachment
Fix attachment interoperability between win and *nix
2018-07-17 16:23:16 +09:00
Junyoung Choi
8de3b3bd8d Update yarn.lock 2018-07-17 15:55:03 +09:00
Junyoung Choi (Sai)
0414483be2 Merge pull request #2178 from enyaxu/feature/2165
Hotkey for toggle editor fullscreen
2018-07-17 14:49:03 +09:00
Junyoung Choi (Sai)
22939aa472 Merge pull request #2145 from amedora/table-formatter
Markdown Table Formatter
2018-07-17 13:50:00 +09:00
Junyoung Choi (Sai)
0cb7c44985 Merge pull request #2168 from enyaxu/bug/2018
Fixed 'Focus Search' shortcut
2018-07-17 13:35:44 +09:00
Junyoung Choi (Sai)
b18a09e5eb Merge pull request #1935 from ZeroX-DG/allow-no-html-escape
Allow customizing html escape when export note
2018-07-17 12:38:14 +09:00
Junyoung Choi (Sai)
ef3649b1d6 Merge pull request #2172 from enyaxu/feature/862
Add chartjs support
2018-07-17 12:21:31 +09:00
Junyoung Choi (Sai)
ac70a0d94d Merge branch 'master' into feature/862 2018-07-17 12:21:17 +09:00
Junyoung Choi (Sai)
3b91f9b88b Merge pull request #2173 from enyaxu/feature/389
Add mermaid support
2018-07-17 12:15:36 +09:00
Santiago Agüero
c37b780ca4 Use markdown content for migrateAttachments 2018-07-17 00:13:13 -03:00
Junyoung Choi (Sai)
20061d2c65 Merge pull request #2183 from max-buranbaev/flickering-on-create-note
Flickering on create note
2018-07-17 11:54:33 +09:00
Junyoung Choi (Sai)
f18fa77c1c Merge pull request #2187 from ivanovserge/issue-2156
Issue 2156
2018-07-17 11:49:39 +09:00
Junyoung Choi (Sai)
a4c6869d4d Merge pull request #2192 from enyaxu/improvement/2133
Replace shortcut for 'Next Note' and 'Previous Note'
2018-07-17 11:46:08 +09:00
Junyoung Choi (Sai)
f9a0070c82 Merge pull request #2197 from chang/improve-bracket-completion
Improve bracket autoclosing
2018-07-17 11:20:27 +09:00
Santiago Agüero
5cc52f91cb Fix lint errors 2018-07-15 12:07:27 -03:00
Santiago Agüero
a46b9fb2be Fix attachment interop between win and nix 2018-07-15 01:37:47 -03:00
Eric
933e38eca9 improve bracket autoclosing 2018-07-09 18:37:54 -05:00
JianXu
e182390480 Replace shortcut for 'Next Note' and 'Previous Note' 2018-07-07 23:02:17 +08:00
Nguyễn Việt Hưng
563fdcba94 added tests escape html function 2018-07-07 00:07:17 +07:00
Nguyễn Việt Hưng
bc640834cd allow detect code block or not in escapeHtml function 2018-07-06 23:45:18 +07:00
Junyoung Choi (Sai)
0e9e7d644a Merge pull request #2191 from BoostIO/fix-codefence-xss
Add sanitization for code fence
2018-07-07 01:23:23 +09:00
Junyoung Choi
1d9b3ac2b5 Add sanitization for code fence 2018-07-07 01:22:11 +09:00
Junyoung Choi (Sai)
aebed4a644 Merge pull request #2033 from ZeroX-DG/fix-scrollbar-disappear
fixed disappearing scroll bar
2018-07-07 00:47:14 +09:00
Junyoung Choi
7bfb094a40 use lighter color for scroll bar 2018-07-06 22:07:06 +09:00
Kazz Yokomizo
f90a44c1d0 Merge pull request #2189 from BoostIO/update-readme
Update readme
2018-07-06 15:55:25 +09:00
Kazz Yokomizo
dfcf6d2729 Update readme 2018-07-06 15:37:10 +09:00
Сергей Иванов
806a5daa86 Processing all location's pathnames 2018-07-05 11:23:57 +03:00
Сергей Иванов
4a3602099a Difference home and searched notes from trashed units 2018-07-04 16:09:49 +03:00
Сергей Иванов
c69be54655 Fixing empty string searching 2018-07-04 14:02:26 +03:00
Сергей Иванов
680eaa1d4a Filtering displayed notes in Detail component 2018-07-04 13:33:47 +03:00
Nguyễn Việt Hưng
9cc7b8bcc6 fixed redundant code 2018-07-04 15:35:46 +07:00
Nguyễn Việt Hưng
55d86d853a improved escape function 2018-07-04 15:27:30 +07:00
Nguyễn Việt Hưng
7d9f309e04 Merge remote-tracking branch 'upstream/master' into allow-no-html-escape 2018-07-04 13:50:10 +07:00
Nguyễn Việt Hưng
c2f0147cff updated new escape html function 2018-07-04 13:50:05 +07:00
JianXu
05488e66ae Add tooltip(CommandOrCtrl+B) for fullscreen 2018-07-04 11:38:43 +08:00
JianXu
09eac89086 Hotkey for toggle editor fullscreen 2018-07-04 09:59:06 +08:00
JianXu
866a0e7534 Add mermaid support 2018-07-03 15:10:08 +08:00
ehhc
4307db11c5 Merge branch 'master' of https://github.com/BoostIO/Boostnote into spell_check
# Conflicts:
#	browser/components/CodeEditor.js
#	locales/fr.json
#	package.json
2018-07-03 09:05:47 +02:00
Max Buranbaev
3c8337cf54 adding timeout one creating a snippet 2018-07-03 10:29:22 +05:00
Max Buranbaev
883b4c4c26 adding timeout on creating a note 2018-07-03 10:27:13 +05:00
JianXu
6bc42c564d Add chartjs 2018-07-03 12:58:45 +08:00
yamash723
4f79f52524 Fix search value for html export path 2018-07-03 10:03:31 +09:00
ehhc
83f8151ca4 spellcheck -> context menu with spelling suggestions 2018-07-02 17:27:47 +02:00
JianXu
d2b2e76a6a Fixed 'Focus Search' shortcut 2018-07-02 21:43:46 +08:00
Sosuke Suzuki
9d9109e9e5 Merge pull request #2158 from BoostIO/fix-contextmenu-bug
Fix contextmenu bug
2018-07-02 11:27:28 +09:00
Kazz Yokomizo
18efb89b9a Merge pull request #2163 from BoostIO/update-slack
Update slack invitation url
2018-07-01 22:02:52 +09:00
Kazz Yokomizo
cefe883025 Update slack invitation url 2018-07-01 21:59:08 +09:00
Sosuke Suzuki
0ffa0b96d3 Merge pull request #2135 from BoostIO/improve-snippets-ui
Improve snippets ui
2018-06-30 20:11:33 +09:00
Sosuke Suzuki
0429acfa1b Merge pull request #2138 from BoostIO/improve-uitab-editor
Improve uitab editor
2018-06-30 20:11:20 +09:00
Sosuke Suzuki
827e3c1829 Merge pull request #2144 from kelvin-wong/retain-collapsed-storage-state
Add collapsed state for storage
2018-06-30 20:11:01 +09:00
Sosuke Suzuki
aa756ef194 Merge pull request #2146 from BoostIO/update-codemirror
update codemirror
2018-06-30 20:10:13 +09:00
Sosuke Suzuki
d8aad65b24 fix from eslint 2018-06-30 16:28:17 +09:00
Sosuke Suzuki
1038e86196 use context.popup on StatusBar 2018-06-30 16:25:44 +09:00
Sosuke Suzuki
47845fd4e3 use context.popup on SideNav 2018-06-30 16:23:51 +09:00
Sosuke Suzuki
294c3f10ab use context.popup on StorageItem 2018-06-30 16:21:35 +09:00
Sosuke Suzuki
f6afc756dc use context.popup on SnippetList 2018-06-30 16:16:18 +09:00
Sosuke Suzuki
64407e5ca6 use context.popup on SnippetNoteDetai; 2018-06-30 16:12:23 +09:00
Sosuke Suzuki
0a42b0f61f use context.popup on NoteList 2018-06-30 16:08:13 +09:00
Junyoung Choi
ae493cbd0e v0.11.7 2018-06-30 00:51:15 +09:00
Kelvin Wong
ddd339851b Fix code style 2018-06-29 10:58:11 +08:00
amedora
82db986bd7 add 'Format Table' in the File menu 2018-06-28 18:16:38 +09:00
amedora
7bacd6f8f0 CodeEditor can handle 'code:format-table' event 2018-06-28 18:16:38 +09:00
amedora
f0941f47dd create TableEditor when CodeEditor mounted 2018-06-28 18:09:06 +09:00
amedora
c9d05b1117 CodeEditor use TableEditor 2018-06-28 18:09:06 +09:00
amedora
7ee12752ec CodeEditor use TextEditorInterface 2018-06-28 18:09:06 +09:00
amedora
b44772441d implement TextEditorInterface 2018-06-28 18:09:06 +09:00
Sosuke Suzuki
72e3784fa5 update codemirror 2018-06-28 17:37:36 +09:00
Max Buranbaev
2c7f24cb8c Debouncing of rendering due to flickering fix 2018-06-28 13:03:12 +05:00
Kelvin Wong
8a6c86bf65 Add collapsed state for storage
The root cause of this issue is that when the folder is clicked,
the router pushed the path and the StorageItem component has been
refreshed and isOpen has been reset

- Add storing collapse state for storage
- Add tests
- Default as collapsed for fallback

fix BoostIo/Boostnote#1979 BoostIo/Boostnote#1911
2018-06-28 13:08:39 +08:00
amedora
cc52cf60dc add reference to @susisu/mte-kernel 2018-06-28 13:36:04 +09:00
Max Buranbaev
398ebae2ba Merge branch 'master' into blinking-markdown-crunch-fix 2018-06-27 14:21:34 +00:00
Sosuke Suzuki
0095735841 fix from eslint 2018-06-27 20:42:19 +09:00
Sosuke Suzuki
95c10a1de7 add test 2018-06-27 20:42:01 +09:00
Sosuke Suzuki
8f4c92e251 extract normalizeEditorFonrFamily 2018-06-27 19:48:09 +09:00
Sosuke Suzuki
58354061d8 set font-family to editor in Preference > Interface 2018-06-27 19:34:58 +09:00
Max Buranbaev
5de176757d Fixing flickering in both cases 2018-06-27 13:07:38 +05:00
Sosuke Suzuki
7414d52dc2 selected snippet item background-color is darken 2018-06-27 16:27:55 +09:00
Sosuke Suzuki
c42b5c8806 First snippet is selected when open Snippets tab 2018-06-27 16:13:42 +09:00
Sosuke Suzuki
5c60da0f8f apply style to each themes button 2018-06-27 15:59:14 +09:00
Junyoung Choi (Sai)
70d02e9a6d Merge pull request #2125 from johannbre/admonition_bug_fix
Fix rendering of admonitions in Windows
2018-06-27 14:50:54 +09:00
Junyoung Choi (Sai)
6401016424 Merge pull request #2122 from yosmoc/plant_uml_improvement
plantuml non-english character support and timing diagram support
2018-06-27 04:54:21 +09:00
Junyoung Choi (Sai)
cd031a89fb Merge pull request #2105 from romainwn/docs/add-missing-translations-fr
update fr translation
2018-06-27 04:52:52 +09:00
Junyoung Choi (Sai)
aadba79002 Merge pull request #2106 from voidsatisfaction/fix-typo-on-main-app
fix tiny comment typo
2018-06-27 04:43:53 +09:00
Junyoung Choi (Sai)
4a017fd8ae Merge pull request #2066 from PeterDaveHello/patch-1
Improve Traditional Chinese translation
2018-06-27 04:43:27 +09:00
Junyoung Choi (Sai)
e6072c8fe9 Merge pull request #2131 from clone1612/updateElectron
Update Electron to v2.0.3
2018-06-27 04:41:36 +09:00
Jannick Hemelhof
f7fd99ec20 Update electron to v2.0.3 2018-06-26 11:27:37 +02:00
Junyoung Choi (Sai)
836fc13449 Merge pull request #2124 from clone1612/remove-unused
[Refactoring] - Removed unused packages
2018-06-26 06:01:30 +08:00
Junyoung Choi (Sai)
e1f78cd682 Merge pull request #2107 from ehhc/fix_images
One more try to fix the handling of images in the legacy location
2018-06-25 21:33:19 +08:00
ehhc
c69f34836a handle dot in file name 2018-06-25 15:18:45 +02:00
Junyoung Choi (Sai)
48a0db28d7 Merge pull request #2127 from BoostIO/update-issue-template
Update issue template
2018-06-25 20:22:11 +08:00
Kazz Yokomizo
58eeb90158 Update issue template
Add IssueHunt url
2018-06-25 15:46:41 +09:00
Johann Breytenbach
c36689934d Fix rendering of admonitions in Windows 2018-06-24 22:04:36 -07:00
ehhc
342575a576 Spellcheck - Dropdown & localisation 2018-06-23 19:29:22 +02:00
ehhc
785272540e Spellcheck - liveSpellcheck 2018-06-23 18:16:39 +02:00
yosmoc
653b985018 plantuml non-english character support and timing diagram support 2018-06-23 14:02:46 +09:00
Junyoung Choi (Sai)
40d90a53b2 Merge pull request #2110 from BoostIO/fix-hotkeys
Rewrite invalid hotkeys when loading
2018-06-21 02:58:12 +09:00
Junyoung Choi
7c3aaff635 Rewrite invalid hotkeys when loading 2018-06-21 02:48:44 +09:00
Junyoung Choi (Sai)
4bb7929229 Merge pull request #2109 from voidsatisfaction/fix-M-key-issue
Fix MacOs 'M' key issue
2018-06-21 02:36:27 +09:00
voidsatisfaction
bdd5b7b3a7 fix: no need semicolon 2018-06-20 21:57:11 +09:00
voidsatisfaction
a2ddb56540 fix: change mode to more desiarable way 2018-06-20 21:45:24 +09:00
voidsatisfaction
7c0097951c fix: m key issue 2018-06-20 21:38:36 +09:00
ehhc
7970016fbf One more try to fix the handling of images in the legacy location 2018-06-20 08:48:55 +02:00
voidsatisfaction
129e3b283d fix tiny typo 2018-06-20 14:29:57 +09:00
Romain Le Quellec
868eefd2cf update fr translation 2018-06-19 22:20:17 +02:00
ehhc
82178055af Spellcheck - initialisation and first draft onChange 2018-06-17 17:13:44 +02:00
Sosuke Suzuki
c42e1a0ab4 Merge pull request #2054 from clone1612/electron-2-compatibility
Upgrade Electron to v2.0.2
2018-06-14 14:34:12 +09:00
Sosuke Suzuki
720475dae5 Merge pull request #2075 from yougotwill/info_box_fix
Fixed info panel positioning
2018-06-14 14:19:31 +09:00
Junyoung Choi
259df880ba v0.11.6 2018-06-14 11:02:20 +09:00
Jannick Hemelhof
68a328a364 Removed unused packages 2018-06-13 16:08:18 +02:00
William Grant
3bc21cdb09 fixed positioning of the info panel so it doesn't cover the info button 2018-06-13 12:19:17 +02:00
Sosuke Suzuki
9e8ef70510 Merge pull request #2064 from FlaPS/debounce-markdonw-search
#2042 Debounce for details renderig added
2018-06-12 19:52:36 +09:00
Sosuke Suzuki
5fd822a24d add a new line at end of file 2018-06-12 19:48:09 +09:00
Sosuke Suzuki
8ee4dbbb5c Merge pull request #2065 from FlaPS/fix-blinking-notes-list-on-search
Fix file list blinking on search
2018-06-12 19:38:26 +09:00
Sosuke Suzuki
9522a4d5d9 fix from eslint 2018-06-12 19:33:54 +09:00
Sosuke Suzuki
eefecdefbe Merge pull request #2062 from zhouxiaoxiaoxujian/bug-1977
Add new future resize editor & Preview Panes by dragging.(#1977)
2018-06-12 16:49:59 +09:00
Sosuke Suzuki
84e670e71c remove unnecesarray line 2018-06-12 16:42:18 +09:00
JianXu
c22b69234f fix review code style ,add new line at end of file 2018-06-12 14:12:59 +08:00
Peter Dave Hello
29cd63d3a7 Improve Traditional Chinese translation 2018-06-11 18:40:55 +08:00
JianXu
214ed388f2 remove unnecessary lines 2018-06-11 17:49:36 +08:00
JianXu
0bd3445370 use 'const' instead of 'let' 2018-06-11 17:49:20 +08:00
Kazz Yokomizo
002dc9b017 Merge pull request #2056 from zhouxiaoxiaoxujian/bug-#1945
Fixed Keyboard tag unvisible in monokai theme[#1945]
2018-06-11 14:55:13 +09:00
Kazz Yokomizo
ebf5a03f56 Merge pull request #2060 from yougotwill/dark_theme_empty_note_fix
[Dark Theme]: Fixes the text color for an active note with an empty title
2018-06-11 14:40:19 +09:00
Kazz Yokomizo
2797faafe5 Merge pull request #2058 from kawmra/remove-duplicated-line
Fix en.json
2018-06-11 14:37:21 +09:00
Kazz Yokomizo
84ac739993 Merge pull request #2057 from kawmra/add-some-ja-translations
Add missing Japanese translations
2018-06-11 14:36:44 +09:00
Kazz Yokomizo
13c37f046f Merge pull request #2059 from kawmra/fix-crowdfunding-button-style
Fix styles of button in crowdfunding tab
2018-06-11 14:25:54 +09:00
Shammasov Max
2631cc3747 Fix file list blinking on search 2018-06-11 03:46:39 +03:00
Shammasov Max
5873e8e896 Debounce for details renderig added 2018-06-11 03:34:45 +03:00
JianXu
6dc633c2a1 Add new future resize editor & Preview Panes by dragging.(#1977) 2018-06-10 23:46:01 +08:00
William Grant
8b07126285 Fixes the text color for an active note with an empty title 2018-06-09 14:18:44 +02:00
kawmra
93a120543a Add some Japanese translations 2018-06-09 20:02:22 +09:00
kawmra
af0aa4a567 Make button width flexible 2018-06-09 19:33:40 +09:00
kawmra
58fd1f0c46 Remove a duplicated line 2018-06-09 19:33:03 +09:00
JianXu
030041932e Fixed Keyboard tag unvisible in monokai theme[#1945] 2018-06-09 15:35:59 +08:00
Jannick Hemelhof
8dbf456398 Upgrade to Electron v2.0.2 2018-06-09 08:52:46 +02:00
Junyoung Choi (Sai)
3a90a078ce Merge pull request #2047 from BoostIO/fix-snippets-json-path
Fix wrong path of snippets.json
2018-06-08 15:56:40 +09:00
Junyoung Choi (Sai)
c30957fc9f Merge pull request #1969 from ZeroX-DG/add-zoom-window
added zoom in & zoom out window feature
2018-06-08 15:43:11 +09:00
Junyoung Choi
f6db946c9a Fix wrong path of snippets.json 2018-06-08 15:37:03 +09:00
Junyoung Choi (Sai)
c6c0d4c62a Merge pull request #2039 from Matts966/Hide-copy-to-clipboard-icon-when-printing
Hide copy-to-clipboard buttons when printing.
2018-06-08 15:25:18 +09:00
Junyoung Choi (Sai)
57befc4ccb Merge pull request #2002 from ehhc/paste_storage_link_should_clone_attachment
Copying the link to an attachment should make sure that it is located…
2018-06-08 15:24:28 +09:00
Junyoung Choi (Sai)
e716af75ed Merge branch 'master' into paste_storage_link_should_clone_attachment 2018-06-08 15:21:26 +09:00
Junyoung Choi (Sai)
efe2bea64b Merge pull request #2017 from onurpalaz/master
Added Turkish translation
2018-06-08 15:01:39 +09:00
Junyoung Choi
9b926326ef Add turkish to languages 2018-06-08 14:59:30 +09:00
Junyoung Choi (Sai)
de71033fe2 Merge pull request #2019 from yosmoc/fix_localfile_link
open local file by shell
2018-06-08 14:54:44 +09:00
Junyoung Choi (Sai)
2c10bf251d Merge pull request #1989 from kawmra/create-image-tag-when-pasting-image-url
Create a image tag when pasting image url
2018-06-08 14:50:09 +09:00
Junyoung Choi (Sai)
8af50aa5bd Merge pull request #1928 from hooklife/perfect-zh-CN
update locales/zh-CN
2018-06-08 14:03:52 +09:00
hooklife
05bedfe3d4 Update zh-CN.json 2018-06-07 17:12:52 +08:00
Junyoung Choi (Sai)
a1929dac8a Merge pull request #2041 from kawmra/fix-typo
Fix typo of MarkdownEditor.js
2018-06-07 15:44:03 +09:00
kawmra
834ecc643a Merge branch 'master' into create-image-tag-when-pasting-image-url
# Conflicts:
#	browser/components/CodeEditor.js
2018-06-07 03:01:08 +09:00
kawmra
60baabf7e7 Fix typo 2018-06-07 02:51:04 +09:00
松井誠泰
185a149d74 Hide copy-to-clipboard buttons when printing.
It is less confusing when printing because the pdf file does not have the function to copy.
2018-06-06 19:39:28 +09:00
ehhc
5d62dd2002 Merge branch 'master' of https://github.com/BoostIO/Boostnote into paste_storage_link_should_clone_attachment
# Conflicts:
#	browser/main/lib/dataApi/attachmentManagement.js
#	locales/da.json
#	locales/de.json
#	locales/en.json
#	locales/es-ES.json
#	locales/fa.json
#	locales/fr.json
#	locales/hu.json
#	locales/it.json
#	locales/ja.json
#	locales/ko.json
#	locales/no.json
#	locales/pl.json
#	locales/pt-BR.json
#	locales/pt-PT.json
#	locales/ru.json
#	locales/sq.json
#	locales/zh-CN.json
#	locales/zh-TW.json
2018-06-06 12:03:53 +02:00
hooklife
9eaa6b5cec Update zh-CN.json 2018-06-06 16:11:29 +08:00
hooklife
6ff03bbb95 Merge branch 'master' into perfect-zh-CN 2018-06-06 16:06:32 +08:00
Sosuke Suzuki
9fac6bca64 Merge pull request #1993 from ehhc/smart_arrows
Include markdown-it-smartArrow. Toggle it via settings and disable it…
2018-06-06 12:13:09 +09:00
Junyoung Choi (Sai)
88856b788a Merge pull request #1963 from ehhc/OnBlur_Throws_Exceptions_On_Snippet_Notes
OnBlur throws exceptions if the notetype is snippet -> Fixes #1962
2018-06-06 11:11:27 +09:00
Sosuke Suzuki
eda4e46d9f Merge pull request #2024 from kawmra/fix-yarn-lock
Fix yarn.lock file
2018-06-06 10:19:42 +09:00
Nguyễn Việt Hưng
0ae1263d9d abort 2018-06-06 00:25:49 +07:00
Nguyễn Việt Hưng
31f1ebe801 removed unnecessary style 2018-06-05 21:31:50 +07:00
Nguyễn Việt Hưng
c6a9c9c57d fixed disappear scrollbar 2018-06-05 21:24:37 +07:00
ehhc
35bcbbbae4 Merge branch 'master' into smart_arrows 2018-06-05 11:35:56 +02:00
ehhc
22e2c3da1f Merge branch 'master' of https://github.com/BoostIO/Boostnote into paste_storage_link_should_clone_attachment
# Conflicts:
#	browser/components/CodeEditor.js
#	browser/main/lib/dataApi/attachmentManagement.js
2018-06-05 11:28:42 +02:00
ehhc
b526d48946 CodeReview 2018-06-05 11:16:50 +02:00
Junyoung Choi (Sai)
91a95b7c20 Merge pull request #1955 from bimlas/update-electron
Update to the latest Electron version (1.8.7)
2018-06-05 09:59:59 +09:00
Sosuke Suzuki
d634e1124a Merge pull request #1996 from ZeroX-DG/custom-markdown-css
Added custom markdown css
2018-06-04 15:07:16 +09:00
Sosuke Suzuki
309e159df1 Merge pull request #1949 from ehhc/Fix_legacy_attachment_issues
Fix legacy attachment issues
2018-06-04 12:02:03 +09:00
ehhc
ffae53326a Fix for the issues raised in the code review 2018-06-04 11:55:23 +09:00
ehhc
ddd1522e19 Pasting an image should insert a relative attachment file link -> fixes #1953 2018-06-04 11:55:23 +09:00
ehhc
4bc0cccb24 Migrate attachments from /images to /attachments -> fix #1941 2018-06-04 11:55:23 +09:00
Nguyễn Việt Hưng
72fbefa300 moved custom markdown checkbox & fixed codemirror size 2018-06-03 08:51:53 +07:00
kawmra
30378eeb50 Remove unnecessary lines 2018-06-02 23:01:52 +09:00
kawmra
03293c0d25 Fix conflict of yarn.lock 2018-06-02 22:59:49 +09:00
Nguyễn Việt Hưng
2e3f6e39f6 fixed width of custom markdown editor 2018-06-02 11:30:12 +07:00
Junyoung Choi (Sai)
e4d4041c6b Merge pull request #1848 from ZeroX-DG/text-expansion-support
Text expansion support
2018-06-01 14:34:57 +09:00
yosmoc
166a5c10a7 open local file by shell 2018-05-31 22:55:10 +02:00
onurpalaz
1fec81cc3e Added Turkish translation
Added Turkish translation
2018-05-31 10:13:05 +03:00
ehhc
9c247bcb22 Copying the link to an attachment should make sure that it is located in the same note folder -> Fixes #1924 2018-05-29 17:20:14 +02:00
Nguyễn Việt Hưng
707356bffe revert to the original function for better performance 2018-05-29 18:15:57 +07:00
Nguyễn Việt Hưng
fc88a49acc disabled custom css by default 2018-05-29 11:52:00 +07:00
ehhc
8ccf490e9b Include markdown-it-smartArrow. Toggle it via settings and disable it by default since it might affect HTML comments in markdown 2018-05-28 23:05:08 +02:00
Nguyễn Việt Hưng
ea768f982e Added custom markdown css 2018-05-29 00:37:59 +07:00
Nguyễn Việt Hưng
172ea82954 fixed yarn.lock conflict 2018-05-28 15:19:10 +07:00
Nguyễn Việt Hưng
10500c3c1c changed all colors to variables & styled for monokai theme 2018-05-28 15:15:09 +07:00
ehhc
225916fbba Fix for the test broken by the merge commit 2018-05-28 09:57:07 +02:00
ehhc
2fce78422b Merge branch 'master' into OnBlur_Throws_Exceptions_On_Snippet_Notes 2018-05-28 09:00:57 +02:00
ehhc
8132dd6847 Fix for the issues raised in the code review 2018-05-28 08:58:09 +02:00
bimlas
4caee1e103 Update to the latest Electron version (1.8.7)
It inculdes security fixes, bug fixes and improvementts. See:
https://electronjs.org/releases

Reason for upgrading from 1.7.X to 1.8.X:

"We can not reasonably back port every bug fix and every feature to
older versions of Electron. 1.8.x is now a stable release line and if
you require this fix you should update to that stream."

https://github.com/electron/electron/issues/9860#issuecomment-365517773
2018-05-28 08:06:43 +02:00
Kazz Yokomizo
ca0b03e97c Merge pull request #1991 from BoostIO/slack-url
Update slack url
2018-05-28 14:55:39 +09:00
Kazz Yokomizo
f03178bb8d Update slack url 2018-05-28 14:51:57 +09:00
Sosuke Suzuki
d083a86138 Merge pull request #1932 from bimlas/fix-logic-of-state-notemap-set
Refactoring of store.js
2018-05-28 14:50:08 +09:00
Kazz Yokomizo
8216b992ea Merge pull request #1970 from HanDH/master
update locales/ko
2018-05-28 14:47:18 +09:00
Sosuke Suzuki
8e74ee7dde Merge pull request #1987 from johannbre/master
[Feature Request] - 1638 - Support for admonitions
2018-05-28 14:32:58 +09:00
Sosuke Suzuki
b207fe14df Merge pull request #1951 from yosmoc/update_cursor_position_after_link_extend
update cursor position after expanding the link
2018-05-28 14:25:42 +09:00
Sosuke Suzuki
92cfa21be6 Merge pull request #1933 from hooklife/fix-word-wrap
fix tooltip word wrap
2018-05-28 14:24:07 +09:00
hook life
5fd482428a add new line at last. 2018-05-28 13:12:18 +08:00
Sosuke Suzuki
98b09f7edc Merge pull request #1967 from yosmoc/external_link_opened_twice
open external browser once in clicking the link
2018-05-28 12:51:13 +09:00
Johann Breytenbach
7b83a34777 [Feature Request] - 1638 - Support for admonitions
Added support for markup admonitions by including markdown-it-admonition. Added material icon support and updates to styles for rendering of six different types of admonitions.
2018-05-27 20:47:44 -07:00
Sosuke Suzuki
aeb63ec901 Merge pull request #1983 from bimlas/i18n-apply-translations-on-hardcoded-strings
i18n: Apply translations on hardcoded strings and add missing translation to English
2018-05-28 11:23:18 +09:00
Sosuke Suzuki
436093e0b6 Merge pull request #1982 from bimlas/i18n-update-hungarian-translations
i18n: Update Hungarian translations
2018-05-28 11:21:18 +09:00
kawmra
d7ee06ce6d Fix lint error 2018-05-27 20:08:57 +09:00
kawmra
e72003009d Create a image tag when pasting image url 2018-05-27 19:42:41 +09:00
bimlas
cfe8235a36 i18n: Add missing translations to English 2018-05-26 11:51:51 +02:00
bimlas
8c1ac9c5b3 i18n: Update Hungarian translations 2018-05-26 11:49:02 +02:00
bimlas
77e3a7d43a i18n: Apply translations on hardcoded strings 2018-05-26 11:39:16 +02:00
bimlas
53728a0f4a Refactoring changing of folder 2018-05-25 23:16:23 +02:00
bimlas
06f33d9a63 Refactoring changing of "starred" 2018-05-25 23:16:23 +02:00
bimlas
ed2698ecc3 Refactoring removing of unique key from tags 2018-05-25 23:16:23 +02:00
bimlas
0cb5554ae5 Refactoring assignment of unique key to tags 2018-05-25 23:16:23 +02:00
bimlas
89850c0b22 Refactoring Set initialization methods 2018-05-25 23:16:23 +02:00
bimlas
d78b94f4e8 Refactoring update of tag changes 2018-05-25 23:16:23 +02:00
Nguyễn Việt Hưng
c2c50817f1 resolved conflict 2018-05-25 18:42:02 +07:00
Nguyễn Việt Hưng
680c2a2904 changed cssmodule & applied style for solarized dark theme 2018-05-25 18:39:11 +07:00
daehyun
a1085e3863 update locales/ko 2018-05-24 20:04:59 +09:00
Nguyễn Việt Hưng
37f6a05170 added zoom in & zoom out 2018-05-24 16:48:51 +07:00
Junyoung Choi (Sai)
0d296c3b25 Merge pull request #1936 from ehhc/delete_folder
deleting a folder should also delete the attachments -> fixes #1903
2018-05-24 14:45:47 +09:00
Junyoung Choi (Sai)
73caa2508e Merge pull request #1931 from bimlas/1498-refresh-taglist-on-deleting-tag
Refresh taglist to remove unused tags on deleting
2018-05-24 14:44:54 +09:00
Junyoung Choi (Sai)
69e012a6f0 Merge pull request #1939 from ehhc/cloning_a_note_should_clone_attachments
Cloning a note should clone attachments
2018-05-24 14:42:56 +09:00
Junyoung Choi (Sai)
21251a1915 Merge pull request #1965 from yosmoc/tooltip_size_position_fix
standardrize sidebar tooltips
2018-05-24 14:40:35 +09:00
Junyoung Choi (Sai)
67143ba2d5 Merge pull request #1929 from ZeroX-DG/shortcut-mode
Shortcut to toggle mode
2018-05-24 14:01:28 +09:00
yosmoc
d399cba4c0 onContextMenu PropType is missing 2018-05-24 00:24:25 +02:00
yosmoc
9cad7cd025 anchorClickHandler is not valid any more
linkClickHandler takes care of behaviours when clicking a tag.
Currently, both anchorClickHandler and linkClickHandler are registered in a tag. When clicking the ^http link, it opens the link twice.
2018-05-24 00:11:14 +02:00
yosmoc
a593842265 standardrize sidebar tooltips
- show in same place
- same height
2018-05-23 22:49:52 +02:00
ehhc
2f4eb595f6 OnBlur throws exceptions if the notetype is snippet -> Fixes #1962 2018-05-23 19:47:41 +02:00
ehhc
bfcf349ffe Attachment management should only become active on cloning notes if the note was of type MARKDOWN_NOTE -> No Stacktraces otherwise! 2018-05-23 19:24:03 +02:00
yosmoc
2bd78cd47f update cursor position after expanding the link 2018-05-22 21:53:08 +02:00
Nguyễn Việt Hưng
713615e28b applied style for snippetEditor 2018-05-21 18:37:17 +07:00
Nguyễn Việt Hưng
2b2f17525e cleaned up redundant variables, fixed eslint fix command, split snippetList into component 2018-05-21 18:32:41 +07:00
ehhc
cd6233a3d7 Cloning of a note should also clone its attachments -> works if the notes are in different storages now 2018-05-20 15:49:15 +02:00
ehhc
f76224bd17 Cloning of a note should also clone its attachments -> fixes #1904 2018-05-20 15:18:49 +02:00
Nguyễn Việt Hưng
1516807ed5 fixed double escape html 2018-05-20 19:24:36 +07:00
ehhc
8afa373726 Attachments should be visible immediately 2018-05-20 13:55:10 +02:00
ehhc
199f2202e0 deleting a folder should also delete the attachments -> fixe eslint issue 2018-05-19 20:43:48 +02:00
ehhc
86a6311f75 deleting a folder should also delete the attachments -> fixes #1903 2018-05-19 20:38:10 +02:00
Nguyễn Việt Hưng
9893fd9ae5 fixed eslint 2018-05-19 19:52:47 +07:00
Nguyễn Việt Hưng
d6c28da3a8 added export escape html config 2018-05-19 19:39:08 +07:00
Nguyễn Việt Hưng
52f694a714 fixed null attachment 2018-05-19 18:58:44 +07:00
Junyoung Choi
0ca4e6ca4f v0.11.5 2018-05-19 16:45:03 +09:00
hooklife
50bce4892f remove test 2018-05-19 03:46:37 +08:00
hooklife
ca345cf008 fix 2018-05-19 03:44:44 +08:00
hooklife
e0e1290fae fix 2018-05-19 03:40:24 +08:00
hooklife
a84b2611e4 fix 2018-05-19 03:35:58 +08:00
hooklife
ec31fab344 fix 2018-05-19 02:15:40 +08:00
hooklife
1b96eee4de fix 2018-05-19 02:12:18 +08:00
bimlas
a6af5de3e1 Refactor tag removing methods (duplicated code) 2018-05-18 15:18:28 +02:00
bimlas
52b3068330 Refresh taglist to remove unused tags on deleting
When a tag  is deleted from a note, the taglist did not updated: the deleted tag was still in the list. If the
tag was created in the current session, it was removed, worked as expected.

The reason is: until the note is not updated, the tag list is not
initialized for first in the "delete tag button" handler, but it works
in the second case. Tried out using backspace to delete the tag, it
works.
2018-05-18 15:18:09 +02:00
Nguyễn Việt Hưng
0934c08dfe added shortcut manager and allow user to customize toggle mode shortcut 2018-05-18 14:55:42 +07:00
hook life
f0428fde66 修正部分翻译 2018-05-18 15:25:41 +08:00
hook life
b3f57a67c4 修正部分翻译 2018-05-18 15:22:45 +08:00
hook life
8bc2b1262b 修正部分翻译 2018-05-18 15:13:38 +08:00
Nguyễn Việt Hưng
fb24efd3de added shortcut for toggle mode 2018-05-18 10:52:42 +07:00
Nguyễn Việt Hưng
ce594b0b5a added note template feature 2018-05-17 00:14:59 +07:00
Junyoung Choi
7b39ab4ec4 Update yarn.lock 2018-05-17 02:00:02 +09:00
Junyoung Choi (Sai)
f717ed9f66 Merge pull request #1923 from ehhc/Moving_Note_With_Attachment
Move note with attachment to different storage Fix for #1788
2018-05-17 01:43:03 +09:00
Junyoung Choi (Sai)
d3091a5384 Merge branch 'master' into Moving_Note_With_Attachment 2018-05-17 01:28:47 +09:00
Junyoung Choi (Sai)
2a6d950a4b Merge pull request #1902 from ehhc/Issue_1900
Deleting a note should also delete the attachments -> fixes #1900
2018-05-17 01:20:55 +09:00
Junyoung Choi (Sai)
b03b9d5334 Merge pull request #1887 from o-3/master
Add configuration to render newlines as <br> or not
2018-05-17 01:08:52 +09:00
hidaiy
c9cb31bd02 Update CodeMirror version (#1925)
to fix issue#1003
2018-05-16 17:41:20 +09:00
ehhc
905d6860fc really fix the eslinter issue... -.- 2018-05-15 20:39:16 +02:00
ehhc
6f52744b0f Fix eslinter issue 2018-05-15 20:32:35 +02:00
ehhc
007d3e52c5 Merge branch 'master' into Issue_1900 2018-05-15 20:26:10 +02:00
ehhc
f10fa632ca Move note with attachment to different storage Fix for #1788 2018-05-15 20:17:32 +02:00
Junyoung Choi (Sai)
266323b90b Merge pull request #1916 from yosmoc/configuable_plantuml_server
Configurable plantuml server
2018-05-15 20:02:11 +09:00
Junyoung Choi (Sai)
60707a8f45 Merge pull request #1918 from yosmoc/about_jp
fix 'About' translation in ja.json
2018-05-15 20:00:18 +09:00
Junyoung Choi (Sai)
b89896a4e7 Merge pull request #1919 from samlanning/inconsistent-state-update
fix inconsistent updates to react component state
2018-05-15 19:30:22 +09:00
Junyoung Choi (Sai)
d69fd12fb9 Merge pull request #1920 from samlanning/incorrect-state-property-reference
Fix mis-referenced state properties
2018-05-15 16:49:40 +09:00
Junyoung Choi (Sai)
0bdcfa6028 Merge pull request #1899 from ehhc/deleting_of_attachment_link
Deleting of attachments -> fixes #1828 and fixes #740
2018-05-15 15:52:31 +09:00
Junyoung Choi (Sai)
55b8488901 Merge pull request #1915 from yougotwill/note_button_styling
fixed NoteItemSimple styling for the dark themes
2018-05-15 15:49:35 +09:00
Junyoung Choi (Sai)
8ddbf2067b Merge pull request #1921 from BoostIO/fix-move-note
Fix moving note with attachments between different storage
2018-05-15 15:48:36 +09:00
Junyoung Choi
fa5cebda6d Fix moving note with attachments between different storage 2018-05-15 15:45:46 +09:00
Sam Lanning
4fd01b4234 Fix mis-referenced state properties 2018-05-14 16:29:54 -07:00
Sam Lanning
0f354f4f06 fix inconsistent updates to react component state
Executions of setState() may be batched, and so updates to this.state and
this.props can be asynchronous, so references to this.state and this.props
should not be made in the new state, and instead the callback form of
setState() should be used.

These alerts were found using lgtm.com:
https://lgtm.com/projects/g/BoostIO/Boostnote/alerts/?mode=tree&ruleFocus=1819283066

see: https://reactjs.org/docs/state-and-lifecycle.html#state-updates-may-be-asynchronous
2018-05-14 16:15:49 -07:00
yosmoc
f94a197828 fix 'About' translation in ja.json 2018-05-14 23:19:33 +02:00
yosmoc
a26ff660b0 add plantuml server setting translation
Currently only translate to en and jp. I haven't translated for other language(just use the original value)
2018-05-14 22:57:05 +02:00
yosmoc
50cc648799 set default plantuml server 2018-05-14 22:56:45 +02:00
yosmoc
a7946805ae configuable plantUML server address 2018-05-14 22:35:38 +02:00
William Grant
f3b2969b42 fixed NoteItemSimple styling for the dark themes 2018-05-14 21:04:18 +02:00
Junyoung Choi (Sai)
d6c3490165 Merge pull request #1895 from yosmoc/move_note_diff_storage_bug
fix moving note across different storage bug
2018-05-14 17:52:29 +09:00
Junyoung Choi (Sai)
6ee594d4d1 Merge pull request #1912 from yosmoc/codemirror-multiplex-support
Codemirror multiplex support
2018-05-14 17:28:37 +09:00
yosmoc
7e1596de30 refactor code duplication 2018-05-13 00:36:03 +02:00
yosmoc
67bba043ed MarkdownPreview also needs to convert the mode name for specific modes 2018-05-13 00:35:32 +02:00
yosmoc
26d7f4923d support multiplex mode
embedded javascript uses combined several modes.
Multiplex mode renders ejs and other formats which uses several modes.
2018-05-13 00:35:01 +02:00
ehhc
e9218d1088 Fix for the broken test 2018-05-10 22:39:00 +02:00
ehhc
03fd1e29e3 Fix for the broken test 2018-05-10 22:30:13 +02:00
ehhc
ff59af6b51 Fix for the broken test 2018-05-10 21:42:23 +02:00
ehhc
73ba8b8b13 Deleting a note should also delete the attachments -> fixes #1900 2018-05-10 21:36:58 +02:00
ehhc
ffc3fb770c Deleting of attachments -> fixes #1828 and fixes #740 2018-05-10 20:27:47 +02:00
yosmoc
d58ea70a95 fix moving note across different storage bug
should update storageNoteMap here.
2018-05-10 06:29:13 +02:00
Kazz Yokomizo
90e8dd038d Merge pull request #1891 from BoostIO/bounty-program
Add bounty program
2018-05-09 10:15:17 +09:00
Kazz Yokomizo
56d1e3edaa Add bounty program 2018-05-09 10:00:07 +09:00
ozone
83a9e54896 Fix snapshot 2018-05-04 01:22:55 -04:00
ozone
ab038b1f31 Add configuration to render line breaks as <br> or not 2018-05-04 00:44:22 -04:00
Nguyễn Việt Hưng
f5a9d3928c disabled code highlight in snippet editor 2018-05-02 10:03:55 +07:00
Nguyễn Việt Hưng
2bc0bce1b5 removed redundant function to get appdata 2018-05-02 09:05:29 +07:00
Junyoung Choi (Sai)
372933fd99 Merge pull request #1873 from yosmoc/trashed_notetag_exist
Not showing unassigned tag in taglist
2018-05-01 14:36:15 -07:00
Junyoung Choi (Sai)
9112347e95 Merge pull request #1870 from cJack1913/master
Fix font color in code block(markdown preview)
2018-05-01 14:35:45 -07:00
Junyoung Choi (Sai)
30548a68e4 Merge pull request #1868 from yosmoc/1820
fix internal note link bug #1820
2018-05-01 12:52:10 -07:00
Junyoung Choi (Sai)
ce052d1691 Merge pull request #1865 from zzdjk6/master
Fix #1780: Use black text with white background for printing and export in all theme
2018-05-01 12:50:35 -07:00
Junyoung Choi (Sai)
765ba8c867 Merge branch 'master' into master 2018-05-01 12:00:50 -07:00
Junyoung Choi (Sai)
a20c0cd49e Merge pull request #1603 from rayou/update-travis-node-version
Updated Travis CI node version - #1602
2018-05-01 11:43:35 -07:00
Junyoung Choi (Sai)
e06ca9a056 Merge pull request #1883 from yosmoc/drag_drop_note
fix drag drop more than one note bug
2018-05-01 10:34:29 -07:00
Junyoung Choi (Sai)
d04048c749 Merge pull request #1874 from ehhc/Issue_1827
Issue 1827
2018-05-01 10:31:34 -07:00
yosmoc
2d0f7589ea select proper notes for dragging
When the dragged target note is included in the selected notes, keeps the current selected notes, otherwise, replace the selected notes by the dragged target
2018-04-30 22:34:15 +02:00
yosmoc
dc60be404a select next note after tranfer note(s) to another folder 2018-04-30 22:30:41 +02:00
Kazz Yokomizo
9ff5cc51f9 Merge pull request #1875 from yougotwill/monokai_theme
Monokai theme
2018-04-27 18:49:17 -07:00
ehhc
e9de8f42e5 Fix eslinter 2018-04-27 09:16:30 +02:00
William Grant
5bd0499ae4 Merge branch 'master' into monokai_theme 2018-04-27 09:06:11 +02:00
ehhc
99e706bcd2 Enable yarn on travis + fix broken test 2018-04-27 09:05:47 +02:00
William Grant
239edb0605 tweaked styling 2018-04-27 09:01:41 +02:00
ehhc
bf3f5a5971 Fixes #1827 -> include attachments in HTML exports of notes 2018-04-27 08:51:47 +02:00
William Grant
92be3f32d6 added monokai theme 2018-04-27 08:10:50 +02:00
Nguyễn Việt Hưng
106f5a53ff added import fs module that was removed by accident 2018-04-27 11:42:34 +07:00
Nguyễn Việt Hưng
8c43f3d567 removed path.sep and use path.join to concatenate path 2018-04-27 11:27:51 +07:00
Nguyễn Việt Hưng
2e09501c8a fixed eslint error 2018-04-27 11:19:37 +07:00
Nguyễn Việt Hưng
a2592e48c8 Merge branch 'text-expansion-support' of https://github.com/ZeroX-DG/Boostnote into text-expansion-support 2018-04-27 11:17:17 +07:00
Nguyễn Việt Hưng
291d76674b refactored snippet dataApi for easy testing and added some test. Fixed old snippet still display when deleted 2018-04-27 11:16:45 +07:00
Nguyễn Việt Hưng
78957cf128 fixed eslint error 2018-04-27 08:25:23 +07:00
Nguyễn Việt Hưng
e88694b049 added fetch snippet
refactored some code

fixed snippet content empty on changed from list

fixed snippet name not updating on list when changed
2018-04-27 08:22:54 +07:00
Junyoung Choi (Sai)
5e7bdf7354 Merge branch 'master' into text-expansion-support 2018-04-26 16:39:52 -07:00
Junyoung Choi
2e3e0bc1d8 Fix lint error 2018-04-26 16:35:47 -07:00
Junyoung Choi (Sai)
b33e6b232c Merge pull request #1863 from PeterDaveHelloKitchen/png-image-optimize
Optimize PNG images losslessly via Google's zopflipng
2018-04-26 16:27:49 -07:00
Junyoung Choi (Sai)
df6b083670 Merge pull request #1852 from ehhc/attachment_refactoring
Fixes #1825 Refactoring of the attachment/image management
2018-04-26 16:26:30 -07:00
Junyoung Choi
05009d40c4 Merge branch 'master' into attachment_refactoring 2018-04-26 16:24:58 -07:00
Junyoung Choi (Sai)
ea27a3b449 Merge pull request #1872 from yosmoc/empty_trash_not_working_in_sidebar_fold
Empty trash menu working in sidebar folded
2018-04-27 07:04:05 +09:00
yosmoc
2831b0bd2a Only showing the tags that size > 0
No meaning to show the tag that has empty List
The tag which is only used in the note(s) in the Trash, tags.size becomes zero. In order to support this case, filtering tagList is needed
2018-04-26 23:55:44 +02:00
yosmoc
32e22dd507 update tagNoteMap when delete / restore the notebook
deleted note should not belong to tagNoteMap
2018-04-26 23:52:31 +02:00
yosmoc
2ee9951853 Empty trash menu working in sidebar folded 2018-04-26 22:29:26 +02:00
Kazz Yokomizo
b1912135ed Merge pull request #1775 from bimlas/narrow-to-related-tags
Show only related tags, select multiple tags
2018-04-26 13:13:24 -07:00
Kazz Yokomizo
bed3d42923 Merge pull request #1824 from ZeroX-DG/fix-paste-image
Fixed image not displaying after paste
2018-04-26 22:39:03 +09:00
bimlas
c4ec69a43f Add tests 2018-04-26 15:38:52 +02:00
bimlas
24b004bb2d Remove obsolete route path 2018-04-26 15:38:52 +02:00
bimlas
84925b24b5 Add option to show only related tags 2018-04-26 15:38:52 +02:00
bimlas
c02b91dfd4 Simplify style 2018-04-26 15:38:52 +02:00
bimlas
066d97220f Cleanup, prettify 2018-04-26 15:38:52 +02:00
bimlas
61ed47dda0 Don't narrow list, add plus sign only for related tags
It's easier to understand by most of the users.

Later I like to add a setting to enable narrowing of tag list to show
only the related ones.
2018-04-26 15:38:51 +02:00
bimlas
68c0f210cc Separate active tags by instead of &
Using `&` to separate tags in path (like
`/tags/currently&selected&tags`) may interfer with tags including `&`
character (like `black&white`). Since ` ` is replaced with `_` when
adding tag to notes, it's ideal separator because it's guaranteed that
tags are not including this character.
2018-04-26 15:38:51 +02:00
bimlas
6c542750f4 Narrow list of tags to related ones
When a tag is selected, the tag list narrows to show only the related
ones: all tags associated to the currently visible notes. Clicking on
the plus sign near another tag narrows the list again to the tags of
notes associated with the firstly AND secondly selected tag. To show
every tags again, press the tag icon on the top-left corner of
Boostnote.

Before:
![screencast](https://i.imgur.com/PwAdhLe.gif)

After:
![screencast](https://i.imgur.com/s3JCaFq.gif)

NOTE: Tags are joined with `&` character (`#` not works) in
`location.pathname` thus it will make the tags with this character
unavailable. Any suggestion to pass multiple values via pathname?
2018-04-26 15:38:47 +02:00
Kazz Yokomizo
25440a26ee Merge pull request #1805 from frankkanis/move-image-note-fix
Fixed moving notes with images
2018-04-26 22:32:21 +09:00
Kazz Yokomizo
ab393b1f6d Merge pull request #1818 from ZeroX-DG/fix-centralize-language
Centralized languages into 1 files
2018-04-26 22:27:35 +09:00
Kazz Yokomizo
e643147b69 Merge pull request #1831 from lboullo0/patch-1
Fix small typo
2018-04-26 22:21:56 +09:00
Kazz Yokomizo
6c4aa71cbc Merge pull request #1834 from ralphchung/edit-locale-zh_TW
Edit the localization file of zh-TW
2018-04-26 22:18:56 +09:00
Kazz Yokomizo
9930ba8748 Merge pull request #1836 from bah2830/TAG_COUNT_FIX
Updated tag note count to float to the right like the storage list
2018-04-26 22:16:35 +09:00
Frank Kanis
fbb8b4687b Reduced nests 2018-04-25 17:53:18 +02:00
cJack1913
01b1c49738 Fix font color in code block(markdown preview) 2018-04-25 17:23:09 +08:00
yosmoc
c9c28eda1b support internal note link 2018-04-24 23:40:59 +02:00
Chen Shenghan
744bcba599 Fix #1780: Use black text with white background for printing and export in all theme 2018-04-25 03:31:36 +12:00
Hung Nguyen
d76db726c4 refactored code according to review 2018-04-24 18:06:10 +07:00
Peter Dave Hello
71ec528a87 Optimize PNG images losslessly via Google's zopflipng 2018-04-24 17:39:18 +08:00
Junyoung Choi (Sai)
fbbc93900e Merge pull request #1858 from zzdjk6/master
Fix #1797: In preview window, open external link in external browser.
2018-04-24 04:58:25 +09:00
Junyoung Choi (Sai)
33b45737c9 Merge pull request #1859 from yosmoc/moment_updateLocale_warning
fix deprecation warning
2018-04-24 04:56:52 +09:00
yosmoc
4a55f78a48 fix deprecation warning
moment.updateLocale will properly replace properties on an existing locale.
2018-04-23 21:08:10 +02:00
Ralph Chung
a82a79e25c Edit the localization file of zh-TW
I've edited the zh-TW.json based on the original version.
The use of words in this document is more in keeping with the habits of how Taiwanese use Chinese.
2018-04-24 00:41:27 +08:00
Chen Shenghan
6ec2124a9c Fix #1797: In preview window, open external link in external browser. 2018-04-24 02:51:58 +12:00
Kazz Yokomizo
1f1ef1440e Merge pull request #1855 from mkal1375/master
Add fa.json in `locales` directory
2018-04-22 14:10:05 +09:00
Hung Nguyen
a7d0a4bdac clean up some redundant code, changed to path.sep, remove some default snippet 2018-04-22 09:27:47 +07:00
Mahdi Kalhor
d2129ffac6 edit some errors in translations. 2018-04-21 19:20:14 +04:30
Mahdi Kalhor
a4782f0663 Add fa.json for persian(farsi) language. 2018-04-21 19:15:10 +04:30
ehhc
16794b9d78 Fixes #1822 -> fix for the broken tests 2018-04-21 16:32:27 +02:00
ehhc
a76aed2d4e Fixes #1822 2018-04-21 14:49:43 +02:00
ehhc
d2163dacf9 Fixes #1825 Refactoring of the attachment/image management 2018-04-21 14:32:24 +02:00
Kazz Yokomizo
158305346f Merge pull request #1850 from BoostIO/slack-url
Remake slack url
2018-04-21 15:56:27 +09:00
Kazz Yokomizo
e692432242 Remake slack url 2018-04-21 15:55:54 +09:00
Hung Nguyen
a7b85b123e fixed get appdata path error 2018-04-21 09:40:32 +07:00
Hung Nguyen
ddcd722598 fix eslint error 2018-04-21 09:07:49 +07:00
Hung Nguyen
358458a937 Fixed appdata path error 2018-04-21 09:04:30 +07:00
Hung Nguyen
8925f7c381 fixed eslint error 2018-04-20 23:58:52 +07:00
Hung Nguyen
ff2e39901a added delete snippet, update snippet, create snippet and save on snippet change 2018-04-20 23:15:17 +07:00
Junyoung Choi (Sai)
90ff0f43ea Merge pull request #1754 from yougotwill/crossplatform_fullscreen_shortcuts
Fullscreen shortcut for non macOS
2018-04-20 13:02:33 +09:00
Junyoung Choi (Sai)
442c352c8d Merge pull request #1842 from davix3f/patch-1
Italian translation
2018-04-20 13:00:50 +09:00
Davide Fiorito
e91b7fb082 Italian translation 2018-04-19 17:54:14 +02:00
Hung Nguyen
88de66a31f fix the same error when drop image 2018-04-19 19:17:10 +07:00
Hung Nguyen
d3b3e45800 improved style for snippet list 2018-04-19 19:05:46 +07:00
Hung Nguyen
50d2f90621 added snippet config in setting 2018-04-19 13:40:33 +07:00
Brent Hughes
8ccf6cb8a3 Updated tag note count to float to the right like the storage list 2018-04-18 10:55:01 -05:00
Hung Nguyen
2e9b478824 added text expansion support 2018-04-18 19:31:10 +07:00
Kazz Yokomizo
89b2d54725 Merge pull request #1832 from dotnsf/translate_ja
locales/ja.json translated in Japanese
2018-04-18 14:33:42 +09:00
K.Kimura
3d0af2d8ca locales/ja.json translated in Japanese 2018-04-18 13:20:20 +09:00
Lucas
813b433f4d Fix small typo 2018-04-17 18:07:27 -03:00
William Grant
0bce96b0c6 Merge branch 'master' into crossplatform_fullscreen_shortcuts 2018-04-17 18:24:35 +02:00
William Grant
1d4f1764fc Changed top:focus-search shortcut 2018-04-17 18:22:54 +02:00
Hung Nguyen
2994420160 Fixed image not displaying after paste 2018-04-17 20:47:13 +07:00
Hung Nguyen
65d8d7282f fetched lastest changes 2018-04-17 10:06:39 +07:00
Hung Nguyen
47af3f09fc Centralized languages into 1 file 2018-04-17 09:59:30 +07:00
Junyoung Choi (Sai)
f4024f4683 Merge pull request #1749 from yougotwill/delete_dialog
Show confirmation dialog when deleting notes from the context menu
2018-04-16 22:03:02 +09:00
Junyoung Choi (Sai)
ee0ed6df7a Merge pull request #1802 from frankkanis/languages-fix
Fixed change some languages
2018-04-16 21:56:32 +09:00
Junyoung Choi (Sai)
d3fbba3572 Merge pull request #1809 from ZeroX-DG/fix-menu-popup-alt
fixed menu popup on alt key pressed
2018-04-16 21:45:03 +09:00
Hung Nguyen
4a6b22f5b7 removed console.log used for debuging 2018-04-15 09:18:12 +07:00
William Grant
d070305002 Merge branch 'master' into delete_dialog 2018-04-14 20:20:17 +02:00
Hung Nguyen
a8500150b0 fixed menu popup on alt 2018-04-14 21:43:19 +07:00
Junyoung Choi (Sai)
02fb1d01ad Merge pull request #1804 from romainwn/feature/add-issue-template
add issue template
2018-04-14 15:20:53 +09:00
Kazz Yokomizo
497dee038f Merge pull request #1807 from ZeroX-DG/master
Edited theme and language init code to avoid code repetition
2018-04-14 14:11:24 +09:00
Hung Nguyen
a4af77f91e fixed eslint error 2018-04-13 21:46:19 +07:00
Hung Nguyen
f2a4e1d230 fixed typo in variable name 2018-04-13 21:00:01 +07:00
Hung Nguyen
8560901f80 Edited theme and language init code to avoid code repetition 2018-04-13 20:39:17 +07:00
Frank Kanis
daea604c60 Added spaces 2018-04-12 21:51:01 +02:00
Frank Kanis
7aedb59f26 Fixed moving notes with images 2018-04-12 21:20:16 +02:00
Unknown
0be1c2f464 remove unnecessary lines 2018-04-12 19:47:02 +02:00
Romain Le Quellec
0dbfaf0e79 fix checkbox 2018-04-12 13:34:26 +02:00
Romain Le Quellec
4147399cda add issue template 2018-04-12 13:25:37 +02:00
Frank Kanis
cc667ac738 Added spacing 2018-04-12 00:27:20 +02:00
Frank Kanis
022915ffc9 Fixed change some languages 2018-04-12 00:10:22 +02:00
Junyoung Choi
4b9cf775ff v0.11.4 2018-04-11 08:16:20 +09:00
Junyoung Choi (Sai)
56879924bd Merge pull request #1701 from bimlas/fix-filter-by-tag-in-search-entry
Fix tag filtering in search entry
2018-04-10 19:59:20 +09:00
Junyoung Choi (Sai)
6142f2d641 Merge pull request #1724 from ehhc/Issue_1723
Fixes #1723
2018-04-10 19:16:05 +09:00
Sosuke Suzuki
0d53f799b7 to short an arrow function 2018-04-10 18:40:57 +09:00
Junyoung Choi (Sai)
65e77e9669 Merge pull request #1742 from bimlas/order-of-tags
Add selector to sort tags by counter or alphabetically
2018-04-10 17:40:31 +09:00
Sosuke Suzuki
2c8f3b56ae use arrow functions 2018-04-10 17:14:25 +09:00
Junyoung Choi (Sai)
8ab190affc Merge pull request #1752 from nlopin/add-jest
Add jest and simple test
2018-04-10 16:50:49 +09:00
Sosuke Suzuki
eafccc4fc4 remove confirmDeletion function 2018-04-10 16:44:04 +09:00
Sosuke Suzuki
ce440351a5 use extracted confirmDeleteNote function 2018-04-10 16:28:05 +09:00
Sosuke Suzuki
be94edde0f extract confirmDeleteNote function 2018-04-10 16:26:50 +09:00
Sosuke Suzuki
4fcc9af933 add jest-localstorage-mock 2018-04-10 15:47:58 +09:00
Kazz Yokomizo
e2b4ac6ee8 Merge pull request #1778 from BoostIO/fix-folded-stragelist-bug
fix folded storagelist width
2018-04-04 22:28:37 +09:00
Sosuke Suzuki
c151049cc2 fix folded storagelist width 2018-04-04 21:17:07 +09:00
Junyoung Choi (Sai)
ac778d3f65 Merge pull request #1764 from frankkanis/languages-production
Fixed change language in production mode
2018-04-03 17:44:14 +09:00
Junyoung Choi (Sai)
1aed0cb4b9 Merge pull request #1774 from li1xu1bin/master
Translate into Chinese
2018-04-03 02:06:12 +09:00
Junyoung Choi (Sai)
5836b65aad Merge pull request #1744 from azu/search-routing
fix reload crash on /searched
2018-04-01 07:51:38 +09:00
Junyoung Choi (Sai)
46f750efba Merge pull request #1745 from frankkanis/trash-context-menu
Clean up trash context menu
2018-04-01 07:51:07 +09:00
Junyoung Choi (Sai)
b33c9e23ce Merge pull request #1737 from yosmoc/noteList_error_handling
remove broken note from note list
2018-04-01 07:48:38 +09:00
Junyoung Choi (Sai)
14694f1cb0 Merge pull request #1751 from gediminasml/folding
Add folding to CodeEditor
2018-04-01 07:48:25 +09:00
Junyoung Choi (Sai)
75575348cd Merge pull request #1757 from hidaiy/fix-vim-mode
Fix #1003 Add CodeMirror addon
2018-04-01 07:48:06 +09:00
Junyoung Choi (Sai)
f6ad0a235c Merge pull request #1759 from bimlas/fix-highlighting-of-active-tag
Fix highlighting of active tag
2018-04-01 07:47:49 +09:00
“li1xu1bin”
bbf6c60888 Chinesization 2018-03-31 18:58:21 +08:00
Junyoung Choi (Sai)
f5915f3e10 Merge pull request #1753 from nlopin/encode_content_in_html_export
Escape html characters before convert to HTML
2018-03-31 17:57:24 +09:00
William Grant
a32cfc8aff Revert "updated for separate methods for full screen depending on the platform"
This reverts commit b46b958105.
2018-03-30 13:01:18 +02:00
ehhc
c90a878c9e Merge branch 'master' into Issue_1723 2018-03-30 12:25:35 +02:00
William Grant
b46b958105 updated for separate methods for full screen depending on the platform 2018-03-30 11:05:20 +02:00
Frank Kanis
6943b06a88 Added missing space 2018-03-28 22:06:50 +02:00
Frank Kanis
27a9def88c Fixed change language in production 2018-03-28 21:55:22 +02:00
William Grant
11f8cfe0e6 fixed label key-spacing 2018-03-28 19:21:36 +02:00
William Grant
e1e3cc7999 moved label to a better position 2018-03-28 19:17:40 +02:00
bimlas
254c8816f1 Fix highlighting of active tag
The currently selected tag was not highlighted in the list.

Before:

![screencast](https://i.imgur.com/6JsjYk7.gif)

After:

![screencast](https://i.imgur.com/xD6fc0c.gif)
2018-03-27 22:14:47 +02:00
William Grant
9a445e34fd fixed trailing spaces 2018-03-27 21:06:59 +02:00
William Grant
ee78e113de Moved 'Toggle Fullscreen' to the View label used non-OS specific fullscreen 2018-03-27 20:52:58 +02:00
hidai
0dfb14962a Add CodeMirror addon 2018-03-27 18:37:20 +09:00
bimlas
d493df4295 Move selector next to title 2018-03-27 07:34:11 +02:00
William Grant
f0144233f9 Fullscreen shortcut for non macOS is now F11 2018-03-25 23:04:16 +02:00
Nikolay Lopin
90f21f4ed1 Escape html characters before convert to HTML 2018-03-25 23:47:17 +03:00
Nikolay Lopin
646ebe592e Add setup files and localstorage mock 2018-03-25 21:02:35 +03:00
Nikolay Lopin
b098a15e9c Add jest and simple test 2018-03-25 20:02:06 +03:00
William Grant
4f98995fe4 ... that second equals 2018-03-25 18:47:21 +02:00
William Grant
56231edc3a fix delete confirmation method 2018-03-25 18:43:54 +02:00
William Grant
871ab428c2 Revert "updated node version in travis.yml"
This reverts commit a9b75f752e.
2018-03-25 18:42:48 +02:00
William Grant
a9b75f752e updated node version in travis.yml 2018-03-25 18:28:02 +02:00
Junyoung Choi (Sai)
9590559b81 Merge pull request #1741 from wAuner/patch-1
fix incorrect app closing for linux mint cinnamon
2018-03-26 00:51:30 +09:00
Junyoung Choi (Sai)
24bd2eddf1 Merge pull request #1748 from davidmigloz/master
Add Spanish (es-ES) locale
2018-03-26 00:50:51 +09:00
Junyoung Choi (Sai)
f4ba06c401 Merge pull request #1747 from lfromanini/master
Brazilian Portuguese localization
2018-03-26 00:49:31 +09:00
Gediminas Petrikas
cd405d1df9 Add cursor pointer when hovering fold gutter 2018-03-25 14:55:33 +03:00
Gediminas Petrikas
9d6dbc1a6f Remove folding keyboard shortcut 2018-03-25 14:55:06 +03:00
Gediminas Petrikas
6d57712fca Add fold gutters 2018-03-25 14:13:19 +03:00
William Grant
191f2cacbf Show confirmation dialog when deleting notes from the context menu if set in preferences 2018-03-25 12:27:04 +02:00
David Miguel
080448af3a Add Spanish (es-ES) locale 2018-03-25 02:09:04 +01:00
Luiz
6e2272d043 Brazilian Portuguese localization 2018-03-24 18:04:45 -03:00
Luiz
71078dea4f Brazilian Portuguese localization 2018-03-24 17:41:48 -03:00
Frank Kanis
333f0be879 Clean up trash context menu 2018-03-24 20:49:04 +01:00
azu
3b0f664a3b fix: fix crash on /searched
Add routing for search word:

- `/searched/:searchword`

Restore the state from the `:searchword` params.
2018-03-25 00:33:57 +09:00
bimlas
2a23d19321 Add selector to sort tags by counter or alphabetically
![screencast](https://i.imgur.com/XUkTyRe.gif)
2018-03-24 15:46:49 +01:00
wAuner
5ee4237510 fix incorrect app closing for linux mint cinnamon
excluded the cinnamon desktop for the macOS-like behavior which closes the window, but does not shutdown the app processes
2018-03-24 14:48:34 +01:00
yosmoc
bdb906c26d remove broken note from note list
When .cson is broken and catch error in processing this file,  undefined is collected in notes.

remved broken note(s) from notes list.
2018-03-23 22:24:53 +01:00
Junyoung Choi (Sai)
02095ac155 Merge pull request #1736 from rayou/fix-typo-in-locales
Fixed typo in locales
2018-03-24 02:47:26 +09:00
Junyoung Choi (Sai)
80d1ca81ac Merge pull request #1725 from frankkanis/master
Updated German translation
2018-03-24 02:33:02 +09:00
Yu-Hung Ou
3bbabbc80b fixed typo in locales 2018-03-23 23:22:49 +11:00
Frank Kanis
f8ff3d4bf5 Update German translation 2018-03-22 21:21:15 +01:00
Frank Kanis
3a40f9ebd6 Prepared text for translation 2018-03-22 21:20:13 +01:00
ceh
cf776088e6 Fixes #1723 2018-03-22 17:26:59 +01:00
Junyoung Choi
7ab81608e8 v0.11.3 2018-03-22 23:07:28 +09:00
Junyoung Choi (Sai)
017e40fcb9 Merge pull request #1722 from BoostIO/disable-i18n-dev-mode
Disable devMode by default
2018-03-22 23:01:49 +09:00
Junyoung Choi
29309fbaa3 Disable devMode by default 2018-03-22 23:01:20 +09:00
Junyoung Choi (Sai)
b766b08bf5 Merge pull request #1709 from rayou/add-editor-rulers
Added editor rulers
2018-03-22 22:54:55 +09:00
Junyoung Choi
e796e00963 Merge branch 'master' into add-editor-rulers 2018-03-22 22:30:03 +09:00
Junyoung Choi (Sai)
10136df977 Merge pull request #1713 from frankkanis/master
Update text for internationalization
2018-03-22 22:09:15 +09:00
Junyoung Choi (Sai)
44ec107ce8 Merge pull request #1715 from BoostIO/sanitize-options
Make sanitization configurable
2018-03-22 21:57:37 +09:00
Junyoung Choi (Sai)
c7fb5b0475 Merge pull request #1718 from rayou/fix-1705-wrap-long-latex
Wrap long LaTeX formula in Preview
2018-03-22 21:57:21 +09:00
Junyoung Choi (Sai)
785735ccf5 Merge pull request #1721 from BoostIO/fix-quit
Always quit app when all window closed
2018-03-22 21:54:13 +09:00
Junyoung Choi (Sai)
f0736ccf8d Merge pull request #1720 from bimlas/i18n-hu-hungarian
i18n: Add Hungarian (HU) translations
2018-03-22 21:50:23 +09:00
Junyoung Choi
a24a7e03be Quit app when all window closed 2018-03-22 20:59:19 +09:00
bimlas
be235e5204 i18n: Add HU to locales 2018-03-22 12:35:42 +01:00
bimlas
57ec598672 i18n: Add Hungarian (HU) translations 2018-03-22 12:35:42 +01:00
Yu-Hung Ou
2627c09cda added new local strings to all locals 2018-03-22 21:44:26 +11:00
Yu-Hung Ou
36e63bb8a9 wrap long LaTeX formula in Preview 2018-03-22 21:33:32 +11:00
Junyoung Choi
5ea24f650b Make sanitization configurable 2018-03-22 12:01:16 +09:00
Junyoung Choi (Sai)
8c792ce7a1 Merge pull request #1714 from BoostIO/fix-lint-errors
Fix lint errors
2018-03-22 11:10:52 +09:00
Frank Kanis
055969f5c6 Update text for internationalization 2018-03-21 22:17:34 +01:00
bimlas
145ae10a79 Add test: find tags without hash symbol
Searching has to find tags without hash symbol too (`tag` instead of
`#tag`).
2018-03-21 20:07:21 +01:00
Yu-Hung Ou
bdb9349b52 updated en local 2018-03-21 22:32:05 +11:00
Yu-Hung Ou
8b11b57ec5 allow users to enable/disable editor rulers. default: disable 2018-03-21 22:31:46 +11:00
Yu-Hung Ou
29888c89ad added CSS style for rulers to make it fit most of the themes 2018-03-21 21:11:26 +11:00
Yu-Hung Ou
281fb2afd3 added CodeMirror ruler support 2018-03-21 21:11:26 +11:00
Yu-Hung Ou
fbb7839f83 added Editor Rulers field in Preferences 2018-03-21 21:11:26 +11:00
Junyoung Choi (Sai)
d3f9c170ac Merge pull request #1703 from Joel-Costamagna/patch-1
typo
2018-03-21 15:28:38 +09:00
bimlas
4f9a0b0040 Merge findByTag() and findByWord() into one
Both looked for word in tags and content too, the only difference is
when searched for `#tag`, the prefix (`#`) was truncated before compared
with list of tags.
2018-03-20 19:30:57 +01:00
bimlas
aae584106a Look for tags in context too
The previous commit broke this behaviour.

Looking for a tag means the union of **tags** AND **tag in content**, so
it has to search in the in currently found notes separetely, thus it has
to clone the list first (`.slice(0)`).
2018-03-20 17:11:08 +01:00
Joël COSTAMAGNA
2a784deb4b typo 2018-03-20 11:46:33 -04:00
bimlas
5f5a7880a6 Fix tag filtering in search entry
Some issues introduced in #954
(https://github.com/BoostIO/Boostnote/pull/954#issuecomment-336344915):

- search by `#tag1 #tag2` returns the results of only `#tag2`
- search by `#tag1 content` is as same as AND search by `#tag1 content` (and
  `#tag1` is regarded a word, not a tag)
- search by `content #tag1` returns the results of only `#tag1`

This commit fixing these:

- search by `#tag1 #tag2` returns the results of only `#tag2`

  ![screencast](https://i.imgur.com/SjhQIhl.gif)

- search by `#tag1 content` is as same as AND search by `#tag1 content` (and
  `#tag1` is regarded a word, not a tag)

  ![screencast](https://i.imgur.com/G0Tmd8c.gif)

- search by `content #tag1` returns the results of only `#tag1`

  ![screencast](https://i.imgur.com/5MrMbE6.gif)

NOTE: the examples works without `#` character too, because
`findByWord()` checks the tags too.
2018-03-20 09:01:11 +01:00
Junyoung Choi (Sai)
ab8b6d806d Merge pull request #1700 from BoostIO/add-korean
Add korean
2018-03-20 16:36:54 +09:00
Junyoung Choi
6c4206a2dd Fix lint errors 2018-03-20 16:18:18 +09:00
Junyoung Choi
0d61d9cee4 Add missing locale 2018-03-20 15:10:55 +09:00
Junyoung Choi
48bdb9e818 Do not use devMode on production 2018-03-20 15:10:35 +09:00
Junyoung Choi
cfe447a403 Add Korean 2018-03-20 15:04:56 +09:00
Junyoung Choi (Sai)
2c30f0e487 Merge pull request #1684 from kawmra/prevent-fetching-title-in-link-tag
Prevent generating a link tag when pasting URL to inside of a link tag.
2018-03-20 10:32:59 +09:00
Junyoung Choi (Sai)
147211478c Merge pull request #1698 from nlopin/fix_export_folder
Fix filenames with forbidden symbols during export #1613
2018-03-19 23:23:47 +09:00
Junyoung Choi (Sai)
35b7674e69 Merge pull request #1696 from frankkanis/master
Fix Copy Note Link in Context Menu
2018-03-19 22:58:38 +09:00
Junyoung Choi (Sai)
55075b2a96 Merge pull request #1566 from nlopin/new-snippet-tabbar
New snippet tabbar
2018-03-19 21:27:37 +09:00
Nikolay Lopin
6577599959 Replace forbidden filename symbols to _ for image export 2018-03-19 00:33:23 +03:00
Nikolay Lopin
0c4e72e507 Replace forbidden filename symbols to _ 2018-03-19 00:28:36 +03:00
Nikolay Lopin
9bf96e943d Add filenamify dependency 2018-03-19 00:22:07 +03:00
Nikolay Lopin
2811843e70 Merge branch 'master' into new-snippet-tabbar
# Conflicts:
#	browser/main/Detail/SnippetNoteDetail.js
2018-03-18 21:26:12 +03:00
Frank Kanis
842ece2a8a Fix Copy Note Link in Context Menu 2018-03-18 11:14:22 +01:00
Junyoung Choi (Sai)
222de03ea3 Merge pull request #1678 from rayou/add-unit-tests-for-lib-markdown
Added unit tests for lib/markdown
2018-03-18 15:24:48 +09:00
Junyoung Choi (Sai)
d31ae9f3fc Merge pull request #1692 from romainwn/master
add missing i18n preview word + fr translation
2018-03-18 15:23:55 +09:00
Yu-Hung Ou
1dd7644e12 added smart quotes unit test for lib/markdown 2018-03-18 15:36:57 +11:00
Romain Le Quellec
2cee54f70a fix missing import 2018-03-17 10:23:44 +01:00
Romain Le Quellec
a8431fae96 add missing i18n preview word + fr translation 2018-03-17 10:16:51 +01:00
Yu-Hung Ou
03d11b7b58 Merge remote-tracking branch 'upstream/master' into add-unit-tests-for-lib-markdown 2018-03-17 18:54:18 +11:00
Junyoung Choi (Sai)
316e2eeefb Merge pull request #1640 from SiSchae/localization
Localization
2018-03-17 11:13:52 +09:00
Junyoung Choi (Sai)
c21e19337a Merge pull request #1691 from rayou/fix-smart-quotes-post-to-blog
Fixed smart quotes when posting a note to blog
2018-03-17 01:04:50 +09:00
Yu-Hung Ou
b9cab0dae8 Init markdown lib only when it's needed when posting a note to blog 2018-03-16 23:33:40 +11:00
Yu-Hung Ou
33b3299ca2 changed the default options of markdown lib to follow config 2018-03-16 23:32:18 +11:00
Yu-Hung Ou
00ba38beba reload config every time when markdown lib initiated 2018-03-16 23:30:57 +11:00
Yu-Hung Ou
433fce286e added electron as global variable to pass eslint check 2018-03-16 23:11:43 +11:00
kawmra
b36322bba4 Prevent generating a link tag when pasting URL to inside of a link tag. 2018-03-16 00:11:47 +09:00
Yu-Hung Ou
c147e0a789 mocked electron in ava unit tests 2018-03-15 22:14:21 +11:00
Yu-Hung Ou
8bf5d02624 Revert "updated lib/consts to access electron remote.app only when in production mode"
This reverts commit bbcd674516.
2018-03-15 22:12:22 +11:00
Simon
35616c1ccd Merge pull request #1 from nlopin/patch-1
Add russian translation
2018-03-15 09:47:09 +01:00
Nikolai Lopin
7c8939ecb8 Add russian translation 2018-03-15 02:23:15 +03:00
Simon
ccb0302d3f Resolved Merge issue; Added Russian; 2018-03-14 13:13:47 +01:00
Simon
0cfd048013 Merge branch 'master' into localization 2018-03-14 12:49:40 +01:00
Yu-Hung Ou
f72b4f0249 added unit test for checkbox markdown syntax 2018-03-14 21:47:07 +11:00
Yu-Hung Ou
b5cb209f14 added browser testing support to ava 2018-03-14 21:46:20 +11:00
Yu-Hung Ou
1af374439d added unit tests for lib/markdown 2018-03-14 20:37:25 +11:00
Yu-Hung Ou
bbcd674516 updated lib/consts to access electron remote.app only when in production mode 2018-03-14 20:37:25 +11:00
Yu-Hung Ou
3cba71b7a8 upgraded ava to 0.25.0 2018-03-14 20:37:25 +11:00
Yu-Hung Ou
6a1e9c5818 removed katex script tag from main.html, use import instead 2018-03-14 20:37:25 +11:00
Junyoung Choi (Sai)
ede41d01b4 Merge pull request #1676 from lijinglue/hotfix/markdown-render-in-blog-post
hotfix: update markdown render in blog post feature
2018-03-14 13:56:18 +09:00
Junyoung Choi (Sai)
826a67b550 Merge pull request #1677 from BoostIO/allow-more
Allow b tag and style attribute
2018-03-14 13:09:38 +09:00
Junyoung Choi
f3d59a9b61 Allow b tag and style attribute 2018-03-14 13:03:57 +09:00
lijinglue
65434453b8 hotfix: update markdown render in blog post feature 2018-03-14 00:30:29 +08:00
Junyoung Choi
b8658abbad v0.11.2 2018-03-13 23:12:32 +09:00
Junyoung Choi (Sai)
0387b33f6c Merge pull request #1673 from BoostIO/update-whitelist
Use same settings of github
2018-03-13 23:02:52 +09:00
Junyoung Choi (Sai)
41042fe64e Merge pull request #1664 from mirsch/fix-copy-note-link-from-list
fix "copy note link from note list" link format
2018-03-13 23:02:44 +09:00
Junyoung Choi (Sai)
1efc3bb15d Merge pull request #1663 from BoostIO/note-list-ui
Fix note list UI
2018-03-13 22:45:51 +09:00
Junyoung Choi
0816a9410b Use same settings of github 2018-03-13 22:41:17 +09:00
Junyoung Choi (Sai)
cb823eaaa6 Merge pull request #1670 from rayou/fix-1661-move-folder-cursor-style
Added draggable folder handle #1661
2018-03-13 22:04:53 +09:00
Junyoung Choi (Sai)
44f027bf18 Merge pull request #1671 from BoostIO/more-whitelist
Add table and details stuff to whitelist
2018-03-13 22:02:06 +09:00
Junyoung Choi
571d159a1f Add table and details stuff to whitelist 2018-03-13 22:00:07 +09:00
Yu-Hung Ou
a30d977727 added draggable folder handle 2018-03-13 23:42:14 +11:00
Simon
847ad2d781 Merge branch 'master' into localization 2018-03-13 09:24:53 +01:00
mirsch
da9067a672 fix "copy note link from note list" introduced in #1583 to reflect changes from #1636 2018-03-12 15:23:37 +01:00
Kazu Yokomizo
5ed5950ed5 Fix note list UI 2018-03-12 22:14:06 +09:00
Junyoung Choi
f53c182cfb Fix version 2018-03-12 18:50:22 +09:00
Junyoung Choi
bb2978b370 v0.11.1 2018-03-12 17:53:16 +09:00
Junyoung Choi (Sai)
66ae4a5163 Merge pull request #1660 from JKetelaar/bugfix/grammar-change
Fixed English typo & grammar
2018-03-12 17:44:40 +09:00
Jeroen Ketelaar
f435595ad8 Fixed English typo & grammar 2018-03-12 09:42:44 +01:00
Junyoung Choi (Sai)
4bec4596fe Merge pull request #1659 from BoostIO/fix-checkbox
Allow checkbox
2018-03-12 17:41:29 +09:00
Junyoung Choi
10b86aec49 Allow checkbox 2018-03-12 17:40:27 +09:00
Simon
ecabd37cbb Setting default language in DEFAULT_CONFIG 2018-03-12 07:26:19 +01:00
Junyoung Choi (Sai)
f3cabfcb4d Merge pull request #1656 from BoostIO/feature-v0-11-0
v0.11.0
2018-03-12 11:45:12 +09:00
Junyoung Choi
46fc010cf9 v0.11.0 2018-03-12 11:34:17 +09:00
Junyoung Choi (Sai)
e370c76521 Merge pull request #1655 from rayou/fix-1609-missing-classname
fixed missing classname in lib/markdown highlight render function
2018-03-12 11:32:18 +09:00
Junyoung Choi (Sai)
1c283f88d0 Merge pull request #1636 from mirsch/remove-volatile-hash-from-note-links
remove volatile hash from note links - #1623
2018-03-12 11:26:41 +09:00
Yu-Hung Ou
cfffa1b10a fixed missing classname in lib/markdown highlight render function 2018-03-11 16:22:04 +11:00
Junyoung Choi (Sai)
8aaae4de49 Merge pull request #1650 from Paalon/katex_update
Update KaTeX Library from 0.8.3 to 0.9.0.
2018-03-10 18:43:18 +09:00
Simon
4f6c35713e Added languages; better German translation 2018-03-09 17:30:11 +01:00
paalon
8fb0b5b572 Update KaTeX Library from 0.8.3 to 0.9.0. 2018-03-10 00:36:00 +09:00
Junyoung Choi (Sai)
12262671ee Merge pull request #1649 from rayou/fix-1562-change-dummy-data-minimum-count
Changed the minimum count of dummy data (folders and notes)
2018-03-09 23:51:39 +09:00
Junyoung Choi (Sai)
3165c62985 Merge pull request #1621 from rayou/feature/add-smartquotes-toggle
Added support for toggling smart quotes in preview
2018-03-09 23:37:42 +09:00
Junyoung Choi
1ca1166f74 Merge branch 'master' into feature/add-smartquotes-toggle 2018-03-09 23:30:54 +09:00
Junyoung Choi (Sai)
7b4d2f3b97 Merge pull request #1617 from pfftdammitchris/folder-dragging
Folders in the side nav are now draggable
2018-03-09 23:17:41 +09:00
Junyoung Choi (Sai)
ccce75a047 Merge pull request #1616 from pfftdammitchris/master
Sort tags alphabetically
2018-03-09 21:33:38 +09:00
Yu-Hung Ou
410e82e375 increased the minimum count of dummy notes to 2 2018-03-09 23:28:01 +11:00
Yu-Hung Ou
bd385ec062 increased the minimum count of dummy folders to 2 2018-03-09 23:27:49 +11:00
Junyoung Choi (Sai)
638227ef25 Merge pull request #1614 from RomanKlopsch/master
Fix missing progress bar in note list
2018-03-09 20:51:34 +09:00
Junyoung Choi (Sai)
e70b35126b Merge pull request #1648 from rayou/fix-1609-wrong-codeblock-style
fixed code block style in exported HTML file
2018-03-09 20:50:22 +09:00
Simon
4d41c7f37f Changed default language to en 2018-03-09 07:39:08 +01:00
Yu-Hung Ou
d01a7b16a1 fixed codeblock style in exported HTML file 2018-03-08 23:40:13 +11:00
Kazz Yokomizo
326d873279 Merge pull request #1646 from BoostIO/update-readme
Update-readme
2018-03-08 11:38:19 +09:00
Kazz Yokomizo
74c32bed29 Update-readme 2018-03-08 11:35:41 +09:00
Nikolay Lopin
a222fd0786 Add animation for scrolling with buttons 2018-03-08 01:02:49 +03:00
Yu-Hung Ou
c633ba9497 Merge branch 'master' into feature/add-smartquotes-toggle 2018-03-07 22:25:39 +11:00
Simon
40b5472866 Adjustments for Travis CI 2018-03-07 08:37:55 +01:00
Simon
a413e273ca Added strings in notifications 2018-03-07 08:20:05 +01:00
Simon
0f82085cae Adjustments for Travis CI 2018-03-07 07:10:49 +01:00
Junyoung Choi (Sai)
fa1ab04409 Merge pull request #1643 from mirsch/export-responsive-html
Export responsive html, fixes #1442
2018-03-07 10:16:14 +09:00
mirsch
f370508c93 fixes #1442, Export responsive html 2018-03-07 01:08:10 +01:00
Nikolay Lopin
7472019422 Change property responsible for scrolling from "offsetLeft" to "scrollLeft" 2018-03-07 01:55:04 +03:00
Simon
aa3597881a added more strings 2018-03-06 15:56:48 +01:00
Simon
a36841e501 Implemented language switch in Interface Config Tab 2018-03-06 15:04:04 +01:00
Simon
fe9afc8952 extracted all strings from html lines 2018-03-06 14:07:04 +01:00
Simon
63d39a81aa Merge branch 'localization' of github.com:SiSchae/Boostnote into localization
hoffe es läuft
2018-03-06 10:02:29 +01:00
Simon
b11dc2ca20 first testing of translation 2018-03-06 09:54:37 +01:00
Junyoung Choi (Sai)
10f5ad6127 Merge pull request #1639 from thedavidgay/add-charset-to-html-export
add UTF-8 tag to HTML export (fixes #1624)
2018-03-06 17:30:04 +09:00
David Gay
4800a88cf6 add UTF-8 tag to HTML export (fixes #1624) 2018-03-05 21:22:42 -05:00
Junyoung Choi (Sai)
9d8bc40594 Merge pull request #1634 from Redsandro/xssSecurity
SECURITY HOTFIX - Remove XSS attack
2018-03-06 03:08:19 +09:00
Junyoung Choi (Sai)
7d3d96a6e0 Merge pull request #1612 from kawmra/fix-title-decoding
Properly decoding for the title of pasted website
2018-03-05 11:36:53 +09:00
Junyoung Choi
4c99429d76 Merge branch 'master' into fix-title-decoding 2018-03-05 11:36:31 +09:00
Junyoung Choi (Sai)
96fbd7572c Merge pull request #1611 from romainwn/feat/addFullScreen
add Toggle FullScreen feat + shortcut
2018-03-05 11:28:28 +09:00
Junyoung Choi (Sai)
b012bba6d6 Merge pull request #1601 from rayou/fix-missing-zoom-button
fixed missing zoom button - #1598
2018-03-05 11:27:27 +09:00
Junyoung Choi (Sai)
45d90b2530 Merge pull request #1594 from clone1612/list_fix
Fix insertion in Markdown lists - #1588 & 1605
2018-03-05 11:25:46 +09:00
Junyoung Choi (Sai)
a8b946a07a Merge pull request #1593 from Redsandro/searchFixes
Add search tweaks; closes 1525 closes 1167
2018-03-05 11:23:48 +09:00
Junyoung Choi (Sai)
18392c4f23 Merge pull request #1591 from Redsandro/scrollSyncFix
Fixed bad merge; closes #1586; related to #1521
2018-03-05 11:16:42 +09:00
Junyoung Choi (Sai)
88e7869284 Merge pull request #1584 from pfftdammitchris/codeeditor-snippet-options-overlapping
Fixes UI overlapping in the snippet editor (bottom options)
2018-03-05 11:14:26 +09:00
Junyoung Choi (Sai)
3c8332c448 Merge pull request #1583 from pfftdammitchris/copylink-notelist
Adds the ability to copy the note link from the note list
2018-03-05 11:13:00 +09:00
Junyoung Choi
207f95693a Merge branch 'master' into copylink-notelist 2018-03-05 11:12:42 +09:00
Junyoung Choi (Sai)
de15120bf8 Merge pull request #1579 from nlopin/move-pictures-between-storages
Move images between storages together with note
2018-03-05 11:06:32 +09:00
Junyoung Choi (Sai)
1dcf11e1c4 Merge pull request #1575 from lurong-hkg/feature/publish-to-wordpress
allow publishing markdown to wordpress
2018-03-05 10:55:05 +09:00
mirsch
b74ba22c44 adjust keygen to use uuid only for notes (uuid on storage/folders woud need more refactoring) 2018-03-05 00:02:30 +01:00
mirsch
fa2d34dcfc fix delete and empty trash 2018-03-04 23:28:18 +01:00
mirsch
0280a5f09e use uuid in keygen, remove storage.key from note hash 2018-03-04 22:21:14 +01:00
Nikolay Lopin
a35f876f4f Merge branch 'master' into new-snippet-tabbar 2018-03-05 00:06:57 +03:00
Sander Steenhuis
c22b7f81c1 Allow iframe size, allow fullscreen 2018-03-04 17:49:17 +01:00
Sander Steenhuis
9344fd78d8 Remove xss attack; closes #1443 at least partially 2018-03-04 17:28:41 +01:00
Yu-Hung Ou
e89c0a3e61 added support for toggling smart quotes in preview 2018-03-02 00:06:58 +11:00
pfftdammitchris
5aa7ef5738 Folders in the side nav are now draggable 2018-02-28 18:33:14 -08:00
pfftdammitchris
88ac6c6fc6 Sort tags alphabetically 2018-02-28 16:34:42 -08:00
Roman Klopsch
a537f9762b Fix missing progress bar in note list 2018-02-28 16:00:42 +01:00
Romain Le Quellec
aab192223a add Toggle FullScreen feat + shortcut 2018-02-28 11:39:45 +01:00
kawmra
6439810d03 Decode the fetched body correctly if content-type was provided 2018-02-28 02:09:35 +09:00
Yu-Hung Ou
8ae7d96cc7 updated Travis CI node version 2018-02-27 23:59:32 +11:00
Yu-Hung Ou
c5c78763d1 fixed missing zoom button 2018-02-27 23:17:15 +11:00
Jannick Hemelhof
012908e32d Linting fixes 2018-02-26 16:43:13 +01:00
Jannick Hemelhof
1f1e545538 Fix for list insertion 2018-02-26 16:32:47 +01:00
Sander Steenhuis
5b8519b2b8 Bind up/down to prev/next event; closes #1167 2018-02-26 16:30:14 +01:00
Sander Steenhuis
6502158716 Add search clear options; closes #1525 2018-02-26 16:30:08 +01:00
lurong
7c525ab7a6 fix lint 2018-02-26 21:27:42 +08:00
Lu Rong
778e3d9799 Merge pull request #1 from lijinglue/feature/publish-to-wordpress
checking if return is valid before creating the blog attr in note
2018-02-26 21:21:15 +08:00
lijinglue
e5f986a959 checking if return is valid before creating the blog attr in note 2018-02-26 21:19:55 +08:00
Sander Steenhuis
d76ecd5423 Fixed bad merge; closes #1586; related to #1521 2018-02-26 13:20:24 +01:00
Markus Deuerlein
6bcb6398f8 German translation: minor corrections (#1585)
* minor corrections

some german improvements and corrections of the translation

* update link to docs/de/debug.md

* minor corrections

* minor corrections

* minor corrections

* minor corrections

* minor corrections
2018-02-26 21:08:03 +09:00
pfftdammitchris
6c341d8fa5 Fixes UI overlapping in the snippet editor (bottom options) 2018-02-25 07:41:50 -08:00
pfftdammitchris
0d5e57eeab Adding the ability to copy the note link from the note list 2018-02-25 07:17:01 -08:00
lurong
aef603ed8c rebase and prefer const in node list 2018-02-25 22:50:51 +08:00
lurong
97600e526b remove the first occurrence of title in content when publishing to WP 2018-02-25 22:44:57 +08:00
lurong
f3f6095d81 allow publishing markdown to wordpress 2018-02-25 22:44:57 +08:00
Junyoung Choi (Sai)
fb7280127c Merge pull request #1581 from BoostIO/v0.10.0
v0.10.0
2018-02-25 15:51:59 +09:00
Junyoung Choi
60df509fc6 v0.10.0 2018-02-25 14:30:57 +09:00
Junyoung Choi (Sai)
ced237fbda Merge pull request #1556 from pfftdammitchris/all-notes-storage-labels
Add storage labels to 'All Notes' and figure a better solution to the dull storage notes list view
2018-02-25 14:27:35 +09:00
Nikolay Lopin
9473a26892 Move images between storages together with note
1. Added new step of moving note's images to `moveNote` function
2. Changed behaviour of sidebar navigation after move finished

Issue #1578
2018-02-25 02:47:28 +03:00
Nikolay Lopin
e5825e898d allow to copy images without generating new name 2018-02-25 02:45:59 +03:00
Nikolay Lopin
8d59bd9f71 Remove redundant symbol from regexp 2018-02-25 02:42:15 +03:00
pfftdammitchris
8f90bb83e7 Added title attributes to support long folder names and foldernames are no longer overflowing nearby elements 2018-02-24 08:42:02 -08:00
pfftdammitchris
ba888a7165 Moved viewType to outer scope so it invokes once (to save resources) 2018-02-24 07:10:46 -08:00
Christopher Tran
9591a7cac2 Merge branch 'master' into all-notes-storage-labels 2018-02-24 06:40:25 -08:00
Junyoung Choi (Sai)
e8fd53d8b7 Merge pull request #1567 from pfftdammitchris/fix-toggle-view-css-positioning
Fixed ToggleMode button overlapping CSS issue
2018-02-24 16:44:41 +09:00
Junyoung Choi (Sai)
3b7c36b1c9 Merge pull request #1559 from pfftdammitchris/tags-note-count
Added note counts to tags view in side nav
2018-02-24 16:19:53 +09:00
Junyoung Choi (Sai)
2750a3ef30 Merge pull request #1558 from pfftdammitchris/empty-trash
Added option Empty Trash
2018-02-24 16:18:43 +09:00
Junyoung Choi (Sai)
7d59f51244 Merge pull request #1549 from nlopin/restore-note-enhancing
Restore note UX enhancements
2018-02-24 16:05:00 +09:00
Nikolay Lopin
a3ec6f470a Add horizontal scroll for touch devices 2018-02-24 01:03:25 +03:00
Nikolay Lopin
8e85a33dac Show Arrows at snippets tab bar only when needed 2018-02-24 00:49:21 +03:00
Nikolay Lopin
77542597f5 onClick listener fix 2018-02-23 10:26:48 +03:00
pfftdammitchris
2a26e8a010 Added folder labels to note items when viewing a specific storage 2018-02-22 17:31:31 -08:00
pfftdammitchris
8b4c1a6c38 Merge branch 'master' of https://github.com/BoostIO/Boostnote into all-notes-storage-labels 2018-02-22 16:16:43 -08:00
Junyoung Choi (Sai)
7d7e277cc6 Merge pull request #1533 from forestail/display-filename-in-codeblock
Display filename in codeblock (resend)
2018-02-22 11:06:20 +09:00
Junyoung Choi (Sai)
cb1da609a4 Merge pull request #1524 from Redsandro/highlightSearch
Highlight global search matches on code editor
2018-02-22 11:06:06 +09:00
Junyoung Choi
e4fbdb35a3 Rename a variable name again 2018-02-22 10:54:12 +09:00
Junyoung Choi
c3586372e0 Rename variables 2018-02-22 10:49:59 +09:00
Junyoung Choi
808d193543 Merge remote-tracking branch 'origin/master' into highlightSearch 2018-02-22 09:56:09 +09:00
Junyoung Choi (Sai)
0b65b70af2 Merge pull request #1570 from BoostIO/fix-memory-lick
Fix memory lickage
2018-02-22 09:43:43 +09:00
Junyoung Choi
deab34abd6 Fix memory lick 2018-02-22 09:39:56 +09:00
Junyoung Choi (Sai)
646cded650 Merge pull request #1521 from Redsandro/scrollsync
Sync Split Editor scroll position
2018-02-22 07:36:41 +09:00
Sander Steenhuis
9047320301 Update CodeEditor.js - Forgot curly brace
Forgot curly brace when merging master
2018-02-21 19:17:38 +01:00
Sander Steenhuis
f16b054f01 Merge branch 'master' into scrollsync 2018-02-21 19:04:24 +01:00
Junyoung Choi (Sai)
fea856202d Merge pull request #1509 from Antogin/feat/display-url-title
Feat/display url title
2018-02-21 16:33:34 +09:00
pfftdammitchris
4f15cc3f08 Fixed ToggleMode button overlapping CSS issue
The absolute positioning of the toggle mode button was creating a static overlapping position issue with the top bar. This fix solves that problem by removing the static positioning and coupling the button component with the buttons to the right
2018-02-20 21:09:43 -08:00
Nikolay Lopin
1769dd959e Revert spaces 2018-02-21 03:21:40 +03:00
Nikolay Lopin
1253b81a01 Introduce tabs with minimal width 2018-02-21 03:08:40 +03:00
Sander Steenhuis
3b524f6aba Highlight global search matches on code editor 2018-02-20 22:46:13 +01:00
Sander Steenhuis
051ccad29a Rename variables 2018-02-20 22:36:38 +01:00
Sander Steenhuis
c82eba05d1 Sync Split Editor scroll position 2018-02-20 22:31:53 +01:00
pfftdammitchris
74af199afc Added note counts to tags view in side nav 2018-02-19 13:08:09 -08:00
pfftdammitchris
c2afdba659 Removed useless url route check 2018-02-19 12:41:36 -08:00
pfftdammitchris
e6ae45f133 Added option Empty Trash 2018-02-19 12:27:04 -08:00
pfftdammitchris
129ef6766b Add storage labels to 'All Notes'
Added storage labelings to 'All Notes' in Default and Compressed views
2018-02-19 10:17:36 -08:00
Masahide Morio
3194a7b1a2 followed eslintrc 2018-02-19 23:02:25 +09:00
Kazz Yokomizo
46a733ba5b Merge pull request #1543 from nlopin/edit-on-dblckick
Switch from preview to edit by double click
2018-02-19 15:56:22 +09:00
Kazz Yokomizo
466844fc55 Merge pull request #1528 from Redsandro/selectionOnSearch
UX: Keep selection synced with note visibility
2018-02-19 15:07:25 +09:00
Kazz Yokomizo
0cc793e3fe Merge pull request #1554 from BoostIO/change-blog-url
Change the blog link to Boostlog from Medium
2018-02-19 15:05:00 +09:00
Kazu Yokomizo
0fdfb385a4 Change blog to Boostlog from Medium 2018-02-19 15:01:08 +09:00
Nikolay Lopin
419a4c6b2d Add "Restore note" item to menu in Trash view. 2018-02-17 00:38:19 +03:00
Nikolay Lopin
55e9441547 Introduce RestoreButton component instead of plain JSX 2018-02-17 00:37:36 +03:00
Kazz Yokomizo
7abff6ded4 Merge pull request #1527 from Redsandro/dont_count_trashed_notes
Trashed notes should not be counted
2018-02-15 11:49:20 +09:00
Kazz Yokomizo
a648d310a5 Merge pull request #1539 from pfftdammitchris/master
Added title attributes to elements to show information on hover --- more like a native app feel to it
2018-02-15 11:40:26 +09:00
Kazz Yokomizo
4b56fa56b5 Merge pull request #1544 from nlopin/global-pin-to-top
Show pinned notes in All notes view and allow to pin them there
2018-02-15 11:33:44 +09:00
Nikolay Lopin
18bf700936 Show pinned notes in All notes view and allow to pin them there
All restrictions of pin functionality were removed. Now user can see pinned notes and also pin notes right from 'home'. Technically, a note still pins to the storage it belong.

#1506
2018-02-14 23:35:11 +03:00
Nikolay Lopin
67ddff736c Switch from preview to edit by double click
User want to click markdown to work with text (for example copy).
If they have "Switch to Preview" setting in "When Editor Blurred",
they enter edit mode after click. To fix that issue I introduced new
value to the "Switch to Preview" setting that do that thing. User can
enter edit mode by double click on the editor and leave it on blur.

Unfortunately, it's impossible to switch both ways by double click
because the editor mode is listening for double click event.

#1523
2018-02-13 23:43:11 +03:00
Kazz Yokomizo
1bba125a2a Merge pull request #1542 from BoostIO/change-company-name
Change the company name
2018-02-13 13:44:18 +09:00
Kazu Yokomizo
187acad592 Change the company name 2018-02-13 13:37:04 +09:00
Sander Steenhuis
5e07c7b3e1 Update selection on new note; closes #1507 2018-02-12 18:15:05 +01:00
pfftdammitchris
cd942cf8b6 Added title attributes to elements to show quick information on each element---like a native app 2018-02-11 19:12:28 -08:00
Masahide Morio
c43589fe6a Add file name and any first line number in code block (fixed) 2018-02-11 02:28:03 +09:00
Junyoung Choi (Sai)
d4594eff3b Merge pull request #1502 from Matts966/feature/new_line_completion
I fixed the behavior of the editor when the enter key is pushed.
2018-02-10 22:53:29 +09:00
Junyoung Choi (Sai)
809a0e846b Merge pull request #1531 from nlopin/export-note-with-images
Remove direct css styling todo lists from MarkdownPreview component
2018-02-10 22:39:10 +09:00
Nikolay Lopin
7f00ce2598 Merge remote-tracking branch 'origin/export-note-with-images' into export-note-with-images 2018-02-10 14:05:34 +03:00
Nikolay Lopin
d7d77dbfe9 Fix wrong styling of todo items in exported HTML
The issue happened because styles connected with todo list were applied directly to HTML in Preview component. I added class to `li` tag of each todo item and style it from css.
2018-02-10 14:03:02 +03:00
Junyoung Choi (Sai)
7a124c74cc Merge pull request #1483 from andyklimczak/delete-note
Fix permanently deleting note
2018-02-10 18:47:41 +09:00
Junyoung Choi (Sai)
f8549f4643 Merge pull request #1501 from Matts966/typo/fix_a_typo_of_log
very easy fix.
2018-02-10 18:47:22 +09:00
Junyoung Choi (Sai)
0476ff70da Merge pull request #1306 from nlopin/export-note-with-images
Export note with local images
2018-02-10 18:45:53 +09:00
Junyoung Choi
5ec541c3c1 Manipulate left margin of task item to hide circle 2018-02-10 18:29:57 +09:00
Sander Steenhuis
7b920348f3 UX: Keep selection synced with note visibility 2018-02-10 01:30:14 +01:00
Sander Steenhuis
51b1ef41a1 Trashed notes should not be counted 2018-02-09 23:10:40 +01:00
Nikolay Lopin
12447effc9 Reject promise if write to file failed 2018-02-06 22:19:06 +03:00
Georges Indrianjafy
dc1b059a9d clean up 2018-02-06 19:12:25 +02:00
Georges Indrianjafy
a676ebf46c fix(editor): replace [] with <> 2018-02-06 18:35:11 +02:00
Nikolay Lopin
338f9fb5a9 Semicolon fix 2018-02-05 13:04:01 +03:00
Nikolay Lopin
98c9132d4a Merge branch 'master' into export-note-with-images
# Conflicts:
#	browser/components/MarkdownPreview.js
2018-02-05 12:59:45 +03:00
Georges Indrianjafy
a054f12492 Merge branch 'master' into feat/display-url-title
# Conflicts:
#	browser/components/CodeEditor.js
#	browser/finder/NoteDetail.js
2018-02-05 11:50:14 +02:00
Georges Indrianjafy
c42ac1df1b chore(editor): resolve lint issues 2018-02-05 11:00:56 +02:00
Georges Indrianjafy
d9d46cda1c feat(editor): extract pasting url method 2018-02-05 10:59:36 +02:00
Nikolay Lopin
f678a17505 Export images together with document 2018-02-05 02:08:33 +03:00
Nikolay Lopin
3da4bb69ce Export images together with document 2018-02-05 02:08:09 +03:00
Georges Indrianjafy
3e2b876c59 fix(config): refrase 2018-02-04 17:49:23 +02:00
Georges Indrianjafy
10daf2599d chore: fix lint isues 2018-02-04 17:39:32 +02:00
Georges Indrianjafy
56d6eb7077 feat(config): add ablility to opt out of fetch url 2018-02-04 13:58:02 +02:00
Georges Indrianjafy
9b54272f8e feat(code-editor): fetch title when pasting url 2018-02-04 13:57:00 +02:00
松井誠泰
685e003db8 delete log. 2018-02-04 10:12:55 +09:00
松井誠泰
701fc0bc80 I fixed the behavior of the editor.
On enter key pushed, if already the line contains a token in markdown list, no completion is needed, I think.

By this change, node_modules/codemirror/addon/edit/continueList.js could be trashed, but I can't because of the gitignore.
2018-02-04 10:03:50 +09:00
松井誠泰
e5518ac0fa very easy fix. 2018-02-04 09:14:31 +09:00
Junyoung Choi
8e1bf48cd1 Close immediately on windows 2018-02-04 00:59:54 +09:00
Junyoung Choi
8dd82e1a3b Disable uglify 2018-02-04 00:12:38 +09:00
Junyoung Choi
4418bfe965 v0.9.0 2018-02-03 23:50:49 +09:00
Junyoung Choi
39c4d710bc Remove unnecessary logging 2018-02-03 23:45:46 +09:00
Junyoung Choi (Sai)
51a8c47afd 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
2018-02-03 23:39:53 +09:00
Kazz Yokomizo
922570bb5c Merge pull request #1495 from BoostIO/fix-todo-style
Fix percentage bar in markdown preview
2018-02-03 16:32:37 +09:00
Kazu Yokomizo
ca282d5635 Fix percentage bar in markdown preview 2018-02-03 16:32:02 +09:00
Junyoung Choi
ff67043210 Bump version 2018-02-03 15:52:51 +09:00
Junyoung Choi
31da231c1c Rollback .travis.yml 2018-02-03 15:28:19 +09:00
Junyoung Choi
eb698a7430 Fix lint error 2018-02-03 15:10:16 +09:00
Junyoung Choi
03be809ba9 Text stable version only
The current version of boostnote doesn't support the latest stable version, v9.x
2018-02-03 15:03:33 +09:00
Junyoung Choi
69601bf15a Fix but: line numbers of editor isnt applied properly 2018-02-03 15:02:26 +09:00
Junyoung Choi
7cad3d403b Discard unnecessary logging 2018-02-03 15:00:06 +09:00
Junyoung Choi (Sai)
cc84af3346 Merge pull request #1458 from cyalins/cyalins-patch-1
Improved overall wording and grammar of preferences
2018-02-03 14:27:55 +09:00
Junyoung Choi
33ef54a162 Fix lint errors 2018-02-03 14:16:26 +09:00
Junyoung Choi (Sai)
ac43ff886a Merge pull request #1494 from Paalon/katex_update
Update KaTeX library from 0.7.1 to 0.8.3
2018-02-03 13:57:30 +09:00
Junyoung Choi (Sai)
a64f73ca0c Merge pull request #879 from xxdavid/feature-editor-line-lines
Make line numbers in the editor optional
2018-02-03 13:57:00 +09:00
Paalon
314477d2fc Update yarn.lock 2018-02-02 17:01:15 +09:00
Paalon
c63fc93daa Update katex from 0.7.1 to 0.8.3. 2018-02-02 16:45:33 +09:00
Andy Klimczak
f04ad1e702 list:moved -> list:next 2018-01-31 22:17:36 -05:00
Kazz Yokomizo
2183c4bda6 Merge pull request #1480 from allejo/feature-preview-scroll
Allow preview area to scroll past end of file
2018-01-31 18:01:32 +09:00
Kazz Yokomizo
6ba91c1515 Merge pull request #1472 from Antogin/feat/add-ability-to-clone-note
Feat/add ability to clone note
2018-01-31 17:55:46 +09:00
Andy Klimczak
dc03bb76e6 Fix 2018-01-30 23:15:16 -05:00
Vladimir Jimenez
d0559c16b5 Pass correct preview prop to MarkdownEditor 2018-01-30 07:42:16 -08:00
Kazz Yokomizo
eb693f7b48 Merge pull request #1481 from andyklimczak/1476-tag-check
Remove leading # when creating tag
2018-01-30 21:50:12 +09:00
Georges Indrianjafy
ef5639ff4b chore: removing space 2018-01-30 11:56:59 +02:00
Georges Indrianjafy
34a335797c chore: remove trailing space 2018-01-30 11:49:39 +02:00
Georges Indrianjafy
edda3a4d23 chore: cleanup 2018-01-30 11:45:47 +02:00
Georges Indrianjafy
184839423f fix(NoteList): remove router 2018-01-30 10:37:58 +02:00
Kazz Yokomizo
c0f3600a52 Merge pull request #1484 from BoostIO/fix-#1477
Fix #1477
2018-01-30 01:00:13 -05:00
Kazu Yokomizo
2b1302aa07 Fix #1477 2018-01-30 14:38:53 +09:00
Andy Klimczak
d894bb4aab Fix permanently deleting note
- Permanently deleting note would not remove note from list until after
refresh
- Fix so permanently deleted note is removed list
2018-01-29 21:51:57 -05:00
Andy Klimczak
470c071344 Remove leading # when creating tag
- Remove leading # from tags that are created with leading #
- Convenience method for users who tend to type them, but did not want a
tag with double #
- If a user wants a tag with a leading #, then can double it (ie: ##OfPeople)
2018-01-29 20:42:59 -05:00
Vladimir Jimenez
4bd639c6c4 Allow preview area to scroll past end of file 2018-01-29 17:11:42 -08:00
Georges Indrianjafy
4cb7e63421 chore: clean up 2018-01-29 09:25:01 +02:00
Georges Indrianjafy
9f14a503d8 fix(history): use hashHistory 2018-01-29 09:24:12 +02:00
Georges Indrianjafy
d5da6de86c fix(NoteList): fix router issue 2018-01-29 09:13:09 +02:00
Georges Indrianjafy
4c2b233722 fix: resolve ci issues 2018-01-27 17:45:50 +02:00
Georges Indrianjafy
ca5b1eea13 chore: removing console.log 2018-01-27 17:33:22 +02:00
Georges Indrianjafy
614e9b6d55 feat(NoteList): add ability to clone note 2018-01-27 14:16:29 +02:00
cyalins
27b2530b8d Undoing an accidental edit 2018-01-26 21:12:10 +11:00
Kazz Yokomizo
2259167200 Merge pull request #1464 from BoostIO/fix-editor-lock-btn
Fix the editor lock button layout
2018-01-25 13:38:33 -05:00
Kazu Yokomizo
2e05214828 Fix the editor lock button layout 2018-01-25 13:30:36 -05:00
Kazz Yokomizo
cfb996039b Merge pull request #1453 from BoostIO/fix-info-right-layout
WIP - Fix info right buttons layout
2018-01-25 09:37:24 -05:00
Kazz Yokomizo
44c4d56214 Merge pull request #1457 from stevequinn/1238
Allows keyboard text selection in Finder search box
2018-01-25 09:34:59 -05:00
cyalins
8e6be91f7c Improved consistency of wording in Storage tab 2018-01-25 13:57:15 +11:00
cyalins
00816fb2c8 Improved clarity of wording in UI Tab 2018-01-25 13:56:11 +11:00
cyalins
535356b77f Improved clarity of tab titles 2018-01-25 13:53:50 +11:00
cyalins
5e558746ce Reworded Hotkey preferences 2018-01-25 13:52:04 +11:00
cyalins
f7bd52ac0c Improved clarity of crowdfunding message 2018-01-25 13:46:08 +11:00
cyalins
9165f518a9 Improved wording of data collection 2018-01-25 13:41:24 +11:00
Steve Quinn
01605aa221 Allows keyboard text selection in Finder search box 2018-01-25 13:27:43 +11:00
cyalins
8b0b29c424 Improved clarity of wording 2018-01-25 13:27:02 +11:00
Kazu Yokomizo
7a116966fa Add tooltip to full-screen-btn on the snippet note detail 2018-01-24 16:16:14 -05:00
Kazu Yokomizo
e7e8f11a74 Fix tooltips position 2018-01-24 16:08:44 -05:00
Kazu Yokomizo
f235d832d5 Fix note detail layout 2018-01-24 16:03:50 -05:00
Kazu Yokomizo
7730b5e20b Change size of icons on note detail 2018-01-24 15:39:27 -05:00
Kazu Yokomizo
8c3ba4ce48 Fix infopanel 2018-01-24 15:26:45 -05:00
Kazu Yokomizo
e9a126f586 Fix multiple colors 2018-01-24 15:19:13 -05:00
Kazu Yokomizo
097e7d2ff2 Fix tooltip 2018-01-24 15:13:45 -05:00
Kazu Yokomizo
81265f1238 Reorder of buttons 2018-01-23 21:02:19 -05:00
Kazu Yokomizo
2b507e6e20 Zoom button to display none 2018-01-23 20:57:57 -05:00
Kazu Yokomizo
747d3a8f13 Fix note detail width 2018-01-23 20:55:29 -05:00
Kazu Yokomizo
30f6f07434 Fix info right buttons layout 2018-01-23 20:50:48 -05:00
Kazz Yokomizo
6de5488a15 Merge pull request #1451 from BoostIO/update-readme
Update readme
2018-01-23 11:50:32 -05:00
Kazz Yokomizo
5413647166 Update readme 2018-01-23 11:46:22 -05:00
Kazz Yokomizo
e83fe73b18 Merge pull request #1271 from mslourens/utf8-uml
convert uml to utf8 before converting to base64
2018-01-17 09:47:56 -05:00
Kazz Yokomizo
87a289ec65 Merge pull request #1429 from yamash723/fix-markdown-list-link-style
Remove inline-style from markdown link list
2018-01-17 09:33:51 -05:00
yamash723
8a0a118dba Remove inline-style from markdown link list 2018-01-17 16:32:43 +09:00
Kazz Yokomizo
687126ce87 Merge pull request #1419 from mslourens/html-export-encoding
added encoding meta tag
2018-01-16 08:06:30 -05:00
Kazz Yokomizo
8a05d577da Merge pull request #1425 from BoostIO/fixed-save-button
make save button position:fixed
2018-01-16 08:05:08 -05:00
Kazz Yokomizo
4c3ebfc0f8 Merge pull request #1418 from mslourens/import-note-name
name note to imported file
2018-01-16 08:04:25 -05:00
Sosuke Suzuki
6093f25f9a make save button position:fixed 2018-01-16 19:37:01 +09:00
Maurits Lourens
ecab68d676 removed unused imports 2018-01-16 10:09:02 +01:00
Maurits Lourens
1cb4f37c95 moved the import outside the use config section 2018-01-15 22:27:38 +01:00
Maurits Lourens
14318528b9 added encoding meta tag 2018-01-15 22:18:23 +01:00
Maurits Lourens
9c0e1f8f1a name note to imported file 2018-01-15 21:33:17 +01:00
Kazz Yokomizo
2034ce9e4d Merge pull request #1416 from mslourens/copy-note-link
added button for copy note link
2018-01-15 15:17:17 -05:00
Maurits Lourens
657489caf6 added button for copy note link 2018-01-15 21:01:18 +01:00
Kazz Yokomizo
94be3d1fe5 Merge pull request #1413 from BoostIO/fix-folded-layout
Fix the folded layout on side bar
2018-01-15 08:39:32 -05:00
Kazz Yokomizo
f6eae41cee Merge pull request #1412 from BoostIO/fix-1409
Fix the Solarized Dark Styling
2018-01-15 08:34:04 -05:00
Kazu Yokomizo
69c64434e3 Fix the folded layout on side bar 2018-01-15 08:33:23 -05:00
Kazz Yokomizo
256cabfce1 Merge pull request #1411 from BoostIO/change-ctrl-icon-windows
Change the control icon on Windows
2018-01-15 08:26:41 -05:00
Kazu Yokomizo
e8b8272cf9 Fix #1409 - Fix the Solarized Dark Styling 2018-01-15 08:22:02 -05:00
Kazu Yokomizo
bd5ab4881c Change the control icon on Windows 2018-01-15 07:57:36 -05:00
Junyoung Choi (Sai)
9630744bdb Merge pull request #1395 from BoostIO/feature-v0-8-20
v0.8.20
2018-01-13 19:43:49 +09:00
Junyoung Choi
ab3ad0eb97 v0.8.20 2018-01-13 19:01:53 +09:00
Junyoung Choi (Sai)
2393889028 Merge pull request #1394 from BoostIO/fix-export-folder-test
Fix exportFolder error
2018-01-13 18:58:45 +09:00
Junyoung Choi
c36ecb1ed1 Fix exportFolder error
writeFileSync doesn't require any errors
2018-01-13 18:48:34 +09:00
Junyoung Choi (Sai)
3e9b28ff0c Merge pull request #1384 from BoostIO/fix-background-color-bug
fix bug happen on solarized-dark CreateFolderModal.
2018-01-13 18:12:59 +09:00
Junyoung Choi (Sai)
d4eec461a9 Merge pull request #1393 from BoostIO/fix-update
Fix windows update
2018-01-13 18:00:44 +09:00
Junyoung Choi (Sai)
b584f37087 Merge pull request #1392 from BoostIO/cm-close-brackets
Cm close brackets
2018-01-13 18:00:12 +09:00
Junyoung Choi
5c75644db2 Check upate every day rather than every hour 2018-01-13 17:36:33 +09:00
Junyoung Choi
72d9e3e00b Fix update error
This error was caused by using super old version of
electron-winstaller.
2018-01-13 17:35:23 +09:00
Sosuke Suzuki
b3d3362f34 set autoCloseBrackets to cm defaultConfigurations 2018-01-13 15:37:14 +09:00
Sosuke Suzuki
1cbaf55cee import the addon for autoCloseBrackets 2018-01-13 15:10:18 +09:00
Sosuke Suzuki
7771875d57 Change CreateFolderInput style from raw color code to variable 2018-01-13 11:37:47 +09:00
Kazz Yokomizo
85937d8e23 Merge pull request #1324 from mslourens/confirmation-dialog
show delete confirmation dialog
2018-01-12 09:37:05 +09:00
Sosuke Suzuki
1480986a3a change submit button style 2018-01-11 18:34:00 +09:00
Sosuke Suzuki
bc968736df add colors for SolarizedDark 2018-01-11 18:30:57 +09:00
Kazz Yokomizo
ad80b8e8b6 Merge pull request #1379 from BoostIO/destroy-initmodal
remove initmodal
2018-01-10 23:36:35 +09:00
Sosuke Suzuki
d44d220c55 change default storage name from debugging to production 2018-01-10 19:40:04 +09:00
Sosuke Suzuki
f6bcef0789 remove unnecessary variables 2018-01-10 19:36:45 +09:00
Sosuke Suzuki
a28ec752e8 remove InitModalComponent 2018-01-10 19:36:13 +09:00
Sosuke Suzuki
48ea5746d9 move init function to Main.js 2018-01-10 19:33:58 +09:00
Kazz Yokomizo
f473d31970 Merge pull request #1368 from marcusstenbeck/patch-1
fix(code-editor): use correct prop for font family
2018-01-05 19:06:57 +09:00
Marcus Stenbeck
9cd1d4b466 fix(code-editor): use correct prop for font family 2018-01-05 10:54:48 +01:00
Kazz Yokomizo
4f02065eaf Merge pull request #1354 from trinode/feature-elixir-support
Elixir syntax highlighting
2018-01-04 20:31:45 +09:00
Kazz Yokomizo
4b85e3e8fb Merge pull request #1363 from BoostIO/fix-note-disppaer-bug
fix bug when add tag, disappear note.
2018-01-04 19:57:40 +09:00
Sosuke Suzuki
e4e8c2205e splid update functions 2018-01-04 18:12:27 +09:00
Maurits Lourens
18649dd074 fixed lint errors 2018-01-04 08:32:42 +01:00
Maurits Lourens
9f9463f0e8 fixed review comments 2018-01-03 23:08:42 +01:00
Kazz Yokomizo
6cf9bc5de2 Merge pull request #1361 from BoostIO/fix-ci-errror
Fix CI error at #1147
2018-01-04 04:07:49 +09:00
Kazu Yokomizo
297b4346c5 Fix CI error at #1147 2018-01-04 03:51:49 +09:00
Kazz Yokomizo
767a203439 Merge pull request #1147 from mslourens/export-folder
export folder as md or text
2018-01-04 03:50:24 +09:00
Kazz Yokomizo
c564c253b1 Merge pull request #1302 from mslourens/open-finder
fixed opening finder on Windows and Linux
2018-01-04 03:39:14 +09:00
Anthony Graham
b4e138e21b Elixir Syntax Highlighting 2018-01-01 21:17:29 +00:00
Kazz Yokomizo
8ca01921c4 Merge pull request #1349 from BoostIO/fix-live-preview-indent-bug
fix bug that config of editorIndentSize is not working.
2017-12-30 16:38:58 +09:00
Sosuke Suzuki
c8b97ffde3 pass fontSize and indentSize to CodeEditor as props 2017-12-30 11:04:13 +09:00
Kazz Yokomizo
abc84e5710 Merge pull request #1347 from BoostIO/fix-solarized-dark-infopanel
fix style
2017-12-29 21:56:55 +09:00
Sosuke Suzuki
d732d195f3 fix style 2017-12-29 21:38:40 +09:00
Kazz Yokomizo
789975abb0 Merge pull request #1343 from BoostIO/fix-table-backgroud-color
add table style in solarized-dark-theme
2017-12-28 22:57:39 +09:00
Sosuke Suzuki
ed1eab7fcc add table style in solarized-dark-theme 2017-12-28 22:48:59 +09:00
Kazz Yokomizo
29b31c114a Merge pull request #1337 from BoostIO/update-readme
Update readme
2017-12-28 11:13:48 +09:00
Kazz Yokomizo
c8cf353c21 Merge pull request #1220 from PaulRosset/add-notification-onChangeUi
Add notification on change ui
2017-12-28 10:45:21 +09:00
Kazz Yokomizo
e82e2c71f1 Update readme 2017-12-28 10:44:07 +09:00
Kazz Yokomizo
dd729c406f Merge pull request #1256 from mslourens/export-html
first attempt to export html
2017-12-28 10:38:55 +09:00
Kazz Yokomizo
3127e85900 Merge pull request #1329 from robbawebba/fix/jump-notes-by-link
Fix linking to other notes
2017-12-26 11:51:51 +09:00
Kazz Yokomizo
304eeb3158 Merge pull request #1331 from ncaron/master
Fix starred item count
2017-12-26 11:41:28 +09:00
Niko Caron
bf781c6b50 Fix starred item count
* Deleting a starred item will now update the starred count in the side nav. (delete from starred set)
* Restoring a starred item will add it the the starred set again.

Fix: #1326
2017-12-23 18:17:48 -04:00
David Pavlík
da1098e441 Merge branch 'master' into feature-editor-line-lines 2017-12-23 23:06:26 +01:00
David Pavlík
85065357e2 Make the option to disable line numbers in editor affect snippet notes too 2017-12-23 22:52:50 +01:00
David Pavlík
1f5f6c3b0e Rename 'lineNumber' to 'displayLineNumbers' 2017-12-23 22:51:38 +01:00
Rob Weber
4f7026969f Fix linking to other notes 2017-12-23 01:33:03 -08:00
Kazz Yokomizo
16d264ebfa Merge pull request #1328 from BoostIO/fix-style
Fix style
2017-12-23 15:32:02 +09:00
Kazu Yokomizo
04ffbe945b Delete unnecessary style 2017-12-23 15:25:45 +09:00
Kazu Yokomizo
974a1a1e7d Fix style 2017-12-23 15:18:16 +09:00
Kazz Yokomizo
ca2c07244f Merge pull request #1321 from mslourens/tooltips
added tooltips like the new note button
2017-12-23 15:12:17 +09:00
Kohei TAKATA
f90786d1c0 Merge pull request #1327 from BoostIO/feature-v0-8-19
v0.8.19
2017-12-23 12:51:13 +09:00
Kohei TAKATA
bdf55568c7 v0.8.19 2017-12-23 12:03:28 +09:00
Maurits Lourens
e262d2f19b fixed lint error 2017-12-21 19:15:34 +01:00
Maurits Lourens
aabfe820ac refactored to prevent duplicate code 2017-12-21 17:41:08 +01:00
Maurits Lourens
3bba5442bd show delete confirmation dialog 2017-12-21 15:57:27 +01:00
Maurits Lourens
6ce1922fb3 added tooltips like the new note button (and consequently extracted some buttons and styles) 2017-12-21 15:23:13 +01:00
Maurits Lourens
9367a404ef converted line-endings back to lf 2017-12-21 09:37:17 +01:00
Kazz Yokomizo
7c8e19c681 Merge pull request #1312 from BoostIO/fix-layout
Fix switch button layout
2017-12-20 18:56:31 +09:00
Kazu Yokomizo
7ccc5eb9b8 Fix switch button layout 2017-12-20 18:50:53 +09:00
Kazz Yokomizo
b4b6d3d07c Merge pull request #1243 from BoostIO/detect-AMA-errors
Detect ama errors
2017-12-20 18:27:24 +09:00
Kazz Yokomizo
9007bac7b2 Merge pull request #1307 from BoostIO/split-markdown
Split markdown
2017-12-20 18:20:49 +09:00
Sosuke Suzuki
df13ca3c92 make splitMode Default 2017-12-20 18:11:01 +09:00
Kazz Yokomizo
d86935acaa Merge pull request #1308 from ytk141/split-icon
Split icon
2017-12-19 13:57:49 +09:00
Yutaka Ishii
72b450d526 icon updated 2017-12-19 10:21:01 +09:00
Sosuke Suzuki
4b7afeeb4f remove unnecesarry state 2017-12-19 03:46:20 +09:00
Sosuke Suzuki
0e0e779cbe remove unnecessary arg 2017-12-18 21:38:58 +09:00
Sosuke Suzuki
89b2f48a06 remove an unnecessary valiable 2017-12-18 19:31:43 +09:00
Sosuke Suzuki
c80bdb8d0c apply ignorePreviewPointerEvents 2017-12-18 19:28:42 +09:00
Sosuke Suzuki
50d89a8ec9 fix to apply fontSize and fontFamily 2017-12-18 19:21:52 +09:00
Sosuke Suzuki
f5ccaa7b48 fix word-wrap 2017-12-18 18:52:59 +09:00
Sosuke Suzuki
e682ee8541 avoid handling events for not split editor 2017-12-18 18:52:33 +09:00
Sosuke Suzuki
caaa7a9e74 implement checkbox 2017-12-18 18:42:35 +09:00
Sosuke Suzuki
6ef0e325e2 fix style 2017-12-18 18:39:40 +09:00
Sosuke Suzuki
ea064deeb8 implement splitEditor 2017-12-18 18:26:25 +09:00
Sosuke Suzuki
8e81609a39 implement minimun splitEditor 2017-12-18 17:40:06 +09:00
Nikolay Lopin
83da07a941 Export note with local images
Looks through the note and searches for local images. Copies them to ‘images’ folder in the export path and replaces affected links.

#1261
2017-12-17 21:39:34 +03:00
Sosuke Suzuki
977e80c829 apply switching style 2017-12-17 02:07:07 +09:00
Sosuke Suzuki
8ba0d10f40 set editorType into Config and state 2017-12-17 02:02:19 +09:00
Sosuke Suzuki
2581091652 add editorType into ConfigManager 2017-12-16 23:17:45 +09:00
Kazz Yokomizo
e72a7ceaea Merge pull request #1207 from ytk141/add-note-mode-tab
add note mode tab
2017-12-16 17:33:49 +09:00
Sosuke Suzuki
a17ddf6d54 use getSendEventCond func 2017-12-16 15:30:21 +09:00
Sosuke Suzuki
b5e2d21f33 split to function send event conditions 2017-12-16 15:30:21 +09:00
Sosuke Suzuki
d09f8dff18 detect internet connection when send events 2017-12-16 15:30:21 +09:00
Sosuke Suzuki
bdb3406dcb modify: change the file where detect Internet disconnection 2017-12-16 15:30:21 +09:00
Sosuke Suzuki
f54b49db1a detect internet disconnection 2017-12-16 15:30:21 +09:00
Kazz Yokomizo
0cc9f006c5 Merge pull request #1217 from SCdF/use-file-metadata-on-import
Use existing file metadata for created and modified dates
2017-12-16 14:29:19 +09:00
Kazz Yokomizo
db1398b65f Merge pull request #1305 from BoostIO/fix-ui-bug
Fix several UI bugs
2017-12-16 13:58:00 +09:00
Kazu Yokomizo
e8192e6c3f Fix several UI bugs 2017-12-16 13:49:53 +09:00
Maurits Lourens
775200bdd6 fixed opening finder on Windows and Linux
fixes #1291 - tested on Ubuntu Linux Mate and Windows 10
2017-12-15 12:57:18 +01:00
Kazz Yokomizo
820a2a093c Merge pull request #1275 from BoostIO/add-pin-note-item-simple
Add Pin to NoteItemSimple
2017-12-15 15:32:26 +09:00
Kazz Yokomizo
d3995b9b10 Merge pull request #1293 from ytk141/Solarized-Dark-Theme
Add Solarized Dark theme
2017-12-15 15:27:43 +09:00
Yutaka Ishii
f6867f9338 Finder style updated 2017-12-15 14:52:58 +09:00
Yutaka Ishii
3e2548fcd5 add active notelist color 2017-12-15 11:04:09 +09:00
Stefan du Fresne
745d250787 Reorder Object.assign
- Respects the dates that may be in input over default dates
 - Respects key and storage over what might be in input
2017-12-14 13:16:37 +00:00
Stefan du Fresne
b1063eb38f Not used to this no semi colon thing 2017-12-14 13:13:29 +00:00
Stefan du Fresne
9032a1debb Use existing file metadata for created and modified dates
NB: this definintely works on OSX. Other operating systems may have
slightly different interpretations of birthtime.

See: https://nodejs.org/api/fs.html#fs_class_fs_stats
2017-12-14 13:13:29 +00:00
Paul Rosset
795fe8ae1d Add isEqual and changing haveToSaveNotif method 2017-12-14 12:26:05 +00:00
Kazz Yokomizo
e5a908af68 Merge pull request #1295 from BoostIO/update-readme
Update readme
2017-12-14 18:26:38 +09:00
Kohei TAKATA
6ce16c1cc0 Merge pull request #1296 from BoostIO/add-lint-plugin
Add lint plugin
2017-12-14 18:22:35 +09:00
Kazu Yokomizo
6ff2a5ac94 Add lint plugin 2017-12-14 18:09:49 +09:00
Kazz Yokomizo
fcea16e43a Update readme 2017-12-14 18:07:27 +09:00
Kazz Yokomizo
7b8e42382e Merge pull request #1294 from BoostIO/update-readme
Update readme
2017-12-14 18:03:38 +09:00
Kazz Yokomizo
a372b5ea39 Update readme 2017-12-14 17:51:48 +09:00
Yutaka Ishii
1aafee2a7c Add Solarized Dark theme 2017-12-14 15:46:29 +09:00
Kazz Yokomizo
7afe3d5181 Merge pull request #1287 from nebbers1111/master
Fixed regex to stop [anytingx] being counted as a checkmark
2017-12-14 12:25:34 +09:00
Maurits Lourens
6fba62d062 fixed review comments 2017-12-13 17:20:22 +01:00
Maurits Lourens
6906c0ab0d changed var into const 2017-12-13 17:16:28 +01:00
Maurits Lourens
5d46adf8fd fixed review comments 2017-12-13 17:11:43 +01:00
Kazz Yokomizo
eda1f11d42 Merge pull request #1267 from hooskers/add-scroll-past-end
Add scroll past end
2017-12-14 00:54:38 +09:00
Ben Coleman
6431a8255d Fixed trailing spaces 2017-12-12 13:59:38 +00:00
Ben Coleman
48fd1d11e2 Fixed regex to stop [anytingx] being counted as a checkmark 2017-12-12 13:34:37 +00:00
Kazz Yokomizo
4c3e62efad Merge pull request #1284 from BoostIO/fix-ci-error
Fix Ci error
2017-12-12 17:29:14 +09:00
Kazu Yokomizo
52a15a5d92 Fix Ci error 2017-12-12 17:19:58 +09:00
Kazz Yokomizo
57f4aa5995 Merge pull request #1268 from ytk141/color-update
Color update
2017-12-12 17:17:44 +09:00
Yutaka Ishii
ab9ab004b7 delete non-use icon 2017-12-12 17:02:09 +09:00
Yutaka Ishii
ac624eb98f Change Edit Lock Icon 2017-12-12 17:01:33 +09:00
Yutaka Ishii
1a4c37820d little bit darker color for new dark theme 2017-12-12 10:26:55 +09:00
Yutaka Ishii
685206950b restore StatusBar 2017-12-12 10:22:31 +09:00
Kazu Yokomizo
eececf8a93 Add Pin to NoteItemSimple 2017-12-12 02:27:44 +09:00
Kazz Yokomizo
9bc3d65554 Merge pull request #1274 from BoostIO/add-german-documents
Add german documents
2017-12-12 02:09:24 +09:00
Kazz Yokomizo
f9b854ce39 Update debug.md 2017-12-12 01:36:37 +09:00
Kazz Yokomizo
1416968fe5 Update debug.md in German 2017-12-12 01:33:46 +09:00
Kazz Yokomizo
efc183c709 Update build.md in German 2017-12-12 01:28:28 +09:00
Kazz Yokomizo
07a2442718 Add debug.md in German 2017-12-12 01:27:23 +09:00
Kazz Yokomizo
f549c50a58 Create German build.md 2017-12-12 01:26:24 +09:00
Kazz Yokomizo
8d6ce1a2f7 Merge pull request #1272 from oisu/cloud-sync-comment
Fix link to Cloud-Syncing
2017-12-12 01:09:25 +09:00
oisu
c5b33e025e Fix link to Cloud-Syncing 2017-12-11 23:45:34 +09:00
Maurits Lourens
4cdfc738c0 forgot to run eslint (again) 2017-12-11 15:14:02 +01:00
Maurits Lourens
46d46f21e4 convert uml to utf8 before converting to base64 2017-12-11 15:02:42 +01:00
Yutaka Ishii
4983605b23 fixed sideNav icons 2017-12-11 22:03:29 +09:00
Yutaka Ishii
9e8d04d806 progressBar padding修正 2017-12-11 21:52:08 +09:00
Kazz Yokomizo
042f935133 Merge pull request #1269 from BoostIO/add-solarized-dark-theme
Add the Solarized Dark Theme
2017-12-11 20:28:22 +09:00
Kazu Yokomizo
ed9d3639e2 Add the Solarized Dark Theme 2017-12-11 19:01:24 +09:00
Yutaka Ishii
728f105830 dark theme update 2017-12-11 15:42:31 +09:00
Yutaka Ishii
6f359fa6a8 color setting 2017-12-11 15:42:31 +09:00
Yutaka Ishii
57a88743bc icon style update. Delete Zoom 2017-12-11 15:42:30 +09:00
Wade Johnson
667f022086 Remove semicolon 2017-12-10 21:13:21 -08:00
Wade Johnson
b742a3a4cd Put this back?? 2017-12-10 17:58:06 -08:00
Wade Johnson
8d5c9742f8 Add ability to scroll pasted last line of editor 2017-12-09 21:14:10 -08:00
Kohei TAKATA
c2a49efe73 Merge pull request #1120 from mslourens/drag-drop-tabs
implemented drag/drop for tabs
2017-12-09 08:05:57 +09:00
Maurits Lourens
8c8a0ab46d forgot to run lint 2017-12-08 16:21:31 +01:00
Maurits Lourens
959b75bddd export folder as md or text 2017-12-08 16:21:31 +01:00
Kazz Yokomizo
d29d5105f1 Merge pull request #1257 from mslourens/preferences-shortcut
added ctrl+, shortcut to preference modal
2017-12-08 22:15:20 +09:00
Kazz Yokomizo
38e82872a5 Merge pull request #1258 from mslourens/import-in-new-folder
fixed import of new notes
2017-12-08 22:07:38 +09:00
Maurits Lourens
15d9ce1d36 fixed import of new notes 2017-12-08 13:27:16 +01:00
Maurits Lourens
67f7cdb36c added ctrl+, shortcut to preference modal 2017-12-08 12:02:07 +01:00
Maurits Lourens
6a9d4ae0fd first attempt to export html 2017-12-08 11:43:50 +01:00
Kazz Yokomizo
6a761c3fb5 Merge pull request #1254 from BoostIO/fix-folded-sidebar
Fix the folded side bar layout
2017-12-08 14:27:29 +09:00
Kazu Yokomizo
3baf97e69f Fix the folded side bar layout 2017-12-08 14:18:45 +09:00
Kazz Yokomizo
694dc60481 Merge pull request #1244 from mslourens/font-family
fixed incorrect fontFamily for multiple fonts
2017-12-07 17:39:10 +09:00
Kazz Yokomizo
e3c6f0452c Merge pull request #1241 from mslourens/global.styl
fixed global styles
2017-12-06 15:56:47 +09:00
Kazz Yokomizo
ed2401a87b Merge branch 'master' into global.styl 2017-12-06 15:39:46 +09:00
Paul Rosset
cb59458c79 refactor 2017-12-05 18:28:59 +00:00
Paul Rosset
125a493400 Change name for state 2017-12-05 18:24:30 +00:00
Paul Rosset
83910b55d2 Correction eslint code format 2017-12-05 18:18:12 +00:00
Paul Rosset
f4fd131100 Requested Review 2017-12-05 18:16:42 +00:00
Maurits Lourens
cfdc880d8c fixed incorrect fontFamily for multiple fonts 2017-12-05 12:51:16 +01:00
Kazz Yokomizo
7303e8bdd2 Merge pull request #1242 from mslourens/ide-related-gitignore
added IDE related ignore rules
2017-12-05 19:32:05 +09:00
Maurits Lourens
ecde465d9f undo ide related gitignore changes 2017-12-05 11:03:30 +01:00
Maurits Lourens
5c5e70a805 added IDE related ignore rules 2017-12-05 11:02:15 +01:00
Maurits Lourens
4e41d9be55 fixed global styles 2017-12-05 09:06:00 +01:00
Maurits Lourens
d06d94449c forgot to reload tab at oldindex 2017-12-04 19:24:50 +01:00
Maurits Lourens
1af2c83c63 removed the onDragEnd handler 2017-12-04 19:24:50 +01:00
Maurits Lourens
6c75136777 implemented drag/drop for tabs 2017-12-04 19:24:50 +01:00
Kazz Yokomizo
31351e34e1 Merge pull request #1236 from Alaev/patch-1
Added border radius & background color to NavToggleButton
2017-12-04 22:32:08 +09:00
Michael Alaev
a058a774e9 Added border radius with background color
At the moment when you hover the left menu icon its hard to see that you fully hovering it, yes there is a white color and a cursor icon I was thinking it would be useful to have a more visual effect
2017-12-04 15:10:36 +02:00
Kazz Yokomizo
e6db28485c Merge pull request #1194 from fabien0102/checked-style
Add a specific style for checked inputs
2017-12-04 13:48:18 +09:00
Kazz Yokomizo
391bb096d6 Merge pull request #1221 from Paalon/master
Add custom LaTeX delimiters to preferences
2017-12-04 13:45:49 +09:00
Kohei TAKATA
a7a5b789fa Merge pull request #1230 from BoostIO/feature-v0-8-18
v0.8.18
2017-12-03 11:51:11 +09:00
Kohei TAKATA
10b7d58dc6 v0.8.18 2017-12-03 11:08:06 +09:00
Paalon
2b496dc2e5 Get back into original yarn.lock 2017-12-02 17:42:11 +09:00
Paalon
a6e0b30576 Bug fix: fix mistaken name. 2017-12-02 17:15:50 +09:00
Kazz Yokomizo
16f0e95e32 Merge pull request #1226 from BoostIO/add-newsletter
Add newsletter link to preference modal
2017-12-02 15:45:36 +09:00
Kazu Yokomizo
55395d3a2d Add newsletter link to preference modal 2017-12-02 15:41:43 +09:00
Kazz Yokomizo
4e0fa63fad Merge pull request #1225 from BoostIO/fix-finder-layout
Fix finder layout
2017-12-02 15:33:55 +09:00
Kazu Yokomizo
b9ea7696d8 Fix finder layout 2017-12-02 15:20:16 +09:00
Kazz Yokomizo
7de3308f52 Merge pull request #1223 from BoostIO/fixbug-cannot-open-finder
fix bug cannot open finder.
2017-12-02 15:07:19 +09:00
Kazz Yokomizo
b2b2373c7b Merge pull request #1218 from PaulRosset/fixbug-react-code-mirror
Fixbug react code mirror
2017-12-02 15:03:19 +09:00
Sosuke Suzuki
1c54f40a28 require ipcClient 2017-12-02 14:07:11 +09:00
paalon
1ac31264b7 Change 'var' to 'const'. 2017-12-02 12:55:10 +09:00
paalon
ca4b8224fd Add LaTeX delimiters preferences 2017-12-02 07:23:12 +09:00
Paul Rosset
d1e5781c24 Correction UiTab 2017-12-01 19:03:04 +00:00
Paul Rosset
c86e451198 Merge branch 'master' of github.com:BoostIO/Boostnote into add-notification-onChangeUi 2017-12-01 17:34:16 +00:00
Paul Rosset
4735992835 Fix 2017-12-01 17:24:28 +00:00
Paul Rosset
cba3519458 Fix 2017-12-01 17:19:21 +00:00
Paul Rosset
c64a5e1cca Correction eslint purpose 2017-12-01 17:10:04 +00:00
Paul Rosset
47ee8b8ce7 Fix bug on UI Tab in relation to React CodeMirror 2017-12-01 16:56:43 +00:00
Paul Rosset
b4a7b547f0 Add notification when not saved 2017-12-01 15:23:23 +00:00
Kazz Yokomizo
455b424429 Merge pull request #1211 from yosmoc/tagconfirm_onblur
confirm tag at onBlur event
2017-12-01 15:11:47 +09:00
Kazz Yokomizo
7d67ac3f12 Merge pull request #1212 from PaulRosset/correct-notification-area
Correction Notification top-left
2017-12-01 15:04:40 +09:00
Paul Rosset
34f377eb5c Correction Notification top-left 2017-11-30 21:32:28 +00:00
yosmoc
b7f4af8c78 confirm tag at onBlur event
When user inputs the tag and leave the tag input box without fixing(enter or tab key), tag string is still there, but it is not stored as a tag.

This changes solved this problem. When the cursol is out of the tag input, it registers the input as a tag.
2017-11-30 22:04:56 +01:00
Yutaka Ishii
07b395c24a add note mode tab 2017-11-30 18:36:41 +09:00
Kazz Yokomizo
a6c7dde194 Merge pull request #1202 from BoostIO/fix-folded-layout
Fix folded layout
2017-11-29 16:51:28 +09:00
Kazu Yokomizo
43ebe4ecfd FIx folded layout 2017-11-29 16:43:26 +09:00
fabien0102
53b9630fa5 Remove italic style 2017-11-28 15:18:22 +01:00
Kazz Yokomizo
1d38f1abb4 Merge pull request #1197 from BoostIO/fix-initialmodal-layout
Fix layout at initial modal
2017-11-28 16:44:07 +09:00
Kazu Yokomizo
061a0cd219 Fix layout at initial modal 2017-11-28 16:27:12 +09:00
Kazz Yokomizo
f0ed20ee2c Merge pull request #1184 from cormoran/fix/SideNavFoldEmoji
Fix surrogate pairs garbling on folded SideNav
2017-11-28 12:42:41 +09:00
Kazz Yokomizo
edfc8d95c8 Merge pull request #1070 from voidsatisfaction/feature/add_multiselect_notes_delete
Feature multiselect notes delete and move to another folder
2017-11-28 12:39:12 +09:00
fabien0102
f820c3089e Add a specific style for checked inputs 2017-11-27 17:30:16 +01:00
voidSatisfaction
c33f9d8307 fix: from let to const 2017-11-27 14:31:11 +09:00
voidSatisfaction
eee212f5b8 Merge with master resolve conflict 2017-11-27 14:05:26 +09:00
Kazz Yokomizo
b690147b0b Merge pull request #1187 from BoostIO/fix-note-list
Fix note list layout
2017-11-27 11:26:27 +09:00
Kazu Yokomizo
10879d0f67 Fix note list layout 2017-11-27 11:22:21 +09:00
Kazz Yokomizo
b48b8f39fc Merge pull request #1144 from whizark/store-window-size-on-linux
store correct window size on Linux
2017-11-27 11:06:56 +09:00
cormoran
3d0b3e759b Fix surrogate pairs garbling on folded SideNav 2017-11-27 06:04:24 +09:00
Kazz Yokomizo
3e7f4a41e2 Merge pull request #1183 from BoostIO/update-backers
Update Backers
2017-11-27 03:03:57 +09:00
Kazz Yokomizo
b89b888129 Update Backers 2017-11-27 02:57:17 +09:00
Kazz Yokomizo
cba9afc9ba Merge pull request #1180 from romainwn/fix/SideNavFilter-Hover
SideNavItem: add background when hover
2017-11-26 19:33:16 +09:00
Unknown
a66a11b81e SideNavItem: add background when hover 2017-11-26 11:21:49 +01:00
Kazz Yokomizo
22cc2791b6 Merge pull request #1179 from BoostIO/fix-margin-notedetail
Fix Margin at Note Detail
2017-11-26 16:24:36 +09:00
Kazu Yokomizo
369cf16b68 Fix Margin at Note Detail 2017-11-26 16:14:52 +09:00
Kazz Yokomizo
0d38baf194 Merge pull request #1176 from yosmoc/initmodal_exit_fix
fix anykey can close the initmodal window issue
2017-11-26 16:05:38 +09:00
Kazz Yokomizo
5b63c95f40 Merge pull request #1178 from BoostIO/fix-typo
Fix typo
2017-11-26 15:57:36 +09:00
Kazu Yokomizo
52497999a0 Fix typo 2017-11-26 15:50:45 +09:00
Kohei TAKATA
6bab108a35 Merge pull request #1113 from yosmoc/react_proptypes_deprecated
React.PropTypes is deprecated from React 15.5
2017-11-26 09:22:38 +09:00
yosmoc
eec22e6b7d fix anykey can close the initmodal issue
this change makes only ESC key can close the initmodal window.
2017-11-25 23:39:59 +01:00
yosmoc
edaa0713e8 React.PropTypes is deprecated from React 15.5
Migrated by react-codemod + minor fix by hand.
2017-11-25 22:27:04 +01:00
Kohei TAKATA
6b6a415dd5 Merge pull request #1170 from mslourens/reduce-lint-errors
fixed eslint warnings
2017-11-25 17:43:13 +09:00
Maurits Lourens
3fbc749395 fixed eslint warnings 2017-11-24 17:00:03 +01:00
Whizark
460437397f store window size on Linux 2017-11-19 21:10:53 +09:00
voidSatisfaction
a36e779980 refactor: add new function and fix problems from feedbacks 2017-11-15 23:19:47 +09:00
voidSatisfaction
84f18ced47 fix: pintotop error 2017-11-07 23:07:39 +09:00
voidSatisfaction
037ff2e749 Merge branch 'master' into feature/add_multiselect_notes_delete 2017-11-07 22:53:14 +09:00
voidSatisfaction
f0f23ede3d Merge branch 'master' into feature/add_multiselect_notes_delete 2017-11-07 22:48:50 +09:00
voidSatisfaction
c8763063c0 resolve conflict with master 2017-11-07 22:47:08 +09:00
voidSatisfaction
e57fef2413 refactor: add utils 2017-11-07 22:38:28 +09:00
voidSatisfaction
9095fe934d add multi selection with arrow short cut 2017-11-07 00:01:50 +09:00
voidSatisfaction
9139495f02 feat: add multiple pin to top and rename activateNote to focusNote 2017-11-06 21:53:31 +09:00
voidSatisfaction
bcb1fb4331 feat multi drag and drop for changing folder 2017-11-05 21:18:39 +09:00
voidSatisfaction
70b69a3bc9 refactor: inner codes 2017-11-05 19:22:55 +09:00
voidSatisfaction
a7e458b784 feat change name and add deletion logic 2017-11-05 19:00:03 +09:00
voidSatisfaction
a504a45d99 fix up and down key rendering problems 2017-11-05 18:45:09 +09:00
voidSatisfaction
2d0e14c1cc feat: add shiftkey multiselect notes and delete 2017-11-05 18:11:08 +09:00
David Pavlík
7a4258bb20 Make line numbers in the editor optional 2017-09-20 22:34:18 +02:00
347 changed files with 245288 additions and 6667 deletions

View File

@@ -5,7 +5,7 @@
"presets": ["react-hmre"] "presets": ["react-hmre"]
}, },
"test": { "test": {
"presets": ["react", "es2015"], "presets": ["env" ,"react", "es2015"],
"plugins": [ "plugins": [
[ "babel-plugin-webpack-alias", { "config": "${PWD}/webpack.config.js" } ] [ "babel-plugin-webpack-alias", { "config": "${PWD}/webpack.config.js" } ]
] ]

View File

@@ -10,7 +10,6 @@
"theme": "monokai" "theme": "monokai"
}, },
"hotkey": { "hotkey": {
"toggleFinder": "Cmd + Alt + S",
"toggleMain": "Cmd + Alt + L" "toggleMain": "Cmd + Alt + L"
}, },
"isSideNavFolded": false, "isSideNavFolded": false,
@@ -23,7 +22,10 @@
"fontSize": "14", "fontSize": "14",
"lineNumber": true "lineNumber": true
}, },
"sortBy": "UPDATED_AT", "sortBy": {
"default": "UPDATED_AT"
},
"sortTagsBy": "ALPHABETICAL",
"ui": { "ui": {
"defaultNote": "ALWAYS_ASK", "defaultNote": "ALWAYS_ASK",
"disableDirectWrite": false, "disableDirectWrite": false,

16
.editorconfig Normal file
View File

@@ -0,0 +1,16 @@
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
# Space indentation
[*]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
# The indent size used in the `package.json` file cannot be changed
# https://github.com/npm/npm/pull/3180#issuecomment-16336516
[{*.yml,*.yaml,package.json}]
indent_style = space
indent_size = 2

View File

@@ -1,3 +1,4 @@
node_modules/ node_modules/
compiled/ compiled/
dist/ dist/
extra_scripts/

View File

@@ -3,7 +3,9 @@
"plugins": ["react"], "plugins": ["react"],
"rules": { "rules": {
"no-useless-escape": 0, "no-useless-escape": 0,
"prefer-const": "warn", "prefer-const": ["warn", {
"destructuring": "all"
}],
"no-unused-vars": "warn", "no-unused-vars": "warn",
"no-undef": "warn", "no-undef": "warn",
"no-lone-blocks": "warn", "no-lone-blocks": "warn",
@@ -12,5 +14,13 @@
"react/no-find-dom-node": "warn", "react/no-find-dom-node": "warn",
"react/no-render-return-value": "warn", "react/no-render-return-value": "warn",
"react/no-deprecated": "warn" "react/no-deprecated": "warn"
},
"globals": {
"FileReader": true,
"localStorage": true,
"fetch": true
},
"env": {
"jest": true
} }
} }

2
.gitignore vendored
View File

@@ -8,3 +8,5 @@ node_modules/*
/compiled /compiled
/secret /secret
*.log *.log
.idea
.vscode

View File

@@ -1,9 +1,9 @@
language: node_js language: node_js
node_js: node_js:
- stable - 7
- lts/*
script: script:
- npm run lint && npm run test - npm run lint && npm run test
- yarn jest
- 'if [[ ${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH} = "master" ]]; then npm install -g grunt npm@5.2 && grunt pre-build; fi' - 'if [[ ${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH} = "master" ]]; then npm install -g grunt npm@5.2 && grunt pre-build; fi'
after_success: after_success:
- openssl aes-256-cbc -K $encrypted_440d7f9a3c38_key -iv $encrypted_440d7f9a3c38_iv - openssl aes-256-cbc -K $encrypted_440d7f9a3c38_key -iv $encrypted_440d7f9a3c38_iv

41
.vscode/launch.json vendored Normal file
View File

@@ -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_modules/.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"]
}
]
}

27
.vscode/tasks.json vendored Normal file
View File

@@ -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
}
]
}
}
]
}

View File

@@ -1,49 +0,0 @@
<h1 align="center">Sponsors &amp; Backers</h1>
Boostnote is an open source project. It's an independent project with its ongoing development made possible entirely thanks to the support by these awesome [backers](https://github.com/BoostIO/Boostnote/blob/master/Backers.md). If you'd like to join them, please consider:
- [Become a backer or sponsor on Open Collective.](https://opencollective.com/boostnoteio)
---
## Backers via OpenCollective
<a href="https://opencollective.com/boostnoteio#backers" target="_blank"><img src="https://opencollective.com/boostnoteio/backers.svg?width=890"></a>
- [Ralph03](https://opencollective.com/ralph03) - $24
- [Nikolas Dan](https://opencollective.com/nikolas-dan) - $20
- [tatoosh11](https://twitter.com/ta11) - $10
- [Alexander Borovkov](https://opencollective.com/alexander-borovkov) - $10
- [Yeojong Kim](https://twitter.com/yeojoy) - $5
- [Scotia Draven](https://opencollective.com/scotia-draven) - $5
- [spoonhoop](https://opencollective.com/spoonhoop) - $5
## Backers via Bountysource
https://salt.bountysource.com/teams/boostnote
- Kuzz - $65
- Intense Raiden - $45
- ravy22 - $25
- trentpolack - $20
- hikariru - $10
- kolchan11 - $10
- RonWalker22 - $10
- hocchuc - $5
- Adam - $5
- Steve - $5
- evmin - $5

29
FAQ.md Normal file
View File

@@ -0,0 +1,29 @@
# Frequently Asked Questions
<details><summary>Allowing dangerous HTML tags</summary>
Sometimes it is useful to allow dangerous HTML tags to add interactivity to your notebook. One of the example is to use details/summary as a way to expand/collaps your todo-list.
* How to enable:
* Go to **Preferences****Interface****Sanitization****Allow dangerous html tags**
* Example note: Multiple todo-list
* Create new notes
* Paste the below code, and you'll see that you can expand/collaps the todo-list, and you can have multiple todo-list in your note.
```html
<details><summary>What I want to do</summary>
- [x] Create an awesome feature X
- [ ] Do my homework
</details>
```
</details>
## Other questions
You can ask [here][ISSUES]
[ISSUES]: https://github.com/BoostIO/Boostnote/issues

View File

@@ -1,10 +1,35 @@
<!-- # Current behavior
Please paste some **screenshots** with the **developer tool** open (console tab) when you report a bug.
If your issue is regarding boostnote mobile, move to https://github.com/BoostIO/boostnote-mobile.
-->
<!-- <!--
Love Boostnote? Please consider supporting us via OpenCollective: Let us know what is currently happening.
👉 https://opencollective.com/boostnoteio
Please include some **screenshots** with the **developer tools** open (console tab) when you report a bug.
If your issue is regarding Boostnote mobile, please open an issue in the Boostnote Mobile repo 👉 https://github.com/BoostIO/boostnote-mobile.
-->
# Expected behavior
<!--
Let us know what you think should happen!
-->
# Steps to reproduce
<!--
Please be thorough, issues we can reproduce are easier to fix!
-->
1.
2.
3.
# Environment
- Version :
- OS Version and name :
<!--
Love Boostnote? Please consider supporting us on IssueHunt:
👉 https://issuehunt.io/repos/53266139
--> -->

View File

@@ -2,7 +2,7 @@ GPL-3.0
Boostnote - an open source note-taking app made for programmers just like you. Boostnote - an open source note-taking app made for programmers just like you.
Copyright (C) 2017 Maisin&Co., Inc. Copyright (C) 2017 - 2019 BoostIO
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

36
PULL_REQUEST_TEMPLATE.md Normal file
View File

@@ -0,0 +1,36 @@
<!--
Before submitting this PR, please make sure that:
- You have read and understand the contributing.md
- You have checked docs/code_style.md for information on code style
-->
## Description
<!--
Tell us what your PR does.
Please attach a screenshot/ video/gif image describing your PR if possible.
-->
## Issue fixed
<!--
Please list out all issue fixed with this PR here.
-->
<!--
Please make sure you fill in these checkboxes,
your PR will be reviewed faster if we know exactly what it does.
Change :white_circle: to :radio_button: in all the options that apply
-->
## Type of changes
- :white_circle: Bug fix (Change that fixed an issue)
- :white_circle: Breaking change (Change that can cause existing functionality to change)
- :white_circle: Improvement (Change that improves the code. Maybe performance or development improvement)
- :white_circle: Feature (Change that adds new functionality)
- :white_circle: Documentation change (Change that modifies documentation. Maybe typo fixes)
## Checklist:
- :white_circle: My code follows [the project code style](docs/code_style.md)
- :white_circle: I have written test for my code and it has been tested
- :white_circle: All existing tests have been passed
- :white_circle: I have attached a screenshot/video to visualize my change if possible

7
__mocks__/electron.js Normal file
View File

@@ -0,0 +1,7 @@
module.exports = {
require: jest.genMockFunction(),
match: jest.genMockFunction(),
app: jest.genMockFunction(),
remote: jest.genMockFunction(),
dialog: jest.genMockFunction()
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,6 @@
.codeEditor-typo
text-decoration underline wavy red
.spellcheck-select
border: none
text-decoration underline wavy red

View File

@@ -0,0 +1,68 @@
import React from 'react'
import PropTypes from 'prop-types'
import { SketchPicker } from 'react-color'
import CSSModules from 'browser/lib/CSSModules'
import styles from './ColorPicker.styl'
const componentHeight = 330
class ColorPicker extends React.Component {
constructor (props) {
super(props)
this.state = {
color: this.props.color || '#939395'
}
this.onColorChange = this.onColorChange.bind(this)
this.handleConfirm = this.handleConfirm.bind(this)
}
componentWillReceiveProps (nextProps) {
this.onColorChange(nextProps.color)
}
onColorChange (color) {
this.setState({
color
})
}
handleConfirm () {
this.props.onConfirm(this.state.color)
}
render () {
const { onReset, onCancel, targetRect } = this.props
const { color } = this.state
const clientHeight = document.body.clientHeight
const alignX = targetRect.right + 4
let alignY = targetRect.top
if (targetRect.top + componentHeight > clientHeight) {
alignY = targetRect.bottom - componentHeight
}
return (
<div styleName='colorPicker' style={{top: `${alignY}px`, left: `${alignX}px`}}>
<div styleName='cover' onClick={onCancel} />
<SketchPicker color={color} onChange={this.onColorChange} />
<div styleName='footer'>
<button styleName='btn-reset' onClick={onReset}>Reset</button>
<button styleName='btn-cancel' onClick={onCancel}>Cancel</button>
<button styleName='btn-confirm' onClick={this.handleConfirm}>Confirm</button>
</div>
</div>
)
}
}
ColorPicker.propTypes = {
color: PropTypes.string,
targetRect: PropTypes.object,
onConfirm: PropTypes.func.isRequired,
onCancel: PropTypes.func.isRequired,
onReset: PropTypes.func.isRequired
}
export default CSSModules(ColorPicker, styles)

View File

@@ -0,0 +1,39 @@
.colorPicker
position fixed
z-index 2
display flex
flex-direction column
.cover
position fixed
top 0
right 0
bottom 0
left 0
.footer
display flex
justify-content center
z-index 2
align-items center
& > button + button
margin-left 10px
.btn-cancel,
.btn-confirm,
.btn-reset
vertical-align middle
height 25px
margin-top 2.5px
border-radius 2px
border none
padding 0 5px
background-color $default-button-background
&:hover
background-color $default-button-background--hover
.btn-confirm
background-color #1EC38B
&:hover
background-color darken(#1EC38B, 25%)

View File

@@ -1,11 +1,13 @@
import React, { PropTypes } from 'react' import PropTypes from 'prop-types'
import React from 'react'
import CSSModules from 'browser/lib/CSSModules' import CSSModules from 'browser/lib/CSSModules'
import styles from './MarkdownEditor.styl' import styles from './MarkdownEditor.styl'
import CodeEditor from 'browser/components/CodeEditor' import CodeEditor from 'browser/components/CodeEditor'
import MarkdownPreview from 'browser/components/MarkdownPreview' import MarkdownPreview from 'browser/components/MarkdownPreview'
import eventEmitter from 'browser/main/lib/eventEmitter' import eventEmitter from 'browser/main/lib/eventEmitter'
import { findStorage } from 'browser/lib/findStorage' import { findStorage } from 'browser/lib/findStorage'
const _ = require('lodash') import ConfigManager from 'browser/main/lib/ConfigManager'
import attachmentManagement from 'browser/main/lib/dataApi/attachmentManagement'
class MarkdownEditor extends React.Component { class MarkdownEditor extends React.Component {
constructor (props) { constructor (props) {
@@ -18,10 +20,10 @@ class MarkdownEditor extends React.Component {
this.supportMdSelectionBold = [16, 17, 186] this.supportMdSelectionBold = [16, 17, 186]
this.state = { this.state = {
status: 'PREVIEW', status: props.config.editor.switchPreview === 'RIGHTCLICK' ? props.config.editor.delfaultStatus : 'CODE',
renderValue: props.value, renderValue: props.value,
keyPressed: new Set(), keyPressed: new Set(),
isLocked: false isLocked: props.isLocked
} }
this.lockEditorCode = () => this.handleLockEditor() this.lockEditorCode = () => this.handleLockEditor()
@@ -64,17 +66,20 @@ class MarkdownEditor extends React.Component {
}) })
} }
setValue (value) {
this.refs.code.setValue(value)
}
handleChange (e) { handleChange (e) {
this.value = this.refs.code.value this.value = this.refs.code.value
this.props.onChange(e) this.props.onChange(e)
} }
handleContextMenu (e) { handleContextMenu (e) {
let { config } = this.props if (this.state.isLocked) return
const { config } = this.props
if (config.editor.switchPreview === 'RIGHTCLICK') { if (config.editor.switchPreview === 'RIGHTCLICK') {
let newStatus = this.state.status === 'PREVIEW' const newStatus = this.state.status === 'PREVIEW' ? 'CODE' : 'PREVIEW'
? 'CODE'
: 'PREVIEW'
this.setState({ this.setState({
status: newStatus status: newStatus
}, () => { }, () => {
@@ -84,6 +89,10 @@ class MarkdownEditor extends React.Component {
this.refs.preview.focus() this.refs.preview.focus()
} }
eventEmitter.emit('topbar:togglelockbutton', this.state.status) eventEmitter.emit('topbar:togglelockbutton', this.state.status)
const newConfig = Object.assign({}, config)
newConfig.editor.delfaultStatus = newStatus
ConfigManager.set(newConfig)
}) })
} }
} }
@@ -91,9 +100,11 @@ class MarkdownEditor extends React.Component {
handleBlur (e) { handleBlur (e) {
if (this.state.isLocked) return if (this.state.isLocked) return
this.setState({ keyPressed: new Set() }) this.setState({ keyPressed: new Set() })
let { config } = this.props const { config } = this.props
if (config.editor.switchPreview === 'BLUR') { if (config.editor.switchPreview === 'BLUR' ||
let cursorPosition = this.refs.code.editor.getCursor() (config.editor.switchPreview === 'DBL_CLICK' && this.state.status === 'CODE')
) {
const cursorPosition = this.refs.code.editor.getCursor()
this.setState({ this.setState({
status: 'PREVIEW' status: 'PREVIEW'
}, () => { }, () => {
@@ -104,12 +115,26 @@ class MarkdownEditor extends React.Component {
} }
} }
handleDoubleClick (e) {
if (this.state.isLocked) return
this.setState({keyPressed: new Set()})
const { config } = this.props
if (config.editor.switchPreview === 'DBL_CLICK') {
this.setState({
status: 'CODE'
}, () => {
this.refs.code.focus()
eventEmitter.emit('topbar:togglelockbutton', this.state.status)
})
}
}
handlePreviewMouseDown (e) { handlePreviewMouseDown (e) {
this.previewMouseDownedAt = new Date() this.previewMouseDownedAt = new Date()
} }
handlePreviewMouseUp (e) { handlePreviewMouseUp (e) {
let { config } = this.props const { config } = this.props
if (config.editor.switchPreview === 'BLUR' && new Date() - this.previewMouseDownedAt < 200) { if (config.editor.switchPreview === 'BLUR' && new Date() - this.previewMouseDownedAt < 200) {
this.setState({ this.setState({
status: 'CODE' status: 'CODE'
@@ -123,21 +148,23 @@ class MarkdownEditor extends React.Component {
handleCheckboxClick (e) { handleCheckboxClick (e) {
e.preventDefault() e.preventDefault()
e.stopPropagation() e.stopPropagation()
let idMatch = /checkbox-([0-9]+)/ const idMatch = /checkbox-([0-9]+)/
let checkedMatch = /\[x\]/i const checkedMatch = /^\s*[\+\-\*] \[x\]/i
let uncheckedMatch = /\[ \]/ const uncheckedMatch = /^\s*[\+\-\*] \[ \]/
const checkReplace = /\[x\]/i
const uncheckReplace = /\[ \]/
if (idMatch.test(e.target.getAttribute('id'))) { if (idMatch.test(e.target.getAttribute('id'))) {
let lineIndex = parseInt(e.target.getAttribute('id').match(idMatch)[1], 10) - 1 const lineIndex = parseInt(e.target.getAttribute('id').match(idMatch)[1], 10) - 1
let lines = this.refs.code.value const lines = this.refs.code.value
.split('\n') .split('\n')
let targetLine = lines[lineIndex] const targetLine = lines[lineIndex]
if (targetLine.match(checkedMatch)) { if (targetLine.match(checkedMatch)) {
lines[lineIndex] = targetLine.replace(checkedMatch, '[ ]') lines[lineIndex] = targetLine.replace(checkReplace, '[ ]')
} }
if (targetLine.match(uncheckedMatch)) { if (targetLine.match(uncheckedMatch)) {
lines[lineIndex] = targetLine.replace(uncheckedMatch, '[x]') lines[lineIndex] = targetLine.replace(uncheckReplace, '[x]')
} }
this.refs.code.setValue(lines.join('\n')) this.refs.code.setValue(lines.join('\n'))
} }
@@ -163,12 +190,12 @@ class MarkdownEditor extends React.Component {
} }
handleKeyDown (e) { handleKeyDown (e) {
let { config } = this.props const { config } = this.props
if (this.state.status !== 'CODE') return false if (this.state.status !== 'CODE') return false
const keyPressed = this.state.keyPressed const keyPressed = this.state.keyPressed
keyPressed.add(e.keyCode) keyPressed.add(e.keyCode)
this.setState({ keyPressed }) this.setState({ keyPressed })
let isNoteHandlerKey = (el) => { return keyPressed.has(el) } const isNoteHandlerKey = (el) => { return keyPressed.has(el) }
// These conditions are for ctrl-e and ctrl-w // These conditions are for ctrl-e and ctrl-w
if (keyPressed.size === this.escapeFromEditor.length && if (keyPressed.size === this.escapeFromEditor.length &&
!this.state.isLocked && this.state.status === 'CODE' && !this.state.isLocked && this.state.status === 'CODE' &&
@@ -196,6 +223,28 @@ class MarkdownEditor extends React.Component {
this.refs.code.editor.replaceSelection(`${mdElement}${this.refs.code.editor.getSelection()}${mdElement}`) this.refs.code.editor.replaceSelection(`${mdElement}${this.refs.code.editor.getSelection()}${mdElement}`)
} }
handleDropImage (dropEvent) {
dropEvent.preventDefault()
const { storageKey, noteKey } = this.props
this.setState({
status: 'CODE'
}, () => {
this.refs.code.focus()
this.refs.code.editor.execCommand('goDocEnd')
this.refs.code.editor.execCommand('goLineEnd')
this.refs.code.editor.execCommand('newlineAndIndent')
attachmentManagement.handleAttachmentDrop(
this.refs.code,
storageKey,
noteKey,
dropEvent
)
})
}
handleKeyUp (e) { handleKeyUp (e) {
const keyPressed = this.state.keyPressed const keyPressed = this.state.keyPressed
keyPressed.delete(e.keyCode) keyPressed.delete(e.keyCode)
@@ -207,14 +256,14 @@ class MarkdownEditor extends React.Component {
} }
render () { render () {
let { className, value, config, storageKey } = this.props const {className, value, config, storageKey, noteKey, linesHighlighted} = this.props
let editorFontSize = parseInt(config.editor.fontSize, 10) let editorFontSize = parseInt(config.editor.fontSize, 10)
if (!(editorFontSize > 0 && editorFontSize < 101)) editorFontSize = 14 if (!(editorFontSize > 0 && editorFontSize < 101)) editorFontSize = 14
let editorIndentSize = parseInt(config.editor.indentSize, 10) let editorIndentSize = parseInt(config.editor.indentSize, 10)
if (!(editorFontSize > 0 && editorFontSize < 132)) editorIndentSize = 4 if (!(editorFontSize > 0 && editorFontSize < 132)) editorIndentSize = 4
let previewStyle = {} const previewStyle = {}
if (this.props.ignorePreviewPointerEvents) previewStyle.pointerEvents = 'none' if (this.props.ignorePreviewPointerEvents) previewStyle.pointerEvents = 'none'
const storage = findStorage(storageKey) const storage = findStorage(storageKey)
@@ -234,7 +283,7 @@ class MarkdownEditor extends React.Component {
: 'codeEditor--hide' : 'codeEditor--hide'
} }
ref='code' ref='code'
mode='GitHub Flavored Markdown' mode='Boost Flavored Markdown'
value={value} value={value}
theme={config.editor.theme} theme={config.editor.theme}
keyMap={config.editor.keyMap} keyMap={config.editor.keyMap}
@@ -242,9 +291,24 @@ class MarkdownEditor extends React.Component {
fontSize={editorFontSize} fontSize={editorFontSize}
indentType={config.editor.indentType} indentType={config.editor.indentType}
indentSize={editorIndentSize} indentSize={editorIndentSize}
enableRulers={config.editor.enableRulers}
rulers={config.editor.rulers}
displayLineNumbers={config.editor.displayLineNumbers}
matchingPairs={config.editor.matchingPairs}
matchingTriples={config.editor.matchingTriples}
explodingPairs={config.editor.explodingPairs}
scrollPastEnd={config.editor.scrollPastEnd}
storageKey={storageKey} storageKey={storageKey}
noteKey={noteKey}
fetchUrlTitle={config.editor.fetchUrlTitle}
enableTableEditor={config.editor.enableTableEditor}
linesHighlighted={linesHighlighted}
onChange={(e) => this.handleChange(e)} onChange={(e) => this.handleChange(e)}
onBlur={(e) => this.handleBlur(e)} onBlur={(e) => this.handleBlur(e)}
spellCheck={config.editor.spellcheck}
enableSmartPaste={config.editor.enableSmartPaste}
hotkey={config.hotkey}
switchPreview={config.editor.switchPreview}
/> />
<MarkdownPreview styleName={this.state.status === 'PREVIEW' <MarkdownPreview styleName={this.state.status === 'PREVIEW'
? 'preview' ? 'preview'
@@ -259,8 +323,14 @@ class MarkdownEditor extends React.Component {
codeBlockFontFamily={config.editor.fontFamily} codeBlockFontFamily={config.editor.fontFamily}
lineNumber={config.preview.lineNumber} lineNumber={config.preview.lineNumber}
indentSize={editorIndentSize} indentSize={editorIndentSize}
scrollPastEnd={config.preview.scrollPastEnd}
smartQuotes={config.preview.smartQuotes}
smartArrows={config.preview.smartArrows}
breaks={config.preview.breaks}
sanitize={config.preview.sanitize}
ref='preview' ref='preview'
onContextMenu={(e) => this.handleContextMenu(e)} onContextMenu={(e) => this.handleContextMenu(e)}
onDoubleClick={(e) => this.handleDoubleClick(e)}
tabIndex='0' tabIndex='0'
value={this.state.renderValue} value={this.state.renderValue}
onMouseUp={(e) => this.handlePreviewMouseUp(e)} onMouseUp={(e) => this.handlePreviewMouseUp(e)}
@@ -268,6 +338,11 @@ class MarkdownEditor extends React.Component {
onCheckboxClick={(e) => this.handleCheckboxClick(e)} onCheckboxClick={(e) => this.handleCheckboxClick(e)}
showCopyNotification={config.ui.showCopyNotification} showCopyNotification={config.ui.showCopyNotification}
storagePath={storage.path} storagePath={storage.path}
noteKey={noteKey}
customCSS={config.preview.customCSS}
allowCustomCSS={config.preview.allowCustomCSS}
lineThroughCheckbox={config.preview.lineThroughCheckbox}
onDrop={(e) => this.handleDropImage(e)}
/> />
</div> </div>
) )

View File

@@ -16,7 +16,6 @@
.preview .preview
display block display block
absolute top bottom left right absolute top bottom left right
z-index 100
background-color white background-color white
height 100% height 100%
width 100% width 100%

939
browser/components/MarkdownPreview.js Normal file → Executable file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,218 @@
import React from 'react'
import CodeEditor from 'browser/components/CodeEditor'
import MarkdownPreview from 'browser/components/MarkdownPreview'
import { findStorage } from 'browser/lib/findStorage'
import _ from 'lodash'
import styles from './MarkdownSplitEditor.styl'
import CSSModules from 'browser/lib/CSSModules'
class MarkdownSplitEditor extends React.Component {
constructor (props) {
super(props)
this.value = props.value
this.focus = () => this.refs.code.focus()
this.reload = () => this.refs.code.reload()
this.userScroll = true
this.state = {
isSliderFocused: false,
codeEditorWidthInPercent: 50
}
}
setValue (value) {
this.refs.code.setValue(value)
}
handleOnChange (e) {
this.value = this.refs.code.value
this.props.onChange(e)
}
handleScroll (e) {
if (!this.props.config.preview.scrollSync) return
const previewDoc = _.get(this, 'refs.preview.refs.root.contentWindow.document')
const codeDoc = _.get(this, 'refs.code.editor.doc')
let srcTop, srcHeight, targetTop, targetHeight
if (this.userScroll) {
if (e.doc) {
srcTop = _.get(e, 'doc.scrollTop')
srcHeight = _.get(e, 'doc.height')
targetTop = _.get(previewDoc, 'body.scrollTop')
targetHeight = _.get(previewDoc, 'body.scrollHeight')
} else {
srcTop = _.get(previewDoc, 'body.scrollTop')
srcHeight = _.get(previewDoc, 'body.scrollHeight')
targetTop = _.get(codeDoc, 'scrollTop')
targetHeight = _.get(codeDoc, 'height')
}
const distance = (targetHeight * srcTop / srcHeight) - targetTop
const framerate = 1000 / 60
const frames = 20
const refractory = frames * framerate
this.userScroll = false
let frame = 0
let scrollPos, time
const timer = setInterval(() => {
time = frame / frames
scrollPos = time < 0.5
? 2 * time * time // ease in
: -1 + (4 - 2 * time) * time // ease out
if (e.doc) _.set(previewDoc, 'body.scrollTop', targetTop + scrollPos * distance)
else _.get(this, 'refs.code.editor').scrollTo(0, targetTop + scrollPos * distance)
if (frame >= frames) {
clearInterval(timer)
setTimeout(() => { this.userScroll = true }, refractory)
}
frame++
}, framerate)
}
}
handleCheckboxClick (e) {
e.preventDefault()
e.stopPropagation()
const idMatch = /checkbox-([0-9]+)/
const checkedMatch = /^\s*[\+\-\*] \[x\]/i
const uncheckedMatch = /^\s*[\+\-\*] \[ \]/
const checkReplace = /\[x\]/i
const uncheckReplace = /\[ \]/
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
.split('\n')
const targetLine = lines[lineIndex]
if (targetLine.match(checkedMatch)) {
lines[lineIndex] = targetLine.replace(checkReplace, '[ ]')
}
if (targetLine.match(uncheckedMatch)) {
lines[lineIndex] = targetLine.replace(uncheckReplace, '[x]')
}
this.refs.code.setValue(lines.join('\n'))
}
}
handleMouseMove (e) {
if (this.state.isSliderFocused) {
const rootRect = this.refs.root.getBoundingClientRect()
const rootWidth = rootRect.width
const offset = rootRect.left
let newCodeEditorWidthInPercent = (e.pageX - offset) / rootWidth * 100
// limit minSize to 10%, maxSize to 90%
if (newCodeEditorWidthInPercent <= 10) {
newCodeEditorWidthInPercent = 10
}
if (newCodeEditorWidthInPercent >= 90) {
newCodeEditorWidthInPercent = 90
}
this.setState({
codeEditorWidthInPercent: newCodeEditorWidthInPercent
})
}
}
handleMouseUp (e) {
e.preventDefault()
this.setState({
isSliderFocused: false
})
}
handleMouseDown (e) {
e.preventDefault()
this.setState({
isSliderFocused: true
})
}
render () {
const {config, value, storageKey, noteKey, linesHighlighted} = this.props
const storage = findStorage(storageKey)
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 previewStyle = {}
previewStyle.width = (100 - this.state.codeEditorWidthInPercent) + '%'
if (this.props.ignorePreviewPointerEvents || this.state.isSliderFocused) previewStyle.pointerEvents = 'none'
return (
<div styleName='root' ref='root'
onMouseMove={e => this.handleMouseMove(e)}
onMouseUp={e => this.handleMouseUp(e)}>
<CodeEditor
styleName='codeEditor'
ref='code'
width={this.state.codeEditorWidthInPercent + '%'}
mode='Boost Flavored Markdown'
value={value}
theme={config.editor.theme}
keyMap={config.editor.keyMap}
fontFamily={config.editor.fontFamily}
fontSize={editorFontSize}
displayLineNumbers={config.editor.displayLineNumbers}
matchingPairs={config.editor.matchingPairs}
matchingTriples={config.editor.matchingTriples}
explodingPairs={config.editor.explodingPairs}
indentType={config.editor.indentType}
indentSize={editorIndentSize}
enableRulers={config.editor.enableRulers}
rulers={config.editor.rulers}
scrollPastEnd={config.editor.scrollPastEnd}
fetchUrlTitle={config.editor.fetchUrlTitle}
enableTableEditor={config.editor.enableTableEditor}
storageKey={storageKey}
noteKey={noteKey}
linesHighlighted={linesHighlighted}
onChange={(e) => this.handleOnChange(e)}
onScroll={this.handleScroll.bind(this)}
spellCheck={config.editor.spellcheck}
enableSmartPaste={config.editor.enableSmartPaste}
hotkey={config.hotkey}
switchPreview={config.editor.switchPreview}
/>
<div styleName='slider' style={{left: this.state.codeEditorWidthInPercent + '%'}} onMouseDown={e => this.handleMouseDown(e)} >
<div styleName='slider-hitbox' />
</div>
<MarkdownPreview
style={previewStyle}
styleName='preview'
theme={config.ui.theme}
keyMap={config.editor.keyMap}
fontSize={config.preview.fontSize}
fontFamily={config.preview.fontFamily}
codeBlockTheme={config.preview.codeBlockTheme}
codeBlockFontFamily={config.editor.fontFamily}
lineNumber={config.preview.lineNumber}
scrollPastEnd={config.preview.scrollPastEnd}
smartQuotes={config.preview.smartQuotes}
smartArrows={config.preview.smartArrows}
breaks={config.preview.breaks}
sanitize={config.preview.sanitize}
ref='preview'
tabInde='0'
value={value}
onCheckboxClick={(e) => this.handleCheckboxClick(e)}
onScroll={this.handleScroll.bind(this)}
showCopyNotification={config.ui.showCopyNotification}
storagePath={storage.path}
noteKey={noteKey}
customCSS={config.preview.customCSS}
allowCustomCSS={config.preview.allowCustomCSS}
lineThroughCheckbox={config.preview.lineThroughCheckbox}
/>
</div>
)
}
}
export default CSSModules(MarkdownSplitEditor, styles)

View File

@@ -0,0 +1,16 @@
.root
width 100%
height 100%
font-size 30px
display flex
.slider
absolute top bottom
top -2px
width 0
z-index 0
.slider-hitbox
absolute top bottom left right
width 7px
left -3px
z-index 10
cursor col-resize

View File

@@ -1,4 +1,5 @@
import React, {PropTypes} from 'react' import PropTypes from 'prop-types'
import React from 'react'
import CSSModules from 'browser/lib/CSSModules' import CSSModules from 'browser/lib/CSSModules'
import styles from './ModalEscButton.styl' import styles from './ModalEscButton.styl'

View File

@@ -1,7 +1,8 @@
/** /**
* @fileoverview Micro component for toggle SideNav * @fileoverview Micro component for toggle SideNav
*/ */
import React, { PropTypes } from 'react' import PropTypes from 'prop-types'
import React from 'react'
import styles from './NavToggleButton.styl' import styles from './NavToggleButton.styl'
import CSSModules from 'browser/lib/CSSModules' import CSSModules from 'browser/lib/CSSModules'

View File

@@ -9,6 +9,10 @@
width 34px width 34px
line-height 32px line-height 32px
padding 0 padding 0
&:hover
border: 1px solid #1EC38B;
background-color: alpha(#1EC38B, 30%)
border-radius: 50%;
body[data-theme="white"] body[data-theme="white"]
navWhiteButtonColor() navWhiteButtonColor()

View File

@@ -1,39 +1,52 @@
/** /**
* @fileoverview Note item component. * @fileoverview Note item component.
*/ */
import React, { PropTypes } from 'react' import PropTypes from 'prop-types'
import React from 'react'
import { isArray } from 'lodash' import { isArray } from 'lodash'
import invertColor from 'invert-color'
import CSSModules from 'browser/lib/CSSModules' import CSSModules from 'browser/lib/CSSModules'
import { getTodoStatus } from 'browser/lib/getTodoStatus' import { getTodoStatus } from 'browser/lib/getTodoStatus'
import styles from './NoteItem.styl' import styles from './NoteItem.styl'
import TodoProcess from './TodoProcess' import TodoProcess from './TodoProcess'
import i18n from 'browser/lib/i18n'
/** /**
* @description Tag element component. * @description Tag element component.
* @param {string} tagName * @param {string} tagName
* @param {string} color
* @return {React.Component} * @return {React.Component}
*/ */
const TagElement = ({ tagName }) => ( const TagElement = ({ tagName, color }) => {
<span styleName='item-bottom-tagList-item' key={tagName}> const style = {}
#{tagName} if (color) {
</span> style.backgroundColor = color
) style.color = invertColor(color, { black: '#222', white: '#f1f1f1', threshold: 0.3 })
}
return (
<span styleName='item-bottom-tagList-item' key={tagName} style={style}>
#{tagName}
</span>
)
}
/** /**
* @description Tag element list component. * @description Tag element list component.
* @param {Array|null} tags * @param {Array|null} tags
* @param {boolean} showTagsAlphabetically
* @param {Object} coloredTags
* @return {React.Component} * @return {React.Component}
*/ */
const TagElementList = (tags) => { const TagElementList = (tags, showTagsAlphabetically, coloredTags) => {
if (!isArray(tags)) { if (!isArray(tags)) {
return [] return []
} }
const tagElements = tags.map(tag => ( if (showTagsAlphabetically) {
TagElement({tagName: tag}) return _.sortBy(tags).map(tag => TagElement({ tagName: tag, color: coloredTags[tag] }))
)) } else {
return tags.map(tag => TagElement({ tagName: tag, color: coloredTags[tag] }))
return tagElements }
} }
/** /**
@@ -43,48 +56,80 @@ const TagElementList = (tags) => {
* @param {Function} handleNoteClick * @param {Function} handleNoteClick
* @param {Function} handleNoteContextMenu * @param {Function} handleNoteContextMenu
* @param {Function} handleDragStart * @param {Function} handleDragStart
* @param {Object} coloredTags
* @param {string} dateDisplay * @param {string} dateDisplay
*/ */
const NoteItem = ({ isActive, note, dateDisplay, handleNoteClick, handleNoteContextMenu, handleDragStart, pathname }) => ( const NoteItem = ({
<div styleName={isActive isActive,
? 'item--active' note,
: 'item' dateDisplay,
} handleNoteClick,
key={`${note.storage}-${note.key}`} handleNoteContextMenu,
onClick={e => handleNoteClick(e, `${note.storage}-${note.key}`)} handleDragStart,
onContextMenu={e => handleNoteContextMenu(e, `${note.storage}-${note.key}`)} pathname,
storageName,
folderName,
viewType,
showTagsAlphabetically,
coloredTags
}) => (
<div
styleName={isActive ? 'item--active' : 'item'}
key={note.key}
onClick={e => handleNoteClick(e, note.key)}
onContextMenu={e => handleNoteContextMenu(e, note.key)}
onDragStart={e => handleDragStart(e, note)} onDragStart={e => handleDragStart(e, note)}
draggable='true' draggable='true'
> >
<div styleName='item-wrapper'> <div styleName='item-wrapper'>
{note.type === 'SNIPPET_NOTE' {note.type === 'SNIPPET_NOTE'
? <i styleName='item-title-icon' className='fa fa-fw fa-code' /> ? <i styleName='item-title-icon' className='fa fa-fw fa-code' />
: <i styleName='item-title-icon' className='fa fa-fw fa-file-text-o' /> : <i styleName='item-title-icon' className='fa fa-fw fa-file-text-o' />}
}
<div styleName='item-title'> <div styleName='item-title'>
{note.title.trim().length > 0 {note.title.trim().length > 0
? note.title ? note.title
: <span styleName='item-title-empty'>Empty</span> : <span styleName='item-title-empty'>{i18n.__('Empty note')}</span>}
} </div>
<div styleName='item-middle'>
<div styleName='item-middle-time'>{dateDisplay}</div>
<div styleName='item-middle-app-meta'>
<div
title={
viewType === 'ALL'
? storageName
: viewType === 'STORAGE' ? folderName : null
}
styleName='item-middle-app-meta-label'
>
{viewType === 'ALL' && storageName}
{viewType === 'STORAGE' && folderName}
</div>
</div>
</div> </div>
<div styleName='item-bottom-time'>{dateDisplay}</div>
{note.isStarred
? <img styleName='item-star' src='../resources/icon/icon-starred.svg' /> : ''
}
{note.isPinned && !pathname.match(/\/home|\/starred|\/trash/)
? <i styleName='item-pin' className='fa fa-thumb-tack' /> : ''
}
{note.type === 'MARKDOWN_NOTE'
? <TodoProcess todoStatus={getTodoStatus(note.content)} />
: ''
}
<div styleName='item-bottom'> <div styleName='item-bottom'>
<div styleName='item-bottom-tagList'> <div styleName='item-bottom-tagList'>
{note.tags.length > 0 {note.tags.length > 0
? TagElementList(note.tags) ? TagElementList(note.tags, showTagsAlphabetically, coloredTags)
: <span styleName='item-bottom-tagList-empty' /> : <span
} style={{ fontStyle: 'italic', opacity: 0.5 }}
styleName='item-bottom-tagList-empty'
>
{i18n.__('No tags')}
</span>}
</div>
<div>
{note.isStarred
? <img
styleName='item-star'
src='../resources/icon/icon-starred.svg'
/>
: ''}
{note.isPinned && !pathname.match(/\/starred|\/trash/)
? <i styleName='item-pin' className='fa fa-thumb-tack' />
: ''}
{note.type === 'MARKDOWN_NOTE'
? <TodoProcess todoStatus={getTodoStatus(note.content)} />
: ''}
</div> </div>
</div> </div>
</div> </div>
@@ -94,6 +139,7 @@ const NoteItem = ({ isActive, note, dateDisplay, handleNoteClick, handleNoteCont
NoteItem.propTypes = { NoteItem.propTypes = {
isActive: PropTypes.bool.isRequired, isActive: PropTypes.bool.isRequired,
dateDisplay: PropTypes.string.isRequired, dateDisplay: PropTypes.string.isRequired,
coloredTags: PropTypes.object,
note: PropTypes.shape({ note: PropTypes.shape({
storage: PropTypes.string.isRequired, storage: PropTypes.string.isRequired,
key: PropTypes.string.isRequired, key: PropTypes.string.isRequired,
@@ -101,7 +147,11 @@ NoteItem.propTypes = {
title: PropTypes.string.isrequired, title: PropTypes.string.isrequired,
tags: PropTypes.array, tags: PropTypes.array,
isStarred: PropTypes.bool.isRequired, isStarred: PropTypes.bool.isRequired,
isTrashed: PropTypes.bool.isRequired isTrashed: PropTypes.bool.isRequired,
blog: {
blogLink: PropTypes.string,
blogId: PropTypes.number
}
}), }),
handleNoteClick: PropTypes.func.isRequired, handleNoteClick: PropTypes.func.isRequired,
handleNoteContextMenu: PropTypes.func.isRequired, handleNoteContextMenu: PropTypes.func.isRequired,

View File

@@ -73,6 +73,7 @@ $control-height = 30px
position relative position relative
font-size 12px font-size 12px
color $ui-inactive-text-color color $ui-inactive-text-color
top 2px
.item-title .item-title
font-size 15px font-size 15px
@@ -80,8 +81,8 @@ $control-height = 30px
position relative position relative
top -12px top -12px
left 20px left 20px
padding-right 15px padding 0px 15px 0px 0px
padding-bottom 4px margin-bottom 4px
overflow ellipsis overflow ellipsis
color $ui-inactive-text-color color $ui-inactive-text-color
@@ -89,6 +90,26 @@ $control-height = 30px
font-weight normal font-weight normal
color $ui-inactive-text-color color $ui-inactive-text-color
.item-middle
font-size 13px
padding-left 2px
padding-bottom 2px
.item-middle-time
color $ui-inactive-text-color
display inline-block
.item-middle-app-meta
float right
.item-middle-app-meta-label
opacity 0.4
color $ui-inactive-text-color
padding 0 3px
white-space nowrap
text-overflow ellipsis
overflow hidden
max-width 200px
.item-bottom .item-bottom
position relative position relative
bottom 0px bottom 0px
@@ -96,7 +117,7 @@ $control-height = 30px
font-size 12px font-size 12px
line-height 20px line-height 20px
overflow ellipsis overflow ellipsis
display flex display block
.item-bottom-tagList .item-bottom-tagList
flex 1 flex 1
@@ -124,10 +145,8 @@ $control-height = 30px
.item-star .item-star
position absolute position absolute
right -6px right 2px
bottom 23px top 5px
width 16px
height 16px
color alpha($ui-favorite-star-button-color, 60%) color alpha($ui-favorite-star-button-color, 60%)
font-size 12px font-size 12px
padding 0 padding 0
@@ -135,10 +154,8 @@ $control-height = 30px
.item-pin .item-pin
position absolute position absolute
right 0px right 25px
bottom 2px top 7px
width 34px
height 34px
color #E54D42 color #E54D42
font-size 14px font-size 14px
padding 0 padding 0
@@ -191,7 +208,7 @@ body[data-theme="dark"]
.item-bottom-tagList-item .item-bottom-tagList-item
transition 0.15s transition 0.15s
background-color alpha(white, 10%) background-color alpha(white, 10%)
color $ui-dark-text-color color $ui-dark-text-color
.item-wrapper .item-wrapper
border-color alpha($ui-dark-button--active-backgroundColor, 60%) border-color alpha($ui-dark-button--active-backgroundColor, 60%)
@@ -230,3 +247,223 @@ body[data-theme="dark"]
.item-bottom-tagList-empty .item-bottom-tagList-empty
color $ui-inactive-text-color color $ui-inactive-text-color
vertical-align middle vertical-align middle
body[data-theme="solarized-dark"]
.root
border-color $ui-solarized-dark-borderColor
background-color $ui-solarized-dark-noteList-backgroundColor
.item
border-color $ui-solarized-dark-borderColor
background-color $ui-solarized-dark-noteList-backgroundColor
&:hover
transition 0.15s
// background-color alpha($ui-solarized-dark-noteList-backgroundColor, 20%)
color $ui-solarized-dark-text-color
.item-title
.item-title-icon
.item-bottom-time
transition 0.15s
color $ui-solarized-dark-text-color
.item-bottom-tagList-item
transition 0.15s
background-color alpha($ui-solarized-dark-noteList-backgroundColor, 20%)
color $ui-solarized-dark-text-color
&:active
transition 0.15s
background-color $ui-solarized-dark-noteList-backgroundColor
color $ui-solarized-dark-text-color
.item-title
.item-title-icon
.item-bottom-time
transition 0.15s
color $ui-solarized-dark-text-color
.item-bottom-tagList-item
transition 0.15s
background-color alpha($ui-solarized-dark-noteList-backgroundColor, 10%)
color $ui-solarized-dark-text-color
.item-wrapper
border-color alpha($ui-solarized-dark-button--active-backgroundColor, 60%)
.item--active
border-color $ui-solarized-dark-borderColor
background-color $ui-solarized-dark-button-backgroundColor
.item-wrapper
border-color transparent
.item-title
.item-title-icon
.item-bottom-time
color $ui-solarized-dark-text-color
.item-bottom-tagList-item
background-color alpha(white, 10%)
color $ui-solarized-dark-text-color
&:hover
// background-color alpha($ui-solarized-dark-button--active-backgroundColor, 60%)
color #c0392b
.item-bottom-tagList-item
background-color alpha(#fff, 20%)
.item-title
color $ui-inactive-text-color
.item-title-icon
color $ui-inactive-text-color
.item-title-empty
color $ui-inactive-text-color
.item-bottom-tagList-item
background-color alpha($ui-dark-button--active-backgroundColor, 40%)
color $ui-inactive-text-color
.item-bottom-tagList-empty
color $ui-inactive-text-color
vertical-align middle
body[data-theme="monokai"]
.root
border-color $ui-monokai-borderColor
background-color $ui-monokai-noteList-backgroundColor
.item
border-color $ui-monokai-borderColor
background-color $ui-monokai-noteList-backgroundColor
&:hover
transition 0.15s
// background-color alpha($ui-monokai-noteList-backgroundColor, 20%)
color $ui-monokai-text-color
.item-title
.item-title-icon
.item-bottom-time
transition 0.15s
color $ui-monokai-text-color
.item-bottom-tagList-item
transition 0.15s
background-color alpha($ui-monokai-noteList-backgroundColor, 20%)
color $ui-monokai-text-color
&:active
transition 0.15s
background-color $ui-monokai-noteList-backgroundColor
color $ui-monokai-text-color
.item-title
.item-title-icon
.item-bottom-time
transition 0.15s
color $ui-monokai-text-color
.item-bottom-tagList-item
transition 0.15s
background-color alpha($ui-monokai-noteList-backgroundColor, 10%)
color $ui-monokai-text-color
.item-wrapper
border-color alpha($ui-monokai-button-backgroundColor, 60%)
.item--active
border-color $ui-monokai-borderColor
background-color $ui-monokai-button-backgroundColor
.item-wrapper
border-color transparent
.item-title
.item-title-icon
.item-bottom-time
color $ui-monokai-active-color
.item-bottom-tagList-item
background-color alpha(white, 10%)
color $ui-monokai-text-color
&:hover
// background-color alpha($ui-monokai-button--active-backgroundColor, 60%)
color #f92672
.item-bottom-tagList-item
background-color alpha(#fff, 20%)
.item-title
color $ui-inactive-text-color
.item-title-icon
color $ui-inactive-text-color
.item-title-empty
color $ui-inactive-text-color
.item-bottom-tagList-item
background-color alpha($ui-dark-button--active-backgroundColor, 40%)
color $ui-inactive-text-color
.item-bottom-tagList-empty
color $ui-inactive-text-color
vertical-align middle
body[data-theme="dracula"]
.root
border-color $ui-dracula-borderColor
background-color $ui-dracula-noteList-backgroundColor
.item
border-color $ui-dracula-borderColor
background-color $ui-dracula-noteList-backgroundColor
&:hover
transition 0.15s
// background-color alpha($ui-dracula-noteList-backgroundColor, 20%)
color $ui-dracula-text-color
.item-title
.item-title-icon
.item-bottom-time
transition 0.15s
color $ui-dracula-text-color
.item-bottom-tagList-item
transition 0.15s
background-color alpha($ui-dracula-noteList-backgroundColor, 20%)
color $ui-dracula-text-color
&:active
transition 0.15s
background-color $ui-dracula-noteList-backgroundColor
color $ui-dracula-text-color
.item-title
.item-title-icon
.item-bottom-time
transition 0.15s
color $ui-dracula-text-color
.item-bottom-tagList-item
transition 0.15s
background-color alpha($ui-dracula-noteList-backgroundColor, 10%)
color $ui-dracula-text-color
.item-wrapper
border-color alpha($ui-dracula-button-backgroundColor, 60%)
.item--active
border-color $ui-dracula-borderColor
background-color $ui-dracula-button-backgroundColor
.item-wrapper
border-color transparent
.item-title
.item-title-icon
.item-bottom-time
color $ui-dracula-active-color
.item-bottom-tagList-item
background-color alpha(#f8f8f2, 10%)
color $ui-dracula-text-color
&:hover
// background-color alpha($ui-dracula-button--active-backgroundColor, 60%)
color #ff79c6
.item-bottom-tagList-item
background-color alpha(#f8f8f2, 20%)
.item-title
color $ui-inactive-text-color
.item-title-icon
color $ui-inactive-text-color
.item-title-empty
color $ui-inactive-text-color
.item-bottom-tagList-item
background-color alpha($ui-dark-button--active-backgroundColor, 40%)
color $ui-inactive-text-color
.item-bottom-tagList-empty
color $ui-inactive-text-color
vertical-align middle

View File

@@ -1,9 +1,11 @@
/** /**
* @fileoverview Note item component with simple display mode. * @fileoverview Note item component with simple display mode.
*/ */
import React, { PropTypes } from 'react' import PropTypes from 'prop-types'
import React from 'react'
import CSSModules from 'browser/lib/CSSModules' import CSSModules from 'browser/lib/CSSModules'
import styles from './NoteItemSimple.styl' import styles from './NoteItemSimple.styl'
import i18n from 'browser/lib/i18n'
/** /**
* @description Note item component when using simple display mode. * @description Note item component when using simple display mode.
@@ -13,14 +15,23 @@ import styles from './NoteItemSimple.styl'
* @param {Function} handleNoteContextMenu * @param {Function} handleNoteContextMenu
* @param {Function} handleDragStart * @param {Function} handleDragStart
*/ */
const NoteItemSimple = ({ isActive, note, handleNoteClick, handleNoteContextMenu, handleDragStart }) => ( const NoteItemSimple = ({
isActive,
isAllNotesView,
note,
handleNoteClick,
handleNoteContextMenu,
handleDragStart,
pathname,
storage
}) => (
<div styleName={isActive <div styleName={isActive
? 'item-simple--active' ? 'item-simple--active'
: 'item-simple' : 'item-simple'
} }
key={`${note.storage}-${note.key}`} key={note.key}
onClick={e => handleNoteClick(e, `${note.storage}-${note.key}`)} onClick={e => handleNoteClick(e, note.key)}
onContextMenu={e => handleNoteContextMenu(e, `${note.storage}-${note.key}`)} onContextMenu={e => handleNoteContextMenu(e, note.key)}
onDragStart={e => handleDragStart(e, note)} onDragStart={e => handleDragStart(e, note)}
draggable='true' draggable='true'
> >
@@ -29,10 +40,19 @@ const NoteItemSimple = ({ isActive, note, handleNoteClick, handleNoteContextMenu
? <i styleName='item-simple-title-icon' className='fa fa-fw fa-code' /> ? <i styleName='item-simple-title-icon' className='fa fa-fw fa-code' />
: <i styleName='item-simple-title-icon' className='fa fa-fw fa-file-text-o' /> : <i styleName='item-simple-title-icon' className='fa fa-fw fa-file-text-o' />
} }
{note.isPinned && !pathname.match(/\/starred|\/trash/)
? <i styleName='item-pin' className='fa fa-thumb-tack' />
: ''
}
{note.title.trim().length > 0 {note.title.trim().length > 0
? note.title ? note.title
: <span styleName='item-simple-title-empty'>Empty</span> : <span styleName='item-simple-title-empty'>{i18n.__('Empty note')}</span>
} }
{isAllNotesView && <div styleName='item-simple-right'>
<span styleName='item-simple-right-storageName'>
{storage.name}
</span>
</div>}
</div> </div>
</div> </div>
) )

View File

@@ -50,6 +50,7 @@ $control-height = 30px
.item-simple-title .item-simple-title
font-size 13px font-size 13px
height 40px height 40px
padding-right 20px
box-sizing border-box box-sizing border-box
line-height 24px line-height 24px
padding-top 8px padding-top 8px
@@ -67,6 +68,15 @@ $control-height = 30px
font-weight normal font-weight normal
color $ui-inactive-text-color color $ui-inactive-text-color
.item-pin
position absolute
right 0px
top 12px
color #E54D42
font-size 14px
padding 0
border-radius 17px
body[data-theme="white"] body[data-theme="white"]
.item-simple .item-simple
background-color $ui-white-noteList-backgroundColor background-color $ui-white-noteList-backgroundColor
@@ -94,6 +104,7 @@ body[data-theme="dark"]
background-color alpha($ui-dark-button--active-backgroundColor, 20%) background-color alpha($ui-dark-button--active-backgroundColor, 20%)
color $ui-dark-text-color color $ui-dark-text-color
.item-simple-title .item-simple-title
.item-simple-title-empty
.item-simple-title-icon .item-simple-title-icon
.item-simple-bottom-time .item-simple-bottom-time
transition 0.15s transition 0.15s
@@ -107,6 +118,7 @@ body[data-theme="dark"]
background-color $ui-dark-button--active-backgroundColor background-color $ui-dark-button--active-backgroundColor
color $ui-dark-text-color color $ui-dark-text-color
.item-simple-title .item-simple-title
.item-simple-title-empty
.item-simple-title-icon .item-simple-title-icon
.item-simple-bottom-time .item-simple-bottom-time
transition 0.15s transition 0.15s
@@ -114,7 +126,7 @@ body[data-theme="dark"]
.item-simple-bottom-tagList-item .item-simple-bottom-tagList-item
transition 0.15s transition 0.15s
background-color alpha(white, 10%) background-color alpha(white, 10%)
color $ui-dark-text-color color $ui-dark-text-color
.item-simple--active .item-simple--active
border-color $ui-dark-borderColor border-color $ui-dark-borderColor
@@ -122,6 +134,7 @@ body[data-theme="dark"]
.item-simple-wrapper .item-simple-wrapper
border-color transparent border-color transparent
.item-simple-title .item-simple-title
.item-simple-title-empty
.item-simple-title-icon .item-simple-title-icon
.item-simple-bottom-time .item-simple-bottom-time
color $ui-dark-text-color color $ui-dark-text-color
@@ -143,3 +156,197 @@ body[data-theme="dark"]
.item-simple-title-empty .item-simple-title-empty
color $ui-dark-inactive-text-color color $ui-dark-inactive-text-color
body[data-theme="solarized-dark"]
.root
border-color $ui-solarized-dark-borderColor
background-color $ui-solarized-dark-noteList-backgroundColor
.item-simple
border-color $ui-solarized-dark-borderColor
background-color $ui-solarized-dark-noteList-backgroundColor
&:hover
transition 0.15s
background-color alpha($ui-dark-button--active-backgroundColor, 60%)
color $ui-solarized-dark-text-color
.item-simple-title
.item-simple-title-empty
.item-simple-title-icon
.item-simple-bottom-time
transition 0.15s
color $ui-solarized-dark-text-color
.item-simple-bottom-tagList-item
transition 0.15s
background-color alpha(#fff, 20%)
color $ui-solarized-dark-text-color
&:active
transition 0.15s
// background-color $ui-solarized-dark-button--active-backgroundColor
color $ui-dark-text-color
.item-simple-title
.item-simple-title-empty
.item-simple-title-icon
.item-simple-bottom-time
transition 0.15s
color $ui-solarized-dark-text-color
.item-simple-bottom-tagList-item
transition 0.15s
background-color alpha(white, 10%)
color $ui-solarized-dark-text-color
.item-simple--active
border-color $ui-solarized-dark-borderColor
background-color $ui-solarized-dark-tag-backgroundColor
.item-simple-wrapper
border-color transparent
.item-simple-title
.item-simple-title-empty
.item-simple-title-icon
color $ui-dark-text-color
.item-simple-bottom-time
color $ui-solarized-dark-text-color
.item-simple-bottom-tagList-item
background-color alpha(white, 10%)
color $ui-solarized-dark-text-color
&:hover
// background-color alpha($ui-dark-button--active-backgroundColor, 60%)
color #c0392b
.item-simple-bottom-tagList-item
background-color alpha(#fff, 20%)
.item-simple-title
color $ui-dark-text-color
border-bottom $ui-dark-borderColor
.item-simple-right
float right
.item-simple-right-storageName
padding-left 4px
opacity 0.4
body[data-theme="monokai"]
.root
border-color $ui-monokai-borderColor
background-color $ui-monokai-noteList-backgroundColor
.item-simple
border-color $ui-monokai-borderColor
background-color $ui-monokai-noteList-backgroundColor
&:hover
transition 0.15s
background-color alpha($ui-monokai-button-backgroundColor, 60%)
color $ui-monokai-text-color
.item-simple-title
.item-simple-title-empty
.item-simple-title-icon
.item-simple-bottom-time
transition 0.15s
color $ui-monokai-text-color
.item-simple-bottom-tagList-item
transition 0.15s
background-color alpha(#fff, 20%)
color $ui-monokai-text-color
&:active
transition 0.15s
background-color $ui-monokai-button--active-backgroundColor
color $ui-monokai-text-color
.item-simple-title
.item-simple-title-empty
.item-simple-title-icon
.item-simple-bottom-time
transition 0.15s
color $ui-monokai-text-color
.item-simple-bottom-tagList-item
transition 0.15s
background-color alpha(white, 10%)
color $ui-monokai-text-color
.item-simple--active
border-color $ui-monokai-borderColor
background-color $ui-monokai-button--active-backgroundColor
.item-simple-wrapper
border-color transparent
.item-simple-title
.item-simple-title-empty
.item-simple-title-icon
.item-simple-bottom-time
color $ui-monokai-text-color
.item-simple-bottom-tagList-item
background-color alpha(white, 10%)
color $ui-monokai-text-color
&:hover
// background-color alpha($ui-dark-button--active-backgroundColor, 60%)
color #c0392b
.item-simple-bottom-tagList-item
background-color alpha(#fff, 20%)
.item-simple-title
color $ui-dark-text-color
border-bottom $ui-dark-borderColor
.item-simple-right
float right
.item-simple-right-storageName
padding-left 4px
opacity 0.4
body[data-theme="dracula"]
.root
border-color $ui-dracula-borderColor
background-color $ui-dracula-noteList-backgroundColor
.item-simple
border-color $ui-dracula-borderColor
background-color $ui-dracula-noteList-backgroundColor
&:hover
transition 0.15s
background-color alpha($ui-dracula-button-backgroundColor, 60%)
color $ui-dracula-text-color
.item-simple-title
.item-simple-title-empty
.item-simple-title-icon
.item-simple-bottom-time
transition 0.15s
color $ui-dracula-text-color
.item-simple-bottom-tagList-item
transition 0.15s
background-color alpha(#f8f8f2, 20%)
color $ui-dracula-text-color
&:active
transition 0.15s
background-color $ui-dracula-button--active-backgroundColor
color $ui-dracula-text-color
.item-simple-title
.item-simple-title-empty
.item-simple-title-icon
.item-simple-bottom-time
transition 0.15s
color $ui-dracula-text-color
.item-simple-bottom-tagList-item
transition 0.15s
background-color alpha(#f8f8f2, 10%)
color $ui-dracula-text-color
.item-simple--active
border-color $ui-dracula-borderColor
background-color $ui-dracula-button--active-backgroundColor
.item-simple-wrapper
border-color transparent
.item-simple-title
.item-simple-title-empty
.item-simple-title-icon
.item-simple-bottom-time
color $ui-dracula-text-color
.item-simple-bottom-tagList-item
background-color alpha(#f8f8f2, 10%)
color $ui-dracula-text-color
&:hover
// background-color alpha($ui-dark-button--active-backgroundColor, 60%)
color #c0392b
.item-simple-bottom-tagList-item
background-color alpha(#f8f8f2, 20%)
.item-simple-title
color $ui-dark-text-color
border-bottom $ui-dark-borderColor
.item-simple-right
float right
.item-simple-right-storageName
padding-left 4px
opacity 0.4

View File

@@ -1,4 +1,4 @@
import React, { PropTypes } from 'react' import React from 'react'
import CSSModules from 'browser/lib/CSSModules' import CSSModules from 'browser/lib/CSSModules'
import styles from './RealtimeNotification.styl' import styles from './RealtimeNotification.styl'

View File

@@ -1,11 +1,8 @@
.notification-area .notification-area
z-index 1000 z-index 1000
font-size 12px font-size 12px
position absolute position: relative
bottom 20px top: 12px
width 100%
float left
height 30px
background-color none background-color none
.notification-link .notification-link
@@ -32,3 +29,37 @@ body[data-theme="dark"]
transition 0.2s transition 0.2s
&:hover &:hover
color #5CB85C color #5CB85C
body[data-theme="solarized-dark"]
.notification-area
background-color none
.notification-link
color $ui-solarized-dark-text-color
border none
background-color $ui-solarized-dark-button-backgroundColor
&:hover
color #5CB85C
body[data-theme="monokai"]
.notification-area
background-color none
.notification-link
color $ui-monokai-text-color
border none
background-color $ui-monokai-button-backgroundColor
&:hover
color #5CB85C
body[data-theme="dracula"]
.notification-area
background-color none
.notification-link
color $ui-dracula-text-color
border none
background-color $ui-dracula-button-backgroundColor
&:hover
color #ff79c6

View File

@@ -1,9 +1,11 @@
/** /**
* @fileoverview Filter for all notes. * @fileoverview Filter for all notes.
*/ */
import React, { PropTypes } from 'react' import PropTypes from 'prop-types'
import React from 'react'
import CSSModules from 'browser/lib/CSSModules' import CSSModules from 'browser/lib/CSSModules'
import styles from './SideNavFilter.styl' import styles from './SideNavFilter.styl'
import i18n from 'browser/lib/i18n'
/** /**
* @param {boolean} isFolded * @param {boolean} isFolded
@@ -16,7 +18,7 @@ import styles from './SideNavFilter.styl'
const SideNavFilter = ({ const SideNavFilter = ({
isFolded, isHomeActive, handleAllNotesButtonClick, isFolded, isHomeActive, handleAllNotesButtonClick,
isStarredActive, handleStarredButtonClick, isTrashedActive, handleTrashedButtonClick, counterDelNote, isStarredActive, handleStarredButtonClick, isTrashedActive, handleTrashedButtonClick, counterDelNote,
counterTotalNote, counterStarredNote counterTotalNote, counterStarredNote, handleFilterButtonContextMenu
}) => ( }) => (
<div styleName={isFolded ? 'menu--folded' : 'menu'}> <div styleName={isFolded ? 'menu--folded' : 'menu'}>
@@ -25,12 +27,12 @@ const SideNavFilter = ({
> >
<div styleName='iconWrap'> <div styleName='iconWrap'>
<img src={isHomeActive <img src={isHomeActive
? '../resources/icon/icon-all-active.svg' ? '../resources/icon/icon-all-active.svg'
: '../resources/icon/icon-all.svg' : '../resources/icon/icon-all.svg'
} }
/> />
</div> </div>
<span styleName='menu-button-label'>All Notes</span> <span styleName='menu-button-label'>{i18n.__('All Notes')}</span>
<span styleName='counters'>{counterTotalNote}</span> <span styleName='counters'>{counterTotalNote}</span>
</button> </button>
@@ -39,26 +41,26 @@ const SideNavFilter = ({
> >
<div styleName='iconWrap'> <div styleName='iconWrap'>
<img src={isStarredActive <img src={isStarredActive
? '../resources/icon/icon-star-active.svg' ? '../resources/icon/icon-star-active.svg'
: '../resources/icon/icon-star.svg' : '../resources/icon/icon-star-sidenav.svg'
} }
/> />
</div> </div>
<span styleName='menu-button-label'>Starred</span> <span styleName='menu-button-label'>{i18n.__('Starred')}</span>
<span styleName='counters'>{counterStarredNote}</span> <span styleName='counters'>{counterStarredNote}</span>
</button> </button>
<button styleName={isTrashedActive ? 'menu-button-trash--active' : 'menu-button'} <button styleName={isTrashedActive ? 'menu-button-trash--active' : 'menu-button'}
onClick={handleTrashedButtonClick} onClick={handleTrashedButtonClick} onContextMenu={handleFilterButtonContextMenu}
> >
<div styleName='iconWrap'> <div styleName='iconWrap'>
<img src={isTrashedActive <img src={isTrashedActive
? '../resources/icon/icon-trash-active.svg' ? '../resources/icon/icon-trash-active.svg'
: '../resources/icon/icon-trash.svg' : '../resources/icon/icon-trash-sidenav.svg'
} }
/> />
</div> </div>
<span styleName='menu-button-label'>Trash</span> <span styleName='menu-button-label'>{i18n.__('Trash')}</span>
<span styleName='counters'>{counterDelNote}</span> <span styleName='counters'>{counterDelNote}</span>
</button> </button>

View File

@@ -18,7 +18,7 @@
.iconWrap .iconWrap
width 20px width 20px
text-align center text-align center
.counters .counters
float right float right
color $ui-inactive-text-color color $ui-inactive-text-color
@@ -55,19 +55,22 @@
.menu--folded .menu--folded
@extend .menu @extend .menu
.menu-button, .menu-button--active .menu-button, .menu-button--active, .menu-button-star--active, .menu-button-trash--active
text-align center text-align center
padding 0 12px
&:hover .menu-button-label &:hover .menu-button-label
transition opacity 0.15s transition opacity 0.15s
opacity 1 opacity 1
color $ui-tooltip-text-color
background-color $ui-tooltip-backgroundColor
.menu-button-label .menu-button-label
position fixed position fixed
display inline-block display inline-block
height 32px height 36px
left 44px left 44px
padding 0 10px padding 0 10px
margin-top -8px
margin-left 0 margin-left 0
overflow ellipsis overflow ellipsis
z-index 10 z-index 10
@@ -88,7 +91,6 @@ body[data-theme="white"]
color $ui-inactive-text-color color $ui-inactive-text-color
.menu-button--active .menu-button--active
@extend .menu-button
color #e74c3c color #e74c3c
background-color $ui-button--active-backgroundColor background-color $ui-button--active-backgroundColor
.menu-button-label .menu-button-label
@@ -105,7 +107,6 @@ body[data-theme="white"]
color $ui-text-color color $ui-text-color
.menu-button-star--active .menu-button-star--active
@extend .menu-button
color #F9BF3B color #F9BF3B
background-color $ui-button--active-backgroundColor background-color $ui-button--active-backgroundColor
.menu-button-label .menu-button-label
@@ -122,7 +123,6 @@ body[data-theme="white"]
color $ui-text-color color $ui-text-color
.menu-button-trash--active .menu-button-trash--active
@extend .menu-button
color #5D9E36 color #5D9E36
background-color $ui-button--active-backgroundColor background-color $ui-button--active-backgroundColor
.menu-button-label .menu-button-label
@@ -178,4 +178,131 @@ body[data-theme="dark"]
background-color alpha($ui-dark-button--active-backgroundColor, 50%) background-color alpha($ui-dark-button--active-backgroundColor, 50%)
color #5D9E36 color #5D9E36
.menu-button-label .menu-button-label
color $ui-dark-text-color color $ui-dark-text-color
body[data-theme="solarized-dark"]
.menu-button
&:active
background-color $ui-solarized-dark-noteList-backgroundColor
color $ui-solarized-dark-text-color
&:hover
background-color $ui-solarized-dark-button-backgroundColor
color $ui-solarized-dark-text-color
.menu-button--active
color $ui-solarized-dark-text-color
background-color $ui-solarized-dark-button-backgroundColor
.menu-button-label
color $ui-solarized-dark-text-color
&:hover
background-color $ui-solarized-dark-button-backgroundColor
color $ui-solarized-dark-text-color
.menu-button-label
color $ui-solarized-dark-text-color
.menu-button-star--active
color $ui-solarized-dark-text-color
background-color $ui-solarized-dark-button-backgroundColor
.menu-button-label
color $ui-solarized-dark-text-color
&:hover
background-color $ui-solarized-dark-button-backgroundColor
color $ui-solarized-dark-text-color
.menu-button-label
color $ui-solarized-dark-text-color
.menu-button-trash--active
color $ui-solarized-dark-text-color
background-color $ui-solarized-dark-button-backgroundColor
.menu-button-label
color $ui-solarized-dark-text-color
&:hover
background-color $ui-solarized-dark-button-backgroundColor
color $ui-solarized-dark-text-color
.menu-button-label
color $ui-solarized-dark-text-color
body[data-theme="monokai"]
.menu-button
&:active
background-color $ui-monokai-noteList-backgroundColor
color $ui-monokai-text-color
&:hover
background-color $ui-monokai-button-backgroundColor
color $ui-monokai-text-color
.menu-button--active
color $ui-monokai-text-color
background-color $ui-monokai-button-backgroundColor
.menu-button-label
color $ui-monokai-text-color
&:hover
background-color $ui-monokai-button-backgroundColor
color $ui-monokai-text-color
.menu-button-label
color $ui-monokai-text-color
.menu-button-star--active
color $ui-monokai-text-color
background-color $ui-monokai-button-backgroundColor
.menu-button-label
color $ui-monokai-text-color
&:hover
background-color $ui-monokai-button-backgroundColor
color $ui-monokai-text-color
.menu-button-label
color $ui-monokai-text-color
.menu-button-trash--active
color $ui-monokai-text-color
background-color $ui-monokai-button-backgroundColor
.menu-button-label
color $ui-monokai-text-color
&:hover
background-color $ui-monokai-button-backgroundColor
color $ui-monokai-text-color
.menu-button-label
color $ui-monokai-text-color
body[data-theme="dracula"]
.menu-button
&:active
background-color $ui-dracula-noteList-backgroundColor
color $ui-dracula-text-color
&:hover
background-color $ui-dracula-button-backgroundColor
color $ui-dracula-text-color
.menu-button--active
color $ui-dracula-text-color
background-color $ui-dracula-button-backgroundColor
.menu-button-label
color $ui-dracula-text-color
&:hover
background-color $ui-dracula-button-backgroundColor
color $ui-dracula-text-color
.menu-button-label
color $ui-dracula-text-color
.menu-button-star--active
color $ui-dracula-text-color
background-color $ui-dracula-button-backgroundColor
.menu-button-label
color $ui-dracula-text-color
&:hover
background-color $ui-dracula-button-backgroundColor
color $ui-dracula-text-color
.menu-button-label
color $ui-dracula-text-color
.menu-button-trash--active
color $ui-dracula-text-color
background-color $ui-dracula-button-backgroundColor
.menu-button-label
color $ui-dracula-text-color
&:hover
background-color $ui-dracula-button-backgroundColor
color $ui-dracula-text-color
.menu-button-label
color $ui-dracula-text-color

View File

@@ -2,6 +2,7 @@ import React from 'react'
import CSSModules from 'browser/lib/CSSModules' import CSSModules from 'browser/lib/CSSModules'
import styles from './SnippetTab.styl' import styles from './SnippetTab.styl'
import context from 'browser/lib/context' import context from 'browser/lib/context'
import i18n from 'browser/lib/i18n'
class SnippetTab extends React.Component { class SnippetTab extends React.Component {
constructor (props) { constructor (props) {
@@ -28,7 +29,7 @@ class SnippetTab extends React.Component {
handleContextMenu (e) { handleContextMenu (e) {
context.popup([ context.popup([
{ {
label: 'Rename', label: i18n.__('Rename'),
click: (e) => this.handleRenameClick(e) click: (e) => this.handleRenameClick(e)
} }
]) ])
@@ -54,10 +55,10 @@ class SnippetTab extends React.Component {
this.handleRename() this.handleRename()
break break
case 27: case 27:
this.setState({ this.setState((prevState, props) => ({
name: this.props.snippet.name, name: props.snippet.name,
isRenaming: false isRenaming: false
}) }))
break break
} }
} }
@@ -85,8 +86,17 @@ class SnippetTab extends React.Component {
}) })
} }
handleDragStart (e) {
e.dataTransfer.dropEffect = 'move'
this.props.onDragStart(e)
}
handleDrop (e) {
this.props.onDrop(e)
}
render () { render () {
let { isActive, snippet, isDeletable } = this.props const { isActive, snippet, isDeletable } = this.props
return ( return (
<div styleName={isActive <div styleName={isActive
? 'root--active' ? 'root--active'
@@ -98,11 +108,14 @@ class SnippetTab extends React.Component {
onClick={(e) => this.handleClick(e)} onClick={(e) => this.handleClick(e)}
onDoubleClick={(e) => this.handleRenameClick(e)} onDoubleClick={(e) => this.handleRenameClick(e)}
onContextMenu={(e) => this.handleContextMenu(e)} onContextMenu={(e) => this.handleContextMenu(e)}
onDragStart={(e) => this.handleDragStart(e)}
onDrop={(e) => this.handleDrop(e)}
draggable='true'
> >
{snippet.name.trim().length > 0 {snippet.name.trim().length > 0
? snippet.name ? snippet.name
: <span styleName='button-unnamed'> : <span styleName='button-unnamed'>
Unnamed {i18n.__('Unnamed')}
</span> </span>
} }
</button> </button>
@@ -127,6 +140,7 @@ class SnippetTab extends React.Component {
} }
SnippetTab.propTypes = { SnippetTab.propTypes = {
} }
export default CSSModules(SnippetTab, styles) export default CSSModules(SnippetTab, styles)

View File

@@ -1,33 +1,44 @@
.root .root
position relative position relative
flex 1 flex 1
min-width 70px
overflow hidden overflow hidden
border-left 1px solid $ui-borderColor
border-top 1px solid $ui-borderColor
&:hover &:hover
background-color alpha($ui-button--active-backgroundColor, 20%)
.deleteButton .deleteButton
color $ui-inactive-text-color color: $ui-text-color
&:hover visibility visible
background-color darken($ui-backgroundColor, 15%) transition 0.15s
&:active .button
color white color: $ui-text-color
background-color $ui-active-color transition 0.15s
.root--active .root--active
@extend .root @extend .root
min-width 100px min-width 100px
border-bottom $ui-border background-color alpha($ui-button--active-backgroundColor, 60%)
.deleteButton
visibility visible
color: $ui-text-color
transition 0.15s
.button
font-weight bold
color: $ui-text-color
transition 0.15s
.button .button
width 100% width 100%
height 29px height 29px
overflow ellipsis overflow ellipsis
text-align left text-align left
padding-right 30px padding-right 23px
border none border none
background-color transparent background-color transparent
transition 0.15s transition 0.15s
border-left 4px solid transparent border-left 4px solid transparent
&:hover color $ui-inactive-text-color
background-color $ui-button--hover-backgroundColor
.deleteButton .deleteButton
position absolute position absolute
@@ -38,9 +49,10 @@
text-align center text-align center
border none border none
padding 0 padding 0
color transparent color $ui-inactive-text-color
background-color transparent background-color transparent
border-radius 2px border-radius 2px
visibility hidden
.input .input
height 29px height 29px
@@ -49,43 +61,142 @@
width 100% width 100%
outline none outline none
body[data-theme="default"], body[data-theme="white"]
.root--active
&:hover
background-color alpha($ui-button--active-backgroundColor, 60%)
body[data-theme="dark"] body[data-theme="dark"]
.root .root
color $ui-dark-text-color
border-color $ui-dark-borderColor border-color $ui-dark-borderColor
border-top 1px solid $ui-dark-borderColor
&:hover &:hover
background-color $ui-dark-button--hover-backgroundColor background-color alpha($ui-dark-button--active-backgroundColor, 20%)
transition 0.15s
.button
color $ui-dark-text-color
transition 0.15s
.deleteButton .deleteButton
color $ui-dark-inactive-text-color color $ui-dark-text-color
&:hover transition 0.15s
background-color darken($ui-dark-button--hover-backgroundColor, 15%)
&:active
color $ui-dark-text-color
background-color $ui-dark-button--active-backgroundColor
.root--active .root--active
color $ui-dark-text-color background-color $ui-dark-button--active-backgroundColor
border-color $ui-dark-borderColor border-left 1px solid $ui-dark-borderColor
&:hover border-top 1px solid $ui-dark-borderColor
background-color $ui-dark-button--hover-backgroundColor .button
.deleteButton color $ui-dark-text-color
color $ui-dark-inactive-text-color .deleteButton
&:hover color $ui-dark-text-color
background-color darken($ui-dark-button--hover-backgroundColor, 15%)
&:active
color $ui-dark-text-color
background-color $ui-dark-button--active-backgroundColor
.button .button
border none border none
color $ui-dark-text-color
background-color transparent background-color transparent
transition color background-color 0.15s transition color background-color 0.15s
border-left 4px solid transparent border-left 4px solid transparent
&:hover
color $ui-dark-text-color
background-color $ui-dark-button--hover-backgroundColor
.input .input
background-color $ui-dark-button--hover-backgroundColor background-color $ui-dark-button--active-backgroundColor
color $ui-dark-text-color color $ui-dark-text-color
transition 0.15s
body[data-theme="solarized-dark"]
.root
border-color $ui-solarized-dark-borderColor
&:hover
background-color $ui-solarized-dark-noteDetail-backgroundColor
transition 0.15s
.deleteButton
color $ui-solarized-dark-button--active-color
transition 0.15s
.button
color $ui-solarized-dark-button--active-color
transition 0.15s
.root--active
color $ui-solarized-dark-button--active-color
background-color $ui-solarized-dark-button-backgroundColor
border-color $ui-solarized-dark-borderColor
.deleteButton
color $ui-solarized-dark-button--active-color
.button
color $ui-solarized-dark-button--active-color
.button
border none
color $ui-solarized-dark-text-color
background-color transparent
transition color background-color 0.15s
border-left 4px solid transparent
.input
background-color $ui-solarized-dark-noteDetail-backgroundColor
color $ui-solarized-dark-button--active-color
transition 0.15s
body[data-theme="monokai"]
.root
border-color $ui-monokai-borderColor
&:hover
background-color $ui-monokai-noteDetail-backgroundColor
transition 0.15s
.deleteButton
color $ui-monokai-text-color
transition 0.15s
.button
color $ui-monokai-text-color
transition 0.15s
.root--active
color $ui-monokai-active-color
background-color $ui-monokai-button-backgroundColor
border-color $ui-monokai-borderColor
.deleteButton
color $ui-monokai-text-color
.button
color $ui-monokai-active-color
.button
border none
color $ui-inactive-text-color
background-color transparent
transition color background-color 0.15s
border-left 4px solid transparent
.input
background-color $ui-monokai-noteDetail-backgroundColor
color $ui-monokai-text-color
transition 0.15s
body[data-theme="dracula"]
.root
border-color $ui-dracula-borderColor
&:hover
background-color $ui-dracula-noteDetail-backgroundColor
transition 0.15s
.deleteButton
color $ui-dracula-text-color
transition 0.15s
.button
color $ui-dracula-text-color
transition 0.15s
.root--active
color $ui-dracula-text-color
background-color $ui-dracula-button-backgroundColor
border-color $ui-dracula-borderColor
.deleteButton
color $ui-dracula-text-color
.button
color $ui-dracula-active-color
.button
border none
color $ui-inactive-text-color
background-color transparent
transition color background-color 0.15s
border-left 4px solid transparent
.input
background-color $ui-dracula-noteDetail-backgroundColor
color $ui-dracula-text-color

View File

@@ -1,10 +1,23 @@
/** /**
* @fileoverview Micro component for showing storage. * @fileoverview Micro component for showing storage.
*/ */
import React, { PropTypes } from 'react' import PropTypes from 'prop-types'
import React from 'react'
import styles from './StorageItem.styl' import styles from './StorageItem.styl'
import CSSModules from 'browser/lib/CSSModules' import CSSModules from 'browser/lib/CSSModules'
import { isNumber } from 'lodash' import _ from 'lodash'
import { SortableHandle } from 'react-sortable-hoc'
const DraggableIcon = SortableHandle(({ className }) => (
<i className={`fa ${className}`} />
))
const FolderIcon = ({ className, color, isActive }) => {
const iconStyle = isActive ? 'fa-folder-open-o' : 'fa-folder-o'
return (
<i className={`fa ${iconStyle} ${className}`} style={{ color: color }} />
)
}
/** /**
* @param {boolean} isActive * @param {boolean} isActive
@@ -20,34 +33,51 @@ import { isNumber } from 'lodash'
* @return {React.Component} * @return {React.Component}
*/ */
const StorageItem = ({ const StorageItem = ({
isActive, handleButtonClick, handleContextMenu, folderName, styles,
folderColor, isFolded, noteCount, handleDrop, handleDragEnter, handleDragLeave isActive,
}) => ( handleButtonClick,
<button styleName={isActive handleContextMenu,
? 'folderList-item--active' folderName,
: 'folderList-item' folderColor,
} isFolded,
onClick={handleButtonClick} noteCount,
onContextMenu={handleContextMenu} handleDrop,
onDrop={handleDrop} handleDragEnter,
onDragEnter={handleDragEnter} handleDragLeave
onDragLeave={handleDragLeave} }) => {
> return (
<span styleName={isFolded <button
? 'folderList-item-name--folded' : 'folderList-item-name' styleName={isActive ? 'folderList-item--active' : 'folderList-item'}
}> onClick={handleButtonClick}
<text style={{color: folderColor, paddingRight: '10px'}}>{isActive ? <i className='fa fa-folder-open-o' /> : <i className='fa fa-folder-o' />}</text>{isFolded ? folderName.substring(0, 1) : folderName} onContextMenu={handleContextMenu}
</span> onDrop={handleDrop}
{(!isFolded && isNumber(noteCount)) && onDragEnter={handleDragEnter}
<span styleName='folderList-item-noteCount'>{noteCount}</span> onDragLeave={handleDragLeave}
} >
{isFolded && {!isFolded &&
<span styleName='folderList-item-tooltip'> <DraggableIcon className={styles['folderList-item-reorder']} />}
{folderName} <span
styleName={
isFolded ? 'folderList-item-name--folded' : 'folderList-item-name'
}
>
<FolderIcon
styleName='folderList-item-icon'
color={folderColor}
isActive={isActive}
/>
{isFolded
? _.truncate(folderName, { length: 1, omission: '' })
: folderName}
</span> </span>
} {!isFolded &&
</button> _.isNumber(noteCount) &&
) <span styleName='folderList-item-noteCount'>{noteCount}</span>}
{isFolded &&
<span styleName='folderList-item-tooltip'>{folderName}</span>}
</button>
)
}
StorageItem.propTypes = { StorageItem.propTypes = {
isActive: PropTypes.bool.isRequired, isActive: PropTypes.bool.isRequired,

View File

@@ -13,6 +13,7 @@
border none border none
overflow ellipsis overflow ellipsis
font-size 14px font-size 14px
align-items: center
&:first-child &:first-child
margin-top 0 margin-top 0
&:hover &:hover
@@ -22,7 +23,7 @@
&:active &:active
color $$ui-button-default-color color $$ui-button-default-color
background-color alpha($ui-button-default--active-backgroundColor, 20%) background-color alpha($ui-button-default--active-backgroundColor, 20%)
.folderList-item--active .folderList-item--active
@extend .folderList-item @extend .folderList-item
color #1EC38B color #1EC38B
@@ -34,9 +35,7 @@
.folderList-item-name .folderList-item-name
display block display block
flex 1 flex 1
padding 0 12px padding-right: 10px
height 26px
line-height 26px
border-width 0 0 0 2px border-width 0 0 0 2px
border-style solid border-style solid
border-color transparent border-color transparent
@@ -59,8 +58,8 @@
opacity 0 opacity 0
border-top-right-radius 2px border-top-right-radius 2px
border-bottom-right-radius 2px border-bottom-right-radius 2px
height 26px height 34px
line-height 26px line-height 32px
.folderList-item:hover, .folderList-item--active:hover .folderList-item:hover, .folderList-item--active:hover
.folderList-item-tooltip .folderList-item-tooltip
@@ -68,9 +67,20 @@
.folderList-item-name--folded .folderList-item-name--folded
@extend .folderList-item-name @extend .folderList-item-name
padding-left 17px padding-left 7px
text .folderList-item-icon
display none font-size 9px
.folderList-item-icon
padding-right: 10px
.folderList-item-reorder
font-size: 9px
padding: 10px 8px 10px 9px;
color: rgba(147, 147, 149, 0.3)
cursor: ns-resize
&:before
content: "\f142 \f142"
body[data-theme="white"] body[data-theme="white"]
.folderList-item .folderList-item
@@ -108,4 +118,61 @@ body[data-theme="dark"]
background-color alpha($ui-dark-button--active-backgroundColor, 50%) background-color alpha($ui-dark-button--active-backgroundColor, 50%)
&:hover &:hover
color $ui-dark-text-color color $ui-dark-text-color
background-color alpha($ui-dark-button--active-backgroundColor, 50%) background-color alpha($ui-dark-button--active-backgroundColor, 50%)
body[data-theme="solarized-dark"]
.folderList-item
&:hover
background-color $ui-solarized-dark-button-backgroundColor
color $ui-solarized-dark-text-color
&:active
color $ui-solarized-dark-text-color
background-color $ui-solarized-dark-button-backgroundColor
.folderList-item--active
@extend .folderList-item
color $ui-solarized-dark-text-color
background-color $ui-solarized-dark-button-backgroundColor
&:active
background-color $ui-solarized-dark-button-backgroundColor
&:hover
color $ui-solarized-dark-text-color
background-color $ui-solarized-dark-button-backgroundColor
body[data-theme="monokai"]
.folderList-item
&:hover
background-color $ui-monokai-button-backgroundColor
color $ui-monokai-text-color
&:active
color $ui-monokai-text-color
background-color $ui-monokai-button-backgroundColor
.folderList-item--active
@extend .folderList-item
color $ui-monokai-text-color
background-color $ui-monokai-button-backgroundColor
&:active
background-color $ui-monokai-button-backgroundColor
&:hover
color $ui-monokai-text-color
background-color $ui-monokai-button-backgroundColor
body[data-theme="dracula"]
.folderList-item
&:hover
background-color $ui-dracula-button-backgroundColor
color $ui-dracula-text-color
&:active
color $ui-dracula-text-color
background-color $ui-dracula-button-backgroundColor
.folderList-item--active
@extend .folderList-item
color $ui-dracula-text-color
background-color $ui-dracula-button-backgroundColor
&:active
background-color $ui-dracula-button-backgroundColor
&:hover
color $ui-dracula-text-color
background-color $ui-dracula-button-backgroundColor

View File

@@ -1,23 +1,24 @@
/** /**
* @fileoverview Micro component for showing StorageList * @fileoverview Micro component for showing StorageList
*/ */
import React, { PropTypes } from 'react' import PropTypes from 'prop-types'
import React from 'react'
import styles from './StorageList.styl' import styles from './StorageList.styl'
import CSSModules from 'browser/lib/CSSModules' import CSSModules from 'browser/lib/CSSModules'
/** /**
* @param {Array} storgaeList * @param {Array} storageList
*/ */
const StorageList = ({storageList}) => ( const StorageList = ({storageList, isFolded}) => (
<div styleName='storageList'> <div styleName={isFolded ? 'storageList-folded' : 'storageList'}>
{storageList.length > 0 ? storageList : ( {storageList.length > 0 ? storageList : (
<div styleName='storgaeList-empty'>No storage mount.</div> <div styleName='storageList-empty'>No storage mount.</div>
)} )}
</div> </div>
) )
StorageList.propTypes = { StorageList.propTypes = {
storgaeList: PropTypes.arrayOf(PropTypes.element).isRequired storageList: PropTypes.arrayOf(PropTypes.element).isRequired
} }
export default CSSModules(StorageList, styles) export default CSSModules(StorageList, styles)

View File

@@ -4,6 +4,10 @@
top 180px top 180px
overflow-y auto overflow-y auto
.storageList-folded
@extend .storageList
width 44px
.storageList-empty .storageList-empty
padding 0 10px padding 0 10px
margin-top 15px margin-top 15px

View File

@@ -1,27 +1,42 @@
/** /**
* @fileoverview Micro component for showing TagList. * @fileoverview Micro component for showing TagList.
*/ */
import React, { PropTypes } from 'react' import PropTypes from 'prop-types'
import React from 'react'
import styles from './TagListItem.styl' import styles from './TagListItem.styl'
import CSSModules from 'browser/lib/CSSModules' import CSSModules from 'browser/lib/CSSModules'
/** /**
* @param {string} name * @param {string} name
* @param {Function} handleClickTagListItem * @param {Function} handleClickTagListItem
* @param {bool} isActive * @param {Function} handleClickNarrowToTag
* @param {boolean} isActive
* @param {boolean} isRelated
* @param {string} bgColor tab backgroundColor
*/ */
const TagListItem = ({name, handleClickTagListItem, isActive}) => ( const TagListItem = ({name, handleClickTagListItem, handleClickNarrowToTag, handleContextMenu, isActive, isRelated, count, color}) => (
<button styleName={isActive ? 'tagList-item-active' : 'tagList-item'} onClick={() => handleClickTagListItem(name)}> <div styleName='tagList-itemContainer' onContextMenu={e => handleContextMenu(e, name)}>
<span styleName='tagList-item-name'> {isRelated
{`# ${name}`} ? <button styleName={isActive ? 'tagList-itemNarrow-active' : 'tagList-itemNarrow'} onClick={() => handleClickNarrowToTag(name)}>
</span> <i className={isActive ? 'fa fa-minus-circle' : 'fa fa-plus-circle'} />
</button> </button>
: <div styleName={isActive ? 'tagList-itemNarrow-active' : 'tagList-itemNarrow'} />
}
<button styleName={isActive ? 'tagList-item-active' : 'tagList-item'} onClick={() => handleClickTagListItem(name)}>
<span styleName='tagList-item-color' style={{backgroundColor: color || 'transparent'}} />
<span styleName='tagList-item-name'>
{`# ${name}`}
<span styleName='tagList-item-count'>{count !== 0 ? count : ''}</span>
</span>
</button>
</div>
) )
TagListItem.propTypes = { TagListItem.propTypes = {
name: PropTypes.string.isRequired, name: PropTypes.string.isRequired,
handleClickTagListItem: PropTypes.func.isRequired handleClickTagListItem: PropTypes.func.isRequired,
color: PropTypes.string
} }
export default CSSModules(TagListItem, styles) export default CSSModules(TagListItem, styles)

View File

@@ -1,5 +1,9 @@
.tagList-itemContainer
display flex
.tagList-item .tagList-item
display flex display flex
flex 1
width 100% width 100%
height 26px height 26px
background-color transparent background-color transparent
@@ -20,9 +24,16 @@
color $ui-button-default-color color $ui-button-default-color
background-color $ui-button-default--active-backgroundColor background-color $ui-button-default--active-backgroundColor
.tagList-itemNarrow
composes tagList-item
flex none
width 20px
padding 0 4px
.tagList-item-active .tagList-item-active
background-color $ui-button-default--active-backgroundColor background-color $ui-button-default--active-backgroundColor
display flex display flex
flex 1
width 100% width 100%
height 26px height 26px
padding 0 padding 0
@@ -36,10 +47,16 @@
background-color alpha($ui-button-default--active-backgroundColor, 60%) background-color alpha($ui-button-default--active-backgroundColor, 60%)
transition 0.2s transition 0.2s
.tagList-itemNarrow-active
composes tagList-item-active
flex none
width 20px
padding 0 4px
.tagList-item-name .tagList-item-name
display block display block
flex 1 flex 1
padding 0 15px padding 0 8px 0 4px
height 26px height 26px
line-height 26px line-height 26px
border-width 0 0 0 2px border-width 0 0 0 2px
@@ -48,6 +65,17 @@
overflow hidden overflow hidden
text-overflow ellipsis text-overflow ellipsis
.tagList-item-count
float right
line-height 26px
padding-right 15px
font-size 13px
.tagList-item-color
height 26px
width 3px
display inline-block
body[data-theme="white"] body[data-theme="white"]
.tagList-item .tagList-item
color $ui-inactive-text-color color $ui-inactive-text-color
@@ -63,6 +91,8 @@ body[data-theme="white"]
color $ui-text-color color $ui-text-color
&:hover &:hover
background-color alpha($ui-button--active-backgroundColor, 60%) background-color alpha($ui-button--active-backgroundColor, 60%)
.tagList-item-count
color $ui-text-color
body[data-theme="dark"] body[data-theme="dark"]
.tagList-item .tagList-item
@@ -81,4 +111,6 @@ body[data-theme="dark"]
background-color alpha($ui-dark-button--active-backgroundColor, 50%) background-color alpha($ui-dark-button--active-backgroundColor, 50%)
&:hover &:hover
color $ui-dark-text-color color $ui-dark-text-color
background-color alpha($ui-dark-button--active-backgroundColor, 50%) background-color alpha($ui-dark-button--active-backgroundColor, 50%)
.tagList-item-count
color $ui-dark-button--active-color

View File

@@ -2,7 +2,8 @@
* @fileoverview Percentage of todo achievement. * @fileoverview Percentage of todo achievement.
*/ */
import React, { PropTypes } from 'react' import PropTypes from 'prop-types'
import React from 'react'
import CSSModules from 'browser/lib/CSSModules' import CSSModules from 'browser/lib/CSSModules'
import styles from './TodoListPercentage.styl' import styles from './TodoListPercentage.styl'
@@ -11,17 +12,23 @@ import styles from './TodoListPercentage.styl'
*/ */
const TodoListPercentage = ({ const TodoListPercentage = ({
percentageOfTodo percentageOfTodo, onClearCheckboxClick
}) => ( }) => (
<div styleName='percentageBar' style={{display: isNaN(percentageOfTodo) ? 'none' : ''}}> <div styleName='percentageBar' style={{display: isNaN(percentageOfTodo) ? 'none' : ''}}>
<div styleName='progressBar' style={{width: `${percentageOfTodo}%`}}> <div styleName='progressBar' style={{width: `${percentageOfTodo}%`}}>
<p styleName='percentageText'>{percentageOfTodo}%</p> <div styleName='progressBarInner'>
<p styleName='percentageText'>{percentageOfTodo}%</p>
</div>
</div>
<div styleName='todoClear'>
<p styleName='todoClearText' onClick={(e) => onClearCheckboxClick(e)}>clear</p>
</div> </div>
</div> </div>
) )
TodoListPercentage.propTypes = { TodoListPercentage.propTypes = {
percentageOfTodo: PropTypes.number.isRequired percentageOfTodo: PropTypes.number.isRequired,
onClearCheckboxClick: PropTypes.func.isRequired
} }
export default CSSModules(TodoListPercentage, styles) export default CSSModules(TodoListPercentage, styles)

View File

@@ -1,6 +1,7 @@
.percentageBar .percentageBar
display: flex
position absolute position absolute
top 50px top 72px
right 0px right 0px
left 0px left 0px
background-color #DADFE1 background-color #DADFE1
@@ -16,17 +17,79 @@
border-radius 2px border-radius 2px
transition 0.4s cubic-bezier(0.4, 0.4, 0, 1) transition 0.4s cubic-bezier(0.4, 0.4, 0, 1)
.progressBarInner
padding 0 10px
min-width 1px
height 100%
display -webkit-box
display box
justify-content center
align-items center
.percentageText .percentageText
color #f4f4f4 color #f4f4f4
padding: 2px 43%
font-weight 600 font-weight 600
.todoClear
display flex
justify-content: flex-end
position absolute
z-index 120
width 100%
height 100%
padding 2px 10px
.todoClearText
color #f4f4f4
cursor pointer
font-weight 500
body[data-theme="dark"] body[data-theme="dark"]
.percentageBar .percentageBar
background-color #363A3D background-color #444444
.progressBar .progressBar
background-color: alpha(#939395, 50%) background-color: #1EC38B
.percentageText .percentageText
color $ui-dark-text-color color $ui-dark-text-color
.todoClearText
color $ui-dark-text-color
body[data-theme="solarized-dark"]
.percentageBar
background-color #002b36
.progressBar
background-color: #2aa198
.percentageText
color #fdf6e3
.todoClearText
color #fdf6e3
body[data-theme="monokai"]
.percentageBar
background-color: $ui-monokai-borderColor
.progressBar
background-color $ui-monokai-active-color
.percentageText
color $ui-monokai-text-color
body[data-theme="dracula"]
.percentageBar
background-color $ui-dracula-borderColor
.progressBar
background-color: $ui-dracula-active-color
.percentageText
color $ui-dracula-text-color
.percentageText
color $ui-dracula-text-color

View File

@@ -2,7 +2,8 @@
* @fileoverview Percentage of todo achievement. * @fileoverview Percentage of todo achievement.
*/ */
import React, { PropTypes } from 'react' import PropTypes from 'prop-types'
import React from 'react'
import CSSModules from 'browser/lib/CSSModules' import CSSModules from 'browser/lib/CSSModules'
import styles from './TodoProcess.styl' import styles from './TodoProcess.styl'

View File

@@ -55,11 +55,14 @@ body
line-height 1.6 line-height 1.6
overflow-x hidden overflow-x hidden
background-color $ui-noteDetail-backgroundColor background-color $ui-noteDetail-backgroundColor
.katex // do not allow display line breaks
font 400 1.2em 'KaTeX_Main' .katex-display > .katex
line-height 1.2em
white-space nowrap white-space nowrap
text-indent 0 // allow inline line breaks
.katex
white-space initial
.katex .katex-html
display inline-flex
.katex .mfrac>.vlist>span:nth-child(2) .katex .mfrac>.vlist>span:nth-child(2)
top 0 !important top 0 !important
.katex-error .katex-error
@@ -68,7 +71,7 @@ body
padding 5px padding 5px
margin -5px margin -5px
border-radius 5px border-radius 5px
.flowchart-error, .sequence-error .flowchart-error, .sequence-error .chart-error
background-color errorBackgroundColor background-color errorBackgroundColor
color errorTextColor color errorTextColor
padding 5px padding 5px
@@ -76,7 +79,13 @@ body
justify-content left justify-content left
li li
label.taskListItem label.taskListItem
margin-left -2em margin-left -1.8em
&.checked
text-decoration line-through
opacity 0.5
&.taskListItem.checked
text-decoration line-through
opacity 0.5
div.math-rendered div.math-rendered
text-align center text-align center
.math-failed .math-failed
@@ -102,7 +111,6 @@ a
border-radius 5px border-radius 5px
margin -5px margin -5px
transition .1s transition .1s
display inline-block
img img
vertical-align sub vertical-align sub
&:hover &:hover
@@ -117,6 +125,7 @@ hr
margin 15px 0 margin 15px 0
h1, h2, h3, h4, h5, h6 h1, h2, h3, h4, h5, h6
font-weight bold font-weight bold
word-wrap break-word
h1 h1
font-size 2.55em font-size 2.55em
padding-bottom 0.3em padding-bottom 0.3em
@@ -154,7 +163,9 @@ p
line-height 1.6em line-height 1.6em
margin 0 0 1em margin 0 0 1em
white-space pre-line white-space pre-line
word-wrap break-word
img img
cursor zoom-in
max-width 100% max-width 100%
strong, b strong, b
font-weight bold font-weight bold
@@ -174,6 +185,12 @@ ul
margin-bottom 1em margin-bottom 1em
li li
display list-item display list-item
&.taskListItem
list-style none
&>input
margin-left -1.6em
&>p
margin-left -1.8em
p p
margin 0 margin 0
&>li>ul, &>li>ol &>li>ul, &>li>ol
@@ -193,7 +210,6 @@ ol
&>li>ul, &>li>ol &>li>ul, &>li>ol
margin 0 margin 0
code code
color #CC305F
padding 0.2em 0.4em padding 0.2em 0.4em
background-color #f7f7f7 background-color #f7f7f7
border-radius 3px border-radius 3px
@@ -201,33 +217,39 @@ code
text-decoration none text-decoration none
margin-right 2px margin-right 2px
pre pre
padding 0.5em !important padding 0.5rem !important
border solid 1px #D1D1D1 border solid 1px #D1D1D1
border-radius 5px border-radius 5px
overflow-x auto overflow-x auto
margin 0 0 1em margin 0 0 1rem
display flex display flex
line-height 1.4em line-height 1.4em
&.flowchart, &.sequence
display flex
justify-content center
background-color white
&.CodeMirror
height initial
&>code
flex 1
overflow-x auto
code code
background-color inherit background-color inherit
margin 0 margin 0
padding 0 padding 0
border none border none
border-radius 0 border-radius 0
&.CodeMirror
height initial
flex-wrap wrap
&>code
flex 1
overflow-x auto
&.mermaid svg
max-width 100% !important
&>span.filename
margin -0.5rem 100% 0.5rem -0.5rem
padding 0.125rem 0.375rem
background-color #777;
color white
&:empty
display none
&>span.lineNumber &>span.lineNumber
display none display none
font-size 1em font-size 1em
padding 0.5em 0 padding 0.5rem 0
margin -0.5em 0.5em -0.5em -0.5em margin -0.5rem 0.5rem -0.5rem -0.5rem
border-right 1px solid border-right 1px solid
text-align right text-align right
border-top-left-radius 4px border-top-left-radius 4px
@@ -244,6 +266,7 @@ table
display block display block
width 100% width 100%
margin 0 0 1em margin 0 0 1em
overflow-x auto
thead thead
tr tr
background-color tableHeadBgColor background-color tableHeadBgColor
@@ -280,6 +303,147 @@ kbd
line-height 1 line-height 1
padding 3px 5px padding 3px 5px
$admonition
box-shadow 0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2)
position relative
margin 1.5625em 0
padding 0 1.2rem
border-left .4rem solid #448aff
border-radius .2rem
overflow auto
html .admonition>:last-child
margin-bottom 1.2rem
.admonition .admonition
margin 1em 0
.admonition p
margin-top: 0.5em
$admonition-icon
position absolute
left 1.2rem
font-family: "Material Icons"
font-weight: normal;
font-style: normal;
font-size: 24px
display: inline-block;
line-height: 1;
text-transform: none;
letter-spacing: normal;
word-wrap: normal;
white-space: nowrap;
direction: ltr;
/* Support for all WebKit browsers. */
-webkit-font-smoothing: antialiased;
/* Support for Safari and Chrome. */
text-rendering: optimizeLegibility;
/* Support for Firefox. */
-moz-osx-font-smoothing: grayscale;
/* Support for IE. */
font-feature-settings: 'liga';
$admonition-title
margin 0 -1.2rem
padding .8rem 1.2rem .8rem 4rem
border-bottom .1rem solid rgba(68,138,255,.1)
background-color rgba(68,138,255,.1)
font-weight 700
.admonition>.admonition-title:last-child
margin-bottom 0
admonition_types = {
note: {color: #0288D1, icon: "note"},
hint: {color: #009688, icon: "info_outline"},
danger: {color: #c2185b, icon: "block"},
caution: {color: #ffa726, icon: "warning"},
error: {color: #d32f2f, icon: "error_outline"},
attention: {color: #455a64, icon: "priority_high"}
}
for name, val in admonition_types
.admonition.{name}
@extend $admonition
border-left-color: val[color]
.admonition.{name}>.admonition-title
@extend $admonition-title
border-bottom-color: .1rem solid rgba(val[color], 0.2)
background-color: rgba(val[color], 0.2)
.admonition.{name}>.admonition-title:before
@extend $admonition-icon
color: val[color]
content: val[icon]
dl
margin 2rem 0
padding 0
display flex
width 100%
flex-wrap wrap
align-items flex-start
border-bottom 1px solid borderColor
background-color tableHeadBgColor
dt
border-top 1px solid borderColor
font-weight bold
text-align right
overflow hidden
flex-basis 20%
padding 0.4rem 0.9rem
box-sizing border-box
dd
border-top 1px solid borderColor
flex-basis 80%
padding 0.4rem 0.9rem
min-height 2.5rem
background-color $ui-noteDetail-backgroundColor
box-sizing border-box
dd + dd
margin-left 20%
pre.fence
flex-wrap wrap
.chart, .flowchart, .mermaid, .sequence
display flex
justify-content center
background-color white
max-width 100%
flex-grow 1
canvas, svg
max-width 100% !important
.gallery
width 100%
height 50vh
.carousel
.carousel-main img
min-width auto
max-width 100%
min-height auto
max-height 100%
.carousel-footer::-webkit-scrollbar-corner
background-color transparent
.carousel-main, .carousel-footer
background-color $ui-noteDetail-backgroundColor
.prev, .next
color $ui-text-color
background-color $ui-tag-backgroundColor
themeDarkBackground = darken(#21252B, 10%) themeDarkBackground = darken(#21252B, 10%)
themeDarkText = #f9f9f9 themeDarkText = #f9f9f9
themeDarkBorder = lighten(themeDarkBackground, 20%) themeDarkBorder = lighten(themeDarkBackground, 20%)
@@ -329,4 +493,155 @@ body[data-theme="dark"]
border-right solid 1px themeDarkTableBorder border-right solid 1px themeDarkTableBorder
kbd kbd
background-color themeDarkBorder background-color themeDarkBorder
color themeDarkText color themeDarkText
dl
border-color themeDarkBorder
background-color themeDarkTableHead
dt
border-color themeDarkBorder
dd
border-color themeDarkBorder
background-color themeDarkPreview
pre.fence
.gallery
.carousel-main, .carousel-footer
background-color $ui-dark-noteDetail-backgroundColor
.prev, .next
color $ui-dark-text-color
background-color $ui-dark-tag-backgroundColor
themeSolarizedDarkTableOdd = $ui-solarized-dark-noteDetail-backgroundColor
themeSolarizedDarkTableEven = darken($ui-solarized-dark-noteDetail-backgroundColor, 10%)
themeSolarizedDarkTableHead = themeSolarizedDarkTableEven
themeSolarizedDarkTableBorder = themeDarkBorder
body[data-theme="solarized-dark"]
color $ui-solarized-dark-text-color
border-color themeDarkBorder
background-color $ui-solarized-dark-noteDetail-backgroundColor
table
thead
tr
background-color themeSolarizedDarkTableHead
th
border-color themeSolarizedDarkTableBorder
&:last-child
border-right solid 1px themeSolarizedDarkTableBorder
tbody
tr:nth-child(2n + 1)
background-color themeSolarizedDarkTableOdd
tr:nth-child(2n)
background-color themeSolarizedDarkTableEven
td
border-color themeSolarizedDarkTableBorder
&:last-child
border-right solid 1px themeSolarizedDarkTableBorder
dl
border-color themeDarkBorder
background-color themeSolarizedDarkTableHead
dt
border-color themeDarkBorder
dd
border-color themeDarkBorder
background-color $ui-solarized-dark-noteDetail-backgroundColor
pre.fence
.gallery
.carousel-main, .carousel-footer
background-color $ui-solarized-dark-noteDetail-backgroundColor
.prev, .next
color $ui-solarized-dark-button--active-color
background-color $ui-solarized-dark-button-backgroundColor
themeMonokaiTableOdd = $ui-monokai-noteDetail-backgroundColor
themeMonokaiTableEven = darken($ui-monokai-noteDetail-backgroundColor, 10%)
themeMonokaiTableHead = themeMonokaiTableEven
themeMonokaiTableBorder = themeDarkBorder
body[data-theme="monokai"]
color $ui-monokai-text-color
border-color themeDarkBorder
background-color $ui-monokai-noteDetail-backgroundColor
table
thead
tr
background-color themeMonokaiTableHead
th
border-color themeMonokaiTableBorder
&:last-child
border-right solid 1px themeMonokaiTableBorder
tbody
tr:nth-child(2n + 1)
background-color themeMonokaiTableOdd
tr:nth-child(2n)
background-color themeMonokaiTableEven
td
border-color themeMonokaiTableBorder
&:last-child
border-right solid 1px themeMonokaiTableBorder
kbd
background-color themeDarkBackground
dl
border-color themeDarkBorder
background-color themeMonokaiTableHead
dt
border-color themeDarkBorder
dd
border-color themeDarkBorder
background-color $ui-monokai-noteDetail-backgroundColor
pre.fence
.gallery
.carousel-main, .carousel-footer
background-color $ui-monokai-noteDetail-backgroundColor
.prev, .next
color $ui-monokai-button--active-color
background-color $ui-monokai-button-backgroundColor
themeDraculaTableOdd = $ui-dracula-noteDetail-backgroundColor
themeDraculaTableEven = darken($ui-dracula-noteDetail-backgroundColor, 10%)
themeDraculaTableHead = themeDraculaTableEven
themeDraculaTableBorder = themeDarkBorder
body[data-theme="dracula"]
color $ui-dracula-text-color
border-color themeDarkBorder
background-color $ui-dracula-noteDetail-backgroundColor
table
thead
tr
background-color themeDraculaTableHead
th
border-color themeDraculaTableBorder
&:last-child
border-right solid 1px themeDraculaTableBorder
tbody
tr:nth-child(2n + 1)
background-color themeDraculaTableOdd
tr:nth-child(2n)
background-color themeDraculaTableEven
td
border-color themeDraculaTableBorder
&:last-child
border-right solid 1px themeDraculaTableBorder
kbd
background-color themeDarkBackground
dl
border-color themeDarkBorder
background-color themeDraculaTableHead
dt
border-color themeDarkBorder
dd
border-color themeDarkBorder
background-color $ui-dracula-noteDetail-backgroundColor
pre.fence
.gallery
.carousel-main, .carousel-footer
background-color $ui-dracula-noteDetail-backgroundColor
.prev, .next
color $ui-dracula-button--active-color
background-color $ui-dracula-button-backgroundColor

View File

@@ -0,0 +1,43 @@
import mermaidAPI from 'mermaid'
// fixes bad styling in the mermaid dark theme
const darkThemeStyling = `
.loopText tspan {
fill: white;
}`
function getRandomInt (min, max) {
return Math.floor(Math.random() * (max - min)) + min
}
function getId () {
const pool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
let id = 'm-'
for (let i = 0; i < 7; i++) {
id += pool[getRandomInt(0, 16)]
}
return id
}
function render (element, content, theme) {
try {
const height = element.attributes.getNamedItem('data-height')
if (height && height.value !== 'undefined') {
element.style.height = height.value + 'vh'
}
const isDarkTheme = theme === 'dark' || theme === 'solarized-dark' || theme === 'monokai' || theme === 'dracula'
mermaidAPI.initialize({
theme: isDarkTheme ? 'dark' : 'default',
themeCSS: isDarkTheme ? darkThemeStyling : '',
useMaxWidth: false
})
mermaidAPI.render(getId(), content, (svgGraph) => {
element.innerHTML = svgGraph
})
} catch (e) {
element.className = 'mermaid-error'
element.innerHTML = 'mermaid diagram parse error: ' + e.message
}
}
export default render

View File

@@ -1,118 +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

View File

@@ -1,209 +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 { 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 () {
let { 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 () {
let { note } = this.props
if (note.type === 'SNIPPET_NOTE' && note.snippets.length > 1) {
this.setState({
snippetIndex: (this.state.snippetIndex + 1) % note.snippets.length
})
}
}
saveToClipboard () {
let { 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 () {
let { note, config } = this.props
if (note == null) {
return (
<div styleName='root' />
)
}
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') {
let tabList = note.snippets.map((snippet, index) => {
let isActive = this.state.snippetIndex === index
return <div styleName={isActive
? 'tabList-item--active'
: 'tabList-item'
}
key={index}
>
<button styleName='tabList-item-button'
onClick={(e) => this.handleTabButtonClick(e, index)}
>
{snippet.name.trim().length > 0
? snippet.name
: <span styleName='tabList-item-unnamed'>
Unnamed
</span>
}
</button>
</div>
})
let viewList = note.snippets.map((snippet, index) => {
let isActive = this.state.snippetIndex === index
let syntax = CodeMirror.findModeByName(pass(snippet.mode))
if (syntax == null) syntax = CodeMirror.findModeByName('Plain Text')
return <div styleName='tabView'
key={index}
style={{zIndex: isActive ? 5 : 4}}
>
{snippet.mode === 'markdown'
? <MarkdownEditor styleName='tabView-content'
config={config}
value={snippet.content}
ref={'code-' + index}
storageKey={note.storage}
/>
: <CodeEditor styleName='tabView-content'
mode={snippet.mode}
value={snippet.content}
theme={config.editor.theme}
fontFamily={config.editor.fontFamily}
fontSize={editorFontSize}
indentType={config.editor.indentType}
indentSize={editorIndentSize}
keyMap={config.editor.keyMap}
readOnly
ref={'code-' + index}
/>
}
</div>
})
return (
<div styleName='root'>
<div styleName='description'>
<textarea styleName='description-textarea'
style={{
fontFamily: config.preview.fontFamily,
fontSize: parseInt(config.preview.fontSize, 10)
}}
ref='description'
placeholder='Description...'
value={note.description}
readOnly
/>
</div>
<div styleName='tabList'>
{tabList}
</div>
{viewList}
</div>
)
}
return (
<MarkdownPreview styleName='root'
theme={config.ui.theme}
fontSize={config.preview.fontSize}
fontFamily={config.preview.fontFamily}
codeBlockTheme={config.preview.codeBlockTheme}
codeBlockFontFamily={config.editor.fontFamily}
lineNumber={config.preview.lineNumber}
indentSize={editorIndentSize}
value={note.content}
showCopyNotification={config.ui.showCopyNotification}
storagePath={storage.path}
/>
)
}
}
NoteDetail.propTypes = {
}
export default CSSModules(NoteDetail, styles)

View File

@@ -1,98 +0,0 @@
@import('../main/Detail/DetailVars.styl')
.root
absolute top bottom left right
bottom 30px
left $note-detail-left-margin
right $note-detail-right-margin
height 100%
width 365px
background-color $ui-noteDetail-backgroundColor
.description
absolute top left right
height 80px
box-sizing border-box
.description-textarea
display block
height 100%
width 100%
resize none
border none
padding 10px
line-height 1.6
box-sizing border-box
background-color $ui-noteDetail-backgroundColor
.tabList
absolute left right
top 80px
box-sizing border-box
height 30px
display flex
background-color $ui-noteDetail-backgroundColor
.tabList-item
position relative
flex 1
overflow hidden
&:hover
background-color $ui-button--hover-backgroundColorg
.tabList-item--active
@extend .tabList-item
border-bottom $ui-border
.tabList-item-button
width 100%
height 29px
overflow ellipsis
text-align left
padding-right 30px
padding-left 10px
border none
background-color transparent
transition 0.15s
&:hover
background-color $ui-button--hover-backgroundColor
.tabView
absolute left right bottom
top 130px
.tabView-content
absolute top left right bottom
box-sizing border-box
height 100%
width 100%
body[data-theme="dark"]
.root
background-color $ui-dark-noteDetail-backgroundColor
.description
border-color $ui-dark-borderColor
background-color $ui-dark-noteDetail-backgroundColor
.description-textarea
background-color $ui-dark-noteDetail-backgroundColor
color white
.tabList
background-color $ui-dark-noteDetail-backgroundColor
.tabList-item
border-color $ui-dark-borderColor
&:hover
background-color $ui-dark-button--hover-backgroundColor
.tabList-item-button
border none
color $ui-dark-text-color
background-color transparent
transition color background-color 0.15s
border-left 4px solid transparent
&:hover
color white
background-color $ui-dark-button--hover-backgroundColor

View File

@@ -1,90 +0,0 @@
import React from 'react'
import NoteItem from 'browser/components/NoteItem'
import moment from 'moment'
class NoteList extends React.Component {
constructor (props) {
super(props)
this.state = {
range: 0
}
}
componentWillReceiveProps (nextProps) {
if (this.props.search !== nextProps.search) {
this.resetScroll()
}
}
componentDidUpdate () {
let { index } = this.props
if (index > -1) {
let list = this.refs.root
let item = list.childNodes[index]
if (item == null) return null
let overflowBelow = item.offsetTop + item.clientHeight - list.clientHeight - list.scrollTop > 0
if (overflowBelow) {
list.scrollTop = item.offsetTop + item.clientHeight - list.clientHeight
}
let overflowAbove = list.scrollTop > item.offsetTop
if (overflowAbove) {
list.scrollTop = item.offsetTop
}
}
}
resetScroll () {
this.refs.root.scrollTop = 0
this.setState({
range: 0
})
}
handleScroll (e) {
let { notes } = this.props
if (e.target.offsetHeight + e.target.scrollTop > e.target.scrollHeight - 100 && notes.length > this.state.range * 10 + 10) {
this.setState({
range: this.state.range + 1
})
}
}
render () {
let { notes, index } = this.props
let notesList = notes
.slice(0, 10 + 10 * this.state.range)
.map((note, _index) => {
const isActive = (index === _index)
const key = `${note.storage}-${note.key}`
const dateDisplay = moment(note.updatedAt).fromNow()
return (
<NoteItem
isActive={isActive}
note={note}
dateDisplay={dateDisplay}
key={key}
handleNoteClick={(e) => this.props.handleNoteClick(e, _index)}
/>
)
})
return (
<div className={this.props.className}
onScroll={(e) => this.handleScroll(e)}
ref='root'
>
{notesList}
</div>
)
}
}
NoteList.propTypes = {
}
export default NoteList

View File

@@ -1,77 +0,0 @@
import React from 'react'
import CSSModules from 'browser/lib/CSSModules'
import styles from './StorageSection.styl'
import StorageItem from 'browser/components/StorageItem'
class StorageSection extends React.Component {
constructor (props) {
super(props)
this.state = {
isOpen: true
}
}
handleToggleButtonClick (e) {
this.setState({
isOpen: !this.state.isOpen
})
}
handleHeaderClick (e) {
let { storage } = this.props
this.props.handleStorageButtonClick(e, storage.key)
}
handleFolderClick (e, folder) {
let { storage } = this.props
this.props.handleFolderButtonClick(e, storage.key, folder.key)
}
render () {
let { storage, filter } = this.props
let folderList = storage.folders
.map(folder => (
<StorageItem
key={folder.key}
isActive={filter.type === 'FOLDER' && filter.folder === folder.key && filter.storage === storage.key}
handleButtonClick={(e) => this.handleFolderClick(e, folder)}
folderName={folder.name}
folderColor={folder.color}
isFolded={false}
/>
))
return (
<div styleName='root'>
<div styleName='header'>
<button styleName='header-toggleButton'
onClick={(e) => this.handleToggleButtonClick(e)}
>
<i className={this.state.isOpen
? 'fa fa-caret-down'
: 'fa fa-caret-right'
}
/>
</button>
<button styleName={filter.type === 'STORAGE' && filter.storage === storage.key
? 'header-name--active'
: 'header-name'
}
onClick={(e) => this.handleHeaderClick(e)}
>{storage.name}</button>
</div>
{this.state.isOpen &&
<div styleName='folderList'>
{folderList}
</div>
}
</div>
)
}
}
StorageSection.propTypes = {
}
export default CSSModules(StorageSection, styles)

View File

@@ -1,85 +0,0 @@
.root
position relative
.header
height 26px
.header-toggleButton
absolute top left
width 25px
height 26px
navButtonColor()
border none
outline none
.header-name
display block
height 26px
navButtonColor()
padding 0 10px 0 25px
font-size 14px
width 100%
text-align left
line-height 26px
box-sizing border-box
cursor pointer
outline none
.header-name--active
@extend .header-name
background-color $ui-button--active-backgroundColor
color $ui-button--active-color
&:hover
background-color $ui-button--active-backgroundColor
.folderList-item
display block
width 100%
height 26px
navButtonColor()
padding 0 10px 0 25px
font-size 14px
width 100%
text-align left
line-height 26px
box-sizing border-box
cursor pointer
outline none
padding 0 10px
margin 2px 0
height 26px
line-height 26px
border-width 0 0 0 6px
border-style solid
border-color transparent
.folderList-item--active
@extend .folderList-item
background-color $ui-button--active-backgroundColor
color $ui-button--active-color
&:hover
background-color $ui-button--active-backgroundColor
body[data-theme="dark"]
.header-toggleButton
navDarkButtonColor()
.header-name
navDarkButtonColor()
.header-name--active
@extend .header-name
background-color $ui-button--active-backgroundColor
color $ui-button--active-color
&:hover
background-color $ui-button--active-backgroundColor
.folderList-item
navDarkButtonColor()
border-width 0 0 0 6px
border-style solid
border-color transparent
.folderList-item--active
@extend .folderList-item
background-color $ui-button--active-backgroundColor
color $ui-button--active-color
&:hover
background-color $ui-button--active-backgroundColor

View File

@@ -1,356 +0,0 @@
import React, { PropTypes } from 'react'
import ReactDOM from 'react-dom'
import { connect, Provider } from 'react-redux'
import _ from 'lodash'
import ipc from './ipcClient'
import store from './store'
import CSSModules from 'browser/lib/CSSModules'
import styles from './FinderMain.styl'
import StorageSection from './StorageSection'
import NoteList from './NoteList'
import NoteDetail from './NoteDetail'
import SideNavFilter from 'browser/components/SideNavFilter'
import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
require('!!style!css!stylus?sourceMap!../main/global.styl')
require('../lib/customMeta')
const electron = require('electron')
const { remote } = electron
const { Menu } = remote
function hideFinder () {
let finderWindow = remote.getCurrentWindow()
if (global.process.platform === 'win32') {
finderWindow.blur()
finderWindow.hide()
}
if (global.process.platform === 'darwin') {
Menu.sendActionToFirstResponder('hide:')
}
remote.getCurrentWindow().hide()
}
require('!!style!css!stylus?sourceMap!../styles/finder/index.styl')
class FinderMain extends React.Component {
constructor (props) {
super(props)
this.state = {
search: '',
index: 0,
filter: {
includeSnippet: true,
includeMarkdown: false,
type: 'ALL',
storage: null,
folder: null
}
}
this.focusHandler = (e) => this.handleWindowFocus(e)
this.blurHandler = (e) => this.handleWindowBlur(e)
}
componentDidMount () {
this.refs.search.focus()
window.addEventListener('focus', this.focusHandler)
window.addEventListener('blur', this.blurHandler)
}
componentWillUnmount () {
window.removeEventListener('focus', this.focusHandler)
window.removeEventListener('blur', this.blurHandler)
}
handleWindowFocus (e) {
this.refs.search.focus()
}
handleWindowBlur (e) {
this.setState({
search: ''
})
}
handleKeyDown (e) {
this.refs.search.focus()
if (e.keyCode === 9) {
if (e.shiftKey) {
this.refs.detail.selectPriorSnippet()
} else {
this.refs.detail.selectNextSnippet()
}
e.preventDefault()
}
if (e.keyCode === 38) {
this.selectPrevious()
e.preventDefault()
}
if (e.keyCode === 40) {
this.selectNext()
e.preventDefault()
}
if (e.keyCode === 13) {
this.refs.detail.saveToClipboard()
AwsMobileAnalyticsConfig.recordDynamicCustomEvent('COPY_FINDER')
hideFinder()
e.preventDefault()
}
if (e.keyCode === 27) {
hideFinder()
e.preventDefault()
}
if (e.keyCode === 91 || e.metaKey) {
return
}
}
handleSearchChange (e) {
this.setState({
search: e.target.value,
index: 0
})
}
selectArticle (article) {
this.setState({currentArticle: article})
}
selectPrevious () {
if (this.state.index > 0) {
this.setState({
index: this.state.index - 1
})
}
}
selectNext () {
if (this.state.index < this.noteCount - 1) {
this.setState({
index: this.state.index + 1
})
}
}
handleOnlySnippetCheckboxChange (e) {
let { filter } = this.state
filter.includeSnippet = e.target.checked
this.setState({
filter: filter,
index: 0
}, () => {
this.refs.search.focus()
})
}
handleOnlyMarkdownCheckboxChange (e) {
let { filter } = this.state
filter.includeMarkdown = e.target.checked
this.refs.list.resetScroll()
this.setState({
filter: filter,
index: 0
}, () => {
this.refs.search.focus()
})
}
handleAllNotesButtonClick (e) {
let { filter } = this.state
filter.type = 'ALL'
this.refs.list.resetScroll()
this.setState({
filter,
index: 0
}, () => {
this.refs.search.focus()
})
}
handleStarredButtonClick (e) {
let { filter } = this.state
filter.type = 'STARRED'
this.refs.list.resetScroll()
this.setState({
filter,
index: 0
}, () => {
this.refs.search.focus()
})
}
handleStorageButtonClick (e, storage) {
let { filter } = this.state
filter.type = 'STORAGE'
filter.storage = storage
this.refs.list.resetScroll()
this.setState({
filter,
index: 0
}, () => {
this.refs.search.focus()
})
}
handleFolderButtonClick (e, storage, folder) {
let { filter } = this.state
filter.type = 'FOLDER'
filter.storage = storage
filter.folder = folder
this.refs.list.resetScroll()
this.setState({
filter,
index: 0
}, () => {
this.refs.search.focus()
})
}
handleNoteClick (e, index) {
this.setState({
index
}, () => {
this.refs.search.focus()
})
}
render () {
let { data, config } = this.props
let { filter, search } = this.state
let storageList = []
for (let key in data.storageMap) {
let storage = data.storageMap[key]
let item = (
<StorageSection
filter={filter}
storage={storage}
key={storage.key}
handleStorageButtonClick={(e, storage) => this.handleStorageButtonClick(e, storage)}
handleFolderButtonClick={(e, storage, folder) => this.handleFolderButtonClick(e, storage, folder)}
/>
)
storageList.push(item)
}
let notes = []
let noteIds
switch (filter.type) {
case 'STORAGE':
noteIds = data.storageNoteMap[filter.storage]
break
case 'FOLDER':
noteIds = data.folderNoteMap[filter.storage + '-' + filter.folder]
break
case 'STARRED':
noteIds = data.starredSet
}
if (noteIds != null) {
noteIds.forEach((id) => {
notes.push(data.noteMap[id])
})
} else {
for (let key in data.noteMap) {
notes.push(data.noteMap[key])
}
}
if (!filter.includeSnippet && filter.includeMarkdown) {
notes = notes.filter((note) => note.type === 'MARKDOWN_NOTE')
} else if (filter.includeSnippet && !filter.includeMarkdown) {
notes = notes.filter((note) => note.type === 'SNIPPET_NOTE')
}
if (search.trim().length > 0) {
let needle = new RegExp(_.escapeRegExp(search.trim()), 'i')
notes = notes.filter((note) => note.title.match(needle))
}
notes = notes
.sort((a, b) => new Date(b.updatedAt) - new Date(a.updatedAt))
let activeNote = notes[this.state.index]
this.noteCount = notes.length
return (
<div className='Finder'
styleName='root'
ref='-1'
onKeyDown={(e) => this.handleKeyDown(e)}
>
<div styleName='search'>
<input
styleName='search-input'
ref='search'
value={search}
placeholder='Search...'
onChange={(e) => this.handleSearchChange(e)}
/>
</div>
<div styleName='result'>
<div styleName='result-nav'>
<div styleName='result-nav-filter'>
<div styleName='result-nav-filter-option'>
<label>
<input type='checkbox'
checked={filter.includeSnippet}
onChange={(e) => this.handleOnlySnippetCheckboxChange(e)}
/> Only Snippets</label>
</div>
<div styleName='result-nav-filter-option'>
<label>
<input type='checkbox'
checked={filter.includeMarkdown}
onChange={(e) => this.handleOnlyMarkdownCheckboxChange(e)}
/> Only Markdown</label>
</div>
</div>
<SideNavFilter
isHomeActive={filter.type === 'ALL'}
handleAllNotesButtonClick={(e) => this.handleAllNotesButtonClick(e)}
isStarredActive={filter.type === 'STARRED'}
handleStarredButtonClick={(e) => this.handleStarredButtonClick(e)}
/>
<div styleName='result-nav-storageList'>
{storageList}
</div>
</div>
<NoteList styleName='result-list'
storageMap={data.storageMap}
notes={notes}
ref='list'
search={search}
index={this.state.index}
handleNoteClick={(e, _index) => this.handleNoteClick(e, _index)}
/>
<div styleName='result-detail'>
<NoteDetail
note={activeNote}
config={config}
ref='detail'
/>
</div>
</div>
</div>
)
}
}
FinderMain.propTypes = {
dispatch: PropTypes.func
}
var Finder = connect((x) => x)(CSSModules(FinderMain, styles))
function refreshData () {
// let data = dataStore.getData(true)
}
ReactDOM.render((
<Provider store={store}>
<Finder />
</Provider>
), document.getElementById('content'), function () {
refreshData()
})

View File

@@ -1,124 +0,0 @@
const nodeIpc = require('node-ipc')
const { remote, ipcRenderer } = require('electron')
const { app, Menu } = remote
const path = require('path')
const store = require('./store')
const consts = require('browser/lib/consts')
nodeIpc.config.id = 'finder'
nodeIpc.config.retry = 1500
nodeIpc.config.silent = true
function killFinder () {
let finderWindow = remote.getCurrentWindow()
finderWindow.removeAllListeners()
if (global.process.platform === 'darwin') {
// Only OSX has another app process.
nodeIpc.of.node.emit('quit-from-finder')
} else {
finderWindow.close()
}
}
function toggleFinder () {
let finderWindow = remote.getCurrentWindow()
if (global.process.platform === 'darwin') {
if (finderWindow.isVisible()) {
finderWindow.hide()
Menu.sendActionToFirstResponder('hide:')
} else {
nodeIpc.of.node.emit('request-data-from-finder')
finderWindow.show()
}
} else {
if (finderWindow.isVisible()) {
finderWindow.blur()
finderWindow.hide()
} else {
nodeIpc.of.node.emit('request-data-from-finder')
finderWindow.show()
finderWindow.focus()
}
}
}
nodeIpc.connectTo(
'node',
path.join(app.getPath('userData'), 'boostnote.service'),
function () {
nodeIpc.of.node.on('error', function (err) {
console.log(err)
})
nodeIpc.of.node.on('connect', function () {
console.log('Conncted successfully')
})
nodeIpc.of.node.on('disconnect', function () {
console.log('disconnected')
})
nodeIpc.of.node.on('open-finder', function () {
toggleFinder()
})
ipcRenderer.on('open-finder-from-tray', function () {
toggleFinder()
})
ipcRenderer.on('open-main-from-tray', function () {
nodeIpc.of.node.emit('open-main-from-finder')
})
ipcRenderer.on('quit-from-tray', function () {
nodeIpc.of.node.emit('quit-from-finder')
killFinder()
})
nodeIpc.of.node.on('throttle-data', function (payload) {
console.log('Received data from Main renderer')
store.default.dispatch({
type: 'THROTTLE_DATA',
data: payload
})
})
nodeIpc.of.node.on('config-renew', function (payload) {
const { config } = payload
if (config.ui.theme === 'dark') {
document.body.setAttribute('data-theme', 'dark')
} else if (config.ui.theme === 'white') {
document.body.setAttribute('data-theme', 'white')
} else {
document.body.setAttribute('data-theme', 'default')
}
let editorTheme = document.getElementById('editorTheme')
if (editorTheme == null) {
editorTheme = document.createElement('link')
editorTheme.setAttribute('id', 'editorTheme')
editorTheme.setAttribute('rel', 'stylesheet')
document.head.appendChild(editorTheme)
}
config.editor.theme = consts.THEMES.some((theme) => theme === config.editor.theme)
? config.editor.theme
: 'default'
if (config.editor.theme !== 'default') {
editorTheme.setAttribute('href', '../node_modules/codemirror/theme/' + config.editor.theme + '.css')
}
store.default.dispatch({
type: 'SET_CONFIG',
config: config
})
})
nodeIpc.of.node.on('quit-finder-app', function () {
nodeIpc.of.node.emit('quit-finder-app-confirm')
killFinder()
})
}
)
const ipc = {}
module.exports = ipc

View File

@@ -1,51 +0,0 @@
import { combineReducers, createStore } from 'redux'
import { routerReducer } from 'react-router-redux'
import { DEFAULT_CONFIG } from 'browser/main/lib/ConfigManager'
let defaultData = {
storageMap: {},
noteMap: {},
starredSet: [],
storageNoteMap: {},
folderNoteMap: {},
tagNoteMap: {}
}
function data (state = defaultData, action) {
switch (action.type) {
case 'THROTTLE_DATA':
console.log(action)
state = action.data
}
return state
}
function config (state = DEFAULT_CONFIG, action) {
switch (action.type) {
case 'INIT_CONFIG':
case 'SET_CONFIG':
return Object.assign({}, state, action.config)
case 'SET_IS_SIDENAV_FOLDED':
state.isSideNavFolded = action.isFolded
return Object.assign({}, state)
case 'SET_ZOOM':
state.zoom = action.zoom
return Object.assign({}, state)
case 'SET_LIST_WIDTH':
state.listWidth = action.listWidth
return Object.assign({}, state)
case 'SET_UI':
return Object.assign({}, state, action.config)
}
return state
}
let reducer = combineReducers({
data,
config,
routing: routerReducer
})
let store = createStore(reducer)
export default store

85
browser/lib/Languages.js Normal file
View File

@@ -0,0 +1,85 @@
const languages = [
{
name: 'Albanian',
locale: 'sq'
},
{
name: 'Chinese (zh-CN)',
locale: 'zh-CN'
},
{
name: 'Chinese (zh-TW)',
locale: 'zh-TW'
},
{
name: 'Danish',
locale: 'da'
},
{
name: 'English',
locale: 'en'
},
{
name: 'French',
locale: 'fr'
},
{
name: 'German',
locale: 'de'
},
{
name: 'Hungarian',
locale: 'hu'
},
{
name: 'Japanese',
locale: 'ja'
},
{
name: 'Korean',
locale: 'ko'
},
{
name: 'Norwegian',
locale: 'no'
},
{
name: 'Polish',
locale: 'pl'
},
{
name: 'Portuguese (PT-BR)',
locale: 'pt-BR'
},
{
name: 'Portuguese (PT-PT)',
locale: 'pt-PT'
},
{
name: 'Russian',
locale: 'ru'
},
{
name: 'Spanish',
locale: 'es-ES'
}, {
name: 'Turkish',
locale: 'tr'
}, {
name: 'Thai',
locale: 'th'
}
]
module.exports = {
getLocales () {
return languages.reduce(function (localeList, locale) {
localeList.push(locale.locale)
return localeList
}, [])
},
getLanguages () {
return languages
}
}

View File

@@ -38,15 +38,15 @@ class MutableMap {
} }
map (cb) { map (cb) {
let result = [] const result = []
for (let [key, value] of this._map) { for (const [key, value] of this._map) {
result.push(cb(value, key)) result.push(cb(value, key))
} }
return result return result
} }
toJS () { toJS () {
let result = {} const result = {}
for (let [key, value] of this._map) { for (let [key, value] of this._map) {
if (value instanceof MutableSet || value instanceof MutableMap) { if (value instanceof MutableSet || value instanceof MutableMap) {
value = value.toJS() value = value.toJS()
@@ -85,7 +85,7 @@ class MutableSet {
} }
map (cb) { map (cb) {
let result = [] const result = []
this._set.forEach(function (value, key) { this._set.forEach(function (value, key) {
result.push(cb(value, key)) result.push(cb(value, key))
}) })

View File

@@ -0,0 +1,113 @@
import { Point } from '@susisu/mte-kernel'
export default class TextEditorInterface {
constructor (editor) {
this.editor = editor
this.doc = editor.getDoc()
this.transaction = false
}
getCursorPosition () {
const { line, ch } = this.doc.getCursor()
return new Point(line, ch)
}
setCursorPosition (pos) {
this.doc.setCursor({
line: pos.row,
ch: pos.column
})
}
setSelectionRange (range) {
this.doc.setSelection(
{ line: range.start.row, ch: range.start.column },
{ line: range.end.row, ch: range.end.column }
)
}
getLastRow () {
return this.doc.lineCount() - 1
}
acceptsTableEdit () {
return true
}
getLine (row) {
return this.doc.getLine(row)
}
insertLine (row, line) {
const lastRow = this.getLastRow()
if (row > lastRow) {
const lastLine = this.getLine(lastRow)
this.doc.replaceRange(
'\n' + line,
{ line: lastRow, ch: lastLine.length },
{ line: lastRow, ch: lastLine.length }
)
} else {
this.doc.replaceRange(
line + '\n',
{ line: row, ch: 0 },
{ line: row, ch: 0 }
)
}
}
deleteLine (row) {
const lastRow = this.getLastRow()
if (row >= lastRow) {
if (lastRow > 0) {
const preLastLine = this.getLine(lastRow - 1)
const lastLine = this.getLine(lastRow)
this.doc.replaceRange(
'',
{ line: lastRow - 1, ch: preLastLine.length },
{ line: lastRow, ch: lastLine.length }
)
} else {
const lastLine = this.getLine(lastRow)
this.doc.replaceRange(
'',
{ line: lastRow, ch: 0 },
{ line: lastRow, ch: lastLine.length }
)
}
} else {
this.doc.replaceRange(
'',
{ line: row, ch: 0 },
{ line: row + 1, ch: 0 }
)
}
}
replaceLines (startRow, endRow, lines) {
const lastRow = this.getLastRow()
if (endRow > lastRow) {
const lastLine = this.getLine(lastRow)
this.doc.replaceRange(
lines.join('\n'),
{ line: startRow, ch: 0 },
{ line: lastRow, ch: lastLine.length }
)
} else {
this.doc.replaceRange(
lines.join('\n') + '\n',
{ line: startRow, ch: 0 },
{ line: endRow, ch: 0 }
)
}
}
transact (func) {
this.transaction = true
func()
this.transaction = false
if (this.onDidFinishTransaction) {
this.onDidFinishTransaction.call(undefined)
}
}
}

View File

@@ -0,0 +1,23 @@
import electron from 'electron'
import i18n from 'browser/lib/i18n'
const { remote } = electron
const { dialog } = remote
export function confirmDeleteNote (confirmDeletion, permanent) {
if (confirmDeletion || permanent) {
const alertConfig = {
ype: 'warning',
message: i18n.__('Confirm note deletion'),
detail: i18n.__('This will permanently remove this note.'),
buttons: [i18n.__('Confirm'), i18n.__('Cancel')]
}
const dialogButtonIndex = dialog.showMessageBox(
remote.getCurrentWindow(), alertConfig
)
return dialogButtonIndex === 0
}
return true
}

View File

@@ -12,6 +12,10 @@ const themes = fs.readdirSync(themePath)
}) })
themes.splice(themes.indexOf('solarized'), 1, 'solarized dark', 'solarized light') themes.splice(themes.indexOf('solarized'), 1, 'solarized dark', 'solarized light')
const snippetFile = process.env.NODE_ENV !== 'test'
? path.join(app.getPath('userData'), 'snippets.json')
: '' // return nothing as we specified different path to snippets.json in test
const consts = { const consts = {
FOLDER_COLORS: [ FOLDER_COLORS: [
'#E10051', '#E10051',
@@ -31,7 +35,16 @@ const consts = {
'Dodger Blue', 'Dodger Blue',
'Violet Eggplant' 'Violet Eggplant'
], ],
THEMES: ['default'].concat(themes) THEMES: ['default'].concat(themes),
SNIPPET_FILE: snippetFile,
DEFAULT_EDITOR_FONT_FAMILY: [
'Monaco',
'Menlo',
'Ubuntu Mono',
'Consolas',
'source-code-pro',
'monospace'
]
} }
module.exports = consts module.exports = consts

View File

@@ -2,7 +2,7 @@ const { remote } = require('electron')
const { Menu, MenuItem } = remote const { Menu, MenuItem } = remote
function popup (templates) { function popup (templates) {
let menu = new Menu() const menu = new Menu()
templates.forEach((item) => { templates.forEach((item) => {
menu.append(new MenuItem(item)) menu.append(new MenuItem(item))
}) })

View File

@@ -0,0 +1,65 @@
const {remote} = require('electron')
const {Menu} = remote.require('electron')
const spellcheck = require('./spellcheck')
/**
* Creates the context menu that is shown when there is a right click in the editor of a (not-snippet) note.
* If the word is does not contains a spelling error (determined by the 'error style'), no suggestions for corrections are requested
* => they are not visible in the context menu
* @param editor CodeMirror editor
* @param {MouseEvent} event that has triggered the creation of the context menu
* @returns {Electron.Menu} The created electron context menu
*/
const buildEditorContextMenu = function (editor, event) {
if (editor == null || event == null || event.pageX == null || event.pageY == null) {
return null
}
const cursor = editor.coordsChar({left: event.pageX, top: event.pageY})
const wordRange = editor.findWordAt(cursor)
const word = editor.getRange(wordRange.anchor, wordRange.head)
const existingMarks = editor.findMarks(wordRange.anchor, wordRange.head) || []
let isMisspelled = false
for (const mark of existingMarks) {
if (mark.className === spellcheck.getCSSClassName()) {
isMisspelled = true
break
}
}
let suggestion = []
if (isMisspelled) {
suggestion = spellcheck.getSpellingSuggestion(word)
}
const selection = {
isMisspelled: isMisspelled,
spellingSuggestions: suggestion
}
const template = [{
role: 'cut'
}, {
role: 'copy'
}, {
role: 'paste'
}, {
role: 'selectall'
}]
if (selection.isMisspelled) {
const suggestions = selection.spellingSuggestions
template.unshift.apply(template, suggestions.map(function (suggestion) {
return {
label: suggestion,
click: function (suggestion) {
if (editor != null) {
editor.replaceRange(suggestion.label, wordRange.anchor, wordRange.head)
}
}
}
}).concat({
type: 'separator'
}))
}
return Menu.buildFromTemplate(template)
}
module.exports = buildEditorContextMenu

View File

@@ -0,0 +1,14 @@
export default function convertModeName (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
}
}

View File

@@ -1,3 +1,5 @@
import CodeMirror from 'codemirror' import CodeMirror from 'codemirror'
import 'codemirror-mode-elixir'
CodeMirror.modeInfo.push({name: 'Stylus', mime: 'text/x-styl', mode: 'stylus', ext: ['styl'], alias: ['styl']}) CodeMirror.modeInfo.push({name: 'Stylus', mime: 'text/x-styl', mode: 'stylus', ext: ['styl'], alias: ['styl']})
CodeMirror.modeInfo.push({name: 'Elixir', mime: 'text/x-elixir', mode: 'elixir', ext: ['ex']})

View File

@@ -1,19 +1,37 @@
export function findNoteTitle (value) { export function findNoteTitle (value, enableFrontMatterTitle, frontMatterTitleField = 'title') {
let splitted = value.split('\n') const splitted = value.split('\n')
let title = null let title = null
let isInsideCodeBlock = false let isInsideCodeBlock = false
splitted.some((line, index) => { if (splitted[0] === '---') {
let trimmedLine = line.trim() let line = 0
let trimmedNextLine = splitted[index + 1] === undefined ? '' : splitted[index + 1].trim() while (++line < splitted.length) {
if (trimmedLine.match('```')) { if (enableFrontMatterTitle && splitted[line].startsWith(frontMatterTitleField + ':')) {
isInsideCodeBlock = !isInsideCodeBlock title = splitted[line].substring(frontMatterTitleField.length + 1).trim()
break
}
if (splitted[line] === '---') {
splitted.splice(0, line + 1)
break
}
} }
if (isInsideCodeBlock === false && (trimmedLine.match(/^# +/) || trimmedNextLine.match(/^=+$/))) { }
title = trimmedLine
return true if (title === null) {
} splitted.some((line, index) => {
}) const trimmedLine = line.trim()
const trimmedNextLine = splitted[index + 1] === undefined ? '' : splitted[index + 1].trim()
if (trimmedLine.match('```')) {
isInsideCodeBlock = !isInsideCodeBlock
}
if (isInsideCodeBlock === false && (trimmedLine.match(/^# +/) || trimmedNextLine.match(/^=+$/))) {
title = trimmedLine
return true
}
})
}
if (title === null) { if (title === null) {
title = '' title = ''

View File

@@ -1,14 +1,14 @@
export function getTodoStatus (content) { export function getTodoStatus (content) {
let splitted = content.split('\n') const splitted = content.split('\n')
let numberOfTodo = 0 let numberOfTodo = 0
let numberOfCompletedTodo = 0 let numberOfCompletedTodo = 0
splitted.forEach((line) => { splitted.forEach((line) => {
let trimmedLine = line.trim() const trimmedLine = line.trim()
if (trimmedLine.match(/^[\+\-\*] \[\s|x\] ./)) { if (trimmedLine.match(/^[\+\-\*] \[(\s|x)\] ./i)) {
numberOfTodo++ numberOfTodo++
} }
if (trimmedLine.match(/^[\+\-\*] \[x\] ./)) { if (trimmedLine.match(/^[\+\-\*] \[x\] ./i)) {
numberOfCompletedTodo++ numberOfCompletedTodo++
} }
}) })

17
browser/lib/i18n.js Normal file
View File

@@ -0,0 +1,17 @@
const path = require('path')
const { remote } = require('electron')
const { app } = remote
const { getLocales } = require('./Languages.js')
// load package for localization
const i18n = new (require('i18n-2'))({
// setup some locales - other locales default to the first locale
locales: getLocales(),
extension: '.json',
directory: process.env.NODE_ENV === 'production'
? path.join(app.getAppPath(), './locales')
: path.resolve('./locales'),
devMode: false
})
export default i18n

View File

@@ -1,7 +1,11 @@
const crypto = require('crypto') const crypto = require('crypto')
const _ = require('lodash') const _ = require('lodash')
const uuidv4 = require('uuid/v4')
module.exports = function (length) { module.exports = function (uuid) {
if (!_.isFinite(length)) length = 10 if (typeof uuid === typeof true && uuid) {
return uuidv4()
}
const length = 10
return crypto.randomBytes(length).toString('hex') return crypto.randomBytes(length).toString('hex')
} }

View File

@@ -0,0 +1,232 @@
'use strict'
module.exports = function definitionListPlugin (md) {
var isSpace = md.utils.isSpace
// Search `[:~][\n ]`, returns next pos after marker on success
// or -1 on fail.
function skipMarker (state, line) {
let start = state.bMarks[line] + state.tShift[line]
const max = state.eMarks[line]
if (start >= max) { return -1 }
// Check bullet
const marker = state.src.charCodeAt(start++)
if (marker !== 0x7E/* ~ */ && marker !== 0x3A/* : */) { return -1 }
const pos = state.skipSpaces(start)
// require space after ":"
if (start === pos) { return -1 }
return start
}
function markTightParagraphs (state, idx) {
const level = state.level + 2
let i
let l
for (i = idx + 2, l = state.tokens.length - 2; i < l; i++) {
if (state.tokens[i].level === level && state.tokens[i].type === 'paragraph_open') {
state.tokens[i + 2].hidden = true
state.tokens[i].hidden = true
i += 2
}
}
}
function deflist (state, startLine, endLine, silent) {
var ch,
contentStart,
ddLine,
dtLine,
itemLines,
listLines,
listTokIdx,
max,
newEndLine,
nextLine,
offset,
oldDDIndent,
oldIndent,
oldLineMax,
oldParentType,
oldSCount,
oldTShift,
oldTight,
pos,
prevEmptyEnd,
tight,
token
if (silent) {
// quirk: validation mode validates a dd block only, not a whole deflist
if (state.ddIndent < 0) { return false }
return skipMarker(state, startLine) >= 0
}
nextLine = startLine + 1
if (nextLine >= endLine) { return false }
if (state.isEmpty(nextLine)) {
nextLine++
if (nextLine >= endLine) { return false }
}
if (state.sCount[nextLine] < state.blkIndent) { return false }
contentStart = skipMarker(state, nextLine)
if (contentStart < 0) { return false }
// Start list
listTokIdx = state.tokens.length
tight = true
token = state.push('dl_open', 'dl', 1)
token.map = listLines = [ startLine, 0 ]
//
// Iterate list items
//
dtLine = startLine
ddLine = nextLine
// One definition list can contain multiple DTs,
// and one DT can be followed by multiple DDs.
//
// Thus, there is two loops here, and label is
// needed to break out of the second one
//
/* eslint no-labels:0,block-scoped-var:0 */
OUTER:
for (;;) {
prevEmptyEnd = false
token = state.push('dt_open', 'dt', 1)
token.map = [ dtLine, dtLine ]
token = state.push('inline', '', 0)
token.map = [ dtLine, dtLine ]
token.content = state.getLines(dtLine, dtLine + 1, state.blkIndent, false).trim()
token.children = []
token = state.push('dt_close', 'dt', -1)
for (;;) {
token = state.push('dd_open', 'dd', 1)
token.map = itemLines = [ ddLine, 0 ]
pos = contentStart
max = state.eMarks[ddLine]
offset = state.sCount[ddLine] + contentStart - (state.bMarks[ddLine] + state.tShift[ddLine])
while (pos < max) {
ch = state.src.charCodeAt(pos)
if (isSpace(ch)) {
if (ch === 0x09) {
offset += 4 - offset % 4
} else {
offset++
}
} else {
break
}
pos++
}
contentStart = pos
oldTight = state.tight
oldDDIndent = state.ddIndent
oldIndent = state.blkIndent
oldTShift = state.tShift[ddLine]
oldSCount = state.sCount[ddLine]
oldParentType = state.parentType
state.blkIndent = state.ddIndent = state.sCount[ddLine] + 2
state.tShift[ddLine] = contentStart - state.bMarks[ddLine]
state.sCount[ddLine] = offset
state.tight = true
state.parentType = 'deflist'
newEndLine = ddLine
while (++newEndLine < endLine && (state.sCount[newEndLine] >= state.sCount[ddLine] || state.isEmpty(newEndLine))) {
}
oldLineMax = state.lineMax
state.lineMax = newEndLine
state.md.block.tokenize(state, ddLine, newEndLine, true)
state.lineMax = oldLineMax
// If any of list item is tight, mark list as tight
if (!state.tight || prevEmptyEnd) {
tight = false
}
// Item become loose if finish with empty line,
// but we should filter last element, because it means list finish
prevEmptyEnd = (state.line - ddLine) > 1 && state.isEmpty(state.line - 1)
state.tShift[ddLine] = oldTShift
state.sCount[ddLine] = oldSCount
state.tight = oldTight
state.parentType = oldParentType
state.blkIndent = oldIndent
state.ddIndent = oldDDIndent
token = state.push('dd_close', 'dd', -1)
itemLines[1] = nextLine = state.line
if (nextLine >= endLine) { break OUTER }
if (state.sCount[nextLine] < state.blkIndent) { break OUTER }
contentStart = skipMarker(state, nextLine)
if (contentStart < 0) { break }
ddLine = nextLine
// go to the next loop iteration:
// insert DD tag and repeat checking
}
if (nextLine >= endLine) { break }
dtLine = nextLine
if (state.isEmpty(dtLine)) { break }
if (state.sCount[dtLine] < state.blkIndent) { break }
ddLine = dtLine + 1
if (ddLine >= endLine) { break }
if (state.isEmpty(ddLine)) { ddLine++ }
if (ddLine >= endLine) { break }
if (state.sCount[ddLine] < state.blkIndent) { break }
contentStart = skipMarker(state, ddLine)
if (contentStart < 0) { break }
// go to the next loop iteration:
// insert DT and DD tags and repeat checking
}
// Finilize list
token = state.push('dl_close', 'dl', -1)
listLines[1] = nextLine
state.line = nextLine
// mark paragraphs tight if needed
if (tight) {
markTightParagraphs(state, listTokIdx)
}
return true
}
md.block.ruler.before('paragraph', 'deflist', deflist, { alt: [ 'paragraph', 'reference' ] })
}

View File

@@ -0,0 +1,136 @@
'use strict'
module.exports = function (md, renderers, defaultRenderer) {
const paramsRE = /^[ \t]*([\w+#-]+)?(?:\(((?:\s*\w[-\w]*(?:=(?:'(?:.*?[^\\])?'|"(?:.*?[^\\])?"|(?:[^'"][^\s]*)))?)*)\))?(?::([^:]*)(?::(\d+))?)?\s*$/
function fence (state, startLine, endLine, silent) {
let pos = state.bMarks[startLine] + state.tShift[startLine]
let max = state.eMarks[startLine]
if (state.sCount[startLine] - state.blkIndent >= 4 || pos + 3 > max) {
return false
}
const marker = state.src.charCodeAt(pos)
if (marker !== 0x7E/* ~ */ && marker !== 0x60 /* ` */) {
return false
}
let mem = pos
pos = state.skipChars(pos, marker)
let len = pos - mem
if (len < 3) {
return false
}
const markup = state.src.slice(mem, pos)
const params = state.src.slice(pos, max)
if (silent) {
return true
}
let nextLine = startLine
let haveEndMarker = false
while (true) {
nextLine++
if (nextLine >= endLine) {
break
}
pos = mem = state.bMarks[nextLine] + state.tShift[nextLine]
max = state.eMarks[nextLine]
if (pos < max && state.sCount[nextLine] < state.blkIndent) {
break
}
if (state.src.charCodeAt(pos) !== marker || state.sCount[nextLine] - state.blkIndent >= 4) {
continue
}
pos = state.skipChars(pos, marker)
if (pos - mem < len) {
continue
}
pos = state.skipSpaces(pos)
if (pos >= max) {
haveEndMarker = true
break
}
}
len = state.sCount[startLine]
state.line = nextLine + (haveEndMarker ? 1 : 0)
const parameters = {}
let langType = ''
let fileName = ''
let firstLineNumber = 1
let match = paramsRE.exec(params)
if (match) {
if (match[1]) {
langType = match[1]
}
if (match[3]) {
fileName = match[3]
}
if (match[4]) {
firstLineNumber = parseInt(match[4], 10)
}
if (match[2]) {
const params = match[2]
const regex = /(\w[-\w]*)(?:=(?:'(.*?[^\\])?'|"(.*?[^\\])?"|([^'"][^\s]*)))?/g
let name, value
while ((match = regex.exec(params))) {
name = match[1]
value = match[2] || match[3] || match[4] || null
const height = /^(\d+)h$/.exec(name)
if (height && !value) {
parameters.height = height[1]
} else {
parameters[name] = value
}
}
}
}
let token
if (renderers[langType]) {
token = state.push(`${langType}_fence`, 'div', 0)
} else {
token = state.push('_fence', 'code', 0)
}
token.langType = langType
token.fileName = fileName
token.firstLineNumber = firstLineNumber
token.parameters = parameters
token.content = state.getLines(startLine + 1, nextLine, len, true)
token.markup = markup
token.map = [startLine, state.line]
return true
}
md.block.ruler.before('fence', '_fence', fence, {
alt: ['paragraph', 'reference', 'blockquote', 'list']
})
for (const name in renderers) {
md.renderer.rules[`${name}_fence`] = (tokens, index) => renderers[name](tokens[index])
}
if (defaultRenderer) {
md.renderer.rules['_fence'] = (tokens, index) => defaultRenderer(tokens[index])
}
}

View File

@@ -0,0 +1,24 @@
'use strict'
module.exports = function frontMatterPlugin (md) {
function frontmatter (state, startLine, endLine, silent) {
if (startLine !== 0 || state.src.substr(startLine, state.eMarks[0]) !== '---') {
return false
}
let line = 0
while (++line < state.lineMax) {
if (state.src.substring(state.bMarks[line], state.eMarks[line]) === '---') {
state.line = line + 1
return true
}
}
return false
}
md.block.ruler.before('table', 'frontmatter', frontmatter, {
alt: [ 'paragraph', 'reference', 'blockquote', 'list' ]
})
}

View File

@@ -0,0 +1,124 @@
'use strict'
import sanitizeHtml from 'sanitize-html'
import { escapeHtmlCharacters } from './utils'
import url from 'url'
module.exports = function sanitizePlugin (md, options) {
options = options || {}
md.core.ruler.after('linkify', 'sanitize_inline', state => {
for (let tokenIdx = 0; tokenIdx < state.tokens.length; tokenIdx++) {
if (state.tokens[tokenIdx].type === 'html_block') {
state.tokens[tokenIdx].content = sanitizeHtml(
state.tokens[tokenIdx].content,
options
)
}
if (state.tokens[tokenIdx].type === '_fence') {
// escapeHtmlCharacters has better performance
state.tokens[tokenIdx].content = escapeHtmlCharacters(
state.tokens[tokenIdx].content,
{ skipSingleQuote: true }
)
}
if (state.tokens[tokenIdx].type === 'inline') {
const inlineTokens = state.tokens[tokenIdx].children
for (let childIdx = 0; childIdx < inlineTokens.length; childIdx++) {
if (inlineTokens[childIdx].type === 'html_inline') {
inlineTokens[childIdx].content = sanitizeInline(
inlineTokens[childIdx].content,
options
)
}
}
}
}
})
}
const tagRegex = /<([A-Z][A-Z0-9]*)\s*((?:\s*[A-Z][A-Z0-9]*(?:=("|')(?:[^\3]+?)\3)?)*)\s*\/?>|<\/([A-Z][A-Z0-9]*)\s*>/i
const attributesRegex = /([A-Z][A-Z0-9]*)(?:=("|')([^\2]+?)\2)?/ig
function sanitizeInline (html, options) {
let match = tagRegex.exec(html)
if (!match) {
return ''
}
const { allowedTags, allowedAttributes, selfClosing, allowedSchemesAppliedToAttributes } = options
if (match[1] !== undefined) {
// opening tag
const tag = match[1].toLowerCase()
if (allowedTags.indexOf(tag) === -1) {
return ''
}
const attributes = match[2]
let attrs = ''
let name
let value
while ((match = attributesRegex.exec(attributes))) {
name = match[1].toLowerCase()
value = match[3]
if (allowedAttributes['*'].indexOf(name) !== -1 || (allowedAttributes[tag] && allowedAttributes[tag].indexOf(name) !== -1)) {
if (allowedSchemesAppliedToAttributes.indexOf(name) !== -1) {
if (naughtyHRef(value, options) || (tag === 'iframe' && name === 'src' && naughtyIFrame(value, options))) {
continue
}
}
attrs += ` ${name}`
if (match[2]) {
attrs += `="${value}"`
}
}
}
if (selfClosing.indexOf(tag) === -1) {
return '<' + tag + attrs + '>'
} else {
return '<' + tag + attrs + ' />'
}
} else {
// closing tag
if (allowedTags.indexOf(match[4].toLowerCase()) !== -1) {
return html
} else {
return ''
}
}
}
function naughtyHRef (href, options) {
// href = href.replace(/[\x00-\x20]+/g, '')
href = href.replace(/<\!\-\-.*?\-\-\>/g, '')
const matches = href.match(/^([a-zA-Z]+)\:/)
if (!matches) {
if (href.match(/^[\/\\]{2}/)) {
return !options.allowProtocolRelative
}
// No scheme
return false
}
const scheme = matches[1].toLowerCase()
return options.allowedSchemes.indexOf(scheme) === -1
}
function naughtyIFrame (src, options) {
try {
const parsed = url.parse(src, false, true)
return options.allowedIframeHostnames.index(parsed.hostname) === -1
} catch (e) {
return true
}
}

View File

@@ -0,0 +1,98 @@
/**
* @fileoverview Markdown table of contents generator
*/
import { EOL } from 'os'
import toc from 'markdown-toc'
import mdlink from 'markdown-link'
import slugify from './slugify'
const hasProp = Object.prototype.hasOwnProperty
/**
* From @enyaxu/markdown-it-anchor
*/
function uniqueSlug (slug, slugs, opts) {
let uniq = slug
let i = opts.uniqueSlugStartIndex
while (hasProp.call(slugs, uniq)) uniq = `${slug}-${i++}`
slugs[uniq] = true
return uniq
}
function linkify (token) {
token.content = mdlink(token.content, '#' + token.slug)
return token
}
const TOC_MARKER_START = '<!-- toc -->'
const TOC_MARKER_END = '<!-- tocstop -->'
/**
* Takes care of proper updating given editor with TOC.
* If TOC doesn't exit in the editor, it's inserted at current caret position.
* Otherwise,TOC is updated in place.
* @param editor CodeMirror editor to be updated with TOC
*/
export function generateInEditor (editor) {
const tocRegex = new RegExp(`${TOC_MARKER_START}[\\s\\S]*?${TOC_MARKER_END}`)
function tocExistsInEditor () {
return tocRegex.test(editor.getValue())
}
function updateExistingToc () {
const toc = generate(editor.getValue())
const search = editor.getSearchCursor(tocRegex)
while (search.findNext()) {
search.replace(toc)
}
}
function addTocAtCursorPosition () {
const toc = generate(editor.getRange(editor.getCursor(), {line: Infinity}))
editor.replaceRange(wrapTocWithEol(toc, editor), editor.getCursor())
}
if (tocExistsInEditor()) {
updateExistingToc()
} else {
addTocAtCursorPosition()
}
}
/**
* Generates MD TOC based on MD document passed as string.
* @param markdownText MD document
* @returns generatedTOC String containing generated TOC
*/
export function generate (markdownText) {
const slugs = {}
const opts = {
uniqueSlugStartIndex: 1
}
const result = toc(markdownText, {
slugify: title => {
return uniqueSlug(slugify(title), slugs, opts)
},
linkify: false
})
const md = toc.bullets(result.json.map(linkify), {
highest: result.highest
})
return TOC_MARKER_START + EOL + EOL + md + EOL + EOL + TOC_MARKER_END
}
function wrapTocWithEol (toc, editor) {
const leftWrap = editor.getCursor().ch === 0 ? '' : EOL
const rightWrap = editor.getLine(editor.getCursor().line).length === editor.getCursor().ch ? '' : EOL
return leftWrap + toc + rightWrap
}
export default {
generate,
generateInEditor
}

View File

@@ -1,157 +1,306 @@
import markdownit from 'markdown-it' import markdownit from 'markdown-it'
import sanitize from './markdown-it-sanitize-html'
import emoji from 'markdown-it-emoji' import emoji from 'markdown-it-emoji'
import math from '@rokt33r/markdown-it-math' import math from '@rokt33r/markdown-it-math'
import smartArrows from 'markdown-it-smartarrows'
import _ from 'lodash' import _ from 'lodash'
import ConfigManager from 'browser/main/lib/ConfigManager'
import katex from 'katex'
import { lastFindInArray } from './utils'
// FIXME We should not depend on global variable. function createGutter (str, firstLineNumber) {
const katex = window.katex if (Number.isNaN(firstLineNumber)) firstLineNumber = 1
const lastLineNumber = (str.match(/\n/g) || []).length + firstLineNumber - 1
function createGutter (str) { const lines = []
let lc = (str.match(/\n/g) || []).length for (let i = firstLineNumber; i <= lastLineNumber; i++) {
let lines = []
for (let i = 1; i <= lc; i++) {
lines.push('<span class="CodeMirror-linenumber">' + i + '</span>') lines.push('<span class="CodeMirror-linenumber">' + i + '</span>')
} }
return '<span class="lineNumber CodeMirror-gutters">' + lines.join('') + '</span>' return '<span class="lineNumber CodeMirror-gutters">' + lines.join('') + '</span>'
} }
var md = markdownit({ class Markdown {
typographer: true, constructor (options = {}) {
linkify: true, const config = ConfigManager.get()
html: true, const defaultOptions = {
xhtmlOut: true, typographer: config.preview.smartQuotes,
breaks: true, linkify: true,
highlight: function (str, lang) { html: true,
if (lang === 'flowchart') { xhtmlOut: true,
return `<pre class="flowchart">${str}</pre>` breaks: config.preview.breaks,
sanitize: 'STRICT'
} }
if (lang === 'sequence') {
return `<pre class="sequence">${str}</pre>`
}
return '<pre class="code">' +
createGutter(str) +
'<code class="' + lang + '">' +
str +
'</code></pre>'
}
})
md.use(emoji, {
shortcuts: {}
})
md.use(math, {
inlineRenderer: function (str) {
let output = ''
try {
output = katex.renderToString(str.trim())
} catch (err) {
output = `<span class="katex-error">${err.message}</span>`
}
return output
},
blockRenderer: function (str) {
let output = ''
try {
output = katex.renderToString(str.trim(), {displayMode: true})
} catch (err) {
output = `<div class="katex-error">${err.message}</div>`
}
return output
}
})
md.use(require('markdown-it-imsize'))
md.use(require('markdown-it-footnote'))
md.use(require('markdown-it-multimd-table'))
md.use(require('markdown-it-named-headers'), {
slugify: (header) => {
return encodeURI(header.trim()
.replace(/[\]\[\!\"\#\$\%\&\'\(\)\*\+\,\.\/\:\;\<\=\>\?\@\\\^\_\{\|\}\~]/g, '')
.replace(/\s+/g, '-'))
.replace(/\-+$/, '')
}
})
md.use(require('markdown-it-kbd'))
md.use(require('markdown-it-plantuml'))
// Override task item const updatedOptions = Object.assign(defaultOptions, options)
md.block.ruler.at('paragraph', function (state, startLine/*, endLine */) { this.md = markdownit(updatedOptions)
let content, terminate, i, l, token
let nextLine = startLine + 1
let terminatorRules = state.md.block.ruler.getRules('paragraph')
let endLine = state.lineMax
// jump line-by-line until empty one or EOF if (updatedOptions.sanitize !== 'NONE') {
for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) { const allowedTags = ['iframe', 'input', 'b',
// this would be a code block normally, but after paragraph 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'h7', 'h8', 'br', 'b', 'i', 'strong', 'em', 'a', 'pre', 'code', 'img', 'tt',
// it's considered a lazy continuation regardless of what's there 'div', 'ins', 'del', 'sup', 'sub', 'p', 'ol', 'ul', 'table', 'thead', 'tbody', 'tfoot', 'blockquote',
if (state.sCount[nextLine] - state.blkIndent > 3) { continue } 'dl', 'dt', 'dd', 'kbd', 'q', 'samp', 'var', 'hr', 'ruby', 'rt', 'rp', 'li', 'tr', 'td', 'th', 's', 'strike', 'summary', 'details'
]
const allowedAttributes = [
'abbr', 'accept', 'accept-charset',
'accesskey', 'action', 'align', 'alt', 'axis',
'border', 'cellpadding', 'cellspacing', 'char',
'charoff', 'charset', 'checked',
'clear', 'cols', 'colspan', 'color',
'compact', 'coords', 'datetime', 'dir',
'disabled', 'enctype', 'for', 'frame',
'headers', 'height', 'hreflang',
'hspace', 'ismap', 'label', 'lang',
'maxlength', 'media', 'method',
'multiple', 'name', 'nohref', 'noshade',
'nowrap', 'open', 'prompt', 'readonly', 'rel', 'rev',
'rows', 'rowspan', 'rules', 'scope',
'selected', 'shape', 'size', 'span',
'start', 'summary', 'tabindex', 'target',
'title', 'type', 'usemap', 'valign', 'value',
'vspace', 'width', 'itemprop'
]
// quirk for blockquotes, this line should already be checked by that rule if (updatedOptions.sanitize === 'ALLOW_STYLES') {
if (state.sCount[nextLine] < 0) { continue } allowedTags.push('style')
allowedAttributes.push('style')
// Some tags can terminate paragraph without empty line.
terminate = false
for (i = 0, l = terminatorRules.length; i < l; i++) {
if (terminatorRules[i](state, nextLine, endLine, true)) {
terminate = true
break
} }
// Sanitize use rinput before other plugins
this.md.use(sanitize, {
allowedTags,
allowedAttributes: {
'*': allowedAttributes,
'a': ['href'],
'div': ['itemscope', 'itemtype'],
'blockquote': ['cite'],
'del': ['cite'],
'ins': ['cite'],
'q': ['cite'],
'img': ['src', 'width', 'height'],
'iframe': ['src', 'width', 'height', 'frameborder', 'allowfullscreen'],
'input': ['type', 'id', 'checked']
},
allowedIframeHostnames: ['www.youtube.com'],
selfClosing: [ 'img', 'br', 'hr', 'input' ],
allowedSchemes: [ 'http', 'https', 'ftp', 'mailto' ],
allowedSchemesAppliedToAttributes: [ 'href', 'src', 'cite' ],
allowProtocolRelative: true
})
} }
if (terminate) { break }
this.md.use(emoji, {
shortcuts: {}
})
this.md.use(math, {
inlineOpen: config.preview.latexInlineOpen,
inlineClose: config.preview.latexInlineClose,
blockOpen: config.preview.latexBlockOpen,
blockClose: config.preview.latexBlockClose,
inlineRenderer: function (str) {
let output = ''
try {
output = katex.renderToString(str.trim())
} catch (err) {
output = `<span class="katex-error">${err.message}</span>`
}
return output
},
blockRenderer: function (str) {
let output = ''
try {
output = katex.renderToString(str.trim(), { displayMode: true })
} catch (err) {
output = `<div class="katex-error">${err.message}</div>`
}
return output
}
})
this.md.use(require('markdown-it-imsize'))
this.md.use(require('markdown-it-footnote'))
this.md.use(require('markdown-it-multimd-table'))
this.md.use(require('@enyaxu/markdown-it-anchor'), {
slugify: require('./slugify')
})
this.md.use(require('markdown-it-kbd'))
this.md.use(require('markdown-it-admonition'), {types: ['note', 'hint', 'attention', 'caution', 'danger', 'error']})
this.md.use(require('markdown-it-abbr'))
this.md.use(require('markdown-it-sub'))
this.md.use(require('markdown-it-sup'))
this.md.use(require('./markdown-it-deflist'))
this.md.use(require('./markdown-it-frontmatter'))
this.md.use(require('./markdown-it-fence'), {
chart: token => {
if (token.parameters.hasOwnProperty('yaml')) {
token.parameters.format = 'yaml'
}
return `<pre class="fence" data-line="${token.map[0]}">
<span class="filename">${token.fileName}</span>
<div class="chart" data-height="${token.parameters.height}" data-format="${token.parameters.format || 'json'}">${token.content}</div>
</pre>`
},
flowchart: token => {
return `<pre class="fence" data-line="${token.map[0]}">
<span class="filename">${token.fileName}</span>
<div class="flowchart" data-height="${token.parameters.height}">${token.content}</div>
</pre>`
},
gallery: token => {
const content = token.content.split('\n').slice(0, -1).map(line => {
const match = /!\[[^\]]*]\(([^\)]*)\)/.exec(line)
if (match) {
return match[1]
} else {
return line
}
}).join('\n')
return `<pre class="fence" data-line="${token.map[0]}">
<span class="filename">${token.fileName}</span>
<div class="gallery" data-autoplay="${token.parameters.autoplay}" data-height="${token.parameters.height}">${content}</div>
</pre>`
},
mermaid: token => {
return `<pre class="fence" data-line="${token.map[0]}">
<span class="filename">${token.fileName}</span>
<div class="mermaid" data-height="${token.parameters.height}">${token.content}</div>
</pre>`
},
sequence: token => {
return `<pre class="fence" data-line="${token.map[0]}">
<span class="filename">${token.fileName}</span>
<div class="sequence" data-height="${token.parameters.height}">${token.content}</div>
</pre>`
}
}, token => {
return `<pre class="code CodeMirror" data-line="${token.map[0]}">
<span class="filename">${token.fileName}</span>
${createGutter(token.content, token.firstLineNumber)}
<code class="${token.langType}">${token.content}</code>
</pre>`
})
const deflate = require('markdown-it-plantuml/lib/deflate')
this.md.use(require('markdown-it-plantuml'), '', {
generateSource: function (umlCode) {
const stripTrailingSlash = (url) => url.endsWith('/') ? url.slice(0, -1) : url
const serverAddress = stripTrailingSlash(config.preview.plantUMLServerAddress) + '/svg'
const s = unescape(encodeURIComponent(umlCode))
const zippedCode = deflate.encode64(
deflate.zip_deflate(`@startuml\n${s}\n@enduml`, 9)
)
return `${serverAddress}/${zippedCode}`
}
})
// Ditaa support
this.md.use(require('markdown-it-plantuml'), {
openMarker: '@startditaa',
closeMarker: '@endditaa',
generateSource: function (umlCode) {
const stripTrailingSlash = (url) => url.endsWith('/') ? url.slice(0, -1) : url
// Currently PlantUML server doesn't support Ditaa in SVG, so we set the format as PNG at the moment.
const serverAddress = stripTrailingSlash(config.preview.plantUMLServerAddress) + '/png'
const s = unescape(encodeURIComponent(umlCode))
const zippedCode = deflate.encode64(
deflate.zip_deflate(`@startditaa\n${s}\n@endditaa`, 9)
)
return `${serverAddress}/${zippedCode}`
}
})
// Override task item
this.md.block.ruler.at('paragraph', function (state, startLine/*, endLine */) {
let content, terminate, i, l, token
let nextLine = startLine + 1
const terminatorRules = state.md.block.ruler.getRules('paragraph')
const endLine = state.lineMax
// jump line-by-line until empty one or EOF
for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
// this would be a code block normally, but after paragraph
// it's considered a lazy continuation regardless of what's there
if (state.sCount[nextLine] - state.blkIndent > 3) { continue }
// quirk for blockquotes, this line should already be checked by that rule
if (state.sCount[nextLine] < 0) { continue }
// Some tags can terminate paragraph without empty line.
terminate = false
for (i = 0, l = terminatorRules.length; i < l; i++) {
if (terminatorRules[i](state, nextLine, endLine, true)) {
terminate = true
break
}
}
if (terminate) { break }
}
content = state.getLines(startLine, nextLine, state.blkIndent, false).trim()
state.line = nextLine
token = state.push('paragraph_open', 'p', 1)
token.map = [startLine, state.line]
if (state.parentType === 'list') {
const match = content.match(/^\[( |x)\] ?(.+)/i)
if (match) {
const liToken = lastFindInArray(state.tokens, token => token.type === 'list_item_open')
if (liToken) {
if (!liToken.attrs) {
liToken.attrs = []
}
if (config.preview.lineThroughCheckbox) {
liToken.attrs.push(['class', `taskListItem${match[1] !== ' ' ? ' checked' : ''}`])
} else {
liToken.attrs.push(['class', 'taskListItem'])
}
}
content = `<label class='taskListItem${match[1] !== ' ' ? ' checked' : ''}' for='checkbox-${startLine + 1}'><input type='checkbox'${match[1] !== ' ' ? ' checked' : ''} id='checkbox-${startLine + 1}'/> ${content.substring(4, content.length)}</label>`
}
}
token = state.push('inline', '', 0)
token.content = content
token.map = [startLine, state.line]
token.children = []
token = state.push('paragraph_close', 'p', -1)
return true
})
if (config.preview.smartArrows) {
this.md.use(smartArrows)
}
// Add line number attribute for scrolling
const originalRender = this.md.renderer.render
this.md.renderer.render = (tokens, options, env) => {
tokens.forEach((token) => {
switch (token.type) {
case 'blockquote_open':
case 'dd_open':
case 'dt_open':
case 'heading_open':
case 'list_item_open':
case 'paragraph_open':
case 'table_open':
token.attrPush(['data-line', token.map[0]])
}
})
const result = originalRender.call(this.md.renderer, tokens, options, env)
return result
}
// FIXME We should not depend on global variable.
window.md = this.md
} }
content = state.getLines(startLine, nextLine, state.blkIndent, false).trim() render (content) {
state.line = nextLine
token = state.push('paragraph_open', 'p', 1)
token.map = [ startLine, state.line ]
if (state.parentType === 'list') {
let match = content.match(/^\[( |x)\] ?(.+)/i)
if (match) {
content = `<label class='taskListItem' for='checkbox-${startLine + 1}'><input type='checkbox'${match[1] !== ' ' ? ' checked' : ''} id='checkbox-${startLine + 1}'/> ${content.substring(4, content.length)}</label>`
}
}
token = state.push('inline', '', 0)
token.content = content
token.map = [ startLine, state.line ]
token.children = []
token = state.push('paragraph_close', 'p', -1)
return true
})
// Add line number attribute for scrolling
let originalRender = md.renderer.render
md.renderer.render = function render (tokens, options, env) {
tokens.forEach((token) => {
switch (token.type) {
case 'heading_open':
case 'paragraph_open':
case 'blockquote_open':
case 'table_open':
token.attrPush(['data-line', token.map[0]])
}
})
let result = originalRender.call(md.renderer, tokens, options, env)
return result
}
// FIXME We should not depend on global variable.
window.md = md
function normalizeLinkText (linkText) {
return md.normalizeLinkText(linkText)
}
const markdown = {
render: function markdown (content) {
if (!_.isString(content)) content = '' if (!_.isString(content)) content = ''
const renderedContent = md.render(content) return this.md.render(content)
return renderedContent }
},
normalizeLinkText
} }
export default markdown export default Markdown

0
browser/lib/markdown2.js Normal file
View File

View File

@@ -22,7 +22,7 @@ export function strip (input) {
.replace(/\[(.*?)\][\[\(].*?[\]\)]/g, '$1') .replace(/\[(.*?)\][\[\(].*?[\]\)]/g, '$1')
.replace(/>/g, '') .replace(/>/g, '')
.replace(/^\s{1,2}\[(.*?)\]: (\S+)( ".*?")?\s*$/g, '') .replace(/^\s{1,2}\[(.*?)\]: (\S+)( ".*?")?\s*$/g, '')
.replace(/^#{1,6}\s*([^#]*)\s*(#{1,6})?/gm, '$1') .replace(/^#{1,6}\s*/gm, '')
.replace(/(`{3,})(.*?)\1/gm, '$2') .replace(/(`{3,})(.*?)\1/gm, '$2')
.replace(/^-{3,}\s*$/g, '') .replace(/^-{3,}\s*$/g, '')
.replace(/`(.+?)`/g, '$1') .replace(/`(.+?)`/g, '$1')

80
browser/lib/newNote.js Normal file
View File

@@ -0,0 +1,80 @@
import { hashHistory } from 'react-router'
import dataApi from 'browser/main/lib/dataApi'
import ee from 'browser/main/lib/eventEmitter'
import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
export function createMarkdownNote (storage, folder, dispatch, location, params, config) {
AwsMobileAnalyticsConfig.recordDynamicCustomEvent('ADD_MARKDOWN')
AwsMobileAnalyticsConfig.recordDynamicCustomEvent('ADD_ALLNOTE')
let tags = []
if (config.ui.tagNewNoteWithFilteringTags && location.pathname.match(/\/tags/)) {
tags = params.tagname.split(' ')
}
return dataApi
.createNote(storage, {
type: 'MARKDOWN_NOTE',
folder: folder,
title: '',
tags,
content: '',
linesHighlighted: []
})
.then(note => {
const noteHash = note.key
dispatch({
type: 'UPDATE_NOTE',
note: note
})
hashHistory.push({
pathname: location.pathname,
query: { key: noteHash }
})
ee.emit('list:jump', noteHash)
ee.emit('detail:focus')
})
}
export function createSnippetNote (storage, folder, dispatch, location, params, config) {
AwsMobileAnalyticsConfig.recordDynamicCustomEvent('ADD_SNIPPET')
AwsMobileAnalyticsConfig.recordDynamicCustomEvent('ADD_ALLNOTE')
let tags = []
if (config.ui.tagNewNoteWithFilteringTags && location.pathname.match(/\/tags/)) {
tags = params.tagname.split(' ')
}
const defaultLanguage = config.editor.snippetDefaultLanguage === 'Auto Detect' ? null : config.editor.snippetDefaultLanguage
return dataApi
.createNote(storage, {
type: 'SNIPPET_NOTE',
folder: folder,
title: '',
tags,
description: '',
snippets: [
{
name: '',
mode: defaultLanguage,
content: '',
linesHighlighted: []
}
]
})
.then(note => {
const noteHash = note.key
dispatch({
type: 'UPDATE_NOTE',
note: note
})
hashHistory.push({
pathname: location.pathname,
query: { key: noteHash }
})
ee.emit('list:jump', noteHash)
ee.emit('detail:focus')
})
}

View File

@@ -0,0 +1,9 @@
import consts from 'browser/lib/consts'
import isString from 'lodash/isString'
export default function normalizeEditorFontFamily (fontFamily) {
const defaultEditorFontFamily = consts.DEFAULT_EDITOR_FONT_FAMILY
return isString(fontFamily) && fontFamily.length > 0
? [fontFamily].concat(defaultEditorFontFamily).join(', ')
: defaultEditorFontFamily.join(', ')
}

View File

@@ -4,39 +4,30 @@ export default function searchFromNotes (notes, search) {
if (search.trim().length === 0) return [] if (search.trim().length === 0) return []
const searchBlocks = search.split(' ').filter(block => { return block !== '' }) const searchBlocks = search.split(' ').filter(block => { return block !== '' })
let foundNotes = findByWord(notes, searchBlocks[0]) let foundNotes = notes
searchBlocks.forEach((block) => { searchBlocks.forEach((block) => {
foundNotes = findByWord(foundNotes, block) foundNotes = findByWordOrTag(foundNotes, block)
if (block.match(/^#.+/)) {
foundNotes = foundNotes.concat(findByTag(notes, block))
}
}) })
return foundNotes return foundNotes
} }
function findByTag (notes, block) { function findByWordOrTag (notes, block) {
const tag = block.match(/#(.+)/)[1] let tag = block
let regExp = new RegExp(_.escapeRegExp(tag), 'i') if (tag.match(/^#.+/)) {
tag = tag.match(/#(.+)/)[1]
}
const tagRegExp = new RegExp(_.escapeRegExp(tag), 'i')
const wordRegExp = new RegExp(_.escapeRegExp(block), 'i')
return notes.filter((note) => { return notes.filter((note) => {
if (!_.isArray(note.tags)) return false if (_.isArray(note.tags) && note.tags.some((_tag) => _tag.match(tagRegExp))) {
return note.tags.some((_tag) => {
return _tag.match(regExp)
})
})
}
function findByWord (notes, block) {
let regExp = new RegExp(_.escapeRegExp(block), 'i')
return notes.filter((note) => {
if (_.isArray(note.tags) && note.tags.some((_tag) => {
return _tag.match(regExp)
})) {
return true return true
} }
if (note.type === 'SNIPPET_NOTE') { if (note.type === 'SNIPPET_NOTE') {
return note.description.match(regExp) return note.description.match(wordRegExp) || note.snippets.some((snippet) => {
return snippet.name.match(wordRegExp) || snippet.content.match(wordRegExp)
})
} else if (note.type === 'MARKDOWN_NOTE') { } else if (note.type === 'MARKDOWN_NOTE') {
return note.content.match(regExp) return note.content.match(wordRegExp)
} }
return false return false
}) })

17
browser/lib/slugify.js Normal file
View File

@@ -0,0 +1,17 @@
import diacritics from 'diacritics-map'
function replaceDiacritics (str) {
return str.replace(/[À-ž]/g, function (ch) {
return diacritics[ch] || ch
})
}
module.exports = function slugify (title) {
let slug = title.trim()
slug = replaceDiacritics(slug)
slug = slug.replace(/[^\w\s-]/g, '').replace(/\s+/g, '-')
return encodeURI(slug).replace(/\-+$/, '')
}

232
browser/lib/spellcheck.js Normal file
View File

@@ -0,0 +1,232 @@
import styles from '../components/CodeEditor.styl'
import i18n from 'browser/lib/i18n'
const Typo = require('typo-js')
const _ = require('lodash')
const CSS_ERROR_CLASS = 'codeEditor-typo'
const SPELLCHECK_DISABLED = 'NONE'
const DICTIONARY_PATH = '../dictionaries'
const MILLISECONDS_TILL_LIVECHECK = 500
let dictionary = null
let self
function getAvailableDictionaries () {
return [
{label: i18n.__('Disabled'), value: SPELLCHECK_DISABLED},
{label: i18n.__('English'), value: 'en_GB'},
{label: i18n.__('German'), value: 'de_DE'},
{label: i18n.__('French'), value: 'fr_FR'}
]
}
/**
* Only to be used in the tests :)
*/
function setDictionaryForTestsOnly (newDictionary) {
dictionary = newDictionary
}
/**
* @description Initializes the spellcheck. It removes all existing marks of the current editor.
* If a language was given (i.e. lang !== this.SPELLCHECK_DISABLED) it will load the stated dictionary and use it to check the whole document.
* @param {Codemirror} editor CodeMirror-Editor
* @param {String} lang on of the values from getAvailableDictionaries()-Method
*/
function setLanguage (editor, lang) {
self = this
dictionary = null
if (editor == null) {
return
}
const existingMarks = editor.getAllMarks() || []
for (const mark of existingMarks) {
mark.clear()
}
if (lang !== SPELLCHECK_DISABLED) {
dictionary = new Typo(lang, false, false, {
dictionaryPath: DICTIONARY_PATH,
asyncLoad: true,
loadedCallback: () =>
checkWholeDocument(editor)
})
}
}
/**
* Checks the whole content of the editor for typos
* @param {Codemirror} editor CodeMirror-Editor
*/
function checkWholeDocument (editor) {
const lastLine = editor.lineCount() - 1
const textOfLastLine = editor.getLine(lastLine) || ''
const lastChar = textOfLastLine.length
const from = {line: 0, ch: 0}
const to = {line: lastLine, ch: lastChar}
checkMultiLineRange(editor, from, to)
}
/**
* Checks the given range for typos
* @param {Codemirror} editor CodeMirror-Editor
* @param {line, ch} from starting position of the spellcheck
* @param {line, ch} to end position of the spellcheck
*/
function checkMultiLineRange (editor, from, to) {
function sortRange (pos1, pos2) {
if (pos1.line > pos2.line || (pos1.line === pos2.line && pos1.ch > pos2.ch)) {
return {from: pos2, to: pos1}
}
return {from: pos1, to: pos2}
}
const {from: smallerPos, to: higherPos} = sortRange(from, to)
for (let l = smallerPos.line; l <= higherPos.line; l++) {
const line = editor.getLine(l) || ''
let w = 0
if (l === smallerPos.line) {
w = smallerPos.ch
}
let wEnd = line.length
if (l === higherPos.line) {
wEnd = higherPos.ch
}
while (w <= wEnd) {
const wordRange = editor.findWordAt({line: l, ch: w})
self.checkWord(editor, wordRange)
w += (wordRange.head.ch - wordRange.anchor.ch) + 1
}
}
}
/**
* @description Checks whether a certain range of characters in the editor (i.e. a word) contains a typo.
* If so the ranged will be marked with the class CSS_ERROR_CLASS.
* Note: Due to performance considerations, only words with more then 3 signs are checked.
* @param {Codemirror} editor CodeMirror-Editor
* @param wordRange Object specifying the range that should be checked.
* Having the following structure: <code>{anchor: {line: integer, ch: integer}, head: {line: integer, ch: integer}}</code>
*/
function checkWord (editor, wordRange) {
const word = editor.getRange(wordRange.anchor, wordRange.head)
if (word == null || word.length <= 3) {
return
}
if (!dictionary.check(word)) {
editor.markText(wordRange.anchor, wordRange.head, {className: styles[CSS_ERROR_CLASS]})
}
}
/**
* Checks the changes recently made (aka live check)
* @param {Codemirror} editor CodeMirror-Editor
* @param fromChangeObject codeMirror changeObject describing the start of the editing
* @param toChangeObject codeMirror changeObject describing the end of the editing
*/
function checkChangeRange (editor, fromChangeObject, toChangeObject) {
/**
* Calculate the smallest respectively largest position as a start, resp. end, position and return it
* @param start CodeMirror change object
* @param end CodeMirror change object
* @returns {{start: {line: *, ch: *}, end: {line: *, ch: *}}}
*/
function getStartAndEnd (start, end) {
const possiblePositions = [start.from, start.to, end.from, end.to]
let smallest = start.from
let biggest = end.to
for (const currentPos of possiblePositions) {
if (currentPos.line < smallest.line || (currentPos.line === smallest.line && currentPos.ch < smallest.ch)) {
smallest = currentPos
}
if (currentPos.line > biggest.line || (currentPos.line === biggest.line && currentPos.ch > biggest.ch)) {
biggest = currentPos
}
}
return {start: smallest, end: biggest}
}
if (dictionary === null || editor == null) { return }
try {
const {start, end} = getStartAndEnd(fromChangeObject, toChangeObject)
// Expand the range to include words after/before whitespaces
start.ch = Math.max(start.ch - 1, 0)
end.ch = end.ch + 1
// clean existing marks
const existingMarks = editor.findMarks(start, end) || []
for (const mark of existingMarks) {
mark.clear()
}
self.checkMultiLineRange(editor, start, end)
} catch (e) {
console.info('Error during the spell check. It might be due to problems figuring out the range of the new text..', e)
}
}
function saveLiveSpellCheckFrom (changeObject) {
liveSpellCheckFrom = changeObject
}
let liveSpellCheckFrom
const debouncedSpellCheckLeading = _.debounce(saveLiveSpellCheckFrom, MILLISECONDS_TILL_LIVECHECK, {
'leading': true,
'trailing': false
})
const debouncedSpellCheck = _.debounce(checkChangeRange, MILLISECONDS_TILL_LIVECHECK, {
'leading': false,
'trailing': true
})
/**
* Handles a keystroke. Buffers the input and performs a live spell check after a certain time. Uses _debounce from lodash to buffer the input
* @param {Codemirror} editor CodeMirror-Editor
* @param changeObject codeMirror changeObject
*/
function handleChange (editor, changeObject) {
if (dictionary === null) {
return
}
debouncedSpellCheckLeading(changeObject)
debouncedSpellCheck(editor, liveSpellCheckFrom, changeObject)
}
/**
* Returns an array of spelling suggestions for the given (wrong written) word.
* Returns an empty array if the dictionary is null (=> spellcheck is disabled) or the given word was null
* @param word word to be checked
* @returns {String[]} Array of suggestions
*/
function getSpellingSuggestion (word) {
if (dictionary == null || word == null) {
return []
}
return dictionary.suggest(word)
}
/**
* Returns the name of the CSS class used for errors
*/
function getCSSClassName () {
return styles[CSS_ERROR_CLASS]
}
module.exports = {
DICTIONARY_PATH,
CSS_ERROR_CLASS,
SPELLCHECK_DISABLED,
getAvailableDictionaries,
setLanguage,
checkChangeRange,
handleChange,
getSpellingSuggestion,
checkWord,
checkMultiLineRange,
checkWholeDocument,
setDictionaryForTestsOnly,
getCSSClassName
}

139
browser/lib/utils.js Normal file
View File

@@ -0,0 +1,139 @@
export function lastFindInArray (array, callback) {
for (let i = array.length - 1; i >= 0; --i) {
if (callback(array[i], i, array)) {
return array[i]
}
}
}
export function escapeHtmlCharacters (
html,
opt = { detectCodeBlock: false, skipSingleQuote: false }
) {
const matchHtmlRegExp = /["'&<>]/g
const matchCodeBlockRegExp = /```/g
const escapes = ['&quot;', '&amp;', '&#39;', '&lt;', '&gt;']
let match = null
const replaceAt = (str, index, replace) =>
str.substr(0, index) +
replace +
str.substr(index + replace.length - (replace.length - 1))
while ((match = matchHtmlRegExp.exec(html)) !== null) {
const current = { char: match[0], index: match.index }
const codeBlockIndexs = []
let openCodeBlock = null
// if the detectCodeBlock option is activated then this function should skip
// characters that needed to be escape but located in code block
if (opt.detectCodeBlock) {
// The first type of code block is lines that start with 4 spaces
// Here we check for the \n character located before the character that
// needed to be escape. It means we check for the begining of the line that
// contain that character, then we check if there are 4 spaces next to the
// \n character (the line start with 4 spaces)
let previousLineEnd = current.index - 1
while (html[previousLineEnd] !== '\n' && previousLineEnd !== -1) {
previousLineEnd--
}
// 4 spaces means this character is in a code block
if (
html[previousLineEnd + 1] === ' ' &&
html[previousLineEnd + 2] === ' ' &&
html[previousLineEnd + 3] === ' ' &&
html[previousLineEnd + 4] === ' '
) {
// skip the current character
continue
}
// The second type of code block is lines that wrapped in ```
// We will get the position of each ```
// then push it into an array
// then the array returned will be like this:
// [startCodeblock, endCodeBlock, startCodeBlock, endCodeBlock]
while ((openCodeBlock = matchCodeBlockRegExp.exec(html)) !== null) {
codeBlockIndexs.push(openCodeBlock.index)
}
let shouldSkipChar = false
// we loop through the array of positions
// we skip 2 element as the i index position is the position of ``` that
// open the codeblock and the i + 1 is the position of the ``` that close
// the code block
for (let i = 0; i < codeBlockIndexs.length; i += 2) {
// the i index position is the position of the ``` that open code block
// so we have to + 2 as that position is the position of the first ` in the ````
// but we need to make sure that the position current character is larger
// that the last ` in the ``` that open the code block so we have to take
// the position of the first ` and + 2
// the i + 1 index position is the closing ``` so the char must less than it
if (
current.index > codeBlockIndexs[i] + 2 &&
current.index < codeBlockIndexs[i + 1]
) {
// skip it
shouldSkipChar = true
break
}
}
if (shouldSkipChar) {
// skip the current character
continue
}
}
// otherwise, escape it !!!
if (current.char === '&') {
// when escaping character & we have to be becareful as the & could be a part
// of an escaped character like &quot; will be came &amp;quot;
let nextStr = ''
let nextIndex = current.index
let escapedStr = false
// maximum length of an escaped string is 5. For example ('&quot;')
// we take the next 5 character of the next string if it is one of the string:
// ['&quot;', '&amp;', '&#39;', '&lt;', '&gt;'] then we will not escape the & character
// as it is a part of the escaped string and should not be escaped
while (nextStr.length <= 5) {
nextStr += html[nextIndex]
nextIndex++
if (escapes.indexOf(nextStr) !== -1) {
escapedStr = true
break
}
}
if (!escapedStr) {
// this & char is not a part of an escaped string
html = replaceAt(html, current.index, '&amp;')
}
} else if (current.char === '"') {
html = replaceAt(html, current.index, '&quot;')
} else if (current.char === "'" && !opt.skipSingleQuote) {
html = replaceAt(html, current.index, '&#39;')
} else if (current.char === '<') {
html = replaceAt(html, current.index, '&lt;')
} else if (current.char === '>') {
html = replaceAt(html, current.index, '&gt;')
}
}
return html
}
export function isObjectEqual (a, b) {
const aProps = Object.getOwnPropertyNames(a)
const bProps = Object.getOwnPropertyNames(b)
if (aProps.length !== bProps.length) {
return false
}
for (var i = 0; i < aProps.length; i++) {
const propName = aProps[i]
if (a[propName] !== b[propName]) {
return false
}
}
return true
}
export default {
lastFindInArray,
escapeHtmlCharacters,
isObjectEqual
}

View File

@@ -20,5 +20,27 @@
body[data-theme="dark"] body[data-theme="dark"]
.root .root
background-color $ui-dark-backgroundColor background-color $ui-dark-backgroundColor
border-left 1px solid $ui-dark-borderColor
.empty-message .empty-message
color $ui-dark-inactive-text-color color $ui-dark-inactive-text-color
body[data-theme="solarized-dark"]
.root
background-color $ui-solarized-dark-noteDetail-backgroundColor
border-left 1px solid $ui-solarized-dark-borderColor
.empty-message
color $ui-solarized-dark-text-color
body[data-theme="monokai"]
.root
background-color $ui-monokai-noteDetail-backgroundColor
border-left 1px solid $ui-monokai-borderColor
.empty-message
color $ui-monokai-text-color
body[data-theme="dracula"]
.root
background-color $ui-dracula-noteDetail-backgroundColor
border-left 1px solid $ui-dracula-borderColor
.empty-message
color $ui-dracula-text-color

View File

@@ -1,7 +1,9 @@
import React, { PropTypes } from 'react' import PropTypes from 'prop-types'
import React from 'react'
import CSSModules from 'browser/lib/CSSModules' import CSSModules from 'browser/lib/CSSModules'
import styles from './FolderSelect.styl' import styles from './FolderSelect.styl'
import _ from 'lodash' import _ from 'lodash'
import i18n from 'browser/lib/i18n'
class FolderSelect extends React.Component { class FolderSelect extends React.Component {
constructor (props) { constructor (props) {
@@ -73,8 +75,8 @@ class FolderSelect extends React.Component {
case 9: case 9:
if (e.shiftKey) { if (e.shiftKey) {
e.preventDefault() e.preventDefault()
let tabbable = document.querySelectorAll('a:not([disabled]), button:not([disabled]), input[type=text]:not([disabled]), [tabindex]:not([disabled]):not([tabindex="-1"])') const tabbable = document.querySelectorAll('a:not([disabled]), button:not([disabled]), input[type=text]:not([disabled]), [tabindex]:not([disabled]):not([tabindex="-1"])')
let previousEl = tabbable[Array.prototype.indexOf.call(tabbable, this.refs.root) - 1] const previousEl = tabbable[Array.prototype.indexOf.call(tabbable, this.refs.root) - 1]
if (previousEl != null) previousEl.focus() if (previousEl != null) previousEl.focus()
} }
} }
@@ -89,9 +91,9 @@ class FolderSelect extends React.Component {
} }
handleSearchInputChange (e) { handleSearchInputChange (e) {
let { folders } = this.props const { folders } = this.props
let search = this.refs.search.value const search = this.refs.search.value
let optionIndex = search.length > 0 const optionIndex = search.length > 0
? _.findIndex(folders, (folder) => { ? _.findIndex(folders, (folder) => {
return folder.name.match(new RegExp('^' + _.escapeRegExp(search), 'i')) return folder.name.match(new RegExp('^' + _.escapeRegExp(search), 'i'))
}) })
@@ -129,7 +131,7 @@ class FolderSelect extends React.Component {
nextOption () { nextOption () {
let { optionIndex } = this.state let { optionIndex } = this.state
let { folders } = this.props const { folders } = this.props
optionIndex++ optionIndex++
if (optionIndex >= folders.length) optionIndex = 0 if (optionIndex >= folders.length) optionIndex = 0
@@ -140,7 +142,7 @@ class FolderSelect extends React.Component {
} }
previousOption () { previousOption () {
let { folders } = this.props const { folders } = this.props
let { optionIndex } = this.state let { optionIndex } = this.state
optionIndex-- optionIndex--
@@ -152,10 +154,10 @@ class FolderSelect extends React.Component {
} }
selectOption () { selectOption () {
let { folders } = this.props const { folders } = this.props
let optionIndex = this.state.optionIndex const optionIndex = this.state.optionIndex
let folder = folders[optionIndex] const folder = folders[optionIndex]
if (folder != null) { if (folder != null) {
this.setState({ this.setState({
status: 'FOCUS' status: 'FOCUS'
@@ -184,10 +186,10 @@ class FolderSelect extends React.Component {
} }
render () { render () {
let { className, data, value } = this.props const { className, data, value } = this.props
let splitted = value.split('-') const splitted = value.split('-')
let storageKey = splitted.shift() const storageKey = splitted.shift()
let folderKey = splitted.shift() const folderKey = splitted.shift()
let options = [] let options = []
data.storageMap.forEach((storage, index) => { data.storageMap.forEach((storage, index) => {
storage.folders.forEach((folder) => { storage.folders.forEach((folder) => {
@@ -198,14 +200,14 @@ class FolderSelect extends React.Component {
}) })
}) })
let currentOption = options.filter((option) => option.storage.key === storageKey && option.folder.key === folderKey)[0] const currentOption = options.filter((option) => option.storage.key === storageKey && option.folder.key === folderKey)[0]
if (this.state.search.trim().length > 0) { if (this.state.search.trim().length > 0) {
let filter = new RegExp('^' + _.escapeRegExp(this.state.search), 'i') const filter = new RegExp('^' + _.escapeRegExp(this.state.search), 'i')
options = options.filter((option) => filter.test(option.folder.name)) options = options.filter((option) => filter.test(option.folder.name))
} }
let optionList = options const optionList = options
.map((option, index) => { .map((option, index) => {
return ( return (
<div styleName={index === this.state.optionIndex <div styleName={index === this.state.optionIndex
@@ -248,7 +250,7 @@ class FolderSelect extends React.Component {
<input styleName='search-input' <input styleName='search-input'
ref='search' ref='search'
value={this.state.search} value={this.state.search}
placeholder='Folder...' placeholder={i18n.__('Folder...')}
onChange={(e) => this.handleSearchInputChange(e)} onChange={(e) => this.handleSearchInputChange(e)}
onBlur={(e) => this.handleSearchInputBlur(e)} onBlur={(e) => this.handleSearchInputBlur(e)}
onKeyDown={(e) => this.handleSearchInputKeyDown(e)} onKeyDown={(e) => this.handleSearchInputKeyDown(e)}

View File

@@ -3,20 +3,14 @@
border solid 1px transparent border solid 1px transparent
vertical-align middle vertical-align middle
border-radius 2px border-radius 2px
height 30px
transition 0.15s transition 0.15s
user-select none user-select none
margin-right 10px margin-right 10px
&:hover
background-color $ui-button--hover-backgroundColor
.root--search, .root--focus .root--search, .root--focus
@extend .root @extend .root
background-color $ui-noteDetail-backgroundColor = #fff
border-color $ui-input--focus-borderColor border-color $ui-input--focus-borderColor
width 154px
height 30px
&:hover
border-color $ui-input--focus-borderColor = #fff
.idle .idle
position relative position relative
@@ -42,7 +36,7 @@
height 34px height 34px
width 20px width 20px
line-height 34px line-height 34px
.search-input .search-input
vertical-align middle vertical-align middle
position relative position relative
@@ -77,7 +71,7 @@
overflow ellipsis overflow ellipsis
cursor pointer cursor pointer
&:hover &:hover
background-color $ui-button--hover-backgroundColor background-color $ui-button--hover-backgroundColor
.search-optionList-item--active .search-optionList-item--active
@extend .search-optionList-item @extend .search-optionList-item
@@ -139,3 +133,55 @@ body[data-theme="dark"]
color $ui-dark-button--active-color color $ui-dark-button--active-color
.search-optionList-item-name-surfix .search-optionList-item-name-surfix
color $ui-dark-inactive-text-color color $ui-dark-inactive-text-color
body[data-theme="monokai"]
.root
color $ui-dark-text-color
&:hover
color white
background-color $ui-monokai-button--hover-backgroundColor
border-color $ui-monokai-borderColor
.search-optionList
color white
border-color $ui-monokai-borderColor
background-color $ui-monokai-button-backgroundColor
.search-optionList-item
&:hover
background-color lighten($ui-monokai-button--hover-backgroundColor, 15%)
.search-optionList-item--active
background-color $ui-monokai-button--active-backgroundColor
color $ui-monokai-button--active-color
&:hover
background-color $ui-monokai-button--active-backgroundColor
color $ui-monokai-button--active-color
.search-optionList-item-name-surfix
color $ui-monokai-inactive-text-color
body[data-theme="dracula"]
.root
color $ui-dracula-text-color
&:hover
color #f8f8f2
background-color $ui-dark-button--hover-backgroundColor
border-color $ui-dracula-borderColor
.search-optionList
color #f8f8f2
border-color $ui-dracula-borderColor
background-color $ui-dracula-button-backgroundColor
.search-optionList-item
&:hover
background-color lighten($ui-dracula-button--hover-backgroundColor, 15%)
.search-optionList-item--active
background-color $ui-dracula-button--active-backgroundColor
color $ui-dracula-button--active-color
&:hover
background-color $ui-dark-button--hover-backgroundColor
color $ui-dracula-button--active-color
.search-optionList-item-name-surfix
color $ui-dracula-inactive-text-color

View File

@@ -0,0 +1,24 @@
import PropTypes from 'prop-types'
import React from 'react'
import CSSModules from 'browser/lib/CSSModules'
import styles from './FullscreenButton.styl'
import i18n from 'browser/lib/i18n'
const OSX = global.process.platform === 'darwin'
const FullscreenButton = ({
onClick
}) => {
const hotkey = (OSX ? i18n.__('Command(⌘)') : i18n.__('Ctrl(^)')) + '+B'
return (
<button styleName='control-fullScreenButton' title={i18n.__('Fullscreen')} onMouseDown={(e) => onClick(e)}>
<img styleName='iconInfo' src='../resources/icon/icon-full.svg' />
<span lang={i18n.locale} styleName='tooltip'>{i18n.__('Fullscreen')}({hotkey})</span>
</button>
)
}
FullscreenButton.propTypes = {
onClick: PropTypes.func.isRequired
}
export default CSSModules(FullscreenButton, styles)

View File

@@ -0,0 +1,26 @@
.control-fullScreenButton
top 80px
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
.tooltip:lang(ja)
@extend .tooltip
right 35px
body[data-theme="dark"]
.control-fullScreenButton
topBarButtonDark()

View File

@@ -1,6 +1,8 @@
import React, { PropTypes } from 'react' import PropTypes from 'prop-types'
import React from 'react'
import CSSModules from 'browser/lib/CSSModules' import CSSModules from 'browser/lib/CSSModules'
import styles from './InfoButton.styl' import styles from './InfoButton.styl'
import i18n from 'browser/lib/i18n'
const InfoButton = ({ const InfoButton = ({
onClick onClick
@@ -9,6 +11,7 @@ const InfoButton = ({
onClick={(e) => onClick(e)} onClick={(e) => onClick(e)}
> >
<img className='infoButton' src='../resources/icon/icon-info.svg' /> <img className='infoButton' src='../resources/icon/icon-info.svg' />
<span styleName='tooltip'>{i18n.__('Info')}</span>
</button> </button>
) )

View File

@@ -1,7 +1,21 @@
.control-infoButton .control-infoButton
top 10px top 10px
margin-bottom 10px topBarButtonRight()
topBarButtonLight() &:hover .tooltip
opacity 1
.tooltip
tooltip()
position absolute
pointer-events none
top 50px
right 20px
z-index 200
padding 5px
line-height normal
border-radius 2px
opacity 0
transition 0.1s
.infoButton .infoButton
padding 0px padding 0px

View File

@@ -1,77 +1,99 @@
import React, { PropTypes } from 'react' import PropTypes from 'prop-types'
import React from 'react'
import CSSModules from 'browser/lib/CSSModules' import CSSModules from 'browser/lib/CSSModules'
import styles from './InfoPanel.styl' import styles from './InfoPanel.styl'
import copy from 'copy-to-clipboard'
import i18n from 'browser/lib/i18n'
const InfoPanel = ({ class InfoPanel extends React.Component {
storageName, folderName, noteLink, updatedAt, createdAt, exportAsMd, exportAsTxt, wordCount, letterCount, type, print copyNoteLink () {
}) => ( const {noteLink} = this.props
<div className='infoPanel' styleName='control-infoButton-panel' style={{display: 'none'}}> this.refs.noteLink.select()
<div> copy(noteLink)
<p styleName='modification-date'>{updatedAt}</p> }
<p styleName='modification-date-desc'>MODIFICATION DATE</p>
</div>
<hr /> render () {
const {
{type === 'SNIPPET_NOTE' storageName, folderName, noteLink, updatedAt, createdAt, exportAsMd, exportAsTxt, exportAsHtml, wordCount, letterCount, type, print
? '' } = this.props
: <div styleName='count-wrap'> return (
<div styleName='count-number'> <div className='infoPanel' styleName='control-infoButton-panel' style={{display: 'none'}}>
<p styleName='infoPanel-defaul-count'>{wordCount}</p> <div>
<p styleName='infoPanel-sub-count'>Words</p> <p styleName='modification-date'>{updatedAt}</p>
<p styleName='modification-date-desc'>{i18n.__('MODIFICATION DATE')}</p>
</div> </div>
<div styleName='count-number'>
<p styleName='infoPanel-defaul-count'>{letterCount}</p> <hr />
<p styleName='infoPanel-sub-count'>Letters</p>
{type === 'SNIPPET_NOTE'
? ''
: <div styleName='count-wrap'>
<div styleName='count-number'>
<p styleName='infoPanel-defaul-count'>{wordCount}</p>
<p styleName='infoPanel-sub-count'>{i18n.__('Words')}</p>
</div>
<div styleName='count-number'>
<p styleName='infoPanel-defaul-count'>{letterCount}</p>
<p styleName='infoPanel-sub-count'>{i18n.__('Letters')}</p>
</div>
</div>
}
{type === 'SNIPPET_NOTE'
? ''
: <hr />
}
<div>
<p styleName='infoPanel-default'>{storageName}</p>
<p styleName='infoPanel-sub'>{i18n.__('STORAGE')}</p>
</div>
<div>
<p styleName='infoPanel-default'>{folderName}</p>
<p styleName='infoPanel-sub'>{i18n.__('FOLDER')}</p>
</div>
<div>
<p styleName='infoPanel-default'>{createdAt}</p>
<p styleName='infoPanel-sub'>{i18n.__('CREATION DATE')}</p>
</div>
<div>
<input styleName='infoPanel-noteLink' ref='noteLink' value={noteLink} onClick={(e) => { e.target.select() }} />
<button onClick={() => this.copyNoteLink()} styleName='infoPanel-copyButton'>
<i className='fa fa-clipboard' />
</button>
<p styleName='infoPanel-sub'>{i18n.__('NOTE LINK')}</p>
</div>
<hr />
<div id='export-wrap'>
<button styleName='export--enable' onClick={(e) => exportAsMd(e, 'export-md')}>
<i className='fa fa-file-code-o' />
<p>{i18n.__('.md')}</p>
</button>
<button styleName='export--enable' onClick={(e) => exportAsTxt(e, 'export-txt')}>
<i className='fa fa-file-text-o' />
<p>{i18n.__('.txt')}</p>
</button>
<button styleName='export--enable' onClick={(e) => exportAsHtml(e, 'export-html')}>
<i className='fa fa-html5' />
<p>{i18n.__('.html')}</p>
</button>
<button styleName='export--enable' onClick={(e) => print(e, 'print')}>
<i className='fa fa-print' />
<p>{i18n.__('Print')}</p>
</button>
</div> </div>
</div> </div>
} )
}
{type === 'SNIPPET_NOTE' }
? ''
: <hr />
}
<div>
<p styleName='infoPanel-default'>{storageName}</p>
<p styleName='infoPanel-sub'>STORAGE</p>
</div>
<div>
<p styleName='infoPanel-default'>{folderName}</p>
<p styleName='infoPanel-sub'>FOLDER</p>
</div>
<div>
<p styleName='infoPanel-default'>{createdAt}</p>
<p styleName='infoPanel-sub'>CREATION DATE</p>
</div>
<div>
<input styleName='infoPanel-noteLink' value={noteLink} onClick={(e) => { e.target.select() }} />
<p styleName='infoPanel-sub'>NOTE LINK</p>
</div>
<hr />
<div id='export-wrap'>
<button styleName='export--enable' onClick={(e) => exportAsMd(e)}>
<i className='fa fa-file-code-o fa-fw' />
<p>.md</p>
</button>
<button styleName='export--enable' onClick={(e) => exportAsTxt(e)}>
<i className='fa fa-file-text-o fa-fw' />
<p>.txt</p>
</button>
<button styleName='export--enable' onClick={(e) => print(e)}>
<i className='fa fa-print fa-fw' />
<p>Print</p>
</button>
</div>
</div>
)
InfoPanel.propTypes = { InfoPanel.propTypes = {
storageName: PropTypes.string.isRequired, storageName: PropTypes.string.isRequired,
@@ -81,6 +103,7 @@ InfoPanel.propTypes = {
createdAt: PropTypes.string.isRequired, createdAt: PropTypes.string.isRequired,
exportAsMd: PropTypes.func.isRequired, exportAsMd: PropTypes.func.isRequired,
exportAsTxt: PropTypes.func.isRequired, exportAsTxt: PropTypes.func.isRequired,
exportAsHtml: PropTypes.func.isRequired,
wordCount: PropTypes.number, wordCount: PropTypes.number,
letterCount: PropTypes.number, letterCount: PropTypes.number,
type: PropTypes.string.isRequired, type: PropTypes.string.isRequired,

View File

@@ -11,11 +11,11 @@
.control-infoButton-panel .control-infoButton-panel
z-index 200 z-index 200
margin-top 0px margin-top 0px
right 0 top: 50px
right 25px
position absolute position absolute
padding 20px 25px 0 25px padding 20px 25px 0 25px
width 300px width 300px
height 350px
overflow auto overflow auto
background-color $ui-noteList-backgroundColor background-color $ui-noteList-backgroundColor
box-shadow 2px 12px 15px 2px rgba(0, 0, 0, 0.1), 2px 1px 50px 2px rgba(0, 0, 0, 0.1) box-shadow 2px 12px 15px 2px rgba(0, 0, 0, 0.1), 2px 1px 50px 2px rgba(0, 0, 0, 0.1)
@@ -33,6 +33,7 @@
.control-infoButton-panel-trash .control-infoButton-panel-trash
z-index 200 z-index 200
margin-top 0px margin-top 0px
top 50px
right 0px right 0px
position absolute position absolute
padding 20px 25px 0 25px padding 20px 25px 0 25px
@@ -41,12 +42,12 @@
box-shadow 2px 12px 15px 2px rgba(0, 0, 0, 0.1), 2px 1px 50px 2px rgba(0, 0, 0, 0.1) box-shadow 2px 12px 15px 2px rgba(0, 0, 0, 0.1), 2px 1px 50px 2px rgba(0, 0, 0, 0.1)
border-radius 2px border-radius 2px
.count-wrap .count-wrap
display flex display flex
position relative position relative
width 100% width 100%
.count-number .count-number
position relative position relative
display block display block
width 50% width 50%
@@ -70,26 +71,41 @@
color $ui-text-color color $ui-text-color
.infoPanel-sub .infoPanel-sub
font-size 14px font-size 12px
font-weight 600
color $ui-inactive-text-color color $ui-inactive-text-color
padding-bottom 8px padding-bottom 8px
.infoPanel-noteLink .infoPanel-noteLink
padding-right 5px padding-right 5px
width 200px width 210px
height 25px height 25px
margin-bottom 6px margin 6px 0
.infoPanel-copyButton
outline none
font-size 16px
color #A0A0A0
background-color transparent
border none
margin 0 5px
border-radius 5px
cursor pointer
&:hover
transition 0.2s
background-color alpha($ui-button--hover-backgroundColor, 30%)
color $ui-inactive-text-color
.infoPanel-trash .infoPanel-trash
color #EA4447 color #EA4447
font-weight 600 font-weight 600
font-size 14px font-size 14px
width 70px width 70px
background-color rgba(226,33,113,0.1) background-color rgba(226,33,113,0.1)
border none border none
outline none outline none
border-radius 2px border-radius 2px
margin-right 5px margin-right 5px
padding 2px 5px padding 2px 5px
[id=export-wrap] [id=export-wrap]
@@ -160,4 +176,124 @@ body[data-theme="dark"]
p p
color $ui-dark-inactive-text-color color $ui-dark-inactive-text-color
&:hover &:hover
color $ui-dark-text-color color $ui-dark-text-color
body[data-theme="solarized-dark"]
.control-infoButton-panel
background-color $ui-solarized-dark-noteList-backgroundColor
.control-infoButton-panel-trash
background-color $ui-solarized-ark-noteList-backgroundColor
.modification-date
color $ui-solarized-ark-text-color
.modification-date-desc
color $ui-inactive-text-color
.infoPanel-defaul-count
color $ui-solarized-dark-text-color
.infoPanel-sub-count
color $ui-inactive-text-color
.infoPanel-default
color $ui-solarized-ark-text-color
.infoPanel-sub
color $ui-inactive-text-color
.infoPanel-noteLink
background-color alpha($ui-solarized-dark-borderColor, 20%)
color $ui-solarized-dark-text-color
[id=export-wrap]
button
color $ui-dark-inactive-text-color
&:hover
background-color alpha($ui-solarized-dark-borderColor, 20%)
color $ui-solarized-ark-text-color
p
color $ui-dark-inactive-text-color
&:hover
color $ui-solarized-ark-text-color
body[data-theme="monokai"]
.control-infoButton-panel
background-color $ui-monokai-noteList-backgroundColor
.control-infoButton-panel-trash
background-color $ui-monokai-noteList-backgroundColor
.modification-date
color $ui-monokai-text-color
.modification-date-desc
color $ui-inactive-text-color
.infoPanel-defaul-count
color $ui-monokai-text-color
.infoPanel-sub-count
color $ui-inactive-text-color
.infoPanel-default
color $ui-monokai-text-color
.infoPanel-sub
color $ui-inactive-text-color
.infoPanel-noteLink
background-color alpha($ui-monokai-borderColor, 20%)
color $ui-monokai-text-color
[id=export-wrap]
button
color $ui-dark-inactive-text-color
&:hover
background-color alpha($ui-monokai-borderColor, 20%)
color $ui-monokai-text-color
p
color $ui-dark-inactive-text-color
&:hover
color $ui-monokai-text-color
body[data-theme="dracula"]
.control-infoButton-panel
background-color $ui-dracula-noteList-backgroundColor
.control-infoButton-panel-trash
background-color $ui-dracula-noteList-backgroundColor
.modification-date
color $ui-dracula-text-color
.modification-date-desc
color $ui-inactive-text-color
.infoPanel-defaul-count
color $ui-dracula-text-color
.infoPanel-sub-count
color $ui-inactive-text-color
.infoPanel-default
color $ui-dracula-text-color
.infoPanel-sub
color $ui-inactive-text-color
.infoPanel-noteLink
background-color alpha($ui-dracula-borderColor, 20%)
color $ui-dracula-text-color
[id=export-wrap]
button
color $ui-dark-inactive-text-color
&:hover
background-color alpha($ui-dracula-borderColor, 20%)
color $ui-dracula-text-color
p
color $ui-dark-inactive-text-color
&:hover
color $ui-dracula-text-color

View File

@@ -1,46 +1,53 @@
import React, { PropTypes } from 'react' import PropTypes from 'prop-types'
import React from 'react'
import CSSModules from 'browser/lib/CSSModules' import CSSModules from 'browser/lib/CSSModules'
import styles from './InfoPanel.styl' import styles from './InfoPanel.styl'
import i18n from 'browser/lib/i18n'
const InfoPanelTrashed = ({ const InfoPanelTrashed = ({
storageName, folderName, updatedAt, createdAt, exportAsMd, exportAsTxt storageName, folderName, updatedAt, createdAt, exportAsMd, exportAsTxt, exportAsHtml
}) => ( }) => (
<div className='infoPanel' styleName='control-infoButton-panel-trash' style={{display: 'none'}}> <div className='infoPanel' styleName='control-infoButton-panel-trash' style={{display: 'none'}}>
<div> <div>
<p styleName='modification-date'>{updatedAt}</p> <p styleName='modification-date'>{updatedAt}</p>
<p styleName='modification-date-desc'>MODIFICATION DATE</p> <p styleName='modification-date-desc'>{i18n.__('MODIFICATION DATE')}</p>
</div> </div>
<hr /> <hr />
<div> <div>
<p styleName='infoPanel-default'>{storageName}</p> <p styleName='infoPanel-default'>{storageName}</p>
<p styleName='infoPanel-sub'>STORAGE</p> <p styleName='infoPanel-sub'>{i18n.__('STORAGE')}</p>
</div> </div>
<div> <div>
<p styleName='infoPanel-default'><text styleName='infoPanel-trash'>Trash</text>{folderName}</p> <p styleName='infoPanel-default'><text styleName='infoPanel-trash'>Trash</text>{folderName}</p>
<p styleName='infoPanel-sub'>FOLDER</p> <p styleName='infoPanel-sub'>{i18n.__('FOLDER')}</p>
</div> </div>
<div> <div>
<p styleName='infoPanel-default'>{createdAt}</p> <p styleName='infoPanel-default'>{createdAt}</p>
<p styleName='infoPanel-sub'>CREATION DATE</p> <p styleName='infoPanel-sub'>{i18n.__('CREATION DATE')}</p>
</div> </div>
<div id='export-wrap'> <div id='export-wrap'>
<button styleName='export--enable' onClick={(e) => exportAsMd(e)}> <button styleName='export--enable' onClick={(e) => exportAsMd(e, 'export-md')}>
<i className='fa fa-file-code-o fa-fw' /> <i className='fa fa-file-code-o' />
<p>.md</p> <p>.md</p>
</button> </button>
<button styleName='export--enable' onClick={(e) => exportAsTxt(e)}> <button styleName='export--enable' onClick={(e) => exportAsTxt(e, 'export-txt')}>
<i className='fa fa-file-text-o fa-fw' /> <i className='fa fa-file-text-o' />
<p>.txt</p> <p>.txt</p>
</button> </button>
<button styleName='export--enable' onClick={(e) => exportAsHtml(e, 'export-html')}>
<i className='fa fa-html5' />
<p>.html</p>
</button>
<button styleName='export--unable'> <button styleName='export--unable'>
<i className='fa fa-file-pdf-o fa-fw' /> <i className='fa fa-file-pdf-o' />
<p>.pdf</p> <p>.pdf</p>
</button> </button>
</div> </div>
@@ -53,7 +60,8 @@ InfoPanelTrashed.propTypes = {
updatedAt: PropTypes.string.isRequired, updatedAt: PropTypes.string.isRequired,
createdAt: PropTypes.string.isRequired, createdAt: PropTypes.string.isRequired,
exportAsMd: PropTypes.func.isRequired, exportAsMd: PropTypes.func.isRequired,
exportAsTxt: PropTypes.func.isRequired exportAsTxt: PropTypes.func.isRequired,
exportAsHtml: PropTypes.func.isRequired
} }
export default CSSModules(InfoPanelTrashed, styles) export default CSSModules(InfoPanelTrashed, styles)

313
browser/main/Detail/MarkdownNoteDetail.js Normal file → Executable file
View File

@@ -1,7 +1,9 @@
import React, { PropTypes } from 'react' import PropTypes from 'prop-types'
import React from 'react'
import CSSModules from 'browser/lib/CSSModules' import CSSModules from 'browser/lib/CSSModules'
import styles from './MarkdownNoteDetail.styl' import styles from './MarkdownNoteDetail.styl'
import MarkdownEditor from 'browser/components/MarkdownEditor' import MarkdownEditor from 'browser/components/MarkdownEditor'
import MarkdownSplitEditor from 'browser/components/MarkdownSplitEditor'
import TodoListPercentage from 'browser/components/TodoListPercentage' import TodoListPercentage from 'browser/components/TodoListPercentage'
import StarButton from './StarButton' import StarButton from './StarButton'
import TagSelect from './TagSelect' import TagSelect from './TagSelect'
@@ -14,18 +16,20 @@ import StatusBar from '../StatusBar'
import _ from 'lodash' import _ from 'lodash'
import { findNoteTitle } from 'browser/lib/findNoteTitle' import { findNoteTitle } from 'browser/lib/findNoteTitle'
import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig' import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
import ConfigManager from 'browser/main/lib/ConfigManager'
import TrashButton from './TrashButton' import TrashButton from './TrashButton'
import FullscreenButton from './FullscreenButton'
import RestoreButton from './RestoreButton'
import PermanentDeleteButton from './PermanentDeleteButton' import PermanentDeleteButton from './PermanentDeleteButton'
import InfoButton from './InfoButton' import InfoButton from './InfoButton'
import ToggleModeButton from './ToggleModeButton'
import InfoPanel from './InfoPanel' import InfoPanel from './InfoPanel'
import InfoPanelTrashed from './InfoPanelTrashed' import InfoPanelTrashed from './InfoPanelTrashed'
import { formatDate } from 'browser/lib/date-formatter' import { formatDate } from 'browser/lib/date-formatter'
import { getTodoPercentageOfCompleted } from 'browser/lib/getTodoStatus' import { getTodoPercentageOfCompleted } from 'browser/lib/getTodoStatus'
import striptags from 'striptags' import striptags from 'striptags'
import { confirmDeleteNote } from 'browser/lib/confirmDeleteNote'
const electron = require('electron') import markdownToc from 'browser/lib/markdown-toc-generator'
const { remote } = electron
const { Menu, MenuItem, dialog } = remote
class MarkdownNoteDetail extends React.Component { class MarkdownNoteDetail extends React.Component {
constructor (props) { constructor (props) {
@@ -35,14 +39,19 @@ class MarkdownNoteDetail extends React.Component {
isMovingNote: false, isMovingNote: false,
note: Object.assign({ note: Object.assign({
title: '', title: '',
content: '' content: '',
linesHighlighted: []
}, props.note), }, props.note),
isLockButtonShown: false, isLockButtonShown: props.config.editor.type !== 'SPLIT',
isLocked: false isLocked: false,
editorType: props.config.editor.type,
switchPreview: props.config.editor.switchPreview
} }
this.dispatchTimer = null this.dispatchTimer = null
this.toggleLockButton = this.handleToggleLockButton.bind(this) this.toggleLockButton = this.handleToggleLockButton.bind(this)
this.generateToc = () => this.handleGenerateToc()
} }
focus () { focus () {
@@ -51,13 +60,24 @@ class MarkdownNoteDetail extends React.Component {
componentDidMount () { componentDidMount () {
ee.on('topbar:togglelockbutton', this.toggleLockButton) ee.on('topbar:togglelockbutton', this.toggleLockButton)
ee.on('topbar:togglemodebutton', () => {
const reversedType = this.state.editorType === 'SPLIT' ? 'EDITOR_PREVIEW' : 'SPLIT'
this.handleSwitchMode(reversedType)
})
ee.on('hotkey:deletenote', this.handleDeleteNote.bind(this))
ee.on('code:generate-toc', this.generateToc)
// Focus content if using blur or double click
if (this.state.switchPreview === 'BLUR' || this.state.switchPreview === 'DBL_CLICK') this.focus()
} }
componentWillReceiveProps (nextProps) { componentWillReceiveProps (nextProps) {
if (nextProps.note.key !== this.props.note.key && !this.isMovingNote) { const isNewNote = nextProps.note.key !== this.props.note.key
const hasDeletedTags = nextProps.note.tags.length < this.props.note.tags.length
if (!this.state.isMovingNote && (isNewNote || hasDeletedTags)) {
if (this.saveQueue != null) this.saveNow() if (this.saveQueue != null) this.saveNow()
this.setState({ this.setState({
note: Object.assign({}, nextProps.note) note: Object.assign({linesHighlighted: []}, nextProps.note)
}, () => { }, () => {
this.refs.content.reload() this.refs.content.reload()
if (this.refs.tags) this.refs.tags.reset() if (this.refs.tags) this.refs.tags.reset()
@@ -66,24 +86,32 @@ class MarkdownNoteDetail extends React.Component {
} }
componentWillUnmount () { componentWillUnmount () {
ee.off('topbar:togglelockbutton', this.toggleLockButton)
ee.off('code:generate-toc', this.generateToc)
if (this.saveQueue != null) this.saveNow() if (this.saveQueue != null) this.saveNow()
} }
componentDidUnmount () { handleUpdateTag () {
ee.off('topbar:togglelockbutton', this.toggleLockButton) const { note } = this.state
if (this.refs.tags) note.tags = this.refs.tags.value
this.updateNote(note)
} }
handleChange (e) { handleUpdateContent () {
let { note } = this.state const { note } = this.state
note.content = this.refs.content.value note.content = this.refs.content.value
if (this.refs.tags) note.tags = this.refs.tags.value
note.title = markdown.strip(striptags(findNoteTitle(note.content)))
note.updatedAt = new Date()
this.setState({ let title = findNoteTitle(note.content, this.props.config.editor.enableFrontMatterTitle, this.props.config.editor.frontMatterTitleField)
note title = striptags(title)
}, () => { title = markdown.strip(title)
note.title = title
this.updateNote(note)
}
updateNote (note) {
note.updatedAt = new Date()
this.setState({note}, () => {
this.save() this.save()
}) })
} }
@@ -96,7 +124,7 @@ class MarkdownNoteDetail extends React.Component {
} }
saveNow () { saveNow () {
let { note, dispatch } = this.props const { note, dispatch } = this.props
clearTimeout(this.saveQueue) clearTimeout(this.saveQueue)
this.saveQueue = null this.saveQueue = null
@@ -112,11 +140,11 @@ class MarkdownNoteDetail extends React.Component {
} }
handleFolderChange (e) { handleFolderChange (e) {
let { note } = this.state const { note } = this.state
let value = this.refs.folder.value const value = this.refs.folder.value
let splitted = value.split('-') const splitted = value.split('-')
let newStorageKey = splitted.shift() const newStorageKey = splitted.shift()
let newFolderKey = splitted.shift() const newFolderKey = splitted.shift()
dataApi dataApi
.moveNote(note.storage, note.key, newStorageKey, newFolderKey) .moveNote(note.storage, note.key, newStorageKey, newFolderKey)
@@ -125,7 +153,7 @@ class MarkdownNoteDetail extends React.Component {
isMovingNote: true, isMovingNote: true,
note: Object.assign({}, newNote) note: Object.assign({}, newNote)
}, () => { }, () => {
let { dispatch, location } = this.props const { dispatch, location } = this.props
dispatch({ dispatch({
type: 'MOVE_NOTE', type: 'MOVE_NOTE',
originNote: note, originNote: note,
@@ -134,7 +162,7 @@ class MarkdownNoteDetail extends React.Component {
hashHistory.replace({ hashHistory.replace({
pathname: location.pathname, pathname: location.pathname,
query: { query: {
key: newNote.storage + '-' + newNote.key key: newNote.key
} }
}) })
this.setState({ this.setState({
@@ -145,7 +173,7 @@ class MarkdownNoteDetail extends React.Component {
} }
handleStarButtonClick (e) { handleStarButtonClick (e) {
let { note } = this.state const { note } = this.state
if (!note.isStarred) AwsMobileAnalyticsConfig.recordDynamicCustomEvent('ADD_STAR') if (!note.isStarred) AwsMobileAnalyticsConfig.recordDynamicCustomEvent('ADD_STAR')
note.isStarred = !note.isStarred note.isStarred = !note.isStarred
@@ -169,45 +197,79 @@ class MarkdownNoteDetail extends React.Component {
ee.emit('export:save-text') ee.emit('export:save-text')
} }
exportAsHtml () {
ee.emit('export:save-html')
}
handleKeyDown (e) {
switch (e.keyCode) {
// tab key
case 9:
if (e.ctrlKey && !e.shiftKey) {
e.preventDefault()
this.jumpNextTab()
} else if (e.ctrlKey && e.shiftKey) {
e.preventDefault()
this.jumpPrevTab()
} else if (!e.ctrlKey && !e.shiftKey && e.target === this.refs.description) {
e.preventDefault()
this.focusEditor()
}
break
// I key
case 73:
{
const isSuper = global.process.platform === 'darwin'
? e.metaKey
: e.ctrlKey
if (isSuper) {
e.preventDefault()
this.handleInfoButtonClick(e)
}
}
break
}
}
handleTrashButtonClick (e) { handleTrashButtonClick (e) {
let { note } = this.state const { note } = this.state
const { isTrashed } = note const { isTrashed } = note
const { confirmDeletion } = this.props.config.ui
if (isTrashed) { if (isTrashed) {
let dialogueButtonIndex = dialog.showMessageBox(remote.getCurrentWindow(), { if (confirmDeleteNote(confirmDeletion, true)) {
type: 'warning', const {note, dispatch} = this.props
message: 'Confirm note deletion', dataApi
detail: 'This will permanently remove this note.', .deleteNote(note.storage, note.key)
buttons: ['Confirm', 'Cancel'] .then((data) => {
}) const dispatchHandler = () => {
if (dialogueButtonIndex === 1) return dispatch({
let { note, dispatch } = this.props type: 'DELETE_NOTE',
dataApi storageKey: data.storageKey,
.deleteNote(note.storage, note.key) noteKey: data.noteKey
.then((data) => { })
let dispatchHandler = () => { }
dispatch({ ee.once('list:next', dispatchHandler)
type: 'DELETE_NOTE', })
storageKey: data.storageKey, .then(() => ee.emit('list:next'))
noteKey: data.noteKey }
})
}
ee.once('list:moved', dispatchHandler)
})
} else { } else {
note.isTrashed = true if (confirmDeleteNote(confirmDeletion, false)) {
note.isTrashed = true
this.setState({ this.setState({
note note
}, () => { }, () => {
this.save() this.save()
}) })
ee.emit('list:next')
}
} }
ee.emit('list:next')
} }
handleUndoButtonClick (e) { handleUndoButtonClick (e) {
let { note } = this.state const { note } = this.state
note.isTrashed = false note.isTrashed = false
@@ -232,7 +294,7 @@ class MarkdownNoteDetail extends React.Component {
} }
getToggleLockButton () { getToggleLockButton () {
return this.state.isLocked ? '../resources/icon/icon-lock.svg' : '../resources/icon/icon-unlock.svg' return this.state.isLocked ? '../resources/icon/icon-previewoff-on.svg' : '../resources/icon/icon-previewoff-off.svg'
} }
handleDeleteKeyDown (e) { handleDeleteKeyDown (e) {
@@ -241,13 +303,18 @@ class MarkdownNoteDetail extends React.Component {
handleToggleLockButton (event, noteStatus) { handleToggleLockButton (event, noteStatus) {
// first argument event is not used // first argument event is not used
if (this.props.config.editor.switchPreview === 'BLUR' && noteStatus === 'CODE') { if (noteStatus === 'CODE') {
this.setState({isLockButtonShown: true}) this.setState({isLockButtonShown: true})
} else { } else {
this.setState({isLockButtonShown: false}) this.setState({isLockButtonShown: false})
} }
} }
handleGenerateToc () {
const editor = this.refs.content.refs.code.editor
markdownToc.generateInEditor(editor)
}
handleFocus (e) { handleFocus (e) {
this.focus() this.focus()
} }
@@ -261,13 +328,77 @@ class MarkdownNoteDetail extends React.Component {
ee.emit('print') ee.emit('print')
} }
render () { handleSwitchMode (type) {
let { data, config, location } = this.props // If in split mode, hide the lock button
let { note } = this.state this.setState({ editorType: type, isLockButtonShown: !(type === 'SPLIT') }, () => {
let storageKey = note.storage this.focus()
let folderKey = note.folder const newConfig = Object.assign({}, this.props.config)
newConfig.editor.type = type
ConfigManager.set(newConfig)
})
}
let options = [] handleDeleteNote () {
this.handleTrashButtonClick()
}
handleClearTodo () {
const { note } = this.state
const splitted = note.content.split('\n')
const clearTodoContent = splitted.map((line) => {
const trimmedLine = line.trim()
if (trimmedLine.match(/\[x\]/i)) {
return line.replace(/\[x\]/i, '[ ]')
} else {
return line
}
}).join('\n')
note.content = clearTodoContent
this.refs.content.setValue(note.content)
this.updateNote(note)
}
renderEditor () {
const { config, ignorePreviewPointerEvents } = this.props
const { note } = this.state
if (this.state.editorType === 'EDITOR_PREVIEW') {
return <MarkdownEditor
ref='content'
styleName='body-noteEditor'
config={config}
value={note.content}
storageKey={note.storage}
noteKey={note.key}
linesHighlighted={note.linesHighlighted}
onChange={this.handleUpdateContent.bind(this)}
isLocked={this.state.isLocked}
ignorePreviewPointerEvents={ignorePreviewPointerEvents}
/>
} else {
return <MarkdownSplitEditor
ref='content'
config={config}
value={note.content}
storageKey={note.storage}
noteKey={note.key}
linesHighlighted={note.linesHighlighted}
onChange={this.handleUpdateContent.bind(this)}
ignorePreviewPointerEvents={ignorePreviewPointerEvents}
/>
}
}
render () {
const { data, location, config } = this.props
const { note, editorType } = this.state
const storageKey = note.storage
const folderKey = note.folder
const options = []
data.storageMap.forEach((storage, index) => { data.storageMap.forEach((storage, index) => {
storage.folders.forEach((folder) => { storage.folders.forEach((folder) => {
options.push({ options.push({
@@ -276,14 +407,11 @@ class MarkdownNoteDetail extends React.Component {
}) })
}) })
}) })
let currentOption = options.filter((option) => option.storage.key === storageKey && option.folder.key === folderKey)[0] const currentOption = options.filter((option) => option.storage.key === storageKey && option.folder.key === folderKey)[0]
const trashTopBar = <div styleName='info'> const trashTopBar = <div styleName='info'>
<div styleName='info-left'> <div styleName='info-left'>
<i styleName='undo-button' <RestoreButton onClick={(e) => this.handleUndoButtonClick(e)} />
className='fa fa-undo fa-fw'
onClick={(e) => this.handleUndoButtonClick(e)}
/>
</div> </div>
<div styleName='info-right'> <div styleName='info-right'>
<PermanentDeleteButton onClick={(e) => this.handleTrashButtonClick(e)} /> <PermanentDeleteButton onClick={(e) => this.handleTrashButtonClick(e)} />
@@ -295,6 +423,7 @@ class MarkdownNoteDetail extends React.Component {
folderName={currentOption.folder.name} folderName={currentOption.folder.name}
updatedAt={formatDate(note.updatedAt)} updatedAt={formatDate(note.updatedAt)}
createdAt={formatDate(note.createdAt)} createdAt={formatDate(note.createdAt)}
exportAsHtml={this.exportAsHtml}
exportAsMd={this.exportAsMd} exportAsMd={this.exportAsMd}
exportAsTxt={this.exportAsTxt} exportAsTxt={this.exportAsTxt}
/> />
@@ -315,17 +444,16 @@ class MarkdownNoteDetail extends React.Component {
<TagSelect <TagSelect
ref='tags' ref='tags'
value={this.state.note.tags} value={this.state.note.tags}
onChange={(e) => this.handleChange(e)} saveTagsAlphabetically={config.ui.saveTagsAlphabetically}
/> showTagsAlphabetically={config.ui.showTagsAlphabetically}
<TodoListPercentage data={data}
percentageOfTodo={getTodoPercentageOfCompleted(note.content)} onChange={this.handleUpdateTag.bind(this)}
coloredTags={config.coloredTags}
/> />
<TodoListPercentage onClearCheckboxClick={(e) => this.handleClearTodo(e)} percentageOfTodo={getTodoPercentageOfCompleted(note.content)} />
</div> </div>
<div styleName='info-right'> <div styleName='info-right'>
<InfoButton <ToggleModeButton onClick={(e) => this.handleSwitchMode(e)} editorType={editorType} />
onClick={(e) => this.handleInfoButtonClick(e)}
/>
<StarButton <StarButton
onClick={(e) => this.handleStarButtonClick(e)} onClick={(e) => this.handleStarButtonClick(e)}
isActive={note.isStarred} isActive={note.isStarred}
@@ -339,6 +467,7 @@ class MarkdownNoteDetail extends React.Component {
onMouseDown={(e) => this.handleLockButtonMouseDown(e)} onMouseDown={(e) => this.handleLockButtonMouseDown(e)}
> >
<img styleName='iconInfo' src={imgSrc} /> <img styleName='iconInfo' src={imgSrc} />
{this.state.isLocked ? <span styleName='tooltip'>Unlock</span> : <span styleName='tooltip'>Lock</span>}
</button> </button>
return ( return (
@@ -346,22 +475,23 @@ class MarkdownNoteDetail extends React.Component {
) )
})()} })()}
<button styleName='control-fullScreenButton' <FullscreenButton onClick={(e) => this.handleFullScreenButton(e)} />
onMouseDown={(e) => this.handleFullScreenButton(e)}
>
<img styleName='iconInfo' src='../resources/icon/icon-sidebar.svg' />
</button>
<TrashButton onClick={(e) => this.handleTrashButtonClick(e)} /> <TrashButton onClick={(e) => this.handleTrashButtonClick(e)} />
<InfoButton
onClick={(e) => this.handleInfoButtonClick(e)}
/>
<InfoPanel <InfoPanel
storageName={currentOption.storage.name} storageName={currentOption.storage.name}
folderName={currentOption.folder.name} folderName={currentOption.folder.name}
noteLink={`[${note.title}](${location.query.key})`} noteLink={`[${note.title}](:note:${location.query.key})`}
updatedAt={formatDate(note.updatedAt)} updatedAt={formatDate(note.updatedAt)}
createdAt={formatDate(note.createdAt)} createdAt={formatDate(note.createdAt)}
exportAsMd={this.exportAsMd} exportAsMd={this.exportAsMd}
exportAsTxt={this.exportAsTxt} exportAsTxt={this.exportAsTxt}
exportAsHtml={this.exportAsHtml}
wordCount={note.content.split(' ').length} wordCount={note.content.split(' ').length}
letterCount={note.content.replace(/\r?\n/g, '').length} letterCount={note.content.replace(/\r?\n/g, '').length}
type={note.type} type={note.type}
@@ -374,20 +504,13 @@ class MarkdownNoteDetail extends React.Component {
<div className='NoteDetail' <div className='NoteDetail'
style={this.props.style} style={this.props.style}
styleName='root' styleName='root'
onKeyDown={(e) => this.handleKeyDown(e)}
> >
{location.pathname === '/trashed' ? trashTopBar : detailTopBar} {location.pathname === '/trashed' ? trashTopBar : detailTopBar}
<div styleName='body'> <div styleName='body'>
<MarkdownEditor {this.renderEditor()}
ref='content'
styleName='body-noteEditor'
config={config}
value={this.state.note.content}
storageKey={this.state.note.storage}
onChange={(e) => this.handleChange(e)}
ignorePreviewPointerEvents={this.props.ignorePreviewPointerEvents}
/>
</div> </div>
<StatusBar <StatusBar

View File

@@ -7,31 +7,42 @@
background-color $ui-noteDetail-backgroundColor background-color $ui-noteDetail-backgroundColor
box-shadow none box-shadow none
padding 20px 40px padding 20px 40px
overflow hidden
.lock-button .lock-button
padding-bottom 3px padding-bottom 3px
.control-lockButton .control-lockButton
top 160px topBarButtonRight()
margin-bottom 10px position absolute
topBarButtonLight() right 225px
&:hover .tooltip
opacity 1
.tooltip
tooltip()
position absolute
pointer-events none
top 35px
right -10px
width 50px
z-index 200
padding 5px
line-height normal
border-radius 2px
opacity 0
transition 0.1s
.trashed-infopanel .trashed-infopanel
top 40px
position relative position relative
.control-fullScreenButton
top 80px
topBarButtonLight()
.body .body
absolute left right absolute left right
left 0 left 0
right 0 right 0
top $info-height + $info-margin-under-border top $info-height + $info-margin-under-border
bottom $statusBar-height bottom $statusBar-height
max-width 600px margin 0 30px
margin 0 auto
.body-noteEditor .body-noteEditor
absolute top bottom left right absolute top bottom left right
@@ -44,7 +55,7 @@ body[data-theme="dark"]
.root .root
background-color $ui-dark-noteDetail-backgroundColor background-color $ui-dark-noteDetail-backgroundColor
box-shadow none box-shadow none
border none border-left 1px solid $ui-dark-borderColor
.control-lockButton .control-lockButton
topBarButtonDark() topBarButtonDark()
@@ -54,3 +65,19 @@ body[data-theme="dark"]
.control-fullScreenButton .control-fullScreenButton
topBarButtonDark() topBarButtonDark()
body[data-theme="solarized-dark"]
.root
border-left 1px solid $ui-solarized-dark-borderColor
background-color $ui-solarized-dark-noteDetail-backgroundColor
body[data-theme="monokai"]
.root
border-left 1px solid $ui-monokai-borderColor
background-color $ui-monokai-noteDetail-backgroundColor
body[data-theme="dracula"]
.root
border-left 1px solid $ui-dracula-borderColor
background-color $ui-dracula-noteDetail-backgroundColor

View File

@@ -1,6 +1,6 @@
@import('DetailVars') @import('DetailVars')
$info-height = 50px $info-height = 60px
$info-margin-under-border = 30px $info-margin-under-border = 30px
.info .info
@@ -8,11 +8,12 @@ $info-margin-under-border = 30px
left 0 left 0
right 0 right 0
height $info-height height $info-height
border-bottom 1px solid #eee
background-color $ui-noteDetail-backgroundColor background-color $ui-noteDetail-backgroundColor
width 100% width 100%
display flex display flex
align-items center align-items center
padding 0 20px
z-index 99
.info-left .info-left
padding 0 10px padding 0 10px
@@ -20,7 +21,6 @@ $info-margin-under-border = 30px
display flex display flex
align-items center align-items center
.info-left-top-folderSelect .info-left-top-folderSelect
display flex display flex
align-items center align-items center
@@ -45,12 +45,9 @@ $info-margin-under-border = 30px
color $ui-button--color color $ui-button--color
.info-right .info-right
position absolute
right 40px
top 60px
bottom 1px
padding-left 30px
z-index 101 z-index 101
display inline-flex
margin-top 3px
.undo-button .undo-button
width 34px width 34px
@@ -95,4 +92,19 @@ body[data-theme="dark"]
background-color $ui-dark-noteDetail-backgroundColor background-color $ui-dark-noteDetail-backgroundColor
.undo-button .undo-button
topBarButtonDark() topBarButtonDark()
body[data-theme="solarized-dark"]
.info
border-color $ui-solarized-dark-borderColor
background-color $ui-solarized-dark-noteDetail-backgroundColor
body[data-theme="monokai"]
.info
border-color $ui-monokai-borderColor
background-color $ui-monokai-noteDetail-backgroundColor
body[data-theme="dracula"]
.info
border-color $ui-dracula-borderColor
background-color $ui-dracula-noteDetail-backgroundColor

View File

@@ -1,6 +1,8 @@
import React, { PropTypes } from 'react' import PropTypes from 'prop-types'
import React from 'react'
import CSSModules from 'browser/lib/CSSModules' import CSSModules from 'browser/lib/CSSModules'
import styles from './TrashButton.styl' import styles from './TrashButton.styl'
import i18n from 'browser/lib/i18n'
const PermanentDeleteButton = ({ const PermanentDeleteButton = ({
onClick onClick
@@ -9,6 +11,7 @@ const PermanentDeleteButton = ({
onClick={(e) => onClick(e)} onClick={(e) => onClick(e)}
> >
<img styleName='iconInfo' src='../resources/icon/icon-trash.svg' /> <img styleName='iconInfo' src='../resources/icon/icon-trash.svg' />
<span styleName='tooltip'>{i18n.__('Permanent Delete')}</span>
</button> </button>
) )

View File

@@ -0,0 +1,22 @@
import PropTypes from 'prop-types'
import React from 'react'
import CSSModules from 'browser/lib/CSSModules'
import styles from './RestoreButton.styl'
import i18n from 'browser/lib/i18n'
const RestoreButton = ({
onClick
}) => (
<button styleName='control-restoreButton'
onClick={onClick}
>
<i className='fa fa-undo fa-fw' styleName='iconRestore' />
<span styleName='tooltip'>{i18n.__('Restore')}</span>
</button>
)
RestoreButton.propTypes = {
onClick: PropTypes.func.isRequired
}
export default CSSModules(RestoreButton, styles)

View File

@@ -0,0 +1,22 @@
.control-restoreButton
top 115px
topBarButtonRight()
&:hover .tooltip
opacity 1
.tooltip
tooltip()
position absolute
pointer-events none
top 50px
left 25px
z-index 200
padding 5px
line-height normal
border-radius 2px
opacity 0
transition 0.1s
body[data-theme="dark"]
.control-restoreButton
topBarButtonDark()

Some files were not shown because too many files have changed in this diff Show More