mirror of
https://github.com/documize/community.git
synced 2025-08-08 23:15:29 +02:00
Compare commits
1336 commits
Author | SHA1 | Date | |
---|---|---|---|
|
efb092ef8f | ||
|
3fc0a15f87 | ||
|
c841c85478 | ||
|
2dae03332b | ||
|
44b1f263cd | ||
|
982e16737e | ||
|
f641e42434 | ||
|
8895db56af | ||
|
acb59e1b43 | ||
|
f2ba294be8 | ||
|
69940cb7f1 | ||
|
6bfdda7178 | ||
|
027fdf108c | ||
|
1f12df76aa | ||
|
d811b88896 | ||
|
20fb853907 | ||
|
599c53a971 | ||
|
1f462ed4f7 | ||
|
9f122fa79b | ||
|
4210caca48 | ||
|
c62fa4612b | ||
|
510e1bd0bd | ||
|
a32510b8e6 | ||
|
589f3f581f | ||
|
20bba4cd7e | ||
|
cbf5f4be7d | ||
|
dc63639c99 | ||
|
26f435bdc9 | ||
|
a8a82963fa | ||
|
ab8582e807 | ||
|
4fa0566274 | ||
|
f4b45d2aa7 | ||
|
1abc5d3e52 | ||
|
6e463ff2f4 | ||
|
f80b3f3d10 | ||
|
6c218cf087 | ||
|
3d1c8a6c54 | ||
|
576fd5e604 | ||
|
62407a28b4 | ||
|
0adf6d5dc8 | ||
|
15f8a64c86 | ||
|
95c67acaa0 | ||
|
d8f66b5ffb | ||
|
c051e81a99 | ||
|
1d86b98949 | ||
|
0a1cc86907 | ||
|
a49869d35d | ||
|
848afd3263 | ||
|
b9cb99e3bb | ||
|
64261ffcf5 | ||
|
0030418707 | ||
|
0f91ee518e | ||
|
5de1b7a92e | ||
|
a2524f785e | ||
|
f16b9f3810 | ||
|
1c09771c33 | ||
|
13fc5b5015 | ||
|
76c777acc1 | ||
|
ea9ff78411 | ||
|
4a9dd47894 | ||
|
7565779ef1 | ||
|
c07e7b6afc | ||
|
88bdafcb1b | ||
|
5a3cb1b226 | ||
|
6ee8e6c7b4 | ||
|
599c464d2d | ||
|
ae77fa2275 | ||
|
610367aac5 | ||
|
be2c2a7a2c | ||
|
0d28b7ee79 | ||
|
aa8b473018 | ||
|
6993dc678f | ||
|
e0e3f0c141 | ||
|
4c031fe7e4 | ||
|
e4025bee42 | ||
|
876775b395 | ||
|
828c01d189 | ||
|
a69bcc0af6 | ||
|
5ec911dce2 | ||
|
ce07d4d147 | ||
|
f3ef83162e | ||
|
f1a01ec195 | ||
|
01e53c3d27 | ||
|
2cf21a7bea | ||
|
d4c606760c | ||
|
9343d77b26 | ||
|
30aa8aadb6 | ||
|
29bc2677a8 | ||
|
d9827df440 | ||
|
cfd7ebd2bf | ||
|
b510615691 | ||
|
e8641405cf | ||
|
209f1b667e | ||
|
e70019d73b | ||
|
dc26f063c8 | ||
|
68d067ef7b | ||
|
0d52f434d5 | ||
|
ce22c78dac | ||
|
f976ea36f6 | ||
|
1734963693 | ||
|
247a2b2c03 | ||
|
38a790dd04 | ||
|
b77b4abdc2 | ||
|
6b498a74c6 | ||
|
f6dd872782 | ||
|
9473ecba9a | ||
|
1a909dd046 | ||
|
607a2d5797 | ||
|
037dfc40cd | ||
|
65348eee28 | ||
|
78932fb8c7 | ||
|
6c8b10753d | ||
|
e56263564c | ||
|
22b6a4fb78 | ||
|
7e26c003d6 | ||
|
e81cbad385 | ||
|
4494ace0a2 | ||
|
23abcf1585 | ||
|
67070c3bfc | ||
|
77c767a351 | ||
|
17162ce336 | ||
|
7255eb4f56 | ||
|
df534f72fa | ||
|
f4a1350a41 | ||
|
cd15c393fe | ||
|
7f66977ac1 | ||
|
33a9cbb5b0 | ||
|
716343680a | ||
|
5db5f4d63b | ||
|
3d3d50762e | ||
|
20c9168140 | ||
|
ce9c635fb4 | ||
|
f735ae1278 | ||
|
bca7794c00 | ||
|
371706fb49 | ||
|
a236cbb01c | ||
|
93b6f26365 | ||
|
5e687f5ef4 | ||
|
97c4c927ac | ||
|
4885a1b380 | ||
|
e0805d7131 | ||
|
6d735e8579 | ||
|
073ef81e80 | ||
|
38c9a94a9c | ||
|
59dc6ea991 | ||
|
4ab48cc67d | ||
|
53297f7627 | ||
|
4ed2b3902c | ||
|
6968581e5b | ||
|
c09a116e56 | ||
|
7cf672646a | ||
|
29447a2784 | ||
|
479d03ba70 | ||
|
a7dac6911c | ||
|
08f21346c1 | ||
|
ce4f62d346 | ||
|
8a25509019 | ||
|
59c929d251 | ||
|
245c538990 | ||
|
32a9528e6d | ||
|
a15f0c8eb6 | ||
|
eb9fbd25b9 | ||
|
dbef758035 | ||
|
dea25a2b85 | ||
|
fcf38d8af9 | ||
|
ce93a5e623 | ||
|
8df1cc73b0 | ||
|
53ec7c9274 | ||
|
cfe85248ce | ||
|
30c31a1ba7 | ||
|
a97b6b22d9 | ||
|
e985c5f808 | ||
|
4b89f3b1c2 | ||
|
707dc1e052 | ||
|
88211739f0 | ||
|
6b3cdb5033 | ||
|
45f216b8a1 | ||
|
c31c130ffd | ||
|
5d5e212a6b | ||
|
8fa5569ae5 | ||
|
8976bf817b | ||
|
0c3fed2b18 | ||
|
60dfb54d54 | ||
|
c6863201b3 | ||
|
45567e274a | ||
|
dff4c6929b | ||
|
eea8db9288 | ||
|
e19c4ad18a | ||
|
989b7cd62c | ||
|
df8f650319 | ||
|
565a063231 | ||
|
cb46f34503 | ||
|
470e2d3ecf | ||
|
cddba799f8 | ||
|
05df22ed4a | ||
|
a5dfa6ee39 | ||
|
780ce2df61 | ||
|
9f28e1bff2 | ||
|
8ae94295a2 | ||
|
adb7b4d7bf | ||
|
66fcb77d8b | ||
|
972413110f | ||
|
a0a166136e | ||
|
30d12ba756 | ||
|
06bf9efcfc | ||
|
9ed8f79315 | ||
|
73e8c7a278 | ||
|
806efd7eac | ||
|
724f3c88b3 | ||
|
4a7d915ebb | ||
|
c7413da943 | ||
|
4e0218f5ea | ||
|
4fe022aa0c | ||
|
aaa8c3282d | ||
|
5e022dd0b8 | ||
|
bbca180298 | ||
|
cdc7489659 | ||
|
ab95fcc64d | ||
|
9bee58057e | ||
|
bda9719ecb | ||
|
fbd4b17c15 | ||
|
c689379f92 | ||
|
d1774b42bd | ||
|
8ac35a6b74 | ||
|
813f270a9d | ||
|
e014f5b5c1 | ||
|
2b66d0096a | ||
|
50f47f61a5 | ||
|
d26ecdc12f | ||
|
1a89201bd9 | ||
|
accf0a2c63 | ||
|
cafa3ceed0 | ||
|
2b3e9dfbc9 | ||
|
1c1ebee15a | ||
|
6ba4ca9c16 | ||
|
5aaa9f874d | ||
|
51a25adbdb | ||
|
9d025c3f71 | ||
|
a4384210d4 | ||
|
6882491201 | ||
|
d4edcb8b2c | ||
|
f117e91bcb | ||
|
5c1ad25dc9 | ||
|
8970a21b58 | ||
|
0e6f2f1f5e | ||
|
7fc74be7cd | ||
|
faeadb2bbb | ||
|
be50bf9f14 | ||
|
60ef205948 | ||
|
7ae801554d | ||
|
441efd42e9 | ||
|
a19ba46f7a | ||
|
ad361c22ba | ||
|
7954f4b976 | ||
|
2d105f2154 | ||
|
811e239baf | ||
|
c7e71173ea | ||
|
8fa8a3657c | ||
|
a64a219ce8 | ||
|
d7a484a936 | ||
|
017b19141c | ||
|
39f457e90e | ||
|
30d3e6f82e | ||
|
8c2bed283f | ||
|
a3867c617a | ||
|
28424e7e4b | ||
|
7c70274f5e | ||
|
ef5b5cdb32 | ||
|
ccd756aca0 | ||
|
444b89e425 | ||
|
3d0f17386b | ||
|
513fd9f994 | ||
|
5cef58eeba | ||
|
fad1de2e41 | ||
|
6b723568d3 | ||
|
00889f0e0e | ||
|
6629d76453 | ||
|
74300b009b | ||
|
5004e5a85e | ||
|
0524a0c74c | ||
|
b826852137 | ||
|
2c164a135a | ||
|
44febcc25c | ||
|
66e11cefbc | ||
|
5e9eeb5bf9 | ||
|
5b7610d726 | ||
|
0419f3b7b3 | ||
|
5b72da037c | ||
|
d14e8a3ff6 | ||
|
9a3d2c3c28 | ||
|
3b76e10ee0 | ||
|
29d7307537 | ||
|
96e5812fc0 | ||
|
c35eb16fc5 | ||
|
9dd78ca9be | ||
|
891ba07db8 | ||
|
2ee9a9ff46 | ||
|
399c36611f | ||
|
fbb73560c0 | ||
|
15e687841f | ||
|
0a10087160 | ||
|
9d0d4a7861 | ||
|
fc60a5917e | ||
|
285a01508b | ||
|
4f248bf018 | ||
|
32dbab826d | ||
|
b6e1543b7f | ||
|
f8bb879a70 | ||
|
20366e6776 | ||
|
ffacf17c5f | ||
|
bfe4c5d768 | ||
|
0f3a618140 | ||
|
826f6d96a6 | ||
|
6a9fa0140a | ||
|
24619c6a58 | ||
|
ebc8214049 | ||
|
71c1def5c7 | ||
|
fded0014a3 | ||
|
041091504f | ||
|
8c2df6178d | ||
|
02d478c6dd | ||
|
8c99977fc9 | ||
|
9d6b6fec23 | ||
|
4e0e3b5101 | ||
|
e219c97a6b | ||
|
7485f2cef7 | ||
|
627195aae7 | ||
|
f39be2a594 | ||
|
444b4fd1f7 | ||
|
b31f330c41 | ||
|
69077ce419 | ||
|
201d2a339c | ||
|
326019d655 | ||
|
264c25cfe0 | ||
|
595301db64 | ||
|
d6432afdad | ||
|
9c36241b58 | ||
|
c538fc9eb1 | ||
|
f3df43efe0 | ||
|
d04becc1a3 | ||
|
3621e2fb79 | ||
|
411f64c359 | ||
|
ae923e7df1 | ||
|
bfe5262cb5 | ||
|
80f0876b51 | ||
|
b2cd375936 | ||
|
243a170071 | ||
|
fb3f2cc24b | ||
|
946c433018 | ||
|
4d2f30711c | ||
|
887c999a1e | ||
|
b256bf2e9d | ||
|
8f4cd755de | ||
|
64612b825a | ||
|
216866a953 | ||
|
14820df165 | ||
|
f7a738ad84 | ||
|
df2775f8a4 | ||
|
a710839f69 | ||
|
2a45c82b46 | ||
|
7eec01811a | ||
|
ef5e4db298 | ||
|
b1cb0ed155 | ||
|
78fd14b3d3 | ||
|
82ddcc057d | ||
|
a90c5834fa | ||
|
ec8d5c78e2 | ||
|
b75969ae90 | ||
|
9b82f42cc1 | ||
|
b8fee6b962 | ||
|
8baad7e2f0 | ||
|
99a5418dba | ||
|
acd3dd63b5 | ||
|
96872990f9 | ||
|
c59a467cdb | ||
|
715c31a1da | ||
|
40237344e2 | ||
|
91a3c59cd2 | ||
|
fe7548cd97 | ||
|
ca4a9a74ee | ||
|
1e1cbdd843 | ||
|
c8b82c85fe | ||
|
bae7909801 | ||
|
c870547fa1 | ||
|
c0876e7be8 | ||
|
cd9f681adf | ||
|
0240f98eb0 | ||
|
c49707d160 | ||
|
c65eb97948 | ||
|
bc9dab72f2 | ||
|
6ae9414361 | ||
|
e37782e5b7 | ||
|
2bbeaf91a0 | ||
|
de273a38ed | ||
|
08794f8d5f | ||
|
14f313a836 | ||
|
62c3cd03ad | ||
|
bce1c1b166 | ||
|
758bf07272 | ||
|
479508e436 | ||
|
49bf4eeaa0 | ||
|
1c45aef461 | ||
|
a988bc0c3c | ||
|
91ec2f89d8 | ||
|
2477c36f11 | ||
|
e2a3962092 | ||
|
8ecbb9cdee | ||
|
f738077f5a | ||
|
f17de58fff | ||
|
40a0d77f93 | ||
|
072ca0dfed | ||
|
b054addb9c | ||
|
e59e1f060a | ||
|
faf9a555d2 | ||
|
8ab3cbe7e8 | ||
|
86d25b2191 | ||
|
9a53958c8f | ||
|
b971c52469 | ||
|
34d1639899 | ||
|
1fefdaec9f | ||
|
8f1bc8ce1f | ||
|
d151555597 | ||
|
4255291223 | ||
|
86a4e82c12 | ||
|
daa9e08ab4 | ||
|
c666e68c2b | ||
|
e6e3ed71ac | ||
|
89a28ad22f | ||
|
8e4ad6422b | ||
|
4de83beba4 | ||
|
10c57a0ae1 | ||
|
728789195c | ||
|
b5cd378302 | ||
|
7fde947a52 | ||
|
61d0086337 | ||
|
166aeba09b | ||
|
c0ed3c3d04 | ||
|
ab5314d5e1 | ||
|
51a0e1127e | ||
|
e10d04d22e | ||
|
2fffb7869e | ||
|
82ed36478b | ||
|
1da49974cb | ||
|
9e3eac19aa | ||
|
92696c5181 | ||
|
eecf316d50 | ||
|
fa383a58ff | ||
|
b5a5cfd697 | ||
|
2ddd7ada9b | ||
|
8515a77403 | ||
|
f8d97d2a56 | ||
|
e98f7b9218 | ||
|
a41f43c380 | ||
|
64403c402b | ||
|
9ec858286f | ||
|
80aab3ce99 | ||
|
deb579d8ad | ||
|
e6335dd58c | ||
|
e1a8f8b724 | ||
|
e1001bb11e | ||
|
dbee77df56 | ||
|
9c2bff0374 | ||
|
651cbb1dfe | ||
|
a98c3a0fe2 | ||
|
a08b583b22 | ||
|
6738d2c9e1 | ||
|
441001fffe | ||
|
a4e07fbf7f | ||
|
9a41e82aa3 | ||
|
b89a297c70 | ||
|
ca1e281775 | ||
|
c5fc0f93e0 | ||
|
217e8a3a29 | ||
|
1854998c80 | ||
|
f4a371357e | ||
|
1d00f8ac6e | ||
|
0985dbf5b6 | ||
|
b2fcad649e | ||
|
f062005946 | ||
|
36d7136210 | ||
|
0bfde82040 | ||
|
e6e5f75ee7 | ||
|
eb9501014d | ||
|
e35639502d | ||
|
3db4981181 | ||
|
3206eb4176 | ||
|
576e1beade | ||
|
54eefc5132 | ||
|
fbb1e334f8 | ||
|
bb73655327 | ||
|
8c2febd636 | ||
|
395008d06d | ||
|
d009e4ed2a | ||
|
54bf258c61 | ||
|
8332e8a03d | ||
|
a6f8be2928 | ||
|
cbd9fddcfe | ||
|
4013b5ca03 | ||
|
24b1326c31 | ||
|
566807bc14 | ||
|
df8e843bf5 | ||
|
4d0de69489 | ||
|
25c247e99b | ||
|
ed99b0c9f3 | ||
|
8b0bb456d9 | ||
|
e438542cab | ||
|
553c17181e | ||
|
9b06ddecb5 | ||
|
3fd1d793a3 | ||
|
fc17ea5225 | ||
|
f47f09661f | ||
|
4b7d4cf872 | ||
|
c108d0eb30 | ||
|
1f5221ffa0 | ||
|
a888b12ad1 | ||
|
2510972a83 | ||
|
560f786b8b | ||
|
af641b93f1 | ||
|
f4fa63359f | ||
|
f828583b49 | ||
|
af9bc25660 | ||
|
66003dac21 | ||
|
d4f6694933 | ||
|
27030a0dc2 | ||
|
43f515a1f9 | ||
|
9aaea9492a | ||
|
ac84eaf85d | ||
|
9504a8cf6c | ||
|
fbe353475c | ||
|
bbed3e5a08 | ||
|
9f4715a494 | ||
|
d8cb69b6c0 | ||
|
7f2d2c01a6 | ||
|
f3e66b73c1 | ||
|
02ffaa5f99 | ||
|
9219dd9296 | ||
|
5faf6bda9b | ||
|
89a7496c7f | ||
|
c0c3ca18e2 | ||
|
2e443de84e | ||
|
9b51d9990f | ||
|
278572c49b | ||
|
1e217274c6 | ||
|
9fd002b5da | ||
|
f5bdbb49d0 | ||
|
c69020f1e6 | ||
|
0707bdd3d6 | ||
|
36634be6f5 | ||
|
6c71a1f18d | ||
|
6126d4dd5d | ||
|
013d09dda4 | ||
|
c6632fec1d | ||
|
e8735ffc12 | ||
|
c5155da74b | ||
|
e737339090 | ||
|
4f63a32ab1 | ||
|
7cc0b9c9b8 | ||
|
560d00322f | ||
|
b6d9c54667 | ||
|
6c07d2e569 | ||
|
924b707db0 | ||
|
3da4144c1b | ||
|
1ef209b74f | ||
|
d281621d90 | ||
|
d05052a5b4 | ||
|
317e9cbcaa | ||
|
2efd239d14 | ||
|
984aa854e5 | ||
|
ca213ba5d1 | ||
|
c1d796e6bc | ||
|
60fbdfda11 | ||
|
659eb99c0f | ||
|
bc28b36627 | ||
|
f73c2f13d4 | ||
|
0ce10ae5a2 | ||
|
a1d5dcaed9 | ||
|
3beb47fd49 | ||
|
aa0f76d3e2 | ||
|
479a61a3ef | ||
|
c706edec47 | ||
|
5467771542 | ||
|
1d4a20cdfe | ||
|
1b268d42de | ||
|
4ddbe59556 | ||
|
a424bbfcae | ||
|
fb391d49a5 | ||
|
9206e9aaa1 | ||
|
e6ddb1ec24 | ||
|
0b94d55fb9 | ||
|
4d83f5efd7 | ||
|
dd355958a2 | ||
|
90aa9710a6 | ||
|
036f36ba1d | ||
|
a211ba051a | ||
|
fe8068965c | ||
|
5757b2d36e | ||
|
3d0a3cecf9 | ||
|
eb56169fe5 | ||
|
6f495dd1c6 | ||
|
b495041222 | ||
|
92cb03a1db | ||
|
60f8cb7b5b | ||
|
60d2ef57bb | ||
|
61c648a7ac | ||
|
d0f0a12f2d | ||
|
89957c8278 | ||
|
e140caff55 | ||
|
3c81297fc6 | ||
|
2042454e77 | ||
|
329c43eba0 | ||
|
93253be0f2 | ||
|
3d2060ca60 | ||
|
7cdf97aa86 | ||
|
b4b3dbcb4c | ||
|
60e92b63a9 | ||
|
d5b5e015d1 | ||
|
0cc83c13c8 | ||
|
42db78ce14 | ||
|
05a1db9d8a | ||
|
9f35cbb64a | ||
|
d1bc4a5b4c | ||
|
8a654fcf3d | ||
|
0ec0c65002 | ||
|
edb256e754 | ||
|
ff1d737c68 | ||
|
8d525ce733 | ||
|
f442081a41 | ||
|
02102f9bf3 | ||
|
6eb68f84e0 | ||
|
f140e7ef77 | ||
|
adbd00bdd7 | ||
|
c7808d0b5a | ||
|
cf263a4f6a | ||
|
70a3b5915c | ||
|
5cfbf07e55 | ||
|
4b68529090 | ||
|
44d3e40663 | ||
|
0de7efdf20 | ||
|
3b179d5bc0 | ||
|
75a19a80f9 | ||
|
f05a6fc999 | ||
|
f44cda66e6 | ||
|
d7a46ceee6 | ||
|
da0861b3fd | ||
|
34d54745f3 | ||
|
679049d2b1 | ||
|
11e164496b | ||
|
a7e52809dc | ||
|
7428199fdd | ||
|
d499888cfd | ||
|
c152d029f2 | ||
|
5d632712e0 | ||
|
09635b67ab | ||
|
73d91a2dae | ||
|
5153d49ad7 | ||
|
b1865b2318 | ||
|
7e959b448c | ||
|
b37f9d601f | ||
|
0a313be1de | ||
|
1d8bb2d3ad | ||
|
3913995dd0 | ||
|
5e58b56182 | ||
|
cb9fd0940d | ||
|
4df1574663 | ||
|
77ab56dbf8 | ||
|
c0e1bd5045 | ||
|
0a64afd6b5 | ||
|
6a9ad7f540 | ||
|
d1b803b246 | ||
|
745e610bcb | ||
|
db78d75489 | ||
|
e116d3b000 | ||
|
6e4c5194e2 | ||
|
eb57cfbfd6 | ||
|
cccf160d37 | ||
|
4b543733e7 | ||
|
8cc6bf3d40 | ||
|
9c6075c6a4 | ||
|
150f86025b | ||
|
313ed7f90a | ||
|
f950075593 | ||
|
9667e8c2a0 | ||
|
88b84dc5ed | ||
|
cee71cb313 | ||
|
db04057d9e | ||
|
ec1939c01d | ||
|
b3383f46ca | ||
|
516140dd7e | ||
|
71a2860716 | ||
|
e0457b40da | ||
|
66d5e73ed1 | ||
|
4094677792 | ||
|
8bbb0d3e82 | ||
|
4aa3bba7bc | ||
|
49f05746bd | ||
|
8eb930d281 | ||
|
85b3f6e8ee | ||
|
5b4c3ec8cd | ||
|
df0e3c108e | ||
|
ab2cbd4ff7 | ||
|
391c143483 | ||
|
7860bc1808 | ||
|
486395c1ce | ||
|
1c3eef345f | ||
|
c5476d99e9 | ||
|
6dfb1ad2e5 | ||
|
075060d11c | ||
|
97d36fa2c8 | ||
|
58aad87770 | ||
|
8a65567169 | ||
|
97beb3f4d3 | ||
|
b455e5eaf5 | ||
|
d0e005f638 | ||
|
a9e12f3b4c | ||
|
153e38a5d4 | ||
|
fe7389e7ca | ||
|
8ee63de6c7 | ||
|
944fd98421 | ||
|
5376bd88d8 | ||
|
3ea6ae3c37 | ||
|
d67767fcfc | ||
|
4f0cc2f616 | ||
|
28342fcf5e | ||
|
9c2594b1b4 | ||
|
4f525bd634 | ||
|
09de686fcf | ||
|
97d90662dd | ||
|
4c733ce581 | ||
|
2336dab69f | ||
|
cf1e1ff943 | ||
|
3bccd6a537 | ||
|
d7fea2125f | ||
|
2792c8c1da | ||
|
0f19826556 | ||
|
64e6a41353 | ||
|
0847a82fc9 | ||
|
9ee9526a47 | ||
|
53e4861ded | ||
|
8ab23c657b | ||
|
e03497032b | ||
|
ae084ae0bb | ||
|
6e0958b3c3 | ||
|
074eea3aeb | ||
|
63b17f9b88 | ||
|
1ce7e53398 | ||
|
fd167234ae | ||
|
e6b557f43b | ||
|
a7865d0f71 | ||
|
7df0fbcb2b | ||
|
e490407260 | ||
|
e7bff0359a | ||
|
2a2831e576 | ||
|
8d3dfcc3c7 | ||
|
f28b7497fa | ||
|
b1a35b7f75 | ||
|
8a30f3681c | ||
|
6073b24036 | ||
|
1b16be2505 | ||
|
bd2e8ac165 | ||
|
351b8dcc12 | ||
|
2c8b757ff6 | ||
|
abc0b206a4 | ||
|
47bb9d7d74 | ||
|
58fc03f4c1 | ||
|
9987d29b7b | ||
|
7206f721f4 | ||
|
4d1eb952b2 | ||
|
64b1394ec1 | ||
|
7b178a76b2 | ||
|
0f9602e3a0 | ||
|
7878a244d3 | ||
|
0c5ec43c80 | ||
|
39891a0758 | ||
|
63ce324eae | ||
|
b74dfe6385 | ||
|
aaca1c73b1 | ||
|
67bb3bae4f | ||
|
39677791b3 | ||
|
82a5bfe198 | ||
|
9d80c5fc8c | ||
|
4949043df9 | ||
|
b7fa4e1a1a | ||
|
def01b6265 | ||
|
cf0b06923d | ||
|
ef425a6ce2 | ||
|
689e5078b8 | ||
|
f916801008 | ||
|
d0970c153b | ||
|
743eae5aad | ||
|
f884926df7 | ||
|
50c7fabeb6 | ||
|
6617a5de45 | ||
|
4cfbd57871 | ||
|
19736aab04 | ||
|
0743ae002c | ||
|
4130d1f129 | ||
|
10a184ad10 | ||
|
a0f6626367 | ||
|
d5be8ec843 | ||
|
13deb55cbb | ||
|
5ed180396e | ||
|
ad44112359 | ||
|
5d80480d75 | ||
|
ecc306136a | ||
|
419ce1bbb5 | ||
|
3c5065375d | ||
|
dc091fed7b | ||
|
467acec3c4 | ||
|
ae50b889c5 | ||
|
6ff74cf45e | ||
|
785e4c245d | ||
|
5d33860a15 | ||
|
d689cbc281 | ||
|
29534273b8 | ||
|
03be1ce904 | ||
|
30856433f8 | ||
|
27fde0dac8 | ||
|
f70d4b33a3 | ||
|
df9d9e174a | ||
|
6e7f3cceaa | ||
|
8db452a18b | ||
|
0b139c871f | ||
|
5a480479a1 | ||
|
ee28e27b16 | ||
|
ce9d314837 | ||
|
628a633a0a | ||
|
ed6edd8dcb | ||
|
ad2e653f3c | ||
|
2e9734e73e | ||
|
0da8ae9e4a | ||
|
d88adef5b5 | ||
|
acdf2025ab | ||
|
78cdca3266 | ||
|
5fe094a2d7 | ||
|
b316ba80d8 | ||
|
bf305d271e | ||
|
dea7a99aed | ||
|
94a2e2c0f7 | ||
|
2d2296591b | ||
|
b34e41f65c | ||
|
b828145163 | ||
|
9a3259b60e | ||
|
372b3f3692 | ||
|
e68a18395e | ||
|
fcd95cf415 | ||
|
92f8fe550e | ||
|
738b3d94b6 | ||
|
59bc495b56 | ||
|
193d6914d6 | ||
|
06b28991a7 | ||
|
fca6cc7ede | ||
|
716bd062d7 | ||
|
d5157615e0 | ||
|
dc2c7a5f7c | ||
|
f9e2141ed4 | ||
|
b0daabb577 | ||
|
983b84235c | ||
|
25fd13bd3f | ||
|
f20a1d1d5f | ||
|
c7cc36b307 | ||
|
c5561491a2 | ||
|
cfe30dcde5 | ||
|
36be6243ad | ||
|
21ba55a58f | ||
|
3903e58367 | ||
|
5d757c992f | ||
|
a453052087 | ||
|
95323c90ee | ||
|
09d698fd2a | ||
|
31580d883c | ||
|
eb7ebf391d | ||
|
942bc386f4 | ||
|
4045197871 | ||
|
46ee4b1a58 | ||
|
f5b196c334 | ||
|
53c2404822 | ||
|
df1e022e71 | ||
|
3e428de4cc | ||
|
17fc2329df | ||
|
9724f85653 | ||
|
e85744e1b3 | ||
|
c66fae703c | ||
|
e4c075ea4b | ||
|
2066f72258 | ||
|
0f87d5b07e | ||
|
c94fd9cfcf | ||
|
fb193ce9f9 | ||
|
2298ac3376 | ||
|
3b0291d94c | ||
|
c32d094e91 | ||
|
3bc775582d | ||
|
af632615cf | ||
|
85b6e40d8c | ||
|
d746c90624 | ||
|
2b8a7921ad | ||
|
567ee10c5f | ||
|
ba42d5e282 | ||
|
fb8adc6491 | ||
|
455a384eb0 | ||
|
e234471b1e | ||
|
b839a0753c | ||
|
05da8894b9 | ||
|
734e8653dd | ||
|
3e37b9b7e4 | ||
|
b1e0e31a9e | ||
|
f2a903d054 | ||
|
b40db1433e | ||
|
962a8369aa | ||
|
f21c80d960 | ||
|
7b619101f1 | ||
|
08557c369c | ||
|
e47c5e61fc | ||
|
123fce6c17 | ||
|
91c8b05d89 | ||
|
74e9699e1e | ||
|
9235c183c5 | ||
|
bde0091a4a | ||
|
8fb001422a | ||
|
0019e860ad | ||
|
591579251e | ||
|
46f5f25acc | ||
|
94ca80f052 | ||
|
22b6674edb | ||
|
6c8f23792c | ||
|
1887eb8100 | ||
|
1ea30ee8e1 | ||
|
b1d677778b | ||
|
a3157749f0 | ||
|
cc7bcc31be | ||
|
2dce8a89a4 | ||
|
efcc0fe9ac | ||
|
ddd90a4aaf | ||
|
c92ab3a589 | ||
|
5fb41e9fb1 | ||
|
19a916a4b4 | ||
|
b65a00dd1c | ||
|
f2b1b5af03 | ||
|
ca62d74a19 | ||
|
335a1d1f81 | ||
|
c9e429ea1a | ||
|
663ec23c75 | ||
|
c29426f2d7 | ||
|
274b77cb8f | ||
|
01720722d6 | ||
|
2579382280 | ||
|
e19e3682b7 | ||
|
38772f5961 | ||
|
0d78cf3dda | ||
|
18930fb610 | ||
|
ca91cd8e49 | ||
|
ee10e6db3b | ||
|
b4c4decb3b | ||
|
a6828e6b7f | ||
|
4816cf73c0 | ||
|
c138716ff4 | ||
|
527b02e8b3 | ||
|
1944690540 | ||
|
df0a13b6ed | ||
|
30315a36c7 | ||
|
ad4030bc17 | ||
|
e1d2d4c037 | ||
|
c3c4e9820e | ||
|
3e1ee64e6f | ||
|
d45182b382 | ||
|
8077dd939a | ||
|
c31711c130 | ||
|
0b85657536 | ||
|
8d65c2d571 | ||
|
38e8c4665a | ||
|
5c0b87bac5 | ||
|
eaf46f06c1 | ||
|
97cc5374f0 | ||
|
c5acaae677 | ||
|
297ce94546 | ||
|
d9a2b16c2a | ||
|
6ac035f196 | ||
|
7eb99c52f2 | ||
|
f825e9fdc9 | ||
|
eb3bebf20d | ||
|
a7a82d9fe3 | ||
|
bc2cab5721 | ||
|
8466cafe1f | ||
|
ddcc61d5e0 | ||
|
089457f16e | ||
|
ba52dfa11d | ||
|
d9a9a828ed | ||
|
b2e3f2be7e | ||
|
958f4d30b9 | ||
|
4e32bffebe | ||
|
c7ebbff318 | ||
|
359e0e29eb | ||
|
1c4a4424e5 | ||
|
f3e4b4060e | ||
|
e6e099db1a | ||
|
bd43319bb2 | ||
|
99220641f3 | ||
|
b2b3e6fca6 | ||
|
ada775e074 | ||
|
ad3f406876 | ||
|
93b95b9eca | ||
|
22679920d0 | ||
|
d1fdb385e9 | ||
|
7ccb3b4658 | ||
|
0d39f7251e | ||
|
08f0c2cd0b | ||
|
99f0a16d71 | ||
|
f0aed0ba77 | ||
|
ed11c0ad11 | ||
|
0b5ed8fd9e | ||
|
7e6d6366da | ||
|
e4d78904dc | ||
|
0680a72ee2 | ||
|
19b4a3de49 | ||
|
00f415214c | ||
|
f8e47fe1d2 | ||
|
ae6494b4f0 | ||
|
e9e1d76831 | ||
|
92533036a7 | ||
|
421fde56e8 | ||
|
8d4c6a19ee | ||
|
c705e8c299 | ||
|
3993cfeb8e | ||
|
c1667e97b7 | ||
|
fc742a2282 | ||
|
bca306347d | ||
|
fd693f4ff4 | ||
|
0262763c95 | ||
|
1e2c468dc4 | ||
|
26de0551ae | ||
|
b5aef1dc87 | ||
|
8f0440d55f | ||
|
1ef8807b2d | ||
|
9d82682797 | ||
|
7d3473365a | ||
|
0f3de51ad5 | ||
|
f967949513 | ||
|
1370b2f2b5 | ||
|
bd9b7e120e | ||
|
0997655e0a | ||
|
880f39f1cb | ||
|
f61f260db1 | ||
|
c000a66eef | ||
|
c77b5c05ca | ||
|
ce3e5c829b | ||
|
717df79e16 | ||
|
bffdd1f2b1 | ||
|
601262db12 | ||
|
a1833f56a3 | ||
|
9d8b1d2f3c | ||
|
91bab8c710 | ||
|
5295f8a41f | ||
|
8ddc6cedde | ||
|
2d8dc62ca4 | ||
|
412127811e | ||
|
c0d70e38de | ||
|
adef6dfffa | ||
|
88b99979a9 | ||
|
4c80b8877d | ||
|
8ec36cfa49 | ||
|
cb4b6ee6c3 | ||
|
5dd7d9c181 | ||
|
b4fd42da38 | ||
|
b7811eccde | ||
|
c0d19f2531 | ||
|
6409ad0d63 | ||
|
5f59e95495 | ||
|
049b83e0b9 | ||
|
a13b631a7e | ||
|
b9394a4967 | ||
|
f4f32bcfcb | ||
|
58c88e2127 | ||
|
7505904de1 | ||
|
9a804b5666 | ||
|
40ade5c777 | ||
|
0b0cae4a8d | ||
|
cafa410d16 | ||
|
00070d7f0d | ||
|
d0f28daa7c | ||
|
ebdaa9529c | ||
|
e897b078fd | ||
|
c3a2717bfa | ||
|
34d7a97ae8 | ||
|
43d3e84573 | ||
|
50a17256e5 | ||
|
ca783dd323 | ||
|
4de19dcbec | ||
|
8b05e7ab81 | ||
|
44970a7861 | ||
|
0336f84a83 | ||
|
3337db6b27 | ||
|
1ed6427532 | ||
|
5d3ddaa2d9 | ||
|
f72b02cbb2 | ||
|
af7e089764 | ||
|
a728f14d41 | ||
|
9afc4ca98b | ||
|
ab475ede04 | ||
|
e25f23e94c | ||
|
26243a5a55 | ||
|
c449bdcd16 | ||
|
dd45a67537 | ||
|
6f1b0564e2 | ||
|
215f644d11 | ||
|
3329942d8a | ||
|
b339df5125 | ||
|
e158c9f0f8 | ||
|
4cf8c34ebd | ||
|
3f2edcaa96 | ||
|
869884abda | ||
|
daf61dfe9f | ||
|
cc1c216754 | ||
|
5edd08ee04 | ||
|
e61b2d0aa8 | ||
|
66bc874d95 | ||
|
cce1b5ef50 | ||
|
486b5983d9 | ||
|
6cc78f76da | ||
|
c5c988709d | ||
|
5de856e579 | ||
|
2da0089c1c | ||
|
9dcaf697a8 | ||
|
c12d66643c | ||
|
0eef10e586 | ||
|
57b3801f87 | ||
|
35947ffbfc | ||
|
23a6b25b0a | ||
|
db1b3aef8c | ||
|
531e9c88d7 | ||
|
13a879a89b | ||
|
836b7f3fb4 | ||
|
72615ba77b | ||
|
9fd53142f3 | ||
|
666ab3151e | ||
|
8415f11303 | ||
|
60fb4e5008 | ||
|
2d7e3c2904 | ||
|
e8785f5420 | ||
|
7188324714 | ||
|
fbb6f3485d | ||
|
95bb440a65 | ||
|
79531e01b3 | ||
|
75aa00beca | ||
|
fd6b4c051b | ||
|
68f5008a52 | ||
|
2ba948bc82 | ||
|
102f0c3800 | ||
|
533a0f094e | ||
|
1f0fc844a8 | ||
|
1c08a7fbcf | ||
|
e10313b7cc | ||
|
18fc5db8c6 | ||
|
aee9345886 | ||
|
bae1245d47 | ||
|
9cbee80f51 | ||
|
acc947c2ed | ||
|
4bc08cbdee | ||
|
ec5d21be4a | ||
|
b31ab712c1 | ||
|
0f04be4ea1 | ||
|
f35fdab9ba | ||
|
e265323a90 | ||
|
2b642f25d3 | ||
|
5ad905a576 | ||
|
cb6dce9613 | ||
|
1e3f8e51f0 | ||
|
785d12191e | ||
|
38b401f646 | ||
|
c77b384215 | ||
|
f2794a9836 | ||
|
d9eda2a0ff | ||
|
e44837c8db | ||
|
41340a7b15 | ||
|
318abef710 | ||
|
bc72db711f | ||
|
82c381de0d | ||
|
94f52760ec | ||
|
f5c819331d | ||
|
8680237016 | ||
|
b8d848549e | ||
|
b2138d6bdb | ||
|
604bdf78da | ||
|
de384f2412 | ||
|
c8dc284d03 | ||
|
0e00085f81 | ||
|
ab7a515b9d | ||
|
1d2109aa44 | ||
|
7ce3adb65e | ||
|
30321781c2 | ||
|
f5f30d2322 | ||
|
620fe28b27 | ||
|
ba5988dca3 | ||
|
8d761da939 | ||
|
5481de4e1c | ||
|
2cee83d570 | ||
|
a0a1dd396a | ||
|
8f80673cde | ||
|
9ccd0fd19c | ||
|
d6e18b4289 | ||
|
37563632ef | ||
|
1b548ea03e | ||
|
f0582e18f7 | ||
|
508ec00c6a | ||
|
b56d3426d2 | ||
|
3a9675eb14 | ||
|
4d989e2497 | ||
|
3f31d6d15e | ||
|
0c152c219f | ||
|
775990f040 | ||
|
ea38729f55 | ||
|
4874d23f15 | ||
|
a86d52388e | ||
|
6a651770b5 | ||
|
c12c000ef3 | ||
|
c4c95a9d24 | ||
|
cd543a1506 | ||
|
300b617583 | ||
|
ef285c91de | ||
|
5f7c6d211f | ||
|
ae05cacf3f | ||
|
eae1a9a429 | ||
|
c51ba65b1d | ||
|
fbf2222eda | ||
|
2386dcbd83 | ||
|
e92ad317d8 | ||
|
42b86b0513 | ||
|
f4f2f5c032 | ||
|
0de060138d | ||
|
66497d5407 | ||
|
6ecf5a87cd | ||
|
d6a17d5a56 | ||
|
dba57a15a8 | ||
|
a982af6e79 | ||
|
e505bb36e2 | ||
|
d3512b499a | ||
|
8081b60146 | ||
|
63b24aed3f | ||
|
c235fb569e | ||
|
07c8238664 | ||
|
5a2c44717e | ||
|
bf390ed0b9 | ||
|
81cd22e130 | ||
|
866b4eba8a | ||
|
17db964b10 | ||
|
adbe93a28a | ||
|
5b70ffd954 | ||
|
eeb3d8f070 | ||
|
f3c7f0eca7 | ||
|
558d90d2ba | ||
|
574139ae21 | ||
|
a306ca2fcd | ||
|
599b961a38 | ||
|
b2a5bc8451 | ||
|
d4463b5aaa | ||
|
1b96c9093f | ||
|
19ae74b388 | ||
|
2c5f73a486 | ||
|
6c3042fd4e | ||
|
7d0c1a3922 | ||
|
4ff78efef2 | ||
|
4fc83c9734 | ||
|
888569d070 | ||
|
4b24cbc686 | ||
|
00c2d17fcb | ||
|
db1af55c6c | ||
|
d45aa70157 | ||
|
9e20a5f085 | ||
|
557da2847e | ||
|
62b7b149c1 | ||
|
0ee2903608 | ||
|
4046accc23 | ||
|
476403bf46 | ||
|
ecc94f31c9 | ||
|
562872a4a8 | ||
|
e284a46f86 | ||
|
5e2c96bf5b | ||
|
23e111f60d | ||
|
d5bc9bb7cb | ||
|
f7bcf1366c | ||
|
7faf6d6cff | ||
|
65390ab67d | ||
|
7756a50d64 | ||
|
d90b3249c3 | ||
|
72b14def6d | ||
|
27640dffc4 | ||
|
792c3e2ce8 | ||
|
25b576f861 | ||
|
d888962082 | ||
|
76d77bef9b | ||
|
1f713c11b6 | ||
|
3defc062bd | ||
|
5acfae3d0d | ||
|
6fd6bc6d26 | ||
|
56238b00c5 | ||
|
89cfbf3e48 | ||
|
d85218ccd2 | ||
|
bc49041359 | ||
|
763bd1f0e2 | ||
|
68130122e7 | ||
|
dc49dbbeff | ||
|
6a18d18f91 | ||
|
fe05cf7bb5 | ||
|
cf58f8164d | ||
|
7b8cec9a6c | ||
|
23948aa386 | ||
|
bcfe638863 | ||
|
6e1cca8658 | ||
|
b6616d4965 | ||
|
7455a027fc | ||
|
fddaf9effe | ||
|
761d3c212c | ||
|
69e90ec56a | ||
|
34527d76e2 | ||
|
d4062db02d | ||
|
3d6727ff4c | ||
|
a8e8d141d2 | ||
|
7397812307 | ||
|
567d49f794 | ||
|
3c1306d178 | ||
|
b1b1544d60 | ||
|
19baae5a3f | ||
|
d46c32c7a2 | ||
|
86dcbbd684 | ||
|
bbcba8eb18 | ||
|
99b9427b8e | ||
|
65666c5a89 | ||
|
60131df628 | ||
|
88add0ae63 | ||
|
36e8f86488 | ||
|
c797a87eb9 | ||
|
2d5b8e652f | ||
|
92eca1a1ce | ||
|
93ed361705 | ||
|
b6c676149a | ||
|
f48740ec12 | ||
|
f8e091db53 | ||
|
bcabe494e3 |
3980 changed files with 580331 additions and 810458 deletions
|
@ -1,3 +1,6 @@
|
|||
.DS_Store
|
||||
.git
|
||||
bin
|
||||
.idea
|
||||
selfcert
|
||||
gui/dist-prod
|
40
.gitignore
vendored
40
.gitignore
vendored
|
@ -18,8 +18,9 @@ _convert
|
|||
bin/*
|
||||
dist/*
|
||||
embed/bindata/*
|
||||
app/dist/*
|
||||
app/dist-prod/*
|
||||
edition/static/*
|
||||
gui/dist/*
|
||||
gui/dist-prod/*
|
||||
|
||||
# Architecture specific extensions/prefixes
|
||||
*.[568vq]
|
||||
|
@ -38,28 +39,35 @@ _testmain.go
|
|||
/plugin-libreoffice/plugin-libreoffice-osx
|
||||
|
||||
# Ember specific
|
||||
/app/dist
|
||||
/app/dist-prod
|
||||
/app/tmp
|
||||
/app/bower_components
|
||||
/app/node_modules
|
||||
/app/.sass-cache
|
||||
/app/connect.lock
|
||||
/app/coverage/*
|
||||
/app/libpeerconnection.log
|
||||
/app/npm-debug.log
|
||||
/app/testem.log
|
||||
/gui/dist
|
||||
/gui/dist-prod
|
||||
/gui/tmp
|
||||
/gui/bower_components
|
||||
/gui/node_modules
|
||||
/gui/.sass-cache
|
||||
/gui/connect.lock
|
||||
/gui/coverage/*
|
||||
/gui/libpeerconnection.log
|
||||
/gui/npm-debug.log
|
||||
/gui/testem.log
|
||||
node_modules
|
||||
|
||||
# Misc.
|
||||
build
|
||||
plugin-msword/plugin-msword
|
||||
plugin-msword/plugin-msword-osx
|
||||
npm-debug.log
|
||||
debug
|
||||
*.pem
|
||||
*.crt
|
||||
Dockerfile
|
||||
container.sh
|
||||
make.sh
|
||||
jsconfig.json
|
||||
jsconfig.json
|
||||
yarn-error.log
|
||||
testem.log
|
||||
# ember-try
|
||||
.node_modules.ember-try/
|
||||
bower.json.ember-try
|
||||
package.json.ember-try
|
||||
embed/bindata_assetfs.go
|
||||
dmz-backup*.zip
|
||||
*.conf
|
||||
|
|
|
@ -1,62 +0,0 @@
|
|||
{
|
||||
"css": {
|
||||
"indent_size": 4,
|
||||
"indent_level": 0,
|
||||
"indent_with_tabs": true,
|
||||
"preserve_newlines": true,
|
||||
"max_preserve_newlines": 2,
|
||||
"newline_between_rules": true,
|
||||
"selector_separator_newlines": true
|
||||
},
|
||||
"scss": {
|
||||
"indent_size": 4,
|
||||
"indent_level": 0,
|
||||
"indent_with_tabs": true,
|
||||
"preserve_newlines": true,
|
||||
"max_preserve_newlines": 2,
|
||||
"newline_between_rules": true,
|
||||
"selector_separator_newlines": true
|
||||
},
|
||||
"html": {
|
||||
"indent_size": 4,
|
||||
"indent_level": 0,
|
||||
"indent_with_tabs": true,
|
||||
"preserve_newlines": true,
|
||||
"max_preserve_newlines": 2,
|
||||
"wrap_line_length": 0,
|
||||
"indent_handlebars": true,
|
||||
"indent_inner_html": false,
|
||||
"indent_scripts": "keep"
|
||||
},
|
||||
"hbs": {
|
||||
"indent_size": 4,
|
||||
"indent_level": 0,
|
||||
"indent_with_tabs": true,
|
||||
"max_preserve_newlines": 2,
|
||||
"preserve_newlines": true,
|
||||
"wrap_line_length": 0
|
||||
},
|
||||
"js": {
|
||||
"indent_size": 4,
|
||||
"indent_level": 0,
|
||||
"indent_with_tabs": true,
|
||||
"preserve_newlines": true,
|
||||
"wrap_line_length": 0,
|
||||
"break_chained_methods": false,
|
||||
"max_preserve_newlines": 2,
|
||||
"jslint_happy": true,
|
||||
"brace_style": "collapse-preserve-inline",
|
||||
"keep_function_indentation": false,
|
||||
"space_after_anon_function": false,
|
||||
"space_before_anon_function": false,
|
||||
"space_before_conditional": true,
|
||||
"space_in_empty_paren": false,
|
||||
"space_before_func_paren": false,
|
||||
"space_in_paren": false
|
||||
},
|
||||
"sql": {
|
||||
"indent_size": 4,
|
||||
"indent_level": 0,
|
||||
"indent_with_tabs": true
|
||||
}
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
app/public/tinymce/**
|
||||
app/public/tinymce/
|
||||
app/public/tinymce
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
Please see this document for contribution guidelines and process:
|
||||
|
||||
https://developers.documize.com/s/leFaXwlU/open-source/d/VzO94aMOCgABGyfe/contributing
|
||||
https://docs.documize.com/s/leFaXwlU/open-source/d/VzO94aMOCgABGyfe/contributing
|
||||
|
|
32
Dockerfile
Normal file
32
Dockerfile
Normal file
|
@ -0,0 +1,32 @@
|
|||
FROM node:16-alpine as frontbuilder
|
||||
WORKDIR /go/src/github.com/documize/community/gui
|
||||
COPY ./gui /go/src/github.com/documize/community/gui
|
||||
RUN npm --network-timeout=100000 install
|
||||
RUN npm run build -- --environment=production --output-path dist-prod --suppress-sizes true
|
||||
|
||||
FROM golang:1.21-alpine as builder
|
||||
WORKDIR /go/src/github.com/documize/community
|
||||
COPY . /go/src/github.com/documize/community
|
||||
COPY --from=frontbuilder /go/src/github.com/documize/community/gui/dist-prod/assets /go/src/github.com/documize/community/edition/static/public/assets
|
||||
COPY --from=frontbuilder /go/src/github.com/documize/community/gui/dist-prod/codemirror /go/src/github.com/documize/community/edition/static/public/codemirror
|
||||
COPY --from=frontbuilder /go/src/github.com/documize/community/gui/dist-prod/prism /go/src/github.com/documize/community/edition/static/public/prism
|
||||
COPY --from=frontbuilder /go/src/github.com/documize/community/gui/dist-prod/sections /go/src/github.com/documize/community/edition/static/public/sections
|
||||
COPY --from=frontbuilder /go/src/github.com/documize/community/gui/dist-prod/tinymce /go/src/github.com/documize/community/edition/static/public/tinymce
|
||||
COPY --from=frontbuilder /go/src/github.com/documize/community/gui/dist-prod/pdfjs /go/src/github.com/documize/community/edition/static/public/pdfjs
|
||||
COPY --from=frontbuilder /go/src/github.com/documize/community/gui/dist-prod/i18n /go/src/github.com/documize/community/edition/static/public/i18n
|
||||
COPY --from=frontbuilder /go/src/github.com/documize/community/gui/dist-prod/*.* /go/src/github.com/documize/community/edition/static/
|
||||
COPY --from=frontbuilder /go/src/github.com/documize/community/gui/dist-prod/i18n/*.json /go/src/github.com/documize/community/edition/static/i18n/
|
||||
COPY domain/mail/*.html /go/src/github.com/documize/community/edition/static/mail/
|
||||
COPY core/database/templates/*.html /go/src/github.com/documize/community/edition/static/
|
||||
COPY core/database/scripts/mysql/*.sql /go/src/github.com/documize/community/edition/static/scripts/mysql/
|
||||
COPY core/database/scripts/postgresql/*.sql /go/src/github.com/documize/community/edition/static/scripts/postgresql/
|
||||
COPY core/database/scripts/sqlserver/*.sql /go/src/github.com/documize/community/edition/static/scripts/sqlserver/
|
||||
COPY domain/onboard/*.json /go/src/github.com/documize/community/edition/static/onboard/
|
||||
RUN env GODEBUG=tls13=1 go build -mod=vendor -o bin/documize-community ./edition/community.go
|
||||
|
||||
# build release image
|
||||
FROM alpine:3.16
|
||||
RUN apk add --no-cache ca-certificates
|
||||
COPY --from=builder /go/src/github.com/documize/community/bin/documize-community /documize
|
||||
EXPOSE 5001
|
||||
ENTRYPOINT [ "/documize" ]
|
2572
NOTICES.md
Normal file
2572
NOTICES.md
Normal file
File diff suppressed because it is too large
Load diff
109
README.md
109
README.md
|
@ -1,53 +1,110 @@
|
|||
# Documize Community Edition
|
||||
Documize Community is an open source, modern, self-hosted, enterprise-grade knowledge management solution.
|
||||
|
||||
Documize is an Integrated Document Environment (IDE) unifying documents, wiki, reporting and dashboards -- one tool to power the enterprise-wide knowledge backbone.
|
||||
- Built for technical and non-technical users
|
||||
- Designed to unify both customer-facing and internal documentation
|
||||
- Organization through labels, spaces and categories
|
||||
|
||||

|
||||
It's built with Golang + EmberJS and compiled down to a single executable binary that is available for Linux, Windows and Mac.
|
||||
|
||||
The mission is to bring software dev inspired features (refactoring, testing, linting, metrics, PRs) to those poor souls stuck writing docs in the dark ages.
|
||||
All you need to provide is your database -- PostgreSQL, Microsoft SQL Server or any MySQL variant.
|
||||
|
||||
## Latest version
|
||||

|
||||
|
||||
v1.46.0
|
||||
## Latest Release
|
||||
|
||||
[Community edition: v5.13.0](https://github.com/documize/community/releases)
|
||||
|
||||
[Community+ edition: v5.13.0](https://www.documize.com/community/get-started)
|
||||
|
||||
The Community+ edition is the "enterprise" offering with advanced capabilities and customer support:
|
||||
|
||||
- content approval workflows
|
||||
- content organization by label, space and category
|
||||
- content version management
|
||||
- content lifecycle management
|
||||
- content feedback capture
|
||||
- content PDF export
|
||||
- analytics and reporting
|
||||
- activity streams
|
||||
- audit logs
|
||||
- actions assignments
|
||||
- product support
|
||||
|
||||
The Community+ edition is [free](https://www.documize.com/community/get-started) for the first five users -- thereafter pricing starts at just $900 annually for 100 users.
|
||||
|
||||
## OS Support
|
||||
|
||||
- Windows
|
||||
- Linux
|
||||
- Windows
|
||||
- macOS
|
||||
- Raspberry Pi (ARM build)
|
||||
|
||||
## Tech stack
|
||||
Support for AMD and ARM 64 bit architectures.
|
||||
|
||||
- EmberJS (v2.12.0)
|
||||
- Go (v1.8)
|
||||
- MySQL (v5.7.10+) or Percona (v5.7.16-10+)
|
||||
## Database Support
|
||||
|
||||
## Documentation
|
||||
For all database types, Full-Text Search (FTS) support is mandatory.
|
||||
|
||||
<https://docs.documize.com>
|
||||
- PostgreSQL (v9.6+)
|
||||
- Microsoft SQL Server (2016+ with FTS)
|
||||
- Microsoft SQL Azure (v12+)
|
||||
- MySQL (v5.7.10+ and v8.0.12+)
|
||||
- Percona (v5.7.16-10+)
|
||||
- MariaDB (10.3.0+)
|
||||
|
||||
## Keycloak Integration
|
||||
## Browser Support
|
||||
|
||||
Documize provides out-of-the-box integration with [Redhat Keycloak](http://www.keycloak.org) for open source identity and access management.
|
||||
- Firefox
|
||||
- Chrome
|
||||
- Safari
|
||||
- Microsoft Edge
|
||||
- Brave
|
||||
- Vivaldi
|
||||
- Opera
|
||||
|
||||
Connect and authenticate with LDAP, Active Directory and more.
|
||||
## Technology Stack
|
||||
|
||||
<https://docs.documize.com>
|
||||
- Go (v1.23.4)
|
||||
- Ember JS (v3.12.0)
|
||||
|
||||
## Auth0 Compatible
|
||||
## Authentication Options
|
||||
|
||||
Documize is compatible with Auth0 identity as a service.
|
||||
Besides email/password login, you can also authenticate via:
|
||||
|
||||
[](https://auth0.com/?utm_source=oss&utm_medium=gp&utm_campaign=oss)
|
||||
* LDAP
|
||||
* Active Directory
|
||||
* Red Hat Keycloak
|
||||
* Central Authentication Service (CAS)
|
||||
|
||||
Open Source Identity and Access Management
|
||||
When using LDAP/Active Directory, you can enable dual-authentication with email/password.
|
||||
|
||||
## Word Conversion to HTML
|
||||
## Localization
|
||||
|
||||
- [Code for `wordconvert` utility](https://github.com/documize/community/tree/master/cmd/wordconvert)
|
||||
Languages supported out-of-the-box:
|
||||
|
||||
## Legal
|
||||
- English
|
||||
- German
|
||||
- French
|
||||
- Chinese (中文)
|
||||
- Portuguese (Brazil) (Português - Brasil)
|
||||
- Japanese (日本語)
|
||||
- Italian
|
||||
- Spanish Argentinian
|
||||
|
||||
<https://documize.com>
|
||||
PR's welcome for additional languages.
|
||||
|
||||
This software (Documize Community Edition) is licensed under GNU AGPL v3 <http://www.gnu.org/licenses/agpl-3.0.en.html>. You can operate outside the AGPL restrictions by purchasing Documize Enterprise Edition and obtaining a commercial license by contacting <sales@documize.com>. Documize® is a registered trade mark of Documize Inc.
|
||||
## Product/Technical Support
|
||||
|
||||
For both Community and Community+ editions, please contact our help desk for product help, suggestions and other enquiries.
|
||||
|
||||
<support@documize.com>
|
||||
|
||||
We aim to respond within two working days.
|
||||
|
||||
## The Legal Bit
|
||||
|
||||
<https://www.documize.com>
|
||||
|
||||
This software (Documize Community edition) is licensed under GNU AGPL v3 <http://www.gnu.org/licenses/agpl-3.0.en.html>.
|
||||
|
||||
Documize Community uses other open source components and we acknowledge them in [NOTICES](NOTICES.md)
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"directory": "bower_components",
|
||||
"analytics": false
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
# EditorConfig helps developers define and maintain consistent
|
||||
# coding styles between different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
|
||||
[*.hbs]
|
||||
insert_final_newline = false
|
||||
|
||||
[*.{diff,md}]
|
||||
trim_trailing_whitespace = false
|
|
@ -1,6 +0,0 @@
|
|||
public/tinymce/**
|
||||
public/tinymce/
|
||||
public/tinymce
|
||||
public/codemirror/**
|
||||
public/codemirror/
|
||||
public/codemirror
|
|
@ -1,37 +0,0 @@
|
|||
module.exports = {
|
||||
root: true,
|
||||
parserOptions: {
|
||||
ecmaVersion: 6,
|
||||
sourceType: 'module'
|
||||
},
|
||||
extends: 'eslint:recommended',
|
||||
env: {
|
||||
browser: true,
|
||||
jquery: true,
|
||||
qunit: true,
|
||||
embertest: true
|
||||
},
|
||||
rules: {
|
||||
},
|
||||
globals: {
|
||||
"$": true,
|
||||
"is": true,
|
||||
"_": true,
|
||||
"tinymce": true,
|
||||
"CodeMirror": true,
|
||||
"Drop": true,
|
||||
"Mousetrap": true,
|
||||
"Sortable": true,
|
||||
"moment": true,
|
||||
"Dropzone": true,
|
||||
"Tooltip": true,
|
||||
"server": true,
|
||||
"authenticateUser": true,
|
||||
"stubAudit": true,
|
||||
"stubUserNotification": true,
|
||||
"userLogin": true,
|
||||
"Keycloak": true,
|
||||
"Intercom": true,
|
||||
"slug": true
|
||||
}
|
||||
};
|
18
app/.gitignore
vendored
18
app/.gitignore
vendored
|
@ -1,18 +0,0 @@
|
|||
# See https://help.github.com/ignore-files/ for more about ignoring files.
|
||||
|
||||
# compiled output
|
||||
/dist
|
||||
/dist-prod
|
||||
/tmp
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/bower_components
|
||||
|
||||
# misc
|
||||
/.sass-cache
|
||||
/connect.lock
|
||||
/coverage/*
|
||||
/libpeerconnection.log
|
||||
npm-debug.log*
|
||||
testem.log
|
|
@ -1,24 +0,0 @@
|
|||
---
|
||||
language: node_js
|
||||
node_js:
|
||||
- "6"
|
||||
|
||||
sudo: false
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.npm
|
||||
- $HOME/.cache # includes bowers cache
|
||||
|
||||
before_install:
|
||||
- npm config set spin false
|
||||
- npm install -g bower phantomjs-prebuilt
|
||||
- bower --version
|
||||
- phantomjs --version
|
||||
|
||||
install:
|
||||
- npm install
|
||||
- bower install
|
||||
|
||||
script:
|
||||
- npm test
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"ignore_dirs": ["tmp", "dist", "dist-prod"]
|
||||
}
|
|
@ -1,53 +0,0 @@
|
|||
# Documize
|
||||
|
||||
This README outlines the details of collaborating on this Ember application.
|
||||
A short introduction of this app could easily go here.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
You will need the following things properly installed on your computer.
|
||||
|
||||
* [Git](http://git-scm.com/)
|
||||
* [Node.js](http://nodejs.org/) (with NPM)
|
||||
* [Bower](http://bower.io/)
|
||||
* [Ember CLI](http://ember-cli.com/)
|
||||
* [PhantomJS](http://phantomjs.org/)
|
||||
|
||||
## Installation
|
||||
|
||||
* `git clone <repository-url>` this repository
|
||||
* `cd documize`
|
||||
* `npm install`
|
||||
* `bower install`
|
||||
|
||||
## Running / Development
|
||||
|
||||
* `ember serve`
|
||||
* Visit your app at [http://localhost:4200](http://localhost:4200).
|
||||
|
||||
### Code Generators
|
||||
|
||||
Make use of the many generators for code, try `ember help generate` for more details
|
||||
|
||||
### Running Tests
|
||||
|
||||
* `ember test`
|
||||
* `ember test --server`
|
||||
|
||||
### Building
|
||||
|
||||
* `ember build` (development)
|
||||
* `ember build --environment production` (production)
|
||||
|
||||
### Deploying
|
||||
|
||||
Specify what it takes to deploy your app.
|
||||
|
||||
## Further Reading / Useful Links
|
||||
|
||||
* [ember.js](http://emberjs.com/)
|
||||
* [ember-cli](http://ember-cli.com/)
|
||||
* Development Browser Extensions
|
||||
* [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi)
|
||||
* [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/)
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import Base from 'ember-simple-auth/authenticators/base';
|
||||
|
||||
const {
|
||||
RSVP: { resolve }
|
||||
} = Ember;
|
||||
|
||||
export default Base.extend({
|
||||
restore(data) {
|
||||
return resolve(data);
|
||||
},
|
||||
authenticate(data) {
|
||||
return resolve(data);
|
||||
}
|
||||
});
|
|
@ -1,54 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import Base from 'ember-simple-auth/authenticators/base';
|
||||
import netUtil from '../utils/net';
|
||||
|
||||
const {
|
||||
isPresent,
|
||||
RSVP: { resolve, reject },
|
||||
inject: { service }
|
||||
} = Ember;
|
||||
|
||||
export default Base.extend({
|
||||
ajax: service(),
|
||||
appMeta: service(),
|
||||
kcAuth: service(),
|
||||
localStorage: service(),
|
||||
|
||||
restore(data) {
|
||||
// TODO: verify authentication data
|
||||
if (data) {
|
||||
return resolve(data);
|
||||
}
|
||||
|
||||
return reject();
|
||||
},
|
||||
|
||||
authenticate(data) {
|
||||
data.domain = netUtil.getSubdomain();
|
||||
|
||||
if (!isPresent(data.token) || !isPresent(data.email)) {
|
||||
return Ember.RSVP.reject("invalid");
|
||||
}
|
||||
|
||||
return this.get('ajax').post('public/authenticate/keycloak', {
|
||||
data: JSON.stringify(data),
|
||||
contentType: 'json'
|
||||
});
|
||||
},
|
||||
|
||||
invalidate() {
|
||||
this.get('localStorage').clearAll();
|
||||
return this.get('kcAuth').logout();
|
||||
}
|
||||
});
|
|
@ -1,15 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
});
|
|
@ -1,156 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import constants from '../../utils/constants';
|
||||
import encoding from '../../utils/encoding';
|
||||
import NotifierMixin from "../../mixins/notifier";
|
||||
|
||||
const {
|
||||
computed
|
||||
} = Ember;
|
||||
|
||||
export default Ember.Component.extend(NotifierMixin, {
|
||||
appMeta: Ember.inject.service(),
|
||||
isDocumizeProvider: computed.equal('authProvider', constants.AuthProvider.Documize),
|
||||
isKeycloakProvider: computed.equal('authProvider', constants.AuthProvider.Keycloak),
|
||||
KeycloakUrlError: computed.empty('keycloakConfig.url'),
|
||||
KeycloakRealmError: computed.empty('keycloakConfig.realm'),
|
||||
KeycloakClientIdError: computed.empty('keycloakConfig.clientId'),
|
||||
KeycloakPublicKeyError: computed.empty('keycloakConfig.publicKey'),
|
||||
KeycloakAdminUserError: computed.empty('keycloakConfig.adminUser'),
|
||||
KeycloakAdminPasswordError: computed.empty('keycloakConfig.adminPassword'),
|
||||
keycloakConfig: {
|
||||
url: '',
|
||||
realm: '',
|
||||
clientId: '',
|
||||
publicKey: '',
|
||||
adminUser: '',
|
||||
adminPassword: '',
|
||||
group: '',
|
||||
disableLogout: false,
|
||||
defaultPermissionAddSpace: false
|
||||
},
|
||||
|
||||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
|
||||
let provider = this.get('authProvider');
|
||||
|
||||
switch (provider) {
|
||||
case constants.AuthProvider.Documize:
|
||||
// nothing to do
|
||||
break;
|
||||
case constants.AuthProvider.Keycloak: // eslint-disable-line no-case-declarations
|
||||
let config = this.get('authConfig');
|
||||
|
||||
if (is.undefined(config) || is.null(config) || is.empty(config) ) {
|
||||
config = {};
|
||||
} else {
|
||||
config = JSON.parse(config);
|
||||
config.publicKey = encoding.Base64.decode(config.publicKey);
|
||||
config.defaultPermissionAddSpace = config.hasOwnProperty('defaultPermissionAddSpace') ? config.defaultPermissionAddSpace : false;
|
||||
config.disableLogout = config.hasOwnProperty('disableLogout') ? config.disableLogout : true;
|
||||
}
|
||||
|
||||
this.set('keycloakConfig', config);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
actions: {
|
||||
onDocumize() {
|
||||
this.set('authProvider', constants.AuthProvider.Documize);
|
||||
},
|
||||
|
||||
onKeycloak() {
|
||||
this.set('authProvider', constants.AuthProvider.Keycloak);
|
||||
},
|
||||
|
||||
onSave() {
|
||||
let provider = this.get('authProvider');
|
||||
let config = this.get('authConfig');
|
||||
|
||||
switch (provider) {
|
||||
case constants.AuthProvider.Documize:
|
||||
config = {};
|
||||
break;
|
||||
case constants.AuthProvider.Keycloak:
|
||||
if (this.get('KeycloakUrlError')) {
|
||||
this.$("#keycloak-url").focus();
|
||||
return;
|
||||
}
|
||||
if (this.get('KeycloakRealmError')) {
|
||||
this.$("#keycloak-realm").focus();
|
||||
return;
|
||||
}
|
||||
if (this.get('KeycloakClientIdError')) {
|
||||
this.$("#keycloak-clientId").focus();
|
||||
return;
|
||||
}
|
||||
if (this.get('KeycloakPublicKeyError')) {
|
||||
this.$("#keycloak-publicKey").focus();
|
||||
return;
|
||||
}
|
||||
if (this.get('KeycloakAdminUserError')) {
|
||||
this.$("#keycloak-admin-user").focus();
|
||||
return;
|
||||
}
|
||||
if (this.get('KeycloakAdminPasswordError')) {
|
||||
this.$("#keycloak-admin-password").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
config = Ember.copy(this.get('keycloakConfig'));
|
||||
config.url = config.url.trim();
|
||||
config.realm = config.realm.trim();
|
||||
config.clientId = config.clientId.trim();
|
||||
config.publicKey = config.publicKey.trim();
|
||||
config.group = is.undefined(config.group) ? '' : config.group.trim();
|
||||
config.adminUser = config.adminUser.trim();
|
||||
config.adminPassword = config.adminPassword.trim();
|
||||
config.defaultPermissionAddSpace = config.hasOwnProperty('defaultPermissionAddSpace') ? config.defaultPermissionAddSpace : true;
|
||||
config.disableLogout = config.hasOwnProperty('disableLogout') ? config.disableLogout : true;
|
||||
|
||||
if (is.endWith(config.url, '/')) {
|
||||
config.url = config.url.substring(0, config.url.length-1);
|
||||
}
|
||||
|
||||
Ember.set(config, 'publicKey', encoding.Base64.encode(this.get('keycloakConfig.publicKey')));
|
||||
break;
|
||||
}
|
||||
|
||||
let data = { authProvider: provider, authConfig: JSON.stringify(config) };
|
||||
|
||||
this.get('onSave')(data).then(() => {
|
||||
if (data.authProvider === constants.AuthProvider.Keycloak) {
|
||||
this.get('onSync')().then((response) => {
|
||||
if (response.isError) {
|
||||
this.showNotification(response.message);
|
||||
data.authProvider = constants.AuthProvider.Documize;
|
||||
this.get('onSave')(data).then(() => {
|
||||
this.showNotification('Reverted back to Documize');
|
||||
});
|
||||
} else {
|
||||
if (data.authProvider === this.get('appMeta.authProvider')) {
|
||||
this.showNotification(response.message);
|
||||
} else {
|
||||
this.get('onChange')(data);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.showNotification('Saved');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,45 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
const {
|
||||
isEmpty,
|
||||
computed,
|
||||
set
|
||||
} = Ember;
|
||||
|
||||
export default Ember.Component.extend({
|
||||
titleEmpty: computed.empty('model.general.title'),
|
||||
messageEmpty: computed.empty('model.general.message'),
|
||||
hasTitleInputError: computed.and('titleEmpty', 'titleError'),
|
||||
hasMessageInputError: computed.and('messageEmpty', 'messageError'),
|
||||
|
||||
actions: {
|
||||
save() {
|
||||
if (isEmpty(this.get('model.general.title'))) {
|
||||
set(this, 'titleError', true);
|
||||
return $("#siteTitle").focus();
|
||||
}
|
||||
|
||||
if (isEmpty(this.get('model.general.message'))) {
|
||||
set(this, 'messageError', true);
|
||||
return $("#siteMessage").focus();
|
||||
}
|
||||
|
||||
this.model.general.set('allowAnonymousAccess', Ember.$("#allowAnonymousAccess").prop('checked'));
|
||||
this.get('save')().then(() => {
|
||||
set(this, 'titleError', false);
|
||||
set(this, 'messageError', false);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,57 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
const {
|
||||
computed
|
||||
} = Ember;
|
||||
|
||||
export default Ember.Component.extend({
|
||||
SMTPHostEmptyError: computed.empty('model.smtp.host'),
|
||||
SMTPPortEmptyError: computed.empty('model.smtp.port'),
|
||||
SMTPSenderEmptyError: computed.empty('model.smtp.sender'),
|
||||
SMTPUserIdEmptyError: computed.empty('model.smtp.userid'),
|
||||
SMTPPasswordEmptyError: computed.empty('model.smtp.password'),
|
||||
|
||||
actions: {
|
||||
saveSMTP() {
|
||||
if (this.get('SMTPHostEmptyError')) {
|
||||
$("#smtp-host").focus();
|
||||
return;
|
||||
}
|
||||
if (this.get('SMTPPortEmptyError')) {
|
||||
$("#smtp-port").focus();
|
||||
return;
|
||||
}
|
||||
if (this.get('SMTPSenderEmptyError')) {
|
||||
$("#smtp-sender").focus();
|
||||
return;
|
||||
}
|
||||
if (this.get('SMTPUserIdEmptyError')) {
|
||||
$("#smtp-userid").focus();
|
||||
return;
|
||||
}
|
||||
if (this.get('SMTPPasswordEmptyError')) {
|
||||
$("#smtp-password").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
this.get('saveSMTP')().then(() => {
|
||||
});
|
||||
},
|
||||
|
||||
saveLicense() {
|
||||
this.get('saveLicense')().then(() => {
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,202 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import AuthProvider from '../../mixins/auth';
|
||||
|
||||
export default Ember.Component.extend(AuthProvider, {
|
||||
editUser: null,
|
||||
deleteUser: null,
|
||||
drop: null,
|
||||
password: {},
|
||||
filter: '',
|
||||
filteredUsers: [],
|
||||
selectedUsers: [],
|
||||
hasSelectedUsers: false,
|
||||
|
||||
didReceiveAttrs() {
|
||||
this.users.forEach(user => {
|
||||
user.set('me', user.get('id') === this.get('session.session.authenticated.user.id'));
|
||||
user.set('selected', false);
|
||||
});
|
||||
|
||||
this.set('filteredUsers', this.users);
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
let drop = this.get('drop');
|
||||
|
||||
if (is.not.null(drop)) {
|
||||
drop.destroy();
|
||||
}
|
||||
},
|
||||
|
||||
onKeywordChange: function () {
|
||||
Ember.run.debounce(this, this.filterUsers, 350);
|
||||
}.observes('filter'),
|
||||
|
||||
filterUsers() {
|
||||
let users = this.get('users');
|
||||
let filteredUsers = [];
|
||||
let filter = this.get('filter').toLowerCase();
|
||||
|
||||
users.forEach(user => {
|
||||
if (user.get('fullname').toLowerCase().includes(filter) || user.get('email').toLowerCase().includes(filter)) {
|
||||
filteredUsers.pushObject(user);
|
||||
}
|
||||
});
|
||||
|
||||
this.set('filteredUsers', filteredUsers);
|
||||
},
|
||||
|
||||
actions: {
|
||||
toggleSelect(user) {
|
||||
user.set('selected', !user.get('selected'));
|
||||
|
||||
let su = this.get('selectedUsers');
|
||||
if (user.get('selected')) {
|
||||
su.push(user.get('id'));
|
||||
} else {
|
||||
su = _.reject(su, function(id){ return id === user.get('id') });
|
||||
}
|
||||
|
||||
this.set('selectedUsers', su);
|
||||
this.set('hasSelectedUsers', su.length > 0);
|
||||
},
|
||||
|
||||
toggleActive(id) {
|
||||
let user = this.users.findBy("id", id);
|
||||
user.set('active', !user.get('active'));
|
||||
this.attrs.onSave(user);
|
||||
},
|
||||
|
||||
toggleEditor(id) {
|
||||
let user = this.users.findBy("id", id);
|
||||
user.set('editor', !user.get('editor'));
|
||||
this.attrs.onSave(user);
|
||||
},
|
||||
|
||||
toggleAdmin(id) {
|
||||
let user = this.users.findBy("id", id);
|
||||
user.set('admin', !user.get('admin'));
|
||||
this.attrs.onSave(user);
|
||||
},
|
||||
|
||||
edit(id) {
|
||||
let self = this;
|
||||
|
||||
let user = this.users.findBy("id", id);
|
||||
let userCopy = user.getProperties('id', 'created', 'revised', 'firstname', 'lastname', 'email', 'initials', 'active', 'editor', 'admin', 'accounts');
|
||||
this.set('editUser', userCopy);
|
||||
this.set('password', {
|
||||
password: "",
|
||||
confirmation: ""
|
||||
});
|
||||
$(".edit-user-dialog").css("display", "block");
|
||||
$("input").removeClass("error");
|
||||
|
||||
let drop = new Drop({
|
||||
target: $(".edit-button-" + id)[0],
|
||||
content: $(".edit-user-dialog")[0],
|
||||
classes: 'drop-theme-basic',
|
||||
position: "bottom right",
|
||||
openOn: "always",
|
||||
tetherOptions: {
|
||||
offset: "5px 0",
|
||||
targetOffset: "10px 0"
|
||||
},
|
||||
remove: false
|
||||
});
|
||||
|
||||
self.set('drop', drop);
|
||||
|
||||
drop.on('open', function () {
|
||||
self.$("#edit-firstname").focus();
|
||||
});
|
||||
},
|
||||
|
||||
confirmDelete(id) {
|
||||
let user = this.users.findBy("id", id);
|
||||
this.set('deleteUser', user);
|
||||
$(".delete-user-dialog").css("display", "block");
|
||||
|
||||
let drop = new Drop({
|
||||
target: $(".delete-button-" + id)[0],
|
||||
content: $(".delete-user-dialog")[0],
|
||||
classes: 'drop-theme-basic',
|
||||
position: "bottom right",
|
||||
openOn: "always",
|
||||
tetherOptions: {
|
||||
offset: "5px 0",
|
||||
targetOffset: "10px 0"
|
||||
},
|
||||
remove: false
|
||||
});
|
||||
|
||||
this.set('drop', drop);
|
||||
},
|
||||
|
||||
cancel() {
|
||||
let drop = this.get('drop');
|
||||
drop.close();
|
||||
},
|
||||
|
||||
save() {
|
||||
let user = this.get('editUser');
|
||||
let password = this.get('password');
|
||||
|
||||
if (is.empty(user.firstname)) {
|
||||
$("#edit-firstname").addClass("error").focus();
|
||||
return;
|
||||
}
|
||||
if (is.empty(user.lastname)) {
|
||||
$("#edit-lastname").addClass("error").focus();
|
||||
return;
|
||||
}
|
||||
if (is.empty(user.email)) {
|
||||
$("#edit-email").addClass("error").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
let drop = this.get('drop');
|
||||
drop.close();
|
||||
|
||||
this.attrs.onSave(user);
|
||||
|
||||
if (is.not.empty(password.password) && is.not.empty(password.confirmation) &&
|
||||
password.password === password.confirmation) {
|
||||
this.attrs.onPassword(user, password.password);
|
||||
}
|
||||
},
|
||||
|
||||
delete() {
|
||||
let drop = this.get('drop');
|
||||
drop.close();
|
||||
|
||||
this.set('selectedUsers', []);
|
||||
this.set('hasSelectedUsers', false);
|
||||
this.attrs.onDelete(this.get('deleteUser.id'));
|
||||
},
|
||||
|
||||
onBulkDelete() {
|
||||
let su = this.get('selectedUsers');
|
||||
|
||||
su.forEach(userId => {
|
||||
this.attrs.onDelete(userId);
|
||||
});
|
||||
|
||||
this.set('selectedUsers', []);
|
||||
this.set('hasSelectedUsers', false);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,57 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import AuthProvider from '../../mixins/auth';
|
||||
|
||||
const {
|
||||
isEmpty,
|
||||
computed,
|
||||
set,
|
||||
get
|
||||
} = Ember;
|
||||
|
||||
export default Ember.Component.extend(AuthProvider, {
|
||||
newUser: { firstname: "", lastname: "", email: "", active: true },
|
||||
firstnameEmpty: computed.empty('newUser.firstname'),
|
||||
lastnameEmpty: computed.empty('newUser.lastname'),
|
||||
emailEmpty: computed.empty('newUser.email'),
|
||||
hasFirstnameEmptyError: computed.and('firstnameEmpty', 'firstnameError'),
|
||||
hasLastnameEmptyError: computed.and('lastnameEmpty', 'lastnameError'),
|
||||
hasEmailEmptyError: computed.and('emailEmpty', 'emailError'),
|
||||
|
||||
actions: {
|
||||
add() {
|
||||
if (isEmpty(this.get('newUser.firstname'))) {
|
||||
set(this, 'firstnameError', true);
|
||||
return $("#newUserFirstname").focus();
|
||||
}
|
||||
if (isEmpty(this.get('newUser.lastname'))) {
|
||||
set(this, 'lastnameError', true);
|
||||
return $("#newUserLastname").focus();
|
||||
}
|
||||
if (isEmpty(this.get('newUser.email')) || is.not.email(this.get('newUser.email'))) {
|
||||
set(this, 'emailError', true);
|
||||
return $("#newUserEmail").focus();
|
||||
}
|
||||
|
||||
let user = get(this, 'newUser');
|
||||
|
||||
get(this, 'add')(user).then(() => {
|
||||
this.set('newUser', { firstname: "", lastname: "", email: "", active: true });
|
||||
set(this, 'firstnameError', false);
|
||||
set(this, 'lastnameError', false);
|
||||
set(this, 'emailError', false);
|
||||
$("#newUserFirstname").focus();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,137 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import TooltipMixin from '../../mixins/tooltip';
|
||||
|
||||
const {
|
||||
inject: { service }
|
||||
} = Ember;
|
||||
|
||||
export default Ember.Component.extend(TooltipMixin, {
|
||||
link: service(),
|
||||
linkName: '',
|
||||
keywords: '',
|
||||
selection: null,
|
||||
matches: {
|
||||
documents: [],
|
||||
pages: [],
|
||||
attachments: []
|
||||
},
|
||||
tabs: [
|
||||
{ label: 'Section', selected: true },
|
||||
{ label: 'Attachment', selected: false },
|
||||
{ label: 'Search', selected: false }
|
||||
],
|
||||
contentLinkerButtonId: Ember.computed('page', function () {
|
||||
let page = this.get('page');
|
||||
return `content-linker-button-${page.id}`;
|
||||
}),
|
||||
|
||||
showSections: Ember.computed('tabs.@each.selected', function () {
|
||||
return this.get('tabs').findBy('label', 'Section').selected;
|
||||
}),
|
||||
showAttachments: Ember.computed('tabs.@each.selected', function () {
|
||||
return this.get('tabs').findBy('label', 'Attachment').selected;
|
||||
}),
|
||||
showSearch: Ember.computed('tabs.@each.selected', function () {
|
||||
return this.get('tabs').findBy('label', 'Search').selected;
|
||||
}),
|
||||
hasMatches: Ember.computed('matches', function () {
|
||||
let m = this.get('matches');
|
||||
return m.documents.length || m.pages.length || m.attachments.length;
|
||||
}),
|
||||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
let self = this;
|
||||
|
||||
let folderId = this.get('folder.id');
|
||||
let documentId = this.get('document.id');
|
||||
let pageId = this.get('page.id');
|
||||
|
||||
this.get('link').getCandidates(folderId, documentId, pageId).then(function (candidates) {
|
||||
self.set('candidates', candidates);
|
||||
self.set('hasSections', is.not.null(candidates.pages) && candidates.pages.length);
|
||||
self.set('hasAttachments', is.not.null(candidates.attachments) && candidates.attachments.length);
|
||||
});
|
||||
},
|
||||
|
||||
didRender() {
|
||||
this.addTooltip(document.getElementById("content-linker-button"));
|
||||
this.addTooltip(document.getElementById("content-counter-button"));
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
this.destroyTooltips();
|
||||
},
|
||||
|
||||
onKeywordChange: function () {
|
||||
Ember.run.debounce(this, this.fetch, 750);
|
||||
}.observes('keywords'),
|
||||
|
||||
fetch() {
|
||||
let keywords = this.get('keywords');
|
||||
let self = this;
|
||||
|
||||
if (_.isEmpty(keywords)) {
|
||||
this.set('matches', { documents: [], pages: [], attachments: [] });
|
||||
return;
|
||||
}
|
||||
|
||||
this.get('link').searchCandidates(keywords).then(function (matches) {
|
||||
self.set('matches', matches);
|
||||
});
|
||||
},
|
||||
|
||||
actions: {
|
||||
setSelection(i) {
|
||||
let candidates = this.get('candidates');
|
||||
let matches = this.get('matches');
|
||||
|
||||
this.set('selection', i);
|
||||
|
||||
candidates.pages.forEach(c => {
|
||||
Ember.set(c, 'selected', c.id === i.id);
|
||||
});
|
||||
|
||||
candidates.attachments.forEach(c => {
|
||||
Ember.set(c, 'selected', c.id === i.id);
|
||||
});
|
||||
|
||||
matches.documents.forEach(c => {
|
||||
Ember.set(c, 'selected', c.id === i.id);
|
||||
});
|
||||
|
||||
matches.pages.forEach(c => {
|
||||
Ember.set(c, 'selected', c.id === i.id);
|
||||
});
|
||||
|
||||
matches.attachments.forEach(c => {
|
||||
Ember.set(c, 'selected', c.id === i.id);
|
||||
});
|
||||
},
|
||||
|
||||
onInsertLink() {
|
||||
let selection = this.get('selection');
|
||||
|
||||
if (is.null(selection)) {
|
||||
return;
|
||||
}
|
||||
|
||||
return this.get('onInsertLink')(selection);
|
||||
},
|
||||
|
||||
onTabSelect(tabs) {
|
||||
this.set('tabs', tabs);
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,66 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import NotifierMixin from '../../mixins/notifier';
|
||||
import TooltipMixin from '../../mixins/tooltip';
|
||||
|
||||
const {
|
||||
computed,
|
||||
} = Ember;
|
||||
|
||||
export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||
documentService: Ember.inject.service('document'),
|
||||
editMode: false,
|
||||
docName: '',
|
||||
docExcerpt: '',
|
||||
hasNameError: computed.empty('docName'),
|
||||
hasExcerptError: computed.empty('docExcerpt'),
|
||||
|
||||
keyUp(e) {
|
||||
if (e.keyCode === 27) { // escape key
|
||||
this.send('onCancel');
|
||||
}
|
||||
},
|
||||
|
||||
actions: {
|
||||
toggleEdit() {
|
||||
this.set('docName', this.get('document.name'));
|
||||
this.set('docExcerpt', this.get('document.excerpt'));
|
||||
this.set('editMode', true);
|
||||
|
||||
Ember.run.schedule('afterRender', () => {
|
||||
$('#document-name').select();
|
||||
});
|
||||
},
|
||||
|
||||
onSave() {
|
||||
if (this.get('hasNameError') || this.get('hasExcerptError')) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.set('document.name', this.get('docName'));
|
||||
this.set('document.excerpt', this.get('docExcerpt'));
|
||||
|
||||
this.showNotification('Saved');
|
||||
this.get('browser').setTitle(this.get('document.name'));
|
||||
this.get('browser').setMetaDescription(this.get('document.excerpt'));
|
||||
|
||||
this.get('documentService').save(this.get('document'));
|
||||
|
||||
this.set('editMode', false);
|
||||
},
|
||||
|
||||
onCancel() {
|
||||
this.set('editMode', false);
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,49 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
revision: null,
|
||||
hasDiff: Ember.computed('diff', function () {
|
||||
return this.get('diff').length > 0;
|
||||
}),
|
||||
|
||||
didReceiveAttrs() {
|
||||
let revisions = this.get('revisions');
|
||||
|
||||
revisions.forEach((r) => {
|
||||
Ember.set(r, 'deleted', r.revisions === 0);
|
||||
Ember.set(r, 'label', `${r.created} - ${r.firstname} ${r.lastname} - ${r.title}`);
|
||||
});
|
||||
|
||||
if (revisions.length > 0 && is.null(this.get('revision'))) {
|
||||
this.send('onSelectRevision', revisions[0]);
|
||||
}
|
||||
|
||||
this.set('revisions', revisions);
|
||||
},
|
||||
|
||||
actions: {
|
||||
onSelectRevision(revision) {
|
||||
this.set('revision', revision);
|
||||
|
||||
if (!revision.deleted) {
|
||||
this.attrs.onFetchDiff(revision.pageId, revision.id);
|
||||
}
|
||||
},
|
||||
|
||||
onRollback() {
|
||||
let revision = this.get('revision');
|
||||
this.attrs.onRollback(revision.pageId, revision.id);
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,92 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import NotifierMixin from '../../mixins/notifier';
|
||||
import TooltipMixin from '../../mixins/tooltip';
|
||||
|
||||
export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||
documentService: Ember.inject.service('document'),
|
||||
sectionService: Ember.inject.service('section'),
|
||||
editMode: false,
|
||||
|
||||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
|
||||
if (this.get('isDestroyed') || this.get('isDestroying')) {
|
||||
return;
|
||||
}
|
||||
|
||||
let page = this.get('page');
|
||||
|
||||
this.get('documentService').getPageMeta(page.get('documentId'), page.get('id')).then((meta) => {
|
||||
if (this.get('isDestroyed') || this.get('isDestroying')) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.set('meta', meta);
|
||||
if (this.get('toEdit') === this.get('page.id') && this.get('isEditor')) {
|
||||
this.send('onEdit');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
actions: {
|
||||
onSavePage(page, meta) {
|
||||
this.set('page', page);
|
||||
this.set('meta', meta);
|
||||
this.set('editMode', false);
|
||||
this.get('onSavePage')(page, meta);
|
||||
},
|
||||
|
||||
onSavePageAsBlock(block) {
|
||||
this.attrs.onSavePageAsBlock(block);
|
||||
},
|
||||
|
||||
onCopyPage(documentId) {
|
||||
this.attrs.onCopyPage(this.get('page.id'), documentId);
|
||||
},
|
||||
|
||||
onMovePage(documentId) {
|
||||
this.attrs.onMovePage(this.get('page.id'), documentId);
|
||||
},
|
||||
|
||||
onDeletePage(deleteChildren) {
|
||||
let page = this.get('page');
|
||||
|
||||
if (is.undefined(page)) {
|
||||
return;
|
||||
}
|
||||
|
||||
let params = {
|
||||
id: page.get('id'),
|
||||
title: page.get('title'),
|
||||
children: deleteChildren
|
||||
};
|
||||
|
||||
this.attrs.onDeletePage(params);
|
||||
},
|
||||
|
||||
onEdit() {
|
||||
if (this.get('editMode')) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.get('toEdit', '');
|
||||
// this.set('pageId', this.get('page.id'));
|
||||
this.set('editMode', true);
|
||||
},
|
||||
|
||||
onCancelEdit() {
|
||||
this.set('editMode', false);
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,77 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import NotifierMixin from '../../mixins/notifier';
|
||||
import TooltipMixin from '../../mixins/tooltip';
|
||||
|
||||
export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||
sectionService: Ember.inject.service('section'),
|
||||
viewMode: true,
|
||||
editMode: false,
|
||||
|
||||
didInsertElement() {
|
||||
this.get('sectionService').refresh(this.get('document.id')).then((changes) => {
|
||||
if (this.get('isDestroyed') || this.get('isDestroying')) {
|
||||
return;
|
||||
}
|
||||
|
||||
let oldPage = this.get('page');
|
||||
|
||||
if (is.undefined(changes) || is.undefined(oldPage)) {
|
||||
return;
|
||||
}
|
||||
|
||||
changes.forEach((newPage) => {
|
||||
if (oldPage.get('id') === newPage.get('id')) {
|
||||
oldPage.set('body', newPage.get('body'));
|
||||
oldPage.set('revised', newPage.get('revised'));
|
||||
this.showNotification(`Refreshed ${oldPage.get('title')}`);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
actions: {
|
||||
onExpand() {
|
||||
this.set('pageId', this.get('page.id'));
|
||||
this.set('expanded', !this.get('expanded'));
|
||||
},
|
||||
|
||||
onSavePageAsBlock(block) {
|
||||
this.attrs.onSavePageAsBlock(block);
|
||||
},
|
||||
|
||||
onCopyPage(documentId) {
|
||||
this.attrs.onCopyPage(this.get('page.id'), documentId);
|
||||
},
|
||||
|
||||
onMovePage(documentId) {
|
||||
this.attrs.onMovePage(this.get('page.id'), documentId);
|
||||
},
|
||||
|
||||
onDeletePage(deleteChildren) {
|
||||
let page = this.get('page');
|
||||
|
||||
if (is.undefined(page)) {
|
||||
return;
|
||||
}
|
||||
|
||||
let params = {
|
||||
id: page.get('id'),
|
||||
title: page.get('title'),
|
||||
children: deleteChildren
|
||||
};
|
||||
|
||||
this.attrs.onDeletePage(params);
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,320 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import NotifierMixin from '../../mixins/notifier';
|
||||
import TooltipMixin from '../../mixins/tooltip';
|
||||
|
||||
const {
|
||||
computed,
|
||||
} = Ember;
|
||||
|
||||
export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||
documentService: Ember.inject.service('document'),
|
||||
sectionService: Ember.inject.service('section'),
|
||||
appMeta: Ember.inject.service(),
|
||||
link: Ember.inject.service(),
|
||||
hasPages: computed.notEmpty('pages'),
|
||||
newSectionName: 'Section',
|
||||
newSectionNameMissing: computed.empty('newSectionName'),
|
||||
newSectionLocation: '',
|
||||
beforePage: '',
|
||||
toEdit: '',
|
||||
|
||||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
|
||||
this.loadBlocks();
|
||||
|
||||
Ember.run.schedule('afterRender', () => {
|
||||
let jumpTo = "#page-" + this.get('pageId');
|
||||
if (!$(jumpTo).inView()) {
|
||||
$(jumpTo).velocity("scroll", { duration: 250, offset: -100 });
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
didRender() {
|
||||
this._super(...arguments);
|
||||
|
||||
this.contentLinkHandler();
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
this._super(...arguments);
|
||||
|
||||
this.setupAddWizard();
|
||||
|
||||
let self = this;
|
||||
$(".tooltipped").each(function(i, el) {
|
||||
self.addTooltip(el);
|
||||
});
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
this._super(...arguments);
|
||||
|
||||
$('.start-section:not(.start-section-empty-state)').off('.hoverIntent');
|
||||
|
||||
this.destroyTooltips();
|
||||
},
|
||||
|
||||
contentLinkHandler() {
|
||||
let links = this.get('link');
|
||||
let doc = this.get('document');
|
||||
let self = this;
|
||||
|
||||
$("a[data-documize='true']").off('click').on('click', function (e) {
|
||||
let link = links.getLinkObject(self.get('links'), this);
|
||||
|
||||
// local link? exists?
|
||||
if ((link.linkType === "section" || link.linkType === "tab") && link.documentId === doc.get('id')) {
|
||||
let exists = self.get('pages').findBy('id', link.targetId);
|
||||
|
||||
if (_.isUndefined(exists)) {
|
||||
link.orphan = true;
|
||||
} else {
|
||||
if (link.linkType === "section") {
|
||||
self.attrs.gotoPage(link.targetId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (link.orphan) {
|
||||
$(this).addClass('broken-link');
|
||||
self.showNotification('Broken link!');
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
return false;
|
||||
}
|
||||
|
||||
links.linkClick(doc, link);
|
||||
return false;
|
||||
});
|
||||
},
|
||||
|
||||
setupAddWizard() {
|
||||
Ember.run.schedule('afterRender', () => {
|
||||
$('.start-section:not(.start-section-empty-state)').off('.hoverIntent');
|
||||
|
||||
$('.start-section:not(.start-section-empty-state)').hoverIntent({interval: 100, over: function() {
|
||||
// in
|
||||
$(this).find('.start-button').velocity("transition.slideDownIn", {duration: 300});
|
||||
}, out: function() {
|
||||
// out
|
||||
$(this).find('.start-button').velocity("transition.slideUpOut", {duration: 300});
|
||||
} });
|
||||
});
|
||||
},
|
||||
|
||||
addSection(model) {
|
||||
// calculate sequence of page (position in document)
|
||||
let sequence = 0;
|
||||
let level = 1;
|
||||
let beforePage = this.get('beforePage');
|
||||
|
||||
if (is.not.null(beforePage)) {
|
||||
level = beforePage.get('level');
|
||||
|
||||
// get any page before the beforePage so we can insert this new section between them
|
||||
let index = _.findIndex(this.get('pages'), function(p) { return p.get('id') === beforePage.get('id'); });
|
||||
|
||||
if (index !== -1) {
|
||||
let beforeBeforePage = this.get('pages')[index-1];
|
||||
|
||||
if (is.not.undefined(beforeBeforePage)) {
|
||||
sequence = (beforePage.get('sequence') + beforeBeforePage.get('sequence')) / 2;
|
||||
} else {
|
||||
sequence = beforePage.get('sequence') / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
model.page.sequence = sequence;
|
||||
model.page.level = level;
|
||||
|
||||
this.send('onHideSectionWizard');
|
||||
|
||||
return this.get('onInsertSection')(model);
|
||||
},
|
||||
|
||||
loadBlocks() {
|
||||
this.get('sectionService').getSpaceBlocks(this.get('folder.id')).then((blocks) => {
|
||||
if (this.get('isDestroyed') || this.get('isDestroying')) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.set('blocks', blocks);
|
||||
this.set('hasBlocks', blocks.get('length') > 0);
|
||||
|
||||
blocks.forEach((b) => {
|
||||
b.set('deleteId', `delete-block-button-${b.id}`);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
actions: {
|
||||
onSavePageAsBlock(block) {
|
||||
const promise = this.attrs.onSavePageAsBlock(block);
|
||||
promise.then(() => {
|
||||
this.loadBlocks();
|
||||
});
|
||||
},
|
||||
|
||||
onCopyPage(pageId, documentId) {
|
||||
this.attrs.onCopyPage(pageId, documentId);
|
||||
},
|
||||
|
||||
onMovePage(pageId, documentId) {
|
||||
this.attrs.onMovePage(pageId, documentId);
|
||||
},
|
||||
|
||||
onDeletePage(params) {
|
||||
this.attrs.onDeletePage(params);
|
||||
},
|
||||
|
||||
onSavePage(page, meta) {
|
||||
this.set('toEdit', '');
|
||||
this.attrs.onSavePage(page, meta);
|
||||
},
|
||||
|
||||
onShowSectionWizard(page) {
|
||||
if (is.undefined(page)) {
|
||||
page = { id: '0' };
|
||||
}
|
||||
|
||||
this.set('pageId', '');
|
||||
|
||||
let beforePage = this.get('beforePage');
|
||||
if (is.not.null(beforePage) && $("#new-section-wizard").is(':visible') && beforePage.get('id') === page.id) {
|
||||
this.send('onHideSectionWizard');
|
||||
return;
|
||||
}
|
||||
|
||||
this.set('newSectionLocation', page.id);
|
||||
|
||||
if (page.id === '0') {
|
||||
// this handles add section at the end of the document
|
||||
// because we are not before another page
|
||||
this.set('beforePage', null);
|
||||
} else {
|
||||
this.set('beforePage', page);
|
||||
}
|
||||
|
||||
$("#new-section-wizard").insertAfter(`#add-section-button-${page.id}`);
|
||||
$("#new-section-wizard").velocity("transition.slideDownIn", { duration: 300, complete:
|
||||
function() {
|
||||
$("#new-section-name").focus();
|
||||
}});
|
||||
},
|
||||
|
||||
onHideSectionWizard() {
|
||||
this.set('newSectionLocation', '');
|
||||
this.set('beforePage', null);
|
||||
$("#new-section-wizard").insertAfter('#wizard-placeholder');
|
||||
$("#new-section-wizard").velocity("transition.slideUpOut", { duration: 300 });
|
||||
},
|
||||
|
||||
onInsertSection(section) {
|
||||
let sectionName = this.get('newSectionName');
|
||||
if (is.empty(sectionName)) {
|
||||
$("#new-section-name").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
let page = {
|
||||
documentId: this.get('document.id'),
|
||||
title: sectionName,
|
||||
level: 1,
|
||||
sequence: 0, // calculated elsewhere
|
||||
body: "",
|
||||
contentType: section.get('contentType'),
|
||||
pageType: section.get('pageType')
|
||||
};
|
||||
|
||||
let meta = {
|
||||
documentId: this.get('document.id'),
|
||||
rawBody: "",
|
||||
config: ""
|
||||
};
|
||||
|
||||
let model = {
|
||||
page: page,
|
||||
meta: meta
|
||||
};
|
||||
|
||||
this.audit.record("added-section-" + section.get('contentType'));
|
||||
|
||||
const promise = this.addSection(model);
|
||||
promise.then((id) => {
|
||||
this.set('pageId', id);
|
||||
|
||||
if (model.page.pageType === 'section') {
|
||||
this.set('toEdit', id);
|
||||
} else {
|
||||
this.set('toEdit', '');
|
||||
}
|
||||
|
||||
this.setupAddWizard();
|
||||
});
|
||||
},
|
||||
|
||||
onInsertBlock(block) {
|
||||
let sectionName = this.get('newSectionName');
|
||||
if (is.empty(sectionName)) {
|
||||
$("#new-section-name").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
let page = {
|
||||
documentId: this.get('document.id'),
|
||||
title: `${block.get('title')}`,
|
||||
level: 1,
|
||||
sequence: 0, // calculated elsewhere
|
||||
body: block.get('body'),
|
||||
contentType: block.get('contentType'),
|
||||
pageType: block.get('pageType'),
|
||||
blockId: block.get('id')
|
||||
};
|
||||
|
||||
let meta = {
|
||||
documentId: this.get('document.id'),
|
||||
rawBody: block.get('rawBody'),
|
||||
config: block.get('config'),
|
||||
externalSource: block.get('externalSource')
|
||||
};
|
||||
|
||||
let model = {
|
||||
page: page,
|
||||
meta: meta
|
||||
};
|
||||
|
||||
this.audit.record("added-content-block-" + block.get('contentType'));
|
||||
|
||||
const promise = this.addSection(model);
|
||||
promise.then((id) => {
|
||||
this.set('pageId', id);
|
||||
|
||||
this.setupAddWizard();
|
||||
});
|
||||
},
|
||||
|
||||
onDeleteBlock(id) {
|
||||
const promise = this.attrs.onDeleteBlock(id);
|
||||
|
||||
promise.then(() => {
|
||||
this.loadBlocks();
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,194 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import TooltipMixin from '../../mixins/tooltip';
|
||||
|
||||
const {
|
||||
computed,
|
||||
inject: { service }
|
||||
} = Ember;
|
||||
|
||||
export default Ember.Component.extend(TooltipMixin, {
|
||||
documentService: service('document'),
|
||||
deleteChildren: false,
|
||||
menuOpen: false,
|
||||
blockTitle: "",
|
||||
blockExcerpt: "",
|
||||
documentList: [], //includes the current document
|
||||
documentListOthers: [], //excludes the current document
|
||||
selectedDocument: null,
|
||||
|
||||
checkId: computed('page', function () {
|
||||
let id = this.get('page.id');
|
||||
return `delete-check-button-${id}`;
|
||||
}),
|
||||
menuTarget: computed('page', function () {
|
||||
let id = this.get('page.id');
|
||||
return `page-menu-${id}`;
|
||||
}),
|
||||
deleteButtonId: computed('page', function () {
|
||||
let id = this.get('page.id');
|
||||
return `delete-page-button-${id}`;
|
||||
}),
|
||||
publishButtonId: computed('page', function () {
|
||||
let id = this.get('page.id');
|
||||
return `publish-button-${id}`;
|
||||
}),
|
||||
publishDialogId: computed('page', function () {
|
||||
let id = this.get('page.id');
|
||||
return `publish-dialog-${id}`;
|
||||
}),
|
||||
blockTitleId: computed('page', function () {
|
||||
let id = this.get('page.id');
|
||||
return `block-title-${id}`;
|
||||
}),
|
||||
blockExcerptId: computed('page', function () {
|
||||
let id = this.get('page.id');
|
||||
return `block-excerpt-${id}`;
|
||||
}),
|
||||
copyButtonId: computed('page', function () {
|
||||
let id = this.get('page.id');
|
||||
return `copy-page-button-${id}`;
|
||||
}),
|
||||
copyDialogId: computed('page', function () {
|
||||
let id = this.get('page.id');
|
||||
return `copy-dialog-${id}`;
|
||||
}),
|
||||
moveButtonId: computed('page', function () {
|
||||
let id = this.get('page.id');
|
||||
return `move-page-button-${id}`;
|
||||
}),
|
||||
moveDialogId: computed('page', function () {
|
||||
let id = this.get('page.id');
|
||||
return `move-dialog-${id}`;
|
||||
}),
|
||||
|
||||
didRender() {
|
||||
$("#" + this.get('blockTitleId')).removeClass('error');
|
||||
$("#" + this.get('blockExcerptId')).removeClass('error');
|
||||
},
|
||||
|
||||
actions: {
|
||||
onMenuOpen() {
|
||||
if ($('#' + this.get('publishDialogId')).is( ":visible" )) {
|
||||
return;
|
||||
}
|
||||
if ($('#' + this.get('copyDialogId')).is( ":visible" )) {
|
||||
return;
|
||||
}
|
||||
if ($('#' + this.get('moveDialogId')).is( ":visible" )) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.set('menuOpen', !this.get('menuOpen'));
|
||||
},
|
||||
|
||||
onEdit() {
|
||||
this.attrs.onEdit();
|
||||
},
|
||||
|
||||
deletePage() {
|
||||
this.attrs.onDeletePage(this.get('deleteChildren'));
|
||||
},
|
||||
|
||||
onSavePageAsBlock() {
|
||||
let page = this.get('page');
|
||||
let titleElem = '#' + this.get('blockTitleId');
|
||||
let blockTitle = this.get('blockTitle');
|
||||
if (is.empty(blockTitle)) {
|
||||
$(titleElem).addClass('error');
|
||||
return;
|
||||
}
|
||||
|
||||
let excerptElem = '#' + this.get('blockExcerptId');
|
||||
let blockExcerpt = this.get('blockExcerpt');
|
||||
blockExcerpt = blockExcerpt.replace(/\n/g, "");
|
||||
if (is.empty(blockExcerpt)) {
|
||||
$(excerptElem).addClass('error');
|
||||
return;
|
||||
}
|
||||
|
||||
this.get('documentService').getPageMeta(this.get('document.id'), page.get('id')).then((pm) => {
|
||||
let block = {
|
||||
folderId: this.get('folder.id'),
|
||||
contentType: page.get('contentType'),
|
||||
pageType: page.get('pageType'),
|
||||
title: blockTitle,
|
||||
body: page.get('body'),
|
||||
excerpt: blockExcerpt,
|
||||
rawBody: pm.get('rawBody'),
|
||||
config: pm.get('config'),
|
||||
externalSource: pm.get('externalSource')
|
||||
};
|
||||
|
||||
this.attrs.onSavePageAsBlock(block);
|
||||
|
||||
this.set('menuOpen', false);
|
||||
this.set('blockTitle', '');
|
||||
this.set('blockExcerpt', '');
|
||||
$(titleElem).removeClass('error');
|
||||
$(excerptElem).removeClass('error');
|
||||
|
||||
return true;
|
||||
});
|
||||
},
|
||||
|
||||
// Copy/move actions
|
||||
onCopyDialogOpen() {
|
||||
// Fetch document targets once.
|
||||
if (this.get('documentList').length > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.get('documentService').getPageMoveCopyTargets().then((d) => {
|
||||
let me = this.get('document');
|
||||
this.set('documentList', d);
|
||||
this.set('documentListOthers', d.filter((item) => item.get('id') !== me.get('id')));
|
||||
});
|
||||
},
|
||||
|
||||
onTargetChange(d) {
|
||||
this.set('selectedDocument', d);
|
||||
},
|
||||
|
||||
onCopyPage() {
|
||||
// can't proceed if no data
|
||||
if (this.get('documentList.length') === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
let targetDocumentId = this.get('document.id');
|
||||
if (is.not.null(this.get('selectedDocument'))) {
|
||||
targetDocumentId = this.get('selectedDocument.id');
|
||||
}
|
||||
|
||||
this.attrs.onCopyPage(targetDocumentId);
|
||||
return true;
|
||||
},
|
||||
|
||||
onMovePage() {
|
||||
// can't proceed if no data
|
||||
if (this.get('documentListOthers.length') === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (is.null(this.get('selectedDocument'))) {
|
||||
this.set('selectedDocument', this.get('documentListOthers')[0]);
|
||||
}
|
||||
|
||||
let targetDocumentId = this.get('selectedDocument.id');
|
||||
|
||||
this.attrs.onMovePage(targetDocumentId);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,24 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
documentService: Ember.inject.service('document'),
|
||||
|
||||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
|
||||
this.get('documentService').getActivity(this.get('document.id')).then((activity) => {
|
||||
this.set('activity', activity);
|
||||
});
|
||||
}
|
||||
});
|
|
@ -1,148 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import NotifierMixin from '../../mixins/notifier';
|
||||
import TooltipMixin from '../../mixins/tooltip';
|
||||
|
||||
export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||
documentService: Ember.inject.service('document'),
|
||||
appMeta: Ember.inject.service(),
|
||||
drop: null,
|
||||
emptyState: Ember.computed.empty('files'),
|
||||
deleteAttachment: {
|
||||
id: "",
|
||||
name: "",
|
||||
},
|
||||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
|
||||
this.getAttachments();
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
this._super(...arguments);
|
||||
|
||||
if (!this.get('isEditor')) {
|
||||
return;
|
||||
}
|
||||
|
||||
let self = this;
|
||||
let documentId = this.get('document.id');
|
||||
let url = this.get('appMeta.endpoint');
|
||||
let uploadUrl = `${url}/documents/${documentId}/attachments`;
|
||||
|
||||
let dzone = new Dropzone("#upload-document-files", {
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + self.get('session.session.content.authenticated.token')
|
||||
},
|
||||
url: uploadUrl,
|
||||
method: "post",
|
||||
paramName: 'attachment',
|
||||
clickable: true,
|
||||
maxFilesize: 10,
|
||||
parallelUploads: 3,
|
||||
uploadMultiple: false,
|
||||
addRemoveLinks: false,
|
||||
autoProcessQueue: true,
|
||||
|
||||
init: function () {
|
||||
this.on("success", function (file /*, response*/ ) {
|
||||
self.showNotification(`Attached ${file.name}`);
|
||||
});
|
||||
|
||||
this.on("queuecomplete", function () {
|
||||
self.getAttachments();
|
||||
});
|
||||
|
||||
this.on("addedfile", function ( /*file*/ ) {
|
||||
self.audit.record('attached-file');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
dzone.on("complete", function (file) {
|
||||
dzone.removeFile(file);
|
||||
});
|
||||
|
||||
this.set('drop', dzone);
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
this._super(...arguments);
|
||||
|
||||
let drop = this.get('drop');
|
||||
if (is.not.null(drop)) {
|
||||
drop.destroy();
|
||||
}
|
||||
},
|
||||
|
||||
getAttachments() {
|
||||
this.get('documentService').getAttachments(this.get('document.id')).then((files) => {
|
||||
this.set('files', files);
|
||||
});
|
||||
},
|
||||
|
||||
actions: {
|
||||
onConfirmDelete(id, name) {
|
||||
this.set('deleteAttachment', {
|
||||
id: id,
|
||||
name: name
|
||||
});
|
||||
|
||||
$(".delete-attachment-dialog").css("display", "block");
|
||||
|
||||
let drop = new Drop({
|
||||
target: $(".delete-attachment-" + id)[0],
|
||||
content: $(".delete-attachment-dialog")[0],
|
||||
classes: 'drop-theme-basic',
|
||||
position: "bottom right",
|
||||
openOn: "always",
|
||||
tetherOptions: {
|
||||
offset: "5px 0",
|
||||
targetOffset: "10px 0"
|
||||
},
|
||||
remove: false
|
||||
});
|
||||
|
||||
this.set('drop', drop);
|
||||
},
|
||||
|
||||
onCancel() {
|
||||
let drop = this.get('drop');
|
||||
drop.close();
|
||||
|
||||
this.set('deleteAttachment', {
|
||||
id: "",
|
||||
name: ""
|
||||
});
|
||||
},
|
||||
|
||||
onDelete() {
|
||||
let attachment = this.get('deleteAttachment');
|
||||
let drop = this.get('drop');
|
||||
drop.close();
|
||||
|
||||
this.showNotification(`Deleted ${name}`);
|
||||
|
||||
this.get('documentService').deleteAttachment(this.get('document.id'), attachment.id).then(() => {
|
||||
this.getAttachments();
|
||||
this.set('deleteAttachment', {
|
||||
id: "",
|
||||
name: ""
|
||||
});
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,24 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
page: {},
|
||||
tagName: "li",
|
||||
classNames: ["item"],
|
||||
|
||||
actions: {
|
||||
onClick(id) {
|
||||
this.get('onClick')(id);
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,174 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import NotifierMixin from '../../mixins/notifier';
|
||||
import TooltipMixin from '../../mixins/tooltip';
|
||||
import tocUtil from '../../utils/toc';
|
||||
|
||||
export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||
document: {},
|
||||
folder: {},
|
||||
pages: [],
|
||||
currentPageId: "",
|
||||
state: {
|
||||
actionablePage: false,
|
||||
upDisabled: true,
|
||||
downDisabled: true,
|
||||
indentDisabled: true,
|
||||
outdentDisabled: true
|
||||
},
|
||||
emptyState: Ember.computed('pages', function () {
|
||||
return this.get('pages.length') === 0;
|
||||
}),
|
||||
|
||||
didReceiveAttrs: function () {
|
||||
this._super(...arguments);
|
||||
|
||||
this.set('showToc', is.not.undefined(this.get('pages')) && this.get('pages').get('length') > 0);
|
||||
|
||||
if (is.not.null(this.get('currentPageId'))) {
|
||||
this.send('onEntryClick', this.get('currentPageId'));
|
||||
}
|
||||
},
|
||||
|
||||
didRender: function () {
|
||||
this._super(...arguments);
|
||||
|
||||
if (this.session.authenticated) {
|
||||
this.addTooltip(document.getElementById("toc-up-button"));
|
||||
this.addTooltip(document.getElementById("toc-down-button"));
|
||||
this.addTooltip(document.getElementById("toc-outdent-button"));
|
||||
this.addTooltip(document.getElementById("toc-indent-button"));
|
||||
}
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
this._super(...arguments);
|
||||
|
||||
this.eventBus.subscribe('documentPageAdded', this, 'onDocumentPageAdded');
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
this._super(...arguments);
|
||||
|
||||
this.eventBus.unsubscribe('documentPageAdded');
|
||||
this.destroyTooltips();
|
||||
},
|
||||
|
||||
onDocumentPageAdded(pageId) {
|
||||
this.send('onEntryClick', pageId);
|
||||
},
|
||||
|
||||
// Controls what user can do with the toc (left sidebar).
|
||||
// Identifies the target pages.
|
||||
setState(pageId) {
|
||||
this.set('currentPageId', pageId);
|
||||
|
||||
let toc = this.get('pages');
|
||||
let page = _.findWhere(toc, { id: pageId });
|
||||
let state = tocUtil.getState(toc, page);
|
||||
|
||||
if (!this.get('isEditor') || is.empty(pageId)) {
|
||||
state.actionablePage = false;
|
||||
state.upDisabled = state.downDisabled = state.indentDisabled = state.outdentDisabled = true;
|
||||
}
|
||||
|
||||
this.set('state', state);
|
||||
},
|
||||
|
||||
actions: {
|
||||
// Page up - above pages shunt down.
|
||||
pageUp() {
|
||||
if (this.get('state.upDisabled')) {
|
||||
return;
|
||||
}
|
||||
|
||||
let state = this.get('state');
|
||||
let pages = this.get('pages');
|
||||
let page = _.findWhere(pages, { id: this.get('currentPageId') });
|
||||
let pendingChanges = tocUtil.moveUp(state, pages, page);
|
||||
|
||||
if (pendingChanges.length > 0) {
|
||||
this.attrs.onPageSequenceChange(pendingChanges);
|
||||
|
||||
this.send('onEntryClick', this.get('currentPageId'));
|
||||
this.audit.record("moved-page-up");
|
||||
this.showNotification("Moved up");
|
||||
}
|
||||
},
|
||||
|
||||
// Move down -- pages below shift up.
|
||||
pageDown() {
|
||||
if (this.get('state.downDisabled')) {
|
||||
return;
|
||||
}
|
||||
|
||||
let state = this.get('state');
|
||||
var pages = this.get('pages');
|
||||
var page = _.findWhere(pages, { id: this.get('currentPageId') });
|
||||
let pendingChanges = tocUtil.moveDown(state, pages, page);
|
||||
|
||||
if (pendingChanges.length > 0) {
|
||||
this.attrs.onPageSequenceChange(pendingChanges);
|
||||
|
||||
this.send('onEntryClick', this.get('currentPageId'));
|
||||
this.audit.record("moved-page-down");
|
||||
this.showNotification("Moved down");
|
||||
}
|
||||
},
|
||||
|
||||
// Indent - changes a page from H2 to H3, etc.
|
||||
pageIndent() {
|
||||
if (this.get('state.indentDisabled')) {
|
||||
return;
|
||||
}
|
||||
|
||||
let state = this.get('state');
|
||||
var pages = this.get('pages');
|
||||
var page = _.findWhere(pages, { id: this.get('currentPageId') });
|
||||
let pendingChanges = tocUtil.indent(state, pages, page);
|
||||
|
||||
if (pendingChanges.length > 0) {
|
||||
this.attrs.onPageLevelChange(pendingChanges);
|
||||
|
||||
this.showNotification("Indent");
|
||||
this.audit.record("changed-page-sequence");
|
||||
this.send('onEntryClick', this.get('currentPageId'));
|
||||
}
|
||||
},
|
||||
|
||||
// Outdent - changes a page from H3 to H2, etc.
|
||||
pageOutdent() {
|
||||
if (this.get('state.outdentDisabled')) {
|
||||
return;
|
||||
}
|
||||
|
||||
let state = this.get('state');
|
||||
var pages = this.get('pages');
|
||||
var page = _.findWhere(pages, { id: this.get('currentPageId') });
|
||||
let pendingChanges = tocUtil.outdent(state, pages, page);
|
||||
|
||||
if (pendingChanges.length > 0) {
|
||||
this.attrs.onPageLevelChange(pendingChanges);
|
||||
|
||||
this.showNotification("Outdent");
|
||||
this.audit.record("changed-page-sequence");
|
||||
this.send('onEntryClick', this.get('currentPageId'));
|
||||
}
|
||||
},
|
||||
|
||||
onEntryClick(id) {
|
||||
this.setState(id);
|
||||
this.attrs.onGotoPage(id);
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,153 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import TooltipMixin from '../../mixins/tooltip';
|
||||
import NotifierMixin from '../../mixins/notifier';
|
||||
|
||||
export default Ember.Component.extend(TooltipMixin, NotifierMixin, {
|
||||
documentService: Ember.inject.service('document'),
|
||||
sectionService: Ember.inject.service('section'),
|
||||
sessionService: Ember.inject.service('session'),
|
||||
appMeta: Ember.inject.service(),
|
||||
userService: Ember.inject.service('user'),
|
||||
localStorage: Ember.inject.service(),
|
||||
pinned: Ember.inject.service(),
|
||||
menuOpen: false,
|
||||
pinState : {
|
||||
isPinned: false,
|
||||
pinId: '',
|
||||
newName: '',
|
||||
},
|
||||
saveTemplate: {
|
||||
name: "",
|
||||
description: ""
|
||||
},
|
||||
tab: '',
|
||||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
|
||||
if (is.empty(this.get('tab')) || is.undefined(this.get('tab'))) {
|
||||
this.set('tab', 'index');
|
||||
}
|
||||
},
|
||||
|
||||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
|
||||
this.set('saveTemplate.name', this.get('document.name'));
|
||||
this.set('saveTemplate.description', this.get('document.excerpt'));
|
||||
|
||||
this.set('pinState.pinId', this.get('pinned').isDocumentPinned(this.get('document.id')));
|
||||
this.set('pinState.isPinned', this.get('pinState.pinId') !== '');
|
||||
this.set('pinState.newName', this.get('document.name').substring(0,3).toUpperCase());
|
||||
},
|
||||
|
||||
actions: {
|
||||
onChangeTab(tab) {
|
||||
this.set('tab', tab);
|
||||
},
|
||||
|
||||
onTagChange(tags) {
|
||||
let doc = this.get('document');
|
||||
doc.set('tags', tags);
|
||||
this.get('documentService').save(doc);
|
||||
},
|
||||
|
||||
onMenuOpen() {
|
||||
this.set('menuOpen', !this.get('menuOpen'));
|
||||
},
|
||||
|
||||
onDeleteDocument() {
|
||||
this.attrs.onDocumentDelete();
|
||||
},
|
||||
|
||||
onPrintDocument() {
|
||||
this.audit.record('printed-document');
|
||||
$("#sidebar-zone-more-button").click();
|
||||
window.print();
|
||||
},
|
||||
|
||||
onPageSequenceChange(changes) {
|
||||
this.get('onPageSequenceChange')(changes);
|
||||
},
|
||||
|
||||
onPageLevelChange(changes) {
|
||||
this.get('onPageLevelChange')(changes);
|
||||
},
|
||||
|
||||
onGotoPage(id) {
|
||||
this.get('onGotoPage')(id);
|
||||
},
|
||||
|
||||
onUnpin() {
|
||||
this.audit.record('unpinned-document');
|
||||
|
||||
this.get('pinned').unpinItem(this.get('pinState.pinId')).then(() => {
|
||||
this.set('pinState.isPinned', false);
|
||||
this.set('pinState.pinId', '');
|
||||
this.eventBus.publish('pinChange');
|
||||
});
|
||||
},
|
||||
|
||||
onPin() {
|
||||
let pin = {
|
||||
pin: this.get('pinState.newName'),
|
||||
documentId: this.get('document.id'),
|
||||
folderId: this.get('folder.id')
|
||||
};
|
||||
|
||||
if (is.empty(pin.pin)) {
|
||||
$("#pin-document-name").addClass("error").focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
this.audit.record('pinned-document');
|
||||
|
||||
this.get('pinned').pinItem(pin).then((pin) => {
|
||||
this.set('pinState.isPinned', true);
|
||||
this.set('pinState.pinId', pin.get('id'));
|
||||
this.eventBus.publish('pinChange');
|
||||
});
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
onSaveTemplate() {
|
||||
var name = this.get('saveTemplate.name');
|
||||
var excerpt = this.get('saveTemplate.description');
|
||||
|
||||
if (is.empty(name)) {
|
||||
$("#new-template-name").addClass("error").focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is.empty(excerpt)) {
|
||||
$("#new-template-desc").addClass("error").focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
this.showNotification('Template saved');
|
||||
this.attrs.onSaveTemplate(name, excerpt);
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
onLayoutChange(layout) {
|
||||
let doc = this.get('document');
|
||||
doc.set('layout', layout);
|
||||
this.get('documentService').save(doc);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,200 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import TooltipMixin from '../../mixins/tooltip';
|
||||
|
||||
const {
|
||||
computed,
|
||||
inject: { service }
|
||||
} = Ember;
|
||||
|
||||
export default Ember.Component.extend(TooltipMixin, {
|
||||
documentService: service('document'),
|
||||
expanded: false,
|
||||
deleteChildren: false,
|
||||
menuOpen: false,
|
||||
blockTitle: "",
|
||||
blockExcerpt: "",
|
||||
documentList: [], //includes the current document
|
||||
documentListOthers: [], //excludes the current document
|
||||
selectedDocument: null,
|
||||
|
||||
checkId: computed('page', function () {
|
||||
let id = this.get('page.id');
|
||||
return `delete-check-button-${id}`;
|
||||
}),
|
||||
menuTarget: computed('page', function () {
|
||||
let id = this.get('page.id');
|
||||
return `page-menu-${id}`;
|
||||
}),
|
||||
deleteButtonId: computed('page', function () {
|
||||
let id = this.get('page.id');
|
||||
return `delete-page-button-${id}`;
|
||||
}),
|
||||
publishButtonId: computed('page', function () {
|
||||
let id = this.get('page.id');
|
||||
return `publish-button-${id}`;
|
||||
}),
|
||||
publishDialogId: computed('page', function () {
|
||||
let id = this.get('page.id');
|
||||
return `publish-dialog-${id}`;
|
||||
}),
|
||||
blockTitleId: computed('page', function () {
|
||||
let id = this.get('page.id');
|
||||
return `block-title-${id}`;
|
||||
}),
|
||||
blockExcerptId: computed('page', function () {
|
||||
let id = this.get('page.id');
|
||||
return `block-excerpt-${id}`;
|
||||
}),
|
||||
copyButtonId: computed('page', function () {
|
||||
let id = this.get('page.id');
|
||||
return `copy-page-button-${id}`;
|
||||
}),
|
||||
copyDialogId: computed('page', function () {
|
||||
let id = this.get('page.id');
|
||||
return `copy-dialog-${id}`;
|
||||
}),
|
||||
moveButtonId: computed('page', function () {
|
||||
let id = this.get('page.id');
|
||||
return `move-page-button-${id}`;
|
||||
}),
|
||||
moveDialogId: computed('page', function () {
|
||||
let id = this.get('page.id');
|
||||
return `move-dialog-${id}`;
|
||||
}),
|
||||
|
||||
didRender() {
|
||||
$("#" + this.get('blockTitleId')).removeClass('error');
|
||||
$("#" + this.get('blockExcerptId')).removeClass('error');
|
||||
},
|
||||
|
||||
actions: {
|
||||
toggleExpand() {
|
||||
this.set('expanded', !this.get('expanded'));
|
||||
this.get('onExpand')();
|
||||
},
|
||||
|
||||
onMenuOpen() {
|
||||
if ($('#' + this.get('publishDialogId')).is( ":visible" )) {
|
||||
return;
|
||||
}
|
||||
if ($('#' + this.get('copyDialogId')).is( ":visible" )) {
|
||||
return;
|
||||
}
|
||||
if ($('#' + this.get('moveDialogId')).is( ":visible" )) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.set('menuOpen', !this.get('menuOpen'));
|
||||
},
|
||||
|
||||
onEdit() {
|
||||
this.attrs.onEdit();
|
||||
},
|
||||
|
||||
deletePage() {
|
||||
this.attrs.onDeletePage(this.get('deleteChildren'));
|
||||
},
|
||||
|
||||
onSavePageAsBlock() {
|
||||
let page = this.get('page');
|
||||
let titleElem = '#' + this.get('blockTitleId');
|
||||
let blockTitle = this.get('blockTitle');
|
||||
if (is.empty(blockTitle)) {
|
||||
$(titleElem).addClass('error');
|
||||
return;
|
||||
}
|
||||
|
||||
let excerptElem = '#' + this.get('blockExcerptId');
|
||||
let blockExcerpt = this.get('blockExcerpt');
|
||||
blockExcerpt = blockExcerpt.replace(/\n/g, "");
|
||||
if (is.empty(blockExcerpt)) {
|
||||
$(excerptElem).addClass('error');
|
||||
return;
|
||||
}
|
||||
|
||||
this.get('documentService').getPageMeta(this.get('document.id'), page.get('id')).then((pm) => {
|
||||
let block = {
|
||||
folderId: this.get('folder.id'),
|
||||
contentType: page.get('contentType'),
|
||||
pageType: page.get('pageType'),
|
||||
title: blockTitle,
|
||||
body: page.get('body'),
|
||||
excerpt: blockExcerpt,
|
||||
rawBody: pm.get('rawBody'),
|
||||
config: pm.get('config'),
|
||||
externalSource: pm.get('externalSource')
|
||||
};
|
||||
|
||||
this.attrs.onSavePageAsBlock(block);
|
||||
|
||||
this.set('menuOpen', false);
|
||||
this.set('blockTitle', '');
|
||||
this.set('blockExcerpt', '');
|
||||
$(titleElem).removeClass('error');
|
||||
$(excerptElem).removeClass('error');
|
||||
|
||||
return true;
|
||||
});
|
||||
},
|
||||
|
||||
// Copy/move actions
|
||||
onCopyDialogOpen() {
|
||||
// Fetch document targets once.
|
||||
if (this.get('documentList').length > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.get('documentService').getPageMoveCopyTargets().then((d) => {
|
||||
let me = this.get('document');
|
||||
this.set('documentList', d);
|
||||
this.set('documentListOthers', d.filter((item) => item.get('id') !== me.get('id')));
|
||||
});
|
||||
},
|
||||
|
||||
onTargetChange(d) {
|
||||
this.set('selectedDocument', d);
|
||||
},
|
||||
|
||||
onCopyPage() {
|
||||
// can't proceed if no data
|
||||
if (this.get('documentList.length') === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
let targetDocumentId = this.get('document.id');
|
||||
if (is.not.null(this.get('selectedDocument'))) {
|
||||
targetDocumentId = this.get('selectedDocument.id');
|
||||
}
|
||||
|
||||
this.attrs.onCopyPage(targetDocumentId);
|
||||
return true;
|
||||
},
|
||||
|
||||
onMovePage() {
|
||||
// can't proceed if no data
|
||||
if (this.get('documentListOthers.length') === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (is.null(this.get('selectedDocument'))) {
|
||||
this.set('selectedDocument', this.get('documentListOthers')[0]);
|
||||
}
|
||||
|
||||
let targetDocumentId = this.get('selectedDocument.id');
|
||||
|
||||
this.attrs.onMovePage(targetDocumentId);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,112 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
documentTags: [],
|
||||
tagz: [],
|
||||
isEditor: false,
|
||||
newTag: "",
|
||||
maxTags: 3,
|
||||
canAdd: false,
|
||||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
let tagz = [];
|
||||
|
||||
if (!_.isUndefined(this.get('documentTags')) && this.get('documentTags').length > 1) {
|
||||
let tags = this.get('documentTags').split('#');
|
||||
_.each(tags, function(tag) {
|
||||
if (tag.length > 0) {
|
||||
tagz.pushObject(tag);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.set('tagz', tagz);
|
||||
this.set('canAdd', this.get('isEditor') && this.get('tagz').get('length') < 3);
|
||||
},
|
||||
|
||||
didUpdateAttrs() {
|
||||
this.set('canAdd', this.get('isEditor') && this.get('tagz').get('length') < 3);
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
$("#add-tag-field").off("keydown");
|
||||
},
|
||||
|
||||
actions: {
|
||||
onTagEditor() {
|
||||
$("#add-tag-field").off("keydown").on("keydown", function(e) {
|
||||
if (e.shiftKey) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (e.which === 13 || e.which === 45 || e.which === 189 || e.which === 8 || e.which === 127 || (e.which >= 65 && e.which <= 90) || (e.which >= 97 && e.which <= 122) || (e.which >= 48 && e.which <= 57)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
},
|
||||
|
||||
addTag() {
|
||||
let tags = this.get("tagz");
|
||||
let tag = this.get('newTag');
|
||||
tag = tag.toLowerCase().trim();
|
||||
|
||||
// empty or dupe?
|
||||
if (tag.length === 0 || _.contains(tags, tag) || tags.length >= this.get('maxTags') || tag.startsWith('-')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
tags.pushObject(tag);
|
||||
this.set('tagz', tags);
|
||||
this.set('newTag', '');
|
||||
|
||||
let save = "#";
|
||||
_.each(tags, function(tag) {
|
||||
save = save + tag + "#";
|
||||
});
|
||||
|
||||
this.get('onChange')(save);
|
||||
|
||||
this.audit.record('added-tag');
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
// removeTag removes specified tag from the list of tags associated with this document.
|
||||
removeTag(tagToRemove) {
|
||||
let tags = this.get("tagz");
|
||||
let save = "";
|
||||
|
||||
tags = _.without(tags, tagToRemove);
|
||||
|
||||
_.each(tags, function(tag) {
|
||||
save = save + tag + "#";
|
||||
});
|
||||
|
||||
if (save.length) {
|
||||
save = "#" + save;
|
||||
}
|
||||
|
||||
this.set('tagz', tags);
|
||||
this.get('onChange')(save);
|
||||
this.audit.record('removed tag');
|
||||
},
|
||||
}
|
||||
});
|
|
@ -1,71 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
const {
|
||||
isEmpty,
|
||||
computed,
|
||||
set
|
||||
|
||||
} = Ember;
|
||||
|
||||
export default Ember.Component.extend({
|
||||
titleEmpty: computed.empty('model.title'),
|
||||
firstnameEmpty: computed.empty('model.firstname'),
|
||||
lastnameEmpty: computed.empty('model.lastname'),
|
||||
emailEmpty: computed.empty('model.email'),
|
||||
passwordEmpty: computed.empty('model.password'),
|
||||
hasEmptyTitleError: computed.and('titleEmpty', 'titleError'),
|
||||
hasEmptyFirstnameError: computed.and('firstnameEmpty', 'adminFirstnameError'),
|
||||
hasEmptyLastnameError: computed.and('lastnameEmpty', 'adminLastnameError'),
|
||||
hasEmptyEmailError: computed.and('emailEmpty', 'adminEmailError'),
|
||||
hasEmptyPasswordError: computed.and('passwordEmpty', 'adminPasswordError'),
|
||||
|
||||
actions: {
|
||||
save() {
|
||||
if (isEmpty(this.get('model.title'))) {
|
||||
set(this, 'titleError', true);
|
||||
return $("#siteTitle").focus();
|
||||
}
|
||||
|
||||
if (isEmpty(this.get('model.firstname'))) {
|
||||
set(this, 'adminFirstnameError', true);
|
||||
return $("#adminFirstname").focus();
|
||||
}
|
||||
|
||||
if (isEmpty(this.get('model.lastname'))) {
|
||||
set(this, 'adminLastnameError', true);
|
||||
return $("#adminLastname").focus();
|
||||
}
|
||||
|
||||
if (isEmpty(this.get('model.email')) || !is.email(this.get('model.email'))) {
|
||||
set(this, 'adminEmailError', true);
|
||||
return $("#adminEmail").focus();
|
||||
}
|
||||
|
||||
if (isEmpty(this.get('model.password'))) {
|
||||
set(this, 'adminPasswordError', true);
|
||||
return $("#adminPassword").focus();
|
||||
}
|
||||
|
||||
this.model.allowAnonymousAccess = Ember.$("#allowAnonymousAccess").prop('checked');
|
||||
|
||||
this.get('save')().then(() => {
|
||||
set(this, 'titleError', false);
|
||||
set(this, 'adminFirstnameError', false);
|
||||
set(this, 'adminLastnameError', false);
|
||||
set(this, 'adminEmailError', false);
|
||||
set(this, 'adminPasswordError', false);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,130 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import stringUtil from '../utils/string';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
drop: null,
|
||||
target: null,
|
||||
button: "Delete",
|
||||
color: "flat-red",
|
||||
button2: "",
|
||||
color2: "2",
|
||||
open: "click",
|
||||
position: 'bottom right',
|
||||
showCancel: true,
|
||||
contentId: "",
|
||||
focusOn: null, // is there an input field we need to focus?
|
||||
selectOn: null, // is there an input field we need to select?
|
||||
onOpenCallback: null, // callback when opened
|
||||
onAction: null,
|
||||
onAction2: null,
|
||||
offset: "5px 0",
|
||||
targetOffset: "10px 0",
|
||||
constrainToWindow: true,
|
||||
constrainToScrollParent: true,
|
||||
tether: Ember.inject.service(),
|
||||
|
||||
hasSecondButton: Ember.computed('button2', 'color2', function () {
|
||||
return is.not.empty(this.get('button2')) && is.not.empty(this.get('color2'));
|
||||
}),
|
||||
|
||||
didReceiveAttrs() {
|
||||
this.set("contentId", 'dropdown-dialog-' + stringUtil.makeId(10));
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
this._super(...arguments);
|
||||
// TODO: refactor to eliminate self
|
||||
let self = this;
|
||||
|
||||
if (is.null(self.get('target'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
let drop = this.get('tether').createDrop({
|
||||
target: document.getElementById(self.get('target')),
|
||||
content: self.$(".dropdown-dialog")[0],
|
||||
classes: 'drop-theme-basic',
|
||||
position: self.get('position'),
|
||||
openOn: self.get('open'),
|
||||
constrainToWindow: true,
|
||||
constrainToScrollParent: false,
|
||||
tetherOptions: {
|
||||
offset: self.offset,
|
||||
targetOffset: self.targetOffset,
|
||||
targetModifier: 'scroll-handle'
|
||||
},
|
||||
remove: true
|
||||
});
|
||||
|
||||
if (drop) {
|
||||
drop.on('open', function () {
|
||||
if (is.not.null(self.get("focusOn"))) {
|
||||
document.getElementById(self.get("focusOn")).focus();
|
||||
}
|
||||
|
||||
if (is.not.null(self.get("selectOn"))) {
|
||||
document.getElementById(self.get("selectOn")).select();
|
||||
}
|
||||
|
||||
if (is.not.null(self.get("onOpenCallback"))) {
|
||||
self.attrs.onOpenCallback(drop);
|
||||
}
|
||||
});
|
||||
|
||||
self.set('drop', drop);
|
||||
}
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
let drop = this.get('drop');
|
||||
if (drop) {
|
||||
drop.destroy();
|
||||
}
|
||||
},
|
||||
|
||||
actions: {
|
||||
onCancel() {
|
||||
let drop = this.get('drop');
|
||||
if (drop) {
|
||||
drop.close();
|
||||
}
|
||||
},
|
||||
|
||||
onAction() {
|
||||
if (this.get('onAction') === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
let close = this.attrs.onAction();
|
||||
|
||||
let drop = this.get('drop');
|
||||
if (close && drop) {
|
||||
drop.close();
|
||||
}
|
||||
},
|
||||
|
||||
onAction2() {
|
||||
if (this.get('onAction2') === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
let close = this.attrs.onAction2();
|
||||
|
||||
let drop = this.get('drop');
|
||||
if (close && drop) {
|
||||
drop.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,71 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import stringUtil from '../utils/string';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
target: null,
|
||||
open: "click",
|
||||
position: 'bottom right',
|
||||
contentId: "",
|
||||
drop: null,
|
||||
onOpenCallback: null, // callback when opened
|
||||
onCloseCallback: null, // callback when closed
|
||||
tether: Ember.inject.service(),
|
||||
|
||||
didReceiveAttrs() {
|
||||
this.set("contentId", 'dropdown-menu-' + stringUtil.makeId(10));
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
this._super(...arguments);
|
||||
let self = this;
|
||||
|
||||
let drop = this.get('tether').createDrop({
|
||||
target: document.getElementById(self.get('target')),
|
||||
content: self.$(".dropdown-menu")[0],
|
||||
classes: 'drop-theme-menu',
|
||||
position: self.get('position'),
|
||||
openOn: self.get('open'),
|
||||
constrainToWindow: false,
|
||||
constrainToScrollParent: false,
|
||||
tetherOptions: {
|
||||
offset: "5px 0",
|
||||
targetOffset: "10px 0",
|
||||
targetModifier: 'scroll-handle',
|
||||
},
|
||||
remove: true
|
||||
});
|
||||
|
||||
if (drop) {
|
||||
drop.on('open', function () {
|
||||
if (is.not.null(self.get("onOpenCallback"))) {
|
||||
self.attrs.onOpenCallback(drop);
|
||||
}
|
||||
});
|
||||
drop.on('close', function () {
|
||||
if (is.not.null(self.get("onCloseCallback"))) {
|
||||
self.attrs.onCloseCallback();
|
||||
}
|
||||
});
|
||||
|
||||
self.set('drop', drop);
|
||||
}
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
let drop = this.get('drop');
|
||||
if (drop) {
|
||||
drop.destroy();
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,18 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.TextField.extend({
|
||||
becomeFocused: function() {
|
||||
this.$().focus();
|
||||
}.on('didInsertElement')
|
||||
});
|
|
@ -1,18 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.TextArea.extend({
|
||||
becomeFocused: function() {
|
||||
this.$().focus();
|
||||
}.on('didInsertElement')
|
||||
});
|
|
@ -1,110 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
folderService: Ember.inject.service('folder'),
|
||||
selectedDocuments: [],
|
||||
moveTarget: null,
|
||||
emptyState: Ember.computed('documents', function() {
|
||||
return this.get('documents.length') === 0;
|
||||
}),
|
||||
|
||||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
|
||||
this.audit.record('viewed-space');
|
||||
this.set('selectedDocuments', []);
|
||||
this.set('canCreate', this.get('folderService').get('canEditCurrentFolder'));
|
||||
this.set('deleteTargets', this.get('folders').rejectBy('id', this.get('folder.id')));
|
||||
},
|
||||
|
||||
didUpdateAttrs() {
|
||||
this._super(...arguments);
|
||||
|
||||
this.setupAddWizard();
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
this._super(...arguments);
|
||||
|
||||
this.setupAddWizard();
|
||||
},
|
||||
|
||||
setupAddWizard() {
|
||||
Ember.run.schedule('afterRender', () => {
|
||||
$('.start-document:not(.start-document-empty-state)').off('.hoverIntent');
|
||||
|
||||
$('.start-document:not(.start-document-empty-state)').hoverIntent({interval: 100, over: function() {
|
||||
// in
|
||||
$(this).find('.start-button').velocity("transition.slideDownIn", {duration: 300});
|
||||
}, out: function() {
|
||||
// out
|
||||
$(this).find('.start-button').velocity("transition.slideUpOut", {duration: 300});
|
||||
} });
|
||||
});
|
||||
},
|
||||
|
||||
actions: {
|
||||
selectDocument(documentId) {
|
||||
let doc = this.get('documents').findBy('id', documentId);
|
||||
let list = this.get('selectedDocuments');
|
||||
|
||||
doc.set('selected', !doc.get('selected'));
|
||||
|
||||
if (doc.get('selected')) {
|
||||
list.push(documentId);
|
||||
} else {
|
||||
var index = list.indexOf(documentId);
|
||||
if (index > -1) {
|
||||
list.splice(index, 1);
|
||||
}
|
||||
}
|
||||
|
||||
this.set('selectedDocuments', list);
|
||||
this.get('onDocumentsChecked')(list);
|
||||
},
|
||||
|
||||
onDelete() {
|
||||
this.get("onDeleteSpace")();
|
||||
},
|
||||
|
||||
onImport() {
|
||||
this.get('onImport')();
|
||||
},
|
||||
|
||||
onShowDocumentWizard(docId) {
|
||||
if ($("#new-document-wizard").is(':visible') && this.get('docId') === docId) {
|
||||
this.send('onHideDocumentWizard');
|
||||
return;
|
||||
}
|
||||
|
||||
this.set('docId', docId);
|
||||
|
||||
if (docId === '') {
|
||||
$("#new-document-wizard").insertAfter('#wizard-placeholder');
|
||||
} else {
|
||||
$("#new-document-wizard").insertAfter(`#document-${docId}`);
|
||||
}
|
||||
|
||||
$("#new-document-wizard").velocity("transition.slideDownIn", { duration: 300, complete:
|
||||
function() {
|
||||
$("#new-document-name").focus();
|
||||
}});
|
||||
},
|
||||
|
||||
onHideDocumentWizard() {
|
||||
$("#new-document-wizard").insertAfter('#wizard-placeholder');
|
||||
$("#new-document-wizard").velocity("transition.slideUpOut", { duration: 300 });
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,60 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import NotifierMixin from '../../mixins/notifier';
|
||||
import TooltipMixin from '../../mixins/tooltip';
|
||||
|
||||
const {
|
||||
computed,
|
||||
} = Ember;
|
||||
|
||||
export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||
folderService: Ember.inject.service('folder'),
|
||||
folderName: '',
|
||||
hasNameError: computed.empty('folderName'),
|
||||
editMode: false,
|
||||
isEditor: false,
|
||||
|
||||
keyUp(e) {
|
||||
if (e.keyCode === 27) { // escape key
|
||||
this.send('onCancel');
|
||||
}
|
||||
},
|
||||
|
||||
actions: {
|
||||
toggleEdit() {
|
||||
this.set('folderName', this.get('folder.name'));
|
||||
this.set('editMode', true);
|
||||
|
||||
Ember.run.schedule('afterRender', () => {
|
||||
$('#folder-name').select();
|
||||
});
|
||||
},
|
||||
|
||||
onSave() {
|
||||
if (this.get('hasNameError')) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.set('folder.name', this.get('folderName'));
|
||||
|
||||
this.get('folderService').save(this.get('folder'));
|
||||
this.showNotification('Saved');
|
||||
|
||||
this.set('editMode', false);
|
||||
},
|
||||
|
||||
onCancel() {
|
||||
this.set('editMode', false);
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,91 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import NotifierMixin from '../../mixins/notifier';
|
||||
import TooltipMixin from '../../mixins/tooltip';
|
||||
import AuthMixin from '../../mixins/auth';
|
||||
|
||||
const {
|
||||
computed
|
||||
} = Ember;
|
||||
|
||||
export default Ember.Component.extend(NotifierMixin, TooltipMixin, AuthMixin, {
|
||||
folderService: Ember.inject.service('folder'),
|
||||
session: Ember.inject.service(),
|
||||
appMeta: Ember.inject.service(),
|
||||
showToolbar: false,
|
||||
folder: {},
|
||||
busy: false,
|
||||
isFolderOwner: computed.equal('folder.userId', 'session.user.id'),
|
||||
moveFolderId: "",
|
||||
drop: null,
|
||||
|
||||
didReceiveAttrs() {
|
||||
this.set('isFolderOwner', this.get('folder.userId') === this.get("session.user.id"));
|
||||
|
||||
let show = this.get('session.authenticated') || this.get('isFolderOwner') || this.get('hasSelectedDocuments') || this.get('folderService').get('canEditCurrentFolder');
|
||||
this.set('showToolbar', show);
|
||||
|
||||
let targets = _.reject(this.get('folders'), {
|
||||
id: this.get('folder').get('id')
|
||||
});
|
||||
|
||||
this.set('movedFolderOptions', targets);
|
||||
},
|
||||
|
||||
didRender() {
|
||||
if (this.get('hasSelectedDocuments')) {
|
||||
this.addTooltip(document.getElementById("move-documents-button"));
|
||||
this.addTooltip(document.getElementById("delete-documents-button"));
|
||||
} else {
|
||||
if (this.get('isFolderOwner')) {
|
||||
this.addTooltip(document.getElementById("folder-share-button"));
|
||||
this.addTooltip(document.getElementById("folder-settings-button"));
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
if (is.not.null(this.get('drop'))) {
|
||||
this.get('drop').destroy();
|
||||
this.set('drop', null);
|
||||
}
|
||||
|
||||
this.destroyTooltips();
|
||||
},
|
||||
|
||||
actions: {
|
||||
deleteDocuments() {
|
||||
this.attrs.onDeleteDocument();
|
||||
},
|
||||
|
||||
setMoveFolder(folderId) {
|
||||
this.set('moveFolderId', folderId);
|
||||
|
||||
let folders = this.get('folders');
|
||||
|
||||
folders.forEach(folder => {
|
||||
folder.set('selected', folder.id === folderId);
|
||||
});
|
||||
},
|
||||
|
||||
moveDocuments() {
|
||||
if (this.get("moveFolderId") === "") {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.attrs.onMoveDocument(this.get('moveFolderId'));
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,73 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import constants from '../../utils/constants';
|
||||
import TooltipMixin from '../../mixins/tooltip';
|
||||
import NotifierMixin from '../../mixins/notifier';
|
||||
import AuthMixin from '../../mixins/auth';
|
||||
|
||||
export default Ember.Component.extend(TooltipMixin, NotifierMixin, AuthMixin, {
|
||||
publicFolders: [],
|
||||
protectedFolders: [],
|
||||
privateFolders: [],
|
||||
hasPublicFolders: false,
|
||||
hasProtectedFolders: false,
|
||||
hasPrivateFolders: false,
|
||||
newFolder: '',
|
||||
|
||||
didReceiveAttrs() {
|
||||
let folders = this.get('folders');
|
||||
|
||||
// clear out state
|
||||
this.set('publicFolders', []);
|
||||
this.set('protectedFolders', []);
|
||||
this.set('privateFolders', []);
|
||||
|
||||
_.each(folders, folder => {
|
||||
if (folder.get('folderType') === constants.FolderType.Public) {
|
||||
let folders = this.get('publicFolders');
|
||||
folders.pushObject(folder);
|
||||
this.set('publicFolders', folders);
|
||||
}
|
||||
if (folder.get('folderType') === constants.FolderType.Private) {
|
||||
let folders = this.get('privateFolders');
|
||||
folders.pushObject(folder);
|
||||
this.set('privateFolders', folders);
|
||||
}
|
||||
if (folder.get('folderType') === constants.FolderType.Protected) {
|
||||
let folders = this.get('protectedFolders');
|
||||
folders.pushObject(folder);
|
||||
this.set('protectedFolders', folders);
|
||||
}
|
||||
});
|
||||
|
||||
this.set('hasPublicFolders', this.get('publicFolders.length') > 0);
|
||||
this.set('hasPrivateFolders', this.get('privateFolders.length') > 0);
|
||||
this.set('hasProtectedFolders', this.get('protectedFolders.length') > 0);
|
||||
},
|
||||
|
||||
actions: {
|
||||
addFolder() {
|
||||
var folderName = this.get('newFolder');
|
||||
|
||||
if (is.empty(folderName)) {
|
||||
$("#new-folder-name").addClass("error").focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
this.attrs.onFolderAdd(folderName);
|
||||
|
||||
this.set('newFolder', '');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,135 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import NotifierMixin from '../../mixins/notifier';
|
||||
|
||||
const {
|
||||
inject: { service }
|
||||
} = Ember;
|
||||
|
||||
export default Ember.Component.extend(NotifierMixin, {
|
||||
folderService: service('folder'),
|
||||
userService: service('user'),
|
||||
appMeta: service(),
|
||||
store: service(),
|
||||
|
||||
didReceiveAttrs() {
|
||||
this.get('userService').getAll().then((users) => {
|
||||
this.set('users', users);
|
||||
|
||||
var folderPermissions = [];
|
||||
|
||||
users.forEach((user) => {
|
||||
let isActive = user.get('active');
|
||||
|
||||
let u = {
|
||||
userId: user.get('id'),
|
||||
fullname: user.get('fullname'),
|
||||
orgId: this.get('folder.orgId'),
|
||||
folderId: this.get('folder.id'),
|
||||
canEdit: false,
|
||||
canView: false,
|
||||
canViewPrevious: false
|
||||
};
|
||||
|
||||
if (isActive) {
|
||||
folderPermissions.pushObject(u);
|
||||
}
|
||||
});
|
||||
|
||||
var u = {
|
||||
userId: "",
|
||||
fullname: " Everyone",
|
||||
orgId: this.get('folder.orgId'),
|
||||
folderId: this.get('folder.id'),
|
||||
canEdit: false,
|
||||
canView: false
|
||||
};
|
||||
|
||||
folderPermissions.pushObject(u);
|
||||
|
||||
this.get('folderService').getPermissions(this.get('folder.id')).then((permissions) => {
|
||||
permissions.forEach((permission, index) => { // eslint-disable-line no-unused-vars
|
||||
var folderPermission = folderPermissions.findBy('userId', permission.get('userId'));
|
||||
if (is.not.undefined(folderPermission)) {
|
||||
Ember.setProperties(folderPermission, {
|
||||
orgId: permission.get('orgId'),
|
||||
folderId: permission.get('folderId'),
|
||||
canEdit: permission.get('canEdit'),
|
||||
canView: permission.get('canView'),
|
||||
canViewPrevious: permission.get('canView')
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
folderPermissions.map((permission) => {
|
||||
let data = this.get('store').normalize('folder-permission', permission);
|
||||
return this.get('store').push(data);
|
||||
});
|
||||
|
||||
this.set('permissions', folderPermissions.sortBy('fullname'));
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
getDefaultInvitationMessage() {
|
||||
return "Hey there, I am sharing the " + this.get('folder.name') + " (in " + this.get("appMeta.title") + ") with you so we can both access the same documents.";
|
||||
},
|
||||
|
||||
actions: {
|
||||
setPermissions() {
|
||||
let message = this.getDefaultInvitationMessage();
|
||||
let folder = this.get('folder');
|
||||
let permissions = this.get('permissions');
|
||||
|
||||
this.get('permissions').forEach((permission, index) => { // eslint-disable-line no-unused-vars
|
||||
Ember.set(permission, 'canView', $("#canView-" + permission.userId).prop('checked'));
|
||||
Ember.set(permission, 'canEdit', $("#canEdit-" + permission.userId).prop('checked'));
|
||||
});
|
||||
|
||||
var data = permissions.map((obj) => {
|
||||
let permission = {
|
||||
'orgId': obj.orgId,
|
||||
'folderId': obj.folderId,
|
||||
'userId': obj.userId,
|
||||
'canEdit': obj.canEdit,
|
||||
'canView': obj.canView
|
||||
};
|
||||
|
||||
return permission;
|
||||
});
|
||||
|
||||
var payload = { Message: message, Roles: data };
|
||||
|
||||
this.get('folderService').savePermissions(folder.get('id'), payload).then(() => {
|
||||
});
|
||||
|
||||
var hasEveryone = _.find(data, function (permission) {
|
||||
return permission.userId === "" && (permission.canView || permission.canEdit);
|
||||
});
|
||||
|
||||
if (is.not.undefined(hasEveryone)) {
|
||||
folder.markAsPublic();
|
||||
} else {
|
||||
if (data.length > 1) {
|
||||
folder.markAsRestricted();
|
||||
} else {
|
||||
folder.markAsPrivate();
|
||||
}
|
||||
}
|
||||
|
||||
this.get('folderService').save(folder).then(function () {
|
||||
// window.location.href = "/folder/" + folder.get('id') + "/" + folder.get('slug');
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,74 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import NotifierMixin from '../../mixins/notifier';
|
||||
|
||||
const {
|
||||
inject: { service }
|
||||
} = Ember;
|
||||
|
||||
export default Ember.Component.extend(NotifierMixin, {
|
||||
folderService: service('folder'),
|
||||
appMeta: service(),
|
||||
inviteEmail: '',
|
||||
inviteMessage: '',
|
||||
|
||||
getDefaultInvitationMessage() {
|
||||
return "Hey there, I am sharing the " + this.folder.get('name') + " (in " + this.get("appMeta.title") + ") with you so we can both access the same documents.";
|
||||
},
|
||||
|
||||
willRender() {
|
||||
if (this.get('inviteMessage').length === 0) {
|
||||
this.set('inviteMessage', this.getDefaultInvitationMessage());
|
||||
}
|
||||
},
|
||||
|
||||
actions: {
|
||||
onShare() {
|
||||
var email = this.get('inviteEmail').trim().replace(/ /g, '');
|
||||
var message = this.get('inviteMessage').trim();
|
||||
|
||||
if (message.length === 0) {
|
||||
message = this.getDefaultInvitationMessage();
|
||||
}
|
||||
|
||||
if (email.length === 0) {
|
||||
$('#inviteEmail').addClass('error').focus();
|
||||
return;
|
||||
}
|
||||
|
||||
var result = {
|
||||
Message: message,
|
||||
Recipients: []
|
||||
};
|
||||
|
||||
// Check for multiple email addresses
|
||||
if (email.indexOf(",") > -1) {
|
||||
result.Recipients = email.split(',');
|
||||
}
|
||||
if (email.indexOf(";") > -1 && result.Recipients.length === 0) {
|
||||
result.Recipients = email.split(';');
|
||||
}
|
||||
|
||||
// Handle just one email address
|
||||
if (result.Recipients.length === 0 && email.length > 0) {
|
||||
result.Recipients.push(email);
|
||||
}
|
||||
|
||||
this.set('inviteEmail', '');
|
||||
|
||||
this.get('folderService').share(this.folder.get('id'), result).then(() => {
|
||||
this.showNotification('Shared');
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,105 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import TooltipMixin from '../../mixins/tooltip';
|
||||
import NotifierMixin from '../../mixins/notifier';
|
||||
import AuthMixin from '../../mixins/auth';
|
||||
|
||||
const {
|
||||
inject: { service }
|
||||
} = Ember;
|
||||
|
||||
export default Ember.Component.extend(TooltipMixin, NotifierMixin, AuthMixin, {
|
||||
folderService: service('folder'),
|
||||
templateService: service('template'),
|
||||
appMeta: service(),
|
||||
pinned: service(),
|
||||
publicFolders: [],
|
||||
protectedFolders: [],
|
||||
privateFolders: [],
|
||||
hasPublicFolders: false,
|
||||
hasProtectedFolders: false,
|
||||
hasPrivateFolders: false,
|
||||
newFolder: "",
|
||||
menuOpen: false,
|
||||
pinState : {
|
||||
isPinned: false,
|
||||
pinId: '',
|
||||
newName: '',
|
||||
},
|
||||
tab: '',
|
||||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
|
||||
if (is.empty(this.get('tab')) || is.undefined(this.get('tab'))) {
|
||||
this.set('tab', 'index');
|
||||
}
|
||||
},
|
||||
|
||||
didReceiveAttrs() {
|
||||
if (!this.get('noFolder')) {
|
||||
let folder = this.get('folder');
|
||||
this.set('pinState.pinId', this.get('pinned').isSpacePinned(folder.get('id')));
|
||||
this.set('pinState.isPinned', this.get('pinState.pinId') !== '');
|
||||
this.set('pinState.newName', folder.get('name').substring(0,3).toUpperCase());
|
||||
}
|
||||
},
|
||||
|
||||
actions: {
|
||||
onFolderAdd(folderName) {
|
||||
this.attrs.onFolderAdd(folderName);
|
||||
return true;
|
||||
},
|
||||
|
||||
onChangeTab(tab) {
|
||||
this.set('tab', tab);
|
||||
},
|
||||
|
||||
onMenuOpen() {
|
||||
this.set('menuOpen', !this.get('menuOpen'));
|
||||
},
|
||||
|
||||
onUnpin() {
|
||||
this.audit.record('unpinned-space');
|
||||
|
||||
this.get('pinned').unpinItem(this.get('pinState.pinId')).then(() => {
|
||||
this.set('pinState.isPinned', false);
|
||||
this.set('pinState.pinId', '');
|
||||
this.eventBus.publish('pinChange');
|
||||
});
|
||||
},
|
||||
|
||||
onPin() {
|
||||
let pin = {
|
||||
pin: this.get('pinState.newName'),
|
||||
documentId: '',
|
||||
folderId: this.get('folder.id')
|
||||
};
|
||||
|
||||
if (is.empty(pin.pin)) {
|
||||
$('#pin-space-name').addClass('error').focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
this.audit.record('pinned-space');
|
||||
|
||||
this.get('pinned').pinItem(pin).then((pin) => {
|
||||
this.set('pinState.isPinned', true);
|
||||
this.set('pinState.pinId', pin.get('id'));
|
||||
this.eventBus.publish('pinChange');
|
||||
});
|
||||
|
||||
return true;
|
||||
},
|
||||
}
|
||||
});
|
|
@ -1,157 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import NotifierMixin from '../../mixins/notifier';
|
||||
|
||||
|
||||
const {
|
||||
computed,
|
||||
} = Ember;
|
||||
export default Ember.Component.extend(NotifierMixin, {
|
||||
localStorage: Ember.inject.service(),
|
||||
appMeta: Ember.inject.service(),
|
||||
templateService: Ember.inject.service('template'),
|
||||
canEditTemplate: "",
|
||||
importedDocuments: [],
|
||||
savedTemplates: [],
|
||||
drop: null,
|
||||
newDocumentName: 'New Document',
|
||||
newDocumentNameMissing: computed.empty('newDocumentName'),
|
||||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
|
||||
this.get('templateService').getSavedTemplates().then((saved) => {
|
||||
let emptyTemplate = {
|
||||
id: "0",
|
||||
title: "Empty",
|
||||
description: "An empty canvas for your words",
|
||||
layout: "doc",
|
||||
locked: true
|
||||
};
|
||||
|
||||
saved.unshiftObject(emptyTemplate);
|
||||
this.set('savedTemplates', saved);
|
||||
});
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
this.setupImport();
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
if (is.not.null(this.get('drop'))) {
|
||||
this.get('drop').destroy();
|
||||
this.set('drop', null);
|
||||
}
|
||||
},
|
||||
|
||||
setupImport() {
|
||||
// already done init?
|
||||
if (is.not.null(this.get('drop'))) {
|
||||
this.get('drop').destroy();
|
||||
this.set('drop', null);
|
||||
}
|
||||
|
||||
let self = this;
|
||||
let folderId = this.get('folder.id');
|
||||
let url = this.get('appMeta.endpoint');
|
||||
let importUrl = `${url}/import/folder/${folderId}`;
|
||||
|
||||
let dzone = new Dropzone("#import-document-button", {
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + self.get('session.session.content.authenticated.token')
|
||||
},
|
||||
url: importUrl,
|
||||
method: "post",
|
||||
paramName: 'attachment',
|
||||
acceptedFiles: ".doc,.docx,.txt,.md,.markdown",
|
||||
clickable: true,
|
||||
maxFilesize: 10,
|
||||
parallelUploads: 3,
|
||||
uploadMultiple: false,
|
||||
addRemoveLinks: false,
|
||||
autoProcessQueue: true,
|
||||
|
||||
init: function () {
|
||||
this.on("success", function (document) {
|
||||
self.send('onDocumentImported', document.name, document);
|
||||
});
|
||||
|
||||
this.on("error", function (x) {
|
||||
console.log("Conversion failed for ", x.name, " obj ", x); // eslint-disable-line no-console
|
||||
});
|
||||
|
||||
this.on("queuecomplete", function () {});
|
||||
|
||||
this.on("addedfile", function (file) {
|
||||
self.send('onDocumentImporting', file.name);
|
||||
self.audit.record('converted-document');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
dzone.on("complete", function (file) {
|
||||
dzone.removeFile(file);
|
||||
});
|
||||
|
||||
this.set('drop', dzone);
|
||||
},
|
||||
|
||||
actions: {
|
||||
onHideDocumentWizard() {
|
||||
this.get('onHideDocumentWizard')();
|
||||
},
|
||||
|
||||
editTemplate(template) {
|
||||
this.audit.record('edited-saved-template');
|
||||
this.get('router').transitionTo('document', this.get('folder.id'), this.get('folder.slug'), template.get('id'), template.get('slug'));
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
startDocument(template) {
|
||||
this.audit.record('used-saved-template');
|
||||
this.send("showNotification", "Creating");
|
||||
|
||||
this.get('templateService').importSavedTemplate(this.folder.get('id'), template.id, this.get('newDocumentName')).then((document) => {
|
||||
this.get('router').transitionTo('document', this.get('folder.id'), this.get('folder.slug'), document.get('id'), document.get('slug'));
|
||||
});
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
onDocumentImporting(filename) {
|
||||
this.send("showNotification", `Importing ${filename}`);
|
||||
this.get('onHideDocumentWizard')();
|
||||
|
||||
let documents = this.get('importedDocuments');
|
||||
documents.push(filename);
|
||||
this.set('importedDocuments', documents);
|
||||
},
|
||||
|
||||
onDocumentImported(filename /*, document*/ ) {
|
||||
this.send("showNotification", `${filename} ready`);
|
||||
|
||||
let documents = this.get('importedDocuments');
|
||||
documents.pop(filename);
|
||||
this.set('importedDocuments', documents);
|
||||
|
||||
this.get('onImport')();
|
||||
|
||||
if (documents.length === 0) {
|
||||
// this.get('showDocument')(this.get('folder'), document);
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
const {
|
||||
computed,
|
||||
isEmpty
|
||||
} = Ember;
|
||||
|
||||
export default Ember.Component.extend({
|
||||
email: "",
|
||||
sayThanks: false,
|
||||
emailEmpty: computed.empty('email'),
|
||||
hasEmptyEmailError: computed.and('emailEmpty', 'emailIsEmpty'),
|
||||
|
||||
actions: {
|
||||
forgot() {
|
||||
let email = this.get('email');
|
||||
|
||||
if (isEmpty(email)) {
|
||||
Ember.set(this, 'emailIsEmpty', true);
|
||||
return $("#email").focus();
|
||||
}
|
||||
|
||||
this.get('forgot')(email).then(() => {
|
||||
Ember.set(this, 'sayThanks', true);
|
||||
Ember.set(this, 'email', '');
|
||||
Ember.set(this, 'emailIsEmpty', false);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,15 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
});
|
|
@ -1,27 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import NotifierMixin from '../../mixins/notifier';
|
||||
|
||||
const {
|
||||
inject: { service }
|
||||
} = Ember;
|
||||
|
||||
export default Ember.Component.extend(NotifierMixin, {
|
||||
appMeta :service(),
|
||||
|
||||
didRender() {
|
||||
if (this.get('appMeta').invalidLicense()) {
|
||||
this.showNotification(`!! Expired or invalid license !!`);
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,27 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import NotifierMixin from '../../mixins/notifier';
|
||||
|
||||
const {
|
||||
inject: { service }
|
||||
} = Ember;
|
||||
|
||||
export default Ember.Component.extend(NotifierMixin, {
|
||||
appMeta :service(),
|
||||
|
||||
didRender() {
|
||||
if (this.get('appMeta').invalidLicense()) {
|
||||
this.showNotification(`!! Expired or invalid license !!`);
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,166 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import netUtil from '../../utils/net';
|
||||
import constants from '../../utils/constants';
|
||||
import TooltipMixin from '../../mixins/tooltip';
|
||||
|
||||
const {
|
||||
inject: { service }
|
||||
} = Ember;
|
||||
|
||||
export default Ember.Component.extend(TooltipMixin, {
|
||||
folderService: service('folder'),
|
||||
appMeta: service(),
|
||||
session: service(),
|
||||
store: service(),
|
||||
folder: null,
|
||||
view: {
|
||||
folder: false,
|
||||
search: false,
|
||||
settings: false,
|
||||
profile: false
|
||||
},
|
||||
pinned: service(),
|
||||
pins: [],
|
||||
enableLogout: true,
|
||||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
|
||||
if (this.get("session.authenticated") && this.get("session.user.id") !== '0') {
|
||||
this.get("session.accounts").forEach((account) => {
|
||||
// TODO: do not mutate account.active here
|
||||
account.active = account.orgId === this.get("appMeta.orgId");
|
||||
});
|
||||
}
|
||||
|
||||
this.set('pins', this.get('pinned').get('pins'));
|
||||
|
||||
if (this.get('appMeta.authProvider') === constants.AuthProvider.Keycloak) {
|
||||
let config = this.get('appMeta.authConfig');
|
||||
config = JSON.parse(config);
|
||||
this.set('enableLogout', !config.disableLogout);
|
||||
}
|
||||
},
|
||||
|
||||
didReceiveAttrs() {
|
||||
if (this.get('folder') === null) {
|
||||
this.set("folder", this.get('folderService.currentFolder'));
|
||||
}
|
||||
|
||||
let route = this.get('router.currentRouteName');
|
||||
this.set('view.folder', (is.startWith(route, 'folder')) ? true : false);
|
||||
this.set('view.settings', (is.startWith(route, 'customize')) ? true : false);
|
||||
this.set('view.profile', (route === 'profile') ? true : false);
|
||||
this.set('view.search', (route === 'search') ? true : false);
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
this._super(...arguments);
|
||||
|
||||
// Size the pinned items zone
|
||||
if (this.get("session.authenticated")) {
|
||||
this.eventBus.subscribe('resized', this, 'sizePinnedZone');
|
||||
this.eventBus.subscribe('pinChange', this, 'setupPins');
|
||||
this.sizePinnedZone();
|
||||
this.setupPins();
|
||||
|
||||
let self = this;
|
||||
|
||||
var sortable = Sortable.create(document.getElementById('pinned-zone'), {
|
||||
animation: 150,
|
||||
onEnd: function () {
|
||||
self.audit.record('reorganized-pins');
|
||||
|
||||
self.get('pinned').updateSequence(this.toArray()).then((pins) => {
|
||||
self.set('pins', pins);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this.set('sortable', sortable);
|
||||
}
|
||||
},
|
||||
|
||||
didRender() {
|
||||
if (this.get('session.isAdmin')) {
|
||||
this.addTooltip(document.getElementById("workspace-settings"));
|
||||
}
|
||||
if (this.get("session.authenticated") && this.get('enableLogout')) {
|
||||
this.addTooltip(document.getElementById("workspace-logout"));
|
||||
} else {
|
||||
this.addTooltip(document.getElementById("workspace-login"));
|
||||
}
|
||||
},
|
||||
|
||||
setupPins() {
|
||||
if (this.get('isDestroyed') || this.get('isDestroying')) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.get('pinned').getUserPins().then((pins) => {
|
||||
if (this.get('isDestroyed') || this.get('isDestroying')) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.set('pins', pins);
|
||||
|
||||
pins.forEach((pin) => {
|
||||
this.addTooltip(document.getElementById(`pin-${pin.id}`));
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
// set height for pinned zone so ti scrolls on spill
|
||||
sizePinnedZone() {
|
||||
let topofBottomZone = parseInt($('#bottom-zone').css("top").replace("px", ""));
|
||||
let heightOfTopZone = parseInt($('#top-zone').css("height").replace("px", ""));
|
||||
let size = topofBottomZone - heightOfTopZone - 40;
|
||||
$('#pinned-zone').css('height', size + "px");
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
let sortable = this.get('sortable');
|
||||
|
||||
if (!_.isUndefined(sortable)) {
|
||||
sortable.destroy();
|
||||
}
|
||||
|
||||
this.eventBus.unsubscribe('resized');
|
||||
this.eventBus.unsubscribe('pinChange');
|
||||
|
||||
this.destroyTooltips();
|
||||
},
|
||||
|
||||
actions: {
|
||||
switchAccount(domain) {
|
||||
this.audit.record('switched-account');
|
||||
window.location.href = netUtil.getAppUrl(domain);
|
||||
},
|
||||
|
||||
jumpToPin(pin) {
|
||||
let folderId = pin.get('folderId');
|
||||
let documentId = pin.get('documentId');
|
||||
|
||||
if (_.isEmpty(documentId)) {
|
||||
// jump to space
|
||||
let folder = this.get('store').peekRecord('folder', folderId);
|
||||
this.get('router').transitionTo('folder', folderId, folder.get('slug'));
|
||||
} else {
|
||||
// jump to doc
|
||||
let folder = this.get('store').peekRecord('folder', folderId);
|
||||
this.get('router').transitionTo('document', folderId, folder.get('slug'), documentId, 'document');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,15 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
});
|
|
@ -1,124 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import encodingUtil from '../../utils/encoding';
|
||||
import netUtil from '../../utils/net';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
folderService: Ember.inject.service('folder'),
|
||||
|
||||
serial: "",
|
||||
folderId: "",
|
||||
slug: "",
|
||||
processing: false,
|
||||
|
||||
didRender() {
|
||||
let self = this;
|
||||
|
||||
$("#stage-1-firstname").focus();
|
||||
|
||||
// Stage 1 - person name keypress handler
|
||||
$("#stage-1-firstname, #stage-1-lastname").keyup(function() {
|
||||
if (!$("#stage-1-firstname").val() || !$("#stage-1-lastname").val()) {
|
||||
$(".name-status").attr("src", "/assets/img/onboard/person-red.png");
|
||||
} else {
|
||||
$(".name-status").attr("src", "/assets/img/onboard/person-green.png");
|
||||
}
|
||||
});
|
||||
|
||||
// Stage 1 - finish
|
||||
$("#stage-1-next").off('click').on('click', function() {
|
||||
if (!$("#stage-1-firstname").val()) {
|
||||
$("#stage-1-firstname").focus();
|
||||
$("#stage-1-firstname").addClass("error");
|
||||
$(".name-status").attr("src", "/assets/img/onboard/person-red.png");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$("#stage-1-lastname").val()) {
|
||||
$("#stage-1-lastname").focus();
|
||||
$("#stage-1-lastname").addClass("error");
|
||||
$(".name-status").attr("src", "/assets/img/onboard/person-red.png");
|
||||
return;
|
||||
}
|
||||
|
||||
self.set('processing', false);
|
||||
|
||||
$(".stage-1").fadeOut("slow", function() {
|
||||
if (self.get('processing')) {
|
||||
return;
|
||||
}
|
||||
|
||||
self.set('processing', true);
|
||||
|
||||
$(".stage-2").fadeIn();
|
||||
$("#stage-2-password").focus();
|
||||
|
||||
// Stage 2 - password keypress handler
|
||||
$("#stage-2-password-confirm").keyup(function() {
|
||||
if ($("#stage-2-password").val().length < 6 || $("#stage-2-password").val().length > 50 ||
|
||||
($("#stage-2-password").val() !== $("#stage-2-password-confirm").val())) {
|
||||
$(".password-status").attr("src", "/assets/img/onboard/lock-red.png");
|
||||
} else {
|
||||
$(".password-status").attr("src", "/assets/img/onboard/lock-green.png");
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Stage 2 - finish
|
||||
$("#stage-2-next").off('click').on('click', function() {
|
||||
if (!$("#stage-2-password").val() || $("#stage-2-password").val().length < 6 || $("#stage-2-password").val().length > 50) {
|
||||
$("#stage-2-password").focus();
|
||||
$("#stage-2-password").addClass("error");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$("#stage-2-password-confirm").val()) {
|
||||
$("#stage-2-password-confirm").focus();
|
||||
$("#stage-2-password-confirm").addClass("error");
|
||||
return;
|
||||
}
|
||||
|
||||
if ($("#stage-2-password-confirm").val() !== $("#stage-2-password").val()) {
|
||||
$(".mismatch").show();
|
||||
$(".password-status").attr("src", "/assets/img/onboard/lock-red.png");
|
||||
return;
|
||||
}
|
||||
|
||||
self.set('processing', false);
|
||||
|
||||
$(".stage-2").fadeOut("slow", function() {
|
||||
if (self.get('processing')) {
|
||||
return;
|
||||
}
|
||||
|
||||
self.set('processing', true);
|
||||
|
||||
$(".stage-3").fadeIn();
|
||||
$("#spinner-1").show();
|
||||
|
||||
var payload = '{ "Password": "' + $("#stage-2-password").val() + '", "Serial": "' + self.serial + '", "Firstname": "' + $("#stage-1-firstname").val() + '", "Lastname": "' + $("#stage-1-lastname").val() + '" }';
|
||||
var password = $("#stage-2-password").val();
|
||||
|
||||
self.get('folderService').onboard(self.folderId, payload).then(function(user) {
|
||||
var credentials = encodingUtil.Base64.encode(netUtil.getSubdomain() + ":" + user.email + ":" + password);
|
||||
self.session.sso(credentials).then(function() {
|
||||
window.location.href = 's/' + self.folderId + "/" + self.slug;
|
||||
});
|
||||
}, function() {
|
||||
window.location.href = "/";
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
});
|
|
@ -1,59 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
const {
|
||||
isEmpty,
|
||||
isEqual,
|
||||
computed,
|
||||
set
|
||||
|
||||
} = Ember;
|
||||
|
||||
export default Ember.Component.extend({
|
||||
password: "",
|
||||
passwordConfirm: "",
|
||||
mustMatch: false,
|
||||
passwordEmpty: computed.empty('password'),
|
||||
confirmEmpty: computed.empty('passwordConfirm'),
|
||||
hasPasswordError: computed.and('passwordEmpty', 'passwordIsEmpty'),
|
||||
hasConfirmError: computed.and('confirmEmpty', 'passwordConfirmIsEmpty'),
|
||||
|
||||
actions: {
|
||||
reset() {
|
||||
let password = this.get('password');
|
||||
let passwordConfirm = this.get('passwordConfirm');
|
||||
|
||||
if (isEmpty(password)) {
|
||||
set(this, 'passwordIsEmpty', true);
|
||||
return $("#newPassword").focus();
|
||||
}
|
||||
|
||||
if (isEmpty(passwordConfirm)) {
|
||||
set(this, 'passwordConfirmIsEmpty', true);
|
||||
return $("#passwordConfirm").focus();
|
||||
}
|
||||
|
||||
if (!isEqual(password, passwordConfirm)) {
|
||||
set(this, 'hasPasswordError', true);
|
||||
set(this, 'hasConfirmError', true);
|
||||
set(this, 'mustMatch', true);
|
||||
return;
|
||||
}
|
||||
|
||||
this.get('reset')(password).then(() => {
|
||||
set(this, 'passwordIsEmpty', false);
|
||||
set(this, 'passwordConfirmIsEmpty', false);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,54 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
results: [],
|
||||
resultPhrase: "",
|
||||
|
||||
didReceiveAttrs() {
|
||||
let results = this.get('results');
|
||||
let temp = _.groupBy(results, 'documentId');
|
||||
let documents = [];
|
||||
|
||||
_.each(temp, function (document) {
|
||||
let refs = [];
|
||||
|
||||
if (document.length > 1) {
|
||||
refs = document.slice(1);
|
||||
}
|
||||
|
||||
_.each(refs, function (ref, index) {
|
||||
ref.comma = index === refs.length - 1 ? "" : ", ";
|
||||
});
|
||||
|
||||
let hasRefs = refs.length > 0;
|
||||
|
||||
documents.pushObject({
|
||||
doc: document[0],
|
||||
ref: refs,
|
||||
hasReferences: hasRefs
|
||||
});
|
||||
});
|
||||
|
||||
let phrase = 'Nothing found';
|
||||
|
||||
if (results.length > 0) {
|
||||
let references = results.length === 1 ? "reference" : "references";
|
||||
let i = results.length;
|
||||
phrase = `${i} ${references}`;
|
||||
}
|
||||
|
||||
this.set('resultPhrase', phrase);
|
||||
this.set('documents', documents);
|
||||
}
|
||||
});
|
|
@ -1,34 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
documentTags: [],
|
||||
tagz: [],
|
||||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
|
||||
let tagz = [];
|
||||
|
||||
if (this.get('documentTags').length > 1) {
|
||||
let tags = this.get('documentTags').split('#');
|
||||
_.each(tags, function(tag) {
|
||||
if (tag.length > 0) {
|
||||
tagz.pushObject(tag);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.set('tagz', tagz);
|
||||
}
|
||||
});
|
|
@ -1,39 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
data: "",
|
||||
|
||||
didReceiveAttrs() {
|
||||
this.set("data", this.get("meta.rawBody"));
|
||||
},
|
||||
|
||||
actions: {
|
||||
isDirty() {
|
||||
return this.get('meta.rawBody') !== this.get('data');
|
||||
},
|
||||
|
||||
onCancel() {
|
||||
this.attrs.onCancel();
|
||||
},
|
||||
|
||||
onAction(title) {
|
||||
let page = this.get('page');
|
||||
let meta = this.get('meta');
|
||||
page.set('title', title);
|
||||
meta.set('rawBody', this.get("data"));
|
||||
|
||||
this.attrs.onAction(page, meta);
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,14 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({});
|
|
@ -1,143 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
const {
|
||||
computed,
|
||||
} = Ember;
|
||||
|
||||
|
||||
export default Ember.Component.extend({
|
||||
drop: null,
|
||||
busy: false,
|
||||
mousetrap: null,
|
||||
hasNameError: computed.empty('page.title'),
|
||||
containerId: Ember.computed('page', function () {
|
||||
let page = this.get('page');
|
||||
return `base-editor-inline-container-${page.id}`;
|
||||
}),
|
||||
pageId: Ember.computed('page', function () {
|
||||
let page = this.get('page');
|
||||
return `page-editor-${page.id}`;
|
||||
}),
|
||||
cancelId: Ember.computed('page', function () {
|
||||
let page = this.get('page');
|
||||
return `cancel-edits-button-${page.id}`;
|
||||
}),
|
||||
dialogId: Ember.computed('page', function () {
|
||||
let page = this.get('page');
|
||||
return `discard-edits-dialog-${page.id}`;
|
||||
}),
|
||||
contentLinkerButtonId: Ember.computed('page', function () {
|
||||
let page = this.get('page');
|
||||
return `content-linker-button-${page.id}`;
|
||||
}),
|
||||
previewButtonId: Ember.computed('page', function () {
|
||||
let page = this.get('page');
|
||||
return `content-preview-button-${page.id}`;
|
||||
}),
|
||||
|
||||
didRender() {
|
||||
let msContainer = document.getElementById(this.get('containerId'));
|
||||
let mousetrap = this.get('mousetrap');
|
||||
|
||||
if (is.null(mousetrap)) {
|
||||
mousetrap = new Mousetrap(msContainer);
|
||||
}
|
||||
|
||||
mousetrap.bind('esc', () => {
|
||||
this.send('onCancel');
|
||||
return false;
|
||||
});
|
||||
mousetrap.bind(['ctrl+s', 'command+s'], () => {
|
||||
this.send('onAction');
|
||||
return false;
|
||||
});
|
||||
|
||||
this.set('mousetrap', mousetrap);
|
||||
|
||||
$('#' + this.get('pageId')).focus(function() {
|
||||
$(this).select();
|
||||
});
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
let drop = this.get('drop');
|
||||
if (is.not.null(drop)) {
|
||||
drop.destroy();
|
||||
}
|
||||
|
||||
let mousetrap = this.get('mousetrap');
|
||||
if (is.not.null(mousetrap)) {
|
||||
mousetrap.unbind('esc');
|
||||
mousetrap.unbind(['ctrl+s', 'command+s']);
|
||||
}
|
||||
},
|
||||
|
||||
actions: {
|
||||
onCancel() {
|
||||
if (this.attrs.isDirty() !== null && this.attrs.isDirty()) {
|
||||
$('#' + this.get('dialogId')).css("display", "block");
|
||||
|
||||
let drop = new Drop({
|
||||
target: $('#' + this.get('cancelId'))[0],
|
||||
content: $('#' + this.get('dialogId'))[0],
|
||||
classes: 'drop-theme-basic',
|
||||
position: "bottom right",
|
||||
openOn: "always",
|
||||
constrainToWindow: true,
|
||||
constrainToScrollParent: false,
|
||||
tetherOptions: {
|
||||
offset: "5px 0",
|
||||
targetOffset: "10px 0"
|
||||
},
|
||||
remove: false
|
||||
});
|
||||
|
||||
this.set('drop', drop);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
this.attrs.onCancel();
|
||||
},
|
||||
|
||||
onAction() {
|
||||
if (this.get('busy') || is.empty(this.get('page.title'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.get('isDestroyed') || this.get('isDestroying')) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.attrs.onAction(this.get('page.title'));
|
||||
},
|
||||
|
||||
keepEditing() {
|
||||
let drop = this.get('drop');
|
||||
drop.close();
|
||||
},
|
||||
|
||||
discardEdits() {
|
||||
this.attrs.onCancel();
|
||||
},
|
||||
|
||||
onInsertLink(selection) {
|
||||
return this.get('onInsertLink')(selection);
|
||||
},
|
||||
|
||||
onPreview() {
|
||||
return this.get('onPreview')();
|
||||
},
|
||||
}
|
||||
});
|
|
@ -1,107 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
drop: null,
|
||||
cancelLabel: "Close",
|
||||
actionLabel: "Save",
|
||||
tip: "Short and concise title",
|
||||
busy: false,
|
||||
hasExcerpt: Ember.computed('page', function () {
|
||||
return is.not.undefined(this.get('page.excerpt'));
|
||||
}),
|
||||
|
||||
didRender() {
|
||||
let self = this;
|
||||
Mousetrap.bind('esc', function () {
|
||||
self.send('onCancel');
|
||||
return false;
|
||||
});
|
||||
Mousetrap.bind(['ctrl+s', 'command+s'], function () {
|
||||
self.send('onAction');
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#page-title").removeClass("error");
|
||||
$("#page-excerpt").removeClass("error");
|
||||
|
||||
$("#page-title").focus(function() {
|
||||
$(this).select();
|
||||
});
|
||||
$("#page-excerpt").focus(function() {
|
||||
$(this).select();
|
||||
});
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
let drop = this.get('drop');
|
||||
|
||||
if (is.not.null(drop)) {
|
||||
drop.destroy();
|
||||
}
|
||||
},
|
||||
|
||||
actions: {
|
||||
onCancel() {
|
||||
if (this.attrs.isDirty() !== null && this.attrs.isDirty()) {
|
||||
$(".discard-edits-dialog").css("display", "block");
|
||||
|
||||
let drop = new Drop({
|
||||
target: $("#editor-cancel")[0],
|
||||
content: $(".cancel-edits-dialog")[0],
|
||||
classes: 'drop-theme-basic',
|
||||
position: "bottom right",
|
||||
openOn: "always",
|
||||
tetherOptions: {
|
||||
offset: "5px 0",
|
||||
targetOffset: "10px 0"
|
||||
},
|
||||
remove: false
|
||||
});
|
||||
|
||||
this.set('drop', drop);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
this.attrs.onCancel();
|
||||
},
|
||||
|
||||
onAction() {
|
||||
if (this.get('busy')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (is.empty(this.get('page.title'))) {
|
||||
$("#page-title").addClass("error").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.get('hasExcerpt') && is.empty(this.get('page.excerpt'))) {
|
||||
$("#page-excerpt").addClass("error").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
this.attrs.onAction(this.get('page.title'));
|
||||
},
|
||||
|
||||
keepEditing() {
|
||||
let drop = this.get('drop');
|
||||
drop.close();
|
||||
},
|
||||
|
||||
discardEdits() {
|
||||
this.attrs.onCancel();
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,143 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import TooltipMixin from '../../../mixins/tooltip';
|
||||
|
||||
export default Ember.Component.extend(TooltipMixin, {
|
||||
isDirty: false,
|
||||
pageBody: "",
|
||||
syntaxOptions: [],
|
||||
codeSyntax: null,
|
||||
codeEditor: null,
|
||||
editorId: Ember.computed('page', function () {
|
||||
let page = this.get('page');
|
||||
return `code-editor-${page.id}`;
|
||||
}),
|
||||
syntaxId: Ember.computed('page', function () {
|
||||
let page = this.get('page');
|
||||
return `code-editor-syntax-${page.id}`;
|
||||
}),
|
||||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
|
||||
let self = this;
|
||||
let rawBody = this.get('meta.rawBody');
|
||||
let cleanBody = rawBody.replace("</pre>", "");
|
||||
|
||||
cleanBody = cleanBody.replace('<pre class="code-mirror cm-s-solarized cm-s-dark" data-lang="', "");
|
||||
let startPos = cleanBody.indexOf('">');
|
||||
let syntax = {
|
||||
mode: "htmlmixed",
|
||||
name: "HTML"
|
||||
};
|
||||
|
||||
if (startPos !== -1) {
|
||||
syntax = cleanBody.substring(0, startPos);
|
||||
cleanBody = cleanBody.substring(startPos + 2);
|
||||
}
|
||||
|
||||
this.set('pageBody', cleanBody);
|
||||
|
||||
let opts = [];
|
||||
|
||||
_.each(_.sortBy(CodeMirror.modeInfo, 'name'), function(item) {
|
||||
let i = { mode: item.mode, name: item.name };
|
||||
opts.pushObject(i);
|
||||
|
||||
if (item.mode === syntax) {
|
||||
self.set('codeSyntax', i);
|
||||
}
|
||||
});
|
||||
|
||||
this.set('syntaxOptions', opts);
|
||||
|
||||
// default check
|
||||
if (is.null(this.get("codeSyntax"))) {
|
||||
this.set("codeSyntax", opts.findBy("mode", "htmlmixed"));
|
||||
}
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById(this.get('editorId')), {
|
||||
theme: "material",
|
||||
lineNumbers: true,
|
||||
lineWrapping: true,
|
||||
indentUnit: 4,
|
||||
tabSize: 4,
|
||||
value: "",
|
||||
dragDrop: false
|
||||
});
|
||||
|
||||
CodeMirror.commands.save = function(/*instance*/){
|
||||
Mousetrap.trigger('ctrl+s');
|
||||
};
|
||||
|
||||
this.set('codeEditor', editor);
|
||||
|
||||
let syntax = this.get("codeSyntax");
|
||||
if (is.not.undefined(syntax)) {
|
||||
CodeMirror.autoLoadMode(editor, syntax.mode);
|
||||
editor.setOption("mode", syntax.mode);
|
||||
}
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
let editor = this.get('codeEditor');
|
||||
|
||||
if (is.not.null(editor)) {
|
||||
editor.toTextArea();
|
||||
editor = null;
|
||||
this.set('codeEditor', null);
|
||||
}
|
||||
|
||||
this.destroyTooltips();
|
||||
|
||||
},
|
||||
|
||||
// Wrap code in PRE tag with language identifier for subsequent rendering.
|
||||
getPRE() {
|
||||
let codeSyntax = this.get("codeSyntax.mode");
|
||||
let body = this.get('codeEditor').getDoc().getValue();
|
||||
|
||||
return `<pre class="code-mirror cm-s-solarized cm-s-dark" data-lang="${codeSyntax}">${body}</pre>`;
|
||||
},
|
||||
|
||||
actions: {
|
||||
onSyntaxChange(syntax) {
|
||||
let editor = this.get('codeEditor');
|
||||
CodeMirror.autoLoadMode(editor, syntax.mode);
|
||||
editor.setOption("mode", syntax.mode);
|
||||
|
||||
this.set('isDirty', true);
|
||||
this.set('codeSyntax', syntax);
|
||||
},
|
||||
|
||||
isDirty() {
|
||||
return this.get('isDirty') || (this.get('codeEditor').getDoc().isClean() === false);
|
||||
},
|
||||
|
||||
onCancel() {
|
||||
this.attrs.onCancel();
|
||||
},
|
||||
|
||||
onAction(title) {
|
||||
let page = this.get('page');
|
||||
let meta = this.get('meta');
|
||||
meta.set('rawBody', this.getPRE());
|
||||
page.set('title', title);
|
||||
page.set('body', meta.get('rawBody'));
|
||||
|
||||
this.attrs.onAction(page, meta);
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,85 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
codeBody: "",
|
||||
codeSyntax: "htmlmixed",
|
||||
|
||||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
|
||||
if (this.get('isDestroyed') || this.get('isDestroying')) {
|
||||
return;
|
||||
}
|
||||
|
||||
let page = this.get('page');
|
||||
let rawBody = page.get('body');
|
||||
let cleanBody = rawBody.replace("</pre>", "").replace('<pre class="code-mirror cm-s-solarized cm-s-dark" data-lang="', "");
|
||||
let startPos = cleanBody.indexOf('">');
|
||||
|
||||
if (startPos !== -1) {
|
||||
this.set('codeSyntax', cleanBody.substring(0, startPos));
|
||||
this.set('codeBody', cleanBody.substring(startPos + 2));
|
||||
}
|
||||
|
||||
_.each(_.sortBy(CodeMirror.modeInfo, 'name'), (item) => {
|
||||
let i = { mode: item.mode, name: item.name };
|
||||
|
||||
if (item.mode === this.get('codeSyntax')) {
|
||||
this.set('codeSyntax', i);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
this._super(...arguments);
|
||||
|
||||
if (this.get('isDestroyed') || this.get('isDestroying')) {
|
||||
return;
|
||||
}
|
||||
|
||||
let page = this.get('page');
|
||||
let elem = `page-${page.id}-code`;
|
||||
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById(elem), {
|
||||
theme: "material",
|
||||
lineNumbers: true,
|
||||
lineWrapping: true,
|
||||
indentUnit: 4,
|
||||
tabSize: 4,
|
||||
value: "",
|
||||
dragDrop: false,
|
||||
readOnly: true
|
||||
});
|
||||
|
||||
this.set('codeEditor', editor);
|
||||
|
||||
let syntax = this.get("codeSyntax");
|
||||
if (is.not.undefined(syntax)) {
|
||||
CodeMirror.autoLoadMode(editor, syntax.mode);
|
||||
editor.setOption("mode", syntax.mode);
|
||||
}
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
this._super(...arguments);
|
||||
|
||||
let editor = this.get('codeEditor');
|
||||
if (is.not.null(editor)) {
|
||||
editor.toTextArea();
|
||||
editor = null;
|
||||
}
|
||||
|
||||
this.set('codeEditor', null);
|
||||
}
|
||||
});
|
|
@ -1,228 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import NotifierMixin from '../../../mixins/notifier';
|
||||
import TooltipMixin from '../../../mixins/tooltip';
|
||||
import SectionMixin from '../../../mixins/section';
|
||||
|
||||
export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin, {
|
||||
sectionService: Ember.inject.service('section'),
|
||||
isDirty: false,
|
||||
waiting: false,
|
||||
authenticated: false,
|
||||
user: {},
|
||||
workspaces: [],
|
||||
config: {},
|
||||
|
||||
didReceiveAttrs() {
|
||||
let config = {};
|
||||
|
||||
try {
|
||||
config = JSON.parse(this.get('meta.config'));
|
||||
} catch (e) {} // eslint-disable-line no-empty
|
||||
|
||||
if (is.empty(config)) {
|
||||
config = {
|
||||
APIKey: "",
|
||||
filter: {},
|
||||
itemCount: 0,
|
||||
url: "",
|
||||
userId: 0,
|
||||
username: "",
|
||||
workspaceId: 0,
|
||||
workspaceName: "",
|
||||
};
|
||||
}
|
||||
|
||||
this.set('config', config);
|
||||
|
||||
let self = this;
|
||||
self.set('waiting', true);
|
||||
this.get('sectionService').fetch(this.get('page'), "secrets", this.get('config'))
|
||||
.then(function (response) {
|
||||
self.set('waiting', false);
|
||||
self.set('config.APIKey', response.apikey);
|
||||
self.set('config.url', response.url);
|
||||
self.set('config.username', response.username);
|
||||
|
||||
if (response.apikey.length > 0 && response.url.length > 0 && response.username.length > 0) {
|
||||
self.send('auth');
|
||||
}
|
||||
}, function (reason) { // eslint-disable-line no-unused-vars
|
||||
self.set('waiting', false);
|
||||
if (self.get('config.userId') > 0) {
|
||||
self.send('auth');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
this.destroyTooltips();
|
||||
},
|
||||
|
||||
getWorkspaces() {
|
||||
let page = this.get('page');
|
||||
let self = this;
|
||||
this.set('waiting', true);
|
||||
|
||||
this.get('sectionService').fetch(page, "workspace", this.get('config'))
|
||||
.then(function (response) {
|
||||
// console.log(response);
|
||||
let workspaceId = self.get('config.workspaceId');
|
||||
|
||||
if (response.length > 0 && workspaceId === 0) {
|
||||
workspaceId = response[0].Id;
|
||||
}
|
||||
|
||||
self.set("config.workspaceId", workspaceId);
|
||||
self.set('workspaces', response);
|
||||
self.selectWorkspace(workspaceId);
|
||||
|
||||
Ember.run.schedule('afterRender', function () {
|
||||
window.scrollTo(0, document.body.scrollHeight);
|
||||
|
||||
response.forEach(function (workspace) {
|
||||
self.addTooltip(document.getElementById("gemini-workspace-" + workspace.Id));
|
||||
});
|
||||
});
|
||||
self.set('waiting', false);
|
||||
}, function (reason) { // eslint-disable-line no-unused-vars
|
||||
self.set('workspaces', []);
|
||||
self.set('waiting', false);
|
||||
});
|
||||
},
|
||||
|
||||
getItems() {
|
||||
let page = this.get('page');
|
||||
let self = this;
|
||||
|
||||
this.set('waiting', true);
|
||||
|
||||
this.get('sectionService').fetch(page, "items", this.get('config'))
|
||||
.then(function (response) {
|
||||
if (self.get('isDestroyed') || self.get('isDestroying')) {
|
||||
return;
|
||||
}
|
||||
self.set('items', response);
|
||||
self.set('config.itemCount', response.length);
|
||||
self.set('waiting', false);
|
||||
}, function (reason) { // eslint-disable-line no-unused-vars
|
||||
if (self.get('isDestroyed') || self.get('isDestroying')) {
|
||||
return;
|
||||
}
|
||||
self.set('items', []);
|
||||
self.set('waiting', false);
|
||||
});
|
||||
},
|
||||
|
||||
selectWorkspace(id) {
|
||||
let self = this;
|
||||
let w = this.get('workspaces');
|
||||
|
||||
w.forEach(function (w) {
|
||||
Ember.set(w, 'selected', w.Id === id);
|
||||
|
||||
if (w.Id === id) {
|
||||
self.set("config.filter", w.Filter);
|
||||
self.set("config.workspaceId", id);
|
||||
self.set("config.workspaceName", w.Title);
|
||||
// console.log(self.get('config'));
|
||||
}
|
||||
});
|
||||
|
||||
this.set('workspaces', w);
|
||||
this.getItems();
|
||||
},
|
||||
|
||||
actions: {
|
||||
isDirty() {
|
||||
return this.get('isDirty');
|
||||
},
|
||||
|
||||
auth() {
|
||||
// missing data?
|
||||
if (is.empty(this.get('config.url'))) {
|
||||
$("#gemini-url").addClass("error").focus();
|
||||
return;
|
||||
}
|
||||
if (is.empty(this.get('config.username'))) {
|
||||
$("#gemini-username").addClass("error").focus();
|
||||
return;
|
||||
}
|
||||
if (is.empty(this.get('config.APIKey'))) {
|
||||
$("#gemini-apikey").addClass("error").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
// knock out spaces
|
||||
this.set('config.url', this.get('config.url').trim());
|
||||
this.set('config.username', this.get('config.username').trim());
|
||||
this.set('config.APIKey', this.get('config.APIKey').trim());
|
||||
|
||||
// remove trailing slash in URL
|
||||
let url = this.get('config.url');
|
||||
if (url.indexOf("/", url.length - 1) !== -1) {
|
||||
this.set('config.url', url.substring(0, url.length - 1));
|
||||
}
|
||||
|
||||
let page = this.get('page');
|
||||
let self = this;
|
||||
|
||||
this.set('waiting', true);
|
||||
|
||||
this.get('sectionService').fetch(page, "auth", this.get('config'))
|
||||
.then(function (response) {
|
||||
self.set('authenticated', true);
|
||||
self.set('user', response);
|
||||
self.set('config.userId', response.BaseEntity.id);
|
||||
self.set('waiting', false);
|
||||
self.getWorkspaces();
|
||||
}, function (reason) { // eslint-disable-line no-unused-vars
|
||||
self.set('authenticated', false);
|
||||
self.set('user', null);
|
||||
self.set('config.userId', 0);
|
||||
self.set('waiting', false);
|
||||
|
||||
switch (reason.status) {
|
||||
case 400:
|
||||
self.showNotification(`Unable to connect to Gemini URL`);
|
||||
break;
|
||||
case 403:
|
||||
self.showNotification(`Unable to authenticate`);
|
||||
break;
|
||||
default:
|
||||
self.showNotification(`Something went wrong, try again!`);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
onWorkspaceChange(id) {
|
||||
this.set('isDirty', true);
|
||||
this.selectWorkspace(id);
|
||||
},
|
||||
|
||||
onCancel() {
|
||||
this.attrs.onCancel();
|
||||
},
|
||||
|
||||
onAction(title) {
|
||||
let page = this.get('page');
|
||||
let meta = this.get('meta');
|
||||
page.set('title', title);
|
||||
meta.set('rawBody', JSON.stringify(this.get("items")));
|
||||
meta.set('config', JSON.stringify(this.get('config')));
|
||||
meta.set('externalSource', true);
|
||||
|
||||
this.attrs.onAction(page, meta);
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,14 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({});
|
|
@ -1,263 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import NotifierMixin from '../../../mixins/notifier';
|
||||
import TooltipMixin from '../../../mixins/tooltip';
|
||||
import SectionMixin from '../../../mixins/section';
|
||||
|
||||
export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin, {
|
||||
sectionService: Ember.inject.service('section'),
|
||||
isDirty: false,
|
||||
busy: false,
|
||||
authenticated: false,
|
||||
config: {},
|
||||
owners: null,
|
||||
|
||||
didReceiveAttrs() {
|
||||
let self = this;
|
||||
let page = this.get('page');
|
||||
|
||||
if (is.undefined(this.get('config.clientId')) || is.undefined(this.get('config.callbackUrl'))) {
|
||||
self.get('sectionService').fetch(page, "config", {})
|
||||
.then(function (cfg) {
|
||||
let config = {};
|
||||
|
||||
config = {
|
||||
clientId: cfg.clientID,
|
||||
callbackUrl: cfg.authorizationCallbackURL,
|
||||
owner: null,
|
||||
owner_name: "",
|
||||
lists: [],
|
||||
branchSince: "",
|
||||
branchLines: "100",
|
||||
userId: "",
|
||||
pageId: page.get('id'),
|
||||
showMilestones: false,
|
||||
showIssues: false,
|
||||
showCommits: true,
|
||||
};
|
||||
|
||||
try {
|
||||
let metaConfig = JSON.parse(self.get('meta.config'));
|
||||
config.owner = metaConfig.owner;
|
||||
config.lists = metaConfig.lists;
|
||||
config.branchSince = metaConfig.branchSince;
|
||||
config.userId = metaConfig.userId;
|
||||
config.pageId = metaConfig.pageId;
|
||||
config.showMilestones = metaConfig.showMilestones;
|
||||
config.showIssues = metaConfig.showIssues;
|
||||
config.showCommits = metaConfig.showCommits;
|
||||
} catch (e) { // eslint-disable-line no-empty
|
||||
}
|
||||
|
||||
if (_.isUndefined(config.showCommits)) {
|
||||
config.showCommits = true;
|
||||
}
|
||||
|
||||
self.set('config', config);
|
||||
self.set('config.pageId', page.get('id'));
|
||||
|
||||
// On auth callback capture code
|
||||
let code = window.location.search;
|
||||
code = code.replace("?mode=edit", "");
|
||||
|
||||
if (is.not.undefined(code) && is.not.null(code) && is.not.empty(code) && code !== "") {
|
||||
let tok = code.replace("&code=", "");
|
||||
self.get('sectionService').fetch(page, "saveSecret", { "token": tok })
|
||||
.then(function () {
|
||||
self.send('authStage2');
|
||||
}, function (error) { //jshint ignore: line
|
||||
console.log(error); // eslint-disable-line no-console
|
||||
self.send('auth');
|
||||
});
|
||||
} else {
|
||||
if (config.userId !== self.get("session.session.authenticated.user.id")) {
|
||||
console.log("github auth wrong user ID, switching"); // eslint-disable-line no-console
|
||||
self.set('config.userId', self.get("session.session.authenticated.user.id"));
|
||||
}
|
||||
self.get('sectionService').fetch(page, "checkAuth", self.get('config'))
|
||||
.then(function () {
|
||||
self.send('authStage2');
|
||||
}, function (error) {
|
||||
console.log(error); // eslint-disable-line no-console
|
||||
self.send('auth'); // require auth if the db token is invalid
|
||||
});
|
||||
}
|
||||
}, function (error) {
|
||||
console.log(error); // eslint-disable-line no-console
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
this.destroyTooltips();
|
||||
},
|
||||
|
||||
getOwnerLists() {
|
||||
this.set('busy', true);
|
||||
|
||||
let owners = this.get('owners');
|
||||
let thisOwner = this.get('config.owner');
|
||||
|
||||
if (is.null(thisOwner) || is.undefined(thisOwner)) {
|
||||
if (owners.length) {
|
||||
thisOwner = owners[0];
|
||||
this.set('config.owner', thisOwner);
|
||||
}
|
||||
} else {
|
||||
this.set('config.owner', owners.findBy('id', thisOwner.id));
|
||||
}
|
||||
|
||||
this.set('owner', thisOwner);
|
||||
|
||||
this.getOrgReposLists();
|
||||
|
||||
if (is.undefined(this.get('initDateTimePicker'))) {
|
||||
$.datetimepicker.setLocale('en');
|
||||
$('#branch-since').datetimepicker();
|
||||
this.set('initDateTimePicker', "Done");
|
||||
}
|
||||
},
|
||||
|
||||
getOrgReposLists() {
|
||||
this.set('busy', true);
|
||||
|
||||
let self = this;
|
||||
let page = this.get('page');
|
||||
|
||||
this.get('sectionService').fetch(page, "orgrepos", self.get('config'))
|
||||
.then(function (lists) {
|
||||
let savedLists = self.get('config.lists');
|
||||
if (savedLists === null) {
|
||||
savedLists = [];
|
||||
}
|
||||
|
||||
if (lists.length > 0) {
|
||||
let noIncluded = true;
|
||||
|
||||
lists.forEach(function (list) {
|
||||
let included = false;
|
||||
var saved;
|
||||
if (is.not.undefined(savedLists)) {
|
||||
saved = savedLists.findBy("id", list.id);
|
||||
}
|
||||
if (is.not.undefined(saved)) {
|
||||
included = saved.included;
|
||||
noIncluded = false;
|
||||
}
|
||||
list.included = included;
|
||||
});
|
||||
|
||||
if (noIncluded) {
|
||||
lists[0].included = true; // make the first entry the default
|
||||
}
|
||||
}
|
||||
|
||||
self.set('config.lists', lists);
|
||||
self.set('busy', false);
|
||||
}, function (error) {
|
||||
self.set('busy', false);
|
||||
self.set('authenticated', false);
|
||||
self.showNotification("Unable to fetch repositories");
|
||||
console.log(error); // eslint-disable-line no-console
|
||||
});
|
||||
},
|
||||
|
||||
actions: {
|
||||
isDirty() {
|
||||
return this.get('isDirty');
|
||||
},
|
||||
|
||||
onListCheckbox(id) { // select one repository only
|
||||
let lists = this.get('config.lists');
|
||||
let list = lists.findBy('id', id);
|
||||
|
||||
lists.forEach(function (entry) {
|
||||
Ember.set(entry, 'included', false);
|
||||
});
|
||||
|
||||
if (list !== null) {
|
||||
Ember.set(list, 'included', true);
|
||||
}
|
||||
},
|
||||
|
||||
authStage2() {
|
||||
let self = this;
|
||||
self.set('config.userId', self.get("session.session.authenticated.user.id"));
|
||||
self.set('authenticated', true);
|
||||
self.set('busy', true);
|
||||
let page = this.get('page');
|
||||
|
||||
self.get('sectionService').fetch(page, "owners", self.get('config'))
|
||||
.then(function (owners) {
|
||||
self.set('busy', false);
|
||||
self.set('owners', owners);
|
||||
self.getOwnerLists();
|
||||
}, function (error) {
|
||||
self.set('busy', false);
|
||||
self.set('authenticated', false);
|
||||
self.showNotification("Unable to fetch owners");
|
||||
console.log(error); // eslint-disable-line no-console
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
auth() {
|
||||
let self = this;
|
||||
self.set('busy', true);
|
||||
self.set('authenticated', false);
|
||||
|
||||
let target = "https://github.com/login/oauth/authorize?client_id=" + self.get('config.clientId') +
|
||||
"&scope=repo&redirect_uri=" + encodeURIComponent(self.get('config.callbackUrl')) +
|
||||
"&state=" + encodeURIComponent(window.location.href);
|
||||
|
||||
window.location.href = target;
|
||||
},
|
||||
|
||||
onOwnerChange(thisOwner) {
|
||||
this.set('isDirty', true);
|
||||
this.set('config.owner', thisOwner);
|
||||
this.set('config.lists', []);
|
||||
this.getOwnerLists();
|
||||
},
|
||||
|
||||
onStateChange(thisState) {
|
||||
this.set('config.state', thisState);
|
||||
},
|
||||
|
||||
onCancel() {
|
||||
this.attrs.onCancel();
|
||||
},
|
||||
|
||||
onAction(title) {
|
||||
this.set('busy', true);
|
||||
|
||||
let self = this;
|
||||
let page = this.get('page');
|
||||
let meta = this.get('meta');
|
||||
page.set('title', title);
|
||||
meta.set('rawBody', '');
|
||||
meta.set('config', JSON.stringify(this.get('config')));
|
||||
meta.set('externalSource', true);
|
||||
|
||||
this.get('sectionService').fetch(page, 'content', this.get('config'))
|
||||
.then(function (response) {
|
||||
meta.set('rawBody', JSON.stringify(response));
|
||||
self.set('busy', false);
|
||||
self.attrs.onAction(page, meta);
|
||||
}, function (reason) { // eslint-disable-line no-unused-vars
|
||||
self.set('busy', false);
|
||||
self.attrs.onAction(page, meta);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,14 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({});
|
|
@ -1,129 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import TooltipMixin from '../../../mixins/tooltip';
|
||||
|
||||
const {
|
||||
inject: { service }
|
||||
} = Ember;
|
||||
|
||||
export default Ember.Component.extend(TooltipMixin, {
|
||||
link: service(),
|
||||
pageBody: "",
|
||||
pagePreview: "",
|
||||
editMode: true,
|
||||
codeSyntax: null,
|
||||
codeEditor: null,
|
||||
editorId: Ember.computed('page', function () {
|
||||
let page = this.get('page');
|
||||
return `markdown-editor-${page.id}`;
|
||||
}),
|
||||
previewId: Ember.computed('page', function () {
|
||||
let page = this.get('page');
|
||||
return `markdown-preview-${page.id}`;
|
||||
}),
|
||||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
this.set('pageBody', this.get('meta.rawBody').trim());
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
this.attachEditor();
|
||||
this.addTooltip(document.getElementById(this.get('tooltipId')));
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
let editor = this.get('codeEditor');
|
||||
|
||||
if (this.get('editMode')) {
|
||||
editor.toTextArea();
|
||||
editor = null;
|
||||
}
|
||||
|
||||
this.set('codeEditor', null);
|
||||
this.destroyTooltips();
|
||||
},
|
||||
|
||||
getBody() {
|
||||
return this.get('codeEditor').getDoc().getValue().trim();
|
||||
},
|
||||
|
||||
attachEditor() {
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById(this.get('editorId')), {
|
||||
theme: "default",
|
||||
mode: "markdown",
|
||||
lineNumbers: false,
|
||||
lineWrapping: true,
|
||||
indentUnit: 4,
|
||||
tabSize: 4,
|
||||
value: "",
|
||||
dragDrop: false,
|
||||
extraKeys: {"Enter": "newlineAndIndentContinueMarkdownList"}
|
||||
});
|
||||
|
||||
CodeMirror.commands.save = function(/*instance*/){
|
||||
Mousetrap.trigger('ctrl+s');
|
||||
};
|
||||
|
||||
this.set('codeEditor', editor);
|
||||
|
||||
let syntax = this.get("codeSyntax");
|
||||
|
||||
if (is.not.undefined(syntax)) {
|
||||
CodeMirror.autoLoadMode(editor, "markdown");
|
||||
editor.setOption("mode", "markdown");
|
||||
}
|
||||
},
|
||||
|
||||
actions: {
|
||||
onPreview() {
|
||||
this.set('editMode', !this.get('editMode'));
|
||||
|
||||
Ember.run.schedule('afterRender', () => {
|
||||
if (this.get('editMode')) {
|
||||
this.attachEditor();
|
||||
} else {
|
||||
this.set('pageBody',this.getBody());
|
||||
let md = window.markdownit({ linkify: true });
|
||||
let result = md.render(this.getBody());
|
||||
|
||||
this.set('pagePreview', result);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
onInsertLink(link) {
|
||||
let linkMarkdown = this.get('link').buildLink(link);
|
||||
this.get('codeEditor').getDoc().replaceSelection(linkMarkdown);
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
isDirty() {
|
||||
return this.get('codeEditor').getDoc().isClean() === false;
|
||||
},
|
||||
|
||||
onCancel() {
|
||||
this.attrs.onCancel();
|
||||
},
|
||||
|
||||
onAction(title) {
|
||||
let page = this.get('page');
|
||||
let meta = this.get('meta');
|
||||
page.set('title', title);
|
||||
meta.set('rawBody', this.getBody());
|
||||
|
||||
this.attrs.onAction(page, meta);
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,14 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({});
|
|
@ -1,186 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import NotifierMixin from '../../../mixins/notifier';
|
||||
import TooltipMixin from '../../../mixins/tooltip';
|
||||
import SectionMixin from '../../../mixins/section';
|
||||
import netUtil from '../../../utils/net';
|
||||
|
||||
export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin, {
|
||||
sectionService: Ember.inject.service('section'),
|
||||
isDirty: false,
|
||||
waiting: false,
|
||||
authenticated: false,
|
||||
config: {},
|
||||
items: {},
|
||||
|
||||
didReceiveAttrs() {
|
||||
let config = {};
|
||||
|
||||
try {
|
||||
config = JSON.parse(this.get('meta.config'));
|
||||
} catch (e) {} // eslint-disable-line no-empty
|
||||
|
||||
if (is.empty(config)) {
|
||||
config = {
|
||||
APIToken: "",
|
||||
query: "",
|
||||
max: 10,
|
||||
group: null,
|
||||
system: null
|
||||
};
|
||||
}
|
||||
|
||||
this.set('config', config);
|
||||
|
||||
this.send('auth');
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
this.destroyTooltips();
|
||||
},
|
||||
|
||||
displayError(reason) {
|
||||
if (netUtil.isAjaxAccessError(reason)) {
|
||||
this.showNotification(`Unable to authenticate`);
|
||||
} else {
|
||||
this.showNotification(`Something went wrong, try again!`);
|
||||
}
|
||||
},
|
||||
|
||||
actions: {
|
||||
isDirty() {
|
||||
return this.get('isDirty');
|
||||
},
|
||||
|
||||
auth() {
|
||||
let page = this.get('page');
|
||||
let config = this.get('config');
|
||||
let self = this;
|
||||
|
||||
this.set('waiting', true);
|
||||
|
||||
this.get('sectionService').fetch(page, "auth", config)
|
||||
.then(function (response) {
|
||||
self.set('authenticated', true);
|
||||
self.set('items', response);
|
||||
self.set('config.APIToken', '********'); // reset the api token once it has been sent to the host
|
||||
|
||||
self.get('sectionService').fetch(page, "options", config)
|
||||
.then(function (response) {
|
||||
self.set('options', response);
|
||||
self.set('waiting', false);
|
||||
|
||||
let options = self.get('options');
|
||||
let group = {};
|
||||
if (is.not.null(config.group)) {
|
||||
group = _.findWhere(options.groups, { id: config.group.id });
|
||||
} else {
|
||||
group = options.groups[0];
|
||||
}
|
||||
if (is.not.undefined(group)) {
|
||||
Ember.set(config, 'group', group);
|
||||
}
|
||||
}, function (reason) {
|
||||
self.set('authenticated', false);
|
||||
self.set('waiting', false);
|
||||
self.set('config.APIToken', ''); // clear the api token
|
||||
self.displayError(reason);
|
||||
console.log("get options call failed"); // eslint-disable-line no-console
|
||||
});
|
||||
}, function (reason) {
|
||||
self.set('authenticated', false);
|
||||
self.set('waiting', false);
|
||||
self.set('config.APIToken', ''); // clear the api token
|
||||
self.displayError(reason);
|
||||
console.log("auth token invalid"); // eslint-disable-line no-console
|
||||
});
|
||||
},
|
||||
|
||||
onGroupsChange(group) {
|
||||
let config = this.get('config');
|
||||
let page = this.get('page');
|
||||
let self = this;
|
||||
this.set('isDirty', true);
|
||||
this.set('config.group', group);
|
||||
this.set('waiting', true);
|
||||
|
||||
this.get('sectionService').fetch(page, "auth", config)
|
||||
.then(function (response) {
|
||||
self.set('waiting', false);
|
||||
self.set('items', response);
|
||||
}, function (reason) { //jshint ignore: line
|
||||
self.set('waiting', false);
|
||||
self.displayError(reason);
|
||||
});
|
||||
},
|
||||
|
||||
onSystemsChange(system) {
|
||||
let config = this.get('config');
|
||||
let page = this.get('page');
|
||||
let self = this;
|
||||
this.set('isDirty', true);
|
||||
this.set('config.system', system);
|
||||
this.set('waiting', true);
|
||||
|
||||
this.get('sectionService').fetch(page, "auth", config)
|
||||
.then(function (response) {
|
||||
self.set('waiting', false);
|
||||
self.set('items', response);
|
||||
}, function (reason) { //jshint ignore: line
|
||||
self.set('waiting', false);
|
||||
self.displayError(reason);
|
||||
});
|
||||
},
|
||||
|
||||
onCancel() {
|
||||
this.attrs.onCancel();
|
||||
},
|
||||
|
||||
onAction(title) {
|
||||
let self = this;
|
||||
let page = this.get('page');
|
||||
let meta = this.get('meta');
|
||||
page.set('title', title);
|
||||
meta.set('externalSource', true);
|
||||
|
||||
let config = this.get('config');
|
||||
let max = 10;
|
||||
if (is.number(parseInt(config.max))) {
|
||||
max = parseInt(config.max);
|
||||
}
|
||||
|
||||
Ember.set(config, 'max', max);
|
||||
this.set('waiting', true);
|
||||
|
||||
this.get('sectionService').fetch(page, "auth", this.get('config'))
|
||||
.then(function (response) {
|
||||
self.set('items', response);
|
||||
let items = self.get('items');
|
||||
|
||||
if (items.events.length > max) {
|
||||
items.events = items.events.slice(0, max);
|
||||
}
|
||||
|
||||
meta.set('config', JSON.stringify(config));
|
||||
meta.set('rawBody', JSON.stringify(items));
|
||||
|
||||
self.set('waiting', false);
|
||||
self.attrs.onAction(page, meta);
|
||||
}, function (reason) { // eslint-disable-line no-unused-vars
|
||||
self.set('authenticated', false);
|
||||
self.set('waiting', false);
|
||||
self.showNotification(`Something went wrong, try again!`);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,14 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({});
|
|
@ -1,73 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
isDirty: false,
|
||||
pageBody: "",
|
||||
editorId: Ember.computed('page', function () {
|
||||
let page = this.get('page');
|
||||
return `table-editor-${page.id}`;
|
||||
}),
|
||||
defaultTable: '<table class="wysiwyg-table" style="width: 100%;"><thead><tr><th><br></th><th><br></th><th><br></th><th><br></th></tr></thead><tbody><tr><td style="width: 25.0000%;"><br></td><td style="width: 25.0000%;"><br></td><td style="width: 25.0000%;"><br></td><td style="width: 25.0000%;"><br></td></tr><tr><td style="width: 25.0000%;"><br></td><td style="width: 25.0000%;"><br></td><td style="width: 25.0000%;"><br></td><td style="width: 25.0000%;"><br></td></tr><tr><td style="width: 25.0000%;"><br></td><td style="width: 25.0000%;"><br></td><td style="width: 25.0000%;"><br></td><td style="width: 25.0000%;"><br></td></tr></tbody></table>',
|
||||
|
||||
didReceiveAttrs() {
|
||||
this.set('pageBody', this.get('meta.rawBody'));
|
||||
|
||||
if (is.empty(this.get('pageBody'))) {
|
||||
this.set('pageBody', this.get('defaultTable'));
|
||||
}
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
let id = '#' + this.get('editorId');
|
||||
$(id).froalaEditor({
|
||||
toolbarButtons: [],
|
||||
toolbarInline: true,
|
||||
tableResizerOffset: 10
|
||||
});
|
||||
|
||||
$(id).on('froalaEditor.contentChanged', () => {
|
||||
this.set('isDirty', true);
|
||||
});
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
$('#' + this.get('editorId')).off('froalaEditor.contentChanged');
|
||||
},
|
||||
|
||||
actions: {
|
||||
isDirty() {
|
||||
return this.get('isDirty');
|
||||
},
|
||||
|
||||
onCancel() {
|
||||
this.attrs.onCancel();
|
||||
},
|
||||
|
||||
onAction(title) {
|
||||
let page = this.get('page');
|
||||
let meta = this.get('meta');
|
||||
|
||||
let body = $('#' + this.get('editorId')).froalaEditor('html.get', true);
|
||||
page.set('title', title);
|
||||
|
||||
if (is.empty(body)) {
|
||||
body = this.get('defaultTable');
|
||||
}
|
||||
|
||||
meta.set('rawBody', body);
|
||||
|
||||
this.attrs.onAction(page, meta);
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,14 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({});
|
|
@ -1,242 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
/*global Trello*/
|
||||
import Ember from 'ember';
|
||||
import NotifierMixin from '../../../mixins/notifier';
|
||||
import TooltipMixin from '../../../mixins/tooltip';
|
||||
import SectionMixin from '../../../mixins/section';
|
||||
|
||||
export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin, {
|
||||
sectionService: Ember.inject.service('section'),
|
||||
isDirty: false,
|
||||
busy: false,
|
||||
authenticated: false,
|
||||
config: {},
|
||||
boards: null,
|
||||
noBoards: false,
|
||||
appKey: "",
|
||||
|
||||
boardStyle: Ember.computed('config.board', function () {
|
||||
let board = this.get('config.board');
|
||||
|
||||
if (is.null(board) || is.undefined(board)) {
|
||||
return "#4c4c4c";
|
||||
}
|
||||
|
||||
let color = board.prefs.backgroundColor;
|
||||
return Ember.String.htmlSafe("background-color: " + color);
|
||||
}),
|
||||
|
||||
didReceiveAttrs() {
|
||||
let page = this.get('page');
|
||||
let config = {};
|
||||
let self = this;
|
||||
|
||||
try {
|
||||
config = JSON.parse(this.get('meta.config'));
|
||||
} catch (e) {} // eslint-disable-line no-empty
|
||||
|
||||
if (is.empty(config)) {
|
||||
config = {
|
||||
token: "",
|
||||
user: null,
|
||||
board: null,
|
||||
lists: []
|
||||
};
|
||||
}
|
||||
|
||||
this.set('config', config);
|
||||
|
||||
this.get('sectionService').fetch(page, "config", {})
|
||||
.then(function (s) {
|
||||
self.set('appKey', s.appKey);
|
||||
self.set('config.token', s.token); // the user's own token has been stored in the DB
|
||||
|
||||
// On auth callback capture user token
|
||||
let hashToken = window.location.hash;
|
||||
if (is.not.undefined(hashToken) && is.not.null(hashToken)) {
|
||||
let token = hashToken.replace("#token=", "");
|
||||
if (is.not.empty(token)) {
|
||||
self.set('config.token', token);
|
||||
}
|
||||
}
|
||||
|
||||
if (self.get('appKey') !== "" && self.get('config.token') !== "") {
|
||||
self.send('auth');
|
||||
} else {
|
||||
Ember.$.getScript("https://api.trello.com/1/client.js?key=" + self.get('appKey'), function () {
|
||||
Trello.deauthorize();
|
||||
});
|
||||
}
|
||||
}, function (error) {
|
||||
console.log(error); // eslint-disable-line no-console
|
||||
});
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
this.destroyTooltips();
|
||||
},
|
||||
|
||||
getBoardLists() {
|
||||
this.set('busy', true);
|
||||
|
||||
let self = this;
|
||||
let boards = this.get('boards');
|
||||
let board = this.get('config.board');
|
||||
let page = this.get('page');
|
||||
|
||||
if (is.null(boards) || is.undefined(boards) || boards.length === 0) {
|
||||
this.set('noBoards', true);
|
||||
return;
|
||||
}
|
||||
|
||||
this.set('noBoards', false);
|
||||
|
||||
if (is.null(board) || is.undefined(board)) {
|
||||
if (boards.length) {
|
||||
board = boards[0];
|
||||
this.set('config.board', board);
|
||||
}
|
||||
} else {
|
||||
this.set('config.board', boards.findBy('id', board.id));
|
||||
}
|
||||
|
||||
this.get('sectionService').fetch(page, "lists", self.get('config'))
|
||||
.then(function (lists) {
|
||||
let savedLists = self.get('config.lists');
|
||||
if (savedLists === null) {
|
||||
savedLists = [];
|
||||
}
|
||||
|
||||
lists.forEach(function (list) {
|
||||
let saved = savedLists.findBy("id", list.id);
|
||||
let included = true;
|
||||
if (is.not.undefined(saved)) {
|
||||
included = saved.included;
|
||||
}
|
||||
list.included = included;
|
||||
});
|
||||
|
||||
self.set('config.lists', lists);
|
||||
self.set('busy', false);
|
||||
}, function (error) { //jshint ignore: line
|
||||
self.set('busy', false);
|
||||
self.set('authenticated', false);
|
||||
self.showNotification("Unable to fetch board lists");
|
||||
console.log(error); // eslint-disable-line no-console
|
||||
});
|
||||
},
|
||||
|
||||
actions: {
|
||||
isDirty() {
|
||||
return this.get('isDirty');
|
||||
},
|
||||
|
||||
onListCheckbox(id) {
|
||||
let lists = this.get('config.lists');
|
||||
let list = lists.findBy('id', id);
|
||||
|
||||
if (list !== null) {
|
||||
Ember.set(list, 'included', !list.included);
|
||||
}
|
||||
},
|
||||
|
||||
auth() {
|
||||
if (this.get('appKey') === "") {
|
||||
$("#trello-appkey").addClass('error').focus();
|
||||
this.set('authenticated', false);
|
||||
return;
|
||||
}
|
||||
|
||||
let self = this;
|
||||
let page = this.get('page');
|
||||
|
||||
self.set('busy', true);
|
||||
|
||||
Ember.$.getScript("https://api.trello.com/1/client.js?key=" + this.get('appKey'), function () {
|
||||
Trello.authorize({
|
||||
type: "redirect",
|
||||
interactive: true,
|
||||
name: "Documize",
|
||||
scope: {
|
||||
read: true,
|
||||
write: false
|
||||
},
|
||||
expiration: "never",
|
||||
persist: true,
|
||||
success: function () {
|
||||
self.set('authenticated', true);
|
||||
self.set('config.token', Trello.token());
|
||||
self.set('busy', true);
|
||||
|
||||
Trello.members.get("me", function (user) {
|
||||
self.set('config.user', user);
|
||||
}, function (error) {
|
||||
console.log(error); // eslint-disable-line no-console
|
||||
});
|
||||
|
||||
self.get('sectionService').fetch(page, "boards", self.get('config'))
|
||||
.then(function (boards) {
|
||||
self.set('busy', false);
|
||||
self.set('boards', boards);
|
||||
self.getBoardLists();
|
||||
}, function (error) { //jshint ignore: line
|
||||
self.set('busy', false);
|
||||
self.set('authenticated', false);
|
||||
self.showNotification("Unable to fetch boards");
|
||||
console.log(error); // eslint-disable-line no-console
|
||||
});
|
||||
},
|
||||
error: function (error) {
|
||||
self.set('busy', false);
|
||||
self.set('authenticated', false);
|
||||
self.showNotification("Unable to authenticate");
|
||||
console.log(error); // eslint-disable-line no-console
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
onBoardChange(board) {
|
||||
this.set('isDirty', true);
|
||||
this.set('config.board', board);
|
||||
this.set('config.lists', []);
|
||||
this.getBoardLists();
|
||||
},
|
||||
|
||||
onCancel() {
|
||||
this.attrs.onCancel();
|
||||
},
|
||||
|
||||
onAction(title) {
|
||||
this.set('busy', true);
|
||||
|
||||
let self = this;
|
||||
let page = this.get('page');
|
||||
let meta = this.get('meta');
|
||||
page.set('title', title);
|
||||
meta.set('rawBody', '');
|
||||
meta.set('config', JSON.stringify(this.get('config')));
|
||||
meta.set('externalSource', true);
|
||||
|
||||
this.get('sectionService').fetch(page, "cards", this.get('config'))
|
||||
.then(function (response) {
|
||||
meta.set('rawBody', JSON.stringify(response));
|
||||
self.set('busy', false);
|
||||
self.attrs.onAction(page, meta);
|
||||
}, function (reason) { // eslint-disable-line no-unused-vars
|
||||
self.set('busy', false);
|
||||
self.attrs.onAction(page, meta);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,14 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({});
|
|
@ -1,134 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
const {
|
||||
inject: { service }
|
||||
} = Ember;
|
||||
|
||||
export default Ember.Component.extend({
|
||||
appMeta: service(),
|
||||
link: service(),
|
||||
pageBody: "",
|
||||
editorId: Ember.computed('page', function () {
|
||||
let page = this.get('page');
|
||||
return `wysiwyg-editor-${page.id}`;
|
||||
}),
|
||||
|
||||
didReceiveAttrs() {
|
||||
this.set('pageBody', this.get('meta.rawBody'));
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
let options = {
|
||||
selector: "#" + this.get('editorId'),
|
||||
relative_urls: false,
|
||||
cache_suffix: "?v=443",
|
||||
browser_spellcheck: false,
|
||||
gecko_spellcheck: false,
|
||||
theme: "modern",
|
||||
skin: 'documize',
|
||||
statusbar: false,
|
||||
inline: true,
|
||||
entity_encoding: "raw",
|
||||
paste_data_images: true,
|
||||
image_advtab: true,
|
||||
image_caption: true,
|
||||
media_live_embeds: true,
|
||||
fontsize_formats: "8px 10px 12px 14px 17px 18px 24px 36px 40px 50px 60px",
|
||||
formats: {
|
||||
bold: {
|
||||
inline: 'b'
|
||||
},
|
||||
italic: {
|
||||
inline: 'i'
|
||||
}
|
||||
},
|
||||
codesample_languages: [
|
||||
{text: 'HTML/XML', value: 'markup'},
|
||||
{text: 'JavaScript', value: 'javascript'},
|
||||
{text: 'CSS', value: 'css'},
|
||||
{text: 'PHP', value: 'php'},
|
||||
{text: 'Ruby', value: 'ruby'},
|
||||
{text: 'Python', value: 'python'},
|
||||
{text: 'Java', value: 'java'},
|
||||
{text: 'C', value: 'c'},
|
||||
{text: 'C#', value: 'csharp'},
|
||||
{text: 'C++', value: 'cpp'}],
|
||||
extended_valid_elements: "b,i,b/strong,i/em",
|
||||
plugins: [
|
||||
'advlist autolink lists link image charmap print preview hr anchor pagebreak',
|
||||
'searchreplace wordcount visualblocks visualchars code codesample fullscreen',
|
||||
'insertdatetime media nonbreaking save table directionality',
|
||||
'template paste textcolor colorpicker textpattern imagetools'
|
||||
],
|
||||
menu: {},
|
||||
menubar: false,
|
||||
toolbar1: "formatselect fontsizeselect | bold italic underline strikethrough superscript subscript | forecolor backcolor link unlink",
|
||||
toolbar2: "outdent indent bullist numlist | alignleft aligncenter alignright alignjustify | table image media codesample",
|
||||
save_onsavecallback: function () {
|
||||
Mousetrap.trigger('ctrl+s');
|
||||
}
|
||||
};
|
||||
|
||||
if (typeof tinymce === 'undefined') {
|
||||
$.getScript("/tinymce/tinymce.min.js?v=443", function () {
|
||||
window.tinymce.dom.Event.domLoaded = true;
|
||||
tinymce.baseURL = "//" + window.location.host + "/tinymce";
|
||||
tinymce.suffix = ".min";
|
||||
tinymce.init(options);
|
||||
});
|
||||
} else {
|
||||
tinymce.init(options);
|
||||
}
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
tinymce.EditorManager.execCommand('mceRemoveEditor', true, this.get('editorId'));
|
||||
},
|
||||
|
||||
actions: {
|
||||
onInsertLink(link) {
|
||||
let editor = tinymce.EditorManager.get(this.get('editorId'));
|
||||
let userSelection = editor.selection.getContent();
|
||||
|
||||
if (is.not.empty(userSelection)) {
|
||||
Ember.set(link, 'title', userSelection);
|
||||
}
|
||||
|
||||
let linkHTML = this.get('link').buildLink(link);
|
||||
editor.insertContent(linkHTML);
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
isDirty() {
|
||||
let editor = tinymce.EditorManager.get(this.get('editorId'));
|
||||
return is.not.undefined(tinymce) && is.not.undefined(editor) && editor.isDirty();
|
||||
},
|
||||
|
||||
onCancel() {
|
||||
this.attrs.onCancel();
|
||||
},
|
||||
|
||||
onAction(title) {
|
||||
let page = this.get('page');
|
||||
let meta = this.get('meta');
|
||||
let editor = tinymce.EditorManager.get(this.get('editorId'));
|
||||
|
||||
page.set('title', title);
|
||||
meta.set('rawBody', editor.getContent());
|
||||
|
||||
this.attrs.onAction(page, meta);
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,14 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({});
|
|
@ -1,20 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import TooltipMixin from '../../mixins/tooltip';
|
||||
|
||||
export default Ember.Component.extend(TooltipMixin, {
|
||||
didRender() {
|
||||
let refId = this.get('refId');
|
||||
this.addTooltip(document.getElementById(`avatar-${refId}`));
|
||||
},
|
||||
});
|
|
@ -1,28 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
tagName: 'span',
|
||||
value: '',
|
||||
onClick: null,
|
||||
|
||||
actions: {
|
||||
onCheck() {
|
||||
if (this.get('onClick') !== null) {
|
||||
this.attrs.onClick(this.get('value'));
|
||||
} else {
|
||||
this.set('selected', !this.get('selected'));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,15 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
});
|
|
@ -1,32 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
myWidth: Ember.computed('tabs', function() {
|
||||
let count = this.get('tabs.length');
|
||||
let width = 95 / count;
|
||||
return Ember.String.htmlSafe("width: " + `${width}%;`);
|
||||
}),
|
||||
|
||||
actions: {
|
||||
onTabSelect(tab) {
|
||||
this.get('tabs').forEach(t => {
|
||||
Ember.set(t, 'selected', false);
|
||||
});
|
||||
|
||||
Ember.set(tab, 'selected', true);
|
||||
|
||||
this.attrs.onTabSelect(this.get('tabs'));
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,52 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import miscUtil from '../utils/misc';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
notifications: [],
|
||||
|
||||
didInsertElement() {
|
||||
this.eventBus.subscribe('notifyUser', this, 'showNotification');
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
this.eventBus.unsubscribe('notifyUser');
|
||||
},
|
||||
|
||||
showNotification(msg) {
|
||||
let self = this;
|
||||
let notifications = this.get('notifications');
|
||||
notifications.pushObject(msg);
|
||||
this.set('notifications', notifications);
|
||||
|
||||
let elem = this.$(".user-notification")[0];
|
||||
|
||||
Ember.run(() => {
|
||||
self.$(elem).show();
|
||||
|
||||
// FIXME: need a more robust solution
|
||||
miscUtil.interval(function() {
|
||||
let notifications = self.get('notifications');
|
||||
|
||||
if (notifications.length > 0) {
|
||||
notifications.removeAt(0);
|
||||
self.set('notifications', notifications);
|
||||
}
|
||||
|
||||
if (notifications.length === 0) {
|
||||
self.$(elem).hide();
|
||||
}
|
||||
}, 2500, self.get('notifications').length);
|
||||
});
|
||||
},
|
||||
});
|
|
@ -1,88 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import AuthProvider from '../mixins/auth';
|
||||
|
||||
const {
|
||||
computed,
|
||||
isEmpty,
|
||||
isEqual,
|
||||
isPresent
|
||||
} = Ember;
|
||||
|
||||
export default Ember.Component.extend(AuthProvider, {
|
||||
password: { password: "", confirmation: "" },
|
||||
hasFirstnameError: computed.empty('model.firstname'),
|
||||
hasLastnameError: computed.empty('model.lastname'),
|
||||
hasEmailError: computed.empty('model.email'),
|
||||
hasPasswordError: computed('passwordError', 'password.password', {
|
||||
get() {
|
||||
if (isPresent(this.get('passwordError'))) {
|
||||
return `error`;
|
||||
}
|
||||
|
||||
if (isEmpty(this.get('password.password'))) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}),
|
||||
hasConfirmPasswordError: computed('confirmPasswordError', {
|
||||
get() {
|
||||
if (isPresent(this.get("confirmPasswordError"))) {
|
||||
return `error`;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}),
|
||||
|
||||
didReceiveAttrs() {
|
||||
this.set
|
||||
},
|
||||
|
||||
actions: {
|
||||
save() {
|
||||
let password = this.get('password.password');
|
||||
let confirmation = this.get('password.confirmation');
|
||||
|
||||
if (isEmpty(this.get('model.firstname'))) {
|
||||
return $("#firstname").focus();
|
||||
}
|
||||
if (isEmpty(this.get('model.lastname'))) {
|
||||
return $("#lastname").focus();
|
||||
}
|
||||
if (isEmpty(this.get('model.email'))) {
|
||||
return $("#email").focus();
|
||||
}
|
||||
|
||||
if (isPresent(password) && isEmpty(confirmation)) {
|
||||
Ember.set(this, 'confirmPasswordError', 'error');
|
||||
return $("#confirmPassword").focus();
|
||||
}
|
||||
if (isEmpty(password) && isPresent(confirmation)) {
|
||||
Ember.set(this, 'passwordError', 'error');
|
||||
return $("#password").focus();
|
||||
}
|
||||
if (!isEqual(password, confirmation)) {
|
||||
Ember.set(this, 'passwordError', 'error');
|
||||
return $("#password").focus();
|
||||
}
|
||||
|
||||
let passwords = this.get('password');
|
||||
|
||||
this.get('save')(passwords).finally(() => {
|
||||
Ember.set(this, 'password.password', '');
|
||||
Ember.set(this, 'password.confirmation', '');
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,54 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
// Copyright (c) 2015 Documize Inc.
|
||||
import Ember from 'ember';
|
||||
import NotifierMixin from '../mixins/notifier';
|
||||
|
||||
export default Ember.Component.extend(NotifierMixin, {
|
||||
drop1: null,
|
||||
|
||||
didInsertElement() {
|
||||
this._super(...arguments);
|
||||
new Tooltip({
|
||||
target: document.getElementById("sample-1")
|
||||
});
|
||||
new Tooltip({
|
||||
target: document.getElementById("sample-2")
|
||||
});
|
||||
new Tooltip({
|
||||
target: document.getElementById("sample-3")
|
||||
});
|
||||
new Tooltip({
|
||||
target: document.getElementById("sample-4")
|
||||
});
|
||||
|
||||
let drop1 = new Drop({
|
||||
target: document.getElementById('sample-dropdown-1'),
|
||||
content: document.getElementById('sample-dropdown-content-1'),
|
||||
classes: 'drop-theme-basic',
|
||||
position: 'bottom middle',
|
||||
openOn: 'click'
|
||||
});
|
||||
|
||||
this.set('drop1', drop1);
|
||||
},
|
||||
|
||||
actions: {
|
||||
dropClose() {
|
||||
this.get('drop1').close();
|
||||
},
|
||||
|
||||
addFolder() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,19 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import dateUtil from '../utils/date';
|
||||
|
||||
export function formattedDate(params) {
|
||||
return dateUtil.toIsoDate(params[0], params[1]);
|
||||
}
|
||||
|
||||
export default Ember.Helper.helper(formattedDate);
|
|
@ -1,16 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Helper.helper(function([object, path]) {
|
||||
return Ember.get(object, path);
|
||||
});
|
|
@ -1,31 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
{{content-for 'head'}}
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>Documize</title>
|
||||
<meta property="dbname" content="{{.DBname}}" />
|
||||
<meta property="dbhash" content="{{.DBhash}}" />
|
||||
<meta name="author" content="Documize" />
|
||||
<meta name="description" content="Documize">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||
<link rel="shortcut icon" href="/favicon.ico?v=1.1" />
|
||||
<link rel="icon" type="image/png" href="/favicon-32x32.png?v=1.1" sizes="32x32" />
|
||||
<link rel="stylesheet" href="/assets/vendor.css">
|
||||
<link rel="stylesheet" href="/assets/documize.css">
|
||||
{{content-for 'head-footer'}}
|
||||
</head>
|
||||
<body>
|
||||
{{content-for 'body'}}
|
||||
<script src="/assets/vendor.js"></script>
|
||||
<script src="/assets/documize.js"></script>
|
||||
<script src="/codemirror/lib/codemirror.js"></script>
|
||||
<script src="/codemirror/mode/meta.js"></script>
|
||||
<script src="/codemirror/addon/mode/loadmode.js"></script>
|
||||
<script src="/codemirror/addon/mode/overlay.js"></script>
|
||||
<script src="/codemirror/addon/runmode/runmode.js"></script>
|
||||
<script src="/codemirror/addon/runmode/colorize.js"></script>
|
||||
{{content-for 'body-footer'}}
|
||||
</body>
|
||||
</html>
|
|
@ -1,29 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
export function initialize( /*application*/ ) {
|
||||
// address insecure jquery defaults (kudos: @nathanhammond)
|
||||
$.globalEval = function() {};
|
||||
$.ajaxSetup({
|
||||
crossDomain: true,
|
||||
converters: {
|
||||
'text script': text => text
|
||||
}
|
||||
});
|
||||
|
||||
Dropzone.autoDiscover = false;
|
||||
CodeMirror.modeURL = "/codemirror/mode/%N/%N.js";
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'application',
|
||||
initialize: initialize
|
||||
};
|
|
@ -1,22 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
export function initialize(application) {
|
||||
application.inject('route', 'audit', 'service:audit');
|
||||
application.inject('controller', 'audit', 'service:audit');
|
||||
application.inject('component', 'audit', 'service:audit');
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'audit',
|
||||
after: 'session',
|
||||
initialize: initialize
|
||||
};
|
|
@ -1,24 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
export function initialize(application) {
|
||||
application.inject('route', 'session', 'service:session');
|
||||
application.inject('controller', 'session', 'service:session');
|
||||
application.inject('component', 'session', 'service:session');
|
||||
application.inject('mixin', 'session', 'service:session');
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'session',
|
||||
after: 'application',
|
||||
before: 'audit',
|
||||
initialize: initialize
|
||||
};
|
|
@ -1,25 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import constants from '../utils/constants';
|
||||
|
||||
export default Ember.Mixin.create({
|
||||
appMeta: Ember.inject.service(),
|
||||
isAuthProviderDocumize: true,
|
||||
IsAuthProviderKeycloak: false,
|
||||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
this.set('isAuthProviderDocumize', this.get('appMeta.authProvider') === constants.AuthProvider.Documize);
|
||||
this.set('isAuthProviderKeycloak', this.get('appMeta.authProvider') === constants.AuthProvider.Keycloak);
|
||||
}
|
||||
});
|
|
@ -1,24 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Mixin.create({
|
||||
showNotification(msg) {
|
||||
this.eventBus.publish('notifyUser', msg);
|
||||
},
|
||||
|
||||
actions: {
|
||||
showNotification(msg) {
|
||||
this.eventBus.publish('notifyUser', msg);
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,26 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Mixin.create({
|
||||
isReadonly: function () {
|
||||
if (this.get('page.userId') === this.get('session.session.authenticated.user.id')) {
|
||||
return undefined;
|
||||
} else {
|
||||
return "readonly";
|
||||
}
|
||||
}.property('page'),
|
||||
|
||||
isMine: function () {
|
||||
return this.get('page.userId') === this.get('session.session.authenticated.user.id');
|
||||
}.property('page')
|
||||
});
|
|
@ -1,42 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Mixin.create({
|
||||
tooltips: [],
|
||||
|
||||
addTooltip(elem) {
|
||||
|
||||
if(elem == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
let t = new Tooltip({
|
||||
target: elem
|
||||
});
|
||||
|
||||
let tt = this.get('tooltips');
|
||||
tt.push(t);
|
||||
},
|
||||
|
||||
destroyTooltips() {
|
||||
let tt = this.get('tooltips');
|
||||
|
||||
tt.forEach(t => {
|
||||
t.destroy();
|
||||
});
|
||||
|
||||
tt.length = 0;
|
||||
|
||||
this.set('tooltips', tt);
|
||||
}
|
||||
});
|
|
@ -1,103 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Model from 'ember-data/model';
|
||||
import attr from 'ember-data/attr';
|
||||
import Ember from 'ember';
|
||||
import constants from '../utils/constants';
|
||||
|
||||
export default Model.extend({
|
||||
orgId: attr('string'),
|
||||
folderId: attr('string'),
|
||||
documentId: attr('string'),
|
||||
userId: attr('string'),
|
||||
firstname: attr('string'),
|
||||
lastname: attr('string'),
|
||||
activityType: attr('number'),
|
||||
created: attr(),
|
||||
|
||||
activityLabel: Ember.computed('activityType', function() {
|
||||
let label = '';
|
||||
|
||||
switch (this.get('activityType')) {
|
||||
case constants.UserActivityType.Created:
|
||||
label = 'Added';
|
||||
break;
|
||||
case constants.UserActivityType.Read:
|
||||
label = 'Viewed';
|
||||
break;
|
||||
case constants.UserActivityType.Edited:
|
||||
label = 'Edited';
|
||||
break;
|
||||
case constants.UserActivityType.Deleted:
|
||||
label = 'Deleted';
|
||||
break;
|
||||
case constants.UserActivityType.Archived:
|
||||
label = 'Archived';
|
||||
break;
|
||||
case constants.UserActivityType.Approved:
|
||||
label = 'Approved';
|
||||
break;
|
||||
case constants.UserActivityType.Reverted:
|
||||
label = 'Reverted';
|
||||
break;
|
||||
case constants.UserActivityType.PublishedTemplate:
|
||||
label = 'Published Template';
|
||||
break;
|
||||
case constants.UserActivityType.PublishedBlock:
|
||||
label = 'Published Block';
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return label;
|
||||
}),
|
||||
|
||||
activityColor: Ember.computed('activityType', function() {
|
||||
let color = '';
|
||||
|
||||
switch (this.get('activityType')) {
|
||||
case constants.UserActivityType.Created:
|
||||
color = 'color-blue';
|
||||
break;
|
||||
case constants.UserActivityType.Read:
|
||||
color = 'color-black';
|
||||
break;
|
||||
case constants.UserActivityType.Edited:
|
||||
color = 'color-green';
|
||||
break;
|
||||
case constants.UserActivityType.Deleted:
|
||||
color = 'color-red';
|
||||
break;
|
||||
case constants.UserActivityType.Archived:
|
||||
color = 'color-gray';
|
||||
break;
|
||||
case constants.UserActivityType.Approved:
|
||||
color = 'color-green';
|
||||
break;
|
||||
case constants.UserActivityType.Reverted:
|
||||
color = 'color-red';
|
||||
break;
|
||||
case constants.UserActivityType.PublishedTemplate:
|
||||
color = 'color-blue';
|
||||
break;
|
||||
case constants.UserActivityType.PublishedBlock:
|
||||
color = 'color-blue';
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return color;
|
||||
})
|
||||
|
||||
});
|
|
@ -1,37 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import Model from 'ember-data/model';
|
||||
import attr from 'ember-data/attr';
|
||||
import Ember from 'ember';
|
||||
import stringUtil from '../utils/string';
|
||||
// import { belongsTo, hasMany } from 'ember-data/relationships';
|
||||
|
||||
export default Model.extend({
|
||||
name: attr('string'),
|
||||
excerpt: attr('string'),
|
||||
job: attr('string'),
|
||||
location: attr('string'),
|
||||
orgId: attr('string'),
|
||||
folderId: attr('string'),
|
||||
userId: attr('string'),
|
||||
tags: attr('string'),
|
||||
template: attr('boolean'),
|
||||
layout: attr('string'),
|
||||
|
||||
// client-side property
|
||||
selected: attr('boolean', { defaultValue: false }),
|
||||
slug: Ember.computed('name', function () {
|
||||
return stringUtil.makeSlug(this.get('name'));
|
||||
}),
|
||||
created: attr(),
|
||||
revised: attr()
|
||||
});
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue