mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 10:16:26 +00:00
Compare commits
504 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be1a5b09da | ||
|
|
3de2db4459 | ||
|
|
f2405a5b34 | ||
|
|
94abb8f959 | ||
|
|
2e30db05bc | ||
|
|
c93f3cc5dd | ||
|
|
068f8f2ba9 | ||
|
|
0980c3b012 | ||
|
|
5288d6768f | ||
|
|
34491f4ea4 | ||
|
|
8c73ca8854 | ||
|
|
0786d8eab6 | ||
|
|
209518c815 | ||
|
|
b2753b6457 | ||
|
|
4775a920c0 | ||
|
|
0e94dc8740 | ||
|
|
cf68d202d5 | ||
|
|
d29ba2bf16 | ||
|
|
720686cef5 | ||
|
|
0625c65cf0 | ||
|
|
acaefe22d1 | ||
|
|
df1f083ebf | ||
|
|
5a1dfc2ca9 | ||
|
|
d84894f1bf | ||
|
|
0fdc444c4c | ||
|
|
4d216c6f13 | ||
|
|
1c0af8eede | ||
|
|
f443f9264a | ||
|
|
d9b2981327 | ||
|
|
68e36d2a6d | ||
|
|
68b91bf98c | ||
|
|
b91ddfad05 | ||
|
|
a110cbfb5d | ||
|
|
d69f45b0c9 | ||
|
|
07df26d5c4 | ||
|
|
d24bcb7f86 | ||
|
|
9f383ba491 | ||
|
|
c38a76d587 | ||
|
|
994ca5dd02 | ||
|
|
9281f8f6cb | ||
|
|
324f579474 | ||
|
|
10bd2d4547 | ||
|
|
d1942868e4 | ||
|
|
a409b3e48d | ||
|
|
21004aab6a | ||
|
|
eaf88c6491 | ||
|
|
17dcd1b6f1 | ||
|
|
244a06eea6 | ||
|
|
afb13af7a1 | ||
|
|
ff9b935e98 | ||
|
|
4250d6fe52 | ||
|
|
5bc2094f10 | ||
|
|
552653c0ed | ||
|
|
c9bbc61c95 | ||
|
|
41a04aa3f1 | ||
|
|
cd421c4662 | ||
|
|
063e2e02bd | ||
|
|
0c3019b52e | ||
|
|
2ee2494dc4 | ||
|
|
df6ff1fffe | ||
|
|
0d2e6a6a12 | ||
|
|
79ed55a76f | ||
|
|
cbe58b9437 | ||
|
|
afc729b1c3 | ||
|
|
5d0cb0302e | ||
|
|
29e0d121cd | ||
|
|
48ca13f82c | ||
|
|
278061e4f1 | ||
|
|
186a815821 | ||
|
|
2fea9eb874 | ||
|
|
f8b6453be9 | ||
|
|
be625f8884 | ||
|
|
2271def5d3 | ||
|
|
275a8ea7cc | ||
|
|
dc236f33b1 | ||
|
|
678d739e75 | ||
|
|
8fe05a4c24 | ||
|
|
77adfdb9f0 | ||
|
|
30c94028fb | ||
|
|
b5bf0780fa | ||
|
|
ad838d82ee | ||
|
|
d5ec0c0cdd | ||
|
|
ff29f1e0c6 | ||
|
|
1f58698a04 | ||
|
|
a275f331d0 | ||
|
|
0862c6e059 | ||
|
|
46fddfd26c | ||
|
|
c547ccb4cb | ||
|
|
86e82fb149 | ||
|
|
00a284bfbd | ||
|
|
f6fbec0a2e | ||
|
|
b24c06bee6 | ||
|
|
95e7f4f645 | ||
|
|
4b75d501f5 | ||
|
|
b28d5c8b25 | ||
|
|
86e61661e6 | ||
|
|
cdd5717e63 | ||
|
|
42bd7fb4fb | ||
|
|
66e478a001 | ||
|
|
c8259abcac | ||
|
|
d6d16a63a4 | ||
|
|
df8d1f0714 | ||
|
|
fbbc6411c3 | ||
|
|
bc1e94fcab | ||
|
|
418439e3d5 | ||
|
|
46cbd04ba7 | ||
|
|
0ade6d9ece | ||
|
|
823599192f | ||
|
|
9496ab88f7 | ||
|
|
290e6ab170 | ||
|
|
a9e3572f4f | ||
|
|
92b2b7dde3 | ||
|
|
dad1e40234 | ||
|
|
b75c8b0373 | ||
|
|
fc4c471a87 | ||
|
|
24de71f240 | ||
|
|
805c39e60c | ||
|
|
10e75041e8 | ||
|
|
2364348df4 | ||
|
|
e643443660 | ||
|
|
d72e876b23 | ||
|
|
f3612774ba | ||
|
|
67d8b02c49 | ||
|
|
7abf53009a | ||
|
|
90bb4632b6 | ||
|
|
630da00235 | ||
|
|
245e0dd7ee | ||
|
|
824e288a80 | ||
|
|
99228f2e60 | ||
|
|
0f71139eba | ||
|
|
2bbe7056d1 | ||
|
|
005d8f84fd | ||
|
|
908cd7a890 | ||
|
|
d4865adf6a | ||
|
|
20411a2fd5 | ||
|
|
19f8930f5a | ||
|
|
ffc4ca1dd4 | ||
|
|
0bc9c6fb5a | ||
|
|
983f453afd | ||
|
|
60a0293495 | ||
|
|
4807d22763 | ||
|
|
e8d451bcbb | ||
|
|
4809bb6f06 | ||
|
|
d6d694cf66 | ||
|
|
132e3c3088 | ||
|
|
3c7ff78549 | ||
|
|
adbdc2cb1c | ||
|
|
e52b74bbc9 | ||
|
|
575f1b4b33 | ||
|
|
a528c99900 | ||
|
|
e6047ed383 | ||
|
|
381b7d960a | ||
|
|
045a8bde22 | ||
|
|
e528182c2a | ||
|
|
b86cdb461a | ||
|
|
7265f76770 | ||
|
|
2ed092279d | ||
|
|
7d71819be0 | ||
|
|
e848c74511 | ||
|
|
968ed146b2 | ||
|
|
5e03f12875 | ||
|
|
09f8e5f25a | ||
|
|
89f4ed3006 | ||
|
|
8d14a9557d | ||
|
|
513042d769 | ||
|
|
c28980c2a9 | ||
|
|
1c31ff4e98 | ||
|
|
7c9d3904b3 | ||
|
|
e23707f0a0 | ||
|
|
a952b18b96 | ||
|
|
35cc07bf63 | ||
|
|
118bf18434 | ||
|
|
34da15208b | ||
|
|
e0dc62c00b | ||
|
|
b58df2f172 | ||
|
|
90846fab81 | ||
|
|
efd80d5c0c | ||
|
|
e37e28a22e | ||
|
|
a1e71b318c | ||
|
|
aee6541d45 | ||
|
|
50ad5e3791 | ||
|
|
b34d72f21a | ||
|
|
e5ae420ef6 | ||
|
|
7269750264 | ||
|
|
33fe3ff733 | ||
|
|
aa77180957 | ||
|
|
3d80b6a4cd | ||
|
|
d76f9243a3 | ||
|
|
88f1a0d5cd | ||
|
|
26c435d6da | ||
|
|
e66abdea2d | ||
|
|
c7d2eeb71a | ||
|
|
0e8d681954 | ||
|
|
433d110cf0 | ||
|
|
4a514cd7bd | ||
|
|
417fee16bd | ||
|
|
49a821d9ee | ||
|
|
6a5ce098e0 | ||
|
|
1af73eebea | ||
|
|
b7ba29ac92 | ||
|
|
133c2ec308 | ||
|
|
a70fe1bba8 | ||
|
|
6dcd653eac | ||
|
|
db2f90b1ce | ||
|
|
60e5665133 | ||
|
|
7aa982849f | ||
|
|
d94f7626c2 | ||
|
|
549c289f81 | ||
|
|
b35953d1f9 | ||
|
|
941c4aeb19 | ||
|
|
11f7fcbaef | ||
|
|
6b8488ae0f | ||
|
|
ee5268a07e | ||
|
|
28bc331318 | ||
|
|
098153b6ba | ||
|
|
878f31e91e | ||
|
|
b40d09fa86 | ||
|
|
eb48f48f6b | ||
|
|
7961008500 | ||
|
|
ff87c6b226 | ||
|
|
0c2807a08b | ||
|
|
f0cf369317 | ||
|
|
5e9954c060 | ||
|
|
0c7bdf20af | ||
|
|
9c1179a6f9 | ||
|
|
43cb290c80 | ||
|
|
f8b7b7df9f | ||
|
|
b73f0a8012 | ||
|
|
75b2c7bd2e | ||
|
|
5fd9866eef | ||
|
|
4e7204bdbc | ||
|
|
ff7024e38f | ||
|
|
8c11a0b42d | ||
|
|
2df295dc1d | ||
|
|
b695d27817 | ||
|
|
8e2fd300f6 | ||
|
|
1722e103fc | ||
|
|
71464112ce | ||
|
|
003d8a1b21 | ||
|
|
adf81175f3 | ||
|
|
39274ce483 | ||
|
|
1daf07edeb | ||
|
|
cd2dc471c7 | ||
|
|
6229ca7ac9 | ||
|
|
10043cc755 | ||
|
|
e60a5430b4 | ||
|
|
f7e0cb655f | ||
|
|
04097ecfcd | ||
|
|
2222192bcd | ||
|
|
ae93c38d46 | ||
|
|
9ff9dcbe6d | ||
|
|
94d442af7d | ||
|
|
6a711d6a71 | ||
|
|
9d8e71aeb3 | ||
|
|
cfeeba209e | ||
|
|
455029851a | ||
|
|
d0f7baaad0 | ||
|
|
e3fb236139 | ||
|
|
42296e421a | ||
|
|
c6f4ed7c8f | ||
|
|
e1fb36d64d | ||
|
|
48cf695e11 | ||
|
|
5b0e0c71a0 | ||
|
|
c1a76b6fb4 | ||
|
|
945a6306ec | ||
|
|
313bacf9dc | ||
|
|
9027f48dda | ||
|
|
eea8f7cdf4 | ||
|
|
ffef239aa7 | ||
|
|
50fc15feea | ||
|
|
2d7a37c872 | ||
|
|
db468fc095 | ||
|
|
9a9f0035c2 | ||
|
|
b9270cd040 | ||
|
|
65b1bd18c4 | ||
|
|
c87ecc3d40 | ||
|
|
e39e1648f9 | ||
|
|
091d2618a2 | ||
|
|
d039b17715 | ||
|
|
e350dca72c | ||
|
|
c07e334f03 | ||
|
|
1ccfd8e392 | ||
|
|
d22c40f0a5 | ||
|
|
3d37db6e54 | ||
|
|
22bd92916b | ||
|
|
de303cf072 | ||
|
|
b22aad0678 | ||
|
|
bf02f9b256 | ||
|
|
6440ab423e | ||
|
|
fceab73226 | ||
|
|
fded0ad3e8 | ||
|
|
294eb64686 | ||
|
|
851b28c482 | ||
|
|
63fa2f1149 | ||
|
|
816d8decbd | ||
|
|
85b4eedcd6 | ||
|
|
901f40a669 | ||
|
|
bae5f202a5 | ||
|
|
131f6780c2 | ||
|
|
a0e067cacf | ||
|
|
8cdcf537be | ||
|
|
575f5f160c | ||
|
|
d8fbac584c | ||
|
|
b73e1b04dc | ||
|
|
3dd49c287d | ||
|
|
6ce6a7036b | ||
|
|
c120633f14 | ||
|
|
6e84b24309 | ||
|
|
343e35bb54 | ||
|
|
09cf94d807 | ||
|
|
a5531e20f2 | ||
|
|
0f311120af | ||
|
|
614506cada | ||
|
|
7891d14a0a | ||
|
|
2df12b6891 | ||
|
|
97b42d6be1 | ||
|
|
39baadeb04 | ||
|
|
a6f5452a85 | ||
|
|
29dc3bd550 | ||
|
|
e103605956 | ||
|
|
c510c2e540 | ||
|
|
41d65e4132 | ||
|
|
b6cb532568 | ||
|
|
a034ea3a05 | ||
|
|
adeb45a9ce | ||
|
|
4ada755793 | ||
|
|
c4be052a49 | ||
|
|
54c2d7bac9 | ||
|
|
233ab17992 | ||
|
|
e251ec64dc | ||
|
|
32bd6d76ee | ||
|
|
3fc17634aa | ||
|
|
555d725e7b | ||
|
|
35416796b5 | ||
|
|
6c737fe25f | ||
|
|
1b58e320aa | ||
|
|
658a90bf15 | ||
|
|
d092e75f3c | ||
|
|
162fae19cc | ||
|
|
58f5035ec6 | ||
|
|
c5076e4e95 | ||
|
|
28ef1e625c | ||
|
|
97441ccacb | ||
|
|
6b29aed6c4 | ||
|
|
31eb9caee4 | ||
|
|
64cf34e673 | ||
|
|
8996ebb819 | ||
|
|
a36c62044b | ||
|
|
13418109ea | ||
|
|
fe7c05aaa5 | ||
|
|
116e27e0db | ||
|
|
6b135afe1a | ||
|
|
7a9c4951a2 | ||
|
|
041a51a70f | ||
|
|
7b4ff9906e | ||
|
|
11ab5c7598 | ||
|
|
64d53c611b | ||
|
|
657d69a0fb | ||
|
|
62d39e6715 | ||
|
|
a27d8192ee | ||
|
|
41b69afe03 | ||
|
|
54b5af0741 | ||
|
|
d4060f8a5a | ||
|
|
2935d41aba | ||
|
|
af6cd10e28 | ||
|
|
435c80d870 | ||
|
|
775cec32da | ||
|
|
e8cc7abadc | ||
|
|
c1051afdc0 | ||
|
|
573d3ce11e | ||
|
|
0a89dcc6d8 | ||
|
|
d45033ae8e | ||
|
|
313e8b8c98 | ||
|
|
25685dc8b0 | ||
|
|
d6a78dfe28 | ||
|
|
de45852790 | ||
|
|
c6a505cb44 | ||
|
|
44427a40b7 | ||
|
|
8a2ac08c0a | ||
|
|
7babf66d5f | ||
|
|
50cd0b794b | ||
|
|
720f07f62c | ||
|
|
6daffbcafa | ||
|
|
b76729e836 | ||
|
|
b2294e0fc9 | ||
|
|
3559737e8e | ||
|
|
40b7ce607b | ||
|
|
1de67a00cb | ||
|
|
6b4b44dba8 | ||
|
|
c424cc5d33 | ||
|
|
5b71d010b4 | ||
|
|
b9457d3e33 | ||
|
|
60e267409c | ||
|
|
e6a2521143 | ||
|
|
ae36ed2b46 | ||
|
|
fb2ed81fd3 | ||
|
|
a74651b515 | ||
|
|
6904c192e4 | ||
|
|
6540d2670c | ||
|
|
966ba06bc4 | ||
|
|
3b4921b848 | ||
|
|
b11e10ac07 | ||
|
|
2ec7ba04f5 | ||
|
|
095910d156 | ||
|
|
c39463aea8 | ||
|
|
87e47c7ffb | ||
|
|
359f6734c5 | ||
|
|
1d3e71cf49 | ||
|
|
1ab449cecf | ||
|
|
44dd609134 | ||
|
|
1e8e161a33 | ||
|
|
c56d232e58 | ||
|
|
8315b75587 | ||
|
|
562b0592af | ||
|
|
1fd1bed01a | ||
|
|
4f116cba34 | ||
|
|
9d1d57f183 | ||
|
|
6feeee8933 | ||
|
|
5541c0dc38 | ||
|
|
4a8054faed | ||
|
|
bbced7be25 | ||
|
|
893a92c87b | ||
|
|
4055ce19cd | ||
|
|
bcf27233bc | ||
|
|
45111e1610 | ||
|
|
2af86dfa3e | ||
|
|
1b474e1c28 | ||
|
|
c4370694cc | ||
|
|
91f24d96b9 | ||
|
|
bb0b74e889 | ||
|
|
525ab900bd | ||
|
|
31c04de7b6 | ||
|
|
dea0c4287b | ||
|
|
cec4b3132c | ||
|
|
f3ed22dd51 | ||
|
|
6aa9104076 | ||
|
|
e7fd18967b | ||
|
|
8a5558db55 | ||
|
|
4767f15e9b | ||
|
|
b7ca4668e9 | ||
|
|
70e637fada | ||
|
|
459b0ff030 | ||
|
|
2903788fd4 | ||
|
|
af0fdb9277 | ||
|
|
41a58583dc | ||
|
|
c80a26fe0b | ||
|
|
806c3bbaf9 | ||
|
|
fe1c197138 | ||
|
|
b577ca2bc2 | ||
|
|
70a97a6a2a | ||
|
|
034f46792b | ||
|
|
3dc1b59753 | ||
|
|
98b761f1d1 | ||
|
|
712301436d | ||
|
|
4243afb033 | ||
|
|
0f43485606 | ||
|
|
b91b88f16e | ||
|
|
2f2c500e4a | ||
|
|
7065fad69b | ||
|
|
6fcbca6b10 | ||
|
|
93b15f2a7a | ||
|
|
df9d8ff735 | ||
|
|
fda17e044e | ||
|
|
b4e54fc149 | ||
|
|
48514d1020 | ||
|
|
49a4ec5e16 | ||
|
|
c3e92b3b81 | ||
|
|
e78492983a | ||
|
|
0f3230110c | ||
|
|
65573bd4db | ||
|
|
928df018dc | ||
|
|
b2187b72ab | ||
|
|
aae2bddd32 | ||
|
|
b6eddf0821 | ||
|
|
fac0abaed6 | ||
|
|
a6bd239592 | ||
|
|
7845bbd881 | ||
|
|
68bc440749 | ||
|
|
6dbe3cec69 | ||
|
|
850c339bb3 | ||
|
|
57835d0e32 | ||
|
|
ac2c50c8bc | ||
|
|
7296cbe4ec | ||
|
|
16061a7eba | ||
|
|
566fe92589 | ||
|
|
83cef13f1c | ||
|
|
4bb9533049 | ||
|
|
d07c62e266 | ||
|
|
8beb661af4 | ||
|
|
5a201dd1b9 | ||
|
|
aa0ad3bb70 | ||
|
|
f7fb531902 | ||
|
|
c65db4e2b0 | ||
|
|
b32b38bb0d | ||
|
|
d6171dc502 | ||
|
|
7b5a7aabed | ||
|
|
77eb19af40 | ||
|
|
e68d535fa2 | ||
|
|
6e5f6cc739 | ||
|
|
bbeeeccb31 | ||
|
|
e9525fae22 | ||
|
|
672d409bf2 | ||
|
|
74ee6ae6ce | ||
|
|
743b220953 |
@@ -1,6 +1,10 @@
|
|||||||
{
|
{
|
||||||
"extends": ["standard", "standard-jsx"],
|
"extends": ["standard", "standard-jsx"],
|
||||||
"rules": {
|
"rules": {
|
||||||
"no-useless-escape": 0
|
"no-useless-escape": 0,
|
||||||
|
"prefer-const": "warn",
|
||||||
|
"no-unused-vars": "warn",
|
||||||
|
"no-undef": "warn",
|
||||||
|
"no-lone-blocks": "warn"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
30
.travis.yml
30
.travis.yml
@@ -1,6 +1,26 @@
|
|||||||
language: node_js
|
language: node_js
|
||||||
node_js:
|
# To fix the npm version in 4.x
|
||||||
- 'stable'
|
# refs: https://github.com/travis-ci/travis-ci/issues/4653#issuecomment-194051953
|
||||||
- 'lts/*'
|
before_install: 'if [[ `npm -v` != 4* ]]; then npm i -g npm@4; fi'
|
||||||
|
matrix:
|
||||||
script: npm run lint && npm run test
|
include:
|
||||||
|
- os: osx
|
||||||
|
install:
|
||||||
|
- 'if [[ ${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH} = "master" ]]; then yarn; fi'
|
||||||
|
node_js:
|
||||||
|
- 'stable'
|
||||||
|
- 'lts/*'
|
||||||
|
script:
|
||||||
|
- 'if [[ ${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH} = "master" && ${TRAVIS_NODE_VERSION} = "stable" ]]; then
|
||||||
|
npm run lint;
|
||||||
|
npm run test;
|
||||||
|
./script/e2e-runner.sh;
|
||||||
|
fi'
|
||||||
|
- os: linux
|
||||||
|
node_js:
|
||||||
|
- 'stable'
|
||||||
|
- 'lts/*'
|
||||||
|
script:
|
||||||
|
- 'npm run lint'
|
||||||
|
- 'npm run test'
|
||||||
|
- 'if [[ ${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH} = "master" && ${TRAVIS_NODE_VERSION} = "stable" ]]; then ./script/e2e-runner.sh; fi'
|
||||||
|
|||||||
5
Backers.md
Normal file
5
Backers.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
Become a [backer](https://salt.bountysource.com/teams/boostnote) and support Boostnote!
|
||||||
|
You can support Boostnote from $ 5 a month!
|
||||||
|
|
||||||
|
# Backers
|
||||||
|
[Kazu Yokomizo](https://twitter.com/kazup_bot)
|
||||||
4
LICENSE
4
LICENSE
@@ -1,8 +1,8 @@
|
|||||||
GPL-3.0
|
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
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import React, { PropTypes } from 'react'
|
|||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
import CodeMirror from 'codemirror'
|
import CodeMirror from 'codemirror'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
|
import copyImage from 'browser/main/lib/dataApi/copyImage'
|
||||||
|
|
||||||
CodeMirror.modeURL = '../node_modules/codemirror/mode/%N/%N.js'
|
CodeMirror.modeURL = '../node_modules/codemirror/mode/%N/%N.js'
|
||||||
|
|
||||||
@@ -55,19 +56,40 @@ export default class CodeEditor extends React.Component {
|
|||||||
indentWithTabs: this.props.indentType !== 'space',
|
indentWithTabs: this.props.indentType !== 'space',
|
||||||
keyMap: this.props.keyMap,
|
keyMap: this.props.keyMap,
|
||||||
inputStyle: 'textarea',
|
inputStyle: 'textarea',
|
||||||
|
dragDrop: false,
|
||||||
extraKeys: {
|
extraKeys: {
|
||||||
Tab: function (cm) {
|
Tab: function (cm) {
|
||||||
|
const cursor = cm.getCursor()
|
||||||
|
const line = cm.getLine(cursor.line)
|
||||||
if (cm.somethingSelected()) cm.indentSelection('add')
|
if (cm.somethingSelected()) cm.indentSelection('add')
|
||||||
else {
|
else {
|
||||||
if (cm.getOption('indentWithTabs')) {
|
const tabs = cm.getOption('indentWithTabs')
|
||||||
cm.execCommand('insertTab')
|
if (line.trimLeft() === '- ' || line.trimLeft() === '* ' || line.trimLeft() === '+ ') {
|
||||||
|
cm.execCommand('goLineStart')
|
||||||
|
if (tabs) {
|
||||||
|
cm.execCommand('insertTab')
|
||||||
|
} else {
|
||||||
|
cm.execCommand('insertSoftTab')
|
||||||
|
}
|
||||||
|
cm.execCommand('goLineEnd')
|
||||||
} else {
|
} else {
|
||||||
cm.execCommand('insertSoftTab')
|
if (tabs) {
|
||||||
|
cm.execCommand('insertTab')
|
||||||
|
} else {
|
||||||
|
cm.execCommand('insertSoftTab')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'Cmd-T': function (cm) {
|
'Cmd-T': function (cm) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
|
},
|
||||||
|
Enter: 'newlineAndIndentContinueMarkdownList',
|
||||||
|
'Ctrl-C': (cm) => {
|
||||||
|
if (cm.getOption('keyMap').substr(0, 3) === 'vim') {
|
||||||
|
document.execCommand('copy')
|
||||||
|
}
|
||||||
|
return CodeMirror.Pass
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -156,6 +178,7 @@ export default class CodeEditor extends React.Component {
|
|||||||
this.editor.setValue(this.props.value)
|
this.editor.setValue(this.props.value)
|
||||||
this.editor.clearHistory()
|
this.editor.clearHistory()
|
||||||
this.editor.on('change', this.changeHandler)
|
this.editor.on('change', this.changeHandler)
|
||||||
|
this.editor.refresh()
|
||||||
}
|
}
|
||||||
|
|
||||||
setValue (value) {
|
setValue (value) {
|
||||||
@@ -166,15 +189,18 @@ export default class CodeEditor extends React.Component {
|
|||||||
|
|
||||||
handleDropImage (e) {
|
handleDropImage (e) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
let imagePath = e.dataTransfer.files[0].path
|
const imagePath = e.dataTransfer.files[0].path
|
||||||
let filename = path.basename(imagePath)
|
const filename = path.basename(imagePath)
|
||||||
let imageMd = ``
|
|
||||||
this.insertImage(imageMd)
|
copyImage(imagePath, this.props.storageKey).then((imagePathInTheStorage) => {
|
||||||
|
const imageMd = ``
|
||||||
|
this.insertImageMd(imageMd)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
insertImage (imageMd) {
|
insertImageMd (imageMd) {
|
||||||
const textarea = this.editor.getInputField()
|
const cm = this.editor
|
||||||
textarea.value = textarea.value.substr(0, textarea.selectionStart) + imageMd + textarea.value.substr(textarea.selectionEnd)
|
cm.setValue(cm.getValue() + imageMd)
|
||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
|
|||||||
@@ -3,22 +3,31 @@ import CSSModules from 'browser/lib/CSSModules'
|
|||||||
import styles from './MarkdownEditor.styl'
|
import styles from './MarkdownEditor.styl'
|
||||||
import CodeEditor from 'browser/components/CodeEditor'
|
import CodeEditor from 'browser/components/CodeEditor'
|
||||||
import MarkdownPreview from 'browser/components/MarkdownPreview'
|
import MarkdownPreview from 'browser/components/MarkdownPreview'
|
||||||
|
import eventEmitter from 'browser/main/lib/eventEmitter'
|
||||||
|
|
||||||
class MarkdownEditor extends React.Component {
|
class MarkdownEditor extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
super(props)
|
super(props)
|
||||||
|
|
||||||
this.escapeFromEditor = ['Control', 'w']
|
// char codes for ctrl + w
|
||||||
|
this.escapeFromEditor = [17, 87]
|
||||||
|
|
||||||
|
// ctrl + shift + ;
|
||||||
|
this.supportMdSelectionBold = [16, 17, 186]
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
status: 'PREVIEW',
|
status: 'PREVIEW',
|
||||||
renderValue: props.value,
|
renderValue: props.value,
|
||||||
keyPressed: {}
|
keyPressed: new Set(),
|
||||||
|
isLocked: false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.lockEditorCode = () => this.handleLockEditor()
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
this.value = this.refs.code.value
|
this.value = this.refs.code.value
|
||||||
|
eventEmitter.on('editor:lock', this.lockEditorCode)
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate () {
|
componentDidUpdate () {
|
||||||
@@ -33,6 +42,7 @@ class MarkdownEditor extends React.Component {
|
|||||||
|
|
||||||
componentWillUnmount () {
|
componentWillUnmount () {
|
||||||
this.cancelQueue()
|
this.cancelQueue()
|
||||||
|
eventEmitter.off('editor:lock', this.lockEditorCode)
|
||||||
}
|
}
|
||||||
|
|
||||||
queueRendering (value) {
|
queueRendering (value) {
|
||||||
@@ -72,12 +82,14 @@ class MarkdownEditor extends React.Component {
|
|||||||
this.refs.code.blur()
|
this.refs.code.blur()
|
||||||
this.refs.preview.focus()
|
this.refs.preview.focus()
|
||||||
}
|
}
|
||||||
|
eventEmitter.emit('topbar:togglelockbutton', this.state.status)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
handleBlur (e) {
|
handleBlur (e) {
|
||||||
this.setState({ keyPressed: [] })
|
if (this.state.isLocked) return
|
||||||
|
this.setState({ keyPressed: new Set() })
|
||||||
let { config } = this.props
|
let { config } = this.props
|
||||||
if (config.editor.switchPreview === 'BLUR') {
|
if (config.editor.switchPreview === 'BLUR') {
|
||||||
let cursorPosition = this.refs.code.editor.getCursor()
|
let cursorPosition = this.refs.code.editor.getCursor()
|
||||||
@@ -87,6 +99,7 @@ class MarkdownEditor extends React.Component {
|
|||||||
this.refs.preview.focus()
|
this.refs.preview.focus()
|
||||||
this.refs.preview.scrollTo(cursorPosition.line)
|
this.refs.preview.scrollTo(cursorPosition.line)
|
||||||
})
|
})
|
||||||
|
eventEmitter.emit('topbar:togglelockbutton', this.state.status)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,6 +115,7 @@ class MarkdownEditor extends React.Component {
|
|||||||
}, () => {
|
}, () => {
|
||||||
this.refs.code.focus()
|
this.refs.code.focus()
|
||||||
})
|
})
|
||||||
|
eventEmitter.emit('topbar:togglelockbutton', this.state.status)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,6 +152,7 @@ class MarkdownEditor extends React.Component {
|
|||||||
} else {
|
} else {
|
||||||
this.refs.code.focus()
|
this.refs.code.focus()
|
||||||
}
|
}
|
||||||
|
eventEmitter.emit('topbar:togglelockbutton', this.state.status)
|
||||||
}
|
}
|
||||||
|
|
||||||
reload () {
|
reload () {
|
||||||
@@ -146,26 +161,49 @@ class MarkdownEditor extends React.Component {
|
|||||||
this.renderPreview(this.props.value)
|
this.renderPreview(this.props.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
handleKeyDown(e) {
|
handleKeyDown (e) {
|
||||||
const keyPressed = Object.assign(this.state.keyPressed, {
|
if (this.state.status !== 'CODE') return false
|
||||||
[e.key]: true
|
const keyPressed = this.state.keyPressed
|
||||||
})
|
keyPressed.add(e.keyCode)
|
||||||
this.setState({ keyPressed })
|
this.setState({ keyPressed })
|
||||||
let isNoteHandlerKey = (el) => { return this.state.keyPressed[el] }
|
let isNoteHandlerKey = (el) => { return keyPressed.has(el) }
|
||||||
if (this.state.status === 'CODE' && this.escapeFromEditor.every(isNoteHandlerKey)) {
|
if (keyPressed.size === this.escapeFromEditor.length &&
|
||||||
|
!this.state.isLocked && this.state.status === 'CODE' &&
|
||||||
|
this.escapeFromEditor.every(isNoteHandlerKey)) {
|
||||||
document.activeElement.blur()
|
document.activeElement.blur()
|
||||||
}
|
}
|
||||||
|
if (keyPressed.size === this.supportMdSelectionBold.length && 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) {
|
handleKeyUp (e) {
|
||||||
const keyPressed = Object.assign(this.state.keyPressed, {
|
const keyPressed = this.state.keyPressed
|
||||||
[e.key]: false
|
keyPressed.delete(e.keyCode)
|
||||||
})
|
|
||||||
this.setState({ keyPressed })
|
this.setState({ keyPressed })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleLockEditor () {
|
||||||
|
this.setState({ isLocked: !this.state.isLocked })
|
||||||
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
let { className, value, config } = this.props
|
let { className, value, config, storageKey } = this.props
|
||||||
|
|
||||||
let editorFontSize = parseInt(config.editor.fontSize, 10)
|
let editorFontSize = parseInt(config.editor.fontSize, 10)
|
||||||
if (!(editorFontSize > 0 && editorFontSize < 101)) editorFontSize = 14
|
if (!(editorFontSize > 0 && editorFontSize < 101)) editorFontSize = 14
|
||||||
@@ -185,7 +223,10 @@ class MarkdownEditor extends React.Component {
|
|||||||
onKeyDown={(e) => this.handleKeyDown(e)}
|
onKeyDown={(e) => this.handleKeyDown(e)}
|
||||||
onKeyUp={(e) => this.handleKeyUp(e)}
|
onKeyUp={(e) => this.handleKeyUp(e)}
|
||||||
>
|
>
|
||||||
<CodeEditor styleName='codeEditor'
|
<CodeEditor styleName={this.state.status === 'CODE'
|
||||||
|
? 'codeEditor'
|
||||||
|
: 'codeEditor--hide'
|
||||||
|
}
|
||||||
ref='code'
|
ref='code'
|
||||||
mode='GitHub Flavored Markdown'
|
mode='GitHub Flavored Markdown'
|
||||||
value={value}
|
value={value}
|
||||||
@@ -195,6 +236,7 @@ class MarkdownEditor extends React.Component {
|
|||||||
fontSize={editorFontSize}
|
fontSize={editorFontSize}
|
||||||
indentType={config.editor.indentType}
|
indentType={config.editor.indentType}
|
||||||
indentSize={editorIndentSize}
|
indentSize={editorIndentSize}
|
||||||
|
storageKey={storageKey}
|
||||||
onChange={(e) => this.handleChange(e)}
|
onChange={(e) => this.handleChange(e)}
|
||||||
onBlur={(e) => this.handleBlur(e)}
|
onBlur={(e) => this.handleBlur(e)}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -4,8 +4,14 @@
|
|||||||
.codeEditor
|
.codeEditor
|
||||||
absolute top bottom left right
|
absolute top bottom left right
|
||||||
|
|
||||||
|
.hide
|
||||||
|
z-index 0
|
||||||
|
opacity 0
|
||||||
|
pointer-events none
|
||||||
|
|
||||||
.codeEditor--hide
|
.codeEditor--hide
|
||||||
@extend .codeEditor
|
@extend .codeEditor
|
||||||
|
@extend .hide
|
||||||
|
|
||||||
.preview
|
.preview
|
||||||
display block
|
display block
|
||||||
@@ -17,7 +23,5 @@
|
|||||||
|
|
||||||
.preview--hide
|
.preview--hide
|
||||||
@extend .preview
|
@extend .preview
|
||||||
z-index 0
|
@extend .hide
|
||||||
opacity 0
|
|
||||||
pointer-events none
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,21 +8,8 @@ import flowchart from 'flowchart'
|
|||||||
import SequenceDiagram from 'js-sequence-diagrams'
|
import SequenceDiagram from 'js-sequence-diagrams'
|
||||||
import eventEmitter from 'browser/main/lib/eventEmitter'
|
import eventEmitter from 'browser/main/lib/eventEmitter'
|
||||||
import fs from 'fs'
|
import fs from 'fs'
|
||||||
|
import htmlTextHelper from 'browser/lib/htmlTextHelper'
|
||||||
function decodeHTMLEntities (text) {
|
import copy from 'copy-to-clipboard'
|
||||||
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 { remote } = require('electron')
|
||||||
const { app } = remote
|
const { app } = remote
|
||||||
@@ -60,6 +47,26 @@ code {
|
|||||||
font-family: ${codeBlockFontFamily.join(', ')};
|
font-family: ${codeBlockFontFamily.join(', ')};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.clipboardButton {
|
||||||
|
color: rgba(147,147,149,0.8);;
|
||||||
|
fill: rgba(147,147,149,1);;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin: 7px;
|
||||||
|
border: none;
|
||||||
|
background-color: transparent;
|
||||||
|
outline: none;
|
||||||
|
height: 32px;
|
||||||
|
width: 32px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clipboardButton:hover {
|
||||||
|
transition: 0.2s;
|
||||||
|
color: #939395;
|
||||||
|
fill: #939395;
|
||||||
|
background-color: rgba(0,0,0,0.1);
|
||||||
|
}
|
||||||
|
|
||||||
h1, h2 {
|
h1, h2 {
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
@@ -73,6 +80,10 @@ h2 {
|
|||||||
padding-bottom: 0.2em;
|
padding-bottom: 0.2em;
|
||||||
margin: 1em 0 0.37em;
|
margin: 1em 0 0.37em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body p {
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,7 +163,7 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
exportAsDocument (fileType) {
|
exportAsDocument (fileType) {
|
||||||
const options = {
|
const options = {
|
||||||
filters: [
|
filters: [
|
||||||
{ name: 'Documents', extensions: [fileType]}
|
{ name: 'Documents', extensions: [fileType] }
|
||||||
],
|
],
|
||||||
properties: ['openFile', 'createDirectory']
|
properties: ['openFile', 'createDirectory']
|
||||||
}
|
}
|
||||||
@@ -181,6 +192,8 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
|
|
||||||
this.refs.root.contentWindow.document.addEventListener('mousedown', this.mouseDownHandler)
|
this.refs.root.contentWindow.document.addEventListener('mousedown', this.mouseDownHandler)
|
||||||
this.refs.root.contentWindow.document.addEventListener('mouseup', this.mouseUpHandler)
|
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-text', this.saveAsTextHandler)
|
||||||
eventEmitter.on('export:save-md', this.saveAsMdHandler)
|
eventEmitter.on('export:save-md', this.saveAsMdHandler)
|
||||||
}
|
}
|
||||||
@@ -189,6 +202,8 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
this.refs.root.contentWindow.document.body.removeEventListener('contextmenu', this.contextMenuHandler)
|
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('mousedown', this.mouseDownHandler)
|
||||||
this.refs.root.contentWindow.document.removeEventListener('mouseup', this.mouseUpHandler)
|
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-text', this.saveAsTextHandler)
|
||||||
eventEmitter.off('export:save-md', this.saveAsMdHandler)
|
eventEmitter.off('export:save-md', this.saveAsMdHandler)
|
||||||
}
|
}
|
||||||
@@ -237,8 +252,19 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
let { value, theme, indentSize, codeBlockTheme } = this.props
|
let { value, theme, indentSize, codeBlockTheme } = this.props
|
||||||
|
|
||||||
this.refs.root.contentWindow.document.body.setAttribute('data-theme', theme)
|
this.refs.root.contentWindow.document.body.setAttribute('data-theme', theme)
|
||||||
|
|
||||||
|
const codeBlocks = value.match(/(```)(.|[\n])*?(```)/g)
|
||||||
|
if (codeBlocks !== null) {
|
||||||
|
codeBlocks.forEach((codeBlock) => {
|
||||||
|
value = value.replace(codeBlock, htmlTextHelper.encodeEntities(codeBlock))
|
||||||
|
})
|
||||||
|
}
|
||||||
this.refs.root.contentWindow.document.body.innerHTML = markdown.render(value)
|
this.refs.root.contentWindow.document.body.innerHTML = markdown.render(value)
|
||||||
|
|
||||||
|
_.forEach(this.refs.root.contentWindow.document.querySelectorAll('.taskListItem'), (el) => {
|
||||||
|
el.parentNode.parentNode.style.listStyleType = 'none'
|
||||||
|
})
|
||||||
|
|
||||||
_.forEach(this.refs.root.contentWindow.document.querySelectorAll('a'), (el) => {
|
_.forEach(this.refs.root.contentWindow.document.querySelectorAll('a'), (el) => {
|
||||||
el.addEventListener('click', this.anchorClickHandler)
|
el.addEventListener('click', this.anchorClickHandler)
|
||||||
})
|
})
|
||||||
@@ -255,7 +281,17 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
let syntax = CodeMirror.findModeByName(el.className)
|
let syntax = CodeMirror.findModeByName(el.className)
|
||||||
if (syntax == null) syntax = CodeMirror.findModeByName('Plain Text')
|
if (syntax == null) syntax = CodeMirror.findModeByName('Plain Text')
|
||||||
CodeMirror.requireMode(syntax.mode, () => {
|
CodeMirror.requireMode(syntax.mode, () => {
|
||||||
let content = decodeHTMLEntities(el.innerHTML)
|
let content = htmlTextHelper.decodeEntities(el.innerHTML)
|
||||||
|
const copyIcon = document.createElement('i')
|
||||||
|
copyIcon.innerHTML = '<button class="clipboardButton"><svg width="13" height="13" viewBox="0 0 1792 1792" ><path d="M768 1664h896v-640h-416q-40 0-68-28t-28-68v-416h-384v1152zm256-1440v-64q0-13-9.5-22.5t-22.5-9.5h-704q-13 0-22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h704q13 0 22.5-9.5t9.5-22.5zm256 672h299l-299-299v299zm512 128v672q0 40-28 68t-68 28h-960q-40 0-68-28t-28-68v-160h-544q-40 0-68-28t-28-68v-1344q0-40 28-68t68-28h1088q40 0 68 28t28 68v328q21 13 36 28l408 408q28 28 48 76t20 88z"/></svg></button>'
|
||||||
|
copyIcon.onclick = (e) => {
|
||||||
|
copy(content)
|
||||||
|
this.notify('Saved to Clipboard!', {
|
||||||
|
body: 'Paste it wherever you want!',
|
||||||
|
silent: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
el.parentNode.appendChild(copyIcon)
|
||||||
el.innerHTML = ''
|
el.innerHTML = ''
|
||||||
el.parentNode.className += ` cm-s-${codeBlockTheme} CodeMirror`
|
el.parentNode.className += ` cm-s-${codeBlockTheme} CodeMirror`
|
||||||
CodeMirror.runMode(content, syntax.mime, el, {
|
CodeMirror.runMode(content, syntax.mime, el, {
|
||||||
@@ -273,7 +309,7 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
_.forEach(this.refs.root.contentWindow.document.querySelectorAll('.flowchart'), (el) => {
|
_.forEach(this.refs.root.contentWindow.document.querySelectorAll('.flowchart'), (el) => {
|
||||||
Raphael.setWindow(this.getWindow())
|
Raphael.setWindow(this.getWindow())
|
||||||
try {
|
try {
|
||||||
let diagram = flowchart.parse(decodeHTMLEntities(el.innerHTML))
|
let diagram = flowchart.parse(htmlTextHelper.decodeEntities(el.innerHTML))
|
||||||
el.innerHTML = ''
|
el.innerHTML = ''
|
||||||
diagram.drawSVG(el, opts)
|
diagram.drawSVG(el, opts)
|
||||||
_.forEach(el.querySelectorAll('a'), (el) => {
|
_.forEach(el.querySelectorAll('a'), (el) => {
|
||||||
@@ -289,7 +325,7 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
_.forEach(this.refs.root.contentWindow.document.querySelectorAll('.sequence'), (el) => {
|
_.forEach(this.refs.root.contentWindow.document.querySelectorAll('.sequence'), (el) => {
|
||||||
Raphael.setWindow(this.getWindow())
|
Raphael.setWindow(this.getWindow())
|
||||||
try {
|
try {
|
||||||
let diagram = SequenceDiagram.parse(decodeHTMLEntities(el.innerHTML))
|
let diagram = SequenceDiagram.parse(htmlTextHelper.decodeEntities(el.innerHTML))
|
||||||
el.innerHTML = ''
|
el.innerHTML = ''
|
||||||
diagram.drawSVG(el, {theme: 'simple'})
|
diagram.drawSVG(el, {theme: 'simple'})
|
||||||
_.forEach(el.querySelectorAll('a'), (el) => {
|
_.forEach(el.querySelectorAll('a'), (el) => {
|
||||||
@@ -325,6 +361,18 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
preventImageDroppedHandler (e) {
|
||||||
|
e.preventDefault()
|
||||||
|
e.stopPropagation()
|
||||||
|
}
|
||||||
|
|
||||||
|
notify (title, options) {
|
||||||
|
if (global.process.platform === 'win32') {
|
||||||
|
options.icon = path.join('file://', global.__dirname, '../../resources/app.png')
|
||||||
|
}
|
||||||
|
return new window.Notification(title, options)
|
||||||
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
let { className, style, tabIndex } = this.props
|
let { className, style, tabIndex } = this.props
|
||||||
return (
|
return (
|
||||||
|
|||||||
18
browser/components/ModalEscButton.js
Normal file
18
browser/components/ModalEscButton.js
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import React, {PropTypes} from 'react'
|
||||||
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
|
import styles from './ModalEscButton.styl'
|
||||||
|
|
||||||
|
const ModalEscButton = ({
|
||||||
|
handleEscButtonClick
|
||||||
|
}) => (
|
||||||
|
<button styleName='escButton' onClick={handleEscButtonClick}>
|
||||||
|
<div styleName='esc-mark'>x</div>
|
||||||
|
<div styleName='esc-text'>esc</div>
|
||||||
|
</button>
|
||||||
|
)
|
||||||
|
|
||||||
|
ModalEscButton.propTypes = {
|
||||||
|
handleEscButtonClick: PropTypes.func.isRequired
|
||||||
|
}
|
||||||
|
|
||||||
|
export default CSSModules(ModalEscButton, styles)
|
||||||
14
browser/components/ModalEscButton.styl
Normal file
14
browser/components/ModalEscButton.styl
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
.escButton
|
||||||
|
height 50px
|
||||||
|
position absolute
|
||||||
|
background-color transparent
|
||||||
|
color $ui-inactive-text-color
|
||||||
|
border none
|
||||||
|
top 1px
|
||||||
|
right 10px
|
||||||
|
text-align center
|
||||||
|
width top-bar--height
|
||||||
|
height top-bar-height
|
||||||
|
|
||||||
|
.esc-mark
|
||||||
|
font-size 15px
|
||||||
@@ -13,7 +13,7 @@ import styles from './NoteItem.styl'
|
|||||||
*/
|
*/
|
||||||
const TagElement = ({ tagName }) => (
|
const TagElement = ({ tagName }) => (
|
||||||
<span styleName='item-bottom-tagList-item' key={tagName}>
|
<span styleName='item-bottom-tagList-item' key={tagName}>
|
||||||
{tagName}
|
#{tagName}
|
||||||
</span>
|
</span>
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -40,9 +40,10 @@ const TagElementList = (tags) => {
|
|||||||
* @param {Object} note
|
* @param {Object} note
|
||||||
* @param {Function} handleNoteClick
|
* @param {Function} handleNoteClick
|
||||||
* @param {Function} handleNoteContextMenu
|
* @param {Function} handleNoteContextMenu
|
||||||
|
* @param {Function} handleDragStart
|
||||||
* @param {string} dateDisplay
|
* @param {string} dateDisplay
|
||||||
*/
|
*/
|
||||||
const NoteItem = ({ isActive, note, dateDisplay, handleNoteClick, handleNoteContextMenu }) => (
|
const NoteItem = ({ isActive, note, dateDisplay, handleNoteClick, handleNoteContextMenu, handleDragStart }) => (
|
||||||
<div styleName={isActive
|
<div styleName={isActive
|
||||||
? 'item--active'
|
? 'item--active'
|
||||||
: 'item'
|
: 'item'
|
||||||
@@ -50,10 +51,14 @@ const NoteItem = ({ isActive, note, dateDisplay, handleNoteClick, handleNoteCont
|
|||||||
key={`${note.storage}-${note.key}`}
|
key={`${note.storage}-${note.key}`}
|
||||||
onClick={e => handleNoteClick(e, `${note.storage}-${note.key}`)}
|
onClick={e => handleNoteClick(e, `${note.storage}-${note.key}`)}
|
||||||
onContextMenu={e => handleNoteContextMenu(e, `${note.storage}-${note.key}`)}
|
onContextMenu={e => handleNoteContextMenu(e, `${note.storage}-${note.key}`)}
|
||||||
|
onDragStart={e => handleDragStart(e, note)}
|
||||||
|
draggable='true'
|
||||||
>
|
>
|
||||||
<div styleName='item-wrapper'>
|
<div styleName='item-wrapper'>
|
||||||
<div styleName='item-bottom-time'>{dateDisplay}</div>
|
{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'>
|
<div styleName='item-title'>
|
||||||
{note.title.trim().length > 0
|
{note.title.trim().length > 0
|
||||||
? note.title
|
? note.title
|
||||||
@@ -61,23 +66,18 @@ const NoteItem = ({ isActive, note, dateDisplay, handleNoteClick, handleNoteCont
|
|||||||
}
|
}
|
||||||
</div>
|
</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'>
|
||||||
<div styleName='item-bottom-tagList'>
|
<div styleName='item-bottom-tagList'>
|
||||||
{note.tags.length > 0
|
{note.tags.length > 0
|
||||||
? TagElementList(note.tags)
|
? TagElementList(note.tags)
|
||||||
: ''
|
: <span styleName='item-bottom-tagList-empty' />
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{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.isStarred
|
|
||||||
? <i styleName='item-star' className='fa fa-star' /> : ''
|
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
@@ -94,7 +94,9 @@ NoteItem.propTypes = {
|
|||||||
isStarred: PropTypes.bool.isRequired
|
isStarred: PropTypes.bool.isRequired
|
||||||
}),
|
}),
|
||||||
handleNoteClick: PropTypes.func.isRequired,
|
handleNoteClick: PropTypes.func.isRequired,
|
||||||
handleNoteContextMenu: PropTypes.func.isRequired
|
handleNoteContextMenu: PropTypes.func.isRequired,
|
||||||
|
handleDragStart: PropTypes.func.isRequired,
|
||||||
|
handleDragEnd: PropTypes.func.isRequired
|
||||||
}
|
}
|
||||||
|
|
||||||
export default CSSModules(NoteItem, styles)
|
export default CSSModules(NoteItem, styles)
|
||||||
|
|||||||
@@ -7,63 +7,72 @@ $control-height = 30px
|
|||||||
|
|
||||||
.item
|
.item
|
||||||
position relative
|
position relative
|
||||||
padding 0 25px
|
padding 0 20px
|
||||||
user-select none
|
user-select none
|
||||||
cursor pointer
|
cursor pointer
|
||||||
background-color $ui-noteList-backgroundColor
|
background-color $ui-noteList-backgroundColor
|
||||||
transition background-color 0.15s
|
transition background-color 0.2s
|
||||||
&:hover
|
&:hover
|
||||||
background-color alpha($ui-active-color, 20%)
|
background-color alpha($ui-button--active-backgroundColor, 40%)
|
||||||
&:active
|
|
||||||
background-color $ui-active-color
|
|
||||||
color white
|
|
||||||
.item-title
|
.item-title
|
||||||
.item-title-empty
|
|
||||||
.item-bottom-tagList-empty
|
|
||||||
.item-bottom-time
|
|
||||||
.item-title-icon
|
.item-title-icon
|
||||||
color white
|
.item-bottom-time
|
||||||
|
transition 0.15s
|
||||||
|
color $ui-text-color
|
||||||
.item-bottom-tagList-item
|
.item-bottom-tagList-item
|
||||||
background-color transparent
|
background-color alpha(white, 0.6)
|
||||||
color white
|
color $ui-text-color
|
||||||
|
.item-star
|
||||||
|
color $ui-favorite-star-button-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
|
.item-wrapper
|
||||||
padding 20px 0
|
padding 15px 0
|
||||||
border-bottom $ui-border
|
border-bottom $ui-border
|
||||||
|
|
||||||
.item--active
|
.item--active
|
||||||
@extend .item
|
@extend .item
|
||||||
background-color $ui-active-color
|
background-color $ui-button--active-backgroundColor
|
||||||
color white
|
color $ui-text-color
|
||||||
.item-title
|
.item-title
|
||||||
.item-title-empty
|
.item-title-empty
|
||||||
.item-bottom-tagList-empty
|
.item-bottom-tagList-empty
|
||||||
.item-bottom-time
|
.item-bottom-time
|
||||||
.item-title-icon
|
.item-title-icon
|
||||||
color white
|
color $ui-text-color
|
||||||
.item-bottom-tagList-item
|
.item-bottom-tagList-item
|
||||||
background-color transparent
|
background-color alpha(white, 0.6)
|
||||||
color white
|
color $ui-text-color
|
||||||
.item-wrapper
|
.item-wrapper
|
||||||
border-color transparent
|
border-color transparent
|
||||||
|
.item-star
|
||||||
|
color $ui-favorite-star-button-color
|
||||||
&:hover
|
&:hover
|
||||||
background-color $ui-active-color
|
background-color $ui-button--active-backgroundColor
|
||||||
|
|
||||||
.item-title
|
|
||||||
font-size 14px
|
|
||||||
height 40px
|
|
||||||
box-sizing border-box
|
|
||||||
line-height 24px
|
|
||||||
padding-top 5px
|
|
||||||
padding-bottom 20px
|
|
||||||
overflow ellipsis
|
|
||||||
color $ui-text-color
|
|
||||||
|
|
||||||
.item-title-icon
|
.item-title-icon
|
||||||
position absolute
|
position relative
|
||||||
top 20px
|
font-size 12px
|
||||||
right 25px
|
color $ui-inactive-text-color
|
||||||
font-size 14px
|
|
||||||
|
.item-title
|
||||||
|
font-size 13px
|
||||||
|
position relative
|
||||||
|
top -12px
|
||||||
|
left 20px
|
||||||
|
padding-right 15px
|
||||||
|
padding-bottom 4px
|
||||||
|
overflow ellipsis
|
||||||
color $ui-inactive-text-color
|
color $ui-inactive-text-color
|
||||||
|
|
||||||
.item-title-empty
|
.item-title-empty
|
||||||
@@ -74,7 +83,6 @@ $control-height = 30px
|
|||||||
position relative
|
position relative
|
||||||
bottom 0px
|
bottom 0px
|
||||||
margin-top 2px
|
margin-top 2px
|
||||||
height 20px
|
|
||||||
font-size 12px
|
font-size 12px
|
||||||
line-height 20px
|
line-height 20px
|
||||||
overflow ellipsis
|
overflow ellipsis
|
||||||
@@ -84,37 +92,35 @@ $control-height = 30px
|
|||||||
flex 1
|
flex 1
|
||||||
overflow ellipsis
|
overflow ellipsis
|
||||||
line-height 20px
|
line-height 20px
|
||||||
color #FFFFFF
|
padding-top 2px
|
||||||
|
padding-left 2px
|
||||||
|
|
||||||
.item-bottom-tagList-item
|
.item-bottom-tagList-item
|
||||||
font-size 12px
|
font-size 10px
|
||||||
margin-right 8px
|
margin-right 8px
|
||||||
padding 0 10px
|
padding 0
|
||||||
height 20px
|
height 20px
|
||||||
box-sizing border-box
|
box-sizing border-box
|
||||||
border-radius 20px
|
border-radius 2px
|
||||||
|
padding 1px 2px
|
||||||
vertical-align middle
|
vertical-align middle
|
||||||
background-color $ui-tag-backgroundColor
|
background-color white
|
||||||
color #FFFFFF
|
|
||||||
|
|
||||||
.item-bottom-tagList-empty
|
|
||||||
color $ui-inactive-text-color
|
color $ui-inactive-text-color
|
||||||
vertical-align middle
|
|
||||||
font-size 10px
|
|
||||||
margin-left 5px
|
|
||||||
|
|
||||||
.item-bottom-time
|
.item-bottom-time
|
||||||
color $ui-inactive-text-color
|
color $ui-inactive-text-color
|
||||||
font-size 12px
|
font-size 10px
|
||||||
|
padding-left 2px
|
||||||
|
padding-bottom 2px
|
||||||
|
|
||||||
.item-star
|
.item-star
|
||||||
position absolute
|
position absolute
|
||||||
top 20px
|
top 34px
|
||||||
right 29px
|
left 5px
|
||||||
width 34px
|
width 34px
|
||||||
height 34px
|
height 34px
|
||||||
color $ui-favorite-star-button-color
|
color alpha($ui-favorite-star-button-color, 60%)
|
||||||
font-size 14px
|
font-size 12px
|
||||||
padding 0
|
padding 0
|
||||||
border-radius 17px
|
border-radius 17px
|
||||||
|
|
||||||
@@ -126,42 +132,59 @@ body[data-theme="dark"]
|
|||||||
.item
|
.item
|
||||||
border-color $ui-dark-borderColor
|
border-color $ui-dark-borderColor
|
||||||
background-color $ui-dark-noteList-backgroundColor
|
background-color $ui-dark-noteList-backgroundColor
|
||||||
&:active
|
|
||||||
background-color $ui-active-color
|
|
||||||
&:hover
|
&:hover
|
||||||
background-color alpha($ui-active-color, 20%)
|
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
|
.item-wrapper
|
||||||
border-color $ui-dark-borderColor
|
border-color alpha($ui-dark-button--active-backgroundColor, 60%)
|
||||||
|
|
||||||
.item--active
|
.item--active
|
||||||
@extend .item
|
|
||||||
border-color $ui-dark-borderColor
|
border-color $ui-dark-borderColor
|
||||||
background-color $ui-active-color
|
background-color $ui-dark-button--active-backgroundColor
|
||||||
.item-wrapper
|
.item-wrapper
|
||||||
border-color transparent
|
border-color transparent
|
||||||
.item-title
|
.item-title
|
||||||
color white
|
.item-title-icon
|
||||||
|
.item-bottom-time
|
||||||
|
color $ui-dark-text-color
|
||||||
.item-bottom-tagList-item
|
.item-bottom-tagList-item
|
||||||
background-color transparent
|
background-color alpha(white, 10%)
|
||||||
color white
|
color $ui-dark-text-color
|
||||||
.item-bottom-tagList-empty
|
|
||||||
color white
|
|
||||||
&:hover
|
|
||||||
background-color $ui-active-color
|
|
||||||
|
|
||||||
.item-title
|
.item-title
|
||||||
color $ui-dark-text-color
|
color $ui-inactive-text-color
|
||||||
|
|
||||||
.item-title-icon
|
.item-title-icon
|
||||||
color $ui-darkinactive-text-color
|
color $ui-inactive-text-color
|
||||||
|
|
||||||
.item-title-empty
|
.item-title-empty
|
||||||
color $ui-dark-inactive-text-color
|
color $ui-inactive-text-color
|
||||||
|
|
||||||
.item-bottom-tagList-item
|
.item-bottom-tagList-item
|
||||||
background-color $ui-dark-tag-backgroundColor
|
background-color alpha($ui-dark-button--active-backgroundColor, 40%)
|
||||||
color $ui-dark-text-color
|
color $ui-inactive-text-color
|
||||||
|
|
||||||
.item-bottom-tagList-empty
|
.item-bottom-tagList-empty
|
||||||
color $ui-inactive-text-color
|
color $ui-inactive-text-color
|
||||||
|
|||||||
@@ -11,8 +11,9 @@ import styles from './NoteItemSimple.styl'
|
|||||||
* @param {Object} note
|
* @param {Object} note
|
||||||
* @param {Function} handleNoteClick
|
* @param {Function} handleNoteClick
|
||||||
* @param {Function} handleNoteContextMenu
|
* @param {Function} handleNoteContextMenu
|
||||||
|
* @param {Function} handleDragStart
|
||||||
*/
|
*/
|
||||||
const NoteItemSimple = ({ isActive, note, handleNoteClick, handleNoteContextMenu }) => (
|
const NoteItemSimple = ({ isActive, note, handleNoteClick, handleNoteContextMenum, handleDragStart }) => (
|
||||||
<div styleName={isActive
|
<div styleName={isActive
|
||||||
? 'item-simple--active'
|
? 'item-simple--active'
|
||||||
: 'item-simple'
|
: 'item-simple'
|
||||||
@@ -20,6 +21,8 @@ const NoteItemSimple = ({ isActive, note, handleNoteClick, handleNoteContextMenu
|
|||||||
key={`${note.storage}-${note.key}`}
|
key={`${note.storage}-${note.key}`}
|
||||||
onClick={e => handleNoteClick(e, `${note.storage}-${note.key}`)}
|
onClick={e => handleNoteClick(e, `${note.storage}-${note.key}`)}
|
||||||
onContextMenu={e => handleNoteContextMenu(e, `${note.storage}-${note.key}`)}
|
onContextMenu={e => handleNoteContextMenu(e, `${note.storage}-${note.key}`)}
|
||||||
|
onDragStart={e => handleDragStart(e, note)}
|
||||||
|
draggable='true'
|
||||||
>
|
>
|
||||||
<div styleName='item-simple-title'>
|
<div styleName='item-simple-title'>
|
||||||
{note.type === 'SNIPPET_NOTE'
|
{note.type === 'SNIPPET_NOTE'
|
||||||
@@ -43,7 +46,8 @@ NoteItemSimple.propTypes = {
|
|||||||
title: PropTypes.string.isrequired
|
title: PropTypes.string.isrequired
|
||||||
}),
|
}),
|
||||||
handleNoteClick: PropTypes.func.isRequired,
|
handleNoteClick: PropTypes.func.isRequired,
|
||||||
handleNoteContextMenu: PropTypes.func.isRequired
|
handleNoteContextMenu: PropTypes.func.isRequired,
|
||||||
|
handleDragStart: PropTypes.func.isRequired
|
||||||
}
|
}
|
||||||
|
|
||||||
export default CSSModules(NoteItemSimple, styles)
|
export default CSSModules(NoteItemSimple, styles)
|
||||||
|
|||||||
@@ -13,36 +13,40 @@ $control-height = 30px
|
|||||||
background-color $ui-noteList-backgroundColor
|
background-color $ui-noteList-backgroundColor
|
||||||
transition background-color 0.15s
|
transition background-color 0.15s
|
||||||
&:hover
|
&:hover
|
||||||
background-color alpha($ui-active-color, 20%)
|
background-color alpha($ui-button--active-backgroundColor, 40%)
|
||||||
&:active
|
|
||||||
background-color $ui-active-color
|
|
||||||
color white
|
|
||||||
.item-simple-title
|
.item-simple-title
|
||||||
.item-simple-title-empty
|
.item-simple-title-empty
|
||||||
.item-simple-title-icon
|
.item-simple-title-icon
|
||||||
color white
|
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
|
.item-simple--active
|
||||||
@extend .item-simple
|
@extend .item-simple
|
||||||
background-color $ui-active-color
|
background-color $ui-button--active-backgroundColor
|
||||||
color white
|
color $ui-text-color
|
||||||
.item-simple-title
|
.item-simple-title
|
||||||
.item-simple-title-empty
|
.item-simple-title-empty
|
||||||
border-color transparent
|
border-color transparent
|
||||||
color white
|
color $ui-text-color
|
||||||
.item-simple-title-icon
|
.item-simple-title-icon
|
||||||
color white
|
color $ui-text-color
|
||||||
&:hover
|
&:hover
|
||||||
background-color $ui-active-color
|
background-color $ui-button--active-backgroundColor
|
||||||
|
|
||||||
.item-simple-title
|
.item-simple-title
|
||||||
font-size 14px
|
font-size 12px
|
||||||
height 40px
|
height 40px
|
||||||
box-sizing border-box
|
box-sizing border-box
|
||||||
line-height 24px
|
line-height 24px
|
||||||
padding-top 8px
|
padding-top 8px
|
||||||
overflow ellipsis
|
overflow ellipsis
|
||||||
color $ui-text-color
|
color $ui-inactive-text-color
|
||||||
border-bottom $ui-border
|
border-bottom $ui-border
|
||||||
|
|
||||||
.item-simple-title-icon
|
.item-simple-title-icon
|
||||||
@@ -63,24 +67,36 @@ body[data-theme="dark"]
|
|||||||
border-color $ui-dark-borderColor
|
border-color $ui-dark-borderColor
|
||||||
background-color $ui-dark-noteList-backgroundColor
|
background-color $ui-dark-noteList-backgroundColor
|
||||||
&:active
|
&:active
|
||||||
background-color $ui-active-color
|
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
|
&:hover
|
||||||
background-color alpha($ui-active-color, 20%)
|
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
|
.item-simple--active
|
||||||
@extend .item-simple
|
|
||||||
border-color $ui-dark-borderColor
|
border-color $ui-dark-borderColor
|
||||||
background-color $ui-active-color
|
background-color $ui-dark-button--active-backgroundColor
|
||||||
.item-simple-title
|
.item-simple-title
|
||||||
.item-simple-title-empty
|
.item-simple-title-icon
|
||||||
color white
|
.item-simple-bottom-time
|
||||||
border-color transparent
|
color $ui-dark-text-color
|
||||||
&:hover
|
.item-simple-bottom-tagList-item
|
||||||
background-color $ui-active-color
|
background-color transparent
|
||||||
|
color $ui-dark-text-color
|
||||||
|
|
||||||
.item-simple-title
|
.item-simple-title
|
||||||
color $ui-dark-text-color
|
color $ui-inactive-text-color
|
||||||
border-color $ui-dark-borderColor
|
border-color alpha($ui-dark-button--active-backgroundColor, 60%)
|
||||||
|
|
||||||
.item-simple-title-icon
|
.item-simple-title-icon
|
||||||
color $ui-darkinactive-text-color
|
color $ui-darkinactive-text-color
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
import React, { PropTypes } from 'react'
|
|
||||||
import md5 from 'md5'
|
|
||||||
|
|
||||||
export default class ProfileImage extends React.Component {
|
|
||||||
render () {
|
|
||||||
let className = this.props.className == null ? 'ProfileImage' : 'ProfileImage ' + this.props.className
|
|
||||||
let email = this.props.email != null ? this.props.email : ''
|
|
||||||
let src = 'http://www.gravatar.com/avatar/' + md5(email.trim().toLowerCase()) + '?s=' + this.props.size
|
|
||||||
|
|
||||||
return (
|
|
||||||
<img
|
|
||||||
className={className}
|
|
||||||
width={this.props.size}
|
|
||||||
height={this.props.size}
|
|
||||||
src={src} />
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ProfileImage.propTypes = {
|
|
||||||
email: PropTypes.string,
|
|
||||||
size: PropTypes.string,
|
|
||||||
className: PropTypes.string
|
|
||||||
}
|
|
||||||
@@ -21,10 +21,10 @@ const SideNavFilter = ({
|
|||||||
<button styleName={isHomeActive ? 'menu-button--active' : 'menu-button'}
|
<button styleName={isHomeActive ? 'menu-button--active' : 'menu-button'}
|
||||||
onClick={handleAllNotesButtonClick}
|
onClick={handleAllNotesButtonClick}
|
||||||
>
|
>
|
||||||
<i className='fa fa-book fa-fw' />
|
<i className='fa fa-archive fa-fw' />
|
||||||
<span styleName='menu-button-label'>All Notes</span>
|
<span styleName='menu-button-label'>All Notes</span>
|
||||||
</button>
|
</button>
|
||||||
<button styleName={isStarredActive ? 'menu-button--active' : 'menu-button'}
|
<button styleName={isStarredActive ? 'menu-button-star--active' : 'menu-button'}
|
||||||
onClick={handleStarredButtonClick}
|
onClick={handleStarredButtonClick}
|
||||||
>
|
>
|
||||||
<i className='fa fa-star fa-fw' />
|
<i className='fa fa-star fa-fw' />
|
||||||
|
|||||||
@@ -5,17 +5,44 @@
|
|||||||
navButtonColor()
|
navButtonColor()
|
||||||
height 32px
|
height 32px
|
||||||
padding 0 15px
|
padding 0 15px
|
||||||
font-size 14px
|
font-size 12px
|
||||||
width 100%
|
width 100%
|
||||||
text-align left
|
text-align left
|
||||||
overflow ellipsis
|
overflow ellipsis
|
||||||
|
|
||||||
.menu-button--active
|
.menu-button--active
|
||||||
@extend .menu-button
|
@extend .menu-button
|
||||||
|
color #e74c3c
|
||||||
background-color $ui-button--active-backgroundColor
|
background-color $ui-button--active-backgroundColor
|
||||||
color $ui-button--active-color
|
.menu-button-label
|
||||||
|
color $ui-text-color
|
||||||
&:hover
|
&:hover
|
||||||
background-color $ui-button--active-backgroundColor
|
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
|
.menu-button-label
|
||||||
margin-left 5px
|
margin-left 5px
|
||||||
@@ -48,11 +75,31 @@
|
|||||||
|
|
||||||
body[data-theme="dark"]
|
body[data-theme="dark"]
|
||||||
.menu-button
|
.menu-button
|
||||||
navDarkButtonColor()
|
&: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
|
.menu-button--active
|
||||||
@extend .menu-button
|
color #c0392b
|
||||||
background-color $ui-dark-button--active-backgroundColor
|
background-color $ui-dark-button--active-backgroundColor
|
||||||
color $ui-dark-button--active-color
|
.menu-button-label
|
||||||
|
color $ui-dark-text-color
|
||||||
&:hover
|
&:hover
|
||||||
background-color $ui-dark-button--active-backgroundColor
|
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
|
||||||
@@ -96,6 +96,7 @@ class SnippetTab extends React.Component {
|
|||||||
{!this.state.isRenaming
|
{!this.state.isRenaming
|
||||||
? <button styleName='button'
|
? <button styleName='button'
|
||||||
onClick={(e) => this.handleClick(e)}
|
onClick={(e) => this.handleClick(e)}
|
||||||
|
onDoubleClick={(e) => this.handleRenameClick(e)}
|
||||||
onContextMenu={(e) => this.handleContextMenu(e)}
|
onContextMenu={(e) => this.handleContextMenu(e)}
|
||||||
>
|
>
|
||||||
{snippet.name.trim().length > 0
|
{snippet.name.trim().length > 0
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ body[data-theme="dark"]
|
|||||||
&:hover
|
&:hover
|
||||||
background-color darken($ui-dark-button--hover-backgroundColor, 15%)
|
background-color darken($ui-dark-button--hover-backgroundColor, 15%)
|
||||||
&:active
|
&:active
|
||||||
color white
|
color $ui-dark-text-color
|
||||||
background-color $ui-dark-button--active-backgroundColor
|
background-color $ui-dark-button--active-backgroundColor
|
||||||
|
|
||||||
.root--active
|
.root--active
|
||||||
@@ -73,7 +73,7 @@ body[data-theme="dark"]
|
|||||||
&:hover
|
&:hover
|
||||||
background-color darken($ui-dark-button--hover-backgroundColor, 15%)
|
background-color darken($ui-dark-button--hover-backgroundColor, 15%)
|
||||||
&:active
|
&:active
|
||||||
color white
|
color $ui-dark-text-color
|
||||||
background-color $ui-dark-button--active-backgroundColor
|
background-color $ui-dark-button--active-backgroundColor
|
||||||
|
|
||||||
.button
|
.button
|
||||||
@@ -83,9 +83,9 @@ body[data-theme="dark"]
|
|||||||
transition color background-color 0.15s
|
transition color background-color 0.15s
|
||||||
border-left 4px solid transparent
|
border-left 4px solid transparent
|
||||||
&:hover
|
&:hover
|
||||||
color white
|
color $ui-dark-text-color
|
||||||
background-color $ui-dark-button--hover-backgroundColor
|
background-color $ui-dark-button--hover-backgroundColor
|
||||||
|
|
||||||
.input
|
.input
|
||||||
background-color $ui-dark-button--hover-backgroundColor
|
background-color $ui-dark-button--hover-backgroundColor
|
||||||
color white
|
color $ui-dark-text-color
|
||||||
|
|||||||
@@ -14,11 +14,14 @@ import { isNumber } from 'lodash'
|
|||||||
* @param {string} folderColor
|
* @param {string} folderColor
|
||||||
* @param {boolean} isFolded
|
* @param {boolean} isFolded
|
||||||
* @param {number} noteCount
|
* @param {number} noteCount
|
||||||
|
* @param {Function} handleDrop
|
||||||
|
* @param {Function} handleDragEnter
|
||||||
|
* @param {Function} handleDragOut
|
||||||
* @return {React.Component}
|
* @return {React.Component}
|
||||||
*/
|
*/
|
||||||
const StorageItem = ({
|
const StorageItem = ({
|
||||||
isActive, handleButtonClick, handleContextMenu, folderName,
|
isActive, handleButtonClick, handleContextMenu, folderName,
|
||||||
folderColor, isFolded, noteCount
|
folderColor, isFolded, noteCount, handleDrop, handleDragEnter, handleDragLeave
|
||||||
}) => (
|
}) => (
|
||||||
<button styleName={isActive
|
<button styleName={isActive
|
||||||
? 'folderList-item--active'
|
? 'folderList-item--active'
|
||||||
@@ -26,6 +29,9 @@ const StorageItem = ({
|
|||||||
}
|
}
|
||||||
onClick={handleButtonClick}
|
onClick={handleButtonClick}
|
||||||
onContextMenu={handleContextMenu}
|
onContextMenu={handleContextMenu}
|
||||||
|
onDrop={handleDrop}
|
||||||
|
onDragEnter={handleDragEnter}
|
||||||
|
onDragLeave={handleDragLeave}
|
||||||
>
|
>
|
||||||
<span styleName={isFolded
|
<span styleName={isFolded
|
||||||
? 'folderList-item-name--folded' : 'folderList-item-name'
|
? 'folderList-item-name--folded' : 'folderList-item-name'
|
||||||
@@ -52,6 +58,8 @@ StorageItem.propTypes = {
|
|||||||
folderName: PropTypes.string.isRequired,
|
folderName: PropTypes.string.isRequired,
|
||||||
folderColor: PropTypes.string,
|
folderColor: PropTypes.string,
|
||||||
isFolded: PropTypes.bool.isRequired,
|
isFolded: PropTypes.bool.isRequired,
|
||||||
|
handleDragEnter: PropTypes.func.isRequired,
|
||||||
|
handleDragLeave: PropTypes.func.isRequired,
|
||||||
noteCount: PropTypes.number
|
noteCount: PropTypes.number
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,30 +13,32 @@
|
|||||||
text-align left
|
text-align left
|
||||||
border none
|
border none
|
||||||
overflow ellipsis
|
overflow ellipsis
|
||||||
font-size 14px
|
font-size 12px
|
||||||
&:first-child
|
&:first-child
|
||||||
margin-top 0
|
margin-top 0
|
||||||
&:hover
|
&:hover
|
||||||
background-color $ui-button--hover-backgroundColor
|
color $ui-text-color
|
||||||
|
background-color alpha($ui-button--active-backgroundColor, 20%)
|
||||||
|
transition background-color 0.15s
|
||||||
&:active
|
&:active
|
||||||
color $ui-button--active-color
|
color $ui-text-color
|
||||||
background-color $ui-button--active-backgroundColor
|
background-color $ui-button--active-backgroundColor
|
||||||
|
|
||||||
.folderList-item--active
|
.folderList-item--active
|
||||||
@extend .folderList-item
|
@extend .folderList-item
|
||||||
color $ui-button--active-color
|
color $ui-text-color
|
||||||
background-color $ui-button--active-backgroundColor
|
background-color $ui-button--active-backgroundColor
|
||||||
&:hover
|
&:hover
|
||||||
color $ui-button--active-color
|
color $ui-text-color
|
||||||
background-color $ui-button--active-backgroundColor
|
background-color $ui-button--active-backgroundColor
|
||||||
|
|
||||||
.folderList-item-name
|
.folderList-item-name
|
||||||
display block
|
display block
|
||||||
flex 1
|
flex 1
|
||||||
padding 0 30px
|
padding 0 25px
|
||||||
height 26px
|
height 26px
|
||||||
line-height 26px
|
line-height 26px
|
||||||
border-width 0 0 0 3px
|
border-width 0 0 0 2px
|
||||||
border-style solid
|
border-style solid
|
||||||
border-color transparent
|
border-color transparent
|
||||||
overflow hidden
|
overflow hidden
|
||||||
@@ -67,4 +69,24 @@
|
|||||||
|
|
||||||
.folderList-item-name--folded
|
.folderList-item-name--folded
|
||||||
@extend .folderList-item-name
|
@extend .folderList-item-name
|
||||||
padding-left 14px
|
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
|
||||||
|
|||||||
27
browser/components/TodoListPercentage.js
Normal file
27
browser/components/TodoListPercentage.js
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
/**
|
||||||
|
* @fileoverview Percentage of todo achievement.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import React, { PropTypes } from 'react'
|
||||||
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
|
import styles from './TodoListPercentage.styl'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {number} percentageOfTodo
|
||||||
|
*/
|
||||||
|
|
||||||
|
const TodoListPercentage = ({
|
||||||
|
percentageOfTodo
|
||||||
|
}) => (
|
||||||
|
<div styleName='percentageBar' style={{display: isNaN(percentageOfTodo) ? 'none' : ''}}>
|
||||||
|
<div styleName='progressBar' style={{width: `${percentageOfTodo}%`}}>
|
||||||
|
<p styleName='percentageText'>{percentageOfTodo}%</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
|
||||||
|
TodoListPercentage.propTypes = {
|
||||||
|
percentageOfTodo: PropTypes.number.isRequired
|
||||||
|
}
|
||||||
|
|
||||||
|
export default CSSModules(TodoListPercentage, styles)
|
||||||
31
browser/components/TodoListPercentage.styl
Normal file
31
browser/components/TodoListPercentage.styl
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
.percentageBar
|
||||||
|
position absolute
|
||||||
|
top 58px
|
||||||
|
right: 0px
|
||||||
|
left 0px
|
||||||
|
background-color #DADFE1
|
||||||
|
width 100%
|
||||||
|
height: 15px
|
||||||
|
font-size: 12px
|
||||||
|
z-index 100
|
||||||
|
border-radius 2px
|
||||||
|
|
||||||
|
.progressBar
|
||||||
|
background-color: #6C7A89
|
||||||
|
height 15px
|
||||||
|
border-radius 2px
|
||||||
|
transition 0.3s
|
||||||
|
|
||||||
|
.percentageText
|
||||||
|
color #f4f4f4
|
||||||
|
padding: 2px 43%
|
||||||
|
|
||||||
|
body[data-theme="dark"]
|
||||||
|
.percentageBar
|
||||||
|
background-color #363A3D
|
||||||
|
|
||||||
|
.progressBar
|
||||||
|
background-color: alpha(#939395, 50%)
|
||||||
|
|
||||||
|
.percentageText
|
||||||
|
color $ui-dark-text-color
|
||||||
@@ -54,7 +54,6 @@ body
|
|||||||
font-family helvetica, arial, sans-serif
|
font-family helvetica, arial, sans-serif
|
||||||
line-height 1.6
|
line-height 1.6
|
||||||
overflow-x hidden
|
overflow-x hidden
|
||||||
user-select all
|
|
||||||
background-color $ui-noteDetail-backgroundColor
|
background-color $ui-noteDetail-backgroundColor
|
||||||
.katex
|
.katex
|
||||||
font 400 1.2em 'KaTeX_Main'
|
font 400 1.2em 'KaTeX_Main'
|
||||||
@@ -78,7 +77,6 @@ body
|
|||||||
li
|
li
|
||||||
label.taskListItem
|
label.taskListItem
|
||||||
margin-left -2em
|
margin-left -2em
|
||||||
background-color white
|
|
||||||
div.math-rendered
|
div.math-rendered
|
||||||
text-align center
|
text-align center
|
||||||
.math-failed
|
.math-failed
|
||||||
@@ -272,7 +270,7 @@ table
|
|||||||
border-right solid 1px borderColor
|
border-right solid 1px borderColor
|
||||||
|
|
||||||
themeDarkBackground = darken(#21252B, 10%)
|
themeDarkBackground = darken(#21252B, 10%)
|
||||||
themeDarkText = #DDDDDD
|
themeDarkText = #f9f9f9
|
||||||
themeDarkBorder = lighten(themeDarkBackground, 20%)
|
themeDarkBorder = lighten(themeDarkBackground, 20%)
|
||||||
themeDarkPreview = $ui-dark-noteDetail-backgroundColor
|
themeDarkPreview = $ui-dark-noteDetail-backgroundColor
|
||||||
themeDarkTableOdd = themeDarkPreview
|
themeDarkTableOdd = themeDarkPreview
|
||||||
@@ -290,8 +288,9 @@ body[data-theme="dark"]
|
|||||||
background-color alpha(lighten(brandColor, 30%), 0.2) !important
|
background-color alpha(lighten(brandColor, 30%), 0.2) !important
|
||||||
|
|
||||||
code
|
code
|
||||||
|
color #EA6730
|
||||||
border-color darken(themeDarkBorder, 10%)
|
border-color darken(themeDarkBorder, 10%)
|
||||||
background-color lighten(themeDarkPreview, 10%)
|
background-color lighten(themeDarkPreview, 5%)
|
||||||
|
|
||||||
pre
|
pre
|
||||||
border-color lighten(#21252B, 20%)
|
border-color lighten(#21252B, 20%)
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import StorageSection from './StorageSection'
|
|||||||
import NoteList from './NoteList'
|
import NoteList from './NoteList'
|
||||||
import NoteDetail from './NoteDetail'
|
import NoteDetail from './NoteDetail'
|
||||||
import SideNavFilter from 'browser/components/SideNavFilter'
|
import SideNavFilter from 'browser/components/SideNavFilter'
|
||||||
|
import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
|
||||||
require('!!style!css!stylus?sourceMap!../main/global.styl')
|
require('!!style!css!stylus?sourceMap!../main/global.styl')
|
||||||
require('../lib/customMeta')
|
require('../lib/customMeta')
|
||||||
|
|
||||||
@@ -68,7 +69,7 @@ class FinderMain extends React.Component {
|
|||||||
|
|
||||||
handleWindowBlur (e) {
|
handleWindowBlur (e) {
|
||||||
this.setState({
|
this.setState({
|
||||||
search: '',
|
search: ''
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,6 +95,7 @@ class FinderMain extends React.Component {
|
|||||||
|
|
||||||
if (e.keyCode === 13) {
|
if (e.keyCode === 13) {
|
||||||
this.refs.detail.saveToClipboard()
|
this.refs.detail.saveToClipboard()
|
||||||
|
AwsMobileAnalyticsConfig.recordDynamitCustomEvent('COPY_FINDER')
|
||||||
hideFinder()
|
hideFinder()
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
}
|
}
|
||||||
|
|||||||
33
browser/lib/findNoteTitle.js
Normal file
33
browser/lib/findNoteTitle.js
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
export function findNoteTitle (value) {
|
||||||
|
let splitted = value.split('\n')
|
||||||
|
let title = null
|
||||||
|
let isInsideCodeBlock = false
|
||||||
|
|
||||||
|
splitted.some((line, index) => {
|
||||||
|
let trimmedLine = line.trim()
|
||||||
|
let trimmedNextLine = splitted[index + 1] === undefined ? '' : splitted[index + 1].trim()
|
||||||
|
if (trimmedLine.match('```')) {
|
||||||
|
isInsideCodeBlock = !isInsideCodeBlock
|
||||||
|
}
|
||||||
|
if (isInsideCodeBlock === false && (trimmedLine.match(/^# +/) || trimmedNextLine.match(/^=+$/))) {
|
||||||
|
title = trimmedLine
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if (title === null) {
|
||||||
|
title = ''
|
||||||
|
splitted.some((line) => {
|
||||||
|
if (line.trim().length > 0) {
|
||||||
|
title = line.trim()
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return title
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
findNoteTitle
|
||||||
|
}
|
||||||
45
browser/lib/htmlTextHelper.js
Normal file
45
browser/lib/htmlTextHelper.js
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
/**
|
||||||
|
* @fileoverview Text trimmer for html.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} text
|
||||||
|
* @return {string}
|
||||||
|
*/
|
||||||
|
|
||||||
|
export function decodeEntities (text) {
|
||||||
|
var entities = [
|
||||||
|
['apos', '\''],
|
||||||
|
['amp', '&'],
|
||||||
|
['lt', '<'],
|
||||||
|
['gt', '>'],
|
||||||
|
['#63', '\\?'],
|
||||||
|
['#36', '\\$']
|
||||||
|
]
|
||||||
|
|
||||||
|
for (var i = 0, max = entities.length; i < max; ++i) {
|
||||||
|
text = text.replace(new RegExp(`&${entities[i][0]};`, 'g'), entities[i][1])
|
||||||
|
}
|
||||||
|
|
||||||
|
return text
|
||||||
|
}
|
||||||
|
|
||||||
|
export function encodeEntities (text) {
|
||||||
|
const entities = [
|
||||||
|
['\'', 'apos'],
|
||||||
|
['<', 'lt'],
|
||||||
|
['>', 'gt'],
|
||||||
|
['\\?', '#63'],
|
||||||
|
['\\$', '#36']
|
||||||
|
]
|
||||||
|
|
||||||
|
entities.forEach((entity) => {
|
||||||
|
text = text.replace(new RegExp(entity[0], 'g'), `&${entity[1]};`)
|
||||||
|
})
|
||||||
|
return text
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
decodeEntities,
|
||||||
|
encodeEntities
|
||||||
|
}
|
||||||
@@ -19,6 +19,7 @@ var md = markdownit({
|
|||||||
linkify: true,
|
linkify: true,
|
||||||
html: true,
|
html: true,
|
||||||
xhtmlOut: true,
|
xhtmlOut: true,
|
||||||
|
breaks: true,
|
||||||
highlight: function (str, lang) {
|
highlight: function (str, lang) {
|
||||||
if (lang === 'flowchart') {
|
if (lang === 'flowchart') {
|
||||||
return `<pre class="flowchart">${str}</pre>`
|
return `<pre class="flowchart">${str}</pre>`
|
||||||
@@ -56,6 +57,7 @@ md.use(math, {
|
|||||||
return output
|
return output
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
md.use(require('markdown-it-imsize'))
|
||||||
md.use(require('markdown-it-footnote'))
|
md.use(require('markdown-it-footnote'))
|
||||||
// Override task item
|
// Override task item
|
||||||
md.block.ruler.at('paragraph', function (state, startLine/*, endLine */) {
|
md.block.ruler.at('paragraph', function (state, startLine/*, endLine */) {
|
||||||
|
|||||||
43
browser/lib/search.js
Normal file
43
browser/lib/search.js
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
import _ from 'lodash'
|
||||||
|
|
||||||
|
export default function searchFromNotes (data, search) {
|
||||||
|
let notes = data.noteMap.map((note) => note)
|
||||||
|
if (search.trim().length === 0) return []
|
||||||
|
let searchBlocks = search.split(' ')
|
||||||
|
searchBlocks.forEach((block) => {
|
||||||
|
if (block.match(/^#.+/)) {
|
||||||
|
notes = findByTag(notes, block)
|
||||||
|
} else {
|
||||||
|
notes = findByWord(notes, block)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return notes
|
||||||
|
}
|
||||||
|
|
||||||
|
function findByTag (notes, block) {
|
||||||
|
const tag = block.match(/#(.+)/)[1]
|
||||||
|
let regExp = new RegExp(_.escapeRegExp(tag), 'i')
|
||||||
|
return notes.filter((note) => {
|
||||||
|
if (!_.isArray(note.tags)) return false
|
||||||
|
return note.tags.some((_tag) => {
|
||||||
|
return _tag.match(regExp)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function findByWord (notes, block) {
|
||||||
|
let regExp = new RegExp(_.escapeRegExp(block), 'i')
|
||||||
|
return notes.filter((note) => {
|
||||||
|
if (_.isArray(note.tags) && note.tags.some((_tag) => {
|
||||||
|
return _tag.match(regExp)
|
||||||
|
})) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if (note.type === 'SNIPPET_NOTE') {
|
||||||
|
return note.description.match(regExp)
|
||||||
|
} else if (note.type === 'MARKDOWN_NOTE') {
|
||||||
|
return note.content.match(regExp)
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -1,8 +1,5 @@
|
|||||||
.root
|
.root
|
||||||
absolute top bottom right
|
absolute top bottom right
|
||||||
border-width 1px 0
|
|
||||||
border-style solid
|
|
||||||
border-color $ui-borderColor
|
|
||||||
|
|
||||||
.empty
|
.empty
|
||||||
height 320px
|
height 320px
|
||||||
@@ -18,7 +15,6 @@
|
|||||||
|
|
||||||
body[data-theme="dark"]
|
body[data-theme="dark"]
|
||||||
.root
|
.root
|
||||||
border-color $ui-dark-borderColor
|
|
||||||
background-color $ui-dark-backgroundColor
|
background-color $ui-dark-backgroundColor
|
||||||
.empty-message
|
.empty-message
|
||||||
color $ui-dark-inactive-text-color
|
color $ui-dark-inactive-text-color
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
overflow ellipsis
|
overflow ellipsis
|
||||||
|
|
||||||
.idle-label-name
|
.idle-label-name
|
||||||
font-size 16px
|
font-size 14px
|
||||||
padding 2px
|
padding 2px
|
||||||
|
|
||||||
.idle-label-name-surfix
|
.idle-label-name-surfix
|
||||||
@@ -81,7 +81,7 @@
|
|||||||
background-color $ui-button--active-backgroundColor
|
background-color $ui-button--active-backgroundColor
|
||||||
color $ui-button--active-color
|
color $ui-button--active-color
|
||||||
.search-optionList-item-name
|
.search-optionList-item-name
|
||||||
border-left solid 4px transparent
|
border-left solid 2px transparent
|
||||||
padding 2px 5px
|
padding 2px 5px
|
||||||
.search-optionList-item-name-surfix
|
.search-optionList-item-name-surfix
|
||||||
font-size 10px
|
font-size 10px
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import React, { PropTypes } from 'react'
|
|||||||
import CSSModules from 'browser/lib/CSSModules'
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
import styles from './MarkdownNoteDetail.styl'
|
import styles from './MarkdownNoteDetail.styl'
|
||||||
import MarkdownEditor from 'browser/components/MarkdownEditor'
|
import MarkdownEditor from 'browser/components/MarkdownEditor'
|
||||||
|
import TodoListPercentage from 'browser/components/TodoListPercentage'
|
||||||
import StarButton from './StarButton'
|
import StarButton from './StarButton'
|
||||||
import TagSelect from './TagSelect'
|
import TagSelect from './TagSelect'
|
||||||
import FolderSelect from './FolderSelect'
|
import FolderSelect from './FolderSelect'
|
||||||
@@ -11,6 +12,8 @@ import ee from 'browser/main/lib/eventEmitter'
|
|||||||
import markdown from 'browser/lib/markdown'
|
import markdown from 'browser/lib/markdown'
|
||||||
import StatusBar from '../StatusBar'
|
import StatusBar from '../StatusBar'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
|
import { findNoteTitle } from 'browser/lib/findNoteTitle'
|
||||||
|
import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
|
||||||
|
|
||||||
const electron = require('electron')
|
const electron = require('electron')
|
||||||
const { remote } = electron
|
const { remote } = electron
|
||||||
@@ -25,15 +28,23 @@ class MarkdownNoteDetail extends React.Component {
|
|||||||
note: Object.assign({
|
note: Object.assign({
|
||||||
title: '',
|
title: '',
|
||||||
content: ''
|
content: ''
|
||||||
}, props.note)
|
}, props.note),
|
||||||
|
isLockButtonShown: false,
|
||||||
|
isLocked: false
|
||||||
}
|
}
|
||||||
this.dispatchTimer = null
|
this.dispatchTimer = null
|
||||||
|
|
||||||
|
this.toggleLockButton = this.handleToggleLockButton.bind(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
focus () {
|
focus () {
|
||||||
this.refs.content.focus()
|
this.refs.content.focus()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentDidMount () {
|
||||||
|
ee.on('topbar:togglelockbutton', this.toggleLockButton)
|
||||||
|
}
|
||||||
|
|
||||||
componentWillReceiveProps (nextProps) {
|
componentWillReceiveProps (nextProps) {
|
||||||
if (nextProps.note.key !== this.props.note.key && !this.isMovingNote) {
|
if (nextProps.note.key !== this.props.note.key && !this.isMovingNote) {
|
||||||
if (this.saveQueue != null) this.saveNow()
|
if (this.saveQueue != null) this.saveNow()
|
||||||
@@ -50,34 +61,26 @@ class MarkdownNoteDetail extends React.Component {
|
|||||||
if (this.saveQueue != null) this.saveNow()
|
if (this.saveQueue != null) this.saveNow()
|
||||||
}
|
}
|
||||||
|
|
||||||
findTitle (value) {
|
componentDidUnmount () {
|
||||||
let splitted = value.split('\n')
|
ee.off('topbar:togglelockbutton', this.toggleLockButton)
|
||||||
let title = null
|
}
|
||||||
|
|
||||||
for (let i = 0; i < splitted.length; i++) {
|
getPercentageOfCompleteTodo (noteContent) {
|
||||||
let trimmedLine = splitted[i].trim()
|
let splitted = noteContent.split('\n')
|
||||||
if (trimmedLine.match(/^# .+/)) {
|
let numberOfTodo = 0
|
||||||
title = trimmedLine.substring(1, trimmedLine.length).trim()
|
let numberOfCompletedTodo = 0
|
||||||
break
|
|
||||||
|
splitted.forEach((line) => {
|
||||||
|
let trimmedLine = line.trim()
|
||||||
|
if (trimmedLine.match(/^[\+\-\*] \[\s|x\] ./)) {
|
||||||
|
numberOfTodo++
|
||||||
}
|
}
|
||||||
}
|
if (trimmedLine.match(/^[\+\-\*] \[x\] ./)) {
|
||||||
|
numberOfCompletedTodo++
|
||||||
if (title == null) {
|
|
||||||
for (let i = 0; i < splitted.length; i++) {
|
|
||||||
let trimmedLine = splitted[i].trim()
|
|
||||||
if (trimmedLine.length > 0) {
|
|
||||||
title = trimmedLine
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (title == null) {
|
})
|
||||||
title = ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
title = markdown.strip(title)
|
return Math.floor(numberOfCompletedTodo / numberOfTodo * 100)
|
||||||
|
|
||||||
return title
|
|
||||||
}
|
}
|
||||||
|
|
||||||
handleChange (e) {
|
handleChange (e) {
|
||||||
@@ -85,7 +88,7 @@ class MarkdownNoteDetail extends React.Component {
|
|||||||
|
|
||||||
note.content = this.refs.content.value
|
note.content = this.refs.content.value
|
||||||
note.tags = this.refs.tags.value
|
note.tags = this.refs.tags.value
|
||||||
note.title = this.findTitle(note.content)
|
note.title = markdown.strip(findNoteTitle(note.content))
|
||||||
note.updatedAt = new Date()
|
note.updatedAt = new Date()
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
@@ -114,6 +117,7 @@ class MarkdownNoteDetail extends React.Component {
|
|||||||
type: 'UPDATE_NOTE',
|
type: 'UPDATE_NOTE',
|
||||||
note: note
|
note: note
|
||||||
})
|
})
|
||||||
|
AwsMobileAnalyticsConfig.recordDynamitCustomEvent('EDIT_NOTE')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,6 +156,7 @@ class MarkdownNoteDetail extends React.Component {
|
|||||||
|
|
||||||
handleStarButtonClick (e) {
|
handleStarButtonClick (e) {
|
||||||
let { note } = this.state
|
let { note } = this.state
|
||||||
|
if (!note.isStarred) AwsMobileAnalyticsConfig.recordDynamitCustomEvent('ADD_STAR')
|
||||||
|
|
||||||
note.isStarred = !note.isStarred
|
note.isStarred = !note.isStarred
|
||||||
|
|
||||||
@@ -166,16 +171,7 @@ class MarkdownNoteDetail extends React.Component {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
handleContextButtonClick (e) {
|
handleDeleteButtonClick (e) {
|
||||||
let menu = new Menu()
|
|
||||||
menu.append(new MenuItem({
|
|
||||||
label: 'Delete',
|
|
||||||
click: (e) => this.handleDeleteMenuClick(e)
|
|
||||||
}))
|
|
||||||
menu.popup(remote.getCurrentWindow())
|
|
||||||
}
|
|
||||||
|
|
||||||
handleDeleteMenuClick (e) {
|
|
||||||
let index = dialog.showMessageBox(remote.getCurrentWindow(), {
|
let index = dialog.showMessageBox(remote.getCurrentWindow(), {
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
message: 'Delete a note',
|
message: 'Delete a note',
|
||||||
@@ -200,10 +196,38 @@ class MarkdownNoteDetail extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleFullScreenButton (e) {
|
||||||
|
ee.emit('editor:fullscreen')
|
||||||
|
}
|
||||||
|
|
||||||
|
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) {
|
handleDeleteKeyDown (e) {
|
||||||
if (e.keyCode === 27) this.handleDeleteCancelButtonClick(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 () {
|
render () {
|
||||||
let { data, config } = this.props
|
let { data, config } = this.props
|
||||||
let { note } = this.state
|
let { note } = this.state
|
||||||
@@ -233,12 +257,44 @@ class MarkdownNoteDetail extends React.Component {
|
|||||||
value={this.state.note.tags}
|
value={this.state.note.tags}
|
||||||
onChange={(e) => this.handleChange(e)}
|
onChange={(e) => this.handleChange(e)}
|
||||||
/>
|
/>
|
||||||
|
<TodoListPercentage
|
||||||
|
percentageOfTodo={this.getPercentageOfCompleteTodo(note.content)}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div styleName='info-right'>
|
<div styleName='info-right'>
|
||||||
<button styleName='info-right-button'
|
{(() => {
|
||||||
onClick={(e) => this.handleContextButtonClick(e)}
|
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-ellipsis-v' />
|
<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
				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
				C494.308,21.067,473.24,0,447.23,0H306c-26.01,0-47.077,21.067-47.077,47.077v47.077h-141.23
				c-26.01,0-47.077,21.067-47.077,47.077v47.077c0,25.986,21.067,47.077,47.077,47.077v423.692
				c0,51.996,42.157,94.153,94.154,94.153h329.539c51.996,0,94.153-42.157,94.153-94.153V235.385
				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
				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
				 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
				 M612,188.308H141.23c-12.993,0-23.538-10.545-23.538-23.539s10.545-23.539,23.538-23.539H612
				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
				V353.077c0-12.993-10.545-23.539-23.539-23.539s-23.539,10.545-23.539,23.539v282.461
				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
				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>
|
||||||
|
<button styleName='control-fullScreenButton'
|
||||||
|
onMouseDown={(e) => this.handleFullScreenButton(e)}
|
||||||
|
>
|
||||||
|
<i className='fa fa-arrows-alt' styleName='fullScreen-button' />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -249,6 +305,7 @@ class MarkdownNoteDetail extends React.Component {
|
|||||||
styleName='body-noteEditor'
|
styleName='body-noteEditor'
|
||||||
config={config}
|
config={config}
|
||||||
value={this.state.note.content}
|
value={this.state.note.content}
|
||||||
|
storageKey={this.state.note.storage}
|
||||||
onChange={(e) => this.handleChange(e)}
|
onChange={(e) => this.handleChange(e)}
|
||||||
ignorePreviewPointerEvents={this.props.ignorePreviewPointerEvents}
|
ignorePreviewPointerEvents={this.props.ignorePreviewPointerEvents}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -9,6 +9,33 @@
|
|||||||
background-color $ui-noteDetail-backgroundColor
|
background-color $ui-noteDetail-backgroundColor
|
||||||
box-shadow $note-detail-box-shadow
|
box-shadow $note-detail-box-shadow
|
||||||
|
|
||||||
|
.lock-button
|
||||||
|
padding-bottom 3px
|
||||||
|
|
||||||
|
.control-lockButton
|
||||||
|
topBarButtonLight()
|
||||||
|
|
||||||
|
.control-lockButton-tooltip
|
||||||
|
tooltip()
|
||||||
|
position fixed
|
||||||
|
pointer-events none
|
||||||
|
top 50px
|
||||||
|
z-index 200
|
||||||
|
padding 5px
|
||||||
|
line-height normal
|
||||||
|
border-radius 2px
|
||||||
|
opacity 0
|
||||||
|
transition 0.1s
|
||||||
|
|
||||||
|
.control-trashButton
|
||||||
|
float right
|
||||||
|
topBarButtonLight()
|
||||||
|
|
||||||
|
.control-fullScreenButton
|
||||||
|
float right
|
||||||
|
padding 7px
|
||||||
|
topBarButtonLight()
|
||||||
|
|
||||||
.body
|
.body
|
||||||
absolute left right
|
absolute left right
|
||||||
left $note-detail-left-margin
|
left $note-detail-left-margin
|
||||||
@@ -24,3 +51,15 @@ body[data-theme="dark"]
|
|||||||
border-color $ui-dark-borderColor
|
border-color $ui-dark-borderColor
|
||||||
background-color $ui-dark-noteDetail-backgroundColor
|
background-color $ui-dark-noteDetail-backgroundColor
|
||||||
box-shadow none
|
box-shadow none
|
||||||
|
|
||||||
|
.control-lockButton
|
||||||
|
topBarButtonDark()
|
||||||
|
|
||||||
|
.control-lockButton-tooltip
|
||||||
|
darkTooltip()
|
||||||
|
|
||||||
|
.control-trashButton
|
||||||
|
topBarButtonDark()
|
||||||
|
|
||||||
|
.control-fullScreenButton
|
||||||
|
topBarButtonDark()
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ $info-margin-under-border = 27px
|
|||||||
margin 13px 2px
|
margin 13px 2px
|
||||||
padding 0
|
padding 0
|
||||||
border-radius 17px
|
border-radius 17px
|
||||||
&:hover .info-right-button-tooltip
|
&:hover .info-left-button-tooltip
|
||||||
opacity 1
|
opacity 1
|
||||||
&:focus
|
&:focus
|
||||||
border-color $ui-favorite-star-button-color
|
border-color $ui-favorite-star-button-color
|
||||||
@@ -54,21 +54,6 @@ $info-margin-under-border = 27px
|
|||||||
bottom 1px
|
bottom 1px
|
||||||
padding-left 30px
|
padding-left 30px
|
||||||
|
|
||||||
.info-right-button
|
|
||||||
width 34px
|
|
||||||
height 34px
|
|
||||||
border-radius 17px
|
|
||||||
font-size 14px
|
|
||||||
margin 13px 7px
|
|
||||||
padding 0
|
|
||||||
border none
|
|
||||||
color $ui-button-color
|
|
||||||
background-color transparent
|
|
||||||
&:hover
|
|
||||||
opacity 1
|
|
||||||
background-color $ui-button--hover-backgroundColor
|
|
||||||
|
|
||||||
|
|
||||||
body[data-theme="dark"]
|
body[data-theme="dark"]
|
||||||
.info
|
.info
|
||||||
border-color $ui-dark-borderColor
|
border-color $ui-dark-borderColor
|
||||||
@@ -88,11 +73,3 @@ body[data-theme="dark"]
|
|||||||
|
|
||||||
.info-right
|
.info-right
|
||||||
background-color $ui-dark-noteDetail-backgroundColor
|
background-color $ui-dark-noteDetail-backgroundColor
|
||||||
|
|
||||||
.info-right-button
|
|
||||||
navDarkButtonColor()
|
|
||||||
border-color $ui-dark-borderColor
|
|
||||||
&:active
|
|
||||||
border-color $ui-dark-button--focus-borderColor
|
|
||||||
&:focus
|
|
||||||
border-color $ui-button--focus-borderColor
|
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ import StatusBar from '../StatusBar'
|
|||||||
import context from 'browser/lib/context'
|
import context from 'browser/lib/context'
|
||||||
import ConfigManager from 'browser/main/lib/ConfigManager'
|
import ConfigManager from 'browser/main/lib/ConfigManager'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
|
import { findNoteTitle } from 'browser/lib/findNoteTitle'
|
||||||
|
import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
|
||||||
|
|
||||||
function pass (name) {
|
function pass (name) {
|
||||||
switch (name) {
|
switch (name) {
|
||||||
@@ -75,41 +77,13 @@ class SnippetNoteDetail extends React.Component {
|
|||||||
if (this.saveQueue != null) this.saveNow()
|
if (this.saveQueue != null) this.saveNow()
|
||||||
}
|
}
|
||||||
|
|
||||||
findTitle (value) {
|
|
||||||
let splitted = value.split('\n')
|
|
||||||
let title = null
|
|
||||||
|
|
||||||
for (let i = 0; i < splitted.length; i++) {
|
|
||||||
let trimmedLine = splitted[i].trim()
|
|
||||||
if (trimmedLine.match(/^# .+/)) {
|
|
||||||
title = trimmedLine.substring(1, trimmedLine.length).trim()
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (title == null) {
|
|
||||||
for (let i = 0; i < splitted.length; i++) {
|
|
||||||
let trimmedLine = splitted[i].trim()
|
|
||||||
if (trimmedLine.length > 0) {
|
|
||||||
title = trimmedLine
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (title == null) {
|
|
||||||
title = ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return title
|
|
||||||
}
|
|
||||||
|
|
||||||
handleChange (e) {
|
handleChange (e) {
|
||||||
let { note } = this.state
|
let { note } = this.state
|
||||||
|
|
||||||
note.tags = this.refs.tags.value
|
note.tags = this.refs.tags.value
|
||||||
note.description = this.refs.description.value
|
note.description = this.refs.description.value
|
||||||
note.updatedAt = new Date()
|
note.updatedAt = new Date()
|
||||||
note.title = this.findTitle(note.description)
|
note.title = findNoteTitle(note.description)
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
note
|
note
|
||||||
@@ -137,6 +111,7 @@ class SnippetNoteDetail extends React.Component {
|
|||||||
type: 'UPDATE_NOTE',
|
type: 'UPDATE_NOTE',
|
||||||
note: note
|
note: note
|
||||||
})
|
})
|
||||||
|
AwsMobileAnalyticsConfig.recordDynamitCustomEvent('EDIT_NOTE')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -175,6 +150,7 @@ class SnippetNoteDetail extends React.Component {
|
|||||||
|
|
||||||
handleStarButtonClick (e) {
|
handleStarButtonClick (e) {
|
||||||
let { note } = this.state
|
let { note } = this.state
|
||||||
|
if (!note.isStarred) AwsMobileAnalyticsConfig.recordDynamitCustomEvent('ADD_STAR')
|
||||||
|
|
||||||
note.isStarred = !note.isStarred
|
note.isStarred = !note.isStarred
|
||||||
|
|
||||||
@@ -189,14 +165,7 @@ class SnippetNoteDetail extends React.Component {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
handleContextButtonClick (e) {
|
handleDeleteButtonClick (e) {
|
||||||
context.popup([{
|
|
||||||
label: 'Delete',
|
|
||||||
click: (e) => this.handleDeleteMenuClick(e)
|
|
||||||
}])
|
|
||||||
}
|
|
||||||
|
|
||||||
handleDeleteMenuClick (e) {
|
|
||||||
let index = dialog.showMessageBox(remote.getCurrentWindow(), {
|
let index = dialog.showMessageBox(remote.getCurrentWindow(), {
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
message: 'Delete a note',
|
message: 'Delete a note',
|
||||||
@@ -221,6 +190,10 @@ class SnippetNoteDetail extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleFullScreenButton (e) {
|
||||||
|
ee.emit('editor:fullscreen')
|
||||||
|
}
|
||||||
|
|
||||||
handleTabPlusButtonClick (e) {
|
handleTabPlusButtonClick (e) {
|
||||||
this.addSnippet()
|
this.addSnippet()
|
||||||
}
|
}
|
||||||
@@ -250,15 +223,15 @@ class SnippetNoteDetail extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
deleteSnippetByIndex (index) {
|
deleteSnippetByIndex (index) {
|
||||||
let snippets = this.state.note.snippets.slice()
|
const snippets = this.state.note.snippets.slice()
|
||||||
snippets.splice(index, 1)
|
snippets.splice(index, 1)
|
||||||
this.state.note.snippets = snippets
|
const note = Object.assign({}, this.state.note, {snippets})
|
||||||
let snippetIndex = this.state.snippetIndex >= snippets.length
|
const snippetIndex = this.state.snippetIndex >= snippets.length
|
||||||
? snippets.length - 1
|
? snippets.length - 1
|
||||||
: this.state.snippetIndex
|
: this.state.snippetIndex
|
||||||
this.setState({
|
this.setState({ note, snippetIndex }, () => {
|
||||||
note: this.state.note,
|
this.save()
|
||||||
snippetIndex
|
this.refs['code-' + this.state.snippetIndex].reload()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -545,10 +518,23 @@ class SnippetNoteDetail extends React.Component {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div styleName='info-right'>
|
<div styleName='info-right'>
|
||||||
<button styleName='info-right-button'
|
<button styleName='control-trashButton'
|
||||||
onClick={(e) => this.handleContextButtonClick(e)}
|
onClick={(e) => this.handleDeleteButtonClick(e)}
|
||||||
>
|
>
|
||||||
<i className='fa fa-ellipsis-v' />
|
<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
				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
				C494.308,21.067,473.24,0,447.23,0H306c-26.01,0-47.077,21.067-47.077,47.077v47.077h-141.23
				c-26.01,0-47.077,21.067-47.077,47.077v47.077c0,25.986,21.067,47.077,47.077,47.077v423.692
				c0,51.996,42.157,94.153,94.154,94.153h329.539c51.996,0,94.153-42.157,94.153-94.153V235.385
				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
				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
				 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
				 M612,188.308H141.23c-12.993,0-23.538-10.545-23.538-23.539s10.545-23.539,23.538-23.539H612
				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
				V353.077c0-12.993-10.545-23.539-23.539-23.539s-23.539,10.545-23.539,23.539v282.461
				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
				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>
|
||||||
|
<button styleName='control-fullScreenButton'
|
||||||
|
onMouseDown={(e) => this.handleFullScreenButton(e)}
|
||||||
|
>
|
||||||
|
<i className='fa fa-arrows-alt' styleName='fullScreen-button' />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
height 80px
|
height 80px
|
||||||
|
|
||||||
.body .description textarea
|
.body .description textarea
|
||||||
|
outline none
|
||||||
display block
|
display block
|
||||||
height 100%
|
height 100%
|
||||||
width 100%
|
width 100%
|
||||||
@@ -62,12 +63,18 @@
|
|||||||
button
|
button
|
||||||
navButtonColor()
|
navButtonColor()
|
||||||
height 24px
|
height 24px
|
||||||
border-width 0 1px 0 0
|
|
||||||
border-style solid
|
|
||||||
border-color $ui-borderColor
|
|
||||||
&:active .update-icon
|
&:active .update-icon
|
||||||
color white
|
color white
|
||||||
|
|
||||||
|
.control-trashButton
|
||||||
|
float right
|
||||||
|
topBarButtonLight()
|
||||||
|
|
||||||
|
.control-fullScreenButton
|
||||||
|
float right
|
||||||
|
padding 7px
|
||||||
|
topBarButtonLight()
|
||||||
|
|
||||||
body[data-theme="dark"]
|
body[data-theme="dark"]
|
||||||
.root
|
.root
|
||||||
border-color $ui-dark-borderColor
|
border-color $ui-dark-borderColor
|
||||||
@@ -79,7 +86,7 @@ body[data-theme="dark"]
|
|||||||
|
|
||||||
.body .description textarea
|
.body .description textarea
|
||||||
background-color $ui-dark-noteDetail-backgroundColor
|
background-color $ui-dark-noteDetail-backgroundColor
|
||||||
color white
|
color $ui-dark-text-color
|
||||||
|
|
||||||
.tabList
|
.tabList
|
||||||
background-color $ui-button--active-backgroundColor
|
background-color $ui-button--active-backgroundColor
|
||||||
@@ -93,3 +100,13 @@ body[data-theme="dark"]
|
|||||||
.override
|
.override
|
||||||
button
|
button
|
||||||
border-color $ui-dark-borderColor
|
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()
|
||||||
|
|
||||||
|
.control-fullScreenButton
|
||||||
|
topBarButtonDark()
|
||||||
|
|||||||
@@ -2,19 +2,46 @@
|
|||||||
left 7px
|
left 7px
|
||||||
top 0
|
top 0
|
||||||
padding 0
|
padding 0
|
||||||
|
color alpha($ui-favorite-star-button-color, 60%)
|
||||||
&:hover
|
&:hover
|
||||||
.icon
|
transition 0.15s
|
||||||
transform rotate(-72deg)
|
background-color alpha($ui-button--active-backgroundColor, 40%)
|
||||||
.tooltip
|
color $ui-favorite-star-button-color
|
||||||
opacity 1
|
&:active
|
||||||
|
transition 0.15s
|
||||||
|
background-color alpha($ui-button--active-backgroundColor, 40%)
|
||||||
|
color $ui-favorite-star-button-color
|
||||||
|
|
||||||
.root--active
|
.root--active
|
||||||
@extend .root
|
@extend .root
|
||||||
color $ui-favorite-star-button-color
|
color $ui-favorite-star-button-color
|
||||||
&:hover
|
&:hover
|
||||||
|
transition 0.15s
|
||||||
color $ui-favorite-star-button-color
|
color $ui-favorite-star-button-color
|
||||||
.icon
|
background-color alpha($ui-button--active-backgroundColor, 40%)
|
||||||
transform rotate(-72deg)
|
&:active
|
||||||
|
transition 0.15s
|
||||||
|
color $ui-favorite-star-button-color
|
||||||
|
background-color alpha($ui-button--active-backgroundColor, 40%)
|
||||||
|
|
||||||
.icon
|
.icon
|
||||||
transition transform 0.15s
|
transition transform 0.15s
|
||||||
|
|
||||||
|
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%)
|
||||||
@@ -2,6 +2,7 @@ import React, { PropTypes } from 'react'
|
|||||||
import CSSModules from 'browser/lib/CSSModules'
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
import styles from './TagSelect.styl'
|
import styles from './TagSelect.styl'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
|
import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
|
||||||
|
|
||||||
class TagSelect extends React.Component {
|
class TagSelect extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
@@ -56,6 +57,7 @@ class TagSelect extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
submitTag () {
|
submitTag () {
|
||||||
|
AwsMobileAnalyticsConfig.recordDynamitCustomEvent('ADD_TAG')
|
||||||
let { value } = this.props
|
let { value } = this.props
|
||||||
let newTag = this.refs.newTag.value.trim().replace(/ +/g, '_')
|
let newTag = this.refs.newTag.value.trim().replace(/ +/g, '_')
|
||||||
|
|
||||||
@@ -107,7 +109,7 @@ class TagSelect extends React.Component {
|
|||||||
<span styleName='tag'
|
<span styleName='tag'
|
||||||
key={tag}
|
key={tag}
|
||||||
>
|
>
|
||||||
<span styleName='tag-label'>{tag}</span>
|
<span styleName='tag-label'>#{tag}</span>
|
||||||
<button styleName='tag-removeButton'
|
<button styleName='tag-removeButton'
|
||||||
onClick={(e) => this.handleTagRemoveButtonClick(tag)(e)}
|
onClick={(e) => this.handleTagRemoveButtonClick(tag)(e)}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -12,12 +12,12 @@
|
|||||||
|
|
||||||
.tag
|
.tag
|
||||||
display inline-block
|
display inline-block
|
||||||
margin 0 2px
|
margin 1px 3px
|
||||||
padding-left 10px
|
padding 0
|
||||||
vertical-align middle
|
vertical-align middle
|
||||||
height 20px
|
height 20px
|
||||||
background-color $ui-tag-backgroundColor
|
background-color alpha($ui-tag-backgroundColor, 10%)
|
||||||
border-radius 20px
|
border-radius 3px
|
||||||
overflow hidden
|
overflow hidden
|
||||||
clearfix()
|
clearfix()
|
||||||
|
|
||||||
@@ -39,9 +39,9 @@
|
|||||||
padding-right 4px
|
padding-right 4px
|
||||||
|
|
||||||
.tag-label
|
.tag-label
|
||||||
font-size 12px
|
font-size 11px
|
||||||
font-weight bold
|
font-weight 600
|
||||||
color: #FFFFFF
|
color: alpha($ui-text-color, 80%)
|
||||||
float left
|
float left
|
||||||
height 20px
|
height 20px
|
||||||
line-height 20px
|
line-height 20px
|
||||||
@@ -54,36 +54,13 @@
|
|||||||
height 24px
|
height 24px
|
||||||
box-sizing borde-box
|
box-sizing borde-box
|
||||||
border none
|
border none
|
||||||
border-bottom $ui-border
|
|
||||||
background-color transparent
|
background-color transparent
|
||||||
outline none
|
outline none
|
||||||
padding 0 4px
|
padding 0 4px
|
||||||
&:focus
|
|
||||||
border-color $ui-input--focus-borderColor = #369DCD
|
|
||||||
&:disabled
|
|
||||||
background-color $ui-input--disabled-backgroundColor = #DDD
|
|
||||||
|
|
||||||
.add-tag-button
|
|
||||||
display inline
|
|
||||||
margin-left 5px
|
|
||||||
width 20px
|
|
||||||
height 20px
|
|
||||||
border none
|
|
||||||
border-radius 20px
|
|
||||||
padding 0
|
|
||||||
color #FFFFFF
|
|
||||||
&:hover
|
|
||||||
background-color rgba(0, 0, 0, 0.3)
|
|
||||||
&:active, &:active:hover
|
|
||||||
background-color rgba(0, 0, 0, 0.5)
|
|
||||||
color $ui-button--active-color
|
|
||||||
|
|
||||||
body[data-theme="dark"]
|
body[data-theme="dark"]
|
||||||
.icon
|
|
||||||
color $ui-dark-button-color
|
|
||||||
|
|
||||||
.tag
|
.tag
|
||||||
background-color $ui-dark-tag-backgroundColor
|
background-color alpha($ui-dark-tag-backgroundColor, 60%)
|
||||||
|
|
||||||
.tag-removeButton
|
.tag-removeButton
|
||||||
border-color $ui-button--focus-borderColor
|
border-color $ui-button--focus-borderColor
|
||||||
@@ -94,17 +71,6 @@ body[data-theme="dark"]
|
|||||||
color $ui-dark-text-color
|
color $ui-dark-text-color
|
||||||
|
|
||||||
.newTag
|
.newTag
|
||||||
border-color $ui-dark-borderColor
|
border-color none
|
||||||
background-color transparent
|
background-color transparent
|
||||||
color $ui-dark-text-color
|
color $ui-dark-text-color
|
||||||
&:focus
|
|
||||||
border-color $ui-input--focus-borderColor = #369DCD
|
|
||||||
&:disabled
|
|
||||||
background-color $ui-input--disabled-backgroundColor = #DDD
|
|
||||||
|
|
||||||
.add-tag-button
|
|
||||||
&:hover
|
|
||||||
background-color rgba(255, 255, 255, 0.3)
|
|
||||||
&:active, &:active:hover
|
|
||||||
background-color rgba(255, 255, 255, 0.5)
|
|
||||||
color $ui-button--active-color
|
|
||||||
@@ -17,7 +17,7 @@ class Detail extends React.Component {
|
|||||||
this.refs.root != null && this.refs.root.focus()
|
this.refs.root != null && this.refs.root.focus()
|
||||||
}
|
}
|
||||||
this.deleteHandler = () => {
|
this.deleteHandler = () => {
|
||||||
this.refs.root != null && this.refs.root.handleDeleteMenuClick()
|
this.refs.root != null && this.refs.root.handleDeleteButtonClick()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ import ConfigManager from 'browser/main/lib/ConfigManager'
|
|||||||
import modal from 'browser/main/lib/modal'
|
import modal from 'browser/main/lib/modal'
|
||||||
import InitModal from 'browser/main/modals/InitModal'
|
import InitModal from 'browser/main/modals/InitModal'
|
||||||
import mixpanel from 'browser/main/lib/mixpanel'
|
import mixpanel from 'browser/main/lib/mixpanel'
|
||||||
|
import mobileAnalytics from 'browser/main/lib/AwsMobileAnalyticsConfig'
|
||||||
|
import eventEmitter from 'browser/main/lib/eventEmitter'
|
||||||
|
|
||||||
function focused () {
|
function focused () {
|
||||||
mixpanel.track('MAIN_FOCUSED')
|
mixpanel.track('MAIN_FOCUSED')
|
||||||
@@ -21,14 +23,23 @@ class Main extends React.Component {
|
|||||||
constructor (props) {
|
constructor (props) {
|
||||||
super(props)
|
super(props)
|
||||||
|
|
||||||
|
if (process.env.NODE_ENV === 'production') {
|
||||||
|
mobileAnalytics.initAwsMobileAnalytics()
|
||||||
|
}
|
||||||
|
|
||||||
let { config } = props
|
let { config } = props
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
isRightSliderFocused: false,
|
isRightSliderFocused: false,
|
||||||
listWidth: config.listWidth,
|
listWidth: config.listWidth,
|
||||||
navWidth: config.navWidth,
|
navWidth: config.navWidth,
|
||||||
isLeftSliderFocused: false
|
isLeftSliderFocused: false,
|
||||||
|
fullScreen: false,
|
||||||
|
noteDetailWidth: 0,
|
||||||
|
mainBodyWidth: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.toggleFullScreen = () => this.handleFullScreenButton()
|
||||||
}
|
}
|
||||||
|
|
||||||
getChildContext () {
|
getChildContext () {
|
||||||
@@ -63,11 +74,13 @@ class Main extends React.Component {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
eventEmitter.on('editor:fullscreen', this.toggleFullScreen)
|
||||||
window.addEventListener('focus', focused)
|
window.addEventListener('focus', focused)
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount () {
|
componentWillUnmount () {
|
||||||
window.removeEventListener('focus', focused)
|
window.removeEventListener('focus', focused)
|
||||||
|
eventEmitter.off('editor:fullscreen', this.toggleFullScreen)
|
||||||
}
|
}
|
||||||
|
|
||||||
handleLeftSlideMouseDown (e) {
|
handleLeftSlideMouseDown (e) {
|
||||||
@@ -144,6 +157,34 @@ class Main extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleFullScreenButton (e) {
|
||||||
|
this.setState({ fullScreen: !this.state.fullScreen }, () => {
|
||||||
|
const noteDetail = document.querySelector('.NoteDetail')
|
||||||
|
const noteList = document.querySelector('.NoteList')
|
||||||
|
const mainBody = document.querySelector('#main-body')
|
||||||
|
|
||||||
|
if (this.state.fullScreen) {
|
||||||
|
this.hideLeftLists(noteDetail, noteList, mainBody)
|
||||||
|
} else {
|
||||||
|
this.showLeftLists(noteDetail, noteList, mainBody)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
hideLeftLists (noteDetail, noteList, mainBody) {
|
||||||
|
this.state.noteDetailWidth = noteDetail.style.left
|
||||||
|
this.state.mainBodyWidth = mainBody.style.left
|
||||||
|
noteDetail.style.left = '0px'
|
||||||
|
mainBody.style.left = '0px'
|
||||||
|
noteList.style.display = 'none'
|
||||||
|
}
|
||||||
|
|
||||||
|
showLeftLists (noteDetail, noteList, mainBody) {
|
||||||
|
noteDetail.style.left = this.state.noteDetailWidth
|
||||||
|
mainBody.style.left = this.state.mainBodyWidth
|
||||||
|
noteList.style.display = 'inline'
|
||||||
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
let { config } = this.props
|
let { config } = this.props
|
||||||
|
|
||||||
@@ -173,6 +214,7 @@ class Main extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
<div styleName={config.isSideNavFolded ? 'body--expanded' : 'body'}
|
<div styleName={config.isSideNavFolded ? 'body--expanded' : 'body'}
|
||||||
|
id='main-body'
|
||||||
ref='body'
|
ref='body'
|
||||||
style={{left: config.isSideNavFolded ? 44 : this.state.navWidth}}
|
style={{left: config.isSideNavFolded ? 44 : this.state.navWidth}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -13,10 +13,12 @@
|
|||||||
absolute top bottom
|
absolute top bottom
|
||||||
top -2px
|
top -2px
|
||||||
width 0
|
width 0
|
||||||
|
z-index 0
|
||||||
|
|
||||||
.slider-right
|
.slider-right
|
||||||
@extend .slider
|
@extend .slider
|
||||||
width 1px
|
width 1px
|
||||||
|
z-index 0
|
||||||
|
|
||||||
.slider--active
|
.slider--active
|
||||||
@extend .slider
|
@extend .slider
|
||||||
|
|||||||
@@ -20,31 +20,36 @@ $control-height = 30px
|
|||||||
padding-left 25px
|
padding-left 25px
|
||||||
|
|
||||||
.control-sortBy-select
|
.control-sortBy-select
|
||||||
margin-left 0
|
appearance: none;
|
||||||
font-size 12px
|
margin-left 3px
|
||||||
color $ui-inactive-text-color
|
color $ui-inactive-text-color
|
||||||
padding 0
|
padding 0
|
||||||
border none
|
border none
|
||||||
background-color transparent
|
background-color transparent
|
||||||
|
outline none
|
||||||
|
cursor pointer
|
||||||
font-size 10px
|
font-size 10px
|
||||||
|
&:hover
|
||||||
|
transition 0.2s
|
||||||
|
color $ui-text-color
|
||||||
|
|
||||||
.control-button
|
.control-button
|
||||||
width 25px
|
width 25px
|
||||||
padding 0
|
padding 0
|
||||||
background-color transparent
|
background-color transparent
|
||||||
border none
|
border none
|
||||||
color $ui-inactive-text-color
|
color alpha($ui-inactive-text-color, 60%)
|
||||||
transition 0.15s
|
transition 0.15s
|
||||||
&:active, &:active:hover
|
&:active, &:active:hover
|
||||||
color $ui-active-color
|
color $ui-inactive-text-color
|
||||||
&:hover
|
&:hover
|
||||||
color $ui-text-color
|
color $ui-inactive-text-color
|
||||||
|
|
||||||
.control-button--active
|
.control-button--active
|
||||||
@extend .control-button
|
@extend .control-button
|
||||||
color $ui-active-color
|
color $ui-inactive-text-color
|
||||||
&:hover
|
&:hover
|
||||||
color $ui-active-color
|
color $ui-inactive-text-color
|
||||||
|
|
||||||
.list
|
.list
|
||||||
absolute left right bottom
|
absolute left right bottom
|
||||||
@@ -56,15 +61,21 @@ body[data-theme="dark"]
|
|||||||
border-color $ui-dark-borderColor
|
border-color $ui-dark-borderColor
|
||||||
background-color $ui-dark-noteList-backgroundColor
|
background-color $ui-dark-noteList-backgroundColor
|
||||||
|
|
||||||
.control
|
|
||||||
background-color $ui-dark-noteList-backgroundColor
|
|
||||||
|
|
||||||
.control
|
.control
|
||||||
background-color $ui-dark-noteList-backgroundColor
|
background-color $ui-dark-noteList-backgroundColor
|
||||||
border-color $ui-dark-borderColor
|
border-color $ui-dark-borderColor
|
||||||
|
|
||||||
|
.control-sortBy-select
|
||||||
|
&:hover
|
||||||
|
transition 0.2s
|
||||||
|
color $ui-dark-text-color
|
||||||
|
|
||||||
.control-button
|
.control-button
|
||||||
color $ui-dark-inactive-text-color
|
color $ui-dark-inactive-text-color
|
||||||
&:hover
|
&:hover
|
||||||
color $ui-dark-text-color
|
color $ui-dark-text-color
|
||||||
|
|
||||||
|
.control-button--active
|
||||||
|
color $ui-dark-text-color
|
||||||
|
&:active
|
||||||
|
color $ui-dark-text-color
|
||||||
@@ -8,6 +8,11 @@ import dataApi from 'browser/main/lib/dataApi'
|
|||||||
import ConfigManager from 'browser/main/lib/ConfigManager'
|
import ConfigManager from 'browser/main/lib/ConfigManager'
|
||||||
import NoteItem from 'browser/components/NoteItem'
|
import NoteItem from 'browser/components/NoteItem'
|
||||||
import NoteItemSimple from 'browser/components/NoteItemSimple'
|
import NoteItemSimple from 'browser/components/NoteItemSimple'
|
||||||
|
import searchFromNotes from 'browser/lib/search'
|
||||||
|
import fs from 'fs'
|
||||||
|
import { hashHistory } from 'react-router'
|
||||||
|
import markdown from 'browser/lib/markdown'
|
||||||
|
import { findNoteTitle } from 'browser/lib/findNoteTitle'
|
||||||
|
|
||||||
const { remote } = require('electron')
|
const { remote } = require('electron')
|
||||||
const { Menu, MenuItem, dialog } = remote
|
const { Menu, MenuItem, dialog } = remote
|
||||||
@@ -38,9 +43,14 @@ class NoteList extends React.Component {
|
|||||||
this.focusHandler = () => {
|
this.focusHandler = () => {
|
||||||
this.refs.list.focus()
|
this.refs.list.focus()
|
||||||
}
|
}
|
||||||
this.alertIfSnippetHnalder = () => {
|
this.alertIfSnippetHandler = () => {
|
||||||
this.alertIfSnippet()
|
this.alertIfSnippet()
|
||||||
}
|
}
|
||||||
|
this.importFromFileHandler = this.importFromFile.bind(this)
|
||||||
|
|
||||||
|
this.jumpToTopHandler = () => {
|
||||||
|
this.jumpToTop()
|
||||||
|
}
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
}
|
}
|
||||||
@@ -51,7 +61,10 @@ class NoteList extends React.Component {
|
|||||||
ee.on('list:next', this.selectNextNoteHandler)
|
ee.on('list:next', this.selectNextNoteHandler)
|
||||||
ee.on('list:prior', this.selectPriorNoteHandler)
|
ee.on('list:prior', this.selectPriorNoteHandler)
|
||||||
ee.on('list:focus', this.focusHandler)
|
ee.on('list:focus', this.focusHandler)
|
||||||
ee.on('list:isMarkdownNote', this.alertIfSnippetHnalder)
|
ee.on('list:isMarkdownNote', this.alertIfSnippetHandler)
|
||||||
|
ee.on('list:top', this.jumpToTopHandler)
|
||||||
|
ee.on('list:jumpToTop', this.jumpToTopHandler)
|
||||||
|
ee.on('import:file', this.importFromFileHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps (nextProps) {
|
componentWillReceiveProps (nextProps) {
|
||||||
@@ -70,7 +83,10 @@ class NoteList extends React.Component {
|
|||||||
ee.off('list:next', this.selectNextNoteHandler)
|
ee.off('list:next', this.selectNextNoteHandler)
|
||||||
ee.off('list:prior', this.selectPriorNoteHandler)
|
ee.off('list:prior', this.selectPriorNoteHandler)
|
||||||
ee.off('list:focus', this.focusHandler)
|
ee.off('list:focus', this.focusHandler)
|
||||||
ee.off('list:isMarkdownNote', this.alertIfSnippetHnalder)
|
ee.off('list:isMarkdownNote', this.alertIfSnippetHandler)
|
||||||
|
ee.off('list:top', this.jumpToTopHandler)
|
||||||
|
ee.off('list:jumpToTop', this.jumpToTopHandler)
|
||||||
|
ee.off('import:file', this.importFromFileHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate (prevProps) {
|
componentDidUpdate (prevProps) {
|
||||||
@@ -194,6 +210,7 @@ class NoteList extends React.Component {
|
|||||||
|
|
||||||
getNotes () {
|
getNotes () {
|
||||||
let { data, params, location } = this.props
|
let { data, params, location } = this.props
|
||||||
|
let { router } = this.context
|
||||||
|
|
||||||
if (location.pathname.match(/\/home/)) {
|
if (location.pathname.match(/\/home/)) {
|
||||||
return data.noteMap.map((note) => note)
|
return data.noteMap.map((note) => note)
|
||||||
@@ -204,6 +221,14 @@ class NoteList extends React.Component {
|
|||||||
.map((uniqueKey) => data.noteMap.get(uniqueKey))
|
.map((uniqueKey) => data.noteMap.get(uniqueKey))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (location.pathname.match(/\/searched/)) {
|
||||||
|
const searchInputText = document.getElementsByClassName('searchInput')[0].value
|
||||||
|
if (searchInputText === '') {
|
||||||
|
router.push('/home')
|
||||||
|
}
|
||||||
|
return searchFromNotes(this.props.data, searchInputText)
|
||||||
|
}
|
||||||
|
|
||||||
let storageKey = params.storageKey
|
let storageKey = params.storageKey
|
||||||
let folderKey = params.folderKey
|
let folderKey = params.folderKey
|
||||||
let storage = data.storageMap.get(storageKey)
|
let storage = data.storageMap.get(storageKey)
|
||||||
@@ -310,7 +335,7 @@ class NoteList extends React.Component {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
alertIfSnippet() {
|
alertIfSnippet () {
|
||||||
let { location } = this.props
|
let { location } = this.props
|
||||||
const targetIndex = _.findIndex(this.notes, (note) => {
|
const targetIndex = _.findIndex(this.notes, (note) => {
|
||||||
return `${note.storage}-${note.key}` === location.query.key
|
return `${note.storage}-${note.key}` === location.query.key
|
||||||
@@ -319,13 +344,81 @@ class NoteList extends React.Component {
|
|||||||
dialog.showMessageBox(remote.getCurrentWindow(), {
|
dialog.showMessageBox(remote.getCurrentWindow(), {
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
message: 'Sorry!',
|
message: 'Sorry!',
|
||||||
detail: 'md/text import is available only a markdown note.'
|
detail: 'md/text import is available only a markdown note.',
|
||||||
|
buttons: ['OK', 'Cancel']
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
handleDragStart (e, note) {
|
||||||
|
const noteData = JSON.stringify(note)
|
||||||
|
e.dataTransfer.setData('note', noteData)
|
||||||
|
}
|
||||||
|
|
||||||
|
importFromFile () {
|
||||||
|
const { dispatch, location } = this.props
|
||||||
|
|
||||||
|
const options = {
|
||||||
|
filters: [
|
||||||
|
{ name: 'Documents', extensions: ['md', 'txt'] }
|
||||||
|
],
|
||||||
|
properties: ['openFile', 'multiSelections']
|
||||||
|
}
|
||||||
|
|
||||||
|
const targetIndex = _.findIndex(this.notes, (note) => {
|
||||||
|
return note !== null && `${note.storage}-${note.key}` === location.query.key
|
||||||
|
})
|
||||||
|
|
||||||
|
const storageKey = this.notes[targetIndex].storage
|
||||||
|
const folderKey = this.notes[targetIndex].folder
|
||||||
|
|
||||||
|
dialog.showOpenDialog(remote.getCurrentWindow(), options, (filepaths) => {
|
||||||
|
if (filepaths === undefined) return
|
||||||
|
filepaths.forEach((filepath) => {
|
||||||
|
fs.readFile(filepath, (err, data) => {
|
||||||
|
if (err) throw Error('File reading error: ', err)
|
||||||
|
const content = data.toString()
|
||||||
|
const newNote = {
|
||||||
|
content: content,
|
||||||
|
folder: folderKey,
|
||||||
|
title: markdown.strip(findNoteTitle(content)),
|
||||||
|
type: 'MARKDOWN_NOTE'
|
||||||
|
}
|
||||||
|
dataApi.createNote(storageKey, newNote)
|
||||||
|
.then((note) => {
|
||||||
|
dispatch({
|
||||||
|
type: 'UPDATE_NOTE',
|
||||||
|
note: note
|
||||||
|
})
|
||||||
|
hashHistory.push({
|
||||||
|
pathname: location.pathname,
|
||||||
|
query: {key: `${note.storage}-${note.key}`}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
let { location, notes, config } = this.props
|
let { location, notes, config, dispatch } = this.props
|
||||||
let sortFunc = config.sortBy === 'CREATED_AT'
|
let sortFunc = config.sortBy === 'CREATED_AT'
|
||||||
? sortByCreatedAt
|
? sortByCreatedAt
|
||||||
: config.sortBy === 'ALPHABETICAL'
|
: config.sortBy === 'ALPHABETICAL'
|
||||||
@@ -357,6 +450,7 @@ class NoteList extends React.Component {
|
|||||||
key={key}
|
key={key}
|
||||||
handleNoteClick={this.handleNoteClick.bind(this)}
|
handleNoteClick={this.handleNoteClick.bind(this)}
|
||||||
handleNoteContextMenu={this.handleNoteContextMenu.bind(this)}
|
handleNoteContextMenu={this.handleNoteContextMenu.bind(this)}
|
||||||
|
handleDragStart={this.handleDragStart.bind(this)}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -368,6 +462,7 @@ class NoteList extends React.Component {
|
|||||||
key={key}
|
key={key}
|
||||||
handleNoteClick={this.handleNoteClick.bind(this)}
|
handleNoteClick={this.handleNoteClick.bind(this)}
|
||||||
handleNoteContextMenu={this.handleNoteContextMenu.bind(this)}
|
handleNoteContextMenu={this.handleNoteContextMenu.bind(this)}
|
||||||
|
handleDragStart={this.handleDragStart.bind(this)}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
@@ -379,7 +474,7 @@ class NoteList extends React.Component {
|
|||||||
>
|
>
|
||||||
<div styleName='control'>
|
<div styleName='control'>
|
||||||
<div styleName='control-sortBy'>
|
<div styleName='control-sortBy'>
|
||||||
Sort by
|
<i className='fa fa-bolt' />
|
||||||
<select styleName='control-sortBy-select'
|
<select styleName='control-sortBy-select'
|
||||||
value={config.sortBy}
|
value={config.sortBy}
|
||||||
onChange={(e) => this.handleSortByChange(e)}
|
onChange={(e) => this.handleSortByChange(e)}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
.root
|
.root
|
||||||
absolute top left bottom
|
absolute top left bottom
|
||||||
width $sideNav-width
|
width $sideNav-width
|
||||||
background-color $ui-backgroundColor
|
background-color #f9f9f9
|
||||||
user-select none
|
user-select none
|
||||||
color $ui-text-color
|
color $ui-text-color
|
||||||
|
|
||||||
@@ -12,9 +12,14 @@
|
|||||||
navButtonColor()
|
navButtonColor()
|
||||||
height $topBar-height
|
height $topBar-height
|
||||||
padding 0 15px
|
padding 0 15px
|
||||||
font-size 14px
|
font-size 12px
|
||||||
width 100%
|
width 100%
|
||||||
text-align left
|
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
|
.top-menu-label
|
||||||
margin-left 5px
|
margin-left 5px
|
||||||
@@ -110,10 +115,16 @@ body[data-theme="dark"]
|
|||||||
|
|
||||||
.top-menu
|
.top-menu
|
||||||
navDarkButtonColor()
|
navDarkButtonColor()
|
||||||
|
&:active
|
||||||
|
background-color alpha($ui-dark-button--active-backgroundColor, 20%)
|
||||||
|
&:hover
|
||||||
|
background-color alpha($ui-dark-button--active-backgroundColor, 20%)
|
||||||
|
|
||||||
.storageList-empty
|
.storageList-empty
|
||||||
color $ui-dark-inactive-text-color
|
color $ui-dark-inactive-text-color
|
||||||
|
|
||||||
.navToggle
|
.navToggle
|
||||||
navDarkButtonColor()
|
&:hover
|
||||||
|
background-color alpha($ui-dark-button--active-backgroundColor, 20%)
|
||||||
|
transition 0.15s
|
||||||
|
color $ui-dark-text-color
|
||||||
@@ -7,6 +7,7 @@ import CreateFolderModal from 'browser/main/modals/CreateFolderModal'
|
|||||||
import RenameFolderModal from 'browser/main/modals/RenameFolderModal'
|
import RenameFolderModal from 'browser/main/modals/RenameFolderModal'
|
||||||
import dataApi from 'browser/main/lib/dataApi'
|
import dataApi from 'browser/main/lib/dataApi'
|
||||||
import StorageItemChild from 'browser/components/StorageItem'
|
import StorageItemChild from 'browser/components/StorageItem'
|
||||||
|
import eventEmitter from 'browser/main/lib/eventEmitter'
|
||||||
|
|
||||||
const { remote } = require('electron')
|
const { remote } = require('electron')
|
||||||
const { Menu, MenuItem, dialog } = remote
|
const { Menu, MenuItem, dialog } = remote
|
||||||
@@ -131,8 +132,54 @@ class StorageItem extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleDragEnter (e) {
|
||||||
|
e.dataTransfer.setData('defaultColor', e.target.style.backgroundColor)
|
||||||
|
e.target.style.backgroundColor = 'rgba(129, 130, 131, 0.08)'
|
||||||
|
}
|
||||||
|
|
||||||
|
handleDragLeave (e) {
|
||||||
|
e.target.style.opacity = '1'
|
||||||
|
e.target.style.backgroundColor = e.dataTransfer.getData('defaultColor')
|
||||||
|
}
|
||||||
|
|
||||||
|
handleDrop (e, storage, folder, dispatch, location) {
|
||||||
|
e.target.style.opacity = '1'
|
||||||
|
e.target.style.backgroundColor = e.dataTransfer.getData('defaultColor')
|
||||||
|
const noteData = JSON.parse(e.dataTransfer.getData('note'))
|
||||||
|
const newNoteData = Object.assign({}, noteData, {storage: storage, folder: folder.key})
|
||||||
|
if (folder.key === noteData.folder) return
|
||||||
|
dataApi
|
||||||
|
.createNote(storage.key, newNoteData)
|
||||||
|
.then((note) => {
|
||||||
|
dataApi
|
||||||
|
.deleteNote(noteData.storage, noteData.key)
|
||||||
|
.then((data) => {
|
||||||
|
let dispatchHandler = () => {
|
||||||
|
dispatch({
|
||||||
|
type: 'DELETE_NOTE',
|
||||||
|
storageKey: data.storageKey,
|
||||||
|
noteKey: data.noteKey
|
||||||
|
})
|
||||||
|
}
|
||||||
|
eventEmitter.once('list:moved', dispatchHandler)
|
||||||
|
eventEmitter.emit('list:next')
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.error(err)
|
||||||
|
})
|
||||||
|
dispatch({
|
||||||
|
type: 'UPDATE_NOTE',
|
||||||
|
note: note
|
||||||
|
})
|
||||||
|
hashHistory.push({
|
||||||
|
pathname: location.pathname,
|
||||||
|
query: {key: `${note.storage}-${note.key}`}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
let { storage, location, isFolded, data } = this.props
|
let { storage, location, isFolded, data, dispatch } = this.props
|
||||||
let { folderNoteMap } = data
|
let { folderNoteMap } = data
|
||||||
let folderList = storage.folders.map((folder) => {
|
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)))
|
||||||
@@ -151,6 +198,9 @@ class StorageItem extends React.Component {
|
|||||||
folderColor={folder.color}
|
folderColor={folder.color}
|
||||||
isFolded={isFolded}
|
isFolded={isFolded}
|
||||||
noteCount={noteCount}
|
noteCount={noteCount}
|
||||||
|
handleDrop={(e) => this.handleDrop(e, storage, folder, dispatch, location)}
|
||||||
|
handleDragEnter={this.handleDragEnter}
|
||||||
|
handleDragLeave={this.handleDragLeave}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -4,81 +4,75 @@
|
|||||||
|
|
||||||
.header
|
.header
|
||||||
position relative
|
position relative
|
||||||
height 26px
|
height 25px
|
||||||
width 100%
|
width 100%
|
||||||
margin-bottom 5px
|
margin-bottom 5px
|
||||||
transition 0.15s
|
transition 0.15s
|
||||||
&:hover
|
|
||||||
background-color $ui-button--hover-backgroundColor
|
|
||||||
&:active
|
|
||||||
.header-toggleButton
|
|
||||||
.header-addFolderButton
|
|
||||||
color white
|
|
||||||
&:active
|
|
||||||
color $ui-active-color
|
|
||||||
|
|
||||||
.header--active
|
.header--active
|
||||||
@extend .header
|
margin-bottom 5px
|
||||||
.header-info
|
background-color $ui-button--active-backgroundColor
|
||||||
color $ui-button--active-color
|
transition color background-color 0.15s
|
||||||
background-color $ui-button--active-backgroundColor
|
|
||||||
|
.header--active
|
||||||
.header-toggleButton
|
.header-toggleButton
|
||||||
|
color $ui-text-color
|
||||||
|
|
||||||
|
.header--active
|
||||||
|
.header-info
|
||||||
|
color $ui-text-color
|
||||||
|
|
||||||
|
.header--active
|
||||||
.header-addFolderButton
|
.header-addFolderButton
|
||||||
color white
|
color $ui-text-color
|
||||||
&:active
|
|
||||||
&:hover
|
|
||||||
&:hover:active
|
|
||||||
color white
|
|
||||||
|
|
||||||
.header-toggleButton
|
.header-toggleButton
|
||||||
|
navButtonColor()
|
||||||
position absolute
|
position absolute
|
||||||
left 0
|
left 0
|
||||||
width 25px
|
width 25px
|
||||||
height 26px
|
height 25px
|
||||||
padding 0
|
padding 0
|
||||||
border none
|
border none
|
||||||
color $ui-inactive-text-color
|
border-radius 50%
|
||||||
background-color transparent
|
|
||||||
&:hover
|
&:hover
|
||||||
|
transition 0.2s
|
||||||
|
background-color alpha($ui-button--active-backgroundColor, 40%)
|
||||||
color $ui-text-color
|
color $ui-text-color
|
||||||
&:active
|
|
||||||
color $ui-active-color
|
|
||||||
|
|
||||||
.header-info
|
.header-info
|
||||||
|
navButtonColor()
|
||||||
display block
|
display block
|
||||||
width 100%
|
width 100%
|
||||||
height 30px
|
height 25px
|
||||||
padding-left 25px
|
padding-left 23px
|
||||||
padding-right 10px
|
padding-right 10px
|
||||||
line-height 26px
|
line-height 22px
|
||||||
cursor pointer
|
cursor pointer
|
||||||
font-size 14px
|
font-size 13px
|
||||||
border none
|
border none
|
||||||
overflow ellipsis
|
overflow ellipsis
|
||||||
text-align left
|
text-align left
|
||||||
background-color transparent
|
background-color alpha($ui-button--active-backgroundColor, 20%)
|
||||||
color $ui-inactive-text-color
|
|
||||||
&:active
|
|
||||||
color $ui-button--active-color
|
|
||||||
background-color $ui-button--active-backgroundColor
|
|
||||||
|
|
||||||
.header-info-path
|
.header-info-path
|
||||||
font-size 10px
|
font-size 10px
|
||||||
margin 0 5px
|
margin 0 5px
|
||||||
|
|
||||||
.header-addFolderButton
|
.header-addFolderButton
|
||||||
|
navButtonColor()
|
||||||
position absolute
|
position absolute
|
||||||
right 0
|
right 0
|
||||||
width 25px
|
width 25px
|
||||||
height 26px
|
height 25px
|
||||||
padding 0
|
padding 0
|
||||||
border none
|
border none
|
||||||
color $ui-inactive-text-color
|
margin-right 5px
|
||||||
background-color transparent
|
border-radius 50%
|
||||||
&:hover
|
&:hover
|
||||||
|
transition 0.2s
|
||||||
|
background-color alpha($ui-button--active-backgroundColor, 40%)
|
||||||
color $ui-text-color
|
color $ui-text-color
|
||||||
&:active
|
|
||||||
color $ui-active-color
|
|
||||||
|
|
||||||
.root--folded
|
.root--folded
|
||||||
@extend .root
|
@extend .root
|
||||||
@@ -108,16 +102,50 @@
|
|||||||
margin 0 5px
|
margin 0 5px
|
||||||
|
|
||||||
body[data-theme="dark"]
|
body[data-theme="dark"]
|
||||||
.header-toggleButton
|
.header--active
|
||||||
.header-addFolderButton
|
background-color $ui-dark-button--active-backgroundColor
|
||||||
color $ui-dark-inactive-text-color
|
transition color background-color 0.15s
|
||||||
&:hover
|
|
||||||
color $ui-dark-text-color
|
|
||||||
&:active
|
|
||||||
color $ui-dark-active-color
|
|
||||||
.header--active
|
.header--active
|
||||||
.header-toggleButton
|
.header-toggleButton
|
||||||
.header-addFolderButton
|
color $ui-dark-text-color
|
||||||
color white
|
|
||||||
|
.header--active
|
||||||
|
.header-info
|
||||||
|
color $ui-dark-text-color
|
||||||
|
background-color $ui-dark-button--active-backgroundColor
|
||||||
&:active
|
&: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
|
||||||
|
transition 0.2s
|
||||||
|
color $ui-dark-text-color
|
||||||
|
background-color alpha($ui-dark-button--active-backgroundColor, 60%)
|
||||||
|
&:active, &:active:hover
|
||||||
|
color $ui-dark-text-color
|
||||||
|
background-color $ui-dark-button--active-backgroundColor
|
||||||
|
|
||||||
|
.header-info
|
||||||
|
background-color alpha($ui-dark-button--active-backgroundColor, 20%)
|
||||||
|
&:hover
|
||||||
|
transition 0.2s
|
||||||
|
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
|
||||||
|
transition 0.2s
|
||||||
|
color $ui-dark-text-color
|
||||||
|
background-color alpha($ui-dark-button--active-backgroundColor, 60%)
|
||||||
|
&:active, &:active:hover
|
||||||
|
color $ui-dark-text-color
|
||||||
|
background-color $ui-dark-button--active-backgroundColor
|
||||||
@@ -4,9 +4,7 @@
|
|||||||
absolute bottom left right
|
absolute bottom left right
|
||||||
height $statusBar-height
|
height $statusBar-height
|
||||||
background-color $ui-noteDetail-backgroundColor
|
background-color $ui-noteDetail-backgroundColor
|
||||||
border-top $ui-border
|
|
||||||
display flex
|
display flex
|
||||||
box-shadow $note-detail-box-shadow
|
|
||||||
|
|
||||||
.blank
|
.blank
|
||||||
flex 1
|
flex 1
|
||||||
@@ -24,9 +22,6 @@
|
|||||||
.zoom
|
.zoom
|
||||||
navButtonColor()
|
navButtonColor()
|
||||||
height 24px
|
height 24px
|
||||||
border-width 0 1px
|
|
||||||
border-style solid
|
|
||||||
border-color $ui-borderColor
|
|
||||||
|
|
||||||
.update
|
.update
|
||||||
navButtonColor()
|
navButtonColor()
|
||||||
@@ -48,6 +43,10 @@ body[data-theme="dark"]
|
|||||||
|
|
||||||
.zoom
|
.zoom
|
||||||
border-color $ui-dark-borderColor
|
border-color $ui-dark-borderColor
|
||||||
|
&:hover
|
||||||
|
background-color alpha($ui-dark-button--active-backgroundColor, 20%)
|
||||||
|
transition 0.15s
|
||||||
|
color $ui-dark-text-color
|
||||||
|
|
||||||
.help
|
.help
|
||||||
navButtonColor()
|
navButtonColor()
|
||||||
|
|||||||
@@ -44,12 +44,13 @@ $control-height = 34px
|
|||||||
.control-search-optionList
|
.control-search-optionList
|
||||||
position fixed
|
position fixed
|
||||||
z-index 200
|
z-index 200
|
||||||
width 275px
|
width 500px
|
||||||
height 175px
|
height 250px
|
||||||
overflow-y auto
|
overflow-y auto
|
||||||
background-color $modal-background
|
background-color $modal-background
|
||||||
border-radius 2px
|
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
|
.control-search-optionList-item
|
||||||
height 50px
|
height 50px
|
||||||
@@ -59,10 +60,10 @@ $control-height = 34px
|
|||||||
cursor pointer
|
cursor pointer
|
||||||
overflow ellipsis
|
overflow ellipsis
|
||||||
&:hover
|
&:hover
|
||||||
background-color alpha($ui-active-color, 10%)
|
background-color alpha(#D4D4D4, 30%)
|
||||||
|
|
||||||
.control-search-optionList-item-folder
|
.control-search-optionList-item-folder
|
||||||
border-left 4px solid transparent
|
border-left 2px solid transparent
|
||||||
padding 2px 5px
|
padding 2px 5px
|
||||||
color $ui-text-color
|
color $ui-text-color
|
||||||
overflow ellipsis
|
overflow ellipsis
|
||||||
@@ -144,7 +145,7 @@ body[data-theme="dark"]
|
|||||||
.control-search-optionList-item
|
.control-search-optionList-item
|
||||||
border-color $ui-dark-borderColor
|
border-color $ui-dark-borderColor
|
||||||
&:hover
|
&:hover
|
||||||
background-color lighten($ui-dark-button--hover-backgroundColor, 15%)
|
background-color alpha($ui-dark-button--active-backgroundColor, 20%)
|
||||||
.control-search-optionList-item-folder
|
.control-search-optionList-item-folder
|
||||||
color $ui-dark-text-color
|
color $ui-dark-text-color
|
||||||
.control-search-optionList-item-folder-surfix
|
.control-search-optionList-item-folder-surfix
|
||||||
@@ -159,10 +160,14 @@ body[data-theme="dark"]
|
|||||||
color $ui-inactive-text-color
|
color $ui-inactive-text-color
|
||||||
|
|
||||||
.control-newPostButton
|
.control-newPostButton
|
||||||
colorDarkDefaultButton()
|
color $ui-inactive-text-color
|
||||||
border-color $ui-dark-borderColor
|
border-color $ui-dark-borderColor
|
||||||
background-color $ui-dark-noteList-backgroundColor
|
background-color $ui-dark-noteList-backgroundColor
|
||||||
|
&:hover
|
||||||
|
transition 0.15s
|
||||||
|
color $ui-dark-text-color
|
||||||
&:active
|
&:active
|
||||||
|
background-color alpha($ui-dark-button--active-backgroundColor, 20%)
|
||||||
border-color $ui-dark-button--active-backgroundColor
|
border-color $ui-dark-button--active-backgroundColor
|
||||||
|
|
||||||
.control-newPostButton-tooltip
|
.control-newPostButton-tooltip
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class TopBar extends React.Component {
|
|||||||
this.state = {
|
this.state = {
|
||||||
search: '',
|
search: '',
|
||||||
searchOptions: [],
|
searchOptions: [],
|
||||||
searchPopupOpen: false
|
isSearching: false
|
||||||
}
|
}
|
||||||
|
|
||||||
this.newNoteHandler = () => {
|
this.newNoteHandler = () => {
|
||||||
@@ -87,79 +87,17 @@ class TopBar extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleSearchChange (e) {
|
handleSearchChange (e) {
|
||||||
|
let { router } = this.context
|
||||||
|
router.push('/searched')
|
||||||
this.setState({
|
this.setState({
|
||||||
search: this.refs.searchInput.value
|
search: this.refs.searchInput.value
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
getOptions () {
|
|
||||||
let { data } = this.props
|
|
||||||
let { search } = this.state
|
|
||||||
let notes = data.noteMap.map((note) => note)
|
|
||||||
if (search.trim().length === 0) return []
|
|
||||||
let searchBlocks = search.split(' ')
|
|
||||||
searchBlocks.forEach((block) => {
|
|
||||||
if (block.match(/^!#.+/)) {
|
|
||||||
let tag = block.match(/^!#(.+)/)[1]
|
|
||||||
let regExp = new RegExp(_.escapeRegExp(tag), 'i')
|
|
||||||
notes = notes
|
|
||||||
.filter((note) => {
|
|
||||||
if (!_.isArray(note.tags)) return false
|
|
||||||
return note.tags.some((_tag) => {
|
|
||||||
return _tag.match(regExp)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
} else if (block.match(/^!.+/)) {
|
|
||||||
let block = block.match(/^!(.+)/)[1]
|
|
||||||
let regExp = new RegExp(_.escapeRegExp(block), 'i')
|
|
||||||
notes = notes.filter((note) => {
|
|
||||||
if (!_.isArray(note.tags) || !note.tags.some((_tag) => {
|
|
||||||
return _tag.match(regExp)
|
|
||||||
})) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
if (note.type === 'SNIPPET_NOTE') {
|
|
||||||
return !note.description.match(regExp)
|
|
||||||
} else if (note.type === 'MARKDOWN_NOTE') {
|
|
||||||
return !note.content.match(regExp)
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
})
|
|
||||||
} else if (block.match(/^#.+/)) {
|
|
||||||
let tag = block.match(/#(.+)/)[1]
|
|
||||||
let regExp = new RegExp(_.escapeRegExp(tag), 'i')
|
|
||||||
notes = notes
|
|
||||||
.filter((note) => {
|
|
||||||
if (!_.isArray(note.tags)) return false
|
|
||||||
return note.tags.some((_tag) => {
|
|
||||||
return _tag.match(regExp)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
let regExp = new RegExp(_.escapeRegExp(block), 'i')
|
|
||||||
notes = notes.filter((note) => {
|
|
||||||
if (_.isArray(note.tags) && note.tags.some((_tag) => {
|
|
||||||
return _tag.match(regExp)
|
|
||||||
})) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
if (note.type === 'SNIPPET_NOTE') {
|
|
||||||
return note.description.match(regExp)
|
|
||||||
} else if (note.type === 'MARKDOWN_NOTE') {
|
|
||||||
return note.content.match(regExp)
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
return notes
|
|
||||||
}
|
|
||||||
|
|
||||||
handleOptionClick (uniqueKey) {
|
handleOptionClick (uniqueKey) {
|
||||||
return (e) => {
|
return (e) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
searchPopupOpen: false
|
isSearching: false
|
||||||
}, () => {
|
}, () => {
|
||||||
let { location } = this.props
|
let { location } = this.props
|
||||||
hashHistory.push({
|
hashHistory.push({
|
||||||
@@ -174,7 +112,7 @@ class TopBar extends React.Component {
|
|||||||
|
|
||||||
handleSearchFocus (e) {
|
handleSearchFocus (e) {
|
||||||
this.setState({
|
this.setState({
|
||||||
searchPopupOpen: true
|
isSearching: true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
handleSearchBlur (e) {
|
handleSearchBlur (e) {
|
||||||
@@ -191,7 +129,7 @@ class TopBar extends React.Component {
|
|||||||
}
|
}
|
||||||
if (!isStillFocused) {
|
if (!isStillFocused) {
|
||||||
this.setState({
|
this.setState({
|
||||||
searchPopupOpen: false
|
isSearching: false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -251,7 +189,7 @@ class TopBar extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleOnSearchFocus () {
|
handleOnSearchFocus () {
|
||||||
if (this.state.searchPopupOpen) {
|
if (this.state.isSearching) {
|
||||||
this.refs.search.childNodes[0].blur()
|
this.refs.search.childNodes[0].blur()
|
||||||
} else {
|
} else {
|
||||||
this.refs.search.childNodes[0].focus()
|
this.refs.search.childNodes[0].focus()
|
||||||
@@ -260,27 +198,6 @@ class TopBar extends React.Component {
|
|||||||
|
|
||||||
render () {
|
render () {
|
||||||
let { config, style, data } = this.props
|
let { config, style, data } = this.props
|
||||||
let searchOptionList = this.getOptions()
|
|
||||||
.map((note) => {
|
|
||||||
let storage = data.storageMap.get(note.storage)
|
|
||||||
let folder = _.find(storage.folders, {key: note.folder})
|
|
||||||
return <div styleName='control-search-optionList-item'
|
|
||||||
key={note.storage + '-' + note.key}
|
|
||||||
onClick={(e) => this.handleOptionClick(note.storage + '-' + note.key)(e)}
|
|
||||||
>
|
|
||||||
<div styleName='control-search-optionList-item-folder'
|
|
||||||
style={{borderColor: folder.color}}>
|
|
||||||
{folder.name}
|
|
||||||
<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' />
|
|
||||||
}
|
|
||||||
{note.title}
|
|
||||||
</div>
|
|
||||||
})
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='TopBar'
|
<div className='TopBar'
|
||||||
styleName={config.isSideNavFolded ? 'root--expanded' : 'root'}
|
styleName={config.isSideNavFolded ? 'root--expanded' : 'root'}
|
||||||
@@ -301,15 +218,8 @@ class TopBar extends React.Component {
|
|||||||
onChange={(e) => this.handleSearchChange(e)}
|
onChange={(e) => this.handleSearchChange(e)}
|
||||||
placeholder='Search'
|
placeholder='Search'
|
||||||
type='text'
|
type='text'
|
||||||
|
className='searchInput'
|
||||||
/>
|
/>
|
||||||
{this.state.searchPopupOpen &&
|
|
||||||
<div styleName='control-search-optionList'>
|
|
||||||
{searchOptionList.length > 0
|
|
||||||
? searchOptionList
|
|
||||||
: <div styleName='control-search-optionList-empty'>Empty List</div>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
{this.state.search > 0 &&
|
{this.state.search > 0 &&
|
||||||
<button styleName='left-search-clearButton'
|
<button styleName='left-search-clearButton'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
global-reset()
|
global-reset()
|
||||||
|
|
||||||
DEFAULT_FONTS = 'Lato', helvetica, arial, sans-serif
|
DEFAULT_FONTS = 'OpenSans', helvetica, arial, sans-serif
|
||||||
|
|
||||||
html, body
|
html, body
|
||||||
width 100%
|
width 100%
|
||||||
@@ -11,7 +11,7 @@ body
|
|||||||
font-family DEFAULT_FONTS
|
font-family DEFAULT_FONTS
|
||||||
color textColor
|
color textColor
|
||||||
font-size fontSize
|
font-size fontSize
|
||||||
font-weight 400
|
font-weight 200
|
||||||
|
|
||||||
button, input, select, textarea
|
button, input, select, textarea
|
||||||
font-family DEFAULT_FONTS
|
font-family DEFAULT_FONTS
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ ReactDOM.render((
|
|||||||
<IndexRedirect to='/home' />
|
<IndexRedirect to='/home' />
|
||||||
<Route path='home' />
|
<Route path='home' />
|
||||||
<Route path='starred' />
|
<Route path='starred' />
|
||||||
|
<Route path='searched' />
|
||||||
<Route path='storages'>
|
<Route path='storages'>
|
||||||
<IndexRedirect to='/home' />
|
<IndexRedirect to='/home' />
|
||||||
<Route path=':storageKey'>
|
<Route path=':storageKey'>
|
||||||
|
|||||||
37
browser/main/lib/AwsMobileAnalyticsConfig.js
Normal file
37
browser/main/lib/AwsMobileAnalyticsConfig.js
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
const AWS = require('aws-sdk')
|
||||||
|
const AMA = require('aws-sdk-mobile-analytics')
|
||||||
|
const ConfigManager = require('browser/main/lib/ConfigManager')
|
||||||
|
|
||||||
|
AWS.config.region = 'us-east-1'
|
||||||
|
AWS.config.credentials = new AWS.CognitoIdentityCredentials({
|
||||||
|
IdentityPoolId: 'us-east-1:xxxxxxxxxxxxxxxxxxxxxxxxx'
|
||||||
|
})
|
||||||
|
|
||||||
|
const mobileAnalyticsClient = new AMA.Manager({
|
||||||
|
appId: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
|
||||||
|
appTitle: 'xxxxxxxxxx'
|
||||||
|
})
|
||||||
|
|
||||||
|
function initAwsMobileAnalytics () {
|
||||||
|
AWS.config.credentials.get((err) => {
|
||||||
|
if (!err) {
|
||||||
|
console.log('Cognito Identity ID: ' + AWS.config.credentials.identityId)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
recordStaticCustomEvent()
|
||||||
|
}
|
||||||
|
|
||||||
|
function recordDynamitCustomEvent (type) {
|
||||||
|
mobileAnalyticsClient.recordEvent(type)
|
||||||
|
}
|
||||||
|
|
||||||
|
function recordStaticCustomEvent () {
|
||||||
|
mobileAnalyticsClient.recordEvent('UI_COLOR_THEME', {
|
||||||
|
uiColorTheme: ConfigManager.default.get().ui.theme
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
initAwsMobileAnalytics,
|
||||||
|
recordDynamitCustomEvent
|
||||||
|
}
|
||||||
@@ -16,7 +16,7 @@ export const DEFAULT_CONFIG = {
|
|||||||
listStyle: 'DEFAULT', // 'DEFAULT', 'SMALL'
|
listStyle: 'DEFAULT', // 'DEFAULT', 'SMALL'
|
||||||
hotkey: {
|
hotkey: {
|
||||||
toggleFinder: OSX ? 'Cmd + Alt + S' : 'Super + Alt + S',
|
toggleFinder: OSX ? 'Cmd + Alt + S' : 'Super + Alt + S',
|
||||||
toggleMain: OSX ? 'Cmd + Alt + L' : 'Super + Alt + E',
|
toggleMain: OSX ? 'Cmd + Alt + L' : 'Super + Alt + E'
|
||||||
},
|
},
|
||||||
ui: {
|
ui: {
|
||||||
theme: 'default',
|
theme: 'default',
|
||||||
|
|||||||
32
browser/main/lib/dataApi/copyImage.js
Normal file
32
browser/main/lib/dataApi/copyImage.js
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
const fs = require('fs')
|
||||||
|
const path = require('path')
|
||||||
|
const _ = require('lodash')
|
||||||
|
const sander = require('sander')
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description To copy an image and return the path.
|
||||||
|
* @param {String} filePath
|
||||||
|
* @param {String} storageKey
|
||||||
|
* @return {String} an image path
|
||||||
|
*/
|
||||||
|
function copyImage (filePath, storageKey) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
try {
|
||||||
|
const cachedStorageList = JSON.parse(localStorage.getItem('storages'))
|
||||||
|
if (!_.isArray(cachedStorageList)) throw new Error('Target storage doesn\'t exist.')
|
||||||
|
const storage = _.find(cachedStorageList, {key: storageKey})
|
||||||
|
if (storage === undefined) throw new Error('Target storage doesn\'t exist.')
|
||||||
|
const targetStorage = storage
|
||||||
|
|
||||||
|
const inputImage = fs.createReadStream(filePath)
|
||||||
|
const imageName = path.basename(filePath)
|
||||||
|
const outputImage = fs.createWriteStream(path.join(targetStorage.path, 'images', imageName))
|
||||||
|
inputImage.pipe(outputImage)
|
||||||
|
resolve(`${encodeURI(targetStorage.path)}/images/${encodeURI(imageName)}`)
|
||||||
|
} catch (e) {
|
||||||
|
return reject(e)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = copyImage
|
||||||
@@ -41,7 +41,7 @@ function init () {
|
|||||||
.then((notes) => {
|
.then((notes) => {
|
||||||
let unknownCount = 0
|
let unknownCount = 0
|
||||||
notes.forEach((note) => {
|
notes.forEach((note) => {
|
||||||
if (!storage.folders.some((folder) => note.folder === folder.key)) {
|
if (note && !storage.folders.some((folder) => note.folder === folder.key)) {
|
||||||
unknownCount++
|
unknownCount++
|
||||||
storage.folders.push({
|
storage.folders.push({
|
||||||
key: note.folder,
|
key: note.folder,
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ function resolveStorageNotes (storage) {
|
|||||||
return data
|
return data
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(notePath)
|
console.error(notePath)
|
||||||
throw err
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ class ModalBase extends React.Component {
|
|||||||
|
|
||||||
close () {
|
close () {
|
||||||
if (modalBase != null) modalBase.setState({component: null, componentProps: null, isHidden: true})
|
if (modalBase != null) modalBase.setState({component: null, componentProps: null, isHidden: true})
|
||||||
|
// Toggle overflow style on NoteList
|
||||||
|
let list = document.querySelector('.NoteList__list___browser-main-NoteList-')
|
||||||
|
list.style.overflow = 'auto'
|
||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
@@ -37,7 +40,9 @@ let modalBase = ReactDOM.render(<ModalBase />, el)
|
|||||||
|
|
||||||
export function openModal (component, props) {
|
export function openModal (component, props) {
|
||||||
if (modalBase == null) { return }
|
if (modalBase == null) { return }
|
||||||
|
// Hide scrollbar by removing overflow when modal opens
|
||||||
|
let list = document.querySelector('.NoteList__list___browser-main-NoteList-')
|
||||||
|
list.style.overflow = 'hidden'
|
||||||
document.body.setAttribute('data-modal', 'open')
|
document.body.setAttribute('data-modal', 'open')
|
||||||
modalBase.setState({component: component, componentProps: props, isHidden: false})
|
modalBase.setState({component: component, componentProps: props, isHidden: false})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import styles from './CreateFolderModal.styl'
|
|||||||
import dataApi from 'browser/main/lib/dataApi'
|
import dataApi from 'browser/main/lib/dataApi'
|
||||||
import store from 'browser/main/store'
|
import store from 'browser/main/store'
|
||||||
import consts from 'browser/lib/consts'
|
import consts from 'browser/lib/consts'
|
||||||
|
import ModalEscButton from 'browser/components/ModalEscButton'
|
||||||
|
import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
|
||||||
|
|
||||||
class CreateFolderModal extends React.Component {
|
class CreateFolderModal extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
@@ -47,6 +49,7 @@ class CreateFolderModal extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
confirm () {
|
confirm () {
|
||||||
|
AwsMobileAnalyticsConfig.recordDynamitCustomEvent('ADD_FOLDER')
|
||||||
if (this.state.name.trim().length > 0) {
|
if (this.state.name.trim().length > 0) {
|
||||||
let { storage } = this.props
|
let { storage } = this.props
|
||||||
let input = {
|
let input = {
|
||||||
@@ -77,11 +80,7 @@ class CreateFolderModal extends React.Component {
|
|||||||
<div styleName='header'>
|
<div styleName='header'>
|
||||||
<div styleName='title'>Create new folder</div>
|
<div styleName='title'>Create new folder</div>
|
||||||
</div>
|
</div>
|
||||||
<button styleName='close' onClick={(e) => this.handleCloseButtonClick(e)}>
|
<ModalEscButton handleEscButtonClick={(e) => this.handleCloseButtonClick(e)} />
|
||||||
<div styleName='close-mark'>X</div>
|
|
||||||
<div styleName='close-text'>esc</div>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<div styleName='control'>
|
<div styleName='control'>
|
||||||
<div styleName='control-folder'>
|
<div styleName='control-folder'>
|
||||||
<div styleName='control-folder-label'>Folder name</div>
|
<div styleName='control-folder-label'>Folder name</div>
|
||||||
@@ -95,7 +94,7 @@ class CreateFolderModal extends React.Component {
|
|||||||
<button styleName='control-confirmButton'
|
<button styleName='control-confirmButton'
|
||||||
onClick={(e) => this.handleConfirmButtonClick(e)}
|
onClick={(e) => this.handleConfirmButtonClick(e)}
|
||||||
>
|
>
|
||||||
Create Folder
|
Create
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,52 +1,37 @@
|
|||||||
.root
|
.root
|
||||||
modal()
|
modal()
|
||||||
width 700px
|
width 500px
|
||||||
height 200px
|
height 270px
|
||||||
overflow hidden
|
overflow hidden
|
||||||
position relative
|
position relative
|
||||||
padding 0 40px
|
padding 0 40px
|
||||||
|
|
||||||
.header
|
.header
|
||||||
height 50px
|
height 70px
|
||||||
margin-bottom 10px
|
margin-bottom 10px
|
||||||
margin-top 10px
|
margin-top 20px
|
||||||
font-size 18px
|
font-size 18px
|
||||||
line-height 50px
|
line-height 50px
|
||||||
background-color $ui-backgroundColor
|
background-color $ui-backgroundColor
|
||||||
color $ui-text-color
|
color $ui-text-color
|
||||||
|
|
||||||
.close-mark
|
|
||||||
font-size 15px
|
|
||||||
|
|
||||||
.close
|
|
||||||
height 50px
|
|
||||||
position absolute
|
|
||||||
background-color transparent
|
|
||||||
color $ui-inactive-text-color
|
|
||||||
border none
|
|
||||||
top 7px
|
|
||||||
right 10px
|
|
||||||
text-align center
|
|
||||||
width top-bar--height
|
|
||||||
height top-bar--height
|
|
||||||
|
|
||||||
.control-folder-label
|
.control-folder-label
|
||||||
text-align left
|
text-align left
|
||||||
font-size 14px
|
font-size 12px
|
||||||
color $ui-text-color
|
color $ui-text-color
|
||||||
|
|
||||||
.control-folder-input
|
.control-folder-input
|
||||||
display block
|
display block
|
||||||
height 30px
|
height 30px
|
||||||
width 620px
|
width 420px
|
||||||
padding 0 5px
|
padding 0 5px
|
||||||
margin 10px auto 15px
|
margin 10px auto 15px
|
||||||
border 1px solid #C9C9C9 // TODO: use variable.
|
border 1px solid #C9C9C9 // TODO: use variable.
|
||||||
border-radius 5px
|
border-radius 2px
|
||||||
background-color transparent
|
background-color transparent
|
||||||
outline none
|
outline none
|
||||||
vertical-align middle
|
vertical-align middle
|
||||||
font-size 18px
|
font-size 14px
|
||||||
&:disabled
|
&:disabled
|
||||||
background-color $ui-input--disabled-backgroundColor
|
background-color $ui-input--disabled-backgroundColor
|
||||||
&:focus, &:active
|
&:focus, &:active
|
||||||
@@ -54,20 +39,21 @@
|
|||||||
|
|
||||||
.control-confirmButton
|
.control-confirmButton
|
||||||
display block
|
display block
|
||||||
|
float right
|
||||||
height 30px
|
height 30px
|
||||||
width 620px
|
width 100px
|
||||||
border none
|
border none
|
||||||
border-radius 5px
|
border-radius 2px
|
||||||
padding 0 25px
|
padding 0 25px
|
||||||
margin 20px auto
|
margin 20px auto
|
||||||
font-size 14px
|
font-size 12px
|
||||||
colorPrimaryButton()
|
colorPrimaryButton()
|
||||||
|
|
||||||
body[data-theme="dark"]
|
body[data-theme="dark"]
|
||||||
.root
|
.root
|
||||||
modalDark()
|
modalDark()
|
||||||
width 700px
|
width 500px
|
||||||
height 200px
|
height 270px
|
||||||
overflow hidden
|
overflow hidden
|
||||||
position relative
|
position relative
|
||||||
padding 0 40px
|
padding 0 40px
|
||||||
@@ -84,10 +70,8 @@ body[data-theme="dark"]
|
|||||||
border 1px solid #C9C9C9 // TODO: use variable.
|
border 1px solid #C9C9C9 // TODO: use variable.
|
||||||
color white
|
color white
|
||||||
|
|
||||||
.closeButton
|
.description
|
||||||
border-color $ui-dark-borderColor
|
|
||||||
color $ui-dark-text-color
|
|
||||||
colorDarkDefaultButton()
|
|
||||||
|
|
||||||
.description
|
|
||||||
color $ui-inactive-text-color
|
color $ui-inactive-text-color
|
||||||
|
|
||||||
|
.control-confirmButton
|
||||||
|
colorDarkPrimaryButton()
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import React, { PropTypes } from 'react'
|
import React, { PropTypes } from 'react'
|
||||||
import ReactDOM from 'react-dom'
|
import ReactDOM from 'react-dom'
|
||||||
import store from '../store'
|
|
||||||
|
|
||||||
const electron = require('electron')
|
const electron = require('electron')
|
||||||
const ipc = electron.ipcRenderer
|
const ipc = electron.ipcRenderer
|
||||||
@@ -26,7 +25,6 @@ export default class DeleteArticleModal extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleYesButtonClick (e) {
|
handleYesButtonClick (e) {
|
||||||
// store.dispatch(destroyArticle(this.props.articleKey))
|
|
||||||
this.props.close()
|
this.props.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import dataApi from 'browser/main/lib/dataApi'
|
|||||||
import store from 'browser/main/store'
|
import store from 'browser/main/store'
|
||||||
import { hashHistory } from 'react-router'
|
import { hashHistory } from 'react-router'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
|
import ModalEscButton from 'browser/components/ModalEscButton'
|
||||||
|
|
||||||
const CSON = require('@rokt33r/season')
|
const CSON = require('@rokt33r/season')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
@@ -41,10 +42,6 @@ class InitModal extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
handleCloseButtonClick (e) {
|
|
||||||
this.props.close()
|
|
||||||
}
|
|
||||||
|
|
||||||
handlePathChange (e) {
|
handlePathChange (e) {
|
||||||
this.setState({
|
this.setState({
|
||||||
path: e.target.value
|
path: e.target.value
|
||||||
@@ -143,7 +140,7 @@ class InitModal extends React.Component {
|
|||||||
type: 'SNIPPET_NOTE',
|
type: 'SNIPPET_NOTE',
|
||||||
folder: data.storage.folders[0].key,
|
folder: data.storage.folders[0].key,
|
||||||
title: 'Snippet note example',
|
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: [
|
snippets: [
|
||||||
{
|
{
|
||||||
name: 'example.html',
|
name: 'example.html',
|
||||||
@@ -187,12 +184,6 @@ class InitModal extends React.Component {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
handleKeyDown (e) {
|
|
||||||
if (e.keyCode === 27) {
|
|
||||||
this.props.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
if (this.state.isLoading) {
|
if (this.state.isLoading) {
|
||||||
return <div styleName='root--loading'>
|
return <div styleName='root--loading'>
|
||||||
@@ -209,15 +200,13 @@ class InitModal extends React.Component {
|
|||||||
<div styleName='header'>
|
<div styleName='header'>
|
||||||
<div styleName='header-title'>Initialize Storage</div>
|
<div styleName='header-title'>Initialize Storage</div>
|
||||||
</div>
|
</div>
|
||||||
<button styleName='closeButton'
|
<ModalEscButton handleEscButtonClick={(e) => this.handleCloseButtonClick(e)} />
|
||||||
onClick={(e) => this.handleCloseButtonClick(e)}
|
|
||||||
>Close</button>
|
|
||||||
<div styleName='body'>
|
<div styleName='body'>
|
||||||
<div styleName='body-welcome'>
|
<div styleName='body-welcome'>
|
||||||
Welcome you!
|
Welcome!
|
||||||
</div>
|
</div>
|
||||||
<div styleName='body-description'>
|
<div styleName='body-description'>
|
||||||
Boostnote will use this directory as a default storage.
|
Please select a directory for Boostnote storage.
|
||||||
</div>
|
</div>
|
||||||
<div styleName='body-path'>
|
<div styleName='body-path'>
|
||||||
<input styleName='body-path-input'
|
<input styleName='body-path-input'
|
||||||
|
|||||||
@@ -22,15 +22,6 @@
|
|||||||
border-bottom solid 1px $ui-borderColor
|
border-bottom solid 1px $ui-borderColor
|
||||||
color $ui-text-color
|
color $ui-text-color
|
||||||
|
|
||||||
.closeButton
|
|
||||||
position absolute
|
|
||||||
top 10px
|
|
||||||
right 10px
|
|
||||||
height 30px
|
|
||||||
padding 0 25px
|
|
||||||
color $ui-text-color
|
|
||||||
colorDefaultButton()
|
|
||||||
|
|
||||||
.body
|
.body
|
||||||
padding 30px
|
padding 30px
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import styles from './NewNoteModal.styl'
|
|||||||
import dataApi from 'browser/main/lib/dataApi'
|
import dataApi from 'browser/main/lib/dataApi'
|
||||||
import { hashHistory } from 'react-router'
|
import { hashHistory } from 'react-router'
|
||||||
import ee from 'browser/main/lib/eventEmitter'
|
import ee from 'browser/main/lib/eventEmitter'
|
||||||
|
import ModalEscButton from 'browser/components/ModalEscButton'
|
||||||
|
import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
|
||||||
|
|
||||||
class NewNoteModal extends React.Component {
|
class NewNoteModal extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
@@ -22,6 +24,8 @@ class NewNoteModal extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleMarkdownNoteButtonClick (e) {
|
handleMarkdownNoteButtonClick (e) {
|
||||||
|
AwsMobileAnalyticsConfig.recordDynamitCustomEvent('ADD_MARKDOWN')
|
||||||
|
AwsMobileAnalyticsConfig.recordDynamitCustomEvent('ADD_ALLNOTE')
|
||||||
let { storage, folder, dispatch, location } = this.props
|
let { storage, folder, dispatch, location } = this.props
|
||||||
dataApi
|
dataApi
|
||||||
.createNote(storage, {
|
.createNote(storage, {
|
||||||
@@ -52,6 +56,8 @@ class NewNoteModal extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleSnippetNoteButtonClick (e) {
|
handleSnippetNoteButtonClick (e) {
|
||||||
|
AwsMobileAnalyticsConfig.recordDynamitCustomEvent('ADD_SNIPPET')
|
||||||
|
AwsMobileAnalyticsConfig.recordDynamitCustomEvent('ADD_ALLNOTE')
|
||||||
let { storage, folder, dispatch, location } = this.props
|
let { storage, folder, dispatch, location } = this.props
|
||||||
|
|
||||||
dataApi
|
dataApi
|
||||||
@@ -102,11 +108,7 @@ class NewNoteModal extends React.Component {
|
|||||||
<div styleName='header'>
|
<div styleName='header'>
|
||||||
<div styleName='title'>Make a Note</div>
|
<div styleName='title'>Make a Note</div>
|
||||||
</div>
|
</div>
|
||||||
<button styleName='closeButton' onClick={(e) => this.handleCloseButtonClick(e)}>
|
<ModalEscButton handleEscButtonClick={(e) => this.handleCloseButtonClick(e)} />
|
||||||
<div styleName='close-mark'>X</div>
|
|
||||||
<div styleName='close-text'>esc</div>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<div styleName='control'>
|
<div styleName='control'>
|
||||||
<button styleName='control-button'
|
<button styleName='control-button'
|
||||||
onClick={(e) => this.handleMarkdownNoteButtonClick(e)}
|
onClick={(e) => this.handleMarkdownNoteButtonClick(e)}
|
||||||
@@ -117,7 +119,7 @@ class NewNoteModal extends React.Component {
|
|||||||
className='fa fa-file-text-o'
|
className='fa fa-file-text-o'
|
||||||
/><br />
|
/><br />
|
||||||
<span styleName='control-button-label'>Markdown Note</span><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>
|
<span styleName='control-button-description'>This format is for creating text documents. Checklists, code blocks and Latex blocks are available.</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button styleName='control-button'
|
<button styleName='control-button'
|
||||||
@@ -129,7 +131,7 @@ class NewNoteModal extends React.Component {
|
|||||||
className='fa fa-code'
|
className='fa fa-code'
|
||||||
/><br />
|
/><br />
|
||||||
<span styleName='control-button-label'>Snippet Note</span><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 styleName='control-button-description'>This format is for creating code snippets. Multiple snippets can be grouped into a single note.
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|||||||
@@ -13,25 +13,10 @@
|
|||||||
border-bottom solid 1px $ui-borderColor
|
border-bottom solid 1px $ui-borderColor
|
||||||
color $ui-text-color
|
color $ui-text-color
|
||||||
|
|
||||||
.closeButton
|
|
||||||
height 50px
|
|
||||||
position absolute
|
|
||||||
background-color transparent
|
|
||||||
color $ui-inactive-text-color
|
|
||||||
border none
|
|
||||||
top 1px
|
|
||||||
right 10px
|
|
||||||
text-align center
|
|
||||||
width top-bar--height
|
|
||||||
height top-bar--height
|
|
||||||
|
|
||||||
.control
|
.control
|
||||||
padding 25px 15px 15px
|
padding 25px 15px 15px
|
||||||
text-align center
|
text-align center
|
||||||
|
|
||||||
.close-mark
|
|
||||||
font-size 15px
|
|
||||||
|
|
||||||
.control-button
|
.control-button
|
||||||
width 220px
|
width 220px
|
||||||
height 220px
|
height 220px
|
||||||
@@ -73,7 +58,7 @@ body[data-theme="dark"]
|
|||||||
color $ui-dark-text-color
|
color $ui-dark-text-color
|
||||||
background-color transparent
|
background-color transparent
|
||||||
&:focus
|
&:focus
|
||||||
colorPrimaryButton()
|
colorDarkPrimaryButton()
|
||||||
|
|
||||||
.description
|
.description
|
||||||
color $ui-inactive-text-color
|
color $ui-inactive-text-color
|
||||||
|
|||||||
@@ -32,14 +32,20 @@
|
|||||||
.group-section-control
|
.group-section-control
|
||||||
flex 1
|
flex 1
|
||||||
|
|
||||||
|
.group-section-control select
|
||||||
|
outline none
|
||||||
|
border 1px solid $ui-borderColor
|
||||||
|
background-color transparent
|
||||||
|
|
||||||
.group-section-control-input
|
.group-section-control-input
|
||||||
height 30px
|
height 30px
|
||||||
vertical-align middle
|
vertical-align middle
|
||||||
width 400px
|
width 400px
|
||||||
font-size $tab--button-font-size
|
font-size $tab--button-font-size
|
||||||
border solid 1px $border-color
|
border solid 1px $border-color
|
||||||
border-radius $tab--input-border-radius
|
border-radius 2px
|
||||||
padding 0 5px
|
padding 0 5px
|
||||||
|
outline none
|
||||||
&:disabled
|
&:disabled
|
||||||
background-color $ui-input--disabled-backgroundColor
|
background-color $ui-input--disabled-backgroundColor
|
||||||
|
|
||||||
@@ -64,7 +70,7 @@
|
|||||||
.group-control-leftButton
|
.group-control-leftButton
|
||||||
colorDefaultButton()
|
colorDefaultButton()
|
||||||
border none
|
border none
|
||||||
border-radius 5px
|
border-radius 2px
|
||||||
font-size $tab--button-font-size
|
font-size $tab--button-font-size
|
||||||
height $tab--button-height
|
height $tab--button-height
|
||||||
padding 0 15px
|
padding 0 15px
|
||||||
@@ -74,17 +80,17 @@
|
|||||||
float right
|
float right
|
||||||
colorPrimaryButton()
|
colorPrimaryButton()
|
||||||
border none
|
border none
|
||||||
border-radius $tab--button-border-radius
|
border-radius 2px
|
||||||
font-size $tab--button-font-size
|
font-size $tab--button-font-size
|
||||||
height $tab--button-height
|
height 35px
|
||||||
padding 0 15px
|
width 100px
|
||||||
margin-right 10px
|
margin-right 10px
|
||||||
|
|
||||||
.group-hint
|
.group-hint
|
||||||
border $ui-border
|
border $ui-border
|
||||||
padding 10px 15px
|
padding 10px 15px
|
||||||
margin 15px 0
|
margin 15px 0
|
||||||
border-radius 5px
|
border-radius 2px
|
||||||
background-color $ui-backgroundColor
|
background-color $ui-backgroundColor
|
||||||
color $ui-inactive-text-color
|
color $ui-inactive-text-color
|
||||||
ul
|
ul
|
||||||
@@ -98,10 +104,17 @@
|
|||||||
margin-left: 10px
|
margin-left: 10px
|
||||||
font-size: 12px
|
font-size: 12px
|
||||||
|
|
||||||
|
.code-mirror
|
||||||
|
width 400px
|
||||||
|
height 120px
|
||||||
|
margin 5px 0
|
||||||
|
font-size 12px
|
||||||
|
|
||||||
colorDarkControl()
|
colorDarkControl()
|
||||||
border-color $ui-dark-borderColor
|
border-color $ui-dark-borderColor
|
||||||
background-color $ui-dark-backgroundColor
|
background-color $ui-dark-backgroundColor
|
||||||
color $ui-dark-text-color
|
color $ui-dark-text-color
|
||||||
|
|
||||||
body[data-theme="dark"]
|
body[data-theme="dark"]
|
||||||
.root
|
.root
|
||||||
color $ui-dark-text-color
|
color $ui-dark-text-color
|
||||||
|
|||||||
@@ -139,6 +139,7 @@ class HotkeyTab extends React.Component {
|
|||||||
<li><code>VolumeUp</code>, <code>VolumeDown</code> and <code>VolumeMute</code></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>MediaNextTrack</code>, <code>MediaPreviousTrack</code>, <code>MediaStop</code> and <code>MediaPlayPause</code></li>
|
||||||
<li><code>Control</code> (or <code>Ctrl</code> for short)</li>
|
<li><code>Control</code> (or <code>Ctrl</code> for short)</li>
|
||||||
|
<li><code>Shift</code></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,28 +30,42 @@ class InfoTab extends React.Component {
|
|||||||
<div styleName='icon-right'>
|
<div styleName='icon-right'>
|
||||||
<div styleName='appId'>Boostnote {appVersion}</div>
|
<div styleName='appId'>Boostnote {appVersion}</div>
|
||||||
<div styleName='description'>
|
<div styleName='description'>
|
||||||
A simple markdown/snippet note app for developer.
|
An open source note-taking app made for programmers just like you.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div styleName='clear' />
|
|
||||||
<div styleName='madeBy'>Made by
|
|
||||||
<a href='http://maisin.co/'
|
|
||||||
onClick={(e) => this.handleLinkClick(e)}
|
|
||||||
>MAISIN&CO.</a></div>
|
|
||||||
<div styleName='copyright'>Copyright 2017 MAISIN&CO. All rights reserved.</div>
|
|
||||||
</div>
|
</div>
|
||||||
<ul styleName='list'>
|
<ul styleName='list'>
|
||||||
<li>
|
<li>
|
||||||
The codes of this app is published under GPLv3 license.
|
<a href='https://boostnote.io'
|
||||||
</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'
|
|
||||||
onClick={(e) => this.handleLinkClick(e)}
|
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://salt.bountysource.com/teams/boostnote'
|
||||||
|
onClick={(e) => this.handleLinkClick(e)}
|
||||||
|
>Donate via Bountysource</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>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,11 +4,9 @@
|
|||||||
padding 15px
|
padding 15px
|
||||||
white-space pre
|
white-space pre
|
||||||
line-height 1.4
|
line-height 1.4
|
||||||
color $ui-text-color
|
color alpha($ui-text-color, 90%)
|
||||||
width 100%
|
width 100%
|
||||||
|
font-size 14px
|
||||||
.clear
|
|
||||||
clear both
|
|
||||||
|
|
||||||
.top
|
.top
|
||||||
text-align left
|
text-align left
|
||||||
@@ -34,26 +32,16 @@
|
|||||||
.description
|
.description
|
||||||
font-size 14px
|
font-size 14px
|
||||||
|
|
||||||
.madeBy
|
|
||||||
font-size 14px
|
|
||||||
$ui-inactive-text-color
|
|
||||||
|
|
||||||
.copyright
|
|
||||||
font-size 14px
|
|
||||||
$ui-inactive-text-color
|
|
||||||
|
|
||||||
.list
|
.list
|
||||||
list-style square
|
list-style square
|
||||||
padding-left 2em
|
padding-left 2em
|
||||||
li
|
li
|
||||||
white-space normal
|
white-space normal
|
||||||
|
padding-bottom 10px
|
||||||
|
a
|
||||||
|
color #4E8EC6
|
||||||
|
text-decoration none
|
||||||
|
|
||||||
body[data-theme="dark"]
|
body[data-theme="dark"]
|
||||||
.root
|
.root
|
||||||
color $tab--dark-text-color
|
color alpha($tab--dark-text-color, 80%)
|
||||||
|
|
||||||
.madeBy
|
|
||||||
color $ui-dark-inactive-text-color
|
|
||||||
|
|
||||||
.copyright
|
|
||||||
color $ui-dark-inactive-text-color
|
|
||||||
@@ -20,17 +20,6 @@ top-bar--height = 50px
|
|||||||
font-size 18px
|
font-size 18px
|
||||||
line-height top-bar--height
|
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
|
.nav
|
||||||
absolute top left right
|
absolute top left right
|
||||||
top top-bar--height
|
top top-bar--height
|
||||||
@@ -45,22 +34,20 @@ top-bar--height = 50px
|
|||||||
text-align left
|
text-align left
|
||||||
width 100px
|
width 100px
|
||||||
margin 4px 0
|
margin 4px 0
|
||||||
padding 7px 0
|
padding 5px 0
|
||||||
padding-left 7px
|
padding-left 10px
|
||||||
border none
|
border none
|
||||||
border-radius 3px
|
border-radius 2px
|
||||||
background-color transparent
|
background-color transparent
|
||||||
color $ui-text-color
|
color $ui-text-color
|
||||||
font-size 14px
|
font-size 14px
|
||||||
&:hover
|
|
||||||
color $ui-active-color
|
|
||||||
|
|
||||||
.nav-button--active
|
.nav-button--active
|
||||||
@extend .nav-button
|
@extend .nav-button
|
||||||
color white
|
color $ui-text-color
|
||||||
background-color $ui-active-color
|
background-color $ui-button--active-backgroundColor
|
||||||
&:hover
|
&:hover
|
||||||
color white
|
color $ui-text-color
|
||||||
|
|
||||||
.nav-button-icon
|
.nav-button-icon
|
||||||
display block
|
display block
|
||||||
@@ -91,3 +78,10 @@ body[data-theme="dark"]
|
|||||||
color $tab--dark-text-color
|
color $tab--dark-text-color
|
||||||
&:hover
|
&:hover
|
||||||
color $ui-dark-text-color
|
color $ui-dark-text-color
|
||||||
|
|
||||||
|
.nav-button--active
|
||||||
|
@extend .nav-button
|
||||||
|
color white
|
||||||
|
background-color $dark-primary-button-background--active
|
||||||
|
&:hover
|
||||||
|
color white
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
border $ui-border
|
border $ui-border
|
||||||
border-radius 2px
|
border-radius 2px
|
||||||
padding 0 5px
|
padding 0 5px
|
||||||
|
outline none
|
||||||
|
|
||||||
.header-control
|
.header-control
|
||||||
float right
|
float right
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
background-color darken(white, 3%)
|
background-color darken(white, 3%)
|
||||||
.folderList-item-left
|
.folderList-item-left
|
||||||
height 30px
|
height 30px
|
||||||
border-left solid 4px transparent
|
border-left solid 2px transparent
|
||||||
padding 0 10px
|
padding 0 10px
|
||||||
line-height 30px
|
line-height 30px
|
||||||
float left
|
float left
|
||||||
@@ -105,6 +105,7 @@
|
|||||||
border $ui-border
|
border $ui-border
|
||||||
border-radius 2px
|
border-radius 2px
|
||||||
padding 0 5px
|
padding 0 5px
|
||||||
|
outline none
|
||||||
|
|
||||||
.folderList-item-right
|
.folderList-item-right
|
||||||
float right
|
float right
|
||||||
|
|||||||
@@ -28,12 +28,15 @@
|
|||||||
.list-control
|
.list-control
|
||||||
height 30px
|
height 30px
|
||||||
.list-control-addStorageButton
|
.list-control-addStorageButton
|
||||||
|
position absolute
|
||||||
|
top 7px
|
||||||
|
right 20px
|
||||||
height $tab--button-height
|
height $tab--button-height
|
||||||
padding 0 15px
|
padding 0 15px
|
||||||
border $ui-border
|
border $ui-border
|
||||||
colorDefaultButton()
|
colorDefaultButton()
|
||||||
font-size $tab--button-font-size
|
font-size $tab--button-font-size
|
||||||
border-radius $tab--button-border-radius
|
border-radius 2px
|
||||||
|
|
||||||
.addStorage
|
.addStorage
|
||||||
margin-bottom 15px
|
margin-bottom 15px
|
||||||
|
|||||||
@@ -4,44 +4,66 @@ import styles from './ConfigTab.styl'
|
|||||||
import ConfigManager from 'browser/main/lib/ConfigManager'
|
import ConfigManager from 'browser/main/lib/ConfigManager'
|
||||||
import store from 'browser/main/store'
|
import store from 'browser/main/store'
|
||||||
import consts from 'browser/lib/consts'
|
import consts from 'browser/lib/consts'
|
||||||
|
import ReactCodeMirror from 'react-codemirror'
|
||||||
|
import CodeMirror from 'codemirror'
|
||||||
|
|
||||||
const OSX = global.process.platform === 'darwin'
|
const OSX = global.process.platform === 'darwin'
|
||||||
|
|
||||||
class UiTab extends React.Component {
|
class UiTab extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
super(props)
|
super(props)
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
config: props.config
|
config: props.config,
|
||||||
|
codemirrorTheme: props.config.editor.theme
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentWillMount () {
|
||||||
|
CodeMirror.autoLoadMode(ReactCodeMirror, 'javascript')
|
||||||
|
}
|
||||||
|
|
||||||
handleUIChange (e) {
|
handleUIChange (e) {
|
||||||
let { config } = this.state
|
const { codemirrorTheme } = this.state
|
||||||
|
let checkHighLight = document.getElementById('checkHighLight')
|
||||||
|
|
||||||
config.ui = {
|
if (checkHighLight === null) {
|
||||||
theme: this.refs.uiTheme.value,
|
checkHighLight = document.createElement('link')
|
||||||
disableDirectWrite: this.refs.uiD2w != null
|
checkHighLight.setAttribute('id', 'checkHighLight')
|
||||||
? this.refs.uiD2w.checked
|
checkHighLight.setAttribute('rel', 'stylesheet')
|
||||||
: false
|
document.head.appendChild(checkHighLight)
|
||||||
}
|
|
||||||
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,
|
|
||||||
keyMap: this.refs.editorKeyMap.value
|
|
||||||
}
|
|
||||||
config.preview = {
|
|
||||||
fontSize: this.refs.previewFontSize.value,
|
|
||||||
fontFamily: this.refs.previewFontFamily.value,
|
|
||||||
codeBlockTheme: this.refs.previewCodeBlockTheme.value,
|
|
||||||
lineNumber: this.refs.previewLineNumber.checked
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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) {
|
handleSaveUIClick (e) {
|
||||||
@@ -61,8 +83,8 @@ class UiTab extends React.Component {
|
|||||||
|
|
||||||
render () {
|
render () {
|
||||||
const themes = consts.THEMES
|
const themes = consts.THEMES
|
||||||
const { config } = this.state
|
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 (
|
return (
|
||||||
<div styleName='root'>
|
<div styleName='root'>
|
||||||
<div styleName='group'>
|
<div styleName='group'>
|
||||||
@@ -113,6 +135,9 @@ class UiTab extends React.Component {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
|
<div styleName='code-mirror'>
|
||||||
|
<ReactCodeMirror value={codemirrorSampleCode} options={{ lineNumbers: true, readOnly: true, mode: 'javascript', theme: codemirrorTheme }} />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div styleName='group-section'>
|
<div styleName='group-section'>
|
||||||
@@ -191,6 +216,7 @@ class UiTab extends React.Component {
|
|||||||
>
|
>
|
||||||
<option value='sublime'>default</option>
|
<option value='sublime'>default</option>
|
||||||
<option value='vim'>vim</option>
|
<option value='vim'>vim</option>
|
||||||
|
<option value='emacs'>emacs</option>
|
||||||
</select>
|
</select>
|
||||||
<span styleName='note-for-keymap'>Please reload boostnote after you change the keymap</span>
|
<span styleName='note-for-keymap'>Please reload boostnote after you change the keymap</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -253,7 +279,7 @@ class UiTab extends React.Component {
|
|||||||
<button styleName='group-control-rightButton'
|
<button styleName='group-control-rightButton'
|
||||||
onClick={(e) => this.handleSaveUIClick(e)}
|
onClick={(e) => this.handleSaveUIClick(e)}
|
||||||
>
|
>
|
||||||
Save UI Config
|
Save
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import HotkeyTab from './HotkeyTab'
|
|||||||
import UiTab from './UiTab'
|
import UiTab from './UiTab'
|
||||||
import InfoTab from './InfoTab'
|
import InfoTab from './InfoTab'
|
||||||
import StoragesTab from './StoragesTab'
|
import StoragesTab from './StoragesTab'
|
||||||
|
import ModalEscButton from 'browser/components/ModalEscButton'
|
||||||
import CSSModules from 'browser/lib/CSSModules'
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
import styles from './PreferencesModal.styl'
|
import styles from './PreferencesModal.styl'
|
||||||
|
|
||||||
@@ -117,10 +118,7 @@ class Preferences extends React.Component {
|
|||||||
<div styleName='top-bar'>
|
<div styleName='top-bar'>
|
||||||
<p>Your menu for Boostnote</p>
|
<p>Your menu for Boostnote</p>
|
||||||
</div>
|
</div>
|
||||||
<button styleName='top-bar-close' onClick={(e) => this.handleEscButtonClick(e)}>
|
<ModalEscButton handleEscButtonClick={(e) => this.handleEscButtonClick(e)} />
|
||||||
<div styleName='top-bar-close-mark'>X</div>
|
|
||||||
<div styleName='top-bar-close-text'>esc</div>
|
|
||||||
</button>
|
|
||||||
<div styleName='nav'>
|
<div styleName='nav'>
|
||||||
{navButtons}
|
{navButtons}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import CSSModules from 'browser/lib/CSSModules'
|
|||||||
import styles from './RenameFolderModal.styl'
|
import styles from './RenameFolderModal.styl'
|
||||||
import dataApi from 'browser/main/lib/dataApi'
|
import dataApi from 'browser/main/lib/dataApi'
|
||||||
import store from 'browser/main/store'
|
import store from 'browser/main/store'
|
||||||
|
import ModalEscButton from 'browser/components/ModalEscButton'
|
||||||
|
|
||||||
class RenameFolderModal extends React.Component {
|
class RenameFolderModal extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
@@ -72,9 +73,7 @@ class RenameFolderModal extends React.Component {
|
|||||||
<div styleName='header'>
|
<div styleName='header'>
|
||||||
<div styleName='title'>Rename Folder</div>
|
<div styleName='title'>Rename Folder</div>
|
||||||
</div>
|
</div>
|
||||||
<button styleName='closeButton'
|
<ModalEscButton handleEscButtonClick={(e) => this.handleCloseButtonClick(e)} />
|
||||||
onClick={(e) => this.handleCloseButtonClick(e)}
|
|
||||||
>Close</button>
|
|
||||||
|
|
||||||
<div styleName='control'>
|
<div styleName='control'>
|
||||||
<input styleName='control-input'
|
<input styleName='control-input'
|
||||||
|
|||||||
@@ -6,24 +6,13 @@
|
|||||||
|
|
||||||
.header
|
.header
|
||||||
height 50px
|
height 50px
|
||||||
font-size 18px
|
font-size 16px
|
||||||
line-height 50px
|
line-height 50px
|
||||||
padding 0 15px
|
padding 0 15px
|
||||||
background-color $ui-backgroundColor
|
background-color $ui-backgroundColor
|
||||||
border-bottom solid 1px $ui-borderColor
|
border-bottom solid 1px $ui-borderColor
|
||||||
color $ui-text-color
|
color $ui-text-color
|
||||||
|
|
||||||
.closeButton
|
|
||||||
position absolute
|
|
||||||
top 10px
|
|
||||||
right 10px
|
|
||||||
height 30px
|
|
||||||
width 0 25px
|
|
||||||
border $ui-border
|
|
||||||
border-radius 2px
|
|
||||||
color $ui-text-color
|
|
||||||
colorDefaultButton()
|
|
||||||
|
|
||||||
.control
|
.control
|
||||||
padding 25px 15px 15px
|
padding 25px 15px 15px
|
||||||
text-align center
|
text-align center
|
||||||
@@ -40,7 +29,7 @@
|
|||||||
background-color transparent
|
background-color transparent
|
||||||
outline none
|
outline none
|
||||||
vertical-align middle
|
vertical-align middle
|
||||||
font-size 18px
|
font-size 14px
|
||||||
text-align center
|
text-align center
|
||||||
&:disabled
|
&:disabled
|
||||||
background-color $ui-input--disabled-backgroundColor
|
background-color $ui-input--disabled-backgroundColor
|
||||||
@@ -65,13 +54,12 @@ body[data-theme="dark"]
|
|||||||
border-color $ui-dark-borderColor
|
border-color $ui-dark-borderColor
|
||||||
color $ui-dark-text-color
|
color $ui-dark-text-color
|
||||||
|
|
||||||
.closeButton
|
.description
|
||||||
border-color $ui-dark-borderColor
|
|
||||||
color $ui-dark-text-color
|
|
||||||
colorDarkDefaultButton()
|
|
||||||
|
|
||||||
.description
|
|
||||||
color $ui-inactive-text-color
|
color $ui-inactive-text-color
|
||||||
|
|
||||||
.control-input
|
.control-input
|
||||||
border-color $ui-dark-borderColor
|
border-color $ui-dark-borderColor
|
||||||
|
color $ui-dark-text-color
|
||||||
|
|
||||||
|
.control-confirmButton
|
||||||
|
colorDarkPrimaryButton()
|
||||||
|
|||||||
@@ -24,7 +24,8 @@ function data (state = defaultDataMap(), action) {
|
|||||||
state.storageMap.set(storage.key, storage)
|
state.storageMap.set(storage.key, storage)
|
||||||
})
|
})
|
||||||
|
|
||||||
action.notes.forEach((note) => {
|
action.notes.some((note) => {
|
||||||
|
if (note === undefined) return true
|
||||||
let uniqueKey = note.storage + '-' + note.key
|
let uniqueKey = note.storage + '-' + note.key
|
||||||
let folderKey = note.storage + '-' + note.folder
|
let folderKey = note.storage + '-' + note.folder
|
||||||
state.noteMap.set(uniqueKey, note)
|
state.noteMap.set(uniqueKey, note)
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ $sideNav--folded-width = 44px
|
|||||||
$topBar-height = 60px
|
$topBar-height = 60px
|
||||||
|
|
||||||
// UI default
|
// UI default
|
||||||
$ui-text-color = #515151
|
$ui-text-color = #333333
|
||||||
$ui-inactive-text-color = #939395
|
$ui-inactive-text-color = #939395
|
||||||
$ui-borderColor = #D1D1D1
|
$ui-borderColor = #D1D1D1
|
||||||
$ui-backgroundColor = #FFFFFF
|
$ui-backgroundColor = #FFFFFF
|
||||||
@@ -23,9 +23,9 @@ $ui-tag-backgroundColor = rgba(0, 0, 0, 0.3)
|
|||||||
|
|
||||||
// UI Button
|
// UI Button
|
||||||
$ui-button-color = #939395
|
$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-color = white
|
||||||
$ui-button--active-backgroundColor = #6AA5E9
|
$ui-button--active-backgroundColor = #D9D9D9
|
||||||
$ui-button--focus-borderColor = lighten(#369DCD, 25%)
|
$ui-button--focus-borderColor = lighten(#369DCD, 25%)
|
||||||
|
|
||||||
// UI Tooltip
|
// UI Tooltip
|
||||||
@@ -67,29 +67,43 @@ $active-border = solid 1px $active-border-color
|
|||||||
// Default button
|
// Default button
|
||||||
$default-button-background = white
|
$default-button-background = white
|
||||||
$default-button-background--hover = #e6e6e6
|
$default-button-background--hover = #e6e6e6
|
||||||
$default-button-background--active = #d4d4d4
|
$default-button-background--active = #D9D9D9
|
||||||
|
|
||||||
colorDefaultButton()
|
colorDefaultButton()
|
||||||
background-color $default-button-background
|
background-color $default-button-background
|
||||||
&:hover
|
&:hover
|
||||||
background-color $default-button-background--hover
|
background-color transparent
|
||||||
&:active
|
&:active
|
||||||
&:active:hover
|
&:active:hover
|
||||||
background-color $default-button-background--active
|
background-color $default-button-background--active
|
||||||
|
|
||||||
// Primary button(Brand color)
|
// 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--hover = darken($brand-color, 5%)
|
||||||
$primary-button-background--active = darken($brand-color, 10%)
|
$primary-button-background--active = darken($brand-color, 10%)
|
||||||
|
|
||||||
colorPrimaryButton()
|
colorPrimaryButton()
|
||||||
color white
|
color $ui-text-color
|
||||||
background-color $primary-button-background
|
background-color $default-button-background--hover
|
||||||
&:hover
|
&:hover
|
||||||
background-color $primary-button-background--hover
|
background-color $default-button-background--active
|
||||||
&:active
|
&:active
|
||||||
&:active:hover
|
&: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(Brand color)
|
||||||
$danger-button-background = #c9302c
|
$danger-button-background = #c9302c
|
||||||
@@ -113,13 +127,15 @@ navButtonColor()
|
|||||||
border none
|
border none
|
||||||
color $ui-button-color
|
color $ui-button-color
|
||||||
background-color transparent
|
background-color transparent
|
||||||
transition color background-color 0.15s
|
transition 0.15s
|
||||||
&:hover
|
&: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
|
&:active, &:active:hover
|
||||||
background-color $ui-button--active-backgroundColor
|
background-color $ui-button--active-backgroundColor
|
||||||
color $ui-button--active-color
|
color $ui-text-color
|
||||||
|
transition 0.15s
|
||||||
/**
|
/**
|
||||||
* # Modal Stuff
|
* # Modal Stuff
|
||||||
* These will be moved lib/modal
|
* These will be moved lib/modal
|
||||||
@@ -137,20 +153,40 @@ modal()
|
|||||||
background-color $modal-background
|
background-color $modal-background
|
||||||
overflow hidden
|
overflow hidden
|
||||||
border-radius $modal-border-radius
|
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
|
// Dark theme
|
||||||
|
$ui-dark-active-color = #3A404C
|
||||||
$ui-dark-borderColor = lighten(#21252B, 20%)
|
$ui-dark-borderColor = lighten(#21252B, 20%)
|
||||||
$ui-dark-backgroundColor = #1D1D1D
|
$ui-dark-backgroundColor = #1E2124
|
||||||
$ui-dark-noteList-backgroundColor = #181818
|
$ui-dark-noteList-backgroundColor = #282C30
|
||||||
$ui-dark-noteDetail-backgroundColor = #0D0D0D
|
$ui-dark-noteDetail-backgroundColor = #2D3033
|
||||||
$ui-dark-tag-backgroundColor = rgba(255, 255, 255, 0.3)
|
$ui-dark-tag-backgroundColor = #3A404C
|
||||||
$dark-background-color = lighten($ui-dark-backgroundColor, 10%)
|
$dark-background-color = lighten($ui-dark-backgroundColor, 10%)
|
||||||
$ui-dark-text-color = #DDDDDD
|
$ui-dark-text-color = #DDDDDD
|
||||||
$ui-dark-button--active-color = white
|
$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--hover-backgroundColor = lighten($ui-dark-backgroundColor, 10%)
|
||||||
$ui-dark-button--focus-borderColor = lighten(#369DCD, 25%)
|
$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 = $ui-dark-backgroundColor
|
||||||
$dark-default-button-background--hover = $ui-dark-button--hover-backgroundColor
|
$dark-default-button-background--hover = $ui-dark-button--hover-backgroundColor
|
||||||
@@ -181,14 +217,27 @@ navDarkButtonColor()
|
|||||||
border none
|
border none
|
||||||
color $ui-dark-button-color
|
color $ui-dark-button-color
|
||||||
background-color transparent
|
background-color transparent
|
||||||
transition color background-color 0.15s
|
transition 0.15s
|
||||||
&:hover
|
&:hover
|
||||||
color white
|
color $ui-dark-text-color
|
||||||
background-color $ui-dark-button--hover-backgroundColor
|
background-color $ui-dark-button--hover-backgroundColor
|
||||||
|
transition 0.15s
|
||||||
&:active
|
&: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
|
&:active:hover
|
||||||
background-color $ui-dark-button--active-backgroundColor
|
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-text-color = white
|
||||||
$ui-dark-tooltip-backgroundColor = alpha(#444, 70%)
|
$ui-dark-tooltip-backgroundColor = alpha(#444, 70%)
|
||||||
|
|||||||
@@ -1,19 +1,69 @@
|
|||||||
# Contributing to Boostnote
|
# Contributing to Boostnote (English)
|
||||||
|
|
||||||
## About copyright of Pull Request
|
### When you open an issue of a bug report
|
||||||
|
There are no issue template. But there is a request.
|
||||||
|
|
||||||
If you make a pull request, It means you agree to transfer the copyright of the code changes to MAISIN&CO.
|
**Please paste screenshots of Boostnote with developer tool open**
|
||||||
|
|
||||||
|
Thank you for your help in advance.
|
||||||
|
|
||||||
|
### About copyright of Pull Request
|
||||||
|
|
||||||
|
If you make a pull request, It means you agree to transfer the copyright of the code changes to Maisin&Co.
|
||||||
|
|
||||||
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.
|
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.
|
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)
|
# Contributing to Boostnote (Russian)
|
||||||
|
|
||||||
## Pull requestの著作権について
|
### Когда у вас появляется сообщение об ошибке
|
||||||
|
У нас нет шаблона, по которому вы должны описать ошибку. Просто расскажите, как вы получили ее
|
||||||
|
|
||||||
Pull requestをすることはその変化分のコードの著作権をMAISIN&CO.に譲渡することに同意することになります。
|
**Вставьте скриншот Boostnote с открытым инструментом разработчика (dev tools)**
|
||||||
|
|
||||||
|
Благодарим Вас за помощь!
|
||||||
|
|
||||||
|
### Об авторских правах Pull Request
|
||||||
|
|
||||||
|
Если вы делаете pull request, значит вы согласны передать авторские права на изменения кода в Maisin&Co.
|
||||||
|
|
||||||
|
Это не означает, что Boostnote станет платным приложением. Если мы захотим заработать немного денег, мы найдем другой способ. Например, использование облачного хранилища, интеграцией мобильных приложений или другими специальными функциями.
|
||||||
|
Так как лицензия GPL v3 слишком строгая, чтобы быть совместимой с любой другой лицензией, мы думаем, что нужно заменить лицензию на более свободную (например, BSD, MIT).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
# Contributing to Boostnote (Korean)
|
||||||
|
|
||||||
|
### 버그 리포트를 보고할 때
|
||||||
|
이슈의 양식은 없습니다. 하지만 부탁이 있습니다.
|
||||||
|
|
||||||
|
**개발자 도구를 연 상태의 Boostnote 스크린샷을 첨부해주세요**
|
||||||
|
|
||||||
|
도움을 주셔서 감사합니다.
|
||||||
|
|
||||||
|
### Pull Request의 저작권에 관하여
|
||||||
|
|
||||||
|
당신이 pull request를 요청하면, 코드 변경에 대한 저작권을 Maisin&Co에 양도한다는 것에 동의한다는 의미입니다.
|
||||||
|
|
||||||
|
이것은 Boostnote가 유료화가 되는 것을 의미하는 건 아닙니다. 만약 우리가 자금이 필요하다면, 우리는 클라우드 연동, 모바일 앱 통합 혹은 특수한 기능 같은 것을 사용해 수입 창출을 시도할 것입니다.
|
||||||
|
GPL v3 라이센스는 다른 라이센스와 혼합해 사용하기엔 너무 엄격하므로, 우리는 BSD, MIT 라이센스와 같은 더 자유로운 라이센스로 교체하는 것을 생각하고 있습니다.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
# Contributing to Boostnote (Japanese)
|
||||||
|
|
||||||
|
### バグレポートに関してのissueを立てる時
|
||||||
|
イシューテンプレートはありませんが、1つお願いがあります。
|
||||||
|
|
||||||
|
**開発者ツールを開いた状態のBoostnoteのスクリーンショットを貼ってください**
|
||||||
|
|
||||||
|
よろしくお願いします。
|
||||||
|
|
||||||
|
### Pull requestの著作権について
|
||||||
|
|
||||||
|
Pull requestをすることはその変化分のコードの著作権をMaisin&Co.に譲渡することに同意することになります。
|
||||||
|
|
||||||
アプリケーションのLicenseをいつでも変える選択肢を残したいと思うからです。
|
アプリケーションのLicenseをいつでも変える選択肢を残したいと思うからです。
|
||||||
これはいずれかBoostnoteが有料の商用アプリになる可能性がある話ではありません。
|
これはいずれかBoostnoteが有料の商用アプリになる可能性がある話ではありません。
|
||||||
|
|||||||
@@ -1,52 +1,52 @@
|
|||||||
# Build
|
# Build
|
||||||
|
|
||||||
|
## Environments
|
||||||
|
* npm: 4.x
|
||||||
|
* node: 7.x
|
||||||
|
|
||||||
|
You should use `npm v4.x` because `$ grand pre-build` fails on `v5.x`.
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
We use Webpack HMR to develop Boostnote.
|
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.
|
||||||
|
|
||||||
```
|
The `webpack` will watch for code changes and then apply them automatically.
|
||||||
webpack: bundle is now VALID.
|
|
||||||
```
|
|
||||||
|
|
||||||
Then, we have to run the app.
|
If the following error occurs: `Failed to load resource: net::ERR_CONNECTION_REFUSED`, please reload Boostnote.
|
||||||
```
|
|
||||||
$ npm run hot
|
|
||||||
```
|
|
||||||
> Actually the app can be start with `npm start`. However, the app will use the compiled script.
|
|
||||||
|
|
||||||
By this, webpack will watch the code changes and apply it automatically.
|

|
||||||
|
|
||||||
> ### Notice
|
> ### Notice
|
||||||
> There are some cases you have to refresh app yourself.
|
> There are some cases where you have to refresh the app manually.
|
||||||
> 1. When editing constructor method of a component
|
> 1. When editing a 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.)
|
> 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
|
## Deploy
|
||||||
|
|
||||||
We use Grunt.
|
We use Grunt to automate deployment.
|
||||||
Acutal deploy can be run by `grunt`. However, you shouldn't use because the default task is including codesign and authenticode.
|
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 executable file.
|
So, we've prepared a separate script which just makes an executable file.
|
||||||
|
|
||||||
```
|
```
|
||||||
grunt pre-build
|
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
20
docs/debug.md
Normal 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:
|
||||||
|

|
||||||
|
|
||||||
|
The `Developer Tools` will look like this:
|
||||||
|

|
||||||
|
|
||||||
|
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:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
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)
|
||||||
@@ -5,25 +5,25 @@
|
|||||||
Webpack HRMを使います。
|
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をリロードしてください。
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
> ### 注意
|
> ### 注意
|
||||||
> 時々、直接リフレッシュをする必要があります。
|
> 時々、直接リフレッシュをする必要があります。
|
||||||
|
|||||||
20
docs/jp/debug.md
Normal file
20
docs/jp/debug.md
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# Boostnote(electronアプリケーション)のデバッグ方法について
|
||||||
|
Boostnoteを作っているelectronはChromiumからできており、開発者は `Developer Tools`をGoogle Chromeと同じように使うことができます。
|
||||||
|
|
||||||
|
Developer Toolsの切り替え方法はこちらです:
|
||||||
|

|
||||||
|
|
||||||
|
実際のデベロッパーツールはこちらです:
|
||||||
|

|
||||||
|
|
||||||
|
何かエラーが起きた場合 `console`にエラーメッセージが表示されます。
|
||||||
|
|
||||||
|
## デバッグ
|
||||||
|
例えば、 `debugger`をコード中にブレークポイントとして挟む方法があります。
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
ですがこれは一例にしか過ぎません。最もあなたに合うデバッグ方法を見つけた方がいいでしょう。
|
||||||
|
|
||||||
|
## 参考
|
||||||
|
* [デバッグに関するGoogle Chromeの公式ドキュメント](https://developer.chrome.com/devtools)
|
||||||
15
docs/jp/testing.md
Normal file
15
docs/jp/testing.md
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# Testing for Boostnote
|
||||||
|
## e2eテスト
|
||||||
|
Boostnoteには[ava](https://github.com/avajs/ava)と[spectron](https://github.com/electron/spectron)で書かれたe2eテストがあります。
|
||||||
|
|
||||||
|
### 実行方法
|
||||||
|
以下のe2eテストのコマンドがあります。
|
||||||
|
|
||||||
|
```
|
||||||
|
$ yarn run test:e2e
|
||||||
|
```
|
||||||
|
|
||||||
|
もう一つのテストコマンドと分けた理由は、travisCIの都合です。
|
||||||
|
|
||||||
|
### travisCIでは
|
||||||
|
travisCIではmasterブランチで飲みe2eテストを実行するようにしています。もし興味がある方は `.travis.yml`をご覧ください。
|
||||||
@@ -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`로 실행가능합니다. 하지만 이 경우, 컴파일된 스크립트를 사용할 것입니다.
|
||||||
|
|
||||||
이로써 웹팩이 자동적으로 코드변경을 확인하고 적용해줄 것입니다.
|
이로써 웹팩이 자동적으로 코드변경을 확인하고 적용해줄 것입니다.
|
||||||
|
|
||||||
|
|||||||
57
docs/ru/build.md
Normal file
57
docs/ru/build.md
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
# Сборка
|
||||||
|
|
||||||
|
## Используемые инструменты
|
||||||
|
* npm: 4.x
|
||||||
|
* node: 7.x
|
||||||
|
|
||||||
|
Вы должны использовать `npm v4.x`, так как `$ grand pre-build` не работает в `v5.x`.
|
||||||
|
|
||||||
|
## Разработка
|
||||||
|
|
||||||
|
Мы используем Webpack HMR при разработке Boostnote.
|
||||||
|
Выполнение следующих команд в корне проекта запустит Boostnote с настройками по умолчанию.
|
||||||
|
|
||||||
|
Установите необходимые пакеты с помощью yarn.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ yarn
|
||||||
|
```
|
||||||
|
|
||||||
|
Соберите и запустите.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ yarn run dev-start
|
||||||
|
```
|
||||||
|
|
||||||
|
Эта команда выполняет `yarn run webpack` и `yarn run hot` параллельно. Результат будет такой же, если вы выполните эти две команды раздельно.
|
||||||
|
|
||||||
|
`Webpack` будет следить за изменениями в коде и будет применять их автоматически.
|
||||||
|
|
||||||
|
Если возникает следующая ошибка: `Failed to load resource: net::ERR_CONNECTION_REFUSED`, пожалуйста, перезапустите Boostnote.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
> ### Примечание
|
||||||
|
> В некоторых случаях вам необходимо обновить приложение вручную.
|
||||||
|
> 1. При редактировании метода конструктора компонента
|
||||||
|
> 2. При добавлении нового класса CSS (аналогично 1: Класс CSS перезаписывается каждым компонентом. Этот процесс выполняется в методе Constructor.)
|
||||||
|
|
||||||
|
## Деплой
|
||||||
|
|
||||||
|
Мы используем Grunt для автоматического деплоя.
|
||||||
|
Вы можете создать задачу, используя `grunt`. Однако мы не рекомендуем этого делать, так как задача по умолчанию включает в себя код и аутентификацию.
|
||||||
|
|
||||||
|
Мы подготовили отдельный скрипт, который просто создает исполняемый файл:
|
||||||
|
|
||||||
|
```
|
||||||
|
grunt pre-build
|
||||||
|
```
|
||||||
|
|
||||||
|
Вы найдете исполняемый файл в папке `dist`. Обратите внимание: автоматическое обновление не будет работать, потому что приложение не подписано.
|
||||||
|
|
||||||
|
Если вам необходимо, вы можете использовать код или аутентификацию с помощью этого исполняемого файла.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Special thanks:
|
||||||
|
Translated by @AlexanderBelkevich
|
||||||
25
docs/ru/debug.md
Normal file
25
docs/ru/debug.md
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# Как отладить Boostnote (приложение Electron)
|
||||||
|
Boostnote - это программа, сделанная с помощью Electron, поэтому она базируется на Chromium. Разработчики могут использовать `Developer Tools` в Google Chrome для отладки.
|
||||||
|
|
||||||
|
Вы можете переключиться в `Developer Tools` следующим образом:
|
||||||
|

|
||||||
|
|
||||||
|
`Developer Tools` будет выглядеть следующим образом:
|
||||||
|

|
||||||
|
|
||||||
|
Возможные ошибки отображаются во вкладке `console`.
|
||||||
|
|
||||||
|
## Отладка
|
||||||
|
Например, вы можете использовать `debugger`, чтобы установить точку остановы следующим образом:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Это всего лишь пример. Вы можете использовать любой свой способ отладки. Тот, который вам будет удобен.
|
||||||
|
|
||||||
|
## Рекомендации
|
||||||
|
* [Официальная документация Google Chrome об отладке](https://developer.chrome.com/devtools)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Special thanks:
|
||||||
|
Translated by @AlexanderBelkevich
|
||||||
20
docs/ru/testing.md
Normal file
20
docs/ru/testing.md
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# Тестирование для Boostnote
|
||||||
|
## Тестирование e2e
|
||||||
|
Существуют тесты e2e для Boostnote, написанные на [ava](https://github.com/avajs/ava) и [spectron](https://github.com/electron/spectron).
|
||||||
|
|
||||||
|
### Как запустить
|
||||||
|
Для тестирование e2e существует команда:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ yarn run test:e2e
|
||||||
|
```
|
||||||
|
|
||||||
|
Причина, по которой я использую другую команду тестирования - это удобство travisCI.
|
||||||
|
|
||||||
|
### TravisCI
|
||||||
|
Я установил тесты e2e, запущенные на travisCI, только в ветке master. Если вас это интересует, ознакомьтесь с файлом .travis.yml
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Special thanks:
|
||||||
|
Translated by @AlexanderBelkevich
|
||||||
15
docs/testing.md
Normal file
15
docs/testing.md
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# Testing for Boostnote
|
||||||
|
## e2e testing
|
||||||
|
There is e2e tests for Boostnote written in [ava](https://github.com/avajs/ava) and [spectron](https://github.com/electron/spectron).
|
||||||
|
|
||||||
|
### How to run
|
||||||
|
There is a command for e2e testing bellow:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ yarn run test:e2e
|
||||||
|
```
|
||||||
|
|
||||||
|
The reason why I seperate aother test command is because of convenience of travisCI.
|
||||||
|
|
||||||
|
### On travisCI
|
||||||
|
I set e2e tests running on travisCI only master branch. If you're interested in it, please take a look at .travis.yml
|
||||||
@@ -259,6 +259,8 @@ module.exports = function (grunt) {
|
|||||||
case 'osx':
|
case 'osx':
|
||||||
grunt.task.run(['compile', 'pack:osx'])
|
grunt.task.run(['compile', 'pack:osx'])
|
||||||
break
|
break
|
||||||
|
case 'linux':
|
||||||
|
grunt.task.run(['compile', 'pack:linux'])
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -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]
|
|
||||||
@@ -32,6 +32,7 @@
|
|||||||
<script src="../node_modules/codemirror/addon/mode/loadmode.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/sublime.js"></script>
|
||||||
<script src="../node_modules/codemirror/keymap/vim.js"></script>
|
<script src="../node_modules/codemirror/keymap/vim.js"></script>
|
||||||
|
<script src="../node_modules/codemirror/keymap/emacs.js"></script>
|
||||||
<script src="../node_modules/codemirror/addon/runmode/runmode.js"></script>
|
<script src="../node_modules/codemirror/addon/runmode/runmode.js"></script>
|
||||||
|
|
||||||
<script src="../node_modules/raphael/raphael.min.js"></script>
|
<script src="../node_modules/raphael/raphael.min.js"></script>
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ const BrowserWindow = electron.BrowserWindow
|
|||||||
const shell = electron.shell
|
const shell = electron.shell
|
||||||
const mainWindow = require('./main-window')
|
const mainWindow = require('./main-window')
|
||||||
|
|
||||||
const OSX = process.platform === 'darwin'
|
const macOS = process.platform === 'darwin'
|
||||||
// const WIN = process.platform === 'win32'
|
// const WIN = process.platform === 'win32'
|
||||||
const LINUX = process.platform === 'linux'
|
const LINUX = process.platform === 'linux'
|
||||||
|
|
||||||
var boost = OSX
|
const boost = macOS
|
||||||
? {
|
? {
|
||||||
label: 'Boostnote',
|
label: 'Boostnote',
|
||||||
submenu: [
|
submenu: [
|
||||||
@@ -36,6 +36,7 @@ var boost = OSX
|
|||||||
type: 'separator'
|
type: 'separator'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
label: 'Quit Boostnote',
|
||||||
role: 'quit'
|
role: 'quit'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -49,19 +50,19 @@ var boost = OSX
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
var file = {
|
const file = {
|
||||||
label: 'File',
|
label: 'File',
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
label: 'New Note',
|
label: 'New Note',
|
||||||
accelerator: 'CmdOrCtrl + N',
|
accelerator: 'CommandOrControl+N',
|
||||||
click: function () {
|
click () {
|
||||||
mainWindow.webContents.send('top:new-note')
|
mainWindow.webContents.send('top:new-note')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Focus Note',
|
label: 'Focus Note',
|
||||||
accelerator: 'Control + E',
|
accelerator: 'Control+E',
|
||||||
click () {
|
click () {
|
||||||
mainWindow.webContents.send('detail:focus')
|
mainWindow.webContents.send('detail:focus')
|
||||||
}
|
}
|
||||||
@@ -91,10 +92,24 @@ var file = {
|
|||||||
{
|
{
|
||||||
type: 'separator'
|
type: 'separator'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: 'Import from',
|
||||||
|
submenu: [
|
||||||
|
{
|
||||||
|
label: 'Plain Text, MarkDown (.txt, .md)',
|
||||||
|
click () {
|
||||||
|
mainWindow.webContents.send('import:file')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'separator'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: 'Delete Note',
|
label: 'Delete Note',
|
||||||
accelerator: OSX ? 'Control + Backspace' : 'Control + Delete',
|
accelerator: macOS ? 'Control+Backspace' : 'Control+Delete',
|
||||||
click: function () {
|
click () {
|
||||||
mainWindow.webContents.send('detail:delete')
|
mainWindow.webContents.send('detail:delete')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -104,13 +119,12 @@ var file = {
|
|||||||
if (LINUX) {
|
if (LINUX) {
|
||||||
file.submenu.push({
|
file.submenu.push({
|
||||||
type: 'separator'
|
type: 'separator'
|
||||||
})
|
}, {
|
||||||
file.submenu.push({
|
|
||||||
role: 'quit'
|
role: 'quit'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
var edit = {
|
const edit = {
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
@@ -149,20 +163,20 @@ var edit = {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
var view = {
|
const view = {
|
||||||
label: 'View',
|
label: 'View',
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
label: 'Reload',
|
label: 'Reload',
|
||||||
accelerator: 'CmdOrCtrl+R',
|
accelerator: 'CommandOrControl+R',
|
||||||
click: function () {
|
click () {
|
||||||
BrowserWindow.getFocusedWindow().reload()
|
BrowserWindow.getFocusedWindow().reload()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Toggle Developer Tools',
|
label: 'Toggle Developer Tools',
|
||||||
accelerator: OSX ? 'Command+Alt+I' : 'Ctrl+Shift+I',
|
accelerator: macOS ? 'Command+Alt+I' : 'Control+Shift+I',
|
||||||
click: function () {
|
click () {
|
||||||
BrowserWindow.getFocusedWindow().toggleDevTools()
|
BrowserWindow.getFocusedWindow().toggleDevTools()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -171,24 +185,31 @@ var view = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Next Note',
|
label: 'Next Note',
|
||||||
accelerator: 'Control + J',
|
accelerator: 'Control+J',
|
||||||
click () {
|
click () {
|
||||||
mainWindow.webContents.send('list:next')
|
mainWindow.webContents.send('list:next')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Previous Note',
|
label: 'Previous Note',
|
||||||
accelerator: 'Control + U',
|
accelerator: 'Control+U',
|
||||||
click () {
|
click () {
|
||||||
mainWindow.webContents.send('list:prior')
|
mainWindow.webContents.send('list:prior')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: 'Jump to Top',
|
||||||
|
accelerator: 'Control+G',
|
||||||
|
click () {
|
||||||
|
mainWindow.webContents.send('list:jumpToTop')
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
type: 'separator'
|
type: 'separator'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Focus Search',
|
label: 'Focus Search',
|
||||||
accelerator: 'Control + S',
|
accelerator: 'Control+S',
|
||||||
click () {
|
click () {
|
||||||
mainWindow.webContents.send('top:focus-search')
|
mainWindow.webContents.send('top:focus-search')
|
||||||
}
|
}
|
||||||
@@ -196,7 +217,7 @@ var view = {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
var window = {
|
const window = {
|
||||||
label: 'Window',
|
label: 'Window',
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
@@ -219,21 +240,21 @@ var window = {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
var help = {
|
const help = {
|
||||||
label: 'Help',
|
label: 'Help',
|
||||||
role: 'help',
|
role: 'help',
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
label: 'Boostnote official site',
|
label: 'Boostnote official site',
|
||||||
click: function () { shell.openExternal('https://boostnote.io/') }
|
click () { shell.openExternal('https://boostnote.io/') }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Issue Tracker',
|
label: 'Issue Tracker',
|
||||||
click: function () { shell.openExternal('https://github.com/BoostIO/Boostnote/issues') }
|
click () { shell.openExternal('https://github.com/BoostIO/Boostnote/issues') }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Changelog',
|
label: 'Changelog',
|
||||||
click: function () { shell.openExternal('https://github.com/BoostIO/boost-releases') }
|
click () { shell.openExternal('https://github.com/BoostIO/boost-releases') }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ const Config = require('electron-config')
|
|||||||
const config = new Config()
|
const config = new Config()
|
||||||
|
|
||||||
var showMenu = process.platform !== 'win32'
|
var showMenu = process.platform !== 'win32'
|
||||||
let windowSize = config.get('windowsize') || { width: 1080, height: 720 }
|
const windowSize = config.get('windowsize') || { width: 1080, height: 720 }
|
||||||
|
|
||||||
let mainWindow = new BrowserWindow({
|
const mainWindow = new BrowserWindow({
|
||||||
width: windowSize.width,
|
width: windowSize.width,
|
||||||
height: windowSize.height,
|
height: windowSize.height,
|
||||||
minWidth: 500,
|
minWidth: 500,
|
||||||
@@ -40,12 +40,19 @@ mainWindow.webContents.sendInputEvent({
|
|||||||
|
|
||||||
if (process.platform !== 'linux' || process.env.DESKTOP_SESSION === 'cinnamon') {
|
if (process.platform !== 'linux' || process.env.DESKTOP_SESSION === 'cinnamon') {
|
||||||
mainWindow.on('close', function (e) {
|
mainWindow.on('close', function (e) {
|
||||||
|
e.preventDefault()
|
||||||
if (process.platform === 'win32') {
|
if (process.platform === 'win32') {
|
||||||
mainWindow.minimize()
|
mainWindow.minimize()
|
||||||
} else {
|
} 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) {
|
app.on('before-quit', function (e) {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
<style>
|
<style>
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Lato';
|
font-family: 'OpenSans';
|
||||||
src: url('../resources/fonts/Lato-Regular.woff2') format('woff2'), /* Modern Browsers */
|
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.woff') format('woff'), /* Modern Browsers */
|
||||||
url('../resources/fonts/Lato-Regular.ttf') format('truetype');
|
url('../resources/fonts/Lato-Regular.ttf') format('truetype');
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
text-rendering: optimizeLegibility;
|
text-rendering: optimizeLegibility;
|
||||||
}
|
}
|
||||||
#loadingCover{
|
#loadingCover{
|
||||||
|
background-color: #f4f4f4;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
@@ -47,7 +48,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<div id="loadingCover">
|
<div id="loadingCover">
|
||||||
<img src="../resources/app.png">
|
<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>
|
||||||
|
|
||||||
<div id="content"></div>
|
<div id="content"></div>
|
||||||
@@ -58,6 +59,7 @@
|
|||||||
<script src="../node_modules/codemirror/addon/mode/loadmode.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/sublime.js"></script>
|
||||||
<script src="../node_modules/codemirror/keymap/vim.js"></script>
|
<script src="../node_modules/codemirror/keymap/vim.js"></script>
|
||||||
|
<script src="../node_modules/codemirror/keymap/emacs.js"></script>
|
||||||
<script src="../node_modules/codemirror/addon/runmode/runmode.js"></script>
|
<script src="../node_modules/codemirror/addon/runmode/runmode.js"></script>
|
||||||
|
|
||||||
<script src="../node_modules/codemirror/addon/edit/continuelist.js"></script>
|
<script src="../node_modules/codemirror/addon/edit/continuelist.js"></script>
|
||||||
|
|||||||
20
package.json
20
package.json
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "boost",
|
"name": "boost",
|
||||||
"version": "0.8.5",
|
"version": "0.8.11",
|
||||||
"description": "Boostnote",
|
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
|
"description": "Boostnote",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "electron ./index.js",
|
"start": "electron ./index.js",
|
||||||
@@ -10,8 +10,10 @@
|
|||||||
"webpack": "webpack-dev-server --hot --inline --config webpack.config.js",
|
"webpack": "webpack-dev-server --hot --inline --config webpack.config.js",
|
||||||
"compile": "grunt compile",
|
"compile": "grunt compile",
|
||||||
"test": "PWD=$(pwd) NODE_ENV=test ava",
|
"test": "PWD=$(pwd) NODE_ENV=test ava",
|
||||||
|
"test:e2e": "NODE_ENV=test ava tests/e2e/*",
|
||||||
"fix": "npm run lint --fix",
|
"fix": "npm run lint --fix",
|
||||||
"lint": "eslint ./**/*.js"
|
"lint": "eslint .",
|
||||||
|
"dev-start": "concurrently --kill-others \"npm run webpack\" \"npm run hot\""
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"electron-version": "1.2.8"
|
"electron-version": "1.2.8"
|
||||||
@@ -48,6 +50,8 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@rokt33r/markdown-it-math": "^4.0.1",
|
"@rokt33r/markdown-it-math": "^4.0.1",
|
||||||
"@rokt33r/season": "^5.3.0",
|
"@rokt33r/season": "^5.3.0",
|
||||||
|
"aws-sdk": "^2.48.0",
|
||||||
|
"aws-sdk-mobile-analytics": "^0.9.2",
|
||||||
"codemirror": "^5.19.0",
|
"codemirror": "^5.19.0",
|
||||||
"electron-config": "^0.2.1",
|
"electron-config": "^0.2.1",
|
||||||
"electron-gh-releases": "^2.0.2",
|
"electron-gh-releases": "^2.0.2",
|
||||||
@@ -55,18 +59,20 @@
|
|||||||
"font-awesome": "^4.3.0",
|
"font-awesome": "^4.3.0",
|
||||||
"immutable": "^3.8.1",
|
"immutable": "^3.8.1",
|
||||||
"js-sequence-diagrams": "^1000000.0.6",
|
"js-sequence-diagrams": "^1000000.0.6",
|
||||||
"katex": "^0.6.0",
|
"katex": "^0.7.1",
|
||||||
"lodash": "^4.11.1",
|
"lodash": "^4.11.1",
|
||||||
"markdown-it": "^6.0.1",
|
"markdown-it": "^6.0.1",
|
||||||
"markdown-it-checkbox": "^1.1.0",
|
"markdown-it-checkbox": "^1.1.0",
|
||||||
"markdown-it-emoji": "^1.1.1",
|
"markdown-it-emoji": "^1.1.1",
|
||||||
"markdown-it-footnote": "^3.0.0",
|
"markdown-it-footnote": "^3.0.0",
|
||||||
|
"markdown-it-imsize": "^2.0.1",
|
||||||
"md5": "^2.0.0",
|
"md5": "^2.0.0",
|
||||||
"mixpanel": "^0.4.1",
|
"mixpanel": "^0.4.1",
|
||||||
"moment": "^2.10.3",
|
"moment": "^2.10.3",
|
||||||
"node-ipc": "^8.1.0",
|
"node-ipc": "^8.1.0",
|
||||||
"raphael": "^2.2.7",
|
"raphael": "^2.2.7",
|
||||||
"react": "^15.0.2",
|
"react": "^15.0.2",
|
||||||
|
"react-codemirror": "^0.3.0",
|
||||||
"react-dom": "^15.0.2",
|
"react-dom": "^15.0.2",
|
||||||
"react-redux": "^4.4.5",
|
"react-redux": "^4.4.5",
|
||||||
"redux": "^3.5.2",
|
"redux": "^3.5.2",
|
||||||
@@ -84,6 +90,8 @@
|
|||||||
"babel-preset-react": "^6.3.13",
|
"babel-preset-react": "^6.3.13",
|
||||||
"babel-preset-react-hmre": "^1.0.1",
|
"babel-preset-react-hmre": "^1.0.1",
|
||||||
"babel-register": "^6.11.6",
|
"babel-register": "^6.11.6",
|
||||||
|
"concurrently": "^3.4.0",
|
||||||
|
"copy-to-clipboard": "^3.0.6",
|
||||||
"css-loader": "^0.19.0",
|
"css-loader": "^0.19.0",
|
||||||
"devtron": "^1.1.0",
|
"devtron": "^1.1.0",
|
||||||
"dom-storage": "^2.0.2",
|
"dom-storage": "^2.0.2",
|
||||||
@@ -97,15 +105,15 @@
|
|||||||
"grunt-electron-installer": "^1.2.0",
|
"grunt-electron-installer": "^1.2.0",
|
||||||
"history": "^1.17.0",
|
"history": "^1.17.0",
|
||||||
"jsdom": "^9.4.2",
|
"jsdom": "^9.4.2",
|
||||||
|
"json-loader": "^0.5.4",
|
||||||
"merge-stream": "^1.0.0",
|
"merge-stream": "^1.0.0",
|
||||||
"nib": "^1.1.0",
|
"nib": "^1.1.0",
|
||||||
"react": "^15.3.0",
|
|
||||||
"react-color": "^2.2.2",
|
"react-color": "^2.2.2",
|
||||||
"react-css-modules": "^3.7.6",
|
"react-css-modules": "^3.7.6",
|
||||||
"react-dom": "^15.3.0",
|
|
||||||
"react-input-autosize": "^1.1.0",
|
"react-input-autosize": "^1.1.0",
|
||||||
"react-router": "^2.4.0",
|
"react-router": "^2.4.0",
|
||||||
"react-router-redux": "^4.0.4",
|
"react-router-redux": "^4.0.4",
|
||||||
|
"spectron": "^3.6.2",
|
||||||
"standard": "^8.4.0",
|
"standard": "^8.4.0",
|
||||||
"style-loader": "^0.12.4",
|
"style-loader": "^0.12.4",
|
||||||
"stylus": "^0.52.4",
|
"stylus": "^0.52.4",
|
||||||
|
|||||||
@@ -23,12 +23,15 @@
|
|||||||
## Contributors
|
## Contributors
|
||||||
[Great contributors](https://github.com/BoostIO/Boostnote/graphs/contributors) :tada:
|
[Great contributors](https://github.com/BoostIO/Boostnote/graphs/contributors) :tada:
|
||||||
|
|
||||||
|
## slack group
|
||||||
|
私たちにはslack groupもあります!世界中のプログラマー達と、Boostnoteについてディスカッションをしましょう! <br>
|
||||||
|
[こちらから](https://join.slack.com/boostnote-group/shared_invite/MjAwNTAwNzc4MDM0LTE0OTc5NjIzMDItZjcyOWIyOWY5YQ)
|
||||||
|
|
||||||
## More Information
|
## More Information
|
||||||
* Website: http://boostnote.io/
|
* Website: http://boostnote.io/
|
||||||
* Roadmap(upcoming features and bug fixes): https://github.com/BoostIO/Boostnote/wiki/List-of-the-requested-features
|
* Roadmap(upcoming features and bug fixes): https://github.com/BoostIO/Boostnote/wiki/List-of-the-requested-features
|
||||||
* Boostnote Shop(Products are shipped to all over the world :+1:): https://boostnote.paintory.com/
|
* Boostnote Shop(Products are shipped to all over the world :+1:): https://boostnote.paintory.com/
|
||||||
* Donation: [Patreon](https://www.patreon.com/boostnote)
|
* Donation: [Bountysource](https://salt.bountysource.com/teams/boostnote)
|
||||||
* Development: https://github.com/BoostIO/Boostnote/blob/master/docs/build.md
|
* Development: https://github.com/BoostIO/Boostnote/blob/master/docs/build.md
|
||||||
* Copyright (C) 2017 Maisin&Co.
|
* Copyright (C) 2017 Maisin&Co.
|
||||||
|
|
||||||
|
|||||||
15
readme.md
15
readme.md
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
[](https://travis-ci.org/BoostIO/Boostnote)
|
[](https://travis-ci.org/BoostIO/Boostnote)
|
||||||
|
|
||||||
## Author & Maintainer
|
## Authors & Maintainers
|
||||||
- [Rokt33r](https://github.com/rokt33r)
|
- [Rokt33r](https://github.com/rokt33r)
|
||||||
- [sota1235](https://github.com/sota1235)
|
- [sota1235](https://github.com/sota1235)
|
||||||
- [Kohei TAKATA](https://github.com/kohei-takata)
|
- [Kohei TAKATA](https://github.com/kohei-takata)
|
||||||
@@ -23,13 +23,16 @@
|
|||||||
## Contributors
|
## Contributors
|
||||||
[Great contributors](https://github.com/BoostIO/Boostnote/graphs/contributors) :tada:
|
[Great contributors](https://github.com/BoostIO/Boostnote/graphs/contributors) :tada:
|
||||||
|
|
||||||
|
## Slack Group
|
||||||
|
Let's talk about Boostnote's great features, new feature requests and things like Japanese gourmet. 🍣 <br>
|
||||||
|
[Join us](https://join.slack.com/boostnote-group/shared_invite/MjAwNTAwNzc4MDM0LTE0OTc5NjIzMDItZjcyOWIyOWY5YQ)
|
||||||
|
|
||||||
## More Information
|
## More Information
|
||||||
* Website: http://boostnote.io/
|
* [Website](https://boostnote.io)
|
||||||
* Roadmap(upcoming features and bug fixes): https://github.com/BoostIO/Boostnote/wiki/List-of-the-requested-features
|
* [Boostnote Shop](https://boostnote.paintory.com/) : Products are shipped to all over the world 🌏
|
||||||
* Boostnote Shop(Products are shipped to all over the world :+1:): https://boostnote.paintory.com/
|
* [Donate via Bountysource](https://salt.bountysource.com/teams/boostnote) : Thank you for your support 🎉
|
||||||
* Donation: [Patreon](https://www.patreon.com/boostnote)
|
* [GitHub Issues](https://github.com/BoostIO/Boostnote/issues) : We'd love to hear your feedback 🙌
|
||||||
* Development: https://github.com/BoostIO/Boostnote/blob/master/docs/build.md
|
* [Development](https://github.com/BoostIO/Boostnote/blob/master/docs/build.md) : Development configurations for Boostnote 🚀
|
||||||
* Copyright (C) 2017 Maisin&Co.
|
* Copyright (C) 2017 Maisin&Co.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|||||||
BIN
resources/tray-icon-dark.png
Executable file → Normal file
BIN
resources/tray-icon-dark.png
Executable file → Normal file
Binary file not shown.
|
Before Width: | Height: | Size: 802 B After Width: | Height: | Size: 498 B |
BIN
resources/tray-icon-dark@2x.png
Executable file → Normal file
BIN
resources/tray-icon-dark@2x.png
Executable file → Normal file
Binary file not shown.
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 937 B |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user