Compare commits
927 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ea79d2900e | ||
|
|
28c59f88e9 | ||
|
|
fb3dc200fb | ||
|
|
e7223c96b7 | ||
|
|
90a531d2a8 | ||
|
|
1f1c71b218 | ||
|
|
b39fdaca95 | ||
|
|
65039feeba | ||
|
|
c62dabc3e3 | ||
|
|
b1f22c4421 | ||
|
|
2814739c1e | ||
|
|
d2cb97ab0a | ||
|
|
98514ac46f | ||
|
|
aaa10a5fff | ||
|
|
49c3f0e4bb | ||
|
|
673c779ca5 | ||
|
|
8c74c7a77c | ||
|
|
376d564004 | ||
|
|
26f3265299 | ||
|
|
d3d5554969 | ||
|
|
5ea3854043 | ||
|
|
ca08a101d1 | ||
|
|
d4de692822 | ||
|
|
2dc702efc6 | ||
|
|
8601363d46 | ||
|
|
110a342bb1 | ||
|
|
e4caebc368 | ||
|
|
934d353537 | ||
|
|
11465d1946 | ||
|
|
fdc5bc34fd | ||
|
|
10a91df31c | ||
|
|
c503830c25 | ||
|
|
0195524f17 | ||
|
|
c2ce4bed8f | ||
|
|
fd8b77a9df | ||
|
|
4b83741dbe | ||
|
|
ab5fbe8a9c | ||
|
|
30aef59c55 | ||
|
|
813d5f01dd | ||
|
|
040a19a400 | ||
|
|
13a5298be7 | ||
|
|
b366e47197 | ||
|
|
9bbc41d7b7 | ||
|
|
4a8703d5f0 | ||
|
|
dcb5c886fa | ||
|
|
fbc6425a13 | ||
|
|
332f2a492d | ||
|
|
86cab45ce2 | ||
|
|
0759aad72f | ||
|
|
9781a05d78 | ||
|
|
8c61b0ebc0 | ||
|
|
1d8f8dcdf9 | ||
|
|
8716026ae8 | ||
|
|
6dbef7c929 | ||
|
|
47775ac085 | ||
|
|
51aa38764a | ||
|
|
2b8010c24a | ||
|
|
8a24eeff24 | ||
|
|
863ece66fa | ||
|
|
b8f696ad69 | ||
|
|
40b31c7d00 | ||
|
|
d85983bbe9 | ||
|
|
143e006e55 | ||
|
|
68a8d6e052 | ||
|
|
ca22316ae4 | ||
|
|
46c0ec9c63 | ||
|
|
c9d4be3d1c | ||
|
|
f9b008f7d2 | ||
|
|
f2474ba8da | ||
|
|
52fc11eb57 | ||
|
|
72ab42e7bf | ||
|
|
5b32c96f1d | ||
|
|
846204c244 | ||
|
|
c0e62ad8e8 | ||
|
|
31bbbe098a | ||
|
|
0fb89ceb06 | ||
|
|
0f904e66d4 | ||
|
|
74739343d4 | ||
|
|
d4f1b9988b | ||
|
|
cd38113da2 | ||
|
|
c95772122f | ||
|
|
3196275bb1 | ||
|
|
483ee12ccd | ||
|
|
ba14dfdc46 | ||
|
|
b7a2e7d097 | ||
|
|
6ff8dcffc1 | ||
|
|
bc8903d3c8 | ||
|
|
6e43e7a336 | ||
|
|
df81050c2a | ||
|
|
ebfafc66cb | ||
|
|
bccf5d0f48 | ||
|
|
761a9f4505 | ||
|
|
5f29c44a9e | ||
|
|
c5b22427f3 | ||
|
|
d3737f5a62 | ||
|
|
7bef57ca76 | ||
|
|
ebff4cd1c0 | ||
|
|
b0dc96c888 | ||
|
|
13e1b933e1 | ||
|
|
b25cab1fe6 | ||
|
|
01ebefcb74 | ||
|
|
e536b0d5e2 | ||
|
|
2147f1f129 | ||
|
|
e684a1e91b | ||
|
|
6f95aeac8f | ||
|
|
f071f84eb4 | ||
|
|
8db478d8f0 | ||
|
|
ce481b0f25 | ||
|
|
6af16d7fca | ||
|
|
850cc3b2bd | ||
|
|
a1363ef41b | ||
|
|
71f82251f6 | ||
|
|
eaf39661ba | ||
|
|
2b991d9958 | ||
|
|
eed8b29753 | ||
|
|
ebc8e3a27b | ||
|
|
aa2ed93d74 | ||
|
|
ba520e6aa1 | ||
|
|
61373e87ea | ||
|
|
4dd95b1b0f | ||
|
|
f160b4fa80 | ||
|
|
de637f1048 | ||
|
|
f628868a8e | ||
|
|
9dd2221841 | ||
|
|
24d68efd4b | ||
|
|
ad8c3da48b | ||
|
|
7255ea4805 | ||
|
|
47cf80102c | ||
|
|
2cebe069f2 | ||
|
|
3326ba5784 | ||
|
|
5e5fa22566 | ||
|
|
95dbad842d | ||
|
|
5576c9e2e9 | ||
|
|
3577fc613e | ||
|
|
7bdeefd7e1 | ||
|
|
df2697c68b | ||
|
|
d859075e97 | ||
|
|
d6c282a70a | ||
|
|
f541fae982 | ||
|
|
054cc5cad9 | ||
|
|
b52f0cd112 | ||
|
|
4865f6c87b | ||
|
|
b2ceca3a8f | ||
|
|
2c4ee9370c | ||
|
|
1f10cad45b | ||
|
|
c2e92fa355 | ||
|
|
2f85371738 | ||
|
|
a48c9f5a77 | ||
|
|
61728cfa07 | ||
|
|
1643e74758 | ||
|
|
33a354688a | ||
|
|
7c2d6f6fb5 | ||
|
|
ea959248ca | ||
|
|
2665a3be40 | ||
|
|
d240cf0a53 | ||
|
|
c02e7cd0b5 | ||
|
|
6a3e15aabf | ||
|
|
e4bae8cdc5 | ||
|
|
e0e679d436 | ||
|
|
0f3050521d | ||
|
|
db5a10bb96 | ||
|
|
b05954eccd | ||
|
|
d2504dac64 | ||
|
|
a95e4124a8 | ||
|
|
c18630b0a5 | ||
|
|
f436aa835d | ||
|
|
7409c89a87 | ||
|
|
0de8405906 | ||
|
|
39d4bfe858 | ||
|
|
0677cb2a90 | ||
|
|
2dd2e64f43 | ||
|
|
3d45172991 | ||
|
|
979fb791ac | ||
|
|
1fcc2d996c | ||
|
|
e1d1891de8 | ||
|
|
fabfcbd742 | ||
|
|
3710fa9e79 | ||
|
|
b059261065 | ||
|
|
7b1b91ca14 | ||
|
|
098127c287 | ||
|
|
83c99f34a3 | ||
|
|
a9ae141838 | ||
|
|
c783416054 | ||
|
|
59e1bc3c56 | ||
|
|
f4cdff0c2c | ||
|
|
5bd99480f1 | ||
|
|
a86e7e4182 | ||
|
|
c3477264b3 | ||
|
|
9c4c33aa76 | ||
|
|
9b5aea5aec | ||
|
|
614ee50262 | ||
|
|
f1b7c973d3 | ||
|
|
0c7fad798c | ||
|
|
e4ed3cf978 | ||
|
|
63687b7f48 | ||
|
|
20454a21ed | ||
|
|
eb30cb0cb6 | ||
|
|
b211fae85c | ||
|
|
93b4774903 | ||
|
|
236b55fce6 | ||
|
|
c34bf50c39 | ||
|
|
b8f921dab2 | ||
|
|
fc79be3010 | ||
|
|
63d08eeed2 | ||
|
|
7fa39f645d | ||
|
|
535677fc8e | ||
|
|
2dfff50031 | ||
|
|
c335b6b7fb | ||
|
|
a81c4c7a75 | ||
|
|
e2ada5e6b2 | ||
|
|
43ae4ac317 | ||
|
|
5f0ee6d95e | ||
|
|
0947172391 | ||
|
|
0fb9680f72 | ||
|
|
ba94a3bba0 | ||
|
|
11963e263d | ||
|
|
3f15cb8fff | ||
|
|
eca4f8e06d | ||
|
|
358be2ee92 | ||
|
|
acd8f949e7 | ||
|
|
a1574af5e0 | ||
|
|
525e73e179 | ||
|
|
abe1745642 | ||
|
|
eda925e617 | ||
|
|
5ab3f7ba16 | ||
|
|
cb12bdad2d | ||
|
|
2a6c2fc273 | ||
|
|
216c04b3f1 | ||
|
|
0ecb6ea1aa | ||
|
|
f3fff8543d | ||
|
|
2d75b57195 | ||
|
|
7ebd73916e | ||
|
|
cafa9d521a | ||
|
|
a5b395d888 | ||
|
|
c214640bb1 | ||
|
|
d7a8b35ded | ||
|
|
bcc86e160f | ||
|
|
5b14389c6e | ||
|
|
0ba4803154 | ||
|
|
e58f9cae28 | ||
|
|
1d5c049c01 | ||
|
|
0d01b4a2ea | ||
|
|
d43a758a37 | ||
|
|
d886372f11 | ||
|
|
838d44bd5c | ||
|
|
8f997eb4f3 | ||
|
|
65b3fc56ef | ||
|
|
6e061cbc30 | ||
|
|
9e44b76214 | ||
|
|
d1e928e068 | ||
|
|
2c2249d96b | ||
|
|
d87e932030 | ||
|
|
44cac8a7e1 | ||
|
|
736d3c8744 | ||
|
|
3104065437 | ||
|
|
444695a908 | ||
|
|
eba6f4eaf2 | ||
|
|
e3b4f0b159 | ||
|
|
5c55939765 | ||
|
|
bd69d00182 | ||
|
|
7312789e12 | ||
|
|
4e765e64ca | ||
|
|
660f86018a | ||
|
|
b5050acba0 | ||
|
|
2fa780236b | ||
|
|
831770e7d8 | ||
|
|
c50102e153 | ||
|
|
54088daa67 | ||
|
|
169312f021 | ||
|
|
62ab717772 | ||
|
|
6273bcdd3f | ||
|
|
5b894794dd | ||
|
|
b31c41fdda | ||
|
|
2c6bcacb25 | ||
|
|
ed9b9881b6 | ||
|
|
2d2945cc5c | ||
|
|
3b1a1fbbe2 | ||
|
|
be2f15f77b | ||
|
|
3c4872c231 | ||
|
|
8c605674f3 | ||
|
|
c1549faca1 | ||
|
|
f4b98cd4ff | ||
|
|
cbeac572f5 | ||
|
|
f94371f16c | ||
|
|
7111a2aee3 | ||
|
|
cc82304996 | ||
|
|
3d91b8ab13 | ||
|
|
9a4ae52df0 | ||
|
|
466b6bb1dd | ||
|
|
facf511621 | ||
|
|
c4cada924e | ||
|
|
99b8a02c0e | ||
|
|
b74ed1490a | ||
|
|
02f64e318d | ||
|
|
2938014b33 | ||
|
|
45040555f0 | ||
|
|
591ec57c49 | ||
|
|
d5626ab7df | ||
|
|
2a25efba1a | ||
|
|
9197d24fff | ||
|
|
9fa87c5141 | ||
|
|
dddf2e9ea1 | ||
|
|
69ea8838cd | ||
|
|
33ea31f1fa | ||
|
|
e2adcabc5b | ||
|
|
a33ded4409 | ||
|
|
6161518d8b | ||
|
|
bf40cb2009 | ||
|
|
12f8315a84 | ||
|
|
0f460483f3 | ||
|
|
bf22cd1638 | ||
|
|
e656c89ba1 | ||
|
|
b8416ed4c1 | ||
|
|
62b8e18c9e | ||
|
|
1e09ccbc0c | ||
|
|
76717f6141 | ||
|
|
33308688aa | ||
|
|
df481aaf07 | ||
|
|
82190b330b | ||
|
|
19d8103806 | ||
|
|
30b6120582 | ||
|
|
b7aa8bd56c | ||
|
|
4aad818888 | ||
|
|
68a51af239 | ||
|
|
80d64ae4e0 | ||
|
|
cd295e2315 | ||
|
|
80bdd6761b | ||
|
|
bf0798d397 | ||
|
|
e130a87e81 | ||
|
|
34e22c63a0 | ||
|
|
70db2a15f4 | ||
|
|
aaa7be7bff | ||
|
|
000fda848b | ||
|
|
c0f0595ad7 | ||
|
|
62ad6dde67 | ||
|
|
8750fe7a43 | ||
|
|
b0f0bb10ec | ||
|
|
e05f276b6a | ||
|
|
a075934168 | ||
|
|
5898ebb5f0 | ||
|
|
d122c83535 | ||
|
|
2025e8f10b | ||
|
|
3339a63268 | ||
|
|
3d2eef2a69 | ||
|
|
aa9f1074bd | ||
|
|
545ba36db4 | ||
|
|
53b8979861 | ||
|
|
0569a4b633 | ||
|
|
cc306475b2 | ||
|
|
3f0982dd7c | ||
|
|
017ef727ab | ||
|
|
1f1635ede3 | ||
|
|
f2f2e780b0 | ||
|
|
f32e7df86a | ||
|
|
030e219cbd | ||
|
|
111e8c82c4 | ||
|
|
d0aad8589d | ||
|
|
c7eb890ffe | ||
|
|
47a9bde70b | ||
|
|
7abadcc6c3 | ||
|
|
8a52bcfec2 | ||
|
|
81770d2182 | ||
|
|
0ed030fae3 | ||
|
|
a8dd0632f2 | ||
|
|
04f7e84642 | ||
|
|
efda17ecfa | ||
|
|
11c9bf39ff | ||
|
|
c41cfe5ae2 | ||
|
|
61c6270edd | ||
|
|
1fe5e6ad8e | ||
|
|
8c7fbcd7d4 | ||
|
|
6746fdb98e | ||
|
|
4cf48bb50f | ||
|
|
80a4e54802 | ||
|
|
c19a958629 | ||
|
|
9b969087a5 | ||
|
|
121de8090f | ||
|
|
ae18a10fd8 | ||
|
|
05b0ef75c9 | ||
|
|
8dfad0aa5d | ||
|
|
b07f2e9633 | ||
|
|
6ecc435b85 | ||
|
|
a0a70495f0 | ||
|
|
29981dfd52 | ||
|
|
86735ac3b7 | ||
|
|
e5a1a10101 | ||
|
|
f362a83cfa | ||
|
|
df902fb08e | ||
|
|
29de36f348 | ||
|
|
92e7603aa5 | ||
|
|
e3431f201c | ||
|
|
5c7a6bbf8f | ||
|
|
d6a82d1962 | ||
|
|
a7a5ada4d9 | ||
|
|
6ff50cb42d | ||
|
|
7ffc89f41b | ||
|
|
8c1131442b | ||
|
|
c49acc9084 | ||
|
|
f03cfcb0e3 | ||
|
|
460d7c5aea | ||
|
|
50fd681420 | ||
|
|
70c8ca3a55 | ||
|
|
1234f789a4 | ||
|
|
25fd009be3 | ||
|
|
9ffab47f83 | ||
|
|
38c46f3d5c | ||
|
|
3a0c33c5cf | ||
|
|
5d6b057361 | ||
|
|
8fcbdc8ea0 | ||
|
|
a774f9052d | ||
|
|
2d79b5a988 | ||
|
|
86ae5e14b4 | ||
|
|
8153d4a139 | ||
|
|
3e80d86628 | ||
|
|
a097330772 | ||
|
|
5545743bd8 | ||
|
|
ccd212f839 | ||
|
|
5697625a7d | ||
|
|
3d54005332 | ||
|
|
a5894dfae8 | ||
|
|
b3aa6e37b9 | ||
|
|
e4e7661a3d | ||
|
|
9fe38ad649 | ||
|
|
a8a03a831a | ||
|
|
0df4db9286 | ||
|
|
e4599e3076 | ||
|
|
1a0d8933dc | ||
|
|
00af30281c | ||
|
|
8c85b3098d | ||
|
|
000607f8e0 | ||
|
|
82e3698dd2 | ||
|
|
0dd9535a5b | ||
|
|
088b3f60ea | ||
|
|
c118159121 | ||
|
|
5fad745220 | ||
|
|
02b41bfbdc | ||
|
|
82ab3faca3 | ||
|
|
df74757e83 | ||
|
|
a21772f3c2 | ||
|
|
cbd930a340 | ||
|
|
9f129c9781 | ||
|
|
18931e94b0 | ||
|
|
1520828dff | ||
|
|
43223d1677 | ||
|
|
3fb9836fc8 | ||
|
|
8cd5a10ea8 | ||
|
|
da1850896b | ||
|
|
336ef01dee | ||
|
|
246bf189b5 | ||
|
|
825effadd9 | ||
|
|
51f53855f8 | ||
|
|
65fa29fbb8 | ||
|
|
5bcfa06e19 | ||
|
|
b01218958f | ||
|
|
7887f0e7a1 | ||
|
|
f522502938 | ||
|
|
c7f533cf0a | ||
|
|
a3107de33e | ||
|
|
e69a3249e5 | ||
|
|
f3c24f05e0 | ||
|
|
20364bb1d7 | ||
|
|
3d1c92dae4 | ||
|
|
4048895c6b | ||
|
|
991908bd8d | ||
|
|
8ff559dbef | ||
|
|
d7d483ef9c | ||
|
|
b11064e3a8 | ||
|
|
409d35b29b | ||
|
|
811cf40cd7 | ||
|
|
3aa9d23ac6 | ||
|
|
9c8bb08454 | ||
|
|
2c28af0dd7 | ||
|
|
cc6bd40b15 | ||
|
|
5221ba0959 | ||
|
|
61f132327d | ||
|
|
826730e88b | ||
|
|
5cdb08c35f | ||
|
|
9806d3705a | ||
|
|
55e6e66df6 | ||
|
|
0d38b23a60 | ||
|
|
07fd0ab6bf | ||
|
|
6036b0635d | ||
|
|
74f678076a | ||
|
|
ef157d71f2 | ||
|
|
0b718e0fbf | ||
|
|
809af86c16 | ||
|
|
449e8e2c4a | ||
|
|
01c8a10463 | ||
|
|
27da7ed0fe | ||
|
|
685116c555 | ||
|
|
0c4741c793 | ||
|
|
4da7024f91 | ||
|
|
b49a2cc52d | ||
|
|
c0fe50cd2f | ||
|
|
497efaabf0 | ||
|
|
2ee777739f | ||
|
|
deb3ad5359 | ||
|
|
3f1801ef2b | ||
|
|
ca8e92e443 | ||
|
|
c514e4a1ad | ||
|
|
ec28de40c9 | ||
|
|
14053fbfdd | ||
|
|
464030808c | ||
|
|
d2377bff34 | ||
|
|
d3f378f6bd | ||
|
|
09e1562fbc | ||
|
|
4e14ac6d9b | ||
|
|
97882f0c60 | ||
|
|
482a5cfb11 | ||
|
|
f73dee1103 | ||
|
|
9034e1ad45 | ||
|
|
7e35481b62 | ||
|
|
2f87f2adc3 | ||
|
|
6b345ac041 | ||
|
|
19e18f6a10 | ||
|
|
f181cef9e9 | ||
|
|
dd19c39cf8 | ||
|
|
5887a9c755 | ||
|
|
ca35084160 | ||
|
|
644eee0aca | ||
|
|
510a0c1087 | ||
|
|
4afbe4c2fc | ||
|
|
6cf36cc99c | ||
|
|
b98127e83a | ||
|
|
f7f195f083 | ||
|
|
22e6228a08 | ||
|
|
b757e42c88 | ||
|
|
fdf1ef1cb7 | ||
|
|
4797ff84d8 | ||
|
|
3937d733f0 | ||
|
|
0328643c7c | ||
|
|
80c73523e3 | ||
|
|
8c5747798d | ||
|
|
bdf6dbd096 | ||
|
|
0eaef469f9 | ||
|
|
f2d3615e26 | ||
|
|
24f05a1c03 | ||
|
|
570642d820 | ||
|
|
fd794f99d2 | ||
|
|
9a95bae6ba | ||
|
|
1b04504617 | ||
|
|
2a2cd81149 | ||
|
|
2bb961b7a8 | ||
|
|
01b035d7af | ||
|
|
8d0de398fd | ||
|
|
2ebec54476 | ||
|
|
b66d5fe8d3 | ||
|
|
0f989f249f | ||
|
|
6980bdcf7f | ||
|
|
975a016974 | ||
|
|
4be1b45896 | ||
|
|
8e10824189 | ||
|
|
1a881b4eaf | ||
|
|
2a9e91dd55 | ||
|
|
725ea8999a | ||
|
|
3427b736ec | ||
|
|
1dde9d0198 | ||
|
|
7577c3552d | ||
|
|
30de655fb2 | ||
|
|
09cf5589f5 | ||
|
|
b206f8ab78 | ||
|
|
f358cdea5b | ||
|
|
14fe45bda8 | ||
|
|
72ff461b45 | ||
|
|
96fe7d46ba | ||
|
|
d40cdeb65e | ||
|
|
4130df7bf9 | ||
|
|
6e176cdda7 | ||
|
|
bdb171dc6d | ||
|
|
801471a105 | ||
|
|
f86cb53bd9 | ||
|
|
435e1b3b4b | ||
|
|
4b17d76144 | ||
|
|
d96ebe4282 | ||
|
|
e5c5e7dc5e | ||
|
|
fe593dcb09 | ||
|
|
b1056a19a3 | ||
|
|
048c47f7f3 | ||
|
|
a4bb1605ce | ||
|
|
c4d24c0a4c | ||
|
|
99dedb61cb | ||
|
|
702c3d069f | ||
|
|
8ec8efe967 | ||
|
|
4aa0260399 | ||
|
|
f24aaf1396 | ||
|
|
00ddd056af | ||
|
|
2438fbb13d | ||
|
|
20832c3dcc | ||
|
|
725461f04e | ||
|
|
a3edd7bdf9 | ||
|
|
8d9d330678 | ||
|
|
d46fa3012b | ||
|
|
75e9f916ec | ||
|
|
f71277008f | ||
|
|
184a9d223b | ||
|
|
b4c45e33e9 | ||
|
|
eea960bcbd | ||
|
|
609e4397db | ||
|
|
b8bfbc5f6a | ||
|
|
4b274f959e | ||
|
|
e66811a4e2 | ||
|
|
139bfe775c | ||
|
|
feb26af4bf | ||
|
|
27d75f810a | ||
|
|
bc251d8c2b | ||
|
|
bde9010000 | ||
|
|
91314f423f | ||
|
|
2bb0a361aa | ||
|
|
5517bf80f9 | ||
|
|
f141e6f7a7 | ||
|
|
7220288460 | ||
|
|
d9f4955736 | ||
|
|
13255bc58b | ||
|
|
2988de5501 | ||
|
|
70a69f1c3b | ||
|
|
7cce0bf865 | ||
|
|
16e3e92c4a | ||
|
|
5f1b78ea1d | ||
|
|
9f36a8e5f8 | ||
|
|
89a2212408 | ||
|
|
9ed344d22d | ||
|
|
642db4c5b9 | ||
|
|
2a93778df7 | ||
|
|
c11500b791 | ||
|
|
ee0303dc06 | ||
|
|
0d55f3bd81 | ||
|
|
0e377c1aff | ||
|
|
388bd7cefa | ||
|
|
8234b3b063 | ||
|
|
573a07026d | ||
|
|
880e04d760 | ||
|
|
683752762d | ||
|
|
79a78e0a58 | ||
|
|
c33bea997a | ||
|
|
a2f8d9bc43 | ||
|
|
80d717b4dc | ||
|
|
e14a8df6a0 | ||
|
|
4be0067852 | ||
|
|
30a97ed4db | ||
|
|
1257ed0174 | ||
|
|
c717dd7bba | ||
|
|
e0a7893578 | ||
|
|
6df5adf0f1 | ||
|
|
7e773e5d0a | ||
|
|
c3dbc4187f | ||
|
|
6c004c3010 | ||
|
|
96054295a0 | ||
|
|
640c0e9c4a | ||
|
|
ce04ef36da | ||
|
|
677e90ed6b | ||
|
|
c2fcdd6b9f | ||
|
|
d89cd59c8b | ||
|
|
ae0d933588 | ||
|
|
15a092ce87 | ||
|
|
e23fc7d15a | ||
|
|
0c07937d45 | ||
|
|
2694a06876 | ||
|
|
66ca709da9 | ||
|
|
a01d770044 | ||
|
|
bdfa5b6141 | ||
|
|
0d9116b9dc | ||
|
|
5c8f11bfe3 | ||
|
|
a32f04a4e3 | ||
|
|
133317efdb | ||
|
|
58f8834041 | ||
|
|
71ff5d3058 | ||
|
|
fb82fcdb20 | ||
|
|
3837e18af2 | ||
|
|
c4a431bd2f | ||
|
|
9ff868a2d4 | ||
|
|
7a44e5db9a | ||
|
|
9ec77d62cc | ||
|
|
fd974c7bb7 | ||
|
|
ed0bad79ad | ||
|
|
021a217f2c | ||
|
|
0c2ab575a1 | ||
|
|
338ca3bb24 | ||
|
|
7c718b5131 | ||
|
|
cbeb595f48 | ||
|
|
293d3aa259 | ||
|
|
21d1c1f9ba | ||
|
|
ef6bf6e4df | ||
|
|
aa6cfcc76e | ||
|
|
924919fb6f | ||
|
|
15b4793d32 | ||
|
|
22a1305cb1 | ||
|
|
7c3cc891f3 | ||
|
|
158e03b5fd | ||
|
|
e2aefab2ae | ||
|
|
4027ecee5a | ||
|
|
b1ca05fec3 | ||
|
|
21ef12f143 | ||
|
|
6cf1def982 | ||
|
|
2c1e032f38 | ||
|
|
56887c9f1f | ||
|
|
8715f79251 | ||
|
|
d8ff32f888 | ||
|
|
d0315891b7 | ||
|
|
a796dc2376 | ||
|
|
eb4cc629a3 | ||
|
|
280320ef9a | ||
|
|
328ddeb46d | ||
|
|
13df2cb182 | ||
|
|
bf73a03125 | ||
|
|
8c98e13984 | ||
|
|
c159e9326e | ||
|
|
662bd1188d | ||
|
|
b3e57075de | ||
|
|
c6a08896f0 | ||
|
|
8cfe6b557c | ||
|
|
8ce1da9485 | ||
|
|
c44b1689b3 | ||
|
|
dcf2571437 | ||
|
|
c9aca08d4e | ||
|
|
fe8486d456 | ||
|
|
b31dc5fb16 | ||
|
|
160ee475fd | ||
|
|
dca9e6a88a | ||
|
|
4172f7d157 | ||
|
|
7a2275b3fb | ||
|
|
76ac21a92d | ||
|
|
f21012202f | ||
|
|
c0eb4172a2 | ||
|
|
2ed832c729 | ||
|
|
bfbf84ca24 | ||
|
|
5747825c14 | ||
|
|
67cbc08b60 | ||
|
|
be0c8088ce | ||
|
|
c36b7d842d | ||
|
|
74534641aa | ||
|
|
f7e1ce7b50 | ||
|
|
dab73a3eb2 | ||
|
|
24fe2bb81e | ||
|
|
1cd1529e28 | ||
|
|
72386c94a9 | ||
|
|
262efb40bb | ||
|
|
85dfe6f5fa | ||
|
|
53cee56a9d | ||
|
|
76224c40fe | ||
|
|
f12b4914e6 | ||
|
|
989b0a602d | ||
|
|
7664f1ea74 | ||
|
|
1d3d5fa56b | ||
|
|
f69edba862 | ||
|
|
20bd4d81ec | ||
|
|
aeac737c84 | ||
|
|
bea1afc01c | ||
|
|
8cbc5d79d4 | ||
|
|
d51f050d6e | ||
|
|
b485e1ce4e | ||
|
|
5de12ce651 | ||
|
|
2d455a2fcf | ||
|
|
7b5f5ae5ce | ||
|
|
853981b3b0 | ||
|
|
2449a059f0 | ||
|
|
d1e2cf4850 | ||
|
|
e89a80ea1a | ||
|
|
ef44be8240 | ||
|
|
81fc8495b2 | ||
|
|
3dc7c62559 | ||
|
|
41e99372f7 | ||
|
|
9ac6ce909d | ||
|
|
9eebbc011e | ||
|
|
8c62d3eb28 | ||
|
|
7576511841 | ||
|
|
58423bfd18 | ||
|
|
aae759c901 | ||
|
|
4fe333e335 | ||
|
|
7634f9c6d5 | ||
|
|
6dd7c4abeb | ||
|
|
f1aa201425 | ||
|
|
964449660d | ||
|
|
5b3af56bd8 | ||
|
|
4c1acb8206 | ||
|
|
a9dd713809 | ||
|
|
d67c25aab5 | ||
|
|
7a0f8c5d98 | ||
|
|
46cd326f09 | ||
|
|
08898a7334 | ||
|
|
f2facff418 | ||
|
|
ef55c48dd1 | ||
|
|
f9411f0500 | ||
|
|
26e54dc2a2 | ||
|
|
a6891e1817 | ||
|
|
de35d2fe15 | ||
|
|
eeffd207be | ||
|
|
047daf4e44 | ||
|
|
b0012bee27 | ||
|
|
f81ea9fe57 | ||
|
|
5f5ebd12a4 | ||
|
|
a63b9e3ff4 | ||
|
|
d256b35a67 | ||
|
|
a3e553c04f | ||
|
|
dadf055a54 | ||
|
|
8d2f7da823 | ||
|
|
61a6c86ae2 | ||
|
|
2c958deebf | ||
|
|
0b4871c299 | ||
|
|
1fa86272d6 | ||
|
|
97f430b2b7 | ||
|
|
9c6be944fc | ||
|
|
f04cdad89d | ||
|
|
862777f067 | ||
|
|
4eb6ffc618 | ||
|
|
b75118b4c2 | ||
|
|
529f7198b1 | ||
|
|
5d08a963d5 | ||
|
|
0ee2193b3c | ||
|
|
e6bc582e16 | ||
|
|
6d23133101 | ||
|
|
11c3d77513 | ||
|
|
d9baa76804 | ||
|
|
88cd0996ec | ||
|
|
93726f9bb3 | ||
|
|
fb7eccee3d | ||
|
|
7fb596a744 | ||
|
|
ab43714359 | ||
|
|
4928b0087e | ||
|
|
9d23e4cfba | ||
|
|
57fd479a9c | ||
|
|
91e30ef9bd | ||
|
|
8af42aa7ac | ||
|
|
b9921e155b | ||
|
|
d7ed877ebd | ||
|
|
436630b5c8 | ||
|
|
5d2edc911d | ||
|
|
f0dcf68f8f | ||
|
|
caca296562 | ||
|
|
948978b5e1 | ||
|
|
a1c7a54172 | ||
|
|
38254f51d1 | ||
|
|
fe8c94bb90 | ||
|
|
891aff80ed | ||
|
|
cfa77ab0a4 | ||
|
|
7ecbc2c407 | ||
|
|
f185438b08 | ||
|
|
d413370104 | ||
|
|
2b54b192ed | ||
|
|
0296379cfa | ||
|
|
e4e9217d84 | ||
|
|
bf06a64734 | ||
|
|
7429ec9576 | ||
|
|
176c8fc557 | ||
|
|
d2e5476432 | ||
|
|
c53b0ba3ad | ||
|
|
e2137b3503 | ||
|
|
dc051e993b | ||
|
|
a0dbbbe397 | ||
|
|
a5d473c546 | ||
|
|
2204a15350 | ||
|
|
971cd573fc | ||
|
|
d3ba467e6a | ||
|
|
eb68960dca | ||
|
|
1297705b53 | ||
|
|
1a81c0b918 | ||
|
|
dd351eeaa5 | ||
|
|
c505f4249d | ||
|
|
26340a0d54 | ||
|
|
6779ec9ab8 | ||
|
|
9a4944f91d | ||
|
|
5a2f004c20 | ||
|
|
939eed7b3e | ||
|
|
e7515b0fdb | ||
|
|
3eb97098bb | ||
|
|
e4fd3927fa | ||
|
|
a5e7452673 | ||
|
|
6a1796a284 | ||
|
|
aaac445d84 | ||
|
|
fd9021190a | ||
|
|
5c35c18e49 | ||
|
|
89777eebcf | ||
|
|
18b2a1a65f | ||
|
|
edc5a9ea0a | ||
|
|
72edcc692b | ||
|
|
6e6a0dae96 | ||
|
|
c6224c4a4a | ||
|
|
76f9c9dd7c | ||
|
|
d75c7f9f50 | ||
|
|
cc7887d452 | ||
|
|
29f431cd78 | ||
|
|
1a97623dee | ||
|
|
79bd665b92 | ||
|
|
0de026fc2b | ||
|
|
cb3f87d4d9 | ||
|
|
f9ec7b7138 | ||
|
|
77e0e1d51f | ||
|
|
c28cd3506e | ||
|
|
7dd3c36867 | ||
|
|
4dd36c5130 | ||
|
|
f00628539a | ||
|
|
fcc5896926 | ||
|
|
75881d1c9f | ||
|
|
9597b057a6 | ||
|
|
7d209a1c58 | ||
|
|
490ca1c1c3 | ||
|
|
95c0aa1812 | ||
|
|
9cbb9f7529 | ||
|
|
c8a73fa56e | ||
|
|
29dff39bf1 | ||
|
|
ef8190612f | ||
|
|
55d547d947 | ||
|
|
e80825ac3a | ||
|
|
8d8edc171c | ||
|
|
c1f4740b68 | ||
|
|
d6a5f486d7 | ||
|
|
807cc53fa8 | ||
|
|
2237c91067 | ||
|
|
98a08fddf8 | ||
|
|
21cdcb20b4 | ||
|
|
47547b2ae8 | ||
|
|
6e9af92471 | ||
|
|
cc7df4222a | ||
|
|
25b5af50c2 | ||
|
|
7c8c728ad4 | ||
|
|
655fef4baa | ||
|
|
a27db58031 | ||
|
|
7c0cb2d1c3 | ||
|
|
229a089d45 | ||
|
|
49ca9d75f9 | ||
|
|
745903d133 | ||
|
|
54bf805548 | ||
|
|
2ac674f5c6 | ||
|
|
2b5a16be70 | ||
|
|
1fbe9df342 | ||
|
|
1217d2d05e | ||
|
|
432795026c | ||
|
|
ab23eaa6ff |
4
.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
error-log.txt
|
||||
backups/*.zip
|
||||
lib/config-*.php
|
||||
test/test-file1.txt
|
||||
@@ -1,6 +0,0 @@
|
||||
# CodeMirror 2
|
||||
|
||||
CodeMirror 2 is a rewrite of [CodeMirror
|
||||
1](http://github.com/marijnh/CodeMirror). The docs live
|
||||
[here](http://codemirror.net/doc/manual.html), and the project page is
|
||||
[http://codemirror.net/](http://codemirror.net/).
|
||||
@@ -1,126 +0,0 @@
|
||||
.CodeMirror {
|
||||
line-height: 1em;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
.CodeMirror-scroll {
|
||||
overflow: auto;
|
||||
height: 300px;
|
||||
/* This is needed to prevent an IE[67] bug where the scrolled content
|
||||
is visible outside of the scrolling box. */
|
||||
position: relative;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.CodeMirror-gutter {
|
||||
position: absolute; left: 0; top: 0;
|
||||
z-index: 10;
|
||||
background-color: #f7f7f7;
|
||||
border-right: 1px solid #eee;
|
||||
min-width: 2em;
|
||||
height: 100%;
|
||||
}
|
||||
.CodeMirror-gutter-text {
|
||||
color: #aaa;
|
||||
text-align: right;
|
||||
padding: .4em .2em .4em .4em;
|
||||
white-space: pre !important;
|
||||
}
|
||||
.CodeMirror-lines {
|
||||
padding: .4em;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
.CodeMirror pre {
|
||||
-moz-border-radius: 0;
|
||||
-webkit-border-radius: 0;
|
||||
-o-border-radius: 0;
|
||||
border-radius: 0;
|
||||
border-width: 0; margin: 0; padding: 0; background: transparent;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
padding: 0; margin: 0;
|
||||
white-space: pre;
|
||||
word-wrap: normal;
|
||||
line-height: inherit;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.CodeMirror-wrap pre {
|
||||
word-wrap: break-word;
|
||||
white-space: pre-wrap;
|
||||
word-break: normal;
|
||||
}
|
||||
.CodeMirror-wrap .CodeMirror-scroll {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.CodeMirror textarea {
|
||||
outline: none !important;
|
||||
}
|
||||
|
||||
.CodeMirror pre.CodeMirror-cursor {
|
||||
z-index: 10;
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
border-left: 1px solid black;
|
||||
border-right: none;
|
||||
width: 0;
|
||||
}
|
||||
.cm-keymap-fat-cursor pre.CodeMirror-cursor {
|
||||
width: auto;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
background: rgba(0, 200, 0, .4);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800, endColorstr=#4c00c800);
|
||||
}
|
||||
/* Kludge to turn off filter in ie9+, which also accepts rgba */
|
||||
.cm-keymap-fat-cursor pre.CodeMirror-cursor:not(#nonsense_id) {
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
||||
}
|
||||
.CodeMirror pre.CodeMirror-cursor.CodeMirror-overwrite {}
|
||||
.CodeMirror-focused pre.CodeMirror-cursor {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
div.CodeMirror-selected { background: #d9d9d9; }
|
||||
.CodeMirror-focused div.CodeMirror-selected { background: #d7d4f0; }
|
||||
|
||||
.CodeMirror-searching {
|
||||
background: #ffa;
|
||||
background: rgba(255, 255, 0, .4);
|
||||
}
|
||||
|
||||
/* Default theme */
|
||||
|
||||
.cm-s-default span.cm-keyword {color: #708;}
|
||||
.cm-s-default span.cm-atom {color: #219;}
|
||||
.cm-s-default span.cm-number {color: #164;}
|
||||
.cm-s-default span.cm-def {color: #00f;}
|
||||
.cm-s-default span.cm-variable {color: black;}
|
||||
.cm-s-default span.cm-variable-2 {color: #05a;}
|
||||
.cm-s-default span.cm-variable-3 {color: #085;}
|
||||
.cm-s-default span.cm-property {color: black;}
|
||||
.cm-s-default span.cm-operator {color: black;}
|
||||
.cm-s-default span.cm-comment {color: #a50;}
|
||||
.cm-s-default span.cm-string {color: #a11;}
|
||||
.cm-s-default span.cm-string-2 {color: #f50;}
|
||||
.cm-s-default span.cm-meta {color: #555;}
|
||||
.cm-s-default span.cm-error {color: #f00;}
|
||||
.cm-s-default span.cm-qualifier {color: #555;}
|
||||
.cm-s-default span.cm-builtin {color: #30a;}
|
||||
.cm-s-default span.cm-bracket {color: #cc7;}
|
||||
.cm-s-default span.cm-tag {color: #170;}
|
||||
.cm-s-default span.cm-attribute {color: #00c;}
|
||||
.cm-s-default span.cm-header {color: blue;}
|
||||
.cm-s-default span.cm-quote {color: #090;}
|
||||
.cm-s-default span.cm-hr {color: #999;}
|
||||
.cm-s-default span.cm-link {color: #00c;}
|
||||
|
||||
span.cm-header, span.cm-strong {font-weight: bold;}
|
||||
span.cm-em {font-style: italic;}
|
||||
span.cm-emstrong {font-style: italic; font-weight: bold;}
|
||||
span.cm-link {text-decoration: underline;}
|
||||
|
||||
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
|
||||
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
||||
@@ -1,191 +0,0 @@
|
||||
// the tagRangeFinder function is
|
||||
// Copyright (C) 2011 by Daniel Glazman <daniel@glazman.org>
|
||||
// released under the MIT license (../../LICENSE) like the rest of CodeMirror
|
||||
CodeMirror.tagRangeFinder = function(cm, line, hideEnd) {
|
||||
var nameStartChar = "A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
|
||||
var nameChar = nameStartChar + "\-\.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
|
||||
var xmlNAMERegExp = new RegExp("^[" + nameStartChar + "][" + nameChar + "]*");
|
||||
|
||||
var lineText = cm.getLine(line);
|
||||
var found = false;
|
||||
var tag = null;
|
||||
var pos = 0;
|
||||
while (!found) {
|
||||
pos = lineText.indexOf("<", pos);
|
||||
if (-1 == pos) // no tag on line
|
||||
return;
|
||||
if (pos + 1 < lineText.length && lineText[pos + 1] == "/") { // closing tag
|
||||
pos++;
|
||||
continue;
|
||||
}
|
||||
// ok we weem to have a start tag
|
||||
if (!lineText.substr(pos + 1).match(xmlNAMERegExp)) { // not a tag name...
|
||||
pos++;
|
||||
continue;
|
||||
}
|
||||
var gtPos = lineText.indexOf(">", pos + 1);
|
||||
if (-1 == gtPos) { // end of start tag not in line
|
||||
var l = line + 1;
|
||||
var foundGt = false;
|
||||
var lastLine = cm.lineCount();
|
||||
while (l < lastLine && !foundGt) {
|
||||
var lt = cm.getLine(l);
|
||||
var gt = lt.indexOf(">");
|
||||
if (-1 != gt) { // found a >
|
||||
foundGt = true;
|
||||
var slash = lt.lastIndexOf("/", gt);
|
||||
if (-1 != slash && slash < gt) {
|
||||
var str = lineText.substr(slash, gt - slash + 1);
|
||||
if (!str.match( /\/\s*\>/ )) { // yep, that's the end of empty tag
|
||||
if (hideEnd === true) l++;
|
||||
return l;
|
||||
}
|
||||
}
|
||||
}
|
||||
l++;
|
||||
}
|
||||
found = true;
|
||||
}
|
||||
else {
|
||||
var slashPos = lineText.lastIndexOf("/", gtPos);
|
||||
if (-1 == slashPos) { // cannot be empty tag
|
||||
found = true;
|
||||
// don't continue
|
||||
}
|
||||
else { // empty tag?
|
||||
// check if really empty tag
|
||||
var str = lineText.substr(slashPos, gtPos - slashPos + 1);
|
||||
if (!str.match( /\/\s*\>/ )) { // finally not empty
|
||||
found = true;
|
||||
// don't continue
|
||||
}
|
||||
}
|
||||
}
|
||||
if (found) {
|
||||
var subLine = lineText.substr(pos + 1);
|
||||
tag = subLine.match(xmlNAMERegExp);
|
||||
if (tag) {
|
||||
// we have an element name, wooohooo !
|
||||
tag = tag[0];
|
||||
// do we have the close tag on same line ???
|
||||
if (-1 != lineText.indexOf("</" + tag + ">", pos)) // yep
|
||||
{
|
||||
found = false;
|
||||
}
|
||||
// we don't, so we have a candidate...
|
||||
}
|
||||
else
|
||||
found = false;
|
||||
}
|
||||
if (!found)
|
||||
pos++;
|
||||
}
|
||||
|
||||
if (found) {
|
||||
var startTag = "(\\<\\/" + tag + "\\>)|(\\<" + tag + "\\>)|(\\<" + tag + "\\s)|(\\<" + tag + "$)";
|
||||
var startTagRegExp = new RegExp(startTag, "g");
|
||||
var endTag = "</" + tag + ">";
|
||||
var depth = 1;
|
||||
var l = line + 1;
|
||||
var lastLine = cm.lineCount();
|
||||
while (l < lastLine) {
|
||||
lineText = cm.getLine(l);
|
||||
var match = lineText.match(startTagRegExp);
|
||||
if (match) {
|
||||
for (var i = 0; i < match.length; i++) {
|
||||
if (match[i] == endTag)
|
||||
depth--;
|
||||
else
|
||||
depth++;
|
||||
if (!depth) {
|
||||
if (hideEnd === true) l++;
|
||||
return l;
|
||||
}
|
||||
}
|
||||
}
|
||||
l++;
|
||||
}
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
CodeMirror.braceRangeFinder = function(cm, line, hideEnd) {
|
||||
var lineText = cm.getLine(line);
|
||||
var startChar = lineText.lastIndexOf("{");
|
||||
if (startChar < 0 || lineText.lastIndexOf("}") > startChar) return;
|
||||
var tokenType = cm.getTokenAt({line: line, ch: startChar}).className;
|
||||
var count = 1, lastLine = cm.lineCount(), end;
|
||||
outer: for (var i = line + 1; i < lastLine; ++i) {
|
||||
var text = cm.getLine(i), pos = 0;
|
||||
for (;;) {
|
||||
var nextOpen = text.indexOf("{", pos), nextClose = text.indexOf("}", pos);
|
||||
if (nextOpen < 0) nextOpen = text.length;
|
||||
if (nextClose < 0) nextClose = text.length;
|
||||
pos = Math.min(nextOpen, nextClose);
|
||||
if (pos == text.length) break;
|
||||
if (cm.getTokenAt({line: i, ch: pos + 1}).className == tokenType) {
|
||||
if (pos == nextOpen) ++count;
|
||||
else if (!--count) { end = i; break outer; }
|
||||
}
|
||||
++pos;
|
||||
}
|
||||
}
|
||||
if (end == null || end == line + 1) return;
|
||||
if (hideEnd === true) end++;
|
||||
return end;
|
||||
};
|
||||
|
||||
CodeMirror.indentRangeFinder = function(cm, line) {
|
||||
var tabSize = cm.getOption("tabSize");
|
||||
var myIndent = cm.getLineHandle(line).indentation(tabSize), last;
|
||||
for (var i = line + 1, end = cm.lineCount(); i < end; ++i) {
|
||||
var handle = cm.getLineHandle(i);
|
||||
if (!/^\s*$/.test(handle.text)) {
|
||||
if (handle.indentation(tabSize) <= myIndent) break;
|
||||
last = i;
|
||||
}
|
||||
}
|
||||
if (!last) return null;
|
||||
return last + 1;
|
||||
};
|
||||
|
||||
CodeMirror.newFoldFunction = function(rangeFinder, markText, hideEnd) {
|
||||
var folded = [];
|
||||
if (markText == null) markText = '<div style="position: absolute; left: 2px; color:#600">▼</div>%N%';
|
||||
|
||||
function isFolded(cm, n) {
|
||||
for (var i = 0; i < folded.length; ++i) {
|
||||
var start = cm.lineInfo(folded[i].start);
|
||||
if (!start) folded.splice(i--, 1);
|
||||
else if (start.line == n) return {pos: i, region: folded[i]};
|
||||
}
|
||||
}
|
||||
|
||||
function expand(cm, region) {
|
||||
cm.clearMarker(region.start);
|
||||
for (var i = 0; i < region.hidden.length; ++i)
|
||||
cm.showLine(region.hidden[i]);
|
||||
}
|
||||
|
||||
return function(cm, line) {
|
||||
cm.operation(function() {
|
||||
var known = isFolded(cm, line);
|
||||
if (known) {
|
||||
folded.splice(known.pos, 1);
|
||||
expand(cm, known.region);
|
||||
} else {
|
||||
var end = rangeFinder(cm, line, hideEnd);
|
||||
if (end == null) return;
|
||||
var hidden = [];
|
||||
for (var i = line + 1; i < end; ++i) {
|
||||
var handle = cm.hideLine(i);
|
||||
if (handle) hidden.push(handle);
|
||||
}
|
||||
var first = cm.setMarker(line, markText);
|
||||
var region = {start: first, hidden: hidden};
|
||||
cm.onDeleteLine(first, function() { expand(cm, region); });
|
||||
folded.push(region);
|
||||
}
|
||||
});
|
||||
};
|
||||
};
|
||||
@@ -1,44 +0,0 @@
|
||||
// Define match-highlighter commands. Depends on searchcursor.js
|
||||
// Use by attaching the following function call to the onCursorActivity event:
|
||||
//myCodeMirror.matchHighlight(minChars);
|
||||
// And including a special span.CodeMirror-matchhighlight css class (also optionally a separate one for .CodeMirror-focused -- see demo matchhighlighter.html)
|
||||
|
||||
(function() {
|
||||
var DEFAULT_MIN_CHARS = 2;
|
||||
|
||||
function MatchHighlightState() {
|
||||
this.marked = [];
|
||||
}
|
||||
function getMatchHighlightState(cm) {
|
||||
return cm._matchHighlightState || (cm._matchHighlightState = new MatchHighlightState());
|
||||
}
|
||||
|
||||
function clearMarks(cm) {
|
||||
var state = getMatchHighlightState(cm);
|
||||
for (var i = 0; i < state.marked.length; ++i)
|
||||
state.marked[i].clear();
|
||||
state.marked = [];
|
||||
}
|
||||
|
||||
function markDocument(cm, className, minChars) {
|
||||
clearMarks(cm);
|
||||
minChars = (typeof minChars !== 'undefined' ? minChars : DEFAULT_MIN_CHARS);
|
||||
if (cm.somethingSelected() && cm.getSelection().replace(/^\s+|\s+$/g, "").length >= minChars) {
|
||||
var state = getMatchHighlightState(cm);
|
||||
var query = cm.getSelection();
|
||||
cm.operation(function() {
|
||||
if (cm.lineCount() < 2000) { // This is too expensive on big documents.
|
||||
for (var cursor = cm.getSearchCursor(query); cursor.findNext();) {
|
||||
//Only apply matchhighlight to the matches other than the one actually selected
|
||||
if (!(cursor.from().line === cm.getCursor(true).line && cursor.from().ch === cm.getCursor(true).ch))
|
||||
state.marked.push(cm.markText(cursor.from(), cursor.to(), className));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
CodeMirror.defineExtension("matchHighlight", function(className, minChars) {
|
||||
markDocument(this, className, minChars);
|
||||
});
|
||||
})();
|
||||
@@ -1,117 +0,0 @@
|
||||
(function(){
|
||||
function SearchCursor(cm, query, pos, caseFold) {
|
||||
this.atOccurrence = false; this.cm = cm;
|
||||
if (caseFold == null && typeof query == "string") caseFold = false;
|
||||
|
||||
pos = pos ? cm.clipPos(pos) : {line: 0, ch: 0};
|
||||
this.pos = {from: pos, to: pos};
|
||||
|
||||
// The matches method is filled in based on the type of query.
|
||||
// It takes a position and a direction, and returns an object
|
||||
// describing the next occurrence of the query, or null if no
|
||||
// more matches were found.
|
||||
if (typeof query != "string") // Regexp match
|
||||
this.matches = function(reverse, pos) {
|
||||
if (reverse) {
|
||||
var line = cm.getLine(pos.line).slice(0, pos.ch), match = line.match(query), start = 0;
|
||||
while (match) {
|
||||
var ind = line.indexOf(match[0]);
|
||||
start += ind;
|
||||
line = line.slice(ind + 1);
|
||||
var newmatch = line.match(query);
|
||||
if (newmatch) match = newmatch;
|
||||
else break;
|
||||
start++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
var line = cm.getLine(pos.line).slice(pos.ch), match = line.match(query),
|
||||
start = match && pos.ch + line.indexOf(match[0]);
|
||||
}
|
||||
if (match)
|
||||
return {from: {line: pos.line, ch: start},
|
||||
to: {line: pos.line, ch: start + match[0].length},
|
||||
match: match};
|
||||
};
|
||||
else { // String query
|
||||
if (caseFold) query = query.toLowerCase();
|
||||
var fold = caseFold ? function(str){return str.toLowerCase();} : function(str){return str;};
|
||||
var target = query.split("\n");
|
||||
// Different methods for single-line and multi-line queries
|
||||
if (target.length == 1)
|
||||
this.matches = function(reverse, pos) {
|
||||
var line = fold(cm.getLine(pos.line)), len = query.length, match;
|
||||
if (reverse ? (pos.ch >= len && (match = line.lastIndexOf(query, pos.ch - len)) != -1)
|
||||
: (match = line.indexOf(query, pos.ch)) != -1)
|
||||
return {from: {line: pos.line, ch: match},
|
||||
to: {line: pos.line, ch: match + len}};
|
||||
};
|
||||
else
|
||||
this.matches = function(reverse, pos) {
|
||||
var ln = pos.line, idx = (reverse ? target.length - 1 : 0), match = target[idx], line = fold(cm.getLine(ln));
|
||||
var offsetA = (reverse ? line.indexOf(match) + match.length : line.lastIndexOf(match));
|
||||
if (reverse ? offsetA >= pos.ch || offsetA != match.length
|
||||
: offsetA <= pos.ch || offsetA != line.length - match.length)
|
||||
return;
|
||||
for (;;) {
|
||||
if (reverse ? !ln : ln == cm.lineCount() - 1) return;
|
||||
line = fold(cm.getLine(ln += reverse ? -1 : 1));
|
||||
match = target[reverse ? --idx : ++idx];
|
||||
if (idx > 0 && idx < target.length - 1) {
|
||||
if (line != match) return;
|
||||
else continue;
|
||||
}
|
||||
var offsetB = (reverse ? line.lastIndexOf(match) : line.indexOf(match) + match.length);
|
||||
if (reverse ? offsetB != line.length - match.length : offsetB != match.length)
|
||||
return;
|
||||
var start = {line: pos.line, ch: offsetA}, end = {line: ln, ch: offsetB};
|
||||
return {from: reverse ? end : start, to: reverse ? start : end};
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
SearchCursor.prototype = {
|
||||
findNext: function() {return this.find(false);},
|
||||
findPrevious: function() {return this.find(true);},
|
||||
|
||||
find: function(reverse) {
|
||||
var self = this, pos = this.cm.clipPos(reverse ? this.pos.from : this.pos.to);
|
||||
function savePosAndFail(line) {
|
||||
var pos = {line: line, ch: 0};
|
||||
self.pos = {from: pos, to: pos};
|
||||
self.atOccurrence = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
if (this.pos = this.matches(reverse, pos)) {
|
||||
this.atOccurrence = true;
|
||||
return this.pos.match || true;
|
||||
}
|
||||
if (reverse) {
|
||||
if (!pos.line) return savePosAndFail(0);
|
||||
pos = {line: pos.line-1, ch: this.cm.getLine(pos.line-1).length};
|
||||
}
|
||||
else {
|
||||
var maxLine = this.cm.lineCount();
|
||||
if (pos.line == maxLine - 1) return savePosAndFail(maxLine);
|
||||
pos = {line: pos.line+1, ch: 0};
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
from: function() {if (this.atOccurrence) return this.pos.from;},
|
||||
to: function() {if (this.atOccurrence) return this.pos.to;},
|
||||
|
||||
replace: function(newText) {
|
||||
var self = this;
|
||||
if (this.atOccurrence)
|
||||
self.pos.to = this.cm.replaceRange(newText, self.pos.from, self.pos.to);
|
||||
}
|
||||
};
|
||||
|
||||
CodeMirror.defineExtension("getSearchCursor", function(query, pos, caseFold) {
|
||||
return new SearchCursor(this, query, pos, caseFold);
|
||||
});
|
||||
})();
|
||||
@@ -1,234 +0,0 @@
|
||||
CodeMirror.defineMode("clike", function(config, parserConfig) {
|
||||
var indentUnit = config.indentUnit,
|
||||
keywords = parserConfig.keywords || {},
|
||||
blockKeywords = parserConfig.blockKeywords || {},
|
||||
atoms = parserConfig.atoms || {},
|
||||
hooks = parserConfig.hooks || {},
|
||||
multiLineStrings = parserConfig.multiLineStrings;
|
||||
var isOperatorChar = /[+\-*&%=<>!?|\/]/;
|
||||
|
||||
var curPunc;
|
||||
|
||||
function tokenBase(stream, state) {
|
||||
var ch = stream.next();
|
||||
if (hooks[ch]) {
|
||||
var result = hooks[ch](stream, state);
|
||||
if (result !== false) return result;
|
||||
}
|
||||
if (ch == '"' || ch == "'") {
|
||||
state.tokenize = tokenString(ch);
|
||||
return state.tokenize(stream, state);
|
||||
}
|
||||
if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
|
||||
curPunc = ch;
|
||||
return null;
|
||||
}
|
||||
if (/\d/.test(ch)) {
|
||||
stream.eatWhile(/[\w\.]/);
|
||||
return "number";
|
||||
}
|
||||
if (ch == "/") {
|
||||
if (stream.eat("*")) {
|
||||
state.tokenize = tokenComment;
|
||||
return tokenComment(stream, state);
|
||||
}
|
||||
if (stream.eat("/")) {
|
||||
stream.skipToEnd();
|
||||
return "comment";
|
||||
}
|
||||
}
|
||||
if (isOperatorChar.test(ch)) {
|
||||
stream.eatWhile(isOperatorChar);
|
||||
return "operator";
|
||||
}
|
||||
stream.eatWhile(/[\w\$_]/);
|
||||
var cur = stream.current();
|
||||
if (keywords.propertyIsEnumerable(cur)) {
|
||||
if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
|
||||
return "keyword";
|
||||
}
|
||||
if (atoms.propertyIsEnumerable(cur)) return "atom";
|
||||
return "word";
|
||||
}
|
||||
|
||||
function tokenString(quote) {
|
||||
return function(stream, state) {
|
||||
var escaped = false, next, end = false;
|
||||
while ((next = stream.next()) != null) {
|
||||
if (next == quote && !escaped) {end = true; break;}
|
||||
escaped = !escaped && next == "\\";
|
||||
}
|
||||
if (end || !(escaped || multiLineStrings))
|
||||
state.tokenize = null;
|
||||
return "string";
|
||||
};
|
||||
}
|
||||
|
||||
function tokenComment(stream, state) {
|
||||
var maybeEnd = false, ch;
|
||||
while (ch = stream.next()) {
|
||||
if (ch == "/" && maybeEnd) {
|
||||
state.tokenize = null;
|
||||
break;
|
||||
}
|
||||
maybeEnd = (ch == "*");
|
||||
}
|
||||
return "comment";
|
||||
}
|
||||
|
||||
function Context(indented, column, type, align, prev) {
|
||||
this.indented = indented;
|
||||
this.column = column;
|
||||
this.type = type;
|
||||
this.align = align;
|
||||
this.prev = prev;
|
||||
}
|
||||
function pushContext(state, col, type) {
|
||||
return state.context = new Context(state.indented, col, type, null, state.context);
|
||||
}
|
||||
function popContext(state) {
|
||||
var t = state.context.type;
|
||||
if (t == ")" || t == "]" || t == "}")
|
||||
state.indented = state.context.indented;
|
||||
return state.context = state.context.prev;
|
||||
}
|
||||
|
||||
// Interface
|
||||
|
||||
return {
|
||||
startState: function(basecolumn) {
|
||||
return {
|
||||
tokenize: null,
|
||||
context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
|
||||
indented: 0,
|
||||
startOfLine: true
|
||||
};
|
||||
},
|
||||
|
||||
token: function(stream, state) {
|
||||
var ctx = state.context;
|
||||
if (stream.sol()) {
|
||||
if (ctx.align == null) ctx.align = false;
|
||||
state.indented = stream.indentation();
|
||||
state.startOfLine = true;
|
||||
}
|
||||
if (stream.eatSpace()) return null;
|
||||
curPunc = null;
|
||||
var style = (state.tokenize || tokenBase)(stream, state);
|
||||
if (style == "comment" || style == "meta") return style;
|
||||
if (ctx.align == null) ctx.align = true;
|
||||
|
||||
if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state);
|
||||
else if (curPunc == "{") pushContext(state, stream.column(), "}");
|
||||
else if (curPunc == "[") pushContext(state, stream.column(), "]");
|
||||
else if (curPunc == "(") pushContext(state, stream.column(), ")");
|
||||
else if (curPunc == "}") {
|
||||
while (ctx.type == "statement") ctx = popContext(state);
|
||||
if (ctx.type == "}") ctx = popContext(state);
|
||||
while (ctx.type == "statement") ctx = popContext(state);
|
||||
}
|
||||
else if (curPunc == ctx.type) popContext(state);
|
||||
else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement"))
|
||||
pushContext(state, stream.column(), "statement");
|
||||
state.startOfLine = false;
|
||||
return style;
|
||||
},
|
||||
|
||||
indent: function(state, textAfter) {
|
||||
if (state.tokenize != tokenBase && state.tokenize != null) return 0;
|
||||
var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
|
||||
if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
|
||||
var closing = firstChar == ctx.type;
|
||||
if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : indentUnit);
|
||||
else if (ctx.align) return ctx.column + (closing ? 0 : 1);
|
||||
else return ctx.indented + (closing ? 0 : indentUnit);
|
||||
},
|
||||
|
||||
electricChars: "{}"
|
||||
};
|
||||
});
|
||||
|
||||
(function() {
|
||||
function words(str) {
|
||||
var obj = {}, words = str.split(" ");
|
||||
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
|
||||
return obj;
|
||||
}
|
||||
var cKeywords = "auto if break int case long char register continue return default short do sizeof " +
|
||||
"double static else struct entry switch extern typedef float union for unsigned " +
|
||||
"goto while enum void const signed volatile";
|
||||
|
||||
function cppHook(stream, state) {
|
||||
if (!state.startOfLine) return false;
|
||||
stream.skipToEnd();
|
||||
return "meta";
|
||||
}
|
||||
|
||||
// C#-style strings where "" escapes a quote.
|
||||
function tokenAtString(stream, state) {
|
||||
var next;
|
||||
while ((next = stream.next()) != null) {
|
||||
if (next == '"' && !stream.eat('"')) {
|
||||
state.tokenize = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return "string";
|
||||
}
|
||||
|
||||
CodeMirror.defineMIME("text/x-csrc", {
|
||||
name: "clike",
|
||||
keywords: words(cKeywords),
|
||||
blockKeywords: words("case do else for if switch while struct"),
|
||||
atoms: words("null"),
|
||||
hooks: {"#": cppHook}
|
||||
});
|
||||
CodeMirror.defineMIME("text/x-c++src", {
|
||||
name: "clike",
|
||||
keywords: words(cKeywords + " asm dynamic_cast namespace reinterpret_cast try bool explicit new " +
|
||||
"static_cast typeid catch operator template typename class friend private " +
|
||||
"this using const_cast inline public throw virtual delete mutable protected " +
|
||||
"wchar_t"),
|
||||
blockKeywords: words("catch class do else finally for if struct switch try while"),
|
||||
atoms: words("true false null"),
|
||||
hooks: {"#": cppHook}
|
||||
});
|
||||
CodeMirror.defineMIME("text/x-java", {
|
||||
name: "clike",
|
||||
keywords: words("abstract assert boolean break byte case catch char class const continue default " +
|
||||
"do double else enum extends final finally float for goto if implements import " +
|
||||
"instanceof int interface long native new package private protected public " +
|
||||
"return short static strictfp super switch synchronized this throw throws transient " +
|
||||
"try void volatile while"),
|
||||
blockKeywords: words("catch class do else finally for if switch try while"),
|
||||
atoms: words("true false null"),
|
||||
hooks: {
|
||||
"@": function(stream, state) {
|
||||
stream.eatWhile(/[\w\$_]/);
|
||||
return "meta";
|
||||
}
|
||||
}
|
||||
});
|
||||
CodeMirror.defineMIME("text/x-csharp", {
|
||||
name: "clike",
|
||||
keywords: words("abstract as base bool break byte case catch char checked class const continue decimal" +
|
||||
" default delegate do double else enum event explicit extern finally fixed float for" +
|
||||
" foreach goto if implicit in int interface internal is lock long namespace new object" +
|
||||
" operator out override params private protected public readonly ref return sbyte sealed short" +
|
||||
" sizeof stackalloc static string struct switch this throw try typeof uint ulong unchecked" +
|
||||
" unsafe ushort using virtual void volatile while add alias ascending descending dynamic from get" +
|
||||
" global group into join let orderby partial remove select set value var yield"),
|
||||
blockKeywords: words("catch class do else finally for foreach if struct switch try while"),
|
||||
atoms: words("true false null"),
|
||||
hooks: {
|
||||
"@": function(stream, state) {
|
||||
if (stream.eat('"')) {
|
||||
state.tokenize = tokenAtString;
|
||||
return tokenAtString(stream, state);
|
||||
}
|
||||
stream.eatWhile(/[\w\$_]/);
|
||||
return "meta";
|
||||
}
|
||||
}
|
||||
});
|
||||
}());
|
||||
@@ -1,347 +0,0 @@
|
||||
/**
|
||||
* Link to the project's GitHub page:
|
||||
* https://github.com/pickhardt/coffeescript-codemirror-mode
|
||||
*/
|
||||
CodeMirror.defineMode('coffeescript', function(conf) {
|
||||
var ERRORCLASS = 'error';
|
||||
|
||||
function wordRegexp(words) {
|
||||
return new RegExp("^((" + words.join(")|(") + "))\\b");
|
||||
}
|
||||
|
||||
var singleOperators = new RegExp("^[\\+\\-\\*/%&|\\^~<>!\?]");
|
||||
var singleDelimiters = new RegExp('^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]');
|
||||
var doubleOperators = new RegExp("^((\->)|(\=>)|(\\+\\+)|(\\+\\=)|(\\-\\-)|(\\-\\=)|(\\*\\*)|(\\*\\=)|(\\/\\/)|(\\/\\=)|(==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//))");
|
||||
var doubleDelimiters = new RegExp("^((\\.\\.)|(\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))");
|
||||
var tripleDelimiters = new RegExp("^((\\.\\.\\.)|(//=)|(>>=)|(<<=)|(\\*\\*=))");
|
||||
var identifiers = new RegExp("^[_A-Za-z$][_A-Za-z$0-9]*");
|
||||
|
||||
var wordOperators = wordRegexp(['and', 'or', 'not',
|
||||
'is', 'isnt', 'in',
|
||||
'instanceof', 'typeof']);
|
||||
var indentKeywords = ['for', 'while', 'loop', 'if', 'unless', 'else',
|
||||
'switch', 'try', 'catch', 'finally', 'class'];
|
||||
var commonKeywords = ['break', 'by', 'continue', 'debugger', 'delete',
|
||||
'do', 'in', 'of', 'new', 'return', 'then',
|
||||
'this', 'throw', 'when', 'until'];
|
||||
|
||||
var keywords = wordRegexp(indentKeywords.concat(commonKeywords));
|
||||
|
||||
indentKeywords = wordRegexp(indentKeywords);
|
||||
|
||||
|
||||
var stringPrefixes = new RegExp("^('{3}|\"{3}|['\"])");
|
||||
var regexPrefixes = new RegExp("^(/{3}|/)");
|
||||
var commonConstants = ['Infinity', 'NaN', 'undefined', 'null', 'true', 'false', 'on', 'off', 'yes', 'no'];
|
||||
var constants = wordRegexp(commonConstants);
|
||||
|
||||
// Tokenizers
|
||||
function tokenBase(stream, state) {
|
||||
// Handle scope changes
|
||||
if (stream.sol()) {
|
||||
var scopeOffset = state.scopes[0].offset;
|
||||
if (stream.eatSpace()) {
|
||||
var lineOffset = stream.indentation();
|
||||
if (lineOffset > scopeOffset) {
|
||||
return 'indent';
|
||||
} else if (lineOffset < scopeOffset) {
|
||||
return 'dedent';
|
||||
}
|
||||
return null;
|
||||
} else {
|
||||
if (scopeOffset > 0) {
|
||||
dedent(stream, state);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (stream.eatSpace()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var ch = stream.peek();
|
||||
|
||||
// Handle docco title comment (single line)
|
||||
if (stream.match("####")) {
|
||||
stream.skipToEnd();
|
||||
return 'comment';
|
||||
}
|
||||
|
||||
// Handle multi line comments
|
||||
if (stream.match("###")) {
|
||||
state.tokenize = longComment;
|
||||
return state.tokenize(stream, state);
|
||||
}
|
||||
|
||||
// Single line comment
|
||||
if (ch === '#') {
|
||||
stream.skipToEnd();
|
||||
return 'comment';
|
||||
}
|
||||
|
||||
// Handle number literals
|
||||
if (stream.match(/^-?[0-9\.]/, false)) {
|
||||
var floatLiteral = false;
|
||||
// Floats
|
||||
if (stream.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)) {
|
||||
floatLiteral = true;
|
||||
}
|
||||
if (stream.match(/^-?\d+\.\d*/)) {
|
||||
floatLiteral = true;
|
||||
}
|
||||
if (stream.match(/^-?\.\d+/)) {
|
||||
floatLiteral = true;
|
||||
}
|
||||
|
||||
if (floatLiteral) {
|
||||
// prevent from getting extra . on 1..
|
||||
if (stream.peek() == "."){
|
||||
stream.backUp(1);
|
||||
}
|
||||
return 'number';
|
||||
}
|
||||
// Integers
|
||||
var intLiteral = false;
|
||||
// Hex
|
||||
if (stream.match(/^-?0x[0-9a-f]+/i)) {
|
||||
intLiteral = true;
|
||||
}
|
||||
// Decimal
|
||||
if (stream.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)) {
|
||||
intLiteral = true;
|
||||
}
|
||||
// Zero by itself with no other piece of number.
|
||||
if (stream.match(/^-?0(?![\dx])/i)) {
|
||||
intLiteral = true;
|
||||
}
|
||||
if (intLiteral) {
|
||||
return 'number';
|
||||
}
|
||||
}
|
||||
|
||||
// Handle strings
|
||||
if (stream.match(stringPrefixes)) {
|
||||
state.tokenize = tokenFactory(stream.current(), 'string');
|
||||
return state.tokenize(stream, state);
|
||||
}
|
||||
// Handle regex literals
|
||||
if (stream.match(regexPrefixes)) {
|
||||
if (stream.current() != '/' || stream.match(/^.*\//, false)) { // prevent highlight of division
|
||||
state.tokenize = tokenFactory(stream.current(), 'string-2');
|
||||
return state.tokenize(stream, state);
|
||||
} else {
|
||||
stream.backUp(1);
|
||||
}
|
||||
}
|
||||
|
||||
// Handle operators and delimiters
|
||||
if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters)) {
|
||||
return 'punctuation';
|
||||
}
|
||||
if (stream.match(doubleOperators)
|
||||
|| stream.match(singleOperators)
|
||||
|| stream.match(wordOperators)) {
|
||||
return 'operator';
|
||||
}
|
||||
if (stream.match(singleDelimiters)) {
|
||||
return 'punctuation';
|
||||
}
|
||||
|
||||
if (stream.match(constants)) {
|
||||
return 'atom';
|
||||
}
|
||||
|
||||
if (stream.match(keywords)) {
|
||||
return 'keyword';
|
||||
}
|
||||
|
||||
if (stream.match(identifiers)) {
|
||||
return 'variable';
|
||||
}
|
||||
|
||||
// Handle non-detected items
|
||||
stream.next();
|
||||
return ERRORCLASS;
|
||||
}
|
||||
|
||||
function tokenFactory(delimiter, outclass) {
|
||||
var singleline = delimiter.length == 1;
|
||||
return function tokenString(stream, state) {
|
||||
while (!stream.eol()) {
|
||||
stream.eatWhile(/[^'"\/\\]/);
|
||||
if (stream.eat('\\')) {
|
||||
stream.next();
|
||||
if (singleline && stream.eol()) {
|
||||
return outclass;
|
||||
}
|
||||
} else if (stream.match(delimiter)) {
|
||||
state.tokenize = tokenBase;
|
||||
return outclass;
|
||||
} else {
|
||||
stream.eat(/['"\/]/);
|
||||
}
|
||||
}
|
||||
if (singleline) {
|
||||
if (conf.mode.singleLineStringErrors) {
|
||||
outclass = ERRORCLASS
|
||||
} else {
|
||||
state.tokenize = tokenBase;
|
||||
}
|
||||
}
|
||||
return outclass;
|
||||
};
|
||||
}
|
||||
|
||||
function longComment(stream, state) {
|
||||
while (!stream.eol()) {
|
||||
stream.eatWhile(/[^#]/);
|
||||
if (stream.match("###")) {
|
||||
state.tokenize = tokenBase;
|
||||
break;
|
||||
}
|
||||
stream.eatWhile("#");
|
||||
}
|
||||
return "comment"
|
||||
}
|
||||
|
||||
function indent(stream, state, type) {
|
||||
type = type || 'coffee';
|
||||
var indentUnit = 0;
|
||||
if (type === 'coffee') {
|
||||
for (var i = 0; i < state.scopes.length; i++) {
|
||||
if (state.scopes[i].type === 'coffee') {
|
||||
indentUnit = state.scopes[i].offset + conf.indentUnit;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
indentUnit = stream.column() + stream.current().length;
|
||||
}
|
||||
state.scopes.unshift({
|
||||
offset: indentUnit,
|
||||
type: type
|
||||
});
|
||||
}
|
||||
|
||||
function dedent(stream, state) {
|
||||
if (state.scopes.length == 1) return;
|
||||
if (state.scopes[0].type === 'coffee') {
|
||||
var _indent = stream.indentation();
|
||||
var _indent_index = -1;
|
||||
for (var i = 0; i < state.scopes.length; ++i) {
|
||||
if (_indent === state.scopes[i].offset) {
|
||||
_indent_index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (_indent_index === -1) {
|
||||
return true;
|
||||
}
|
||||
while (state.scopes[0].offset !== _indent) {
|
||||
state.scopes.shift();
|
||||
}
|
||||
return false
|
||||
} else {
|
||||
state.scopes.shift();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function tokenLexer(stream, state) {
|
||||
var style = state.tokenize(stream, state);
|
||||
var current = stream.current();
|
||||
|
||||
// Handle '.' connected identifiers
|
||||
if (current === '.') {
|
||||
style = state.tokenize(stream, state);
|
||||
current = stream.current();
|
||||
if (style === 'variable') {
|
||||
return 'variable';
|
||||
} else {
|
||||
return ERRORCLASS;
|
||||
}
|
||||
}
|
||||
|
||||
// Handle properties
|
||||
if (current === '@') {
|
||||
stream.eat('@');
|
||||
return 'keyword';
|
||||
}
|
||||
|
||||
// Handle scope changes.
|
||||
if (current === 'return') {
|
||||
state.dedent += 1;
|
||||
}
|
||||
if (((current === '->' || current === '=>') &&
|
||||
!state.lambda &&
|
||||
state.scopes[0].type == 'coffee' &&
|
||||
stream.peek() === '')
|
||||
|| style === 'indent') {
|
||||
indent(stream, state);
|
||||
}
|
||||
var delimiter_index = '[({'.indexOf(current);
|
||||
if (delimiter_index !== -1) {
|
||||
indent(stream, state, '])}'.slice(delimiter_index, delimiter_index+1));
|
||||
}
|
||||
if (indentKeywords.exec(current)){
|
||||
indent(stream, state);
|
||||
}
|
||||
if (current == 'then'){
|
||||
dedent(stream, state);
|
||||
}
|
||||
|
||||
|
||||
if (style === 'dedent') {
|
||||
if (dedent(stream, state)) {
|
||||
return ERRORCLASS;
|
||||
}
|
||||
}
|
||||
delimiter_index = '])}'.indexOf(current);
|
||||
if (delimiter_index !== -1) {
|
||||
if (dedent(stream, state)) {
|
||||
return ERRORCLASS;
|
||||
}
|
||||
}
|
||||
if (state.dedent > 0 && stream.eol() && state.scopes[0].type == 'coffee') {
|
||||
if (state.scopes.length > 1) state.scopes.shift();
|
||||
state.dedent -= 1;
|
||||
}
|
||||
|
||||
return style;
|
||||
}
|
||||
|
||||
var external = {
|
||||
startState: function(basecolumn) {
|
||||
return {
|
||||
tokenize: tokenBase,
|
||||
scopes: [{offset:basecolumn || 0, type:'coffee'}],
|
||||
lastToken: null,
|
||||
lambda: false,
|
||||
dedent: 0
|
||||
};
|
||||
},
|
||||
|
||||
token: function(stream, state) {
|
||||
var style = tokenLexer(stream, state);
|
||||
|
||||
state.lastToken = {style:style, content: stream.current()};
|
||||
|
||||
if (stream.eol() && stream.lambda) {
|
||||
state.lambda = false;
|
||||
}
|
||||
|
||||
return style;
|
||||
},
|
||||
|
||||
indent: function(state, textAfter) {
|
||||
if (state.tokenize != tokenBase) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return state.scopes[0].offset;
|
||||
}
|
||||
|
||||
};
|
||||
return external;
|
||||
});
|
||||
|
||||
CodeMirror.defineMIME('text/x-coffeescript', 'coffeescript');
|
||||
@@ -1,124 +0,0 @@
|
||||
CodeMirror.defineMode("css", function(config) {
|
||||
var indentUnit = config.indentUnit, type;
|
||||
function ret(style, tp) {type = tp; return style;}
|
||||
|
||||
function tokenBase(stream, state) {
|
||||
var ch = stream.next();
|
||||
if (ch == "@") {stream.eatWhile(/[\w\\\-]/); return ret("meta", stream.current());}
|
||||
else if (ch == "/" && stream.eat("*")) {
|
||||
state.tokenize = tokenCComment;
|
||||
return tokenCComment(stream, state);
|
||||
}
|
||||
else if (ch == "<" && stream.eat("!")) {
|
||||
state.tokenize = tokenSGMLComment;
|
||||
return tokenSGMLComment(stream, state);
|
||||
}
|
||||
else if (ch == "=") ret(null, "compare");
|
||||
else if ((ch == "~" || ch == "|") && stream.eat("=")) return ret(null, "compare");
|
||||
else if (ch == "\"" || ch == "'") {
|
||||
state.tokenize = tokenString(ch);
|
||||
return state.tokenize(stream, state);
|
||||
}
|
||||
else if (ch == "#") {
|
||||
stream.eatWhile(/[\w\\\-]/);
|
||||
return ret("atom", "hash");
|
||||
}
|
||||
else if (ch == "!") {
|
||||
stream.match(/^\s*\w*/);
|
||||
return ret("keyword", "important");
|
||||
}
|
||||
else if (/\d/.test(ch)) {
|
||||
stream.eatWhile(/[\w.%]/);
|
||||
return ret("number", "unit");
|
||||
}
|
||||
else if (/[,.+>*\/]/.test(ch)) {
|
||||
return ret(null, "select-op");
|
||||
}
|
||||
else if (/[;{}:\[\]]/.test(ch)) {
|
||||
return ret(null, ch);
|
||||
}
|
||||
else {
|
||||
stream.eatWhile(/[\w\\\-]/);
|
||||
return ret("variable", "variable");
|
||||
}
|
||||
}
|
||||
|
||||
function tokenCComment(stream, state) {
|
||||
var maybeEnd = false, ch;
|
||||
while ((ch = stream.next()) != null) {
|
||||
if (maybeEnd && ch == "/") {
|
||||
state.tokenize = tokenBase;
|
||||
break;
|
||||
}
|
||||
maybeEnd = (ch == "*");
|
||||
}
|
||||
return ret("comment", "comment");
|
||||
}
|
||||
|
||||
function tokenSGMLComment(stream, state) {
|
||||
var dashes = 0, ch;
|
||||
while ((ch = stream.next()) != null) {
|
||||
if (dashes >= 2 && ch == ">") {
|
||||
state.tokenize = tokenBase;
|
||||
break;
|
||||
}
|
||||
dashes = (ch == "-") ? dashes + 1 : 0;
|
||||
}
|
||||
return ret("comment", "comment");
|
||||
}
|
||||
|
||||
function tokenString(quote) {
|
||||
return function(stream, state) {
|
||||
var escaped = false, ch;
|
||||
while ((ch = stream.next()) != null) {
|
||||
if (ch == quote && !escaped)
|
||||
break;
|
||||
escaped = !escaped && ch == "\\";
|
||||
}
|
||||
if (!escaped) state.tokenize = tokenBase;
|
||||
return ret("string", "string");
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
startState: function(base) {
|
||||
return {tokenize: tokenBase,
|
||||
baseIndent: base || 0,
|
||||
stack: []};
|
||||
},
|
||||
|
||||
token: function(stream, state) {
|
||||
if (stream.eatSpace()) return null;
|
||||
var style = state.tokenize(stream, state);
|
||||
|
||||
var context = state.stack[state.stack.length-1];
|
||||
if (type == "hash" && context != "rule") style = "string-2";
|
||||
else if (style == "variable") {
|
||||
if (context == "rule") style = "number";
|
||||
else if (!context || context == "@media{") style = "tag";
|
||||
}
|
||||
|
||||
if (context == "rule" && /^[\{\};]$/.test(type))
|
||||
state.stack.pop();
|
||||
if (type == "{") {
|
||||
if (context == "@media") state.stack[state.stack.length-1] = "@media{";
|
||||
else state.stack.push("{");
|
||||
}
|
||||
else if (type == "}") state.stack.pop();
|
||||
else if (type == "@media") state.stack.push("@media");
|
||||
else if (context == "{" && type != "comment") state.stack.push("rule");
|
||||
return style;
|
||||
},
|
||||
|
||||
indent: function(state, textAfter) {
|
||||
var n = state.stack.length;
|
||||
if (/^\}/.test(textAfter))
|
||||
n -= state.stack[state.stack.length-1] == "rule" ? 2 : 1;
|
||||
return state.baseIndent + n * indentUnit;
|
||||
},
|
||||
|
||||
electricChars: "}"
|
||||
};
|
||||
});
|
||||
|
||||
CodeMirror.defineMIME("text/css", "css");
|
||||
@@ -1,361 +0,0 @@
|
||||
CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
||||
var indentUnit = config.indentUnit;
|
||||
var jsonMode = parserConfig.json;
|
||||
|
||||
// Tokenizer
|
||||
|
||||
var keywords = function(){
|
||||
function kw(type) {return {type: type, style: "keyword"};}
|
||||
var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c");
|
||||
var operator = kw("operator"), atom = {type: "atom", style: "atom"};
|
||||
return {
|
||||
"if": A, "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B,
|
||||
"return": C, "break": C, "continue": C, "new": C, "delete": C, "throw": C,
|
||||
"var": kw("var"), "const": kw("var"), "let": kw("var"),
|
||||
"function": kw("function"), "catch": kw("catch"),
|
||||
"for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),
|
||||
"in": operator, "typeof": operator, "instanceof": operator,
|
||||
"true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom
|
||||
};
|
||||
}();
|
||||
|
||||
var isOperatorChar = /[+\-*&%=<>!?|]/;
|
||||
|
||||
function chain(stream, state, f) {
|
||||
state.tokenize = f;
|
||||
return f(stream, state);
|
||||
}
|
||||
|
||||
function nextUntilUnescaped(stream, end) {
|
||||
var escaped = false, next;
|
||||
while ((next = stream.next()) != null) {
|
||||
if (next == end && !escaped)
|
||||
return false;
|
||||
escaped = !escaped && next == "\\";
|
||||
}
|
||||
return escaped;
|
||||
}
|
||||
|
||||
// Used as scratch variables to communicate multiple values without
|
||||
// consing up tons of objects.
|
||||
var type, content;
|
||||
function ret(tp, style, cont) {
|
||||
type = tp; content = cont;
|
||||
return style;
|
||||
}
|
||||
|
||||
function jsTokenBase(stream, state) {
|
||||
var ch = stream.next();
|
||||
if (ch == '"' || ch == "'")
|
||||
return chain(stream, state, jsTokenString(ch));
|
||||
else if (/[\[\]{}\(\),;\:\.]/.test(ch))
|
||||
return ret(ch);
|
||||
else if (ch == "0" && stream.eat(/x/i)) {
|
||||
stream.eatWhile(/[\da-f]/i);
|
||||
return ret("number", "number");
|
||||
}
|
||||
else if (/\d/.test(ch) || ch == "-" && stream.eat(/\d/)) {
|
||||
stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);
|
||||
return ret("number", "number");
|
||||
}
|
||||
else if (ch == "/") {
|
||||
if (stream.eat("*")) {
|
||||
return chain(stream, state, jsTokenComment);
|
||||
}
|
||||
else if (stream.eat("/")) {
|
||||
stream.skipToEnd();
|
||||
return ret("comment", "comment");
|
||||
}
|
||||
else if (state.reAllowed) {
|
||||
nextUntilUnescaped(stream, "/");
|
||||
stream.eatWhile(/[gimy]/); // 'y' is "sticky" option in Mozilla
|
||||
return ret("regexp", "string-2");
|
||||
}
|
||||
else {
|
||||
stream.eatWhile(isOperatorChar);
|
||||
return ret("operator", null, stream.current());
|
||||
}
|
||||
}
|
||||
else if (ch == "#") {
|
||||
stream.skipToEnd();
|
||||
return ret("error", "error");
|
||||
}
|
||||
else if (isOperatorChar.test(ch)) {
|
||||
stream.eatWhile(isOperatorChar);
|
||||
return ret("operator", null, stream.current());
|
||||
}
|
||||
else {
|
||||
stream.eatWhile(/[\w\$_]/);
|
||||
var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word];
|
||||
return (known && state.kwAllowed) ? ret(known.type, known.style, word) :
|
||||
ret("variable", "variable", word);
|
||||
}
|
||||
}
|
||||
|
||||
function jsTokenString(quote) {
|
||||
return function(stream, state) {
|
||||
if (!nextUntilUnescaped(stream, quote))
|
||||
state.tokenize = jsTokenBase;
|
||||
return ret("string", "string");
|
||||
};
|
||||
}
|
||||
|
||||
function jsTokenComment(stream, state) {
|
||||
var maybeEnd = false, ch;
|
||||
while (ch = stream.next()) {
|
||||
if (ch == "/" && maybeEnd) {
|
||||
state.tokenize = jsTokenBase;
|
||||
break;
|
||||
}
|
||||
maybeEnd = (ch == "*");
|
||||
}
|
||||
return ret("comment", "comment");
|
||||
}
|
||||
|
||||
// Parser
|
||||
|
||||
var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true};
|
||||
|
||||
function JSLexical(indented, column, type, align, prev, info) {
|
||||
this.indented = indented;
|
||||
this.column = column;
|
||||
this.type = type;
|
||||
this.prev = prev;
|
||||
this.info = info;
|
||||
if (align != null) this.align = align;
|
||||
}
|
||||
|
||||
function inScope(state, varname) {
|
||||
for (var v = state.localVars; v; v = v.next)
|
||||
if (v.name == varname) return true;
|
||||
}
|
||||
|
||||
function parseJS(state, style, type, content, stream) {
|
||||
var cc = state.cc;
|
||||
// Communicate our context to the combinators.
|
||||
// (Less wasteful than consing up a hundred closures on every call.)
|
||||
cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc;
|
||||
|
||||
if (!state.lexical.hasOwnProperty("align"))
|
||||
state.lexical.align = true;
|
||||
|
||||
while(true) {
|
||||
var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;
|
||||
if (combinator(type, content)) {
|
||||
while(cc.length && cc[cc.length - 1].lex)
|
||||
cc.pop()();
|
||||
if (cx.marked) return cx.marked;
|
||||
if (type == "variable" && inScope(state, content)) return "variable-2";
|
||||
return style;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Combinator utils
|
||||
|
||||
var cx = {state: null, column: null, marked: null, cc: null};
|
||||
function pass() {
|
||||
for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);
|
||||
}
|
||||
function cont() {
|
||||
pass.apply(null, arguments);
|
||||
return true;
|
||||
}
|
||||
function register(varname) {
|
||||
var state = cx.state;
|
||||
if (state.context) {
|
||||
cx.marked = "def";
|
||||
for (var v = state.localVars; v; v = v.next)
|
||||
if (v.name == varname) return;
|
||||
state.localVars = {name: varname, next: state.localVars};
|
||||
}
|
||||
}
|
||||
|
||||
// Combinators
|
||||
|
||||
var defaultVars = {name: "this", next: {name: "arguments"}};
|
||||
function pushcontext() {
|
||||
if (!cx.state.context) cx.state.localVars = defaultVars;
|
||||
cx.state.context = {prev: cx.state.context, vars: cx.state.localVars};
|
||||
}
|
||||
function popcontext() {
|
||||
cx.state.localVars = cx.state.context.vars;
|
||||
cx.state.context = cx.state.context.prev;
|
||||
}
|
||||
function pushlex(type, info) {
|
||||
var result = function() {
|
||||
var state = cx.state;
|
||||
state.lexical = new JSLexical(state.indented, cx.stream.column(), type, null, state.lexical, info)
|
||||
};
|
||||
result.lex = true;
|
||||
return result;
|
||||
}
|
||||
function poplex() {
|
||||
var state = cx.state;
|
||||
if (state.lexical.prev) {
|
||||
if (state.lexical.type == ")")
|
||||
state.indented = state.lexical.indented;
|
||||
state.lexical = state.lexical.prev;
|
||||
}
|
||||
}
|
||||
poplex.lex = true;
|
||||
|
||||
function expect(wanted) {
|
||||
return function expecting(type) {
|
||||
if (type == wanted) return cont();
|
||||
else if (wanted == ";") return pass();
|
||||
else return cont(arguments.callee);
|
||||
};
|
||||
}
|
||||
|
||||
function statement(type) {
|
||||
if (type == "var") return cont(pushlex("vardef"), vardef1, expect(";"), poplex);
|
||||
if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex);
|
||||
if (type == "keyword b") return cont(pushlex("form"), statement, poplex);
|
||||
if (type == "{") return cont(pushlex("}"), block, poplex);
|
||||
if (type == ";") return cont();
|
||||
if (type == "function") return cont(functiondef);
|
||||
if (type == "for") return cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"),
|
||||
poplex, statement, poplex);
|
||||
if (type == "variable") return cont(pushlex("stat"), maybelabel);
|
||||
if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"),
|
||||
block, poplex, poplex);
|
||||
if (type == "case") return cont(expression, expect(":"));
|
||||
if (type == "default") return cont(expect(":"));
|
||||
if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"),
|
||||
statement, poplex, popcontext);
|
||||
return pass(pushlex("stat"), expression, expect(";"), poplex);
|
||||
}
|
||||
function expression(type) {
|
||||
if (atomicTypes.hasOwnProperty(type)) return cont(maybeoperator);
|
||||
if (type == "function") return cont(functiondef);
|
||||
if (type == "keyword c") return cont(maybeexpression);
|
||||
if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeoperator);
|
||||
if (type == "operator") return cont(expression);
|
||||
if (type == "[") return cont(pushlex("]"), commasep(expression, "]"), poplex, maybeoperator);
|
||||
if (type == "{") return cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeoperator);
|
||||
return cont();
|
||||
}
|
||||
function maybeexpression(type) {
|
||||
if (type.match(/[;\}\)\],]/)) return pass();
|
||||
return pass(expression);
|
||||
}
|
||||
|
||||
function maybeoperator(type, value) {
|
||||
if (type == "operator" && /\+\+|--/.test(value)) return cont(maybeoperator);
|
||||
if (type == "operator" || type == ":") return cont(expression);
|
||||
if (type == ";") return;
|
||||
if (type == "(") return cont(pushlex(")"), commasep(expression, ")"), poplex, maybeoperator);
|
||||
if (type == ".") return cont(property, maybeoperator);
|
||||
if (type == "[") return cont(pushlex("]"), expression, expect("]"), poplex, maybeoperator);
|
||||
}
|
||||
function maybelabel(type) {
|
||||
if (type == ":") return cont(poplex, statement);
|
||||
return pass(maybeoperator, expect(";"), poplex);
|
||||
}
|
||||
function property(type) {
|
||||
if (type == "variable") {cx.marked = "property"; return cont();}
|
||||
}
|
||||
function objprop(type) {
|
||||
if (type == "variable") cx.marked = "property";
|
||||
if (atomicTypes.hasOwnProperty(type)) return cont(expect(":"), expression);
|
||||
}
|
||||
function commasep(what, end) {
|
||||
function proceed(type) {
|
||||
if (type == ",") return cont(what, proceed);
|
||||
if (type == end) return cont();
|
||||
return cont(expect(end));
|
||||
}
|
||||
return function commaSeparated(type) {
|
||||
if (type == end) return cont();
|
||||
else return pass(what, proceed);
|
||||
};
|
||||
}
|
||||
function block(type) {
|
||||
if (type == "}") return cont();
|
||||
return pass(statement, block);
|
||||
}
|
||||
function vardef1(type, value) {
|
||||
if (type == "variable"){register(value); return cont(vardef2);}
|
||||
return cont();
|
||||
}
|
||||
function vardef2(type, value) {
|
||||
if (value == "=") return cont(expression, vardef2);
|
||||
if (type == ",") return cont(vardef1);
|
||||
}
|
||||
function forspec1(type) {
|
||||
if (type == "var") return cont(vardef1, forspec2);
|
||||
if (type == ";") return pass(forspec2);
|
||||
if (type == "variable") return cont(formaybein);
|
||||
return pass(forspec2);
|
||||
}
|
||||
function formaybein(type, value) {
|
||||
if (value == "in") return cont(expression);
|
||||
return cont(maybeoperator, forspec2);
|
||||
}
|
||||
function forspec2(type, value) {
|
||||
if (type == ";") return cont(forspec3);
|
||||
if (value == "in") return cont(expression);
|
||||
return cont(expression, expect(";"), forspec3);
|
||||
}
|
||||
function forspec3(type) {
|
||||
if (type != ")") cont(expression);
|
||||
}
|
||||
function functiondef(type, value) {
|
||||
if (type == "variable") {register(value); return cont(functiondef);}
|
||||
if (type == "(") return cont(pushlex(")"), pushcontext, commasep(funarg, ")"), poplex, statement, popcontext);
|
||||
}
|
||||
function funarg(type, value) {
|
||||
if (type == "variable") {register(value); return cont();}
|
||||
}
|
||||
|
||||
// Interface
|
||||
|
||||
return {
|
||||
startState: function(basecolumn) {
|
||||
return {
|
||||
tokenize: jsTokenBase,
|
||||
reAllowed: true,
|
||||
kwAllowed: true,
|
||||
cc: [],
|
||||
lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false),
|
||||
localVars: parserConfig.localVars,
|
||||
context: parserConfig.localVars && {vars: parserConfig.localVars},
|
||||
indented: 0
|
||||
};
|
||||
},
|
||||
|
||||
token: function(stream, state) {
|
||||
if (stream.sol()) {
|
||||
if (!state.lexical.hasOwnProperty("align"))
|
||||
state.lexical.align = false;
|
||||
state.indented = stream.indentation();
|
||||
}
|
||||
if (stream.eatSpace()) return null;
|
||||
var style = state.tokenize(stream, state);
|
||||
if (type == "comment") return style;
|
||||
state.reAllowed = !!(type == "operator" || type == "keyword c" || type.match(/^[\[{}\(,;:]$/));
|
||||
state.kwAllowed = type != '.';
|
||||
return parseJS(state, style, type, content, stream);
|
||||
},
|
||||
|
||||
indent: function(state, textAfter) {
|
||||
if (state.tokenize != jsTokenBase) return 0;
|
||||
var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical;
|
||||
if (lexical.type == "stat" && firstChar == "}") lexical = lexical.prev;
|
||||
var type = lexical.type, closing = firstChar == type;
|
||||
if (type == "vardef") return lexical.indented + 4;
|
||||
else if (type == "form" && firstChar == "{") return lexical.indented;
|
||||
else if (type == "stat" || type == "form") return lexical.indented + indentUnit;
|
||||
else if (lexical.info == "switch" && !closing)
|
||||
return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit);
|
||||
else if (lexical.align) return lexical.column + (closing ? 0 : 1);
|
||||
else return lexical.indented + (closing ? 0 : indentUnit);
|
||||
},
|
||||
|
||||
electricChars: ":{}"
|
||||
};
|
||||
});
|
||||
|
||||
CodeMirror.defineMIME("text/javascript", "javascript");
|
||||
CodeMirror.defineMIME("application/json", {name: "javascript", json: true});
|
||||
@@ -1,150 +0,0 @@
|
||||
(function() {
|
||||
function keywords(str) {
|
||||
var obj = {}, words = str.split(" ");
|
||||
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
|
||||
return obj;
|
||||
}
|
||||
function heredoc(delim) {
|
||||
return function(stream, state) {
|
||||
if (stream.match(delim)) state.tokenize = null;
|
||||
else stream.skipToEnd();
|
||||
return "string";
|
||||
}
|
||||
}
|
||||
var phpConfig = {
|
||||
name: "clike",
|
||||
keywords: keywords("abstract and array as break case catch class clone const continue declare default " +
|
||||
"do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final " +
|
||||
"for foreach function global goto if implements interface instanceof namespace " +
|
||||
"new or private protected public static switch throw trait try use var while xor " +
|
||||
"die echo empty exit eval include include_once isset list require require_once return " +
|
||||
"print unset __halt_compiler self static parent"),
|
||||
blockKeywords: keywords("catch do else elseif for foreach if switch try while"),
|
||||
atoms: keywords("true false null TRUE FALSE NULL"),
|
||||
multiLineStrings: true,
|
||||
hooks: {
|
||||
"$": function(stream, state) {
|
||||
stream.eatWhile(/[\w\$_]/);
|
||||
return "variable-2";
|
||||
},
|
||||
"<": function(stream, state) {
|
||||
if (stream.match(/<</)) {
|
||||
stream.eatWhile(/[\w\.]/);
|
||||
state.tokenize = heredoc(stream.current().slice(3));
|
||||
return state.tokenize(stream, state);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
"#": function(stream, state) {
|
||||
while (!stream.eol() && !stream.match("?>", false)) stream.next();
|
||||
return "comment";
|
||||
},
|
||||
"/": function(stream, state) {
|
||||
if (stream.eat("/")) {
|
||||
while (!stream.eol() && !stream.match("?>", false)) stream.next();
|
||||
return "comment";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CodeMirror.defineMode("php", function(config, parserConfig) {
|
||||
var htmlMode = CodeMirror.getMode(config, {name: "xml", htmlMode: true});
|
||||
var jsMode = CodeMirror.getMode(config, "javascript");
|
||||
var cssMode = CodeMirror.getMode(config, "css");
|
||||
var phpMode = CodeMirror.getMode(config, phpConfig);
|
||||
|
||||
function dispatch(stream, state) { // TODO open PHP inside text/css
|
||||
var isPHP = state.mode == "php";
|
||||
if (stream.sol() && state.pending != '"') state.pending = null;
|
||||
if (state.curMode == htmlMode) {
|
||||
if (stream.match(/^<\?\w*/)) {
|
||||
state.curMode = phpMode;
|
||||
state.curState = state.php;
|
||||
state.curClose = "?>";
|
||||
state.mode = "php";
|
||||
return "meta";
|
||||
}
|
||||
if (state.pending == '"') {
|
||||
while (!stream.eol() && stream.next() != '"') {}
|
||||
var style = "string";
|
||||
} else if (state.pending && stream.pos < state.pending.end) {
|
||||
stream.pos = state.pending.end;
|
||||
var style = state.pending.style;
|
||||
} else {
|
||||
var style = htmlMode.token(stream, state.curState);
|
||||
}
|
||||
state.pending = null;
|
||||
var cur = stream.current(), openPHP = cur.search(/<\?/);
|
||||
if (openPHP != -1) {
|
||||
if (style == "string" && /\"$/.test(cur) && !/\?>/.test(cur)) state.pending = '"';
|
||||
else state.pending = {end: stream.pos, style: style};
|
||||
stream.backUp(cur.length - openPHP);
|
||||
} else if (style == "tag" && stream.current() == ">" && state.curState.context) {
|
||||
if (/^script$/i.test(state.curState.context.tagName)) {
|
||||
state.curMode = jsMode;
|
||||
state.curState = jsMode.startState(htmlMode.indent(state.curState, ""));
|
||||
state.curClose = /^<\/\s*script\s*>/i;
|
||||
state.mode = "javascript";
|
||||
}
|
||||
else if (/^style$/i.test(state.curState.context.tagName)) {
|
||||
state.curMode = cssMode;
|
||||
state.curState = cssMode.startState(htmlMode.indent(state.curState, ""));
|
||||
state.curClose = /^<\/\s*style\s*>/i;
|
||||
state.mode = "css";
|
||||
}
|
||||
}
|
||||
return style;
|
||||
} else if ((!isPHP || state.php.tokenize == null) &&
|
||||
stream.match(state.curClose, isPHP)) {
|
||||
state.curMode = htmlMode;
|
||||
state.curState = state.html;
|
||||
state.curClose = null;
|
||||
state.mode = "html";
|
||||
if (isPHP) return "meta";
|
||||
else return dispatch(stream, state);
|
||||
} else {
|
||||
return state.curMode.token(stream, state.curState);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
startState: function() {
|
||||
var html = htmlMode.startState();
|
||||
return {html: html,
|
||||
php: phpMode.startState(),
|
||||
curMode: parserConfig.startOpen ? phpMode : htmlMode,
|
||||
curState: parserConfig.startOpen ? phpMode.startState() : html,
|
||||
curClose: parserConfig.startOpen ? /^\?>/ : null,
|
||||
mode: parserConfig.startOpen ? "php" : "html",
|
||||
pending: null}
|
||||
},
|
||||
|
||||
copyState: function(state) {
|
||||
var html = state.html, htmlNew = CodeMirror.copyState(htmlMode, html),
|
||||
php = state.php, phpNew = CodeMirror.copyState(phpMode, php), cur;
|
||||
if (state.curState == html) cur = htmlNew;
|
||||
else if (state.curState == php) cur = phpNew;
|
||||
else cur = CodeMirror.copyState(state.curMode, state.curState);
|
||||
return {html: htmlNew, php: phpNew, curMode: state.curMode, curState: cur,
|
||||
curClose: state.curClose, mode: state.mode,
|
||||
pending: state.pending};
|
||||
},
|
||||
|
||||
token: dispatch,
|
||||
|
||||
indent: function(state, textAfter) {
|
||||
if ((state.curMode != phpMode && /^\s*<\//.test(textAfter)) ||
|
||||
(state.curMode == phpMode && /^\?>/.test(textAfter)))
|
||||
return htmlMode.indent(state.html, textAfter);
|
||||
return state.curMode.indent(state.curState, textAfter);
|
||||
},
|
||||
|
||||
electricChars: "/{}:"
|
||||
}
|
||||
}, "xml", "clike", "javascript", "css");
|
||||
CodeMirror.defineMIME("application/x-httpd-php", "php");
|
||||
CodeMirror.defineMIME("application/x-httpd-php-open", {name: "php", startOpen: true});
|
||||
CodeMirror.defineMIME("text/x-php", phpConfig);
|
||||
})();
|
||||
@@ -1,24 +0,0 @@
|
||||
Copyright (c) 2011, Ubalo, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the Ubalo, Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL UBALO, INC BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -1,200 +0,0 @@
|
||||
CodeMirror.defineMode("ruby", function(config, parserConfig) {
|
||||
function wordObj(words) {
|
||||
var o = {};
|
||||
for (var i = 0, e = words.length; i < e; ++i) o[words[i]] = true;
|
||||
return o;
|
||||
}
|
||||
var keywords = wordObj([
|
||||
"alias", "and", "BEGIN", "begin", "break", "case", "class", "def", "defined?", "do", "else",
|
||||
"elsif", "END", "end", "ensure", "false", "for", "if", "in", "module", "next", "not", "or",
|
||||
"redo", "rescue", "retry", "return", "self", "super", "then", "true", "undef", "unless",
|
||||
"until", "when", "while", "yield", "nil", "raise", "throw", "catch", "fail", "loop", "callcc",
|
||||
"caller", "lambda", "proc", "public", "protected", "private", "require", "load",
|
||||
"require_relative", "extend", "autoload"
|
||||
]);
|
||||
var indentWords = wordObj(["def", "class", "case", "for", "while", "do", "module", "then",
|
||||
"catch", "loop", "proc", "begin"]);
|
||||
var dedentWords = wordObj(["end", "until"]);
|
||||
var matching = {"[": "]", "{": "}", "(": ")"};
|
||||
var curPunc;
|
||||
|
||||
function chain(newtok, stream, state) {
|
||||
state.tokenize.push(newtok);
|
||||
return newtok(stream, state);
|
||||
}
|
||||
|
||||
function tokenBase(stream, state) {
|
||||
curPunc = null;
|
||||
if (stream.sol() && stream.match("=begin") && stream.eol()) {
|
||||
state.tokenize.push(readBlockComment);
|
||||
return "comment";
|
||||
}
|
||||
if (stream.eatSpace()) return null;
|
||||
var ch = stream.next();
|
||||
if (ch == "`" || ch == "'" || ch == '"' ||
|
||||
(ch == "/" && !stream.eol() && stream.peek() != " ")) {
|
||||
return chain(readQuoted(ch, "string", ch == '"' || ch == "`"), stream, state);
|
||||
} else if (ch == "%") {
|
||||
var style, embed = false;
|
||||
if (stream.eat("s")) style = "atom";
|
||||
else if (stream.eat(/[WQ]/)) { style = "string"; embed = true; }
|
||||
else if (stream.eat(/[wxqr]/)) style = "string";
|
||||
var delim = stream.eat(/[^\w\s]/);
|
||||
if (!delim) return "operator";
|
||||
if (matching.propertyIsEnumerable(delim)) delim = matching[delim];
|
||||
return chain(readQuoted(delim, style, embed, true), stream, state);
|
||||
} else if (ch == "#") {
|
||||
stream.skipToEnd();
|
||||
return "comment";
|
||||
} else if (ch == "<" && stream.eat("<")) {
|
||||
stream.eat("-");
|
||||
stream.eat(/[\'\"\`]/);
|
||||
var match = stream.match(/^\w+/);
|
||||
stream.eat(/[\'\"\`]/);
|
||||
if (match) return chain(readHereDoc(match[0]), stream, state);
|
||||
return null;
|
||||
} else if (ch == "0") {
|
||||
if (stream.eat("x")) stream.eatWhile(/[\da-fA-F]/);
|
||||
else if (stream.eat("b")) stream.eatWhile(/[01]/);
|
||||
else stream.eatWhile(/[0-7]/);
|
||||
return "number";
|
||||
} else if (/\d/.test(ch)) {
|
||||
stream.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/);
|
||||
return "number";
|
||||
} else if (ch == "?") {
|
||||
while (stream.match(/^\\[CM]-/)) {}
|
||||
if (stream.eat("\\")) stream.eatWhile(/\w/);
|
||||
else stream.next();
|
||||
return "string";
|
||||
} else if (ch == ":") {
|
||||
if (stream.eat("'")) return chain(readQuoted("'", "atom", false), stream, state);
|
||||
if (stream.eat('"')) return chain(readQuoted('"', "atom", true), stream, state);
|
||||
stream.eatWhile(/[\w\?]/);
|
||||
return "atom";
|
||||
} else if (ch == "@") {
|
||||
stream.eat("@");
|
||||
stream.eatWhile(/[\w\?]/);
|
||||
return "variable-2";
|
||||
} else if (ch == "$") {
|
||||
stream.next();
|
||||
stream.eatWhile(/[\w\?]/);
|
||||
return "variable-3";
|
||||
} else if (/\w/.test(ch)) {
|
||||
stream.eatWhile(/[\w\?]/);
|
||||
if (stream.eat(":")) return "atom";
|
||||
return "ident";
|
||||
} else if (ch == "|" && (state.varList || state.lastTok == "{" || state.lastTok == "do")) {
|
||||
curPunc = "|";
|
||||
return null;
|
||||
} else if (/[\(\)\[\]{}\\;]/.test(ch)) {
|
||||
curPunc = ch;
|
||||
return null;
|
||||
} else if (ch == "-" && stream.eat(">")) {
|
||||
return "arrow";
|
||||
} else if (/[=+\-\/*:\.^%<>~|]/.test(ch)) {
|
||||
stream.eatWhile(/[=+\-\/*:\.^%<>~|]/);
|
||||
return "operator";
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function tokenBaseUntilBrace() {
|
||||
var depth = 1;
|
||||
return function(stream, state) {
|
||||
if (stream.peek() == "}") {
|
||||
depth--;
|
||||
if (depth == 0) {
|
||||
state.tokenize.pop();
|
||||
return state.tokenize[state.tokenize.length-1](stream, state);
|
||||
}
|
||||
} else if (stream.peek() == "{") {
|
||||
depth++;
|
||||
}
|
||||
return tokenBase(stream, state);
|
||||
};
|
||||
}
|
||||
function readQuoted(quote, style, embed, unescaped) {
|
||||
return function(stream, state) {
|
||||
var escaped = false, ch;
|
||||
while ((ch = stream.next()) != null) {
|
||||
if (ch == quote && (unescaped || !escaped)) {
|
||||
state.tokenize.pop();
|
||||
break;
|
||||
}
|
||||
if (embed && ch == "#" && !escaped && stream.eat("{")) {
|
||||
state.tokenize.push(tokenBaseUntilBrace(arguments.callee));
|
||||
break;
|
||||
}
|
||||
escaped = !escaped && ch == "\\";
|
||||
}
|
||||
return style;
|
||||
};
|
||||
}
|
||||
function readHereDoc(phrase) {
|
||||
return function(stream, state) {
|
||||
if (stream.match(phrase)) state.tokenize.pop();
|
||||
else stream.skipToEnd();
|
||||
return "string";
|
||||
};
|
||||
}
|
||||
function readBlockComment(stream, state) {
|
||||
if (stream.sol() && stream.match("=end") && stream.eol())
|
||||
state.tokenize.pop();
|
||||
stream.skipToEnd();
|
||||
return "comment";
|
||||
}
|
||||
|
||||
return {
|
||||
startState: function() {
|
||||
return {tokenize: [tokenBase],
|
||||
indented: 0,
|
||||
context: {type: "top", indented: -config.indentUnit},
|
||||
continuedLine: false,
|
||||
lastTok: null,
|
||||
varList: false};
|
||||
},
|
||||
|
||||
token: function(stream, state) {
|
||||
if (stream.sol()) state.indented = stream.indentation();
|
||||
var style = state.tokenize[state.tokenize.length-1](stream, state), kwtype;
|
||||
if (style == "ident") {
|
||||
var word = stream.current();
|
||||
style = keywords.propertyIsEnumerable(stream.current()) ? "keyword"
|
||||
: /^[A-Z]/.test(word) ? "tag"
|
||||
: (state.lastTok == "def" || state.lastTok == "class" || state.varList) ? "def"
|
||||
: "variable";
|
||||
if (indentWords.propertyIsEnumerable(word)) kwtype = "indent";
|
||||
else if (dedentWords.propertyIsEnumerable(word)) kwtype = "dedent";
|
||||
else if ((word == "if" || word == "unless") && stream.column() == stream.indentation())
|
||||
kwtype = "indent";
|
||||
}
|
||||
if (curPunc || (style && style != "comment")) state.lastTok = word || curPunc || style;
|
||||
if (curPunc == "|") state.varList = !state.varList;
|
||||
|
||||
if (kwtype == "indent" || /[\(\[\{]/.test(curPunc))
|
||||
state.context = {prev: state.context, type: curPunc || style, indented: state.indented};
|
||||
else if ((kwtype == "dedent" || /[\)\]\}]/.test(curPunc)) && state.context.prev)
|
||||
state.context = state.context.prev;
|
||||
|
||||
if (stream.eol())
|
||||
state.continuedLine = (curPunc == "\\" || style == "operator");
|
||||
return style;
|
||||
},
|
||||
|
||||
indent: function(state, textAfter) {
|
||||
if (state.tokenize[state.tokenize.length-1] != tokenBase) return 0;
|
||||
var firstChar = textAfter && textAfter.charAt(0);
|
||||
var ct = state.context;
|
||||
var closing = ct.type == matching[firstChar] ||
|
||||
ct.type == "keyword" && /^(?:end|until|else|elsif|when|rescue)\b/.test(textAfter);
|
||||
return ct.indented + (closing ? 0 : config.indentUnit) +
|
||||
(state.continuedLine ? config.indentUnit : 0);
|
||||
},
|
||||
electricChars: "}de" // enD and rescuE
|
||||
|
||||
};
|
||||
});
|
||||
|
||||
CodeMirror.defineMIME("text/x-ruby", "ruby");
|
||||
|
||||
@@ -1,325 +0,0 @@
|
||||
CodeMirror.defineMode("xml", function(config, parserConfig) {
|
||||
var indentUnit = config.indentUnit;
|
||||
var Kludges = parserConfig.htmlMode ? {
|
||||
autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,
|
||||
'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,
|
||||
'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,
|
||||
'track': true, 'wbr': true},
|
||||
implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,
|
||||
'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,
|
||||
'th': true, 'tr': true},
|
||||
contextGrabbers: {
|
||||
'dd': {'dd': true, 'dt': true},
|
||||
'dt': {'dd': true, 'dt': true},
|
||||
'li': {'li': true},
|
||||
'option': {'option': true, 'optgroup': true},
|
||||
'optgroup': {'optgroup': true},
|
||||
'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,
|
||||
'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,
|
||||
'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,
|
||||
'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,
|
||||
'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},
|
||||
'rp': {'rp': true, 'rt': true},
|
||||
'rt': {'rp': true, 'rt': true},
|
||||
'tbody': {'tbody': true, 'tfoot': true},
|
||||
'td': {'td': true, 'th': true},
|
||||
'tfoot': {'tbody': true},
|
||||
'th': {'td': true, 'th': true},
|
||||
'thead': {'tbody': true, 'tfoot': true},
|
||||
'tr': {'tr': true}
|
||||
},
|
||||
doNotIndent: {"pre": true},
|
||||
allowUnquoted: true,
|
||||
allowMissing: false
|
||||
} : {
|
||||
autoSelfClosers: {},
|
||||
implicitlyClosed: {},
|
||||
contextGrabbers: {},
|
||||
doNotIndent: {},
|
||||
allowUnquoted: false,
|
||||
allowMissing: false
|
||||
};
|
||||
var alignCDATA = parserConfig.alignCDATA;
|
||||
|
||||
// Return variables for tokenizers
|
||||
var tagName, type;
|
||||
|
||||
function inText(stream, state) {
|
||||
function chain(parser) {
|
||||
state.tokenize = parser;
|
||||
return parser(stream, state);
|
||||
}
|
||||
|
||||
var ch = stream.next();
|
||||
if (ch == "<") {
|
||||
if (stream.eat("!")) {
|
||||
if (stream.eat("[")) {
|
||||
if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>"));
|
||||
else return null;
|
||||
}
|
||||
else if (stream.match("--")) return chain(inBlock("comment", "-->"));
|
||||
else if (stream.match("DOCTYPE", true, true)) {
|
||||
stream.eatWhile(/[\w\._\-]/);
|
||||
return chain(doctype(1));
|
||||
}
|
||||
else return null;
|
||||
}
|
||||
else if (stream.eat("?")) {
|
||||
stream.eatWhile(/[\w\._\-]/);
|
||||
state.tokenize = inBlock("meta", "?>");
|
||||
return "meta";
|
||||
}
|
||||
else {
|
||||
type = stream.eat("/") ? "closeTag" : "openTag";
|
||||
stream.eatSpace();
|
||||
tagName = "";
|
||||
var c;
|
||||
while ((c = stream.eat(/[^\s\u00a0=<>\"\'\/?]/))) tagName += c;
|
||||
state.tokenize = inTag;
|
||||
return "tag";
|
||||
}
|
||||
}
|
||||
else if (ch == "&") {
|
||||
var ok;
|
||||
if (stream.eat("#")) {
|
||||
if (stream.eat("x")) {
|
||||
ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";");
|
||||
} else {
|
||||
ok = stream.eatWhile(/[\d]/) && stream.eat(";");
|
||||
}
|
||||
} else {
|
||||
ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";");
|
||||
}
|
||||
return ok ? "atom" : "error";
|
||||
}
|
||||
else {
|
||||
stream.eatWhile(/[^&<]/);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function inTag(stream, state) {
|
||||
var ch = stream.next();
|
||||
if (ch == ">" || (ch == "/" && stream.eat(">"))) {
|
||||
state.tokenize = inText;
|
||||
type = ch == ">" ? "endTag" : "selfcloseTag";
|
||||
return "tag";
|
||||
}
|
||||
else if (ch == "=") {
|
||||
type = "equals";
|
||||
return null;
|
||||
}
|
||||
else if (/[\'\"]/.test(ch)) {
|
||||
state.tokenize = inAttribute(ch);
|
||||
return state.tokenize(stream, state);
|
||||
}
|
||||
else {
|
||||
stream.eatWhile(/[^\s\u00a0=<>\"\'\/?]/);
|
||||
return "word";
|
||||
}
|
||||
}
|
||||
|
||||
function inAttribute(quote) {
|
||||
return function(stream, state) {
|
||||
while (!stream.eol()) {
|
||||
if (stream.next() == quote) {
|
||||
state.tokenize = inTag;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return "string";
|
||||
};
|
||||
}
|
||||
|
||||
function inBlock(style, terminator) {
|
||||
return function(stream, state) {
|
||||
while (!stream.eol()) {
|
||||
if (stream.match(terminator)) {
|
||||
state.tokenize = inText;
|
||||
break;
|
||||
}
|
||||
stream.next();
|
||||
}
|
||||
return style;
|
||||
};
|
||||
}
|
||||
function doctype(depth) {
|
||||
return function(stream, state) {
|
||||
var ch;
|
||||
while ((ch = stream.next()) != null) {
|
||||
if (ch == "<") {
|
||||
state.tokenize = doctype(depth + 1);
|
||||
return state.tokenize(stream, state);
|
||||
} else if (ch == ">") {
|
||||
if (depth == 1) {
|
||||
state.tokenize = inText;
|
||||
break;
|
||||
} else {
|
||||
state.tokenize = doctype(depth - 1);
|
||||
return state.tokenize(stream, state);
|
||||
}
|
||||
}
|
||||
}
|
||||
return "meta";
|
||||
};
|
||||
}
|
||||
|
||||
var curState, setStyle;
|
||||
function pass() {
|
||||
for (var i = arguments.length - 1; i >= 0; i--) curState.cc.push(arguments[i]);
|
||||
}
|
||||
function cont() {
|
||||
pass.apply(null, arguments);
|
||||
return true;
|
||||
}
|
||||
|
||||
function pushContext(tagName, startOfLine) {
|
||||
var noIndent = Kludges.doNotIndent.hasOwnProperty(tagName) || (curState.context && curState.context.noIndent);
|
||||
curState.context = {
|
||||
prev: curState.context,
|
||||
tagName: tagName,
|
||||
indent: curState.indented,
|
||||
startOfLine: startOfLine,
|
||||
noIndent: noIndent
|
||||
};
|
||||
}
|
||||
function popContext() {
|
||||
if (curState.context) curState.context = curState.context.prev;
|
||||
}
|
||||
|
||||
function element(type) {
|
||||
if (type == "openTag") {
|
||||
curState.tagName = tagName;
|
||||
return cont(attributes, endtag(curState.startOfLine));
|
||||
} else if (type == "closeTag") {
|
||||
var err = false;
|
||||
if (curState.context) {
|
||||
if (curState.context.tagName != tagName) {
|
||||
if (Kludges.implicitlyClosed.hasOwnProperty(curState.context.tagName.toLowerCase())) {
|
||||
popContext();
|
||||
}
|
||||
err = !curState.context || curState.context.tagName != tagName;
|
||||
}
|
||||
} else {
|
||||
err = true;
|
||||
}
|
||||
if (err) setStyle = "error";
|
||||
return cont(endclosetag(err));
|
||||
}
|
||||
return cont();
|
||||
}
|
||||
function endtag(startOfLine) {
|
||||
return function(type) {
|
||||
if (type == "selfcloseTag" ||
|
||||
(type == "endTag" && Kludges.autoSelfClosers.hasOwnProperty(curState.tagName.toLowerCase()))) {
|
||||
maybePopContext(curState.tagName.toLowerCase());
|
||||
return cont();
|
||||
}
|
||||
if (type == "endTag") {
|
||||
maybePopContext(curState.tagName.toLowerCase());
|
||||
pushContext(curState.tagName, startOfLine);
|
||||
return cont();
|
||||
}
|
||||
return cont();
|
||||
};
|
||||
}
|
||||
function endclosetag(err) {
|
||||
return function(type) {
|
||||
if (err) setStyle = "error";
|
||||
if (type == "endTag") { popContext(); return cont(); }
|
||||
setStyle = "error";
|
||||
return cont(arguments.callee);
|
||||
}
|
||||
}
|
||||
function maybePopContext(nextTagName) {
|
||||
var parentTagName;
|
||||
while (true) {
|
||||
if (!curState.context) {
|
||||
return;
|
||||
}
|
||||
parentTagName = curState.context.tagName.toLowerCase();
|
||||
if (!Kludges.contextGrabbers.hasOwnProperty(parentTagName) ||
|
||||
!Kludges.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {
|
||||
return;
|
||||
}
|
||||
popContext();
|
||||
}
|
||||
}
|
||||
|
||||
function attributes(type) {
|
||||
if (type == "word") {setStyle = "attribute"; return cont(attribute, attributes);}
|
||||
if (type == "endTag" || type == "selfcloseTag") return pass();
|
||||
setStyle = "error";
|
||||
return cont(attributes);
|
||||
}
|
||||
function attribute(type) {
|
||||
if (type == "equals") return cont(attvalue, attributes);
|
||||
if (!Kludges.allowMissing) setStyle = "error";
|
||||
return (type == "endTag" || type == "selfcloseTag") ? pass() : cont();
|
||||
}
|
||||
function attvalue(type) {
|
||||
if (type == "string") return cont(attvaluemaybe);
|
||||
if (type == "word" && Kludges.allowUnquoted) {setStyle = "string"; return cont();}
|
||||
setStyle = "error";
|
||||
return (type == "endTag" || type == "selfCloseTag") ? pass() : cont();
|
||||
}
|
||||
function attvaluemaybe(type) {
|
||||
if (type == "string") return cont(attvaluemaybe);
|
||||
else return pass();
|
||||
}
|
||||
|
||||
return {
|
||||
startState: function() {
|
||||
return {tokenize: inText, cc: [], indented: 0, startOfLine: true, tagName: null, context: null};
|
||||
},
|
||||
|
||||
token: function(stream, state) {
|
||||
if (stream.sol()) {
|
||||
state.startOfLine = true;
|
||||
state.indented = stream.indentation();
|
||||
}
|
||||
if (stream.eatSpace()) return null;
|
||||
|
||||
setStyle = type = tagName = null;
|
||||
var style = state.tokenize(stream, state);
|
||||
state.type = type;
|
||||
if ((style || type) && style != "comment") {
|
||||
curState = state;
|
||||
while (true) {
|
||||
var comb = state.cc.pop() || element;
|
||||
if (comb(type || style)) break;
|
||||
}
|
||||
}
|
||||
state.startOfLine = false;
|
||||
return setStyle || style;
|
||||
},
|
||||
|
||||
indent: function(state, textAfter, fullLine) {
|
||||
var context = state.context;
|
||||
if ((state.tokenize != inTag && state.tokenize != inText) ||
|
||||
context && context.noIndent)
|
||||
return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0;
|
||||
if (alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0;
|
||||
if (context && /^<\//.test(textAfter))
|
||||
context = context.prev;
|
||||
while (context && !context.startOfLine)
|
||||
context = context.prev;
|
||||
if (context) return context.indent + indentUnit;
|
||||
else return 0;
|
||||
},
|
||||
|
||||
compareStates: function(a, b) {
|
||||
if (a.indented != b.indented || a.tokenize != b.tokenize) return false;
|
||||
for (var ca = a.context, cb = b.context; ; ca = ca.prev, cb = cb.prev) {
|
||||
if (!ca || !cb) return ca == cb;
|
||||
if (ca.tagName != cb.tagName) return false;
|
||||
}
|
||||
},
|
||||
|
||||
electricChars: "/"
|
||||
};
|
||||
});
|
||||
|
||||
CodeMirror.defineMIME("application/xml", "xml");
|
||||
if (!CodeMirror.mimeModes.hasOwnProperty("text/html"))
|
||||
CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true});
|
||||
@@ -1,4 +1,4 @@
|
||||
Copyright (C) 2012 by Marijn Haverbeke <marijnh@gmail.com>
|
||||
Copyright (C) 2013 by Marijn Haverbeke <marijnh@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
38
CodeMirror-3.14/addon/hint/show-hint.css
Normal file
@@ -0,0 +1,38 @@
|
||||
.CodeMirror-hints {
|
||||
position: absolute;
|
||||
z-index: 10;
|
||||
overflow: hidden;
|
||||
list-style: none;
|
||||
|
||||
margin: 0;
|
||||
padding: 2px;
|
||||
|
||||
-webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
||||
-moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
||||
box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
||||
border-radius: 3px;
|
||||
border: 1px solid silver;
|
||||
|
||||
background: white;
|
||||
font-size: 90%;
|
||||
font-family: monospace;
|
||||
|
||||
max-height: 20em;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.CodeMirror-hint {
|
||||
margin: 0;
|
||||
padding: 0 4px;
|
||||
border-radius: 2px;
|
||||
max-width: 19em;
|
||||
overflow: hidden;
|
||||
white-space: pre;
|
||||
color: black;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.CodeMirror-hint-active {
|
||||
background: #08f;
|
||||
color: white;
|
||||
}
|
||||
72
CodeMirror-3.14/addon/lint/lint.css
Normal file
@@ -0,0 +1,72 @@
|
||||
/* The lint marker gutter */
|
||||
.CodeMirror-lint-markers {
|
||||
width: 12px; margin-left: 2px;
|
||||
}
|
||||
|
||||
.CodeMirror-lint-tooltip {
|
||||
background-color: infobackground;
|
||||
border: 1px solid black;
|
||||
border-radius: 4px 4px 4px 4px;
|
||||
color: infotext;
|
||||
font-family: monospace;
|
||||
font-size: 10pt;
|
||||
overflow: hidden;
|
||||
padding: 2px 5px;
|
||||
position: fixed;
|
||||
white-space: pre;
|
||||
z-index: 100;
|
||||
max-width: 600px;
|
||||
opacity: 0;
|
||||
transition: opacity .4s;
|
||||
-moz-transition: opacity .4s;
|
||||
-webkit-transition: opacity .4s;
|
||||
-o-transition: opacity .4s;
|
||||
-ms-transition: opacity .4s;
|
||||
}
|
||||
|
||||
.CodeMirror-lint-mark-error, .CodeMirror-lint-mark-warning {
|
||||
background-position: left bottom;
|
||||
background-repeat: repeat-x;
|
||||
}
|
||||
|
||||
.CodeMirror-lint-mark-error {
|
||||
background-image:
|
||||
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==")
|
||||
;
|
||||
}
|
||||
|
||||
.CodeMirror-lint-mark-warning {
|
||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=");
|
||||
}
|
||||
|
||||
.CodeMirror-lint-marker-error, .CodeMirror-lint-marker-warning {
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
cursor: help;
|
||||
display: inline-block;
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
vertical-align: middle;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.CodeMirror-lint-message-error, .CodeMirror-lint-message-warning {
|
||||
padding-left: 18px;
|
||||
background-position: top left;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.CodeMirror-lint-marker-error, .CodeMirror-lint-message-error {
|
||||
background-image: url("../../../images/error.png");
|
||||
}
|
||||
|
||||
.CodeMirror-lint-marker-warning, .CodeMirror-lint-message-warning {
|
||||
background-image: url("../../../images/warning.png");
|
||||
}
|
||||
|
||||
.CodeMirror-lint-marker-multiple {
|
||||
background-image: url("../../../images/multiple.png");
|
||||
background-repeat: no-repeat;
|
||||
background-position: right bottom;
|
||||
width: 100%; height: 100%;
|
||||
}
|
||||
7
CodeMirror-3.14/lib/codemirror-compressed.js
Normal file
248
CodeMirror-3.14/lib/codemirror.css
Normal file
@@ -0,0 +1,248 @@
|
||||
/* BASICS */
|
||||
|
||||
.CodeMirror {
|
||||
/* Set height, width, borders, and global font properties here */
|
||||
font-family: monospace;
|
||||
height: 300px;
|
||||
}
|
||||
.CodeMirror-scroll {
|
||||
/* Set scrolling behaviour here */
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/* PADDING */
|
||||
|
||||
.CodeMirror-lines {
|
||||
padding: 4px 0; /* Vertical padding around content */
|
||||
}
|
||||
.CodeMirror pre {
|
||||
padding: 0 4px; /* Horizontal padding of content */
|
||||
}
|
||||
|
||||
.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
|
||||
background-color: white; /* The little square between H and V scrollbars */
|
||||
}
|
||||
|
||||
/* GUTTER */
|
||||
|
||||
.CodeMirror-gutters {
|
||||
border-right: 1px solid #ddd;
|
||||
background-color: #f7f7f7;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.CodeMirror-linenumbers {}
|
||||
.CodeMirror-linenumber {
|
||||
padding: 0 3px 0 5px;
|
||||
min-width: 20px;
|
||||
text-align: right;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
/* CURSOR */
|
||||
|
||||
.CodeMirror div.CodeMirror-cursor {
|
||||
border-left: 1px solid black;
|
||||
z-index: 3;
|
||||
}
|
||||
/* Shown when moving in bi-directional text */
|
||||
.CodeMirror div.CodeMirror-secondarycursor {
|
||||
border-left: 1px solid silver;
|
||||
}
|
||||
.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {
|
||||
width: auto;
|
||||
border: 0;
|
||||
background: #7e7;
|
||||
z-index: 1;
|
||||
}
|
||||
/* Can style cursor different in overwrite (non-insert) mode */
|
||||
.CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {}
|
||||
|
||||
.cm-tab { display: inline-block; }
|
||||
|
||||
/* DEFAULT THEME */
|
||||
|
||||
.cm-s-default .cm-keyword {color: #708;}
|
||||
.cm-s-default .cm-atom {color: #219;}
|
||||
.cm-s-default .cm-number {color: #164;}
|
||||
.cm-s-default .cm-def {color: #00f;}
|
||||
.cm-s-default .cm-variable {color: black;}
|
||||
.cm-s-default .cm-variable-2 {color: #05a;}
|
||||
.cm-s-default .cm-variable-3 {color: #085;}
|
||||
.cm-s-default .cm-property {color: black;}
|
||||
.cm-s-default .cm-operator {color: black;}
|
||||
.cm-s-default .cm-comment {color: #a50;}
|
||||
.cm-s-default .cm-string {color: #a11;}
|
||||
.cm-s-default .cm-string-2 {color: #f50;}
|
||||
.cm-s-default .cm-meta {color: #555;}
|
||||
.cm-s-default .cm-error {color: #f00;}
|
||||
.cm-s-default .cm-qualifier {color: #555;}
|
||||
.cm-s-default .cm-builtin {color: #30a;}
|
||||
.cm-s-default .cm-bracket {color: #997;}
|
||||
.cm-s-default .cm-tag {color: #170;}
|
||||
.cm-s-default .cm-attribute {color: #00c;}
|
||||
.cm-s-default .cm-header {color: blue;}
|
||||
.cm-s-default .cm-quote {color: #090;}
|
||||
.cm-s-default .cm-hr {color: #999;}
|
||||
.cm-s-default .cm-link {color: #00c;}
|
||||
|
||||
.cm-negative {color: #d44;}
|
||||
.cm-positive {color: #292;}
|
||||
.cm-header, .cm-strong {font-weight: bold;}
|
||||
.cm-em {font-style: italic;}
|
||||
.cm-link {text-decoration: underline;}
|
||||
|
||||
.cm-invalidchar {color: #f00;}
|
||||
|
||||
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
|
||||
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
||||
|
||||
/* STOP */
|
||||
|
||||
/* The rest of this file contains styles related to the mechanics of
|
||||
the editor. You probably shouldn't touch them. */
|
||||
|
||||
.CodeMirror {
|
||||
line-height: 1;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: white;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.CodeMirror-scroll {
|
||||
/* 30px is the magic margin used to hide the element's real scrollbars */
|
||||
/* See overflow: hidden in .CodeMirror */
|
||||
margin-bottom: -30px; margin-right: -30px;
|
||||
padding-bottom: 30px; padding-right: 30px;
|
||||
height: 100%;
|
||||
outline: none; /* Prevent dragging from highlighting the element */
|
||||
position: relative;
|
||||
}
|
||||
.CodeMirror-sizer {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* The fake, visible scrollbars. Used to force redraw during scrolling
|
||||
before actuall scrolling happens, thus preventing shaking and
|
||||
flickering artifacts. */
|
||||
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
|
||||
position: absolute;
|
||||
z-index: 6;
|
||||
display: none;
|
||||
}
|
||||
.CodeMirror-vscrollbar {
|
||||
right: 0; top: 0;
|
||||
overflow-x: hidden;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
.CodeMirror-hscrollbar {
|
||||
bottom: 0; left: 0;
|
||||
overflow-y: hidden;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
.CodeMirror-scrollbar-filler {
|
||||
right: 0; bottom: 0;
|
||||
}
|
||||
.CodeMirror-gutter-filler {
|
||||
left: 0; bottom: 0;
|
||||
}
|
||||
|
||||
.CodeMirror-gutters {
|
||||
position: absolute; left: 0; top: 0;
|
||||
padding-bottom: 30px;
|
||||
z-index: 3;
|
||||
}
|
||||
.CodeMirror-gutter {
|
||||
white-space: normal;
|
||||
height: 100%;
|
||||
padding-bottom: 30px;
|
||||
margin-bottom: -32px;
|
||||
display: inline-block;
|
||||
/* Hack to make IE7 behave */
|
||||
*zoom:1;
|
||||
*display:inline;
|
||||
}
|
||||
.CodeMirror-gutter-elt {
|
||||
position: absolute;
|
||||
cursor: default;
|
||||
z-index: 4;
|
||||
}
|
||||
|
||||
.CodeMirror-lines {
|
||||
cursor: text;
|
||||
}
|
||||
.CodeMirror pre {
|
||||
/* Reset some styles that the rest of the page might have set */
|
||||
-moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
|
||||
border-width: 0;
|
||||
background: transparent;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
margin: 0;
|
||||
white-space: pre;
|
||||
word-wrap: normal;
|
||||
line-height: inherit;
|
||||
color: inherit;
|
||||
z-index: 2;
|
||||
position: relative;
|
||||
overflow: visible;
|
||||
}
|
||||
.CodeMirror-wrap pre {
|
||||
word-wrap: break-word;
|
||||
white-space: pre-wrap;
|
||||
word-break: normal;
|
||||
}
|
||||
.CodeMirror-linebackground {
|
||||
position: absolute;
|
||||
left: 0; right: 0; top: 0; bottom: 0;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.CodeMirror-linewidget {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.CodeMirror-widget {
|
||||
}
|
||||
|
||||
.CodeMirror-wrap .CodeMirror-scroll {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.CodeMirror-measure {
|
||||
position: absolute;
|
||||
width: 100%; height: 0px;
|
||||
overflow: hidden;
|
||||
visibility: hidden;
|
||||
}
|
||||
.CodeMirror-measure pre { position: static; }
|
||||
|
||||
.CodeMirror div.CodeMirror-cursor {
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
border-right: none;
|
||||
width: 0;
|
||||
}
|
||||
.CodeMirror-focused div.CodeMirror-cursor {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.CodeMirror-selected { background: #d9d9d9; }
|
||||
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
|
||||
|
||||
.cm-searching {
|
||||
background: #ffa;
|
||||
background: rgba(255, 255, 0, .4);
|
||||
}
|
||||
|
||||
/* IE7 hack to prevent it from returning funny offsetTops on the spans */
|
||||
.CodeMirror span { *vertical-align: text-bottom; }
|
||||
|
||||
@media print {
|
||||
/* Hide the cursor when printing */
|
||||
.CodeMirror div.CodeMirror-cursor {
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
33
CodeMirror-3.14/theme/base16-dark.css
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
|
||||
Name: Base16 Default Dark
|
||||
Author: Chris Kempson (http://chriskempson.com)
|
||||
|
||||
CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-chrome-devtools)
|
||||
Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16)
|
||||
|
||||
*/
|
||||
|
||||
.cm-s-base16-dark.CodeMirror {background: #151515; color: #e0e0e0;}
|
||||
.cm-s-base16-dark div.CodeMirror-selected {background: #202020 !important;}
|
||||
.cm-s-base16-dark .CodeMirror-gutters {background: #151515; border-right: 0px;}
|
||||
.cm-s-base16-dark .CodeMirror-linenumber {color: #505050;}
|
||||
.cm-s-base16-dark .CodeMirror-cursor {border-left: 1px solid #b0b0b0 !important;}
|
||||
|
||||
.cm-s-base16-dark span.cm-comment {color: #8f5536;}
|
||||
.cm-s-base16-dark span.cm-atom {color: #aa759f;}
|
||||
.cm-s-base16-dark span.cm-number {color: #aa759f;}
|
||||
|
||||
.cm-s-base16-dark span.cm-property, .cm-s-base16-dark span.cm-attribute {color: #90a959;}
|
||||
.cm-s-base16-dark span.cm-keyword {color: #ac4142;}
|
||||
.cm-s-base16-dark span.cm-string {color: #f4bf75;}
|
||||
|
||||
.cm-s-base16-dark span.cm-variable {color: #90a959;}
|
||||
.cm-s-base16-dark span.cm-variable-2 {color: #6a9fb5;}
|
||||
.cm-s-base16-dark span.cm-def {color: #d28445;}
|
||||
.cm-s-base16-dark span.cm-error {background: #ac4142; color: #b0b0b0;}
|
||||
.cm-s-base16-dark span.cm-bracket {color: #e0e0e0;}
|
||||
.cm-s-base16-dark span.cm-tag {color: #ac4142;}
|
||||
.cm-s-base16-dark span.cm-link {color: #aa759f;}
|
||||
|
||||
.cm-s-base16-dark .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}
|
||||
@@ -1,9 +1,9 @@
|
||||
/* Port of TextMate's Blackboard theme */
|
||||
|
||||
.cm-s-blackboard { background: #0C1021; color: #F8F8F8; }
|
||||
.cm-s-blackboard.CodeMirror { background: #0C1021; color: #F8F8F8; }
|
||||
.cm-s-blackboard .CodeMirror-selected { background: #253B76 !important; }
|
||||
.cm-s-blackboard .CodeMirror-gutter { background: #0C1021; border-right: 0; }
|
||||
.cm-s-blackboard .CodeMirror-gutter-text { color: #888; }
|
||||
.cm-s-blackboard .CodeMirror-gutters { background: #0C1021; border-right: 0; }
|
||||
.cm-s-blackboard .CodeMirror-linenumber { color: #888; }
|
||||
.cm-s-blackboard .CodeMirror-cursor { border-left: 1px solid #A7A7A7 !important; }
|
||||
|
||||
.cm-s-blackboard .cm-keyword { color: #FBDE2D; }
|
||||
@@ -1,7 +1,7 @@
|
||||
.cm-s-cobalt { background: #002240; color: white; }
|
||||
.cm-s-cobalt.CodeMirror { background: #002240; color: white; }
|
||||
.cm-s-cobalt div.CodeMirror-selected { background: #b36539 !important; }
|
||||
.cm-s-cobalt .CodeMirror-gutter { background: #002240; border-right: 1px solid #aaa; }
|
||||
.cm-s-cobalt .CodeMirror-gutter-text { color: #d0d0d0; }
|
||||
.cm-s-cobalt .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; }
|
||||
.cm-s-cobalt .CodeMirror-linenumber { color: #d0d0d0; }
|
||||
.cm-s-cobalt .CodeMirror-cursor { border-left: 1px solid white !important; }
|
||||
|
||||
.cm-s-cobalt span.cm-comment { color: #08f; }
|
||||
@@ -20,6 +20,6 @@
|
||||
.cm-s-eclipse span.cm-link {color: #219;}
|
||||
|
||||
.cm-s-eclipse .CodeMirror-matchingbracket {
|
||||
border:1px solid grey;
|
||||
color:black !important;;
|
||||
outline:1px solid grey;
|
||||
color:black !important;
|
||||
}
|
||||
@@ -1,21 +1,21 @@
|
||||
.cm-s-erlang-dark { background: #002240; color: white; }
|
||||
.cm-s-erlang-dark.CodeMirror { background: #002240; color: white; }
|
||||
.cm-s-erlang-dark div.CodeMirror-selected { background: #b36539 !important; }
|
||||
.cm-s-erlang-dark .CodeMirror-gutter { background: #002240; border-right: 1px solid #aaa; }
|
||||
.cm-s-erlang-dark .CodeMirror-gutter-text { color: #d0d0d0; }
|
||||
.cm-s-erlang-dark .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; }
|
||||
.cm-s-erlang-dark .CodeMirror-linenumber { color: #d0d0d0; }
|
||||
.cm-s-erlang-dark .CodeMirror-cursor { border-left: 1px solid white !important; }
|
||||
|
||||
.cm-s-erlang-dark span.cm-atom { color: #845dc4; }
|
||||
.cm-s-erlang-dark span.cm-attribute { color: #ff80e1; }
|
||||
.cm-s-erlang-dark span.cm-bracket { color: #ff9d00; }
|
||||
.cm-s-erlang-dark span.cm-builtin { color: #eeaaaa; }
|
||||
.cm-s-erlang-dark span.cm-comment { color: #7777ff; }
|
||||
.cm-s-erlang-dark span.cm-def { color: #ee77aa; }
|
||||
.cm-s-erlang-dark span.cm-builtin { color: #eaa; }
|
||||
.cm-s-erlang-dark span.cm-comment { color: #77f; }
|
||||
.cm-s-erlang-dark span.cm-def { color: #e7a; }
|
||||
.cm-s-erlang-dark span.cm-error { color: #9d1e15; }
|
||||
.cm-s-erlang-dark span.cm-keyword { color: #ffee80; }
|
||||
.cm-s-erlang-dark span.cm-meta { color: #50fefe; }
|
||||
.cm-s-erlang-dark span.cm-number { color: #ffd0d0; }
|
||||
.cm-s-erlang-dark span.cm-operator { color: #dd1111; }
|
||||
.cm-s-erlang-dark span.cm-operator { color: #d11; }
|
||||
.cm-s-erlang-dark span.cm-string { color: #3ad900; }
|
||||
.cm-s-erlang-dark span.cm-tag { color: #9effff; }
|
||||
.cm-s-erlang-dark span.cm-variable { color: #50fe50; }
|
||||
.cm-s-erlang-dark span.cm-variable-2 { color: #ee00ee; }
|
||||
.cm-s-erlang-dark span.cm-variable-2 { color: #e0e; }
|
||||
@@ -2,23 +2,22 @@
|
||||
http://lesscss.org/ dark theme
|
||||
Ported to CodeMirror by Peter Kroon
|
||||
*/
|
||||
.CodeMirror{
|
||||
line-height: 15px;
|
||||
.cm-s-lesser-dark {
|
||||
line-height: 1.3em;
|
||||
}
|
||||
.cm-s-lesser-dark {
|
||||
font-family: 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', 'Monaco', Courier, monospace !important;
|
||||
font-size:12px;
|
||||
}
|
||||
|
||||
.cm-s-lesser-dark { background: #262626; color: #EBEFE7; text-shadow: 0 -1px 1px #262626; }
|
||||
.cm-s-lesser-dark.CodeMirror { background: #262626; color: #EBEFE7; text-shadow: 0 -1px 1px #262626; }
|
||||
.cm-s-lesser-dark div.CodeMirror-selected {background: #45443B !important;} /* 33322B*/
|
||||
.cm-s-lesser-dark .CodeMirror-cursor { border-left: 1px solid white !important; }
|
||||
.cm-s-lesser-dark .CodeMirror-lines { margin-left:3px; margin-right:3px; }/*editable code holder*/
|
||||
.cm-s-lesser-dark pre { padding: 0 8px; }/*editable code holder*/
|
||||
|
||||
div.CodeMirror span.CodeMirror-matchingbracket { color: #7EFC7E; }/*65FC65*/
|
||||
|
||||
.cm-s-lesser-dark .CodeMirror-gutter { background: #262626; border-right:1px solid #aaa; padding-right:3px; min-width:2.5em; }
|
||||
.cm-s-lesser-dark .CodeMirror-gutter-text { color: #777; }
|
||||
.cm-s-lesser-dark .CodeMirror-gutters { background: #262626; border-right:1px solid #aaa; }
|
||||
.cm-s-lesser-dark .CodeMirror-linenumber { color: #777; }
|
||||
|
||||
.cm-s-lesser-dark span.cm-keyword { color: #599eff; }
|
||||
.cm-s-lesser-dark span.cm-atom { color: #C2B470; }
|
||||
52
CodeMirror-3.14/theme/midnight.css
Normal file
@@ -0,0 +1,52 @@
|
||||
/* Based on the theme at http://bonsaiden.github.com/JavaScript-Garden */
|
||||
|
||||
/*<!--breakpoint-->*/
|
||||
.breakpoints {width: .8em;}
|
||||
.breakpoint { color: #822; }
|
||||
|
||||
/*<!--match-->*/
|
||||
span.CodeMirror-matchhighlight { background: #494949 }
|
||||
.CodeMirror-focused span.CodeMirror-matchhighlight { background: #314D67; !important }
|
||||
|
||||
/*<!--activeline-->*/
|
||||
.activeline {background: #253540 !important;}
|
||||
|
||||
.cm-s-midnight.CodeMirror {
|
||||
background: #0F192A;
|
||||
color: #D1EDFF;
|
||||
}
|
||||
|
||||
.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
|
||||
|
||||
.cm-s-midnight div.CodeMirror-selected {background: #314D67 !important;}
|
||||
.cm-s-midnight .CodeMirror-gutters {background: #0F192A; border-right: 1px solid;}
|
||||
.cm-s-midnight .CodeMirror-linenumber {color: #D0D0D0;}
|
||||
.cm-s-midnight .CodeMirror-cursor {
|
||||
border-left: 1px solid #F8F8F0 !important;
|
||||
}
|
||||
|
||||
.cm-s-midnight span.cm-comment {color: #428BDD;}
|
||||
.cm-s-midnight span.cm-atom {color: #AE81FF;}
|
||||
.cm-s-midnight span.cm-number {color: #D1EDFF;}
|
||||
|
||||
.cm-s-midnight span.cm-property, .cm-s-tropicaleve span.cm-attribute {color: #A6E22E;}
|
||||
.cm-s-midnight span.cm-keyword {color: #E83737;}
|
||||
.cm-s-midnight span.cm-string {color: #1DC116;}
|
||||
|
||||
.cm-s-midnight span.cm-variable {color: #FFAA3E;}
|
||||
.cm-s-midnight span.cm-variable-2 {color: #FFAA3E;}
|
||||
.cm-s-midnight span.cm-def {color: #4DD;}
|
||||
.cm-s-midnight span.cm-error {background: #F92672; color: #F8F8F0;}
|
||||
.cm-s-midnight span.cm-bracket {color: #D1EDFF;}
|
||||
.cm-s-midnight span.cm-tag {color: #008;}
|
||||
.cm-s-midnight span.cm-link {color: #AE81FF;}
|
||||
|
||||
.cm-s-midnight .CodeMirror-matchingbracket {
|
||||
text-decoration: underline;
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
.typ { color: #FFAA3E; }
|
||||
.atn { color: #606; }
|
||||
.atv { color: #080; }
|
||||
.dec { color: #606; }
|
||||
@@ -1,9 +1,9 @@
|
||||
/* Based on Sublime Text's Monokai theme */
|
||||
|
||||
.cm-s-monokai {background: #272822; color: #f8f8f2;}
|
||||
.cm-s-monokai.CodeMirror {background: #272822; color: #f8f8f2;}
|
||||
.cm-s-monokai div.CodeMirror-selected {background: #49483E !important;}
|
||||
.cm-s-monokai .CodeMirror-gutter {background: #272822; border-right: 0px;}
|
||||
.cm-s-monokai .CodeMirror-gutter-text {color: #d0d0d0;}
|
||||
.cm-s-monokai .CodeMirror-gutters {background: #272822; border-right: 0px;}
|
||||
.cm-s-monokai .CodeMirror-linenumber {color: #d0d0d0;}
|
||||
.cm-s-monokai .CodeMirror-cursor {border-left: 1px solid #f8f8f0 !important;}
|
||||
|
||||
.cm-s-monokai span.cm-comment {color: #75715e;}
|
||||
@@ -1,9 +1,9 @@
|
||||
/* Loosely based on the Midnight Textmate theme */
|
||||
|
||||
.cm-s-night { background: #0a001f; color: #f8f8f8; }
|
||||
.cm-s-night div.CodeMirror-selected { background: #a8f !important; }
|
||||
.cm-s-night .CodeMirror-gutter { background: #0a001f; border-right: 1px solid #aaa; }
|
||||
.cm-s-night .CodeMirror-gutter-text { color: #f8f8f8; }
|
||||
.cm-s-night.CodeMirror { background: #0a001f; color: #f8f8f8; }
|
||||
.cm-s-night div.CodeMirror-selected { background: #447 !important; }
|
||||
.cm-s-night .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; }
|
||||
.cm-s-night .CodeMirror-linenumber { color: #f8f8f8; }
|
||||
.cm-s-night .CodeMirror-cursor { border-left: 1px solid white !important; }
|
||||
|
||||
.cm-s-night span.cm-comment { color: #6900a1; }
|
||||
@@ -1,9 +1,9 @@
|
||||
.cm-s-rubyblue { font:13px/1.4em Trebuchet, Verdana, sans-serif; } /* - customized editor font - */
|
||||
.cm-s-rubyblue { font-family: Trebuchet, Verdana, sans-serif; } /* - customized editor font - */
|
||||
|
||||
.cm-s-rubyblue { background: #112435; color: white; }
|
||||
.cm-s-rubyblue.CodeMirror { background: #112435; color: white; }
|
||||
.cm-s-rubyblue div.CodeMirror-selected { background: #38566F !important; }
|
||||
.cm-s-rubyblue .CodeMirror-gutter { background: #1F4661; border-right: 7px solid #3E7087; min-width:2.5em; }
|
||||
.cm-s-rubyblue .CodeMirror-gutter-text { color: white; }
|
||||
.cm-s-rubyblue .CodeMirror-gutters { background: #1F4661; border-right: 7px solid #3E7087; }
|
||||
.cm-s-rubyblue .CodeMirror-linenumber { color: white; }
|
||||
.cm-s-rubyblue .CodeMirror-cursor { border-left: 1px solid white !important; }
|
||||
|
||||
.cm-s-rubyblue span.cm-comment { color: #999; font-style:italic; line-height: 1em; }
|
||||
207
CodeMirror-3.14/theme/solarized.css
Normal file
26
CodeMirror-3.14/theme/twilight.css
Normal file
@@ -0,0 +1,26 @@
|
||||
.cm-s-twilight.CodeMirror { background: #141414; color: #f7f7f7; } /**/
|
||||
.cm-s-twilight .CodeMirror-selected { background: #323232 !important; } /**/
|
||||
|
||||
.cm-s-twilight .CodeMirror-gutters { background: #222; border-right: 1px solid #aaa; }
|
||||
.cm-s-twilight .CodeMirror-linenumber { color: #aaa; }
|
||||
.cm-s-twilight .CodeMirror-cursor { border-left: 1px solid white !important; }
|
||||
|
||||
.cm-s-twilight .cm-keyword { color: #f9ee98; } /**/
|
||||
.cm-s-twilight .cm-atom { color: #FC0; }
|
||||
.cm-s-twilight .cm-number { color: #ca7841; } /**/
|
||||
.cm-s-twilight .cm-def { color: #8DA6CE; }
|
||||
.cm-s-twilight span.cm-variable-2, .cm-s-twilight span.cm-tag { color: #607392; } /**/
|
||||
.cm-s-twilight span.cm-variable-3, .cm-s-twilight span.cm-def { color: #607392; } /**/
|
||||
.cm-s-twilight .cm-operator { color: #cda869; } /**/
|
||||
.cm-s-twilight .cm-comment { color:#777; font-style:italic; font-weight:normal; } /**/
|
||||
.cm-s-twilight .cm-string { color:#8f9d6a; font-style:italic; } /**/
|
||||
.cm-s-twilight .cm-string-2 { color:#bd6b18 } /*?*/
|
||||
.cm-s-twilight .cm-meta { background-color:#141414; color:#f7f7f7; } /*?*/
|
||||
.cm-s-twilight .cm-error { border-bottom: 1px solid red; }
|
||||
.cm-s-twilight .cm-builtin { color: #cda869; } /*?*/
|
||||
.cm-s-twilight .cm-tag { color: #997643; } /**/
|
||||
.cm-s-twilight .cm-attribute { color: #d6bb6d; } /*?*/
|
||||
.cm-s-twilight .cm-header { color: #FF6400; }
|
||||
.cm-s-twilight .cm-hr { color: #AEAEAE; }
|
||||
.cm-s-twilight .cm-link { color:#ad9361; font-style:italic; text-decoration:none; } /**/
|
||||
|
||||
27
CodeMirror-3.14/theme/vibrant-ink.css
Normal file
@@ -0,0 +1,27 @@
|
||||
/* Taken from the popular Visual Studio Vibrant Ink Schema */
|
||||
|
||||
.cm-s-vibrant-ink.CodeMirror { background: black; color: white; }
|
||||
.cm-s-vibrant-ink .CodeMirror-selected { background: #35493c !important; }
|
||||
|
||||
.cm-s-vibrant-ink .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; }
|
||||
.cm-s-vibrant-ink .CodeMirror-linenumber { color: #d0d0d0; }
|
||||
.cm-s-vibrant-ink .CodeMirror-cursor { border-left: 1px solid white !important; }
|
||||
|
||||
.cm-s-vibrant-ink .cm-keyword { color: #CC7832; }
|
||||
.cm-s-vibrant-ink .cm-atom { color: #FC0; }
|
||||
.cm-s-vibrant-ink .cm-number { color: #FFEE98; }
|
||||
.cm-s-vibrant-ink .cm-def { color: #8DA6CE; }
|
||||
.cm-s-vibrant-ink span.cm-variable-2, .cm-s-cobalt span.cm-tag { color: #FFC66D }
|
||||
.cm-s-vibrant-ink span.cm-variable-3, .cm-s-cobalt span.cm-def { color: #FFC66D }
|
||||
.cm-s-vibrant-ink .cm-operator { color: #888; }
|
||||
.cm-s-vibrant-ink .cm-comment { color: gray; font-weight: bold; }
|
||||
.cm-s-vibrant-ink .cm-string { color: #A5C25C }
|
||||
.cm-s-vibrant-ink .cm-string-2 { color: red }
|
||||
.cm-s-vibrant-ink .cm-meta { color: #D8FA3C; }
|
||||
.cm-s-vibrant-ink .cm-error { border-bottom: 1px solid red; }
|
||||
.cm-s-vibrant-ink .cm-builtin { color: #8DA6CE; }
|
||||
.cm-s-vibrant-ink .cm-tag { color: #8DA6CE; }
|
||||
.cm-s-vibrant-ink .cm-attribute { color: #8DA6CE; }
|
||||
.cm-s-vibrant-ink .cm-header { color: #FF6400; }
|
||||
.cm-s-vibrant-ink .cm-hr { color: #AEAEAE; }
|
||||
.cm-s-vibrant-ink .cm-link { color: blue; }
|
||||
@@ -20,10 +20,10 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
.cm-s-xq-dark { background: #0a001f; color: #f8f8f8; }
|
||||
.cm-s-xq-dark.CodeMirror { background: #0a001f; color: #f8f8f8; }
|
||||
.cm-s-xq-dark span.CodeMirror-selected { background: #a8f !important; }
|
||||
.cm-s-xq-dark .CodeMirror-gutter { background: #0a001f; border-right: 1px solid #aaa; }
|
||||
.cm-s-xq-dark .CodeMirror-gutter-text { color: #f8f8f8; }
|
||||
.cm-s-xq-dark .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; }
|
||||
.cm-s-xq-dark .CodeMirror-linenumber { color: #f8f8f8; }
|
||||
.cm-s-xq-dark .CodeMirror-cursor { border-left: 1px solid white !important; }
|
||||
|
||||
.cm-s-xq-dark span.cm-keyword {color: #FFBD40;}
|
||||
43
CodeMirror-3.14/theme/xq-light.css
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
Copyright (C) 2011 by MarkLogic Corporation
|
||||
Author: Mike Brevoort <mike@brevoort.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
.cm-s-xq-light span.cm-keyword {line-height: 1em; font-weight: bold; color: #5A5CAD; }
|
||||
.cm-s-xq-light span.cm-atom {color: #6C8CD5;}
|
||||
.cm-s-xq-light span.cm-number {color: #164;}
|
||||
.cm-s-xq-light span.cm-def {text-decoration:underline;}
|
||||
.cm-s-xq-light span.cm-variable {color: black; }
|
||||
.cm-s-xq-light span.cm-variable-2 {color:black;}
|
||||
.cm-s-xq-light span.cm-variable-3 {color: black; }
|
||||
.cm-s-xq-light span.cm-property {}
|
||||
.cm-s-xq-light span.cm-operator {}
|
||||
.cm-s-xq-light span.cm-comment {color: #0080FF; font-style: italic;}
|
||||
.cm-s-xq-light span.cm-string {color: red;}
|
||||
.cm-s-xq-light span.cm-meta {color: yellow;}
|
||||
.cm-s-xq-light span.cm-error {color: #f00;}
|
||||
.cm-s-xq-light span.cm-qualifier {color: grey}
|
||||
.cm-s-xq-light span.cm-builtin {color: #7EA656;}
|
||||
.cm-s-xq-light span.cm-bracket {color: #cc7;}
|
||||
.cm-s-xq-light span.cm-tag {color: #3F7F7F;}
|
||||
.cm-s-xq-light span.cm-attribute {color: #7F007F;}
|
||||
|
||||
.cm-s-xq-light .CodeMirror-activeline-background {background: #e8f2ff !important;}
|
||||
.cm-s-xq-light .CodeMirror-matchingbracket {border:1px solid grey;color:black !important;background:yellow;}
|
||||
@@ -1,7 +1,7 @@
|
||||
Copyright (C) 2012 Matt Pass
|
||||
Website: mattpass.com
|
||||
Email: matt@mattpass.com
|
||||
Twitter: @mattpass
|
||||
Copyright: © 2013 Matt Pass
|
||||
Website: mattpass.com
|
||||
Email: matt@mattpass.com
|
||||
Twitter: @mattpass
|
||||
|
||||
#ICEcoder License
|
||||
##Standard Open Source Initiative MIT License
|
||||
|
||||
46
README.md
@@ -1,40 +1,12 @@
|
||||
#ICEcoder
|
||||
##Web based IDE for smart web development
|
||||
##Web IDE / browser code editor awesomeness
|
||||
|
||||
Early version of the web based IDE which allows for creation of websites in the web browser. Uses the brilliant CodeMirror for code highlighting & editing, with a slick IDE wrapped around it to make the whole thing work.
|
||||
ICEcoder is a web IDE / browser based code editor, which allows you to develop websites directly within the web browser. It uses the brilliant CodeMirror for code highlighting & editing, with a slick IDE wrapped around it to make the whole thing work.
|
||||
|
||||
###Features you'd expect
|
||||
* Context aware code highlighting
|
||||
* Supports HTML, CSS, JavaScript, PHP & Ruby
|
||||
* Smart tab key system (selected text indents line)
|
||||
* File manager
|
||||
* Find & replace/replace all
|
||||
* Document tabs indicate current doc & changes made
|
||||
* Code folding
|
||||
* Open last files on load
|
||||
* Web based, access from anywhere
|
||||
* Free, open source & customisable
|
||||
<img src="http://icecoder.net/images/icecoder-v3-0-browser-code-editor.png" alt="ICEcoder web IDE">
|
||||
|
||||
###Cool features you wouldn't expect
|
||||
* Find & replace in current doc, open docs, files & filenames
|
||||
* Found match & current position counter
|
||||
* Indicates content type cursor is on
|
||||
* Account login to keep certain files secure
|
||||
* Restrict files, ban files and restrict by IP
|
||||
* Settings to change functionality & editor theme
|
||||
* Code Assist system
|
||||
* Displays nest position of text cursor, hover to select, click to set cursor
|
||||
* Nest structure OK/broken indicator
|
||||
* Highlight word and press CTRL+I to Google search that
|
||||
* Adds end tags as you type and in a context aware way
|
||||
* Can rename open files (whoaah!)
|
||||
* CTRL+Enter open current webpage in new tab
|
||||
* CTRL+S+Enter opens a sticky tab to show live edits
|
||||
* ESC = Comment/Uncomment line, incl partial lines
|
||||
* Image viewer
|
||||
* Colour preview block on CSS colours, ie red, #ff0000 or RGBA(255,0,0,0.5)
|
||||
* MySQL Database management via Adminer plugin
|
||||
* Backs up files every 10 mins or on click of backup plugin icon
|
||||
###Requirements
|
||||
You can run ICEcoder either online or locally, on Linux, Windows or Mac based platforms. The only requirement is to have PHP 5 available (5.3 recommended). You can have this either as a vanilla installation or via a program such as WAMP or XAMPP (for Windows) or MAMP (for Mac).
|
||||
|
||||
###Installation
|
||||
|
||||
@@ -44,10 +16,10 @@ Early version of the web based IDE which allows for creation of websites in the
|
||||
$ git clone git@github:mattpass/ICEcoder
|
||||
```
|
||||
|
||||
####Step 2: Upload the files (Linux or Windows hosting OK)
|
||||
####Step 2: Place in your document root (online or local)
|
||||
```
|
||||
Upload to a new sub-dir URL such as yourdomain.com/_coder
|
||||
Set public write permissions on the lib/config.php file
|
||||
Put in a new sub-dir URL such as yourdomain.com/_coder or localhost/_coder
|
||||
Set write permissions (757 or 775 depending on your system) on the 'backups', 'lib' and 'test' folders
|
||||
```
|
||||
|
||||
####Step 3: Start coding
|
||||
@@ -58,7 +30,7 @@ Now you're setup, auto-logged in and ready to code!
|
||||
|
||||
Suitable for commercial & non-commercial projects, just let me know if it's useful to you and any cool customisations you make to it. I take no responsibility for anything, your usage is all down to you.
|
||||
|
||||
Is fully open source and I'd encourage you to take it, make it your own and customise to your hearts content! :)
|
||||
It's fully open source and MIT licensed. I'm happy for you to take it, make it your own and customise to your hearts content and/or contribute to this main repo! :)
|
||||
|
||||
Plenty of comments included in the code to assist with understanding, customising etc.
|
||||
|
||||
|
||||
0
backups/.gitkeep
Normal file
404
editor.php
@@ -1,167 +1,291 @@
|
||||
<?php include("lib/settings.php");?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html style="margin: 0">
|
||||
<html style="margin: 0" onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false; if (!top.ICEcoder.overCloseLink) {top.ICEcoder.tabDragEnd()}" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'editor');top.ICEcoder.canResizeFilesW()}">
|
||||
<head>
|
||||
<title>CodeMirror 2: ICE Coders Editor of Choice</title>
|
||||
<?php include("lib/settings.php");?>
|
||||
<link rel="stylesheet" href="<?php echo $codeMirrorDir; ?>/lib/codemirror.css">
|
||||
<script src="<?php echo $codeMirrorDir; ?>/lib/codemirror.js"></script>
|
||||
<script src="<?php echo $codeMirrorDir; ?>/mode/clike/clike.js"></script>
|
||||
<script src="<?php echo $codeMirrorDir; ?>/mode/css/css.js"></script>
|
||||
<script src="<?php echo $codeMirrorDir; ?>/mode/javascript/javascript.js"></script>
|
||||
<script src="<?php echo $codeMirrorDir; ?>/mode/xml/xml.js"></script>
|
||||
<script src="<?php echo $codeMirrorDir; ?>/mode/coffeescript/coffeescript.js"></script>
|
||||
<script src="<?php echo $codeMirrorDir; ?>/mode/php/php.js"></script>
|
||||
<script src="<?php echo $codeMirrorDir; ?>/mode/ruby/ruby.js"></script>
|
||||
<script src="<?php echo $codeMirrorDir; ?>/lib/util/searchcursor.js"></script>
|
||||
<script src="<?php echo $codeMirrorDir; ?>/lib/util/match-highlighter.js"></script>
|
||||
<script src="<?php echo $codeMirrorDir; ?>/lib/util/foldcode.js"></script>
|
||||
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?> editor</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<link rel="stylesheet" href="<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror.css">
|
||||
<link rel="stylesheet" href="<?php echo $ICEcoder["codeMirrorDir"]; ?>/addon/hint/show-hint.css">
|
||||
<link rel="stylesheet" href="<?php echo $ICEcoder["codeMirrorDir"]; ?>/addon/lint/lint.css">
|
||||
<!--
|
||||
codemirror-compressed.js
|
||||
incls: codemirror
|
||||
modes: clike, coffeescript, css, htmlmixed, javascript, less, markdown, php, python, ruby & xml
|
||||
addon: brace-fold, closetag, html-hint, javascript-hint, javascript-lint, lint, match-highlighter, searchcursor, show-hint, trailingspace, xml-fold
|
||||
//-->
|
||||
<script src="<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror-compressed.js"></script>
|
||||
<script src="jshint/jshint-2.1.4.min.js"></script>
|
||||
<script src="lib/mmd.js"></script>
|
||||
<script src="lib/foldcode.js"></script>
|
||||
<?php
|
||||
if ($theme=="default") {
|
||||
echo '<link rel="stylesheet" href="lib/editor.css">';
|
||||
} else {
|
||||
echo '<link rel="stylesheet" href="'.$codeMirrorDir.'/theme/'.$theme.'.css">';
|
||||
}
|
||||
?>
|
||||
if (file_exists(dirname(__FILE__)."/plugins/emmet/emmet.min.js")) {
|
||||
echo '<script src="plugins/emmet/emmet.min.js"></script>';
|
||||
};?>
|
||||
<link rel="stylesheet" href="<?php
|
||||
if ($ICEcoder["theme"]=="default") {echo 'lib/editor.css';} else {echo $ICEcoder["codeMirrorDir"].'/theme/'.$ICEcoder["theme"].'.css';};
|
||||
$activeLineBG = array_search($ICEcoder["theme"],array("eclipse","elegant","neat","solarized","xq-light")) !== false ? "#ccc" : "#000";
|
||||
?>">
|
||||
|
||||
<style type="text/css">
|
||||
.CodeMirror {position: absolute; width: 0; background-color: #fff; top: 0px; z-index: 1}
|
||||
.CodeMirror-scroll {width: 100px; height: 100px;}
|
||||
.cm-s-visible {display: block; top: 0}
|
||||
.cm-s-hidden {display: none; top: 4000px}
|
||||
.cm-s-activeLine {background: #002 !important;}
|
||||
// Make sure this next one remains the 5th item, updated with JS
|
||||
.cm-tab:after {position: relative; display: inline-block; width: 0; left: -1.4em; overflow: visible; color: #aaa; content: "<?php if ($visibleTabs) {?>\21e5<?;};?>";}
|
||||
span.CodeMirror-matchhighlight {background: #555}
|
||||
.CodeMirror-focused span.CodeMirror-matchhighlight {color: #000; background: #555; !important}
|
||||
/* Make sure this next one remains the 1st item, updated with JS */
|
||||
.CodeMirror {position: absolute; top: 0; width: 100%; font-size: <?php echo $ICEcoder["fontSize"];?>; z-index: 1}
|
||||
.CodeMirror-scroll {} /* was: height: auto; overflow: visible */
|
||||
/* Make sure this next one remains the 3rd item, updated with JS */
|
||||
.cm-s-activeLine {background: <?php echo $activeLineBG;?> !important}
|
||||
.cm-matchhighlight, .CodeMirror-focused .cm-matchhighlight {color: #fff !important; background: #06c !important}
|
||||
/* Make sure this next one remains the 5th item, updated with JS */
|
||||
.cm-tab:after {position: relative; display: inline-block; width: 0; left: -1.4em; overflow: visible; color: #aaa; content: "<?php if($ICEcoder["visibleTabs"]) {echo '\\21e5';};?>";}
|
||||
.cm-trailingspace {
|
||||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAACCAYAAAB/qH1jAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QUXCToH00Y1UgAAACFJREFUCNdjPMDBUc/AwNDAAAFMTAwMDA0OP34wQgX/AQBYgwYEx4f9lQAAAABJRU5ErkJggg==);
|
||||
background-position: bottom left;
|
||||
background-repeat: repeat-x;
|
||||
}
|
||||
.CodeMirror-foldmarker {font-family: arial; line-height: .3; color: #b00; cursor: pointer;
|
||||
text-shadow: #fff 1px 1px 2px, #fff -1px -1px 2px, #fff 1px -1px 2px, #fff -1px 1px 2px;
|
||||
}
|
||||
.folds {display: inline-block; width: 13px}
|
||||
.fold {position: absolute; display: inline-block; width: 13px; height: 13px; font-size: 14px; text-align: center; cursor: pointer}
|
||||
.foldOn {background: #800; color: #ddd}
|
||||
.foldOff {background: rgba(255,255,255,0.04); color: #666}
|
||||
.demoArrow {position: absolute; display: inline-block; width: 99px; height: 50px; top: 0; right: 30px; background: url('images/big-arrow.gif') 0 -10px no-repeat; text-align: center; font-family: arial; font-size: 10px; padding-top: 60px}
|
||||
h2 {color: rgba(0,198,255,0.7)}
|
||||
.heading {color:#888}
|
||||
</style>
|
||||
<link rel="stylesheet" href="lib/file-types.css">
|
||||
</head>
|
||||
|
||||
<body onLoad="top.ICEcoder.updateFileFolderCount()" style="color: #fff; margin: 0" onKeyDown="return top.ICEcoder.interceptKeys('content', event);" onKeyUp="top.ICEcoder.resetKeys(event);">
|
||||
<body style="color: #fff; margin: 0" onKeyDown="return top.ICEcoder.interceptKeys('content', event);" onKeyUp="top.ICEcoder.resetKeys(event);">
|
||||
|
||||
<div style="margin: 32px 43px; font-family: arial; font-size: 10px; color: #dddddd">
|
||||
<?php if($_SESSION['userLevel'] == 10) {
|
||||
echo '<h2 style="color: rgba(0,198,255,0.7)">server</h2>'.PHP_EOL;
|
||||
echo '<span style="color:#888">Server name:</span><br>'.PHP_EOL;
|
||||
echo $_SERVER['SERVER_NAME'].'<br><br>'.PHP_EOL;
|
||||
echo '<span style="color:#888">Server OS:</span><br>'.PHP_EOL;
|
||||
echo $_SERVER['SERVER_SOFTWARE'].'<br><br>'.PHP_EOL;
|
||||
echo '<span style="color:#888">Server IP:</span><br>'.PHP_EOL;
|
||||
echo $_SERVER['SERVER_ADDR'].'<br><br>'.PHP_EOL;
|
||||
echo '<span style="color:#888">Root:</span><br>'.PHP_EOL;
|
||||
echo $_SERVER['DOCUMENT_ROOT'].'<br><br>'.PHP_EOL;
|
||||
echo '<span style="color:#888">PHP version:</span><br>'.PHP_EOL;
|
||||
echo phpversion().'<br><br>'.PHP_EOL;
|
||||
echo '<span style="color:#888">File & folder count:</span><br>'.PHP_EOL;
|
||||
echo '<div id="fileFolderCounts"></div><br><br><br>'.PHP_EOL;
|
||||
<?php if ($ICEcoder['demoMode']) {?>
|
||||
<div class="demoArrow"><b>Click icons<br>for help &<br>usage info</b></div>
|
||||
<?php ;}; ?>
|
||||
|
||||
echo '<h2 style="color: rgba(0,198,255,0.7)">your device</h2>'.PHP_EOL;
|
||||
echo '<span style="color:#888">Browser:</span><br>'.PHP_EOL;
|
||||
echo $_SERVER['HTTP_USER_AGENT'].'<br><br>'.PHP_EOL;
|
||||
echo '<span style="color:#888">Your IP:</span><br>'.PHP_EOL;
|
||||
echo $_SERVER['REMOTE_ADDR'].'<br><br><br>'.PHP_EOL;
|
||||
<div style="display: none; margin: 32px 43px 0 43px; padding: 10px; width: 500px; font-family: arial; font-size: 10px; color: #ddd; background: #333" id="dataMessage"></div>
|
||||
|
||||
echo '<h2 style="color: rgba(0,198,255,0.7)">general</h2>'.PHP_EOL;
|
||||
echo '<span style="color:#888">Date & time:</span><br>'.PHP_EOL;
|
||||
echo date("D jS M Y g:i:sa").'<br><br>'.PHP_EOL;
|
||||
}; ?>
|
||||
<div style="margin: 20px 43px 32px 43px; font-family: arial; font-size: 10px; color: #ddd">
|
||||
<div style="float: left; margin-right: 50px">
|
||||
<h2>server</h2>
|
||||
<span class="heading">Server name, OS & IP:</span><br>
|
||||
<?php echo $_SERVER['SERVER_NAME']."   ".$_SERVER['SERVER_SOFTWARE']."   ".$_SERVER['SERVER_ADDR'];?><br><br>
|
||||
<span class="heading">Root:</span><br>
|
||||
<?php echo $docRoot;?><br><br>
|
||||
<span class="heading">ICEcoder root:</span><br>
|
||||
<?php echo $docRoot.$iceRoot;?><br><br>
|
||||
<span class="heading">PHP version:</span><br>
|
||||
<?php echo phpversion();?><br><br>
|
||||
<span class="heading">Date & time:</span><br>
|
||||
<span id="serverDT"></span><br><br><br>
|
||||
</div>
|
||||
|
||||
<div style="float: left">
|
||||
<h2>files</h2>
|
||||
<span class="heading">Last 10 files opened:</span><br>
|
||||
<ul class="fileManager" style="margin-left: 0; line-height: 20px">
|
||||
<?php
|
||||
$last10FilesArray = explode(",",$ICEcoder["last10Files"]);
|
||||
for ($i=0;$i<count($last10FilesArray);$i++) {
|
||||
if ($ICEcoder["last10Files"]=="") {
|
||||
echo '<div style="display: inline-block; margin-left: -39px; margin-top: -18px">[none]</div><br><br>';
|
||||
} else {
|
||||
$fileFolderName = str_replace("\\","/",$last10FilesArray[$i]);
|
||||
// Get extension (prefix 'ext-' to prevent invalid classes from extensions that begin with numbers)
|
||||
$ext = "ext-".pathinfo($docRoot.$iceRoot.$fileFolderName, PATHINFO_EXTENSION);
|
||||
echo '<li class="pft-file '.strtolower($ext).'" style="margin-left: -21px">';
|
||||
echo '<a style="cursor:pointer" onClick="top.ICEcoder.openFile(\''.str_replace("|","/",$last10FilesArray[$i]).'\')">';
|
||||
echo str_replace($docRoot,"",str_replace("|","/",$last10FilesArray[$i]));
|
||||
echo '</a></li>'.PHP_EOL;
|
||||
if ($i==count($last10FilesArray)-1) {echo '<br>'.PHP_EOL;};
|
||||
}
|
||||
}
|
||||
;?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div style="clear: both">
|
||||
<h2>your device</h2>
|
||||
<span class="heading">Browser:</span><br>
|
||||
<?php echo $_SERVER['HTTP_USER_AGENT'];?><br><br>
|
||||
<span class="heading">Your IP:</span><br>
|
||||
<?php echo $_SERVER['REMOTE_ADDR'];?>
|
||||
</div>
|
||||
<script>
|
||||
var nDT=<?php echo time()*1000;?>;
|
||||
setInterval(function(){
|
||||
var s=(new Date(nDT+=1e3)+'').split(' '),
|
||||
d=s[2]*1,
|
||||
t=s[4].split(':'),
|
||||
p=t[0]>11?'pm':'am',
|
||||
e=d%20==1|d>30?'st':d%20==2?'nd':d%20==3?'rd':'th';
|
||||
t[0]=--t[0]%12+1;
|
||||
if (document.getElementById('serverDT')) {
|
||||
document.getElementById('serverDT').innerHTML=[s[0],d+e,s[1],s[3],t.join(':')+p].join(' ');
|
||||
}
|
||||
},1000);
|
||||
</script>
|
||||
<?php if(is_dir('test') && !$ICEcoder['demoMode']) {?>
|
||||
<div style="float: left; margin-right: 50px">
|
||||
<br><br>
|
||||
<h2>test suite</h2>
|
||||
<span class="heading">Run unit tests:</span><br>
|
||||
<a href="javascript:top.ICEcoder.filesFrame.contentWindow.frames['testControl'].location.href = 'test'" style="color: #fff">Run unit tests</a><div id="unitTestResults"></div>
|
||||
</div>
|
||||
<?php
|
||||
;};
|
||||
if($ICEcoder['devMode']) {?>
|
||||
<div style="float: left">
|
||||
<br><br>
|
||||
<h2>dev mode on</h2>
|
||||
<span class="heading">Status:</span><br>
|
||||
Using ice-coder.js
|
||||
</div>
|
||||
<?php ;};?>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
CodeMirror.keyMap.ICEcoder = {
|
||||
// "Tab": "defaultTab", **Now used by Emmet**
|
||||
"Shift-Tab": "indentLess",
|
||||
"Ctrl-Space": "autocomplete",
|
||||
fallthrough: ["default"]
|
||||
};
|
||||
CodeMirror.commands.autocomplete = function(cm) {
|
||||
CodeMirror.showHint(cm, top.ICEcoder.caretLocType=="JavaScript"
|
||||
? CodeMirror.javascriptHint
|
||||
: CodeMirror.htmlHint
|
||||
);
|
||||
}
|
||||
|
||||
function createNewCMInstance(num) {
|
||||
var fileName = top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];
|
||||
var codeFold = CodeMirror.newFoldFunction(CodeMirror.tagRangeFinder,'<span style=\"display: inline-block; width: 13px; height: 13px; background-color: #b00; color: #fff; text-align: center; cursor: pointer\"><span style="position: relative; top: -1px">+</span></span> %N%');
|
||||
var codeFold_JS_Coffee_PHP_Ruby = CodeMirror.newFoldFunction(CodeMirror.braceRangeFinder,'<span style=\"display: inline-block; width: 13px; height: 13px; background-color: #b00; color: #fff; text-align: center; cursor: pointer\"><span style="position: relative; top: -1px">+</span></span> %N%');
|
||||
|
||||
window['cM'+num] = CodeMirror(document.body, {
|
||||
mode: "application/x-httpd-php",
|
||||
lineNumbers: true,
|
||||
lineWrapping: true,
|
||||
indentUnit: 4,
|
||||
tabSize: 4,
|
||||
indentWithTabs: true,
|
||||
electricChars: false,
|
||||
onCursorActivity: function() {
|
||||
top.ICEcoder.getCaretPosition();
|
||||
top.ICEcoder.updateCharDisplay();
|
||||
window['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].setLineClass(top.ICEcoder['cMActiveLine'+top.ICEcoder.selectedTab], null);
|
||||
if(!window['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].somethingSelected()) {
|
||||
top.ICEcoder['cMActiveLine'+top.ICEcoder.selectedTab] = window['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].setLineClass(window['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].getCursor().line, "cm-s-activeLine");
|
||||
mode: "application/x-httpd-php",
|
||||
lineNumbers: true,
|
||||
gutters: ["folds","CodeMirror-lint-markers","CodeMirror-linenumbers"],
|
||||
lineWrapping: top.ICEcoder.lineWrapping,
|
||||
indentWithTabs: top.ICEcoder.indentWithTabs,
|
||||
indentUnit: top.ICEcoder.indentSize,
|
||||
tabSize: top.ICEcoder.indentSize,
|
||||
electricChars: false,
|
||||
autoCloseTags: true,
|
||||
highlightSelectionMatches: true,
|
||||
showTrailingSpace: true,
|
||||
lintWith: <?php if ($ICEcoder['codeAssist']) {echo 'fileName && fileName.indexOf(".js")>-1 ? CodeMirror.javascriptValidator : ';};?>false,
|
||||
keyMap: "ICEcoder",
|
||||
onKeyEvent: function(thisCM, e) {
|
||||
top.ICEcoder.redoChangedContent(e);
|
||||
top.ICEcoder.findReplace(top.document.getElementById('find').value,true,false);
|
||||
top.ICEcoder.getCaretPosition();
|
||||
top.ICEcoder.updateCharDisplay();
|
||||
top.ICEcoder.updateByteDisplay();
|
||||
tok = thisCM.getTokenAt(thisCM.getCursor());
|
||||
}
|
||||
window['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].matchHighlight("CodeMirror-matchhighlight");
|
||||
top.ICEcoder.cssColorPreview();
|
||||
},
|
||||
onChange: function() {
|
||||
// If we're not loading the file, it's a change, so update tab
|
||||
if (!top.ICEcoder.loadingFile) {
|
||||
top.ICEcoder.changedContent[top.ICEcoder.selectedTab-1] = 1;
|
||||
top.ICEcoder.redoTabHighlight(top.ICEcoder.selectedTab);
|
||||
}
|
||||
top.ICEcoder.getCaretPosition();
|
||||
top.ICEcoder.dontUpdateNest = false;
|
||||
top.ICEcoder.updateCharDisplay();
|
||||
top.ICEcoder.updateNestingIndicator();
|
||||
if (top.ICEcoder.findMode) {
|
||||
top.ICEcoder.results.splice(top.ICEcoder.findResult,1);
|
||||
top.document.getElementById('results').innerHTML = top.ICEcoder.results.length + " results";
|
||||
top.ICEcoder.findMode = false;
|
||||
}
|
||||
},
|
||||
onKeyEvent: function(instance, e) {
|
||||
top.ICEcoder.redoChangedContent(e);
|
||||
top.ICEcoder.findReplace('find',true,false);
|
||||
top.ICEcoder.getCaretPosition();
|
||||
top.ICEcoder.updateCharDisplay();
|
||||
tok = window['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].getTokenAt(window['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].getCursor());
|
||||
if (tok.string!=">") {lastString=tok.string};
|
||||
if (e.type=="keyup"&&e.keyCode=="16"&&lastKeyCode=="190") {
|
||||
canDoEndTag=true;
|
||||
for (i=0;i<top.ICEcoder.tagNestExceptions.length;i++) {
|
||||
if(top.ICEcoder.tagString!="script" && top.ICEcoder.tagString==top.ICEcoder.tagNestExceptions[i]) {
|
||||
canDoEndTag=false;
|
||||
}
|
||||
}
|
||||
if(top.ICEcoder.tagString.slice(0,1)=="/"||top.ICEcoder.tagString.slice(0,1)=="?") {
|
||||
canDoEndTag=false;
|
||||
}
|
||||
if (!top.ICEcoder.codeAssist||fileName.indexOf(".js")>0||fileName.indexOf(".css")>0) {
|
||||
canDoEndTag=false;
|
||||
}
|
||||
contentType = top.ICEcoder.caretLocType;
|
||||
if (canDoEndTag && (contentType!="JavaScript"||(contentType=="JavaScript"&&top.ICEcoder.tagString=="script"))) {
|
||||
numTabs = top.ICEcoder.htmlTagArray.length;
|
||||
if (top.ICEcoder.htmlTagArray[0]=="html") {numTabs--};
|
||||
tabs = "";
|
||||
for (i=0;i<numTabs-1;i++) {
|
||||
tabs += "\t";
|
||||
}
|
||||
//endTag = "</" + top.ICEcoder.htmlTagArray[top.ICEcoder.htmlTagArray.length-1] + ">";
|
||||
endTag = "</" + top.ICEcoder.tagString + ">";
|
||||
if (top.ICEcoder.tagString=="script") {endTag="</"+"script>"};
|
||||
if(top.ICEcoder.tagString=="title"||top.ICEcoder.tagString=="a"||top.ICEcoder.tagString=="li"||top.ICEcoder.tagString=="span"||(top.ICEcoder.tagString.slice(0,1)=="h"&&parseInt(top.ICEcoder.tagString.slice(1,2),10)>=1&&parseInt(top.ICEcoder.tagString.slice(1,2),10)<=7)) {
|
||||
window['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].replaceSelection(endTag);
|
||||
window['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].setCursor(window['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].getCursor().line,window['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].getCursor().ch-top.ICEcoder.tagString.length-3);
|
||||
} else if(top.ICEcoder.tagString=="html"||top.ICEcoder.tagString=="head") {
|
||||
window['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].replaceSelection("\n\n"+endTag);
|
||||
window['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].setCursor(window['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].getCursor().line-1,numTabs);
|
||||
} else {
|
||||
window['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].replaceSelection("\n"+tabs+"\t\n"+tabs+endTag);
|
||||
window['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].setCursor(window['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].getCursor().line-1,numTabs);
|
||||
}
|
||||
}
|
||||
};
|
||||
lastKeyCode = e.keyCode;
|
||||
},
|
||||
onGutterClick: !fileName || (fileName && fileName.indexOf(".js") == -1 && fileName.indexOf(".coffee") == -1 && fileName.indexOf(".php") && fileName.indexOf(".rb") == -1) ? codeFold : codeFold_JS_Coffee_PHP_Ruby,
|
||||
extraKeys: {
|
||||
"Tab": function(cm) {CodeMirror.commands[top.tabsIndent ? "defaultTab" : "insertTab"](cm);},
|
||||
"Shift-Tab": "indentLess"
|
||||
}
|
||||
});
|
||||
|
||||
window['cM'+num].on("cursorActivity", function(thisCM) {
|
||||
top.ICEcoder.getCaretPosition();
|
||||
top.ICEcoder.updateCharDisplay();
|
||||
top.ICEcoder.updateByteDisplay();
|
||||
window['cM'+num].removeLineClass(top.ICEcoder['cMActiveLine'+num], "background");
|
||||
if(window['cM'+num].getCursor('start').line == window['cM'+num].getCursor().line) {
|
||||
top.ICEcoder['cMActiveLine'+num] = window['cM'+num].addLineClass(window['cM'+num].getCursor().line, "background","cm-s-activeLine");
|
||||
}
|
||||
if (top.ICEcoder.caretLocType=="CSS") {
|
||||
top.ICEcoder.cssColorPreview();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
window['cM'+num].on("change", function(thisCM, changeObj) {
|
||||
// If we're not loading the file, it's a change, so update tab
|
||||
if (!top.ICEcoder.loadingFile) {
|
||||
top.ICEcoder.changedContent[top.ICEcoder.selectedTab-1] = thisCM.historySize().undo > 0 ? 1 : 0;
|
||||
top.ICEcoder.redoTabHighlight(top.ICEcoder.selectedTab);
|
||||
}
|
||||
top.ICEcoder.getCaretPosition();
|
||||
top.ICEcoder.dontUpdateNest = false;
|
||||
top.ICEcoder.updateCharDisplay();
|
||||
top.ICEcoder.updateByteDisplay();
|
||||
top.ICEcoder.updateNestingIndicator();
|
||||
if (top.ICEcoder.findMode) {
|
||||
top.ICEcoder.results.splice(top.ICEcoder.findResult,1);
|
||||
top.document.getElementById('results').innerHTML = top.ICEcoder.results.length + " results";
|
||||
top.ICEcoder.findMode = false;
|
||||
}
|
||||
var filepath = top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];
|
||||
if (filepath) {
|
||||
var filename = filepath.substr(filepath.lastIndexOf("/")+1);
|
||||
var fileExt = filename.substr(filename.lastIndexOf(".")+1);
|
||||
for (var i=changeObj.from.line; i<changeObj.from.line+changeObj.text.length; i++) {
|
||||
top.ICEcoder.content.contentWindow.CodeMirror.newFoldFunction(top.ICEcoder.content.contentWindow.CodeMirror[
|
||||
window['cM'+num].getLine(i).indexOf("{")>-1
|
||||
? "braceRangeFinder"
|
||||
: "tagRangeFinder"
|
||||
],null,"+","-",true)(thisCM, i);
|
||||
}
|
||||
if (changeObj.text[0] == "}" || changeObj.removed && changeObj.removed[0] == "}") {
|
||||
cursor = window['cM'+num].getSearchCursor("{",window['cM'+num].getCursor(),false);
|
||||
cursor.findPrevious();
|
||||
for (var i=cursor.from().line; i<window['cM'+num].getCursor().line; i++) {
|
||||
top.ICEcoder.content.contentWindow.CodeMirror.newFoldFunction(top.ICEcoder.content.contentWindow.CodeMirror[
|
||||
window['cM'+num].getLine(i).indexOf("{")>-1
|
||||
? "braceRangeFinder"
|
||||
: "tagRangeFinder"
|
||||
],null,"+","-",true)(thisCM, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Update HTML edited files live
|
||||
if (filepath && top.ICEcoder.previewWindow.location) {
|
||||
if (top.ICEcoder.previewWindow.location.pathname==filepath) {
|
||||
if (["htm","html","txt"].indexOf(fileExt) > -1) {
|
||||
top.ICEcoder.previewWindow.document.documentElement.innerHTML = window['cM'+num].getValue();
|
||||
} else if (["md"].indexOf(fileExt) > -1) {
|
||||
top.ICEcoder.previewWindow.document.documentElement.innerHTML = mmd(window['cM'+num].getValue());
|
||||
}
|
||||
} else if (["css"].indexOf(fileExt) > -1) {
|
||||
if (top.ICEcoder.previewWindow.document.documentElement.innerHTML.indexOf(filename) > -1) {
|
||||
var css = window['cM'+num].getValue();
|
||||
var style = document.createElement('style');
|
||||
style.type = 'text/css';
|
||||
style.id = "ICEcoder"+filepath.replace(/\//g,"_");
|
||||
if (style.styleSheet){
|
||||
style.styleSheet.cssText = css;
|
||||
} else {
|
||||
style.appendChild(document.createTextNode(css));
|
||||
}
|
||||
if (top.ICEcoder.previewWindow.document.getElementById(style.id)) {
|
||||
top.ICEcoder.previewWindow.document.documentElement.removeChild(top.ICEcoder.previewWindow.document.getElementById(style.id));
|
||||
}
|
||||
top.ICEcoder.previewWindow.document.documentElement.appendChild(style);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
window['cM'+num].on("scroll", function(thisCM) {
|
||||
top.ICEcoder.mouseDown=false;
|
||||
}
|
||||
);
|
||||
|
||||
window['cM'+num].on("gutterClick", function(thisCM, line, gutter, clickEvent) {
|
||||
var filepath = top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];
|
||||
var fileExt = filepath.substr(filepath.lastIndexOf(".")+1);
|
||||
window['cM'+num].getLine(line).indexOf("{")>-1
|
||||
? codeFoldBrace(window['cM'+num], line) : codeFoldTag(window['cM'+num], line);
|
||||
}
|
||||
);
|
||||
|
||||
// Now create the active line for this CodeMirror object
|
||||
top.ICEcoder['cMActiveLine'+top.ICEcoder.selectedTab] = window['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].setLineClass(0, "cm-s-activeLine");
|
||||
top.ICEcoder['cMActiveLine'+num] = window['cM'+num].addLineClass(0, "background", "cm-s-activeLine");
|
||||
};
|
||||
|
||||
var codeFoldTag = CodeMirror.newFoldFunction(CodeMirror.tagRangeFinder,null,"+","-",false);
|
||||
var codeFoldBrace = CodeMirror.newFoldFunction(CodeMirror.braceRangeFinder,null,"+","-",false);
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
49
farbtastic/farbtastic.css
Normal file
@@ -0,0 +1,49 @@
|
||||
.picker {
|
||||
display: inline-block;
|
||||
}
|
||||
.farbtastic {
|
||||
position: relative;
|
||||
}
|
||||
.farbtastic * {
|
||||
position: absolute;
|
||||
cursor: crosshair;
|
||||
}
|
||||
.farbtastic, .farbtastic .wheel {
|
||||
width: 195px;
|
||||
height: 195px;
|
||||
}
|
||||
.farbtastic .color, .farbtastic .overlay {
|
||||
top: 47px;
|
||||
left: 47px;
|
||||
width: 101px;
|
||||
height: 101px;
|
||||
}
|
||||
.farbtastic .wheel {
|
||||
background: url(wheel.png) no-repeat;
|
||||
width: 195px;
|
||||
height: 195px;
|
||||
}
|
||||
.farbtastic .overlay {
|
||||
background: url(mask.png) no-repeat;
|
||||
}
|
||||
.farbtastic .marker {
|
||||
width: 17px;
|
||||
height: 17px;
|
||||
margin: -8px 0 0 -8px;
|
||||
overflow: hidden;
|
||||
background: url(marker.png) no-repeat;
|
||||
}
|
||||
.colorValue {
|
||||
border: 0;
|
||||
width: 105px;
|
||||
padding-left: 5px
|
||||
}
|
||||
.insertColorValue {
|
||||
background: #888;
|
||||
color: #fff;
|
||||
height: 18px;
|
||||
width: 60px;
|
||||
border: 0;
|
||||
margin-left: 5px;
|
||||
cursor: pointer
|
||||
}
|
||||
253
farbtastic/farbtastic.js
Normal file
@@ -0,0 +1,253 @@
|
||||
/*!
|
||||
* Farbtastic: NON jQuery color picker plug-in v1.4, based on v1.3u
|
||||
*
|
||||
* Licensed under the GPL license:
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*/
|
||||
|
||||
farbtasticFunc = function (options) {
|
||||
farbtastic(this, options);
|
||||
return this;
|
||||
};
|
||||
|
||||
farbtastic = function (container, callback) {
|
||||
var container = document.getElementById(container);
|
||||
var callback = document.getElementById(callback);
|
||||
return container.farbtastic || (container.farbtastic = new _farbtastic(container, callback));
|
||||
};
|
||||
|
||||
_farbtastic = function (container, callback) {
|
||||
// Store farbtastic object
|
||||
var fb = this;
|
||||
|
||||
// Insert markup
|
||||
container.innerHTML = '<div class="farbtastic"><div class="color"></div><div class="wheel"></div><div class="overlay"></div><div class="h-marker marker"></div><div class="sl-marker marker"></div></div>';
|
||||
fb.wheel = document.getElementsByClassName('wheel')[0];
|
||||
// Dimensions
|
||||
fb.radius = 84;
|
||||
fb.square = 100;
|
||||
fb.width = 194;
|
||||
|
||||
/**
|
||||
* Link to the given element(s) or callback.
|
||||
*/
|
||||
fb.linkTo = function (callback) {
|
||||
// Unbind previous nodes
|
||||
if (typeof fb.callback == 'object') {
|
||||
console.log("Doesn't do anything?");
|
||||
fb.callback.removeEventListener('keyup', fb.updateValue);
|
||||
}
|
||||
|
||||
// Reset color
|
||||
fb.color = null;
|
||||
|
||||
// Bind callback or elements
|
||||
if (typeof callback == 'function') {
|
||||
fb.callback = callback;
|
||||
}
|
||||
else if (typeof callback == 'object' || typeof callback == 'string') {
|
||||
fb.callback = callback;
|
||||
fb.callback.addEventListener('keyup',fb.updateValue);
|
||||
if (fb.callback.value) {
|
||||
fb.setColor(fb.callback.value);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
};
|
||||
fb.updateValue = function (event) {
|
||||
if (this.value && this.value != fb.color) {
|
||||
fb.setColor(this.value);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Change color with HTML syntax #123456
|
||||
*/
|
||||
fb.setColor = function (color) {
|
||||
var unpack = fb.unpack(color);
|
||||
if (fb.color != color && unpack) {
|
||||
fb.color = color;
|
||||
fb.rgb = unpack;
|
||||
fb.hsl = fb.RGBToHSL(fb.rgb);
|
||||
fb.updateDisplay();
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Change color with HSL triplet [0..1, 0..1, 0..1]
|
||||
*/
|
||||
fb.setHSL = function (hsl) {
|
||||
fb.hsl = hsl;
|
||||
fb.rgb = fb.HSLToRGB(hsl);
|
||||
fb.color = fb.pack(fb.rgb);
|
||||
fb.updateDisplay();
|
||||
return this;
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Retrieve the coordinates of the given event relative to the center
|
||||
* of the widget.
|
||||
*/
|
||||
fb.widgetCoords = function (event) {
|
||||
return { x: (event.pageX - fb.wheel.offsetParent.offsetLeft) - fb.width / 2, y: (event.pageY - fb.wheel.offsetParent.offsetTop) - fb.width / 2 };
|
||||
};
|
||||
|
||||
/**
|
||||
* Mousedown handler
|
||||
*/
|
||||
fb.mousedown = function (event) {
|
||||
// Capture mouse
|
||||
if (!document.dragging) {
|
||||
document.addEventListener('mousemove', fb.mousemove);
|
||||
document.addEventListener('mouseup', fb.mouseup);
|
||||
document.dragging = true;
|
||||
}
|
||||
|
||||
// Check which area is being dragged
|
||||
var pos = fb.widgetCoords(event);
|
||||
fb.circleDrag = Math.max(Math.abs(pos.x), Math.abs(pos.y)) * 2 > fb.square;
|
||||
|
||||
// Process
|
||||
fb.mousemove(event);
|
||||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Mousemove handler
|
||||
*/
|
||||
fb.mousemove = function (event) {
|
||||
// Get coordinates relative to color picker center
|
||||
var pos = fb.widgetCoords(event);
|
||||
|
||||
// Set new HSL parameters
|
||||
if (fb.circleDrag) {
|
||||
var hue = Math.atan2(pos.x, -pos.y) / 6.28;
|
||||
if (hue < 0) hue += 1;
|
||||
fb.setHSL([hue, fb.hsl[1], fb.hsl[2]]);
|
||||
}
|
||||
else {
|
||||
var sat = Math.max(0, Math.min(1, -(pos.x / fb.square) + .5));
|
||||
var lum = Math.max(0, Math.min(1, -(pos.y / fb.square) + .5));
|
||||
fb.setHSL([fb.hsl[0], sat, lum]);
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Mouseup handler
|
||||
*/
|
||||
fb.mouseup = function () {
|
||||
// Uncapture mouse
|
||||
document.removeEventListener('mousemove', fb.mousemove);
|
||||
document.removeEventListener('mouseup', fb.mouseup);
|
||||
document.dragging = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Update the markers and styles
|
||||
*/
|
||||
fb.updateDisplay = function () {
|
||||
// Markers
|
||||
var angle = fb.hsl[0] * 6.28;
|
||||
document.getElementsByClassName('h-marker')[0].style.left = Math.round(Math.sin(angle) * fb.radius + fb.width / 2) + 'px';
|
||||
document.getElementsByClassName('h-marker')[0].style.top = Math.round(-Math.cos(angle) * fb.radius + fb.width / 2) + 'px';
|
||||
|
||||
document.getElementsByClassName('sl-marker')[0].style.left = Math.round(fb.square * (.5 - fb.hsl[1]) + fb.width / 2) + 'px';
|
||||
document.getElementsByClassName('sl-marker')[0].style.top = Math.round(fb.square * (.5 - fb.hsl[2]) + fb.width / 2) + 'px';
|
||||
|
||||
// Saturation/Luminance gradient
|
||||
document.getElementsByClassName('color')[0].style.backgroundColor = fb.pack(fb.HSLToRGB([fb.hsl[0], 1, 0.5]));
|
||||
|
||||
// Linked elements or callback
|
||||
if (typeof fb.callback == 'object') {
|
||||
// Set background/foreground color
|
||||
document.getElementById(fb.callback.id).style.backgroundColor = document.getElementById(fb.callback.id + 'RGB').style.backgroundColor = fb.color;
|
||||
document.getElementById(fb.callback.id).style.color = document.getElementById(fb.callback.id + 'RGB').style.color = fb.hsl[2] > 0.5 ? '#000' : '#fff';
|
||||
document.getElementById('colorRGB').value = document.getElementById(fb.callback.id).style.backgroundColor.replace(/\s/g,'');
|
||||
|
||||
// Change linked value
|
||||
if (callback.value && callback.value != fb.color) {
|
||||
callback.value = fb.color;
|
||||
}
|
||||
}
|
||||
else if (typeof fb.callback == 'function') {
|
||||
fb.callback.call(fb, fb.color);
|
||||
}
|
||||
};
|
||||
|
||||
/* Various color utility functions */
|
||||
fb.pack = function (rgb) {
|
||||
var r = Math.round(rgb[0] * 255);
|
||||
var g = Math.round(rgb[1] * 255);
|
||||
var b = Math.round(rgb[2] * 255);
|
||||
return '#' + (r < 16 ? '0' : '') + r.toString(16) +
|
||||
(g < 16 ? '0' : '') + g.toString(16) +
|
||||
(b < 16 ? '0' : '') + b.toString(16);
|
||||
};
|
||||
|
||||
fb.unpack = function (color) {
|
||||
if (color.length == 7) {
|
||||
return [parseInt('0x' + color.substring(1, 3)) / 255,
|
||||
parseInt('0x' + color.substring(3, 5)) / 255,
|
||||
parseInt('0x' + color.substring(5, 7)) / 255];
|
||||
}
|
||||
else if (color.length == 4) {
|
||||
return [parseInt('0x' + color.substring(1, 2)) / 15,
|
||||
parseInt('0x' + color.substring(2, 3)) / 15,
|
||||
parseInt('0x' + color.substring(3, 4)) / 15];
|
||||
}
|
||||
};
|
||||
|
||||
fb.HSLToRGB = function (hsl) {
|
||||
var m1, m2, r, g, b;
|
||||
var h = hsl[0], s = hsl[1], l = hsl[2];
|
||||
m2 = (l <= 0.5) ? l * (s + 1) : l + s - l*s;
|
||||
m1 = l * 2 - m2;
|
||||
return [this.hueToRGB(m1, m2, h+0.33333),
|
||||
this.hueToRGB(m1, m2, h),
|
||||
this.hueToRGB(m1, m2, h-0.33333)];
|
||||
};
|
||||
|
||||
fb.hueToRGB = function (m1, m2, h) {
|
||||
h = (h < 0) ? h + 1 : ((h > 1) ? h - 1 : h);
|
||||
if (h * 6 < 1) return m1 + (m2 - m1) * h * 6;
|
||||
if (h * 2 < 1) return m2;
|
||||
if (h * 3 < 2) return m1 + (m2 - m1) * (0.66666 - h) * 6;
|
||||
return m1;
|
||||
};
|
||||
|
||||
fb.RGBToHSL = function (rgb) {
|
||||
var min, max, delta, h, s, l;
|
||||
var r = rgb[0], g = rgb[1], b = rgb[2];
|
||||
min = Math.min(r, Math.min(g, b));
|
||||
max = Math.max(r, Math.max(g, b));
|
||||
delta = max - min;
|
||||
l = (min + max) / 2;
|
||||
s = 0;
|
||||
if (l > 0 && l < 1) {
|
||||
s = delta / (l < 0.5 ? (2 * l) : (2 - 2 * l));
|
||||
}
|
||||
h = 0;
|
||||
if (delta > 0) {
|
||||
if (max == r && max != g) h += (g - b) / delta;
|
||||
if (max == g && max != b) h += (2 + (b - r) / delta);
|
||||
if (max == b && max != r) h += (4 + (r - g) / delta);
|
||||
h /= 6;
|
||||
}
|
||||
return [h, s, l];
|
||||
};
|
||||
|
||||
// Install mousedown handler (the others are set on the document on-demand)
|
||||
document.getElementsByClassName('farbtastic')[0].onmousedown = fb.mousedown;
|
||||
|
||||
// Init color
|
||||
fb.setColor('#000000');
|
||||
|
||||
// Set linked elements/callback
|
||||
if (callback) {
|
||||
fb.linkTo(callback);
|
||||
}
|
||||
};
|
||||
BIN
farbtastic/marker.png
Normal file
|
After Width: | Height: | Size: 652 B |
BIN
farbtastic/mask.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
farbtastic/wheel.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
favicon.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
181
files.php
@@ -1,176 +1,31 @@
|
||||
<?php
|
||||
function fileManager($directory, $return_link) {
|
||||
$code = "";
|
||||
// Generates a list of all directories, sub-directories, and files in $directory
|
||||
// Remove trailing slash
|
||||
if(substr($directory, -1) == "/" ) {$directory = substr($directory, 0, strlen($directory)-1);};
|
||||
$code .= fileManager_dir($directory, $return_link);
|
||||
return $code;
|
||||
}
|
||||
|
||||
function fileManager_dir($directory, $return_link, $first_call=true) {
|
||||
if (!isset($_SESSION['restrictedFiles'])) {include("lib/settings.php");};
|
||||
$restrictedFiles = $_SESSION['restrictedFiles'];
|
||||
$bannedFiles = $_SESSION['bannedFiles'];
|
||||
$docRoot = str_replace("\\","/",$_SERVER['DOCUMENT_ROOT']);
|
||||
if (strrpos($_SERVER['DOCUMENT_ROOT'],":")) {
|
||||
$serverType = "Windows";
|
||||
} else {
|
||||
$serverType = "Linux";
|
||||
}
|
||||
// Chop off trailing slash
|
||||
if (strrpos($docRoot,"/")==strlen($docRoot)-1) {$docRoot = substr($docRoot,0,strlen($docRoot)-1);};
|
||||
$fileManager = "";
|
||||
|
||||
// Recursive function called by fileManager() to list directories/files
|
||||
// Get and sort directories/files
|
||||
if(function_exists("scandir")) {$file = scandir($directory);} else {$file = php4_scandir($directory);};
|
||||
natcasesort($file);
|
||||
|
||||
// Make directories first
|
||||
$files = $dirs = array();
|
||||
foreach($file as $this_file) {
|
||||
if(is_dir("$directory/$this_file")) {$dirs[] = $this_file;} else {$files[] = $this_file;};
|
||||
}
|
||||
|
||||
$file = array_merge($dirs, $files);
|
||||
|
||||
// Filter unwanted files
|
||||
if(!empty($bannedFiles)) {
|
||||
foreach(array_keys($file) as $key) {
|
||||
$fileFolder = $file[$key];
|
||||
for ($i=0;$i<count($bannedFiles);$i++) {
|
||||
if(strpos($fileFolder,$bannedFiles[$i])!==false) {unset($file[$key]);};
|
||||
}
|
||||
}
|
||||
}
|
||||
if(count($file) > 2) { // To ignore . and .. directories
|
||||
if($first_call) {
|
||||
// Root Directory
|
||||
$dirRep = str_replace("\\","/",$directory);
|
||||
$link = str_replace("[link]", "$dirRep/", $return_link);
|
||||
$link = str_replace("//","/",$link);
|
||||
$fileAtts = "";
|
||||
|
||||
if ($serverType=="Linux") {
|
||||
$chmodInfo = substr(sprintf('%o', fileperms($link)), -4);
|
||||
$fileAtts = '<span style="color: #888; font-size: 8px">'.$chmodInfo.'</span>';
|
||||
}
|
||||
$fileManager = "<ul class=\"fileManager\">";
|
||||
$fileManager .= "<li class=\"pft-directory\"><a href=\"#\" onMouseOver=\"top.ICEcoder.overFileFolder('folder','$link')\" onMouseOut=\"top.ICEcoder.overFileFolder('folder','')\" style=\"position: relative; left:-22px\"> <span id=\"|\">/ [ROOT]</span> ".$fileAtts."</a>";
|
||||
$fileManager .= $fileManager .= fileManager_dir("$directory/", $return_link ,false);
|
||||
$fileManager .= "</li>";
|
||||
$first_call = false;
|
||||
} else {
|
||||
$fileManager = "<ul>";
|
||||
}
|
||||
foreach( $file as $this_file ) {
|
||||
$bannedFile=false;
|
||||
for ($i=0;$i<count($bannedFiles);$i++) {
|
||||
if (strpos($directory,$bannedFiles[$i])!=""||strpos($this_file,$bannedFiles[$i])!="") {
|
||||
$bannedFile=true;
|
||||
}
|
||||
}
|
||||
if( $this_file != "." && $this_file != ".." && $bannedFile == false) {
|
||||
if( is_dir("$directory/$this_file") ) {
|
||||
// Directory
|
||||
$dirCount++;
|
||||
$dirRep = str_replace("\\","/",$directory);
|
||||
$link = str_replace("[link]", "$dirRep/" . urlencode($this_file), $return_link);
|
||||
$link = str_replace("//","/",$link);
|
||||
|
||||
$restrictedFile=false;
|
||||
for ($i=0;$i<count($restrictedFiles);$i++) {
|
||||
if (strpos($link,$restrictedFiles[$i])!="") {
|
||||
$restrictedFile=true;
|
||||
}
|
||||
}
|
||||
|
||||
$fileAtts = "";
|
||||
if ($serverType=="Linux") {
|
||||
$chmodInfo = substr(sprintf('%o', fileperms($link)), -4);
|
||||
$fileAtts = '<span style="color: #888; font-size: 8px">'.$chmodInfo.'</span>';
|
||||
}
|
||||
if ($_SESSION['userLevel'] == 10 || ($_SESSION['userLevel'] < 10 && $restrictedFile==false)) {
|
||||
$fileManager .= "<li class=\"pft-directory\"><a href=\"#\" onMouseOver=\"top.ICEcoder.overFileFolder('folder','$link')\" onMouseOut=\"top.ICEcoder.overFileFolder('folder','')\" style=\"position: relative; left:-22px\"> <span id=\"".str_replace("/","|",str_replace($docRoot,"",$link))."\">" . htmlspecialchars($this_file) . "</span> ".$fileAtts."</a>";
|
||||
$fileManager .= fileManager_dir("$directory/$this_file", $return_link , false);
|
||||
$fileManager .= "</li>";
|
||||
} else {
|
||||
$fileManager .= "<li class=\"pft-directory\" style=\"cursor: pointer\"><span style=\"position: relative; left:-22px; color: #888\"> [HIDDEN] ".$fileAtts."</span></li>";
|
||||
}
|
||||
} else {
|
||||
// File
|
||||
$fileCount++;
|
||||
$fileBytes+=filesize($link);
|
||||
// Get extension (prefix 'ext-' to prevent invalid classes from extensions that begin with numbers)
|
||||
$ext = "ext-" . substr($this_file, strrpos($this_file, ".") + 1);
|
||||
$dirRep = str_replace("\\","/",$directory);
|
||||
$link = str_replace("[link]", "$dirRep/" . urlencode($this_file), $return_link);
|
||||
$link = str_replace("//","/",$link);
|
||||
|
||||
$restrictedFile=false;
|
||||
for ($i=0;$i<count($restrictedFiles);$i++) {
|
||||
if (strpos($link,$restrictedFiles[$i])!="") {
|
||||
$restrictedFile=true;
|
||||
}
|
||||
}
|
||||
if ($_SESSION['userLevel'] == 10 || ($_SESSION['userLevel'] < 10 && $restrictedFile==false)) {
|
||||
$fileAtts = "";
|
||||
if ($serverType=="Linux") {
|
||||
$chmodInfo = substr(sprintf('%o', fileperms($link)), -4);
|
||||
$fileAtts = '<span style="color: #888; font-size: 8px">'.$chmodInfo.'</span>';
|
||||
}
|
||||
$fileManager .= "<li class=\"pft-file " . strtolower($ext) . "\"><a nohref onMouseOver=\"top.ICEcoder.overFileFolder('file','$link')\" onMouseOut=\"top.ICEcoder.overFileFolder('file','')\" style=\"position: relative; left:-22px; cursor: pointer\"> <span id=\"".str_replace("/","|",str_replace($docRoot,"",$link))."\">" . htmlspecialchars($this_file) . "</span> ".$fileAtts."</a></li>";
|
||||
} else {
|
||||
$fileAtts = "<img src=\"images/padlock.png\" style=\"cursor: pointer\" onClick=\"alert('Sorry, you need higher admin level rights to view.')\">";
|
||||
$fileManager .= "<li class=\"pft-file " . strtolower($ext) . "\" style=\"cursor: default\"><span style=\"position: relative; left:-22px; color: #888\"> [HIDDEN] ".$fileAtts."</span></li>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$fileManager .= "</ul>";
|
||||
}
|
||||
$varOutput = "";
|
||||
if ($dirCount) {$varOutput .= "top.ICEcoder.dirCount+=".$dirCount.";".PHP_EOL;};
|
||||
if ($fileCount) {$varOutput .= "top.ICEcoder.fileCount+=".$fileCount.";".PHP_EOL;};
|
||||
if ($fileBytes) {$varOutput .= "top.ICEcoder.fileBytes+=".$fileBytes.";".PHP_EOL;};
|
||||
// After outputting the fileManager, output the JS vars, but only the first time
|
||||
return $fileManager."<script>if (top.ICEcoder.dirCount==0) {".PHP_EOL.$varOutput."}</script>";
|
||||
}
|
||||
|
||||
// For PHP4 compatibility
|
||||
function php4_scandir($dir) {
|
||||
$dh = opendir($dir);
|
||||
while( false !== ($filename = readdir($dh)) ) {
|
||||
$files[] = $filename;
|
||||
}
|
||||
sort($files);
|
||||
return($files);
|
||||
}
|
||||
?>
|
||||
<?php include("lib/settings.php");?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false" onMouseMove="top.ICEcoder.getMouseXY(event);top.ICEcoder.canResizeFilesW()" onContextMenu="top.ICEcoder.rightClickedFile=top.ICEcoder.thisFileFolderLink; return top.ICEcoder.showMenu()" onClick="top.ICEcoder.selectFileFolder()">
|
||||
<html onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false; if (!top.ICEcoder.overCloseLink) {top.ICEcoder.tabDragEnd()}" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'files');top.ICEcoder.canResizeFilesW()}" onContextMenu="top.ICEcoder.rightClickedFile=top.ICEcoder.thisFileFolderLink; return top.ICEcoder.showMenu(event)" onClick="top.ICEcoder.selectFileFolder(event)">
|
||||
<head>
|
||||
<title>ICE Coder File Manager</title>
|
||||
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?> file manager</title>
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<link rel="stylesheet" type="text/css" href="lib/files.css">
|
||||
|
||||
<script src="lib/coder.js" type="text/javascript"></script>
|
||||
<link rel="stylesheet" type="text/css" href="lib/file-types.css">
|
||||
<script src="lib/ice-coder<?php if (!$ICEcoder['devMode']) {echo '.min';};?>.js" type="text/javascript"></script>
|
||||
</head>
|
||||
|
||||
<body onLoad="top.ICEcoder.fileManager()" onDblClick="top.ICEcoder.openFile()" onKeyDown="return top.ICEcoder.interceptKeys('files', event);" onKeyUp="top.ICEcoder.resetKeys(event);">
|
||||
<div onClick="top.ICEcoder.refreshFileManager()" class="refresh"><img src="images/refresh.png"></div>
|
||||
<script>
|
||||
top.ICEcoder.dirCount = 0;
|
||||
top.ICEcoder.fileCount = 0;
|
||||
top.ICEcoder.fileBytes = 0;
|
||||
</script>
|
||||
<?php
|
||||
<body onDblClick="top.ICEcoder.openFile()" onKeyDown="return top.ICEcoder.interceptKeys('files', event);" onKeyUp="top.ICEcoder.resetKeys(event);">
|
||||
|
||||
echo fileManager($_SERVER['DOCUMENT_ROOT'], "[link]");
|
||||
<div title="Refresh" onClick="top.ICEcoder.refreshFileManager()" class="refresh"></div>
|
||||
|
||||
<ul class="fileManager">
|
||||
<li class="pft-directory dirOpen"><a nohref title="/" onMouseOver="top.ICEcoder.overFileFolder('folder','/')" onMouseOut="top.ICEcoder.overFileFolder('folder','')" onClick="top.ICEcoder.openCloseDir(this)" style="position: relative; left:-22px"> <span id="|">/ <?php echo $iceRoot == "" ? "[ROOT]" : trim($iceRoot,"/");?></span> <span style="color: #888; font-size: 8px" id="|_perms"><?php echo $serverType=="Linux" ? substr(sprintf('%o', fileperms($docRoot.$iceRoot)), -3) : "";?></span></a></li><?php
|
||||
$_GET['location'] = "|";
|
||||
include("lib/get-branch.php");
|
||||
?>
|
||||
</ul>
|
||||
|
||||
<iframe name="fileControl" style="display: none"></iframe>
|
||||
|
||||
<iframe name="testControl" style="display: none"></iframe>
|
||||
|
||||
<iframe name="processControl" style="display: none"></iframe>
|
||||
|
||||
</body>
|
||||
|
||||
|
||||
BIN
images/big-arrow.gif
Normal file
|
After Width: | Height: | Size: 430 B |
BIN
images/blank.gif
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 55 B |
BIN
images/checkerboard.png
Normal file
|
After Width: | Height: | Size: 231 B |
BIN
images/color-picker.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 739 B |
BIN
images/error.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/file-folder-icons.png
Normal file
|
After Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 842 B |
BIN
images/files-arrow.png
Normal file
|
After Width: | Height: | Size: 164 B |
BIN
images/help.gif
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
images/ice-coder-icon.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
BIN
images/multiple.png
Normal file
|
After Width: | Height: | Size: 972 B |
BIN
images/nav-alpha.png
Normal file
|
After Width: | Height: | Size: 990 B |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 480 B |
BIN
images/nest-tag-bg.gif
Normal file
|
After Width: | Height: | Size: 120 B |
|
Before Width: | Height: | Size: 512 B |
|
Before Width: | Height: | Size: 1.2 KiB |
BIN
images/open.png
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 752 B |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 253 B |
BIN
images/save.png
|
Before Width: | Height: | Size: 2.0 KiB |
BIN
images/settings.gif
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
images/view.png
|
Before Width: | Height: | Size: 982 B |
BIN
images/warning.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
227
index.php
@@ -1,72 +1,86 @@
|
||||
<?php
|
||||
include("lib/settings.php");
|
||||
$allowedIP = false;
|
||||
for($i=0;$i<count($_SESSION['allowedIPs']);$i++) {
|
||||
if ($_SESSION['allowedIPs'][$i]==$_SERVER["REMOTE_ADDR"]||$_SESSION['allowedIPs'][$i]=="*") {
|
||||
$allowedIP = true;
|
||||
}
|
||||
}
|
||||
if (!$allowedIP) {
|
||||
<?php include("lib/settings.php");
|
||||
|
||||
// Check IP permissions
|
||||
if (!in_array($_SERVER["REMOTE_ADDR"], $_SESSION['allowedIPs']) && !in_array("*", $_SESSION['allowedIPs'])) {
|
||||
header('Location: /');
|
||||
};
|
||||
|
||||
// Test for latest CodeMirror version
|
||||
if ($testcMVersion) {
|
||||
$cMLatestVer = json_encode(file_get_contents("http://codemirror.net/latest-version.txt"));
|
||||
$cMLatestVer = rtrim(ltrim($cMLatestVer,"\""),"\"\\n");
|
||||
if ($cMThisVer<$cMLatestVer) {
|
||||
echo '<script>alert(\'Code Mirror '.$cMLatestVer.' now released\n\nPlease upgrade\');</script>';
|
||||
$updateMsg = '';
|
||||
// Check for updates
|
||||
if ($ICEcoder["checkUpdates"]) {
|
||||
$icv_url = "http://icecoder.net/latest-version?thisVersion=".$ICEcoder["versionNo"];
|
||||
if (ini_get('allow_url_fopen')) {
|
||||
$icvInfo = explode("\n",file_get_contents($icv_url,false,$context));
|
||||
} elseif (function_exists('curl_init')) {
|
||||
$ch = curl_init($icv_url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
$icvInfo = explode("\n", curl_exec($ch));
|
||||
}
|
||||
$icv = $icvInfo[0];
|
||||
$icvI = str_replace('"','\\\'',$icvInfo[1]);
|
||||
$thisV = $ICEcoder["versionNo"];
|
||||
if (strpos($thisV,"beta")>-1 && !strpos($icv,"beta") && str_replace(" beta","",$thisV) == $icv) {$thisV-=0.1;};
|
||||
if ($thisV<$icv) {
|
||||
$updateMsg = ";top.ICEcoder.dataMessage('<b>UPDATE INFO:</b> ICEcoder v ".$icv." now available. (Your version is v ".$ICEcoder["versionNo"]."). Get it free from <a href=\\'http://icecoder.net\\' target=\\'_blank\\' style=\\'color:#ddd\\'>icecoder.net</a><br>".$icvI."');";
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<html onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false; if (!top.ICEcoder.overCloseLink) {top.ICEcoder.tabDragEnd()}" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'top');top.ICEcoder.canResizeFilesW()}" onMouseWheel="event.wheelDelta > 0 ? top.ICEcoder.nextTab() : top.ICEcoder.previousTab()">
|
||||
<head>
|
||||
<title>ICE Coder - <?php echo $versionNo;?></title>
|
||||
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<link rel="stylesheet" type="text/css" href="lib/coder.css">
|
||||
<link rel="stylesheet" type="text/css" href="lib/ice-coder.css">
|
||||
<link rel="icon" type="image/png" href="favicon.png">
|
||||
<script>
|
||||
shortURLStarts = "<?php echo $shortURLStarts;?>";
|
||||
theme = "<?php if ($theme=="default") {echo 'icecoder';} else {echo $theme;};?>";
|
||||
tabsIndent = <?php if ($tabsIndent) {echo 'true';} else {echo 'false';};?>;
|
||||
<?
|
||||
$docRoot = str_replace("\\","/",$_SERVER['DOCUMENT_ROOT']);
|
||||
if (strrpos($docRoot,"/")==strlen($docRoot)-1) {$docRoot = substr($docRoot,0,strlen($docRoot)-1);};
|
||||
echo 'fullPath = "'.$docRoot.'";'.PHP_EOL;
|
||||
?>
|
||||
iceRoot = "<?php echo $ICEcoder['root']; ?>";
|
||||
|
||||
window.onbeforeunload = function() {
|
||||
for (var i=0; i<=top.ICEcoder.changedContent.length; i++) {
|
||||
if (top.ICEcoder.changedContent[i]==1) {
|
||||
return "You have some unsaved changes.";
|
||||
}
|
||||
if (top.ICEcoder.changedContent.indexOf(1)>-1) {
|
||||
return "You have some unsaved changes.";
|
||||
}
|
||||
}
|
||||
|
||||
lastOpenFiles = [<?php
|
||||
if ($lastOpenedFiles!="" && $_SESSION['userLevel'] == 10) {
|
||||
$openFilesArray = explode(",",$lastOpenedFiles);
|
||||
for ($i=0;$i<count($openFilesArray);$i++) {
|
||||
echo "'".$openFilesArray[$i]."'";
|
||||
if ($i<count($openFilesArray)-1) {echo ",";};
|
||||
}
|
||||
}
|
||||
?>];
|
||||
</script>
|
||||
<script language="JavaScript" src="lib/coder.js"></script>
|
||||
<script language="JavaScript" src="lib/ice-coder<?php if (!$ICEcoder['devMode']) {echo '.min';};?>.js"></script>
|
||||
<script src="lib/mmd.js"></script>
|
||||
<script src="farbtastic/farbtastic.js"></script>
|
||||
<link rel="stylesheet" href="farbtastic/farbtastic.css" type="text/css">
|
||||
</head>
|
||||
|
||||
<body onLoad="ICEcoder.init(<?php if ($_SESSION['userLevel'] == 10) {echo "'login'";} ?>)<?php echo $onLoadExtras;?>" onResize="ICEcoder.setLayout()" onMouseMove="top.ICEcoder.getMouseXY(event);top.ICEcoder.canResizeFilesW()" onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false" onKeyDown="return ICEcoder.interceptKeys('coder', event);" onKeyUp="parent.ICEcoder.resetKeys(event);">
|
||||
<body onLoad="<?php
|
||||
echo 'top.ICEcoder.previousFiles = [';
|
||||
if ($ICEcoder["previousFiles"]!="") {
|
||||
$openFilesArray = explode(",",$ICEcoder["previousFiles"]);
|
||||
echo "'".implode("','",$openFilesArray)."'";
|
||||
}
|
||||
echo "];top.ICEcoder.theme = '";
|
||||
echo $ICEcoder["theme"]=="default" ? 'icecoder' : $ICEcoder["theme"];
|
||||
echo "'";
|
||||
echo ";top.ICEcoder.fontSize = '";
|
||||
echo $ICEcoder["fontSize"];
|
||||
echo "'";
|
||||
echo ';top.ICEcoder.openLastFiles = ';
|
||||
echo $ICEcoder["openLastFiles"] ? 'true' : 'false';
|
||||
echo ';top.ICEcoder.codeAssist = ';
|
||||
echo $ICEcoder["codeAssist"] ? 'true' : 'false';
|
||||
echo ';top.ICEcoder.lineWrapping = ';
|
||||
echo $ICEcoder["lineWrapping"] ? 'true' : 'false';
|
||||
echo ';top.ICEcoder.indentWithTabs = ';
|
||||
echo $ICEcoder["indentWithTabs"] ? 'true' : 'false';
|
||||
echo ';top.ICEcoder.indentSize = ';
|
||||
echo $ICEcoder["indentSize"];
|
||||
echo ';top.ICEcoder.demoMode = ';
|
||||
echo $ICEcoder["demoMode"] ? 'true' : 'false';
|
||||
?>;ICEcoder.init()<?php echo $updateMsg.$onLoadExtras;?>;top.ICEcoder.filesFrame.contentWindow.frames['processControl'].location.href = 'processes/on-load.php';" onResize="ICEcoder.setLayout()" onKeyDown="return ICEcoder.interceptKeys('coder',event);" onKeyUp="parent.ICEcoder.resetKeys(event);">
|
||||
|
||||
<div id="blackMask" class="blackMask" onClick="ICEcoder.showHide('hide',this)">
|
||||
<div id="blackMask" class="blackMask" onClick="if (!ICEcoder.overPopup) {ICEcoder.showHide('hide',this)}" onContextMenu="return false">
|
||||
<div class="popupVCenter">
|
||||
<div class="popup" id="mediaContainer"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="loadingMask" class="blackMask" style="visibility: visible">
|
||||
<span class="progressBar"></span>
|
||||
<div id="loadingMask" class="blackMask" style="visibility: visible" onContextMenu="return false">
|
||||
<div class="popupVCenter">
|
||||
<div class="popup">
|
||||
<div class="circleOutside"></div>
|
||||
@@ -76,102 +90,127 @@ lastOpenFiles = [<?php
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="fileMenu" class="fileMenu" onMouseOver="ICEcoder.changeFilesW('expand')" onMouseOut="ICEcoder.changeFilesW('contract')">
|
||||
<div id="fileMenu" class="fileMenu" onMouseOver="ICEcoder.changeFilesW('expand')" onMouseOut="ICEcoder.changeFilesW('contract');top.ICEcoder.hideFileMenu()" style="opacity: 0" onContextMenu="return false">
|
||||
<span id="folderMenuItems">
|
||||
<a href="javascript:top.ICEcoder.newFile()" onMouseOver="document.getElementById('fileMenu').style.display='inline-block'">New File</a>
|
||||
<a href="javascript:top.ICEcoder.newFolder()" onMouseOver="document.getElementById('fileMenu').style.display='inline-block'">New Folder</a>
|
||||
<a href="javascript:top.ICEcoder.newFile()" onMouseOver="ICEcoder.showFileMenu()">New File</a>
|
||||
<a href="javascript:top.ICEcoder.newFolder()" onMouseOver="ICEcoder.showFileMenu()">New Folder</a>
|
||||
<div onMouseOver="ICEcoder.showFileMenu()" style="padding: 2px 0"><hr></div>
|
||||
<a href="javascript:top.ICEcoder.uploadFilesSelect(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Upload File(s)</a>
|
||||
<div style="display: none">
|
||||
<form enctype="multipart/form-data" id="uploadFilesForm" action="lib/file-control.php?action=upload&file=/uploaded" method="POST" target="fileControl">
|
||||
<input type="hidden" name="folder" id="uploadDir" value="/">
|
||||
<input type="file" name="filesInput[]" id="fileInput" onchange="top.ICEcoder.uploadFilesSubmit(this)" multiple>
|
||||
<input type="submit" value="Upload File">
|
||||
</form>
|
||||
</div>
|
||||
<a href="javascript:top.ICEcoder.pasteFiles(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()" id="fmMenuPasteOption" style="display: none">Paste</a>
|
||||
<div onMouseOver="ICEcoder.showFileMenu()" style="padding: 2px 0"><hr></div>
|
||||
</span>
|
||||
<a href="javascript:top.ICEcoder.deleteFile(top.ICEcoder.rightClickedFile)" onMouseOver="document.getElementById('fileMenu').style.display='inline-block'">Delete</a>
|
||||
<a href="javascript:top.ICEcoder.openFilesFromList(top.ICEcoder.selectedFiles)" onMouseOver="ICEcoder.showFileMenu()">Open</a>
|
||||
<a href="javascript:top.ICEcoder.copyFiles(top.ICEcoder.selectedFiles)" onMouseOver="ICEcoder.showFileMenu()">Copy</a>
|
||||
<a href="javascript:top.ICEcoder.duplicateFiles(top.ICEcoder.selectedFiles)" onMouseOver="ICEcoder.showFileMenu()">Duplicate</a>
|
||||
<a href="javascript:top.ICEcoder.deleteFiles(top.ICEcoder.selectedFiles)" onMouseOver="ICEcoder.showFileMenu()">Delete</a>
|
||||
<span id="singleFileMenuItems">
|
||||
<a href="javascript:top.ICEcoder.renameFile(top.ICEcoder.rightClickedFile)" onMouseOver="document.getElementById('fileMenu').style.display='inline-block'">Rename</a>
|
||||
<a href="javascript:window.open(top.ICEcoder.rightClickedFile.substr((top.ICEcoder.rightClickedFile.indexOf(shortURLStarts)+top.shortURLStarts.length),top.ICEcoder.rightClickedFile.length))" onMouseOver="document.getElementById('fileMenu').style.display='inline-block'">View Webpage</a>
|
||||
<a href="javascript:top.ICEcoder.renameFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Rename</a>
|
||||
<div onMouseOver="ICEcoder.showFileMenu()" style="padding: 2px 0"><hr></div>
|
||||
<a href="javascript:window.open(top.ICEcoder.rightClickedFile.replace(/\|/g,'/'))" onMouseOver="ICEcoder.showFileMenu()">View Webpage</a>
|
||||
</span>
|
||||
<div onMouseOver="ICEcoder.showFileMenu()" style="padding: 2px 0"><hr></div>
|
||||
<a href="javascript:top.ICEcoder.zipIt(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Zip It!</a>
|
||||
<div onMouseOver="ICEcoder.showFileMenu()" style="padding: 2px 0"><hr></div>
|
||||
<a href="javascript:top.ICEcoder.propertiesScreen(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Properties</a>
|
||||
</div>
|
||||
|
||||
<div id="header" class="header" onContextMenu="return false">
|
||||
<div class="tools">
|
||||
<a nohref onClick="top.ICEcoder.showColorPicker(top.document.getElementById('color') ? top.document.getElementById('color').value : '#123456')" title="Farbtastic
|
||||
Color picker"><img src="images/color-picker.png" style="margin-top: 3px; cursor: pointer" alt="Color Picker"></a>
|
||||
</div>
|
||||
<div class="plugins" id="pluginsContainer">
|
||||
<?php echo $pluginsDisplay; ?>
|
||||
</div>
|
||||
<div class="version"><?php echo $versionNo;?></div><img src="images/full-screen.gif" id="screenMode" class="screenModeIcon" onClick="top.ICEcoder.fullScreenSwitcher()">
|
||||
<img src="images/ice-coder.png" class="logo" onClick="ICEcoder.helpScreen('show')" onContextMenu="ICEcoder.settingsScreen('show')">
|
||||
<div class="version"><a href="javascript:top:ICEcoder.logout()">logout</a> : v <?php echo $ICEcoder["versionNo"];?></div>
|
||||
<img src="images/help.gif" class="helpIcon" alt="Help" title="Help" onClick="ICEcoder.helpScreen()">
|
||||
<img src="images/settings.gif" class="settingsIcon" alt="Settings" title="Settings" onClick="ICEcoder.settingsScreen()">
|
||||
<img src="images/full-screen.gif" id="screenMode" class="screenModeIcon" alt="Toggle Fullscreen" title="Toggle Fullscreen" onClick="top.ICEcoder.fullScreenSwitcher()">
|
||||
<a href="http://icecoder.net" target="_blank"><img src="images/ice-coder-icon.png" class="logo" alt="ICEcoder website" title="ICEcoder website"></a>
|
||||
</div>
|
||||
|
||||
<div id="files" class="files" onMouseOver="ICEcoder.changeFilesW('expand')" onMouseOut="ICEcoder.changeFilesW('contract'); top.document.getElementById('fileMenu').style.display='none';">
|
||||
<div id="files" class="files" onMouseOver="ICEcoder.changeFilesW('expand')" onMouseOut="ICEcoder.changeFilesW('contract'); top.ICEcoder.hideFileMenu();">
|
||||
<div class="account" id="account">
|
||||
<div class="accountLoginContainer" id="accountLoginContainer">
|
||||
<div class="accountLogin" id="accountLogin">
|
||||
<form name="login" action="lib/settings.php" method="POST" target="ff">
|
||||
<input type="password" name="loginPassword" class="accountPassword">
|
||||
<input type="submit" name="submit" value="Login" class="button">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="accountOptions">
|
||||
<a nohref title="Save" onClick="ICEcoder.fMIcon('save')"><img src="images/save.png" alt="Save" id="fMSave" style="opacity: 0.3"></a>
|
||||
<a nohref title="Open" onClick="ICEcoder.fMIcon('open')"><img src="images/open.png" alt="Open" id="fMOpen" style="margin-left: 7px; opacity: 0.3"></a>
|
||||
<a nohref title="New File" onClick="ICEcoder.fMIcon('newFile')"><img src="images/new-file.png" alt="New File" id="fMNewFile" style="margin: 8px 0 0 10px; opacity: 0.3"></a>
|
||||
<a nohref title="New Folder" onClick="ICEcoder.fMIcon('newFolder')"><img src="images/new-folder.png" alt="New Folder" id="fMNewFolder" style="margin: 9px 0 0 5px; opacity: 0.3"></a>
|
||||
<a nohref title="Delete" onClick="ICEcoder.fMIcon('delete')"><img src="images/delete.png" alt="Delete" id="fMDelete" style="margin: 9px 0 0 5px; opacity: 0.3"></a>
|
||||
<a nohref title="Rename" onClick="ICEcoder.fMIcon('rename')"><img src="images/rename.png" alt="Rename" id="fMRename" style="margin: 9px 0 0 5px; opacity: 0.3"></a>
|
||||
<a nohref title="View" onClick="ICEcoder.fMIcon('view')"><img src="images/view.png" alt="View" id="fMView" style="margin: 9px 0 0 5px; opacity: 0.3"></a>
|
||||
<?php $isMac = strpos($_SERVER['HTTP_USER_AGENT'], "Macintosh")>-1 ? true : false;?>
|
||||
<div title="Save (<?php echo $isMac ? "Cmd" : "Ctrl";?> + s)" onClick="ICEcoder.fMIcon('save')" id="fMSave" class="save"></div>
|
||||
<div title="Open (<?php echo $isMac ? "Cmd" : "Ctrl";?> + o)" onClick="ICEcoder.fMIcon('open')" id="fMOpen" class="open"></div>
|
||||
<div title="New File" onClick="if(this.style.opacity==1) {ICEcoder.fMIcon('newFile')}" id="fMNewFile" class="newFile"></div>
|
||||
<div title="New Folder" onClick="if(this.style.opacity==1) {ICEcoder.fMIcon('newFolder')}" id="fMNewFolder" class="newFolder"></div>
|
||||
<div title="Delete" onClick="ICEcoder.fMIcon('delete')" id="fMDelete" class="delete"></div>
|
||||
<div title="Rename" onClick="ICEcoder.fMIcon('rename')" id="fMRename" class="rename"></div>
|
||||
<div title="View" onClick="ICEcoder.fMIcon('view')" id="fMView" class="view"></div>
|
||||
|
||||
<div title="Lock" onClick="ICEcoder.lockUnlockNav()" id="fmLock" class="lock"></div>
|
||||
</div>
|
||||
<a nohref style="cursor: pointer" onClick="ICEcoder.lockUnlockNav()"><img src="images/padlock.png" id="fmLock" class="lock"></a>
|
||||
</div>
|
||||
<iframe id="filesFrame" class="frame" name="ff" src="files.php" style="opacity: 0" onLoad="this.style.opacity='1'"></iframe>
|
||||
<iframe id="filesFrame" class="frame" name="ff" src="files.php" style="opacity: 0" onLoad="this.style.opacity='1';this.contentWindow.onscroll=function(){top.ICEcoder.mouseDown=false}"></iframe>
|
||||
<div class="serverMessage" id="serverMessage"></div>
|
||||
</div>
|
||||
|
||||
<div id="editor" class="editor">
|
||||
<div id="tabsBar" class="tabsBar" onContextMenu="return false">
|
||||
<a nohref onClick="top.ICEcoder.closeAllTabs()"><img src="images/nav-close.gif" class="closeAllTabs" title="Close all tabs"></a>
|
||||
<a nohref onClick="top.ICEcoder.alphaTabs()"><img src="images/nav-alpha.png" class="alphaTabs" title="Alphabetize tabs"></a>
|
||||
<?php
|
||||
for ($i=1;$i<=10;$i++) {
|
||||
echo '<div id="tab'.$i.'" class="tab" onClick="if(ICEcoder.canSwitchTabs) {ICEcoder.switchTab('.$i.')} else {ICEcoder.canSwitchTabs=true}"></div>';
|
||||
for ($i=1;$i<=100;$i++) {
|
||||
echo '<div id="tab'.$i.'" class="tab" onMouseDown="ICEcoder.canSwitchTabs ? ICEcoder.switchTab(parseInt(this.id.slice(3),10)) : ICEcoder.canSwitchTabs=true; thisColor=top.ICEcoder.tabFGselected; if (!top.ICEcoder.overCloseLink) {ICEcoder.tabDragStart(parseInt(this.id.slice(3),10))}; if (event.button==1) {ICEcoder.closeTab(parseInt(this.id.slice(3),10)); return false};" onMouseOver="thisColor=this.style.color;this.style.color=top.ICEcoder.tabFGselected" onMouseOut="this.style.color=thisColor"></div>';
|
||||
}
|
||||
?><div class="newTab" onClick="ICEcoder.newTab()"><img src="images/nav-new.png"></div>
|
||||
?><div class="newTab" onClick="ICEcoder.newTab()" id="newTab">+</div>
|
||||
</div>
|
||||
<div id="findBar" class="findBar" onContextMenu="return false">
|
||||
<form name="findAndReplace">
|
||||
<form name="findAndReplace" onSubmit="ICEcoder.findReplace(top.document.getElementById('find').value,false,true);return false">
|
||||
<div class="findReplace">
|
||||
<div class="findText">Find</div>
|
||||
<input type="text" name="find" value="" id="find" class="textbox find" onKeyUp="ICEcoder.findReplace('find',true,false)">
|
||||
<div class="findTextPlural">'s</div>
|
||||
<input type="text" name="find" value="" id="find" class="textbox find" onKeyUp="ICEcoder.findReplace(top.document.getElementById('find').value,true,false)">
|
||||
|
||||
<select name="connector" onChange="ICEcoder.findReplaceOptions()">
|
||||
<option>in</option>
|
||||
<option>and</option>
|
||||
</select>
|
||||
<div class="replaceText" id="rText" style="display: none">
|
||||
<select name="replaceAction" class="replaceAction">
|
||||
<option>replace</option>
|
||||
<option>replace all</option>
|
||||
<option>replace</option>
|
||||
<option>replace all</option>
|
||||
</select>
|
||||
with
|
||||
</div>
|
||||
<input type="text" name="replace" value="" id="replace" class="textbox replace" style="display: none">
|
||||
<div class="targetText" id="rTarget" style="display: none">in</div>
|
||||
<select name="target" onChange="ICEcoder.updateResultsDisplay(this.value=='this document' ? 'show' : 'hide')">
|
||||
<option>this document</option>
|
||||
<option>open documents</option>
|
||||
<option>all files</option>
|
||||
<option>all filenames</option>
|
||||
<option>this document</option>
|
||||
<option>open documents</option>
|
||||
<option>all files</option>
|
||||
<option>all filenames</option>
|
||||
</select>
|
||||
<input type="button" name="submit" value=">>" class="submit" onClick="ICEcoder.findReplace('findReplace',false,true)">
|
||||
<input type="submit" name="submit" value=">>" class="submit">
|
||||
<div class="results" id="results"></div>
|
||||
</div>
|
||||
</form>
|
||||
<form onSubmit="return ICEcoder.goToLine()">
|
||||
<div class="codeAssist"><input type="checkbox" name="codeAssist" id="codeAssist" checked onClick="top.ICEcoder.codeAssistToggle()">Code Assist</div>
|
||||
<div class="goLine">Go to Line<input type="text" name="goToLine" value="" id="goToLineNo" class="textbox goToLine">
|
||||
<form action="#" onSubmit="return ICEcoder.goToLine()">
|
||||
<div class="codeAssist" title="Turn on/off JS Hint & CSS color previews"><input type="checkbox" name="codeAssist" id="codeAssist" <?php if ($ICEcoder['codeAssist']) {echo 'checked ';};?>onClick="top.ICEcoder.codeAssistToggle()">Code Assist</div>
|
||||
<div class="goLine">Go to Line<input type="text" name="goToLine" value="" id="goToLineNo" class="textbox goToLine">
|
||||
</form>
|
||||
</div>
|
||||
<iframe name="contentFrame" id="content" src="editor.php" class="code">
|
||||
</iframe>
|
||||
<iframe name="contentFrame" id="content" src="editor.php" class="code"></iframe>
|
||||
</div>
|
||||
|
||||
<div class="footer" id="footer" onContextMenu="return false">
|
||||
<div class="nesting" id="nestValid">Nesting OK</div>
|
||||
<div class="nestLoc">Cursor nest location</div>
|
||||
<div class="system" id="system">
|
||||
<div onClick="top.ICEcoder.openPreviewWindow()" class="preview" title="Preview Window"></div>
|
||||
<div onClick="top.ICEcoder.openTerminal()" class="terminal" title="Terminal"></div>
|
||||
</div>
|
||||
<div class="nesting" id="nestValid"></div>
|
||||
<div class="nestDisplay" id="nestDisplay"></div>
|
||||
<div class="charDisplay" id="charDisplay"><span id="char"></span></div>
|
||||
<div class="byteDisplay" id="byteDisplay" style="display: none" onClick="top.ICEcoder.showDisplay('char')"></div>
|
||||
<div class="charDisplay" id="charDisplay" style="display: inline-block" onClick="top.ICEcoder.showDisplay('byte')"></div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
5
jshint/jshint-2.1.4.min.js
vendored
Normal file
165
lib/coder.css
@@ -1,165 +0,0 @@
|
||||
/* First, reset everything to a standard */
|
||||
html, body, div, span, applet, object, iframe,
|
||||
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
||||
a, abbr, acronym, address, big, cite, code,
|
||||
del, dfn, em, font, img, ins, kbd, q, s, samp,
|
||||
small, strike, strong, sub, sup, tt, var,
|
||||
b, u, i, center,
|
||||
dl, dt, dd, ol, ul, li,
|
||||
fieldset, form, label, legend,
|
||||
table, caption, tbody, tfoot, thead, tr, th, td {
|
||||
font-family: arial, verdana, helvetica, sans-serif;
|
||||
border: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
outline: 0;
|
||||
font-size: 12px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
body {overflow: hidden;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-o-user-select:none;
|
||||
user-select: none;
|
||||
background-color: #222;
|
||||
}
|
||||
|
||||
h1 {font-size: 36px; font-weight: normal; color: #888; margin-bottom: 20px}
|
||||
h2 {font-size: 18px; font-weight: normal; color: #fff}
|
||||
|
||||
.blackMask {position: fixed; display: table; width: 100%; height: 100%; top: 0; left: 0; visibility: hidden; background-color: rgba(0,0,0,0.8); text-align: center; z-index: 100}
|
||||
.blackMask .popupVCenter {#position: absolute; display: table-cell; #top: 50%; vertical-align: middle; text-align: center}
|
||||
.popupVCenter .popup {#position: relative; #top: -50%; text-align: center; color: #fff; font-size: 10px}
|
||||
.whiteGlow {
|
||||
-webkit-box-shadow: 0 0 8px 2px rgba(255,255,255,0.6);
|
||||
-moz-box-shadow: 0 0 8px 2px rgba(255,255,255,0.6);
|
||||
box-shadow: 0 0 8px 2px rgba(255,255,255,0.6);
|
||||
}
|
||||
|
||||
.circleOutside {background-color: rgba(0,0,0,0); border:5px solid rgba(0,183,229,0.9); opacity:.9; border-top:5px solid rgba(0,0,0,0); border-left:5px solid rgba(0,0,0,0); border-radius:50px; box-shadow: 0 0 35px #2187e7;
|
||||
width:50px; height:50px; margin:0 auto; -moz-animation:spin .5s infinite linear; -webkit-animation:spin .5s infinite linear;
|
||||
}
|
||||
.circleInside {background-color: rgba(0,0,0,0); border:5px solid rgba(0,183,229,0.9); opacity:.9; border-top:5px solid rgba(0,0,0,0); border-left:5px solid rgba(0,0,0,0); border-radius:50px; box-shadow: 0 0 15px #2187e7;
|
||||
width:30px; height:30px; margin:0 auto; position:relative; top:-50px; -moz-animation:spinoff .5s infinite linear; -webkit-animation:spinoff .5s infinite linear;
|
||||
}
|
||||
@-moz-keyframes spin {
|
||||
0% { -moz-transform:rotate(0deg);}
|
||||
100% { -moz-transform:rotate(360deg);}
|
||||
}
|
||||
@-moz-keyframes spinoff {
|
||||
0% { -moz-transform:rotate(0deg);}
|
||||
100% { -moz-transform:rotate(-360deg);}
|
||||
}
|
||||
@-webkit-keyframes spin {
|
||||
0% { -webkit-transform:rotate(0deg);}
|
||||
100% { -webkit-transform:rotate(360deg);}
|
||||
}
|
||||
@-webkit-keyframes spinoff {
|
||||
0% { -webkit-transform:rotate(0deg); }
|
||||
100% { -webkit-transform:rotate(-360deg);}
|
||||
}
|
||||
|
||||
.progressBar {top: 0; left: 0; width:100%; height:1px; margin:2px 0; background:#2187e7; position:absolute; box-shadow:0 0 10px 1px rgba(0,198,255,0.7);
|
||||
-moz-animation:fullexpand 10s ease-out; -webkit-animation:fullexpand 10s ease-out;
|
||||
}
|
||||
@-moz-keyframes fullexpand {
|
||||
0% { width:0;}
|
||||
100%{ width:100%;}
|
||||
}
|
||||
@-webkit-keyframes fullexpand {
|
||||
0% { width:0;}
|
||||
100%{ width:100%;}
|
||||
}
|
||||
|
||||
.header {position: absolute; display: inline-block; top: 0; left: 0; width: 100%; height: 40px; background-color: #fff; text-align: right; z-index: 2}
|
||||
.header .plugins {position: absolute; display: inline-block; left: 15px; top: 3px}
|
||||
.header .plugins img {position: relative; display: inline-block; margin-right: 15px}
|
||||
.header .screenModeIcon {position: absolute; top: 5px; right: 178px; cursor: pointer}
|
||||
.header .version {position: relative; display: inline-block; margin-top: 25px; font-size: 10px; color: #bbb}
|
||||
.header .logo {position: relative; margin: 5px 10px 0 5px; cursor: pointer}
|
||||
|
||||
.files {position: absolute; display: inline-block; top: 0; left: 0; height: 100%; width: 250px; background-color: #444; background-image: url('../images/files-arrow.gif'); background-repeat: no-repeat; background-position: 100% 50%; overflow: hidden; z-index: 1;
|
||||
-webkit-box-shadow: 0 0 10px 4px rgba(0,0,0,0.4);
|
||||
-moz-box-shadow: 0 0 10px 4px rgba(0,0,0,0.4);
|
||||
box-shadow: 0 0 10px 4px rgba(0,0,0,0.4);
|
||||
}
|
||||
.files .account {display: inline-block; height: 50px; width: 250px; margin-top: 40px; background-color: #888}
|
||||
.files .accountLoginContainer {position: absolute; width: 250px; height: 50px; z-index: 1}
|
||||
.files .accountLoginContainer .accountLogin {position: absolute; width: 250px; height: 50px; top: 0; background-color: #666;
|
||||
-webkit-transition: top 0.3s;
|
||||
-moz-transition: top 0.3s;
|
||||
-o-transition: top 0.3s;
|
||||
transition: top 0.3s;
|
||||
}
|
||||
.files .accountOptions {position: relative; height: 31px; width: 200px; margin-left: 15px; margin-top: 8px}
|
||||
.files .accountOptions img {cursor: pointer}
|
||||
.files .accountPassword {position: relative; border: 1px solid #888; background-color: #999; height: 18px; width: 140px; margin-left: 14px; margin-top: 15px}
|
||||
.files input:focus, .findReplace input:focus, .findReplace select:focus, .accountPassword:focus {
|
||||
outline: none;
|
||||
-webkit-box-shadow: 0 0 10px 1px rgba(0,198,255,0.7);
|
||||
-moz-box-shadow: 0 0 10px 1px rgba(0,198,255,0.7);
|
||||
box-shadow: 0 0 10px 1px rgba(0,198,255,0.7);
|
||||
}
|
||||
.files .button {position: absolute; border: 0; background: #999; color: #555; height:20px; margin-top: 16px; margin-left: 5px; font-size: 11px; cursor: pointer}
|
||||
.files .button:hover {background-color: #444; color: #eee}
|
||||
.files .lock {position: relative; margin-left: 225px; margin-top: -20px; z-index: 1}
|
||||
.files .frame {display: inline-block; width: 250px}
|
||||
.files .serverMessage {position: absolute; display: inline-block; width: 450px; bottom: 0; margin-bottom: 30px; background-color: rgba(255,255,255,0.8); font-size: 10px; padding: 7px 12px; opacity: 0;
|
||||
-webkit-transition: all 0.2s;
|
||||
-moz-transition: all 0.2s;
|
||||
-o-transition: all 0.2s;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
.files .serverMessage b {font-size: 10px}
|
||||
|
||||
.editor {position: absolute; display: inline-block; top: 0; left: 15px; width: 2400px}
|
||||
.editor .tabsBar {display: inline-block; height: 22px; width: 2400px; margin-top: 40px; padding-left: 41px; background-color: #888;}
|
||||
.tabsBar .tab {display: inline-block; display: none; background-image: url('../images/nav-bg.gif'); background-repeat: repeat-x; background-position: 0 0; padding: 5px 8px 2px 8px; font-size: 10px; border-left: solid 1px #fff; border-right: solid 1px #777; color: #fff; cursor: pointer;
|
||||
-webkit-transition: all 0.15s;
|
||||
-moz-transition: all 0.15s;
|
||||
-o-transition: all 0.15s;
|
||||
transition: all 0.15s;
|
||||
}
|
||||
.tabsBar .tab .closeTab {margin: 1px 0 0 5px; border-radius: 6px}
|
||||
.tabsBar .newTab {display: inline-block; background-image: url('../images/nav-bg.gif'); background-repeat: repeat-x; background-position: 0 0; padding: 6px 5px 1px 5px; border-left: solid 1px #fff; border-right: solid 1px #777; cursor: pointer;}
|
||||
.editor .findBar {display: inline-block; height: 28px; width: 2400px; color: #fff; background-color: #141414}
|
||||
.findBar .findReplace {position: absolute; z-index: 1}
|
||||
.findReplace select {position: relative; font-size: 10px; margin: 8px 2px 0 2px; top: -2px;}
|
||||
.findReplace .findText {display: inline-block; height: 21px; font-size: 10px; margin: 8px 2px 0 2px; margin-left: 43px}
|
||||
.findReplace .find {position: relative; width: 120px; height: 16px; border: 0; top: -2px; font-size: 10px; padding-left: 5px}
|
||||
.findReplace .findTextPlural {display: inline-block; height: 21px; font-size: 10px; margin: 8px 2px 0 0}
|
||||
.findReplace .replaceAction {margin: 0 2px 0 0; top: -2px}
|
||||
.findReplace .replaceText {height: 21px; font-size: 10px; margin: 8px 2px 0 2px}
|
||||
.findReplace .replace {position: relative; width: 120px; height: 16px; border: 0; top: -2px; font-size: 10px; padding-left: 5px}
|
||||
.findReplace .targetText {height: 21px; font-size: 10px; margin: 8px 2px 0 2px}
|
||||
.findReplace .submit {position: relative; top: -2px; height: 17px; border: 1px solid #bbb; background-color: #f8f8f8; font-size: 10px; cursor: pointer}
|
||||
.findReplace .results {position: relative; display: inline-block; width: 200px; height: 20px; font-size: 10px; margin: 8px 0 0 20px}
|
||||
.findBar .codeAssist {position: fixed; display: inline-block; width: 100px; right: 74px; top: 70px; height: 21px; font-size: 10px; z-index: 1}
|
||||
.findBar .codeAssist input {margin-top: -1px}
|
||||
.findBar .goLine {position: fixed; display: inline-block; width: 100px; right: -10px; top: 70px; height: 21px; font-size: 10px; z-index: 1}
|
||||
.goLine .goToLine {width: 25px; height: 16px; border: 0; font-size: 10px; margin: -3px 0 0 3px}
|
||||
.editor .code {position: relative; display: inline-block; top: 28px; width: 600px; height: 600px; visibility: hidden}
|
||||
|
||||
.footer {position: fixed; display: inline-block; width: 100%; height: 30px; bottom: 0; background-color: rgba(0,0,0,0.7); left: 0; z-index: 2}
|
||||
.footer .nesting {display: inline-block; padding: 5px 8px; margin: 4px 0 0 15px; font-weight: bold; font-size: 10px; color: #fff; background-color: #0b0}
|
||||
.footer .nestLoc {position: absolute; display: inline-block; width: 120px; padding: 5px 0 0 8px; margin-top: 3px; left: 112px; font-weight: bold; font-size: 12px; color: #fff; text-align: right}
|
||||
.footer .nestDisplay {position: absolute; display: inline-block; padding: 5px 0 0 8px; margin-top: 3px; left: 255px; font-size: 12px; color: #fff; text-align: right}
|
||||
.footer .charDisplay {position: absolute; display: inline-block; padding: 5px 0 0 8px; margin-top: 3px; left: 100%; font-weight: bold; font-size: 12px; color: #fff; text-align: right; width: 200px; text-align: right; margin-left: -220px}
|
||||
|
||||
.textbox {
|
||||
-webkit-box-shadow: inset 1px 1px 2px 0 rgba(0,0,0,0.4);
|
||||
-moz-box-shadow: inset 1px 1px 2px 0 rgba(0,0,0,0.4);
|
||||
box-shadow: inset 1px 1px 2px 0 rgba(0,0,0,0.4);
|
||||
}
|
||||
|
||||
.fileMenu {position: absolute; display: none; left: 0; top: 0; background-color: #333; z-index: 10}
|
||||
.fileMenu a {display: block; padding: 2px 5px; background-color: #444; color: #eee; text-decoration: none}
|
||||
.fileMenu a:hover {background-color: #666}
|
||||
|
||||
.screenContainer {position: absolute; display: table; width: 100%; height: 100%; top: 0; left: 0; text-align: center}
|
||||
.screenContainer .screenVCenter {#position: absolute; display: table-cell; #top: 50%; vertical-align: middle; text-align: center}
|
||||
.screenVCenter .screenCenter {#position: relative; #top: -50%; text-align: center; display: inline}
|
||||
.screenCenter .version {position: relative; display: block; margin: 5px 0 15px 0; font-size: 10px; color: #bbb}
|
||||
.screenCenter .accountPassword {border: 1px solid #888; height: 18px}
|
||||
.screenCenter .button {border: 0; background: #666; color: #fff; height: 22px; cursor: pointer}
|
||||
1543
lib/coder.js
@@ -1,23 +0,0 @@
|
||||
<?php
|
||||
$versionNo = "v 0.7.1";
|
||||
$codeMirrorDir = "CodeMirror-2.25";
|
||||
$cMThisVer = 2.25;
|
||||
$tabsIndent = true;
|
||||
$testcMVersion = false;
|
||||
$openLastFiles = true;
|
||||
$findFilesExclude = array("_coder",".doc",".gif",".jpg",".jpeg",".pdf",".png",".swf",".xml",".zip");
|
||||
$codeAssist = true;
|
||||
$visibleTabs = false;
|
||||
$lockedNav = true;
|
||||
$accountPassword = "";
|
||||
$restrictedFiles = array("wp-",".php",".rb",".sql");
|
||||
$bannedFiles = array("_coder","wp-",".exe");
|
||||
$allowedIPs = array("*");
|
||||
$plugins = array(
|
||||
array("Database Admin","images/database.png","margin-top: 3px","plugins/adminer/adminer-3.3.3-mysql-en.php","_blank",""),
|
||||
array("Batch Image Processor","images/images.png","margin-top: 5px","http://birme.net","_blank",""),
|
||||
array("Backup","images/backup-open-files.png","margin-top: 3px","plugins/backupOpenFiles/index.php","fileControl:<b>Zipping Open Files</b>","10")
|
||||
);
|
||||
$theme = "default";
|
||||
$lastOpenedFiles = "";
|
||||
?>
|
||||
12
lib/config___settings.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
// ICEcoder system settings
|
||||
$ICEcoderSettings = array(
|
||||
"versionNo" => "3.0",
|
||||
"codeMirrorDir" => "CodeMirror-3.14",
|
||||
"docRoot" => $_SERVER['DOCUMENT_ROOT'],
|
||||
"demoMode" => false,
|
||||
"devMode" => false,
|
||||
"multiUser" => false,
|
||||
"lineEnding" => "\n"
|
||||
);
|
||||
?>
|
||||
34
lib/config___users-template.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
$ICEcoderUserSettings = array(
|
||||
"versionNo" => "3.0",
|
||||
"root" => "",
|
||||
"checkUpdates" => true,
|
||||
"openLastFiles" => true,
|
||||
"findFilesExclude" => array("_coder","ICEcoder",".doc",".gif",".jpg",".jpeg",".pdf",".png",".swf",".xml",".zip"),
|
||||
"codeAssist" => true,
|
||||
"visibleTabs" => false,
|
||||
"lockedNav" => true,
|
||||
"password" => "",
|
||||
"bannedFiles" => array("_coder","ICEcoder"),
|
||||
"bannedPaths" => array("/var/www/.git","/var/www/sites/all/modules","/var/www/sites/default/files"),
|
||||
"allowedIPs" => array("*"),
|
||||
"plugins" => array(
|
||||
array("Adminer\\nMySQL database manager","plugins/adminer/icon.png","margin-top: 3px","plugins/adminer/adminer-3.7.1-mysql-en.php","_blank",""),
|
||||
array("Emmet\\nSnippet type booster","plugins/emmet/icon.png","margin-top: 3px","http://docs.emmet.io","_blank",""),
|
||||
array("ICErepo\\nGithub repo manager","plugins/ice-repo/icon.png","margin-top: 3px","plugins/ice-repo","_blank",""),
|
||||
array("Dochub\\nCoding syntax info","plugins/dochub/icon.png","margin-top: 3px","http://dochub.io","_blank",""),
|
||||
array("Voke\\nCoding syntax info","plugins/voke/icon.png","margin-top: 3px","http://voke.fm","_blank",""),
|
||||
array("Regexplained\\nRegex builder","plugins/regexplained/icon.png","margin-top: 3px","http://leaverou.github.io/regexplained","_blank",""),
|
||||
array("wireframe|cc\\nWireframing tool","plugins/wireframecc/icon.png","margin-top: 3px","http://wireframe.cc","_blank",""),
|
||||
array("TinyPNG\\nImage file compressor","plugins/tinypng/icon.png","margin-top: 7px","http://tinypng.org","_blank",""),
|
||||
array("Zip It!\\nFile/folder zip utility","plugins/zip-it/icon.png","margin-top: 3px; margin-left: 3px","plugins/zip-it/?zip=|&exclude=*.doc*.gif*.jpg*.jpeg*.pdf*.png*.swf*.xml*.zip","fileControl:<b>Zipping Files</b>","30")
|
||||
),
|
||||
"theme" => "default",
|
||||
"fontSize" => "13px",
|
||||
"lineWrapping" => true,
|
||||
"indentWithTabs" => true,
|
||||
"indentSize" => 4,
|
||||
"previousFiles" => "",
|
||||
"last10Files" => ""
|
||||
);
|
||||
?>
|
||||
@@ -1,40 +1,40 @@
|
||||
/* ICE coder default theme: Based VERY loosely on Monokai */
|
||||
/* ICEcoder default theme by Matt Pass */
|
||||
|
||||
.cm-s-icecoder {font-size: 12px; color: #666; background: #1c1c19;}
|
||||
.cm-s-icecoder {color: #666; background: #161612}
|
||||
|
||||
.cm-s-icecoder span.cm-keyword {color: #f8f8f8; font-weight:bold;}
|
||||
.cm-s-icecoder span.cm-atom {color: #ae81ff;}
|
||||
.cm-s-icecoder span.cm-number {color: #0a0;}
|
||||
.cm-s-icecoder span.cm-def {color: #fd971f;}
|
||||
.cm-s-icecoder span.cm-keyword {color: #eee; font-weight:bold}
|
||||
.cm-s-icecoder span.cm-atom {color: #8b67cc}
|
||||
.cm-s-icecoder span.cm-number {color: #080}
|
||||
.cm-s-icecoder span.cm-def {color: #ca7919}
|
||||
|
||||
.cm-s-icecoder span.cm-variable {color: #a6e22e;}
|
||||
.cm-s-icecoder span.cm-variable-2 {color: #f92672;}
|
||||
.cm-s-icecoder span.cm-variable-3 {color: #0a0;}
|
||||
.cm-s-icecoder span.cm-variable {color: #85b525}
|
||||
.cm-s-icecoder span.cm-variable-2 {color: #c71e5b}
|
||||
.cm-s-icecoder span.cm-variable-3 {color: #080}
|
||||
|
||||
.cm-s-icecoder span.cm-property {color: #a6e22e;}
|
||||
.cm-s-icecoder span.cm-operator {color: #0a0;}
|
||||
.cm-s-icecoder span.cm-comment {color: #444;}
|
||||
.cm-s-icecoder span.cm-property {color: #85b525}
|
||||
.cm-s-icecoder span.cm-operator {color: #080}
|
||||
.cm-s-icecoder span.cm-comment {color: #444}
|
||||
|
||||
.cm-s-icecoder span.cm-string {color: #fd0;}
|
||||
.cm-s-icecoder span.cm-string-2 {color: #f80;}
|
||||
.cm-s-icecoder span.cm-string {color: #ccb100}
|
||||
.cm-s-icecoder span.cm-string-2 {color: #cc6d00}
|
||||
|
||||
.cm-s-icecoder span.cm-meta {color: #555;}
|
||||
.cm-s-icecoder span.cm-error {color: #f00;}
|
||||
.cm-s-icecoder span.cm-meta {color: #555}
|
||||
.cm-s-icecoder span.cm-error {color: #d00}
|
||||
|
||||
.cm-s-icecoder span.cm-qualifier {color: #555;}
|
||||
.cm-s-icecoder span.cm-builtin {color: #06c;}
|
||||
.cm-s-icecoder span.cm-bracket {color: #cc7;}
|
||||
.cm-s-icecoder span.cm-qualifier {color: #555}
|
||||
.cm-s-icecoder span.cm-builtin {color: #0052a3}
|
||||
.cm-s-icecoder span.cm-bracket {color: #cc7}
|
||||
|
||||
.cm-s-icecoder span.cm-tag {color: #e8e8e8;}
|
||||
.cm-s-icecoder span.cm-attribute {color: #00b8bb;}
|
||||
.cm-s-icecoder span.cm-tag {color: #e8e8e8}
|
||||
.cm-s-icecoder span.cm-attribute {color: #099}
|
||||
|
||||
.cm-s-icecoder span.cm-header {color: #a0a;}
|
||||
.cm-s-icecoder span.cm-quote {color: #090;}
|
||||
.cm-s-icecoder span.cm-hr {color: #999;}
|
||||
.cm-s-icecoder span.cm-link {color: #ff0;}
|
||||
.cm-s-icecoder span.cm-header {color: #808}
|
||||
.cm-s-icecoder span.cm-quote {color: #070}
|
||||
.cm-s-icecoder span.cm-hr {color: #888}
|
||||
.cm-s-icecoder span.cm-link {color: #cc0}
|
||||
|
||||
.cm-s-icecoder .CodeMirror-cursor {border-left: 1px solid white !important;}
|
||||
.cm-s-icecoder .CodeMirror-selected {background: #037 !important;}
|
||||
.cm-s-icecoder .CodeMirror-gutter {background: #333; border-right: 1px solid #e8e8e8}
|
||||
.cm-s-icecoder .CodeMirror-gutter-text {color: #999; width: 35px; cursor: default}
|
||||
.cm-s-icecoder .CodeMirror-matchingbracket {border: 1px solid grey; color: black !important;}
|
||||
.cm-s-icecoder .CodeMirror-cursor {border-left: 1px solid white !important}
|
||||
.cm-s-icecoder .CodeMirror-selected {color: #fff !important; background: #037 !important}
|
||||
.cm-s-icecoder .CodeMirror-gutters {background: #161612; min-width: 41px; border-right: 0}
|
||||
.cm-s-icecoder .CodeMirror-linenumber {color: #555; cursor: default}
|
||||
.cm-s-icecoder .CodeMirror-matchingbracket {border: 1px solid grey; color: black !important}
|
||||
@@ -1,116 +1,248 @@
|
||||
<?php include("settings.php");?>
|
||||
<?php include("settings.php");?>
|
||||
<script>
|
||||
<?php
|
||||
// Get the save type if any
|
||||
$saveType = isset($_GET['saveType']) ? strClean($_GET['saveType']) : "";
|
||||
|
||||
// Establish the full file path reference
|
||||
$file=$_GET['file'];
|
||||
if (isset($_GET['saveType'])) {$saveType = $_GET['saveType'];};
|
||||
$docRoot = str_replace("\\","/",$_SERVER['DOCUMENT_ROOT']);
|
||||
// Establish the filename/new filename
|
||||
$file = str_replace("|","/",strClean(
|
||||
isset($_POST['newFileName']) && $_POST['newFileName']!=""
|
||||
? $_POST['newFileName']
|
||||
: $_GET['file']
|
||||
));
|
||||
|
||||
// Not done the first time we are on the save loop (ie, before the form posting reload)
|
||||
if ($_GET['action']=="load"||$_GET['action']=="newFolder"||$_GET['action']=="rename"||$_GET['action']=="delete"||isset($_POST['contents'])) {
|
||||
$file= str_replace("|","/",$file);
|
||||
}
|
||||
// Trim any +'s or spaces from the end of file
|
||||
$file = rtrim(rtrim($file,'+'),' ');
|
||||
|
||||
// Make $file a full path and establish the $fileLoc and $fileName
|
||||
if (strpos($file,$docRoot)===false && $_GET['action']!="getRemoteFile") {$file=str_replace("|","/",$docRoot.$iceRoot.$file);};
|
||||
$fileLoc = substr(str_replace($docRoot,"",$file),0,strrpos(str_replace($docRoot,"",$file),"/"));
|
||||
$fileName = basename($file);
|
||||
|
||||
// If we're due to open a file...
|
||||
if ($_GET['action']=="load") {
|
||||
echo '<script>action="load";</script>';
|
||||
echo 'action="load";';
|
||||
|
||||
// Determine what to do based on filename
|
||||
// Everything is opened as text in the editor unless specified otherwise
|
||||
$fileType="text";
|
||||
if (strpos($file,".jpg")>0||strpos($file,".jpeg")>0||strpos($file,".gif")>0||strpos($file,".png")>0) {$fileType="image";};
|
||||
|
||||
if ($fileType=="text") {
|
||||
$bannedFile=false;
|
||||
for ($i=0;$i<count($restrictedFiles);$i++) {
|
||||
if (strpos($file,$restrictedFiles[$i])!="") {
|
||||
$bannedFile=true;
|
||||
}
|
||||
}
|
||||
if ($_SESSION['userLevel'] == 10 || ($_SESSION['userLevel'] < 10 && $bannedFile==false)) {
|
||||
echo '<script>fileType="text";top.ICEcoder.rightClickedFile=top.ICEcoder.thisFileFolderLink=\''.$file.'\';';
|
||||
echo 'shortURL = top.ICEcoder.thisFileFolderLink.replace(/\|/g,"/");';
|
||||
echo 'top.ICEcoder.shortURL = shortURL.substr((shortURL.indexOf(top.shortURLStarts)+top.shortURLStarts.length),shortURL.length);</script>';
|
||||
$loadedFile = file_get_contents($file);
|
||||
echo '<textarea name="loadedFile" id="loadedFile">'.str_replace("</textarea>","<ICEcoder:/:textarea>",$loadedFile).'</textarea>';
|
||||
if (file_exists($file)) {
|
||||
$finfo = "";
|
||||
// Determine what to do based on mime type
|
||||
if (function_exists('finfo_open')) {
|
||||
$finfoMIME = finfo_open(FILEINFO_MIME_TYPE);
|
||||
$finfo = finfo_file($finfoMIME, $file);
|
||||
finfo_close($finfoMIME);
|
||||
} else {
|
||||
echo '<script>fileType="nothing";</script>';
|
||||
echo '<script>alert(\'Sorry, you need a higher admin level to view this file\');</script>';
|
||||
$fileExt = explode(" ",pathinfo($file, PATHINFO_EXTENSION));
|
||||
$fileExt = $fileExt[0];
|
||||
if (array_search($fileExt,array("coffee","css","htm","html","js","less","md","php","py","rb","ruby","txt","xml"))!==false) {$finfo = "text";};
|
||||
if (array_search($fileExt,array("gif","jpg","jpeg","png"))!==false) {$finfo = "image";};
|
||||
}
|
||||
};
|
||||
if (strpos($finfo,"text")===0 || strpos($finfo,"empty")!==false) {
|
||||
echo 'fileType="text";';
|
||||
echo 'top.ICEcoder.shortURL = top.ICEcoder.rightClickedFile = top.ICEcoder.thisFileFolderLink = "'.$fileLoc."/".$fileName.'";';
|
||||
$loadedFile = toUTF8noBOM(file_get_contents($file,false,$context),true);
|
||||
echo '</script><textarea name="loadedFile" id="loadedFile">'.str_replace("</textarea>","<ICEcoder:/:textarea>",str_replace("&","&",$loadedFile)).'</textarea><script>';
|
||||
} else if (strpos($finfo,"image")===0) {
|
||||
echo 'fileType="image";fileName=\''.$fileLoc."/".$fileName.'\';';
|
||||
} else {
|
||||
echo 'fileType="other";window.open(\'http://'.$_SERVER['SERVER_NAME'].$fileLoc."/".$fileName.'\');';
|
||||
};
|
||||
} else {
|
||||
echo 'fileType="nothing"; top.ICEcoder.message(\'Sorry, '.$fileLoc."/".$fileName.' doesn\\\'t seem to exist on the server\');';
|
||||
}
|
||||
|
||||
if ($fileType=="image") {
|
||||
echo '<script>fileType="image";fileName=\''.$file.'\'</script>';
|
||||
};
|
||||
};
|
||||
|
||||
// Get the contents of a remote URL
|
||||
if ($_GET['action']=="getRemoteFile") {
|
||||
if ($remoteFile = toUTF8noBOM(file_get_contents($file,false,$context),true)) {
|
||||
// replace \r\n (Windows), \r (old Mac) and \n (Linux) line endings with whatever we chose to be lineEnding
|
||||
$remoteFile = str_replace("\r\n", $ICEcoder["lineEnding"], $remoteFile);
|
||||
$remoteFile = str_replace("\r", $ICEcoder["lineEnding"], $remoteFile);
|
||||
$remoteFile = str_replace("\n", $ICEcoder["lineEnding"], $remoteFile);
|
||||
echo 'top.ICEcoder.newTab();';
|
||||
echo '</script><textarea name="remoteFile" id="remoteFile">'.str_replace("</textarea>","<ICEcoder:/:textarea>",str_replace("&","&",$remoteFile)).'</textarea><script>';
|
||||
echo 'top.ICEcoder.getcMInstance().setValue(document.getElementById("remoteFile").value);action="getRemoteFile";';
|
||||
} else {
|
||||
echo 'action="nothing"; top.ICEcoder.message(\'Sorry, could\\\'t get contents of '.$file.'\');';
|
||||
}
|
||||
echo 'top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);';
|
||||
}
|
||||
|
||||
// If we're due to add a new folder...
|
||||
if ($_GET['action']=="newFolder") {
|
||||
if ($_SESSION['userLevel'] > 0) {
|
||||
mkdir($docRoot.$file, 0707);
|
||||
if (!$demoMode && is_writable($docRoot.$fileLoc)) {
|
||||
mkdir($file, 0705);
|
||||
// Reload file manager
|
||||
$fileName = substr($file,strrpos($file,"/")+1);
|
||||
$fileLoc = substr($file,0,strrpos($file,"/"));
|
||||
if ($fileLoc=="") {$fileLoc = "/";};
|
||||
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.$fileLoc.'\',\''.$fileName.'\');top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);action="newFolder";</script>';
|
||||
echo 'top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.$fileLoc.'\',\''.$fileName.'\');action="newFolder";';
|
||||
} else {
|
||||
if (!is_writable($docRoot.$file)) {
|
||||
echo "<script>alert('Sorry, cannot create folder at\\n".substr($file,0,strrpos($file,"/"))."');</script>";
|
||||
} else {
|
||||
echo '<script>alert(\'Sorry, you need to be logged in to add folders\');</script>';
|
||||
}
|
||||
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);action="nothing";</script>';
|
||||
echo "action='nothing'; top.ICEcoder.message('Sorry, cannot create folder at\\n".$fileLoc."');";
|
||||
}
|
||||
echo 'top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);';
|
||||
}
|
||||
|
||||
// If we're due to rename a file...
|
||||
if ($_GET['action']=="rename") {
|
||||
if ($_SESSION['userLevel'] > 0 && is_writable($_GET['oldFileName'])) {
|
||||
rename($_GET['oldFileName'],$docRoot.$file);
|
||||
// Reload file manager
|
||||
$fileName = substr($file,strrpos($file,"/")+1);
|
||||
$fileLoc = substr($file,0,strrpos($file,"/"));
|
||||
if ($fileLoc=="") {$fileLoc = "/";};
|
||||
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'rename\',\''.$fileLoc.'\',\''.$fileName.'\');top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);action="rename";</script>';
|
||||
} else {
|
||||
if (!is_writable($_GET['oldFileName'])) {
|
||||
echo "<script>alert('Sorry, cannot rename\\n".$_GET['oldFileName']."');</script>";
|
||||
// If we're due to paste a new file...
|
||||
if ($_GET['action']=="paste") {
|
||||
$source = $file;
|
||||
$dest = str_replace("//","/",$docRoot.strClean(str_replace("|","/",$_GET['location']))."/".basename($source));
|
||||
if (!$demoMode && is_writable(dirname($dest))) {
|
||||
if (is_dir($source)) {
|
||||
if (!is_dir($dest)) {
|
||||
mkdir($dest, 0705);
|
||||
} else {
|
||||
for ($i=2; $i<1000000000; $i++) {
|
||||
if (!is_dir($dest." (".$i.")")) {
|
||||
$dest = $dest." (".$i.")";
|
||||
mkdir($dest, 0705);
|
||||
$i=1000000000;
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach ($iterator = new RecursiveIteratorIterator(
|
||||
new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS),
|
||||
RecursiveIteratorIterator::SELF_FIRST) as $item
|
||||
) {
|
||||
if ($item->isDir()) {
|
||||
mkdir($dest.DIRECTORY_SEPARATOR.$iterator->getSubPathName(), 0705);
|
||||
} else {
|
||||
copy($item, $dest.DIRECTORY_SEPARATOR.$iterator->getSubPathName());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo '<script>alert(\'Sorry, you need to be logged in to rename\');</script>';
|
||||
if (!file_exists($dest)) {
|
||||
copy($source, $dest);
|
||||
} else {
|
||||
for ($i=2; $i<1000000000; $i++) {
|
||||
if (!file_exists($dest." (".$i.")")) {
|
||||
$dest = $dest." (".$i.")";
|
||||
copy($source, $dest);
|
||||
$i=1000000000;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);action="nothing";</script>';
|
||||
// Reload file manager
|
||||
echo 'top.ICEcoder.updateFileManagerList(\'add\',\''.strClean(str_replace("|","/",$_GET['location'])).'\',\''.basename($dest).'\');action="pasteFile";';
|
||||
} else {
|
||||
echo "action='nothing'; top.ICEcoder.message('Sorry, cannot copy \\n".str_replace($docRoot,"",$source)."\\n into \\n".str_replace($docRoot,"",$dest)."');";
|
||||
}
|
||||
echo 'top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);';
|
||||
}
|
||||
|
||||
// If we're due to upload files...
|
||||
if ($_GET['action']=="upload") {
|
||||
if (!$demoMode) {
|
||||
class fileUploader {
|
||||
public function __construct($uploads) {
|
||||
global $docRoot;
|
||||
$uploadDir=$docRoot.$iceRoot.str_replace("..","",str_replace("|","/",strClean($_POST['folder'])."/"));
|
||||
foreach($uploads as $current) {
|
||||
$this->uploadFile=$uploadDir.$current->name;
|
||||
$fileName = $current->name;
|
||||
if ($this->upload($current,$this->uploadFile)) {
|
||||
echo 'action="upload"; top.ICEcoder.updateFileManagerList(\'add\',top.ICEcoder.rightClickedFile.replace(/\|/g,\'/\'),\''.$fileName.'\',false,false,true); top.ICEcoder.serverMessage("Uploaded file(s) OK");setTimeout(function(){top.ICEcoder.serverMessage();},2000);';
|
||||
} else {
|
||||
echo "action='nothing'; top.ICEcoder.message('Sorry, cannot upload \\n".$fileName."\\n into \\n'+top.ICEcoder.rightClickedFile.replace(/\|/g,'/'));";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function upload($current,$uploadFile){
|
||||
if(move_uploaded_file($current->tmp_name,$uploadFile)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getDetails($fileArr) {
|
||||
foreach($fileArr['name'] as $keyee => $info) {
|
||||
$uploads[$keyee]->name=$fileArr['name'][$keyee];
|
||||
$uploads[$keyee]->type=$fileArr['type'][$keyee];
|
||||
$uploads[$keyee]->tmp_name=$fileArr['tmp_name'][$keyee];
|
||||
$uploads[$keyee]->error=$fileArr['error'][$keyee];
|
||||
}
|
||||
return $uploads;
|
||||
}
|
||||
|
||||
if($_FILES['filesInput']){
|
||||
$uploads = getDetails($_FILES['filesInput']);
|
||||
$fileUploader=new fileUploader($uploads);
|
||||
}
|
||||
} else {
|
||||
echo "action='nothing'; top.ICEcoder.message('Sorry, cannot upload whilst in demo mode');";
|
||||
}
|
||||
|
||||
echo "top.ICEcoder.hideFileMenu();top.document.getElementById('fileInput').value='';top.ICEcoder.showHide('hide',top.document.getElementById('loadingMask'));";
|
||||
}
|
||||
|
||||
// If we're due to rename a file/folder...
|
||||
if ($_GET['action']=="rename") {
|
||||
$renamed=false;
|
||||
if (!$demoMode && is_writable($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])))) {
|
||||
if(rename($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])),$docRoot.$fileLoc."/".$fileName)) {
|
||||
// Reload file manager
|
||||
echo 'top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'rename\',\''.$fileLoc.'\',\''.$fileName.'\',\'\',\''.str_replace($iceRoot,"",strClean($_GET['oldFileName'])).'\');';
|
||||
echo 'action="rename";';
|
||||
$renamed=true;
|
||||
}
|
||||
}
|
||||
if (!$renamed) {
|
||||
echo "action='nothing'; top.ICEcoder.message('Sorry, cannot rename\\n".strClean($_GET['oldFileName'])."\\n\\nMaybe public write permissions needed on this or parent folder?');";
|
||||
}
|
||||
echo 'top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);';
|
||||
}
|
||||
|
||||
// If we're due to replace text in a file...
|
||||
if ($_GET['action']=="replaceText") {
|
||||
if (!$demoMode && is_writable(str_replace("|","/",strClean($_GET['fileRef'])))) {
|
||||
$file = str_replace("|","/",strClean($_GET['fileRef']));
|
||||
$loadedFile = toUTF8noBOM(file_get_contents($file,false,$context),true);
|
||||
$newContent = str_replace(strClean($_GET['find']),strClean($_GET['replace']),$loadedFile);
|
||||
$fh = fopen($file, 'w') or die("Sorry, cannot save");
|
||||
fwrite($fh, $newContent);
|
||||
fclose($fh);
|
||||
echo 'action="replaceText";';
|
||||
} else {
|
||||
echo "action='nothing'; top.ICEcoder.message('Sorry, cannot replace text in\\n".strClean($_GET['fileRef'])."');";
|
||||
}
|
||||
echo 'top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);';
|
||||
}
|
||||
|
||||
// If we're due to change permissions on a file/folder...
|
||||
if ($_GET['action']=="perms") {
|
||||
if (!$demoMode && is_writable($file)) {
|
||||
chmod($file,octdec(numClean($_GET['perms'])));
|
||||
// Reload file manager
|
||||
echo 'top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'chmod\',\''.$fileLoc.'\',\''.$fileName.'\',\''.numClean($_GET['perms']).'\');';
|
||||
echo 'action="perms";';
|
||||
} else {
|
||||
echo "action='nothing'; top.ICEcoder.message('Sorry, cannot change permissions on \\n".strClean($file)."');";
|
||||
}
|
||||
echo 'top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);';
|
||||
}
|
||||
|
||||
// If we're due to delete a file...
|
||||
if ($_GET['action']=="delete") {
|
||||
if ($_SESSION['userLevel'] > 0) {
|
||||
$filesArray = split(";",$file); // May contain more than one file here
|
||||
for ($i=0;$i<=count($filesArray)-1;$i++) {
|
||||
if (is_writable($docRoot.$filesArray[$i])) {
|
||||
if (is_dir($docRoot.$filesArray[$i])) {
|
||||
rrmdir($docRoot.$filesArray[$i]);
|
||||
} else {
|
||||
unlink($docRoot.$filesArray[$i]);
|
||||
}
|
||||
// Reload file manager
|
||||
$fileName = substr($file,strrpos($file,"/")+1);
|
||||
$fileLoc = substr($file,0,strrpos($file,"/"));
|
||||
if ($fileLoc=="") {$fileLoc = "/";};
|
||||
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'delete\',\''.$fileLoc.'\',\''.$fileName.'\');top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);action="delete";</script>';
|
||||
} else {
|
||||
echo "<script>alert('Sorry can\\'t delete\\n".$filesArray[$i]."');</script>";
|
||||
}
|
||||
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);action="nothing";</script>';
|
||||
}
|
||||
} else {
|
||||
if (!is_writable($docRoot.$filesArray[$i])) {
|
||||
echo "<script>alert('Sorry, cannot delete\\n".$docRoot.$filesArray[$i]."');</script>";
|
||||
$filesArray = explode(";",$file); // May contain more than one file here
|
||||
for ($i=0;$i<count($filesArray);$i++) {
|
||||
$fullPath = str_replace($docRoot,"",$filesArray[$i]);
|
||||
$fullPath = str_replace($iceRoot,"",$fullPath);
|
||||
$fullPath = $docRoot.$iceRoot.$fullPath;
|
||||
if (!$demoMode && is_writable($fullPath)) {
|
||||
is_dir($fullPath)
|
||||
? rrmdir($fullPath)
|
||||
: unlink($fullPath);
|
||||
$fileName = basename($fullPath);
|
||||
$fileLoc = dirname(str_replace($docRoot,"",$fullPath));
|
||||
if ($fileLoc=="" || $fileLoc=="\\") {$fileLoc="/";};
|
||||
// Reload file manager
|
||||
echo 'top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'delete\',\''.$fileLoc.'\',\''.$fileName.'\');';
|
||||
echo 'action="delete";';
|
||||
} else {
|
||||
echo '<script>alert(\'Sorry, you need to be logged in to delete\');</script>';
|
||||
echo "top.ICEcoder.message('Sorry can\\'t delete\\n".str_replace($docRoot,"",$fullPath)."');";
|
||||
}
|
||||
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);action="nothing";</script>';
|
||||
echo 'action="nothing";';
|
||||
}
|
||||
echo 'top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);';
|
||||
}
|
||||
|
||||
// The function to recursively remove folders & files
|
||||
@@ -119,7 +251,9 @@ function rrmdir($dir) {
|
||||
$objects = scandir($dir);
|
||||
foreach ($objects as $object) {
|
||||
if ($object != "." && $object != "..") {
|
||||
if (filetype($dir."/".$object) == "dir") rrmdir($dir."/".$object); else unlink($dir."/".$object);
|
||||
filetype($dir."/".$object) == "dir"
|
||||
? rrmdir($dir."/".$object)
|
||||
: unlink($dir."/".$object);
|
||||
}
|
||||
}
|
||||
reset($objects);
|
||||
@@ -128,141 +262,160 @@ function rrmdir($dir) {
|
||||
}
|
||||
|
||||
if ($_GET['action']=="save") {
|
||||
echo '<script>action="save";</script>';
|
||||
echo 'action="save";';
|
||||
// on the form posting via a reload, save the file
|
||||
if (isset($_POST['contents'])) {
|
||||
if ($_SESSION['userLevel'] > 0) {
|
||||
if (isset($_POST['newFileName'])&&$_POST['newFileName']!="") {
|
||||
$file = $_POST['newFileName'];
|
||||
}
|
||||
$saveFile = str_replace("\\","/",$_SERVER['DOCUMENT_ROOT']).$file;
|
||||
$saveFile = str_replace("//","/",$saveFile);
|
||||
if ((file_exists($saveFile) && is_writable($saveFile)) || $_POST['newFileName']!="") {
|
||||
if (filemtime($saveFile)==$_GET['fileMDT']||!(isset($_GET['fileMDT']))) {
|
||||
$fh = fopen($saveFile, 'w') or die("Sorry, cannot save");
|
||||
fwrite($fh, $_POST['contents']);
|
||||
fclose($fh);
|
||||
clearstatcache();
|
||||
echo '<script>top.ICEcoder.openFileMDTs[top.ICEcoder.selectedTab-1]="'.filemtime($saveFile).'";</script>';
|
||||
|
||||
if (isset($_POST['newFileName'])&&$_POST['newFileName']!="") {
|
||||
// Reload file manager & stop CTRL+s being sticky
|
||||
$fileName = substr($file,strrpos($file,"/")+1);
|
||||
$fileLoc = substr($file,0,strrpos($file,"/"));
|
||||
if ($fileLoc=="") {$fileLoc = "/";};
|
||||
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.$fileLoc.'\',\''.$fileName.'\')</script>';
|
||||
if (!$demoMode && ((file_exists($file) && is_writable($file)) || isset($_POST['newFileName']) && $_POST['newFileName']!="")) {
|
||||
$filemtime = $serverType=="Linux" ? filemtime($file) : "1000000";
|
||||
if (!(isset($_GET['fileMDT']))||$filemtime==$_GET['fileMDT']) {
|
||||
$fh = fopen($file, 'w') or die("Sorry, cannot save");
|
||||
// replace \r\n (Windows), \r (old Mac) and \n (Linux) line endings with whatever we chose to be lineEnding
|
||||
$contents = $_POST['contents'];
|
||||
$contents = str_replace("\r\n", $ICEcoder["lineEnding"], $contents);
|
||||
$contents = str_replace("\r", $ICEcoder["lineEnding"], $contents);
|
||||
$contents = str_replace("\n", $ICEcoder["lineEnding"], $contents);
|
||||
// Now write that content, close the file and clear the statcache
|
||||
fwrite($fh, $contents);
|
||||
fclose($fh);
|
||||
clearstatcache();
|
||||
$filemtime = $serverType=="Linux" ? filemtime($file) : "1000000";
|
||||
echo 'top.ICEcoder.openFileMDTs[top.ICEcoder.selectedTab-1]="'.$filemtime.'";';
|
||||
// Reload file manager, rename tab & remove old file highlighting if it was a new file
|
||||
if (isset($_POST['newFileName']) && $_POST['newFileName']!="") {
|
||||
echo 'top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.$fileLoc.'\',\''.$fileName.'\');';
|
||||
echo 'top.ICEcoder.renameTab(top.ICEcoder.selectedTab,\''.$fileLoc."/".$fileName.'\');';
|
||||
if (!strpos($_GET['file'],"[NEW]")) {
|
||||
// We're saving as a new file, so unhighlight the old name in the file manager if visible
|
||||
echo "fileLink = top.ICEcoder.filesFrame.contentWindow.document.getElementById('".str_replace("/","|",$fileLoc)."|".basename($_GET['file'])."');";
|
||||
echo "if (fileLink) {fileLink.style.backgroundColor = top.ICEcoder.tabBGnormal; fileLink.style.color = top.ICEcoder.tabFGnormalFile};";
|
||||
}
|
||||
if (isset($_POST['newFileName'])&&$_POST['newFileName']!="") {
|
||||
echo '<script>top.ICEcoder.renameTab(top.ICEcoder.selectedTab,\''.$file.'\');</script>';
|
||||
}
|
||||
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);if (top.ICEcoder.stickyTabWindow.location) {top.ICEcoder.stickyTabWindow.location.reload()};action="doneSave";</script>';
|
||||
} else {
|
||||
$loadedFile = file_get_contents($saveFile);
|
||||
echo '<textarea name="loadedFile" id="loadedFile">'.str_replace("</textarea>","<ICEcoder:/:textarea>",$loadedFile).'</textarea>';
|
||||
echo '<textarea name="userVersionFile" id="userVersionFile"></textarea>';
|
||||
?>
|
||||
<script>
|
||||
var refreshFile = confirm('Sorry, this file has changed, cannot save\n<?php echo $file;?>\n\nReload this file and copy your version to a new document?');
|
||||
if (refreshFile) {
|
||||
var cM = top.ICEcoder.getcMInstance();
|
||||
var thisTab = top.ICEcoder.selectedTab;
|
||||
document.getElementById('userVersionFile').value = cM.getValue();
|
||||
// Revert back to original
|
||||
cM.setValue(document.getElementById('loadedFile').value);
|
||||
top.ICEcoder.changedContent[thisTab-1] = 0;
|
||||
top.ICEcoder.openFileMDTs[top.ICEcoder.selectedTab-1] = "<?php echo filemtime($saveFile); ?>";
|
||||
cM.clearHistory();
|
||||
// Now for the new file
|
||||
top.ICEcoder.newTab();
|
||||
cM = top.ICEcoder.getcMInstance();
|
||||
cM.setValue(document.getElementById('userVersionFile').value);
|
||||
cM.clearHistory();
|
||||
// Finally, switch back to original tab
|
||||
top.ICEcoder.switchTab(thisTab);
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);action="nothing";</script>';
|
||||
}
|
||||
} else {
|
||||
echo "<script>alert('Sorry, cannot write\\n".$file."');</script>";
|
||||
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);action="nothing";</script>';
|
||||
}
|
||||
} else {
|
||||
if (!is_writable($saveFile)) {
|
||||
echo "<script>alert('Sorry, cannot write\\n".$file."');</script>";
|
||||
// Reload previewWindow window if not a Markdown file
|
||||
echo 'if (top.ICEcoder.previewWindow.location && top.ICEcoder.previewWindow.location.pathname.indexOf(".md")==-1) {top.ICEcoder.previewWindow.location.reload()};';
|
||||
echo 'top.ICEcoder.setPreviousFiles();action="doneSave";';
|
||||
} else {
|
||||
echo '<script>alert(\'Sorry, you need to be logged in to save\');</script>';
|
||||
$loadedFile = toUTF8noBOM(file_get_contents($file,false,$context),true);
|
||||
echo '</script><textarea name="loadedFile" id="loadedFile">'.str_replace("</textarea>","<ICEcoder:/:textarea>",htmlentities($loadedFile)).'</textarea>';
|
||||
echo '<textarea name="userVersionFile" id="userVersionFile"></textarea><script>';
|
||||
?>
|
||||
var refreshFile = top.ICEcoder.ask('Sorry, this file has changed, cannot save\n<?php echo $file;?>\n\nReload this file and copy your version to a new document?');
|
||||
if (refreshFile) {
|
||||
var cM = top.ICEcoder.getcMInstance();
|
||||
var thisTab = top.ICEcoder.selectedTab;
|
||||
document.getElementById('userVersionFile').value = cM.getValue();
|
||||
// Revert back to original
|
||||
cM.setValue(document.getElementById('loadedFile').value);
|
||||
top.ICEcoder.changedContent[thisTab-1] = 0;
|
||||
top.ICEcoder.openFileMDTs[top.ICEcoder.selectedTab-1] = "<?php echo $filemtime; ?>";
|
||||
cM.clearHistory();
|
||||
// Now for the new file
|
||||
top.ICEcoder.newTab();
|
||||
cM = top.ICEcoder.getcMInstance();
|
||||
cM.setValue(document.getElementById('userVersionFile').value);
|
||||
cM.clearHistory();
|
||||
// Finally, switch back to original tab
|
||||
top.ICEcoder.switchTab(thisTab);
|
||||
}
|
||||
action='nothing';
|
||||
<?php
|
||||
}
|
||||
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);action="nothing";</script>';
|
||||
} else {
|
||||
echo "action='nothing';top.ICEcoder.message('Sorry, cannot write\\n".$file."');";
|
||||
}
|
||||
echo 'top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);';
|
||||
}
|
||||
};
|
||||
?>
|
||||
<script>
|
||||
if (action=="load") {
|
||||
if (fileType=="text") {
|
||||
top.ICEcoder.loadingFile = true;
|
||||
// Reset the various states back to their initial setting
|
||||
selectedTab = top.ICEcoder.openFiles.length; // The tab that's currently selected
|
||||
setTimeout(function() {
|
||||
if (!top.ICEcoder.content.contentWindow.createNewCMInstance) {
|
||||
console.log('There was tech hiccup, likely something wasn\'t quite ready. So ICEcoder reloaded it\'s file control again.');
|
||||
window.location.reload();
|
||||
<?php
|
||||
if (file_exists($file)) {
|
||||
?>
|
||||
} else {
|
||||
top.ICEcoder.loadingFile = true;
|
||||
// Reset the various states back to their initial setting
|
||||
selectedTab = top.ICEcoder.openFiles.length; // The tab that's currently selected
|
||||
|
||||
// Finally, store all data, show tabs etc
|
||||
top.ICEcoder.createNewTab();
|
||||
top.ICEcoder.cMInstances.push(top.ICEcoder.nextcMInstance);
|
||||
top.ICEcoder.content.contentWindow.createNewCMInstance(top.ICEcoder.nextcMInstance);
|
||||
// Finally, store all data, show tabs etc
|
||||
top.ICEcoder.createNewTab();
|
||||
top.ICEcoder.cMInstances.push(top.ICEcoder.nextcMInstance);
|
||||
top.ICEcoder.setLayout();
|
||||
top.ICEcoder.content.contentWindow.createNewCMInstance(top.ICEcoder.nextcMInstance);
|
||||
|
||||
// Set the value & innerHTML of the code textarea to that of our loaded file plus make it visible (it's hidden on _coder's load)
|
||||
top.ICEcoder.switchMode();
|
||||
cM = top.ICEcoder.getcMInstance();
|
||||
cM.setValue(document.getElementById('loadedFile').value);
|
||||
top.document.getElementById('content').style.visibility='visible';
|
||||
top.ICEcoder.switchTab(top.ICEcoder.selectedTab);
|
||||
cM.focus();
|
||||
// Set the value & innerHTML of the code textarea to that of our loaded file plus make it visible (it's hidden on ICEcoder's load)
|
||||
top.ICEcoder.switchMode();
|
||||
cM = top.ICEcoder.getcMInstance();
|
||||
cM.setValue(document.getElementById('loadedFile').value);
|
||||
top.document.getElementById('content').style.visibility='visible';
|
||||
top.ICEcoder.switchTab(top.ICEcoder.selectedTab);
|
||||
top.ICEcoder.focus();
|
||||
|
||||
// Then clean it up, set the text cursor, update the display and get the character data
|
||||
top.ICEcoder.contentCleanUp();
|
||||
top.ICEcoder.content.contentWindow['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].setLineClass(top.ICEcoder['cMActiveLine'+top.ICEcoder.selectedTab], null);
|
||||
top.ICEcoder['cMActiveLine'+top.ICEcoder.selectedTab] = top.ICEcoder.content.contentWindow['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].setLineClass(0, "cm-s-activeLine");
|
||||
top.ICEcoder.nextcMInstance++;
|
||||
top.ICEcoder.openFileMDTs.push('<?php echo filemtime($file); ?>');
|
||||
top.ICEcoder.loadingFile = false;
|
||||
// Then clean it up, set the text cursor, update the display and get the character data
|
||||
top.ICEcoder.contentCleanUp();
|
||||
top.ICEcoder.content.contentWindow['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].removeLineClass(top.ICEcoder['cMActiveLine'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]], "background");
|
||||
top.ICEcoder['cMActiveLine'+top.ICEcoder.selectedTab] = top.ICEcoder.content.contentWindow['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].addLineClass(0, "background", "cm-s-activeLine");
|
||||
top.ICEcoder.nextcMInstance++;
|
||||
top.ICEcoder.openFileMDTs.push('<?php echo $serverType=="Linux" ? filemtime($file) : "1000000"; ?>');
|
||||
for (var i=0; i<cM.lineCount(); i++) {
|
||||
top.ICEcoder.content.contentWindow.CodeMirror.newFoldFunction(top.ICEcoder.content.contentWindow.CodeMirror[
|
||||
cM.getLine(i).indexOf("{")>-1
|
||||
? "braceRangeFinder"
|
||||
: "tagRangeFinder"
|
||||
],null,"+","-",true)(cM, i);
|
||||
}
|
||||
top.ICEcoder.loadingFile = false;
|
||||
<?php
|
||||
;};
|
||||
?>
|
||||
}
|
||||
},4);
|
||||
}
|
||||
|
||||
if (fileType=="image") {
|
||||
top.document.getElementById('blackMask').style.visibility = "visible";
|
||||
top.document.getElementById('mediaContainer').innerHTML = "<img src=\"<?php echo str_replace($docRoot,"",$file);?>\" class=\"whiteGlow\" style=\"border: solid 10px #fff; max-width: 700px; max-height: 500px\" onClick=\"return false\"><br><span class=\"whiteGlow\" style=\"border: solid 10px #fff; color: #000; background-color: #fff\" onClick=\"return false\"><?php echo str_replace($docRoot,"",$file);?></span>";
|
||||
top.document.getElementById('mediaContainer').innerHTML =
|
||||
"<canvas id=\"canvasPicker\" width=\"1\" height=\"1\" style=\"position: absolute; margin: 10px 0 0 10px; cursor: crosshair\" onmouseover=\"top.ICEcoder.overPopup=true\" onmouseout=\"top.ICEcoder.overPopup=false\"></canvas>" +
|
||||
"<img src=\"<?php echo $fileLoc."/".$fileName;?>\" class=\"whiteGlow\" style=\"border: solid 10px #fff; max-width: 700px; max-height: 500px; background-color: #000; background-image: url('images/checkerboard.png')\" onLoad=\"reducedImgMsg = (this.naturalWidth > 700 || this.naturalHeight > 500) ? ', displayed at ' + this.width + ' x ' + this.height : ''; document.getElementById('imgInfo').innerHTML += ' (' + this.naturalWidth + ' x ' + this.naturalHeight + reducedImgMsg + ')'; top.ICEcoder.drawCanvasImage(this)\"><br>" +
|
||||
"<div class=\"whiteGlow\" style=\"display: inline-block; margin-top: -10px; border: solid 10px #fff; color: #000; background-color: #fff\" id=\"imgInfo\" onmouseover=\"top.ICEcoder.overPopup=true\" onmouseout=\"top.ICEcoder.overPopup=false\">" +
|
||||
"<b><?php echo $fileLoc."/".$fileName;?></b>" +
|
||||
"</div><br>" +
|
||||
"<input type=\"text\" id=\"hexMouseXY\" style=\"border: 1px solid #888; border-right: 0; width: 70px\" onmouseover=\"top.ICEcoder.overPopup=true\" onmouseout=\"top.ICEcoder.overPopup=false\"></input>" +
|
||||
"<input type=\"text\" id=\"rgbMouseXY\" style=\"border: 1px solid #888; margin-right: 10px; width: 70px\" onmouseover=\"top.ICEcoder.overPopup=true\" onmouseout=\"top.ICEcoder.overPopup=false\"></input>" +
|
||||
"<input type=\"text\" id=\"hex\" style=\"border: 1px solid #888; border-right: 0; width: 70px\" onmouseover=\"top.ICEcoder.overPopup=true\" onmouseout=\"top.ICEcoder.overPopup=false\"></input>" +
|
||||
"<input type=\"text\" id=\"rgb\" style=\"border: 1px solid #888; width: 70px\" onmouseover=\"top.ICEcoder.overPopup=true\" onmouseout=\"top.ICEcoder.overPopup=false\"></input>";
|
||||
}
|
||||
|
||||
top.ICEcoder.serverMessage();
|
||||
top.ICEcoder.serverQueue("del",0);
|
||||
top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);
|
||||
}
|
||||
</script>
|
||||
|
||||
<form name="saveFile" action="file-control.php?action=save&file=<?php if (isset($file)) {echo $file;}; if (isset($_GET['fileMDT']) && $_GET['fileMDT']!="undefined") {echo "&fileMDT=".$_GET['fileMDT'];};?>" method="POST">
|
||||
<textarea name="contents"></textarea>
|
||||
<input type="hidden" name="newFileName" value="">
|
||||
<form name="saveFile" action="file-control.php?action=save&file=<?php if (isset($file)) {echo $file;}; if (isset($_GET['fileMDT']) && $_GET['fileMDT']!="undefined") {echo "&fileMDT=".numClean($_GET['fileMDT']);};?>" method="POST">
|
||||
<textarea name="contents"></textarea>
|
||||
<input type="hidden" name="newFileName" value="">
|
||||
</form>
|
||||
|
||||
<script>
|
||||
if (action=="save") {
|
||||
<?php
|
||||
if ($file=="|[NEW]"||$saveType=="saveAs") {
|
||||
if (strpos($file,"[NEW]")>0||$saveType=="saveAs") {
|
||||
?>
|
||||
if (top.ICEcoder.rightClickedFile) {
|
||||
shortURL = top.ICEcoder.rightClickedFile.substr((top.ICEcoder.rightClickedFile.indexOf(top.shortURLStarts)+top.shortURLStarts.length),top.ICEcoder.rightClickedFile.length).replace(/\|/g,"/")+"/";
|
||||
newFileName = prompt('Enter Filename',shortURL);
|
||||
} else {
|
||||
newFileName = prompt('Enter Filename','/');
|
||||
fileLoc = '<?php echo $fileLoc;?>';
|
||||
newFileName = top.ICEcoder.getInput('Enter filename to save at '+(fileLoc!='' ? fileLoc : '/'),'');
|
||||
if (newFileName) {
|
||||
if (newFileName.substr(0,1)!="/") {newFileName = "/" + newFileName}
|
||||
newFileName = fileLoc + newFileName;
|
||||
if (top.document.getElementById('filesFrame').contentWindow.document.getElementById(newFileName.replace(/\//g,"|"))) {
|
||||
overwriteOK = top.ICEcoder.ask('That file exists already, overwrite?');
|
||||
}
|
||||
}
|
||||
if (newFileName && top.document.getElementById('filesFrame').contentWindow.document.getElementById(newFileName.replace(/\//g,"|"))) {
|
||||
overwriteOK = confirm('That file exists already, overwrite?');
|
||||
}
|
||||
document.saveFile.newFileName.value = newFileName;
|
||||
document.saveFile.newFileName.value = '<?php echo $docRoot; ?>' + newFileName;
|
||||
<?php ;};?>
|
||||
if ("undefined" == typeof newFileName || (newFileName && "undefined" == typeof overwriteOK) || ("undefined" != typeof overwriteOK && overwriteOK)) {
|
||||
if ("undefined" != typeof newFileName) {
|
||||
top.ICEcoder.serverMessage('<b>Saving</b><br>'+newFileName);
|
||||
}
|
||||
top.ICEcoder.serverMessage('<b>Saving</b><br>'+ <?php echo strpos($file,"[NEW]")>0 ? "newFileName" : "'$file'"; ?>);
|
||||
document.saveFile.contents.value = top.document.getElementById('saveTemp1').value;
|
||||
document.saveFile.submit();
|
||||
} else {
|
||||
@@ -270,9 +423,7 @@ if (action=="save") {
|
||||
action=="nothing";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
if (action=="doneSave") {
|
||||
top.ICEcoder.changedContent[top.ICEcoder.selectedTab-1] = 0;
|
||||
top.ICEcoder.redoTabHighlight(top.ICEcoder.selectedTab);
|
||||
|
||||
41
lib/file-types.css
Normal file
@@ -0,0 +1,41 @@
|
||||
.fileManager {
|
||||
margin: 15px 0 15px 20px;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.fileManager span {font-family: helvetica, arial, swiss, verdana; padding: 1px 3px; border-radius: 3px}
|
||||
.fileManager a {color: #eee; text-decoration: none; cursor: pointer}
|
||||
.fileManager .pft-directory, .fileManager .pft-file {list-style-image: url(../images/blank.gif)}
|
||||
.fileManager ul, .fileManager li {margin-left: 15px}
|
||||
|
||||
/* Default file */
|
||||
.fileManager LI.pft-directory:before, .fileManager LI.pft-file:before {
|
||||
position: absolute; display: block; width: 16px; height: 16px; content: ""; margin-top: -2px; margin-left: -20px; background:url(../images/file-folder-icons.png) no-repeat 0 0;
|
||||
}
|
||||
.fileManager LI.dirOpen:before {background-position: -16px 0}
|
||||
|
||||
@media screen and (-webkit-min-device-pixel-ratio:0) { /* hacked for chrome and safari */
|
||||
.fileManager LI.pft-directory:before, .fileManager LI.pft-file:before {
|
||||
margin-top: -19px;
|
||||
}
|
||||
}
|
||||
.fileManager LI.pft-file:before {background-position: -32px 0}
|
||||
|
||||
/* Additional file types */
|
||||
.fileManager LI.ext-coffee:before {background-position: -48px 0}
|
||||
.fileManager LI.ext-css:before {background-position: -64px 0}
|
||||
.fileManager LI.ext-gif:before {background-position: -80px 0}
|
||||
.fileManager LI.ext-htm:before, .fileManager LI.ext-html:before {background-position: -96px 0}
|
||||
.fileManager LI.ext-jpg:before, .fileManager LI.ext-jpeg:before {background-position: -112px 0}
|
||||
.fileManager LI.ext-js:before {background-position: -128px 0}
|
||||
.fileManager LI.ext-less:before {background-position: -144px 0}
|
||||
.fileManager LI.ext-md:before {background-position: -160px 0}
|
||||
.fileManager LI.ext-php:before {background-position: -176px 0}
|
||||
.fileManager LI.ext-png:before {background-position: -192px 0}
|
||||
.fileManager LI.ext-py:before {background-position: -208px 0}
|
||||
.fileManager LI.ext-rb:before, .fileManager LI.ext-ruby:before {background-position: -224px 0}
|
||||
.fileManager LI.ext-txt:before {background-position: -240px 0}
|
||||
.fileManager LI.ext-zip:before {background-position: -256px 0}
|
||||
@@ -19,52 +19,4 @@ table, caption, tbody, tfoot, thead, tr, th, td {
|
||||
|
||||
body {margin: 0; overflow: auto}
|
||||
|
||||
.refresh {float: right; margin-right: 15px; cursor: pointer}
|
||||
|
||||
.fileManager {
|
||||
margin: 15px 0 15px 22px;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-o-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.fileManager span {font-family: helvetica, arial, swiss, verdana}
|
||||
.fileManager a {color: #eee; text-decoration: none}
|
||||
.fileManager .open {font-style: italic}
|
||||
.fileManager .closed {font-style: normal}
|
||||
.fileManager .pft-directory, .fileManager .pft-file {list-style-image: url(../images/blank.gif)}
|
||||
.fileManager li {margin-left: 15px}
|
||||
|
||||
/* Default file */
|
||||
.fileManager LI.pft-directory:before, .fileManager LI.pft-file:before {
|
||||
position: absolute; display: block; width: 16px; height: 16px; content: ""; margin-top: -2px; margin-left: -23px; background:url(../images/file-manager-icons.png) no-repeat 0 0;
|
||||
}
|
||||
@media screen and (-webkit-min-device-pixel-ratio:0) { /* hacked for chrome and safari */
|
||||
.fileManager LI.pft-directory:before, .fileManager LI.pft-file:before {
|
||||
margin-top: -19px;
|
||||
}
|
||||
}
|
||||
.fileManager LI.pft-file:before {background-position: -16px 0}
|
||||
|
||||
/* Additional file types */
|
||||
.fileManager LI.ext-coffee:before {background-position: -32px 0}
|
||||
.fileManager LI.ext-css:before {background-position: -48px 0}
|
||||
.fileManager LI.ext-gif:before {background-position: -64px 0}
|
||||
.fileManager LI.ext-htm:before {background-position: -80px 0}
|
||||
.fileManager LI.ext-html:before {background-position: -80px 0}
|
||||
.fileManager LI.ext-jpg:before {background-position: -96px 0}
|
||||
.fileManager LI.ext-jpeg:before {background-position: -96px 0}
|
||||
.fileManager LI.ext-js:before {background-position: -112px 0}
|
||||
/*.fileManager LI.ext-pdf:before {background-position: -???px 0} */
|
||||
.fileManager LI.ext-php:before {background-position: -128px 0}
|
||||
.fileManager LI.ext-png:before {background-position: -144px 0}
|
||||
.fileManager LI.ext-rb:before {background-position: -160px 0}
|
||||
.fileManager LI.ext-rbx:before {background-position: -160px 0}
|
||||
.fileManager LI.ext-rhtml:before {background-position: -160px 0}
|
||||
.fileManager LI.ext-ruby:before {background-position: -160px 0}
|
||||
/*.fileManager LI.ext-sql:before {background-position: -???px 0} */
|
||||
/*.fileManager LI.ext-swf:before {background-position: -???px 0} */
|
||||
.fileManager LI.ext-txt:before {background-position: -176px 0}
|
||||
/*.fileManager LI.ext-xml:before {background-position: -???px 0} */
|
||||
.fileManager LI.ext-zip:before {background-position: -192px 0}
|
||||
.refresh {position: fixed; display: inline-block; width: 14px; height: 14px; background: url('../images/file-manager-icons.png') -100px -16px no-repeat; right: 0; margin-right: 15px; top: 17px; cursor: pointer}
|
||||
54
lib/foldcode.js
Normal file
@@ -0,0 +1,54 @@
|
||||
// Modified version of CodeMirror's codefold.js to show guttermarkers
|
||||
|
||||
CodeMirror.newFoldFunction = function(rangeFinder, widget, markOn, markOff, dontCollapse) {
|
||||
if (widget == null) widget = "\u2194";
|
||||
if (typeof widget == "string") {
|
||||
var text = document.createTextNode(widget);
|
||||
widget = document.createElement("span");
|
||||
widget.appendChild(text);
|
||||
widget.className = "CodeMirror-foldmarker";
|
||||
}
|
||||
if (markOn == null) markOn = "+";
|
||||
if (typeof markOn == "string") {
|
||||
var text = document.createTextNode(markOn);
|
||||
markOn = document.createElement("span");
|
||||
markOn.appendChild(text);
|
||||
markOn.className = "fold foldOn";
|
||||
}
|
||||
if (markOff == null) markOff = "-";
|
||||
if (typeof markOff == "string") {
|
||||
var text = document.createTextNode(markOff);
|
||||
markOff = document.createElement("span");
|
||||
markOff.appendChild(text);
|
||||
markOff.className = "fold foldOff";
|
||||
}
|
||||
|
||||
return function(cm, pos) {
|
||||
if (typeof pos == "number") pos = CodeMirror.Pos(pos, 0);
|
||||
var range = rangeFinder(cm, pos);
|
||||
foldable = range && (range.from.line != range.to.line || range.from.ch != range.to.ch) ? true : false;
|
||||
if (!foldable) cm.setGutterMarker(pos.line, "folds", null);
|
||||
if (!range) return;
|
||||
|
||||
var present = cm.findMarksAt(range.from), cleared = 0;
|
||||
for (var i = 0; i < present.length; ++i) {
|
||||
if (present[i].__isFold) {
|
||||
++cleared;
|
||||
present[i].clear();
|
||||
}
|
||||
}
|
||||
|
||||
if (foldable) {
|
||||
cm.setGutterMarker(pos.line, "folds", cleared || dontCollapse ? markOff.cloneNode(true) : markOn.cloneNode(true));
|
||||
}
|
||||
|
||||
if (cleared || dontCollapse) return;
|
||||
var myWidget = widget.cloneNode(true);
|
||||
CodeMirror.on(myWidget, "mousedown", function() {myRange.clear();cm.setGutterMarker(pos.line, "folds", markOff.cloneNode(true));});
|
||||
var myRange = cm.markText(range.from, range.to, {
|
||||
replacedWith: myWidget,
|
||||
clearOnEnter: true,
|
||||
__isFold: true
|
||||
});
|
||||
};
|
||||
};
|
||||
93
lib/get-branch.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
if (!isset($ICEcoder['root'])) {
|
||||
include("settings.php");
|
||||
}
|
||||
|
||||
if (!$_SESSION['loggedIn']) {
|
||||
header("Location: ../");
|
||||
}
|
||||
|
||||
// If we're just getting a branch, get that and set as the finalArray
|
||||
$scanDir = $docRoot.$iceRoot;
|
||||
$location = "";
|
||||
if (isset($_GET['location'])) {
|
||||
echo '<div id="branch" style="display: none">';
|
||||
$location = str_replace("|","/",$_GET['location']);
|
||||
}
|
||||
if ($location=="/") {$location = "";};
|
||||
|
||||
$dirArray = $filesArray = $finalArray = array();
|
||||
$finalArray = scanDir($scanDir.$location);
|
||||
foreach($finalArray as $entry) {
|
||||
$canAdd = true;
|
||||
for ($i=0;$i<count($_SESSION['bannedFiles']);$i++) {
|
||||
if(strpos($entry,$_SESSION['bannedFiles'][$i])!==false) {$canAdd = false;}
|
||||
}
|
||||
if ($entry != "." && $entry != ".." && $canAdd) {
|
||||
is_dir($docRoot.$iceRoot.$location."/".$entry)
|
||||
? array_push($dirArray,$location."/".$entry)
|
||||
: array_push($filesArray,$location."/".$entry);
|
||||
}
|
||||
}
|
||||
natcasesort($dirArray);
|
||||
natcasesort($filesArray);
|
||||
|
||||
$finalArray = array_merge($dirArray,$filesArray);
|
||||
for ($i=0;$i<count($finalArray);$i++) {
|
||||
$fileFolderName = str_replace("\\","/",$finalArray[$i]);
|
||||
$type = is_dir($docRoot.$iceRoot.$fileFolderName) ? "folder" : "file";
|
||||
if ($type=="file") {
|
||||
// Get extension (prefix 'ext-' to prevent invalid classes from extensions that begin with numbers)
|
||||
$ext = "ext-".pathinfo($docRoot.$iceRoot.$fileFolderName, PATHINFO_EXTENSION);
|
||||
}
|
||||
if ($i==0) {echo "<ul style=\"display: block\">\n";}
|
||||
if ($i==count($finalArray)-1 && isset($_GET['location'])) {
|
||||
echo "</ul>\n";
|
||||
}
|
||||
$type == "folder" ? $class = 'pft-directory' : $class = 'pft-file '.strtolower($ext);
|
||||
$loadParam = $type == "folder" ? "true" : "false";
|
||||
echo "<li class=\"".$class."\"><a nohref title=\"$fileFolderName\" onMouseOver=\"top.ICEcoder.overFileFolder('$type',this.childNodes[1].id)\" onMouseOut=\"top.ICEcoder.overFileFolder('$type','')\" onClick=\"if(!event.ctrlKey && !top.ICEcoder.cmdKey) {top.ICEcoder.openCloseDir(this,$loadParam); if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {top.ICEcoder.openFile()}}\" style=\"position: relative; left:-22px\"> <span id=\"".str_replace($docRoot,"",str_replace("/","|",$fileFolderName))."\">".basename($fileFolderName)."</span> ";
|
||||
echo '<span style="color: #888; font-size: 8px" id="'.str_replace($docRoot,"",str_replace("/","|",$fileFolderName)).'_perms">';
|
||||
echo $serverType=="Linux" ? substr(sprintf('%o', fileperms($docRoot.$iceRoot.$fileFolderName)), -3) : '';
|
||||
echo "</span></a></li>\n";
|
||||
}
|
||||
|
||||
if (isset($_GET['location'])) {
|
||||
?>
|
||||
</div>
|
||||
<script>
|
||||
targetElem = top.ICEcoder.filesFrame.contentWindow.document.getElementById('<?php echo $_GET['location'];?>');
|
||||
newUL = document.createElement("ul");
|
||||
newUL.style = "display: block";
|
||||
locNest = targetElem.parentNode.parentNode;
|
||||
if(locNest.nextSibling && locNest.nextSibling.tagName=="UL") {
|
||||
x = locNest.nextSibling;
|
||||
x.parentNode.removeChild(x);
|
||||
}
|
||||
folderContent = document.getElementById('branch').innerHTML;
|
||||
if (folderContent.indexOf('<ul')>-1 || folderContent.indexOf('<li')>-1) {
|
||||
// Now animate folders & files into view
|
||||
i=0;
|
||||
animFolders = setInterval(function() {
|
||||
i++;
|
||||
showContent = "";
|
||||
folderItems = folderContent.split("\n");
|
||||
for (j=0; j<=i; j++) {
|
||||
showContent += folderItems[j];
|
||||
if (j<i) {showContent += "\n";};
|
||||
}
|
||||
showContent = showContent.slice(28);
|
||||
if (j==folderItems.length) {
|
||||
clearInterval(animFolders);
|
||||
showContent = showContent.slice(0,-2);
|
||||
setTimeout(function(){top.ICEcoder.redoTabHighlight(top.ICEcoder.selectedTab);},4);
|
||||
if (!top.ICEcoder.fmReady) {top.ICEcoder.fmReady=true;};
|
||||
}
|
||||
newUL.innerHTML = showContent;
|
||||
locNest.parentNode.insertBefore(newUL,locNest.nextSibling);
|
||||
},4);
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
;};
|
||||
?>
|
||||
16
lib/help.css
@@ -17,15 +17,17 @@ table, caption, tbody, tfoot, thead, tr, th, td {
|
||||
}
|
||||
|
||||
body {overflow: hidden;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-o-user-select:none;
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
h1 {font-size: 36px; font-weight: normal; color: #888; margin-bottom: 20px}
|
||||
a {color: #fff; text-decoration: none}
|
||||
|
||||
.help {font-family: arial, verdana, helvetica, sans-serif; background-color: #1c1c19; color: #fff; padding: 20px}
|
||||
.help .key {display: inline-block; width: 175px; text-align: right; margin-right: 5px; float: left}
|
||||
.help .key .plus {color: #888}
|
||||
.help .shortcut {display: inline-block; width: 175px; color: #888; margin-left: 5px; float: left}
|
||||
.key {display: inline-block; width: 175px; text-align: right; margin-right: 5px; float: left}
|
||||
.key .plus {color: #888}
|
||||
.shortcut {display: inline-block; width: 175px; color: #888; margin-left: 5px; float: left}
|
||||
.info {color: #bbb; cursor: help}
|
||||
71
lib/help.php
@@ -3,8 +3,9 @@
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>ICE Coder - <?php echo $versionNo;?> :: Help & Shortcuts</title>
|
||||
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> help</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<link rel="stylesheet" type="text/css" href="help.css">
|
||||
</head>
|
||||
|
||||
@@ -12,26 +13,58 @@
|
||||
|
||||
<h1 id="title">help</h1>
|
||||
|
||||
<h2>In file manager</h2>
|
||||
<span class="key">Delete</span> <span class="shortcut">Delete file</span><br><br>
|
||||
<a href="javascript:top.ICEcoder.showManual('<?php echo $ICEcoder["versionNo"];?>')" style="position: absolute; top: 26px; right: 20px"><div style="padding: 10px; background: #2187e7; color: #fff; font-size: 18px">ICEcoder manual</div></a>
|
||||
<?php $isMac = strpos($_SERVER['HTTP_USER_AGENT'], "Macintosh")>-1 ? true : false;?>
|
||||
<div style="display: inline-block; width: 365px; margin-right: 20px">
|
||||
<h2>Within document</h2>
|
||||
<!-- This can only be CTRL+space as Cmd+space is a reserved apple shortcut -->
|
||||
<span class="key">Ctrl <span class="plus">+</span> Space</span> <span class="shortcut">Autocomplete / add snippet</span><br>
|
||||
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> ↑</span> <span class="shortcut">Move line up</span><br>
|
||||
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> ↓</span> <span class="shortcut">Move line down</span><br>
|
||||
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> +</span> <span class="shortcut">Duplicate line(s)</span><br>
|
||||
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> -</span> <span class="shortcut">Remove line(s)</span><br>
|
||||
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> i</span> <span class="shortcut">Search for selected <span class="info" title="Popups need to be enabled">[?]</span></span><br>
|
||||
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> j</span> <span class="shortcut">Jump to definition / jump back</span><br>
|
||||
<span class="key">Esc</span> <span class="shortcut">Comment / uncomment</span><br>
|
||||
<span class="key">Tab</span> <span class="shortcut">Insert tab / indent selected</span><br>
|
||||
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Alt <span class="plus">+</span> d</span> <span class="shortcut">Wrap with <div></span><br>
|
||||
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Alt <span class="plus">+</span> s</span> <span class="shortcut">Wrap with <span></span><br>
|
||||
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Alt <span class="plus">+</span> p</span> <span class="shortcut">Wrap / unwrap with <p></span><br>
|
||||
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Alt <span class="plus">+</span> a</span> <span class="shortcut">Wrap / unwrap with <a></span><br>
|
||||
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Alt <span class="plus">+</span> b</span> <span class="shortcut">Wrap / unwrap with <b></span><br>
|
||||
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Alt <span class="plus">+</span> i</span> <span class="shortcut">Wrap / unwrap with <i></span><br>
|
||||
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Alt <span class="plus">+</span> g</span> <span class="shortcut">Wrap / unwrap with <strong></span><br>
|
||||
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Alt <span class="plus">+</span> e</span> <span class="shortcut">Wrap / unwrap with <em></span><br>
|
||||
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Alt <span class="plus">+</span> nums 1 - 6</span> <span class="shortcut">Wrap/unwrap with <h1> - <h6></span><br>
|
||||
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Alt <span class="plus">+</span> Enter</span> <span class="shortcut">End line with <br></span><br><br>
|
||||
<h2>On Tabs</h2>
|
||||
<span class="key">Middle click</span> <span class="shortcut">Close tab</span><br>
|
||||
</div>
|
||||
|
||||
<h2>Within document</h2>
|
||||
<span class="key">CTRL <span class="plus">+</span> I</span> <span class="shortcut">Search selected text</span><br>
|
||||
<span class="key">Esc</span> <span class="shortcut">Comment / uncomment text</span><br>
|
||||
<span class="key">Tab</span> <span class="shortcut">Insert tab / indent selected text</span><br><br>
|
||||
<div style="display: inline-block; width: 365px">
|
||||
<h2>Within file manager</h2>
|
||||
<span class="key">Left click</span> <span class="shortcut">Select file / folder</span><br>
|
||||
<span class="key">Double click / click (mobile)</span> <span class="shortcut">Open file</span><br>
|
||||
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> left click</span> <span class="shortcut">Multiple select</span><br>
|
||||
<span class="key">Shift <span class="plus">+</span> left click</span> <span class="shortcut">Range select</span><br>
|
||||
<span class="key">Right click</span> <span class="shortcut">Options for selected</span><br>
|
||||
<span class="key">Delete</span> <span class="shortcut">Delete selected</span><br><br>
|
||||
|
||||
<h2>Anywhere</h2>
|
||||
<span class="key">CTRL <span class="plus">+</span> F</span> <span class="shortcut">Find</span><br>
|
||||
<span class="key">CTRL <span class="plus">+</span> G</span> <span class="shortcut">Go to line</span><br>
|
||||
<span class="key">CTRL <span class="plus">+</span> S</span> <span class="shortcut">Save</span><br>
|
||||
<span class="key">CTRL <span class="plus">+</span> Shift <span class="plus">+</span> S</span> <span class="shortcut">Save as...</span><br>
|
||||
<span class="key">CTRL <span class="plus">+</span> Enter</span> <span class="shortcut">View webpage</span><br>
|
||||
<span class="key">CTRL <span class="plus">+</span> S <span class="plus">+</span> Enter</span> <span class="shortcut">Save & create sticky tab</span><br>
|
||||
<span class="key">Esc</span> <span class="shortcut">Cancel tasks</span><br><br>
|
||||
|
||||
<h2>Clicking logo</h2>
|
||||
<span class="key">Left click</span> <span class="shortcut">Help</span><br>
|
||||
<span class="key">Right click</span> <span class="shortcut">Settings</span><br>
|
||||
<h2>Anywhere</h2>
|
||||
<span class="key">Middle scrollwheel</span> <span class="shortcut">Next/previous tab</span><br>
|
||||
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> →</span> <span class="shortcut">Next tab</span><br>
|
||||
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> ←</span> <span class="shortcut">Previous tab</span><br>
|
||||
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> +</span> <span class="shortcut">New tab</span><br>
|
||||
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> -</span> <span class="shortcut">Close current tab</span><br>
|
||||
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> o</span> <span class="shortcut">Open file prompt</span><br>
|
||||
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> f</span> <span class="shortcut">Find</span><br>
|
||||
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> g</span> <span class="shortcut">Focus on Go to line input</span><br>
|
||||
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> s</span> <span class="shortcut">Save</span><br>
|
||||
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Shift <span class="plus">+</span> s</span> <span class="shortcut">Save as...</span><br>
|
||||
<span class="key"><?php echo $isMac ? "Cmd" : "Ctrl";?> <span class="plus">+</span> Enter</span> <span class="shortcut">View webpage <span class="info" title="Popups need to be enabled">[?]</span></span><br>
|
||||
<span class="key">Space</span> <span class="shortcut">Refocus on document</span><br>
|
||||
<span class="key">Esc</span> <span class="shortcut">Cancel tasks</span><br><br>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
|
||||
160
lib/ice-coder.css
Normal file
@@ -0,0 +1,160 @@
|
||||
/* First, reset everything to a standard */
|
||||
html, body, div, span, applet, object, iframe,
|
||||
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
||||
a, abbr, acronym, address, big, cite, code,
|
||||
del, dfn, em, font, img, ins, kbd, q, s, samp,
|
||||
small, strike, strong, sub, sup, tt, var,
|
||||
b, u, i, center,
|
||||
dl, dt, dd, ol, ul, li,
|
||||
fieldset, form, label, legend,
|
||||
table, caption, tbody, tfoot, thead, tr, th, td {
|
||||
font-family: arial, verdana, helvetica, sans-serif;
|
||||
border: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
outline: 0;
|
||||
font-size: 12px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
body {overflow: hidden;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
background-color: #222;
|
||||
}
|
||||
|
||||
h1 {font-size: 36px; font-weight: normal; color: #888; margin-bottom: 20px}
|
||||
h2 {font-size: 18px; font-weight: normal; color: #fff}
|
||||
|
||||
.blackMask {position: fixed; display: table; width: 100%; height: 100%; top: 0; left: 0; visibility: hidden; background-color: rgba(0,0,0,0.8); text-align: center; z-index: 100}
|
||||
.blackMask .popupVCenter {#position: absolute; display: table-cell; #top: 50%; vertical-align: middle; text-align: center}
|
||||
.popupVCenter .popup {#position: relative; #top: -50%; text-align: center; color: #fff; font-size: 10px}
|
||||
.whiteGlow {box-shadow: 0 0 8px 2px rgba(255,255,255,0.6)}
|
||||
|
||||
.circleOutside {background-color: rgba(0,0,0,0); border:5px solid rgba(0,183,229,0.9); opacity:.9; border-top:5px solid rgba(0,0,0,0); border-left:5px solid rgba(0,0,0,0); border-radius:50px; box-shadow: 0 0 35px #2187e7;
|
||||
width:50px; height:50px; margin:0 auto; animation:spin .5s infinite linear; -webkit-animation:spin .5s infinite linear;
|
||||
}
|
||||
.circleInside {background-color: rgba(0,0,0,0); border:5px solid rgba(0,183,229,0.9); opacity:.9; border-top:5px solid rgba(0,0,0,0); border-left:5px solid rgba(0,0,0,0); border-radius:50px; box-shadow: 0 0 15px #2187e7;
|
||||
width:30px; height:30px; margin:0 auto; position:relative; top:-50px; animation:spinoff .5s infinite linear; -webkit-animation:spinoff .5s infinite linear;
|
||||
}
|
||||
@keyframes spin {
|
||||
0% {transform:rotate(0deg)}
|
||||
100% {transform:rotate(360deg)}
|
||||
}
|
||||
@keyframes spinoff {
|
||||
0% {transform:rotate(0deg)}
|
||||
100% {transform:rotate(-360deg)}
|
||||
}
|
||||
@-webkit-keyframes spin {
|
||||
0% {-webkit-transform:rotate(0deg)}
|
||||
100% {-webkit-transform:rotate(360deg)}
|
||||
}
|
||||
@-webkit-keyframes spinoff {
|
||||
0% {-webkit-transform:rotate(0deg)}
|
||||
100% {-webkit-transform:rotate(-360deg)}
|
||||
}
|
||||
|
||||
.header {position: absolute; display: inline-block; top: 0; left: 0; width: 100%; height: 40px; background-color: #fff; text-align: right; z-index: 2}
|
||||
.header .tools {position: absolute; display: inline-block; left: 15px; top: 3px}
|
||||
.header .plugins {position: absolute; display: inline-block; left: 55px; top: 3px}
|
||||
.header .plugins img {position: relative; display: inline-block; margin-right: 15px}
|
||||
.header .helpIcon {position: absolute; top: 5px; right: 90px; cursor: pointer}
|
||||
.header .settingsIcon {position: absolute; top: 5px; right: 70px; cursor: pointer}
|
||||
.header .screenModeIcon {position: absolute; top: 5px; right: 46px; cursor: pointer}
|
||||
.header .version {position: relative; display: inline-block; margin-top: 25px; font-size: 10px; color: #bbb}
|
||||
.header .version a {font-size: 10px; color: #bbb; text-decoration: none}
|
||||
.header .logo {position: relative; margin: 5px 10px 0 5px; cursor: pointer}
|
||||
|
||||
.files {position: absolute; display: inline-block; top: 0; left: 0; height: 100%; width: 250px; background-color: #444; background-image: url('../images/files-arrow.png'); background-repeat: no-repeat; background-position: 100% 50%; overflow: hidden; z-index: 1;
|
||||
box-shadow: 0 50px 10px 4px rgba(0,0,0,0.4);
|
||||
}
|
||||
.files .account {display: inline-block; height: 50px; width: 250px; margin-top: 40px; background-color: #888}
|
||||
.files .accountOptions {position: relative; height: 32px; width: 100%; margin-left: 15px; margin-top: 8px}
|
||||
.files .accountOptions div {display: inline-block; background: url('../images/file-manager-icons.png') 0 0 no-repeat; cursor: pointer}
|
||||
.files .accountOptions .save {width: 30px; height: 32px; opacity: 0.3}
|
||||
.files .accountOptions .open {width: 25px; height: 32px; background-position: -32px -3px; margin: 3px 0 0 7px; opacity: 0.3}
|
||||
.files .accountOptions .newFile {width: 15px; height: 16px; background-position: -64px 0; margin: 8px 0 0 10px; opacity: 0.3}
|
||||
.files .accountOptions .newFolder {width: 20px; height: 16px; background-position: -80px 0; margin: 8px 0 0 5px; opacity: 0.3}
|
||||
.files .accountOptions .delete {width: 16px; height: 16px; background-position: -100px 0; margin: 8px 0 0 5px; opacity: 0.3}
|
||||
.files .accountOptions .rename {width: 16px; height: 16px; background-position: -116px 0; margin: 8px 0 0 5px; opacity: 0.3}
|
||||
.files .accountOptions .view {width: 16px; height: 16px; background-position: -132px 0; margin: 8px 0 0 5px; opacity: 0.3}
|
||||
.files .accountOptions .lock {position: relative; margin-left: 208px; margin-top: -27px; width: 12px; height: 16px; background-position: -64px -16px; z-index: 1}
|
||||
.files input:focus, .findReplace input:focus, .findReplace select:focus, .password:focus {outline: none; box-shadow: 0 0 10px 1px rgba(0,198,255,1)}
|
||||
.files .button {position: absolute; border: 0; background: #444; color: #eee; height:20px; margin-top: 16px; margin-left: 5px; font-size: 11px; cursor: pointer}
|
||||
.files .button:hover {background-color: #222; color: #eee}
|
||||
.files .frame {display: inline-block; width: 250px}
|
||||
.files .serverMessage {position: absolute; display: inline-block; width: 450px; bottom: 0; margin-bottom: 30px; background-color: rgba(255,255,255,0.8); font-size: 10px; padding: 7px 12px; opacity: 0;
|
||||
transition: opacity 0.2s;
|
||||
}
|
||||
.files .serverMessage b {font-size: 10px}
|
||||
|
||||
.editor {position: absolute; display: inline-block; top: 0; left: 15px; width: 2400px}
|
||||
.editor .tabsBar {display: inline-block; height: 22px; width: 2400px; margin-top: 40px; padding-left: 53px; background: #ddd}
|
||||
.tabsBar .tab {position: absolute; display: none; height: 15px; padding: 5px 8px 2px 8px; font-size: 10px; border-left: solid 1px #eee; border-right: solid 1px #777; border-radius: 5px 5px 0 0; color: #fff; white-space: nowrap; overflow: hidden; cursor: pointer; z-index: 1;
|
||||
transition: width 0.15s ease-in-out;
|
||||
transition: left 0.15s ease-in-out;
|
||||
}
|
||||
.tabsBar .tabSlide {
|
||||
transition: left 0.15s ease-in-out;
|
||||
}
|
||||
.tabsBar .tabDrag {
|
||||
transition: left 0s ease-in-out;
|
||||
}
|
||||
.tabsBar .tab .closeTab, .tabsBar .closeAllTabs {margin: 1px 0 0 5px; border-radius: 6px; cursor: pointer}
|
||||
.tabsBar .tab .closeTab {position: absolute; right: 7px}
|
||||
.tabsBar .alphaTabs {position: absolute; margin: 6px 0 0 -20px; background: #bbb; border-radius: 6px; cursor: pointer}
|
||||
.tabsBar .alphaTabs:hover {background: #000}
|
||||
.tabsBar .closeAllTabs {position: absolute; margin: 6px 0 0 -36px; background: #bbb}
|
||||
.tabsBar .closeAllTabs:hover {background: #000}
|
||||
.tabsBar .newTab {position: absolute; display: inline-block; height: 15px; padding: 4px 7px 3px 7px; border-left: solid 1px #eee; border-right: solid 1px #777; background: #aaa; border-radius: 4px 4px 0 0; cursor: pointer; z-index: 0;
|
||||
transition: left 0.15s ease-in-out;
|
||||
}
|
||||
.editor .findBar {display: inline-block; height: 28px; width: 2400px; color: #fff; background-color: #161612}
|
||||
.findBar .findReplace {position: absolute; z-index: 1}
|
||||
.findReplace select {position: relative; font-size: 10px; margin: 8px 2px 0 2px; top: -2px;}
|
||||
.findReplace .findText {display: inline-block; height: 21px; font-size: 10px; margin: 8px 2px 0 2px; margin-left: 43px}
|
||||
.findReplace .find {position: relative; width: 120px; height: 16px; border: 0; top: -3px; font-size: 10px; padding-left: 5px; margin-right: 3px}
|
||||
.findReplace .replaceAction {margin: 0 2px 0 0; top: -2px}
|
||||
.findReplace .replaceText {height: 21px; font-size: 10px; margin: 8px 2px 0 2px}
|
||||
.findReplace .replace {position: relative; width: 120px; height: 16px; border: 0; top: -3px; font-size: 10px; padding-left: 5px}
|
||||
.findReplace .targetText {height: 21px; font-size: 10px; margin: 8px 2px 0 2px}
|
||||
.findReplace .submit {position: relative; top: -2px; height: 17px; border: 0; background-color: #444; color: #eee; font-size: 10px; margin-left: 2px; cursor: pointer}
|
||||
.findReplace .submit:hover {background-color: #2187e7; color: #eee}
|
||||
.findReplace .results {position: relative; display: inline-block; width: 200px; height: 20px; font-size: 10px; margin: 8px 0 0 20px}
|
||||
.findBar .codeAssist {position: fixed; display: inline-block; width: 100px; right: 74px; top: 70px; height: 21px; font-size: 10px; cursor: default; z-index: 1}
|
||||
.findBar .codeAssist input {margin-top: -1px}
|
||||
.findBar .goLine {position: fixed; display: inline-block; width: 100px; right: -10px; top: 70px; height: 21px; font-size: 10px; cursor: default; z-index: 1}
|
||||
.goLine .goToLine {width: 25px; height: 16px; border: 0; font-size: 10px; margin: -3px 0 0 3px}
|
||||
.goLine .goToLine:focus {outline: none; box-shadow: 0 0 10px 1px rgba(0,198,255,1)}
|
||||
.editor .code {position: relative; display: inline-block; top: 28px; width: 600px; height: 600px; visibility: hidden}
|
||||
|
||||
.footer {position: fixed; display: inline-block; width: 100%; height: 30px; bottom: 0; background-color: rgba(0,0,0,0.7); left: 0; z-index: 2}
|
||||
.footer .system {position: absolute; display: inline-block; padding: 10px 0 0 15px}
|
||||
.footer .system div {position: relative; display: inline-block; margin-right: 10px; width: 11px; height: 11px; cursor: pointer}
|
||||
.footer .system .preview {background: url('../images/file-manager-icons.png') no-repeat -116px -16px}
|
||||
.footer .system .terminal {background: url('../images/file-manager-icons.png') no-repeat -132px -16px}
|
||||
.footer .nesting {position: absolute; display: inline-block; padding: 5px; margin-top: 10px; left: 260px; border-radius: 5px; background-color: #0b0; cursor: default}
|
||||
.footer .nestDisplay {position: absolute; display: inline-block; padding: 5px 0 0 8px; margin-top: 0px; left: 267px; font-size: 12px; color: #fff; text-align: right}
|
||||
.footer .charDisplay, .footer .byteDisplay {position: absolute; display: inline-block; padding: 5px 0 0 8px; margin-top: 3px; margin-right: 10px; right: 0; font-weight: bold; font-size: 12px; color: #fff; text-align: right; text-align: right; cursor: pointer}
|
||||
|
||||
.textbox {box-shadow: inset 1px 1px 2px 0 rgba(0,0,0,0.4)}
|
||||
|
||||
.fileMenu {position: absolute; display: none; left: 0; top: 0; background-color: #333; z-index: 10;
|
||||
transition: opacity 0.15s;
|
||||
}
|
||||
.fileMenu a {display: block; padding: 2px 5px; background-color: #333; color: #eee; text-decoration: none}
|
||||
.fileMenu a:hover {background-color: #666}
|
||||
.fileMenu hr {border: 0; height: 1px; padding: 0; margin: 0; background: #444}
|
||||
|
||||
.screenContainer {position: absolute; display: table; width: 100%; height: 100%; top: 0; left: 0; text-align: center}
|
||||
.screenContainer .screenVCenter {#position: absolute; display: table-cell; #top: 50%; vertical-align: middle; text-align: center}
|
||||
.screenVCenter .screenCenter {#position: relative; #top: -50%; text-align: center; display: inline}
|
||||
.screenCenter .version {position: relative; display: block; margin: 5px 0 15px 0; font-size: 10px; color: #bbb}
|
||||
.screenCenter .text {position: relative; display: block; margin-top: 15px; font-size: 10px; color: #888}
|
||||
.screenCenter .text input {margin-top: 1px}
|
||||
.screenCenter .text a {position: relative; display: block; margin-top: 15px; font-size: 10px; color: #888; text-decoration: none}
|
||||
.screenCenter .password {border: 0; background-color: #333; color: #fff; height: 20px}
|
||||
.screenCenter .button {border: 0; background: #444; color: #eee; height: 22px; cursor: pointer}
|
||||
.screenCenter .button:hover {background: #2187e7; color: #eee}
|
||||
2417
lib/ice-coder.js
Normal file
108
lib/ice-coder.min.js
vendored
Normal file
@@ -0,0 +1,108 @@
|
||||
var get=function(a){return top.document.getElementById(a)},ICEcoder={filesW:250,minFilesW:14,maxFilesW:250,selectedTab:0,changedContent:[],canSwitchTabs:!0,openFiles:[],openFileMDTs:[],cMInstances:[],nextcMInstance:1,selectedFiles:[],findMode:!1,lockedNav:!0,htmlTagArray:[],mouseDown:!1,draggingFilesW:!1,draggingTab:!1,tabLeftPos:[],tabBGcurrent:"#141414",tabBGselected:"#49d",tabBGopen:"#aaa",tabBGnormal:"transparent",tabFGcurrent:"#fff",tabFGselected:"#fff",tabFGopenFile:"#000",tabFGnormalFile:"#eee",
|
||||
tabFGnormalTab:"#000",serverQueueItems:[],previewWindow:!1,pluginIntervalRefs:[],overPopup:!1,cmdKey:!1,fmReady:!1,ready:!1,initAliases:function(){for(var a="header files account fmLock filesFrame editor tabsBar findBar content footer system nestValid nestDisplay charDisplay byteDisplay".split(" "),b=0;b<a.length;b++)ICEcoder[a[b]]=top.get(a[b])},init:function(){var a,b;ICEcoder.setLayout();top.ICEcoder.showHide("hide",top.get("loadingMask"));top.ICEcoder.autoOpenInt=setInterval(function(){top.ICEcoder.fmReady&&
|
||||
(top.ICEcoder.openLastFiles&&top.ICEcoder.autoOpenFiles(),clearInterval(top.ICEcoder.autoOpenInt))},4);setInterval(ICEcoder.updateNestingIndicator,30);a=top.get("screenMode");b=["images/restored-screen.gif","images/full-screen.gif"];document.addEventListener("fullscreenchange",function(){a.src=document.fullscreen?b[0]:b[1]},!1);document.addEventListener("mozfullscreenchange",function(){a.src=document.mozFullScreen?b[0]:b[1]},!1);document.addEventListener("webkitfullscreenchange",function(){a.src=
|
||||
document.webkitIsFullScreen?b[0]:b[1]},!1);top.ICEcoder.ready=!0},setLayout:function(a){var b,c;b=window.innerWidth;c=window.innerHeight;this.header.style.width=this.tabsBar.style.width=this.findBar.style.width=b+"px";this.files.style.width=this.editor.style.left=this.filesW+"px";this.account.style.height=this.accountH+"px";this.fmLock.style.marginLeft=this.filesW-42+"px";this.filesFrame.style.height=c-40-50-30+"px";this.nestValid.style.left=this.filesW+10+"px";this.nestDisplay.style.left=this.filesW+
|
||||
17+"px";top.ICEcoder.setTabWidths();a||(this.editor.style.width=ICEcoder.content.style.width=b-this.filesW+"px",ICEcoder.content.style.height=c-40-30-21-28+"px",setTimeout(function(){for(var a=0;a<top.ICEcoder.openFiles.length;a++)top.ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[a]].setSize("100%",top.ICEcoder.content.style.height)},4))},changeFilesW:function(a){ICEcoder.lockedNav&&ICEcoder.filesW!=ICEcoder.minFilesW||("undefined"!=typeof ICEcoder.changeFilesInt&&clearInterval(ICEcoder.changeFilesInt),
|
||||
ICEcoder.changeFilesInt=setInterval(function(){ICEcoder.changeFilesWStep(a)},10))},changeFilesWStep:function(a){"expand"==a?ICEcoder.filesW<ICEcoder.maxFilesW-1?ICEcoder.filesW+=Math.ceil((ICEcoder.maxFilesW-ICEcoder.filesW)/2):ICEcoder.filesW=ICEcoder.maxFilesW:ICEcoder.filesW>ICEcoder.minFilesW+1?ICEcoder.filesW-=Math.ceil((ICEcoder.filesW-ICEcoder.minFilesW)/2):ICEcoder.filesW=ICEcoder.minFilesW;("expand"==a&&ICEcoder.filesW==ICEcoder.maxFilesW||"contract"==a&&ICEcoder.filesW==ICEcoder.minFilesW)&&
|
||||
clearInterval(ICEcoder.changeFilesInt);ICEcoder.setLayout()},canResizeFilesW:function(){top.ICEcoder.ready&&"w-resize"==top.document.body.style.cursor?top.ICEcoder.mouseDown&&(top.ICEcoder.filesW=top.ICEcoder.maxFilesW=250<=top.ICEcoder.mouseX&&400>=top.ICEcoder.mouseX?top.ICEcoder.mouseX:250>top.ICEcoder.mouseX?250:400,top.ICEcoder.files.style.width=top.ICEcoder.account.style.width=top.ICEcoder.filesFrame.style.width=top.ICEcoder.filesW+"px",top.ICEcoder.setLayout(),top.ICEcoder.draggingFilesW=!0):
|
||||
top.ICEcoder.draggingFilesW=!1},lockUnlockNav:function(){var a;a=top.get("fmLock");ICEcoder.lockedNav=!ICEcoder.lockedNav;a.style.backgroundPosition=ICEcoder.lockedNav?"-64px -16px":"-80px -16px"},contentCleanUp:function(){var a,b;a=ICEcoder.getcMInstance();b=a.getValue();b=b.replace(/<ICEcoder:\/:textarea>/g,"</textarea>");a.setValue(b);a.clearHistory()},moveLine:function(a){var b,c,d,e;b=top.ICEcoder.getcMInstance();c=b.getCursor().line;"up"==a&&0<c&&(d=c-1);"down"==a&&c<b.lineCount()-1&&(d=c+1);
|
||||
isNaN(d)||(e=b.getLine(d),b.operation(function(){b.setLine(d,b.getLine(c));b.setLine(c,e)}),ICEcoder.highlightLine(d))},highlightLine:function(a){var b;b=top.ICEcoder.getcMInstance();b.setSelection({line:a,ch:0},{line:a,ch:b.lineInfo(a).text.length})},focus:function(){var a;/iPhone|iPad|iPod/i.test(navigator.userAgent)||(a=top.ICEcoder.getcMInstance(),a.focus())},goToLine:function(a){ICEcoder.getcMInstance().setCursor(a?a-1:top.get("goToLineNo").value-1);top.ICEcoder.focus();return!1},switchMode:function(a){var b,
|
||||
c;b=ICEcoder.getcMInstance();c=ICEcoder.openFiles[ICEcoder.selectedTab-1];a?b.setOption("mode",a):c&&(0<c.indexOf(".js")?b.setOption("mode","javascript"):0<c.indexOf(".coffee")?b.setOption("mode","coffeescript"):0<c.indexOf(".rb")?b.setOption("mode","ruby"):0<c.indexOf(".py")?b.setOption("mode","python"):0<c.indexOf(".css")?b.setOption("mode","css"):0<c.indexOf(".less")?b.setOption("mode","less"):0<c.indexOf(".md")?b.setOption("mode","markdown"):b.setOption("mode","application/x-httpd-php"))},lineCommentToggle:function(){var a,
|
||||
b,c,d,e,f;a=ICEcoder.getcMInstance();b=a.getCursor().ch;c=a.getCursor().line;d=a.getLine(c);e=d.length;f=2;if(-1<"JavaScript CoffeeScript PHP Python Ruby CSS".split(" ").indexOf(ICEcoder.caretLocType))if(a.somethingSelected())if("Ruby"==ICEcoder.caretLocType||"Python"==ICEcoder.caretLocType)for(e=a.getCursor(!0).line,d=a.getCursor().line;e<=d;e++)a.setLine(e,"#"!=a.getLine(e).slice(0,1)?"#"+a.getLine(e):a.getLine(e).slice(1,a.getLine(e).length));else a.replaceSelection("/*"!=a.getSelection().slice(0,
|
||||
2)?"/*"+a.getSelection()+"*/":a.getSelection().slice(2,a.getSelection().length-2));else-1<["CoffeeScript","CSS"].indexOf(ICEcoder.caretLocType)?(a.setLine(c,"/*"!=d.slice(0,2)?"/*"+d+"*/":d.slice(2,e).slice(0,e-4)),"/*"==d.slice(0,2)&&(f=-f)):"Ruby"==ICEcoder.caretLocType?(a.setLine(c,"#"!=d.slice(0,1)?"#"+d:d.slice(1,e)),"#"==d.slice(0,1)&&(f=-f)):(a.setLine(c,"//"!=d.slice(0,2)?"//"+d:d.slice(2,e)),"//"==d.slice(0,2)&&(f=-f));else a.somethingSelected()?a.replaceSelection("\x3c!--"!=a.getSelection().slice(0,
|
||||
4)?"\x3c!--"+a.getSelection()+"//--\x3e":a.getSelection().slice(4,a.getSelection().length-5)):(a.setLine(c,"\x3c!--"!=d.slice(0,4)?"\x3c!--"+d+"//--\x3e":d.slice(4,e).slice(0,e-9)),f="\x3c!--"==d.slice(0,4)?-4:4);a.somethingSelected()||a.setCursor(c,b+f)},highlightBlock:function(a,b){var c,d,e,f;c=top.ICEcoder.getcMInstance();if(b)top.ICEcoder.dontUpdateNest?c.setCursor(top.ICEcoder.cursorOrigLine,top.ICEcoder.cursorOrigCh):top.ICEcoder.getNestLocation("updateNestDisplay"),top.ICEcoder.dontUpdateNest=
|
||||
!1;else{top.ICEcoder.cursorOrigCh=c.getCursor().ch;top.ICEcoder.cursorOrigLine=c.getCursor().line;top.ICEcoder.dontUpdateNest=!0;d={};d.ch=c.getCursor().ch;d.line=c.getCursor().line;for(var g=top.ICEcoder.htmlTagArray.length-1;g>=a;g--)e=c.getSearchCursor("<"+top.ICEcoder.htmlTagArray[g],d),e.findPrevious(),d.ch=e.from().ch,d.line=e.from().line,g==a&&(f=c.getSearchCursor(">",d),f.findNext(),c.setCursor(f.from().line,f.from().ch+1),top.ICEcoder.getNestLocation(),ICEcoder.htmlTagArray.length-1!=a&&
|
||||
g++);e.from()&&(d={},top.ICEcoder.startPosLine=d.line=e.from().line,top.ICEcoder.startPosCh=d.ch=e.from().ch,e={},e.line=top.ICEcoder.content.contentWindow.CodeMirror.tagRangeFinder(c,d)||d.line,e.line=e.line.to?e.line.to.line:e.line,e.ch=c.getLine(e.line).indexOf("</"+top.ICEcoder.htmlTagArray[a]+">")+top.ICEcoder.htmlTagArray[a].length+3,top.ICEcoder.dontSelect?top.ICEcoder.dontSelect=!1:c.setSelection(d,e),c.scrollIntoView(d))}},setPosition:function(a,b,c){var d;d=ICEcoder.getcMInstance();c=d.getLine(b).indexOf(">",
|
||||
d.getLine(b).indexOf("<"+c))+1;d.setCursor(b,c);top.ICEcoder.focus();for(d=b=0;d<=a;d++)b=ICEcoder.nestDisplay.innerHTML.indexOf(">",b+1);ICEcoder.nestDisplay.innerHTML=ICEcoder.nestDisplay.innerHTML.substr(0,b).replace(/<(?:.|\n)*?>/gm,"");top.ICEcoder.dontUpdateNest=!1;top.ICEcoder.dontSelect=!0},tagWrapper:function(a){var b,c,d,e;b=ICEcoder.getcMInstance();c=a;"div"==a?(d=b.getCursor("start").line,e=b.getCursor().line,b.operation(function(){b.replaceSelection("<div>\n"+b.getSelection()+"\n</div>");
|
||||
for(var a=d+1;a<=e+1;a++)b.indentLine(a);b.indentLine(e+2,"prev");b.indentLine(e+2,"subtract")})):-1<"p a b i strong em h1 h2 h3 h4 h5 h6".split(" ").indexOf(a)&&b.getSelection().substr(0,a.length+1)=="<"+c&&b.getSelection().substr(-(a.length+3))=="</"+a+">"?b.replaceSelection(b.getSelection().substr(b.getSelection().indexOf(">")+1,b.getSelection().length-b.getSelection().indexOf(">")-1-a.length-3)):("a"==a&&(c='a href=""'),b.replaceSelection("<"+c+">"+b.getSelection()+"</"+a+">"),"a"==a&&b.setCursor({line:b.getCursor("start").line,
|
||||
ch:b.getCursor("start").ch+9}))},addLineBreakAtEnd:function(a){var b;b=ICEcoder.getcMInstance();a||(a=b.getCursor().line);b.setLine(a,b.getLine(a)+"<br>")},duplicateLines:function(a){var b,c,d;b=ICEcoder.getcMInstance();!a&&b.somethingSelected()?(c=b.getCursor("start"),d=b.getCursor("end"),a=c.line!=d.line&&d.ch==b.getLine(d.line).length?"\n":"",b.replaceSelection(b.getSelection()+a+b.getSelection(),"start"),b.setSelection(c,d)):(a||(a=b.getCursor().line),c=b.getCursor().ch,b.setLine(a,b.getLine(a)+
|
||||
"\n"+b.getLine(a)),b.setCursor(a+1,c))},removeLines:function(a){var b,c;b=ICEcoder.getcMInstance();!a&&b.somethingSelected()?b.replaceSelection(""):(a||(a=b.getCursor().line),c=b.getCursor().ch,b.removeLine(a),b.setCursor(a-1,c))},jumpToDefinition:function(){var a,b;a=ICEcoder.getcMInstance();b=a.getTokenAt(a.getCursor()).string;if(a.somethingSelected()&&top.ICEcoder.origCurorPos)a.setCursor(top.ICEcoder.origCurorPos);else for(top.ICEcoder.origCurorPos=a.getCursor(),a=["var "+b,"function "+b,b+"=function",
|
||||
b+"= function",b+" =function",b+" = function",b+"=new function",b+"= new function",b+" =new function",b+" = new function","window['"+b+"']",'window["'+b+'"]',"this['"+b+"']",'this["'+b+'"]',b+":",b+" :","def "+b,"class "+b],b=0;b<a.length&&!top.ICEcoder.findReplace(a[b],!1,!1);b++);},openCloseDir:function(a,b){var c,d;a.onclick=function(a){a.ctrlKey||top.ICEcoder.cmdKey||top.ICEcoder.openCloseDir(this,!1)};c=a.parentNode;c.nextSibling&&(c=c.nextSibling);c&&"UL"==c.tagName&&((d="none"==c.style.display)?
|
||||
b=!0:c.style.display="none",a.parentNode.className=a.className=d?"pft-directory dirOpen":"pft-directory");b&&(top.ICEcoder.filesFrame.contentWindow.frames.fileControl.location.href="lib/get-branch.php?location="+a.childNodes[1].id);return!1},overFileFolder:function(a,b){ICEcoder.thisFileFolderType=a;ICEcoder.thisFileFolderLink=b},selectFileFolder:function(a){var b,c,d,e,f;if(""==top.ICEcoder.thisFileFolderLink)a.ctrlKey||top.ICEcoder.cmdKey||top.ICEcoder.deselectAllFiles();else if(top.ICEcoder.thisFileFolderLink)if(c=
|
||||
top.ICEcoder.thisFileFolderLink.replace(/\//g,"|"),b=ICEcoder.filesFrame.contentWindow.document.getElementById(c),a.ctrlKey||top.ICEcoder.cmdKey)-1<top.ICEcoder.selectedFiles.indexOf(c)?(ICEcoder.selectDeselectFile("deselect",b),top.ICEcoder.selectedFiles.splice(top.ICEcoder.selectedFiles.indexOf(c),1)):(ICEcoder.selectDeselectFile("select",b),top.ICEcoder.selectedFiles.push(c));else if(a.shiftKey){a=!1;d=b.parentNode.parentNode.parentNode;e=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-
|
||||
1];var g=function(a,b,c,d){return("00000000000000000000"+a).substr(-20)};f=c.replace(/\d+/g,g)<e.replace(/\d+/g,g)?c:e;e=c.replace(/\d+/g,g)>e.replace(/\d+/g,g)?c:e;if(0<top.ICEcoder.selectedFiles.length&&f.substr(0,f.lastIndexOf("|"))==e.substr(0,e.lastIndexOf("|")))for(c=0;1E6>c&&("LI"!=d.childNodes[c].nodeName&&c++,b=d.childNodes[c].childNodes[0].childNodes[1],b.id==f&&(a=!0),!0==a&&-1==top.ICEcoder.selectedFiles.indexOf(b.id)&&(ICEcoder.selectDeselectFile("select",b),top.ICEcoder.selectedFiles.push(b.id)),
|
||||
b.id!=e);c+=2);else ICEcoder.selectDeselectFile("select",b),top.ICEcoder.selectedFiles.push(c)}else top.ICEcoder.deselectAllFiles(),ICEcoder.selectDeselectFile("select",b),top.ICEcoder.selectedFiles.push(c);document.findAndReplace.target[2].innerHTML=top.ICEcoder.selectedFiles[0]?"selected files":"all files";document.findAndReplace.target[3].innerHTML=top.ICEcoder.selectedFiles[0]?"selected filenames":"all filenames";top.ICEcoder.fMIconVis("fMOpen",1==top.ICEcoder.selectedFiles.length?1:0.3);top.ICEcoder.fMIconVis("fMNewFile",
|
||||
1==top.ICEcoder.selectedFiles.length&&"folder"==top.ICEcoder.thisFileFolderType?1:0.3);top.ICEcoder.fMIconVis("fMNewFolder",1==top.ICEcoder.selectedFiles.length&&"folder"==top.ICEcoder.thisFileFolderType?1:0.3);top.ICEcoder.fMIconVis("fMDelete",0<top.ICEcoder.selectedFiles.length?1:0.3);top.ICEcoder.fMIconVis("fMRename",1==top.ICEcoder.selectedFiles.length?1:0.3);top.ICEcoder.hideFileMenu()},deselectAllFiles:function(){for(var a,b=0;b<top.ICEcoder.selectedFiles.length;b++)a=top.ICEcoder.filesFrame.contentWindow.document.getElementById(top.ICEcoder.selectedFiles[b]),
|
||||
ICEcoder.selectDeselectFile("deselect",a);top.ICEcoder.selectedFiles.length=0},selectDeselectFile:function(a,b){var c;b&&(c=-1<top.ICEcoder.openFiles.indexOf(b.id.replace(/\|/g,"/"))?!0:!1,top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]==b.id.replace(/\|/g,"/")?b.style.backgroundColor="select"==a?top.ICEcoder.tabBGselected:top.ICEcoder.tabBGcurrent:b.style.backgroundColor="select"==a?top.ICEcoder.tabBGselected:b.style.backgroundColor=c?top.ICEcoder.tabBGopen:top.ICEcoder.tabBGnormal,b.style.color=
|
||||
"select"==a?top.ICEcoder.tabFGselected:top.ICEcoder.tabFGnormalFile)},newFile:function(){top.ICEcoder.newTab();top.ICEcoder.saveFile()},newFolder:function(){var a,b;a=top.ICEcoder.rightClickedFile.replace(/\|/g,"/");if(b=top.ICEcoder.getInput("Enter new folder name at "+a,""))b=(a+"/"+b).replace(/\/\//,"/"),top.ICEcoder.serverQueue("add","lib/file-control.php?action=newFolder&file="+b.replace(/\//g,"|")),top.ICEcoder.serverMessage("<b>Creating Folder</b><br>"+b)},openFile:function(a){var b;a&&(top.ICEcoder.thisFileFolderLink=
|
||||
a,top.ICEcoder.thisFileFolderType="file");"/[NEW]"!=top.ICEcoder.thisFileFolderLink&&!1!==top.ICEcoder.isOpen(top.ICEcoder.thisFileFolderLink)?top.ICEcoder.switchTab(top.ICEcoder.isOpen(top.ICEcoder.thisFileFolderLink)+1):""!=top.ICEcoder.thisFileFolderLink&&"file"==top.ICEcoder.thisFileFolderType&&(a=top.ICEcoder.thisFileFolderLink.replace(/\|/g,"/"),b=!0,100<=top.ICEcoder.openFiles.length&&(top.ICEcoder.message("Sorry, you can only have 100 files open at a time!"),b=!1),b&&(top.ICEcoder.shortURL=
|
||||
a,"/[NEW]"!=a?(top.ICEcoder.thisFileFolderLink=top.ICEcoder.thisFileFolderLink.replace(/\//g,"|"),top.ICEcoder.serverQueue("add","lib/file-control.php?action=load&file="+top.ICEcoder.thisFileFolderLink),top.ICEcoder.serverMessage("<b>Opening File</b><br>"+top.ICEcoder.shortURL)):top.ICEcoder.createNewTab(),top.ICEcoder.fMIconVis("fMView",1)))},openFilesFromList:function(a){for(var b=0;b<a.length;b++)top.ICEcoder.rightClickedFile=top.ICEcoder.thisFileFolderLink=a[b].replace("|","/"),top.ICEcoder.thisFileFolderType=
|
||||
"file",top.ICEcoder.openFile()},openPrompt:function(){var a;if(a=top.ICEcoder.getInput("Enter relative file path (prefixed with /) or remote URL",""))-1<a.indexOf("://")?top.ICEcoder.getRemoteFile(a):top.ICEcoder.openFile(a)},getRemoteFile:function(a){top.ICEcoder.serverQueue("add","lib/file-control.php?action=getRemoteFile&file="+a);top.ICEcoder.serverMessage("<b>Getting</b><br>"+a)},saveFile:function(a){var b,c;a=a?"saveAs":"save";b=ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,
|
||||
"").replace(/\//g,"|");"|[NEW]"==b&&0<top.ICEcoder.selectedFiles.length&&(c=top.ICEcoder.selectedFiles[0],b=-1==c.lastIndexOf(".")||c.lastIndexOf(".")<c.lastIndexOf("|")?c+b:"|[NEW]");b=b.replace("||","|");top.ICEcoder.serverQueue("add","lib/file-control.php?action=save&file="+b+"&fileMDT="+ICEcoder.openFileMDTs[ICEcoder.selectedTab-1]+"&saveType="+a);top.ICEcoder.serverMessage("<b>Saving</b><br>"+ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,""))},renameFile:function(a,b){var c,
|
||||
d;a?c=a.replace(/\|/g,"/"):(c=top.ICEcoder.rightClickedFile.replace(/\|/g,"/"),a=top.ICEcoder.rightClickedFile.replace(/\|/g,"/"));b||(b=top.ICEcoder.getInput("Please enter the new name for",c));b&&(d=top.ICEcoder.openFiles.indexOf(c.replace(/\|/g,"/")),-1<d&&(top.ICEcoder.openFiles[d]=b,closeTabLink='<a nohref onClick="top.ICEcoder.closeTab(parseInt(this.parentNode.id.slice(3),10))"><img src="images/nav-close.gif" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'; top.ICEcoder.overCloseLink=true" onMouseOut="this.style.backgroundColor=prevBG; top.ICEcoder.overCloseLink=false"></a>',
|
||||
c=top.ICEcoder.openFiles[d],top.get("tab"+(d+1)).innerHTML=closeTabLink+" "+c.slice(c.lastIndexOf("/")).replace(/\//,""),top.get("tab"+(d+1)).title=b),top.ICEcoder.serverQueue("add","lib/file-control.php?action=rename&file="+b+"&oldFileName="+a.replace(/\|/g,"/")),top.ICEcoder.serverMessage("<b>Renaming to</b><br>"+b),top.ICEcoder.setPreviousFiles())},deleteFiles:function(){var a;a=top.ICEcoder.selectedFiles.toString().replace(/\|/g,"/").replace(/,/g,"\n");0<top.ICEcoder.selectedFiles.length&&top.ICEcoder.ask("Delete:\n\n"+
|
||||
a+"?")&&(top.ICEcoder.serverQueue("add","lib/file-control.php?action=delete&file="+top.ICEcoder.selectedFiles.join(";")),top.ICEcoder.serverMessage("<b>Deleting File</b><br>"+a))},copyFiles:function(a,b,c){top.ICEcoder.copiedFiles=[];for(var d=0;d<a.length;d++)top.ICEcoder.copiedFiles[d]=a[d];b||(top.get("fmMenuPasteOption").style.display="block");c||top.ICEcoder.hideFileMenu()},pasteFiles:function(a){if(top.ICEcoder.copiedFiles)for(var b=0;b<top.ICEcoder.copiedFiles.length;b++)"|"!=top.ICEcoder.copiedFiles[b]?
|
||||
(top.ICEcoder.serverQueue("add","lib/file-control.php?action=paste&file="+top.ICEcoder.copiedFiles[b]+"&location="+a),top.ICEcoder.serverMessage("<b>Pasting File</b><br>"+top.ICEcoder.copiedFiles[b].toString().replace(/\|/g,"/").replace(/,/g,"\n"))):top.ICEcoder.message("Sorry, cannot paste a whole root");else top.ICEcoder.message("Nothing to paste, copy a file/folder first!")},duplicateFiles:function(a){var b;top.ICEcoder.copiedFiles&&(b=top.ICEcoder.copiedFiles);top.ICEcoder.copyFiles(a,"dontShowPaste",
|
||||
"dontHide");a=a[0].substr(0,a[0].lastIndexOf("|"));top.ICEcoder.pasteFiles(a);"undefined"!=typeof b&&(top.ICEcoder.copiedFiles=b)},uploadFilesSelect:function(a){top.get("uploadDir").value=a;top.get("fileInput").click()},uploadFilesSubmit:function(a){""!=top.get("fileInput").value&&(top.ICEcoder.showHide("show",top.get("loadingMask")),top.get("uploadFilesForm").submit(),event.preventDefault())},showMenu:function(a){var b,c;0!=top.ICEcoder.selectedFiles.length&&-1!=top.ICEcoder.selectedFiles.indexOf(top.ICEcoder.rightClickedFile.replace(/\//g,
|
||||
"|"))||top.ICEcoder.selectFileFolder(a);a=129;c=window.innerHeight;"undefined"!=typeof top.ICEcoder.thisFileFolderLink&&""!=top.ICEcoder.thisFileFolderLink&&(b=-1<top.ICEcoder.selectedFiles[0].indexOf(".")?"file":"folder",top.get("folderMenuItems").style.display="folder"==b&&1==top.ICEcoder.selectedFiles.length?"block":"none","folder"==b&&1==top.ICEcoder.selectedFiles.length&&(a+=67,"block"==top.get("fmMenuPasteOption").style.display&&(a+=19)),top.get("singleFileMenuItems").style.display=1<top.ICEcoder.selectedFiles.length?
|
||||
"none":"block",1==top.ICEcoder.selectedFiles.length&&(a+=43),top.get("fileMenu").style.display="inline-block",setTimeout(function(){top.get("fileMenu").style.opacity="1"},4),top.get("fileMenu").style.left=top.ICEcoder.mouseX+20+"px",b=top.ICEcoder.mouseY-top.ICEcoder.filesFrame.contentWindow.document.body.scrollTop-10,b+a>c&&(b-=b+a-c),top.get("fileMenu").style.top=b+"px");return!1},showFileMenu:function(){top.get("fileMenu").style.display="inline-block";setTimeout(function(){top.get("fileMenu").style.opacity=
|
||||
"1"},4)},hideFileMenu:function(){top.get("fileMenu").style.display="none";top.get("fileMenu").style.opacity="0"},updateFileManagerList:function(a,b,c,d,e,f){var g,l,h,k,n,p,m,q;if("add"==a&&!top.get("filesFrame").contentWindow.document.getElementById(b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c)){g=-1<c.indexOf(".")?"file":"folder";l="file"==g?"pft-file ext-"+c.substr(c.indexOf(".")+1):"pft-directory";d="file"==g?664:705;b||(b="/");b=b.replace(top.iceRoot,"");h=top.get("filesFrame").contentWindow.document.getElementById(b.replace(/\//g,
|
||||
"|"));k=h.parentNode.parentNode.nextSibling;n=document.createTextNode("\n");p='<a nohref title="'+b.replace(/\/$/,"")+"/"+c+'" onMouseOver="top.ICEcoder.overFileFolder(\''+g+"','"+b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c+"')\" onMouseOut=\"top.ICEcoder.overFileFolder('"+g+'\',\'\')" style="position: relative; left:-22px"> <span id="'+b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c+'">'+c+'</span> <span style="color: #888; font-size: 8px" id="'+b.replace(/\/$/,
|
||||
"").replace(/\//g,"|")+"|"+c+'_perms">'+d+"</span></a>";if(3>k.childNodes.length)m=document.createElement("ul"),k=h.parentNode.parentNode,k.parentNode.insertBefore(m,k.nextSibling),m=document.createElement("li"),m.className=l,m.innerHTML=p,k.nextSibling.appendChild(m),k.nextSibling.appendChild(n);else for(h=0;h<k.childNodes.length;h++)if(k.childNodes[h].className&&(m=0<k.childNodes[h].className.indexOf("directory")?"folder":"file",q=k.childNodes[h].getElementsByTagName("span")[0].innerHTML,m==g&&
|
||||
q>c||"folder"==g&&"file"==m||h==k.childNodes.length-1)){m=document.createElement("li");m.className=l;m.innerHTML=p;h==k.childNodes.length-1?(k.appendChild(m),k.appendChild(n)):(k.insertBefore(m,k.childNodes[h]),k.insertBefore(n,k.childNodes[h+1]));break}"file"!=g||f||(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]=b+c)}"rename"==a&&(e=e.replace(/\//g,"|"),h=top.get("filesFrame").contentWindow.document.getElementById(e),h.innerHTML=c,h.id=b.replace(/\//g,"|")+"|"+c,h.parentNode.title=h.id.replace(/\|/g,
|
||||
"/"),targetElemPerms=top.get("filesFrame").contentWindow.document.getElementById(e+"_perms"),targetElemPerms.id=b.replace(/\//g,"|")+"|"+c+"_perms");"chmod"==a&&(e=top.ICEcoder.rightClickedFile.replace(/\|/g,"/"),h=top.get("filesFrame").contentWindow.document.getElementById(e.replace(/\//g,"|")+"_perms"),h.innerHTML=d);"delete"==a&&(h=top.get("filesFrame").contentWindow.document.getElementById(b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c).parentNode.parentNode,top.ICEcoder.openCloseDir(h.childNodes[0],
|
||||
!1),h.parentNode.removeChild(h))},fMIcon:function(a){"save"==a&&0<ICEcoder.openFiles.length&&top.ICEcoder.saveFile();1==ICEcoder.selectedFiles.length&&(top.ICEcoder.rightClickedFile=top.ICEcoder.thisFileFolderLink=top.ICEcoder.selectedFiles[0].replace("|","/"),"open"==a&&-1<ICEcoder.selectedFiles[0].indexOf(".")?(top.ICEcoder.thisFileFolderType="file",top.ICEcoder.openFile()):"newFile"==a?top.ICEcoder.newFile():"newFolder"==a?top.ICEcoder.newFolder():"rename"==a&&top.ICEcoder.renameFile(top.ICEcoder.rightClickedFile));
|
||||
"delete"==a&&0<ICEcoder.selectedFiles.length&&top.ICEcoder.deleteFiles();"view"==a&&0<ICEcoder.openFiles.length&&window.open(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1])},refreshFileManager:function(){top.ICEcoder.showHide("show",top.get("loadingMask"));top.ICEcoder.filesFrame.src="files.php";top.ICEcoder.filesFrame.style.opacity="0";top.ICEcoder.filesFrame.onload=function(){top.ICEcoder.filesFrame.style.opacity="1";top.ICEcoder.showHide("hide",top.get("loadingMask"))}},findReplaceOptions:function(){top.get("rText").style.display=
|
||||
top.get("replace").style.display=top.get("rTarget").style.display="and"==document.findAndReplace.connector.value?"inline-block":"none"},findReplace:function(a,b,c){var d,e,f;a=a.toLowerCase();d=top.get("replace").value;e=top.get("results");if((f=ICEcoder.getcMInstance())&&0<a.length&&"this document"==document.findAndReplace.target.value){f.getValue().toLowerCase();"and"==document.findAndReplace.connector.value&&c&&("replace"==document.findAndReplace.replaceAction.value&&f.getSelection().toLowerCase()==
|
||||
a?f.replaceSelection(d):"replace all"==document.findAndReplace.replaceAction.value&&(c=RegExp(a,"gi"),f.setValue(f.getValue().replace(c,d))));c=f.getValue().toLowerCase();if(!top.ICEcoder.findMode||a!=top.ICEcoder.lastsearch){ICEcoder.results=[];for(d=0;d<c.length;d++)c.substr(d,a.length)==a&&-1==ICEcoder.results.indexOf(d)&&ICEcoder.results.push(d);ICEcoder.lastsearch=a}if(0<ICEcoder.results.length){if(b)e.innerHTML=ICEcoder.results.length+" results";else{b=-1;for(d=0;d<f.getCursor().line;d++)b+=
|
||||
f.getLine(d).length+1;-1==b&&(b=0);b=b+f.getCursor().ch+1;for(d=ICEcoder.findResult=0;d<ICEcoder.results.length;d++)ICEcoder.results[d]<b&&ICEcoder.findResult++;ICEcoder.findResult>ICEcoder.results.length-1&&(ICEcoder.findResult=0);e.innerHTML="Highlighted result "+(ICEcoder.findResult+1)+" of "+ICEcoder.results.length+" results";e=f.getSearchCursor(a,f.getCursor(),!0);e.findNext();e.from()||(e=f.getSearchCursor(a,{line:0,ch:0},!0),e.findNext());f.setSelection(e.from(),e.to());top.ICEcoder.focus();
|
||||
top.ICEcoder.findMode=!0}return!0}e.innerHTML="No results";return!1}""!=a&&c&&(filesQS=e=f="","and"==document.findAndReplace.connector.value&&(f="&replace="+d),0<=document.findAndReplace.target.value.indexOf("file")&&(e="&target="+document.findAndReplace.target.value.replace(/ /g,"-")),"selected files"==document.findAndReplace.target.value&&(filesQS="&selectedFiles="+top.ICEcoder.selectedFiles.join(":")),a=a.replace(/\'/g,"'"),a!=encodeURIComponent(a)?a="ICEcoder:"+encodeURIComponent(a):a,top.ICEcoder.showHide("show",
|
||||
top.get("loadingMask")),top.get("mediaContainer").innerHTML='<iframe src="lib/multiple-results.php?find='+a+f+e+filesQS+'" class="whiteGlow" style="width: 700px; height: 500px"></iframe>')},replaceInFile:function(a,b,c){top.ICEcoder.serverQueue("add","lib/file-control.php?action=replaceText&fileRef="+a.replace(/\//g,"|")+"&find="+b+"&replace="+c);top.ICEcoder.serverMessage("<b>Replacing text in</b><br>"+a)},getNestLocation:function(a){var b,c,d;if(b=ICEcoder.getcMInstance()){c=b.getValue();b=b.getTokenAt(b.getCursor()).state;
|
||||
if("undefined"!=typeof b.curState&&"undefined"!=typeof b.curState.htmlState)for(ICEcoder.htmlTagArray=[],d=b.curState.htmlState.context;d;d=d.prev)"undefined"!=typeof d.tagName&&ICEcoder.htmlTagArray.unshift(d.tagName);ICEcoder.tagString=ICEcoder.htmlTagArray[ICEcoder.htmlTagArray.length-1];"JavaScript"==ICEcoder.caretLocType&&(ICEcoder.tagString="script");if(a&&!top.ICEcoder.dontUpdateNest&&(ICEcoder.nestDisplay.innerHTML="","undefined"!=typeof ICEcoder.openFiles[ICEcoder.selectedTab-1]&&(a=ICEcoder.openFiles[ICEcoder.selectedTab-
|
||||
1],0>["js","coffee","css","less"].indexOf(a.split(".")[1])&&-1==c.indexOf("include(")&&-1==c.indexOf("include_once(")&&(-1<c.indexOf("<html")||-1<c.indexOf("<body"))))){for(a=0;a<ICEcoder.htmlTagArray.length;a++)c='onMouseover="top.ICEcoder.highlightBlock('+a+')" onMouseout="top.ICEcoder.highlightBlock('+a+",'hide')\" onClick=\"top.ICEcoder.setPosition("+a+",top.ICEcoder.startPosLine,'"+ICEcoder.htmlTagArray[a]+"')\"",0==a&&(ICEcoder.nestDisplay.innerHTML+="<div "+c+' style="display: inline-block; width: 7px; margin-top: -5px; height: 30px; background-image: url(images/nest-tag-bg.gif)"></div>'),
|
||||
ICEcoder.nestDisplay.innerHTML+="<a "+c+' style="display: inline-block; cursor: pointer; background: #333; padding: 7px 2px 7px 7px; margin-top: -5px; height: 30px">'+ICEcoder.htmlTagArray[a]+"</a>",ICEcoder.nestDisplay.innerHTML+=a<ICEcoder.htmlTagArray.length-1?"<div "+c+' style="display: inline-block; width: 8px; margin-top: -5px; height: 30px; background-image: url(images/nest-tag-bg.gif); background-position: -7px 0; cursor: pointer"></div>':"<div "+c+' style="display: inline-block; width: 7px; margin-top: -5px; height: 30px; background-image: url(images/nest-tag-bg.gif); background-position: -15px 0; cursor: pointer"></div>';
|
||||
"undefined"!=typeof b.curState&&0<ICEcoder.htmlTagArray.length&&(ICEcoder.nestDisplay.innerHTML+='<a style="display: inline-block; cursor: default; padding: 7px 2px 7px 7px; margin-top: -5px; height: 30px; color: #666">'+(b.curState.tagName?b.curState.tagName:"content")+"</a>")}}},updateNestingIndicator:function(){var a,b,c;a=ICEcoder.getcMInstance();b=!0;c=ICEcoder.openFiles[ICEcoder.selectedTab-1];a&&(c&&-1==["js","coffee","css","less"].indexOf(c.split(".")[1]))&&(b="error"!=a.getTokenAt({line:a.lineCount(),
|
||||
ch:a.lineInfo(a.lineCount()-1).text.length}).className?!0:!1);ICEcoder.nestValid.style.background=b?"#0b0":"#f00";ICEcoder.nestValid.title=b?"Nesting OK":"Nesting Broken"},getCaretPosition:function(){var a,b,c,d;a=ICEcoder.getcMInstance();b=a.getCursor().line;c=a.getCursor().ch;for(var e=d=0;e<b;e++)d+=a.getLine(e).length+1;ICEcoder.caretPos=d+c-1;ICEcoder.getNestLocation("yes")},updateCharDisplay:function(){var a;a=ICEcoder.getcMInstance();ICEcoder.caretLocationType();ICEcoder.charDisplay.innerHTML=
|
||||
ICEcoder.caretLocType+", Line: "+(a.getCursor().line+1)+", Char: "+a.getCursor().ch},updateByteDisplay:function(){ICEcoder.byteDisplay.innerHTML=ICEcoder.getcMInstance().getValue().length.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")+" bytes"},showDisplay:function(a){top.ICEcoder.byteDisplay.style.display="byte"==a?"inline-block":"none";top.ICEcoder.charDisplay.style.display="char"==a?"inline-block":"none"},caretLocationType:function(){var a,b;a=ICEcoder.getcMInstance();b="Unknown";a=a.getValue().substr(0,
|
||||
ICEcoder.caretPos+1);a.lastIndexOf("<script")>a.lastIndexOf("\x3c/script>")&&"Unknown"==b?b="JavaScript":a.lastIndexOf("<?")>a.lastIndexOf("?>")&&"Unknown"==b?b="PHP":a.lastIndexOf("<%")>a.lastIndexOf("%>")&&"Unknown"==b?b="Ruby":a.lastIndexOf("<")>a.lastIndexOf(">")&&"Unknown"==b?b="HTML":"Unknown"==b&&(b="Content");(a=ICEcoder.openFiles[ICEcoder.selectedTab-1])&&(0<a.indexOf(".js")?b="JavaScript":0<a.indexOf(".coffee")?b="CoffeeScript":0<a.indexOf(".py")?b="Python":0<a.indexOf(".rb")?b="Ruby":0<
|
||||
a.indexOf(".css")?b="CSS":0<a.indexOf(".less")?b="LESS":0<a.indexOf(".md")&&(b="Markdown"));ICEcoder.caretLocType=b},redoChangedContent:function(a){var b,c;b=ICEcoder.getcMInstance();c=a.keyCode?a.keyCode:a.which?a.which:a.charCode;a.ctrlKey||(top.ICEcoder.cmdKey||27==c||20==c||!(16>c||19<c)||!(37>c||40<c)||144==c&&145==c||45==c&&46==c||!(33>c||36<c)||91==c&&92==c||!(112>c||123<c))||(ICEcoder.changedContent[ICEcoder.selectedTab-1]=0<b.historySize().undo?1:0,ICEcoder.redoTabHighlight(ICEcoder.selectedTab))},
|
||||
showHide:function(a,b){b.style.visibility="show"==a?"visible":"hidden"},getcMInstance:function(a){return top.ICEcoder.content.contentWindow["new"==a||"new"!=a&&0<ICEcoder.openFiles.length?"cM"+ICEcoder.cMInstances[ICEcoder.selectedTab-1]:"cM1"]},getMouseXY:function(a,b){top.ICEcoder.mouseX=a.pageX?a.pageX:a.clientX+document.body.scrollLeft;top.ICEcoder.mouseY=a.pageY?a.pageY:a.clientY+document.body.scrollTop;"top"!=b&&(top.ICEcoder.mouseY+=90);"editor"==b&&(top.ICEcoder.mouseX+=top.ICEcoder.filesW);
|
||||
top.ICEcoder.dragCursorTest();62<top.ICEcoder.mouseY&&top.ICEcoder.setTabWidths()},dragCursorTest:function(){var a,b;a=top.ICEcoder.mouseX-top.ICEcoder.diffStartX;!1!==top.ICEcoder.draggingTab&&(top.ICEcoder.diffStartX&&(-10>=a||10<=a))&&top.ICEcoder.mouseX>parseInt(top.ICEcoder.files.style.width,10)&&(top.ICEcoder.tabDragMouseX=top.ICEcoder.mouseX-parseInt(top.ICEcoder.files.style.width,10)-top.ICEcoder.tabDragMouseXStart,top.ICEcoder.tabDragMove());if(top.ICEcoder.ready&&(a=window.innerHeight,top.ICEcoder.mouseDown||
|
||||
(top.ICEcoder.draggingFilesW=!1),a=!ICEcoder.draggingTab&&(top.ICEcoder.mouseX>top.ICEcoder.filesW-7&&top.ICEcoder.mouseX<top.ICEcoder.filesW+7&&40<top.ICEcoder.mouseY&&top.ICEcoder.mouseY<a-30||top.ICEcoder.draggingFilesW)?"w-resize":"auto",top.ICEcoder.content.contentWindow.document&&top.ICEcoder.filesFrame.contentWindow)){top.document.body.style.cursor=a;if(b=top.ICEcoder.content.contentWindow.document.body)b.style.cursor=a;if(b=top.ICEcoder.filesFrame.contentWindow.document.body)b.style.cursor=
|
||||
a}},serverMessage:function(a){var b;b=top.get("serverMessage");a?(b.innerHTML=a,b.style.left="0"):setTimeout(function(){b.style.left="2000px"},200);b.style.opacity=a?1:0},cssColorPreview:function(){var a,b,c,d;a=ICEcoder.getcMInstance();b=a.getLine(a.getCursor().line);for(c=/(#[\da-f]{3}(?:[\da-f]{3})?\b|\b(?:rgb|hsl)a?\([\s\d%,.-]+\)|\b[a-z]+\b)/gi;(d=c.exec(b))&&a.getCursor().ch>d.index+d[0].length;);(b=top.get("content").contentWindow.document.getElementById("cssColor"))&&b.parentNode.removeChild(b);
|
||||
top.ICEcoder.codeAssist&&"CSS"==top.ICEcoder.caretLocType&&(b=top.document.createElement("div"),b.id="cssColor",b.style.position="absolute",b.style.display="block",b.style.width=b.style.height="20px",b.style.zIndex="1000",b.style.background=d?d[0]:"",b.style.cursor="pointer",b.onclick=function(){top.ICEcoder.showColorPicker(d[0])},""==b.style.backgroundColor&&(b.style.display="none"),top.get("header").appendChild(b),a.addWidget(a.getCursor(),top.get("cssColor"),!0))},showColorPicker:function(a){top.get("blackMask").style.visibility=
|
||||
"visible";top.get("mediaContainer").innerHTML='<div id="picker" class="picker"></div><br><br><input type="text" id="color" name="color" value="#000" class="colorValue"><input type="button" onClick="top.ICEcoder.insertColorValue(top.get(\'color\').value)" value="insert >" class="insertColorValue"><br><input type="text" id="colorRGB" name="colorRGB" value="rgb(0,0,0)" class="colorValue"><input type="button" onClick="top.ICEcoder.insertColorValue(top.get(\'colorRGB\').value)" value="insert >" class="insertColorValue">';
|
||||
farbtastic("picker","color");a&&top.get("picker").farbtastic.setColor(a)},drawCanvasImage:function(a){var b,c,d,e,f,g,l,h,k,n,p;b=top.get("canvasPicker").getContext("2d");c=new Image;c.src=a.src;c.onload=function(){top.get("canvasPicker").width=a.width;top.get("canvasPicker").height=a.height;b.drawImage(c,0,0,a.width,a.height)};top.get("canvasPicker").onmousemove=function(a){d=a.pageX-this.offsetLeft;e=a.pageY-this.offsetTop;f=b.getImageData(d,e,1,1).data;g=f[0];l=f[1];h=f[2];k=g+","+l+","+h;n=top.ICEcoder.rgbToHex(g,
|
||||
l,h);top.get("rgbMouseXY").value=k;top.get("hexMouseXY").value="#"+n;top.get("hexMouseXY").style.backgroundColor=top.get("rgbMouseXY").style.backgroundColor="#"+n;p=128>g||128>l||128>h&&200>g&&200>l&&50<h?"#fff":"#000";top.get("hexMouseXY").style.color=top.get("rgbMouseXY").style.color=p};top.get("canvasPicker").onclick=function(){top.get("rgb").value=top.get("rgbMouseXY").value;top.get("hex").value=top.get("hexMouseXY").value;top.get("hex").style.backgroundColor=top.get("rgb").style.backgroundColor=
|
||||
top.get("hex").value;top.get("hex").style.color=top.get("rgb").style.color=p}},rgbToHex:function(a,b,c){return top.ICEcoder.toHex(a)+top.ICEcoder.toHex(b)+top.ICEcoder.toHex(c)},toHex:function(a){a=parseInt(a,10);if(isNaN(a))return"00";a=Math.max(0,Math.min(a,255));return"0123456789abcdef".charAt((a-a%16)/16)+"0123456789abcdef".charAt(a%16)},insertColorValue:function(a){var b,c;b=ICEcoder.getcMInstance();c=b.getTokenAt(b.getCursor());b.replaceRange(a,{line:b.getCursor().line,ch:c.start},{line:b.getCursor().line,
|
||||
ch:c.end})},fMIconVis:function(a,b){var c;if(c=top.get(a))c.style.opacity=b},isOpen:function(a){a=a.replace(/\|/g,"/").replace(top.docRoot+top.iceRoot,"");a=top.ICEcoder.openFiles.indexOf(a);return-1!=a?a:!1},startPluginIntervals:function(a,b,c,d){top.ICEcoder["plugTimer"+a]=-1<["_parent","_top","_self",""].indexOf(c)?top.ICEcoder["plugTimer"+a]=setInterval("window.location='"+b+"'",6E4*d):0==c.indexOf("fileControl")?top.ICEcoder["plugTimer"+a]=setInterval(function(){top.ICEcoder.serverQueue("add",
|
||||
b);top.ICEcoder.serverMessage(c.split(":")[1])},6E4*d):top.ICEcoder["plugTimer"+a]=setInterval("window.open('"+b+"','"+c+"')",6E4*d);top.ICEcoder.pluginIntervalRefs.push(a)},codeAssistToggle:function(){var a;ICEcoder.getcMInstance();top.ICEcoder.codeAssist=!top.ICEcoder.codeAssist;top.ICEcoder.cssColorPreview();top.ICEcoder.focus();for(i=0;i<top.ICEcoder.cMInstances.length;i++)-1<top.ICEcoder.openFiles[i].indexOf(".js")&&(a=top.ICEcoder.content.contentWindow["cM"+top.ICEcoder.cMInstances[i]],top.ICEcoder.codeAssist?
|
||||
a.setOption("lintWith",top.ICEcoder.content.contentWindow.CodeMirror.javascriptValidator):(a.clearGutter("CodeMirror-lint-markers"),a.setOption("lintWith",!1)))},serverQueue:function(a,b){var c,d,e;c=ICEcoder.getcMInstance();for(e=d=0;e<ICEcoder.serverQueueItems.length;e++)0<ICEcoder.serverQueueItems[e].indexOf("action=save")&&d++;d++;if("add"==a)ICEcoder.serverQueueItems.push(b),0<b.indexOf("action=save")&&(e=document.createElement("textarea"),e.setAttribute("id","saveTemp"+d),document.body.appendChild(e),
|
||||
top.get("saveTemp"+d).value=c.getValue());else if("del"==a){if(ICEcoder.serverQueueItems[0]&&0<ICEcoder.serverQueueItems[0].indexOf("action=save")){c=d-1;for(e=1;e<c;e++)top.get("saveTemp"+e).value=top.get("saveTemp"+(e+1)).value;c=top.get("saveTemp"+c);c.parentNode.removeChild(c)}ICEcoder.serverQueueItems.splice(0,1)}("del"==a&&1<=ICEcoder.serverQueueItems.length||1==ICEcoder.serverQueueItems.length)&&setTimeout(function(){top.ICEcoder.filesFrame.contentWindow.frames.fileControl.location.href=ICEcoder.serverQueueItems[0]},
|
||||
1)},cancelAllActions:function(){window.stop();0<ICEcoder.serverQueueItems.length&&ICEcoder.serverQueueItems.splice(1,ICEcoder.serverQueueItems.length);top.ICEcoder.showHide("hide",top.get("loadingMask"));top.ICEcoder.serverMessage('<b style="color: #d00">Cancelled tasks</b>');setTimeout(function(){top.ICEcoder.serverMessage()},2E3)},setPreviousFiles:function(){var a;a=top.ICEcoder.openFiles.join(",").replace(/\//g,"|").replace(/(\|\[NEW\])|(,\|\[NEW\])/g,"").replace(/(^,)|(,$)/g,"");""==a&&(a="CLEAR");
|
||||
top.ICEcoder.serverQueue("add","lib/settings.php?saveFiles="+a)},autoOpenFiles:function(){if(0<top.ICEcoder.previousFiles.length&&top.ICEcoder.ask("Open previous files?\n\n"+top.ICEcoder.previousFiles.length+" files:\n"+top.ICEcoder.previousFiles.join("\n").replace(/\|/g,"/").replace(RegExp(top.docRoot+top.iceRoot,"gi"),"")))for(var a=0;a<top.ICEcoder.previousFiles.length;a++)top.ICEcoder.rightClickedFile=top.ICEcoder.thisFileFolderLink=top.ICEcoder.previousFiles[a].replace("|","/"),top.ICEcoder.thisFileFolderType=
|
||||
"file",top.ICEcoder.openFile()},settingsScreen:function(a){a||(top.get("mediaContainer").innerHTML='<iframe src="lib/settings-screen.php" class="whiteGlow" style="width: 970px; height: 600px"></iframe>');top.ICEcoder.showHide(a?"hide":"show",top.get("blackMask"))},helpScreen:function(){top.get("mediaContainer").innerHTML='<iframe src="lib/help.php" class="whiteGlow" style="width: 800px; height: 450px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},showManual:function(a){top.get("mediaContainer").innerHTML=
|
||||
'<iframe src="http://icecoder.net/manual?version='+a+'" class="whiteGlow" style="width: 500px; height: 500px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},propertiesScreen:function(a){top.get("mediaContainer").innerHTML='<iframe src="lib/properties.php?fileName='+a.replace(/\//g,"|")+'" class="whiteGlow" style="width: 660px; height: 330px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},useNewSettings:function(a,b,c,d,e,f,g,l,h){var k;top.ICEcoder.theme=a.slice(a.lastIndexOf("/")+
|
||||
1,a.lastIndexOf("."));"editor"==top.ICEcoder.theme&&(top.ICEcoder.theme="icecoder");k=document.createElement("link");k.setAttribute("rel","stylesheet");k.setAttribute("type","text/css");k.setAttribute("href",a);top.ICEcoder.content.contentWindow.document.getElementsByTagName("head")[0].appendChild(k);a=-1<["eclipse","elegant","neat","solarized","xq-light"].indexOf(top.ICEcoder.theme)?"#ccc":"#000";top.ICEcoder.switchTab(top.ICEcoder.selectedTab);b!=top.ICEcoder.codeAssist&&(top.get("codeAssist").checked=
|
||||
b,top.ICEcoder.codeAssistToggle());c!=top.ICEcoder.lockedNav&&top.ICEcoder.lockUnlockNav();c||(ICEcoder.changeFilesW("contract"),top.ICEcoder.hideFileMenu());c=ICEcoder.content.contentWindow.document.styleSheets[4];b=c.rules?"rules":"cssRules";c[b][0].style.fontSize=e;c[b][4].style.content=d?'"\\21e5"':'" "';c[b][2].style.cssText="background-color: "+a+" !important";top.ICEcoder.lineWrapping=f;top.ICEcoder.indentWithTabs=g;top.ICEcoder.indentSize=l;for(d=0;d<ICEcoder.cMInstances.length;d++)ICEcoder.content.contentWindow["cM"+
|
||||
ICEcoder.cMInstances[d]].setOption("lineWrapping",top.ICEcoder.lineWrapping),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[d]].setOption("indentWithTabs",top.ICEcoder.indentWithTabs),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[d]].setOption("indentUnit",top.ICEcoder.indentSize),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[d]].setOption("tabSize",top.ICEcoder.indentSize);h&&top.ICEcoder.refreshFileManager()},updateResultsDisplay:function(a){ICEcoder.findReplace(top.get("find").value,
|
||||
!0,!1);top.get("results").style.display="show"==a?"inline-block":"none"},fullScreenSwitcher:function(){"undefined"!=typeof document.cancelFullScreen?document.fullScreen?document.cancelFullScreen():document.body.requestFullScreen():"undefined"!=typeof document.mozCancelFullScreen?document.mozFullScreen?document.mozCancelFullScreen():document.body.mozRequestFullScreen():"undefined"!=typeof document.webkitCancelFullScreen&&(document.webkitIsFullScreen?document.webkitCancelFullScreen():document.body.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT))},
|
||||
zipIt:function(a){a=a.replace(/\//g,"|");top.ICEcoder.filesFrame.contentWindow.frames.fileControl.location.href="plugins/zip-it/index.php?zip="+a},chmod:function(a,b){a=a.replace(top.iceRoot,"");top.ICEcoder.showHide("hide",top.get("blackMask"));top.ICEcoder.serverQueue("add","lib/file-control.php?action=perms&file="+a+"&perms="+b);top.ICEcoder.serverMessage("<b>chMod "+b+" on </b><br>"+a)},openPreviewWindow:function(){if(0<top.ICEcoder.openFiles.length){var a,b,c;b=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-
|
||||
1];c=b.substr(b.lastIndexOf("/")+1);c=c.substr(c.lastIndexOf(".")+1);a=ICEcoder.getcMInstance();top.ICEcoder.previewWindow=window.open(b,"previewWindow");-1<["md"].indexOf(c)&&(top.ICEcoder.previewWindow.onload=function(){top.ICEcoder.previewWindow.document.documentElement.innerHTML=mmd(a.getValue())})}},openTerminal:function(){top.ICEcoder.demoMode?top.ICEcoder.message("Sorry, you need to be logged in to use the terminal"):window.open("terminal")},logout:function(){window.location+="?logout"},message:function(a){alert(a)},
|
||||
ask:function(a){return confirm(a)},getInput:function(a,b){return prompt(a,b)},dataMessage:function(a){var b;b=top.ICEcoder.content.contentWindow.document.getElementById("dataMessage");b.style.display="block";b.innerHTML=a},switchTab:function(a,b){var c;ICEcoder.selectedTab=a;if(c=ICEcoder.getcMInstance()){ICEcoder.switchMode();for(var d=0;d<ICEcoder.cMInstances.length;d++)ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[d]].getWrapperElement().style.display="none";c.setOption("theme",top.ICEcoder.theme);
|
||||
c.getWrapperElement().style.display="block";b||setTimeout(function(){top.ICEcoder.focus()},4);c.refresh();ICEcoder.redoTabHighlight(ICEcoder.selectedTab);top.ICEcoder.findMode=!1;ICEcoder.findReplace(top.get("find").value,!0,!1);top.ICEcoder.getCaretPosition();top.ICEcoder.updateCharDisplay();top.ICEcoder.updateByteDisplay()}},newTab:function(){var a;ICEcoder.cMInstances.push(ICEcoder.nextcMInstance);ICEcoder.selectedTab=ICEcoder.cMInstances.length;ICEcoder.showHide("show",ICEcoder.content);ICEcoder.content.contentWindow.createNewCMInstance(ICEcoder.nextcMInstance);
|
||||
ICEcoder.setLayout();ICEcoder.thisFileFolderType="file";ICEcoder.thisFileFolderLink="/[NEW]";ICEcoder.openFile();a=ICEcoder.getcMInstance("new");ICEcoder.switchTab(ICEcoder.openFiles.length);a.removeLineClass(ICEcoder["cMActiveLine"+ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]],"background");ICEcoder["cMActiveLine"+ICEcoder.selectedTab]=a.addLineClass(0,"background","cm-s-activeLine");ICEcoder.nextcMInstance++},createNewTab:function(){var a;top.ICEcoder.openFiles.push(top.ICEcoder.shortURL);top.get("tab"+
|
||||
top.ICEcoder.openFiles.length).style.display="inline-block";a=top.ICEcoder.openFiles[top.ICEcoder.openFiles.length-1];top.get("tab"+top.ICEcoder.openFiles.length).innerHTML='<a nohref onClick="top.ICEcoder.closeTab(parseInt(this.parentNode.id.slice(3),10))"><img src="images/nav-close.gif" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'; top.ICEcoder.overCloseLink=true" onMouseOut="this.style.backgroundColor=prevBG; top.ICEcoder.overCloseLink=false"></a> '+
|
||||
a.slice(a.lastIndexOf("/")).replace(/\//,"");top.get("tab"+top.ICEcoder.openFiles.length).title="/"+top.ICEcoder.openFiles[top.ICEcoder.openFiles.length-1].replace(/\//,"");top.ICEcoder.setTabWidths();top.ICEcoder.redoTabHighlight(top.ICEcoder.openFiles.length);top.ICEcoder.selectedTab=top.ICEcoder.openFiles.length;top.ICEcoder.changedContent.push(0);top.ICEcoder.setPreviousFiles()},nextTab:function(){top.ICEcoder.switchTab(top.ICEcoder.selectedTab+1<=top.ICEcoder.openFiles.length?top.ICEcoder.selectedTab+
|
||||
1:1,"noFocus")},previousTab:function(){top.ICEcoder.switchTab(1<=top.ICEcoder.selectedTab-1?top.ICEcoder.selectedTab-1:top.ICEcoder.openFiles.length,"noFocus")},renameTab:function(a,b){var c;top.ICEcoder.openFiles[a-1]=b;c=top.ICEcoder.openFiles[a-1];top.get("tab"+a).innerHTML='<a nohref onClick="top.ICEcoder.closeTab(parseInt(this.parentNode.id.slice(3),10))"><img src="images/nav-close.gif" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'; top.ICEcoder.overCloseLink=true" onMouseOut="this.style.backgroundColor=prevBG; top.ICEcoder.overCloseLink=false"></a> '+
|
||||
c.slice(c.lastIndexOf("/")).replace(/\//,"");top.get("tab"+a).title="/"+top.ICEcoder.openFiles[a-1].replace(/\//,"")},redoTabHighlight:function(a){for(var b,c,d=1;d<=ICEcoder.changedContent.length;d++)top.get("tab"+d).childNodes[0]&&(top.get("tab"+d).childNodes[0].childNodes[0].style.backgroundColor=1==ICEcoder.changedContent[d-1]?"#b00":"transparent"),b=d==a?top.ICEcoder.tabFGselected:top.ICEcoder.tabFGnormalTab,"undefined"!=typeof top.ICEcoder.openFiles[d-1]&&"/[NEW]"!=top.ICEcoder.openFiles[d-
|
||||
1]&&(c=top.ICEcoder.filesFrame.contentWindow.document.getElementById(top.ICEcoder.openFiles[d-1].replace(/\//g,"|")))&&(c.style.backgroundColor=d==a?top.ICEcoder.tabBGcurrent:top.ICEcoder.tabBGopen,c.style.color=d==a?top.ICEcoder.tabFGcurrent:top.ICEcoder.tabFGopenFile),top.get("tab"+d).style.color=b,top.get("tab"+d).style.background=d==a?top.ICEcoder.tabBGcurrent:top.ICEcoder.tabBGopen;top.ICEcoder.fMIconVis("fMSave",1==ICEcoder.changedContent[a-1]?1:0.3)},closeTab:function(a,b,c){var d;a||(a=top.ICEcoder.selectedTab);
|
||||
ICEcoder.getcMInstance();d=!0;c||1!=ICEcoder.changedContent[a-1]||(d=top.ICEcoder.ask("You have made changes.\n\nAre you sure you want to close without saving?"));if(d){c=top.ICEcoder.openFiles[a-1];for(d=a;d<ICEcoder.openFiles.length;d++)top.get("tab"+d).innerHTML=top.get("tab"+(d+1)).innerHTML,top.get("tab"+d).title=top.get("tab"+(d+1)).title,ICEcoder.openFiles[d-1]=ICEcoder.openFiles[d],ICEcoder.openFileMDTs[d-1]=ICEcoder.openFileMDTs[d];ICEcoder.content.contentWindow["cM"+top.ICEcoder.cMInstances[a-
|
||||
1]].getWrapperElement().style.display="none";top.ICEcoder.cMInstances.splice(a-1,1);top.get("tab"+ICEcoder.openFiles.length).style.display="none";top.get("tab"+ICEcoder.openFiles.length).innerHTML="";top.get("tab"+ICEcoder.openFiles.length).title="";ICEcoder.openFiles.pop();ICEcoder.openFileMDTs.pop();ICEcoder.selectedTab==a&&(0<ICEcoder.openFiles.length?ICEcoder.selectedTab-=1:ICEcoder.selectedTab=0);0<ICEcoder.openFiles.length&&0==ICEcoder.selectedTab&&(ICEcoder.selectedTab=1);0==ICEcoder.openFiles.length?
|
||||
top.ICEcoder.fMIconVis("fMView",0.3):(ICEcoder.switchMode(),ICEcoder.switchTab(ICEcoder.selectedTab));top.ICEcoder.changedContent.splice(a-1,1);top.ICEcoder.redoTabHighlight(ICEcoder.selectedTab);top.ICEcoder.getNestLocation("update");top.ICEcoder.selectDeselectFile("deselect",top.ICEcoder.filesFrame.contentWindow.document.getElementById(c.replace(/\//g,"|")));b||top.ICEcoder.setPreviousFiles()}top.ICEcoder.canSwitchTabs=!1;top.ICEcoder.setTabWidths("posOnlyNewTab");setTimeout(function(){top.ICEcoder.canSwitchTabs=
|
||||
!0},100)},closeAllTabs:function(){if(0<top.ICEcoder.cMInstances.length&&ICEcoder.ask("Close all tabs?"))for(var a=top.ICEcoder.cMInstances.length;0<a;a--)top.ICEcoder.closeTab(a,1<a?!0:!1)},setTabWidths:function(a){var b,c,d,e,f;if(top.ICEcoder.ready){b=parseInt(top.ICEcoder.content.style.width,10)-53-24-10;c=b/top.ICEcoder.openFiles.length-18;d=-18;e=53;f=0;top.ICEcoder.tabLeftPos=[];for(var g=0;g<top.ICEcoder.openFiles.length;g++)a&&(g=top.ICEcoder.openFiles.length),d=168*top.ICEcoder.openFiles.length>
|
||||
b?parseInt(c*g,10)-parseInt(c*(g-1),10):150,e=0==g?53:parseInt(top.get("tab"+g).style.left,10),f=0==g?0:parseInt(top.get("tab"+g).style.width,10)+18,a?d=-18:(top.get("tab"+(g+1)).style.left=e+f+"px",top.get("tab"+(g+1)).style.width=d+"px"),top.ICEcoder.tabLeftPos.push(e+f);top.get("newTab").style.left=e+f+d+18+"px"}},tabDragStart:function(a){top.ICEcoder.draggingTab=a;top.ICEcoder.diffStartX=top.ICEcoder.mouseX;top.ICEcoder.tabDragMouseXStart=(top.ICEcoder.mouseX-(parseInt(top.ICEcoder.files.style.width,
|
||||
10)+53+18))%150;top.get("tab"+a).style.zIndex=2;for(var b=1;b<=top.ICEcoder.openFiles.length;b++)top.get("tab"+b).className=b!==a?"tab tabSlide":"tab tabDrag"},tabDragMove:function(){var a,b;a=parseInt(top.get("tab"+top.ICEcoder.openFiles.length).style.width,10)+18;top.ICEcoder.thisLeft=a=53<=top.ICEcoder.tabDragMouseX?top.ICEcoder.tabDragMouseX<=parseInt(top.get("newTab").style.left,10)-a?top.ICEcoder.tabDragMouseX:parseInt(top.get("newTab").style.left,10)-a:53;top.get("tab"+top.ICEcoder.draggingTab).style.left=
|
||||
a+"px";top.ICEcoder.dragTabNo=top.ICEcoder.draggingTab;for(var c=1;c<=top.ICEcoder.openFiles.length;c++)top.get("tab"+c).style.opacity=c==top.ICEcoder.draggingTab?1:0.5,b=top.ICEcoder.tabLeftPos[c]?top.ICEcoder.tabLeftPos[c]-top.ICEcoder.tabLeftPos[c-1]:b,c!=top.ICEcoder.draggingTab&&(c<top.ICEcoder.draggingTab?top.get("tab"+c).style.left=a<=top.ICEcoder.tabLeftPos[c-1]?top.ICEcoder.tabLeftPos[c-1]+b:top.ICEcoder.tabLeftPos[c-1]:top.get("tab"+c).style.left=a>=top.ICEcoder.tabLeftPos[c-1]?top.ICEcoder.tabLeftPos[c-
|
||||
1]-b:top.ICEcoder.tabLeftPos[c-1])},tabDragEnd:function(){var a,b;top.ICEcoder.setTabWidths();for(var c=1;c<=top.ICEcoder.openFiles.length;c++)top.ICEcoder.thisLeft>=top.ICEcoder.tabLeftPos[c-1]&&(a=top.ICEcoder.thisLeft==top.ICEcoder.tabLeftPos[0]?1:top.ICEcoder.dragTabNo>c?c+1:c),top.get("tab"+c).className="tab",top.get("tab"+c).style.opacity=1,c!=top.ICEcoder.dragTabNo?top.get("tab"+c).style.zIndex=1:setTimeout(function(){top.get("tab"+c).style.zIndex=1},150);if(top.ICEcoder.thisLeft&&!1!==top.ICEcoder.thisLeft){b=
|
||||
[];for(c=1;c<=top.ICEcoder.openFiles.length;c++)b.push(c);b.splice(top.ICEcoder.dragTabNo-1,1);b.splice(a-1,0,top.ICEcoder.dragTabNo);ICEcoder.sortTabs(b)}top.ICEcoder.setTabWidths();top.ICEcoder.draggingTab=!1;top.ICEcoder.thisLeft=!1},sortTabs:function(a){var b,c,d;b=[ICEcoder.changedContent,ICEcoder.openFiles,ICEcoder.openFileMDTs,ICEcoder.cMInstances];c=[[],[],[],[]];for(var e=0;e<b.length;e++){for(var f=0;f<b[e].length;f++)c[e].push(b[e][a[f]-1]);b[e]=c[e]}for(e=0;e<a.length;e++)top.get("tab"+
|
||||
a[e]).id="tab"+(e+1)+".temp",top.ICEcoder.selectedTab==a[e]&&(d=e+1);for(e=0;e<a.length;e++)top.get("tab"+(e+1)+".temp").id="tab"+(e+1);top.get("tab"+d)&&(top.get("tab"+d).className="tab tabSlide");ICEcoder.changedContent=b[0];ICEcoder.openFiles=b[1];ICEcoder.openFileMDTs=b[2];ICEcoder.cMInstances=b[3];top.ICEcoder.setTabWidths();top.ICEcoder.switchTab(d)},alphaTabs:function(){if(0<top.ICEcoder.openFiles.length){var a,b,c,d,e;a=[];b=[];c=[];for(var f=0;f<top.ICEcoder.openFiles.length;f++)a.push(top.ICEcoder.openFiles[f].slice(top.ICEcoder.openFiles[f].lastIndexOf("/")+
|
||||
1)),b.push(top.ICEcoder.openFiles[f]),top.get("tab"+(f+1)).className="tab tabSlide";for(;0<a.length;){d=a[0];nextValueFull=b[0];for(f=e=0;f<a.length;f++)a[f]<d&&(d=a[f],nextValueFull=top.ICEcoder.openFiles[top.ICEcoder.openFiles.indexOf(b[f])],e=f);c.push(top.ICEcoder.openFiles.indexOf(nextValueFull)+1);a.splice(e,1);b.splice(e,1)}top.ICEcoder.sortTabs(c)}},interceptKeys:function(a,b){var c;c=b.keyCode?b.keyCode:b.which?b.which:b.charCode;if(224==c||91==c||93==c)top.ICEcoder.cmdKey=!0;if(46==c&&"files"==
|
||||
a)return top.ICEcoder.deleteFiles(),!1;if(b.altKey){if((b.ctrlKey||top.ICEcoder.cmdKey)&&"content"==a){if(68==c)return top.ICEcoder.tagWrapper("div"),!1;if(83==c)return top.ICEcoder.tagWrapper("span"),!1;if(80==c)return top.ICEcoder.tagWrapper("p"),!1;if(65==c)return top.ICEcoder.tagWrapper("a"),!1;if(66==c)return top.ICEcoder.tagWrapper("b"),!1;if(73==c)return top.ICEcoder.tagWrapper("i"),!1;if(71==c)return top.ICEcoder.tagWrapper("strong"),!1;if(69==c)return top.ICEcoder.tagWrapper("em"),!1;if(49==
|
||||
c)return top.ICEcoder.tagWrapper("h1"),!1;if(50==c)return top.ICEcoder.tagWrapper("h2"),!1;if(51==c)return top.ICEcoder.tagWrapper("h3"),!1;if(52==c)return top.ICEcoder.tagWrapper("h4"),!1;if(53==c)return top.ICEcoder.tagWrapper("h5"),!1;if(54==c)return top.ICEcoder.tagWrapper("h6"),!1;if(13==c)return top.ICEcoder.addLineBreakAtEnd(),!1}return c}return 70==c&&(b.ctrlKey||top.ICEcoder.cmdKey)?(top.get("find").focus(),!1):71==c&&(b.ctrlKey||top.ICEcoder.cmdKey)?(top.get("goToLineNo").focus(),!1):73==
|
||||
c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"==a?(top.ICEcoder.resetKeys(b),c=top.ICEcoder.caretLocType.toLowerCase()+" ","CSS"==top.ICEcoder.caretLocType||"PHP"==top.ICEcoder.caretLocType?window.open("http://voke.fm/"+c+top.ICEcoder.getcMInstance().getSelection()):("Content"==top.ICEcoder.caretLocType&&(c=""),window.open("http://www.google.com/#output=search&q="+c+top.ICEcoder.getcMInstance().getSelection())),!1):39==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"!=a?(top.ICEcoder.nextTab(),!1):
|
||||
37==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"!=a?(top.ICEcoder.previousTab(),!1):38==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"==a?(top.ICEcoder.moveLine("up"),!1):40==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"==a?(top.ICEcoder.moveLine("down"),!1):107==c&&(b.ctrlKey||top.ICEcoder.cmdKey)?("content"==a?top.ICEcoder.duplicateLines():top.ICEcoder.newTab(),!1):109==c&&(b.ctrlKey||top.ICEcoder.cmdKey)?("content"==a?top.ICEcoder.removeLines():top.ICEcoder.closeTab(top.ICEcoder.selectedTab),
|
||||
!1):83==c&&(b.ctrlKey||top.ICEcoder.cmdKey)?(b.shiftKey?top.ICEcoder.saveFile("saveAs"):top.ICEcoder.saveFile(),!1):13==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"/[NEW]"!=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]?(top.ICEcoder.resetKeys(b),window.open(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]),!1):79==c&&(b.ctrlKey||top.ICEcoder.cmdKey)?(top.ICEcoder.openPrompt(),!1):32==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"==a?(top.ICEcoder.addSnippet(),!1):32==c&&"content"!=a&&-1==["find",
|
||||
"replace"].indexOf(document.activeElement.id)?(top.ICEcoder.getcMInstance()&&top.ICEcoder.focus(),!1):74==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"==a?(top.ICEcoder.jumpToDefinition(),!1):27==c&&"content"==a?(top.ICEcoder.lineCommentToggle(),!1):27==c&&"content"!=a?(top.ICEcoder.cancelAllActions(),!1):c},resetKeys:function(a){a=a.keyCode?a.keyCode:a.which?a.which:a.charCode;if(224==a||91==a||93==a)top.ICEcoder.cmdKey=!1},addSnippet:function(){var a,b,c;a=ICEcoder.getcMInstance();b=a.getCursor().line;
|
||||
c=a.getLine(b).length-a.getLine(b).replace(/^\s\s*/,"").length;a=a.getLine(b).slice(c);"function"==a.slice(0,8)?top.ICEcoder.doSnippet("function","function VAR() {\nINDENT\tCURSOR\nINDENT}"):"if"==a.slice(0,2)?top.ICEcoder.doSnippet("if","if (CURSOR) {\nINDENT\t\nINDENT}"):"for"==a.slice(0,3)&&top.ICEcoder.doSnippet("for","for (var i=0; i<CURSOR; i++) {\nINDENT\t\nINDENT}")},doSnippet:function(a,b){var c,d,e,f,g,l;c=top.ICEcoder.getcMInstance();d=c.getCursor().line;if(-1<c.getLine(d).indexOf(a)){e=
|
||||
c.getLine(d);f=e.indexOf(a);e=e.slice(e.indexOf(a)+a.length+1);b=b.replace(/VAR/g,e);e=c.getLine(d).slice(0,f);f=c.getLine(d).length-c.getLine(d).replace(/^\s\s*/,"").length;f=c.getLine(d).slice(0,f);b=b.replace(/INDENT/g,f);e+=b;f=e.indexOf("CURSOR");g=0;l=d;for(i=0;i<e.length;i++)e.indexOf("\n",g)<e.indexOf("CURSOR")&&(g=e.indexOf("\n",g)+1,l+=1);c.setLine(d,e.replace("CURSOR",""));c.setCursor(l,f);top.ICEcoder.focus()}}};
|
||||
44
lib/mmd.js
Normal file
@@ -0,0 +1,44 @@
|
||||
;function mmd(src)
|
||||
{
|
||||
var h='';
|
||||
|
||||
function escape(t)
|
||||
{
|
||||
return new Option(t).innerHTML;
|
||||
}
|
||||
function inlineEscape(s)
|
||||
{
|
||||
return escape(s)
|
||||
.replace(/!\[([^\]]*)]\(([^(]+)\)/g, '<img alt="$1" src="$2">')
|
||||
.replace(/\[([^\]]+)]\(([^(]+)\)/g, '$1'.link('$2'))
|
||||
.replace(/`([^`]+)`/g, '<code>$1</code>')
|
||||
.replace(/\*\*([^*]+)\*\*/g, '<strong>$1</strong>')
|
||||
.replace(/\*([^*]+)\*/g, '<em>$1</em>');
|
||||
}
|
||||
|
||||
src
|
||||
.replace(/^\s+|\r|\s+$/g, '')
|
||||
.replace(/\t/g, ' ')
|
||||
.split(/\n\n+/)
|
||||
.forEach(function(b, f, R)
|
||||
{
|
||||
f=b[0];
|
||||
R=
|
||||
{
|
||||
'*':[/\n\* /,'<ul><li>','</li></ul>'],
|
||||
'1':[/\n[1-9]\d*\.? /,'<ol><li>','</li></ol>'],
|
||||
' ':[/\n /,'<pre><code>','</pre></code>','\n'],
|
||||
'>':[/\n> /,'<blockquote>','</blockquote>','\n']
|
||||
}[f];
|
||||
h+=
|
||||
R?R[1]+('\n'+b)
|
||||
.split(R[0])
|
||||
.slice(1)
|
||||
.map(R[3]?escape:inlineEscape)
|
||||
.join(R[3]||'</li>\n<li>')+R[2]:
|
||||
f=='#'?'<h'+(f=b.indexOf(' '))+'>'+inlineEscape(b.slice(f+1))+'</h'+f+'>':
|
||||
f=='<'?b:
|
||||
'<p>'+inlineEscape(b)+'</p>';
|
||||
});
|
||||
return h;
|
||||
};
|
||||
@@ -17,18 +17,18 @@ table, caption, tbody, tfoot, thead, tr, th, td {
|
||||
}
|
||||
|
||||
body {overflow: hidden;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-o-user-select:none;
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
h1 {font-size: 36px; font-weight: normal; color: #888; margin-bottom: 20px}
|
||||
h1 {font-size: 36px; font-weight: normal; color: #888; margin: 20px 20px 0 20px}
|
||||
h2 {font-size: 18px; font-weight: normal; color: #fff}
|
||||
hr {border: 0; height: 1px; background-color: #888}
|
||||
|
||||
.results {font-family: arial, verdana, helvetica, sans-serif; background-color: #1c1c19; color: #fff}
|
||||
.results .resultsPane {position: relative; width: 660px; height: 560px; font-size: 10px; padding: 20px; float: left}
|
||||
.results .resultsPane {position: relative; width: 660px; height: 340px; overflow: auto; font-size: 10px; padding: 20px; float: left}
|
||||
.results .resultsPane a {color: rgba(0,198,255,0.7); text-decoration: none}
|
||||
.results .resultsPane a:hover {text-decoration: underline}
|
||||
.replace {position: absolute; margin-top: -28px; right: 20px; padding: 5px 10px; font-size: 14px; background-color: rgba(0,198,255,0.7); cursor: pointer}
|
||||
|
||||