Compare commits
797 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7579957fdf | ||
|
|
257d0d313d | ||
|
|
4b970ef770 | ||
|
|
6ec35e37ab | ||
|
|
72f461f0d2 | ||
|
|
32c7f52882 | ||
|
|
4943b3ad20 | ||
|
|
7eccc04e98 | ||
|
|
88e65c36bf | ||
|
|
5e13d86778 | ||
|
|
0e89f8bc4d | ||
|
|
a9a57822ef | ||
|
|
df25b4e609 | ||
|
|
b3ca402842 | ||
|
|
a52d7aee73 | ||
|
|
7214ff001a | ||
|
|
0e731c3e8a | ||
|
|
4f858cf7d6 | ||
|
|
3e5f9c51f5 | ||
|
|
8784cae01c | ||
|
|
81a3da550f | ||
|
|
7fc06d0750 | ||
|
|
1e0ebe9b7f | ||
|
|
73b7abd894 | ||
|
|
132f7253f6 | ||
|
|
827d581f1a | ||
|
|
9a315c241c | ||
|
|
5f9ddd969e | ||
|
|
cacf7f9920 | ||
|
|
d642729158 | ||
|
|
6b339b636a | ||
|
|
85468761d3 | ||
|
|
4cabeb2e99 | ||
|
|
f7d89b7659 | ||
|
|
6b5c527a3e | ||
|
|
57cbab10ac | ||
|
|
f50c2d3049 | ||
|
|
9957bd9b8a | ||
|
|
e6767dc3f9 | ||
|
|
136935d4f9 | ||
|
|
d654b63bca | ||
|
|
3ba4dee8a7 | ||
|
|
d4e0a50dbb | ||
|
|
3d4e35d942 | ||
|
|
5dcdbcdb53 | ||
|
|
d3a6ad1105 | ||
|
|
f233ca3284 | ||
|
|
f4914d9461 | ||
|
|
433aac37da | ||
|
|
fa34f5483e | ||
|
|
defa748497 | ||
|
|
c70b78d0c7 | ||
|
|
570b0c3e6a | ||
|
|
62a8d9b0f6 | ||
|
|
97e1e4ce53 | ||
|
|
b5655b530f | ||
|
|
b2c2530a1a | ||
|
|
c0a1139773 | ||
|
|
e452f8e006 | ||
|
|
7de625e004 | ||
|
|
8106296f6c | ||
|
|
7df901756f | ||
|
|
b41984e153 | ||
|
|
376c7f2545 | ||
|
|
d5df64f949 | ||
|
|
c9b2a66114 | ||
|
|
530917b85e | ||
|
|
b118e61741 | ||
|
|
635df4dd09 | ||
|
|
dccdc6290e | ||
|
|
573c461aa2 | ||
|
|
5a76eb28bf | ||
|
|
48028a8e09 | ||
|
|
1917531c54 | ||
|
|
a9d2bc08b7 | ||
|
|
e4ddd6ad8c | ||
|
|
aaf318de03 | ||
|
|
3c80cc0670 | ||
|
|
a01d89db30 | ||
|
|
26090084ff | ||
|
|
ab0ce56033 | ||
|
|
527854bbed | ||
|
|
f9de846ad5 | ||
|
|
57fbb15685 | ||
|
|
8986107256 | ||
|
|
2326d409a4 | ||
|
|
bcbccd5cb1 | ||
|
|
d47373e3b5 | ||
|
|
9ffcfa7f41 | ||
|
|
9a7ff92b5b | ||
|
|
a53f2ace64 | ||
|
|
280f6c4c9a | ||
|
|
cc33e8fa1b | ||
|
|
52b649b1c4 | ||
|
|
4194412540 | ||
|
|
9f2f0e29be | ||
|
|
e43107ccf7 | ||
|
|
c2ebadd87a | ||
|
|
3521e7b0e7 | ||
|
|
9d0aad933e | ||
|
|
3bd3df8fb2 | ||
|
|
71e1f5ae9d | ||
|
|
36c3d354cd | ||
|
|
9f0af1ba86 | ||
|
|
f74e2262dc | ||
|
|
2971144d7f | ||
|
|
2e2723427b | ||
|
|
ee6127ffcc | ||
|
|
dcd6fa6958 | ||
|
|
7442216962 | ||
|
|
bb0c781daa | ||
|
|
56e5a5ac53 | ||
|
|
419fa4906d | ||
|
|
16e7617b1e | ||
|
|
2ca5798f89 | ||
|
|
a08ddc1b8c | ||
|
|
83153e2777 | ||
|
|
5b72b93248 | ||
|
|
c7d911451c | ||
|
|
c400cc317d | ||
|
|
50784c9958 | ||
|
|
c4a5d406c7 | ||
|
|
d933eef8cc | ||
|
|
ce84069429 | ||
|
|
8140e56cbc | ||
|
|
de40e0e22a | ||
|
|
44ccd111b2 | ||
|
|
7ac0889b78 | ||
|
|
c4a5996b21 | ||
|
|
9eaca7bcb2 | ||
|
|
90629aecb4 | ||
|
|
cb6a75de3b | ||
|
|
9bb066596c | ||
|
|
a0b6610b7d | ||
|
|
c4e06f90f8 | ||
|
|
60a525f0b8 | ||
|
|
fe6067eeed | ||
|
|
f72294e2b9 | ||
|
|
409b98dd39 | ||
|
|
0168b882a8 | ||
|
|
9aa83354bd | ||
|
|
e311d82b0a | ||
|
|
531e526d33 | ||
|
|
a2a6c49ae0 | ||
|
|
15ae6d91d9 | ||
|
|
f3ba3706ba | ||
|
|
0ab6ea2e26 | ||
|
|
05d17f329f | ||
|
|
c7e9b67698 | ||
|
|
f654620816 | ||
|
|
5bd4885241 | ||
|
|
91643b06f2 | ||
|
|
d35ec1b7c4 | ||
|
|
d2609d11ab | ||
|
|
014d3499f0 | ||
|
|
edd8a412b5 | ||
|
|
7c57eef9f7 | ||
|
|
8df4d5d808 | ||
|
|
98b0fd4a4f | ||
|
|
3e8c9acb02 | ||
|
|
d829dd01de | ||
|
|
41803d21c9 | ||
|
|
b58b66178c | ||
|
|
7c40cf1fb7 | ||
|
|
a923c62dac | ||
|
|
00d9c91a53 | ||
|
|
6fa101c699 | ||
|
|
1372833dd8 | ||
|
|
7d57750d73 | ||
|
|
28c06706b4 | ||
|
|
18146d2ef7 | ||
|
|
52c65afce6 | ||
|
|
8f76c9b09d | ||
|
|
fffc94fbdd | ||
|
|
1f398a8b4c | ||
|
|
98f4010cb7 | ||
|
|
d34e8940a7 | ||
|
|
bbf3c33a89 | ||
|
|
f69fee98df | ||
|
|
f9b717965f | ||
|
|
01ad439d0a | ||
|
|
29ad8d9dbc | ||
|
|
6ffad11cba | ||
|
|
dc62840299 | ||
|
|
ae9c669ca3 | ||
|
|
cd4b9b3be6 | ||
|
|
e7fc5719e3 | ||
|
|
29350e0782 | ||
|
|
2c9821e670 | ||
|
|
a61050f8fa | ||
|
|
747d25b439 | ||
|
|
cafd36b85d | ||
|
|
d7450d9699 | ||
|
|
4224a02d16 | ||
|
|
82bf21d54b | ||
|
|
e2672d5d94 | ||
|
|
8d30ccf6fe | ||
|
|
be995930a0 | ||
|
|
fbd52c5a85 | ||
|
|
10e7a7fd27 | ||
|
|
92a0ec03b1 | ||
|
|
83a07f7ee4 | ||
|
|
32628be87b | ||
|
|
102e8964ee | ||
|
|
742ea9f245 | ||
|
|
25f843331c | ||
|
|
c6680d1f03 | ||
|
|
f5279fc91e | ||
|
|
ba50376c85 | ||
|
|
dd1395f3f4 | ||
|
|
450df2ce6a | ||
|
|
f9e384a87d | ||
|
|
81484b7ae3 | ||
|
|
a14809a96a | ||
|
|
1753b01a1b | ||
|
|
86e7924675 | ||
|
|
e0daa923c6 | ||
|
|
32c67d5f62 | ||
|
|
7580706bd0 | ||
|
|
68da5085ea | ||
|
|
55d0c0f66b | ||
|
|
5d35d56837 | ||
|
|
a9b150960e | ||
|
|
72a9e81ba1 | ||
|
|
0032a51051 | ||
|
|
faa9102815 | ||
|
|
525ce59b8b | ||
|
|
00055a9f32 | ||
|
|
3da62e366f | ||
|
|
66ba0fe18e | ||
|
|
cc7a7386be | ||
|
|
f1a89f1001 | ||
|
|
83ad5538b0 | ||
|
|
8e1497cf71 | ||
|
|
9b4da63b0d | ||
|
|
1fad5adbd2 | ||
|
|
72497154a7 | ||
|
|
5dcab4fe9e | ||
|
|
d592f5eb62 | ||
|
|
d85cbca8ea | ||
|
|
be92ae76d6 | ||
|
|
3cfedd4ae9 | ||
|
|
cd88acf337 | ||
|
|
adf628b3b0 | ||
|
|
bbb945283b | ||
|
|
10b7691313 | ||
|
|
1e93556f8e | ||
|
|
77bfb852e0 | ||
|
|
abeb0ad82f | ||
|
|
722304c4a1 | ||
|
|
9e5ea8c052 | ||
|
|
e6dc46a270 | ||
|
|
cf0fffcc3b | ||
|
|
64835b0de9 | ||
|
|
ca3ae925d1 | ||
|
|
245e17ed42 | ||
|
|
22605323c1 | ||
|
|
ca0e8f93f9 | ||
|
|
8f763f9c5c | ||
|
|
1e8e619762 | ||
|
|
5d3d5b4c72 | ||
|
|
81029b203e | ||
|
|
1fbfb3970d | ||
|
|
aa9e590574 | ||
|
|
495ef70d41 | ||
|
|
8d45bf6ee9 | ||
|
|
5ea7e397c6 | ||
|
|
70af77f06e | ||
|
|
21da8f0274 | ||
|
|
9be2b578a2 | ||
|
|
bcbc640840 | ||
|
|
a569240444 | ||
|
|
f071b9c4f2 | ||
|
|
681f116733 | ||
|
|
b1bfa713e2 | ||
|
|
8133bf1916 | ||
|
|
7fc61cdad3 | ||
|
|
0f926c96c8 | ||
|
|
557409ea72 | ||
|
|
f0a847b135 | ||
|
|
5181b271bc | ||
|
|
38fe00fbe0 | ||
|
|
be100b24d1 | ||
|
|
0ef338b1e8 | ||
|
|
12130f8601 | ||
|
|
dfe6c9e8e7 | ||
|
|
cfd4d18c62 | ||
|
|
7ee60c8986 | ||
|
|
0fee24734d | ||
|
|
4b7895c3ab | ||
|
|
63610a324c | ||
|
|
7a72daf3ec | ||
|
|
f33acd67ec | ||
|
|
9a5ac036d6 | ||
|
|
e0d8094268 | ||
|
|
1d5648f882 | ||
|
|
d528093510 | ||
|
|
738a11d96f | ||
|
|
01744889fb | ||
|
|
f5c4362f0d | ||
|
|
268dd4d469 | ||
|
|
41c207af14 | ||
|
|
513b7ecd78 | ||
|
|
83fb4663f6 | ||
|
|
7e88993b5c | ||
|
|
6e6b7f37b2 | ||
|
|
a1152446d9 | ||
|
|
3eab9b30a1 | ||
|
|
573587b894 | ||
|
|
adfb395492 | ||
|
|
b4b4f09287 | ||
|
|
31c80ff07b | ||
|
|
d20e94b422 | ||
|
|
1e7fefbde9 | ||
|
|
42f68a1109 | ||
|
|
f47c704e29 | ||
|
|
be3cfd8d2d | ||
|
|
d6ded9e64b | ||
|
|
6b0704ec76 | ||
|
|
a896ae69d0 | ||
|
|
9ba4fe2d0f | ||
|
|
29b904998e | ||
|
|
bf422cb0b2 | ||
|
|
bf87c3e3f1 | ||
|
|
b96c6bd324 | ||
|
|
0293318b59 | ||
|
|
38588b8204 | ||
|
|
f2d22e6b7f | ||
|
|
45848306bc | ||
|
|
b160b25d7d | ||
|
|
d1e6d533fc | ||
|
|
ee168ed5e2 | ||
|
|
6c8e3d88bd | ||
|
|
77b2e416c1 | ||
|
|
e02eefdc8e | ||
|
|
fd4f5ec574 | ||
|
|
b327b38113 | ||
|
|
76ad662f56 | ||
|
|
4ad3c397b6 | ||
|
|
75d2b46c7a | ||
|
|
a7659a0c2e | ||
|
|
e3a740f66a | ||
|
|
af281481d5 | ||
|
|
5f6758554d | ||
|
|
2b2a8c1d2e | ||
|
|
156f5aec91 | ||
|
|
9045e5aa90 | ||
|
|
5ca9d2f1b1 | ||
|
|
6cb5bcfb0c | ||
|
|
ffaff7c356 | ||
|
|
130fc4996f | ||
|
|
a95141048d | ||
|
|
2d82382f34 | ||
|
|
6afd975913 | ||
|
|
0df0eb104c | ||
|
|
f1c5d3605c | ||
|
|
afed289647 | ||
|
|
22fb1fb8c9 | ||
|
|
5809d4efca | ||
|
|
332e215c85 | ||
|
|
9eefbe9fb9 | ||
|
|
3fa86d3236 | ||
|
|
f0e125df08 | ||
|
|
8bf7d0efd4 | ||
|
|
8a71dfa591 | ||
|
|
928dee677f | ||
|
|
bf5500eb19 | ||
|
|
a5efb1b4b6 | ||
|
|
5aa77a67a8 | ||
|
|
c5c22f8dc9 | ||
|
|
ad3ae5e6b1 | ||
|
|
ed029ecb01 | ||
|
|
ff45c64a22 | ||
|
|
c953091e8d | ||
|
|
fd30ab7168 | ||
|
|
dca3dddba0 | ||
|
|
41eb4c54a4 | ||
|
|
15a2333010 | ||
|
|
1061d2867f | ||
|
|
64ba1f1ea1 | ||
|
|
196cc664c8 | ||
|
|
1d871d4d68 | ||
|
|
89475a9838 | ||
|
|
52d335cbfd | ||
|
|
333ca4f36a | ||
|
|
d2e18c5400 | ||
|
|
f04cc92b44 | ||
|
|
fa3a048a6c | ||
|
|
6200034dd0 | ||
|
|
9a25d82c48 | ||
|
|
95e0d3953e | ||
|
|
fb91da4b69 | ||
|
|
74fcd2df7b | ||
|
|
1a88a08454 | ||
|
|
688cf579d6 | ||
|
|
ba9ba5f55b | ||
|
|
8341733dc2 | ||
|
|
54f7a0f20e | ||
|
|
b2382d91d6 | ||
|
|
b729780ac1 | ||
|
|
6f4c516d0c | ||
|
|
b9bdcba4f9 | ||
|
|
bd69863799 | ||
|
|
375fdc444e | ||
|
|
e832592b35 | ||
|
|
a15d4e097e | ||
|
|
2597d2455c | ||
|
|
16e817d42c | ||
|
|
c6d39a9e60 | ||
|
|
b860f1a170 | ||
|
|
0cebd0b7f3 | ||
|
|
91742c1b80 | ||
|
|
64bc79de38 | ||
|
|
55239be477 | ||
|
|
0feebb662f | ||
|
|
1699f9d141 | ||
|
|
7ac9df9496 | ||
|
|
2074818cd0 | ||
|
|
ecb3eaf541 | ||
|
|
345455da4b | ||
|
|
1937fddbfd | ||
|
|
e7534bbcbd | ||
|
|
305192eae6 | ||
|
|
0541aa3373 | ||
|
|
81fe8b7435 | ||
|
|
4ca26b4e32 | ||
|
|
d348a67ba8 | ||
|
|
e2f03ee8d6 | ||
|
|
0e64c46064 | ||
|
|
987a4125ae | ||
|
|
a7e4c1a5a5 | ||
|
|
6d66982d35 | ||
|
|
7c78e05649 | ||
|
|
61383ef294 | ||
|
|
469d4ec566 | ||
|
|
418f1146b7 | ||
|
|
170c8885d0 | ||
|
|
e3f04f4ab8 | ||
|
|
791b8142bd | ||
|
|
ffff89ae96 | ||
|
|
3c8b0f6308 | ||
|
|
a01aa8c335 | ||
|
|
1dc1e6f081 | ||
|
|
b86447cdbf | ||
|
|
bf1e805269 | ||
|
|
0b0d551730 | ||
|
|
22016d2856 | ||
|
|
6ef5d66521 | ||
|
|
bbf80408d4 | ||
|
|
f7c7614625 | ||
|
|
c5e71230e3 | ||
|
|
d61e15a02c | ||
|
|
981d286e13 | ||
|
|
f58c3e9a67 | ||
|
|
c316c381f8 | ||
|
|
066ae678f9 | ||
|
|
c3a75a5525 | ||
|
|
14257ba448 | ||
|
|
2c7e86fa97 | ||
|
|
63d7b7a471 | ||
|
|
98a882f450 | ||
|
|
868fd1ddc5 | ||
|
|
9c19819a08 | ||
|
|
62ef634bc0 | ||
|
|
f4158deb0a | ||
|
|
e61a224fc6 | ||
|
|
c83fb868e4 | ||
|
|
0a118f1740 | ||
|
|
d5d6edd2fb | ||
|
|
e17382f441 | ||
|
|
6c6fe5378f | ||
|
|
b68a31b2ee | ||
|
|
0be362e82c | ||
|
|
17a917ad00 | ||
|
|
f975fbf221 | ||
|
|
1741813003 | ||
|
|
7e7e24021b | ||
|
|
a662106228 | ||
|
|
be98a562d4 | ||
|
|
2af4692e1a | ||
|
|
b525ac18bc | ||
|
|
3fdca1ba64 | ||
|
|
9cc721bf80 | ||
|
|
d9cbd5d173 | ||
|
|
59f5cb9d35 | ||
|
|
bd020c14fb | ||
|
|
7b9f814d37 | ||
|
|
7a6fe30ee5 | ||
|
|
9910adbb40 | ||
|
|
ad6a578863 | ||
|
|
365120ed9f | ||
|
|
dbd0541ad1 | ||
|
|
7ce16856ec | ||
|
|
8fff3e4ec0 | ||
|
|
53f559a750 | ||
|
|
924fc30697 | ||
|
|
41955f8927 | ||
|
|
83689f420c | ||
|
|
1c68a0fd4b | ||
|
|
9e25db7089 | ||
|
|
7eacd54a9c | ||
|
|
be44519431 | ||
|
|
66f35b2720 | ||
|
|
23902d2465 | ||
|
|
1c3717edef | ||
|
|
17fa0f3eb0 | ||
|
|
247e19f1e3 | ||
|
|
54fae816d2 | ||
|
|
3b70a2cc2d | ||
|
|
acd4a16dcb | ||
|
|
550c84c367 | ||
|
|
e35e0be251 | ||
|
|
db5ada2cfb | ||
|
|
643f452064 | ||
|
|
bbda6c6785 | ||
|
|
e6449cd818 | ||
|
|
708527db77 | ||
|
|
b1aa6c5699 | ||
|
|
eeaa1a7f07 | ||
|
|
52b7183935 | ||
|
|
386833ae64 | ||
|
|
d4a48ce585 | ||
|
|
4931cdd272 | ||
|
|
d7933dc73f | ||
|
|
9a1048cc17 | ||
|
|
a8fd0736b3 | ||
|
|
10d884a837 | ||
|
|
52b28c79c7 | ||
|
|
8a36e55813 | ||
|
|
5103bb2697 | ||
|
|
c6a07714ba | ||
|
|
48c3500033 | ||
|
|
d155e75a5d | ||
|
|
fa481129a9 | ||
|
|
3c1402dab7 | ||
|
|
a7f4189bd3 | ||
|
|
64ed13de7c | ||
|
|
21394eb29e | ||
|
|
fbb8c3613f | ||
|
|
7778da80d5 | ||
|
|
e791e102d5 | ||
|
|
deb73450c3 | ||
|
|
cc9d1bf4f2 | ||
|
|
b025ef8b22 | ||
|
|
7bda0f400a | ||
|
|
3b7a113a11 | ||
|
|
ee636bf88c | ||
|
|
52144d8e52 | ||
|
|
513c686dea | ||
|
|
29cc2429ae | ||
|
|
31219e9ac1 | ||
|
|
3beab5a9e1 | ||
|
|
7558311531 | ||
|
|
106d08a899 | ||
|
|
02f203475d | ||
|
|
b4460eddf7 | ||
|
|
90e06116d1 | ||
|
|
1e4397ed7b | ||
|
|
e9cc2d0e52 | ||
|
|
376847b489 | ||
|
|
5d61b83c50 | ||
|
|
561b3a594b | ||
|
|
2d0acb68b1 | ||
|
|
919c6c40e2 | ||
|
|
120e9da1c9 | ||
|
|
47c6454c00 | ||
|
|
02f49cd392 | ||
|
|
8117ddb6ce | ||
|
|
d372fa8e6e | ||
|
|
c3ed865a3a | ||
|
|
96c137ec4b | ||
|
|
c5cd683aa5 | ||
|
|
c5cdabaa3a | ||
|
|
d19be3f2cb | ||
|
|
a9f55aa64f | ||
|
|
dfb0f79c92 | ||
|
|
4a59438c0c | ||
|
|
f35710d652 | ||
|
|
c19a532f3e | ||
|
|
be6b278b3c | ||
|
|
78c16dc278 | ||
|
|
09d2839a00 | ||
|
|
d17d52436f | ||
|
|
5c522a33d0 | ||
|
|
c9cf89adeb | ||
|
|
c5c996cb7a | ||
|
|
f2ec258e7a | ||
|
|
8c29f21970 | ||
|
|
5b730d2c38 | ||
|
|
609e84a8ae | ||
|
|
7ca778f81b | ||
|
|
93b194af3b | ||
|
|
b3e1f32ffe | ||
|
|
d78b3bffeb | ||
|
|
bff5038a64 | ||
|
|
0c7fcfbcc5 | ||
|
|
9d6fc15959 | ||
|
|
5bad5e1031 | ||
|
|
f8d6ec3a8f | ||
|
|
9a3dc81630 | ||
|
|
3d9b97ccb5 | ||
|
|
2c3dbba052 | ||
|
|
907eecd030 | ||
|
|
75026bf42d | ||
|
|
d217fb33a9 | ||
|
|
8cea32d01b | ||
|
|
c8d2da0c07 | ||
|
|
a458f51b9a | ||
|
|
bd8ac2935b | ||
|
|
dd59cc1468 | ||
|
|
fd365c52cc | ||
|
|
ad7e77a067 | ||
|
|
6b9135a205 | ||
|
|
fdca5b1c60 | ||
|
|
f891b30f9f | ||
|
|
8fbd8070f2 | ||
|
|
657dec1c10 | ||
|
|
0d93dcdc45 | ||
|
|
5a50c0e1e6 | ||
|
|
ab8da89fbc | ||
|
|
c9edf47643 | ||
|
|
84328bf693 | ||
|
|
6fdbf0b48e | ||
|
|
8b1d5b3cb4 | ||
|
|
bf69d23379 | ||
|
|
a4e3031796 | ||
|
|
286e7956f2 | ||
|
|
e04b64a326 | ||
|
|
c86a99df06 | ||
|
|
3b69c4e7c1 | ||
|
|
bc5be9449d | ||
|
|
b968e59db1 | ||
|
|
fa06c4a729 | ||
|
|
81b99515cd | ||
|
|
5e6c713f9d | ||
|
|
376425cc98 | ||
|
|
38cff550e1 | ||
|
|
64781c1cca | ||
|
|
e82e85b5ea | ||
|
|
2b84a27cdc | ||
|
|
6f7f5cbabc | ||
|
|
174a8696b0 | ||
|
|
d5a27ba814 | ||
|
|
6e2e488565 | ||
|
|
7d02ef2b3e | ||
|
|
f8f2719c5d | ||
|
|
da6faaf1a5 | ||
|
|
350068d6f1 | ||
|
|
70bee4265b | ||
|
|
18ce8cf2f4 | ||
|
|
b50a55cce7 | ||
|
|
e6f0e18aed | ||
|
|
fd7daa407a | ||
|
|
0dead93606 | ||
|
|
5d6e8cf9b3 | ||
|
|
a0544e21e3 | ||
|
|
d54112d41c | ||
|
|
1a0ba40b43 | ||
|
|
5d8ca9566a | ||
|
|
834fa719b2 | ||
|
|
89bde2739a | ||
|
|
46dbc9ae62 | ||
|
|
71554fca59 | ||
|
|
1c76b5886f | ||
|
|
5007b70683 | ||
|
|
5694cbd945 | ||
|
|
eee3c34dd7 | ||
|
|
cac39ad539 | ||
|
|
1b68cdf7db | ||
|
|
845c9a0f2e | ||
|
|
24c69af942 | ||
|
|
c656bc4bb6 | ||
|
|
025b60e564 | ||
|
|
1e86964d8f | ||
|
|
61d4d7005e | ||
|
|
d0ed9faf50 | ||
|
|
8ed12170de | ||
|
|
d2ba5cbe4d | ||
|
|
6b6d3c7307 | ||
|
|
362b5b9c69 | ||
|
|
3cde12e893 | ||
|
|
d2214480f6 | ||
|
|
b8bd1a8ae6 | ||
|
|
0bfef0c2ce | ||
|
|
f2ce98fda5 | ||
|
|
5f08215571 | ||
|
|
9567a6ddf9 | ||
|
|
4416c56884 | ||
|
|
68328a9449 | ||
|
|
141f2a3f39 | ||
|
|
7bbca06033 | ||
|
|
ebb72265b9 | ||
|
|
c98f433da6 | ||
|
|
2346ef7089 | ||
|
|
8aac6474da | ||
|
|
ffcecf38c8 | ||
|
|
77342206b1 | ||
|
|
b6a44e7a7c | ||
|
|
e138d357c7 | ||
|
|
66645982e9 | ||
|
|
4347f55077 | ||
|
|
ab9d45c775 | ||
|
|
9c0c662f25 | ||
|
|
63abdb2d53 | ||
|
|
47e2693368 | ||
|
|
b909cbe666 | ||
|
|
95f5ce13ba | ||
|
|
fed1496e68 | ||
|
|
da6993730c | ||
|
|
0a1d462ace | ||
|
|
1387482db0 | ||
|
|
b7a86324dd | ||
|
|
babc5a6424 | ||
|
|
74a468383c | ||
|
|
3a48f0ff0d | ||
|
|
e26363adf6 | ||
|
|
35d97d42c5 | ||
|
|
4fa7d07500 | ||
|
|
15f428528b | ||
|
|
7fa805fe3a | ||
|
|
fd9c97a126 | ||
|
|
f081154804 | ||
|
|
866affdf45 | ||
|
|
30aee556f1 | ||
|
|
b12c18aa08 | ||
|
|
f17a47d088 | ||
|
|
d79f096749 | ||
|
|
5b82b91c6a | ||
|
|
4a6b87ac1c | ||
|
|
1bea06354e | ||
|
|
5fbd5aaf10 | ||
|
|
0290a6d918 | ||
|
|
2576c48441 | ||
|
|
eb02dd2986 | ||
|
|
d92570fa3b | ||
|
|
38c988d2a2 | ||
|
|
0927282d41 | ||
|
|
5ffd59619c | ||
|
|
a739926ad4 | ||
|
|
e41c38f41d | ||
|
|
2de05b84aa | ||
|
|
0e9bdef9ca | ||
|
|
8e70e005c1 | ||
|
|
3817dbc925 | ||
|
|
63ec669c52 | ||
|
|
afc5702796 | ||
|
|
41ec66b58a | ||
|
|
936d3ca7fc | ||
|
|
f8b4b7b74d | ||
|
|
bd865977b0 | ||
|
|
d056db5617 | ||
|
|
7685677ada | ||
|
|
eb0aa81492 | ||
|
|
dc52531f28 | ||
|
|
5a20034b9f | ||
|
|
5cd0ef0d8a | ||
|
|
4daf47bb5f | ||
|
|
3e0dbd8433 | ||
|
|
fc4d3b24f6 | ||
|
|
3a9eab55a4 | ||
|
|
546b34275d | ||
|
|
3ee4cf27d5 | ||
|
|
87da95b9a4 | ||
|
|
3368e30e15 | ||
|
|
f1ea5ad8f1 | ||
|
|
fa2d5f8492 | ||
|
|
0f2c5de161 | ||
|
|
b69937d4fd | ||
|
|
e82faacbb2 | ||
|
|
2ab5c67545 | ||
|
|
358d01b12e | ||
|
|
95460fabbb | ||
|
|
0fb882b3ad | ||
|
|
3d0382d279 | ||
|
|
59d5aa4515 | ||
|
|
2dff9f9b17 | ||
|
|
03fded672e | ||
|
|
a21c1f5329 | ||
|
|
37815ced63 | ||
|
|
b7f9b8d668 | ||
|
|
f68af78099 | ||
|
|
027abffa01 | ||
|
|
5dfba4dd5e | ||
|
|
d0ae7e9cf9 | ||
|
|
5a57e984de | ||
|
|
473f4d7c24 | ||
|
|
35bfea2dbd | ||
|
|
62cb30cb5b | ||
|
|
9d2eb6f18b | ||
|
|
d5cd57c26d | ||
|
|
37695735e0 | ||
|
|
c15625c063 | ||
|
|
cd65bd4c2a | ||
|
|
fc3fead235 | ||
|
|
2e00282560 | ||
|
|
54d740e861 | ||
|
|
6cdd4cba9e |
27
.github/ISSUE_TEMPLATE/bug-report-english.md
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
name: Bug report English
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: "\U0001F41Bbug"
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
Describe the bug: a clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Click on '....'
|
||||
2. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Environment**
|
||||
- OS: [e.g. macOS High Sierra , Windows 10 Pro 1903, Ubuntu 19.04]
|
||||
- Version: [e.g. Usamin (18.0.0)]
|
||||
Check at 'Application,' 'About TheDesk' at top of the window.
|
||||
- Your instance: [e.g. mastodon.social]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
27
.github/ISSUE_TEMPLATE/bug-report-japanese----------.md
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
name: Bug report Japanese(日本語のバグ報告)
|
||||
about: 迅速なバグ撲滅のために
|
||||
title: ''
|
||||
labels: "\U0001F41Bbug"
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
バグの簡単な説明を最初に入れます。
|
||||
|
||||
**再現方法**
|
||||
このようにするとバグが発生しました。
|
||||
1. '....'をクリックすると
|
||||
2. エラーが出ます
|
||||
|
||||
**本来の挙動**
|
||||
本来どのように動くのが望ましいかを記入
|
||||
|
||||
**環境**
|
||||
- OS: [例 macOS High Sierra , Windows 10 Pro 1903, Ubuntu 19.04]
|
||||
- バージョン: [例 Usamin (18.0.0)]
|
||||
TheDesk画面上部の「アプリケーション」から「TheDeskについて」で確認
|
||||
- インスタンス: [例. mastodon.social]
|
||||
|
||||
**追記**
|
||||
追記
|
||||
13
.gitignore
vendored
@@ -3,8 +3,7 @@
|
||||
*.7z
|
||||
*.exe
|
||||
TheDesk-*
|
||||
app/build
|
||||
build
|
||||
build/*
|
||||
app/.DS_Store
|
||||
.DS_Store
|
||||
.vs/*
|
||||
@@ -13,3 +12,13 @@ enq.md
|
||||
app/.tkn
|
||||
app/node_modules
|
||||
app/js/login/tkn.js
|
||||
app/view/en
|
||||
app/view/ja
|
||||
app/view/de
|
||||
app/view/bg
|
||||
app/view/cs
|
||||
app/view/ps
|
||||
app/view/es-AR
|
||||
app/git
|
||||
*.code-workspace
|
||||
releasenote.md
|
||||
|
||||
10
.travis.yml
@@ -3,20 +3,26 @@ os:
|
||||
- linux
|
||||
- osx
|
||||
language: node_js
|
||||
env:
|
||||
- YARN_GPG=no
|
||||
node_js:
|
||||
- '10.15.2'
|
||||
cache:
|
||||
yarn: true
|
||||
script: node -v
|
||||
before_deploy:
|
||||
- npm install electron-builder -g
|
||||
- yarn global add electron-builder
|
||||
- cd app
|
||||
- VERSION=$(cat package.json | grep version | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,\",]//g' | tr -d '[[:space:]]')
|
||||
- npm install
|
||||
- yarn install --no-lockfile --prod
|
||||
- yarn construct
|
||||
- if [ "$TRAVIS_OS_NAME" = "osx" ];then electron-builder --mac -p never;else :;fi
|
||||
- if [ "$TRAVIS_OS_NAME" = "linux" ];then electron-builder --linux --x64 -p never;else :;fi
|
||||
- if [ "$TRAVIS_OS_NAME" = "linux" ];then cd ../build;else :;fi
|
||||
- if [ "$TRAVIS_OS_NAME" = "linux" ];then ls;else :;fi
|
||||
- if [ "$TRAVIS_OS_NAME" = "linux" ];then mv thedesk-*.zip thedesk.zip;else :;fi
|
||||
- if [ "$TRAVIS_OS_NAME" = "linux" ];then cd ../app;else :;fi
|
||||
- if [ "$TRAVIS_OS_NAME" = "windows" ];then yarn add electron-builder;else :;fi
|
||||
- if [ "$TRAVIS_OS_NAME" = "windows" ];then electron-builder --win --ia32 -p never;else :;fi
|
||||
- if [ "$TRAVIS_OS_NAME" = "windows" ];then cd ../build;else :;fi
|
||||
- if [ "$TRAVIS_OS_NAME" = "windows" ];then ls;else :;fi
|
||||
|
||||
67
README.md
@@ -5,8 +5,8 @@
|
||||
|
||||
[](https://travis-ci.org/cutls/TheDesk)
|
||||
[](https://translate.thedesk.top/project/thedesk)
|
||||
[](https://bit.ly/31zqMmZ)
|
||||
[](https://github.com/cutls/TheDesk/releases)
|
||||
[](https://github.com/cutls/TheDesk/releases)
|
||||

|
||||
Mastodon/Misskey client for PC(Windows/Linux/macOS)
|
||||
オープンソースSNSマストドン/MisskeyのPC向けクライアント[日本語はこちら](README_ja.md)
|
||||
@@ -14,6 +14,7 @@ Mastodon/Misskey client for PC(Windows/Linux/macOS)
|
||||
Download:[TheDesk](https://thedesk.top) [](https://status.cutls.com)
|
||||
|
||||
<a href="https://www.patreon.com/cutls"><img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" alt="Become a Patron!" width="160"></a>
|
||||
<a href="https://liberapay.com/cutls/donate"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a>
|
||||

|
||||
|
||||
## License
|
||||
@@ -21,12 +22,13 @@ Download:[TheDesk](https://thedesk.top) [
|
||||
|
||||
The icon is provided under [Creative Commons BY-NC-SA](https://creativecommons.org/licenses/by-nc-sa/4.0/)
|
||||
[Press Kit](https://dl.thedesk.top/press/TheDesk+PressKit.zip)
|
||||
[Press Kit](https://d2upiril6ywqp9.cloudfront.net/press/TheDesk+PressKit.zip)
|
||||
|
||||
* [PNG](https://dl.thedesk.top/press/TheDesk.png)
|
||||
* [Monotone SVG](https://dl.thedesk.top/press/TheDesk.svg)
|
||||
* [ico](https://dl.thedesk.top/press/TheDesk.ico)
|
||||
* [icns](https://dl.thedesk.top/press/TheDesk.icns)
|
||||
* [PNG 512x512](https://d2upiril6ywqp9.cloudfront.net/press/thedesk.png)
|
||||
* [SVG 4095x4096](https://d2upiril6ywqp9.cloudfront.net/press/thedesk-fullcolor.svg)
|
||||
* [ico 256x256](https://d2upiril6ywqp9.cloudfront.net/press/thedesk.ico)
|
||||
* [icns old](https://d2upiril6ywqp9.cloudfront.net/press/thedesk.icns)
|
||||
* [Illustrator .ai](https://d2upiril6ywqp9.cloudfront.net/press/thedesk.ai)
|
||||
|
||||
The default sounds of notifications is provided [Creative Commons BY](https://creativecommons.org/licenses/by/4.0/)
|
||||
|
||||
@@ -39,12 +41,13 @@ The default sounds of notifications is provided [Creative Commons BY](https://cr
|
||||
|
||||
* 日本語(Japanese)
|
||||
* English
|
||||
* de, cs, bg(from Crowdin)
|
||||
|
||||
### Translation
|
||||
|
||||
Crowdin project is available! Visit: https://translate.thedesk.top
|
||||
|
||||
## Requirement
|
||||
## Requirement and development
|
||||
|
||||
* Electron 4.2 or above(install yourself)
|
||||
* electron-dl(in package.json)
|
||||
@@ -57,6 +60,10 @@ Crowdin project is available! Visit: https://translate.thedesk.top
|
||||
* sumchecker(in package.json)
|
||||
* Ability to read unformated files!(install yourself)
|
||||
|
||||
### Run on developer mode
|
||||
|
||||
`npm run dev` on `app` folder.
|
||||
|
||||
## Contributors
|
||||
|
||||
Build for macOS
|
||||
@@ -69,19 +76,41 @@ Build for Linux
|
||||
|
||||
Fellow coder
|
||||
|
||||
* [kPherox](https://www.kr-kp.com/)
|
||||
* [kPherox](https://pl.kpherox.dev/kPherox)
|
||||
|
||||
## Build
|
||||
|
||||
You have to use either **npm** or **yarn**. Whichever you use, it works well.
|
||||
|
||||
### npm
|
||||
|
||||
```sh
|
||||
git clone https://github.com/cutls/TheDesk
|
||||
cd TheDesk/app
|
||||
npm install
|
||||
npm install --only=dev
|
||||
npm run construct
|
||||
```
|
||||
|
||||
### yarn
|
||||
|
||||
```sh
|
||||
git clone https://github.com/cutls/TheDesk
|
||||
cd TheDesk/app
|
||||
# Linux or macOS
|
||||
yarn install --no-lockfile
|
||||
# Windows
|
||||
yarn install
|
||||
|
||||
yarn construct
|
||||
```
|
||||
|
||||
run `npm run dev` or `yarn dev` to launch developer version with console(click `view`)
|
||||
|
||||
### electron-builder(Recommended)
|
||||
Use npm scripts.
|
||||
Use scripts(they can work well with npm, **yarn**).
|
||||
|
||||
#### npm
|
||||
|
||||
```sh
|
||||
# Build for current platform
|
||||
@@ -95,6 +124,21 @@ npm run build:win
|
||||
npm run build:all
|
||||
```
|
||||
|
||||
#### yarn
|
||||
|
||||
```sh
|
||||
# Build for current platform
|
||||
yarn build
|
||||
|
||||
# Select build target
|
||||
## Windows
|
||||
yarn build:win
|
||||
|
||||
## Windows and Linux (The macOS target should run on macOS. So, this option hasn't include the build for macOS)
|
||||
yarn build:all
|
||||
```
|
||||
|
||||
|
||||
Config is all on package.json
|
||||
|
||||
### electron-packager
|
||||
@@ -120,3 +164,8 @@ macOS
|
||||
Did you find a bug with Pleroma accounts?
|
||||
Pleroma **does not** follow Mastodon API rules completely although Pleroma developers say so.
|
||||
Please write issues to improve TheDesk affinity with Pleroma.
|
||||
|
||||
## Vulnerabilities when `npm i`???
|
||||
|
||||
No, if your npm says materialize-css has vulnerabilities(CVE-2019-11002/3/4), look at [here](https://github.com/Dogfalo/materialize/issues/6286) under discussion.
|
||||
|
||||
|
||||
63
README_ja.md
@@ -5,8 +5,8 @@
|
||||
|
||||
[](https://travis-ci.org/cutls/TheDesk)
|
||||
[](https://translate.thedesk.top/project/thedesk)
|
||||
[](https://bit.ly/31zqMmZ)
|
||||
[](https://github.com/cutls/TheDesk/releases)
|
||||
[](https://github.com/cutls/TheDesk/releases)
|
||||

|
||||
Mastodon/Misskey client for PC(Windows/Linux/macOS)
|
||||
オープンソースSNSマストドン/MisskeyのPC向けクライアント
|
||||
@@ -21,12 +21,13 @@ Download:[TheDesk](https://thedesk.top) [
|
||||
|
||||
アイコンは[クリエイティブ・コモンズ 表示-非営利-継承](https://creativecommons.org/licenses/by-nc-sa/4.0/)で提供されています。
|
||||
[プレスキット](https://dl.thedesk.top/press/TheDesk+PressKit.zip)
|
||||
[プレスキット](https://d2upiril6ywqp9.cloudfront.net/press/TheDesk+PressKit.zip)
|
||||
|
||||
* [PNG](https://dl.thedesk.top/press/TheDesk.png)
|
||||
* [Monotone SVG](https://dl.thedesk.top/press/TheDesk.svg)
|
||||
* [ico](https://dl.thedesk.top/press/TheDesk.ico)
|
||||
* [icns](https://dl.thedesk.top/press/TheDesk.icns)
|
||||
* [PNG 512x512](https://d2upiril6ywqp9.cloudfront.net/press/thedesk.png)
|
||||
* [SVG 4095x4096](https://d2upiril6ywqp9.cloudfront.net/press/thedesk-fullcolor.svg)
|
||||
* [ico 256x256](https://d2upiril6ywqp9.cloudfront.net/press/thedesk.ico)
|
||||
* [icns old](https://d2upiril6ywqp9.cloudfront.net/press/thedesk.icns)
|
||||
* [Illustrator .ai](https://d2upiril6ywqp9.cloudfront.net/press/thedesk.ai)
|
||||
|
||||
標準の通知音は [Creative Commons BY](https://creativecommons.org/licenses/by/4.0/) で提供されています。
|
||||
|
||||
@@ -39,6 +40,7 @@ Download:[TheDesk](https://thedesk.top) [
|
||||
* ドイツ語, チェコ語, ブルガリア語(from Crowdin)
|
||||
|
||||
### 翻訳
|
||||
|
||||
@@ -57,6 +59,10 @@ Crowdinから翻訳に参加してみませんか?: https://translate.thedesk.
|
||||
* sumchecker(in package.json)
|
||||
* Ability to read unformated files!(自分で入れて)
|
||||
|
||||
### デベロッパーモード
|
||||
|
||||
`npm run dev`を`app`フォルダ内で実行
|
||||
|
||||
## 主なコントリビューター
|
||||
|
||||
macOSビルダー
|
||||
@@ -67,22 +73,42 @@ Linuxビルダー
|
||||
|
||||
* [ぽぷんじゃ](https://popon.pptdn.jp/@popn_ja)
|
||||
|
||||
iTunes NowPlayingにアルバムアートワークを付けてくれた人
|
||||
コーダー
|
||||
|
||||
* [kPherox](https://www.kr-kp.com/)
|
||||
* [kPherox](https://pl.kpherox.dev/kPherox)
|
||||
|
||||
## ビルド
|
||||
|
||||
npmでもyarnでも好きな方を選んでください。
|
||||
|
||||
### npm
|
||||
|
||||
```sh
|
||||
git clone https://github.com/cutls/TheDesk
|
||||
cd TheDesk/app
|
||||
npm install
|
||||
npm install --only=dev
|
||||
npm run construct
|
||||
```
|
||||
|
||||
### yarn
|
||||
|
||||
```sh
|
||||
git clone https://github.com/cutls/TheDesk
|
||||
cd TheDesk/app
|
||||
# Linux or macOS
|
||||
yarn install --no-lockfile
|
||||
# Windows
|
||||
yarn install
|
||||
|
||||
yarn construct
|
||||
```
|
||||
|
||||
### electron-builder(推奨)
|
||||
npm scriptsを利用します
|
||||
|
||||
scriptsを利用します
|
||||
|
||||
#### npm
|
||||
|
||||
```sh
|
||||
# 実行している環境向けにビルド
|
||||
@@ -96,6 +122,20 @@ npm run build:win
|
||||
npm run build:all
|
||||
```
|
||||
|
||||
#### yarn
|
||||
|
||||
```sh
|
||||
# 実行している環境向けにビルド
|
||||
yarn build
|
||||
|
||||
# ターゲットを指定してビルド
|
||||
## Windows
|
||||
yarn build:win
|
||||
|
||||
## macOS向けのビルドにはmacOSで実行する必要があるためこのコマンドではビルドされません
|
||||
yarn build:all
|
||||
```
|
||||
|
||||
ビルド設定はすべてpackage.jsonに記載しています。
|
||||
|
||||
### electron-packager(非推奨)
|
||||
@@ -126,3 +166,8 @@ Issuesに書いてある問題についてはなるべく対処しますので
|
||||
## 詳しく
|
||||
|
||||
[TheDesk - マストドン日本語ウィキ](https://ja.mstdn.wiki/TheDesk)
|
||||
|
||||
## `npm i`したら脆弱性あるって言われた
|
||||
|
||||
materialize-cssの脆弱性(CVE-2019-11002/3/4)については[こちら](https://github.com/Dogfalo/materialize/issues/6286)で本当に脆弱性かどうか議論しています。
|
||||
実際には害が無いものと思われます。
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<title>TheDesk</title>
|
||||
<meta content="width=device-width,initial-scale=1.0" name="viewport">
|
||||
<link href="./css/materialize.css" type="text/css" rel="stylesheet">
|
||||
<link href="./node_modules/materialize-css/dist/css/materialize.css" type="text/css" rel="stylesheet">
|
||||
<link href='./css/font-awesome.css' rel='stylesheet' type='text/css'>
|
||||
<link href="./css/themes.css" type="text/css" rel="stylesheet">
|
||||
<link href="./css/master.css" type="text/css" rel="stylesheet">
|
||||
@@ -15,6 +15,8 @@
|
||||
font-family: 'Open Sans';
|
||||
-webkit-app-region: drag;
|
||||
cursor: move;
|
||||
padding: 5px;
|
||||
padding-top: 15px;
|
||||
}
|
||||
|
||||
a,
|
||||
@@ -27,7 +29,7 @@
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
grid-template-rows: 1fr 1fr 1fr 1fr 1fr;
|
||||
grid-template-areas: 'name1 data1''name2 data2''name3 data3''name4 data4''name5 data5';
|
||||
grid-template-areas: 'name1 data1''name2 data2''name3 data3''name4 data4''name5 data5''name6 data6';
|
||||
text-align: left;
|
||||
margin: 5px;
|
||||
}
|
||||
@@ -71,31 +73,41 @@
|
||||
.area-data5 {
|
||||
grid-area: data5;
|
||||
}
|
||||
|
||||
.area-name6 {
|
||||
grid-area: name6;
|
||||
}
|
||||
|
||||
.area-data6 {
|
||||
grid-area: data6;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="center " style="overflow:hidden">
|
||||
<script type="text/javascript" src="./js/common/jquery.js"></script>
|
||||
<script type="text/javascript" src="./node_modules/jquery/dist/jquery.js"></script>
|
||||
<script type="text/javascript" src="./js/platform/first-not-view.js"></script>
|
||||
<script type="text/javascript" src="./js/common/materialize.js"></script>
|
||||
<img src="./img/desk.png" style="max-width:62%;">
|
||||
<script type="text/javascript" src="./node_modules/materialize-css/dist/js/materialize.js"></script>
|
||||
<img src="./img/desk.svg" style="max-width:62%;">
|
||||
<h5>TheDesk</h5>
|
||||
<div class="container">
|
||||
<div class="area-name1">Display version</div>
|
||||
<div class="area-data1" id="now"></div>
|
||||
<div class="area-name2">Internal version</div>
|
||||
<div class="area-data2" id="ver"></div>
|
||||
<div class="area-name3">Chromium</div>
|
||||
<div class="area-data3" id="chrome"></div>
|
||||
<div class="area-name4">Electron</div>
|
||||
<div class="area-data4" id="electron"></div>
|
||||
<div class="area-name5">Node.js</div>
|
||||
<div class="area-data5" id="node"></div>
|
||||
<div class="area-name3">Commit(7chars)</div>
|
||||
<div class="area-data3" id="hash"></div>
|
||||
<div class="area-name4">Chromium</div>
|
||||
<div class="area-data4" id="chrome"></div>
|
||||
<div class="area-name5">Electron</div>
|
||||
<div class="area-data5" id="electron"></div>
|
||||
<div class="area-name6">Node.js</div>
|
||||
<div class="area-data6" id="node"></div>
|
||||
</div>
|
||||
<div class="cp">Copyright © TheDesk 2018<br>
|
||||
Main developer(author): <a href="https://cutls.com/@Cutls" target="_blank">Cutls P</a><br>
|
||||
Thanks:<a href="https://minohdon.jp/@toneji" target="_blank">toneji</a>/<a
|
||||
href="https://popon.pptdn.jp/@popn_ja" target="_blank">popn_ja</a>/<a href="https://pawoo.net/@kPherox"
|
||||
href="https://popon.pptdn.jp/@popn_ja" target="_blank">popn_ja</a>/<a href="https://pl.kpherox.dev/kPherox"
|
||||
target="_blank">kPherox</a> and all users
|
||||
<img draggable="false" style="width:0.8rem;top: 1px;margin-left: 1px;position: relative;" alt="❤️"
|
||||
title=":heart:" src="https://twemoji.maxcdn.com/2/72x72/2764.png">
|
||||
@@ -114,6 +126,7 @@
|
||||
var ver = m[1];
|
||||
$("#ver").text(ver);
|
||||
}
|
||||
$("#hash").html('<a href="https://github.com/cutls/TheDesk/commits/' + about[3] + '" target="_blank">' + about[3].slice(0, 7) + '</a>');
|
||||
$(document).on('click', 'a', e => {
|
||||
var url = $(e.target).attr('href');
|
||||
postMessage(["openUrl", url], "*")
|
||||
|
||||
BIN
app/build/appx/Square150x150Logo.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
app/build/appx/Square44x44Logo.png
Normal file
|
After Width: | Height: | Size: 9.4 KiB |
BIN
app/build/appx/StoreLogo.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
app/build/appx/Wide310x150Logo.png
Normal file
|
After Width: | Height: | Size: 117 KiB |
BIN
app/build/thedesk.ico
Normal file
|
After Width: | Height: | Size: 9.4 KiB |
@@ -7,12 +7,8 @@ body {
|
||||
cursor: default;
|
||||
font-size: 13px;
|
||||
height: 100vh;
|
||||
background-color: var(--bg);
|
||||
color: var(--color);
|
||||
}
|
||||
body {
|
||||
border: thin solid gray;
|
||||
}
|
||||
.btn {
|
||||
margin: 5px;
|
||||
text-transform: none;
|
||||
@@ -76,6 +72,9 @@ option {
|
||||
min-width: 0 !important;
|
||||
margin-left: 5px !important;
|
||||
}
|
||||
.unvisible {
|
||||
opacity: 0;
|
||||
}
|
||||
.bbcode-pulse-loadings,
|
||||
.bbcode-pulse-loading,
|
||||
.fa-pulse {
|
||||
@@ -221,6 +220,17 @@ blockquote:before,
|
||||
right: 0;
|
||||
top: 0;
|
||||
}
|
||||
#start {
|
||||
display: none;
|
||||
position: fixed;
|
||||
width: 100vw;
|
||||
height: calc(100vh - 40px);
|
||||
background-color: var(--bg);
|
||||
color: var(--color);
|
||||
z-index: 99999;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
#drag {
|
||||
display: none;
|
||||
position: fixed;
|
||||
@@ -235,9 +245,6 @@ blockquote:before,
|
||||
#drag-content {
|
||||
font-size: 2rem;
|
||||
}
|
||||
.radio {
|
||||
font-family: "Baloo Bhai";
|
||||
}
|
||||
#pip {
|
||||
z-index: 504;
|
||||
width: 418px;
|
||||
@@ -304,6 +311,9 @@ blockquote:before,
|
||||
.tabs {
|
||||
background-color: var(--subcolor);
|
||||
}
|
||||
.collapsible-header:focus {
|
||||
background-color: var(--subcolor) !important;
|
||||
}
|
||||
.modal-footer {
|
||||
background-color: var(--modalfooter) !important;
|
||||
}
|
||||
@@ -326,20 +336,23 @@ blockquote:before,
|
||||
#menu {
|
||||
position: fixed;
|
||||
z-index: 9999;
|
||||
background-color: var(--box);
|
||||
background-color: var(--postbox);
|
||||
width: 540px;
|
||||
top: calc(50% - 150px);
|
||||
left: calc(50% - 250px);
|
||||
padding: 5px;
|
||||
border: thin solid gray;
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
}
|
||||
#menu-wrapper {
|
||||
margin-left: -5px;
|
||||
display: flex;
|
||||
height: calc(100% - 3.5rem);
|
||||
overflow: hidden;
|
||||
}
|
||||
#left-menu {
|
||||
width: 170px;
|
||||
width: 230px;
|
||||
}
|
||||
#left-menu div {
|
||||
padding-left: 5px;
|
||||
@@ -359,8 +372,7 @@ blockquote:before,
|
||||
background-color: var(--emphasized);
|
||||
}
|
||||
#right-menu {
|
||||
width: 380px;
|
||||
max-height: 375px;
|
||||
width: 100%;
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
padding: 5px;
|
||||
@@ -377,6 +389,9 @@ blockquote:before,
|
||||
height: 40px;
|
||||
cursor: pointer;
|
||||
}
|
||||
#tltype .type span {
|
||||
width: calc(100% - 30px);
|
||||
}
|
||||
#tltype .type:hover {
|
||||
background-color: var(--beforehover);
|
||||
}
|
||||
@@ -388,16 +403,19 @@ blockquote:before,
|
||||
}
|
||||
#tltype i.sub-icon {
|
||||
font-size: 20px;
|
||||
position: relative;
|
||||
position: absolute;
|
||||
color: var(--beforehover);
|
||||
left: -15px;
|
||||
left: 10px;
|
||||
bottom: 5px;
|
||||
background-color: #fff;
|
||||
}
|
||||
.drag-bar {
|
||||
cursor: move;
|
||||
text-align: center;
|
||||
width: calc(100% + 10px);
|
||||
border-radius: 5px;
|
||||
background-color: var(--bg);
|
||||
background-color: var(--box);
|
||||
filter: brightness(80%);
|
||||
margin-left: -5px;
|
||||
margin-right: -5px;
|
||||
margin-top: -5px;
|
||||
@@ -441,9 +459,27 @@ blockquote:before,
|
||||
.select-wrapper .dropdown-content {
|
||||
width: 250px !important;
|
||||
}
|
||||
input, textarea {
|
||||
input,
|
||||
textarea {
|
||||
color: var(--color);
|
||||
font-size: 1rem !important;
|
||||
font-family: inherit;
|
||||
}
|
||||
.swal2-popup {
|
||||
background-color: var(--notfbox) !important;
|
||||
}
|
||||
.swal2-title,
|
||||
.swal2-content {
|
||||
color: var(--color) !important;
|
||||
}
|
||||
#src-contents svg {
|
||||
margin-right: 5px;
|
||||
}
|
||||
.contributor {
|
||||
cursor: pointer;
|
||||
}
|
||||
.contributor img {
|
||||
width: 1rem;
|
||||
}
|
||||
|
||||
/*スクロールバー*/
|
||||
@@ -463,3 +499,37 @@ input, textarea {
|
||||
background: #607d8b;
|
||||
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
/* Web Fonts */
|
||||
@font-face {
|
||||
font-family: "Open Sans";
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
src: local("Open Sans Light"), local("OpenSans-Light"),
|
||||
url(https://fonts.gstatic.com/s/opensans/v17/mem5YaGs126MiZpBA-UN_r8OUuhp.woff2)
|
||||
format("woff2");
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
|
||||
U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
|
||||
U+FEFF, U+FFFD;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "Material Icons";
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: url(https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2)
|
||||
format("woff2");
|
||||
}
|
||||
.material-icons {
|
||||
font-family: "Material Icons";
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-size: 24px;
|
||||
line-height: 1;
|
||||
letter-spacing: normal;
|
||||
text-transform: none;
|
||||
display: inline-block;
|
||||
white-space: nowrap;
|
||||
word-wrap: normal;
|
||||
direction: ltr;
|
||||
-webkit-font-feature-settings: "liga";
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
9067
app/css/materialize.css
vendored
13
app/css/materialize.min.css
vendored
@@ -7,13 +7,17 @@
|
||||
background-color: var(--postbox);
|
||||
border: thin solid gray;
|
||||
z-index: 501;
|
||||
min-width: 300px;
|
||||
max-width: 100%;
|
||||
padding: 5px;
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
}
|
||||
textarea{
|
||||
textarea {
|
||||
min-height: 100px !important;
|
||||
font-family: inherit;
|
||||
}
|
||||
#post-box .ui-resizable-s, #post-box .ui-resizable-se{
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.cancel {
|
||||
@@ -107,23 +111,20 @@ textarea{
|
||||
}
|
||||
#left-side {
|
||||
float: left;
|
||||
width: 300px;
|
||||
overflow-x: hidden;
|
||||
height: calc(100% - 32px);
|
||||
}
|
||||
#right-side {
|
||||
display: none;
|
||||
float: left;
|
||||
width: 300px;
|
||||
padding: 5px;
|
||||
overflow-x: hidden;
|
||||
height: calc(100% - 32px);
|
||||
}
|
||||
#poll {
|
||||
#posttgl,#toot-post-btn {
|
||||
background-color: var(--accentbtn);
|
||||
}
|
||||
.poll-provider {
|
||||
position: absolute;
|
||||
height: calc(100% - 90px);
|
||||
overflow-y: scroll;
|
||||
top: 90px;
|
||||
}
|
||||
|
||||
/*mini*/
|
||||
.mini-post .mize {
|
||||
display: none !important;
|
||||
|
||||
@@ -14,6 +14,10 @@
|
||||
--active: #e6ee9c;
|
||||
--postbox: white;
|
||||
--modalfooter: #fafafa;
|
||||
--accentbtn: #009688;
|
||||
--selected: #c0c0c0;
|
||||
--selectedWithShare: #b2babd;
|
||||
--gray: #757575;
|
||||
}
|
||||
#imagemodal {
|
||||
background: url("../img/pixel.white.svg");
|
||||
@@ -34,6 +38,10 @@
|
||||
--active: #757575;
|
||||
--postbox: #424242;
|
||||
--modalfooter: #212121;
|
||||
--accentbtn: #3f51b5;
|
||||
--selected: #3f3f3f;
|
||||
--selectedWithShare: #003a30;
|
||||
--gray: #cccccc;
|
||||
}
|
||||
.blacktheme #imagemodal {
|
||||
background: url("../img/pixel.svg");
|
||||
@@ -54,6 +62,10 @@
|
||||
--active: #757575;
|
||||
--postbox: #1a237e;
|
||||
--modalfooter: #031833;
|
||||
--accentbtn: #00acc1;
|
||||
--selected: #214f8a;
|
||||
--selectedWithShare: #003a30;
|
||||
--gray: #cccccc ;
|
||||
}
|
||||
.indigotheme #imagemodal {
|
||||
background: url("../img/pixel.svg");
|
||||
@@ -74,6 +86,10 @@
|
||||
--active: #757575;
|
||||
--postbox: #4e342e;
|
||||
--modalfooter: #261411;
|
||||
--accentbtn: #827717;
|
||||
--selected: #6d352b;
|
||||
--selectedWithShare: #003a30;
|
||||
--gray: #cccccc;
|
||||
}
|
||||
.browntheme #imagemodal {
|
||||
background: url("../img/pixel.svg");
|
||||
@@ -86,7 +102,7 @@
|
||||
--modal: #81c784;
|
||||
--subcolor: #a5d6a7;
|
||||
--box: #81c784;
|
||||
--sidebar: #81c784;
|
||||
--sidebar: #c5e1a5;
|
||||
--shared: #ffcc80;
|
||||
--notfbox: #a5d6a7;
|
||||
--emphasized: #9e9d24;
|
||||
@@ -94,7 +110,35 @@
|
||||
--active: #e6ee9c;
|
||||
--postbox: #a5d6a7;
|
||||
--modalfooter: #81c784;
|
||||
--accentbtn: #33691e;
|
||||
--selected: #78c17a;
|
||||
--selectedWithShare: #caa266;
|
||||
--gray: #757575;
|
||||
}
|
||||
.greentheme #imagemodal {
|
||||
background: url("../img/pixel.white.svg");
|
||||
}
|
||||
.bluetheme {
|
||||
--bg: #c9e1ec;
|
||||
--drag: rgba(255, 255, 255, 0.8);
|
||||
--color: black;
|
||||
--beforehover: #757575;
|
||||
--modal: #b2ebf2;
|
||||
--subcolor: #90caf9;
|
||||
--box: #90caf9;
|
||||
--sidebar: #b6e6f5;
|
||||
--shared: #e0ffe4;
|
||||
--notfbox: #90caf9;
|
||||
--emphasized: #c5e1a5;
|
||||
--his-data: rgba(255, 255, 255, 0.9);
|
||||
--active: #b39ddb;
|
||||
--postbox: #dff1ff;
|
||||
--modalfooter: #2196f3;
|
||||
--accentbtn: #2f7bb7;
|
||||
--selected: #9dcade;
|
||||
--selectedWithShare: #c1dac4;
|
||||
--gray: #757575;
|
||||
}
|
||||
.bluetheme #imagemodal {
|
||||
background: url("../img/pixel.white.svg");
|
||||
}
|
||||
|
||||
158
app/css/tl.css
@@ -24,6 +24,10 @@
|
||||
z-index: 500;
|
||||
box-shadow: 10px 0 10px 10px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
#demobottom {
|
||||
width: 500px;
|
||||
display: flex;
|
||||
}
|
||||
#bottom.reverse {
|
||||
padding-left: 0;
|
||||
padding-right: 40px;
|
||||
@@ -41,16 +45,22 @@
|
||||
#bottom .trendtag {
|
||||
height: 40px;
|
||||
}
|
||||
#bottom #group {
|
||||
#bottom #group,
|
||||
#demogroup {
|
||||
margin-right: 40px;
|
||||
}
|
||||
#bottom .leftside {
|
||||
display: flex;
|
||||
}
|
||||
#tips {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
#bottom #tips img {
|
||||
vertical-align: -3px;
|
||||
}
|
||||
#bottom a {
|
||||
#bottom a,
|
||||
#demogroup a {
|
||||
color: var(--color);
|
||||
}
|
||||
#bottom i {
|
||||
@@ -62,9 +72,9 @@
|
||||
.exc-chb {
|
||||
padding-left: 24px !important;
|
||||
}
|
||||
#bottom .btnsgroup {
|
||||
.btnsgroup {
|
||||
border: 1px solid;
|
||||
padding: 1px;
|
||||
padding-top: 1px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
margin-right: 15px;
|
||||
@@ -94,8 +104,10 @@
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
iframe {
|
||||
iframe,
|
||||
.cvo video {
|
||||
max-width: 100%;
|
||||
max-height: 300px;
|
||||
}
|
||||
@media screen and (max-width: 600px) {
|
||||
.mobile #timeline-container {
|
||||
@@ -126,7 +138,7 @@ iframe {
|
||||
}
|
||||
.marquee {
|
||||
width: 100%;
|
||||
padding: .5em 0;
|
||||
padding: 0.5em 0;
|
||||
overflow: hidden;
|
||||
margin-bottom: 0;
|
||||
position: relative;
|
||||
@@ -142,14 +154,15 @@ iframe {
|
||||
animation-iteration-count: infinite;
|
||||
}
|
||||
@keyframes marquee {
|
||||
0% {
|
||||
-webkit-transform: translate(0);
|
||||
transform: translate(0);
|
||||
}
|
||||
99%, 100% {
|
||||
-webkit-transform: translate(-100%);
|
||||
transform: translate(-100%);
|
||||
}
|
||||
0% {
|
||||
-webkit-transform: translate(0);
|
||||
transform: translate(0);
|
||||
}
|
||||
99%,
|
||||
100% {
|
||||
-webkit-transform: translate(-100%);
|
||||
transform: translate(-100%);
|
||||
}
|
||||
}
|
||||
.boxIn {
|
||||
display: flex;
|
||||
@@ -157,6 +170,7 @@ iframe {
|
||||
height: 100%;
|
||||
border: thin solid gray;
|
||||
overflow: hidden;
|
||||
border-top: none;
|
||||
}
|
||||
.box .pin,
|
||||
#his-data .pin {
|
||||
@@ -176,6 +190,9 @@ iframe {
|
||||
vertical-align: middle;
|
||||
margin: -1px 0;
|
||||
}
|
||||
.bigemoji {
|
||||
width: 60px !important;
|
||||
}
|
||||
.faicon_FTL {
|
||||
display: none;
|
||||
}
|
||||
@@ -207,7 +224,20 @@ iframe {
|
||||
width: 100%;
|
||||
display: grid;
|
||||
grid-template-columns: 43px 2fr 1fr;
|
||||
grid-template-areas: "notice notice notice" "icon display_name display_name" "icon toot toot" "vis additional additional" "actions actions side";
|
||||
grid-template-rows: auto 1.6rem 1fr auto 2.5rem;
|
||||
grid-template-areas: "notice notice notice" "icon display_name display_name" "space toot toot" "space additional additional" "vis actions side";
|
||||
}
|
||||
.hide-actions{
|
||||
grid-template-rows: auto 1.6rem 1fr auto 0;
|
||||
}
|
||||
.hide-actions .area-actions{
|
||||
display:none;
|
||||
}
|
||||
.hide-actions .area-vis{
|
||||
display:none;
|
||||
}
|
||||
.hide-actions .area-side{
|
||||
display:none;
|
||||
}
|
||||
.cvo h1,
|
||||
.cvo h2,
|
||||
@@ -252,7 +282,8 @@ iframe {
|
||||
.area-toot {
|
||||
cursor: text;
|
||||
user-select: auto;
|
||||
margin: 2px;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
margin-left: 5px;
|
||||
grid-area: toot;
|
||||
}
|
||||
@@ -270,32 +301,50 @@ iframe {
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.acct-note p {
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
.area-toot.acct-note p:not(:first-child) {
|
||||
display: none;
|
||||
}
|
||||
.area-toot.acct-note p:first-child:after {
|
||||
content: "...";
|
||||
color: var(--gray);
|
||||
}
|
||||
|
||||
.area-actions {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
top: -20px;
|
||||
top: -5px;
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
width: 250px;
|
||||
max-width: 100%;
|
||||
grid-area: actions;
|
||||
}
|
||||
.area-vis {
|
||||
margin: 2px;
|
||||
grid-area: vis;
|
||||
text-align: center;
|
||||
}
|
||||
.area-side {
|
||||
display: flex;
|
||||
top: -5px;
|
||||
position: relative;
|
||||
justify-content: flex-end;
|
||||
margin: 2px;
|
||||
grid-area: side;
|
||||
}
|
||||
|
||||
.quote-inline {
|
||||
display: none;
|
||||
}
|
||||
.quote-renote {
|
||||
display: grid;
|
||||
grid-template-columns: 43px 2fr 1fr;
|
||||
grid-template-areas: "ricon ruser" "ricon rtext";
|
||||
grid-template-columns: 43px 2fr 25px;
|
||||
grid-template-areas: "ricon ruser rdet" "ricon rtext rdet";
|
||||
border: 1px solid;
|
||||
margin-top: 3px;
|
||||
padding: 1px;
|
||||
@@ -303,9 +352,13 @@ iframe {
|
||||
}
|
||||
.renote-icon {
|
||||
grid-area: ricon;
|
||||
padding: 5px;
|
||||
}
|
||||
.renote-details {
|
||||
grid-area: rdet;
|
||||
}
|
||||
.renote-icon img {
|
||||
width: 43px;
|
||||
width: 100%;
|
||||
}
|
||||
.renote-user {
|
||||
grid-area: ruser;
|
||||
@@ -339,7 +392,7 @@ iframe {
|
||||
}
|
||||
|
||||
.gray {
|
||||
color: gray;
|
||||
color: var(--gray);
|
||||
}
|
||||
.sml {
|
||||
font-size: 0.8em;
|
||||
@@ -373,6 +426,7 @@ iframe {
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
height: calc(0.8em + 8px);
|
||||
user-select: none;
|
||||
}
|
||||
.cbadge-hover {
|
||||
color: var(--color);
|
||||
@@ -410,7 +464,7 @@ p:not(:last-child) {
|
||||
z-index: 500;
|
||||
padding: 5px;
|
||||
display: grid;
|
||||
grid-template-columns: 40px 48px 1fr 24px;
|
||||
grid-template-columns: 40px 1fr 1fr 24px;
|
||||
grid-template-rows: 30px 30px;
|
||||
grid-template-areas: "notice notice_name notice_name a2" "notice a1 sta a3" "notf-box notf-box notf-box notf-box";
|
||||
}
|
||||
@@ -425,6 +479,9 @@ p:not(:last-child) {
|
||||
|
||||
.area-notice_name {
|
||||
grid-area: notice_name;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.area-notice_acct {
|
||||
@@ -432,7 +489,6 @@ p:not(:last-child) {
|
||||
}
|
||||
|
||||
.area-a1 {
|
||||
text-align: center;
|
||||
grid-area: a1;
|
||||
}
|
||||
.area-sta {
|
||||
@@ -502,11 +558,6 @@ p:not(:last-child) {
|
||||
0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.3),
|
||||
0px -10px 10px 0px rgba(0, 0, 0, 0.3) inset;
|
||||
}
|
||||
#src-contents {
|
||||
min-height: 100px;
|
||||
max-height: 190px;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
.type-b {
|
||||
display: none;
|
||||
}
|
||||
@@ -581,6 +632,7 @@ p:not(:last-child) {
|
||||
display: block;
|
||||
margin-right: 1px;
|
||||
float: left;
|
||||
overflow: hidden;
|
||||
}
|
||||
.nsfw-media {
|
||||
position: absolute;
|
||||
@@ -594,6 +646,32 @@ p:not(:last-child) {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.shared.selectedToot {
|
||||
background-color: var(--selectedWithShare);
|
||||
}
|
||||
.selectedToot {
|
||||
background-color: var(--selected);
|
||||
}
|
||||
audio {
|
||||
height: 2rem;
|
||||
}
|
||||
.translate {
|
||||
white-space: normal;
|
||||
}
|
||||
.cw_btn {
|
||||
margin: 3px;
|
||||
background-color: var(--emphasized);
|
||||
color: var(--color);
|
||||
padding-left: 3px;
|
||||
padding-right: 3px;
|
||||
border-radius: 3px;
|
||||
border: 1px solid var(--color);
|
||||
}
|
||||
.vis-data {
|
||||
font-size: 1rem !important;
|
||||
margin: 5px;
|
||||
user-select: none;
|
||||
}
|
||||
@keyframes jump {
|
||||
0% {
|
||||
transform: translateY(0);
|
||||
@@ -638,11 +716,29 @@ p:not(:last-child) {
|
||||
}
|
||||
}
|
||||
.box-anime {
|
||||
animation-duration: 1s;
|
||||
animation-name: fadeInLeft;
|
||||
/*animation-duration: 1s;
|
||||
animation-name: fadeInLeft;*/
|
||||
}
|
||||
|
||||
.cvo-anime {
|
||||
animation-duration: 0.1s;
|
||||
animation-name: fadeInDown;
|
||||
}
|
||||
.urbadge {
|
||||
line-height: normal;
|
||||
height: 2rem;
|
||||
font-size: 1rem;
|
||||
background-color: #009688;
|
||||
}
|
||||
.box .ui-resizable-s {
|
||||
display: none !important;
|
||||
}
|
||||
.boxIn .ui-resizable-e {
|
||||
display: none !important;
|
||||
}
|
||||
.boxIn .ui-resizable-s {
|
||||
display: block !important;
|
||||
}
|
||||
.box .ui-resizable-se {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,13 @@
|
||||
background-image: url("../../loading.svg");
|
||||
overflow-y: hidden;
|
||||
}
|
||||
#his-data .btn .material-icons{
|
||||
float:left;
|
||||
}
|
||||
#his-data-content {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
#his-name {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
@@ -13,16 +20,18 @@
|
||||
margin-right: 5px;
|
||||
}
|
||||
.his-float {
|
||||
float: left;
|
||||
overflow-y: scroll;
|
||||
padding: 5px;
|
||||
}
|
||||
#his-float-data {
|
||||
width: 400px;
|
||||
height: 100%;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
#his-leftside {
|
||||
width: 500px;
|
||||
}
|
||||
#his-float-timeline {
|
||||
width: calc(100% - 400px);
|
||||
max-width: 775px;
|
||||
height: 100%;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
@@ -55,27 +64,36 @@
|
||||
padding: 0;
|
||||
padding-left: 5px;
|
||||
}
|
||||
#his-data a span.ellipsis:after {
|
||||
.his-var-content a span.ellipsis:after {
|
||||
content: "...";
|
||||
}
|
||||
#his-data a:not(.mention) span:last-of-type {
|
||||
.his-var-content a:not(.mention) span:last-of-type {
|
||||
display: none;
|
||||
}
|
||||
#his-data a .rep_ct,
|
||||
#his-data a .rt_ct,
|
||||
#his-data a .fav_ct {
|
||||
display: inline !important;
|
||||
}
|
||||
#his-data-show {
|
||||
margin: 20px;
|
||||
margin-left: 50px;
|
||||
margin-right: 50px;
|
||||
background-color: var(--his-data);
|
||||
width: calc(100% - 20px);
|
||||
height: calc(100% - 20px);
|
||||
margin-bottom: 0;
|
||||
padding: 5px;
|
||||
}
|
||||
.tab-content {
|
||||
#his-data-wrap {
|
||||
display: flex;
|
||||
}
|
||||
.his-var-content {
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
height: calc(100% - 240px);
|
||||
height: calc(100% - 45px);
|
||||
}
|
||||
.my-data-width {
|
||||
width: 10%;
|
||||
#my-data-nav .btn {
|
||||
width: 140px;
|
||||
}
|
||||
.active-back {
|
||||
background-color: var(--active);
|
||||
@@ -85,7 +103,8 @@
|
||||
width: 20px;
|
||||
}
|
||||
#his-plus-action .btn {
|
||||
width: 170px;
|
||||
padding-right: 5px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
.tabs {
|
||||
display: flex;
|
||||
@@ -93,16 +112,40 @@
|
||||
.tabs .tab a {
|
||||
padding: 8px 12px;
|
||||
}
|
||||
#his-des {
|
||||
max-height: 250px;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
#his-sign-action {
|
||||
border: 1px solid;
|
||||
border-radius: 5px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
#his-sign-action .btn {
|
||||
flex-basis: 31.2%;
|
||||
}
|
||||
#his-des .mention {
|
||||
color: #039be5;
|
||||
cursor: pointer;
|
||||
}
|
||||
#his-table{
|
||||
max-height: 150px;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
#his-float-blocked {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 2rem;
|
||||
width: 90%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
}
|
||||
#hisdropdown{
|
||||
background-color: var(--bg);
|
||||
}
|
||||
#hisdropdown li:hover{
|
||||
background-color: var(--active);
|
||||
}
|
||||
BIN
app/img/desk.png
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 11 KiB |
35
app/img/desk.svg
Normal file
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 23.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 4096 4096" style="enable-background:new 0 0 4096 4096;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{display:none;}
|
||||
.st1{fill:#FFFFFF;}
|
||||
.st2{fill:#545251;stroke:#040000;stroke-miterlimit:10;}
|
||||
.st3{fill:#F0842E;}
|
||||
.st4{fill:#364C9F;}
|
||||
.st5{fill:#FFFFFF;stroke:#040000;stroke-miterlimit:10;}
|
||||
.st6{fill-rule:evenodd;clip-rule:evenodd;fill:#040000;}
|
||||
.st7{fill-rule:evenodd;clip-rule:evenodd;fill:none;}
|
||||
</style>
|
||||
<g id="レイヤー_1" class="st0">
|
||||
</g>
|
||||
<g id="レイヤー_2">
|
||||
<polyline class="st1" points="1128.5,650.67 3378,1950 3378,2137 1128.5,3432.67 "/>
|
||||
<rect x="678.5" y="128.48" class="st2" width="450" height="3821.5"/>
|
||||
|
||||
<rect x="1915.71" y="-583.55" transform="matrix(0.5 -0.866 0.866 0.5 225.753 2341.5386)" class="st3" width="450" height="3117.62"/>
|
||||
|
||||
<rect x="1915.5" y="1555.41" transform="matrix(0.5 0.866 -0.866 0.5 3762.031 -299.6245)" class="st4" width="450" height="3105.58"/>
|
||||
<path class="st5" d="M714.5,2953.5"/>
|
||||
<path id="path1891" class="st6" d="M1592.47,2584h456.47c0-64.89-4.63-77.76-112.1-77.76c17.17-51.5,86.95-176.11,125.73-176.11
|
||||
c34.31,0,75.24,1.89,75.24,80.17c0,88.87,149.56,232.16,185.82,173.7c54.04-87.12-92.91-60.55-92.91-270.65
|
||||
c0-287.43,167.74-246.51,167.74-407.99c0-80.79-22.32-91.7-22.32-149.46c0-76.34,67.25-71.91,54.17-135.2
|
||||
c-9.04-43.72-16.11-78.78-21.38-131.65c-3.74-37.51-4.93-77.5-43.9-75.89c-45.78,1.89-63.15,82.47-134.31,88.25
|
||||
c-71.02,5.77-131.57-60.46-159.06-51c-27.25,9.38-18.68,83.32-2.52,135.83c25.4,82.54,80.79,189.86-20.2,206.02
|
||||
c-100.99,16.16-274.69,32.32-399.92,197.94s-120.6,359.99-169.66,420.11C1314.72,2612.08,1146,2529.23,1146,2697.11
|
||||
c0,75.16,127.35,129.27,147.55,105.03c20.2-24.24-171.62-96.46,43.01-181.78C1519.91,2547.46,1536.28,2532.58,1592.47,2584z"/>
|
||||
<rect class="st7" width="4096" height="4096"/>
|
||||
<path class="st1" d="M-58,1122"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
@@ -1,122 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
|
||||
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 23.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 4096 4096" style="enable-background:new 0 0 4096 4096;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{display:none;}
|
||||
.st1{fill:none;}
|
||||
.st2{fill:#FFFFFF;}
|
||||
.st3{fill:#FFFFFF;}
|
||||
.st4{fill:#FFFFFF;}
|
||||
.st5{fill:#none;}
|
||||
.st6{fill-rule:evenodd;clip-rule:evenodd;fill:#FFFFFF;}
|
||||
.st7{fill-rule:evenodd;clip-rule:evenodd;fill:none;}
|
||||
</style>
|
||||
<g id="レイヤー_1" class="st0">
|
||||
</g>
|
||||
<g id="レイヤー_2">
|
||||
<polyline class="st1" points="1128.5,650.67 3378,1950 3378,2137 1128.5,3432.67 "/>
|
||||
<rect x="678.5" y="128.48" class="st2" width="450" height="3821.5"/>
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="7.11022in" height="7.11022in"
|
||||
viewBox="0 0 512 512">
|
||||
<path id="選択範囲 #1"
|
||||
fill="white" stroke="white" stroke-width="1"
|
||||
d="M 96.00,16.00
|
||||
C 99.85,16.01 102.39,15.12 104.00,19.00
|
||||
104.00,19.00 97.00,19.00 97.00,19.00
|
||||
97.00,19.00 108.00,22.07 108.00,22.07
|
||||
108.00,22.07 144.00,43.08 144.00,43.08
|
||||
144.00,43.08 181.83,64.31 181.83,64.31
|
||||
181.83,64.31 223.00,88.26 223.00,88.26
|
||||
223.00,88.26 247.00,102.22 247.00,102.22
|
||||
247.00,102.22 257.00,107.00 257.00,107.00
|
||||
260.09,110.36 266.43,114.39 271.00,115.00
|
||||
271.00,115.00 298.00,133.00 298.00,133.00
|
||||
298.00,133.00 300.00,132.00 300.00,132.00
|
||||
300.00,132.00 312.00,141.00 312.00,141.00
|
||||
312.00,141.00 314.00,140.00 314.00,140.00
|
||||
318.40,144.39 334.83,152.80 341.00,156.45
|
||||
341.00,156.45 404.00,192.94 404.00,192.94
|
||||
404.00,192.94 425.67,205.63 425.67,205.63
|
||||
428.70,208.64 426.87,211.86 425.12,215.00
|
||||
425.12,215.00 412.26,237.00 412.26,237.00
|
||||
410.65,240.07 409.02,245.62 404.90,245.68
|
||||
401.70,245.72 396.83,242.47 394.00,240.87
|
||||
394.00,240.87 370.00,226.89 370.00,226.89
|
||||
370.00,226.89 282.00,176.51 282.00,176.51
|
||||
282.00,176.51 271.00,169.52 271.00,169.52
|
||||
271.00,169.52 261.00,164.31 261.00,164.31
|
||||
257.45,162.08 251.05,157.46 247.00,157.00
|
||||
247.00,157.00 234.00,148.55 234.00,148.55
|
||||
234.00,148.55 208.17,133.78 208.17,133.78
|
||||
208.17,133.78 190.00,124.00 190.00,124.00
|
||||
190.00,124.00 163.00,107.60 163.00,107.60
|
||||
163.00,107.60 103.00,73.00 103.00,73.00
|
||||
103.00,73.00 103.00,453.00 103.00,453.00
|
||||
103.00,453.00 127.00,439.42 127.00,439.42
|
||||
127.00,439.42 170.00,414.58 170.00,414.58
|
||||
170.00,414.58 237.17,376.24 237.17,376.24
|
||||
237.17,376.24 256.00,364.59 256.00,364.59
|
||||
256.00,364.59 264.00,360.53 264.00,360.53
|
||||
264.00,360.53 285.00,348.20 285.00,348.20
|
||||
285.00,348.20 292.99,344.12 292.99,344.12
|
||||
292.99,344.12 299.28,339.83 299.28,339.83
|
||||
299.28,339.83 320.00,328.41 320.00,328.41
|
||||
320.00,328.41 362.00,304.05 362.00,304.05
|
||||
362.00,304.05 371.91,297.68 371.91,297.68
|
||||
371.91,297.68 379.04,294.41 379.04,294.41
|
||||
379.04,294.41 410.00,276.00 410.00,276.00
|
||||
410.00,276.00 416.00,285.00 416.00,285.00
|
||||
416.81,288.83 421.21,296.21 424.00,299.00
|
||||
424.00,299.00 423.00,301.00 423.00,301.00
|
||||
427.24,303.72 430.62,312.17 432.00,317.00
|
||||
432.00,317.00 388.00,342.67 388.00,342.67
|
||||
388.00,342.67 317.00,383.55 317.00,383.55
|
||||
317.00,383.55 279.00,405.32 279.00,405.32
|
||||
279.00,405.32 264.00,415.00 264.00,415.00
|
||||
264.00,415.00 262.00,414.00 262.00,414.00
|
||||
262.00,414.00 250.00,423.00 250.00,423.00
|
||||
250.00,423.00 248.00,422.00 248.00,422.00
|
||||
248.00,422.00 238.00,428.92 238.00,428.92
|
||||
238.00,428.92 218.00,440.67 218.00,440.67
|
||||
218.00,440.67 207.00,448.00 207.00,448.00
|
||||
207.00,448.00 193.00,455.18 193.00,455.18
|
||||
193.00,455.18 176.00,465.08 176.00,465.08
|
||||
176.00,465.08 166.09,470.31 166.09,470.31
|
||||
166.09,470.31 137.00,487.31 137.00,487.31
|
||||
137.00,487.31 103.00,506.00 103.00,506.00
|
||||
103.00,506.00 104.00,509.00 104.00,509.00
|
||||
104.00,509.00 57.00,509.00 57.00,509.00
|
||||
57.00,509.00 57.00,16.00 57.00,16.00
|
||||
57.00,16.00 96.00,16.00 96.00,16.00 Z
|
||||
M 102.00,72.00
|
||||
C 102.00,72.00 103.00,73.00 103.00,73.00
|
||||
103.00,73.00 103.00,72.00 103.00,72.00
|
||||
103.00,72.00 102.00,72.00 102.00,72.00 Z
|
||||
M 261.00,190.61
|
||||
C 270.30,188.63 274.03,177.15 280.77,179.78
|
||||
284.36,181.18 284.28,187.65 284.72,191.00
|
||||
285.35,195.85 287.64,207.99 286.57,212.00
|
||||
285.51,216.00 282.42,218.30 280.78,222.00
|
||||
277.54,229.29 282.79,236.85 282.99,245.00
|
||||
283.38,261.24 274.02,264.52 266.36,276.00
|
||||
261.36,283.50 258.58,297.05 259.09,306.00
|
||||
259.91,320.41 263.09,322.38 271.02,333.00
|
||||
273.09,335.77 275.09,339.39 272.11,342.37
|
||||
269.94,344.63 266.39,343.51 264.00,342.37
|
||||
258.40,339.52 252.76,332.51 249.91,327.00
|
||||
246.61,320.60 248.26,314.37 244.57,310.23
|
||||
240.72,305.90 235.19,306.50 231.18,310.23
|
||||
225.69,315.34 221.16,325.22 218.00,332.00
|
||||
226.04,333.96 232.79,331.61 234.00,342.00
|
||||
234.00,342.00 175.00,342.00 175.00,342.00
|
||||
166.62,341.85 166.77,339.11 162.00,338.56
|
||||
158.39,338.15 148.72,341.68 145.00,343.05
|
||||
138.31,345.53 120.54,352.22 119.64,360.00
|
||||
119.01,365.49 125.06,367.91 127.00,374.00
|
||||
115.41,373.03 104.20,364.93 108.88,352.00
|
||||
111.36,345.12 117.06,343.57 123.00,340.75
|
||||
132.86,336.05 141.94,332.38 149.58,323.96
|
||||
151.40,321.95 154.62,318.26 155.92,316.00
|
||||
155.92,316.00 166.03,283.00 166.03,283.00
|
||||
169.87,271.08 179.16,256.26 189.00,248.52
|
||||
199.37,240.36 208.38,237.36 221.00,234.66
|
||||
226.45,233.50 237.77,232.36 240.99,227.79
|
||||
244.55,222.75 241.98,216.26 240.34,211.00
|
||||
237.46,201.77 234.64,193.69 237.00,184.00
|
||||
244.82,185.47 252.94,192.32 261.00,190.61 Z
|
||||
M 102.00,453.00
|
||||
C 102.00,453.00 103.00,454.00 103.00,454.00
|
||||
103.00,454.00 103.00,453.00 103.00,453.00
|
||||
103.00,453.00 102.00,453.00 102.00,453.00 Z
|
||||
M 102.00,505.00
|
||||
C 102.00,505.00 103.00,506.00 103.00,506.00
|
||||
103.00,506.00 103.00,505.00 103.00,505.00
|
||||
103.00,505.00 102.00,505.00 102.00,505.00 Z" />
|
||||
<rect x="1915.71" y="-583.55" transform="matrix(0.5 -0.866 0.866 0.5 225.753 2341.5386)" class="st3" width="450" height="3117.62"/>
|
||||
|
||||
<rect x="1915.5" y="1555.41" transform="matrix(0.5 0.866 -0.866 0.5 3762.031 -299.6245)" class="st4" width="450" height="3105.58"/>
|
||||
<path class="st5" d="M714.5,2953.5"/>
|
||||
<path id="path1891" class="st6" d="M1592.47,2584h456.47c0-64.89-4.63-77.76-112.1-77.76c17.17-51.5,86.95-176.11,125.73-176.11
|
||||
c34.31,0,75.24,1.89,75.24,80.17c0,88.87,149.56,232.16,185.82,173.7c54.04-87.12-92.91-60.55-92.91-270.65
|
||||
c0-287.43,167.74-246.51,167.74-407.99c0-80.79-22.32-91.7-22.32-149.46c0-76.34,67.25-71.91,54.17-135.2
|
||||
c-9.04-43.72-16.11-78.78-21.38-131.65c-3.74-37.51-4.93-77.5-43.9-75.89c-45.78,1.89-63.15,82.47-134.31,88.25
|
||||
c-71.02,5.77-131.57-60.46-159.06-51c-27.25,9.38-18.68,83.32-2.52,135.83c25.4,82.54,80.79,189.86-20.2,206.02
|
||||
c-100.99,16.16-274.69,32.32-399.92,197.94s-120.6,359.99-169.66,420.11C1314.72,2612.08,1146,2529.23,1146,2697.11
|
||||
c0,75.16,127.35,129.27,147.55,105.03c20.2-24.24-171.62-96.46,43.01-181.78C1519.91,2547.46,1536.28,2532.58,1592.47,2584z"/>
|
||||
<rect class="st7" width="4096" height="4096"/>
|
||||
<path class="st1" d="M-58,1122"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 434 B |
|
Before Width: | Height: | Size: 34 KiB |
132
app/img/thinking.svg
Normal file
@@ -0,0 +1,132 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 23.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 4096 4096" style="enable-background:new 0 0 4096 4096;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#040000;}
|
||||
.st1{fill:#040000;stroke:#040000;stroke-miterlimit:10;}
|
||||
.st2{clip-path:url(#SVGID_2_);}
|
||||
.st3{clip-path:url(#SVGID_4_);}
|
||||
.st4{fill:none;}
|
||||
.st5{fill:#FFFFFF;}
|
||||
.st6{fill:#545251;stroke:#040000;stroke-miterlimit:10;}
|
||||
.st7{fill:#F0842E;}
|
||||
.st8{fill:#3D4FA0;}
|
||||
.st9{fill:#63451F;stroke:#FFFFFF;stroke-width:20;stroke-miterlimit:10;}
|
||||
.st10{fill:#63451F;}
|
||||
</style>
|
||||
<g id="DrawBlack">
|
||||
<polyline id="BG_1_" class="st0" points="1128.5,650.67 3378,1950 3378,2137 1128.5,3432.67 "/>
|
||||
<rect id="Left_1_" x="678.5" y="128.48" class="st1" width="450" height="3821.5"/>
|
||||
|
||||
<rect id="Top_1_" x="1915.71" y="-583.55" transform="matrix(0.5 -0.866 0.866 0.5 225.753 2341.5386)" class="st0" width="450" height="3117.62"/>
|
||||
<g id="Finger_1_">
|
||||
<g>
|
||||
<defs>
|
||||
|
||||
<rect id="SVGID_1_" x="-626.54" y="666.18" transform="matrix(0.9063 -0.4226 0.4226 0.9063 -723.8983 1097.2598)" width="5478.6" height="3030.2"/>
|
||||
</defs>
|
||||
<clipPath id="SVGID_2_">
|
||||
<use xlink:href="#SVGID_1_" style="overflow:visible;"/>
|
||||
</clipPath>
|
||||
<g id="g14_3_" class="st2">
|
||||
<g id="g44_1_" transform="translate(17.2764,0.8682)">
|
||||
<path id="path46_1_" class="st0" d="M2605.11,3533.86c0,0,159.85-112.71,149-195.05c-10.68-85.2-127.58-48.89-127.58-48.89
|
||||
s136.18-82.82,112.7-180.35c-22.17-91.83-167.38-48.54-167.38-48.54s119.56-92.9,85.39-182.75
|
||||
c-28.87-75.6-188.03-44.94-188.03-44.94s651.47-417.09,718.51-459.5c66.86-42.42,160.29-131.95,87.28-198.12
|
||||
c-72.76-66.37-205.83-7.85-269.88,32.69c-64.01,40.62-874.42,553.28-1153.93,730.24c-29.84,18.84-169.66,107.16-186.59,118.03
|
||||
c-69.96,44.42-112.22,42.02-74.07-13.01c51.14-73.63,74.73-139.7,55.45-222.1c-20.44-86.69-114.31-161.6-159.65-186.44
|
||||
c-84.35-46.21-197.27-61.16-306.71-33.34c-170.83,43.44-256.98,149.65-157.15,218.26c149.29,102.66,148.88,244.02,37.82,381.07
|
||||
c-261.05,322.06-363.57,512.7-142.28,713.95c241.24,219.53,812.72,166.75,1276.35-126.35
|
||||
C2218.92,3773.38,2605.11,3533.86,2605.11,3533.86"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g id="Eyes_1_">
|
||||
<g>
|
||||
<defs>
|
||||
<rect id="SVGID_3_" x="95.01" y="544.01" width="3526.99" height="3526.99"/>
|
||||
</defs>
|
||||
<clipPath id="SVGID_4_">
|
||||
<use xlink:href="#SVGID_3_" style="overflow:visible;"/>
|
||||
</clipPath>
|
||||
<g id="g14_2_" class="st3">
|
||||
<g id="g24_1_" transform="translate(15.4063,25.5)">
|
||||
<path id="path26_1_" class="st0" d="M1588.99,1547.21c0,135.3-87.78,244.93-195.94,244.93
|
||||
c-108.16,0-195.94-109.63-195.94-244.93c0-135.2,87.78-244.93,195.94-244.93C1501.21,1302.28,1588.99,1412.01,1588.99,1547.21"
|
||||
/>
|
||||
</g>
|
||||
<g id="g32_1_" transform="translate(9.6709,29.667)">
|
||||
<path id="path34_1_" class="st0" d="M1032.82,1134.8c-16.07-8.52-29.69-21.85-38.31-38.99c-21.16-42.03-3.92-90.82,38.5-109.04
|
||||
c417.95-179.29,754.29-4.21,768.39,3.33c42.42,22.63,59.57,73.28,38.31,113.06c-21.16,39.68-72.5,53.49-114.92,31.16
|
||||
c-12.05-6.27-277.46-140.3-615.07,4.6C1084.54,1149.59,1056.13,1147.24,1032.82,1134.8"/>
|
||||
</g>
|
||||
<g id="g36_1_" transform="translate(14.7427,16.4277)">
|
||||
<path id="path38_1_" class="st0" d="M1524.64,2445.12c-13.32-12.44-23.12-28.71-27.04-47.61c-9.7-45.95,19.4-88.76,65.15-95.42
|
||||
c449.89-66.43,730.09,188.99,741.94,199.86c35.27,32.72,38.7,85.92,8.03,119.04c-30.57,32.92-83.77,33.11-118.94,0.59
|
||||
c-10.19-9.01-232.39-206.52-595.87-152.93C1570.78,2472.65,1543.94,2463.15,1524.64,2445.12"/>
|
||||
</g>
|
||||
<g id="g40_1_" transform="translate(20.4307,25.917)">
|
||||
<path id="path42_1_" class="st0" d="M2076.21,1505.94c-15.28-9.6-28.02-23.81-35.47-41.54c-18.32-43.3,2.25-90.92,45.75-106.2
|
||||
c429.22-150.48,752.91,47.03,766.53,55.55c40.66,25.47,54.28,77.1,30.47,115.41c-23.71,38.21-76.03,48.5-116.68,23.32
|
||||
c-11.76-7.15-267.27-158.81-613.99-37.23C2126.96,1524.26,2098.75,1519.95,2076.21,1505.94"/>
|
||||
</g>
|
||||
<g id="g28_1_" transform="translate(26,24.5)">
|
||||
<path id="path30_1_" class="st0" d="M2616.28,1646.19c0,135.3-87.69,244.93-195.94,244.93
|
||||
c-108.16,0-195.94-109.63-195.94-244.93c0-135.2,87.78-244.93,195.94-244.93C2528.6,1401.26,2616.28,1510.99,2616.28,1646.19"
|
||||
/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g id="Path">
|
||||
<path id="CutLine" class="st4" d="M528,128C532-14,669,0,669,0h346l2629,1464c0,0,78,34,28,108s-217,359-217,359s-22,9,9,226
|
||||
s-204,313-204,313l-545,356c0,0,421.37,492.67,29.68,732.33S1798,4056,1798,4056s28.13,15-290.94,15s-828.56,0-828.56,0
|
||||
S531,4102,528,3904S528,128,528,128z"/>
|
||||
</g>
|
||||
<g id="Draw">
|
||||
<polyline id="BG" class="st5" points="1128.5,650.67 3378,1950 3378,2137 1128.5,3432.67 "/>
|
||||
<rect id="Left" x="678.5" y="128.48" class="st6" width="450" height="3821.5"/>
|
||||
|
||||
<rect id="Top" x="1915.71" y="-583.55" transform="matrix(0.5 -0.866 0.866 0.5 225.753 2341.5386)" class="st7" width="450" height="3117.62"/>
|
||||
<g id="Finger">
|
||||
<g id="g44" transform="translate(17.2764,0.8682)">
|
||||
<path id="path46" class="st8" d="M2605.11,3533.86c0,0,159.85-112.71,149-195.05c-10.68-85.2-127.58-48.89-127.58-48.89
|
||||
s136.18-82.82,112.7-180.35c-22.17-91.83-167.38-48.54-167.38-48.54s119.56-92.9,85.39-182.75
|
||||
c-28.87-75.6-188.03-44.94-188.03-44.94s651.47-417.09,718.51-459.5c66.86-42.42,160.29-131.95,87.28-198.12
|
||||
c-72.76-66.37-205.83-7.85-269.88,32.69c-64.01,40.62-874.42,553.28-1153.93,730.24c-29.84,18.84-169.66,107.16-186.59,118.03
|
||||
c-69.96,44.42-112.22,42.02-74.07-13.01c51.14-73.63,74.73-139.7,55.45-222.1c-20.44-86.69-114.31-161.6-159.65-186.44
|
||||
c-84.35-46.21-197.27-61.16-306.71-33.34c-170.83,43.44-256.98,149.65-157.15,218.26c149.29,102.66,148.88,244.02,37.82,381.07
|
||||
c-261.05,322.06-363.57,512.7-142.28,713.95c241.24,219.53,812.72,166.75,1276.35-126.35
|
||||
C2218.92,3773.38,2605.11,3533.86,2605.11,3533.86"/>
|
||||
</g>
|
||||
</g>
|
||||
<g id="Eyes">
|
||||
<g id="g24" transform="translate(15.4063,25.5)">
|
||||
<path id="path26" class="st9" d="M1588.99,1547.21c0,135.3-87.78,244.93-195.94,244.93c-108.16,0-195.94-109.63-195.94-244.93
|
||||
c0-135.2,87.78-244.93,195.94-244.93C1501.21,1302.28,1588.99,1412.01,1588.99,1547.21"/>
|
||||
</g>
|
||||
<g id="g32" transform="translate(9.6709,29.667)">
|
||||
<path id="path34" class="st9" d="M1032.82,1134.8c-16.07-8.52-29.69-21.85-38.31-38.99c-21.16-42.03-3.92-90.82,38.5-109.04
|
||||
c417.95-179.29,754.29-4.21,768.39,3.33c42.42,22.63,59.57,73.28,38.31,113.06c-21.16,39.68-72.5,53.49-114.92,31.16
|
||||
c-12.05-6.27-277.46-140.3-615.07,4.6C1084.54,1149.59,1056.13,1147.24,1032.82,1134.8"/>
|
||||
</g>
|
||||
<g id="g36" transform="translate(14.7427,16.4277)">
|
||||
<path id="path38" class="st9" d="M1524.64,2445.12c-13.32-12.44-23.12-28.71-27.04-47.61c-9.7-45.95,19.4-88.76,65.15-95.42
|
||||
c449.89-66.43,730.09,188.99,741.94,199.86c35.27,32.72,38.7,85.92,8.03,119.04c-30.57,32.92-83.77,33.11-118.94,0.59
|
||||
c-10.19-9.01-232.39-206.52-595.87-152.93C1570.78,2472.65,1543.94,2463.15,1524.64,2445.12"/>
|
||||
</g>
|
||||
<g id="g40" transform="translate(20.4307,25.917)">
|
||||
<path id="path42" class="st9" d="M2076.21,1505.94c-15.28-9.6-28.02-23.81-35.47-41.54c-18.32-43.3,2.25-90.92,45.75-106.2
|
||||
c429.22-150.48,752.91,47.03,766.53,55.55c40.66,25.47,54.28,77.1,30.47,115.41c-23.71,38.21-76.03,48.5-116.68,23.32
|
||||
c-11.76-7.15-267.27-158.81-613.99-37.23C2126.96,1524.26,2098.75,1519.95,2076.21,1505.94"/>
|
||||
</g>
|
||||
<g id="g28" transform="translate(26,24.5)">
|
||||
<path id="path30" class="st10" d="M2616.28,1646.19c0,135.3-87.69,244.93-195.94,244.93c-108.16,0-195.94-109.63-195.94-244.93
|
||||
c0-135.2,87.78-244.93,195.94-244.93C2528.6,1401.26,2616.28,1510.99,2616.28,1646.19"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 41 KiB |
4
app/js/common/jquery.js
vendored
@@ -1,3 +1,5 @@
|
||||
selectedColumn = 0
|
||||
selectedToot = 0
|
||||
$(function ($) {
|
||||
//キーボードショートカット
|
||||
$(window).keydown(function (e) {
|
||||
@@ -12,6 +14,17 @@ $(function ($) {
|
||||
} else {
|
||||
var wv = true;
|
||||
}
|
||||
//Enter
|
||||
if (e.keyCode === 13) {
|
||||
if($("#src").is(':focus')){
|
||||
src()
|
||||
return false;
|
||||
}
|
||||
if($("#list-add").is(':focus')){
|
||||
makeNewList()
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//Ctrl+Shift+Enter:Lgen
|
||||
if (event.metaKey || event.ctrlKey && wv) {
|
||||
if (event.shiftKey) {
|
||||
@@ -20,7 +33,6 @@ $(function ($) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//Ctrl+Enter:投稿
|
||||
if (event.metaKey || event.ctrlKey && wv) {
|
||||
@@ -36,14 +48,6 @@ $(function ($) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//Shift+Space:Markdownゼロ幅スペース
|
||||
if (event.shiftKey) {
|
||||
if (e.keyCode === 32) {
|
||||
brInsert("");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//Esc:消す
|
||||
if (e.keyCode === 27 && wv) {
|
||||
hide();
|
||||
@@ -54,14 +58,6 @@ $(function ($) {
|
||||
location.href = "index.html";
|
||||
return false;
|
||||
}
|
||||
//Ctrl+R:ランキング
|
||||
if ((event.metaKey || event.ctrlKey) && wv) {
|
||||
if (e.keyCode === 82) {
|
||||
if (localStorage.getItem("kirishima")) {
|
||||
window.open("https://astarte.thedesk.top");
|
||||
}
|
||||
}
|
||||
}
|
||||
//Ctrl+Sift+C:全消し
|
||||
if (((event.metaKey || event.ctrlKey) && event.shiftKey) && wv) {
|
||||
if (e.keyCode === 67) {
|
||||
@@ -135,7 +131,7 @@ $(function ($) {
|
||||
}
|
||||
}
|
||||
//Ctrl+Sift+P:プロフ
|
||||
if ((event.ctrlKey) && event.shiftKey) {
|
||||
if ((event.metaKey || event.ctrlKey) && event.shiftKey) {
|
||||
if (e.keyCode === 80) {
|
||||
profShow()
|
||||
return false;
|
||||
@@ -149,30 +145,82 @@ $(function ($) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//矢印:選択
|
||||
if (e.code == "ArrowLeft") {
|
||||
//left
|
||||
if ($("#imagemodal").hasClass("open")) {
|
||||
imgCont('prev');
|
||||
return false;
|
||||
}
|
||||
if (selectedColumn > 0) {
|
||||
selectedColumn--
|
||||
}
|
||||
tootSelector(selectedColumn, selectedToot)
|
||||
return false;
|
||||
} else if (e.code == "ArrowUp") {
|
||||
//up
|
||||
if ($("#imagemodal").hasClass("open")) {
|
||||
return false;
|
||||
}
|
||||
if (selectedToot > 0) {
|
||||
selectedToot--
|
||||
}
|
||||
tootSelector(selectedColumn, selectedToot)
|
||||
return false;
|
||||
} else if (e.code == "ArrowRight") {
|
||||
//right
|
||||
if ($("#imagemodal").hasClass("open")) {
|
||||
imgCont('next');
|
||||
return false;
|
||||
}
|
||||
if (selectedColumn < $(".tl-box").length - 1) {
|
||||
selectedColumn++
|
||||
}
|
||||
tootSelector(selectedColumn, selectedToot)
|
||||
return false;
|
||||
} else if (e.code == "ArrowDown") {
|
||||
//down
|
||||
if ($("#imagemodal").hasClass("open")) {
|
||||
return false;
|
||||
}
|
||||
selectedToot++
|
||||
tootSelector(selectedColumn, selectedToot)
|
||||
return false;
|
||||
}
|
||||
//Ctrl+U:0,0選択
|
||||
if (event.ctrlKey || event.metaKey) {
|
||||
if (e.keyCode === 85) {
|
||||
selectedToot = 0
|
||||
selectedColumn = 0
|
||||
tootSelector(0, 0)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//選択時
|
||||
if (e.keyCode == 70) {
|
||||
var id = $(".selectedToot").attr('unique-id')
|
||||
var acct_id = $('#timeline_' + selectedColumn).attr("data-acct")
|
||||
fav(id, acct_id, false)
|
||||
return false;
|
||||
}
|
||||
if (e.keyCode == 66) {
|
||||
var id = $(".selectedToot").attr('unique-id')
|
||||
var acct_id = $('#timeline_' + selectedColumn).attr("data-acct")
|
||||
rt(id, acct_id, false)
|
||||
return false;
|
||||
}
|
||||
if (e.keyCode == 82) {
|
||||
var id = $(".selectedToot").attr('unique-id')
|
||||
var acct_id = $('#timeline_' + selectedColumn).attr("data-acct")
|
||||
var ats_cm = $('.selectedToot .rep-btn').attr("data-men")
|
||||
var mode = $('.selectedToot .rep-btn').attr("data-visen")
|
||||
re(id, ats_cm, acct_id, mode)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//textareaフォーカス時
|
||||
if (hasFocus2 && wv) {
|
||||
if (event.metaKey || event.ctrlKey) {
|
||||
//Ctrl+B:太字
|
||||
if (e.keyCode === 66) {
|
||||
tagsel('b');
|
||||
return false;
|
||||
}
|
||||
//Ctrl+I:斜字
|
||||
if (e.keyCode === 73) {
|
||||
tagsel('i');
|
||||
return false;
|
||||
}
|
||||
//Ctrl+U:下線
|
||||
if (e.keyCode === 85) {
|
||||
tagsel('u');
|
||||
return false;
|
||||
}
|
||||
//Ctrl+S:取り消し線
|
||||
if (e.keyCode === 83) {
|
||||
tagsel('s');
|
||||
return false;
|
||||
}
|
||||
//C+S+(No):ワンクリ
|
||||
if ((event.metaKey || event.ctrlKey) && event.shiftKey) {
|
||||
if (e.keyCode >= 49 && e.keyCode <= 51) {
|
||||
@@ -183,22 +231,28 @@ $(function ($) {
|
||||
}
|
||||
}
|
||||
}
|
||||
//イメージビューワー切り替え
|
||||
if (e.keyCode === 37 && wv) {
|
||||
if ($("#imagemodal").hasClass("open")) {
|
||||
imgCont('prev');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (e.keyCode === 39 && wv) {
|
||||
if ($("#imagemodal").hasClass("open")) {
|
||||
imgCont('next');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
//クリアボタン
|
||||
$("#clear").click(function () {
|
||||
clear();
|
||||
});
|
||||
});
|
||||
//選択する
|
||||
function tootSelector(column, toot) {
|
||||
$('.cvo').removeClass("selectedToot")
|
||||
$('#timeline_' + column + ' .cvo').eq(toot).addClass("selectedToot")
|
||||
var scr = $('.tl-box[tlid=' + column + ']').scrollTop()
|
||||
var elem = $('.selectedToot').offset().top
|
||||
var top = elem - $('.tl-box').height() + scr
|
||||
if (top > 0) {
|
||||
top = top + $('.selectedToot').height()
|
||||
if (top > scr) {
|
||||
$('.tl-box[tlid=' + column + ']').animate({ scrollTop: top })
|
||||
}
|
||||
} else if (elem < 0) {
|
||||
var to = scr + elem - $('.selectedToot').height()
|
||||
if (to < scr) {
|
||||
$('.tl-box[tlid=' + column + ']').animate({ scrollTop: to })
|
||||
}
|
||||
}
|
||||
}
|
||||
12374
app/js/common/materialize.js
vendored
6
app/js/common/materialize.min.js
vendored
@@ -23,4 +23,7 @@ $(document).ready(function () {
|
||||
}
|
||||
);
|
||||
$('.collapsible').collapsible();
|
||||
$('#videomodal').modal({
|
||||
onCloseEnd: stopVideo
|
||||
});
|
||||
});
|
||||
@@ -37,7 +37,6 @@
|
||||
}
|
||||
};
|
||||
var $t = $.timeago;
|
||||
|
||||
$.extend($.timeago, {
|
||||
settings: {
|
||||
refreshMillis: 60000,
|
||||
@@ -47,22 +46,22 @@
|
||||
cutoff: 0,
|
||||
autoDispose: true,
|
||||
strings: {
|
||||
prefixAgo: null,
|
||||
prefixFromNow: "今から",
|
||||
suffixAgo: "",
|
||||
suffixFromNow: "",
|
||||
inPast: '',
|
||||
seconds: "%d秒前",
|
||||
minute: "1分前",
|
||||
minutes: "%d分前",
|
||||
hour: "1時間前",
|
||||
hours: "%d時間前",
|
||||
day: "昨日",
|
||||
days: "%d日前",
|
||||
month: "昨月",
|
||||
months: "%dヶ月前",
|
||||
year: "去年",
|
||||
years: "%d年前",
|
||||
prefixAgo: lang.lang_time_prefixAgo,
|
||||
prefixFromNow: lang.lang_time_prefixFromNow,
|
||||
suffixAgo: lang.lang_time_suffixAgo,
|
||||
suffixFromNow: lang.lang_time_suffixFromNow,
|
||||
inPast: lang.lang_time_inPast,
|
||||
seconds: lang.lang_time_seconds,
|
||||
minute: lang.lang_time_minute,
|
||||
minutes: lang.lang_time_minutes,
|
||||
hour: lang.lang_time_hour,
|
||||
hours: lang.lang_time_hours,
|
||||
day: lang.lang_time_day,
|
||||
days: lang.lang_time_days,
|
||||
month: lang.lang_time_month,
|
||||
months: lang.lang_time_months,
|
||||
year: lang.lang_time_year,
|
||||
years: lang.lang_time_years,
|
||||
wordSeparator: " ",
|
||||
numbers: []
|
||||
}
|
||||
|
||||
@@ -3,12 +3,24 @@ function verck(ver) {
|
||||
console.log("%c Welcome😊", "color: red;font-size:200%;")
|
||||
var date = new Date();
|
||||
var show = false
|
||||
if (localStorage.getItem("ver") != ver) {
|
||||
localStorage.setItem("ver", ver);
|
||||
if (localStorage.getItem("ver") != ver && localStorage.getItem("winstore")) {
|
||||
//ちょっと削除とリンク解析の都合上アレ(s)
|
||||
//対象外のアプデ:storageが20の最初まで"Usamin (18.6.5)"
|
||||
if (!localStorage.getItem("usamin_18_6_5_flag")) {
|
||||
localStorage.setItem("usamin_18_6_5_flag", true)
|
||||
var multi = localStorage.getItem("column");
|
||||
var obj = JSON.parse(multi);
|
||||
for (var i = 0; i < obj.length; i++) {
|
||||
localStorage.removeItem("card_" + i);
|
||||
}
|
||||
}
|
||||
//ちょっと削除とリンク解析の都合上アレ(e)
|
||||
show = true
|
||||
console.log("%c Thank you for your update🎉", "color: red;font-size:200%;");
|
||||
$(document).ready(function () {
|
||||
$('#releasenote').modal('open');
|
||||
if (localStorage.getItem("winstore")) {
|
||||
$('#releasenote').modal('open');
|
||||
}
|
||||
verp = ver.replace('(', '');
|
||||
verp = verp.replace('.', '-');
|
||||
verp = verp.replace('.', '-');
|
||||
@@ -22,9 +34,9 @@ function verck(ver) {
|
||||
} else {
|
||||
$("#release-en").show();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
localStorage.setItem("ver", ver);
|
||||
if (!show) {
|
||||
console.log(show)
|
||||
if (date.getMonth() + 1 >= localStorage.getItem("showSupportMe") || !localStorage.getItem("showSupportMe")) {
|
||||
@@ -48,48 +60,8 @@ function verck(ver) {
|
||||
}
|
||||
var platform = localStorage.getItem("platform");
|
||||
console.log("Your platform:" + platform)
|
||||
if (platform == "win32") {
|
||||
const options = {
|
||||
type: 'info',
|
||||
title: "Select your platform",
|
||||
message: lang.lang_version_platform,
|
||||
buttons: [lang.lang_no, lang.lang_yesno]
|
||||
}
|
||||
if (!localStorage.getItem("winstore")) {
|
||||
postMessage(["dialogStore", options], "*")
|
||||
}
|
||||
} else if (platform == "linux") {
|
||||
if (localStorage.getItem("winstore") == "unix") {
|
||||
localStorage.removeItem("winstore")
|
||||
}
|
||||
if (!localStorage.getItem("winstore")) {
|
||||
const options = {
|
||||
type: 'info',
|
||||
title: "Select your platform",
|
||||
message: lang.lang_version_platform_linux,
|
||||
buttons: [lang.lang_no, lang.lang_yesno]
|
||||
}
|
||||
if (!localStorage.getItem("winstore")) {
|
||||
postMessage(["dialogStore", options], "*")
|
||||
}
|
||||
}
|
||||
} else if (platform == "darwin") {
|
||||
if (localStorage.getItem("winstore") == "unix") {
|
||||
localStorage.removeItem("winstore")
|
||||
}
|
||||
if (!localStorage.getItem("winstore")) {
|
||||
const options = {
|
||||
type: 'info',
|
||||
title: "Select your platform",
|
||||
message: lang.lang_version_platform_mac,
|
||||
buttons: [lang.lang_no, lang.lang_yesno]
|
||||
}
|
||||
if (!localStorage.getItem("winstore")) {
|
||||
postMessage(["dialogStore", options], "*")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
localStorage.setItem("winstore", "unix")
|
||||
if (!localStorage.getItem("winstore")) {
|
||||
$("#start").css('display', 'flex');
|
||||
}
|
||||
if (localStorage.getItem("winstore") == "brewcask" || localStorage.getItem("winstore") == "snapcraft" || localStorage.getItem("winstore") == "winstore") {
|
||||
var winstore = true;
|
||||
@@ -163,6 +135,59 @@ function verck(ver) {
|
||||
if (obj.ID * 1 <= last) {
|
||||
break;
|
||||
} else {
|
||||
if (obj.type == "textv2") {
|
||||
if (~obj.languages.indexOf(lang.language)) {
|
||||
var show = true;
|
||||
if (obj.toot != "") {
|
||||
var toot = '<button class="btn-flat toast-action" onclick="detEx(\'' + obj.toot + '\',\'main\')">Show</button>';
|
||||
} else {
|
||||
var toot = "";
|
||||
}
|
||||
if (obj.ver != "") {
|
||||
if (obj.ver == ver) {
|
||||
show = true;
|
||||
} else {
|
||||
show = false;
|
||||
}
|
||||
}
|
||||
if (obj.domain != "") {
|
||||
var multi = localStorage.getItem("multi");
|
||||
if (multi) {
|
||||
show = false;
|
||||
var accts = JSON.parse(multi);
|
||||
Object.keys(accts).forEach(function (key) {
|
||||
var acct = accts[key];
|
||||
if (acct.domain == obj.domain) {
|
||||
show = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
if (show) {
|
||||
M.toast({ html: escapeHTML(obj.text) + toot + '<span class="sml grey-text">(スライドして消去)</span>', displayLength: 86400 })
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
var infostreaming = false;
|
||||
function infowebsocket() {
|
||||
infows = new WebSocket("wss://thedesk.top/ws/");
|
||||
infows.onopen = function (mess) {
|
||||
console.log([tlid, ":Connect Streaming Info:", mess]);
|
||||
infostreaming = true;
|
||||
}
|
||||
infows.onmessage = function (mess) {
|
||||
console.log([tlid, ":Receive Streaming:", JSON.parse(mess.data)]);
|
||||
var obj = JSON.parse(mess.data);
|
||||
if (obj.type != "counter") {
|
||||
if (obj.type == "textv2") {
|
||||
if (~obj.languages.indexOf(lang.language)) {
|
||||
localStorage.setItem("last-notice-id", obj.id)
|
||||
var show = true;
|
||||
if (obj.toot != "") {
|
||||
var toot = '<button class="btn-flat toast-action" onclick="detEx(\'' + obj.toot + '\',\'main\')">Show</button>';
|
||||
@@ -190,54 +215,11 @@ function verck(ver) {
|
||||
}
|
||||
}
|
||||
if (show) {
|
||||
console.log(obj.text)
|
||||
console.log(escapeHTML(obj.text))
|
||||
M.toast({ html: escapeHTML(obj.text) + toot + '<span class="sml grey-text">(スライドして消去)</span>', displayLength: 86400 })
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
var infostreaming = false;
|
||||
function infowebsocket() {
|
||||
infows = new WebSocket("wss://thedesk.top/ws/");
|
||||
infows.onopen = function (mess) {
|
||||
console.log([tlid, ":Connect Streaming Info:", mess]);
|
||||
infostreaming = true;
|
||||
}
|
||||
infows.onmessage = function (mess) {
|
||||
console.log([tlid, ":Receive Streaming:", JSON.parse(mess.data)]);
|
||||
var obj = JSON.parse(mess.data);
|
||||
if (obj.type != "counter") {
|
||||
localStorage.setItem("last-notice-id", obj.id)
|
||||
var show = true;
|
||||
if (obj.toot != "") {
|
||||
var toot = '<button class="btn-flat toast-action" onclick="detEx(\'' + obj.toot + '\',\'main\')">Show</button>';
|
||||
} else {
|
||||
var toot = "";
|
||||
}
|
||||
if (obj.ver != "") {
|
||||
if (obj.ver == ver) {
|
||||
show = true;
|
||||
} else {
|
||||
show = false;
|
||||
}
|
||||
}
|
||||
if (obj.domain != "") {
|
||||
var multi = localStorage.getItem("multi");
|
||||
if (multi) {
|
||||
show = false;
|
||||
var accts = JSON.parse(multi);
|
||||
Object.keys(accts).forEach(function (key) {
|
||||
var acct = accts[key];
|
||||
if (acct.domain == obj.domain) {
|
||||
show = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
if (show) {
|
||||
M.toast({ html: escapeHTML(obj.Text) + toot + '<span class="sml grey-text">(スライドして消去)</span>', displayLength: 86400 })
|
||||
}
|
||||
} else {
|
||||
$("#persons").text(obj.text);
|
||||
@@ -285,3 +267,54 @@ function closeSupport() {
|
||||
}
|
||||
});
|
||||
}
|
||||
function storeDialog(platform, ver) {
|
||||
if (platform == "win32") {
|
||||
var mes = lang.lang_version_platform;
|
||||
} else if (platform == "linux") {
|
||||
var mes = lang.lang_version_platform_linux;
|
||||
} else if (platform == "darwin") {
|
||||
var mes = lang.lang_version_platform_mac;
|
||||
}
|
||||
Swal.fire({
|
||||
title: "Select your platform",
|
||||
text: mes,
|
||||
type: 'info',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#3085d6',
|
||||
confirmButtonText: lang.lang_no,
|
||||
cancelButtonText: lang.lang_yesno
|
||||
}).then((result) => {
|
||||
//逆にしてる
|
||||
if (!result.value) {
|
||||
localStorage.setItem("winstore", "winstore")
|
||||
} else {
|
||||
localStorage.setItem("winstore", "localinstall")
|
||||
}
|
||||
localStorage.setItem("ver", ver);
|
||||
show = true
|
||||
console.log("%c Thank you for your update🎉", "color: red;font-size:200%;");
|
||||
$(document).ready(function () {
|
||||
$('#releasenote').modal('open');
|
||||
verp = ver.replace('(', '');
|
||||
verp = verp.replace('.', '-');
|
||||
verp = verp.replace('.', '-');
|
||||
verp = verp.replace('[', '-');
|
||||
verp = verp.replace(']', '');
|
||||
verp = verp.replace(')', '');
|
||||
verp = verp.replace(' ', '_');
|
||||
console.log("%c " + verp, "color: red;font-size:200%;");
|
||||
if (lang.language == "ja") {
|
||||
$("#release-" + verp).show();
|
||||
} else {
|
||||
$("#release-en").show();
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
function closeStart() {
|
||||
$("#start").css('display', 'none');
|
||||
var platform = localStorage.getItem("platform");
|
||||
var ver = localStorage.getItem("ver");
|
||||
storeDialog(platform, ver)
|
||||
}
|
||||
@@ -50,6 +50,10 @@ function customEmoji() {
|
||||
emojiList('home')
|
||||
}
|
||||
function defEmoji(target) {
|
||||
var selin = $("#textarea").prop('selectionStart');
|
||||
if (!selin) {
|
||||
selin = 0;
|
||||
}
|
||||
var emojiraw = newpack.filter(function (item, index) {
|
||||
if (item.short_name == target) return true;
|
||||
});
|
||||
@@ -60,22 +64,11 @@ function defEmoji(target) {
|
||||
emoji = twemoji.convert.fromCodePoint(hex[0]);
|
||||
}
|
||||
var now = $("#textarea").val();
|
||||
var selin = localStorage.getItem("cursor");
|
||||
var now = $("#textarea").val();
|
||||
if (selin > 0) {
|
||||
var before = now.substr(0, selin);
|
||||
var after = now.substr(selin, now.length);
|
||||
newt = before + emoji + after;
|
||||
} else {
|
||||
newt = emoji + now;
|
||||
}
|
||||
var before = now.substr(0, selin);
|
||||
var after = now.substr(selin, now.length);
|
||||
newt = before + emoji + after;
|
||||
$("#textarea").val(newt);
|
||||
$("#textarea").focus();
|
||||
var selin = $("#textarea").prop('selectionStart');
|
||||
if (!selin) {
|
||||
selin = 0;
|
||||
}
|
||||
localStorage.setItem("cursor", selin);
|
||||
}
|
||||
function faicon() {
|
||||
var json = faicons;
|
||||
|
||||
@@ -9,22 +9,11 @@ var idata = {
|
||||
"kirishima.cloud_public": "パブリックタイムライン",
|
||||
"minohdon.jp": "instance",
|
||||
"minohdon.jp_name": "箕面どん",
|
||||
"minohdon.jp_letters": "500",
|
||||
"minohdon.jp_bbcode": "disabled",
|
||||
"minohdon.jp_markdown": "disabled",
|
||||
"minohdon.jp_glitch": "disabled",
|
||||
"knzk.me": "instance",
|
||||
"knzk.me_name": "Knzk",
|
||||
"knzk.me_letters": "5000",
|
||||
"knzk.me_bbcode": "disabled",
|
||||
"knzk.me_markdown": "disabled",
|
||||
"knzk.me_glitch": "disabled",
|
||||
"fedibird.com":"instance",
|
||||
"fedibird.com_name":"Fedibird",
|
||||
"fedibird.com_quote":"enabled",
|
||||
"mastodos.com": "instance",
|
||||
"mastodos.com_name": "マストどす",
|
||||
"mastodos.com_letters": "500",
|
||||
"mastodos.com_bbcode": "disabled",
|
||||
"mastodos.com_markdown": "disabled",
|
||||
"mastodos.com_glitch": "disabled",
|
||||
"dev.kirishima.cloud": "hidden",
|
||||
"dev.kirishima.cloud_name": "アスタルテ(Dev)",
|
||||
"dev.kirishima.cloud_letters": "6229",
|
||||
@@ -33,15 +22,8 @@ var idata = {
|
||||
"dev.kirishima.cloud_glitch": "enabled",
|
||||
"mstdn.y-zu.org": "instance",
|
||||
"mstdn.y-zu.org_name": "Yづドン(Y-zuDon)",
|
||||
"mstdn.y-zu.org_letters": "500",
|
||||
"mstdn.y-zu.org_bbcode": "disabled",
|
||||
"mstdn.y-zu.org_markdown": "enabled",
|
||||
"mstdn.y-zu.org_glitch": "disabled",
|
||||
"imastodon.net": "instance",
|
||||
"imastodon.net_name": "im@stodon",
|
||||
"imastodon.net_letters": "500",
|
||||
"imastodon.net_bbcode": "disabled",
|
||||
"imastodon.net_markdown": "disabled",
|
||||
"imastodon.net_home": "オフィス",
|
||||
"imastodon.net_local": "楽屋",
|
||||
"imastodon.net_notification": "ホワイトボード",
|
||||
@@ -50,12 +32,6 @@ var idata = {
|
||||
"imastodon.net_fav": "の頭にティンときたようです",
|
||||
"imastodon.net_bt": ":「わかるわ」",
|
||||
"imastodon.net_follow": "名刺をいただきました",
|
||||
"imastodon.net_glitch": "disabled",
|
||||
"mstdn.osaka": "instance",
|
||||
"mstdn.osaka_name": "大阪丼",
|
||||
"mstdn.osaka_letters": "500",
|
||||
"mstdn.osaka_bbcode": "disabled",
|
||||
"mstdn.osaka_markdown": "disabled",
|
||||
"mstdn.osaka_home": "ウチ",
|
||||
"mstdn.osaka_local": "近所",
|
||||
"mstdn.osaka_notification": "あめちゃん",
|
||||
@@ -64,12 +40,9 @@ var idata = {
|
||||
"mstdn.osaka_fav": "がええやん言いました",
|
||||
"mstdn.osaka_bt": "がしばいた",
|
||||
"mstdn.osaka_follow": "ツルまれました",
|
||||
"mstdn.osaka_glitch": "disabled",
|
||||
"mstdn.kemono-friends.info": "instance",
|
||||
"mstdn.kemono-friends.info_name": "ますとどんちほー",
|
||||
"mstdn.kemono-friends.info_letters": "1024",
|
||||
"mstdn.kemono-friends.info_bbcode": "disabled",
|
||||
"mstdn.kemono-friends.info_markdown": "disabled",
|
||||
"mstdn.kemono-friends.info_home": "なわばり",
|
||||
"mstdn.kemono-friends.info_local": "ますとどんちほー",
|
||||
"mstdn.kemono-friends.info_notification": "ねえねえ!",
|
||||
@@ -77,28 +50,22 @@ var idata = {
|
||||
"mstdn.kemono-friends.info_post": "がおー!",
|
||||
"mstdn.kemono-friends.info_fav": ":「すごーい」",
|
||||
"mstdn.kemono-friends.info_bt": ":「たーのしー」",
|
||||
"mstdn.kemono-friends.info_glitch": "disabled",
|
||||
"itabashi.0j0.jp": "instance",
|
||||
"itabashi.0j0.jp_name": "板橋丼",
|
||||
"itabashi.0j0.jp_letters": "1024",
|
||||
"itabashi.0j0.jp_bbcode": "disabled",
|
||||
"itabashi.0j0.jp_markdown": "disabled",
|
||||
"itabashi.0j0.jp_glitch": "disabled",
|
||||
"itabashi.0j0.jp_quote":"enabled",
|
||||
"dtp-mstdn.jp": "instance",
|
||||
"dtp-mstdn.jp_name": "DTP鯖",
|
||||
"dtp-mstdn.jp_letters": "500",
|
||||
"dtp-mstdn.jp_bbcode": "disabled",
|
||||
"dtp-mstdn.jp_markdown": "disabled",
|
||||
"dtp-mstdn.jp_glitch": "disabled",
|
||||
"misskey.xyz": "misskey",
|
||||
"misskey.xyz_name": "misskey.xyz",
|
||||
"misskey.xyz_letters": "1000",
|
||||
"misskey.xyz_bbcode": "disabled",
|
||||
"misskey.xyz_markdown": "enabled",
|
||||
"misskey.xyz_public": "Global",
|
||||
"misskey.xyz_post": "Post",
|
||||
"misskey.xyz_fav": " reacted your post.",
|
||||
"misskey.xyz_bt": " reposted your post.",
|
||||
"dtp-mstdn.jp_name": "dtp-mstdn.jp",
|
||||
"dtp-mstdn.jp_quote":"enabled",
|
||||
"misskey.io": "misskey",
|
||||
"misskey.io_name": "misskey.io",
|
||||
"misskey.io_letters": "1000",
|
||||
"misskey.io_bbcode": "disabled",
|
||||
"misskey.io_markdown": "enabled",
|
||||
"misskey.io_public": "Global",
|
||||
"misskey.io_post": "Post",
|
||||
"misskey.io_fav": " reacted your post.",
|
||||
"misskey.io_bt": " reposted your post.",
|
||||
"misskey.dev": "misskey",
|
||||
"misskey.dev_name": "misskey.dev",
|
||||
"misskey.dev_letters": "1024",
|
||||
@@ -111,16 +78,11 @@ var idata = {
|
||||
"precure.ml": "instance",
|
||||
"precure.ml_name": "キュアスタ!",
|
||||
"precure.ml_letters": "1024",
|
||||
"precure.ml_bbcode": "disabled",
|
||||
"precure.ml_markdown": "disabled",
|
||||
"precure.ml_post": "キュア!",
|
||||
"precure.ml_glitch": "disabled",
|
||||
"best-friends.chat": "instance",
|
||||
"best-friends.chat_name": "Best Friends",
|
||||
"best-friends.chat_letters": "500",
|
||||
"best-friends.chat_bbcode": "disabled",
|
||||
"best-friends.chat_markdown": "disabled",
|
||||
"best-friends.chat_glitch": "disabled",
|
||||
"odakyu.app_quote":"enabled",
|
||||
"nitiasa.com_quote":"enabled",
|
||||
"biwakodon.com_quote":"enabled",
|
||||
"comm.cx_quote":"enabled"
|
||||
};
|
||||
|
||||
localStorage.setItem("instance", JSON.stringify(idata));
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
//アスタルテ判定初期化
|
||||
|
||||
localStorage.removeItem("kirishima")
|
||||
localStorage.removeItem("quoters")
|
||||
localStorage.removeItem("imas")
|
||||
localStorage.removeItem("image");
|
||||
localStorage.removeItem("stable")
|
||||
@@ -40,9 +41,10 @@ function ck() {
|
||||
if (obj[0].domain) {
|
||||
$("#tl").show();
|
||||
ticker();
|
||||
multiSelector();
|
||||
multiSelector(false);
|
||||
verck(ver);
|
||||
$("#something-wrong img").attr("src", "../../img/thinkingdesk.png")
|
||||
$(".stw").show()
|
||||
$("#something-wrong img").attr("src", "../../img/thinking.svg")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -289,6 +291,11 @@ function refresh(target, loadskip) {
|
||||
localStorage.setItem("user-id_" + target, json["id"]);
|
||||
localStorage.setItem("prof_" + target, avatar);
|
||||
localStorage.setItem("follow_" + target, json["following_count"]);
|
||||
if(json["source"]["sensitive"]){
|
||||
localStorage.setItem("nsfw_" + target, "true");
|
||||
}else{
|
||||
localStorage.removeItem("nsfw_" + target);
|
||||
}
|
||||
obj[target] = ref;
|
||||
var json = JSON.stringify(obj);
|
||||
localStorage.setItem("multi", json);
|
||||
@@ -313,7 +320,6 @@ function ckdb(acct_id) {
|
||||
localStorage.removeItem("followlocale_" + acct_id);
|
||||
if (domain == "kirishima.cloud") {
|
||||
localStorage.setItem("kirishima", "true");
|
||||
$("#ranking-btn").show();
|
||||
} else if (domain == "imastodon.net") {
|
||||
localStorage.setItem("imas", "true");
|
||||
$(".imasonly").show();
|
||||
@@ -321,8 +327,13 @@ function ckdb(acct_id) {
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var bbcode = domain + "_bbcode";
|
||||
var letters = domain + "_letters";
|
||||
var quoteMarker = domain + "_quote";
|
||||
if (localStorage.getItem("instance")) {
|
||||
var json = JSON.parse(localStorage.getItem("instance"));
|
||||
if (json[quoteMarker] == "enabled") {
|
||||
localStorage.setItem("quoters", "true");
|
||||
localStorage.setItem("quote_" + acct_id, "true");
|
||||
}
|
||||
if (json[bbcode]) {
|
||||
if (json[bbcode] == "enabled") {
|
||||
localStorage.setItem("bb_" + acct_id, "true");
|
||||
@@ -392,6 +403,8 @@ function ckdb(acct_id) {
|
||||
}
|
||||
if (json["urls"]["streaming_api"]) {
|
||||
localStorage.setItem("streaming_" + acct_id, json["urls"]["streaming_api"]);
|
||||
}else{
|
||||
localStorage.removeItem("streaming_" + acct_id);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -403,7 +416,7 @@ function ckdb(acct_id) {
|
||||
}
|
||||
|
||||
//アカウントを選択…を実装
|
||||
function multiSelector() {
|
||||
function multiSelector(parseC) {
|
||||
var multi = localStorage.getItem("multi");
|
||||
if (!multi) {
|
||||
var obj = [];
|
||||
@@ -450,7 +463,7 @@ function multiSelector() {
|
||||
$("#local-button").removeClass("hide")
|
||||
}
|
||||
var profimg = acct.prof;
|
||||
localStorage.setItem("prof_" + key, profimg);
|
||||
//localStorage.setItem("prof_" + key, profimg);
|
||||
if (!profimg) {
|
||||
profimg = "../../img/missing.svg";
|
||||
}
|
||||
@@ -488,9 +501,12 @@ function multiSelector() {
|
||||
});
|
||||
$("#src-acct-sel").append('<option value="tootsearch">Tootsearch</option>');
|
||||
$("#add-acct-sel").append('<option value="noauth">' + lang.lang_login_noauth + '</option><option value="webview">Twitter</option>');
|
||||
$("#dir-acct-sel").append('<option value="noauth">' + lang.lang_login_noauth + '</option>');
|
||||
}
|
||||
$('select').formSelect();
|
||||
parseColumn(true);
|
||||
if(!parseC){
|
||||
parseColumn(null, true);
|
||||
}
|
||||
}
|
||||
|
||||
//バージョンエンコ
|
||||
@@ -511,13 +527,11 @@ function ticker() {
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
}).then(function (response) {
|
||||
|
||||
return response.json();
|
||||
}).catch(function (error) {
|
||||
console.error(error);
|
||||
}).then(function (json) {
|
||||
if (json.error) {
|
||||
return;
|
||||
}
|
||||
if (json) {
|
||||
localStorage.setItem("ticker", JSON.stringify(json));
|
||||
}
|
||||
|
||||
@@ -10,16 +10,20 @@ $(document).on('click', 'a', e => {
|
||||
if (url) {
|
||||
urls = url.match(/https?:\/\/(.+)/);
|
||||
//トゥートのURLぽかったら
|
||||
toot = url.match(/https:\/\/([a-zA-Z0-9.-]+)\/@([a-zA-Z0-9_]+)\/([0-9]+)/);
|
||||
toot = url.match(/https:\/\/([^+_]+)\/@([a-zA-Z0-9_]+)\/([0-9]+)/);
|
||||
if(!toot){
|
||||
//Pleroma対策
|
||||
toot = url.match(/https:\/\/([^+_]+)\/users\/([a-zA-Z0-9_]+)\/statuses\/([0-9]+)/);
|
||||
}
|
||||
//タグのURLぽかったら
|
||||
var tags = [];
|
||||
tags = url.match(
|
||||
/https:\/\/([-a-zA-Z0-9@.]+)\/tags\/([-_.!~*\'()a-zA-Z0-9;\/?:\&=+\$,%#]+)/
|
||||
/https:\/\/([^+_]+)\/tags\/([_a-zA-Z0-9\&=+\%]+)/
|
||||
);
|
||||
//メンションっぽかったら
|
||||
var ats = [];
|
||||
ats = url.match(
|
||||
/https:\/\/([-a-zA-Z0-9.]+)\/@([-_.!~*\'()a-zA-Z0-9;\/?:\&=+\$,%#@]+)/
|
||||
/https:\/\/([^+_]+)\/@([_a-zA-Z0-9\&=+\%]+)/
|
||||
);
|
||||
if (toot) {
|
||||
if (toot[1]) {
|
||||
@@ -44,7 +48,7 @@ $(document).on('click', 'a', e => {
|
||||
if (ats[2]) {
|
||||
//Quesdon判定
|
||||
if (!~ats[2].indexOf("@")) {
|
||||
udgEx(ats[2] + "@" + ats[1], "main");
|
||||
udgEx(url, "main");
|
||||
return false
|
||||
} else {
|
||||
postMessage(["openUrl", url], "*")
|
||||
@@ -77,11 +81,8 @@ $(document).on('click', 'a', e => {
|
||||
|
||||
//コピー
|
||||
function execCopy(string) {
|
||||
var temp = $("#copy");
|
||||
temp.val(string);
|
||||
temp.select();
|
||||
var result = document.execCommand('copy');
|
||||
return result;
|
||||
postMessage(["copy", string], "*")
|
||||
return true;
|
||||
}
|
||||
function progshow(e) {
|
||||
if (e.lengthComputable) {
|
||||
@@ -104,12 +105,16 @@ function opendev() {
|
||||
});
|
||||
*/
|
||||
}
|
||||
var soundFile
|
||||
function playSound() {
|
||||
window.AudioContext = window.AudioContext || window.webkitAudioContext;
|
||||
if(soundFile){
|
||||
soundFile.stop()
|
||||
}
|
||||
context = new AudioContext();
|
||||
context.createBufferSource().start(0);
|
||||
context.decodeAudioData(request.response, function (buf) {
|
||||
console.log("Playing:" + source)
|
||||
//console.log("Playing:" , source)
|
||||
source.buffer = buf;
|
||||
source.loop = false;
|
||||
});
|
||||
@@ -117,53 +122,72 @@ function playSound() {
|
||||
volumeControl = context.createGain();
|
||||
source.connect(volumeControl);
|
||||
volumeControl.connect(context.destination);
|
||||
volumeControl.gain.value = 0.8
|
||||
var cvol = localStorage.getItem("customVol")
|
||||
if (cvol) {
|
||||
vol = cvol
|
||||
}else{
|
||||
vol = 0.8
|
||||
}
|
||||
volumeControl.gain.value = vol
|
||||
source.start(0);
|
||||
soundFile = source;
|
||||
|
||||
function newFunction() {
|
||||
var source;
|
||||
return source;
|
||||
}
|
||||
}
|
||||
function nano() {
|
||||
postMessage(["nano", null], "*")
|
||||
}
|
||||
onmessage = function (e) {
|
||||
if (e.data[0] == "details") {
|
||||
details(e.data[1][0], e.data[1][1])
|
||||
} else if (e.data[0] == "udg") {
|
||||
udg(e.data[1][0], e.data[1][1])
|
||||
} else if (e.data[0] == "media") {
|
||||
media(e.data[1][0], e.data[1][1], e.data[1][2])
|
||||
} else if (e.data[0] == "post") {
|
||||
post("pass")
|
||||
} else if (e.data[0] == "toastSaved") {
|
||||
M.toast({ html: lang.lang_img_DLDone + e.data[1][0] + '<button class="btn-flat toast-action" onclick="openFinder(\'' + e.data[1][1] + '\')">Show</button>', displayLength: 5000 })
|
||||
} else if (e.data[0] == "toastMute") {
|
||||
M.toast({ html: escapeHTML(e.data[1]) + lang.lang_parse_mute, displayLength: 2000 })
|
||||
} else if (e.data[0] == "toastEmp") {
|
||||
M.toast({ html: escapeHTML(e.data[1]) + lang.lang_status_emphas, displayLength: 2000 })
|
||||
} else if (e.data[0] == "toastUnEmp") {
|
||||
M.toast({ html: escapeHTML(e.data[1]) + lang.lang_status_unemphas, displayLength: 2000 })
|
||||
} else if (e.data[0] == "parseColumn") {
|
||||
parseColumn()
|
||||
} else if (e.data[0] == "sortload") {
|
||||
sortload()
|
||||
} else if (e.data[0] == "exportSettingsCore") {
|
||||
exportSettingsCore()
|
||||
} else if (e.data[0] == "fontList") {
|
||||
fontList(e.data[1])
|
||||
} else if (e.data[0] == "customSoundSave") {
|
||||
customSoundSave(e.data[1][0], e.data[1][1])
|
||||
} else if (e.data[0] == "ctLoadCore") {
|
||||
ctLoadCore(e.data[1])
|
||||
} else if (e.data[0] == "ctLoad") {
|
||||
ctLoad()
|
||||
} else if (e.data[0] == "customConnect") {
|
||||
customConnect(e.data[1])
|
||||
} else if (e.data[0] == "clearCustomImport") {
|
||||
clearCustomImport()
|
||||
} else if (e.data[0] == "npCore") {
|
||||
npCore(e.data[1]);
|
||||
} else if (e.data[0] == "renderMem") {
|
||||
renderMem(e.data[1][0], e.data[1][1], e.data[1][2])
|
||||
} else if (e.data[0] == "updateProg") {
|
||||
updateProg(e.data[1]);
|
||||
} else if (e.data[0] == "updateMess") {
|
||||
updateMess(e.data[1]);
|
||||
} else if (e.data[0] == "renderAbout") {
|
||||
if (e.data[0] == "details") {
|
||||
details(e.data[1][0], e.data[1][1])
|
||||
} else if (e.data[0] == "udg") {
|
||||
udg(e.data[1][0], e.data[1][1])
|
||||
} else if (e.data[0] == "media") {
|
||||
media(e.data[1][0], e.data[1][1], e.data[1][2])
|
||||
} else if (e.data[0] == "post") {
|
||||
post("pass")
|
||||
} else if (e.data[0] == "toastSaved") {
|
||||
M.toast({ html: lang.lang_img_DLDone + e.data[1][0] + '<button class="btn-flat toast-action" onclick="openFinder(\'' + e.data[1][1] + '\')">Show</button>', displayLength: 5000 })
|
||||
} else if (e.data[0] == "parseColumn") {
|
||||
parseColumn(e.data[1])
|
||||
} else if (e.data[0] == "exportSettingsCore") {
|
||||
var exp = exportSettingsCore()
|
||||
postMessage(["exportSettingsCoreComplete", [e.data[1], exp]], "*")
|
||||
} else if (e.data[0] == "importSettingsCore") {
|
||||
importSettingsCore(e.data[1])
|
||||
}else if (e.data[0] == "fontList") {
|
||||
fontList(e.data[1])
|
||||
} else if (e.data[0] == "customSoundSave") {
|
||||
customSoundSave(e.data[1][0], e.data[1][1])
|
||||
} else if (e.data[0] == "ctLoadCore") {
|
||||
ctLoadCore(e.data[1])
|
||||
} else if (e.data[0] == "ctLoad") {
|
||||
ctLoad()
|
||||
} else if (e.data[0] == "customConnect") {
|
||||
customConnect(e.data[1])
|
||||
} else if (e.data[0] == "clearCustomImport") {
|
||||
clearCustomImport()
|
||||
} else if (e.data[0] == "npCore") {
|
||||
npCore(e.data[1]);
|
||||
} else if (e.data[0] == "renderMem") {
|
||||
renderMem(e.data[1][0], e.data[1][1], e.data[1][2])
|
||||
} else if (e.data[0] == "updateProg") {
|
||||
updateProg(e.data[1]);
|
||||
} else if (e.data[0] == "updateMess") {
|
||||
updateMess(e.data[1]);
|
||||
} else if (e.data[0] == "renderAbout") {
|
||||
renderAbout(e.data[1]);
|
||||
}
|
||||
} else if (e.data[0] == "asRead") {
|
||||
asRead()
|
||||
} else if (e.data[0] == "asReadEnd") {
|
||||
asReadEnd()
|
||||
} else if (e.data[0] == "alert") {
|
||||
Swal.fire({
|
||||
type: 'info',
|
||||
title: e.data[1]
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
document.title="TheDesk"
|
||||
$.strip_tags = function (str, allowed) {
|
||||
if (!str) {
|
||||
return "";
|
||||
@@ -170,4 +171,29 @@ $.mb_substr = function (str, begin, end) {
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
//ソートするやつ
|
||||
function object_array_sort(data, key, order, fn) {
|
||||
var num_a = -1;
|
||||
var num_b = 1;
|
||||
if (order === 'asc') {
|
||||
num_a = 1;
|
||||
num_b = -1;
|
||||
}
|
||||
data = data.sort(function (a, b) {
|
||||
var x = a[key];
|
||||
var y = b[key];
|
||||
if (x > y) return num_a;
|
||||
if (x < y) return num_b;
|
||||
return 0;
|
||||
});
|
||||
var arrObj = {};
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
arrObj[data[i]['family']] = data[i];
|
||||
}
|
||||
data = [];
|
||||
for (var key in arrObj) {
|
||||
data.push(arrObj[key]);
|
||||
}
|
||||
fn(data);
|
||||
}
|
||||
localStorage.removeItem("errors");
|
||||
@@ -1,7 +1,11 @@
|
||||
|
||||
//TL取得
|
||||
var websocket;
|
||||
function tl(data) {
|
||||
var tlid = 0;
|
||||
if(websocket){
|
||||
websocket.close()
|
||||
}
|
||||
var acct_id = $("#post-acct-sel").val();
|
||||
var type = $("#type-sel").val();
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
@@ -28,9 +32,9 @@ function tl(data) {
|
||||
var templete = parse([json[0]], '', acct_id, tlid);
|
||||
$("#timeline_nano").html(templete);
|
||||
jQuery("time.timeago").timeago();
|
||||
$("#menu").addClass("hide");
|
||||
});
|
||||
//Streaming接続
|
||||
var websocket = [];
|
||||
var tlid = 0;
|
||||
if (type == "home") {
|
||||
var start = "wss://" + domain +
|
||||
@@ -45,29 +49,26 @@ function tl(data) {
|
||||
var start = "wss://" + domain +
|
||||
"/api/v1/streaming/?stream=hashtag&tag=" + data + "&access_token=" + at;
|
||||
}
|
||||
var wsid = websocket.length;
|
||||
websocket[wsid] = new WebSocket(start);
|
||||
websocket[wsid].onopen = function (mess) {
|
||||
websocket = new WebSocket(start);
|
||||
websocket.onopen = function (mess) {
|
||||
$("#notice_icon_" + tlid).removeClass("red-text");
|
||||
}
|
||||
websocket[wsid].onmessage = function (mess) {
|
||||
websocket.onmessage = function (mess) {
|
||||
var typeA = JSON.parse(mess.data).event;
|
||||
if (typeA == "delete") {
|
||||
var obj = JSON.parse(mess.data).payload;
|
||||
$("[toot-id=" + JSON.parse(mess.data).payload + "]").hide();
|
||||
$("[toot-id=" + JSON.parse(mess.data).payload + "]").remove();
|
||||
} else if (typeA == "update") {
|
||||
if (typeA == "update") {
|
||||
var obj = JSON.parse(JSON.parse(mess.data).payload);
|
||||
var templete = parse([obj], '', acct_id, tlid);
|
||||
jQuery("time.timeago").timeago();
|
||||
$("#timeline_nano").html(templete);
|
||||
}
|
||||
websocket[wsid].onclose = function (mess) {
|
||||
console.error("Close Streaming API:" + type);
|
||||
}
|
||||
|
||||
}
|
||||
websocket[wsid].onerror = function (error) {
|
||||
websocket.onerror = function (error) {
|
||||
console.error('WebSocket Error ' + error);
|
||||
};
|
||||
websocket.onclose = function (mess) {
|
||||
console.error("Close Streaming API:" + type);
|
||||
}
|
||||
}
|
||||
//TLのタイトル
|
||||
function cap(type, data) {
|
||||
@@ -134,3 +135,122 @@ $(function ($) {
|
||||
}
|
||||
});
|
||||
});
|
||||
function set() {
|
||||
$("#menu").toggleClass("hide");
|
||||
if($("#menu").hasClass("hide")){
|
||||
$("#setting").text("Setting")
|
||||
}else{
|
||||
$("#setting").text("Close")
|
||||
}
|
||||
}
|
||||
|
||||
var multi = localStorage.getItem("multi");
|
||||
if (!multi) {
|
||||
var obj = [
|
||||
{
|
||||
at: localStorage.getItem(localStorage.getItem("domain_" + acct_id) + "_at"),
|
||||
name: localStorage.getItem("name_" + acct_id),
|
||||
domain: localStorage.getItem("domain_" + acct_id),
|
||||
user: localStorage.getItem("user_" + acct_id),
|
||||
prof: localStorage.getItem("prof_" + acct_id)
|
||||
}
|
||||
];
|
||||
var json = JSON.stringify(obj);
|
||||
localStorage.setItem("multi", json);
|
||||
} else {
|
||||
var obj = JSON.parse(multi);
|
||||
}
|
||||
var templete;
|
||||
var last = localStorage.getItem("last-use");
|
||||
var sel;
|
||||
Object.keys(obj).forEach(function(key) {
|
||||
var acct = obj[key];
|
||||
var list = key * 1 + 1;
|
||||
if (key == last) {
|
||||
sel = "selected";
|
||||
} else {
|
||||
sel = "";
|
||||
}
|
||||
templete = '<option value="' + key + '" ' + sel + ">" + acct.user + "@" + acct.domain + "</option>";
|
||||
$("#post-acct-sel").append(templete);
|
||||
});
|
||||
function mov() {
|
||||
return false;
|
||||
}
|
||||
function resetmv() {
|
||||
return false;
|
||||
}
|
||||
function post() {
|
||||
var acct_id = $("#post-acct-sel").val();
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/statuses";
|
||||
var str = $("#textarea").val();
|
||||
var toot = {
|
||||
status: str
|
||||
};
|
||||
var vis = loadVis(acct_id);
|
||||
toot.visibility = vis;
|
||||
var httpreq = new XMLHttpRequest();
|
||||
httpreq.open("POST", start, true);
|
||||
httpreq.setRequestHeader("Content-Type", "application/json");
|
||||
httpreq.setRequestHeader("Authorization", "Bearer " + at);
|
||||
httpreq.responseType = "json";
|
||||
httpreq.send(JSON.stringify(toot));
|
||||
httpreq.onreadystatechange = function() {
|
||||
if (httpreq.readyState === 4) {
|
||||
$("#textarea").val("");
|
||||
}
|
||||
};
|
||||
}
|
||||
function loadVis(acct_id) {
|
||||
var vist = localStorage.getItem("vis");
|
||||
if (!vist) {
|
||||
return "public";
|
||||
} else {
|
||||
if (vist == "memory") {
|
||||
var memory = localStorage.getItem("vis-memory-" + acct_id);
|
||||
if (!memory) {
|
||||
memory = "public";
|
||||
}
|
||||
return memory;
|
||||
} else if (vist == "server" || vist == "useapi") {
|
||||
var multi = localStorage.getItem("multi");
|
||||
var obj = JSON.parse(multi);
|
||||
var memory = obj[acct_id]["vis"];
|
||||
if (!memory) {
|
||||
memory = "public";
|
||||
}
|
||||
return memory;
|
||||
} else {
|
||||
return vist;
|
||||
}
|
||||
}
|
||||
}
|
||||
function loader(){
|
||||
var acct_id = $("#post-acct-sel").val()
|
||||
console.log(loadVis(acct_id))
|
||||
$("#vis-sel").val(loadVis(acct_id));
|
||||
}
|
||||
loader()
|
||||
$("textarea").height(15); //init
|
||||
$("textarea").css("lineHeight", "1rem"); //init
|
||||
|
||||
$("textarea").on("input", function(evt) {
|
||||
if (evt.target.scrollHeight > evt.target.offsetHeight) {
|
||||
$(evt.target).height(evt.target.scrollHeight);
|
||||
} else {
|
||||
var lineHeight = Number(
|
||||
$(evt.target)
|
||||
.css("lineHeight")
|
||||
.split("px")[0]
|
||||
);
|
||||
while (true) {
|
||||
$(evt.target).height($(evt.target).height() - lineHeight);
|
||||
if (evt.target.scrollHeight > evt.target.offsetHeight) {
|
||||
$(evt.target).height(evt.target.scrollHeight);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -30,6 +30,8 @@ onmessage = function (e) {
|
||||
ipc.send('lang', e.data[1]);
|
||||
} else if (e.data[0] == "exportSettings") {
|
||||
ipc.send('exportSettings', e.data[1]);
|
||||
} else if (e.data[0] == "exportSettingsCoreComplete") {
|
||||
ipc.send('export', e.data[1]);
|
||||
} else if (e.data[0] == "importSettings") {
|
||||
ipc.send('importSettings', e.data[1]);
|
||||
} else if (e.data[0] == "customSound") {
|
||||
@@ -45,16 +47,20 @@ onmessage = function (e) {
|
||||
} else if (e.data[0] == "aboutData") {
|
||||
ipc.send('aboutData', "");
|
||||
} else if (e.data[0] == "itunes") {
|
||||
console.log("NowPlaying" + ipc.listenerCount('itunes-np'))
|
||||
if (ipc.listenerCount('itunes-np') > 1) {
|
||||
return false;
|
||||
} else {
|
||||
ipc.send("itunes", e.data[1])
|
||||
}
|
||||
console.log("NowPlaying")
|
||||
ipc.send("itunes", e.data[1])
|
||||
} else if (e.data[0] == "themeCSSRequest") {
|
||||
ipc.send('theme-css-request', e.data[1]);
|
||||
} else if (e.data[0] == "customCSSRequest") {
|
||||
ipc.send('custom-css-request', e.data[1]);
|
||||
} else if (e.data[0] == "downloadButton") {
|
||||
ipc.send('download-btn', e.data[1]);
|
||||
} else if (e.data[0] == "nano") {
|
||||
ipc.send('nano', null);
|
||||
} else if (e.data[0] == "asReadComp") {
|
||||
ipc.send('sendMarkersComplete', null);
|
||||
} else if (e.data[0] == "copy") {
|
||||
ipc.send('copy', e.data[1]);
|
||||
}
|
||||
}
|
||||
//version.js
|
||||
@@ -62,10 +68,7 @@ ipc.send("getPlatform", "")
|
||||
ipc.on('platform', function (event, args) {
|
||||
localStorage.setItem("platform", args[0])
|
||||
localStorage.setItem("bit", args[1])
|
||||
localStorage.setItem("about", JSON.stringify([args[2], args[3], args[4]]))
|
||||
})
|
||||
ipc.on('winstore', function (event, arg) {
|
||||
localStorage.setItem("winstore", arg)
|
||||
localStorage.setItem("about", JSON.stringify([args[2], args[3], args[4], args[5]]))
|
||||
})
|
||||
|
||||
ipc.on('reload', function (event, arg) {
|
||||
@@ -79,9 +82,7 @@ ipc.on('shownotf', function (event, args) {
|
||||
postMessage(["udg", [user, acct_id]], "*")
|
||||
}
|
||||
})
|
||||
function nano() {
|
||||
ipc.send('nano', "");
|
||||
}
|
||||
|
||||
//first.js
|
||||
ipc.on('custom-css-response', function (event, arg) {
|
||||
if (arg == "") { return false; }
|
||||
@@ -105,63 +106,6 @@ ipc.on('theme-css-response', function (event, arg) {
|
||||
ipc.on('bmp-img-comp', function (event, b64) {
|
||||
postMessage(["media", [b64[0], "image/png", b64[1]]], "*")
|
||||
});
|
||||
//post.js
|
||||
ipc.on('dialogCWRender', function (event, arg) {
|
||||
if (arg === 1) {
|
||||
$("#cw-text").show();
|
||||
$("#cw").addClass("yellow-text");
|
||||
$("#cw").addClass("cw-avail");
|
||||
$("#cw-text").val(plus);
|
||||
postMessage(["post", ""], "*")
|
||||
} else if (arg === 2) {
|
||||
postMessage(["post", ""], "*")
|
||||
}
|
||||
});
|
||||
//parse.js
|
||||
ipc.on('dialogClientRender', function (event, arg) {
|
||||
if (arg === 1) {
|
||||
var cli = localStorage.getItem("client_emp");
|
||||
var obj = JSON.parse(cli);
|
||||
if (!obj) {
|
||||
var obj = [];
|
||||
obj.push(name);
|
||||
postMessage(["toastEmp", name], "*")
|
||||
} else {
|
||||
var can;
|
||||
Object.keys(obj).forEach(function (key) {
|
||||
var cliT = obj[key];
|
||||
if (cliT != name && !can) {
|
||||
can = false;
|
||||
} else {
|
||||
can = true;
|
||||
obj.splice(key, 1);
|
||||
postMessage(["toastUnEmp", name], "*")
|
||||
}
|
||||
});
|
||||
if (!can) {
|
||||
obj.push(name);
|
||||
postMessage(["toastEmp", name], "*")
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
var json = JSON.stringify(obj);
|
||||
localStorage.setItem("client_emp", json);
|
||||
} else if (arg === 2) {
|
||||
var cli = localStorage.getItem("client_mute");
|
||||
var obj = JSON.parse(cli);
|
||||
if (!obj) {
|
||||
obj = [];
|
||||
}
|
||||
obj.push(name);
|
||||
var json = JSON.stringify(obj);
|
||||
localStorage.setItem("client_mute", json);
|
||||
postMessage(["toastMute", name], "*")
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
parseColumn();
|
||||
});
|
||||
//ui,img.js
|
||||
ipc.on('general-dl-prog', function (event, arg) {
|
||||
console.log("Progress: " + arg);
|
||||
@@ -171,33 +115,15 @@ ipc.on('general-dl-message', function (event, arg) {
|
||||
console.log("saved")
|
||||
postMessage(["toastSaved", [arg, argC]], "*")
|
||||
})
|
||||
//layout.js
|
||||
ipc.on('column-del-reply', function (event, args) {
|
||||
if (args[0] === 1) {
|
||||
var multi = localStorage.getItem("column");
|
||||
var obj = JSON.parse(multi);
|
||||
localStorage.removeItem("card_" + args[1]);
|
||||
obj.splice(args[1], 1);
|
||||
for (var i = 0; i < obj.length; i++) {
|
||||
localStorage.setItem("card_" + i, "true");
|
||||
localStorage.removeItem("catch_" + i);
|
||||
}
|
||||
var json = JSON.stringify(obj);
|
||||
localStorage.setItem("column", json);
|
||||
postMessage(["parseColumn", ""], "*")
|
||||
postMessage(["sortload", ""], "*")
|
||||
}
|
||||
})
|
||||
//setting.js
|
||||
ipc.on('langres', function (event, arg) {
|
||||
location.href = "../" + lang + "/setting.html"
|
||||
location.href = "../" + arg + "/setting.html"
|
||||
});
|
||||
ipc.on('exportSettingsFile', function (event, savedFiles) {
|
||||
var exp = exportSettingsCore()
|
||||
ipc.send('export', [savedFiles, JSON.stringify(exp)]);
|
||||
alert("Done.")
|
||||
//cards
|
||||
//lang
|
||||
ipc.on('exportSettingsFile', function (event, arg) {
|
||||
postMessage(["exportSettingsCore", arg], "*")
|
||||
});
|
||||
ipc.on('exportAllComplete', function (event, arg) {
|
||||
postMessage(["alert", "Complete"], "*")
|
||||
});
|
||||
ipc.on('config', function (event, arg) {
|
||||
postMessage(["importSettingsCore", arg], "*")
|
||||
@@ -225,7 +151,7 @@ ipc.on('theme-json-create-complete', function (event, args) {
|
||||
postMessage(["ctLoad", ""], "*")
|
||||
});
|
||||
//spotify.js
|
||||
ipc.once('itunes-np', function (event, arg) {
|
||||
ipc.on('itunes-np', function (event, arg) {
|
||||
postMessage(["npCore", arg], "*")
|
||||
})
|
||||
//tips.js
|
||||
@@ -242,6 +168,12 @@ ipc.on('prog', function (event, arg) {
|
||||
ipc.on('mess', function (event, arg) {
|
||||
postMessage(["updateMess", arg], "*")
|
||||
})
|
||||
ipc.on('asRead', function (event, arg) {
|
||||
postMessage(["asRead", ""], "*")
|
||||
})
|
||||
ipc.on('asReadEnd', function (event, arg) {
|
||||
postMessage(["asReadEnd", ""], "*")
|
||||
})
|
||||
var webviewDom = document.getElementById('webview');
|
||||
if (webviewDom) {
|
||||
webviewDom.addEventListener('new-window', function (e) {
|
||||
|
||||
533
app/js/platform/punycode.js
Normal file
@@ -0,0 +1,533 @@
|
||||
/*! https://mths.be/punycode v1.4.1 by @mathias */
|
||||
;(function(root) {
|
||||
|
||||
/** Detect free variables */
|
||||
var freeExports = typeof exports == 'object' && exports &&
|
||||
!exports.nodeType && exports;
|
||||
var freeModule = typeof module == 'object' && module &&
|
||||
!module.nodeType && module;
|
||||
var freeGlobal = typeof global == 'object' && global;
|
||||
if (
|
||||
freeGlobal.global === freeGlobal ||
|
||||
freeGlobal.window === freeGlobal ||
|
||||
freeGlobal.self === freeGlobal
|
||||
) {
|
||||
root = freeGlobal;
|
||||
}
|
||||
|
||||
/**
|
||||
* The `punycode` object.
|
||||
* @name punycode
|
||||
* @type Object
|
||||
*/
|
||||
var punycode,
|
||||
|
||||
/** Highest positive signed 32-bit float value */
|
||||
maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1
|
||||
|
||||
/** Bootstring parameters */
|
||||
base = 36,
|
||||
tMin = 1,
|
||||
tMax = 26,
|
||||
skew = 38,
|
||||
damp = 700,
|
||||
initialBias = 72,
|
||||
initialN = 128, // 0x80
|
||||
delimiter = '-', // '\x2D'
|
||||
|
||||
/** Regular expressions */
|
||||
regexPunycode = /^xn--/,
|
||||
regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars
|
||||
regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators
|
||||
|
||||
/** Error messages */
|
||||
errors = {
|
||||
'overflow': 'Overflow: input needs wider integers to process',
|
||||
'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
|
||||
'invalid-input': 'Invalid input'
|
||||
},
|
||||
|
||||
/** Convenience shortcuts */
|
||||
baseMinusTMin = base - tMin,
|
||||
floor = Math.floor,
|
||||
stringFromCharCode = String.fromCharCode,
|
||||
|
||||
/** Temporary variable */
|
||||
key;
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* A generic error utility function.
|
||||
* @private
|
||||
* @param {String} type The error type.
|
||||
* @returns {Error} Throws a `RangeError` with the applicable error message.
|
||||
*/
|
||||
function error(type) {
|
||||
throw new RangeError(errors[type]);
|
||||
}
|
||||
|
||||
/**
|
||||
* A generic `Array#map` utility function.
|
||||
* @private
|
||||
* @param {Array} array The array to iterate over.
|
||||
* @param {Function} callback The function that gets called for every array
|
||||
* item.
|
||||
* @returns {Array} A new array of values returned by the callback function.
|
||||
*/
|
||||
function map(array, fn) {
|
||||
var length = array.length;
|
||||
var result = [];
|
||||
while (length--) {
|
||||
result[length] = fn(array[length]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* A simple `Array#map`-like wrapper to work with domain name strings or email
|
||||
* addresses.
|
||||
* @private
|
||||
* @param {String} domain The domain name or email address.
|
||||
* @param {Function} callback The function that gets called for every
|
||||
* character.
|
||||
* @returns {Array} A new string of characters returned by the callback
|
||||
* function.
|
||||
*/
|
||||
function mapDomain(string, fn) {
|
||||
var parts = string.split('@');
|
||||
var result = '';
|
||||
if (parts.length > 1) {
|
||||
// In email addresses, only the domain name should be punycoded. Leave
|
||||
// the local part (i.e. everything up to `@`) intact.
|
||||
result = parts[0] + '@';
|
||||
string = parts[1];
|
||||
}
|
||||
// Avoid `split(regex)` for IE8 compatibility. See #17.
|
||||
string = string.replace(regexSeparators, '\x2E');
|
||||
var labels = string.split('.');
|
||||
var encoded = map(labels, fn).join('.');
|
||||
return result + encoded;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an array containing the numeric code points of each Unicode
|
||||
* character in the string. While JavaScript uses UCS-2 internally,
|
||||
* this function will convert a pair of surrogate halves (each of which
|
||||
* UCS-2 exposes as separate characters) into a single code point,
|
||||
* matching UTF-16.
|
||||
* @see `punycode.ucs2.encode`
|
||||
* @see <https://mathiasbynens.be/notes/javascript-encoding>
|
||||
* @memberOf punycode.ucs2
|
||||
* @name decode
|
||||
* @param {String} string The Unicode input string (UCS-2).
|
||||
* @returns {Array} The new array of code points.
|
||||
*/
|
||||
function ucs2decode(string) {
|
||||
var output = [],
|
||||
counter = 0,
|
||||
length = string.length,
|
||||
value,
|
||||
extra;
|
||||
while (counter < length) {
|
||||
value = string.charCodeAt(counter++);
|
||||
if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
|
||||
// high surrogate, and there is a next character
|
||||
extra = string.charCodeAt(counter++);
|
||||
if ((extra & 0xFC00) == 0xDC00) { // low surrogate
|
||||
output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
|
||||
} else {
|
||||
// unmatched surrogate; only append this code unit, in case the next
|
||||
// code unit is the high surrogate of a surrogate pair
|
||||
output.push(value);
|
||||
counter--;
|
||||
}
|
||||
} else {
|
||||
output.push(value);
|
||||
}
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a string based on an array of numeric code points.
|
||||
* @see `punycode.ucs2.decode`
|
||||
* @memberOf punycode.ucs2
|
||||
* @name encode
|
||||
* @param {Array} codePoints The array of numeric code points.
|
||||
* @returns {String} The new Unicode string (UCS-2).
|
||||
*/
|
||||
function ucs2encode(array) {
|
||||
return map(array, function(value) {
|
||||
var output = '';
|
||||
if (value > 0xFFFF) {
|
||||
value -= 0x10000;
|
||||
output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
|
||||
value = 0xDC00 | value & 0x3FF;
|
||||
}
|
||||
output += stringFromCharCode(value);
|
||||
return output;
|
||||
}).join('');
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a basic code point into a digit/integer.
|
||||
* @see `digitToBasic()`
|
||||
* @private
|
||||
* @param {Number} codePoint The basic numeric code point value.
|
||||
* @returns {Number} The numeric value of a basic code point (for use in
|
||||
* representing integers) in the range `0` to `base - 1`, or `base` if
|
||||
* the code point does not represent a value.
|
||||
*/
|
||||
function basicToDigit(codePoint) {
|
||||
if (codePoint - 48 < 10) {
|
||||
return codePoint - 22;
|
||||
}
|
||||
if (codePoint - 65 < 26) {
|
||||
return codePoint - 65;
|
||||
}
|
||||
if (codePoint - 97 < 26) {
|
||||
return codePoint - 97;
|
||||
}
|
||||
return base;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a digit/integer into a basic code point.
|
||||
* @see `basicToDigit()`
|
||||
* @private
|
||||
* @param {Number} digit The numeric value of a basic code point.
|
||||
* @returns {Number} The basic code point whose value (when used for
|
||||
* representing integers) is `digit`, which needs to be in the range
|
||||
* `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
|
||||
* used; else, the lowercase form is used. The behavior is undefined
|
||||
* if `flag` is non-zero and `digit` has no uppercase form.
|
||||
*/
|
||||
function digitToBasic(digit, flag) {
|
||||
// 0..25 map to ASCII a..z or A..Z
|
||||
// 26..35 map to ASCII 0..9
|
||||
return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Bias adaptation function as per section 3.4 of RFC 3492.
|
||||
* https://tools.ietf.org/html/rfc3492#section-3.4
|
||||
* @private
|
||||
*/
|
||||
function adapt(delta, numPoints, firstTime) {
|
||||
var k = 0;
|
||||
delta = firstTime ? floor(delta / damp) : delta >> 1;
|
||||
delta += floor(delta / numPoints);
|
||||
for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {
|
||||
delta = floor(delta / baseMinusTMin);
|
||||
}
|
||||
return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a Punycode string of ASCII-only symbols to a string of Unicode
|
||||
* symbols.
|
||||
* @memberOf punycode
|
||||
* @param {String} input The Punycode string of ASCII-only symbols.
|
||||
* @returns {String} The resulting string of Unicode symbols.
|
||||
*/
|
||||
function decode(input) {
|
||||
// Don't use UCS-2
|
||||
var output = [],
|
||||
inputLength = input.length,
|
||||
out,
|
||||
i = 0,
|
||||
n = initialN,
|
||||
bias = initialBias,
|
||||
basic,
|
||||
j,
|
||||
index,
|
||||
oldi,
|
||||
w,
|
||||
k,
|
||||
digit,
|
||||
t,
|
||||
/** Cached calculation results */
|
||||
baseMinusT;
|
||||
|
||||
// Handle the basic code points: let `basic` be the number of input code
|
||||
// points before the last delimiter, or `0` if there is none, then copy
|
||||
// the first basic code points to the output.
|
||||
|
||||
basic = input.lastIndexOf(delimiter);
|
||||
if (basic < 0) {
|
||||
basic = 0;
|
||||
}
|
||||
|
||||
for (j = 0; j < basic; ++j) {
|
||||
// if it's not a basic code point
|
||||
if (input.charCodeAt(j) >= 0x80) {
|
||||
error('not-basic');
|
||||
}
|
||||
output.push(input.charCodeAt(j));
|
||||
}
|
||||
|
||||
// Main decoding loop: start just after the last delimiter if any basic code
|
||||
// points were copied; start at the beginning otherwise.
|
||||
|
||||
for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {
|
||||
|
||||
// `index` is the index of the next character to be consumed.
|
||||
// Decode a generalized variable-length integer into `delta`,
|
||||
// which gets added to `i`. The overflow checking is easier
|
||||
// if we increase `i` as we go, then subtract off its starting
|
||||
// value at the end to obtain `delta`.
|
||||
for (oldi = i, w = 1, k = base; /* no condition */; k += base) {
|
||||
|
||||
if (index >= inputLength) {
|
||||
error('invalid-input');
|
||||
}
|
||||
|
||||
digit = basicToDigit(input.charCodeAt(index++));
|
||||
|
||||
if (digit >= base || digit > floor((maxInt - i) / w)) {
|
||||
error('overflow');
|
||||
}
|
||||
|
||||
i += digit * w;
|
||||
t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
|
||||
|
||||
if (digit < t) {
|
||||
break;
|
||||
}
|
||||
|
||||
baseMinusT = base - t;
|
||||
if (w > floor(maxInt / baseMinusT)) {
|
||||
error('overflow');
|
||||
}
|
||||
|
||||
w *= baseMinusT;
|
||||
|
||||
}
|
||||
|
||||
out = output.length + 1;
|
||||
bias = adapt(i - oldi, out, oldi == 0);
|
||||
|
||||
// `i` was supposed to wrap around from `out` to `0`,
|
||||
// incrementing `n` each time, so we'll fix that now:
|
||||
if (floor(i / out) > maxInt - n) {
|
||||
error('overflow');
|
||||
}
|
||||
|
||||
n += floor(i / out);
|
||||
i %= out;
|
||||
|
||||
// Insert `n` at position `i` of the output
|
||||
output.splice(i++, 0, n);
|
||||
|
||||
}
|
||||
|
||||
return ucs2encode(output);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a string of Unicode symbols (e.g. a domain name label) to a
|
||||
* Punycode string of ASCII-only symbols.
|
||||
* @memberOf punycode
|
||||
* @param {String} input The string of Unicode symbols.
|
||||
* @returns {String} The resulting Punycode string of ASCII-only symbols.
|
||||
*/
|
||||
function encode(input) {
|
||||
var n,
|
||||
delta,
|
||||
handledCPCount,
|
||||
basicLength,
|
||||
bias,
|
||||
j,
|
||||
m,
|
||||
q,
|
||||
k,
|
||||
t,
|
||||
currentValue,
|
||||
output = [],
|
||||
/** `inputLength` will hold the number of code points in `input`. */
|
||||
inputLength,
|
||||
/** Cached calculation results */
|
||||
handledCPCountPlusOne,
|
||||
baseMinusT,
|
||||
qMinusT;
|
||||
|
||||
// Convert the input in UCS-2 to Unicode
|
||||
input = ucs2decode(input);
|
||||
|
||||
// Cache the length
|
||||
inputLength = input.length;
|
||||
|
||||
// Initialize the state
|
||||
n = initialN;
|
||||
delta = 0;
|
||||
bias = initialBias;
|
||||
|
||||
// Handle the basic code points
|
||||
for (j = 0; j < inputLength; ++j) {
|
||||
currentValue = input[j];
|
||||
if (currentValue < 0x80) {
|
||||
output.push(stringFromCharCode(currentValue));
|
||||
}
|
||||
}
|
||||
|
||||
handledCPCount = basicLength = output.length;
|
||||
|
||||
// `handledCPCount` is the number of code points that have been handled;
|
||||
// `basicLength` is the number of basic code points.
|
||||
|
||||
// Finish the basic string - if it is not empty - with a delimiter
|
||||
if (basicLength) {
|
||||
output.push(delimiter);
|
||||
}
|
||||
|
||||
// Main encoding loop:
|
||||
while (handledCPCount < inputLength) {
|
||||
|
||||
// All non-basic code points < n have been handled already. Find the next
|
||||
// larger one:
|
||||
for (m = maxInt, j = 0; j < inputLength; ++j) {
|
||||
currentValue = input[j];
|
||||
if (currentValue >= n && currentValue < m) {
|
||||
m = currentValue;
|
||||
}
|
||||
}
|
||||
|
||||
// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
|
||||
// but guard against overflow
|
||||
handledCPCountPlusOne = handledCPCount + 1;
|
||||
if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
|
||||
error('overflow');
|
||||
}
|
||||
|
||||
delta += (m - n) * handledCPCountPlusOne;
|
||||
n = m;
|
||||
|
||||
for (j = 0; j < inputLength; ++j) {
|
||||
currentValue = input[j];
|
||||
|
||||
if (currentValue < n && ++delta > maxInt) {
|
||||
error('overflow');
|
||||
}
|
||||
|
||||
if (currentValue == n) {
|
||||
// Represent delta as a generalized variable-length integer
|
||||
for (q = delta, k = base; /* no condition */; k += base) {
|
||||
t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
|
||||
if (q < t) {
|
||||
break;
|
||||
}
|
||||
qMinusT = q - t;
|
||||
baseMinusT = base - t;
|
||||
output.push(
|
||||
stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
|
||||
);
|
||||
q = floor(qMinusT / baseMinusT);
|
||||
}
|
||||
|
||||
output.push(stringFromCharCode(digitToBasic(q, 0)));
|
||||
bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
|
||||
delta = 0;
|
||||
++handledCPCount;
|
||||
}
|
||||
}
|
||||
|
||||
++delta;
|
||||
++n;
|
||||
|
||||
}
|
||||
return output.join('');
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a Punycode string representing a domain name or an email address
|
||||
* to Unicode. Only the Punycoded parts of the input will be converted, i.e.
|
||||
* it doesn't matter if you call it on a string that has already been
|
||||
* converted to Unicode.
|
||||
* @memberOf punycode
|
||||
* @param {String} input The Punycoded domain name or email address to
|
||||
* convert to Unicode.
|
||||
* @returns {String} The Unicode representation of the given Punycode
|
||||
* string.
|
||||
*/
|
||||
function toUnicode(input) {
|
||||
return mapDomain(input, function(string) {
|
||||
return regexPunycode.test(string)
|
||||
? decode(string.slice(4).toLowerCase())
|
||||
: string;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a Unicode string representing a domain name or an email address to
|
||||
* Punycode. Only the non-ASCII parts of the domain name will be converted,
|
||||
* i.e. it doesn't matter if you call it with a domain that's already in
|
||||
* ASCII.
|
||||
* @memberOf punycode
|
||||
* @param {String} input The domain name or email address to convert, as a
|
||||
* Unicode string.
|
||||
* @returns {String} The Punycode representation of the given domain name or
|
||||
* email address.
|
||||
*/
|
||||
function toASCII(input) {
|
||||
return mapDomain(input, function(string) {
|
||||
return regexNonASCII.test(string)
|
||||
? 'xn--' + encode(string)
|
||||
: string;
|
||||
});
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/** Define the public API */
|
||||
punycode = {
|
||||
/**
|
||||
* A string representing the current Punycode.js version number.
|
||||
* @memberOf punycode
|
||||
* @type String
|
||||
*/
|
||||
'version': '1.4.1',
|
||||
/**
|
||||
* An object of methods to convert from JavaScript's internal character
|
||||
* representation (UCS-2) to Unicode code points, and back.
|
||||
* @see <https://mathiasbynens.be/notes/javascript-encoding>
|
||||
* @memberOf punycode
|
||||
* @type Object
|
||||
*/
|
||||
'ucs2': {
|
||||
'decode': ucs2decode,
|
||||
'encode': ucs2encode
|
||||
},
|
||||
'decode': decode,
|
||||
'encode': encode,
|
||||
'toASCII': toASCII,
|
||||
'toUnicode': toUnicode
|
||||
};
|
||||
|
||||
/** Expose `punycode` */
|
||||
// Some AMD build optimizers, like r.js, check for specific condition patterns
|
||||
// like the following:
|
||||
if (
|
||||
typeof define == 'function' &&
|
||||
typeof define.amd == 'object' &&
|
||||
define.amd
|
||||
) {
|
||||
define('punycode', function() {
|
||||
return punycode;
|
||||
});
|
||||
} else if (freeExports && freeModule) {
|
||||
if (module.exports == freeExports) {
|
||||
// in Node.js, io.js, or RingoJS v0.8.0+
|
||||
freeModule.exports = punycode;
|
||||
} else {
|
||||
// in Narwhal or RingoJS v0.7.0-
|
||||
for (key in punycode) {
|
||||
punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// in Rhino or a web browser
|
||||
root.punycode = punycode;
|
||||
}
|
||||
|
||||
}(this));
|
||||
@@ -10,13 +10,20 @@ function emojiToggle(reaction) {
|
||||
if (!selin) {
|
||||
selin = 0;
|
||||
}
|
||||
localStorage.setItem("cursor", selin);
|
||||
|
||||
if ($("#emoji").hasClass("hide")) {
|
||||
$("#emoji").removeClass("hide")
|
||||
$("#right-side").show()
|
||||
$("#right-side").css("width", "300px")
|
||||
$("#left-side").css("width", "calc(100% - 300px)")
|
||||
var width = localStorage.getItem("postbox-width");
|
||||
if (width) {
|
||||
width = width.replace("px", "") * 1 + 300
|
||||
} else {
|
||||
width = 600
|
||||
}
|
||||
$("#post-box").css("width", width + "px")
|
||||
$("#suggest").html("");
|
||||
if (!localStorage.getItem("emoji_" + acct_id)) {
|
||||
if (!localStorage.getItem("emojis_" + acct_id)) {
|
||||
var html =
|
||||
'<button class="btn waves-effect green" style="width:100%; padding:0; margin-top:0;" onclick="emojiGet(\'true\');">' + lang.lang_emoji_get + '</button>';
|
||||
$("#emoji-list").html(html);
|
||||
@@ -25,9 +32,18 @@ function emojiToggle(reaction) {
|
||||
}
|
||||
} else {
|
||||
$("#poll").addClass("hide")
|
||||
$("#right-side").hide()
|
||||
$("#right-side").css("width", "300px")
|
||||
$("#emoji").addClass("hide")
|
||||
$("#suggest").html("");
|
||||
$("#right-side").hide()
|
||||
$("#left-side").css("width", "100%")
|
||||
var width = localStorage.getItem("postbox-width");
|
||||
if (width) {
|
||||
width = width.replace("px", "") * 1
|
||||
} else {
|
||||
width = 300
|
||||
}
|
||||
$("#post-box").css("width", width + "px")
|
||||
}
|
||||
|
||||
|
||||
@@ -53,15 +69,56 @@ function emojiGet(parse, started) {
|
||||
}).then(function (json) {
|
||||
if (parse == "true") {
|
||||
$('#emoji-list').text('Parsing...');
|
||||
var md = {
|
||||
"categorized": {},
|
||||
"uncategorized": []
|
||||
};
|
||||
var if_categorized = false
|
||||
Object.keys(json).forEach(function (key) {
|
||||
var emoji = json[key];
|
||||
if (emoji.visible_in_picker) {
|
||||
var listed = true
|
||||
} else {
|
||||
var listed = false
|
||||
}
|
||||
if (emoji.category) {
|
||||
var cat = emoji.category
|
||||
if (!md["categorized"][cat]) {
|
||||
md["categorized"][cat] = []
|
||||
}
|
||||
md["categorized"][cat].push({
|
||||
"shortcode": emoji.shortcode,
|
||||
"url": emoji.url,
|
||||
"listed": listed
|
||||
})
|
||||
if_categorized = true
|
||||
} else {
|
||||
md["uncategorized"].push({
|
||||
"shortcode": emoji.shortcode,
|
||||
"url": emoji.url,
|
||||
"listed": listed
|
||||
})
|
||||
}
|
||||
});
|
||||
console.log(md)
|
||||
//絵文字をマストドン公式と同順にソート
|
||||
json.sort(function (a, b) {
|
||||
md["uncategorized"].sort(function (a, b) {
|
||||
if (a.shortcode < b.shortcode) return -1;
|
||||
if (a.shortcode > b.shortcode) return 1;
|
||||
return 0;
|
||||
});
|
||||
localStorage.setItem("emoji_" + acct_id, JSON.stringify(json));
|
||||
Object.keys(md["categorized"]).forEach(function (key) {
|
||||
md["categorized"][key].sort(function (a, b) {
|
||||
if (a.shortcode < b.shortcode) return -1;
|
||||
if (a.shortcode > b.shortcode) return 1;
|
||||
return 0;
|
||||
});
|
||||
});
|
||||
|
||||
md["if_categorized"] = if_categorized
|
||||
localStorage.setItem("emojis_" + acct_id, JSON.stringify(md));
|
||||
} else {
|
||||
localStorage.setItem("emoji_" + acct_id, JSON.stringify(json));
|
||||
localStorage.setItem("emojis_" + acct_id, JSON.stringify(md));
|
||||
}
|
||||
localStorage.setItem("emojiseek", 0);
|
||||
if (!started) {
|
||||
@@ -87,25 +144,27 @@ function emojiGet(parse, started) {
|
||||
localStorage.setItem("emojiReaction_" + acct_id, "disabled");
|
||||
}
|
||||
var emojis = json.emojis;
|
||||
var md = [];
|
||||
var md = {"uncategorized": []}
|
||||
Object.keys(emojis).forEach(function (key) {
|
||||
var emoji = emojis[key];
|
||||
md.push({
|
||||
md["uncategorized"].push({
|
||||
"shortcode": emoji.name,
|
||||
"url": emoji.url
|
||||
"url": emoji.url,
|
||||
"listed": true
|
||||
})
|
||||
});
|
||||
md["if_categorized"] = false
|
||||
if (parse == "true") {
|
||||
$('#emoji-list').text('Parsing...');
|
||||
//絵文字をマストドン公式と同順にソート
|
||||
md.sort(function (a, b) {
|
||||
md["uncategorized"].sort(function (a, b) {
|
||||
if (a.shortcode < b.shortcode) return -1;
|
||||
if (a.shortcode > b.shortcode) return 1;
|
||||
return 0;
|
||||
});
|
||||
localStorage.setItem("emoji_" + acct_id, JSON.stringify(md));
|
||||
localStorage.setItem("emojis_" + acct_id, JSON.stringify(md));
|
||||
} else {
|
||||
localStorage.setItem("emoji_" + acct_id, JSON.stringify(md));
|
||||
localStorage.setItem("emojis_" + acct_id, JSON.stringify(md));
|
||||
}
|
||||
localStorage.setItem("emojiseek", 0);
|
||||
if (!started) {
|
||||
@@ -137,7 +196,28 @@ function emojiList(target, reaction) {
|
||||
localStorage.getItem("emojiseek", 0)
|
||||
}
|
||||
var html = '';
|
||||
var obj = JSON.parse(localStorage.getItem("emoji_" + acct_id));
|
||||
var raw = JSON.parse(localStorage.getItem("emojis_" + acct_id));
|
||||
console.log(raw)
|
||||
if (raw.if_categorized) {
|
||||
var obj = [{
|
||||
"divider": true,
|
||||
"cat": lang.lang_emoji_uncat
|
||||
}]
|
||||
var cats = raw["uncategorized"]
|
||||
obj = obj.concat(cats);
|
||||
Object.keys(raw["categorized"]).forEach(function (key) {
|
||||
var cats = raw["categorized"][key];
|
||||
obj = obj.concat([{
|
||||
"divider": true,
|
||||
"cat": key
|
||||
}]);
|
||||
obj = obj.concat(cats);
|
||||
});
|
||||
} else {
|
||||
var obj = raw["uncategorized"]
|
||||
}
|
||||
console.log(obj)
|
||||
|
||||
var num = obj.length;
|
||||
if (num < start) {
|
||||
var start = 0;
|
||||
@@ -147,24 +227,36 @@ function emojiList(target, reaction) {
|
||||
$("#emoji-sum").text(page);
|
||||
var ct = Math.ceil(start / 126);
|
||||
if (ct === 0) {
|
||||
var ct = 1;
|
||||
if(num > 0){
|
||||
var ct = 1;
|
||||
}
|
||||
$("#emoji-before").addClass("disabled");
|
||||
} else {
|
||||
$("#emoji-before").removeClass("disabled");
|
||||
}
|
||||
$("#emoji-next").removeClass("disabled");
|
||||
if (page != 1) {
|
||||
$("#emoji-next").removeClass("disabled");
|
||||
} else {
|
||||
$("#emoji-next").addClass("disabled");
|
||||
}
|
||||
$("#emoji-count").text(ct);
|
||||
for (i = start; i < start + 126; i++) {
|
||||
var emoji = obj[i];
|
||||
if (emoji) {
|
||||
if (reaction) {
|
||||
html = html + '<a onclick="emojiReaction(\':' + emoji.shortcode +
|
||||
':\')" class="pointer"><img src="' + emoji.url + '" width="20"></a>';
|
||||
':\')" class="pointer"><img src="' + emoji.url + '" width="20" title="' + emoji.shortcode + '"></a>';
|
||||
} else {
|
||||
html = html + '<a onclick="emojiInsert(\':' + emoji.shortcode +
|
||||
':\')" class="pointer"><img src="' + emoji.url + '" width="20"></a>';
|
||||
}
|
||||
if(emoji.divider){
|
||||
html = html + '<p style="margin-bottom:0">'+ emoji.cat +'</p>'
|
||||
}else{
|
||||
if (emoji.listed) {
|
||||
html = html + '<a onclick="emojiInsert(\':' + emoji.shortcode +
|
||||
':\')" class="pointer"><img src="' + emoji.url + '" width="20" title="' + emoji.shortcode + '"></a>';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
$("#emoji-list").html(html);
|
||||
@@ -173,35 +265,31 @@ function emojiList(target, reaction) {
|
||||
//絵文字など様々なものをテキストボックスに挿入
|
||||
function emojiInsert(code, del) {
|
||||
var now = $("#textarea").val();
|
||||
var selin = localStorage.getItem("cursor");
|
||||
var selin = $("#textarea").prop('selectionStart');
|
||||
if (localStorage.getItem("emoji-zero-width") == "yes") {
|
||||
var brank = "";
|
||||
var blank = "";
|
||||
} else {
|
||||
var brank = " ";
|
||||
var blank = " ";
|
||||
}
|
||||
var now = $("#textarea").val();
|
||||
if (selin > 0) {
|
||||
var before = now.substr(0, selin);
|
||||
var after = now.substr(selin, now.length);
|
||||
newt = before + brank + code + brank + after;
|
||||
} else {
|
||||
newt = code + brank;
|
||||
var before = now.substr(0, selin);
|
||||
if (before.slice(-1) != " ") {
|
||||
before = before + blank
|
||||
}
|
||||
var after = now.substr(selin, now.length);
|
||||
if (after.slice(-1) != " ") {
|
||||
after = blank + after
|
||||
}
|
||||
newt = before + code + after;
|
||||
if (!del) {
|
||||
$("#textarea").val(newt);
|
||||
//emoji();
|
||||
} else {
|
||||
var regExp = new RegExp(del, "g");
|
||||
var regExp = new RegExp(del.replace(/[.*+?^=!:${}()|[\]\/\\]/g, "\\$&"), "g");
|
||||
var now = now.replace(regExp, "");
|
||||
$("#textarea").val(now + brank + code);
|
||||
$("#textarea").val(now + blank + code);
|
||||
}
|
||||
|
||||
$("#textarea").focus();
|
||||
var selin = $("#textarea").prop('selectionStart');
|
||||
if (!selin) {
|
||||
selin = 0;
|
||||
}
|
||||
localStorage.setItem("cursor", selin);
|
||||
}
|
||||
//改行挿入
|
||||
function brInsert(code) {
|
||||
|
||||
@@ -2,36 +2,35 @@
|
||||
var obj = $("body");
|
||||
var system;
|
||||
//ドラッグスタート
|
||||
obj.on('dragstart', function (e) {
|
||||
system = "locked"
|
||||
obj.on("dragstart", function(e) {
|
||||
system = "locked";
|
||||
});
|
||||
//何もなくファイルが通過
|
||||
obj.on('dragend', function (e) {
|
||||
obj.on("dragend", function(e) {
|
||||
system = "";
|
||||
});
|
||||
//ドラッグファイルが画面上に
|
||||
obj.on('dragenter', function (e) {
|
||||
obj.on("dragenter", function(e) {
|
||||
if (system != "locked") {
|
||||
$("#drag").css('display', 'flex');
|
||||
$("#drag").css("display", "flex");
|
||||
}
|
||||
|
||||
});
|
||||
$("body").on('dragover', function (e) {
|
||||
$("body").on("dragover", function(e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
});
|
||||
//ドロップした
|
||||
$("body").on('drop', function (e) {
|
||||
$("body").on("drop", function(e) {
|
||||
if (system != "locked") {
|
||||
$("#drag").css('display', 'none');
|
||||
$("#drag").css("display", "none");
|
||||
e.preventDefault();
|
||||
var files = e.originalEvent.dataTransfer.files;
|
||||
pimg(files);
|
||||
}
|
||||
});
|
||||
//何もなくファイルが通過
|
||||
$("#drag").on('dragleave', function (e) {
|
||||
$("#drag").css('display', 'none');
|
||||
$("#drag").on("dragleave", function(e) {
|
||||
$("#drag").css("display", "none");
|
||||
});
|
||||
|
||||
//複数アップ
|
||||
@@ -40,9 +39,8 @@ function pimg(files) {
|
||||
for (i = 0; i < files.length; i++) {
|
||||
var dot = files[i].path.match(/\.(.+)$/)[1];
|
||||
if (dot == "bmp" || dot == "BMP") {
|
||||
postMessage(["bmpImage", [files[i].path, i]], "*")
|
||||
postMessage(["bmpImage", [files[i].path, i]], "*");
|
||||
todo(lang.lang_progress);
|
||||
|
||||
} else {
|
||||
handleFileUpload(files[i], obj, i);
|
||||
}
|
||||
@@ -50,21 +48,21 @@ function pimg(files) {
|
||||
}
|
||||
//ドラッグ・アンド・ドロップを終了
|
||||
function closedrop() {
|
||||
$("#drag").css('display', 'none');
|
||||
$("#drag").css("display", "none");
|
||||
}
|
||||
//ファイル選択
|
||||
function fileselect() {
|
||||
postMessage(["sendSinmpleIpc", "file-select"], "*")
|
||||
postMessage(["sendSinmpleIpc", "file-select"], "*");
|
||||
}
|
||||
|
||||
//ファイル読み込み
|
||||
function handleFileUpload(files, obj, no) {
|
||||
var fr = new FileReader();
|
||||
fr.onload = function (evt) {
|
||||
fr.onload = function(evt) {
|
||||
var b64 = evt.target.result;
|
||||
$('#b64-box').val(b64);
|
||||
var ret = media(b64, files["type"], no)
|
||||
}
|
||||
$("#b64-box").val(b64);
|
||||
var ret = media(b64, files["type"], no);
|
||||
};
|
||||
fr.readAsDataURL(files);
|
||||
$("#mec").append(files["name"] + "/");
|
||||
}
|
||||
@@ -79,7 +77,7 @@ function media(b64, type, no) {
|
||||
r += c[Math.floor(Math.random() * cl)];
|
||||
}
|
||||
if ($("#media").val()) {
|
||||
$("#media").val($("#media").val() + ',' + "tmp_" + r);
|
||||
$("#media").val($("#media").val() + "," + "tmp_" + r);
|
||||
} else {
|
||||
$("#media").val("tmp_" + r);
|
||||
}
|
||||
@@ -89,14 +87,14 @@ function media(b64, type, no) {
|
||||
todo("Image Upload...");
|
||||
var media = toBlob(b64, type);
|
||||
var fd = new FormData();
|
||||
fd.append('file', media);
|
||||
fd.append("file", media);
|
||||
var acct_id = $("#post-acct-sel").val();
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var httpreq = new XMLHttpRequest();
|
||||
if (localStorage.getItem("mode_" + domain) == "misskey") {
|
||||
var start = "https://" + domain + "/api/drive/files/create";
|
||||
httpreq.open('POST', start, true);
|
||||
httpreq.open("POST", start, true);
|
||||
httpreq.upload.addEventListener("progress", progshow, false);
|
||||
httpreq.responseType = "json";
|
||||
if ($("#nsfw").hasClass("nsfw-avail")) {
|
||||
@@ -104,28 +102,38 @@ function media(b64, type, no) {
|
||||
} else {
|
||||
var nsfw = false;
|
||||
}
|
||||
var previewer = "url"
|
||||
fd.append('i', at);
|
||||
var previewer = "url";
|
||||
fd.append("i", at);
|
||||
//fd.append('isSensitive', nsfw);
|
||||
httpreq.send(fd);
|
||||
} else {
|
||||
var previewer = "preview_url"
|
||||
var previewer = "preview_url";
|
||||
var start = "https://" + domain + "/api/v1/media";
|
||||
httpreq.open('POST', start, true);
|
||||
httpreq.open("POST", start, true);
|
||||
httpreq.upload.addEventListener("progress", progshow, false);
|
||||
httpreq.responseType = "json";
|
||||
httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
|
||||
httpreq.setRequestHeader("Authorization", "Bearer " + at);
|
||||
httpreq.send(fd);
|
||||
}
|
||||
httpreq.onreadystatechange = function () {
|
||||
httpreq.onreadystatechange = function() {
|
||||
if (httpreq.readyState === 4) {
|
||||
var json = httpreq.response;
|
||||
if (!json.id) {
|
||||
todc();
|
||||
$("#imgup").text("");
|
||||
$(".toot-btn-group").prop("disabled", false);
|
||||
$("#post-acct-sel").prop("disabled", false);
|
||||
$("select").formSelect();
|
||||
$("#imgsel").show();
|
||||
M.toast({ html: lang.lang_postimg_failupload, displayLength: 5000 });
|
||||
return false;
|
||||
}
|
||||
var img = localStorage.getItem("img");
|
||||
if (json.type.indexOf("image") != -1) {
|
||||
var html = '<img src="' + json[previewer] + '" class="preview-img pointer" data-media="' + json["id"] + '" onclick="deleteImage(\'' + json["id"] + '\')" title="' + lang.lang_postimg_delete + '">';
|
||||
$('#preview').append(html);
|
||||
var html = '<img src="' + json[previewer] + '" class="preview-img pointer" data-media="' + json["id"] + '" oncontextmenu="deleteImage(\'' + json["id"] + "')\" onclick=\"altImage('" + acct_id + "','" + json["id"] + '\')" title="' + lang.lang_postimg_delete + '">';
|
||||
$("#preview").append(html);
|
||||
} else {
|
||||
$('#preview').append(lang.lang_postimg_previewdis);
|
||||
$("#preview").append(lang.lang_postimg_previewdis);
|
||||
}
|
||||
if (!img) {
|
||||
var img = "no-act";
|
||||
@@ -135,26 +143,30 @@ function media(b64, type, no) {
|
||||
var regExp = new RegExp("tmp_" + r, "g");
|
||||
mediav = mediav.replace(regExp, json["id"]);
|
||||
$("#media").val(mediav);
|
||||
|
||||
}
|
||||
if (img == "url") {
|
||||
$("#textarea").val($("#textarea").val() + " " + json["text_url"])
|
||||
$("#textarea").val($("#textarea").val() + " " + json["text_url"]);
|
||||
}
|
||||
todc();
|
||||
if (localStorage.getItem("nsfw_" + acct_id)) {
|
||||
$("#nsfw").addClass("yellow-text");
|
||||
$("#nsfw").html("visibility");
|
||||
$("#nsfw").addClass("nsfw-avail");
|
||||
}
|
||||
$(".toot-btn-group").prop("disabled", false);
|
||||
$('select').material_select();
|
||||
$("select").formSelect();
|
||||
$("#mec").text(lang.lang_there);
|
||||
M.toast({ html: lang.lang_postimg_aftupload, displayLength: 1000 })
|
||||
M.toast({ html: lang.lang_postimg_aftupload, displayLength: 1000 });
|
||||
$("#imgup").text("");
|
||||
$("#imgsel").show();
|
||||
localStorage.removeItem("image");
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//Base64からBlobへ
|
||||
function toBlob(base64, type) {
|
||||
var bin = atob(base64.replace(/^.*,/, ''));
|
||||
var bin = atob(base64.replace(/^.*,/, ""));
|
||||
var buffer = new Uint8Array(bin.length);
|
||||
for (var i = 0; i < bin.length; i++) {
|
||||
buffer[i] = bin.charCodeAt(i);
|
||||
@@ -172,14 +184,14 @@ function toBlob(base64, type) {
|
||||
}
|
||||
//画像を貼り付けたら…
|
||||
var element = document.querySelector("#textarea");
|
||||
element.addEventListener("paste", function (e) {
|
||||
element.addEventListener("paste", function(e) {
|
||||
if (!e.clipboardData || !e.clipboardData.items) {
|
||||
return true;
|
||||
}
|
||||
// DataTransferItemList に画像が含まれいない場合は終了する
|
||||
var imageItems = [...e.clipboardData.items].filter(i => i.type.startsWith('image'));
|
||||
var imageItems = [...e.clipboardData.items].filter(i => i.type.startsWith("image"));
|
||||
if (imageItems.length == 0) {
|
||||
console.warn("it is not image")
|
||||
console.warn("it is not image");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -190,7 +202,7 @@ element.addEventListener("paste", function (e) {
|
||||
|
||||
// FileReaderで読み込む
|
||||
var fr = new FileReader();
|
||||
fr.onload = function (e) {
|
||||
fr.onload = function(e) {
|
||||
// onload内ではe.target.resultにbase64が入っているのであとは煮るなり焼くなり
|
||||
var base64 = e.target.result;
|
||||
var mediav = $("#media").val();
|
||||
@@ -198,24 +210,80 @@ element.addEventListener("paste", function (e) {
|
||||
var i = mediav.split(",").length;
|
||||
}
|
||||
// DataTransferItem の type に mime tipes があるのでそれを使う
|
||||
media(base64, imageType, i)
|
||||
media(base64, imageType, i);
|
||||
};
|
||||
fr.readAsDataURL(imageFile);
|
||||
|
||||
// 画像以外がペーストされたときのために、元に戻しておく
|
||||
});
|
||||
function deleteImage(key) {
|
||||
if (!confirm(lang.lang_postimg_delete)) {
|
||||
return false;
|
||||
}
|
||||
var media = $("#media").val();
|
||||
var arr = media.split(",");
|
||||
for (var i = 0; i < media.length; i++) {
|
||||
if (arr[i] == key) {
|
||||
arr.splice(i, 1);
|
||||
break;
|
||||
Swal.fire({
|
||||
title: lang.lang_postimg_delete,
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
cancelButtonColor: "#d33",
|
||||
confirmButtonText: lang.lang_yesno,
|
||||
cancelButtonText: lang.lang_no
|
||||
}).then(result => {
|
||||
if (result.value) {
|
||||
var media = $("#media").val();
|
||||
var arr = media.split(",");
|
||||
for (var i = 0; i < media.length; i++) {
|
||||
if (arr[i] == key) {
|
||||
arr.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
$("#media").val(arr.join(","));
|
||||
$("#preview [data-media=" + key + "]").remove();
|
||||
}
|
||||
}
|
||||
$("#media").val(arr.join(","));
|
||||
$('#preview [data-media=' + key + ']').remove();
|
||||
});
|
||||
}
|
||||
function altImage(acct_id, id) {
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/media/" + id;
|
||||
|
||||
Swal.fire({
|
||||
title: lang.lang_postimg_desc,
|
||||
text: lang.lang_postimg_leadContext,
|
||||
input: "text",
|
||||
inputAttributes: {
|
||||
autocapitalize: "off"
|
||||
},
|
||||
showCancelButton: true,
|
||||
confirmButtonText: "Post",
|
||||
showLoaderOnConfirm: true,
|
||||
preConfirm: data => {
|
||||
return fetch(start, {
|
||||
method: "PUT",
|
||||
headers: {
|
||||
"content-type": "application/json",
|
||||
Authorization: "Bearer " + at
|
||||
},
|
||||
body: JSON.stringify({
|
||||
description: data
|
||||
})
|
||||
})
|
||||
.then(function(response) {
|
||||
return response.json();
|
||||
})
|
||||
.catch(function(error) {
|
||||
todo(error);
|
||||
console.error(error);
|
||||
})
|
||||
.then(function(json) {
|
||||
console.log(json)
|
||||
$("[data-media=" + id + "]").attr("title", data);
|
||||
});
|
||||
},
|
||||
allowOutsideClick: () => !Swal.isLoading()
|
||||
}).then(result => {
|
||||
if (result.value) {
|
||||
Swal.fire({
|
||||
title: "Complete",
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -31,7 +31,7 @@ function renoteqt(id, acct_id) {
|
||||
$("#rec").text("Renote");
|
||||
$("#post-acct-sel").val(acct_id);
|
||||
$("#post-acct-sel").prop("disabled", true);
|
||||
$('select').material_select();
|
||||
$('select').formSelect();
|
||||
$("#textarea").attr("placeholder", lang.lang_misskeyparse_qt);
|
||||
$("#textarea").focus();
|
||||
}
|
||||
@@ -43,7 +43,7 @@ function misskeyreply(id, acct_id) {
|
||||
$("#rec").text("Renote");
|
||||
$("#post-acct-sel").val(acct_id);
|
||||
$("#post-acct-sel").prop("disabled", true);
|
||||
$('select').material_select();
|
||||
$('select').formSelect();
|
||||
$("#textarea").attr("placeholder", lang.lang_misskeyparse_qt);
|
||||
$("#textarea").focus();
|
||||
}
|
||||
@@ -102,7 +102,7 @@ function reactioncustom(acct_id, id) {
|
||||
$("#unreact").hide();
|
||||
$("#addreact").removeClass("hide");
|
||||
$("#post-acct-sel").val(acct_id);
|
||||
$('select').material_select();
|
||||
$('select').formSelect();
|
||||
localStorage.setItem("nohide", true);
|
||||
show()
|
||||
emojiToggle(true)
|
||||
|
||||
@@ -17,44 +17,43 @@ function post(mode, postvis) {
|
||||
var acct_id = $("#post-acct-sel").val();
|
||||
localStorage.setItem("last-use", acct_id);
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
if (domain == "theboss.tech") {
|
||||
if (~str.indexOf("#")) {
|
||||
if (str.indexOf("#theboss_tech") == "-1") {
|
||||
if (!confirm(lang.lang_post_tagTL)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (domain == "dtp-mstdn.jp") {
|
||||
if (~str.indexOf("#")) {
|
||||
if (str.indexOf("#dtp") == "-1") {
|
||||
if (!confirm(lang.lang_post_tagTL)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!localStorage.getItem("cw_sentence")) {
|
||||
var cw_sent = 500;
|
||||
} else {
|
||||
var cw_sent = localStorage.getItem("cw_sentence");
|
||||
}
|
||||
if (!localStorage.getItem("cw_letters")) {
|
||||
var cw_ltres = 500;
|
||||
var cw_ltres = 7000;
|
||||
} else {
|
||||
var cw_ltres = localStorage.getItem("cw_letters");
|
||||
}
|
||||
if (domain != "kirishima.cloud") {
|
||||
if (mode != "pass" && !$("#cw").hasClass("cw-avail") && (str.length > cw_sent || (str.split("\n").length - 1) > cw_ltres)) {
|
||||
var plus = str.replace(/\n/g, "").slice(0, 10) + "...";
|
||||
const options = {
|
||||
type: 'info',
|
||||
Swal.fire({
|
||||
title: lang.lang_post_cwtitle,
|
||||
message: lang.lang_post_cwtxt + plus,
|
||||
buttons: [lang.lang_post_btn1, lang.lang_post_btn2, lang.lang_post_btn3]
|
||||
}
|
||||
postMessage(["dialogCW", options], "*")
|
||||
text: lang.lang_post_cwtxt + plus,
|
||||
type: 'info',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#3085d6',
|
||||
confirmButtonText: lang.lang_post_btn2,
|
||||
cancelButtonText: lang.lang_post_btn3,
|
||||
showCloseButton: true,
|
||||
focusConfirm: false,
|
||||
}).then((result) => {
|
||||
if (result.dismiss == "cancel") {
|
||||
//btn3:sonomama
|
||||
post("pass")
|
||||
} else if (result.value) {
|
||||
//btn2:auto-CW
|
||||
$("#cw-text").show();
|
||||
$("#cw").addClass("yellow-text");
|
||||
$("#cw").addClass("cw-avail");
|
||||
$("#cw-text").val(plus);
|
||||
post("pass")
|
||||
}
|
||||
})
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -80,6 +79,10 @@ function post(mode, postvis) {
|
||||
if (media) {
|
||||
toot.media_ids = media.split(",");
|
||||
}
|
||||
var quote = $("#quote").val();
|
||||
if (quote) {
|
||||
toot.quote_id = quote;
|
||||
}
|
||||
if ($("#nsfw").hasClass("nsfw-avail")) {
|
||||
var nsfw = "true";
|
||||
toot.sensitive = nsfw;
|
||||
@@ -91,22 +94,11 @@ function post(mode, postvis) {
|
||||
} else {
|
||||
var vis = $("#vis").text();
|
||||
}
|
||||
|
||||
if (vis != "inherit" && vis != "local") {
|
||||
toot.visibility = vis;
|
||||
} else if (vis == "local") {
|
||||
toot.status = str + "👁️";
|
||||
}
|
||||
//ここに非公開・未収載タグについてwarn
|
||||
if (domain != "kirishima.cloud" && domain != "imastodon.net") {
|
||||
if (~str.indexOf("#")) {
|
||||
if (vis == "local" || vis == "unlisted" || vis == "direct" || vis == "private") {
|
||||
if (!confirm(lang.lang_post_tagVis)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($("#cw").hasClass("cw-avail")) {
|
||||
var spo = $("#cw-text").val();
|
||||
cw();
|
||||
@@ -122,7 +114,7 @@ function post(mode, postvis) {
|
||||
} else {
|
||||
var scheduled = "";
|
||||
}
|
||||
if ($("#poll-sel").val() == "mastodon-poll") {
|
||||
if (!$("#poll").hasClass("hide")) {
|
||||
var options = [];
|
||||
$(".mastodon-choice").map(function () {
|
||||
var choice = $(this).val();
|
||||
@@ -255,6 +247,7 @@ function clear() {
|
||||
}
|
||||
$("#textarea").attr("placeholder", lang.lang_toot);
|
||||
$("#reply").val("");
|
||||
$("#quote").val("");
|
||||
$("#media").val("");
|
||||
var cwt = localStorage.getItem("cw-text");
|
||||
if (cwt) {
|
||||
@@ -286,6 +279,8 @@ function clear() {
|
||||
$("#days_poll").val(0);
|
||||
$("#hours_poll").val(0);
|
||||
$("#mins_poll").val(6);
|
||||
$("#poll").addClass("hide")
|
||||
$("#pollsta").text(lang.lang_no)
|
||||
$(".mastodon-choice").map(function () {
|
||||
$(this).val("");
|
||||
});
|
||||
@@ -293,9 +288,20 @@ function clear() {
|
||||
if (localStorage.getItem("mainuse") == "main") {
|
||||
$("#post-acct-sel").val(localStorage.getItem("main"));
|
||||
}
|
||||
$('select').material_select();
|
||||
$("#left-side").show();
|
||||
$("#emoji").addClass("hide")
|
||||
$('select').formSelect();
|
||||
$("#default-emoji").show();
|
||||
$("#unreact").show();
|
||||
$("#addreact").addClass("hide");
|
||||
$("#right-side").hide()
|
||||
$("#right-side").css("width", "300px")
|
||||
$("#left-side").css("width", "100%")
|
||||
var width = localStorage.getItem("postbox-width");
|
||||
if(width){
|
||||
width = width.replace("px", "") * 1
|
||||
} else {
|
||||
width = 300
|
||||
}
|
||||
$("#post-box").css("width", width)
|
||||
mdCheck()
|
||||
}
|
||||
@@ -45,7 +45,10 @@ function vis(set) {
|
||||
var acct_id = $("#post-acct-sel").val();
|
||||
localStorage.setItem("vis-memory-" + acct_id, set);
|
||||
}
|
||||
M.Dropdown.getInstance($('#dropdown1')).close();
|
||||
var ins = M.Dropdown.getInstance($('#dropdown1'))
|
||||
if(ins){
|
||||
ins.close();
|
||||
}
|
||||
}
|
||||
function loadVis() {
|
||||
var vist = localStorage.getItem("vis");
|
||||
|
||||
@@ -1,479 +1,539 @@
|
||||
//お気に入り登録やブースト等、フォローやブロック等
|
||||
//お気に入り登録
|
||||
function fav(id, acct_id, remote) {
|
||||
if ($("#pub_" + id).hasClass("faved")) {
|
||||
var flag = "unfavourite";
|
||||
} else {
|
||||
var flag = "favourite";
|
||||
}
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/statuses/" + id + "/" + flag;
|
||||
var httpreq = new XMLHttpRequest();
|
||||
httpreq.open('POST', start, true);
|
||||
httpreq.setRequestHeader('Content-Type', 'application/json');
|
||||
httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
|
||||
httpreq.responseType = "json";
|
||||
httpreq.send();
|
||||
httpreq.onreadystatechange = function () {
|
||||
if (httpreq.readyState === 4) {
|
||||
var json = httpreq.response;
|
||||
if (remote != "remote") {
|
||||
//APIのふぁぼカウントがおかしい
|
||||
if ($("[toot-id=" + id + "] .fav_ct").text() == json.favourites_count) {
|
||||
if (flag == "unfavourite") {
|
||||
var fav = json.favourites_count - 1;
|
||||
} else {
|
||||
var fav = json.favourites_count + 1;
|
||||
//var fav = json.favourites_count;
|
||||
}
|
||||
} else {
|
||||
var fav = json.favourites_count;
|
||||
}
|
||||
$("[toot-id=" + id + "] .fav_ct").text(fav);
|
||||
if (!json.reblog) {
|
||||
} else {
|
||||
$("[toot-id=" + id + "] .rt_ct").text(fav);
|
||||
}
|
||||
if ($("[toot-id=" + id + "]").hasClass("faved")) {
|
||||
$("[toot-id=" + id + "]").removeClass("faved");
|
||||
$(".fav_" + id).removeClass("yellow-text");
|
||||
} else {
|
||||
$("[toot-id=" + id + "]").addClass("faved");
|
||||
$(".fav_" + id).addClass("yellow-text");
|
||||
}
|
||||
} else {
|
||||
M.toast({ html: lang.lang_status_favWarn, displayLength: 1000 })
|
||||
}
|
||||
if ($("#pub_" + id).hasClass("faved")) {
|
||||
var flag = "unfavourite";
|
||||
} else {
|
||||
var flag = "favourite";
|
||||
}
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/statuses/" + id + "/" + flag;
|
||||
var httpreq = new XMLHttpRequest();
|
||||
httpreq.open("POST", start, true);
|
||||
httpreq.setRequestHeader("Content-Type", "application/json");
|
||||
httpreq.setRequestHeader("Authorization", "Bearer " + at);
|
||||
httpreq.responseType = "json";
|
||||
httpreq.send();
|
||||
httpreq.onreadystatechange = function() {
|
||||
if (httpreq.readyState === 4) {
|
||||
var json = httpreq.response;
|
||||
if (json.reblog) {
|
||||
json = json.reblog;
|
||||
}
|
||||
if (remote != "remote") {
|
||||
//APIのふぁぼカウントがおかしい
|
||||
if ($("[unique-id=" + id + "] .fav_ct").text() == json.favourites_count) {
|
||||
if (flag == "unfavourite") {
|
||||
var fav = json.favourites_count - 1;
|
||||
if (fav * 1 < 0) {
|
||||
fav = 0;
|
||||
}
|
||||
} else {
|
||||
var fav = json.favourites_count;
|
||||
//var fav = json.favourites_count;
|
||||
}
|
||||
} else {
|
||||
var fav = json.favourites_count;
|
||||
}
|
||||
}
|
||||
$("[unique-id=" + id + "] .fav_ct").text(fav);
|
||||
$("[unique-id=" + id + "] .rt_ct").text(json.reblogs_count);
|
||||
if ($("[unique-id=" + id + "]").hasClass("faved")) {
|
||||
$("[unique-id=" + id + "]").removeClass("faved");
|
||||
$(".fav_" + id).removeClass("yellow-text");
|
||||
} else {
|
||||
$("[unique-id=" + id + "]").addClass("faved");
|
||||
$(".fav_" + id).addClass("yellow-text");
|
||||
}
|
||||
} else {
|
||||
M.toast({ html: lang.lang_status_favWarn, displayLength: 1000 });
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//ブースト
|
||||
function rt(id, acct_id, remote) {
|
||||
if ($("#pub_" + id).hasClass("rted")) {
|
||||
var flag = "unreblog";
|
||||
} else {
|
||||
var flag = "reblog";
|
||||
}
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/statuses/" + id + "/" + flag;
|
||||
var httpreq = new XMLHttpRequest();
|
||||
httpreq.open('POST', start, true);
|
||||
httpreq.setRequestHeader('Content-Type', 'application/json');
|
||||
httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
|
||||
httpreq.responseType = "json";
|
||||
httpreq.send();
|
||||
httpreq.onreadystatechange = function () {
|
||||
if (httpreq.readyState === 4) {
|
||||
var json = httpreq.response;
|
||||
console.log(["Success: boost", json]);
|
||||
if (remote != "remote") {
|
||||
$("[toot-id=" + id + "] .fav_ct").text(json.favourites_count);
|
||||
if (!json.reblog) {
|
||||
if (flag == "unreblog") {
|
||||
var rt = json.reblogs_count - 1;
|
||||
} else {
|
||||
var rt = json.reblogs_count + 1;
|
||||
}
|
||||
$("[toot-id=" + id + "] .rt_ct").text(rt);
|
||||
} else {
|
||||
$("[toot-id=" + id + "] .rt_ct").text(json.reblog.reblogs_count);
|
||||
}
|
||||
function rt(id, acct_id, remote, vis) {
|
||||
if ($("#pub_" + id).hasClass("rted")) {
|
||||
var flag = "unreblog";
|
||||
} else {
|
||||
var flag = "reblog";
|
||||
}
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/statuses/" + id + "/" + flag;
|
||||
var httpreq = new XMLHttpRequest();
|
||||
httpreq.open("POST", start, true);
|
||||
httpreq.setRequestHeader("Content-Type", "application/json");
|
||||
httpreq.setRequestHeader("Authorization", "Bearer " + at);
|
||||
httpreq.responseType = "json";
|
||||
if (vis) {
|
||||
httpreq.send(JSON.stringify({ visibility: vis }));
|
||||
} else {
|
||||
httpreq.send();
|
||||
}
|
||||
httpreq.onreadystatechange = function() {
|
||||
if (httpreq.readyState === 4) {
|
||||
var json = httpreq.response;
|
||||
if (json.reblog) {
|
||||
json = json.reblog;
|
||||
}
|
||||
console.log(["Success: boost", json]);
|
||||
$("[unique-id=" + id + "] .fav_ct").text(json.favourites_count);
|
||||
if (!json.reblog) {
|
||||
if (flag == "unreblog") {
|
||||
var rt = json.reblogs_count - 1;
|
||||
if (rt * 1 < 0) {
|
||||
rt = 0;
|
||||
}
|
||||
} else {
|
||||
var rt = json.reblogs_count;
|
||||
}
|
||||
$("[unique-id=" + id + "] .rt_ct").text(rt);
|
||||
} else {
|
||||
$("[unique-id=" + id + "] .rt_ct").text(json.reblogs_count);
|
||||
}
|
||||
|
||||
if ($("[toot-id=" + id + "]").hasClass("rted")) {
|
||||
$("[toot-id=" + id + "]").removeClass("rted");
|
||||
$(".rt_" + id).removeClass("teal-text");
|
||||
} else {
|
||||
$("[toot-id=" + id + "]").addClass("rted");
|
||||
$(".rt_" + id).addClass("teal-text");
|
||||
}
|
||||
} else {
|
||||
M.toast({ html: lang.lang_status_btWarn, displayLength: 1000 })
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($("[unique-id=" + id + "]").hasClass("rted")) {
|
||||
$("[unique-id=" + id + "]").removeClass("rted");
|
||||
$(".rt_" + id).removeClass("light-blue-text");
|
||||
} else {
|
||||
$("[unique-id=" + id + "]").addClass("rted");
|
||||
$(".rt_" + id).addClass("light-blue-text");
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
function boostWith(vis) {
|
||||
var id = $("#tootmodal").attr("data-id");
|
||||
var acct_id = $("#tootmodal").attr("data-acct");
|
||||
rt(id, acct_id, false, vis);
|
||||
}
|
||||
|
||||
//フォロー
|
||||
function follow(acct_id, remote) {
|
||||
if (!acct_id && acct_id != "selector") {
|
||||
var acct_id = $('#his-data').attr("use-acct");
|
||||
} else if (acct_id == "selector") {
|
||||
var acct_id = $("#user-acct-sel").val();
|
||||
}
|
||||
if (!remote && $("#his-data").hasClass("following")) {
|
||||
var flag = "unfollow";
|
||||
var flagm = "delete";
|
||||
} else {
|
||||
var flag = "follow";
|
||||
var flagm = "create";
|
||||
}
|
||||
var id = $("#his-data").attr("user-id");
|
||||
if (!remote) {
|
||||
var remote = $("#his-data").attr("remote");
|
||||
}
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
if (localStorage.getItem("mode_" + domain) == "misskey") {
|
||||
var start = "https://" + domain + "/api/following/" + flagm;
|
||||
var user = $("#his-acct").text();
|
||||
var ent = { "i": at, "userId": id }
|
||||
} else if (remote == "true" && flag == "follow") {
|
||||
var start = "https://" + domain + "/api/v1/follows";
|
||||
var user = $("#his-acct").text();
|
||||
var ent = { "uri": user }
|
||||
} else {
|
||||
var start = "https://" + domain + "/api/v1/accounts/" + id + "/" + flag;
|
||||
var ent = {}
|
||||
}
|
||||
var httpreq = new XMLHttpRequest();
|
||||
httpreq.open('POST', start, true);
|
||||
httpreq.setRequestHeader('Content-Type', 'application/json');
|
||||
httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
|
||||
httpreq.responseType = "json";
|
||||
httpreq.send(JSON.stringify(ent));
|
||||
httpreq.onreadystatechange = function () {
|
||||
if (httpreq.readyState === 4) {
|
||||
var json = httpreq.response;
|
||||
console.log(["Success: folllow", json]);
|
||||
if ($("#his-data").hasClass("following")) {
|
||||
$("#his-data").removeClass("following");
|
||||
$("#his-follow-btn").text(lang.lang_status_follow);
|
||||
} else {
|
||||
$("#his-data").addClass("following");
|
||||
$("#his-follow-btn").text(lang.lang_status_unfollow);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!acct_id && acct_id != "selector") {
|
||||
var acct_id = $("#his-data").attr("use-acct");
|
||||
} else if (acct_id == "selector") {
|
||||
var acct_id = $("#user-acct-sel").val();
|
||||
}
|
||||
if (!remote && $("#his-data").hasClass("following")) {
|
||||
var flag = "unfollow";
|
||||
var flagm = "delete";
|
||||
} else {
|
||||
var flag = "follow";
|
||||
var flagm = "create";
|
||||
}
|
||||
var id = $("#his-data").attr("user-id");
|
||||
if (!remote) {
|
||||
var remote = $("#his-data").attr("remote");
|
||||
}
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var user = $("#his-acct").text();
|
||||
var start = "https://" + domain + "/api/v1/accounts/" + id + "/" + flag;
|
||||
if (localStorage.getItem("mode_" + domain) == "misskey") {
|
||||
var start = "https://" + domain + "/api/following/" + flagm;
|
||||
var ent = { i: at, userId: id };
|
||||
} else if (remote == "true" && flag == "follow") {
|
||||
var ent = {};
|
||||
}
|
||||
var httpreq = new XMLHttpRequest();
|
||||
httpreq.open("POST", start, true);
|
||||
httpreq.setRequestHeader("Content-Type", "application/json");
|
||||
httpreq.setRequestHeader("Authorization", "Bearer " + at);
|
||||
httpreq.responseType = "json";
|
||||
httpreq.send(JSON.stringify(ent));
|
||||
httpreq.onreadystatechange = function() {
|
||||
if (httpreq.readyState === 4) {
|
||||
var json = httpreq.response;
|
||||
console.log(["Success: folllow", json]);
|
||||
if ($("#his-data").hasClass("following")) {
|
||||
$("#his-data").removeClass("following");
|
||||
$("#his-follow-btn").text(lang.lang_status_follow);
|
||||
} else {
|
||||
$("#his-data").addClass("following");
|
||||
$("#his-follow-btn").text(lang.lang_status_unfollow);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//ブロック
|
||||
function block(acct_id) {
|
||||
if (!acct_id) {
|
||||
var acct_id = $('#his-data').attr("use-acct");
|
||||
}
|
||||
var id = $("#his-data").attr("user-id");
|
||||
if ($("#his-data").hasClass("blocking")) {
|
||||
var flag = "unblock";
|
||||
} else {
|
||||
var flag = "block";
|
||||
}
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/accounts/" + id + "/" + flag;
|
||||
var httpreq = new XMLHttpRequest();
|
||||
httpreq.open('POST', start, true);
|
||||
httpreq.setRequestHeader('Content-Type', 'application/json');
|
||||
httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
|
||||
httpreq.responseType = "json";
|
||||
httpreq.send();
|
||||
httpreq.onreadystatechange = function () {
|
||||
if (httpreq.readyState === 4) {
|
||||
if ($("#his-data").hasClass("blocking")) {
|
||||
$("#his-data").removeClass("blocking");
|
||||
$("#his-block-btn").text(lang.lang_status_block);
|
||||
} else {
|
||||
$("#his-data").addClass("blocking");
|
||||
$("#his-block-btn").text(lang.lang_status_unblock);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($("#his-data").hasClass("blocking")) {
|
||||
var flag = "unblock";
|
||||
var txt = lang.lang_status_unmute;
|
||||
} else {
|
||||
var flag = "block";
|
||||
var txt = lang.lang_status_block;
|
||||
}
|
||||
Swal.fire({
|
||||
title: txt,
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
cancelButtonColor: "#d33",
|
||||
confirmButtonText: lang.lang_yesno,
|
||||
cancelButtonText: lang.lang_no
|
||||
}).then(result => {
|
||||
if (result.value) {
|
||||
if (!acct_id) {
|
||||
var acct_id = $("#his-data").attr("use-acct");
|
||||
}
|
||||
var id = $("#his-data").attr("user-id");
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/accounts/" + id + "/" + flag;
|
||||
var httpreq = new XMLHttpRequest();
|
||||
httpreq.open("POST", start, true);
|
||||
httpreq.setRequestHeader("Content-Type", "application/json");
|
||||
httpreq.setRequestHeader("Authorization", "Bearer " + at);
|
||||
httpreq.responseType = "json";
|
||||
httpreq.send();
|
||||
httpreq.onreadystatechange = function() {
|
||||
if (httpreq.readyState === 4) {
|
||||
if ($("#his-data").hasClass("blocking")) {
|
||||
$("#his-data").removeClass("blocking");
|
||||
$("#his-block-btn").text(lang.lang_status_block);
|
||||
} else {
|
||||
$("#his-data").addClass("blocking");
|
||||
$("#his-block-btn").text(lang.lang_status_unblock);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//ミュート
|
||||
function mute(acct_id) {
|
||||
if (!acct_id) {
|
||||
var acct_id = $('#his-data').attr("use-acct");
|
||||
}
|
||||
var id = $("#his-data").attr("user-id");
|
||||
if ($("#his-data").hasClass("muting")) {
|
||||
var flag = "unmute";
|
||||
var flagm = "delete";
|
||||
} else {
|
||||
var flag = "mute";
|
||||
var flagm = "create";
|
||||
}
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
if (localStorage.getItem("mode_" + domain) == "misskey") {
|
||||
var start = "https://" + domain + "/api/mute/" + flagm;
|
||||
var ent = { "i": at, "userId": id }
|
||||
var rq = JSON.stringify(ent);
|
||||
} else {
|
||||
var start = "https://" + domain + "/api/v1/accounts/" + id + "/" + flag;
|
||||
var rq = "";
|
||||
}
|
||||
var httpreq = new XMLHttpRequest();
|
||||
httpreq.open('POST', start, true);
|
||||
httpreq.setRequestHeader('Content-Type', 'application/json');
|
||||
httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
|
||||
httpreq.responseType = "json";
|
||||
httpreq.send(rq);
|
||||
httpreq.onreadystatechange = function () {
|
||||
if (httpreq.readyState === 4) {
|
||||
if ($("#his-data").hasClass("muting")) {
|
||||
$("#his-data").removeClass("muting");
|
||||
$("#his-mute-btn").text(lang.lang_status_mute);
|
||||
} else {
|
||||
$("#his-data").addClass("muting");
|
||||
$("#his-mute-btn").text(lang.lang_status_unmute);
|
||||
}
|
||||
}
|
||||
}
|
||||
function muteDo(acct_id) {
|
||||
if ($("#his-data").hasClass("muting")) {
|
||||
var flag = "unmute";
|
||||
var flagm = "delete";
|
||||
var txt = lang.lang_status_unmute;
|
||||
} else {
|
||||
var flag = "mute";
|
||||
var flagm = "create";
|
||||
var txt = lang.lang_status_mute;
|
||||
}
|
||||
Swal.fire({
|
||||
title: txt,
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
cancelButtonColor: "#d33",
|
||||
confirmButtonText: lang.lang_yesno,
|
||||
cancelButtonText: lang.lang_no
|
||||
}).then(result => {
|
||||
if (result.value) {
|
||||
if (!acct_id) {
|
||||
var acct_id = $("#his-data").attr("use-acct");
|
||||
}
|
||||
var id = $("#his-data").attr("user-id");
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
if (localStorage.getItem("mode_" + domain) == "misskey") {
|
||||
var start = "https://" + domain + "/api/mute/" + flagm;
|
||||
var ent = { i: at, userId: id };
|
||||
var rq = JSON.stringify(ent);
|
||||
} else {
|
||||
var start = "https://" + domain + "/api/v1/accounts/" + id + "/" + flag;
|
||||
var rq = "";
|
||||
}
|
||||
var httpreq = new XMLHttpRequest();
|
||||
httpreq.open("POST", start, true);
|
||||
httpreq.setRequestHeader("Content-Type", "application/json");
|
||||
httpreq.setRequestHeader("Authorization", "Bearer " + at);
|
||||
httpreq.responseType = "json";
|
||||
httpreq.send(rq);
|
||||
httpreq.onreadystatechange = function() {
|
||||
if (httpreq.readyState === 4) {
|
||||
if ($("#his-data").hasClass("muting")) {
|
||||
$("#his-data").removeClass("muting");
|
||||
$("#his-mute-btn").text(lang.lang_status_mute);
|
||||
} else {
|
||||
$("#his-data").addClass("muting");
|
||||
$("#his-mute-btn").text(lang.lang_status_unmute);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//投稿削除
|
||||
function del(id, acct_id) {
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
if (localStorage.getItem("mode_" + domain) == "misskey") {
|
||||
var start = "https://" + domain + "/api/notes/delete";
|
||||
var httpreq = new XMLHttpRequest();
|
||||
httpreq.open('POST', start, true);
|
||||
httpreq.setRequestHeader('Content-Type', 'application/json');
|
||||
httpreq.responseType = "json";
|
||||
httpreq.send(JSON.stringify({ i: at, noteId: id }));
|
||||
$("[toot-id=" + id + "]").hide();
|
||||
$("[toot-id=" + id + "]").remove();
|
||||
} else {
|
||||
var start = "https://" + domain + "/api/v1/statuses/" + id;
|
||||
var httpreq = new XMLHttpRequest();
|
||||
httpreq.open('DELETE', start, true);
|
||||
httpreq.setRequestHeader('Content-Type', 'application/json');
|
||||
httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
|
||||
httpreq.responseType = "json";
|
||||
httpreq.send();
|
||||
}
|
||||
httpreq.onreadystatechange = function () {
|
||||
if (httpreq.readyState === 4) {
|
||||
}
|
||||
}
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
if (localStorage.getItem("mode_" + domain) == "misskey") {
|
||||
var start = "https://" + domain + "/api/notes/delete";
|
||||
var httpreq = new XMLHttpRequest();
|
||||
httpreq.open("POST", start, true);
|
||||
httpreq.setRequestHeader("Content-Type", "application/json");
|
||||
httpreq.responseType = "json";
|
||||
httpreq.send(JSON.stringify({ i: at, noteId: id }));
|
||||
$("[toot-id=" + id + "]").hide();
|
||||
$("[toot-id=" + id + "]").remove();
|
||||
} else {
|
||||
var start = "https://" + domain + "/api/v1/statuses/" + id;
|
||||
var httpreq = new XMLHttpRequest();
|
||||
httpreq.open("DELETE", start, true);
|
||||
httpreq.setRequestHeader("Content-Type", "application/json");
|
||||
httpreq.setRequestHeader("Authorization", "Bearer " + at);
|
||||
httpreq.responseType = "json";
|
||||
httpreq.send();
|
||||
}
|
||||
httpreq.onreadystatechange = function() {
|
||||
if (httpreq.readyState === 4) {
|
||||
}
|
||||
};
|
||||
}
|
||||
//redraft
|
||||
function redraft(id, acct_id) {
|
||||
if (confirm(lang.lang_status_redraft)) {
|
||||
show();
|
||||
del(id, acct_id);
|
||||
$("#post-acct-sel").prop("disabled", true);
|
||||
var medias = $("[toot-id=" + id + "]").attr("data-medias");
|
||||
var vismode = $("[toot-id=" + id + "] .vis-data").attr("data-vis");
|
||||
vis(vismode);
|
||||
$("#media").val(medias);
|
||||
var ct = medias.split(",").length;
|
||||
$("[toot-id=" + id + "] img.toot-img").each(function (i, elem) {
|
||||
if (i < ct) {
|
||||
var url = $(elem).attr("src");
|
||||
console.log("Play back image data:" + url);
|
||||
$('#preview').append('<img src="' + url + '" style="width:50px; max-height:100px;">');
|
||||
}
|
||||
});
|
||||
var html = $("[toot-id=" + id + "] .toot").html();
|
||||
html = html.replace(/^<p>(.+)<\/p>$/, "$1");
|
||||
html = html.replace(/<br\s?\/?>/, "\n");
|
||||
html = html.replace(/<p>/, "\n");
|
||||
html = html.replace(/<\/p>/, "\n");
|
||||
html = html.replace(/<img[\s\S]*alt="(.+?)"[\s\S]*?>/g, "$1");
|
||||
html = $.strip_tags(html);
|
||||
localStorage.setItem("nohide", true);
|
||||
show();
|
||||
$("#textarea").val(html);
|
||||
var cwtxt = $("[toot-id=" + id + "] .cw_text").html();
|
||||
if (cwtxt != "") {
|
||||
cwtxt = $.strip_tags(cwtxt);
|
||||
cw();
|
||||
$("#cw-text").val(cwtxt);
|
||||
}
|
||||
}
|
||||
Swal.fire({
|
||||
title: lang.lang_status_redraftTitle,
|
||||
text: lang.lang_status_redraft,
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
cancelButtonColor: "#d33",
|
||||
confirmButtonText: lang.lang_yesno,
|
||||
cancelButtonText: lang.lang_no
|
||||
}).then(result => {
|
||||
if (result.value) {
|
||||
show();
|
||||
del(id, acct_id);
|
||||
$("#post-acct-sel").prop("disabled", true);
|
||||
$("#post-acct-sel").val(acct_id);
|
||||
$("select").formSelect();
|
||||
mdCheck();
|
||||
var medias = $("[toot-id=" + id + "]").attr("data-medias");
|
||||
var vismode = $("[toot-id=" + id + "] .vis-data").attr("data-vis");
|
||||
vis(vismode);
|
||||
$("#media").val(medias);
|
||||
var ct = medias.split(",").length;
|
||||
$("[toot-id=" + id + "] img.toot-img").each(function(i, elem) {
|
||||
if (i < ct) {
|
||||
var url = $(elem).attr("src");
|
||||
console.log("Play back image data:" + url);
|
||||
$("#preview").append(
|
||||
'<img src="' + url + '" style="width:50px; max-height:100px;">'
|
||||
);
|
||||
}
|
||||
});
|
||||
var html = $("[toot-id=" + id + "] .toot").html();
|
||||
html = html.replace(/^<p>(.+)<\/p>$/, "$1");
|
||||
html = html.replace(/<br\s?\/?>/, "\n");
|
||||
html = html.replace(/<p>/, "\n");
|
||||
html = html.replace(/<\/p>/, "\n");
|
||||
html = html.replace(/<img[\s\S]*alt="(.+?)"[\s\S]*?>/g, "$1");
|
||||
html = $.strip_tags(html);
|
||||
localStorage.setItem("nohide", true);
|
||||
show();
|
||||
$("#textarea").val(html);
|
||||
var cwtxt = $("[toot-id=" + id + "] .cw_text").html();
|
||||
if (cwtxt != "") {
|
||||
cwtxt = $.strip_tags(cwtxt);
|
||||
cw();
|
||||
$("#cw-text").val(cwtxt);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
//ピン留め
|
||||
function pin(id, acct_id) {
|
||||
if ($("#pub_" + id).hasClass("pined")) {
|
||||
var flag = "unpin";
|
||||
} else {
|
||||
var flag = "pin";
|
||||
}
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/statuses/" + id + "/" + flag;
|
||||
var httpreq = new XMLHttpRequest();
|
||||
httpreq.open('POST', start, true);
|
||||
httpreq.setRequestHeader('Content-Type', 'application/json');
|
||||
httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
|
||||
httpreq.responseType = "json";
|
||||
httpreq.send();
|
||||
httpreq.onreadystatechange = function () {
|
||||
if (httpreq.readyState === 4) {
|
||||
var json = httpreq.response;
|
||||
console.log(["Success: pinned", json]);
|
||||
if ($("[toot-id=" + id + "]").hasClass("pined")) {
|
||||
$("[toot-id=" + id + "]").removeClass("pined");
|
||||
$(".pin_" + id).removeClass("blue-text");
|
||||
} else {
|
||||
$("[toot-id=" + id + "]").addClass("pined");
|
||||
$(".pin_" + id).addClass("blue-text");
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($("#pub_" + id).hasClass("pined")) {
|
||||
var flag = "unpin";
|
||||
} else {
|
||||
var flag = "pin";
|
||||
}
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/statuses/" + id + "/" + flag;
|
||||
var httpreq = new XMLHttpRequest();
|
||||
httpreq.open("POST", start, true);
|
||||
httpreq.setRequestHeader("Content-Type", "application/json");
|
||||
httpreq.setRequestHeader("Authorization", "Bearer " + at);
|
||||
httpreq.responseType = "json";
|
||||
httpreq.send();
|
||||
httpreq.onreadystatechange = function() {
|
||||
if (httpreq.readyState === 4) {
|
||||
var json = httpreq.response;
|
||||
console.log(["Success: pinned", json]);
|
||||
if ($("[toot-id=" + id + "]").hasClass("pined")) {
|
||||
$("[toot-id=" + id + "]").removeClass("pined");
|
||||
$(".pin_" + id).removeClass("blue-text");
|
||||
} else {
|
||||
$("[toot-id=" + id + "]").addClass("pined");
|
||||
$(".pin_" + id).addClass("blue-text");
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//フォロリク
|
||||
function request(id, flag, acct_id) {
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/follow_requests/" + id + "/" + flag;
|
||||
var httpreq = new XMLHttpRequest();
|
||||
httpreq.open('POST', start, true);
|
||||
httpreq.setRequestHeader('Content-Type', 'application/json');
|
||||
httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
|
||||
httpreq.responseType = "json";
|
||||
httpreq.send();
|
||||
httpreq.onreadystatechange = function () {
|
||||
if (httpreq.readyState === 4) {
|
||||
var json = httpreq.response;
|
||||
console.log(["Success: request", "type:" + flag, json]);
|
||||
showReq();
|
||||
}
|
||||
}
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start =
|
||||
"https://" + domain + "/api/v1/follow_requests/" + id + "/" + flag;
|
||||
var httpreq = new XMLHttpRequest();
|
||||
httpreq.open("POST", start, true);
|
||||
httpreq.setRequestHeader("Content-Type", "application/json");
|
||||
httpreq.setRequestHeader("Authorization", "Bearer " + at);
|
||||
httpreq.responseType = "json";
|
||||
httpreq.send();
|
||||
httpreq.onreadystatechange = function() {
|
||||
if (httpreq.readyState === 4) {
|
||||
var json = httpreq.response;
|
||||
console.log(["Success: request", "type:" + flag, json]);
|
||||
showReq();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//ドメインブロック(未実装)
|
||||
function domainblock(add, flag, acct_id) {
|
||||
if (!acct_id) {
|
||||
var acct_id = $('#his-data').attr("use-acct");
|
||||
}
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/domain_blocks"
|
||||
var httpreq = new XMLHttpRequest();
|
||||
httpreq.open('POST', start, true);
|
||||
httpreq.setRequestHeader('Content-Type', 'application/json');
|
||||
httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
|
||||
httpreq.responseType = "json";
|
||||
httpreq.send();
|
||||
httpreq.onreadystatechange = function () {
|
||||
if (httpreq.readyState === 4) {
|
||||
var json = httpreq.response;
|
||||
console.log(["Success: domain block", json]);
|
||||
showDom();
|
||||
}
|
||||
}
|
||||
if (!acct_id) {
|
||||
var acct_id = $("#his-data").attr("use-acct");
|
||||
}
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/domain_blocks";
|
||||
var httpreq = new XMLHttpRequest();
|
||||
httpreq.open("POST", start, true);
|
||||
httpreq.setRequestHeader("Content-Type", "application/json");
|
||||
httpreq.setRequestHeader("Authorization", "Bearer " + at);
|
||||
httpreq.responseType = "json";
|
||||
httpreq.send();
|
||||
httpreq.onreadystatechange = function() {
|
||||
if (httpreq.readyState === 4) {
|
||||
var json = httpreq.response;
|
||||
console.log(["Success: domain block", json]);
|
||||
showDom();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function addDomainblock() {
|
||||
var domain = $("#domainblock").val();
|
||||
domainblock(domain, 'POST');
|
||||
var domain = $("#domainblock").val();
|
||||
domainblock(domain, "POST");
|
||||
}
|
||||
//ユーザー強調
|
||||
function empUser() {
|
||||
var usr = localStorage.getItem("user_emp");
|
||||
var obj = JSON.parse(usr);
|
||||
var id = $("#his-acct").attr("fullname");
|
||||
if (!obj) {
|
||||
var obj = [];
|
||||
obj.push(id);
|
||||
M.toast({ html: id + lang.lang_status_emphas, displayLength: 4000 })
|
||||
} else {
|
||||
var can;
|
||||
Object.keys(obj).forEach(function (key) {
|
||||
var usT = obj[key];
|
||||
if (usT != id && !can) {
|
||||
can = false;
|
||||
} else {
|
||||
can = true;
|
||||
obj.splice(key, 1);
|
||||
M.toast({ html: id + lang.lang_status_unemphas, displayLength: 4000 })
|
||||
}
|
||||
});
|
||||
}
|
||||
var json = JSON.stringify(obj);
|
||||
localStorage.setItem("user_emp", json);
|
||||
var usr = localStorage.getItem("user_emp");
|
||||
var obj = JSON.parse(usr);
|
||||
var id = $("#his-acct").attr("fullname");
|
||||
if (!obj) {
|
||||
var obj = [];
|
||||
obj.push(id);
|
||||
M.toast({ html: id + lang.lang_status_emphas, displayLength: 4000 });
|
||||
} else {
|
||||
var can;
|
||||
Object.keys(obj).forEach(function(key) {
|
||||
var usT = obj[key];
|
||||
if (usT != id && !can) {
|
||||
can = false;
|
||||
} else {
|
||||
can = true;
|
||||
obj.splice(key, 1);
|
||||
M.toast({ html: id + lang.lang_status_unemphas, displayLength: 4000 });
|
||||
}
|
||||
});
|
||||
}
|
||||
var json = JSON.stringify(obj);
|
||||
localStorage.setItem("user_emp", json);
|
||||
}
|
||||
//Endorse
|
||||
function pinUser() {
|
||||
var id = $("#his-data").attr("user-id");
|
||||
var acct_id = $("#his-data").attr("use-acct");
|
||||
if ($("#his-end-btn").hasClass("endorsed")) {
|
||||
var flag = "unpin";
|
||||
} else {
|
||||
var flag = "pin";
|
||||
}
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/accounts/" + id + "/" + flag;
|
||||
var httpreq = new XMLHttpRequest();
|
||||
httpreq.open('POST', start, true);
|
||||
httpreq.setRequestHeader('Content-Type', 'application/json');
|
||||
httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
|
||||
httpreq.responseType = "json";
|
||||
httpreq.send();
|
||||
httpreq.onreadystatechange = function () {
|
||||
if (httpreq.readyState === 4) {
|
||||
var json = httpreq.response;
|
||||
if ($("#his-end-btn").hasClass("endorsed")) {
|
||||
$("#his-end-btn").removeClass("endorsed")
|
||||
$("#his-end-btn").text(lang.lang_status_endorse)
|
||||
} else {
|
||||
$("#his-end-btn").addClass("endorsed")
|
||||
$("#his-end-btn").text(lang.lang_status_unendorse)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
var id = $("#his-data").attr("user-id");
|
||||
var acct_id = $("#his-data").attr("use-acct");
|
||||
if ($("#his-end-btn").hasClass("endorsed")) {
|
||||
var flag = "unpin";
|
||||
} else {
|
||||
var flag = "pin";
|
||||
}
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/accounts/" + id + "/" + flag;
|
||||
var httpreq = new XMLHttpRequest();
|
||||
httpreq.open("POST", start, true);
|
||||
httpreq.setRequestHeader("Content-Type", "application/json");
|
||||
httpreq.setRequestHeader("Authorization", "Bearer " + at);
|
||||
httpreq.responseType = "json";
|
||||
httpreq.send();
|
||||
httpreq.onreadystatechange = function() {
|
||||
if (httpreq.readyState === 4) {
|
||||
var json = httpreq.response;
|
||||
if ($("#his-end-btn").hasClass("endorsed")) {
|
||||
$("#his-end-btn").removeClass("endorsed");
|
||||
$("#his-end-btn").text(lang.lang_status_endorse);
|
||||
} else {
|
||||
$("#his-end-btn").addClass("endorsed");
|
||||
$("#his-end-btn").text(lang.lang_status_unendorse);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
//URLコピー
|
||||
function tootUriCopy(url) {
|
||||
execCopy(url);
|
||||
M.toast({ html: lang.lang_details_url, displayLength: 1500 })
|
||||
execCopy(url);
|
||||
M.toast({ html: lang.lang_details_url, displayLength: 1500 });
|
||||
}
|
||||
|
||||
//他のアカウントで…
|
||||
function staEx(mode) {
|
||||
var url = $("#tootmodal").attr("data-url");
|
||||
var acct_id = $("#status-acct-sel").val();
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/search?resolve=true&q=" + url
|
||||
fetch(start, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
'Authorization': 'Bearer ' + at
|
||||
}
|
||||
}).then(function (response) {
|
||||
return response.json();
|
||||
}).catch(function (error) {
|
||||
todo(error);
|
||||
console.error(error);
|
||||
}).then(function (json) {
|
||||
var id = json.statuses[0].id;
|
||||
if (mode == "rt") {
|
||||
rt(id, acct_id, 'remote')
|
||||
} else if (mode == "fav") {
|
||||
fav(id, acct_id, 'remote')
|
||||
} else if (mode == "reply") {
|
||||
reEx(id)
|
||||
}
|
||||
});
|
||||
return;
|
||||
var url = $("#tootmodal").attr("data-url");
|
||||
var acct_id = $("#status-acct-sel").val();
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v2/search?resolve=true&q=" + url;
|
||||
fetch(start, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"content-type": "application/json",
|
||||
Authorization: "Bearer " + at
|
||||
}
|
||||
})
|
||||
.then(function(response) {
|
||||
return response.json();
|
||||
})
|
||||
.catch(function(error) {
|
||||
todo(error);
|
||||
console.error(error);
|
||||
})
|
||||
.then(function(json) {
|
||||
var id = json.statuses[0].id;
|
||||
if (mode == "rt") {
|
||||
rt(id, acct_id, "remote");
|
||||
} else if (mode == "fav") {
|
||||
fav(id, acct_id, "remote");
|
||||
} else if (mode == "reply") {
|
||||
reEx(id);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
function toggleAction(id, tlid, acct_id) {
|
||||
if (tlid == "notf") {
|
||||
var tlide = "[data-notf=" + acct_id + "]";
|
||||
} else {
|
||||
var tlide = "[tlid=" + tlid + "]";
|
||||
}
|
||||
if (!$(tlide + " [toot-id=" + id + "]").hasClass("ext-mode")) {
|
||||
$(tlide + " [toot-id=" + id + "] .type-a").hide();
|
||||
$(tlide + " [toot-id=" + id + "] .type-b").show();
|
||||
$(tlide + " [toot-id=" + id + "]").addClass("ext-mode")
|
||||
$(tlide + " [toot-id=" + id + "] .act-icon").text("expand_less");
|
||||
} else {
|
||||
$(tlide + " [toot-id=" + id + "] .type-b").hide();
|
||||
$(tlide + " [toot-id=" + id + "] .type-a").show();
|
||||
$(tlide + " [toot-id=" + id + "]").removeClass("ext-mode")
|
||||
$(tlide + " [toot-id=" + id + "] .act-icon").text("expand_more");
|
||||
}
|
||||
|
||||
if (tlid == "notf") {
|
||||
var tlide = "[data-acct=" + acct_id + "] .notf-timeline";
|
||||
} else if (tlid == "user") {
|
||||
var tlide = "#his-tl-contents";
|
||||
} else {
|
||||
var tlide = "[tlid=" + tlid + "]";
|
||||
}
|
||||
if (!$(tlide + " [toot-id=" + id + "]").hasClass("ext-mode")) {
|
||||
$(tlide + " [toot-id=" + id + "] .type-a").hide();
|
||||
$(tlide + " [toot-id=" + id + "] .type-b").show();
|
||||
$(tlide + " [toot-id=" + id + "]").addClass("ext-mode");
|
||||
$(tlide + " [toot-id=" + id + "] .act-icon").text("expand_less");
|
||||
} else {
|
||||
$(tlide + " [toot-id=" + id + "] .type-b").hide();
|
||||
$(tlide + " [toot-id=" + id + "] .type-a").show();
|
||||
$(tlide + " [toot-id=" + id + "]").removeClass("ext-mode");
|
||||
$(tlide + " [toot-id=" + id + "] .act-icon").text("expand_more");
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ var oldSuggest;
|
||||
var suggest;
|
||||
|
||||
input.addEventListener("focus", function () {
|
||||
localStorage.removeItem("cursor");
|
||||
var acct_id = $("#post-acct-sel").val();
|
||||
$("#suggest").html("");
|
||||
window.clearInterval(timer);
|
||||
@@ -17,6 +18,15 @@ input.addEventListener("focus", function () {
|
||||
$("#suggest").html("");
|
||||
if ($("#poll").hasClass("hide") && $("#emoji").hasClass("hide")) {
|
||||
$("#right-side").hide()
|
||||
$("#right-side").css("width", "300px")
|
||||
$("#left-side").css("width", "100%")
|
||||
var width = localStorage.getItem("postbox-width");
|
||||
if (width) {
|
||||
width = width.replace("px", "") * 1
|
||||
} else {
|
||||
width = 300
|
||||
}
|
||||
$("#post-box").css("width", width + "px")
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -41,11 +51,29 @@ input.addEventListener("focus", function () {
|
||||
}
|
||||
if (ehtml != "") {
|
||||
$("#right-side").show()
|
||||
$("#right-side").css("width", "200px")
|
||||
$("#left-side").css("width", "calc(100% - 200px)")
|
||||
var width = localStorage.getItem("postbox-width");
|
||||
if (width) {
|
||||
width = width.replace("px", "") * 1 + 200
|
||||
} else {
|
||||
width = 500
|
||||
}
|
||||
$("#post-box").css("width", width + "px")
|
||||
$("#poll").addClass("hide")
|
||||
$("#emoji").addClass("hide")
|
||||
} else {
|
||||
if ($("#poll").hasClass("hide") && $("#emoji").hasClass("hide")) {
|
||||
$("#right-side").hide()
|
||||
$("#right-side").css("width", "300px")
|
||||
$("#left-side").css("width", "100%")
|
||||
var width = localStorage.getItem("postbox-width");
|
||||
if (width) {
|
||||
width = width.replace("px", "") * 1
|
||||
} else {
|
||||
width = 300
|
||||
}
|
||||
$("#post-box").css("width", width + "px")
|
||||
}
|
||||
}
|
||||
$("#suggest").html(ehtml);
|
||||
@@ -61,12 +89,21 @@ input.addEventListener("focus", function () {
|
||||
$("#suggest").html("");
|
||||
if ($("#poll").hasClass("hide") && $("#emoji").hasClass("hide")) {
|
||||
$("#right-side").hide()
|
||||
$("#right-side").css("width", "300px")
|
||||
$("#left-side").css("width", "100%")
|
||||
var width = localStorage.getItem("postbox-width");
|
||||
if (width) {
|
||||
width = width.replace("px", "") * 1
|
||||
} else {
|
||||
width = 300
|
||||
}
|
||||
$("#post-box").css("width", width + "px")
|
||||
}
|
||||
return;
|
||||
}
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
suggest = "https://" + domain + "/api/v1/search?q=" + q
|
||||
suggest = "https://" + domain + "/api/v2/search?q=" + q
|
||||
if (suggest != oldSuggest) {
|
||||
console.log("Try to get suggest at " + suggest)
|
||||
fetch(suggest, {
|
||||
@@ -81,18 +118,52 @@ input.addEventListener("focus", function () {
|
||||
todo(error);
|
||||
console.error(error);
|
||||
}).then(function (json) {
|
||||
console.log(["Search", json]);
|
||||
//ハッシュタグ
|
||||
if (json.hashtags[0] && tag) {
|
||||
if (tag[1]) {
|
||||
var tags = "";
|
||||
var tags = [];
|
||||
Object.keys(json.hashtags).forEach(function (key4) {
|
||||
var tag = json.hashtags[key4];
|
||||
if (tag != q) {
|
||||
tags = tags + '<a onclick="tagInsert(\'#' + tag + '\',\'#' + q +
|
||||
'\')" class="pointer">#' + tag + '</a><br>';
|
||||
var his = tag.history;
|
||||
var uses = his[0].uses * 1 + his[1].uses * 1 + his[2].uses * 1 + his[3].uses * 1 + his[4].uses * 1 + his[5].uses * 1 + his[6].uses * 1;
|
||||
tagHTML = '<br><a onclick="tagInsert(\'#' + escapeHTML(tag.name) + '\',\'#' + q + '\')" class="pointer">#' +
|
||||
escapeHTML(tag.name) + '</a> ' + uses + 'toot(s)'
|
||||
var item = {
|
||||
"uses": uses,
|
||||
"html": tagHTML
|
||||
}
|
||||
tags.push(item)
|
||||
});
|
||||
var num_a = -1;
|
||||
var num_b = 1;
|
||||
tags = tags.sort(function (a, b) {
|
||||
var x = a["uses"];
|
||||
var y = b["uses"];
|
||||
if (x > y) return num_a;
|
||||
if (x < y) return num_b;
|
||||
return 0;
|
||||
});
|
||||
var ins = ""
|
||||
var nev = false
|
||||
Object.keys(tags).forEach(function (key7) {
|
||||
ins = ins + tags[key7].html
|
||||
if (key7 <= 0 && !nev) {
|
||||
ins = ins + '<br>'
|
||||
nev = true
|
||||
}
|
||||
});
|
||||
$("#suggest").html(ins);
|
||||
$("#right-side").show()
|
||||
$("#suggest").html("Tags:<br>" + tags);
|
||||
$("#right-side").css("width", "200px")
|
||||
$("#left-side").css("width", "calc(100% - 200px)")
|
||||
var width = localStorage.getItem("postbox-width");
|
||||
if (width) {
|
||||
width = width.replace("px", "") * 1 + 200
|
||||
} else {
|
||||
width = 500
|
||||
}
|
||||
$("#post-box").css("width", width + "px")
|
||||
$("#poll").addClass("hide")
|
||||
$("#emoji").addClass("hide")
|
||||
}
|
||||
@@ -101,17 +172,38 @@ input.addEventListener("focus", function () {
|
||||
Object.keys(json.accounts).forEach(function (key3) {
|
||||
var acct = json.accounts[key3];
|
||||
if (acct.acct != q) {
|
||||
accts = accts + '<a onclick="tagInsert(\'@' + acct.acct +
|
||||
'\',\'@' + q + '\')" class="pointer">@' + acct.acct + '</a><br>';
|
||||
//Instance Actorって…
|
||||
if (acct.username.indexOf(".") < 0) {
|
||||
accts = accts + '<a onclick="tagInsert(\'@' + acct.acct +
|
||||
'\',\'@' + q + '\')" class="pointer">@' + acct.acct + '</a><br>';
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#right-side").show()
|
||||
$("#right-side").css("width", "200px")
|
||||
$("#left-side").css("width", "calc(100% - 200px)")
|
||||
var width = localStorage.getItem("postbox-width");
|
||||
if (width) {
|
||||
width = width.replace("px", "") * 1 + 200
|
||||
} else {
|
||||
width = 500
|
||||
}
|
||||
$("#post-box").css("width", width + "px")
|
||||
$("#suggest").html(accts);
|
||||
$("#poll").addClass("hide")
|
||||
$("#emoji").addClass("hide")
|
||||
} else {
|
||||
if ($("#poll").hasClass("hide") && $("#emoji").hasClass("hide")) {
|
||||
$("#right-side").hide()
|
||||
$("#right-side").css("width", "300px")
|
||||
$("#left-side").css("width", "100%")
|
||||
var width = localStorage.getItem("postbox-width");
|
||||
if (width) {
|
||||
width = width.replace("px", "") * 1
|
||||
} else {
|
||||
width = 300
|
||||
}
|
||||
$("#post-box").css("width", width + "px")
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -131,7 +223,7 @@ function tagInsert(code, del) {
|
||||
var selin = $("#textarea").prop('selectionStart');
|
||||
if (!del) {
|
||||
} else {
|
||||
var regExp = new RegExp(del, "g");
|
||||
var regExp = new RegExp(del.replace(/[.*+?^=!:${}()|[\]\/\\]/g, "\\$&"), "g");
|
||||
var now = now.replace(regExp, "");
|
||||
selin = selin - del.length;
|
||||
}
|
||||
@@ -146,6 +238,13 @@ function tagInsert(code, del) {
|
||||
$("#textarea").focus();
|
||||
if ($("#poll").hasClass("hide") && $("#emoji").hasClass("hide")) {
|
||||
$("#right-side").hide()
|
||||
$("#right-side").css("width", "300px")
|
||||
$("#left-side").css("width", "50%")
|
||||
var width = localStorage.getItem("postbox-width").replace("px", "") * 1;
|
||||
if (!width) {
|
||||
width = 300
|
||||
}
|
||||
$("#post-box").css("width", width + "px")
|
||||
}
|
||||
$("#suggest").html("");
|
||||
}
|
||||
|
||||
@@ -15,7 +15,8 @@ function re(id, ats_cm, acct_id, mode) {
|
||||
$("#rec").text(lang.lang_yesno);
|
||||
$("#post-acct-sel").val(acct_id);
|
||||
$("#post-acct-sel").prop("disabled", true);
|
||||
$('select').material_select();
|
||||
$('select').formSelect();
|
||||
mdCheck()
|
||||
$("#textarea").attr("placeholder", lang.lang_usetxtbox_reply);
|
||||
$("#textarea").focus();
|
||||
var profimg = localStorage.getItem("prof_" + acct_id);
|
||||
@@ -57,8 +58,24 @@ function qt(id, acct_id, at, url) {
|
||||
html = html.replace(/<\/p>/, "\n");
|
||||
html = $.strip_tags(html);
|
||||
$("#textarea").val("\n" + "@" + at + " " + html + "\n" + url);
|
||||
} else if (qt == "apiQuote") {
|
||||
clear();
|
||||
localStorage.setItem("nohide", true);
|
||||
show();
|
||||
$("#quote").val(id);
|
||||
$("#post-acct-sel").val(acct_id);
|
||||
$("#post-acct-sel").prop("disabled", true);
|
||||
$('select').formSelect();
|
||||
$("#textarea").attr("placeholder", lang.lang_usetxtbox_reply);
|
||||
$("#textarea").focus();
|
||||
var profimg = localStorage.getItem("prof_" + acct_id);
|
||||
if (!profimg) {
|
||||
profimg = "../../img/missing.svg";
|
||||
}
|
||||
$("#acct-sel-prof").attr("src", profimg);
|
||||
}
|
||||
$("#textarea").focus();
|
||||
$("#post-acct-sel").val(acct_id);
|
||||
$('select').material_select();
|
||||
$('select').formSelect();
|
||||
mdCheck()
|
||||
$("#textarea").focus();
|
||||
}
|
||||
@@ -6,17 +6,21 @@ function additional(acct_id, tlid) {
|
||||
|
||||
$("#timeline-container .mention").addClass("parsed");
|
||||
|
||||
$("#timeline-container .hashtag").each(function (i, elem) {
|
||||
$("#timeline-container .hashtag, #timeline-container [rel=tag]").each(function (i, elem) {
|
||||
var tags = $(this).attr("href").match(
|
||||
/https?:\/\/([-a-zA-Z0-9@.]+)\/tags\/([-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)/
|
||||
);
|
||||
$(this).attr("href", "#");
|
||||
if (tags) {
|
||||
if (tags[2]) {
|
||||
$(this).attr("onclick", 'tagShow(\'' + tags[2] + '\')');
|
||||
}
|
||||
|
||||
if(tags){
|
||||
var tagThis = tags[2]
|
||||
}else{
|
||||
var tagThis = $(this).attr("data-tag")
|
||||
}
|
||||
|
||||
if(tagThis){
|
||||
$(this).attr("onclick", 'tagShow(\'' + tagThis + '\')');
|
||||
$(this).attr("href", "#");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//トゥートサムネ
|
||||
@@ -155,7 +159,7 @@ function additionalIndv(tlid, acct_id, id) {
|
||||
});
|
||||
} else {
|
||||
var id = $("[toot-id=" + id + "] .toot a").parents('.cvo').attr("toot-id");
|
||||
var start = "https://" + domain + "/api/v1/statuses/" + id + "/card";
|
||||
var start = "https://" + domain + "/api/v1/statuses/" + id;
|
||||
fetch(start, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
@@ -169,6 +173,7 @@ function additionalIndv(tlid, acct_id, id) {
|
||||
todo(error);
|
||||
console.error(error);
|
||||
}).then(function (json) {
|
||||
json = json.card;
|
||||
//このリンク鳥やんけ、ってとき
|
||||
if (json.provider_name == "Twitter") {
|
||||
if (json.image) {
|
||||
@@ -233,6 +238,7 @@ function cardCheck(tlid) {
|
||||
}
|
||||
|
||||
function mov(id, tlid, type) {
|
||||
var click = false
|
||||
if (tlid == "notf") {
|
||||
var tlide = "[data-notf=" + acct_id + "]";
|
||||
} else if (tlid == "user") {
|
||||
@@ -252,12 +258,21 @@ function mov(id, tlid, type) {
|
||||
} else {
|
||||
mouseover = "hide";
|
||||
}
|
||||
click=true
|
||||
} else if (mouseover == "no") {
|
||||
mouseover = "";
|
||||
}
|
||||
if (mouseover == "hide") {
|
||||
$(tlide + " [toot-id=" + id + "] .area-actions").toggleClass("hide")
|
||||
$(tlide + " [toot-id=" + id + "] .area-side").toggleClass("hide")
|
||||
if(click){
|
||||
$(tlide + " [toot-id=" + id + "]").toggleClass("hide-actions")
|
||||
}else{
|
||||
$(tlide + " [toot-id=" + id + "]").removeClass("hide-actions")
|
||||
}
|
||||
|
||||
//$(tlide + " [toot-id=" + id + "] .area-vis").toggleClass("hide")
|
||||
//$(tlide + " [toot-id=" + id + "] .area-actions").toggleClass("hide")
|
||||
//$(tlide + " [toot-id=" + id + "] .area-side").toggleClass("hide")
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -273,8 +288,10 @@ function resetmv(type) {
|
||||
mouseover = "hide";
|
||||
}
|
||||
if (mouseover == "hide") {
|
||||
$(".area-actions").addClass("hide");
|
||||
$(".area-side").addClass("hide");
|
||||
$(".cvo").addClass("hide-actions")
|
||||
//$(".area-vis").addClass("hide");
|
||||
//$(".area-actions").addClass("hide");
|
||||
//$(".area-side").addClass("hide");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -77,12 +77,13 @@ function details(id, acct_id, tlid, mode) {
|
||||
$("#toot-this .rt_ct").text(json.reblogs_count);
|
||||
$("#tootmodal").attr("data-url", url);
|
||||
$("#tootmodal").attr("data-id", json.id);
|
||||
$("#tootmodal").attr("data-acct", acct_id);
|
||||
if (local) {
|
||||
$("#tootmodal").attr("data-user", scn + "@" + domain);
|
||||
} else {
|
||||
$("#tootmodal").attr("data-user", scn);
|
||||
}
|
||||
context(id, acct_id);
|
||||
getContext(id, acct_id);
|
||||
var dom = null;
|
||||
if (!local) {
|
||||
dom = scn.replace(/.+@/g, '');
|
||||
@@ -99,7 +100,9 @@ function details(id, acct_id, tlid, mode) {
|
||||
if ($("#toot-this div").hasClass("cvo")) {
|
||||
$("#toot-this").removeClass("cvo");
|
||||
} else {
|
||||
$("#toot-this").addClass("cvo");
|
||||
if(!$("#toot-this .cvo").hasClass("cvo")){
|
||||
$("#toot-this").addClass("cvo");
|
||||
}
|
||||
}
|
||||
if (!$("#activator").hasClass("active")) {
|
||||
$('#det-col').collapsible('open', 4);
|
||||
@@ -125,14 +128,7 @@ function replyTL(id, acct_id) {
|
||||
})
|
||||
}
|
||||
} else {
|
||||
var start = "https://" + domain + "/api/v1/statuses/" + id;
|
||||
var i = {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
'Authorization': 'Bearer ' + at
|
||||
},
|
||||
}
|
||||
return false
|
||||
}
|
||||
fetch(start, i).then(function (response) {
|
||||
return response.json();
|
||||
@@ -155,27 +151,13 @@ function replyTL(id, acct_id) {
|
||||
if (json[rep]) {
|
||||
replyTL(json[rep][0], acct_id);
|
||||
}
|
||||
} else {
|
||||
var templete = parse([json], '', acct_id, "", "", mute);
|
||||
if (templete != "") {
|
||||
$("#toot-reply .no-data").hide();
|
||||
}
|
||||
$("#toot-reply").prepend(templete);
|
||||
$("#toot-reply .hide").html(lang.lang_details_filtered);
|
||||
$("#toot-reply .by_filter").css("display", "block");
|
||||
$("#toot-reply .by_filter").removeClass("hide");
|
||||
jQuery("time.timeago").timeago();
|
||||
var rep = "in_reply_to_id";
|
||||
if (json[rep]) {
|
||||
replyTL(json[rep], acct_id);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//コンテクストってなんですか
|
||||
function context(id, acct_id) {
|
||||
function getContext(id, acct_id) {
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
if (localStorage.getItem("mode_" + domain) == "misskey") {
|
||||
@@ -228,6 +210,14 @@ function context(id, acct_id) {
|
||||
$("#toot-after .hide").html(lang.lang_details_filtered);
|
||||
$("#toot-after .by_filter").css("display", "block");
|
||||
$("#toot-after .by_filter").removeClass("hide");
|
||||
var templete = parse(json.ancestors, '', acct_id, "", "", mute);
|
||||
if (templete != "") {
|
||||
$("#toot-reply .no-data").hide();
|
||||
}
|
||||
$("#toot-reply").prepend(templete);
|
||||
$("#toot-reply .hide").html(lang.lang_details_filtered);
|
||||
$("#toot-reply .by_filter").css("display", "block");
|
||||
$("#toot-reply .by_filter").removeClass("hide");
|
||||
jQuery("time.timeago").timeago();
|
||||
}
|
||||
|
||||
@@ -433,6 +423,7 @@ function faved(id, acct_id) {
|
||||
$("#toot-fav .no-data").hide();
|
||||
}
|
||||
$("#toot-fav").html(templete);
|
||||
jQuery("time.timeago").timeago();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -456,6 +447,7 @@ function rted(id, acct_id) {
|
||||
}).then(function (json) {
|
||||
var templete = userparse(json, '', acct_id);
|
||||
$("#toot-rt").html(templete);
|
||||
jQuery("time.timeago").timeago();
|
||||
});
|
||||
}
|
||||
//URL等のコピー
|
||||
@@ -513,7 +505,7 @@ function trans(tar, to) {
|
||||
todo(error);
|
||||
console.error(error);
|
||||
}).then(function (text) {
|
||||
$("#toot-this .additional").html('<span class="gray">' + text.text + '</span>');
|
||||
$("#toot-this .additional").html('<span class="gray translate">' + text.text + '</span>');
|
||||
});
|
||||
}
|
||||
//ブラウザで開く
|
||||
@@ -528,7 +520,7 @@ function detEx(url, acct_id) {
|
||||
}
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/search?resolve=true&q=" + url
|
||||
var start = "https://" + domain + "/api/v2/search?resolve=true&q=" + url
|
||||
fetch(start, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
|
||||
69
app/js/tl/directory.js
Normal file
@@ -0,0 +1,69 @@
|
||||
//ディレクトリ
|
||||
//ディレクトリトグル
|
||||
function dirMenu() {
|
||||
$("#dir-contents").html("");
|
||||
directory();
|
||||
$("#left-menu div").removeClass("active");
|
||||
$("#dirMenu").addClass("active");
|
||||
$(".menu-content").addClass("hide");
|
||||
$("#dir-box").removeClass("hide");
|
||||
}
|
||||
function dirselCk() {
|
||||
var acct = $("#dir-acct-sel").val();
|
||||
if (acct == "noauth") {
|
||||
$("#dirNoAuth").removeClass("hide");
|
||||
} else {
|
||||
$("#dirNoAuth").addClass("hide");
|
||||
directory();
|
||||
}
|
||||
}
|
||||
function directory(isMore) {
|
||||
var order = $("[name=sort]:checked").val()
|
||||
if (!order) {
|
||||
order = "active"
|
||||
}
|
||||
var local_only = $("#local_only:checked").val()
|
||||
if (local_only) {
|
||||
local_only = "true"
|
||||
} else {
|
||||
local_only = "false"
|
||||
}
|
||||
var acct_id = $("#dir-acct-sel").val();
|
||||
if (acct_id == "noauth") {
|
||||
var domain = $("#dirNoAuth-url").val();
|
||||
var at = "";
|
||||
} else {
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
}
|
||||
if (isMore) {
|
||||
var addOffset = $("#dir-contents .cvo").length
|
||||
} else {
|
||||
var addOffset = 0
|
||||
$("#dir-contents").html("");
|
||||
}
|
||||
var start = "https://" + domain + "/api/v1/directory?order=" + order + "&local=" + local_only + "&offset=" + addOffset
|
||||
console.log(start)
|
||||
fetch(start, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
'Authorization': 'Bearer ' + at
|
||||
},
|
||||
}).then(function (response) {
|
||||
return response.json();
|
||||
}).catch(function (error) {
|
||||
//todo(error);
|
||||
console.error(error);
|
||||
}).then(function (json) {
|
||||
if (json) {
|
||||
$("#moreDir").removeClass("disabled")
|
||||
var html = userparse(json, null, acct_id, "dir", null)
|
||||
$("#dir-contents").append(html)
|
||||
jQuery("time.timeago").timeago();
|
||||
} else {
|
||||
$("#moreDir").addClass("disabled")
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
@@ -77,12 +77,12 @@ function catchToggle(tlid) {
|
||||
localStorage.removeItem("catch_" + tlid);
|
||||
$("#sta-del-" + tlid).text("Off");
|
||||
$("#sta-del-" + tlid).css("color", 'red');
|
||||
parseColumn();
|
||||
parseColumn(tlid);
|
||||
} else {
|
||||
localStorage.setItem("catch_" + tlid, "true");
|
||||
$("#sta-del-" + tlid).text("On");
|
||||
$("#sta-del-" + tlid).css("color", '#009688');
|
||||
parseColumn();
|
||||
parseColumn(tlid);
|
||||
}
|
||||
}
|
||||
function catchCheck(tlid) {
|
||||
@@ -370,7 +370,7 @@ function filterUpdateInternal(json, type) {
|
||||
var text = $(elem).find('.toot').html();
|
||||
Object.keys(home).forEach(function (key8) {
|
||||
var word = home[key8];
|
||||
var regExp = new RegExp(word, "g");
|
||||
var regExp = new RegExp(word.replace(/[.*+?^=!:${}()|[\]\/\\]/g, "\\$&"), "g");
|
||||
if ($.strip_tags(text).match(regExp)) {
|
||||
$("[toot-id=" + id + "]").addClass("hide");
|
||||
}
|
||||
@@ -386,6 +386,7 @@ function filterUpdateInternal(json, type) {
|
||||
*/
|
||||
//通知フィルター
|
||||
function exclude(key) {
|
||||
localStorage.setItem("exclude-" + key, "")
|
||||
var excludetxt = localStorage.getItem("exclude-" + key);
|
||||
if ($('#exc-reply-' + key + ':checked').val()) {
|
||||
excludetxt = "?exclude_types[]=mention"
|
||||
@@ -420,7 +421,7 @@ function exclude(key) {
|
||||
} else {
|
||||
}
|
||||
localStorage.setItem("exclude-" + key, excludetxt)
|
||||
parseColumn();
|
||||
parseColumn(key);
|
||||
}
|
||||
function excludeCk(key, target) {
|
||||
var exc = localStorage.getItem("exclude-" + key);
|
||||
@@ -443,7 +444,7 @@ function checkNotfFilter(tlid){
|
||||
}
|
||||
function resetNotfFilter(tlid){
|
||||
localStorage.setItem("exclude-" + tlid, "")
|
||||
parseColumn();
|
||||
parseColumn(tlid);
|
||||
}
|
||||
function notfFilter(id,tlid,acct_id){
|
||||
var excludetxt = localStorage.getItem("exclude-" + tlid);
|
||||
@@ -453,5 +454,5 @@ function notfFilter(id,tlid,acct_id){
|
||||
excludetxt = "?account_id="+id
|
||||
}
|
||||
localStorage.setItem("exclude-" + tlid, excludetxt)
|
||||
parseColumn();
|
||||
parseColumn(tlid);
|
||||
}
|
||||
@@ -135,6 +135,7 @@ function listUser(id, acct_id) {
|
||||
templete = lang.lang_list_nouser;
|
||||
}
|
||||
$("#lists-user").html(templete);
|
||||
jQuery("time.timeago").timeago();
|
||||
} else {
|
||||
$("#lists-user").html(lang.lang_list_nouser);
|
||||
}
|
||||
|
||||
@@ -50,14 +50,18 @@ function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) {
|
||||
native = "yes";
|
||||
}
|
||||
//クライアント強調
|
||||
var emp = localStorage.getItem("client_emp");
|
||||
if (emp) {
|
||||
var emp = JSON.parse(emp);
|
||||
var empCli = localStorage.getItem("client_emp");
|
||||
if (empCli) {
|
||||
var empCli = JSON.parse(empCli);
|
||||
} else {
|
||||
var empCli = [];
|
||||
}
|
||||
//クライアントミュート
|
||||
var mute = localStorage.getItem("client_mute");
|
||||
if (mute) {
|
||||
var mute = JSON.parse(mute);
|
||||
var muteCli = localStorage.getItem("client_mute");
|
||||
if (muteCli) {
|
||||
var muteCli = JSON.parse(muteCli);
|
||||
} else {
|
||||
var muteCli = [];
|
||||
}
|
||||
//ユーザー強調
|
||||
var useremp = localStorage.getItem("user_emp");
|
||||
@@ -65,17 +69,19 @@ function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) {
|
||||
var useremp = JSON.parse(useremp);
|
||||
}
|
||||
//ワード強調
|
||||
var wordemp = localStorage.getItem("word_emp");
|
||||
if (wordemp) {
|
||||
var wordemp = JSON.parse(wordemp);
|
||||
var wordempList = localStorage.getItem("word_emp");
|
||||
if (wordempList) {
|
||||
var wordempList = JSON.parse(wordempList);
|
||||
}
|
||||
//ワードミュート
|
||||
var wordmute = localStorage.getItem("word_mute");
|
||||
if (wordmute) {
|
||||
var wordmute = JSON.parse(wordmute);
|
||||
wordmute = wordmute.concat(mutefilter);
|
||||
var wordmuteList = localStorage.getItem("word_mute");
|
||||
if (wordmuteList) {
|
||||
var wordmuteList = JSON.parse(wordmuteList);
|
||||
if (wordmuteList) {
|
||||
wordmuteList = wordmuteList.concat(mutefilter);
|
||||
}
|
||||
} else {
|
||||
wordmute = mutefilter;
|
||||
wordmuteList = mutefilter;
|
||||
}
|
||||
//Ticker
|
||||
var tickerck = localStorage.getItem("ticker_ok");
|
||||
@@ -178,9 +184,9 @@ function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) {
|
||||
noticeavatar = toot.user.avatarUrl;
|
||||
}
|
||||
noticeavatar = '<a onclick="udg(\'' + toot.user.id +
|
||||
'\',' + acct_id + ');" user="' + toot.user.username + '" class="udg">' +
|
||||
'\',' + acct_id + ');" user="' + toot.user.username + '" class="udg notf-icon">' +
|
||||
'<img src="' + noticeavatar +
|
||||
'" width="20" class="notf-icon prof-img" user="' + toot.user.username +
|
||||
'" width="20" class="prof-img" user="' + toot.user.username +
|
||||
'"></a>';
|
||||
if (toot.type == "reply") {
|
||||
var what = lang.lang_parse_mentioned;
|
||||
@@ -262,19 +268,7 @@ function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) {
|
||||
body: toot.user.name + "(" + toot.user.username + ")" + what + "\n\n" + $.strip_tagstemp(toot.note.text),
|
||||
icon: toot.user.avatarUrl
|
||||
};
|
||||
if (os == "darwin") {
|
||||
var n = new Notification('TheDesk:' + domain, options);
|
||||
} else {
|
||||
var nativeNotfOpt=[
|
||||
'TheDesk:' + domain,
|
||||
toot.user.name + "(" + toot.user.username + ")" + what + "\n\n" + $.strip_tagstemp(toot.note.text),
|
||||
toot.user.avatarUrl,
|
||||
"toot",
|
||||
acct_id,
|
||||
toot.note.id
|
||||
]
|
||||
postMessage(["nativeNotf", nativeNotfOpt], "*")
|
||||
}
|
||||
var n = new Notification('TheDesk:' + domain, options);
|
||||
}
|
||||
if (localStorage.getItem("hasNotfC_" + acct_id) != "true") {
|
||||
$(".notf-icon_" + acct_id).addClass("red-text");
|
||||
@@ -349,16 +343,16 @@ function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) {
|
||||
viashow = "via-hide";
|
||||
}
|
||||
//強調チェック
|
||||
Object.keys(emp).forEach(function (key6) {
|
||||
var cli = emp[key6];
|
||||
if (cli == via) {
|
||||
Object.keys(empCli).forEach(function (key6) {
|
||||
var empCliList = empCli[key6];
|
||||
if (empCliList == via) {
|
||||
boostback = "emphasized";
|
||||
}
|
||||
});
|
||||
//ミュートチェック
|
||||
Object.keys(mute).forEach(function (key7) {
|
||||
var cli = mute[key7];
|
||||
if (cli == via) {
|
||||
Object.keys(muteCli).forEach(function (key7) {
|
||||
var muteCliList = muteCli[key7];
|
||||
if (muteCliList == via) {
|
||||
boostback = "hide";
|
||||
}
|
||||
});
|
||||
@@ -369,7 +363,7 @@ function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) {
|
||||
var spoiler = "cw cw_hide_" + toot.id;
|
||||
var api_spoil = "gray";
|
||||
var spoiler_show = '<a href="#" onclick="cw_show(\'' + toot.id +
|
||||
'\')" class="nex parsed">' + lang.lang_parse_cwshow + '</a><br>';
|
||||
'\')" class="nex parsed cw_btn">' + lang.lang_parse_cwshow + '</a><br>';
|
||||
} else {
|
||||
var ct1 = nl2br(toot.text).split('<br />').length - 2;
|
||||
var ct2 = nl2br(toot.text).split('<br>').length - 2;
|
||||
@@ -381,7 +375,7 @@ function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) {
|
||||
'</span><span class="gray">' + lang.lang_parse_autofold + '</span>';
|
||||
var spoiler = "cw cw_hide_" + toot.id;
|
||||
var spoiler_show = '<a href="#" onclick="cw_show(\'' + toot.id +
|
||||
'\')" class="nex parsed">' + lang.lang_parse_more + '</a><br>';
|
||||
'\')" class="nex parsed cw_btn">' + lang.lang_parse_more + '</a><br>';
|
||||
} else {
|
||||
var content = escapeHTMLtemp(toot.text);
|
||||
if (toot.cw) {
|
||||
@@ -495,12 +489,16 @@ function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) {
|
||||
'" data-type="video" class="img-parsed"><video src="' +
|
||||
purl + '" class="' + sense +
|
||||
' toot-img pointer" style="max-width:100%;"></a></span>';
|
||||
} else if (media.type.indexOf("audio") !== -1) {
|
||||
viewer = viewer + '<audio src="' +
|
||||
purl + '" class="' + sense +
|
||||
' toot-img pointer" style="width:100%;" controls></span>';
|
||||
} else {
|
||||
viewer = viewer + '<a onclick="imgv(\'' + id + '\',\'' + key2 + '\',' +
|
||||
acct_id + ')" id="' + id + '-image-' + key2 + '" data-url="' + url +
|
||||
'" data-type="image" class="img-parsed"><img src="' +
|
||||
purl + '" class="' + sense +
|
||||
' toot-img pointer" style="width:' + cwdt + '%; height:' + imh + 'px;"></a></span>';
|
||||
' toot-img pointer" style="width:' + cwdt + '%; height:' + imh + 'px;" onerror="this.src=\'../../img/loading.svg\'"></a></span>';
|
||||
}
|
||||
|
||||
});
|
||||
@@ -571,7 +569,7 @@ function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) {
|
||||
var rt_app = "";
|
||||
/*
|
||||
if (toot.reblogged) {
|
||||
var if_rt = "teal-text";
|
||||
var if_rt = "light-blue-text";
|
||||
var rt_app = "rted";
|
||||
} else {
|
||||
var if_rt = "";
|
||||
@@ -581,16 +579,16 @@ function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) {
|
||||
//アバター
|
||||
var avatar = toot.user.avatarUrl;
|
||||
//ワードミュート
|
||||
if (wordmute) {
|
||||
Object.keys(wordmute).forEach(function (key8) {
|
||||
var worde = wordmute[key8];
|
||||
if (wordmuteList) {
|
||||
Object.keys(wordmuteList).forEach(function (key8) {
|
||||
var worde = wordmuteList[key8];
|
||||
if (worde) {
|
||||
if (worde.tag) {
|
||||
var word = worde.tag;
|
||||
var wordList = worde.tag;
|
||||
} else {
|
||||
var word = worde
|
||||
var wordList = worde
|
||||
}
|
||||
var regExp = new RegExp(word, "g");
|
||||
var regExp = new RegExp(wordList.replace(/[.*+?^=!:${}()|[\]\/\\]/g, "\\$&"), "g");
|
||||
if ($.strip_tagstemp(content).match(regExp)) {
|
||||
boostback = "hide by_filter";
|
||||
}
|
||||
@@ -598,13 +596,13 @@ function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) {
|
||||
});
|
||||
}
|
||||
//ワード強調
|
||||
if (wordemp) {
|
||||
Object.keys(wordemp).forEach(function (key9) {
|
||||
var word = wordemp[key9];
|
||||
if (word) {
|
||||
var word = word.tag;
|
||||
var regExp = new RegExp(word, "g");
|
||||
content = content.replace(regExp, '<span class="emp">' + word + "</span>");
|
||||
if (wordempList) {
|
||||
Object.keys(wordempList).forEach(function (key9) {
|
||||
var wordList = wordempList[key9];
|
||||
if (wordList) {
|
||||
var wordList = wordList.tag;
|
||||
var regExp = new RegExp(wordList.replace(/[.*+?^=!:${}()|[\]\/\\]/g, "\\$&"), "g");
|
||||
content = content.replace(regExp, '<span class="emp">' + wordList + "</span>");
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -778,7 +776,7 @@ function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) {
|
||||
'\',' + acct_id + ');" user="' + toot.user.username + '" class="udg">' +
|
||||
'<img src="' + avatar +
|
||||
'" width="40" class="prof-img" user="' + toot.user.username +
|
||||
'"></a></div>' +
|
||||
'" onerror="this.src=\'../../img/loading.svg\'"></a></div>' +
|
||||
'<div class="area-display_name"><div class="flex-name"><span class="user">' +
|
||||
dis_name +
|
||||
'</span><span class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis; cursor:text;"> @' +
|
||||
@@ -822,10 +820,10 @@ function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) {
|
||||
'<div class="action ' + disp["re"] + ' ' + noauth + '"><a onclick="misskeyreply(\'' + toot.id +
|
||||
'\',\'' + acct_id + '\',' +
|
||||
acct_id + ',\'' + visen +
|
||||
'\')" class="waves-effect waves-dark btn-flat" style="padding:0" title="' + lang.lang_parse_replyto + '"><i class="fas fa-share"></i></a></div>' +
|
||||
'\')" class="waves-effect waves-dark btn-flat rep-btn" style="padding:0" title="' + lang.lang_parse_replyto + '"><i class="fas fa-share"></i></a></div>' +
|
||||
'<div class="action ' + can_rt + ' ' + disp["rt"] + ' ' + noauth + '"><a onclick="renote(\'' + toot.id + '\',' + acct_id +
|
||||
',\'' + tlid +
|
||||
'\')" class="waves-effect waves-dark btn-flat" style="padding:0" title="' + lang.lang_misskeyparse_renote + '"><i class="text-darken-3 fas fa-retweet ' +
|
||||
'\')" class="waves-effect waves-dark btn-flat bt-btn" style="padding:0" title="' + lang.lang_misskeyparse_renote + '"><i class="text-darken-3 fas fa-retweet ' +
|
||||
if_rt + ' rt_' + toot.id + '"></i><span class="rt_ct"></span></a></div>' +
|
||||
'<div class="action ' + can_rt + ' ' + disp["qt"] + ' ' + noauth + '"><a onclick="renoteqt(\'' + toot.id + '\',' + acct_id +
|
||||
',\'misskey.xyz\',\'misskey.xyz\')" class="waves-effect waves-dark btn-flat" style="padding:0" title="' + lang.lang_misskeyparse_renoteqt + '"><i class="text-darken-3 fas fa-quote-right"></i></a></div>' +
|
||||
@@ -907,19 +905,7 @@ function misskeyUserparse(obj, auth, acct_id, tlid, popup) {
|
||||
icon: toot.avatar
|
||||
};
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
if (os == "darwin") {
|
||||
var n = new Notification('TheDesk:' + domain, options);
|
||||
} else {
|
||||
var nativeNotfOpt=[
|
||||
'TheDesk:' + domain,
|
||||
toot.display_name + "(" + toot.acct + ")" + ftxt,
|
||||
toot.avatar,
|
||||
"userdata",
|
||||
acct_id,
|
||||
toot.id
|
||||
]
|
||||
postMessage(["nativeNotf", nativeNotfOpt], "*")
|
||||
}
|
||||
var n = new Notification('TheDesk:' + domain, options);
|
||||
}
|
||||
}
|
||||
if (toot.name) {
|
||||
@@ -969,7 +955,7 @@ function goGoogle(id) {
|
||||
}
|
||||
var misskeyws = []
|
||||
var misskeywsstate = []
|
||||
function connectMisskey(acct_id) {
|
||||
function connectMisskey(acct_id, re) {
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "wss://" + domain +
|
||||
@@ -988,10 +974,9 @@ function connectMisskey(acct_id) {
|
||||
console.log([domain + ":Receive Streaming API:", data]);
|
||||
var data = JSON.parse(mess.data)
|
||||
var obj = data.body.body
|
||||
|
||||
var mute = [];
|
||||
if (data.body.id.indexOf("notf:") !== -1) {
|
||||
var obj = JSON.parse(mess.data).body;
|
||||
console.log(obj);
|
||||
var popup = localStorage.getItem("popup");
|
||||
if (!popup) {
|
||||
popup = 0;
|
||||
@@ -1053,13 +1038,17 @@ function connectMisskey(acct_id) {
|
||||
console.error("Error closing " + tlid);
|
||||
console.error(error);
|
||||
misskeywsstate[wsid] = false
|
||||
connectMisskey(acct_id)
|
||||
if(!re){
|
||||
connectMisskey(acct_id, true)
|
||||
}
|
||||
return false;
|
||||
};
|
||||
misskeyws[wsid].onclose = function () {
|
||||
console.warn("Closing " + tlid);
|
||||
misskeywsstate[wsid] = false
|
||||
connectMisskey(acct_id)
|
||||
if(!re){
|
||||
connectMisskey(acct_id, true)
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
|
||||
@@ -43,15 +43,15 @@ function mixtl(acct_id, tlid, type, delc, voice) {
|
||||
timeline.splice(20);
|
||||
}
|
||||
var templete = "";
|
||||
if (localStorage.getItem("filter_" + acct_id) != "undefined") {
|
||||
var mute = getFilterType(JSON.parse(localStorage.getItem("filter_" + acct_id)), "mix");
|
||||
} else {
|
||||
var mute = [];
|
||||
}
|
||||
Object.keys(timeline).forEach(function (key) {
|
||||
var pkey = key * 1 + 1;
|
||||
if (pkey < timeline.length) {
|
||||
if (date(timeline[key].created_at, "unix") != date(timeline[pkey].created_at, "unix")) {
|
||||
if (localStorage.getItem("filter_" + acct_id) != "undefined") {
|
||||
var mute = getFilterType(JSON.parse(localStorage.getItem("filter_" + acct_id)), "mix");
|
||||
} else {
|
||||
var mute = [];
|
||||
}
|
||||
if (type == "integrated") {
|
||||
templete = templete + parse([timeline[key]], '', acct_id, tlid, "", mute, "mix");
|
||||
} else if (type == "plus") {
|
||||
|
||||
@@ -63,12 +63,7 @@ function notfColumn(acct_id, tlid, sys) {
|
||||
body: ct + lang.lang_notf_new,
|
||||
icon: localStorage.getItem("prof_" + acct_id)
|
||||
};
|
||||
if (os == "darwin") {
|
||||
var n = new Notification('TheDesk:' + domain, options);
|
||||
} else {
|
||||
var nativeNotfOpt=['TheDesk:' + domain, ct + lang.lang_notf_new, localStorage.getItem("prof_" + acct_id)]
|
||||
postMessage(["nativeNotf", nativeNotfOpt], "*")
|
||||
}
|
||||
var n = new Notification('TheDesk:' + domain, options);
|
||||
|
||||
}
|
||||
if (localStorage.getItem("filter_" + acct_id) != "undefined") {
|
||||
@@ -98,6 +93,16 @@ function notfColumn(acct_id, tlid, sys) {
|
||||
}
|
||||
$("#notf-box").addClass("fetched");
|
||||
todc();
|
||||
//Markers
|
||||
var markers = localStorage.getItem("markers");
|
||||
if (markers == "yes") {
|
||||
markers = true;
|
||||
} else {
|
||||
markers = false
|
||||
}
|
||||
if (markers) {
|
||||
getMarker(tlid, "notf", acct_id)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!misskey) {
|
||||
@@ -168,12 +173,7 @@ function notfCommon(acct_id, tlid, sys) {
|
||||
body: ct + lang.lang_notf_new,
|
||||
icon: localStorage.getItem("prof_" + acct_id)
|
||||
};
|
||||
if (os == "darwin") {
|
||||
var n = new Notification('TheDesk:' + domain, options);
|
||||
} else {
|
||||
var nativeNotfOpt=['TheDesk:' + domain, ct + lang.lang_notf_new, localStorage.getItem("prof_" + acct_id)]
|
||||
postMessage(["nativeNotf", nativeNotfOpt], "*")
|
||||
}
|
||||
var n = new Notification('TheDesk:' + domain, options);
|
||||
|
||||
}
|
||||
if (localStorage.getItem("filter_" + acct_id) != "undefined") {
|
||||
@@ -224,7 +224,7 @@ function notfWS(misskey, acct_id, tlid, domain, at) {
|
||||
|
||||
}
|
||||
websocketNotf[acct_id].onmessage = function (mess) {
|
||||
console.log(["Receive Streaming API(Notf):" + acct_id + "(" + domain + ")", JSON.parse(JSON.parse(mess.data).payload)]);
|
||||
//console.log(["Receive Streaming API(Notf):" + acct_id + "(" + domain + ")", JSON.parse(JSON.parse(mess.data).payload)]);
|
||||
var popup = localStorage.getItem("popup");
|
||||
if (!popup) {
|
||||
popup = 0;
|
||||
@@ -234,16 +234,19 @@ function notfWS(misskey, acct_id, tlid, domain, at) {
|
||||
if (type == "notification") {
|
||||
var templete = "";
|
||||
localStorage.setItem("lastnotf_" + acct_id, obj.id);
|
||||
if (obj.type != "follow") {
|
||||
templete = parse([obj], 'notf', acct_id, 'notf', popup);
|
||||
} else {
|
||||
templete = userparse([obj], 'notf', acct_id, 'notf', popup);
|
||||
if (!$("#unread_" + tlid + " .material-icons").hasClass("teal-text")) {
|
||||
//markers show中はダメ
|
||||
if (obj.type != "follow") {
|
||||
templete = parse([obj], 'notf', acct_id, 'notf', popup);
|
||||
} else {
|
||||
templete = userparse([obj], 'notf', acct_id, 'notf', popup);
|
||||
}
|
||||
if (!$("div[data-notfIndv=" + acct_id + "_" + obj.id + "]").length) {
|
||||
$("div[data-notf=" + acct_id + "]").prepend(templete);
|
||||
$("div[data-const=notf_" + acct_id + "]").prepend(templete);
|
||||
}
|
||||
jQuery("time.timeago").timeago();
|
||||
}
|
||||
if (!$("div[data-notfIndv=" + acct_id + "_" + obj.id + "]").length) {
|
||||
$("div[data-notf=" + acct_id + "]").prepend(templete);
|
||||
$("div[data-const=notf_" + acct_id + "]").prepend(templete);
|
||||
}
|
||||
jQuery("time.timeago").timeago();
|
||||
} else if (type == "delete") {
|
||||
$("[toot-id=" + obj + "]").hide();
|
||||
$("[toot-id=" + obj + "]").remove();
|
||||
@@ -251,7 +254,21 @@ function notfWS(misskey, acct_id, tlid, domain, at) {
|
||||
}
|
||||
websocketNotf[acct_id].onerror = function (error) {
|
||||
console.error('WebSocket Error ' + error);
|
||||
notfWS(misskey, acct_id, tlid, domain, at)
|
||||
errorct++;
|
||||
console.log(errorct)
|
||||
if (errorct < 3) {
|
||||
notfWS(misskey, acct_id, tlid, domain, at)
|
||||
}
|
||||
|
||||
};
|
||||
websocketNotf[acct_id].onclose = function (error) {
|
||||
console.error('WebSocket Close ' + error);
|
||||
errorct++;
|
||||
console.log(errorct)
|
||||
if (errorct < 3) {
|
||||
notfWS(misskey, acct_id, tlid, domain, at)
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -348,23 +365,23 @@ function notfToggle(acct, tlid) {
|
||||
$("#notf-box_" + tlid).animate({
|
||||
'height': '400px'
|
||||
}, {
|
||||
'duration': 300,
|
||||
'complete': function () {
|
||||
$("#notf-box_" + tlid).css("overflow-y", "scroll")
|
||||
$("#notf-box_" + tlid).removeClass("column-hide")
|
||||
}
|
||||
});
|
||||
'duration': 300,
|
||||
'complete': function () {
|
||||
$("#notf-box_" + tlid).css("overflow-y", "scroll")
|
||||
$("#notf-box_" + tlid).removeClass("column-hide")
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$("#notf-box_" + tlid).css("overflow-y", "hidden")
|
||||
$("#notf-box_" + tlid).animate({
|
||||
'height': '0'
|
||||
}, {
|
||||
'duration': 300,
|
||||
'complete': function () {
|
||||
$("#notf-box_" + tlid).addClass("column-hide")
|
||||
$("#notf-box_" + tlid).css("display", "none")
|
||||
}
|
||||
});
|
||||
'duration': 300,
|
||||
'complete': function () {
|
||||
$("#notf-box_" + tlid).addClass("column-hide")
|
||||
$("#notf-box_" + tlid).css("display", "none")
|
||||
}
|
||||
});
|
||||
}
|
||||
notfCanceler(acct)
|
||||
}
|
||||
|
||||
1282
app/js/tl/parse.js
@@ -2,11 +2,31 @@
|
||||
function pollToggle() {
|
||||
if ($("#poll").hasClass("hide")) {
|
||||
$("#right-side").show()
|
||||
$("#right-side").css("width", "300px")
|
||||
$("#left-side").css("width", "calc(100% - 300px)")
|
||||
var width = localStorage.getItem("postbox-width");
|
||||
if (width) {
|
||||
width = width.replace("px", "") * 1 + 300
|
||||
} else {
|
||||
width = 600
|
||||
}
|
||||
$("#post-box").css("width", width + "px")
|
||||
$("#poll").removeClass("hide")
|
||||
$("#pollsta").text(lang.lang_yesno)
|
||||
} else {
|
||||
$("#right-side").hide()
|
||||
$("#left-side").css("width", "100%")
|
||||
$("#right-side").css("width", "300px")
|
||||
var width = localStorage.getItem("postbox-width");
|
||||
if (width) {
|
||||
width = width.replace("px", "") * 1
|
||||
} else {
|
||||
width = 300
|
||||
}
|
||||
$("#post-box").css("width", width + "px")
|
||||
$("#emoji").addClass("hide")
|
||||
$("#poll").addClass("hide")
|
||||
$("#pollsta").text(lang.lang_no)
|
||||
}
|
||||
}
|
||||
function pollProviderCk() {
|
||||
@@ -89,8 +109,9 @@ function voteMastodonrefresh(acct_id, id) {
|
||||
var start = "https://" + domain + "/api/v1/polls/" + id;
|
||||
httpreqd.open('GET', start, true);
|
||||
httpreqd.setRequestHeader('Content-Type', 'application/json');
|
||||
httpreqd.setRequestHeader('Authorization', 'Bearer ' + at);
|
||||
httpreqd.responseType = 'json';
|
||||
httpreqd.send(JSON.stringify({ i: at, noteId: id }));
|
||||
httpreqd.send();
|
||||
httpreqd.onreadystatechange = function () {
|
||||
if (httpreqd.readyState == 4) {
|
||||
var json = httpreqd.response;
|
||||
@@ -98,20 +119,7 @@ function voteMastodonrefresh(acct_id, id) {
|
||||
if (!json) {
|
||||
return false;
|
||||
}
|
||||
var poll = "";
|
||||
var choices = json.options;
|
||||
var myvote = lang.lang_parse_voted;
|
||||
var result_hide = "";
|
||||
Object.keys(choices).forEach(function (keyc) {
|
||||
var choice = choices[keyc];
|
||||
if (!json.voted) {
|
||||
votesel = 'voteSelMastodon(\'' + acct_id + '\',\'' + json.id + '\',' + keyc + ',' + json.multiple + ')';
|
||||
}
|
||||
poll = poll + '<div class="pointer vote vote_' + acct_id + '_' + json.id + '_' + keyc + '" onclick="' + votesel + '">' + escapeHTML(choice.title) + '<span class="vote_' + acct_id + '_' + json.id + '_result ' + result_hide + '">(' + choice.votes_count + ')</span></div>';
|
||||
});
|
||||
poll = poll + myvote + '<span class="cbadge cbadge-hover" title="' + date(json.expires_at, 'absolute') +
|
||||
'"><i class="far fa-calendar-times"></i>' +
|
||||
date(json.expires_at, datetype) + '</span>';
|
||||
var poll = pollParse(json, acct_id)
|
||||
$('.vote_' + acct_id + '_' + json.id).html(poll)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
$voise = null;
|
||||
isBouyomi = localStorage.getItem("voice_bouyomi");
|
||||
$voiseName = lang.lang_speech;
|
||||
$voices = speechSynthesis.getVoices();
|
||||
$synthes = new SpeechSynthesisUtterance();
|
||||
@@ -9,9 +10,12 @@ speechSynthesis.cancel()
|
||||
if (!localStorage.getItem("voice_vol")) {
|
||||
localStorage.setItem("voice_vol", 1)
|
||||
}
|
||||
$synthes.rate = localStorage.getItem("voice_speed");
|
||||
$synthes.pitch = localStorage.getItem("voice_pitch");
|
||||
$synthes.volume = localStorage.getItem("voice_vol");
|
||||
voiceRate = localStorage.getItem("voice_speed");
|
||||
$synthes.rate = voiceRate
|
||||
voicePitch = localStorage.getItem("voice_pitch");
|
||||
$synthes.pitch = voicePitch
|
||||
voiceVol = localStorage.getItem("voice_vol");
|
||||
$synthes.volume = voiceVol
|
||||
function say(msgr) {
|
||||
msg = voiceParse(msgr);
|
||||
var voice = localStorage.getItem("voicebank");
|
||||
@@ -32,8 +36,21 @@ $repeat = setInterval(function () {
|
||||
if (voice) {
|
||||
var obj = JSON.parse(voice);
|
||||
if (obj[0]) {
|
||||
$synthes.text = obj[0];
|
||||
speechSynthesis.speak($synthes);
|
||||
if (localStorage.getItem("voice_bouyomi")) {
|
||||
var delim = "<bouyomi>";
|
||||
var thisVoiceRate = voiceRate * 10 + 70
|
||||
var thisVoicePitch = voicePitch * 50 + 70
|
||||
var thisVoiceVol = voiceVol * 100
|
||||
console.log(thisVoiceRate, thisVoicePitch, thisVoiceVol)
|
||||
var command = 0x0001;
|
||||
var type = 0;
|
||||
var sends = "" + command + delim + thisVoiceRate + delim + thisVoicePitch + delim + thisVoiceVol + delim + type + delim + obj[0];
|
||||
bouyomiConnect(sends)
|
||||
} else {
|
||||
$synthes.text = obj[0];
|
||||
speechSynthesis.speak($synthes);
|
||||
}
|
||||
|
||||
obj.splice(0, 1);
|
||||
var json = JSON.stringify(obj);
|
||||
localStorage.setItem("voicebank", json);
|
||||
@@ -54,14 +71,19 @@ function voiceToggle(tlid) {
|
||||
if (voiceck) {
|
||||
localStorage.removeItem("voice_" + tlid);
|
||||
speechSynthesis.cancel()
|
||||
if (localStorage.getItem("voice_bouyomi")) {
|
||||
var command = 0x0010;
|
||||
var sends = "" + command;
|
||||
bouyomiConnect(sends)
|
||||
}
|
||||
$("#sta-voice-" + tlid).text("Off");
|
||||
$("#sta-voice-" + tlid).css("color", 'red');
|
||||
parseColumn();
|
||||
parseColumn(tlid);
|
||||
} else {
|
||||
localStorage.setItem("voice_" + tlid, "true");
|
||||
$("#sta-voice-" + tlid).text("On");
|
||||
$("#sta-voice-" + tlid).css("color", '#009688');
|
||||
parseColumn();
|
||||
parseColumn(tlid);
|
||||
}
|
||||
}
|
||||
function voiceCheck(tlid) {
|
||||
@@ -78,31 +100,71 @@ function voicePlay() {
|
||||
if (speechSynthesis.speaking) {
|
||||
speechSynthesis.cancel()
|
||||
} else {
|
||||
$synthes.text = $("#voicetxt").val();
|
||||
$synthes.rate = $("#voicespeed").val() / 10;
|
||||
$synthes.pitch = $("#voicepitch").val() / 50;
|
||||
$synthes.volume = $("#voicevol").val() / 100;
|
||||
speechSynthesis.speak($synthes);
|
||||
var text = $("#voicetxt").val();
|
||||
var rate = $("#voicespeed").val();
|
||||
var pitch = $("#voicepitch").val()
|
||||
var vol = $("#voicevol").val()
|
||||
if (localStorage.getItem("voice_bouyomi")) {
|
||||
var delim = "<bouyomi>";
|
||||
rate = rate * 1 + 70
|
||||
pitch = pitch * 1 + 70
|
||||
var command = 0x0001; // コマンドです。0x0001.読み上げ/0x0010.ポーズ/0x0020.再開/0x0030.スキップ
|
||||
/*var speed = 100; // 速度50-200。-1を指定すると本体設定
|
||||
var pitch = 100; // ピッチ50-200。-1を指定すると本体設定
|
||||
var volume = 100; // ボリューム0-100。-1を指定すると本体設定*/
|
||||
var type = 0; // 声質(0.本体設定/1.女性1/2.女性2/3.男性1/4.男性2/5.中性/6.ロボット/7.機械1/8.機械2)
|
||||
var sends = "" + command + delim + rate + delim + pitch + delim + vol + delim + type + delim + text;
|
||||
bouyomiConnect(sends)
|
||||
} else {
|
||||
$synthes.text = text
|
||||
$synthes.rate = rate / 10
|
||||
$synthes.pitch = pitch / 50
|
||||
$synthes.volume = vol / 100;
|
||||
speechSynthesis.speak($synthes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function voiceSettings() {
|
||||
var awk = $("[name=bym]:checked").val();
|
||||
if (awk == "yes") {
|
||||
localStorage.setItem("voice_bouyomi", "yes");
|
||||
M.toast({ html: "Bouyomi Chan connection requires WebSocket Plugin", displayLength: 3000 })
|
||||
} else {
|
||||
localStorage.removeItem("voice_bouyomi");
|
||||
}
|
||||
localStorage.setItem("voice_speed", $("#voicespeed").val() / 10);
|
||||
localStorage.setItem("voice_pitch", $("#voicepitch").val() / 50);
|
||||
localStorage.setItem("voice_vol", $("#voicevol").val() / 100);
|
||||
M.toast({ html: lang.lang_speech_refresh, displayLength: 3000 })
|
||||
}
|
||||
function voiceSettingLoad() {
|
||||
var flag = localStorage.getItem("voice_bouyomi");
|
||||
if (flag) {
|
||||
$("#bym_yes").prop("checked", true);
|
||||
} else {
|
||||
$("#bym_no").prop("checked", true);
|
||||
}
|
||||
var speed = localStorage.getItem("voice_speed");
|
||||
var pitch = localStorage.getItem("voice_pitch");
|
||||
var vol = localStorage.getItem("voice_vol");
|
||||
if (speed) {
|
||||
$("#voicespeed").val(speed * 10);
|
||||
$("#voicespeedVal").text(speed * 10);
|
||||
}
|
||||
if (pitch) {
|
||||
$("#voicepitch").val(pitch * 50);
|
||||
$("#voicepitchVal").text(pitch * 50);
|
||||
}
|
||||
if (vol) {
|
||||
$("#voicevol").val(vol * 100);
|
||||
$("#voicevolVal").text(vol * 100);
|
||||
}
|
||||
}
|
||||
function bouyomiConnect(sends) {
|
||||
var socket = new WebSocket('ws://localhost:50002/');
|
||||
socket.onopen = function () {
|
||||
socket.send(sends);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,17 +1,24 @@
|
||||
//検索
|
||||
//検索ボックストグル
|
||||
function searchMenu() {
|
||||
$("#src-contents").html("");
|
||||
trend();
|
||||
$("#left-menu div").removeClass("active");
|
||||
$("#searchMenu").addClass("active");
|
||||
$(".menu-content").addClass("hide");
|
||||
$("#src-box").removeClass("hide");
|
||||
$('ul.tabs').tabs('select_tab', 'src-sta');
|
||||
$("#src-contents").html("");
|
||||
//$('ul.tabs').tabs('select_tab', 'src-sta');
|
||||
}
|
||||
|
||||
//検索取得
|
||||
function src(mode) {
|
||||
$("#src-contents").html("");
|
||||
function src(mode, offset) {
|
||||
if (!offset) {
|
||||
$("#src-contents").html("");
|
||||
var add = ""
|
||||
} else {
|
||||
var add = "&type=accounts&offset=" + $("#src-accts .cvo").length
|
||||
}
|
||||
|
||||
var q = $("#src").val();
|
||||
var acct_id = $("#src-acct-sel").val();
|
||||
if (acct_id == "tootsearch") {
|
||||
@@ -27,7 +34,7 @@ function src(mode) {
|
||||
var user = $('#his-data').attr("user-id");
|
||||
}
|
||||
if (!mode) {
|
||||
var start = "https://" + domain + "/api/v2/search?q=" + q
|
||||
var start = "https://" + domain + "/api/v2/search?q=" + q + add
|
||||
} else {
|
||||
var start = "https://" + domain + "/api/v1/search?q=" + q
|
||||
}
|
||||
@@ -54,7 +61,7 @@ function src(mode) {
|
||||
tags = tags + '<a onclick="tl(\'tag\',\'' + tag + '\',\'' + acct_id +
|
||||
'\',\'add\')" class="pointer">#' + escapeHTML(tag) + '</a><br> ';
|
||||
} else {
|
||||
tags = tags + graphDraw(tag);
|
||||
tags = tags + graphDraw(tag, acct_id);
|
||||
}
|
||||
|
||||
});
|
||||
@@ -63,12 +70,17 @@ function src(mode) {
|
||||
//トゥート
|
||||
if (json.statuses[0]) {
|
||||
var templete = parse(json.statuses, '', acct_id);
|
||||
$("#src-contents").append("Mentions<br>" + templete);
|
||||
$("#src-contents").append("<br>Mentions<br>" + templete);
|
||||
}
|
||||
//アカウント
|
||||
if (json.accounts[0]) {
|
||||
var templete = userparse(json.accounts, '', acct_id);
|
||||
$("#src-contents").append("Accounts<br>" + templete);
|
||||
if (!offset) {
|
||||
$("#src-contents").append("<br>Accounts<div id=\"src-accts\">" + templete + '</div><a onclick="src(false,\'more\')" class="pointer">more...</a>');
|
||||
} else {
|
||||
$("#src-accts").append(templete)
|
||||
}
|
||||
|
||||
}
|
||||
jQuery("time.timeago").timeago();
|
||||
});
|
||||
@@ -85,7 +97,7 @@ function tsAdd(q) {
|
||||
obj.push(add);
|
||||
var json = JSON.stringify(obj);
|
||||
localStorage.setItem("column", json);
|
||||
parseColumn();
|
||||
parseColumn('add');
|
||||
}
|
||||
function tootsearch(tlid, q) {
|
||||
var start = "https://tootsearch.chotto.moe/api/v1/search?from=0&sort=created_at%3Adesc&q=" + q
|
||||
@@ -164,7 +176,7 @@ function moreTs(tlid, q) {
|
||||
jQuery("time.timeago").timeago();
|
||||
});
|
||||
}
|
||||
function graphDraw(tag) {
|
||||
function graphDraw(tag, acct_id) {
|
||||
var tags = "";
|
||||
var his = tag.history;
|
||||
var max = Math.max.apply(null, [his[0].uses, his[1].uses, his[2].uses, his[3].uses, his[4].uses, his[5].uses, his[6].uses]);
|
||||
@@ -177,12 +189,12 @@ function graphDraw(tag) {
|
||||
var zero = 50 - (his[0].uses / max * 50);
|
||||
if (max === 0) {
|
||||
tags = '<br><br><svg version="1.1" viewbox="0 0 60 50" width="60" height="50">' +
|
||||
'</svg><span style="font-size:200%">' + his[0].uses + '</span>toots <a onclick="tl(\'tag\',\'' + escapeHTML(tag.name) + '\',\'' + acct_id +
|
||||
'</svg><span style="font-size:200%">' + his[0].uses + '</span>toot(s) <a onclick="tl(\'tag\',\'' + escapeHTML(tag.name) + '\',\'' + acct_id +
|
||||
'\',\'add\')" class="pointer">#' + escapeHTML(tag.name) + '</a> ' + his[0].accounts + lang.lang_src_people;
|
||||
} else {
|
||||
tags = '<br><br><svg version="1.1" viewbox="0 0 60 50" width="60" height="50">' +
|
||||
'<g><path d="M0,' + six + ' L10,' + five + ' 20,' + four + ' 30,' + three + ' 40,' + two + ' 50,' + one + ' 60,' + zero + '" style="stroke: #9e9e9e; stroke-width: 1;fill: none;"></path></g>' +
|
||||
'</svg><span style="font-size:200%">' + his[0].uses + '</span>toots <a onclick="tl(\'tag\',\'' + escapeHTML(tag.name) + '\',\'' + acct_id +
|
||||
'</svg><span style="font-size:200%">' + his[0].uses + '</span>toot <a onclick="tl(\'tag\',\'' + escapeHTML(tag.name) + '\',\'' + acct_id +
|
||||
'\',\'add\')" class="pointer">#' + escapeHTML(tag.name) + '</a> ' + his[0].accounts + lang.lang_src_people;
|
||||
}
|
||||
|
||||
@@ -193,3 +205,48 @@ function graphDraw(tag) {
|
||||
<path d="M0,0 L10,0 20,10 20,50" fill="#3F51B5"></path>
|
||||
</svg>
|
||||
*/
|
||||
function trend() {
|
||||
console.log("get trend")
|
||||
$("#src-contents").html("");
|
||||
var acct_id = $("#src-acct-sel").val();
|
||||
if (acct_id == "tootsearch") {
|
||||
return false;
|
||||
}
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/trends"
|
||||
console.log(start)
|
||||
fetch(start, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
'Authorization': 'Bearer ' + at
|
||||
},
|
||||
}).then(function (response) {
|
||||
return response.json();
|
||||
}).catch(function (error) {
|
||||
//todo(error);
|
||||
console.error(error);
|
||||
}).then(function (json) {
|
||||
var tags = "";
|
||||
Object.keys(json).forEach(function (keye) {
|
||||
var tag = json[keye];
|
||||
var his = tag.history;
|
||||
var max = Math.max.apply(null, [his[0].uses, his[1].uses, his[2].uses, his[3].uses, his[4].uses, his[5].uses, his[6].uses]);
|
||||
var six = 50 - (his[6].uses / max * 50);
|
||||
var five = 50 - (his[5].uses / max * 50);
|
||||
var four = 50 - (his[4].uses / max * 50);
|
||||
var three = 50 - (his[3].uses / max * 50);
|
||||
var two = 50 - (his[2].uses / max * 50);
|
||||
var one = 50 - (his[1].uses / max * 50);
|
||||
var zero = 50 - (his[0].uses / max * 50);
|
||||
tags = '<svg version="1.1" viewbox="0 0 60 50" width="60" height="50">' +
|
||||
'<g><path d="M-1,51, -1,' + six + ', 0,' + six + ' L10,' + five + ' 20,' + four + ' 30,' + three + ' 40,' + two + ' 50,' + one + ' 60,' + zero + ' 61,' + zero + ' 61,51 -1,51" style="stroke: #0f8c0c;fill: rgba(13,113,19,.25); stroke-width: 1;"></path></g>' +
|
||||
'</svg><span style="font-size:200%">' + his[0].uses + '</span>toots <a onclick="tl(\'tag\',\'' + tag.name + '\',\'' + acct_id +
|
||||
'\',\'add\')" class="pointer">#' + tag.name + '</a> ' + his[0].accounts + lang.lang_src_people + "<br><br>";
|
||||
|
||||
$("#src-contents").append(tags);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
@@ -10,7 +10,7 @@ if (location.search) {
|
||||
}
|
||||
//よく使うタグ
|
||||
function tagShow(tag) {
|
||||
$("[data-tag=" + decodeURI(tag) + "]").toggleClass("hide");
|
||||
$("[data-tag=" + decodeURI(tag).toLowerCase() + "]").toggleClass("hide");
|
||||
}
|
||||
//タグ追加
|
||||
function tagPin(tag) {
|
||||
@@ -128,3 +128,26 @@ function autoToot(tag) {
|
||||
}
|
||||
favTag();
|
||||
}
|
||||
//タグをフィーチャー
|
||||
function tagFeature(name, acct_id){
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/featured_tags"
|
||||
fetch(start, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
'Authorization': 'Bearer ' + at
|
||||
},
|
||||
body: JSON.stringify({
|
||||
name: name
|
||||
})
|
||||
}).then(function (response) {
|
||||
return response.json();
|
||||
}).catch(function (error) {
|
||||
return false;
|
||||
}).then(function (json) {
|
||||
console.log(json)
|
||||
M.toast({ html: "Complete: " + escapeHTML(name), displayLength: 3000 })
|
||||
});
|
||||
}
|
||||
347
app/js/tl/tl.js
@@ -1,7 +1,9 @@
|
||||
//TL取得
|
||||
moreloading = false;
|
||||
var errorct=0;
|
||||
function tl(type, data, acct_id, tlid, delc, voice, mode) {
|
||||
scrollevent();
|
||||
$("#unread_" + tlid + " .material-icons").removeClass("teal-text")
|
||||
localStorage.removeItem("morelock");
|
||||
localStorage.removeItem("pool");
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
@@ -20,7 +22,7 @@ function tl(type, data, acct_id, tlid, delc, voice, mode) {
|
||||
obj.push(add);
|
||||
var json = JSON.stringify(obj);
|
||||
localStorage.setItem("column", json);
|
||||
parseColumn();
|
||||
parseColumn('add');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -149,6 +151,18 @@ function tl(type, data, acct_id, tlid, delc, voice, mode) {
|
||||
jQuery("time.timeago").timeago();
|
||||
todc();
|
||||
reload(type, '', acct_id, tlid, data, mute, delc, voice);
|
||||
if (type == "home" || type == "notf") {
|
||||
//Markers
|
||||
var markers = localStorage.getItem("markers");
|
||||
if (markers == "yes") {
|
||||
markers = true;
|
||||
} else {
|
||||
markers = false
|
||||
}
|
||||
if (markers) {
|
||||
getMarker(tlid, type, acct_id)
|
||||
}
|
||||
}
|
||||
$(window).scrollTop(0);
|
||||
});
|
||||
}
|
||||
@@ -217,7 +231,8 @@ function reload(type, cc, acct_id, tlid, data, mute, delc, voice, mode) {
|
||||
websocket[wsid] = new WebSocket(start);
|
||||
websocket[wsid].onopen = function (mess) {
|
||||
console.table({ "tlid": tlid, "type": "Connect Streaming API" + type, "domain": domain, "message": [mess] })
|
||||
$("#notice_icon_" + tlid).removeClass("red-text");
|
||||
errorct=0
|
||||
$("#notice_icon_" + tlid).removeClass("red-text")
|
||||
}
|
||||
websocket[wsid].onmessage = function (mess) {
|
||||
console.log([tlid + ":Receive Streaming API:", JSON.parse(mess.data)]);
|
||||
@@ -256,37 +271,40 @@ function reload(type, cc, acct_id, tlid, data, mute, delc, voice, mode) {
|
||||
$("#timeline_" + tlid + " [toot-id=" + JSON.parse(mess.data).payload + "]").addClass("emphasized");
|
||||
$("#timeline_" + tlid + " [toot-id=" + JSON.parse(mess.data).payload + "]").addClass("by_delcatch");
|
||||
} else {
|
||||
$("[toot-id=" + JSON.parse(mess.data).payload + "]").hide();
|
||||
$("[toot-id=" + JSON.parse(mess.data).payload + "]").remove();
|
||||
$("[toot-id=" + JSON.parse(mess.data).payload + "]").hide()
|
||||
$("[toot-id=" + JSON.parse(mess.data).payload + "]").remove()
|
||||
}
|
||||
|
||||
} else if (typeA == "update" || typeA == "conversation") {
|
||||
localStorage.removeItem("delete");
|
||||
var obj = JSON.parse(JSON.parse(mess.data).payload);
|
||||
if ($("#timeline_" + tlid + " [toot-id=" + obj.id + "]").length < 1) {
|
||||
if (voice) {
|
||||
say(obj.content)
|
||||
}
|
||||
var templete = parse([obj], type, acct_id, tlid, "", mute, type);
|
||||
if ($("timeline_box_" + tlid + "_box .tl-box").scrollTop() === 0) {
|
||||
$("#timeline_" + tlid).prepend(templete);
|
||||
} else {
|
||||
var pool = localStorage.getItem("pool_" + tlid);
|
||||
if (pool) {
|
||||
pool = templete + pool;
|
||||
} else {
|
||||
pool = templete
|
||||
localStorage.removeItem("delete")
|
||||
if (!$("#unread_" + tlid + " .material-icons").hasClass("teal-text")) {
|
||||
//markers show中はダメ
|
||||
var obj = JSON.parse(JSON.parse(mess.data).payload);
|
||||
if ($("#timeline_" + tlid + " [toot-id=" + obj.id + "]").length < 1) {
|
||||
if (voice) {
|
||||
say(obj.content)
|
||||
}
|
||||
localStorage.setItem("pool_" + tlid, pool);
|
||||
var templete = parse([obj], type, acct_id, tlid, "", mute, type);
|
||||
if ($("timeline_box_" + tlid + "_box .tl-box").scrollTop() === 0) {
|
||||
$("#timeline_" + tlid).prepend(templete);
|
||||
} else {
|
||||
var pool = localStorage.getItem("pool_" + tlid);
|
||||
if (pool) {
|
||||
pool = templete + pool;
|
||||
} else {
|
||||
pool = templete
|
||||
}
|
||||
localStorage.setItem("pool_" + tlid, pool);
|
||||
}
|
||||
scrollck();
|
||||
additional(acct_id, tlid);
|
||||
jQuery("time.timeago").timeago();
|
||||
} else {
|
||||
todo("二重取得発生中");
|
||||
}
|
||||
scrollck();
|
||||
additional(acct_id, tlid);
|
||||
jQuery("time.timeago").timeago();
|
||||
} else {
|
||||
todo("二重取得発生中");
|
||||
}
|
||||
|
||||
todc();
|
||||
todc();
|
||||
}
|
||||
} else if (typeA == "filters_changed") {
|
||||
filterUpdate(acct_id);
|
||||
}
|
||||
@@ -298,11 +316,11 @@ function reload(type, cc, acct_id, tlid, data, mute, delc, voice, mode) {
|
||||
console.error("Error closing");
|
||||
console.error(error);
|
||||
if (mode == "error") {
|
||||
$("#notice_icon_" + tlid).addClass("red-text");
|
||||
$("#notice_icon_" + tlid).addClass("red-text")
|
||||
todo('WebSocket Error ' + error);
|
||||
} else {
|
||||
var errorct = localStorage.getItem("wserror_" + tlid) * 1 + 1;
|
||||
localStorage.setItem("wserror_" + tlid, errorct);
|
||||
errorct++;
|
||||
console.log(errorct)
|
||||
if (errorct < 3) {
|
||||
reconnector(tlid, type, acct_id, data, "error");
|
||||
}
|
||||
@@ -312,11 +330,11 @@ function reload(type, cc, acct_id, tlid, data, mute, delc, voice, mode) {
|
||||
websocket[wsid].onclose = function () {
|
||||
console.warn("Closing " + tlid);
|
||||
if (mode == "error") {
|
||||
$("#notice_icon_" + tlid).addClass("red-text");
|
||||
$("#notice_icon_" + tlid).addClass("red-text")
|
||||
todo('WebSocket Closed');
|
||||
} else {
|
||||
var errorct = localStorage.getItem("wserror_" + tlid) * 1 + 1;
|
||||
localStorage.setItem("wserror_" + tlid, errorct);
|
||||
errorct++;
|
||||
console.log(errorct)
|
||||
if (errorct < 3) {
|
||||
reconnector(tlid, type, acct_id, data, "error");
|
||||
}
|
||||
@@ -425,6 +443,11 @@ function moreload(type, tlid) {
|
||||
todo(error);
|
||||
console.error(error);
|
||||
}).then(function (json) {
|
||||
if (localStorage.getItem("filter_" + acct_id) != "undefined") {
|
||||
var mute = getFilterType(JSON.parse(localStorage.getItem("filter_" + acct_id)), type);
|
||||
} else {
|
||||
var mute = [];
|
||||
}
|
||||
if (misskey) {
|
||||
var templete = misskeyParse(json, '', acct_id, tlid, "", mute);
|
||||
} else {
|
||||
@@ -770,7 +793,6 @@ function strAlive() {
|
||||
var type = obj[key].type;
|
||||
var acct_id = obj[key].domain;
|
||||
var data = obj[key].data;
|
||||
localStorage.removeItem("wserror_" + tlid)
|
||||
reconnector(key, type, acct_id, data, "error");
|
||||
}
|
||||
});
|
||||
@@ -819,4 +841,261 @@ function reconnector(tlid, type, acct_id, data, mode) {
|
||||
M.toast({ html: lang.lang_tl_reconnect, displayLength: 2000 })
|
||||
|
||||
}
|
||||
function columnReload(tlid, type) {
|
||||
$("#notice_icon_" + tlid).addClass("red-text");
|
||||
$("#unread_" + tlid + " .material-icons").removeClass("teal-text")
|
||||
if (type == "mix" || type == "integrated" || type == "plus") {
|
||||
if (localStorage.getItem("voice_" + tlid)) {
|
||||
var voice = true;
|
||||
} else {
|
||||
var voice = false;
|
||||
}
|
||||
if (localStorage.getItem("filter_" + acct_id) != "undefined") {
|
||||
var mute = getFilterType(JSON.parse(localStorage.getItem("filter_" + acct_id)), type);
|
||||
} else {
|
||||
var mute = [];
|
||||
}
|
||||
var wssh = localStorage.getItem("wssH_" + tlid);
|
||||
websocketHome[wssh].close();
|
||||
var wssl = localStorage.getItem("wssL_" + tlid);
|
||||
websocketLocal[wssl].close();
|
||||
parseColumn(tlid)
|
||||
} else if (type == "notf") {
|
||||
$("#notice_icon_" + tlid).removeClass("red-text");
|
||||
notfColumn(acct_id, tlid, "")
|
||||
} else {
|
||||
var wss = localStorage.getItem("wss_" + tlid);
|
||||
websocket[wss].close();
|
||||
if (localStorage.getItem("voice_" + tlid)) {
|
||||
var voice = true;
|
||||
} else {
|
||||
var voice = false;
|
||||
}
|
||||
if (localStorage.getItem("filter_" + acct_id) != "undefined") {
|
||||
var mute = getFilterType(JSON.parse(localStorage.getItem("filter_" + acct_id)), type);
|
||||
} else {
|
||||
var mute = [];
|
||||
}
|
||||
parseColumn(tlid)
|
||||
}
|
||||
}
|
||||
strAliveInt()
|
||||
//Markers
|
||||
function getMarker(tlid, type, acct_id) {
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
if (type == "home") {
|
||||
var add = "home"
|
||||
} else if (type == "notf") {
|
||||
var add = "notifications"
|
||||
}
|
||||
var start = "https://" + domain + "/api/v1/markers?timeline=" + add
|
||||
fetch(start, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
'Authorization': 'Bearer ' + at
|
||||
},
|
||||
}).then(function (response) {
|
||||
return response.json();
|
||||
}).catch(function (error) {
|
||||
$("#unread_" + tlid).attr("title", lang.lang_layout_unread + ":" + lang.lang_nothing)
|
||||
$("#unread_" + tlid).attr("data-id", "")
|
||||
return false;
|
||||
}).then(function (json) {
|
||||
if (json) {
|
||||
if (json[add]) {
|
||||
json = json[add]
|
||||
$("#unread_" + tlid).attr("title", lang.lang_layout_unread + ":" + json.updated_at + ' v' + json.version)
|
||||
$("#unread_" + tlid).attr("data-id", json.last_read_id)
|
||||
} else {
|
||||
$("#unread_" + tlid).attr("title", lang.lang_layout_unread + ":" + lang.lang_nothing)
|
||||
$("#unread_" + tlid).attr("data-id", "")
|
||||
}
|
||||
} else {
|
||||
$("#unread_" + tlid).attr("title", lang.lang_layout_unread + ":" + lang.lang_nothing)
|
||||
$("#unread_" + tlid).attr("data-id", "")
|
||||
}
|
||||
});
|
||||
}
|
||||
function showUnread(tlid, type, acct_id) {
|
||||
if ($("#unread_" + tlid + " .material-icons").hasClass("teal-text")) {
|
||||
goTop(tlid)
|
||||
return
|
||||
}
|
||||
$("#unread_" + tlid + " .material-icons").addClass("teal-text")
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var id = $("#unread_" + tlid).attr("data-id")
|
||||
if (type == "home") {
|
||||
var add = "timelines/home?min_id=" + id
|
||||
} else if (type == "notf") {
|
||||
var add = "notifications?min_id=" + id
|
||||
}
|
||||
var start = "https://" + domain + "/api/v1/" + add
|
||||
fetch(start, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
'Authorization': 'Bearer ' + at
|
||||
},
|
||||
}).then(function (response) {
|
||||
return response.json();
|
||||
}).catch(function (error) {
|
||||
todo(error);
|
||||
console.error(error);
|
||||
}).then(function (json) {
|
||||
if (!json || !json.length) {
|
||||
columnReload(tlid, type)
|
||||
}
|
||||
if (localStorage.getItem("filter_" + acct_id) != "undefined") {
|
||||
var mute = getFilterType(JSON.parse(localStorage.getItem("filter_" + acct_id)), type);
|
||||
} else {
|
||||
var mute = [];
|
||||
}
|
||||
var templete = parse(json, type, acct_id, tlid, "", mute, type);
|
||||
var len = json.length - 1
|
||||
$("#timeline_" + tlid).html(templete);
|
||||
if ($("#timeline_" + tlid + " .cvo:eq(" + len + ")").length) {
|
||||
var to = $("#timeline_" + tlid + " .cvo:eq(" + len + ")").offset().top
|
||||
$("#timeline_box_" + tlid + "_box .tl-box").scrollTop(to)
|
||||
}
|
||||
additional(acct_id, tlid);
|
||||
jQuery("time.timeago").timeago();
|
||||
todc();
|
||||
});
|
||||
}
|
||||
var ueloadlock = false
|
||||
function ueload(tlid) {
|
||||
if (ueloadlock) {
|
||||
return false
|
||||
}
|
||||
ueloadlock = true
|
||||
var multi = localStorage.getItem("column")
|
||||
var obj = JSON.parse(multi)
|
||||
var acct_id = obj[tlid * 1].domain
|
||||
var type = obj[tlid * 1].type
|
||||
var domain = localStorage.getItem("domain_" + acct_id)
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at")
|
||||
var id = $("#timeline_" + tlid + " .cvo:eq(0)").attr("unique-id")
|
||||
if (type == "home") {
|
||||
var add = "timelines/home?min_id=" + id
|
||||
} else if (type == "notf") {
|
||||
var add = "notifications?min_id=" + id
|
||||
}
|
||||
var start = "https://" + domain + "/api/v1/" + add
|
||||
fetch(start, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
'Authorization': 'Bearer ' + at
|
||||
},
|
||||
}).then(function (response) {
|
||||
return response.json();
|
||||
}).catch(function (error) {
|
||||
todo(error);
|
||||
console.error(error);
|
||||
}).then(function (json) {
|
||||
if (!json) {
|
||||
columnReload(tlid, type)
|
||||
}
|
||||
if (localStorage.getItem("filter_" + acct_id) != "undefined") {
|
||||
var mute = getFilterType(JSON.parse(localStorage.getItem("filter_" + acct_id)), type)
|
||||
} else {
|
||||
var mute = []
|
||||
}
|
||||
var templete = parse(json, '', acct_id, tlid, "", mute, type)
|
||||
var len = json.length - 1
|
||||
$("#timeline_" + tlid).prepend(templete)
|
||||
if ($("#timeline_" + tlid + " .cvo:eq(" + len + ")").length) {
|
||||
var to = $("#timeline_" + tlid + " .cvo:eq(" + len + ")").offset().top
|
||||
$("#timeline_box_" + tlid + "_box .tl-box").scrollTop(to)
|
||||
}
|
||||
additional(acct_id, tlid)
|
||||
jQuery("time.timeago").timeago()
|
||||
todc()
|
||||
ueloadlock = false
|
||||
});
|
||||
}
|
||||
function asRead(callback) {
|
||||
//Markers
|
||||
var markers = localStorage.getItem("markers");
|
||||
if (markers == "no") {
|
||||
markers = false;
|
||||
} else {
|
||||
markers = true
|
||||
}
|
||||
if (markers) {
|
||||
var multi = localStorage.getItem("column")
|
||||
var obj = JSON.parse(multi)
|
||||
var obl = obj.length
|
||||
ct = 0
|
||||
for (var i = 0; i < obl; i++) {
|
||||
var acct_id = obj[i].domain
|
||||
var type = obj[i].type
|
||||
if (type == "home" || type == "notf") {
|
||||
if (type == "home") {
|
||||
var id = $("#timeline_" + i + " .cvo:eq(0)").attr("unique-id")
|
||||
var poster = {
|
||||
home: {
|
||||
last_read_id: id
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var id = $("#timeline_" + i + " .cvo:eq(0)").attr("data-notf")
|
||||
var poster = {
|
||||
notifications: {
|
||||
last_read_id: id
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var domain = localStorage.getItem("domain_" + acct_id)
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at")
|
||||
var httpreq = new XMLHttpRequest()
|
||||
var start = "https://" + domain + "/api/v1/markers"
|
||||
httpreq.open('POST', start, true)
|
||||
httpreq.setRequestHeader('Content-Type', 'application/json')
|
||||
httpreq.setRequestHeader('Authorization', 'Bearer ' + at)
|
||||
httpreq.responseType = "json"
|
||||
httpreq.send(JSON.stringify(poster))
|
||||
httpreq.onreadystatechange = function () {
|
||||
if (httpreq.readyState === 4) {
|
||||
var json = httpreq.response
|
||||
console.log(json)
|
||||
ct++
|
||||
if (ct == obl && callback) {
|
||||
postMessage(["asReadComp", ""], "*")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function asReadEnd() {
|
||||
//Markers
|
||||
var markers = localStorage.getItem("markers");
|
||||
if (markers == "no") {
|
||||
markers = false;
|
||||
} else {
|
||||
markers = true
|
||||
}
|
||||
if (markers) {
|
||||
asRead(true)
|
||||
Swal.fire({
|
||||
title: lang.lang_tl_postmarkers_title,
|
||||
html: lang.lang_tl_postmarkers,
|
||||
timer: 3000,
|
||||
onBeforeOpen: () => {
|
||||
Swal.showLoading()
|
||||
},
|
||||
onClose: () => {
|
||||
}
|
||||
}).then((result) => {
|
||||
|
||||
})
|
||||
} else {
|
||||
postMessage(["asReadComp", ""], "*")
|
||||
}
|
||||
}
|
||||
@@ -282,3 +282,6 @@ function dlImg() {
|
||||
function openFinder(dir) {
|
||||
postMessage(["openFinder", dir], "*")
|
||||
}
|
||||
function stopVideo(){
|
||||
document.getElementById('video').pause()
|
||||
}
|
||||
13
app/js/ui/jquery-ui.min.js
vendored
@@ -20,7 +20,11 @@ $('.type').click(function () {
|
||||
$("#type-sel").val($(this).attr("data-type"))
|
||||
})
|
||||
//最初、カラム変更時に発火
|
||||
function parseColumn(dontclose) {
|
||||
function parseColumn(target, dontclose) {
|
||||
if (target === 0) {
|
||||
//this is kuso
|
||||
target = "zero"
|
||||
}
|
||||
console.log("%c Parse column", "color:red;font-size:125%");
|
||||
var size = localStorage.getItem("size");
|
||||
if (size) {
|
||||
@@ -31,7 +35,7 @@ function parseColumn(dontclose) {
|
||||
if (localStorage.getItem("menu-done")) {
|
||||
$("#fukidashi").addClass("hide")
|
||||
}
|
||||
if (!dontclose) {
|
||||
if (!dontclose && !target) {
|
||||
tlCloser();
|
||||
}
|
||||
|
||||
@@ -42,6 +46,7 @@ function parseColumn(dontclose) {
|
||||
var templete;
|
||||
Object.keys(obj).forEach(function (key) {
|
||||
var acct = obj[key];
|
||||
|
||||
localStorage.setItem("name_" + key, acct.name);
|
||||
localStorage.setItem("user_" + key, acct.user);
|
||||
localStorage.setItem("user-id_" + key, acct.id);
|
||||
@@ -55,8 +60,9 @@ function parseColumn(dontclose) {
|
||||
var domain = localStorage.getItem("domain_" + key);
|
||||
if (localStorage.getItem("mode_" + domain) == "misskey") {
|
||||
localStorage.removeItem("misskey_wss_" + key)
|
||||
connectMisskey(key)
|
||||
connectMisskey(key, false)
|
||||
}
|
||||
localStorage.removeItem("emoji_" + key) //カスタム絵文字カテゴリ分け用旧データ削除
|
||||
});
|
||||
}
|
||||
var acctlist = obj;
|
||||
@@ -76,13 +82,37 @@ function parseColumn(dontclose) {
|
||||
} else {
|
||||
var obj = JSON.parse(col);
|
||||
}
|
||||
if ($("#timeline-container").length) {
|
||||
$("#timeline-container").html("");
|
||||
var numtarget = false
|
||||
if (target == "add") {
|
||||
var tlidtar = obj.length - 1
|
||||
obj = [obj[tlidtar]]
|
||||
} else if (target) {
|
||||
var tlidtar = target
|
||||
if (target == "zero") {
|
||||
target = 0
|
||||
}
|
||||
obj = [obj[target]]
|
||||
numtarget = true
|
||||
} else {
|
||||
var tlidtar = null
|
||||
if ($("#timeline-container").length) {
|
||||
$("#timeline-container").html("");
|
||||
$(".box, .boxIn").resizable("destroy");
|
||||
}
|
||||
}
|
||||
var basekey = 0;
|
||||
for (var key = 0; key < obj.length; key++) {
|
||||
var next = key + 1;
|
||||
//acctって言いながらタイムライン
|
||||
var acct = obj[key];
|
||||
if (tlidtar) {
|
||||
if (tlidtar == "zero") {
|
||||
key = 0
|
||||
} else {
|
||||
key = tlidtar
|
||||
}
|
||||
|
||||
}
|
||||
if (acct.type == "notf") {
|
||||
var notf_attr = ' data-notf=' + acct.domain;
|
||||
var if_notf = "hide";
|
||||
@@ -128,6 +158,16 @@ function parseColumn(dontclose) {
|
||||
} else {
|
||||
localStorage.removeItem("hasNotfC_" + acct.domain);
|
||||
}
|
||||
var width = localStorage.getItem("width");
|
||||
if (width) {
|
||||
var css = " min-width:" + width + "px;"
|
||||
}
|
||||
if(acct.width){
|
||||
var css = " min-width:" + acct.width + "px;max-width:" + acct.width + "px;"
|
||||
}
|
||||
if(!css){
|
||||
var css = ""
|
||||
}
|
||||
if (acct.type == "webview") {
|
||||
if (localStorage.getItem("fixwidth")) {
|
||||
var fixwidth = localStorage.getItem("fixwidth");
|
||||
@@ -141,10 +181,7 @@ function parseColumn(dontclose) {
|
||||
if (!acct.left_fold) {
|
||||
basekey = key;
|
||||
}
|
||||
var width = localStorage.getItem("width");
|
||||
if (width) {
|
||||
var css = " min-width:" + width + "px;"
|
||||
}
|
||||
|
||||
var anime = localStorage.getItem("animation");
|
||||
if (anime == "yes" || !anime) {
|
||||
var animecss = "box-anime";
|
||||
@@ -153,38 +190,49 @@ function parseColumn(dontclose) {
|
||||
}
|
||||
unstreamingTL(acct.type, key, basekey, insert, icnsert, acct.left_fold, css, animecss, acct.data);
|
||||
} else {
|
||||
var width = localStorage.getItem("width");
|
||||
if (width) {
|
||||
var css = " min-width:" + width + "px;"
|
||||
}
|
||||
var anime = localStorage.getItem("animation");
|
||||
if (anime == "yes" || !anime) {
|
||||
var animecss = "box-anime";
|
||||
} else {
|
||||
var animecss = "";
|
||||
}
|
||||
var unread = '<a id="unread_' + key + '" onclick="showUnread(' + key + ',\'' + acct.type + '\',\'' + acct.domain + '\')" class="setting nex" title="' + lang.lang_layout_unread + '"><i class="material-icons waves-effect nex">more</i></a>'
|
||||
if (acct.type == "notf") {
|
||||
var exclude = lang.lang_excluded + ':<br><input type="checkbox" class="filled-in" id="exc-reply-' + key + '" ' + excludeCk(key, "mention") + ' /><label for="exc-reply-' + key + '" class="exc-chb"><i class="fas fa-share exc-icons"></i></label> ' +
|
||||
'<input type="checkbox" class="filled-in" id="exc-fav-' + key + '" ' + excludeCk(key, "favourite") + ' /><label for="exc-fav-' + key + '" class="exc-chb"><i class="fas fa-star exc-icons"></i></label> ' +
|
||||
'<input type="checkbox" class="filled-in" id="exc-bt-' + key + '" ' + excludeCk(key, "reblog") + ' /><label for="exc-bt-' + key + '" class="exc-chb" ><i class="fas fa-retweet exc-icons"></i></label> ' +
|
||||
'<input type="checkbox" class="filled-in" id="exc-follow-' + key + '" ' + excludeCk(key, "follow") + ' /><label for="exc-follow-' + key + '" class="exc-chb" ><i class="fas fa-users exc-icons"></i></label> ' +
|
||||
'<input type="checkbox" class="filled-in" id="exc-poll-' + key + '" ' + excludeCk(key, "poll") + ' /><label for="exc-poll-' + key + '" class="exc-chb" ><i class="fas fa-tasks exc-icons"></i></label> ' +
|
||||
var exclude = lang.lang_excluded + ':<br><label><input type="checkbox" class="filled-in" id="exc-reply-' + key + '" ' + excludeCk(key, "mention") + ' /><span><i class="fas fa-share exc-icons"></i></span></label> ' +
|
||||
'<label><input type="checkbox" class="filled-in" id="exc-fav-' + key + '" ' + excludeCk(key, "favourite") + ' /><span><i class="fas fa-star exc-icons"></i></span></label> ' +
|
||||
'<label><input type="checkbox" class="filled-in" id="exc-bt-' + key + '" ' + excludeCk(key, "reblog") + ' /><span><i class="fas fa-retweet exc-icons"></i></span></label> ' +
|
||||
'<label><input type="checkbox" class="filled-in" id="exc-follow-' + key + '" ' + excludeCk(key, "follow") + ' /><span><i class="fas fa-users exc-icons"></i></span></label> ' +
|
||||
'<label><input type="checkbox" class="filled-in" id="exc-poll-' + key + '" ' + excludeCk(key, "poll") + ' /><span><i class="fas fa-tasks exc-icons"></i></span></label> ' +
|
||||
'<button class="btn waves-effect" style="width:60px; padding:0;" onclick="exclude(' + key + ')">Filter</button>';
|
||||
if (checkNotfFilter(key)) {
|
||||
exclude = exclude + '<button class="btn red waves-effect" style="width:60px; padding:0;" onclick="resetNotfFilter(' + key + ')">Clear all</button>'
|
||||
}
|
||||
exclude = exclude + "<br>";
|
||||
|
||||
} else if (acct.type == "home") {
|
||||
var exclude = '<a onclick="ebtToggle(' + key +
|
||||
')" class="setting nex"><i class="fas fa-retweet waves-effect nex" title="' + lang.lang_layout_excludingbt + '" style="font-size:24px"></i><span id="sta-bt-' +
|
||||
key + '">Off</span></a>' + lang.lang_layout_excludingbt + '<br>';
|
||||
|
||||
} else {
|
||||
var exclude = "";
|
||||
unread = ""
|
||||
}
|
||||
var markers = localStorage.getItem("markers");
|
||||
if (markers == "yes") {
|
||||
markers = true;
|
||||
} else {
|
||||
markers = false
|
||||
}
|
||||
if (!markers) {
|
||||
unread = ""
|
||||
}
|
||||
if (!acct.left_fold) {
|
||||
basekey = key;
|
||||
var basehtml = '<div style="' + css + '" class="box ' + animecss + '" id="timeline_box_' + basekey + '_parentBox"></div>';
|
||||
$("#timeline-container").append(basehtml);
|
||||
if (!numtarget) {
|
||||
var basehtml = '<div style="' + css + '" class="box ' + animecss + '" id="timeline_box_' + basekey + '_parentBox"></div>';
|
||||
$("#timeline-container").append(basehtml);
|
||||
}
|
||||
var left_hold = '<a onclick="leftFoldSet(' + key + ')" class="setting nex"><i class="material-icons waves-effect nex" title="' + lang.lang_layout_leftFold + '">view_agenda</i></a>' + lang.lang_layout_leftFold + '</span><br>';
|
||||
} else {
|
||||
var left_hold = '<a onclick="leftFoldRemove(' + key + ')" class="setting nex"><i class="material-icons waves-effect nex" title="' + lang.lang_layout_leftUnfold + '">view_column</i></a>' + lang.lang_layout_leftUnfold + '</span><br>';
|
||||
@@ -200,13 +248,18 @@ function parseColumn(dontclose) {
|
||||
var isMisRed = "red-text"
|
||||
var if_misskey_hide = ""
|
||||
}
|
||||
if(acct.height){
|
||||
var addHeight = " min-height:" + acct.height + "px;max-height:" + acct.height + "px;"
|
||||
}else {
|
||||
var addHeight = ""
|
||||
}
|
||||
var html = '<div class="boxIn" id="timeline_box_' + key + '_box" tlid="' + key +
|
||||
'" data-acct="' + acct.domain + '"><div class="notice-box z-depth-2" id="menu_' + key + '" style="' + insert + ' ">' +
|
||||
'" data-acct="' + acct.domain + '" style="' + addHeight + '"><div class="notice-box z-depth-2" id="menu_' + key + '" style="' + insert + ' ">' +
|
||||
'<div class="area-notice"><i class="material-icons waves-effect ' + isMisRed + '" id="notice_icon_' + key + '"' + notf_attr + ' style="font-size:40px; padding-top:25%;" onclick="checkStr(\'' + acct.type + '\', \'' + data + '\', \'' + acct.domain + '\', \'' + key + '\', \'' + delc + '\',\'' + voice + '\',null)" title="' + lang.lang_layout_gotop + '"></i></div>' +
|
||||
'<div class="area-notice_name"><span id="notice_' + key + '" class="tl-title"></span></div>' +
|
||||
'<div class="area-a1"><a onclick="notfToggle(' + acct.domain + ',' + key +
|
||||
')" class="setting nex ' + if_notf + '" title="' + unique_notf + '"' + icnsert + '><i class="material-icons waves-effect nex notf-icon_' +
|
||||
acct.domain + '">notifications</i></div><div class="area-sta"><span class="new badge teal notf-reply_' + acct.domain + ' hide" data-badge-caption="Reply">0</span><span class="new badge yellow black-text notf-fav_' + acct.domain + ' hide" data-badge-caption="Fav">0</span><span class="new badge blue notf-bt_' + acct.domain + ' hide" data-badge-caption="BT">0</span><span class="new badge orange notf-follow_' + acct.domain + ' hide" data-badge-caption="Follow">0</span></a></div>' +
|
||||
acct.domain + '">notifications</i></a>' + unread + '</div><div class="area-sta"><span class="new badge teal notf-reply_' + acct.domain + ' hide" data-badge-caption="Reply">0</span><span class="new badge yellow black-text notf-fav_' + acct.domain + ' hide" data-badge-caption="Fav">0</span><span class="new badge blue notf-bt_' + acct.domain + ' hide" data-badge-caption="BT">0</span><span class="new badge orange notf-follow_' + acct.domain + ' hide" data-badge-caption="Follow">0</span></div>' +
|
||||
'<div class="area-a2"><a onclick="removeColumn(' + key +
|
||||
')" class="setting nex"><i class="material-icons waves-effect nex" title="' + lang.lang_layout_delthis + '"' + icnsert + '>cancel</i></a></div>' +
|
||||
'<div class="area-a3"><a onclick="setToggle(' + key +
|
||||
@@ -218,12 +271,16 @@ function parseColumn(dontclose) {
|
||||
')" class="setting nex"><i class="material-icons waves-effect nex" title="' + lang.lang_layout_mediafil + '">perm_media</i><span id="sta-media-' +
|
||||
key + '">On</span></a>' + lang.lang_layout_mediafil + '<br><a onclick="cardToggle(' + key +
|
||||
')" class="setting nex"><i class="material-icons waves-effect nex" title="' + lang.lang_layout_linkanades + '">link</i><span id="sta-card-' +
|
||||
key + '">On</span></a>' + lang.lang_layout_linkana + '<br><a onclick="voiceToggle(' + key +
|
||||
')" class="setting nex"><i class="material-icons waves-effect nex" title="' + lang.lang_layout_tts + '">hearing</i><span id="sta-voice-' +
|
||||
key + '">On</span></a>' + lang.lang_layout_tts + 'TL<br><a onclick="reconnector(' + key +
|
||||
',\'' + acct.type + '\',\'' + acct.domain + '\',\'' + escapeHTML(acct.data) + '\')" class="setting nex ' + if_notf + ' ' + if_misskey_hide + '"><i class="material-icons waves-effect nex ' + if_notf + '" title="' + lang.lang_layout_reconnect + '">low_priority</i></a><span class="' + if_notf + '">' + lang.lang_layout_reconnect + '</span><br>' + lang.lang_layout_headercolor + '<br><div id="picker_' + key + '" class="color-picker"></div></div><div class="tl-box" tlid="' + key + '"><div id="timeline_' + key +
|
||||
key + '">On</span></a>' + lang.lang_layout_linkana + '<br><a onclick="voiceToggle(\'' + key +
|
||||
'\')" class="setting nex"><i class="material-icons waves-effect nex" title="' + lang.lang_layout_tts + '">hearing</i><span id="sta-voice-' + key + '">' +
|
||||
'">On</span></a>' + lang.lang_layout_tts + 'TL<br><a onclick="columnReload(' + key +
|
||||
',\'' + acct.type + '\')" class="setting nex ' + if_misskey_hide + '"><i class="material-icons waves-effect nex" title="' + lang.lang_layout_reconnect + '">refresh</i></a><span>' + lang.lang_layout_reconnect + '</span><br>' + lang.lang_layout_headercolor + '<br><div id="picker_' + key + '" class="color-picker"></div></div><div class="tl-box" tlid="' + key + '"><div id="timeline_' + key +
|
||||
'" class="tl ' + acct.type + '-timeline " tlid="' + key + '" data-type="' + acct.type + '" data-acct="' + acct.domain + '" data-const="' + acct.type + '_' + acct.domain + '"><div id="landing_' + key + '" style="text-align:center">' + lang.lang_layout_nodata + '</div></div></div>'
|
||||
$('#timeline_box_' + basekey + '_parentBox').append(html);
|
||||
if (numtarget) {
|
||||
$('timeline_box_' + key + '_box').html(html)
|
||||
} else {
|
||||
$('#timeline_box_' + basekey + '_parentBox').append(html)
|
||||
}
|
||||
localStorage.removeItem("pool_" + key);
|
||||
if (acct.data) {
|
||||
var data = acct.data;
|
||||
@@ -247,6 +304,7 @@ function parseColumn(dontclose) {
|
||||
mediaCheck(key);
|
||||
catchCheck(key);
|
||||
voiceCheck(key);
|
||||
var css = ""
|
||||
}
|
||||
}
|
||||
var box = localStorage.getItem("box");
|
||||
@@ -257,6 +315,7 @@ function parseColumn(dontclose) {
|
||||
$("#bottom").removeClass("reverse");
|
||||
$(".leftside").removeClass("reverse");
|
||||
}
|
||||
$("#bottom").removeClass("hide");
|
||||
if (localStorage.getItem("sec") && localStorage.getItem("sec") != "nothing") {
|
||||
secvis(localStorage.getItem("sec"));
|
||||
}
|
||||
@@ -273,6 +332,40 @@ function parseColumn(dontclose) {
|
||||
}
|
||||
}
|
||||
}
|
||||
$(".box, .boxIn").resizable({
|
||||
minHeight: 50,
|
||||
minWidth: 50,
|
||||
grid: 50,
|
||||
resize: function (event, ui) {
|
||||
$(this).css("min-width", ui.size.width + "px")
|
||||
$(this).css("max-width", ui.size.width + "px")
|
||||
$(this).css("min-height", ui.size.height + "px")
|
||||
$(this).css("max-height", ui.size.height + "px")
|
||||
},
|
||||
stop: function (event, ui) {
|
||||
var col = localStorage.getItem("column");
|
||||
var o = JSON.parse(col);
|
||||
var width = ui.size.width
|
||||
var height = ui.size.height
|
||||
if ($(this).hasClass("boxIn")) {
|
||||
//縦幅。その縦幅を持つカラムのidは
|
||||
console.log("tate")
|
||||
var key = $(this).attr("tlid")
|
||||
var obj = o[key];
|
||||
obj.height = height;
|
||||
o[key] = obj;
|
||||
} else {
|
||||
//横幅。その縦幅を持つカラムのidは
|
||||
console.log("yoko")
|
||||
var key = $(this).find(".boxIn").attr("tlid")
|
||||
var obj = o[key];
|
||||
obj.width = width;
|
||||
o[key] = obj;
|
||||
}
|
||||
var json = JSON.stringify(o);
|
||||
localStorage.setItem("column", json);
|
||||
}
|
||||
});
|
||||
}
|
||||
function checkStr(type, data, acct_id, key, delc, voice) {
|
||||
if ($('#notice_icon_' + key).hasClass("red-text") && type != "notf" && type != "mix") {
|
||||
@@ -336,7 +429,7 @@ function addColumn() {
|
||||
localStorage.setItem("column", json);
|
||||
}
|
||||
|
||||
parseColumn();
|
||||
parseColumn('add');
|
||||
}
|
||||
function addselCk() {
|
||||
var acct = $("#add-acct-sel").val();
|
||||
@@ -364,8 +457,28 @@ function addselCk() {
|
||||
function removeColumn(tlid) {
|
||||
$("#sort-box").addClass("hide");
|
||||
$("#sort-box").removeClass("show");
|
||||
//聞く
|
||||
postMessage(["columnDel", tlid], "*")
|
||||
Swal.fire({
|
||||
title: lang.lang_layout_deleteColumn,
|
||||
text: lang.lang_layout_deleteColumnDesc,
|
||||
type: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: lang.lang_yesno,
|
||||
cancelButtonText: lang.lang_no
|
||||
}).then((result) => {
|
||||
if (result.value) {
|
||||
var multi = localStorage.getItem("column");
|
||||
var obj = JSON.parse(multi);
|
||||
obj.splice(tlid, 1);
|
||||
var json = JSON.stringify(obj);
|
||||
localStorage.setItem("column", json);
|
||||
sortLoad()
|
||||
$("#timeline_box_" + tlid + "_parentBox").remove()
|
||||
}
|
||||
$("#sort-box").removeClass("hide");
|
||||
$("#sort-box").addClass("show");
|
||||
});
|
||||
}
|
||||
|
||||
//設定トグル
|
||||
@@ -376,23 +489,23 @@ function setToggle(tlid) {
|
||||
$("#util-box_" + tlid).animate({
|
||||
'height': '200px'
|
||||
}, {
|
||||
'duration': 300,
|
||||
'complete': function () {
|
||||
$("#util-box_" + tlid).css("overflow-y", "scroll")
|
||||
$("#util-box_" + tlid).removeClass("column-hide")
|
||||
}
|
||||
});
|
||||
'duration': 300,
|
||||
'complete': function () {
|
||||
$("#util-box_" + tlid).css("overflow-y", "scroll")
|
||||
$("#util-box_" + tlid).removeClass("column-hide")
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$("#util-box_" + tlid).css("overflow-y", "hidden")
|
||||
$("#util-box_" + tlid).animate({
|
||||
'height': '0'
|
||||
}, {
|
||||
'duration': 300,
|
||||
'complete': function () {
|
||||
$("#util-box_" + tlid).addClass("column-hide")
|
||||
$("#util-box_" + tlid).css("display", "none")
|
||||
}
|
||||
});
|
||||
'duration': 300,
|
||||
'complete': function () {
|
||||
$("#util-box_" + tlid).addClass("column-hide")
|
||||
$("#util-box_" + tlid).css("display", "none")
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
function colorpicker(key) {
|
||||
@@ -433,6 +546,7 @@ function coloradd(key, bg, txt) {
|
||||
if (txt == "def") {
|
||||
$("#menu_" + key).css("background-color", "");
|
||||
$("#menu_" + key).css("color", "");
|
||||
$("#menu_" + key + " .nex").css("color", "");
|
||||
} else {
|
||||
$("#menu_" + key).css('background-color', '#' + bg);
|
||||
if (txt == "black") {
|
||||
|
||||
@@ -17,6 +17,16 @@ function menu() {
|
||||
}
|
||||
$('#menu').css("left", left + "px")
|
||||
$('#menu').css("top", top + "px")
|
||||
var height = localStorage.getItem("menu-height");
|
||||
var width = localStorage.getItem("menu-width");
|
||||
if(height){
|
||||
$('#menu').css("height", height + "px")
|
||||
}else{
|
||||
$('#menu').css("height", "460px")
|
||||
}
|
||||
if(width){
|
||||
$('#menu').css("width", width + "px")
|
||||
}
|
||||
$('#menu').fadeIn();
|
||||
$("#menu-bar").html("TheDesk " + localStorage.getItem("ver"));
|
||||
$(".menu-content").addClass("hide");
|
||||
@@ -49,6 +59,14 @@ $(function () {
|
||||
localStorage.setItem("menu-top", top);
|
||||
}
|
||||
});
|
||||
$("#menu").resizable({
|
||||
minHeight: 150,
|
||||
minWidth: 200,
|
||||
stop: function (event, ui) {
|
||||
localStorage.setItem("menu-height", ui.size.height);
|
||||
localStorage.setItem("menu-width", ui.size.width);
|
||||
}
|
||||
});
|
||||
});
|
||||
function help() {
|
||||
postMessage(["openUrl", "https://docs.thedesk.top"], "*")
|
||||
|
||||
@@ -2,6 +2,15 @@
|
||||
//✕隠す
|
||||
function hide() {
|
||||
$("#right-side").hide()
|
||||
$("#right-side").css("width", "300px")
|
||||
$("#left-side").css("width", "100%")
|
||||
var width = localStorage.getItem("postbox-width");
|
||||
if(width){
|
||||
width = width.replace("px", "") * 1
|
||||
} else {
|
||||
width = 300
|
||||
}
|
||||
$("#post-box").css("width", width)
|
||||
$('#post-box').fadeOut()
|
||||
$("#post-box").removeClass("appear")
|
||||
$("#emoji").addClass("hide")
|
||||
@@ -38,7 +47,15 @@ function show() {
|
||||
}
|
||||
$('#post-box').css("left", left + "px")
|
||||
$('#post-box').css("top", top + "px")
|
||||
var width = localStorage.getItem("postbox-width");
|
||||
if (width) {
|
||||
$('#post-box').css("width", width + "px")
|
||||
} else {
|
||||
$('#post-box').css("width", "300px")
|
||||
}
|
||||
$('#post-box').fadeIn();
|
||||
$('#textarea').characterCounter();
|
||||
mdCheck()
|
||||
}
|
||||
|
||||
$(function () {
|
||||
@@ -61,6 +78,14 @@ $(function () {
|
||||
localStorage.setItem("postbox-top", top);
|
||||
}
|
||||
});
|
||||
$("#post-box").resizable({
|
||||
minHeight: 150,
|
||||
minWidth: 100,
|
||||
stop: function (event, ui) {
|
||||
$("#textarea").blur()
|
||||
localStorage.setItem("postbox-width", ui.size.width);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//コード受信
|
||||
@@ -69,7 +94,6 @@ if (location.search) {
|
||||
var mode = m[1];
|
||||
var codex = m[2];
|
||||
if (mode == "share") {
|
||||
console.log(codex);
|
||||
$('textarea').focus();
|
||||
$("#textarea").val(decodeURI(codex));
|
||||
show();
|
||||
@@ -83,15 +107,20 @@ $('#posttgl').click(function (e) {
|
||||
} else {
|
||||
hide();
|
||||
}
|
||||
$('.cvo').removeClass("selectedToot")
|
||||
selectedColumn = 0
|
||||
selectedToot = 0
|
||||
});
|
||||
|
||||
$("#timeline-container,#group").click(function (e) {
|
||||
|
||||
if (localStorage.getItem("box") != "absolute") {
|
||||
if ($('#post-box').hasClass("appear") && !localStorage.getItem("nohide")) {
|
||||
hide();
|
||||
}
|
||||
}
|
||||
$('.cvo').removeClass("selectedToot")
|
||||
selectedColumn = 0
|
||||
selectedToot = 0
|
||||
localStorage.removeItem("nohide")
|
||||
});
|
||||
$('#textarea,#cw-text').focusout(function (e) {
|
||||
@@ -100,4 +129,7 @@ $('#textarea,#cw-text').focusout(function (e) {
|
||||
localStorage.removeItem("nohide")
|
||||
}
|
||||
//setTimeout(remove, 100);
|
||||
$('.cvo').removeClass("selectedToot")
|
||||
selectedColumn = 0
|
||||
selectedToot = 0
|
||||
});
|
||||
@@ -9,13 +9,17 @@ scrollevent();
|
||||
function scrollck() {
|
||||
$(".tl-box").each(function (i, elem) {
|
||||
var tlid = $(this).attr('tlid');
|
||||
//一番上ならためていた新しいトゥートを表示
|
||||
//一番上ならためていた新しいトゥートを表示ないしtealなら未読管理モード
|
||||
if ($(this).scrollTop() === 0) {
|
||||
var pool = localStorage.getItem("pool_" + tlid);
|
||||
if (pool) {
|
||||
$("#timeline_" + tlid).prepend(pool);
|
||||
jQuery("time.timeago").timeago();
|
||||
localStorage.removeItem("pool_" + tlid);
|
||||
if (!$("#unread_" + tlid + " .material-icons").hasClass("teal-text")) {
|
||||
var pool = localStorage.getItem("pool_" + tlid);
|
||||
if (pool) {
|
||||
$("#timeline_" + tlid).prepend(pool);
|
||||
jQuery("time.timeago").timeago();
|
||||
localStorage.removeItem("pool_" + tlid);
|
||||
}
|
||||
} else {
|
||||
ueload(tlid)
|
||||
}
|
||||
//自動リフレッシュ
|
||||
if ($("#timeline_" + tlid + " .cvo").length > 30) {
|
||||
@@ -35,6 +39,15 @@ function scrollck() {
|
||||
}
|
||||
|
||||
function goTop(id) {
|
||||
if ($("#unread_" + id + " .material-icons").hasClass("teal-text")) {
|
||||
$("#unread_" + id + " .material-icons").removeClass("teal-text")
|
||||
var multi = localStorage.getItem("column")
|
||||
var obj = JSON.parse(multi)
|
||||
var acct_id = obj[id * 1].domain
|
||||
var type = obj[id * 1].type
|
||||
console.log(id, type)
|
||||
columnReload(id, type)
|
||||
}
|
||||
if ($("#timeline_box_" + id + "_box .tl-box").scrollTop() > 500) {
|
||||
$("#timeline_box_" + id + "_box .tl-box").scrollTop(500)
|
||||
}
|
||||
|
||||
@@ -23,29 +23,47 @@ var tlView = new Vue({
|
||||
data: { config: tlConstruction },
|
||||
methods: {
|
||||
complete: function (i, val) {
|
||||
var ls = tlView.config[i].storage;
|
||||
if (!val) {
|
||||
var id = tlView.config[i].id;
|
||||
var val = $("#" + id).val()
|
||||
var ls = tlView.config[i];
|
||||
if (val) {
|
||||
localStorage.setItem(ls.storage, val)
|
||||
} else {
|
||||
if (!ls.data) {
|
||||
ls = [ls]
|
||||
} else {
|
||||
ls = ls.data
|
||||
}
|
||||
for (var j = 0; j < ls.length; j++) {
|
||||
M.toast({ html: 'Complete', displayLength: 3000 })
|
||||
var id = ls[j].id;
|
||||
var val = $("#" + id).val()
|
||||
localStorage.setItem(ls[j].storage, val)
|
||||
}
|
||||
}
|
||||
M.toast({ html: 'Complete', displayLength: 3000 })
|
||||
localStorage.setItem(ls, val)
|
||||
return true
|
||||
}
|
||||
}
|
||||
});
|
||||
var postView = new Vue({
|
||||
el: '#postView',
|
||||
data: { config: postConstruction, kirishima: localStorage.getItem('kirishima') },
|
||||
data: { config: postConstruction, kirishima: localStorage.getItem('kirishima'), quoters: localStorage.getItem('quoters') },
|
||||
methods: {
|
||||
complete: function (i, val) {
|
||||
var ls = postView.config[i].storage;
|
||||
M.toast({ html: 'Complete', displayLength: 3000 })
|
||||
if (!val) {
|
||||
var id = postView.config[i].id;
|
||||
var val = $("#" + id).val()
|
||||
var ls = postView.config[i];
|
||||
if (val) {
|
||||
localStorage.setItem(ls.storage, val)
|
||||
} else {
|
||||
if (!ls.data) {
|
||||
ls = [ls]
|
||||
} else {
|
||||
ls = ls.data
|
||||
}
|
||||
for (var j = 0; j < ls.length; j++) {
|
||||
M.toast({ html: 'Complete', displayLength: 3000 })
|
||||
var id = ls[j].id;
|
||||
var val = $("#" + id).val()
|
||||
localStorage.setItem(ls[j].storage, val)
|
||||
}
|
||||
}
|
||||
localStorage.setItem(ls, val)
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -53,7 +71,7 @@ var postView = new Vue({
|
||||
//設定ボタン押した。
|
||||
function settings() {
|
||||
var cd = $("[name=theme]:checked").val();
|
||||
var ct = $("[for=" + cd + "]").html();
|
||||
var ct = $("[data-ct=" + cd + "]").html();
|
||||
if (cd == "custom" && !$("#custom-sel-sel").val()) {
|
||||
var theme = localStorage.getItem("theme");
|
||||
if (!theme) {
|
||||
@@ -96,15 +114,31 @@ function load() {
|
||||
var max = tlView.config.length;
|
||||
for (var i = 0; i < max; i++) {
|
||||
var ls = tlView.config[i].storage;
|
||||
if (localStorage.getItem(ls)) {
|
||||
tlView.config[i].setValue = localStorage.getItem(ls)
|
||||
if (ls) {
|
||||
if (localStorage.getItem(ls)) {
|
||||
tlView.config[i].setValue = localStorage.getItem(ls)
|
||||
}
|
||||
} else {
|
||||
ls = tlView.config[i].data
|
||||
for (var j = 0; j < ls.length; j++) {
|
||||
if (localStorage.getItem(tlView.config[i].data[j].storage)) {
|
||||
tlView.config[i].data[j].setValue = localStorage.getItem(tlView.config[i].data[j].storage)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var max = postView.config.length;
|
||||
for (var i = 0; i < max; i++) {
|
||||
var ls = postView.config[i].storage;
|
||||
if (localStorage.getItem(ls)) {
|
||||
postView.config[i].setValue = localStorage.getItem(ls)
|
||||
if (ls) {
|
||||
if (localStorage.getItem(ls)) {
|
||||
postView.config[i].setValue = localStorage.getItem(ls)
|
||||
}
|
||||
} else {
|
||||
ls = postView.config[i].data
|
||||
for (var j = 0; j < ls.length; j++) {
|
||||
postView.config[i].data[j].setValue = localStorage.getItem(ls[j].storage)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (localStorage.getItem("imas")) {
|
||||
@@ -127,8 +161,37 @@ function load() {
|
||||
$("#c2-file").text(localStorage.getItem("custom2"));
|
||||
$("#c3-file").text(localStorage.getItem("custom3"));
|
||||
$("#c4-file").text(localStorage.getItem("custom4"));
|
||||
var cvol = localStorage.getItem("customVol")
|
||||
if (cvol) {
|
||||
$("#soundvol").val(cvol * 100);
|
||||
$("#soundVolVal").text(cvol * 100)
|
||||
}
|
||||
//$("#log").val(localStorage.getItem("errors"))
|
||||
}
|
||||
function customVol() {
|
||||
var cvol = $("#soundvol").val()
|
||||
$("#soundVolVal").text(cvol)
|
||||
localStorage.setItem("customVol", cvol / 100)
|
||||
var sound = localStorage.getItem("favSound");
|
||||
if (sound == "default") {
|
||||
var file = "../../source/notif.wav"
|
||||
}else{
|
||||
if (sound == "c1") {
|
||||
var file = localStorage.getItem("custom1");
|
||||
} else if (sound == "c2") {
|
||||
var file = localStorage.getItem("custom2");
|
||||
} else if (sound == "c3") {
|
||||
var file = localStorage.getItem("custom3");
|
||||
} else if (sound == "c4") {
|
||||
var file = localStorage.getItem("custom4");
|
||||
}
|
||||
}
|
||||
request = new XMLHttpRequest();
|
||||
request.open("GET", file, true);
|
||||
request.responseType = "arraybuffer";
|
||||
request.onload = playSound;
|
||||
request.send();
|
||||
}
|
||||
|
||||
function climute() {
|
||||
//クライアントミュート
|
||||
@@ -171,7 +234,7 @@ function wordmute() {
|
||||
});
|
||||
}
|
||||
function wordmuteSave() {
|
||||
var word = $('#wordmute').material_chip('data');
|
||||
var word = M.Chips.getInstance($("#wordmute")).chipsData;
|
||||
var json = JSON.stringify(word);
|
||||
localStorage.setItem("word_mute", json);
|
||||
}
|
||||
@@ -185,7 +248,7 @@ function wordemp() {
|
||||
});
|
||||
}
|
||||
function wordempSave() {
|
||||
var word = $('#wordemp').material_chip('data');
|
||||
var word = M.Chips.getInstance($("#wordemp")).chipsData;
|
||||
var json = JSON.stringify(word);
|
||||
localStorage.setItem("word_emp", json);
|
||||
}
|
||||
@@ -195,12 +258,7 @@ function notftest() {
|
||||
body: lang.lang_setting_notftest + '(' + lang.lang_setting_notftestprof + ')',
|
||||
icon: localStorage.getItem("prof_0")
|
||||
};
|
||||
if (os == "darwin") {
|
||||
var n = new Notification('TheDesk' + lang.lang_setting_notftest, options);
|
||||
} else {
|
||||
var nativeNotfOpt = ['TheDesk' + lang.lang_setting_notftest, lang.lang_setting_notftest + '(' + lang.lang_setting_notftestprof + ')', localStorage.getItem('prof_0'), "", ""]
|
||||
postMessage(["nativeNotf", nativeNotfOpt], "*")
|
||||
}
|
||||
var n = new Notification('TheDesk' + lang.lang_setting_notftest, options);
|
||||
|
||||
}
|
||||
function oks(no) {
|
||||
@@ -217,10 +275,19 @@ function changelang(lang) {
|
||||
postMessage(["lang", lang], "*")
|
||||
}
|
||||
function exportSettings() {
|
||||
if (!confirm(lang.lang_setting_exportwarn)) {
|
||||
return false;
|
||||
}
|
||||
postMessage(["exportSettings", ""], "*")
|
||||
Swal.fire({
|
||||
title: lang.lang_setting_exportwarn,
|
||||
type: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: lang.lang_yesno,
|
||||
cancelButtonText: lang.lang_no
|
||||
}).then((result) => {
|
||||
if (result.value) {
|
||||
postMessage(["exportSettings", ""], "*")
|
||||
}
|
||||
})
|
||||
}
|
||||
function exportSettingsCore() {
|
||||
var exp = {};
|
||||
@@ -280,16 +347,29 @@ function exportSettingsCore() {
|
||||
var tagarr = localStorage.getItem("tag");
|
||||
var favtag = JSON.parse(tagarr);
|
||||
exp.favoriteTags = favtag;
|
||||
exp.revisons = 2.1
|
||||
exp.meta = {}
|
||||
exp.meta.date = new Date()
|
||||
exp.meta.thedesk = localStorage.getItem("ver")
|
||||
exp.meta.platform = localStorage.getItem("platform")
|
||||
return exp;
|
||||
}
|
||||
function importSettings() {
|
||||
if (!confirm(lang.lang_setting_importwarn)) {
|
||||
return false;
|
||||
}
|
||||
postMessage(["importSettings", ""], "*")
|
||||
Swal.fire({
|
||||
title: lang.lang_setting_importwarn,
|
||||
type: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: lang.lang_yesno,
|
||||
cancelButtonText: lang.lang_no
|
||||
}).then((result) => {
|
||||
if (result.value) {
|
||||
postMessage(["importSettings", ""], "*")
|
||||
}
|
||||
})
|
||||
}
|
||||
function importSettingsCore(arg) {
|
||||
var obj = JSON.parse(arg);
|
||||
function importSettingsCore(obj) {
|
||||
if (obj) {
|
||||
localStorage.clear();
|
||||
localStorage.setItem("multi", JSON.stringify(obj.accts));
|
||||
@@ -304,7 +384,7 @@ function importSettingsCore(arg) {
|
||||
}
|
||||
localStorage.setItem("column", JSON.stringify(obj.columns));
|
||||
if (obj.config) {
|
||||
//Version 2
|
||||
//Version 2~
|
||||
var max = envView.config.length;
|
||||
for (var i = 0; i < max; i++) {
|
||||
var ls = envView.config[i].storage;
|
||||
@@ -375,7 +455,10 @@ function importSettingsCore(arg) {
|
||||
}
|
||||
location.href = "index.html";
|
||||
} else {
|
||||
alert("Error.")
|
||||
Swal.fire({
|
||||
type: 'error',
|
||||
title: 'Error'
|
||||
})
|
||||
}
|
||||
}
|
||||
function savefolder() {
|
||||
@@ -435,14 +518,38 @@ function customComp() {
|
||||
if (!secondaryC) { secondaryC = "rgb(255,255,255)" }
|
||||
var textC = $("#color-picker2_value").val();
|
||||
if (!textC) { textC = "rgb(255,255,255)" }
|
||||
var accentC = $("#color-picker3_value").val();
|
||||
if (!accentC) { accentC = "rgb(255,255,255)" }
|
||||
var multi = localStorage.getItem("multi");
|
||||
if($("#pickers").hasClass("advanceTheme")){
|
||||
var accentC = $("#color-picker3_value").val();
|
||||
if (!accentC) { accentC = null }
|
||||
var activeC = $("#color-picker4_value").val();
|
||||
if (!activeC) { activeC = null }
|
||||
var modalC = $("#color-picker5_value").val();
|
||||
if (!modalC) { modalC = null }
|
||||
var bottomC = $("#color-picker6_value").val();
|
||||
if (!bottomC) { bottomC = null }
|
||||
var postboxC = $("#color-picker7_value").val();
|
||||
if (!postboxC) { postboxC = null }
|
||||
var subcolorC = $("#color-picker8_value").val();
|
||||
if (!subcolorC) { subcolorC = null }
|
||||
var advanceTheme = {
|
||||
"TheDeskAccent": accentC,
|
||||
"TheDeskActive": activeC,
|
||||
"TheDeskModal": modalC,
|
||||
"TheDeskBottom": bottomC,
|
||||
"TheDeskPostbox": postboxC,
|
||||
"TheDeskSubcolor": subcolorC
|
||||
}
|
||||
}else{
|
||||
var advanceTheme = {}
|
||||
}
|
||||
|
||||
var my = JSON.parse(multi)[0].name;
|
||||
var id = $("#custom-edit-sel").val();
|
||||
if (id == "add_new") {
|
||||
id = makeCID();
|
||||
}
|
||||
localStorage.setItem("customtheme-id", id)
|
||||
var json = {
|
||||
"name": nameC,
|
||||
"author": my,
|
||||
@@ -453,29 +560,21 @@ function customComp() {
|
||||
"secondary": secondaryC,
|
||||
"text": textC
|
||||
},
|
||||
"props": {
|
||||
"TheDeskAccent": accentC
|
||||
},
|
||||
"props": advanceTheme,
|
||||
"id": id
|
||||
}
|
||||
$("#custom_json").val(JSON.stringify(json));
|
||||
themes();
|
||||
themes("custom");
|
||||
$("#custom").prop("checked", true);
|
||||
$("#custom_name").val("");
|
||||
$("#custom_desc").val("");
|
||||
$("#dark").prop("checked", true);
|
||||
$("#custom_json").val("");
|
||||
$("#color-picker0-wrap").html('<div class="color-picker" id="color-picker0"></div>')
|
||||
$("#color-picker1-wrap").html('<div class="color-picker" id="color-picker1"></div>')
|
||||
$("#color-picker2-wrap").html('<div class="color-picker" id="color-picker2"></div>')
|
||||
$("#color-picker3-wrap").html('<div class="color-picker" id="color-picker3"></div>')
|
||||
$("#color-picker0_value").val("");
|
||||
$("#color-picker1_value").val("");
|
||||
$("#color-picker2_value").val("");
|
||||
$("#color-picker3_value").val("");
|
||||
pickerDefine(0, "fff");
|
||||
pickerDefine(1, "fff");
|
||||
pickerDefine(2, "fff");
|
||||
pickerDefine(3, "fff");
|
||||
for(var i =0;i <= 8; i++){
|
||||
$("#color-picker" + i + "-wrap").html('<div class="color-picker" id="color-picker' + i + '"></div>')
|
||||
$("#color-picker" + i + "_value").val("");
|
||||
pickerDefine(i, "fff");
|
||||
}
|
||||
postMessage(["themeJsonCreate", JSON.stringify(json)], "*")
|
||||
}
|
||||
function deleteIt() {
|
||||
@@ -484,18 +583,11 @@ function deleteIt() {
|
||||
$("#custom_desc").val("");
|
||||
$("#dark").prop("checked", true);
|
||||
$("#custom_json").val("");
|
||||
$("#color-picker0-wrap").html('<div class="color-picker" id="color-picker0"></div>')
|
||||
$("#color-picker1-wrap").html('<div class="color-picker" id="color-picker1"></div>')
|
||||
$("#color-picker2-wrap").html('<div class="color-picker" id="color-picker2"></div>')
|
||||
$("#color-picker3-wrap").html('<div class="color-picker" id="color-picker3"></div>')
|
||||
$("#color-picker0_value").val("");
|
||||
$("#color-picker1_value").val("");
|
||||
$("#color-picker2_value").val("");
|
||||
$("#color-picker3_value").val("");
|
||||
pickerDefine(0, "fff");
|
||||
pickerDefine(1, "fff");
|
||||
pickerDefine(2, "fff");
|
||||
pickerDefine(3, "fff");
|
||||
for(var i =0;i <= 8; i++){
|
||||
$("#color-picker" + i + "-wrap").html('<div class="color-picker" id="color-picker' + i + '"></div>')
|
||||
$("#color-picker" + i + "_value").val("");
|
||||
pickerDefine(i, "fff");
|
||||
}
|
||||
postMessage(["themeJsonDelete", id], "*")
|
||||
}
|
||||
function ctLoad() {
|
||||
@@ -527,58 +619,74 @@ function custom() {
|
||||
$("#custom_desc").val("");
|
||||
$("#dark").prop("checked", true);
|
||||
$("#custom_json").val("");
|
||||
$("#color-picker0-wrap").html('<div class="color-picker" id="color-picker0"></div>')
|
||||
$("#color-picker1-wrap").html('<div class="color-picker" id="color-picker1"></div>')
|
||||
$("#color-picker2-wrap").html('<div class="color-picker" id="color-picker2"></div>')
|
||||
$("#color-picker3-wrap").html('<div class="color-picker" id="color-picker3"></div>')
|
||||
$("#color-picker0_value").val("");
|
||||
$("#color-picker1_value").val("");
|
||||
$("#color-picker2_value").val("");
|
||||
$("#color-picker3_value").val("");
|
||||
pickerDefine(0, "fff");
|
||||
pickerDefine(1, "fff");
|
||||
pickerDefine(2, "fff");
|
||||
pickerDefine(3, "fff");
|
||||
for(var i =0;i <= 8; i++){
|
||||
$("#color-picker" + i + "-wrap").html('<div class="color-picker" id="color-picker' + i + '"></div>')
|
||||
$("#color-picker" + i + "_value").val("");
|
||||
pickerDefine(i, "fff");
|
||||
}
|
||||
$("#delTheme").addClass("disabled")
|
||||
} else {
|
||||
$("#delTheme").removeClass("disabled")
|
||||
postMessage(["themeJsonRequest", id], "*")
|
||||
}
|
||||
}
|
||||
function customConnect(args) {
|
||||
function customConnect(raw) {
|
||||
var args = raw[0]
|
||||
$("#custom_name").val(args.name);
|
||||
$("#custom_desc").val(args.desc);
|
||||
$("#" + args.base).prop("checked", true);
|
||||
//Primary
|
||||
$("#color-picker0-wrap").html('<div class="color-picker" id="color-picker0"></div>')
|
||||
pickerDefine(0, rgbToHex(args.vars.primary))
|
||||
$("#color-picker0_value").val(args.vars.primary);
|
||||
//Secondary
|
||||
$("#color-picker1-wrap").html('<div class="color-picker" id="color-picker1"></div>')
|
||||
pickerDefine(1, rgbToHex(args.vars.secondary))
|
||||
$("#color-picker1_value").val(args.vars.secondary);
|
||||
//Text
|
||||
$("#color-picker2-wrap").html('<div class="color-picker" id="color-picker2"></div>')
|
||||
$("#color-picker2_value").val(args.vars.text);
|
||||
pickerDefine(2, rgbToHex(args.vars.text))
|
||||
//TheDesk Only
|
||||
advancedConncet(args, "TheDeskAccent", "secondary", 3)
|
||||
advancedConncet(args, "TheDeskActive", "primary", 4)
|
||||
advancedConncet(args, "TheDeskModal", "secondary", 5)
|
||||
advancedConncet(args, "TheDeskBottom", "primary", 6)
|
||||
advancedConncet(args, "TheDeskPostbox", "primary", 7)
|
||||
advancedConncet(args, "TheDeskSubcolor", "primary", 8)
|
||||
$("#custom_json").val(raw[1]);
|
||||
}
|
||||
function advancedConncet(args, tar, sub, i){
|
||||
if (args.props) {
|
||||
if (args.props.TheDeskAccent) {
|
||||
var accent = args.props.TheDeskAccent;
|
||||
if (args.props[tar]) {
|
||||
var color = args.props[tar];
|
||||
$("#pickers").addClass("advanceTheme")
|
||||
$(".advanced").removeClass("hide")
|
||||
} else {
|
||||
var accent = args.vars.secondary;
|
||||
var color = args.vars[sub];
|
||||
}
|
||||
} else {
|
||||
var accent = args.vars.secondary;
|
||||
var color = args.vars[sub];
|
||||
}
|
||||
$("#color-picker3-wrap").html('<div class="color-picker" id="color-picker3"></div>')
|
||||
pickerDefine(3, rgbToHex(accent))
|
||||
$("#custom_json").val(JSON.stringify(args));
|
||||
$("#color-picker"+i+"-wrap").html('<div class="color-picker" id="color-picker'+i+'"></div>')
|
||||
$("#color-picker"+i+"_value").val(color);
|
||||
pickerDefine(i, rgbToHex(color))
|
||||
}
|
||||
function customImp() {
|
||||
var json = $("#custom_import").val();
|
||||
if (JSON5.parse(json)) {
|
||||
postMessage(["themeJsonCreate", json], "*")
|
||||
} else {
|
||||
alert("Error")
|
||||
Swal.fire({
|
||||
type: 'error',
|
||||
title: 'Error'
|
||||
})
|
||||
}
|
||||
}
|
||||
function advanced(){
|
||||
$(".advanced").toggleClass("hide")
|
||||
$("#pickers").toggleClass("advanceTheme")
|
||||
}
|
||||
function clearCustomImport() {
|
||||
$("#custom_import").val("");
|
||||
}
|
||||
@@ -601,7 +709,47 @@ window.onload = function () {
|
||||
checkSpotify();
|
||||
voiceSettingLoad();
|
||||
oksload();
|
||||
npprovider();
|
||||
ctLoad()
|
||||
};
|
||||
|
||||
//設定画面で未読マーカーは要らない
|
||||
function asReadEnd() {
|
||||
postMessage(["asReadComp", ""], "*")
|
||||
}
|
||||
function checkupd(){
|
||||
var ver = localStorage.getItem("ver");
|
||||
var start = "https://thedesk.top/ver.json";
|
||||
fetch(start, {
|
||||
method: 'GET'
|
||||
}).then(function (response) {
|
||||
return response.json();
|
||||
}).catch(function (error) {
|
||||
todo(error);
|
||||
console.error(error);
|
||||
}).then(function (mess) {
|
||||
console.table(mess);
|
||||
if (mess) {
|
||||
var platform = localStorage.getItem("platform");
|
||||
if (platform == "darwin") {
|
||||
var newest = mess.desk_mac;
|
||||
} else {
|
||||
var newest = mess.desk;
|
||||
}
|
||||
if (newest == ver) {
|
||||
Swal.fire({
|
||||
type: 'info',
|
||||
title: lang.lang_setting_noupd,
|
||||
html: ver
|
||||
})
|
||||
} else if (ver.indexOf("beta") != -1 || winstore) {
|
||||
Swal.fire({
|
||||
type: 'info',
|
||||
title: lang.lang_setting_thisisbeta,
|
||||
html: ver
|
||||
})
|
||||
} else {
|
||||
localStorage.removeItem("new-ver-skip")
|
||||
location.href="index.html"
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1,953 +0,0 @@
|
||||
//設定(setting.html)で読む
|
||||
var envView = new Vue({
|
||||
el: '#env-view',
|
||||
data: {config:envConstruction,value:envValue},
|
||||
method: {
|
||||
settings: function (index) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//設定ボタン押した。
|
||||
function settings() {
|
||||
var dd = $("[name=time]:checked").val();
|
||||
var dt = $("[for="+dd+"]").text();
|
||||
if (dd != localStorage.getItem("datetype")) {
|
||||
Materialize.toast(lang.lang_setting_time.replace("{{set}}" ,dt), 3000);
|
||||
}
|
||||
localStorage.setItem("datetype", dd);
|
||||
|
||||
var cd = $("[name=theme]:checked").val();
|
||||
var ct = $("[for="+cd+"]").html();
|
||||
if(cd=="custom" && !$("#custom-sel-sel").val()){
|
||||
var theme = localStorage.getItem("theme");
|
||||
if (!theme) {
|
||||
var theme = "white";
|
||||
}
|
||||
$("#" + theme).prop("checked", true);
|
||||
}else{
|
||||
if (cd != localStorage.getItem("theme")) {
|
||||
Materialize.toast(lang.lang_setting_theme.replace("{{set}}" ,ct), 3000);
|
||||
}
|
||||
//テーマはこの場で設定
|
||||
themes(cd);
|
||||
localStorage.setItem("theme", cd);
|
||||
}
|
||||
|
||||
var nd = $("[name=nsfw]:checked").val();
|
||||
var nt = $("[for=n_"+nd+"]").text();
|
||||
if (nd != localStorage.getItem("nsfw")) {
|
||||
Materialize.toast(lang.lang_setting_nsfw.replace("{{set}}" ,nt), 3000);
|
||||
}
|
||||
localStorage.setItem("nsfw", nd);
|
||||
|
||||
var cwd = $("[name=cw]:checked").val();
|
||||
var cwt = $("[for=c_"+cwd+"]").text();
|
||||
if (cwd != localStorage.getItem("cw")) {
|
||||
Materialize.toast(lang.lang_setting_cw.replace("{{set}}" ,cwt), 3000);
|
||||
}
|
||||
localStorage.setItem("cw", cwd);
|
||||
|
||||
var cwtd = $("#cw-text").val();
|
||||
if (cwtd != localStorage.getItem("cw-text")) {
|
||||
Materialize.toast(lang.lang_setting_cwtext.replace("{{set}}" ,cwtd), 3000);
|
||||
}
|
||||
localStorage.setItem("cw-text", cwtd);
|
||||
|
||||
var cwsd = $("[name=cws]:checked").val();
|
||||
var cwst = $("[for=cws_"+cwsd+"]").text();
|
||||
if (cwsd != localStorage.getItem("always-cw")) {
|
||||
Materialize.toast(lang.lang_setting_cws.replace("{{set}}" ,cwst), 3000);
|
||||
}
|
||||
localStorage.setItem("always-cw", cwsd);
|
||||
|
||||
var rpd = $("[name=rp]:checked").val();
|
||||
var rpt = $("[for=c_"+cwd+"]").text();
|
||||
if (rpd != localStorage.getItem("replyct")) {
|
||||
Materialize.toast(lang.lang_setting_rp.replace("{{set}}" ,rpt), 3000);
|
||||
}
|
||||
localStorage.setItem("replyct", rpd);
|
||||
|
||||
var visd = $("[name=vis]:checked").val();
|
||||
var vist = $("[for="+visd+"]").text();
|
||||
if (visd != localStorage.getItem("vis")) {
|
||||
Materialize.toast(lang.lang_setting_vis.replace("{{set}}" ,vist), 3000);
|
||||
}
|
||||
localStorage.setItem("vis", visd);
|
||||
|
||||
var popd = $("#popup").val();
|
||||
if (popd > 0 && popd != localStorage.getItem("popup")) {
|
||||
Materialize.toast(lang.lang_setting_popup.replace("{{set}}" ,popd+lang.lang_setting_s), 3000);
|
||||
} else if (popd != localStorage.getItem("popup")) {
|
||||
Materialize.toast(lang.lang_setting_popup.replace("{{set}}" ,lang.lang_setting_off), 3000);
|
||||
}
|
||||
localStorage.setItem("popup", popd);
|
||||
|
||||
var gifd = $("[name=gif]:checked").val();
|
||||
var gift = $("[for=g_"+gifd+"]").text();
|
||||
if (gifd != localStorage.getItem("gif")) {
|
||||
Materialize.toast(lang.lang_setting_gif.replace("{{set}}" ,gift), 3000);
|
||||
}
|
||||
localStorage.setItem("gif", gifd);
|
||||
|
||||
var sentd = $("#sentence").val();
|
||||
var ltrd = $("#letters").val();
|
||||
if (sentd != localStorage.getItem("sentence") || ltrd != localStorage.getItem("letters")) {
|
||||
Materialize.toast(lang.lang_setting_selt.replace("{{set1}}" ,sentd).replace("{{set2}}" ,ltrd), 3000);
|
||||
}
|
||||
localStorage.setItem("sentence", sentd);
|
||||
localStorage.setItem("letters", ltrd);
|
||||
|
||||
var csentd = $("#cw_sentence").val();
|
||||
var cltrd = $("#cw_letters").val();
|
||||
if (csentd != localStorage.getItem("cw_sentence") || cltrd != localStorage.getItem("cw_letters")) {
|
||||
Materialize.toast(lang.lang_setting_autocw.replace("{{set1}}" ,csentd).replace("{{set2}}" ,cltrd), 3000);
|
||||
}
|
||||
localStorage.setItem("cw_sentence", csentd);
|
||||
localStorage.setItem("cw_letters", cltrd);
|
||||
|
||||
var widthd = $("#width").val();
|
||||
if (widthd != localStorage.getItem("width")) {
|
||||
Materialize.toast(lang.lang_setting_width.replace("{{set}}" ,widthd), 3000);
|
||||
}
|
||||
localStorage.setItem("width", widthd);
|
||||
|
||||
var fwidthd = $("#fixwidth").val();
|
||||
if (fwidthd != localStorage.getItem("fixwidth")) {
|
||||
Materialize.toast(lang.lang_setting_fixwidth.replace("{{set}}" ,fwidthd), 3000);
|
||||
}
|
||||
localStorage.setItem("fixwidth", fwidthd);
|
||||
|
||||
var imgd = $("[name=img]:checked").val();
|
||||
var imgt = $("[for=i_"+imgd+"]").text();
|
||||
if (imgd != localStorage.getItem("img")) {
|
||||
Materialize.toast(lang.lang_setting_img.replace("{{set}}" ,imgt), 3000);
|
||||
}
|
||||
localStorage.setItem("img", imgd);
|
||||
|
||||
var fontd = $("#font").val();
|
||||
if(fontd){
|
||||
if (fontd != localStorage.getItem("font")) {
|
||||
Materialize.toast(lang.lang_setting_font.replace("{{set}}" ,fontd), 3000);
|
||||
}
|
||||
localStorage.setItem("font", fontd);
|
||||
themes();
|
||||
}else{
|
||||
if(localStorage.getItem("font")){
|
||||
localStorage.removeItem("font");
|
||||
Materialize.toast(lang.lang_setting_font.replace("{{set}}" ,lang.lang_setting_default), 3000);
|
||||
themes();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var sized = $("#size").val();
|
||||
if (sized != localStorage.getItem("size")) {
|
||||
Materialize.toast(lang.lang_setting_size.replace("{{set}}" ,sized), 3000);
|
||||
}
|
||||
localStorage.setItem("size", sized);
|
||||
|
||||
var heid = $("#img-height").val();
|
||||
if (heid != localStorage.getItem("img-height")) {
|
||||
Materialize.toast(lang.lang_setting_imgheight.replace("{{set}}" ,heid), 3000);
|
||||
}
|
||||
localStorage.setItem("img-height", heid);
|
||||
|
||||
var tckrd = $("[name=ticker]:checked").val();
|
||||
var tckrt = $("[for=ticker_"+tckrd+"]").text();
|
||||
if (tckrd != localStorage.getItem("ticker_ok")) {
|
||||
Materialize.toast(lang.lang_setting_ticker.replace("{{set}}" ,tckrt), 3000);
|
||||
}
|
||||
localStorage.setItem("ticker_ok", tckrd);
|
||||
|
||||
var animed = $("[name=anime]:checked").val();
|
||||
var animet = $("[for=anime_"+animed+"]").text();
|
||||
if (animed != localStorage.getItem("animation")) {
|
||||
Materialize.toast(lang.lang_setting_animation.replace("{{set}}" ,animet), 3000);
|
||||
}
|
||||
localStorage.setItem("animation", animed);
|
||||
|
||||
var boxd = $("[name=box]:checked").val();
|
||||
var boxt = $("[for=bx_"+boxd+"]").text();
|
||||
if (boxd != localStorage.getItem("box")) {
|
||||
Materialize.toast(lang.lang_setting_boxConfirm.replace("{{set}}" ,boxt), 3000);
|
||||
}
|
||||
localStorage.setItem("box", boxd);
|
||||
|
||||
var tagd = $("[name=tag]:checked").val();
|
||||
var tagt = $("[for=t_"+tagd+"]").text();
|
||||
if (tagd != localStorage.getItem("tag-range")) {
|
||||
Materialize.toast(lang.lang_setting_tag.replace("{{set}}" ,tagt), 3000);
|
||||
}
|
||||
localStorage.setItem("tag-range", tagd);
|
||||
|
||||
var uld = $("[name=ul]:checked").val();
|
||||
var ult = $("[for=ul_"+uld+"]").text();
|
||||
if (uld != localStorage.getItem("locale")) {
|
||||
Materialize.toast(lang.lang_setting_ul.replace("{{set}}" ,ult), 3000);
|
||||
}
|
||||
localStorage.setItem("locale", uld);
|
||||
|
||||
var ntd = $("[name=notf]:checked").val();
|
||||
var ntt = $("[for=ntf_"+ntd+"]").text();
|
||||
if (ntd != localStorage.getItem("nativenotf")) {
|
||||
Materialize.toast(lang.lang_setting_notf.replace("{{set}}" ,ntt), 3000);
|
||||
}
|
||||
localStorage.setItem("nativenotf", ntd);
|
||||
|
||||
var qtd = $("[name=quote]:checked").val();
|
||||
var qtt = $("[for=q_"+qtd+"]").text();
|
||||
if (qtd != localStorage.getItem("quote")) {
|
||||
Materialize.toast(lang.lang_setting_quote.replace("{{set}}" ,qtt), 3000);
|
||||
}
|
||||
localStorage.setItem("quote", qtd);
|
||||
|
||||
var viad = $("[name=via]:checked").val();
|
||||
var viat = $("[for=via_"+viad+"]").text();
|
||||
if (viad != localStorage.getItem("viashow")) {
|
||||
Materialize.toast(lang.lang_setting_via.replace("{{set}}" ,viat), 3000);
|
||||
}
|
||||
localStorage.setItem("viashow", viad);
|
||||
|
||||
var notfmd = $("[name=notfm]:checked").val();
|
||||
var notfmt = $("[for=notfm_"+notfmd+"]").text();
|
||||
if (notfmd != localStorage.getItem("setasread")) {
|
||||
Materialize.toast(lang.lang_setting_setasread.replace("{{set}}" ,notfmt), 3000);
|
||||
}
|
||||
localStorage.setItem("setasread", notfmd);
|
||||
|
||||
var movd = $("[name=mov]:checked").val();
|
||||
var movt = $("[for=mov_"+movd+"]").text();
|
||||
if (movd != localStorage.getItem("mouseover")) {
|
||||
Materialize.toast(lang.lang_setting_mov.replace("{{set}}" ,movt), 3000);
|
||||
}
|
||||
localStorage.setItem("mouseover", movd);
|
||||
|
||||
var maind = $("[name=main]:checked").val();
|
||||
var maint = $("[for=mn_"+maind+"]").text();
|
||||
if (maind != localStorage.getItem("mainuse")) {
|
||||
Materialize.toast(lang.lang_setting_main.replace("{{set}}" ,maint), 3000);
|
||||
}
|
||||
localStorage.setItem("mainuse", maind);
|
||||
|
||||
var secd = $("[name=sec]:checked").val();
|
||||
var sect = $("[for=sec-"+secd+"]").text();
|
||||
if (secd != localStorage.getItem("sec")) {
|
||||
Materialize.toast(lang.lang_setting_sec.replace("{{set}}" ,sect), 3000);
|
||||
}
|
||||
localStorage.setItem("sec", secd);
|
||||
}
|
||||
|
||||
//読み込み時の設定ロード
|
||||
function load() {
|
||||
if(localStorage.getItem("imas")){
|
||||
$(".imas").removeClass("hide");
|
||||
}
|
||||
if(localStorage.getItem("kirishima")){
|
||||
$(".kirishima").removeClass("hide");
|
||||
}
|
||||
var prof = localStorage.getItem("prof");
|
||||
$("#my-prof").attr("src", prof);
|
||||
var datetype = localStorage.getItem("datetype");
|
||||
if (!datetype) {
|
||||
var datetype = "absolute";
|
||||
}
|
||||
$("#" + datetype).prop("checked", true);
|
||||
|
||||
var theme = localStorage.getItem("theme");
|
||||
if (!theme) {
|
||||
var theme = "white";
|
||||
}
|
||||
$("#" + theme).prop("checked", true);
|
||||
|
||||
var ha = localStorage.getItem("ha");
|
||||
if (!ha) {
|
||||
var ha = "false";
|
||||
}
|
||||
$("#ha_" + ha).prop("checked", true);
|
||||
|
||||
var nsfw = localStorage.getItem("nsfw");
|
||||
if (!nsfw) {
|
||||
var nsfw = "yes";
|
||||
}
|
||||
$("#n_" + nsfw).prop("checked", true);
|
||||
|
||||
var cw = localStorage.getItem("cw");
|
||||
if (!cw) {
|
||||
var cw = "yes";
|
||||
}
|
||||
$("#c_" + cw).prop("checked", true);
|
||||
|
||||
var cws = localStorage.getItem("always-cw");
|
||||
if (!cws) {
|
||||
var cws = "no";
|
||||
}
|
||||
$("#cws_" + cws).prop("checked", true);
|
||||
|
||||
var popup = localStorage.getItem("popup");
|
||||
if (!popup) {
|
||||
var popup = "0";
|
||||
}
|
||||
$("#popup").val(popup);
|
||||
|
||||
var box = localStorage.getItem("box");
|
||||
if (!box) {
|
||||
var box = "no";
|
||||
}
|
||||
if(box=="absolute"){
|
||||
var box = "abs";
|
||||
}
|
||||
$("#bx_" + box).prop("checked", true);
|
||||
|
||||
var gif = localStorage.getItem("gif");
|
||||
if (!gif) {
|
||||
var gif = "yes";
|
||||
}
|
||||
$("#g_" + gif).prop("checked", true);
|
||||
|
||||
var sent = localStorage.getItem("sentence");
|
||||
if (!sent) {
|
||||
var sent = "500";
|
||||
}
|
||||
$("#sentence").val(sent);
|
||||
var ltrs = localStorage.getItem("letters");
|
||||
if (!ltrs) {
|
||||
var ltrs = "500";
|
||||
}
|
||||
$("#letters").val(ltrs);
|
||||
|
||||
var csent = localStorage.getItem("cw_sentence");
|
||||
if (!csent) {
|
||||
var csent = "500";
|
||||
}
|
||||
$("#cw_sentence").val(csent);
|
||||
var cltrs = localStorage.getItem("cw_letters");
|
||||
if (!cltrs) {
|
||||
var cltrs = "500";
|
||||
}
|
||||
$("#cw_letters").val(cltrs);
|
||||
|
||||
var width = localStorage.getItem("width");
|
||||
if (!width) {
|
||||
var width = "300";
|
||||
}
|
||||
$("#width").val(width);
|
||||
|
||||
var fwidth = localStorage.getItem("fixwidth");
|
||||
if (!fwidth) {
|
||||
var fwidth = "300";
|
||||
}
|
||||
$("#fixwidth").val(fwidth);
|
||||
|
||||
var cwt = localStorage.getItem("cw-text");
|
||||
if (!cwt) {
|
||||
var cwt = "";
|
||||
}
|
||||
$("#cw-text").val(cwt);
|
||||
|
||||
var cws = localStorage.getItem("always-cw");
|
||||
if (!cws) {
|
||||
var cws = "no";
|
||||
}
|
||||
$("#cws_" + cws).prop("checked", true);
|
||||
|
||||
var rps = localStorage.getItem("replyct");
|
||||
if (!rps) {
|
||||
var rps = "hidden";
|
||||
}
|
||||
$("#rp_" + rps).prop("checked", true);
|
||||
|
||||
var vis = localStorage.getItem("vis");
|
||||
if (!vis) {
|
||||
var vis = "public";
|
||||
}
|
||||
$("#" + vis).prop("checked", true);
|
||||
|
||||
var img = localStorage.getItem("img");
|
||||
if (!img) {
|
||||
var img = "no-act";
|
||||
}
|
||||
$("#i_" + img).prop("checked", true);
|
||||
|
||||
var font = localStorage.getItem("font");
|
||||
if (!font) {
|
||||
var font = "";
|
||||
}
|
||||
$("#font").val(font);
|
||||
|
||||
var size = localStorage.getItem("size");
|
||||
if (!size) {
|
||||
var size = "13";
|
||||
}
|
||||
$("#size").val(size);
|
||||
|
||||
var imh = localStorage.getItem("img-height");
|
||||
if (!imh) {
|
||||
var imh = "200";
|
||||
}
|
||||
$("#img-height").val(imh);
|
||||
|
||||
var ticker = localStorage.getItem("ticker_ok");
|
||||
if (!ticker) {
|
||||
var ticker = "no";
|
||||
}
|
||||
$("#ticker_" + ticker).prop("checked", true);
|
||||
|
||||
var animation = localStorage.getItem("animation");
|
||||
if (!animation) {
|
||||
var animation = "yes";
|
||||
}
|
||||
$("#anime_" + animation).prop("checked", true);
|
||||
|
||||
var tag = localStorage.getItem("tag-range");
|
||||
if (!tag) {
|
||||
var tag = "all";
|
||||
}
|
||||
$("#t_" + tag).prop("checked", true);
|
||||
|
||||
var box = localStorage.getItem("box");
|
||||
if (!box) {
|
||||
var box = "yes";
|
||||
}
|
||||
$("#bx_" + box).prop("checked", true);
|
||||
|
||||
var uld = localStorage.getItem("locale");
|
||||
if (!uld) {
|
||||
var uld = "yes";
|
||||
}
|
||||
$("#ul_" + uld).prop("checked", true);
|
||||
|
||||
var nnd = localStorage.getItem("nativenotf");
|
||||
if (!nnd) {
|
||||
var nnd = "yes";
|
||||
}
|
||||
$("#ntf_" + nnd).prop("checked", true);
|
||||
|
||||
var qt = localStorage.getItem("quote");
|
||||
if (!qt) {
|
||||
var qt = "simple";
|
||||
}
|
||||
$("#q_" + qt).prop("checked", true);
|
||||
|
||||
var viat = localStorage.getItem("viashow");
|
||||
if (!viat) {
|
||||
var viat = "hide";
|
||||
}
|
||||
$("#via_" + viat).prop("checked", true);
|
||||
|
||||
var movt = localStorage.getItem("mouseover");
|
||||
if (!movt) {
|
||||
var movt = "no";
|
||||
}
|
||||
$("#mov_" + movt).prop("checked", true);
|
||||
|
||||
var notfmt = localStorage.getItem("setasread");
|
||||
if (!notfmt) {
|
||||
var notfmt = "yes";
|
||||
}
|
||||
$("#notfm_" + notfmt).prop("checked", true);
|
||||
|
||||
var maint = localStorage.getItem("mainuse");
|
||||
if (!maint) {
|
||||
var maint = "remain";
|
||||
}
|
||||
$("#mn_" + maint).prop("checked", true);
|
||||
|
||||
var sect = localStorage.getItem("sec");
|
||||
if (!sect) {
|
||||
var sect = "nothing";
|
||||
}
|
||||
$("#sec-" + sect).prop("checked", true);
|
||||
|
||||
}
|
||||
|
||||
function climute(){
|
||||
//クライアントミュート
|
||||
var cli = localStorage.getItem("client_mute");
|
||||
var obj = JSON.parse(cli);
|
||||
if(!obj){
|
||||
$("#mute-cli").html(lang.lang_setting_nomuting);
|
||||
}else{
|
||||
if(!obj[0]){
|
||||
$("#mute-cli").html(lang.lang_setting_nomuting);
|
||||
return;
|
||||
}
|
||||
var templete;
|
||||
Object.keys(obj).forEach(function(key) {
|
||||
var cli = obj[key];
|
||||
var list = key * 1 + 1;
|
||||
templete = '<div class="acct" id="acct_' + key + '">' + list +
|
||||
'.' +
|
||||
cli + '<button class="btn waves-effect red disTar" onclick="cliMuteDel(' +
|
||||
key + ')">'+lang.lang_del+'</button><br></div>';
|
||||
$("#mute-cli").append(templete);
|
||||
});
|
||||
}
|
||||
}
|
||||
function cliMuteDel(key){
|
||||
var cli = localStorage.getItem("client_mute");
|
||||
var obj = JSON.parse(cli);
|
||||
obj.splice(key, 1);
|
||||
var json = JSON.stringify(obj);
|
||||
localStorage.setItem("client_mute", json);
|
||||
mute();
|
||||
}
|
||||
|
||||
function wordmute(){
|
||||
var word = localStorage.getItem("word_mute");
|
||||
var obj = JSON.parse(word);
|
||||
$('#wordmute').material_chip({
|
||||
data: obj,
|
||||
});
|
||||
}
|
||||
function wordmuteSave(){
|
||||
var word=$('#wordmute').material_chip('data');
|
||||
var json = JSON.stringify(word);
|
||||
localStorage.setItem("word_mute", json);
|
||||
}
|
||||
|
||||
function wordemp(){
|
||||
var word = localStorage.getItem("word_emp");
|
||||
var obj = JSON.parse(word);
|
||||
$('#wordemp').material_chip({
|
||||
data: obj,
|
||||
});
|
||||
}
|
||||
function wordempSave(){
|
||||
var word=$('#wordemp').material_chip('data');
|
||||
var json = JSON.stringify(word);
|
||||
localStorage.setItem("word_emp", json);
|
||||
}
|
||||
function notftest(){
|
||||
var electron = require("electron");
|
||||
var ipc = electron.ipcRenderer;
|
||||
var os = electron.remote.process.platform;
|
||||
var options = {
|
||||
body: lang.lang_setting_notftest+'('+lang.lang_setting_notftestprof+')',
|
||||
icon: localStorage.getItem("prof_0")
|
||||
};
|
||||
if(os=="darwin"){
|
||||
var n = new Notification('TheDesk'+lang.lang_setting_notftest, options);
|
||||
}else{
|
||||
ipc.send('native-notf', ['TheDesk'+lang.lang_setting_notftest,lang.lang_setting_notftest+'('+lang.lang_setting_notftestprof+')',localStorage.getItem('prof_0'),"",""]);
|
||||
}
|
||||
|
||||
}
|
||||
function oks(no){
|
||||
var txt=$("#oks-"+no).val();
|
||||
localStorage.setItem("oks-"+no, txt);
|
||||
Materialize.toast(lang.lang_setting_ksref, 3000);
|
||||
}
|
||||
function oksload(){
|
||||
if(localStorage.getItem("oks-1")){$("#oks-1").val(localStorage.getItem("oks-1"))}
|
||||
if(localStorage.getItem("oks-2")){$("#oks-2").val(localStorage.getItem("oks-2"))}
|
||||
if(localStorage.getItem("oks-3")){$("#oks-3").val(localStorage.getItem("oks-3"))}
|
||||
}
|
||||
function changelang(lang){
|
||||
var electron = require("electron");
|
||||
var ipc = electron.ipcRenderer;
|
||||
ipc.send('lang',lang);
|
||||
ipc.on('langres', function (event, arg) {
|
||||
location.href="../"+lang+"/setting.html"
|
||||
});
|
||||
}
|
||||
function exportSettings(){
|
||||
if(!confirm(lang.lang_setting_exportwarn)){
|
||||
return false;
|
||||
}
|
||||
var electron = require("electron");
|
||||
var remote=electron.remote;
|
||||
var dialog=remote.dialog;
|
||||
var ipc = electron.ipcRenderer;
|
||||
dialog.showSaveDialog(null, {
|
||||
title: 'Export',
|
||||
properties: ['openFile', 'createDirectory'],
|
||||
defaultPath: "export.thedeskconfig"
|
||||
}, (savedFiles) => {
|
||||
console.log(savedFiles);
|
||||
if(!savedFiles){
|
||||
return false;
|
||||
}
|
||||
var exp={};
|
||||
//Accounts
|
||||
var multi = localStorage.getItem("multi");
|
||||
var acct = JSON.parse(multi);
|
||||
exp.accts=acct;
|
||||
//Columns
|
||||
var multi = localStorage.getItem("column");
|
||||
var column = JSON.parse(multi);
|
||||
exp.columns=column;
|
||||
//Themes
|
||||
exp.theme=localStorage.getItem("theme");
|
||||
//Min width
|
||||
exp.minwidth=localStorage.getItem("width");
|
||||
//Font
|
||||
exp.font=localStorage.getItem("font");
|
||||
exp.size=localStorage.getItem("size");
|
||||
//Img height
|
||||
exp.imgheight=localStorage.getItem("img-height");
|
||||
//Main
|
||||
exp.mainuse=localStorage.getItem("mainuse");
|
||||
//CW text
|
||||
exp.cw=localStorage.getItem("cw-text");
|
||||
//vis
|
||||
exp.vis=localStorage.getItem("vis");
|
||||
//keysc
|
||||
exp.ksc=[
|
||||
localStorage.getItem("oks-1"),
|
||||
localStorage.getItem("oks-2"),
|
||||
localStorage.getItem("oks-3")
|
||||
];
|
||||
//climu
|
||||
var cli = localStorage.getItem("client_mute");
|
||||
var climu = JSON.parse(cli);
|
||||
exp.clientMute=climu;
|
||||
//wordmu
|
||||
var wdm = localStorage.getItem("word_mute");
|
||||
var wordmu = JSON.parse(wdm);
|
||||
exp.wordMute=wordmu;
|
||||
//spotify
|
||||
exp.spotifyArtwork=localStorage.getItem("artwork")
|
||||
var content=localStorage.getItem("np-temp");
|
||||
if(content || content=="" || content=="null"){
|
||||
exp.spotifyTemplete=content;
|
||||
}else{
|
||||
exp.spotifyTemplete=null;
|
||||
}
|
||||
//tags
|
||||
var tagarr = localStorage.getItem("tag");
|
||||
var favtag = JSON.parse(tagarr);
|
||||
exp.favoriteTags=favtag;
|
||||
console.log(exp);
|
||||
ipc.send('export', [savedFiles,JSON.stringify(exp)]);
|
||||
alert("Done.")
|
||||
//cards
|
||||
//lang
|
||||
});
|
||||
}
|
||||
function importSettings(){
|
||||
if(!confirm(lang.lang_setting_importwarn)){
|
||||
return false;
|
||||
}
|
||||
var electron = require("electron");
|
||||
var remote=electron.remote;
|
||||
var dialog=remote.dialog;
|
||||
var ipc = electron.ipcRenderer;
|
||||
dialog.showOpenDialog(null, {
|
||||
title: 'Import',
|
||||
properties: ['openFile'],
|
||||
filters: [
|
||||
{name: 'TheDesk Config', extensions: ['thedeskconfig']},
|
||||
]
|
||||
}, (fileNames) => {
|
||||
console.log(fileNames);
|
||||
if(!fileNames){
|
||||
return false;
|
||||
}
|
||||
ipc.send('import', fileNames[0]);
|
||||
ipc.on('config', function (event, arg) {
|
||||
var obj = JSON.parse(arg);
|
||||
if(obj){
|
||||
localStorage.clear();
|
||||
localStorage.setItem("multi",JSON.stringify(obj.accts));
|
||||
for(var key=0;key<obj.accts.length;key++){
|
||||
var acct=obj.accts[key];
|
||||
localStorage.setItem("name_" + key, acct.name);
|
||||
localStorage.setItem("user_" + key, acct.user);
|
||||
localStorage.setItem("user-id_" + key, acct.id);
|
||||
localStorage.setItem("prof_" + key, acct.prof);
|
||||
localStorage.setItem("domain_" + key, acct.domain);
|
||||
localStorage.setItem("acct_"+ key + "_at", acct.at);
|
||||
}
|
||||
localStorage.setItem("column",JSON.stringify(obj.columns));
|
||||
localStorage.setItem("theme",obj.theme);
|
||||
if(obj.width){
|
||||
console.log(obj.width)
|
||||
localStorage.setItem("width",obj.width);
|
||||
}
|
||||
if(obj.font){
|
||||
localStorage.setItem("font",obj.font);
|
||||
}
|
||||
if(obj.size){
|
||||
localStorage.setItem("size",obj.size);
|
||||
}
|
||||
themes(obj.theme);
|
||||
if(obj.imgheight){
|
||||
localStorage.setItem("img-height",obj.imgheight);
|
||||
}
|
||||
localStorage.setItem("mainuse",obj.mainuse);
|
||||
if(obj.cw){
|
||||
localStorage.setItem("cwtext",obj.cw);
|
||||
}
|
||||
localStorage.setItem("vis",obj.vis);
|
||||
if(obj.ksc[0]){
|
||||
localStorage.setItem("oks-1",obj.ksc[0]);
|
||||
}
|
||||
if(obj.ksc[1]){
|
||||
localStorage.setItem("oks-2",obj.ksc[1]);
|
||||
}
|
||||
if(obj.ksc[2]){
|
||||
localStorage.setItem("oks-3",obj.ksc[2]);
|
||||
}
|
||||
if(obj.clientMute){
|
||||
localStorage.setItem("client_mute",JSON.stringify(obj.clientMute));
|
||||
}
|
||||
if(obj.wordMute){
|
||||
localStorage.setItem("word_mute",JSON.stringify(obj.wordMute));
|
||||
}
|
||||
if(obj.favoriteTags){
|
||||
localStorage.setItem("tag",JSON.stringify(obj.favoriteTags));
|
||||
}
|
||||
|
||||
localStorage.setItem("np-temp",obj.spotifyTemplete);
|
||||
for(var i=0;i<obj.columns.length;i++){
|
||||
localStorage.setItem("card_" + i,"true");
|
||||
localStorage.removeItem("catch_" + i);
|
||||
}
|
||||
location.href="language.html";
|
||||
}else{
|
||||
alert("Error.")
|
||||
}
|
||||
})
|
||||
//cards
|
||||
//lang
|
||||
});
|
||||
}
|
||||
function savefolder(){
|
||||
var electron = require("electron");
|
||||
var remote=electron.remote;
|
||||
var dialog=remote.dialog;
|
||||
dialog.showOpenDialog(null, {
|
||||
title: 'Save folder',
|
||||
properties: ['openDirectory'],
|
||||
}, (fileNames) => {
|
||||
localStorage.setItem("savefolder",fileNames[0]);
|
||||
});
|
||||
}
|
||||
|
||||
function font(){
|
||||
var electron = require("electron");
|
||||
var ipc = electron.ipcRenderer;
|
||||
ipc.send('fonts', []);
|
||||
ipc.on('font-list', function (event, arg) {
|
||||
$("#fonts").removeClass("hide");
|
||||
for( var i=0; i<arg.length; i++) {
|
||||
var font=arg[i];
|
||||
$("#fonts").append('<div class="font pointer" style="font-family:'+font.family+'" onclick="insertFont(\''+font.family+'\')">'+font.family+"</div>")
|
||||
}
|
||||
});
|
||||
}
|
||||
function insertFont(name){
|
||||
$("#font").val(name);
|
||||
}
|
||||
$(".color-picker").each(function(i, elem) {
|
||||
pickerDefine(i,"fff");
|
||||
});
|
||||
function pickerDefine(i,color){
|
||||
var pickr = new Pickr({
|
||||
el: '#color-picker'+i,
|
||||
default: color,
|
||||
showAlways: true,
|
||||
appendToBody: true,
|
||||
closeWithKey: 'Escape',
|
||||
comparison: false,
|
||||
components: {
|
||||
preview: true, // Left side color comparison
|
||||
opacity: false, // Opacity slider
|
||||
hue: true, // Hue slider
|
||||
interaction: {
|
||||
rgba: false, // rgba option (red green blue and alpha)
|
||||
input: true, // input / output element
|
||||
}
|
||||
},
|
||||
strings: {
|
||||
save: 'Save', // Default for save button
|
||||
clear: 'Clear' // Default for clear button
|
||||
}
|
||||
});
|
||||
pickr.on('change', (...args) => {
|
||||
var rgb='rgb('+args[0].toRGBA()[0]+','+args[0].toRGBA()[1]+','+args[0].toRGBA()[2]+')';
|
||||
$("#color-picker"+i+"_value").val(rgb)
|
||||
});
|
||||
}
|
||||
function customComp(){
|
||||
var nameC=$("#custom_name").val();
|
||||
if(!nameC){return false;}
|
||||
var descC=$("#custom_desc").val();
|
||||
var primaryC=$("#color-picker0_value").val();
|
||||
if(!primaryC){primaryC="rgb(255,255,255)"}
|
||||
var secondaryC=$("#color-picker1_value").val();
|
||||
if(!secondaryC){secondaryC="rgb(255,255,255)"}
|
||||
var textC=$("#color-picker2_value").val();
|
||||
if(!textC){textC="rgb(255,255,255)"}
|
||||
var accentC=$("#color-picker3_value").val();
|
||||
if(!accentC){accentC="rgb(255,255,255)"}
|
||||
var multi = localStorage.getItem("multi");
|
||||
var my=JSON.parse(multi)[0].name;
|
||||
var id=$("#custom-edit-sel").val();
|
||||
if(id=="add_new"){
|
||||
id=makeCID();
|
||||
}
|
||||
var json={
|
||||
"name": nameC,
|
||||
"author": my,
|
||||
"desc": descC,
|
||||
"base": $("[name=direction]:checked").val(),
|
||||
"vars": {
|
||||
"primary": primaryC,
|
||||
"secondary": secondaryC,
|
||||
"text": textC
|
||||
},
|
||||
"props": {
|
||||
"TheDeskAccent": accentC
|
||||
},
|
||||
"id": id
|
||||
}
|
||||
$("#custom_json").val(JSON.stringify(json));
|
||||
themes();
|
||||
$("#custom_name").val("");
|
||||
$("#custom_desc").val("");
|
||||
$("#dark").prop("checked", true);
|
||||
$("#custom_json").val("");
|
||||
$("#color-picker0-wrap").html('<div class="color-picker" id="color-picker0"></div>')
|
||||
$("#color-picker1-wrap").html('<div class="color-picker" id="color-picker1"></div>')
|
||||
$("#color-picker2-wrap").html('<div class="color-picker" id="color-picker2"></div>')
|
||||
$("#color-picker3-wrap").html('<div class="color-picker" id="color-picker3"></div>')
|
||||
$("#color-picker0_value").val("");
|
||||
$("#color-picker1_value").val("");
|
||||
$("#color-picker2_value").val("");
|
||||
$("#color-picker3_value").val("");
|
||||
pickerDefine(0,"fff");
|
||||
pickerDefine(1,"fff");
|
||||
pickerDefine(2,"fff");
|
||||
pickerDefine(3,"fff");
|
||||
ipc.send('theme-json-create', JSON.stringify(json));
|
||||
}
|
||||
function deleteIt(){
|
||||
var id=$("#custom-sel-sel").val();
|
||||
$("#custom_name").val("");
|
||||
$("#custom_desc").val("");
|
||||
$("#dark").prop("checked", true);
|
||||
$("#custom_json").val("");
|
||||
$("#color-picker0-wrap").html('<div class="color-picker" id="color-picker0"></div>')
|
||||
$("#color-picker1-wrap").html('<div class="color-picker" id="color-picker1"></div>')
|
||||
$("#color-picker2-wrap").html('<div class="color-picker" id="color-picker2"></div>')
|
||||
$("#color-picker3-wrap").html('<div class="color-picker" id="color-picker3"></div>')
|
||||
$("#color-picker0_value").val("");
|
||||
$("#color-picker1_value").val("");
|
||||
$("#color-picker2_value").val("");
|
||||
$("#color-picker3_value").val("");
|
||||
pickerDefine(0,"fff");
|
||||
pickerDefine(1,"fff");
|
||||
pickerDefine(2,"fff");
|
||||
pickerDefine(3,"fff");
|
||||
ipc.on('theme-json-delete-complete', function (event, args) {
|
||||
ctLoad()
|
||||
});
|
||||
ipc.send('theme-json-delete', id);
|
||||
}
|
||||
function ctLoad(){
|
||||
ipc.send('theme-json-list', "");
|
||||
ipc.on('theme-json-list-response', function (event, args) {
|
||||
console.log(args);
|
||||
var templete="";
|
||||
Object.keys(args).forEach(function(key) {
|
||||
var theme = args[key];
|
||||
var themeid=theme.id
|
||||
templete = templete+'<option value="'+themeid+'">' + theme.name +'</option>';
|
||||
});
|
||||
if(args[0]){
|
||||
localStorage.setItem("customtheme-id",args[0].id)
|
||||
}
|
||||
$("#custom-sel-sel").html(templete);
|
||||
templete='<option value="add_new">'+$("#edit-selector").attr("data-add")+'</option>'+templete;
|
||||
$("#custom-edit-sel").html(templete);
|
||||
$('select').material_select('update');
|
||||
});
|
||||
}
|
||||
function customSel(){
|
||||
var id=$("#custom-sel-sel").val();
|
||||
localStorage.setItem("customtheme-id",id)
|
||||
}
|
||||
function custom(){
|
||||
var id=$("#custom-edit-sel").val();
|
||||
if(id=="add_new"){
|
||||
$("#custom_name").val("");
|
||||
$("#custom_desc").val("");
|
||||
$("#dark").prop("checked", true);
|
||||
$("#custom_json").val("");
|
||||
$("#color-picker0-wrap").html('<div class="color-picker" id="color-picker0"></div>')
|
||||
$("#color-picker1-wrap").html('<div class="color-picker" id="color-picker1"></div>')
|
||||
$("#color-picker2-wrap").html('<div class="color-picker" id="color-picker2"></div>')
|
||||
$("#color-picker3-wrap").html('<div class="color-picker" id="color-picker3"></div>')
|
||||
$("#color-picker0_value").val("");
|
||||
$("#color-picker1_value").val("");
|
||||
$("#color-picker2_value").val("");
|
||||
$("#color-picker3_value").val("");
|
||||
pickerDefine(0,"fff");
|
||||
pickerDefine(1,"fff");
|
||||
pickerDefine(2,"fff");
|
||||
pickerDefine(3,"fff");
|
||||
$("#delTheme").addClass("disabled")
|
||||
}else{
|
||||
$("#delTheme").removeClass("disabled")
|
||||
ipc.send('theme-json-request', id);
|
||||
ipc.on('theme-json-response', function (event, args) {
|
||||
console.log(args);
|
||||
$("#custom_name").val(args.name);
|
||||
$("#custom_desc").val(args.desc);
|
||||
$("#"+args.base).prop("checked", true);
|
||||
$("#color-picker0-wrap").html('<div class="color-picker" id="color-picker0"></div>')
|
||||
pickerDefine(0,rgbToHex(args.vars.primary))
|
||||
$("#color-picker0_value").val(args.vars.primary);
|
||||
$("#color-picker1-wrap").html('<div class="color-picker" id="color-picker1"></div>')
|
||||
pickerDefine(1,rgbToHex(args.vars.secondary))
|
||||
$("#color-picker1_value").val(args.vars.secondary);
|
||||
$("#color-picker2-wrap").html('<div class="color-picker" id="color-picker2"></div>')
|
||||
$("#color-picker2_value").val(args.vars.text);
|
||||
pickerDefine(2,rgbToHex(args.vars.text))
|
||||
if(args.props){
|
||||
if(args.props.TheDeskAccent){
|
||||
var accent=args.props.TheDeskAccent;
|
||||
}else{
|
||||
var accent=args.vars.secondary;
|
||||
}
|
||||
}else{
|
||||
var accent=args.vars.secondary;
|
||||
}
|
||||
$("#color-picker3-wrap").html('<div class="color-picker" id="color-picker3"></div>')
|
||||
pickerDefine(3,rgbToHex(accent))
|
||||
$("#custom_json").val(JSON.stringify(args));
|
||||
});
|
||||
}
|
||||
}
|
||||
function customImp(){
|
||||
var json=$("#custom_import").val();
|
||||
if(JSON5.parse(json)){
|
||||
ipc.send('theme-json-create', json);
|
||||
}else{
|
||||
alert("Error")
|
||||
}
|
||||
}
|
||||
function hardwareAcceleration(){
|
||||
var had = $("[name=ha]:checked").val();
|
||||
localStorage.setItem("ha", had);
|
||||
console.log("ha");
|
||||
ipc.send('ha', had);
|
||||
}
|
||||
|
||||
ipc.on('theme-json-create-complete', function (event, args) {
|
||||
$("#custom_import").val("");
|
||||
ctLoad()
|
||||
});
|
||||
//最初に読む
|
||||
load();
|
||||
climute();
|
||||
wordmute();
|
||||
wordemp();
|
||||
checkSpotify();
|
||||
voiceSettingLoad();
|
||||
oksload();
|
||||
npprovider();
|
||||
ctLoad()
|
||||
@@ -1,5 +1,6 @@
|
||||
//ソートデータ読み込み
|
||||
function sortload() {
|
||||
function sortLoad () {
|
||||
$("#sort").html("");
|
||||
var col = localStorage.getItem("column");
|
||||
if (col) {
|
||||
var obj = JSON.parse(col);
|
||||
@@ -104,7 +105,7 @@ function sort() {
|
||||
localStorage.setItem("column", json);
|
||||
$("#sort").html("");
|
||||
M.toast({ html: "Sorted", displayLength: 3000 })
|
||||
sortload();
|
||||
sortLoad();
|
||||
parseColumn();
|
||||
sortMenu()
|
||||
}
|
||||
@@ -115,5 +116,5 @@ function sortMenu() {
|
||||
$(".menu-content").addClass("hide");
|
||||
$("#sort-box").removeClass("hide");
|
||||
$("#sort").html("");
|
||||
sortload();
|
||||
sortLoad();
|
||||
}
|
||||
@@ -108,7 +108,10 @@ function nowplaying(mode) {
|
||||
$("#textarea").val(content);
|
||||
});
|
||||
} else {
|
||||
alert(lang.lang_spotify_acct);
|
||||
Swal.fire({
|
||||
type: 'info',
|
||||
title: lang.lang_spotify_acct
|
||||
})
|
||||
}
|
||||
} else if (mode == "itunes") {
|
||||
postMessage(["itunes", ""], "*")
|
||||
@@ -131,14 +134,18 @@ function npCore(arg) {
|
||||
media(arg.path, "image/png", "new");
|
||||
}
|
||||
} else if (platform == "darwin") {
|
||||
if (flag && arg.existsArtwork) {
|
||||
media(arg.artworks[0].data, "image/png", "new");
|
||||
if (flag && arg.artwork) {
|
||||
media(arg.artwork, "image/png", "new");
|
||||
}
|
||||
}
|
||||
var regExp = new RegExp("{song}", "g");
|
||||
content = content.replace(regExp, arg.name);
|
||||
var regExp = new RegExp("{album}", "g");
|
||||
content = content.replace(regExp, arg.album);
|
||||
if(arg.album){
|
||||
if(arg.album.name){
|
||||
content = content.replace(regExp, arg.album.name);
|
||||
}
|
||||
}
|
||||
var regExp = new RegExp("{artist}", "g");
|
||||
content = content.replace(regExp, arg.artist);
|
||||
var regExp = new RegExp("{url}", "g");
|
||||
@@ -162,24 +169,6 @@ function spotifySave() {
|
||||
localStorage.setItem("np-temp", temp);
|
||||
M.toast({ html: lang.lang_spotify_np, displayLength: 3000 })
|
||||
}
|
||||
function npprovider() {
|
||||
var provd = $("[name=npp]:checked").val();
|
||||
if (!provd) {
|
||||
if (localStorage.getItem("np_provider")) {
|
||||
$("[value=" + localStorage.getItem("np_provider") + "]").prop("checked", true);
|
||||
} else {
|
||||
$("[value=AIMP]").prop("checked", true);
|
||||
localStorage.setItem("np_provider", "AIMP");
|
||||
}
|
||||
} else {
|
||||
if (provd != localStorage.getItem("np_provider")) {
|
||||
M.toast({ html: lang.lang_setting_npprovide.replace("{{set}}", provd), displayLength: 3000 })
|
||||
}
|
||||
localStorage.setItem("np_provider", provd);
|
||||
postMessage(["itunes", ["set", provd]], "*")
|
||||
|
||||
}
|
||||
}
|
||||
if (location.search) {
|
||||
var m = location.search.match(/\?mode=([a-zA-Z-0-9]+)\&code=(.+)/);
|
||||
var mode = m[1];
|
||||
@@ -193,10 +182,3 @@ if (location.search) {
|
||||
}
|
||||
|
||||
}
|
||||
$("#npbtn").click(function () {
|
||||
nowplaying('spotify');
|
||||
});
|
||||
$("#npbtn").bind('contextmenu', function () {
|
||||
nowplaying('itunes');
|
||||
return false;
|
||||
});
|
||||
@@ -7,22 +7,26 @@ function themes(theme) {
|
||||
localStorage.setItem("theme", "black");
|
||||
}
|
||||
}
|
||||
$("html").removeClass("indigotheme");
|
||||
$("html").removeClass("greentheme");
|
||||
$("html").removeClass("browntheme");
|
||||
$("html").removeClass("blacktheme");
|
||||
$("html").removeClass("customtheme");
|
||||
$("html").addClass(theme + "theme");
|
||||
var el = document.getElementsByTagName("html")[0]
|
||||
|
||||
el.classList.remove('indigotheme');
|
||||
el.classList.remove('greentheme');
|
||||
el.classList.remove('browntheme');
|
||||
el.classList.remove('blacktheme');
|
||||
el.classList.remove('bluetheme');
|
||||
el.classList.remove('customtheme');
|
||||
el.classList.add(theme + "theme");
|
||||
var font = localStorage.getItem("font");
|
||||
if (font) {
|
||||
$("html").css("font-family", font);
|
||||
el.style.fontFamily = font;
|
||||
} else {
|
||||
$("html").css("font-family", "");
|
||||
el.style.fontFamily = "";
|
||||
}
|
||||
if (theme == "custom") {
|
||||
if (localStorage.getItem("customtheme-id")) {
|
||||
postMessage(["themeCSSRequest", localStorage.getItem("customtheme-id")], "*")
|
||||
}
|
||||
}
|
||||
el.style.backgroundColor = "var(--bg)";
|
||||
}
|
||||
themes();
|
||||
@@ -25,7 +25,7 @@ function tips(mode) {
|
||||
clearInterval(spotStart);
|
||||
if (mode == "ver") {
|
||||
tipsToggle()
|
||||
$("#tips-text").html('<img src="../../img/desk.png" width="20" onclick="todo(\'!TheDesk! It\\\'s a nice client!\')"><span style="font-size:20px">TheDesk</span> ' + localStorage.getItem("ver") + '[<i class="material-icons" style="font-size:1.2rem;top: 3px;position: relative;">supervisor_account</i><span id="persons">1+</span>]')
|
||||
$("#tips-text").html('<img src="../../img/desk.png" width="20" onclick="todo(\'TheDesk is a nice client!: TheDesk ' + localStorage.getItem("ver") + ' git: '+ gitHash +'\')">TheDesk ' + localStorage.getItem("ver") + ' {'+ gitHash.slice(0, 7) +'} [<i class="material-icons" style="font-size:1.2rem;top: 3px;position: relative;">supervisor_account</i><span id="persons">1+</span>]')
|
||||
localStorage.setItem("tips", "ver")
|
||||
} else if (mode == "clock") {
|
||||
tipsToggle()
|
||||
@@ -133,7 +133,10 @@ function spotifytips() {
|
||||
spotint = setInterval(spotStart, 1000);
|
||||
});
|
||||
} else {
|
||||
alert(lang.lang_spotify_acct);
|
||||
Swal.fire({
|
||||
type: 'info',
|
||||
title: lang.lang_spotify_acct
|
||||
})
|
||||
}
|
||||
}
|
||||
function spotStart() {
|
||||
|
||||
@@ -162,7 +162,7 @@ function flw(user, more, acct_id) {
|
||||
} else {
|
||||
$("#his-follow-list-contents").html(templete);
|
||||
}
|
||||
|
||||
jQuery("time.timeago").timeago();
|
||||
|
||||
});
|
||||
}
|
||||
@@ -228,7 +228,7 @@ function fer(user, more, acct_id) {
|
||||
} else {
|
||||
$("#his-follower-list-contents").html(templete);
|
||||
}
|
||||
|
||||
jQuery("time.timeago").timeago();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -390,7 +390,7 @@ function showBlo(more, acct_id) {
|
||||
} else {
|
||||
$("#his-blocking-list-contents").html(templete);
|
||||
}
|
||||
|
||||
jQuery("time.timeago").timeago();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -453,7 +453,7 @@ function showReq(more, acct_id) {
|
||||
} else {
|
||||
$("#his-request-list-contents").html(templete);
|
||||
}
|
||||
|
||||
jQuery("time.timeago").timeago();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -550,15 +550,19 @@ function showFrl(more, acct_id) {
|
||||
} else {
|
||||
$("#his-follow-recom-contents").html(templete);
|
||||
}
|
||||
|
||||
jQuery("time.timeago").timeago();
|
||||
});
|
||||
}
|
||||
//Keybase
|
||||
function udAdd(start) {
|
||||
fetch(start, {
|
||||
function udAdd(acct_id, id, start) {
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var proof = "https://" + domain + "/api/v1/accounts/" + id + "/identity_proofs"
|
||||
fetch(proof, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Accept': 'application/json'
|
||||
'content-type': 'application/json',
|
||||
'Authorization': 'Bearer ' + at
|
||||
},
|
||||
//body: JSON.stringify({})
|
||||
}).then(function (response) {
|
||||
@@ -567,16 +571,10 @@ function udAdd(start) {
|
||||
todo(error);
|
||||
console.error(error);
|
||||
}).then(function (json) {
|
||||
var fields = json.attachment;
|
||||
var fields = json;
|
||||
for (var i = 0; i < fields.length; i++) {
|
||||
if (fields[i].type == "IdentityProof") {
|
||||
if (fields[i].signatureAlgorithm == "keybase") {
|
||||
var html = '<a href="https://keybase.io/' + fields[i].name + '" target="_blank" class="cbadge teal waves-effect" style="max-width:200px;" title="' + lang.lang_hisdata_key.replace("{{set}}", escapeHTML(fields[i].signatureAlgorithm)) + '"><i class="fas fa-key" aria-hidden="true"></i>' + escapeHTML(fields[i].signatureAlgorithm) + ':' + escapeHTML(fields[i].name) + '</a>';
|
||||
} else {
|
||||
var html = '<span class="cbadge teal" style="max-width:200px;" title="' + lang.lang_hisdata_key.replace("{{set}}", escapeHTML(fields[i].signatureAlgorithm)) + '"><i class="fas fa-key" aria-hidden="true"></i>' + escapeHTML(fields[i].signatureAlgorithm) + ':' + escapeHTML(fields[i].name) + '</span>';
|
||||
}
|
||||
$("#his-proof-prof").append(html)
|
||||
}
|
||||
var html = '<a href="' + fields[i].proof_url + '" target="_blank" class="cbadge teal waves-effect" style="max-width:200px;" title="' + lang.lang_hisdata_key.replace("{{set}}", escapeHTML(fields[i].provider)) + '"><i class="fas fa-key" aria-hidden="true"></i>' + escapeHTML(fields[i].provider) + ':' + escapeHTML(fields[i].provider_username) + '</a>';
|
||||
$("#his-proof-prof").append(html)
|
||||
}
|
||||
});
|
||||
fetch("https://notestock.osa-p.net/api/v1/isstock.json?id=" + start.replace("@", "users/"), {
|
||||
@@ -622,12 +620,17 @@ function showMat() {
|
||||
var templete = "";
|
||||
Object.keys(json).forEach(function (key) {
|
||||
var user = json[key];
|
||||
if (user.avatar) {
|
||||
var avatar = user.avatar
|
||||
} else {
|
||||
var avatar = "../../img/loading.svg"
|
||||
}
|
||||
templete = templete +
|
||||
'<div class="" style="padding-top:5px;">' +
|
||||
'<div style="padding:0; margin:0; width:400px; max-width:100%; display:flex; align-items:flex-end;">' +
|
||||
'<div style="flex-basis:40px;"><a onclick="udgEx(\'' + user.user + '\',' +
|
||||
acct_id + ');" user="' + user.user + '" class="udg">' +
|
||||
'<img src="' + user.avatar + '" width="40" class="prof-img" user="' + user.user + '"></a></div>' +
|
||||
'<img src="' + avatar + '" width="40" class="prof-img" user="' + user.user + '"></a></div>' +
|
||||
'<div style="flex-grow:3; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;user-select:auto; cursor:text;"><big>' +
|
||||
escapeHTML(user.screen_name) + '</big></div>' +
|
||||
'<div class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;user-select:auto; cursor:text;"> @' +
|
||||
|
||||
@@ -23,7 +23,7 @@ function udgEx(user, acct_id) {
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
if (localStorage.getItem("mode_" + domain) == "misskey") { return false; }
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/search?resolve=true&q=" + user
|
||||
var start = "https://" + domain + "/api/v2/search?resolve=true&q=" + user
|
||||
fetch(start, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
@@ -36,11 +36,11 @@ function udgEx(user, acct_id) {
|
||||
todo(error);
|
||||
console.error(error);
|
||||
}).then(function (json) {
|
||||
if (json.accounts) {
|
||||
if (json.accounts[0]) {
|
||||
var id = json.accounts[0].id;
|
||||
udg(id, acct_id);
|
||||
} else {
|
||||
postMessage(["openUrl", url], "*")
|
||||
postMessage(["openUrl", user], "*")
|
||||
}
|
||||
});
|
||||
return true;
|
||||
@@ -79,8 +79,10 @@ function udg(user, acct_id) {
|
||||
}
|
||||
//moved設定時
|
||||
if (json.moved) {
|
||||
M.toast({ html: lang.lang_showontl_movetxt + '<button class="btn-flat toast-action" onclick="udg(\'' +
|
||||
json.moved.id + '\',\'' + acct_id + '\')">' + lang.lang_showontl_movebtn + '</button>', displayLength: 4000 })
|
||||
M.toast({
|
||||
html: lang.lang_showontl_movetxt + '<button class="btn-flat toast-action" onclick="udg(\'' +
|
||||
json.moved.id + '\',\'' + acct_id + '\')">' + lang.lang_showontl_movebtn + '</button>', displayLength: 4000
|
||||
})
|
||||
}
|
||||
$('#his-data').modal('open');
|
||||
$('#his-data').attr("user-id", user);
|
||||
@@ -137,8 +139,10 @@ function udg(user, acct_id) {
|
||||
$("#his-since").text(crat(json.created_at));
|
||||
$("#his-openin").attr("data-href", json.url);
|
||||
if (json.fields) {
|
||||
var table =""
|
||||
if (json.fields.length > 0) {
|
||||
note = note + '<table id="his-field">'
|
||||
$("#his-des").css("max-height", "250px");
|
||||
table = '<table id="his-field">'
|
||||
for (var i = 0; i < json.fields.length; i++) {
|
||||
var fname = json.fields[i].name;
|
||||
var fval = json.fields[i].value;
|
||||
@@ -149,22 +153,24 @@ function udg(user, acct_id) {
|
||||
var when = "";
|
||||
var color = "inherit"
|
||||
}
|
||||
note = note + '<tr><td class="his-field-title">' + twemoji.parse(escapeHTML(fname)) + '</td><td class="his-field-content" title="' + when + '" style="background-color:' + color + '">' + twemoji.parse(fval) + '</td></tr>';
|
||||
table = table + '<tr><td class="his-field-title">' + escapeHTML(fname) + '</td><td class="his-field-content" title="' + when + '" style="background-color:' + color + '">' + fval + '</td></tr>';
|
||||
}
|
||||
note = note + '</table>'
|
||||
table = table + '</table>'
|
||||
$("#his-des").html(twemoji.parse(note));
|
||||
} else {
|
||||
$("#his-des").html(twemoji.parse(note));
|
||||
$("#his-des").css("max-height", "400px");
|
||||
}
|
||||
} else {
|
||||
$("#his-des").html(twemoji.parse(note));
|
||||
$("#his-table").html(twemoji.parse(table));
|
||||
}else {
|
||||
$("#his-des").css("max-height", "400px");
|
||||
}
|
||||
$("#his-des").html(twemoji.parse(note));
|
||||
if (json.bot) {
|
||||
$("#his-bot").html(lang.lang_showontl_botacct);
|
||||
}
|
||||
$("#his-des").attr("data-acct", acct_id);
|
||||
$('#his-data').css('background-size', 'cover');
|
||||
$("#his-data .tab-content").css("height", $("#his-float-timeline").height() - 70 + "px")
|
||||
$("#his-float-timeline").css("height", $("#his-data-show").height() + "px")
|
||||
localStorage.setItem("history", user);
|
||||
//自分の時
|
||||
if (json.acct == localStorage.getItem("user_" + acct_id)) {
|
||||
@@ -193,6 +199,9 @@ function udg(user, acct_id) {
|
||||
$("#his-emp-btn").hide();
|
||||
$(".only-my-data").show();
|
||||
$(".only-his-data").hide();
|
||||
if (localStorage.getItem("main") == acct_id) {
|
||||
$("#his-main-acct").hide();
|
||||
}
|
||||
} else {
|
||||
relations(user, acct_id);
|
||||
$(".only-my-data").hide();
|
||||
@@ -200,7 +209,7 @@ function udg(user, acct_id) {
|
||||
}
|
||||
todc();
|
||||
//外部データ取得(死かもしれないので)
|
||||
udAdd(json.url);
|
||||
udAdd(acct_id, user, json.url);
|
||||
});
|
||||
}
|
||||
function misskeyUdg(user, acct_id) {
|
||||
@@ -293,14 +302,17 @@ function misskeyUdg(user, acct_id) {
|
||||
$("#his-emp-btn").hide();
|
||||
$(".only-my-data").show();
|
||||
$(".only-his-data").hide();
|
||||
if (localStorage.getItem("main") == acct_id) {
|
||||
$("#his-main-acct").hide();
|
||||
}
|
||||
} else {
|
||||
if (json.isFollowing) {
|
||||
//自分がフォローしている
|
||||
$("#his-data").addClass("following");
|
||||
$("#his-follow-btn").text(lang.lang_status_unfollow);
|
||||
$("#his-follow-btn-text").text(lang.lang_status_unfollow);
|
||||
hisList(user, acct_id);
|
||||
} else {
|
||||
$("#his-follow-btn").text(lang.lang_status_follow);
|
||||
$("#his-follow-btn-text").text(lang.lang_status_follow);
|
||||
}
|
||||
if (json.isFollowed) {
|
||||
//フォローされてる
|
||||
@@ -309,9 +321,9 @@ function misskeyUdg(user, acct_id) {
|
||||
$("#his-block-btn").hide();
|
||||
if (json.isMuted) {
|
||||
$("#his-data").addClass("muting");
|
||||
$("#his-mute-btn").text(lang.lang_status_unmute);
|
||||
$("#his-mute-btn-text").text(lang.lang_status_unmute);
|
||||
} else {
|
||||
$("#his-mute-btn").text(lang.lang_status_mute);
|
||||
$("#his-mute-btn-text").text(lang.lang_status_mute);
|
||||
}
|
||||
$(".only-my-data").hide();
|
||||
$(".only-his-data").show();
|
||||
@@ -351,14 +363,13 @@ function relations(user, acct_id) {
|
||||
console.error(error);
|
||||
}).then(function (json) {
|
||||
var json = json[0];
|
||||
console.log(json);
|
||||
if (json.following) {
|
||||
//自分がフォローしている
|
||||
$("#his-data").addClass("following");
|
||||
$("#his-follow-btn").text(lang.lang_status_unfollow);
|
||||
$("#his-follow-btn-text").text(lang.lang_status_unfollow);
|
||||
hisList(user, acct_id);
|
||||
} else {
|
||||
$("#his-follow-btn").text(lang.lang_status_follow);
|
||||
$("#his-follow-btn-text").text(lang.lang_status_follow);
|
||||
}
|
||||
if (json.followed_by) {
|
||||
//フォローされてる
|
||||
@@ -366,49 +377,55 @@ function relations(user, acct_id) {
|
||||
}
|
||||
if (json.blocking) {
|
||||
$("#his-data").addClass("blocking");
|
||||
$("#his-block-btn").text(lang.lang_status_unblock);
|
||||
$("#his-block-btn-text").text(lang.lang_status_unblock);
|
||||
} else {
|
||||
$("#his-block-btn").text(lang.lang_status_block);
|
||||
$("#his-block-btn-text").text(lang.lang_status_block);
|
||||
}
|
||||
if (json.muting) {
|
||||
$("#his-data").addClass("muting");
|
||||
$("#his-mute-btn").text(lang.lang_status_unmute);
|
||||
$("#his-mute-btn-text").text(lang.lang_status_unmute);
|
||||
} else {
|
||||
$("#his-mute-btn").text(lang.lang_status_mute);
|
||||
$("#his-mute-btn-text").text(lang.lang_status_mute);
|
||||
}
|
||||
if (json.muting_notifications) {
|
||||
$("#his-data").addClass("mutingNotf");
|
||||
$("#his-notf-btn").text(lang.lang_showontl_notf + lang.lang_status_unmute);
|
||||
$("#his-notf-btn-text").text(lang.lang_showontl_notf + lang.lang_status_unmute);
|
||||
} else {
|
||||
$("#his-notf-btn").text(lang.lang_showontl_notf + lang.lang_status_mute);
|
||||
$("#his-notf-btn-text").text(lang.lang_showontl_notf + lang.lang_status_mute);
|
||||
}
|
||||
if (json.domain_blocking) {
|
||||
$("#his-data").addClass("blockingDom");
|
||||
$("#his-domain-btn").text(lang.lang_showontl_domain + lang.lang_status_unblock);
|
||||
$("#his-domain-btn-text").text(lang.lang_showontl_domain + lang.lang_status_unblock);
|
||||
} else {
|
||||
$("#his-domain-btn").text(lang.lang_showontl_domain + lang.lang_status_block);
|
||||
$("#his-domain-btn-text").text(lang.lang_showontl_domain + lang.lang_status_block);
|
||||
}
|
||||
//Endorsed
|
||||
if (json.endorsed) {
|
||||
$("#his-end-btn").addClass("endorsed");
|
||||
$("#his-end-btn").text(lang.lang_status_unendorse)
|
||||
$("#his-end-btn-text").text(lang.lang_status_unendorse)
|
||||
} else {
|
||||
$("#his-end-btn").removeClass("endorsed");
|
||||
$("#his-end-btn").text(lang.lang_status_endorse)
|
||||
$("#his-end-btn-text").text(lang.lang_status_endorse)
|
||||
}
|
||||
//Blocked
|
||||
if (json.blocked_by) {
|
||||
$("#his-float-timeline").hide();
|
||||
$("#his-float-blocked").show();
|
||||
$("#my-data-nav .btn").addClass("disabled")
|
||||
$(".his-var-content").hide();
|
||||
$("#his-float-blocked").show()
|
||||
$("#his-follow-btn").hide()
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
function profbrws() {
|
||||
const { shell } = require('electron');
|
||||
var url = $("#his-openin").attr("data-href")
|
||||
shell.openExternal(url);
|
||||
postMessage(["openUrl", url], "*")
|
||||
}
|
||||
function setMain() {
|
||||
var acct_id = $("#his-data").attr("use-acct")
|
||||
localStorage.setItem("main", acct_id);
|
||||
multiSelector(true)
|
||||
M.toast({ html: lang.lang_manager_mainAcct, displayLength: 3000 })
|
||||
}
|
||||
//オールリセット
|
||||
function hisclose() {
|
||||
@@ -418,8 +435,9 @@ function hisclose() {
|
||||
localStorage.removeItem("history");
|
||||
}
|
||||
function reset() {
|
||||
$(".tab-content:eq(0)").show();
|
||||
$(".tab-content:gt(0)").hide();
|
||||
$(".his-var-content:eq(0)").show();
|
||||
$(".his-var-content:gt(0)").hide();
|
||||
$("#my-data-nav .btn").removeClass("disabled")
|
||||
$(".active-back").removeClass("active-back");
|
||||
$(".column-first").addClass("active-back");
|
||||
$("#his-name").text("Loading");
|
||||
@@ -438,6 +456,7 @@ function reset() {
|
||||
$("#his-data").removeClass("mutingNotf");
|
||||
$("#his-data").removeClass("blockingDom");
|
||||
$("#his-end-btn").removeClass("endorsed");
|
||||
$("#his-des").css("max-height", "250px");
|
||||
$("#his-bot").html("");
|
||||
$("#his-follow-btn").show();
|
||||
$("#his-block-btn").show();
|
||||
@@ -445,9 +464,9 @@ function reset() {
|
||||
$("#his-notf-btn").show();
|
||||
$("#his-domain-btn").show();
|
||||
$("#his-emp-btn").show();
|
||||
$("#his-follow-btn").text(lang.lang_status_follow);
|
||||
$("#his-mute-btn").text(lang.lang_status_mute);
|
||||
$("#his-block-btn").text(lang.lang_status_block);
|
||||
$("#his-follow-btn-text").text(lang.lang_status_follow);
|
||||
$("#his-mute-btn-text").text(lang.lang_status_mute);
|
||||
$("#his-block-btn-text").text(lang.lang_status_block);
|
||||
$("#his-notf-btn").text(lang.lang_showontl_notf + lang.lang_status_mute);
|
||||
$("#his-domain-btn").text(lang.lang_showontl_domain + lang.lang_status_block);
|
||||
$("#his-relation").text("");
|
||||
@@ -465,12 +484,16 @@ function reset() {
|
||||
$("#his-openin").attr("data-href", "");
|
||||
$("#his-float-timeline").show();
|
||||
$("#his-float-blocked").hide();
|
||||
$("#his-main-acct").show();
|
||||
$("#his-proof-prof").html("")
|
||||
}
|
||||
$('#my-data-nav .tab').on('click', function () {
|
||||
var target = $(this).find("a").attr("go");
|
||||
$("#my-data-nav .tab").removeClass("active-back");
|
||||
$(this).addClass("active-back");
|
||||
$(target).show();
|
||||
$(".tab-content:not(" + target + ")").hide();
|
||||
$('#my-data-nav .anc-link').on('click', function () {
|
||||
var target = $(this).attr("go");
|
||||
if (target) {
|
||||
$("#my-data-nav .anc-link").removeClass("active-back");
|
||||
$(this).addClass("active-back");
|
||||
$(target).show();
|
||||
$(".his-var-content:not(" + target + ")").hide();
|
||||
}
|
||||
|
||||
});
|
||||
143
app/main.js
@@ -12,12 +12,51 @@ const np = require('./main/np.js');
|
||||
const systemFunc = require('./main/system.js');
|
||||
const Menu = electron.Menu
|
||||
const join = require('path').join;
|
||||
|
||||
// アプリケーションをコントロールするモジュール
|
||||
const app = electron.app;
|
||||
// ウィンドウを作成するモジュール
|
||||
const BrowserWindow = electron.BrowserWindow;
|
||||
// メインウィンドウはGCされないようにグローバル宣言
|
||||
let mainWindow;
|
||||
|
||||
// アプリが多重起動しないようにする
|
||||
const gotTheLock = app.requestSingleInstanceLock()
|
||||
|
||||
if (!gotTheLock) {
|
||||
app.quit()
|
||||
} else {
|
||||
app.on('second-instance', () => {
|
||||
// 多重起動を試みた場合、既に存在するウィンドウにフォーカスを移す
|
||||
// Someone tried to run a second instance, we should focus our window.
|
||||
if (mainWindow) {
|
||||
if (mainWindow.isMinimized()) mainWindow.restore()
|
||||
mainWindow.focus()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if (process.argv.indexOf("--dev") === -1) {
|
||||
var packaged = true;
|
||||
} else {
|
||||
var packaged = false;
|
||||
console.log(
|
||||
"||\\\\\\ \n" +
|
||||
"|||| \\\\\\\\ \n" +
|
||||
"|||| \\\\\\\\ \n" +
|
||||
"|||| Am I a \\\\\\\\ \n" +
|
||||
"|||| cat? ^ ^ \\\\\\\\\\ _____ _ ____ _ \n" +
|
||||
"|||| (.-.) \\\\\\\\\\ |_ _| |__ ___| _ \\ ___ ___| | __\n" +
|
||||
"|||| ___> ) ||||| | | | '_ \\ / _ \\ | | |/ _ \\/ __| |/ /\n" +
|
||||
"|||| < _ _) ////// | | | | | | __/ |_| | __/\__ \\ < \n" +
|
||||
"|||| |_||_| ///// |_| |_| |_|\\___|____/ \\___||___/_|\\_\\ \n" +
|
||||
"|||| ///// \n" +
|
||||
"|||| /////\n" +
|
||||
"|||| /////\n" +
|
||||
"||||//////"
|
||||
)
|
||||
console.log("Welcome!")
|
||||
}
|
||||
var info_path = join(app.getPath("userData"), "window-size.json");
|
||||
var max_info_path = join(app.getPath("userData"), "max-window-size.json");
|
||||
var lang_path = join(app.getPath("userData"), "language");
|
||||
@@ -25,9 +64,9 @@ var ha_path = join(app.getPath("userData"), "hardwareAcceleration");
|
||||
try {
|
||||
fs.readFileSync(ha_path, 'utf8');
|
||||
app.disableHardwareAcceleration()
|
||||
console.log("disabled: HA");
|
||||
if (!packaged) console.log("disabled: Hardware Acceleration");
|
||||
} catch{
|
||||
console.log("enabled: HA");
|
||||
if (!packaged) console.log("enabled: Hardware Acceleration");
|
||||
}
|
||||
var window_size;
|
||||
try {
|
||||
@@ -60,27 +99,24 @@ function isFile(file) {
|
||||
}
|
||||
// 全てのウィンドウが閉じたら終了
|
||||
app.on('window-all-closed', function () {
|
||||
if (process.platform != 'darwin') {
|
||||
electron.session.defaultSession.clearCache(() => { })
|
||||
app.quit();
|
||||
}
|
||||
});
|
||||
// macOSでウィンドウを閉じた後に再度開けるようにする
|
||||
app.on('activate', function () {
|
||||
if (mainWindow == null) {
|
||||
createWindow();
|
||||
}
|
||||
electron.session.defaultSession.clearCache(() => { })
|
||||
app.quit();
|
||||
});
|
||||
|
||||
function createWindow() {
|
||||
if (isFile(lang_path)) {
|
||||
console.log("exist");
|
||||
var lang = fs.readFileSync(lang_path, 'utf8');
|
||||
} else {
|
||||
var langs = app.getLocale();
|
||||
console.log(langs);
|
||||
if (~langs.indexOf("ja")) {
|
||||
lang = "ja";
|
||||
} else if (~langs.indexOf("de")) {
|
||||
lang = "de";
|
||||
} else if (~langs.indexOf("cs")) {
|
||||
lang = "cs";
|
||||
} else if (~langs.indexOf("bg")) {
|
||||
lang = "bg";
|
||||
} else {
|
||||
lang = "en";
|
||||
}
|
||||
@@ -88,8 +124,8 @@ function createWindow() {
|
||||
fs.writeFileSync(lang_path, lang);
|
||||
});
|
||||
}
|
||||
console.log(app.getLocale());
|
||||
console.log("launch:" + lang);
|
||||
if (!packaged) console.log("your lang:" + app.getLocale());
|
||||
if (!packaged) console.log("launch:" + lang);
|
||||
// メイン画面の表示。ウィンドウの幅、高さを指定できる
|
||||
var platform = process.platform;
|
||||
var bit = process.arch;
|
||||
@@ -101,7 +137,7 @@ function createWindow() {
|
||||
contextIsolation: true,
|
||||
preload: join(__dirname, "js", "platform", "preload.js")
|
||||
},
|
||||
width: window_size.width, height: window_size.height, x: window_size.x, y: window_size.y, icon: __dirname + '/desk.png'
|
||||
width: window_size.width, height: window_size.height, x: window_size.x, y: window_size.y, icon: __dirname + '/desk.png', show: false
|
||||
}
|
||||
} else if (platform == "win32") {
|
||||
var arg = {
|
||||
@@ -111,7 +147,7 @@ function createWindow() {
|
||||
contextIsolation: true,
|
||||
preload: join(__dirname, "js", "platform", "preload.js")
|
||||
},
|
||||
width: window_size.width, height: window_size.height, x: window_size.x, y: window_size.y, simpleFullscreen: true
|
||||
width: window_size.width, height: window_size.height, x: window_size.x, y: window_size.y, simpleFullscreen: true, show: false
|
||||
}
|
||||
} else if (platform == "darwin") {
|
||||
var arg = {
|
||||
@@ -121,10 +157,17 @@ function createWindow() {
|
||||
contextIsolation: true,
|
||||
preload: join(__dirname, "js", "platform", "preload.js")
|
||||
},
|
||||
width: window_size.width, height: window_size.height, x: window_size.x, y: window_size.y, simpleFullscreen: true
|
||||
width: window_size.width, height: window_size.height, x: window_size.x, y: window_size.y, simpleFullscreen: true, show: false
|
||||
}
|
||||
}
|
||||
mainWindow = new BrowserWindow(arg);
|
||||
mainWindow.once('page-title-updated', () => {
|
||||
mainWindow.show()
|
||||
if (window_size.max) {
|
||||
mainWindow.maximize();
|
||||
}
|
||||
})
|
||||
if (!packaged) mainWindow.toggleDevTools();
|
||||
electron.session.defaultSession.clearCache(() => { })
|
||||
if (process.argv) {
|
||||
if (process.argv[1]) {
|
||||
@@ -146,15 +189,32 @@ function createWindow() {
|
||||
if (!window_size.x && !window_size.y) {
|
||||
mainWindow.center();
|
||||
}
|
||||
if (window_size.max) {
|
||||
mainWindow.maximize();
|
||||
}
|
||||
// ウィンドウが閉じられたらアプリも終了
|
||||
mainWindow.on('closed', function () {
|
||||
electron.ipcMain.removeAllListeners();
|
||||
mainWindow = null;
|
||||
});
|
||||
mainWindow.on('close', function () {
|
||||
closeArg = false
|
||||
mainWindow.on('close', function (e, arg) {
|
||||
writePos(mainWindow)
|
||||
if(!closeArg){
|
||||
e.preventDefault()
|
||||
}
|
||||
const promise = new Promise(function (resolve) {
|
||||
mainWindow.webContents.send('asReadEnd', "")
|
||||
setTimeout(function () { resolve() }, 3000)
|
||||
})
|
||||
promise.then((function (response) {
|
||||
closeArg = true
|
||||
mainWindow.close()
|
||||
})
|
||||
);
|
||||
});
|
||||
electron.ipcMain.on('sendMarkersComplete', function (e, arg) {
|
||||
closeArg = true
|
||||
mainWindow.close()
|
||||
})
|
||||
function writePos(mainWindow){
|
||||
if (
|
||||
max_window_size.width == mainWindow.getBounds().width &&
|
||||
max_window_size.height == mainWindow.getBounds().height &&
|
||||
@@ -165,20 +225,20 @@ function createWindow() {
|
||||
} else {
|
||||
var size = { width: mainWindow.getBounds().width, height: mainWindow.getBounds().height, x: mainWindow.getBounds().x, y: mainWindow.getBounds().y }
|
||||
}
|
||||
fs.writeFileSync(info_path, JSON.stringify(size));
|
||||
});
|
||||
fs.writeFileSync(info_path, JSON.stringify(size))
|
||||
}
|
||||
mainWindow.on('maximize', function () {
|
||||
writePos(mainWindow)
|
||||
fs.writeFileSync(max_info_path, JSON.stringify(mainWindow.getBounds()));
|
||||
});
|
||||
mainWindow.on('minimize', function () {
|
||||
writePos(mainWindow)
|
||||
mainWindow.webContents.send('asRead', "")
|
||||
})
|
||||
|
||||
var platform = process.platform;
|
||||
var bit = process.arch;
|
||||
if (process.argv.indexOf("--dev") === -1) {
|
||||
packaged = true;
|
||||
} else {
|
||||
packaged = false;
|
||||
}
|
||||
Menu.setApplicationMenu(Menu.buildFromTemplate(language.template(lang, mainWindow, packaged, dir)));
|
||||
Menu.setApplicationMenu(Menu.buildFromTemplate(language.template(lang, mainWindow, packaged, dir, dirname)));
|
||||
//CSS
|
||||
css.css(mainWindow);
|
||||
//アップデータとダウンロード
|
||||
@@ -189,6 +249,29 @@ function createWindow() {
|
||||
np.TheDeskNowPlaying(mainWindow);
|
||||
//その他system
|
||||
systemFunc.system(mainWindow, dir, lang, dirname);
|
||||
setInterval(function () { mouseTrack(mainWindow) }, 1000);
|
||||
}
|
||||
var x = 0
|
||||
var y = 0
|
||||
var unchanged = 0
|
||||
var locked = false
|
||||
function mouseTrack(mainWindow) {
|
||||
let mousePos = electron.screen.getCursorScreenPoint()
|
||||
let xNow = mousePos.x
|
||||
let yNow = mousePos.x
|
||||
if (x != xNow || y != yNow) {
|
||||
unchanged = 0
|
||||
locked = false
|
||||
} else {
|
||||
unchanged++
|
||||
if (unchanged > 60 && !locked) {
|
||||
unchanged = 0
|
||||
locked = true
|
||||
mainWindow.webContents.send('asRead', "")
|
||||
}
|
||||
}
|
||||
x = xNow
|
||||
y = yNow
|
||||
}
|
||||
// Electronの初期化完了後に実行
|
||||
app.on('ready', createWindow);
|
||||
|
||||
@@ -23,7 +23,7 @@ function css(mainWindow) {
|
||||
ipc.on('theme-json-create', function (e, arg) {
|
||||
var themecss = join(app.getPath("userData"), JSON5.parse(arg)["id"] +
|
||||
".thedesktheme");
|
||||
fs.writeFileSync(themecss, JSON.stringify(JSON5.parse(arg)));
|
||||
fs.writeFileSync(themecss, JSON5.stringify(JSON5.parse(arg)));
|
||||
if (JSON5.parse(arg)["id"]) {
|
||||
e.sender.webContents.send('theme-json-create-complete', "");
|
||||
} else {
|
||||
@@ -39,13 +39,14 @@ function css(mainWindow) {
|
||||
})
|
||||
ipc.on('theme-json-request', function (e, arg) {
|
||||
var themecss = join(app.getPath("userData"), arg + ".thedesktheme");
|
||||
var json = JSON.parse(fs.readFileSync(themecss, 'utf8'));
|
||||
e.sender.webContents.send('theme-json-response', json);
|
||||
var raw = fs.readFileSync(themecss, 'utf8')
|
||||
var json = JSON5.parse(raw);
|
||||
e.sender.webContents.send('theme-json-response', [json, raw]);
|
||||
})
|
||||
ipc.on('theme-css-request', function (e, arg) {
|
||||
var themecss = join(app.getPath("userData"), arg + ".thedesktheme");
|
||||
try {
|
||||
var json = JSON.parse(fs.readFileSync(themecss, 'utf8'));
|
||||
var json = JSON5.parse(fs.readFileSync(themecss, 'utf8'));
|
||||
|
||||
var primary = json.vars.primary;
|
||||
var secondary = json.vars.secondary;
|
||||
@@ -53,29 +54,68 @@ function css(mainWindow) {
|
||||
if (json.base == "light") {
|
||||
var drag = "rgba(255, 255, 255, 0.8)";
|
||||
var beforehover = "#757575";
|
||||
var selected = "#3f3f3f"
|
||||
var selectedWithShare = "#b2babd"
|
||||
var gray = "#757575"
|
||||
} else {
|
||||
var drag = "rgba(0, 0, 0, 0.8)";
|
||||
var beforehover = "#9e9e9e";
|
||||
var selected = "#c0c0c0"
|
||||
var selectedWithShare = "#003a30"
|
||||
var gray = "#cccccc"
|
||||
}
|
||||
if (json.props) {
|
||||
if (json.props.TheDeskAccent) {
|
||||
var emphasized = json.props.TheDeskAccent
|
||||
} else {
|
||||
var emphasized = secondary;
|
||||
var emphasized = secondary
|
||||
}
|
||||
if (json.props.TheDeskActive) {
|
||||
var active = json.props.TheDeskActive
|
||||
} else {
|
||||
var active = primary
|
||||
}
|
||||
if (json.props.TheDeskModal) {
|
||||
var modal = json.props.TheDeskModal
|
||||
} else {
|
||||
var modal = secondary
|
||||
}
|
||||
if (json.props.TheDeskBottom) {
|
||||
var bottom = json.props.TheDeskBottom
|
||||
} else {
|
||||
var bottom = primary
|
||||
}
|
||||
if (json.props.TheDeskPostbox) {
|
||||
var postbox = json.props.TheDeskPostbox
|
||||
} else {
|
||||
var postbox = primary
|
||||
}
|
||||
if (json.props.TheDeskSubcolor) {
|
||||
var subcolor = json.props.TheDeskSubcolor
|
||||
} else {
|
||||
var subcolor = primary
|
||||
}
|
||||
} else {
|
||||
var emphasized = primary;
|
||||
var emphasized = primary
|
||||
var acs = secondary
|
||||
var active = primary
|
||||
var modal = secondary
|
||||
var bottom = primary
|
||||
var postbox = primary
|
||||
var subcolor = primary
|
||||
}
|
||||
|
||||
var css = ".customtheme {--bg:" + secondary + ";--drag:" + drag + ";" +
|
||||
"--color:" + text + ";--beforehover:" + beforehover + ";--modal:" +
|
||||
secondary + ";--subcolor:" + primary + ";--box:" + primary +
|
||||
";--sidebar:" + primary + ";--shared:" + emphasized + ";" +
|
||||
"--notfbox:" + secondary + ";--emphasized:" + primary + ";--his-data:" +
|
||||
modal + ";--subcolor:" + subcolor + ";--box:" + subcolor +
|
||||
";--sidebar:" + bottom + ";--shared:" + emphasized + ";" +
|
||||
"--notfbox:" + secondary + ";--emphasized:" + active + ";--his-data:" +
|
||||
secondary +
|
||||
";--active:" + primary + ";--postbox:" + primary + ";--modalfooter:" +
|
||||
";--active:" + active + ";--postbox:" + postbox + ";--modalfooter:" +
|
||||
primary +
|
||||
";}.blacktheme #imagemodal{background: url(\"../img/pixel.svg\");}";
|
||||
";--accentbtn:" + subcolor + ";--selected:" + selected + ";--selectedWithShare:" + selectedWithShare + "}"+
|
||||
"--gray:" + gray + ";"+
|
||||
".customtheme #imagemodal{background: url(\"../img/pixel.svg\");}";
|
||||
e.sender.webContents.send('theme-css-response', css);
|
||||
} catch (e) {
|
||||
var css = "";
|
||||
@@ -84,15 +124,19 @@ function css(mainWindow) {
|
||||
})
|
||||
ipc.on('theme-json-list', function (e, arg) {
|
||||
fs.readdir(app.getPath("userData"), function (err, files) {
|
||||
if (err) throw err;
|
||||
if (err || !files) throw err;
|
||||
var fileList = files.filter(function (file) {
|
||||
var tfile = join(app.getPath("userData"), file);
|
||||
return fs.statSync(tfile).isFile() && /.*\.thedesktheme$/.test(tfile); //絞り込み
|
||||
if(file.match(/\.thedesktheme$/)){
|
||||
var tfile = join(app.getPath("userData"), file)
|
||||
return fs.statSync(tfile).isFile() && /.*\.thedesktheme$/.test(tfile)
|
||||
}else{
|
||||
return null
|
||||
}
|
||||
})
|
||||
var themes = [];
|
||||
for (var i = 0; i < fileList.length; i++) {
|
||||
var themecss = join(app.getPath("userData"), fileList[i]);
|
||||
var json = JSON.parse(fs.readFileSync(themecss, 'utf8'));
|
||||
var json = JSON5.parse(fs.readFileSync(themecss, 'utf8'));
|
||||
themes.push({
|
||||
name: json.name,
|
||||
id: json.id
|
||||
|
||||
@@ -26,10 +26,9 @@ function dl(mainWindow, lang_path, base, dirname) {
|
||||
"transparent": false, // ウィンドウの背景を透過
|
||||
"frame": false, // 枠の無いウィンドウ
|
||||
"resizable": false
|
||||
});
|
||||
})
|
||||
var lang = fs.readFileSync(lang_path, 'utf8');
|
||||
updatewin.loadURL(base + lang + '/update.html');
|
||||
|
||||
return "true"
|
||||
} else {
|
||||
return false;
|
||||
@@ -44,7 +43,7 @@ function dl(mainWindow, lang_path, base, dirname) {
|
||||
directory: dir,
|
||||
openFolderWhenDone: true,
|
||||
onProgress: function (event) {
|
||||
e.sender.webContents.send('prog', e);
|
||||
e.sender.webContents.send('prog', event);
|
||||
},
|
||||
saveAs: false
|
||||
};
|
||||
@@ -53,7 +52,6 @@ function dl(mainWindow, lang_path, base, dirname) {
|
||||
.then(dl => {
|
||||
e.sender.webContents.send('mess', "ダウンロードが完了しました。");
|
||||
app.quit();
|
||||
|
||||
})
|
||||
.catch(console.error);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
// Create the Application's main menu
|
||||
function templete(lang, mainWindow, packaged, dir) {
|
||||
function templete(lang, mainWindow, packaged, dir, dirname) {
|
||||
if(lang !="ja" && lang != "en"){
|
||||
lang = "en"
|
||||
}
|
||||
const electron = require("electron");
|
||||
const app = electron.app;
|
||||
const BrowserWindow = electron.BrowserWindow;
|
||||
const join = require('path').join;
|
||||
const dict = {
|
||||
"application": {
|
||||
"ja": "アプリケーション",
|
||||
@@ -98,9 +102,9 @@ function templete(lang, mainWindow, packaged, dir) {
|
||||
webviewTag: false,
|
||||
nodeIntegration: false,
|
||||
contextIsolation: true,
|
||||
preload: "../js/platform/preload.js"
|
||||
preload: join(dirname , "js", "platform", "preload.js")
|
||||
},
|
||||
width: 300, height: 460,
|
||||
width: 300, height: 500,
|
||||
"transparent": false, // ウィンドウの背景を透過
|
||||
"frame": false, // 枠の無いウィンドウ
|
||||
"resizable": false
|
||||
@@ -146,33 +150,5 @@ function templete(lang, mainWindow, packaged, dir) {
|
||||
];
|
||||
return menu;
|
||||
}
|
||||
function delsel(lang) {
|
||||
const dict = {
|
||||
"delete": {
|
||||
"ja": "カラム削除",
|
||||
"en": "Delete this column"
|
||||
},
|
||||
"mess": {
|
||||
"ja": "カラムを削除しますか?(すべてのカラムのリンク解析がOFFになります。)",
|
||||
"en": "Delete this column(URL analyzes of all windows will be disabled.)"
|
||||
},
|
||||
"yes": {
|
||||
"ja": "はい",
|
||||
"en": "Yes"
|
||||
},
|
||||
"no": {
|
||||
"ja": "いいえ",
|
||||
"en": "No"
|
||||
}
|
||||
}
|
||||
const options = {
|
||||
type: 'info',
|
||||
title: dict.delete[lang],
|
||||
message: dict.mess[lang],
|
||||
buttons: [dict.no[lang], dict.yes[lang]]
|
||||
}
|
||||
return options;
|
||||
}
|
||||
|
||||
exports.template = templete;
|
||||
exports.delsel = delsel;
|
||||
@@ -8,26 +8,18 @@ function np(mainWindow) {
|
||||
//Verified on Windows
|
||||
console.log("Access");
|
||||
if (args[0] == "set") {
|
||||
var { NowPlaying, PlayerName } = require("nowplaying-node");
|
||||
var nppath = join(app.getPath("userData"), "nowplaying");
|
||||
var npProvider;
|
||||
try {
|
||||
npProvider = args[1];
|
||||
} catch (e) {
|
||||
npProvider = "AIMP";
|
||||
}
|
||||
var myAIMP = new NowPlaying({
|
||||
fetchCover: true,
|
||||
player: PlayerName[npProvider],
|
||||
});
|
||||
fs.writeFileSync(nppath, npProvider);
|
||||
|
||||
} else {
|
||||
var platform = process.platform;
|
||||
var bit = process.arch;
|
||||
if (platform == "darwin") {
|
||||
try {
|
||||
const nowplaying = require("itunes-nowplaying-mac");
|
||||
const value = await nowplaying.getRawData();
|
||||
let value = await nowplaying();
|
||||
|
||||
const artwork = await nowplaying.getThumbnailBuffer(value.databaseID);
|
||||
const base64 = artwork.toString('base64');
|
||||
value.artwork = base64
|
||||
e.sender.webContents.send('itunes-np', value);
|
||||
} catch (error) {
|
||||
// エラーを返す
|
||||
@@ -35,34 +27,7 @@ function np(mainWindow) {
|
||||
e.sender.webContents.send('itunes-np', error);
|
||||
}
|
||||
} else {
|
||||
var { NowPlaying, PlayerName } = require("nowplaying-node");
|
||||
var nppath = join(app.getPath("userData"), "nowplaying");
|
||||
var npProvider;
|
||||
try {
|
||||
npProvider = fs.readFileSync(nppath, 'utf8');
|
||||
} catch (e) {
|
||||
npProvider = "AIMP";
|
||||
}
|
||||
var myAIMP = new NowPlaying({
|
||||
fetchCover: true,
|
||||
player: PlayerName[npProvider],
|
||||
});
|
||||
myAIMP.update();
|
||||
var path = myAIMP.getCoverPath();
|
||||
if (path) {
|
||||
var bin = fs.readFileSync(path, 'base64');
|
||||
} else {
|
||||
var bin = false;
|
||||
}
|
||||
|
||||
var value = {
|
||||
win: true,
|
||||
name: myAIMP.getTitle(),
|
||||
artist: myAIMP.getArtist(),
|
||||
album: myAIMP.getAlbum(),
|
||||
path: bin
|
||||
}
|
||||
e.sender.webContents.send('itunes-np', value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,9 @@ function system(mainWindow, dir, lang, dirname) {
|
||||
const join = require('path').join;
|
||||
var Jimp = require("jimp");
|
||||
const fs = require("fs");
|
||||
var JSON5 = require('json5');
|
||||
var ipc = electron.ipcMain;
|
||||
const clipboard = electron.clipboard;
|
||||
var tmp_img = join(app.getPath("userData"), "tmp.png");
|
||||
var ha_path = join(app.getPath("userData"), "hardwareAcceleration");
|
||||
var lang_path = join(app.getPath("userData"), "language");
|
||||
@@ -12,73 +14,28 @@ function system(mainWindow, dir, lang, dirname) {
|
||||
const dialog = electron.dialog;
|
||||
const os = require('os')
|
||||
const language = require("../main/language.js");
|
||||
ipc.on('native-notf', function (e, args) {
|
||||
|
||||
var platform = process.platform;
|
||||
var bit = process.arch;
|
||||
if (platform == "win32") {
|
||||
const notifier = require('node-notifier')
|
||||
var tmp_imge = tmp_img;
|
||||
Jimp.read(args[2], function (err, lenna) {
|
||||
if (!err && lenna) {
|
||||
lenna.write(tmp_img);
|
||||
var tmp_imge = tmp_img;
|
||||
} else {
|
||||
var tmp_imge = "";
|
||||
}
|
||||
notifier.notify({
|
||||
appID: "top.thedesk",
|
||||
message: args[1],
|
||||
title: args[0],
|
||||
icon: tmp_imge,
|
||||
sound: false,
|
||||
wait: true,
|
||||
},
|
||||
function (err, response) {
|
||||
console.log(err, response)
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
//プラットフォーム
|
||||
ipc.on('getPlatform', function (e, arg) {
|
||||
e.sender.webContents.send('platform', [process.platform, process.arch, process.version, process.versions.chrome, process.versions.electron]);
|
||||
try {
|
||||
var gitHash = fs.readFileSync("git", 'utf8')
|
||||
} catch{
|
||||
var gitHash = null
|
||||
}
|
||||
e.sender.webContents.send('platform', [process.platform, process.arch, process.version, process.versions.chrome, process.versions.electron, gitHash]);
|
||||
})
|
||||
//言語
|
||||
ipc.on('lang', function (e, arg) {
|
||||
|
||||
console.log("set:" + arg);
|
||||
fs.writeFileSync(lang_path, arg);
|
||||
e.sender.webContents.send('langres', "");
|
||||
})
|
||||
//ストアから入れたかダイアログ
|
||||
ipc.on('dialogStore', function (e, args) {
|
||||
dialog.showMessageBox(args, function (arg) {
|
||||
if (arg == 1) {
|
||||
e.sender.webContents.send('winstore', "winstore");
|
||||
} else {
|
||||
e.sender.webContents.send('winstore', "localinstall");
|
||||
}
|
||||
});
|
||||
})
|
||||
//CWのダイアログ
|
||||
ipc.on('dialogCW', function (e, args) {
|
||||
dialog.showMessageBox(args, function (arg) {
|
||||
e.sender.webContents.send('dialogCWRender', arg);
|
||||
});
|
||||
})
|
||||
//クライアントのダイアログ
|
||||
ipc.on('dialogClient', function (e, args) {
|
||||
dialog.showMessageBox(args, function (arg) {
|
||||
e.sender.webContents.send('dialogClientRender', arg);
|
||||
});
|
||||
e.sender.webContents.send('langres', arg);
|
||||
})
|
||||
//エクスポートのダイアログ
|
||||
ipc.on('exportSettings', function (e, args) {
|
||||
dialog.showSaveDialog(null, {
|
||||
title: 'Export',
|
||||
properties: ['openFile', 'createDirectory'],
|
||||
defaultPath: "export.thedeskconfigv2"
|
||||
defaultPath: "export.thedeskconfig.json5"
|
||||
}, (savedFiles) => {
|
||||
if (!savedFiles) {
|
||||
return false;
|
||||
@@ -92,13 +49,13 @@ function system(mainWindow, dir, lang, dirname) {
|
||||
title: 'Import',
|
||||
properties: ['openFile'],
|
||||
filters: [
|
||||
{ name: 'TheDesk Config', extensions: ['thedeskconfig', 'thedeskconfigv2'] },
|
||||
{ name: 'TheDesk Config', extensions: ['thedeskconfig', 'thedeskconfigv2', 'json5'] },
|
||||
]
|
||||
}, (fileNames) => {
|
||||
if (!fileNames) {
|
||||
return false;
|
||||
}
|
||||
e.sender.webContents.send('config', fs.readFileSync(arg, 'utf8'));
|
||||
e.sender.webContents.send('config', JSON5.parse(fs.readFileSync(fileNames[0], 'utf8')));
|
||||
})
|
||||
})
|
||||
//保存フォルダのダイアログ
|
||||
@@ -147,10 +104,12 @@ function system(mainWindow, dir, lang, dirname) {
|
||||
var window = new BrowserWindow({
|
||||
webPreferences: {
|
||||
webviewTag: false,
|
||||
nodeIntegration: false
|
||||
nodeIntegration: false,
|
||||
contextIsolation: true,
|
||||
preload: join(dirname, "js", "platform", "preload.js")
|
||||
},
|
||||
width: 300,
|
||||
height: 480,
|
||||
height: 500,
|
||||
"transparent": false, // ウィンドウの背景を透過
|
||||
"frame": false, // 枠の無いウィンドウ
|
||||
"resizable": false
|
||||
@@ -158,13 +117,6 @@ function system(mainWindow, dir, lang, dirname) {
|
||||
window.loadURL(dir + '/about.html?ver=' + ver);
|
||||
return "true"
|
||||
}
|
||||
ipc.on('column-del', (e, tlid) => {
|
||||
console.log(tlid);
|
||||
var options = language.delsel(lang)
|
||||
dialog.showMessageBox(options, function (index) {
|
||||
e.sender.webContents.send('column-del-reply', [index, tlid]);
|
||||
})
|
||||
});
|
||||
ipc.on('nano', function (e, x, y) {
|
||||
|
||||
var nano_info_path = join(app.getPath("userData"),
|
||||
@@ -180,17 +132,17 @@ function system(mainWindow, dir, lang, dirname) {
|
||||
webviewTag: false,
|
||||
nodeIntegration: false,
|
||||
contextIsolation: true,
|
||||
preload: join(dirname,"js", "platform", "preload.js")
|
||||
preload: join(dirname, "js", "platform", "preload.js")
|
||||
},
|
||||
width: 350,
|
||||
height: 200,
|
||||
height: 140,
|
||||
"transparent": false, // ウィンドウの背景を透過
|
||||
"frame": false, // 枠の無いウィンドウ
|
||||
"resizable": false
|
||||
});
|
||||
nanowindow.loadURL(dir + '/nano.html');
|
||||
nanowindow.setAlwaysOnTop(true);
|
||||
|
||||
//nanowindow.toggleDevTools()
|
||||
nanowindow.setPosition(window_pos[0], window_pos[1]);
|
||||
nanowindow.on('close', function () {
|
||||
fs.writeFileSync(nano_info_path, JSON.stringify(nanowindow.getPosition()));
|
||||
@@ -216,7 +168,8 @@ function system(mainWindow, dir, lang, dirname) {
|
||||
|
||||
|
||||
ipc.on('export', (e, args) => {
|
||||
fs.writeFileSync(args[0], args[1]);
|
||||
fs.writeFileSync(args[0], JSON5.stringify(args[1]));
|
||||
e.sender.webContents.send('exportAllComplete', "");
|
||||
});
|
||||
//フォント
|
||||
function object_array_sort(data, key, order, fn) {
|
||||
@@ -257,5 +210,9 @@ function system(mainWindow, dir, lang, dirname) {
|
||||
e.sender.webContents.send('font-list', fonts_sorted);
|
||||
});
|
||||
});
|
||||
//コピー
|
||||
ipc.on('copy', (e, arg) => {
|
||||
clipboard.writeText(arg)
|
||||
});
|
||||
}
|
||||
exports.system = system;
|
||||
379
app/nano.html
@@ -1,242 +1,155 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link href="./css/themes.css" type="text/css" rel="stylesheet">
|
||||
<link href="./css/tl.css" type="text/css" rel="stylesheet">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<title>TheDesk Nano</title>
|
||||
<style>
|
||||
html {
|
||||
-webkit-app-region: drag !important;
|
||||
cursor: move !important;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: rgba(0, 0, 0, 0.1);
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
#timeline_nano {
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
-webkit-app-region: no-drag;
|
||||
max-height: 100px;
|
||||
}
|
||||
|
||||
.user {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
select {
|
||||
-webkit-app-region: no-drag;
|
||||
}
|
||||
|
||||
button {
|
||||
-webkit-app-region: no-drag;
|
||||
}
|
||||
|
||||
textarea {
|
||||
-webkit-app-region: no-drag;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 5px;
|
||||
height: 10px;
|
||||
background: rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
-webkit-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.area-actions {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.area-date_via {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.area-side {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Handle */
|
||||
::-webkit-scrollbar-thumb {
|
||||
-webkit-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.blacktheme body {
|
||||
color: white;
|
||||
background-color: #212121;
|
||||
}
|
||||
|
||||
.blacktheme button {
|
||||
background-color: black;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.blacktheme textarea,
|
||||
.blacktheme select {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.blacktheme select,
|
||||
.blacktheme option {
|
||||
background-color: black;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script>
|
||||
//jQuery読む
|
||||
window.jQuery = window.$ = require('./js/common/jquery.js');
|
||||
var Hammer = require('./js/common/hammer.min.js');
|
||||
$.strip_tags = function (str, allowed) {
|
||||
if (!str) {
|
||||
return "";
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link href="./css/themes.css" type="text/css" rel="stylesheet" />
|
||||
<link href="./css/tl.css" type="text/css" rel="stylesheet" />
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
|
||||
<link href="./node_modules/@fortawesome/fontawesome-free/css/all.min.css" type="text/css" rel="stylesheet">
|
||||
<title>TheDesk Nano</title>
|
||||
<style>
|
||||
html {
|
||||
-webkit-app-region: drag !important;
|
||||
cursor: move !important;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
font-family: sans-serif;
|
||||
color: var(--color) !important;
|
||||
}
|
||||
allowed = (((allowed || '') + '').toLowerCase().match(/<[a-z][a-z0-9]*>/g) || [])
|
||||
.join('');
|
||||
var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>?/gi,
|
||||
commentsAndPhpTags = /<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi;
|
||||
return str.replace(commentsAndPhpTags, '').replace(tags, function ($0, $1) {
|
||||
return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : '';
|
||||
});
|
||||
};
|
||||
function escapeHTML(str) {
|
||||
if (!str) {
|
||||
return "";
|
||||
}
|
||||
return str.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''');
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript" src="./js/platform/first-not-view.js"></script>
|
||||
<select id="post-acct-sel" style="max-width:150px">
|
||||
</select>
|
||||
<select id="type-sel" style="max-width:60px">
|
||||
<option value="local">Local</option>
|
||||
<option value="home">Home</option>
|
||||
</select><button onclick="tl()">Show</button><button onclick="window.close()">x</button><br>
|
||||
<div id="timeline_nano">
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<textarea id="textarea" style="width:80%; background-color:transparent"></textarea>
|
||||
<button class="btn" onclick="post()">Post</button>
|
||||
<script>
|
||||
if (localStorage.getItem("lang")) {
|
||||
var lang = localStorage.getItem("lang");
|
||||
} else {
|
||||
var lang = "ja";
|
||||
}
|
||||
</script>
|
||||
<script src="https://twemoji.maxcdn.com/2/twemoji.min.js?2.7"></script>
|
||||
<script type="text/javascript" src="./js/post/post.js"></script>
|
||||
<script type="text/javascript" src="./js/post/use-txtbox.js"></script>
|
||||
<script type="text/javascript" src="./js/tl/parse.js"></script>
|
||||
<script type="text/javascript" src="./js/ui/theme.js"></script>
|
||||
<script type="text/javascript" src="./js/tl/date.js"></script>
|
||||
<script type="text/javascript" src="./js/common/time.js"></script>
|
||||
<script type="text/javascript" src="./js/platform/nano.js"></script>
|
||||
<script type="text/javascript" src="./js/platform/end.js"></script>
|
||||
<script>
|
||||
var multi = localStorage.getItem("multi");
|
||||
if (!multi) {
|
||||
var obj = [{
|
||||
at: localStorage.getItem(localStorage.getItem("domain_" + acct_id) + "_at"),
|
||||
name: localStorage.getItem("name_" + acct_id),
|
||||
domain: localStorage.getItem("domain_" + acct_id),
|
||||
user: localStorage.getItem("user_" + acct_id),
|
||||
prof: localStorage.getItem("prof_" + acct_id)
|
||||
}];
|
||||
var json = JSON.stringify(obj);
|
||||
localStorage.setItem("multi", json);
|
||||
} else {
|
||||
var obj = JSON.parse(multi);
|
||||
}
|
||||
var templete;
|
||||
var last = localStorage.getItem("last-use");
|
||||
var sel;
|
||||
Object.keys(obj).forEach(function (key) {
|
||||
var acct = obj[key];
|
||||
var list = key * 1 + 1;
|
||||
if (key == last) {
|
||||
sel = "selected";
|
||||
} else {
|
||||
sel = "";
|
||||
body {
|
||||
background-color: rgba(0, 0, 0, 0.1);
|
||||
font-size: 11px;
|
||||
}
|
||||
templete = '<option value="' + key + '" ' + sel + '>' + acct.user + '@' + acct.domain +
|
||||
'</option>';
|
||||
$("#post-acct-sel").append(templete);
|
||||
});
|
||||
function mov() {
|
||||
return false;
|
||||
}
|
||||
function resetmv() {
|
||||
return false;
|
||||
}
|
||||
function post() {
|
||||
var acct_id = $("#post-acct-sel").val();
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/statuses";
|
||||
var str = $("#textarea").val();
|
||||
var toot = {
|
||||
status: str
|
||||
|
||||
#timeline_nano {
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
-webkit-app-region: no-drag;
|
||||
max-height: 100px;
|
||||
}
|
||||
var vis = loadVis(acct_id)
|
||||
toot.visibility = vis;
|
||||
var httpreq = new XMLHttpRequest();
|
||||
httpreq.open('POST', start, true);
|
||||
httpreq.setRequestHeader('Content-Type', 'application/json');
|
||||
httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
|
||||
httpreq.responseType = "json";
|
||||
httpreq.send(JSON.stringify(toot));
|
||||
httpreq.onreadystatechange = function () {
|
||||
if (httpreq.readyState === 4) {
|
||||
$("#textarea").val("");
|
||||
|
||||
.user {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
select {
|
||||
-webkit-app-region: no-drag;
|
||||
}
|
||||
|
||||
button {
|
||||
-webkit-app-region: no-drag;
|
||||
}
|
||||
|
||||
textarea {
|
||||
-webkit-app-region: no-drag;
|
||||
color: var(--color) !important;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 5px;
|
||||
height: 10px;
|
||||
background: rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
-webkit-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.area-date_via {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.area-side {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Handle */
|
||||
::-webkit-scrollbar-thumb {
|
||||
-webkit-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
.hide, .pin, .rep-btn, .tickers{
|
||||
display: none;
|
||||
}
|
||||
.fas {
|
||||
font-size: 1rem !important;
|
||||
}
|
||||
.cvo {
|
||||
grid-template-rows: auto 1rem 1fr auto 2rem;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script type="text/javascript" src="./node_modules/jquery/dist/jquery.js"></script>
|
||||
<script>
|
||||
$.strip_tags = function(str, allowed) {
|
||||
if (!str) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
function loadVis(acct_id) {
|
||||
var vist = localStorage.getItem("vis");
|
||||
console.log(vist);
|
||||
if (!vist) {
|
||||
return "public";
|
||||
} else {
|
||||
if (vist == "memory") {
|
||||
var memory = localStorage.getItem("vis-memory-" + acct_id);
|
||||
if (!memory) {
|
||||
memory = "public";
|
||||
}
|
||||
return memory;
|
||||
} else if (vist == "server") {
|
||||
var multi = localStorage.getItem("multi");
|
||||
var obj = JSON.parse(multi);
|
||||
var memory = obj[acct_id]["vis"];
|
||||
if (!memory) {
|
||||
memory = "public";
|
||||
}
|
||||
return memory;
|
||||
} else {
|
||||
return vist;
|
||||
allowed = (((allowed || "") + "").toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join("");
|
||||
var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>?/gi,
|
||||
commentsAndPhpTags = /<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi;
|
||||
return str.replace(commentsAndPhpTags, "").replace(tags, function($0, $1) {
|
||||
return allowed.indexOf("<" + $1.toLowerCase() + ">") > -1 ? $0 : "";
|
||||
});
|
||||
};
|
||||
function escapeHTML(str) {
|
||||
if (!str) {
|
||||
return "";
|
||||
}
|
||||
return str
|
||||
.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/"/g, """)
|
||||
.replace(/'/g, "'");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
<script type="text/javascript" src="./js/platform/first-not-view.js"></script>
|
||||
<div id="menu" class="hide">
|
||||
TL and posting account<br>
|
||||
<select id="post-acct-sel" style="max-width:150px"> </select><br>
|
||||
TL type<br>
|
||||
<select id="type-sel" style="max-width:60px" onchange="loader()">
|
||||
<option value="local">Local</option>
|
||||
<option value="home">Home</option> </select
|
||||
><button onclick="tl()">Show</button><br>
|
||||
Visibility<br>
|
||||
<select id="vis-sel" style="max-width:60px">
|
||||
<option value="public">Public</option>
|
||||
<option value="unlisted">Unlisted</option>
|
||||
<option value="private">Private</option>
|
||||
</select>
|
||||
</div>
|
||||
<button onclick="set()" id="setting">Setting</button>
|
||||
<textarea id="textarea" style="width:55%; background-color:transparent" placeholder="Post someyhing new"></textarea>
|
||||
<button class="btn" onclick="post()">Post</button>
|
||||
<button onclick="window.close()">x</button><br />
|
||||
<div id="timeline_nano">Click "settings" to show TL</div>
|
||||
<br />
|
||||
<script>
|
||||
if (localStorage.getItem("lang")) {
|
||||
var lang = localStorage.getItem("lang");
|
||||
} else {
|
||||
var lang = "ja";
|
||||
}
|
||||
</script>
|
||||
<script src="https://twemoji.maxcdn.com/2/twemoji.min.js?2.7"></script>
|
||||
<script type="text/javascript" src="view/en/main.js"></script>
|
||||
<script type="text/javascript" src="./js/post/status.js"></script>
|
||||
<script type="text/javascript" src="./js/post/post.js"></script>
|
||||
<script type="text/javascript" src="./js/post/use-txtbox.js"></script>
|
||||
<script type="text/javascript" src="./js/tl/parse.js"></script>
|
||||
<script type="text/javascript" src="./js/ui/theme.js"></script>
|
||||
<script type="text/javascript" src="./js/tl/date.js"></script>
|
||||
<script type="text/javascript" src="./js/common/time.js"></script>
|
||||
<script type="text/javascript" src="./js/platform/nano.js"></script>
|
||||
<script type="text/javascript" src="./js/platform/end.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
3846
app/package-lock.json
generated
@@ -1,14 +1,15 @@
|
||||
{
|
||||
"name": "thedesk",
|
||||
"version": "18.6.0",
|
||||
"version": "18.11.3",
|
||||
"description": "TheDesk is a Mastodon client for PC.",
|
||||
"repository": "https://github.com/cutls/TheDesk",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"construct": "cd view/make && node make",
|
||||
"construct": "cd view/make && node make --automatic && cd ../../",
|
||||
"dev": "electron ./ --dev",
|
||||
"dist": "build --linux snap",
|
||||
"watchview": "node view/make/make.js --automatic --watch",
|
||||
"build:js": "node build.js",
|
||||
"build": "electron-builder",
|
||||
"build:all": "electron-builder --win --linux",
|
||||
@@ -43,28 +44,33 @@
|
||||
},
|
||||
{
|
||||
"name": "kPherox",
|
||||
"url": "https://pawoo.net/@kPherox",
|
||||
"url": "https://pl.kpherox.dev/kPherox",
|
||||
"email": "admin@mail.kr-kp.com"
|
||||
}
|
||||
],
|
||||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
"@fortawesome/fontawesome-free": "^5.11.2",
|
||||
"electron-dl": "^1.14.0",
|
||||
"jimp": "^0.6.4",
|
||||
"json5": "^2.1.0",
|
||||
"node-notifier": "^5.4.0",
|
||||
"jimp": "^0.8.4",
|
||||
"jquery": "^3.4.1",
|
||||
"jquery-ui-dist": "^1.12.1",
|
||||
"json5": "^2.1.1",
|
||||
"materialize-css": "^1.0.0",
|
||||
"sumchecker": "^3.0.0",
|
||||
"sweetalert2": "^8.18.5",
|
||||
"vue": "^2.6.10"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"nowplaying-node": "git+https://github.com/cutls/nowplaying-node",
|
||||
"itunes-nowplaying-mac": "git+https://github.com/rinsuki/itunes-nowplaying-mac#pull/4/head",
|
||||
"font-manager": "^0.3.0"
|
||||
"font-manager": "^0.3.0",
|
||||
"itunes-nowplaying-mac": "0.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"electron": "^5.0.1",
|
||||
"electron-builder": "^20.43.0",
|
||||
"readline-sync": "1.4.9"
|
||||
"chokidar": "^3.2.2",
|
||||
"electron": "^6.0.12",
|
||||
"electron-builder": "^21.1.5",
|
||||
"electron-rebuild": "^1.8.6",
|
||||
"readline-sync": "1.4.10"
|
||||
},
|
||||
"build": {
|
||||
"productName": "TheDesk",
|
||||
@@ -102,7 +108,8 @@
|
||||
"icon": "build/icons",
|
||||
"target": [
|
||||
"zip",
|
||||
"snap"
|
||||
"snap",
|
||||
"deb"
|
||||
],
|
||||
"category": "Network"
|
||||
},
|
||||
@@ -113,8 +120,8 @@
|
||||
]
|
||||
},
|
||||
"electronDownload": {
|
||||
"version": "5.0.1"
|
||||
"version": "6.0.0"
|
||||
},
|
||||
"electronVersion": "5.0.1"
|
||||
"electronVersion": "6.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
94
app/source/version.json
Normal file
@@ -0,0 +1,94 @@
|
||||
{
|
||||
"latest":[],
|
||||
"3.0.0": [
|
||||
"プロフィールディレクトリの表示",
|
||||
"ホワイトリスト式のトレンドタグ(3.0の機能)",
|
||||
"Featuredハッシュタグの追加",
|
||||
"ホームタイムラインと通知タイムラインの未読管理",
|
||||
"自分がどの選択肢に投票したかを表示"
|
||||
],
|
||||
"2.9.3": [],
|
||||
"2.9.2": [],
|
||||
"2.9.1": ["オーディオのアップロードと再生"],
|
||||
"2.9.0": ["ユーザーごとの通知のフィルター"],
|
||||
"2.8.4": [],
|
||||
"2.8.3": [],
|
||||
"2.8.2": [],
|
||||
"2.8.1": ["blurhashによる閲覧注意画像表示"],
|
||||
"2.8.0": [
|
||||
"アンケートの作成と投票",
|
||||
"keybase等のアカウント認証対応",
|
||||
"検索のオフセット等",
|
||||
"ブロックされているアカウントを表示したときに「ブロックされています」と表示",
|
||||
"公開範囲を指定してブースト"
|
||||
],
|
||||
"2.7.4": [],
|
||||
"2.7.3": [],
|
||||
"2.7.2": [],
|
||||
"2.7.1": [],
|
||||
"2.7.0": ["プロフィールディレクトリのユーザー追加", "時間指定投稿"],
|
||||
"2.6.5": [],
|
||||
"2.6.4": [],
|
||||
"2.6.3": [],
|
||||
"2.6.2": [],
|
||||
"2.6.1": [],
|
||||
"2.6.0": [
|
||||
"ダイレクトメールだけのタイムラインの表示",
|
||||
"詳細画面の「これより後のタイムライン」の利用",
|
||||
"タイムラインにおけるカードの表示"
|
||||
],
|
||||
"2.5.2": [],
|
||||
"2.5.1": [],
|
||||
"2.5.0": ["リプライ数のカウント", "プロフィールに紹介する"],
|
||||
"2.4.5": [],
|
||||
"2.4.4": [],
|
||||
"2.4.3": ["フィルター機能", "フォローレコメンデーション"],
|
||||
"2.4.2": [],
|
||||
"2.4.1": [
|
||||
"削除して再編集の画像を下書きに戻す",
|
||||
"検索時のトゥート数のグラフ等の表示(v2 search)",
|
||||
"トゥート内のURLからトゥートやアカウントの情報を開く",
|
||||
"設定ページから製作者のアカウント情報を開く",
|
||||
"TheDeskお知らせに添付されたトゥートを開く",
|
||||
"Glance TLやtootsearchのトゥートやアカウント情報を表示する"
|
||||
],
|
||||
"2.4.0": [
|
||||
"プロフィールのフィールド(4つの項目)を見る",
|
||||
"プロフィールにカスタム絵文字を使用する"
|
||||
],
|
||||
"2.3.3": [],
|
||||
"2.3.2": [],
|
||||
"2.3.1": [],
|
||||
"2.3.0": [
|
||||
"トゥートに埋め込まれたYouTubeやニコ動などをその場で再生する",
|
||||
"ローカル(メディア)と連合(メディア)タイムライン"
|
||||
],
|
||||
"2.2.0": [],
|
||||
"2.1.3": [],
|
||||
"2.1.2": [],
|
||||
"2.1.0": [
|
||||
"リスト機能",
|
||||
"アカウント移行機能(移行された通知)",
|
||||
"Glance TLのストリーミング"
|
||||
],
|
||||
"2.0.0": ["カスタム絵文字"],
|
||||
"1.6.1": [],
|
||||
"1.6.0": ["トゥートのピン留め"],
|
||||
"1.5.1": [],
|
||||
"1.5.0": [
|
||||
"Mastodonのサーバー規定値による投稿範囲の変更",
|
||||
"Mastodonのサーバー規定値による閲覧注意画像設定"
|
||||
],
|
||||
"1.4.7": [],
|
||||
"1.4.6": [],
|
||||
"1.4.5": [],
|
||||
"1.4.4": [],
|
||||
"1.4.3": [],
|
||||
"1.4.2": [],
|
||||
"1.4.1": ["ユーザーによるドメインブロック"],
|
||||
"1.3.3": [],
|
||||
"1.3.2": [],
|
||||
"1.3.1": [],
|
||||
"1.3.0": [],
|
||||
"oldest":[]
|
||||
}
|
||||
@@ -1,158 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<title>Account Manager - TheDesk</title>
|
||||
<meta content="width=device-width,initial-scale=1.0" name="viewport">
|
||||
<link href="../../css/materialize.css" type="text/css" rel="stylesheet">
|
||||
<link href="../../css/themes.css" type="text/css" rel="stylesheet">
|
||||
<link href="../../css/master.css" type="text/css" rel="stylesheet">
|
||||
<link href='../../css/font-awesome.css' rel='stylesheet' type='text/css'>
|
||||
<link href='../../css/tl.css' rel='stylesheet' type='text/css'>
|
||||
<link href='../../css/userdata.css' rel='stylesheet' type='text/css'>
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons|Open+Sans:300" rel="stylesheet">
|
||||
<style>
|
||||
.acct {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.card {
|
||||
width: 400px;
|
||||
background-color: #9e9e9e;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
body,
|
||||
html {
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
#acct-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
color: white;
|
||||
align-items: flex-start
|
||||
}
|
||||
|
||||
.lts {
|
||||
font-size: 150%
|
||||
}
|
||||
|
||||
.colorsel {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.card .colorsel div:not(.exc) {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.card .colorsel div.exc {
|
||||
width: 40px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.first {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center
|
||||
}
|
||||
|
||||
.first .hide-first {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
<meta charset="utf-8">
|
||||
<!--
|
||||
<script type="text/javascript">
|
||||
var _jipt = [];
|
||||
_jipt.push(['project', 'thedesk']);
|
||||
</script>
|
||||
<script type="text/javascript" src="https://cdn.crowdin.com/jipt/jipt.js"></script>
|
||||
-->
|
||||
</head>
|
||||
|
||||
<body id="mainView">
|
||||
<script type="text/javascript" src="../../js/common/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../js/platform/first.js"></script>
|
||||
<script type="text/javascript" src="../../js/common/materialize.js"></script>
|
||||
<script type="text/javascript" src="../../js/lang/lang.en.js"></script>
|
||||
<script>
|
||||
var misskeytoken = false;
|
||||
</script>
|
||||
<script type="text/javascript" src="../../js/ui/tips.js"></script>
|
||||
<script type="text/javascript" src="../../js/common/time.js"></script>
|
||||
<script type="text/javascript" src="../../js/common/modal.js"></script>
|
||||
<div class="hide-first">
|
||||
<a href="index.html" class="btn waves-effect orange nex"
|
||||
style="width:100%; max-width:200px;">Back</a><br>
|
||||
<h5>List of accounts</h5>
|
||||
<div id="acct-list"></div>
|
||||
<div class="divider"></div>
|
||||
</div>
|
||||
<div>
|
||||
<h5>Add an account</h5><br>
|
||||
<div id="add">
|
||||
<div class="row">
|
||||
<div class="col s8">
|
||||
<input type="text" id="url" style="width:70%" placeholder="ex)mstdn.jp">
|
||||
<div id="ins-suggest"></div>
|
||||
Uncheck it to skip pasiting code.(login to Mastodon on Windows or macOS) (Recommended: pcheck)<br>
|
||||
<label>
|
||||
<input type="checkbox" class="filled-in" id="linux" />
|
||||
<span>Code setup</span>
|
||||
</label>
|
||||
<br>
|
||||
<label>
|
||||
<input type="checkbox" class="filled-in" id="misskey" />
|
||||
<span>Login as Misskey</span>
|
||||
</label><br>
|
||||
<button class="btn waves-effect" onclick="instance()">Login</button><br>
|
||||
</div>
|
||||
<div class="col s4">
|
||||
<span style="font-family:Open Sans;">Supports</span>
|
||||
<div id="support" class="collection transparent"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="auth" style="display:none">
|
||||
Paste the code and close browser.<br>
|
||||
<input type="text" id="code" placeholder="Code">
|
||||
<button class="btn waves-effect" onclick="code()">Auth</button><br>
|
||||
</div>
|
||||
<div id="misskeylogin" style="display:none">
|
||||
<h5>AppSecret</h5>
|
||||
Read <a href="https://thedesk.top/how-to-misskey-login.html">Docs(ja)</a> to login Misskey.<br>
|
||||
<input type="hidden" id="misskey-url">
|
||||
<input type="text" id="misskey-key" placeholder="Code">
|
||||
<button class="btn waves-effect" onclick="misskeyLogin()">Auth</button><br>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hide-first">
|
||||
<h5>Main an account</h5>
|
||||
<div class="input-field" style="width:300px"><span data-trans="your_acct">Select an account</span>
|
||||
<br>
|
||||
<select id="main-acct-sel" class="acct-sel" style="color:black" onchange="mainacct()"></select>
|
||||
<label></label>
|
||||
</div>
|
||||
Some instance data by <a href="https://instances.social" target="_blank">instances.social API</a><br>
|
||||
<h5 id="ins-title"></h5>
|
||||
Administered by:<a id="ins-admin"></a><br>
|
||||
<span id="ins-desc"></span><br>
|
||||
<img src="../../img/loading.svg" id="ins-prof" width="200"><br>
|
||||
<br>
|
||||
Domain:<span id="ins-name"></span><br>
|
||||
Federated servers:<span id="ins-connect"></span><br>
|
||||
Toots:<span id="ins-toot"></span><br>
|
||||
Users:<span id="ins-user"></span>Users<br>
|
||||
Connection:<span id="ins-per"></span>%<br>
|
||||
Mastodon version:<span id="ins-ver"></span>@<span id="ins-upd"></span><br>
|
||||
</div>
|
||||
<script type="text/javascript" src="../../js/ui/theme.js"></script>
|
||||
<script type="text/javascript" src="../../js/platform/end.js"></script>
|
||||
<script type="text/javascript" src="../../js/common/sha256.js"></script>
|
||||
<script type="text/javascript" src="../../js/login/tkn.js"></script>
|
||||
<script type="text/javascript" src="../../js/login/instance.js"></script>
|
||||
<script type="text/javascript" src="../../js/login/manager.js"></script>
|
||||
<script type="text/javascript" src="../../js/tl/date.js"></script>
|
||||