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

Compare commits

...

550 Commits

Author SHA1 Message Date
Sota Sugiura
6a711d6a71 Merge pull request #476 from BoostIO/v8-8-8
v0.8.8
2017-04-22 18:30:05 +09:00
sota1235
9d8e71aeb3 v8.8.8 2017-04-22 16:34:58 +09:00
Sota Sugiura
cfeeba209e Merge pull request #468 from BoostIO/feature-fix-text
Fix text on menu bar(macOS) and some refactor
2017-04-22 16:31:58 +09:00
Sota Sugiura
455029851a Merge pull request #474 from BoostIO/delete-escbutton-in-initimodal
delete the escButton in the InitModal
2017-04-22 16:19:32 +09:00
Sota Sugiura
d0f7baaad0 Merge pull request #473 from BoostIO/Fix-ConfigTab-Interface
Fix the config tab layout
2017-04-22 16:17:43 +09:00
Kazu Yokomizo
e3fb236139 Fix the config tab layout 2017-04-22 16:06:01 +09:00
Sosuke Suzuki
42296e421a delete the escButton in the InitModal 2017-04-22 16:05:22 +09:00
Sota Sugiura
c6f4ed7c8f Merge pull request #472 from BoostIO/Design-update
Fix the english typo
2017-04-22 15:45:09 +09:00
Kazu Yokomizo
e1fb36d64d Fix the border-left width at folder-selector 2017-04-22 15:33:05 +09:00
Sota Sugiura
48cf695e11 Merge branch 'master' into Design-update 2017-04-22 15:17:03 +09:00
Kazu Yokomizo
5b0e0c71a0 Fix the english typo 2017-04-22 14:59:53 +09:00
Sota Sugiura
c1a76b6fb4 Merge pull request #290 from BoostIO/featureSyntaxHighlightCheck
Feature syntax highlight check
2017-04-22 13:20:19 +09:00
Sota Sugiura
945a6306ec Merge pull request #469 from LeoLamCY/add-support-to-bold-selected-text-via-kb-shortcut
Add support to bold selected text via kb shortcut
2017-04-22 13:07:04 +09:00
sota1235
313bacf9dc modify: fix for ESLint 2017-04-22 13:00:25 +09:00
Sota Sugiura
9027f48dda Merge pull request #453 from bubuzzz/feature/double-click-to-rename-tab
double click on tab to rename
2017-04-22 12:58:29 +09:00
Sota Sugiura
eea8f7cdf4 Merge pull request #425 from AWEEKJ/feature_markdown_note
Fix new line problem in list and task list
2017-04-22 12:52:53 +09:00
Leo Lam
ffef239aa7 fix minor build error 2017-04-21 23:40:52 -04:00
Leo Lam
50fc15feea add support to bold selected text via kb shortcut
to improve upon #301
ctrl + : to bold a single word under caret or bold selected text if some
text is selected (highlighted)

#463
2017-04-21 23:32:57 -04:00
Leo Lam
2d7a37c872 Merge remote-tracking branch 'refs/remotes/BoostIO/master' 2017-04-21 23:24:44 -04:00
sota1235
db468fc095 modify: some refactor 2017-04-22 11:54:05 +09:00
sota1235
9a9f0035c2 modify: add label for quit button on macOS 2017-04-22 11:51:06 +09:00
Sota Sugiura
b9270cd040 Merge pull request #349 from asmsuechan/iss-332
Fix the screen become black on closing Boostnote when a state of Boostnote is fullscreen on mac
2017-04-22 11:44:44 +09:00
Kazu Yokomizo
65b1bd18c4 Merge pull request #465 from BoostIO/Design-update
Fix the loading layout
2017-04-21 20:48:44 +09:00
Kazu Yokomizo
c87ecc3d40 Fix the Statusbar layout 2017-04-21 20:23:33 +09:00
Kazu Yokomizo
e39e1648f9 Fix the loading layout 2017-04-21 20:07:14 +09:00
Kazu Yokomizo
091d2618a2 Merge pull request #462 from BoostIO/Design-update
Design update
2017-04-21 18:21:16 +09:00
Kazu Yokomizo
d039b17715 modify: Fix the SideNavFilter layout 2017-04-21 16:13:45 +09:00
Kazu Yokomizo
e350dca72c modify: Fix the star-btn layout at NoteDetail 2017-04-21 15:48:57 +09:00
Kazu Yokomizo
c07e334f03 modify: Fix the tag style at NoteDetail 2017-04-21 15:32:23 +09:00
Kazu Yokomizo
1ccfd8e392 modify: Fix the tag-list layout at NoteItem 2017-04-21 15:00:09 +09:00
Kazu Yokomizo
d22c40f0a5 modify: Fix the tag layout at note list 2017-04-21 14:53:25 +09:00
Kazu Yokomizo
3d37db6e54 modify: Fix the hover layout at SideNav 2017-04-21 14:33:16 +09:00
Kazu Yokomizo
22bd92916b modify: Fix the navtoggle-btn layout 2017-04-21 14:24:22 +09:00
Kazu Yokomizo
de303cf072 modify: Fix the sort-by-btn layout 2017-04-21 14:20:21 +09:00
Kazu Yokomizo
b22aad0678 modify: Fix the navtoggle-btn layout 2017-04-21 14:02:48 +09:00
Kazu Yokomizo
bf02f9b256 modify: Fix the layout of new-post-btn and status-bar 2017-04-21 13:45:04 +09:00
SuenagaRyota
6440ab423e Merge pull request #457 from SalvatoreTosti/master
Updated initial pieces of text to read more clearly in English
2017-04-20 22:16:53 -05:00
Salvatore Tosti
fceab73226 Updated initial pieces of text to read more clearly in English 2017-04-19 17:57:42 -07:00
Thai Tran
fded0ad3e8 double click on tab to rename 2017-04-19 15:05:47 +10:00
Kazu Yokomizo
294eb64686 Merge pull request #451 from BoostIO/Fix-slack-link
Fix slack group invitation
2017-04-19 10:15:45 +09:00
Kazu Yokomizo
851b28c482 Fix slack group invitation 2017-04-19 10:10:35 +09:00
Kazu Yokomizo
63fa2f1149 Fix slack group invitaition 2017-04-19 10:10:05 +09:00
Kazu Yokomizo
816d8decbd Merge pull request #443 from SalvatoreTosti/master
Changed wording in build.md and debug.md
2017-04-18 12:04:39 +09:00
Salvatore Tosti
85b4eedcd6 Changed wording in build.md and debug.md
I've adjusted the wording in the build and debug files to flow better and make more sense in English.
2017-04-17 19:38:20 -07:00
Kazu Yokomizo
901f40a669 Merge pull request #442 from BoostIO/Fix-typo
Fix typo in Infotab
2017-04-18 10:24:07 +09:00
Kazu Yokomizo
bae5f202a5 Fix typo in Infotab 2017-04-18 10:20:39 +09:00
Kazu Yokomizo
131f6780c2 Merge pull request #441 from SalvatoreTosti/master
Updated readme file to read more cleanly in English
2017-04-18 10:10:53 +09:00
Salvatore Tosti
a0e067cacf Updated readme file to read more cleanly in English
Made some small styling tweaks for greater uniformity within the readme document.
Also reworded a few sections to read more clearly.
2017-04-17 12:38:43 -07:00
Kazu Yokomizo
8cdcf537be Merge pull request #439 from BoostIO/update-info
Update information.
2017-04-18 00:57:38 +09:00
Kazu Yokomizo
575f5f160c Update information. 2017-04-18 00:55:31 +09:00
Kazu Yokomizo
d8fbac584c Merge pull request #438 from BoostIO/Fix-readme
Fix readme
2017-04-18 00:47:34 +09:00
Kazu Yokomizo
b73e1b04dc Fix readme 2017-04-17 18:21:12 +09:00
Kazu Yokomizo
3dd49c287d Merge pull request #424 from BoostIO/Design-update
Design update at v0.8.8
2017-04-15 13:00:36 +09:00
Kazu Yokomizo
6ce6a7036b Fix typo 2017-04-15 12:33:16 +09:00
SuenagaRyota
c120633f14 Merge pull request #426 from asmsuechan/edit-contributing.md
Edit contributing.md
2017-04-14 19:33:04 -07:00
asmsuechan
6e84b24309 Edit contributing.md 2017-04-14 18:52:48 -07:00
Kazu Yokomizo
343e35bb54 Fix the select-btn layout at setting modal in white theme 2017-04-14 17:14:45 +09:00
Kazu Yokomizo
09cf94d807 Fix to outline:none 2017-04-14 17:10:37 +09:00
Hanju Jo
a5531e20f2 Fix new line problem of list and task list 2017-04-14 17:09:30 +09:00
Kazu Yokomizo
0f311120af Fix the layout of NoteItem at SideNav 2017-04-14 16:42:01 +09:00
Kazu Yokomizo
614506cada Fix the hover/active layout at menubar in white theme 2017-04-14 15:45:52 +09:00
Kazu Yokomizo
7891d14a0a Fix the hover/active layout at NoteItemSimple 2017-04-14 15:38:45 +09:00
Kazu Yokomizo
2df12b6891 Fix the hover layout at NoteNavFilter in white theme 2017-04-14 15:28:27 +09:00
Kazu Yokomizo
97b42d6be1 Fix the hover/active layout at NoteItem in white theme 2017-04-14 15:26:45 +09:00
Kazu Yokomizo
39baadeb04 Fix hover/active layout at NoteItem 2017-04-14 15:23:52 +09:00
Kazu Yokomizo
a6f5452a85 Change the button color at setting modal 2017-04-13 20:45:26 +09:00
Kazu Yokomizo
29dc3bd550 Fix the layout of nav-btn at setting modal 2017-04-13 12:14:36 +09:00
Kazu Yokomizo
e103605956 Change the border-left at setting modal 2017-04-13 12:05:10 +09:00
Kazu Yokomizo
c510c2e540 Change the add-storage-btn at setting modal 2017-04-13 12:04:51 +09:00
Kazu Yokomizo
41d65e4132 Change the border-width at folder list 2017-04-13 11:46:41 +09:00
SuenagaRyota
b6cb532568 Merge pull request #422 from asmsuechan/iss-421
Update katex to 0.7.1
2017-04-12 14:27:36 -07:00
asmsuechan
a034ea3a05 Update katex to 0.7.1 2017-04-12 12:55:30 -07:00
Kazu Yokomizo
adeb45a9ce Fix the storage-btn layout at SideNav 2017-04-12 23:10:29 +09:00
Kazu Yokomizo
4ada755793 Change the info at InfoTag modal 2017-04-12 22:22:22 +09:00
Kazu Yokomizo
c4be052a49 Change the info at infoModal 2017-04-12 20:17:06 +09:00
Kazu Yokomizo
54c2d7bac9 Delete the border-line at Statusbar 2017-04-12 16:14:00 +09:00
Kazu Yokomizo
233ab17992 Change the default background-color of ui-btn at white theme 2017-04-12 15:08:51 +09:00
Kazu Yokomizo
e251ec64dc Fix the layout of SideNavFilter 2017-04-12 14:59:47 +09:00
Kazu Yokomizo
32bd6d76ee Change the All Notes icon at SideNavFilter 2017-04-12 14:48:52 +09:00
Kazu Yokomizo
3fc17634aa Merge pull request #418 from BoostIO/Update-slack-invitation
Update slack invitation
2017-04-12 12:45:20 +09:00
Kazu Yokomizo
555d725e7b Update slack group invitation link 2017-04-12 12:42:54 +09:00
Kazu Yokomizo
35416796b5 Update slack group invitation link 2017-04-12 12:42:14 +09:00
SuenagaRyota
6c737fe25f Merge pull request #399 from asmsuechan/remove-a-shortcut-fot-bold
Remove Ctrl-B shortcut for bold
2017-04-11 12:54:29 -07:00
Kazu Yokomizo
1b58e320aa Change the font color at dark theme 2017-04-11 00:47:13 +09:00
Kazu Yokomizo
658a90bf15 Fix the layout at NoteItem 2017-04-10 23:08:06 +09:00
Kazu Yokomizo
d092e75f3c Delete the border line at Statusbar 2017-04-10 22:11:44 +09:00
asmsuechan
162fae19cc Remove Ctrl-B shortcut for bold 2017-04-08 14:31:18 -07:00
Kazu Yokomizo
58f5035ec6 Change the star background-color when hover at NoteDetail 2017-04-08 16:58:52 +09:00
Kazu Yokomizo
c5076e4e95 Change the star background-color when hover 2017-04-08 16:54:36 +09:00
Kazu Yokomizo
28ef1e625c Fix the rename folder modal layout 2017-04-08 16:49:35 +09:00
Kazu Yokomizo
97441ccacb Fix the box-shadow 2017-04-08 16:46:11 +09:00
Kazu Yokomizo
6b29aed6c4 Fix the search modal layout 2017-04-08 16:40:26 +09:00
Kazu Yokomizo
31eb9caee4 Fix the dark layout at NoteList 2017-04-08 16:03:53 +09:00
Kazu Yokomizo
64cf34e673 Fix the make note modal layout at white theme 2017-04-08 15:57:59 +09:00
Kazu Yokomizo
8996ebb819 Fix the make note modal layout at dark theme 2017-04-08 15:53:31 +09:00
Kazu Yokomizo
a36c62044b Fix the create folder modal layout at dark theme 2017-04-08 15:49:43 +09:00
Kazu Yokomizo
13418109ea Fix the create folder modal layout at white theme 2017-04-08 15:37:55 +09:00
Kohei TAKATA
fe7c05aaa5 Merge pull request #393 from BoostIO/feature-use-yarn
Using yarn
2017-04-08 12:51:48 +09:00
Kazu Yokomizo
116e27e0db Fix the textarea layout at Snippet note 2017-04-08 01:04:32 +09:00
Kazu Yokomizo
6b135afe1a Change the font-size at FolderSelect 2017-04-07 19:20:49 +09:00
Kazu Yokomizo
7a9c4951a2 Fix the tag layout of white theme at NoteDetail 2017-04-07 19:08:34 +09:00
Kazu Yokomizo
041a51a70f Fix the tag layout of dark theme at NoteDetail 2017-04-07 19:04:09 +09:00
Kazu Yokomizo
7b4ff9906e Change the note-title-icon position at NoteList 2017-04-07 18:51:34 +09:00
Kazu Yokomizo
11ab5c7598 Fix the tag layout of white theme at NoteList 2017-04-07 18:45:16 +09:00
Kazu Yokomizo
64d53c611b Fix the tag layout of dark theme at NoteList 2017-04-07 18:43:36 +09:00
Kazu Yokomizo
657d69a0fb Fix the dark theme layout at NoteList 2017-04-07 15:25:59 +09:00
Kazu Yokomizo
62d39e6715 Change the StorageList layout 2017-04-07 15:12:46 +09:00
Kazu Yokomizo
a27d8192ee Change the white theme layout of NoteList 2017-04-07 15:05:18 +09:00
SuenagaRyota
41b69afe03 Merge pull request #385 from BoostIO/Change-trashButton-size
Change the trashButton size
2017-04-06 23:04:20 -07:00
sota1235
54b5af0741 modify: update docs 2017-04-07 14:39:10 +09:00
sota1235
d4060f8a5a add: using yarn 🎉 2017-04-07 14:37:13 +09:00
SuenagaRyota
2935d41aba Merge pull request #386 from clone1612/productionPruneFix
Fix for 'npm prune --production' deleting needed dependencies
2017-04-06 22:33:16 -07:00
Kazu Yokomizo
af6cd10e28 Change the layout at SideNav 2017-04-07 14:24:38 +09:00
SuenagaRyota
435c80d870 Merge pull request #392 from asmsuechan/rm-finder-menu
Remove finder-menu
2017-04-06 21:30:04 -07:00
asmsuechan
775cec32da Remove finder-menu
it's no longer required
2017-04-06 21:22:25 -07:00
SuenagaRyota
e8cc7abadc Merge pull request #364 from Hastegan/master
Uniform the accelerator notation
2017-04-06 21:08:55 -07:00
Kazu Yokomizo
c1051afdc0 Change the SideNav layout 2017-04-07 00:38:49 +09:00
Kazu Yokomizo
573d3ce11e Fix the layout on NoteList 2017-04-06 23:25:38 +09:00
Kazu Yokomizo
0a89dcc6d8 Change the font-size at SideNav 2017-04-06 23:09:24 +09:00
Kazu Yokomizo
d45033ae8e Change the font-size at NoteList 2017-04-06 22:59:09 +09:00
Kazu Yokomizo
313e8b8c98 Fix the dark theme layout of Sidebar and NoteList 2017-04-06 22:11:59 +09:00
Jannick Hemelhof
d6a78dfe28 Fix for prune deleting needed packages 2017-04-05 14:53:51 +02:00
Kazu Yokomizo
de45852790 Change the trashButton size 2017-04-05 11:38:44 +09:00
Kazu Yokomizo
c6a505cb44 Merge pull request #384 from BoostIO/update-slack-invitiaon
Update slack invitiaon
2017-04-05 11:36:10 +09:00
Kazu Yokomizo
44427a40b7 Update readme
Update slack group invitation link.
2017-04-05 11:32:06 +09:00
Kazu Yokomizo
8a2ac08c0a Update readme
Update the slack group invitation link.
2017-04-05 11:31:12 +09:00
Kazu Yokomizo
7babf66d5f Merge pull request #340 from asmsuechan/remove-a-menu-on-delete
Remove a menu which is shown on clicked the trash button
2017-04-05 11:26:18 +09:00
hastegan
6daffbcafa uniform shortcut notation 2017-03-29 01:10:55 +02:00
Sota Sugiura
b76729e836 Merge pull request #362 from BoostIO/Edit-slackgrou-link
Edit slack group invitation link
2017-03-28 15:14:49 +09:00
Kazu Yokomizo
b2294e0fc9 modify: Edited the slack group invitation link
at Japanese
2017-03-28 14:49:21 +09:00
Kazu Yokomizo
3559737e8e modify: Edited the slack group invitation link 2017-03-28 14:48:15 +09:00
asmsuechan
40b7ce607b Add it to snippet note 2017-03-27 11:49:54 -07:00
asmsuechan
1de67a00cb Remove a menu which is shown on clicked the trash button 2017-03-27 11:44:42 -07:00
SuenagaRyota
6b4b44dba8 Merge pull request #358 from asmsuechan/modify-documents
Modify and add documents
2017-03-27 02:37:44 -07:00
asmsuechan
c424cc5d33 Change the sentence 2017-03-26 23:55:09 -07:00
asmsuechan
5b71d010b4 Add docs/ja/debug.md 2017-03-26 23:49:18 -07:00
asmsuechan
b9457d3e33 Add docs/debug.md 2017-03-26 23:49:08 -07:00
asmsuechan
60e267409c Modify ja/build.md accompanied by npm run dev-start 2017-03-26 23:20:04 -07:00
asmsuechan
e6a2521143 Modify build.md accompanied by npm run dev-start 2017-03-26 23:15:36 -07:00
Sota Sugiura
ae36ed2b46 Merge pull request #357 from asmsuechan/add-concurrently
Add concurrently for running local environment more easily
2017-03-27 14:30:21 +09:00
asmsuechan
fb2ed81fd3 Add concurrently for running local environment more easily 2017-03-26 22:04:47 -07:00
Sosuke Suzuki
a74651b515 load javascript mode of codemirror & clean up dirty codes 2017-03-25 15:32:45 +09:00
SuenagaRyota
6904c192e4 Merge pull request #352 from redcom/fix-288
fix: #288 Fixed Snippet tabs overwriting other tabs when closed
2017-03-23 13:41:54 -07:00
Razvan Moraru
6540d2670c better formatting 2017-03-23 21:01:49 +01:00
Razvan Moraru
966ba06bc4 change let to const 2017-03-23 17:50:39 +01:00
Razvan Moraru
3b4921b848 fix: #288 Fixed Snippet tabs overwriting other tabs when closed 2017-03-23 09:20:02 +01:00
SuenagaRyota
b11e10ac07 Merge pull request #347 from BoostIO/add-slack-group-link
Add slack group link
2017-03-22 18:50:03 -07:00
asmsuechan
2ec7ba04f5 Fix by lint 2017-03-22 00:21:49 -07:00
asmsuechan
095910d156 Fix the screen become black on closing Boostnote when a state of Boostnote is fullscreen on mac 2017-03-22 00:00:45 -07:00
Kazu Yokomizo
c39463aea8 modify: add the join to slack group link
Ver Japanese
2017-03-21 15:54:29 +09:00
Kazu Yokomizo
87e47c7ffb modify: Add the join to slack group link 2017-03-21 15:52:43 +09:00
Sota Sugiura
359f6734c5 Merge pull request #317 from BoostIO/feature-add-esilnt-rule
Add prefer-const rule and fix code
2017-03-21 15:16:48 +09:00
sota1235
1d3e71cf49 fix: for ESLint 2017-03-21 15:14:03 +09:00
Sota Sugiura
1ab449cecf Merge branch 'master' into feature-add-esilnt-rule 2017-03-21 15:04:14 +09:00
Sota Sugiura
44dd609134 Merge pull request #289 from kostaldavid8/master
Smart bullets
2017-03-21 15:02:25 +09:00
kostaldavid8
1e8e161a33 remove console.log 2017-03-20 19:42:14 +01:00
kostaldavid8
c56d232e58 Added + as bullet, bug fix 2017-03-20 19:22:31 +01:00
Sota Sugiura
8315b75587 Merge pull request #342 from sota1235/feature-v0-8-7
v0.8.7
2017-03-20 16:11:24 +09:00
sota1235
562b0592af v0.8.7 2017-03-20 15:39:34 +09:00
Sota Sugiura
1fd1bed01a Merge pull request #343 from asmsuechan/remove-markdown-it-toc
Remove markdown-it-toc because an errors are happening
2017-03-20 15:38:32 +09:00
asmsuechan
4f116cba34 Remove markdown-it-toc because an errors are happening 2017-03-19 23:32:51 -07:00
Sota Sugiura
9d1d57f183 Merge pull request #331 from asmsuechan/fix-the-behavior-of-lock
Fix the behavior of a feature which locks the editor
2017-03-20 15:31:44 +09:00
asmsuechan
6feeee8933 Refactor the styles of the buttons 2017-03-19 22:17:01 -07:00
asmsuechan
5541c0dc38 Refactor styles of the buttons 2017-03-19 22:11:02 -07:00
asmsuechan
4a8054faed Fix the design of the trash button on snippet note 2017-03-19 22:04:19 -07:00
asmsuechan
bbced7be25 Fix the background-color of button 2017-03-19 21:56:41 -07:00
asmsuechan
4055ce19cd Fix the design of buttons of TopBar on dark theme 2017-03-19 11:18:17 -07:00
asmsuechan
bcf27233bc Fix a style of the lock button 2017-03-19 01:31:28 -07:00
asmsuechan
45111e1610 Change the styleName info-right-button to control-trashButton because it's not good name
* fix the position of lock button
2017-03-19 01:20:04 -07:00
asmsuechan
2af86dfa3e Fix the action of hover 2017-03-19 01:02:47 -07:00
Sota Sugiura
1b474e1c28 Merge pull request #337 from BoostIO/Change-the-tray-icon
Changed the tray icon when mouse on.
2017-03-19 16:45:15 +09:00
Sota Sugiura
c4370694cc Merge pull request #295 from asmsuechan/add-a-shortcut-for-jump-to-top
Add a shortcut which jumps to top by Ctrl-G
2017-03-19 16:43:15 +09:00
asmsuechan
91f24d96b9 Fix a bug which cannot read a property when moves to other folder on locking 2017-03-19 00:41:55 -07:00
Kazu Yokomizo
bb0b74e889 Changed the tray icon when mouse on. 2017-03-19 16:20:55 +09:00
asmsuechan
525ab900bd Fix == to === 2017-03-19 00:18:09 -07:00
asmsuechan
31c04de7b6 Change the name list:top to list:jumpToTop 2017-03-19 00:18:09 -07:00
asmsuechan
dea0c4287b Fix let to const 2017-03-19 00:18:09 -07:00
asmsuechan
cec4b3132c Add a shortcut which jumps to top by Ctrl-G 2017-03-19 00:18:05 -07:00
asmsuechan
f3ed22dd51 Enable to appear a tooltip for the LockButton 2017-03-18 23:19:43 -07:00
asmsuechan
6aa9104076 Fix not to be shown the lock button if config.editor.switchPreview is
RIGHTCLICK
2017-03-18 23:19:43 -07:00
asmsuechan
e7fd18967b Change a state name editorStatus to isLockButtonShown 2017-03-18 23:19:43 -07:00
asmsuechan
8a5558db55 Change a name showlockbutton to togglelockbutton 2017-03-18 23:19:43 -07:00
asmsuechan
4767f15e9b Fix the behavior of a feature what locks the editor 2017-03-18 23:19:43 -07:00
Sota Sugiura
b7ca4668e9 Merge pull request #301 from asmsuechan/add-a-shortcut-for-supporting-to-input-bold
Add a shortcut for supporting to input bold
2017-03-19 15:08:17 +09:00
Sota Sugiura
70e637fada Merge pull request #326 from asmsuechan/refactor-typos
Fix typos
2017-03-19 14:09:29 +09:00
SuenagaRyota
459b0ff030 Merge pull request #316 from asmsuechan/fix-the-design-of-li
Fix the design of li
2017-03-18 10:58:30 -07:00
SuenagaRyota
2903788fd4 Merge pull request #330 from BoostIO/feature-dragDrop-svg
dragged svg file is turns not into xml text
2017-03-17 22:54:04 -07:00
Sosuke Suzuki
af0fdb9277 move the line under L57 2017-03-18 14:49:46 +09:00
SuenagaRyota
41a58583dc Merge pull request #324 from BoostIO/feature_note_title_markdown_sharp
ignore # in the code block
2017-03-17 21:48:16 -07:00
Sosuke Suzuki
c80a26fe0b dragged svg file is turns not into xml text 2017-03-18 13:44:35 +09:00
Sosuke Suzuki
806c3bbaf9 delete unnecessary } and correct the indent 2017-03-18 12:27:43 +09:00
Sosuke Suzuki
fe1c197138 reduce indent 2017-03-18 03:02:04 +09:00
Sosuke Suzuki
b577ca2bc2 Refactor the dirty code 2017-03-18 01:58:15 +09:00
asmsuechan
70a97a6a2a Fix a typo 2017-03-16 13:30:24 -07:00
Sosuke Suzuki
034f46792b ignore # in the code block 2017-03-17 03:42:17 +09:00
SuenagaRyota
3dc1b59753 Merge pull request #307 from BoostIO/feature-trashCan-icon
I changed the button  deleting snnipet and markdown from ... to trash can.
2017-03-15 13:55:31 -07:00
SuenagaRyota
98b761f1d1 Merge pull request #322 from BoostIO/featureSuccessfullyDeleteSubtab
The snippet subtab was successfully deleted.
2017-03-15 13:51:11 -07:00
Sosuke Suzuki
712301436d I crrected indents 2017-03-16 02:54:57 +09:00
Sosuke Suzuki
4243afb033 remove the extra file, and correct indents 2017-03-16 02:34:26 +09:00
Sosuke Suzuki
0f43485606 The snippet subtab was successfully deleted. 2017-03-16 01:36:58 +09:00
Sota Sugiura
b91b88f16e Merge pull request #321 from BoostIO/Change-the-tray-icon
Change the tray icons.
2017-03-14 14:24:02 +09:00
Kazu Yokomizo
2f2c500e4a Change the tray icons. 2017-03-14 13:59:59 +09:00
sota1235
7065fad69b modify: change warning level for no-lone-blocks rule 2017-03-13 18:55:16 +09:00
sota1235
6fcbca6b10 refactor: by ESLint 2017-03-13 18:40:12 +09:00
sota1235
93b15f2a7a modify: change warning level for no-undef 2017-03-13 18:36:21 +09:00
sota1235
df9d8ff735 modify: change warning level for no-unused-var 2017-03-13 18:33:39 +09:00
sota1235
fda17e044e modify: change warning level for prefer-const rule 2017-03-13 18:26:56 +09:00
sota1235
b4e54fc149 modify: npm script 2017-03-13 18:26:39 +09:00
asmsuechan
48514d1020 Change an arg name md to mdElement 2017-03-12 16:07:40 -07:00
asmsuechan
49a4ec5e16 Enable CTRL + B in a word to make it bold 2017-03-12 16:04:08 -07:00
asmsuechan
c3e92b3b81 Fix if clauses 2017-03-12 16:04:00 -07:00
asmsuechan
e78492983a Add a shortcut for supporting to input bold 2017-03-12 16:02:52 -07:00
sota1235
fac0abaed6 modify: add prefer-const rule and fix code 2017-03-10 10:12:23 +09:00
asmsuechan
a6bd239592 Fix the design of li
* fix the design of markdown-it-TOC
2017-03-09 13:04:14 -08:00
SuenagaRyota
7845bbd881 Merge pull request #310 from Gansgar/master
Added Table of Contents and two small bug fixes
2017-03-09 12:09:50 -08:00
SuenagaRyota
68bc440749 Merge pull request #298 from asmsuechan/fix-drop-an-image-on-CodeEditor-and-MarkdownPreview
Disable dragging an image to MarkdownPreview and fix the behavior of an image dropped on CodeEditor.
2017-03-08 15:38:27 +09:00
SuenagaRyota
6dbe3cec69 Merge pull request #283 from asmsuechan/add-lock-to-CodeEditor
Enable lock in MarkdownEditor
2017-03-07 11:16:55 +09:00
georg
850c339bb3 bug fix to select all
- at least on OSX fixed bug, that would select all text when clicking,
opening or any other action was done
2017-03-04 18:37:04 +01:00
georg
57835d0e32 Added ToC support
- added `markdown-it-toc-and-anchor` into the project
- integrated it, create a table of contents every in a markup by adding
`@[TOC]`
2017-03-04 17:48:17 +01:00
georg
ac2c50c8bc Fixed background of taskListItem
- fixed background bug when using a taskListItem with the light design
2017-03-04 17:18:30 +01:00
Kohei TAKATA
7296cbe4ec Merge pull request #309 from BoostIO/feature-v0-8-6
v0.8.6
2017-03-04 14:06:31 +09:00
Kohei TAKATA
16061a7eba v0.8.6 2017-03-04 13:04:18 +09:00
Sosuke Suzuki
566fe92589 change the icon to delete snippet and markdown 2017-03-03 02:13:13 +09:00
asmsuechan
83cef13f1c Change let to const 2017-02-21 23:30:37 +09:00
asmsuechan
4bb9533049 Fix prevention of an image dropped on MarkdownPreview and fix the behavior of an image dropped on CodeEditor 2017-02-21 00:14:03 +09:00
kostaldavid8
d07c62e266 Merge branch 'master' of https://github.com/BoostIO/Boostnote 2017-02-18 23:36:09 +01:00
SuenagaRyota
8beb661af4 Merge pull request #291 from kostaldavid8/image-drag-fix
Image drag fix
2017-02-18 21:06:16 +09:00
Sosuke Suzuki
5a201dd1b9 correction the pointed out code 2017-02-18 12:26:38 +09:00
asmsuechan
aa0ad3bb70 Fix from review 2017-02-18 12:18:55 +09:00
kostaldavid8
f7fb531902 Fixed image drag and drop
Added escaping and changed function that wasn't working
2017-02-17 10:31:41 +01:00
kostaldavid8
c65db4e2b0 Fixed image drag and drop
Added escaping and changed function that wasn't working
2017-02-17 10:04:55 +01:00
Sota Sugiura
b32b38bb0d Merge pull request #287 from ericsolomon/274_font_color_rename_folder_modal
Fix font color for dark theme rename folder modal
2017-02-16 21:38:37 -08:00
kostaldavid8
d6171dc502 Smart numbered lists, too
Has auto increment, but no auto indent on tab, I don't know what to do
2017-02-16 13:18:17 +01:00
Sosuke Suzuki
7b5a7aabed add HighLightCheckEditor 2017-02-16 13:00:45 +09:00
kostaldavid8
77eb19af40 Code style fixes 2017-02-15 23:30:56 +01:00
kostaldavid8
e68d535fa2 Smart bullets
When you hit enter on a line with a bullet, you get a new one on the new line.
Also when you hit tab after a bullet, it automatically indents.
It makes typing with bullets much more pleasant.
2017-02-15 22:18:20 +01:00
Eric Solomon
6e5f6cc739 Fix font color for dark theme rename folder modal 2017-02-14 03:21:23 -06:00
asmsuechan
bbeeeccb31 Fix to use by preventDefault 2017-02-11 23:09:03 +09:00
asmsuechan
e9525fae22 Change the order of focus and emit 'editor:lock' 2017-02-11 23:09:01 +09:00
asmsuechan
672d409bf2 Enable to show the lock icon only the Editor state is CODE 2017-02-11 17:52:11 +09:00
Kohei TAKATA
6624178864 Merge pull request #284 from BoostIO/feature-v0-8-5
v0.8.5
2017-02-11 17:47:30 +09:00
Kohei TAKATA
4a66c6717c v0.8.5 2017-02-11 16:08:31 +09:00
Kohei TAKATA
dd76bc027b Merge pull request #282 from BoostIO/fix-windows-taskbar-icon
Fix windows taskbar icon
2017-02-11 16:02:58 +09:00
asmsuechan
74ee6ae6ce Add lock icon to NoteDetail 2017-02-11 15:48:38 +09:00
Kohei TAKATA
1ae3f295f3 Remove unused variable 2017-02-11 15:47:25 +09:00
Kohei TAKATA
3cb2ce41fe Merge pull request #278 from EmEpsilon/fix-239-on-windows
refs #239 [Fix] cannot open finder with using hotkey on windows
2017-02-11 15:38:21 +09:00
Kohei TAKATA
5534319e93 Fix windows taskbar icon 2017-02-11 14:05:14 +09:00
EmEpsilon
c7373c15a5 Fix: cannot open finder with using hotkey 2017-02-10 00:35:31 +09:00
Sota Sugiura
dbf1d6403b Merge pull request #216 from asmsuechan/decode-for-codemirror
Decodes HTML entity in code area
2017-02-08 05:44:49 -08:00
Sosuke Suzuki
743b220953 unfinished syntaxHighLightCheck 2017-02-04 14:41:26 +09:00
Sota Sugiura
95d74c6f5b Merge pull request #269 from sota1235/feature-v0-8-4
v0.8.4
2017-01-28 14:22:42 +09:00
sota1235
f04b7db9fc v0.8.4 2017-01-28 13:54:54 +09:00
Sota Sugiura
900fa023fb Merge pull request #261 from asmsuechan/change-Ctrl-E-customizable
refs #260 Change a shortcut Ctrl-E to Ctrl-W
2017-01-28 13:37:08 +09:00
asmsuechan
ad9da44afb Move a shortcut escapeFromCodeEditor from CodeEditor to MarkdownEditor, because it's not customizable 2017-01-28 13:27:34 +09:00
asmsuechan
c827717202 refs #260 Change a shortcut Ctrl-E to Ctrl-W
it escapes CodeEditor to MarkdownPreview
2017-01-28 12:51:49 +09:00
Sota Sugiura
7d3caa3c2e Merge pull request #267 from asmsuechan/fix-ctrl-e-shortcut
Fix Ctrl + E shortcut on escape from CodeEditor
2017-01-28 12:48:32 +09:00
asmsuechan
fde7fbccac Fix Ctrl + E shortcut on escape from CodeEditor 2017-01-27 01:27:29 +09:00
Sota Sugiura
56f06fa7d5 Merge pull request #262 from BoostIO/Changed-the-order-of-English-and-Japanese
Changed the order of English and Japanese.
2017-01-26 11:24:07 +09:00
Sota Sugiura
c0fba82e73 Merge pull request #265 from BoostIO/delete-readme-ko
Delete readme-ko.md
2017-01-26 11:23:34 +09:00
Kohei TAKATA
5438cd14a0 Merge pull request #257 from sota1235/feature-fix_style_for_side_nav
Fix style for side nav
2017-01-25 19:20:47 +09:00
Sota Sugiura
0d642b308d Merge pull request #264 from BoostIO/add-maintainer-1
add-maintainer(ja)
2017-01-25 01:29:52 +09:00
Sota Sugiura
0b96472f72 Merge pull request #259 from BoostIO/add-maintainer
Add maintainer
2017-01-25 01:29:37 +09:00
Kazu Yokomizo
675d0ed08c Delete readme-ko.md 2017-01-25 01:29:24 +09:00
Kazu Yokomizo
9c0f5c31c2 add-maintainer(ja) 2017-01-25 01:22:19 +09:00
Kazu Yokomizo
09ce59fd04 Deleted (English) 2017-01-25 01:14:54 +09:00
Kazu Yokomizo
98cd83c4e0 Changed the order of English and Japanese. 2017-01-24 19:18:52 +09:00
Kazu Yokomizo
1aec386656 Add maintainer 2017-01-21 18:45:28 +09:00
sota1235
b03cd9cd99 modify: fix style for side nav 2017-01-21 17:34:02 +09:00
Sota Sugiura
27265e210f Merge pull request #256 from BoostIO/release-v0-8-3
v0.8.3
2017-01-21 16:51:45 +09:00
sota1235
c392c5d178 v0.8.3 2017-01-21 16:32:27 +09:00
Sota Sugiura
11fe420fac Merge pull request #255 from BoostIO/featureEscButton
Feature esc button
2017-01-21 16:30:45 +09:00
Sota Sugiura
9b17a8fb5b Merge pull request #250 from asmsuechan/add-drop-image
Dropping images into CodeEditor
2017-01-21 16:28:56 +09:00
Sota Sugiura
27f3fd0032 Merge pull request #241 from asmsuechan/iss-208
Fixes syntax hilight of inline code on Preview
2017-01-21 16:14:58 +09:00
Sota Sugiura
1672d9fa5f Merge pull request #235 from asmsuechan/add-focus-shortcut
Adds shortcuts
2017-01-21 16:12:13 +09:00
asmsuechan
59c9e11879 Change the color in <code> tag on preview 2017-01-21 16:12:03 +09:00
asmsuechan
4523743150 Fix by review
refs: https://github.com/BoostIO/Boostnote/pull/235#pullrequestreview-17800321
2017-01-21 16:06:14 +09:00
Sosuke Suzuki
2fdbe9de96 unify finder backgroundcolor 2017-01-21 16:04:55 +09:00
asmsuechan
a617976c78 Fix by review
refs: https://github.com/BoostIO/Boostnote/pull/250#pullrequestreview-17801164
2017-01-21 15:57:42 +09:00
Sota Sugiura
7201a98d78 Merge pull request #245 from asmsuechan/add-md-and-text-exporter
Add export as txt/md
2017-01-21 15:54:01 +09:00
Sosuke Suzuki
472560e2bf correction EscButton in darkmode 2017-01-21 15:52:06 +09:00
Sota Sugiura
96753fe0a0 Merge pull request #254 from BoostIO/featureFinderBackgroundColor
unify finder backgroundcolor
2017-01-21 15:51:15 +09:00
Sosuke Suzuki
83c2fdd161 unify finder backgroundcolor 2017-01-21 15:44:52 +09:00
asmsuechan
911ce7572f Fix by review
refs: https://github.com/BoostIO/Boostnote/pull/245#pullrequestreview-17800372
2017-01-21 15:44:48 +09:00
Sota Sugiura
0a24d7d4a7 Merge pull request #247 from asmsuechan/iss-246
Fix a Bug when using the Finder Window with markdown Notes
2017-01-21 15:05:51 +09:00
Sota Sugiura
c542062d4d Merge pull request #253 from BoostIO/featureEscButton
changeEscButton
2017-01-21 14:55:13 +09:00
Sosuke Suzuki
eb7a195cce NewNoteModal fineModification 2017-01-21 14:50:10 +09:00
Sosuke Suzuki
23a356164e changeEscButton 2017-01-21 14:31:38 +09:00
asmsuechan
de19c51061 Change to use Object.assign by checking keyPressed and remove unnecessary processing 2017-01-21 01:04:33 +09:00
asmsuechan
221b6a2938 Alert users try to export md/txt in SNIPPET 2017-01-20 18:56:33 +09:00
asmsuechan
cda9d53c8e Add image dropper 2017-01-19 01:32:06 +09:00
Sota Sugiura
f043b0ffb3 Merge pull request #248 from whizark/more-zoom-options
modify: add more zoom options (140-200%)
2017-01-19 00:23:07 +09:00
Sota Sugiura
28e0590327 Merge pull request #244 from asmsuechan/hotfix-an-error-occurs-on-update
Fix a bug due to event handler of before-quit on update
2017-01-19 00:15:56 +09:00
asmsuechan
ec6de1b91b Fix typo 2017-01-19 00:01:14 +09:00
asmsuechan
2b0bdbf1c8 Fix pointed part by review 2017-01-18 12:03:29 +09:00
asmsuechan
f48864a2e7 Fix pointed part by review 2017-01-18 10:09:12 +09:00
Whizark
94c6578675 modify: add more zoom options (140-200%)
* https://github.com/BoostIO/Boostnote/issues/31#issuecomment-267843725
2017-01-18 02:52:26 +09:00
asmsuechan
2af2399971 refs #247 Add fixed blur handler 2017-01-17 11:27:37 +09:00
asmsuechan
ebea01cecf refs #246 Fix a Bug when using the Finder Window with markdown Notes 2017-01-16 22:17:25 +09:00
asmsuechan
5d1db1de31 Add export as txt/md 2017-01-16 13:09:59 +09:00
asmsuechan
6c528625d8 Fix a bug due to event handler of before-quit on update 2017-01-16 04:36:23 +09:00
sota1235
7b326b99af v0.8.2 2017-01-15 18:37:39 +09:00
asmsuechan
2a60ba95e0 refs #208 Fixes syntax hilight of inline code on Preview 2017-01-14 20:45:53 +09:00
Sota Sugiura
6b98afaa02 Merge pull request #238 from BoostIO/update-todo-link
Update to readme
2017-01-14 20:39:06 +09:00
asmsuechan
cdb079dc81 refs #226 Enables to use multiple key for shortcut 2017-01-14 20:26:43 +09:00
asmsuechan
2ac0d93caf refs #226 Adds Control to Hint of Hotkey 2017-01-14 19:17:47 +09:00
asmsuechan
41977e8726 refs #226 Adds shortcuts which move next note and prior note to main-menu 2017-01-14 19:17:43 +09:00
asmsuechan
b9e6a56a83 refs #226 Changes to toggle by Ctrl + S 2017-01-14 19:17:41 +09:00
asmsuechan
2468c8311f refs #226 Adds focus to search shortcut to main-menu 2017-01-14 19:17:39 +09:00
asmsuechan
e8e05b20cd refs #226 Adds blur shortcut on Editor 2017-01-14 19:17:35 +09:00
asmsuechan
5bd0a446f1 refs #226 Adds a shortcut which focuses the note 2017-01-14 19:17:24 +09:00
sota1235
ad4e50d542 hack: for ESLint 2017-01-14 18:15:48 +09:00
Sota Sugiura
13131a0d5c Merge pull request #240 from asmsuechan/iss-239
refs #239 Fixes a bug which cannot open finder with using HotKey
2017-01-14 18:11:59 +09:00
asmsuechan
f007664745 refs #239 Fixes a bug which cannot open finder with using HotKey 2017-01-14 18:04:54 +09:00
sota1235
87f9589be3 v0.8.1 2017-01-14 17:09:45 +09:00
Kazu Yokomizo
e059106a93 update-ja-readme 2017-01-14 17:08:35 +09:00
Kazu Yokomizo
ada1b4de6b update-todo-link 2017-01-14 17:05:58 +09:00
Sota Sugiura
96413b9851 Merge pull request #218 from asmsuechan/feature-vim-keymap
Adds vim keymap setting
2017-01-14 17:03:20 +09:00
Sota Sugiura
9699ef6319 Merge pull request #237 from sota1235/feature-add_folder_on_note_detail
Add folder selector on note detail.
2017-01-14 16:57:00 +09:00
sota1235
dd8f4d60f0 fix: do not ignore dist file 2017-01-14 16:49:38 +09:00
asmsuechan
372f2e7319 Adds a prop keyMap to NoteDetail and SnippetNoteDetail 2017-01-14 16:39:50 +09:00
sota1235
1957d87dd7 modify: fix font size - folder name 2017-01-14 15:52:11 +09:00
sota1235
a148d17ba1 modify: add folder selector on top of note detail component 2017-01-14 15:44:28 +09:00
sota1235
297553c240 modify: move updated string to the bottom of note detail component 2017-01-14 14:54:08 +09:00
sota1235
f0fcaa6be7 modify: move zoom-pointer to left on note detail component 2017-01-14 14:47:06 +09:00
sota1235
cfa40f3ec1 refactor: remove unused component 2017-01-14 14:40:33 +09:00
sota1235
832c43de88 refactor: remove unused option 2017-01-14 14:36:26 +09:00
sota1235
1665e18edb fix: remove unused npm command 2017-01-14 13:52:10 +09:00
Sota Sugiura
fd1717046b Merge pull request #232 from BoostIO/simplified
I simplified.
2017-01-14 13:36:47 +09:00
sota1235
7fe7c555bc modify: add badge for TravisCI 2017-01-14 13:30:42 +09:00
Sota Sugiura
411a7a8e80 Merge pull request #233 from BoostIO/update-more-information
Update more information.
2017-01-14 13:27:38 +09:00
sota1235
196f5a7bf7 modify: add license section 2017-01-14 13:24:25 +09:00
Kazu Yokomizo
3fa326121a Update more information. 2017-01-12 20:35:53 +09:00
Kazu Yokomizo
cce69bea3a I simplified. 2017-01-12 20:29:20 +09:00
Sota Sugiura
f70cf7845d Merge pull request #231 from sota1235/master
[Refactor] Use ESLint instead of StandarJS and add settings for TravisCI
2017-01-12 00:48:05 +09:00
Sota Sugiura
bd0a326128 Merge pull request #20 from sota1235/feature-settings_for_travis
Settings for TravisCI
2017-01-12 00:34:44 +09:00
sota1235
897d99e043 modify: add badge of TravisCI on README 2017-01-12 00:28:10 +09:00
sota1235
b0f288e103 fix: ignore invalid tests 2017-01-12 00:23:44 +09:00
sota1235
7d26d46c7b modify: execute test on TravisCI 2017-01-12 00:01:12 +09:00
sota1235
5c7804fc40 modify: fix some codes pointed by eslint 2017-01-11 23:59:48 +09:00
sota1235
836f3af1ab add: files for using eslint 2017-01-11 23:52:22 +09:00
sota1235
67b89d4fe7 modfiy: install npm libraries for using eslint 2017-01-11 23:49:59 +09:00
sota1235
bc2d9d0fe2 modify: add settings for travisci 2017-01-11 23:38:43 +09:00
sota1235
79f33b9405 refactor: fix some coding style pointed by standard js 2017-01-11 23:35:02 +09:00
sota1235
ed9ddee5f1 refactor: fix by standardjs 2017-01-11 23:17:32 +09:00
sota1235
0d004b2f0a add: npm script for fix codes with standardjs 2017-01-11 23:13:50 +09:00
sota1235
f41ff77d76 add: npm command for checking coding style 2017-01-11 23:12:24 +09:00
sota1235
ae97a76d2e add: for using TravisCI 2017-01-11 23:10:09 +09:00
Sota Sugiura
3ca18c04c6 Merge pull request #221 from asmsuechan/remember-window-size
refs #207 Keeps window size
2017-01-11 23:03:01 +09:00
asmsuechan
2b03e6e956 refs #207 Fixes lengthy assignment 2017-01-11 22:56:12 +09:00
Sota Sugiura
010793a478 Merge pull request #228 from asmsuechan/iss-224
refs #224 Fixes the style of folder-list
2017-01-11 22:30:03 +09:00
asmsuechan
b136512ece refs #224 Fixes the style of folder-list 2017-01-11 10:21:53 +09:00
asmsuechan
9179c199fe refs #207 Keeps window size 2017-01-09 11:37:05 +09:00
Sota Sugiura
cfa4dfa817 Merge pull request #222 from asmsuechan/fix-npm-install
Fixes npm task bacause oh-my-cdn is removed
2017-01-09 11:35:13 +09:00
asmsuechan
6a73a3af97 Fixes npm task bacause oh-my-cdn is removed 2017-01-09 11:27:55 +09:00
Sota Sugiura
923c24fa6c Merge pull request #214 from asmsuechan/master
Fixes the theme of code block by codemirror
2017-01-08 23:53:10 +09:00
Sota Sugiura
4b1c8a3238 Merge pull request #206 from sota1235/hotfix-replace_old_url
Replace old url.
2017-01-08 23:46:54 +09:00
sota1235
76508fbc3b refactor: remove oh-my-cdn 2017-01-08 23:45:34 +09:00
sota1235
2bfda95ed8 modify: get flowchart.js from npm 2017-01-08 23:44:49 +09:00
Sota Sugiura
6e5082a470 Merge pull request #220 from BoostIO/Fixed-the-features-url(ja)
Fixed the features url(ja).
2017-01-08 19:47:32 +09:00
Kazu Yokomizo
a6cec44fc4 Fixed the features url(ja). 2017-01-08 19:45:45 +09:00
Sota Sugiura
600fab4f23 Merge pull request #219 from BoostIO/Fixed-the-features-url
Fixed the features url.
2017-01-08 19:45:26 +09:00
Kazu Yokomizo
12377b8caf Fixed the features url. 2017-01-08 19:44:46 +09:00
Sota Sugiura
250c6e488d Merge pull request #211 from BoostIO/Update-Author-&-Maintainer
Update Author & Maintainer
2017-01-08 19:42:35 +09:00
Kazu Yokomizo
3a9b57adae Merge branch 'master' into Update-Author-&-Maintainer 2017-01-08 19:41:31 +09:00
Sota Sugiura
74415956ac Merge pull request #213 from BoostIO/Updated-of-Japanese-readme
Updated of Japanese readme.
2017-01-08 19:36:08 +09:00
Sota Sugiura
33d7ed25a5 Merge pull request #212 from BoostIO/Fixed-link-and-typo
Fixed link and typo.
2017-01-08 19:33:05 +09:00
asmsuechan
df2de5c081 Adds note of caution next to keymap change select box 2017-01-08 18:16:32 +09:00
asmsuechan
7f4c58a84a Adds vim keymap setting 2017-01-08 17:52:52 +09:00
asmsuechan
a641a7b3e4 Decodes HTML entity in code area 2017-01-08 12:29:43 +09:00
asmsuechan
7437b26e3c Fixes in order to handle default setting 2017-01-07 23:51:37 +09:00
asmsuechan
ee6d41859f Fixes the theme of code block by codemirror 2017-01-07 22:48:37 +09:00
Kazu Yokomizo
b368c3b5d8 Updated of Japanese readme.
Link, typo and list of Author & Maintainer
2017-01-07 19:33:31 +09:00
Kazu Yokomizo
b1ae2b0b6f Fixed link and typo. 2017-01-07 19:26:36 +09:00
Kazu Yokomizo
27a6d53c7f Update Author & Maintainer
add sota1235, Kohei TAKATA and Kazu Yokomizo.
2017-01-07 18:07:23 +09:00
sota1235
4caf3a81be fix: update the url of official homepage 2017-01-05 00:08:18 +09:00
sota1235
ab578f768f refactor: remove unused file 2017-01-05 00:06:03 +09:00
Sota Sugiura
e4212e796a Merge pull request #204 from sota1235/master
Use npm instead of using oh-my-cdn
2017-01-04 23:55:57 +09:00
Sota Sugiura
95b1ff9b41 Merge pull request #19 from sota1235/feature-remove_oh_my_cdn
Remove oh-my-cdn
2017-01-04 23:53:50 +09:00
sota1235
684d2c411e fix: path for react-dom.min.js 2017-01-04 23:51:29 +09:00
sota1235
42710cfee5 refactor: remove libraries in package.json 2017-01-04 23:46:06 +09:00
sota1235
277004fd9b refactor: replace with files in node_modules 2017-01-04 23:30:15 +09:00
sota1235
14f79c4c21 modify: install libraries with using npm, not using oh-my-cdn 2017-01-04 23:15:32 +09:00
Sota Sugiura
f88cd80dca Merge pull request #198 from sota1235/master
v0.8.0
2017-01-03 18:14:15 +09:00
sota1235
19ada1dbf6 v0.8.0 2017-01-03 18:13:12 +09:00
sota1235
7754ab1a2e modify: update readem for using new design 2017-01-03 18:11:47 +09:00
sota1235
de0a8837eb add: image file for readme 2017-01-03 18:09:15 +09:00
Sota Sugiura
042d059d53 Merge pull request #15 from sota1235/feature-design_renewal_rebase
Design renewal (v0.8.0)
2017-01-03 17:57:10 +09:00
sota1235
cba743c895 modify: fix sidenav style for folded mode 2017-01-03 17:56:30 +09:00
sota1235
24ee71ac06 modify: fix top for storage list 2017-01-03 17:51:00 +09:00
Sota Sugiura
0ec4ef3363 Merge pull request #18 from sota1235/hotfix-updated_string
Fix for updated string.
2017-01-03 17:33:31 +09:00
sota1235
98120a5e40 modify: fix style for updated date on note detail 2017-01-03 17:32:25 +09:00
Sota Sugiura
3cb2a6bf92 Merge pull request #17 from sota1235/hotfix-for_review
Some fix specified by @kazup.
2017-01-03 17:03:08 +09:00
sota1235
4b7262cb72 fix: text color on creating new folder form (dark theme) 2017-01-03 17:01:04 +09:00
sota1235
eac8b13d7b modify: fix padding for storage note count 2017-01-03 16:58:44 +09:00
sota1235
4458c58066 fix: scrolling for folder list 2017-01-03 16:56:52 +09:00
sota1235
245d603ae8 fix: Hello, 2017! 2017-01-03 16:54:07 +09:00
Sota Sugiura
e3d959522b Merge pull request #16 from sota1235/hotfix-border_for_hint_button
Fix style for hint button.
2017-01-03 16:30:58 +09:00
sota1235
124544452b fix: border-radius for hint button 2017-01-03 16:29:41 +09:00
sota1235
4534625084 modify: fix style for h1, h2 tag on markdown preview 2017-01-03 16:16:06 +09:00
sota1235
3e4342eec4 modify: remove underline for h tag on markdown previe 2017-01-03 16:16:06 +09:00
sota1235
0ed2d26129 fix: for renewal 2017-01-03 16:16:06 +09:00
sota1235
1b538993db modify: design for modal window creating new folder (dark theme) 2017-01-03 16:16:05 +09:00
sota1235
d67e4009e7 modify: change design for model window creating new folder 2017-01-03 16:16:05 +09:00
sota1235
7f066c4443 modify: fix some parameter for whole components 2017-01-03 16:16:05 +09:00
sota1235
2594ca984a modify: change style for snippet note on finder component 2017-01-03 16:16:05 +09:00
sota1235
0e089fadfb refactor: move component to common components directory 2017-01-03 16:16:05 +09:00
sota1235
e56518e13d modify: replace the component with common component 2017-01-03 16:16:05 +09:00
sota1235
c9bc0c89ff refactor: cut down the component from SideNav component 2017-01-03 16:16:05 +09:00
sota1235
b18b1171e7 refactor: replace storage item component with common component 2017-01-03 16:16:05 +09:00
sota1235
d65464401c refactor: replace component with common component 2017-01-03 16:16:05 +09:00
sota1235
e9a9e10c81 modify: cut down the component from SideNav component 2017-01-03 16:16:05 +09:00
sota1235
825cd6a93b modify: change design for note list on finder 2017-01-03 16:16:05 +09:00
sota1235
276471979a modify: move components file 2017-01-03 16:16:05 +09:00
sota1235
d6903edac7 modify: fix for black theme 2017-01-03 16:16:05 +09:00
sota1235
4e1b4bdd6a fix: border design for note item list 2017-01-03 16:16:05 +09:00
sota1235
52f0a5639d fix: markup for box-shadow 2017-01-03 16:16:05 +09:00
sota1235
58181d02b2 modify: change color for escape button on config modal 2017-01-03 16:16:05 +09:00
sota1235
1fea39f1b7 modify: add esc button for config modal 2017-01-03 16:16:05 +09:00
sota1235
ae97ff0f98 modify: fix some colors for config 2017-01-03 16:16:05 +09:00
sota1235
b2d7fa9e97 modify: fix style for button on storages config 2017-01-03 16:16:05 +09:00
sota1235
93e9235bb2 modify: markup style for info tab on config modal 2017-01-03 16:16:05 +09:00
sota1235
094bce20e2 modfiy: markup for UI config tab. 2017-01-03 16:16:05 +09:00
sota1235
2f9d4c447a modify: markup style for Hotkey config modal 2017-01-03 16:16:05 +09:00
sota1235
84eb790d93 modify: extend common config 2017-01-03 16:16:05 +09:00
sota1235
ebd07694db add: common style for config tabs 2017-01-03 16:16:05 +09:00
sota1235
2bbac8a6f4 modify: markup for storages config 2017-01-03 16:16:05 +09:00
sota1235
e74f5e835f modify: fix style for dark theme 2017-01-03 16:16:05 +09:00
sota1235
69e753cc71 modify: use new components insted of ConfigTab component 2017-01-03 16:16:05 +09:00
sota1235
b0978c772e modify: devide ConfigTab component for two components 2017-01-03 16:16:05 +09:00
sota1235
fb4dfbadf3 modify: change layout for config modal 2017-01-03 16:16:05 +09:00
sota1235
d19ff3ff17 modify: add shadow on notelist and topbar component(light theme) 2017-01-03 16:16:05 +09:00
sota1235
d0990be856 modify: fix font color for tags 2017-01-03 16:16:05 +09:00
sota1235
268d66b51d modify: add icon for NoteItem component 2017-01-03 16:16:05 +09:00
sota1235
c1df311e86 modify: add icon for NoteItemSimple component 2017-01-03 16:16:05 +09:00
sota1235
cc3bd41df2 modify: change text-align for title of the snipet files 2017-01-03 16:16:05 +09:00
sota1235
856979b455 modify: add border line on NoteList component 2017-01-03 16:16:05 +09:00
sota1235
47925489fd modify: not showing star when the note is not starred 2017-01-03 16:16:05 +09:00
sota1235
8aefb21123 modify: remove border color of slidebar 2017-01-03 16:16:05 +09:00
sota1235
e27751c18c modify: remove border-right of SideNav component 2017-01-03 16:16:05 +09:00
sota1235
a3f3fdcc71 modify: change base color for dark theme 2017-01-03 16:16:04 +09:00
sota1235
a757576920 fix: get js-sequence-diagrams from npm, not CDN 2017-01-03 16:16:04 +09:00
sota1235
c4eb28d241 modify: change style for NoteItemSimple component 2017-01-03 16:15:45 +09:00
sota1235
aba6c2eb4f add: style sheet for NoteItemSimple component 2017-01-03 16:15:45 +09:00
sota1235
ecb91b3155 refactor: remove unused styles 2017-01-03 16:15:45 +09:00
sota1235
7374b1cc70 refactor: replace code with micro components 2017-01-03 16:15:45 +09:00
sota1235
e8f2972659 modify: remove duplicated codes 2017-01-03 16:15:45 +09:00
sota1235
5bef19a306 add: stylesheet for note-item components 2017-01-03 16:15:45 +09:00
sota1235
54d9e02a42 add: NoteItem component on NoteList component when using simple display mode 2017-01-03 16:15:45 +09:00
sota1235
4f479a8baf add: NoteItem component on NoteList component 2017-01-03 16:15:45 +09:00
sota1235
e7e6194cac modify: not showing the star on the note-list component when using the simple mode 2017-01-03 16:15:45 +09:00
sota1235
113abbb94d refactor: remove unused component 2017-01-03 16:15:45 +09:00
sota1235
d9d0651352 modify: adjust space on note-detail component 2017-01-03 16:15:45 +09:00
sota1235
e27af9f6c1 fix: style for the TagSelect component 2017-01-03 16:15:45 +09:00
sota1235
11d820356d modify: change style for note-detail component (snipet mode) 2017-01-03 16:15:45 +09:00
sota1235
0945aab232 modify: fix text color on note list(dark theme) 2017-01-03 16:15:45 +09:00
sota1235
e4744221ee modify: fix the style of the tooltip for creating new note 2017-01-03 16:15:45 +09:00
sota1235
5f71b24f8d modify: change background-color for note-detail component 2017-01-03 16:15:45 +09:00
sota1235
095a29972a modify: fix text on the modal window for creating new note 2017-01-03 16:15:45 +09:00
sota1235
76bdb708fa refactor: move the code for note info to NoteDetailInfo.styl 2017-01-03 16:15:45 +09:00
sota1235
7c3c08fd96 modify: add color variable for note-detail component 2017-01-03 16:15:45 +09:00
sota1235
a4a2e09429 modify: remove tooltips 2017-01-03 16:15:45 +09:00
sota1235
4ed0ae5e2d modify: change icon for controling viewing mode of note list 2017-01-03 16:15:45 +09:00
sota1235
4cb5e43357 modify: change icon for All Notes 2017-01-03 16:15:45 +09:00
sota1235
b0fecc6b51 modify: fix style for dark theme 2017-01-03 16:15:45 +09:00
sota1235
dd4236ca89 modify: add Star on note right side 2017-01-03 16:15:45 +09:00
sota1235
5da908c759 modfiy: change style for note list 2017-01-03 16:15:45 +09:00
sota1235
fcce1d406d modify: move variables to global file 2017-01-03 16:15:45 +09:00
sota1235
5a01f39dc7 modfiy: fix style for sort button 2017-01-03 16:15:45 +09:00
sota1235
ea1d76f853 modfiy: change style for top bar 2017-01-03 16:15:45 +09:00
sota1235
2356d8a64f modify: add color variable for style 2017-01-03 16:15:45 +09:00
sota1235
969f82b903 modify: remove bordertop of note list 2017-01-03 16:15:45 +09:00
sota1235
fb90907abf modify: change ui-backgroundColor 2017-01-03 16:15:45 +09:00
sota1235
cbd4cd940c modify: fix padding-left on side nav bar 2017-01-03 16:15:45 +09:00
sota1235
6b18c6182e modify: fix style for storage item 2017-01-03 16:15:45 +09:00
sota1235
09164aa0c9 modify: fix space on side nav 2017-01-03 16:15:45 +09:00
sota1235
b83dadddb7 modify: remove border-bottom of menu button 2017-01-03 16:15:45 +09:00
sota1235
b3263b41ff Revert "fix: default.css not found"
This reverts commit 7b55454a73b3eebbfe1ed4684157c2d822ee2f05.
2017-01-03 16:15:45 +09:00
sota1235
1118149b9e modify: remove add tag button 2017-01-03 16:15:45 +09:00
sota1235
b6fc24c6e7 modify: fix style for more option button 2017-01-03 16:15:45 +09:00
sota1235
441edf4667 add: show last updated date on detail top bar 2017-01-03 16:15:45 +09:00
sota1235
74068eaa3d modify: fix test and logic 2017-01-03 16:15:45 +09:00
sota1235
c11bd9e7eb fix: default.css not found 2017-01-03 16:15:45 +09:00
sota1235
b21a82ea6b modify: add date string for detail 2017-01-03 16:15:45 +09:00
sota1235
cf455a13d5 add: util method for generating date 2017-01-03 16:15:45 +09:00
sota1235
c492f3529e modify: remove tooltip of 'more option' button 2017-01-03 16:15:45 +09:00
sota1235
40d7ba4bcc modify: remove border from options button 2017-01-03 16:15:45 +09:00
sota1235
686bc49230 modify: change color for adding tag button 2017-01-03 16:15:45 +09:00
sota1235
6550af698a modify: add button for tag component 2017-01-03 16:15:45 +09:00
sota1235
aac5cbf53e modify: fix active color for favorite star button 2017-01-03 16:15:45 +09:00
sota1235
00636db87c modify: remove animatino for removing tag button 2017-01-03 16:15:45 +09:00
sota1235
6231b8ad57 modify: fix size of removet tag button 2017-01-03 16:15:45 +09:00
sota1235
f2a41aa049 modify: change design for star button 2017-01-03 16:15:45 +09:00
sota1235
bb87b80a92 modify: add variable for star button's color 2017-01-03 16:15:45 +09:00
sota1235
ebfbe29217 modify: change design for tag 2017-01-03 16:15:45 +09:00
sota1235
fad837e148 modify: remove tag icon 2017-01-03 16:15:45 +09:00
sota1235
7dc84c0d6d revert: add FolderSelect Component again 2017-01-03 16:15:45 +09:00
sota1235
74807fe251 Revert "remove: unused file"
This reverts commit db1d0fb5d57967e586bd3e2cb02268f69a718861.
2017-01-03 16:15:45 +09:00
sota1235
bf9773be20 modify: move star on left side 2017-01-03 16:15:45 +09:00
sota1235
18961ff555 refactor: remove context button on top bar 2017-01-03 16:15:45 +09:00
sota1235
1f6e0342d6 modify: fix min width of window 2017-01-03 16:15:45 +09:00
sota1235
7d2bc58ba2 modify: change height of menu on SideNav component 2017-01-03 16:15:45 +09:00
sota1235
556b53181f modify: fix to use navWidth instead of listWidth 2017-01-03 16:15:45 +09:00
sota1235
ca904d69e5 modify: add comment for handleMousUp action 2017-01-03 16:15:45 +09:00
sota1235
f461d459d2 modify: change width of SideNav component 2017-01-03 16:15:45 +09:00
sota1235
6e535c11fd refactor: separate styl file 2017-01-03 16:15:45 +09:00
sota1235
49d3262380 remove: unused file 2017-01-03 16:15:45 +09:00
sota1235
1ee3dec0cc modify: fix style for detail info 2017-01-03 16:15:44 +09:00
sota1235
15637642bb refactor: remove FolderSelect Component 2017-01-03 16:15:44 +09:00
sota1235
3c950c2b9e refactor: remove ShareButton 2017-01-03 16:15:44 +09:00
Sota Sugiura
7811039651 Merge pull request #196 from asmsuechan/master
URL is no longer available
2016-12-31 00:39:16 +09:00
asmsuechan
ec5f7b38d0 Updates invalid url of sequence-diagram 2016-12-30 23:14:25 +09:00
sota1235
2bb361dc19 v0.7.5 2016-12-20 17:41:42 +09:00
Sota Sugiura
3445e484ae Merge pull request #188 from less-easy-way/patch-1
Just fix a trivial typo.
2016-12-14 02:43:39 +09:00
Jae-woo Kim
efd6bf2afe Just fix a trivial typo.
Just fixed a trivial typo.
어쩌다 발견하게 됐네요. :)
2016-12-13 23:28:50 +09:00
sota1235
cd2e6e1b24 v0.7.4 2016-12-13 20:33:04 +09:00
sota1235
99b8d24db3 hotfix: add dependent libraries 2016-12-13 20:24:13 +09:00
sota1235
8116b569c1 v0.7.3 2016-12-13 13:48:03 +09:00
sota1235
da791c5fed fix: link for boostnote store 2016-12-13 13:36:56 +09:00
sota1235
fbd9c59bfd modify: add contributor 2016-12-13 12:55:25 +09:00
Junyoung Choi
3a1b3d19c5 Merge pull request #166 from bkjohnson/master
Adding menu back in temporarily to fix shortcuts.
2016-10-28 12:15:03 +09:00
Brooks Johnson
238076f534 Adding menu back in temporarily to fix shortcuts. 2016-10-27 20:48:01 -05:00
Junyoung Choi
214d74ae11 Merge pull request #164 from bkjohnson/master
Minor accelerator updates
2016-10-27 21:05:01 +09:00
Brooks Johnson
30324f6113 Refactors color changes into mixin 2016-10-26 23:43:01 -05:00
Brooks Johnson
68f0a25873 Adds dark theme to controls in config window. 2016-10-26 20:39:54 -05:00
Brooks Johnson
cd5bc4e930 Simplify OSX accelerators (see here: http://electron.atom.io/docs/api/accelerator/#platform-notice) 2016-10-26 19:51:35 -05:00
Brooks Johnson
1d8f729c95 Update accelerators to use var instead of function 2016-10-26 19:37:44 -05:00
Dick Choi
f0d2fb53d4 add sequence diagram 2016-10-26 13:06:02 +09:00
Dick Choi
0445c680ba debounce rendering 2016-10-26 10:48:04 +09:00
Dick Choi
12453942c8 use _.forEach instead of Array.prototype.forEach.call 2016-10-26 10:47:51 +09:00
Dick Choi
b18a5be940 flowchart 2016-10-26 10:03:20 +09:00
Junyoung Choi
c2234747e8 Merge pull request #161 from twhiting/master
Updated readme english & reformatting
2016-10-25 09:49:18 +09:00
Trent
d6c9ab43ec Fixed spacing issue with markdown syntax 2016-10-24 17:29:09 -06:00
twhiting
db16a87f74 Formatting fixes for readme 2016-10-24 16:55:21 -06:00
twhiting
5b0d2ec97b Updated readme with english fixes + reformatting 2016-10-24 16:52:04 -06:00
Dick Choi
b906db3b24 fix syntax name bug of snippet note 2016-10-24 18:48:04 +09:00
Dick Choi
df0af2a11f Render codefence by codemirror rather than by hljs 2016-10-24 18:05:01 +09:00
Junyoung Choi
706dd3e616 Merge pull request #160 from tejado/master
Fix of storage unlink in preference popup
2016-10-22 16:50:47 +09:00
Dick Choi
bbec58e049 update contributors
add Mike Resoli and tjado
2016-10-21 16:59:37 +09:00
Dick Choi
381b7d85f4 keep the convention 2016-10-21 08:43:00 +09:00
Junyoung Choi
c17c056af3 Merge pull request #157 from tejado/master
Fix syntax error (unexpected token)
2016-10-21 08:13:18 +09:00
Junyoung Choi
a26a85cd1f Merge pull request #159 from mikeres0/patch-1
Improved error messaging
2016-10-21 02:50:48 +09:00
Mike Resoli
9b68b1d327 Improved error messaging
Instead of a standard `console.log` I've added an alert. Pressing the button and getting nowhere is not good from a user perspective.
2016-10-20 16:50:47 +01:00
tjado
6a6631052e Fix of storage unlink in preference popup 2016-10-20 13:35:02 +02:00
tjado
d4ad3a953a Fix syntax error (unexpected token) 2016-10-20 12:56:07 +02:00
Junyoung Choi
7bb63a78c5 Merge pull request #150 from mikeres0/master
Various updates
2016-10-20 00:53:30 +09:00
Mike Resoli
26c859f14c added npm run vendor to build.md 2016-10-19 14:41:01 +01:00
Mike Resoli
dd5c9bf3f6 Spelling mistake in index.js 2016-10-19 11:17:35 +01:00
Dick Choi
3db40fea31 v0.7.2 2016-10-18 14:46:17 +09:00
Dick Choi
8f1c198406 hot fix: Wrong behavior with Japanese IME keyboard 2016-10-18 13:42:10 +09:00
Mike Resoli
44d754c59d Hid menu 2016-10-17 13:40:13 +01:00
135 changed files with 9683 additions and 2556 deletions

3
.eslintignore Normal file
View File

@@ -0,0 +1,3 @@
node_modules/
compiled/
dist/

10
.eslintrc Normal file
View File

@@ -0,0 +1,10 @@
{
"extends": ["standard", "standard-jsx"],
"rules": {
"no-useless-escape": 0,
"prefer-const": "warn",
"no-unused-vars": "warn",
"no-undef": "warn",
"no-lone-blocks": "warn"
}
}

6
.travis.yml Normal file
View File

@@ -0,0 +1,6 @@
language: node_js
node_js:
- 'stable'
- 'lts/*'
script: npm run lint && npm run test

View File

@@ -1,8 +1,8 @@
GPL-3.0
Boostnote - the simplest note app
Boostnote - an open source note-taking app made for programmers just like you.
Copyright (C) 2016 MAISIN&CO.
Copyright (C) 2017 Maisin&Co., Inc.
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

View File

@@ -1,6 +1,7 @@
import React, { PropTypes } from 'react'
import _ from 'lodash'
import CodeMirror from 'codemirror'
import path from 'path'
CodeMirror.modeURL = '../node_modules/codemirror/mode/%N/%N.js'
@@ -37,6 +38,9 @@ export default class CodeEditor extends React.Component {
}
this.props.onBlur != null && this.props.onBlur(e)
}
this.loadStyleHandler = (e) => {
this.editor.refresh()
}
}
componentDidMount () {
@@ -49,22 +53,37 @@ export default class CodeEditor extends React.Component {
indentUnit: this.props.indentSize,
tabSize: this.props.indentSize,
indentWithTabs: this.props.indentType !== 'space',
keyMap: 'sublime',
inputStyle: 'contenteditable',
keyMap: this.props.keyMap,
inputStyle: 'textarea',
dragDrop: false,
extraKeys: {
Tab: function (cm) {
const cursor = cm.getCursor()
const line = cm.getLine(cursor.line)
if (cm.somethingSelected()) cm.indentSelection('add')
else {
if (cm.getOption('indentWithTabs')) {
cm.execCommand('insertTab')
const tabs = cm.getOption('indentWithTabs')
if (line.trimLeft() === '- ' || line.trimLeft() === '* ' || line.trimLeft() === '+ ') {
cm.execCommand('goLineStart')
if (tabs) {
cm.execCommand('insertTab')
} else {
cm.execCommand('insertSoftTab')
}
cm.execCommand('goLineEnd')
} else {
cm.execCommand('insertSoftTab')
if (tabs) {
cm.execCommand('insertTab')
} else {
cm.execCommand('insertSoftTab')
}
}
}
},
'Cmd-T': function (cm) {
// Do nothing
}
},
Enter: 'newlineAndIndentContinueMarkdownList'
}
})
@@ -72,11 +91,16 @@ export default class CodeEditor extends React.Component {
this.editor.on('blur', this.blurHandler)
this.editor.on('change', this.changeHandler)
let editorTheme = document.getElementById('editorTheme')
editorTheme.addEventListener('load', this.loadStyleHandler)
}
componentWillUnmount () {
this.editor.off('blur', this.blurHandler)
this.editor.off('change', this.changeHandler)
let editorTheme = document.getElementById('editorTheme')
editorTheme.removeEventListener('load', this.loadStyleHandler)
}
componentDidUpdate (prevProps, prevState) {
@@ -86,7 +110,7 @@ export default class CodeEditor extends React.Component {
}
if (prevProps.theme !== this.props.theme) {
this.editor.setOption('theme', this.props.theme)
needRefresh = true
// editor should be refreshed after css loaded
}
if (prevProps.fontSize !== this.props.fontSize) {
needRefresh = true
@@ -94,6 +118,9 @@ export default class CodeEditor extends React.Component {
if (prevProps.fontFamily !== this.props.fontFamily) {
needRefresh = true
}
if (prevProps.keyMap !== this.props.keyMap) {
needRefresh = true
}
if (prevProps.indentSize !== this.props.indentSize) {
this.editor.setOption('indentUnit', this.props.indentSize)
@@ -144,6 +171,7 @@ export default class CodeEditor extends React.Component {
this.editor.setValue(this.props.value)
this.editor.clearHistory()
this.editor.on('change', this.changeHandler)
this.editor.refresh()
}
setValue (value) {
@@ -152,6 +180,19 @@ export default class CodeEditor extends React.Component {
this.editor.setCursor(cursor)
}
handleDropImage (e) {
e.preventDefault()
const imagePath = e.dataTransfer.files[0].path
const filename = path.basename(imagePath)
const imageMd = `![${encodeURI(filename)}](${encodeURI(imagePath)})`
this.insertImage(imageMd)
}
insertImage (imageMd) {
const textarea = this.editor.getInputField()
textarea.value = textarea.value.substr(0, textarea.selectionStart) + imageMd + textarea.value.substr(textarea.selectionEnd)
}
render () {
let { className, fontFamily, fontSize } = this.props
fontFamily = _.isString(fontFamily) && fontFamily.length > 0
@@ -169,6 +210,7 @@ export default class CodeEditor extends React.Component {
fontFamily: fontFamily.join(', '),
fontSize: fontSize
}}
onDrop={(e) => this.handleDropImage(e)}
/>
)
}
@@ -186,6 +228,7 @@ CodeEditor.propTypes = {
CodeEditor.defaultProps = {
readOnly: false,
theme: 'xcode',
keyMap: 'sublime',
fontSize: 14,
fontFamily: 'Monaco, Consolas',
indentSize: 4,

View File

@@ -3,24 +3,63 @@ import CSSModules from 'browser/lib/CSSModules'
import styles from './MarkdownEditor.styl'
import CodeEditor from 'browser/components/CodeEditor'
import MarkdownPreview from 'browser/components/MarkdownPreview'
import eventEmitter from 'browser/main/lib/eventEmitter'
class MarkdownEditor extends React.Component {
constructor (props) {
super(props)
this.escapeFromEditor = ['Control', 'w']
this.supportMdSelectionBold = ['Control', ':']
this.state = {
status: 'PREVIEW'
status: 'PREVIEW',
renderValue: props.value,
keyPressed: {},
isLocked: false
}
this.lockEditorCode = () => this.handleLockEditor()
}
componentDidMount () {
this.value = this.refs.code.value
eventEmitter.on('editor:lock', this.lockEditorCode)
}
componentDidUpdate () {
this.value = this.refs.code.value
}
componentWillReceiveProps (props) {
if (props.value !== this.props.value) {
this.queueRendering(props.value)
}
}
componentWillUnmount () {
this.cancelQueue()
eventEmitter.off('editor:lock', this.lockEditorCode)
}
queueRendering (value) {
clearTimeout(this.renderTimer)
this.renderTimer = setTimeout(() => {
this.renderPreview(value)
}, 500)
}
cancelQueue () {
clearTimeout(this.renderTimer)
}
renderPreview (value) {
this.setState({
renderValue: value
})
}
handleChange (e) {
this.value = this.refs.code.value
this.props.onChange(e)
@@ -41,11 +80,14 @@ class MarkdownEditor extends React.Component {
this.refs.code.blur()
this.refs.preview.focus()
}
eventEmitter.emit('topbar:togglelockbutton', this.state.status)
})
}
}
handleBlur (e) {
if (this.state.isLocked) return
this.setState({ keyPressed: [] })
let { config } = this.props
if (config.editor.switchPreview === 'BLUR') {
let cursorPosition = this.refs.code.editor.getCursor()
@@ -55,6 +97,7 @@ class MarkdownEditor extends React.Component {
this.refs.preview.focus()
this.refs.preview.scrollTo(cursorPosition.line)
})
eventEmitter.emit('topbar:togglelockbutton', this.state.status)
}
}
@@ -70,6 +113,7 @@ class MarkdownEditor extends React.Component {
}, () => {
this.refs.code.focus()
})
eventEmitter.emit('topbar:togglelockbutton', this.state.status)
}
}
@@ -106,14 +150,59 @@ class MarkdownEditor extends React.Component {
} else {
this.refs.code.focus()
}
eventEmitter.emit('topbar:togglelockbutton', this.state.status)
}
reload () {
this.refs.code.reload()
this.cancelQueue()
this.renderPreview(this.props.value)
}
handleKeyDown (e) {
if (this.state.status !== 'CODE') return false
const keyPressed = Object.assign(this.state.keyPressed, {
[e.key]: true
})
this.setState({ keyPressed })
let isNoteHandlerKey = (el) => { return this.state.keyPressed[el] }
if (!this.state.isLocked && this.state.status === 'CODE' && this.escapeFromEditor.every(isNoteHandlerKey)) {
document.activeElement.blur()
}
if (this.supportMdSelectionBold.every(isNoteHandlerKey)) {
this.addMdAroundWord('**')
}
}
addMdAroundWord (mdElement) {
if (this.refs.code.editor.getSelection()) {
return this.addMdAroundSelection(mdElement)
}
const currentCaret = this.refs.code.editor.getCursor()
const word = this.refs.code.editor.findWordAt(currentCaret)
const cmDoc = this.refs.code.editor.getDoc()
cmDoc.replaceRange(mdElement, word.anchor)
cmDoc.replaceRange(mdElement, { line: word.head.line, ch: word.head.ch + mdElement.length })
}
addMdAroundSelection (mdElement) {
this.refs.code.editor.replaceSelection(`${mdElement}${this.refs.code.editor.getSelection()}${mdElement}`)
}
handleKeyUp (e) {
const keyPressed = Object.assign(this.state.keyPressed, {
[e.key]: false
})
this.setState({ keyPressed })
}
handleLockEditor () {
this.setState({ isLocked: !this.state.isLocked })
}
render () {
let { className, value, config } = this.props
let editorFontSize = parseInt(config.editor.fontSize, 10)
if (!(editorFontSize > 0 && editorFontSize < 101)) editorFontSize = 14
let editorIndentSize = parseInt(config.editor.indentSize, 10)
@@ -129,12 +218,15 @@ class MarkdownEditor extends React.Component {
}
onContextMenu={(e) => this.handleContextMenu(e)}
tabIndex='-1'
onKeyDown={(e) => this.handleKeyDown(e)}
onKeyUp={(e) => this.handleKeyUp(e)}
>
<CodeEditor styleName='codeEditor'
ref='code'
mode='GitHub Flavored Markdown'
value={value}
theme={config.editor.theme}
keyMap={config.editor.keyMap}
fontFamily={config.editor.fontFamily}
fontSize={editorFontSize}
indentType={config.editor.indentType}
@@ -148,15 +240,17 @@ class MarkdownEditor extends React.Component {
}
style={previewStyle}
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}
indentSize={editorIndentSize}
ref='preview'
onContextMenu={(e) => this.handleContextMenu(e)}
tabIndex='0'
value={value}
value={this.state.renderValue}
onMouseUp={(e) => this.handlePreviewMouseUp(e)}
onMouseDown={(e) => this.handlePreviewMouseDown(e)}
onCheckboxClick={(e) => this.handleCheckboxClick(e)}

View File

@@ -1,11 +1,82 @@
import React, { PropTypes } from 'react'
import markdown from 'browser/lib/markdown'
import _ from 'lodash'
import hljsTheme from 'browser/lib/hljsThemes'
import CodeMirror from 'codemirror'
import consts from 'browser/lib/consts'
import Raphael from 'raphael'
import flowchart from 'flowchart'
import SequenceDiagram from 'js-sequence-diagrams'
import eventEmitter from 'browser/main/lib/eventEmitter'
import fs from 'fs'
function decodeHTMLEntities (text) {
var entities = [
['apos', '\''],
['amp', '&'],
['lt', '<'],
['gt', '>']
]
for (var i = 0, max = entities.length; i < max; ++i) {
text = text.replace(new RegExp('&' + entities[i][0] + ';', 'g'), entities[i][1])
}
return text
}
const { remote } = require('electron')
const { app } = remote
const path = require('path')
const dialog = remote.dialog
const markdownStyle = require('!!css!stylus?sourceMap!./markdown.styl')[0][1]
const { shell } = require('electron')
const appPath = 'file://' + (process.env.NODE_ENV === 'production'
? app.getAppPath()
: path.resolve())
function buildStyle (fontFamily, fontSize, codeBlockFontFamily, lineNumber) {
return `
@font-face {
font-family: 'Lato';
src: url('${appPath}/resources/fonts/Lato-Regular.woff2') format('woff2'), /* Modern Browsers */
url('${appPath}/resources/fonts/Lato-Regular.woff') format('woff'), /* Modern Browsers */
url('${appPath}/resources/fonts/Lato-Regular.ttf') format('truetype');
font-style: normal;
font-weight: normal;
text-rendering: optimizeLegibility;
}
${markdownStyle}
body {
font-family: ${fontFamily.join(', ')};
font-size: ${fontSize}px;
}
code {
font-family: ${codeBlockFontFamily.join(', ')};
background-color: rgba(0,0,0,0.04);
color: #CC305F;
}
.lineNumber {
${lineNumber && 'display: block !important;'}
font-family: ${codeBlockFontFamily.join(', ')};
}
h1, h2 {
border: none;
}
h1 {
padding-bottom: 4px;
margin: 1em 0 8px;
}
h2 {
padding-bottom: 0.2em;
margin: 1em 0 0.37em;
}
`
}
const { shell } = require('electron')
const OSX = global.process.platform === 'darwin'
const defaultFontFamily = ['helvetica', 'arial', 'sans-serif']
@@ -24,20 +95,23 @@ export default class MarkdownPreview extends React.Component {
this.mouseUpHandler = (e) => this.handleMouseUp(e)
this.anchorClickHandler = (e) => this.handlePreviewAnchorClick(e)
this.checkboxClickHandler = (e) => this.handleCheckboxClick(e)
this.saveAsTextHandler = () => this.handleSaveAsText()
this.saveAsMdHandler = () => this.handleSaveAsMd()
}
handlePreviewAnchorClick (e) {
e.preventDefault()
e.stopPropagation()
let href = e.target.getAttribute('href')
let anchor = e.target.closest('a')
let href = anchor.getAttribute('href')
if (_.isString(href) && href.match(/^#/)) {
let targetElement = this.refs.root.contentWindow.document.getElementById(href.substring(1, href.length))
if (targetElement != null) {
this.getWindow().scrollTo(0, targetElement.offsetTop)
}
} else {
shell.openExternal(e.target.href)
shell.openExternal(href)
}
}
@@ -67,87 +141,174 @@ export default class MarkdownPreview extends React.Component {
if (this.props.onMouseUp != null) this.props.onMouseUp(e)
}
handleSaveAsText () {
this.exportAsDocument('txt')
}
handleSaveAsMd () {
this.exportAsDocument('md')
}
exportAsDocument (fileType) {
const options = {
filters: [
{ name: 'Documents', extensions: [fileType] }
],
properties: ['openFile', 'createDirectory']
}
dialog.showSaveDialog(remote.getCurrentWindow(), options,
(filename) => {
if (filename) {
fs.writeFile(filename, this.props.value, (err) => {
if (err) throw err
})
}
})
}
componentDidMount () {
this.refs.root.setAttribute('sandbox', 'allow-same-origin')
this.refs.root.setAttribute('sandbox', 'allow-scripts')
this.refs.root.contentWindow.document.body.addEventListener('contextmenu', this.contextMenuHandler)
this.refs.root.contentWindow.document.head.innerHTML = `
<style id='style'></style>
<link rel="stylesheet" href="${appPath}/node_modules/katex/dist/katex.min.css">
<link rel="stylesheet" href="${appPath}/node_modules/codemirror/lib/codemirror.css">
<link rel="stylesheet" id="codeTheme">
`
this.rewriteIframe()
this.applyStyle()
this.refs.root.contentWindow.document.addEventListener('mousedown', this.mouseDownHandler)
this.refs.root.contentWindow.document.addEventListener('mouseup', this.mouseUpHandler)
this.refs.root.contentWindow.document.addEventListener('drop', this.preventImageDroppedHandler)
this.refs.root.contentWindow.document.addEventListener('dragover', this.preventImageDroppedHandler)
eventEmitter.on('export:save-text', this.saveAsTextHandler)
eventEmitter.on('export:save-md', this.saveAsMdHandler)
}
componentWillUnmount () {
this.refs.root.contentWindow.document.body.removeEventListener('contextmenu', this.contextMenuHandler)
this.refs.root.contentWindow.document.removeEventListener('mousedown', this.mouseDownHandler)
this.refs.root.contentWindow.document.removeEventListener('mouseup', this.mouseUpHandler)
this.refs.root.contentWindow.document.removeEventListener('drop', this.preventImageDroppedHandler)
this.refs.root.contentWindow.document.removeEventListener('dragover', this.preventImageDroppedHandler)
eventEmitter.off('export:save-text', this.saveAsTextHandler)
eventEmitter.off('export:save-md', this.saveAsMdHandler)
}
componentDidUpdate (prevProps) {
if (prevProps.value !== this.props.value ||
prevProps.fontFamily !== this.props.fontFamily ||
if (prevProps.value !== this.props.value) this.rewriteIframe()
if (prevProps.fontFamily !== this.props.fontFamily ||
prevProps.fontSize !== this.props.fontSize ||
prevProps.codeBlockFontFamily !== this.props.codeBlockFontFamily ||
prevProps.codeBlockTheme !== this.props.codeBlockTheme ||
prevProps.lineNumber !== this.props.lineNumber ||
prevProps.theme !== this.props.theme
) this.rewriteIframe()
prevProps.theme !== this.props.theme) {
this.applyStyle()
this.rewriteIframe()
}
}
rewriteIframe () {
Array.prototype.forEach.call(this.refs.root.contentWindow.document.querySelectorAll('a'), (el) => {
el.removeEventListener('click', this.anchorClickHandler)
})
Array.prototype.forEach.call(this.refs.root.contentWindow.document.querySelectorAll('input[type="checkbox"]'), (el) => {
el.removeEventListener('click', this.checkboxClickHandler)
})
let { value, fontFamily, fontSize, codeBlockFontFamily, lineNumber, codeBlockTheme, theme } = this.props
applyStyle () {
let { fontFamily, fontSize, codeBlockFontFamily, lineNumber, codeBlockTheme } = this.props
fontFamily = _.isString(fontFamily) && fontFamily.trim().length > 0
? [fontFamily].concat(defaultFontFamily)
: defaultFontFamily
codeBlockFontFamily = _.isString(codeBlockFontFamily) && codeBlockFontFamily.trim().length > 0
? [codeBlockFontFamily].concat(defaultCodeBlockFontFamily)
: defaultCodeBlockFontFamily
codeBlockTheme = hljsTheme().some((theme) => theme.name === codeBlockTheme) ? codeBlockTheme : 'xcode'
this.refs.root.contentWindow.document.head.innerHTML = `
<style>
@font-face {
font-family: 'Lato';
src: url('../resources/fonts/Lato-Regular.woff2') format('woff2'), /* Modern Browsers */
url('../resources/fonts/Lato-Regular.woff') format('woff'), /* Modern Browsers */
url('../resources/fonts/Lato-Regular.ttf') format('truetype');
font-style: normal;
font-weight: normal;
text-rendering: optimizeLegibility;
}
${markdownStyle}
body {
font-family: ${fontFamily.join(', ')};
font-size: ${fontSize}px;
}
code {
font-family: ${codeBlockFontFamily.join(', ')};
}
.lineNumber {
${lineNumber && 'display: block !important;'}
font-family: ${codeBlockFontFamily.join(', ')};
opacity: 0.5;
}
</style>
<link rel="stylesheet" href="../node_modules/highlight.js/styles/${codeBlockTheme}.css">
<link rel="stylesheet" href="../compiled/katex-style.css">
`
this.setCodeTheme(codeBlockTheme)
this.getWindow().document.getElementById('style').innerHTML = buildStyle(fontFamily, fontSize, codeBlockFontFamily, lineNumber, codeBlockTheme, lineNumber)
}
setCodeTheme (theme) {
theme = consts.THEMES.some((_theme) => _theme === theme) && theme !== 'default'
? theme
: 'elegant'
this.getWindow().document.getElementById('codeTheme').href = `${appPath}/node_modules/codemirror/theme/${theme}.css`
}
rewriteIframe () {
_.forEach(this.refs.root.contentWindow.document.querySelectorAll('a'), (el) => {
el.removeEventListener('click', this.anchorClickHandler)
})
_.forEach(this.refs.root.contentWindow.document.querySelectorAll('input[type="checkbox"]'), (el) => {
el.removeEventListener('click', this.checkboxClickHandler)
})
let { value, theme, indentSize, codeBlockTheme } = this.props
this.refs.root.contentWindow.document.body.setAttribute('data-theme', theme)
this.refs.root.contentWindow.document.body.innerHTML = markdown.render(value)
Array.prototype.forEach.call(this.refs.root.contentWindow.document.querySelectorAll('a'), (el) => {
_.forEach(this.refs.root.contentWindow.document.querySelectorAll('.taskListItem'), (el) => {
el.parentNode.parentNode.style.listStyleType = 'none'
})
_.forEach(this.refs.root.contentWindow.document.querySelectorAll('a'), (el) => {
el.addEventListener('click', this.anchorClickHandler)
})
Array.prototype.forEach.call(this.refs.root.contentWindow.document.querySelectorAll('input[type="checkbox"]'), (el) => {
_.forEach(this.refs.root.contentWindow.document.querySelectorAll('input[type="checkbox"]'), (el) => {
el.addEventListener('click', this.checkboxClickHandler)
})
codeBlockTheme = consts.THEMES.some((_theme) => _theme === codeBlockTheme)
? codeBlockTheme
: 'default'
_.forEach(this.refs.root.contentWindow.document.querySelectorAll('.code code'), (el) => {
let syntax = CodeMirror.findModeByName(el.className)
if (syntax == null) syntax = CodeMirror.findModeByName('Plain Text')
CodeMirror.requireMode(syntax.mode, () => {
let content = decodeHTMLEntities(el.innerHTML)
el.innerHTML = ''
el.parentNode.className += ` cm-s-${codeBlockTheme} CodeMirror`
CodeMirror.runMode(content, syntax.mime, el, {
tabSize: indentSize
})
})
})
let opts = {}
// if (this.props.theme === 'dark') {
// opts['font-color'] = '#DDD'
// opts['line-color'] = '#DDD'
// opts['element-color'] = '#DDD'
// opts['fill'] = '#3A404C'
// }
_.forEach(this.refs.root.contentWindow.document.querySelectorAll('.flowchart'), (el) => {
Raphael.setWindow(this.getWindow())
try {
let diagram = flowchart.parse(decodeHTMLEntities(el.innerHTML))
el.innerHTML = ''
diagram.drawSVG(el, opts)
_.forEach(el.querySelectorAll('a'), (el) => {
el.addEventListener('click', this.anchorClickHandler)
})
} catch (e) {
console.error(e)
el.className = 'flowchart-error'
el.innerHTML = 'Flowchart parse error: ' + e.message
}
})
_.forEach(this.refs.root.contentWindow.document.querySelectorAll('.sequence'), (el) => {
Raphael.setWindow(this.getWindow())
try {
let diagram = SequenceDiagram.parse(decodeHTMLEntities(el.innerHTML))
el.innerHTML = ''
diagram.drawSVG(el, {theme: 'simple'})
_.forEach(el.querySelectorAll('a'), (el) => {
el.addEventListener('click', this.anchorClickHandler)
})
} catch (e) {
console.error(e)
el.className = 'sequence-error'
el.innerHTML = 'Sequence diagram parse error: ' + e.message
}
})
}
focus () {
@@ -172,6 +333,11 @@ export default class MarkdownPreview extends React.Component {
}
}
preventImageDroppedHandler (e) {
e.preventDefault()
e.stopPropagation()
}
render () {
let { className, style, tabIndex } = this.props
return (

View File

@@ -0,0 +1,97 @@
/**
* @fileoverview Note item component.
*/
import React, { PropTypes } from 'react'
import { isArray } from 'lodash'
import CSSModules from 'browser/lib/CSSModules'
import styles from './NoteItem.styl'
/**
* @description Tag element component.
* @param {string} tagName
* @return {React.Component}
*/
const TagElement = ({ tagName }) => (
<span styleName='item-bottom-tagList-item' key={tagName}>
#{tagName}
</span>
)
/**
* @description Tag element list component.
* @param {Array|null} tags
* @return {React.Component}
*/
const TagElementList = (tags) => {
if (!isArray(tags)) {
return []
}
const tagElements = tags.map(tag => (
TagElement({tagName: tag})
))
return tagElements
}
/**
* @description Note item component when using normal display mode.
* @param {boolean} isActive
* @param {Object} note
* @param {Function} handleNoteClick
* @param {Function} handleNoteContextMenu
* @param {string} dateDisplay
*/
const NoteItem = ({ isActive, note, dateDisplay, handleNoteClick, handleNoteContextMenu }) => (
<div styleName={isActive
? 'item--active'
: 'item'
}
key={`${note.storage}-${note.key}`}
onClick={e => handleNoteClick(e, `${note.storage}-${note.key}`)}
onContextMenu={e => handleNoteContextMenu(e, `${note.storage}-${note.key}`)}
>
<div styleName='item-wrapper'>
{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-file-text-o' />
}
<div styleName='item-title'>
{note.title.trim().length > 0
? note.title
: <span styleName='item-title-empty'>Empty</span>
}
</div>
<div styleName='item-bottom-time'>{dateDisplay}</div>
{note.isStarred
? <i styleName='item-star' className='fa fa-star' /> : ''
}
<div styleName='item-bottom'>
<div styleName='item-bottom-tagList'>
{note.tags.length > 0
? TagElementList(note.tags)
: <span styleName='item-bottom-tagList-empty' />
}
</div>
</div>
</div>
</div>
)
NoteItem.propTypes = {
isActive: PropTypes.bool.isRequired,
dateDisplay: PropTypes.string.isRequired,
note: PropTypes.shape({
storage: PropTypes.string.isRequired,
key: PropTypes.string.isRequired,
type: PropTypes.string.isRequired,
title: PropTypes.string.isrequired,
tags: PropTypes.array,
isStarred: PropTypes.bool.isRequired
}),
handleNoteClick: PropTypes.func.isRequired,
handleNoteContextMenu: PropTypes.func.isRequired
}
export default CSSModules(NoteItem, styles)

View File

@@ -0,0 +1,187 @@
$control-height = 30px
.root
absolute left bottom
top $topBar-height - 1
background-color $ui-noteList-backgroundColor
.item
position relative
padding 0 20px
user-select none
cursor pointer
background-color $ui-noteList-backgroundColor
transition background-color 0.2s
&:hover
background-color alpha($ui-button--active-backgroundColor, 40%)
.item-title
.item-title-icon
.item-bottom-time
transition 0.15s
color $ui-text-color
.item-bottom-tagList-item
background-color alpha(white, 0.6)
color $ui-text-color
&:active
background-color $ui-button--active-backgroundColor
color $ui-text-color
.item-title
.item-title-icon
.item-bottom-time
transition 0.15s
color $ui-text-color
.item-bottom-tagList-item
background-color alpha(white, 0.6)
color $ui-text-color
.item-wrapper
padding 15px 0
border-bottom $ui-border
.item--active
@extend .item
background-color $ui-button--active-backgroundColor
color $ui-text-color
.item-title
.item-title-empty
.item-bottom-tagList-empty
.item-bottom-time
.item-title-icon
color $ui-text-color
.item-bottom-tagList-item
background-color alpha(white, 0.6)
color $ui-text-color
.item-wrapper
border-color transparent
&:hover
background-color $ui-button--active-backgroundColor
.item-title-icon
position relative
font-size 12px
color $ui-inactive-text-color
.item-title
font-size 13px
position relative
top -12px
left 20px
padding-right 15px
padding-bottom 4px
overflow ellipsis
color $ui-inactive-text-color
.item-title-empty
font-weight normal
color $ui-inactive-text-color
.item-bottom
position relative
bottom 0px
margin-top 2px
height 20px
font-size 12px
line-height 20px
overflow ellipsis
display flex
.item-bottom-tagList
flex 1
overflow ellipsis
line-height 20px
padding-left 2px
.item-bottom-tagList-item
font-size 10px
margin-right 8px
padding 0
height 20px
box-sizing border-box
border-radius 2px
padding 1px 2px
vertical-align middle
background-color white
color $ui-inactive-text-color
.item-bottom-time
color $ui-inactive-text-color
font-size 10px
padding-left 2px
padding-bottom 2px
.item-star
position absolute
top 19px
left 5px
width 34px
height 34px
color $ui-favorite-star-button-color
font-size 12px
padding 0
border-radius 17px
body[data-theme="dark"]
.root
border-color $ui-dark-borderColor
background-color $ui-dark-noteList-backgroundColor
.item
border-color $ui-dark-borderColor
background-color $ui-dark-noteList-backgroundColor
&:hover
transition 0.15s
background-color alpha($ui-dark-button--active-backgroundColor, 20%)
.item-title
.item-title-icon
.item-bottom-time
transition 0.15s
color $ui-dark-text-color
.item-bottom-tagList-item
transition 0.15s
background-color alpha($ui-dark-button--active-backgroundColor, 40%)
color $ui-dark-text-color
&:active
transition 0.15s
background-color $ui-dark-button--active-backgroundColor
.item-title
.item-title-icon
.item-bottom-time
transition 0.15s
color $ui-dark-text-color
.item-bottom-tagList-item
transition 0.15s
background-color alpha(white, 10%)
color $ui-dark-text-color
.item-wrapper
border-color $ui-dark-borderColor
.item--active
border-color $ui-dark-borderColor
background-color $ui-dark-button--active-backgroundColor
.item-wrapper
border-color transparent
.item-title
.item-title-icon
.item-bottom-time
color $ui-dark-text-color
.item-bottom-tagList-item
background-color alpha(white, 10%)
color $ui-dark-text-color
.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

@@ -0,0 +1,49 @@
/**
* @fileoverview Note item component with simple display mode.
*/
import React, { PropTypes } from 'react'
import CSSModules from 'browser/lib/CSSModules'
import styles from './NoteItemSimple.styl'
/**
* @description Note item component when using simple display mode.
* @param {boolean} isActive
* @param {Object} note
* @param {Function} handleNoteClick
* @param {Function} handleNoteContextMenu
*/
const NoteItemSimple = ({ isActive, note, handleNoteClick, handleNoteContextMenu }) => (
<div styleName={isActive
? 'item-simple--active'
: 'item-simple'
}
key={`${note.storage}-${note.key}`}
onClick={e => handleNoteClick(e, `${note.storage}-${note.key}`)}
onContextMenu={e => handleNoteContextMenu(e, `${note.storage}-${note.key}`)}
>
<div styleName='item-simple-title'>
{note.type === 'SNIPPET_NOTE'
? <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' />
}
{note.title.trim().length > 0
? note.title
: <span styleName='item-simple-title-empty'>Empty</span>
}
</div>
</div>
)
NoteItemSimple.propTypes = {
isActive: PropTypes.bool.isRequired,
note: PropTypes.shape({
storage: PropTypes.string.isRequired,
key: PropTypes.string.isRequired,
type: PropTypes.string.isRequired,
title: PropTypes.string.isrequired
}),
handleNoteClick: PropTypes.func.isRequired,
handleNoteContextMenu: PropTypes.func.isRequired
}
export default CSSModules(NoteItemSimple, styles)

View File

@@ -0,0 +1,105 @@
$control-height = 30px
.root
absolute left bottom
top $topBar-height - 1
background-color $ui-noteList-backgroundColor
.item-simple
position relative
padding 0 25px
user-select none
cursor pointer
background-color $ui-noteList-backgroundColor
transition background-color 0.15s
&:hover
background-color alpha($ui-button--active-backgroundColor, 40%)
.item-simple-title
.item-simple-title-empty
.item-simple-title-icon
color $ui-text-color
&:active
background-color $ui-button--active-backgroundColor
color $ui-text-color
.item-simple-title
.item-simple-title-empty
.item-simple-title-icon
color $ui-text-color
.item-simple--active
@extend .item-simple
background-color $ui-button--active-backgroundColor
color $ui-text-color
.item-simple-title
.item-simple-title-empty
border-color transparent
color $ui-text-color
.item-simple-title-icon
color $ui-text-color
&:hover
background-color $ui-button--active-backgroundColor
.item-simple-title
font-size 12px
height 40px
box-sizing border-box
line-height 24px
padding-top 8px
overflow ellipsis
color $ui-inactive-text-color
border-bottom $ui-border
.item-simple-title-icon
font-size 12px
color $ui-inactive-text-color
padding-right 6px
.item-simple-title-empty
font-weight normal
color $ui-inactive-text-color
body[data-theme="dark"]
.root
border-color $ui-dark-borderColor
background-color $ui-dark-noteList-backgroundColor
.item-simple
border-color $ui-dark-borderColor
background-color $ui-dark-noteList-backgroundColor
&:active
background-color $ui-dark-button--active-backgroundColor
.item-simple-title
.item-simple-title-icon
.item-simple-bottom-time
.item-simple-bottom-tagList-item
transition 0.15s
color $ui-dark-text-color
&:hover
background-color alpha($ui-dark-button--active-backgroundColor, 20%)
.item-simple-title
.item-simple-title-icon
.item-simple-bottom-time
.item-simple-bottom-tagList-item
transition 0.15s
color $ui-dark-text-color
.item-simple--active
border-color $ui-dark-borderColor
background-color $ui-dark-button--active-backgroundColor
.item-simple-title
.item-simple-title-icon
.item-simple-bottom-time
color $ui-dark-text-color
.item-simple-bottom-tagList-item
background-color transparent
color $ui-dark-text-color
.item-simple-title
color $ui-inactive-text-color
border-color $ui-dark-borderColor
.item-simple-title-icon
color $ui-darkinactive-text-color
.item-simple-title-empty
color $ui-dark-inactive-text-color

View File

@@ -12,7 +12,7 @@ export default class ProfileImage extends React.Component {
className={className}
width={this.props.size}
height={this.props.size}
src={src}/>
src={src} />
)
}
}

View File

@@ -0,0 +1,44 @@
/**
* @fileoverview Filter for all notes.
*/
import React, { PropTypes } from 'react'
import CSSModules from 'browser/lib/CSSModules'
import styles from './SideNavFilter.styl'
/**
* @param {boolean} isFolded
* @param {boolean} isHomeActive
* @param {Function} handleAllNotesButtonClick
* @param {boolean} isStarredActive
* @param {Function} handleStarredButtonClick
* @return {React.Component}
*/
const SideNavFilter = ({
isFolded, isHomeActive, handleAllNotesButtonClick,
isStarredActive, handleStarredButtonClick
}) => (
<div styleName={isFolded ? 'menu--folded' : 'menu'}>
<button styleName={isHomeActive ? 'menu-button--active' : 'menu-button'}
onClick={handleAllNotesButtonClick}
>
<i className='fa fa-archive fa-fw' />
<span styleName='menu-button-label'>All Notes</span>
</button>
<button styleName={isStarredActive ? 'menu-button-star--active' : 'menu-button'}
onClick={handleStarredButtonClick}
>
<i className='fa fa-star fa-fw' />
<span styleName='menu-button-label'>Starred</span>
</button>
</div>
)
SideNavFilter.propTypes = {
isFolded: PropTypes.bool,
isHomeActive: PropTypes.bool.isRequired,
handleAllNotesButtonClick: PropTypes.func.isRequired,
isStarredActive: PropTypes.bool.isRequired,
handleStarredButtonClick: PropTypes.func.isRequired
}
export default CSSModules(SideNavFilter, styles)

View File

@@ -0,0 +1,105 @@
.menu
margin-bottom 30px
.menu-button
navButtonColor()
height 32px
padding 0 15px
font-size 12px
width 100%
text-align left
overflow ellipsis
.menu-button--active
@extend .menu-button
color #e74c3c
background-color $ui-button--active-backgroundColor
.menu-button-label
color $ui-text-color
&:hover
background-color $ui-button--active-backgroundColor
color #e74c3c
.menu-button-label
color $ui-text-color
&:active, &:active:hover
background-color $ui-button--active-backgroundColor
color #e74c3c
.menu-button-label
color $ui-text-color
.menu-button-star--active
@extend .menu-button
color #F9BF3B
background-color $ui-button--active-backgroundColor
.menu-button-label
color $ui-text-color
&:hover
background-color $ui-button--active-backgroundColor
color #F9BF3B
.menu-button-label
color $ui-text-color
&:active, &:active:hover
background-color $ui-button--active-backgroundColor
color #F9BF3B
.menu-button-label
color $ui-text-color
.menu-button-label
margin-left 5px
.menu--folded
@extend .menu
.menu-button, .menu-button--active
text-align center
&:hover .menu-button-label
transition opacity 0.15s
opacity 1
.menu-button-label
position fixed
display inline-block
height 32px
left 44px
padding 0 10px
margin-top -8px
margin-left 0
overflow ellipsis
background-color $ui-tooltip-backgroundColor
z-index 10
color white
line-height 32px
border-top-right-radius 2px
border-bottom-right-radius 2px
pointer-events none
opacity 0
font-size 12px
body[data-theme="dark"]
.menu-button
&:active
background-color $ui-dark-button--active-backgroundColor
color $ui-dark-text-color
&:hover
background-color alpha($ui-dark-button--active-backgroundColor, 20%)
color $ui-dark-text-color
.menu-button--active
color #c0392b
background-color $ui-dark-button--active-backgroundColor
.menu-button-label
color $ui-dark-text-color
&:hover
background-color $ui-dark-button--active-backgroundColor
color #c0392b
.menu-button-label
color $ui-dark-text-color
.menu-button-star--active
color $ui-favorite-star-button-color
background-color $ui-dark-button--active-backgroundColor
.menu-button-label
color $ui-dark-text-color
&:hover
background-color $ui-dark-button--active-backgroundColor
color $ui-favorite-star-button-color
.menu-button-label
color $ui-dark-text-color

View File

@@ -1,4 +1,4 @@
import React, { PropTypes } from 'react'
import React from 'react'
import CSSModules from 'browser/lib/CSSModules'
import styles from './SnippetTab.styl'
import context from 'browser/lib/context'
@@ -96,6 +96,7 @@ class SnippetTab extends React.Component {
{!this.state.isRenaming
? <button styleName='button'
onClick={(e) => this.handleClick(e)}
onDoubleClick={(e) => this.handleRenameClick(e)}
onContextMenu={(e) => this.handleContextMenu(e)}
>
{snippet.name.trim().length > 0
@@ -117,7 +118,7 @@ class SnippetTab extends React.Component {
<button styleName='deleteButton'
onClick={(e) => this.handleDeleteButtonClick(e)}
>
<i className='fa fa-times'/>
<i className='fa fa-times' />
</button>
}
</div>

View File

@@ -2,9 +2,6 @@
position relative
flex 1
overflow hidden
border-right $ui-border
&:last-child
border-right none
&:hover
.deleteButton
color $ui-inactive-text-color
@@ -13,11 +10,11 @@
&:active
color white
background-color $ui-active-color
.root--active
@extend .root
min-width 100px
.button
border-color $brand-color
border-bottom $ui-border
.button
width 100%
@@ -31,8 +28,6 @@
border-left 4px solid transparent
&:hover
background-color $ui-button--hover-backgroundColor
&:active, &:active:hover
border-color $brand-color
.deleteButton
position absolute
@@ -65,14 +60,12 @@ body[data-theme="dark"]
&:hover
background-color darken($ui-dark-button--hover-backgroundColor, 15%)
&:active
color white
color $ui-dark-text-color
background-color $ui-dark-button--active-backgroundColor
.root--active
color $ui-dark-text-color
border-color $ui-dark-borderColor
.button
border-color $brand-color
&:hover
background-color $ui-dark-button--hover-backgroundColor
.deleteButton
@@ -80,7 +73,7 @@ body[data-theme="dark"]
&:hover
background-color darken($ui-dark-button--hover-backgroundColor, 15%)
&:active
color white
color $ui-dark-text-color
background-color $ui-dark-button--active-backgroundColor
.button
@@ -90,13 +83,9 @@ body[data-theme="dark"]
transition color background-color 0.15s
border-left 4px solid transparent
&:hover
color white
color $ui-dark-text-color
background-color $ui-dark-button--hover-backgroundColor
&:active
color $ui-dark-button--active-color
&:active, &:active:hover
color $ui-dark-button--active-color
.input
background-color $ui-dark-button--hover-backgroundColor
color white
color $ui-dark-text-color

View File

@@ -0,0 +1,58 @@
/**
* @fileoverview Micro component for showing storage.
*/
import React, { PropTypes } from 'react'
import styles from './StorageItem.styl'
import CSSModules from 'browser/lib/CSSModules'
import { isNumber } from 'lodash'
/**
* @param {boolean} isActive
* @param {Function} handleButtonClick
* @param {Function} handleContextMenu
* @param {string} folderName
* @param {string} folderColor
* @param {boolean} isFolded
* @param {number} noteCount
* @return {React.Component}
*/
const StorageItem = ({
isActive, handleButtonClick, handleContextMenu, folderName,
folderColor, isFolded, noteCount
}) => (
<button styleName={isActive
? 'folderList-item--active'
: 'folderList-item'
}
onClick={handleButtonClick}
onContextMenu={handleContextMenu}
>
<span styleName={isFolded
? 'folderList-item-name--folded' : 'folderList-item-name'
}
style={{borderColor: folderColor}}
>
{isFolded ? folderName.substring(0, 1) : folderName}
</span>
{(!isFolded && isNumber(noteCount)) &&
<span styleName='folderList-item-noteCount'>{noteCount}</span>
}
{isFolded &&
<span styleName='folderList-item-tooltip'>
{folderName}
</span>
}
</button>
)
StorageItem.propTypes = {
isActive: PropTypes.bool.isRequired,
handleButtonClick: PropTypes.func,
handleContextMenu: PropTypes.func,
folderName: PropTypes.string.isRequired,
folderColor: PropTypes.string,
isFolded: PropTypes.bool.isRequired,
noteCount: PropTypes.number
}
export default CSSModules(StorageItem, styles)

View File

@@ -0,0 +1,92 @@
.root
width 100%
user-select none
.folderList-item
display flex
width 100%
height 26px
background-color transparent
color $ui-inactive-text-color
padding 0
margin-bottom 5px
text-align left
border none
overflow ellipsis
font-size 12px
&:first-child
margin-top 0
&:hover
color $ui-text-color
background-color alpha($ui-button--active-backgroundColor, 20%)
transition background-color 0.15s
&:active
color $ui-text-color
background-color $ui-button--active-backgroundColor
.folderList-item--active
@extend .folderList-item
color $ui-text-color
background-color $ui-button--active-backgroundColor
&:hover
color $ui-text-color
background-color $ui-button--active-backgroundColor
.folderList-item-name
display block
flex 1
padding 0 15px
height 26px
line-height 26px
border-width 0 0 0 2px
border-style solid
border-color transparent
overflow hidden
text-overflow ellipsis
.folderList-item-noteCount
float right
line-height 26px
padding-right 15px
font-size 12px
.folderList-item-tooltip
tooltip()
position fixed
padding 0 10px
left 44px
z-index 10
pointer-events none
opacity 0
border-top-right-radius 2px
border-bottom-right-radius 2px
height 26px
line-height 26px
.folderList-item:hover, .folderList-item--active:hover
.folderList-item-tooltip
opacity 1
.folderList-item-name--folded
@extend .folderList-item-name
padding-left 12px
body[data-theme="dark"]
.folderList-item
&:hover
background-color alpha($ui-dark-button--active-backgroundColor, 20%)
color $ui-dark-text-color
&:active
color $ui-dark-text-color
background-color $ui-dark-button--active-backgroundColor
.folderList-item--active
@extend .folderList-item
color $ui-dark-text-color
background-color $ui-dark-button--active-backgroundColor
&:active
background-color $ui-dark-button--active-backgroundColor
&:hover
color $ui-dark-text-color
background-color $ui-dark-button--active-backgroundColor

View File

@@ -54,7 +54,7 @@ body
font-family helvetica, arial, sans-serif
line-height 1.6
overflow-x hidden
user-select all
background-color $ui-noteDetail-backgroundColor
.katex
font 400 1.2em 'KaTeX_Main'
line-height 1.2em
@@ -68,10 +68,15 @@ body
padding 5px
margin -5px
border-radius 5px
.flowchart-error, .sequence-error
background-color errorBackgroundColor
color errorTextColor
padding 5px
border-radius 5px
justify-content left
li
label.taskListItem
margin-left -2em
background-color white
div.math-rendered
text-align center
.math-failed
@@ -191,7 +196,7 @@ code
padding 0.2em 0.4em
background-color #f7f7f7
border-radius 3px
font-size 0.85em
font-size 1em
text-decoration none
margin-right 2px
pre
@@ -200,26 +205,40 @@ pre
border-radius 5px
overflow-x auto
margin 0 0 1em
line-height 1.35
display flex
line-height 1.4em
&.flowchart, &.sequence
display flex
justify-content center
background-color white
&.CodeMirror
height initial
&>code
flex 1
overflow-x auto
code
margin 0
background-color inherit
margin 0
padding 0
border none
border-radius 0
pre
border none
margin -5px
&>span.lineNumber
display none
float left
font-size 0.85em
margin 0 0.5em 0 -0.5em
font-size 1em
padding 0.5em 0
margin -0.5em 0.5em -0.5em -0.5em
border-right 1px solid
text-align right
border-top-left-radius 4px
border-bottom-left-radius 4px
&.CodeMirror-gutters
position initial
top initial
left initial
min-height 0 !important
&>span
display block
padding 0 .5em 0 1em
padding 0 .5em 0
table
display block
width 100%
@@ -253,13 +272,14 @@ table
themeDarkBackground = darken(#21252B, 10%)
themeDarkText = #DDDDDD
themeDarkBorder = lighten(themeDarkBackground, 20%)
themeDarkPreview = #282C34
themeDarkPreview = $ui-dark-noteDetail-backgroundColor
themeDarkTableOdd = themeDarkPreview
themeDarkTableEven = darken(themeDarkPreview, 10%)
themeDarkTableHead = themeDarkTableEven
themeDarkTableBorder = themeDarkBorder
themeDarkModalButtonDefault = themeDarkPreview
themeDarkModalButtonDanger = #BF360C
body[data-theme="dark"]
color themeDarkText
border-color themeDarkBorder
@@ -269,7 +289,7 @@ body[data-theme="dark"]
code
border-color darken(themeDarkBorder, 10%)
background-color lighten(themeDarkPreview, 5%)
background-color lighten(themeDarkPreview, 10%)
pre
border-color lighten(#21252B, 20%)

View File

@@ -21,9 +21,11 @@ $list-width = 250px
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
@@ -32,7 +34,7 @@ $list-width = 250px
background-color $ui-backgroundColor
.result-nav-filter
margin-bottom 5px
margin-bottom 10px
.result-nav-filter-option
height 25px
@@ -62,7 +64,7 @@ $list-width = 250px
.result-nav-storageList
absolute bottom left right
top 80px + 32px + 10px
top 80px + 32px + 10px + 10px
overflow-y auto
.result-list
@@ -70,15 +72,15 @@ $list-width = 250px
absolute top bottom
left $nav-width
width $list-width
border-width 0 1px
border-style solid
border-color $ui-borderColor
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
@@ -88,6 +90,9 @@ body[data-theme="dark"]
.search-input
color $ui-dark-text-color
.result
background-color $ui-dark-noteList-backgroundColor
.result-nav
background-color $ui-dark-backgroundColor
label
@@ -104,7 +109,10 @@ body[data-theme="dark"]
.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,4 +1,4 @@
import React, { PropTypes } from 'react'
import React from 'react'
import CSSModules from 'browser/lib/CSSModules'
import styles from './NoteDetail.styl'
import MarkdownPreview from 'browser/components/MarkdownPreview'
@@ -97,9 +97,7 @@ class NoteDetail extends React.Component {
let { note, config } = this.props
if (note == null) {
return (
<div styleName='root'>
</div>
<div styleName='root' />
)
}
@@ -154,6 +152,7 @@ class NoteDetail extends React.Component {
fontSize={editorFontSize}
indentType={config.editor.indentType}
indentSize={editorIndentSize}
keyMap={config.editor.keyMap}
readOnly
ref={'code-' + index}
/>
@@ -185,11 +184,13 @@ class NoteDetail extends React.Component {
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}
/>
)

View File

@@ -1,12 +1,16 @@
@import('../main/Detail/DetailVars.styl')
.root
absolute top bottom left right
width 100%
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
border-bottom $ui-border
box-sizing border-box
.description-textarea
@@ -18,52 +22,43 @@
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
border-bottom $ui-border
display flex
background-color $ui-backgroundColor
background-color $ui-noteDetail-backgroundColor
.tabList-item
position relative
flex 1
border-right $ui-border
overflow hidden
&:hover
background-color $ui-button--hover-backgroundColorg
.tabList-item--active
@extend .tabList-item
.tabList-item-button
border-color $brand-color
border-bottom $ui-border
.tabList-item-button
width 100%
height 29px
navButtonColor()
outline none
border-left 4px solid transparent
.tabList-item-deleteButton
position absolute
top 5px
height 20px
right 5px
width 20px
text-align center
overflow ellipsis
text-align left
padding-right 30px
padding-left 10px
border none
padding 0
color transparent
background-color transparent
border-radius 2px
.tabList-plusButton
navButtonColor()
width 30px
transition 0.15s
&:hover
background-color $ui-button--hover-backgroundColor
.tabView
absolute left right bottom
top 110px
top 130px
.tabView-content
absolute top left right bottom
@@ -72,38 +67,31 @@
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-button--hover-backgroundColor
background-color $ui-dark-noteDetail-backgroundColor
color white
.tabList
background-color $ui-button--active-backgroundColor
border-bottom-color $ui-dark-borderColor
background-color $ui-dark-backgroundColor
background-color $ui-dark-noteDetail-backgroundColor
.tabList-item
border-color $ui-dark-borderColor
&:hover
background-color $ui-dark-button--hover-backgroundColor
.tabList-item--active
border-color $ui-dark-borderColor
.tabList-item-button
border-color $brand-color
.tabList-item-button
navDarkButtonColor()
border-left 4px solid transparent
.tabList-plusButton
navDarkButtonColor()
.tabView-top
border-color $ui-dark-borderColor
.tabView-top-name
border-color $ui-dark-borderColor
.tabList-item-button
border none
color $ui-dark-text-color
background-color $ui-dark-button--hover-backgroundColor
.tabView-top-mode
border-color $ui-dark-borderColor
background-color $dark-default-button-background
color $ui-dark-inactive-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,85 +0,0 @@
import React, { PropTypes } from 'react'
import CSSModules from 'browser/lib/CSSModules'
import styles from './NoteItem.styl'
import moment from 'moment'
import _ from 'lodash'
class NoteItem extends React.Component {
constructor (props) {
super(props)
this.state = {
}
}
handleClick (e) {
this.props.onClick(e)
}
render () {
let { note, folder, storage, isActive } = this.props
let tagList = _.isArray(note.tags)
? note.tags.map((tag) => {
return (
<span styleName='bottom-tagList-item'
key={tag}>
{tag}
</span>
)
})
: []
return (
<div styleName={isActive
? 'root--active'
: 'root'
}
key={note.storage + '-' + note.key}
onClick={(e) => this.handleClick(e)}
>
<div styleName='info'>
<div styleName='info-left'>
<span styleName='info-left-folder'
style={{borderColor: folder.color}}
>
{folder.name}
<span styleName='info-left-folder-surfix'>in {storage.name}</span>
</span>
</div>
</div>
<div styleName='title'>
{note.type === 'SNIPPET_NOTE'
? <i styleName='title-icon' className='fa fa-fw fa-code'/>
: <i styleName='title-icon' className='fa fa-fw fa-file-text-o'/>
}
{note.title.trim().length > 0
? note.title
: <span styleName='title-empty'>Empty</span>
}
</div>
<div styleName='bottom'>
<i styleName='bottom-tagIcon'
className='fa fa-tags fa-fw'
/>
<div styleName='bottom-tagList'>
{tagList.length > 0
? tagList
: <span styleName='bottom-tagList-empty'>Not tagged yet</span>
}
</div>
<div styleName='bottom-time'>
{moment(note.updatedAt).fromNow()}
</div>
</div>
</div>
)
}
}
NoteItem.propTypes = {
}
export default CSSModules(NoteItem, styles)

View File

@@ -1,179 +0,0 @@
.root
position relative
border-bottom $ui-border
padding 2px 5px
user-select none
cursor pointer
transition background-color 0.15s
&:hover
background-color alpha($ui-active-color, 20%)
.root--active
@extend .root
background-color $ui-active-color
&:hover
background-color $ui-active-color
color white
.info-left-folder
.info-left-folder-surfix
.title
.title-icon
.title-empty
.bottom-tagIcon
.bottom-tagList-item
.bottom-tagList-empty
.bottom-time
color white
.bottom-tagList-item
color white
background-color transparent
.border
absolute top bottom left right
border-style solid
border-width 2px
border-color transparent
transition 0.15s
.info
height 20px
clearfix()
font-size 12px
color $ui-inactive-text-color
line-height 20px
overflow-y hidden
.info-left
float left
overflow ellipsis
.info-left-folder
border-left 4px solid transparent
padding 2px 5px
color $ui-text-color
.info-left-folder-surfix
font-size 10px
margin-left 5px
color $ui-inactive-text-color
.info-right
float right
.title
height 24px
box-sizing border-box
line-height 24px
height 20px
line-height 20px
padding 0 5px 0 0
overflow ellipsis
color $ui-text-color
.title-icon
font-size 12px
color $ui-inactive-text-color
padding-right 3px
.title-empty
font-weight normal
color $ui-inactive-text-color
.bottom
margin-top 2px
height 20px
font-size 12px
line-height 20px
overflow ellipsis
display flex
.bottom-tagIcon
vertical-align middle
color $ui-button-color
height 20px
line-height 20px
.bottom-tagList
flex 1
overflow ellipsis
line-height 20px
.bottom-tagList-item
margin 0 4px
padding 0 4px
height 20px
box-sizing border-box
border-radius 3px
vertical-align middle
border-style solid
border-color $ui-button--focus-borderColor
border-width 0 0 0 3px
background-color $ui-backgroundColor
color $ui-text-color
transition 0.15s
.bottom-tagList-empty
color $ui-inactive-text-color
vertical-align middle
font-size 10px
margin-left 5px
.bottom-time
color $ui-inactive-text-color
margin-left 5px
font-size 10px
body[data-theme="dark"]
.root
border-color $ui-dark-borderColor
.root--active
@extend .root
border-color $ui-dark-borderColor
&:hover
background-color $ui-active-color
.info-left-folder
.info-left-folder-surfix
.title
.title-icon
.title-empty
.bottom-tagIcon
.bottom-tagList-item
.bottom-tagList-empty
.bottom-time
color white
.bottom-tagList-item
color white
background-color transparent
.info
color $ui-dark-inactive-text-color
.info-left-folder
color $ui-dark-text-color
.info-left-folder-surfix
color $ui-dark-inactive-text-color
.title
color $ui-dark-text-color
.title-icon
color $ui-dark-inactive-text-color
.title-empty
color $ui-dark-inactive-text-color
.tagList-empty
color $ui-dark-inactive-text-color
.bottom-tagIcon
color $ui-dark-button-color
.bottom-tagList-item
color $ui-dark-text-color
background-color $ui-dark-backgroundColor
.bottom-tagList-empty
color $ui-dark-inactive-text-color
.bottom-time
color $ui-dark-inactive-text-color

View File

@@ -1,6 +1,6 @@
import React, { PropTypes } from 'react'
import NoteItem from './NoteItem'
import _ from 'lodash'
import React from 'react'
import NoteItem from 'browser/components/NoteItem'
import moment from 'moment'
class NoteList extends React.Component {
constructor (props) {
@@ -54,21 +54,23 @@ class NoteList extends React.Component {
}
render () {
let { storageMap, notes, index } = this.props
let { notes, index } = this.props
let notesList = notes
.slice(0, 10 + 10 * this.state.range)
.map((note, _index) => {
let storage = storageMap[note.storage]
let folder = _.find(storage.folders, {key: note.folder})
const isActive = (index === _index)
const key = `${note.storage}-${note.key}`
const dateDisplay = moment(note.updatedAt).fromNow()
return (
<NoteItem
isActive={isActive}
note={note}
key={`${note.storage}-${note.key}`}
storage={storage}
folder={folder}
isActive={index === _index}
onClick={(e) => this.props.handleNoteClick(e, _index)}
dateDisplay={dateDisplay}
key={key}
handleNoteClick={(e) => this.props.handleNoteClick(e, _index)}
handleNoteContextMenu={() => ''}
/>
)
})

View File

@@ -1,6 +1,7 @@
import React, { PropTypes } from 'react'
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) {
@@ -30,20 +31,17 @@ class StorageSection extends React.Component {
render () {
let { storage, filter } = this.props
let folderList = storage.folders
.map((folder) => {
return (
<button styleName={filter.type === 'FOLDER' && filter.folder === folder.key && filter.storage === storage.key
? 'folderList-item--active'
: 'folderList-item'
}
style={{borderColor: folder.color}}
key={folder.key}
onClick={(e) => this.handleFolderClick(e, folder)}
>
{folder.name}
</button>
)
})
.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'>

View File

@@ -9,6 +9,7 @@ import styles from './FinderMain.styl'
import StorageSection from './StorageSection'
import NoteList from './NoteList'
import NoteDetail from './NoteDetail'
import SideNavFilter from 'browser/components/SideNavFilter'
require('!!style!css!stylus?sourceMap!../main/global.styl')
require('../lib/customMeta')
@@ -66,12 +67,8 @@ class FinderMain extends React.Component {
}
handleWindowBlur (e) {
let { filter } = this.state
filter.type = 'ALL'
this.setState({
search: '',
filter,
index: 0
search: ''
})
}
@@ -307,18 +304,12 @@ class FinderMain extends React.Component {
/> Only Markdown</label>
</div>
</div>
<button styleName={filter.type === 'ALL'
? 'result-nav-menu--active'
: 'result-nav-menu'
}
onClick={(e) => this.handleAllNotesButtonClick(e)}
><i className='fa fa-files-o fa-fw'/> All Notes</button>
<button styleName={filter.type === 'STARRED'
? 'result-nav-menu--active'
: 'result-nav-menu'
}
onClick={(e) => this.handleStarredButtonClick(e)}
><i className='fa fa-star fa-fw'/> Starred</button>
<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>
@@ -356,7 +347,7 @@ function refreshData () {
ReactDOM.render((
<Provider store={store}>
<Finder/>
<Finder />
</Provider>
), document.getElementById('content'), function () {
refreshData()

View File

@@ -1,21 +0,0 @@
import superagent from 'superagent'
import superagentPromise from 'superagent-promise'
export const SERVER_URL = 'https://b00st.io/'
// export const SERVER_URL = 'http://localhost:3333/'
export const request = superagentPromise(superagent, Promise)
export function shareViaPublicURL (input) {
return request
.post(SERVER_URL + 'apis/share')
// .set({
// Authorization: 'Bearer ' + auth.token()
// })
.send(input)
}
export default {
SERVER_URL,
shareViaPublicURL
}

View File

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

View File

@@ -0,0 +1,18 @@
/**
* @fileoverview Formatting date string.
*/
import moment from 'moment'
/**
* @description Return date string. For example, 'Sep.9, 2016 12:00'.
* @param {mixed}
* @return {string}
*/
export function getLastUpdated (date) {
const m = moment(date)
if (!m.isValid()) {
throw Error('Invalid argument.')
}
return m.format('MMM D, gggg H:mm')
}

View File

@@ -1,78 +0,0 @@
const hljsThemeList = [
{caption: 'Default', name: 'default'},
{caption: 'Agate', name: 'agate'},
{caption: 'Androidstudio', name: 'androidstudio'},
{caption: 'Arduino Light', name: 'arduino-light'},
{caption: 'Arta', name: 'arta'},
{caption: 'Ascetic', name: 'ascetic'},
{caption: 'Atelier Cave Dark', name: 'atelier-cave-dark'},
{caption: 'Atelier Cave Light', name: 'atelier-cave-light'},
{caption: 'Atelier Dune Dark', name: 'atelier-dune-dark'},
{caption: 'Atelier Dune Light', name: 'atelier-dune-light'},
{caption: 'Atelier Estuary Dark', name: 'atelier-estuary-dark'},
{caption: 'Atelier Estuary Light', name: 'atelier-estuary-light'},
{caption: 'Atelier Forest Dark', name: 'atelier-forest-dark'},
{caption: 'Atelier Forest Light', name: 'atelier-forest-light'},
{caption: 'Atelier Heath Dark', name: 'atelier-heath-dark'},
{caption: 'Atelier Heath Light', name: 'atelier-heath-light'},
{caption: 'Atelier Lakeside Dark', name: 'atelier-lakeside-dark'},
{caption: 'Atelier Lakeside Light', name: 'atelier-lakeside-light'},
{caption: 'Atelier Plateau Dark', name: 'atelier-plateau-dark'},
{caption: 'Atelier Plateau Light', name: 'atelier-plateau-light'},
{caption: 'Atelier Savanna Dark', name: 'atelier-savanna-dark'},
{caption: 'Atelier Savanna Light', name: 'atelier-savanna-light'},
{caption: 'Atelier Seaside Dark', name: 'atelier-seaside-dark'},
{caption: 'Atelier Seaside Light', name: 'atelier-seaside-light'},
{caption: 'Atelier Sulphurpool Dark', name: 'atelier-sulphurpool-dark'},
{caption: 'Atelier Sulphurpool Light', name: 'atelier-sulphurpool-light'},
{caption: 'Brown Paper', name: 'brown-paper'},
{caption: 'Codepen Embed', name: 'codepen-embed'},
{caption: 'Color Brewer', name: 'color-brewer'},
{caption: 'Dark', name: 'dark'},
{caption: 'Darkula', name: 'darkula'},
{caption: 'Docco', name: 'docco'},
{caption: 'Dracula', name: 'dracula'},
{caption: 'Far', name: 'far'},
{caption: 'Foundation', name: 'foundation'},
{caption: 'Github Gist', name: 'github-gist'},
{caption: 'Github', name: 'github'},
{caption: 'Googlecode', name: 'googlecode'},
{caption: 'Grayscale', name: 'grayscale'},
{caption: 'Gruvbox Dark', name: 'gruvbox.dark'},
{caption: 'Gruvbox Light', name: 'gruvbox.light'},
{caption: 'Hopscotch', name: 'hopscotch'},
{caption: 'Hybrid', name: 'hybrid'},
{caption: 'Idea', name: 'idea'},
{caption: 'Ir Black', name: 'ir-black'},
{caption: 'Kimbie Dark', name: 'kimbie.dark'},
{caption: 'Kimbie Light', name: 'kimbie.light'},
{caption: 'Magula', name: 'magula'},
{caption: 'Mono Blue', name: 'mono-blue'},
{caption: 'Monokai Sublime', name: 'monokai-sublime'},
{caption: 'Monokai', name: 'monokai'},
{caption: 'Obsidian', name: 'obsidian'},
{caption: 'Paraiso Dark', name: 'paraiso-dark'},
{caption: 'Paraiso Light', name: 'paraiso-light'},
{caption: 'Pojoaque', name: 'pojoaque'},
{caption: 'Qtcreator Dark', name: 'qtcreator_dark'},
{caption: 'Qtcreator Light', name: 'qtcreator_light'},
{caption: 'Railscasts', name: 'railscasts'},
{caption: 'Rainbow', name: 'rainbow'},
{caption: 'School Book', name: 'school-book'},
{caption: 'Solarized Dark', name: 'solarized-dark'},
{caption: 'Solarized Light', name: 'solarized-light'},
{caption: 'Sunburst', name: 'sunburst'},
{caption: 'Tomorrow Night Blue', name: 'tomorrow-night-blue'},
{caption: 'Tomorrow Night Bright', name: 'tomorrow-night-bright'},
{caption: 'Tomorrow Night Eighties', name: 'tomorrow-night-eighties'},
{caption: 'Tomorrow Night', name: 'tomorrow-night'},
{caption: 'Tomorrow', name: 'tomorrow'},
{caption: 'Vs', name: 'vs'},
{caption: 'Xcode', name: 'xcode'},
{caption: 'Xt 256', name: 'xt256'},
{caption: 'Zenburn', name: 'zenburn'}
]
export default function hljsTheme () {
return hljsThemeList
}

View File

@@ -1,7 +1,6 @@
import markdownit from 'markdown-it'
import emoji from 'markdown-it-emoji'
import math from '@rokt33r/markdown-it-math'
import hljs from 'highlight.js'
import _ from 'lodash'
const katex = window.katex
@@ -10,9 +9,9 @@ function createGutter (str) {
let lc = (str.match(/\n/g) || []).length
let lines = []
for (let i = 1; i <= lc; i++) {
lines.push('<span>' + i + '</span>')
lines.push('<span class="CodeMirror-linenumber">' + i + '</span>')
}
return '<span class="lineNumber">' + lines.join('') + '</span>'
return '<span class="lineNumber CodeMirror-gutters">' + lines.join('') + '</span>'
}
var md = markdownit({
@@ -21,19 +20,16 @@ var md = markdownit({
html: true,
xhtmlOut: true,
highlight: function (str, lang) {
if (lang && hljs.getLanguage(lang)) {
try {
return '<pre class="hljs">' +
createGutter(str) +
'<code>' +
hljs.highlight(lang, str).value +
'</code></pre>'
} catch (e) {}
if (lang === 'flowchart') {
return `<pre class="flowchart">${str}</pre>`
}
return '<pre class="hljs">' +
if (lang === 'sequence') {
return `<pre class="sequence">${str}</pre>`
}
return '<pre class="code">' +
createGutter(str) +
'<code>' +
str.replace(/\&/g, '&amp;').replace(/\</g, '&lt;').replace(/\>/g, '&gt;').replace(/\"/g, '&quot;') +
'<code class="' + lang + '">' +
str +
'</code></pre>'
}
})
@@ -62,7 +58,7 @@ md.use(math, {
})
md.use(require('markdown-it-footnote'))
// Override task item
md.block.ruler.at('paragraph', function (state, startLine/*, endLine*/) {
md.block.ruler.at('paragraph', function (state, startLine/*, endLine */) {
let content, terminate, i, l, token
let nextLine = startLine + 1
let terminatorRules = state.md.block.ruler.getRules('paragraph')
@@ -139,13 +135,13 @@ function strip (input) {
.replace(/`{3}.*\n/g, '')
.replace(/<(.*?)>/g, '$1')
.replace(/^[=\-]{2,}\s*$/g, '')
.replace(/\[\^.+?\](\: .*?$)?/g, '')
.replace(/\[\^.+?\](: .*?$)?/g, '')
.replace(/\s{0,2}\[.*?\]: .*?$/g, '')
.replace(/\!\[.*?\][\[\(].*?[\]\)]/g, '')
.replace(/!\[.*?\][\[\(].*?[\]\)]/g, '')
.replace(/\[(.*?)\][\[\(].*?[\]\)]/g, '$1')
.replace(/>/g, '')
.replace(/^\s{1,2}\[(.*?)\]: (\S+)( ".*?")?\s*$/g, '')
.replace(/^\#{1,6}\s*([^#]*)\s*(\#{1,6})?/gm, '$1')
.replace(/^#{1,6}\s*([^#]*)\s*(#{1,6})?/gm, '$1')
.replace(/([\*_]{1,3})(\S.*?\S)\1/g, '$2')
.replace(/(`{3,})(.*?)\1/gm, '$2')
.replace(/^-{3,}\s*$/g, '')

View File

@@ -1,8 +1,5 @@
.root
absolute top bottom right
border-width 1px 0
border-style solid
border-color $ui-borderColor
.empty
height 320px
@@ -18,7 +15,6 @@
body[data-theme="dark"]
.root
border-color $ui-dark-borderColor
background-color $ui-dark-backgroundColor
.empty-message
color $ui-dark-inactive-text-color

View File

@@ -0,0 +1,9 @@
/**
* Varibales for note detail space.
*/
// Margin on the left side and the right side for NoteDetail component.
$note-detail-left-margin = 25px
$note-detail-right-margin = 25px
$note-detail-box-shadow = 2px 0 15px -8px #b1b1b1 inset

View File

@@ -128,8 +128,8 @@ class FolderSelect extends React.Component {
}
nextOption () {
let { storages } = this.props
let { optionIndex } = this.state
let { folders } = this.props
optionIndex++
if (optionIndex >= folders.length) optionIndex = 0
@@ -262,13 +262,11 @@ class FolderSelect extends React.Component {
: <div styleName='idle'>
<div styleName='idle-label'>
<span styleName='idle-label-name'
style={{borderColor: currentOption.folder.color}}
style={{color: currentOption.folder.color}}
>
{currentOption.folder.name}
<span styleName='idle-label-name-surfix'>in {currentOption.storage.name}</span>
{currentOption.folder.name} /
</span>
</div>
<i styleName='idle-caret' className='fa fa-fw fa-caret-down'/>
</div>
}

View File

@@ -7,29 +7,28 @@
transition 0.15s
user-select none
&:hover
background-color white
border-color $ui-borderColor
background-color $ui-button--hover-backgroundColor
.root--search, .root--focus
@extend .root
background-color white
background-color $ui-noteDetail-backgroundColor = #F4F4F4
border-color $ui-input--focus-borderColor
width 100px
&:hover
background-color white
border-color $ui-input--focus-borderColor
.idle
position relative
cursor pointer
.idle-label
absolute left top
padding 0 0 0 5px
right 20px
overflow ellipsis
.idle-label-name
border-left solid 4px transparent
padding 2px 5px
font-size 14px
padding 2px
.idle-label-name-surfix
font-size 10px
color $ui-inactive-text-color
@@ -60,9 +59,9 @@
max-height 450px
overflow auto
z-index 200
border $ui-border
background-color white
border-radius 2px
box-shadow 2px 2px 10px gray
.search-optionList-item
height 34px
@@ -82,7 +81,7 @@
background-color $ui-button--active-backgroundColor
color $ui-button--active-color
.search-optionList-item-name
border-left solid 4px transparent
border-left solid 2px transparent
padding 2px 5px
.search-optionList-item-name-surfix
font-size 10px
@@ -115,8 +114,8 @@ body[data-theme="dark"]
.search-optionList
color white
border-color $ui-dark-borderColor
background-color $ui-dark-button--hover-backgroundColor
box-shadow 2px 2px 10px black
.search-optionList-item
&:hover

View File

@@ -0,0 +1,27 @@
/**
* @fileoverview Component for show updated date of the detail.
*/
import React, { PropTypes } from 'react'
import { getLastUpdated } from 'browser/lib/date-formatter'
import CSSModules from 'browser/lib/CSSModules'
import styles from './LastUpdatedString.styl'
const LastUpdatedString = ({ date }) => {
let text = ''
try {
text = `Last updated at ${getLastUpdated(date)}`
} catch (e) {
text = ''
}
return (
<p styleName='info-right-date'>{text}</p>
)
}
LastUpdatedString.propTypes = {
date: PropTypes.string
}
export default CSSModules(LastUpdatedString, styles)

View File

@@ -0,0 +1,10 @@
.info-right-date
display inline
line-height 24px
padding-right 25px
font-size 11px
color $ui-button-color
body[data-theme="dark"]
.info-right-date
color $ui-dark-button-color

View File

@@ -25,15 +25,23 @@ class MarkdownNoteDetail extends React.Component {
note: Object.assign({
title: '',
content: ''
}, props.note)
}, props.note),
isLockButtonShown: false,
isLocked: false
}
this.dispatchTimer = null
this.toggleLockButton = this.handleToggleLockButton.bind(this)
}
focus () {
this.refs.content.focus()
}
componentDidMount () {
ee.on('topbar:togglelockbutton', this.toggleLockButton)
}
componentWillReceiveProps (nextProps) {
if (nextProps.note.key !== this.props.note.key && !this.isMovingNote) {
if (this.saveQueue != null) this.saveNow()
@@ -50,13 +58,20 @@ class MarkdownNoteDetail extends React.Component {
if (this.saveQueue != null) this.saveNow()
}
componentDidUnmount () {
ee.off('topbar:togglelockbutton', this.toggleLockButton)
}
findTitle (value) {
let splitted = value.split('\n')
let title = null
let isMarkdownInCode = false
for (let i = 0; i < splitted.length; i++) {
let trimmedLine = splitted[i].trim()
if (trimmedLine.match(/^# .+/)) {
if (trimmedLine.match('```')) {
isMarkdownInCode = !isMarkdownInCode
} else if (isMarkdownInCode === false && trimmedLine.match(/^# +/)) {
title = trimmedLine.substring(1, trimmedLine.length).trim()
break
}
@@ -166,30 +181,7 @@ class MarkdownNoteDetail extends React.Component {
}
handleShareButtonClick (e) {
let menu = new Menu()
menu.append(new MenuItem({
label: 'Export as a File',
click: (e) => this.handlePreferencesButtonClick(e)
}))
menu.append(new MenuItem({
label: 'Export to Web',
disabled: true,
click: (e) => this.handlePreferencesButtonClick(e)
}))
menu.popup(remote.getCurrentWindow())
}
handleContextButtonClick (e) {
let menu = new Menu()
menu.append(new MenuItem({
label: 'Delete',
click: (e) => this.handleDeleteMenuClick(e)
}))
menu.popup(remote.getCurrentWindow())
}
handleDeleteMenuClick (e) {
handleDeleteButtonClick (e) {
let index = dialog.showMessageBox(remote.getCurrentWindow(), {
type: 'warning',
message: 'Delete a note',
@@ -214,10 +206,34 @@ class MarkdownNoteDetail extends React.Component {
}
}
handleLockButtonMouseDown (e) {
e.preventDefault()
ee.emit('editor:lock')
this.setState({ isLocked: !this.state.isLocked })
if (this.state.isLocked) this.focus()
}
getToggleLockButton () {
return this.state.isLocked ? 'fa-lock' : 'fa-unlock-alt'
}
handleDeleteKeyDown (e) {
if (e.keyCode === 27) this.handleDeleteCancelButtonClick(e)
}
handleToggleLockButton (event, noteStatus) {
// first argument event is not used
if (this.props.config.editor.switchPreview === 'BLUR' && noteStatus === 'CODE') {
this.setState({isLockButtonShown: true})
} else {
this.setState({isLockButtonShown: false})
}
}
handleFocus (e) {
this.focus()
}
render () {
let { data, config } = this.props
let { note } = this.state
@@ -229,6 +245,10 @@ class MarkdownNoteDetail extends React.Component {
>
<div styleName='info'>
<div styleName='info-left'>
<StarButton styleName='info-left-button'
onClick={(e) => this.handleStarButtonClick(e)}
isActive={note.isStarred}
/>
<div styleName='info-left-top'>
<FolderSelect styleName='info-left-top-folderSelect'
value={this.state.note.storage + '-' + this.state.note.folder}
@@ -237,36 +257,42 @@ class MarkdownNoteDetail extends React.Component {
onChange={(e) => this.handleFolderChange(e)}
/>
</div>
<div styleName='info-left-bottom'>
<TagSelect
styleName='info-left-bottom-tagSelect'
ref='tags'
value={this.state.note.tags}
onChange={(e) => this.handleChange(e)}
/>
</div>
<TagSelect
ref='tags'
value={this.state.note.tags}
onChange={(e) => this.handleChange(e)}
/>
</div>
<div styleName='info-right'>
<StarButton styleName='info-right-button'
onClick={(e) => this.handleStarButtonClick(e)}
isActive={note.isStarred}
/>
<button styleName='info-right-button'
onClick={(e) => this.handleShareButtonClick(e)}
disabled
{(() => {
const faClassName = `fa ${this.getToggleLockButton()}`
const lockButtonComponent =
<button styleName='control-lockButton'
onFocus={(e) => this.handleFocus(e)}
onMouseDown={(e) => this.handleLockButtonMouseDown(e)}
>
<i className={faClassName} styleName='lock-button' />
<span styleName='control-lockButton-tooltip'>
{this.state.isLocked ? 'Unlock' : 'Lock'}
</span>
</button>
return (
this.state.isLockButtonShown ? lockButtonComponent : ''
)
})()}
<button styleName='control-trashButton'
onClick={(e) => this.handleDeleteButtonClick(e)}
>
<i className='fa fa-share-alt fa-fw' />
<span styleName='info-right-button-tooltip'
style={{right: 20}}
>Share Note</span>
</button>
<button styleName='info-right-button'
onClick={(e) => this.handleContextButtonClick(e)}
>
<i className='fa fa-ellipsis-v' />
<span styleName='info-right-button-tooltip'
style={{right: 5}}
>More Options</span>
<svg height='14px' id='Capa_1' style={{enableBackground: 'new 0 0 753.23 753.23'}} width='14px' version='1.1' viewBox='0 0 753.23 753.23' x='0px' y='0px' xmlSpace='preserve'>
<g>
<g id='_x34__19_'>
<g>
<path d='M494.308,659.077c12.993,0,23.538-10.546,23.538-23.539V353.077c0-12.993-10.545-23.539-23.538-23.539&#xA;&#x9;&#x9;&#x9;&#x9;s-23.538,10.545-23.538,23.539v282.461C470.77,648.531,481.314,659.077,494.308,659.077z M635.538,94.154h-141.23V47.077&#xA;&#x9;&#x9;&#x9;&#x9;C494.308,21.067,473.24,0,447.23,0H306c-26.01,0-47.077,21.067-47.077,47.077v47.077h-141.23&#xA;&#x9;&#x9;&#x9;&#x9;c-26.01,0-47.077,21.067-47.077,47.077v47.077c0,25.986,21.067,47.077,47.077,47.077v423.692&#xA;&#x9;&#x9;&#x9;&#x9;c0,51.996,42.157,94.153,94.154,94.153h329.539c51.996,0,94.153-42.157,94.153-94.153V235.385&#xA;&#x9;&#x9;&#x9;&#x9;c26.01,0,47.077-21.091,47.077-47.077V141.23C682.615,115.221,661.548,94.154,635.538,94.154z M306,70.615&#xA;&#x9;&#x9;&#x9;&#x9;c0-12.993,10.545-23.539,23.538-23.539h94.154c12.993,0,23.538,10.545,23.538,23.539v23.539c-22.809,0-141.23,0-141.23,0V70.615z&#xA;&#x9;&#x9;&#x9;&#x9; M588.461,659.077c0,25.986-21.066,47.076-47.076,47.076H211.846c-26.01,0-47.077-21.09-47.077-47.076V235.385h423.692V659.077z&#xA;&#x9;&#x9;&#x9;&#x9; M612,188.308H141.23c-12.993,0-23.538-10.545-23.538-23.539s10.545-23.539,23.538-23.539H612&#xA;&#x9;&#x9;&#x9;&#x9;c12.993,0,23.538,10.545,23.538,23.539S624.993,188.308,612,188.308z M258.923,659.077c12.993,0,23.539-10.546,23.539-23.539&#xA;&#x9;&#x9;&#x9;&#x9;V353.077c0-12.993-10.545-23.539-23.539-23.539s-23.539,10.545-23.539,23.539v282.461&#xA;&#x9;&#x9;&#x9;&#x9;C235.384,648.531,245.93,659.077,258.923,659.077z M376.615,659.077c12.993,0,23.538-10.546,23.538-23.539V353.077&#xA;&#x9;&#x9;&#x9;&#x9;c0-12.993-10.545-23.539-23.538-23.539s-23.539,10.545-23.539,23.539v282.461C353.077,648.531,363.622,659.077,376.615,659.077z' />
</g>
</g>
</g>
</svg>
</button>
</div>
</div>
@@ -284,6 +310,7 @@ class MarkdownNoteDetail extends React.Component {
<StatusBar
{..._.pick(this.props, ['config', 'location', 'dispatch'])}
date={note.updatedAt}
/>
</div>
)

View File

@@ -1,68 +1,41 @@
$info-height = 75px
@import('NoteDetailInfo')
@import('DetailVars')
.root
absolute top right bottom
border-width 0 0 1px
border-style solid
border-color $ui-borderColor
background-color $ui-noteDetail-backgroundColor
box-shadow $note-detail-box-shadow
.info
absolute top left right
height $info-height
border-bottom $ui-border
background-color $ui-backgroundColor
.lock-button
padding-bottom 3px
.info-left
float left
padding 0 5px
.control-lockButton
topBarButtonLight()
.info-left-top
height 40px
line-height 40px
.info-left-top-folderSelect
display inline-block
height 34px
width 200px
vertical-align middle
.info-left-bottom
height 30px
.info-left-bottom-tagSelect
height 30px
line-height 30px
.info-right
float right
.info-right-button
width 34px
height 34px
border-radius 17px
navButtonColor()
border $ui-border
font-size 14px
margin 8px 2px
padding 0
&:active
border-color $ui-button--focus-borderColor
&:hover .info-right-button-tooltip
opacity 1
&:focus
border-color $ui-button--focus-borderColor
.info-right-button-tooltip
.control-lockButton-tooltip
tooltip()
position fixed
top 45px
pointer-events none
top 50px
z-index 200
padding 5px
opacity 0
line-height normal
border-radius 2px
opacity 0
transition 0.1s
.control-trashButton
float right
topBarButtonLight()
.body
absolute left right
top $info-height
left $note-detail-left-margin
right $note-detail-right-margin
top $info-height + $info-margin-under-border
bottom $statusBar-height
.body-noteEditor
@@ -71,32 +44,14 @@ $info-height = 75px
body[data-theme="dark"]
.root
border-color $ui-dark-borderColor
background-color $ui-dark-noteDetail-backgroundColor
box-shadow none
.info
border-color $ui-dark-borderColor
background-color $ui-dark-backgroundColor
.control-lockButton
topBarButtonDark()
.info-delete
color $ui-dark-text-color
.info-delete-confirmButton
colorDarkDangerButton()
color $ui-dark-text-color
.info-delete-cancelButton
colorDarkDefaultButton()
border-color $ui-dark-borderColor
color $ui-dark-text-color
.info-right-button
navDarkButtonColor()
border-color $ui-dark-borderColor
&:active
border-color $ui-dark-button--focus-borderColor
&:hover .info-right-button-tooltip
opacity 1
&:focus
border-color $ui-button--focus-borderColor
.info-right-button-tooltip
.control-lockButton-tooltip
darkTooltip()
.control-trashButton
topBarButtonDark()

View File

@@ -0,0 +1,75 @@
@import('DetailVars')
$info-height = 60px
$info-margin-under-border = 27px
.info
absolute top left right
left $note-detail-left-margin
right $note-detail-right-margin
height $info-height
border-bottom $ui-border
background-color $ui-noteDetail-backgroundColor
.info-left
float left
padding 0 5px
margin 0px 2px
.info-left-top
display inline-block
height $info-height
line-height $info-height
.info-left-top-folderSelect
display inline-block
padding 0 3px
height 34px
line-height 34px
vertical-align middle
border-radius 3px
.info-left-button
width 34px
height 34px
navButtonColor()
color $ui-favorite-star-button-color
font-size 14px
margin 13px 2px
padding 0
border-radius 17px
&:hover .info-left-button-tooltip
opacity 1
&:focus
border-color $ui-favorite-star-button-color
&:active, &:active:hover
background-color $ui-favorite-star-button-color
color $ui-button--active-color
.info-right
position absolute
right 0
top 0
background $ui-noteDetail-backgroundColor
bottom 1px
padding-left 30px
body[data-theme="dark"]
.info
border-color $ui-dark-borderColor
background-color $ui-dark-noteDetail-backgroundColor
.info-delete
color $ui-dark-text-color
.info-delete-confirmButton
colorDarkDangerButton()
color $ui-dark-text-color
.info-delete-cancelButton
colorDarkDefaultButton()
border-color $ui-dark-borderColor
color $ui-dark-text-color
.info-right
background-color $ui-dark-noteDetail-backgroundColor

View File

@@ -10,10 +10,11 @@ import dataApi from 'browser/main/lib/dataApi'
import { hashHistory } from 'react-router'
import ee from 'browser/main/lib/eventEmitter'
import CodeMirror from 'codemirror'
import SnippetTab from './SnippetTab'
import SnippetTab from 'browser/components/SnippetTab'
import StatusBar from '../StatusBar'
import context from 'browser/lib/context'
import ConfigManager from 'browser/main/lib/ConfigManager'
import _ from 'lodash'
function pass (name) {
switch (name) {
@@ -188,29 +189,7 @@ class SnippetNoteDetail extends React.Component {
}
handleShareButtonClick (e) {
let menu = new Menu()
menu.append(new MenuItem({
label: 'Export as a File',
disabled: true,
click: (e) => this.handlePreferencesButtonClick(e)
}))
menu.append(new MenuItem({
label: 'Export to Web',
disabled: true,
click: (e) => this.handlePreferencesButtonClick(e)
}))
menu.popup(remote.getCurrentWindow())
}
handleContextButtonClick (e) {
context.popup([{
label: 'Delete',
click: (e) => this.handleDeleteMenuClick(e)
}])
}
handleDeleteMenuClick (e) {
handleDeleteButtonClick (e) {
let index = dialog.showMessageBox(remote.getCurrentWindow(), {
type: 'warning',
message: 'Delete a note',
@@ -264,15 +243,15 @@ class SnippetNoteDetail extends React.Component {
}
deleteSnippetByIndex (index) {
let snippets = this.state.note.snippets.slice()
const snippets = this.state.note.snippets.slice()
snippets.splice(index, 1)
this.state.note.snippets = snippets
let snippetIndex = this.state.snippetIndex >= snippets.length
const note = Object.assign({}, this.state.note, {snippets})
const snippetIndex = this.state.snippetIndex >= snippets.length
? snippets.length - 1
: this.state.snippetIndex
this.setState({
note: this.state.note,
snippetIndex
this.setState({ note, snippetIndex }, () => {
this.save()
this.refs['code-' + this.state.snippetIndex].reload()
})
}
@@ -507,7 +486,7 @@ class SnippetNoteDetail extends React.Component {
key={index}
style={{zIndex: isActive ? 5 : 4}}
>
{snippet.mode === 'markdown'
{snippet.mode === 'Markdown' || snippet.mode === 'GitHub Flavored Markdown'
? <MarkdownEditor styleName='tabView-content'
value={snippet.content}
config={config}
@@ -523,6 +502,7 @@ class SnippetNoteDetail extends React.Component {
fontSize={editorFontSize}
indentType={config.editor.indentType}
indentSize={editorIndentSize}
keyMap={config.editor.keyMap}
onChange={(e) => this.handleCodeChange(index)(e)}
ref={'code-' + index}
/>
@@ -538,6 +518,10 @@ class SnippetNoteDetail extends React.Component {
>
<div styleName='info'>
<div styleName='info-left'>
<StarButton styleName='info-left-button'
onClick={(e) => this.handleStarButtonClick(e)}
isActive={note.isStarred}
/>
<div styleName='info-left-top'>
<FolderSelect styleName='info-left-top-folderSelect'
value={this.state.note.storage + '-' + this.state.note.folder}
@@ -546,36 +530,26 @@ class SnippetNoteDetail extends React.Component {
onChange={(e) => this.handleFolderChange(e)}
/>
</div>
<div styleName='info-left-bottom'>
<TagSelect
styleName='info-left-bottom-tagSelect'
ref='tags'
value={this.state.note.tags}
onChange={(e) => this.handleChange(e)}
/>
</div>
<TagSelect
ref='tags'
value={this.state.note.tags}
onChange={(e) => this.handleChange(e)}
/>
</div>
<div styleName='info-right'>
<StarButton styleName='info-right-button'
onClick={(e) => this.handleStarButtonClick(e)}
isActive={note.isStarred}
/>
<button styleName='info-right-button'
onClick={(e) => this.handleShareButtonClick(e)}
disabled
<button styleName='control-trashButton'
onClick={(e) => this.handleDeleteButtonClick(e)}
>
<i className='fa fa-share-alt fa-fw'/>
<span styleName='info-right-button-tooltip'
style={{right: 20}}
>Share Note</span>
</button>
<button styleName='info-right-button'
onClick={(e) => this.handleContextButtonClick(e)}
>
<i className='fa fa-ellipsis-v'/>
<span styleName='info-right-button-tooltip'
style={{right: 5}}
>More Options</span>
<svg height='14px' id='Capa_1' style={{enableBackground: 'new 0 0 753.23 753.23'}} width='14px' version='1.1' viewBox='0 0 753.23 753.23' x='0px' y='0px' xmlSpace='preserve'>
<g>
<g id='_x34__19_'>
<g>
<path d='M494.308,659.077c12.993,0,23.538-10.546,23.538-23.539V353.077c0-12.993-10.545-23.539-23.538-23.539&#xA;&#x9;&#x9;&#x9;&#x9;s-23.538,10.545-23.538,23.539v282.461C470.77,648.531,481.314,659.077,494.308,659.077z M635.538,94.154h-141.23V47.077&#xA;&#x9;&#x9;&#x9;&#x9;C494.308,21.067,473.24,0,447.23,0H306c-26.01,0-47.077,21.067-47.077,47.077v47.077h-141.23&#xA;&#x9;&#x9;&#x9;&#x9;c-26.01,0-47.077,21.067-47.077,47.077v47.077c0,25.986,21.067,47.077,47.077,47.077v423.692&#xA;&#x9;&#x9;&#x9;&#x9;c0,51.996,42.157,94.153,94.154,94.153h329.539c51.996,0,94.153-42.157,94.153-94.153V235.385&#xA;&#x9;&#x9;&#x9;&#x9;c26.01,0,47.077-21.091,47.077-47.077V141.23C682.615,115.221,661.548,94.154,635.538,94.154z M306,70.615&#xA;&#x9;&#x9;&#x9;&#x9;c0-12.993,10.545-23.539,23.538-23.539h94.154c12.993,0,23.538,10.545,23.538,23.539v23.539c-22.809,0-141.23,0-141.23,0V70.615z&#xA;&#x9;&#x9;&#x9;&#x9; M588.461,659.077c0,25.986-21.066,47.076-47.076,47.076H211.846c-26.01,0-47.077-21.09-47.077-47.076V235.385h423.692V659.077z&#xA;&#x9;&#x9;&#x9;&#x9; M612,188.308H141.23c-12.993,0-23.538-10.545-23.538-23.539s10.545-23.539,23.538-23.539H612&#xA;&#x9;&#x9;&#x9;&#x9;c12.993,0,23.538,10.545,23.538,23.539S624.993,188.308,612,188.308z M258.923,659.077c12.993,0,23.539-10.546,23.539-23.539&#xA;&#x9;&#x9;&#x9;&#x9;V353.077c0-12.993-10.545-23.539-23.539-23.539s-23.539,10.545-23.539,23.539v282.461&#xA;&#x9;&#x9;&#x9;&#x9;C235.384,648.531,245.93,659.077,258.923,659.077z M376.615,659.077c12.993,0,23.538-10.546,23.538-23.539V353.077&#xA;&#x9;&#x9;&#x9;&#x9;c0-12.993-10.545-23.539-23.538-23.539s-23.539,10.545-23.539,23.539v282.461C353.077,648.531,363.622,659.077,376.615,659.077z' />
</g>
</g>
</g>
</svg>
</button>
</div>
</div>
@@ -600,7 +574,7 @@ class SnippetNoteDetail extends React.Component {
<button styleName='plusButton'
onClick={(e) => this.handleTabPlusButtonClick(e)}
>
<i className='fa fa-plus'/>
<i className='fa fa-plus' />
</button>
</div>
{viewList}
@@ -614,24 +588,25 @@ class SnippetNoteDetail extends React.Component {
? 'Select Syntax...'
: this.state.note.snippets[this.state.snippetIndex].mode
}&nbsp;
<i className='fa fa-caret-down'/>
<i className='fa fa-caret-down' />
</button>
<button
onClick={(e) => this.handleIndentTypeButtonClick(e)}
>
Indent: {config.editor.indentType}&nbsp;
<i className='fa fa-caret-down'/>
<i className='fa fa-caret-down' />
</button>
<button
onClick={(e) => this.handleIndentSizeButtonClick(e)}
>
size: {config.editor.indentSize}&nbsp;
<i className='fa fa-caret-down'/>
<i className='fa fa-caret-down' />
</button>
</div>
<StatusBar
{..._.pick(this.props, ['config', 'location', 'dispatch'])}
date={note.updatedAt}
/>
</div>
)

View File

@@ -1,74 +1,28 @@
$info-height = 75px
@import('NoteDetailInfo')
@import('DetailVars')
.root
absolute top bottom right
border-width 0 0 1px
border-style solid
border-color $ui-borderColor
.info
absolute top left right
height $info-height
border-bottom $ui-border
background-color $ui-backgroundColor
.info-left
float left
padding 0 5px
.info-left-top
height 40px
line-height 40px
.info-left-top-folderSelect
display inline-block
height 34px
width 200px
vertical-align middle
.info-left-bottom
height 30px
.info-left-bottom-tagSelect
height 30px
line-height 30px
.info-right
float right
.info-right-button
width 34px
height 34px
border-radius 17px
navButtonColor()
border $ui-border
font-size 14px
margin 8px 2px
padding 0
&:active
border-color $ui-button--focus-borderColor
&:hover .info-right-button-tooltip
opacity 1
&:focus
border-color $ui-button--focus-borderColor
.info-right-button-tooltip
tooltip()
position fixed
top 45px
padding 5px
opacity 0
background-color $ui-noteDetail-backgroundColor
box-shadow $note-detail-box-shadow
.body
absolute left right
top $info-height
left $note-detail-left-margin
right $note-detail-right-margin
top $info-height + $info-margin-under-border
bottom $statusBar-height
background-color $ui-noteDetail-backgroundColor
.body .description
absolute top left right
height 80px
border-bottom $ui-border
.body .description textarea
outline none
display block
height 100%
width 100%
@@ -76,20 +30,19 @@ $info-height = 75px
border none
padding 10px
line-height 1.6
background-color $ui-noteDetail-backgroundColor
.tabList
absolute left right
top 80px
height 30px
border-bottom $ui-border
display flex
background-color $ui-backgroundColor
background-color $ui-noteDetail-backgroundColor
.tabList .list
flex 1
display flex
overflow hidden
border-right $ui-border
.tabList .plusButton
navButtonColor()
@@ -97,68 +50,42 @@ $info-height = 75px
.tabView
absolute left right bottom
top 110px
top 130px
.tabView-content
absolute top left right bottom
.override
absolute bottom left
left 60px
height 23px
z-index 1
button
navButtonColor()
height 24px
border-width 0 1px 0 0
border-style solid
border-color $ui-borderColor
&:active .update-icon
color white
.control-trashButton
float right
topBarButtonLight()
body[data-theme="dark"]
.root
border-color $ui-dark-borderColor
background-color $ui-dark-noteDetail-backgroundColor
box-shadow none
.info
border-bottom-color $ui-dark-borderColor
background-color $ui-dark-backgroundColor
.info-delete
color $ui-dark-text-color
.info-delete-confirmButton
colorDarkDangerButton()
color $ui-dark-text-color
.info-delete-cancelButton
colorDarkDefaultButton()
border-color $ui-dark-borderColor
color $ui-dark-text-color
.info-right-button
navDarkButtonColor()
border-color $ui-dark-borderColor
&:active
border-color $ui-dark-button--focus-borderColor
&:hover .info-right-button-tooltip
opacity 1
&:focus
border-color $ui-button--focus-borderColor
.info-right-button-tooltip
darkTooltip()
.body .description
border-bottom-color $ui-dark-borderColor
.body
background-color $ui-dark-noteDetail-backgroundColor
.body .description textarea
background-color $ui-dark-button--hover-backgroundColor
color white
background-color $ui-dark-noteDetail-backgroundColor
color $ui-dark-text-color
.tabList
background-color $ui-button--active-backgroundColor
border-bottom-color $ui-dark-borderColor
background-color $ui-dark-backgroundColor
background-color $ui-dark-noteDetail-backgroundColor
.tabList .list
border-color $ui-dark-borderColor
@@ -168,3 +95,10 @@ body[data-theme="dark"]
.override
button
border-color $ui-dark-borderColor
&:hover
background-color alpha($ui-dark-button--active-backgroundColor, 20%)
transition 0.15s
color $ui-dark-text-color
.control-trashButton
topBarButtonDark()

View File

@@ -53,7 +53,6 @@ class StarButton extends React.Component {
: 'fa fa-star-o'
}
/>
<span styleName='tooltip'>Star Note</span>
</button>
)
}

View File

@@ -1,27 +1,47 @@
.root
position relative
left 7px
top 0
padding 0
color alpha($ui-favorite-star-button-color, 60%)
&:hover
.icon
transform rotate(-72deg)
.tooltip
opacity 1
transition 0.15s
background-color alpha($ui-button--active-backgroundColor, 40%)
color $ui-favorite-star-button-color
&:active
transition 0.15s
background-color alpha($ui-button--active-backgroundColor, 40%)
color $ui-favorite-star-button-color
.root--active
@extend .root
color $brand-color
color $ui-favorite-star-button-color
&:hover
color $brand-color !important
.icon
transform rotate(-72deg)
transition 0.15s
color $ui-favorite-star-button-color
background-color alpha($ui-button--active-backgroundColor, 40%)
&:active
transition 0.15s
color $ui-favorite-star-button-color
background-color alpha($ui-button--active-backgroundColor, 40%)
.icon
transition transform 0.15s
.tooltip
tooltip()
position fixed
top 45px
right 65px
padding 5px
opacity 0
border-radius 2px
body[data-theme="dark"]
.root
&:hover
transition 0.15s
background-color alpha($ui-dark-button--active-backgroundColor, 20%)
color $ui-favorite-star-button-color
&:active
transition 0.15s
background-color alpha($ui-dark-button--active-backgroundColor, 20%)
color $ui-favorite-star-button-color
.root--active
@extend .root
color $ui-favorite-star-button-color
&:hover
transition 0.15s
color $ui-favorite-star-button-color
background-color alpha($ui-dark-button--active-backgroundColor, 20%)

View File

@@ -107,12 +107,12 @@ class TagSelect extends React.Component {
<span styleName='tag'
key={tag}
>
<span styleName='tag-label'>#{tag}</span>
<button styleName='tag-removeButton'
onClick={(e) => this.handleTagRemoveButtonClick(tag)(e)}
>
<i className='fa fa-times fa-fw'/>
<i className='fa fa-times fa-fw tag-removeButton-icon' />
</button>
<span styleName='tag-label'>{tag}</span>
</span>
)
})
@@ -125,10 +125,7 @@ class TagSelect extends React.Component {
}
styleName='root'
>
<i styleName='icon'
className='fa fa-tags'
/>
{tagList}
{tagList}
<input styleName='newTag'
ref='newTag'
value={this.state.newTag}
@@ -136,7 +133,6 @@ class TagSelect extends React.Component {
onChange={(e) => this.handleNewTagInputChange(e)}
onKeyDown={(e) => this.handleNewTagInputKeyDown(e)}
/>
</div>
)
}

View File

@@ -1,46 +1,47 @@
.root
position relative
user-select none
.icon
display inline-block
width 30px
top 19px
user-select none
vertical-align middle
text-align center
color $ui-button-color
width 300px
overflow-x scroll
white-space nowrap
.root::-webkit-scrollbar
display none
.tag
display inline-block
margin 0 2px
margin 1px 3px
padding 0
vertical-align middle
height 20px
background-color white
background-color alpha($ui-tag-backgroundColor, 10%)
border-radius 3px
overflow hidden
clearfix()
.tag-removeButton
float left
float right
height 20px
width 18px
margin 0
padding 0
border-style solid
border-color $ui-button--focus-borderColor
border-width 0 0 0 3px
border-width 0
border-radius 20px
line-height 18px
background-color transparent
color $ui-button-color
&:hover
background-color $ui-button--hover-backgroundColor
&:active, &:active:hover
color $ui-button--active-color
background-color $ui-button--active-backgroundColor
border-color $ui-button--focus-borderColor
&:focus
border-color $ui-button--focus-borderColor
.tag-removeButton-icon
width 5px
padding-right 4px
.tag-label
font-size 11px
font-weight 600
color: alpha($ui-text-color, 80%)
float left
height 20px
line-height 20px
@@ -53,21 +54,13 @@
height 24px
box-sizing borde-box
border none
border-bottom $ui-border
background-color transparent
outline none
padding 0 4px
&:focus
border-color $ui-input--focus-borderColor = #369DCD
&:disabled
background-color $ui-input--disabled-backgroundColor = #DDD
body[data-theme="dark"]
.icon
color $ui-dark-button-color
.tag
background-color $ui-dark-button--hover-backgroundColor
background-color alpha($ui-dark-tag-backgroundColor, 60%)
.tag-removeButton
border-color $ui-button--focus-borderColor
@@ -78,10 +71,6 @@ body[data-theme="dark"]
color $ui-dark-text-color
.newTag
border-color $ui-dark-borderColor
border-color none
background-color transparent
color $ui-dark-text-color
&:focus
border-color $ui-input--focus-borderColor = #369DCD
&:disabled
background-color $ui-input--disabled-backgroundColor = #DDD
color $ui-dark-text-color

View File

@@ -26,7 +26,7 @@ class Main extends React.Component {
this.state = {
isRightSliderFocused: false,
listWidth: config.listWidth,
navWidth: config.listWidth,
navWidth: config.navWidth,
isLeftSliderFocused: false
}
}
@@ -85,6 +85,7 @@ class Main extends React.Component {
}
handleMouseUp (e) {
// Change width of NoteList component.
if (this.state.isRightSliderFocused) {
this.setState({
isRightSliderFocused: false
@@ -99,6 +100,8 @@ class Main extends React.Component {
})
})
}
// Change width of SideNav component.
if (this.state.isLeftSliderFocused) {
this.setState({
isLeftSliderFocused: false
@@ -106,10 +109,10 @@ class Main extends React.Component {
let { dispatch } = this.props
let navWidth = this.state.navWidth
// TODO: ConfigManager should dispatch itself.
ConfigManager.set({listWidth: navWidth})
ConfigManager.set({ navWidth })
dispatch({
type: 'SET_NAV_WIDTH',
listWidth: navWidth
navWidth
})
})
}
@@ -162,11 +165,11 @@ class Main extends React.Component {
/>
{!config.isSideNavFolded &&
<div styleName={this.state.isLeftSliderFocused ? 'slider--active' : 'slider'}
style={{left: this.state.navWidth - 1}}
style={{left: this.state.navWidth}}
onMouseDown={(e) => this.handleLeftSlideMouseDown(e)}
draggable='false'
>
<div styleName='slider-hitbox'/>
<div styleName='slider-hitbox' />
</div>
}
<div styleName={config.isSideNavFolded ? 'body--expanded' : 'body'}
@@ -191,15 +194,15 @@ class Main extends React.Component {
'location'
])}
/>
<div styleName={this.state.isRightSliderFocused ? 'slider--active' : 'slider'}
style={{left: this.state.listWidth}}
<div styleName={this.state.isRightSliderFocused ? 'slider-right--active' : 'slider-right'}
style={{left: this.state.listWidth - 1}}
onMouseDown={(e) => this.handleRightSlideMouseDown(e)}
draggable='false'
>
<div styleName='slider-hitbox' />
</div>
<Detail
style={{left: this.state.listWidth + 1}}
style={{left: this.state.listWidth}}
{..._.pick(this.props, [
'dispatch',
'data',

View File

@@ -11,15 +11,18 @@
.slider
absolute top bottom
top -2px
width 0
.slider-right
@extend .slider
width 1px
background-color $ui-borderColor
border-width 0
border-style solid
border-color $ui-borderColor
.slider--active
@extend .slider
background-color $ui-button--active-backgroundColor
.slider-right--active
@extend .slider-right
.slider-hitbox
absolute top bottom left right
@@ -33,9 +36,6 @@ body[data-theme="dark"]
.root
absolute top left bottom right
.slider
background-color $ui-dark-borderColor
border-color $ui-dark-borderColor
.slider--active
background-color $ui-button--active-backgroundColor
.slider-right
.slider-right--active
box-shadow none

View File

@@ -1,168 +0,0 @@
import React, { PropTypes } from 'react'
import ReactDOM from 'react-dom'
import api from 'browser/lib/api'
import clientKey from 'browser/lib/clientKey'
import activityRecord from 'browser/lib/activityRecord'
const clipboard = require('electron').clipboard
function notify (...args) {
return new window.Notification(...args)
}
function getDefault () {
return {
openDropdown: false,
isSharing: false,
// Fetched url
url: null,
// for tooltip Copy -> Copied!
copied: false,
failed: false
}
}
export default class ShareButton extends React.Component {
constructor (props) {
super(props)
this.state = getDefault()
}
componentWillReceiveProps (nextProps) {
this.setState(getDefault())
}
componentDidMount () {
this.dropdownInterceptor = e => {
this.dropdownClicked = true
}
ReactDOM.findDOMNode(this.refs.dropdown).addEventListener('click', this.dropdownInterceptor)
this.shareViaPublicURLHandler = e => {
this.handleShareViaPublicURLClick(e)
}
}
componentWillUnmount () {
document.removeEventListener('click', this.dropdownHandler)
ReactDOM.findDOMNode(this.refs.dropdown).removeEventListener('click', this.dropdownInterceptor)
}
handleOpenButtonClick (e) {
this.openDropdown()
if (this.dropdownHandler == null) {
this.dropdownHandler = e => {
if (!this.dropdownClicked) {
this.closeDropdown()
} else {
this.dropdownClicked = false
}
}
}
document.removeEventListener('click', this.dropdownHandler)
document.addEventListener('click', this.dropdownHandler)
}
openDropdown () {
this.setState({openDropdown: true})
}
closeDropdown () {
document.removeEventListener('click', this.dropdownHandler)
this.setState({openDropdown: false})
}
handleClipboardButtonClick (e) {
activityRecord.emit('MAIN_DETAIL_COPY')
clipboard.writeText(this.props.article.content)
notify('Saved to Clipboard!', {
body: 'Paste it wherever you want!'
})
this.setState({openDropdown: false})
}
handleShareViaPublicURLClick (e) {
let { user } = this.props
let input = Object.assign({}, this.props.article, {
clientKey: clientKey.get(),
writerName: user.name
})
this.setState({
isSharing: true,
failed: false
}, () => {
api.shareViaPublicURL(input)
.then(res => {
let url = res.body.url
this.setState({url: url, isSharing: false})
activityRecord.emit('ARTICLE_SHARE')
})
.catch(err => {
console.log(err)
this.setState({isSharing: false, failed: true})
})
})
}
handleCopyURLClick () {
clipboard.writeText(this.state.url)
this.setState({copied: true})
}
// Restore copy url tooltip
handleCopyURLMouseLeave () {
this.setState({copied: false})
}
render () {
let hasPublicURL = this.state.url != null
return (
<div className='ShareButton'>
<button ref='openButton' onClick={e => this.handleOpenButtonClick(e)} className='ShareButton-open-button'>
<i className='fa fa-fw fa-share-alt'/>
{
this.state.openDropdown ? null : (
<span className='tooltip'>Share</span>
)
}
</button>
<div ref='dropdown' className={'ShareButton-dropdown' + (this.state.openDropdown ? '' : ' hide')}>
{
!hasPublicURL ? (
<button
onClick={e => this.shareViaPublicURLHandler(e)}
ref='sharePublicURL'
disabled={this.state.isSharing}>
<i className='fa fa-fw fa-external-link'/> {this.state.failed ? 'Failed : Click to Try again' : !this.state.isSharing ? 'Share via public URL' : 'Sharing...'}
</button>
) : (
<div className='ShareButton-url'>
<input className='ShareButton-url-input' value={this.state.url} readOnly/>
<button
onClick={e => this.handleCopyURLClick(e)}
className='ShareButton-url-button'
onMouseLeave={e => this.handleCopyURLMouseLeave(e)}
>
<i className='fa fa-fw fa-clipboard'/>
<div className='ShareButton-url-button-tooltip'>{this.state.copied ? 'Copied!' : 'Copy URL'}</div>
</button>
<div className='ShareButton-url-alert'>This url is valid for 7 days.</div>
</div>
)
}
<button onClick={e => this.handleClipboardButtonClick(e)}>
<i className='fa fa-fw fa-clipboard'/>&nbsp;Copy to clipboard
</button>
</div>
</div>
)
}
}
ShareButton.propTypes = {
article: PropTypes.shape({
publicURL: PropTypes.string,
content: PropTypes.string
}),
user: PropTypes.shape({
name: PropTypes.string
})
}

View File

@@ -1,225 +1,81 @@
$control-height = 30px
.root
absolute left bottom
border-top $ui-border
top $topBar-height - 1
background-color $ui-noteList-backgroundColor
.control
absolute top left right
user-select none
height 25px
font-size 10px
border-bottom $ui-border
height $control-height
font-size 12px
line-height 25px
display flex
background-color $ui-backgroundColor
background-color $ui-noteList-backgroundColor
color $ui-inactive-text-color
.control-sortBy
flex 1
padding-left 5px
padding-left 25px
.control-sortBy-select
margin-left 5px
appearance: none;
margin-left 3px
color $ui-inactive-text-color
padding 0
border none
background-color transparent
outline none
cursor pointer
font-size 10px
&:hover
transition 0.2s
color $ui-text-color
.control-button
width 25px
padding 0
background-color transparent
border none
color $ui-inactive-text-color
color alpha($ui-inactive-text-color, 60%)
transition 0.15s
&:active, &:active:hover
color $ui-active-color
color $ui-inactive-text-color
&:hover
color $ui-text-color
.control-button-tooltip
opacity 1
color $ui-inactive-text-color
.control-button--active
@extend .control-button
color $ui-active-color
color $ui-inactive-text-color
&:hover
color $ui-active-color
.control-button-tooltip
tooltip()
position absolute
top 20px
right 5px
padding 5px
opacity 0
white-space nowrap
border-radius 2px
z-index 1
color $ui-inactive-text-color
.list
absolute left right bottom
top 24px
top $control-height
overflow auto
.item
position relative
border-bottom $ui-border
padding 2px 5px
user-select none
cursor pointer
transition background-color 0.15s
&:hover
background-color alpha($ui-active-color, 20%)
&:active
background-color $ui-active-color
color white
.item-title
.item-title-empty
.item-title-icon
.item-bottom-tagIcon
.item-bottom-tagList-empty
.item-bottom-time
color white
.item-bottom-tagList-item
background-color transparent
color white
.item--active
@extend .item
background-color $ui-active-color
color white
.item-title
.item-title-empty
.item-title-icon
.item-bottom-tagIcon
.item-bottom-tagList-empty
.item-bottom-time
color white
.item-bottom-tagList-item
background-color transparent
color white
&:hover
background-color $ui-active-color
.item-border
absolute top bottom left right
border-style solid
border-width 2px
border-color transparent
transition 0.15s
.item-title
height 24px
box-sizing border-box
line-height 24px
padding 0
overflow ellipsis
color $ui-text-color
.item-title-icon
font-size 12px
color $ui-inactive-text-color
padding-right 3px
.item-title-empty
font-weight normal
color $ui-inactive-text-color
.item-bottom
margin-top 2px
height 20px
font-size 12px
line-height 20px
overflow ellipsis
display flex
.item-bottom-tagIcon
vertical-align middle
color $ui-button-color
height 20px
line-height 20px
.item-bottom-tagList
flex 1
overflow ellipsis
line-height 20px
.item-bottom-tagList-item
margin 0 4px
padding 0 4px
height 20px
box-sizing border-box
border-radius 3px
vertical-align middle
border-style solid
border-color $ui-button--focus-borderColor
border-width 0 0 0 3px
background-color $ui-backgroundColor
color $ui-text-color
.item-bottom-tagList-empty
color $ui-inactive-text-color
vertical-align middle
font-size 10px
margin-left 5px
.item-bottom-time
color $ui-inactive-text-color
margin-left 5px
font-size 10px
body[data-theme="dark"]
.root
border-color $ui-dark-borderColor
background-color $ui-dark-backgroundColor
.item
border-color $ui-dark-borderColor
&:hover
background-color alpha($ui-active-color, 20%)
.item--active
@extend .item
border-color $ui-dark-borderColor
.item-title
color white
.item-bottom-tagList-item
background-color transparent
color white
.item-bottom-tagList-empty
color white
&:hover
background-color $ui-active-color
.item-title
color $ui-dark-text-color
.item-title-icon
color $ui-darkinactive-text-color
.item-title-empty
color $ui-dark-inactive-text-color
.item-bottom-tagIcon
color $ui-dark-button-color
.item-bottom-tagList-item
border-color $ui-dark-button--focus-borderColor
background-color $ui-dark-button--hover-backgroundColor
color $ui-dark-text-color
.item-bottom-tagList-empty
color $ui-inactive-text-color
vertical-align middle
background-color $ui-dark-noteList-backgroundColor
.control
background-color $ui-dark-backgroundColor
background-color $ui-dark-noteList-backgroundColor
border-color $ui-dark-borderColor
.control-sortBy-select
color $ui-dark-text-color
&:hover
transition 0.2s
color $ui-dark-text-color
.control-button
color $ui-dark-inactive-text-color
&:hover
color $ui-dark-text-color
.control-button--active
color $ui-dark-text-color
&:active
color $ui-dark-text-color

View File

@@ -6,6 +6,8 @@ import _ from 'lodash'
import ee from 'browser/main/lib/eventEmitter'
import dataApi from 'browser/main/lib/dataApi'
import ConfigManager from 'browser/main/lib/ConfigManager'
import NoteItem from 'browser/components/NoteItem'
import NoteItemSimple from 'browser/components/NoteItemSimple'
const { remote } = require('electron')
const { Menu, MenuItem, dialog } = remote
@@ -36,6 +38,13 @@ class NoteList extends React.Component {
this.focusHandler = () => {
this.refs.list.focus()
}
this.alertIfSnippetHandler = () => {
this.alertIfSnippet()
}
this.jumpToTopHandler = () => {
this.jumpToTop()
}
this.state = {
}
@@ -46,6 +55,9 @@ class NoteList extends React.Component {
ee.on('list:next', this.selectNextNoteHandler)
ee.on('list:prior', this.selectPriorNoteHandler)
ee.on('list:focus', this.focusHandler)
ee.on('list:isMarkdownNote', this.alertIfSnippetHandler)
ee.on('list:top', this.jumpToTopHandler)
ee.on('list:jumpToTop', this.jumpToTopHandler)
}
componentWillReceiveProps (nextProps) {
@@ -64,6 +76,9 @@ class NoteList extends React.Component {
ee.off('list:next', this.selectNextNoteHandler)
ee.off('list:prior', this.selectPriorNoteHandler)
ee.off('list:focus', this.focusHandler)
ee.off('list:isMarkdownNote', this.alertIfSnippetHandler)
ee.off('list:top', this.jumpToTopHandler)
ee.off('list:jumpToTop', this.jumpToTopHandler)
}
componentDidUpdate (prevProps) {
@@ -303,6 +318,37 @@ class NoteList extends React.Component {
})
}
alertIfSnippet () {
let { location } = this.props
const targetIndex = _.findIndex(this.notes, (note) => {
return `${note.storage}-${note.key}` === location.query.key
})
if (this.notes[targetIndex].type === 'SNIPPET_NOTE') {
dialog.showMessageBox(remote.getCurrentWindow(), {
type: 'warning',
message: 'Sorry!',
detail: 'md/text import is available only a markdown note.'
})
}
}
jumpToTop () {
if (this.notes === null || this.notes.length === 0) {
return
}
let { router } = this.context
let { location } = this.props
const targetIndex = 0
router.push({
pathname: location.pathname,
query: {
key: this.notes[targetIndex].storage + '-' + this.notes[targetIndex].key
}
})
}
render () {
let { location, notes, config } = this.props
let sortFunc = config.sortBy === 'CREATED_AT'
@@ -314,57 +360,40 @@ class NoteList extends React.Component {
.sort(sortFunc)
let noteList = notes
.map((note) => {
if (note == null) return null
let tagElements = _.isArray(note.tags)
? note.tags.map((tag) => {
return (
<span styleName='item-bottom-tagList-item'
key={tag}>
{tag}
</span>
)
})
: []
let isActive = location.query.key === note.storage + '-' + note.key
.map(note => {
if (note == null) {
return null
}
const isDefault = config.listStyle === 'DEFAULT'
const isActive = location.query.key === note.storage + '-' + note.key
const dateDisplay = moment(
config.sortBy === 'CREATED_AT'
? note.createdAt : note.updatedAt
).fromNow()
const key = `${note.storage}-${note.key}`
if (isDefault) {
return (
<NoteItem
isActive={isActive}
note={note}
dateDisplay={dateDisplay}
key={key}
handleNoteClick={this.handleNoteClick.bind(this)}
handleNoteContextMenu={this.handleNoteContextMenu.bind(this)}
/>
)
}
return (
<div styleName={isActive
? 'item--active'
: 'item'
}
key={note.storage + '-' + note.key}
onClick={(e) => this.handleNoteClick(e, note.storage + '-' + note.key)}
onContextMenu={(e) => this.handleNoteContextMenu(e, note.storage + '-' + note.key)}
>
<div styleName='item-title'>
{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-file-text-o'/>
}
{note.title.trim().length > 0
? note.title
: <span styleName='item-title-empty'>Empty</span>
}
</div>
{config.listStyle === 'DEFAULT' &&
<div styleName='item-bottom'>
<i styleName='item-bottom-tagIcon'
className='fa fa-tags fa-fw'
/>
<div styleName='item-bottom-tagList'>
{tagElements.length > 0
? tagElements
: <span styleName='item-bottom-tagList-empty'>Not tagged yet</span>
}
</div>
<div styleName='item-bottom-time'>
{moment(config.sortBy === 'CREATED_AT' ? note.createdAt : note.updatedAt).fromNow()}
</div>
</div>
}
</div>
<NoteItemSimple
isActive={isActive}
note={note}
key={key}
handleNoteClick={this.handleNoteClick.bind(this)}
handleNoteContextMenu={this.handleNoteContextMenu.bind(this)}
/>
)
})
@@ -375,7 +404,7 @@ class NoteList extends React.Component {
>
<div styleName='control'>
<div styleName='control-sortBy'>
Sort by
<i className='fa fa-bolt' />
<select styleName='control-sortBy-select'
value={config.sortBy}
onChange={(e) => this.handleSortByChange(e)}
@@ -391,10 +420,7 @@ class NoteList extends React.Component {
}
onClick={(e) => this.handleListStyleButtonClick(e, 'DEFAULT')}
>
<i className='fa fa-th-list'/>
<span styleName='control-button-tooltip'>
Default Size
</span>
<i className='fa fa-th-large' />
</button>
<button styleName={config.listStyle === 'SMALL'
? 'control-button--active'
@@ -402,10 +428,7 @@ class NoteList extends React.Component {
}
onClick={(e) => this.handleListStyleButtonClick(e, 'SMALL')}
>
<i className='fa fa-list'/>
<span styleName='control-button-tooltip'>
Small Size
</span>
<i className='fa fa-list-ul' />
</button>
</div>
<div styleName='list'

View File

@@ -1,53 +1,34 @@
.root
absolute top left bottom
width $sideNav-width
border-right $ui-border
background-color $ui-backgroundColor
user-select none
color $ui-text-color
.top
height $topBar-height
border-bottom $ui-border
.top-menu
navButtonColor()
height $topBar-height - 1
padding 0 10px
font-size 14px
height $topBar-height
padding 0 15px
font-size 12px
width 100%
text-align left
&:hover
color $ui-text-color
&:active, &:active:hover
color $ui-text-color
background-color alpha($ui-button--active-backgroundColor, 20%)
.top-menu-label
margin-left 5px
overflow ellipsis
.menu
margin 0
.menu-button
navButtonColor()
height 32px
padding 0 10px
font-size 14px
width 100%
text-align left
overflow ellipsis
.menu-button--active
@extend .menu-button
background-color $ui-button--active-backgroundColor
color $ui-button--active-color
&:hover
background-color $ui-button--active-backgroundColor
.menu-button-label
margin-left 5px
.storageList
absolute left right
bottom 32px
top 120px
bottom 37px
top 160px
overflow-y auto
.storageList-empty
@@ -134,20 +115,16 @@ body[data-theme="dark"]
.top-menu
navDarkButtonColor()
.menu-button
navDarkButtonColor()
.menu-button--active
@extend .menu-button
background-color $ui-dark-button--active-backgroundColor
color $ui-dark-button--active-color
&:active
background-color alpha($ui-dark-button--active-backgroundColor, 20%)
&:hover
background-color $ui-dark-button--active-backgroundColor
background-color alpha($ui-dark-button--active-backgroundColor, 20%)
.storageList-empty
color $ui-dark-inactive-text-color
.navToggle
navDarkButtonColor()
&:hover
background-color alpha($ui-dark-button--active-backgroundColor, 20%)
transition 0.15s
color $ui-dark-text-color

View File

@@ -6,6 +6,7 @@ import modal from 'browser/main/lib/modal'
import CreateFolderModal from 'browser/main/modals/CreateFolderModal'
import RenameFolderModal from 'browser/main/modals/RenameFolderModal'
import dataApi from 'browser/main/lib/dataApi'
import StorageItemChild from 'browser/components/StorageItem'
const { remote } = require('electron')
const { Menu, MenuItem, dialog } = remote
@@ -134,34 +135,24 @@ class StorageItem extends React.Component {
let { storage, location, isFolded, data } = this.props
let { folderNoteMap } = data
let folderList = storage.folders.map((folder) => {
let isActive = location.pathname.match(new RegExp('\/storages\/' + storage.key + '\/folders\/' + folder.key))
let isActive = !!(location.pathname.match(new RegExp('\/storages\/' + storage.key + '\/folders\/' + folder.key)))
let noteSet = folderNoteMap.get(storage.key + '-' + folder.key)
let noteCount = noteSet != null
? noteSet.size
: 0
return <button styleName={isActive
? 'folderList-item--active'
: 'folderList-item'
}
key={folder.key}
onClick={(e) => this.handleFolderButtonClick(folder.key)(e)}
onContextMenu={(e) => this.handleFolderButtonContextMenu(e, folder)}
>
<span styleName='folderList-item-name'
style={{borderColor: folder.color}}
>
{isFolded ? folder.name.substring(0, 1) : folder.name}
</span>
{!isFolded &&
<span styleName='folderList-item-noteCount'>{noteCount}</span>
}
{isFolded &&
<span styleName='folderList-item-tooltip'>
{folder.name}
</span>
}
</button>
return (
<StorageItemChild
key={folder.key}
isActive={isActive}
handleButtonClick={(e) => this.handleFolderButtonClick(folder.key)(e)}
handleContextMenu={(e) => this.handleFolderButtonContextMenu(e, folder)}
folderName={folder.name}
folderColor={folder.color}
isFolded={isFolded}
noteCount={noteCount}
/>
)
})
let isActive = location.pathname.match(new RegExp('\/storages\/' + storage.key + '$'))
@@ -190,7 +181,7 @@ class StorageItem extends React.Component {
<button styleName='header-addFolderButton'
onClick={(e) => this.handleAddFolderButtonClick(e)}
>
<i className='fa fa-plus'/>
<i className='fa fa-plus' />
</button>
}

View File

@@ -1,139 +1,71 @@
.root
width 100%
user-select none
.header
position relative
height 26px
width 100%
margin-bottom 5px
transition 0.15s
&:hover
background-color $ui-button--hover-backgroundColor
&:active
.header-toggleButton
.header-addFolderButton
color white
&:active
color $ui-active-color
.header--active
@extend .header
.header-info
color $ui-button--active-color
background-color $ui-button--active-backgroundColor
background-color $ui-button--active-backgroundColor
transition color background-color 0.15s
.header--active
.header-toggleButton
color $ui-text-color
.header--active
.header-info
color $ui-text-color
.header--active
.header-addFolderButton
color white
&:active
&:hover
&:hover:active
color white
color $ui-text-color
.header-toggleButton
navButtonColor()
position absolute
left 0
width 25px
height 26px
padding 0
border none
color $ui-inactive-text-color
background-color transparent
&:hover
background-color transparent
color $ui-text-color
&:active
color $ui-active-color
.header-info
navButtonColor()
display block
width 100%
height 26px
height 30px
padding-left 25px
padding-right 10px
line-height 26px
cursor pointer
font-size 14px
font-size 13px
border none
overflow ellipsis
text-align left
background-color transparent
color $ui-inactive-text-color
&:active
color $ui-button--active-color
background-color $ui-button--active-backgroundColor
.header-info-path
font-size 10px
margin 0 5px
.header-addFolderButton
navButtonColor()
position absolute
right 0
width 25px
height 26px
padding 0
border none
color $ui-inactive-text-color
background-color transparent
&:hover
background-color transparent
color $ui-text-color
&:active
color $ui-active-color
.folderList-item
display flex
width 100%
height 26px
background-color transparent
color $ui-inactive-text-color
padding 0
margin-bottom 2px
text-align left
border none
overflow ellipsis
font-size 14px
&:first-child
margin-top 0
&:hover
background-color $ui-button--hover-backgroundColor
&:active
color $ui-button--active-color
background-color $ui-button--active-backgroundColor
.folderList-item--active
@extend .folderList-item
color $ui-button--active-color
background-color $ui-button--active-backgroundColor
&:hover
color $ui-button--active-color
background-color $ui-button--active-backgroundColor
.folderList-item-name
display block
flex 1
padding 0 10px
height 26px
line-height 26px
border-width 0 0 0 6px
border-style solid
border-color transparent
.folderList-item-noteCount
float right
line-height 26px
padding-right 5px
font-size 12px
.folderList-item-tooltip
tooltip()
position fixed
padding 0 10px
left 44px
z-index 10
pointer-events none
opacity 0
border-top-right-radius 2px
border-bottom-right-radius 2px
height 26px
line-height 26px
.root--folded
@extend .root
@@ -161,22 +93,40 @@
.header-info--folded-tooltip-path
font-size 10px
margin 0 5px
.folderList-item:hover, .folderList-item--active:hover
.folderList-item-tooltip
opacity 1
.folderList-item-name
padding-left 14px
body[data-theme="dark"]
.header-toggleButton
.header-addFolderButton
color $ui-dark-inactive-text-color
&:hover
color $ui-dark-text-color
&:active
color $ui-dark-active-color
.header--active
background-color $ui-dark-button--active-backgroundColor
transition color background-color 0.15s
.header--active
.header-toggleButton
.header-addFolderButton
color white
color $ui-dark-text-color
.header--active
.header-info
color $ui-dark-text-color
background-color $ui-dark-button--active-backgroundColor
&:active
color white
color $ui-dark-text-color
background-color $ui-dark-button--active-backgroundColor
.header--active
.header-addFolderButton
color $ui-dark-text-color
.header-toggleButton
&:hover
color $ui-dark-text-color
.header-info
&:hover
color $ui-dark-text-color
background-color alpha($ui-dark-button--active-backgroundColor, 20%)
&:active, &:active:hover
color $ui-dark-text-color
background-color $ui-dark-button--active-backgroundColor
.header-addFolderButton
&:hover
color $ui-dark-text-color

View File

@@ -5,9 +5,7 @@ import { openModal } from 'browser/main/lib/modal'
import PreferencesModal from '../modals/PreferencesModal'
import ConfigManager from 'browser/main/lib/ConfigManager'
import StorageItem from './StorageItem'
const electron = require('electron')
const { remote } = electron
import SideNavFilter from 'browser/components/SideNavFilter'
class SideNav extends React.Component {
// TODO: should not use electron stuff v0.7
@@ -39,8 +37,8 @@ class SideNav extends React.Component {
let { data, location, config, dispatch } = this.props
let isFolded = config.isSideNavFolded
let isHomeActive = location.pathname.match(/^\/home$/)
let isStarredActive = location.pathname.match(/^\/starred$/)
let isHomeActive = !!location.pathname.match(/^\/home$/)
let isStarredActive = !!location.pathname.match(/^\/starred$/)
let storageList = data.storageMap.map((storage, key) => {
return <StorageItem
@@ -64,25 +62,18 @@ class SideNav extends React.Component {
<button styleName='top-menu'
onClick={(e) => this.handleMenuButtonClick(e)}
>
<i className='fa fa-navicon fa-fw'/>
<i className='fa fa-navicon fa-fw' />
<span styleName='top-menu-label'>Menu</span>
</button>
</div>
<div styleName='menu'>
<button styleName={isHomeActive ? 'menu-button--active' : 'menu-button'}
onClick={(e) => this.handleHomeButtonClick(e)}
>
<i className='fa fa-files-o fa-fw'/>
<span styleName='menu-button-label'>All Notes</span>
</button>
<button styleName={isStarredActive ? 'menu-button--active' : 'menu-button'}
onClick={(e) => this.handleStarredButtonClick(e)}
>
<i className='fa fa-star fa-fw'/>
<span styleName='menu-button-label'>Starred</span>
</button>
</div>
<SideNavFilter
isFolded={isFolded}
isHomeActive={isHomeActive}
handleAllNotesButtonClick={(e) => this.handleHomeButtonClick(e)}
isStarredActive={isStarredActive}
handleStarredButtonClick={(e) => this.handleStarredButtonClick(e)}
/>
<div styleName='storageList'>
{storageList.length > 0 ? storageList : (
@@ -93,8 +84,8 @@ class SideNav extends React.Component {
onClick={(e) => this.handleToggleButtonClick(e)}
>
{isFolded
? <i className='fa fa-angle-double-right'/>
: <i className='fa fa-angle-double-left'/>
? <i className='fa fa-angle-double-right' />
: <i className='fa fa-angle-double-left' />
}
</button>
</div>

View File

@@ -1,8 +1,9 @@
@import('../Detail/DetailVars')
.root
absolute bottom left right
height $statusBar-height
background-color $ui-backgroundColor
border-top $ui-border
background-color $ui-noteDetail-backgroundColor
display flex
.blank
@@ -21,9 +22,6 @@
.zoom
navButtonColor()
height 24px
border-width 0 1px
border-style solid
border-color $ui-borderColor
.update
navButtonColor()
@@ -39,11 +37,16 @@
body[data-theme="dark"]
.root
background-color $ui-dark-backgroundColor
background-color $ui-dark-noteDetail-backgroundColor
border-color $ui-dark-borderColor
box-shadow none
.zoom
border-color $ui-dark-borderColor
&:hover
background-color alpha($ui-dark-button--active-backgroundColor, 20%)
transition 0.15s
color $ui-dark-text-color
.help
navButtonColor()

View File

@@ -2,12 +2,13 @@ import React, { PropTypes } from 'react'
import CSSModules from 'browser/lib/CSSModules'
import styles from './StatusBar.styl'
import ZoomManager from 'browser/main/lib/ZoomManager'
import LastUpdatedString from '../Detail/LastUpdatedString'
const electron = require('electron')
const { remote, ipcRenderer } = electron
const { Menu, MenuItem, dialog } = remote
const zoomOptions = [0.8, 0.9, 1, 1.1, 1.2, 1.3]
const zoomOptions = [0.8, 0.9, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0]
class StatusBar extends React.Component {
updateApp () {
@@ -52,22 +53,23 @@ class StatusBar extends React.Component {
<div className='StatusBar'
styleName='root'
>
<div styleName='blank' />
{status.updateReady
? <button onClick={this.updateApp} styleName='update'>
<i styleName='update-icon' className='fa fa-cloud-download' /> Ready to Update!
</button>
: null
}
{/*<button styleName='help'>
<i className='fa fa-info-circle' />
</button>*/}
<button styleName='zoom'
onClick={(e) => this.handleZoomButtonClick(e)}
>
<i className='fa fa-search-plus' />&nbsp;
{Math.floor(config.zoom * 100)}%
</button>
<div styleName='blank' />
{status.updateReady
? <button onClick={this.updateApp} styleName='update'>
<i styleName='update-icon' className='fa fa-cloud-download' /> Ready to Update!
</button>
: null
}
<LastUpdatedString date={this.props.date} />
</div>
)
}
@@ -77,7 +79,8 @@ StatusBar.contextTypes = {
status: PropTypes.shape({
updateReady: PropTypes.bool.isRequired
}).isRequired,
config: PropTypes.shape({}).isRequired
config: PropTypes.shape({}).isRequired,
date: PropTypes.string
}
StatusBar.propTypes = {

View File

@@ -1,19 +1,19 @@
.root
position relative
background-color $ui-backgroundColor
background-color $ui-noteList-backgroundColor
height $topBar-height - 1
.root--expanded
@extend .root
$control-height = 34px
.control
position absolute
top 8px
top 13px
left 8px
right 8px
height $control-height
border $ui-border
border-radius 20px
overflow hidden
display flex
@@ -28,6 +28,7 @@ $control-height = 34px
line-height 32px
width 35px
color $ui-inactive-text-color
background-color $ui-noteList-backgroundColor
.control-search-input
display block
@@ -38,16 +39,18 @@ $control-height = 34px
height 100%
outline none
border none
background-color $ui-noteList-backgroundColor
.control-search-optionList
position fixed
z-index 200
width 275px
height 175px
width 500px
height 250px
overflow-y auto
background-color $modal-background
border-radius 2px
box-shadow 2px 2px 10px gray
border-none
box-shadow 0 0 1px rgba(76,86,103,.25), 0 2px 18px rgba(31,37,50,.32)
.control-search-optionList-item
height 50px
@@ -57,49 +60,40 @@ $control-height = 34px
cursor pointer
overflow ellipsis
&:hover
background-color alpha($ui-active-color, 10%)
background-color alpha(#D4D4D4, 30%)
.control-search-optionList-item-folder
border-left 4px solid transparent
border-left 2px solid transparent
padding 2px 5px
color $ui-text-color
overflow ellipsis
font-size 12px
height 16px
margin-bottom 4px
.control-search-optionList-item-folder-surfix
font-size 10px
margin-left 5px
color $ui-inactive-text-color
.control-search-optionList-item-type
font-size 12px
color $ui-inactive-text-color
padding-right 3px
.control-search-optionList-empty
height 150px
color $ui-inactive-text-color
line-height 150px
text-align center
.control-contextButton
display block
width 20px
height $control-height - 2
navButtonColor()
border-left $ui-border
font-size 14px
line-height 28px
padding 0
&:active
border-color $ui-button--active-backgroundColor
&:hover .control-newPostButton-tooltip
opacity 1
.control-newPostButton
display block
width 36px
width 32px
height $control-height - 2
navButtonColor()
border-left $ui-border
border $ui-border
border-radius 32px
font-size 14px
line-height 28px
padding 0
@@ -112,17 +106,18 @@ $control-height = 34px
tooltip()
position fixed
pointer-events none
top 45px
left 385px
z-index 10
top 50px
left 433px
z-index 200
padding 5px
line-height normal
border-radius 2px
opacity 0
transition 0.1s
body[data-theme="dark"]
.root, .root--expanded
background-color $ui-dark-backgroundColor
background-color $ui-dark-noteList-backgroundColor
.control
border-color $ui-dark-borderColor
@@ -134,11 +129,13 @@ body[data-theme="dark"]
line-height 32px
width 35px
color $ui-dark-inactive-text-color
background-color $ui-dark-noteList-backgroundColor
.control-search-input
input
background-color $dark-background-color
background-color $ui-dark-noteList-backgroundColor
color $ui-dark-text-color
.control-search-optionList
color white
background-color $ui-dark-button--hover-backgroundColor
@@ -148,7 +145,7 @@ body[data-theme="dark"]
.control-search-optionList-item
border-color $ui-dark-borderColor
&:hover
background-color lighten($ui-dark-button--hover-backgroundColor, 15%)
background-color alpha($ui-dark-button--active-backgroundColor, 20%)
.control-search-optionList-item-folder
color $ui-dark-text-color
.control-search-optionList-item-folder-surfix
@@ -162,11 +159,15 @@ body[data-theme="dark"]
.control-search-optionList-empty
color $ui-inactive-text-color
.control-contextButton,
.control-newPostButton
colorDarkDefaultButton()
color $ui-inactive-text-color
border-color $ui-dark-borderColor
background-color $ui-dark-noteList-backgroundColor
&:hover
transition 0.15s
color $ui-dark-text-color
&:active
background-color alpha($ui-dark-button--active-backgroundColor, 20%)
border-color $ui-dark-button--active-backgroundColor
.control-newPostButton-tooltip

View File

@@ -10,8 +10,6 @@ import ConfigManager from 'browser/main/lib/ConfigManager'
import dataApi from 'browser/main/lib/dataApi'
const OSX = window.process.platform === 'darwin'
const { remote } = require('electron')
const { Menu, MenuItem } = remote
class TopBar extends React.Component {
constructor (props) {
@@ -26,14 +24,20 @@ class TopBar extends React.Component {
this.newNoteHandler = () => {
this.handleNewPostButtonClick()
}
this.focusSearchHandler = () => {
this.handleOnSearchFocus()
}
}
componentDidMount () {
ee.on('top:new-note', this.newNoteHandler)
ee.on('top:focus-search', this.focusSearchHandler)
}
componentWillUnmount () {
ee.off('top:new-note', this.newNoteHandler)
ee.off('top:focus-search', this.focusSearchHandler)
}
handleNewPostButtonClick (e) {
@@ -71,10 +75,10 @@ class TopBar extends React.Component {
break
}
}
if (storage == null) throw new Error('No storage to create a note')
if (storage == null) window.alert('No storage to create a note')
let folder = _.find(storage.folders, {key: params.folderKey})
if (folder == null) folder = storage.folders[0]
if (folder == null) throw new Error('No folder to craete a note')
if (folder == null) window.alert('No folder to create a note')
return {
storage,
@@ -192,47 +196,6 @@ class TopBar extends React.Component {
}
}
handleContextButtonClick (e) {
let { config } = this.props
let menu = new Menu()
menu.append(new MenuItem({
label: 'Create Markdown Note',
click: (e) => this.createNote('MARKDOWN_NOTE')
}))
menu.append(new MenuItem({
label: 'Create Snippet Note',
click: (e) => this.createNote('SNIPPET_NOTE')
}))
menu.append(new MenuItem({
type: 'separator'
}))
menu.append(new MenuItem({
label: 'Change Default Note',
submenu: [
{
type: 'radio',
label: 'Markdown Note',
checked: config.ui.defaultNote === 'MARKDOWN_NOTE',
click: (e) => this.setDefaultNote('MARKDOWN_NOTE')
},
{
type: 'radio',
label: 'Snippet Note',
checked: config.ui.defaultNote === 'SNIPPET_NOTE',
click: (e) => this.setDefaultNote('SNIPPET_NOTE')
},
{
type: 'radio',
label: 'Always Ask',
checked: config.ui.defaultNote === 'ALWAYS_ASK',
click: (e) => this.setDefaultNote('ALWAYS_ASK')
}
]
}))
menu.popup(remote.getCurrentWindow())
}
createNote (noteType) {
let { dispatch, location } = this.props
if (noteType !== 'MARKDOWN_NOTE' && noteType !== 'SNIPPET_NOTE') throw new Error('Invalid note type.')
@@ -287,6 +250,14 @@ class TopBar extends React.Component {
})
}
handleOnSearchFocus () {
if (this.state.searchPopupOpen) {
this.refs.search.childNodes[0].blur()
} else {
this.refs.search.childNodes[0].focus()
}
}
render () {
let { config, style, data } = this.props
let searchOptionList = this.getOptions()
@@ -303,8 +274,8 @@ class TopBar extends React.Component {
<span styleName='control-search-optionList-item-folder-surfix'>in {storage.name}</span>
</div>
{note.type === 'SNIPPET_NOTE'
? <i styleName='control-search-optionList-item-type' className='fa fa-code'/>
: <i styleName='control-search-optionList-item-type' className='fa fa-file-text-o'/>
? <i styleName='control-search-optionList-item-type' className='fa fa-code' />
: <i styleName='control-search-optionList-item-type' className='fa fa-file-text-o' />
}&nbsp;
{note.title}
</div>
@@ -317,7 +288,7 @@ class TopBar extends React.Component {
>
<div styleName='control'>
<div styleName='control-search'>
<i styleName='control-search-icon' className='fa fa-search fa-fw'/>
<i styleName='control-search-icon' className='fa fa-search fa-fw' />
<div styleName='control-search-input'
onFocus={(e) => this.handleSearchFocus(e)}
onBlur={(e) => this.handleSearchBlur(e)}
@@ -344,23 +315,18 @@ class TopBar extends React.Component {
<button styleName='left-search-clearButton'
onClick={(e) => this.handleSearchClearButton(e)}
>
<i className='fa fa-times'/>
<i className='fa fa-times' />
</button>
}
</div>
<button styleName='control-newPostButton'
onClick={(e) => this.handleNewPostButtonClick(e)}>
<i className='fa fa-plus'/>
<i className='fa fa-plus' />
<span styleName='control-newPostButton-tooltip'>
New Note {OSX ? '⌘' : '^'} + n
Make a Note {OSX ? '⌘' : '^'} + n
</span>
</button>
<button styleName='control-contextButton'
onClick={(e) => this.handleContextButtonClick(e)}
>
<i className='fa fa-caret-down'/>
</button>
</div>
</div>
)

View File

@@ -1,6 +1,6 @@
global-reset()
DEFAULT_FONTS = 'Lato', helvetica, arial, sans-serif
DEFAULT_FONTS = 'OpenSans', helvetica, arial, sans-serif
html, body
width 100%
@@ -11,7 +11,7 @@ body
font-family DEFAULT_FONTS
color textColor
font-size fontSize
font-weight 400
font-weight 200
button, input, select, textarea
font-family DEFAULT_FONTS
@@ -92,6 +92,8 @@ body[data-theme="dark"]
font-family inherit !important
line-height 1.4em
height 100%
.CodeMirror > div > textarea
margin-bottom -1em
.CodeMirror-focused .CodeMirror-selected
background #B1D7FE
.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection

View File

@@ -10,7 +10,7 @@ let isInitialized = false
export const DEFAULT_CONFIG = {
zoom: 1,
isSideNavFolded: false,
listWidth: 250,
listWidth: 280,
navWidth: 200,
sortBy: 'UPDATED_AT', // 'CREATED_AT', 'UPDATED_AT', 'APLHABETICAL'
listStyle: 'DEFAULT', // 'DEFAULT', 'SMALL'
@@ -25,6 +25,7 @@ export const DEFAULT_CONFIG = {
},
editor: {
theme: 'default',
keyMap: 'sublime',
fontSize: '14',
fontFamily: 'Monaco, Consolas',
indentType: 'space',
@@ -34,7 +35,7 @@ export const DEFAULT_CONFIG = {
preview: {
fontSize: '14',
fontFamily: 'Lato',
codeBlockTheme: 'xcode',
codeBlockTheme: 'elegant',
lineNumber: true
}
}

View File

@@ -20,10 +20,10 @@ class ModalBase extends React.Component {
render () {
return (
<div className={'ModalBase' + (this.state.isHidden ? ' hide' : '')}>
<div onClick={(e) => this.close(e)} className='modalBack'/>
<div onClick={(e) => this.close(e)} className='modalBack' />
{this.state.component == null ? null : (
<Provider store={store}>
<this.state.component {...this.state.componentProps} close={this.close}/>
<this.state.component {...this.state.componentProps} close={this.close} />
</Provider>
)}
</div>
@@ -33,7 +33,7 @@ class ModalBase extends React.Component {
let el = document.createElement('div')
document.body.appendChild(el)
let modalBase = ReactDOM.render(<ModalBase/>, el)
let modalBase = ReactDOM.render(<ModalBase />, el)
export function openModal (component, props) {
if (modalBase == null) { return }

View File

@@ -75,24 +75,27 @@ class CreateFolderModal extends React.Component {
onKeyDown={(e) => this.handleKeyDown(e)}
>
<div styleName='header'>
<div styleName='title'>New Folder</div>
<div styleName='title'>Create new folder</div>
</div>
<button styleName='closeButton'
onClick={(e) => this.handleCloseButtonClick(e)}
>Close</button>
<button styleName='close' onClick={(e) => this.handleCloseButtonClick(e)}>
<div styleName='close-mark'>×</div>
<div styleName='close-text'>esc</div>
</button>
<div styleName='control'>
<input styleName='control-input'
placeholder='Folder Name'
ref='name'
value={this.state.name}
onChange={(e) => this.handleChange(e)}
onKeyDown={(e) => this.handleInputKeyDown(e)}
/>
<div styleName='control-folder'>
<div styleName='control-folder-label'>Folder name</div>
<input styleName='control-folder-input'
ref='name'
value={this.state.name}
onChange={(e) => this.handleChange(e)}
onKeyDown={(e) => this.handleInputKeyDown(e)}
/>
</div>
<button styleName='control-confirmButton'
onClick={(e) => this.handleConfirmButtonClick(e)}
>
Confirm
Create
</button>
</div>
</div>

View File

@@ -1,47 +1,52 @@
.root
modal()
max-width 340px
width 500px
height 270px
overflow hidden
position relative
padding 0 40px
.header
height 50px
height 70px
margin-bottom 10px
margin-top 20px
font-size 18px
line-height 50px
padding 0 15px
background-color $ui-backgroundColor
border-bottom solid 1px $ui-borderColor
color $ui-text-color
.closeButton
.close-mark
font-size 15px
.close
height 70px
position absolute
top 10px
right 10px
height 30px
width 0 25px
border $ui-border
border-radius 2px
color $ui-text-color
colorDefaultButton()
.control
padding 25px 15px 15px
background-color transparent
color $ui-inactive-text-color
border none
top 7px
right 30px
text-align center
width top-bar--height
height top-bar--height
.control-input
.control-folder-label
text-align left
font-size 12px
color $ui-text-color
.control-folder-input
display block
height 30px
width 240px
width 420px
padding 0 5px
margin 0 auto 15px
border none
border-bottom solid 1px $border-color
margin 10px auto 15px
border 1px solid #C9C9C9 // TODO: use variable.
border-radius 2px
background-color transparent
outline none
vertical-align middle
font-size 18px
text-align center
font-size 14px
&:disabled
background-color $ui-input--disabled-backgroundColor
&:focus, &:active
@@ -49,22 +54,37 @@
.control-confirmButton
display block
float right
height 30px
width 100px
border none
border-radius 2px
padding 0 25px
margin 0 auto
margin 20px auto
font-size 12px
colorPrimaryButton()
body[data-theme="dark"]
.root
modalDark()
width 500px
height 270px
overflow hidden
position relative
padding 0 40px
.header
background-color $ui-dark-button--hover-backgroundColor
background-color transparent
border-color $ui-dark-borderColor
color $ui-dark-text-color
.control-folder-label
color $ui-dark-text-color
.control-folder-input
border 1px solid #C9C9C9 // TODO: use variable.
color white
.closeButton
border-color $ui-dark-borderColor
color $ui-dark-text-color
@@ -73,7 +93,5 @@ body[data-theme="dark"]
.description
color $ui-inactive-text-color
.control-input
border-color $ui-dark-borderColor
color white
.control-confirmButton
colorDarkPrimaryButton()

View File

@@ -1,6 +1,5 @@
import React, { PropTypes } from 'react'
import ReactDOM from 'react-dom'
import store from '../store'
const electron = require('electron')
const ipc = electron.ipcRenderer
@@ -26,20 +25,19 @@ export default class DeleteArticleModal extends React.Component {
}
handleYesButtonClick (e) {
// store.dispatch(destroyArticle(this.props.articleKey))
this.props.close()
}
render () {
return (
<div className='DeleteArticleModal modal'>
<div className='title'><i className='fa fa-fw fa-trash'/> Delete an article.</div>
<div className='title'><i className='fa fa-fw fa-trash' /> Delete an article.</div>
<div className='message'>Do you really want to delete?</div>
<div className='control'>
<button ref='no' onClick={(e) => this.handleNoButtonClick(e)}><i className='fa fa-fw fa-close'/> No</button>
<button ref='yes' onClick={(e) => this.handleYesButtonClick(e)} className='danger'><i className='fa fa-fw fa-check'/> Yes</button>
<button ref='no' onClick={(e) => this.handleNoButtonClick(e)}><i className='fa fa-fw fa-close' /> No</button>
<button ref='yes' onClick={(e) => this.handleYesButtonClick(e)} className='danger'><i className='fa fa-fw fa-check' /> Yes</button>
</div>
</div>
)

View File

@@ -1,11 +1,10 @@
import React, { PropTypes } from 'react'
import React from 'react'
import CSSModules from 'browser/lib/CSSModules'
import styles from './InitModal.styl'
import dataApi from 'browser/main/lib/dataApi'
import store from 'browser/main/store'
import { hashHistory } from 'react-router'
import _ from 'lodash'
import keygen from 'browser/lib/keygen'
const CSON = require('@rokt33r/season')
const path = require('path')
@@ -42,10 +41,6 @@ class InitModal extends React.Component {
}
}
handleCloseButtonClick (e) {
this.props.close()
}
handlePathChange (e) {
this.setState({
path: e.target.value
@@ -144,7 +139,7 @@ class InitModal extends React.Component {
type: 'SNIPPET_NOTE',
folder: data.storage.folders[0].key,
title: 'Snippet note example',
description: 'Snippet note example\nYou can store a series of snippet as a single note like Gist.',
description: 'Snippet note example\nYou can store a series of snippets as a single note, like Gist.',
snippets: [
{
name: 'example.html',
@@ -188,16 +183,10 @@ class InitModal extends React.Component {
})
}
handleKeyDown (e) {
if (e.keyCode === 27) {
this.props.close()
}
}
render () {
if (this.state.isLoading) {
return <div styleName='root--loading'>
<i styleName='spinner' className='fa fa-spin fa-spinner'/>
<i styleName='spinner' className='fa fa-spin fa-spinner' />
<div styleName='loadingMessage'>Preparing initialization...</div>
</div>
}
@@ -210,15 +199,12 @@ class InitModal extends React.Component {
<div styleName='header'>
<div styleName='header-title'>Initialize Storage</div>
</div>
<button styleName='closeButton'
onClick={(e) => this.handleCloseButtonClick(e)}
>Close</button>
<div styleName='body'>
<div styleName='body-welcome'>
Welcome you!
Welcome!
</div>
<div styleName='body-description'>
Boostnote will use this directory as a default storage.
Please select a directory for Boostnote storage.
</div>
<div styleName='body-path'>
<input styleName='body-path-input'
@@ -235,7 +221,7 @@ class InitModal extends React.Component {
{this.state.legacyStorageExists &&
<div styleName='body-migration'>
<label><input type='checkbox' checked={this.state.migrationRequested} onChange={(e) => this.handleMigrationRequestedChange(e)}/> Migrate old data from the legacy app v0.5</label>
<label><input type='checkbox' checked={this.state.migrationRequested} onChange={(e) => this.handleMigrationRequestedChange(e)} /> Migrate old data from the legacy app v0.5</label>
</div>
}
@@ -247,7 +233,7 @@ class InitModal extends React.Component {
>
{this.state.isSending
? <span>
<i className='fa fa-spin fa-spinner'/> Loading...
<i className='fa fa-spin fa-spinner' /> Loading...
</span>
: 'Let\'s Go!'
}

View File

@@ -28,8 +28,6 @@
right 10px
height 30px
padding 0 25px
border $ui-border
border-radius 2px
color $ui-text-color
colorDefaultButton()

View File

@@ -1,4 +1,4 @@
import React, { PropTypes } from 'react'
import React from 'react'
import CSSModules from 'browser/lib/CSSModules'
import styles from './NewNoteModal.styl'
import dataApi from 'browser/main/lib/dataApi'
@@ -100,11 +100,12 @@ class NewNoteModal extends React.Component {
onKeyDown={(e) => this.handleKeyDown(e)}
>
<div styleName='header'>
<div styleName='title'>New Note</div>
<div styleName='title'>Make a Note</div>
</div>
<button styleName='closeButton'
onClick={(e) => this.handleCloseButtonClick(e)}
>Close</button>
<button styleName='closeButton' onClick={(e) => this.handleCloseButtonClick(e)}>
<div styleName='close-mark'>×</div>
<div styleName='close-text'>esc</div>
</button>
<div styleName='control'>
<button styleName='control-button'
@@ -114,8 +115,8 @@ class NewNoteModal extends React.Component {
>
<i styleName='control-button-icon'
className='fa fa-file-text-o'
/><br/>
<span styleName='control-button-label'>Markdown Note</span><br/>
/><br />
<span styleName='control-button-label'>Markdown Note</span><br />
<span styleName='control-button-description'>It is good for any type of documents. Check List, Code block and Latex block are available.</span>
</button>
@@ -126,14 +127,14 @@ class NewNoteModal extends React.Component {
>
<i styleName='control-button-icon'
className='fa fa-code'
/><br/>
<span styleName='control-button-label'>Snippet Note</span><br/>
/><br />
<span styleName='control-button-label'>Snippet Note</span><br />
<span styleName='control-button-description'>This format is specialized on managing snippets like Gist. Multiple snippets can be grouped as a note.
</span>
</button>
</div>
<div styleName='description'><i className='fa fa-arrows-h'/> Tab to switch format</div>
<div styleName='description'><i className='fa fa-arrows-h' /> Tab to switch format</div>
</div>
)

View File

@@ -14,20 +14,24 @@
color $ui-text-color
.closeButton
height 50px
position absolute
top 10px
background-color transparent
color $ui-inactive-text-color
border none
top 1px
right 10px
height 30px
width 0 25px
border $ui-border
border-radius 2px
color $ui-text-color
colorDefaultButton()
text-align center
width top-bar--height
height top-bar--height
.control
padding 25px 15px 15px
text-align center
.close-mark
font-size 15px
.control-button
width 220px
height 220px
@@ -64,17 +68,12 @@ body[data-theme="dark"]
border-color $ui-dark-borderColor
color $ui-dark-text-color
.closeButton
border-color $ui-dark-borderColor
color $ui-dark-text-color
colorDarkDefaultButton()
.control-button
border-color $ui-dark-borderColor
color $ui-dark-text-color
background-color transparent
&:focus
colorPrimaryButton()
colorDarkPrimaryButton()
.description
color $ui-inactive-text-color

View File

@@ -1,40 +1,51 @@
@import('./Tab')
.root
padding 15px
color $ui-text-color
margin-bottom 30px
.group
margin-bottom 45px
.group-header
font-size 24px
@extend .header
color $ui-text-color
padding 5px
border-bottom $default-border
margin-bottom 15px
.group-header2
font-size 18px
font-size 20px
color $ui-text-color
padding 5px
margin-bottom 15px
margin-top 30px
.group-section
margin-bottom 15px
margin-bottom 20px
display flex
line-height 30px
.group-section-label
width 150px
text-align right
text-align left
margin-right 10px
font-size 14px
.group-section-control
flex 1
.group-section-control select
outline none
border 1px solid $ui-borderColor
background-color transparent
.group-section-control-input
height 30px
vertical-align middle
width 150px
font-size 12px
width 400px
font-size $tab--button-font-size
border solid 1px $border-color
border-radius 2px
padding 0 5px
outline none
&:disabled
background-color $ui-input--disabled-backgroundColor
@@ -45,7 +56,6 @@
padding-left 15px
.group-control
border-top $default-border
padding-top 10px
box-sizing border-box
height 40px
@@ -56,27 +66,31 @@
line-height 30px
padding 0 5px
float right
.group-control-leftButton
float left
colorDefaultButton()
border $default-border
border none
border-radius 2px
height 30px
font-size $tab--button-font-size
height $tab--button-height
padding 0 15px
margin-right 5px
margin-right 10px
.group-control-rightButton
float right
colorPrimaryButton()
border none
border-radius 2px
height 30px
padding 0 15px
margin-right 5px
font-size $tab--button-font-size
height 35px
width 100px
margin-right 10px
.group-hint
border $ui-border
padding 10px 15px
margin 15px 0
border-radius 5px
border-radius 2px
background-color $ui-backgroundColor
color $ui-inactive-text-color
ul
@@ -86,6 +100,21 @@
p
line-height 1.2
.note-for-keymap
margin-left: 10px
font-size: 12px
.code-mirror
width 400px
height 120px
margin 5px 0
font-size 12px
colorDarkControl()
border-color $ui-dark-borderColor
background-color $ui-dark-backgroundColor
color $ui-dark-text-color
body[data-theme="dark"]
.root
color $ui-dark-text-color
@@ -108,6 +137,7 @@ body[data-theme="dark"]
.group-control-rightButton
colorDarkPrimaryButton()
.group-hint
border-color $ui-dark-borderColor
background-color $ui-dark-backgroundColor
color $ui-dark-text-color
colorDarkControl()
.group-section-control
select, .group-section-control-input
colorDarkControl()

View File

@@ -0,0 +1,155 @@
import React, { PropTypes } from 'react'
import CSSModules from 'browser/lib/CSSModules'
import styles from './ConfigTab.styl'
import ConfigManager from 'browser/main/lib/ConfigManager'
import store from 'browser/main/store'
const electron = require('electron')
const ipc = electron.ipcRenderer
class HotkeyTab extends React.Component {
constructor (props) {
super(props)
this.state = {
isHotkeyHintOpen: false,
config: props.config
}
}
componentDidMount () {
this.handleSettingDone = () => {
this.setState({keymapAlert: {
type: 'success',
message: 'Successfully applied!'
}})
}
this.handleSettingError = (err) => {
this.setState({keymapAlert: {
type: 'error',
message: err.message != null ? err.message : 'Error occurs!'
}})
}
ipc.addListener('APP_SETTING_DONE', this.handleSettingDone)
ipc.addListener('APP_SETTING_ERROR', this.handleSettingError)
}
componentWillUnmount () {
ipc.removeListener('APP_SETTING_DONE', this.handleSettingDone)
ipc.removeListener('APP_SETTING_ERROR', this.handleSettingError)
}
handleSaveButtonClick (e) {
let newConfig = {
hotkey: this.state.config.hotkey
}
ConfigManager.set(newConfig)
store.dispatch({
type: 'SET_UI',
config: newConfig
})
}
handleHintToggleButtonClick (e) {
this.setState({
isHotkeyHintOpen: !this.state.isHotkeyHintOpen
})
}
handleHotkeyChange (e) {
let { config } = this.state
config.hotkey = {
toggleFinder: this.refs.toggleFinder.value,
toggleMain: this.refs.toggleMain.value
}
this.setState({
config
})
}
render () {
let keymapAlert = this.state.keymapAlert
let keymapAlertElement = keymapAlert != null
? <p className={`alert ${keymapAlert.type}`}>
{keymapAlert.message}
</p>
: null
let { config } = this.state
return (
<div styleName='root'>
<div styleName='group'>
<div styleName='group-header'>Hotkey</div>
<div styleName='group-section'>
<div styleName='group-section-label'>Toggle Main</div>
<div styleName='group-section-control'>
<input styleName='group-section-control-input'
onChange={(e) => this.handleHotkeyChange(e)}
ref='toggleMain'
value={config.hotkey.toggleMain}
type='text'
/>
</div>
</div>
<div styleName='group-section'>
<div styleName='group-section-label'>Toggle Finder(popup)</div>
<div styleName='group-section-control'>
<input styleName='group-section-control-input'
onChange={(e) => this.handleHotkeyChange(e)}
ref='toggleFinder'
value={config.hotkey.toggleFinder}
type='text'
/>
</div>
</div>
<div styleName='group-control'>
<button styleName='group-control-leftButton'
onClick={(e) => this.handleHintToggleButtonClick(e)}
>
{this.state.isHotkeyHintOpen
? 'Hide Hint'
: 'Hint?'
}
</button>
<button styleName='group-control-rightButton'
onClick={(e) => this.handleSaveButtonClick(e)}>Save
</button>
{keymapAlertElement}
</div>
{this.state.isHotkeyHintOpen &&
<div styleName='group-hint'>
<p>Available Keys</p>
<ul>
<li><code>0</code> to <code>9</code></li>
<li><code>A</code> to <code>Z</code></li>
<li><code>F1</code> to <code>F24</code></li>
<li>Punctuations like <code>~</code>, <code>!</code>, <code>@</code>, <code>#</code>, <code>$</code>, etc.</li>
<li><code>Plus</code></li>
<li><code>Space</code></li>
<li><code>Backspace</code></li>
<li><code>Delete</code></li>
<li><code>Insert</code></li>
<li><code>Return</code> (or <code>Enter</code> as alias)</li>
<li><code>Up</code>, <code>Down</code>, <code>Left</code> and <code>Right</code></li>
<li><code>Home</code> and <code>End</code></li>
<li><code>PageUp</code> and <code>PageDown</code></li>
<li><code>Escape</code> (or <code>Esc</code> for short)</li>
<li><code>VolumeUp</code>, <code>VolumeDown</code> and <code>VolumeMute</code></li>
<li><code>MediaNextTrack</code>, <code>MediaPreviousTrack</code>, <code>MediaStop</code> and <code>MediaPlayPause</code></li>
<li><code>Control</code> (or <code>Ctrl</code> for short)</li>
</ul>
</div>
}
</div>
</div>
)
}
}
HotkeyTab.propTypes = {
dispatch: PropTypes.func
}
export default CSSModules(HotkeyTab, styles)

View File

@@ -1,4 +1,4 @@
import React, { PropTypes } from 'react'
import React from 'react'
import CSSModules from 'browser/lib/CSSModules'
import styles from './InfoTab.styl'
@@ -22,29 +22,50 @@ class InfoTab extends React.Component {
render () {
return (
<div styleName='root'>
<div styleName='header'>Info</div>
<div styleName='top'>
<img styleName='icon' src='../resources/app.png' width='150' height='150'/>
<div styleName='appId'>Boostnote {appVersion}</div>
<div styleName='description'>
A simple markdown/snippet note app for developer.
<div styleName='icon-space'>
<img styleName='icon' src='../resources/app.png' width='92' height='92' />
<div styleName='icon-right'>
<div styleName='appId'>Boostnote {appVersion}</div>
<div styleName='description'>
An open source note-taking app made for programmers just like you.
</div>
</div>
</div>
<div styleName='madeBy'>Made by&nbsp;
<a href='http://maisin.co/'
onClick={(e) => this.handleLinkClick(e)}
>MAISIN&CO.</a></div>
<div styleName='copyright'>Copyright 2016 MAISIN&CO. All rights reserved.</div>
</div>
<ul styleName='list'>
<li>
The codes of this app is published under GPLv3 license.
</li>
<li>
Any kinds of feedback, creating a new issue or a pull request, would be welcomed.
</li>
<li>
Issue Tracker : <a href='https://github.com/BoostIO/Boostnote/issues'
<a href='https://boostnote.io'
onClick={(e) => this.handleLinkClick(e)}
>https://github.com/BoostIO/Boostnote/issues</a>
>Website</a>
</li>
<li>
<a href='https://boostnote.paintory.com/'
onClick={(e) => this.handleLinkClick(e)}
>Boostnote Shop</a> : Products are shipped to all over the world 🌏
</li>
<li>
<a href='https://www.patreon.com/boostnote'
onClick={(e) => this.handleLinkClick(e)}
>Donate via Patreon</a> : Thank you for your support 🎉
</li>
<li>
<a href='https://github.com/BoostIO/Boostnote/issues'
onClick={(e) => this.handleLinkClick(e)}
>GitHub Issues</a> : We'd love to hear your feedback 🙌
</li>
<li>
<a href='https://github.com/BoostIO/Boostnote/blob/master/docs/build.md'
onClick={(e) => this.handleLinkClick(e)}
>Development</a> : Development configurations for Boostnote 🚀
</li>
<li styleName='cc'>
Copyright (C) 2017 Maisin&Co.
</li>
<li styleName='cc'>
License: GPL v3
</li>
</ul>
</div>

View File

@@ -1,45 +1,47 @@
@import('./Tab')
.root
padding 15px
white-space pre
line-height 1.4
color $ui-text-color
color alpha($ui-text-color, 90%)
width 100%
font-size 14px
.top
text-align center
margin-bottom 25px
text-align left
margin-bottom 20px
.icon-space
margin 20px 0
height 100px
.icon
display inline-block
vertical-align middle
.icon-right
display inline-block
vertical-align middle
margin-left 20px
.appId
font-size 24px
margin-bottom 13px
.description
overflow hidden
white-space normal
line-height 1.5
margin 5px auto 10px
font-size 14px
text-align center
.madeBy
font-size 12px
$ui-inactive-text-color
.copyright
font-size 12px
$ui-inactive-text-color
.list
list-style square
padding-left 2em
li
white-space normal
padding-bottom 10px
a
color #4E8EC6
text-decoration none
body[data-theme="dark"]
.root
color $ui-dark-text-color
.madeBy
color $ui-dark-inactive-text-color
.copyright
color $ui-dark-inactive-text-color
color alpha($tab--dark-text-color, 80%)

View File

@@ -1,51 +1,98 @@
@import('./Tab')
top-bar--height = 50px
.root
modal()
max-width 540px
min-height 400px
max-width 800px
min-height 500px
height 80%
overflow hidden
position relative
.nav
.top-bar
absolute top left right
height 50px
height top-bar--height
background-color $ui-backgroundColor
border-bottom solid 1px $ui-borderColor
p
text-align center
font-size 18px
line-height top-bar--height
.top-bar-close
position absolute
background-color transparent
color $ui-inactive-text-color
border none
top 0
right 0
text-align center
width top-bar--height
height top-bar--height
.nav
absolute top left right
top top-bar--height
left 0
width 140px
margin-left 30px
margin-top 20px
background-color $ui-backgroundColor
.nav-button
width 80px
height 50px
border none
background-color transparent
color #939395
font-size 14px
&:hover
color #515151
text-align left
width 100px
margin 4px 0
padding 5px 0
padding-left 10px
border none
border-radius 2px
background-color transparent
color $ui-text-color
font-size 14px
.nav-button--active
@extend .nav-button
color #6AA5E9
color $ui-text-color
background-color $ui-button--active-backgroundColor
&:hover
color #6AA5E9
color $ui-text-color
.nav-button-icon
display block
.content
absolute left right bottom
top 50px
top top-bar--height
left 140px
margin-top 10px
overflow-y auto
body[data-theme="dark"]
.root
modalDark()
.top-bar
background-color transparent
border-color #4A4D52
p
color $tab--dark-text-color
.nav
background-color $ui-dark-button--hover-backgroundColor
background-color transparent
border-color $ui-dark-borderColor
.nav-button
background-color transparent
color #939395
color $tab--dark-text-color
&:hover
color $ui-dark-text-color
.nav-button--active
@extend .nav-button
color white
background-color $dark-primary-button-background--active
&:hover
color white

View File

@@ -106,7 +106,10 @@ class UnstyledFolderItem extends React.Component {
const popover = { position: 'absolute', zIndex: 2 }
const cover = {
position: 'fixed',
top: 0, right: 0, bottom: 0, left: 0
top: 0,
right: 0,
bottom: 0,
left: 0
}
const pickerStyle = Object.assign({}, {
position: 'absolute'
@@ -137,7 +140,7 @@ class UnstyledFolderItem extends React.Component {
</div>
: null
}
<i className='fa fa-square'/>
<i className='fa fa-square' />
</button>
<input styleName='folderList-item-left-nameInput'
value={this.state.folder.name}
@@ -300,10 +303,10 @@ class StorageItem extends React.Component {
})
if (index === 0) {
let { storage, dispatch } = this.props
let { storage } = this.props
dataApi.removeStorage(storage.key)
.then(() => {
dispatch({
store.dispatch({
type: 'REMOVE_STORAGE',
storageKey: storage.key
})
@@ -368,17 +371,17 @@ class StorageItem extends React.Component {
: <div styleName='header-label'
onClick={(e) => this.handleLabelClick(e)}
>
<i className='fa fa-folder-open'/>&nbsp;
<i className='fa fa-folder-open' />&nbsp;
{storage.name}&nbsp;
<span styleName='header-label-path'>({storage.path})</span>&nbsp;
<i styleName='header-label-editButton' className='fa fa-pencil'/>
<i styleName='header-label-editButton' className='fa fa-pencil' />
</div>
}
<div styleName='header-control'>
<button styleName='header-control-button'
onClick={(e) => this.handleNewFolderButtonClick(e)}
>
<i className='fa fa-plus'/>
<i className='fa fa-plus' />
<span styleName='header-control-button-tooltip'
style={{left: -20}}
>Add Folder</span>
@@ -386,7 +389,7 @@ class StorageItem extends React.Component {
<button styleName='header-control-button'
onClick={(e) => this.handleExternalButtonClick(e)}
>
<i className='fa fa-external-link'/>
<i className='fa fa-external-link' />
<span styleName='header-control-button-tooltip'
style={{left: -50}}
>Open Storage folder</span>
@@ -394,7 +397,7 @@ class StorageItem extends React.Component {
<button styleName='header-control-button'
onClick={(e) => this.handleUnlinkButtonClick(e)}
>
<i className='fa fa-unlink'/>
<i className='fa fa-unlink' />
<span styleName='header-control-button-tooltip'
style={{left: -10}}
>Unlink</span>

View File

@@ -35,7 +35,7 @@
border $ui-border
border-radius 2px
padding 0 5px
outline none
.header-control
float right
@@ -71,7 +71,7 @@
background-color darken(white, 3%)
.folderList-item-left
height 30px
border-left solid 4px transparent
border-left solid 2px transparent
padding 0 10px
line-height 30px
float left
@@ -105,6 +105,7 @@
border $ui-border
border-radius 2px
padding 0 5px
outline none
.folderList-item-right
float right

View File

@@ -63,6 +63,7 @@ class StoragesTab extends React.Component {
})
return (
<div styleName='list'>
<div styleName='header'>Storages</div>
{storageList.length > 0
? storageList
: <div styleName='list-empty'>No storage found.</div>
@@ -71,7 +72,7 @@ class StoragesTab extends React.Component {
<button styleName='list-control-addStorageButton'
onClick={(e) => this.handleAddStorageButton(e)}
>
<i className='fa fa-plus'/> Add Storage
<i className='fa fa-plus' /> Add Storage
</button>
</div>
</div>

View File

@@ -1,3 +1,5 @@
@import('./Tab')
.root
padding 15px
color $ui-text-color
@@ -26,10 +28,14 @@
.list-control
height 30px
.list-control-addStorageButton
height 30px
position absolute
top 7px
right 20px
height $tab--button-height
padding 0 15px
border $ui-border
colorDefaultButton()
font-size $tab--button-font-size
border-radius 2px
.addStorage

View File

@@ -0,0 +1,18 @@
/**
* Common style for tabs on config modal.
*/
$tab--input-border-radius = 5px
$tab--button-border-radius = 5px
$tab--button-height = 40px
$tab--button-font-size = 14px
$tab--dark-text-color = #E5E5E5
.header
font-size 24px
margin-bottom 30px
body[data-theme="dark"]
.header
color $tab--dark-text-color

View File

@@ -1,138 +1,73 @@
import React, { PropTypes } from 'react'
import CSSModules from 'browser/lib/CSSModules'
import styles from './ConfigTab.styl'
import hljsTheme from 'browser/lib/hljsThemes'
import ConfigManager from 'browser/main/lib/ConfigManager'
import store from 'browser/main/store'
import consts from 'browser/lib/consts'
const electron = require('electron')
const ipc = electron.ipcRenderer
import ReactCodeMirror from 'react-codemirror'
import CodeMirror from 'codemirror'
const OSX = global.process.platform === 'darwin'
class ConfigTab extends React.Component {
class UiTab extends React.Component {
constructor (props) {
super(props)
this.state = {
isHotkeyHintOpen: false,
config: props.config
config: props.config,
codemirrorTheme: props.config.editor.theme
}
}
componentDidMount () {
this.handleSettingDone = () => {
this.setState({keymapAlert: {
type: 'success',
message: 'Successfully applied!'
}})
}
this.handleSettingError = (err) => {
this.setState({keymapAlert: {
type: 'error',
message: err.message != null ? err.message : 'Error occurs!'
}})
}
ipc.addListener('APP_SETTING_DONE', this.handleSettingDone)
ipc.addListener('APP_SETTING_ERROR', this.handleSettingError)
}
componentWillUnmount () {
ipc.removeListener('APP_SETTING_DONE', this.handleSettingDone)
ipc.removeListener('APP_SETTING_ERROR', this.handleSettingError)
}
handleSaveButtonClick (e) {
let newConfig = {
hotkey: this.state.config.hotkey
}
ConfigManager.set(newConfig)
store.dispatch({
type: 'SET_UI',
config: newConfig
})
}
handleKeyDown (e) {
if (e.keyCode === 13) {
this.submitHotKey()
}
}
handleConfigKeyDown (e) {
if (e.keyCode === 13) {
this.submitConfig()
}
}
handleLineNumberingClick (e) {
let config = this.state.config
config['preview-line-number'] = e.target.checked
this.setState({
config
})
}
handleDisableDirectWriteClick (e) {
let config = this.state.config
config['disable-direct-write'] = e.target.checked
this.setState({
config
})
}
handleHintToggleButtonClick (e) {
this.setState({
isHotkeyHintOpen: !this.state.isHotkeyHintOpen
})
}
handleHotkeyChange (e) {
let { config } = this.state
config.hotkey = {
toggleFinder: this.refs.toggleFinder.value,
toggleMain: this.refs.toggleMain.value
}
this.setState({
config
})
componentWillMount () {
CodeMirror.autoLoadMode(ReactCodeMirror, 'javascript')
}
handleUIChange (e) {
let { config } = this.state
const { codemirrorTheme } = this.state
let checkHighLight = document.getElementById('checkHighLight')
config.ui = {
theme: this.refs.uiTheme.value,
disableDirectWrite: this.refs.uiD2w != null
? this.refs.uiD2w.checked
: false
}
config.editor = {
theme: this.refs.editorTheme.value,
fontSize: this.refs.editorFontSize.value,
fontFamily: this.refs.editorFontFamily.value,
indentType: this.refs.editorIndentType.value,
indentSize: this.refs.editorIndentSize.value,
switchPreview: this.refs.editorSwitchPreview.value
}
config.preview = {
fontSize: this.refs.previewFontSize.value,
fontFamily: this.refs.previewFontFamily.value,
codeBlockTheme: this.refs.previewCodeBlockTheme.value,
lineNumber: this.refs.previewLineNumber.checked
if (checkHighLight === null) {
checkHighLight = document.createElement('link')
checkHighLight.setAttribute('id', 'checkHighLight')
checkHighLight.setAttribute('rel', 'stylesheet')
document.head.appendChild(checkHighLight)
}
this.setState({
config
})
const newConfig = {
ui: {
theme: this.refs.uiTheme.value,
disableDirectWrite: this.refs.uiD2w != null
? this.refs.uiD2w.checked
: false
},
editor: {
theme: this.refs.editorTheme.value,
fontSize: this.refs.editorFontSize.value,
fontFamily: this.refs.editorFontFamily.value,
indentType: this.refs.editorIndentType.value,
indentSize: this.refs.editorIndentSize.value,
switchPreview: this.refs.editorSwitchPreview.value,
keyMap: this.refs.editorKeyMap.value
},
preview: {
fontSize: this.refs.previewFontSize.value,
fontFamily: this.refs.previewFontFamily.value,
codeBlockTheme: this.refs.previewCodeBlockTheme.value,
lineNumber: this.refs.previewLineNumber.checked
}
}
const newCodemirrorTheme = this.refs.editorTheme.value
if (newCodemirrorTheme !== codemirrorTheme) {
checkHighLight.setAttribute('href', `../node_modules/codemirror/theme/${newCodemirrorTheme}.css`)
}
this.setState({ config: newConfig, codemirrorTheme: newCodemirrorTheme })
}
handleSaveUIClick (e) {
let newConfig = {
const newConfig = {
ui: this.state.config.ui,
editor: this.state.config.editor,
preview: this.state.config.preview
@@ -147,85 +82,17 @@ class ConfigTab extends React.Component {
}
render () {
let keymapAlert = this.state.keymapAlert
let keymapAlertElement = keymapAlert != null
? <p className={`alert ${keymapAlert.type}`}>
{keymapAlert.message}
</p>
: null
let themes = consts.THEMES
let hljsThemeList = hljsTheme()
let { config } = this.state
const themes = consts.THEMES
const { config, codemirrorTheme } = this.state
const codemirrorSampleCode = 'function iamHappy (happy) {\n\tif (happy) {\n\t console.log("I am Happy!")\n\t} else {\n\t console.log("I am not Happy!")\n\t}\n};'
return (
<div styleName='root'>
<div styleName='group'>
<div styleName='group-header'>Hotkey</div>
<div styleName='group-section'>
<div styleName='group-section-label'>Toggle Main</div>
<div styleName='group-section-control'>
<input styleName='group-section-control-input'
onChange={(e) => this.handleHotkeyChange(e)}
ref='toggleMain'
value={config.hotkey.toggleMain}
type='text'
/>
</div>
</div>
<div styleName='group-section'>
<div styleName='group-section-label'>Toggle Finder(popup)</div>
<div styleName='group-section-control'>
<input styleName='group-section-control-input'
onChange={(e) => this.handleHotkeyChange(e)}
ref='toggleFinder'
value={config.hotkey.toggleFinder}
type='text'
/>
</div>
</div>
<div styleName='group-control'>
<button styleName='group-control-leftButton'
onClick={(e) => this.handleHintToggleButtonClick(e)}
>
{this.state.isHotkeyHintOpen
? 'Hide Hint'
: 'Show Hint'
}
</button>
<button styleName='group-control-rightButton'
onClick={(e) => this.handleSaveButtonClick(e)}>Save Hotkey
</button>
{keymapAlertElement}
</div>
{this.state.isHotkeyHintOpen &&
<div styleName='group-hint'>
<p>Available Keys</p>
<ul>
<li><code>0</code> to <code>9</code></li>
<li><code>A</code> to <code>Z</code></li>
<li><code>F1</code> to <code>F24</code></li>
<li>Punctuations like <code>~</code>, <code>!</code>, <code>@</code>, <code>#</code>, <code>$</code>, etc.</li>
<li><code>Plus</code></li>
<li><code>Space</code></li>
<li><code>Backspace</code></li>
<li><code>Delete</code></li>
<li><code>Insert</code></li>
<li><code>Return</code> (or <code>Enter</code> as alias)</li>
<li><code>Up</code>, <code>Down</code>, <code>Left</code> and <code>Right</code></li>
<li><code>Home</code> and <code>End</code></li>
<li><code>PageUp</code> and <code>PageDown</code></li>
<li><code>Escape</code> (or <code>Esc</code> for short)</li>
<li><code>VolumeUp</code>, <code>VolumeDown</code> and <code>VolumeMute</code></li>
<li><code>MediaNextTrack</code>, <code>MediaPreviousTrack</code>, <code>MediaStop</code> and <code>MediaPlayPause</code></li>
</ul>
</div>
}
</div>
<div styleName='group'>
<div styleName='group-header'>UI</div>
<div styleName='group-header2'>Theme</div>
<div styleName='group-section'>
<div styleName='group-section-label'>Theme</div>
<div styleName='group-section-control'>
<select value={config.ui.theme}
onChange={(e) => this.handleUIChange(e)}
@@ -268,6 +135,9 @@ class ConfigTab extends React.Component {
})
}
</select>
<div styleName='code-mirror'>
<ReactCodeMirror value={codemirrorSampleCode} options={{ lineNumbers: true, readOnly: true, mode: 'javascript', theme: codemirrorTheme }} />
</div>
</div>
</div>
<div styleName='group-section'>
@@ -334,6 +204,23 @@ class ConfigTab extends React.Component {
</select>
</div>
</div>
<div styleName='group-section'>
<div styleName='group-section-label'>
Editor Keymap
</div>
<div styleName='group-section-control'>
<select value={config.editor.keyMap}
ref='editorKeyMap'
onChange={(e) => this.handleUIChange(e)}
>
<option value='sublime'>default</option>
<option value='vim'>vim</option>
</select>
<span styleName='note-for-keymap'>Please reload boostnote after you change the keymap</span>
</div>
</div>
<div styleName='group-header2'>Preview</div>
<div styleName='group-section'>
<div styleName='group-section-label'>
@@ -369,8 +256,8 @@ class ConfigTab extends React.Component {
onChange={(e) => this.handleUIChange(e)}
>
{
hljsThemeList.map((theme) => {
return (<option value={theme.name} key={theme.name}>{theme.caption}</option>)
themes.map((theme) => {
return (<option value={theme} key={theme}>{theme}</option>)
})
}
</select>
@@ -391,7 +278,7 @@ class ConfigTab extends React.Component {
<button styleName='group-control-rightButton'
onClick={(e) => this.handleSaveUIClick(e)}
>
Save UI Config
Save
</button>
</div>
</div>
@@ -400,11 +287,11 @@ class ConfigTab extends React.Component {
}
}
ConfigTab.propTypes = {
UiTab.propTypes = {
user: PropTypes.shape({
name: PropTypes.string
}),
dispatch: PropTypes.func
}
export default CSSModules(ConfigTab, styles)
export default CSSModules(UiTab, styles)

View File

@@ -1,7 +1,8 @@
import React, { PropTypes } from 'react'
import ReactDOM from 'react-dom'
import { connect } from 'react-redux'
import ConfigTab from './ConfigTab'
import HotkeyTab from './HotkeyTab'
import UiTab from './UiTab'
import InfoTab from './InfoTab'
import StoragesTab from './StoragesTab'
import CSSModules from 'browser/lib/CSSModules'
@@ -32,16 +33,27 @@ class Preferences extends React.Component {
}
}
handleEscButtonClick () {
this.props.close()
}
renderContent () {
const { boundingBox } = this.state
let { dispatch, config, data } = this.props
switch (this.state.currentTab) {
case 'INFO':
return <InfoTab/>
case 'CONFIG':
return <InfoTab />
case 'HOTKEY':
return (
<ConfigTab
<HotkeyTab
dispatch={dispatch}
config={config}
/>
)
case 'UI':
return (
<UiTab
dispatch={dispatch}
config={config}
/>
@@ -73,9 +85,10 @@ class Preferences extends React.Component {
let content = this.renderContent()
let tabs = [
{target: 'STORAGES', label: 'Storages', icon: 'database'},
{target: 'CONFIG', label: 'Config', icon: 'cogs'},
{target: 'INFO', label: 'Info', icon: 'info-circle'}
{target: 'STORAGES', label: 'Storages'},
{target: 'HOTKEY', label: 'Hotkey'},
{target: 'UI', label: 'UI'},
{target: 'INFO', label: 'Info'}
]
let navButtons = tabs.map((tab) => {
@@ -88,9 +101,6 @@ class Preferences extends React.Component {
key={tab.target}
onClick={(e) => this.handleNavButtonClick(tab.target)(e)}
>
<i styleName='nav-button-icon'
className={'fa fa-' + tab.icon}
/>
<span styleName='nav-button-label'>
{tab.label}
</span>
@@ -104,6 +114,13 @@ class Preferences extends React.Component {
tabIndex='-1'
onKeyDown={(e) => this.handleKeyDown(e)}
>
<div styleName='top-bar'>
<p>Your menu for Boostnote</p>
</div>
<button styleName='top-bar-close' onClick={(e) => this.handleEscButtonClick(e)}>
<div styleName='top-bar-close-mark'>×</div>
<div styleName='top-bar-close-text'>esc</div>
</button>
<div styleName='nav'>
{navButtons}
</div>

View File

@@ -6,7 +6,7 @@
.header
height 50px
font-size 18px
font-size 16px
line-height 50px
padding 0 15px
background-color $ui-backgroundColor
@@ -40,7 +40,7 @@
background-color transparent
outline none
vertical-align middle
font-size 18px
font-size 14px
text-align center
&:disabled
background-color $ui-input--disabled-backgroundColor
@@ -75,3 +75,7 @@ body[data-theme="dark"]
.control-input
border-color $ui-dark-borderColor
color $ui-dark-text-color
.control-confirmButton
colorDarkPrimaryButton()

View File

@@ -8,21 +8,24 @@ $danger-lighten-color = lighten(#c9302c, 5%)
$statusBar-height = 24px
$sideNav-width = 200px
$sideNav--folded-width = 44px
$topBar-height = 50px
$topBar-height = 60px
// UI default
$ui-text-color = #515151
$ui-text-color = #333333
$ui-inactive-text-color = #939395
$ui-borderColor = #D1D1D1
$ui-backgroundColor = #FAFAFA
$ui-backgroundColor = #FFFFFF
$ui-noteList-backgroundColor = #F3F3F3
$ui-noteDetail-backgroundColor = #F4F4F4
$ui-border = solid 1px $ui-borderColor
$ui-active-color = #6AA5E9
$ui-tag-backgroundColor = rgba(0, 0, 0, 0.3)
// UI Button
$ui-button-color = #939395
$ui-button--hover-backgroundColor = rgba(126, 127, 129, 0.08)
$ui-button--hover-backgroundColor = #D9D9D9
$ui-button--active-color = white
$ui-button--active-backgroundColor = #6AA5E9
$ui-button--active-backgroundColor = #D9D9D9
$ui-button--focus-borderColor = lighten(#369DCD, 25%)
// UI Tooltip
@@ -44,6 +47,9 @@ tooltip()
$ui-input--focus-borderColor = #369DCD
$ui-input--disabled-backgroundColor = #DDD
// Parts
$ui-favorite-star-button-color = #FFC216
/*
* # Border
*/
@@ -61,29 +67,43 @@ $active-border = solid 1px $active-border-color
// Default button
$default-button-background = white
$default-button-background--hover = #e6e6e6
$default-button-background--active = #d4d4d4
$default-button-background--active = #D9D9D9
colorDefaultButton()
background-color $default-button-background
&:hover
background-color $default-button-background--hover
background-color transparent
&:active
&:active:hover
background-color $default-button-background--active
// Primary button(Brand color)
$primary-button-background = $brand-color
$primary-button-background = alpha($brand-color, 60%)
$primary-button-background--hover = darken($brand-color, 5%)
$primary-button-background--active = darken($brand-color, 10%)
colorPrimaryButton()
color white
background-color $primary-button-background
color $ui-text-color
background-color $default-button-background--hover
&:hover
background-color $primary-button-background--hover
background-color $default-button-background--active
&:active
&:active:hover
background-color $primary-button-background--active
background-color $default-button-background--active
// Dark Primary button(Brand color)
$dark-primary-button-background = alpha(#3A404C, 80%)
$dark-primary-button-background--hover = #3A404C
$dark-primary-button-background--active = #3A404C
colorDarkPrimaryButton()
color white
background-color $dark-primary-button-background
&:hover
background-color $dark-primary-button-background--hover
&:active
&:active:hover
background-color $dark-primary-button-background--active
// Danger button(Brand color)
$danger-button-background = #c9302c
@@ -107,13 +127,15 @@ navButtonColor()
border none
color $ui-button-color
background-color transparent
transition color background-color 0.15s
transition 0.15s
&:hover
background-color $ui-button--hover-backgroundColor
background-color alpha($ui-button--active-backgroundColor, 20%)
transition 0.15s
color $ui-text-color
&:active, &:active:hover
background-color $ui-button--active-backgroundColor
color $ui-button--active-color
color $ui-text-color
transition 0.15s
/**
* # Modal Stuff
* These will be moved lib/modal
@@ -131,17 +153,40 @@ modal()
background-color $modal-background
overflow hidden
border-radius $modal-border-radius
box-shadow 2px 2px 10px gray
box-shadow 0 0 1px rgba(76,86,103,.15), 0 2px 18px rgba(31,37,50,.22)
topBarButtonLight()
width 34px
height 34px
border-radius 17px
font-size 14px
margin 13px 7px
padding-top 7px
border none
color $ui-button-color
fill $ui-button-color
background-color transparent
&:active
border-color $ui-button--active-backgroundColor
&:hover
background-color $ui-button--hover-backgroundColor
.control-lockButton-tooltip
opacity 1
// Dark theme
$ui-dark-active-color = #3A404C
$ui-dark-borderColor = lighten(#21252B, 20%)
$ui-dark-backgroundColor = darken(#21252B, 10%)
$ui-dark-backgroundColor = #1D1D1D
$ui-dark-noteList-backgroundColor = #181818
$ui-dark-noteDetail-backgroundColor = #0D0D0D
$ui-dark-tag-backgroundColor = #3A404C
$dark-background-color = lighten($ui-dark-backgroundColor, 10%)
$ui-dark-text-color = #DDDDDD
$ui-dark-button--active-color = white
$ui-dark-button--active-backgroundColor = #6AA5E9
$ui-dark-button--active-backgroundColor = #3A404C
$ui-dark-button--hover-backgroundColor = lighten($ui-dark-backgroundColor, 10%)
$ui-dark-button--focus-borderColor = lighten(#369DCD, 25%)
$ui-dark-topbar-button-color = #939395
$dark-default-button-background = $ui-dark-backgroundColor
$dark-default-button-background--hover = $ui-dark-button--hover-backgroundColor
@@ -172,14 +217,27 @@ navDarkButtonColor()
border none
color $ui-dark-button-color
background-color transparent
transition color background-color 0.15s
transition 0.15s
&:hover
color white
color $ui-dark-text-color
background-color $ui-dark-button--hover-backgroundColor
transition 0.15s
&:active
&:active:hover
transition 0.15s
color $ui-dark-text-color
topBarButtonDark()
border-color $ui-dark-borderColor
color $ui-dark-topbar-button-color
&:hover
background-color $dark-default-button-background--hover
&:active
border-color $ui-dark-button--focus-borderColor
&:active:hover
background-color $ui-dark-button--active-backgroundColor
color $ui-dark-button--active-color
&:focus
border-color $ui-button--focus-borderColor
$ui-dark-tooltip-text-color = white
$ui-dark-tooltip-backgroundColor = alpha(#444, 70%)

View File

@@ -1,19 +1,11 @@
# Contributing to Boostnote
> English below.
## When you open an issue of a bug report
There are no issue template. But there is a request.
## Pull requestの著作権について
**Please paste screenshots of Boostnote with developer tool open**
Pull requestをすることはその変化分のコードの著作権をMAISIN&CO.に譲渡することに同意することになります。
アプリケーションのLicenseのをいつでも変える選択肢を残したいからです。
しかし、これはいずれかBoostnoteが有料の商用アプリになる可能性がある話ではありません。
もし、このアプリケーションで金を稼ごうとするならBoostnote専用のCloud storageの提供やMobile appとの連動、何か特殊なプレミアム機能の提供など形になると思います。
現在考えられているのは、GPL v3の場合、他のライセンスとの互換が不可能であるため、もしより自由なLicense(BSD, MIT)に変える時に改めて著作権者としてライセンスし直す選択肢を残したいぐらいのイメージです。
---
# Contributing to Boostnote(ENG)
Thank you for your help in advance.
## About copyright of Pull Request
@@ -21,3 +13,23 @@ If you make a pull request, It means you agree to transfer the copyright of the
It doesn't mean Boostnote will become a paid app. If we want to earn some money, We will try other way, which is some kind of cloud storage, Mobile app integration or some SPECIAL features.
Because GPL v3 is too strict to be compatible with any other License, We thought this is needed to replace the license with much freer one(like BSD, MIT) somewhen.
---
# Contributing to Boostnote(Japanese)
## バグレポートに関してのissueを立てる時
イシューテンプレートはありませんが、1つお願いがあります。
**開発者ツールを開いた状態のBoostnoteのスクリーンショットを貼ってください**
よろしくお願いします。
## Pull requestの著作権について
Pull requestをすることはその変化分のコードの著作権をMAISIN&CO.に譲渡することに同意することになります。
アプリケーションのLicenseをいつでも変える選択肢を残したいと思うからです。
これはいずれかBoostnoteが有料の商用アプリになる可能性がある話ではありません。
もし、このアプリケーションに料金が発生する時は、Boostnote専用のCloud storageの提供やMobile appとの連動、何か特殊なプレミアム機能の提供など形になります。
現在考えられているのは、GPL v3の場合、他のライセンスとの互換が不可能であるため、もしより自由なLicense(BSD, MIT)に変える時に改めて著作権者としてライセンスし直す選択肢を残すイメージです。

View File

@@ -3,50 +3,44 @@
## Development
We use Webpack HMR to develop Boostnote.
You can use following commands to use default configuration at the top of project directory.
Running the following commands, at the top of the project directory, will start Boostnote with the default configurations.
Install requirement packages.
Install the required packages using yarn.
```
$ npm install
$ yarn
```
Build codes.
Build and run.
```
$ npm run webpack
$ yarn run dev-start
```
After a few seconds, you will see this message.
This command runs `yarn run webpack` and `yarn run hot` in parallel. It is the same as running these commands in two terminals.
```
webpack: bundle is now VALID.
```
The `webpack` will watch for code changes and then apply them automatically.
Then, we have to run the app.
```
$ npm run hot
```
> Actually the app can be start with `npm start`. However, the app will use the compiled script.
If the following error occurs: `Failed to load resource: net::ERR_CONNECTION_REFUSED`, please reload Boostnote.
By this, webpack will watch the code changes and apply it automatically.
![net::ERR_CONNECTION_REFUSED](https://cloud.githubusercontent.com/assets/11307908/24343004/081e66ae-1279-11e7-8d9e-7f478043d835.png)
> ### Notice
> There are some cases you have to refresh app yourself.
> 1. When editing constructor method of a component
> 2. When adding a new css class(same to 1: CSS class is re-written by each component. This process occurs at Constructor method.)
> There are some cases where you have to refresh the app manually.
> 1. When editing a constructor method of a component
> 2. When adding a new css class (similar to 1: the CSS class is re-written by each component. This process occurs at the Constructor method.)
## Deploy
We use Grunt.
Acutal deploy can be run by `grunt`. However, you shouldn't use because the default task is including codesign and authenticode.
We use Grunt to automate deployment.
You can build the program by using `grunt`. However, we don't recommend this because the default task includes codesign and authenticode.
So, we prepare a script which just make an excutable file.
So, we've prepared a separate script which just makes an executable file.
```
grunt pre-build
```
You will find the executable from `dist`. In this case, auto updater won't work because the app isn't signed.
You will find the executable in the `dist` directory. Note, the auto updater won't work because the app isn't signed.
If you are necessary, you can do codesign or authenticode by this excutable.
If you find it necessary, you can use codesign or authenticode with this executable.

20
docs/debug.md Normal file
View File

@@ -0,0 +1,20 @@
# How to debug Boostnote (Electron app)
Boostnote is an Electron app so it's based on Chromium; developers can use `Developer Tools` just like Google Chrome.
You can toggle the `Developer Tools` like this:
![how_to_toggle_devTools](https://cloud.githubusercontent.com/assets/11307908/24343585/162187e2-127c-11e7-9c01-23578db03ecf.png)
The `Developer Tools` will look like this:
![Developer_Tools](https://cloud.githubusercontent.com/assets/11307908/24343545/eff9f3a6-127b-11e7-94cf-cb67bfda634a.png)
When errors occur, the error messages are displayed at the `console`.
## Debugging
For example, you can use the `debugger` to set a breakpoint in the code like this:
![debugger](https://cloud.githubusercontent.com/assets/11307908/24343879/9459efea-127d-11e7-9943-f60bf7f66d4a.png)
This is just an illustrative example, you should find a way to debug which fits your style.
## References
* [Official document of Google Chrome about debugging](https://developer.chrome.com/devtools)

View File

@@ -5,25 +5,25 @@
Webpack HRMを使います。
次の命令から私達がしておいた設定を使うことができます。
```
npm run webpack
```
数秒後、次のメッセージが表示されます。
依存するパッケージをインストールします。
```
webpack: bundle is now VALID.
$ yarn
```
では、アプリを起動します。
ビルドして実行します。
```
npm run hot
$ yarn run dev-start
```
> 元々、アプリは`npm start`から起動できます。しかし、この場合、コンパイルされたスクリプトを利用します。
このコマンドは `yarn run webpack``yarn run hot`を並列に実行します。つまりこのコマンドは2つのターミナルで同時にこれらのコマンドを実行するのと同じことです。
これにより、Webpackが自動的にコードの変更を確認し、それを適用してくれるようになります。
そして、Webpackが自動的にコードの変更を確認し、それを適用してくれるようになります。
もし、 `Failed to load resource: net::ERR_CONNECTION_REFUSED`というエラーが起きた場合、Boostnoteをリロードしてください。
![net::ERR_CONNECTION_REFUSED](https://cloud.githubusercontent.com/assets/11307908/24343004/081e66ae-1279-11e7-8d9e-7f478043d835.png)
> ### 注意
> 時々、直接リフレッシュをする必要があります。

20
docs/jp/debug.md Normal file
View File

@@ -0,0 +1,20 @@
# Boostnote(electronアプリケーション)のデバッグ方法について
Boostnoteを作っているelectronはChromiumからできており、開発者は `Developer Tools`をGoogle Chromeと同じように使うことができます。
Developer Toolsの切り替え方法はこちらです:
![how_to_toggle_devTools](https://cloud.githubusercontent.com/assets/11307908/24343585/162187e2-127c-11e7-9c01-23578db03ecf.png)
実際のデベロッパーツールはこちらです:
![Developer_Tools](https://cloud.githubusercontent.com/assets/11307908/24343545/eff9f3a6-127b-11e7-94cf-cb67bfda634a.png)
何かエラーが起きた場合 `console`にエラーメッセージが表示されます。
## デバッグ
例えば、 `debugger`をコード中にブレークポイントとして挟む方法があります。
![debugger](https://cloud.githubusercontent.com/assets/11307908/24343879/9459efea-127d-11e7-9943-f60bf7f66d4a.png)
ですがこれは一例にしか過ぎません。最もあなたに合うデバッグ方法を見つけた方がいいでしょう。
## 参考
* [デバッグに関するGoogle Chromeの公式ドキュメント](https://developer.chrome.com/devtools)

View File

@@ -6,7 +6,7 @@ Webpack HRM을 개발을 위해 사용합니다.
다음 명령을 통해 저희가 해둔 설정을 사용 할 수 있습니다.
```
npm run webpack
yarn run webpack
```
몇 초 후, 다음 메세지를 보게 될겁니다.
@@ -18,10 +18,10 @@ webpack: bundle is now VALID.
그럼 앱을 실행합시다.
```
npm run hot
yarn run hot
```
> 원래 앱은 `npm start`로 실행가능합니다. 하지만 이 경우, 컴파일된 스크립트를 사용할 것입니다.
> 원래 앱은 `yarn start`로 실행가능합니다. 하지만 이 경우, 컴파일된 스크립트를 사용할 것입니다.
이로써 웹팩이 자동적으로 코드변경을 확인하고 적용해줄 것입니다.

View File

@@ -5,16 +5,16 @@ const packager = require('electron-packager')
const WIN = process.platform === 'win32'
module.exports = function (grunt) {
var auth_code
var authCode
try {
auth_code = grunt.file.readJSON('secret/auth_code.json')
authCode = grunt.file.readJSON('secret/auth_code.json')
} catch (e) {
if (e.origError.code === 'ENOENT') {
console.warn('secret/auth_code.json is not found. CodeSigning is not available.')
}
}
const OSX_COMMON_NAME = auth_code != null ? auth_code.OSX_COMMON_NAME : ''
const WIN_CERT_PASSWORD = auth_code != null ? auth_code.WIN_CERT_PASSWORD : ''
const OSX_COMMON_NAME = authCode != null ? authCode.OSX_COMMON_NAME : ''
const WIN_CERT_PASSWORD = authCode != null ? authCode.WIN_CERT_PASSWORD : ''
var initConfig = {
pkg: grunt.file.readJSON('package.json'),
@@ -98,7 +98,7 @@ module.exports = function (grunt) {
prune: true,
overwrite: true,
out: path.join(__dirname, 'dist'),
ignore: /node_modules\/ace-builds\/(?!src-min)|node_modules\/ace-builds\/(?=src-min-noconflict)|node_modules\/devicon\/icons|dist|^\/browser|^\/secret|\.babelrc|\.gitignore|^\/\.gitmodules|^\/gruntfile|^\/readme.md|^\/webpack|^\/appdmg\.json|^\/node_modules\/grunt/
ignore: /node_modules\/ace-builds\/(?!src-min)|node_modules\/ace-builds\/(?=src-min-noconflict)|node_modules\/devicon\/icons|^\/browser|^\/secret|\.babelrc|\.gitignore|^\/\.gitmodules|^\/gruntfile|^\/readme.md|^\/webpack|^\/appdmg\.json|^\/node_modules\/grunt/
}
switch (platform) {
case 'win':

View File

@@ -1,19 +1,14 @@
const electron = require('electron')
const app = electron.app
const Menu = electron.Menu
var finderWindow = null
app.on('ready', function () {
if (process.platform === 'darwin') {
app.dock.hide()
}
// var template = require('./finder-menu')
// var menu = Menu.buildFromTemplate(template)
// Menu.setApplicationMenu(menu)
/* eslint-disable */
finderWindow = require('./finder-window')
/* eslint-enable */
})
module.exports = app

View File

@@ -1,84 +0,0 @@
const electron = require('electron')
const BrowserWindow = electron.BrowserWindow
const OSX = process.platform === 'darwin'
// const WIN = process.platform === 'win32'
var edit = {
label: 'Edit',
submenu: [
{
label: 'Undo',
accelerator: 'Command+Z',
selector: 'undo:'
},
{
label: 'Redo',
accelerator: 'Shift+Command+Z',
selector: 'redo:'
},
{
type: 'separator'
},
{
label: 'Cut',
accelerator: 'Command+X',
selector: 'cut:'
},
{
label: 'Copy',
accelerator: 'Command+C',
selector: 'copy:'
},
{
label: 'Paste',
accelerator: 'Command+V',
selector: 'paste:'
},
{
label: 'Select All',
accelerator: 'Command+A',
selector: 'selectAll:'
}
]
}
var view = {
label: 'View',
submenu: [
{
label: 'Focus Search',
accelerator: 'Control + Alt + F',
click: function () {
console.log('focus find')
}
},
{
type: 'separator'
},
{
label: 'Toggle Markdown Preview',
accelerator: OSX ? 'Command + P' : 'Ctrl + P',
click: function () {
console.log('markdown')
}
},
{
type: 'separator'
},
{
label: 'Reload',
accelerator: (function () {
if (process.platform === 'darwin') return 'Command+R'
else return 'Ctrl+R'
})(),
click: function () {
BrowserWindow.getFocusedWindow().reload()
}
}
]
}
module.exports = process.platform === 'darwin'
? [edit, view]
: [view]

View File

@@ -1,6 +1,5 @@
const electron = require('electron')
const { app } = electron
const { systemPreferences } = electron
const BrowserWindow = electron.BrowserWindow
const Menu = electron.Menu
const MenuItem = electron.MenuItem
@@ -45,13 +44,9 @@ finderWindow.on('close', function (e) {
finderWindow.hide()
})
var trayIcon = process.platform === 'darwin'
? !systemPreferences.isDarkMode()
? path.join(__dirname, '../resources/tray-icon-default.png')
: path.join(__dirname, '../resources/tray-icon-dark.png')
: process.platform === 'win32'
? path.join(__dirname, '../resources/tray-icon-dark.png')
: path.join(__dirname, '../resources/tray-icon.png')
var trayIcon = process.platform === 'darwin' || process.platform === 'win32'
? path.join(__dirname, '../resources/tray-icon-default.png')
: path.join(__dirname, '../resources/tray-icon.png')
var appIcon = new Tray(trayIcon)
appIcon.setToolTip('Boostnote')
if (process.platform === 'darwin') {

View File

@@ -8,7 +8,6 @@
<link rel="stylesheet" href="../node_modules/font-awesome/css/font-awesome.min.css" media="screen" charset="utf-8">
<link rel="stylesheet" href="../node_modules/highlight.js/styles/xcode.css" id="hljs-css">
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" href="../node_modules/codemirror/lib/codemirror.css">
@@ -32,23 +31,31 @@
<script src="../node_modules/codemirror/addon/mode/overlay.js"></script>
<script src="../node_modules/codemirror/addon/mode/loadmode.js"></script>
<script src="../node_modules/codemirror/keymap/sublime.js"></script>
<script src="../node_modules/codemirror/keymap/vim.js"></script>
<script src="../node_modules/codemirror/addon/runmode/runmode.js"></script>
<script src="../compiled/katex.js"></script>
<script src="../compiled/react.js"></script>
<script src="../compiled/react-dom.js"></script>
<script src="../compiled/redux.js"></script>
<script src="../compiled/react-redux.js"></script>
<script src="../node_modules/raphael/raphael.min.js"></script>
<script src="../node_modules/flowchart.js/release/flowchart.min.js"></script>
<script src="../node_modules/katex/dist/katex.min.js"></script>
<script src="../node_modules/react/dist/react.min.js"></script>
<script src="../node_modules/react-dom/dist/react-dom.min.js"></script>
<script src="../node_modules/redux/dist/redux.min.js"></script>
<script src="../node_modules/react-redux/dist/react-redux.min.js"></script>
<script>
window._ = require('lodash');
</script>
<script src="../node_modules/js-sequence-diagrams/fucknpm/sequence-diagram-min.js"></script>
<script>
const electron = require('electron')
electron.webFrame.setZoomLevelLimits(1, 1)
const _ = require('lodash')
var scriptUrl = _.find(electron.remote.process.argv, a => a === '--hot')
var scriptUrl = _.find(electron.remote.process.argv, (a) => a === '--hot')
? 'http://localhost:8080/assets/finder.js'
: '../compiled/finder.js'
var scriptEl=document.createElement('script')
scriptEl.setAttribute("type","text/javascript")
scriptEl.setAttribute("src", scriptUrl)
var scriptEl = document.createElement('script')
scriptEl.setAttribute('type', 'text/javascript')
scriptEl.setAttribute('src', scriptUrl)
document.body.appendChild(scriptEl)
</script>
</body>

View File

@@ -2,7 +2,6 @@ const electron = require('electron')
const app = electron.app
const Menu = electron.Menu
const ipc = electron.ipcMain
const autoUpdater = electron.autoUpdater
const path = require('path')
const ChildProcess = require('child_process')
const _ = require('lodash')
@@ -11,9 +10,8 @@ const GhReleases = require('electron-gh-releases')
var ipcServer = null
var mainWindow = null
var finderWindow = null
var shouldQuit = app.makeSingleInstance(function(commandLine, workingDirectory) {
var shouldQuit = app.makeSingleInstance(function (commandLine, workingDirectory) {
if (mainWindow) {
if (process.platform === 'win32') {
mainWindow.minimize()
@@ -26,12 +24,8 @@ var shouldQuit = app.makeSingleInstance(function(commandLine, workingDirectory)
if (shouldQuit) {
app.quit()
return
}
var version = app.getVersion()
var versionText = (version == null || version.length === 0) ? 'DEV version' : 'v' + version
var isUpdateReady = false
var ghReleasesOpts = {
@@ -108,14 +102,12 @@ app.on('ready', function () {
Menu.setApplicationMenu(menu)
break
case 'win32':
/* eslint-disable */
finderWindow = require('./finder-window')
/* eslint-disable */
mainWindow.setMenu(menu)
break
case 'linux':
// Finder is available on cinnamon only.
if (process.env.DESKTOP_SESSION === 'cinnamon') {
finderWindow = require('./finder-window')
}
Menu.setApplicationMenu(menu)
mainWindow.setMenu(menu)
}

View File

@@ -3,11 +3,11 @@ const BrowserWindow = electron.BrowserWindow
const shell = electron.shell
const mainWindow = require('./main-window')
const OSX = process.platform === 'darwin'
const macOS = process.platform === 'darwin'
// const WIN = process.platform === 'win32'
const LINUX = process.platform === 'linux'
var boost = OSX
const boost = macOS
? {
label: 'Boostnote',
submenu: [
@@ -36,6 +36,7 @@ var boost = OSX
type: 'separator'
},
{
label: 'Quit Boostnote',
role: 'quit'
}
]
@@ -49,23 +50,52 @@ var boost = OSX
]
}
var file = {
const file = {
label: 'File',
submenu: [
{
label: 'New Note',
accelerator: OSX ? 'Command + N' : 'Control + N',
click: function () {
accelerator: 'CommandOrControl+N',
click () {
mainWindow.webContents.send('top:new-note')
}
},
{
label: 'Focus Note',
accelerator: 'Control+E',
click () {
mainWindow.webContents.send('detail:focus')
}
},
{
type: 'separator'
},
{
label: 'Export as',
submenu: [
{
label: 'Plain Text (.txt)',
click () {
mainWindow.webContents.send('list:isMarkdownNote')
mainWindow.webContents.send('export:save-text')
}
},
{
label: 'MarkDown (.md)',
click () {
mainWindow.webContents.send('list:isMarkdownNote')
mainWindow.webContents.send('export:save-md')
}
}
]
},
{
type: 'separator'
},
{
label: 'Delete Note',
accelerator: OSX ? 'Control + Backspace' : 'Control + Delete',
click: function () {
accelerator: macOS ? 'Control+Backspace' : 'Control+Delete',
click () {
mainWindow.webContents.send('detail:delete')
}
}
@@ -75,13 +105,12 @@ var file = {
if (LINUX) {
file.submenu.push({
type: 'separator'
})
file.submenu.push({
}, {
role: 'quit'
})
}
var edit = {
const edit = {
label: 'Edit',
submenu: [
{
@@ -120,33 +149,61 @@ var edit = {
]
}
var view = {
const view = {
label: 'View',
submenu: [
{
label: 'Reload',
accelerator: (function () {
if (process.platform === 'darwin') return 'Command+R'
else return 'Ctrl+R'
})(),
click: function () {
accelerator: 'CommandOrControl+R',
click () {
BrowserWindow.getFocusedWindow().reload()
}
},
{
label: 'Toggle Developer Tools',
accelerator: (function () {
if (process.platform === 'darwin') return 'Command+Alt+I'
else return 'Ctrl+Shift+I'
})(),
click: function () {
accelerator: macOS ? 'Command+Alt+I' : 'Control+Shift+I',
click () {
BrowserWindow.getFocusedWindow().toggleDevTools()
}
},
{
type: 'separator'
},
{
label: 'Next Note',
accelerator: 'Control+J',
click () {
mainWindow.webContents.send('list:next')
}
},
{
label: 'Previous Note',
accelerator: 'Control+U',
click () {
mainWindow.webContents.send('list:prior')
}
},
{
label: 'Jump to Top',
accelerator: 'Control+G',
click () {
mainWindow.webContents.send('list:jumpToTop')
}
},
{
type: 'separator'
},
{
label: 'Focus Search',
accelerator: 'Control+S',
click () {
mainWindow.webContents.send('top:focus-search')
}
}
]
}
var window = {
const window = {
label: 'Window',
submenu: [
{
@@ -169,21 +226,21 @@ var window = {
]
}
var help = {
const help = {
label: 'Help',
role: 'help',
submenu: [
{
label: 'Boostnote official site',
click: function () { shell.openExternal('https://b00st.io/') }
click () { shell.openExternal('https://boostnote.io/') }
},
{
label: 'Issue Tracker',
click: function () { shell.openExternal('https://github.com/BoostIO/Boostnote/issues') }
click () { shell.openExternal('https://github.com/BoostIO/Boostnote/issues') }
},
{
label: 'Changelog',
click: function () { shell.openExternal('https://github.com/BoostIO/boost-releases') }
click () { shell.openExternal('https://github.com/BoostIO/boost-releases') }
}
]
}

View File

@@ -2,12 +2,18 @@ const electron = require('electron')
const app = electron.app
const BrowserWindow = electron.BrowserWindow
const path = require('path')
const Config = require('electron-config')
const config = new Config()
var mainWindow = new BrowserWindow({
width: 1080,
height: 720,
minWidth: 420,
var showMenu = process.platform !== 'win32'
const windowSize = config.get('windowsize') || { width: 1080, height: 720 }
const mainWindow = new BrowserWindow({
width: windowSize.width,
height: windowSize.height,
minWidth: 500,
minHeight: 320,
autoHideMenuBar: showMenu,
webPreferences: {
zoomFactor: 1.0,
blinkFeatures: 'OverlayScrollbars'
@@ -34,15 +40,28 @@ mainWindow.webContents.sendInputEvent({
if (process.platform !== 'linux' || process.env.DESKTOP_SESSION === 'cinnamon') {
mainWindow.on('close', function (e) {
e.preventDefault()
if (process.platform === 'win32') {
mainWindow.minimize()
} else {
mainWindow.hide()
if (mainWindow.isFullScreen()) {
mainWindow.once('leave-full-screen', function () {
mainWindow.hide()
})
mainWindow.setFullScreen(false)
} else {
mainWindow.hide()
}
}
e.preventDefault()
})
app.on('before-quit', function (e) {
try {
config.set('windowsize', mainWindow.getBounds())
} catch (e) {
// ignore any errors because an error occurs only on update
// refs: https://github.com/BoostIO/Boostnote/issues/243
}
mainWindow.removeAllListeners()
})
} else {

View File

@@ -5,14 +5,13 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
<link rel="stylesheet" href="../node_modules/font-awesome/css/font-awesome.min.css" media="screen" charset="utf-8">
<link rel="stylesheet" href="../node_modules/highlight.js/styles/xcode.css" id="hljs-css">
<link rel="shortcut icon" href="../resources/favicon.ico">
<link rel="stylesheet" href="../node_modules/codemirror/lib/codemirror.css">
<title>Boostnote</title>
<style>
@font-face {
font-family: 'Lato';
font-family: 'OpenSans';
src: url('../resources/fonts/Lato-Regular.woff2') format('woff2'), /* Modern Browsers */
url('../resources/fonts/Lato-Regular.woff') format('woff'), /* Modern Browsers */
url('../resources/fonts/Lato-Regular.ttf') format('truetype');
@@ -21,6 +20,7 @@
text-rendering: optimizeLegibility;
}
#loadingCover{
background-color: #f4f4f4;
position: absolute;
top: 0;
bottom: 0;
@@ -48,7 +48,7 @@
<body>
<div id="loadingCover">
<img src="../resources/app.png">
<div class='message'>Loading...</div>
<div class='message'><i class="fa fa-spinner fa-spin" spin></i></div>
</div>
<div id="content"></div>
@@ -58,20 +58,27 @@
<script src="../node_modules/codemirror/addon/mode/overlay.js"></script>
<script src="../node_modules/codemirror/addon/mode/loadmode.js"></script>
<script src="../node_modules/codemirror/keymap/sublime.js"></script>
<script src="../node_modules/codemirror/keymap/vim.js"></script>
<script src="../node_modules/codemirror/addon/runmode/runmode.js"></script>
<script src="../node_modules/codemirror/addon/edit/continuelist.js"></script>
<script src="../compiled/katex.js"></script>
<script src="../compiled/react.js"></script>
<script src="../compiled/react-dom.js"></script>
<script src="../compiled/redux.js"></script>
<script src="../compiled/react-redux.js"></script>
<script src="../node_modules/raphael/raphael.min.js"></script>
<script src="../node_modules/flowchart.js/release/flowchart.min.js"></script>
<script>
window._ = require('lodash')
</script>
<script src="../node_modules/js-sequence-diagrams/fucknpm/sequence-diagram-min.js"></script>
<script src="../node_modules/katex/dist/katex.min.js"></script>
<script src="../node_modules/react/dist/react.min.js"></script>
<script src="../node_modules/react-dom/dist/react-dom.min.js"></script>
<script src="../node_modules/redux/dist/redux.min.js"></script>
<script src="../node_modules/react-redux/dist/react-redux.min.js"></script>
<script type='text/javascript'>
const electron = require('electron')
electron.webFrame.setZoomLevelLimits(1, 1)
const _ = require('lodash')
var scriptUrl = _.find(electron.remote.process.argv, (a) => a === '--hot')
var scriptUrl = window._.find(electron.remote.process.argv, (a) => a === '--hot')
? 'http://localhost:8080/assets/main.js'
: '../compiled/main.js'
var scriptEl = document.createElement('script')

View File

@@ -1,11 +0,0 @@
{
"directory": "compiled",
"targets": {
"react": "https://cdnjs.cloudflare.com/ajax/libs/react/15.0.2/react.js",
"react-dom": "https://cdnjs.cloudflare.com/ajax/libs/react/15.0.2/react-dom.js",
"redux": "https://cdnjs.cloudflare.com/ajax/libs/redux/3.5.2/redux.js",
"react-redux": "https://unpkg.com/react-redux@4.4.5/dist/react-redux.min.js",
"katex": "https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/katex.min.js",
"katex-style": "https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/katex.min.css"
}
}

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