Compare commits
742 Commits
feature/op
...
master
Author | SHA1 | Date | |
---|---|---|---|
b2bfde4426 | |||
8602b53260 | |||
145b361581 | |||
7743dd8e7f | |||
ed2886d449 | |||
002dfacc3e | |||
fd9fbc32a8 | |||
e54deeb4f7 | |||
c85f211d5e | |||
67f848a9ee | |||
fe336122e0 | |||
6d8d8493a6 | |||
5d7d249fff | |||
35ca030dfb | |||
fab6fb0f5b | |||
3b8fc807f7 | |||
13cfb9ff14 | |||
aabd5e75d8 | |||
7be6fb9501 | |||
9fc63e5cd3 | |||
7a1e8be48a | |||
d299a65e03 | |||
2337f7a3ba | |||
4853d7e2fd | |||
ca1a375f2d | |||
0d098815a2 | |||
30cbfb6ffd | |||
4c7deffdfe | |||
15133e561f | |||
c235b52e3b | |||
903f356252 | |||
54c44b4379 | |||
dcbeecc8cf | |||
bf182c65ad | |||
7c5e4101b0 | |||
2736ac418f | |||
e2dac10501 | |||
c15d7ab28e | |||
de78f8b1d5 | |||
e56d32180c | |||
6c92837317 | |||
d4015a86ef | |||
4b4be96e26 | |||
823e1d983c | |||
47fba5b81a | |||
ee23ebb705 | |||
d6d3a95daf | |||
e839e632fc | |||
cb6f0a9a32 | |||
c5515934d9 | |||
7dafe85c53 | |||
3bc65c252d | |||
d4f9ab9f37 | |||
b96227b07a | |||
da12ee452c | |||
99df043b5f | |||
54d53f1b91 | |||
3645b9ffcf | |||
9d0ce25be7 | |||
1c860f74fb | |||
75e31dc3a4 | |||
10a8452709 | |||
f824f73491 | |||
16c34e3d52 | |||
76c4599dee | |||
1af80096c7 | |||
cbb2bb4502 | |||
0f3bcaa8e6 | |||
ae6575043e | |||
0dbd5b456c | |||
81f3e62446 | |||
e0bb25466d | |||
cb334aab0d | |||
9cef850d06 | |||
79ecc87db4 | |||
12644bfbea | |||
bc6b58aa3f | |||
abeded1d03 | |||
a466f77b6e | |||
968ce5432a | |||
277506b3c8 | |||
1c48ea1908 | |||
f2ac1557a4 | |||
7213c1e35f | |||
9f5f953b46 | |||
3ff6054c20 | |||
9fb25254a6 | |||
8c6a06d490 | |||
dd37837848 | |||
5ca9325e16 | |||
b8fdf0911a | |||
a7302fee4b | |||
41bf4d2764 | |||
0970140a3a | |||
b8eb8ec052 | |||
46b7d6a25a | |||
aab2f5b014 | |||
6062094e6f | |||
f7e36619df | |||
167f5173cd | |||
c7ebd42fe9 | |||
94018c6ee3 | |||
388327ec1d | |||
0ba56c271d | |||
bd1216c275 | |||
3180063fe3 | |||
9cb9a6607b | |||
42cdcd5c25 | |||
8b1da27af7 | |||
638e228ce9 | |||
94469ccd0e | |||
48f7e1f39c | |||
60f7abfa42 | |||
cd391db302 | |||
8613d6971f | |||
cc18153889 | |||
be4bf9e2a3 | |||
085bd4aab9 | |||
977d103c3a | |||
0778f07922 | |||
e12154601b | |||
b22d50f760 | |||
302f21b477 | |||
65da515854 | |||
e9bd3154a5 | |||
1da147e110 | |||
e7dd85420c | |||
3e542871c6 | |||
26b78f1225 | |||
57261b5094 | |||
c7f24133e5 | |||
87aa397a7c | |||
e2a18ec765 | |||
26ee2ffbb6 | |||
38dd1ddbe8 | |||
11bc79520a | |||
cc0ae60c83 | |||
30b028d836 | |||
a30a70c6b5 | |||
9503003a4a | |||
a58edad8ea | |||
d0ba619b45 | |||
64bad6758b | |||
b902b8f9ba | |||
7bb4ee96e7 | |||
6c3e960096 | |||
cacb0f1ea0 | |||
5a2e33ccd2 | |||
5d389a0796 | |||
6db1d8af2a | |||
51d73e09ae | |||
3c324aa1b2 | |||
a94092ac78 | |||
f9d72d12b6 | |||
81e11c2ae9 | |||
f7a82ccdf7 | |||
44e3395835 | |||
d558717152 | |||
b9b021f466 | |||
13bfd63dc2 | |||
9600c4f1c9 | |||
de9696471a | |||
c954f8b984 | |||
08479242f7 | |||
d70783cc82 | |||
a2f0617d5a | |||
27b6ca824d | |||
e84f8ee541 | |||
ad87dbdcb9 | |||
9c42c120f5 | |||
740f2e8f6f | |||
a0388689cf | |||
46cb5e1078 | |||
abc53cf00f | |||
68f367bd39 | |||
d54097799c | |||
ffc25520bb | |||
ccdc68870a | |||
7820da181e | |||
ec4d43d2ec | |||
c12a04b55f | |||
e0fe4c7103 | |||
82f2983ac2 | |||
d2733cf486 | |||
3aabd298ec | |||
a0e375d2dc | |||
8806c8ea0c | |||
f0120010fe | |||
a5a121ee00 | |||
459a0eaa91 | |||
84fefbaa14 | |||
023b8c370a | |||
0a023ac6f2 | |||
83f7e4498a | |||
d57040fc5b | |||
7df62ba530 | |||
f51ec50113 | |||
6748cbe52d | |||
fda2dcc484 | |||
07a5f06695 | |||
c9392911d9 | |||
88dec55116 | |||
f30de3f4a0 | |||
3c5aafee2d | |||
52b4e48217 | |||
58ed3b1ca4 | |||
bfef49bc33 | |||
b7a61e5bc0 | |||
|
15a3ffd406 | ||
66f934e46e | |||
47b85cfebc | |||
d0b060f31a | |||
a756a9dc16 | |||
207b82cc8b | |||
26df9633b4 | |||
2b749d6a3b | |||
8c403f106c | |||
36aa226e9c | |||
|
1946b77285 | ||
a09ea26b0e | |||
1556506bd7 | |||
f94f6ec956 | |||
aae566b82a | |||
dd8aeefdfd | |||
7d951a5115 | |||
556722693c | |||
78f350b72b | |||
340ee05443 | |||
561a1aa5a5 | |||
e2fa4f9cfc | |||
ee56187c9d | |||
d3dbceb749 | |||
799c953b30 | |||
e766d6da69 | |||
53ed81fa81 | |||
320d35d9e5 | |||
a1bfaaaf92 | |||
03ebc87aa5 | |||
d2447d2d8a | |||
296f146835 | |||
9a7e38d897 | |||
f0fcf996c9 | |||
c1b14979a2 | |||
9e9fdfe37f | |||
135ce2dfdd | |||
167d46ca76 | |||
23d2c252fe | |||
9100c1d9de | |||
b45b232ecf | |||
9648d30aa2 | |||
5a04c2eeee | |||
74fe85f3a2 | |||
4b44efe6fc | |||
|
8922054c44 | ||
302353f448 | |||
3891d946e0 | |||
e92e2e22f5 | |||
4f4eb46a60 | |||
0daef615c1 | |||
6ce8bba6b7 | |||
09cf3ce54e | |||
872b0dea6e | |||
376f20aeab | |||
57aae96781 | |||
7c27c33aa0 | |||
7dc354509b | |||
7c09440084 | |||
|
5538ec4d3d | ||
89168b643c | |||
7fefe255ea | |||
3423aac49a | |||
|
cc8d1d8a94 | ||
|
c0a863740a | ||
|
f006eed113 | ||
3f131f44d1 | |||
5cfc089bf1 | |||
987b1ad655 | |||
1cd06040da | |||
f99220bf8b | |||
8bef1d0c99 | |||
47a73cfa6c | |||
2dd901b1d5 | |||
46725c6fa4 | |||
|
adfc3fca5f | ||
|
077610820c | ||
|
9a3bd3ff88 | ||
85fed9d4c5 | |||
5a2d8d22cb | |||
761f2c21a8 | |||
c34340d0d1 | |||
045cd5a528 | |||
27b0609d34 | |||
65556d9cad | |||
30835e94c0 | |||
ee8ac1d9ee | |||
2be44d54ae | |||
cf8bedfad9 | |||
5dc9b498d4 | |||
fb7a168d31 | |||
484db037c0 | |||
15a89583a2 | |||
75cc0d5a87 | |||
0e3b962a00 | |||
afaf65a53d | |||
f00d3b5aaf | |||
03bd442783 | |||
787bd1a532 | |||
bd5befc18c | |||
829047585a | |||
78da45d468 | |||
7f7ab7b752 | |||
79fb10c556 | |||
ffd9c6fb7a | |||
4074774d3a | |||
e7d43c566f | |||
52b94003bf | |||
13bd280062 | |||
209e4221d2 | |||
c4832a9ef7 | |||
6cb8cc174b | |||
e9b882376c | |||
a4948d3eef | |||
746a78577e | |||
268ef7dae3 | |||
6c1d666fdf | |||
53fb3e8f46 | |||
2df0b1a0fb | |||
3846d1a926 | |||
2a747e11af | |||
cda6b4e10d | |||
502ce707e1 | |||
5b1f73a69e | |||
f7eba0974f | |||
2ae84bccd8 | |||
3ac3f1aee5 | |||
23ca74afdb | |||
7d894fb1e3 | |||
b39e6be952 | |||
415ebf6821 | |||
b1ec4f7387 | |||
820af9b133 | |||
54c88dcb2f | |||
104ed85d72 | |||
84de5927cd | |||
1b829e095b | |||
cbb4624e25 | |||
2cb02ff3f2 | |||
b8cd441109 | |||
86a8c23999 | |||
a2573b5aaf | |||
ea8671f64b | |||
a234903b8f | |||
981da95cde | |||
18fe17f00f | |||
5ad8302084 | |||
cfcd0c5945 | |||
eb1b1cf73d | |||
95d3d962f4 | |||
6eb96f917d | |||
5847215097 | |||
d102a8cd7d | |||
571ac92cd3 | |||
246743203f | |||
1cc76ab3b1 | |||
5c9112a07b | |||
d92b24a2f6 | |||
7729bf545e | |||
c14aa99e5b | |||
2ced591ed4 | |||
56dcd0feb3 | |||
c43b1daa42 | |||
5e0f7c6160 | |||
cbaa424fc4 | |||
c2039da7c8 | |||
6d4b161b06 | |||
fef2c26cbe | |||
50719113b1 | |||
4e407e2cf8 | |||
336879a4a1 | |||
7fd28616aa | |||
fba6a8d604 | |||
e5c1bcded1 | |||
b99929063c | |||
18d7414b90 | |||
|
4427844a41 | ||
|
e92f53f590 | ||
965a48c086 | |||
0edd82479e | |||
338b219142 | |||
c504d5594c | |||
9beeffc679 | |||
19e021ce8e | |||
c863447f3d | |||
520b0b7ade | |||
48e12c8504 | |||
60f940f4db | |||
0bed840b6f | |||
ddbddc45a9 | |||
a039fd4ce4 | |||
d3c3c99069 | |||
843a405323 | |||
cb548c3a3d | |||
d406438527 | |||
6737061713 | |||
46c635b11b | |||
5f04c03f80 | |||
dbf96f97b6 | |||
861e62dc56 | |||
1b00420388 | |||
0ac57ca2ac | |||
58e29f4590 | |||
8e544a6ae0 | |||
2cf42cb6ed | |||
93eb67ca49 | |||
58302ea87c | |||
f17bae8f39 | |||
fee73519e6 | |||
5d1ad6f935 | |||
6d07fc24e4 | |||
a720556ac9 | |||
0bc1254ce0 | |||
f8bd8e2eec | |||
d0beb137fe | |||
c6e4d06fa1 | |||
190737b915 | |||
902f880a68 | |||
624c072bb3 | |||
09253fe0a1 | |||
a0eeabbd50 | |||
873a8cf3a8 | |||
9c1fb77dc8 | |||
0a3627c7fe | |||
2a4a3f7192 | |||
0b30688d59 | |||
5cbfb70306 | |||
63e40cf71a | |||
d1baebcceb | |||
c07916362e | |||
d382b46464 | |||
78c66a1543 | |||
48319acc31 | |||
b634e4d2b3 | |||
03f37fa1a3 | |||
3185e500d1 | |||
bf010a243c | |||
9d2b480f3f | |||
b69a03d42f | |||
f1330570d6 | |||
589a1fefbf | |||
d64b41a363 | |||
e7613aa691 | |||
e272d1d4d4 | |||
0dc196127e | |||
42394a48bc | |||
6546ad2166 | |||
cd7a1de548 | |||
d644395b35 | |||
5b0fcef15c | |||
|
bd1a904fd5 | ||
a9ab8d8b92 | |||
bb3fcc646e | |||
0f5111e1e2 | |||
73eb5ffe93 | |||
8cefa4af2f | |||
ede570865f | |||
038191d38e | |||
6a1f07d881 | |||
6c59c009e5 | |||
4354393f79 | |||
d215a10486 | |||
a699166368 | |||
b83be3de7d | |||
db287adaed | |||
7714adb843 | |||
3eca178df5 | |||
87310f95cc | |||
57ad81a7a4 | |||
c1e0e7b280 | |||
006c9ef975 | |||
08fceafc17 | |||
357d4829eb | |||
e5d1addc00 | |||
d4868020f4 | |||
7e41768aba | |||
075168ed85 | |||
8475340999 | |||
a3bd8a8b7e | |||
7e49b493bb | |||
888ffcaded | |||
83b8ce0aaa | |||
7f77847baa | |||
72da7eb5f4 | |||
5c6ea49c66 | |||
6de5ae6355 | |||
ec2cd3d6a0 | |||
6031e35133 | |||
b322ef0db1 | |||
4febd2f602 | |||
46360d1b1f | |||
2d8bf0c0ee | |||
a907d0d404 | |||
0117d44422 | |||
4fdd6af291 | |||
9a864bc11c | |||
ee3ccef0e4 | |||
d9053e26b5 | |||
efefa4ef32 | |||
cfc7f6aca6 | |||
3b79829b72 | |||
4d1da636e3 | |||
226cfb654e | |||
dc71a25863 | |||
cb5218e52d | |||
f63fd895fe | |||
5efa8c88c1 | |||
870384f83b | |||
02b4b44780 | |||
ea186d0aeb | |||
96a5b8da8f | |||
f961c8aea8 | |||
f3a9c06f92 | |||
78c04523c0 | |||
fff575f762 | |||
bc19164c25 | |||
3ab619799a | |||
f1613b950c | |||
ee9599d040 | |||
851f0e0e84 | |||
56ebd2d36c | |||
38d1be5fc2 | |||
35208cf9e8 | |||
0aa7beb525 | |||
71cb357424 | |||
bc5d5046df | |||
5bd2952437 | |||
9a0c0ba810 | |||
a5bf3ec1e0 | |||
84da78e2e8 | |||
13b89eb2a9 | |||
89c524a690 | |||
d44d1b6e64 | |||
8ea5b3d5be | |||
f8c774700e | |||
ef410d9e01 | |||
328eba1d6c | |||
b819fc816b | |||
1410f699c5 | |||
be6df178f6 | |||
2a7001ea3a | |||
e2eaa206e4 | |||
437890a609 | |||
2025547d33 | |||
884db1c5e3 | |||
aa1ccedad5 | |||
df2b0f5614 | |||
aec87e7681 | |||
bf26961aaa | |||
67ad0c54b4 | |||
fda7b38fa1 | |||
5b5f4204bb | |||
167b9d4305 | |||
0760e447db | |||
897e65567b | |||
7e403e3406 | |||
7cb378029c | |||
f4ff7e7ed6 | |||
4c359675b6 | |||
5987fda0b2 | |||
066b74e1ac | |||
af7833a372 | |||
f554030f3c | |||
0e0eb57fd9 | |||
485a5c13f0 | |||
bb8d63f67d | |||
6340541daf | |||
028aceef2c | |||
5e96cdcad8 | |||
c04780bb16 | |||
84d33a9ccb | |||
b30369dfea | |||
a5ef24a50f | |||
9b1067afc4 | |||
433057bb19 | |||
3704ea7962 | |||
76b380d6c3 | |||
804509b3c5 | |||
1e8fd6aad4 | |||
fbcf4c0c19 | |||
0234ea7871 | |||
75ec1969c0 | |||
bcc3d89342 | |||
e4194e029c | |||
d673ed089f | |||
96ddc8a84b | |||
70f7b88d71 | |||
f174ddab68 | |||
f7c373481d | |||
33d16221cc | |||
dd4d71a496 | |||
c2f1c6980f | |||
c0c454f3ef | |||
4b5c5a8dce | |||
becf7c328e | |||
fbe58ec54d | |||
609247cbf0 | |||
a9f99d93be | |||
be82c4dae6 | |||
94a9b1e56f | |||
769ff6aace | |||
6e1fe930ac | |||
93b8049b01 | |||
5cf74b4405 | |||
2aa91df820 | |||
85fedbfeaf | |||
1cbe74252c | |||
9fb9667dba | |||
55b6ca7392 | |||
758c2bf0bc | |||
6eed271814 | |||
7a5a4bddf8 | |||
3f8ea683ef | |||
29dff35bb4 | |||
c1c9dd1625 | |||
ffa38cf4ff | |||
3d64a08b08 | |||
79462c320d | |||
7881ae5290 | |||
2d6052d715 | |||
b4e8622af3 | |||
7c2cd5cf03 | |||
2a350f404a | |||
6907f65439 | |||
5713037c4d | |||
cd26a1ceed | |||
c05eed44f0 | |||
f27b3f1895 | |||
f4f69d4eaa | |||
1badce511e | |||
|
595109024a | ||
f55731e793 | |||
6061a3efc5 | |||
b6cae36528 | |||
7d8f3912bb | |||
eb02865131 | |||
0310e1e2de | |||
12b15c58f8 | |||
4635dc4eec | |||
0a5243837f | |||
37eccb12f2 | |||
84db9361f9 | |||
3fd432f432 | |||
d4947571a4 | |||
e8e9db2bbc | |||
4ed998a9ab | |||
7900bd18db | |||
357b7a0365 | |||
145b237701 | |||
38ef7905c7 | |||
38641df28e | |||
55fbd30699 | |||
5e4aca66c5 | |||
8325e44a0e | |||
a91ed7368f | |||
cda4b81554 | |||
be759c512a | |||
cfde1ee58c | |||
db866bf8d8 | |||
d32c083406 | |||
e56551c79d | |||
97099ece1c | |||
f05f37841a | |||
dbc0c8c741 | |||
2ab01c1013 | |||
ada7e69abd | |||
27e03115d2 | |||
1b6d20fa0b | |||
aa186da1bd | |||
a6a09a10b5 | |||
e25a0a954c | |||
09f203dd64 | |||
1858e092a9 | |||
e5f2bde6bc | |||
0848b2fe67 | |||
691675bdc2 | |||
1e70ea51cf | |||
f8e3a39620 | |||
6b91444f3c | |||
4f7fc75d6b | |||
51735ad8c2 | |||
78c34c77e0 | |||
65dacee829 | |||
288f2334f6 | |||
43a86a7495 | |||
28c12861e5 | |||
7fb9aad0d0 | |||
48167623ff | |||
43b136ca46 | |||
ec83830e78 | |||
7093236237 | |||
c7d133ba3d | |||
47475ac597 | |||
4f478a4667 | |||
b55d9dd7b9 | |||
02fa4e2fe8 | |||
e5206b524f | |||
|
5695534a9a | ||
ca6083b0ee | |||
8d29e7b5bb | |||
7f9766ff95 | |||
5098c45174 | |||
6ca6fcd10c | |||
86a184fe29 | |||
19f2ef7d68 | |||
|
74ea6fa238 | ||
87a65d4af2 | |||
2eec8b3ef9 | |||
cfa0c4e2c8 | |||
ced35084ba | |||
20346a784e | |||
4f6f946245 | |||
16a2a424d2 | |||
2aea741372 | |||
53073ecdfa | |||
8216965533 | |||
88ce945a47 | |||
fef30ce3e9 | |||
0cdbb19b7a | |||
69e44c4964 | |||
d59a78b039 | |||
e7957b6503 | |||
3b4b52f6a1 | |||
a4bca8af45 | |||
cc53df5999 | |||
a271b4d63e | |||
5c73f97c54 | |||
ecc65676f2 | |||
619d89c4f5 | |||
fe66c9dfbc | |||
95d8d8a8cb | |||
ee7d958224 | |||
88a3298cfa | |||
4a761efaed |
6
.babelrc
@ -1,13 +1,13 @@
|
||||
{
|
||||
"plugins": [
|
||||
"@babel/plugin-proposal-optional-chaining"
|
||||
"@babel/plugin-proposal-class-properties"
|
||||
],
|
||||
"presets": [
|
||||
["@babel/preset-env", {
|
||||
"useBuiltIns": false,
|
||||
"targets": {
|
||||
"esmodules": true,
|
||||
},
|
||||
"esmodules": true
|
||||
}
|
||||
}]
|
||||
]
|
||||
}
|
||||
|
6
.gitignore
vendored
@ -9,3 +9,9 @@ build/
|
||||
*.pem
|
||||
|
||||
*.kate-swp
|
||||
|
||||
src/res/img/git-ignore/
|
||||
|
||||
test/debug-configs/
|
||||
|
||||
debugging-resources/
|
||||
|
@ -1,23 +0,0 @@
|
||||
image: node:current
|
||||
|
||||
cache:
|
||||
paths:
|
||||
- node_modules/
|
||||
- .yarn
|
||||
|
||||
stages:
|
||||
- prep
|
||||
- build
|
||||
- pack
|
||||
|
||||
install deps:
|
||||
stage: prep
|
||||
script: yarn install
|
||||
|
||||
build:
|
||||
stage: build
|
||||
script: npm run build
|
||||
|
||||
create zip:
|
||||
stage: pack
|
||||
script: npm run build-zip
|
8
.vscode/extensions.json
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"hollowtree.vue-pack",
|
||||
"msjsdiag.debugger-for-chrome",
|
||||
"firefox-devtools.vscode-firefox-debug",
|
||||
"msjsdiag.debugger-for-edge"
|
||||
]
|
||||
}
|
67
.vscode/launch.json
vendored
@ -1,23 +1,52 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
|
||||
{
|
||||
"type": "chrome",
|
||||
"request": "attach",
|
||||
"name": "Attach to Chrome",
|
||||
"port": 9222,
|
||||
"urlFilter": "http://*/*",
|
||||
"webRoot": "${workspaceFolder}"
|
||||
},
|
||||
{
|
||||
"type": "firefox",
|
||||
"request": "attach",
|
||||
"name": "Attach (firefox)",
|
||||
"pathMappings": [
|
||||
{
|
||||
"name": "Launch addon",
|
||||
"type": "firefox",
|
||||
"request": "launch",
|
||||
"port":6000,
|
||||
"reAttach": true,
|
||||
"addonType": "webExtension",
|
||||
"addonPath": "${workspaceFolder}/dist-ff",
|
||||
"url": "webpack:///ext",
|
||||
"path": "${workspaceFolder}/src/ext"
|
||||
}
|
||||
],
|
||||
"firefox": {
|
||||
"executable": "/usr/bin/firefox-developer-edition",
|
||||
"firefoxArgs": [
|
||||
"--start-debugger-server"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Launch addon (firefox)",
|
||||
"type": "firefox",
|
||||
"request": "launch",
|
||||
"port": 6000,
|
||||
"reAttach": true,
|
||||
"addonType": "webExtension",
|
||||
"addonPath": "${workspaceFolder}/dist-ff",
|
||||
"pathMappings": [
|
||||
{
|
||||
"url": "webpack:///ext",
|
||||
"path": "${workspaceFolder}/src/ext"
|
||||
},
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"firefox": {
|
||||
"executable": "/usr/bin/firefox-developer-edition",
|
||||
"firefoxArgs": [
|
||||
"--start-debugger-server"
|
||||
]
|
||||
},
|
||||
"chrome": {
|
||||
"executable": "/usr/bin/google-chrome-stable --remote-debugging-port=9222",
|
||||
}
|
||||
}
|
||||
|
17
.vscode/settings.json
vendored
@ -1,7 +1,5 @@
|
||||
{
|
||||
"cSpell.words": [
|
||||
"PILLARBOX",
|
||||
"PILLARBOXED",
|
||||
"aard",
|
||||
"ardetector",
|
||||
"autodetect",
|
||||
@ -11,26 +9,38 @@
|
||||
"blackbars",
|
||||
"blackframe",
|
||||
"canvas",
|
||||
"clickthrough",
|
||||
"com",
|
||||
"comms",
|
||||
"csui",
|
||||
"decycle",
|
||||
"dinked",
|
||||
"dinks",
|
||||
"disneyplus",
|
||||
"endregion",
|
||||
"equalish",
|
||||
"fith",
|
||||
"fitw",
|
||||
"fuckup",
|
||||
"gfycat",
|
||||
"gmail",
|
||||
"guardline",
|
||||
"han",
|
||||
"haram",
|
||||
"iframe",
|
||||
"imgur",
|
||||
"insta",
|
||||
"letterboxed",
|
||||
"manjaro",
|
||||
"mdicon",
|
||||
"mdijs",
|
||||
"minification",
|
||||
"mitigations",
|
||||
"nogrow",
|
||||
"noshrink",
|
||||
"outro",
|
||||
"PILLARBOX",
|
||||
"PILLARBOXED",
|
||||
"polyfill",
|
||||
"recursing",
|
||||
"reddit",
|
||||
@ -44,6 +54,7 @@
|
||||
"tablist",
|
||||
"tamius",
|
||||
"textbox",
|
||||
"ultrawide",
|
||||
"ultrawidify",
|
||||
"unmark",
|
||||
"unmarking",
|
||||
@ -72,4 +83,4 @@
|
||||
"undisable",
|
||||
"vdid"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
224
CHANGELOG.md
@ -1,19 +1,183 @@
|
||||
# Changelog
|
||||
|
||||
## v4.x
|
||||
|
||||
|
||||
### Plans for the future
|
||||
|
||||
* WebGL
|
||||
* Native builds for Chromium Edge and Opera
|
||||
* Native builds for Chromium Edge
|
||||
* Settings page looks ugly af right now. Maybe fix it some time later
|
||||
* other bug fixes
|
||||
|
||||
QoL improvements for me:
|
||||
## v7.0 (planned major)
|
||||
* WebGL autodetection
|
||||
|
||||
* logging: allow to enable logging at will and export said logs to a file
|
||||
## v6.0 (current major)
|
||||
|
||||
### v4.4.8 (Current)
|
||||
### v6.0.1
|
||||
|
||||
* Fixed external links
|
||||
|
||||
### v6.0.0
|
||||
|
||||
Chrome only, because I needed to rush manifest v3 migration before ensuring things work in Firefox.
|
||||
|
||||
* In player UI
|
||||
* New alignment options (can align video both vertically, as well as horizontally)
|
||||
* Extension does a little bit of a better job differentiating between levels of support for a given site
|
||||
* Changed how cropping and panning works. This should lead to fewer problems and better generic support.
|
||||
* REGRESSION: no manual panning with shift + mouse movement
|
||||
* "Player select" screen, which provides a GUI way for picking HTML element that acts as the video player area
|
||||
|
||||
Regressions and potential issues:
|
||||
* Settings were largely not migrated from previous versions. This is as intended, since changes to cropping (and some other aspects)
|
||||
rendered certain old settings obsolete.
|
||||
* Extension can no longer discriminate between iframes — extension popup commands get sent to ALL iframes on page
|
||||
* Extension probably can't discriminate between multiple videos on a single page
|
||||
|
||||
## v5.x
|
||||
|
||||
### v5.1.7
|
||||
|
||||
Firefox-only.
|
||||
|
||||
* When cropping and panning video, CSS' `transform: translate(x,y)` now uses integers _always_. Before that fix, `translate(x,y)` could be offset by x.5 px, and that half of a pixel introduced a 1px thick line on the portion of the left edge of the video.
|
||||
|
||||
### v5.1.7
|
||||
|
||||
* When aligning videos, ensure video is never translated by a fractional value
|
||||
* As of recent nVidia driver update in Edge, Angle detection fails in a way that prevents popup from showing up. This problem should be fixed now.
|
||||
|
||||
The angle detection problem was fixed by disabling the angle detection check for now, as Chrome, et al. appear to have fixed buggy video hardware acceleration.
|
||||
|
||||
### v5.1.6
|
||||
|
||||
* Added new config for disney+ (courtesy of @MStefan99)
|
||||
* Chrome hardware acceleration is bugged and cannot be worked around in-extension. Only way to fix this is for users to change their Google Chrome settings. Added naggathon with instructions into the extension popup.
|
||||
|
||||
### v5.1.5
|
||||
|
||||
* Fixed laginess in Chromium-based browsers on Windows. Details in [#199](https://github.com/tamius-han/ultrawidify/issues/199#issuecomment-1221383134)
|
||||
|
||||
### v5.1.4
|
||||
|
||||
* Fixed some problems with autodetection not returning to 16:9 when necessary if autodetection already changed aspect ratio ([#198](https://github.com/tamius-han/ultrawidify/issues/198))
|
||||
|
||||
### v5.1.3
|
||||
|
||||
* Fixed some problems with autodetection sometimes briefly resetting on dark frames ([#195](https://github.com/tamius-han/ultrawidify/issues/195), [#196](https://github.com/tamius-han/ultrawidify/issues/196))
|
||||
|
||||
### v5.1.2
|
||||
|
||||
* `set-extension-mode` turned into `set-ExtensionMode` at some point. This caused in "Enable this extension" options to vanish on certain setups.
|
||||
* Blackframe tests now run on same data as main algorithm as opposed on a smaller sample (`drawImage()` calls are _very_ expensive even for a 16x9 sample).
|
||||
|
||||
### v5.1.1
|
||||
|
||||
* Fixed autodetection
|
||||
|
||||
### v5.1.0
|
||||
|
||||
* Re-enable logger
|
||||
* Move aspect ratio autodetection to requestAnimationFrame
|
||||
* Fix netflix
|
||||
|
||||
### v5.0.7
|
||||
|
||||
* Videos of square-ish aspect ratios on 1440p (and lower) resolutions now no longer get misaligned ([#162](https://github.com/tamius-han/ultrawidify/issues/162))
|
||||
* Alignment of featured videos on youtube channel page should now also be fixed
|
||||
|
||||
### v5.0.6
|
||||
* Added configuration for metaivi.com based on user feedback ([#160](https://github.com/tamius-han/ultrawidify/issues/160))
|
||||
* Removed ExtConfPatches for versions < 4.5.0, because nobody should be using a build of this extension that's over a year old
|
||||
|
||||
### v5.0.5
|
||||
|
||||
* improved UX a bit
|
||||
* Fixed white background on app.plex.tv ([#158](https://github.com/tamius-han/ultrawidify/issues/158))
|
||||
|
||||
### v5.0.4
|
||||
* Attempt to fix disney+ again, courtesy of [@jwannebo](https://github.com/tamius-han/ultrawidify/issues/84#issuecomment-846334005) on github.
|
||||
|
||||
|
||||
### v5.0.3
|
||||
|
||||
* Fixed the issue where the videos were sometimes offset up and left. Again.
|
||||
* Fix the issue where correcting source stretch was squished incorrectly ([#153](https://github.com/tamius-han/ultrawidify/issues/153))
|
||||
|
||||
### v5.0.2
|
||||
|
||||
* When in full screen, the extension will assume player element dimensions are the same as the screen resolution. This should help with sites where ultrawidify doesn't correctly identify the player, as cropping generally doesn't work if player element is not identified. Old behaviour can be restored in advanced extension settings by toggling the "use player aspect ratio in fullscreen" checkbox under 'player detection settings'.
|
||||
* Extension should now respect 'disable extension' option for real.
|
||||
* Fixed the issue where player wouldn't get detected if video was wider than the player.
|
||||
|
||||
|
||||
### v5.0.1
|
||||
* Added an option for users to turn off (and/or configure) Chrome/Edge's zoom limiter.
|
||||
|
||||
### v5.0.0
|
||||
|
||||
There's been some big-ish changes under the hood:
|
||||
|
||||
* Migrate main scripts to typescript (vue is currently not included).
|
||||
* webextension-polyfill is now used everywhere (if only because typescript throws a hissy fit with `browser` and `chrome` otherwise) ([#114](https://github.com/tamius-han/ultrawidify/issues/114))
|
||||
* Fix some bugs that I didn't even know I had, but typescript kinda shone some light on them
|
||||
* Manual zoom (Z/U unless sites override the two) should now work again (without automatic AR constantly overriding it). Same goes for panning. ([#135](https://github.com/tamius-han/ultrawidify/issues/135) & [#138](https://github.com/tamius-han/ultrawidify/issues/138))
|
||||
* Fix issue when video would be scaled incorrectly if video element uses `height:auto`.
|
||||
* **[5.0.0.1]** Fixed the issue where settings were reset on page load.
|
||||
* **[5.0.0.1]** Fixed the issue where settings page wouldn't load.
|
||||
## v4.x (current major)
|
||||
|
||||
### v4.5.3
|
||||
|
||||
* Provides workaround for the fullscreen stretching bug Chrome 88 (or a recent Windows 10 update) introduced for nVidia users using hardware acceleration on Windows 10. In order to mitigate this bug, Ultrawidify needs to keep a 5-10 px wide black border while watching videos in full screen. This bug is also present in Edge.
|
||||
* **[4.5.3.1]** Fixed letterbox misalignment binding in settings (#134)
|
||||
* **[4.5.3.2]** Fixed false 'autodetection not supported' notifications.
|
||||
|
||||
### v4.5.2
|
||||
|
||||
* Fixed the issue where videos would sometimes get misaligned while using hybrid stretch, except for real this time. ([#125](https://github.com/tamius-han/ultrawidify/issues/125))
|
||||
* Improved DRM detection (the 'autodetection cannot work on this site' popup should now no longer show up on the sites where autodetection _can_ work)
|
||||
|
||||
### v4.5.1
|
||||
|
||||
* Fixed the misalignment issue on netflix ... hopefully.
|
||||
* 'Site settings' tab should now work in Chrome as well ([#126](https://github.com/tamius-han/ultrawidify/issues/126))
|
||||
* Popup interface now refreshes properly ([#127](https://github.com/tamius-han/ultrawidify/issues/127))
|
||||
* Videos should now be scaled correctly when the display is narrower than video's native aspect ratio ([#118](https://github.com/tamius-han/ultrawidify/issues/118))
|
||||
* Fullscreen videos on streamable are aligned correctly ([#116](https://github.com/tamius-han/ultrawidify/issues/118)).
|
||||
* **[4.5.1.1]** Streamable fix broke old.reddit + RES on embeds from v.redd.it and streamable.com. We're now using an alternative implementation. ([#128](https://github.com/tamius-han/ultrawidify/issues/128))
|
||||
* **[4.5.1.2]** Fixed the issue where videos would sometimes get misaligned while using hybrid stretch. ([#125](https://github.com/tamius-han/ultrawidify/issues/125))
|
||||
* **[4.5.1.3]** Added fix for disney plus
|
||||
* **[4.5.1.3]** Microsoft Edge has fixed the bugs that prevented the extension from working properly. Popup should no longer be shown.
|
||||
|
||||
|
||||
### v4.5.0 (Current)
|
||||
|
||||
* Under the hood: migrated from vue2 to vue3, because optional chaining in templates is too OP.
|
||||
* (On options page, section 'Action & shortcuts') Manual aspect ratio now supports entering custom ratios using '21/9' and '2.39:1' formats (as opposed to single number, e.g. '2.39') — [#121](https://github.com/tamius-han/ultrawidify/issues/121).
|
||||
* Added config for wakanim.tv (special thanks to @saschanaz for doing the legwork — [#113](https://github.com/tamius-han/ultrawidify/issues/113))
|
||||
* (In Firefox) When extension was placed in overflow menu, the popup was cut off. That should be fixed now. [#119](https://github.com/tamius-han/ultrawidify/issues/119)
|
||||
* The extension will now show a notification when autodetection can't run due to DRM
|
||||
* Videos on facebook and reddit no longer get shifted up and to the left for me (cropping most of the video off-screen), but I haven't been deliberately trying to fix that issue. If you experience that issue, please consider contacting me (via github or email) with a link to a problematic video.
|
||||
|
||||
### v4.4.10
|
||||
|
||||
* Video alignment should now work on Twitch — [#109](https://github.com/tamius-han/ultrawidify/issues/109)
|
||||
* Videos should now align properly on Hulu while cropped — [#111](https://github.com/tamius-han/ultrawidify/issues/111) & via email
|
||||
* Fixed a problem where changing certain settings would cause multiple instances of Ultrawidify to run on a page, effectively preventing some crop options to be set until reload. (possibly [#112](https://github.com/tamius-han/ultrawidify/issues/112)?)
|
||||
* Fixed a problem where embedded videos would be misaligned after switching from full screen
|
||||
* **[4.4.10.1]** Fixed cruncyhroll regression — [#109](https://github.com/tamius-han/ultrawidify/issues/115)
|
||||
|
||||
### v4.4.9
|
||||
|
||||
* Fixed the youtube alignment issue (previously fixed in v4.4.7.1-2), but this time for real (and in a bit more proper way)
|
||||
* Fixed the bug where extension wouldn't work when URL specified a port (e.g. www.example.com:80)
|
||||
* **[4.4.9.1]** removed source files from extension build in order to decrease package size
|
||||
* **[4.4.9.2]** updated dependencies and stuff
|
||||
|
||||
In addition to that, as of 4.4.9.1 the build process ensures removal of `node_modules` before building the extension so we can have reproducible builds except for real this time. Hopefully.
|
||||
|
||||
### v4.4.8
|
||||
|
||||
* Fixed the bug where on pages with more than one video, the list of available videos in the extension popup wouldn't remove videos that are no longer displayed on site. This resulted in extension listing videos that were no longer on the page. Reboot or navigation would also not clear the list if navigating between various pages on the same host.
|
||||
* Fixed the chrome-only bug where on sites with more than one video, the number wouldn't get hidden when the extension popup closed.
|
||||
@ -34,7 +198,7 @@ QoL improvements for me:
|
||||
* Fixed netflix (and possibly disney+ )
|
||||
* It's been almost a month and Chrome Web Store still hasn't finished the review of the 4.4.4.1 (and 4.4.4.2) revisions because when it comes to incompetence, it's hard to expect anything less from Google. I've did some proverbial yelling at the support in hopes that Chrome version will finally see an update (disclaimer: when I said yelling I really mean a polite request, because support staff doesn't deserve abuse because a different department is utter shite at doing their jobs).
|
||||
|
||||
### v4.4.5
|
||||
### v4.4.5
|
||||
|
||||
* Extension no longer requires `allTabs` and `webNavigation` permissions
|
||||
* Some CSS on the debugger popup was not scoped, causing issues with some sites.
|
||||
@ -64,7 +228,7 @@ QoL improvements for me:
|
||||
|
||||
* Changes to player detection that fix issues with vk
|
||||
* Extension tries to avoid setting aspect ratio pointlessly
|
||||
* (Hopefully) fixed mailto: and reddit compose links.
|
||||
* (Hopefully) fixed mailto: and reddit compose links.
|
||||
* When reporting bugs, email/reddit template now automatically gathers browser, extension version and OS.
|
||||
|
||||
### v4.4.0
|
||||
@ -110,23 +274,23 @@ and OS are automatically included in email/reddit template.
|
||||
* Started using mutation observers to watch for anything modifying the size of our video.
|
||||
* **[4.2.3.1]** fixed some bugs in popup.
|
||||
|
||||
### v4.2.2
|
||||
### v4.2.2
|
||||
|
||||
* Fixed player detection on reddit (for videos from v.reddit)
|
||||
|
||||
### v4.2.1
|
||||
* Fixed bug where custom CSS didn't get applied to pages
|
||||
|
||||
### v4.2.0
|
||||
### v4.2.0
|
||||
|
||||
* Slightly improved popup design. (Design change suggested by PortaTrekos)
|
||||
* Player detection: youtube and twitch now have manual player element detection, with strictly defined players.
|
||||
* Player detection: youtube and twitch now have manual player element detection, with strictly defined players.
|
||||
* Improved site settings control in extension popup. It's possible to enable extension for previously disabled embedded sites.
|
||||
* Improved incompatibilities with reddit, where videos would be vertically misaligned when not using RES
|
||||
* Fixed imcompatibilities with Iridium. Flicker when clicking play/pause or switching between big and popup player is caused by either Youtube or Iridium trying to apply their styles over mine.
|
||||
* Issues with inconsistent alignment that some people reported are potentially fixed
|
||||
|
||||
### v4.1.2
|
||||
### v4.1.2
|
||||
|
||||
* Fixed video alignment issues on www.reddit as well (for people who use old reddit without going to old.reddit)
|
||||
* Fixed bug with 'player detection' tab
|
||||
@ -138,17 +302,17 @@ and OS are automatically included in email/reddit template.
|
||||
### v4.1.0
|
||||
|
||||
* Added ability to add custom CSS to page
|
||||
* Fixed video alignment issues on old.reddit. Disabled extension on imgur by default.
|
||||
* Fixed video alignment issues on old.reddit. Disabled extension on imgur by default.
|
||||
* Extension now works on vimeo again
|
||||
* **UX:** Renamed 'about' to 'report a problem' in order to make contact info more discoverable
|
||||
|
||||
|
||||
### v4.0.1
|
||||
|
||||
* Fixed bug where sites using 'default' option in 'Extension mode' settings would be disabled, even if extension was not.
|
||||
* Fixed bug where sites using 'default' option in 'Extension mode' settings would be disabled, even if extension was not.
|
||||
* Fixed bug where extension sometimes wouldn't work on Netflix.
|
||||
|
||||
### v4.0.0
|
||||
### v4.0.0
|
||||
|
||||
* Fixed the bug where saving settings wouldn't work
|
||||
* Massive under-the-hood changes. The extension popup and settings page use VueJS
|
||||
@ -178,7 +342,7 @@ and OS are automatically included in email/reddit template.
|
||||
|
||||
Never happened, got bumped to 4.0.0.
|
||||
|
||||
### v3.2.2
|
||||
### v3.2.2
|
||||
|
||||
* Pan event listener now gets properly unbound
|
||||
* Fixed 'reset zoom' button in popup
|
||||
@ -187,7 +351,7 @@ Never happened, got bumped to 4.0.0.
|
||||
|
||||
* Fixed issue where global video alignment setting didn't get saved properly
|
||||
|
||||
### v3.2.0
|
||||
### v3.2.0
|
||||
|
||||
* Zoom and panning
|
||||
* Reorganized popup
|
||||
@ -227,7 +391,7 @@ User-facing changes:
|
||||
|
||||
Added some anti-lag measures. This seems to be an issue affecting _only_ Chrome (and only then some installs), where canvas.drawImage() won't work properly for some reason.
|
||||
|
||||
### v2.2.4
|
||||
### v2.2.4
|
||||
|
||||
Lots of mostly incredibly minor stuff.
|
||||
|
||||
@ -238,11 +402,11 @@ Lots of mostly incredibly minor stuff.
|
||||
* Fixed some under-the-hood bugs nobody knew they even existed
|
||||
* A lil bit of refactoring
|
||||
|
||||
### v2.2.3
|
||||
### v2.2.3
|
||||
|
||||
* Fixed automatic aspect ratio detection on DRM-protected sites.
|
||||
|
||||
### v2.2.2
|
||||
### v2.2.2
|
||||
|
||||
* Fixes problems with switching from normal to fullscreen player on youtube. If 2.2.1 didn't fix the font issue, this version should have.
|
||||
|
||||
@ -258,9 +422,9 @@ Various improvements to automatic aspect ratio detection:
|
||||
* **Fixed the situation with insane memory usage due to the automatic aspect ratio detection (#25, #32) and lag that appeared in certain cases after the extension has been running for a while.** There's still fun stuff going on — see notes below.
|
||||
* Improved accuracy of automatic detection. This should fix the issue of rapid switching in dark videos or videos with otherwise uneven edges (#12 - [video](https://www.youtube.com/watch?v=NaTGwlfRB_c); #24 - [video](https://www.youtube.com/watch?v=xvZqHgFz51I) (see the car at the beginning))
|
||||
|
||||
Improved accuracy has increased the base RAM usage, and not by a small amount (I seem to have fixed my blunders, so that could _actually_ be on Firefox). As a result, I've reduced both resolution of the sample as well as polling frequency.
|
||||
Improved accuracy has increased the base RAM usage, and not by a small amount (I seem to have fixed my blunders, so that could _actually_ be on Firefox). As a result, I've reduced both resolution of the sample as well as polling frequency.
|
||||
|
||||
Polling of 1 check per second shouldn't use too much RAM. If you want automatic aspect ratio detection to react faster, you can up that number to 30 in the settings. 30 checks per second can be expensive: up to 400 MB if you've just started Firefox and went to youtube. Can go north of 2 gigs if you've been running Firefox for longer than that (seems to be a problem with Javascript garbage collection).
|
||||
Polling of 1 check per second shouldn't use too much RAM. If you want automatic aspect ratio detection to react faster, you can up that number to 30 in the settings. 30 checks per second can be expensive: up to 400 MB if you've just started Firefox and went to youtube. Can go north of 2 gigs if you've been running Firefox for longer than that (seems to be a problem with Javascript garbage collection).
|
||||
|
||||
Videos that aren't playing (e.g. videos that are paused or ended) do (should) ***not*** use any meaningful amount of RAM.
|
||||
|
||||
@ -278,11 +442,11 @@ Videos that aren't playing (e.g. videos that are paused or ended) do (should) **
|
||||
|
||||
Youtube fix seems to have broken Chrome compatibility (again), so any quick fix for this point forward will land in Chrome version along with v2.2.
|
||||
|
||||
### v2.1.2
|
||||
### v2.1.2
|
||||
|
||||
* Fixed some bugs with autodetection sometimes not working properly on Youtube.
|
||||
|
||||
Problem: there's this bit of code that keeps aspect ratio from changing when the difference between 'previous' and 'current' aspect ratio is too small. Unfortunately, the 'previous' value was _not_ updated on every aspect ratio switch for some reason. Also `ArDetect.init()` — for some reason — didn't always clean the 'previous' value even though it should.
|
||||
Problem: there's this bit of code that keeps aspect ratio from changing when the difference between 'previous' and 'current' aspect ratio is too small. Unfortunately, the 'previous' value was _not_ updated on every aspect ratio switch for some reason. Also `ArDetect.init()` — for some reason — didn't always clean the 'previous' value even though it should.
|
||||
|
||||
### v2.1.1
|
||||
|
||||
@ -294,7 +458,7 @@ Problem: there's this bit of code that keeps aspect ratio from changing when the
|
||||
* Popup should work more reliably now
|
||||
* Twitch works ... kinda but not always
|
||||
|
||||
### v2.0.3
|
||||
### v2.0.3
|
||||
|
||||
* Fixed the bug where Netflix videos weren't vertically centered in Firefox 57+ (not present in Chrome or FF 56 or earlier)
|
||||
|
||||
@ -355,15 +519,15 @@ The extension is being rewritten almost ground-up, around automatic aspect ratio
|
||||
|
||||
* Introduced Netflix support.
|
||||
|
||||
As Netflix relies on extension re-initializing at least the UI ***a lot***, the optimization introduced in 1.0.2 was reversed (as waiting 2 seconds for the UI to appear is just too much).
|
||||
As Netflix relies on extension re-initializing at least the UI ***a lot***, the optimization introduced in 1.0.2 was reversed (as waiting 2 seconds for the UI to appear is just too much).
|
||||
|
||||
Furthermore, triggering UI re-initialisation on onUpdated events turned out to not be the proper way to go: immediately after the extension is initialized, onUpdated gets triggered even more often than your average Buzzfeed writer/reader. But change the episode on Netflix and suddenly, onUpdated gets barely triggered at all — which means that more often than not, the UI extension injects into the page wasn't visible. (the fuck, really)
|
||||
|
||||
This is why Netflix uses another function that manually checks whether the player bar is present. Ideally that check happens every tenth of a second, but Firefox may be limiting that to one per second.
|
||||
|
||||
### v1.0.2
|
||||
### v1.0.2
|
||||
|
||||
The 'extension sometimes not working' bug was fixed (by having extension try to setup every time a page got updated), but the fix had some problems. Namely, the extension would re-initiate (complete with re-adding the entire UI) itself very _very_ often.
|
||||
The 'extension sometimes not working' bug was fixed (by having extension try to setup every time a page got updated), but the fix had some problems. Namely, the extension would re-initiate (complete with re-adding the entire UI) itself very _very_ often.
|
||||
|
||||
This could be a problem, so it was fixed. Extension is notified of updates only every ~2 seconds (which absorbs most of the "page was updated" events on page load) and doesn't attempt to reload the UI if the UI was already loaded. (Unless `debugmsg` is set to true. It's generally not, but any commits to this repo could potentially still have it enabled).
|
||||
|
||||
@ -377,7 +541,7 @@ Fixed the bug where sometimes the extension would fail to work. (example: you op
|
||||
|
||||
### v1.0-rc1
|
||||
|
||||
* Settings page is added and mostly working.
|
||||
* Settings page is added and mostly working.
|
||||
|
||||
### v0.9.9.6
|
||||
|
||||
@ -393,7 +557,7 @@ Fixed the bug where sometimes the extension would fail to work. (example: you op
|
||||
|
||||
### v0.9.9.1
|
||||
|
||||
* Keybinds `a` and `w` now work.
|
||||
* Keybinds `a` and `w` now work.
|
||||
* Some changes under the bonnet, mostly regarding the way keypresses are handled.
|
||||
* 'Settings' page is ~15% done.
|
||||
|
||||
|
6
DOCUMENTATION.MD
Normal file
@ -0,0 +1,6 @@
|
||||
# Implementation details
|
||||
|
||||
## Enabling/disabling aspect ratio corrections
|
||||
|
||||
* Aspect ratios are changed by proxy. Extension attaches **a custom CSS class** to `video` and `player` elements.
|
||||
* To prevent extension from affecting the appearance of a webpage, **it's sufficient to remove our custom CSS classes from `video` and `player` elements.**
|
32
Jenkinsfile
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
// required jenkins plugins:
|
||||
// * https://plugins.jenkins.io/git/
|
||||
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
stages {
|
||||
|
||||
// stage('Check for changes') {
|
||||
// sh "env.GIT_COMMIT != env.GIT_PREVIOUS_COMMIT"
|
||||
// }
|
||||
|
||||
stage('Install dependencies') {
|
||||
steps {
|
||||
sh 'npm ci'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build') {
|
||||
steps {
|
||||
sh 'npm run build-all'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Push to release server') {
|
||||
steps {
|
||||
sh "echo 'implement me pls!'"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -4,14 +4,28 @@
|
||||
|
||||
The extension is built on a PC running Manjaro Linux. npm and node are installed from repositories/aur.
|
||||
|
||||
### Software versions:
|
||||
|
||||
## Installing dependencies
|
||||
Node/npm versions:
|
||||
|
||||
Run `npm ci`
|
||||
```
|
||||
node: %%NODE_VERSION%%
|
||||
npm: %%NPM_VERSION%%
|
||||
```
|
||||
|
||||
Linux (`uname -a`):
|
||||
|
||||
```
|
||||
%%LINUX_VERSION%%
|
||||
```
|
||||
|
||||
## Reproducing build
|
||||
|
||||
`npm run build`
|
||||
Run the following commands to install dependencies and compile the firefox build:
|
||||
|
||||
The compiled code pops up in /dist-ff (/dist-chrome for Chromium-based browsers).
|
||||
```
|
||||
npm ci
|
||||
npm run build
|
||||
```
|
||||
|
||||
The compiled code pops up in `/dist-ff`.
|
||||
|
52
README.md
@ -1,8 +1,8 @@
|
||||
# Ultrawidify — aspect ratio fixer for youtube and netflix
|
||||
# Ultrawidify — aspect ratio fixer for youtube and netflix
|
||||
|
||||
## Super TL;DR: I'm just looking for the install links, thanks
|
||||
|
||||
[Firefox](https://addons.mozilla.org/en/firefox/addon/ultrawidify/), [Chrome](https://chrome.google.com/webstore/detail/ultrawidify/dndehlekllfkaijdlokmmicgnlanfjbi), [Edge](https://github.com/tamius-han/ultrawidify#microsoft-edge) (Chromium-based only)
|
||||
[Firefox](https://addons.mozilla.org/en/firefox/addon/ultrawidify/), [Chrome](https://chrome.google.com/webstore/detail/ultrawidify/dndehlekllfkaijdlokmmicgnlanfjbi), [Edge](https://microsoftedge.microsoft.com/addons/detail/ultrawidify/lmpgpgechmkkkehkihpiddbcbgibokbi).
|
||||
|
||||
There's also [nightly "builds"](https://stuff.lionsarch.tamius.net/ultrawidify/nightly/).
|
||||
|
||||
@ -13,10 +13,9 @@ If you own an ultrawide monitor, you have probably noticed that sometimes videos
|
||||
![Demo](img-demo/example-httyd2.png "Should these black bars be here? No [...] But an ultrawide user never forgets.")
|
||||
|
||||
|
||||
|
||||
## Known issues
|
||||
|
||||
* Netflix autodetection not working in Chrome, wontfix as issue is fundamentally unfixable.
|
||||
* Netflix autodetection not working in Chrome and working poorly in Firefox. This problem happens because DRM, and happens on other sites utilizing DRM protection schemes. Don't expect Chrome support any time soon.
|
||||
* Everything reported in [issues](https://github.com/tamius-han/ultrawidify/issues)
|
||||
|
||||
### Limitations
|
||||
@ -25,15 +24,14 @@ If you own an ultrawide monitor, you have probably noticed that sometimes videos
|
||||
* Autodetection is only correct 95% of the time, most of the time.
|
||||
* That new stretching mode wasn't thoroughly tested yet. Issues may be present. (Same with zoom)
|
||||
* Enabling extension everywhere (as opposed to whitelisted sites) could break some websites.
|
||||
* Edge has
|
||||
|
||||
### Features
|
||||
|
||||
* **Can be enabled or disabled on per-site basis**
|
||||
* **Crop video to fit screen** (no stretching. Supported aspect ratios: 21/9 (1:2.39), 16:9, 16:10, _one (1) custom aspect ratio_)
|
||||
* **Automatic aspect ratio detection** (can be enabled/disabled entirely or on a per-site basis, separately of the extension. Autodetection in action: [youtube](https://www.youtube.com/watch?v=j2xn1WpbtCQ))
|
||||
* **Crop video to fit screen** (no stretching. Supported aspect ratios: 21/9 (1:2.39), 16:9, 16:10. It's possible to set additional aspect ratios, but settings GUI currently contains some mildly annoying bugs)
|
||||
* **Automatic aspect ratio detection** (can be enabled/disabled entirely or on a per-site basis, separately of the extension. May not work on sites utilizing DRM schemes, such as Netflix et. al.). Autodetection in action: [youtube](https://www.youtube.com/watch?v=j2xn1WpbtCQ))
|
||||
* **Supports Youtube theater mode**
|
||||
* **[EXPERIMENTAL!]** Stretch video to fit the screen (4 different approaches)
|
||||
* **[EXPERIMENTAL!]** Stretch video to fit the screen
|
||||
* **[EXPERIMENTAL!]** custom zooming and panning
|
||||
|
||||
|
||||
@ -41,19 +39,23 @@ If you own an ultrawide monitor, you have probably noticed that sometimes videos
|
||||
|
||||
* Youtube
|
||||
* Netflix
|
||||
* Twitch
|
||||
|
||||
### Other sites
|
||||
|
||||
I am not actively testing extension on other sites. You can try your luck and enable extension for any unsupported site you stumble across via extension popup, but I make no guarantees it will work everywhere.
|
||||
|
||||
If extension doesn't work for a site I'm not testing on out of the box, follow [this wiki](https://github.com/tamius-han/ultrawidify/wiki/Fixing-site-incompatibilites-('Advanced-settings')). The 'quick and dirty' approach should work for most sites. (If you try doing things the proper way, you should really know what you're doing.)
|
||||
|
||||
### Installing this extension
|
||||
|
||||
You can download this extension from Firefox' and Chrome's extension stores:
|
||||
You can download this extension from the relevant extension stores:
|
||||
|
||||
* [Firefox](https://addons.mozilla.org/en/firefox/addon/ultrawidify/)
|
||||
* [Chrome, Opera, Chromium Edge](https://chrome.google.com/webstore/detail/ultrawidify/dndehlekllfkaijdlokmmicgnlanfjbi)
|
||||
* [Chrome](https://chrome.google.com/webstore/detail/ultrawidify/dndehlekllfkaijdlokmmicgnlanfjbi)
|
||||
* [Edge](https://microsoftedge.microsoft.com/addons/detail/ultrawidify/lmpgpgechmkkkehkihpiddbcbgibokbi)
|
||||
|
||||
Opera users and users of the new, Chromium-based Edge can install Ultrawidify from Chrome Web Store as well.
|
||||
Other browsers are not officially supported. If you're using a different Chromium-based browser, you can try installing the addon from the Chrome Web Store — but if things don't work, you're on your own.
|
||||
|
||||
### Nightly builds
|
||||
|
||||
@ -80,7 +82,7 @@ You can make a donation [via Paypal](https://www.paypal.me/tamius).
|
||||
|
||||
# The long version
|
||||
|
||||
The technology has been here for a while, but plenty of people don't know how to properly encode a video (despite the fact [youtube has an article that explains aspect ratios](https://support.google.com/youtube/answer/6375112)). Plenty of people surprisingly includes major Holywood studios, such as [Marvel](https://www.youtube.com/watch?v=Ke1Y3P9D0Bc), [Disney](https://www.youtube.com/watch?v=yCOPJi0Urq4), [Dreamworks](https://www.youtube.com/watch?v=oKiYuIsPxYk), [Warner Brothers](https://www.youtube.com/watch?v=VYZ3U1inHA4), [Sony](https://www.youtube.com/watch?v=7BWWWQzTpNU), et cetera. You'd think that this is the one thing Holywood studios and people who make [music videos for a living](https://www.youtube.com/watch?v=c6Mx2mxpaCY) would know how to do right, but they don't. This extension is here to fix that.
|
||||
The technology has been here for a while, but plenty of people don't know how to properly encode a video (despite the fact [youtube has an article that explains aspect ratios](https://support.google.com/youtube/answer/6375112)). Plenty of people surprisingly includes major Hollywood studios, such as [Marvel](https://www.youtube.com/watch?v=Ke1Y3P9D0Bc), [Disney](https://www.youtube.com/watch?v=yCOPJi0Urq4), [Dreamworks](https://www.youtube.com/watch?v=oKiYuIsPxYk), [Warner Brothers](https://www.youtube.com/watch?v=VYZ3U1inHA4), [Sony](https://www.youtube.com/watch?v=7BWWWQzTpNU), et cetera. You'd think that this is the one thing Hollywood studios and people who make [music videos for a living](https://www.youtube.com/watch?v=c6Mx2mxpaCY) would know how to do right, but they don't. This extension is here to fix that.
|
||||
|
||||
![Jesus Christ.](img-demo/example-jasonbourne.png "This is indeed worse than Snowden.")
|
||||
|
||||
@ -233,7 +235,6 @@ However, I do plan on implementing this feature. Hopefully by the end of the yea
|
||||
|
||||
|
||||
|
||||
|
||||
## Plans for the future
|
||||
|
||||
1. Handle porting of extension settings between versions.
|
||||
@ -252,6 +253,9 @@ However, I do plan on implementing this feature. Hopefully by the end of the yea
|
||||
|
||||
[Latest stable for Chrome — download from Chrome store](https://chrome.google.com/webstore/detail/ultrawidify/dndehlekllfkaijdlokmmicgnlanfjbi)
|
||||
|
||||
Edge version is currently not available, as Edge has some bugs that prevent this extension from working correctly. [Read more](https://github.com/tamius-han/ultrawidify/issues/117#issuecomment-747109695)
|
||||
<!-- [Latest stable for Edge — Download from Microsoft store](https://microsoftedge.microsoft.com/addons/detail/lmpgpgechmkkkehkihpiddbcbgibokbi) -->
|
||||
|
||||
### Installing the current, github version
|
||||
|
||||
## Get pre-built version:
|
||||
@ -264,7 +268,7 @@ Requirements: npm, node.
|
||||
|
||||
1. Clone this repo
|
||||
2. run `npm install`
|
||||
3. If using **Firefox,** run: `npm run watch:dev`. If using **Chrome,** run: `npm run watch-chrome:dev`. If using Edge, run: `npm run watch-edge:dev`.
|
||||
3. If using **Firefox,** run: `npm run watch:dev`. If using **Chrome,** run: `npm run watch-chrome:dev`.
|
||||
|
||||
TODO: see if #3 already loads the extension in FF
|
||||
|
||||
@ -273,26 +277,6 @@ TODO: see if #3 already loads the extension in FF
|
||||
4. Add temporary addon
|
||||
5. Select `${ultrawidify_folder}/dist/manifest.json`
|
||||
|
||||
|
||||
# Microsoft Edge
|
||||
|
||||
With the advent of the new Chromium-based Edge, this extension should work just fine. I don't actively test in Edge, though, so your mileage may vary.
|
||||
|
||||
## Chromium-based
|
||||
|
||||
1. Visit [edge://extensions](edge://extensions/)
|
||||
2. Go to [Chrome Web Store](https://chrome.google.com/webstore/detail/ultrawidify/dndehlekllfkaijdlokmmicgnlanfjbi)
|
||||
3. Click 'Allow extensions from other stores' on the blue popup bar at the top of the screen
|
||||
4. Install Ultrawidify
|
||||
5. Enjoy
|
||||
|
||||
I might reconsider publishing extension for Chromium-based Microsoft Edge once it's released. Releasing in MS Store appears to be impossible at current time as extension submissions don't appear to be open at all (unless you got a special invite or something).
|
||||
|
||||
## Old Edge
|
||||
|
||||
1. Get [Chromium-based Edge](https://www.microsoftedgeinsider.com/en-us/)
|
||||
2. See steps above
|
||||
|
||||
# Changelog
|
||||
|
||||
see changelog.md
|
||||
|
14896
package-lock.json
generated
80
package.json
@ -1,54 +1,78 @@
|
||||
{
|
||||
"name": "ultrawidify",
|
||||
"version": "4.4.8",
|
||||
"version": "6.0.2",
|
||||
"description": "Aspect ratio fixer for youtube and other sites, with automatic aspect ratio detection. Supports ultrawide and other ratios.",
|
||||
"author": "Tamius Han <tamius.han@gmail.com>",
|
||||
"scripts": {
|
||||
"start": "npm run dev",
|
||||
"build": "cross-env NODE_ENV=production BROWSER=firefox CHANNEL=stable webpack --hide-modules",
|
||||
"build": "npm run pre-build; cross-env NODE_ENV=production BROWSER=firefox CHANNEL=stable webpack --hide-modules",
|
||||
"build-all": "bash ./scripts/build-all.sh",
|
||||
"build-chrome": "cross-env NODE_ENV=production BROWSER=chrome CHANNEL=stable webpack --hide-modules",
|
||||
"build-edge": "cross-env NODE_ENV=production BROWSER=edge CHANNEL=stable webpack --hide-modules",
|
||||
"build:dev": "webpack --hide-modules",
|
||||
"build-testing": "cross-env NODE_ENV=development BROWSER=firefox CHANNEL=testing webpack --hide-modules",
|
||||
"build-nightly": "cross-env NODE_ENV=development BROWSER=firefox CHANNEL=nightly webpack --hide-modules",
|
||||
"build-testing-chrome": "cross-env NODE_ENV=development BROWSER=chrome CHANNEL=testing webpack --hide-modules",
|
||||
"build-nightly-chrome": "cross-env NODE_ENV=development BROWSER=chrome CHANNEL=nightly webpack --hide-modules",
|
||||
"build-chrome:dev": "cross-env NODE_ENV=development BROWSER=chrome webpack --hide-modules",
|
||||
"build-all": "mkdir -p ./build/old; rm -rf ./dist-ff; rm -rf ./dist-chrome; rm ./dist-zip/uw-amo-source.zip; mv -f ./dist-zip/*.zip ./build/old; npm run build; node scripts/build-zip.js ff; npm run build-chrome; node scripts/build-zip.js chrome; ./scripts/prepare-amo-source.sh",
|
||||
"build-edge": "cross-env NODE_ENV=production BROWSER=edge CHANNEL=stable webpack --hide-modules",
|
||||
"build-nightly": "cross-env NODE_ENV=development BROWSER=firefox CHANNEL=nightly webpack --hide-modules",
|
||||
"build-nightly-chrome": "cross-env NODE_ENV=development BROWSER=chrome CHANNEL=nightly webpack --hide-modules",
|
||||
"build-testing": "cross-env NODE_ENV=development BROWSER=firefox CHANNEL=testing webpack --hide-modules",
|
||||
"build-testing-chrome": "cross-env NODE_ENV=development BROWSER=chrome CHANNEL=testing webpack --hide-modules",
|
||||
"build-zip": "node scripts/build-zip.js",
|
||||
"dev": "cross-env NODE_ENV=development CHANNEL=dev concurrently \"cross-env BROWSER=firefox npm run build:dev -- --watch\" \"cross-env BROWSER=chrome npm run build:dev -- --watch\""
|
||||
"build:dev": "webpack --hide-modules",
|
||||
"dev": "cross-env NODE_ENV=development CHANNEL=dev concurrently \"cross-env BROWSER=firefox npm run build:dev -- --watch\" \"cross-env BROWSER=chrome npm run build:dev -- --watch\" \"cross-env BROWSER=edge npm run build:dev -- --watch\"",
|
||||
"dev:windows": "cross-env NODE_ENV=development CHANNEL=dev concurrently \"cross-env BROWSER=firefox npm run build:dev -- -w --watch-poll\" \"cross-env BROWSER=chrome npm run build:dev -- -w --watch-poll\" \"cross-env BROWSER=edge npm run build:dev -- -w --watch-poll\"",
|
||||
"dev-ff": "rm -rf ./dist-ff && cross-env NODE_ENV=development CHANNEL=dev BROWSER=firefox npm run build:dev -- --watch",
|
||||
"dev-chrome": "rm -rf ./dist-chrome && cross-env NODE_ENV=development CHANNEL=dev BROWSER=chrome npm run build:dev -- --watch",
|
||||
"dev-edge": "rm -rf ./dist-edge && cross-env NODE_ENV=development CHANNEL=dev BROWSER=edge npm run build:dev -- --watch",
|
||||
"pre-build": "rm -rf ./dist-ff; rm -rf ./dist-chrome; rm -rf ./dist-edge; rm -rf ./node_modules; npm ci",
|
||||
"start": "npm run dev",
|
||||
"start:windows": "npm run dev:windows"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/core-js": "^2.5.0",
|
||||
"@types/es6-promise": "^3.3.0",
|
||||
"concurrently": "^5.1.0",
|
||||
"@babel/plugin-proposal-class-properties": "^7.16.0",
|
||||
"@mdi/font": "^6.5.95",
|
||||
"@mdi/js": "^6.4.95",
|
||||
"@types/resize-observer-browser": "^0.1.6",
|
||||
"concurrently": "^5.3.0",
|
||||
"fs-extra": "^7.0.1",
|
||||
"gl-matrix": "^3.4.3",
|
||||
"json-cyclic": "0.0.3",
|
||||
"vue": "^2.6.11",
|
||||
"vuex": "^3.1.2",
|
||||
"vuex-webextensions": "^1.3.0",
|
||||
"webextension-polyfill": "^0.6.0"
|
||||
"lodash": "^4.17.21",
|
||||
"mdi-vue": "^3.0.11",
|
||||
"typescript": "^4.4.4",
|
||||
"vue": "^3.2.21",
|
||||
"vue-style-loader": "^4.1.3",
|
||||
"vuex": "^4.0.2",
|
||||
"vuex-webextensions": "^1.3.3",
|
||||
"webextension-polyfill": "^0.12.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.8.3",
|
||||
"@babel/plugin-proposal-optional-chaining": "^7.8.3",
|
||||
"@babel/preset-env": "^7.8.3",
|
||||
"@babel/core": "^7.16.0",
|
||||
"@babel/preset-env": "^7.16.0",
|
||||
"@types/chrome": "0.0.240",
|
||||
"@types/core-js": "^2.5.5",
|
||||
"@types/es6-promise": "^3.3.0",
|
||||
"@types/firefox": "0.0.31",
|
||||
"@types/lodash": "^4.14.176",
|
||||
"@types/node": "^14.17.32",
|
||||
"@vue/cli": "^4.5.15",
|
||||
"@vue/cli-plugin-typescript": "^4.5.15",
|
||||
"@vue/compiler-sfc": "^3.2.21",
|
||||
"archiver": "^3.0.0",
|
||||
"babel-loader": "^8.0.6",
|
||||
"babel-loader": "^8.2.3",
|
||||
"babel-preset-es2020": "^1.0.2",
|
||||
"copy-webpack-plugin": "^4.5.3",
|
||||
"cross-env": "^5.2.0",
|
||||
"css-loader": "^0.28.11",
|
||||
"ejs": "^2.7.4",
|
||||
"file-loader": "^1.1.11",
|
||||
"mini-css-extract-plugin": "^0.4.4",
|
||||
"node-sass": "^4.13.1",
|
||||
"node-sass": "^4.14.1",
|
||||
"resolve-url-loader": "^5.0.0",
|
||||
"sass-loader": "^7.1.0",
|
||||
"vue-loader": "^15.8.3",
|
||||
"vue-template-compiler": "^2.6.11",
|
||||
"web-ext-types": "^2.1.0",
|
||||
"webpack": "^4.41.5",
|
||||
"ts-loader": "^8.3.0",
|
||||
"vue-cli-plugin-vue-next": "~0.1.4",
|
||||
"vue-loader": "^16.8.2",
|
||||
"web-ext-types": "^2.3.0",
|
||||
"webpack": "^4.46.0",
|
||||
"webpack-chrome-extension-reloader": "^0.8.3",
|
||||
"webpack-cli": "^3.3.10",
|
||||
"webpack-cli": "^3.3.12",
|
||||
"webpack-shell-plugin": "^0.5.0"
|
||||
}
|
||||
}
|
||||
|
42
scripts/build-all.sh
Normal file
@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
|
||||
# NOTE: this script needs to be run with the npm run build-all
|
||||
# command from the root directory of the project. Running it in
|
||||
# any other way probably isn't going to work.
|
||||
|
||||
# pre-build steps:
|
||||
mkdir -p ./build/old
|
||||
npm run pre-build
|
||||
rm ./dist-zip/uw-amo-source.zip
|
||||
mv -f ./dist-zip/*.zip ./build/old
|
||||
|
||||
# lets force raise ram limit, but the improper way
|
||||
# export NODE_OPTIONS=--max_old_space_size=4096
|
||||
|
||||
# build the version for each browser and create a zip afterwards
|
||||
# step 1: define build functions
|
||||
#function buildFF {
|
||||
npm run build
|
||||
node scripts/build-zip.js ff
|
||||
#}
|
||||
#function buildChrome {
|
||||
npm run build-chrome
|
||||
node scripts/build-zip.js chrome
|
||||
#}
|
||||
#function buildEdge {
|
||||
npm run build-edge
|
||||
node scripts/build-zip.js edge
|
||||
#}
|
||||
|
||||
# step 2: execute them all at once
|
||||
# buildFF &
|
||||
# buildChrome &
|
||||
# buildEdge &
|
||||
|
||||
# wait < <(jobs -p)
|
||||
|
||||
# prepare AMO source
|
||||
# source code needs to be prepared AFTER
|
||||
# the code has been built, to ensure that
|
||||
# package-lock.json remains unchanged
|
||||
./scripts/prepare-amo-source.sh
|
@ -37,6 +37,9 @@ if [ ! -z "$GIT_COMMIT" ] ; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# let's raise RAM limit for npm command globally
|
||||
NODE_OPTIONS=--max_old_space_size=4096
|
||||
|
||||
npm ci
|
||||
|
||||
rm -rf ./dist-zip || true # no big deal if ./dist-zip doesn't exist
|
||||
@ -46,7 +49,7 @@ mkdir dist-zip # create it back
|
||||
# build firefox
|
||||
#
|
||||
npm run "${BUILD_SCRIPT}"
|
||||
node scripts/build-zip.js ff nightly
|
||||
node --max-old-space-size=2048 scripts/build-zip.js ff nightly
|
||||
# if [ ! -z "${AMO_API_KEY}" ] ; then
|
||||
# if [ ! -z "${AMO_API_SECRET}" ] ; then
|
||||
# web-ext sign --source-dir ./dist --api-key "${AMO_API_KEY}" --api-secret "${AMO_API_SECRET}"
|
||||
@ -57,12 +60,18 @@ node scripts/build-zip.js ff nightly
|
||||
# build chrome
|
||||
#
|
||||
npm run "${BUILD_SCRIPT}-chrome"
|
||||
node scripts/build-zip.js chrome nightly
|
||||
|
||||
node --max-old-space-size=2048 scripts/build-zip.js chrome nightly
|
||||
#
|
||||
#./scripts/build-crx.sh
|
||||
#
|
||||
|
||||
#
|
||||
# build edge
|
||||
#
|
||||
npm run "${BUILD_SCRIPT}-edge"
|
||||
node --max-old-space-size=2048 scripts/build-zip.js chrome nightly
|
||||
|
||||
|
||||
######################################
|
||||
# UPLOAD TO WEB SERVER
|
||||
######################################
|
||||
@ -76,7 +85,6 @@ echo "Uploading to server ..."
|
||||
scp -i ~/.ssh/id_rsa -r ./dist-zip/* "ultrawidify-uploader@${RELEASE_SERVER}:${RELEASE_DIRECTORY}${BUILD_CHANNEL_DIRECTORY}"
|
||||
|
||||
|
||||
|
||||
######################################
|
||||
# Build finished message
|
||||
######################################
|
||||
|
@ -5,7 +5,7 @@
|
||||
#
|
||||
# Script assumes we're in basedir of the repository and that extension has been built and zipped to /dist-zip
|
||||
# using the crx name we want (same name as zip, except different extension)
|
||||
#
|
||||
#
|
||||
# also this doesn't check for errors ever so
|
||||
#
|
||||
|
||||
@ -42,4 +42,4 @@ sig_len_hex=$(byte_swap $(printf '%08x\n' $(ls -l "$sig" | awk '{print $5}')))
|
||||
echo "Wrote $crx"
|
||||
|
||||
echo "exiting dist-zip"
|
||||
cd ..
|
||||
cd ..
|
||||
|
@ -24,7 +24,7 @@ const buildZip = (src, dist, zipFilename) => {
|
||||
|
||||
const archive = archiver('zip', { zlib: { level: 9 }});
|
||||
const stream = fs.createWriteStream(path.join(dist, zipFilename));
|
||||
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
archive
|
||||
.directory(src, false)
|
||||
@ -46,14 +46,14 @@ const main = () => {
|
||||
browserPostfix = browser;
|
||||
}
|
||||
const destDir = path.join(__dirname, `../dist-${browserPostfix}`);
|
||||
const zipDir = path.join(__dirname, '../dist-zip');
|
||||
const zipDir = path.join(__dirname, '../dist-zip');
|
||||
const {name, version} = extractExtensionData(browserPostfix);
|
||||
|
||||
// collapse spaces and dashes into single dash
|
||||
const baseFilename = `${name.replace(/[ -]+/g, '-')}-${version}`;
|
||||
|
||||
let realZipDir;
|
||||
|
||||
|
||||
if (!!testingOrNightly) {
|
||||
realZipDir = path.join(zipDir, version);
|
||||
} else {
|
||||
@ -61,7 +61,7 @@ const main = () => {
|
||||
}
|
||||
|
||||
const zipFilename = `${baseFilename}-${browser}.zip`;
|
||||
|
||||
|
||||
try {
|
||||
makeDirIfNotExists(realZipDir, {recursive: true});
|
||||
} catch (e) {
|
||||
@ -70,7 +70,7 @@ const main = () => {
|
||||
}
|
||||
buildZip(destDir, realZipDir, zipFilename)
|
||||
.then(() => console.info('OK'))
|
||||
.catch(console.err);
|
||||
.catch(console.err);
|
||||
};
|
||||
|
||||
main();
|
||||
|
@ -2,4 +2,46 @@
|
||||
|
||||
# makes a zip file with human-readable source code that we need to upload to AMO
|
||||
# since webpack minifies stuff
|
||||
zip -r dist-zip/uw-amo-source.zip README-AMO.md .babelrc package.json package-lock.json webpack.config.js src/
|
||||
|
||||
# first, we collect npm/node versions:
|
||||
# (NOTE: the last bit is necessary to remove ANSI color codes from output)
|
||||
NODE_VERSION=`node --version`
|
||||
NPM_VERSION=`npm --version`
|
||||
LINUX_VERSION="$(uname -a | sed 's/\//\\\//g')"
|
||||
|
||||
# copy REAMDE to /tmp for processing
|
||||
cp README-AMO.md /tmp/README-AMO.md
|
||||
|
||||
# replace placeholders with proper software versions
|
||||
sed -i "s/%%NODE_VERSION%%/${NODE_VERSION}/g" /tmp/README-AMO.md
|
||||
sed -i "s/%%NPM_VERSION%%/${NPM_VERSION}/g" /tmp/README-AMO.md
|
||||
sed -i "s/%%LINUX_VERSION%%/${LINUX_VERSION}/g" /tmp/README-AMO.md
|
||||
|
||||
# add files to archive
|
||||
zip -r dist-zip/uw-amo-source.zip /tmp/README-AMO.md .babelrc package.json package-lock.json webpack.config.js scripts/ src/
|
||||
|
||||
# rename /tmp/README-AMO.md to README.md
|
||||
printf "@ tmp/README-AMO.md\n@=README.md\n" | zipnote -w dist-zip/uw-amo-source.zip
|
||||
|
||||
# printout for debugging purposes:
|
||||
echo ""
|
||||
echo "—————— AMO SOURCE PREPARATION FINISHED ——————"
|
||||
echo " Debug info:"
|
||||
echo ""
|
||||
echo "node --version:"
|
||||
node --version
|
||||
echo ""
|
||||
echo "npm --version"
|
||||
npm --version
|
||||
echo ""
|
||||
echo "uname -a"
|
||||
uname -a
|
||||
echo ""
|
||||
echo ""
|
||||
echo "extracted variables:"
|
||||
echo "NODE_VERSION: ${NODE_VERSION}"
|
||||
echo "NPM_VERSION: ${NPM_VERSION}"
|
||||
echo "UNAME: ${LINUX_VERSION}"
|
||||
echo ""
|
||||
echo ""
|
||||
echo "—————— EXTENSION PACKAGES READY FOR UPLOAD ——————"
|
||||
|
@ -5,8 +5,7 @@ const fs = require('fs');
|
||||
|
||||
const BUNDLE_DIR = path.join(__dirname, `../dist-${process.env.BROWSER === 'firefox' ? 'ff' : process.env.BROWSER}`);
|
||||
const bundles = [
|
||||
'popup/popup.js',
|
||||
'options/options.js',
|
||||
'csui/csui-popup.js',
|
||||
];
|
||||
|
||||
const evalRegexForProduction = /;([a-z])=function\(\){return this}\(\);try{\1=\1\|\|Function\("return this"\)\(\)\|\|\(0,eval\)\("this"\)}catch\(t\){"object"==typeof window&&\(\1=window\)}/g;
|
||||
|
57
scripts/reproducability-test.sh
Executable file
@ -0,0 +1,57 @@
|
||||
#!/bin/bash
|
||||
|
||||
### VARIABLES
|
||||
|
||||
REPRODUCABILITY=5 # how many times we need to build with same hash
|
||||
|
||||
### TEST STARTS HERE ###
|
||||
|
||||
CURRENT_DIR=$(pwd)
|
||||
|
||||
if [[ $(echo $0 | awk -F"/" '{print NF-1}') -eq 1 ]] ; then
|
||||
# we need to go one directory up
|
||||
cd ..
|
||||
fi
|
||||
|
||||
# cleanup after self if we already ran and previous test crashed or
|
||||
# something before it cleaned up after itself.
|
||||
rm -rf /tmp/uw-test-runs/* 2>/dev/null # we not interested if fails
|
||||
|
||||
# make new folder if it doesn't exist
|
||||
mkdir -p /tmp/uw-test-runs
|
||||
|
||||
for ((run=0;run<$REPRODUCABILITY;run++)) ; do
|
||||
echo ""
|
||||
echo "---- run ${run} ----"
|
||||
|
||||
# save hash and then run build. Save hash.
|
||||
OLD_HASH=$HASH
|
||||
HASH=$(npm run build 2>/dev/null | grep "Hash:")
|
||||
|
||||
# move build file to /tmp, where it'll be saved for later
|
||||
mv dist-ff /tmp/uw-test-runs/${run}
|
||||
|
||||
# skip comparisons with previous tests on first run,
|
||||
# cos we don't have anything to compare against yet
|
||||
if [[ $run -ne 0 ]] ; then
|
||||
if [[ "$OLD_HASH" == "$HASH" ]] ; then
|
||||
echo "Hashes ok${HASH##*:}"
|
||||
else
|
||||
echo "Webpack hashes do not match! (${OLD_HASH##*:} <---> ${HASH##*:})"
|
||||
fi
|
||||
|
||||
echo "Diff test (no output=ok):"
|
||||
diff -qr /tmp/uw-test-runs/${prev_run} /tmp/uw-test-runs/${run}
|
||||
else
|
||||
echo "Webpack hash: $HASH"
|
||||
fi
|
||||
|
||||
# save id of previous run
|
||||
prev_run=$run
|
||||
done
|
||||
|
||||
# clean up after self
|
||||
rm -rf /tmp/uw-test-runs
|
||||
|
||||
# restore dir
|
||||
cd "$CURRENT_DIR"
|
@ -1,17 +0,0 @@
|
||||
<template>
|
||||
<div class="button center-text flex"
|
||||
:class="{'setting-selected': selected, 'w24': fixedWidth, 'flex-auto': !fixedWidth }"
|
||||
>
|
||||
{{label}}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
fixedWidth: Boolean,
|
||||
selected: Boolean,
|
||||
label: String,
|
||||
}
|
||||
}
|
||||
</script>
|
14
src/common/data/notifications.js
Normal file
@ -0,0 +1,14 @@
|
||||
let Notifications = Object.freeze({
|
||||
'TEST_NOTIFICATION': {
|
||||
icon: 'card-text',
|
||||
text: 'This is a test notification.',
|
||||
timeout: -1,
|
||||
},
|
||||
'AARD_DRM': {
|
||||
icon: 'exclamation-triangle',
|
||||
text: '<b>Autodetection may not be able to run on this video.</b> On sites that utilize DRM you will have to set aspect ratio manually.',
|
||||
timeout: 5000,
|
||||
}
|
||||
});
|
||||
|
||||
export default Notifications;
|
7
src/common/enums/AntiGradientMode.enum.ts
Normal file
@ -0,0 +1,7 @@
|
||||
enum AntiGradientMode {
|
||||
Disabled = 0,
|
||||
Lax = 1,
|
||||
Strict = 2
|
||||
}
|
||||
|
||||
export default AntiGradientMode;
|
13
src/common/enums/AspectRatioType.enum.ts
Normal file
@ -0,0 +1,13 @@
|
||||
enum AspectRatioType {
|
||||
Cycle = -2,
|
||||
Initial = -1, // page default
|
||||
Reset = 0, // reset to initial
|
||||
Automatic = 1, // we want to request automatic aspect ratio detection
|
||||
FitWidth = 2, // legacy/dynamic = fit to width
|
||||
FitHeight = 3, // legacy/dynamic = fit to height
|
||||
Fixed = 4, // pre-determined aspect ratio
|
||||
Manual = 5, // ratio achieved by zooming in/zooming out
|
||||
AutomaticUpdate = 6, // set by Aard
|
||||
}
|
||||
|
||||
export default AspectRatioType;
|
9
src/common/enums/CropModePersistence.enum.ts
Normal file
@ -0,0 +1,9 @@
|
||||
enum CropModePersistence {
|
||||
Default = -1,
|
||||
Disabled = 0,
|
||||
UntilPageReload = 1,
|
||||
CurrentSession = 2,
|
||||
Forever = 3,
|
||||
}
|
||||
|
||||
export default CropModePersistence;
|
10
src/common/enums/ExtensionMode.enum.ts
Normal file
@ -0,0 +1,10 @@
|
||||
enum ExtensionMode {
|
||||
AutoDisabled = -2,
|
||||
Disabled = -1,
|
||||
Default = 0,
|
||||
Whitelist = 1,
|
||||
Basic = 2,
|
||||
Enabled = 3,
|
||||
};
|
||||
|
||||
export default ExtensionMode;
|
11
src/common/enums/StretchType.enum.ts
Normal file
@ -0,0 +1,11 @@
|
||||
enum StretchType {
|
||||
NoStretch = 0,
|
||||
Basic = 1,
|
||||
Hybrid = 2,
|
||||
Conditional = 3,
|
||||
Fixed = 4,
|
||||
FixedSource = 5,
|
||||
Default = -1
|
||||
};
|
||||
|
||||
export default StretchType;
|
10
src/common/enums/VideoAlignmentType.enum.ts
Normal file
@ -0,0 +1,10 @@
|
||||
enum VideoAlignmentType {
|
||||
Left = 0,
|
||||
Center = 1,
|
||||
Right = 2,
|
||||
Top = 3,
|
||||
Bottom = 4,
|
||||
Default = -1
|
||||
};
|
||||
|
||||
export default VideoAlignmentType;
|
@ -1,7 +0,0 @@
|
||||
var AntiGradientMode = Object.freeze({
|
||||
Disabled: 0,
|
||||
Lax: 1,
|
||||
Strict: 2
|
||||
});
|
||||
|
||||
export default AntiGradientMode;
|
@ -1,10 +0,0 @@
|
||||
var AspectRatio = Object.freeze({
|
||||
Initial: -1,
|
||||
Reset: 0,
|
||||
Automatic: 1,
|
||||
FitWidth: 2,
|
||||
FitHeight: 3,
|
||||
Fixed: 4,
|
||||
});
|
||||
|
||||
export default AspectRatio;
|
@ -1,9 +0,0 @@
|
||||
var CropModePersistence = Object.freeze({
|
||||
Default: -1,
|
||||
Disabled: 0,
|
||||
UntilPageReload: 1,
|
||||
CurrentSession: 2,
|
||||
Forever: 3,
|
||||
});
|
||||
|
||||
export default CropModePersistence;
|
@ -1,15 +0,0 @@
|
||||
if (process.env.CHANNEL !== 'stable') {
|
||||
console.log('Loaded ExtensionMode');
|
||||
}
|
||||
|
||||
|
||||
var ExtensionMode = Object.freeze({
|
||||
AutoDisabled: -2,
|
||||
Disabled: -1,
|
||||
Default: 0,
|
||||
Whitelist: 1,
|
||||
Basic: 2,
|
||||
Enabled: 3,
|
||||
});
|
||||
|
||||
export default ExtensionMode;
|
@ -1,11 +0,0 @@
|
||||
var Stretch = Object.freeze({
|
||||
NoStretch: 0,
|
||||
Basic: 1,
|
||||
Hybrid: 2,
|
||||
Conditional: 3,
|
||||
Fixed: 4,
|
||||
FixedSource: 5,
|
||||
Default: -1
|
||||
});
|
||||
|
||||
export default Stretch;
|
@ -1,8 +0,0 @@
|
||||
var VideoAlignment = Object.freeze({
|
||||
Left: 0,
|
||||
Center: 1,
|
||||
Right: 2,
|
||||
Default: -1
|
||||
});
|
||||
|
||||
export default VideoAlignment;
|
6
src/common/interfaces/ArInterface.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import AspectRatioType from '../enums/AspectRatioType.enum';
|
||||
|
||||
export interface Ar {
|
||||
type: AspectRatioType,
|
||||
ratio?: number
|
||||
}
|
418
src/common/interfaces/SettingsInterface.ts
Normal file
@ -0,0 +1,418 @@
|
||||
import { Action } from '../../../node_modules/vuex/types/index'
|
||||
import AntiGradientMode from '../enums/AntiGradientMode.enum'
|
||||
import AspectRatioType from '../enums/AspectRatioType.enum'
|
||||
import CropModePersistence from '../enums/CropModePersistence.enum'
|
||||
import ExtensionMode from '../enums/ExtensionMode.enum'
|
||||
import StretchType from '../enums/StretchType.enum'
|
||||
import VideoAlignmentType from '../enums/VideoAlignmentType.enum'
|
||||
|
||||
export interface KeyboardShortcutInterface {
|
||||
key?: string,
|
||||
code?: string,
|
||||
ctrlKey?: boolean,
|
||||
metaKey?: boolean,
|
||||
altKey?: boolean,
|
||||
shiftKey?: boolean,
|
||||
onKeyUp?: boolean,
|
||||
onKeyDown?: boolean,
|
||||
onMouseMove?: boolean,
|
||||
}
|
||||
|
||||
interface ActionScopeInterface {
|
||||
show: boolean,
|
||||
label?: string, // example override, takes precedence over default label
|
||||
shortcut?: KeyboardShortcutInterface[],
|
||||
}
|
||||
|
||||
interface RestrictionsSettings {
|
||||
disableOnSmallPlayers?: boolean; // Whether ultrawidify should disable itself when the player is small
|
||||
minAllowedWidth?: number; // if player is less than this many px wide, ultrawidify will disable itself
|
||||
minAllowedHeight?: number; // if player is less than this many px tall, ultrawidify will disable itself
|
||||
onlyAllowInFullscreen?: boolean; // if enabled, ultrawidify will be disabled when not in full screen regardless of what previous two options say
|
||||
onlyAllowAutodetectionInFullScreen?: boolean; // if enabled, autodetection will only start once in full screen
|
||||
}
|
||||
|
||||
interface ExtensionEnvironmentSettingsInterface {
|
||||
normal: ExtensionMode,
|
||||
theater: ExtensionMode,
|
||||
fullscreen: ExtensionMode,
|
||||
}
|
||||
|
||||
export interface CommandInterface {
|
||||
action: string,
|
||||
label: string,
|
||||
comment?: string,
|
||||
arguments?: any,
|
||||
shortcut?: KeyboardShortcutInterface,
|
||||
internalOnly?: boolean,
|
||||
actionId?: string,
|
||||
}
|
||||
|
||||
export type SettingsReloadComponent = 'PlayerData' | 'VideoData';
|
||||
export type SettingsReloadFlags = true | SettingsReloadComponent;
|
||||
|
||||
export interface AardSettings {
|
||||
aardType: 'webgl' | 'legacy' | 'auto';
|
||||
|
||||
disabledReason: string, // if automatic aspect ratio has been disabled, show reason
|
||||
allowedMisaligned: number, // top and bottom letterbox thickness can differ by this much.
|
||||
// Any more and we don't adjust ar.
|
||||
allowedArVariance: number, // amount by which old ar can differ from the new (1 = 100%)
|
||||
timers: { // autodetection frequency
|
||||
playing: number, // while playing
|
||||
paused: number, // while paused
|
||||
error: number, // after error
|
||||
minimumTimeout: number,
|
||||
tickrate: number, // 1 tick every this many milliseconds
|
||||
},
|
||||
autoDisable: { // settings for automatically disabling the extension
|
||||
maxExecutionTime: number, // if execution time of main autodetect loop exceeds this many milliseconds,
|
||||
// we disable it.
|
||||
consecutiveTimeoutCount: number, // we only do it if it happens this many consecutive times
|
||||
|
||||
// FOR FUTURE USE
|
||||
consecutiveArResets: number // if aspect ratio reverts immediately after AR change is applied, we disable everything
|
||||
},
|
||||
canvasDimensions: {
|
||||
blackframeCanvas: { // smaller than sample canvas, blackframe canvas is used to recon for black frames
|
||||
// it's not used to detect aspect ratio by itself, so it can be tiny af
|
||||
width: number,
|
||||
height: number,
|
||||
},
|
||||
sampleCanvas: { // size of image sample for detecting aspect ratio. Bigger size means more accurate results,
|
||||
// at the expense of performance
|
||||
width: number,
|
||||
height: number,
|
||||
},
|
||||
},
|
||||
|
||||
// NOTE: Black Frame is currently not in use.
|
||||
blackframe: {
|
||||
sufficientColorVariance: number, // calculate difference between average intensity and pixel, for every pixel for every color
|
||||
// component. Average intensity is normalized to where 0 is black and 1 is biggest value for
|
||||
// that component. If sum of differences between normalized average intensity and normalized
|
||||
// component varies more than this % between color components, we can afford to use less strict
|
||||
// cumulative threshold.
|
||||
cumulativeThresholdLax: number,
|
||||
cumulativeThresholdStrict: number,// if we add values of all pixels together and get more than this, the frame is bright enough.
|
||||
// (note: blackframe is 16x9 px -> 144px total. cumulative threshold can be reached fast)
|
||||
blackPixelsCondition: number, // How much pixels must be black (1 all, 0 none) before we consider frame as black. Takes
|
||||
// precedence over cumulative threshold: if blackPixelsCondition is met, the frame is dark
|
||||
// regardless of whether cumulative threshold has been reached.
|
||||
},
|
||||
|
||||
// Used by old aspect ratio detection algorithm. Pls remove.
|
||||
blackbar: {
|
||||
blackLevel: number, // everything darker than 10/255 across all RGB components is considered black by
|
||||
// default. blackLevel can decrease if we detect darker black.
|
||||
threshold: number, // if pixel is darker than the sum of black level and this value, we count it as black
|
||||
// on 0-255. Needs to be fairly high (8 might not cut it) due to compression
|
||||
// artifacts in the video itself
|
||||
frameThreshold: number, // threshold, but when doing blackframe test
|
||||
imageThreshold: number, // in order to detect pixel as "not black", the pixel must be brighter than
|
||||
// the sum of black level, threshold and this value.
|
||||
gradientThreshold: number, // When trying to determine thickness of the black bars, we take 2 values: position of
|
||||
// the last pixel that's darker than our threshold, and position of the first pixel that's
|
||||
// brighter than our image threshold. If positions are more than this many pixels apart,
|
||||
// we assume we aren't looking at letterbox and thus don't correct the aspect ratio.
|
||||
gradientSampleSize: number, // How far do we look to find the gradient
|
||||
maxGradient: number, // if two neighboring pixels in gradientSampleSize differ by more than this, then we aren't
|
||||
// looking at a gradient
|
||||
gradientNegativeTreshold: number,
|
||||
gradientMaxSD: number, // reserved for future use
|
||||
antiGradientMode: AntiGradientMode
|
||||
},
|
||||
// Also not in use, probs.
|
||||
variableBlackbarThresholdOptions: { // In case of poor bitrate videos, jpeg artifacts may cause us issues
|
||||
// FOR FUTURE USE
|
||||
enabled: boolean, // allow increasing blackbar threshold
|
||||
disableArDetectOnMax: boolean, // disable autodetection when threshold goes over max blackbar threshold
|
||||
maxBlackbarThreshold: number, // max threshold (don't increase past this)
|
||||
thresholdStep: number, // when failing to set aspect ratio, increase threshold by this much
|
||||
increaseAfterConsecutiveResets: number // increase if AR resets this many times in a row
|
||||
},
|
||||
blackLevels: {
|
||||
defaultBlack: number, // By default, pixels darker than this are considered black.
|
||||
// (If detection algorithm detects darker blacks, black is considered darkest detected pixel)
|
||||
blackTolerance: number, // If pixel is more than this much brighter than blackLevel, it's considered not black
|
||||
// It is not considered a valid image detection if gradient detection is enabled
|
||||
imageDelta: number, // When gradient detection is enabled, pixels this much brighter than black skip gradient detection
|
||||
}
|
||||
sampling: {
|
||||
edgePosition: number; // % of width (max 0.33). Pixels up to this far away from either edge may contain logo.
|
||||
staticCols: number, // we take a column at [0-n]/n-th parts along the width and sample it
|
||||
randomCols: number, // we add this many randomly selected columns to the static columns
|
||||
staticRows: number, // forms grid with staticSampleCols. Determined in the same way. For black frame checks,
|
||||
},
|
||||
guardLine: { // all pixels on the guardline need to be black, or else we trigger AR recalculation
|
||||
// (if AR fails to be recalculated, we reset AR)
|
||||
enabled: boolean,
|
||||
ignoreEdgeMargin: number, // we ignore anything that pokes over the black line this close to the edge
|
||||
// (relative to width of the sample)
|
||||
imageTestThreshold: number, // when testing for image, this much pixels must be over blackbarThreshold
|
||||
edgeTolerancePx: number, // black edge violation is performed this far from reported 'last black pixel'
|
||||
edgeTolerancePercent: null // unused. same as above, except use % of canvas height instead of pixels
|
||||
},
|
||||
arSwitchLimiter: { // to be implemented
|
||||
switches: number, // we can switch this many times
|
||||
period: number // per this period
|
||||
},
|
||||
|
||||
|
||||
// pls deprecate and move things used
|
||||
edgeDetection: {
|
||||
slopeTestWidth: number,
|
||||
gradientTestSamples: number, // we check this many pixels below (or above) the suspected edge to check for gradient
|
||||
gradientTestBlackThreshold: number, // if pixel in test sample is brighter than that, we aren't looking at gradient
|
||||
gradientTestDeltaThreshold: number, // if delta between two adjacent pixels in gradient test exceeds this, it's not gradient
|
||||
gradientTestMinDelta: number, // if last pixels of the test sample is less than this brighter than the first -> not gradient
|
||||
|
||||
thresholds: {
|
||||
edgeDetectionLimit: number, // during scanning of the edge, quit after edge gets detected at this many points
|
||||
minQualitySingleEdge: number, // At least one of the detected must reach this quality
|
||||
minQualitySecondEdge: number, // The other edge must reach this quality (must be smaller or equal to single edge quality)
|
||||
}
|
||||
|
||||
maxLetterboxOffset: 0.1, // Upper and lower letterbox can be different by this many (% of height)
|
||||
|
||||
// Previous iteration variables VVVV
|
||||
sampleWidth: number, // we take a sample this wide for edge detection
|
||||
detectionThreshold: number, // sample needs to have this many non-black pixels to be a valid edge
|
||||
confirmationThreshold: number, //
|
||||
singleSideConfirmationThreshold: number, // we need this much edges (out of all samples, not just edges) in order
|
||||
// to confirm an edge in case there's no edges on top or bottom (other
|
||||
// than logo, of course)
|
||||
logoThreshold: number, // if edge candidate sits with count greater than this*all_samples, it can't be logo
|
||||
// or watermark.
|
||||
edgeTolerancePx?: number, // we check for black edge violation this far from detection point
|
||||
edgeTolerancePercent?: number, // we check for black edge detection this % of height from detection point. unused
|
||||
middleIgnoredArea: number, // we ignore this % of canvas height towards edges while detecting aspect ratios
|
||||
minColsForSearch: number, // if we hit the edge of blackbars for all but this many columns (%-wise), we don't
|
||||
// continue with search. It's pointless, because black edge is higher/lower than we
|
||||
// are now. (NOTE: keep this less than 1 in case we implement logo detection)
|
||||
},
|
||||
pillarTest: {
|
||||
ignoreThinPillarsPx: number, // ignore pillars that are less than this many pixels thick.
|
||||
allowMisaligned: number // left and right edge can vary this much (%)
|
||||
},
|
||||
textLineTest: {
|
||||
nonTextPulse: number, // if a single continuous pulse has this many non-black pixels, we aren't dealing
|
||||
// with text. This value is relative to canvas width (%)
|
||||
pulsesToConfirm: number, // this is a threshold to confirm we're seeing text.
|
||||
pulsesToConfirmIfHalfBlack: number, // this is the threshold to confirm we're seeing text if longest black pulse
|
||||
// is over 50% of the canvas width
|
||||
testRowOffset: number // we test this % of height from detected edge
|
||||
}
|
||||
}
|
||||
|
||||
interface SettingsInterface {
|
||||
_updateFlags?: {
|
||||
requireReload?: SettingsReloadFlags,
|
||||
forSite?: string
|
||||
}
|
||||
|
||||
arDetect: AardSettings,
|
||||
|
||||
ui: {
|
||||
inPlayer: {
|
||||
enabled: boolean,
|
||||
enabledFullscreenOnly: boolean,
|
||||
popupAlignment: 'left' | 'right',
|
||||
minEnabledWidth: number, // don't show UI if player is narrower than % of screen width
|
||||
minEnabledHeight: number, // don't show UI if player is narrower than % of screen height
|
||||
activation: 'trigger-zone' | 'player', // what needs to be hovered in order for UI to be visible
|
||||
triggerZoneDimensions: { // how large the trigger zone is (relative to player size)
|
||||
width: number
|
||||
height: number,
|
||||
offsetX: number, // fed to translateX(offsetX + '%'). Valid range [-100, 0]
|
||||
offsetY: number // fed to translateY(offsetY + '%'). Valid range [-100, 100]
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
restrictions?: RestrictionsSettings;
|
||||
|
||||
crop: {
|
||||
default: any;
|
||||
},
|
||||
stretch: {
|
||||
default: any;
|
||||
conditionalDifferencePercent: number // black bars less than this wide will trigger stretch
|
||||
// if mode is set to '1'. 1.0=100%
|
||||
},
|
||||
kbm: {
|
||||
enabled: boolean, // if keyboard/mouse handler service will run
|
||||
keyboardEnabled: boolean, // if keyboard shortcuts are processed
|
||||
mouseEnabled: boolean, // if mouse movement is processed
|
||||
}
|
||||
|
||||
zoom: {
|
||||
minLogZoom: number,
|
||||
maxLogZoom: number,
|
||||
announceDebounce: number // we wait this long before announcing new zoom
|
||||
},
|
||||
|
||||
miscSettings: {
|
||||
mousePan: {
|
||||
enabled: boolean
|
||||
},
|
||||
mousePanReverseMouse: boolean,
|
||||
defaultAr?: any
|
||||
},
|
||||
|
||||
resizer: {
|
||||
setStyleString: {
|
||||
maxRetries: number,
|
||||
retryTimeout: number
|
||||
}
|
||||
},
|
||||
pageInfo: {
|
||||
timeouts: {
|
||||
urlCheck: number,
|
||||
rescan: number
|
||||
}
|
||||
},
|
||||
pan?: any,
|
||||
version?: string,
|
||||
preventReload?: boolean,
|
||||
|
||||
// -----------------------------------------
|
||||
// ::: MITIGATIONS :::
|
||||
// -----------------------------------------
|
||||
// Settings for browser bug workarounds.
|
||||
mitigations?: {
|
||||
zoomLimit?: {
|
||||
enabled?: boolean,
|
||||
fullscreenOnly?: boolean,
|
||||
limit?: number,
|
||||
}
|
||||
}
|
||||
// -----------------------------------------
|
||||
// ::: ACTIONS :::
|
||||
// -----------------------------------------
|
||||
// Nastavitve za ukaze. Zamenja stare nastavitve za bližnične tipke.
|
||||
//
|
||||
// Polje 'shortcut' je tabela, če se slučajno lotimo kdaj delati choordov.
|
||||
actions: {
|
||||
name?: string, // name displayed in settings
|
||||
label?: string, // name displayed in ui (can be overridden in scope/playerUi)
|
||||
cmd?: {
|
||||
action: string,
|
||||
arg: any,
|
||||
customArg?: any,
|
||||
persistent?: boolean, // optional, false by default. If true, change doesn't take effect immediately.
|
||||
// Instead, this action saves stuff to settings
|
||||
}[],
|
||||
scopes?: {
|
||||
global?: ActionScopeInterface,
|
||||
site?: ActionScopeInterface,
|
||||
page?: ActionScopeInterface
|
||||
},
|
||||
playerUi?: {
|
||||
show: boolean,
|
||||
path?: string,
|
||||
},
|
||||
userAdded?: boolean,
|
||||
}[],
|
||||
// This object fulfills the same purpose as 'actions', but is written in less retarded and overly
|
||||
// complicated way. Hopefully it'll be easier to maintain it that way.
|
||||
commands?: {
|
||||
crop?: CommandInterface[],
|
||||
stretch?: CommandInterface[],
|
||||
zoom?: CommandInterface[],
|
||||
pan?: CommandInterface[],
|
||||
internal?: CommandInterface[],
|
||||
},
|
||||
whatsNewChecked: boolean,
|
||||
newFeatureTracker: any,
|
||||
// -----------------------------------------
|
||||
// ::: SITE CONFIGURATION :::
|
||||
// -----------------------------------------
|
||||
// Config for a given page:
|
||||
//
|
||||
// <hostname> : {
|
||||
// status: <option> // should extension work on this site?
|
||||
// arStatus: <option> // should we do autodetection on this site?
|
||||
//
|
||||
// defaultAr?: <ratio> // automatically apply this aspect ratio on this side. Use extension defaults if undefined.
|
||||
// stretch? <stretch mode> // automatically stretch video on this site in this manner
|
||||
// videoAlignment? <left|center|right>
|
||||
//
|
||||
// type: <official|community|user> // 'official' — blessed by Tam.
|
||||
// // 'community' — blessed by reddit.
|
||||
// // 'user' — user-defined (not here)
|
||||
// override: <true|false> // override user settings for this site on update
|
||||
// }
|
||||
//
|
||||
// Valid values for options:
|
||||
//
|
||||
// status, arStatus, statusEmbedded:
|
||||
//
|
||||
// * enabled — always allow, full
|
||||
// * basic — allow, but only the basic version without playerData
|
||||
// * default — allow if default is to allow, block if default is to block
|
||||
// * disabled — never allow
|
||||
//
|
||||
sites: {
|
||||
[x: string]: SiteSettingsInterface,
|
||||
}
|
||||
}
|
||||
|
||||
export interface SiteSettingsInterface {
|
||||
enable: ExtensionEnvironmentSettingsInterface;
|
||||
enableAard: ExtensionEnvironmentSettingsInterface;
|
||||
enableKeyboard: ExtensionEnvironmentSettingsInterface;
|
||||
|
||||
type?: 'official' | 'community' | 'user-defined' | 'testing' | 'officially-disabled' | 'unknown' | 'modified';
|
||||
defaultType: 'official' | 'community' | 'user-defined' | 'testing' | 'officially-disabled' | 'unknown' | 'modified';
|
||||
|
||||
// must be defined in @global and @empty
|
||||
persistCSA?: CropModePersistence, // CSA - crop, stretch, alignment
|
||||
|
||||
defaults?: { // must be defined in @global and @empty
|
||||
crop?: {type: AspectRatioType, [x: string]: any},
|
||||
stretch?: StretchType,
|
||||
alignment?: {x: VideoAlignmentType, y: VideoAlignmentType},
|
||||
}
|
||||
|
||||
cropModePersistence?: CropModePersistence;
|
||||
stretchModePersistence?: CropModePersistence;
|
||||
alignmentPersistence?: CropModePersistence;
|
||||
|
||||
|
||||
activeDOMConfig?: string;
|
||||
DOMConfig?: { [x: string]: SiteDOMSettingsInterface };
|
||||
|
||||
// the following script are for extension caching and shouldn't be saved.
|
||||
// if they _are_ saved, they will be overwritten
|
||||
currentDOMConfig?: SiteDOMSettingsInterface;
|
||||
|
||||
// the following fields are for use with extension update script
|
||||
override?: boolean; // whether settings for this site will be overwritten by extension upgrade script
|
||||
}
|
||||
|
||||
export interface SiteDOMSettingsInterface {
|
||||
type: 'official' | 'community' | 'user-defined' | 'modified' | undefined;
|
||||
elements?: {
|
||||
player?: SiteDOMElementSettingsInterface,
|
||||
video?: SiteDOMElementSettingsInterface,
|
||||
other?: { [x: number]: SiteDOMElementSettingsInterface }
|
||||
};
|
||||
customCss?: string;
|
||||
periodicallyRefreshPlayerElement?: boolean;
|
||||
|
||||
// the following script are for extension caching and shouldn't be saved.
|
||||
// if they _are_ saved, they will be overwritten
|
||||
anchorElementIndex?: number;
|
||||
anchorElement?: HTMLElement;
|
||||
}
|
||||
|
||||
export interface SiteDOMElementSettingsInterface {
|
||||
manual?: boolean;
|
||||
querySelectors?: string;
|
||||
index?: number; // previously: useRelativeAncestor + videoAncestor
|
||||
mode?: 'index' | 'qs';
|
||||
nodeCss?: {[x: string]: string};
|
||||
}
|
||||
|
||||
export default SettingsInterface;
|
33
src/common/js/ChromeShittinessMitigations.ts
Normal file
@ -0,0 +1,33 @@
|
||||
/**
|
||||
* For some reason, Chrome really doesn't like when chrome.runtime
|
||||
* methods are wrapped inside a ES6 proxy object. If 'port' is a
|
||||
* ES6 Proxy of a Port object that `chrome.runtime.connect()` creates,
|
||||
* then Chrome will do bullshits like `port.sendMessage` and
|
||||
* `port.onMessage.addListener` crashing your Vue3 UI with bullshits
|
||||
* excuses, e.g.
|
||||
*
|
||||
* | TypeError: Illegal invocation. Function must be called on
|
||||
* | an object of type Port
|
||||
*
|
||||
* which is some grade A bullshit because Firefox can handle that just
|
||||
* fine.
|
||||
*
|
||||
* There's two ways how I could handle this:
|
||||
* * Find out how to get the original object from the proxy Vue3
|
||||
* creates, which would take time and ruin my xmass holiday, or
|
||||
* * make a global object with a passive-aggressive name and ignore
|
||||
* the very real possibility that there's prolly a reason Chrome
|
||||
* does things in its own very special(tm) way, as if it had one
|
||||
* extra chromosome over Firefox.
|
||||
*
|
||||
* Easy choice, really.
|
||||
*/
|
||||
export class ChromeShittinessMitigations {
|
||||
static port = null;
|
||||
|
||||
static setProperty(property, value) {
|
||||
ChromeShittinessMitigations[property] = value;
|
||||
}
|
||||
}
|
||||
|
||||
export default ChromeShittinessMitigations;
|
@ -1,7 +1,7 @@
|
||||
class KeyboardShortcutParser {
|
||||
static parseShortcut(keypress) {
|
||||
let shortcutCombo = '';
|
||||
|
||||
|
||||
if (keypress.ctrlKey) {
|
||||
shortcutCombo += 'Ctrl + ';
|
||||
}
|
||||
@ -21,6 +21,20 @@ class KeyboardShortcutParser {
|
||||
}
|
||||
return shortcutCombo;
|
||||
}
|
||||
|
||||
static generateShortcutFromKeypress(event) {
|
||||
return {
|
||||
ctrlKey: event.ctrlKey,
|
||||
altKey: event.altKey,
|
||||
shiftKey: event.shiftKey,
|
||||
metaKey: event.metaKey,
|
||||
code: event.code,
|
||||
key: event.key,
|
||||
keyup: true,
|
||||
keydown: false,
|
||||
type: event.type, // only needed for purposes of EditShortcutButton
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default KeyboardShortcutParser;
|
||||
export default KeyboardShortcutParser;
|
18
src/common/js/utils.ts
Normal file
@ -0,0 +1,18 @@
|
||||
export async function sleep(timeout) {
|
||||
return new Promise<void>( (resolve, reject) => setTimeout(() => resolve(), timeout));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates deep copy of an object
|
||||
* @param obj
|
||||
* @returns
|
||||
*/
|
||||
export function _cp(obj) {
|
||||
try {
|
||||
return JSON.parse(JSON.stringify(obj));
|
||||
} catch (e) {
|
||||
// console.error('Failed to parse json. This probably means that the data we received was not an object. Will return data as-is');
|
||||
// console.error('data in:', obj, 'error:', e);
|
||||
return obj;
|
||||
}
|
||||
}
|
69
src/csui/GlobalFrame.vue
Normal file
@ -0,0 +1,69 @@
|
||||
<template>
|
||||
<div class="uw-clickthrough relative w-100 h-100">
|
||||
<template v-for="rectangle of drawnRectangles" :key="rectangle.id ?? rectangle">
|
||||
|
||||
<!-- Player element overlays -->
|
||||
<div class="absolute z-index-overlay"
|
||||
:style="rectangle.style"
|
||||
>
|
||||
<!-- used for drawing player element overlay rectangles - keep this section empty -->
|
||||
</div>
|
||||
|
||||
<!-- Notification overlay -->
|
||||
<div class="absolute z-index-notification notification-area">
|
||||
<template v-for="notification of displayedNotifications" :key="notification.id">
|
||||
<div class="notification d-flex flex-row">
|
||||
<div class="notification-icon">
|
||||
<mdicon :name="notification.icon ?? 'alert'" :size="128"></mdicon>
|
||||
</div>
|
||||
<div class="notification-text">
|
||||
<h3 class="notification-title">{{ notification.title }}</h3>
|
||||
<p class="notification-verbose">{{ notification.text }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import UIProbeMixin from './src/utils/UIProbeMixin';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
},
|
||||
mixins: [
|
||||
UIProbeMixin
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
drawnRectangles: [],
|
||||
displayedNotifications: [],
|
||||
}
|
||||
},
|
||||
|
||||
async created() {
|
||||
this.logger = new Logger();
|
||||
|
||||
// this prolly needs to be taken out
|
||||
await this.logger.init({
|
||||
allowLogging: true,
|
||||
});
|
||||
|
||||
/**
|
||||
* Setup the "companion" onMouseMove handler to the one in the content script.
|
||||
* We can handle events with the same function we use to handle events from
|
||||
* the content script.
|
||||
*/
|
||||
document.addEventListener('mousemove', (event) => {
|
||||
this.handleProbe({
|
||||
coords: {
|
||||
x: event.clientX,
|
||||
y: event.clientY
|
||||
}
|
||||
}, this.origin);
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
@ -1,437 +0,0 @@
|
||||
<template>
|
||||
<div v-if="showLoggerUi" class="root-window flex flex-column overflow-hidden"
|
||||
@keyup.stop
|
||||
@keydown.stop
|
||||
@keypress.stop
|
||||
>
|
||||
<div class="header">
|
||||
<div class="header-top flex flex-row">
|
||||
<div class="flex-grow">
|
||||
<h1>{{header.header}}</h1>
|
||||
</div>
|
||||
<div class="button flex-noshrink button-header"
|
||||
@click="hidePopup()"
|
||||
>
|
||||
<template v-if="logStringified">Finish logging</template>
|
||||
<template v-else>Hide popup</template>
|
||||
</div>
|
||||
<!-- <div class="button flex-noshrink button-header"
|
||||
@click="stopLogging()"
|
||||
>
|
||||
Stop logging
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="header-bottom">
|
||||
<div>{{header.subheader}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content flex flex-row flex-grow overflow-hidden">
|
||||
|
||||
<!-- LOGGER SETTINGS PANEL -->
|
||||
<div class="settings-panel flex flex-noshrink flex-column">
|
||||
<div class="panel-top flex-nogrow">
|
||||
<h2>Logger configuration</h2>
|
||||
</div>
|
||||
<div class="flex flex-row flex-end w100">
|
||||
<div v-if="!showTextMode" class="button" @click="showTextMode = true">
|
||||
Paste config ...
|
||||
</div>
|
||||
<div v-else class="button" @click="showTextMode = false">
|
||||
Back
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel-middle scrollable flex-grow log-config-margin">
|
||||
<template v-if="showTextMode">
|
||||
<div ref="settingsEditArea"
|
||||
style="white-space: pre-wrap; border: 1px solid orange; padding: 10px;"
|
||||
class="monospace h100"
|
||||
:class="{'jsonbg': !confHasError, 'jsonbg-error': confHasError}"
|
||||
contenteditable="true"
|
||||
@input="updateSettings"
|
||||
>
|
||||
{{parsedSettings}}
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<JsonObject label="logger-settings"
|
||||
:value="currentSettings"
|
||||
:ignoreKeys="{'allowLogging': true}"
|
||||
@change="updateSettingsUi"
|
||||
></JsonObject>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="flex flex-row flex-end">
|
||||
<div class="button" @click="restoreLoggerSettings()">
|
||||
Revert
|
||||
</div>
|
||||
<div class="button button-primary" @click="saveLoggerSettings()">
|
||||
Save
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- LOGGER OUTPUT/START LOGGING -->
|
||||
<div class="results-panel flex flex-shrink flex-column overflow-hidden">
|
||||
<div class="panel-top flex-nogrow">
|
||||
<h2>Logger results</h2>
|
||||
</div>
|
||||
<template v-if="logStringified">
|
||||
<div v-if="confHasError" class="warn">
|
||||
Logger configuration contains an error. You can export current log, but you will be unable to record a new log.
|
||||
</div>
|
||||
<div class="panel-middle scrollable flex-grow p-t-025em">
|
||||
<pre>
|
||||
{{logStringified}}
|
||||
</pre>
|
||||
</div>
|
||||
<div class="flex-noshrink flex flex-row flex-end p-t-025em">
|
||||
<div class="button button-bar"
|
||||
@click="startLogging()"
|
||||
>
|
||||
New log
|
||||
</div>
|
||||
<div class="button button-bar"
|
||||
@click="exportLog()"
|
||||
>
|
||||
Export log
|
||||
</div>
|
||||
<div class="button button-bar button-primary"
|
||||
@click="exportAndQuit()"
|
||||
>
|
||||
Export & finish
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="panel-middle scrollable flex-grow">
|
||||
<div v-if="!parsedSettings" class="text-center w100">
|
||||
Please paste logger config into the text box to the left.
|
||||
←←←
|
||||
</div>
|
||||
<div v-else-if="confHasError" class="warn">
|
||||
Logger configuration contains an error. Cannot start logging.
|
||||
</div>
|
||||
<div v-else-if="lastSettings && lastSettings.allowLogging && lastSettings.consoleOptions && lastSettings.consoleOptions.enabled"
|
||||
class="flex flex-column flex-center flex-cross-center w100 h100"
|
||||
>
|
||||
<p class="m-025em">
|
||||
Logging in progress ...
|
||||
</p>
|
||||
<div class="button button-big button-primary"
|
||||
@click="stopLogging()"
|
||||
>
|
||||
Stop logging
|
||||
</div>
|
||||
<template v-if="lastSettings && lastSettings.timeout"
|
||||
class="m-025em"
|
||||
>
|
||||
<p>
|
||||
... or wait until logging ends.
|
||||
</p>
|
||||
<p>
|
||||
You can <a @click="hidePopup()">hide popup</a> — it will automatically re-appear when logging finishes.
|
||||
</p>
|
||||
</template>
|
||||
<template v-else-if="lastSettings">
|
||||
<p>
|
||||
You can <a @click="hidePopup()">hide popup</a> — the logging will continue until you re-open the popup and stop it.
|
||||
</p>
|
||||
</template>
|
||||
</div>
|
||||
<div v-else class="flex flex-column flex-center flex-cross-center w100 h100">
|
||||
<div class="button button-big button-primary"
|
||||
@click="startLogging()"
|
||||
>
|
||||
Start logging
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div>
|
||||
button row is heres
|
||||
</div> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex';
|
||||
import Logger from '../ext/lib/Logger';
|
||||
import Comms from '../ext/lib/comms/Comms';
|
||||
import IO from '../common/js/IO';
|
||||
import JsonObject from '../common/components/JsonEditor/JsonObject';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
JsonObject,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showLoggerUi: false,
|
||||
header: {
|
||||
header: 'whoopsie daisy',
|
||||
subheader: 'you broke the header choosing script'
|
||||
},
|
||||
parsedSettings: '',
|
||||
lastSettings: {},
|
||||
currentSettings: {},
|
||||
confHasError: false,
|
||||
logStringified: '',
|
||||
showTextMode: false,
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
const headerRotation = [{
|
||||
header: "DEFORESTATOR 5000",
|
||||
subheader: "Iron Legion's finest logging tool"
|
||||
}, {
|
||||
header: "Astinus",
|
||||
subheader: "Ultrawidify logging tool"
|
||||
}, {
|
||||
header: "Tracer",
|
||||
subheader: "I'm already printing stack traces"
|
||||
}];
|
||||
|
||||
this.header = headerRotation[Math.floor(+Date.now() / (3600000*24)) % headerRotation.length] || this.header;
|
||||
|
||||
this.getLoggerSettings();
|
||||
},
|
||||
computed: {
|
||||
...mapState([
|
||||
'uwLog',
|
||||
'showLogger',
|
||||
'loggingEnded',
|
||||
]),
|
||||
},
|
||||
watch: {
|
||||
uwLog(newValue, oldValue) {
|
||||
if (oldValue !== newValue) {
|
||||
this.$store.dispatch('uw-show-logger');
|
||||
this.logStringified = JSON.stringify(newValue, null, 2);
|
||||
}
|
||||
},
|
||||
async showLogger(newValue) {
|
||||
this.showLoggerUi = newValue;
|
||||
|
||||
// update logger settings (they could have changed while the popup was closed)
|
||||
if (newValue) {
|
||||
this.getLoggerSettings();
|
||||
}
|
||||
},
|
||||
loggingEnded(newValue) {
|
||||
// note — the value of loggingEnded never actually matters. Even if this value is 'true'
|
||||
// internally, vuexStore.dspatch() will still do its job and give us the signal we want
|
||||
if (newValue) {
|
||||
this.stopLogging();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getLoggerSettings() {
|
||||
this.lastSettings = await Logger.getConfig() || {};
|
||||
this.parsedSettings = JSON.stringify(this.lastSettings, null, 2) || '';
|
||||
this.currentSettings = JSON.parse(JSON.stringify(this.lastSettings));
|
||||
},
|
||||
updateSettings(val) {
|
||||
try {
|
||||
this.parsedSettings = JSON.stringify(JSON.parse(val.target.textContent.trim()), null, 2);
|
||||
this.lastSettings = JSON.parse(val.target.textContent.trim());
|
||||
this.currentSettings = JSON.parse(JSON.stringify(this.lastSettings));
|
||||
this.confHasError = false;
|
||||
} catch (e) {
|
||||
this.confHasError = true;
|
||||
}
|
||||
},
|
||||
updateSettingsUi(val) {
|
||||
try {
|
||||
this.parsedSettings = JSON.stringify(val, null, 2);
|
||||
this.lastSettings = val;
|
||||
this.currentSettings = JSON.parse(JSON.stringify(this.lastSettings));
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
},
|
||||
saveLoggerSettings() {
|
||||
Logger.saveConfig({...this.lastSettings});
|
||||
},
|
||||
restoreLoggerSettings() {
|
||||
this.getLoggerSettings();
|
||||
this.confHasError = false;
|
||||
},
|
||||
async startLogging(){
|
||||
this.logStringified = undefined;
|
||||
await Logger.saveConfig({...this.lastSettings, allowLogging: true});
|
||||
window.location.reload();
|
||||
},
|
||||
hidePopup() {
|
||||
// this function only works as 'close' if logging has finished
|
||||
if (this.logStringified) {
|
||||
Logger.saveConfig({...this.lastSettings, allowLogging: false});
|
||||
this.logStringified = undefined;
|
||||
}
|
||||
this.$store.dispatch('uw-hide-logger');
|
||||
},
|
||||
closePopupAndStopLogging() {
|
||||
Logger.saveConfig({...this.lastSettings, allowLogging: false});
|
||||
this.logStringified = undefined;
|
||||
this.$store.dispatch('uw-hide-logger');
|
||||
},
|
||||
stopLogging() {
|
||||
Logger.saveConfig({...this.lastSettings, allowLogging: false});
|
||||
this.lastSettings.allowLogging = false;
|
||||
},
|
||||
exportLog() {
|
||||
IO.csStringToFile(this.logStringified);
|
||||
},
|
||||
exportAndQuit() {
|
||||
this.exportLog();
|
||||
this.logStringified = undefined;
|
||||
this.closePopupAndStopLogging();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" src="../res/css/flex.scss" scoped></style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import '../res/css/colors.scss';
|
||||
@import '../res/css/font/overpass.css';
|
||||
@import '../res/css/font/overpass-mono.css';
|
||||
@import '../res/css/common.scss';
|
||||
|
||||
|
||||
.root-window {
|
||||
position: fixed !important;
|
||||
top: 5vh !important;
|
||||
left: 5vw !important;
|
||||
width: 90vw !important;
|
||||
height: 90vh !important;
|
||||
z-index: 999999 !important;
|
||||
background-color: rgba( $page-background, 0.9) !important;
|
||||
color: #f1f1f1 !important;
|
||||
font-size: 14px !important;
|
||||
|
||||
box-sizing: border-box !important;
|
||||
}
|
||||
|
||||
div {
|
||||
font-family: 'Overpass';
|
||||
}
|
||||
|
||||
h1, h2 {
|
||||
font-family: 'Overpass Thin';
|
||||
}
|
||||
h1 {
|
||||
font-size: 4em;
|
||||
}
|
||||
h2 {
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
.header {
|
||||
h1 {
|
||||
margin-bottom: -0.20em;
|
||||
margin-top: 0.0em;
|
||||
}
|
||||
.header-top, .header-bottom {
|
||||
padding-left: 16px;
|
||||
padding-right: 16px;
|
||||
}
|
||||
.header-top {
|
||||
background-color: $popup-header-background !important;
|
||||
}
|
||||
.header-bottom {
|
||||
font-size: 1.75em;
|
||||
}
|
||||
}
|
||||
.content {
|
||||
box-sizing: border-box;
|
||||
padding: 8px 32px;
|
||||
width: 100%;
|
||||
}
|
||||
.settings-panel {
|
||||
box-sizing: border-box;
|
||||
padding-right: 8px;
|
||||
flex-grow: 2 !important;
|
||||
min-width: 30% !important;
|
||||
flex-shrink: 0 !important;
|
||||
height: inherit !important;
|
||||
}
|
||||
.results-panel {
|
||||
box-sizing: border-box;
|
||||
padding-left: 8px;
|
||||
max-width: 70% !important;
|
||||
flex-grow: 5 !important;
|
||||
flex-shrink: 0 !important;
|
||||
height: inherit !important;
|
||||
}
|
||||
|
||||
.scrollable {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.overflow-hidden {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
pre {
|
||||
font-family: 'Overpass Mono';
|
||||
}
|
||||
|
||||
.m-025em {
|
||||
margin: 0.25em;
|
||||
}
|
||||
|
||||
.p-t-025em {
|
||||
padding-top: 0.25em;
|
||||
}
|
||||
|
||||
.button {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-items: center;
|
||||
padding-left: 2em;
|
||||
padding-right: 2em;
|
||||
}
|
||||
|
||||
.button-primary {
|
||||
background-color: $primary;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.button-big {
|
||||
font-size: 1.5em;
|
||||
padding: 1.75em 3.25em;
|
||||
}
|
||||
|
||||
.button-bar {
|
||||
font-size: 1.25em;
|
||||
padding: 0.25em 1.25em;
|
||||
margin-left: 0.25em;
|
||||
}
|
||||
|
||||
.button-header {
|
||||
font-size: 2em;
|
||||
padding-top: 0.1em;
|
||||
padding-left: 1em;
|
||||
padding-right: 1em;
|
||||
}
|
||||
|
||||
.jsonbg {
|
||||
background-color: #131313;
|
||||
}
|
||||
.jsonbg-error {
|
||||
background-color: #884420;
|
||||
}
|
||||
|
||||
.log-config-margin {
|
||||
margin-top: 3em;
|
||||
margin-bottom: 3em;
|
||||
}
|
||||
|
||||
</style>
|
687
src/csui/PlayerOverlay.vue
Normal file
@ -0,0 +1,687 @@
|
||||
<template>
|
||||
<div
|
||||
class="context-spawn uw-ui-area"
|
||||
style="z-index: 1000;"
|
||||
v-if="!triggerZoneEditorVisible"
|
||||
>
|
||||
<div
|
||||
class="spawn-container uw-ui-trigger"
|
||||
:style="triggerZoneStyles"
|
||||
>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="contextMenuActive || settingsInitialized && uwTriggerZoneVisible && !isGlobal"
|
||||
class="context-spawn uw-clickable uw-ui-area"
|
||||
style="z-index: 1001"
|
||||
|
||||
>
|
||||
<GhettoContextMenu
|
||||
alignment="right" class="uw-menu"
|
||||
@mouseenter="() => {preventContextMenuHide(); newFeatureViewUpdate('uw6.ui-popup')}"
|
||||
@mouseleave="allowContextMenuHide()"
|
||||
>
|
||||
<template v-slot:activator>
|
||||
<div class="context-item">
|
||||
Ultrawidify
|
||||
</div>
|
||||
</template>
|
||||
<slot>
|
||||
|
||||
<!--
|
||||
Didn't manage to ensure that extension status pops up above other menu items in less than 3 minutes with z-index,
|
||||
so wrapping 'status' and 'real menu items' in two different divs, ordering them in the opposite way, and then
|
||||
ensuring correct ordering with flex-direction: column-reverse ended up being easier and faster.
|
||||
-->
|
||||
<div class="menu-width flex-reverse-order">
|
||||
<div style="z-index: 1000">
|
||||
<GhettoContextMenu alignment="right">
|
||||
<template v-slot:activator>
|
||||
Crop
|
||||
</template>
|
||||
<slot>
|
||||
<GhettoContextMenuOption
|
||||
v-for="(command, index) of settings?.active.commands.crop"
|
||||
:key="index"
|
||||
:label="command.label"
|
||||
:shortcut="getKeyboardShortcutLabel(command)"
|
||||
@click="execAction(command)"
|
||||
>
|
||||
</GhettoContextMenuOption>
|
||||
</slot>
|
||||
</GhettoContextMenu>
|
||||
<GhettoContextMenu alignment="right">
|
||||
<template v-slot:activator>
|
||||
Stretch
|
||||
</template>
|
||||
<slot>
|
||||
<GhettoContextMenuOption
|
||||
v-for="(command, index) of settings?.active.commands.stretch"
|
||||
:key="index"
|
||||
:label="command.label"
|
||||
:shortcut="getKeyboardShortcutLabel(command)"
|
||||
@click="execAction(command)"
|
||||
>
|
||||
</GhettoContextMenuOption>
|
||||
</slot>
|
||||
</GhettoContextMenu>
|
||||
<GhettoContextMenu alignment="right">
|
||||
<template v-slot:activator>
|
||||
<div class="context-item">
|
||||
Align
|
||||
</div>
|
||||
</template>
|
||||
<slot>
|
||||
<GhettoContextMenuItem :disableHover="true" :css="{'reduced-padding': true}">
|
||||
<AlignmentOptionsControlComponent
|
||||
:eventBus="eventBus"
|
||||
>
|
||||
</AlignmentOptionsControlComponent>
|
||||
</GhettoContextMenuItem>
|
||||
</slot>
|
||||
</GhettoContextMenu>
|
||||
|
||||
<!-- shortcut for configuring UI -->
|
||||
<GhettoContextMenuOption
|
||||
v-if="settings.active.newFeatureTracker?.['uw6.ui-popup']?.show > 0"
|
||||
@click="showUwWindow('playerUiSettings')"
|
||||
>
|
||||
<span style="color: #fa6;">Change when and if<br/>this popup appears</span>
|
||||
<span style="font-size: 0.8rem">
|
||||
<span style="font-size: 0.8rem; opacity: 0.5">This menu option will show {{settings.active.newFeatureTracker?.['uw6.ui-popup']?.show}} more<br/> times; or until clicked or dismissed.<br/>
|
||||
Also accessible via:<br/> <span style="font-size: 0.85em">EXTENSION SETTINGS > UI AND KEYBOARD</span>.
|
||||
</span>
|
||||
<br/>
|
||||
<a style="color: #fa6; cursor: pointer;" @click="() => acknowledgeNewFeature('uw6.ui-popup')">Dismiss this option</a>
|
||||
</span>
|
||||
</GhettoContextMenuOption>
|
||||
|
||||
<!-- -->
|
||||
<GhettoContextMenuOption
|
||||
@click="showUwWindow()"
|
||||
label="Extension settings"
|
||||
>
|
||||
</GhettoContextMenuOption>
|
||||
<GhettoContextMenuOption
|
||||
@click="showUwWindow('playerDetection')"
|
||||
label="Incorrect cropping?"
|
||||
>
|
||||
</GhettoContextMenuOption>
|
||||
<GhettoContextMenuOption
|
||||
@click="showUwWindow('about')"
|
||||
label="Not working?"
|
||||
>
|
||||
</GhettoContextMenuOption>
|
||||
</div>
|
||||
|
||||
<div style="z-index: 10000">
|
||||
<GhettoContextMenuItem
|
||||
class="extension-status-messages"
|
||||
:disableHover="true"
|
||||
>
|
||||
Site compatibility:
|
||||
<SupportLevelIndicator
|
||||
:siteSupportLevel="siteSupportLevel"
|
||||
>
|
||||
</SupportLevelIndicator>
|
||||
<div v-if="statusFlags.hasDrm" class="aard-blocked">
|
||||
Autodetection potentially<br/>
|
||||
unavailable due to <a href="https://en.wikipedia.org/wiki/Digital_rights_management">DRM</a>.
|
||||
</div>
|
||||
<div v-else-if="statusFlags.aardErrors?.cors" class="aard-blocked">
|
||||
Autodetection blocked<br/>
|
||||
by site/browser (CORS).
|
||||
</div>
|
||||
<div v-else-if="statusFlags.aardErrors?.webglError" class="aard-blocked">
|
||||
Autodetection unavailable<br/>
|
||||
due to webgl error.
|
||||
</div>
|
||||
</GhettoContextMenuItem>
|
||||
</div>
|
||||
</div>
|
||||
</slot>
|
||||
</GhettoContextMenu>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="settingsInitialized && uwWindowVisible"
|
||||
class="uw-window flex flex-col uw-clickable uw-ui-area"
|
||||
:class="{'fade-out': uwWindowFadeOut}"
|
||||
>
|
||||
<PlayerUIWindow
|
||||
:settings="settings"
|
||||
:eventBus="eventBus"
|
||||
:logger="logger"
|
||||
:in-player="!isGlobal"
|
||||
:site="site"
|
||||
:defaultTab="defaultWindowTab"
|
||||
@close="uwWindowVisible = false"
|
||||
@preventClose="(event) => uwWindowFadeOutDisabled = event"
|
||||
></PlayerUIWindow>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="triggerZoneEditorVisible"
|
||||
class="context-spawn uw-ui-area"
|
||||
style="z-index: 1000;"
|
||||
>
|
||||
<TriggerZoneEditor
|
||||
:settings="settings"
|
||||
:eventBus="eventBus"
|
||||
:playerDimensions="playerDimensions"
|
||||
>
|
||||
</TriggerZoneEditor>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PlayerUIWindow from './src/PlayerUIWindow.vue';
|
||||
import GhettoContextMenu from './src/components/GhettoContextMenu.vue';
|
||||
import GhettoContextMenuItem from './src/components/GhettoContextMenuItem.vue';
|
||||
import GhettoContextMenuOption from './src/components/GhettoContextMenuOption.vue';
|
||||
import AlignmentOptionsControlComponent from './src/PlayerUiPanels/AlignmentOptionsControlComponent.vue';
|
||||
import BrowserDetect from '../ext/conf/BrowserDetect';
|
||||
import Logger from '../ext/lib/Logger';
|
||||
import Settings from '../ext/lib/Settings';
|
||||
import EventBus from '../ext/lib/EventBus';
|
||||
import UIProbeMixin from './src/utils/UIProbeMixin';
|
||||
import KeyboardShortcutParserMixin from './src/utils/KeyboardShortcutParserMixin';
|
||||
import CommsMixin from './src/utils/CommsMixin';
|
||||
import SupportLevelIndicator from './src/components/SupportLevelIndicator.vue';
|
||||
import TriggerZoneEditor from './src/components/TriggerZoneEditor.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
PlayerUIWindow,
|
||||
GhettoContextMenu,
|
||||
GhettoContextMenuItem,
|
||||
GhettoContextMenuOption,
|
||||
AlignmentOptionsControlComponent,
|
||||
SupportLevelIndicator,
|
||||
TriggerZoneEditor,
|
||||
},
|
||||
mixins: [
|
||||
UIProbeMixin,
|
||||
KeyboardShortcutParserMixin,
|
||||
CommsMixin
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
uwTriggerZoneVisible: false,
|
||||
uwTriggerZoneTimeout: undefined,
|
||||
uwTriggerRegionConf: {
|
||||
left: "10%",
|
||||
top: "10%",
|
||||
height: "30%",
|
||||
width: "30%",
|
||||
maxWidth: "24rem",
|
||||
maxHeight: "13.37rem",
|
||||
},
|
||||
|
||||
uwWindowFadeOutDisabled: false,
|
||||
uwWindowFadeOut: false,
|
||||
uwWindowCloseTimeout: undefined,
|
||||
uwWindowVisible: false,
|
||||
triggerZoneEditorVisible: false,
|
||||
|
||||
// component properties
|
||||
settings: {},
|
||||
BrowserDetect: BrowserDetect,
|
||||
settingsInitialized: false,
|
||||
eventBus: new EventBus(),
|
||||
logger: null,
|
||||
|
||||
// NOTE: chromium doesn't allow us to access window.parent.location
|
||||
// meaning we will have to correct this value from our uwui-probe
|
||||
// messages ... which is a bummer.
|
||||
site: null,
|
||||
origin: '*', // will be set appropriately once the first uwui-probe event is received
|
||||
lastProbeTs: null,
|
||||
|
||||
isGlobal: true,
|
||||
disabled: false,
|
||||
|
||||
contextMenuActive: false,
|
||||
triggerZoneActive: false,
|
||||
|
||||
uiVisible: true,
|
||||
debugData: {
|
||||
resizer: {},
|
||||
player: {},
|
||||
},
|
||||
debugDataPrettified: '',
|
||||
|
||||
// in global overlay, this property is used to determine
|
||||
// if closing the window should emit uw-set-ui-state
|
||||
// event on eventBus
|
||||
showPlayerUIAfterClose: false,
|
||||
|
||||
statusFlags: {
|
||||
hasDrm: undefined,
|
||||
aardErrors: undefined,
|
||||
},
|
||||
defaultWindowTab: 'videoSettings',
|
||||
|
||||
saveState: {},
|
||||
siteSettings: undefined,
|
||||
previewZoneVisible: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
// LPT: NO ARROW FUNCTIONS IN COMPUTED,
|
||||
// IS SUPER HARAM
|
||||
// THINGS WILL NOT WORK IF YOU USE ARROWS
|
||||
windowWidth() {
|
||||
return window.innerWidth;
|
||||
},
|
||||
windowHeight() {
|
||||
return window.innerHeight;
|
||||
},
|
||||
// LPT: NO ARROW FUNCTIONS IN COMPUTED,
|
||||
// IS SUPER HARAM
|
||||
// THINGS WILL NOT WORK IF YOU USE ARROWS
|
||||
siteSupportLevel() {
|
||||
return (this.site && this.siteSettings) ? this.siteSettings.data.type || 'no-support' : 'waiting';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
showUi(visible) {
|
||||
if (visible !== undefined) {
|
||||
this.uiVisible = visible;
|
||||
}
|
||||
},
|
||||
resizerDebugData(newData) {
|
||||
this.debugData.resizer = newData;
|
||||
this.debugDataPrettified = JSON.stringify(this.debugData, null, 2);
|
||||
},
|
||||
playerDebugData(newData) {
|
||||
this.debugData.player = newData;
|
||||
this.debugDataPrettified = JSON.stringify(this.debugData, null, 2);
|
||||
}
|
||||
},
|
||||
|
||||
async created() {
|
||||
this.logger = new Logger();
|
||||
|
||||
// this prolly needs to be taken out
|
||||
await this.logger.init({
|
||||
allowLogging: true,
|
||||
});
|
||||
|
||||
this.settings = new Settings({afterSettingsSaved: this.updateConfig, logger: this.logger});
|
||||
this.settings.listenAfterChange(() => this.updateTriggerZones());
|
||||
|
||||
await this.settings.init();
|
||||
this.settingsInitialized = true;
|
||||
|
||||
// set up communication with client script.
|
||||
// NOTE: companion onmousemove is set up in UIProbeMixin
|
||||
window.addEventListener('message', event => {
|
||||
this.handleMessage(event);
|
||||
});
|
||||
|
||||
this.eventBus.subscribe('uw-config-broadcast', {function: (data) => {
|
||||
switch (data.type) {
|
||||
case 'drm-status':
|
||||
this.statusFlags.hasDrm = data.hasDrm;
|
||||
break;
|
||||
case 'aard-error':
|
||||
this.statusFlags.aardErrors = data.aardErrors;
|
||||
break;
|
||||
case 'player-dimensions':
|
||||
this.playerDimensionsUpdate(data.data);
|
||||
break;
|
||||
}
|
||||
}});
|
||||
|
||||
this.eventBus.subscribe('uw-set-ui-state', { function: (data) => {
|
||||
if (data.globalUiVisible !== undefined) {
|
||||
if (this.isGlobal) {
|
||||
if (data.globalUiVisible) {
|
||||
this.showUwWindow();
|
||||
} else {
|
||||
this.hideUwWindow(true);
|
||||
}
|
||||
// this.showPlayerUIAfterClose = data.showPlayerUIAfterClose;
|
||||
} else {
|
||||
// non global UIs are hidden while global overlay
|
||||
// is visible and vice versa
|
||||
// this.disabled = data.globalUiVisible;
|
||||
this.saveState = {
|
||||
uwWindowVisible: this.uwWindowVisible,
|
||||
uwWindowFadeOutDisabled: this.uwWindowFadeOutDisabled,
|
||||
uwWindowFadeOut: this.uwWindowFadeOut
|
||||
};
|
||||
this.uwWindowFadeOutDisabled = false;
|
||||
this.hideUwWindow(true);
|
||||
}
|
||||
}
|
||||
}});
|
||||
|
||||
this.eventBus.subscribe(
|
||||
'uw-restore-ui-state',
|
||||
{
|
||||
function: (data) => {
|
||||
if (this.saveState) {
|
||||
if (this.saveState.uwWindowVisible) {
|
||||
this.showUwWindow();
|
||||
}
|
||||
this.uwWindowFadeOutDisabled = this.saveState.uwWindowFadeOutDisabled;
|
||||
this.uwWindowFadeOut = this.saveState.uwWindowFadeOut;
|
||||
}
|
||||
this.saveState = {};
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
this.eventBus.subscribe('ui-trigger-zone-update', {
|
||||
function: (data) => {
|
||||
this.showTriggerZonePreview = data.previewZoneVisible;
|
||||
// this.;
|
||||
}
|
||||
});
|
||||
|
||||
this.eventBus.subscribe(
|
||||
'start-trigger-zone-edit',
|
||||
{
|
||||
function: () => {
|
||||
this.triggerZoneEditorVisible = true;
|
||||
this.uwWindowVisible = false;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
this.eventBus.subscribe(
|
||||
'finish-trigger-zone-edit',
|
||||
{
|
||||
function: () => {
|
||||
this.triggerZoneEditorVisible = false;
|
||||
this.showUwWindow('playerUiSettings');
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
this.sendToParentLowLevel('uwui-get-role', null);
|
||||
this.sendToParentLowLevel('uwui-get-theme', null);
|
||||
|
||||
this.sendToParentLowLevel('uw-bus-tunnel', {
|
||||
action: 'get-player-dimensions'
|
||||
});
|
||||
},
|
||||
|
||||
methods: {
|
||||
/**
|
||||
* Gets URL of the browser settings page (i think?)
|
||||
*/
|
||||
getUrl(url) {
|
||||
return BrowserDetect.getURL(url);
|
||||
},
|
||||
|
||||
/**
|
||||
* Mostly intended to process messages received via window.addEventListener('message').
|
||||
* This method should include minimal logic — instead, it should only route messages
|
||||
* to the correct function down the line.
|
||||
*/
|
||||
handleMessage(event) {
|
||||
switch (event.data.action) {
|
||||
case 'uwui-probe':
|
||||
if (!this.site) {
|
||||
this.origin = event.origin;
|
||||
this.site = event.origin.split('//')[1];
|
||||
this.siteSettings = this.settings.getSiteSettings(this.site);
|
||||
}
|
||||
return this.handleProbe(event.data, event.origin); // handleProbe is defined in UIProbeMixin
|
||||
case 'uw-bus-tunnel':
|
||||
return this.handleBusTunnelIn(event.data.payload);
|
||||
case 'uwui-set-role':
|
||||
this.isGlobal = event.data.payload.role === 'global';
|
||||
this.sendToParentLowLevel('uwui-interface-ready', true);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Handles trigger zone
|
||||
*/
|
||||
handleTriggerZone(mouseInside) {
|
||||
// this.triggerZoneActive = mouseInside;
|
||||
},
|
||||
|
||||
acknowledgeNewFeature(featureKey) {
|
||||
delete this.settings.active.newFeatureTracker[featureKey];
|
||||
this.settings.saveWithoutReload();
|
||||
},
|
||||
newFeatureViewUpdate(featureKey) {
|
||||
if (!this.settings.active.newFeatureTracker[featureKey]) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.settings.active.newFeatureTracker[featureKey].show--;
|
||||
this.settings.saveWithoutReload();
|
||||
|
||||
if (this.settings.active.newFeatureTracker[featureKey]?.show < 0) {
|
||||
this.acknowledgeNewFeature(featureKey);
|
||||
}
|
||||
} catch (e) {
|
||||
// do nothing
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Sends message to parent _without_ using event bus.
|
||||
*/
|
||||
sendToParentLowLevel(action, payload, lowLevelExtras = {}) {
|
||||
window.parent.postMessage(
|
||||
{
|
||||
action, payload, ...lowLevelExtras
|
||||
},
|
||||
'*'
|
||||
);
|
||||
},
|
||||
|
||||
preventContextMenuHide() {
|
||||
this.contextMenuActive = true;
|
||||
},
|
||||
allowContextMenuHide() {
|
||||
this.contextMenuActive = false;
|
||||
},
|
||||
|
||||
setTriggerZoneActive(active, event) {
|
||||
this.triggerZoneActive = active;
|
||||
},
|
||||
|
||||
showUwWindow(tab) {
|
||||
this.defaultWindowTab = tab; // can be undefined
|
||||
|
||||
this.uwWindowFadeOut = false;
|
||||
this.uwWindowVisible = true;
|
||||
this.uwTriggerZoneVisible = false;
|
||||
this.allowContextMenuHide();
|
||||
|
||||
// refresh DRM status
|
||||
this.eventBus.send('get-drm-status');
|
||||
|
||||
// if (this.isGlobal) {
|
||||
// this.sendToParentLowLevel('uwui-clickable', undefined, {clickable: true});
|
||||
// }
|
||||
},
|
||||
|
||||
hideUwWindow(skipTimeout = false) {
|
||||
if (this.uwWindowFadeOutDisabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
const timeout = skipTimeout ? 0 : 1100;
|
||||
|
||||
this.uwWindowCloseTimeout = setTimeout(
|
||||
() => {
|
||||
this.uwWindowVisible = false;
|
||||
|
||||
// Global UI has some extra housekeeping to do when window gets hidden
|
||||
if (this.isGlobal) {
|
||||
this.sendToParentLowLevel('uwui-global-window-hidden', {});
|
||||
}
|
||||
},
|
||||
timeout
|
||||
);
|
||||
this.uwWindowFadeOut = true;
|
||||
},
|
||||
|
||||
cancelUwWindowHide() {
|
||||
this.uwWindowFadeOut = false;
|
||||
clearTimeout(this.uwWindowCloseTimeout);
|
||||
},
|
||||
|
||||
handleBusTunnelIn(payload) {
|
||||
this.eventBus.send(payload.action, payload.config, payload.routingData);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.ard-blocked {
|
||||
color: rgb(219, 125, 48) !important;
|
||||
background-color: rgba(0,0,0,0.85) !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss" src="./src/res-common/panels.scss" scoped module></style>
|
||||
<style lang="scss" src="./src/res-common/common.scss" scoped module></style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.uw-hover {
|
||||
position: absolute;
|
||||
z-index: 999999999999999999;
|
||||
}
|
||||
|
||||
.reduced-padding {
|
||||
padding: 1rem !important;
|
||||
}
|
||||
|
||||
.uv-hover-trigger-region {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
border: 0.5rem dashed #fff;
|
||||
color: #fff;
|
||||
backdrop-filter: blur(0.5rem) brightness(0.5);
|
||||
}
|
||||
|
||||
.uw-window {
|
||||
position: fixed;
|
||||
|
||||
top: 10%;
|
||||
left: 10%;
|
||||
|
||||
z-index: 999999999999999999;
|
||||
|
||||
width: 2500px;
|
||||
height: 1200px;
|
||||
max-width: 80%;
|
||||
max-height: 80%;
|
||||
|
||||
pointer-events: all !important;
|
||||
|
||||
opacity: 1;
|
||||
backdrop-filter: blur(16px) saturate(120%);
|
||||
|
||||
&.fade-out {
|
||||
opacity: 0;
|
||||
transition: opacity 0.5s;
|
||||
transition-delay: 0.5s;
|
||||
}
|
||||
}
|
||||
|
||||
.gib-bg {
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
backdrop-filter: blur(16px) saturate(120%);
|
||||
|
||||
width: fit-content;
|
||||
block-size: fit-content;
|
||||
}
|
||||
|
||||
|
||||
.context-spawn {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
|
||||
width: 100dvw;
|
||||
height: 100dvh;
|
||||
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-content: center;
|
||||
align-items: center;
|
||||
// width: 100%;
|
||||
// height: 100%;
|
||||
|
||||
color: #fff;
|
||||
|
||||
// .context-item {
|
||||
// font-size: .95rem;
|
||||
// padding: 1rem 1.6rem;
|
||||
// background-color: rgba(0, 0, 0, 0.5);
|
||||
// backdrop-filter: blur(16px) saturate(120%);
|
||||
|
||||
// white-space: nowrap;
|
||||
// }
|
||||
|
||||
// .spawn-container {
|
||||
// border: 1px solid white;
|
||||
// }
|
||||
}
|
||||
|
||||
.extension-status-messages {
|
||||
z-index: 1000;
|
||||
text-transform: uppercase;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
|
||||
width: 112.25%;
|
||||
transform: translate(-12.5%, 12.5%) scale(0.75);
|
||||
|
||||
> * {
|
||||
margin-top: 0.5rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
.flex-reverse-order {
|
||||
display: flex;
|
||||
flex-direction: column-reverse;
|
||||
|
||||
}
|
||||
|
||||
.aard-blocked {
|
||||
color: #fa6;
|
||||
}
|
||||
|
||||
.trigger-zone-preview {
|
||||
border: 4px solid #fa4;
|
||||
}
|
||||
|
||||
.debug-1 {
|
||||
border: 1px solid yellow;
|
||||
|
||||
&:hover {
|
||||
background-color: rbba(255,255,0,0.5);
|
||||
}
|
||||
}
|
||||
.debug-2 {
|
||||
border: 1px solid blue;
|
||||
|
||||
&:hover {
|
||||
background-color: rbba(0,0,255,.5);
|
||||
}
|
||||
}
|
||||
</style>
|
535
src/csui/Popup.vue
Normal file
@ -0,0 +1,535 @@
|
||||
<template>
|
||||
<div class="popup-panel">
|
||||
<!--
|
||||
NOTE — the code that makes ultrawidify popup work in firefox regardless of whether the
|
||||
extension is being displayed in a normal or a small/overflow popup breaks the popup
|
||||
behaviour on Chrome (where the popup would never reach the full width of 800px)
|
||||
|
||||
Since I'm tired and the hour is getting late, we'll just add an extra CSS class for
|
||||
non-firefox builds of this extension and be done with it. No need to complicate things
|
||||
further than that.
|
||||
-->
|
||||
<div v-if="settingsInitialized"
|
||||
class="popup flex flex-col no-overflow"
|
||||
:class="{'popup-chrome': ! BrowserDetect?.firefox}"
|
||||
>
|
||||
<div class="flex-row flex-nogrow flex-noshrink relative header"
|
||||
>
|
||||
<div class="grow shrink">
|
||||
<h1>
|
||||
<span class="smallcaps">Ultrawidify</span>: <small>Quick settings</small>
|
||||
</h1>
|
||||
</div>
|
||||
<div v-if="BrowserDetect?.processEnvChannel !== 'stable'" class="absolute channel-info version-info">
|
||||
Build channel: {{BrowserDetect?.processEnvChannel}} <br/>
|
||||
<label>Version:</label> <br/>
|
||||
{{ settings.getExtensionVersion() }}
|
||||
</div>
|
||||
<div v-else class="version-info">
|
||||
<label>Version:</label> <br/>
|
||||
{{ settings.getExtensionVersion() }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- CONTAINER ROOT -->
|
||||
<div class="flex flex-row body no-overflow flex-grow">
|
||||
|
||||
<!-- TABS -->
|
||||
<div class="flex flex-col tab-row" style="flex: 3 3; border-right: 1px solid #222;">
|
||||
<div
|
||||
v-for="tab of tabs"
|
||||
:key="tab.id"
|
||||
class="tab flex flex-row"
|
||||
:class="{'active': tab.id === selectedTab}"
|
||||
@click="selectTab(tab.id)"
|
||||
>
|
||||
<div class="icon-container">
|
||||
<mdicon
|
||||
:name="tab.icon"
|
||||
:size="32"
|
||||
/>
|
||||
</div>
|
||||
<div class="label">
|
||||
{{tab.label}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- CONTENT -->
|
||||
<div class="scrollable" style="flex: 7 7; padding: 1rem;">
|
||||
<template v-if="settings && siteSettings">
|
||||
<InPlayerUIAdvertisement
|
||||
v-if="selectedTab === 'playerUiCtl'"
|
||||
:eventBus="eventBus"
|
||||
/>
|
||||
<PopupVideoSettings
|
||||
v-if="selectedTab === 'videoSettings'"
|
||||
:settings="settings"
|
||||
:eventBus="eventBus"
|
||||
:siteSettings="siteSettings"
|
||||
></PopupVideoSettings>
|
||||
<!-- <PlayerDetectionPanel
|
||||
v-if="selectedTab === 'playerDetection'"
|
||||
:settings="settings"
|
||||
:eventBus="eventBus"
|
||||
:siteSettings="siteSettings"
|
||||
:site="site.host"
|
||||
>
|
||||
</PlayerDetectionPanel> -->
|
||||
<BaseExtensionSettings
|
||||
v-if="selectedTab === 'extensionSettings'"
|
||||
:settings="settings"
|
||||
:eventBus="eventBus"
|
||||
:siteSettings="siteSettings"
|
||||
:site="site.host"
|
||||
>
|
||||
</BaseExtensionSettings>
|
||||
</template>
|
||||
<template v-else>No settings or site settings found.</template>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BaseExtensionSettings from './src/PlayerUiPanels/BaseExtensionSettings.vue'
|
||||
import PlayerDetectionPanel from './src/PlayerUiPanels/PlayerDetectionPanel.vue'
|
||||
import PopupVideoSettings from './src/popup/panels/PopupVideoSettings.vue'
|
||||
import InPlayerUIAdvertisement from './src/PlayerUiPanels/InPlayerUiAdvertisement.vue';
|
||||
import Debug from '../ext/conf/Debug';
|
||||
import BrowserDetect from '../ext/conf/BrowserDetect';
|
||||
import Comms from '../ext/lib/comms/Comms';
|
||||
import CommsClient, {CommsOrigin} from '../ext/lib/comms/CommsClient';
|
||||
import Settings from '../ext/lib/Settings';
|
||||
import Logger from '../ext/lib/Logger';
|
||||
import EventBus from '../ext/lib/EventBus';
|
||||
import {ChromeShittinessMitigations as CSM} from '../common/js/ChromeShittinessMitigations';
|
||||
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
comms: undefined,
|
||||
eventBus: new EventBus(),
|
||||
settings: {},
|
||||
settingsInitialized: false,
|
||||
narrowPopup: null,
|
||||
sideMenuVisible: null,
|
||||
logger: undefined,
|
||||
site: undefined,
|
||||
siteSettings: undefined,
|
||||
selectedTab: 'playerUiCtl',
|
||||
tabs: [
|
||||
// see this for icons: https://pictogrammers.com/library/mdi/
|
||||
{id: 'playerUiCtl', label: 'In-player UI', icon: 'artboard'},
|
||||
{id: 'videoSettings', label: 'Video settings', icon: 'crop'},
|
||||
// {id: 'playerDetection', label: 'Player detection', icon: 'television-play'},
|
||||
{id: 'extensionSettings', label: 'Site and Extension options', icon: 'cogs' },
|
||||
],
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.logger = new Logger();
|
||||
await this.logger.init({
|
||||
allowLogging: true,
|
||||
});
|
||||
|
||||
this.settings = new Settings({afterSettingsSaved: () => this.updateConfig(), logger: this.logger});
|
||||
await this.settings.init();
|
||||
this.settingsInitialized = true;
|
||||
|
||||
// const port = chrome.runtime.connect({name: 'popup-port'});
|
||||
// port.onMessage.addListener( (m,p) => this.processReceivedMessage(m,p));
|
||||
// CSM.setProperty('port', port);
|
||||
|
||||
this.eventBus = new EventBus();
|
||||
this.eventBus.subscribe(
|
||||
'set-current-site',
|
||||
{
|
||||
function: (config, context) => {
|
||||
if (this.site) {
|
||||
if (!this.site.host) {
|
||||
// dunno why this fix is needed, but sometimes it is
|
||||
this.site.host = config.site.host;
|
||||
}
|
||||
}
|
||||
this.site = config.site;
|
||||
// this.selectedSite = this.selectedSite || config.site.host;
|
||||
this.siteSettings = this.settings.getSiteSettings(this.site.host);
|
||||
|
||||
this.eventBus.setupPopupTunnelWorkaround({
|
||||
origin: CommsOrigin.Popup,
|
||||
comms: {
|
||||
forwardTo: 'active'
|
||||
}
|
||||
});
|
||||
|
||||
this.loadFrames(this.site);
|
||||
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
this.comms = new CommsClient('popup-port', this.logger, this.eventBus);
|
||||
this.eventBus.setComms(this.comms);
|
||||
this.eventBus.setupPopupTunnelWorkaround({
|
||||
origin: CommsOrigin.Popup,
|
||||
comms: {forwardTo: 'active'}
|
||||
});
|
||||
|
||||
|
||||
// ensure we'll clean player markings on popup close
|
||||
window.addEventListener("unload", () => {
|
||||
CSM.port.postMessage({
|
||||
cmd: 'unmark-player',
|
||||
forwardToAll: true,
|
||||
});
|
||||
// if (BrowserDetect.anyChromium) {
|
||||
// chrome.extension.getBackgroundPage().sendUnmarkPlayer({
|
||||
// cmd: 'unmark-player',
|
||||
// forwardToAll: true,
|
||||
// });
|
||||
// }
|
||||
});
|
||||
|
||||
// get info about current site from background script
|
||||
while (true) {
|
||||
this.requestSite();
|
||||
await this.sleep(5000);
|
||||
}
|
||||
},
|
||||
async updated() {
|
||||
const body = document.getElementsByTagName('body')[0];
|
||||
|
||||
// ensure that narrowPopup only gets set the first time the popup renders
|
||||
// if popup was rendered before, we don't do anything because otherwise
|
||||
// we'll be causing an unwanted re-render
|
||||
//
|
||||
// another thing worth noting — the popup gets first initialized with
|
||||
// offsetWidth set to 0. This means proper popup will be displayed as a
|
||||
// mini popup if we don't check for that.
|
||||
if (this.narrowPopup === null && body.offsetWidth > 0) {
|
||||
this.narrowPopup = body.offsetWidth < 600;
|
||||
}
|
||||
},
|
||||
components: {
|
||||
Debug,
|
||||
BrowserDetect,
|
||||
PopupVideoSettings, PlayerDetectionPanel, BaseExtensionSettings, InPlayerUIAdvertisement
|
||||
},
|
||||
methods: {
|
||||
async sleep(t) {
|
||||
return new Promise( (resolve,reject) => {
|
||||
setTimeout(() => resolve(), t);
|
||||
});
|
||||
},
|
||||
toObject(obj) {
|
||||
return JSON.parse(JSON.stringify(obj));
|
||||
},
|
||||
requestSite() {
|
||||
try {
|
||||
this.logger.log('info','popup', '[popup::getSite] Requesting current site ...')
|
||||
// CSM.port.postMessage({command: 'get-current-site'});
|
||||
this.eventBus.send(
|
||||
'get-current-site',
|
||||
{
|
||||
comms: {forwardTo: 'active'}
|
||||
}
|
||||
);
|
||||
} catch (e) {
|
||||
this.logger.log('error','popup','[popup::getSite] sending get-current-site failed for some reason. Reason:', e);
|
||||
}
|
||||
},
|
||||
getRandomColor() {
|
||||
return `rgb(${Math.floor(Math.random() * 128)}, ${Math.floor(Math.random() * 128)}, ${Math.floor(Math.random() * 128)})`;
|
||||
},
|
||||
selectTab(tab) {
|
||||
this.selectedTab = tab;
|
||||
},
|
||||
processReceivedMessage(message, port) {
|
||||
this.logger.log('info', 'popup', '[popup::processReceivedMessage] received message:', message)
|
||||
|
||||
if (message.command === 'set-current-site'){
|
||||
if (this.site) {
|
||||
if (!this.site.host) {
|
||||
// dunno why this fix is needed, but sometimes it is
|
||||
this.site.host = site.tabHostname;
|
||||
}
|
||||
}
|
||||
this.site = message.site;
|
||||
|
||||
// update activeSites
|
||||
// this.activeSites = this.activeSites.filter(x => x.host !== message.site);
|
||||
|
||||
// add current site
|
||||
// this.activeSites = unshift({
|
||||
// host: message.site.host,
|
||||
// isIFrame: false, // currently unused
|
||||
// });
|
||||
this.selectedSite = this.selectedSite || message.site.host;
|
||||
|
||||
this.loadFrames(this.site);
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
isDefaultFrame(frameId) {
|
||||
return frameId === '__playing' || frameId === '__all';
|
||||
},
|
||||
loadFrames() {
|
||||
this.activeSites = [{
|
||||
host: this.site.host,
|
||||
isIFrame: false, // not used tho. Maybe one day
|
||||
}];
|
||||
this.selectedSite = this.selectedSite || this.site.host;
|
||||
|
||||
// for (const frame in videoTab.frames) {
|
||||
// this.activeFrames.push({
|
||||
// id: `${this.site.id}-${frame}`,
|
||||
// label: videoTab.frames[frame].host,
|
||||
// ...this.frameStore[frame],
|
||||
// })
|
||||
|
||||
// // only add each host once at most
|
||||
// if (!this.activeSites.find(x => x.host === videoTab.frames[frame].host)) {
|
||||
// this.activeSites.push({
|
||||
// host: videoTab.frames[frame].host,
|
||||
// isIFrame: undefined // maybe one day
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
// update whether video tab can be shown
|
||||
// this.updateCanShowVideoTab();
|
||||
},
|
||||
getRandomColor() {
|
||||
return `rgb(${Math.floor(Math.random() * 128)}, ${Math.floor(Math.random() * 128)}, ${Math.floor(Math.random() * 128)})`;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
// @import 'res/css/uwui-base.scss';
|
||||
@import 'res/css/colors.scss';
|
||||
@import 'res/css/font/overpass.css';
|
||||
@import 'res/css/font/overpass-mono.css';
|
||||
@import 'res/css/common.scss';
|
||||
@import './src/res-common/_variables';
|
||||
|
||||
.header {
|
||||
background-color: rgb(90, 28, 13);
|
||||
color: #fff;
|
||||
padding: 8px;
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
|
||||
|
||||
h1 {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
.version-info {
|
||||
text-align: right;
|
||||
font-size: 0.8rem;
|
||||
opacity: 0.8;
|
||||
label {
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.site-support-info {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
.site-support-site {
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
.site-support {
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
margin-left: 1rem;
|
||||
border-radius: 8px;
|
||||
padding: 0rem 1.5rem 0rem 1rem;
|
||||
|
||||
position: relative;
|
||||
|
||||
.tooltip {
|
||||
padding: 1rem;
|
||||
display: none;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
transform: translateY(110%);
|
||||
width: 42em;
|
||||
|
||||
background-color: rgba(0,0,0,0.90);
|
||||
color: #ccc;
|
||||
}
|
||||
&:hover {
|
||||
.tooltip {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.mdi {
|
||||
margin-right: 1rem;
|
||||
}
|
||||
|
||||
&.official {
|
||||
background-color: #fa6;
|
||||
color: #000;
|
||||
|
||||
.mdi {
|
||||
fill: #000 !important;
|
||||
}
|
||||
}
|
||||
|
||||
&.community {
|
||||
background-color: rgb(85, 85, 179);
|
||||
color: #fff;
|
||||
|
||||
.mdi {
|
||||
fill: #fff !important;
|
||||
}
|
||||
}
|
||||
|
||||
&.no-support {
|
||||
background-color: rgb(138, 65, 126);
|
||||
color: #eee;
|
||||
|
||||
.mdi {
|
||||
fill: #eee !important;
|
||||
}
|
||||
}
|
||||
|
||||
&.user-added {
|
||||
border: 1px solid #ff0;
|
||||
|
||||
color: #ff0;
|
||||
|
||||
.mdi {
|
||||
fill: #ff0 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
flex-grow: 1;
|
||||
|
||||
.warning-area {
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.panel-content {
|
||||
flex-grow: 1;
|
||||
flex-shrink: 1;
|
||||
|
||||
overflow-y: auto;
|
||||
padding: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.warning-box {
|
||||
background: rgb(255, 174, 107);
|
||||
color: #000;
|
||||
margin: 1rem;
|
||||
padding: 1rem;
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
.icon-container {
|
||||
margin-right: 1rem;
|
||||
flex-shrink: 0;
|
||||
flex-grow: 0;
|
||||
}
|
||||
|
||||
a {
|
||||
color: rgba(0,0,0,0.7);
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.popup-panel {
|
||||
background-color: rgba(0,0,0,0.50);
|
||||
color: #fff;
|
||||
|
||||
overflow-y: auto;
|
||||
|
||||
.popup-window-header {
|
||||
padding: 1rem;
|
||||
background-color: rgba(5,5,5, 0.75);
|
||||
}
|
||||
.tab-row {
|
||||
background-color: rgba(11,11,11, 0.75);
|
||||
|
||||
.tab {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
padding: 1rem;
|
||||
font-size: 1.25rem;
|
||||
// height: rem;
|
||||
min-height: 3rem;
|
||||
|
||||
border-bottom: 1px solid rgba(128, 128, 128, 0.5);
|
||||
border-top: 1px solid rgba(128, 128, 128, 0.5);
|
||||
opacity: 0.5;
|
||||
|
||||
&:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
&.active {
|
||||
opacity: 1.0;
|
||||
background-color: $primaryBg;
|
||||
color: rgb(255, 174, 107);
|
||||
border-bottom: 1px solid rgba(116, 78, 47, 0.5);
|
||||
border-top: 1px solid rgba(116, 78, 47, 0.5);
|
||||
}
|
||||
|
||||
.icon-container {
|
||||
width: 64px;
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.label {
|
||||
flex-grow: 1;
|
||||
flex-shrink: 1;
|
||||
padding: 0 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.popup-title, .popup-title h1 {
|
||||
font-size: 48px !important;
|
||||
}
|
||||
}
|
||||
|
||||
pre {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.button {
|
||||
border: 1px solid #222 !important;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin: 0; padding: 0; font-weight: 400; font-size:24px;
|
||||
}
|
||||
</style>
|
16
src/csui/csui-global.html
Normal file
@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en"; style="position: relative">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="color-scheme" content="light dark">
|
||||
<title>Ultrawidify - Content Script User Interface (global overlay)</title>
|
||||
<!-- <link rel="stylesheet" href="csui.css"> -->
|
||||
<% if (NODE_ENV === 'development') { %>
|
||||
<!-- Load some resources only in development environment -->
|
||||
<% } %>
|
||||
</head>
|
||||
<body class="uw-ultrawidify-container-root">
|
||||
<div id="app"></div>
|
||||
<script src="csui-global.js"></script>
|
||||
</body>
|
||||
</html>
|
11
src/csui/csui-global.js
Normal file
@ -0,0 +1,11 @@
|
||||
import { createApp } from 'vue';
|
||||
import GlobalFrame from './GlobalFrame';
|
||||
import mdiVue from 'mdi-vue/v3';
|
||||
import * as mdijs from '@mdi/js';
|
||||
|
||||
// NOTE — this is in-player interface for ultrawidify
|
||||
// it is injected into the page in UI.init()
|
||||
|
||||
createApp(GlobalFrame)
|
||||
.use(mdiVue, {icons: mdijs})
|
||||
.mount('#app');
|
13
src/csui/csui-overlay-dark.html
Normal file
@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" style="position: relative">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="color-scheme" content="dark">
|
||||
<title>Ultrawidify - Content Script User Interface (in-player overlay)</title>
|
||||
<!-- <link rel="stylesheet" href="csui.css"> -->
|
||||
</head>
|
||||
<body class="uw-ultrawidify-container-root" style="background-color: transparent;">
|
||||
<div id="app"></div>
|
||||
<script src="csui.js"></script>
|
||||
</body>
|
||||
</html>
|
13
src/csui/csui-overlay-light.html
Normal file
@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" style="position: relative">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="color-scheme" content="light">
|
||||
<title>Ultrawidify - Content Script User Interface (in-player overlay)</title>
|
||||
<!-- <link rel="stylesheet" href="csui.css"> -->
|
||||
</head>
|
||||
<body class="uw-ultrawidify-container-root" style="background-color: transparent;">
|
||||
<div id="app"></div>
|
||||
<script src="csui.js"></script>
|
||||
</body>
|
||||
</html>
|
12
src/csui/csui-overlay-normal.html
Normal file
@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" style="position: relative">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Ultrawidify - Content Script User Interface (in-player overlay)</title>
|
||||
<!-- <link rel="stylesheet" href="csui.css"> -->
|
||||
</head>
|
||||
<body class="uw-ultrawidify-container-root" style="background-color: transparent;">
|
||||
<div id="app"></div>
|
||||
<script src="csui.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -1,18 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<html lang="en" style="position: relative">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
<link rel="stylesheet" href="popup.css">
|
||||
<!-- <link rel="stylesheet" href="popup.css"> -->
|
||||
|
||||
<% if (NODE_ENV === 'development') { %>
|
||||
<!-- Load some resources only in development environment -->
|
||||
<% } %>
|
||||
</head>
|
||||
<body style="width: 800px; height: 600px; overflow: hidden !important">
|
||||
<body
|
||||
style="width: 100%; height: 100%; overflow-x: hidden; min-width: 750px"
|
||||
>
|
||||
<div id="app">
|
||||
|
||||
</div>
|
||||
<script src="popup.js"></script>
|
||||
<script src="csui-popup.js"></script>
|
||||
</body>
|
||||
</html>
|
8
src/csui/csui-popup.js
Normal file
@ -0,0 +1,8 @@
|
||||
import { createApp } from 'vue'
|
||||
import Popup from './Popup';
|
||||
import mdiVue from 'mdi-vue/v3';
|
||||
import * as mdijs from '@mdi/js';
|
||||
|
||||
createApp(Popup)
|
||||
.use(mdiVue, {icons: mdijs})
|
||||
.mount('#app');
|
11
src/csui/csui.js
Normal file
@ -0,0 +1,11 @@
|
||||
import { createApp } from 'vue';
|
||||
import PlayerOverlay from './PlayerOverlay';
|
||||
import mdiVue from 'mdi-vue/v3';
|
||||
import * as mdijs from '@mdi/js';
|
||||
|
||||
// NOTE — this is in-player interface for ultrawidify
|
||||
// it is injected into the page in UI.init()
|
||||
|
||||
createApp(PlayerOverlay)
|
||||
.use(mdiVue, {icons: mdijs})
|
||||
.mount('#app');
|
@ -1,6 +1,8 @@
|
||||
@import "colors.scss";
|
||||
@import "fonts.scss";
|
||||
@import "flex.scss";
|
||||
// @import "~/@mdi/font/css/materialdesignicons.css";
|
||||
|
||||
// @import "form.scss";
|
||||
|
||||
body {
|
||||
@ -17,12 +19,11 @@ body {
|
||||
}
|
||||
|
||||
/* STANDARD WIDTHS AND HEIGHTS */
|
||||
|
||||
.w100 {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.h100 {
|
||||
.h100, .h-full {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
@ -235,9 +236,11 @@ small {
|
||||
margin-bottom: 3px;
|
||||
color: $text-dim;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
user-select: none;;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.selected, .setting-selected {
|
||||
color: $selected-color !important;
|
||||
background-color: $background-selected !important;
|
||||
@ -256,10 +259,6 @@ small {
|
||||
background-color: lighten($background-selected, 10%);
|
||||
}
|
||||
|
||||
.button {
|
||||
cursor: pointer !important;
|
||||
}
|
||||
|
||||
.disabled {
|
||||
pointer-events: none;
|
||||
/* color: #666; */
|
||||
@ -268,7 +267,7 @@ small {
|
||||
|
||||
.disabled-button {
|
||||
color: #666 !important;
|
||||
cursor: not-allowed !important;
|
||||
cursor: not-allowed !important;
|
||||
}
|
||||
|
||||
.disabled-button:hover {
|
||||
@ -359,17 +358,17 @@ small {
|
||||
margin-top: -4px;
|
||||
}
|
||||
.experimental:hover::after {
|
||||
content: "Ⓔ Experimental";
|
||||
content: "Ⓔ Experimental";
|
||||
// content: "";
|
||||
color: #ffde12;
|
||||
color: #ffde12;
|
||||
// background-color: #1f1f1f;
|
||||
display: inline-block;
|
||||
font-size: .75em;
|
||||
font-variant: small-caps;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
margin-left: 10px;
|
||||
margin-top: -4px;
|
||||
display: inline-block;
|
||||
font-size: .75em;
|
||||
font-variant: small-caps;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
margin-left: 10px;
|
||||
margin-top: -4px;
|
||||
}
|
||||
|
||||
.sticky-bottom {
|
||||
@ -390,3 +389,8 @@ small {
|
||||
.monospace {
|
||||
font-family: 'Overpass Mono';
|
||||
}
|
||||
|
||||
.pointer {
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
@ -6,7 +6,7 @@
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.flex-column {
|
||||
.flex-col {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
@ -48,4 +48,4 @@
|
||||
|
||||
.flex-self-center {
|
||||
align-self: center;
|
||||
}
|
||||
}
|
@ -1,111 +1,111 @@
|
||||
@font-face {
|
||||
font-family: 'Overpass';
|
||||
src: url('/res/fonts/overpass-webfont/overpass-thin.woff2') format('woff2'); /* Super Modern Browsers */
|
||||
src: url('/csui/res/fonts/overpass-webfont/overpass-thin.woff2') format('woff2'); /* Super Modern Browsers */
|
||||
font-weight: 200;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Overpass';
|
||||
src: url('/res/fonts/overpass-webfont/overpass-thin-italic.woff2') format('woff2');
|
||||
src: url('/csui/res/fonts/overpass-webfont/overpass-thin-italic.woff2') format('woff2');
|
||||
font-weight: 200;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Overpass';
|
||||
src: url('/res/fonts/overpass-webfont/overpass-extralight.woff2') format('woff2');
|
||||
src: url('/csui/res/fonts/overpass-webfont/overpass-extralight.woff2') format('woff2');
|
||||
font-weight: 300;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Overpass';
|
||||
src: url('/res/fonts/overpass-webfont/overpass-extralight-italic.woff2') format('woff2');
|
||||
src: url('/csui/res/fonts/overpass-webfont/overpass-extralight-italic.woff2') format('woff2');
|
||||
font-weight: 300;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Overpass';
|
||||
src: url('/res/fonts/overpass-webfont/overpass-light.woff2') format('woff2');
|
||||
src: url('/csui/res/fonts/overpass-webfont/overpass-light.woff2') format('woff2');
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Overpass';
|
||||
src: url('/res/fonts/overpass-webfont/overpass-light-italic.woff2') format('woff2');
|
||||
src: url('/csui/res/fonts/overpass-webfont/overpass-light-italic.woff2') format('woff2');
|
||||
font-weight: 400;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Overpass';
|
||||
src: url('/res/fonts/overpass-webfont/overpass-regular.woff2') format('woff2');
|
||||
src: url('/csui/res/fonts/overpass-webfont/overpass-regular.woff2') format('woff2');
|
||||
font-weight: 500;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Overpass';
|
||||
src: url('/res/fonts/overpass-webfont/overpass-italic.woff2') format('woff2');
|
||||
src: url('/csui/res/fonts/overpass-webfont/overpass-italic.woff2') format('woff2');
|
||||
font-weight: 500;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Overpass';
|
||||
src: url('/res/fonts/overpass-webfont/overpass-semibold.woff2') format('woff2');
|
||||
src: url('/csui/res/fonts/overpass-webfont/overpass-semibold.woff2') format('woff2');
|
||||
font-weight: 600;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Overpass';
|
||||
src: url('/res/fonts/overpass-webfont/overpass-semibold-italic.woff2') format('woff2');
|
||||
src: url('/csui/res/fonts/overpass-webfont/overpass-semibold-italic.woff2') format('woff2');
|
||||
font-weight: 600;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Overpass';
|
||||
src: url('/res/fonts/overpass-webfont/overpass-bold.woff2') format('woff2');
|
||||
src: url('/csui/res/fonts/overpass-webfont/overpass-bold.woff2') format('woff2');
|
||||
font-weight: 700;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Overpass';
|
||||
src: url('/res/fonts/overpass-webfont/overpass-bold-italic.woff2') format('woff2');
|
||||
src: url('/csui/res/fonts/overpass-webfont/overpass-bold-italic.woff2') format('woff2');
|
||||
font-weight: 700;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Overpass mono';
|
||||
src: url('/res/fonts/overpass-mono-webfont/overpass-mono-light.woff2') format('woff2');
|
||||
src: url('/csui/res/fonts/overpass-mono-webfont/overpass-mono-light.woff2') format('woff2');
|
||||
font-weight: 300;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Overpass mono';
|
||||
src: url('/res/fonts/overpass-mono-webfont/overpass-mono-regular.woff2') format('woff2');
|
||||
src: url('/csui/res/fonts/overpass-mono-webfont/overpass-mono-regular.woff2') format('woff2');
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Overpass mono';
|
||||
src: url('/res/fonts/overpass-mono-webfont/overpass-mono-semibold.woff2') format('woff2');
|
||||
src: url('/csui/res/fonts/overpass-mono-webfont/overpass-mono-semibold.woff2') format('woff2');
|
||||
font-weight: 500;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Overpass mono';
|
||||
src: url('/res/fonts/overpass-mono-webfont/overpass-mono-bold.woff2') format('woff2');
|
||||
src: url('/csui/res/fonts/overpass-mono-webfont/overpass-mono-bold.woff2') format('woff2');
|
||||
font-weight: 600;
|
||||
font-style: normal;
|
||||
}
|
26653
src/csui/res/css/mdi.scss
Normal file
35
src/csui/res/css/uwui-base.scss
Normal file
@ -0,0 +1,35 @@
|
||||
@import 'flex.scss';
|
||||
@import 'colors.scss';
|
||||
@import 'common.scss';
|
||||
|
||||
* {
|
||||
font-family: 'Overpass';
|
||||
}
|
||||
|
||||
.uw-ultrawidify-container-root {
|
||||
// here's the defaults:
|
||||
// all: initial;
|
||||
// * {
|
||||
// all: unset;
|
||||
// }
|
||||
|
||||
// here's things that we don't want as defaults
|
||||
// (must come after the all: declaration, otherwise
|
||||
// all: declaration overrides everything.)
|
||||
|
||||
// we put our UI _over_ site's player:
|
||||
z-index: 999999;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: none transparent !important;
|
||||
|
||||
// Ensure we're display:block
|
||||
display: block;
|
||||
|
||||
// we are click-through by default:
|
||||
pointer-events: none;
|
||||
}
|
||||
|
BIN
src/csui/res/fonts/materialdesignicons-webfont.woff2
Normal file
BIN
src/csui/res/icons/ms-promo-tile.png
Normal file
After Width: | Height: | Size: 88 KiB |
BIN
src/csui/res/icons/uw-128.png
Normal file
After Width: | Height: | Size: 9.7 KiB |
BIN
src/csui/res/icons/uw-32.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
src/csui/res/icons/uw-64.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
src/csui/res/icons/uw-microsoft-store-icon.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
src/csui/res/icons/uw-webstore-icon.png
Normal file
After Width: | Height: | Size: 6.7 KiB |
BIN
src/csui/res/img/grid_512.webp
Normal file
After Width: | Height: | Size: 273 KiB |
BIN
src/csui/res/img/settings/bg_random2.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
415
src/csui/src/PlayerUIWindow.vue
Normal file
@ -0,0 +1,415 @@
|
||||
<template>
|
||||
<div
|
||||
class="popup-panel flex flex-col uw-clickable h-full"
|
||||
>
|
||||
<div class="popup-window-header">
|
||||
<div class="header-title">
|
||||
<div class="popup-title">Ultrawidify <small>{{settings?.active?.version}} - {{BrowserDetect.processEnvChannel}}</small></div>
|
||||
<div class="site-support-info flex flex-row">
|
||||
<div class="site-support-site">{{site}}</div>
|
||||
<SupportLevelIndicator
|
||||
v-if="inPlayer"
|
||||
:siteSupportLevel="siteSupportLevel"
|
||||
>
|
||||
</SupportLevelIndicator>
|
||||
</div>
|
||||
</div>
|
||||
<div class="header-buttons">
|
||||
<div
|
||||
class="header-button close-button"
|
||||
@click="$emit('close')"
|
||||
>
|
||||
<mdicon name="close" :size="36"></mdicon>
|
||||
</div>
|
||||
<!-- <a >{{preventClose ? 'allow auto-close' : 'prevent auto-close'}}</a> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-main flex flex-row">
|
||||
<div class="tab-row flex flex-col grow-0 shrink-0">
|
||||
<div
|
||||
v-for="tab of tabs"
|
||||
:key="tab.id"
|
||||
class="tab"
|
||||
:class="{
|
||||
'active': tab.id === selectedTab,
|
||||
'highlight-tab': tab.highlight,
|
||||
}"
|
||||
@click="selectTab(tab.id)"
|
||||
>
|
||||
<div class="icon-container">
|
||||
<mdicon
|
||||
v-if="tab.icon"
|
||||
:name="tab.icon"
|
||||
:size="32"
|
||||
/>
|
||||
</div>
|
||||
<div class="label">
|
||||
{{tab.label}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content flex flex-col">
|
||||
<!-- autodetection warning -->
|
||||
|
||||
<div class="warning-area">
|
||||
<div
|
||||
v-if="statusFlags.hasDrm"
|
||||
class="warning-box"
|
||||
>
|
||||
<div class="icon-container">
|
||||
<mdicon name="alert" :size="32" />
|
||||
</div>
|
||||
<div>
|
||||
This site is blocking automatic aspect ratio detection. You will have to adjust aspect ratio manually.<br/>
|
||||
<a>Learn more ...</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row panel-content">
|
||||
<!-- Panel section -->
|
||||
<!-- <VideoSettings
|
||||
v-if="selectedTab === 'videoSettings'"
|
||||
:settings="settings"
|
||||
:siteSettings="siteSettings"
|
||||
:eventBus="eventBus"
|
||||
:site="site"
|
||||
></VideoSettings> -->
|
||||
<PlayerDetectionPanel
|
||||
v-if="selectedTab === 'playerDetection'"
|
||||
:siteSettings="siteSettings"
|
||||
:eventBus="eventBus"
|
||||
:site="site"
|
||||
>
|
||||
</PlayerDetectionPanel>
|
||||
<PlayerUiSettings
|
||||
v-if="selectedTab === 'playerUiSettings'"
|
||||
:settings="settings"
|
||||
:eventBus="eventBus"
|
||||
>
|
||||
</PlayerUiSettings>
|
||||
<BaseExtensionSettings
|
||||
v-if="selectedTab === 'extensionSettings'"
|
||||
:settings="settings"
|
||||
:siteSettings="siteSettings"
|
||||
:site="site"
|
||||
></BaseExtensionSettings>
|
||||
<AutodetectionSettingsPanel
|
||||
v-if="selectedTab === 'autodetectionSettings'"
|
||||
:settings="settings"
|
||||
:siteSettings="siteSettings"
|
||||
:eventBus="eventBus"
|
||||
:site="site"
|
||||
>
|
||||
</AutodetectionSettingsPanel>
|
||||
<DebugPanel
|
||||
v-if="selectedTab === 'debugging'"
|
||||
:settings="settings"
|
||||
:eventBus="eventBus"
|
||||
:site="site"
|
||||
></DebugPanel>
|
||||
<ChangelogPanel
|
||||
v-if="selectedTab === 'changelog'"
|
||||
:settings="settings"
|
||||
></ChangelogPanel>
|
||||
<AboutPanel
|
||||
v-if="selectedTab === 'about'"
|
||||
>
|
||||
</AboutPanel>
|
||||
<!-- <ResetBackupPanel
|
||||
v-if="selectedTab === 'resetBackup'"
|
||||
:settings="settings"
|
||||
>
|
||||
</ResetBackupPanel> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import DebugPanel from './PlayerUiPanels/DebugPanel.vue'
|
||||
import AutodetectionSettingsPanel from './PlayerUiPanels/AutodetectionSettingsPanel.vue'
|
||||
import BaseExtensionSettings from './PlayerUiPanels/BaseExtensionSettings.vue'
|
||||
import PlayerDetectionPanel from './PlayerUiPanels/PlayerDetectionPanel.vue'
|
||||
import VideoSettings from './PlayerUiPanels/VideoSettings.vue'
|
||||
import BrowserDetect from '../../ext/conf/BrowserDetect'
|
||||
import ChangelogPanel from './PlayerUiPanels/ChangelogPanel.vue'
|
||||
import AboutPanel from './PlayerUiPanels/AboutPanel.vue'
|
||||
import PlayerUiSettings from './PlayerUiPanels/PlayerUiSettings.vue'
|
||||
import ResetBackupPanel from './PlayerUiPanels/ResetBackupPanel.vue'
|
||||
|
||||
import SupportLevelIndicator from './components/SupportLevelIndicator.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
VideoSettings,
|
||||
PlayerDetectionPanel,
|
||||
BaseExtensionSettings,
|
||||
AutodetectionSettingsPanel,
|
||||
DebugPanel,
|
||||
PlayerUiSettings,
|
||||
ChangelogPanel,
|
||||
AboutPanel,
|
||||
SupportLevelIndicator,
|
||||
ResetBackupPanel,
|
||||
},
|
||||
mixins: [],
|
||||
data() {
|
||||
return {
|
||||
statusFlags: {
|
||||
hasDrm: undefined,
|
||||
},
|
||||
|
||||
tabs: [
|
||||
// {id: 'videoSettings', label: 'Video settings', icon: 'crop'},
|
||||
{id: 'extensionSettings', label: 'Site and Extension options', icon: 'cogs' },
|
||||
{id: 'playerUiSettings', label: 'UI and keyboard', icon: 'movie-cog-outline' },
|
||||
{id: 'playerDetection', label: 'Player detection', icon: 'television-play'},
|
||||
{id: 'autodetectionSettings', label: 'Autodetection options', icon: 'auto-fix'},
|
||||
// {id: 'advancedOptions', label: 'Advanced options', icon: 'cogs' },
|
||||
// {id: 'debugging', label: 'Debugging', icon: 'bug-outline' }
|
||||
{id: 'changelog', label: 'What\'s new', icon: 'alert-decagram' },
|
||||
{id: 'about', label: 'About', icon: 'information-outline'},
|
||||
// {id: 'resetBackup', label: 'Reset and backup', icon: 'file-restore-outline'},
|
||||
],
|
||||
selectedTab: 'extensionSettings',
|
||||
BrowserDetect: BrowserDetect,
|
||||
preventClose: false,
|
||||
siteSettings: null,
|
||||
}
|
||||
},
|
||||
props: [
|
||||
'settings',
|
||||
'eventBus',
|
||||
'logger',
|
||||
'in-player',
|
||||
'site',
|
||||
'defaultTab'
|
||||
],
|
||||
computed: {
|
||||
// LPT: NO ARROW FUNCTIONS IN COMPUTED,
|
||||
// IS SUPER HARAM
|
||||
// THINGS WILL NOT WORK IF YOU USE ARROWS
|
||||
siteSupportLevel() {
|
||||
return (this.site && this.siteSettings) ? this.siteSettings.data.type || 'no-support' : 'waiting';
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.defaultTab) {
|
||||
this.selectedTab = this.defaultTab;
|
||||
}
|
||||
this.siteSettings = this.settings.getSiteSettings(this.site);
|
||||
this.tabs.find(x => x.id === 'changelog').highlight = !this.settings.active.whatsNewChecked;
|
||||
|
||||
this.eventBus.subscribe(
|
||||
'uw-show-ui',
|
||||
() => {
|
||||
if (this.inPlayer) {
|
||||
return; // show-ui is only intended for global overlay
|
||||
}
|
||||
}
|
||||
)
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* Gets URL of the browser settings page (i think?)
|
||||
*/
|
||||
getUrl(url) {
|
||||
return BrowserDetect.getURL(url);
|
||||
},
|
||||
selectTab(tab) {
|
||||
this.selectedTab = tab;
|
||||
},
|
||||
setPreventClose(bool) {
|
||||
this.preventClose = bool;
|
||||
this.$emit('preventClose', bool);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import '../res/css/uwui-base.scss';
|
||||
@import '../res/css/colors.scss';
|
||||
@import '../res/css/font/overpass.css';
|
||||
@import '../res/css/font/overpass-mono.css';
|
||||
@import '../res/css/common.scss';
|
||||
@import '../src/res-common/_variables';
|
||||
|
||||
// .relative-wrapper {
|
||||
// position: relative;
|
||||
// width: 100%;
|
||||
// height: 100%;
|
||||
// }
|
||||
|
||||
.tab-row {
|
||||
width: 22rem;
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.tab-main {
|
||||
flex-grow: 1;
|
||||
flex-shrink: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.content {
|
||||
flex-grow: 1;
|
||||
|
||||
.warning-area {
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.panel-content {
|
||||
flex-grow: 1;
|
||||
flex-shrink: 1;
|
||||
|
||||
overflow-y: auto;
|
||||
padding: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.warning-box {
|
||||
background: rgb(255, 174, 107);
|
||||
color: #000;
|
||||
margin: 1rem;
|
||||
padding: 1rem;
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
.icon-container {
|
||||
margin-right: 1rem;
|
||||
flex-shrink: 0;
|
||||
flex-grow: 0;
|
||||
}
|
||||
|
||||
a {
|
||||
color: rgba(0,0,0,0.7);
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.site-support-info {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: bottom;
|
||||
|
||||
.site-support-site {
|
||||
font-size: 1.5em;
|
||||
}
|
||||
}
|
||||
|
||||
.popup-panel {
|
||||
background-color: rgba(0,0,0,0.50);
|
||||
color: #fff;
|
||||
|
||||
overflow-y: auto;
|
||||
|
||||
.popup-window-header {
|
||||
padding: 1rem;
|
||||
background-color: rgba(5,5,5, 0.75);
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
.header-title {
|
||||
flex: 1 1;
|
||||
}
|
||||
.header-buttons {
|
||||
flex: 0 0;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
.header-button {
|
||||
cursor: pointer;
|
||||
border-radius: 50%;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
&.button-active {
|
||||
background-color: #fa6;
|
||||
color: #000;
|
||||
|
||||
&:hover {
|
||||
color: #ccc;
|
||||
}
|
||||
}
|
||||
|
||||
&.close-button {
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
color: #fa6;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.tab-row {
|
||||
background-color: rgba(11,11,11, 0.75);
|
||||
|
||||
.tab {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
padding: 2rem;
|
||||
font-size: 1.5rem;
|
||||
height: 4rem;
|
||||
|
||||
border-bottom: 1px solid rgba(128, 128, 128, 0.5);
|
||||
border-top: 1px solid rgba(128, 128, 128, 0.5);
|
||||
opacity: 0.5;
|
||||
|
||||
&:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
&.active {
|
||||
opacity: 1.0;
|
||||
background-color: $primaryBg;
|
||||
color: rgb(255, 174, 107);
|
||||
border-bottom: 1px solid rgba(116, 78, 47, 0.5);
|
||||
border-top: 1px solid rgba(116, 78, 47, 0.5);
|
||||
}
|
||||
|
||||
.icon-container {
|
||||
width: 64px;
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.label {
|
||||
flex-grow: 1;
|
||||
flex-shrink: 1;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
&.highlight-tab {
|
||||
opacity: 0.9;
|
||||
color: #eee;
|
||||
|
||||
// .label {
|
||||
// color: rgb(239, 192, 152);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.popup-title, .popup-title h1 {
|
||||
font-size: 48px !important;
|
||||
}
|
||||
}
|
||||
|
||||
pre {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
122
src/csui/src/PlayerUiPanels/AboutPanel.vue
Normal file
@ -0,0 +1,122 @@
|
||||
<template>
|
||||
<div class="flex flex-col w-full h-full gap-2">
|
||||
<h1>About Ultrawidify</h1>
|
||||
<p>
|
||||
Ultrawidify version: <b>{{addonVersion}}</b><br>
|
||||
Install source: <b>{{addonSource}}</b>
|
||||
</p>
|
||||
|
||||
<div class="flex flex-row gap-2 bg-black">
|
||||
<div class="w-[1/2]" style="width: 50%">
|
||||
<h2>Report a problem</h2>
|
||||
<p>
|
||||
You may report <strike>undocumented features</strike> bugs using one of the following options (in order of preference):
|
||||
</p>
|
||||
<ul>
|
||||
<li> <a target="_blank" href="https://github.com/tamius-han/ultrawidify/issues"><b>Github (preferred)</b></a><br/></li>
|
||||
<li>Email: <a target="_blank" :href="mailtoLink">tamius.han@gmail.com</a></li>
|
||||
</ul>
|
||||
<p>
|
||||
When reporting bugs, please include the following information:
|
||||
</p>
|
||||
<ul>
|
||||
<li>Extension version</li>
|
||||
<li>Which browser you're using¹</li>
|
||||
<li>Which extension store you installed extension from (install source)²</li>
|
||||
<li>Which site you're having the issue on (preferably link. For issues with autodetection, please also include a timestamp)</li>
|
||||
<li>What do I need to do in order to make the issue happen</li>
|
||||
<li>Please include a screenshot of the problem. It usually helps.</li>
|
||||
</ul>
|
||||
<p>
|
||||
<small>
|
||||
[1] If using anything other than Firefox, Chrome, or Edge, please check if issue also happens in Chrome or Edge. Bugs affecting Opera will only get fixed if they also affect Chrome, because <a target="_blank" href="https://stuff.tamius.net/sacred-texts/2024/06/08/why-im-boycotting-opera/">I'm salty</a>.<br/>
|
||||
[2] It is recommended that users of Microsoft Edge install Ultrawidify from the Microsoft Edge Addons source
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="w-[1/2]" style="width: 50%">
|
||||
<h2>Thank you monies</h2>
|
||||
<p>
|
||||
If you think I deserve money for the work I did up to this point, you can bankroll my caffeine addiction.
|
||||
</p>
|
||||
<p class="text-center">
|
||||
<a class="donate" href="https://www.paypal.com/paypalme/tamius" target="_blank">Donate on Paypal</a>
|
||||
</p>
|
||||
<p>
|
||||
I also have <a href="https://instagram.com/shaman_urkog" target="_blank">instagram with nerdy shit</a> <small>(mini painting + various fantasy events)</small>.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BrowserDetect from '../../../ext/conf/BrowserDetect';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
BrowserDetect,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// reminder — webextension-polyfill doesn't seem to work in vue!
|
||||
addonVersion: BrowserDetect.firefox ? chrome.runtime.getManifest().version : chrome.runtime.getManifest().version,
|
||||
addonSource: BrowserDetect.processEnvVersion,
|
||||
mailtoLink: '',
|
||||
redditLink: '',
|
||||
showEasterEgg: false,
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
const messageTemplate = encodeURIComponent(
|
||||
`Describe your issue in more detail. In case of misaligned videos, please provide screenshots. When reporting\
|
||||
issues with autodetection not detecting aspect ratio correctly, please provide a link with timestamp to the\
|
||||
problematic video at the time where the problem happens. You may delete this paragraph, as it's only a template.
|
||||
|
||||
|
||||
Extension info (AUTOGENERATED — DO NOT CHANGE OR REMOVE):
|
||||
* Build: ${BrowserDetect.processEnvBrowser}-${this.addonVersion}-stable
|
||||
|
||||
Browser-related stuff (please ensure this section is correct):
|
||||
* User Agent string: ${window.navigator.userAgent}
|
||||
* vendor: ${window.navigator.vendor}
|
||||
* Operating system: ${window.navigator.platform}
|
||||
`
|
||||
);
|
||||
this.mailtoLink = `mailto:tamius.han@gmail.com?subject=%5BUltrawidify%5D%20ENTER%20SUMMARY%20OF%20YOUR%20ISSUE%20HERE&body=${messageTemplate}`;
|
||||
},
|
||||
methods: {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.flex {
|
||||
display: flex;
|
||||
}
|
||||
.flex-row {
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
p, li {
|
||||
font-size: 1rem;
|
||||
}
|
||||
small {
|
||||
opacity: 0.5;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
a {
|
||||
color: #fa6;
|
||||
}
|
||||
.text-center {
|
||||
text-align: center;
|
||||
}
|
||||
.donate {
|
||||
margin: 1rem;
|
||||
padding: 0.5rem 1rem;
|
||||
border-radius: 0.25rem;
|
||||
background-color: #fa6;
|
||||
color: #000;
|
||||
}
|
||||
</style>
|
171
src/csui/src/PlayerUiPanels/AlignmentOptionsControlComponent.vue
Normal file
@ -0,0 +1,171 @@
|
||||
<template>
|
||||
<div class="alignment-box">
|
||||
<div
|
||||
class="col top left"
|
||||
@click="align(VideoAlignment.Left, VideoAlignment.Top)"
|
||||
>
|
||||
<div class="alignment-ui"></div>
|
||||
</div>
|
||||
<div
|
||||
class="col top center"
|
||||
@click="align(VideoAlignment.Center, VideoAlignment.Top)"
|
||||
>
|
||||
<div class="alignment-ui"></div>
|
||||
</div>
|
||||
<div
|
||||
class="col top right"
|
||||
@click="align(VideoAlignment.Right, VideoAlignment.Top)"
|
||||
>
|
||||
<div class="alignment-ui"></div>
|
||||
</div>
|
||||
<div
|
||||
class="col ycenter left"
|
||||
@click="align(VideoAlignment.Left, VideoAlignment.Center)"
|
||||
>
|
||||
<div class="alignment-ui"></div>
|
||||
</div>
|
||||
<div
|
||||
class="col ycenter center"
|
||||
@click="align(VideoAlignment.Center, VideoAlignment.Center)"
|
||||
>
|
||||
<div class="alignment-ui"></div>
|
||||
</div>
|
||||
<div
|
||||
class="col ycenter right"
|
||||
@click="align(VideoAlignment.Right, VideoAlignment.Center)"
|
||||
>
|
||||
<div class="alignment-ui"></div>
|
||||
</div>
|
||||
<div
|
||||
class="col bottom left"
|
||||
@click="align(VideoAlignment.Left, VideoAlignment.Bottom)"
|
||||
>
|
||||
<div class="alignment-ui"></div>
|
||||
</div>
|
||||
<div
|
||||
class="col bottom center"
|
||||
@click="align(VideoAlignment.Center, VideoAlignment.Bottom)"
|
||||
>
|
||||
<div class="alignment-ui"></div>
|
||||
</div>
|
||||
<div
|
||||
class="col bottom right"
|
||||
@click="align(VideoAlignment.Right, VideoAlignment.Bottom)"
|
||||
>
|
||||
<div class="alignment-ui"></div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import VideoAlignmentType from '../../../common/enums/VideoAlignmentType.enum';
|
||||
|
||||
|
||||
export default {
|
||||
props: [
|
||||
'eventBus'
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
VideoAlignment: VideoAlignmentType
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
align(alignmentX, alignmentY) {
|
||||
this.eventBus?.sendToTunnel('set-alignment', {x: alignmentX, y: alignmentY})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped module>
|
||||
.alignment-box {
|
||||
aspect-ratio: 1;
|
||||
// width: 100%;
|
||||
// min-width: 40px;
|
||||
// max-width: 80px;
|
||||
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 0.5rem;
|
||||
|
||||
|
||||
.col {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
background-color: rgba(0,0,0,0.25);
|
||||
cursor: pointer;
|
||||
|
||||
padding: 0.5rem;
|
||||
width: 1.5rem;
|
||||
height: 1.5rem;
|
||||
|
||||
border-bottom: 1px solid transparent;
|
||||
|
||||
.alignment-ui {
|
||||
|
||||
width: 50%;
|
||||
height: 50%;
|
||||
|
||||
border-style: solid;
|
||||
border-width: 0px;
|
||||
border-color: #fff;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: rgba(0,0,0,0.5);
|
||||
border-bottom: 1px solid #fa6;
|
||||
|
||||
.alignment-ui {
|
||||
border-color: #fa6 !important;
|
||||
}
|
||||
|
||||
&.center.ycenter {
|
||||
.alignment-ui {
|
||||
background-color: #fa6;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.top {
|
||||
align-items: flex-start;
|
||||
|
||||
.alignment-ui {
|
||||
border-top-width: 3px;
|
||||
}
|
||||
}
|
||||
&.bottom {
|
||||
align-items: flex-end;
|
||||
|
||||
.alignment-ui {
|
||||
border-bottom-width: 3px;
|
||||
}
|
||||
}
|
||||
&.left {
|
||||
justify-content: flex-start;
|
||||
|
||||
.alignment-ui {
|
||||
border-left-width: 3px;
|
||||
}
|
||||
}
|
||||
&.right {
|
||||
justify-content: flex-end;
|
||||
|
||||
.alignment-ui {
|
||||
border-right-width: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
&.center.ycenter {
|
||||
|
||||
.alignment-ui {
|
||||
width: 25%;
|
||||
height: 25%;
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
478
src/csui/src/PlayerUiPanels/AutodetectionSettingsPanel.vue
Normal file
@ -0,0 +1,478 @@
|
||||
<template>
|
||||
<div class="flex flex-col tab-root">
|
||||
<div class="flex flex-row flex-wrap">
|
||||
|
||||
<!-- AARD performance metrics -->
|
||||
<div class="sub-panel">
|
||||
<div class="flex flex-row">
|
||||
<h1><mdicon name="television-play" :size="32" /> Automatic Aspect Ratio Detection</h1>
|
||||
</div>
|
||||
<div class="sub-panel-content">
|
||||
<p>
|
||||
<b>Autodetection performance</b>
|
||||
</p>
|
||||
<p>
|
||||
Automatic aspect ratio detection is a resource-hungry feature.
|
||||
This page allows you to trade autodetection accuracy and/or frequency for
|
||||
better performance.
|
||||
</p>
|
||||
<p>
|
||||
Note that some browsers <a href="https://developer.mozilla.org/en-US/docs/Web/API/Performance/now" target="_blank">limit the accuracy of time measurements</a>, though once the bars go past the blue line those limitations are largely inconsequential.
|
||||
</p>
|
||||
<div class="performance-graph-container">
|
||||
<div class="performance-graph">
|
||||
<div class="time-budget hz144"></div>
|
||||
<div class="time-budget hz120"></div>
|
||||
<div class="time-budget hz60"></div>
|
||||
<div class="time-budget hz30"></div>
|
||||
<div class="time-budget hz24"></div>
|
||||
<div class="time-budget rest"></div>
|
||||
|
||||
<div class="bar-container">
|
||||
<div class="average-case">
|
||||
<div class="stats">
|
||||
<b>Average: </b>
|
||||
<span class="draw">draw (main) {{(performanceData?.imageDraw?.averageTime ?? 0).toFixed(1)}} ms</span> |
|
||||
<span class="draw-blackframe">blackframe {{(performanceData?.blackFrame?.averageTime ?? 0).toFixed(1)}} ms</span> |
|
||||
<span class="processing">
|
||||
processing {{
|
||||
Math.max(
|
||||
(performanceData?.total?.averageTime ?? 0)
|
||||
- (performanceData?.imageDraw?.averageTime ?? 0)
|
||||
- (performanceData?.blackFrame?.averageTime ?? 0),
|
||||
0
|
||||
).toFixed(1)
|
||||
}} ms
|
||||
</span>
|
||||
</div>
|
||||
<div class="bar">
|
||||
<div
|
||||
class="draw"
|
||||
:style="{'width': (performanceData?.imageDraw?.averageTime ?? 0) + '%'}"
|
||||
>
|
||||
</div>
|
||||
<div
|
||||
class="draw-blackframe"
|
||||
:style="{'width': (performanceData?.blackFrame?.averageTime ?? 0) + '%'}"
|
||||
>
|
||||
</div>
|
||||
<div
|
||||
class="processing"
|
||||
:style="{
|
||||
'width': Math.max(
|
||||
(performanceData?.total?.averageTime ?? 0)
|
||||
- (performanceData?.imageDraw?.averageTime ?? 0)
|
||||
- (performanceData?.blackFrame?.averageTime ?? 0),
|
||||
0
|
||||
) + '%'
|
||||
}"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="worst-case">
|
||||
<div class="stats">
|
||||
<b>Worst: </b>
|
||||
<span class="draw">draw (main) {{(performanceData?.imageDraw?.worstTime ?? 0).toFixed(1)}} ms</span> |
|
||||
<span class="draw-blackframe">blackframe {{(performanceData?.blackFrame?.worstTime ?? 0).toFixed(1)}} ms</span> |
|
||||
<span class="processing">
|
||||
processing {{
|
||||
Math.max(
|
||||
(performanceData?.total?.worstTime ?? 0)
|
||||
- (performanceData?.imageDraw?.worstTime ?? 0)
|
||||
- (performanceData?.blackFrame?.worstTime ?? 0),
|
||||
0
|
||||
).toFixed(1)
|
||||
}} ms
|
||||
</span>
|
||||
</div>
|
||||
<div class="bar">
|
||||
<div
|
||||
class="draw"
|
||||
:style="{'width': (performanceData?.imageDraw?.worstTime ?? 0) + '%'}"
|
||||
>
|
||||
</div>
|
||||
<div
|
||||
class="draw-blackframe"
|
||||
:style="{'width': (performanceData?.blackFrame?.worstTime ?? 0) + '%'}"
|
||||
>
|
||||
</div>
|
||||
<div
|
||||
class="processing"
|
||||
:style="{
|
||||
'width': Math.max(
|
||||
(performanceData?.total?.worstTime ?? 0)
|
||||
- (performanceData?.imageDraw?.worstTime ?? 0)
|
||||
- (performanceData?.blackFrame?.worstTime ?? 0),
|
||||
0
|
||||
) + '%'
|
||||
}"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="average-case">
|
||||
<div class="stats">
|
||||
<b>AR change (average): </b>
|
||||
<span class="draw">draw (main) {{(performanceData?.imageDraw?.averageTime ?? 0).toFixed(1)}} ms</span> |
|
||||
<span class="draw-blackframe">blackframe {{(performanceData?.blackFrame?.averageTime ?? 0).toFixed(1)}} ms</span> |
|
||||
<span class="processing">processing {{
|
||||
(
|
||||
(performanceData?.fastLetterbox?.averageTime ?? 0)
|
||||
+ (performanceData?.edgeDetect?.averageTime ?? 0)
|
||||
).toFixed(1)
|
||||
}} ms</span>
|
||||
</div>
|
||||
<div class="bar">
|
||||
<div
|
||||
class="draw"
|
||||
:style="{'width': (performanceData?.imageDraw?.averageTime ?? 0) + '%'}"
|
||||
>
|
||||
</div>
|
||||
<div
|
||||
class="draw-blackframe"
|
||||
:style="{'width': (performanceData?.blackFrame?.averageTime ?? 0) + '%'}"
|
||||
>
|
||||
</div>
|
||||
<div
|
||||
class="processing"
|
||||
:style="{
|
||||
'width': (
|
||||
(performanceData?.fastLetterbox?.averageTime ?? 0)
|
||||
+ (performanceData?.edgeDetect?.averageTime ?? 0)
|
||||
) + '%'
|
||||
}"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="worst-case">
|
||||
<div class="stats">
|
||||
<b>AR change (worst): </b>
|
||||
<span class="draw">draw (main) {{(performanceData?.imageDraw?.worstTime ?? 0).toFixed(1)}} ms</span> |
|
||||
<span class="draw-blackframe">blackframe {{(performanceData?.blackFrame?.worstTime ?? 0).toFixed(1)}} ms</span> |
|
||||
<span class="processing">processing {{
|
||||
(
|
||||
(performanceData?.fastLetterbox?.worstTime ?? 0)
|
||||
+ (performanceData?.edgeDetect?.worstTime ?? 0)
|
||||
).toFixed(1)
|
||||
}} ms</span>
|
||||
</div>
|
||||
<div class="bar">
|
||||
<div
|
||||
class="draw"
|
||||
:style="{'width': (performanceData?.imageDraw?.worstTime ?? 0) + '%'}"
|
||||
>
|
||||
</div>
|
||||
<div
|
||||
class="draw-blackframe"
|
||||
:style="{'width': (performanceData?.blackFrame?.worstTime ?? 0) + '%'}"
|
||||
>
|
||||
</div>
|
||||
<div
|
||||
class="processing"
|
||||
:style="{
|
||||
'width': (
|
||||
(performanceData?.fastLetterbox?.worstTime ?? 0)
|
||||
+ (performanceData?.edgeDetect?.worstTime ?? 0)
|
||||
) + '%'
|
||||
}"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="settings-segment">
|
||||
<h2>Basic settings</h2>
|
||||
|
||||
<div class="option">
|
||||
<div class="name">
|
||||
Autodetection frequency
|
||||
</div>
|
||||
<div class="description">
|
||||
Shorter intervals (left side of the slider) are more responsive to changes in aspect ratio detections,
|
||||
but requires more system resources.
|
||||
</div>
|
||||
<div class="indent">
|
||||
<div class="flex flex-row row-padding">
|
||||
<div class="flex flex-input">
|
||||
More often <small>(~60/s)</small>
|
||||
<input type="range"
|
||||
:value="Math.log(settings.active.arDetect.timers.playing)"
|
||||
@change="setArCheckFrequency($event.target.value)"
|
||||
min="2.3"
|
||||
max="9.3"
|
||||
step="any"
|
||||
/>
|
||||
Less often <small>(~1/10s)</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="option">
|
||||
<div class="name">
|
||||
Autodetection sensitivity
|
||||
</div>
|
||||
<div class="description">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<div class="label">Maximum allowed vertical video misalignment:</div>
|
||||
<div class="input">
|
||||
<input v-model="settings.active.arDetect.allowedMisaligned" />
|
||||
</div>
|
||||
<div class="description">
|
||||
Ultrawidify detects letterbox only if video is vertically centered. Some people are bad at vertically
|
||||
centering the content, though. This is how off-center the video can be before autodetection will
|
||||
refuse to crop it.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="option">
|
||||
<div class="name">Video sample size</div>
|
||||
<div class="input">
|
||||
<input v-model="settings.active.arDetect.canvasDimensions.sampleCanvas.width" /> x <input v-model="settings.active.arDetect.canvasDimensions.sampleCanvas.height" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<div class="label">Sample columns:</div>
|
||||
<div class="input"><input v-model="settings.active.arDetect.sampling.staticCols" /></div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="label">Sample rows:</div>
|
||||
<div class="input"><input v-model="settings.active.arDetect.sampling.staticRows" /></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Button from '../components/Button.vue'
|
||||
import KeyboardShortcutParser from '../../../common/js/KeyboardShortcutParser';
|
||||
import ShortcutButton from '../components/ShortcutButton';
|
||||
import EditShortcutButton from '../components/EditShortcutButton';
|
||||
import BrowserDetect from '../../../ext/conf/BrowserDetect';
|
||||
import AspectRatioType from '../../../common/enums/AspectRatioType.enum';
|
||||
import StretchType from '../../../common/enums/StretchType.enum';
|
||||
import CropModePersistence from '../../../common/enums/CropModePersistence.enum';
|
||||
import AlignmentOptionsControlComponent from './AlignmentOptionsControlComponent.vue';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
exec: null,
|
||||
performanceData: {},
|
||||
graphRefreshInterval: undefined,
|
||||
}
|
||||
},
|
||||
mixins: [
|
||||
],
|
||||
props: [
|
||||
'settings',
|
||||
'frame',
|
||||
'eventBus',
|
||||
'site'
|
||||
],
|
||||
created() {
|
||||
this.eventBus.subscribe('uw-config-broadcast', {function: (config) => this.handleConfigBroadcast(config)});
|
||||
},
|
||||
mounted() {
|
||||
this.eventBus.sendToTunnel('get-aard-timing');
|
||||
this.graphRefreshInterval = setInterval(() => this.eventBus.sendToTunnel('get-aard-timing'), 500);
|
||||
},
|
||||
destroyed() {
|
||||
clearInterval(this.graphRefreshInterval);
|
||||
},
|
||||
components: {
|
||||
ShortcutButton,
|
||||
EditShortcutButton,
|
||||
Button,
|
||||
AlignmentOptionsControlComponent
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
methods: {
|
||||
async openOptionsPage() {
|
||||
BrowserDetect.runtime.openOptionsPage();
|
||||
},
|
||||
refreshGraph() {
|
||||
this.eventBus.sendToTunnel('get-aard-timing');
|
||||
},
|
||||
handleConfigBroadcast(data) {
|
||||
if (data.type === 'aard-performance-data') {
|
||||
this.performanceData = data.performanceData;
|
||||
this.$nextTick( () => this.$forceUpdate() );
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" src="../../res/css/flex.scss" scoped module></style>
|
||||
<style lang="scss" src="../res-common/panels.scss" scoped module></style>
|
||||
<style lang="scss" src="../res-common/common.scss" scoped module></style>
|
||||
|
||||
<style lang="scss" scoped module>
|
||||
@import '../res-common/variables';
|
||||
|
||||
.performance-graph-container {
|
||||
position: relative;
|
||||
|
||||
width: 100%;
|
||||
height: 8rem;
|
||||
padding: 1rem;
|
||||
|
||||
.performance-graph {
|
||||
border: 1px solid #fa6;
|
||||
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
// graph is 100 ms wide
|
||||
.time-budget {
|
||||
height: 100%;
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
|
||||
box-sizing: border-box;
|
||||
|
||||
z-index: 100;
|
||||
|
||||
&.hz144 {
|
||||
width: 6.9%;
|
||||
// background-color: rgba(143, 143, 235, 0.47);
|
||||
}
|
||||
&.hz120 {
|
||||
width: 1.39%;
|
||||
// background-color: rgba(108, 108, 211, 0.441);
|
||||
}
|
||||
&.hz60 {
|
||||
width: 8.33%;
|
||||
// background-color: rgba(78, 78, 182, 0.327);
|
||||
border-right: 2px solid rgb(96, 96, 227);
|
||||
&::after {
|
||||
content: '60fps';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: -2px;
|
||||
|
||||
border-right: 2px solid rgb(96, 96, 227);
|
||||
|
||||
transform: translateY(-100%);
|
||||
|
||||
font-size: 0.6rem;
|
||||
padding-right: 0.25rem;
|
||||
text-transform: small-caps;
|
||||
}
|
||||
}
|
||||
&.hz30 {
|
||||
width: 16.67%;
|
||||
// background-color: rgba(56, 56, 151, 0.308);
|
||||
border-right: 2px solid #fb772a;
|
||||
|
||||
&::after {
|
||||
content: '30fps';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: -2px;
|
||||
|
||||
border-right: 2px solid #fb772a;
|
||||
|
||||
transform: translateY(-100%);
|
||||
|
||||
font-size: 0.6rem;
|
||||
padding-right: 0.25rem;
|
||||
text-transform: small-caps;
|
||||
}
|
||||
}
|
||||
&.hz24 {
|
||||
width: 8.33%;
|
||||
// background-color: rgba(37, 37, 118, 0.269);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.bar-container {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding-top: 0.5rem;
|
||||
padding-bottom: 0.5rem;
|
||||
|
||||
> div {
|
||||
height: 2.5rem;
|
||||
}
|
||||
|
||||
.stats {
|
||||
background-color: rgba(0, 0, 0, 0.544);
|
||||
font-size: 0.75rem;
|
||||
font-family: 'Overpass Mono';
|
||||
z-index: 11010;
|
||||
|
||||
span {
|
||||
font-size: 0.75rem;
|
||||
z-index: 11011;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
width: 0.75rem;
|
||||
height: 0.75rem;
|
||||
margin-top: 0.25rem;
|
||||
margin-right: 0.5rem;
|
||||
}
|
||||
|
||||
&.draw::before {
|
||||
background-color: #fb772a;
|
||||
}
|
||||
&.draw-blackframe::before {
|
||||
background-color: #e70c0c;
|
||||
}
|
||||
&.processing::before {
|
||||
background-color: rgb(176, 167, 239);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bar {
|
||||
width: 100%;
|
||||
height: 0.69rem;
|
||||
background-color: #000;
|
||||
|
||||
overflow: hidden;
|
||||
* {
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.draw {
|
||||
background-color: #fb772a;
|
||||
}
|
||||
.draw-blackframe {
|
||||
background-color: #e70c0c;
|
||||
}
|
||||
.processing {
|
||||
background-color: rgb(176, 167, 239);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
124
src/csui/src/PlayerUiPanels/BaseExtensionSettings.vue
Normal file
@ -0,0 +1,124 @@
|
||||
<template>
|
||||
<div class="flex flex-col w-100">
|
||||
|
||||
<!-- TAB ROW -->
|
||||
<div class="flex flex-row">
|
||||
<div
|
||||
class="tab"
|
||||
:class="{'active': tab === 'siteSettings'}"
|
||||
@click="setTab('siteSettings')"
|
||||
>
|
||||
Settings for current site<br/>
|
||||
<small>{{ site }}</small>
|
||||
</div>
|
||||
<div
|
||||
class="tab"
|
||||
:class="{'active': tab === 'extensionSettings'}"
|
||||
@click="setTab(tab = 'extensionSettings')"
|
||||
>
|
||||
Default settings for extension
|
||||
</div>
|
||||
<div
|
||||
class="tab"
|
||||
:class="{'active': tab === 'otherSites'}"
|
||||
@click="setTab(tab = 'otherSites')"
|
||||
>
|
||||
Settings for other sites
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template v-if="tab === 'siteSettings' && siteSettings">
|
||||
<!-- <div class="button">
|
||||
Reset settings for site
|
||||
</div> -->
|
||||
<SiteExtensionSettings
|
||||
v-if="settings"
|
||||
:settings="settings"
|
||||
:siteSettings="siteSettings"
|
||||
:isDefaultConfiguration="false"
|
||||
></SiteExtensionSettings>
|
||||
</template>
|
||||
|
||||
<template v-if="tab === 'extensionSettings' && globalSettings">
|
||||
<SiteExtensionSettings
|
||||
v-if="settings"
|
||||
:settings="settings"
|
||||
:siteSettings="globalSettings"
|
||||
:isDefaultConfiguration="true"
|
||||
></SiteExtensionSettings>
|
||||
</template>
|
||||
|
||||
<template v-if="tab === 'otherSites'">
|
||||
<OtherSiteSettings
|
||||
v-if="settings"
|
||||
:settings="settings"
|
||||
>
|
||||
</OtherSiteSettings>
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
<!-- Reset options -->
|
||||
<div class="flex flex-col" style="margin-top: 2rem">
|
||||
<h2>Reset and backup</h2>
|
||||
<p>
|
||||
Pressing the button will reset settings to default without asking.
|
||||
</p>
|
||||
<button
|
||||
class="danger"
|
||||
@click="resetSettings"
|
||||
>
|
||||
Reset settings
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SiteExtensionSettings from './PanelComponents/ExtensionSettings/SiteExtensionSettings.vue';
|
||||
import OtherSiteSettings from './PanelComponents/ExtensionSettings/OtherSiteSettings.vue';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tab: 'siteSettings'
|
||||
}
|
||||
},
|
||||
mixins: [
|
||||
|
||||
],
|
||||
props: [
|
||||
'settings',
|
||||
'site',
|
||||
],
|
||||
components: {
|
||||
SiteExtensionSettings,
|
||||
OtherSiteSettings
|
||||
},
|
||||
computed: {
|
||||
globalSettings() {
|
||||
return this.settings?.getSiteSettings('@global') ?? null;
|
||||
},
|
||||
siteSettings() {
|
||||
if (this.site) {
|
||||
return this.settings?.getSiteSettings(this.site) ?? null;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
resetSettings() {
|
||||
this.settings.active = JSON.parse(JSON.stringify(this.settings.default));
|
||||
this.settings.saveWithoutReload();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setTab(tab) {
|
||||
this.tab = tab;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" src="../../res/css/flex.scss" scoped module></style>
|
||||
<style lang="scss" src="../res-common/panels.scss" scoped module></style>
|
||||
<style lang="scss" src="../res-common/common.scss" scoped module></style>
|
127
src/csui/src/PlayerUiPanels/ChangelogPanel.vue
Normal file
@ -0,0 +1,127 @@
|
||||
<template>
|
||||
<div class="flex flex-col w-full h-full gap-2">
|
||||
<div class="flex flex-row gap-2 bg-black">
|
||||
<div class="w-[1/2]" style="width: 50%">
|
||||
<h1>What's new</h1>
|
||||
<p>Full changelog for older versions <a href="https://github.com/tamius-han/ultrawidify/blob/master/CHANGELOG.md" target="_blank">is available here</a>.</p>
|
||||
|
||||
<h2>6.2.0</h2>
|
||||
<p>
|
||||
There's been another major change that skips a version.
|
||||
</p>
|
||||
<ul>
|
||||
<li>Parts of automatic aspect ratio detection use WebGL now. This should result in improved performance. Slightly underwhelming blog post about this issue can be found <a href="https://stuff.tamius.net/sacred-texts/2024/10/02/hot-dang-i-shouldnt-have-given-on-webgl/" target="_blank">here</a>.</li>
|
||||
<li>In-player UI now indicates whether a site is having a problem with automatic aspect ratio detection.</li>
|
||||
<li>UI improvements</li>
|
||||
</ul>
|
||||
<p>
|
||||
Since automatic aspect ratio detection had to be rewritten completely and since the new version needs to be out 5 days ago, there are some regressions in the automatic aspect ratio detection.
|
||||
</p>
|
||||
|
||||
<h2>6.0.1</h2>
|
||||
<p>Fixed external links.</p>
|
||||
|
||||
<h2>6.0.0</h2>
|
||||
<p>
|
||||
I don't think I need to write a changelog for this one. I've also been working on this, on and (mostly) off, for ... a long time, so I might have "kinda forgot" some minor things.
|
||||
</p>
|
||||
<ul>
|
||||
<li><b>Manifest v3</b>. Bit late, but still.</li>
|
||||
<li>
|
||||
<b>In-player UI.</b><br/>
|
||||
This one took major effort to pull off. Required some changes under the hood, required me to de-spaghettify some code. The UI will only show
|
||||
if the video takes up sufficient amount of space (currently determined as 960 pixels wide).
|
||||
</li>
|
||||
<li>
|
||||
<b>New alignment options.</b> Video can be aligned vertically as well as horizontally.
|
||||
</li>
|
||||
<!-- <li>
|
||||
By default, Ultrawidify will not kick in on "small videos". You have to be either in full screen or theater mode. Ultrawidify assumes that any
|
||||
video that takes up more than 85% of the window width is being viewed in theater mode. This value may be tweaked later on. This feature can be
|
||||
configured (or turned off entirely) via 'Advanced options' menu on the in-player UI.
|
||||
</li> -->
|
||||
<li>
|
||||
The in-player extension UI will do a better job differentiating between the various level of support: "official" for the sites that Tam can check
|
||||
on his own, "fingers crossed" for sites that Tam can't check because my load-bearing credit card can't support the weight of a dozen subscription
|
||||
services, and "community support" for sites that enjoy support through the helping hand of people willing to help.
|
||||
</li>
|
||||
<li>
|
||||
The in-player UI should now display a warning whenever Ultrawidify detects automatic aspect ratio detection isn't happening because the site uses DRM.
|
||||
</li>
|
||||
<!-- <li>
|
||||
Better zooming. The slider is back, baby.
|
||||
</li> -->
|
||||
<!-- <li>
|
||||
Panning option that's a bit more intuitive.
|
||||
</li> -->
|
||||
</ul>
|
||||
<h3>Regressions</h3>
|
||||
<ul>
|
||||
<li>
|
||||
Due to major changes under the hood, custom settings from older versions were NOT been migrated (probably).
|
||||
</li>
|
||||
<li>
|
||||
It is unclear how extension acts on sites with more than one video.
|
||||
</li>
|
||||
<li>
|
||||
Extension lost the ability to discriminate between iframes. Actions taken through the popup will be affect <b>all</b> iframes.
|
||||
</li>
|
||||
<li>
|
||||
Hope the UI is worth the regressions, because getting UI to work has been a MAJOR pain in the ass.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="w-[1/2]" style="width: 50%; padding-left: 1rem; padding-top: 5rem;">
|
||||
<h2>Thank you monies</h2>
|
||||
<p>
|
||||
If you think I deserve money for the work I did up to this point, you can bankroll my caffeine addiction.
|
||||
</p>
|
||||
<p class="text-center">
|
||||
<a class="donate" href="https://www.paypal.com/paypalme/tamius" target="_blank">Donate on Paypal</a>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
export default({
|
||||
props: [
|
||||
'settings'
|
||||
],
|
||||
mounted() {
|
||||
this.settings.active.whatsNewChecked = true;
|
||||
this.settings.saveWithoutReload();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.flex {
|
||||
display: flex;
|
||||
}
|
||||
.flex-row {
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
p, li {
|
||||
font-size: 1rem;
|
||||
}
|
||||
small {
|
||||
opacity: 0.5;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
a {
|
||||
color: #fa6;
|
||||
}
|
||||
.text-center {
|
||||
text-align: center;
|
||||
}
|
||||
.donate {
|
||||
margin: 1rem;
|
||||
padding: 0.5rem 1rem;
|
||||
border-radius: 0.25rem;
|
||||
background-color: #fa6;
|
||||
color: #000;
|
||||
}
|
||||
</style>
|
126
src/csui/src/PlayerUiPanels/DebugPanel.vue
Normal file
@ -0,0 +1,126 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<div>
|
||||
<h1>{{loggerPanel.title}}<small><br/>{{loggerPanel.subtitle}}</small></h1>
|
||||
|
||||
<div>Logger configuration:</div>
|
||||
|
||||
<template v-if="loggerPanel.pasteConfMode">
|
||||
|
||||
</template>
|
||||
<template v-else>
|
||||
<JsonObject
|
||||
label="logger-settings"
|
||||
:value="currentSettings"
|
||||
:ignoreKeys="{'allowLogging': false}"
|
||||
@change="updateSettingsUi"
|
||||
></JsonObject>
|
||||
</template>
|
||||
|
||||
<div class="flex flex-row flex-end">
|
||||
<div class="button" @click="restoreLoggerSettings()">
|
||||
Revert
|
||||
</div>
|
||||
<div class="button button-primary" @click="saveLoggerSettings()">
|
||||
Save
|
||||
</div>
|
||||
<div class="button button-primary" @click="startLogging()">
|
||||
Save and start logging
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import JsonObject from '../components/JsonEditor/JsonObject.vue'
|
||||
import Logger, { baseLoggingOptions } from '../../../ext/lib/Logger';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
JsonObject
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loggerPanelRotation: [{
|
||||
title: 'DEFORESTATOR 5000',
|
||||
subtitle: 'Iron Legion\'s finest logging tool'
|
||||
},{
|
||||
title: 'Astinus',
|
||||
subtitle: 'Ultrawidify logging tool'
|
||||
}, {
|
||||
title: 'Tracer',
|
||||
subtitle: "Maybe I'll be Tracer — I'm already printing stack traces."
|
||||
}, {
|
||||
title: 'Grûmsh',
|
||||
subtitle: "He who watches (all the things printed to the console)."
|
||||
}, {
|
||||
title: 'Situation Room/The Council',
|
||||
subtitle: 'We will always be watching.'
|
||||
}, {
|
||||
title: 'Isengard Land Management Services',
|
||||
subtitle: "#log4saruman"
|
||||
}, {
|
||||
title: 'Saw Hero',
|
||||
subtitle: 'Ultrawidify logging tool'
|
||||
}],
|
||||
|
||||
loggerPanel: {
|
||||
title: 'whoopsie daisy',
|
||||
subtitle: 'you broke the header choosing script',
|
||||
pasteConfMode: false,
|
||||
},
|
||||
lastSettings: undefined,
|
||||
parsedSettings: undefined,
|
||||
currentSettings: undefined
|
||||
};
|
||||
},
|
||||
props: [
|
||||
'settings',
|
||||
'eventBus',
|
||||
'site'
|
||||
],
|
||||
created() {
|
||||
this.loggerPanel = {
|
||||
...this.loggerPanelRotation[Math.floor(Math.random() * this.loggerPanelRotation.length)],
|
||||
pasteConfMode: false,
|
||||
};
|
||||
this.loadDefaultConfig();
|
||||
},
|
||||
methods: {
|
||||
loadDefaultConfig() {
|
||||
this.lastSettings = baseLoggingOptions;
|
||||
this.parsedSettings = JSON.stringify(this.lastSettings, null, 2) || '';
|
||||
this.currentSettings = JSON.parse(JSON.stringify(this.lastSettings));
|
||||
},
|
||||
async getLoggerSettings() {
|
||||
this.lastSettings = await Logger.getConfig() || baseLoggingOptions;
|
||||
this.parsedSettings = JSON.stringify(this.lastSettings, null, 2) || '';
|
||||
this.currentSettings = JSON.parse(JSON.stringify(this.lastSettings));
|
||||
},
|
||||
updateSettingsUi(val) {
|
||||
try {
|
||||
this.parsedSettings = JSON.stringify(val, null, 2);
|
||||
this.lastSettings = val;
|
||||
this.currentSettings = JSON.parse(JSON.stringify(this.lastSettings));
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
},
|
||||
saveLoggerSettings() {
|
||||
Logger.saveConfig({...this.lastSettings});
|
||||
},
|
||||
restoreLoggerSettings() {
|
||||
this.getLoggerSettings();
|
||||
this.confHasError = false;
|
||||
},
|
||||
async startLogging(){
|
||||
this.logStringified = undefined;
|
||||
await Logger.saveConfig({...this.lastSettings, allowLogging: true});
|
||||
window.location.reload();
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
34
src/csui/src/PlayerUiPanels/InPlayerUiAdvertisement.vue
Normal file
@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<div>
|
||||
<h1>In-player UI</h1>
|
||||
<div
|
||||
class="button b3"
|
||||
style="margin: 16px; padding: 4px;"
|
||||
@click="showInPlayerUi()"
|
||||
>
|
||||
Show in-player UI
|
||||
</div>
|
||||
<p></p>
|
||||
<p></p>
|
||||
<p>In-player UI should show and hide automatically as you start or stop moving your mouse inside the player window.</p>
|
||||
<p>Note that by default, in-player UI may not show if player window is not big enough.</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import UIProbeMixin from '../utils/UIProbeMixin';
|
||||
|
||||
export default {
|
||||
mixins: [
|
||||
UIProbeMixin
|
||||
],
|
||||
props: [
|
||||
'eventBus',
|
||||
],
|
||||
methods: {
|
||||
showInPlayerUi() {
|
||||
this.eventBus.send('uw-set-ui-state', {globalUiVisible: true}, {comms: {forwardTo: 'active'}});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,122 @@
|
||||
<template>
|
||||
<div class="">
|
||||
<template v-if="!selectedSite">
|
||||
<div style="margin-top: 1rem; margin-bottom: 1rem;">
|
||||
<b>NOTE:</b> Sites not on this list use default extension settings.
|
||||
</div>
|
||||
<div v-for="site of sites" :key="site.key" @click="selectedSite = site.key" class="flex flex-col container pointer" style="margin-top: 4px; padding: 0.5rem 1rem;">
|
||||
<div class="flex flex-row">
|
||||
<div class="flex-grow pointer">
|
||||
<b>{{ site.key }}</b>
|
||||
<span :style="getSiteTypeColor(site.type)">
|
||||
(config: {{site.type ?? 'unknown'}})
|
||||
</span></div>
|
||||
<div>Edit</div>
|
||||
</div>
|
||||
<div class="flex flex-row">
|
||||
<small>
|
||||
Enabled: <span :style="getSiteEnabledColor(site.key, 'enable')"><small>{{ getSiteEnabledModes(site.key, 'enable') }}</small></span>;
|
||||
Aard <span :style="getSiteEnabledColor(site.key, 'enableAard')"><small>{{ getSiteEnabledModes(site.key, 'enableAard') }}</small></span>;
|
||||
kbd: <span :style="getSiteEnabledColor(site.key, 'enableKeyboard')"><small>{{ getSiteEnabledModes(site.key, 'enableKeyboard') }}</small></span>
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="selectedSite">
|
||||
<div class="flex flex-row container" style="align-items: center; color: #dedede; margin-top: 1rem;">
|
||||
<div @click="selectedSite = null" class="pointer button-hover" style=" font-size: 2em; padding: 0.5rem; margin-right: 1em;">
|
||||
←
|
||||
</div>
|
||||
<div>
|
||||
Editing {{ selectedSite }}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<SiteExtensionSettings
|
||||
v-if="selectedSiteSettings"
|
||||
:settings="settings"
|
||||
:siteSettings="selectedSiteSettings"
|
||||
:isDefaultConfiguration="false"
|
||||
></SiteExtensionSettings>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ExtensionMode from '../../../../../common/enums/ExtensionMode.enum';
|
||||
import SiteExtensionSettings from './SiteExtensionSettings.vue';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
selectedSite: null,
|
||||
}
|
||||
},
|
||||
props: [
|
||||
'settings',
|
||||
],
|
||||
components: {
|
||||
SiteExtensionSettings,
|
||||
},
|
||||
computed: {
|
||||
sites() {
|
||||
if (!this.settings?.active?.sites) {
|
||||
return [];
|
||||
} else {
|
||||
const sites = [];
|
||||
for (const siteKey in this.settings.active.sites) {
|
||||
if (!siteKey.startsWith('@')) {
|
||||
sites.push({
|
||||
key: siteKey,
|
||||
...this.settings.active.sites[siteKey]
|
||||
})
|
||||
}
|
||||
};
|
||||
sites.sort((a, b) => {
|
||||
const cmpa = a.key.replace('www.', '');
|
||||
const cmpb = b.key.replace('www.', '');
|
||||
|
||||
return cmpa < cmpb ? -1 : 1;
|
||||
});
|
||||
return sites;
|
||||
}
|
||||
},
|
||||
selectedSiteSettings() {
|
||||
return this.settings?.getSiteSettings(this.selectedSite) ?? null;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getSiteTypeColor(siteType) {
|
||||
switch (siteType) {
|
||||
case 'official': return 'color: #fa6';
|
||||
case 'community': return 'color: rgb(114, 114, 218)';
|
||||
case 'officially-disabled': return 'color: #f00';
|
||||
case 'testing': return 'color: #d81';
|
||||
default: return 'color: rgb(138, 65, 126)'
|
||||
};
|
||||
},
|
||||
getSiteEnabledColor(site, component) {
|
||||
const status = this.getSiteEnabledModes(site, component);
|
||||
|
||||
return status === 'disabled' ? 'color: #f00' : 'color: #1f8';
|
||||
},
|
||||
getSiteEnabledModes(site, component) {
|
||||
if (this.settings?.getSiteSettings(site).data[component]?.normal === ExtensionMode.Enabled) {
|
||||
return 'always';
|
||||
}
|
||||
if (this.settings?.getSiteSettings(site).data[component]?.theater === ExtensionMode.Enabled) {
|
||||
return 'T + FS';
|
||||
}
|
||||
if (this.settings?.getSiteSettings(site).data[component]?.fullscreen === ExtensionMode.Enabled) {
|
||||
return 'fullscreen';
|
||||
}
|
||||
return 'disabled';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" src="../../../../res/css/flex.scss" scoped></style>
|
||||
<style lang="scss" src="../../../res-common/panels.scss" scoped></style>
|
||||
<style lang="scss" src="../../../res-common/common.scss" scoped></style>
|
@ -0,0 +1,462 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- Enable extension -->
|
||||
<div class="field">
|
||||
<div class="label">
|
||||
Enable extension under the following conditions:
|
||||
</div>
|
||||
<div class="select">
|
||||
<select
|
||||
v-model="simpleExtensionSettings.enable"
|
||||
@click="setExtensionMode('enable', $event)"
|
||||
>
|
||||
<option
|
||||
v-if="simpleExtensionSettings.enable === 'complex'"
|
||||
value="complex"
|
||||
>
|
||||
(Site uses advanced settings)
|
||||
</option>
|
||||
<template v-if="isDefaultConfiguration">
|
||||
<option value="disabled">
|
||||
Disabled (unless enabled for specific site)
|
||||
</option>
|
||||
</template>
|
||||
<template v-else>
|
||||
<option value="default">
|
||||
Use default ()
|
||||
</option>
|
||||
<option value="disabled">
|
||||
Never
|
||||
</option>
|
||||
</template>
|
||||
<option value="fs">
|
||||
Fullscreen only
|
||||
</option>
|
||||
<option value="theater">
|
||||
Fullscreen and theater mode
|
||||
</option>
|
||||
<option value="enabled">
|
||||
Always
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Enable AARD -->
|
||||
<div class="field">
|
||||
<div class="label">
|
||||
Enable automatic aspect ratio detection under the following conditions:
|
||||
</div>
|
||||
<div class="select">
|
||||
<select
|
||||
v-model="simpleExtensionSettings.enableAard"
|
||||
@click="setExtensionMode('enableAard', $event)"
|
||||
>
|
||||
<option
|
||||
v-if="simpleExtensionSettings.enable === 'complex'"
|
||||
value="complex"
|
||||
>
|
||||
(Site uses advanced settings)
|
||||
</option>
|
||||
<template v-if="isDefaultConfiguration">
|
||||
<option value="disabled">
|
||||
Disabled (unless enabled for specific site)
|
||||
</option>
|
||||
</template>
|
||||
<template v-else>
|
||||
<option value="default">
|
||||
Use default ()
|
||||
</option>
|
||||
<option value="disabled">
|
||||
Never
|
||||
</option>
|
||||
</template>
|
||||
<option value="fs">
|
||||
Fullscreen only
|
||||
</option>
|
||||
<option value="theater">
|
||||
Fullscreen and theater mode
|
||||
</option>
|
||||
<option value="enabled">
|
||||
Always
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Enable keyboard -->
|
||||
<div class="field">
|
||||
<div class="label">
|
||||
Enable keyboard shortcuts under the following conditions
|
||||
</div>
|
||||
<div class="select">
|
||||
<select
|
||||
v-model="simpleExtensionSettings.enableKeyboard"
|
||||
@click="setExtensionMode('enableKeyboard', $event)"
|
||||
>
|
||||
<option
|
||||
v-if="simpleExtensionSettings.enable === 'complex'"
|
||||
value="complex"
|
||||
>
|
||||
(Site uses advanced settings)
|
||||
</option>
|
||||
<template v-if="isDefaultConfiguration">
|
||||
<option value="disabled">
|
||||
Disabled (unless enabled for specific site)
|
||||
</option>
|
||||
</template>
|
||||
<template v-else>
|
||||
<option value="default">
|
||||
Use default ()
|
||||
</option>
|
||||
<option value="disabled">
|
||||
Never
|
||||
</option>
|
||||
</template>
|
||||
<option value="fs">
|
||||
Fullscreen only
|
||||
</option>
|
||||
<option value="theater">
|
||||
Fullscreen and theater mode
|
||||
</option>
|
||||
<option value="enabled">
|
||||
Always
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Default crop -->
|
||||
<div class="field">
|
||||
<div class="label">Default crop:</div>
|
||||
<div class="select">
|
||||
<select
|
||||
v-model="siteDefaultCrop"
|
||||
@change="setOption('defaults.crop', $event)"
|
||||
>
|
||||
<option
|
||||
v-if="!isDefaultConfiguration"
|
||||
:value="JSON.stringify({useDefault: true})"
|
||||
>
|
||||
Use default ({{getCommandValue(settings?.active.commands.crop, siteSettings.data.defaults.crop)}})
|
||||
</option>
|
||||
<option
|
||||
v-for="(command, index) of settings?.active.commands.crop"
|
||||
:key="index"
|
||||
:value="JSON.stringify(command.arguments)"
|
||||
>
|
||||
{{command.label}}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="hint">This is how extension will crop video if/when autodetection is disabled. Pick 'Reset' option to keep aspect ratio as-is by default.</div>
|
||||
</div>
|
||||
|
||||
<!-- Default stretch -->
|
||||
<div class="field">
|
||||
<div class="label">Default stretch:</div>
|
||||
<div class="select">
|
||||
<select
|
||||
v-model="siteDefaultStretch"
|
||||
@change="setOption('defaults.stretch', $event)"
|
||||
>
|
||||
<option
|
||||
v-if="!isDefaultConfiguration"
|
||||
:value="JSON.stringify({useDefault: true})"
|
||||
>
|
||||
Use default ({{getCommandValue(settings?.active.commands.stretch, siteSettings.data.defaults.stretch)}})
|
||||
</option>
|
||||
<option
|
||||
v-for="(command, index) of settings?.active.commands.stretch"
|
||||
:key="index"
|
||||
:value="JSON.stringify(command.arguments)"
|
||||
>
|
||||
{{command.label}}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Default alignment -->
|
||||
<div class="field">
|
||||
<div class="label">Default alignment:</div>
|
||||
<div class="select">
|
||||
<select
|
||||
v-model="siteDefaultAlignment"
|
||||
@change="setOption('defaults.alignment', $event)"
|
||||
>
|
||||
<option
|
||||
v-if="!isDefaultConfiguration"
|
||||
:value="JSON.stringify({useDefault: true})"
|
||||
>
|
||||
Use default ({{getAlignmentLabel(siteSettings.data.defaults.alignment)}})
|
||||
</option>
|
||||
<option
|
||||
v-for="(command, index) of alignmentOptions"
|
||||
:key="index"
|
||||
:value="JSON.stringify(command.arguments)"
|
||||
>
|
||||
{{command.label}}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Crop, et. al. Persistence -->
|
||||
<div class="field">
|
||||
<div class="label">Persist crop, stretch, and alignment between videos</div>
|
||||
<div class="select">
|
||||
<select
|
||||
v-model="siteDefaultCropPersistence"
|
||||
@click="setOption('persistCSA', $event)"
|
||||
>
|
||||
<option
|
||||
v-if="!isDefaultConfiguration"
|
||||
:value="CropModePersistence.Default"
|
||||
>
|
||||
Use default ({{defaultPersistanceLabel}})
|
||||
</option>
|
||||
<option :value="CropModePersistence.Disabled">Disabled</option>
|
||||
<option :value="CropModePersistence.UntilPageReload">Until page reload</option>
|
||||
<option :value="CropModePersistence.CurrentSession">Current session</option>
|
||||
<option :value="CropModePersistence.Forever">Always persist</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ExtensionMode from '../../../../../common/enums/ExtensionMode.enum';
|
||||
import VideoAlignmentType from '../../../../../common/enums/VideoAlignmentType.enum';
|
||||
import CropModePersistence from './../../../../../common/enums/CropModePersistence.enum';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
CropModePersistence: CropModePersistence,
|
||||
alignmentOptions: [
|
||||
{label: 'Top left', arguments: {x: VideoAlignmentType.Left, y: VideoAlignmentType.Top}},
|
||||
{label: 'Top center', arguments: {x: VideoAlignmentType.Center, y: VideoAlignmentType.Top}},
|
||||
{label: 'Top right', arguments: {x: VideoAlignmentType.Right, y: VideoAlignmentType.Top}},
|
||||
{label: 'Left', arguments: {x: VideoAlignmentType.Left, y: VideoAlignmentType.Center}},
|
||||
{label: 'Center', arguments: {x: VideoAlignmentType.Center, y: VideoAlignmentType.Center}},
|
||||
{label: 'Right', arguments: {x: VideoAlignmentType.Right, y: VideoAlignmentType.Center}},
|
||||
{label: 'Bottom left', arguments: {x: VideoAlignmentType.Left, y: VideoAlignmentType.Bottom}},
|
||||
{label: 'Bottom center', arguments: {x: VideoAlignmentType.Center, y: VideoAlignmentType.Bottom}},
|
||||
{label: 'Bottom right', arguments: {x: VideoAlignmentType.Right, y: VideoAlignmentType.Bottom}}
|
||||
]
|
||||
}
|
||||
},
|
||||
mixins: [
|
||||
|
||||
],
|
||||
props: [
|
||||
'settings',
|
||||
'siteSettings',
|
||||
'isDefaultConfiguration'
|
||||
],
|
||||
components: {
|
||||
|
||||
},
|
||||
computed: {
|
||||
simpleExtensionSettings() {
|
||||
return {
|
||||
enable: this.compileSimpleSettings('enable'),
|
||||
enableAard: this.compileSimpleSettings('enableAard'),
|
||||
enableKeyboard: this.compileSimpleSettings('enableKeyboard'),
|
||||
}
|
||||
},
|
||||
siteDefaultCrop() {
|
||||
return this.siteSettings.raw?.defaults?.crop ? JSON.stringify(this.siteSettings.raw?.defaults?.crop) : JSON.stringify({useDefault: true});
|
||||
},
|
||||
siteDefaultStretch() {
|
||||
return this.siteSettings.raw?.defaults?.stretch ? JSON.stringify(this.siteSettings.raw?.defaults?.stretch) : JSON.stringify({useDefault: true});
|
||||
},
|
||||
siteDefaultAlignment() {
|
||||
return this.siteSettings.raw?.defaults?.alignment ? JSON.stringify(this.siteSettings.raw?.defaults?.alignment) : JSON.stringify({useDefault: true});
|
||||
},
|
||||
siteDefaultCropPersistence() {
|
||||
return this.siteSettings.raw?.persistCSA ?? undefined;
|
||||
},
|
||||
defaultPersistanceLabel() {
|
||||
switch (this.siteSettings.defaultSettings.persistCSA) {
|
||||
case CropModePersistence.CurrentSession:
|
||||
return 'current session';
|
||||
case CropModePersistence.Disabled:
|
||||
return 'disabled';
|
||||
case CropModePersistence.UntilPageReload:
|
||||
return 'until page reload';
|
||||
case CropModePersistence.Forever:
|
||||
return 'Always persist';
|
||||
}
|
||||
|
||||
return '??';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* Compiles our extension settings into more user-friendly options
|
||||
*/
|
||||
compileSimpleSettings(component) {
|
||||
try {
|
||||
if (
|
||||
this.siteSettings?.data?.[component]?.normal === ExtensionMode.Disabled
|
||||
&& this.siteSettings?.data?.[component]?.theater === ExtensionMode.Disabled
|
||||
&& this.siteSettings?.data?.[component]?.fullscreen === ExtensionMode.Disabled
|
||||
) {
|
||||
return 'disabled';
|
||||
}
|
||||
if (
|
||||
this.siteSettings?.data?.[component]?.normal === ExtensionMode.Default
|
||||
&& this.siteSettings?.data?.[component]?.theater === ExtensionMode.Default
|
||||
&& this.siteSettings?.data?.[component]?.fullscreen === ExtensionMode.Default
|
||||
) {
|
||||
return 'default';
|
||||
}
|
||||
if (
|
||||
this.siteSettings?.data?.[component]?.normal === ExtensionMode.Disabled
|
||||
&& this.siteSettings?.data?.[component]?.theater === ExtensionMode.Disabled
|
||||
&& this.siteSettings?.data?.[component]?.fullscreen === ExtensionMode.Enabled
|
||||
) {
|
||||
return 'fs';
|
||||
}
|
||||
if (
|
||||
this.siteSettings?.data?.[component]?.normal === ExtensionMode.Disabled
|
||||
&& this.siteSettings?.data?.[component]?.theater === ExtensionMode.Enabled
|
||||
&& this.siteSettings?.data?.[component]?.fullscreen === ExtensionMode.Enabled
|
||||
) {
|
||||
return 'theater';
|
||||
}
|
||||
if (
|
||||
this.siteSettings?.data?.[component]?.normal === ExtensionMode.Enabled
|
||||
&& this.siteSettings?.data?.[component]?.theater === ExtensionMode.Enabled
|
||||
&& this.siteSettings?.data?.[component]?.fullscreen === ExtensionMode.Enabled
|
||||
) {
|
||||
return 'enabled';
|
||||
}
|
||||
|
||||
return 'complex';
|
||||
} catch (e) {
|
||||
return 'loading';
|
||||
}
|
||||
},
|
||||
|
||||
getCommandValue(availableCommands, command) {
|
||||
for (const cmd of availableCommands) {
|
||||
if (JSON.stringify(cmd.arguments) === JSON.stringify(command)) {
|
||||
return cmd.label;
|
||||
}
|
||||
}
|
||||
return 'Unknown command';
|
||||
},
|
||||
|
||||
getAlignmentLabel(alignment) {
|
||||
// in case default settings don't have this set
|
||||
if (!alignment) {
|
||||
return 'Center'
|
||||
}
|
||||
|
||||
let x, y;
|
||||
if (alignment.x === VideoAlignmentType.Center) {
|
||||
x = 'center';
|
||||
} else if (alignment.x === VideoAlignmentType.Left) {
|
||||
x = 'left';
|
||||
} else if (alignment.x === VideoAlignmentType.Right) {
|
||||
x = 'right';
|
||||
} else {
|
||||
x = '??'
|
||||
}
|
||||
|
||||
if (alignment.y === VideoAlignmentType.Center) {
|
||||
y = 'center';
|
||||
} else if (alignment.y === VideoAlignmentType.Bottom) {
|
||||
y = 'bottom';
|
||||
} else if (alignment.y === VideoAlignmentType.Top) {
|
||||
y = 'top';
|
||||
} else {
|
||||
y = '???'
|
||||
};
|
||||
|
||||
if (x === y) {
|
||||
return x;
|
||||
}
|
||||
return `${y} ${x}`;
|
||||
},
|
||||
getOption(option) {
|
||||
|
||||
},
|
||||
async setOption(option, $event) {
|
||||
const value = $event.target.value;
|
||||
let commandArguments;
|
||||
|
||||
// if argument is json, parse json. Otherwise, pass the value as-is
|
||||
try {
|
||||
commandArguments = value !== undefined ? JSON.parse(value) : undefined;
|
||||
} catch(e) {
|
||||
commandArguments = value;
|
||||
}
|
||||
|
||||
if (commandArguments.useDefault) {
|
||||
commandArguments = undefined;
|
||||
}
|
||||
|
||||
await this.siteSettings.set(option, commandArguments);
|
||||
this.$nextTick( () => this.$forceUpdate() );
|
||||
},
|
||||
setExtensionMode(component, event) {
|
||||
const option = event.target.value;
|
||||
|
||||
if (option === 'complex') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (option === 'default') {
|
||||
return this.siteSettings.set(component, {
|
||||
normal: ExtensionMode.Default,
|
||||
theater: ExtensionMode.Default,
|
||||
fullscreen: ExtensionMode.Default
|
||||
});
|
||||
}
|
||||
if (option === 'disabled') {
|
||||
return this.siteSettings.set(component, {
|
||||
normal: ExtensionMode.Disabled,
|
||||
theater: ExtensionMode.Disabled,
|
||||
fullscreen: ExtensionMode.Disabled
|
||||
});
|
||||
}
|
||||
if (option === 'enabled') {
|
||||
return this.siteSettings.set(component, {
|
||||
normal: ExtensionMode.Enabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
fullscreen: ExtensionMode.Enabled
|
||||
});
|
||||
}
|
||||
if (option === 'theater') {
|
||||
return this.siteSettings.set(component, {
|
||||
normal: ExtensionMode.Disabled,
|
||||
theater: ExtensionMode.Enabled,
|
||||
fullscreen: ExtensionMode.Enabled
|
||||
});
|
||||
}
|
||||
if (option === 'fs') {
|
||||
return this.siteSettings.set(component, {
|
||||
normal: ExtensionMode.Disabled,
|
||||
theater: ExtensionMode.Disabled,
|
||||
fullscreen: ExtensionMode.Enabled
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" src="../../../../res/css/flex.scss" scoped></style>
|
||||
<style lang="scss" src="../../../res-common/panels.scss" scoped></style>
|
||||
<style lang="scss" src="../../../res-common/common.scss" scoped></style>
|
||||
<style scoped>
|
||||
.button-hover:hover {
|
||||
color: #fa6;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,244 @@
|
||||
<template>
|
||||
<div class="sub-panel-content flex flex-row flex-wrap">
|
||||
|
||||
<ShortcutButton
|
||||
v-for="(command, index) of settings?.active.commands.crop"
|
||||
class="flex b3 button"
|
||||
:class="{active: editMode ? index === editModeOptions?.crop?.selectedIndex : isActiveCrop(command)}"
|
||||
:key="index"
|
||||
:label="command.label"
|
||||
:shortcut="getKeyboardShortcutLabel(command)"
|
||||
@click="editMode ? editAction(command, index, 'crop') : execAction(command)"
|
||||
>
|
||||
</ShortcutButton>
|
||||
|
||||
<!-- "Add new" button -->
|
||||
<ShortcutButton
|
||||
v-if="editMode"
|
||||
class="button b3"
|
||||
:class="{active: editMode ? editModeOptions?.crop?.selectedIndex === null : isActiveCrop(command)}"
|
||||
label="Add new"
|
||||
@click="editAction(
|
||||
{action: 'set-ar', label: 'New aspect ratio', arguments: {type: AspectRatioType.Fixed}},
|
||||
null,
|
||||
'crop'
|
||||
)"
|
||||
></ShortcutButton>
|
||||
</div>
|
||||
|
||||
<!-- EDIT MODE PANEL -->
|
||||
<div
|
||||
v-if="editMode && !editModeOptions?.crop?.selected"
|
||||
class="sub-panel-content"
|
||||
>
|
||||
<div class="edit-action-area">
|
||||
Click a button to edit
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="editMode && editModeOptions?.crop?.selected" class="sub-panel-content">
|
||||
<div class="edit-action-area-header">
|
||||
<span class="text-primary">Editing options for:</span> <b>{{editModeOptions?.crop?.selected?.label}}</b>
|
||||
<template v-if="editModeOptions?.crop?.selectedIndex === null && editModeOptions?.crop?.selected?.label !== 'New aspect ratio'">(New ratio)</template>
|
||||
</div>
|
||||
<div class="edit-action-area">
|
||||
<!-- Some options are only shown for type 4 (fixed) crops -->
|
||||
<template v-if="editModeOptions?.crop?.selected?.arguments?.type === AspectRatioType.Fixed">
|
||||
<div class="field">
|
||||
<div class="label">
|
||||
Ratio:
|
||||
</div>
|
||||
<div class="input">
|
||||
<!-- We do an ugly in order to avoid spamming functions down at the bottom -->
|
||||
<input
|
||||
v-model="editModeOptions.crop.selected.arguments.ratio"
|
||||
@blur="editModeOptions.crop.selected.label === 'New aspect ratio' ? editModeOptions.crop.selected.label = editModeOptions.crop.selected.arguments.ratio : null"
|
||||
>
|
||||
</div>
|
||||
<div class="hint">
|
||||
You can enter a ratio in width:height format (e.g. "21:9" or "1:2.39"), or just the factor
|
||||
(in this case, "1:2.39" would become "2.39" and "21:9" would become "2.33"). You should enter
|
||||
your numbers without quote marks. Number will be converted to factor form on save.
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="label">
|
||||
Label:
|
||||
</div>
|
||||
<div class="input">
|
||||
<input v-model="editModeOptions.crop.selected.label">
|
||||
</div>
|
||||
<div class="hint">
|
||||
Label for the button. You can make it say something other than ratio.
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- editing keyboard shortcuts is always allowed -->
|
||||
<div class="field">
|
||||
<div class="label">Shortcut:</div>
|
||||
<div class="">
|
||||
<EditShortcutButton
|
||||
:shortcut="editModeOptions?.crop?.selected?.shortcut"
|
||||
@shortcutChanged="updateSelectedShortcut($event, 'crop')"
|
||||
>
|
||||
</EditShortcutButton>
|
||||
</div>
|
||||
<div class="hint">
|
||||
<b>Note:</b> Your browser and OS already use certain key combinations that involve Ctrl and Meta (Windows) keys — and, to a lesser extent, Alt.
|
||||
The extension doesn't (and cannot) check whether the keyboard shortcut you enter is actually free for you to use. The extension also won't override
|
||||
any keyboard shortcuts defined by the site itself.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row flex-end">
|
||||
<div
|
||||
v-if="editModeOptions?.crop?.selected?.arguments?.type === AspectRatioType.Fixed && editModeOptions?.crop?.selectedIndex !== null"
|
||||
class="button"
|
||||
@click="deleteAction('crop')"
|
||||
>
|
||||
<mdicon name="delete"></mdicon> Delete
|
||||
</div>
|
||||
<div class="flex-grow"></div>
|
||||
<div class="button" @click="cancelEdit('crop')">Cancel</div>
|
||||
<div class="button" @click="saveShortcut('crop')">
|
||||
<mdicon name="floppy"></mdicon>
|
||||
|
||||
<template v-if="editModeOptions?.crop?.selectedIndex === null">Add</template>
|
||||
<template v-else>Save</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="siteSettings" class="edit-action-area">
|
||||
<div class="field">
|
||||
<div class="label">Default for this site</div>
|
||||
<div class="select">
|
||||
<select
|
||||
:value="siteDefaultCrop"
|
||||
@change="setDefaultCrop($event, 'site')"
|
||||
>
|
||||
<option
|
||||
v-for="(command, index) of settings?.active.commands.crop"
|
||||
:key="index"
|
||||
:value="JSON.stringify(command.arguments)"
|
||||
>
|
||||
{{command.label}}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ShortcutButton from '../../../components/ShortcutButton.vue';
|
||||
import EditShortcutButton from '../../../components/EditShortcutButton';
|
||||
import EditModeMixin from '../../../utils/EditModeMixin';
|
||||
import KeyboardShortcutParserMixin from '../../../utils/KeyboardShortcutParserMixin';
|
||||
import CommsMixin from '../../../utils/CommsMixin';
|
||||
import AspectRatioType from '../../../../../common/enums/AspectRatioType.enum';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
|
||||
return {
|
||||
AspectRatioType: AspectRatioType,
|
||||
|
||||
// TODO: this should be mixin?
|
||||
resizerConfig: {
|
||||
crop: null,
|
||||
stretch: null,
|
||||
zoom: null,
|
||||
pan: null
|
||||
}
|
||||
}
|
||||
},
|
||||
mixins: [
|
||||
// ComputeActionsMixin,
|
||||
EditModeMixin,
|
||||
KeyboardShortcutParserMixin,
|
||||
CommsMixin
|
||||
],
|
||||
props: [
|
||||
'settings', // required for buttons and actions, which are global
|
||||
'siteSettings',
|
||||
'eventBus',
|
||||
'isEditing'
|
||||
],
|
||||
components: {
|
||||
ShortcutButton,
|
||||
EditShortcutButton,
|
||||
},
|
||||
computed: {
|
||||
siteDefaultCrop() {
|
||||
if (!this.siteSettings) {
|
||||
return null;
|
||||
}
|
||||
return JSON.stringify(
|
||||
this.siteSettings.data.defaults.crop
|
||||
);
|
||||
},
|
||||
},
|
||||
created() {
|
||||
if (this.isEditing) {
|
||||
this.enableEditMode();
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
isEditing(newValue, oldValue) {
|
||||
if (newValue) {
|
||||
this.enableEditMode();
|
||||
} else {
|
||||
this.disableEditMode();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* Sets default crop, for either site or global
|
||||
*/
|
||||
setDefaultCrop($event, scope) {
|
||||
if (!this.siteSettings) {
|
||||
return;
|
||||
}
|
||||
const commandArguments = JSON.parse($event.target.value);
|
||||
|
||||
this.siteSettings.set('defaults.crop', commandArguments);
|
||||
this.settings.saveWithoutReload();
|
||||
},
|
||||
|
||||
/**
|
||||
* Determines whether a given crop command is the currently active one
|
||||
*/
|
||||
isActiveCrop(cropCommand) {
|
||||
if (! this.resizerConfig.crop || !this.siteSettings) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const defaultCrop = this.siteSettings.data.defaults.crop;
|
||||
|
||||
if (cropCommand.arguments.type === AspectRatioType.Automatic) {
|
||||
return this.resizerConfig.crop.type === AspectRatioType.Automatic
|
||||
|| this.resizerConfig.crop.type === AspectRatioType.AutomaticUpdate
|
||||
|| this.resizerConfig.crop.type === AspectRatioType.Initial && defaultCrop === AspectRatioType.Automatic;
|
||||
}
|
||||
if (cropCommand.arguments.type === AspectRatioType.Reset) {
|
||||
return this.resizerConfig.crop.type === AspectRatioType.Reset
|
||||
|| this.resizerConfig.crop.type === AspectRatioType.Initial && defaultCrop !== AspectRatioType.Automatic;
|
||||
}
|
||||
if (cropCommand.arguments.type === AspectRatioType.Fixed) {
|
||||
return this.resizerConfig.crop.type === AspectRatioType.Fixed
|
||||
&& this.resizerConfig.crop.ratio === cropCommand.arguments.ratio;
|
||||
}
|
||||
// only legacy options (fitw, fith) left to handle:
|
||||
return cropCommand.arguments.type === this.resizerConfig.crop.type;
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" src="../../../../res/css/flex.scss" scoped></style>
|
||||
<style lang="scss" src="../../../res-common/panels.scss" scoped></style>
|
||||
<style lang="scss" src="../../../res-common/common.scss" scoped></style>
|
@ -0,0 +1,249 @@
|
||||
<template>
|
||||
<div class="sub-panel-content flex flex-row flex-wrap">
|
||||
<ShortcutButton
|
||||
v-for="(command, index) of settings?.active.commands.stretch"
|
||||
class="b3 button"
|
||||
:class="{active: editMode ? index === editModeOptions?.stretch?.selectedIndex : isActiveStretch(command)}"
|
||||
:key="index"
|
||||
:label="command.label"
|
||||
:shortcut="getKeyboardShortcutLabel(command)"
|
||||
@click="editMode ? editAction(command, index, 'stretch') : execAction(command)"
|
||||
>
|
||||
</ShortcutButton>
|
||||
|
||||
<!-- "Add new" button -->
|
||||
<ShortcutButton
|
||||
v-if="editMode"
|
||||
class="button b3"
|
||||
label="Add new"
|
||||
@click="editAction(
|
||||
{action: 'set-stretch', label: 'Stretch to ...', arguments: {type: StretchType.FixedSource}},
|
||||
null,
|
||||
'stretch'
|
||||
)"
|
||||
></ShortcutButton>
|
||||
</div>
|
||||
|
||||
<!-- EDIT MODE PANEL -->
|
||||
<div
|
||||
v-if="editMode && !editModeOptions?.stretch?.selected"
|
||||
class="sub-panel-content"
|
||||
>
|
||||
<div class="edit-action-area">
|
||||
Click a button to edit
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="editMode && editModeOptions?.stretch?.selected" class="sub-panel-content">
|
||||
<div class="edit-action-area-header">
|
||||
<span class="text-primary">Editing options for:</span> <b>{{editModeOptions?.stretch?.selected?.label}}</b>
|
||||
<template v-if="editModeOptions?.stretch?.selectedIndex === null && editModeOptions?.stretch?.selected?.label !== 'Stretch to ...'">(New option)</template>
|
||||
</div>
|
||||
<div class="edit-action-area">
|
||||
<!-- There are some special options for 'thin borders' -->
|
||||
<template v-if="editModeOptions?.stretch?.selected?.arguments?.type === StretchType.Conditional">
|
||||
<div class="field">
|
||||
<div class="label">
|
||||
Limit:
|
||||
</div>
|
||||
<div class="input">
|
||||
<input
|
||||
v-model="editModeOptions.stretch.selected.arguments.limit"
|
||||
>
|
||||
</div>
|
||||
<div class="hint">
|
||||
If vertical borders would take up less than this much of screen width, the image will be stretched. If the borders are too thick, image will not be stretched.
|
||||
Value of 1 means 100%. Value of 0.1 means vertical black bars can take up 10% of the width at most. There's no validation on this, use common sense.
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- Some options are only shown for type 5 (fixed) stretch -->
|
||||
<template v-if="editModeOptions?.stretch?.selected?.arguments?.type === StretchType.FixedSource">
|
||||
<div class="field">
|
||||
<div class="label">
|
||||
Ratio:
|
||||
</div>
|
||||
<div class="input">
|
||||
<!-- We do an ugly in order to avoid spamming functions down at the bottom -->
|
||||
<input
|
||||
v-model="editModeOptions.stretch.selected.arguments.ratio"
|
||||
@blur="editModeOptions.stretch.selected.label === 'Stretch to ...' ? editModeOptions.stretch.selected.label = `Stretch to ${editModeOptions.stretch.selected.arguments.ratio}` : null"
|
||||
>
|
||||
</div>
|
||||
<div class="hint">
|
||||
You can enter a ratio in width:height format (e.g. "21:9" or "1:2.39"), or just the factor
|
||||
(in this case, "1:2.39" would become "2.39" and "21:9" would become "2.33"). You should enter
|
||||
your numbers without quote marks. Number will be converted to factor form on save.
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="label">
|
||||
Label:
|
||||
</div>
|
||||
<div class="input">
|
||||
<input v-model="editModeOptions.stretch.selected.label">
|
||||
</div>
|
||||
<div class="hint">
|
||||
Label for the button. You can make it say something other than ratio.
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- editing keyboard shortcuts is always allowed -->
|
||||
<div class="field">
|
||||
<div class="label">Shortcut:</div>
|
||||
<div class="">
|
||||
<EditShortcutButton
|
||||
:shortcut="editModeOptions?.stretch?.selected?.shortcut"
|
||||
@shortcutChanged="updateSelectedShortcut($event, 'stretch')"
|
||||
>
|
||||
</EditShortcutButton>
|
||||
</div>
|
||||
<div class="hint">
|
||||
<b>Note:</b> Your browser and OS already use certain key combinations that involve Ctrl and Meta (Windows) keys — and, to a lesser extent, Alt.
|
||||
The extension doesn't (and cannot) check whether the keyboard shortcut you enter is actually free for you to use. The extension also won't override
|
||||
any keyboard shortcuts defined by the site itself.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row flex-end">
|
||||
<div
|
||||
v-if="editModeOptions?.stretch?.selected?.arguments?.type === StretchType.FixedSource && editModeOptions?.stretch?.selectedIndex !== null"
|
||||
class="button"
|
||||
@click="deleteAction('stretch')"
|
||||
>
|
||||
<mdicon name="delete"></mdicon> Delete
|
||||
</div>
|
||||
<div class="flex-grow"></div>
|
||||
<div class="button" @click="cancelEdit('stretch')">Cancel</div>
|
||||
<div class="button" @click="saveShortcut('stretch')">
|
||||
<mdicon name="floppy"></mdicon>
|
||||
|
||||
<template v-if="editModeOptions?.crop?.selectedIndex === null">Add</template>
|
||||
<template v-else>Save</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="siteSettings" class="edit-action-area">
|
||||
<div class="field">
|
||||
<div class="label">Default for this site:</div>
|
||||
<div class="select">
|
||||
<div class="select">
|
||||
<select
|
||||
v-model="siteDefaultStretchMode"
|
||||
@change="setDefaultStretchingMode($event, 'site')"
|
||||
>
|
||||
<option
|
||||
v-for="(command, index) of settings?.active.commands.stretch"
|
||||
:key="index"
|
||||
:value="JSON.stringify(command.arguments)"
|
||||
>
|
||||
{{command.label}}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ShortcutButton from '../../../components/ShortcutButton.vue';
|
||||
import EditShortcutButton from '../../../components/EditShortcutButton';
|
||||
import EditModeMixin from '../../../utils/EditModeMixin';
|
||||
import KeyboardShortcutParserMixin from '../../../utils/KeyboardShortcutParserMixin';
|
||||
import CommsMixin from '../../../utils/CommsMixin';
|
||||
import StretchType from '../../../../../common/enums/StretchType.enum';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
exec: null,
|
||||
StretchType: StretchType,
|
||||
|
||||
// TODO: this should be mixin?
|
||||
resizerConfig: {
|
||||
crop: null,
|
||||
stretch: null,
|
||||
zoom: null,
|
||||
pan: null
|
||||
}
|
||||
}
|
||||
},
|
||||
mixins: [
|
||||
// ComputeActionsMixin,
|
||||
EditModeMixin,
|
||||
KeyboardShortcutParserMixin,
|
||||
CommsMixin
|
||||
],
|
||||
props: [
|
||||
'settings', // required for buttons and actions, which are global
|
||||
'siteSettings',
|
||||
'eventBus',
|
||||
'isEditing'
|
||||
],
|
||||
components: {
|
||||
ShortcutButton,
|
||||
EditShortcutButton,
|
||||
},
|
||||
computed: {
|
||||
siteDefaultStretch() {
|
||||
if (!this.siteSettings) {
|
||||
return null;
|
||||
}
|
||||
return JSON.stringify(
|
||||
this.siteSettings.data.defaults.stretch
|
||||
);
|
||||
},
|
||||
},
|
||||
created() {
|
||||
if (this.isEditing) {
|
||||
this.enableEditMode();
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
isEditing(newValue, oldValue) {
|
||||
if (newValue) {
|
||||
this.enableEditMode();
|
||||
} else {
|
||||
this.disableEditMode();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* Sets default stretching mode, for either site or global
|
||||
*/
|
||||
setDefaultStretchingMode($event, globalOrSite) {
|
||||
if (!this.siteSettings) {
|
||||
return;
|
||||
}
|
||||
const commandArguments = JSON.parse($event.target.value);
|
||||
this.siteSettings.set('defaults.stretch', commandArguments);
|
||||
},
|
||||
|
||||
/**
|
||||
* Determines whether a given stretch command is the currently active one
|
||||
*/
|
||||
isActiveStretch(stretchCommand) {
|
||||
if (! this.resizerConfig.stretch || !this.siteSettings) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// const defaultCrop = this.settings.getDefaultStretch(this.site);
|
||||
|
||||
if ([StretchType.NoStretch, StretchType.Basic, StretchType.Hybrid, StretchType.Conditional, StretchType.Default].includes(stretchCommand.arguments.type)) {
|
||||
return this.resizerConfig.stretch.type === stretchCommand.arguments.type;
|
||||
}
|
||||
return this.resizerConfig.crop.type === stretchCommand.arguments.type && this.resizerConfig.crop.ratio === stretchCommand.arguments.ratio;
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" src="../../../../res/css/flex.scss" scoped></style>
|
||||
<style lang="scss" src="../../../res-common/panels.scss" scoped></style>
|
||||
<style lang="scss" src="../../../res-common/common.scss" scoped></style>
|