Compare commits
643 Commits
1.0.10@181
...
1.5.0-8
| Author | SHA1 | Date | |
|---|---|---|---|
| b0ba26918a | |||
| 3f756a78f4 | |||
| 80464c8342 | |||
| a587278586 | |||
| 00e8a342c0 | |||
| 203430c224 | |||
| 8c2a33b54d | |||
| 3f1832387a | |||
| cb78e4bc1d | |||
| f17adb764b | |||
| c73a940bae | |||
| 805b9ba2dc | |||
| 66bd753689 | |||
| c1358ef72f | |||
| 25bb62f622 | |||
| aab63aa8cc | |||
| 5e941b889c | |||
| b6c0ff80b6 | |||
| 97b24da0ed | |||
| a34a951a33 | |||
| 12ecc32e44 | |||
| b44f5c3678 | |||
| bdfae19796 | |||
| 5cb9bdd6dd | |||
| 9b8e6763af | |||
| 1e53bc1b37 | |||
| cfa77051e5 | |||
| 08de047d91 | |||
| da24fc6b20 | |||
| f4357b87db | |||
| 9fb761a38e | |||
| a79addc543 | |||
| 5edd63b2af | |||
| 7f1d68bf3a | |||
| 0d7ba4744f | |||
| c5c4091cf6 | |||
| 778c328a79 | |||
| 99f22c6a28 | |||
| 51719420ba | |||
| e5a8f12a15 | |||
| 3dc3404327 | |||
| 67fe7e655c | |||
| 4f55ea1b9f | |||
| 4f5ba6f14f | |||
| a7a4067a7f | |||
| 4d9fa6b961 | |||
| 55ea14864c | |||
| de1b690f36 | |||
| caafde56c8 | |||
| cb549b4995 | |||
|
|
d04c094543 | ||
|
|
2b51358c63 | ||
| 033eff6fcc | |||
| d5b34ed2c3 | |||
|
|
541318fbba | ||
| eab635cab6 | |||
| e4aa241351 | |||
|
|
760f6db560 | ||
|
|
d5fd97a83a | ||
|
|
d4fbdd149e | ||
|
|
3a1d398874 | ||
| 4b925199e5 | |||
| 599bb9b5bc | |||
| cdeea09dab | |||
| 710162a654 | |||
| 8347713f55 | |||
| afee47b6bc | |||
| 318d088fff | |||
| 08ec7643f7 | |||
|
|
0e66340b42 | ||
| 6c3c1f3423 | |||
| a748870195 | |||
| 5c8a573382 | |||
| db477e5d42 | |||
| 7c4d359aec | |||
| 88d3274241 | |||
| 00689a2036 | |||
| 39dae95f28 | |||
| 0c1bb71520 | |||
| 763abda557 | |||
| 3f75333542 | |||
| 11cfa40d78 | |||
| e884a2ebad | |||
| fac0dee693 | |||
| 2f28b0a66e | |||
| ad9b48b0d2 | |||
| 0e6a67d24a | |||
| eb7f9667ba | |||
| b8964c8017 | |||
| 1a08892868 | |||
|
|
42619e6555 | ||
|
|
eac4849326 | ||
|
|
0d99a7b24d | ||
| 6d0b1deebe | |||
| 959aa9f8e6 | |||
| 6814880b40 | |||
|
|
569bff9d60 | ||
| b9787a0a9f | |||
| 42d03e25c6 | |||
| 13f3b1ccce | |||
| 3981bbd37e | |||
| 67e71691eb | |||
| 567d142613 | |||
| 1b11be6827 | |||
| 519f771859 | |||
| 49a7e430cf | |||
| da7d07a891 | |||
| bf838ed5e4 | |||
| 8b795a0a7d | |||
| 243dfdd595 | |||
| 8bbc28d3c2 | |||
| c8f51adfaa | |||
| 4845a4b0cf | |||
|
|
ee4c121a54 | ||
|
|
8f340c9a3b | ||
| 67504198ec | |||
| ba0f505e34 | |||
| 33e2f705c3 | |||
| a26526b047 | |||
|
|
04e4fd1083 | ||
| 6e3b5114be | |||
| 6c40da165d | |||
| 7964145677 | |||
| f032f8b469 | |||
| e79e85af81 | |||
| 68d9d7f5b5 | |||
| 3454302a98 | |||
| 75b32ad3e0 | |||
| 20c035873e | |||
| 346ed469c8 | |||
|
|
029b115628 | ||
|
|
c7a91766af | ||
|
|
d00f925e58 | ||
|
|
fc3b28e978 | ||
| c4afa7ac60 | |||
| 3c3b0af49f | |||
| f206766191 | |||
| 67afb37f27 | |||
| ad150143a8 | |||
| 5d3b046c70 | |||
| 18bed926b3 | |||
| 1c868ae201 | |||
|
|
4820ade1f5 | ||
| bc2e6c1a85 | |||
| 6f45884f94 | |||
| a1cf871a84 | |||
| 7834dae075 | |||
| 15cba14cc3 | |||
| 3f74654ea2 | |||
| f16399ec2f | |||
| 0060e47db5 | |||
| 8bdb1233e8 | |||
| 2642b190b0 | |||
| 8975cbd71d | |||
| 32ac3c8421 | |||
| f5180dc144 | |||
| dac3ea8698 | |||
| 4ae8ea85f7 | |||
| 47495e7b8d | |||
| 73d25247f0 | |||
| f7c37e83ae | |||
| cf407f9a80 | |||
| d98217b679 | |||
|
|
269f844f43 | ||
|
|
488961c600 | ||
|
|
a5f0734201 | ||
| 94849c51e7 | |||
| 907d9d8dcf | |||
| 6641b6f458 | |||
| 98ef6a876f | |||
| d05f841bb4 | |||
| 4da3bb0209 | |||
|
|
2e471129b8 | ||
| 0ad1491634 | |||
| da32aa0a72 | |||
| f6117a4ec0 | |||
| 580ecb8c75 | |||
| 3c8ea907de | |||
| 8e68fb10ad | |||
| c9d7299092 | |||
| 0b6f6fccb1 | |||
| 6937f2b7fb | |||
| 086814cafa | |||
| 8021455a94 | |||
| c995f2232e | |||
| 6dc47f2b96 | |||
| af74503b99 | |||
| 58ecd41952 | |||
| e579c8dd24 | |||
| 7c600be77e | |||
| e3f7a2b738 | |||
| a90f49b324 | |||
| 3e9ecc8a7c | |||
| 7bb66de5f2 | |||
| 9b64128c92 | |||
| 6822c833be | |||
| cefe60c722 | |||
| ee885a173c | |||
|
|
d7c15163e1 | ||
| 879c458256 | |||
| 1a25e2a3f1 | |||
| 006a04683a | |||
| 3623a26a08 | |||
| c428a367a1 | |||
| 480108f3a2 | |||
| 2884a82dbf | |||
| ac4b392db8 | |||
| c3d360fa63 | |||
| 2d06ec7811 | |||
| 3f199f32ab | |||
|
|
1994d99294 | ||
|
|
cbc62f4903 | ||
| f40a82df57 | |||
|
|
0ef47da7b6 | ||
| 42cf8bf238 | |||
| 9cf915e5f7 | |||
| 478d9db2e2 | |||
| b824882eb2 | |||
|
|
4b3efc2e72 | ||
|
|
abf121bba4 | ||
|
|
c1bc10eca8 | ||
| 0e09258bfa | |||
|
|
3b7a573600 | ||
|
|
c68b6a17db | ||
| e767f28a8f | |||
| ddb163ab5c | |||
|
|
4194bf627c | ||
|
|
e3de677046 | ||
| d69ee1e97a | |||
|
|
3ddc898553 | ||
| 1dfb66c576 | |||
| 96e53bec56 | |||
| 18aee67607 | |||
| c416e5f39d | |||
| 61df972bde | |||
| a67f5a9b70 | |||
|
|
022e6459fc | ||
| cd9e9924f6 | |||
| e3da17ca6c | |||
| b99327a562 | |||
| 1b5472a141 | |||
| 8586483474 | |||
| dd3e4cb358 | |||
|
|
a3cb0a6693 | ||
|
|
7b53d0b549 | ||
| 79785362ae | |||
| 38cde695e4 | |||
|
|
3080f9786d | ||
|
|
1363fd2f22 | ||
|
|
7cc8518779 | ||
|
|
487ff500ab | ||
|
|
d2e4e10919 | ||
|
|
8994d016ef | ||
| d14ccef3bf | |||
| f77d11f3fc | |||
| 38aca0d740 | |||
|
|
249af1b4fa | ||
| 9fe8b3a067 | |||
| 0f55145586 | |||
| ede9ef3171 | |||
|
|
dfde94c384 | ||
| 0c7dd2b31f | |||
| 59bbcc09fb | |||
| 789950858d | |||
| 69d0e6597d | |||
|
|
9c80bb0601 | ||
| 92f9e5ca60 | |||
| 917d47e1c6 | |||
| b9bf4fc5d3 | |||
| e595c6b17b | |||
|
|
6eb6f49fea | ||
| f5a205a2af | |||
| 773a33f960 | |||
| 03e1c7340e | |||
| db4655e29b | |||
| 042f729006 | |||
| a68df32ac0 | |||
| da865f3e85 | |||
| 06188094bf | |||
| a4fe3dcaed | |||
| 22b6892b2d | |||
| 132afd3ca7 | |||
| ba3db5eb59 | |||
| 0f3ba2655a | |||
| ea4feec008 | |||
| 9de13741c8 | |||
| f3fc621de1 | |||
| 6745b88fb9 | |||
| da9f328316 | |||
| 5d03bedfac | |||
| c15859ed30 | |||
| 9fdf3017f0 | |||
| 89e61f669b | |||
| 83abd2a5cd | |||
| db273a8502 | |||
| 93b32a7796 | |||
| 4d3b134fe7 | |||
| 7477fe1956 | |||
| 26150bda5a | |||
| 3193ca00ab | |||
| 437fed841b | |||
| 165b1de49e | |||
| df05e23415 | |||
| 133a9ffd46 | |||
| ff846fb6d0 | |||
| b6eceebc26 | |||
| 61582251c7 | |||
| 4ce3759902 | |||
| ebf7d1312e | |||
| 07b16a4efb | |||
| 0da04b5aed | |||
| 87ff52dd03 | |||
| 641b43d8a0 | |||
| 31f4b53f68 | |||
| 7e0de7889e | |||
| 87440918e0 | |||
| 07a6f990bd | |||
| 5075d638e5 | |||
| 909f9cad31 | |||
| 71dcd3960a | |||
| 0dda2fa11a | |||
| 9a5fe4394b | |||
| 51311e74ba | |||
| 63f9906526 | |||
| 0fa233afce | |||
| c79b890985 | |||
| 9529cd2071 | |||
| ab1f04fe8e | |||
| f28a048bd9 | |||
| 45d1cdd2d1 | |||
| 5dc2405068 | |||
| 37c6876e28 | |||
| 524a97ef0d | |||
| 10227c6928 | |||
| e8d75bcb20 | |||
| 5ccd378fc0 | |||
| eb0a23d82c | |||
| 2c9a386e25 | |||
| 4bb5fd3a30 | |||
| 4a840d89d8 | |||
| 7bfabc825a | |||
| 73aa90c2db | |||
| 3cee225331 | |||
| 98dc8bdfd1 | |||
| 1725bce452 | |||
| d4a0117fab | |||
| 74b744aa02 | |||
| 03d526549c | |||
| be1b26378e | |||
| a5fa577099 | |||
| 76691eedd0 | |||
| c447922233 | |||
|
|
13e561277c | ||
|
|
22dfc27130 | ||
| 5f1745ef27 | |||
|
|
c02d776466 | ||
| 19a2eaf8db | |||
| 40c54af482 | |||
| 55528cf3d1 | |||
| 403281e489 | |||
|
|
7b6866cdb0 | ||
|
|
20b4fe2f66 | ||
|
|
92a0cbd01b | ||
|
|
44814fb791 | ||
|
|
14f4eb0371 | ||
|
|
9a874d65d2 | ||
|
|
c8c2cc3c9c | ||
|
|
e758b99f55 | ||
|
|
e9fd4f4110 | ||
|
|
1b3aad52d1 | ||
|
|
1f98b627d7 | ||
|
|
bd5bb64b13 | ||
|
|
8e7d14efc4 | ||
|
|
e71419b7e5 | ||
|
|
3d979a292e | ||
|
|
40a1a42433 | ||
|
|
f19dfe65eb | ||
|
|
2bb88ac84d | ||
|
|
d6129ebd28 | ||
|
|
3fa95419ce | ||
|
|
034e9c1598 | ||
|
|
fa013cec91 | ||
|
|
aa91b5a865 | ||
|
|
4ecb91a6b5 | ||
|
|
9a6e3ccc39 | ||
|
|
8b021ec4b7 | ||
|
|
5104dbd387 | ||
|
|
c21504b43f | ||
|
|
efd7544b8c | ||
|
|
92a5c27401 | ||
|
|
caeabd15d0 | ||
|
|
26ceff2ad2 | ||
|
|
53edb41250 | ||
|
|
e910472fa6 | ||
|
|
0dd9641e76 | ||
|
|
d58ebd684a | ||
|
|
6516f47f56 | ||
|
|
fce45667fc | ||
|
|
1c8a3d87da | ||
|
|
09dd487b60 | ||
|
|
fadca6e8c5 | ||
|
|
4a9c5cda27 | ||
|
|
daa312c162 | ||
|
|
ba0c2ca311 | ||
|
|
d0cb142952 | ||
|
|
88c7f8cef9 | ||
|
|
097ed2d74c | ||
|
|
4adc26d2f2 | ||
|
|
4f8c5a7b46 | ||
|
|
1fc426cb1a | ||
|
|
759b96e764 | ||
|
|
d1ccf7b2d1 | ||
|
|
ddeab2831e | ||
|
|
bb80ba1b83 | ||
|
|
1c9d1c75f3 | ||
|
|
825b377a78 | ||
|
|
35785a7387 | ||
|
|
03459caabc | ||
|
|
e4809de977 | ||
|
|
dc5795f8ae | ||
|
|
3dadba3556 | ||
|
|
0c0ea08f09 | ||
|
|
7b7651b5f8 | ||
|
|
7edf787c28 | ||
|
|
9e685245b9 | ||
|
|
8710cb0480 | ||
|
|
8cd924c8ac | ||
|
|
46a539c739 | ||
|
|
de8af8c4ad | ||
|
|
b89b9cd5c9 | ||
|
|
482e1fb597 | ||
|
|
84fdeabd6d | ||
|
|
e19cf1998e | ||
|
|
3cbf0649ad | ||
|
|
ddde3ecc4e | ||
|
|
eda5ab7656 | ||
|
|
c865d8b1a1 | ||
|
|
eeba46c703 | ||
|
|
b13337653d | ||
|
|
8ed615459f | ||
|
|
f72cf64cce | ||
|
|
a6f35d4fdb | ||
|
|
daa345cac9 | ||
|
|
0d3e33330e | ||
|
|
950051032e | ||
|
|
0bd1f610d1 | ||
|
|
5fe06b267c | ||
|
|
d7fc82e292 | ||
|
|
0de011e28d | ||
|
|
e3e1fb618a | ||
|
|
bcc93e0e9f | ||
|
|
8238571064 | ||
|
|
638219fd45 | ||
|
|
417f1aed61 | ||
|
|
7d06c3afbc | ||
|
|
4b7509fedd | ||
|
|
a2a1a54913 | ||
|
|
8592bddc0d | ||
|
|
d3a352748a | ||
|
|
bd69b981a7 | ||
|
|
203813b7ec | ||
|
|
58da098a11 | ||
|
|
9ce18af5cf | ||
|
|
7bbfa758c1 | ||
|
|
17f5cf5e7e | ||
|
|
6bd6c33e70 | ||
|
|
b044418869 | ||
|
|
76308b9489 | ||
|
|
e6ed9e9822 | ||
|
|
c6e933999b | ||
|
|
32774754a4 | ||
|
|
8fd5cdb062 | ||
|
|
347f7989ec | ||
|
|
d09e2f2432 | ||
|
|
055458ed46 | ||
|
|
03164c8b4c | ||
|
|
59c4e7ad1f | ||
|
|
687fc606a1 | ||
|
|
879d672a62 | ||
|
|
e1a5bb3998 | ||
|
|
f4afecf77c | ||
|
|
b092b571e2 | ||
|
|
f29532b481 | ||
|
|
943009252b | ||
|
|
131b8980ac | ||
|
|
e316ad3a5a | ||
|
|
971d074f3c | ||
|
|
4886a5f191 | ||
|
|
21de0e6d5a | ||
|
|
95bc11d2f1 | ||
|
|
4d3fa4a268 | ||
|
|
15befb403e | ||
|
|
e3a0d1ec96 | ||
|
|
e5c01f19d3 | ||
|
|
4bdd52307c | ||
|
|
1579763bb2 | ||
|
|
19ae94cd2c | ||
|
|
debb7c0da8 | ||
|
|
47b23d76cf | ||
|
|
bb2496a8a7 | ||
|
|
57a2523b1c | ||
|
|
5f04fbdf01 | ||
|
|
f34872a4c4 | ||
|
|
b373ccb3dc | ||
|
|
79dadbec68 | ||
|
|
96eea155da | ||
|
|
2b6e29b1c2 | ||
|
|
6b8933634b | ||
|
|
e7ca1d7742 | ||
|
|
c24374c4c0 | ||
|
|
42f83f1040 | ||
|
|
8a6bc41b4d | ||
|
|
cffa6cca1b | ||
|
|
dfdb9c5a27 | ||
|
|
9b5498af1c | ||
|
|
1b698dbb2d | ||
|
|
a9f7ba3ff2 | ||
|
|
427aa42ace | ||
|
|
91a7f66d9c | ||
|
|
0c3af11f45 | ||
|
|
eb80167e31 | ||
|
|
23438a6122 | ||
|
|
bc682f4bef | ||
|
|
2ce27624ce | ||
|
|
37e979787e | ||
|
|
547f825f54 | ||
|
|
677bc95882 | ||
|
|
c54dd07563 | ||
|
|
1d6d1c972c | ||
|
|
b136b61893 | ||
|
|
0a91878fd5 | ||
|
|
2e3ce0aed1 | ||
|
|
bf1bd66bbe | ||
|
|
9b9032eee8 | ||
|
|
9b30a9b0b6 | ||
|
|
e26298cab0 | ||
|
|
8f7f20b83d | ||
|
|
217b08922f | ||
|
|
03002d4b60 | ||
|
|
1cd5fbe6fe | ||
|
|
8334746a5c | ||
|
|
b9e6ad6881 | ||
|
|
4e8d9f5b88 | ||
|
|
675139500a | ||
|
|
46de6718c3 | ||
|
|
05b8383fb3 | ||
|
|
529fccd4fd | ||
|
|
97bf8cf820 | ||
|
|
8f7476a369 | ||
|
|
9e9ffd9c44 | ||
|
|
157c1c3979 | ||
|
|
f9bc928250 | ||
|
|
35ed1a5db5 | ||
|
|
38fdd3aaa6 | ||
|
|
73f6fd5519 | ||
|
|
db75c29143 | ||
|
|
2c2c434fec | ||
|
|
24e1ee5210 | ||
|
|
ede9be2693 | ||
|
|
3ca87e1285 | ||
|
|
777ff469b9 | ||
|
|
86ab612ea3 | ||
|
|
2744a91ec7 | ||
|
|
85fed3247a | ||
|
|
51aded3d2d | ||
|
|
5d0939d8de | ||
|
|
fcb036801e | ||
|
|
d962ada7e5 | ||
|
|
3f52c3063a | ||
|
|
bf94690223 | ||
|
|
8516f21c18 | ||
|
|
9d69328615 | ||
|
|
14fb5f7c76 | ||
|
|
788f613a5b | ||
|
|
1c9da2f52f | ||
|
|
37efb8d633 | ||
|
|
294598faf6 | ||
|
|
1116a3f050 | ||
|
|
67ffdc8105 | ||
|
|
04fe30145d | ||
|
|
61f3868c42 | ||
|
|
987425b22a | ||
|
|
c886f6afd2 | ||
|
|
e6d7af1fc4 | ||
|
|
0691577b96 | ||
|
|
876d5b5e8a | ||
|
|
4d895e464d | ||
|
|
252d6bf7f6 | ||
|
|
ea03a67b4a | ||
|
|
3adbeb987a | ||
|
|
23fdc62b81 | ||
|
|
b88691c9e5 | ||
|
|
3c4b907091 | ||
|
|
1c00e63f48 | ||
|
|
59006ff474 | ||
|
|
616c0afff1 | ||
|
|
84899871e1 | ||
|
|
ed042ee230 | ||
|
|
3c44ec33f9 | ||
|
|
02d7bc3f33 | ||
|
|
492b37be41 | ||
|
|
c237f228a8 | ||
|
|
7a523a9ddb | ||
|
|
972366de14 | ||
|
|
aeb96c2c8a | ||
|
|
68f98c8a65 | ||
|
|
61b09db04b | ||
|
|
de2035e1e0 | ||
|
|
b4bd45566e | ||
|
|
692488a11f | ||
|
|
bd27200ba8 | ||
|
|
7e30a4272e | ||
|
|
945007f73d | ||
|
|
fc9c912f99 | ||
|
|
bf67161898 | ||
|
|
f029ab1ce6 | ||
|
|
bfd099a82e | ||
|
|
d9a284994e | ||
|
|
e6df0ae3af | ||
|
|
e14ccce2cc | ||
|
|
60111cd8b1 | ||
|
|
fb81a7e954 | ||
|
|
218221c069 | ||
|
|
a001241c5d | ||
|
|
a8a9f041f0 | ||
|
|
67df756156 | ||
|
|
a73afaf951 | ||
|
|
fe439ec25a | ||
|
|
2fa55d3c90 | ||
|
|
c76e6638a4 | ||
|
|
cd3cbf186c | ||
|
|
38956e2669 | ||
|
|
62a13e18cc | ||
|
|
52d05a7f48 | ||
|
|
612a61a5b1 | ||
|
|
17ba0bb00e | ||
|
|
5f473c9e72 | ||
|
|
e0ac834c78 | ||
|
|
604ac65172 | ||
|
|
dad2a630c7 | ||
|
|
2bf876262f | ||
|
|
972eab191c | ||
|
|
9fd84a8938 |
3
.gitattributes
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
*.jim linguist-language=tcl
|
||||
*.class linguist-language=tcl
|
||||
|
||||
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
ignore:*
|
||||
@@ -1,6 +1,6 @@
|
||||
var/mongoose/html/css/EXTRA.css
|
||||
var/mongoose/html/favicon.ico
|
||||
var/mongoose/html/img/fav/57.png
|
||||
var/mongoose/html/img/fav/72.png
|
||||
var/mongoose/html/img/fav/114.png
|
||||
var/mongoose/html/img/fav/144.png
|
||||
webif/html/css/EXTRA.css
|
||||
webif/html/favicon.ico
|
||||
webif/html/img/fav/57.png
|
||||
webif/html/img/fav/72.png
|
||||
webif/html/img/fav/114.png
|
||||
webif/html/img/fav/144.png
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
Package: webif
|
||||
Priority: optional
|
||||
Section: web
|
||||
Version: 1.0.9-6
|
||||
Version: 1.5.0-8
|
||||
Architecture: mipsel
|
||||
Maintainer: af123@hummypkg.org.uk
|
||||
Depends: webif-channelicons(>=1.1.9),mongoose(>=3.0.11),jim(>=0.75),jim-oo,jim-sqlite3(>=0.75),jim-cgi(>=0.7),jim-binary(>=0.75),service-control(>=1.2),busybox(>=1.20.2-1),lsof,epg(>=1.0.13),hmt(>=1.1.14),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2),stripts(>=1.2.5-3),smartmontools,tmenu(>=1.05),ffmpeg,id3v2,multienv(>=1.6)
|
||||
Maintainer: af123@hpkg.tv
|
||||
Depends: tcpfix,webif-channelicons(>=1.1.27),lighttpd(>=1.4.39-1),jim(>=0.81-3),jim-cgi(>=0.7-2),service-control(>=2.3),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.8),hmt(>=2.0.11),ssmtp,cron-daemon(>=1.18.3-3),at(>=3.1.18),anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.1.13),webif-charts(>=1.2-1),stripts(>=1.4.2),tmenu(>=1.21-2),ffmpeg(>=2.8),id3v2,multienv(>=1.6),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,recmon(>=2.0.7),hwctl,nugget(>=0.98),sqlite3(>=3.15.1),jim-xconv,zip(>=3.0-1),wget
|
||||
Suggests:
|
||||
Description: An evolving web interface for the Humax.
|
||||
Tags: http://hummy.tv/forum/threads/4659/
|
||||
Tags: https://hummy.tv/forum/threads/10581/
|
||||
|
||||
@@ -1,6 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Postinstall $*"
|
||||
# Relocate any stray files in /mod/var/mongoose
|
||||
|
||||
if [ -d /mod/var/mongoose -a ! -h /mod/var/mongoose ]; then
|
||||
(
|
||||
cd /mod/var/mongoose
|
||||
find . | cpio -pmud /mod/webif
|
||||
cd /mod/var
|
||||
rm -rf mongoose
|
||||
ln -s ../webif mongoose
|
||||
)
|
||||
fi
|
||||
|
||||
export tmpf=/tmp/cronf.$$
|
||||
|
||||
@@ -8,9 +18,11 @@ export tmpf=/tmp/cronf.$$
|
||||
|
||||
crontab=$PKG_ROOT/bin/crontab
|
||||
if [ -x $crontab ]; then
|
||||
$crontab -l | grep -v webif/lib/bin/auto > $tmpf
|
||||
$crontab -l | grep -v webif/lib/bin/auto \
|
||||
| grep -v webif/lib/auto > $tmpf
|
||||
cat $tmpf - << EOM | $crontab -
|
||||
*/10 * * * * /mod/webif/lib/bin/auto >/dev/null 2>&1
|
||||
* * * * * /mod/webif/lib/auto/scan >/dev/null 2>>/mod/tmp/auto.log
|
||||
* * * * * /mod/webif/lib/auto/deq >/dev/null 2>>/mod/tmp/auto.log
|
||||
EOM
|
||||
fi
|
||||
|
||||
@@ -19,27 +31,37 @@ fi
|
||||
ana=$PKG_ROOT/etc/anacrontab
|
||||
egrep -v 'backup/backup.jim|bin/diskattrs' $ana > $tmpf
|
||||
cat $tmpf - << EOM > $ana
|
||||
1 8 sched_backup /mod/webif/cgi-bin/backup/backup.jim
|
||||
1 8 sched_backup /mod/webif/html/sched/backup/backup.jim
|
||||
1 5 diskattrs /mod/webif/lib/bin/diskattrs
|
||||
EOM
|
||||
|
||||
$PKG_ROOT/etc/init.d/S02anacron start < /dev/null > /dev/null 2>&1 &
|
||||
|
||||
[ -f /tmp/webif_auto.log ] && rm -f /tmp/webif_auto.log
|
||||
|
||||
if [ ! -f /mod/webif/.strip-updated ]; then
|
||||
echo "*********************************"
|
||||
echo "* Please wait while any shrunk recordings are flagged..."
|
||||
echo "*********************************"
|
||||
/mod/webif/lib/bin/strip-update
|
||||
|
||||
touch /mod/webif/.strip-updated
|
||||
fi
|
||||
[ -f /mod/webif/.strip-updated ] && rm -f /mod/webif/.strip-updated
|
||||
|
||||
/mod/webif/lib/bin/diskattrs
|
||||
/mod/webif/lib/auto/upgrade
|
||||
#/mod/webif/lib/bin/resetnew
|
||||
|
||||
# Remove hook script placed by the legacy rt3070 package which does not work
|
||||
# with CFW >= 3.00
|
||||
hook=/mod/boot/xinit.d/rt3070
|
||||
[ -f $hook ] && rm -f $hook
|
||||
|
||||
# Remove legacy mongoose startup script
|
||||
[ -f /mod/etc/init.d/Z01mongoose ] && rm -f /mod/etc/init.d/Z01mongoose
|
||||
|
||||
# Migrate record log to new name.
|
||||
(
|
||||
cd /mod/tmp
|
||||
[ -f record.log -a ! -f activity.log ] && mv record.log activity.log
|
||||
)
|
||||
|
||||
[ -f $tmpf ] && rm -f $tmpf
|
||||
|
||||
# Remove empty directories
|
||||
find /mod/webif/ -type d -exec rmdir {} \; 2>/dev/null
|
||||
|
||||
exit 0
|
||||
|
||||
|
||||
23
CONTROL/preinst
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Handle moving the legacy /var/mongoose directory to /webif..
|
||||
|
||||
if [ -h /mod/webif -a -d /mod/var/mongoose -a ! -h /mod/var/mongoose ]; then
|
||||
echo "Relocating web interface files..."
|
||||
|
||||
cd /mod
|
||||
rm webif || exit 1
|
||||
mv var/mongoose webif || exit 1
|
||||
cd var
|
||||
ln -s ../webif mongoose
|
||||
fi
|
||||
|
||||
if [ ! -f /mod/webif/.pfixpkg -a -x /mod/bin/at ]; then
|
||||
/mod/bin/at now + 1 minute << EOM
|
||||
diag fixpkg
|
||||
touch /mod/webif/.pfixpkg
|
||||
EOM
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -4,7 +4,8 @@ export tmpf=/tmp/cronf.$$
|
||||
|
||||
crontab=$PKG_ROOT/bin/crontab
|
||||
if [ -x $crontab ]; then
|
||||
$crontab -l | grep -v webif/lib/bin/auto > $tmpf
|
||||
$crontab -l | grep -v webif/lib/bin/auto \
|
||||
| grep -v webif/lib/auto > $tmpf
|
||||
[ -s $tmpf ] && $crontab $tmpf || $crontab -r
|
||||
fi
|
||||
|
||||
|
||||
2
README.md
Normal file
@@ -0,0 +1,2 @@
|
||||
# webif
|
||||
An evolving web interface for the Humax HD[R] Fox T2 customised firmware.
|
||||
1
bin/reboot
Symbolic link
@@ -0,0 +1 @@
|
||||
../webif/lib/bin/reboot
|
||||
23
bin/version
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
source /mod/webif/lib/setup
|
||||
require system.class
|
||||
|
||||
set modver [system modversion]
|
||||
set modbuild [system modbuild]
|
||||
if {$modbuild > 0} {
|
||||
append modver " (build $modbuild)"
|
||||
}
|
||||
catch {set fhtcpversion [system fhtcpversion]}
|
||||
catch {set kernelver [system kernelver]}
|
||||
|
||||
puts "
|
||||
Humax [system model] Fox T2 ([system hostname])
|
||||
Humax Version: $fhtcpversion (kernel $kernelver)
|
||||
Custom firmware version: $modver
|
||||
Web interface version: [system pkgver webif]
|
||||
Serial Number: [system serialno]
|
||||
Encryption Key: [system encryptionkey]
|
||||
Last Boot Reason: [system lastbootreason]
|
||||
"
|
||||
|
||||
BIN
boot/xinit.d/ahw
Executable file
18
etc/init.d/S59webif
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /mod/webif/lib/lib.sh
|
||||
|
||||
export TZ=GMT+0BST,M3.5.0/1,M10.5.0/2
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
/mod/webif/lib/bin/manage_logs
|
||||
plog activity "System booted (`lbr_descr`)."
|
||||
;;
|
||||
stop)
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -10,7 +10,14 @@ fi
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
/mod/bin/epg -f $epg sqlitedumpd $epgdb > /tmp/epgd.log 2>&1 &
|
||||
(
|
||||
ulimit -c unlimited
|
||||
while [ 1 ]; do
|
||||
/mod/bin/epg -f $epg sqlitedumpd $epgdb \
|
||||
> /tmp/epgd.log 2>&1
|
||||
[ $? -eq 143 ] && break
|
||||
done
|
||||
)&
|
||||
;;
|
||||
stop)
|
||||
killall -q epg
|
||||
|
||||
3
etc/modservice.d/epg
Normal file
@@ -0,0 +1,3 @@
|
||||
key=/mod/bin/epg
|
||||
rc=60parseepg
|
||||
proc="/mod/bin/epg.*sqlitedumpd"
|
||||
31
etc/recmon.d/autotrigger
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
if {[lindex $argv 0] ne "-stop"} exit
|
||||
|
||||
source /mod/webif/lib/setup
|
||||
require system.class settings.class lock
|
||||
|
||||
set loglevel [[settings] autolog]
|
||||
|
||||
set file [lindex $argv 1]
|
||||
set dir [file dirname $file]
|
||||
|
||||
set prefix "autotrigger\[[pid]\]"
|
||||
if {$loglevel > 0} {
|
||||
system plog auto "$prefix: $file"
|
||||
system plog auto "$prefix: will run for $dir"
|
||||
}
|
||||
|
||||
# Wait up to 10 minutes for any existing auto process to finish...
|
||||
if {![acquire_lock webif_autoscan 600 5]} {
|
||||
puts "Cannot acquire exclusive lock, terminating."
|
||||
system plog auto "$prefix: failed to get lock"
|
||||
exit
|
||||
}
|
||||
if {$loglevel > 0} { system plog auto "$prefix: got lock" }
|
||||
|
||||
exec /mod/webif/lib/auto/scan -f -prelocked -logprefix "$prefix: " \
|
||||
-singledir $dir
|
||||
|
||||
if {$loglevel > 0} { system plog auto "$prefix: done" }
|
||||
|
||||
21
etc/recmon.d/webiflog
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
if {[lindex $argv 0] ne "-stop"} exit
|
||||
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class system.class
|
||||
|
||||
set file [lindex $argv 1]
|
||||
set ts [ts fetch "$file.ts"]
|
||||
set root [system mediaroot]
|
||||
|
||||
set dir [file dirname $file]
|
||||
if {[string match "$root*" $dir]} {
|
||||
set dir [string range $dir $([string length $root] + 1) end]
|
||||
}
|
||||
set ch [$ts get channel_name]
|
||||
set dur [$ts duration]
|
||||
set title [$ts get title]
|
||||
|
||||
system plog activity "Recorded: $dir/$title ($dur minutes - $ch)"
|
||||
|
||||
0
var/backup/.gitignore
vendored
Normal file
1
var/mongoose
Symbolic link
@@ -0,0 +1 @@
|
||||
../webif
|
||||
@@ -1,70 +0,0 @@
|
||||
|
||||
function refresh_files()
|
||||
{
|
||||
$('#backup_files').load('/cgi-bin/backup/files.jim', function() {
|
||||
$('input.restore').change(function() {
|
||||
$('#restore_button').removeAttr('disabled')
|
||||
.button('option', 'disabled', false);
|
||||
$('#delete_button').removeAttr('disabled')
|
||||
.button('option', 'disabled', false);
|
||||
$('#view_button').removeAttr('disabled')
|
||||
.button('option', 'disabled', false);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('button').button();
|
||||
|
||||
refresh_files();
|
||||
|
||||
$('#backup_button').click(function() {
|
||||
$('#backup_working').slideDown();
|
||||
$('#results').load('/cgi-bin/backup/backup.jim?' +
|
||||
$('#backup_name').serialize(), function() {
|
||||
$('#results').slideDown(function() {
|
||||
$('#backup_working').slideUp();
|
||||
refresh_files();
|
||||
});
|
||||
});
|
||||
});
|
||||
$('#delete_button').click(function() {
|
||||
var backup = $('input.restore:checked').val();
|
||||
if (confirm('Confirm deletion of ' + backup))
|
||||
{
|
||||
$('#results').load('/cgi-bin/backup/delete.jim?' +
|
||||
$('input.restore').serialize(), function() {
|
||||
$('#results').slideDown(function() {
|
||||
refresh_files();
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
$('#view_button').click(function() {
|
||||
var backup = $('input.restore:checked').val();
|
||||
$('#results').load('/cgi-bin/backup/view.jim?' +
|
||||
$('input.restore').serialize(), function() {
|
||||
$('#results').slideDown(function() {
|
||||
refresh_files();
|
||||
});
|
||||
});
|
||||
});
|
||||
$('#restore_button').click(function() {
|
||||
var backup = $('input.restore:checked').val();
|
||||
if (confirm('!!!!!!!!!!!!!!!!!!!!!!!!! PLEASE CONFIRM !!!!!!!!!!!!!!!!!!!!!!!!!\n\nAre you sure you wish to erase all scheduled recordings and favourite channels and then restore them from\n' + backup + '?'))
|
||||
{
|
||||
$('#restore_working').slideDown();
|
||||
$('#results').load('/cgi-bin/backup/restore.jim?' +
|
||||
$('input.restore').serialize(), function() {
|
||||
$('#results').slideDown(function() {
|
||||
$('#restore_working').slideUp();
|
||||
refresh_files();
|
||||
$('#restore_warning').slideDown();
|
||||
$('#restart_block').load(
|
||||
'/cgi-bin/restartblock.jim');
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
|
||||
require rsv.class findhsvc
|
||||
|
||||
set dir /mod/var/backup
|
||||
|
||||
httpheader
|
||||
|
||||
set file [file tail [cgi_get restore_file]]
|
||||
if {$file == 0} {
|
||||
puts "No filename supplied."
|
||||
exit
|
||||
}
|
||||
|
||||
set ffile "/$dir/$file.rbk"
|
||||
|
||||
if {![file exists $ffile]} {
|
||||
puts "Backup file <i>$file</i> does not exist."
|
||||
exit
|
||||
}
|
||||
|
||||
if {[catch { set fd [open $ffile r] } msg]} {
|
||||
puts "Error opening <i>$file</i> - $msg"
|
||||
exit
|
||||
}
|
||||
|
||||
puts "Listing scheduled events from <i>$file</i>..."
|
||||
|
||||
set fields [lsort [[rsv] vars]]
|
||||
|
||||
set data [split [read $fd] "\n"]
|
||||
|
||||
foreach line $data {
|
||||
set vals [split $line "\t"]
|
||||
if {[lindex $vals 0] ne "event"} { continue }
|
||||
set vars {}
|
||||
set i 0
|
||||
foreach f $fields {
|
||||
if {$f eq "aulEventToRecordInfo"} { continue }
|
||||
incr i
|
||||
lappend vars $f [lindex $vals $i]
|
||||
}
|
||||
|
||||
set rsv [rsv new $vars]
|
||||
|
||||
puts " [$rsv name] ([$rsv channel_name])"
|
||||
}
|
||||
|
||||
close $fd
|
||||
rsv cleanup
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ -n "$QUERY_STRING" ] && rma="${QUERY_STRING##*=}" || rma=0
|
||||
|
||||
echo "Content-Type: text/plain"
|
||||
echo
|
||||
|
||||
if [ "$rma" = 1 ]; then
|
||||
modver="`cat /etc/modversion`"
|
||||
if [ "$modver" -ge 215 ]; then
|
||||
touch /var/lib/humaxtv_backup/.rma
|
||||
else
|
||||
touch /var/lib/humaxtv/.rma
|
||||
fi
|
||||
else
|
||||
touch /var/lib/humaxtv/mod/_RESET_CUSTOM_FIRMWARE_ENVIRONMENT
|
||||
fi
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
source /mod/webif/lib/setup
|
||||
httpheader "text/plain"
|
||||
|
||||
foreach f [dict keys $env] {
|
||||
puts "$f = $env($f)"
|
||||
}
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require pkg.class chunked
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
set cmd [cgi_get cmd update]
|
||||
|
||||
proc opkg {cmd} {
|
||||
chunk ">>> opkg $cmd\r\n"
|
||||
set bcmd "|/mod/webif/lib/bin/opkg $cmd"
|
||||
set fd [open $bcmd r]
|
||||
while {[gets $fd line] >= 0} {
|
||||
chunk "$line\r\n"
|
||||
#chunk_pad
|
||||
}
|
||||
close $fd
|
||||
chunk "\r\n"
|
||||
}
|
||||
|
||||
start_chunked
|
||||
|
||||
if {$cmd eq "upgrade"} { opkg update }
|
||||
opkg $cmd
|
||||
|
||||
if {$cmd eq "update" || $cmd eq "upgrade"} {
|
||||
chunk "Updating package meta information\r\n"
|
||||
pkg fetchmeta
|
||||
chunk "Done.\r\n"
|
||||
chunk "Updating diagnostic meta information\r\n"
|
||||
pkg fetchdiagmeta
|
||||
chunk "Done.\r\n"
|
||||
}
|
||||
|
||||
end_chunked
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require rsv.class system.class
|
||||
|
||||
httpheader
|
||||
|
||||
if {[cgi_get act] eq "cancel"} {
|
||||
system restartpending 0
|
||||
exit
|
||||
}
|
||||
|
||||
if {[cgi_get now] eq "yes"} {
|
||||
# - Busybox reboot does sync the disk but may still not be clean enough.
|
||||
puts "Restarting."
|
||||
system reboot
|
||||
exit
|
||||
}
|
||||
|
||||
system restartpending 0
|
||||
jqplugin progressbar
|
||||
header
|
||||
|
||||
# Commit pending reservations on older mod versions.
|
||||
if {![file exists /sbin/rsvsync] && ![file exists /mod/boot/rsvsync]} {
|
||||
rsv commit
|
||||
}
|
||||
|
||||
puts {
|
||||
|
||||
<script type=text/javascript>
|
||||
var handle = 0;
|
||||
var pct = 0;
|
||||
function update()
|
||||
{
|
||||
$('#progressbar').reportprogress(++pct);
|
||||
if (pct == 100)
|
||||
{
|
||||
clearInterval(handle);
|
||||
pct = 0;
|
||||
window.location = '/';
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#progressbar').reportprogress(0);
|
||||
handle = setInterval("update()", 350);
|
||||
$.get('/cgi-bin/restart.jim?now=yes');
|
||||
});
|
||||
</script>
|
||||
|
||||
Please wait while the Humax restarts...<br>
|
||||
<div id=progressbar></div>
|
||||
}
|
||||
|
||||
footer
|
||||
|
||||
@@ -1,492 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require settings.class plugin system.class
|
||||
|
||||
httpheader
|
||||
|
||||
if {[cgi_get act] eq "https"} {
|
||||
set val [cgi_get val off]
|
||||
if {$val in {0 off}} {
|
||||
file delete /mod/etc/mongoose.cert
|
||||
puts "HTTPS Server will be disabled after next reboot."
|
||||
} else {
|
||||
exec /mod/sbin/mongoose_mkcert
|
||||
puts "HTTPS Server will be enabled after next reboot."
|
||||
}
|
||||
exit
|
||||
}
|
||||
|
||||
if {[cgi_get act] eq "xtelnet"} {
|
||||
set val [cgi_get val off]
|
||||
if {$val in {0 off}} {
|
||||
file delete /mod/boot/xtelnet
|
||||
puts "Telnet server expert mode will be disabled after next reboot."
|
||||
} else {
|
||||
exec /mod/bin/busybox/touch /mod/boot/xtelnet
|
||||
puts "Telnet server expert mode will be enabled after next reboot."
|
||||
}
|
||||
exit
|
||||
}
|
||||
|
||||
set settings [settings new]
|
||||
|
||||
set hostname [$settings hostname]
|
||||
set smtp_server [$settings smtp_server]
|
||||
set channel_group [$settings channel_group]
|
||||
set epg_style [$settings epg_style]
|
||||
set service_style [$settings service_style]
|
||||
set pkgdev [$settings pkgdev]
|
||||
set notoolbar [$settings notoolbar]
|
||||
set nomobile [$settings nomobile]
|
||||
set nohelplinks [$settings nohelplinks]
|
||||
set notwitfeed [$settings notwitfeed]
|
||||
set nounwatchedcount [$settings nounwatchedcount]
|
||||
set chanchangenc [$settings chanchangenc]
|
||||
set xepghours [$settings xepghours]
|
||||
if {$xepghours == 0} { set xepghours 4 }
|
||||
set genrededup [$settings genrededup]
|
||||
set autolog [$settings autolog]
|
||||
|
||||
# Handle updates
|
||||
|
||||
if {![dict exists $env REQUEST_URI]} { set env(REQUEST_URI) "" }
|
||||
|
||||
proc _handle_update {class var old text} {
|
||||
global _cgi
|
||||
global settings
|
||||
|
||||
if {[dict exists $_cgi $var]} {
|
||||
set new [string trim [dict get $_cgi $var]]
|
||||
if {$new == $old} {
|
||||
puts "$text unchanged."
|
||||
} elseif [string is $class -strict $new] {
|
||||
$settings $var $new
|
||||
puts "$text updated."
|
||||
} else {
|
||||
puts "Invalid value for $var."
|
||||
}
|
||||
exit
|
||||
}
|
||||
}
|
||||
|
||||
proc handle_int_update {var old {text "Value"}} {
|
||||
_handle_update digit $var $old $text
|
||||
}
|
||||
|
||||
proc handle_str_update {var old {text "Value"}} {
|
||||
_handle_update alnum $var $old $text
|
||||
}
|
||||
|
||||
handle_str_update hostname $hostname Hostname
|
||||
_handle_update ascii smtp_server $smtp_server "SMTP Server"
|
||||
handle_int_update channel_group $channel_group "Channel Group"
|
||||
handle_int_update xepghours $xepghours "Grid EPG Hours"
|
||||
handle_str_update epg_style $epg_style "EPG Type"
|
||||
handle_str_update service_style $service_style "EPG Channel Type"
|
||||
handle_int_update pkgdev $pkgdev "Development Package Display"
|
||||
handle_int_update notoolbar $notoolbar "Disable toolbar"
|
||||
handle_int_update nomobile $nomobile "Disable mobile link"
|
||||
handle_int_update nohelplinks $nohelplinks "Disable help links"
|
||||
handle_int_update notwitfeed $notwitfeed "Disable twitter feed ticker"
|
||||
handle_int_update chanchangenc $chanchangenc \
|
||||
"Disable channel change confirmation"
|
||||
handle_int_update nounwatchedcount $nounwatchedcount "Disable unwatched count"
|
||||
handle_int_update genrededup $genrededup "Genre search dedup"
|
||||
handle_int_update autolog $autolog "Auto-processing log level"
|
||||
|
||||
set acluser [cgi_get acluser "-"]
|
||||
set aclpass [cgi_get aclpass "-"]
|
||||
set aclpassc [cgi_get aclpassc "-"]
|
||||
if {$acluser ne "-" && $aclpass ne "-"} {
|
||||
if {![string length $acluser]} {
|
||||
puts "No username provided."
|
||||
exit
|
||||
}
|
||||
if {$aclpass ne $aclpassc} {
|
||||
puts "Passwords do not match."
|
||||
exit
|
||||
}
|
||||
if {[string length $aclpass] < 4} {
|
||||
puts "Password is too short (< 4 characters)"
|
||||
exit
|
||||
}
|
||||
puts [$settings addacluser $acluser $aclpass]
|
||||
exit
|
||||
}
|
||||
|
||||
set aclact [cgi_get aclact "-"]
|
||||
if {$aclact ne "-" && $acluser ne "-"} {
|
||||
switch $aclact {
|
||||
"del" { puts [$settings delacluser $acluser] }
|
||||
}
|
||||
exit
|
||||
}
|
||||
|
||||
jqplugin form iphone-style-checkboxes
|
||||
header
|
||||
|
||||
puts {
|
||||
<script type="text/javascript" src="settings.js"></script>
|
||||
<div id=accordion>
|
||||
}
|
||||
|
||||
proc setting_toggle {name attr checked {invert 0} {val 0}} {
|
||||
puts -nonewline "
|
||||
<tr>
|
||||
<th class=key>$name</th>
|
||||
<td><input class=setting_toggle type=checkbox value=yes"
|
||||
if {$checked} { puts -nonewline " checked" }
|
||||
puts -nonewline " attr=$attr"
|
||||
if {$invert} { puts -nonewline " invert=1" }
|
||||
if {$val} { puts -nonewline " useval=1" }
|
||||
puts -nonewline ">
|
||||
<div id=${attr}_output></div>
|
||||
</td>
|
||||
</tr>
|
||||
"
|
||||
}
|
||||
|
||||
puts "
|
||||
<h4>General Settings</h4>
|
||||
<div><fieldset style=\"display: inline\">
|
||||
<legend>
|
||||
General Settings
|
||||
</legend>
|
||||
<table>
|
||||
"
|
||||
|
||||
puts "
|
||||
<tr>
|
||||
<form class=auto id=hostname method=get action=$env(REQUEST_URI)>
|
||||
<th class=key>Hostname</th>
|
||||
<td><input name=hostname value=\"$hostname\"
|
||||
class=\"text ui-widget-content ui-corner-all\"
|
||||
length=20 maxlength=50>
|
||||
<small>
|
||||
<input id=hostname_submit value=\"change\" type=submit>
|
||||
</small>
|
||||
<div id=hostname_output></div>
|
||||
</td>
|
||||
</form>
|
||||
</tr>
|
||||
"
|
||||
|
||||
setting_toggle "HTTPS web server?" "https" \
|
||||
[file exists /mod/etc/mongoose.cert] 0 1
|
||||
setting_toggle "Slide-down toolbar?" "notoolbar" $(!$notoolbar) 1
|
||||
setting_toggle "Mobile link on main page?" "nomobile" $(!$nomobile) 1
|
||||
setting_toggle "Help links on main page?" "nohelplinks" $(!$nohelplinks) 1
|
||||
setting_toggle "Twitter feed ticker on main page?" "notwitfeed" $(!$notwitfeed) 1
|
||||
setting_toggle "Unwatched count on folders?" "nounwatchedcount" $(!$nounwatchedcount) 1
|
||||
if {[system pkginst ir]} {
|
||||
setting_toggle "Disable channel change confirmation?" \
|
||||
"chanchangenc" $chanchangenc 0
|
||||
}
|
||||
|
||||
puts -nonewline "
|
||||
<tr>
|
||||
<form class=auto id=autolog method=get action=$env(REQUEST_URI)>
|
||||
<th class=key>Auto-processing log level</th>
|
||||
<td><select id=autolog name=autolog
|
||||
class=\"text ui-widget-content ui-corner-all\">
|
||||
"
|
||||
puts "<option value=0"
|
||||
if {$autolog == 0} { puts " selected" }
|
||||
puts ">Actions and errors only\n"
|
||||
puts "<option value=1"
|
||||
if {$autolog == 1} { puts " selected" }
|
||||
puts ">Actions, errors and scan information\n"
|
||||
puts "<option value=2"
|
||||
if {$autolog == 1} { puts " selected" }
|
||||
puts ">Debugging information\n"
|
||||
puts "
|
||||
</select>
|
||||
<small>
|
||||
<input name=autolog value=\"set\" type=submit>
|
||||
</small>
|
||||
<div id=autolog_output></div>
|
||||
</td>
|
||||
</form>
|
||||
</tr>
|
||||
"
|
||||
|
||||
puts "
|
||||
</table></fieldset></div>
|
||||
|
||||
<h4>EPG Settings</h4>
|
||||
<div><fieldset style=\"display: inline\">
|
||||
<legend>
|
||||
EPG Settings
|
||||
</legend>
|
||||
<table>
|
||||
"
|
||||
|
||||
puts "
|
||||
<tr>
|
||||
<form class=auto id=epg_style method=get action=$env(REQUEST_URI)>
|
||||
<th class=key>Default Now/Next style</th>
|
||||
<td><select id=epg_style name=epg_style
|
||||
class=\"text ui-widget-content ui-corner-all\">
|
||||
"
|
||||
puts "<option value=standard"
|
||||
if {$epg_style ne "grid"} { puts " selected" }
|
||||
puts ">Standard\n"
|
||||
puts "<option value=grid"
|
||||
if {$epg_style eq "grid"} { puts " selected" }
|
||||
puts ">Grid\n"
|
||||
puts "
|
||||
</select>
|
||||
<small>
|
||||
<input name=epg_style value=\"set\" type=submit>
|
||||
</small>
|
||||
<div id=epg_style_output></div>
|
||||
</td>
|
||||
</form>
|
||||
</tr>
|
||||
"
|
||||
|
||||
puts "
|
||||
<tr>
|
||||
<form class=auto id=service_style method=get action=$env(REQUEST_URI)>
|
||||
<th class=key>Default Single-channel style</th>
|
||||
<td><select id=service_style name=service_style
|
||||
class=\"text ui-widget-content ui-corner-all\">
|
||||
"
|
||||
puts "<option value=standard"
|
||||
if {$service_style eq "standard"} { puts " selected" }
|
||||
puts ">Standard\n"
|
||||
puts "<option value=grid"
|
||||
if {$service_style ne "standard"} { puts " selected" }
|
||||
puts ">Grid\n"
|
||||
puts "
|
||||
</select>
|
||||
<small>
|
||||
<input name=service_style value=\"set\" type=submit>
|
||||
</small>
|
||||
<div id=service_style_output></div>
|
||||
</td>
|
||||
</form>
|
||||
</tr>
|
||||
"
|
||||
|
||||
puts "
|
||||
<tr>
|
||||
<form class=auto id=channel_group method=get action=$env(REQUEST_URI)>
|
||||
<th class=key>Channel Group for EPG</th>
|
||||
<td><select id=channel_group name=channel_group
|
||||
class=\"text ui-widget-content ui-corner-all\">
|
||||
"
|
||||
|
||||
set i 0
|
||||
puts "<option value=0>-- None --"
|
||||
foreach grp [$settings channel_groups] {
|
||||
incr i
|
||||
puts -nonewline "<option value=$i"
|
||||
if {$channel_group == $i} {
|
||||
puts -nonewline " selected"
|
||||
}
|
||||
puts ">$grp"
|
||||
}
|
||||
|
||||
puts "
|
||||
</select>
|
||||
<small>
|
||||
<input name=channel_group value=\"set\" type=submit>
|
||||
</small>
|
||||
<div id=channel_group_output></div>
|
||||
</td>
|
||||
</form>
|
||||
</tr>
|
||||
"
|
||||
|
||||
puts "
|
||||
<tr>
|
||||
<form class=auto id=xepghours method=get action=$env(REQUEST_URI)>
|
||||
<th class=key>Grid-style EPG Hours</th>
|
||||
<td><select id=xepghours name=xepghours
|
||||
class=\"text ui-widget-content ui-corner-all\">
|
||||
"
|
||||
|
||||
foreach xehopt {2 3 4 5 6} {
|
||||
puts -nonewline "<option value=$xehopt"
|
||||
if {$xehopt == $xepghours} {
|
||||
puts -nonewline " selected"
|
||||
}
|
||||
puts ">$xehopt hours"
|
||||
}
|
||||
|
||||
puts "
|
||||
</select>
|
||||
<small>
|
||||
<input name=xepghours value=\"set\" type=submit>
|
||||
</small>
|
||||
<div id=xepghours_output></div>
|
||||
</td>
|
||||
</form>
|
||||
</tr>
|
||||
"
|
||||
|
||||
setting_toggle "De-duplicate genre search results?" genrededup $genrededup
|
||||
|
||||
puts "
|
||||
</table>
|
||||
</fieldset></div>
|
||||
"
|
||||
|
||||
#puts "
|
||||
# <fieldset style=\"display: inline\">
|
||||
# <legend> Email Settings </legend>
|
||||
# <table>
|
||||
#"
|
||||
#
|
||||
#puts "
|
||||
# <tr>
|
||||
# <form class=auto id=smtp_server method=get action=$env(REQUEST_URI)>
|
||||
# <th class=key>SMTP Server for outbound email</th>
|
||||
# <td><input name=smtp_server value=\"$smtp_server\"
|
||||
# class=\"text ui-widget-content ui-corner-all\"
|
||||
# length=20 maxlength=50>
|
||||
# <small>
|
||||
# <input id=smtp_server_submit value=\"change\" type=submit>
|
||||
# </small>
|
||||
# <div id=smtp_server_output></div>
|
||||
# </td>
|
||||
# </form>
|
||||
# </tr>
|
||||
#"
|
||||
#
|
||||
#puts "
|
||||
# </table>
|
||||
# </fieldset>
|
||||
# <br><br>
|
||||
#"
|
||||
|
||||
puts "
|
||||
<h4>Web Interface User Access Control</h4>
|
||||
<div>
|
||||
<fieldset style=\"display: inline\">
|
||||
<legend> Web Interface User Access Control </legend>
|
||||
<table>
|
||||
"
|
||||
|
||||
set aclusers [$settings aclusers]
|
||||
if {[llength $aclusers]} {
|
||||
puts "<tr><th colspan=5 class=odd>Existing Users</th></tr>"
|
||||
foreach user [$settings aclusers] {
|
||||
lassign $user user
|
||||
puts "<tr><td align=center style=\"font-weight: bold\">
|
||||
$user</td>"
|
||||
puts "<th class=key>New password:
|
||||
<input
|
||||
class=\"aclpass text ui-widget-content ui-corner-all\"
|
||||
type=password size=20 maxlength=50><br>"
|
||||
puts "Again:
|
||||
<input
|
||||
class=\"aclpassc text ui-widget-content ui-corner-all\"
|
||||
type=password size=20 maxlength=50></td>"
|
||||
puts "<th class=key><button class=pwchange>
|
||||
Change</button></td>"
|
||||
puts "<th class=key><button class=userdel>
|
||||
Delete User</button></td>"
|
||||
puts "</tr>"
|
||||
}
|
||||
puts "<tr><td colspan=5 id=aclusermod_output> </td></tr>"
|
||||
puts "<tr><td colspan=5> </td></tr>"
|
||||
} else {
|
||||
puts "<tr><td colspan=5 class=blood><b>
|
||||
Add a user to enable authentication.</b></td></tr>"
|
||||
}
|
||||
|
||||
puts "<tr><th colspan=5 class=odd>Add New User</th></tr>"
|
||||
puts "
|
||||
<form id=aclnewuser method=get action=$env(REQUEST_URI)>
|
||||
<tr><th class=key>New User:</th><td>
|
||||
<input
|
||||
class=\"text ui-widget-content ui-corner-all\"
|
||||
id=acluser name=acluser size=20 maxlength=50></td></tr>
|
||||
<tr><th class=key>Password:</th><td>
|
||||
<input type=password
|
||||
class=\"text ui-widget-content ui-corner-all\"
|
||||
id=aclpass name=aclpass size=20 maxlength=50></td></tr>
|
||||
<tr><th class=key>Password (confirm):</th><td>
|
||||
<input type=password
|
||||
class=\"text ui-widget-content ui-corner-all\"
|
||||
id=aclpassc name=aclpassc size=20 maxlength=50></td></tr>
|
||||
<tr><td><input id=aclnewuser_submit value=\"Add User\" type=submit>
|
||||
</td></tr>
|
||||
</form>
|
||||
</table>
|
||||
<div id=aclnewuser_output></div>
|
||||
</fieldset>
|
||||
</div>
|
||||
"
|
||||
|
||||
puts {
|
||||
<script type=text/javascript>
|
||||
$('#aclnewuser').ajaxForm({
|
||||
target: '#aclnewuser_output',
|
||||
success: function(txt) {
|
||||
if (txt.indexOf('Success') >= 0)
|
||||
window.location.reload(true);
|
||||
}
|
||||
});
|
||||
|
||||
$('button.userdel').click(function(el) {
|
||||
var user = $('td:first', $(this).parents('tr')).text().trim();
|
||||
$('#aclusermod_output').load(
|
||||
'/cgi-bin/settings.jim?aclact=del&acluser=' +
|
||||
encodeURIComponent(user), function(txt) {
|
||||
if (txt.indexOf('Success') >= 0)
|
||||
window.location.reload(true);
|
||||
});
|
||||
});
|
||||
|
||||
$('button.pwchange').click(function(el) {
|
||||
var tr = $(this).parents('tr');
|
||||
var user = $('td:first', $(tr)).text().trim();
|
||||
var pass = $(tr).find('input.aclpass').val();
|
||||
var passc = $(tr).find('input.aclpassc').val();
|
||||
$('#aclusermod_output').load('/cgi-bin/settings.jim?' +
|
||||
'acluser=' + encodeURIComponent(user) + '&' +
|
||||
'aclpass=' + encodeURIComponent(pass) + '&' +
|
||||
'aclpassc=' + encodeURIComponent(passc));
|
||||
});
|
||||
</script>
|
||||
}
|
||||
|
||||
puts -nonewline "
|
||||
<h4>Advanced Settings</h4>
|
||||
<div>
|
||||
<fieldset style=\"display: inline\">
|
||||
<legend> Advanced Settings </legend>
|
||||
<table>
|
||||
"
|
||||
setting_toggle "Show development and advanced packages?" "pkgdev" $pkgdev
|
||||
|
||||
if {[system modversion 1] >= 214} {
|
||||
setting_toggle "Expert mode telnet server?" "xtelnet" \
|
||||
[file exists /mod/boot/xtelnet] 0 1
|
||||
}
|
||||
|
||||
puts "
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
"
|
||||
|
||||
set hook settings
|
||||
foreach plugin [lsort [glob -nocomplain /mod/webif/plugin/*]] {
|
||||
if {[file isfile "$plugin/$hook.hook"]} {
|
||||
puts "<h4>Settings for <i>[file tail $plugin]</i> package</h4>"
|
||||
puts "<div class=pluginsettings>"
|
||||
catch {source "$plugin/$hook.hook"}
|
||||
puts "</div>"
|
||||
}
|
||||
}
|
||||
|
||||
puts "</div>"
|
||||
|
||||
footer
|
||||
|
||||
@@ -1,183 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require system.class findhsvc epg.class rsv.class
|
||||
|
||||
set runmode cli
|
||||
if {[string match {*jim} $argv0]} { set runmode cgi }
|
||||
|
||||
set schedtime 1200
|
||||
switch $runmode {
|
||||
cgi {
|
||||
set type [cgi_get type "full"]
|
||||
httpheader
|
||||
}
|
||||
cli {
|
||||
set type "full"
|
||||
if {"-X" in $argv} { set schedtime 7200 }
|
||||
}
|
||||
}
|
||||
|
||||
if {[catch {set pid [exec pgrep -n humaxtv]}]} {
|
||||
puts "Cannot find humaxtv process."
|
||||
exit
|
||||
}
|
||||
|
||||
proc get_data {} {
|
||||
global pid
|
||||
|
||||
set ret {}
|
||||
if {[catch {set data \
|
||||
[exec /mod/bin/lsof -p $pid | grep Video | fgrep .ts]} ]} {
|
||||
set ret {}
|
||||
} else {
|
||||
foreach line [split $data "\n"] {
|
||||
regsub -all -- {[[:space:]]+} $line " " line
|
||||
set name [file rootname [file tail $line]]
|
||||
if {[dict exists $ret $name]} {
|
||||
set ret($name) -1
|
||||
} else {
|
||||
set size [lindex [split $line " "] 6]
|
||||
set ret($name) $size
|
||||
}
|
||||
}
|
||||
}
|
||||
return $ret
|
||||
}
|
||||
|
||||
set play 0
|
||||
set rec 0
|
||||
set seen {}
|
||||
set output {}
|
||||
|
||||
if {$type eq "full"} {
|
||||
set data [get_data]
|
||||
} else {
|
||||
set data {}
|
||||
}
|
||||
|
||||
if {[llength $data]} {
|
||||
sleep 3
|
||||
set ndata [get_data]
|
||||
foreach name [array names ndata] {
|
||||
if {![dict exists $seen $name]} { set seen($name) 0 }
|
||||
if {![dict exists $data $name]} { set data($name) 0 }
|
||||
if {[file exists "/mod/tmp/webif_auto/decrypting.$name.ts"]} {
|
||||
set mode "Decrypting"
|
||||
set icon "178_1_00_Icon_Lock.png style=\"padding: 0 0.2em 0 0.5em\""
|
||||
} elseif {$ndata($name) == -1} {
|
||||
incr rec
|
||||
incr play
|
||||
set mode "Chase Playing"
|
||||
set icon "745_1_11_Video_3REC_Live.png"
|
||||
} elseif {$ndata($name) > $data($name) && $seen($name) < 1} {
|
||||
incr rec
|
||||
set mode "Recording"
|
||||
set icon "745_1_11_Video_1REC.png"
|
||||
} else {
|
||||
incr play
|
||||
set mode "Playing"
|
||||
set icon "745_1_10_Video_2Live.png"
|
||||
}
|
||||
|
||||
incr seen($name)
|
||||
|
||||
if {$runmode eq "cgi"} {
|
||||
lappend output [concat \
|
||||
"<span class=\"va stitem\">\n" \
|
||||
" <img class=va src=/images/$icon>\n" \
|
||||
" <span>$mode <i>$name</i></span>\n" \
|
||||
"</span>\n" \
|
||||
]
|
||||
} else {
|
||||
lappend output "$mode $name"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if {![system instandby] && $play < 1} {
|
||||
set hsvc [system param CUR_SVC Value USERCONFIG]
|
||||
|
||||
set ff [$rsvdb query "
|
||||
select usSvcid as svcid, usLcn as lcn,
|
||||
substr(szSvcName, 2) as name
|
||||
from channel.TBL_SVC
|
||||
where hSvc = $hsvc
|
||||
limit 1
|
||||
"]
|
||||
|
||||
if {[llength $ff] == 1} {
|
||||
lassign [lindex $ff 0] x svcid x lcn x name
|
||||
set epgs [epg dbfetch get \
|
||||
-service $svcid \
|
||||
-time [clock seconds]\
|
||||
]
|
||||
set prog ""
|
||||
if {[llength $epgs] == 1} {
|
||||
lassign $epgs epg
|
||||
set prog "- [$epg get name] ("
|
||||
append prog "[clock format [$epg get start] -format %H:%M] - "
|
||||
append prog "[clock format $([$epg get start] + [$epg get duration]) -format %H:%M]"
|
||||
append prog ") \[[$epg percent]%\]"
|
||||
}
|
||||
|
||||
if {$runmode eq "cgi"} {
|
||||
lappend output [concat \
|
||||
"<span class=\"va stitem\">\n" \
|
||||
" [epg channelicon $name 30 \
|
||||
{vertical-align: middle; padding: 0 4px 0 2px}]\n" \
|
||||
" <span>Watching <i>$lcn: $name $prog</i></span>\n" \
|
||||
"</span>\n" \
|
||||
]
|
||||
} else {
|
||||
lappend output "Watching $lcn: $name $prog"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if {[system instandby]} {
|
||||
if {$runmode eq "cgi"} {
|
||||
lappend output [concat \
|
||||
"<span class=\"va stitem\">\n" \
|
||||
" <img class=va width=28 style=\"padding: 0 4px\"" \
|
||||
"src=/img/standby.png>\n" \
|
||||
" <span>System is in standby.</span>\n" \
|
||||
"</span>" \
|
||||
]
|
||||
} else {
|
||||
lappend output "System is in standby."
|
||||
}
|
||||
}
|
||||
|
||||
set events [rsv list tbl_reservation \
|
||||
" where ersvtype = 3 and nsttime - [clock seconds] < $schedtime
|
||||
and nsttime > [clock seconds] "]
|
||||
foreach event $events {
|
||||
if {$runmode eq "cgi"} {
|
||||
set icon "175_1_11_Reservation_Record.png"
|
||||
lappend output [concat \
|
||||
"<span class=\"va stitem\">\n" \
|
||||
" <img class=va src=/images/$icon width=20>\n" \
|
||||
" <span>Will record <i>[$event name]</i>" \
|
||||
" on [$event channel_name] at"\
|
||||
" [clock format [$event get nsttime] -format {%H:%M}]" \
|
||||
" </span>\n" \
|
||||
"</span>\n" \
|
||||
} else {
|
||||
lappend output [concat \
|
||||
"Will record '[$event name]' " \
|
||||
"on [$event channel_name] at " \
|
||||
"[clock format [$event get nsttime] -format {%H:%M}]" \
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
if {[llength $output]} {
|
||||
if {$runmode eq "cgi"} {
|
||||
puts [join $output "\n<br>\n"]
|
||||
} else {
|
||||
puts [join $output "\n"]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,266 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require settings.class
|
||||
|
||||
jqplugin enadis
|
||||
jscss xepg.js /css/xepg.css
|
||||
header
|
||||
|
||||
require epg.class spinner.class altrow epg_search totop system.class
|
||||
|
||||
set irinst [system pkginst ir]
|
||||
|
||||
set s [settings]
|
||||
|
||||
if {[$s chanchangenc]} {
|
||||
puts { <script type=text/javascript src=/js/chanchangenc.js></script> }
|
||||
} else {
|
||||
jqplugin confirmAction
|
||||
puts { <script type=text/javascript src=/js/chanchange.js></script> }
|
||||
}
|
||||
|
||||
if {[$s service_style] eq "standard"} {
|
||||
set surl xservice
|
||||
} else {
|
||||
set surl service
|
||||
}
|
||||
|
||||
[spinner new {
|
||||
text "Loading EPG Information..."
|
||||
size "1.2em"
|
||||
style "margin: 1em;"
|
||||
}] start
|
||||
|
||||
require epg_popup
|
||||
|
||||
set now [clock seconds]
|
||||
set stt [cgi_get stt $now]
|
||||
if {$stt <= $now} {
|
||||
set stt $now
|
||||
set current 1
|
||||
} else {
|
||||
set current 0
|
||||
}
|
||||
|
||||
set favgroup [$s channel_group]
|
||||
|
||||
set hours [expr 1.0 * [[settings] xepghours]]
|
||||
if {$hours == 0} { set hours 4.0 }
|
||||
set seconds $($hours * 3600)
|
||||
|
||||
set ostt $stt
|
||||
set stt [expr int($stt / 1800.0) * 1800]
|
||||
|
||||
set ett $(int($stt + $seconds))
|
||||
set offset $(($ostt - $stt) / 1800.0)
|
||||
|
||||
set chanpx 160
|
||||
set eventpx 1000
|
||||
set totalpx $($chanpx + $eventpx)
|
||||
set contwidth $($totalpx + 50)
|
||||
|
||||
set hourpx $($eventpx / $hours)
|
||||
set minpx $($hourpx / 60.0)
|
||||
set secpx $($minpx / 60.0)
|
||||
|
||||
set start [clock milliseconds]
|
||||
if {$::qepg} {
|
||||
if {$favgroup} {
|
||||
set records [epg dbfetch dump \
|
||||
-trange "$stt:$ett" -fav $favgroup]
|
||||
} else {
|
||||
set records [epg dbfetch dump -trange "$stt:$ett"]
|
||||
}
|
||||
|
||||
} else {
|
||||
require channelsort
|
||||
set records [channelsort [epg fetch dump -trange "$stt:$ett"]]
|
||||
}
|
||||
set got [clock milliseconds]
|
||||
|
||||
proc but {label time {active 1}} {
|
||||
puts -nonewline "<button style=\"margin-right: 2em\" tt=$time"
|
||||
if {$active} {
|
||||
puts -nonewline " class=nav"
|
||||
} else {
|
||||
puts -nonewline " disabled class=\"nav ui-state-disabled\""
|
||||
}
|
||||
puts " active=$active>$label</button>"
|
||||
}
|
||||
|
||||
puts "<!-- Hours $hours ($seconds) -->"
|
||||
puts "<div id=buttons style=\"width: $eventpx; margin-left: ${chanpx}px;\">"
|
||||
|
||||
but "<< -1 Week" $($stt - 3600 * 24 * 7) \
|
||||
$($stt - $now + 3600 >= 3600 * 24 * 7)
|
||||
but "<< -1 Day" $($stt - 3600 * 24) $($stt - $now >= 3600 * 23)
|
||||
but "<< Earlier", $($stt - 3600 * 4) $($stt > $now)
|
||||
#but "< Now >" $now $($current == 0)
|
||||
but "< Now >" $now
|
||||
but ">> Later" $ett;
|
||||
but ">> +1 Day" $($stt + 3600 * 24) $($stt < $now + 8 * 3600 * 24)
|
||||
but ">> +1 Week" $($stt + 3600 * 24 * 7) $($stt < $now + 8 * 3600 * 24)
|
||||
|
||||
puts "</div>"
|
||||
|
||||
puts "
|
||||
<script type=text/javascript>
|
||||
\$('button.nav').button();
|
||||
</script>
|
||||
<div id=xepg style=\"min-width: ${contwidth}px; overflow: auto\">
|
||||
<div id=xepgnow></div>
|
||||
<div id=xegrid>
|
||||
"
|
||||
|
||||
puts "<div id=epgdate style=\"width: ${eventpx}px; margin-left: ${chanpx}px;\">"
|
||||
puts [clock format $stt -format {%a %d/%m/%Y}]
|
||||
puts "<input type=hidden id=xepg_dp stt=$stt>"
|
||||
puts "</div>"
|
||||
|
||||
puts "<div class=xechan style=\"width: ${chanpx}px;\"> </div>"
|
||||
for {set i 0} {$i < $hours * 2} {incr i} {
|
||||
puts "<div class=xetime id=xe$i
|
||||
style=\"width: [expr $minpx * 30]px\">"
|
||||
puts "[clock format $($stt + 1800 * $i) -format "%H:%M"]</div>"
|
||||
}
|
||||
|
||||
set lim 0
|
||||
set lcn 0
|
||||
set bg "odd"
|
||||
|
||||
foreach e $records {
|
||||
set chnum [$e get channel_num]
|
||||
if {$chnum == 0} { continue }
|
||||
|
||||
if {$chnum != $lcn} {
|
||||
puts "<div class=xechan style=\"width: ${chanpx}px;\">"
|
||||
|
||||
if {$irinst} {
|
||||
puts "<a class=chanchange chan=$chnum href=#>"
|
||||
}
|
||||
puts "[$e channel_icon 30] "
|
||||
if {$irinst} { puts "</a>" }
|
||||
puts "$chnum
|
||||
<a href=\"/epg/$surl.jim?service=[$e get service_id]\"
|
||||
title=\"[$e get channel_name]\">
|
||||
[$e get channel_name]
|
||||
</a></div>"
|
||||
|
||||
set lcn $chnum
|
||||
set le 0
|
||||
set pos 0
|
||||
if {$bg eq "odd"} { set bg "even" } else { set bg "odd" }
|
||||
}
|
||||
|
||||
set es [$e get start]
|
||||
set ee [expr $es + [$e get duration]]
|
||||
|
||||
if {$es < $le} continue
|
||||
|
||||
if {$es < $stt} { set es $stt }
|
||||
if {$ee > $ett} { set ee $ett }
|
||||
set le $ee
|
||||
|
||||
set left [expr int(($es - $stt) * $secpx)]
|
||||
set right [expr int(($ee - $stt - 1) * $secpx)]
|
||||
set px $($right - $left)
|
||||
if {$pos < $left} {
|
||||
set px $($px + $left - $pos - 1)
|
||||
} elseif {$pos > $left} {
|
||||
set px $($px - ($pos - $left - 1))
|
||||
}
|
||||
incr pos $px
|
||||
|
||||
$e process_sched
|
||||
|
||||
set recopts 1
|
||||
if {[$e get series_crid] ne ""} { set recopts 2 }
|
||||
|
||||
set perc [$e percent]
|
||||
set showing 0
|
||||
if {$perc > 0 && $perc < 100} { set showing 1 }
|
||||
|
||||
set txt "[cgi_quote_html [$e get name]] <span>([\
|
||||
clock format $es -format "%H:%M"] - [\
|
||||
clock format $ee -format "%H:%M"])"
|
||||
if {$showing} { append txt " ($perc%)" }
|
||||
append txt "</span>"
|
||||
|
||||
set htxt "[cgi_quote_html [$e get name]] ([\
|
||||
clock format $es -format "%H:%M"] - [\
|
||||
clock format $ee -format "%H:%M"])"
|
||||
if {$showing} { append hxt " ($perc%)" }
|
||||
|
||||
set lbg $bg
|
||||
if {[$e scheduled]} { set lbg "blueshade" }
|
||||
|
||||
puts "<div class=\"xeprog $lbg\"
|
||||
style=\"width: [expr $px - 4]px;\" title=\"$htxt\">
|
||||
<a class=event href=# xs=[$e get service_id]
|
||||
xe=[$e get event_id] sch=[$e get sched_type]
|
||||
rec=$recopts>"
|
||||
puts $txt
|
||||
puts "</a>"
|
||||
puts "</div>"
|
||||
}
|
||||
puts "<div id=keypos style=\"float: left; clear: left;\"></div>"
|
||||
puts "</div>"
|
||||
puts "</div>"
|
||||
|
||||
set earlier $($stt - 3600 * 4)
|
||||
|
||||
puts "
|
||||
|
||||
<div style=\"clear: both;\">
|
||||
<small><button id=epgswitch>
|
||||
Switch to standard now/next display.
|
||||
</button></small>
|
||||
</div>
|
||||
"
|
||||
|
||||
if {$current} {
|
||||
puts "
|
||||
<script type=text/javascript>
|
||||
\$(function() {
|
||||
"
|
||||
puts {
|
||||
|
||||
var kt = $('#xe0');
|
||||
var ktpos = kt.position();
|
||||
|
||||
var height = $('#keypos').position().top - ktpos.top;
|
||||
|
||||
}
|
||||
puts "var nowpos = ktpos.left + (kt.width() * $offset);"
|
||||
puts {
|
||||
$('#xepgnow')
|
||||
.css('left', nowpos + 'px')
|
||||
.css('top', ktpos.top)
|
||||
.height(height)
|
||||
.show('slow');
|
||||
}
|
||||
|
||||
puts "
|
||||
});
|
||||
</script>
|
||||
"
|
||||
}
|
||||
|
||||
puts "
|
||||
<a href=/cgi-bin/settings.jim>
|
||||
<img border=0 height=14 src=/images/421_1_00_CH_Title_2R_Arrow.png>
|
||||
Visit settings to change EPG options.
|
||||
</a><br>
|
||||
"
|
||||
|
||||
epg cleanup
|
||||
|
||||
set end [clock milliseconds]
|
||||
puts "<font class=footnote>
|
||||
Retrieved in: [expr [expr $got - $start] / 1000.0] seconds.
|
||||
</font>"
|
||||
|
||||
footer
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
$(function() {
|
||||
|
||||
$('#epgswitch').button().click(function() {
|
||||
window.location = '/epg.shtml';
|
||||
});
|
||||
|
||||
$('button.nav').click(function() {
|
||||
window.location = '/cgi-bin/xepg.jim?stt=' + $(this).attr('tt') +
|
||||
'&pos=' + $('#xegrid').scrollTop();
|
||||
});
|
||||
|
||||
$('#xepg_dp').datepicker({
|
||||
buttonImage: '/img/cal.gif',
|
||||
buttonImageOnly: true,
|
||||
showOn: 'button',
|
||||
dateFormat: '@',
|
||||
minDate: 0,
|
||||
maxDate: 8,
|
||||
onSelect: function(val, sel) {
|
||||
var stt = $(this).attr('stt');
|
||||
// Extract date part
|
||||
dval = Math.round(val / 86400000.0);
|
||||
// Extract current time part
|
||||
var tm = ~~(stt % 86400);
|
||||
|
||||
var ret = dval * 86400 + tm;
|
||||
|
||||
window.location = '/cgi-bin/xepg.jim?stt=' + ret;
|
||||
}
|
||||
});
|
||||
|
||||
$('img.ui-datepicker-trigger').hover(
|
||||
function() { $(this).css('cursor', 'pointer'); },
|
||||
function() { $(this).css('cursor', 'auto'); }
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<!--#include virtual="/lib/header.shtml" -->
|
||||
<!--#exec cmd="/mod/webif/include/backup.jim" -->
|
||||
<!--#include virtual="/lib/footer.shtml" -->
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
|
||||
httpheader
|
||||
|
||||
# dir=%2Fmedia%2FMy+Video%2FWeatherview
|
||||
# aexpiry_days=13
|
||||
|
||||
set dir [cgi_get dir "-"]
|
||||
set days [cgi_get aexpiry_days 7]
|
||||
if {$dir eq "-"} exit
|
||||
|
||||
if {![file isdirectory $dir]} {
|
||||
puts "Not a directory."
|
||||
exit
|
||||
}
|
||||
|
||||
set fd [open "$dir/.autoexpire" w]
|
||||
puts $fd $days
|
||||
$fd close
|
||||
puts "Ok."
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require sqlite3
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class system.class
|
||||
|
||||
httpheader
|
||||
|
||||
set rfile [cgi_get file]
|
||||
set ts [ts fetch $rfile]
|
||||
set dir [file dirname $rfile]
|
||||
set len [$ts duration 1]
|
||||
|
||||
set xstart [clock milliseconds]
|
||||
|
||||
set base [file rootname $rfile]
|
||||
set shname [file tail $base]
|
||||
puts "Processing $shname"
|
||||
|
||||
puts [exec /mod/bin/ffmpeg -y -benchmark -v 0 \
|
||||
-i $rfile -f mp3 \
|
||||
-vn -acodec copy "${base}.mp3"]
|
||||
|
||||
if {[system pkginst id3v2]} {
|
||||
puts [exec /mod/bin/id3v2 \
|
||||
--song "[$ts get title]" \
|
||||
--comment "[$ts get synopsis]" \
|
||||
--album "[$ts get channel_name]" \
|
||||
--year "[clock format [$ts get start] -format {%Y}]" \
|
||||
"${base}.mp3"]
|
||||
}
|
||||
|
||||
set xtime [expr [expr [clock milliseconds] - $xstart] / 1000.0]
|
||||
puts "Time taken: $xtime"
|
||||
|
||||
@@ -1,110 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class pretty_size
|
||||
|
||||
jqplugin progressbar
|
||||
jscss crop.js
|
||||
header
|
||||
|
||||
set rfile [cgi_get file]
|
||||
set ts [ts fetch $rfile]
|
||||
set dir [file dirname $rfile]
|
||||
|
||||
set len [$ts duration 1]
|
||||
|
||||
puts "
|
||||
<fieldset class=cleft>
|
||||
<legend>Crop recording</legend>
|
||||
|
||||
<table class=keyval cellpadding=5>
|
||||
<tr><th>File:</th><td>$rfile</td></tr>
|
||||
<tr><th>Length:</th><td>[clock format $len -format \"%T\"]</td></tr>
|
||||
<tr><th>Size:</th><td>[pretty_size [$ts size]] ([$ts get definition])</td></tr>
|
||||
<tr><th>Bookmarks:</th><td>[$ts get bookmarks] @ "
|
||||
|
||||
set flag 0
|
||||
foreach b [$ts bookmarks] {
|
||||
if $flag { puts -nonewline ", " }
|
||||
incr flag
|
||||
puts -nonewline [clock format $b -format "%T"]
|
||||
}
|
||||
|
||||
puts "</td></tr><tr><th>File</th><td>"
|
||||
|
||||
puts "<div style=\"position: relative; top: -10px\">"
|
||||
|
||||
proc div {type left right} {
|
||||
set width $($right - $left)
|
||||
puts "<div class=$type style=\"left: ${left}px; width: ${width}px\">
|
||||
$type</div>"
|
||||
}
|
||||
|
||||
set keeping 0
|
||||
set last 0
|
||||
set start -1
|
||||
foreach b [$ts bookmarks] {
|
||||
if {$start < 0} {
|
||||
set start $b
|
||||
continue
|
||||
}
|
||||
set end $b
|
||||
|
||||
incr keeping $($end - $start)
|
||||
|
||||
set left $($start * 500 / $len)
|
||||
set right $($end * 500 / $len)
|
||||
|
||||
div cut $last $($left - 1)
|
||||
div keep $left $($right - 1)
|
||||
|
||||
set last $right
|
||||
|
||||
set start -1
|
||||
}
|
||||
|
||||
if {$start > 0} {
|
||||
incr keeping $($len - $start)
|
||||
set left $($start * 500 / $len)
|
||||
div cut $last $($left - 1)
|
||||
div keep $left 500
|
||||
} else {
|
||||
div cut $last 500
|
||||
}
|
||||
|
||||
set keepperc $($keeping * 100.0 / $len)
|
||||
set esttime $(int($keeping * 0.025))
|
||||
if {[$ts get definition] eq "HD"} { set esttime $($esttime * 4) }
|
||||
|
||||
puts "
|
||||
</div>
|
||||
</td></tr>
|
||||
<tr><th>Keeping:</th><td>
|
||||
[clock format $keeping -format "%T"] ([format "%.2f" $keepperc]%)
|
||||
</td></tr>
|
||||
<tr><th>Time:</th>
|
||||
<td>Cropping will take around [clock format $esttime -format "%T"]</td></tr>
|
||||
</table>
|
||||
|
||||
<span class=hidden id=params
|
||||
file=\"[cgi_quote_url $rfile]\"
|
||||
perc=\"$keepperc\"
|
||||
dir=\"[cgi_quote_url $dir]\"
|
||||
></span>
|
||||
|
||||
<div id=cropdiv style=\"padding: 1em\">
|
||||
<button id=cropit>Perform crop operation</button>
|
||||
</div>
|
||||
|
||||
<div id=progressdiv class=hidden>
|
||||
Cropping: <div id=progressbar></div>
|
||||
</div>
|
||||
|
||||
<button id=back class=hidden>Back to media list</button>
|
||||
|
||||
<div id=output class=pre style=\"margin-top: 10px\"></div>
|
||||
</fieldset>
|
||||
|
||||
"
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
var handle = 0;
|
||||
|
||||
function update()
|
||||
{
|
||||
var perc = $('#params').attr('perc');
|
||||
var file = $('#params').attr('file');
|
||||
|
||||
$.get('progress.jim' + '?perc=' + perc + '&file=' + file,
|
||||
function(data) {
|
||||
if (handle)
|
||||
$('#progressbar').reportprogress(data);
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#progressbar').reportprogress(0);
|
||||
|
||||
$('#back').button().click(function() {
|
||||
window.location = '../index.jim?dir=' + $('#params').attr('dir');
|
||||
});
|
||||
|
||||
$('#cropit').button().click(function() {
|
||||
$('#cropdiv').hide('slow');
|
||||
$('#progressdiv').show('slow');
|
||||
handle = setInterval("update()", 1000);
|
||||
$('#output').text('Please do not interrupt...')
|
||||
.load('execute.jim?file=' + $('#params').attr('file'),
|
||||
function() {
|
||||
clearInterval(handle);
|
||||
handle = 0;
|
||||
$('#back').show();
|
||||
$('#progressbar').reportprogress(100);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class pretty_size system.class
|
||||
|
||||
httpheader
|
||||
|
||||
set rfile [cgi_get file]
|
||||
|
||||
if {[system inuse $rfile]} {
|
||||
puts "This file is in use. Cannot process at the moment."
|
||||
exit
|
||||
}
|
||||
|
||||
set ts [ts fetch $rfile]
|
||||
set dir [file dirname $rfile]
|
||||
|
||||
set len [$ts duration 1]
|
||||
|
||||
set cropstart [clock milliseconds]
|
||||
|
||||
set base [file rootname $rfile]
|
||||
set origdir "$dir/_original"
|
||||
if {![file exists $origdir]} { file mkdir $origdir }
|
||||
|
||||
set shname [file tail $base]
|
||||
puts "Processing $shname"
|
||||
|
||||
if {[file exists "$origdir/$shname.ts"]} {
|
||||
puts "This recording already exists within _original"
|
||||
puts "Cannot continue."
|
||||
exit
|
||||
}
|
||||
|
||||
puts "Moving recording to $origdir"
|
||||
foreach f [glob -nocomplain "${base}.*"] {
|
||||
set tail [file tail $f]
|
||||
puts " $tail"
|
||||
file rename $f "$origdir/$tail"
|
||||
}
|
||||
|
||||
puts [exec /mod/bin/nicesplice \
|
||||
-in "$origdir/$shname" \
|
||||
-out "$dir/$shname" \
|
||||
-cutBookMarks]
|
||||
|
||||
set newname "$shname-[clock seconds]"
|
||||
puts "Renaming file group to $newname"
|
||||
ts renamegroup "$dir/$shname.ts" $newname
|
||||
exec /mod/bin/hmt "+setfilename=$newname" "$dir/$newname.hmt"
|
||||
# New nicesplice shrinks whilst cropping.
|
||||
exec /mod/bin/hmt "+shrunk" "$dir/$newname.hmt"
|
||||
|
||||
set croptime [expr [expr [clock milliseconds] - $cropstart] / 1000.0]
|
||||
puts "Time taken: $croptime"
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require sqlite3
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
jqplugin progressbar
|
||||
jscss decrypt.js
|
||||
header
|
||||
|
||||
set rfile [cgi_get file]
|
||||
set ts [ts fetch $rfile]
|
||||
set dir [file dirname $rfile]
|
||||
set len [$ts duration 1]
|
||||
lassign [$ts dlnaloc "127.0.0.1"] url
|
||||
|
||||
puts "
|
||||
|
||||
<fieldset class=cleft>
|
||||
<legend>Decrypt in-place</legend>
|
||||
|
||||
<table class=keyval cellpadding=5>
|
||||
<tr><th>File:</th><td>$rfile</td></tr>
|
||||
<tr><th>Length:</th><td>[clock format $len -format "%T"]</td></tr>
|
||||
<tr><th>DLNA URL</th><td>$url</td></tr>
|
||||
</table>
|
||||
"
|
||||
|
||||
if {$url eq ""} {
|
||||
puts "This file has not been indexed by the media server.
|
||||
Cannot decrypt."
|
||||
puts "Have you enabled <i>Content Sharing</i> in the Humax menus?"
|
||||
exit
|
||||
}
|
||||
|
||||
if {![system is_listening 9000]} {
|
||||
puts "The Humax media server is not running, cannot decrypt."
|
||||
puts "Have you enabled <i>Content Sharing</i> in the Humax menus?"
|
||||
puts "It can sometimes turn itself off so it's worth double checking."
|
||||
puts "If it is on then try turning sharing off and on again."
|
||||
exit
|
||||
}
|
||||
|
||||
puts "
|
||||
|
||||
<span class=hidden id=params
|
||||
dir=\"[cgi_quote_url $dir]\"
|
||||
file=\"[cgi_quote_url $rfile]\"
|
||||
></span>
|
||||
|
||||
<div id=decryptdiv style=\"padding: 1em\">
|
||||
<button id=decryptit>Perform decryption</button>
|
||||
</div>
|
||||
|
||||
<div id=progressdiv class=hidden>
|
||||
Decrypting: <div id=progressbar></div>
|
||||
</div>
|
||||
|
||||
<button id=back class=hidden>Back to media list</button>
|
||||
|
||||
<div id=output class=pre style=\"margin-top: 10px\"></div>
|
||||
</fieldset>
|
||||
|
||||
"
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require sqlite3
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class system.class
|
||||
|
||||
httpheader
|
||||
|
||||
set rfile [cgi_get file]
|
||||
set ts [ts fetch $rfile]
|
||||
set dir [file dirname $rfile]
|
||||
set len [$ts duration 1]
|
||||
lassign [$ts dlnaloc "127.0.0.1"] url
|
||||
|
||||
if {$url eq ""} {
|
||||
puts "This file has not been indexed by the media server.
|
||||
Cannot decrypt."
|
||||
exit
|
||||
}
|
||||
|
||||
if {[system inuse $rfile]} {
|
||||
puts "This file is in use. Cannot decrypt at the moment."
|
||||
exit
|
||||
}
|
||||
|
||||
set xstart [clock milliseconds]
|
||||
|
||||
set base [file rootname $rfile]
|
||||
set origdir "$dir/_original"
|
||||
if {![file exists $origdir]} { file mkdir $origdir }
|
||||
|
||||
set shname [file tail $base]
|
||||
puts "Processing $shname"
|
||||
|
||||
if {[file exists "$origdir/$shname.ts"]} {
|
||||
puts "The file already exists in _original, cannot decrypt."
|
||||
exit
|
||||
}
|
||||
|
||||
exec wget -O "$rfile.decrypting" $url
|
||||
|
||||
puts "Moving recording to $origdir"
|
||||
|
||||
foreach f [glob -nocomplain "${base}.*"] {
|
||||
if {[file extension $f] eq ".decrypting"} { continue }
|
||||
set tail [file tail $f]
|
||||
puts " $tail"
|
||||
file rename $f "${origdir}/$tail"
|
||||
}
|
||||
|
||||
file rename "$rfile.decrypting" $rfile
|
||||
|
||||
foreach ext {nts hmt thm} {
|
||||
set sidecar "$shname.$ext"
|
||||
if {[file exists "$origdir/$sidecar"]} {
|
||||
puts "Copying back sidecar $ext"
|
||||
file copy "$origdir/$sidecar" "$dir/$sidecar"
|
||||
}
|
||||
}
|
||||
|
||||
if {[file exists "$dir/$shname.hmt"]} {
|
||||
exec /mod/bin/hmt -encrypted "$dir/$shname.hmt"
|
||||
}
|
||||
|
||||
set xtime [expr [expr [clock milliseconds] - $xstart] / 1000.0]
|
||||
puts "Time taken: $xtime"
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
httpheader
|
||||
|
||||
set tsfile [cgi_get file]
|
||||
set rfile [file normalize $tsfile]
|
||||
|
||||
if {![file exists "$rfile.decrypting"]} {
|
||||
puts "0"
|
||||
} else {
|
||||
set sz [file size $rfile]
|
||||
set nsz [file size "$rfile.decrypting"]
|
||||
|
||||
puts [expr $nsz * 100 / $sz]
|
||||
}
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
httpheader "application/json"
|
||||
|
||||
set file [cgi_get file]
|
||||
if {$file == 0} exit
|
||||
set ts [ts fetch $file]
|
||||
|
||||
puts "{"
|
||||
puts "\"title\" : \"[$ts get title]\","
|
||||
puts "\"synopsis\" : \"[$ts get synopsis]\","
|
||||
puts "\"guidance\" : \"[$ts get guidance]\","
|
||||
puts "\"genre\" : [$ts get genre]"
|
||||
puts "}"
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
|
||||
httpheader
|
||||
|
||||
if [file exists /mod/bin/ffmpeg] {
|
||||
set file [cgi_get file]
|
||||
puts [exec /mod/webif/lib/bin/ffmpeg -i $file]
|
||||
} else {
|
||||
puts "Install ffmpeg package for more information..."
|
||||
}
|
||||
|
||||
@@ -1,161 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require pretty_size
|
||||
|
||||
httpheader
|
||||
|
||||
set file [cgi_get file]
|
||||
set type [cgi_get type]
|
||||
|
||||
if {$file == 0} exit
|
||||
|
||||
file stat $file st
|
||||
set sz [pretty_size $st(size)]
|
||||
|
||||
if {$type eq "ts"} {
|
||||
require epg.class ts.class
|
||||
|
||||
set ts [ts fetch $file]
|
||||
|
||||
puts "
|
||||
<table class=keyval>
|
||||
<tr>
|
||||
<th>Title</th>
|
||||
<td class=va>
|
||||
"
|
||||
if {[file exists "[file rootname $file].thm"]} {
|
||||
puts "<img class=\"bmp va\" width=70 height=39 src=\"bmp.jim?file=$file\">"
|
||||
}
|
||||
puts "[$ts get title]</td>
|
||||
</tr><tr>
|
||||
<th>Synopsis</th>
|
||||
<td>[$ts get synopsis]</td>
|
||||
</tr><tr>
|
||||
"
|
||||
|
||||
if {[$ts flag "Guidance"] > 0} {
|
||||
puts "
|
||||
<th>Guidance</th>
|
||||
<td><img class=va
|
||||
src=/images/174_1_26_GuidancePolicy.png height=21>
|
||||
[$ts get guidance]
|
||||
</td>
|
||||
</tr><tr>
|
||||
"
|
||||
}
|
||||
|
||||
puts "
|
||||
<th>Definition</th>
|
||||
<td>
|
||||
"
|
||||
if {[$ts get definition] eq "HD"} {
|
||||
puts "<img class=va src=/images/172_1_00_HD.png height=21>"
|
||||
} else {
|
||||
puts "<img class=va src=/images/172_1_26_SD.png height=21>"
|
||||
}
|
||||
puts "</td>
|
||||
</tr><tr>
|
||||
<th>Channel</th>
|
||||
<td>[epg channelicon [$ts get channel_name] 50 "vertical-align: middle"]
|
||||
[$ts get channel_num] - [$ts get channel_name]</td>
|
||||
</tr><tr>
|
||||
<th>Start Time</th>
|
||||
<td>"
|
||||
puts [clock format [$ts get start] -format "%c %Z"]
|
||||
puts "<font class=also>(Scheduled: [
|
||||
clock format [$ts get schedstart] -format "%c %Z"])</font>"
|
||||
puts "</td>
|
||||
</tr><tr>
|
||||
<th>End Time</th>
|
||||
<td>"
|
||||
puts [clock format [$ts get end] -format "%c %Z"]
|
||||
puts "<font class=also>(Scheduled: [clock format \
|
||||
[expr [$ts get schedstart] + [$ts get scheddur]] \
|
||||
-format "%c %Z"])</font>"
|
||||
puts "</td>
|
||||
</tr><tr>
|
||||
<th>Duration</th>
|
||||
<td>[$ts duration] minute(s).
|
||||
<font class=also>(Scheduled: [expr [$ts get scheddur] / 60])
|
||||
</font></td>
|
||||
</tr><tr>
|
||||
<th>Size</th>
|
||||
<td>$sz</td>
|
||||
"
|
||||
lassign [$ts dlnaloc] url
|
||||
if {$url ne ""} {
|
||||
puts "</tr><tr><th>DLNA URL</th>
|
||||
<td><a href=\"$url\">$url</a></td>"
|
||||
}
|
||||
puts "
|
||||
</tr><tr>
|
||||
<th>Files</th>
|
||||
<td>
|
||||
"
|
||||
|
||||
set fileset [$ts fileset]
|
||||
puts -nonewline "<img id=xfileset class=va src=/img/tree/plusonly.png>"
|
||||
puts -nonewline "[llength $fileset] file"
|
||||
if {[llength $fileset] != 1} { puts -nonewline "s" }
|
||||
puts -nonewline " in set."
|
||||
puts "<div id=fileset class=hidden><ul>"
|
||||
foreach f $fileset {
|
||||
puts "<li>[file tail $f] ([pretty_size [file size $f]])</li>"
|
||||
}
|
||||
puts "</ul></div>"
|
||||
|
||||
puts "</td>
|
||||
</tr><tr>
|
||||
<th>Flags</th>
|
||||
<td>[$ts get flags]
|
||||
"
|
||||
if {[$ts get bookmarks]} {
|
||||
puts " \[Bookmarks: [$ts get bookmarks]\]"
|
||||
}
|
||||
|
||||
puts "</tr>"
|
||||
puts "</table>"
|
||||
puts {
|
||||
<script type=text/javascript>
|
||||
$('#xfileset').click(function() {
|
||||
$('#fileset').slideToggle('slow', function() {
|
||||
if ($('#fileset').is(':visible'))
|
||||
$('#xfileset').attr('src', '/img/tree/minustop.png');
|
||||
else
|
||||
$('#xfileset').attr('src', '/img/tree/plusonly.png');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
exit
|
||||
}
|
||||
|
||||
# Otherwise, for a general file.
|
||||
|
||||
puts "
|
||||
<table class=keyval>
|
||||
<tr>
|
||||
<th>File</th>
|
||||
<td>$file</td>
|
||||
</tr><tr>
|
||||
<th>Size</th>
|
||||
<td>$sz</td>
|
||||
</tr><tr>
|
||||
<th>Info</th>
|
||||
<td class=pre id=ffmpeg>
|
||||
<img src=/img/loading.gif><i>Loading...</i>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
"
|
||||
|
||||
set url "/browse/ffmpeg.jim?file=[cgi_quote_url $file]"
|
||||
puts { <script type="text/javascript"> }
|
||||
puts "var url = \"$url\";"
|
||||
puts {
|
||||
$('#ffmpeg').load(url);
|
||||
</script>
|
||||
}
|
||||
|
||||
@@ -1,399 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class pretty_size system.class settings.class escape browse.class
|
||||
|
||||
jqplugin contextMenu bar enadis
|
||||
jscss script.js style.css
|
||||
header
|
||||
|
||||
set nicesplice [system pkginst nicesplice]
|
||||
set flatten [system pkginst flatten]
|
||||
|
||||
set ignore {.nts .thm .hmi}
|
||||
set include {.ts .avi .mpg .mpeg .wmv .mkv .mp3 .mp4 .mov .hmt}
|
||||
|
||||
if {![dict exists $env REQUEST_URI]} {
|
||||
set env(REQUEST_URI) ""
|
||||
cgi_input
|
||||
set _cgi(dir) "/media/My Video/"
|
||||
}
|
||||
|
||||
if {![dict exists $env QUERY_STRING]} { set env(QUERY_STRING) "root" }
|
||||
|
||||
set config [settings new]
|
||||
|
||||
set order [cgi_get order -]
|
||||
if {$order eq "-"} {
|
||||
set order [$config sortorder]
|
||||
} else {
|
||||
$config sortorder $order
|
||||
}
|
||||
|
||||
set nofcount [$config nounwatchedcount]
|
||||
|
||||
set model [system model]
|
||||
set dustbin [system dustbin 1]
|
||||
|
||||
proc icon {img {hover ""} {extra ""} {class "va"}} {
|
||||
puts -nonewline "<img src=$img class=\"$class\" height=21 $extra"
|
||||
if {$hover ne ""} {
|
||||
puts -nonewline " alt=\"$hover\" title=\"$hover\""
|
||||
}
|
||||
puts ">"
|
||||
}
|
||||
|
||||
proc directory {file bfile tbfile} {
|
||||
puts "<div class=\"va relative\">"
|
||||
set img "/images/711_1_09_Media_Folder.png"
|
||||
if {$bfile eq $::dustbin} { set img "/img/Dustbin_Folder.png" }
|
||||
puts "<img border=0 class=va id=\"img$tbfile\" src=$img>"
|
||||
if {!$::nofcount} { puts "<span class=foldernum></span>" }
|
||||
puts "<input class=\"fs fsdir\" type=checkbox>"
|
||||
puts "<a class=dbf
|
||||
href=\"$::env(REQUEST_URI)?dir=[cgi_quote_url $file]\"
|
||||
file=\"[cgi_quote_url $file]\">"
|
||||
puts "$bfile</a><span class=filesize id=\"$tbfile\">
|
||||
</span>"
|
||||
|
||||
lassign [{dir iconset} $file] icons attrs
|
||||
|
||||
puts "<span class=iconset>"
|
||||
puts [join $icons ""]
|
||||
puts "</span>"
|
||||
|
||||
if {[string first $::mroot $file] >= 0} {
|
||||
set class dopt
|
||||
} else {
|
||||
set class doopt
|
||||
}
|
||||
|
||||
puts -nonewline "
|
||||
<a href=#>
|
||||
<img class=\"$class va\" border=0 width=45 "
|
||||
puts -nonewline [join $attrs " "]
|
||||
puts "
|
||||
src=/images/181_1_00_Help5_OPT_Plus.png>
|
||||
</a>
|
||||
"
|
||||
|
||||
puts "
|
||||
<div class=\"results blood\" style=\"margin: 0 0 0 5em\"></div>
|
||||
"
|
||||
puts "</div>"
|
||||
}
|
||||
|
||||
set dircount 0
|
||||
set filecount 0
|
||||
|
||||
proc entry {file} {{i 0}} {
|
||||
global dircount filecount
|
||||
|
||||
set bfile [file tail $file]
|
||||
regsub -all " +" $bfile "" tbfile
|
||||
if {[string index $bfile 0] == "\025"} {
|
||||
set bfile [string range $bfile 1 end]
|
||||
}
|
||||
if [file isdirectory "$file"] {
|
||||
incr dircount
|
||||
directory $file $bfile $tbfile
|
||||
return
|
||||
}
|
||||
set ext [string tolower [file extension $file]]
|
||||
if {$ext in $::ignore || $ext ni $::include} { return }
|
||||
|
||||
file stat $file st
|
||||
set rsz $st(size)
|
||||
set sz [pretty_size $rsz]
|
||||
|
||||
set base [file rootname $file]
|
||||
|
||||
set thmok 0
|
||||
if {$ext eq ".ts" && [file exists "${base}.nts"]} {
|
||||
set type ts
|
||||
set ts [ts fetch $file 1]
|
||||
set img Video_TS
|
||||
set omenu opt
|
||||
if {[file exists "${base}.thm"]} { set thmok 1 }
|
||||
} elseif {$ext eq ".hmt"} {
|
||||
if {[file exists "${base}.ts"]} { continue }
|
||||
# Sole hmt file indicates failure to track.
|
||||
set type bad
|
||||
set ts 0
|
||||
set img Video_Failed
|
||||
set omenu oopt
|
||||
} else {
|
||||
set type gen
|
||||
set ts 0
|
||||
set img Video_Other
|
||||
set omenu oopt
|
||||
}
|
||||
incr filecount
|
||||
|
||||
set new 0
|
||||
if {$type eq "ts"} {
|
||||
if {[$ts flag "New"] > 0} { set new 1 }
|
||||
} elseif {$type eq "gen"} {
|
||||
if {![file exists "${base}.hmi"]} { set new 1 }
|
||||
}
|
||||
|
||||
if {$new} { append img _New }
|
||||
|
||||
set fscl "fs"
|
||||
set synopsis ""
|
||||
if {$type eq "ts"} {
|
||||
set fscl "fs fsts"
|
||||
set synopsis [cgi_quote_html [$ts get synopsis]]
|
||||
}
|
||||
|
||||
puts "
|
||||
<div class=\"va bf\" id=[incr i]>
|
||||
<img class=va border=0 src=/img/$img.png>
|
||||
<input class=\"$fscl\" type=checkbox>
|
||||
<a class=bf title=\"$synopsis\"
|
||||
file=\"[cgi_quote_url $file]\" type=$type href=#>
|
||||
$bfile
|
||||
</a>
|
||||
"
|
||||
|
||||
# Size
|
||||
puts "<span class=filesize> ($sz) </span>"
|
||||
|
||||
# Icons
|
||||
|
||||
set locked 0
|
||||
set encd 0
|
||||
set odencd 1
|
||||
set def unknown
|
||||
set bx 0
|
||||
set dlna 0
|
||||
set shrunk 0
|
||||
if {$type eq "ts"} {
|
||||
set genre [$ts get genre]
|
||||
set glist [ts genrelist]
|
||||
if {[dict exists $glist $genre]} {
|
||||
set ret $glist($genre)
|
||||
} else {
|
||||
set ret $glist(0)
|
||||
}
|
||||
lassign $ret txt img
|
||||
if {$img eq "Unclassified"} {
|
||||
icon "/images/173_3_26_G3_$img.png" $txt "" "va genre"
|
||||
} else {
|
||||
icon "/images/173_3_00_G3_$img.png" $txt "" "va genre"
|
||||
}
|
||||
|
||||
# HD / SD
|
||||
if {[$ts get definition] eq "HD"} {
|
||||
set def HD
|
||||
set img "172_1_00_HD"
|
||||
} else {
|
||||
set def SD
|
||||
set img "172_1_26_SD"
|
||||
}
|
||||
icon "/images/$img.png"
|
||||
|
||||
# Locked
|
||||
if {[$ts flag "Locked"] > 0} {
|
||||
set locked 1
|
||||
icon "/images/178_1_00_Icon_Lock.png" "Locked"
|
||||
}
|
||||
|
||||
# Encrypted
|
||||
if {[$ts flag "Encrypted"] > 0} {
|
||||
set encd 1
|
||||
icon "/images/749_1_26_Video_Encryption.png" ""
|
||||
}
|
||||
if {![$ts flag "ODEncrypted"]} {
|
||||
set odencd 0
|
||||
icon "/img/Decrypted.png" "Decrypted"
|
||||
}
|
||||
|
||||
# Guidance
|
||||
if {[$ts flag "Guidance"] > 0} {
|
||||
icon "/images/174_1_26_GuidancePolicy.png"
|
||||
}
|
||||
|
||||
# Indexed
|
||||
if {$::model eq "HDR" && [llength [$ts dlnaloc]]} {
|
||||
icon "/img/dlna.png" "Indexed by DLNA Server"
|
||||
set dlna 1
|
||||
}
|
||||
|
||||
# Shrunk
|
||||
if {[$ts flag Shrunk]} {
|
||||
icon "/img/compress.png" "Shrunk"
|
||||
set shrunk 1
|
||||
}
|
||||
|
||||
set bx [$ts get bookmarks]
|
||||
}
|
||||
|
||||
# Opt+ button
|
||||
|
||||
puts "
|
||||
<a href=#>
|
||||
<img class=\"$omenu va\" border=0 width=45 type=$type did=$i
|
||||
locked=$locked encd=$encd def=$def new=$new bx=$bx
|
||||
shrunk=$shrunk rsize=$rsz
|
||||
odencd=$odencd dlna=$dlna thmok=$thmok
|
||||
src=/images/181_1_00_Help5_OPT_Plus.png>
|
||||
</a>
|
||||
<div class=\"results blood\" style=\"margin: 0 0 0 5em\"></div>
|
||||
"
|
||||
puts "</div>"
|
||||
}
|
||||
|
||||
set mroot [system mediaroot]
|
||||
set dir [cgi_get dir $mroot]
|
||||
|
||||
######################################################################
|
||||
# Render web page
|
||||
|
||||
source assets.jim
|
||||
|
||||
puts "
|
||||
<span style=\"display:none\" id=dir>$dir</span>
|
||||
<span style=\"display:none\" id=mediaroot>$mroot</span>
|
||||
<fieldset class=cleft style=\"margin: 0 1em 1em 1em\">
|
||||
<legend style=\"font-size: 1.5em; padding: 0 0.5em 0.5em 0.5em;\">
|
||||
"
|
||||
|
||||
# Breadcrumb path
|
||||
set stub ""
|
||||
foreach part [split $dir /] {
|
||||
if {$stub eq "/"} { set name $part } else { set name "/$part" }
|
||||
append stub $name
|
||||
puts "<a href=\"$env(REQUEST_URI)?dir=[cgi_quote_url $stub]\">$name</a>
|
||||
}
|
||||
puts "<span class=filesize id=dirsize></span>"
|
||||
puts "</legend>"
|
||||
|
||||
# Parent directory
|
||||
set parent [join [lrange [split $dir /] 0 end-1] /]
|
||||
if {$parent ne ""} {
|
||||
puts "
|
||||
<div class=va>
|
||||
<a href=\"$env(REQUEST_URI)?dir=[cgi_quote_url $parent]\">
|
||||
<img border=0 src=/images/711_3_09_Media_Folder_UP.png class=va>
|
||||
\[parent directory\]</a>
|
||||
</div>
|
||||
"
|
||||
}
|
||||
|
||||
proc s_time {a b} {
|
||||
global dir
|
||||
|
||||
set a "$dir/$a"
|
||||
set b "$dir/$b"
|
||||
|
||||
set ad [file isdirectory $a]
|
||||
set bd [file isdirectory $b]
|
||||
|
||||
if {$ad && !$bd} { return -1 }
|
||||
if {$bd && !$ad} { return 1 }
|
||||
if {$ad && $bd} {
|
||||
if {$a < $b} { return -1 }
|
||||
if {$a > $b} { return 1 }
|
||||
return 0
|
||||
}
|
||||
|
||||
if {[catch {file stat $a l}]} { return 0}
|
||||
set at $l(mtime)
|
||||
if {[catch {file stat $b l}]} { return 0}
|
||||
set bt $l(mtime)
|
||||
|
||||
if {$at < $bt} { return -1 }
|
||||
if {$at > $bt} { return 1 }
|
||||
return 0
|
||||
}
|
||||
|
||||
set files [readdir -nocomplain $dir]
|
||||
switch $order {
|
||||
1 { set files [lsort -command s_time $files] }
|
||||
default { set files [lsort -nocase $files] }
|
||||
}
|
||||
|
||||
foreach file $files { entry "$dir/$file" }
|
||||
|
||||
puts "
|
||||
<a href=# id=selectall>Select all</a> | <a href=# id=deselectall>none</a>
|
||||
|
||||
Directories: $dircount, Files: $filecount
|
||||
"
|
||||
|
||||
# Sort icons
|
||||
puts "<div id=sortdiv>"
|
||||
set sortlist {{0 sort_name name} {1 sort_date date}}
|
||||
foreach sl $sortlist {
|
||||
lassign $sl index img descr
|
||||
|
||||
if {$index} { puts " | " }
|
||||
|
||||
set tag "Currently sorting"
|
||||
if {$order != $index} {
|
||||
puts "
|
||||
<a href=\"$env(REQUEST_URI)?$env(QUERY_STRING)&order=$index\">"
|
||||
set tag "Sort"
|
||||
}
|
||||
puts "<img class=va border=0 src=/img/$img.gif> $tag by $descr"
|
||||
if {$order != $index} {
|
||||
puts "</a>"
|
||||
}
|
||||
}
|
||||
puts "</div>"
|
||||
|
||||
puts "</fieldset>"
|
||||
|
||||
puts {
|
||||
<fieldset class=left style="margin: 0 1em 1em 1em">
|
||||
<legend style="font-size: 1.5em; padding: 0 0.5em 0.5em 0.5em; color: #1e5bbd;">
|
||||
File Clipboard
|
||||
</legend>
|
||||
<div id=clipboard>
|
||||
<img src=/img/loading.gif> <i>Loading...</i>
|
||||
</div>
|
||||
</fieldset>
|
||||
}
|
||||
|
||||
puts "<div class=brow>"
|
||||
|
||||
puts {
|
||||
<button id=copy>Copy</button>
|
||||
<button id=cut>Cut</button>
|
||||
<button id=delete>Delete</button>
|
||||
<button id=newdir>New Folder</button>
|
||||
<div id=deletewait class=blood style="display: none">
|
||||
<img src=/img/loading.gif>Deleting may take some time, please be patient...
|
||||
</div>
|
||||
}
|
||||
|
||||
# Join
|
||||
if $nicesplice {
|
||||
puts { <button id=join>Join</button> }
|
||||
}
|
||||
|
||||
puts "</div><div class=brow style=\"margin-top: 3px\">"
|
||||
|
||||
# De-duplicate
|
||||
|
||||
puts {
|
||||
<button id=dedup>De-duplicate/tidy this folder</button>
|
||||
}
|
||||
|
||||
# Streamer file
|
||||
|
||||
if {[file exists /mnt/hd3/Streamer_down_file]} {
|
||||
puts {
|
||||
<button id=save_stream file=/mnt/hd3/Streamer_down_file>
|
||||
Save last streamed content (e.g. iPlayer/YouTube)
|
||||
<div id=streamstatus></div>
|
||||
</button>
|
||||
}
|
||||
}
|
||||
|
||||
puts "</div>"
|
||||
|
||||
footer
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
httpheader
|
||||
|
||||
set file [cgi_get renamefile "-"]
|
||||
if {$file eq "-"} exit
|
||||
|
||||
set newfile [string trim [cgi_get rename]]
|
||||
set dir [file dirname $file]
|
||||
|
||||
if {[file isdirectory $file]} {
|
||||
#puts "Directory."
|
||||
if {$newfile ne ""} {
|
||||
set newfile "${dir}/${newfile}"
|
||||
file rename $file $newfile
|
||||
}
|
||||
} elseif {[set ts [ts fetch $file]] != 0} {
|
||||
#puts "TS file."
|
||||
|
||||
foreach attr {title synopsis guidance genre} {
|
||||
if {[catch {
|
||||
set new [string trim [cgi_get "rename_$attr"]]
|
||||
set old [$ts get $attr]
|
||||
if {$new ne $old} {
|
||||
if {$attr eq "guidance" ||
|
||||
[string length $new] > 0} {
|
||||
$ts set$attr $new
|
||||
}
|
||||
}
|
||||
} msg]} {
|
||||
puts "$attr: $msg"
|
||||
}
|
||||
}
|
||||
|
||||
if {"$dir/$newfile.ts" ne "$file"} { ts renamegroup $file $newfile }
|
||||
} else {
|
||||
#puts "Normal file."
|
||||
if {$newfile ne ""} {
|
||||
set newfile "$dir/$newfile[file extension $file]"
|
||||
puts "Rename ($file) -> ($newfile)"
|
||||
file rename $file $newfile
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,999 +0,0 @@
|
||||
|
||||
var dir;
|
||||
|
||||
function disableall()
|
||||
{
|
||||
$('button,a,input').disable();
|
||||
}
|
||||
|
||||
function pastedialogue()
|
||||
{
|
||||
$('#pwdialogue').dialog({
|
||||
title: "Pasting from clipboard",
|
||||
modal: true, autoOpen: true,
|
||||
height: 'auto', width: 'auto',
|
||||
show: 'scale', hide: 'fade',
|
||||
draggable: false, resizable: false,
|
||||
closeOnEscape: false,
|
||||
open: function() {
|
||||
$('.ui-dialog-titlebar-close').hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function reloadclipboard()
|
||||
{
|
||||
$('#clipboard')
|
||||
.empty()
|
||||
.html('<img src=/img/loading.gif> <i>Loading...</i>')
|
||||
.load('/browse/clipboard.jim', function() {
|
||||
|
||||
// Start Clipboard post-load actions
|
||||
|
||||
if ($('#clipclear').length)
|
||||
{
|
||||
$('#paste').enable();
|
||||
$('#doptmenu,#dooptmenu').enableContextMenuItems('#paste');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#paste').disable();
|
||||
$('#doptmenu,#dooptmenu').disableContextMenuItems('#paste');
|
||||
}
|
||||
|
||||
$('#clipclear').button().click(function() {
|
||||
$.get('/browse/clipboard.jim?act=clear', function() {
|
||||
reloadclipboard();
|
||||
});
|
||||
});
|
||||
|
||||
$('a.clipdel').click(function() {
|
||||
$.get('/browse/clipboard.jim?act=remove&path=' +
|
||||
$(this).attr('path'), function() {
|
||||
reloadclipboard();
|
||||
});
|
||||
});
|
||||
|
||||
$('#paste').button()
|
||||
.click(function() {
|
||||
disableall();
|
||||
pastedialogue();
|
||||
$('#pwfeedback').load(
|
||||
'/browse/clipboard.jim?act=paste&dir='
|
||||
+ encodeURIComponent(dir), function() {
|
||||
$('#pwdialogue').dialog('close');
|
||||
window.location.reload(true);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// End Clipboard post-load actions
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function epginfo_callback(data, status, xhr)
|
||||
{
|
||||
//console.log(status);
|
||||
//console.dir(data);
|
||||
|
||||
if (status != 'success')
|
||||
return;
|
||||
|
||||
$('#rename_title').val(data.title);
|
||||
$('#rename_synopsis').val(data.synopsis);
|
||||
$('#rename_guidance').val(data.guidance);
|
||||
$('#rename_genre').val(data.genre);
|
||||
|
||||
$('tr.tstype').show('slow');
|
||||
}
|
||||
|
||||
function insert_folder_size(folder, size)
|
||||
{
|
||||
folder = folder.replace(/ /g, '');
|
||||
folder = folder.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g, '\\$1');
|
||||
//console.log("Folder: (%s) = (%s)", folder, size);
|
||||
if (size.search(/\d$/) == -1)
|
||||
size += 'iB';
|
||||
else
|
||||
size += ' bytes';
|
||||
if (folder == "")
|
||||
$('#dirsize').text(' (' + size + ')');
|
||||
else
|
||||
$('#' + folder).text(' (' + size + ')');
|
||||
}
|
||||
|
||||
function folder_size_callback(data, status, xhr)
|
||||
{
|
||||
//console.log("Status: %s", status);
|
||||
//console.dir(data);
|
||||
$.each(data, insert_folder_size);
|
||||
}
|
||||
|
||||
function set_folder_new(folder, cnt)
|
||||
{
|
||||
folder = folder.replace(/ /g, '');
|
||||
folder = folder.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g, '\\$1');
|
||||
//console.log("Folder: (%s) = (%s)", folder, cnt);
|
||||
left = cnt > 99 ? 11 : (cnt > 9 ? 14 : 17);
|
||||
$('#img' + folder)
|
||||
.attr('src', '/img/Folder_New.png')
|
||||
.next('span.foldernum')
|
||||
.css('left', left + 'px')
|
||||
.text(cnt)
|
||||
.show();
|
||||
}
|
||||
|
||||
function new_folder_callback(data, status, xhr)
|
||||
{
|
||||
//console.log("Status: %s", status);
|
||||
//console.dir(data);
|
||||
$.each(data, set_folder_new);
|
||||
}
|
||||
|
||||
//function insert_shrunk(file, perc)
|
||||
//{
|
||||
// if (perc == 0)
|
||||
// {
|
||||
// file = file.replace(/[ ]/g, '');
|
||||
// file = file.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g, '\\$1');
|
||||
// //console.log("File: (%s) = (%s)", file, perc);
|
||||
// $('#sp_' + file).show();
|
||||
// }
|
||||
//}
|
||||
|
||||
//function shrunk_callback(data, status, xhr)
|
||||
//{
|
||||
// //console.log("Status: %s", status);
|
||||
// //console.dir(data);
|
||||
// $.each(data, insert_shrunk);
|
||||
//}
|
||||
|
||||
function delete_callback(file, dir, id)
|
||||
{
|
||||
var el = 'div.bf#' + id;
|
||||
var results = el + ' .results';
|
||||
$(results)
|
||||
.html('<img src=/img/loading.gif>Deleting, please wait...')
|
||||
.slideDown('slow')
|
||||
.load('/browse/delete.jim', {
|
||||
'dir': dir,
|
||||
'files': [decodeURIComponent(file)]
|
||||
}, function() {
|
||||
$(el).delay(3000).slideUp(300, function() {
|
||||
$(el).remove();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function lock_callback(file, type, id)
|
||||
{
|
||||
var url = '/browse/lock.jim?file=' + file;
|
||||
$.get(url, function() { window.location.reload(true); });
|
||||
}
|
||||
|
||||
function enc_callback(file, type, id)
|
||||
{
|
||||
var url = '/browse/enc.jim?file=' + file;
|
||||
$.get(url, function() { window.location.reload(true); });
|
||||
}
|
||||
|
||||
function new_callback(file, type, id)
|
||||
{
|
||||
var url = '/browse/new.jim?file=' + file;
|
||||
$.get(url, function() { window.location.reload(true); });
|
||||
}
|
||||
|
||||
function thumbnail_callback(file, type, id)
|
||||
{
|
||||
var el = 'div.bf#' + id;
|
||||
var results = el + ' .results';
|
||||
$(results)
|
||||
.html('<img src=/img/loading.gif>Generating thumbnail, ' +
|
||||
'please wait...')
|
||||
.slideDown('slow')
|
||||
.load('/browse/thumbnail.jim?file=' + file)
|
||||
.delay(3000)
|
||||
.slideUp('slow');
|
||||
$('div.bf#' + id + ' img.opt').attr('thmok', 1);
|
||||
}
|
||||
|
||||
function rename_submit()
|
||||
{
|
||||
var s = $('#renameform_form').serialize();
|
||||
$.post('/browse/rename.jim', s,
|
||||
function() { window.location.reload(true); });
|
||||
}
|
||||
|
||||
function drename_submit()
|
||||
{
|
||||
var s = $('#drenameform_form').serialize();
|
||||
$.get('/browse/rename.jim?' + s,
|
||||
function() { window.location.reload(true); });
|
||||
}
|
||||
|
||||
function aexpiry_submit()
|
||||
{
|
||||
$('#aexpiry_working').slideDown('slow');
|
||||
var s = $('#aexpiry_form').serialize();
|
||||
$.get('/browse/aexpiry.jim?' + s,
|
||||
function() { window.location.reload(true); });
|
||||
}
|
||||
|
||||
function newdir_submit()
|
||||
{
|
||||
var s = $('#newdirform_form').serialize();
|
||||
$.get('/browse/mknewdir.jim?' + s,
|
||||
function() { window.location.reload(true); });
|
||||
}
|
||||
|
||||
function savestream_submit()
|
||||
{
|
||||
var s = $('#savestream_form').serialize();
|
||||
var sf = $('#save_stream').attr('file');
|
||||
$('#savestream_name').disable();
|
||||
$('#savestream_spin').show();
|
||||
$.get('/browse/savestream.jim?sfile=' +
|
||||
encodeURIComponent(sf) + '&' + s,
|
||||
function() {
|
||||
window.location.reload(true);
|
||||
});
|
||||
}
|
||||
|
||||
var $confirm; // Populated after DOM is loaded.
|
||||
|
||||
function confirm_action(action, callback, file, type, id)
|
||||
{
|
||||
var bfile = file.replace(/.*\/|\.[^.]*$/g, '');
|
||||
$confirm.dialog('option', 'buttons', {
|
||||
'Yes': function() { $(this).dialog('close');
|
||||
callback(file, type, id); },
|
||||
'No': function() {$(this).dialog('close');}
|
||||
|
||||
});
|
||||
$('#confirm').empty().html(
|
||||
'Are you sure you wish to ' + action + '<br>' +
|
||||
'<i>' + decodeURIComponent(bfile) + '</i> ?'
|
||||
);
|
||||
$confirm.dialog('open');
|
||||
}
|
||||
|
||||
function preparemenu(el, menu)
|
||||
{
|
||||
if (el.attr('type') == 'ts')
|
||||
{
|
||||
// if (el.attr('def') == 'HD')
|
||||
// {
|
||||
// $(menu).enableContextMenuItems('#enc');
|
||||
// if (el.attr('encd') == 1)
|
||||
// $(menu).changeContextMenuItem('#enc',
|
||||
// 'Remove Enc');
|
||||
// else
|
||||
// $(menu).changeContextMenuItem('#enc',
|
||||
// 'Set Enc');
|
||||
// }
|
||||
|
||||
if (el.attr('bx') > 0)
|
||||
$(menu).enableContextMenuItems('#crop');
|
||||
else
|
||||
$(menu).disableContextMenuItems('#crop');
|
||||
|
||||
if (el.attr('odencd') == 0)
|
||||
$(menu).enableContextMenuItems('#thm');
|
||||
else
|
||||
$(menu).disableContextMenuItems('#thm');
|
||||
|
||||
if (el.attr('thmok') == 1)
|
||||
$(menu).enableContextMenuItems('#vthm');
|
||||
else
|
||||
$(menu).disableContextMenuItems('#vthm');
|
||||
|
||||
$(menu).enableContextMenuItems('#strip');
|
||||
|
||||
if (el.attr('rsize') > 4294967296)
|
||||
$(menu).enableContextMenuItems('#chunk');
|
||||
else
|
||||
$(menu).disableContextMenuItems('#chunk');
|
||||
|
||||
$(menu).enableContextMenuItems('#new');
|
||||
if (el.attr('new') == 1)
|
||||
$(menu).changeContextMenuItem('#new', 'Mark watched');
|
||||
else
|
||||
$(menu).changeContextMenuItem('#new', 'Mark new');
|
||||
|
||||
|
||||
$(menu).enableContextMenuItems('#lock');
|
||||
if (el.attr('locked') == 1)
|
||||
{
|
||||
$(menu).changeContextMenuItem('#lock', 'Unlock');
|
||||
$(menu).disableContextMenuItems('#delete');
|
||||
}
|
||||
else
|
||||
{
|
||||
$(menu).changeContextMenuItem('#lock', 'Lock');
|
||||
$(menu).enableContextMenuItems('#delete');
|
||||
}
|
||||
|
||||
if (el.attr('odencd') == 1 && el.attr('dlna') == 1 &&
|
||||
el.attr('encd') == 0)
|
||||
$(menu).enableContextMenuItems('#decrypt');
|
||||
else
|
||||
$(menu).disableContextMenuItems('#decrypt');
|
||||
|
||||
if (el.attr('odencd') == 1)
|
||||
{
|
||||
$(menu).disableContextMenuItems('#audio');
|
||||
$(menu).disableContextMenuItems('#mpg');
|
||||
}
|
||||
else
|
||||
{
|
||||
$(menu).enableContextMenuItems('#audio');
|
||||
if (el.attr('def') == 'HD')
|
||||
$(menu).disableContextMenuItems('#mpg');
|
||||
else
|
||||
$(menu).enableContextMenuItems('#mpg');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$(menu).enableContextMenuItems('#delete');
|
||||
$(menu).disableContextMenuItems('#lock');
|
||||
//$(menu).disableContextMenuItems('#enc');
|
||||
$(menu).disableContextMenuItems('#new');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function fixdmenu(el, menu, flag, tag, descr, recurse)
|
||||
{
|
||||
var a = el.attr(flag);
|
||||
var b = el.attr(flag + 'r');
|
||||
|
||||
if (a == undefined) a = 0;
|
||||
if (b == undefined) b = 0;
|
||||
|
||||
if (a > 0)
|
||||
$(menu).changeContextMenuItem(tag, 'Disable ' + descr);
|
||||
else
|
||||
$(menu).changeContextMenuItem(tag, 'Enable ' + descr);
|
||||
|
||||
if (recurse)
|
||||
{
|
||||
if (b > 0)
|
||||
{
|
||||
$(menu).changeContextMenuItem(tag + 'r',
|
||||
'Disable Recursive ' + descr);
|
||||
$(menu).disableContextMenuItems(tag);
|
||||
}
|
||||
else
|
||||
{
|
||||
$(menu).changeContextMenuItem(tag + 'r',
|
||||
'Enable Recursive ' + descr);
|
||||
$(menu).enableContextMenuItems(tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function preparedmenu(el, menu)
|
||||
{
|
||||
if (el.attr('noflat') != undefined)
|
||||
{
|
||||
if (el.attr('noflat') > 0)
|
||||
$(menu).changeContextMenuItem('#flat', 'Allow Flatten');
|
||||
else
|
||||
$(menu).changeContextMenuItem('#flat',
|
||||
'Prevent Flatten');
|
||||
}
|
||||
|
||||
fixdmenu(el, menu, 'autoshrink', '#shrink', 'Auto-shrink', 1);
|
||||
fixdmenu(el, menu, 'autodedup', '#dedup', 'Auto-dedup', 0);
|
||||
fixdmenu(el, menu, 'autodecrypt', '#decrypt', 'Auto-decrypt', 1);
|
||||
fixdmenu(el, menu, 'autompg', '#mpg', 'Auto-mpg', 0);
|
||||
fixdmenu(el, menu, 'automp3', '#mp3', 'Auto-audio', 0);
|
||||
fixdmenu(el, menu, 'autoexpire', '#expire', 'Auto-expire', 0);
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
dir = $('#dir').text();
|
||||
|
||||
var menuclick = function(action, el, pos)
|
||||
{
|
||||
var file = $(el).parent().prevAll('a.bf').last().attr('file');
|
||||
var bfile = file.replace(/.*\/|\.[^.]*$/g, '');
|
||||
bfile = bfile.replace(/[\x00-\x1f]+/g, '');
|
||||
var type = $(el).attr('type');
|
||||
var id = $(el).attr('did');
|
||||
switch (action)
|
||||
{
|
||||
case 'delete':
|
||||
confirm_action('delete', delete_callback, file,
|
||||
dir, id);
|
||||
break;
|
||||
|
||||
case 'copy':
|
||||
if (!confirm('Are you sure? Copying recordings takes a long time!'))
|
||||
break;
|
||||
// Fallthrough
|
||||
case 'cut':
|
||||
$.get('/browse/clipboard.jim?act=add&mode=' + action +
|
||||
'&path=' + file, function() {
|
||||
reloadclipboard();
|
||||
});
|
||||
break;
|
||||
|
||||
case 'lock':
|
||||
confirm_action('change the lock on', lock_callback,
|
||||
file, type, id);
|
||||
break;
|
||||
|
||||
// case 'enc':
|
||||
// confirm_action('change the ENC flag on', enc_callback,
|
||||
// file, type, id);
|
||||
// break;
|
||||
|
||||
case 'new':
|
||||
confirm_action('change the New flag on', new_callback,
|
||||
file, type, id);
|
||||
break;
|
||||
|
||||
case 'rename':
|
||||
$('#rename').val(decodeURIComponent(bfile));
|
||||
$('#renamefile').val(decodeURIComponent(file));
|
||||
|
||||
$('#rename_title').val('');
|
||||
$('#rename_synopsis').val('');
|
||||
$('#rename_guidance').val('');
|
||||
$('tr.tstype').css('display', 'none');
|
||||
|
||||
if (type == 'ts')
|
||||
{
|
||||
$.getJSON('/browse/epgtitle.jim?file=' +
|
||||
file, epginfo_callback);
|
||||
}
|
||||
|
||||
$('#renameform').dialog('open');
|
||||
break;
|
||||
|
||||
case 'thm':
|
||||
window.location.href = '/browse/thumbnail/index.jim?file=' +
|
||||
file;
|
||||
break;
|
||||
|
||||
case 'vthm':
|
||||
// window.open('/browse/bmpw.jim?file=' + file, 'hxwebifbmp',
|
||||
// 'height=156,width=280,toolbar=no,' +
|
||||
// 'scrollbars=no,menubar=no,location=no,titlebar=no');
|
||||
$('#thmbmp').attr('src', 'bmp.jim?file=' + file);
|
||||
$('#bmpdialogue').dialog('open');
|
||||
break;
|
||||
|
||||
case 'download':
|
||||
window.location.href = '/browse/download.jim?file=' +
|
||||
file + '&base=' +
|
||||
encodeURIComponent(document.URL.match(/:\/\/(.[^/]+)/)[1]);
|
||||
break;
|
||||
|
||||
case 'crop':
|
||||
window.location.href = '/browse/crop/crop.jim?file=' +
|
||||
file;
|
||||
break;
|
||||
|
||||
case 'strip':
|
||||
window.location.href = '/browse/strip/strip.jim?file=' +
|
||||
file;
|
||||
break;
|
||||
|
||||
case 'chunk':
|
||||
window.location.href = '/browse/chunk/chunk.jim?file=' +
|
||||
file;
|
||||
break;
|
||||
|
||||
case 'decrypt':
|
||||
window.location.href =
|
||||
'/browse/decrypt/decrypt.jim?file=' + file;
|
||||
break;
|
||||
|
||||
case 'audio':
|
||||
window.location.href = '/browse/audio/audio.jim?file=' +
|
||||
file;
|
||||
break;
|
||||
|
||||
case 'mpg':
|
||||
window.location.href = '/browse/mpg/mpg.jim?file=' +
|
||||
file;
|
||||
break;
|
||||
|
||||
default:
|
||||
alert('Unhandled action: ' + action);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
function flagdir(file, flag, iconset, output, options)
|
||||
{
|
||||
var url = '/browse/flagdir.jim?dir=' + file +
|
||||
'&flag=' + flag;
|
||||
|
||||
$(output).load(url, function() {
|
||||
$(iconset)
|
||||
.empty()
|
||||
.html('<img src=/img/loading.gif> Updating...')
|
||||
.load('/browse/iconset.jim?file=' + file);
|
||||
if ($(options).attr(flag) == '1')
|
||||
$(options).attr(flag, 0);
|
||||
else
|
||||
$(options).attr(flag, 1);
|
||||
}).delay(3000).slideUp();
|
||||
}
|
||||
|
||||
var dmenuclick = function(action, el, pos)
|
||||
{
|
||||
var direl = $(el).parent().parent();
|
||||
var file = $(el).parent().prevAll('a.dbf').last().attr('file');
|
||||
var iconset = $(el).parent().prevAll('span.iconset').last();
|
||||
var bfile = file.replace(/.*\//g, '');
|
||||
bfile = bfile.replace(/[\x00-\x1f]+/g, '');
|
||||
var results = $(el).parent().next('div.results');
|
||||
|
||||
switch (action)
|
||||
{
|
||||
case 'paste':
|
||||
pastedialogue();
|
||||
$('#pwfeedback').load(
|
||||
'/browse/clipboard.jim?act=paste&dir=' +
|
||||
file, function() {
|
||||
$('#pwdialogue').dialog('close');
|
||||
reloadclipboard();
|
||||
});
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
|
||||
if (confirm('Are you sure you wish to delete "' +
|
||||
decodeURIComponent(file) +
|
||||
'" and all files within it?'))
|
||||
{
|
||||
$(results)
|
||||
.html('<img src=/img/loading.gif>' +
|
||||
'Deleting, please wait...')
|
||||
.slideDown('slow')
|
||||
.load('/browse/delete.jim', {
|
||||
'dir': dir,
|
||||
'files': [decodeURIComponent(file)]
|
||||
}, function() {
|
||||
$(direl).delay(3000).slideUp(300, function() {
|
||||
$(direl).remove();
|
||||
});
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
case 'copy':
|
||||
if (!confirm('Are you sure? Copying directories can take a very long time!'))
|
||||
break;
|
||||
// Fallthrough
|
||||
case 'cut':
|
||||
$.get('/browse/clipboard.jim?act=add&mode=' + action +
|
||||
'&path=' + file, function() {
|
||||
reloadclipboard();
|
||||
});
|
||||
break;
|
||||
|
||||
case 'rename':
|
||||
$('#drename').val(decodeURIComponent(bfile));
|
||||
$('#drenameorig').val(decodeURIComponent(file));
|
||||
$('#drenameform').dialog('open');
|
||||
break;
|
||||
|
||||
case 'expire':
|
||||
if ($(el).attr('autoexpire') == 1)
|
||||
flagdir(file, 'autoexpire', iconset, results, el);
|
||||
else
|
||||
{
|
||||
$('#aexpiry_ldir').val(decodeURIComponent(file));
|
||||
if ($(el).attr('autoexpiredays') > 0)
|
||||
$('#aexpiry_days')
|
||||
.val($(el).attr('autoexpiredays'));
|
||||
else
|
||||
$('#aexpiry_days').val(7);
|
||||
$('#aexpiry_working').hide('fast');
|
||||
$('#aexpiry').dialog('open');
|
||||
}
|
||||
break;
|
||||
|
||||
case 'flat':
|
||||
flagdir(file, 'noflatten', iconset, results, el);
|
||||
break;
|
||||
|
||||
case 'dedup':
|
||||
flagdir(file, 'autodedup', iconset, results, el);
|
||||
break;
|
||||
|
||||
case 'mpg':
|
||||
flagdir(file, 'autompg', iconset, results, el);
|
||||
break;
|
||||
|
||||
case 'mp3':
|
||||
flagdir(file, 'automp3', iconset, results, el);
|
||||
break;
|
||||
|
||||
case 'shrink':
|
||||
flagdir(file, 'autoshrink', iconset, results, el);
|
||||
break;
|
||||
|
||||
case 'shrinkr':
|
||||
flagdir(file, 'autoshrinkr', iconset, results, el);
|
||||
break;
|
||||
|
||||
case 'decrypt':
|
||||
flagdir(file, 'autodecrypt', iconset, results, el);
|
||||
break;
|
||||
|
||||
case 'decryptr':
|
||||
flagdir(file, 'autodecryptr', iconset, results, el);
|
||||
break;
|
||||
|
||||
case 'resetnew':
|
||||
var url = '/browse/resetnew.jim?dir=' + file;
|
||||
$.get(url, function() { window.location.reload(true); });
|
||||
break;
|
||||
|
||||
default:
|
||||
alert('Unhandled action: ' + action);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
// Bind context menu to opt+ image
|
||||
$('img.opt').contextMenu(
|
||||
{
|
||||
menu: 'optmenu',
|
||||
leftButton: true,
|
||||
beforeShow: preparemenu
|
||||
},
|
||||
menuclick
|
||||
);
|
||||
|
||||
// Bind context menu to opt+ image
|
||||
$('img.oopt').contextMenu(
|
||||
{
|
||||
menu: 'ooptmenu',
|
||||
leftButton: true,
|
||||
beforeShow: preparemenu
|
||||
},
|
||||
menuclick
|
||||
);
|
||||
|
||||
$('img.dopt').contextMenu(
|
||||
{
|
||||
menu: 'doptmenu',
|
||||
leftButton: true,
|
||||
beforeShow: preparedmenu
|
||||
},
|
||||
dmenuclick
|
||||
);
|
||||
|
||||
$('img.doopt').contextMenu(
|
||||
{
|
||||
menu: 'dooptmenu',
|
||||
leftButton: true,
|
||||
beforeShow: preparedmenu
|
||||
},
|
||||
dmenuclick
|
||||
);
|
||||
|
||||
// Disable items which are not yet implemented.
|
||||
$('#optmenu').disableContextMenuItems('#title');
|
||||
|
||||
var $buttons = {
|
||||
"Close" : function() {$(this).dialog('close');}
|
||||
};
|
||||
var $buttonsp = $.extend(
|
||||
{"Play" : function() { doplay(); }},
|
||||
$buttons);
|
||||
|
||||
// Create reusable dialogue.
|
||||
var $dialog = $('#dialogue').dialog({
|
||||
title: "Media Details",
|
||||
modal: false, autoOpen: false,
|
||||
height: 600, width: 700,
|
||||
show: 'scale', hide: 'fade',
|
||||
draggable: true, resizable: true,
|
||||
buttons: $buttons,
|
||||
close: function(e,u) { $('#dialogue').empty().html(
|
||||
'<img src="/img/loading.gif" alt="loading">'); }
|
||||
});
|
||||
|
||||
function doplay()
|
||||
{
|
||||
var file = $dialog.attr('file');
|
||||
var type = $dialog.attr('type');
|
||||
|
||||
disableall();
|
||||
|
||||
window.location = '/play/play.jim?' +
|
||||
'dir=' + encodeURIComponent(dir) +
|
||||
'&file=' + file;
|
||||
}
|
||||
|
||||
// Bind dialogue open to filenames.
|
||||
$('a.bf').click(function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
var file = $(this).attr('file');
|
||||
var type = $(this).attr('type');
|
||||
var opt = $(this).nextAll('a').find('img.opt');
|
||||
|
||||
var url = '/browse/file.jim?file=' + file
|
||||
+ '&type=' + type;
|
||||
$dialog.load(url);
|
||||
|
||||
$dialog.attr('file', file);
|
||||
$dialog.attr('type', type);
|
||||
|
||||
if (type == 'ts' &&
|
||||
(opt.attr('odencd') == 0 || opt.attr('dlna') == 1))
|
||||
$dialog.dialog("option", "buttons", $buttonsp);
|
||||
else
|
||||
$dialog.dialog("option", "buttons", $buttons);
|
||||
$dialog.dialog('open');
|
||||
});
|
||||
|
||||
$('#renameform').dialog({
|
||||
autoOpen: false,
|
||||
height: 'auto', width: 'auto',
|
||||
modal: true,
|
||||
buttons: {
|
||||
"Update": rename_submit,
|
||||
"Close": function() {
|
||||
$(this).dialog('close');
|
||||
}
|
||||
},
|
||||
close: function() { $('#rename').val(''); }
|
||||
});
|
||||
|
||||
$('#drenameform').dialog({
|
||||
autoOpen: false,
|
||||
height: 'auto', width: 'auto',
|
||||
modal: true,
|
||||
buttons: {
|
||||
"Update": drename_submit,
|
||||
"Close": function() {
|
||||
$(this).dialog('close');
|
||||
}
|
||||
},
|
||||
close: function() { $('#drename').val(''); }
|
||||
});
|
||||
|
||||
$('#aexpiry').dialog({
|
||||
autoOpen: false,
|
||||
height: 'auto', width: 'auto',
|
||||
modal: true,
|
||||
buttons: {
|
||||
"Update": aexpiry_submit,
|
||||
"Close": function() {
|
||||
$(this).dialog('close');
|
||||
}
|
||||
},
|
||||
close: function() { $('#aexpiry_days').val('0'); }
|
||||
});
|
||||
|
||||
$('#savestreamform').dialog({
|
||||
autoOpen: false,
|
||||
height: 'auto', width: 'auto',
|
||||
modal: true,
|
||||
buttons: {
|
||||
"Save": savestream_submit,
|
||||
"Cancel": function() {
|
||||
$(this).dialog('close');
|
||||
}
|
||||
},
|
||||
close: function() { $('#savestream_name').val(''); }
|
||||
});
|
||||
|
||||
$('#savestream_name').keyup(function(e) {
|
||||
if (e.keyCode == $.ui.keyCode.ENTER)
|
||||
savestream_submit();
|
||||
});
|
||||
|
||||
$('#bmpdialogue').dialog({
|
||||
autoOpen: false,
|
||||
height: 'auto', width: 'auto',
|
||||
modal: true,
|
||||
buttons: {
|
||||
"Close": function() {
|
||||
$(this).dialog('close');
|
||||
}
|
||||
},
|
||||
close: function() { $('#thmbmp').attr('src', 'about:blank'); }
|
||||
});
|
||||
|
||||
// Create re-usable confirmation dialogue.
|
||||
$confirm = $('#confirm').dialog({
|
||||
modal: true, autoOpen: false,
|
||||
height: 160, width: 500,
|
||||
show: 'fade', hide: 'fade',
|
||||
draggable: false, resizable: false
|
||||
});
|
||||
|
||||
// Load folder sizes
|
||||
$.getJSON('/browse/sizes.jim?dir=' + encodeURIComponent(dir),
|
||||
folder_size_callback);
|
||||
|
||||
// Flag shrunk recordings
|
||||
// $.getJSON('/browse/shrunk.jim?dir=' + encodeURIComponent(dir),
|
||||
// shrunk_callback);
|
||||
|
||||
// Flag folders with unwatched items
|
||||
$.getJSON('/browse/newdir.jim?dir=' + encodeURIComponent(dir),
|
||||
new_folder_callback);
|
||||
|
||||
// Load clipboard
|
||||
reloadclipboard();
|
||||
|
||||
// Uncheck everything
|
||||
$('input.fs:checked').attr('checked', false);
|
||||
|
||||
// Buttons
|
||||
|
||||
$('#dedup').button().click(function() {
|
||||
window.location = '/dedup/dedup.jim?dir='
|
||||
+ encodeURIComponent(dir);
|
||||
});
|
||||
|
||||
$('#save_stream').button().click(function() {
|
||||
$('#savestream_retrieving').show();
|
||||
$('#savestream_detail').text('').hide();
|
||||
$('#savestream_spin').hide();
|
||||
$('#savestream_name').val('').enable();
|
||||
|
||||
$('#savestreamform').dialog('open');
|
||||
$('#savestream_detail').load(
|
||||
'/browse/ffmpeg.jim?file=' +
|
||||
encodeURIComponent($('#save_stream').attr('file')),
|
||||
function() {
|
||||
$('#savestream_retrieving').hide();
|
||||
$('#savestream_detail').show();
|
||||
$('#savestream_form').show();
|
||||
});
|
||||
});
|
||||
|
||||
$('#selectall').click(function(e) {
|
||||
e.preventDefault();
|
||||
$('input.fs').attr('checked', true).trigger('change');
|
||||
});
|
||||
$('#deselectall').click(function(e) {
|
||||
e.preventDefault();
|
||||
$('input.fs:checked').attr('checked', false).trigger('change');
|
||||
});
|
||||
|
||||
$('#join').button().disable()
|
||||
.click(function() {
|
||||
var files = new Array();
|
||||
var els = $('input.fsts:checked + a').each(function() {
|
||||
files.push($(this).attr('file'));
|
||||
});
|
||||
//console.log("%o", files);
|
||||
window.location.href = '/browse/join/join.jim?files=' +
|
||||
files.join();
|
||||
});
|
||||
|
||||
$('#delete').button().disable()
|
||||
.click(function() {
|
||||
var files = new Array();
|
||||
var els = $('input.fs:checked + a').each(function() {
|
||||
files.push(decodeURIComponent($(this).attr('file')));
|
||||
});
|
||||
//console.log("%o", files);
|
||||
var str = 'Are you sure you want to delete ' + files.length +
|
||||
' file';
|
||||
if (files.length != 1) str += 's';
|
||||
str += '?';
|
||||
if (confirm(str))
|
||||
{
|
||||
disableall();
|
||||
$('#deletewait').slideDown('slow');
|
||||
|
||||
$('#pwdialogue').dialog({
|
||||
title: "Deleting",
|
||||
modal: true, autoOpen: true,
|
||||
height: 'auto', width: 'auto',
|
||||
show: 'scale', hide: 'fade',
|
||||
draggable: false, resizable: false,
|
||||
closeOnEscape: false,
|
||||
open: function() {
|
||||
$('.ui-dialog-titlebar-close').hide();
|
||||
}
|
||||
});
|
||||
$('#pwfeedback').load(
|
||||
'/browse/delete.jim', {
|
||||
'dir': dir,
|
||||
'files': files
|
||||
}, function() {
|
||||
$('#pwdialogue').dialog('close');
|
||||
window.location.reload(true);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('#copy,#cut').button().disable()
|
||||
.click(function() {
|
||||
var files = new Array();
|
||||
var els = $('input.fs:checked + a').each(function() {
|
||||
files.push(decodeURIComponent($(this).attr('file')));
|
||||
});
|
||||
//console.log("%o", files);
|
||||
var action = $(this).attr('id');
|
||||
if (action == 'copy' && !confirm('Are you sure? ' +
|
||||
'Copying recordings can take a very long time!'))
|
||||
return;
|
||||
|
||||
$.post('/browse/clipboard.jim', {
|
||||
'act': 'add',
|
||||
'dir': dir,
|
||||
'mode': action,
|
||||
'path': files
|
||||
}, function() {
|
||||
reloadclipboard();
|
||||
$('input.fs:checked').attr('checked', false);
|
||||
});
|
||||
});
|
||||
|
||||
$('#newdir').button().click(function() {
|
||||
$('#newdirform').dialog({
|
||||
autoOpen: true,
|
||||
height: 'auto', width: 'auto',
|
||||
modal: true,
|
||||
buttons: {
|
||||
"Create": newdir_submit,
|
||||
"Cancel": function() {
|
||||
$(this).dialog('close');
|
||||
}
|
||||
},
|
||||
close: function() { $('#newdirname').val(''); }
|
||||
});
|
||||
});
|
||||
|
||||
$('input.fs').change(function() {
|
||||
var num = $('input.fs:checked').size();
|
||||
if (num > 0)
|
||||
$('#delete,#cut,#copy').enable();
|
||||
else
|
||||
$('#delete,#cut,#copy').disable();
|
||||
|
||||
var num = $('input.fsts:checked').size();
|
||||
if (num > 1)
|
||||
$('#join').enable();
|
||||
else
|
||||
$('#join').disable();
|
||||
|
||||
});
|
||||
|
||||
var streamsize = 0;
|
||||
|
||||
function checkstream()
|
||||
{
|
||||
$.get('/browse/streamsize.jim', function(size) {
|
||||
//console.log('Stream size: %o', size);
|
||||
var mb = size / (1024 * 1024);
|
||||
mb = mb|0;
|
||||
if (streamsize && size > streamsize)
|
||||
{
|
||||
rate = (size - streamsize) * 8.0 /
|
||||
(3 * 1048576);
|
||||
$('#streamstatus').text(mb +
|
||||
' MiB (growing @' + rate.toFixed(2) +
|
||||
' Mib/s)');
|
||||
}
|
||||
else
|
||||
$('#streamstatus').text(mb + ' MiB');
|
||||
streamsize = size;
|
||||
});
|
||||
}
|
||||
|
||||
if ($('#streamstatus').length)
|
||||
setInterval(checkstream, 3000);
|
||||
|
||||
});
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
|
||||
div.brow
|
||||
{
|
||||
float: left;
|
||||
clear: left;
|
||||
}
|
||||
|
||||
div.cliplist span
|
||||
{
|
||||
display: block;
|
||||
}
|
||||
|
||||
#clipclear
|
||||
{
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
/* This style sheet can be customised to change the look and feel of some
|
||||
* web interface elements.
|
||||
* It will not be overwritten on webif updates.
|
||||
*/
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../lib/jquery.iphone-style-checkboxes/iphone-style-checkboxes.css
|
||||
@@ -1,22 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
|
||||
httpheader
|
||||
|
||||
set logdirs {/var/log /mod/tmp /mnt/hd3}
|
||||
set logext {.log}
|
||||
|
||||
set log [cgi_get file 0]
|
||||
set unlink [cgi_get unlink 0]
|
||||
|
||||
set ldir [file dirname $log]
|
||||
if {[file dirname $log] in $logdirs && [file extension $log] in $logext} {
|
||||
file copy -force "/dev/null" $log
|
||||
if {$unlink} { file delete $log }
|
||||
puts "Cleared $log"
|
||||
exit
|
||||
}
|
||||
puts "Cannot clear $log"
|
||||
|
||||
@@ -1,191 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require pretty_size system.class pkg.class
|
||||
|
||||
jqplugin enadis
|
||||
jscss script.js style.css
|
||||
header
|
||||
|
||||
pkg loaddiagmeta
|
||||
|
||||
set smv [system modversion 1]
|
||||
|
||||
|
||||
puts {
|
||||
<fieldset class=cleft>
|
||||
<legend>Utilities</legend>
|
||||
<table>
|
||||
|
||||
<tr>
|
||||
<td>Run Diagnostic:</td>
|
||||
<td class=va><span class=cleft>
|
||||
<select name=diagsel id=diagsel class="text ui-widget-content ui-corner-all">
|
||||
<option value=0>-- Select diag or type name in box below --
|
||||
}
|
||||
|
||||
foreach diag [array names ::diagmeta] {
|
||||
puts "<option value=\"$diag\">$diag\n"
|
||||
}
|
||||
|
||||
puts {
|
||||
</select><br>
|
||||
<input name=seq id=seq autocorrect=off autocapitalize=off
|
||||
value="general" size=30 maxlength=50
|
||||
class="text ui-widget-content ui-corner-all">
|
||||
</span>
|
||||
<span class="left va">
|
||||
<button id=rundiag>Run Diagnostic</button>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Package:</td>
|
||||
<td><input name=fopkg id=fopkg autocorrect=off autocapitalize=off
|
||||
value='' size=30 maxlength=50
|
||||
class="text ui-widget-content ui-corner-all">
|
||||
<button id=runfopkg>Force re-install</button>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr><td colspan=2 style="height: 10px"></td></tr>
|
||||
|
||||
<tr>
|
||||
<td colspan=2 align=center>
|
||||
<button id=runedit class=half>File Editor</button>
|
||||
<button id=dbinfo class=half>Database Browser</button>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan=2 align=center>
|
||||
}
|
||||
if {[system model] eq "HDR"} {
|
||||
puts { <button id=diskdiag class=half>Hard Disk</button> }
|
||||
}
|
||||
puts {
|
||||
<button id=channelinfo class=half>Channel Information</button>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan=2 align=center>
|
||||
<button id=dspace class=half>Disk Space</button>
|
||||
}
|
||||
|
||||
if {[system model] eq "HDR"} {
|
||||
puts { <button id=dlna class=half>DLNA Server</button> }
|
||||
}
|
||||
|
||||
puts {
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr><td colspan=2 style="height: 10px"></td></tr>
|
||||
|
||||
<tr>
|
||||
<td colspan=2>
|
||||
<button id=reboot style="width: 100%">Reboot System</button>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan=2>
|
||||
<button id=runreset style="width: 100%"
|
||||
}
|
||||
|
||||
if {$smv < 200} {
|
||||
puts -nonewline " disabled class=ui-state-disabled"
|
||||
}
|
||||
|
||||
puts {
|
||||
>
|
||||
Remove all custom firmware packages and settings
|
||||
</button>
|
||||
}
|
||||
|
||||
if {$smv < 200} {
|
||||
puts {
|
||||
<div class=footnote style="text-align: center">
|
||||
(Install custom firmware v2.00 to enable this option)
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
puts {
|
||||
|
||||
<div id=resetdone class="hidden blood">
|
||||
Restart your Humax with the remote control.<br>
|
||||
Allow it to turn off completely before restarting.<br>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan=2>
|
||||
<button id=runrma style="width: 100%"
|
||||
}
|
||||
|
||||
if {$smv < 213} {
|
||||
puts -nonewline " disabled class=ui-state-disabled"
|
||||
}
|
||||
|
||||
puts {
|
||||
>
|
||||
Set Return-to-manufacturer (RMA) Mode
|
||||
</button>
|
||||
}
|
||||
|
||||
if {$smv < 213} {
|
||||
puts {
|
||||
<div class=footnote style="text-align: center">
|
||||
(Install custom firmware v2.13 to enable this option)
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
puts {
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<span class=also style="padding-left: 5px">
|
||||
View:
|
||||
<a href=/jim/ref.html target=_blank>Jim Reference Manual</a> |
|
||||
<a href=/jim/oo.html target=_blank>OO</a> |
|
||||
<a href=/jim/sqlite.html target=_blank>Sqlite</a>
|
||||
</span>
|
||||
</fieldset>
|
||||
|
||||
<fieldset class=left>
|
||||
<legend>View Log Files</legend>
|
||||
}
|
||||
|
||||
foreach file [lsort [concat \
|
||||
[glob -nocomplain /var/log/*.log] \
|
||||
[glob -nocomplain /mod/tmp/*.log] \
|
||||
[glob -nocomplain /mnt/hd3/*.log] \
|
||||
]] {
|
||||
puts "<a href=# class=log file=\"$file\">
|
||||
<img border=0 height=14 src=/images/421_1_00_CH_Title_2R_Arrow.png>
|
||||
[file tail $file]</a>
|
||||
(<span class=lsize>[pretty_size [file size $file]]</span>)
|
||||
<a class=\"va footnote logclear\" href=# file=\"$file\">
|
||||
<img class=va border=0 src=/img/close.png width=20>Clear</a>
|
||||
<br>"
|
||||
}
|
||||
|
||||
puts {
|
||||
</fieldset>
|
||||
|
||||
<div style="margin-top: 2em; display: none; float: left; clear: left"
|
||||
id=results></div>
|
||||
|
||||
}
|
||||
|
||||
footer
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require system.class chunked
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
set diag [cgi_get diag general]
|
||||
|
||||
start_chunked
|
||||
|
||||
if {[system modversion 1] < 113} {
|
||||
chunk ">>> Diagnostics only available with customised firmware 1.13 or above."
|
||||
end_chunked
|
||||
exit
|
||||
}
|
||||
|
||||
chunk ">>> Beginning diagnostic $diag\r\n"
|
||||
|
||||
set bcmd "|/bin/diag $diag"
|
||||
set fd [open $bcmd r]
|
||||
while {[gets $fd line] >= 0} {
|
||||
chunk "$line\r\n"
|
||||
#chunk_pad
|
||||
}
|
||||
close $fd
|
||||
chunk "\r\n"
|
||||
chunk ">>> Ending diagnostic $diag\r\n"
|
||||
|
||||
end_chunked
|
||||
|
||||
@@ -1,126 +0,0 @@
|
||||
|
||||
$(function() {
|
||||
|
||||
$('button').button();
|
||||
|
||||
$('#rundiag').click(function() {
|
||||
var val = $('#diagsel').val();
|
||||
if (val == '0')
|
||||
val = $('#seq').val();
|
||||
$('#results')
|
||||
.slideDown()
|
||||
.html('<br><br><img src=/img/loading.gif> ' +
|
||||
'Running diagnostic, please wait...')
|
||||
.load('rundiag.jim?diag=' + encodeURIComponent(val), function() {
|
||||
$('#results').wrapInner('<pre>');
|
||||
});
|
||||
});
|
||||
|
||||
$('#runfopkg').click(function() {
|
||||
$('#results')
|
||||
.slideDown()
|
||||
.text('\n\nForcibly re-installing package, please wait...\n\n')
|
||||
.load('/cgi-bin/opkg.jim?cmd=install+--force-reinstall+' +
|
||||
encodeURIComponent($('#fopkg').val()), function() {
|
||||
$('#results').wrapInner('<pre>');
|
||||
$('#fopkg').val('');
|
||||
});
|
||||
});
|
||||
|
||||
$('a.log').click(function(e) {
|
||||
e.preventDefault();
|
||||
$('#results')
|
||||
.slideDown()
|
||||
.text('\n\nLoading log, please wait...\n\n')
|
||||
.load('/cgi-bin/cat.jim?file=' +
|
||||
encodeURIComponent($(this).attr('file')), function() {
|
||||
$('#results').wrapInner('<pre>');
|
||||
});
|
||||
});
|
||||
|
||||
$('a.logclear').click(function(e) {
|
||||
var t = $(this);
|
||||
e.preventDefault();
|
||||
if (!confirm('Delete ' + $(this).attr('file') + '?'))
|
||||
return;
|
||||
$('#results')
|
||||
.slideDown()
|
||||
.text('\n\nClearing log, please wait...\n\n')
|
||||
.load('clearlog.jim?file=' +
|
||||
encodeURIComponent($(this).attr('file')), function() {
|
||||
$('#results').wrapInner('<pre>');
|
||||
$(t).prev('span.lsize').html('0 bytes');
|
||||
});
|
||||
});
|
||||
|
||||
$('#runedit').click(function(e) {
|
||||
e.preventDefault();
|
||||
window.location = '/edit/edit.jim';
|
||||
});
|
||||
|
||||
$('#dbinfo').click(function(e) {
|
||||
e.preventDefault();
|
||||
window.location = '/cgi-bin/db.jim';
|
||||
});
|
||||
|
||||
$('#channelinfo').click(function(e) {
|
||||
e.preventDefault();
|
||||
window.location = '/cgi-bin/channel.jim';
|
||||
});
|
||||
|
||||
$('#diskdiag').click(function(e) {
|
||||
e.preventDefault();
|
||||
window.location = 'disk.jim';
|
||||
});
|
||||
|
||||
$('#dlna').click(function(e) {
|
||||
e.preventDefault();
|
||||
window.location = '/dlna/dlna.jim';
|
||||
});
|
||||
|
||||
$('#dspace').click(function(e) {
|
||||
e.preventDefault();
|
||||
window.location = 'dspace/index.jim';
|
||||
});
|
||||
|
||||
$('#reboot').click(function(e) {
|
||||
e.preventDefault();
|
||||
if (confirm('Are you sure you wish to perform a reboot now?'))
|
||||
if (confirm('Really sure?\n\nThere is a small chance the ' +
|
||||
' Humax may not restart\n' +
|
||||
'without physical intervention.\n\n' +
|
||||
'i.e. pressing the standby button or using the remote control'))
|
||||
window.location = '/cgi-bin/restart.jim';
|
||||
});
|
||||
|
||||
$('#runreset').click(function(e) {
|
||||
e.preventDefault();
|
||||
if (!confirm('Are you sure? This will completely remove all packages and settings.'))
|
||||
return;
|
||||
if (!confirm('Are you really sure?'))
|
||||
return;
|
||||
if (!confirm('One last time, are you sure?'))
|
||||
return;
|
||||
$.get('/cgi-bin/cfwreset.cgi', function() {
|
||||
$('button').disable();
|
||||
$('#resetdone').slideDown();
|
||||
});
|
||||
});
|
||||
|
||||
$('#runrma').click(function(e) {
|
||||
e.preventDefault();
|
||||
if (!confirm('Are you sure? This will completely remove all packages and settings and return the unit to state where you can re-install official firmware ready to return a faulty box to Humax for repair.'))
|
||||
return;
|
||||
if (!confirm('Are you really sure?'))
|
||||
return;
|
||||
if (!confirm('One last time, are you sure?'))
|
||||
return;
|
||||
$.get('/cgi-bin/cfwreset.cgi?rma=1', function() {
|
||||
$('button').disable();
|
||||
$('#resetdone').slideDown();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
button.half { width: 48%; }
|
||||
@@ -1,4 +0,0 @@
|
||||
<!--#include virtual="/lib/header.shtml" -->
|
||||
<!--#exec cmd="/mod/webif/include/epg.jim" -->
|
||||
<!--#include virtual="/lib/footer.shtml" -->
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
img/fav/favicon.ico
|
||||
@@ -1 +0,0 @@
|
||||
context/clock.png
|
||||
@@ -1 +0,0 @@
|
||||
context/compress.png
|
||||
@@ -1 +0,0 @@
|
||||
context/compressr.png
|
||||
@@ -1 +0,0 @@
|
||||
context/decrypt.png
|
||||
@@ -1 +0,0 @@
|
||||
context/decryptr.png
|
||||
@@ -1 +0,0 @@
|
||||
context/dedup.png
|
||||
|
Before Width: | Height: | Size: 2.3 KiB |
@@ -1 +0,0 @@
|
||||
context/mp3.png
|
||||
@@ -1 +0,0 @@
|
||||
context/mpg.png
|
||||
@@ -1,372 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Jim Tcl - Object Oriented</title>
|
||||
<link rel="stylesheet" type="text/css" href="/css/style.css" media="screen">
|
||||
<link rel="stylesheet" type="text/css" href="/css/sh_style.css" media="screen">
|
||||
|
||||
<script src="/javascript/sh_main.min.js" type="text/javascript"></script>
|
||||
<script src="/javascript/sh_lang.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var _gaq = _gaq || [];
|
||||
_gaq.push(['_setAccount', 'UA-23178588-2']);
|
||||
_gaq.push(['_trackPageview']);
|
||||
|
||||
(function() {
|
||||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
||||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
||||
})();
|
||||
</script>
|
||||
|
||||
<meta name="generator" content="nanoc 3.1.6">
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<h1 id="blog-title">The Jim Interpreter</h1>
|
||||
<p id="description">A small footprint implementation of the Tcl programming language</p>
|
||||
</div>
|
||||
<div id="content">
|
||||
<div class="breadcrumbs">
|
||||
|
||||
|
||||
<a href="/">The Jim Interpreter</a>
|
||||
»
|
||||
|
||||
<a href="/documentation/">Documentation</a>
|
||||
»
|
||||
|
||||
<a href="/documentation/oo/">Object Oriented</a>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="main" id="main">
|
||||
|
||||
<h1 id="object-oriented-support-for-jim-tcl">Object Oriented Support for Jim Tcl</h1>
|
||||
|
||||
<h2 id="overview">OVERVIEW</h2>
|
||||
|
||||
<p>The pure-Tcl oo package leverages Jim’s unique strengths
|
||||
to provide support for Object Oriented programming. </p>
|
||||
|
||||
<p>The oo package can be statically linked with Jim or installed
|
||||
as a separate Tcl package and loaded with:</p>
|
||||
|
||||
<pre class="sh_tcl">
|
||||
package require oo
|
||||
</pre>
|
||||
|
||||
<h2 id="declaring-classes">DECLARING CLASSES</h2>
|
||||
|
||||
<p>A class is declared with the <code>class</code> proc as follows.</p>
|
||||
|
||||
<pre class="sh_tcl">
|
||||
class myclass ?baseclasses? classvars
|
||||
</pre>
|
||||
|
||||
<p>This declares a class named <code>myclass</code> with the given dictionary,
|
||||
<code>classvars</code>, providing the initial state of all new objects.
|
||||
It is important to list all class variables in <code>classvars</code>, even
|
||||
if initialised only to the empty string, since the class makes
|
||||
these variables available in methods and via <code>[myclass vars]</code>.</p>
|
||||
|
||||
<p>A list of zero or more base classes may also be specified from
|
||||
which methods and class variables are imported. See INHERITANCE
|
||||
below for more details.</p>
|
||||
|
||||
<p>Declaring a class creates a procedure with the class name along
|
||||
with some related procedures. For example:</p>
|
||||
|
||||
<pre class="sh_tcl">
|
||||
. class Account {balance 0}
|
||||
Account
|
||||
. info procs Account*
|
||||
{Account get} {Account methods} {Account eval} Account {Account new} {Account destroy}
|
||||
{Account vars} {Account classname} {Account classvars} {Account method}
|
||||
</pre>
|
||||
|
||||
<p>Notice that apart from the main <code>Account</code> procedure, all the remaining procedures (methods)
|
||||
are prefixed with <code>Account</code> and a space.</p>
|
||||
|
||||
<h2 id="predefined-class-methods">PREDEFINED CLASS METHODS</h2>
|
||||
|
||||
<p>Decaring a class pre-defines a number of “class” methods. i.e. those which don’t
|
||||
require an object and simply return or manipulate properties of the class. These are:</p>
|
||||
|
||||
<dl>
|
||||
<dt><strong>new</strong> ?instancevars?</dt>
|
||||
<dd>Creates and returns new object, optionally overriding the default class variable values.
|
||||
Note that the class name is an alias for <code>classname new {}</code> and can be used as a shorthand
|
||||
for creating new objects with default values.</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><strong>method</strong> name arglist body</dt>
|
||||
<dd>Creates or redefines a method for the class with the given name, argument list and body.</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><strong>methods</strong></dt>
|
||||
<dd>Returns a list of the methods supported by this class, including both class methods
|
||||
and instance methods. Also includes base class methods.</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><strong>vars</strong></dt>
|
||||
<dd>Returns a list of the class variables for this class (names
|
||||
only). Also includes base class variables.</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><strong>classvars</strong></dt>
|
||||
<dd>Returns a dictionary the class variables, including initial values, for this class.
|
||||
Also includes base class variables.</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><strong>classname</strong></dt>
|
||||
<dd>Returns the classname. This can be useful as [$self classname].</dd>
|
||||
</dl>
|
||||
|
||||
<p>Class methods may be invoked either via the class name or via an object of the class.
|
||||
For example:</p>
|
||||
|
||||
<pre class="sh_tcl">
|
||||
. class Account {balance 0}
|
||||
Account
|
||||
. Account methods
|
||||
classname classvars destroy eval get method methods new vars
|
||||
. set a [Account]
|
||||
<reference.<Account>.00000000000000000001>
|
||||
. $a methods
|
||||
classname classvars destroy eval get method methods new vars
|
||||
</pre>
|
||||
|
||||
<h2 id="predefined-object-methods">PREDEFINED OBJECT METHODS</h2>
|
||||
|
||||
<p>Decaring a class pre-defines a number of “object” methods. i.e. those which operate
|
||||
on a specific object.</p>
|
||||
|
||||
<dl>
|
||||
<dt><strong>destroy</strong></dt>
|
||||
<dd>Destroys the object. This method may be overridden, but note that it should
|
||||
delete the object with {rename $self “”}. This method will also be called
|
||||
if the object is reaped during garbage collection.</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><strong>get</strong> varname</dt>
|
||||
<dd>Returns the value of the given instance variable.</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><strong>eval</strong> ?locals? body</dt>
|
||||
<dd>Makes any given local variables available to the body, along with
|
||||
the instance variables, and evaluate the body in that context.
|
||||
This can be used for one-off evaluation to avoid declaring a method.</dd>
|
||||
</dl>
|
||||
|
||||
<h2 id="creating-objects">CREATING OBJECTS</h2>
|
||||
|
||||
<p>An object is created with the <code>new</code> method, or simply by using the classname shortcut.
|
||||
If the <code>new</code> method is used, the variables for the newly created object (instance variables)
|
||||
may be initialised. Otherwise they are set to the default values specified when the
|
||||
class was declared.</p>
|
||||
|
||||
<p>For example:</p>
|
||||
|
||||
<pre class="sh_tcl">
|
||||
. class Account {balance 0}
|
||||
Account
|
||||
. set a [Account]
|
||||
<reference.<Account>.00000000000000000001>
|
||||
. set b [Account new {balance 1000}]
|
||||
<reference.<Account>.00000000000000000002>
|
||||
. $a get balance
|
||||
0
|
||||
. $b get balance
|
||||
1000
|
||||
</pre>
|
||||
|
||||
<h2 id="declaring-methods">DECLARING METHODS</h2>
|
||||
|
||||
<p>In addition to the predefined methods, new methods may be decared, or existing
|
||||
methods redefined with the class method, method.</p>
|
||||
|
||||
<p>Declaring a method is very similar to defining a proc, and the arglist
|
||||
has identical syntax. For example:</p>
|
||||
|
||||
<pre class="sh_tcl">
|
||||
. Account method show {{chan stdout}} { $chan puts "Balance of account is $balance" }
|
||||
. $b show
|
||||
Balance of account is 1000
|
||||
</pre>
|
||||
|
||||
<p>All instance variables are available within the method and any
|
||||
changes to these variables are maintained by the object.</p>
|
||||
|
||||
<p>In addition, the $self variables is defined and refers to the current object.
|
||||
This may be used to invoke further methods on the object. For example:</p>
|
||||
|
||||
<pre class="sh_tcl">
|
||||
. Account method show {} { puts "Balance of account is [$self get balance]" }
|
||||
. $b show
|
||||
Balance of account is 1000
|
||||
</pre>
|
||||
|
||||
<p>Notes:</p>
|
||||
|
||||
<ul>
|
||||
<li>It is a bad idea to unset an instance variable.</li>
|
||||
<li>In general, you should avoid redefining any of the pre-defined methods, except for <code>destroy</code>.</li>
|
||||
<li>When accessing the caller’s scope with upvar or uplevel, note that there
|
||||
are two frame levels between the caller and the method. Thus it is necessary
|
||||
to use <code>upvar 2</code> or <code>uplevel 2</code></li>
|
||||
</ul>
|
||||
|
||||
<h2 id="inheritance">INHERITANCE</h2>
|
||||
|
||||
<p>For each base class given in a new class declaration, the methods
|
||||
and variables of those classes are imported into the new class being
|
||||
defined. Base classes are imported in left to right order, so that if a
|
||||
method is defined in more than one base class, the later definition
|
||||
is selected. This applies similarly to class variables.</p>
|
||||
|
||||
<p>Within a method, <code>super</code> may be used to explicitly invoke a
|
||||
base class method on the object. This applies only to the <em>last</em>
|
||||
base class given. For example:</p>
|
||||
|
||||
<pre class="sh_tcl">
|
||||
# Assumes the existence of classes Account and Client
|
||||
. Account method debit {amount} { incr balance -$amount }
|
||||
. class CreditAccount {Client Account} {type visa}
|
||||
CreditAccount
|
||||
. CreditAccount method debit {amount} {
|
||||
puts "Debit $type card"
|
||||
super debit $amount
|
||||
}
|
||||
. set a [CreditAccount]
|
||||
<reference.<Account>.00000000000000000001>
|
||||
. $a debit 20
|
||||
Debit visa card
|
||||
. $a balance
|
||||
-20
|
||||
</pre>
|
||||
|
||||
<p>In the CreditAccount debit method, the call to <code>super debit</code> invokes
|
||||
the method <code>Account debit</code> since Account is the last base class listed.</p>
|
||||
|
||||
<h2 id="object-lifetimegarbage-collection">OBJECT LIFETIME/GARBAGE COLLECTION</h2>
|
||||
|
||||
<p>Objects are implemented as lambdas. That is, they are procedures with state
|
||||
and are named as references. This means that when an object is no longer
|
||||
reachable by any name and garbage collection runs, the object will be
|
||||
discarded and the destructor will be invoked. Note that the garbage collector
|
||||
can be invoked manually with <code>collect</code> if required.</p>
|
||||
|
||||
<pre class="sh_tcl">
|
||||
. class Account {}
|
||||
Account
|
||||
. Account method destroy {} { puts dying...; rename $self "" }
|
||||
Account destroy
|
||||
. proc a {} { set b [Account]; return "" }
|
||||
a
|
||||
. a
|
||||
. collect
|
||||
dying...
|
||||
1
|
||||
</pre>
|
||||
|
||||
<h2 id="class-methodsclass-static-variables">CLASS METHODS/CLASS STATIC VARIABLES</h2>
|
||||
|
||||
<p>All methods defined with <code>method</code> operate on objects (instances).
|
||||
If a class method is required, it is possible to simply declare one with <code>proc</code>.
|
||||
The method dispatcher will automatically be able to dispatch to this method.
|
||||
Using this approach, it is also possible to add class static variables by
|
||||
defining static variables to the proc. Although strictly these variables
|
||||
are accessible only to that proc, not the class as a whole.</p>
|
||||
|
||||
<p>For example:</p>
|
||||
|
||||
<pre class="sh_tcl">
|
||||
. class Account {}
|
||||
Account
|
||||
. proc {Account nextid} {} {{id 0}} { incr id }
|
||||
Account nextid
|
||||
. Account nextid
|
||||
1
|
||||
. Account nextid
|
||||
2
|
||||
. set a [Account]
|
||||
<reference.<Account>.00000000000000000001>
|
||||
. $a nextid
|
||||
3
|
||||
. $a eval { $self nextid }
|
||||
4
|
||||
</pre>
|
||||
|
||||
<h2 id="how-method-dispatch-works">HOW METHOD DISPATCH WORKS</h2>
|
||||
|
||||
<p>All class and object methods are name “classname methodname”.</p>
|
||||
|
||||
<p>The class method dispatcher is named “classname”. When invoked with a methodname,
|
||||
it simply invokes the method “classname methodname”.</p>
|
||||
|
||||
<p>The method dispatch is via a two step process. Firstly the object procedure is invoked
|
||||
with the method name. This procedure then invokes “classname method” which sets up
|
||||
the appropriate access to the object variables, and then invokes the method body.</p>
|
||||
|
||||
<h2 id="examples">EXAMPLES</h2>
|
||||
|
||||
<h3 id="treetclhttprepoorczwjimtclgitblobheadtreetcl"><a href="http://repo.or.cz/w/jimtcl.git/blob/HEAD:/tree.tcl">tree.tcl</a></h3>
|
||||
|
||||
<p>The <code>tree</code> package is implemented using the <code>oo</code> package.
|
||||
See the source code in tree.tcl and a usage example in tests/tree.test</p>
|
||||
|
||||
<p>Of particular note is how callbacks and recursive invocation is used in the <code>walk</code> method.</p>
|
||||
|
||||
<h3 id="examplesootesttclhttprepoorczwjimtclgitblobheadexamplesootesttcl"><a href="http://repo.or.cz/w/jimtcl.git/blob/HEAD:/examples/ootest.tcl">examples/ootest.tcl</a></h3>
|
||||
|
||||
<p>A comprehensive OO example is provided in examples/ootest.tcl.</p>
|
||||
|
||||
<p>It can be run simply as:</p>
|
||||
|
||||
<pre class="sh_unix">
|
||||
$ ./jimsh examples/ootest.tcl
|
||||
</pre>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div id="sidebar">
|
||||
<h2>About Jim Tcl</h2>
|
||||
<ul>
|
||||
|
||||
|
||||
<li class="stdlink"><a href="/">Introduction</a></li>
|
||||
|
||||
|
||||
<li class="newlink"><a href="/news/">News</a></li>
|
||||
|
||||
|
||||
<li class="stdlink"><a href="/download/">Download</a></li>
|
||||
|
||||
|
||||
<li class="stdlink"><a href="/documentation/">Documentation</a></li>
|
||||
|
||||
|
||||
<li class="stdlink"><a href="/extensions/">Extensions</a></li>
|
||||
|
||||
|
||||
<li class="stdlink"><a href="/license/">License</a></li>
|
||||
|
||||
|
||||
<li class="stdlink"><a href="/about/">About</a></li>
|
||||
|
||||
</ul>
|
||||
<h2>Community</h2>
|
||||
<ul>
|
||||
<li><a href="https://lists.berlios.de/mailman/listinfo/jim-devel">Mailing List</a></li>
|
||||
<li><a href="https://github.com/msteveb/jimtcl">Jim on github</a></li>
|
||||
<li><a href="http://wiki.tcl.tk/jim">Jim @ the Tcler's Wiki</a></li>
|
||||
<li><a href="http://developer.berlios.de/projects/jim">Berlios Project Page</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<script language="javascript">sh_highlightDocument();</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,285 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Jim Tcl - Sqlite Extension</title>
|
||||
<link rel="stylesheet" type="text/css" href="/css/style.css" media="screen">
|
||||
<link rel="stylesheet" type="text/css" href="/css/sh_style.css" media="screen">
|
||||
|
||||
<script src="/javascript/sh_main.min.js" type="text/javascript"></script>
|
||||
<script src="/javascript/sh_lang.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var _gaq = _gaq || [];
|
||||
_gaq.push(['_setAccount', 'UA-23178588-2']);
|
||||
_gaq.push(['_trackPageview']);
|
||||
|
||||
(function() {
|
||||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
||||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
||||
})();
|
||||
</script>
|
||||
|
||||
<meta name="generator" content="nanoc 3.1.6">
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<h1 id="blog-title">The Jim Interpreter</h1>
|
||||
<p id="description">A small footprint implementation of the Tcl programming language</p>
|
||||
</div>
|
||||
<div id="content">
|
||||
<div class="breadcrumbs">
|
||||
|
||||
|
||||
<a href="/">The Jim Interpreter</a>
|
||||
»
|
||||
|
||||
<a href="/documentation/">Documentation</a>
|
||||
»
|
||||
|
||||
<a href="/documentation/sqlite/">Sqlite Extension</a>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="main" id="main">
|
||||
|
||||
<h1 id="sqlite-support-for-jim-tcl">Sqlite Support for Jim Tcl</h1>
|
||||
|
||||
<h2 id="overview">OVERVIEW</h2>
|
||||
|
||||
<p>The sqlite and sqlite3 extensions makes possible to work with
|
||||
<a href="http://www.sqlite.org">sqlite</a> databases from Jim. SQLite is a
|
||||
small C library that implements a self-contained, embeddable,
|
||||
zero-configuration SQL database engine. This means it is perfect
|
||||
for embedded systems, and for stand-alone applications that need
|
||||
the power of SQL without to use an external server like Mysql.</p>
|
||||
|
||||
<p><strong>Note:</strong> The same interface is exported for both the <strong>sqlite</strong> and <strong>sqlite3</strong>
|
||||
extensions. The only difference being the open call, <strong>sqlite.open</strong> vs. <strong>sqlite3.open</strong></p>
|
||||
|
||||
<h2 id="basic-usage">Basic usage</h2>
|
||||
|
||||
<p>The Sqlite extension exports an Object Based interface for databases. In order
|
||||
to open a database use:</p>
|
||||
|
||||
<pre class="sh_tcl">
|
||||
set f [sqlite3.open dbname]
|
||||
</pre>
|
||||
|
||||
<p>The <code>sqlite3.open</code> command returns a db handle, that is a command name that
|
||||
can be used to perform operations on the database. A real example:</p>
|
||||
|
||||
<pre class="sh_tcl">
|
||||
. set db [sqlite3.open test.db]
|
||||
sqlite.handle0
|
||||
. $db query "SELECT * from tbl1"
|
||||
{one hello! two 10} {one goodbye two 20}
|
||||
</pre>
|
||||
|
||||
<p>In the second line the handle is used as a command name, followed
|
||||
by the ‘method’ or ‘subcommand’ (“query” in the example), and the arguments.</p>
|
||||
|
||||
<h2 id="the-query-method">The query method</h2>
|
||||
|
||||
<p>The query method has the following signature:</p>
|
||||
|
||||
<pre class="sh_tcl">
|
||||
$db query SqlQuery ?args?
|
||||
</pre>
|
||||
|
||||
<p>The sql query may contain occurrences of “%s” that are substituted
|
||||
in the actual query with the following arguments, quoted in order
|
||||
to make sure that the query is correct even if this arguments contain
|
||||
“’” characters. So for example it is possible to write:</p>
|
||||
|
||||
<pre class="sh_tcl">
|
||||
. $db query "SELECT * from tbl1 WHERE one='%s'" hello!
|
||||
{one hello! two 10}
|
||||
</pre>
|
||||
|
||||
<p>Instead of hello! it is possible to use a string with embedded “’”:</p>
|
||||
|
||||
<pre class="sh_tcl">
|
||||
. $db query "SELECT * from tbl1 WHERE one='%s'" a'b
|
||||
(no matches - the empty list is returned)
|
||||
</pre>
|
||||
|
||||
<p>This does not work instead using the Tcl variable expansion in the string:</p>
|
||||
|
||||
<pre class="sh_tcl">
|
||||
. $db query "SELECT * from tbl1 WHERE one='$foo'"
|
||||
near "b": syntax error
|
||||
</pre>
|
||||
|
||||
<p>In order to obtain an actual ‘%’ character in the query, there is just
|
||||
to use two, like in “foo %% bar”. This is the same as the [format] argument.</p>
|
||||
|
||||
<h2 id="specification-of-query-results">Specification of query results</h2>
|
||||
|
||||
<p>In one of the above examples, the following query was used:</p>
|
||||
|
||||
<pre class="sh_tcl">
|
||||
. $db query "SELECT * from tbl1"
|
||||
{one hello! two 10} {one goodbye two 20}
|
||||
</pre>
|
||||
|
||||
<p>As you can see the result of a query is a list of lists. Every
|
||||
element of the list represents a row, as a list of key/value pairs,
|
||||
so actually every row is a Jim dictionary.</p>
|
||||
|
||||
<p>The following example and generated output show how to take advantage
|
||||
of this representation:</p>
|
||||
|
||||
<pre class="sh_tcl">
|
||||
. set res [$db query "SELECT * from tbl1"]
|
||||
{one hello! two 10} {one goodbye two 20}
|
||||
. foreach row $res {puts "One: $row(one), Two: $row(two)"}
|
||||
One: hello!, Two: 10
|
||||
One: goodbye, Two: 20
|
||||
</pre>
|
||||
|
||||
<p>To access every row sequentially is very simple, and field of a row
|
||||
can be accessed using the $row(field) syntax.</p>
|
||||
|
||||
<h2 id="the-close-method">The close method</h2>
|
||||
|
||||
<p>In order to close the db, use the ‘close’ method that will have as side effect
|
||||
to close the db and to remove the command associated with the db.
|
||||
Just use:</p>
|
||||
|
||||
<pre class="sh_tcl">
|
||||
$db close
|
||||
</pre>
|
||||
|
||||
<h2 id="handling-null-values">Handling NULL values</h2>
|
||||
|
||||
<p>In the SQL language there is a special value NULL that is not the empty
|
||||
string, so how to represent it in a typeless language like Tcl?
|
||||
For default this extension will use the empty string, but it is possible
|
||||
to specify a different string for the NULL value.</p>
|
||||
|
||||
<p>In the above example there were two rows in the ‘tbl1’ table. Now
|
||||
we can add usign the “sqlite” command line client another one with
|
||||
a NULL value:</p>
|
||||
|
||||
<pre><code>sqlite> INSERT INTO tbl1 VALUES(NULL,30);
|
||||
sqlite> .exit
|
||||
</code></pre>
|
||||
|
||||
<p>That’s what the sqlite extension will return for default:</p>
|
||||
|
||||
<pre class="sh_tcl">
|
||||
. $db query "SELECT * from tbl1"
|
||||
{one hello! two 10} {one goodbye two 20} {one {} two 30}
|
||||
</pre>
|
||||
|
||||
<p>As you can see in the last row, the NULL is represented as {}, that’s
|
||||
the empty string. Using the -null option of the ‘query’ command we
|
||||
can change this default, and tell the sqlite extension to represent
|
||||
the NULL value as a different string:</p>
|
||||
|
||||
<pre class="sh_tcl">
|
||||
. $db query -null <<NULL>> "SELECT * from tbl1"
|
||||
{one hello! two 10} {one goodbye two 20} {one <<NULL>> two 30}
|
||||
</pre>
|
||||
|
||||
<p>This way if the emtpy string has some semantical value for your
|
||||
dataset you can change it.</p>
|
||||
|
||||
<h2 id="finding-the-id-of-the-last-inserted-row">Finding the ID of the last inserted row</h2>
|
||||
|
||||
<p>This is as simple as:</p>
|
||||
|
||||
<pre class="sh_tcl">
|
||||
. $db lastid
|
||||
10
|
||||
</pre>
|
||||
|
||||
<h2 id="number-of-rows-changed-by-the-most-recent-query">Number of rows changed by the most recent query</h2>
|
||||
|
||||
<p>This is also very simple, there is just to use the ‘changes’ method
|
||||
without arugments.</p>
|
||||
|
||||
<pre class="sh_tcl">
|
||||
. $db changes
|
||||
5
|
||||
</pre>
|
||||
|
||||
<p>Note that if you drop an entire table the number of changes will
|
||||
be reported as zero, because of details of the sqlite implementation.</p>
|
||||
|
||||
<p>That’s all,
|
||||
Enjoy!
|
||||
Salvatore Sanfilippo</p>
|
||||
|
||||
<p>p.s. this extension is just the work of some hour thanks to the cool
|
||||
clean C API that sqlite exports. Thanks to the author of sqlite for this
|
||||
great work.</p>
|
||||
|
||||
<h2 id="in-memory-databases">In memory databases</h2>
|
||||
|
||||
<p>SQLite is able to create in-memory databases instead to use files.
|
||||
This is of course faster and does not need the ability to write
|
||||
to the filesystem. Of course this databases are only useful for
|
||||
temp data.</p>
|
||||
|
||||
<p>In-memory DBs are used just like regular databases, just the name used to
|
||||
open the database is :memory:. That’s an example that does not use the
|
||||
filesystem at all to create and work with the db.</p>
|
||||
|
||||
<pre class="sh_tcl">
|
||||
package require sqlite3
|
||||
set db [sqlite3.open :memory:]
|
||||
$db query {CREATE TABLE plays (id, author, title)}
|
||||
$db query {INSERT INTO plays (id, author, title) VALUES (1, 'Goethe', 'Faust');}
|
||||
$db query {INSERT INTO plays (id, author, title) VALUES (2, 'Shakespeare', 'Hamlet');}
|
||||
$db query {INSERT INTO plays (id, author, title) VALUES (3, 'Sophocles', 'Oedipus Rex');}
|
||||
set res [$db query "SELECT * FROM plays"]
|
||||
$db close
|
||||
foreach r $res {puts $r(author)}
|
||||
</pre>
|
||||
|
||||
<p>Of course once the Jim process is destroyed the database will no longer
|
||||
exists.</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div id="sidebar">
|
||||
<h2>About Jim Tcl</h2>
|
||||
<ul>
|
||||
|
||||
|
||||
<li class="stdlink"><a href="/">Introduction</a></li>
|
||||
|
||||
|
||||
<li class="newlink"><a href="/news/">News</a></li>
|
||||
|
||||
|
||||
<li class="stdlink"><a href="/download/">Download</a></li>
|
||||
|
||||
|
||||
<li class="stdlink"><a href="/documentation/">Documentation</a></li>
|
||||
|
||||
|
||||
<li class="stdlink"><a href="/extensions/">Extensions</a></li>
|
||||
|
||||
|
||||
<li class="stdlink"><a href="/license/">License</a></li>
|
||||
|
||||
|
||||
<li class="stdlink"><a href="/about/">About</a></li>
|
||||
|
||||
</ul>
|
||||
<h2>Community</h2>
|
||||
<ul>
|
||||
<li><a href="https://lists.berlios.de/mailman/listinfo/jim-devel">Mailing List</a></li>
|
||||
<li><a href="https://github.com/msteveb/jimtcl">Jim on github</a></li>
|
||||
<li><a href="http://wiki.tcl.tk/jim">Jim @ the Tcler's Wiki</a></li>
|
||||
<li><a href="http://developer.berlios.de/projects/jim">Berlios Project Page</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<script language="javascript">sh_highlightDocument();</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1 +0,0 @@
|
||||
../lib/jquery.plugin/easing/easing.js
|
||||
@@ -1,72 +0,0 @@
|
||||
$(function() {
|
||||
function doschedule(type)
|
||||
{
|
||||
$('#epginfo_extra').load('/cgi-bin/epg/schedule.jim?' +
|
||||
'service=' +
|
||||
encodeURIComponent($('#dialogue').attr('xs')) +
|
||||
'&event=' +
|
||||
encodeURIComponent($('#dialogue').attr('xe')) +
|
||||
'&type=' + type, function() {
|
||||
$('#restart_block')
|
||||
.load('/cgi-bin/restartblock.jim');
|
||||
});
|
||||
$(":button:contains('Record')").fadeOut('slow');
|
||||
$(":button:contains('Reminder')").fadeOut('slow');
|
||||
}
|
||||
|
||||
var $buttons1 = {
|
||||
"Close" : function() {$(this).dialog('close');}
|
||||
};
|
||||
var $buttons2 = $.extend(
|
||||
{"Record Programme": function() { doschedule(1) }},
|
||||
{"Set Reminder": function() { doschedule(3) }},
|
||||
$buttons1);
|
||||
var $buttons3 = $.extend(
|
||||
{"Record Series": function() { doschedule(2) }},
|
||||
$buttons2);
|
||||
|
||||
var $dialog = $('#dialogue').dialog({
|
||||
title: "Programme Details",
|
||||
modal: false, autoOpen: false,
|
||||
height: 500, width: 700,
|
||||
show: 'scale', hide: 'fade',
|
||||
draggable: true, resizable: true,
|
||||
buttons: $buttons1,
|
||||
close: function(e,u) { $('#dialogue').empty().html(
|
||||
'<img src="/img/loading.gif" alt="loading">'); }
|
||||
});
|
||||
|
||||
function epgpopup(e, o)
|
||||
{
|
||||
e.preventDefault();
|
||||
var sch = o.attr('sch');
|
||||
var rec = o.attr('rec');
|
||||
if (sch != 0)
|
||||
$dialog.dialog("option", "buttons", $buttons1);
|
||||
else if (rec == 2)
|
||||
$dialog.dialog("option", "buttons", $buttons3);
|
||||
else if (rec == 1)
|
||||
$dialog.dialog("option", "buttons", $buttons2);
|
||||
else
|
||||
$dialog.dialog("option", "buttons", $buttons1);
|
||||
var url = '/cgi-bin/epg/info.jim?service=' +
|
||||
o.attr('xs') + '&event=' +
|
||||
o.attr('xe') + '&bare=1';
|
||||
$('#dialogue')
|
||||
.html('<img src=/img/loading.gif> Loading details...' +
|
||||
' Please wait...')
|
||||
.load(url, function() {
|
||||
$('#dialogue a.event').click(function(e) {
|
||||
epgpopup(e, $(this));
|
||||
});
|
||||
});
|
||||
$('#dialogue')
|
||||
.attr('xs', o.attr('xs'))
|
||||
.attr('xe', o.attr('xe'));
|
||||
$dialog.dialog('open');
|
||||
}
|
||||
$('a.event').click(function(e) {
|
||||
e.preventDefault();
|
||||
epgpopup(e, $(this))
|
||||
});
|
||||
});
|
||||
@@ -1 +0,0 @@
|
||||
../lib/jquery.plugin/iajax/iajax.js
|
||||
@@ -1 +0,0 @@
|
||||
../lib/jquery.iphone-style-checkboxes/iphone-style-checkboxes.js
|
||||
6
var/mongoose/html/js/jquery-1.10.2.min.js
vendored
1
var/mongoose/html/js/jquery.js
vendored
@@ -1 +0,0 @@
|
||||
jquery-1.10.2.min.js
|
||||
1
var/mongoose/html/js/jquery.ui.totop.js
vendored
@@ -1 +0,0 @@
|
||||
../lib/jquery.plugin/ui.totop/jquery.ui.totop.js
|
||||
@@ -1,20 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
puts {
|
||||
<!-- Start of footer -->
|
||||
<div class=footer>
|
||||
}
|
||||
|
||||
if {![catch {
|
||||
set rendertime [expr [expr [clock milliseconds] - $renderstart] / 1000.0]
|
||||
}]} {
|
||||
puts "<font class=footnote>Rendered in: $rendertime seconds</font>"
|
||||
}
|
||||
|
||||
puts {
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<!--#exec cmd="/mod/webif/html/lib/footer.jim" -->
|
||||
@@ -1,55 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
puts {
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<title>
|
||||
}
|
||||
source /mod/webif/include/model.jim
|
||||
puts {
|
||||
</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<link rel="icon" href="/favicon.ico" sizes="16x16 32x32 64x64"
|
||||
type="image/vnd.microsoft.icon" />
|
||||
<link rel="apple-touch-icon" href="/img/fav/57.png" />
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="/img/fav/57.png" />
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="/img/fav/72.png" />
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="/img/fav/114.png" />
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="/img/fav/144.png" />
|
||||
<link type="text/css" href="/lib/jquery.ui/css/humax/jquery-ui.css"
|
||||
rel="Stylesheet" />
|
||||
<link href="/css/style.css" rel="Stylesheet" type="text/css" />
|
||||
<link href="/css/EXTRA.css" rel="Stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="/js/jquery.js"></script>
|
||||
<script type="text/javascript" src="/lib/jquery.ui/js/jquery-ui.js"></script>
|
||||
}
|
||||
if {[info exists _mws_js]} {
|
||||
foreach js $::_mws_js {
|
||||
puts "<script type=text/javascript src=\"$js\"></script>"
|
||||
}
|
||||
foreach css $::_mws_css {
|
||||
puts "<link href=\"$css\" rel=stylesheet type=text/css />"
|
||||
}
|
||||
}
|
||||
puts {
|
||||
</head>
|
||||
<body>
|
||||
}
|
||||
|
||||
source /mod/webif/html/lib/topbar.jim
|
||||
puts "<center><div id=restart_block>"
|
||||
source /mod/webif/include/restart.jim
|
||||
puts "</div></center>"
|
||||
source /mod/webif/include/diskcheck.jim
|
||||
source /mod/webif/include/notify.jim
|
||||
|
||||
puts {
|
||||
<div style="clear: both">
|
||||
|
||||
<!-- end of header -->
|
||||
}
|
||||
|
||||
set renderstart [clock milliseconds]
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<!--#exec cmd="/mod/webif/html/lib/header.jim" -->
|
||||
|
Before Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
@@ -1,36 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<!-- Need to get a proper redirect hooked up. Blech. -->
|
||||
<meta http-equiv="refresh" content="0;url=demos/">
|
||||
<meta name="robots" content="noindex, follow">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>jQuery Mobile</title>
|
||||
<link rel="stylesheet" href="css/themes/default/jquery.mobile-1.3.2.min.css">
|
||||
<link rel="stylesheet" href="demos/_assets/css/jqm-demos.css">
|
||||
<link rel="shortcut icon" href="demos/_assets/favicon.ico">
|
||||
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,700">
|
||||
<script src="js/jquery.js"></script>
|
||||
<script src="demos/_assets/js/index.js"></script>
|
||||
<script src="js/jquery.mobile-1.3.2.min.js"></script>
|
||||
<script>
|
||||
$( document ).on( "pageshow", function(){
|
||||
$( "p.message" ).hide().delay( 1500 ).show( "fast" );
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div data-role="page" class="jqm-demos">
|
||||
|
||||
<div data-role="content" class="jqm-content">
|
||||
|
||||
<p class="message">Nothing to see here folks. <a href="demos/">View the demo center home page →</a></p>
|
||||
|
||||
</div><!-- /content -->
|
||||
|
||||
</div><!-- /page -->
|
||||
</body>
|
||||
</html>
|
||||
@@ -1 +0,0 @@
|
||||
jquery.mobile-1.3.2.min.css
|
||||
@@ -1 +0,0 @@
|
||||
jquery.mobile-1.3.2.min.js
|
||||
@@ -1,50 +0,0 @@
|
||||
/*
|
||||
* jQuery Plugin : jConfirmAction
|
||||
*
|
||||
* by Hidayat Sagita
|
||||
* http://www.webstuffshare.com
|
||||
* Licensed Under GPL version 2 license.
|
||||
*
|
||||
*/
|
||||
(function($){
|
||||
|
||||
jQuery.fn.jConfirmAction = function (options, callback) {
|
||||
|
||||
// Some jConfirmAction options (limited to customize language) :
|
||||
// question : a text for your question.
|
||||
// yesAnswer : a text for Yes answer.
|
||||
// cancelAnswer : a text for Cancel/No answer.
|
||||
var theOptions = jQuery.extend ({
|
||||
question: "Are You Sure?",
|
||||
yesAnswer: "Yes",
|
||||
cancelAnswer: "Cancel"
|
||||
}, options);
|
||||
|
||||
return this.each (function () {
|
||||
$(this).click(function(e) {
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
var p = $(this);
|
||||
|
||||
if($(this).next('.question').length <= 0)
|
||||
$(this).after('<div class="jcaquestion">'+theOptions.question+'<br/> <span class="jcayes">'+theOptions.yesAnswer+'</span><span class="jcacancel">'+theOptions.cancelAnswer+'</span></div>');
|
||||
|
||||
$(this).next('.jcaquestion').animate({opacity: 1}, 300);
|
||||
|
||||
$('.jcayes').bind('click', function() {
|
||||
callback(p);
|
||||
});
|
||||
|
||||
$('.jcacancel').bind('click', function(){
|
||||
$(this).parents('.jcaquestion').fadeOut(300, function() {
|
||||
$(this).remove();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
})(jQuery);
|
||||
@@ -1,21 +0,0 @@
|
||||
|
||||
.context-menu-item.icon-pwedit { background-image: url(/img/context/page_white_edit.png); }
|
||||
.context-menu-item.icon-pwcopy { background-image: url(/img/context/page_white_copy.png); }
|
||||
.context-menu-item.icon-pwpaste { background-image: url(/img/context/page_white_paste.png); }
|
||||
.context-menu-item.icon-pwdelete { background-image: url(/img/context/page_white_delete.png); }
|
||||
.context-menu-item.icon-edit { background-image: url(/img/context/edit.png); }
|
||||
.context-menu-item.icon-copy { background-image: url(/img/context/copy.png); }
|
||||
.context-menu-item.icon-paste { background-image: url(/img/context/paste.png); }
|
||||
.context-menu-item.icon-delete { background-image: url(/img/context/delete.png); }
|
||||
.context-menu-item.icon-cut { background-image: url(/img/context/cut.png); }
|
||||
.context-menu-item.icon-quit { background-image: url(/img/context/door.png); }
|
||||
.context-menu-item.icon-compress { background-image: url(/img/context/compress.png); }
|
||||
.context-menu-item.icon-compressr { background-image: url(/img/context/compressr.png); }
|
||||
.context-menu-item.icon-dedup { background-image: url(/img/context/dedup.png); }
|
||||
.context-menu-item.icon-decrypt { background-image: url(/img/context/decrypt.png); }
|
||||
.context-menu-item.icon-decryptr { background-image: url(/img/context/decryptr.png); }
|
||||
.context-menu-item.icon-mpg { background-image: url(/img/context/mpg.png); }
|
||||
.context-menu-item.icon-mp3 { background-image: url(/img/context/mp3.png); }
|
||||
.context-menu-item.icon-clock { background-image: url(/img/context/clock.png); }
|
||||
.context-menu-item.icon-thm { background-image: url(/img/context/thumb.png); }
|
||||
|
||||
|
Before Width: | Height: | Size: 412 B |
|
Before Width: | Height: | Size: 309 B |
|
Before Width: | Height: | Size: 536 B |
|
Before Width: | Height: | Size: 618 B |
|
Before Width: | Height: | Size: 620 B |
@@ -1,77 +0,0 @@
|
||||
/* Generic context menu styles */
|
||||
.contextMenu {
|
||||
position: absolute;
|
||||
width: 150px;
|
||||
z-index: 99999;
|
||||
border: solid 1px #CCC;
|
||||
background: #EEE;
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.contextMenu LI {
|
||||
list-style: none;
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.contextMenu A {
|
||||
color: #333;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
line-height: 20px;
|
||||
height: 20px;
|
||||
background-position: 6px center;
|
||||
background-repeat: no-repeat;
|
||||
outline: none;
|
||||
padding: 1px 5px;
|
||||
padding-left: 28px;
|
||||
}
|
||||
|
||||
.contextMenu LI.hover A {
|
||||
color: #FFF;
|
||||
background-color: #3399FF;
|
||||
}
|
||||
|
||||
.contextMenu LI.disabled A {
|
||||
color: #AAA;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.contextMenu LI.hover.disabled A {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.contextMenu LI.separator {
|
||||
border-top: solid 1px #CCC;
|
||||
}
|
||||
|
||||
/*
|
||||
Adding Icons
|
||||
|
||||
You can add icons to the context menu by adding
|
||||
classes to the respective LI element(s)
|
||||
*/
|
||||
|
||||
.contextMenu LI.pwedit A { background-image: url(/img/context/page_white_edit.png); }
|
||||
.contextMenu LI.pwcopy A { background-image: url(/img/context/page_white_copy.png); }
|
||||
.contextMenu LI.pwpaste A { background-image: url(/img/context/page_white_paste.png); }
|
||||
.contextMenu LI.pwdelete A { background-image: url(/img/context/page_white_delete.png); }
|
||||
.contextMenu LI.edit A { background-image: url(/img/context/edit.png); }
|
||||
.contextMenu LI.copy A { background-image: url(/img/context/copy.png); }
|
||||
.contextMenu LI.paste A { background-image: url(/img/context/paste.png); }
|
||||
.contextMenu LI.delete A { background-image: url(/img/context/delete.png); }
|
||||
.contextMenu LI.cut A { background-image: url(/img/context/cut.png); }
|
||||
.contextMenu LI.quit A { background-image: url(/img/context/door.png); }
|
||||
.contextMenu LI.compress A { background-image: url(/img/context/compress.png); }
|
||||
.contextMenu LI.compressr A { background-image: url(/img/context/compressr.png); }
|
||||
.contextMenu LI.dedup A { background-image: url(/img/context/dedup.png); }
|
||||
.contextMenu LI.decrypt A { background-image: url(/img/context/decrypt.png); }
|
||||
.contextMenu LI.decryptr A { background-image: url(/img/context/decryptr.png); }
|
||||
.contextMenu LI.mpg A { background-image: url(/img/context/mpg.png); }
|
||||
.contextMenu LI.mp3 A { background-image: url(/img/context/mp3.png); }
|
||||
.contextMenu LI.clock A { background-image: url(/img/context/clock.png); }
|
||||
.contextMenu LI.thm A { background-image: url(/img/context/thumb.png); }
|
||||
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
.iPhoneCheckContainer {
|
||||
position: relative;
|
||||
height: 27px;
|
||||
cursor: pointer;
|
||||
overflow: hidden; }
|
||||
.iPhoneCheckContainer input {
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
left: 30px;
|
||||
opacity: 0;
|
||||
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
|
||||
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); }
|
||||
.iPhoneCheckContainer label {
|
||||
white-space: nowrap;
|
||||
font-size: 17px;
|
||||
line-height: 17px;
|
||||
font-weight: bold;
|
||||
font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
|
||||
text-transform: uppercase;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
height: 27px;
|
||||
position: absolute;
|
||||
width: auto;
|
||||
top: 0;
|
||||
padding-top: 5px;
|
||||
overflow: hidden; }
|
||||
.iPhoneCheckContainer, .iPhoneCheckContainer label {
|
||||
user-select: none;
|
||||
-moz-user-select: none;
|
||||
-khtml-user-select: none; }
|
||||
|
||||
.iPhoneCheckDisabled {
|
||||
opacity: 0.5;
|
||||
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50);
|
||||
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50); }
|
||||
|
||||
label.iPhoneCheckLabelOn {
|
||||
color: white;
|
||||
background: url('/img/iphone-style-checkboxes/on.png?1282083753') no-repeat;
|
||||
text-shadow: 0px 0px 2px rgba(0, 0, 0, 0.6);
|
||||
left: 0;
|
||||
padding-top: 5px; }
|
||||
label.iPhoneCheckLabelOn span {
|
||||
padding-left: 8px; }
|
||||
label.iPhoneCheckLabelOff {
|
||||
color: #8b8b8b;
|
||||
background: url('/img/iphone-style-checkboxes/off.png?1282083753') no-repeat right 0;
|
||||
text-shadow: 0px 0px 2px rgba(255, 255, 255, 0.6);
|
||||
text-align: right;
|
||||
right: 0; }
|
||||
label.iPhoneCheckLabelOff span {
|
||||
padding-right: 8px; }
|
||||
|
||||
.iPhoneCheckHandle {
|
||||
display: block;
|
||||
height: 27px;
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 0;
|
||||
background: url('/img/iphone-style-checkboxes/slider_left.png?1282083753') no-repeat;
|
||||
padding-left: 3px; }
|
||||
|
||||
.iPhoneCheckHandleRight {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
padding-right: 3px;
|
||||
background: url('/img/iphone-style-checkboxes/slider_right.png?1282083753') no-repeat right 0; }
|
||||
|
||||
.iPhoneCheckHandleCenter {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background: url('/img/iphone-style-checkboxes/slider_center.png?1282083753'); }
|
||||
@@ -1,7 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2007-2014 Ariel Flesler - aflesler<a>gmail<d>com | http://flesler.blogspot.com
|
||||
* Licensed under MIT
|
||||
* @author Ariel Flesler
|
||||
* @version 1.4.11
|
||||
*/
|
||||
;(function(a){if(typeof define==='function'&&define.amd){define(['jquery'],a)}else{a(jQuery)}}(function($){var j=$.scrollTo=function(a,b,c){return $(window).scrollTo(a,b,c)};j.defaults={axis:'xy',duration:parseFloat($.fn.jquery)>=1.3?0:1,limit:true};j.window=function(a){return $(window)._scrollable()};$.fn._scrollable=function(){return this.map(function(){var a=this,isWin=!a.nodeName||$.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!isWin)return a;var b=(a.contentWindow||a).document||a.ownerDocument||a;return/webkit/i.test(navigator.userAgent)||b.compatMode=='BackCompat'?b.body:b.documentElement})};$.fn.scrollTo=function(f,g,h){if(typeof g=='object'){h=g;g=0}if(typeof h=='function')h={onAfter:h};if(f=='max')f=9e9;h=$.extend({},j.defaults,h);g=g||h.duration;h.queue=h.queue&&h.axis.length>1;if(h.queue)g/=2;h.offset=both(h.offset);h.over=both(h.over);return this._scrollable().each(function(){if(f==null)return;var d=this,$elem=$(d),targ=f,toff,attr={},win=$elem.is('html,body');switch(typeof targ){case'number':case'string':if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)){targ=both(targ);break}targ=$(targ,this);if(!targ.length)return;case'object':if(targ.is||targ.style)toff=(targ=$(targ)).offset()}var e=$.isFunction(h.offset)&&h.offset(d,targ)||h.offset;$.each(h.axis.split(''),function(i,a){var b=a=='x'?'Left':'Top',pos=b.toLowerCase(),key='scroll'+b,old=d[key],max=j.max(d,a);if(toff){attr[key]=toff[pos]+(win?0:old-$elem.offset()[pos]);if(h.margin){attr[key]-=parseInt(targ.css('margin'+b))||0;attr[key]-=parseInt(targ.css('border'+b+'Width'))||0}attr[key]+=e[pos]||0;if(h.over[pos])attr[key]+=targ[a=='x'?'width':'height']()*h.over[pos]}else{var c=targ[pos];attr[key]=c.slice&&c.slice(-1)=='%'?parseFloat(c)/100*max:c}if(h.limit&&/^\d+$/.test(attr[key]))attr[key]=attr[key]<=0?0:Math.min(attr[key],max);if(!i&&h.queue){if(old!=attr[key])animate(h.onAfterFirst);delete attr[key]}});animate(h.onAfter);function animate(a){$elem.animate(attr,g,h.easing,a&&function(){a.call(this,targ,h)})}}).end()};j.max=function(a,b){var c=b=='x'?'Width':'Height',scroll='scroll'+c;if(!$(a).is('html,body'))return a[scroll]-$(a)[c.toLowerCase()]();var d='client'+c,html=a.ownerDocument.documentElement,body=a.ownerDocument.body;return Math.max(html[scroll],body[scroll])-Math.min(html[d],body[d])};function both(a){return $.isFunction(a)||typeof a=='object'?a:{top:a,left:a}};return j}));
|
||||