Compare commits
1493 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
18a41de47a | ||
|
|
9bd12eb782 | ||
|
|
ef66650997 | ||
|
|
fcffcdde1b | ||
|
|
7de892ccac | ||
|
|
f90f2e051a | ||
|
|
24f49c8d83 | ||
|
|
a4ebaf15ab | ||
|
|
54a46dccc3 | ||
|
|
9747d5057d | ||
|
|
7f5c97d0be | ||
|
|
1933a76631 | ||
|
|
c20d7f9754 | ||
|
|
6b46dc7e89 | ||
|
|
0c1a26170c | ||
|
|
244ee08d7d | ||
|
|
a3acbca24b | ||
|
|
d77e4ed581 | ||
|
|
b928abb956 | ||
|
|
a46ef8d1a6 | ||
|
|
a5d459749f | ||
|
|
7dfa383968 | ||
|
|
036483d195 | ||
|
|
2c950f74bc | ||
|
|
2c59dcd929 | ||
|
|
658d14f31d | ||
|
|
819f4d2151 | ||
|
|
9b214d75df | ||
|
|
e0891a2d71 | ||
|
|
34a4876761 | ||
|
|
13ead0085d | ||
|
|
9e63270fc5 | ||
|
|
eccab3cd57 | ||
|
|
6446daf1a6 | ||
|
|
821602ef1c | ||
|
|
dc3512de9f | ||
|
|
36e9cb7108 | ||
|
|
42f4531720 | ||
|
|
d1fb379a40 | ||
|
|
e27bdb965c | ||
|
|
54fc6df3da | ||
|
|
9dd8f62c8a | ||
|
|
1db19148e7 | ||
|
|
93a01506e4 | ||
|
|
4767ed790c | ||
|
|
e39211347c | ||
|
|
a8cdbb65fe | ||
|
|
ff74ff4149 | ||
|
|
96e47f3d27 | ||
|
|
be52c181ea | ||
|
|
507f2ec544 | ||
|
|
fe00c628f4 | ||
|
|
e9387d322c | ||
|
|
2e3b135fe9 | ||
|
|
d28cc15be2 | ||
|
|
d15bd23800 | ||
|
|
90fe45c52d | ||
|
|
8f7be71905 | ||
|
|
5d583637c4 | ||
|
|
0efb4285c1 | ||
|
|
6dc543ca18 | ||
|
|
e93e1ddeb9 | ||
|
|
d5459f5996 | ||
|
|
c6420a910d | ||
|
|
f8e67b8e68 | ||
|
|
9ffcd382b4 | ||
|
|
725746badf | ||
|
|
9d5290de91 | ||
|
|
1bb0b58cce | ||
|
|
32f0ebbe61 | ||
|
|
25a1d74627 | ||
|
|
355b2f09bf | ||
|
|
01621f75b6 | ||
|
|
242e8a3bd6 | ||
|
|
010c26e716 | ||
|
|
e7bad10663 | ||
|
|
16242f98ce | ||
|
|
14a447b3d8 | ||
|
|
a2088fa500 | ||
|
|
87af68c092 | ||
|
|
06daad87ca | ||
|
|
0b4b86f6c9 | ||
|
|
10626904af | ||
|
|
90cca8a3eb | ||
|
|
8da0141cac | ||
|
|
39e123aaf4 | ||
|
|
24fd17f072 | ||
|
|
9270cc47b5 | ||
|
|
3721db34ab | ||
|
|
e85ae351c7 | ||
|
|
a56ba245ea | ||
|
|
d162eed4c7 | ||
|
|
43fea34f61 | ||
|
|
f7c960fc0d | ||
|
|
ee1933389a | ||
|
|
fdc9d5f1fd | ||
|
|
bad40b6125 | ||
|
|
d76ce85327 | ||
|
|
d3df072a22 | ||
|
|
4b3009a195 | ||
|
|
b72b0d60cb | ||
|
|
5841e62c66 | ||
|
|
9bd0c01702 | ||
|
|
6d86b3a950 | ||
|
|
5ff9b02c89 | ||
|
|
80934ea232 | ||
|
|
5acfa2bf3a | ||
|
|
4fada52e04 | ||
|
|
e1c8e95e11 | ||
|
|
1dfebad790 | ||
|
|
37ffe63d13 | ||
|
|
cc14c34dc2 | ||
|
|
e0cf4e644b | ||
|
|
aad55fc3db | ||
|
|
ba2b459220 | ||
|
|
086669fbe0 | ||
|
|
4cc3fcb6e8 | ||
|
|
8781053dbe | ||
|
|
bdac8974d8 | ||
|
|
9ae24141a3 | ||
|
|
e773efdc59 | ||
|
|
8f94bd1fbd | ||
|
|
d24d83d52a | ||
|
|
c938017baa | ||
|
|
728eea3ae1 | ||
|
|
88f9c1e539 | ||
|
|
76540c20f3 | ||
|
|
70761cf1d9 | ||
|
|
ace913a97d | ||
|
|
d6e269c7f6 | ||
|
|
ec10550b3a | ||
|
|
86e2374b48 | ||
|
|
d156dacbb9 | ||
|
|
1af5517da0 | ||
|
|
e5d34890a9 | ||
|
|
183b2548cf | ||
|
|
d2de489e3a | ||
|
|
90f8dbd86e | ||
|
|
3508ce19f3 | ||
|
|
00188c9818 | ||
|
|
499232f0e6 | ||
|
|
17471a12d2 | ||
|
|
de4b5eeda7 | ||
|
|
d0a0193707 | ||
|
|
5269a26b69 | ||
|
|
8dc6ad587f | ||
|
|
757339c52d | ||
|
|
6e289339d7 | ||
|
|
3ff0a44a1c | ||
|
|
0562228e9a | ||
|
|
0b6993bb7c | ||
|
|
4a19d90d48 | ||
|
|
038b1bcf7b | ||
|
|
a707c2fe8e | ||
|
|
3bb119f578 | ||
|
|
2a92600fa7 | ||
|
|
e80e1dab4d | ||
|
|
45d59d75ba | ||
|
|
28cd4c3ee9 | ||
|
|
e7c44274b0 | ||
|
|
3b2e0e34ef | ||
|
|
2276df07bd | ||
|
|
758ff03520 | ||
|
|
c3ac172960 | ||
|
|
562b4eb531 | ||
|
|
b1f8e845df | ||
|
|
bda869ea54 | ||
|
|
19cfbf082a | ||
|
|
07078bdd1f | ||
|
|
03657a98e1 | ||
|
|
b3f64abfae | ||
|
|
5d73c8f002 | ||
|
|
ba0882762d | ||
|
|
bb8855b628 | ||
|
|
883d5917f5 | ||
|
|
0275e99fe2 | ||
|
|
5d109077e5 | ||
|
|
540851ab6a | ||
|
|
6b920fa5e6 | ||
|
|
d1498bb9fb | ||
|
|
54eeef173a | ||
|
|
723ddf8cda | ||
|
|
9f12552907 | ||
|
|
a8b6fa413e | ||
|
|
76aae8ce42 | ||
|
|
ad0c287053 | ||
|
|
4a11a3559d | ||
|
|
1faa5a80e4 | ||
|
|
f1d3df1ec0 | ||
|
|
e7c94d3351 | ||
|
|
954f76dcf5 | ||
|
|
43037c0ff9 | ||
|
|
93df901b71 | ||
|
|
e97e645eda | ||
|
|
4a03ba3874 | ||
|
|
7f637e4acc | ||
|
|
8f3eeefafd | ||
|
|
5dc550a0ce | ||
|
|
6fe322da27 | ||
|
|
3cfe7c9a56 | ||
|
|
be7d5917cb | ||
|
|
ca28aa6ebd | ||
|
|
e76360c1b5 | ||
|
|
265ca8ba67 | ||
|
|
b0d942d0ec | ||
|
|
6c25905ae4 | ||
|
|
80a39393fe | ||
|
|
d4aed71abf | ||
|
|
ebb72bb992 | ||
|
|
8ffcd30b4d | ||
|
|
06804c37e2 | ||
|
|
1acca0278c | ||
|
|
639c8d4171 | ||
|
|
d77c9d3fca | ||
|
|
2c7cc2c191 | ||
|
|
d7c74b8004 | ||
|
|
aaa8003418 | ||
|
|
86890b13c6 | ||
|
|
39158b0eb6 | ||
|
|
87f1d55bc2 | ||
|
|
14343b5410 | ||
|
|
ffdac30b3c | ||
|
|
244c8dc391 | ||
|
|
e593344461 | ||
|
|
74c46f6e93 | ||
|
|
bbfd8aa249 | ||
|
|
2705a488ad | ||
|
|
850c253e08 | ||
|
|
80e0e3fcd7 | ||
|
|
2cc2d696f1 | ||
|
|
8a83a6b5be | ||
|
|
002d5338a0 | ||
|
|
743aa472f0 | ||
|
|
ba85d5d351 | ||
|
|
4e2ef908dc | ||
|
|
f5dd05ba8e | ||
|
|
17eda2a4cc | ||
|
|
d219c6e019 | ||
|
|
2dc539747b | ||
|
|
e941de50e8 | ||
|
|
63052257a2 | ||
|
|
ac5d2a714e | ||
|
|
59f78c16b1 | ||
|
|
3f7f8133df | ||
|
|
fef5e1ce2c | ||
|
|
0b97b3864f | ||
|
|
3d1330c85d | ||
|
|
041c0cc322 | ||
|
|
e72712640c | ||
|
|
6830195127 | ||
|
|
f9b5d6644d | ||
|
|
40f9eeda36 | ||
|
|
0fa0b0b1ea | ||
|
|
ff0b23f200 | ||
|
|
5456d4081b | ||
|
|
8948fae780 | ||
|
|
ee4542a699 | ||
|
|
31e4e631f9 | ||
|
|
cbf20b3271 | ||
|
|
a65fd50723 | ||
|
|
63a6aac2d8 | ||
|
|
afde4804c9 | ||
|
|
bc8ec9cd3e | ||
|
|
b63ab18e29 | ||
|
|
e7325f58c3 | ||
|
|
7b35bb8c96 | ||
|
|
e84671ce5d | ||
|
|
b01d50fe05 | ||
|
|
3f163051b1 | ||
|
|
4f1d03e1d4 | ||
|
|
fc39e4a225 | ||
|
|
bf88ad7fc8 | ||
|
|
11ba02067e | ||
|
|
952afa05ce | ||
|
|
3131cc3160 | ||
|
|
792f768479 | ||
|
|
ff312a15dd | ||
|
|
36207c9a98 | ||
|
|
b92105e888 | ||
|
|
35bd7c55d0 | ||
|
|
9f19c302d8 | ||
|
|
87b1ac776f | ||
|
|
41e401b05e | ||
|
|
d88da3589d | ||
|
|
9638c393bb | ||
|
|
9961ddc2a8 | ||
|
|
2d40dfd8d4 | ||
|
|
99c9bdf71d | ||
|
|
4fcd25ec88 | ||
|
|
440218da67 | ||
|
|
fefdb9fc8d | ||
|
|
21a0eff593 | ||
|
|
8825a094ae | ||
|
|
aa49ce5c56 | ||
|
|
1522d3385d | ||
|
|
510c41440a | ||
|
|
aa0c34ba1c | ||
|
|
af87e6ef62 | ||
|
|
30291ce6e6 | ||
|
|
890c2eb564 | ||
|
|
67a269b89c | ||
|
|
4b9ee81a78 | ||
|
|
4343f4d229 | ||
|
|
2162baa6c0 | ||
|
|
7e7f792710 | ||
|
|
1bbd9e24b0 | ||
|
|
6435aaa64f | ||
|
|
999aae0a33 | ||
|
|
ba795639b4 | ||
|
|
4c4b205721 | ||
|
|
b3c550b7c0 | ||
|
|
eb8953e784 | ||
|
|
b88b292d5d | ||
|
|
5f42c3b319 | ||
|
|
5b27ae0371 | ||
|
|
f26b1da1b5 | ||
|
|
7a853e2dcb | ||
|
|
9b22748bd0 | ||
|
|
c1e9dd3373 | ||
|
|
8cbbc47043 | ||
|
|
81b3567133 | ||
|
|
fc6568f390 | ||
|
|
8e30fe2946 | ||
|
|
6c811a3261 | ||
|
|
afbe5aa540 | ||
|
|
324afd2d6c | ||
|
|
58d94ef61e | ||
|
|
39974b0982 | ||
|
|
323d7306e2 | ||
|
|
251e228ce4 | ||
|
|
a99f3f217a | ||
|
|
e2acbee113 | ||
|
|
37b69eddf2 | ||
|
|
f0322e6f2c | ||
|
|
756587d080 | ||
|
|
1ad2c92324 | ||
|
|
e5433adf78 | ||
|
|
ed765f75d8 | ||
|
|
4136f1b377 | ||
|
|
860339b90e | ||
|
|
03254a0c0f | ||
|
|
a76081c979 | ||
|
|
71a207079f | ||
|
|
f6e724c4c5 | ||
|
|
4251b36b25 | ||
|
|
b8f39cbfdf | ||
|
|
088c621862 | ||
|
|
2459a53350 | ||
|
|
7093e9c0d4 | ||
|
|
4bc49978d1 | ||
|
|
96bac9c149 | ||
|
|
8dcc15f4d3 | ||
|
|
8183740c04 | ||
|
|
25e4231d7b | ||
|
|
3ed9e0e905 | ||
|
|
45bec0c440 | ||
|
|
5133e39d45 | ||
|
|
cb3b4e446e | ||
|
|
9829a2f3b4 | ||
|
|
7eadf11145 | ||
|
|
2a2bc44f43 | ||
|
|
9ccfa5cec9 | ||
|
|
02687f3c78 | ||
|
|
7ea7a6cbb1 | ||
|
|
a15a28fe5b | ||
|
|
265dedfae1 | ||
|
|
5ddbb8bc56 | ||
|
|
4101b8e937 | ||
|
|
56b6d50479 | ||
|
|
506f585d78 | ||
|
|
577dfb7220 | ||
|
|
7e4286adde | ||
|
|
1090228628 | ||
|
|
aeea861b73 | ||
|
|
997c43bbdd | ||
|
|
958d4dbd2e | ||
|
|
f2b350eb62 | ||
|
|
a3464780a1 | ||
|
|
fe1eb92196 | ||
|
|
0b2d26ec92 | ||
|
|
8024a25f2b | ||
|
|
d287ecbb34 | ||
|
|
d9c95e7730 | ||
|
|
c3b1af31ce | ||
|
|
465576b5cb | ||
|
|
9ecbcd0075 | ||
|
|
c1f62d72ae | ||
|
|
1b27834c41 | ||
|
|
77804907b6 | ||
|
|
9dfa2609be | ||
|
|
8ffb3ab3c4 | ||
|
|
65e1da34fa | ||
|
|
282110807c | ||
|
|
25e5f43d1c | ||
|
|
ce0441694d | ||
|
|
db29699927 | ||
|
|
9a4e2d7617 | ||
|
|
fbf64585b7 | ||
|
|
6d1c6dfd16 | ||
|
|
e78df4d981 | ||
|
|
a757b4d5dc | ||
|
|
d28036ee91 | ||
|
|
d2ba0d4e7a | ||
|
|
5787436177 | ||
|
|
f5ab24b8d2 | ||
|
|
05c0f32a24 | ||
|
|
7b918f77a9 | ||
|
|
d87929d61c | ||
|
|
a926829c33 | ||
|
|
d58e366c40 | ||
|
|
0fb4f7e1c4 | ||
|
|
6ee606e3e2 | ||
|
|
22d4a7690f | ||
|
|
f3a2f5018a | ||
|
|
d2a7589f7c | ||
|
|
f87b4e04f1 | ||
|
|
b5aa4c1f0c | ||
|
|
0c1eb6d288 | ||
|
|
8a03c5f998 | ||
|
|
60aa50ae45 | ||
|
|
aae6bbbb66 | ||
|
|
5ca903c428 | ||
|
|
e86b07f760 | ||
|
|
d7fea5dc78 | ||
|
|
c1eff5aebb | ||
|
|
f2dc490d6f | ||
|
|
b296e1b340 | ||
|
|
8adb060edb | ||
|
|
c3b984fea7 | ||
|
|
afbb2c338b | ||
|
|
6632241ab5 | ||
|
|
be50df81db | ||
|
|
9763b6e2cf | ||
|
|
812b848daf | ||
|
|
4907a7389f | ||
|
|
17dff36b65 | ||
|
|
904921d8c4 | ||
|
|
ac4c075d32 | ||
|
|
ddde64ece9 | ||
|
|
91c097e88d | ||
|
|
894658a3f5 | ||
|
|
a4454ea5f9 | ||
|
|
8ea8fa3a8a | ||
|
|
7480603295 | ||
|
|
079b749d5d | ||
|
|
4815600e85 | ||
|
|
1c63e2d295 | ||
|
|
cf13eca58c | ||
|
|
3cf4607870 | ||
|
|
23c3ba6ad7 | ||
|
|
17fc3c2317 | ||
|
|
af234cbe54 | ||
|
|
c8517c0ec9 | ||
|
|
20b226454b | ||
|
|
98eccf223a | ||
|
|
0fc2ab4d41 | ||
|
|
641b6efe7f | ||
|
|
4c83435b4b | ||
|
|
9f7319cff4 | ||
|
|
dd9baa1502 | ||
|
|
41b4d0daa1 | ||
|
|
e41b181163 | ||
|
|
288ac115d0 | ||
|
|
6774d46a6f | ||
|
|
607abf89f7 | ||
|
|
27f1e5e2f2 | ||
|
|
a457675ce1 | ||
|
|
82049096e6 | ||
|
|
6c965e0223 | ||
|
|
8b4d952929 | ||
|
|
873cc63f94 | ||
|
|
39fc839ff2 | ||
|
|
4edef4c959 | ||
|
|
1d9ced8037 | ||
|
|
4cb77d1429 | ||
|
|
b52d9d1bdd | ||
|
|
5fe7ca5e70 | ||
|
|
62fb440de2 | ||
|
|
96fbd7c7ba | ||
|
|
c9bec8e636 | ||
|
|
769e03e7f2 | ||
|
|
ab83f2d5e2 | ||
|
|
b60d0cdb17 | ||
|
|
677503dbf1 | ||
|
|
25efa29470 | ||
|
|
21a90f8f8f | ||
|
|
64e8d6ae99 | ||
|
|
16a204335e | ||
|
|
0a53f762fe | ||
|
|
6ba4778c1b | ||
|
|
0404c2266c | ||
|
|
e5e914282f | ||
|
|
9867d4bdc3 | ||
|
|
e4cb7112cf | ||
|
|
2d202e90b7 | ||
|
|
016391e442 | ||
|
|
1eff48a429 | ||
|
|
ce33af6bb5 | ||
|
|
fb9d4303f1 | ||
|
|
4e631c9e8f | ||
|
|
766d67d80d | ||
|
|
e2c2a37221 | ||
|
|
2b23020695 | ||
|
|
8d43c6b1a8 | ||
|
|
7362dd1a7c | ||
|
|
316caf7e8c | ||
|
|
87dc6631ee | ||
|
|
62246d7d43 | ||
|
|
a14be3a42c | ||
|
|
7fdf00d5e9 | ||
|
|
99e02f30fb | ||
|
|
716a5b9b5a | ||
|
|
87f880ca52 | ||
|
|
8ec7b84a78 | ||
|
|
05cf5bc8db | ||
|
|
ac25e21a0c | ||
|
|
cc1e0daaa4 | ||
|
|
f4120a9c8c | ||
|
|
e3b80a5e09 | ||
|
|
ef7cb26b01 | ||
|
|
408a5c168f | ||
|
|
0ad6ac95b2 | ||
|
|
bda4747e9c | ||
|
|
bd8f882c94 | ||
|
|
32b5b5b1c4 | ||
|
|
c1e543c9fe | ||
|
|
3908fa5c57 | ||
|
|
1b347fc185 | ||
|
|
282a5e0b01 | ||
|
|
e9d23cc1ea | ||
|
|
34173fd60f | ||
|
|
d0d3c8ef57 | ||
|
|
11912008dd | ||
|
|
c122007e17 | ||
|
|
69dfa1a175 | ||
|
|
bfea443e55 | ||
|
|
680798c28f | ||
|
|
9f0cc45c45 | ||
|
|
0ac97f467f | ||
|
|
647746ea72 | ||
|
|
7bea30b2e6 | ||
|
|
12bc852c89 | ||
|
|
0d42e84045 | ||
|
|
897b85b607 | ||
|
|
5c55cf0efb | ||
|
|
eccd6463f6 | ||
|
|
4a0897c734 | ||
|
|
c86a16df7f | ||
|
|
2ae0e9d902 | ||
|
|
bba18cd56b | ||
|
|
2f20781e16 | ||
|
|
3bee212876 | ||
|
|
6c8893a550 | ||
|
|
9c52ecc19b | ||
|
|
692c884ca2 | ||
|
|
3ef51d7fae | ||
|
|
73d95de122 | ||
|
|
04a568ac9b | ||
|
|
a45499cf04 | ||
|
|
b847d672ab | ||
|
|
3ffefdf6b5 | ||
|
|
cca4c4be80 | ||
|
|
cb9e044cb3 | ||
|
|
fd25dd83bd | ||
|
|
584bb00cfc | ||
|
|
5b9369d344 | ||
|
|
a64506a0de | ||
|
|
2fc83ef80b | ||
|
|
8bee3ebd65 | ||
|
|
99686fdd73 | ||
|
|
33bc3d6a1e | ||
|
|
90597530a4 | ||
|
|
b2af8da9a2 | ||
|
|
05dbf41fdc | ||
|
|
c56bb56708 | ||
|
|
4def1ea1dc | ||
|
|
0ba05e4de0 | ||
|
|
24fce89155 | ||
|
|
1a3c20f91d | ||
|
|
fe3e78cc1c | ||
|
|
749f49b1a0 | ||
|
|
f14010a09d | ||
|
|
0b48b9c7d4 | ||
|
|
13d62b01d1 | ||
|
|
4e7b71db1d | ||
|
|
069fc1f97b | ||
|
|
8684f75254 | ||
|
|
11cd924ce1 | ||
|
|
e2fd0cfc4e | ||
|
|
5eb3106706 | ||
|
|
1831efbe9d | ||
|
|
38edbadca5 | ||
|
|
6fcd80b979 | ||
|
|
cf5e5dbe55 | ||
|
|
a451861bf1 | ||
|
|
7313dd74a6 | ||
|
|
32b9de05f2 | ||
|
|
c79bed22f8 | ||
|
|
cdeb50132d | ||
|
|
090fb09955 | ||
|
|
54b862bd79 | ||
|
|
e37e1c109a | ||
|
|
939123785b | ||
|
|
221b347bd9 | ||
|
|
af9bf3e852 | ||
|
|
ed8746df77 | ||
|
|
bb187db49d | ||
|
|
081e72b3ea | ||
|
|
6188c38053 | ||
|
|
12b0186f5a | ||
|
|
9bccc9c53c | ||
|
|
351b2b320e | ||
|
|
94258feb09 | ||
|
|
8b0f033a78 | ||
|
|
f58f255fc8 | ||
|
|
e3eabcf648 | ||
|
|
9aa506cbd7 | ||
|
|
d8cff7b90f | ||
|
|
07e7bca9eb | ||
|
|
e1f442be90 | ||
|
|
c5d579e0e3 | ||
|
|
5271c2e08f | ||
|
|
9010a7ddbc | ||
|
|
bb95fb7d07 | ||
|
|
2edb11376d | ||
|
|
e7f5ebf912 | ||
|
|
da9758c2f3 | ||
|
|
3e11d58d73 | ||
|
|
6b35c097d6 | ||
|
|
619ba13265 | ||
|
|
529c5b8abf | ||
|
|
3a5ed6e800 | ||
|
|
52cddc015b | ||
|
|
4a01f4f65f | ||
|
|
f9768cb5a3 | ||
|
|
221e0e550c | ||
|
|
d2d1d42d0f | ||
|
|
faf018a097 | ||
|
|
a2a71a107e | ||
|
|
fc9c937e67 | ||
|
|
b4f2e9b442 | ||
|
|
1672645e73 | ||
|
|
4a42c44101 | ||
|
|
383b1a5769 | ||
|
|
77bac4cf9e | ||
|
|
e2b8e530c9 | ||
|
|
e9f752bd67 | ||
|
|
4b31921eb4 | ||
|
|
3df9fc6225 | ||
|
|
b57fe466ce | ||
|
|
bd4bff3b6b | ||
|
|
9d4618a223 | ||
|
|
93636180df | ||
|
|
fcceaa168f | ||
|
|
2639cc6138 | ||
|
|
4a99c2e928 | ||
|
|
7d5af3df05 | ||
|
|
c88b80d2a0 | ||
|
|
819d4abaa2 | ||
|
|
20630aeb47 | ||
|
|
0c0db3babb | ||
|
|
e7761f7e57 | ||
|
|
064fd497ae | ||
|
|
49c60b6b75 | ||
|
|
ca7f36506c | ||
|
|
155f0a9736 | ||
|
|
25e1eb3ce9 | ||
|
|
f2f980928b | ||
|
|
1d121a97a7 | ||
|
|
211d13da09 | ||
|
|
11343d469e | ||
|
|
d7c8041aa1 | ||
|
|
9587e30af8 | ||
|
|
76fa7affaf | ||
|
|
2971dd8672 | ||
|
|
2a33fe3564 | ||
|
|
46cdf5da70 | ||
|
|
28c801bfd4 | ||
|
|
c22cd40293 | ||
|
|
56bd430983 | ||
|
|
d873890e46 | ||
|
|
d29b8eca3c | ||
|
|
6f258000fe | ||
|
|
255211cd07 | ||
|
|
f6d28a90e3 | ||
|
|
ed66ff88a1 | ||
|
|
82e58f2bf9 | ||
|
|
797a87ca26 | ||
|
|
ec6a709393 | ||
|
|
07cbfdb424 | ||
|
|
3b9bd944fb | ||
|
|
934e585cb3 | ||
|
|
3a68f4cf54 | ||
|
|
bd00fcb875 | ||
|
|
905dd5a70f | ||
|
|
c65250ec39 | ||
|
|
607eec6ff0 | ||
|
|
14fb3bde60 | ||
|
|
6782bc8ca2 | ||
|
|
3db6841305 | ||
|
|
f478fa8029 | ||
|
|
d255f8400f | ||
|
|
a1545c60d6 | ||
|
|
ed48603ab5 | ||
|
|
23a0507439 | ||
|
|
482e013887 | ||
|
|
265727c30f | ||
|
|
4d3f4e096b | ||
|
|
7629bca62d | ||
|
|
2712f17262 | ||
|
|
86a37559ba | ||
|
|
b504a557f4 | ||
|
|
e849b46f6b | ||
|
|
738dc50a6f | ||
|
|
3138523b5b | ||
|
|
537643a4c3 | ||
|
|
04bfe098ed | ||
|
|
c507887bdd | ||
|
|
ee261313ac | ||
|
|
c9c152bc8a | ||
|
|
6c8e19a321 | ||
|
|
218e3b66f2 | ||
|
|
1d3488fa8e | ||
|
|
f4c1682592 | ||
|
|
28ac6623c7 | ||
|
|
16ab179e1d | ||
|
|
a8ff5385dc | ||
|
|
9dc33c6086 | ||
|
|
b17c576705 | ||
|
|
96f8f2891b | ||
|
|
581d73afe0 | ||
|
|
1baefebe8f | ||
|
|
39fb05033f | ||
|
|
c6093c084c | ||
|
|
dfec6d9a6d | ||
|
|
08b1261c75 | ||
|
|
2ad6faae3a | ||
|
|
4eff301db3 | ||
|
|
447e43e8f4 | ||
|
|
7457001275 | ||
|
|
fcabd5e79e | ||
|
|
594002316c | ||
|
|
eccf92ebaf | ||
|
|
ad9ddc5621 | ||
|
|
1825dd916e | ||
|
|
dfcde8171e | ||
|
|
b0361183df | ||
|
|
71fe13b249 | ||
|
|
442f51224d | ||
|
|
974678f500 | ||
|
|
8329409c03 | ||
|
|
06c2ac2724 | ||
|
|
04e9e8f9d8 | ||
|
|
7a3330cb8c | ||
|
|
cae29941ea | ||
|
|
15cf2ad076 | ||
|
|
2f16f6dc23 | ||
|
|
528aebffe4 | ||
|
|
e82b2f0cbe | ||
|
|
73e64f3e4a | ||
|
|
15f5b1f830 | ||
|
|
1b0a77f9a8 | ||
|
|
0f82ae3644 | ||
|
|
de3b01b54b | ||
|
|
c17e3646d5 | ||
|
|
26aed3e89e | ||
|
|
74caea8f8f | ||
|
|
2cf07fa072 | ||
|
|
1181cd2fd7 | ||
|
|
850d55ab45 | ||
|
|
a0c91b8754 | ||
|
|
937bdc05c8 | ||
|
|
453755bfa1 | ||
|
|
400b6fbb61 | ||
|
|
8c4e882fa3 | ||
|
|
84eec23793 | ||
|
|
7dfe69f6a5 | ||
|
|
ada6115073 | ||
|
|
e1643566f9 | ||
|
|
053a9a6317 | ||
|
|
425b976cc0 | ||
|
|
5f5f1b1e09 | ||
|
|
e6f4935c7b | ||
|
|
6452e5976b | ||
|
|
2383dff317 | ||
|
|
de3e5042fb | ||
|
|
0dcc35152c | ||
|
|
8eecfcbfaf | ||
|
|
efa3e60f89 | ||
|
|
782df659bc | ||
|
|
0aa158824f | ||
|
|
da7fb44e5d | ||
|
|
4b59ef802e | ||
|
|
be5789cd56 | ||
|
|
9adf0e5d59 | ||
|
|
e2de22470e | ||
|
|
3b7ab2e553 | ||
|
|
8617dedc46 | ||
|
|
0b8f1a9a58 | ||
|
|
16748c0920 | ||
|
|
01ec585a44 | ||
|
|
b5f2295f37 | ||
|
|
d6ca0199b7 | ||
|
|
2257c5e547 | ||
|
|
b5a3d39799 | ||
|
|
a26c3e9d3c | ||
|
|
98a09532eb | ||
|
|
d736789bbc | ||
|
|
82a6cfc03a | ||
|
|
62e9c7c75a | ||
|
|
eb32bd45e7 | ||
|
|
4b95f07923 | ||
|
|
dea8ad4c49 | ||
|
|
96553b217c | ||
|
|
3f79ed5d91 | ||
|
|
1e4283aad3 | ||
|
|
1dda31a28c | ||
|
|
10c87012be | ||
|
|
bda00bf512 | ||
|
|
c8f871ff2a | ||
|
|
58dc0b1aef | ||
|
|
4cd4d8f31a | ||
|
|
b751fd738d | ||
|
|
f97c6fb94c | ||
|
|
219138ade6 | ||
|
|
9086d189b9 | ||
|
|
d1178defe0 | ||
|
|
691a561a95 | ||
|
|
aaaac93bd0 | ||
|
|
fd790566b2 | ||
|
|
db3b429784 | ||
|
|
40ed3278d4 | ||
|
|
d174b13111 | ||
|
|
1708663b32 | ||
|
|
6fdce4ad0d | ||
|
|
fff8d5f07d | ||
|
|
9c8e1f4706 | ||
|
|
0a1036c78f | ||
|
|
0e881a7972 | ||
|
|
839e52ba30 | ||
|
|
8f7d5dcb4d | ||
|
|
1104b28bc1 | ||
|
|
48521cb1e4 | ||
|
|
17e113dafb | ||
|
|
c33825a904 | ||
|
|
b07ef98c8f | ||
|
|
b3d68893df | ||
|
|
1329599987 | ||
|
|
2adf3f364c | ||
|
|
436ee34a02 | ||
|
|
4a6e17b214 | ||
|
|
6e9cbccde6 | ||
|
|
a0cb8ec124 | ||
|
|
21217dfda3 | ||
|
|
25ba18e570 | ||
|
|
a210377f35 | ||
|
|
07b9ca457f | ||
|
|
5f1372d39c | ||
|
|
01b84c79f0 | ||
|
|
4017443b1e | ||
|
|
fd2a17d244 | ||
|
|
126804f7c3 | ||
|
|
5167bbf59e | ||
|
|
8bcdfa2793 | ||
|
|
2f9cb6a91e | ||
|
|
662be14535 | ||
|
|
d6d065cd61 | ||
|
|
ac7f045708 | ||
|
|
ffe02ad7bf | ||
|
|
db1a87d10c | ||
|
|
4bae41ffd8 | ||
|
|
be36fb979f | ||
|
|
0f66d763e0 | ||
|
|
06f4743f51 | ||
|
|
9cc11b8774 | ||
|
|
de821e55ae | ||
|
|
463b5c6e49 | ||
|
|
65ab5fdb34 | ||
|
|
d2f7a035b3 | ||
|
|
bc0b924283 | ||
|
|
56ad6af5b2 | ||
|
|
c50bb3a5a9 | ||
|
|
d993a62263 | ||
|
|
82bc52b909 | ||
|
|
f31598f916 | ||
|
|
6a9efd8ac6 | ||
|
|
a9dddb6066 | ||
|
|
40cf5c99ef | ||
|
|
42f58cbbb3 | ||
|
|
fd9c780015 | ||
|
|
383b92b207 | ||
|
|
7036ed5e2f | ||
|
|
30666aa111 | ||
|
|
9614d68baa | ||
|
|
c25fb4c743 | ||
|
|
09d5222b1f | ||
|
|
426ca78bf7 | ||
|
|
a77a0945fe | ||
|
|
5311a0f903 | ||
|
|
d421656be8 | ||
|
|
04459eaa50 | ||
|
|
3beda8eea0 | ||
|
|
5e894be06b | ||
|
|
bc8f93b596 | ||
|
|
2fb93bac99 | ||
|
|
d0c94c1aef | ||
|
|
77242bfb95 | ||
|
|
5d2d86bffc | ||
|
|
8492c13e72 | ||
|
|
e4eb5dadda | ||
|
|
8532dc4b75 | ||
|
|
1ca26ce676 | ||
|
|
d8e3e823a7 | ||
|
|
473dd7660b | ||
|
|
5afeed56ef | ||
|
|
b91b04f652 | ||
|
|
25de44a23d | ||
|
|
00cfb95971 | ||
|
|
f4ba0e1191 | ||
|
|
6499643769 | ||
|
|
f85287a444 | ||
|
|
483bc9ad87 | ||
|
|
93b89a93c1 | ||
|
|
10064c046c | ||
|
|
a5aecb9d0e | ||
|
|
de1e889f1d | ||
|
|
16f89b40c3 | ||
|
|
0e387d2cda | ||
|
|
837c15e4f9 | ||
|
|
ae7e353169 | ||
|
|
6c1bbd2344 | ||
|
|
27247e8e56 | ||
|
|
08249d78ea | ||
|
|
827091e522 | ||
|
|
13d901bf8d | ||
|
|
e69bdabc99 | ||
|
|
e8d19265e4 | ||
|
|
49e3a49dc5 | ||
|
|
82a7c01898 | ||
|
|
c0d7dbf639 | ||
|
|
569caa0bf2 | ||
|
|
f88ea1ee7d | ||
|
|
d5a8fa0b97 | ||
|
|
3f8f96edea | ||
|
|
04fb4aff28 | ||
|
|
83c6fb089e | ||
|
|
9d8d17b964 | ||
|
|
39d4842ff5 | ||
|
|
cad8473986 | ||
|
|
5f085ccb52 | ||
|
|
b406246689 | ||
|
|
cbe46afdff | ||
|
|
a59d6dc3c7 | ||
|
|
2afb2dd5fd | ||
|
|
4fc3c969d3 | ||
|
|
1796ce324b | ||
|
|
5e04c7f827 | ||
|
|
20fcede440 | ||
|
|
012c1833f2 | ||
|
|
32e8e03256 | ||
|
|
dca653cb92 | ||
|
|
0805eca979 | ||
|
|
17935a78ff | ||
|
|
e16918ee32 | ||
|
|
78471b4595 | ||
|
|
c30bcdd515 | ||
|
|
ac78c5f4e5 | ||
|
|
57a990ce25 | ||
|
|
24825b42a2 | ||
|
|
4f7323f7fc | ||
|
|
a228be85e2 | ||
|
|
fa565bdbdf | ||
|
|
2dc53223e5 | ||
|
|
958ac72805 | ||
|
|
f7297b84e7 | ||
|
|
9a7d9e7bb8 | ||
|
|
fa9df75cf7 | ||
|
|
e3ec76418b | ||
|
|
102d6d8c84 | ||
|
|
a742b5f3e2 | ||
|
|
a2a3bb291f | ||
|
|
b7c0ac7d67 | ||
|
|
13b1fc6b44 | ||
|
|
3939fcf6e7 | ||
|
|
13abbb81af | ||
|
|
019f0153c8 | ||
|
|
8abc2925e0 | ||
|
|
996c9a032a | ||
|
|
22d3794d22 | ||
|
|
ba948a38e9 | ||
|
|
e8a522c4df | ||
|
|
c60f3da32e | ||
|
|
0c92d3cbb2 | ||
|
|
e4fc8dd6fe | ||
|
|
1a849e2de0 | ||
|
|
ffdd79f86b | ||
|
|
e87e46b1b6 | ||
|
|
3ca81a4ff7 | ||
|
|
5477d3c292 | ||
|
|
08300183b3 | ||
|
|
095c77f22c | ||
|
|
09926e63a3 | ||
|
|
87d70f29a1 | ||
|
|
3a7661b111 | ||
|
|
ec976953cd | ||
|
|
1837562b50 | ||
|
|
f3bec4fc37 | ||
|
|
c2117ef4fd | ||
|
|
910804ecd1 | ||
|
|
ce5ae1dfdd | ||
|
|
2c31411ffb | ||
|
|
84d69fa2a1 | ||
|
|
2aea296d19 | ||
|
|
2b0bffc362 | ||
|
|
83356142c1 | ||
|
|
24dcc6947c | ||
|
|
a7e3136a0b | ||
|
|
71639cfea7 | ||
|
|
8c2d39fb82 | ||
|
|
e060d29337 | ||
|
|
79e9156d2f | ||
|
|
9100db55b0 | ||
|
|
141c10f6fe | ||
|
|
4613ab9dc3 | ||
|
|
061ad41b51 | ||
|
|
3a0007cd18 | ||
|
|
0044917943 | ||
|
|
0337c04278 | ||
|
|
4585acf70b | ||
|
|
2ad9bbae25 | ||
|
|
cf075df7d1 | ||
|
|
11cd9905c4 | ||
|
|
cf462542e9 | ||
|
|
b63f25a1ae | ||
|
|
7de69a21c5 | ||
|
|
21783e4ea0 | ||
|
|
53e5a756d7 | ||
|
|
8c911a2fd0 | ||
|
|
ce440e9f43 | ||
|
|
6465f8d8e6 | ||
|
|
4bdf28059a | ||
|
|
21010c6540 | ||
|
|
a5a6cabac6 | ||
|
|
f460c77f2c | ||
|
|
1c69d9213e | ||
|
|
c02c2d3b2c | ||
|
|
7adf5e763b | ||
|
|
0e4afefc7f | ||
|
|
c7f290f42e | ||
|
|
bb553b8a6a | ||
|
|
21eda2a1a3 | ||
|
|
48c13c990f | ||
|
|
a2665529f6 | ||
|
|
8d35d78eff | ||
|
|
a82a364c22 | ||
|
|
cc150ff9d2 | ||
|
|
feeb38293d | ||
|
|
5b9271ccfe | ||
|
|
e60bbc2fb7 | ||
|
|
387cc184e6 | ||
|
|
a830ddcb43 | ||
|
|
35fea30191 | ||
|
|
24b672b968 | ||
|
|
de6a3c5ab1 | ||
|
|
260ff6de3e | ||
|
|
7cb37411c9 | ||
|
|
e4e41e5ef8 | ||
|
|
985f4aafca | ||
|
|
0c25dd44b3 | ||
|
|
285f0bc6dd | ||
|
|
07a370fd24 | ||
|
|
95f07ea38a | ||
|
|
2890b92b21 | ||
|
|
8b80c5d0b5 | ||
|
|
04425786a1 | ||
|
|
15b14e12e2 | ||
|
|
b328972c4d | ||
|
|
da3156047f | ||
|
|
f9f08ba54f | ||
|
|
b43684262f | ||
|
|
2120f78bd7 | ||
|
|
2d896f22d6 | ||
|
|
9fa0aebfe9 | ||
|
|
2ddc3af5ff | ||
|
|
fd80e096ea | ||
|
|
fab2d69fce | ||
|
|
83d08e3aba | ||
|
|
bfea6bcacf | ||
|
|
feff34b021 | ||
|
|
79fbade92a | ||
|
|
bf508e453e | ||
|
|
47b51c22fa | ||
|
|
ebd16105f2 | ||
|
|
01fb1a5775 | ||
|
|
b8c2a05db9 | ||
|
|
4087dc5fe4 | ||
|
|
408029e6e0 | ||
|
|
23ff403529 | ||
|
|
be4f81f584 | ||
|
|
361c91e610 | ||
|
|
2aa2ea9675 | ||
|
|
e084225edf | ||
|
|
9ce342205b | ||
|
|
0edf50e00e | ||
|
|
1ea19daad9 | ||
|
|
32b302314e | ||
|
|
ee197e02a2 | ||
|
|
7cd6ffec2a | ||
|
|
0077580838 | ||
|
|
4d85a79fd1 | ||
|
|
a35139bb61 | ||
|
|
f72b833724 | ||
|
|
0e16bac6e2 | ||
|
|
e17564b362 | ||
|
|
90b66eddf5 | ||
|
|
2862a5849f | ||
|
|
7e839231ed | ||
|
|
fa56a4bb73 | ||
|
|
dff950748c | ||
|
|
b7374e3f8e | ||
|
|
4244b92b08 | ||
|
|
4f688028ad | ||
|
|
5a9a18501d | ||
|
|
896b8f7cf1 | ||
|
|
95bd1b014f | ||
|
|
dbdf8642bb | ||
|
|
c3cd9007d2 | ||
|
|
8079fb5bc5 | ||
|
|
80d0b5d4ed | ||
|
|
86bd847bf9 | ||
|
|
943004844a | ||
|
|
4ff12e0426 | ||
|
|
0d7bdb6fa8 | ||
|
|
6d488b6a81 | ||
|
|
f1d0263ffa | ||
|
|
24035caadb | ||
|
|
ed89a3e0f8 | ||
|
|
7088ab89f1 | ||
|
|
d4688bd76b | ||
|
|
befe0fccaf | ||
|
|
a192410498 | ||
|
|
d43ede3a11 | ||
|
|
9848ffb77f | ||
|
|
7487497d1f | ||
|
|
be11c848f4 | ||
|
|
9836b274b9 | ||
|
|
a96d14566f | ||
|
|
1c8cd8c168 | ||
|
|
5f5806a98e | ||
|
|
624b045ac0 | ||
|
|
0f8bae950e | ||
|
|
fcede42903 | ||
|
|
5defe7d975 | ||
|
|
7e79903fe8 | ||
|
|
a2fa52504c | ||
|
|
2629f85e73 | ||
|
|
8577816234 | ||
|
|
e58d47a3b2 | ||
|
|
c9c83ee7e6 | ||
|
|
139693dce6 | ||
|
|
f98193d822 | ||
|
|
8052f1ac9d | ||
|
|
4f78a06993 | ||
|
|
6c4b4b392b | ||
|
|
268fe34238 | ||
|
|
cc620205d6 | ||
|
|
f0d7c97b7b | ||
|
|
660a6e9e4c | ||
|
|
3386c2a7a5 | ||
|
|
9530efb4d4 | ||
|
|
4293515b3d | ||
|
|
61105e0679 | ||
|
|
79a289c7e2 | ||
|
|
46781e7614 | ||
|
|
1f3546a9f6 | ||
|
|
0dc88bb412 | ||
|
|
971a26c123 | ||
|
|
0976a3b721 | ||
|
|
d496361555 | ||
|
|
60ed65a73a | ||
|
|
d1407b3bd0 | ||
|
|
5ca2da76df | ||
|
|
2ac887ff74 | ||
|
|
cbdc9c0be1 | ||
|
|
b9bade8d5a | ||
|
|
eb43786641 | ||
|
|
0515db3d7c | ||
|
|
db257778c0 | ||
|
|
3b37d7489f | ||
|
|
329c7e8e05 | ||
|
|
fad9b4fa72 | ||
|
|
c1a81279ed | ||
|
|
8bb35a17d2 | ||
|
|
36415054ea | ||
|
|
3e84cbae69 | ||
|
|
f5f2bf7f46 | ||
|
|
acb6656958 | ||
|
|
9d70d7c27e | ||
|
|
648a6afb25 | ||
|
|
57ae1925b1 | ||
|
|
d49318582f | ||
|
|
83e3f830e6 | ||
|
|
04d4353c0f | ||
|
|
6d217fc097 | ||
|
|
9d7136c63c | ||
|
|
51a679d60a | ||
|
|
7d4d28614a | ||
|
|
c75cfaf692 | ||
|
|
fe6aa8a6fc | ||
|
|
a5fe1eb5fb | ||
|
|
5afd37c92c | ||
|
|
293d0409c6 | ||
|
|
4352f18dd3 | ||
|
|
0ae7fe9df5 | ||
|
|
5048f0422d | ||
|
|
c46a36f8ed | ||
|
|
90e2bd0372 | ||
|
|
10fbc8a04b | ||
|
|
fb818f3775 | ||
|
|
434e23c209 | ||
|
|
fe53bd6475 | ||
|
|
268ce91c65 | ||
|
|
3b4074bfc7 | ||
|
|
6af4652161 | ||
|
|
3717d30188 | ||
|
|
4cf2e83418 | ||
|
|
1228639103 | ||
|
|
e12d67de94 | ||
|
|
10bcb37ca5 | ||
|
|
e973598bff | ||
|
|
3a5129694d | ||
|
|
a1e0fbea8b | ||
|
|
0bf374454e | ||
|
|
5e592fbf29 | ||
|
|
ad4101bc99 | ||
|
|
2d057d92cf | ||
|
|
00d1cc9bf8 | ||
|
|
2c1ec5fe75 | ||
|
|
81b28d005d | ||
|
|
6a90616b99 | ||
|
|
d5be43695a | ||
|
|
0a93b81ae7 | ||
|
|
65f8da1654 | ||
|
|
911014db95 | ||
|
|
313ee13f18 | ||
|
|
addad04c44 | ||
|
|
e3789e5b64 | ||
|
|
410315ce35 | ||
|
|
90998da308 | ||
|
|
6fa5b13e10 | ||
|
|
93067c2d52 | ||
|
|
b2079b7007 | ||
|
|
b643dd074c | ||
|
|
a3932c75e1 | ||
|
|
1cd3b9ec47 | ||
|
|
0c77f42080 | ||
|
|
cea122db38 | ||
|
|
966f9fcd07 | ||
|
|
6ce9df8504 | ||
|
|
2a0b223896 | ||
|
|
c2db180829 | ||
|
|
3223e4ffa5 | ||
|
|
24c9b6e211 | ||
|
|
e5555dd26a | ||
|
|
ee2d0ddf8a | ||
|
|
aef130b396 | ||
|
|
fbdadec5e5 | ||
|
|
a068339079 | ||
|
|
3f07d3ec55 | ||
|
|
62e7da9d8a | ||
|
|
b60d43e5f6 | ||
|
|
a5873a3158 | ||
|
|
3a698eb0ed | ||
|
|
1e2ef542e4 | ||
|
|
94e8af4d93 | ||
|
|
250a0ab5eb | ||
|
|
2da05d88a0 | ||
|
|
7faa849a89 | ||
|
|
c5bceb8fc8 | ||
|
|
1e94b93ce6 | ||
|
|
3f7bccf2e6 | ||
|
|
181b869109 | ||
|
|
2332245be1 | ||
|
|
3c6999f3a4 | ||
|
|
5f2f15b976 | ||
|
|
47dfb5b6b7 | ||
|
|
c410c1293e | ||
|
|
ca1c732f31 | ||
|
|
5e8c373bf4 | ||
|
|
51a459fe48 | ||
|
|
03c07abbc3 | ||
|
|
5eabe1a172 | ||
|
|
5b6ea7afb2 | ||
|
|
7c1c5e70ca | ||
|
|
d475f8f965 | ||
|
|
fd239076dd | ||
|
|
5f786bbe47 | ||
|
|
f66dc6bed8 | ||
|
|
52c36ac445 | ||
|
|
8f6a78cba5 | ||
|
|
7053e9113f | ||
|
|
89f9ab9940 | ||
|
|
240bc40b39 | ||
|
|
74649b5f28 | ||
|
|
b484d4b2dc | ||
|
|
da1124dd37 | ||
|
|
210485d0be | ||
|
|
d9aee5ae60 | ||
|
|
9ac64623fc | ||
|
|
6ea4226680 | ||
|
|
c1416bba39 | ||
|
|
ddb3ab3238 | ||
|
|
5e7c9698c7 | ||
|
|
4c66b95516 | ||
|
|
2d03060a0d | ||
|
|
3313b0aa42 | ||
|
|
5d2928d2b3 | ||
|
|
f6e2ae41d6 | ||
|
|
7ccb038b6d | ||
|
|
7d62bbf74f | ||
|
|
3d8cc32302 | ||
|
|
861eea5148 | ||
|
|
b432721fe5 | ||
|
|
f13a0cc7e0 | ||
|
|
1f7e37a1a3 | ||
|
|
548e9cac26 | ||
|
|
0d2a1641c9 | ||
|
|
a67281f8e7 | ||
|
|
281475e6ef | ||
|
|
a5712fc873 | ||
|
|
205ded45e2 | ||
|
|
8ef039b9db | ||
|
|
3d2428b278 | ||
|
|
35d5704e3f | ||
|
|
c1860d30d6 | ||
|
|
e0fba5cb51 | ||
|
|
570ba189ed | ||
|
|
e335e0fd72 | ||
|
|
74a2d8dcb1 | ||
|
|
43ea0c9072 | ||
|
|
dde3eb2e36 | ||
|
|
2008bf90af | ||
|
|
06ffa93bd0 | ||
|
|
5da03cac79 | ||
|
|
8a5eb89aa8 | ||
|
|
f81ede2fd6 | ||
|
|
6f7df67ded | ||
|
|
bb9ad69219 | ||
|
|
8f7667a524 | ||
|
|
86e125a6f3 | ||
|
|
8b3ba13ff0 | ||
|
|
82f062caf2 | ||
|
|
67303eb9fb | ||
|
|
af3ded68c4 | ||
|
|
b94eb44e18 | ||
|
|
c62b24b024 | ||
|
|
baa37450cc | ||
|
|
231fd46cd2 | ||
|
|
b2728d9902 | ||
|
|
451a33f526 | ||
|
|
3670bce918 | ||
|
|
afb041b23c | ||
|
|
5315058e2d | ||
|
|
26d9cc972e | ||
|
|
52ae87812e | ||
|
|
f8af24b383 | ||
|
|
b38947146e | ||
|
|
5c48abff4b | ||
|
|
3994c7fc2b | ||
|
|
859f2b2f3b | ||
|
|
f5040a7bec | ||
|
|
a604494aa9 | ||
|
|
eaaef83ace | ||
|
|
9cf1424d8f | ||
|
|
cb74e45b89 | ||
|
|
1da0498f74 | ||
|
|
754b1de597 | ||
|
|
7e39941ad3 | ||
|
|
79a27b18ce | ||
|
|
194551fdbf | ||
|
|
5a82c8f89b | ||
|
|
2e540368eb | ||
|
|
d5966ae5db | ||
|
|
97f4dfc089 | ||
|
|
b03c2b3b8f | ||
|
|
9a81df6d77 | ||
|
|
a9d55121bb | ||
|
|
88327aeba2 | ||
|
|
8e2d972281 | ||
|
|
7b44ef1664 | ||
|
|
5204fac055 | ||
|
|
c2a1f50dc0 | ||
|
|
c8f3b128cb | ||
|
|
b32ed95597 | ||
|
|
57da1d3062 | ||
|
|
6dfe18fe18 | ||
|
|
1dd9ee2397 | ||
|
|
d31471c6a1 | ||
|
|
930f04951f | ||
|
|
8846835ab8 | ||
|
|
b080cc4d23 | ||
|
|
c910a95ee4 | ||
|
|
4601129fc7 | ||
|
|
9c79259e9c | ||
|
|
bdca0cf668 | ||
|
|
628ad0fcb2 | ||
|
|
793332beb8 | ||
|
|
4e9688cc18 | ||
|
|
ef9a6a0027 | ||
|
|
9e9222c65d | ||
|
|
9ef0d9084f | ||
|
|
36df8f7828 | ||
|
|
8ee1cc8d27 | ||
|
|
e4e2658a3b | ||
|
|
ae8e7ae992 | ||
|
|
e0c936ba03 | ||
|
|
0297e31893 | ||
|
|
5b975adc8e | ||
|
|
12fc6b3a67 | ||
|
|
cb4cc61c5b | ||
|
|
9f4404628b | ||
|
|
5441f6b55b | ||
|
|
258fc518a6 | ||
|
|
6a06bf5efa | ||
|
|
ff93f7cbb5 | ||
|
|
2e291396bd | ||
|
|
b779f8b029 | ||
|
|
04a05b4c02 | ||
|
|
90989a816d | ||
|
|
9b26b96836 | ||
|
|
972a716600 | ||
|
|
b5c4a9241b | ||
|
|
45f9d80a81 | ||
|
|
98435d2d92 | ||
|
|
ccbf965bd9 | ||
|
|
5c82104d7b | ||
|
|
4c29fbb36d | ||
|
|
88e754850d | ||
|
|
21b86980a7 | ||
|
|
98942c5e1a | ||
|
|
9c54df2de5 | ||
|
|
f31c2d24f9 | ||
|
|
52cf17b24a | ||
|
|
d26fc7154c | ||
|
|
14c8863657 | ||
|
|
6d3d5f77bc | ||
|
|
293fc695a4 | ||
|
|
a317d2471f | ||
|
|
afe7ff6d2c | ||
|
|
2f908870e7 | ||
|
|
312f0310dc | ||
|
|
1a1bd5322c | ||
|
|
04ca0ae309 | ||
|
|
221f70e609 | ||
|
|
a426109c1c | ||
|
|
d5e2489cad | ||
|
|
367f0bd6a9 | ||
|
|
8396ed3167 | ||
|
|
6cc360d613 | ||
|
|
e86eef5905 | ||
|
|
24d5fbb595 | ||
|
|
6fb7681a2d | ||
|
|
0b404d4bb1 | ||
|
|
464826e81d | ||
|
|
e871ffeff0 | ||
|
|
2847b1f08e | ||
|
|
d702e00446 | ||
|
|
142ee20bca | ||
|
|
e3f03fa2ce | ||
|
|
8dc3fb86db | ||
|
|
358ec3fb39 | ||
|
|
f4a38a25c8 | ||
|
|
dcb62a3df5 | ||
|
|
59c26957bb | ||
|
|
09d8561b3c | ||
|
|
6246e71c87 | ||
|
|
adcc2dd8d2 | ||
|
|
947fc9ce97 | ||
|
|
5caca9175d | ||
|
|
520d09e81e | ||
|
|
7fa4304097 | ||
|
|
ceed641730 | ||
|
|
1d4ce28b62 | ||
|
|
a551992c3f | ||
|
|
23b8d083a4 | ||
|
|
b3d249f2ef | ||
|
|
647633a1a0 | ||
|
|
313ffb8821 | ||
|
|
774f159e67 | ||
|
|
f9358531ad | ||
|
|
bb09d77eb5 | ||
|
|
ba8cc970d0 | ||
|
|
89c986d50f |
5
.gitattributes
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
* text=auto
|
||||||
|
*.js text eol=lf
|
||||||
|
*.jst text eol=lf
|
||||||
|
*.sh text eol=lf
|
||||||
|
*.tpl text eol=lf
|
||||||
8
.gitignore
vendored
@@ -1,2 +1,8 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
node_modules/
|
*.custom.*
|
||||||
|
*.template.*
|
||||||
|
*.d.ts
|
||||||
|
*.map
|
||||||
|
node_modules
|
||||||
|
vendor/closure-compiler
|
||||||
|
vendor/uglifyjs
|
||||||
|
|||||||
18
.gitmodules
vendored
@@ -1,18 +0,0 @@
|
|||||||
[submodule "vendor/benchmark.js"]
|
|
||||||
path = vendor/benchmark.js
|
|
||||||
url = git://github.com/bestiejs/benchmark.js.git
|
|
||||||
[submodule "vendor/docdown"]
|
|
||||||
path = vendor/docdown
|
|
||||||
url = git://github.com/jdalton/docdown.git
|
|
||||||
[submodule "vendor/qunit"]
|
|
||||||
path = vendor/qunit
|
|
||||||
url = git://github.com/jquery/qunit.git
|
|
||||||
[submodule "vendor/qunit-clib"]
|
|
||||||
path = vendor/qunit-clib
|
|
||||||
url = git://github.com/jdalton/qunit-clib.git
|
|
||||||
[submodule "vendor/requirejs"]
|
|
||||||
path = vendor/requirejs
|
|
||||||
url = git://github.com/jrburke/requirejs.git
|
|
||||||
[submodule "vendor/uglifyjs"]
|
|
||||||
path = vendor/uglifyjs
|
|
||||||
url = git://github.com/mishoo/UglifyJS.git
|
|
||||||
18
.jamignore
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
.*
|
||||||
|
*.custom.*
|
||||||
|
*.template.*
|
||||||
|
*.d.ts
|
||||||
|
*.map
|
||||||
|
*.md
|
||||||
|
*.txt
|
||||||
|
build.js
|
||||||
|
lodash.js
|
||||||
|
index.js
|
||||||
|
bower.json
|
||||||
|
component.json
|
||||||
|
build
|
||||||
|
doc
|
||||||
|
node_modules
|
||||||
|
perf
|
||||||
|
test
|
||||||
|
vendor
|
||||||
28
.npmignore
@@ -1,5 +1,25 @@
|
|||||||
.*
|
.*
|
||||||
dist/*
|
*.custom.*
|
||||||
doc/*.php
|
*.template.*
|
||||||
test/*.html
|
*.d.ts
|
||||||
vendor/
|
*.map
|
||||||
|
*.md
|
||||||
|
bower.json
|
||||||
|
component.json
|
||||||
|
doc
|
||||||
|
perf
|
||||||
|
test
|
||||||
|
vendor/*.gz
|
||||||
|
vendor/backbone
|
||||||
|
vendor/benchmark.js
|
||||||
|
vendor/closure-compiler
|
||||||
|
vendor/docdown
|
||||||
|
vendor/firebug-lite
|
||||||
|
vendor/jquery
|
||||||
|
vendor/json3
|
||||||
|
vendor/platform.js
|
||||||
|
vendor/qunit
|
||||||
|
vendor/qunit-clib
|
||||||
|
vendor/requirejs
|
||||||
|
vendor/uglifyjs
|
||||||
|
vendor/underscore
|
||||||
|
|||||||
23
.travis.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
language: node_js
|
||||||
|
node_js:
|
||||||
|
- 0.6
|
||||||
|
- 0.9
|
||||||
|
- 0.10
|
||||||
|
env:
|
||||||
|
- TEST_COMMAND="istanbul cover ./test/test.js"
|
||||||
|
- TEST_COMMAND="phantomjs ./test/test.js ../dist/lodash.compat.js"
|
||||||
|
- TEST_COMMAND="phantomjs ./test/test.js ../dist/lodash.compat.min.js"
|
||||||
|
- TEST_COMMAND="node ./test/test.js ../dist/lodash.js"
|
||||||
|
- TEST_COMMAND="node ./test/test.js ../dist/lodash.min.js"
|
||||||
|
- TEST_COMMAND="node ./test/test-build.js --time-limit 48m"
|
||||||
|
git:
|
||||||
|
depth: 1
|
||||||
|
branches:
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
before_script:
|
||||||
|
- "tar -xzvf vendor/closure-compiler.tar.gz -C vendor"
|
||||||
|
- "tar -xzvf vendor/uglifyjs.tar.gz -C vendor"
|
||||||
|
- "npm install -g istanbul"
|
||||||
|
script:
|
||||||
|
$TEST_COMMAND
|
||||||
35
CONTRIBUTING.md
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
# Contributing to Lo-Dash
|
||||||
|
|
||||||
|
If you’d like to contribute a feature or bug fix, you can [fork](https://help.github.com/articles/fork-a-repo) Lo-Dash, commit your changes, and [send a pull request](https://help.github.com/articles/using-pull-requests).
|
||||||
|
Please make sure to [search the issue tracker](https://github.com/bestiejs/lodash/issues) first; your issue may have already been discussed or fixed in `master`.
|
||||||
|
|
||||||
|
## Tests
|
||||||
|
|
||||||
|
Include updated unit tests in the `test` directory as part of your pull request.
|
||||||
|
You can run the tests from the command line via `npm test`, or open `test/index.html` in a web browser.
|
||||||
|
The `test/run-test.sh` script attempts to run the tests in [Rhino](https://developer.mozilla.org/en-US/docs/Rhino), [Narwhal](https://github.com/280north/narwhal), [RingoJS](http://ringojs.org/), [PhantomJS](http://phantomjs.org/), and [Node](http://nodejs.org/), before running them in your default browser.
|
||||||
|
The [Backbone](http://backbonejs.org/) and [Underscore](http://http://underscorejs.org/) test suites are included as well.
|
||||||
|
|
||||||
|
## Contributor License Agreement
|
||||||
|
|
||||||
|
Lo-Dash is a member of the [Dojo Foundation](http://dojofoundation.org/).
|
||||||
|
As such, we request that all contributors sign the Dojo Foundation [contributor license agreement](http://dojofoundation.org/about/claForm).
|
||||||
|
|
||||||
|
For more information about CLAs, please check out Alex Russell’s excellent post, ["Why Do I Need to Sign This?"](http://infrequently.org/2008/06/why-do-i-need-to-sign-this/).
|
||||||
|
|
||||||
|
## Coding Guidelines
|
||||||
|
|
||||||
|
In addition to the following guidelines, please follow the conventions already established in the code.
|
||||||
|
|
||||||
|
- **Spacing**:<br>
|
||||||
|
Use two spaces for indentation. No tabs.
|
||||||
|
|
||||||
|
- **Naming**:<br>
|
||||||
|
Keep variable and method names concise and descriptive.<br>
|
||||||
|
Variable names `index`, `collection`, and `callback` are preferable to `i`, `arr`, and `fn`.
|
||||||
|
|
||||||
|
- **Quotes**:<br>
|
||||||
|
Single-quoted strings are preferred to double-quoted strings; however, please use a double-quoted string if the value contains a single-quote character to avoid unnecessary escaping.
|
||||||
|
|
||||||
|
- **Comments**:<br>
|
||||||
|
Please use single-line comments to annotate significant additions, and [JSDoc-style](http://www.2ality.com/2011/08/jsdoc-intro.html) comments for new methods.
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
Copyright 2012 John-David Dalton <http://allyoucanleet.com/>
|
Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
Based on Underscore.js 1.3.3, copyright 2009-2012 Jeremy Ashkenas,
|
Based on Underscore.js 1.4.3, copyright 2009-2013 Jeremy Ashkenas,
|
||||||
DocumentCloud Inc. <http://documentcloud.github.com/underscore>
|
DocumentCloud Inc. <http://underscorejs.org/>
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
a copy of this software and associated documentation files (the
|
a copy of this software and associated documentation files (the
|
||||||
|
|||||||
307
README.md
@@ -1,104 +1,309 @@
|
|||||||
# Lo-Dash <sup>v0.1.0</sup>
|
# Lo-Dash <sup>v1.3.1</sup>
|
||||||
|
|
||||||
A drop-in replacement for [Underscore.js](https://github.com/documentcloud/underscore/) that delivers up to [8x performance improvements](http://jsperf.com/lodash-underscore#chart=bar), [bug fixes](https://github.com/bestiejs/lodash/blob/master/test/test.js#L71), and additional features.
|
A low-level utility library delivering consistency, [customization](https://github.com/bestiejs/lodash#custom-builds), [performance](http://lodash.com/benchmarks), and [extra features](https://github.com/bestiejs/lodash#features).
|
||||||
|
|
||||||
## BestieJS
|
## Download
|
||||||
|
|
||||||
Lo-Dash is part of the BestieJS *"Best in Class"* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation.
|
* Lo-Dash builds (for modern environments):<br>
|
||||||
|
[Development](https://raw.github.com/bestiejs/lodash/v1.3.1/dist/lodash.js) and
|
||||||
|
[Production](https://raw.github.com/bestiejs/lodash/v1.3.1/dist/lodash.min.js)
|
||||||
|
|
||||||
## Documentation
|
* Lo-Dash compatibility builds (for legacy and modern environments):<br>
|
||||||
|
[Development](https://raw.github.com/bestiejs/lodash/v1.3.1/dist/lodash.compat.js) and
|
||||||
|
[Production](https://raw.github.com/bestiejs/lodash/v1.3.1/dist/lodash.compat.min.js)
|
||||||
|
|
||||||
The documentation for Lo-Dash can be viewed here: [/doc/README.md](https://github.com/bestiejs/lodash/blob/master/doc/README.md#readme)
|
* Underscore compatibility builds:<br>
|
||||||
|
[Development](https://raw.github.com/bestiejs/lodash/v1.3.1/dist/lodash.underscore.js) and
|
||||||
|
[Production](https://raw.github.com/bestiejs/lodash/v1.3.1/dist/lodash.underscore.min.js)
|
||||||
|
|
||||||
Underscore's [documentation](http://documentcloud.github.com/underscore/) may also be used.
|
* CDN copies of ≤ v1.3.1’s builds are available on [cdnjs](http://cdnjs.com/) thanks to [CloudFlare](http://www.cloudflare.com/):<br>
|
||||||
|
[Lo-Dash dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.3.1/lodash.js),
|
||||||
|
[Lo-Dash prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.3.1/lodash.min.js),<br>
|
||||||
|
[Lo-Dash compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.3.1/lodash.compat.js),
|
||||||
|
[Lo-Dash compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.3.1/lodash.compat.min.js),<br>
|
||||||
|
[Underscore compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.3.1/lodash.underscore.js), and
|
||||||
|
[Underscore compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.3.1/lodash.underscore.min.js)
|
||||||
|
|
||||||
|
* For optimal file size, [create a custom build](https://github.com/bestiejs/lodash#custom-builds) with only the features you need
|
||||||
|
|
||||||
|
## Dive in
|
||||||
|
|
||||||
|
We’ve got [API docs](http://lodash.com/docs), [benchmarks](http://lodash.com/benchmarks), and [unit tests](http://lodash.com/tests).
|
||||||
|
|
||||||
For a list of upcoming features, check out our [roadmap](https://github.com/bestiejs/lodash/wiki/Roadmap).
|
For a list of upcoming features, check out our [roadmap](https://github.com/bestiejs/lodash/wiki/Roadmap).
|
||||||
|
|
||||||
## So What's The Secret?
|
## Resources
|
||||||
|
|
||||||
Lo-Dash's performance is gained by avoiding native methods, instead opting for simplified non-ES5 compliant methods optimized for common usage, and by leveraging function compilation to reduce the number of overall function calls.
|
For more information check out these articles, screencasts, and other videos over Lo-Dash:
|
||||||
|
|
||||||
## What else?
|
* Posts
|
||||||
|
- [Say “Hello” to Lo-Dash](http://kitcambridge.be/blog/say-hello-to-lo-dash/)
|
||||||
|
|
||||||
Lo-Dash comes with AMD loader support baked in, chainable `_.each`, and will [soon address](https://github.com/bestiejs/lodash/wiki/Roadmap) cross-browser object iteration issues.
|
* Videos
|
||||||
|
- [Introducing Lo-Dash](https://vimeo.com/44154599)
|
||||||
|
- [Lo-Dash optimizations and custom builds](https://vimeo.com/44154601)
|
||||||
|
- [Lo-Dash’s origin and why it’s a better utility belt](https://vimeo.com/44154600)
|
||||||
|
- [Unit testing in Lo-Dash](https://vimeo.com/45865290)
|
||||||
|
- [Lo-Dash’s approach to native method use](https://vimeo.com/48576012)
|
||||||
|
- [CascadiaJS: Lo-Dash for a better utility belt](http://www.youtube.com/watch?v=dpPy4f_SeEk)
|
||||||
|
|
||||||
## Screencast
|
## Features
|
||||||
|
|
||||||
For more information check out [this screencast](http://dl.dropbox.com/u/513327/allyoucanleet/post/20/file/screencast.mp4) over Lo-Dash.
|
* AMD loader support ([RequireJS](http://requirejs.org/), [curl.js](https://github.com/cujojs/curl), etc.)
|
||||||
|
* [_(…)](http://lodash.com/docs#_) supports intuitive chaining
|
||||||
|
* [_.at](http://lodash.com/docs#at) for cherry-picking collection values
|
||||||
|
* [_.bindKey](http://lodash.com/docs#bindKey) for binding [*“lazy”* defined](http://michaux.ca/articles/lazy-function-definition-pattern) methods
|
||||||
|
* [_.cloneDeep](http://lodash.com/docs#cloneDeep) for deep cloning arrays and objects
|
||||||
|
* [_.contains](http://lodash.com/docs#contains) accepts a `fromIndex` argument
|
||||||
|
* [_.debounce](http://lodash.com/docs#debounce) and [_.throttle](http://lodash.com/docs#throttle) accept an `options` argument for more control
|
||||||
|
* [_.createCallback](http://lodash.com/docs#createCallback) to customize how callback arguments are handled and support callback shorthands in mixins
|
||||||
|
* [_.findIndex](http://lodash.com/docs#findIndex) and [_.findKey](http://lodash.com/docs#findKey) for finding indexes and keys of collections
|
||||||
|
* [_.forEach](http://lodash.com/docs#forEach) is chainable and supports exiting iteration early
|
||||||
|
* [_.forIn](http://lodash.com/docs#forIn) for iterating over an object’s own and inherited properties
|
||||||
|
* [_.forOwn](http://lodash.com/docs#forOwn) for iterating over an object’s own properties
|
||||||
|
* [_.isPlainObject](http://lodash.com/docs#isPlainObject) checks if values are created by the `Object` constructor
|
||||||
|
* [_.merge](http://lodash.com/docs#merge) for a deep [_.extend](http://lodash.com/docs#extend)
|
||||||
|
* [_.parseInt](http://lodash.com/docs#parseInt) for consistent cross-environment behavior
|
||||||
|
* [_.partial](http://lodash.com/docs#partial) and [_.partialRight](http://lodash.com/docs#partialRight) for partial application without `this` binding
|
||||||
|
* [_.runInContext](http://lodash.com/docs#runInContext) for easier mocking and extended environment support
|
||||||
|
* [_.support](http://lodash.com/docs#support) to flag environment features
|
||||||
|
* [_.template](http://lodash.com/docs#template) supports [*“imports”* options](http://lodash.com/docs#templateSettings_imports), [ES6 template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6), and [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
|
||||||
|
* [_.transform](http://lodash.com/docs#transform) as a powerful alternative to [_.reduce](http://lodash.com/docs#reduce) for transforming objects
|
||||||
|
* [_.unzip](http://lodash.com/docs#unzip) as the inverse of [_.zip](http://lodash.com/docs#zip)
|
||||||
|
* [_.where](http://lodash.com/docs#where) supports deep object comparisons
|
||||||
|
* [_.clone](http://lodash.com/docs#clone), [_.omit](http://lodash.com/docs#omit), [_.pick](http://lodash.com/docs#pick),
|
||||||
|
[and more…](http://lodash.com/docs "_.assign, _.cloneDeep, _.first, _.initial, _.isEqual, _.last, _.merge, _.rest") accept `callback` and `thisArg` arguments
|
||||||
|
* [_.contains](http://lodash.com/docs#contains), [_.size](http://lodash.com/docs#size), [_.toArray](http://lodash.com/docs#toArray),
|
||||||
|
[and more…](http://lodash.com/docs "_.at, _.countBy, _.every, _.filter, _.find, _.forEach, _.groupBy, _.invoke, _.map, _.max, _.min, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.some, _.sortBy, _.where") accept strings
|
||||||
|
* [_.filter](http://lodash.com/docs#filter), [_.find](http://lodash.com/docs#find), [_.map](http://lodash.com/docs#map),
|
||||||
|
[and more…](http://lodash.com/docs "_.countBy, _.every, _.first, _.groupBy, _.initial, _.last, _.max, _.min, _.reject, _.rest, _.some, _.sortBy, _.sortedIndex, _.uniq") support *“_.pluck”* and *“_.where”* `callback` shorthands
|
||||||
|
|
||||||
|
## Support
|
||||||
|
|
||||||
|
Lo-Dash has been tested in at least Chrome 5~27, Firefox 2~21, IE 6-10, Opera 9.25~12, Safari 3-6, Node.js 0.4.8-0.10.7 (Node bug [#5622](https://github.com/joyent/node/issues/5622) prevents 0.10.8-0.10.10 from working), Narwhal 0.3.2, PhantomJS 1.9.0, RingoJS 0.9, and Rhino 1.7RC5.
|
||||||
|
|
||||||
|
## Custom builds
|
||||||
|
|
||||||
|
Custom builds make it easy to create lightweight versions of Lo-Dash containing only the methods you need.
|
||||||
|
To top it off, we handle all method dependency and alias mapping for you.
|
||||||
|
For a more detailed summary over the differences between various builds, check out the [wiki page](https://github.com/bestiejs/lodash/wiki/build-differences).
|
||||||
|
|
||||||
|
* Backbone builds, with only methods required by Backbone, may be created using the `backbone` modifier argument.
|
||||||
|
```bash
|
||||||
|
lodash backbone
|
||||||
|
```
|
||||||
|
|
||||||
|
* Legacy builds, tailored for older environments without [ES5 support](http://es5.github.com/), may be created using the `legacy` modifier argument.
|
||||||
|
```bash
|
||||||
|
lodash legacy
|
||||||
|
```
|
||||||
|
|
||||||
|
* Modern builds, tailored for newer environments with ES5 support, may be created using the `modern` modifier argument.
|
||||||
|
```bash
|
||||||
|
lodash modern
|
||||||
|
```
|
||||||
|
|
||||||
|
* Mobile builds, without method compilation and most bug fixes for old browsers, may be created using the `mobile` modifier argument.
|
||||||
|
```bash
|
||||||
|
lodash mobile
|
||||||
|
```
|
||||||
|
|
||||||
|
* Strict builds, with `_.bindAll`, `_.defaults`, and `_.extend` in [strict mode](http://es5.github.com/#C), may be created using the `strict` modifier argument.
|
||||||
|
```bash
|
||||||
|
lodash strict
|
||||||
|
```
|
||||||
|
|
||||||
|
* Underscore builds, tailored for projects already using Underscore, may be created using the `underscore` modifier argument.
|
||||||
|
```bash
|
||||||
|
lodash underscore
|
||||||
|
```
|
||||||
|
|
||||||
|
Custom builds may be created using the following commands:
|
||||||
|
|
||||||
|
* Use the `category` argument to pass comma separated categories of methods to include in the build.<br>
|
||||||
|
Valid categories (case-insensitive) are *“arrays”*, *“chaining”*, *“collections”*, *“functions”*, *“objects”*, and *“utilities”*.
|
||||||
|
```bash
|
||||||
|
lodash category=collections,functions
|
||||||
|
lodash category="collections, functions"
|
||||||
|
```
|
||||||
|
|
||||||
|
* Use the `exports` argument to pass comma separated names of ways to export the `LoDash` function.<br>
|
||||||
|
Valid exports are *“amd”*, *“commonjs”*, *“global”*, *“node”*, and *“none”*.
|
||||||
|
```bash
|
||||||
|
lodash exports=amd,commonjs,node
|
||||||
|
lodash exports="amd, commonjs, node"
|
||||||
|
```
|
||||||
|
|
||||||
|
* Use the `iife` argument to specify code to replace the immediately-invoked function expression that wraps Lo-Dash.
|
||||||
|
```bash
|
||||||
|
lodash iife="!function(window,undefined){%output%}(this)"
|
||||||
|
```
|
||||||
|
|
||||||
|
* Use the `include` argument to pass comma separated method/category names to include in the build.
|
||||||
|
```bash
|
||||||
|
lodash include=each,filter,map
|
||||||
|
lodash include="each, filter, map"
|
||||||
|
```
|
||||||
|
|
||||||
|
* Use the `minus` argument to pass comma separated method/category names to remove from those included in the build.
|
||||||
|
```bash
|
||||||
|
lodash underscore minus=result,shuffle
|
||||||
|
lodash underscore minus="result, shuffle"
|
||||||
|
```
|
||||||
|
|
||||||
|
* Use the `plus` argument to pass comma separated method/category names to add to those included in the build.
|
||||||
|
```bash
|
||||||
|
lodash backbone plus=random,template
|
||||||
|
lodash backbone plus="random, template"
|
||||||
|
```
|
||||||
|
|
||||||
|
* Use the `template` argument to pass the file path pattern used to match template files to precompile.
|
||||||
|
```bash
|
||||||
|
lodash template="./*.jst"
|
||||||
|
```
|
||||||
|
|
||||||
|
* Use the `settings` argument to pass the template settings used when precompiling templates.
|
||||||
|
```bash
|
||||||
|
lodash settings="{interpolate:/\{\{([\s\S]+?)\}\}/g}"
|
||||||
|
```
|
||||||
|
|
||||||
|
* Use the `moduleId` argument to specify the AMD module ID of Lo-Dash, which defaults to “lodash”, used by precompiled templates.
|
||||||
|
```bash
|
||||||
|
lodash moduleId="underscore"
|
||||||
|
```
|
||||||
|
|
||||||
|
All arguments, except `legacy` with `mobile`, `modern`, or `underscore`, may be combined.<br>
|
||||||
|
Unless specified by `-o` or `--output`, all files created are saved to the current working directory.
|
||||||
|
|
||||||
|
The following options are also supported:
|
||||||
|
|
||||||
|
* `-c`, `--stdout` ......... Write output to standard output
|
||||||
|
* `-d`, `--debug` ........... Write only the non-minified development output
|
||||||
|
* `-h`, `--help` ............. Display help information
|
||||||
|
* `-m`, `--minify` ......... Write only the minified production output
|
||||||
|
* `-o`, `--output` ......... Write output to a given path/filename
|
||||||
|
* `-p`, `--source-map` .. Generate a source map for the minified output, using an optional source map URL
|
||||||
|
* `-s`, `--silent` ......... Skip status updates normally logged to the console
|
||||||
|
* `-V`, `--version` ....... Output current version of Lo-Dash
|
||||||
|
|
||||||
|
The `lodash` command-line utility is available when Lo-Dash is installed as a global package (i.e. `npm install -g lodash`).
|
||||||
|
|
||||||
## Installation and usage
|
## Installation and usage
|
||||||
|
|
||||||
In a browser:
|
In browsers:
|
||||||
|
|
||||||
~~~ html
|
```html
|
||||||
<script src="lodash.js"></script>
|
<script src="lodash.js"></script>
|
||||||
~~~
|
```
|
||||||
|
|
||||||
Via [npm](http://npmjs.org/):
|
Using [`npm`](http://npmjs.org/):
|
||||||
|
|
||||||
~~~ bash
|
```bash
|
||||||
npm install lodash
|
npm install lodash
|
||||||
~~~
|
|
||||||
|
|
||||||
In [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/):
|
npm install -g lodash
|
||||||
|
npm link lodash
|
||||||
|
```
|
||||||
|
|
||||||
~~~ js
|
To avoid potential issues, update `npm` before installing Lo-Dash:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install npm -g
|
||||||
|
```
|
||||||
|
|
||||||
|
In [Node.js](http://nodejs.org/) and [RingoJS ≥ v0.8.0](http://ringojs.org/):
|
||||||
|
|
||||||
|
```js
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
~~~
|
|
||||||
|
|
||||||
In [Narwhal](http://narwhaljs.org/) and [RingoJS v0.7.0-](http://ringojs.org/):
|
// or as a drop-in replacement for Underscore
|
||||||
|
var _ = require('lodash/dist/lodash.underscore');
|
||||||
|
```
|
||||||
|
|
||||||
~~~ js
|
**Note:** If Lo-Dash is installed globally, run [`npm link lodash`](http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation/) in your project’s root directory before requiring it.
|
||||||
|
|
||||||
|
In [RingoJS ≤ v0.7.0](http://ringojs.org/):
|
||||||
|
|
||||||
|
```js
|
||||||
var _ = require('lodash')._;
|
var _ = require('lodash')._;
|
||||||
~~~
|
```
|
||||||
|
|
||||||
In [Rhino](http://www.mozilla.org/rhino/):
|
In [Rhino](http://www.mozilla.org/rhino/):
|
||||||
|
|
||||||
~~~ js
|
```js
|
||||||
load('lodash.js');
|
load('lodash.js');
|
||||||
~~~
|
```
|
||||||
|
|
||||||
In an AMD loader like [RequireJS](http://requirejs.org/):
|
In an AMD loader like [RequireJS](http://requirejs.org/):
|
||||||
|
|
||||||
~~~ js
|
```js
|
||||||
// opt-in
|
|
||||||
define.amd.lodash = true;
|
|
||||||
|
|
||||||
require({
|
require({
|
||||||
'paths': {
|
'paths': {
|
||||||
'lodash': 'path/to/lodash'
|
'underscore': 'path/to/lodash'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
['lodash'], function(_) {
|
['underscore'], function(_) {
|
||||||
console.log(_.VERSION);
|
console.log(_.VERSION);
|
||||||
});
|
});
|
||||||
~~~
|
```
|
||||||
|
|
||||||
## Cloning this repo
|
## Release Notes
|
||||||
|
|
||||||
To clone this repository including all submodules, using Git 1.6.5 or later:
|
### <sup>v1.3.1</sup>
|
||||||
|
|
||||||
~~~ bash
|
* Added missing `cache` property to the objects returned by `getObject`
|
||||||
git clone --recursive https://github.com/bestiejs/lodash.git
|
* Ensured `maxWait` unit tests pass in Ringo
|
||||||
cd lodash.js
|
* Increased the `maxPoolSize` value
|
||||||
~~~
|
* Optimized `releaseArray` and `releaseObject`
|
||||||
|
|
||||||
For older Git versions, just use:
|
### <sup>v1.3.0</sup>
|
||||||
|
|
||||||
~~~ bash
|
* Added `_.transform` method
|
||||||
git clone https://github.com/bestiejs/lodash.git
|
* Added `_.chain` and `_.findWhere` aliases
|
||||||
cd lodash
|
* Added internal array and object pooling
|
||||||
git submodule update --init
|
* Added Istanbul test coverage reports to Travis CI
|
||||||
~~~
|
* Added `maxWait` option to `_.debounce`
|
||||||
|
* Added support for floating point numbers to `_.random`
|
||||||
|
* Added Volo configuration to package.json
|
||||||
|
* Adjusted UMD for `component build`
|
||||||
|
* Allowed more stable mixing of `lodash` and `underscore` build methods
|
||||||
|
* Ensured debounced function with, `leading` and `trailing` options, works as expected
|
||||||
|
* Ensured minified builds work with the Dojo builder
|
||||||
|
* Ensured minification avoids deoptimizing expressions containing boolean values
|
||||||
|
* Ensured unknown types return `false` in `_.isObject` and `_.isRegExp`
|
||||||
|
* Ensured `_.clone`, `_.flatten`, and `_.uniq` can be used as a `callback` for methods like `_.map`
|
||||||
|
* Ensured `_.forIn` works on objects with longer inheritance chains in IE < 9
|
||||||
|
* Ensured `_.isPlainObject` returns `true` for empty objects in IE < 9
|
||||||
|
* Ensured `_.max` and `_.min` chain correctly
|
||||||
|
* Ensured `clearTimeout` use doesn’t cause errors in Titanium
|
||||||
|
* Ensured that the `--stdout` build option doesn't write to a file
|
||||||
|
* Exposed memoized function’s `cache`
|
||||||
|
* Fixed `Error.prototype` iteration bugs
|
||||||
|
* Fixed "scripts" paths in component.json
|
||||||
|
* Made methods support customizing `_.indexOf`
|
||||||
|
* Made the build track dependencies of private functions
|
||||||
|
* Made the `template` pre-compiler build option avoid escaping non-ascii characters
|
||||||
|
* Made `_.createCallback` avoid binding functions if they don’t reference `this`
|
||||||
|
* Optimized the Closure Compiler minification process
|
||||||
|
* Optimized the large array cache for `_.difference`, `_.intersection`, and `_.uniq`
|
||||||
|
* Optimized internal `_.flatten` and `_.indexOf` use
|
||||||
|
* Reduced `_.unzip` and `_.zip`
|
||||||
|
* Removed special handling of arrays in `_.assign` and `_.defaults`
|
||||||
|
|
||||||
Feel free to fork and send pull requests if you see improvements!
|
The full changelog is available [here](https://github.com/bestiejs/lodash/wiki/Changelog).
|
||||||
|
|
||||||
|
## BestieJS
|
||||||
|
|
||||||
|
Lo-Dash is part of the BestieJS *“Best in Class”* module collection. This means we promote solid browser/environment support, ES5+ precedents, unit testing, and plenty of documentation.
|
||||||
|
|
||||||
## Author
|
## Author
|
||||||
|
|
||||||
* [John-David Dalton](http://allyoucanleet.com/)
|
| [](http://twitter.com/jdalton "Follow @jdalton on Twitter") |
|
||||||
[](https://twitter.com/jdalton "Follow @jdalton on Twitter")
|
|---|
|
||||||
|
| [John-David Dalton](http://allyoucanleet.com/) |
|
||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
|
|
||||||
* [Kit Cambridge](http://kitcambridge.github.com/)
|
| [](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [](http://twitter.com/mathias "Follow @mathias on Twitter") |
|
||||||
[](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter")
|
|---|---|
|
||||||
|
| [Kit Cambridge](http://kitcambridge.github.io/) | [Mathias Bynens](http://mathiasbynens.be/) |
|
||||||
|
|||||||
24
bower.json
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"name": "lodash",
|
||||||
|
"version": "1.3.1",
|
||||||
|
"main": "./dist/lodash.compat.js",
|
||||||
|
"ignore": [
|
||||||
|
".*",
|
||||||
|
"*.custom.*",
|
||||||
|
"*.template.*",
|
||||||
|
"*.d.ts",
|
||||||
|
"*.map",
|
||||||
|
"*.md",
|
||||||
|
"*.txt",
|
||||||
|
"build.js",
|
||||||
|
"index.js",
|
||||||
|
"component.json",
|
||||||
|
"package.json",
|
||||||
|
"build",
|
||||||
|
"doc",
|
||||||
|
"node_modules",
|
||||||
|
"perf",
|
||||||
|
"test",
|
||||||
|
"vendor"
|
||||||
|
]
|
||||||
|
}
|
||||||
793
build/minify.js
Executable file
@@ -0,0 +1,793 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
;(function() {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
/** Load Node.js modules */
|
||||||
|
var cp = require('child_process'),
|
||||||
|
https = require('https'),
|
||||||
|
zlib = require('zlib');
|
||||||
|
|
||||||
|
/** Load other modules */
|
||||||
|
var _ = require('../lodash.js'),
|
||||||
|
preprocess = require('./pre-compile.js'),
|
||||||
|
postprocess = require('./post-compile.js'),
|
||||||
|
tar = require('../vendor/tar/tar.js'),
|
||||||
|
util = require('./util.js');
|
||||||
|
|
||||||
|
/** Module shortcuts */
|
||||||
|
var fs = util.fs,
|
||||||
|
path = util.path;
|
||||||
|
|
||||||
|
/** The Git object ID of `closure-compiler.tar.gz` */
|
||||||
|
var closureId = '9fd5d61c1b706e7505aeb5187941c2c5497e5fd8';
|
||||||
|
|
||||||
|
/** The Git object ID of `uglifyjs.tar.gz` */
|
||||||
|
var uglifyId = '7de2795a3af58d1b293e3b0e83cdbc994f4941dc';
|
||||||
|
|
||||||
|
/** The path of the directory that is the base of the repository */
|
||||||
|
var basePath = fs.realpathSync(path.join(__dirname, '..'));
|
||||||
|
|
||||||
|
/** The path of the `vendor` directory */
|
||||||
|
var vendorPath = path.join(basePath, 'vendor');
|
||||||
|
|
||||||
|
/** The path to the Closure Compiler `.jar` */
|
||||||
|
var closurePath = path.join(vendorPath, 'closure-compiler', 'compiler.jar');
|
||||||
|
|
||||||
|
/** The path to the UglifyJS module */
|
||||||
|
var uglifyPath = path.join(vendorPath, 'uglifyjs', 'tools', 'node.js');
|
||||||
|
|
||||||
|
/** The Closure Compiler command-line options */
|
||||||
|
var closureOptions = ['--warning_level=QUIET'];
|
||||||
|
|
||||||
|
/** The media type for raw blob data */
|
||||||
|
var mediaType = 'application/vnd.github.v3.raw';
|
||||||
|
|
||||||
|
/** Used to detect the Node.js executable in command-line arguments */
|
||||||
|
var reNode = RegExp('(?:^|' + path.sepEscaped + ')node(?:\\.exe)?$');
|
||||||
|
|
||||||
|
/** Used to reference parts of the blob href */
|
||||||
|
var location = (function() {
|
||||||
|
var host = 'api.github.com',
|
||||||
|
origin = 'https://api.github.com',
|
||||||
|
pathname = '/repos/bestiejs/lodash/git/blobs';
|
||||||
|
|
||||||
|
return {
|
||||||
|
'host': host,
|
||||||
|
'href': origin + pathname,
|
||||||
|
'origin': origin,
|
||||||
|
'pathname': pathname
|
||||||
|
};
|
||||||
|
}());
|
||||||
|
|
||||||
|
/** The Closure Compiler optimization modes */
|
||||||
|
var optimizationModes = {
|
||||||
|
'simple': 'SIMPLE_OPTIMIZATIONS',
|
||||||
|
'advanced': 'ADVANCED_OPTIMIZATIONS'
|
||||||
|
};
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Minifies a given Lo-Dash `source` and invokes the `options.onComplete`
|
||||||
|
* callback when finished. The `onComplete` callback is invoked with one
|
||||||
|
* argument; (outputSource).
|
||||||
|
*
|
||||||
|
* @param {Array|String} [source=''] The source to minify or array of commands.
|
||||||
|
* -o, --output - Write output to a given path/filename.
|
||||||
|
* -s, --silent - Skip status updates normally logged to the console.
|
||||||
|
* -t, --template - Applies template specific minifier options.
|
||||||
|
*
|
||||||
|
* @param {Object} [options={}] The options object.
|
||||||
|
* outputPath - Write output to a given path/filename.
|
||||||
|
* isSilent - Skip status updates normally logged to the console.
|
||||||
|
* isTemplate - Applies template specific minifier options.
|
||||||
|
* onComplete - The function called once minification has finished.
|
||||||
|
*/
|
||||||
|
function minify(source, options) {
|
||||||
|
// used to specify the source map URL
|
||||||
|
var sourceMapURL;
|
||||||
|
|
||||||
|
// used to specify the default minifer modes
|
||||||
|
var modes = ['simple', 'advanced', 'hybrid'];
|
||||||
|
|
||||||
|
source || (source = '');
|
||||||
|
options || (options = {});
|
||||||
|
|
||||||
|
// juggle arguments
|
||||||
|
if (Array.isArray(source)) {
|
||||||
|
// convert commands to an options object
|
||||||
|
options = source;
|
||||||
|
|
||||||
|
// used to report invalid command-line arguments
|
||||||
|
var invalidArgs = _.reject(options.slice(reNode.test(options[0]) ? 2 : 0), function(value, index, options) {
|
||||||
|
if (/^(?:-o|--output)$/.test(options[index - 1]) ||
|
||||||
|
/^modes=.*$/.test(value)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
var result = [
|
||||||
|
'-o', '--output',
|
||||||
|
'-p', '--source-map',
|
||||||
|
'-s', '--silent',
|
||||||
|
'-t', '--template'
|
||||||
|
].indexOf(value) > -1;
|
||||||
|
|
||||||
|
if (!result && /^(?:-p|--source-map)$/.test(options[index - 1])) {
|
||||||
|
result = true;
|
||||||
|
sourceMapURL = value;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
});
|
||||||
|
|
||||||
|
// report invalid arguments
|
||||||
|
if (invalidArgs.length) {
|
||||||
|
console.log(
|
||||||
|
'\n' +
|
||||||
|
'Invalid argument' + (invalidArgs.length > 1 ? 's' : '') +
|
||||||
|
' passed: ' + invalidArgs.join(', ')
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var filePath = options[options.length - 1],
|
||||||
|
isMapped = _.contains(options, '-p') || _.contains(options, '--source-map'),
|
||||||
|
isSilent = _.contains(options, '-s') || _.contains(options, '--silent'),
|
||||||
|
isTemplate = _.contains(options, '-t') || _.contains(options, '--template'),
|
||||||
|
outputPath = path.join(path.dirname(filePath), path.basename(filePath, '.js') + '.min.js');
|
||||||
|
|
||||||
|
modes = options.reduce(function(result, value) {
|
||||||
|
var match = value.match(/modes=(.*)$/);
|
||||||
|
return match ? match[1].split(/, */) : result;
|
||||||
|
}, modes);
|
||||||
|
|
||||||
|
outputPath = options.reduce(function(result, value, index) {
|
||||||
|
if (/-o|--output/.test(value)) {
|
||||||
|
result = options[index + 1];
|
||||||
|
var dirname = path.dirname(result);
|
||||||
|
fs.mkdirpSync(dirname);
|
||||||
|
result = path.join(fs.realpathSync(dirname), path.basename(result));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}, outputPath);
|
||||||
|
|
||||||
|
options = {
|
||||||
|
'filePath': filePath,
|
||||||
|
'isMapped': isMapped,
|
||||||
|
'isSilent': isSilent,
|
||||||
|
'isTemplate': isTemplate,
|
||||||
|
'modes': modes,
|
||||||
|
'outputPath': outputPath,
|
||||||
|
'sourceMapURL': sourceMapURL
|
||||||
|
};
|
||||||
|
|
||||||
|
source = fs.readFileSync(filePath, 'utf8');
|
||||||
|
}
|
||||||
|
|
||||||
|
modes = options.modes || modes;
|
||||||
|
if (options.isMapped) {
|
||||||
|
modes = modes.filter(function(mode) {
|
||||||
|
return mode != 'hybrid';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (options.isTemplate) {
|
||||||
|
modes = modes.filter(function(mode) {
|
||||||
|
return mode != 'advanced';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
options.modes = modes;
|
||||||
|
|
||||||
|
// fetch the Closure Compiler
|
||||||
|
getDependency({
|
||||||
|
'id': 'closure-compiler',
|
||||||
|
'hashId': closureId,
|
||||||
|
'path': vendorPath,
|
||||||
|
'title': 'the Closure Compiler',
|
||||||
|
'onComplete': function(exception) {
|
||||||
|
var error = exception;
|
||||||
|
|
||||||
|
// fetch UglifyJS
|
||||||
|
getDependency({
|
||||||
|
'id': 'uglifyjs',
|
||||||
|
'hashId': uglifyId,
|
||||||
|
'title': 'UglifyJS',
|
||||||
|
'path': vendorPath,
|
||||||
|
'onComplete': function(exception) {
|
||||||
|
error || (error = exception);
|
||||||
|
if (!error) {
|
||||||
|
new Minify(source, options);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Minify constructor used to keep state of each `minify` invocation.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @constructor
|
||||||
|
* @param {String} source The source to minify.
|
||||||
|
* @param {Object} options The options object.
|
||||||
|
* outputPath - Write output to a given path/filename.
|
||||||
|
* isSilent - Skip status updates normally logged to the console.
|
||||||
|
* isTemplate - Applies template specific minifier options.
|
||||||
|
* onComplete - The function called once minification has finished.
|
||||||
|
*/
|
||||||
|
function Minify(source, options) {
|
||||||
|
// juggle arguments
|
||||||
|
if (typeof source == 'object' && source) {
|
||||||
|
options = source || options;
|
||||||
|
source = options.source || '';
|
||||||
|
}
|
||||||
|
this.compiled = { 'simple': {}, 'advanced': {} };
|
||||||
|
this.hybrid = { 'simple': {}, 'advanced': {} };
|
||||||
|
this.uglified = {};
|
||||||
|
|
||||||
|
this.filePath = options.filePath;
|
||||||
|
this.isMapped = !!options.isMapped;
|
||||||
|
this.isSilent = !!options.isSilent;
|
||||||
|
this.isTemplate = !!options.isTemplate;
|
||||||
|
this.outputPath = options.outputPath;
|
||||||
|
this.sourceMapURL = options.sourceMapURL;
|
||||||
|
|
||||||
|
var modes = this.modes = options.modes;
|
||||||
|
source = this.source = preprocess(source, options);
|
||||||
|
|
||||||
|
this.onComplete = options.onComplete || function(data) {
|
||||||
|
var outputPath = this.outputPath,
|
||||||
|
sourceMap = data.sourceMap;
|
||||||
|
|
||||||
|
fs.writeFileSync(outputPath, data.source, 'utf8');
|
||||||
|
if (sourceMap) {
|
||||||
|
fs.writeFileSync(getMapPath(outputPath), sourceMap, 'utf8');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// begin the minification process
|
||||||
|
if (_.contains(modes, 'simple')) {
|
||||||
|
closureCompile.call(this, source, 'simple', onClosureSimpleCompile.bind(this));
|
||||||
|
} else if (_.contains(modes, 'advanced')) {
|
||||||
|
onClosureSimpleGzip.call(this);
|
||||||
|
} else {
|
||||||
|
onClosureAdvancedGzip.call(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetches a required `.tar.gz` dependency with the given Git object ID from
|
||||||
|
* the Lo-Dash repo on GitHub. The object ID may be obtained by running
|
||||||
|
* `git hash-object path/to/dependency.tar.gz`.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Object} options The options object.
|
||||||
|
* id - The Git object ID of the `.tar.gz` file.
|
||||||
|
* onComplete - The function called once the extraction has finished.
|
||||||
|
* path - The path of the extraction directory.
|
||||||
|
* title - The dependency's title used in status updates logged to the console.
|
||||||
|
*/
|
||||||
|
function getDependency(options) {
|
||||||
|
options || (options = {});
|
||||||
|
|
||||||
|
var ran,
|
||||||
|
destPath = options.path,
|
||||||
|
hashId = options.hashId,
|
||||||
|
id = options.id,
|
||||||
|
onComplete = options.onComplete,
|
||||||
|
title = options.title;
|
||||||
|
|
||||||
|
// exit early if dependency exists
|
||||||
|
if (fs.existsSync(path.join(destPath, id))) {
|
||||||
|
onComplete();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var callback = function(exception) {
|
||||||
|
if (ran) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (exception) {
|
||||||
|
console.error([
|
||||||
|
'There was a problem installing ' + title + '.',
|
||||||
|
'Try running the command as root, via `sudo`, or manually install by running:',
|
||||||
|
'',
|
||||||
|
"curl -H 'Accept: " + mediaType + "' " + location.href + '/' + hashId + " | tar xvz -C '" + destPath + "'",
|
||||||
|
''
|
||||||
|
].join('\n'));
|
||||||
|
}
|
||||||
|
ran = true;
|
||||||
|
process.removeListener('uncaughtException', callback);
|
||||||
|
onComplete(exception);
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log('Downloading ' + title + '...');
|
||||||
|
process.on('uncaughtException', callback);
|
||||||
|
|
||||||
|
https.get({
|
||||||
|
'host': location.host,
|
||||||
|
'path': location.pathname + '/' + hashId,
|
||||||
|
'headers': {
|
||||||
|
// By default, all GitHub blob API endpoints return a JSON document
|
||||||
|
// containing Base64-encoded blob data. Overriding the `Accept` header
|
||||||
|
// with the GitHub raw media type returns the blob data directly.
|
||||||
|
// See http://developer.github.com/v3/media/.
|
||||||
|
'Accept': mediaType,
|
||||||
|
// As of 2013-04-24, the GitHub API mandates the `User-Agent` header
|
||||||
|
// for all requests.
|
||||||
|
'User-Agent': 'Lo-Dash/' + _.VERSION
|
||||||
|
}
|
||||||
|
}, function(response) {
|
||||||
|
var decompressor = zlib.createUnzip(),
|
||||||
|
parser = new tar.Extract({ 'path': destPath });
|
||||||
|
|
||||||
|
parser.on('end', callback);
|
||||||
|
response.pipe(decompressor).pipe(parser);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the Java command-line options used for faster minification by
|
||||||
|
* the Closure Compiler, invoking the `callback` when finished. Subsequent
|
||||||
|
* calls will lazily return the previously retrieved options. The `callback`
|
||||||
|
* is invoked with one argument; (options).
|
||||||
|
*
|
||||||
|
* See https://code.google.com/p/closure-compiler/wiki/FAQ#What_are_the_recommended_Java_VM_command-line_options?.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Function} callback The function called once the options have been retrieved.
|
||||||
|
*/
|
||||||
|
function getJavaOptions(callback) {
|
||||||
|
var result = [];
|
||||||
|
cp.exec('java -version -client -d32', function(error) {
|
||||||
|
if (!error && process.platform != 'win32') {
|
||||||
|
result.push('-client', '-d32');
|
||||||
|
}
|
||||||
|
getJavaOptions = function(callback) {
|
||||||
|
_.defer(callback, result);
|
||||||
|
};
|
||||||
|
callback(result);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resolves the source map path from the given output path.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {String} outputPath The output path.
|
||||||
|
* @returns {String} Returns the source map path.
|
||||||
|
*/
|
||||||
|
function getMapPath(outputPath) {
|
||||||
|
return path.join(path.dirname(outputPath), path.basename(outputPath, '.js') + '.map');
|
||||||
|
}
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compresses a `source` string using the Closure Compiler. Yields the
|
||||||
|
* minified result, and any exceptions encountered, to a `callback` function.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {String} source The JavaScript source to minify.
|
||||||
|
* @param {String} mode The optimization mode.
|
||||||
|
* @param {Function} callback The function called once the process has completed.
|
||||||
|
*/
|
||||||
|
function closureCompile(source, mode, callback) {
|
||||||
|
var filePath = this.filePath,
|
||||||
|
isAdvanced = mode == 'advanced',
|
||||||
|
isMapped = this.isMapped,
|
||||||
|
isSilent = this.isSilent,
|
||||||
|
isTemplate = this.isTemplate,
|
||||||
|
options = closureOptions.slice(),
|
||||||
|
outputPath = this.outputPath,
|
||||||
|
mapPath = getMapPath(outputPath),
|
||||||
|
sourceMapURL = this.sourceMapURL || path.basename(mapPath);
|
||||||
|
|
||||||
|
// remove copyright header to make other modifications easier
|
||||||
|
var license = (/^(?:\s*\/\/.*\s*|\s*\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/\s*)*/.exec(source) || [''])[0];
|
||||||
|
if (license) {
|
||||||
|
source = source.replace(license, '');
|
||||||
|
}
|
||||||
|
|
||||||
|
var hasIIFE = /^;?\(function[^{]+{/.test(source),
|
||||||
|
isStrict = hasIIFE && /^;?\(function[^{]+{\s*["']use strict["']/.test(source);
|
||||||
|
|
||||||
|
// to avoid stripping the IIFE, convert it to a function call
|
||||||
|
if (hasIIFE && isAdvanced) {
|
||||||
|
source = source
|
||||||
|
.replace(/\(function/, '__iife__$&')
|
||||||
|
.replace(/\(this\)\)([\s;]*(\n\/\/.+)?)$/, ', this)$1');
|
||||||
|
}
|
||||||
|
|
||||||
|
options.push('--compilation_level=' + optimizationModes[mode]);
|
||||||
|
if (isMapped) {
|
||||||
|
options.push('--create_source_map=' + mapPath, '--source_map_format=V3');
|
||||||
|
}
|
||||||
|
if (isTemplate) {
|
||||||
|
options.push('--charset=UTF-8');
|
||||||
|
}
|
||||||
|
|
||||||
|
getJavaOptions(function(javaOptions) {
|
||||||
|
var compiler = cp.spawn('java', javaOptions.concat('-jar', closurePath, options));
|
||||||
|
if (!isSilent) {
|
||||||
|
console.log('Compressing ' + path.basename(outputPath, '.js') + ' using the Closure Compiler (' + mode + ')...');
|
||||||
|
}
|
||||||
|
|
||||||
|
var error = '';
|
||||||
|
compiler.stderr.on('data', function(data) {
|
||||||
|
error += data;
|
||||||
|
});
|
||||||
|
|
||||||
|
var output = '';
|
||||||
|
compiler.stdout.on('data', function(data) {
|
||||||
|
output += data;
|
||||||
|
});
|
||||||
|
|
||||||
|
compiler.on('exit', function(status) {
|
||||||
|
// `status` contains the process exit code
|
||||||
|
if (status) {
|
||||||
|
var exception = new Error(error);
|
||||||
|
exception.status = status;
|
||||||
|
}
|
||||||
|
// restore IIFE and move exposed vars inside the IIFE
|
||||||
|
if (hasIIFE && isAdvanced) {
|
||||||
|
output = output
|
||||||
|
.replace(/__iife__\(/, '(')
|
||||||
|
.replace(/,\s*this\)([\s;]*(\n\/\/.+)?)$/, '(this))$1')
|
||||||
|
.replace(/^((?:var (?:\w+=(?:!0|!1|null)[,;])+)?)([\s\S]*?function[^{]+{)/, '$2$1');
|
||||||
|
}
|
||||||
|
// inject "use strict" directive
|
||||||
|
if (isStrict) {
|
||||||
|
output = output.replace(/^[\s\S]*?function[^{]+{/, '$&"use strict";');
|
||||||
|
}
|
||||||
|
// restore copyright header
|
||||||
|
if (license) {
|
||||||
|
output = license + output;
|
||||||
|
}
|
||||||
|
if (isMapped) {
|
||||||
|
var mapOutput = fs.readFileSync(mapPath, 'utf8');
|
||||||
|
fs.unlinkSync(mapPath);
|
||||||
|
output = output.replace(/[\s;]*$/, '\n/*\n//@ sourceMappingURL=' + sourceMapURL) + '\n*/';
|
||||||
|
|
||||||
|
mapOutput = JSON.parse(mapOutput);
|
||||||
|
mapOutput.file = path.basename(outputPath);
|
||||||
|
mapOutput.sources = [path.basename(filePath)];
|
||||||
|
mapOutput = JSON.stringify(mapOutput, null, 2);
|
||||||
|
}
|
||||||
|
callback(exception, output, mapOutput);
|
||||||
|
});
|
||||||
|
|
||||||
|
// proxy the standard input to the Closure Compiler
|
||||||
|
compiler.stdin.end(source);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compresses a `source` string using UglifyJS. Yields the result to a
|
||||||
|
* `callback` function. This function is synchronous; the `callback` is used
|
||||||
|
* for symmetry.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {String} source The JavaScript source to minify.
|
||||||
|
* @param {String} label The label to log.
|
||||||
|
* @param {Function} callback The function called once the process has completed.
|
||||||
|
*/
|
||||||
|
function uglify(source, label, callback) {
|
||||||
|
if (!this.isSilent) {
|
||||||
|
console.log('Compressing ' + path.basename(this.outputPath, '.js') + ' using ' + label + '...');
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
var uglifyJS = require(uglifyPath);
|
||||||
|
|
||||||
|
// 1. parse
|
||||||
|
var toplevel = uglifyJS.parse(source);
|
||||||
|
|
||||||
|
// 2. compress
|
||||||
|
// enable unsafe comparisons
|
||||||
|
toplevel.figure_out_scope();
|
||||||
|
toplevel = toplevel.transform(uglifyJS.Compressor({
|
||||||
|
'comparisons': false,
|
||||||
|
'unsafe': true,
|
||||||
|
'unsafe_comps': true,
|
||||||
|
'warnings': false
|
||||||
|
}));
|
||||||
|
|
||||||
|
// 3. mangle
|
||||||
|
// excluding the `define` function exposed by AMD loaders
|
||||||
|
toplevel.figure_out_scope();
|
||||||
|
toplevel.compute_char_frequency();
|
||||||
|
toplevel.mangle_names({
|
||||||
|
'except': ['define']
|
||||||
|
});
|
||||||
|
|
||||||
|
// 4. output
|
||||||
|
// restrict lines to 500 characters for consistency with the Closure Compiler
|
||||||
|
var stream = uglifyJS.OutputStream({
|
||||||
|
'ascii_only': !this.isTemplate,
|
||||||
|
'comments': /@cc_on|@license|@preserve/i,
|
||||||
|
'max_line_len': 500,
|
||||||
|
});
|
||||||
|
|
||||||
|
toplevel.print(stream);
|
||||||
|
}
|
||||||
|
catch(e) {
|
||||||
|
var exception = e;
|
||||||
|
}
|
||||||
|
callback(exception, stream && String(stream));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Closure Compiler callback for simple optimizations.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Object|Undefined} exception The error object.
|
||||||
|
* @param {String} result The resulting minified source.
|
||||||
|
* @param {String} map The source map output.
|
||||||
|
*/
|
||||||
|
function onClosureSimpleCompile(exception, result, map) {
|
||||||
|
if (exception) {
|
||||||
|
throw exception;
|
||||||
|
}
|
||||||
|
result = postprocess(result);
|
||||||
|
|
||||||
|
var simple = this.compiled.simple;
|
||||||
|
simple.source = result;
|
||||||
|
simple.sourceMap = map;
|
||||||
|
zlib.gzip(result, onClosureSimpleGzip.bind(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Closure Compiler `gzip` callback for simple optimizations.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Object|Undefined} exception The error object.
|
||||||
|
* @param {Buffer} result The resulting gzipped source.
|
||||||
|
*/
|
||||||
|
function onClosureSimpleGzip(exception, result) {
|
||||||
|
if (exception) {
|
||||||
|
throw exception;
|
||||||
|
}
|
||||||
|
if (result != null) {
|
||||||
|
if (!this.isSilent) {
|
||||||
|
console.log('Done. Size: %d bytes.', result.length);
|
||||||
|
}
|
||||||
|
this.compiled.simple.gzip = result;
|
||||||
|
}
|
||||||
|
// compile the source using advanced optimizations
|
||||||
|
if (_.contains(this.modes, 'advanced')) {
|
||||||
|
closureCompile.call(this, this.source, 'advanced', onClosureAdvancedCompile.bind(this));
|
||||||
|
} else {
|
||||||
|
onClosureAdvancedGzip.call(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Closure Compiler callback for advanced optimizations.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Object|Undefined} exception The error object.
|
||||||
|
* @param {String} result The resulting minified source.
|
||||||
|
* @param {String} map The source map output.
|
||||||
|
*/
|
||||||
|
function onClosureAdvancedCompile(exception, result, map) {
|
||||||
|
if (exception) {
|
||||||
|
throw exception;
|
||||||
|
}
|
||||||
|
result = postprocess(result);
|
||||||
|
|
||||||
|
var advanced = this.compiled.advanced;
|
||||||
|
advanced.source = result;
|
||||||
|
advanced.sourceMap = map;
|
||||||
|
zlib.gzip(result, onClosureAdvancedGzip.bind(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Closure Compiler `gzip` callback for advanced optimizations.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Object|Undefined} exception The error object.
|
||||||
|
* @param {Buffer} result The resulting gzipped source.
|
||||||
|
*/
|
||||||
|
function onClosureAdvancedGzip(exception, result) {
|
||||||
|
if (exception) {
|
||||||
|
throw exception;
|
||||||
|
}
|
||||||
|
if (result != null) {
|
||||||
|
if (!this.isSilent) {
|
||||||
|
console.log('Done. Size: %d bytes.', result.length);
|
||||||
|
}
|
||||||
|
this.compiled.advanced.gzip = result;
|
||||||
|
}
|
||||||
|
// minify the source using UglifyJS
|
||||||
|
if (!this.isMapped) {
|
||||||
|
uglify.call(this, this.source, 'UglifyJS', onUglify.bind(this));
|
||||||
|
} else {
|
||||||
|
onComplete.call(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The UglifyJS callback.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Object|Undefined} exception The error object.
|
||||||
|
* @param {String} result The resulting minified source.
|
||||||
|
*/
|
||||||
|
function onUglify(exception, result) {
|
||||||
|
if (exception) {
|
||||||
|
throw exception;
|
||||||
|
}
|
||||||
|
result = postprocess(result);
|
||||||
|
this.uglified.source = result;
|
||||||
|
zlib.gzip(result, onUglifyGzip.bind(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The UglifyJS `gzip` callback.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Object|Undefined} exception The error object.
|
||||||
|
* @param {Buffer} result The resulting gzipped source.
|
||||||
|
*/
|
||||||
|
function onUglifyGzip(exception, result) {
|
||||||
|
if (exception) {
|
||||||
|
throw exception;
|
||||||
|
}
|
||||||
|
if (result != null) {
|
||||||
|
if (!this.isSilent) {
|
||||||
|
console.log('Done. Size: %d bytes.', result.length);
|
||||||
|
}
|
||||||
|
this.uglified.gzip = result;
|
||||||
|
}
|
||||||
|
// minify the already Closure Compiler simple optimized source using UglifyJS
|
||||||
|
var modes = this.modes;
|
||||||
|
if (_.contains(modes, 'hybrid')) {
|
||||||
|
if (_.contains(modes, 'simple')) {
|
||||||
|
uglify.call(this, this.compiled.simple.source, 'hybrid (simple)', onSimpleHybrid.bind(this));
|
||||||
|
} else if (_.contains(modes, 'advanced')) {
|
||||||
|
onSimpleHybridGzip.call(this);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
onComplete.call(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The hybrid callback for simple optimizations.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Object|Undefined} exception The error object.
|
||||||
|
* @param {String} result The resulting minified source.
|
||||||
|
*/
|
||||||
|
function onSimpleHybrid(exception, result) {
|
||||||
|
if (exception) {
|
||||||
|
throw exception;
|
||||||
|
}
|
||||||
|
result = postprocess(result);
|
||||||
|
this.hybrid.simple.source = result;
|
||||||
|
zlib.gzip(result, onSimpleHybridGzip.bind(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The hybrid `gzip` callback for simple optimizations.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Object|Undefined} exception The error object.
|
||||||
|
* @param {Buffer} result The resulting gzipped source.
|
||||||
|
*/
|
||||||
|
function onSimpleHybridGzip(exception, result) {
|
||||||
|
if (exception) {
|
||||||
|
throw exception;
|
||||||
|
}
|
||||||
|
if (result != null) {
|
||||||
|
if (!this.isSilent) {
|
||||||
|
console.log('Done. Size: %d bytes.', result.length);
|
||||||
|
}
|
||||||
|
this.hybrid.simple.gzip = result;
|
||||||
|
}
|
||||||
|
// minify the already Closure Compiler advance optimized source using UglifyJS
|
||||||
|
if (_.contains(this.modes, 'advanced')) {
|
||||||
|
uglify.call(this, this.compiled.advanced.source, 'hybrid (advanced)', onAdvancedHybrid.bind(this));
|
||||||
|
} else {
|
||||||
|
onComplete.call(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The hybrid callback for advanced optimizations.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Object|Undefined} exception The error object.
|
||||||
|
* @param {String} result The resulting minified source.
|
||||||
|
*/
|
||||||
|
function onAdvancedHybrid(exception, result) {
|
||||||
|
if (exception) {
|
||||||
|
throw exception;
|
||||||
|
}
|
||||||
|
result = postprocess(result);
|
||||||
|
this.hybrid.advanced.source = result;
|
||||||
|
zlib.gzip(result, onAdvancedHybridGzip.bind(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The hybrid `gzip` callback for advanced optimizations.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Object|Undefined} exception The error object.
|
||||||
|
* @param {Buffer} result The resulting gzipped source.
|
||||||
|
*/
|
||||||
|
function onAdvancedHybridGzip(exception, result) {
|
||||||
|
if (exception) {
|
||||||
|
throw exception;
|
||||||
|
}
|
||||||
|
if (result != null) {
|
||||||
|
if (!this.isSilent) {
|
||||||
|
console.log('Done. Size: %d bytes.', result.length);
|
||||||
|
}
|
||||||
|
this.hybrid.advanced.gzip = result;
|
||||||
|
}
|
||||||
|
// finish by choosing the smallest compressed file
|
||||||
|
onComplete.call(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The callback executed after the source is minified and gzipped.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
function onComplete() {
|
||||||
|
var compiledSimple = this.compiled.simple,
|
||||||
|
compiledAdvanced = this.compiled.advanced,
|
||||||
|
uglified = this.uglified,
|
||||||
|
hybridSimple = this.hybrid.simple,
|
||||||
|
hybridAdvanced = this.hybrid.advanced;
|
||||||
|
|
||||||
|
var objects = [
|
||||||
|
compiledSimple,
|
||||||
|
compiledAdvanced,
|
||||||
|
uglified,
|
||||||
|
hybridSimple,
|
||||||
|
hybridAdvanced
|
||||||
|
];
|
||||||
|
|
||||||
|
var gzips = objects
|
||||||
|
.map(function(data) { return data.gzip; })
|
||||||
|
.filter(Boolean);
|
||||||
|
|
||||||
|
// select the smallest gzipped file and use its minified counterpart as the
|
||||||
|
// official minified release (ties go to the Closure Compiler)
|
||||||
|
var min = gzips.reduce(function(min, gzip) {
|
||||||
|
var length = gzip.length;
|
||||||
|
return min > length ? length : min;
|
||||||
|
}, Infinity);
|
||||||
|
|
||||||
|
// pass the minified source to the "onComplete" callback
|
||||||
|
objects.some(function(data) {
|
||||||
|
var gzip = data.gzip;
|
||||||
|
if (gzip && gzip.length == min) {
|
||||||
|
data.outputPath = this.outputPath;
|
||||||
|
this.onComplete(data);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
// expose `minify`
|
||||||
|
if (module != require.main) {
|
||||||
|
module.exports = minify;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// read the Lo-Dash source file from the first argument if the script
|
||||||
|
// was invoked directly (e.g. `node minify.js source.js`) and write to
|
||||||
|
// `<filename>.min.js`
|
||||||
|
(function() {
|
||||||
|
var options = process.argv;
|
||||||
|
if (options.length < 3) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
minify(options);
|
||||||
|
}());
|
||||||
|
}
|
||||||
|
}());
|
||||||
@@ -2,35 +2,96 @@
|
|||||||
;(function() {
|
;(function() {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
/** The Node filesystem module */
|
/** Load Node.js modules */
|
||||||
var fs = require('fs');
|
var fs = require('fs'),
|
||||||
|
vm = require('vm');
|
||||||
|
|
||||||
/** The minimal license/copyright template */
|
/** The minimal license/copyright template */
|
||||||
var licenseTemplate =
|
var licenseTemplate = [
|
||||||
'/*!\n' +
|
'/**',
|
||||||
' Lo-Dash @VERSION github.com/bestiejs/lodash/blob/master/LICENSE.txt\n' +
|
' * @license',
|
||||||
' Underscore.js 1.3.3 github.com/documentcloud/underscore/blob/master/LICENSE\n' +
|
' * Lo-Dash <%= VERSION %> lodash.com/license',
|
||||||
'*/';
|
' * Underscore.js 1.4.4 underscorejs.org/LICENSE',
|
||||||
|
' */'
|
||||||
|
].join('\n');
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Post-process a given minified JavaScript `source`, preparing it for
|
* Post-process a given minified Lo-Dash `source`, preparing it for
|
||||||
* deployment.
|
* deployment.
|
||||||
*
|
*
|
||||||
* @private
|
|
||||||
* @param {String} source The source to process.
|
* @param {String} source The source to process.
|
||||||
* @returns {String} Returns the processed source.
|
* @returns {String} Returns the processed source.
|
||||||
*/
|
*/
|
||||||
function postprocess(source) {
|
function postprocess(source) {
|
||||||
// set the version
|
// correct overly aggressive Closure Compiler advanced optimization
|
||||||
var license = licenseTemplate.replace('@VERSION', (/VERSION:([\'"])(.*?)\1/).exec(source).pop());
|
source = source
|
||||||
// move vars exposed by Closure Compiler into the IIFE
|
.replace(/(document[^&]+&&)\s*(?:\w+|!\d)/, '$1!({toString:0}+"")')
|
||||||
source = source.replace(/^([^(\n]+)\s*(\(function[^)]+\){)/, '$2$1');
|
.replace(/"\t"/g, '"\\t"')
|
||||||
// use double quotes consistently
|
.replace(/"[^"]*?\\f[^"]*?"/g,
|
||||||
source = source.replace(/'use strict'/, '"use strict"');
|
'" \\t\\x0B\\f\\xa0\\ufeff' +
|
||||||
// add license
|
'\\n\\r\\u2028\\u2029' +
|
||||||
return license + '\n;' + source;
|
'\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000"'
|
||||||
|
);
|
||||||
|
|
||||||
|
try {
|
||||||
|
var context = vm.createContext({});
|
||||||
|
vm.runInContext(source, context);
|
||||||
|
} catch(e) { }
|
||||||
|
|
||||||
|
['forEach', 'forIn', 'forOwn'].forEach(function(methodName) {
|
||||||
|
var pairs = /[!=]==\s*([a-zA-Z]+)(?!\()|([a-zA-Z]+)\s*[!=]==/.exec((context._ || {})[methodName]),
|
||||||
|
varName = pairs && (pairs[1] || pairs[2]),
|
||||||
|
value = (value = varName && RegExp('\\b' + varName + '\\s*=\\s*!([01])\\b').exec(source)) && !+value[1];
|
||||||
|
|
||||||
|
if (typeof value == 'boolean') {
|
||||||
|
// replace vars for `false` and `true` with boolean literals
|
||||||
|
source = source.replace(RegExp('([!=]==\\s*)' + varName + '\\b(?!\\()|\\b' + varName + '(\\s*[!=]==)', 'g'), function(match, prelude, postlude, at) {
|
||||||
|
// avoid replacing local variables with the same name
|
||||||
|
return RegExp('\\b' + varName + '\\s*(?:,|=[^=])').test(source.slice(at - 10, at))
|
||||||
|
? match
|
||||||
|
: (prelude || '') + value + (postlude || '');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// replace `!1` and `!0` in expressions with `false` and `true` values
|
||||||
|
[/([!=]==)\s*!1\b|(.)!1\s*([!=]==)/g, /([!=]==)\s*!0\b|(.)!0\s*([!=]==)/g].forEach(function(regexp, index) {
|
||||||
|
source = source.replace(regexp, function(match, prelude, chr, postlude) {
|
||||||
|
return (prelude || chr + (/\w/.test(chr) ? ' ' : '')) + !!index + (postlude || '');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// flip `typeof` expressions to help optimize Safari and
|
||||||
|
// correct the AMD module definition for AMD build optimizers
|
||||||
|
// (e.g. from `"number" == typeof x` to `typeof x == "number")
|
||||||
|
source = source.replace(/(\w)?("[^"]+")\s*([!=]=)\s*(typeof(?:\s*\([^)]+\)|\s+[.\w]+(?!\[)))/g, function(match, other, type, equality, expression) {
|
||||||
|
return (other ? other + ' ' : '') + expression + equality + type;
|
||||||
|
});
|
||||||
|
|
||||||
|
// add a space so `define` is detected by the Dojo builder
|
||||||
|
source = source.replace(/(.)(define\()/, function(match, prelude, define) {
|
||||||
|
return prelude + (/^\S/.test(prelude) ? ' ' : '') + define;
|
||||||
|
});
|
||||||
|
|
||||||
|
// add trailing semicolon
|
||||||
|
if (source) {
|
||||||
|
source = source.replace(/[\s;]*?(\s*\/\/.*\s*|\s*\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/\s*)*$/, ';$1');
|
||||||
|
}
|
||||||
|
// exit early if version snippet isn't found
|
||||||
|
var snippet = /VERSION\s*[=:]\s*([\'"])(.*?)\1/.exec(source);
|
||||||
|
if (!snippet) {
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
// remove copyright header
|
||||||
|
source = source.replace(/^\/\**[\s\S]+?\*\/\n/, '');
|
||||||
|
|
||||||
|
// add new copyright header
|
||||||
|
var version = snippet[2];
|
||||||
|
source = licenseTemplate.replace('<%= VERSION %>', version) + '\n;' + source;
|
||||||
|
|
||||||
|
return source;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
@@ -38,13 +99,20 @@
|
|||||||
// expose `postprocess`
|
// expose `postprocess`
|
||||||
if (module != require.main) {
|
if (module != require.main) {
|
||||||
module.exports = postprocess;
|
module.exports = postprocess;
|
||||||
} else {
|
}
|
||||||
// read the JavaScript source file from the first argument if the script
|
else {
|
||||||
|
// read the Lo-Dash source file from the first argument if the script
|
||||||
// was invoked directly (e.g. `node post-compile.js source.js`) and write to
|
// was invoked directly (e.g. `node post-compile.js source.js`) and write to
|
||||||
// the same file
|
// the same file
|
||||||
(function() {
|
(function() {
|
||||||
var source = fs.readFileSync(process.argv[2], 'utf8');
|
var options = process.argv;
|
||||||
fs.writeFileSync(process.argv[2], postprocess(source), 'utf8');
|
if (options.length < 3) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var filePath = options[options.length - 1],
|
||||||
|
source = fs.readFileSync(filePath, 'utf8');
|
||||||
|
|
||||||
|
fs.writeFileSync(filePath, postprocess(source), 'utf8');
|
||||||
}());
|
}());
|
||||||
}
|
}
|
||||||
}());
|
}());
|
||||||
|
|||||||
@@ -2,192 +2,445 @@
|
|||||||
;(function() {
|
;(function() {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
/** The Node filesystem module */
|
/** The Node.js filesystem module */
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
|
|
||||||
/** Used to minify string values embedded in compiled strings */
|
|
||||||
var compiledValues = [
|
|
||||||
'arrays',
|
|
||||||
'objects'
|
|
||||||
];
|
|
||||||
|
|
||||||
/** Used to minify variables embedded in compiled strings */
|
/** Used to minify variables embedded in compiled strings */
|
||||||
var compiledVars = [
|
var compiledVars = [
|
||||||
'accumulator',
|
'args',
|
||||||
'array',
|
'argsIndex',
|
||||||
'arrayClass',
|
'argsLength',
|
||||||
'bind',
|
|
||||||
'callback',
|
'callback',
|
||||||
'className',
|
'className',
|
||||||
'collection',
|
'collection',
|
||||||
'computed',
|
'conditions',
|
||||||
'concat',
|
'ctor',
|
||||||
'current',
|
'errorClass',
|
||||||
'false',
|
'errorProto',
|
||||||
'funcClass',
|
'guard',
|
||||||
'hasOwnProperty',
|
'hasOwnProperty',
|
||||||
'identity',
|
|
||||||
'index',
|
'index',
|
||||||
'indexOf',
|
'isArguments',
|
||||||
'Infinity',
|
|
||||||
'initial',
|
|
||||||
'isArray',
|
'isArray',
|
||||||
'isEmpty',
|
'isProto',
|
||||||
|
'isString',
|
||||||
|
'iterable',
|
||||||
'length',
|
'length',
|
||||||
|
'keys',
|
||||||
|
'lodash',
|
||||||
|
'nonEnum',
|
||||||
|
'nonEnumProps',
|
||||||
'object',
|
'object',
|
||||||
'Math',
|
'objectProto',
|
||||||
'property',
|
'objectTypes',
|
||||||
|
'ownIndex',
|
||||||
|
'ownProps',
|
||||||
'result',
|
'result',
|
||||||
'slice',
|
'skipErrorProps',
|
||||||
|
'skipProto',
|
||||||
'source',
|
'source',
|
||||||
'stringClass',
|
'stringClass',
|
||||||
'target',
|
'stringProto',
|
||||||
'thisArg',
|
'thisArg',
|
||||||
'toString',
|
'toString'
|
||||||
'true',
|
|
||||||
'undefined',
|
|
||||||
'value',
|
|
||||||
'values'
|
|
||||||
];
|
];
|
||||||
|
|
||||||
/** Used to minify `iterationFactory` option properties */
|
/** Used to minify `iteratorTemplate` data properties */
|
||||||
var iterationFactoryOptions = [
|
var iteratorOptions = [
|
||||||
'afterLoop',
|
|
||||||
'args',
|
'args',
|
||||||
'array',
|
'array',
|
||||||
'beforeLoop',
|
|
||||||
'bottom',
|
'bottom',
|
||||||
'exits',
|
'firstArg',
|
||||||
'inLoop',
|
|
||||||
'init',
|
'init',
|
||||||
'iterate',
|
'loop',
|
||||||
'loopExp',
|
'shadowedProps',
|
||||||
'object',
|
|
||||||
'returns',
|
|
||||||
'top',
|
'top',
|
||||||
'useHas'
|
'useHas',
|
||||||
|
'useKeys'
|
||||||
];
|
];
|
||||||
|
|
||||||
/** Used to minify variables and string values to a single character */
|
/** Used to minify variables and string values to a single character */
|
||||||
var minNames = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');
|
var minNames = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');
|
||||||
|
minNames.push.apply(minNames, minNames.map(function(value) {
|
||||||
|
return value + value;
|
||||||
|
}));
|
||||||
|
|
||||||
/** Used protect the specified properties from getting minified */
|
/** Used to protect the specified properties from getting minified */
|
||||||
var propWhitelist = [
|
var propWhitelist = [
|
||||||
|
'Array',
|
||||||
|
'Boolean',
|
||||||
|
'Date',
|
||||||
|
'Error',
|
||||||
|
'Function',
|
||||||
|
'Math',
|
||||||
|
'Number',
|
||||||
|
'Object',
|
||||||
|
'RegExp',
|
||||||
|
'String',
|
||||||
|
'TypeError',
|
||||||
|
'VERSION',
|
||||||
'_',
|
'_',
|
||||||
|
'__wrapped__',
|
||||||
|
'after',
|
||||||
|
'all',
|
||||||
'amd',
|
'amd',
|
||||||
'chain',
|
'any',
|
||||||
|
'argsClass',
|
||||||
|
'argsObject',
|
||||||
|
'array',
|
||||||
|
'assign',
|
||||||
|
'at',
|
||||||
|
'attachEvent',
|
||||||
|
'bind',
|
||||||
|
'bindAll',
|
||||||
|
'bindKey',
|
||||||
|
'cache',
|
||||||
'clearTimeout',
|
'clearTimeout',
|
||||||
|
'clone',
|
||||||
|
'cloneDeep',
|
||||||
|
'collect',
|
||||||
|
'compact',
|
||||||
|
'compose',
|
||||||
|
'contains',
|
||||||
|
'countBy',
|
||||||
|
'createCallback',
|
||||||
'criteria',
|
'criteria',
|
||||||
|
'debounce',
|
||||||
|
'defaults',
|
||||||
|
'defer',
|
||||||
|
'delay',
|
||||||
|
'detect',
|
||||||
|
'difference',
|
||||||
|
'drop',
|
||||||
|
'each',
|
||||||
|
'enumErrorProps',
|
||||||
|
'enumPrototypes',
|
||||||
|
'environment',
|
||||||
'escape',
|
'escape',
|
||||||
'evaluate',
|
'evaluate',
|
||||||
|
'every',
|
||||||
|
'exports',
|
||||||
|
'extend',
|
||||||
|
'fastBind',
|
||||||
|
'fastKeys',
|
||||||
|
'filter',
|
||||||
|
'find',
|
||||||
|
'findIndex',
|
||||||
|
'findKey',
|
||||||
|
'first',
|
||||||
|
'flatten',
|
||||||
|
'foldl',
|
||||||
|
'foldr',
|
||||||
|
'forEach',
|
||||||
|
'forIn',
|
||||||
|
'forOwn',
|
||||||
|
'function',
|
||||||
|
'functions',
|
||||||
|
'global',
|
||||||
|
'groupBy',
|
||||||
|
'has',
|
||||||
|
'head',
|
||||||
|
'identity',
|
||||||
|
'imports',
|
||||||
|
'include',
|
||||||
|
'index',
|
||||||
|
'indexOf',
|
||||||
|
'initial',
|
||||||
|
'inject',
|
||||||
'interpolate',
|
'interpolate',
|
||||||
|
'intersection',
|
||||||
|
'invert',
|
||||||
|
'invoke',
|
||||||
|
'isArguments',
|
||||||
|
'isArray',
|
||||||
|
'isBoolean',
|
||||||
|
'isDate',
|
||||||
|
'isElement',
|
||||||
|
'isEmpty',
|
||||||
|
'isEqual',
|
||||||
'isEqual',
|
'isEqual',
|
||||||
'isFinite',
|
'isFinite',
|
||||||
'lodash',
|
'isFinite',
|
||||||
|
'isFunction',
|
||||||
|
'isNaN',
|
||||||
|
'isNull',
|
||||||
|
'isNumber',
|
||||||
|
'isObject',
|
||||||
|
'isPlainObject',
|
||||||
|
'isRegExp',
|
||||||
|
'isString',
|
||||||
|
'isUndefined',
|
||||||
|
'keys',
|
||||||
|
'last',
|
||||||
|
'lastIndexOf',
|
||||||
|
'leading',
|
||||||
|
'map',
|
||||||
|
'max',
|
||||||
|
'maxWait',
|
||||||
|
'memoize',
|
||||||
|
'merge',
|
||||||
|
'methods',
|
||||||
|
'min',
|
||||||
|
'mixin',
|
||||||
|
'noConflict',
|
||||||
|
'nodeClass',
|
||||||
|
'nonEnumArgs',
|
||||||
|
'nonEnumShadows',
|
||||||
|
'null',
|
||||||
|
'number',
|
||||||
|
'object',
|
||||||
|
'omit',
|
||||||
|
'once',
|
||||||
|
'ownLast',
|
||||||
|
'pairs',
|
||||||
|
'parseInt',
|
||||||
|
'partial',
|
||||||
|
'partialRight',
|
||||||
|
'pick',
|
||||||
|
'pluck',
|
||||||
|
'random',
|
||||||
|
'range',
|
||||||
|
'reduce',
|
||||||
|
'reduceRight',
|
||||||
|
'reject',
|
||||||
|
'rest',
|
||||||
|
'result',
|
||||||
|
'runInContext',
|
||||||
|
'select',
|
||||||
|
'setImmediate',
|
||||||
'setTimeout',
|
'setTimeout',
|
||||||
|
'shuffle',
|
||||||
|
'size',
|
||||||
|
'some',
|
||||||
|
'sortBy',
|
||||||
|
'sortedIndex',
|
||||||
|
'source',
|
||||||
|
'spliceObjects',
|
||||||
|
'string',
|
||||||
|
'support',
|
||||||
|
'tail',
|
||||||
|
'take',
|
||||||
|
'tap',
|
||||||
|
'template',
|
||||||
'templateSettings',
|
'templateSettings',
|
||||||
|
'throttle',
|
||||||
|
'times',
|
||||||
'toArray',
|
'toArray',
|
||||||
|
'trailing',
|
||||||
|
'transform',
|
||||||
|
'undefined',
|
||||||
|
'unescape',
|
||||||
|
'unindexedChars',
|
||||||
|
'union',
|
||||||
|
'uniq',
|
||||||
|
'unique',
|
||||||
|
'uniqueId',
|
||||||
|
'unzip',
|
||||||
'value',
|
'value',
|
||||||
'variable'
|
'values',
|
||||||
|
'variable',
|
||||||
|
'where',
|
||||||
|
'window',
|
||||||
|
'without',
|
||||||
|
'wrap',
|
||||||
|
'zip',
|
||||||
|
'zipObject',
|
||||||
|
|
||||||
|
// properties used by the `backbone` and `underscore` builds
|
||||||
|
'__chain__',
|
||||||
|
'chain',
|
||||||
|
'findWhere'
|
||||||
];
|
];
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pre-process a given JavaScript `source`, preparing it for minification.
|
* Pre-process a given Lo-Dash `source`, preparing it for minification.
|
||||||
*
|
*
|
||||||
* @private
|
* @param {String} [source=''] The source to process.
|
||||||
* @param {String} source The source to process.
|
* @param {Object} [options={}] The options object.
|
||||||
* @returns {String} Returns the processed source.
|
* @returns {String} Returns the processed source.
|
||||||
*/
|
*/
|
||||||
function preprocess(source) {
|
function preprocess(source, options) {
|
||||||
// remove copyright to add later in post-compile.js
|
source || (source = '');
|
||||||
source = source.replace(/\/\*![\s\S]+?\*\//, '');
|
options || (options = {});
|
||||||
|
|
||||||
// correct JSDoc tags for Closure Compiler
|
// remove unrecognized JSDoc tags so the Closure Compiler won't complain
|
||||||
source = source.replace(/@(?:alias|category)[^\n]*/g, '');
|
source = source.replace(/@(?:alias|category)\b.*/g, '');
|
||||||
|
|
||||||
// add brackets to whitelisted properties so Closure Compiler won't mung them.
|
if (options.isTemplate) {
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
// add brackets to whitelisted properties so the Closure Compiler won't mung them
|
||||||
// http://code.google.com/closure/compiler/docs/api-tutorial3.html#export
|
// http://code.google.com/closure/compiler/docs/api-tutorial3.html#export
|
||||||
source = source.replace(RegExp('\\.(' + iterationFactoryOptions.concat(propWhitelist).join('|') + ')\\b', 'g'), "['$1']");
|
source = source.replace(RegExp('\\.(' + propWhitelist.join('|') + ')\\b', 'g'), function(match, prop) {
|
||||||
|
return "['" + prop.replace(/['\n\r\t]/g, '\\$&') + "']";
|
||||||
// minify `sortBy` and `template` methods
|
|
||||||
['sortBy', 'template'].forEach(function(methodName) {
|
|
||||||
var properties = ['criteria', 'value'],
|
|
||||||
snippet = source.match(RegExp('(\\n\\s*)function ' + methodName + '[\\s\\S]+?\\1}'))[0],
|
|
||||||
result = snippet;
|
|
||||||
|
|
||||||
// minify property strings
|
|
||||||
properties.forEach(function(property, index) {
|
|
||||||
result = result.replace(RegExp("'" + property + "'", 'g'), "'" + minNames[index] + "'");
|
|
||||||
});
|
|
||||||
|
|
||||||
// remove escaped newlines in strings
|
|
||||||
result = result.replace(/\\n/g, '');
|
|
||||||
|
|
||||||
// replace with modified snippet
|
|
||||||
source = source.replace(snippet, result);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// minify all `iterationFactory` related snippets
|
// remove brackets from `lodash.createCallback` in `eachIteratorOptions`
|
||||||
source.match(
|
source = source.replace('lodash[\'createCallback\'](callback, thisArg)"', 'lodash.createCallback(callback, thisArg)"');
|
||||||
RegExp([
|
|
||||||
// match variables storing `iterationFactory` options
|
|
||||||
'var [a-zA-Z]+FactoryOptions\\s*=\\s*\\{[\\s\\S]+?};\\n',
|
|
||||||
// match the the `iterationFactory` function
|
|
||||||
'(\\n\\s*)function iterationFactory[\\s\\S]+?\\1}',
|
|
||||||
// match methods created by `iterationFactor` calls
|
|
||||||
'iterationFactory\\((?:[\'{]|[a-zA-Z]+,)[\\s\\S]+?\\);\\n'
|
|
||||||
].join('|'), 'g')
|
|
||||||
)
|
|
||||||
.forEach(function(snippet, index) {
|
|
||||||
var result = snippet;
|
|
||||||
|
|
||||||
// add `true` and `false` arguments to be minified
|
// remove brackets from `lodash.createCallback` in `_.assign`
|
||||||
if (/function iterationFactory/.test(snippet)) {
|
source = source.replace("' var callback = lodash['createCallback']", "'var callback=lodash.createCallback");
|
||||||
result = result
|
|
||||||
.replace(/(Function\('[\s\S]+?)undefined/, '$1true,false,undefined')
|
|
||||||
.replace(/\)\([^)]+/, '$&,true,false');
|
|
||||||
|
|
||||||
// replace with modified snippet early and clip snippet
|
// remove brackets from `_.escape` in `_.template`
|
||||||
source = source.replace(snippet, result);
|
source = source.replace(/__e *= *_\['escape']/g, '__e=_.escape');
|
||||||
snippet = result = result.replace(/\)\([\s\S]+$/, '');
|
|
||||||
|
// remove brackets from `collection.indexOf` in `_.contains`
|
||||||
|
source = source.replace("collection['indexOf'](target)", 'collection.indexOf(target)');
|
||||||
|
|
||||||
|
// remove brackets from `result[length].value` in `_.sortBy`
|
||||||
|
source = source.replace("result[length]['value']", 'result[length].value');
|
||||||
|
|
||||||
|
// remove whitespace from string literals
|
||||||
|
source = source.replace(/^((?:[ "'\w]+:)? *)"[^"\\\n]*(?:\\.[^"\\\n]*)*"|'[^'\\\n]*(?:\\.[^'\\\n]*)*'/gm, function(string, left) {
|
||||||
|
// clip after an object literal property name or leading spaces
|
||||||
|
if (left) {
|
||||||
|
string = string.slice(left.length);
|
||||||
}
|
}
|
||||||
|
// avoids removing the '\n' of the `stringEscapes` object
|
||||||
|
string = string.replace(/\[object |delete |else (?!{)|function | in | instanceof |return\s+[\w"']|throw |typeof |use strict|var |@ |(["'])\\n\1|\\\\n|\\n|\s+/g, function(match) {
|
||||||
|
return match == false || match == '\\n' ? '' : match;
|
||||||
|
});
|
||||||
|
// unclip
|
||||||
|
return (left || '') + string;
|
||||||
|
});
|
||||||
|
|
||||||
// minify snippet variables/arguments
|
// remove whitespace from `_.template` related regexes
|
||||||
compiledVars.forEach(function(variable, index) {
|
source = source.replace(/reEmptyString\w+ *=.+/g, function(match) {
|
||||||
result = result.replace(RegExp('([^.]\\b|\\\\n)' + variable + '\\b(?!\'\\s*[\\]:])', 'g'), '$1' + minNames[index]);
|
return match.replace(/ |\\n/g, '');
|
||||||
// correct `typeof x == 'object'`
|
});
|
||||||
if (variable == 'object') {
|
|
||||||
result = result.replace(RegExp("(typeof [^']+')" + minNames[index] + "'", 'g'), "$1object'");
|
// remove newline from double-quoted strings in `_.template`
|
||||||
}
|
source = source
|
||||||
// correct boolean literals
|
.replace('"__p += \'"', '"__p+=\'"')
|
||||||
if (variable == 'true' || variable == 'false') {
|
.replace('"\';\n"', '"\';"')
|
||||||
result = result
|
|
||||||
.replace(RegExp(':\\s*' + minNames[index] + '\\s*,', 'g'), ':' + variable + ',')
|
// remove debug sourceURL use in `_.template`
|
||||||
.replace(RegExp('\\s*' + minNames[index] + '\\s*;', 'g'), variable + ';');
|
source = source.replace(/(?:\s*\/\/.*\n)* *var sourceURL[^;]+;|\+ *sourceURL/g, '');
|
||||||
}
|
|
||||||
|
// minify internal properties
|
||||||
|
(function() {
|
||||||
|
var methods = [
|
||||||
|
'cacheIndexOf',
|
||||||
|
'cachePush',
|
||||||
|
'compareAscending',
|
||||||
|
'createCache',
|
||||||
|
'getObject',
|
||||||
|
'releaseObject',
|
||||||
|
'sortBy',
|
||||||
|
'uniq'
|
||||||
|
];
|
||||||
|
|
||||||
|
var props = [
|
||||||
|
'cache',
|
||||||
|
'criteria',
|
||||||
|
'index',
|
||||||
|
'value'
|
||||||
|
];
|
||||||
|
|
||||||
|
var snippets = source.match(RegExp('^( *)(?:var|function) +(?:' + methods.join('|') + ')\\b[\\s\\S]+?\\n\\1}', 'gm'));
|
||||||
|
if (!snippets) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
snippets.forEach(function(snippet) {
|
||||||
|
var modified = snippet;
|
||||||
|
|
||||||
|
// minify properties
|
||||||
|
props.forEach(function(prop, index) {
|
||||||
|
// use minified names different than those chosen for `iteratorOptions`
|
||||||
|
var minName = minNames[iteratorOptions.length + index],
|
||||||
|
reBracketProp = RegExp("\\['(" + prop + ")'\\]", 'g'),
|
||||||
|
reDotProp = RegExp('\\.' + prop + '\\b', 'g'),
|
||||||
|
rePropColon = RegExp("([^?\\s])\\s*([\"'])?\\b" + prop + "\\2 *:", 'g');
|
||||||
|
|
||||||
|
modified = modified
|
||||||
|
.replace(reBracketProp, "['" + minName + "']")
|
||||||
|
.replace(reDotProp, "['" + minName + "']")
|
||||||
|
.replace(rePropColon, "$1'" + minName + "':");
|
||||||
|
});
|
||||||
|
|
||||||
|
// replace with modified snippet
|
||||||
|
source = source.replace(snippet, function() {
|
||||||
|
return modified;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}());
|
||||||
|
|
||||||
|
// minify all compilable snippets
|
||||||
|
var snippets = source.match(
|
||||||
|
RegExp([
|
||||||
|
// match the `iteratorTemplate`
|
||||||
|
'^( *)var iteratorTemplate\\b[\\s\\S]+?\\n\\1}',
|
||||||
|
// match methods created by `createIterator` calls
|
||||||
|
'createIterator\\((?:{|[a-zA-Z]+)[\\s\\S]*?\\);\\n',
|
||||||
|
// match variables storing `createIterator` options
|
||||||
|
'^( *)var [a-zA-Z]+IteratorOptions\\b[\\s\\S]+?\\n\\2}',
|
||||||
|
// match `cachePush`, `createCache`, `createIterator`, `getObject`, `releaseObject`, and `uniq` functions
|
||||||
|
'^( *)(?:var|function) +(?:cachePush|createCache|createIterator|getObject|releaseObject|uniq)\\b[\\s\\S]+?\\n\\3}'
|
||||||
|
].join('|'), 'gm')
|
||||||
|
);
|
||||||
|
|
||||||
|
// exit early if no compilable snippets
|
||||||
|
if (!snippets) {
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
|
||||||
|
snippets.forEach(function(snippet, index) {
|
||||||
|
var isFunc = /\bfunction *[ \w]*\(/.test(snippet),
|
||||||
|
isIteratorTemplate = /var iteratorTemplate\b/.test(snippet),
|
||||||
|
modified = snippet;
|
||||||
|
|
||||||
|
// add brackets to iterator option properties so the Closure Compiler won't mung them
|
||||||
|
modified = modified.replace(RegExp('\\.(' + iteratorOptions.join('|') + ')\\b', 'g'), function(match, prop) {
|
||||||
|
return "['" + prop.replace(/['\n\r\t]/g, '\\$&') + "']";
|
||||||
});
|
});
|
||||||
|
|
||||||
// minify snippet values
|
// remove unnecessary semicolons in strings
|
||||||
compiledValues.forEach(function(value, index) {
|
modified = modified.replace(/;(?:}["']|(?:\\n|\s)*["']\s*\+\s*["'](?:\\n|\s)*})/g, function(match) {
|
||||||
result = result.replace(RegExp("'" + value + "'", 'g'), "'" + minNames[index] + "'");
|
return match.slice(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
// minify iterationFactory option property strings
|
// minify `createIterator` option property names
|
||||||
iterationFactoryOptions.forEach(function(property, index) {
|
iteratorOptions.forEach(function(property, index) {
|
||||||
if (property == 'array' || property == 'object') {
|
var minName = minNames[index];
|
||||||
result = result.replace(RegExp("'" + property + "'(\\s*[\\]:])", 'g'), "'" + minNames[index] + "'$1");
|
|
||||||
} else {
|
// minify variables in `iteratorTemplate` or property names in everything else
|
||||||
result = result.replace(RegExp("'" + property + "'", 'g'), "'" + minNames[index] + "'");
|
modified = isIteratorTemplate
|
||||||
|
? modified.replace(RegExp('\\b' + property + '\\b', 'g'), minName)
|
||||||
|
: modified.replace(RegExp("'" + property + "'", 'g'), "'" + minName + "'");
|
||||||
|
});
|
||||||
|
|
||||||
|
// minify snippet variables / arguments
|
||||||
|
compiledVars.forEach(function(varName, index) {
|
||||||
|
var minName = minNames[index];
|
||||||
|
|
||||||
|
// minify variable names present in strings
|
||||||
|
if (isFunc && !isIteratorTemplate) {
|
||||||
|
modified = modified.replace(RegExp('((["\'])[^\\n\\2]*?)\\b' + varName + '\\b(?=[^\\n\\2]*\\2[ ,+;]+$)', 'gm'), function(match, prelude) {
|
||||||
|
return prelude + minName;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// ensure properties in compiled strings aren't minified
|
||||||
|
else {
|
||||||
|
modified = modified.replace(RegExp('([^.])\\b' + varName + '\\b(?!\' *[\\]:])', 'g'), function(match, prelude) {
|
||||||
|
return prelude + minName;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// correct `typeof` string values
|
||||||
|
if (/^(?:boolean|function|object|number|string|undefined)$/.test(varName)) {
|
||||||
|
modified = modified.replace(RegExp('(= *)(["\'])' + minName + '\\2|(["\'])' + minName + '\\3( *=)', 'g'), function(match, prelude, preQuote, postQuote, postlude) {
|
||||||
|
return prelude
|
||||||
|
? prelude + preQuote + varName + preQuote
|
||||||
|
: postQuote + varName + postQuote + postlude;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// remove escaped newlines in strings
|
|
||||||
result = result.replace(/\\n/g, '');
|
|
||||||
|
|
||||||
// replace with modified snippet
|
// replace with modified snippet
|
||||||
source = source.replace(snippet, result);
|
source = source.replace(snippet, function() {
|
||||||
|
return modified;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
return source;
|
return source;
|
||||||
@@ -198,13 +451,23 @@
|
|||||||
// expose `preprocess`
|
// expose `preprocess`
|
||||||
if (module != require.main) {
|
if (module != require.main) {
|
||||||
module.exports = preprocess;
|
module.exports = preprocess;
|
||||||
} else {
|
}
|
||||||
// read the JavaScript source file from the first argument if the script
|
else {
|
||||||
|
// read the Lo-Dash source file from the first argument if the script
|
||||||
// was invoked directly (e.g. `node pre-compile.js source.js`) and write to
|
// was invoked directly (e.g. `node pre-compile.js source.js`) and write to
|
||||||
// the same file
|
// the same file
|
||||||
(function() {
|
(function() {
|
||||||
var source = fs.readFileSync(process.argv[2], 'utf8');
|
var options = process.argv;
|
||||||
fs.writeFileSync(process.argv[2], preprocess(source), 'utf8');
|
if (options.length < 3) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var filePath = options[options.length - 1],
|
||||||
|
isTemplate = options.indexOf('-t') > -1 || options.indexOf('--template') > -1,
|
||||||
|
source = fs.readFileSync(filePath, 'utf8');
|
||||||
|
|
||||||
|
fs.writeFileSync(filePath, preprocess(source, {
|
||||||
|
'isTemplate': isTemplate
|
||||||
|
}), 'utf8');
|
||||||
}());
|
}());
|
||||||
}
|
}
|
||||||
}());
|
}());
|
||||||
|
|||||||
98
build/util.js
Executable file
@@ -0,0 +1,98 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
;(function() {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
/** Load Node.js modules */
|
||||||
|
var fs = require('fs'),
|
||||||
|
path = require('path');
|
||||||
|
|
||||||
|
/** Load other modules */
|
||||||
|
var _ = require('../lodash.js');
|
||||||
|
|
||||||
|
/** Used to indicate if running in Windows */
|
||||||
|
var isWindows = process.platform == 'win32';
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The path separator.
|
||||||
|
*
|
||||||
|
* @memberOf util.path
|
||||||
|
* @type String
|
||||||
|
*/
|
||||||
|
var sep = path.sep || (isWindows ? '\\' : '/');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The escaped path separator used for inclusion in RegExp strings.
|
||||||
|
*
|
||||||
|
* @memberOf util.path
|
||||||
|
* @type String
|
||||||
|
*/
|
||||||
|
var sepEscaped = sep.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
||||||
|
|
||||||
|
/** Used to determine if a path is prefixed with a drive letter, dot, or slash */
|
||||||
|
var rePrefixed = RegExp('^(?:' + (isWindows ? '[a-zA-Z]:|' : '') + '\\.?)' + sepEscaped);
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Makes the given `dirname` directory, without throwing errors for existing
|
||||||
|
* directories and making parent directories as needed.
|
||||||
|
*
|
||||||
|
* @memberOf util.fs
|
||||||
|
* @param {String} dirname The path of the directory.
|
||||||
|
* @param {Number|String} [mode='0777'] The permission mode.
|
||||||
|
*/
|
||||||
|
function mkdirpSync(dirname, mode) {
|
||||||
|
// ensure relative paths are prefixed with `./`
|
||||||
|
if (!rePrefixed.test(dirname)) {
|
||||||
|
dirname = '.' + sep + dirname;
|
||||||
|
}
|
||||||
|
dirname.split(sep).reduce(function(currPath, segment) {
|
||||||
|
currPath += sep + segment;
|
||||||
|
try {
|
||||||
|
currPath = fs.realpathSync(currPath);
|
||||||
|
} catch(e) {
|
||||||
|
fs.mkdirSync(currPath, mode);
|
||||||
|
}
|
||||||
|
return currPath;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The utility object.
|
||||||
|
*
|
||||||
|
* @type Object
|
||||||
|
*/
|
||||||
|
var util = {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The file system object.
|
||||||
|
*
|
||||||
|
* @memberOf util
|
||||||
|
* @type Object
|
||||||
|
*/
|
||||||
|
'fs': _.defaults(_.cloneDeep(fs), {
|
||||||
|
'existsSync': fs.existsSync || path.existsSync,
|
||||||
|
'mkdirpSync': mkdirpSync
|
||||||
|
}),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The path object.
|
||||||
|
*
|
||||||
|
* @memberOf util
|
||||||
|
* @type Object
|
||||||
|
*/
|
||||||
|
'path': _.defaults(_.cloneDeep(path), {
|
||||||
|
'sep': sep,
|
||||||
|
'sepEscaped': sepEscaped
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
// expose
|
||||||
|
module.exports = util;
|
||||||
|
}());
|
||||||
20
component.json
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"name": "lodash",
|
||||||
|
"repo": "bestiejs/lodash",
|
||||||
|
"version": "1.3.1",
|
||||||
|
"description": "A low-level utility library delivering consistency, customization, performance, and extra features.",
|
||||||
|
"license": "MIT",
|
||||||
|
"scripts": [
|
||||||
|
"index.js",
|
||||||
|
"dist/lodash.compat.js"
|
||||||
|
],
|
||||||
|
"keywords": [
|
||||||
|
"browser",
|
||||||
|
"client",
|
||||||
|
"functional",
|
||||||
|
"performance",
|
||||||
|
"server",
|
||||||
|
"speed",
|
||||||
|
"util"
|
||||||
|
]
|
||||||
|
}
|
||||||
5909
dist/lodash.compat.js
vendored
Normal file
51
dist/lodash.compat.min.js
vendored
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
/**
|
||||||
|
* @license
|
||||||
|
* Lo-Dash 1.3.1 (Custom Build) lodash.com/license
|
||||||
|
* Build: `lodash -o ./dist/lodash.compat.js`
|
||||||
|
* Underscore.js 1.4.4 underscorejs.org/LICENSE
|
||||||
|
*/
|
||||||
|
;!function(n){function t(n,t,r){r=(r||0)-1;for(var e=n.length;++r<e;)if(n[r]===t)return r;return-1}function r(n,r){var e=typeof r;if(n=n.k,"boolean"==e||r==d)return n[r];"number"!=e&&"string"!=e&&(e="object");var u="number"==e?r:x+r;return n=n[e]||(n[e]={}),"object"==e?n[u]&&-1<t(n[u],r)?0:-1:n[u]?0:-1}function e(n){var t=this.k,r=typeof n;if("boolean"==r||n==d)t[n]=y;else{"number"!=r&&"string"!=r&&(r="object");var e="number"==r?n:x+n,u=t[r]||(t[r]={});"object"==r?(u[e]||(u[e]=[])).push(n)==this.b.length&&(t[r]=b):u[e]=y
|
||||||
|
}}function u(n){return n.charCodeAt(0)}function a(n,t){var r=n.m,e=t.m;if(n=n.l,t=t.l,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1}return r<e?-1:1}function o(n){var t=-1,r=n.length,u=c();u["false"]=u["null"]=u["true"]=u.undefined=b;var a=c();for(a.b=n,a.k=u,a.push=e;++t<r;)a.push(n[t]);return u.object===false?(g(a),d):a}function i(n){return"\\"+tt[n]}function l(){return _.pop()||[]}function c(){return C.pop()||{a:"",b:d,c:"",k:d,l:d,"false":b,d:"",m:0,e:"",leading:b,f:"",maxWait:0,"null":b,number:d,object:d,push:d,g:d,string:d,h:"",trailing:b,"true":b,undefined:b,i:b,j:b,n:d}
|
||||||
|
}function f(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function p(){}function s(n){n.length=0,_.length<E&&_.push(n)}function g(n){var t=n.k;t&&g(t),n.b=n.k=n.l=n.object=n.number=n.string=n.n=d,C.length<E&&C.push(n)}function v(n,t,r){t||(t=0),typeof r=="undefined"&&(r=n?n.length:0);var e=-1;r=r-t||0;for(var u=Array(0>r?0:r);++e<r;)u[e]=n[t+e];return u}function h(e){function _(n){return n&&typeof n=="object"&&!qr(n)&&sr.call(n,"__wrapped__")?n:new C(n)}function C(n){this.__wrapped__=n
|
||||||
|
}function E(n,t,r,e){function u(){var e=arguments,c=o?this:t;return a||(n=t[i]),r.length&&(e=e.length?(e=Sr.call(e),l?e.concat(r):r.concat(e)):r),this instanceof u?(c=rt(n.prototype),e=n.apply(c,e),mt(e)?e:c):n.apply(c,e)}var a=ht(n),o=!r,i=t;if(o){var l=e;r=t}else if(!a){if(!e)throw new Zt;t=n}return u}function tt(){var n=c();n.g=L,n.b=n.c=n.f=n.h="",n.e="r",n.i=y,n.j=!!Rr;for(var t,r=0;t=arguments[r];r++)for(var e in t)n[e]=t[e];r=n.a,n.d=/^[^,]+/.exec(r)[0],t=Mt,r="return function("+r+"){",e="var m,r="+n.d+",C="+n.e+";if(!r)return C;"+n.h+";",n.b?(e+="var s=r.length;m=-1;if("+n.b+"){",Pr.unindexedChars&&(e+="if(q(r)){r=r.split('')}"),e+="while(++m<s){"+n.f+";}}else{"):Pr.nonEnumArgs&&(e+="var s=r.length;m=-1;if(s&&n(r)){while(++m<s){m+='';"+n.f+";}}else{"),Pr.enumPrototypes&&(e+="var E=typeof r=='function';"),Pr.enumErrorProps&&(e+="var D=r===j||r instanceof Error;");
|
||||||
|
var u=[];if(Pr.enumPrototypes&&u.push('!(E&&m=="prototype")'),Pr.enumErrorProps&&u.push('!(D&&(m=="message"||m=="name"))'),n.i&&n.j)e+="var A=-1,B=z[typeof r]&&t(r),s=B?B.length:0;while(++A<s){m=B[A];",u.length&&(e+="if("+u.join("&&")+"){"),e+=n.f+";",u.length&&(e+="}"),e+="}";else if(e+="for(m in r){",n.i&&u.push("l.call(r, m)"),u.length&&(e+="if("+u.join("&&")+"){"),e+=n.f+";",u.length&&(e+="}"),e+="}",Pr.nonEnumShadows){for(e+="if(r!==y){var h=r.constructor,p=r===(h&&h.prototype),e=r===H?G:r===j?i:J.call(r),v=w[e];",k=0;7>k;k++)e+="m='"+n.g[k]+"';if((!(p&&v[m])&&l.call(r,m))",n.i||(e+="||(!v[m]&&r[m]!==y[m])"),e+="){"+n.f+"}";
|
||||||
|
e+="}"}return(n.b||Pr.nonEnumArgs)&&(e+="}"),e+=n.c+";return C",t=t("i,j,l,n,o,q,t,u,y,z,w,G,H,J",r+e+"}"),g(n),t(M,tr,sr,ft,qr,dt,Rr,_,rr,nt,Nr,Y,er,yr)}function rt(n){return mt(n)?br(n):{}}function ut(n){return Wr[n]}function ot(){var n=(n=_.indexOf)===Pt?t:n;return n}function it(n){return function(t,r,e,u){return typeof r!="boolean"&&r!=d&&(u=e,e=u&&u[r]===t?m:r,r=b),e!=d&&(e=_.createCallback(e,u)),n(t,r,e,u)}}function lt(n){var t,r;return!n||yr.call(n)!=Q||(t=n.constructor,ht(t)&&!(t instanceof t))||!Pr.argsClass&&ft(n)||!Pr.nodeClass&&f(n)?b:Pr.ownLast?(Jr(n,function(n,t,e){return r=sr.call(e,t),b
|
||||||
|
}),r!==false):(Jr(n,function(n,t){r=t}),r===m||sr.call(n,r))}function ct(n){return Lr[n]}function ft(n){return yr.call(n)==G}function pt(n,t,r,e,u,a){var o=n;if(typeof t!="boolean"&&t!=d&&(e=r,r=t,t=b),typeof r=="function"){if(r=typeof e=="undefined"?r:_.createCallback(r,e,1),o=r(o),typeof o!="undefined")return o;o=n}if(e=mt(o)){var i=yr.call(o);if(!Z[i]||!Pr.nodeClass&&f(o))return o;var c=qr(o)}if(!e||!t)return e?c?v(o):Gr({},o):o;switch(e=Br[i],i){case J:case K:return new e(+o);case V:case Y:return new e(o);
|
||||||
|
case X:return e(o.source,P.exec(o))}i=!u,u||(u=l()),a||(a=l());for(var p=u.length;p--;)if(u[p]==n)return a[p];return o=c?e(o.length):{},c&&(sr.call(n,"index")&&(o.index=n.index),sr.call(n,"input")&&(o.input=n.input)),u.push(n),a.push(o),(c?Tr:Kr)(n,function(n,e){o[e]=pt(n,t,r,m,u,a)}),i&&(s(u),s(a)),o}function st(n){var t=[];return Jr(n,function(n,r){ht(n)&&t.push(r)}),t.sort()}function gt(n){for(var t=-1,r=Rr(n),e=r.length,u={};++t<e;){var a=r[t];u[n[a]]=a}return u}function vt(n,t,r,e,u,a){var o=r===w;
|
||||||
|
if(typeof r=="function"&&!o){r=_.createCallback(r,e,2);var i=r(n,t);if(typeof i!="undefined")return!!i}if(n===t)return 0!==n||1/n==1/t;var c=typeof n,p=typeof t;if(n===n&&(!n||"function"!=c&&"object"!=c)&&(!t||"function"!=p&&"object"!=p))return b;if(n==d||t==d)return n===t;if(p=yr.call(n),c=yr.call(t),p==G&&(p=Q),c==G&&(c=Q),p!=c)return b;switch(p){case J:case K:return+n==+t;case V:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case X:case Y:return n==Yt(t)}if(c=p==H,!c){if(sr.call(n,"__wrapped__")||sr.call(t,"__wrapped__"))return vt(n.__wrapped__||n,t.__wrapped__||t,r,e,u,a);
|
||||||
|
if(p!=Q||!Pr.nodeClass&&(f(n)||f(t)))return b;var p=!Pr.argsObject&&ft(n)?Qt:n.constructor,g=!Pr.argsObject&&ft(t)?Qt:t.constructor;if(p!=g&&(!ht(p)||!(p instanceof p&&ht(g)&&g instanceof g)))return b}for(g=!u,u||(u=l()),a||(a=l()),p=u.length;p--;)if(u[p]==n)return a[p]==t;var v=0,i=y;if(u.push(n),a.push(t),c){if(p=n.length,v=t.length,i=v==n.length,!i&&!o)return i;for(;v--;)if(c=p,g=t[v],o)for(;c--&&!(i=vt(n[c],g,r,e,u,a)););else if(!(i=vt(n[v],g,r,e,u,a)))break;return i}return Jr(t,function(t,o,l){return sr.call(l,o)?(v++,i=sr.call(n,o)&&vt(n[o],t,r,e,u,a)):void 0
|
||||||
|
}),i&&!o&&Jr(n,function(n,t,r){return sr.call(r,t)?i=-1<--v:void 0}),g&&(s(u),s(a)),i}function ht(n){return typeof n=="function"}function mt(n){return!(!n||!nt[typeof n])}function yt(n){return typeof n=="number"||yr.call(n)==V}function dt(n){return typeof n=="string"||yr.call(n)==Y}function bt(n,t,r){var e=arguments,u=0,a=2;if(!mt(n))return n;if(r===w)var o=e[3],i=e[4],c=e[5];else{var f=y,i=l(),c=l();typeof r!="number"&&(a=e.length),3<a&&"function"==typeof e[a-2]?o=_.createCallback(e[--a-1],e[a--],2):2<a&&"function"==typeof e[a-1]&&(o=e[--a])
|
||||||
|
}for(;++u<a;)(qr(e[u])?xt:Kr)(e[u],function(t,r){var e,u,a=t,l=n[r];if(t&&((u=qr(t))||Mr(t))){for(a=i.length;a--;)if(e=i[a]==t){l=c[a];break}if(!e){var f;o&&(a=o(l,t),f=typeof a!="undefined")&&(l=a),f||(l=u?qr(l)?l:[]:Mr(l)?l:{}),i.push(t),c.push(l),f||(l=bt(l,t,w,o,i,c))}}else o&&(a=o(l,t),typeof a=="undefined"&&(a=t)),typeof a!="undefined"&&(l=a);n[r]=l});return f&&(s(i),s(c)),n}function _t(n){for(var t=-1,r=Rr(n),e=r.length,u=Ht(e);++t<e;)u[t]=n[r[t]];return u}function Ct(n,t,r){var e=-1,u=ot(),a=n?n.length:0,o=b;
|
||||||
|
return r=(0>r?kr(0,a+r):r)||0,a&&typeof a=="number"?o=-1<(dt(n)?n.indexOf(t,r):u(n,t,r)):Tr(n,function(n){return++e<r?void 0:!(o=n===t)}),o}function jt(n,t,r){var e=y;if(t=_.createCallback(t,r),qr(n)){r=-1;for(var u=n.length;++r<u&&(e=!!t(n[r],r,n)););}else Tr(n,function(n,r,u){return e=!!t(n,r,u)});return e}function wt(n,t,r){var e=[];if(t=_.createCallback(t,r),qr(n)){r=-1;for(var u=n.length;++r<u;){var a=n[r];t(a,r,n)&&e.push(a)}}else Tr(n,function(n,r,u){t(n,r,u)&&e.push(n)});return e}function kt(n,t,r){if(t=_.createCallback(t,r),!qr(n)){var e;
|
||||||
|
return Tr(n,function(n,r,u){return t(n,r,u)?(e=n,b):void 0}),e}r=-1;for(var u=n.length;++r<u;){var a=n[r];if(t(a,r,n))return a}}function xt(n,t,r){if(t&&typeof r=="undefined"&&qr(n)){r=-1;for(var e=n.length;++r<e&&t(n[r],r,n)!==false;);}else Tr(n,t,r);return n}function Ot(n,t,r){var e=-1,u=n?n.length:0,a=Ht(typeof u=="number"?u:0);if(t=_.createCallback(t,r),qr(n))for(;++e<u;)a[e]=t(n[e],e,n);else Tr(n,function(n,r,u){a[++e]=t(n,r,u)});return a}function Et(n,t,r){var e=-1/0,a=e;if(!t&&qr(n)){r=-1;for(var o=n.length;++r<o;){var i=n[r];
|
||||||
|
i>a&&(a=i)}}else t=!t&&dt(n)?u:_.createCallback(t,r),Tr(n,function(n,r,u){r=t(n,r,u),r>e&&(e=r,a=n)});return a}function St(n,t,r,e){var u=3>arguments.length;if(t=_.createCallback(t,e,4),qr(n)){var a=-1,o=n.length;for(u&&(r=n[++a]);++a<o;)r=t(r,n[a],a,n)}else Tr(n,function(n,e,a){r=u?(u=b,n):t(r,n,e,a)});return r}function At(n,t,r,e){var u=n,a=n?n.length:0,o=3>arguments.length;if(typeof a!="number")var i=Rr(n),a=i.length;else Pr.unindexedChars&&dt(n)&&(u=n.split(""));return t=_.createCallback(t,e,4),xt(n,function(n,e,l){e=i?i[--a]:--a,r=o?(o=b,u[e]):t(r,u[e],e,l)
|
||||||
|
}),r}function It(n,t,r){var e;if(t=_.createCallback(t,r),qr(n)){r=-1;for(var u=n.length;++r<u&&!(e=t(n[r],r,n)););}else Tr(n,function(n,r,u){return!(e=t(n,r,u))});return!!e}function Bt(n){var e=-1,u=ot(),a=n?n.length:0,i=lr.apply(nr,Sr.call(arguments,1)),l=[],c=a>=O&&u===t;if(c){var f=o(i);f?(u=r,i=f):c=b}for(;++e<a;)f=n[e],0>u(i,f)&&l.push(f);return c&&g(i),l}function Nt(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=d){var a=-1;for(t=_.createCallback(t,r);++a<u&&t(n[a],a,n);)e++}else if(e=t,e==d||r)return n[0];
|
||||||
|
return v(n,0,xr(kr(0,e),u))}}function Pt(n,r,e){if(typeof e=="number"){var u=n?n.length:0;e=0>e?kr(0,u+e):e||0}else if(e)return e=Ft(n,r),n[e]===r?e:-1;return n?t(n,r,e):-1}function zt(n,t,r){if(typeof t!="number"&&t!=d){var e=0,u=-1,a=n?n.length:0;for(t=_.createCallback(t,r);++u<a&&t(n[u],u,n);)e++}else e=t==d||r?1:kr(0,t);return v(n,e)}function Ft(n,t,r,e){var u=0,a=n?n.length:u;for(r=r?_.createCallback(r,e,1):Wt,t=r(t);u<a;)e=u+a>>>1,r(n[e])<t?u=e+1:a=e;return u}function $t(n){for(var t=-1,r=n?Et(Ur(n,"length")):0,e=Ht(0>r?0:r);++t<r;)e[t]=Ur(n,t);
|
||||||
|
return e}function qt(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var a=n[r];t?u[a]=t[r]:u[a[0]]=a[1]}return u}function Dt(n,t){return Pr.fastBind||dr&&2<arguments.length?dr.call.apply(dr,arguments):E(n,t,Sr.call(arguments,2))}function Rt(n,t,r){function e(){ir(s),ir(g),c=0,s=g=d}function u(){var t=v&&(!h||1<c);e(),t&&(p!==false&&(f=new Kt),i=n.apply(l,o))}function a(){e(),(v||p!==t)&&(f=new Kt,i=n.apply(l,o))}var o,i,l,c=0,f=0,p=b,s=d,g=d,v=y;if(t=kr(0,t||0),r===y)var h=y,v=b;else mt(r)&&(h=r.leading,p="maxWait"in r&&kr(t,r.maxWait||0),v="trailing"in r?r.trailing:v);
|
||||||
|
return function(){if(o=arguments,l=this,c++,ir(g),p===false)h&&2>c&&(i=n.apply(l,o));else{var r=new Kt;!s&&!h&&(f=r);var e=p-(r-f);0<e?s||(s=mr(a,e)):(ir(s),s=d,f=r,i=n.apply(l,o))}return t!==p&&(g=mr(u,t)),i}}function Tt(n){var t=Sr.call(arguments,1);return mr(function(){n.apply(m,t)},1)}function Wt(n){return n}function Lt(n){xt(st(n),function(t){var r=_[t]=n[t];_.prototype[t]=function(){var n=this.__wrapped__,t=[n];return gr.apply(t,arguments),t=r.apply(_,t),n&&typeof n=="object"&&n===t?this:new C(t)
|
||||||
|
}})}function Gt(){return this.__wrapped__}e=e?at.defaults(n.Object(),e,at.pick(n,W)):n;var Ht=e.Array,Jt=e.Boolean,Kt=e.Date,Mt=e.Function,Ut=e.Math,Vt=e.Number,Qt=e.Object,Xt=e.RegExp,Yt=e.String,Zt=e.TypeError,nr=[],tr=e.Error.prototype,rr=Qt.prototype,er=Yt.prototype,ur=e._,ar=Xt("^"+Yt(rr.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),or=Ut.ceil,ir=e.clearTimeout,lr=nr.concat,cr=Ut.floor,fr=Mt.prototype.toString,pr=ar.test(pr=Qt.getPrototypeOf)&&pr,sr=rr.hasOwnProperty,gr=nr.push,vr=rr.propertyIsEnumerable,hr=e.setImmediate,mr=e.setTimeout,yr=rr.toString,dr=ar.test(dr=yr.bind)&&dr,br=ar.test(br=Qt.create)&&br,_r=ar.test(_r=Ht.isArray)&&_r,Cr=e.isFinite,jr=e.isNaN,wr=ar.test(wr=Qt.keys)&&wr,kr=Ut.max,xr=Ut.min,Or=e.parseInt,Er=Ut.random,Sr=nr.slice,Ar=ar.test(e.attachEvent),Ir=dr&&!/\n|true/.test(dr+Ar),Br={};
|
||||||
|
Br[H]=Ht,Br[J]=Jt,Br[K]=Kt,Br[U]=Mt,Br[Q]=Qt,Br[V]=Vt,Br[X]=Xt,Br[Y]=Yt;var Nr={};Nr[H]=Nr[K]=Nr[V]={constructor:y,toLocaleString:y,toString:y,valueOf:y},Nr[J]=Nr[Y]={constructor:y,toString:y,valueOf:y},Nr[M]=Nr[U]=Nr[X]={constructor:y,toString:y},Nr[Q]={constructor:y},function(){for(var n=L.length;n--;){var t,r=L[n];for(t in Nr)sr.call(Nr,t)&&!sr.call(Nr[t],r)&&(Nr[t][r]=b)}}(),C.prototype=_.prototype;var Pr=_.support={};!function(){function n(){this.x=1}var t={0:1,length:1},r=[];n.prototype={valueOf:1};
|
||||||
|
for(var e in new n)r.push(e);for(e in arguments);Pr.argsObject=arguments.constructor==Qt&&!(arguments instanceof Ht),Pr.argsClass=ft(arguments),Pr.enumErrorProps=vr.call(tr,"message")||vr.call(tr,"name"),Pr.enumPrototypes=vr.call(n,"prototype"),Pr.fastBind=dr&&!Ir,Pr.ownLast="x"!=r[0],Pr.nonEnumArgs=0!=e,Pr.nonEnumShadows=!/valueOf/.test(r),Pr.spliceObjects=(nr.splice.call(t,0,1),!t[0]),Pr.unindexedChars="xx"!="x"[0]+Qt("x")[0];try{Pr.nodeClass=!(yr.call(document)==Q&&!({toString:0}+""))}catch(u){Pr.nodeClass=y
|
||||||
|
}}(1),_.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:z,variable:"",imports:{_:_}};var zr={a:"x,F,k",h:"var a=arguments,b=0,c=typeof k=='number'?2:a.length;while(++b<c){r=a[b];if(r&&z[typeof r]){",f:"if(typeof C[m]=='undefined')C[m]=r[m]",c:"}}"},Fr={a:"f,d,I",h:"d=d&&typeof I=='undefined'?d:u.createCallback(d,I)",b:"typeof s=='number'",f:"if(d(r[m],m,f)===false)return C"},$r={h:"if(!z[typeof r])return C;"+Fr.h,b:b};br||(rt=function(n){if(mt(n)){p.prototype=n;
|
||||||
|
var t=new p;p.prototype=d}return t||{}}),Pr.argsClass||(ft=function(n){return n?sr.call(n,"callee"):b});var qr=_r||function(n){return n?typeof n=="object"&&yr.call(n)==H:b},Dr=tt({a:"x",e:"[]",h:"if(!(z[typeof x]))return C",f:"C.push(m)"}),Rr=wr?function(n){return mt(n)?Pr.enumPrototypes&&typeof n=="function"||Pr.nonEnumArgs&&n.length&&ft(n)?Dr(n):wr(n):[]}:Dr,Tr=tt(Fr),Wr={"&":"&","<":"<",">":">",'"':""","'":"'"},Lr=gt(Wr),Gr=tt(zr,{h:zr.h.replace(";",";if(c>3&&typeof a[c-2]=='function'){var d=u.createCallback(a[--c-1],a[c--],2)}else if(c>2&&typeof a[c-1]=='function'){d=a[--c]}"),f:"C[m]=d?d(C[m],r[m]):r[m]"}),Hr=tt(zr),Jr=tt(Fr,$r,{i:b}),Kr=tt(Fr,$r);
|
||||||
|
ht(/x/)&&(ht=function(n){return typeof n=="function"&&yr.call(n)==U});var Mr=pr?function(n){if(!n||yr.call(n)!=Q||!Pr.argsClass&&ft(n))return b;var t=n.valueOf,r=typeof t=="function"&&(r=pr(t))&&pr(r);return r?n==r||pr(n)==r:lt(n)}:lt,Ur=Ot,Vr=it(function Yr(n,t,r){for(var e=-1,u=n?n.length:0,a=[];++e<u;){var o=n[e];r&&(o=r(o,e,n)),qr(o)?gr.apply(a,t?o:Yr(o)):a.push(o)}return a}),Qr=it(function(n,e,u){var a=-1,i=ot(),c=n?n.length:0,f=[],p=!e&&c>=O&&i===t,v=u||p?l():f;if(p){var h=o(v);h?(i=r,v=h):(p=b,v=u?v:(s(v),f))
|
||||||
|
}for(;++a<c;){var h=n[a],m=u?u(h,a,n):h;(e?!a||v[v.length-1]!==m:0>i(v,m))&&((u||p)&&v.push(m),f.push(h))}return p?(s(v.b),g(v)):u&&s(v),f});Ir&&et&&typeof hr=="function"&&(Tt=Dt(hr,e));var Xr=8==Or($+"08")?Or:function(n,t){return Or(dt(n)?n.replace(q,""):n,t||0)};return _.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},_.assign=Gr,_.at=function(n){var t=-1,r=lr.apply(nr,Sr.call(arguments,1)),e=r.length,u=Ht(e);for(Pr.unindexedChars&&dt(n)&&(n=n.split(""));++t<e;)u[t]=n[r[t]];
|
||||||
|
return u},_.bind=Dt,_.bindAll=function(n){for(var t=1<arguments.length?lr.apply(nr,Sr.call(arguments,1)):st(n),r=-1,e=t.length;++r<e;){var u=t[r];n[u]=Dt(n[u],n)}return n},_.bindKey=function(n,t){return E(n,t,Sr.call(arguments,2),w)},_.compact=function(n){for(var t=-1,r=n?n.length:0,e=[];++t<r;){var u=n[t];u&&e.push(u)}return e},_.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},_.countBy=function(n,t,r){var e={};return t=_.createCallback(t,r),xt(n,function(n,r,u){r=Yt(t(n,r,u)),sr.call(e,r)?e[r]++:e[r]=1
|
||||||
|
}),e},_.createCallback=function(n,t,r){if(n==d)return Wt;var e=typeof n;if("function"!=e){if("object"!=e)return function(t){return t[n]};var u=Rr(n);return function(t){for(var r=u.length,e=b;r--&&(e=vt(t[u[r]],n[u[r]],w)););return e}}return typeof t=="undefined"||F&&!F.test(fr.call(n))?n:1===r?function(r){return n.call(t,r)}:2===r?function(r,e){return n.call(t,r,e)}:4===r?function(r,e,u,a){return n.call(t,r,e,u,a)}:function(r,e,u){return n.call(t,r,e,u)}},_.debounce=Rt,_.defaults=Hr,_.defer=Tt,_.delay=function(n,t){var r=Sr.call(arguments,2);
|
||||||
|
return mr(function(){n.apply(m,r)},t)},_.difference=Bt,_.filter=wt,_.flatten=Vr,_.forEach=xt,_.forIn=Jr,_.forOwn=Kr,_.functions=st,_.groupBy=function(n,t,r){var e={};return t=_.createCallback(t,r),xt(n,function(n,r,u){r=Yt(t(n,r,u)),(sr.call(e,r)?e[r]:e[r]=[]).push(n)}),e},_.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t!="number"&&t!=d){var a=u;for(t=_.createCallback(t,r);a--&&t(n[a],a,n);)e++}else e=t==d||r?1:t||e;return v(n,0,xr(kr(0,u-e),u))},_.intersection=function(n){for(var e=arguments,u=e.length,a=-1,i=l(),c=-1,f=ot(),p=n?n.length:0,v=[],h=l();++a<u;){var m=e[a];
|
||||||
|
i[a]=f===t&&(m?m.length:0)>=O&&o(a?e[a]:h)}n:for(;++c<p;){var y=i[0],m=n[c];if(0>(y?r(y,m):f(h,m))){for(a=u,(y||h).push(m);--a;)if(y=i[a],0>(y?r(y,m):f(e[a],m)))continue n;v.push(m)}}for(;u--;)(y=i[u])&&g(y);return s(i),s(h),v},_.invert=gt,_.invoke=function(n,t){var r=Sr.call(arguments,2),e=-1,u=typeof t=="function",a=n?n.length:0,o=Ht(typeof a=="number"?a:0);return xt(n,function(n){o[++e]=(u?t:n[t]).apply(n,r)}),o},_.keys=Rr,_.map=Ot,_.max=Et,_.memoize=function(n,t){function r(){var e=r.cache,u=x+(t?t.apply(this,arguments):arguments[0]);
|
||||||
|
return sr.call(e,u)?e[u]:e[u]=n.apply(this,arguments)}return r.cache={},r},_.merge=bt,_.min=function(n,t,r){var e=1/0,a=e;if(!t&&qr(n)){r=-1;for(var o=n.length;++r<o;){var i=n[r];i<a&&(a=i)}}else t=!t&&dt(n)?u:_.createCallback(t,r),Tr(n,function(n,r,u){r=t(n,r,u),r<e&&(e=r,a=n)});return a},_.omit=function(n,t,r){var e=ot(),u=typeof t=="function",a={};if(u)t=_.createCallback(t,r);else var o=lr.apply(nr,Sr.call(arguments,1));return Jr(n,function(n,r,i){(u?!t(n,r,i):0>e(o,r))&&(a[r]=n)}),a},_.once=function(n){var t,r;
|
||||||
|
return function(){return t?r:(t=y,r=n.apply(this,arguments),n=d,r)}},_.pairs=function(n){for(var t=-1,r=Rr(n),e=r.length,u=Ht(e);++t<e;){var a=r[t];u[t]=[a,n[a]]}return u},_.partial=function(n){return E(n,Sr.call(arguments,1))},_.partialRight=function(n){return E(n,Sr.call(arguments,1),d,w)},_.pick=function(n,t,r){var e={};if(typeof t!="function")for(var u=-1,a=lr.apply(nr,Sr.call(arguments,1)),o=mt(n)?a.length:0;++u<o;){var i=a[u];i in n&&(e[i]=n[i])}else t=_.createCallback(t,r),Jr(n,function(n,r,u){t(n,r,u)&&(e[r]=n)
|
||||||
|
});return e},_.pluck=Ur,_.range=function(n,t,r){n=+n||0,r=+r||1,t==d&&(t=n,n=0);var e=-1;t=kr(0,or((t-n)/r));for(var u=Ht(t);++e<t;)u[e]=n,n+=r;return u},_.reject=function(n,t,r){return t=_.createCallback(t,r),wt(n,function(n,r,e){return!t(n,r,e)})},_.rest=zt,_.shuffle=function(n){var t=-1,r=n?n.length:0,e=Ht(typeof r=="number"?r:0);return xt(n,function(n){var r=cr(Er()*(++t+1));e[t]=e[r],e[r]=n}),e},_.sortBy=function(n,t,r){var e=-1,u=n?n.length:0,o=Ht(typeof u=="number"?u:0);for(t=_.createCallback(t,r),xt(n,function(n,r,u){var a=o[++e]=c();
|
||||||
|
a.l=t(n,r,u),a.m=e,a.n=n}),u=o.length,o.sort(a);u--;)n=o[u],o[u]=n.n,g(n);return o},_.tap=function(n,t){return t(n),n},_.throttle=function(n,t,r){var e=y,u=y;return r===false?e=b:mt(r)&&(e="leading"in r?r.leading:e,u="trailing"in r?r.trailing:u),r=c(),r.leading=e,r.maxWait=t,r.trailing=u,n=Rt(n,t,r),g(r),n},_.times=function(n,t,r){n=-1<(n=+n)?n:0;var e=-1,u=Ht(n);for(t=_.createCallback(t,r,1);++e<n;)u[e]=t(e);return u},_.toArray=function(n){return n&&typeof n.length=="number"?Pr.unindexedChars&&dt(n)?n.split(""):v(n):_t(n)
|
||||||
|
},_.transform=function(n,t,r,e){var u=qr(n);return t=_.createCallback(t,e,4),r==d&&(u?r=[]:(e=n&&n.constructor,r=rt(e&&e.prototype))),(u?Tr:Kr)(n,function(n,e,u){return t(r,n,e,u)}),r},_.union=function(n){return qr(n)||(arguments[0]=n?Sr.call(n):nr),Qr(lr.apply(nr,arguments))},_.uniq=Qr,_.unzip=$t,_.values=_t,_.where=wt,_.without=function(n){return Bt(n,Sr.call(arguments,1))},_.wrap=function(n,t){return function(){var r=[n];return gr.apply(r,arguments),t.apply(this,r)}},_.zip=function(n){return n?$t(arguments):[]
|
||||||
|
},_.zipObject=qt,_.collect=Ot,_.drop=zt,_.each=xt,_.extend=Gr,_.methods=st,_.object=qt,_.select=wt,_.tail=zt,_.unique=Qr,Lt(_),_.chain=_,_.prototype.chain=function(){return this},_.clone=pt,_.cloneDeep=function(n,t,r){return pt(n,y,t,r)},_.contains=Ct,_.escape=function(n){return n==d?"":Yt(n).replace(R,ut)},_.every=jt,_.find=kt,_.findIndex=function(n,t,r){var e=-1,u=n?n.length:0;for(t=_.createCallback(t,r);++e<u;)if(t(n[e],e,n))return e;return-1},_.findKey=function(n,t,r){var e;return t=_.createCallback(t,r),Kr(n,function(n,r,u){return t(n,r,u)?(e=r,b):void 0
|
||||||
|
}),e},_.has=function(n,t){return n?sr.call(n,t):b},_.identity=Wt,_.indexOf=Pt,_.isArguments=ft,_.isArray=qr,_.isBoolean=function(n){return n===y||n===false||yr.call(n)==J},_.isDate=function(n){return n?typeof n=="object"&&yr.call(n)==K:b},_.isElement=function(n){return n?1===n.nodeType:b},_.isEmpty=function(n){var t=y;if(!n)return t;var r=yr.call(n),e=n.length;return r==H||r==Y||(Pr.argsClass?r==G:ft(n))||r==Q&&typeof e=="number"&&ht(n.splice)?!e:(Kr(n,function(){return t=b}),t)},_.isEqual=vt,_.isFinite=function(n){return Cr(n)&&!jr(parseFloat(n))
|
||||||
|
},_.isFunction=ht,_.isNaN=function(n){return yt(n)&&n!=+n},_.isNull=function(n){return n===d},_.isNumber=yt,_.isObject=mt,_.isPlainObject=Mr,_.isRegExp=function(n){return!(!n||!nt[typeof n])&&yr.call(n)==X},_.isString=dt,_.isUndefined=function(n){return typeof n=="undefined"},_.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?kr(0,e+r):xr(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},_.mixin=Lt,_.noConflict=function(){return e._=ur,this},_.parseInt=Xr,_.random=function(n,t){n==d&&t==d&&(t=1),n=+n||0,t==d?(t=n,n=0):t=+t||0;
|
||||||
|
var r=Er();return n%1||t%1?n+xr(r*(t-n+parseFloat("1e-"+((r+"").length-1))),t):n+cr(r*(t-n+1))},_.reduce=St,_.reduceRight=At,_.result=function(n,t){var r=n?n[t]:m;return ht(r)?n[t]():r},_.runInContext=h,_.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Rr(n).length},_.some=It,_.sortedIndex=Ft,_.template=function(n,t,r){var e=_.templateSettings;n||(n=""),r=Hr({},r,e);var u,a=Hr({},r.imports,e.imports),e=Rr(a),a=_t(a),o=0,l=r.interpolate||D,c="__p+='",l=Xt((r.escape||D).source+"|"+l.source+"|"+(l===z?N:D).source+"|"+(r.evaluate||D).source+"|$","g");
|
||||||
|
n.replace(l,function(t,r,e,a,l,f){return e||(e=a),c+=n.slice(o,f).replace(T,i),r&&(c+="'+__e("+r+")+'"),l&&(u=y,c+="';"+l+";__p+='"),e&&(c+="'+((__t=("+e+"))==null?'':__t)+'"),o=f+t.length,t}),c+="';\n",l=r=r.variable,l||(r="obj",c="with("+r+"){"+c+"}"),c=(u?c.replace(S,""):c).replace(A,"$1").replace(I,"$1;"),c="function("+r+"){"+(l?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+c+"return __p}";try{var f=Mt(e,"return "+c).apply(m,a)
|
||||||
|
}catch(p){throw p.source=c,p}return t?f(t):(f.source=c,f)},_.unescape=function(n){return n==d?"":Yt(n).replace(B,ct)},_.uniqueId=function(n){var t=++j;return Yt(n==d?"":n)+t},_.all=jt,_.any=It,_.detect=kt,_.findWhere=kt,_.foldl=St,_.foldr=At,_.include=Ct,_.inject=St,Kr(_,function(n,t){_.prototype[t]||(_.prototype[t]=function(){var t=[this.__wrapped__];return gr.apply(t,arguments),n.apply(_,t)})}),_.first=Nt,_.last=function(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=d){var a=u;for(t=_.createCallback(t,r);a--&&t(n[a],a,n);)e++
|
||||||
|
}else if(e=t,e==d||r)return n[u-1];return v(n,kr(0,u-e))}},_.take=Nt,_.head=Nt,Kr(_,function(n,t){_.prototype[t]||(_.prototype[t]=function(t,r){var e=n(this.__wrapped__,t,r);return t==d||r&&typeof t!="function"?e:new C(e)})}),_.VERSION="1.3.1",_.prototype.toString=function(){return Yt(this.__wrapped__)},_.prototype.value=Gt,_.prototype.valueOf=Gt,Tr(["join","pop","shift"],function(n){var t=nr[n];_.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),Tr(["push","reverse","sort","unshift"],function(n){var t=nr[n];
|
||||||
|
_.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Tr(["concat","slice","splice"],function(n){var t=nr[n];_.prototype[n]=function(){return new C(t.apply(this.__wrapped__,arguments))}}),Pr.spliceObjects||Tr(["pop","shift","splice"],function(n){var t=nr[n],r="splice"==n;_.prototype[n]=function(){var n=this.__wrapped__,e=t.apply(n,arguments);return 0===n.length&&delete n[0],r?new C(e):e}}),_}var m,y=!0,d=null,b=!1,_=[],C=[],j=0,w={},x=+new Date+"",O=75,E=40,S=/\b__p\+='';/g,A=/\b(__p\+=)''\+/g,I=/(__e\(.*?\)|\b__t\))\+'';/g,B=/&(?:amp|lt|gt|quot|#39);/g,N=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,P=/\w*$/,z=/<%=([\s\S]+?)%>/g,F=(F=/\bthis\b/)&&F.test(h)&&F,$=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",q=RegExp("^["+$+"]*0+(?=.$)"),D=/($^)/,R=/[&<>"']/g,T=/['\n\r\t\u2028\u2029\\]/g,W="Array Boolean Date Error Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),L="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),G="[object Arguments]",H="[object Array]",J="[object Boolean]",K="[object Date]",M="[object Error]",U="[object Function]",V="[object Number]",Q="[object Object]",X="[object RegExp]",Y="[object String]",Z={};
|
||||||
|
Z[U]=b,Z[G]=Z[H]=Z[J]=Z[K]=Z[V]=Z[Q]=Z[X]=Z[Y]=y;var nt={"boolean":b,"function":y,object:y,number:b,string:b,undefined:b},tt={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},rt=nt[typeof exports]&&exports,et=nt[typeof module]&&module&&module.exports==rt&&module,ut=nt[typeof global]&&global;!ut||ut.global!==ut&&ut.window!==ut||(n=ut);var at=h();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=at, define(function(){return at})):rt&&!rt.nodeType?et?(et.exports=at)._=at:rt._=at:n._=at
|
||||||
|
}(this);
|
||||||
5555
dist/lodash.js
vendored
Normal file
48
dist/lodash.min.js
vendored
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
/**
|
||||||
|
* @license
|
||||||
|
* Lo-Dash 1.3.1 (Custom Build) lodash.com/license
|
||||||
|
* Build: `lodash modern -o ./dist/lodash.js`
|
||||||
|
* Underscore.js 1.4.4 underscorejs.org/LICENSE
|
||||||
|
*/
|
||||||
|
;!function(n){function t(n,t,e){e=(e||0)-1;for(var r=n.length;++e<r;)if(n[e]===t)return e;return-1}function e(n,e){var r=typeof e;if(n=n.k,"boolean"==r||e==h)return n[e];"number"!=r&&"string"!=r&&(r="object");var u="number"==r?e:j+e;return n=n[r]||(n[r]={}),"object"==r?n[u]&&-1<t(n[u],e)?0:-1:n[u]?0:-1}function r(n){var t=this.k,e=typeof n;if("boolean"==e||n==h)t[n]=y;else{"number"!=e&&"string"!=e&&(e="object");var r="number"==e?n:j+n,u=t[e]||(t[e]={});"object"==e?(u[r]||(u[r]=[])).push(n)==this.b.length&&(t[e]=b):u[r]=y
|
||||||
|
}}function u(n){return n.charCodeAt(0)}function a(n,t){var e=n.m,r=t.m;if(n=n.l,t=t.l,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1}return e<r?-1:1}function o(n){var t=-1,e=n.length,u=l();u["false"]=u["null"]=u["true"]=u.undefined=b;var a=l();for(a.b=n,a.k=u,a.push=r;++t<e;)a.push(n[t]);return u.object===false?(p(a),h):a}function i(n){return"\\"+Q[n]}function f(){return m.pop()||[]}function l(){return d.pop()||{b:h,k:h,l:h,"false":b,m:0,leading:b,maxWait:0,"null":b,number:h,object:h,push:h,string:h,trailing:b,"true":b,undefined:b,n:h}
|
||||||
|
}function c(n){n.length=0,m.length<C&&m.push(n)}function p(n){var t=n.k;t&&p(t),n.b=n.k=n.l=n.object=n.number=n.string=n.n=h,d.length<C&&d.push(n)}function s(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Array(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function v(r){function m(n){if(!n||ve.call(n)!=V)return b;var t=n.valueOf,e=typeof t=="function"&&(e=fe(t))&&fe(e);return e?n==e||fe(n)==e:it(n)}function d(n,t,e){if(!n||!L[typeof n])return n;t=t&&typeof e=="undefined"?t:tt.createCallback(t,e);
|
||||||
|
for(var r=-1,u=L[typeof n]&&Se(n),a=u?u.length:0;++r<a&&(e=u[r],!(t(n[e],e,n)===false)););return n}function C(n,t,e){var r;if(!n||!L[typeof n])return n;t=t&&typeof e=="undefined"?t:tt.createCallback(t,e);for(r in n)if(t(n[r],r,n)===false)break;return n}function Q(n,t,e){var r,u=n,a=u;if(!u)return a;for(var o=arguments,i=0,f=typeof e=="number"?2:o.length;++i<f;)if((u=o[i])&&L[typeof u])for(var l=-1,c=L[typeof u]&&Se(u),p=c?c.length:0;++l<p;)r=c[l],"undefined"==typeof a[r]&&(a[r]=u[r]);return a}function X(n,t,e){var r,u=n,a=u;
|
||||||
|
if(!u)return a;var o=arguments,i=0,f=typeof e=="number"?2:o.length;if(3<f&&"function"==typeof o[f-2])var l=tt.createCallback(o[--f-1],o[f--],2);else 2<f&&"function"==typeof o[f-1]&&(l=o[--f]);for(;++i<f;)if((u=o[i])&&L[typeof u])for(var c=-1,p=L[typeof u]&&Se(u),s=p?p.length:0;++c<s;)r=p[c],a[r]=l?l(a[r],u[r]):u[r];return a}function Z(n){var t,e=[];if(!n||!L[typeof n])return e;for(t in n)le.call(n,t)&&e.push(t);return e}function tt(n){return n&&typeof n=="object"&&!Ee(n)&&le.call(n,"__wrapped__")?n:new et(n)
|
||||||
|
}function et(n){this.__wrapped__=n}function rt(n,t,e,r){function u(){var r=arguments,l=o?this:t;return a||(n=t[i]),e.length&&(r=r.length?(r=Ce.call(r),f?r.concat(e):e.concat(r)):e),this instanceof u?(l=gt(n.prototype)?ye(n.prototype):{},r=n.apply(l,r),gt(r)?r:l):n.apply(l,r)}var a=vt(n),o=!e,i=t;if(o){var f=r;e=t}else if(!a){if(!r)throw new Yt;t=n}return u}function ut(n){return Ie[n]}function at(){var n=(n=tt.indexOf)===$t?t:n;return n}function ot(n){return function(t,e,r,u){return typeof e!="boolean"&&e!=h&&(u=r,r=u&&u[e]===t?g:e,e=b),r!=h&&(r=tt.createCallback(r,u)),n(t,e,r,u)
|
||||||
|
}}function it(n){var t,e;return n&&ve.call(n)==V&&(t=n.constructor,!vt(t)||t instanceof t)?(C(n,function(n,t){e=t}),e===g||le.call(n,e)):b}function ft(n){return Ae[n]}function lt(n,t,e,r,u,a){var o=n;if(typeof t!="boolean"&&t!=h&&(r=e,e=t,t=b),typeof e=="function"){if(e=typeof r=="undefined"?e:tt.createCallback(e,r,1),o=e(o),typeof o!="undefined")return o;o=n}if(r=gt(o)){var i=ve.call(o);if(!J[i])return o;var l=Ee(o)}if(!r||!t)return r?l?s(o):X({},o):o;switch(r=xe[i],i){case P:case K:return new r(+o);
|
||||||
|
case U:case H:return new r(o);case G:return r(o.source,A.exec(o))}i=!u,u||(u=f()),a||(a=f());for(var p=u.length;p--;)if(u[p]==n)return a[p];return o=l?r(o.length):{},l&&(le.call(n,"index")&&(o.index=n.index),le.call(n,"input")&&(o.input=n.input)),u.push(n),a.push(o),(l?wt:d)(n,function(n,r){o[r]=lt(n,t,e,g,u,a)}),i&&(c(u),c(a)),o}function ct(n){var t=[];return C(n,function(n,e){vt(n)&&t.push(e)}),t.sort()}function pt(n){for(var t=-1,e=Se(n),r=e.length,u={};++t<r;){var a=e[t];u[n[a]]=a}return u}function st(n,t,e,r,u,a){var o=e===k;
|
||||||
|
if(typeof e=="function"&&!o){e=tt.createCallback(e,r,2);var i=e(n,t);if(typeof i!="undefined")return!!i}if(n===t)return 0!==n||1/n==1/t;var l=typeof n,p=typeof t;if(n===n&&(!n||"function"!=l&&"object"!=l)&&(!t||"function"!=p&&"object"!=p))return b;if(n==h||t==h)return n===t;if(p=ve.call(n),l=ve.call(t),p==z&&(p=V),l==z&&(l=V),p!=l)return b;switch(p){case P:case K:return+n==+t;case U:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case G:case H:return n==Xt(t)}if(l=p==W,!l){if(le.call(n,"__wrapped__")||le.call(t,"__wrapped__"))return st(n.__wrapped__||n,t.__wrapped__||t,e,r,u,a);
|
||||||
|
if(p!=V)return b;var p=n.constructor,s=t.constructor;if(p!=s&&(!vt(p)||!(p instanceof p&&vt(s)&&s instanceof s)))return b}for(s=!u,u||(u=f()),a||(a=f()),p=u.length;p--;)if(u[p]==n)return a[p]==t;var v=0,i=y;if(u.push(n),a.push(t),l){if(p=n.length,v=t.length,i=v==n.length,!i&&!o)return i;for(;v--;)if(l=p,s=t[v],o)for(;l--&&!(i=st(n[l],s,e,r,u,a)););else if(!(i=st(n[v],s,e,r,u,a)))break;return i}return C(t,function(t,o,f){return le.call(f,o)?(v++,i=le.call(n,o)&&st(n[o],t,e,r,u,a)):void 0}),i&&!o&&C(n,function(n,t,e){return le.call(e,t)?i=-1<--v:void 0
|
||||||
|
}),s&&(c(u),c(a)),i}function vt(n){return typeof n=="function"}function gt(n){return!(!n||!L[typeof n])}function yt(n){return typeof n=="number"||ve.call(n)==U}function ht(n){return typeof n=="string"||ve.call(n)==H}function bt(n,t,e){var r=arguments,u=0,a=2;if(!gt(n))return n;if(e===k)var o=r[3],i=r[4],l=r[5];else{var p=y,i=f(),l=f();typeof e!="number"&&(a=r.length),3<a&&"function"==typeof r[a-2]?o=tt.createCallback(r[--a-1],r[a--],2):2<a&&"function"==typeof r[a-1]&&(o=r[--a])}for(;++u<a;)(Ee(r[u])?wt:d)(r[u],function(t,e){var r,u,a=t,f=n[e];
|
||||||
|
if(t&&((u=Ee(t))||m(t))){for(a=i.length;a--;)if(r=i[a]==t){f=l[a];break}if(!r){var c;o&&(a=o(f,t),c=typeof a!="undefined")&&(f=a),c||(f=u?Ee(f)?f:[]:m(f)?f:{}),i.push(t),l.push(f),c||(f=bt(f,t,k,o,i,l))}}else o&&(a=o(f,t),typeof a=="undefined"&&(a=t)),typeof a!="undefined"&&(f=a);n[e]=f});return p&&(c(i),c(l)),n}function mt(n){for(var t=-1,e=Se(n),r=e.length,u=Mt(r);++t<r;)u[t]=n[e[t]];return u}function dt(n,t,e){var r=-1,u=at(),a=n?n.length:0,o=b;return e=(0>e?_e(0,a+e):e)||0,a&&typeof a=="number"?o=-1<(ht(n)?n.indexOf(t,e):u(n,t,e)):d(n,function(n){return++r<e?void 0:!(o=n===t)
|
||||||
|
}),o}function _t(n,t,e){var r=y;t=tt.createCallback(t,e),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u&&(r=!!t(n[e],e,n)););else d(n,function(n,e,u){return r=!!t(n,e,u)});return r}function kt(n,t,e){var r=[];t=tt.createCallback(t,e),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u;){var a=n[e];t(a,e,n)&&r.push(a)}else d(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function jt(n,t,e){t=tt.createCallback(t,e),e=-1;var r=n?n.length:0;if(typeof r!="number"){var u;return d(n,function(n,e,r){return t(n,e,r)?(u=n,b):void 0
|
||||||
|
}),u}for(;++e<r;){var a=n[e];if(t(a,e,n))return a}}function wt(n,t,e){var r=-1,u=n?n.length:0;if(t=t&&typeof e=="undefined"?t:tt.createCallback(t,e),typeof u=="number")for(;++r<u&&t(n[r],r,n)!==false;);else d(n,t);return n}function Ct(n,t,e){var r=-1,u=n?n.length:0;if(t=tt.createCallback(t,e),typeof u=="number")for(var a=Mt(u);++r<u;)a[r]=t(n[r],r,n);else a=[],d(n,function(n,e,u){a[++r]=t(n,e,u)});return a}function xt(n,t,e){var r=-1/0,a=r;if(!t&&Ee(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];i>a&&(a=i)
|
||||||
|
}}else t=!t&&ht(n)?u:tt.createCallback(t,e),wt(n,function(n,e,u){e=t(n,e,u),e>r&&(r=e,a=n)});return a}function Ot(n,t){var e=-1,r=n?n.length:0;if(typeof r=="number")for(var u=Mt(r);++e<r;)u[e]=n[e][t];return u||Ct(n,t)}function Et(n,t,e,r){if(!n)return e;var u=3>arguments.length;t=tt.createCallback(t,r,4);var a=-1,o=n.length;if(typeof o=="number")for(u&&(e=n[++a]);++a<o;)e=t(e,n[a],a,n);else d(n,function(n,r,a){e=u?(u=b,n):t(e,n,r,a)});return e}function St(n,t,e,r){var u=n?n.length:0,a=3>arguments.length;
|
||||||
|
if(typeof u!="number")var o=Se(n),u=o.length;return t=tt.createCallback(t,r,4),wt(n,function(r,i,f){i=o?o[--u]:--u,e=a?(a=b,n[i]):t(e,n[i],i,f)}),e}function It(n,t,e){var r;t=tt.createCallback(t,e),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u&&!(r=t(n[e],e,n)););else d(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function At(n){var r=-1,u=at(),a=n?n.length:0,i=ae.apply(Zt,Ce.call(arguments,1)),f=[],l=a>=w&&u===t;if(l){var c=o(i);c?(u=e,i=c):l=b}for(;++r<a;)c=n[r],0>u(i,c)&&f.push(c);
|
||||||
|
return l&&p(i),f}function Nt(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&t!=h){var a=-1;for(t=tt.createCallback(t,e);++a<u&&t(n[a],a,n);)r++}else if(r=t,r==h||e)return n[0];return s(n,0,ke(_e(0,r),u))}}function $t(n,e,r){if(typeof r=="number"){var u=n?n.length:0;r=0>r?_e(0,u+r):r||0}else if(r)return r=Ft(n,e),n[r]===e?r:-1;return n?t(n,e,r):-1}function Bt(n,t,e){if(typeof t!="number"&&t!=h){var r=0,u=-1,a=n?n.length:0;for(t=tt.createCallback(t,e);++u<a&&t(n[u],u,n);)r++}else r=t==h||e?1:_e(0,t);
|
||||||
|
return s(n,r)}function Ft(n,t,e,r){var u=0,a=n?n.length:u;for(e=e?tt.createCallback(e,r,1):Wt,t=e(t);u<a;)r=u+a>>>1,e(n[r])<t?u=r+1:a=r;return u}function Rt(n){for(var t=-1,e=n?xt(Ot(n,"length")):0,r=Mt(0>e?0:e);++t<e;)r[t]=Ot(n,t);return r}function Tt(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var a=n[e];t?u[a]=t[e]:u[a[0]]=a[1]}return u}function qt(n,t){return Oe.fastBind||ge&&2<arguments.length?ge.call.apply(ge,arguments):rt(n,t,Ce.call(arguments,2))}function Dt(n,t,e){function r(){ue(s),ue(v),l=0,s=v=h
|
||||||
|
}function u(){var t=g&&(!m||1<l);r(),t&&(p!==false&&(c=new Vt),i=n.apply(f,o))}function a(){r(),(g||p!==t)&&(c=new Vt,i=n.apply(f,o))}var o,i,f,l=0,c=0,p=b,s=h,v=h,g=y;if(t=_e(0,t||0),e===y)var m=y,g=b;else gt(e)&&(m=e.leading,p="maxWait"in e&&_e(t,e.maxWait||0),g="trailing"in e?e.trailing:g);return function(){if(o=arguments,f=this,l++,ue(v),p===false)m&&2>l&&(i=n.apply(f,o));else{var e=new Vt;!s&&!m&&(c=e);var r=p-(e-c);0<r?s||(s=se(a,r)):(ue(s),s=h,c=e,i=n.apply(f,o))}return t!==p&&(v=se(u,t)),i}}function zt(n){var t=Ce.call(arguments,1);
|
||||||
|
return se(function(){n.apply(g,t)},1)}function Wt(n){return n}function Pt(n){wt(ct(n),function(t){var e=tt[t]=n[t];tt.prototype[t]=function(){var n=this.__wrapped__,t=[n];return ce.apply(t,arguments),t=e.apply(tt,t),n&&typeof n=="object"&&n===t?this:new et(t)}})}function Kt(){return this.__wrapped__}r=r?nt.defaults(n.Object(),r,nt.pick(n,D)):n;var Mt=r.Array,Ut=r.Boolean,Vt=r.Date,Gt=r.Function,Ht=r.Math,Jt=r.Number,Lt=r.Object,Qt=r.RegExp,Xt=r.String,Yt=r.TypeError,Zt=[],ne=Lt.prototype,te=r._,ee=Qt("^"+Xt(ne.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),re=Ht.ceil,ue=r.clearTimeout,ae=Zt.concat,oe=Ht.floor,ie=Gt.prototype.toString,fe=ee.test(fe=Lt.getPrototypeOf)&&fe,le=ne.hasOwnProperty,ce=Zt.push,pe=r.setImmediate,se=r.setTimeout,ve=ne.toString,ge=ee.test(ge=ve.bind)&&ge,ye=ee.test(ye=Lt.create)&&ye,he=ee.test(he=Mt.isArray)&&he,be=r.isFinite,me=r.isNaN,de=ee.test(de=Lt.keys)&&de,_e=Ht.max,ke=Ht.min,je=r.parseInt,we=Ht.random,Ce=Zt.slice,Ht=ee.test(r.attachEvent),Ht=ge&&!/\n|true/.test(ge+Ht),xe={};
|
||||||
|
xe[W]=Mt,xe[P]=Ut,xe[K]=Vt,xe[M]=Gt,xe[V]=Lt,xe[U]=Jt,xe[G]=Qt,xe[H]=Xt,et.prototype=tt.prototype;var Oe=tt.support={};Oe.fastBind=ge&&!Ht,tt.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:N,variable:"",imports:{_:tt}};var Ee=he,Se=de?function(n){return gt(n)?de(n):[]}:Z,Ie={"&":"&","<":"<",">":">",'"':""","'":"'"},Ae=pt(Ie),Ut=ot(function $e(n,t,e){for(var r=-1,u=n?n.length:0,a=[];++r<u;){var o=n[r];e&&(o=e(o,r,n)),Ee(o)?ce.apply(a,t?o:$e(o)):a.push(o)
|
||||||
|
}return a}),Ne=ot(function(n,r,u){var a=-1,i=at(),l=n?n.length:0,s=[],v=!r&&l>=w&&i===t,g=u||v?f():s;if(v){var y=o(g);y?(i=e,g=y):(v=b,g=u?g:(c(g),s))}for(;++a<l;){var y=n[a],h=u?u(y,a,n):y;(r?!a||g[g.length-1]!==h:0>i(g,h))&&((u||v)&&g.push(h),s.push(y))}return v?(c(g.b),p(g)):u&&c(g),s});return Ht&&Y&&typeof pe=="function"&&(zt=qt(pe,r)),pe=8==je(B+"08")?je:function(n,t){return je(ht(n)?n.replace(F,""):n,t||0)},tt.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0
|
||||||
|
}},tt.assign=X,tt.at=function(n){for(var t=-1,e=ae.apply(Zt,Ce.call(arguments,1)),r=e.length,u=Mt(r);++t<r;)u[t]=n[e[t]];return u},tt.bind=qt,tt.bindAll=function(n){for(var t=1<arguments.length?ae.apply(Zt,Ce.call(arguments,1)):ct(n),e=-1,r=t.length;++e<r;){var u=t[e];n[u]=qt(n[u],n)}return n},tt.bindKey=function(n,t){return rt(n,t,Ce.call(arguments,2),k)},tt.compact=function(n){for(var t=-1,e=n?n.length:0,r=[];++t<e;){var u=n[t];u&&r.push(u)}return r},tt.compose=function(){var n=arguments;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];
|
||||||
|
return t[0]}},tt.countBy=function(n,t,e){var r={};return t=tt.createCallback(t,e),wt(n,function(n,e,u){e=Xt(t(n,e,u)),le.call(r,e)?r[e]++:r[e]=1}),r},tt.createCallback=function(n,t,e){if(n==h)return Wt;var r=typeof n;if("function"!=r){if("object"!=r)return function(t){return t[n]};var u=Se(n);return function(t){for(var e=u.length,r=b;e--&&(r=st(t[u[e]],n[u[e]],k)););return r}}return typeof t=="undefined"||$&&!$.test(ie.call(n))?n:1===e?function(e){return n.call(t,e)}:2===e?function(e,r){return n.call(t,e,r)
|
||||||
|
}:4===e?function(e,r,u,a){return n.call(t,e,r,u,a)}:function(e,r,u){return n.call(t,e,r,u)}},tt.debounce=Dt,tt.defaults=Q,tt.defer=zt,tt.delay=function(n,t){var e=Ce.call(arguments,2);return se(function(){n.apply(g,e)},t)},tt.difference=At,tt.filter=kt,tt.flatten=Ut,tt.forEach=wt,tt.forIn=C,tt.forOwn=d,tt.functions=ct,tt.groupBy=function(n,t,e){var r={};return t=tt.createCallback(t,e),wt(n,function(n,e,u){e=Xt(t(n,e,u)),(le.call(r,e)?r[e]:r[e]=[]).push(n)}),r},tt.initial=function(n,t,e){if(!n)return[];
|
||||||
|
var r=0,u=n.length;if(typeof t!="number"&&t!=h){var a=u;for(t=tt.createCallback(t,e);a--&&t(n[a],a,n);)r++}else r=t==h||e?1:t||r;return s(n,0,ke(_e(0,u-r),u))},tt.intersection=function(n){for(var r=arguments,u=r.length,a=-1,i=f(),l=-1,s=at(),v=n?n.length:0,g=[],y=f();++a<u;){var h=r[a];i[a]=s===t&&(h?h.length:0)>=w&&o(a?r[a]:y)}n:for(;++l<v;){var b=i[0],h=n[l];if(0>(b?e(b,h):s(y,h))){for(a=u,(b||y).push(h);--a;)if(b=i[a],0>(b?e(b,h):s(r[a],h)))continue n;g.push(h)}}for(;u--;)(b=i[u])&&p(b);return c(i),c(y),g
|
||||||
|
},tt.invert=pt,tt.invoke=function(n,t){var e=Ce.call(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=Mt(typeof a=="number"?a:0);return wt(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},tt.keys=Se,tt.map=Ct,tt.max=xt,tt.memoize=function(n,t){function e(){var r=e.cache,u=j+(t?t.apply(this,arguments):arguments[0]);return le.call(r,u)?r[u]:r[u]=n.apply(this,arguments)}return e.cache={},e},tt.merge=bt,tt.min=function(n,t,e){var r=1/0,a=r;if(!t&&Ee(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];
|
||||||
|
i<a&&(a=i)}}else t=!t&&ht(n)?u:tt.createCallback(t,e),wt(n,function(n,e,u){e=t(n,e,u),e<r&&(r=e,a=n)});return a},tt.omit=function(n,t,e){var r=at(),u=typeof t=="function",a={};if(u)t=tt.createCallback(t,e);else var o=ae.apply(Zt,Ce.call(arguments,1));return C(n,function(n,e,i){(u?!t(n,e,i):0>r(o,e))&&(a[e]=n)}),a},tt.once=function(n){var t,e;return function(){return t?e:(t=y,e=n.apply(this,arguments),n=h,e)}},tt.pairs=function(n){for(var t=-1,e=Se(n),r=e.length,u=Mt(r);++t<r;){var a=e[t];u[t]=[a,n[a]]
|
||||||
|
}return u},tt.partial=function(n){return rt(n,Ce.call(arguments,1))},tt.partialRight=function(n){return rt(n,Ce.call(arguments,1),h,k)},tt.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,a=ae.apply(Zt,Ce.call(arguments,1)),o=gt(n)?a.length:0;++u<o;){var i=a[u];i in n&&(r[i]=n[i])}else t=tt.createCallback(t,e),C(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},tt.pluck=Ot,tt.range=function(n,t,e){n=+n||0,e=+e||1,t==h&&(t=n,n=0);var r=-1;t=_e(0,re((t-n)/e));for(var u=Mt(t);++r<t;)u[r]=n,n+=e;
|
||||||
|
return u},tt.reject=function(n,t,e){return t=tt.createCallback(t,e),kt(n,function(n,e,r){return!t(n,e,r)})},tt.rest=Bt,tt.shuffle=function(n){var t=-1,e=n?n.length:0,r=Mt(typeof e=="number"?e:0);return wt(n,function(n){var e=oe(we()*(++t+1));r[t]=r[e],r[e]=n}),r},tt.sortBy=function(n,t,e){var r=-1,u=n?n.length:0,o=Mt(typeof u=="number"?u:0);for(t=tt.createCallback(t,e),wt(n,function(n,e,u){var a=o[++r]=l();a.l=t(n,e,u),a.m=r,a.n=n}),u=o.length,o.sort(a);u--;)n=o[u],o[u]=n.n,p(n);return o},tt.tap=function(n,t){return t(n),n
|
||||||
|
},tt.throttle=function(n,t,e){var r=y,u=y;return e===false?r=b:gt(e)&&(r="leading"in e?e.leading:r,u="trailing"in e?e.trailing:u),e=l(),e.leading=r,e.maxWait=t,e.trailing=u,n=Dt(n,t,e),p(e),n},tt.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Mt(n);for(t=tt.createCallback(t,e,1);++r<n;)u[r]=t(r);return u},tt.toArray=function(n){return n&&typeof n.length=="number"?s(n):mt(n)},tt.transform=function(n,t,e,r){var u=Ee(n);return t=tt.createCallback(t,r,4),e==h&&(u?e=[]:(r=n&&n.constructor,e=gt(r&&r.prototype)?ye(r&&r.prototype):{})),(u?wt:d)(n,function(n,r,u){return t(e,n,r,u)
|
||||||
|
}),e},tt.union=function(n){return Ee(n)||(arguments[0]=n?Ce.call(n):Zt),Ne(ae.apply(Zt,arguments))},tt.uniq=Ne,tt.unzip=Rt,tt.values=mt,tt.where=kt,tt.without=function(n){return At(n,Ce.call(arguments,1))},tt.wrap=function(n,t){return function(){var e=[n];return ce.apply(e,arguments),t.apply(this,e)}},tt.zip=function(n){return n?Rt(arguments):[]},tt.zipObject=Tt,tt.collect=Ct,tt.drop=Bt,tt.each=wt,tt.extend=X,tt.methods=ct,tt.object=Tt,tt.select=kt,tt.tail=Bt,tt.unique=Ne,Pt(tt),tt.chain=tt,tt.prototype.chain=function(){return this
|
||||||
|
},tt.clone=lt,tt.cloneDeep=function(n,t,e){return lt(n,y,t,e)},tt.contains=dt,tt.escape=function(n){return n==h?"":Xt(n).replace(T,ut)},tt.every=_t,tt.find=jt,tt.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=tt.createCallback(t,e);++r<u;)if(t(n[r],r,n))return r;return-1},tt.findKey=function(n,t,e){var r;return t=tt.createCallback(t,e),d(n,function(n,e,u){return t(n,e,u)?(r=e,b):void 0}),r},tt.has=function(n,t){return n?le.call(n,t):b},tt.identity=Wt,tt.indexOf=$t,tt.isArguments=function(n){return ve.call(n)==z
|
||||||
|
},tt.isArray=Ee,tt.isBoolean=function(n){return n===y||n===false||ve.call(n)==P},tt.isDate=function(n){return n?typeof n=="object"&&ve.call(n)==K:b},tt.isElement=function(n){return n?1===n.nodeType:b},tt.isEmpty=function(n){var t=y;if(!n)return t;var e=ve.call(n),r=n.length;return e==W||e==H||e==z||e==V&&typeof r=="number"&&vt(n.splice)?!r:(d(n,function(){return t=b}),t)},tt.isEqual=st,tt.isFinite=function(n){return be(n)&&!me(parseFloat(n))},tt.isFunction=vt,tt.isNaN=function(n){return yt(n)&&n!=+n
|
||||||
|
},tt.isNull=function(n){return n===h},tt.isNumber=yt,tt.isObject=gt,tt.isPlainObject=m,tt.isRegExp=function(n){return n?typeof n=="object"&&ve.call(n)==G:b},tt.isString=ht,tt.isUndefined=function(n){return typeof n=="undefined"},tt.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?_e(0,r+e):ke(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},tt.mixin=Pt,tt.noConflict=function(){return r._=te,this},tt.parseInt=pe,tt.random=function(n,t){n==h&&t==h&&(t=1),n=+n||0,t==h?(t=n,n=0):t=+t||0;
|
||||||
|
var e=we();return n%1||t%1?n+ke(e*(t-n+parseFloat("1e-"+((e+"").length-1))),t):n+oe(e*(t-n+1))},tt.reduce=Et,tt.reduceRight=St,tt.result=function(n,t){var e=n?n[t]:g;return vt(e)?n[t]():e},tt.runInContext=v,tt.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Se(n).length},tt.some=It,tt.sortedIndex=Ft,tt.template=function(n,t,e){var r=tt.templateSettings;n||(n=""),e=Q({},e,r);var u,a=Q({},e.imports,r.imports),r=Se(a),a=mt(a),o=0,f=e.interpolate||R,l="__p+='",f=Qt((e.escape||R).source+"|"+f.source+"|"+(f===N?I:R).source+"|"+(e.evaluate||R).source+"|$","g");
|
||||||
|
n.replace(f,function(t,e,r,a,f,c){return r||(r=a),l+=n.slice(o,c).replace(q,i),e&&(l+="'+__e("+e+")+'"),f&&(u=y,l+="';"+f+";__p+='"),r&&(l+="'+((__t=("+r+"))==null?'':__t)+'"),o=c+t.length,t}),l+="';\n",f=e=e.variable,f||(e="obj",l="with("+e+"){"+l+"}"),l=(u?l.replace(x,""):l).replace(O,"$1").replace(E,"$1;"),l="function("+e+"){"+(f?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";try{var c=Gt(r,"return "+l).apply(g,a)
|
||||||
|
}catch(p){throw p.source=l,p}return t?c(t):(c.source=l,c)},tt.unescape=function(n){return n==h?"":Xt(n).replace(S,ft)},tt.uniqueId=function(n){var t=++_;return Xt(n==h?"":n)+t},tt.all=_t,tt.any=It,tt.detect=jt,tt.findWhere=jt,tt.foldl=Et,tt.foldr=St,tt.include=dt,tt.inject=Et,d(tt,function(n,t){tt.prototype[t]||(tt.prototype[t]=function(){var t=[this.__wrapped__];return ce.apply(t,arguments),n.apply(tt,t)})}),tt.first=Nt,tt.last=function(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&t!=h){var a=u;
|
||||||
|
for(t=tt.createCallback(t,e);a--&&t(n[a],a,n);)r++}else if(r=t,r==h||e)return n[u-1];return s(n,_e(0,u-r))}},tt.take=Nt,tt.head=Nt,d(tt,function(n,t){tt.prototype[t]||(tt.prototype[t]=function(t,e){var r=n(this.__wrapped__,t,e);return t==h||e&&typeof t!="function"?r:new et(r)})}),tt.VERSION="1.3.1",tt.prototype.toString=function(){return Xt(this.__wrapped__)},tt.prototype.value=Kt,tt.prototype.valueOf=Kt,wt(["join","pop","shift"],function(n){var t=Zt[n];tt.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)
|
||||||
|
}}),wt(["push","reverse","sort","unshift"],function(n){var t=Zt[n];tt.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),wt(["concat","slice","splice"],function(n){var t=Zt[n];tt.prototype[n]=function(){return new et(t.apply(this.__wrapped__,arguments))}}),tt}var g,y=!0,h=null,b=!1,m=[],d=[],_=0,k={},j=+new Date+"",w=75,C=40,x=/\b__p\+='';/g,O=/\b(__p\+=)''\+/g,E=/(__e\(.*?\)|\b__t\))\+'';/g,S=/&(?:amp|lt|gt|quot|#39);/g,I=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,A=/\w*$/,N=/<%=([\s\S]+?)%>/g,$=($=/\bthis\b/)&&$.test(v)&&$,B=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",F=RegExp("^["+B+"]*0+(?=.$)"),R=/($^)/,T=/[&<>"']/g,q=/['\n\r\t\u2028\u2029\\]/g,D="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),z="[object Arguments]",W="[object Array]",P="[object Boolean]",K="[object Date]",M="[object Function]",U="[object Number]",V="[object Object]",G="[object RegExp]",H="[object String]",J={};
|
||||||
|
J[M]=b,J[z]=J[W]=J[P]=J[K]=J[U]=J[V]=J[G]=J[H]=y;var L={"boolean":b,"function":y,object:y,number:b,string:b,undefined:b},Q={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},X=L[typeof exports]&&exports,Y=L[typeof module]&&module&&module.exports==X&&module,Z=L[typeof global]&&global;!Z||Z.global!==Z&&Z.window!==Z||(n=Z);var nt=v();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=nt, define(function(){return nt})):X&&!X.nodeType?Y?(Y.exports=nt)._=nt:X._=nt:n._=nt
|
||||||
|
}(this);
|
||||||
4493
dist/lodash.underscore.js
vendored
Normal file
35
dist/lodash.underscore.min.js
vendored
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
/**
|
||||||
|
* @license
|
||||||
|
* Lo-Dash 1.3.1 (Custom Build) lodash.com/license
|
||||||
|
* Build: `lodash underscore exports="amd,commonjs,global,node" -o ./dist/lodash.underscore.js`
|
||||||
|
* Underscore.js 1.4.4 underscorejs.org/LICENSE
|
||||||
|
*/
|
||||||
|
;!function(n){function t(n,t){var r;if(n&>[typeof n])for(r in n)if(Et.call(n,r)&&t(n[r],r,n)===nt)break}function r(n,t){var r;if(n&>[typeof n])for(r in n)if(t(n[r],r,n)===nt)break}function e(n){var t,r=[];if(!n||!gt[typeof n])return r;for(t in n)Et.call(n,t)&&r.push(t);return r}function u(n,t,r){r=(r||0)-1;for(var e=n.length;++r<e;)if(n[r]===t)return r;return-1}function o(n,t){var r=n.m,e=t.m;if(n=n.l,t=t.l,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1}return r<e?-1:1
|
||||||
|
}function i(n){return"\\"+ht[n]}function a(){}function f(n){return n instanceof f?n:new c(n)}function c(n){this.__wrapped__=n}function l(n,t,r){function e(){var f=arguments,c=o?this:t;return u||(n=t[i]),r.length&&(f=f.length?(f=zt.call(f),a?f.concat(r):r.concat(f)):r),this instanceof e?(c=p(n.prototype),f=n.apply(c,f),A(f)?f:c):n.apply(c,f)}var u=w(n),o=!r,i=t;if(o){var a=void 0;r=t}else if(!u)throw new TypeError;return e}function p(n){return A(n)?Ft(n):{}}function s(n){return Wt[n]}function v(){var n=(n=f.indexOf)===U?u:n;
|
||||||
|
return n}function g(n){return Gt[n]}function h(n){return kt.call(n)==it}function y(n){if(!n)return n;for(var t=1,r=arguments.length;t<r;t++){var e=arguments[t];if(e)for(var u in e)n[u]=e[u]}return n}function m(n){if(!n)return n;for(var t=1,r=arguments.length;t<r;t++){var e=arguments[t];if(e)for(var u in e)n[u]==X&&(n[u]=e[u])}return n}function _(n){var t=[];return r(n,function(n,r){w(n)&&t.push(r)}),t.sort()}function d(n){for(var t=-1,r=Vt(n),e=r.length,u={};++t<e;){var o=r[t];u[n[o]]=o}return u}function b(n){if(!n)return Q;
|
||||||
|
if(Ut(n)||O(n))return!n.length;for(var t in n)if(Et.call(n,t))return Y;return Q}function j(n,t,e,u){if(n===t)return 0!==n||1/n==1/t;var o=typeof n,i=typeof t;if(n===n&&(!n||"function"!=o&&"object"!=o)&&(!t||"function"!=i&&"object"!=i))return Y;if(n==X||t==X)return n===t;if(i=kt.call(n),o=kt.call(t),i!=o)return Y;switch(i){case ft:case ct:return+n==+t;case lt:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case st:case vt:return n==t+""}if(o=i==at,!o){if(n instanceof f||t instanceof f)return j(n.__wrapped__||n,t.__wrapped__||t,e,u);
|
||||||
|
if(i!=pt)return Y;var i=n.constructor,a=t.constructor;if(i!=a&&(!w(i)||!(i instanceof i&&w(a)&&a instanceof a)))return Y}for(e||(e=[]),u||(u=[]),i=e.length;i--;)if(e[i]==n)return u[i]==t;var c=Q,l=0;if(e.push(n),u.push(t),o){if(l=t.length,c=l==n.length)for(;l--&&(c=j(n[l],t[l],e,u)););return c}return r(t,function(t,r,o){return Et.call(o,r)?(l++,!(c=Et.call(n,r)&&j(n[r],t,e,u))&&nt):void 0}),c&&r(n,function(n,t,r){return Et.call(r,t)?!(c=-1<--l)&&nt:void 0}),c}function w(n){return typeof n=="function"
|
||||||
|
}function A(n){return!(!n||!gt[typeof n])}function x(n){return typeof n=="number"||kt.call(n)==lt}function O(n){return typeof n=="string"||kt.call(n)==vt}function E(n){for(var t=-1,r=Vt(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function S(n,r){var e=v(),u=n?n.length:0,o=Y;return u&&typeof u=="number"?o=-1<e(n,r):t(n,function(n){return(o=n===r)&&nt}),o}function N(n,r,e){var u=Q;r=J(r,e),e=-1;var o=n?n.length:0;if(typeof o=="number")for(;++e<o&&(u=!!r(n[e],e,n)););else t(n,function(n,t,e){return!(u=!!r(n,t,e))&&nt
|
||||||
|
});return u}function k(n,r,e){var u=[];r=J(r,e),e=-1;var o=n?n.length:0;if(typeof o=="number")for(;++e<o;){var i=n[e];r(i,e,n)&&u.push(i)}else t(n,function(n,t,e){r(n,t,e)&&u.push(n)});return u}function B(n,r,e){r=J(r,e),e=-1;var u=n?n.length:0;if(typeof u!="number"){var o;return t(n,function(n,t,e){return r(n,t,e)?(o=n,nt):void 0}),o}for(;++e<u;){var i=n[e];if(r(i,e,n))return i}}function F(n,r,e){var u=-1,o=n?n.length:0;if(r=r&&typeof e=="undefined"?r:J(r,e),typeof o=="number")for(;++u<o&&r(n[u],u,n)!==nt;);else t(n,r)
|
||||||
|
}function q(n,r,e){var u=-1,o=n?n.length:0;if(r=J(r,e),typeof o=="number")for(var i=Array(o);++u<o;)i[u]=r(n[u],u,n);else i=[],t(n,function(n,t,e){i[++u]=r(n,t,e)});return i}function R(n,t,r){var e=-1/0,u=e,o=-1,i=n?n.length:0;if(t||typeof i!="number")t=J(t,r),F(n,function(n,r,o){r=t(n,r,o),r>e&&(e=r,u=n)});else for(;++o<i;)r=n[o],r>u&&(u=r);return u}function D(n,t){var r=-1,e=n?n.length:0;if(typeof e=="number")for(var u=Array(e);++r<e;)u[r]=n[r][t];return u||q(n,t)}function M(n,r,e,u){if(!n)return e;
|
||||||
|
var o=3>arguments.length;r=J(r,u,4);var i=-1,a=n.length;if(typeof a=="number")for(o&&(e=n[++i]);++i<a;)e=r(e,n[i],i,n);else t(n,function(n,t,u){e=o?(o=Y,n):r(e,n,t,u)});return e}function T(n,t,r,e){var u=n?n.length:0,o=3>arguments.length;if(typeof u!="number")var i=Vt(n),u=i.length;return t=J(t,e,4),F(n,function(e,a,f){a=i?i[--u]:--u,r=o?(o=Y,n[a]):t(r,n[a],a,f)}),r}function $(n,r,e){var u;r=J(r,e),e=-1;var o=n?n.length:0;if(typeof o=="number")for(;++e<o&&!(u=r(n[e],e,n)););else t(n,function(n,t,e){return(u=r(n,t,e))&&nt
|
||||||
|
});return!!u}function I(n,t,r){return r&&b(t)?X:(r?B:k)(n,t)}function z(n){for(var t=-1,r=v(),e=n.length,u=xt.apply(dt,zt.call(arguments,1)),o=[];++t<e;){var i=n[t];0>r(u,i)&&o.push(i)}return o}function C(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=X){var o=-1;for(t=J(t,r);++o<u&&t(n[o],o,n);)e++}else if(e=t,e==X||r)return n[0];return zt.call(n,0,$t(Tt(0,e),u))}}function P(n,t){for(var r=-1,e=n?n.length:0,u=[];++r<e;){var o=n[r];Ut(o)?St.apply(u,t?o:P(o)):u.push(o)}return u}function U(n,t,r){if(typeof r=="number"){var e=n?n.length:0;
|
||||||
|
r=0>r?Tt(0,e+r):r||0}else if(r)return r=W(n,t),n[r]===t?r:-1;return n?u(n,t,r):-1}function V(n,t,r){if(typeof t!="number"&&t!=X){var e=0,u=-1,o=n?n.length:0;for(t=J(t,r);++u<o&&t(n[u],u,n);)e++}else e=t==X||r?1:Tt(0,t);return zt.call(n,e)}function W(n,t,r,e){var u=0,o=n?n.length:u;for(r=r?J(r,e,1):K,t=r(t);u<o;)e=u+o>>>1,r(n[e])<t?u=e+1:o=e;return u}function G(n,t,r,e){var u=-1,o=v(),i=n?n.length:0,a=[],f=a;for(typeof t!="boolean"&&t!=X&&(e=r,r=t,t=Y),r!=X&&(f=[],r=J(r,e));++u<i;){e=n[u];var c=r?r(e,u,n):e;
|
||||||
|
(t?!u||f[f.length-1]!==c:0>o(f,c))&&(r&&f.push(c),a.push(e))}return a}function H(n,t){return Pt.fastBind||Bt&&2<arguments.length?Bt.call.apply(Bt,arguments):l(n,t,zt.call(arguments,2))}function J(n,t,r){if(n==X)return K;var e=typeof n;if("function"!=e){if("object"!=e)return function(t){return t[n]};var u=Vt(n);return function(t){for(var r=u.length,e=Y;r--&&(e=t[u[r]]===n[u[r]]););return e}}return typeof t=="undefined"?n:1===r?function(r){return n.call(t,r)}:2===r?function(r,e){return n.call(t,r,e)
|
||||||
|
}:4===r?function(r,e,u,o){return n.call(t,r,e,u,o)}:function(r,e,u){return n.call(t,r,e,u)}}function K(n){return n}function L(n){F(_(n),function(t){var r=f[t]=n[t];f.prototype[t]=function(){var n=[this.__wrapped__];return St.apply(n,arguments),n=r.apply(f,n),this.__chain__&&(n=new c(n),n.__chain__=Q),n}})}var Q=!0,X=null,Y=!1,Z=0,nt={},tt=+new Date+"",rt=/&(?:amp|lt|gt|quot|#39);/g,et=/($^)/,ut=/[&<>"']/g,ot=/['\n\r\t\u2028\u2029\\]/g,it="[object Arguments]",at="[object Array]",ft="[object Boolean]",ct="[object Date]",lt="[object Number]",pt="[object Object]",st="[object RegExp]",vt="[object String]",gt={"boolean":Y,"function":Q,object:Q,number:Y,string:Y,undefined:Y},ht={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},yt=gt[typeof exports]&&exports,mt=gt[typeof module]&&module&&module.exports==yt&&module,_t=gt[typeof global]&&global;
|
||||||
|
!_t||_t.global!==_t&&_t.window!==_t||(n=_t);var dt=[],_t=Object.prototype,bt=n._,jt=RegExp("^"+(_t.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),wt=Math.ceil,At=n.clearTimeout,xt=dt.concat,Ot=Math.floor,Et=_t.hasOwnProperty,St=dt.push,Nt=n.setTimeout,kt=_t.toString,Bt=jt.test(Bt=kt.bind)&&Bt,Ft=jt.test(Ft=Object.create)&&Ft,qt=jt.test(qt=Array.isArray)&&qt,Rt=n.isFinite,Dt=n.isNaN,Mt=jt.test(Mt=Object.keys)&&Mt,Tt=Math.max,$t=Math.min,It=Math.random,zt=dt.slice,_t=jt.test(n.attachEvent),Ct=Bt&&!/\n|true/.test(Bt+_t);
|
||||||
|
c.prototype=f.prototype;var Pt={};!function(){var n={0:1,length:1};Pt.fastBind=Bt&&!Ct,Pt.spliceObjects=(dt.splice.call(n,0,1),!n[0])}(1),f.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Ft||(p=function(n){if(A(n)){a.prototype=n;var t=new a;a.prototype=X}return t||{}}),h(arguments)||(h=function(n){return n?Et.call(n,"callee"):Y});var Ut=qt||function(n){return n?typeof n=="object"&&kt.call(n)==at:Y},Vt=Mt?function(n){return A(n)?Mt(n):[]
|
||||||
|
}:e,Wt={"&":"&","<":"<",">":">",'"':""","'":"'"},Gt=d(Wt);w(/x/)&&(w=function(n){return typeof n=="function"&&"[object Function]"==kt.call(n)}),f.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},f.bind=H,f.bindAll=function(n){for(var t=1<arguments.length?xt.apply(dt,zt.call(arguments,1)):_(n),r=-1,e=t.length;++r<e;){var u=t[r];n[u]=H(n[u],n)}return n},f.compact=function(n){for(var t=-1,r=n?n.length:0,e=[];++t<r;){var u=n[t];u&&e.push(u)
|
||||||
|
}return e},f.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},f.countBy=function(n,t,r){var e={};return t=J(t,r),F(n,function(n,r,u){r=t(n,r,u)+"",Et.call(e,r)?e[r]++:e[r]=1}),e},f.debounce=function(n,t,r){function e(){a=X,r||(o=n.apply(i,u))}var u,o,i,a=X;return function(){var f=r&&!a;return u=arguments,i=this,At(a),a=Nt(e,t),f&&(o=n.apply(i,u)),o}},f.defaults=m,f.defer=function(n){var t=zt.call(arguments,1);return Nt(function(){n.apply(void 0,t)
|
||||||
|
},1)},f.delay=function(n,t){var r=zt.call(arguments,2);return Nt(function(){n.apply(void 0,r)},t)},f.difference=z,f.filter=k,f.flatten=P,f.forEach=F,f.functions=_,f.groupBy=function(n,t,r){var e={};return t=J(t,r),F(n,function(n,r,u){r=t(n,r,u)+"",(Et.call(e,r)?e[r]:e[r]=[]).push(n)}),e},f.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t!="number"&&t!=X){var o=u;for(t=J(t,r);o--&&t(n[o],o,n);)e++}else e=t==X||r?1:t||e;return zt.call(n,0,$t(Tt(0,u-e),u))},f.intersection=function(n){var t=arguments,r=t.length,e=-1,u=v(),o=n?n.length:0,i=[];
|
||||||
|
n:for(;++e<o;){var a=n[e];if(0>u(i,a)){for(var f=r;--f;)if(0>u(t[f],a))continue n;i.push(a)}}return i},f.invert=d,f.invoke=function(n,t){var r=zt.call(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);return F(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},f.keys=Vt,f.map=q,f.max=R,f.memoize=function(n,t){var r={};return function(){var e=tt+(t?t.apply(this,arguments):arguments[0]);return Et.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},f.min=function(n,t,r){var e=1/0,u=e,o=-1,i=n?n.length:0;
|
||||||
|
if(t||typeof i!="number")t=J(t,r),F(n,function(n,r,o){r=t(n,r,o),r<e&&(e=r,u=n)});else for(;++o<i;)r=n[o],r<u&&(u=r);return u},f.omit=function(n){var t=v(),e=xt.apply(dt,zt.call(arguments,1)),u={};return r(n,function(n,r){0>t(e,r)&&(u[r]=n)}),u},f.once=function(n){var t,r;return function(){return t?r:(t=Q,r=n.apply(this,arguments),n=X,r)}},f.pairs=function(n){for(var t=-1,r=Vt(n),e=r.length,u=Array(e);++t<e;){var o=r[t];u[t]=[o,n[o]]}return u},f.partial=function(n){return l(n,zt.call(arguments,1))
|
||||||
|
},f.pick=function(n){for(var t=-1,r=xt.apply(dt,zt.call(arguments,1)),e=r.length,u={};++t<e;){var o=r[t];o in n&&(u[o]=n[o])}return u},f.pluck=D,f.range=function(n,t,r){n=+n||0,r=+r||1,t==X&&(t=n,n=0);var e=-1;t=Tt(0,wt((t-n)/r));for(var u=Array(t);++e<t;)u[e]=n,n+=r;return u},f.reject=function(n,t,r){return t=J(t,r),k(n,function(n,r,e){return!t(n,r,e)})},f.rest=V,f.shuffle=function(n){var t=-1,r=n?n.length:0,e=Array(typeof r=="number"?r:0);return F(n,function(n){var r=Ot(It()*(++t+1));e[t]=e[r],e[r]=n
|
||||||
|
}),e},f.sortBy=function(n,t,r){var e=-1,u=n?n.length:0,i=Array(typeof u=="number"?u:0);for(t=J(t,r),F(n,function(n,r,u){i[++e]={l:t(n,r,u),m:e,n:n}}),u=i.length,i.sort(o);u--;)i[u]=i[u].n;return i},f.tap=function(n,t){return t(n),n},f.throttle=function(n,t){function r(){i=new Date,a=X,u=n.apply(o,e)}var e,u,o,i=0,a=X;return function(){var f=new Date,c=t-(f-i);return e=arguments,o=this,0<c?a||(a=Nt(r,c)):(At(a),a=X,i=f,u=n.apply(o,e)),u}},f.times=function(n,t,r){for(var e=-1,u=Array(-1<n?n:0);++e<n;)u[e]=t.call(r,e);
|
||||||
|
return u},f.toArray=function(n){return Ut(n)?zt.call(n):n&&typeof n.length=="number"?q(n):E(n)},f.union=function(n){return Ut(n)||(arguments[0]=n?zt.call(n):dt),G(xt.apply(dt,arguments))},f.uniq=G,f.values=E,f.where=I,f.without=function(n){return z(n,zt.call(arguments,1))},f.wrap=function(n,t){return function(){var r=[n];return St.apply(r,arguments),t.apply(this,r)}},f.zip=function(n){for(var t=-1,r=n?R(D(arguments,"length")):0,e=Array(0>r?0:r);++t<r;)e[t]=D(arguments,t);return e},f.collect=q,f.drop=V,f.each=F,f.extend=y,f.methods=_,f.object=function(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var o=n[r];
|
||||||
|
t?u[o]=t[r]:u[o[0]]=o[1]}return u},f.select=k,f.tail=V,f.unique=G,f.chain=function(n){return n=new c(n),n.__chain__=Q,n},f.clone=function(n){return A(n)?Ut(n)?zt.call(n):y({},n):n},f.contains=S,f.escape=function(n){return n==X?"":(n+"").replace(ut,s)},f.every=N,f.find=B,f.has=function(n,t){return n?Et.call(n,t):Y},f.identity=K,f.indexOf=U,f.isArguments=h,f.isArray=Ut,f.isBoolean=function(n){return n===Q||n===Y||kt.call(n)==ft},f.isDate=function(n){return n?typeof n=="object"&&kt.call(n)==ct:Y},f.isElement=function(n){return n?1===n.nodeType:Y
|
||||||
|
},f.isEmpty=b,f.isEqual=j,f.isFinite=function(n){return Rt(n)&&!Dt(parseFloat(n))},f.isFunction=w,f.isNaN=function(n){return x(n)&&n!=+n},f.isNull=function(n){return n===X},f.isNumber=x,f.isObject=A,f.isRegExp=function(n){return!(!n||!gt[typeof n])&&kt.call(n)==st},f.isString=O,f.isUndefined=function(n){return typeof n=="undefined"},f.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?Tt(0,e+r):$t(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},f.mixin=L,f.noConflict=function(){return n._=bt,this
|
||||||
|
},f.random=function(n,t){n==X&&t==X&&(t=1),n=+n||0,t==X?(t=n,n=0):t=+t||0;var r=It();return n%1||t%1?n+$t(r*(t-n+parseFloat("1e-"+((r+"").length-1))),t):n+Ot(r*(t-n+1))},f.reduce=M,f.reduceRight=T,f.result=function(n,t){var r=n?n[t]:X;return w(r)?n[t]():r},f.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Vt(n).length},f.some=$,f.sortedIndex=W,f.template=function(n,t,r){var e=f.templateSettings;n||(n=""),r=m({},r,e);var u=0,o="__p+='",e=r.variable;n.replace(RegExp((r.escape||et).source+"|"+(r.interpolate||et).source+"|"+(r.evaluate||et).source+"|$","g"),function(t,r,e,a,f){return o+=n.slice(u,f).replace(ot,i),r&&(o+="'+_['escape']("+r+")+'"),a&&(o+="';"+a+";__p+='"),e&&(o+="'+((__t=("+e+"))==null?'':__t)+'"),u=f+t.length,t
|
||||||
|
}),o+="';\n",e||(e="obj",o="with("+e+"||{}){"+o+"}"),o="function("+e+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+o+"return __p}";try{var a=Function("_","return "+o)(f)}catch(c){throw c.source=o,c}return t?a(t):(a.source=o,a)},f.unescape=function(n){return n==X?"":(n+"").replace(rt,g)},f.uniqueId=function(n){var t=++Z+"";return n?n+t:t},f.all=N,f.any=$,f.detect=B,f.findWhere=function(n,t){return I(n,t,Q)},f.foldl=M,f.foldr=T,f.include=S,f.inject=M,f.first=C,f.last=function(n,t,r){if(n){var e=0,u=n.length;
|
||||||
|
if(typeof t!="number"&&t!=X){var o=u;for(t=J(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,e==X||r)return n[u-1];return zt.call(n,Tt(0,u-e))}},f.take=C,f.head=C,f.VERSION="1.3.1",L(f),f.prototype.chain=function(){return this.__chain__=Q,this},f.prototype.value=function(){return this.__wrapped__},F("pop push reverse shift sort splice unshift".split(" "),function(n){var t=dt[n];f.prototype[n]=function(){var n=this.__wrapped__;return t.apply(n,arguments),!Pt.spliceObjects&&0===n.length&&delete n[0],this}}),F(["concat","join","slice"],function(n){var t=dt[n];
|
||||||
|
f.prototype[n]=function(){var n=t.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new c(n),n.__chain__=Q),n}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=f, define(function(){return f})):yt&&!yt.nodeType?mt?(mt.exports=f)._=f:yt._=f:n._=f}(this);
|
||||||
5420
doc/README.md
@@ -20,9 +20,10 @@
|
|||||||
|
|
||||||
// generate Markdown
|
// generate Markdown
|
||||||
$markdown = docdown(array(
|
$markdown = docdown(array(
|
||||||
'path' => '../' . $file,
|
'path' => '../' . $file,
|
||||||
'title' => 'Lo-Dash <sup>v0.1.0</sup>',
|
'title' => 'Lo-Dash <sup>v1.3.1</sup>',
|
||||||
'url' => 'https://github.com/bestiejs/lodash/blob/master/lodash.js'
|
'toc' => 'categories',
|
||||||
|
'url' => 'https://github.com/lodash/lodash/blob/1.3.1/lodash.js'
|
||||||
));
|
));
|
||||||
|
|
||||||
// save to a .md file
|
// save to a .md file
|
||||||
@@ -32,4 +33,4 @@
|
|||||||
header('Content-Type: text/plain;charset=utf-8');
|
header('Content-Type: text/plain;charset=utf-8');
|
||||||
echo $markdown . PHP_EOL;
|
echo $markdown . PHP_EOL;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
1
index.js
Executable file
@@ -0,0 +1 @@
|
|||||||
|
module.exports = require('./dist/lodash.compat.js');
|
||||||
26
lodash.min.js
vendored
@@ -1,26 +0,0 @@
|
|||||||
/*!
|
|
||||||
Lo-Dash 0.1.0 github.com/bestiejs/lodash/blob/master/LICENSE.txt
|
|
||||||
Underscore.js 1.3.3 github.com/documentcloud/underscore/blob/master/LICENSE
|
|
||||||
*/
|
|
||||||
;(function(r,h){"use strict";var n=!0,o=!1;function Q(a){return"[object Arguments]"==k.call(a)}function i(a){return new p(a)}function p(a){this.o=a}function g(){for(var a,b=-1,c={},d={},f={},e=["d","j","g","a"];++b<arguments.length;)for(a in arguments[b])f[a]=arguments[b][a];for(;a=e.pop();)"object"==typeof f[a]?(c[a]=f[a].c,d[a]=f[a].k):c[a]=d[a]=f[a]||"";a=f.b;var b=/^[^,]+/.exec(a)[0],e=f.h,j=f.i,g=!("v"==a||"b"==j),j=!("b"==a||"a"==j),h=f.n!==o;return Function("c,d,i,l,m,n,p,q,s,t,w,z,B,E,F,k,G",'"use strict";return function('+
|
|
||||||
a+"){"+(f.m||"")+";"+("var o, y"+(e?"="+e:""))+";if("+b+"==G)return "+(f.f||"y")+";"+(g?"var u="+b+".length;o=-1;"+((j?"if(u===+u){":"")+(c.d||"")+";while("+(c.j||"++o<u")+"){"+c.g+"}"+(c.a||"")+";"+(j?"}":"")):"")+(j?(g?"else{":"")+(d.d||"")+";for("+(d.j||"o in "+b)+"){"+(h?"if(m.call("+/\S+$/.exec(d.j||b)[0]+",o)){":"")+d.g+(h?"}":"")+"}"+(d.a||"")+";"+(g?"}":""):"")+(f.e||"")+";return "+(f.l||"y")+"}")(D,u,ba,ca,s,R,E,Infinity,F,da,Math,l,G,k,n,o)}function S(a){return a.replace(ua,function(a,c){return y[c]})}
|
|
||||||
function ea(a,b,c,d){var f=2<arguments.length;if(a==h)return c;d&&(b=u(b,d));var e=a.length;if(e===+e){for(e&&!f&&(c=a[--e]);e--;)c=b(c,a[e],e,a);return c}var j=T(a);for((e=j.length)&&!f&&(c=a[j[--e]]);e--;)f=j[e],c=b(c,a[f],f,a);return c}function fa(a,b,c){var d=0,f=a.length;for(c||(c=R);d<f;){var e=d+f>>1;c(a[e])<c(b)?d=e+1:f=e}return d}function U(a,b,c){return b==h||c?a[0]:l.call(a,0,b)}function H(a,b){return b?ba.apply([],a):z(a,function(a,b){if(F(b))return V.apply(a,H(b)),a;a.push(b);return a},
|
|
||||||
[])}function E(a,b,c){var d;if(a==h)return-1;if(c)return c=fa(a,b),a[c]===b?c:-1;c=0;for(d=a.length;c<d;c++)if(a[c]===b)return c;return-1}function ga(a){var b=l.call(arguments,1);return W(I(a),function(a){return X(b,function(b){return 0<=E(b,a)})})}function ha(a,b,c){var d=a.length;return b==h||c?a[d-1]:l.call(a,-b||d)}function ia(a,b,c){return l.call(a,b==h||c?1:b)}function I(a,b,c){var c=c?A(a,c):a,d=[];3>a.length&&(b=n);z(c,function(c,e,j){if(b?ha(c)!==e||!c.length:0>E(c,e))c.push(e),d.push(a[j]);
|
|
||||||
return c},[]);return d}function u(a,b){var c=l.call(arguments,2),d=c.length;return function(){c.length=d;V.apply(c,arguments);return a.apply(b,c)}}function ja(a,b,c){var d;return function(){var f=arguments,e=this;c&&!d&&a.apply(e,f);va(d);d=J(function(){d=h;c||a.apply(e,f)},b)}}function Y(a,b,c){c||(c=[]);if(a===b)return 0!==a||1/a==1/b;if(a==h||b==h)return a===b;a.p&&(a=a.o);b.p&&(b=b.o);if(a.isEqual&&q(a.isEqual))return a.isEqual(b);if(b.isEqual&&q(b.isEqual))return b.isEqual(a);var d=k.call(a);
|
|
||||||
if(d!=k.call(b))return o;switch(d){case G:return a==""+b;case K:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case ka:case la:return+a==+b;case ma:return a.source==b.source&&a.global==b.global&&a.multiline==b.multiline&&a.ignoreCase==b.ignoreCase}if("object"!=typeof a||"object"!=typeof b)return o;for(var f=c.length;f--;)if(c[f]==a)return n;var f=n,e=0;c.push(a);if(d==D){if(e=a.length,f=e==b.length)for(;e--&&(f=e in a==e in b&&Y(a[e],b[e],c)););}else{if("constructor"in a!="constructor"in b||a.constructor!=
|
|
||||||
b.constructor)return o;for(var j in a)if(s.call(a,j)&&(e++,!(f=s.call(b,j)&&Y(a[j],b[j],c))))break;if(f){for(j in b)if(s.call(b,j)&&!e--)break;f=!e}}c.pop();return f}function q(a){return k.call(a)==ca}function R(a){return a}function na(a){t(L(a),function(b){var c=i[b]=a[b];i.prototype[b]=function(){var a=l.call(arguments);wa.call(a,this.o);a=c.apply(i,a);return this.p?(new p(a)).chain():a}})}var y={"\\":"\\","'":"'",r:"\r",n:"\n",t:"\t",u2028:"\u2028",u2029:"\u2029"};(function(){for(var a in y)y[y[a]]=
|
|
||||||
a})();var Z="object"==typeof exports&&exports&&("object"==typeof global&&global&&global==global.global&&(r=global),exports),xa=0,ya=r._,za=/\\|'|\r|\n|\t|\u2028|\u2029/g,$=/.^/,ua=/\\(\\|'|r|n|t|u2028|u2029)/g,D="[object Array]",ka="[object Boolean]",la="[object Date]",ca="[object Function]",K="[object Number]",ma="[object RegExp]",G="[object String]",v=Array.prototype,M=Object.prototype,ba=v.concat,s=M.hasOwnProperty,V=v.push,l=v.slice,k=M.toString,wa=v.unshift,Aa=r.isFinite,M=Object.keys,va=r.clearTimeout,
|
|
||||||
J=r.setTimeout,N={b:"b",m:"var I=i.apply([],z.call(arguments,1))",h:"[]",g:"if(p(I,b[o])<0)y.push(b[o])"},w={h:"F",g:"if(!e(g[o],o,g))return !y"},aa={b:"v",h:"v",d:"for(var A,j=1,u=arguments.length;j<u;j++){A=arguments[j]",j:"o in A",g:"v[o]=A[o]",n:o,a:"}"},B={h:"[]",g:"e(g[o],o,g)&&y.push(g[o])"},m={b:"g,e,D",m:"if(!e){e=n}else if(D){e=d(e,D)}",h:"g",g:"e(g[o],o,g)"},oa={b:"v",m:"if(v!==Object(v))throw TypeError()",h:"[]",g:"y.push(o)"},C={h:"",f:"[]",d:{c:"y=Array(u)",k:"y=[]"},g:{c:"y[o]=e(g[o],o,g)",
|
|
||||||
k:"y[y.length]=e(g[o],o,g)"}},x={m:"var j,y=-q,h=y;if(!e){if(s(g)&&g[0]===+g[0])return w.max.apply(w,g);if(t(g))return y;}else if(D)e=d(e,D)",g:"j=e?e(g[o],o,g):g[o];if(j>=h)h=j,y=g[o]"},F=Array.isArray||function(a){return k.call(a)==D},da=g({b:"H",i:"b",m:"var f=E.call(H)",h:"F",d:"if(f==c||f==B)return !H.length",g:"return k"}),pa=g({b:"g,C",h:"k",g:"if(g[o]===C)return F"}),X=g(m,w),W=g(m,B),qa=g(m,{g:"if(e(g[o],o,g))return g[o]"}),t=g(m),A=g(m,C),ra=g(m,x),x=g(m,x,{m:x.m.replace("-","").replace("max",
|
|
||||||
"min"),g:x.g.replace(">=","<")}),O=g(C,{b:"g,x",g:{c:"y[o]=g[o][x]",k:"y[y.length]=g[o][x]"}}),z=g({b:"g,e,a,D",m:"var r=arguments.length>2;if(D)e=d(e,D)",h:"a",d:{c:"if(!r)y=g[++o]"},g:{c:"y=e(y,g[o],o,g)",k:"y=r?e(y,g[o],o,g):(r=F,g[o])"}}),B=g(m,B,{g:"!"+B.g}),w=g(m,w,{h:"k",g:w.g.replace("!","")}),sa=g(C,{b:"g",g:{c:"y[o]=g[o]",k:"y[y.length]=g[o]"}}),C=g({b:"b",h:"[]",g:"if(b[o])y.push(b[o])"}),m=g(N),N=g(N,{m:"var I=z.call(arguments,1)",h:"[]"}),ta=g(aa,{g:"if(v[o]==G)"+aa.g}),P=g(aa),L=g(oa,
|
|
||||||
{m:"",n:o,g:"if(E.call(v[o])==l)y.push(o)",l:"y.sort()"});Q(arguments)||(Q=function(a){return!(!a||!s.call(a,"callee"))});var T=M||g(oa);P(i,{VERSION:"0.1.0",templateSettings:{escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g},after:function(a,b){return 1>a?b():function(){if(1>--a)return b.apply(this,arguments)}},bind:u,bindAll:function(a){var b=arguments,c=1;1==b.length&&(c=0,b=L(a));for(var d=b.length;c<d;c++)a[b[c]]=u(a[b[c]],a);return a},chain:function(a){return(new p(a)).chain()},
|
|
||||||
clone:function(a){return a!==Object(a)?a:F(a)?a.slice():P({},a)},compact:C,compose:function(){var a=arguments;return function(){for(var b=arguments,c=a.length;c--;)b=[a[c].apply(this,b)];return b[0]}},contains:pa,debounce:ja,defaults:ta,defer:function(a){var b=l.call(arguments,1);return J(function(){return a.apply(h,b)},1)},delay:function(a,b){var c=l.call(arguments,2);return J(function(){return a.apply(h,c)},b)},difference:m,escape:function(a){return(a+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,
|
|
||||||
">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")},every:X,extend:P,filter:W,find:qa,first:U,flatten:H,forEach:t,functions:L,groupBy:function(a,b){var c={};if(!q(b))var d=b,b=function(a){return a[d]};t(a,function(a,e,d){e=b(a,e,d);(c[e]||(c[e]=[])).push(a)});return c},has:function(a,b){return s.call(a,b)},identity:R,indexOf:E,initial:function(a,b,c){return l.call(a,0,-(b==h||c?1:b))},intersection:ga,invoke:function(a,b){var c=l.call(arguments,2),d=q(b);return A(a,function(a){return(d?
|
|
||||||
b||a:a[b]).apply(a,c)})},isArguments:Q,isArray:F,isBoolean:function(a){return a===n||a===o||k.call(a)==ka},isDate:function(a){return k.call(a)==la},isElement:function(a){return!!(a&&1==a.nodeType)},isEmpty:da,isEqual:Y,isFinite:function(a){return Aa(a)&&k.call(a)==K},isFunction:q,isNaN:function(a){return k.call(a)==K&&a!=+a},isNull:function(a){return null===a},isNumber:function(a){return k.call(a)==K},isObject:function(a){return a===Object(a)},isRegExp:function(a){return k.call(a)==ma},isString:function(a){return k.call(a)==
|
|
||||||
G},isUndefined:function(a){return a===h},keys:T,last:ha,lastIndexOf:function(a,b){if(a==h)return-1;for(var c=a.length;c--;)if(a[c]===b)return c;return-1},map:A,max:ra,memoize:function(a,b){var c={};return function(){var d=b?b.apply(this,arguments):arguments[0];return s.call(c,d)?c[d]:c[d]=a.apply(this,arguments)}},min:x,mixin:na,noConflict:function(){r._=ya;return this},once:function(a){var b,c=o;return function(){if(c)return b;c=n;return b=a.apply(this,arguments)}},pick:function(a){for(var b,c=-1,
|
|
||||||
d=H(l.call(arguments,1)),f=d.length,e={};++c<f;)b=d[c],b in a&&(e[b]=a[b]);return e},pluck:O,range:function(a,b,c){c||(c=1);2>arguments.length&&(b=a||0,a=0);for(var d=-1,f=Math.max(Math.ceil((b-a)/c),0),e=Array(f);++d<f;)e[d]=a,a+=c;return e},reduce:z,reduceRight:ea,reject:B,rest:ia,result:function(a,b){if(a==h)return null;var c=a[b];return q(c)?a[b]():c},shuffle:function(a){var b,c=[];t(a,function(a,f){b=Math.floor(Math.random()*(f+1));c[f]=c[b];c[b]=a});return c},size:function(a){var b=k.call(a);
|
|
||||||
return b==D||b==G?a.length:T(a).length},some:w,sortBy:function(a,b,c){if(q(b))c&&(b=u(b,c));else var d=b,b=function(a){return a[d]};return O(A(a,function(c,e){return{a:b(c,e,a),b:c}}).sort(function(a,b){var c=a.a,d=b.a;return c===h?1:d===h?-1:c<d?-1:c>d?1:0}),"b")},sortedIndex:fa,tap:function(a,b){b(a);return a},template:function(a,b,c){function d(a){return f.call(this,a,i)}c=ta(c||{},i.templateSettings);a="__p+='"+a.replace(za,function(a){return"\\"+y[a]}).replace(c.escape||$,function(a,b){return"'+((__t=("+
|
|
||||||
S(b)+"))==null?'':_['escape'](__t))+'"}).replace(c.interpolate||$,function(a,b){return"'+((__t=("+S(b)+"))==null?'':__t)+'"}).replace(c.evaluate||$,function(a,b){return"';"+S(b)+";__p+='"})+"';";c.variable||(a="with(object||{}){"+a+"}");var a='var __t,__j=Array.prototype.join,__p="";function print(){__p+=__j.call(arguments,"")}'+a+"return __p",f=Function(c.variable||"object","_",a);if(b)return f(b,i);d.source="function("+(c.variable||"object")+"){"+a+"}";return d},throttle:function(a,b){var c,d,f,
|
|
||||||
e,g,i,k=ja(function(){d=g=o},b);return function(){c=arguments;e=this;i||(i=J(function(){i=h;d&&a.apply(e,c);k()},b));g?d=n:f=a.apply(e,c);k();g=n;return f}},times:function(a,b,c){c&&(b=u(b,c));for(c=0;c<a;c++)b(c)},toArray:function(a){if(!a)return[];if(q(a.toArray))return a.toArray();var b=a.length;return b===+b?l.call(a):sa(a)},union:function(){return I(H(arguments,n))},uniq:I,uniqueId:function(a){var b=xa++;return a?a+b:b},values:sa,without:N,wrap:function(a,b){return function(){var c=[a];V.apply(c,
|
|
||||||
arguments);return b.apply(this,c)}},zip:function(){for(var a=-1,b=ra(O(arguments,"length")),c=Array(b);++a<b;)c[a]=O(arguments,a);return c},all:X,any:w,collect:A,detect:qa,each:t,foldl:z,foldr:ea,head:U,include:pa,inject:z,intersect:ga,methods:L,select:W,tail:ia,take:U,unique:I});p.prototype=i.prototype;na(i);t("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=v[a];i.prototype[a]=function(){var a=this.o;b.apply(a,arguments);a.length===0&&delete a[0];return this.p?(new p(a)).chain():
|
|
||||||
a}});t(["concat","join","slice"],function(a){var b=v[a];p.prototype[a]=function(){var a=b.apply(this.o,arguments);return this.p?(new p(a)).chain():a}});P(p.prototype,{chain:function(){this.p=n;return this},value:function(){return this.o}});Z?"object"==typeof module&&module&&module.q==Z?(module.q=i)._=i:Z._=i:(r._=i,"function"==typeof define&&"object"==typeof define.amd&&define.amd&&define.amd.lodash&&define("lodash",function(){return i}))})(this);
|
|
||||||
50
package.json
@@ -1,9 +1,10 @@
|
|||||||
{
|
{
|
||||||
"name": "lodash",
|
"name": "lodash",
|
||||||
"version": "0.1.0",
|
"version": "1.3.1",
|
||||||
"description": "A drop-in replacement for Underscore.js that delivers up to 8x performance improvements, bug fixes, and additional features.",
|
"description": "A low-level utility library delivering consistency, customization, performance, and extra features.",
|
||||||
"homepage": "https://github.com/bestiejs/lodash",
|
"homepage": "http://lodash.com/",
|
||||||
"main": "lodash",
|
"license": "MIT",
|
||||||
|
"main": "./dist/lodash.js",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"browser",
|
"browser",
|
||||||
"client",
|
"client",
|
||||||
@@ -13,15 +14,9 @@
|
|||||||
"speed",
|
"speed",
|
||||||
"util"
|
"util"
|
||||||
],
|
],
|
||||||
"licenses": [
|
|
||||||
{
|
|
||||||
"type": "MIT",
|
|
||||||
"url": "http://mths.be/mit"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"author": {
|
"author": {
|
||||||
"name": "John-David Dalton",
|
"name": "John-David Dalton",
|
||||||
"email": "john@fusejs.com",
|
"email": "john.david.dalton@gmail.com",
|
||||||
"web": "http://allyoucanleet.com/"
|
"web": "http://allyoucanleet.com/"
|
||||||
},
|
},
|
||||||
"bugs": {
|
"bugs": {
|
||||||
@@ -31,12 +26,37 @@
|
|||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/bestiejs/lodash.git"
|
"url": "https://github.com/bestiejs/lodash.git"
|
||||||
},
|
},
|
||||||
|
"bin": {
|
||||||
|
"lodash": "./build.js"
|
||||||
|
},
|
||||||
"engines": [
|
"engines": [
|
||||||
"node",
|
"node",
|
||||||
"rhino"
|
"rhino"
|
||||||
],
|
],
|
||||||
"directories": {
|
"jam": {
|
||||||
"doc": "./doc",
|
"main": "./dist/lodash.compat.js"
|
||||||
"test": "./test"
|
},
|
||||||
|
"volo": {
|
||||||
|
"type": "directory",
|
||||||
|
"ignore": [
|
||||||
|
".*",
|
||||||
|
"*.custom.*",
|
||||||
|
"*.template.*",
|
||||||
|
"*.d.ts",
|
||||||
|
"*.map",
|
||||||
|
"*.md",
|
||||||
|
"*.txt",
|
||||||
|
"build.js",
|
||||||
|
"lodash.js",
|
||||||
|
"index.js",
|
||||||
|
"bower.json",
|
||||||
|
"component.json",
|
||||||
|
"build",
|
||||||
|
"doc",
|
||||||
|
"node_modules",
|
||||||
|
"perf",
|
||||||
|
"test",
|
||||||
|
"vendor"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
82
perf/index.html
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Lo-Dash Performance Suite</title>
|
||||||
|
<style>
|
||||||
|
html, body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
applet {
|
||||||
|
position: absolute;
|
||||||
|
left: -9999em;
|
||||||
|
}
|
||||||
|
#FirebugUI {
|
||||||
|
top: 2em;
|
||||||
|
}
|
||||||
|
#perf-toolbar {
|
||||||
|
background-color: #EEE;
|
||||||
|
color: #5E740B;
|
||||||
|
font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
|
||||||
|
font-size: small;
|
||||||
|
padding: 0.5em 0 0.5em 2em;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="perf-toolbar"></div>
|
||||||
|
<script src="../vendor/platform.js/platform.js"></script>
|
||||||
|
<script src="../lodash.js"></script>
|
||||||
|
<script src="../vendor/benchmark.js/benchmark.js"></script>
|
||||||
|
<script src="../vendor/firebug-lite/src/firebug-lite-debug.js"></script>
|
||||||
|
<script src="perf-ui.js"></script>
|
||||||
|
<script>
|
||||||
|
document.write('<script src="' + ui.buildPath + '"><\/script>');
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
var lodash = _.noConflict();
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
document.write('<script src="' + ui.otherPath + '"><\/script>');
|
||||||
|
</script>
|
||||||
|
<script src="perf.js"></script>
|
||||||
|
<script>
|
||||||
|
(function() {
|
||||||
|
var measured,
|
||||||
|
perfNow,
|
||||||
|
begin = new Date;
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
var fbUI = document.getElementById('FirebugUI'),
|
||||||
|
fbDoc = fbUI && (fbDoc = fbUI.contentWindow || fbUI.contentDocument).document || fbDoc,
|
||||||
|
fbCommandLine = fbDoc && fbDoc.getElementById('fbCommandLine');
|
||||||
|
|
||||||
|
if (!fbCommandLine) {
|
||||||
|
return setTimeout(init, 15);
|
||||||
|
}
|
||||||
|
fbUI.style.height = (
|
||||||
|
Math.max(document.documentElement.clientHeight, document.body.clientHeight) -
|
||||||
|
document.getElementById('perf-toolbar').clientHeight
|
||||||
|
) + 'px';
|
||||||
|
|
||||||
|
fbDoc.body.style.height = fbDoc.documentElement.style.height = '100%';
|
||||||
|
setTimeout(run, 15);
|
||||||
|
}
|
||||||
|
|
||||||
|
// is the applet permitted?
|
||||||
|
if (!/[?&]nojava=true(?:&|$)/.test(location.search)) {
|
||||||
|
// is the applet really needed?
|
||||||
|
while (!(measured = new Date - begin)) { }
|
||||||
|
if (measured != 1 && !((perfNow = window.performance) && typeof (perfNow.now || perfNow.webkitNow) == 'function')) {
|
||||||
|
// load applet
|
||||||
|
document.write('<applet code="nano" archive="../vendor/benchmark.js/nano.jar"></applet>');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
window.onload = init;
|
||||||
|
}());
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
163
perf/perf-ui.js
Normal file
@@ -0,0 +1,163 @@
|
|||||||
|
;(function(window) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
/** The base path of the builds */
|
||||||
|
var basePath = '../';
|
||||||
|
|
||||||
|
/** The Lo-Dash build to load */
|
||||||
|
var build = (/build=([^&]+)/.exec(location.search) || [])[1];
|
||||||
|
|
||||||
|
/** The other library to load */
|
||||||
|
var other = (/other=([^&]+)/.exec(location.search) || [])[1];
|
||||||
|
|
||||||
|
/** The `ui` object */
|
||||||
|
var ui = {};
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers an event listener on an element.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Element} element The element.
|
||||||
|
* @param {String} eventName The name of the event.
|
||||||
|
* @param {Function} handler The event handler.
|
||||||
|
* @returns {Element} The element.
|
||||||
|
*/
|
||||||
|
function addListener(element, eventName, handler) {
|
||||||
|
if (typeof element.addEventListener != 'undefined') {
|
||||||
|
element.addEventListener(eventName, handler, false);
|
||||||
|
} else if (typeof element.attachEvent != 'undefined') {
|
||||||
|
element.attachEvent('on' + eventName, handler);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
// expose Lo-Dash build file path
|
||||||
|
ui.buildPath = (function() {
|
||||||
|
var result;
|
||||||
|
switch (build) {
|
||||||
|
case 'lodash-compat': result = 'dist/lodash.compat.min.js'; break;
|
||||||
|
case 'lodash-legacy': result = 'dist/lodash.legacy.min.js'; break;
|
||||||
|
case 'lodash-mobile': result = 'dist/lodash.mobile.min.js'; break;
|
||||||
|
case 'lodash-underscore': result = 'dist/lodash.underscore.min.js'; break;
|
||||||
|
case 'lodash-custom-dev': result = 'lodash.custom.js'; break;
|
||||||
|
case 'lodash-custom': result = 'lodash.custom.min.js'; break;
|
||||||
|
case 'lodash-modern':
|
||||||
|
case undefined: result = 'dist/lodash.min.js'; break;
|
||||||
|
default: result = build;
|
||||||
|
}
|
||||||
|
return result == build ? result : (basePath + result);
|
||||||
|
}());
|
||||||
|
|
||||||
|
// expose other library file path
|
||||||
|
ui.otherPath = (function() {
|
||||||
|
var result;
|
||||||
|
switch (other) {
|
||||||
|
case 'lodash-compat': result = 'dist/lodash.compat.min.js'; break;
|
||||||
|
case 'lodash-legacy': result = 'dist/lodash.legacy.min.js'; break;
|
||||||
|
case 'lodash-mobile': result = 'dist/lodash.mobile.min.js'; break;
|
||||||
|
case 'lodash-modern': result = 'dist/lodash.min.js'; break;
|
||||||
|
case 'lodash-underscore': result = 'dist/lodash.underscore.min.js'; break;
|
||||||
|
case 'lodash-custom-dev': result = 'lodash.custom.js'; break;
|
||||||
|
case 'lodash-custom': result = 'lodash.custom.min.js'; break;
|
||||||
|
case 'underscore-dev': result = 'vendor/underscore/underscore.js'; break;
|
||||||
|
case 'underscore':
|
||||||
|
case undefined: result = 'vendor/underscore/underscore-min.js'; break;
|
||||||
|
default: result = other;
|
||||||
|
}
|
||||||
|
return result == other ? result : (basePath + result);
|
||||||
|
}());
|
||||||
|
|
||||||
|
// initialize controls
|
||||||
|
addListener(window, 'load', function() {
|
||||||
|
function eventHandler(event) {
|
||||||
|
var search = location.search.replace(/^\?|&?(?:build|other)=[^&]*&?/g, '');
|
||||||
|
if (event.stopPropagation) {
|
||||||
|
event.stopPropagation();
|
||||||
|
} else {
|
||||||
|
event.cancelBubble = true;
|
||||||
|
}
|
||||||
|
location.href =
|
||||||
|
location.href.split('?')[0] + '?' +
|
||||||
|
(search ? search + '&' : '') +
|
||||||
|
'build=' + buildList[buildList.selectedIndex].value + '&' +
|
||||||
|
'other=' + otherList[otherList.selectedIndex].value;
|
||||||
|
}
|
||||||
|
|
||||||
|
var span1 = document.createElement('span');
|
||||||
|
span1.style.cssText = 'float:right';
|
||||||
|
span1.innerHTML =
|
||||||
|
'<label for="perf-build">Build: </label>' +
|
||||||
|
'<select id="perf-build">' +
|
||||||
|
'<option value="lodash-compat">Lo-Dash (compat)</option>' +
|
||||||
|
'<option value="lodash-legacy">Lo-Dash (legacy)</option>' +
|
||||||
|
'<option value="lodash-mobile">Lo-Dash (mobile)</option>' +
|
||||||
|
'<option value="lodash-modern">Lo-Dash (modern)</option>' +
|
||||||
|
'<option value="lodash-underscore">Lo-Dash (underscore)</option>' +
|
||||||
|
'<option value="lodash-custom-dev">Lo-Dash (custom development)</option>' +
|
||||||
|
'<option value="lodash-custom">Lo-Dash (custom production)</option>' +
|
||||||
|
'</select>';
|
||||||
|
|
||||||
|
var span2 = document.createElement('span');
|
||||||
|
span2.style.cssText = 'float:right';
|
||||||
|
span2.innerHTML =
|
||||||
|
'<label for="perf-other">Other Library: </label>' +
|
||||||
|
'<select id="perf-other">' +
|
||||||
|
'<option value="underscore-dev">Underscore (development)</option>' +
|
||||||
|
'<option value="underscore">Underscore (production)</option>' +
|
||||||
|
'<option value="lodash-compat">Lo-Dash (compat)</option>' +
|
||||||
|
'<option value="lodash-legacy">Lo-Dash (legacy)</option>' +
|
||||||
|
'<option value="lodash-mobile">Lo-Dash (mobile)</option>' +
|
||||||
|
'<option value="lodash-modern">Lo-Dash (modern)</option>' +
|
||||||
|
'<option value="lodash-underscore">Lo-Dash (underscore)</option>' +
|
||||||
|
'<option value="lodash-custom-dev">Lo-Dash (custom development)</option>' +
|
||||||
|
'<option value="lodash-custom">Lo-Dash (custom production)</option>' +
|
||||||
|
'</select>';
|
||||||
|
|
||||||
|
var buildList = span1.lastChild,
|
||||||
|
otherList = span2.lastChild,
|
||||||
|
toolbar = document.getElementById('perf-toolbar');
|
||||||
|
|
||||||
|
toolbar.appendChild(span2);
|
||||||
|
toolbar.appendChild(span1);
|
||||||
|
|
||||||
|
buildList.selectedIndex = (function() {
|
||||||
|
switch (build) {
|
||||||
|
case 'lodash-compat': return 0;
|
||||||
|
case 'lodash-legacy': return 1;
|
||||||
|
case 'lodash-mobile': return 2;
|
||||||
|
case 'lodash-underscore': return 4;
|
||||||
|
case 'lodash-custom-dev': return 5;
|
||||||
|
case 'lodash-custom': return 6;
|
||||||
|
case 'lodash-modern':
|
||||||
|
case undefined: return 3;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}());
|
||||||
|
|
||||||
|
otherList.selectedIndex = (function() {
|
||||||
|
switch (other) {
|
||||||
|
case 'underscore-dev': return 0;
|
||||||
|
case 'lodash-compat': return 2;
|
||||||
|
case 'lodash-legacy': return 3;
|
||||||
|
case 'lodash-mobile': return 4;
|
||||||
|
case 'lodash-modern': return 5;
|
||||||
|
case 'lodash-underscore': return 6;
|
||||||
|
case 'lodash-custom-dev': return 7;
|
||||||
|
case 'lodash-custom': return 8;
|
||||||
|
case 'underscore':
|
||||||
|
case undefined: return 1;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}());
|
||||||
|
|
||||||
|
addListener(buildList, 'change', eventHandler);
|
||||||
|
addListener(otherList, 'change', eventHandler);
|
||||||
|
});
|
||||||
|
|
||||||
|
// expose `ui`
|
||||||
|
window.ui = ui;
|
||||||
|
|
||||||
|
}(this));
|
||||||
1906
perf/perf.js
Normal file
14
perf/run-perf.sh
Executable file
@@ -0,0 +1,14 @@
|
|||||||
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
|
echo "Running performance suite in node..."
|
||||||
|
node perf.js ../dist/lodash.js && node perf.js ../dist/lodash.min.js
|
||||||
|
|
||||||
|
for cmd in rhino "rhino -require" narwhal ringo phantomjs; do
|
||||||
|
echo ""
|
||||||
|
echo "Running performance suite in $cmd..."
|
||||||
|
$cmd perf.js ../dist/lodash.compat.js && $cmd perf.js ../dist/lodash.compat.min.js
|
||||||
|
done
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "Running performance suite in a browser..."
|
||||||
|
open index.html
|
||||||
47
test/backbone.html
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Backbone Test Suite</title>
|
||||||
|
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css">
|
||||||
|
<style>
|
||||||
|
body > #qunit-header {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="qunit"></div>
|
||||||
|
<h1 id="qunit-header"></h1>
|
||||||
|
<div id="qunit-fixture">
|
||||||
|
<div id='testElement'>
|
||||||
|
<h1>Test</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script src="../vendor/json3/lib/json3.js"></script>
|
||||||
|
<script src="../vendor/jquery/jquery.js"></script>
|
||||||
|
<script src="../vendor/platform.js/platform.js"></script>
|
||||||
|
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
||||||
|
<script src="test-ui.js"></script>
|
||||||
|
<script src="../lodash.js"></script>
|
||||||
|
<script>
|
||||||
|
var lodash = _.noConflict();
|
||||||
|
document.write('<script src="../' + ui.buildPath + '"><\/script>');
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
_.mixin({
|
||||||
|
'debounce': lodash.debounce,
|
||||||
|
'defer': lodash.defer
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<script src="../vendor/backbone/backbone.js"></script>
|
||||||
|
<script src="../vendor/backbone/test/environment.js"></script>
|
||||||
|
<script src="../vendor/backbone/test/noconflict.js"></script>
|
||||||
|
<script src="../vendor/backbone/test/events.js"></script>
|
||||||
|
<script src="../vendor/backbone/test/model.js"></script>
|
||||||
|
<script src="../vendor/backbone/test/collection.js"></script>
|
||||||
|
<script src="../vendor/backbone/test/router.js"></script>
|
||||||
|
<script src="../vendor/backbone/test/view.js"></script>
|
||||||
|
<script src="../vendor/backbone/test/sync.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
103
test/index.html
@@ -4,36 +4,93 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>Lo-Dash Test Suite</title>
|
<title>Lo-Dash Test Suite</title>
|
||||||
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css">
|
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css">
|
||||||
|
<style>
|
||||||
|
#exports {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1 id="qunit-header">Lo-Dash Test Suite</h1>
|
|
||||||
<h2 id="qunit-banner"></h2>
|
|
||||||
<div id="qunit-testrunner-toolbar"></div>
|
|
||||||
<h2 id="qunit-userAgent"></h2>
|
|
||||||
<ol id="qunit-tests"></ol>
|
|
||||||
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
||||||
<script>var _2, _ = 1;</script>
|
<script src="../vendor/platform.js/platform.js"></script>
|
||||||
<script src="../lodash.js"></script>
|
<script src="test-ui.js"></script>
|
||||||
<script src="../vendor/requirejs/require.js"></script>
|
<div id="qunit"></div>
|
||||||
|
<div id="exports"></div>
|
||||||
<script>
|
<script>
|
||||||
if (/[?&]norequire=true(?:&|$)/.test(location.search)) {
|
// set a bad shim
|
||||||
require = define = null;
|
Object._keys = Object.keys;
|
||||||
document.write('<script src="test.js"><\/script>');
|
Object.keys = function() { return []; };
|
||||||
}
|
|
||||||
else {
|
// load Lo-Dash and expose it to the bad `Object.keys` shim
|
||||||
define.amd.lodash = true;
|
document.write('<script src="../' + ui.buildPath + '"><\/script>');
|
||||||
require({
|
</script>
|
||||||
|
<script>
|
||||||
|
// store Lo-Dash to test for bad shim detection
|
||||||
|
var lodashBadShim = _;
|
||||||
|
|
||||||
|
// restore nativeKeys
|
||||||
|
Object.keys = Object._keys;
|
||||||
|
delete Object._keys;
|
||||||
|
|
||||||
|
// load Lo-Dash again to overwrite the existing `_` value
|
||||||
|
document.write('<script src="../' + ui.buildPath + '"><\/script>');
|
||||||
|
|
||||||
|
// load test.js if not using require.js
|
||||||
|
document.write(QUnit.urlParams.norequire
|
||||||
|
? '<script src="test.js"><\/script>'
|
||||||
|
: '<script src="../vendor/requirejs/require.js"><\/script>'
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
// load Lo-Dash as a module
|
||||||
|
var lodashModule,
|
||||||
|
shimmedModule,
|
||||||
|
underscoreModule;
|
||||||
|
|
||||||
|
window.require && require(
|
||||||
|
(function() {
|
||||||
|
var modulePath = ui.buildPath.replace(/\.js$/, '');
|
||||||
|
return {
|
||||||
'baseUrl': '../vendor/requirejs/',
|
'baseUrl': '../vendor/requirejs/',
|
||||||
'urlArgs': 't=' + (+new Date),
|
'urlArgs': 't=' + (+new Date),
|
||||||
'paths': {
|
'paths': {
|
||||||
'lodash': '../../lodash'
|
'lodash': '../../' + modulePath,
|
||||||
|
'shimmed': './../../' + modulePath,
|
||||||
|
'underscore': '../underscore/../../' + modulePath
|
||||||
|
},
|
||||||
|
'shim': {
|
||||||
|
'shimmed': {
|
||||||
|
'exports': '_'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
['lodash'], function(_) {
|
}()),
|
||||||
_2 = _.noConflict();
|
['lodash', 'shimmed', 'underscore'], function(lodash, shimmed, underscore) {
|
||||||
require(['test.js']);
|
if (lodash && lodash.noConflict) {
|
||||||
});
|
lodashModule = lodash.noConflict();
|
||||||
}
|
lodashModule.moduleName = 'lodash';
|
||||||
|
}
|
||||||
|
if (shimmed.noConflict) {
|
||||||
|
shimmedModule = shimmed.noConflict();
|
||||||
|
shimmedModule.moduleName = 'shimmed';
|
||||||
|
}
|
||||||
|
if (underscore && underscore.noConflict) {
|
||||||
|
underscoreModule = underscore.noConflict();
|
||||||
|
underscoreModule.moduleName = 'underscore';
|
||||||
|
}
|
||||||
|
require(['test.js']);
|
||||||
|
});
|
||||||
|
|
||||||
|
// set a more readable browser name
|
||||||
|
window.onload = function() {
|
||||||
|
var timeoutId = setInterval(function() {
|
||||||
|
var ua = document.getElementById('qunit-userAgent');
|
||||||
|
if (ua) {
|
||||||
|
ua.innerHTML = platform;
|
||||||
|
clearInterval(timeoutId);
|
||||||
|
}
|
||||||
|
}, 15);
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
19
test/run-test.sh
Executable file → Normal file
@@ -1,7 +1,18 @@
|
|||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
for cmd in rhino ringo narwhal node; do
|
|
||||||
echo "Testing in $cmd..."
|
for cmd in rhino "rhino -require" narwhal ringo phantomjs; do
|
||||||
$cmd test.js
|
echo "Testing in $cmd..."
|
||||||
|
$cmd test.js ../dist/lodash.compat.js && $cmd test.js ../dist/lodash.compat.min.js
|
||||||
|
echo ""
|
||||||
done
|
done
|
||||||
|
|
||||||
|
echo "Testing in node..."
|
||||||
|
node test.js ../dist/lodash.js && node test.js ../dist/lodash.min.js
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "Testing build..."
|
||||||
|
node test-build.js
|
||||||
|
|
||||||
|
echo ""
|
||||||
echo "Testing in a browser..."
|
echo "Testing in a browser..."
|
||||||
open index.html
|
open index.html
|
||||||
|
|||||||
3
test/template/a.jst
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<ul>
|
||||||
|
<% _.forEach(people, function(name) { %><li><%- name %></li><% }); %>
|
||||||
|
</ul>
|
||||||
1
test/template/b.jst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<% print("Hello " + epithet); %>.
|
||||||
1
test/template/c.jst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Hello ${ name }!
|
||||||
1
test/template/d.tpl
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Hallå {{ name }}!
|
||||||
1707
test/test-build.js
Normal file
114
test/test-ui.js
Normal file
@@ -0,0 +1,114 @@
|
|||||||
|
;(function(window) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
/** `QUnit.addEvent` shortcut */
|
||||||
|
var addEvent = QUnit.addEvent;
|
||||||
|
|
||||||
|
/** The Lo-Dash build to load */
|
||||||
|
var build = (/build=([^&]+)/.exec(location.search) || [])[1];
|
||||||
|
|
||||||
|
/** A flag to determine if RequireJS should be loaded */
|
||||||
|
var norequire = /[?&]norequire=true(?:&|$)/.test(location.search);
|
||||||
|
|
||||||
|
/** The `ui` object */
|
||||||
|
var ui = {};
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
// expose Lo-Dash build file path
|
||||||
|
ui.buildPath = (function() {
|
||||||
|
switch (build) {
|
||||||
|
case 'lodash-compat': return 'dist/lodash.compat.min.js';
|
||||||
|
case 'lodash-modern-dev': return 'dist/lodash.js';
|
||||||
|
case 'lodash-modern': return 'dist/lodash.min.js';
|
||||||
|
case 'lodash-legacy': return 'dist/lodash.legacy.min.js';
|
||||||
|
case 'lodash-mobile': return 'dist/lodash.mobile.min.js';
|
||||||
|
case 'lodash-underscore': return 'dist/lodash.underscore.min.js';
|
||||||
|
case 'lodash-custom-dev': return 'lodash.custom.js';
|
||||||
|
case 'lodash-custom': return 'lodash.custom.min.js';
|
||||||
|
}
|
||||||
|
return 'lodash.js';
|
||||||
|
}());
|
||||||
|
|
||||||
|
// assign `QUnit.urlParams` properties
|
||||||
|
QUnit.extend(QUnit.urlParams, {
|
||||||
|
'build': build,
|
||||||
|
'norequire': norequire
|
||||||
|
});
|
||||||
|
|
||||||
|
// initialize controls
|
||||||
|
addEvent(window, 'load', function() {
|
||||||
|
function eventHandler(event) {
|
||||||
|
var search = location.search.replace(/^\?|&?(?:build|norequire)=[^&]*&?/g, '');
|
||||||
|
if (event.stopPropagation) {
|
||||||
|
event.stopPropagation();
|
||||||
|
} else {
|
||||||
|
event.cancelBubble = true;
|
||||||
|
}
|
||||||
|
location.href =
|
||||||
|
location.href.split('?')[0] + '?' +
|
||||||
|
(search ? search + '&' : '') +
|
||||||
|
'build=' + buildList[buildList.selectedIndex].value +
|
||||||
|
(checkbox.checked ? '&norequire=true' : '');
|
||||||
|
}
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
var toolbar = document.getElementById('qunit-testrunner-toolbar');
|
||||||
|
if (toolbar) {
|
||||||
|
toolbar.appendChild(span1);
|
||||||
|
toolbar.appendChild(span2);
|
||||||
|
|
||||||
|
buildList.selectedIndex = (function() {
|
||||||
|
switch (build) {
|
||||||
|
case 'lodash-compat': return 1;
|
||||||
|
case 'lodash-modern-dev': return 2;
|
||||||
|
case 'lodash-modern': return 3;
|
||||||
|
case 'lodash-legacy': return 4;
|
||||||
|
case 'lodash-mobile': return 5;
|
||||||
|
case 'lodash-underscore': return 6;
|
||||||
|
case 'lodash-custom-dev': return 7;
|
||||||
|
case 'lodash-custom': return 8;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}());
|
||||||
|
|
||||||
|
checkbox.checked = norequire;
|
||||||
|
addEvent(checkbox, 'click', eventHandler);
|
||||||
|
addEvent(buildList, 'change', eventHandler);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
setTimeout(init, 15);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var span1 = document.createElement('span');
|
||||||
|
span1.innerHTML =
|
||||||
|
'<input id="qunit-norequire" type="checkbox">' +
|
||||||
|
'<label for="qunit-norequire">No RequireJS</label>';
|
||||||
|
|
||||||
|
var span2 = document.createElement('span');
|
||||||
|
span2.style.cssText = 'float:right';
|
||||||
|
span2.innerHTML =
|
||||||
|
'<label for="qunit-build">Build: </label>' +
|
||||||
|
'<select id="qunit-build">' +
|
||||||
|
'<option value="lodash-compat-dev">Lo-Dash (compat development)</option>' +
|
||||||
|
'<option value="lodash-compat">Lo-Dash (compat production)</option>' +
|
||||||
|
'<option value="lodash-modern-dev">Lo-Dash (modern development)</option>' +
|
||||||
|
'<option value="lodash-modern">Lo-Dash (modern production)</option>' +
|
||||||
|
'<option value="lodash-legacy">Lo-Dash (legacy)</option>' +
|
||||||
|
'<option value="lodash-mobile">Lo-Dash (mobile)</option>' +
|
||||||
|
'<option value="lodash-underscore">Lo-Dash (underscore)</option>' +
|
||||||
|
'<option value="lodash-custom-dev">Lo-Dash (custom development)</option>' +
|
||||||
|
'<option value="lodash-custom">Lo-Dash (custom production)</option>' +
|
||||||
|
'</select>';
|
||||||
|
|
||||||
|
var checkbox = span1.firstChild,
|
||||||
|
buildList = span2.lastChild;
|
||||||
|
|
||||||
|
init();
|
||||||
|
});
|
||||||
|
|
||||||
|
// expose `ui`
|
||||||
|
window.ui = ui;
|
||||||
|
|
||||||
|
}(this));
|
||||||
3737
test/test.js
102
test/underscore.html
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Underscore Test Suite</title>
|
||||||
|
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css">
|
||||||
|
<style>
|
||||||
|
iframe {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="qunit"></div>
|
||||||
|
<div id="qunit-fixture">
|
||||||
|
<div id="map-test">
|
||||||
|
<div id="id1"></div>
|
||||||
|
<div id="id2"></div>
|
||||||
|
</div>
|
||||||
|
<img id="chart_image" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==">
|
||||||
|
</div>
|
||||||
|
<script src="../vendor/jquery/jquery.js"></script>
|
||||||
|
<script src="../vendor/platform.js/platform.js"></script>
|
||||||
|
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
||||||
|
<script src="test-ui.js"></script>
|
||||||
|
<script>
|
||||||
|
document.write('<script src="../' + ui.buildPath + '"><\/script>');
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
(function() {
|
||||||
|
var arrayProto = Array.prototype,
|
||||||
|
concat = arrayProto.concat,
|
||||||
|
pop = arrayProto.pop,
|
||||||
|
push = arrayProto.push,
|
||||||
|
slice = arrayProto.slice;
|
||||||
|
|
||||||
|
if (_.chain().__chain__) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_.mixin = function(object) {
|
||||||
|
_.forEach(_.functions(object), function(methodName) {
|
||||||
|
var func = _[methodName] = object[methodName];
|
||||||
|
_.prototype[methodName] = function() {
|
||||||
|
var args = [this.__wrapped__];
|
||||||
|
push.apply(args, arguments);
|
||||||
|
|
||||||
|
var result = func.apply(_, args);
|
||||||
|
if (this.__chain__) {
|
||||||
|
result = new _(result);
|
||||||
|
result.__chain__ = true;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
_.mixin(_);
|
||||||
|
|
||||||
|
_.mixin({
|
||||||
|
'findWhere': _.find
|
||||||
|
});
|
||||||
|
|
||||||
|
_.chain = function(value) {
|
||||||
|
value = new _(value);
|
||||||
|
value.__chain__ = true;
|
||||||
|
return value;
|
||||||
|
};
|
||||||
|
|
||||||
|
_.prototype.chain = function() {
|
||||||
|
this.__chain__ = true;
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
|
_.prototype.concat = function() {
|
||||||
|
var result = concat.apply(this.__wrapped__, arguments);
|
||||||
|
if (this.__chain__) {
|
||||||
|
result = new _(result);
|
||||||
|
result.__chain__ = true;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
|
||||||
|
_.prototype.pop = function() {
|
||||||
|
pop.apply(this.__wrapped__, arguments);
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
}());
|
||||||
|
</script>
|
||||||
|
<script src="../vendor/underscore/test/collections.js"></script>
|
||||||
|
<script src="../vendor/underscore/test/arrays.js"></script>
|
||||||
|
<script src="../vendor/underscore/test/functions.js"></script>
|
||||||
|
<script src="../vendor/underscore/test/objects.js"></script>
|
||||||
|
<script src="../vendor/underscore/test/utility.js"></script>
|
||||||
|
<script src="../vendor/underscore/test/chaining.js"></script>
|
||||||
|
<script type="text/html" id="template">
|
||||||
|
<%
|
||||||
|
// a comment
|
||||||
|
if (data) { data += 12345; }; %>
|
||||||
|
<li><%= data %></li>
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
<!DOCTYPE HTML>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Underscore Test Suite</title>
|
|
||||||
<link rel="stylesheet" href="vendor/qunit.css" type="text/css" media="screen" />
|
|
||||||
<script type="text/javascript" src="vendor/jquery.js"></script>
|
|
||||||
<script type="text/javascript" src="vendor/qunit.js"></script>
|
|
||||||
<script type="text/javascript" src="vendor/jslitmus.js"></script>
|
|
||||||
<script type="text/javascript" src="../../lodash.js"></script>
|
|
||||||
<script type="text/javascript" src="collections.js"></script>
|
|
||||||
<script type="text/javascript" src="arrays.js"></script>
|
|
||||||
<script type="text/javascript" src="functions.js"></script>
|
|
||||||
<script type="text/javascript" src="objects.js"></script>
|
|
||||||
<script type="text/javascript" src="utility.js"></script>
|
|
||||||
<script type="text/javascript" src="chaining.js"></script>
|
|
||||||
<script type="text/javascript" src="speed.js"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="underscore-test">
|
|
||||||
<h1 id="qunit-header">Underscore Test Suite</h1>
|
|
||||||
<div id="qunit-testrunner-toolbar"></div>
|
|
||||||
<h2 id="qunit-banner"></h2>
|
|
||||||
<h2 id="qunit-userAgent"></h2>
|
|
||||||
<ol id="qunit-tests"></ol>
|
|
||||||
<br />
|
|
||||||
<h1 class="qunit-header">Underscore Speed Suite</h1>
|
|
||||||
<p>
|
|
||||||
A representative sample of the functions are benchmarked here, to provide
|
|
||||||
a sense of how fast they might run in different browsers.
|
|
||||||
Each iteration runs on an array of 1000 elements.<br /><br />
|
|
||||||
For example, the 'intersect' test measures the number of times you can
|
|
||||||
find the intersection of two thousand-element arrays in one second.
|
|
||||||
</p>
|
|
||||||
<br />
|
|
||||||
|
|
||||||
<script type="text/html" id="template">
|
|
||||||
<%
|
|
||||||
// a comment
|
|
||||||
if (data) { data += 12345; }; %>
|
|
||||||
<li><%= data %></li>
|
|
||||||
</script>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
(function() {
|
|
||||||
|
|
||||||
var numbers = [];
|
|
||||||
for (var i=0; i<1000; i++) numbers.push(i);
|
|
||||||
var objects = _.map(numbers, function(n){ return {num : n}; });
|
|
||||||
var randomized = _.sortBy(numbers, function(){ return Math.random(); });
|
|
||||||
|
|
||||||
JSLitmus.test('_.each()', function() {
|
|
||||||
var timesTwo = [];
|
|
||||||
_.each(numbers, function(num){ timesTwo.push(num * 2); });
|
|
||||||
return timesTwo;
|
|
||||||
});
|
|
||||||
|
|
||||||
JSLitmus.test('_(list).each()', function() {
|
|
||||||
var timesTwo = [];
|
|
||||||
_(numbers).each(function(num){ timesTwo.push(num * 2); });
|
|
||||||
return timesTwo;
|
|
||||||
});
|
|
||||||
|
|
||||||
JSLitmus.test('jQuery.each()', function() {
|
|
||||||
var timesTwo = [];
|
|
||||||
jQuery.each(numbers, function(){ timesTwo.push(this * 2); });
|
|
||||||
return timesTwo;
|
|
||||||
});
|
|
||||||
|
|
||||||
JSLitmus.test('_.map()', function() {
|
|
||||||
return _.map(objects, function(obj){ return obj.num; });
|
|
||||||
});
|
|
||||||
|
|
||||||
JSLitmus.test('jQuery.map()', function() {
|
|
||||||
return jQuery.map(objects, function(obj){ return obj.num; });
|
|
||||||
});
|
|
||||||
|
|
||||||
JSLitmus.test('_.pluck()', function() {
|
|
||||||
return _.pluck(objects, 'num');
|
|
||||||
});
|
|
||||||
|
|
||||||
JSLitmus.test('_.uniq()', function() {
|
|
||||||
return _.uniq(randomized);
|
|
||||||
});
|
|
||||||
|
|
||||||
JSLitmus.test('_.uniq() (sorted)', function() {
|
|
||||||
return _.uniq(numbers, true);
|
|
||||||
});
|
|
||||||
|
|
||||||
JSLitmus.test('_.sortBy()', function() {
|
|
||||||
return _.sortBy(numbers, function(num){ return -num; });
|
|
||||||
});
|
|
||||||
|
|
||||||
JSLitmus.test('_.isEqual()', function() {
|
|
||||||
return _.isEqual(numbers, randomized);
|
|
||||||
});
|
|
||||||
|
|
||||||
JSLitmus.test('_.keys()', function() {
|
|
||||||
return _.keys(objects);
|
|
||||||
});
|
|
||||||
|
|
||||||
JSLitmus.test('_.values()', function() {
|
|
||||||
return _.values(objects);
|
|
||||||
});
|
|
||||||
|
|
||||||
JSLitmus.test('_.intersect()', function() {
|
|
||||||
return _.intersect(numbers, randomized);
|
|
||||||
});
|
|
||||||
|
|
||||||
JSLitmus.test('_.range()', function() {
|
|
||||||
return _.range(1000);
|
|
||||||
});
|
|
||||||
|
|
||||||
})();
|
|
||||||
19
test/underscore/vendor/jquery.js
vendored
670
test/underscore/vendor/jslitmus.js
vendored
@@ -1,670 +0,0 @@
|
|||||||
// JSLitmus.js
|
|
||||||
//
|
|
||||||
// History:
|
|
||||||
// 2008-10-27: Initial release
|
|
||||||
// 2008-11-09: Account for iteration loop overhead
|
|
||||||
// 2008-11-13: Added OS detection
|
|
||||||
// 2009-02-25: Create tinyURL automatically, shift-click runs tests in reverse
|
|
||||||
//
|
|
||||||
// Copyright (c) 2008-2009, Robert Kieffer
|
|
||||||
// All Rights Reserved
|
|
||||||
//
|
|
||||||
// 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 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.
|
|
||||||
|
|
||||||
(function() {
|
|
||||||
// Private methods and state
|
|
||||||
|
|
||||||
// Get platform info but don't go crazy trying to recognize everything
|
|
||||||
// that's out there. This is just for the major platforms and OSes.
|
|
||||||
var platform = 'unknown platform', ua = navigator.userAgent;
|
|
||||||
|
|
||||||
// Detect OS
|
|
||||||
var oses = ['Windows','iPhone OS','(Intel |PPC )?Mac OS X','Linux'].join('|');
|
|
||||||
var pOS = new RegExp('((' + oses + ') [^ \);]*)').test(ua) ? RegExp.$1 : null;
|
|
||||||
if (!pOS) pOS = new RegExp('((' + oses + ')[^ \);]*)').test(ua) ? RegExp.$1 : null;
|
|
||||||
|
|
||||||
// Detect browser
|
|
||||||
var pName = /(Chrome|MSIE|Safari|Opera|Firefox)/.test(ua) ? RegExp.$1 : null;
|
|
||||||
|
|
||||||
// Detect version
|
|
||||||
var vre = new RegExp('(Version|' + pName + ')[ \/]([^ ;]*)');
|
|
||||||
var pVersion = (pName && vre.test(ua)) ? RegExp.$2 : null;
|
|
||||||
var platform = (pOS && pName && pVersion) ? pName + ' ' + pVersion + ' on ' + pOS : 'unknown platform';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A smattering of methods that are needed to implement the JSLitmus testbed.
|
|
||||||
*/
|
|
||||||
var jsl = {
|
|
||||||
/**
|
|
||||||
* Enhanced version of escape()
|
|
||||||
*/
|
|
||||||
escape: function(s) {
|
|
||||||
s = s.replace(/,/g, '\\,');
|
|
||||||
s = escape(s);
|
|
||||||
s = s.replace(/\+/g, '%2b');
|
|
||||||
s = s.replace(/ /g, '+');
|
|
||||||
return s;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get an element by ID.
|
|
||||||
*/
|
|
||||||
$: function(id) {
|
|
||||||
return document.getElementById(id);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Null function
|
|
||||||
*/
|
|
||||||
F: function() {},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the status shown in the UI
|
|
||||||
*/
|
|
||||||
status: function(msg) {
|
|
||||||
var el = jsl.$('jsl_status');
|
|
||||||
if (el) el.innerHTML = msg || '';
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Convert a number to an abbreviated string like, "15K" or "10M"
|
|
||||||
*/
|
|
||||||
toLabel: function(n) {
|
|
||||||
if (n == Infinity) {
|
|
||||||
return 'Infinity';
|
|
||||||
} else if (n > 1e9) {
|
|
||||||
n = Math.round(n/1e8);
|
|
||||||
return n/10 + 'B';
|
|
||||||
} else if (n > 1e6) {
|
|
||||||
n = Math.round(n/1e5);
|
|
||||||
return n/10 + 'M';
|
|
||||||
} else if (n > 1e3) {
|
|
||||||
n = Math.round(n/1e2);
|
|
||||||
return n/10 + 'K';
|
|
||||||
}
|
|
||||||
return n;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Copy properties from src to dst
|
|
||||||
*/
|
|
||||||
extend: function(dst, src) {
|
|
||||||
for (var k in src) dst[k] = src[k]; return dst;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Like Array.join(), but for the key-value pairs in an object
|
|
||||||
*/
|
|
||||||
join: function(o, delimit1, delimit2) {
|
|
||||||
if (o.join) return o.join(delimit1); // If it's an array
|
|
||||||
var pairs = [];
|
|
||||||
for (var k in o) pairs.push(k + delimit1 + o[k]);
|
|
||||||
return pairs.join(delimit2);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Array#indexOf isn't supported in IE, so we use this as a cross-browser solution
|
|
||||||
*/
|
|
||||||
indexOf: function(arr, o) {
|
|
||||||
if (arr.indexOf) return arr.indexOf(o);
|
|
||||||
for (var i = 0; i < this.length; i++) if (arr[i] === o) return i;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test manages a single test (created with
|
|
||||||
* JSLitmus.test())
|
|
||||||
*
|
|
||||||
* @private
|
|
||||||
*/
|
|
||||||
var Test = function (name, f) {
|
|
||||||
if (!f) throw new Error('Undefined test function');
|
|
||||||
if (!(/function[^\(]*\(([^,\)]*)/).test(f.toString())) {
|
|
||||||
throw new Error('"' + name + '" test: Test is not a valid Function object');
|
|
||||||
}
|
|
||||||
this.loopArg = RegExp.$1;
|
|
||||||
this.name = name;
|
|
||||||
this.f = f;
|
|
||||||
};
|
|
||||||
|
|
||||||
jsl.extend(Test, /** @lends Test */ {
|
|
||||||
/** Calibration tests for establishing iteration loop overhead */
|
|
||||||
CALIBRATIONS: [
|
|
||||||
new Test('calibrating loop', function(count) {while (count--);}),
|
|
||||||
new Test('calibrating function', jsl.F)
|
|
||||||
],
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Run calibration tests. Returns true if calibrations are not yet
|
|
||||||
* complete (in which case calling code should run the tests yet again).
|
|
||||||
* onCalibrated - Callback to invoke when calibrations have finished
|
|
||||||
*/
|
|
||||||
calibrate: function(onCalibrated) {
|
|
||||||
for (var i = 0; i < Test.CALIBRATIONS.length; i++) {
|
|
||||||
var cal = Test.CALIBRATIONS[i];
|
|
||||||
if (cal.running) return true;
|
|
||||||
if (!cal.count) {
|
|
||||||
cal.isCalibration = true;
|
|
||||||
cal.onStop = onCalibrated;
|
|
||||||
//cal.MIN_TIME = .1; // Do calibrations quickly
|
|
||||||
cal.run(2e4);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
jsl.extend(Test.prototype, {/** @lends Test.prototype */
|
|
||||||
/** Initial number of iterations */
|
|
||||||
INIT_COUNT: 10,
|
|
||||||
/** Max iterations allowed (i.e. used to detect bad looping functions) */
|
|
||||||
MAX_COUNT: 1e9,
|
|
||||||
/** Minimum time a test should take to get valid results (secs) */
|
|
||||||
MIN_TIME: .5,
|
|
||||||
|
|
||||||
/** Callback invoked when test state changes */
|
|
||||||
onChange: jsl.F,
|
|
||||||
|
|
||||||
/** Callback invoked when test is finished */
|
|
||||||
onStop: jsl.F,
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reset test state
|
|
||||||
*/
|
|
||||||
reset: function() {
|
|
||||||
delete this.count;
|
|
||||||
delete this.time;
|
|
||||||
delete this.running;
|
|
||||||
delete this.error;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Run the test (in a timeout). We use a timeout to make sure the browser
|
|
||||||
* has a chance to finish rendering any UI changes we've made, like
|
|
||||||
* updating the status message.
|
|
||||||
*/
|
|
||||||
run: function(count) {
|
|
||||||
count = count || this.INIT_COUNT;
|
|
||||||
jsl.status(this.name + ' x ' + count);
|
|
||||||
this.running = true;
|
|
||||||
var me = this;
|
|
||||||
setTimeout(function() {me._run(count);}, 200);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The nuts and bolts code that actually runs a test
|
|
||||||
*/
|
|
||||||
_run: function(count) {
|
|
||||||
var me = this;
|
|
||||||
|
|
||||||
// Make sure calibration tests have run
|
|
||||||
if (!me.isCalibration && Test.calibrate(function() {me.run(count);})) return;
|
|
||||||
this.error = null;
|
|
||||||
|
|
||||||
try {
|
|
||||||
var start, f = this.f, now, i = count;
|
|
||||||
|
|
||||||
// Start the timer
|
|
||||||
start = new Date();
|
|
||||||
|
|
||||||
// Now for the money shot. If this is a looping function ...
|
|
||||||
if (this.loopArg) {
|
|
||||||
// ... let it do the iteration itself
|
|
||||||
f(count);
|
|
||||||
} else {
|
|
||||||
// ... otherwise do the iteration for it
|
|
||||||
while (i--) f();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get time test took (in secs)
|
|
||||||
this.time = Math.max(1,new Date() - start)/1000;
|
|
||||||
|
|
||||||
// Store iteration count and per-operation time taken
|
|
||||||
this.count = count;
|
|
||||||
this.period = this.time/count;
|
|
||||||
|
|
||||||
// Do we need to do another run?
|
|
||||||
this.running = this.time <= this.MIN_TIME;
|
|
||||||
|
|
||||||
// ... if so, compute how many times we should iterate
|
|
||||||
if (this.running) {
|
|
||||||
// Bump the count to the nearest power of 2
|
|
||||||
var x = this.MIN_TIME/this.time;
|
|
||||||
var pow = Math.pow(2, Math.max(1, Math.ceil(Math.log(x)/Math.log(2))));
|
|
||||||
count *= pow;
|
|
||||||
if (count > this.MAX_COUNT) {
|
|
||||||
throw new Error('Max count exceeded. If this test uses a looping function, make sure the iteration loop is working properly.');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
// Exceptions are caught and displayed in the test UI
|
|
||||||
this.reset();
|
|
||||||
this.error = e;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Figure out what to do next
|
|
||||||
if (this.running) {
|
|
||||||
me.run(count);
|
|
||||||
} else {
|
|
||||||
jsl.status('');
|
|
||||||
me.onStop(me);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Finish up
|
|
||||||
this.onChange(this);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the number of operations per second for this test.
|
|
||||||
*
|
|
||||||
* @param normalize if true, iteration loop overhead taken into account
|
|
||||||
*/
|
|
||||||
getHz: function(/**Boolean*/ normalize) {
|
|
||||||
var p = this.period;
|
|
||||||
|
|
||||||
// Adjust period based on the calibration test time
|
|
||||||
if (normalize && !this.isCalibration) {
|
|
||||||
var cal = Test.CALIBRATIONS[this.loopArg ? 0 : 1];
|
|
||||||
|
|
||||||
// If the period is within 20% of the calibration time, then zero the
|
|
||||||
// it out
|
|
||||||
p = p < cal.period*1.2 ? 0 : p - cal.period;
|
|
||||||
}
|
|
||||||
|
|
||||||
return Math.round(1/p);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get a friendly string describing the test
|
|
||||||
*/
|
|
||||||
toString: function() {
|
|
||||||
return this.name + ' - ' + this.time/this.count + ' secs';
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// CSS we need for the UI
|
|
||||||
var STYLESHEET = '<style> \
|
|
||||||
#jslitmus {font-family:sans-serif; font-size: 12px;} \
|
|
||||||
#jslitmus a {text-decoration: none;} \
|
|
||||||
#jslitmus a:hover {text-decoration: underline;} \
|
|
||||||
#jsl_status { \
|
|
||||||
margin-top: 10px; \
|
|
||||||
font-size: 10px; \
|
|
||||||
color: #888; \
|
|
||||||
} \
|
|
||||||
A IMG {border:none} \
|
|
||||||
#test_results { \
|
|
||||||
margin-top: 10px; \
|
|
||||||
font-size: 12px; \
|
|
||||||
font-family: sans-serif; \
|
|
||||||
border-collapse: collapse; \
|
|
||||||
border-spacing: 0px; \
|
|
||||||
} \
|
|
||||||
#test_results th, #test_results td { \
|
|
||||||
border: solid 1px #ccc; \
|
|
||||||
vertical-align: top; \
|
|
||||||
padding: 3px; \
|
|
||||||
} \
|
|
||||||
#test_results th { \
|
|
||||||
vertical-align: bottom; \
|
|
||||||
background-color: #ccc; \
|
|
||||||
padding: 1px; \
|
|
||||||
font-size: 10px; \
|
|
||||||
} \
|
|
||||||
#test_results #test_platform { \
|
|
||||||
color: #444; \
|
|
||||||
text-align:center; \
|
|
||||||
} \
|
|
||||||
#test_results .test_row { \
|
|
||||||
color: #006; \
|
|
||||||
cursor: pointer; \
|
|
||||||
} \
|
|
||||||
#test_results .test_nonlooping { \
|
|
||||||
border-left-style: dotted; \
|
|
||||||
border-left-width: 2px; \
|
|
||||||
} \
|
|
||||||
#test_results .test_looping { \
|
|
||||||
border-left-style: solid; \
|
|
||||||
border-left-width: 2px; \
|
|
||||||
} \
|
|
||||||
#test_results .test_name {white-space: nowrap;} \
|
|
||||||
#test_results .test_pending { \
|
|
||||||
} \
|
|
||||||
#test_results .test_running { \
|
|
||||||
font-style: italic; \
|
|
||||||
} \
|
|
||||||
#test_results .test_done {} \
|
|
||||||
#test_results .test_done { \
|
|
||||||
text-align: right; \
|
|
||||||
font-family: monospace; \
|
|
||||||
} \
|
|
||||||
#test_results .test_error {color: #600;} \
|
|
||||||
#test_results .test_error .error_head {font-weight:bold;} \
|
|
||||||
#test_results .test_error .error_body {font-size:85%;} \
|
|
||||||
#test_results .test_row:hover td { \
|
|
||||||
background-color: #ffc; \
|
|
||||||
text-decoration: underline; \
|
|
||||||
} \
|
|
||||||
#chart { \
|
|
||||||
margin: 10px 0px; \
|
|
||||||
width: 250px; \
|
|
||||||
} \
|
|
||||||
#chart img { \
|
|
||||||
border: solid 1px #ccc; \
|
|
||||||
margin-bottom: 5px; \
|
|
||||||
} \
|
|
||||||
#chart #tiny_url { \
|
|
||||||
height: 40px; \
|
|
||||||
width: 250px; \
|
|
||||||
} \
|
|
||||||
#jslitmus_credit { \
|
|
||||||
font-size: 10px; \
|
|
||||||
color: #888; \
|
|
||||||
margin-top: 8px; \
|
|
||||||
} \
|
|
||||||
</style>';
|
|
||||||
|
|
||||||
// HTML markup for the UI
|
|
||||||
var MARKUP = '<div id="jslitmus"> \
|
|
||||||
<button onclick="JSLitmus.runAll(event)">Run Tests</button> \
|
|
||||||
<button id="stop_button" disabled="disabled" onclick="JSLitmus.stop()">Stop Tests</button> \
|
|
||||||
<br \> \
|
|
||||||
<br \> \
|
|
||||||
<input type="checkbox" style="vertical-align: middle" id="test_normalize" checked="checked" onchange="JSLitmus.renderAll()""> Normalize results \
|
|
||||||
<table id="test_results"> \
|
|
||||||
<colgroup> \
|
|
||||||
<col /> \
|
|
||||||
<col width="100" /> \
|
|
||||||
</colgroup> \
|
|
||||||
<tr><th id="test_platform" colspan="2">' + platform + '</th></tr> \
|
|
||||||
<tr><th>Test</th><th>Ops/sec</th></tr> \
|
|
||||||
<tr id="test_row_template" class="test_row" style="display:none"> \
|
|
||||||
<td class="test_name"></td> \
|
|
||||||
<td class="test_result">Ready</td> \
|
|
||||||
</tr> \
|
|
||||||
</table> \
|
|
||||||
<div id="jsl_status"></div> \
|
|
||||||
<div id="chart" style="display:none"> \
|
|
||||||
<a id="chart_link" target="_blank"><img id="chart_image"></a> \
|
|
||||||
TinyURL (for chart): \
|
|
||||||
<iframe id="tiny_url" frameBorder="0" scrolling="no" src=""></iframe> \
|
|
||||||
</div> \
|
|
||||||
<a id="jslitmus_credit" title="JSLitmus home page" href="http://code.google.com/p/jslitmus" target="_blank">Powered by JSLitmus</a> \
|
|
||||||
</div>';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The public API for creating and running tests
|
|
||||||
*/
|
|
||||||
window.JSLitmus = {
|
|
||||||
/** The list of all tests that have been registered with JSLitmus.test */
|
|
||||||
_tests: [],
|
|
||||||
/** The queue of tests that need to be run */
|
|
||||||
_queue: [],
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The parsed query parameters the current page URL. This is provided as a
|
|
||||||
* convenience for test functions - it's not used by JSLitmus proper
|
|
||||||
*/
|
|
||||||
params: {},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize
|
|
||||||
*/
|
|
||||||
_init: function() {
|
|
||||||
// Parse query params into JSLitmus.params[] hash
|
|
||||||
var match = (location + '').match(/([^?#]*)(#.*)?$/);
|
|
||||||
if (match) {
|
|
||||||
var pairs = match[1].split('&');
|
|
||||||
for (var i = 0; i < pairs.length; i++) {
|
|
||||||
var pair = pairs[i].split('=');
|
|
||||||
if (pair.length > 1) {
|
|
||||||
var key = pair.shift();
|
|
||||||
var value = pair.length > 1 ? pair.join('=') : pair[0];
|
|
||||||
this.params[key] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Write out the stylesheet. We have to do this here because IE
|
|
||||||
// doesn't honor sheets written after the document has loaded.
|
|
||||||
document.write(STYLESHEET);
|
|
||||||
|
|
||||||
// Setup the rest of the UI once the document is loaded
|
|
||||||
if (window.addEventListener) {
|
|
||||||
window.addEventListener('load', this._setup, false);
|
|
||||||
} else if (document.addEventListener) {
|
|
||||||
document.addEventListener('load', this._setup, false);
|
|
||||||
} else if (window.attachEvent) {
|
|
||||||
window.attachEvent('onload', this._setup);
|
|
||||||
}
|
|
||||||
|
|
||||||
return this;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set up the UI
|
|
||||||
*/
|
|
||||||
_setup: function() {
|
|
||||||
var el = jsl.$('jslitmus_container');
|
|
||||||
if (!el) document.body.appendChild(el = document.createElement('div'));
|
|
||||||
|
|
||||||
el.innerHTML = MARKUP;
|
|
||||||
|
|
||||||
// Render the UI for all our tests
|
|
||||||
for (var i=0; i < JSLitmus._tests.length; i++)
|
|
||||||
JSLitmus.renderTest(JSLitmus._tests[i]);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* (Re)render all the test results
|
|
||||||
*/
|
|
||||||
renderAll: function() {
|
|
||||||
for (var i = 0; i < JSLitmus._tests.length; i++)
|
|
||||||
JSLitmus.renderTest(JSLitmus._tests[i]);
|
|
||||||
JSLitmus.renderChart();
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* (Re)render the chart graphics
|
|
||||||
*/
|
|
||||||
renderChart: function() {
|
|
||||||
var url = JSLitmus.chartUrl();
|
|
||||||
jsl.$('chart_link').href = url;
|
|
||||||
jsl.$('chart_image').src = url;
|
|
||||||
jsl.$('chart').style.display = '';
|
|
||||||
|
|
||||||
// Update the tiny URL
|
|
||||||
jsl.$('tiny_url').src = 'http://tinyurl.com/api-create.php?url='+escape(url);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* (Re)render the results for a specific test
|
|
||||||
*/
|
|
||||||
renderTest: function(test) {
|
|
||||||
// Make a new row if needed
|
|
||||||
if (!test._row) {
|
|
||||||
var trow = jsl.$('test_row_template');
|
|
||||||
if (!trow) return;
|
|
||||||
|
|
||||||
test._row = trow.cloneNode(true);
|
|
||||||
test._row.style.display = '';
|
|
||||||
test._row.id = '';
|
|
||||||
test._row.onclick = function() {JSLitmus._queueTest(test);};
|
|
||||||
test._row.title = 'Run ' + test.name + ' test';
|
|
||||||
trow.parentNode.appendChild(test._row);
|
|
||||||
test._row.cells[0].innerHTML = test.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
var cell = test._row.cells[1];
|
|
||||||
var cns = [test.loopArg ? 'test_looping' : 'test_nonlooping'];
|
|
||||||
|
|
||||||
if (test.error) {
|
|
||||||
cns.push('test_error');
|
|
||||||
cell.innerHTML =
|
|
||||||
'<div class="error_head">' + test.error + '</div>' +
|
|
||||||
'<ul class="error_body"><li>' +
|
|
||||||
jsl.join(test.error, ': ', '</li><li>') +
|
|
||||||
'</li></ul>';
|
|
||||||
} else {
|
|
||||||
if (test.running) {
|
|
||||||
cns.push('test_running');
|
|
||||||
cell.innerHTML = 'running';
|
|
||||||
} else if (jsl.indexOf(JSLitmus._queue, test) >= 0) {
|
|
||||||
cns.push('test_pending');
|
|
||||||
cell.innerHTML = 'pending';
|
|
||||||
} else if (test.count) {
|
|
||||||
cns.push('test_done');
|
|
||||||
var hz = test.getHz(jsl.$('test_normalize').checked);
|
|
||||||
cell.innerHTML = hz != Infinity ? hz : '∞';
|
|
||||||
} else {
|
|
||||||
cell.innerHTML = 'ready';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cell.className = cns.join(' ');
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new test
|
|
||||||
*/
|
|
||||||
test: function(name, f) {
|
|
||||||
// Create the Test object
|
|
||||||
var test = new Test(name, f);
|
|
||||||
JSLitmus._tests.push(test);
|
|
||||||
|
|
||||||
// Re-render if the test state changes
|
|
||||||
test.onChange = JSLitmus.renderTest;
|
|
||||||
|
|
||||||
// Run the next test if this one finished
|
|
||||||
test.onStop = function(test) {
|
|
||||||
if (JSLitmus.onTestFinish) JSLitmus.onTestFinish(test);
|
|
||||||
JSLitmus.currentTest = null;
|
|
||||||
JSLitmus._nextTest();
|
|
||||||
};
|
|
||||||
|
|
||||||
// Render the new test
|
|
||||||
this.renderTest(test);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add all tests to the run queue
|
|
||||||
*/
|
|
||||||
runAll: function(e) {
|
|
||||||
e = e || window.event;
|
|
||||||
var reverse = e && e.shiftKey, len = JSLitmus._tests.length;
|
|
||||||
for (var i = 0; i < len; i++) {
|
|
||||||
JSLitmus._queueTest(JSLitmus._tests[!reverse ? i : (len - i - 1)]);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove all tests from the run queue. The current test has to finish on
|
|
||||||
* it's own though
|
|
||||||
*/
|
|
||||||
stop: function() {
|
|
||||||
while (JSLitmus._queue.length) {
|
|
||||||
var test = JSLitmus._queue.shift();
|
|
||||||
JSLitmus.renderTest(test);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Run the next test in the run queue
|
|
||||||
*/
|
|
||||||
_nextTest: function() {
|
|
||||||
if (!JSLitmus.currentTest) {
|
|
||||||
var test = JSLitmus._queue.shift();
|
|
||||||
if (test) {
|
|
||||||
jsl.$('stop_button').disabled = false;
|
|
||||||
JSLitmus.currentTest = test;
|
|
||||||
test.run();
|
|
||||||
JSLitmus.renderTest(test);
|
|
||||||
if (JSLitmus.onTestStart) JSLitmus.onTestStart(test);
|
|
||||||
} else {
|
|
||||||
jsl.$('stop_button').disabled = true;
|
|
||||||
JSLitmus.renderChart();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add a test to the run queue
|
|
||||||
*/
|
|
||||||
_queueTest: function(test) {
|
|
||||||
if (jsl.indexOf(JSLitmus._queue, test) >= 0) return;
|
|
||||||
JSLitmus._queue.push(test);
|
|
||||||
JSLitmus.renderTest(test);
|
|
||||||
JSLitmus._nextTest();
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generate a Google Chart URL that shows the data for all tests
|
|
||||||
*/
|
|
||||||
chartUrl: function() {
|
|
||||||
var n = JSLitmus._tests.length, markers = [], data = [];
|
|
||||||
var d, min = 0, max = -1e10;
|
|
||||||
var normalize = jsl.$('test_normalize').checked;
|
|
||||||
|
|
||||||
// Gather test data
|
|
||||||
for (var i=0; i < JSLitmus._tests.length; i++) {
|
|
||||||
var test = JSLitmus._tests[i];
|
|
||||||
if (test.count) {
|
|
||||||
var hz = test.getHz(normalize);
|
|
||||||
var v = hz != Infinity ? hz : 0;
|
|
||||||
data.push(v);
|
|
||||||
markers.push('t' + jsl.escape(test.name + '(' + jsl.toLabel(hz)+ ')') + ',000000,0,' +
|
|
||||||
markers.length + ',10');
|
|
||||||
max = Math.max(v, max);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (markers.length <= 0) return null;
|
|
||||||
|
|
||||||
// Build chart title
|
|
||||||
var title = document.getElementsByTagName('title');
|
|
||||||
title = (title && title.length) ? title[0].innerHTML : null;
|
|
||||||
var chart_title = [];
|
|
||||||
if (title) chart_title.push(title);
|
|
||||||
chart_title.push('Ops/sec (' + platform + ')');
|
|
||||||
|
|
||||||
// Build labels
|
|
||||||
var labels = [jsl.toLabel(min), jsl.toLabel(max)];
|
|
||||||
|
|
||||||
var w = 250, bw = 15;
|
|
||||||
var bs = 5;
|
|
||||||
var h = markers.length*(bw + bs) + 30 + chart_title.length*20;
|
|
||||||
|
|
||||||
var params = {
|
|
||||||
chtt: escape(chart_title.join('|')),
|
|
||||||
chts: '000000,10',
|
|
||||||
cht: 'bhg', // chart type
|
|
||||||
chd: 't:' + data.join(','), // data set
|
|
||||||
chds: min + ',' + max, // max/min of data
|
|
||||||
chxt: 'x', // label axes
|
|
||||||
chxl: '0:|' + labels.join('|'), // labels
|
|
||||||
chsp: '0,1',
|
|
||||||
chm: markers.join('|'), // test names
|
|
||||||
chbh: [bw, 0, bs].join(','), // bar widths
|
|
||||||
// chf: 'bg,lg,0,eeeeee,0,eeeeee,.5,ffffff,1', // gradient
|
|
||||||
chs: w + 'x' + h
|
|
||||||
};
|
|
||||||
return 'http://chart.apis.google.com/chart?' + jsl.join(params, '=', '&');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
JSLitmus._init();
|
|
||||||
})();
|
|
||||||
1597
test/underscore/vendor/qunit.js
vendored
22
vendor/backbone/LICENSE
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
Copyright (c) 2010-2013 Jeremy Ashkenas, DocumentCloud
|
||||||
|
|
||||||
|
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.
|
||||||
26
vendor/backbone/README.md
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
____ __ __
|
||||||
|
/\ _`\ /\ \ /\ \ __
|
||||||
|
\ \ \ \ \ __ ___\ \ \/'\\ \ \____ ___ ___ __ /\_\ ____
|
||||||
|
\ \ _ <' /'__`\ /'___\ \ , < \ \ '__`\ / __`\ /' _ `\ /'__`\ \/\ \ /',__\
|
||||||
|
\ \ \ \ \/\ \ \.\_/\ \__/\ \ \\`\\ \ \ \ \/\ \ \ \/\ \/\ \/\ __/ __ \ \ \/\__, `\
|
||||||
|
\ \____/\ \__/.\_\ \____\\ \_\ \_\ \_,__/\ \____/\ \_\ \_\ \____\/\_\_\ \ \/\____/
|
||||||
|
\/___/ \/__/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/_/\/_/\/____/\/_/\ \_\ \/___/
|
||||||
|
\ \____/
|
||||||
|
\/___/
|
||||||
|
(_'_______________________________________________________________________________'_)
|
||||||
|
(_.———————————————————————————————————————————————————————————————————————————————._)
|
||||||
|
|
||||||
|
|
||||||
|
Backbone supplies structure to JavaScript-heavy applications by providing models key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing application over a RESTful JSON interface.
|
||||||
|
|
||||||
|
For Docs, License, Tests, pre-packed downloads, and everything else, really, see:
|
||||||
|
http://backbonejs.org
|
||||||
|
|
||||||
|
To suggest a feature, report a bug, or general discussion:
|
||||||
|
http://github.com/documentcloud/backbone/issues/
|
||||||
|
|
||||||
|
All contributors are listed here:
|
||||||
|
http://github.com/documentcloud/backbone/contributors
|
||||||
|
|
||||||
|
Special thanks to Robert Kieffer for the original philosophy behind Backbone.
|
||||||
|
http://github.com/broofa
|
||||||
1571
vendor/backbone/backbone.js
vendored
Normal file
1100
vendor/backbone/test/collection.js
vendored
Normal file
45
vendor/backbone/test/environment.js
vendored
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
(function() {
|
||||||
|
|
||||||
|
var Environment = this.Environment = function(){};
|
||||||
|
|
||||||
|
_.extend(Environment.prototype, {
|
||||||
|
|
||||||
|
ajax: Backbone.ajax,
|
||||||
|
|
||||||
|
sync: Backbone.sync,
|
||||||
|
|
||||||
|
emulateHTTP: Backbone.emulateHTTP,
|
||||||
|
|
||||||
|
emulateJSON: Backbone.emulateJSON,
|
||||||
|
|
||||||
|
setup: function() {
|
||||||
|
var env = this;
|
||||||
|
|
||||||
|
// Capture ajax settings for comparison.
|
||||||
|
Backbone.ajax = function(settings) {
|
||||||
|
env.ajaxSettings = settings;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Capture the arguments to Backbone.sync for comparison.
|
||||||
|
Backbone.sync = function(method, model, options) {
|
||||||
|
env.syncArgs = {
|
||||||
|
method: method,
|
||||||
|
model: model,
|
||||||
|
options: options
|
||||||
|
};
|
||||||
|
env.sync.apply(this, arguments);
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
teardown: function() {
|
||||||
|
this.syncArgs = null;
|
||||||
|
this.ajaxSettings = null;
|
||||||
|
Backbone.sync = this.sync;
|
||||||
|
Backbone.ajax = this.ajax;
|
||||||
|
Backbone.emulateHTTP = this.emulateHTTP;
|
||||||
|
Backbone.emulateJSON = this.emulateJSON;
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
})();
|
||||||
452
vendor/backbone/test/events.js
vendored
Normal file
@@ -0,0 +1,452 @@
|
|||||||
|
$(document).ready(function() {
|
||||||
|
|
||||||
|
module("Backbone.Events");
|
||||||
|
|
||||||
|
test("on and trigger", 2, function() {
|
||||||
|
var obj = { counter: 0 };
|
||||||
|
_.extend(obj,Backbone.Events);
|
||||||
|
obj.on('event', function() { obj.counter += 1; });
|
||||||
|
obj.trigger('event');
|
||||||
|
equal(obj.counter,1,'counter should be incremented.');
|
||||||
|
obj.trigger('event');
|
||||||
|
obj.trigger('event');
|
||||||
|
obj.trigger('event');
|
||||||
|
obj.trigger('event');
|
||||||
|
equal(obj.counter, 5, 'counter should be incremented five times.');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("binding and triggering multiple events", 4, function() {
|
||||||
|
var obj = { counter: 0 };
|
||||||
|
_.extend(obj, Backbone.Events);
|
||||||
|
|
||||||
|
obj.on('a b c', function() { obj.counter += 1; });
|
||||||
|
|
||||||
|
obj.trigger('a');
|
||||||
|
equal(obj.counter, 1);
|
||||||
|
|
||||||
|
obj.trigger('a b');
|
||||||
|
equal(obj.counter, 3);
|
||||||
|
|
||||||
|
obj.trigger('c');
|
||||||
|
equal(obj.counter, 4);
|
||||||
|
|
||||||
|
obj.off('a c');
|
||||||
|
obj.trigger('a b c');
|
||||||
|
equal(obj.counter, 5);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("binding and triggering with event maps", function() {
|
||||||
|
var obj = { counter: 0 };
|
||||||
|
_.extend(obj, Backbone.Events);
|
||||||
|
|
||||||
|
var increment = function() {
|
||||||
|
this.counter += 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
obj.on({
|
||||||
|
a: increment,
|
||||||
|
b: increment,
|
||||||
|
c: increment
|
||||||
|
}, obj);
|
||||||
|
|
||||||
|
obj.trigger('a');
|
||||||
|
equal(obj.counter, 1);
|
||||||
|
|
||||||
|
obj.trigger('a b');
|
||||||
|
equal(obj.counter, 3);
|
||||||
|
|
||||||
|
obj.trigger('c');
|
||||||
|
equal(obj.counter, 4);
|
||||||
|
|
||||||
|
obj.off({
|
||||||
|
a: increment,
|
||||||
|
c: increment
|
||||||
|
}, obj);
|
||||||
|
obj.trigger('a b c');
|
||||||
|
equal(obj.counter, 5);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("listenTo and stopListening", 1, function() {
|
||||||
|
var a = _.extend({}, Backbone.Events);
|
||||||
|
var b = _.extend({}, Backbone.Events);
|
||||||
|
a.listenTo(b, 'all', function(){ ok(true); });
|
||||||
|
b.trigger('anything');
|
||||||
|
a.listenTo(b, 'all', function(){ ok(false); });
|
||||||
|
a.stopListening();
|
||||||
|
b.trigger('anything');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("listenTo and stopListening with event maps", 4, function() {
|
||||||
|
var a = _.extend({}, Backbone.Events);
|
||||||
|
var b = _.extend({}, Backbone.Events);
|
||||||
|
var cb = function(){ ok(true); };
|
||||||
|
a.listenTo(b, {event: cb});
|
||||||
|
b.trigger('event');
|
||||||
|
a.listenTo(b, {event2: cb});
|
||||||
|
b.on('event2', cb);
|
||||||
|
a.stopListening(b, {event2: cb});
|
||||||
|
b.trigger('event event2');
|
||||||
|
a.stopListening();
|
||||||
|
b.trigger('event event2');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("stopListening with omitted args", 2, function () {
|
||||||
|
var a = _.extend({}, Backbone.Events);
|
||||||
|
var b = _.extend({}, Backbone.Events);
|
||||||
|
var cb = function () { ok(true); };
|
||||||
|
a.listenTo(b, 'event', cb);
|
||||||
|
b.on('event', cb);
|
||||||
|
a.listenTo(b, 'event2', cb);
|
||||||
|
a.stopListening(null, {event: cb});
|
||||||
|
b.trigger('event event2');
|
||||||
|
b.off();
|
||||||
|
a.listenTo(b, 'event event2', cb);
|
||||||
|
a.stopListening(null, 'event');
|
||||||
|
a.stopListening();
|
||||||
|
b.trigger('event2');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("listenToOnce and stopListening", 1, function() {
|
||||||
|
var a = _.extend({}, Backbone.Events);
|
||||||
|
var b = _.extend({}, Backbone.Events);
|
||||||
|
a.listenToOnce(b, 'all', function() { ok(true); });
|
||||||
|
b.trigger('anything');
|
||||||
|
b.trigger('anything');
|
||||||
|
a.listenToOnce(b, 'all', function() { ok(false); });
|
||||||
|
a.stopListening();
|
||||||
|
b.trigger('anything');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("listenTo, listenToOnce and stopListening", 1, function() {
|
||||||
|
var a = _.extend({}, Backbone.Events);
|
||||||
|
var b = _.extend({}, Backbone.Events);
|
||||||
|
a.listenToOnce(b, 'all', function() { ok(true); });
|
||||||
|
b.trigger('anything');
|
||||||
|
b.trigger('anything');
|
||||||
|
a.listenTo(b, 'all', function() { ok(false); });
|
||||||
|
a.stopListening();
|
||||||
|
b.trigger('anything');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("listenTo and stopListening with event maps", 1, function() {
|
||||||
|
var a = _.extend({}, Backbone.Events);
|
||||||
|
var b = _.extend({}, Backbone.Events);
|
||||||
|
a.listenTo(b, {change: function(){ ok(true); }});
|
||||||
|
b.trigger('change');
|
||||||
|
a.listenTo(b, {change: function(){ ok(false); }});
|
||||||
|
a.stopListening();
|
||||||
|
b.trigger('change');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("listenTo yourself", 1, function(){
|
||||||
|
var e = _.extend({}, Backbone.Events);
|
||||||
|
e.listenTo(e, "foo", function(){ ok(true); });
|
||||||
|
e.trigger("foo");
|
||||||
|
});
|
||||||
|
|
||||||
|
test("listenTo yourself cleans yourself up with stopListening", 1, function(){
|
||||||
|
var e = _.extend({}, Backbone.Events);
|
||||||
|
e.listenTo(e, "foo", function(){ ok(true); });
|
||||||
|
e.trigger("foo");
|
||||||
|
e.stopListening();
|
||||||
|
e.trigger("foo");
|
||||||
|
});
|
||||||
|
|
||||||
|
test("listenTo with empty callback doesn't throw an error", 1, function(){
|
||||||
|
var e = _.extend({}, Backbone.Events);
|
||||||
|
e.listenTo(e, "foo", null);
|
||||||
|
e.trigger("foo");
|
||||||
|
ok(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("trigger all for each event", 3, function() {
|
||||||
|
var a, b, obj = { counter: 0 };
|
||||||
|
_.extend(obj, Backbone.Events);
|
||||||
|
obj.on('all', function(event) {
|
||||||
|
obj.counter++;
|
||||||
|
if (event == 'a') a = true;
|
||||||
|
if (event == 'b') b = true;
|
||||||
|
})
|
||||||
|
.trigger('a b');
|
||||||
|
ok(a);
|
||||||
|
ok(b);
|
||||||
|
equal(obj.counter, 2);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("on, then unbind all functions", 1, function() {
|
||||||
|
var obj = { counter: 0 };
|
||||||
|
_.extend(obj,Backbone.Events);
|
||||||
|
var callback = function() { obj.counter += 1; };
|
||||||
|
obj.on('event', callback);
|
||||||
|
obj.trigger('event');
|
||||||
|
obj.off('event');
|
||||||
|
obj.trigger('event');
|
||||||
|
equal(obj.counter, 1, 'counter should have only been incremented once.');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("bind two callbacks, unbind only one", 2, function() {
|
||||||
|
var obj = { counterA: 0, counterB: 0 };
|
||||||
|
_.extend(obj,Backbone.Events);
|
||||||
|
var callback = function() { obj.counterA += 1; };
|
||||||
|
obj.on('event', callback);
|
||||||
|
obj.on('event', function() { obj.counterB += 1; });
|
||||||
|
obj.trigger('event');
|
||||||
|
obj.off('event', callback);
|
||||||
|
obj.trigger('event');
|
||||||
|
equal(obj.counterA, 1, 'counterA should have only been incremented once.');
|
||||||
|
equal(obj.counterB, 2, 'counterB should have been incremented twice.');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("unbind a callback in the midst of it firing", 1, function() {
|
||||||
|
var obj = {counter: 0};
|
||||||
|
_.extend(obj, Backbone.Events);
|
||||||
|
var callback = function() {
|
||||||
|
obj.counter += 1;
|
||||||
|
obj.off('event', callback);
|
||||||
|
};
|
||||||
|
obj.on('event', callback);
|
||||||
|
obj.trigger('event');
|
||||||
|
obj.trigger('event');
|
||||||
|
obj.trigger('event');
|
||||||
|
equal(obj.counter, 1, 'the callback should have been unbound.');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("two binds that unbind themeselves", 2, function() {
|
||||||
|
var obj = { counterA: 0, counterB: 0 };
|
||||||
|
_.extend(obj,Backbone.Events);
|
||||||
|
var incrA = function(){ obj.counterA += 1; obj.off('event', incrA); };
|
||||||
|
var incrB = function(){ obj.counterB += 1; obj.off('event', incrB); };
|
||||||
|
obj.on('event', incrA);
|
||||||
|
obj.on('event', incrB);
|
||||||
|
obj.trigger('event');
|
||||||
|
obj.trigger('event');
|
||||||
|
obj.trigger('event');
|
||||||
|
equal(obj.counterA, 1, 'counterA should have only been incremented once.');
|
||||||
|
equal(obj.counterB, 1, 'counterB should have only been incremented once.');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("bind a callback with a supplied context", 1, function () {
|
||||||
|
var TestClass = function () {
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
TestClass.prototype.assertTrue = function () {
|
||||||
|
ok(true, '`this` was bound to the callback');
|
||||||
|
};
|
||||||
|
|
||||||
|
var obj = _.extend({},Backbone.Events);
|
||||||
|
obj.on('event', function () { this.assertTrue(); }, (new TestClass));
|
||||||
|
obj.trigger('event');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("nested trigger with unbind", 1, function () {
|
||||||
|
var obj = { counter: 0 };
|
||||||
|
_.extend(obj, Backbone.Events);
|
||||||
|
var incr1 = function(){ obj.counter += 1; obj.off('event', incr1); obj.trigger('event'); };
|
||||||
|
var incr2 = function(){ obj.counter += 1; };
|
||||||
|
obj.on('event', incr1);
|
||||||
|
obj.on('event', incr2);
|
||||||
|
obj.trigger('event');
|
||||||
|
equal(obj.counter, 3, 'counter should have been incremented three times');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("callback list is not altered during trigger", 2, function () {
|
||||||
|
var counter = 0, obj = _.extend({}, Backbone.Events);
|
||||||
|
var incr = function(){ counter++; };
|
||||||
|
obj.on('event', function(){ obj.on('event', incr).on('all', incr); })
|
||||||
|
.trigger('event');
|
||||||
|
equal(counter, 0, 'bind does not alter callback list');
|
||||||
|
obj.off()
|
||||||
|
.on('event', function(){ obj.off('event', incr).off('all', incr); })
|
||||||
|
.on('event', incr)
|
||||||
|
.on('all', incr)
|
||||||
|
.trigger('event');
|
||||||
|
equal(counter, 2, 'unbind does not alter callback list');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("#1282 - 'all' callback list is retrieved after each event.", 1, function() {
|
||||||
|
var counter = 0;
|
||||||
|
var obj = _.extend({}, Backbone.Events);
|
||||||
|
var incr = function(){ counter++; };
|
||||||
|
obj.on('x', function() {
|
||||||
|
obj.on('y', incr).on('all', incr);
|
||||||
|
})
|
||||||
|
.trigger('x y');
|
||||||
|
strictEqual(counter, 2);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("if no callback is provided, `on` is a noop", 0, function() {
|
||||||
|
_.extend({}, Backbone.Events).on('test').trigger('test');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("if callback is truthy but not a function, `on` should throw an error just like jQuery", 1, function() {
|
||||||
|
var view = _.extend({}, Backbone.Events).on('test', 'noop');
|
||||||
|
throws(function() {
|
||||||
|
view.trigger('test');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test("remove all events for a specific context", 4, function() {
|
||||||
|
var obj = _.extend({}, Backbone.Events);
|
||||||
|
obj.on('x y all', function() { ok(true); });
|
||||||
|
obj.on('x y all', function() { ok(false); }, obj);
|
||||||
|
obj.off(null, null, obj);
|
||||||
|
obj.trigger('x y');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("remove all events for a specific callback", 4, function() {
|
||||||
|
var obj = _.extend({}, Backbone.Events);
|
||||||
|
var success = function() { ok(true); };
|
||||||
|
var fail = function() { ok(false); };
|
||||||
|
obj.on('x y all', success);
|
||||||
|
obj.on('x y all', fail);
|
||||||
|
obj.off(null, fail);
|
||||||
|
obj.trigger('x y');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("#1310 - off does not skip consecutive events", 0, function() {
|
||||||
|
var obj = _.extend({}, Backbone.Events);
|
||||||
|
obj.on('event', function() { ok(false); }, obj);
|
||||||
|
obj.on('event', function() { ok(false); }, obj);
|
||||||
|
obj.off(null, null, obj);
|
||||||
|
obj.trigger('event');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("once", 2, function() {
|
||||||
|
// Same as the previous test, but we use once rather than having to explicitly unbind
|
||||||
|
var obj = { counterA: 0, counterB: 0 };
|
||||||
|
_.extend(obj, Backbone.Events);
|
||||||
|
var incrA = function(){ obj.counterA += 1; obj.trigger('event'); };
|
||||||
|
var incrB = function(){ obj.counterB += 1; };
|
||||||
|
obj.once('event', incrA);
|
||||||
|
obj.once('event', incrB);
|
||||||
|
obj.trigger('event');
|
||||||
|
equal(obj.counterA, 1, 'counterA should have only been incremented once.');
|
||||||
|
equal(obj.counterB, 1, 'counterB should have only been incremented once.');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("once variant one", 3, function() {
|
||||||
|
var f = function(){ ok(true); };
|
||||||
|
|
||||||
|
var a = _.extend({}, Backbone.Events).once('event', f);
|
||||||
|
var b = _.extend({}, Backbone.Events).on('event', f);
|
||||||
|
|
||||||
|
a.trigger('event');
|
||||||
|
|
||||||
|
b.trigger('event');
|
||||||
|
b.trigger('event');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("once variant two", 3, function() {
|
||||||
|
var f = function(){ ok(true); };
|
||||||
|
var obj = _.extend({}, Backbone.Events);
|
||||||
|
|
||||||
|
obj
|
||||||
|
.once('event', f)
|
||||||
|
.on('event', f)
|
||||||
|
.trigger('event')
|
||||||
|
.trigger('event');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("once with off", 0, function() {
|
||||||
|
var f = function(){ ok(true); };
|
||||||
|
var obj = _.extend({}, Backbone.Events);
|
||||||
|
|
||||||
|
obj.once('event', f);
|
||||||
|
obj.off('event', f);
|
||||||
|
obj.trigger('event');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("once with event maps", function() {
|
||||||
|
var obj = { counter: 0 };
|
||||||
|
_.extend(obj, Backbone.Events);
|
||||||
|
|
||||||
|
var increment = function() {
|
||||||
|
this.counter += 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
obj.once({
|
||||||
|
a: increment,
|
||||||
|
b: increment,
|
||||||
|
c: increment
|
||||||
|
}, obj);
|
||||||
|
|
||||||
|
obj.trigger('a');
|
||||||
|
equal(obj.counter, 1);
|
||||||
|
|
||||||
|
obj.trigger('a b');
|
||||||
|
equal(obj.counter, 2);
|
||||||
|
|
||||||
|
obj.trigger('c');
|
||||||
|
equal(obj.counter, 3);
|
||||||
|
|
||||||
|
obj.trigger('a b c');
|
||||||
|
equal(obj.counter, 3);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("once with off only by context", 0, function() {
|
||||||
|
var context = {};
|
||||||
|
var obj = _.extend({}, Backbone.Events);
|
||||||
|
obj.once('event', function(){ ok(false); }, context);
|
||||||
|
obj.off(null, null, context);
|
||||||
|
obj.trigger('event');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Backbone object inherits Events", function() {
|
||||||
|
ok(Backbone.on === Backbone.Events.on);
|
||||||
|
});
|
||||||
|
|
||||||
|
asyncTest("once with asynchronous events", 1, function() {
|
||||||
|
var func = _.debounce(function() { ok(true); start(); }, 50);
|
||||||
|
var obj = _.extend({}, Backbone.Events).once('async', func);
|
||||||
|
|
||||||
|
obj.trigger('async');
|
||||||
|
obj.trigger('async');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("once with multiple events.", 2, function() {
|
||||||
|
var obj = _.extend({}, Backbone.Events);
|
||||||
|
obj.once('x y', function() { ok(true); });
|
||||||
|
obj.trigger('x y');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Off during iteration with once.", 2, function() {
|
||||||
|
var obj = _.extend({}, Backbone.Events);
|
||||||
|
var f = function(){ this.off('event', f); };
|
||||||
|
obj.on('event', f);
|
||||||
|
obj.once('event', function(){});
|
||||||
|
obj.on('event', function(){ ok(true); });
|
||||||
|
|
||||||
|
obj.trigger('event');
|
||||||
|
obj.trigger('event');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("`once` on `all` should work as expected", 1, function() {
|
||||||
|
Backbone.once('all', function() {
|
||||||
|
ok(true);
|
||||||
|
Backbone.trigger('all');
|
||||||
|
});
|
||||||
|
Backbone.trigger('all');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("once without a callback is a noop", 0, function() {
|
||||||
|
_.extend({}, Backbone.Events).once('event').trigger('event');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("event functions are chainable", function() {
|
||||||
|
var obj = _.extend({}, Backbone.Events);
|
||||||
|
var obj2 = _.extend({}, Backbone.Events);
|
||||||
|
var fn = function() {};
|
||||||
|
equal(obj, obj.trigger('noeventssetyet'));
|
||||||
|
equal(obj, obj.off('noeventssetyet'));
|
||||||
|
equal(obj, obj.stopListening('noeventssetyet'));
|
||||||
|
equal(obj, obj.on('a', fn));
|
||||||
|
equal(obj, obj.once('c', fn));
|
||||||
|
equal(obj, obj.trigger('a'));
|
||||||
|
equal(obj, obj.listenTo(obj2, 'a', fn));
|
||||||
|
equal(obj, obj.listenToOnce(obj2, 'b', fn));
|
||||||
|
equal(obj, obj.off('a c'));
|
||||||
|
equal(obj, obj.stopListening(obj2, 'a'));
|
||||||
|
equal(obj, obj.stopListening());
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
1102
vendor/backbone/test/model.js
vendored
Normal file
12
vendor/backbone/test/noconflict.js
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
$(document).ready(function() {
|
||||||
|
|
||||||
|
module("Backbone.noConflict");
|
||||||
|
|
||||||
|
test('noConflict', 2, function() {
|
||||||
|
var noconflictBackbone = Backbone.noConflict();
|
||||||
|
equal(window.Backbone, undefined, 'Returned window.Backbone');
|
||||||
|
window.Backbone = noconflictBackbone;
|
||||||
|
equal(window.Backbone, noconflictBackbone, 'Backbone is still pointing to the original Backbone');
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
612
vendor/backbone/test/router.js
vendored
Normal file
@@ -0,0 +1,612 @@
|
|||||||
|
$(document).ready(function() {
|
||||||
|
|
||||||
|
var router = null;
|
||||||
|
var location = null;
|
||||||
|
var lastRoute = null;
|
||||||
|
var lastArgs = [];
|
||||||
|
|
||||||
|
function onRoute(router, route, args) {
|
||||||
|
lastRoute = route;
|
||||||
|
lastArgs = args;
|
||||||
|
}
|
||||||
|
|
||||||
|
var Location = function(href) {
|
||||||
|
this.replace(href);
|
||||||
|
};
|
||||||
|
|
||||||
|
_.extend(Location.prototype, {
|
||||||
|
|
||||||
|
replace: function(href) {
|
||||||
|
_.extend(this, _.pick($('<a></a>', {href: href})[0],
|
||||||
|
'href',
|
||||||
|
'hash',
|
||||||
|
'host',
|
||||||
|
'search',
|
||||||
|
'fragment',
|
||||||
|
'pathname',
|
||||||
|
'protocol'
|
||||||
|
));
|
||||||
|
// In IE, anchor.pathname does not contain a leading slash though
|
||||||
|
// window.location.pathname does.
|
||||||
|
if (!/^\//.test(this.pathname)) this.pathname = '/' + this.pathname;
|
||||||
|
},
|
||||||
|
|
||||||
|
toString: function() {
|
||||||
|
return this.href;
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
module("Backbone.Router", {
|
||||||
|
|
||||||
|
setup: function() {
|
||||||
|
location = new Location('http://example.com');
|
||||||
|
Backbone.history = _.extend(new Backbone.History, {location: location});
|
||||||
|
router = new Router({testing: 101});
|
||||||
|
Backbone.history.interval = 9;
|
||||||
|
Backbone.history.start({pushState: false});
|
||||||
|
lastRoute = null;
|
||||||
|
lastArgs = [];
|
||||||
|
Backbone.history.on('route', onRoute);
|
||||||
|
},
|
||||||
|
|
||||||
|
teardown: function() {
|
||||||
|
Backbone.history.stop();
|
||||||
|
Backbone.history.off('route', onRoute);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
var ExternalObject = {
|
||||||
|
value: 'unset',
|
||||||
|
|
||||||
|
routingFunction: function(value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
_.bindAll(ExternalObject);
|
||||||
|
|
||||||
|
var Router = Backbone.Router.extend({
|
||||||
|
|
||||||
|
count: 0,
|
||||||
|
|
||||||
|
routes: {
|
||||||
|
"noCallback": "noCallback",
|
||||||
|
"counter": "counter",
|
||||||
|
"search/:query": "search",
|
||||||
|
"search/:query/p:page": "search",
|
||||||
|
"contacts": "contacts",
|
||||||
|
"contacts/new": "newContact",
|
||||||
|
"contacts/:id": "loadContact",
|
||||||
|
"route-event/:arg": "routeEvent",
|
||||||
|
"optional(/:item)": "optionalItem",
|
||||||
|
"named/optional/(y:z)": "namedOptional",
|
||||||
|
"splat/*args/end": "splat",
|
||||||
|
":repo/compare/*from...*to": "github",
|
||||||
|
"decode/:named/*splat": "decode",
|
||||||
|
"*first/complex-*part/*rest": "complex",
|
||||||
|
":entity?*args": "query",
|
||||||
|
"function/:value": ExternalObject.routingFunction,
|
||||||
|
"*anything": "anything"
|
||||||
|
},
|
||||||
|
|
||||||
|
initialize : function(options) {
|
||||||
|
this.testing = options.testing;
|
||||||
|
this.route('implicit', 'implicit');
|
||||||
|
},
|
||||||
|
|
||||||
|
counter: function() {
|
||||||
|
this.count++;
|
||||||
|
},
|
||||||
|
|
||||||
|
implicit: function() {
|
||||||
|
this.count++;
|
||||||
|
},
|
||||||
|
|
||||||
|
search : function(query, page) {
|
||||||
|
this.query = query;
|
||||||
|
this.page = page;
|
||||||
|
},
|
||||||
|
|
||||||
|
contacts: function(){
|
||||||
|
this.contact = 'index';
|
||||||
|
},
|
||||||
|
|
||||||
|
newContact: function(){
|
||||||
|
this.contact = 'new';
|
||||||
|
},
|
||||||
|
|
||||||
|
loadContact: function(){
|
||||||
|
this.contact = 'load';
|
||||||
|
},
|
||||||
|
|
||||||
|
optionalItem: function(arg){
|
||||||
|
this.arg = arg != void 0 ? arg : null;
|
||||||
|
},
|
||||||
|
|
||||||
|
splat: function(args) {
|
||||||
|
this.args = args;
|
||||||
|
},
|
||||||
|
|
||||||
|
github: function(repo, from, to) {
|
||||||
|
this.repo = repo;
|
||||||
|
this.from = from;
|
||||||
|
this.to = to;
|
||||||
|
},
|
||||||
|
|
||||||
|
complex: function(first, part, rest) {
|
||||||
|
this.first = first;
|
||||||
|
this.part = part;
|
||||||
|
this.rest = rest;
|
||||||
|
},
|
||||||
|
|
||||||
|
query: function(entity, args) {
|
||||||
|
this.entity = entity;
|
||||||
|
this.queryArgs = args;
|
||||||
|
},
|
||||||
|
|
||||||
|
anything: function(whatever) {
|
||||||
|
this.anything = whatever;
|
||||||
|
},
|
||||||
|
|
||||||
|
namedOptional: function(z) {
|
||||||
|
this.z = z;
|
||||||
|
},
|
||||||
|
|
||||||
|
decode: function(named, path) {
|
||||||
|
this.named = named;
|
||||||
|
this.path = path;
|
||||||
|
},
|
||||||
|
|
||||||
|
routeEvent: function(arg) {
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
test("initialize", 1, function() {
|
||||||
|
equal(router.testing, 101);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("routes (simple)", 4, function() {
|
||||||
|
location.replace('http://example.com#search/news');
|
||||||
|
Backbone.history.checkUrl();
|
||||||
|
equal(router.query, 'news');
|
||||||
|
equal(router.page, void 0);
|
||||||
|
equal(lastRoute, 'search');
|
||||||
|
equal(lastArgs[0], 'news');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("routes (simple, but unicode)", 4, function() {
|
||||||
|
location.replace('http://example.com#search/тест');
|
||||||
|
Backbone.history.checkUrl();
|
||||||
|
equal(router.query, "тест");
|
||||||
|
equal(router.page, void 0);
|
||||||
|
equal(lastRoute, 'search');
|
||||||
|
equal(lastArgs[0], "тест");
|
||||||
|
});
|
||||||
|
|
||||||
|
test("routes (two part)", 2, function() {
|
||||||
|
location.replace('http://example.com#search/nyc/p10');
|
||||||
|
Backbone.history.checkUrl();
|
||||||
|
equal(router.query, 'nyc');
|
||||||
|
equal(router.page, '10');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("routes via navigate", 2, function() {
|
||||||
|
Backbone.history.navigate('search/manhattan/p20', {trigger: true});
|
||||||
|
equal(router.query, 'manhattan');
|
||||||
|
equal(router.page, '20');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("routes via navigate for backwards-compatibility", 2, function() {
|
||||||
|
Backbone.history.navigate('search/manhattan/p20', true);
|
||||||
|
equal(router.query, 'manhattan');
|
||||||
|
equal(router.page, '20');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("route precedence via navigate", 6, function(){
|
||||||
|
// check both 0.9.x and backwards-compatibility options
|
||||||
|
_.each([ { trigger: true }, true ], function( options ){
|
||||||
|
Backbone.history.navigate('contacts', options);
|
||||||
|
equal(router.contact, 'index');
|
||||||
|
Backbone.history.navigate('contacts/new', options);
|
||||||
|
equal(router.contact, 'new');
|
||||||
|
Backbone.history.navigate('contacts/foo', options);
|
||||||
|
equal(router.contact, 'load');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test("loadUrl is not called for identical routes.", 0, function() {
|
||||||
|
Backbone.history.loadUrl = function(){ ok(false); };
|
||||||
|
location.replace('http://example.com#route');
|
||||||
|
Backbone.history.navigate('route');
|
||||||
|
Backbone.history.navigate('/route');
|
||||||
|
Backbone.history.navigate('/route');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("use implicit callback if none provided", 1, function() {
|
||||||
|
router.count = 0;
|
||||||
|
router.navigate('implicit', {trigger: true});
|
||||||
|
equal(router.count, 1);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("routes via navigate with {replace: true}", 1, function() {
|
||||||
|
location.replace('http://example.com#start_here');
|
||||||
|
Backbone.history.checkUrl();
|
||||||
|
location.replace = function(href) {
|
||||||
|
strictEqual(href, new Location('http://example.com#end_here').href);
|
||||||
|
};
|
||||||
|
Backbone.history.navigate('end_here', {replace: true});
|
||||||
|
});
|
||||||
|
|
||||||
|
test("routes (splats)", 1, function() {
|
||||||
|
location.replace('http://example.com#splat/long-list/of/splatted_99args/end');
|
||||||
|
Backbone.history.checkUrl();
|
||||||
|
equal(router.args, 'long-list/of/splatted_99args');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("routes (github)", 3, function() {
|
||||||
|
location.replace('http://example.com#backbone/compare/1.0...braddunbar:with/slash');
|
||||||
|
Backbone.history.checkUrl();
|
||||||
|
equal(router.repo, 'backbone');
|
||||||
|
equal(router.from, '1.0');
|
||||||
|
equal(router.to, 'braddunbar:with/slash');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("routes (optional)", 2, function() {
|
||||||
|
location.replace('http://example.com#optional');
|
||||||
|
Backbone.history.checkUrl();
|
||||||
|
ok(!router.arg);
|
||||||
|
location.replace('http://example.com#optional/thing');
|
||||||
|
Backbone.history.checkUrl();
|
||||||
|
equal(router.arg, 'thing');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("routes (complex)", 3, function() {
|
||||||
|
location.replace('http://example.com#one/two/three/complex-part/four/five/six/seven');
|
||||||
|
Backbone.history.checkUrl();
|
||||||
|
equal(router.first, 'one/two/three');
|
||||||
|
equal(router.part, 'part');
|
||||||
|
equal(router.rest, 'four/five/six/seven');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("routes (query)", 5, function() {
|
||||||
|
location.replace('http://example.com#mandel?a=b&c=d');
|
||||||
|
Backbone.history.checkUrl();
|
||||||
|
equal(router.entity, 'mandel');
|
||||||
|
equal(router.queryArgs, 'a=b&c=d');
|
||||||
|
equal(lastRoute, 'query');
|
||||||
|
equal(lastArgs[0], 'mandel');
|
||||||
|
equal(lastArgs[1], 'a=b&c=d');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("routes (anything)", 1, function() {
|
||||||
|
location.replace('http://example.com#doesnt-match-a-route');
|
||||||
|
Backbone.history.checkUrl();
|
||||||
|
equal(router.anything, 'doesnt-match-a-route');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("routes (function)", 3, function() {
|
||||||
|
router.on('route', function(name) {
|
||||||
|
ok(name === '');
|
||||||
|
});
|
||||||
|
equal(ExternalObject.value, 'unset');
|
||||||
|
location.replace('http://example.com#function/set');
|
||||||
|
Backbone.history.checkUrl();
|
||||||
|
equal(ExternalObject.value, 'set');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Decode named parameters, not splats.", 2, function() {
|
||||||
|
location.replace('http://example.com#decode/a%2Fb/c%2Fd/e');
|
||||||
|
Backbone.history.checkUrl();
|
||||||
|
strictEqual(router.named, 'a/b');
|
||||||
|
strictEqual(router.path, 'c/d/e');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("fires event when router doesn't have callback on it", 1, function() {
|
||||||
|
router.on("route:noCallback", function(){ ok(true); });
|
||||||
|
location.replace('http://example.com#noCallback');
|
||||||
|
Backbone.history.checkUrl();
|
||||||
|
});
|
||||||
|
|
||||||
|
test("#933, #908 - leading slash", 2, function() {
|
||||||
|
location.replace('http://example.com/root/foo');
|
||||||
|
|
||||||
|
Backbone.history.stop();
|
||||||
|
Backbone.history = _.extend(new Backbone.History, {location: location});
|
||||||
|
Backbone.history.start({root: '/root', hashChange: false, silent: true});
|
||||||
|
strictEqual(Backbone.history.getFragment(), 'foo');
|
||||||
|
|
||||||
|
Backbone.history.stop();
|
||||||
|
Backbone.history = _.extend(new Backbone.History, {location: location});
|
||||||
|
Backbone.history.start({root: '/root/', hashChange: false, silent: true});
|
||||||
|
strictEqual(Backbone.history.getFragment(), 'foo');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("#1003 - History is started before navigate is called", 1, function() {
|
||||||
|
Backbone.history.stop();
|
||||||
|
Backbone.history.navigate = function(){ ok(Backbone.History.started); };
|
||||||
|
Backbone.history.start();
|
||||||
|
// If this is not an old IE navigate will not be called.
|
||||||
|
if (!Backbone.history.iframe) ok(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("#967 - Route callback gets passed encoded values.", 3, function() {
|
||||||
|
var route = 'has%2Fslash/complex-has%23hash/has%20space';
|
||||||
|
Backbone.history.navigate(route, {trigger: true});
|
||||||
|
strictEqual(router.first, 'has/slash');
|
||||||
|
strictEqual(router.part, 'has#hash');
|
||||||
|
strictEqual(router.rest, 'has space');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("correctly handles URLs with % (#868)", 3, function() {
|
||||||
|
location.replace('http://example.com#search/fat%3A1.5%25');
|
||||||
|
Backbone.history.checkUrl();
|
||||||
|
location.replace('http://example.com#search/fat');
|
||||||
|
Backbone.history.checkUrl();
|
||||||
|
equal(router.query, 'fat');
|
||||||
|
equal(router.page, void 0);
|
||||||
|
equal(lastRoute, 'search');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("#1185 - Use pathname when hashChange is not wanted.", 1, function() {
|
||||||
|
Backbone.history.stop();
|
||||||
|
location.replace('http://example.com/path/name#hash');
|
||||||
|
Backbone.history = _.extend(new Backbone.History, {location: location});
|
||||||
|
Backbone.history.start({hashChange: false});
|
||||||
|
var fragment = Backbone.history.getFragment();
|
||||||
|
strictEqual(fragment, location.pathname.replace(/^\//, ''));
|
||||||
|
});
|
||||||
|
|
||||||
|
test("#1206 - Strip leading slash before location.assign.", 1, function() {
|
||||||
|
Backbone.history.stop();
|
||||||
|
location.replace('http://example.com/root/');
|
||||||
|
Backbone.history = _.extend(new Backbone.History, {location: location});
|
||||||
|
Backbone.history.start({hashChange: false, root: '/root/'});
|
||||||
|
location.assign = function(pathname) {
|
||||||
|
strictEqual(pathname, '/root/fragment');
|
||||||
|
};
|
||||||
|
Backbone.history.navigate('/fragment');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("#1387 - Root fragment without trailing slash.", 1, function() {
|
||||||
|
Backbone.history.stop();
|
||||||
|
location.replace('http://example.com/root');
|
||||||
|
Backbone.history = _.extend(new Backbone.History, {location: location});
|
||||||
|
Backbone.history.start({hashChange: false, root: '/root/', silent: true});
|
||||||
|
strictEqual(Backbone.history.getFragment(), '');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("#1366 - History does not prepend root to fragment.", 2, function() {
|
||||||
|
Backbone.history.stop();
|
||||||
|
location.replace('http://example.com/root/');
|
||||||
|
Backbone.history = _.extend(new Backbone.History, {
|
||||||
|
location: location,
|
||||||
|
history: {
|
||||||
|
pushState: function(state, title, url) {
|
||||||
|
strictEqual(url, '/root/x');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Backbone.history.start({
|
||||||
|
root: '/root/',
|
||||||
|
pushState: true,
|
||||||
|
hashChange: false
|
||||||
|
});
|
||||||
|
Backbone.history.navigate('x');
|
||||||
|
strictEqual(Backbone.history.fragment, 'x');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Normalize root.", 1, function() {
|
||||||
|
Backbone.history.stop();
|
||||||
|
location.replace('http://example.com/root');
|
||||||
|
Backbone.history = _.extend(new Backbone.History, {
|
||||||
|
location: location,
|
||||||
|
history: {
|
||||||
|
pushState: function(state, title, url) {
|
||||||
|
strictEqual(url, '/root/fragment');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Backbone.history.start({
|
||||||
|
pushState: true,
|
||||||
|
root: '/root',
|
||||||
|
hashChange: false
|
||||||
|
});
|
||||||
|
Backbone.history.navigate('fragment');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Normalize root.", 1, function() {
|
||||||
|
Backbone.history.stop();
|
||||||
|
location.replace('http://example.com/root#fragment');
|
||||||
|
Backbone.history = _.extend(new Backbone.History, {
|
||||||
|
location: location,
|
||||||
|
history: {
|
||||||
|
pushState: function(state, title, url) {},
|
||||||
|
replaceState: function(state, title, url) {
|
||||||
|
strictEqual(url, '/root/fragment');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Backbone.history.start({
|
||||||
|
pushState: true,
|
||||||
|
root: '/root'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Normalize root.", 1, function() {
|
||||||
|
Backbone.history.stop();
|
||||||
|
location.replace('http://example.com/root');
|
||||||
|
Backbone.history = _.extend(new Backbone.History, {location: location});
|
||||||
|
Backbone.history.loadUrl = function() { ok(true); };
|
||||||
|
Backbone.history.start({
|
||||||
|
pushState: true,
|
||||||
|
root: '/root'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Normalize root - leading slash.", 1, function() {
|
||||||
|
Backbone.history.stop();
|
||||||
|
location.replace('http://example.com/root');
|
||||||
|
Backbone.history = _.extend(new Backbone.History, {
|
||||||
|
location: location,
|
||||||
|
history: {
|
||||||
|
pushState: function(){},
|
||||||
|
replaceState: function(){}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Backbone.history.start({root: 'root'});
|
||||||
|
strictEqual(Backbone.history.root, '/root/');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Transition from hashChange to pushState.", 1, function() {
|
||||||
|
Backbone.history.stop();
|
||||||
|
location.replace('http://example.com/root#x/y');
|
||||||
|
Backbone.history = _.extend(new Backbone.History, {
|
||||||
|
location: location,
|
||||||
|
history: {
|
||||||
|
pushState: function(){},
|
||||||
|
replaceState: function(state, title, url){
|
||||||
|
strictEqual(url, '/root/x/y');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Backbone.history.start({
|
||||||
|
root: 'root',
|
||||||
|
pushState: true
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test("#1619: Router: Normalize empty root", 1, function() {
|
||||||
|
Backbone.history.stop();
|
||||||
|
location.replace('http://example.com/');
|
||||||
|
Backbone.history = _.extend(new Backbone.History, {
|
||||||
|
location: location,
|
||||||
|
history: {
|
||||||
|
pushState: function(){},
|
||||||
|
replaceState: function(){}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Backbone.history.start({root: ''});
|
||||||
|
strictEqual(Backbone.history.root, '/');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("#1619: Router: nagivate with empty root", 1, function() {
|
||||||
|
Backbone.history.stop();
|
||||||
|
location.replace('http://example.com/');
|
||||||
|
Backbone.history = _.extend(new Backbone.History, {
|
||||||
|
location: location,
|
||||||
|
history: {
|
||||||
|
pushState: function(state, title, url) {
|
||||||
|
strictEqual(url, '/fragment');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Backbone.history.start({
|
||||||
|
pushState: true,
|
||||||
|
root: '',
|
||||||
|
hashChange: false
|
||||||
|
});
|
||||||
|
Backbone.history.navigate('fragment');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Transition from pushState to hashChange.", 1, function() {
|
||||||
|
Backbone.history.stop();
|
||||||
|
location.replace('http://example.com/root/x/y?a=b');
|
||||||
|
location.replace = function(url) {
|
||||||
|
strictEqual(url, '/root/?a=b#x/y');
|
||||||
|
};
|
||||||
|
Backbone.history = _.extend(new Backbone.History, {
|
||||||
|
location: location,
|
||||||
|
history: {
|
||||||
|
pushState: null,
|
||||||
|
replaceState: null
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Backbone.history.start({
|
||||||
|
root: 'root',
|
||||||
|
pushState: true
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test("#1695 - hashChange to pushState with search.", 1, function() {
|
||||||
|
Backbone.history.stop();
|
||||||
|
location.replace('http://example.com/root?a=b#x/y');
|
||||||
|
Backbone.history = _.extend(new Backbone.History, {
|
||||||
|
location: location,
|
||||||
|
history: {
|
||||||
|
pushState: function(){},
|
||||||
|
replaceState: function(state, title, url){
|
||||||
|
strictEqual(url, '/root/x/y?a=b');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Backbone.history.start({
|
||||||
|
root: 'root',
|
||||||
|
pushState: true
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test("#1746 - Router allows empty route.", 1, function() {
|
||||||
|
var Router = Backbone.Router.extend({
|
||||||
|
routes: {'': 'empty'},
|
||||||
|
empty: function(){},
|
||||||
|
route: function(route){
|
||||||
|
strictEqual(route, '');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
new Router;
|
||||||
|
});
|
||||||
|
|
||||||
|
test("#1794 - Trailing space in fragments.", 1, function() {
|
||||||
|
var history = new Backbone.History;
|
||||||
|
strictEqual(history.getFragment('fragment '), 'fragment');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("#1820 - Leading slash and trailing space.", 1, function() {
|
||||||
|
var history = new Backbone.History;
|
||||||
|
strictEqual(history.getFragment('/fragment '), 'fragment');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("#1980 - Optional parameters.", 2, function() {
|
||||||
|
location.replace('http://example.com#named/optional/y');
|
||||||
|
Backbone.history.checkUrl();
|
||||||
|
strictEqual(router.z, undefined);
|
||||||
|
location.replace('http://example.com#named/optional/y123');
|
||||||
|
Backbone.history.checkUrl();
|
||||||
|
strictEqual(router.z, '123');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("#2062 - Trigger 'route' event on router instance.", 2, function() {
|
||||||
|
router.on('route', function(name, args) {
|
||||||
|
strictEqual(name, 'routeEvent');
|
||||||
|
deepEqual(args, ['x']);
|
||||||
|
});
|
||||||
|
location.replace('http://example.com#route-event/x');
|
||||||
|
Backbone.history.checkUrl();
|
||||||
|
});
|
||||||
|
|
||||||
|
test("#2255 - Extend routes by making routes a function.", 1, function() {
|
||||||
|
var RouterBase = Backbone.Router.extend({
|
||||||
|
routes: function() {
|
||||||
|
return {
|
||||||
|
home: "root",
|
||||||
|
index: "index.html"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var RouterExtended = RouterBase.extend({
|
||||||
|
routes: function() {
|
||||||
|
var _super = RouterExtended.__super__.routes;
|
||||||
|
return _.extend(_super(),
|
||||||
|
{ show: "show",
|
||||||
|
search: "search" });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var router = new RouterExtended();
|
||||||
|
deepEqual({home: "root", index: "index.html", show: "show", search: "search"}, router.routes);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
212
vendor/backbone/test/sync.js
vendored
Normal file
@@ -0,0 +1,212 @@
|
|||||||
|
$(document).ready(function() {
|
||||||
|
|
||||||
|
var Library = Backbone.Collection.extend({
|
||||||
|
url : function() { return '/library'; }
|
||||||
|
});
|
||||||
|
var library;
|
||||||
|
|
||||||
|
var attrs = {
|
||||||
|
title : "The Tempest",
|
||||||
|
author : "Bill Shakespeare",
|
||||||
|
length : 123
|
||||||
|
};
|
||||||
|
|
||||||
|
module("Backbone.sync", _.extend(new Environment, {
|
||||||
|
|
||||||
|
setup : function() {
|
||||||
|
Environment.prototype.setup.apply(this, arguments);
|
||||||
|
library = new Library;
|
||||||
|
library.create(attrs, {wait: false});
|
||||||
|
},
|
||||||
|
|
||||||
|
teardown: function() {
|
||||||
|
Environment.prototype.teardown.apply(this, arguments);
|
||||||
|
Backbone.emulateHTTP = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}));
|
||||||
|
|
||||||
|
test("read", 4, function() {
|
||||||
|
library.fetch();
|
||||||
|
equal(this.ajaxSettings.url, '/library');
|
||||||
|
equal(this.ajaxSettings.type, 'GET');
|
||||||
|
equal(this.ajaxSettings.dataType, 'json');
|
||||||
|
ok(_.isEmpty(this.ajaxSettings.data));
|
||||||
|
});
|
||||||
|
|
||||||
|
test("passing data", 3, function() {
|
||||||
|
library.fetch({data: {a: 'a', one: 1}});
|
||||||
|
equal(this.ajaxSettings.url, '/library');
|
||||||
|
equal(this.ajaxSettings.data.a, 'a');
|
||||||
|
equal(this.ajaxSettings.data.one, 1);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("create", 6, function() {
|
||||||
|
equal(this.ajaxSettings.url, '/library');
|
||||||
|
equal(this.ajaxSettings.type, 'POST');
|
||||||
|
equal(this.ajaxSettings.dataType, 'json');
|
||||||
|
var data = JSON.parse(this.ajaxSettings.data);
|
||||||
|
equal(data.title, 'The Tempest');
|
||||||
|
equal(data.author, 'Bill Shakespeare');
|
||||||
|
equal(data.length, 123);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("update", 7, function() {
|
||||||
|
library.first().save({id: '1-the-tempest', author: 'William Shakespeare'});
|
||||||
|
equal(this.ajaxSettings.url, '/library/1-the-tempest');
|
||||||
|
equal(this.ajaxSettings.type, 'PUT');
|
||||||
|
equal(this.ajaxSettings.dataType, 'json');
|
||||||
|
var data = JSON.parse(this.ajaxSettings.data);
|
||||||
|
equal(data.id, '1-the-tempest');
|
||||||
|
equal(data.title, 'The Tempest');
|
||||||
|
equal(data.author, 'William Shakespeare');
|
||||||
|
equal(data.length, 123);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("update with emulateHTTP and emulateJSON", 7, function() {
|
||||||
|
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'}, {
|
||||||
|
emulateHTTP: true,
|
||||||
|
emulateJSON: true
|
||||||
|
});
|
||||||
|
equal(this.ajaxSettings.url, '/library/2-the-tempest');
|
||||||
|
equal(this.ajaxSettings.type, 'POST');
|
||||||
|
equal(this.ajaxSettings.dataType, 'json');
|
||||||
|
equal(this.ajaxSettings.data._method, 'PUT');
|
||||||
|
var data = JSON.parse(this.ajaxSettings.data.model);
|
||||||
|
equal(data.id, '2-the-tempest');
|
||||||
|
equal(data.author, 'Tim Shakespeare');
|
||||||
|
equal(data.length, 123);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("update with just emulateHTTP", 6, function() {
|
||||||
|
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'}, {
|
||||||
|
emulateHTTP: true
|
||||||
|
});
|
||||||
|
equal(this.ajaxSettings.url, '/library/2-the-tempest');
|
||||||
|
equal(this.ajaxSettings.type, 'POST');
|
||||||
|
equal(this.ajaxSettings.contentType, 'application/json');
|
||||||
|
var data = JSON.parse(this.ajaxSettings.data);
|
||||||
|
equal(data.id, '2-the-tempest');
|
||||||
|
equal(data.author, 'Tim Shakespeare');
|
||||||
|
equal(data.length, 123);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("update with just emulateJSON", 6, function() {
|
||||||
|
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'}, {
|
||||||
|
emulateJSON: true
|
||||||
|
});
|
||||||
|
equal(this.ajaxSettings.url, '/library/2-the-tempest');
|
||||||
|
equal(this.ajaxSettings.type, 'PUT');
|
||||||
|
equal(this.ajaxSettings.contentType, 'application/x-www-form-urlencoded');
|
||||||
|
var data = JSON.parse(this.ajaxSettings.data.model);
|
||||||
|
equal(data.id, '2-the-tempest');
|
||||||
|
equal(data.author, 'Tim Shakespeare');
|
||||||
|
equal(data.length, 123);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("read model", 3, function() {
|
||||||
|
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'});
|
||||||
|
library.first().fetch();
|
||||||
|
equal(this.ajaxSettings.url, '/library/2-the-tempest');
|
||||||
|
equal(this.ajaxSettings.type, 'GET');
|
||||||
|
ok(_.isEmpty(this.ajaxSettings.data));
|
||||||
|
});
|
||||||
|
|
||||||
|
test("destroy", 3, function() {
|
||||||
|
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'});
|
||||||
|
library.first().destroy({wait: true});
|
||||||
|
equal(this.ajaxSettings.url, '/library/2-the-tempest');
|
||||||
|
equal(this.ajaxSettings.type, 'DELETE');
|
||||||
|
equal(this.ajaxSettings.data, null);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("destroy with emulateHTTP", 3, function() {
|
||||||
|
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'});
|
||||||
|
library.first().destroy({
|
||||||
|
emulateHTTP: true,
|
||||||
|
emulateJSON: true
|
||||||
|
});
|
||||||
|
equal(this.ajaxSettings.url, '/library/2-the-tempest');
|
||||||
|
equal(this.ajaxSettings.type, 'POST');
|
||||||
|
equal(JSON.stringify(this.ajaxSettings.data), '{"_method":"DELETE"}');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("urlError", 2, function() {
|
||||||
|
var model = new Backbone.Model();
|
||||||
|
raises(function() {
|
||||||
|
model.fetch();
|
||||||
|
});
|
||||||
|
model.fetch({url: '/one/two'});
|
||||||
|
equal(this.ajaxSettings.url, '/one/two');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("#1052 - `options` is optional.", 0, function() {
|
||||||
|
var model = new Backbone.Model();
|
||||||
|
model.url = '/test';
|
||||||
|
Backbone.sync('create', model);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Backbone.ajax", 1, function() {
|
||||||
|
Backbone.ajax = function(settings){
|
||||||
|
strictEqual(settings.url, '/test');
|
||||||
|
};
|
||||||
|
var model = new Backbone.Model();
|
||||||
|
model.url = '/test';
|
||||||
|
Backbone.sync('create', model);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Call provided error callback on error.", 1, function() {
|
||||||
|
var model = new Backbone.Model;
|
||||||
|
model.url = '/test';
|
||||||
|
Backbone.sync('read', model, {
|
||||||
|
error: function() { ok(true); }
|
||||||
|
});
|
||||||
|
this.ajaxSettings.error();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Use Backbone.emulateHTTP as default.', 2, function() {
|
||||||
|
var model = new Backbone.Model;
|
||||||
|
model.url = '/test';
|
||||||
|
|
||||||
|
Backbone.emulateHTTP = true;
|
||||||
|
model.sync('create', model);
|
||||||
|
strictEqual(this.ajaxSettings.emulateHTTP, true);
|
||||||
|
|
||||||
|
Backbone.emulateHTTP = false;
|
||||||
|
model.sync('create', model);
|
||||||
|
strictEqual(this.ajaxSettings.emulateHTTP, false);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Use Backbone.emulateJSON as default.', 2, function() {
|
||||||
|
var model = new Backbone.Model;
|
||||||
|
model.url = '/test';
|
||||||
|
|
||||||
|
Backbone.emulateJSON = true;
|
||||||
|
model.sync('create', model);
|
||||||
|
strictEqual(this.ajaxSettings.emulateJSON, true);
|
||||||
|
|
||||||
|
Backbone.emulateJSON = false;
|
||||||
|
model.sync('create', model);
|
||||||
|
strictEqual(this.ajaxSettings.emulateJSON, false);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("#1756 - Call user provided beforeSend function.", 4, function() {
|
||||||
|
Backbone.emulateHTTP = true;
|
||||||
|
var model = new Backbone.Model;
|
||||||
|
model.url = '/test';
|
||||||
|
var xhr = {
|
||||||
|
setRequestHeader: function(header, value) {
|
||||||
|
strictEqual(header, 'X-HTTP-Method-Override');
|
||||||
|
strictEqual(value, 'DELETE');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
model.sync('delete', model, {
|
||||||
|
beforeSend: function(_xhr) {
|
||||||
|
ok(_xhr === xhr);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
strictEqual(this.ajaxSettings.beforeSend(xhr), false);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
357
vendor/backbone/test/view.js
vendored
Normal file
@@ -0,0 +1,357 @@
|
|||||||
|
$(document).ready(function() {
|
||||||
|
|
||||||
|
var view;
|
||||||
|
|
||||||
|
module("Backbone.View", {
|
||||||
|
|
||||||
|
setup: function() {
|
||||||
|
view = new Backbone.View({
|
||||||
|
id : 'test-view',
|
||||||
|
className : 'test-view',
|
||||||
|
other : 'non-special-option'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
test("constructor", 6, function() {
|
||||||
|
equal(view.el.id, 'test-view');
|
||||||
|
equal(view.el.className, 'test-view');
|
||||||
|
equal(view.el.other, void 0);
|
||||||
|
equal(view.options.id, 'test-view');
|
||||||
|
equal(view.options.className, 'test-view');
|
||||||
|
equal(view.options.other, 'non-special-option');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("jQuery", 1, function() {
|
||||||
|
var view = new Backbone.View;
|
||||||
|
view.setElement('<p><a><b>test</b></a></p>');
|
||||||
|
strictEqual(view.$('a b').html(), 'test');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("initialize", 1, function() {
|
||||||
|
var View = Backbone.View.extend({
|
||||||
|
initialize: function() {
|
||||||
|
this.one = 1;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
strictEqual(new View().one, 1);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("delegateEvents", 6, function() {
|
||||||
|
var counter1 = 0, counter2 = 0;
|
||||||
|
|
||||||
|
var view = new Backbone.View({el: '<p><a id="test"></a></p>'});
|
||||||
|
view.increment = function(){ counter1++; };
|
||||||
|
view.$el.on('click', function(){ counter2++; });
|
||||||
|
|
||||||
|
var events = {'click #test': 'increment'};
|
||||||
|
|
||||||
|
view.delegateEvents(events);
|
||||||
|
view.$('#test').trigger('click');
|
||||||
|
equal(counter1, 1);
|
||||||
|
equal(counter2, 1);
|
||||||
|
|
||||||
|
view.$('#test').trigger('click');
|
||||||
|
equal(counter1, 2);
|
||||||
|
equal(counter2, 2);
|
||||||
|
|
||||||
|
view.delegateEvents(events);
|
||||||
|
view.$('#test').trigger('click');
|
||||||
|
equal(counter1, 3);
|
||||||
|
equal(counter2, 3);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("delegateEvents allows functions for callbacks", 3, function() {
|
||||||
|
var view = new Backbone.View({el: '<p></p>'});
|
||||||
|
view.counter = 0;
|
||||||
|
|
||||||
|
var events = {
|
||||||
|
click: function() {
|
||||||
|
this.counter++;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
view.delegateEvents(events);
|
||||||
|
view.$el.trigger('click');
|
||||||
|
equal(view.counter, 1);
|
||||||
|
|
||||||
|
view.$el.trigger('click');
|
||||||
|
equal(view.counter, 2);
|
||||||
|
|
||||||
|
view.delegateEvents(events);
|
||||||
|
view.$el.trigger('click');
|
||||||
|
equal(view.counter, 3);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
test("delegateEvents ignore undefined methods", 0, function() {
|
||||||
|
var view = new Backbone.View({el: '<p></p>'});
|
||||||
|
view.delegateEvents({'click': 'undefinedMethod'});
|
||||||
|
view.$el.trigger('click');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("undelegateEvents", 6, function() {
|
||||||
|
var counter1 = 0, counter2 = 0;
|
||||||
|
|
||||||
|
var view = new Backbone.View({el: '<p><a id="test"></a></p>'});
|
||||||
|
view.increment = function(){ counter1++; };
|
||||||
|
view.$el.on('click', function(){ counter2++; });
|
||||||
|
|
||||||
|
var events = {'click #test': 'increment'};
|
||||||
|
|
||||||
|
view.delegateEvents(events);
|
||||||
|
view.$('#test').trigger('click');
|
||||||
|
equal(counter1, 1);
|
||||||
|
equal(counter2, 1);
|
||||||
|
|
||||||
|
view.undelegateEvents();
|
||||||
|
view.$('#test').trigger('click');
|
||||||
|
equal(counter1, 1);
|
||||||
|
equal(counter2, 2);
|
||||||
|
|
||||||
|
view.delegateEvents(events);
|
||||||
|
view.$('#test').trigger('click');
|
||||||
|
equal(counter1, 2);
|
||||||
|
equal(counter2, 3);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("_ensureElement with DOM node el", 1, function() {
|
||||||
|
var View = Backbone.View.extend({
|
||||||
|
el: document.body
|
||||||
|
});
|
||||||
|
|
||||||
|
equal(new View().el, document.body);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("_ensureElement with string el", 3, function() {
|
||||||
|
var View = Backbone.View.extend({
|
||||||
|
el: "body"
|
||||||
|
});
|
||||||
|
strictEqual(new View().el, document.body);
|
||||||
|
|
||||||
|
View = Backbone.View.extend({
|
||||||
|
el: "#testElement > h1"
|
||||||
|
});
|
||||||
|
strictEqual(new View().el, $("#testElement > h1").get(0));
|
||||||
|
|
||||||
|
View = Backbone.View.extend({
|
||||||
|
el: "#nonexistent"
|
||||||
|
});
|
||||||
|
ok(!new View().el);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("with className and id functions", 2, function() {
|
||||||
|
var View = Backbone.View.extend({
|
||||||
|
className: function() {
|
||||||
|
return 'className';
|
||||||
|
},
|
||||||
|
id: function() {
|
||||||
|
return 'id';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
strictEqual(new View().el.className, 'className');
|
||||||
|
strictEqual(new View().el.id, 'id');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("with options function", 3, function() {
|
||||||
|
var View1 = Backbone.View.extend({
|
||||||
|
options: function() {
|
||||||
|
return {
|
||||||
|
title: 'title1',
|
||||||
|
acceptText: 'confirm'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var View2 = View1.extend({
|
||||||
|
options: function() {
|
||||||
|
return _.extend(View1.prototype.options.call(this), {
|
||||||
|
title: 'title2',
|
||||||
|
fixed: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
strictEqual(new View2().options.title, 'title2');
|
||||||
|
strictEqual(new View2().options.acceptText, 'confirm');
|
||||||
|
strictEqual(new View2().options.fixed, true);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("with attributes", 2, function() {
|
||||||
|
var View = Backbone.View.extend({
|
||||||
|
attributes: {
|
||||||
|
id: 'id',
|
||||||
|
'class': 'class'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
strictEqual(new View().el.className, 'class');
|
||||||
|
strictEqual(new View().el.id, 'id');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("with attributes as a function", 1, function() {
|
||||||
|
var View = Backbone.View.extend({
|
||||||
|
attributes: function() {
|
||||||
|
return {'class': 'dynamic'};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
strictEqual(new View().el.className, 'dynamic');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("multiple views per element", 3, function() {
|
||||||
|
var count = 0;
|
||||||
|
var $el = $('<p></p>');
|
||||||
|
|
||||||
|
var View = Backbone.View.extend({
|
||||||
|
el: $el,
|
||||||
|
events: {
|
||||||
|
click: function() {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var view1 = new View;
|
||||||
|
$el.trigger("click");
|
||||||
|
equal(1, count);
|
||||||
|
|
||||||
|
var view2 = new View;
|
||||||
|
$el.trigger("click");
|
||||||
|
equal(3, count);
|
||||||
|
|
||||||
|
view1.delegateEvents();
|
||||||
|
$el.trigger("click");
|
||||||
|
equal(5, count);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("custom events, with namespaces", 2, function() {
|
||||||
|
var count = 0;
|
||||||
|
|
||||||
|
var View = Backbone.View.extend({
|
||||||
|
el: $('body'),
|
||||||
|
events: function() {
|
||||||
|
return {"fake$event.namespaced": "run"};
|
||||||
|
},
|
||||||
|
run: function() {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var view = new View;
|
||||||
|
$('body').trigger('fake$event').trigger('fake$event');
|
||||||
|
equal(count, 2);
|
||||||
|
|
||||||
|
$('body').unbind('.namespaced');
|
||||||
|
$('body').trigger('fake$event');
|
||||||
|
equal(count, 2);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("#1048 - setElement uses provided object.", 2, function() {
|
||||||
|
var $el = $('body');
|
||||||
|
|
||||||
|
var view = new Backbone.View({el: $el});
|
||||||
|
ok(view.$el === $el);
|
||||||
|
|
||||||
|
view.setElement($el = $($el));
|
||||||
|
ok(view.$el === $el);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("#986 - Undelegate before changing element.", 1, function() {
|
||||||
|
var button1 = $('<button></button>');
|
||||||
|
var button2 = $('<button></button>');
|
||||||
|
|
||||||
|
var View = Backbone.View.extend({
|
||||||
|
events: {
|
||||||
|
click: function(e) {
|
||||||
|
ok(view.el === e.target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var view = new View({el: button1});
|
||||||
|
view.setElement(button2);
|
||||||
|
|
||||||
|
button1.trigger('click');
|
||||||
|
button2.trigger('click');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("#1172 - Clone attributes object", 2, function() {
|
||||||
|
var View = Backbone.View.extend({
|
||||||
|
attributes: {foo: 'bar'}
|
||||||
|
});
|
||||||
|
|
||||||
|
var view1 = new View({id: 'foo'});
|
||||||
|
strictEqual(view1.el.id, 'foo');
|
||||||
|
|
||||||
|
var view2 = new View();
|
||||||
|
ok(!view2.el.id);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("#1228 - tagName can be provided as a function", 1, function() {
|
||||||
|
var View = Backbone.View.extend({
|
||||||
|
tagName: function() {
|
||||||
|
return 'p';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
ok(new View().$el.is('p'));
|
||||||
|
});
|
||||||
|
|
||||||
|
test("views stopListening", 0, function() {
|
||||||
|
var View = Backbone.View.extend({
|
||||||
|
initialize: function() {
|
||||||
|
this.listenTo(this.model, 'all x', function(){ ok(false); }, this);
|
||||||
|
this.listenTo(this.collection, 'all x', function(){ ok(false); }, this);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var view = new View({
|
||||||
|
model: new Backbone.Model,
|
||||||
|
collection: new Backbone.Collection
|
||||||
|
});
|
||||||
|
|
||||||
|
view.stopListening();
|
||||||
|
view.model.trigger('x');
|
||||||
|
view.collection.trigger('x');
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Provide function for el.", 1, function() {
|
||||||
|
var View = Backbone.View.extend({
|
||||||
|
el: function() {
|
||||||
|
return "<p><a></a></p>";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var view = new View;
|
||||||
|
ok(view.$el.is('p:has(a)'));
|
||||||
|
});
|
||||||
|
|
||||||
|
test("events passed in options", 2, function() {
|
||||||
|
var counter = 0;
|
||||||
|
|
||||||
|
var View = Backbone.View.extend({
|
||||||
|
el: '<p><a id="test"></a></p>',
|
||||||
|
increment: function() {
|
||||||
|
counter++;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var view = new View({events:{'click #test':'increment'}});
|
||||||
|
var view2 = new View({events:function(){
|
||||||
|
return {'click #test':'increment'};
|
||||||
|
}});
|
||||||
|
|
||||||
|
view.$('#test').trigger('click');
|
||||||
|
view2.$('#test').trigger('click');
|
||||||
|
equal(counter, 2);
|
||||||
|
|
||||||
|
view.$('#test').trigger('click');
|
||||||
|
view2.$('#test').trigger('click');
|
||||||
|
equal(counter, 4);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
1
vendor/benchmark.js
vendored
22
vendor/benchmark.js/LICENSE.txt
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
Copyright 2010-2013 Mathias Bynens <http://mathiasbynens.be/>
|
||||||
|
Based on JSLitmus.js, copyright Robert Kieffer <http://broofa.com/>
|
||||||
|
Modified by John-David Dalton <http://allyoucanleet.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.
|
||||||
128
vendor/benchmark.js/README.md
vendored
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
# Benchmark.js <sup>v1.0.0</sup>
|
||||||
|
[](http://travis-ci.org/bestiejs/benchmark.js)
|
||||||
|
|
||||||
|
A [robust](http://calendar.perfplanet.com/2010/bulletproof-javascript-benchmarks/ "Bulletproof JavaScript benchmarks") benchmarking library that works on nearly all JavaScript platforms<sup><a name="fnref1" href="#fn1">1</a></sup>, supports high-resolution timers, and returns statistically significant results. As seen on [jsPerf](http://jsperf.com/).
|
||||||
|
|
||||||
|
## Download
|
||||||
|
|
||||||
|
* [Development source](https://raw.github.com/bestiejs/benchmark.js/v1.0.0/benchmark.js)
|
||||||
|
|
||||||
|
## Dive in
|
||||||
|
|
||||||
|
We’ve got [API docs](http://benchmarkjs.com/docs) and [unit tests](http://benchmarkjs.com/tests).
|
||||||
|
|
||||||
|
For a list of upcoming features, check out our [roadmap](https://github.com/bestiejs/benchmark.js/wiki/Roadmap).
|
||||||
|
|
||||||
|
## Support
|
||||||
|
|
||||||
|
Benchmark.js has been tested in at least Chrome 5~27, Firefox 2~21, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.10.7, Narwhal 0.3.2, PhantomJS 1.9.0, RingoJS 0.9, and Rhino 1.7RC5.
|
||||||
|
|
||||||
|
## Installation and usage
|
||||||
|
|
||||||
|
Benchmark.js’ only hard dependency is [Lo-Dash](http://lodash.com/).
|
||||||
|
|
||||||
|
In a browser:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<script src="lodash.js"></script>
|
||||||
|
<script src="benchmark.js"></script>
|
||||||
|
```
|
||||||
|
|
||||||
|
Optionally, expose Java’s nanosecond timer by adding the `nano` applet to the `<body>`:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<applet code="nano" archive="nano.jar"></applet>
|
||||||
|
```
|
||||||
|
|
||||||
|
Or enable Chrome’s microsecond timer by using the [command line switch](http://peter.sh/experiments/chromium-command-line-switches/#enable-benchmarking):
|
||||||
|
|
||||||
|
--enable-benchmarking
|
||||||
|
|
||||||
|
Via [npm](http://npmjs.org/):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install benchmark
|
||||||
|
```
|
||||||
|
|
||||||
|
In [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/):
|
||||||
|
|
||||||
|
```js
|
||||||
|
var Benchmark = require('benchmark');
|
||||||
|
```
|
||||||
|
|
||||||
|
Optionally, use the [microtime module](https://github.com/wadey/node-microtime) by Wade Simmons:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install microtime
|
||||||
|
```
|
||||||
|
|
||||||
|
In [RingoJS v0.7.0-](http://ringojs.org/):
|
||||||
|
|
||||||
|
```js
|
||||||
|
var Benchmark = require('benchmark').Benchmark;
|
||||||
|
```
|
||||||
|
|
||||||
|
In [Rhino](http://www.mozilla.org/rhino/):
|
||||||
|
|
||||||
|
```js
|
||||||
|
load('benchmark.js');
|
||||||
|
```
|
||||||
|
|
||||||
|
In an AMD loader like [RequireJS](http://requirejs.org/):
|
||||||
|
|
||||||
|
```js
|
||||||
|
require({
|
||||||
|
'paths': {
|
||||||
|
'benchmark': 'path/to/benchmark',
|
||||||
|
'lodash': 'path/to/lodash',
|
||||||
|
'platform': 'path/to/platform'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
['benchmark'], function(Benchmark) {
|
||||||
|
console.log(Benchmark.platform.name);
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
Usage example:
|
||||||
|
|
||||||
|
```js
|
||||||
|
var suite = new Benchmark.Suite;
|
||||||
|
|
||||||
|
// add tests
|
||||||
|
suite.add('RegExp#test', function() {
|
||||||
|
/o/.test('Hello World!');
|
||||||
|
})
|
||||||
|
.add('String#indexOf', function() {
|
||||||
|
'Hello World!'.indexOf('o') > -1;
|
||||||
|
})
|
||||||
|
// add listeners
|
||||||
|
.on('cycle', function(event) {
|
||||||
|
console.log(String(event.target));
|
||||||
|
})
|
||||||
|
.on('complete', function() {
|
||||||
|
console.log('Fastest is ' + this.filter('fastest').pluck('name'));
|
||||||
|
})
|
||||||
|
// run async
|
||||||
|
.run({ 'async': true });
|
||||||
|
|
||||||
|
// logs:
|
||||||
|
// > RegExp#test x 4,161,532 +-0.99% (59 cycles)
|
||||||
|
// > String#indexOf x 6,139,623 +-1.00% (131 cycles)
|
||||||
|
// > Fastest is String#indexOf
|
||||||
|
```
|
||||||
|
|
||||||
|
## BestieJS
|
||||||
|
|
||||||
|
Benchmark.js is part of the BestieJS *"Best in Class"* module collection. This means we promote solid browser/environment support, ES5+ precedents, unit testing, and plenty of documentation.
|
||||||
|
|
||||||
|
## Authors
|
||||||
|
|
||||||
|
| [](http://twitter.com/mathias "Follow @mathias on Twitter") | [](http://twitter.com/jdalton "Follow @jdalton on Twitter") |
|
||||||
|
|---|---|
|
||||||
|
| [Mathias Bynens](http://mathiasbynens.be/) | [John-David Dalton](http://allyoucanleet.com/) |
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
| [](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") |
|
||||||
|
|---|
|
||||||
|
| [Kit Cambridge](http://kitcambridge.github.io/) |
|
||||||
2877
vendor/benchmark.js/benchmark.js
vendored
Normal file
BIN
vendor/benchmark.js/nano.jar
vendored
Normal file
1
vendor/docdown
vendored
20
vendor/docdown/LICENSE.txt
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
Copyright 2011-2013 John-David Dalton <http://allyoucanleet.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.
|
||||||
35
vendor/docdown/README.md
vendored
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
# Docdown <sup>v1.0.0</sup>
|
||||||
|
|
||||||
|
A simple JSDoc to Markdown documentation generator.
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
|
||||||
|
The documentation for Docdown can be viewed here: [/doc/README.md](https://github.com/jdalton/docdown/blob/master/doc/README.md#readme)
|
||||||
|
|
||||||
|
For a list of upcoming features, check out our [roadmap](https://github.com/jdalton/docdown/wiki/Roadmap).
|
||||||
|
|
||||||
|
## Installation and usage
|
||||||
|
|
||||||
|
Usage example:
|
||||||
|
|
||||||
|
```php
|
||||||
|
require("docdown.php");
|
||||||
|
|
||||||
|
// generate Markdown
|
||||||
|
$markdown = docdown(array(
|
||||||
|
"path" => $filepath,
|
||||||
|
"url" => "https://github.com/username/project/blob/master/my.js"
|
||||||
|
));
|
||||||
|
```
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
| [](http://twitter.com/jdalton "Follow @jdalton on Twitter") |
|
||||||
|
|---|
|
||||||
|
| [John-David Dalton](http://allyoucanleet.com/) |
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
| [](http://twitter.com/mathias "Follow @mathias on Twitter") |
|
||||||
|
|---|
|
||||||
|
| [Mathias Bynens](http://mathiasbynens.be/) |
|
||||||
38
vendor/docdown/docdown.php
vendored
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
/*!
|
||||||
|
* Docdown v1.0.0-pre
|
||||||
|
* Copyright 2011-2013 John-David Dalton <http://allyoucanleet.com/>
|
||||||
|
* Available under MIT license <http://mths.be/mit>
|
||||||
|
*/
|
||||||
|
require(dirname(__FILE__) . '/src/DocDown/Generator.php');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates Markdown from JSDoc entries in a given file.
|
||||||
|
*
|
||||||
|
* @param {Array} [$options=array()] The options array.
|
||||||
|
* @returns {String} The generated Markdown.
|
||||||
|
* @example
|
||||||
|
*
|
||||||
|
* // specify a file path
|
||||||
|
* $markdown = docdown(array(
|
||||||
|
* // path to js file
|
||||||
|
* 'path' => $filepath,
|
||||||
|
* // url used to reference line numbers in code
|
||||||
|
* 'url' => 'https://github.com/username/project/blob/master/my.js'
|
||||||
|
* ));
|
||||||
|
*
|
||||||
|
* // or pass raw js
|
||||||
|
* $markdown = docdown(array(
|
||||||
|
* // raw JavaScript source
|
||||||
|
* 'source' => $rawJS,
|
||||||
|
* // documentation title
|
||||||
|
* 'title' => 'My API Documentation',
|
||||||
|
* // url used to reference line numbers in code
|
||||||
|
* 'url' => 'https://github.com/username/project/blob/master/my.js'
|
||||||
|
* ));
|
||||||
|
*/
|
||||||
|
function docdown( $options = array() ) {
|
||||||
|
$gen = new Generator($options);
|
||||||
|
return $gen->generate();
|
||||||
|
}
|
||||||
|
?>
|
||||||
226
vendor/docdown/src/DocDown/Alias.php
vendored
Normal file
@@ -0,0 +1,226 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A class to represent a JSDoc entry alias.
|
||||||
|
*/
|
||||||
|
class Alias {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The alias owner.
|
||||||
|
*
|
||||||
|
* @memberOf Alias
|
||||||
|
* @type Object
|
||||||
|
*/
|
||||||
|
public $owner;
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Alias constructor.
|
||||||
|
*
|
||||||
|
* @constructor
|
||||||
|
* @param {String} $name The alias name.
|
||||||
|
* @param {Object} $owner The alias owner.
|
||||||
|
*/
|
||||||
|
public function __construct( $name, $owner ) {
|
||||||
|
$this->owner = $owner;
|
||||||
|
$this->_name = $name;
|
||||||
|
$this->_call = $owner->getCall();
|
||||||
|
$this->_category = $owner->getCategory();
|
||||||
|
$this->_desc = $owner->getDesc();
|
||||||
|
$this->_example = $owner->getExample();
|
||||||
|
$this->_isCtor = $owner->isCtor();
|
||||||
|
$this->_isLicense = $owner->isLicense();
|
||||||
|
$this->_isPlugin = $owner->isPlugin();
|
||||||
|
$this->_isPrivate = $owner->isPrivate();
|
||||||
|
$this->_isStatic = $owner->isStatic();
|
||||||
|
$this->_lineNumber = $owner->getLineNumber();
|
||||||
|
$this->_members = $owner->getMembers();
|
||||||
|
$this->_params = $owner->getParams();
|
||||||
|
$this->_returns = $owner->getReturns();
|
||||||
|
$this->_type = $owner->getType();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extracts the entry's `alias` objects.
|
||||||
|
*
|
||||||
|
* @memberOf Alias
|
||||||
|
* @param {Number} $index The index of the array value to return.
|
||||||
|
* @returns {Array|String} The entry's `alias` objects.
|
||||||
|
*/
|
||||||
|
public function getAliases( $index = null ) {
|
||||||
|
$result = array();
|
||||||
|
return $index !== null
|
||||||
|
? @$result[$index]
|
||||||
|
: $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extracts the function call from the owner entry.
|
||||||
|
*
|
||||||
|
* @memberOf Alias
|
||||||
|
* @returns {String} The function call.
|
||||||
|
*/
|
||||||
|
public function getCall() {
|
||||||
|
return $this->_call;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extracts the owner entry's `category` data.
|
||||||
|
*
|
||||||
|
* @memberOf Alias
|
||||||
|
* @returns {String} The owner entry's `category` data.
|
||||||
|
*/
|
||||||
|
public function getCategory() {
|
||||||
|
return $this->_category;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extracts the owner entry's description.
|
||||||
|
*
|
||||||
|
* @memberOf Alias
|
||||||
|
* @returns {String} The owner entry's description.
|
||||||
|
*/
|
||||||
|
public function getDesc() {
|
||||||
|
return $this->_desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extracts the owner entry's `example` data.
|
||||||
|
*
|
||||||
|
* @memberOf Alias
|
||||||
|
* @returns {String} The owner entry's `example` data.
|
||||||
|
*/
|
||||||
|
public function getExample() {
|
||||||
|
return $this->_example;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the entry is an alias.
|
||||||
|
*
|
||||||
|
* @memberOf Alias
|
||||||
|
* @returns {Boolean} Returns `true`.
|
||||||
|
*/
|
||||||
|
public function isAlias() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the owner entry is a constructor.
|
||||||
|
*
|
||||||
|
* @memberOf Alias
|
||||||
|
* @returns {Boolean} Returns `true` if a constructor, else `false`.
|
||||||
|
*/
|
||||||
|
public function isCtor() {
|
||||||
|
return $this->_isCtor;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the owner entry is a license.
|
||||||
|
*
|
||||||
|
* @memberOf Alias
|
||||||
|
* @returns {Boolean} Returns `true` if a license, else `false`.
|
||||||
|
*/
|
||||||
|
public function isLicense() {
|
||||||
|
return $this->_isLicense;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the owner entry *is* assigned to a prototype.
|
||||||
|
*
|
||||||
|
* @memberOf Alias
|
||||||
|
* @returns {Boolean} Returns `true` if assigned to a prototype, else `false`.
|
||||||
|
*/
|
||||||
|
public function isPlugin() {
|
||||||
|
return $this->_isPlugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the owner entry is private.
|
||||||
|
*
|
||||||
|
* @memberOf Alias
|
||||||
|
* @returns {Boolean} Returns `true` if private, else `false`.
|
||||||
|
*/
|
||||||
|
public function isPrivate() {
|
||||||
|
return $this->_isPrivate;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the owner entry is *not* assigned to a prototype.
|
||||||
|
*
|
||||||
|
* @memberOf Alias
|
||||||
|
* @returns {Boolean} Returns `true` if not assigned to a prototype, else `false`.
|
||||||
|
*/
|
||||||
|
public function isStatic() {
|
||||||
|
return $this->_isStatic;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resolves the owner entry's line number.
|
||||||
|
*
|
||||||
|
* @memberOf Alias
|
||||||
|
* @returns {Number} The owner entry's line number.
|
||||||
|
*/
|
||||||
|
public function getLineNumber() {
|
||||||
|
return $this->_lineNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extracts the owner entry's `member` data.
|
||||||
|
*
|
||||||
|
* @memberOf Alias
|
||||||
|
* @param {Number} $index The index of the array value to return.
|
||||||
|
* @returns {Array|String} The owner entry's `member` data.
|
||||||
|
*/
|
||||||
|
public function getMembers( $index = null ) {
|
||||||
|
return $index !== null
|
||||||
|
? @$this->_members[$index]
|
||||||
|
: $this->_members;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extracts the owner entry's `name` data.
|
||||||
|
*
|
||||||
|
* @memberOf Alias
|
||||||
|
* @returns {String} The owner entry's `name` data.
|
||||||
|
*/
|
||||||
|
public function getName() {
|
||||||
|
return $this->_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extracts the owner entry's `param` data.
|
||||||
|
*
|
||||||
|
* @memberOf Alias
|
||||||
|
* @param {Number} $index The index of the array value to return.
|
||||||
|
* @returns {Array} The owner entry's `param` data.
|
||||||
|
*/
|
||||||
|
public function getParams( $index = null ) {
|
||||||
|
return $index !== null
|
||||||
|
? @$this->_params[$index]
|
||||||
|
: $this->_params;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extracts the owner entry's `returns` data.
|
||||||
|
*
|
||||||
|
* @memberOf Alias
|
||||||
|
* @returns {String} The owner entry's `returns` data.
|
||||||
|
*/
|
||||||
|
public function getReturns() {
|
||||||
|
return $this->_returns;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extracts the owner entry's `type` data.
|
||||||
|
*
|
||||||
|
* @memberOf Alias
|
||||||
|
* @returns {String} The owner entry's `type` data.
|
||||||
|
*/
|
||||||
|
public function getType() {
|
||||||
|
return $this->_type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
442
vendor/docdown/src/DocDown/Entry.php
vendored
Normal file
@@ -0,0 +1,442 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
require(dirname(__FILE__) . "/Alias.php");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A class to simplify parsing a single JSDoc entry.
|
||||||
|
*/
|
||||||
|
class Entry {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The documentation entry.
|
||||||
|
*
|
||||||
|
* @memberOf Entry
|
||||||
|
* @type String
|
||||||
|
*/
|
||||||
|
public $entry = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The language highlighter used for code examples.
|
||||||
|
*
|
||||||
|
* @memberOf Entry
|
||||||
|
* @type String
|
||||||
|
*/
|
||||||
|
public $lang = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The source code.
|
||||||
|
*
|
||||||
|
* @memberOf Entry
|
||||||
|
* @type String
|
||||||
|
*/
|
||||||
|
public $source = '';
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Entry constructor.
|
||||||
|
*
|
||||||
|
* @constructor
|
||||||
|
* @param {String} $entry The documentation entry to analyse.
|
||||||
|
* @param {String} $source The source code.
|
||||||
|
* @param {String} [$lang ='js'] The language highlighter used for code examples.
|
||||||
|
*/
|
||||||
|
public function __construct( $entry, $source, $lang = 'js' ) {
|
||||||
|
$this->entry = $entry;
|
||||||
|
$this->lang = $lang;
|
||||||
|
$this->source = str_replace(PHP_EOL, "\n", $source);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extracts the documentation entries from source code.
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @memberOf Entry
|
||||||
|
* @param {String} $source The source code.
|
||||||
|
* @returns {Array} The array of entries.
|
||||||
|
*/
|
||||||
|
public static function getEntries( $source ) {
|
||||||
|
preg_match_all('#/\*\*(?![-!])[\s\S]*?\*/\s*.+#', $source, $result);
|
||||||
|
return array_pop($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the entry is a function reference.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @memberOf Entry
|
||||||
|
* @returns {Boolean} Returns `true` if the entry is a function reference, else `false`.
|
||||||
|
*/
|
||||||
|
private function isFunction() {
|
||||||
|
if (!isset($this->_isFunction)) {
|
||||||
|
$this->_isFunction = !!(
|
||||||
|
$this->isCtor() ||
|
||||||
|
count($this->getParams()) ||
|
||||||
|
count($this->getReturns()) ||
|
||||||
|
preg_match('/\*[\t ]*@function\b/', $this->entry)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return $this->_isFunction;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extracts the entry's `alias` objects.
|
||||||
|
*
|
||||||
|
* @memberOf Entry
|
||||||
|
* @param {Number} $index The index of the array value to return.
|
||||||
|
* @returns {Array|String} The entry's `alias` objects.
|
||||||
|
*/
|
||||||
|
public function getAliases( $index = null ) {
|
||||||
|
if (!isset($this->_aliases)) {
|
||||||
|
preg_match('#\*[\t ]*@alias\s+(.+)#', $this->entry, $result);
|
||||||
|
|
||||||
|
if (count($result)) {
|
||||||
|
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
|
||||||
|
$result = preg_split('/,\s*/', $result);
|
||||||
|
natsort($result);
|
||||||
|
|
||||||
|
foreach ($result as $resultIndex => $value) {
|
||||||
|
$result[$resultIndex] = new Alias($value, $this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$this->_aliases = $result;
|
||||||
|
}
|
||||||
|
return $index !== null
|
||||||
|
? @$this->_aliases[$index]
|
||||||
|
: $this->_aliases;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extracts the function call from the entry.
|
||||||
|
*
|
||||||
|
* @memberOf Entry
|
||||||
|
* @returns {String} The function call.
|
||||||
|
*/
|
||||||
|
public function getCall() {
|
||||||
|
if (isset($this->_call)) {
|
||||||
|
return $this->_call;
|
||||||
|
}
|
||||||
|
|
||||||
|
preg_match('#\*/\s*(?:function ([^(]*)|(.*?)(?=[:=,]|return\b))#', $this->entry, $result);
|
||||||
|
if ($result = array_pop($result)) {
|
||||||
|
$result = array_pop(explode('var ', trim(trim(array_pop(explode('.', $result))), "'")));
|
||||||
|
}
|
||||||
|
// resolve name
|
||||||
|
// avoid $this->getName() because it calls $this->getCall()
|
||||||
|
preg_match('#\*[\t ]*@name\s+(.+)#', $this->entry, $name);
|
||||||
|
if (count($name)) {
|
||||||
|
$name = trim($name[1]);
|
||||||
|
} else {
|
||||||
|
$name = $result;
|
||||||
|
}
|
||||||
|
// compile function call syntax
|
||||||
|
if ($this->isFunction()) {
|
||||||
|
// compose parts
|
||||||
|
$result = array($result);
|
||||||
|
$params = $this->getParams();
|
||||||
|
foreach ($params as $param) {
|
||||||
|
$result[] = $param[1];
|
||||||
|
}
|
||||||
|
// format
|
||||||
|
$result = $name .'('. implode(array_slice($result, 1), ', ') .')';
|
||||||
|
$result = str_replace(', [', ' [, ', str_replace('], [', ', ', $result));
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->_call = $result ? $result : $name;
|
||||||
|
return $this->_call;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extracts the entry's `category` data.
|
||||||
|
*
|
||||||
|
* @memberOf Entry
|
||||||
|
* @returns {String} The entry's `category` data.
|
||||||
|
*/
|
||||||
|
public function getCategory() {
|
||||||
|
if (isset($this->_category)) {
|
||||||
|
return $this->_category;
|
||||||
|
}
|
||||||
|
|
||||||
|
preg_match('#\*[\t ]*@category\s+(.+)#', $this->entry, $result);
|
||||||
|
if (count($result)) {
|
||||||
|
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
|
||||||
|
} else {
|
||||||
|
$result = $this->getType() == 'Function' ? 'Methods' : 'Properties';
|
||||||
|
}
|
||||||
|
$this->_category = $result;
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extracts the entry's description.
|
||||||
|
*
|
||||||
|
* @memberOf Entry
|
||||||
|
* @returns {String} The entry's description.
|
||||||
|
*/
|
||||||
|
public function getDesc() {
|
||||||
|
if (isset($this->_desc)) {
|
||||||
|
return $this->_desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
preg_match('#/\*\*(?:\s*\*)?([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
|
||||||
|
if (count($result)) {
|
||||||
|
$type = $this->getType();
|
||||||
|
$result = preg_replace('/:\n[\t ]*\*[\t ]*/', ":<br>\n", $result[1]);
|
||||||
|
$result = preg_replace('/(?:^|\n)[\t ]*\*\n[\t ]*\*[\t ]*/', "\n\n", $result);
|
||||||
|
$result = preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result);
|
||||||
|
$result = trim($result);
|
||||||
|
$result = ($type == 'Function' ? '' : '(' . str_replace('|', ', ', trim($type, '{}')) . '): ') . $result;
|
||||||
|
}
|
||||||
|
$this->_desc = $result;
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extracts the entry's `example` data.
|
||||||
|
*
|
||||||
|
* @memberOf Entry
|
||||||
|
* @returns {String} The entry's `example` data.
|
||||||
|
*/
|
||||||
|
public function getExample() {
|
||||||
|
if (isset($this->_example)) {
|
||||||
|
return $this->_example;
|
||||||
|
}
|
||||||
|
|
||||||
|
preg_match('#\*[\t ]*@example\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
|
||||||
|
if (count($result)) {
|
||||||
|
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', "\n", $result[1]));
|
||||||
|
$result = '```' . $this->lang . "\n" . $result . "\n```";
|
||||||
|
}
|
||||||
|
$this->_example = $result;
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the entry is an alias.
|
||||||
|
*
|
||||||
|
* @memberOf Entry
|
||||||
|
* @returns {Boolean} Returns `false`.
|
||||||
|
*/
|
||||||
|
public function isAlias() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the entry is a constructor.
|
||||||
|
*
|
||||||
|
* @memberOf Entry
|
||||||
|
* @returns {Boolean} Returns `true` if a constructor, else `false`.
|
||||||
|
*/
|
||||||
|
public function isCtor() {
|
||||||
|
if (!isset($this->_isCtor)) {
|
||||||
|
$this->_isCtor = !!preg_match('/\*[\t ]*@constructor\b/', $this->entry);
|
||||||
|
}
|
||||||
|
return $this->_isCtor;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the entry is a license.
|
||||||
|
*
|
||||||
|
* @memberOf Entry
|
||||||
|
* @returns {Boolean} Returns `true` if a license, else `false`.
|
||||||
|
*/
|
||||||
|
public function isLicense() {
|
||||||
|
if (!isset($this->_isLicense)) {
|
||||||
|
$this->_isLicense = !!preg_match('/\*[\t ]*@license\b/', $this->entry);
|
||||||
|
}
|
||||||
|
return $this->_isLicense;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the entry *is* assigned to a prototype.
|
||||||
|
*
|
||||||
|
* @memberOf Entry
|
||||||
|
* @returns {Boolean} Returns `true` if assigned to a prototype, else `false`.
|
||||||
|
*/
|
||||||
|
public function isPlugin() {
|
||||||
|
if (!isset($this->_isPlugin)) {
|
||||||
|
$this->_isPlugin = !$this->isCtor() && !$this->isPrivate() && !$this->isStatic();
|
||||||
|
}
|
||||||
|
return $this->_isPlugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the entry is private.
|
||||||
|
*
|
||||||
|
* @memberOf Entry
|
||||||
|
* @returns {Boolean} Returns `true` if private, else `false`.
|
||||||
|
*/
|
||||||
|
public function isPrivate() {
|
||||||
|
if (!isset($this->_isPrivate)) {
|
||||||
|
$this->_isPrivate = $this->isLicense() || !!preg_match('/\*[\t ]*@private\b/', $this->entry) || !preg_match('/\*[\t ]*@[a-z]+\b/', $this->entry);
|
||||||
|
}
|
||||||
|
return $this->_isPrivate;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the entry is *not* assigned to a prototype.
|
||||||
|
*
|
||||||
|
* @memberOf Entry
|
||||||
|
* @returns {Boolean} Returns `true` if not assigned to a prototype, else `false`.
|
||||||
|
*/
|
||||||
|
public function isStatic() {
|
||||||
|
if (isset($this->_isStatic)) {
|
||||||
|
return $this->_isStatic;
|
||||||
|
}
|
||||||
|
|
||||||
|
$public = !$this->isPrivate();
|
||||||
|
$result = $public && !!preg_match('/\*[\t ]*@static\b/', $this->entry);
|
||||||
|
|
||||||
|
// set in cases where it isn't explicitly stated
|
||||||
|
if ($public && !$result) {
|
||||||
|
if ($parent = array_pop(preg_split('/[#.]/', $this->getMembers(0)))) {
|
||||||
|
foreach (Entry::getEntries($this->source) as $entry) {
|
||||||
|
$entry = new Entry($entry, $this->source);
|
||||||
|
if ($entry->getName() == $parent) {
|
||||||
|
$result = !$entry->isCtor();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$result = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$this->_isStatic = $result;
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resolves the entry's line number.
|
||||||
|
*
|
||||||
|
* @memberOf Entry
|
||||||
|
* @returns {Number} The entry's line number.
|
||||||
|
*/
|
||||||
|
public function getLineNumber() {
|
||||||
|
if (!isset($this->_lineNumber)) {
|
||||||
|
preg_match_all('/\n/', substr($this->source, 0, strrpos($this->source, $this->entry) + strlen($this->entry)), $lines);
|
||||||
|
$this->_lineNumber = count(array_pop($lines)) + 1;
|
||||||
|
}
|
||||||
|
return $this->_lineNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extracts the entry's `member` data.
|
||||||
|
*
|
||||||
|
* @memberOf Entry
|
||||||
|
* @param {Number} $index The index of the array value to return.
|
||||||
|
* @returns {Array|String} The entry's `member` data.
|
||||||
|
*/
|
||||||
|
public function getMembers( $index = null ) {
|
||||||
|
if (!isset($this->_members)) {
|
||||||
|
preg_match('#\*[\t ]*@member(?:Of)?\s+(.+)#', $this->entry, $result);
|
||||||
|
if (count($result)) {
|
||||||
|
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
|
||||||
|
$result = preg_split('/,\s*/', $result);
|
||||||
|
natsort($result);
|
||||||
|
}
|
||||||
|
$this->_members = $result;
|
||||||
|
}
|
||||||
|
return $index !== null
|
||||||
|
? @$this->_members[$index]
|
||||||
|
: $this->_members;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extracts the entry's `name` data.
|
||||||
|
*
|
||||||
|
* @memberOf Entry
|
||||||
|
* @returns {String} The entry's `name` data.
|
||||||
|
*/
|
||||||
|
public function getName() {
|
||||||
|
if (isset($this->_name)) {
|
||||||
|
return $this->_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
preg_match('#\*[\t ]*@name\s+(.+)#', $this->entry, $result);
|
||||||
|
if (count($result)) {
|
||||||
|
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
|
||||||
|
} else {
|
||||||
|
$result = array_shift(explode('(', $this->getCall()));
|
||||||
|
}
|
||||||
|
$this->_name = $result;
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extracts the entry's `param` data.
|
||||||
|
*
|
||||||
|
* @memberOf Entry
|
||||||
|
* @param {Number} $index The index of the array value to return.
|
||||||
|
* @returns {Array} The entry's `param` data.
|
||||||
|
*/
|
||||||
|
public function getParams( $index = null ) {
|
||||||
|
if (!isset($this->_params)) {
|
||||||
|
preg_match_all('#\*[\t ]*@param\s+\{([^}]+)\}\s+(\[.+\]|[$\w|]+(?:\[.+\])?)\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#i', $this->entry, $result);
|
||||||
|
if (count($result = array_filter(array_slice($result, 1)))) {
|
||||||
|
// repurpose array
|
||||||
|
foreach ($result as $param) {
|
||||||
|
foreach ($param as $key => $value) {
|
||||||
|
if (!is_array($result[0][$key])) {
|
||||||
|
$result[0][$key] = array();
|
||||||
|
}
|
||||||
|
$result[0][$key][] = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]*/', ' ', $value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$result = $result[0];
|
||||||
|
}
|
||||||
|
$this->_params = $result;
|
||||||
|
}
|
||||||
|
return $index !== null
|
||||||
|
? @$this->_params[$index]
|
||||||
|
: $this->_params;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extracts the entry's `returns` data.
|
||||||
|
*
|
||||||
|
* @memberOf Entry
|
||||||
|
* @returns {String} The entry's `returns` data.
|
||||||
|
*/
|
||||||
|
public function getReturns() {
|
||||||
|
if (isset($this->_returns)) {
|
||||||
|
return $this->_returns;
|
||||||
|
}
|
||||||
|
|
||||||
|
preg_match('#\*[\t ]*@returns\s+\{([^}]+)\}\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
|
||||||
|
if (count($result)) {
|
||||||
|
$result = array_map('trim', array_slice($result, 1));
|
||||||
|
$result[0] = str_replace('|', ', ', $result[0]);
|
||||||
|
$result[1] = preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]);
|
||||||
|
}
|
||||||
|
$this->_returns = $result;
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extracts the entry's `type` data.
|
||||||
|
*
|
||||||
|
* @memberOf Entry
|
||||||
|
* @returns {String} The entry's `type` data.
|
||||||
|
*/
|
||||||
|
public function getType() {
|
||||||
|
if (isset($this->_type)) {
|
||||||
|
return $this->_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
preg_match('#\*[\t ]*@type\s+(.+)#', $this->entry, $result);
|
||||||
|
if (count($result)) {
|
||||||
|
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
|
||||||
|
} else {
|
||||||
|
$result = $this->isFunction() ? 'Function' : 'Unknown';
|
||||||
|
}
|
||||||
|
$this->_type = $result;
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
563
vendor/docdown/src/DocDown/Generator.php
vendored
Normal file
@@ -0,0 +1,563 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
require(dirname(__FILE__) . "/Entry.php");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates Markdown from JSDoc entries.
|
||||||
|
*/
|
||||||
|
class Generator {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The HTML for the close tag.
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @memberOf Generator
|
||||||
|
* @type String
|
||||||
|
*/
|
||||||
|
public $closeTag = "\n<!-- /div -->\n";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An array of JSDoc entries.
|
||||||
|
*
|
||||||
|
* @memberOf Generator
|
||||||
|
* @type Array
|
||||||
|
*/
|
||||||
|
public $entries = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The HTML for the open tag.
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @memberOf Generator
|
||||||
|
* @type String
|
||||||
|
*/
|
||||||
|
public $openTag = "\n<!-- div -->\n";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An options array used to configure the generator.
|
||||||
|
*
|
||||||
|
* @memberOf Generator
|
||||||
|
* @type Array
|
||||||
|
*/
|
||||||
|
public $options = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The file's source code.
|
||||||
|
*
|
||||||
|
* @memberOf Generator
|
||||||
|
* @type String
|
||||||
|
*/
|
||||||
|
public $source = '';
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Generator constructor.
|
||||||
|
*
|
||||||
|
* @constructor
|
||||||
|
* @param {String} $source The source code to parse.
|
||||||
|
* @param {Array} $options The options array.
|
||||||
|
*/
|
||||||
|
public function __construct( $source, $options = array() ) {
|
||||||
|
// juggle arguments
|
||||||
|
if (is_array($source)) {
|
||||||
|
$options = $source;
|
||||||
|
} else {
|
||||||
|
$options['source'] = $source;
|
||||||
|
}
|
||||||
|
if (isset($options['source']) && realpath($options['source'])) {
|
||||||
|
$options['path'] = $options['source'];
|
||||||
|
}
|
||||||
|
if (isset($options['path'])) {
|
||||||
|
preg_match('/(?<=\.)[a-z]+$/', $options['path'], $ext);
|
||||||
|
$options['source'] = file_get_contents($options['path']);
|
||||||
|
$ext = array_pop($ext);
|
||||||
|
|
||||||
|
if (!isset($options['lang']) && $ext) {
|
||||||
|
$options['lang'] = $ext;
|
||||||
|
}
|
||||||
|
if (!isset($options['title'])) {
|
||||||
|
$options['title'] = ucfirst(basename($options['path'])) . ' API documentation';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!isset($options['lang'])) {
|
||||||
|
$options['lang'] = 'js';
|
||||||
|
}
|
||||||
|
if (!isset($options['toc'])) {
|
||||||
|
$options['toc'] = 'properties';
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->options = $options;
|
||||||
|
$this->source = str_replace(PHP_EOL, "\n", $options['source']);
|
||||||
|
$this->entries = Entry::getEntries($this->source);
|
||||||
|
|
||||||
|
foreach ($this->entries as $index => $value) {
|
||||||
|
$this->entries[$index] = new Entry($value, $this->source, $options['lang']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Performs common string formatting operations.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @static
|
||||||
|
* @memberOf Generator
|
||||||
|
* @param {String} $string The string to format.
|
||||||
|
* @returns {String} The formatted string.
|
||||||
|
*/
|
||||||
|
private static function format( $string ) {
|
||||||
|
$counter = 0;
|
||||||
|
|
||||||
|
// tokenize inline code snippets
|
||||||
|
preg_match_all('/`[^`]+`/', $string, $tokenized);
|
||||||
|
$tokenized = $tokenized[0];
|
||||||
|
foreach ($tokenized as $snippet) {
|
||||||
|
$string = str_replace($snippet, '__token' . ($counter++) .'__', $string);
|
||||||
|
}
|
||||||
|
|
||||||
|
// italicize parentheses
|
||||||
|
$string = preg_replace('/(^|\s)(\([^)]+\))/', '$1*$2*', $string);
|
||||||
|
|
||||||
|
// mark numbers as inline code
|
||||||
|
$string = preg_replace('/[\t ](-?\d+(?:.\d+)?)(?!\.[^\n])/', ' `$1`', $string);
|
||||||
|
|
||||||
|
// detokenize inline code snippets
|
||||||
|
$counter = 0;
|
||||||
|
foreach ($tokenized as $snippet) {
|
||||||
|
$string = str_replace('__token' . ($counter++) . '__', $snippet, $string);
|
||||||
|
}
|
||||||
|
|
||||||
|
return trim($string);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Modify a string by replacing named tokens with matching assoc. array values.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @static
|
||||||
|
* @memberOf Generator
|
||||||
|
* @param {String} $string The string to modify.
|
||||||
|
* @param {Array|Object} $object The template object.
|
||||||
|
* @returns {String} The modified string.
|
||||||
|
*/
|
||||||
|
private static function interpolate( $string, $object ) {
|
||||||
|
preg_match_all('/#\{([^}]+)\}/', $string, $tokens);
|
||||||
|
$tokens = array_unique(array_pop($tokens));
|
||||||
|
|
||||||
|
foreach ($tokens as $token) {
|
||||||
|
$pattern = '/#\{' . $token . '\}/';
|
||||||
|
$replacement = '';
|
||||||
|
|
||||||
|
if (is_object($object)) {
|
||||||
|
preg_match('/\(([^)]+?)\)$/', $token, $args);
|
||||||
|
$args = preg_split('/,\s*/', array_pop($args));
|
||||||
|
$method = 'get' . ucfirst(str_replace('/\([^)]+?\)$/', '', $token));
|
||||||
|
|
||||||
|
if (method_exists($object, $method)) {
|
||||||
|
$replacement = (string) call_user_func_array(array($object, $method), $args);
|
||||||
|
} else if (isset($object->{$token})) {
|
||||||
|
$replacement = (string) $object->{$token};
|
||||||
|
}
|
||||||
|
} else if (isset($object[$token])) {
|
||||||
|
$replacement = (string) $object[$token];
|
||||||
|
}
|
||||||
|
$string = preg_replace($pattern, trim($replacement), $string);
|
||||||
|
}
|
||||||
|
return Generator::format($string);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds the given `$entries` to the `$result` array.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @memberOf Generator
|
||||||
|
* @param {Array} $result The result array to modify.
|
||||||
|
* @param {Array} $entries The entries to add to the `$result`.
|
||||||
|
*/
|
||||||
|
private function addEntries( &$result, $entries ) {
|
||||||
|
foreach ($entries as $entry) {
|
||||||
|
// skip aliases
|
||||||
|
if ($entry->isAlias()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// name and description
|
||||||
|
array_push(
|
||||||
|
$result,
|
||||||
|
$this->openTag,
|
||||||
|
Generator::interpolate("### <a id=\"#{hash}\"></a>`#{member}#{separator}#{call}`\n<a href=\"##{hash}\">#</a> [Ⓢ](#{href} \"View in source\") [Ⓣ][1]\n\n#{desc}", $entry)
|
||||||
|
);
|
||||||
|
|
||||||
|
// @alias
|
||||||
|
if (count($aliases = $entry->getAliases())) {
|
||||||
|
array_push($result, '', '#### Aliases');
|
||||||
|
foreach ($aliases as $index => $alias) {
|
||||||
|
$aliases[$index] = $alias->getName();
|
||||||
|
}
|
||||||
|
$result[] = '*' . implode(', ', $aliases) . '*';
|
||||||
|
}
|
||||||
|
// @param
|
||||||
|
if (count($params = $entry->getParams())) {
|
||||||
|
array_push($result, '', '#### Arguments');
|
||||||
|
foreach ($params as $index => $param) {
|
||||||
|
$result[] = Generator::interpolate('#{num}. `#{name}` (#{type}): #{desc}', array(
|
||||||
|
'desc' => $param[2],
|
||||||
|
'name' => $param[1],
|
||||||
|
'num' => $index + 1,
|
||||||
|
'type' => $param[0]
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// @returns
|
||||||
|
if (count($returns = $entry->getReturns())) {
|
||||||
|
array_push(
|
||||||
|
$result, '',
|
||||||
|
'#### Returns',
|
||||||
|
Generator::interpolate('(#{type}): #{desc}', array('desc' => $returns[1], 'type' => $returns[0]))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
// @example
|
||||||
|
if ($example = $entry->getExample()) {
|
||||||
|
array_push($result, '', '#### Example', $example);
|
||||||
|
}
|
||||||
|
array_push($result, "\n* * *", $this->closeTag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resolves the entry's hash used to navigate the documentation.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @memberOf Generator
|
||||||
|
* @param {Number|Object} $entry The entry object.
|
||||||
|
* @param {String} $member The name of the member.
|
||||||
|
* @returns {String} The url hash.
|
||||||
|
*/
|
||||||
|
private function getHash( $entry, $member = '' ) {
|
||||||
|
$entry = is_numeric($entry) ? $this->entries[$entry] : $entry;
|
||||||
|
$member = !$member ? $entry->getMembers(0) : $member;
|
||||||
|
$result = ($member ? $member . ($entry->isPlugin() ? 'prototype' : '') : '') . $entry->getCall();
|
||||||
|
$result = preg_replace('/\(\[|\[\]/', '', $result);
|
||||||
|
$result = preg_replace('/[ =|\'"{}.()\]]/', '', $result);
|
||||||
|
$result = preg_replace('/[[#,]/', '-', $result);
|
||||||
|
return strtolower($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resolves the entry's url for the specific line number.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @memberOf Generator
|
||||||
|
* @param {Number|Object} $entry The entry object.
|
||||||
|
* @returns {String} The url.
|
||||||
|
*/
|
||||||
|
private function getLineUrl( $entry ) {
|
||||||
|
$entry = is_numeric($entry) ? $this->entries($entry) : $entry;
|
||||||
|
return $this->options['url'] . '#L' . $entry->getLineNumber();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extracts the character used to separate the entry's name from its member.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @memberOf Generator
|
||||||
|
* @param {Number|Object} $entry The entry object.
|
||||||
|
* @returns {String} The separator.
|
||||||
|
*/
|
||||||
|
private function getSeparator( $entry ) {
|
||||||
|
$entry = is_numeric($entry) ? $this->entries($entry) : $entry;
|
||||||
|
return $entry->isPlugin() ? '.prototype.' : '.';
|
||||||
|
}
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates Markdown from JSDoc entries.
|
||||||
|
*
|
||||||
|
* @memberOf Generator
|
||||||
|
* @returns {String} The rendered Markdown.
|
||||||
|
*/
|
||||||
|
public function generate() {
|
||||||
|
$api = array();
|
||||||
|
$byCategory = $this->options['toc'] == 'categories';
|
||||||
|
$categories = array();
|
||||||
|
$closeTag = $this->closeTag;
|
||||||
|
$compiling = false;
|
||||||
|
$openTag = $this->openTag;
|
||||||
|
$result = array('# ' . $this->options['title']);
|
||||||
|
$toc = 'toc';
|
||||||
|
|
||||||
|
// initialize $api array
|
||||||
|
foreach ($this->entries as $entry) {
|
||||||
|
// skip invalid or private entries
|
||||||
|
$name = $entry->getName();
|
||||||
|
if (!$name || $entry->isPrivate()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$members = $entry->getMembers();
|
||||||
|
$members = count($members) ? $members : array('');
|
||||||
|
|
||||||
|
foreach ($members as $member) {
|
||||||
|
// create api category arrays
|
||||||
|
if ($member && !isset($api[$member])) {
|
||||||
|
// create temporary entry to be replaced later
|
||||||
|
$api[$member] = new stdClass;
|
||||||
|
$api[$member]->static = array();
|
||||||
|
$api[$member]->plugin = array();
|
||||||
|
}
|
||||||
|
|
||||||
|
// append entry to api member
|
||||||
|
if (!$member || $entry->isCtor() || ($entry->getType() == 'Object' &&
|
||||||
|
!preg_match('/[=:]\s*(?:null|undefined)\s*[,;]?$/', $entry->entry))) {
|
||||||
|
|
||||||
|
// assign the real entry, replacing the temporary entry if it exist
|
||||||
|
$member = ($member ? $member . ($entry->isPlugin() ? '#' : '.') : '') . $name;
|
||||||
|
$entry->static = @$api[$member] ? $api[$member]->static : array();
|
||||||
|
$entry->plugin = @$api[$member] ? $api[$member]->plugin : array();
|
||||||
|
|
||||||
|
$api[$member] = $entry;
|
||||||
|
foreach ($entry->getAliases() as $alias) {
|
||||||
|
$api[$member]->static[] = $alias;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ($entry->isStatic()) {
|
||||||
|
$api[$member]->static[] = $entry;
|
||||||
|
foreach ($entry->getAliases() as $alias) {
|
||||||
|
$api[$member]->static[] = $alias;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (!$entry->isCtor()) {
|
||||||
|
$api[$member]->plugin[] = $entry;
|
||||||
|
foreach ($entry->getAliases() as $alias) {
|
||||||
|
$api[$member]->plugin[] = $alias;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// add properties to each entry
|
||||||
|
foreach ($api as $entry) {
|
||||||
|
$entry->hash = $this->getHash($entry);
|
||||||
|
$entry->href = $this->getLineUrl($entry);
|
||||||
|
|
||||||
|
$member = $entry->getMembers(0);
|
||||||
|
$member = ($member ? $member . ($entry->isPlugin() ? '.prototype.' : '.') : '') . $entry->getName();
|
||||||
|
$entry->member = preg_replace('/' . $entry->getName() . '$/', '', $member);
|
||||||
|
|
||||||
|
// add properties to static and plugin sub-entries
|
||||||
|
foreach (array('static', 'plugin') as $kind) {
|
||||||
|
foreach ($entry->{$kind} as $subentry) {
|
||||||
|
$subentry->hash = $this->getHash($subentry);
|
||||||
|
$subentry->href = $this->getLineUrl($subentry);
|
||||||
|
$subentry->member = $member;
|
||||||
|
$subentry->separator = $this->getSeparator($subentry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
// custom sort for root level entries
|
||||||
|
// TODO: see how well it handles deeper namespace traversal
|
||||||
|
function sortCompare($a, $b) {
|
||||||
|
$score = array( 'a' => 0, 'b' => 0);
|
||||||
|
foreach (array( 'a' => $a, 'b' => $b) as $key => $value) {
|
||||||
|
// capitalized properties are last
|
||||||
|
if (preg_match('/[#.][A-Z]/', $value)) {
|
||||||
|
$score[$key] = 0;
|
||||||
|
}
|
||||||
|
// lowercase prototype properties are next to last
|
||||||
|
else if (preg_match('/#[a-z]/', $value)) {
|
||||||
|
$score[$key] = 1;
|
||||||
|
}
|
||||||
|
// lowercase static properties next to first
|
||||||
|
else if (preg_match('/\.[a-z]/', $value)) {
|
||||||
|
$score[$key] = 2;
|
||||||
|
}
|
||||||
|
// root properties are first
|
||||||
|
else if (preg_match('/^[^#.]+$/', $value)) {
|
||||||
|
$score[$key] = 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$score = $score['b'] - $score['a'];
|
||||||
|
return $score ? $score : strcasecmp($a, $b);
|
||||||
|
}
|
||||||
|
|
||||||
|
uksort($api, 'sortCompare');
|
||||||
|
|
||||||
|
// sort static and plugin sub-entries
|
||||||
|
foreach ($api as $entry) {
|
||||||
|
foreach (array('static', 'plugin') as $kind) {
|
||||||
|
$sortBy = array( 'a' => array(), 'b' => array(), 'c' => array() );
|
||||||
|
foreach ($entry->{$kind} as $subentry) {
|
||||||
|
$name = $subentry->getName();
|
||||||
|
// functions w/o ALL-CAPs names are last
|
||||||
|
$sortBy['a'][] = $subentry->getType() == 'Function' && !preg_match('/^[A-Z_]+$/', $name);
|
||||||
|
// ALL-CAPs properties first
|
||||||
|
$sortBy['b'][] = preg_match('/^[A-Z_]+$/', $name);
|
||||||
|
// lowercase alphanumeric sort
|
||||||
|
$sortBy['c'][] = strtolower($name);
|
||||||
|
}
|
||||||
|
array_multisort($sortBy['a'], SORT_ASC, $sortBy['b'], SORT_DESC, $sortBy['c'], SORT_ASC, $entry->{$kind});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
// add categories
|
||||||
|
foreach ($api as $entry) {
|
||||||
|
$categories[$entry->getCategory()][] = $entry;
|
||||||
|
foreach (array('static', 'plugin') as $kind) {
|
||||||
|
foreach ($entry->{$kind} as $subentry) {
|
||||||
|
$categories[$subentry->getCategory()][] = $subentry;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// sort categories
|
||||||
|
ksort($categories);
|
||||||
|
|
||||||
|
foreach(array('Methods', 'Properties') as $category) {
|
||||||
|
if (isset($categories[$category])) {
|
||||||
|
$entries = $categories[$category];
|
||||||
|
unset($categories[$category]);
|
||||||
|
$categories[$category] = $entries;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
// compile TOC
|
||||||
|
$result[] = $openTag;
|
||||||
|
|
||||||
|
// compile TOC by categories
|
||||||
|
if ($byCategory) {
|
||||||
|
foreach ($categories as $category => $entries) {
|
||||||
|
if ($compiling) {
|
||||||
|
$result[] = $closeTag;
|
||||||
|
} else {
|
||||||
|
$compiling = true;
|
||||||
|
}
|
||||||
|
// assign TOC hash
|
||||||
|
if (count($result) == 2) {
|
||||||
|
$toc = $category;
|
||||||
|
}
|
||||||
|
// add category
|
||||||
|
array_push(
|
||||||
|
$result,
|
||||||
|
$openTag, '## ' . (count($result) == 2 ? '<a id="' . $toc . '"></a>' : '') . '`' . $category . '`'
|
||||||
|
);
|
||||||
|
// add entries
|
||||||
|
foreach ($entries as $entry) {
|
||||||
|
$result[] = Generator::interpolate('* [`#{member}#{separator}#{name}`](##{hash})', $entry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// compile TOC by namespace
|
||||||
|
else {
|
||||||
|
foreach ($api as $entry) {
|
||||||
|
if ($compiling) {
|
||||||
|
$result[] = $closeTag;
|
||||||
|
} else {
|
||||||
|
$compiling = true;
|
||||||
|
}
|
||||||
|
$member = $entry->member . $entry->getName();
|
||||||
|
|
||||||
|
// assign TOC hash
|
||||||
|
if (count($result) == 2) {
|
||||||
|
$toc = $member;
|
||||||
|
}
|
||||||
|
// add root entry
|
||||||
|
array_push(
|
||||||
|
$result,
|
||||||
|
$openTag, '## ' . (count($result) == 2 ? '<a id="' . $toc . '"></a>' : '') . '`' . $member . '`',
|
||||||
|
Generator::interpolate('* [`' . $member . '`](##{hash})', $entry)
|
||||||
|
);
|
||||||
|
|
||||||
|
// add static and plugin sub-entries
|
||||||
|
foreach (array('static', 'plugin') as $kind) {
|
||||||
|
if ($kind == 'plugin' && count($entry->plugin)) {
|
||||||
|
array_push(
|
||||||
|
$result,
|
||||||
|
$closeTag,
|
||||||
|
$openTag,
|
||||||
|
'## `' . $member . ($entry->isCtor() ? '.prototype`' : '`')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
foreach ($entry->{$kind} as $subentry) {
|
||||||
|
$subentry->member = $member;
|
||||||
|
$result[] = Generator::interpolate('* [`#{member}#{separator}#{name}`](##{hash})', $subentry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
array_push($result, $closeTag, $closeTag);
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
// compile content
|
||||||
|
$compiling = false;
|
||||||
|
$result[] = $openTag;
|
||||||
|
|
||||||
|
if ($byCategory) {
|
||||||
|
foreach ($categories as $category => $entries) {
|
||||||
|
if ($compiling) {
|
||||||
|
$result[] = $closeTag;
|
||||||
|
} else {
|
||||||
|
$compiling = true;
|
||||||
|
}
|
||||||
|
if ($category != 'Methods' && $category != 'Properties') {
|
||||||
|
$category = '“' . $category . '” Methods';
|
||||||
|
}
|
||||||
|
array_push($result, $openTag, '## `' . $category . '`');
|
||||||
|
$this->addEntries($result, $entries);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
foreach ($api as $entry) {
|
||||||
|
// skip aliases
|
||||||
|
if ($entry->isAlias()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ($compiling) {
|
||||||
|
$result[] = $closeTag;
|
||||||
|
} else {
|
||||||
|
$compiling = true;
|
||||||
|
}
|
||||||
|
// add root entry name
|
||||||
|
$member = $entry->member . $entry->getName();
|
||||||
|
array_push($result, $openTag, '## `' . $member . '`');
|
||||||
|
|
||||||
|
foreach (array($entry, 'static', 'plugin') as $kind) {
|
||||||
|
$subentries = is_string($kind) ? $entry->{$kind} : array($kind);
|
||||||
|
|
||||||
|
// add sub-entry name
|
||||||
|
if ($kind != 'static' && $entry->getType() != 'Object' &&
|
||||||
|
count($subentries) && $subentries[0] != $kind) {
|
||||||
|
if ($kind == 'plugin') {
|
||||||
|
$result[] = $closeTag;
|
||||||
|
}
|
||||||
|
array_push(
|
||||||
|
$result,
|
||||||
|
$openTag,
|
||||||
|
'## `' . $member . ($kind == 'plugin' ? '.prototype`' : '`')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
$this->addEntries($result, $subentries);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// close tags add TOC link reference
|
||||||
|
array_push($result, $closeTag, $closeTag, '', ' [1]: #' . $toc . ' "Jump back to the TOC."');
|
||||||
|
|
||||||
|
// cleanup whitespace
|
||||||
|
return trim(preg_replace('/[\t ]+\n/', "\n", join($result, "\n")));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
30
vendor/firebug-lite/license.txt
vendored
Executable file
@@ -0,0 +1,30 @@
|
|||||||
|
Software License Agreement (BSD License)
|
||||||
|
|
||||||
|
Copyright (c) 2007, Parakey Inc.
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use of this software 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 Parakey Inc. nor the names of its
|
||||||
|
contributors may be used to endorse or promote products
|
||||||
|
derived from this software without specific prior
|
||||||
|
written permission of Parakey Inc.
|
||||||
|
|
||||||
|
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 THE COPYRIGHT OWNER OR
|
||||||
|
CONTRIBUTORS 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.
|
||||||
BIN
vendor/firebug-lite/skin/xp/blank.gif
vendored
Executable file
|
After Width: | Height: | Size: 43 B |
BIN
vendor/firebug-lite/skin/xp/buttonBg.png
vendored
Executable file
|
After Width: | Height: | Size: 167 B |
BIN
vendor/firebug-lite/skin/xp/buttonBgHover.png
vendored
Executable file
|
After Width: | Height: | Size: 171 B |
331
vendor/firebug-lite/skin/xp/debugger.css
vendored
Executable file
@@ -0,0 +1,331 @@
|
|||||||
|
/* See license.txt for terms of usage */
|
||||||
|
|
||||||
|
.panelNode-script {
|
||||||
|
overflow: hidden;
|
||||||
|
font-family: monospace;
|
||||||
|
}
|
||||||
|
|
||||||
|
/************************************************************************************************/
|
||||||
|
|
||||||
|
.scriptTooltip {
|
||||||
|
position: fixed;
|
||||||
|
z-index: 2147483647;
|
||||||
|
padding: 2px 3px;
|
||||||
|
border: 1px solid #CBE087;
|
||||||
|
background: LightYellow;
|
||||||
|
font-family: monospace;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
/************************************************************************************************/
|
||||||
|
|
||||||
|
.sourceBox {
|
||||||
|
/* TODO: xxxpedro problem with sourceBox and scrolling elements */
|
||||||
|
/*overflow: scroll; /* see issue 1479 */
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sourceRow {
|
||||||
|
white-space: nowrap;
|
||||||
|
-moz-user-select: text;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sourceRow.hovered {
|
||||||
|
background-color: #EEEEEE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/************************************************************************************************/
|
||||||
|
|
||||||
|
.sourceLine {
|
||||||
|
-moz-user-select: none;
|
||||||
|
margin-right: 10px;
|
||||||
|
border-right: 1px solid #CCCCCC;
|
||||||
|
padding: 0px 4px 0 20px;
|
||||||
|
background: #EEEEEE no-repeat 2px 0px;
|
||||||
|
color: #888888;
|
||||||
|
white-space: pre;
|
||||||
|
font-family: monospace; /* see issue 2953 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.noteInToolTip { /* below sourceLine, so it overrides it */
|
||||||
|
background-color: #FFD472;
|
||||||
|
}
|
||||||
|
|
||||||
|
.useA11y .sourceBox .sourceViewport:focus .sourceLine {
|
||||||
|
background-color: #FFFFC0;
|
||||||
|
color: navy;
|
||||||
|
border-right: 1px solid black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.useA11y .sourceBox .sourceViewport:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.a11y1emSize {
|
||||||
|
width: 1em;
|
||||||
|
height: 1em;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
.useA11y .panelStatusLabel:focus {
|
||||||
|
outline-offset: -2px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sourceBox > .sourceRow > .sourceLine {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sourceLine:hover {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sourceRowText {
|
||||||
|
white-space: pre;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sourceRow[exe_line="true"] {
|
||||||
|
outline: 1px solid #D9D9B6;
|
||||||
|
margin-right: 1px;
|
||||||
|
background-color: lightgoldenrodyellow;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sourceRow[executable="true"] > .sourceLine {
|
||||||
|
content: "-";
|
||||||
|
color: #4AA02C; /* Spring Green */
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sourceRow[exe_line="true"] > .sourceLine {
|
||||||
|
background-image: url(chrome://firebug/skin/exe.png);
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sourceRow[breakpoint="true"] > .sourceLine {
|
||||||
|
background-image: url(chrome://firebug/skin/breakpoint.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sourceRow[breakpoint="true"][condition="true"] > .sourceLine {
|
||||||
|
background-image: url(chrome://firebug/skin/breakpointCondition.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sourceRow[breakpoint="true"][disabledBreakpoint="true"] > .sourceLine {
|
||||||
|
background-image: url(chrome://firebug/skin/breakpointDisabled.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sourceRow[breakpoint="true"][exe_line="true"] > .sourceLine {
|
||||||
|
background-image: url(chrome://firebug/skin/breakpointExe.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sourceRow[breakpoint="true"][exe_line="true"][disabledBreakpoint="true"] > .sourceLine {
|
||||||
|
background-image: url(chrome://firebug/skin/breakpointDisabledExe.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sourceLine.editing {
|
||||||
|
background-image: url(chrome://firebug/skin/breakpoint.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
/************************************************************************************************/
|
||||||
|
|
||||||
|
.conditionEditor {
|
||||||
|
z-index: 2147483647;
|
||||||
|
position: absolute;
|
||||||
|
margin-top: 0;
|
||||||
|
left: 2px;
|
||||||
|
width: 90%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.conditionEditorInner {
|
||||||
|
position: relative;
|
||||||
|
top: -26px;
|
||||||
|
height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.conditionCaption {
|
||||||
|
margin-bottom: 2px;
|
||||||
|
font-family: Lucida Grande, sans-serif;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 11px;
|
||||||
|
color: #226679;
|
||||||
|
}
|
||||||
|
|
||||||
|
.conditionInput {
|
||||||
|
width: 100%;
|
||||||
|
border: 1px solid #0096C0;
|
||||||
|
font-family: monospace;
|
||||||
|
font-size: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.conditionEditorInner1 {
|
||||||
|
padding-left: 37px;
|
||||||
|
background: url(condBorders.png) repeat-y;
|
||||||
|
}
|
||||||
|
|
||||||
|
.conditionEditorInner2 {
|
||||||
|
padding-right: 25px;
|
||||||
|
background: url(condBorders.png) repeat-y 100% 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.conditionEditorTop1 {
|
||||||
|
background: url(condCorners.png) no-repeat 100% 0;
|
||||||
|
margin-left: 37px;
|
||||||
|
height: 35px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.conditionEditorTop2 {
|
||||||
|
position: relative;
|
||||||
|
left: -37px;
|
||||||
|
width: 37px;
|
||||||
|
height: 35px;
|
||||||
|
background: url(condCorners.png) no-repeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
.conditionEditorBottom1 {
|
||||||
|
background: url(condCorners.png) no-repeat 100% 100%;
|
||||||
|
margin-left: 37px;
|
||||||
|
height: 33px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.conditionEditorBottom2 {
|
||||||
|
position: relative; left: -37px;
|
||||||
|
width: 37px;
|
||||||
|
height: 33px;
|
||||||
|
background: url(condCorners.png) no-repeat 0 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
.upsideDown {
|
||||||
|
margin-top: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.upsideDown .conditionEditorInner {
|
||||||
|
top: -8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.upsideDown .conditionEditorInner1 {
|
||||||
|
padding-left: 33px;
|
||||||
|
background: url(condBordersUps.png) repeat-y;
|
||||||
|
}
|
||||||
|
|
||||||
|
.upsideDown .conditionEditorInner2 {
|
||||||
|
padding-right: 25px;
|
||||||
|
background: url(condBordersUps.png) repeat-y 100% 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.upsideDown .conditionEditorTop1 {
|
||||||
|
background: url(condCornersUps.png) no-repeat 100% 0;
|
||||||
|
margin-left: 33px;
|
||||||
|
height: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.upsideDown .conditionEditorTop2 {
|
||||||
|
position: relative;
|
||||||
|
left: -33px;
|
||||||
|
width: 33px;
|
||||||
|
height: 25px;
|
||||||
|
background: url(condCornersUps.png) no-repeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
.upsideDown .conditionEditorBottom1 {
|
||||||
|
background: url(condCornersUps.png) no-repeat 100% 100%;
|
||||||
|
margin-left: 33px;
|
||||||
|
height: 43px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.upsideDown .conditionEditorBottom2 {
|
||||||
|
position: relative;
|
||||||
|
left: -33px;
|
||||||
|
width: 33px;
|
||||||
|
height: 43px;
|
||||||
|
background: url(condCornersUps.png) no-repeat 0 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/************************************************************************************************/
|
||||||
|
|
||||||
|
.breakpointsGroupListBox {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.breakpointBlockHead {
|
||||||
|
position: relative;
|
||||||
|
padding-top: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.breakpointBlockHead > .checkbox {
|
||||||
|
margin-right: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.breakpointBlockHead > .objectLink-sourceLink {
|
||||||
|
top: 4px;
|
||||||
|
right: 20px;
|
||||||
|
background-color: #FFFFFF; /* issue 3308 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.breakpointBlockHead > .closeButton {
|
||||||
|
position: absolute;
|
||||||
|
top: 2px;
|
||||||
|
right: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.breakpointCheckbox {
|
||||||
|
margin-top: 0;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
|
.breakpointName {
|
||||||
|
margin-left: 4px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.breakpointRow[aria-checked="false"] > .breakpointBlockHead > *,
|
||||||
|
.breakpointRow[aria-checked="false"] > .breakpointCode {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.breakpointRow[aria-checked="false"] .breakpointCheckbox,
|
||||||
|
.breakpointRow[aria-checked="false"] .objectLink-sourceLink,
|
||||||
|
.breakpointRow[aria-checked="false"] .closeButton,
|
||||||
|
.breakpointRow[aria-checked="false"] .breakpointMutationType {
|
||||||
|
opacity: 1.0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.breakpointCode {
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
padding-left: 24px;
|
||||||
|
padding-bottom: 2px;
|
||||||
|
border-bottom: 1px solid #D7D7D7;
|
||||||
|
font-family: monospace;
|
||||||
|
color: DarkGreen;
|
||||||
|
}
|
||||||
|
|
||||||
|
.breakpointCondition {
|
||||||
|
white-space: nowrap;
|
||||||
|
padding-left: 24px;
|
||||||
|
padding-bottom: 2px;
|
||||||
|
border-bottom: 1px solid #D7D7D7;
|
||||||
|
font-family: monospace;
|
||||||
|
color: Gray;
|
||||||
|
}
|
||||||
|
|
||||||
|
.breakpointBlock-breakpoints > .groupHeader {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.breakpointBlock-monitors > .breakpointCode {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.breakpointBlock-errorBreakpoints .breakpointCheckbox,
|
||||||
|
.breakpointBlock-monitors .breakpointCheckbox {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.breakpointHeader {
|
||||||
|
margin: 0 !important;
|
||||||
|
border-top: none !important;
|
||||||
|
}
|
||||||
BIN
vendor/firebug-lite/skin/xp/detach.png
vendored
Executable file
|
After Width: | Height: | Size: 655 B |
BIN
vendor/firebug-lite/skin/xp/detachHover.png
vendored
Executable file
|
After Width: | Height: | Size: 586 B |
BIN
vendor/firebug-lite/skin/xp/disable.gif
vendored
Executable file
|
After Width: | Height: | Size: 340 B |
BIN
vendor/firebug-lite/skin/xp/disable.png
vendored
Executable file
|
After Width: | Height: | Size: 543 B |
BIN
vendor/firebug-lite/skin/xp/disableHover.gif
vendored
Executable file
|
After Width: | Height: | Size: 344 B |
BIN
vendor/firebug-lite/skin/xp/disableHover.png
vendored
Executable file
|
After Width: | Height: | Size: 512 B |
BIN
vendor/firebug-lite/skin/xp/down.png
vendored
Executable file
|
After Width: | Height: | Size: 637 B |
BIN
vendor/firebug-lite/skin/xp/downActive.png
vendored
Executable file
|
After Width: | Height: | Size: 543 B |
BIN
vendor/firebug-lite/skin/xp/downHover.png
vendored
Executable file
|
After Width: | Height: | Size: 526 B |
BIN
vendor/firebug-lite/skin/xp/errorIcon-sm.png
vendored
Executable file
|
After Width: | Height: | Size: 447 B |
BIN
vendor/firebug-lite/skin/xp/errorIcon.gif
vendored
Executable file
|
After Width: | Height: | Size: 365 B |
BIN
vendor/firebug-lite/skin/xp/errorIcon.png
vendored
Executable file
|
After Width: | Height: | Size: 457 B |
817
vendor/firebug-lite/skin/xp/firebug-1.3a2.css
vendored
Executable file
@@ -0,0 +1,817 @@
|
|||||||
|
.fbBtnPressed {
|
||||||
|
background: #ECEBE3;
|
||||||
|
padding: 3px 6px 2px 7px !important;
|
||||||
|
margin: 1px 0 0 1px;
|
||||||
|
_margin: 1px -1px 0 1px;
|
||||||
|
border: 1px solid #ACA899 !important;
|
||||||
|
border-color: #ACA899 #ECEBE3 #ECEBE3 #ACA899 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbToolbarButtons {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbStatusBarBox {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/************************************************************************************************
|
||||||
|
Error Popup
|
||||||
|
*************************************************************************************************/
|
||||||
|
#fbErrorPopup {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
height: 19px;
|
||||||
|
width: 75px;
|
||||||
|
background: url(sprite.png) #f1f2ee 0 0;
|
||||||
|
z-index: 999;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbErrorPopupContent {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 1px;
|
||||||
|
height: 18px;
|
||||||
|
width: 75px;
|
||||||
|
_width: 74px;
|
||||||
|
border-left: 1px solid #aca899;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbErrorIndicator {
|
||||||
|
position: absolute;
|
||||||
|
top: 2px;
|
||||||
|
right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.fbBtnInspectActive {
|
||||||
|
background: #aaa;
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/************************************************************************************************
|
||||||
|
General
|
||||||
|
*************************************************************************************************/
|
||||||
|
html, body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: Lucida Grande, Tahoma, sans-serif;
|
||||||
|
font-size: 11px;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clear {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
/************************************************************************************************
|
||||||
|
Mini Chrome
|
||||||
|
*************************************************************************************************/
|
||||||
|
#fbMiniChrome {
|
||||||
|
display: none;
|
||||||
|
right: 0;
|
||||||
|
height: 27px;
|
||||||
|
background: url(sprite.png) #f1f2ee 0 0;
|
||||||
|
margin-left: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbMiniContent {
|
||||||
|
display: block;
|
||||||
|
position: relative;
|
||||||
|
left: -1px;
|
||||||
|
right: 0;
|
||||||
|
top: 1px;
|
||||||
|
height: 25px;
|
||||||
|
border-left: 1px solid #aca899;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbToolbarSearch {
|
||||||
|
float: right;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
margin: 0 5px 0 0;
|
||||||
|
background: #fff url(search.png) no-repeat 4px 2px;
|
||||||
|
padding-left: 20px;
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbToolbarErrors {
|
||||||
|
float: right;
|
||||||
|
margin: 1px 4px 0 0;
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbLeftToolbarErrors {
|
||||||
|
float: left;
|
||||||
|
margin: 7px 0px 0 5px;
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbErrors {
|
||||||
|
padding-left: 20px;
|
||||||
|
height: 14px;
|
||||||
|
background: url(errorIcon.png) no-repeat;
|
||||||
|
color: #f00;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbMiniErrors {
|
||||||
|
display: inline;
|
||||||
|
display: none;
|
||||||
|
float: right;
|
||||||
|
margin: 5px 2px 0 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbMiniIcon {
|
||||||
|
float: right;
|
||||||
|
margin: 3px 4px 0;
|
||||||
|
height: 20px;
|
||||||
|
width: 20px;
|
||||||
|
float: right;
|
||||||
|
background: url(sprite.png) 0 -135px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************************************
|
||||||
|
Master Layout
|
||||||
|
*************************************************************************************************/
|
||||||
|
#fbChrome {
|
||||||
|
position: fixed;
|
||||||
|
overflow: hidden;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
border-collapse: collapse;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbTop {
|
||||||
|
height: 49px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbToolbar {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 5;
|
||||||
|
width: 100%;
|
||||||
|
top: 0;
|
||||||
|
background: url(sprite.png) #f1f2ee 0 0;
|
||||||
|
height: 27px;
|
||||||
|
font-size: 11px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbPanelBarBox {
|
||||||
|
top: 27px;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 8;
|
||||||
|
width: 100%;
|
||||||
|
background: url(sprite.png) #dbd9c9 0 -27px;
|
||||||
|
height: 22px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbContent {
|
||||||
|
height: 100%;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbBottom {
|
||||||
|
height: 18px;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
/************************************************************************************************
|
||||||
|
Sub-Layout
|
||||||
|
*************************************************************************************************/
|
||||||
|
|
||||||
|
/* fbToolbar
|
||||||
|
*************************************************************************************************/
|
||||||
|
#fbToolbarIcon {
|
||||||
|
float: left;
|
||||||
|
padding: 4px 5px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbToolbarIcon a {
|
||||||
|
display: block;
|
||||||
|
height: 20px;
|
||||||
|
width: 20px;
|
||||||
|
background: url(sprite.png) 0 -135px;
|
||||||
|
text-decoration: none;
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbToolbarButtons {
|
||||||
|
float: left;
|
||||||
|
padding: 4px 2px 0 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbToolbarButtons a {
|
||||||
|
text-decoration: none;
|
||||||
|
display: block;
|
||||||
|
float: left;
|
||||||
|
color: #000;
|
||||||
|
padding: 4px 8px 4px;
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbToolbarButtons a:hover {
|
||||||
|
color: #333;
|
||||||
|
padding: 3px 7px 3px;
|
||||||
|
border: 1px solid #fff;
|
||||||
|
border-bottom: 1px solid #bbb;
|
||||||
|
border-right: 1px solid #bbb;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbStatusBarBox {
|
||||||
|
position: relative;
|
||||||
|
top: 5px;
|
||||||
|
line-height: 19px;
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbToolbarSeparator{
|
||||||
|
overflow: hidden;
|
||||||
|
border: 1px solid;
|
||||||
|
border-color: transparent #fff transparent #777;
|
||||||
|
_border-color: #eee #fff #eee #777;
|
||||||
|
height: 7px;
|
||||||
|
margin: 10px 6px 0 0;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbStatusBar span {
|
||||||
|
color: #808080;
|
||||||
|
padding: 0 4px 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbStatusBar span a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbStatusBar span a:hover {
|
||||||
|
color: blue;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#fbWindowButtons {
|
||||||
|
position: absolute;
|
||||||
|
white-space: nowrap;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
height: 17px;
|
||||||
|
_width: 50px;
|
||||||
|
padding: 5px 0 5px 5px;
|
||||||
|
z-index: 6;
|
||||||
|
background: url(sprite.png) #f1f2ee 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* fbPanelBarBox
|
||||||
|
*************************************************************************************************/
|
||||||
|
|
||||||
|
#fbPanelBar1 {
|
||||||
|
width: 255px; /* fixed width to avoid tabs breaking line */
|
||||||
|
z-index: 8;
|
||||||
|
left: 0;
|
||||||
|
white-space: nowrap;
|
||||||
|
background: url(sprite.png) #dbd9c9 0 -27px;
|
||||||
|
position: absolute;
|
||||||
|
left: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbPanelBar2Box {
|
||||||
|
background: url(sprite.png) #dbd9c9 0 -27px;
|
||||||
|
position: absolute;
|
||||||
|
height: 22px;
|
||||||
|
width: 300px; /* fixed width to avoid tabs breaking line */
|
||||||
|
z-index: 9;
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbPanelBar2 {
|
||||||
|
position: absolute;
|
||||||
|
width: 290px; /* fixed width to avoid tabs breaking line */
|
||||||
|
height: 22px;
|
||||||
|
padding-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* body
|
||||||
|
*************************************************************************************************/
|
||||||
|
.fbPanel {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbPanelBox1, #fbPanelBox2 {
|
||||||
|
max-height: inherit;
|
||||||
|
height: 100%;
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbPanelBox2 {
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbPanelBox2 {
|
||||||
|
width: 300px;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbPanel2 {
|
||||||
|
padding-left: 6px;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hide {
|
||||||
|
overflow: hidden !important;
|
||||||
|
position: fixed !important;
|
||||||
|
display: none !important;
|
||||||
|
visibility: hidden !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* fbBottom
|
||||||
|
*************************************************************************************************/
|
||||||
|
|
||||||
|
#fbCommand {
|
||||||
|
height: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbCommandBox {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 18px;
|
||||||
|
bottom: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
z-index: 9;
|
||||||
|
background: #fff;
|
||||||
|
border: 0;
|
||||||
|
border-top: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbCommandIcon {
|
||||||
|
position: absolute;
|
||||||
|
color: #00f;
|
||||||
|
top: 2px;
|
||||||
|
left: 7px;
|
||||||
|
display: inline;
|
||||||
|
font: 11px Monaco, monospace;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbCommandLine {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
border: 0;
|
||||||
|
margin: 0;
|
||||||
|
padding: 2px 0 2px 32px;
|
||||||
|
font: 11px Monaco, monospace;
|
||||||
|
z-index: 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.fbFitHeight {
|
||||||
|
overflow: auto;
|
||||||
|
_position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************************************
|
||||||
|
Layout Controls
|
||||||
|
*************************************************************************************************/
|
||||||
|
|
||||||
|
/* fbToolbar buttons
|
||||||
|
*************************************************************************************************/
|
||||||
|
#fbWindowButtons a {
|
||||||
|
font-size: 1px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
display: block;
|
||||||
|
float: right;
|
||||||
|
margin-right: 4px;
|
||||||
|
text-decoration: none;
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbWindow_btClose {
|
||||||
|
background: url(sprite.png) 0 -119px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbWindow_btClose:hover {
|
||||||
|
background: url(sprite.png) -16px -119px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbWindow_btDetach {
|
||||||
|
background: url(sprite.png) -32px -119px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbWindow_btDetach:hover {
|
||||||
|
background: url(sprite.png) -48px -119px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* fbPanelBarBox tabs
|
||||||
|
*************************************************************************************************/
|
||||||
|
.fbTab {
|
||||||
|
text-decoration: none;
|
||||||
|
display: none;
|
||||||
|
float: left;
|
||||||
|
width: auto;
|
||||||
|
float: left;
|
||||||
|
cursor: default;
|
||||||
|
font-family: Lucida Grande, Tahoma, sans-serif;
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: bold;
|
||||||
|
height: 22px;
|
||||||
|
color: #565656;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbPanelBar span {
|
||||||
|
display: block;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbPanelBar .fbTabL,.fbPanelBar .fbTabR {
|
||||||
|
height: 22px;
|
||||||
|
width: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbPanelBar .fbTabText {
|
||||||
|
padding: 4px 1px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.fbTab:hover {
|
||||||
|
background: url(sprite.png) 0 -73px;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.fbTab:hover .fbTabL {
|
||||||
|
background: url(sprite.png) -16px -96px;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.fbTab:hover .fbTabR {
|
||||||
|
background: url(sprite.png) -24px -96px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbSelectedTab {
|
||||||
|
background: url(sprite.png) #f1f2ee 0 -50px !important;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbSelectedTab .fbTabL {
|
||||||
|
background: url(sprite.png) 0 -96px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbSelectedTab .fbTabR {
|
||||||
|
background: url(sprite.png) -8px -96px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* splitters
|
||||||
|
*************************************************************************************************/
|
||||||
|
#fbHSplitter {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 5px;
|
||||||
|
overflow: hidden;
|
||||||
|
cursor: n-resize !important;
|
||||||
|
background: url(pixel_transparent.gif);
|
||||||
|
z-index: 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbHSplitter.fbOnMovingHSplitter {
|
||||||
|
height: 100%;
|
||||||
|
z-index: 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbVSplitter {
|
||||||
|
background: #ece9d8;
|
||||||
|
color: #000;
|
||||||
|
border: 1px solid #716f64;
|
||||||
|
border-width: 0 1px;
|
||||||
|
border-left-color: #aca899;
|
||||||
|
width: 4px;
|
||||||
|
cursor: e-resize;
|
||||||
|
overflow: hidden;
|
||||||
|
right: 294px;
|
||||||
|
text-decoration: none;
|
||||||
|
z-index: 9;
|
||||||
|
position: absolute;
|
||||||
|
height: 100%;
|
||||||
|
top: 27px;
|
||||||
|
_width: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/************************************************************************************************/
|
||||||
|
div.lineNo {
|
||||||
|
font: 11px Monaco, monospace;
|
||||||
|
float: left;
|
||||||
|
display: inline;
|
||||||
|
position: relative;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0 5px 0 20px;
|
||||||
|
background: #eee;
|
||||||
|
color: #888;
|
||||||
|
border-right: 1px solid #ccc;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre.nodeCode {
|
||||||
|
font: 11px Monaco, monospace;
|
||||||
|
margin: 0;
|
||||||
|
padding-left: 10px;
|
||||||
|
overflow: hidden;
|
||||||
|
/*
|
||||||
|
_width: 100%;
|
||||||
|
/**/
|
||||||
|
}
|
||||||
|
|
||||||
|
/************************************************************************************************/
|
||||||
|
.nodeControl {
|
||||||
|
margin-top: 3px;
|
||||||
|
margin-left: -14px;
|
||||||
|
float: left;
|
||||||
|
width: 9px;
|
||||||
|
height: 9px;
|
||||||
|
overflow: hidden;
|
||||||
|
cursor: default;
|
||||||
|
background: url(tree_open.gif);
|
||||||
|
_float: none;
|
||||||
|
_display: inline;
|
||||||
|
_position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.nodeMaximized {
|
||||||
|
background: url(tree_close.gif);
|
||||||
|
}
|
||||||
|
|
||||||
|
div.objectBox-element {
|
||||||
|
padding: 1px 3px;
|
||||||
|
}
|
||||||
|
.objectBox-selector{
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
|
.selectedElement{
|
||||||
|
background: highlight;
|
||||||
|
/* background: url(roundCorner.svg); Opera */
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
.selectedElement span{
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Webkit CSS Hack - bug in "highlight" named color */
|
||||||
|
@media screen and (-webkit-min-device-pixel-ratio:0) {
|
||||||
|
.selectedElement{
|
||||||
|
background: #316AC5;
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/************************************************************************************************/
|
||||||
|
/************************************************************************************************/
|
||||||
|
.logRow * {
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logRow {
|
||||||
|
position: relative;
|
||||||
|
border-bottom: 1px solid #D7D7D7;
|
||||||
|
padding: 2px 4px 1px 6px;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logRow-command {
|
||||||
|
font-family: Monaco, monospace;
|
||||||
|
color: blue;
|
||||||
|
}
|
||||||
|
|
||||||
|
.objectBox-string,
|
||||||
|
.objectBox-text,
|
||||||
|
.objectBox-number,
|
||||||
|
.objectBox-function,
|
||||||
|
.objectLink-element,
|
||||||
|
.objectLink-textNode,
|
||||||
|
.objectLink-function,
|
||||||
|
.objectBox-stackTrace,
|
||||||
|
.objectLink-profile {
|
||||||
|
font-family: Monaco, monospace;
|
||||||
|
}
|
||||||
|
|
||||||
|
.objectBox-null {
|
||||||
|
padding: 0 2px;
|
||||||
|
border: 1px solid #666666;
|
||||||
|
background-color: #888888;
|
||||||
|
color: #FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.objectBox-string {
|
||||||
|
color: red;
|
||||||
|
white-space: pre;
|
||||||
|
}
|
||||||
|
|
||||||
|
.objectBox-number {
|
||||||
|
color: #000088;
|
||||||
|
}
|
||||||
|
|
||||||
|
.objectBox-function {
|
||||||
|
color: DarkGreen;
|
||||||
|
}
|
||||||
|
|
||||||
|
.objectBox-object {
|
||||||
|
color: DarkGreen;
|
||||||
|
font-weight: bold;
|
||||||
|
font-family: Lucida Grande, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.objectBox-array {
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
/************************************************************************************************/
|
||||||
|
.logRow-info,.logRow-error,.logRow-warning {
|
||||||
|
background: #fff no-repeat 2px 2px;
|
||||||
|
padding-left: 20px;
|
||||||
|
padding-bottom: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logRow-info {
|
||||||
|
background-image: url(infoIcon.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
.logRow-warning {
|
||||||
|
background-color: cyan;
|
||||||
|
background-image: url(warningIcon.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
.logRow-error {
|
||||||
|
background-color: LightYellow;
|
||||||
|
background-image: url(errorIcon.png);
|
||||||
|
color: #f00;
|
||||||
|
}
|
||||||
|
|
||||||
|
.errorMessage {
|
||||||
|
vertical-align: top;
|
||||||
|
color: #f00;
|
||||||
|
}
|
||||||
|
|
||||||
|
.objectBox-sourceLink {
|
||||||
|
position: absolute;
|
||||||
|
right: 4px;
|
||||||
|
top: 2px;
|
||||||
|
padding-left: 8px;
|
||||||
|
font-family: Lucida Grande, sans-serif;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #0000FF;
|
||||||
|
}
|
||||||
|
|
||||||
|
/************************************************************************************************/
|
||||||
|
.logRow-group {
|
||||||
|
background: #EEEEEE;
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logGroup {
|
||||||
|
background: #EEEEEE;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logGroupBox {
|
||||||
|
margin-left: 24px;
|
||||||
|
border-top: 1px solid #D7D7D7;
|
||||||
|
border-left: 1px solid #D7D7D7;
|
||||||
|
}
|
||||||
|
|
||||||
|
/************************************************************************************************/
|
||||||
|
.selectorTag,.selectorId,.selectorClass {
|
||||||
|
font-family: Monaco, monospace;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.selectorTag {
|
||||||
|
color: #0000FF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.selectorId {
|
||||||
|
color: DarkBlue;
|
||||||
|
}
|
||||||
|
|
||||||
|
.selectorClass {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
/************************************************************************************************/
|
||||||
|
.objectBox-element {
|
||||||
|
font-family: Monaco, monospace;
|
||||||
|
color: #000088;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nodeChildren {
|
||||||
|
padding-left: 26px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nodeTag {
|
||||||
|
color: blue;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nodeValue {
|
||||||
|
color: #FF0000;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nodeText,.nodeComment {
|
||||||
|
margin: 0 2px;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nodeText {
|
||||||
|
color: #333333;
|
||||||
|
font-family: Monaco, monospace;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nodeComment {
|
||||||
|
color: DarkGreen;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
.nodeHidden, .nodeHidden * {
|
||||||
|
color: #888888;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nodeHidden .nodeTag {
|
||||||
|
color: #5F82D9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nodeHidden .nodeValue {
|
||||||
|
color: #D86060;
|
||||||
|
}
|
||||||
|
|
||||||
|
.selectedElement .nodeHidden, .selectedElement .nodeHidden * {
|
||||||
|
color: SkyBlue !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************************************/
|
||||||
|
.log-object {
|
||||||
|
/*
|
||||||
|
_position: relative;
|
||||||
|
_height: 100%;
|
||||||
|
/**/
|
||||||
|
}
|
||||||
|
|
||||||
|
.property {
|
||||||
|
position: relative;
|
||||||
|
clear: both;
|
||||||
|
height: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.propertyNameCell {
|
||||||
|
vertical-align: top;
|
||||||
|
float: left;
|
||||||
|
width: 28%;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
z-index: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.propertyValueCell {
|
||||||
|
float: right;
|
||||||
|
width: 68%;
|
||||||
|
background: #fff;
|
||||||
|
position: absolute;
|
||||||
|
padding-left: 5px;
|
||||||
|
display: table-cell;
|
||||||
|
right: 0;
|
||||||
|
z-index: 1;
|
||||||
|
/*
|
||||||
|
_position: relative;
|
||||||
|
/**/
|
||||||
|
}
|
||||||
|
|
||||||
|
.propertyName {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.FirebugPopup {
|
||||||
|
height: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.FirebugPopup #fbWindowButtons {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.FirebugPopup #fbHSplitter {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
20
vendor/firebug-lite/skin/xp/firebug.IE6.css
vendored
Executable file
@@ -0,0 +1,20 @@
|
|||||||
|
/************************************************************************************************/
|
||||||
|
#fbToolbarSearch {
|
||||||
|
background-image: url(search.gif) !important;
|
||||||
|
}
|
||||||
|
/************************************************************************************************/
|
||||||
|
.fbErrors {
|
||||||
|
background-image: url(errorIcon.gif) !important;
|
||||||
|
}
|
||||||
|
/************************************************************************************************/
|
||||||
|
.logRow-info {
|
||||||
|
background-image: url(infoIcon.gif) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logRow-warning {
|
||||||
|
background-image: url(warningIcon.gif) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logRow-error {
|
||||||
|
background-image: url(errorIcon.gif) !important;
|
||||||
|
}
|
||||||
3147
vendor/firebug-lite/skin/xp/firebug.css
vendored
Executable file
215
vendor/firebug-lite/skin/xp/firebug.html
vendored
Executable file
@@ -0,0 +1,215 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/DTD/strict.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
|
<title>Firebug Lite</title>
|
||||||
|
<!-- An empty script to avoid FOUC when loading the stylesheet -->
|
||||||
|
<script type="text/javascript"></script>
|
||||||
|
<style type="text/css" media="screen">@import "firebug.css";</style>
|
||||||
|
<style>html,body{margin:0;padding:0;overflow:hidden;}</style>
|
||||||
|
</head>
|
||||||
|
<body class="fbBody">
|
||||||
|
<table id="fbChrome" cellpadding="0" cellspacing="0" border="0">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<!-- Interface - Top Area -->
|
||||||
|
<td id="fbTop" colspan="2">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<div>
|
||||||
|
--><!-- <span id="fbToolbarErrors" class="fbErrors">2 errors</span> --><!--
|
||||||
|
<input type="text" id="fbToolbarSearch" />
|
||||||
|
</div>
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- Window Buttons -->
|
||||||
|
<div id="fbWindowButtons">
|
||||||
|
<a id="fbWindow_btDeactivate" class="fbSmallButton fbHover" title="Deactivate Firebug for this web page"> </a>
|
||||||
|
<a id="fbWindow_btDetach" class="fbSmallButton fbHover" title="Open Firebug in popup window"> </a>
|
||||||
|
<a id="fbWindow_btClose" class="fbSmallButton fbHover" title="Minimize Firebug"> </a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Toolbar buttons and Status Bar -->
|
||||||
|
<div id="fbToolbar">
|
||||||
|
<div id="fbToolbarContent">
|
||||||
|
|
||||||
|
<!-- Firebug Button -->
|
||||||
|
<span id="fbToolbarIcon">
|
||||||
|
<a id="fbFirebugButton" class="fbIconButton" class="fbHover" target="_blank"> </a>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<span id="fbLeftToolbarErrors" class="fbErrors">2 errors</span>
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- Toolbar Buttons -->
|
||||||
|
<span id="fbToolbarButtons">
|
||||||
|
<!-- Fixed Toolbar Buttons -->
|
||||||
|
<span id="fbFixedButtons">
|
||||||
|
<a id="fbChrome_btInspect" class="fbButton fbHover" title="Click an element in the page to inspect">Inspect</a>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<!-- Console Panel Toolbar Buttons -->
|
||||||
|
<span id="fbConsoleButtons" class="fbToolbarButtons">
|
||||||
|
<a id="fbConsole_btClear" class="fbButton fbHover" title="Clear the console">Clear</a>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<!-- HTML Panel Toolbar Buttons -->
|
||||||
|
<!--
|
||||||
|
<span id="fbHTMLButtons" class="fbToolbarButtons">
|
||||||
|
<a id="fbHTML_btEdit" class="fbHover" title="Edit this HTML">Edit</a>
|
||||||
|
</span>
|
||||||
|
-->
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<!-- Status Bar -->
|
||||||
|
<span id="fbStatusBarBox">
|
||||||
|
<span class="fbToolbarSeparator"></span>
|
||||||
|
<!-- HTML Panel Status Bar -->
|
||||||
|
<!--
|
||||||
|
<span id="fbHTMLStatusBar" class="fbStatusBar fbToolbarButtons">
|
||||||
|
</span>
|
||||||
|
-->
|
||||||
|
</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- PanelBars -->
|
||||||
|
<div id="fbPanelBarBox">
|
||||||
|
|
||||||
|
<!-- Main PanelBar -->
|
||||||
|
<div id="fbPanelBar1" class="fbPanelBar">
|
||||||
|
<a id="fbConsoleTab" class="fbTab fbHover">
|
||||||
|
<span class="fbTabL"></span>
|
||||||
|
<span class="fbTabText">Console</span>
|
||||||
|
<span class="fbTabMenuTarget"></span>
|
||||||
|
<span class="fbTabR"></span>
|
||||||
|
</a>
|
||||||
|
<a id="fbHTMLTab" class="fbTab fbHover">
|
||||||
|
<span class="fbTabL"></span>
|
||||||
|
<span class="fbTabText">HTML</span>
|
||||||
|
<span class="fbTabR"></span>
|
||||||
|
</a>
|
||||||
|
<a class="fbTab fbHover">
|
||||||
|
<span class="fbTabL"></span>
|
||||||
|
<span class="fbTabText">CSS</span>
|
||||||
|
<span class="fbTabR"></span>
|
||||||
|
</a>
|
||||||
|
<a class="fbTab fbHover">
|
||||||
|
<span class="fbTabL"></span>
|
||||||
|
<span class="fbTabText">Script</span>
|
||||||
|
<span class="fbTabR"></span>
|
||||||
|
</a>
|
||||||
|
<a class="fbTab fbHover">
|
||||||
|
<span class="fbTabL"></span>
|
||||||
|
<span class="fbTabText">DOM</span>
|
||||||
|
<span class="fbTabR"></span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Side PanelBars -->
|
||||||
|
<div id="fbPanelBar2Box" class="hide">
|
||||||
|
<div id="fbPanelBar2" class="fbPanelBar">
|
||||||
|
<!--
|
||||||
|
<a class="fbTab fbHover">
|
||||||
|
<span class="fbTabL"></span>
|
||||||
|
<span class="fbTabText">Style</span>
|
||||||
|
<span class="fbTabR"></span>
|
||||||
|
</a>
|
||||||
|
<a class="fbTab fbHover">
|
||||||
|
<span class="fbTabL"></span>
|
||||||
|
<span class="fbTabText">Layout</span>
|
||||||
|
<span class="fbTabR"></span>
|
||||||
|
</a>
|
||||||
|
<a class="fbTab fbHover">
|
||||||
|
<span class="fbTabL"></span>
|
||||||
|
<span class="fbTabText">DOM</span>
|
||||||
|
<span class="fbTabR"></span>
|
||||||
|
</a>
|
||||||
|
-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Horizontal Splitter -->
|
||||||
|
<div id="fbHSplitter"> </div>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<!-- Interface - Main Area -->
|
||||||
|
<tr id="fbContent">
|
||||||
|
|
||||||
|
<!-- Panels -->
|
||||||
|
<td id="fbPanelBox1">
|
||||||
|
<div id="fbPanel1" class="fbFitHeight">
|
||||||
|
<div id="fbConsole" class="fbPanel"></div>
|
||||||
|
<div id="fbHTML" class="fbPanel"></div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<!-- Side Panel Box -->
|
||||||
|
<td id="fbPanelBox2" class="hide">
|
||||||
|
|
||||||
|
<!-- VerticalSplitter -->
|
||||||
|
<div id="fbVSplitter" class="fbVSplitter"> </div>
|
||||||
|
|
||||||
|
<!-- Side Panels -->
|
||||||
|
<div id="fbPanel2" class="fbFitHeight">
|
||||||
|
|
||||||
|
<!-- HTML Side Panels -->
|
||||||
|
<div id="fbHTML_Style" class="fbPanel"></div>
|
||||||
|
<div id="fbHTML_Layout" class="fbPanel"></div>
|
||||||
|
<div id="fbHTML_DOM" class="fbPanel"></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Large Command Line -->
|
||||||
|
<textarea id="fbLargeCommandLine" class="fbFitHeight"></textarea>
|
||||||
|
|
||||||
|
<!-- Large Command Line Buttons -->
|
||||||
|
<div id="fbLargeCommandButtons">
|
||||||
|
<a id="fbCommand_btRun" class="fbButton fbHover">Run</a>
|
||||||
|
<a id="fbCommand_btClear" class="fbButton fbHover">Clear</a>
|
||||||
|
|
||||||
|
<a id="fbSmallCommandLineIcon" class="fbSmallButton fbHover"></a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<!-- Interface - Bottom Area -->
|
||||||
|
<tr id="fbBottom" class="hide">
|
||||||
|
|
||||||
|
<!-- Command Line -->
|
||||||
|
<td id="fbCommand" colspan="2">
|
||||||
|
<div id="fbCommandBox">
|
||||||
|
<div id="fbCommandIcon">>>></div>
|
||||||
|
<input id="fbCommandLine" name="fbCommandLine" type="text" />
|
||||||
|
<a id="fbLargeCommandLineIcon" class="fbSmallButton fbHover"></a>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<span id="fbMiniChrome">
|
||||||
|
<span id="fbMiniContent">
|
||||||
|
<span id="fbMiniIcon" title="Open Firebug Lite"></span>
|
||||||
|
<span id="fbMiniErrors" class="fbErrors"><!-- 2 errors --></span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
<!--
|
||||||
|
<div id="fbErrorPopup">
|
||||||
|
<div id="fbErrorPopupContent">
|
||||||
|
<div id="fbErrorIndicator" class="fbErrors">2 errors</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
-->
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
BIN
vendor/firebug-lite/skin/xp/firebug.png
vendored
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
vendor/firebug-lite/skin/xp/group.gif
vendored
Executable file
|
After Width: | Height: | Size: 158 B |
272
vendor/firebug-lite/skin/xp/html.css
vendored
Executable file
@@ -0,0 +1,272 @@
|
|||||||
|
/* See license.txt for terms of usage */
|
||||||
|
|
||||||
|
.panelNode-html {
|
||||||
|
-moz-box-sizing: padding-box;
|
||||||
|
padding: 4px 0 0 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nodeBox {
|
||||||
|
position: relative;
|
||||||
|
font-family: Monaco, monospace;
|
||||||
|
padding-left: 13px;
|
||||||
|
-moz-user-select: -moz-none;
|
||||||
|
}
|
||||||
|
.nodeBox.search-selection {
|
||||||
|
-moz-user-select: text;
|
||||||
|
}
|
||||||
|
.twisty {
|
||||||
|
position: absolute;
|
||||||
|
left: 0px;
|
||||||
|
top: 0px;
|
||||||
|
width: 14px;
|
||||||
|
height: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nodeChildBox {
|
||||||
|
margin-left: 12px;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nodeLabel,
|
||||||
|
.nodeCloseLabel {
|
||||||
|
margin: -2px 2px 0 2px;
|
||||||
|
border: 2px solid transparent;
|
||||||
|
-moz-border-radius: 3px;
|
||||||
|
padding: 0 2px;
|
||||||
|
color: #000088;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nodeCloseLabel {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nodeTag {
|
||||||
|
cursor: pointer;
|
||||||
|
color: blue;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nodeValue {
|
||||||
|
color: #FF0000;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nodeText,
|
||||||
|
.nodeComment {
|
||||||
|
margin: 0 2px;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nodeText {
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nodeWhiteSpace {
|
||||||
|
border: 1px solid LightGray;
|
||||||
|
white-space: pre; /* otherwise the border will be collapsed around zero pixels */
|
||||||
|
margin-left: 1px;
|
||||||
|
color: gray;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.nodeWhiteSpace_Space {
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nodeTextEntity {
|
||||||
|
border: 1px solid gray;
|
||||||
|
white-space: pre; /* otherwise the border will be collapsed around zero pixels */
|
||||||
|
margin-left: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nodeComment {
|
||||||
|
color: DarkGreen;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
.nodeBox.highlightOpen > .nodeLabel {
|
||||||
|
background-color: #EEEEEE;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nodeBox.highlightOpen > .nodeCloseLabel,
|
||||||
|
.nodeBox.highlightOpen > .nodeChildBox,
|
||||||
|
.nodeBox.open > .nodeCloseLabel,
|
||||||
|
.nodeBox.open > .nodeChildBox {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
.nodeBox.selected > .nodeLabel > .nodeLabelBox,
|
||||||
|
.nodeBox.selected > .nodeLabel {
|
||||||
|
border-color: Highlight;
|
||||||
|
background-color: Highlight;
|
||||||
|
color: HighlightText !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nodeBox.selected > .nodeLabel > .nodeLabelBox,
|
||||||
|
.nodeBox.selected > .nodeLabel > .nodeLabelBox > .nodeTag,
|
||||||
|
.nodeBox.selected > .nodeLabel > .nodeLabelBox > .nodeAttr > .nodeValue,
|
||||||
|
.nodeBox.selected > .nodeLabel > .nodeLabelBox > .nodeText {
|
||||||
|
color: inherit !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
.nodeBox.highlighted > .nodeLabel {
|
||||||
|
border-color: Highlight !important;
|
||||||
|
background-color: cyan !important;
|
||||||
|
color: #000000 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nodeBox.highlighted > .nodeLabel > .nodeLabelBox,
|
||||||
|
.nodeBox.highlighted > .nodeLabel > .nodeLabelBox > .nodeTag,
|
||||||
|
.nodeBox.highlighted > .nodeLabel > .nodeLabelBox > .nodeAttr > .nodeValue,
|
||||||
|
.nodeBox.highlighted > .nodeLabel > .nodeLabelBox > .nodeText {
|
||||||
|
color: #000000 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
.nodeBox.nodeHidden .nodeLabel > .nodeLabelBox,
|
||||||
|
.nodeBox.nodeHidden .nodeCloseLabel,
|
||||||
|
.nodeBox.nodeHidden .nodeLabel > .nodeLabelBox > .nodeText,
|
||||||
|
.nodeBox.nodeHidden .nodeText {
|
||||||
|
color: #888888;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nodeBox.nodeHidden .nodeLabel > .nodeLabelBox > .nodeTag,
|
||||||
|
.nodeBox.nodeHidden .nodeCloseLabel > .nodeCloseLabelBox > .nodeTag {
|
||||||
|
color: #5F82D9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nodeBox.nodeHidden .nodeLabel > .nodeLabelBox > .nodeAttr > .nodeValue {
|
||||||
|
color: #D86060;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nodeBox.nodeHidden.selected > .nodeLabel > .nodeLabelBox,
|
||||||
|
.nodeBox.nodeHidden.selected > .nodeLabel > .nodeLabelBox > .nodeTag,
|
||||||
|
.nodeBox.nodeHidden.selected > .nodeLabel > .nodeLabelBox > .nodeAttr > .nodeValue,
|
||||||
|
.nodeBox.nodeHidden.selected > .nodeLabel > .nodeLabelBox > .nodeText {
|
||||||
|
color: SkyBlue !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
.nodeBox.mutated > .nodeLabel,
|
||||||
|
.nodeAttr.mutated,
|
||||||
|
.nodeValue.mutated,
|
||||||
|
.nodeText.mutated,
|
||||||
|
.nodeBox.mutated > .nodeText {
|
||||||
|
background-color: #EFFF79;
|
||||||
|
color: #FF0000 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nodeBox.selected.mutated > .nodeLabel,
|
||||||
|
.nodeBox.selected.mutated > .nodeLabel > .nodeLabelBox,
|
||||||
|
.nodeBox.selected > .nodeLabel > .nodeLabelBox > .nodeAttr.mutated > .nodeValue,
|
||||||
|
.nodeBox.selected > .nodeLabel > .nodeLabelBox > .nodeAttr > .nodeValue.mutated,
|
||||||
|
.nodeBox.selected > .nodeLabel > .nodeLabelBox > .nodeText.mutated {
|
||||||
|
background-color: #EFFF79;
|
||||||
|
border-color: #EFFF79;
|
||||||
|
color: #FF0000 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/************************************************************************************************/
|
||||||
|
|
||||||
|
.logRow-dirxml {
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.soloElement > .nodeBox {
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.useA11y .nodeLabel.focused {
|
||||||
|
outline: 2px solid #FF9933;
|
||||||
|
-moz-outline-radius: 3px;
|
||||||
|
outline-offset: -2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.useA11y .nodeLabelBox:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/************************************************************************************************/
|
||||||
|
|
||||||
|
.breakpointCode .twisty {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.breakpointCode .nodeBox.containerNodeBox,
|
||||||
|
.breakpointCode .nodeLabel {
|
||||||
|
padding-left: 0px;
|
||||||
|
margin-left: 0px;
|
||||||
|
font-family: Monaco, monospace !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.breakpointCode .nodeTag,
|
||||||
|
.breakpointCode .nodeAttr,
|
||||||
|
.breakpointCode .nodeText,
|
||||||
|
.breakpointCode .nodeValue,
|
||||||
|
.breakpointCode .nodeLabel {
|
||||||
|
color: DarkGreen !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.breakpointMutationType {
|
||||||
|
position: absolute;
|
||||||
|
top: 4px;
|
||||||
|
right: 20px;
|
||||||
|
color: gray;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************************************/
|
||||||
|
/************************************************************************************************/
|
||||||
|
/************************************************************************************************/
|
||||||
|
/************************************************************************************************/
|
||||||
|
/************************************************************************************************/
|
||||||
|
/************************************************************************************************/
|
||||||
|
/************************************************************************************************/
|
||||||
|
/************************************************************************************************/
|
||||||
|
/************************************************************************************************/
|
||||||
|
/************************************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/************************************************************************************************/
|
||||||
|
/* Twisties */
|
||||||
|
|
||||||
|
.twisty,
|
||||||
|
.logRow-errorMessage > .hasTwisty > .errorTitle,
|
||||||
|
.logRow-log > .objectBox-array.hasTwisty,
|
||||||
|
.logRow-spy .spyHead .spyTitle,
|
||||||
|
.logGroup > .logRow,
|
||||||
|
.memberRow.hasChildren > .memberLabelCell > .memberLabel,
|
||||||
|
.hasHeaders .netHrefLabel,
|
||||||
|
.netPageRow > .netCol > .netPageTitle {
|
||||||
|
background-image: url(twistyClosed.png);
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: 2px 2px;
|
||||||
|
min-height: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logRow-errorMessage > .hasTwisty.opened > .errorTitle,
|
||||||
|
.logRow-log > .objectBox-array.hasTwisty.opened,
|
||||||
|
.logRow-spy.opened .spyHead .spyTitle,
|
||||||
|
.logGroup.opened > .logRow,
|
||||||
|
.memberRow.hasChildren.opened > .memberLabelCell > .memberLabel,
|
||||||
|
.nodeBox.highlightOpen > .nodeLabel > .twisty,
|
||||||
|
.nodeBox.open > .nodeLabel > .twisty,
|
||||||
|
.netRow.opened > .netCol > .netHrefLabel,
|
||||||
|
.netPageRow.opened > .netCol > .netPageTitle {
|
||||||
|
background-image: url(twistyOpen.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
.twisty {
|
||||||
|
background-position: 4px 4px;
|
||||||
|
}
|
||||||
BIN
vendor/firebug-lite/skin/xp/infoIcon.gif
vendored
Executable file
|
After Width: | Height: | Size: 359 B |
BIN
vendor/firebug-lite/skin/xp/infoIcon.png
vendored
Executable file
|
After Width: | Height: | Size: 524 B |
BIN
vendor/firebug-lite/skin/xp/loading_16.gif
vendored
Executable file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
vendor/firebug-lite/skin/xp/min.png
vendored
Executable file
|
After Width: | Height: | Size: 552 B |
BIN
vendor/firebug-lite/skin/xp/minHover.png
vendored
Executable file
|
After Width: | Height: | Size: 485 B |