Compare commits
1371 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba364547f9 | ||
|
|
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
|
||||||
6
.gitignore
vendored
@@ -1,2 +1,6 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
node_modules/
|
*.custom.*
|
||||||
|
*.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
|
|
||||||
16
.jamignore
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
.*
|
||||||
|
*.custom.*
|
||||||
|
*.d.ts
|
||||||
|
*.map
|
||||||
|
*.md
|
||||||
|
*.txt
|
||||||
|
build.js
|
||||||
|
index.js
|
||||||
|
bower.json
|
||||||
|
component.json
|
||||||
|
build
|
||||||
|
doc
|
||||||
|
node_modules
|
||||||
|
perf
|
||||||
|
test
|
||||||
|
vendor
|
||||||
28
.npmignore
@@ -1,5 +1,25 @@
|
|||||||
.*
|
.*
|
||||||
dist/*
|
*.custom.*
|
||||||
doc/*.php
|
*.d.ts
|
||||||
test/*.html
|
*.map
|
||||||
vendor/
|
*.md
|
||||||
|
bower.json
|
||||||
|
component.json
|
||||||
|
doc
|
||||||
|
node_modules
|
||||||
|
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
|
||||||
|
|||||||
20
.travis.yml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
language: node_js
|
||||||
|
node_js:
|
||||||
|
- 0.6
|
||||||
|
- 0.9
|
||||||
|
env:
|
||||||
|
- 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 49m30s"
|
||||||
|
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"
|
||||||
|
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
|
||||||
|
|||||||
274
README.md
@@ -1,104 +1,276 @@
|
|||||||
# Lo-Dash <sup>v0.1.0</sup>
|
# Lo-Dash <sup>v1.2.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.2.1/dist/lodash.js) and
|
||||||
|
[Production](https://raw.github.com/bestiejs/lodash/v1.2.1/dist/lodash.min.js)
|
||||||
|
|
||||||
## Documentation
|
* Lo-Dash compatibility builds (for legacy and modern environments):<br>
|
||||||
|
[Development](https://raw.github.com/bestiejs/lodash/v1.2.1/dist/lodash.compat.js) and
|
||||||
|
[Production](https://raw.github.com/bestiejs/lodash/v1.2.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.2.1/dist/lodash.underscore.js) and
|
||||||
|
[Production](https://raw.github.com/bestiejs/lodash/v1.2.1/dist/lodash.underscore.min.js)
|
||||||
|
|
||||||
Underscore's [documentation](http://documentcloud.github.com/underscore/) may also be used.
|
* CDN copies of ≤ v1.2.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.2.1/lodash.js),
|
||||||
|
[Lo-Dash prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.1/lodash.min.js),<br>
|
||||||
|
[Lo-Dash compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.1/lodash.compat.js),
|
||||||
|
[Lo-Dash compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.1/lodash.compat.min.js),<br>
|
||||||
|
[Underscore compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.1/lodash.underscore.js), and
|
||||||
|
[Underscore compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.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)
|
||||||
|
* [_.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~26, Firefox 2~20, IE 6-10, Opera 9.25~12, Safari 3-6, Node.js 0.4.8-0.10.5, 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 our [wiki entry](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.2.1</sup>
|
||||||
|
|
||||||
~~~ bash
|
* Added Component package support
|
||||||
git clone --recursive https://github.com/bestiejs/lodash.git
|
* Updated the build utility to work with changes in GitHub’s API
|
||||||
cd lodash.js
|
* Ensured `_.isPlainObject` works with objects created by `Object.create(null)`
|
||||||
~~~
|
* Ensured *“isType”* methods return `false` for subclassed values
|
||||||
|
* Ensured debounced functions, with `leading` and `trailing` calls enabled,<br>
|
||||||
|
only perform trailing calls after they’re called more than once
|
||||||
|
|
||||||
For older Git versions, just use:
|
The full changelog is available [here](https://github.com/bestiejs/lodash/wiki/Changelog).
|
||||||
|
|
||||||
~~~ bash
|
## BestieJS
|
||||||
git clone https://github.com/bestiejs/lodash.git
|
|
||||||
cd lodash
|
|
||||||
git submodule update --init
|
|
||||||
~~~
|
|
||||||
|
|
||||||
Feel free to fork and send pull requests if you see improvements!
|
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/) |
|
||||||
|
|||||||
23
bower.json
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"name": "lodash",
|
||||||
|
"version": "1.2.1",
|
||||||
|
"main": "./dist/lodash.compat.js",
|
||||||
|
"ignore": [
|
||||||
|
".*",
|
||||||
|
"*.custom.*",
|
||||||
|
"*.d.ts",
|
||||||
|
"*.map",
|
||||||
|
"*.md",
|
||||||
|
"*.txt",
|
||||||
|
"build.js",
|
||||||
|
"index.js",
|
||||||
|
"component.json",
|
||||||
|
"package.json",
|
||||||
|
"build",
|
||||||
|
"doc",
|
||||||
|
"node_modules",
|
||||||
|
"perf",
|
||||||
|
"test",
|
||||||
|
"vendor"
|
||||||
|
]
|
||||||
|
}
|
||||||
762
build/minify.js
Executable file
@@ -0,0 +1,762 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
;(function() {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
/** Load Node.js modules */
|
||||||
|
var https = require('https'),
|
||||||
|
spawn = require('child_process').spawn,
|
||||||
|
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 = '7815712f73ccb21f587bf3fb72a2f50be788515d';
|
||||||
|
|
||||||
|
/** The Git object ID of `uglifyjs.tar.gz` */
|
||||||
|
var uglifyId = 'fb620e8672ad194b3ab501790e19c40c8ac79286';
|
||||||
|
|
||||||
|
/** 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);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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,
|
||||||
|
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');
|
||||||
|
}
|
||||||
|
|
||||||
|
var compiler = spawn('java', ['-jar', closurePath].concat(options));
|
||||||
|
if (!this.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': true,
|
||||||
|
'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,62 @@
|
|||||||
;(function() {
|
;(function() {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
/** The Node filesystem module */
|
/** The Node.js filesystem module */
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
|
|
||||||
/** 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
|
// remove copyright header
|
||||||
var license = licenseTemplate.replace('@VERSION', (/VERSION:([\'"])(.*?)\1/).exec(source).pop());
|
source = source.replace(/^\/\**[\s\S]+?\*\/\n/, '');
|
||||||
// move vars exposed by Closure Compiler into the IIFE
|
|
||||||
source = source.replace(/^([^(\n]+)\s*(\(function[^)]+\){)/, '$2$1');
|
// correct overly aggressive Closure Compiler advanced optimization
|
||||||
// use double quotes consistently
|
source = source
|
||||||
source = source.replace(/'use strict'/, '"use strict"');
|
.replace(/(document[^&]+&&)\s*(?:\w+|!\d)/, '$1!({toString:0}+"")')
|
||||||
// add license
|
.replace(/"\t"/g, '"\\t"')
|
||||||
return license + '\n;' + source;
|
.replace(/"[^"]*?\\u180e[^"]*?"/g,
|
||||||
|
'" \\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"'
|
||||||
|
);
|
||||||
|
|
||||||
|
// 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 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;
|
||||||
|
}
|
||||||
|
// add new copyright header
|
||||||
|
var version = snippet[2];
|
||||||
|
source = licenseTemplate.replace('<%= VERSION %>', version) + '\n;' + source;
|
||||||
|
|
||||||
|
return source;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
@@ -38,13 +65,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,392 @@
|
|||||||
;(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',
|
|
||||||
'collection',
|
'collection',
|
||||||
'computed',
|
'ctor',
|
||||||
'concat',
|
'guard',
|
||||||
'current',
|
|
||||||
'false',
|
|
||||||
'funcClass',
|
|
||||||
'hasOwnProperty',
|
'hasOwnProperty',
|
||||||
'identity',
|
|
||||||
'index',
|
'index',
|
||||||
'indexOf',
|
'isArguments',
|
||||||
'Infinity',
|
|
||||||
'initial',
|
|
||||||
'isArray',
|
'isArray',
|
||||||
'isEmpty',
|
'isString',
|
||||||
|
'iterable',
|
||||||
'length',
|
'length',
|
||||||
|
'keys',
|
||||||
|
'lodash',
|
||||||
'object',
|
'object',
|
||||||
'Math',
|
'objectTypes',
|
||||||
'property',
|
'ownIndex',
|
||||||
|
'ownProps',
|
||||||
'result',
|
'result',
|
||||||
'slice',
|
'skipProto',
|
||||||
'source',
|
'source',
|
||||||
'stringClass',
|
'thisArg'
|
||||||
'target',
|
|
||||||
'thisArg',
|
|
||||||
'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',
|
'arrays',
|
||||||
'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',
|
||||||
|
'Function',
|
||||||
|
'Math',
|
||||||
|
'Number',
|
||||||
|
'Object',
|
||||||
|
'RegExp',
|
||||||
|
'String',
|
||||||
|
'TypeError',
|
||||||
|
'VERSION',
|
||||||
'_',
|
'_',
|
||||||
|
'__wrapped__',
|
||||||
|
'after',
|
||||||
|
'all',
|
||||||
'amd',
|
'amd',
|
||||||
'chain',
|
'any',
|
||||||
|
'argsClass',
|
||||||
|
'argsObject',
|
||||||
|
'assign',
|
||||||
|
'at',
|
||||||
|
'attachEvent',
|
||||||
|
'bind',
|
||||||
|
'bindAll',
|
||||||
|
'bindKey',
|
||||||
'clearTimeout',
|
'clearTimeout',
|
||||||
|
'clone',
|
||||||
|
'cloneDeep',
|
||||||
|
'collect',
|
||||||
|
'compact',
|
||||||
|
'compose',
|
||||||
|
'contains',
|
||||||
|
'countBy',
|
||||||
|
'createCallback',
|
||||||
'criteria',
|
'criteria',
|
||||||
|
'debounce',
|
||||||
|
'defaults',
|
||||||
|
'defer',
|
||||||
|
'delay',
|
||||||
|
'detect',
|
||||||
|
'difference',
|
||||||
|
'drop',
|
||||||
|
'each',
|
||||||
|
'enumPrototypes',
|
||||||
|
'environment',
|
||||||
'escape',
|
'escape',
|
||||||
'evaluate',
|
'evaluate',
|
||||||
|
'every',
|
||||||
|
'exports',
|
||||||
|
'extend',
|
||||||
|
'fastBind',
|
||||||
|
'fastKeys',
|
||||||
|
'filter',
|
||||||
|
'find',
|
||||||
|
'findIndex',
|
||||||
|
'findKey',
|
||||||
|
'first',
|
||||||
|
'flatten',
|
||||||
|
'foldl',
|
||||||
|
'foldr',
|
||||||
|
'forEach',
|
||||||
|
'forIn',
|
||||||
|
'forOwn',
|
||||||
|
'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',
|
||||||
|
'memoize',
|
||||||
|
'merge',
|
||||||
|
'methods',
|
||||||
|
'min',
|
||||||
|
'mixin',
|
||||||
|
'noConflict',
|
||||||
|
'nodeClass',
|
||||||
|
'nonEnumArgs',
|
||||||
|
'nonEnumShadows',
|
||||||
|
'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',
|
||||||
|
'support',
|
||||||
|
'tail',
|
||||||
|
'take',
|
||||||
|
'tap',
|
||||||
|
'template',
|
||||||
'templateSettings',
|
'templateSettings',
|
||||||
|
'throttle',
|
||||||
|
'times',
|
||||||
'toArray',
|
'toArray',
|
||||||
|
'trailing',
|
||||||
|
'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 |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 used by 'compareAscending' and `_.sortBy`
|
||||||
|
(function() {
|
||||||
|
var properties = ['criteria', 'index', 'value'],
|
||||||
|
snippets = source.match(/( +)function (?:compareAscending|sortBy)\b[\s\S]+?\n\1}/g);
|
||||||
|
|
||||||
|
if (!snippets) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
snippets.forEach(function(snippet) {
|
||||||
|
var modified = snippet;
|
||||||
|
|
||||||
|
// minify properties
|
||||||
|
properties.forEach(function(property, index) {
|
||||||
|
var minName = minNames[index],
|
||||||
|
reBracketProp = RegExp("\\['(" + property + ")'\\]", 'g'),
|
||||||
|
reDotProp = RegExp('\\.' + property + '\\b', 'g'),
|
||||||
|
rePropColon = RegExp("([^?\\s])\\s*([\"'])?\\b" + property + "\\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 the the `createIterator` function
|
||||||
|
'( +)function createIterator\\b[\\s\\S]+?\\n\\3}'
|
||||||
|
].join('|'), 'g')
|
||||||
|
);
|
||||||
|
|
||||||
|
// exit early if no compilable snippets
|
||||||
|
if (!snippets) {
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
|
||||||
|
snippets.forEach(function(snippet, index) {
|
||||||
|
var isCreateIterator = /function createIterator\b/.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
|
// minify `createIterator` option property names
|
||||||
compiledValues.forEach(function(value, index) {
|
iteratorOptions.forEach(function(property, index) {
|
||||||
result = result.replace(RegExp("'" + value + "'", 'g'), "'" + minNames[index] + "'");
|
var minName = minNames[index];
|
||||||
|
|
||||||
|
// minify variables in `iteratorTemplate` or property names in everything else
|
||||||
|
modified = isIteratorTemplate
|
||||||
|
? modified.replace(RegExp('\\b' + property + '\\b', 'g'), minName)
|
||||||
|
: modified.replace(RegExp("'" + property + "'", 'g'), "'" + minName + "'");
|
||||||
});
|
});
|
||||||
|
|
||||||
// minify iterationFactory option property strings
|
// minify snippet variables / arguments
|
||||||
iterationFactoryOptions.forEach(function(property, index) {
|
compiledVars.forEach(function(varName, index) {
|
||||||
if (property == 'array' || property == 'object') {
|
var minName = minNames[index];
|
||||||
result = result.replace(RegExp("'" + property + "'(\\s*[\\]:])", 'g'), "'" + minNames[index] + "'$1");
|
|
||||||
} else {
|
// minify variable names present in strings
|
||||||
result = result.replace(RegExp("'" + property + "'", 'g'), "'" + minNames[index] + "'");
|
if (isCreateIterator) {
|
||||||
|
modified = modified.replace(RegExp('(([\'"])[^\\n\\2]*?)\\b' + varName + '\\b(?=[^\\n\\2]*\\2[ ,+]+$)', 'gm'), '$1' + minName);
|
||||||
|
}
|
||||||
|
// ensure properties in compiled strings aren't minified
|
||||||
|
else {
|
||||||
|
modified = modified.replace(RegExp('([^.])\\b' + varName + '\\b(?!\' *[\\]:])', 'g'), '$1' + minName);
|
||||||
|
}
|
||||||
|
// correct `typeof` values
|
||||||
|
if (/^(?:boolean|function|object|number|string|undefined)$/.test(varName)) {
|
||||||
|
modified = modified.replace(RegExp("(typeof [^']+')" + minName + "'", 'g'), '$1' + varName + "'");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 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 +398,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.2.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"
|
||||||
|
]
|
||||||
|
}
|
||||||
5543
dist/lodash.compat.js
vendored
Normal file
47
dist/lodash.compat.min.js
vendored
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
/**
|
||||||
|
* @license
|
||||||
|
* Lo-Dash 1.2.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(r){function a(n){return n&&typeof n=="object"&&!me(n)&&Qt.call(n,"__wrapped__")?n:new V(n)}function R(n){var t=n.length,e=t>=l;if(e)for(var r={},u=-1;++u<t;){var a=f+n[u];(r[a]||(r[a]=[])).push(n[u])}return function(t){if(e){var u=f+t;return r[u]&&-1<_t(r[u],t)}return-1<_t(n,t)}}function T(n){return n.charCodeAt(0)}function D(n,t){var e=n.b,r=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1}return e<r?-1:1}function z(n,t,e,r){function u(){var r=arguments,l=o?this:t;
|
||||||
|
return a||(n=t[i]),e.length&&(r=r.length?(r=le.call(r),f?r.concat(e):e.concat(r)):e),this instanceof u?(G.prototype=n.prototype,l=new G,G.prototype=null,r=n.apply(l,r),et(r)?r:l):n.apply(l,r)}var a=tt(n),o=!e,i=t;if(o){var f=r;e=t}else if(!a){if(!r)throw new Dt;t=n}return u}function L(){for(var n,t={g:j,b:"k(m)",c:"",e:"m",f:"",h:"",i:!0,j:!!be},e=0;n=arguments[e];e++)for(var r in n)t[r]=n[r];if(n=t.a,t.d=/^[^,]+/.exec(n)[0],e=$t,r="var i,m="+t.d+",u="+t.e+";if(!m)return u;"+t.h+";",t.b?(r+="var n=m.length;i=-1;if("+t.b+"){",ve.unindexedChars&&(r+="if(l(m)){m=m.split('')}"),r+="while(++i<n){"+t.f+"}}else{"):ve.nonEnumArgs&&(r+="var n=m.length;i=-1;if(n&&j(m)){while(++i<n){i+='';"+t.f+"}}else{"),ve.enumPrototypes&&(r+="var v=typeof m=='function';"),t.i&&t.j)r+="var s=-1,t=r[typeof m]?o(m):[],n=t.length;while(++s<n){i=t[s];",ve.enumPrototypes&&(r+="if(!(v&&i=='prototype')){"),r+=t.f,ve.enumPrototypes&&(r+="}"),r+="}";
|
||||||
|
else if(r+="for(i in m){",(ve.enumPrototypes||t.i)&&(r+="if(",ve.enumPrototypes&&(r+="!(v&&i=='prototype')"),ve.enumPrototypes&&t.i&&(r+="&&"),t.i&&(r+="h.call(m,i)"),r+="){"),r+=t.f+";",(ve.enumPrototypes||t.i)&&(r+="}"),r+="}",ve.nonEnumShadows){r+="var f=m.constructor;";for(var u=0;7>u;u++)r+="i='"+t.g[u]+"';if(","constructor"==t.g[u]&&(r+="!(f&&f.prototype===m)&&"),r+="h.call(m,i)){"+t.f+"}"}return(t.b||ve.nonEnumArgs)&&(r+="}"),r+=t.c+";return u",e("h,j,k,l,o,p,r","return function("+n+"){"+r+"}")(Qt,W,me,ut,be,a,q)
|
||||||
|
}function K(n){return"\\"+B[n]}function M(n){return we[n]}function U(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function V(n){this.__wrapped__=n}function G(){}function H(n){var t=!1;if(!n||Zt.call(n)!=I||!ve.argsClass&&W(n))return t;var e=n.constructor;return(tt(e)?e instanceof e:ve.nodeClass||!U(n))?ve.ownLast?(xe(n,function(n,e,r){return t=Qt.call(r,e),!1}),!0===t):(xe(n,function(n,e){t=e}),!1===t||Qt.call(n,t)):t}function J(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);
|
||||||
|
var r=-1;e=e-t||0;for(var u=It(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function Q(n){return Ce[n]}function W(n){return Zt.call(n)==k}function X(n,t,r,u,o,i){var f=n;if(typeof t=="function"&&(u=r,r=t,t=!1),typeof r=="function"){if(r=typeof u=="undefined"?r:a.createCallback(r,u,1),f=r(f),typeof f!="undefined")return f;f=n}if(u=et(f)){var l=Zt.call(f);if(!$[l]||!ve.nodeClass&&U(f))return f;var c=me(f)}if(!u||!t)return u?c?J(f):je({},f):f;switch(u=se[l],l){case O:case E:return new u(+f);case A:case N:return new u(f);
|
||||||
|
case P:return u(f.source,y.exec(f))}for(o||(o=[]),i||(i=[]),l=o.length;l--;)if(o[l]==n)return i[l];return f=c?u(f.length):{},c&&(Qt.call(n,"index")&&(f.index=n.index),Qt.call(n,"input")&&(f.input=n.input)),o.push(n),i.push(f),(c?pt:Oe)(n,function(n,u){f[u]=X(n,t,r,e,o,i)}),f}function Y(n){var t=[];return xe(n,function(n,e){tt(n)&&t.push(e)}),t.sort()}function Z(n){for(var t=-1,e=be(n),r=e.length,u={};++t<r;){var a=e[t];u[n[a]]=a}return u}function nt(n,t,e,r,u,o){var f=e===i;if(typeof e=="function"&&!f){e=a.createCallback(e,r,2);
|
||||||
|
var l=e(n,t);if(typeof l!="undefined")return!!l}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!1;if(null==n||null==t)return n===t;if(p=Zt.call(n),c=Zt.call(t),p==k&&(p=I),c==k&&(c=I),p!=c)return!1;switch(p){case O:case E:return+n==+t;case A:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case P:case N:return n==Tt(t)}if(c=p==x,!c){if(Qt.call(n,"__wrapped__")||Qt.call(t,"__wrapped__"))return nt(n.__wrapped__||n,t.__wrapped__||t,e,r,u,o);
|
||||||
|
if(p!=I||!ve.nodeClass&&(U(n)||U(t)))return!1;var p=!ve.argsObject&&W(n)?Ft:n.constructor,s=!ve.argsObject&&W(t)?Ft:t.constructor;if(p!=s&&(!tt(p)||!(p instanceof p&&tt(s)&&s instanceof s)))return!1}for(u||(u=[]),o||(o=[]),p=u.length;p--;)if(u[p]==n)return o[p]==t;var v=0,l=!0;if(u.push(n),o.push(t),c){if(p=n.length,v=t.length,l=v==n.length,!l&&!f)return l;for(;v--;)if(c=p,s=t[v],f)for(;c--&&!(l=nt(n[c],s,e,r,u,o)););else if(!(l=nt(n[v],s,e,r,u,o)))break;return l}return xe(t,function(t,a,i){return Qt.call(i,a)?(v++,l=Qt.call(n,a)&&nt(n[a],t,e,r,u,o)):void 0
|
||||||
|
}),l&&!f&&xe(n,function(n,t,e){return Qt.call(e,t)?l=-1<--v:void 0}),l}function tt(n){return typeof n=="function"}function et(n){return n?q[typeof n]:!1}function rt(n){return typeof n=="number"||Zt.call(n)==A}function ut(n){return typeof n=="string"||Zt.call(n)==N}function at(n,t,e){var r=arguments,u=0,o=2;if(!et(n))return n;if(e===i)var f=r[3],l=r[4],c=r[5];else l=[],c=[],typeof e!="number"&&(o=r.length),3<o&&"function"==typeof r[o-2]?f=a.createCallback(r[--o-1],r[o--],2):2<o&&"function"==typeof r[o-1]&&(f=r[--o]);
|
||||||
|
for(;++u<o;)(me(r[u])?pt:Oe)(r[u],function(t,e){var r,u,a=t,o=n[e];if(t&&((u=me(t))||Ee(t))){for(a=l.length;a--;)if(r=l[a]==t){o=c[a];break}if(!r){var p;f&&(a=f(o,t),p=typeof a!="undefined")&&(o=a),p||(o=u?me(o)?o:[]:Ee(o)?o:{}),l.push(t),c.push(o),p||(o=at(o,t,i,f,l,c))}}else f&&(a=f(o,t),typeof a=="undefined"&&(a=t)),typeof a!="undefined"&&(o=a);n[e]=o});return n}function ot(n){for(var t=-1,e=be(n),r=e.length,u=It(r);++t<r;)u[t]=n[e[t]];return u}function it(n,t,e){var r=-1,u=n?n.length:0,a=!1;return e=(0>e?ae(0,u+e):e)||0,typeof u=="number"?a=-1<(ut(n)?n.indexOf(t,e):_t(n,t,e)):_e(n,function(n){return++r<e?void 0:!(a=n===t)
|
||||||
|
}),a}function ft(n,t,e){var r=!0;if(t=a.createCallback(t,e),me(n)){e=-1;for(var u=n.length;++e<u&&(r=!!t(n[e],e,n)););}else _e(n,function(n,e,u){return r=!!t(n,e,u)});return r}function lt(n,t,e){var r=[];if(t=a.createCallback(t,e),me(n)){e=-1;for(var u=n.length;++e<u;){var o=n[e];t(o,e,n)&&r.push(o)}}else _e(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function ct(n,t,e){if(t=a.createCallback(t,e),!me(n)){var r;return _e(n,function(n,e,u){return t(n,e,u)?(r=n,!1):void 0}),r}e=-1;for(var u=n.length;++e<u;){var o=n[e];
|
||||||
|
if(t(o,e,n))return o}}function pt(n,t,e){if(t&&typeof e=="undefined"&&me(n)){e=-1;for(var r=n.length;++e<r&&!1!==t(n[e],e,n););}else _e(n,t,e);return n}function st(n,t,e){var r=-1,u=n?n.length:0,o=It(typeof u=="number"?u:0);if(t=a.createCallback(t,e),me(n))for(;++r<u;)o[r]=t(n[r],r,n);else _e(n,function(n,e,u){o[++r]=t(n,e,u)});return o}function vt(n,t,e){var r=-1/0,u=r;if(!t&&me(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];i>u&&(u=i)}}else t=!t&&ut(n)?T:a.createCallback(t,e),_e(n,function(n,e,a){e=t(n,e,a),e>r&&(r=e,u=n)
|
||||||
|
});return u}function gt(n,t,e,r){var u=3>arguments.length;if(t=a.createCallback(t,r,4),me(n)){var o=-1,i=n.length;for(u&&(e=n[++o]);++o<i;)e=t(e,n[o],o,n)}else _e(n,function(n,r,a){e=u?(u=!1,n):t(e,n,r,a)});return e}function yt(n,t,e,r){var u=n,o=n?n.length:0,i=3>arguments.length;if(typeof o!="number")var f=be(n),o=f.length;else ve.unindexedChars&&ut(n)&&(u=n.split(""));return t=a.createCallback(t,r,4),pt(n,function(n,r,a){r=f?f[--o]:--o,e=i?(i=!1,u[r]):t(e,u[r],r,a)}),e}function ht(n,t,e){var r;
|
||||||
|
if(t=a.createCallback(t,e),me(n)){e=-1;for(var u=n.length;++e<u&&!(r=t(n[e],e,n)););}else _e(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function mt(n){for(var t=-1,e=n?n.length:0,r=Gt.apply(zt,le.call(arguments,1)),r=R(r),u=[];++t<e;){var a=n[t];r(a)||u.push(a)}return u}function dt(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&null!=t){var o=-1;for(t=a.createCallback(t,e);++o<u&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n[0];return J(n,0,oe(ae(0,r),u))}}function bt(n,t,e,r){var u=-1,o=n?n.length:0,i=[];
|
||||||
|
for(typeof t!="boolean"&&null!=t&&(r=e,e=t,t=!1),null!=e&&(e=a.createCallback(e,r));++u<o;)r=n[u],e&&(r=e(r,u,n)),me(r)?Wt.apply(i,t?r:bt(r)):i.push(r);return i}function _t(n,t,e){var r=-1,u=n?n.length:0;if(typeof e=="number")r=(0>e?ae(0,u+e):e||0)-1;else if(e)return r=Ct(n,t),n[r]===t?r:-1;for(;++r<u;)if(n[r]===t)return r;return-1}function wt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=a.createCallback(t,e);++u<o&&t(n[u],u,n);)r++}else r=null==t||e?1:ae(0,t);return J(n,r)
|
||||||
|
}function Ct(n,t,e,r){var u=0,o=n?n.length:u;for(e=e?a.createCallback(e,r,1):Et,t=e(t);u<o;)r=u+o>>>1,e(n[r])<t?u=r+1:o=r;return u}function jt(n,t,e,r){var u=-1,o=n?n.length:0,i=[],c=i;typeof t!="boolean"&&null!=t&&(r=e,e=t,t=!1);var p=!t&&o>=l;if(p)var s={};for(null!=e&&(c=[],e=a.createCallback(e,r));++u<o;){r=n[u];var v=e?e(r,u,n):r;if(p)var g=f+v,g=s[g]?!(c=s[g]):c=s[g]=[];(t?!u||c[c.length-1]!==v:g||0>_t(c,v))&&((e||p)&&c.push(v),i.push(r))}return i}function kt(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 xt(n,t){return ve.fastBind||ne&&2<arguments.length?ne.call.apply(ne,arguments):z(n,t,le.call(arguments,2))}function Ot(n){var t=le.call(arguments,1);return Yt(function(){n.apply(e,t)},1)}function Et(n){return n}function St(n){pt(Y(n),function(t){var e=a[t]=n[t];a.prototype[t]=function(){var n=this.__wrapped__,t=[n];return Wt.apply(t,arguments),t=e.apply(a,t),n&&typeof n=="object"&&n==t?this:new V(t)}})}function At(){return this.__wrapped__}r=r?F.defaults(n.Object(),r,F.pick(n,C)):n;
|
||||||
|
var It=r.Array,Pt=r.Boolean,Nt=r.Date,$t=r.Function,qt=r.Math,Bt=r.Number,Ft=r.Object,Rt=r.RegExp,Tt=r.String,Dt=r.TypeError,zt=It(),Lt=Ft(),Kt=r._,Mt=Rt("^"+Tt(Lt.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),Ut=qt.ceil,Vt=r.clearTimeout,Gt=zt.concat,Ht=qt.floor,Jt=Mt.test(Jt=Ft.getPrototypeOf)&&Jt,Qt=Lt.hasOwnProperty,Wt=zt.push,Xt=r.setImmediate,Yt=r.setTimeout,Zt=Lt.toString,ne=Mt.test(ne=Zt.bind)&&ne,te=Mt.test(te=It.isArray)&&te,ee=r.isFinite,re=r.isNaN,ue=Mt.test(ue=Ft.keys)&&ue,ae=qt.max,oe=qt.min,ie=r.parseInt,fe=qt.random,le=zt.slice,ce=Mt.test(r.attachEvent),pe=ne&&!/\n|true/.test(ne+ce),se={};
|
||||||
|
se[x]=It,se[O]=Pt,se[E]=Nt,se[I]=Ft,se[A]=Bt,se[P]=Rt,se[N]=Tt;var ve=a.support={};(function(){var n=function(){this.x=1},t={0:1,length:1},e=[];n.prototype={valueOf:1,y:1};for(var r in new n)e.push(r);for(r in arguments);ve.argsObject=arguments.constructor==Ft&&!(arguments instanceof It),ve.argsClass=W(arguments),ve.enumPrototypes=n.propertyIsEnumerable("prototype"),ve.fastBind=ne&&!pe,ve.ownLast="x"!=e[0],ve.nonEnumArgs=0!=r,ve.nonEnumShadows=!/valueOf/.test(e),ve.spliceObjects=(zt.splice.call(t,0,1),!t[0]),ve.unindexedChars="xx"!="x"[0]+Ft("x")[0];
|
||||||
|
try{ve.nodeClass=!(Zt.call(document)==I&&!({toString:0}+""))}catch(u){ve.nodeClass=!0}})(1),a.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:h,variable:"",imports:{_:a}};var ge={a:"q,w,g",h:"var a=arguments,b=0,c=typeof g=='number'?2:a.length;while(++b<c){m=a[b];if(m&&r[typeof m]){",f:"if(typeof u[i]=='undefined')u[i]=m[i]",c:"}}"},ye={a:"e,d,x",h:"d=d&&typeof x=='undefined'?d:p.createCallback(d,x)",b:"typeof n=='number'",f:"if(d(m[i],i,e)===false)return u"},he={h:"if(!r[typeof m])return u;"+ye.h,b:!1};
|
||||||
|
V.prototype=a.prototype,ve.argsClass||(W=function(n){return n?Qt.call(n,"callee"):!1});var me=te||function(n){return n?typeof n=="object"&&Zt.call(n)==x:!1},de=L({a:"q",e:"[]",h:"if(!(r[typeof q]))return u",f:"u.push(i)",b:!1}),be=ue?function(n){return et(n)?ve.enumPrototypes&&typeof n=="function"||ve.nonEnumArgs&&n.length&&W(n)?de(n):ue(n):[]}:de,_e=L(ye),we={"&":"&","<":"<",">":">",'"':""","'":"'"},Ce=Z(we),je=L(ge,{h:ge.h.replace(";",";if(c>3&&typeof a[c-2]=='function'){var d=p.createCallback(a[--c-1],a[c--],2);}else if(c>2&&typeof a[c-1]=='function'){d=a[--c];}"),f:"u[i]=d?d(u[i],m[i]):m[i]"}),ke=L(ge),xe=L(ye,he,{i:!1}),Oe=L(ye,he);
|
||||||
|
tt(/x/)&&(tt=function(n){return typeof n=="function"&&Zt.call(n)==S});var Ee=Jt?function(n){if(!n||Zt.call(n)!=I||!ve.argsClass&&W(n))return!1;var t=n.valueOf,e=typeof t=="function"&&(e=Jt(t))&&Jt(e);return e?n==e||Jt(n)==e:H(n)}:H;pe&&u&&typeof Xt=="function"&&(Ot=xt(Xt,r));var Se=8==ie(m+"08")?ie:function(n,t){return ie(ut(n)?n.replace(d,""):n,t||0)};return a.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},a.assign=je,a.at=function(n){var t=-1,e=Gt.apply(zt,le.call(arguments,1)),r=e.length,u=It(r);
|
||||||
|
for(ve.unindexedChars&&ut(n)&&(n=n.split(""));++t<r;)u[t]=n[e[t]];return u},a.bind=xt,a.bindAll=function(n){for(var t=1<arguments.length?Gt.apply(zt,le.call(arguments,1)):Y(n),e=-1,r=t.length;++e<r;){var u=t[e];n[u]=xt(n[u],n)}return n},a.bindKey=function(n,t){return z(n,t,le.call(arguments,2),i)},a.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},a.compose=function(){var n=arguments;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];
|
||||||
|
return t[0]}},a.countBy=function(n,t,e){var r={};return t=a.createCallback(t,e),pt(n,function(n,e,u){e=Tt(t(n,e,u)),Qt.call(r,e)?r[e]++:r[e]=1}),r},a.createCallback=function(n,t,e){if(null==n)return Et;var r=typeof n;if("function"!=r){if("object"!=r)return function(t){return t[n]};var u=be(n);return function(t){for(var e=u.length,r=!1;e--&&(r=nt(t[u[e]],n[u[e]],i)););return r}}return typeof t!="undefined"?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)}:n},a.debounce=function(n,t,e){function r(){a=f=null,l&&(o=n.apply(i,u))}var u,a,o,i,f,l=!0;if(!0===e)var c=!0,l=!1;else e&&q[typeof e]&&(c=e.leading,l="trailing"in e?e.trailing:l);return function(){return u=arguments,i=this,Vt(f),!a&&c?(a=!0,o=n.apply(i,u)):f=Yt(r,t),o}},a.defaults=ke,a.defer=Ot,a.delay=function(n,t){var r=le.call(arguments,2);return Yt(function(){n.apply(e,r)},t)},a.difference=mt,a.filter=lt,a.flatten=bt,a.forEach=pt,a.forIn=xe,a.forOwn=Oe,a.functions=Y,a.groupBy=function(n,t,e){var r={};
|
||||||
|
return t=a.createCallback(t,e),pt(n,function(n,e,u){e=Tt(t(n,e,u)),(Qt.call(r,e)?r[e]:r[e]=[]).push(n)}),r},a.initial=function(n,t,e){if(!n)return[];var r=0,u=n.length;if(typeof t!="number"&&null!=t){var o=u;for(t=a.createCallback(t,e);o--&&t(n[o],o,n);)r++}else r=null==t||e?1:t||r;return J(n,0,oe(ae(0,u-r),u))},a.intersection=function(n){var t=arguments,e=t.length,r={0:{}},u=-1,a=n?n.length:0,o=a>=l,i=[],c=i;n:for(;++u<a;){var p=n[u];if(o)var s=f+p,s=r[0][s]?!(c=r[0][s]):c=r[0][s]=[];if(s||0>_t(c,p)){o&&c.push(p);
|
||||||
|
for(var v=e;--v;)if(!(r[v]||(r[v]=R(t[v])))(p))continue n;i.push(p)}}return i},a.invert=Z,a.invoke=function(n,t){var e=le.call(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=It(typeof a=="number"?a:0);return pt(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},a.keys=be,a.map=st,a.max=vt,a.memoize=function(n,t){var e={};return function(){var r=f+(t?t.apply(this,arguments):arguments[0]);return Qt.call(e,r)?e[r]:e[r]=n.apply(this,arguments)}},a.merge=at,a.min=function(n,t,e){var r=1/0,u=r;
|
||||||
|
if(!t&&me(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];i<u&&(u=i)}}else t=!t&&ut(n)?T:a.createCallback(t,e),_e(n,function(n,e,a){e=t(n,e,a),e<r&&(r=e,u=n)});return u},a.omit=function(n,t,e){var r=typeof t=="function",u={};if(r)t=a.createCallback(t,e);else var o=Gt.apply(zt,le.call(arguments,1));return xe(n,function(n,e,a){(r?!t(n,e,a):0>_t(o,e))&&(u[e]=n)}),u},a.once=function(n){var t,e;return function(){return t?e:(t=!0,e=n.apply(this,arguments),n=null,e)}},a.pairs=function(n){for(var t=-1,e=be(n),r=e.length,u=It(r);++t<r;){var a=e[t];
|
||||||
|
u[t]=[a,n[a]]}return u},a.partial=function(n){return z(n,le.call(arguments,1))},a.partialRight=function(n){return z(n,le.call(arguments,1),null,i)},a.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,o=Gt.apply(zt,le.call(arguments,1)),i=et(n)?o.length:0;++u<i;){var f=o[u];f in n&&(r[f]=n[f])}else t=a.createCallback(t,e),xe(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},a.pluck=st,a.range=function(n,t,e){n=+n||0,e=+e||1,null==t&&(t=n,n=0);var r=-1;t=ae(0,Ut((t-n)/e));for(var u=It(t);++r<t;)u[r]=n,n+=e;
|
||||||
|
return u},a.reject=function(n,t,e){return t=a.createCallback(t,e),lt(n,function(n,e,r){return!t(n,e,r)})},a.rest=wt,a.shuffle=function(n){var t=-1,e=n?n.length:0,r=It(typeof e=="number"?e:0);return pt(n,function(n){var e=Ht(fe()*(++t+1));r[t]=r[e],r[e]=n}),r},a.sortBy=function(n,t,e){var r=-1,u=n?n.length:0,o=It(typeof u=="number"?u:0);for(t=a.createCallback(t,e),pt(n,function(n,e,u){o[++r]={a:t(n,e,u),b:r,c:n}}),u=o.length,o.sort(D);u--;)o[u]=o[u].c;return o},a.tap=function(n,t){return t(n),n},a.throttle=function(n,t,e){function r(){i=null,c&&(f=new Nt,a=n.apply(o,u))
|
||||||
|
}var u,a,o,i,f=0,l=!0,c=!0;return!1===e?l=!1:e&&q[typeof e]&&(l="leading"in e?e.leading:l,c="trailing"in e?e.trailing:c),function(){var e=new Nt;!i&&!l&&(f=e);var c=t-(e-f);return u=arguments,o=this,0<c?i||(i=Yt(r,c)):(Vt(i),i=null,f=e,a=n.apply(o,u)),a}},a.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=It(n);for(t=a.createCallback(t,e,1);++r<n;)u[r]=t(r);return u},a.toArray=function(n){return n&&typeof n.length=="number"?ve.unindexedChars&&ut(n)?n.split(""):J(n):ot(n)},a.union=function(n){return me(n)||(arguments[0]=n?le.call(n):zt),jt(Gt.apply(zt,arguments))
|
||||||
|
},a.uniq=jt,a.unzip=function(n){for(var t=-1,e=n?n.length:0,r=e?vt(st(n,"length")):0,u=It(r);++t<e;)for(var a=-1,o=n[t];++a<r;)(u[a]||(u[a]=It(e)))[t]=o[a];return u},a.values=ot,a.where=lt,a.without=function(n){return mt(n,le.call(arguments,1))},a.wrap=function(n,t){return function(){var e=[n];return Wt.apply(e,arguments),t.apply(this,e)}},a.zip=function(n){for(var t=-1,e=n?vt(st(arguments,"length")):0,r=It(e);++t<e;)r[t]=st(arguments,t);return r},a.zipObject=kt,a.collect=st,a.drop=wt,a.each=pt,a.extend=je,a.methods=Y,a.object=kt,a.select=lt,a.tail=wt,a.unique=jt,St(a),a.clone=X,a.cloneDeep=function(n,t,e){return X(n,!0,t,e)
|
||||||
|
},a.contains=it,a.escape=function(n){return null==n?"":Tt(n).replace(_,M)},a.every=ft,a.find=ct,a.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=a.createCallback(t,e);++r<u;)if(t(n[r],r,n))return r;return-1},a.findKey=function(n,t,e){var r;return t=a.createCallback(t,e),Oe(n,function(n,e,u){return t(n,e,u)?(r=e,!1):void 0}),r},a.has=function(n,t){return n?Qt.call(n,t):!1},a.identity=Et,a.indexOf=_t,a.isArguments=W,a.isArray=me,a.isBoolean=function(n){return!0===n||!1===n||Zt.call(n)==O},a.isDate=function(n){return n?typeof n=="object"&&Zt.call(n)==E:!1
|
||||||
|
},a.isElement=function(n){return n?1===n.nodeType:!1},a.isEmpty=function(n){var t=!0;if(!n)return t;var e=Zt.call(n),r=n.length;return e==x||e==N||(ve.argsClass?e==k:W(n))||e==I&&typeof r=="number"&&tt(n.splice)?!r:(Oe(n,function(){return t=!1}),t)},a.isEqual=nt,a.isFinite=function(n){return ee(n)&&!re(parseFloat(n))},a.isFunction=tt,a.isNaN=function(n){return rt(n)&&n!=+n},a.isNull=function(n){return null===n},a.isNumber=rt,a.isObject=et,a.isPlainObject=Ee,a.isRegExp=function(n){return n?q[typeof n]&&Zt.call(n)==P:!1
|
||||||
|
},a.isString=ut,a.isUndefined=function(n){return typeof n=="undefined"},a.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?ae(0,r+e):oe(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},a.mixin=St,a.noConflict=function(){return r._=Kt,this},a.parseInt=Se,a.random=function(n,t){return null==n&&null==t&&(t=1),n=+n||0,null==t&&(t=n,n=0),n+Ht(fe()*((+t||0)-n+1))},a.reduce=gt,a.reduceRight=yt,a.result=function(n,t){var r=n?n[t]:e;return tt(r)?n[t]():r},a.runInContext=t,a.size=function(n){var t=n?n.length:0;
|
||||||
|
return typeof t=="number"?t:be(n).length},a.some=ht,a.sortedIndex=Ct,a.template=function(n,t,r){var u=a.templateSettings;n||(n=""),r=ke({},r,u);var o,i=ke({},r.imports,u.imports),u=be(i),i=ot(i),f=0,l=r.interpolate||b,v="__p+='",l=Rt((r.escape||b).source+"|"+l.source+"|"+(l===h?g:b).source+"|"+(r.evaluate||b).source+"|$","g");n.replace(l,function(t,e,r,u,a,i){return r||(r=u),v+=n.slice(f,i).replace(w,K),e&&(v+="'+__e("+e+")+'"),a&&(o=!0,v+="';"+a+";__p+='"),r&&(v+="'+((__t=("+r+"))==null?'':__t)+'"),f=i+t.length,t
|
||||||
|
}),v+="';\n",l=r=r.variable,l||(r="obj",v="with("+r+"){"+v+"}"),v=(o?v.replace(c,""):v).replace(p,"$1").replace(s,"$1;"),v="function("+r+"){"+(l?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+v+"return __p}";try{var y=$t(u,"return "+v).apply(e,i)}catch(m){throw m.source=v,m}return t?y(t):(y.source=v,y)},a.unescape=function(n){return null==n?"":Tt(n).replace(v,Q)},a.uniqueId=function(n){var t=++o;return Tt(null==n?"":n)+t
|
||||||
|
},a.all=ft,a.any=ht,a.detect=ct,a.foldl=gt,a.foldr=yt,a.include=it,a.inject=gt,Oe(a,function(n,t){a.prototype[t]||(a.prototype[t]=function(){var t=[this.__wrapped__];return Wt.apply(t,arguments),n.apply(a,t)})}),a.first=dt,a.last=function(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&null!=t){var o=u;for(t=a.createCallback(t,e);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n[u-1];return J(n,ae(0,u-r))}},a.take=dt,a.head=dt,Oe(a,function(n,t){a.prototype[t]||(a.prototype[t]=function(t,e){var r=n(this.__wrapped__,t,e);
|
||||||
|
return null==t||e&&typeof t!="function"?r:new V(r)})}),a.VERSION="1.2.1",a.prototype.toString=function(){return Tt(this.__wrapped__)},a.prototype.value=At,a.prototype.valueOf=At,_e(["join","pop","shift"],function(n){var t=zt[n];a.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),_e(["push","reverse","sort","unshift"],function(n){var t=zt[n];a.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),_e(["concat","slice","splice"],function(n){var t=zt[n];a.prototype[n]=function(){return new V(t.apply(this.__wrapped__,arguments))
|
||||||
|
}}),ve.spliceObjects||_e(["pop","shift","splice"],function(n){var t=zt[n],e="splice"==n;a.prototype[n]=function(){var n=this.__wrapped__,r=t.apply(n,arguments);return 0===n.length&&delete n[0],e?new V(r):r}}),a}var e,r=typeof exports=="object"&&exports,u=typeof module=="object"&&module&&module.exports==r&&module,a=typeof global=="object"&&global;(a.global===a||a.window===a)&&(n=a);var o=0,i={},f=+new Date+"",l=200,c=/\b__p\+='';/g,p=/\b(__p\+=)''\+/g,s=/(__e\(.*?\)|\b__t\))\+'';/g,v=/&(?:amp|lt|gt|quot|#39);/g,g=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,y=/\w*$/,h=/<%=([\s\S]+?)%>/g,m=" \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",d=RegExp("^["+m+"]*0+(?=.$)"),b=/($^)/,_=/[&<>"']/g,w=/['\n\r\t\u2028\u2029\\]/g,C="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),j="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),k="[object Arguments]",x="[object Array]",O="[object Boolean]",E="[object Date]",S="[object Function]",A="[object Number]",I="[object Object]",P="[object RegExp]",N="[object String]",$={};
|
||||||
|
$[S]=!1,$[k]=$[x]=$[O]=$[E]=$[A]=$[I]=$[P]=$[N]=!0;var q={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},B={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},F=t();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=F,define(function(){return F})):r&&!r.nodeType?u?(u.exports=F)._=F:r._=F:n._=F})(this);
|
||||||
5264
dist/lodash.js
vendored
Normal file
44
dist/lodash.min.js
vendored
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
/**
|
||||||
|
* @license
|
||||||
|
* Lo-Dash 1.2.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(o){function f(n){if(!n||ue.call(n)!=A)return a;var t=n.valueOf,e=typeof t=="function"&&(e=Zt(t))&&Zt(e);return e?n==e||Zt(n)==e:Y(n)}function D(n,t,e){if(!n||!R[typeof n])return n;t=t&&typeof e=="undefined"?t:U.createCallback(t,e);for(var r=-1,u=R[typeof n]?be(n):[],o=u.length;++r<o&&(e=u[r],!(t(n[e],e,n)===a)););return n}function z(n,t,e){var r;if(!n||!R[typeof n])return n;t=t&&typeof e=="undefined"?t:U.createCallback(t,e);for(r in n)if(t(n[r],r,n)===a)break;return n}function P(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])&&R[typeof u]){var c=u.length;if(r=-1,me(u))for(;++r<c;)"undefined"==typeof a[r]&&(a[r]=u[r]);else for(var l=-1,p=R[typeof u]?be(u):[],c=p.length;++l<c;)r=p[l],"undefined"==typeof a[r]&&(a[r]=u[r])}return a}function K(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 c=U.createCallback(o[--f-1],o[f--],2);else 2<f&&"function"==typeof o[f-1]&&(c=o[--f]);
|
||||||
|
for(;++i<f;)if((u=o[i])&&R[typeof u]){var l=u.length;if(r=-1,me(u))for(;++r<l;)a[r]=c?c(a[r],u[r]):u[r];else for(var p=-1,s=R[typeof u]?be(u):[],l=s.length;++p<l;)r=s[p],a[r]=c?c(a[r],u[r]):u[r]}return a}function M(n){var t,e=[];if(!n||!R[typeof n])return e;for(t in n)ne.call(n,t)&&e.push(t);return e}function U(n){return n&&typeof n=="object"&&!me(n)&&ne.call(n,"__wrapped__")?n:new W(n)}function V(n){var t=n.length,e=t>=s;if(e)for(var r={},u=-1;++u<t;){var a=p+n[u];(r[a]||(r[a]=[])).push(n[u])}return function(t){if(e){var u=p+t;
|
||||||
|
return r[u]&&-1<xt(r[u],t)}return-1<xt(n,t)}}function G(n){return n.charCodeAt(0)}function H(n,t){var e=n.b,r=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1}return e<r?-1:1}function J(n,t,e,r){function a(){var r=arguments,l=i?this:t;return o||(n=t[f]),e.length&&(r=r.length?(r=ge.call(r),c?r.concat(e):e.concat(r)):e),this instanceof a?(X.prototype=n.prototype,l=new X,X.prototype=u,r=n.apply(l,r),ot(r)?r:l):n.apply(l,r)}var o=at(n),i=!e,f=t;if(i){var c=r;
|
||||||
|
e=t}else if(!o){if(!r)throw new Vt;t=n}return a}function L(n){return"\\"+T[n]}function Q(n){return de[n]}function W(n){this.__wrapped__=n}function X(){}function Y(n){var t=a;if(!n||ue.call(n)!=A)return t;var e=n.constructor;return(at(e)?e instanceof e:1)?(z(n,function(n,e){t=e}),t===a||ne.call(n,t)):t}function Z(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Rt(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function nt(n){return _e[n]}function tt(n,t,r,u,o,i){var f=n;if(typeof t=="function"&&(u=r,r=t,t=a),typeof r=="function"){if(r=typeof u=="undefined"?r:U.createCallback(r,u,1),f=r(f),typeof f!="undefined")return f;
|
||||||
|
f=n}if(u=ot(f)){var c=ue.call(f);if(!F[c])return f;var l=me(f)}if(!u||!t)return u?l?Z(f):K({},f):f;switch(u=ye[c],c){case I:case N:return new u(+f);case S:case B:return new u(f);case $:return u(f.source,b.exec(f))}for(o||(o=[]),i||(i=[]),c=o.length;c--;)if(o[c]==n)return i[c];return f=l?u(f.length):{},l&&(ne.call(n,"index")&&(f.index=n.index),ne.call(n,"input")&&(f.input=n.input)),o.push(n),i.push(f),(l?yt:D)(n,function(n,u){f[u]=tt(n,t,r,e,o,i)}),f}function et(n){var t=[];return z(n,function(n,e){at(n)&&t.push(e)
|
||||||
|
}),t.sort()}function rt(n){for(var t=-1,e=be(n),r=e.length,u={};++t<r;){var a=e[t];u[n[a]]=a}return u}function ut(n,t,e,o,i,f){var c=e===l;if(typeof e=="function"&&!c){e=U.createCallback(e,o,2);var p=e(n,t);if(typeof p!="undefined")return!!p}if(n===t)return 0!==n||1/n==1/t;var s=typeof n,v=typeof t;if(n===n&&(!n||"function"!=s&&"object"!=s)&&(!t||"function"!=v&&"object"!=v))return a;if(n==u||t==u)return n===t;if(v=ue.call(n),s=ue.call(t),v==O&&(v=A),s==O&&(s=A),v!=s)return a;switch(v){case I:case N:return+n==+t;
|
||||||
|
case S:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case $:case B:return n==Ut(t)}if(s=v==E,!s){if(ne.call(n,"__wrapped__")||ne.call(t,"__wrapped__"))return ut(n.__wrapped__||n,t.__wrapped__||t,e,o,i,f);if(v!=A)return a;var v=n.constructor,g=t.constructor;if(v!=g&&(!at(v)||!(v instanceof v&&at(g)&&g instanceof g)))return a}for(i||(i=[]),f||(f=[]),v=i.length;v--;)if(i[v]==n)return f[v]==t;var y=0,p=r;if(i.push(n),f.push(t),s){if(v=n.length,y=t.length,p=y==n.length,!p&&!c)return p;for(;y--;)if(s=v,g=t[y],c)for(;s--&&!(p=ut(n[s],g,e,o,i,f)););else if(!(p=ut(n[y],g,e,o,i,f)))break;
|
||||||
|
return p}return z(t,function(t,r,u){return ne.call(u,r)?(y++,p=ne.call(n,r)&&ut(n[r],t,e,o,i,f)):void 0}),p&&!c&&z(n,function(n,t,e){return ne.call(e,t)?p=-1<--y:void 0}),p}function at(n){return typeof n=="function"}function ot(n){return n?R[typeof n]:a}function it(n){return typeof n=="number"||ue.call(n)==S}function ft(n){return typeof n=="string"||ue.call(n)==B}function ct(n,t,e){var r=arguments,u=0,a=2;if(!ot(n))return n;if(e===l)var o=r[3],i=r[4],c=r[5];else i=[],c=[],typeof e!="number"&&(a=r.length),3<a&&"function"==typeof r[a-2]?o=U.createCallback(r[--a-1],r[a--],2):2<a&&"function"==typeof r[a-1]&&(o=r[--a]);
|
||||||
|
for(;++u<a;)(me(r[u])?yt:D)(r[u],function(t,e){var r,u,a=t,p=n[e];if(t&&((u=me(t))||f(t))){for(a=i.length;a--;)if(r=i[a]==t){p=c[a];break}if(!r){var s;o&&(a=o(p,t),s=typeof a!="undefined")&&(p=a),s||(p=u?me(p)?p:[]:f(p)?p:{}),i.push(t),c.push(p),s||(p=ct(p,t,l,o,i,c))}}else o&&(a=o(p,t),typeof a=="undefined"&&(a=t)),typeof a!="undefined"&&(p=a);n[e]=p});return n}function lt(n){for(var t=-1,e=be(n),r=e.length,u=Rt(r);++t<r;)u[t]=n[e[t]];return u}function pt(n,t,e){var r=-1,u=n?n.length:0,o=a;return e=(0>e?le(0,u+e):e)||0,typeof u=="number"?o=-1<(ft(n)?n.indexOf(t,e):xt(n,t,e)):D(n,function(n){return++r<e?void 0:!(o=n===t)
|
||||||
|
}),o}function st(n,t,e){var u=r;t=U.createCallback(t,e),e=-1;var a=n?n.length:0;if(typeof a=="number")for(;++e<a&&(u=!!t(n[e],e,n)););else D(n,function(n,e,r){return u=!!t(n,e,r)});return u}function vt(n,t,e){var r=[];t=U.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 gt(n,t,e){t=U.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,a):void 0
|
||||||
|
}),u}for(;++e<r;){var o=n[e];if(t(o,e,n))return o}}function yt(n,t,e){var r=-1,u=n?n.length:0;if(t=t&&typeof e=="undefined"?t:U.createCallback(t,e),typeof u=="number")for(;++r<u&&t(n[r],r,n)!==a;);else D(n,t);return n}function ht(n,t,e){var r=-1,u=n?n.length:0;if(t=U.createCallback(t,e),typeof u=="number")for(var a=Rt(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 mt(n,t,e){var r=-1/0,u=r;if(!t&&me(n)){e=-1;for(var a=n.length;++e<a;){var o=n[e];o>u&&(u=o)
|
||||||
|
}}else t=!t&&ft(n)?G:U.createCallback(t,e),yt(n,function(n,e,a){e=t(n,e,a),e>r&&(r=e,u=n)});return u}function bt(n,t){var e=-1,r=n?n.length:0;if(typeof r=="number")for(var u=Rt(r);++e<r;)u[e]=n[e][t];return u||ht(n,t)}function dt(n,t,e,r){if(!n)return e;var u=3>arguments.length;t=U.createCallback(t,r,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(e=n[++o]);++o<i;)e=t(e,n[o],o,n);else D(n,function(n,r,o){e=u?(u=a,n):t(e,n,r,o)});return e}function _t(n,t,e,r){var u=n?n.length:0,o=3>arguments.length;
|
||||||
|
if(typeof u!="number")var i=be(n),u=i.length;return t=U.createCallback(t,r,4),yt(n,function(r,f,c){f=i?i[--u]:--u,e=o?(o=a,n[f]):t(e,n[f],f,c)}),e}function kt(n,t,e){var r;t=U.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 wt(n){for(var t=-1,e=n?n.length:0,r=Xt.apply(Gt,ge.call(arguments,1)),r=V(r),u=[];++t<e;){var a=n[t];r(a)||u.push(a)}return u}function jt(n,t,e){if(n){var r=0,a=n.length;
|
||||||
|
if(typeof t!="number"&&t!=u){var o=-1;for(t=U.createCallback(t,e);++o<a&&t(n[o],o,n);)r++}else if(r=t,r==u||e)return n[0];return Z(n,0,pe(le(0,r),a))}}function Ct(n,t,e,r){var o=-1,i=n?n.length:0,f=[];for(typeof t!="boolean"&&t!=u&&(r=e,e=t,t=a),e!=u&&(e=U.createCallback(e,r));++o<i;)r=n[o],e&&(r=e(r,o,n)),me(r)?te.apply(f,t?r:Ct(r)):f.push(r);return f}function xt(n,t,e){var r=-1,u=n?n.length:0;if(typeof e=="number")r=(0>e?le(0,u+e):e||0)-1;else if(e)return r=Et(n,t),n[r]===t?r:-1;for(;++r<u;)if(n[r]===t)return r;
|
||||||
|
return-1}function Ot(n,t,e){if(typeof t!="number"&&t!=u){var r=0,a=-1,o=n?n.length:0;for(t=U.createCallback(t,e);++a<o&&t(n[a],a,n);)r++}else r=t==u||e?1:le(0,t);return Z(n,r)}function Et(n,t,e,r){var u=0,a=n?n.length:u;for(e=e?U.createCallback(e,r,1):$t,t=e(t);u<a;)r=u+a>>>1,e(n[r])<t?u=r+1:a=r;return u}function It(n,t,e,r){var o=-1,i=n?n.length:0,f=[],c=f;typeof t!="boolean"&&t!=u&&(r=e,e=t,t=a);var l=!t&&i>=s;if(l)var v={};for(e!=u&&(c=[],e=U.createCallback(e,r));++o<i;){r=n[o];var g=e?e(r,o,n):r;
|
||||||
|
if(l)var y=p+g,y=v[y]?!(c=v[y]):c=v[y]=[];(t?!o||c[c.length-1]!==g:y||0>xt(c,g))&&((e||l)&&c.push(g),f.push(r))}return f}function Nt(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 St(n,t){return he.fastBind||ae&&2<arguments.length?ae.call.apply(ae,arguments):J(n,t,ge.call(arguments,2))}function At(n){var t=ge.call(arguments,1);return re(function(){n.apply(e,t)},1)}function $t(n){return n}function Bt(n){yt(et(n),function(t){var e=U[t]=n[t];U.prototype[t]=function(){var n=this.__wrapped__,t=[n];
|
||||||
|
return te.apply(t,arguments),t=e.apply(U,t),n&&typeof n=="object"&&n==t?this:new W(t)}})}function Ft(){return this.__wrapped__}o=o?q.defaults(n.Object(),o,q.pick(n,x)):n;var Rt=o.Array,Tt=o.Boolean,qt=o.Date,Dt=o.Function,zt=o.Math,Pt=o.Number,Kt=o.Object,Mt=o.RegExp,Ut=o.String,Vt=o.TypeError,Gt=Rt(),Ht=Kt(),Jt=o._,Lt=Mt("^"+Ut(Ht.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),Qt=zt.ceil,Wt=o.clearTimeout,Xt=Gt.concat,Yt=zt.floor,Zt=Lt.test(Zt=Kt.getPrototypeOf)&&Zt,ne=Ht.hasOwnProperty,te=Gt.push,ee=o.setImmediate,re=o.setTimeout,ue=Ht.toString,ae=Lt.test(ae=ue.bind)&&ae,oe=Lt.test(oe=Rt.isArray)&&oe,ie=o.isFinite,fe=o.isNaN,ce=Lt.test(ce=Kt.keys)&&ce,le=zt.max,pe=zt.min,se=o.parseInt,ve=zt.random,ge=Gt.slice,zt=Lt.test(o.attachEvent),zt=ae&&!/\n|true/.test(ae+zt),ye={};
|
||||||
|
ye[E]=Rt,ye[I]=Tt,ye[N]=qt,ye[A]=Kt,ye[S]=Pt,ye[$]=Mt,ye[B]=Ut;var he=U.support={};he.fastBind=ae&&!zt,U.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:d,variable:"",imports:{_:U}},W.prototype=U.prototype;var me=oe,be=ce?function(n){return ot(n)?ce(n):[]}:M,de={"&":"&","<":"<",">":">",'"':""","'":"'"},_e=rt(de);return zt&&i&&typeof ee=="function"&&(At=St(ee,o)),Tt=8==se(_+"08")?se:function(n,t){return se(ft(n)?n.replace(k,""):n,t||0)},U.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0
|
||||||
|
}},U.assign=K,U.at=function(n){for(var t=-1,e=Xt.apply(Gt,ge.call(arguments,1)),r=e.length,u=Rt(r);++t<r;)u[t]=n[e[t]];return u},U.bind=St,U.bindAll=function(n){for(var t=1<arguments.length?Xt.apply(Gt,ge.call(arguments,1)):et(n),e=-1,r=t.length;++e<r;){var u=t[e];n[u]=St(n[u],n)}return n},U.bindKey=function(n,t){return J(n,t,ge.call(arguments,2),l)},U.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},U.compose=function(){var n=arguments;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];
|
||||||
|
return t[0]}},U.countBy=function(n,t,e){var r={};return t=U.createCallback(t,e),yt(n,function(n,e,u){e=Ut(t(n,e,u)),ne.call(r,e)?r[e]++:r[e]=1}),r},U.createCallback=function(n,t,e){if(n==u)return $t;var r=typeof n;if("function"!=r){if("object"!=r)return function(t){return t[n]};var o=be(n);return function(t){for(var e=o.length,r=a;e--&&(r=ut(t[o[e]],n[o[e]],l)););return r}}return typeof t!="undefined"?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)}:n},U.debounce=function(n,t,e){function o(){f=p=u,s&&(c=n.apply(l,i))}var i,f,c,l,p,s=r;if(e===r)var v=r,s=a;else e&&R[typeof e]&&(v=e.leading,s="trailing"in e?e.trailing:s);return function(){return i=arguments,l=this,Wt(p),!f&&v?(f=r,c=n.apply(l,i)):p=re(o,t),c}},U.defaults=P,U.defer=At,U.delay=function(n,t){var r=ge.call(arguments,2);return re(function(){n.apply(e,r)},t)},U.difference=wt,U.filter=vt,U.flatten=Ct,U.forEach=yt,U.forIn=z,U.forOwn=D,U.functions=et,U.groupBy=function(n,t,e){var r={};
|
||||||
|
return t=U.createCallback(t,e),yt(n,function(n,e,u){e=Ut(t(n,e,u)),(ne.call(r,e)?r[e]:r[e]=[]).push(n)}),r},U.initial=function(n,t,e){if(!n)return[];var r=0,a=n.length;if(typeof t!="number"&&t!=u){var o=a;for(t=U.createCallback(t,e);o--&&t(n[o],o,n);)r++}else r=t==u||e?1:t||r;return Z(n,0,pe(le(0,a-r),a))},U.intersection=function(n){var t=arguments,e=t.length,r={0:{}},u=-1,a=n?n.length:0,o=a>=s,i=[],f=i;n:for(;++u<a;){var c=n[u];if(o)var l=p+c,l=r[0][l]?!(f=r[0][l]):f=r[0][l]=[];if(l||0>xt(f,c)){o&&f.push(c);
|
||||||
|
for(var v=e;--v;)if(!(r[v]||(r[v]=V(t[v])))(c))continue n;i.push(c)}}return i},U.invert=rt,U.invoke=function(n,t){var e=ge.call(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=Rt(typeof a=="number"?a:0);return yt(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},U.keys=be,U.map=ht,U.max=mt,U.memoize=function(n,t){var e={};return function(){var r=p+(t?t.apply(this,arguments):arguments[0]);return ne.call(e,r)?e[r]:e[r]=n.apply(this,arguments)}},U.merge=ct,U.min=function(n,t,e){var r=1/0,u=r;
|
||||||
|
if(!t&&me(n)){e=-1;for(var a=n.length;++e<a;){var o=n[e];o<u&&(u=o)}}else t=!t&&ft(n)?G:U.createCallback(t,e),yt(n,function(n,e,a){e=t(n,e,a),e<r&&(r=e,u=n)});return u},U.omit=function(n,t,e){var r=typeof t=="function",u={};if(r)t=U.createCallback(t,e);else var a=Xt.apply(Gt,ge.call(arguments,1));return z(n,function(n,e,o){(r?!t(n,e,o):0>xt(a,e))&&(u[e]=n)}),u},U.once=function(n){var t,e;return function(){return t?e:(t=r,e=n.apply(this,arguments),n=u,e)}},U.pairs=function(n){for(var t=-1,e=be(n),r=e.length,u=Rt(r);++t<r;){var a=e[t];
|
||||||
|
u[t]=[a,n[a]]}return u},U.partial=function(n){return J(n,ge.call(arguments,1))},U.partialRight=function(n){return J(n,ge.call(arguments,1),u,l)},U.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,a=Xt.apply(Gt,ge.call(arguments,1)),o=ot(n)?a.length:0;++u<o;){var i=a[u];i in n&&(r[i]=n[i])}else t=U.createCallback(t,e),z(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},U.pluck=bt,U.range=function(n,t,e){n=+n||0,e=+e||1,t==u&&(t=n,n=0);var r=-1;t=le(0,Qt((t-n)/e));for(var a=Rt(t);++r<t;)a[r]=n,n+=e;
|
||||||
|
return a},U.reject=function(n,t,e){return t=U.createCallback(t,e),vt(n,function(n,e,r){return!t(n,e,r)})},U.rest=Ot,U.shuffle=function(n){var t=-1,e=n?n.length:0,r=Rt(typeof e=="number"?e:0);return yt(n,function(n){var e=Yt(ve()*(++t+1));r[t]=r[e],r[e]=n}),r},U.sortBy=function(n,t,e){var r=-1,u=n?n.length:0,a=Rt(typeof u=="number"?u:0);for(t=U.createCallback(t,e),yt(n,function(n,e,u){a[++r]={a:t(n,e,u),b:r,c:n}}),u=a.length,a.sort(H);u--;)a[u]=a[u].c;return a},U.tap=function(n,t){return t(n),n},U.throttle=function(n,t,e){function o(){l=u,v&&(p=new qt,f=n.apply(c,i))
|
||||||
|
}var i,f,c,l,p=0,s=r,v=r;return e===a?s=a:e&&R[typeof e]&&(s="leading"in e?e.leading:s,v="trailing"in e?e.trailing:v),function(){var e=new qt;!l&&!s&&(p=e);var r=t-(e-p);return i=arguments,c=this,0<r?l||(l=re(o,r)):(Wt(l),l=u,p=e,f=n.apply(c,i)),f}},U.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Rt(n);for(t=U.createCallback(t,e,1);++r<n;)u[r]=t(r);return u},U.toArray=function(n){return n&&typeof n.length=="number"?Z(n):lt(n)},U.union=function(n){return me(n)||(arguments[0]=n?ge.call(n):Gt),It(Xt.apply(Gt,arguments))
|
||||||
|
},U.uniq=It,U.unzip=function(n){for(var t=-1,e=n?n.length:0,r=e?mt(bt(n,"length")):0,u=Rt(r);++t<e;)for(var a=-1,o=n[t];++a<r;)(u[a]||(u[a]=Rt(e)))[t]=o[a];return u},U.values=lt,U.where=vt,U.without=function(n){return wt(n,ge.call(arguments,1))},U.wrap=function(n,t){return function(){var e=[n];return te.apply(e,arguments),t.apply(this,e)}},U.zip=function(n){for(var t=-1,e=n?mt(bt(arguments,"length")):0,r=Rt(e);++t<e;)r[t]=bt(arguments,t);return r},U.zipObject=Nt,U.collect=ht,U.drop=Ot,U.each=yt,U.extend=K,U.methods=et,U.object=Nt,U.select=vt,U.tail=Ot,U.unique=It,Bt(U),U.clone=tt,U.cloneDeep=function(n,t,e){return tt(n,r,t,e)
|
||||||
|
},U.contains=pt,U.escape=function(n){return n==u?"":Ut(n).replace(j,Q)},U.every=st,U.find=gt,U.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=U.createCallback(t,e);++r<u;)if(t(n[r],r,n))return r;return-1},U.findKey=function(n,t,e){var r;return t=U.createCallback(t,e),D(n,function(n,e,u){return t(n,e,u)?(r=e,a):void 0}),r},U.has=function(n,t){return n?ne.call(n,t):a},U.identity=$t,U.indexOf=xt,U.isArguments=function(n){return ue.call(n)==O},U.isArray=me,U.isBoolean=function(n){return n===r||n===a||ue.call(n)==I
|
||||||
|
},U.isDate=function(n){return n?typeof n=="object"&&ue.call(n)==N:a},U.isElement=function(n){return n?1===n.nodeType:a},U.isEmpty=function(n){var t=r;if(!n)return t;var e=ue.call(n),u=n.length;return e==E||e==B||e==O||e==A&&typeof u=="number"&&at(n.splice)?!u:(D(n,function(){return t=a}),t)},U.isEqual=ut,U.isFinite=function(n){return ie(n)&&!fe(parseFloat(n))},U.isFunction=at,U.isNaN=function(n){return it(n)&&n!=+n},U.isNull=function(n){return n===u},U.isNumber=it,U.isObject=ot,U.isPlainObject=f,U.isRegExp=function(n){return n?typeof n=="object"&&ue.call(n)==$:a
|
||||||
|
},U.isString=ft,U.isUndefined=function(n){return typeof n=="undefined"},U.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?le(0,r+e):pe(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},U.mixin=Bt,U.noConflict=function(){return o._=Jt,this},U.parseInt=Tt,U.random=function(n,t){return n==u&&t==u&&(t=1),n=+n||0,t==u&&(t=n,n=0),n+Yt(ve()*((+t||0)-n+1))},U.reduce=dt,U.reduceRight=_t,U.result=function(n,t){var r=n?n[t]:e;return at(r)?n[t]():r},U.runInContext=t,U.size=function(n){var t=n?n.length:0;
|
||||||
|
return typeof t=="number"?t:be(n).length},U.some=kt,U.sortedIndex=Et,U.template=function(n,t,u){var a=U.templateSettings;n||(n=""),u=P({},u,a);var o,i=P({},u.imports,a.imports),a=be(i),i=lt(i),f=0,c=u.interpolate||w,l="__p+='",c=Mt((u.escape||w).source+"|"+c.source+"|"+(c===d?m:w).source+"|"+(u.evaluate||w).source+"|$","g");n.replace(c,function(t,e,u,a,i,c){return u||(u=a),l+=n.slice(f,c).replace(C,L),e&&(l+="'+__e("+e+")+'"),i&&(o=r,l+="';"+i+";__p+='"),u&&(l+="'+((__t=("+u+"))==null?'':__t)+'"),f=c+t.length,t
|
||||||
|
}),l+="';\n",c=u=u.variable,c||(u="obj",l="with("+u+"){"+l+"}"),l=(o?l.replace(v,""):l).replace(g,"$1").replace(y,"$1;"),l="function("+u+"){"+(c?"":u+"||("+u+"={});")+"var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";try{var p=Dt(a,"return "+l).apply(e,i)}catch(s){throw s.source=l,s}return t?p(t):(p.source=l,p)},U.unescape=function(n){return n==u?"":Ut(n).replace(h,nt)},U.uniqueId=function(n){var t=++c;return Ut(n==u?"":n)+t
|
||||||
|
},U.all=st,U.any=kt,U.detect=gt,U.foldl=dt,U.foldr=_t,U.include=pt,U.inject=dt,D(U,function(n,t){U.prototype[t]||(U.prototype[t]=function(){var t=[this.__wrapped__];return te.apply(t,arguments),n.apply(U,t)})}),U.first=jt,U.last=function(n,t,e){if(n){var r=0,a=n.length;if(typeof t!="number"&&t!=u){var o=a;for(t=U.createCallback(t,e);o--&&t(n[o],o,n);)r++}else if(r=t,r==u||e)return n[a-1];return Z(n,le(0,a-r))}},U.take=jt,U.head=jt,D(U,function(n,t){U.prototype[t]||(U.prototype[t]=function(t,e){var r=n(this.__wrapped__,t,e);
|
||||||
|
return t==u||e&&typeof t!="function"?r:new W(r)})}),U.VERSION="1.2.1",U.prototype.toString=function(){return Ut(this.__wrapped__)},U.prototype.value=Ft,U.prototype.valueOf=Ft,yt(["join","pop","shift"],function(n){var t=Gt[n];U.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),yt(["push","reverse","sort","unshift"],function(n){var t=Gt[n];U.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),yt(["concat","slice","splice"],function(n){var t=Gt[n];U.prototype[n]=function(){return new W(t.apply(this.__wrapped__,arguments))
|
||||||
|
}}),U}var e,r=!0,u=null,a=!1,o=typeof exports=="object"&&exports,i=typeof module=="object"&&module&&module.exports==o&&module,f=typeof global=="object"&&global;(f.global===f||f.window===f)&&(n=f);var c=0,l={},p=+new Date+"",s=200,v=/\b__p\+='';/g,g=/\b(__p\+=)''\+/g,y=/(__e\(.*?\)|\b__t\))\+'';/g,h=/&(?:amp|lt|gt|quot|#39);/g,m=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,b=/\w*$/,d=/<%=([\s\S]+?)%>/g,_=" \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",k=RegExp("^["+_+"]*0+(?=.$)"),w=/($^)/,j=/[&<>"']/g,C=/['\n\r\t\u2028\u2029\\]/g,x="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),O="[object Arguments]",E="[object Array]",I="[object Boolean]",N="[object Date]",S="[object Number]",A="[object Object]",$="[object RegExp]",B="[object String]",F={"[object Function]":a};
|
||||||
|
F[O]=F[E]=F[I]=F[N]=F[S]=F[A]=F[$]=F[B]=r;var R={"boolean":a,"function":r,object:r,number:a,string:a,undefined:a},T={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},q=t();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=q,define(function(){return q})):o&&!o.nodeType?i?(i.exports=q)._=q:o._=q:n._=q})(this);
|
||||||
4407
dist/lodash.underscore.js
vendored
Normal file
35
dist/lodash.underscore.min.js
vendored
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
/**
|
||||||
|
* @license
|
||||||
|
* Lo-Dash 1.2.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){return n instanceof t?n:new i(n)}function r(n,t){var r=n.b,e=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1}return r<e?-1:1}function e(n,t,r,e){function u(){var e=arguments,c=i?this:t;return o||(n=t[f]),r.length&&(e=e.length?(e=Bt.call(e),l?e.concat(r):r.concat(e)):r),this instanceof u?(a.prototype=n.prototype,c=new a,a.prototype=null,e=n.apply(c,e),m(e)?e:c):n.apply(c,e)}var o=y(n),i=!r,f=t;if(i){var l=e;r=t}else if(!o){if(!e)throw new TypeError;
|
||||||
|
t=n}return u}function u(n){return"\\"+lt[n]}function o(n){return Dt[n]}function i(n){this.__wrapped__=n}function a(){}function f(n){return Mt[n]}function l(n){return dt.call(n)==nt}function c(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 p(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)null==n[u]&&(n[u]=e[u])}return n}function s(n){var t=[];return Tt(n,function(n,r){y(n)&&t.push(r)
|
||||||
|
}),t.sort()}function v(n){for(var t=-1,r=Rt(n),e=r.length,u={};++t<e;){var o=r[t];u[n[o]]=o}return u}function g(n){if(!n)return!0;if(Ft(n)||b(n))return!n.length;for(var t in n)if(mt.call(n,t))return!1;return!0}function h(n,r,e,u){if(n===r)return 0!==n||1/n==1/r;var o=typeof n,i=typeof r;if(n===n&&(!n||"function"!=o&&"object"!=o)&&(!r||"function"!=i&&"object"!=i))return!1;if(null==n||null==r)return n===r;if(i=dt.call(n),o=dt.call(r),i!=o)return!1;switch(i){case rt:case et:return+n==+r;case ut:return n!=+n?r!=+r:0==n?1/n==1/r:n==+r;
|
||||||
|
case it:case at:return n==r+""}if(o=i==tt,!o){if(n instanceof t||r instanceof t)return h(n.__wrapped__||n,r.__wrapped__||r,e,u);if(i!=ot)return!1;var i=n.constructor,a=r.constructor;if(i!=a&&(!y(i)||!(i instanceof i&&y(a)&&a instanceof a)))return!1}for(e||(e=[]),u||(u=[]),i=e.length;i--;)if(e[i]==n)return u[i]==r;var f=!0,l=0;if(e.push(n),u.push(r),o){if(l=r.length,f=l==n.length)for(;l--&&(f=h(n[l],r[l],e,u)););return f}return Tt(r,function(t,r,o){return mt.call(o,r)?(l++,!(f=mt.call(n,r)&&h(n[r],t,e,u))&&K):void 0
|
||||||
|
}),f&&Tt(n,function(n,t,r){return mt.call(r,t)?!(f=-1<--l)&&K:void 0}),f}function y(n){return typeof n=="function"}function m(n){return n?ft[typeof n]:!1}function _(n){return typeof n=="number"||dt.call(n)==ut}function b(n){return typeof n=="string"||dt.call(n)==at}function d(n){for(var t=-1,r=Rt(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function j(n,t){var r=!1;return typeof(n?n.length:0)=="number"?r=-1<T(n,t):$t(n,function(n){return(r=n===t)&&K}),r}function w(n,t,r){var e=!0;t=P(t,r),r=-1;
|
||||||
|
var u=n?n.length:0;if(typeof u=="number")for(;++r<u&&(e=!!t(n[r],r,n)););else $t(n,function(n,r,u){return!(e=!!t(n,r,u))&&K});return e}function A(n,t,r){var e=[];t=P(t,r),r=-1;var u=n?n.length:0;if(typeof u=="number")for(;++r<u;){var o=n[r];t(o,r,n)&&e.push(o)}else $t(n,function(n,r,u){t(n,r,u)&&e.push(n)});return e}function x(n,t,r){t=P(t,r),r=-1;var e=n?n.length:0;if(typeof e!="number"){var u;return $t(n,function(n,r,e){return t(n,r,e)?(u=n,K):void 0}),u}for(;++r<e;){var o=n[r];if(t(o,r,n))return o
|
||||||
|
}}function E(n,t,r){var e=-1,u=n?n.length:0;if(t=t&&typeof r=="undefined"?t:P(t,r),typeof u=="number")for(;++e<u&&t(n[e],e,n)!==K;);else $t(n,t)}function O(n,t,r){var e=-1,u=n?n.length:0;if(t=P(t,r),typeof u=="number")for(var o=Array(u);++e<u;)o[e]=t(n[e],e,n);else o=[],$t(n,function(n,r,u){o[++e]=t(n,r,u)});return o}function S(n,t,r){var e=-1/0,u=e,o=-1,i=n?n.length:0;if(t||typeof i!="number")t=P(t,r),E(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 N(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||O(n,t)}function B(n,t,r,e){if(!n)return r;var u=3>arguments.length;t=P(t,e,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(r=n[++o]);++o<i;)r=t(r,n[o],o,n);else $t(n,function(n,e,o){r=u?(u=!1,n):t(r,n,e,o)});return r}function k(n,t,r,e){var u=n?n.length:0,o=3>arguments.length;if(typeof u!="number")var i=Rt(n),u=i.length;return t=P(t,e,4),E(n,function(e,a,f){a=i?i[--u]:--u,r=o?(o=!1,n[a]):t(r,n[a],a,f)}),r}function q(n,t,r){var e;
|
||||||
|
t=P(t,r),r=-1;var u=n?n.length:0;if(typeof u=="number")for(;++r<u&&!(e=t(n[r],r,n)););else $t(n,function(n,r,u){return(e=t(n,r,u))&&K});return!!e}function F(n,t,r){return r&&g(t)?null:(r?x:A)(n,t)}function R(n){for(var t=-1,r=n.length,e=ht.apply(ct,Bt.call(arguments,1)),u=[];++t<r;){var o=n[t];0>T(e,o)&&u.push(o)}return u}function D(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&null!=t){var o=-1;for(t=P(t,r);++o<u&&t(n[o],o,n);)e++}else if(e=t,null==e||r)return n[0];return Bt.call(n,0,St(Ot(0,e),u))
|
||||||
|
}}function M(n,t){for(var r=-1,e=n?n.length:0,u=[];++r<e;){var o=n[r];Ft(o)?_t.apply(u,t?o:M(o)):u.push(o)}return u}function T(n,t,r){var e=-1,u=n?n.length:0;if(typeof r=="number")e=(0>r?Ot(0,u+r):r||0)-1;else if(r)return e=I(n,t),n[e]===t?e:-1;for(;++e<u;)if(n[e]===t)return e;return-1}function $(n,t,r){if(typeof t!="number"&&null!=t){var e=0,u=-1,o=n?n.length:0;for(t=P(t,r);++u<o&&t(n[u],u,n);)e++}else e=null==t||r?1:Ot(0,t);return Bt.call(n,e)}function I(n,t,r,e){var u=0,o=n?n.length:u;for(r=r?P(r,e,1):U,t=r(t);u<o;)e=u+o>>>1,r(n[e])<t?u=e+1:o=e;
|
||||||
|
return u}function z(n,t,r,e){var u=-1,o=n?n.length:0,i=[],a=i;for(typeof t!="boolean"&&null!=t&&(e=r,r=t,t=!1),null!=r&&(a=[],r=P(r,e));++u<o;){e=n[u];var f=r?r(e,u,n):e;(t?!u||a[a.length-1]!==f:0>T(a,f))&&(r&&a.push(f),i.push(e))}return i}function C(n,t){return qt.fastBind||jt&&2<arguments.length?jt.call.apply(jt,arguments):e(n,t,Bt.call(arguments,2))}function P(n,t,r){if(null==n)return U;var e=typeof n;if("function"!=e){if("object"!=e)return function(t){return t[n]};var u=Rt(n);return function(t){for(var r=u.length,e=!1;r--&&(e=t[u[r]]===n[u[r]]););return e
|
||||||
|
}}return typeof t!="undefined"?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)}:n}function U(n){return n}function V(n){E(s(n),function(r){var e=t[r]=n[r];t.prototype[r]=function(){var n=[this.__wrapped__];return _t.apply(n,arguments),n=e.apply(t,n),this.__chain__&&(n=new i(n),n.__chain__=!0),n}})}var W=typeof exports=="object"&&exports,G=typeof module=="object"&&module&&module.exports==W&&module,H=typeof global=="object"&&global;
|
||||||
|
(H.global===H||H.window===H)&&(n=H);var J=0,K={},L=+new Date+"",Q=/&(?:amp|lt|gt|quot|#39);/g,X=/($^)/,Y=/[&<>"']/g,Z=/['\n\r\t\u2028\u2029\\]/g,nt="[object Arguments]",tt="[object Array]",rt="[object Boolean]",et="[object Date]",ut="[object Number]",ot="[object Object]",it="[object RegExp]",at="[object String]",ft={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},lt={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},ct=[],H={},pt=n._,st=RegExp("^"+(H.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),vt=Math.ceil,gt=n.clearTimeout,ht=ct.concat,yt=Math.floor,mt=H.hasOwnProperty,_t=ct.push,bt=n.setTimeout,dt=H.toString,jt=st.test(jt=dt.bind)&&jt,wt=st.test(wt=Array.isArray)&&wt,At=n.isFinite,xt=n.isNaN,Et=st.test(Et=Object.keys)&&Et,Ot=Math.max,St=Math.min,Nt=Math.random,Bt=ct.slice,H=st.test(n.attachEvent),kt=jt&&!/\n|true/.test(jt+H),qt={};
|
||||||
|
(function(){var n={0:1,length:1};qt.fastBind=jt&&!kt,qt.spliceObjects=(ct.splice.call(n,0,1),!n[0])})(1),t.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},i.prototype=t.prototype,l(arguments)||(l=function(n){return n?mt.call(n,"callee"):!1});var Ft=wt||function(n){return n?typeof n=="object"&&dt.call(n)==tt:!1},wt=function(n){var t,r=[];if(!n||!ft[typeof n])return r;for(t in n)mt.call(n,t)&&r.push(t);return r},Rt=Et?function(n){return m(n)?Et(n):[]
|
||||||
|
}:wt,Dt={"&":"&","<":"<",">":">",'"':""","'":"'"},Mt=v(Dt),Tt=function(n,t){var r;if(!n||!ft[typeof n])return n;for(r in n)if(t(n[r],r,n)===K)break;return n},$t=function(n,t){var r;if(!n||!ft[typeof n])return n;for(r in n)if(mt.call(n,r)&&t(n[r],r,n)===K)break;return n};y(/x/)&&(y=function(n){return typeof n=="function"&&"[object Function]"==dt.call(n)}),t.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},t.bind=C,t.bindAll=function(n){for(var t=1<arguments.length?ht.apply(ct,Bt.call(arguments,1)):s(n),r=-1,e=t.length;++r<e;){var u=t[r];
|
||||||
|
n[u]=C(n[u],n)}return n},t.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},t.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},t.countBy=function(n,t,r){var e={};return t=P(t,r),E(n,function(n,r,u){r=t(n,r,u)+"",mt.call(e,r)?e[r]++:e[r]=1}),e},t.debounce=function(n,t,r){function e(){a=null,r||(o=n.apply(i,u))}var u,o,i,a;return function(){var f=r&&!a;return u=arguments,i=this,gt(a),a=bt(e,t),f&&(o=n.apply(i,u)),o
|
||||||
|
}},t.defaults=p,t.defer=function(n){var t=Bt.call(arguments,1);return bt(function(){n.apply(void 0,t)},1)},t.delay=function(n,t){var r=Bt.call(arguments,2);return bt(function(){n.apply(void 0,r)},t)},t.difference=R,t.filter=A,t.flatten=M,t.forEach=E,t.functions=s,t.groupBy=function(n,t,r){var e={};return t=P(t,r),E(n,function(n,r,u){r=t(n,r,u)+"",(mt.call(e,r)?e[r]:e[r]=[]).push(n)}),e},t.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t!="number"&&null!=t){var o=u;for(t=P(t,r);o--&&t(n[o],o,n);)e++
|
||||||
|
}else e=null==t||r?1:t||e;return Bt.call(n,0,St(Ot(0,u-e),u))},t.intersection=function(n){var t=arguments,r=t.length,e=-1,u=n?n.length:0,o=[];n:for(;++e<u;){var i=n[e];if(0>T(o,i)){for(var a=r;--a;)if(0>T(t[a],i))continue n;o.push(i)}}return o},t.invert=v,t.invoke=function(n,t){var r=Bt.call(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);return E(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},t.keys=Rt,t.map=O,t.max=S,t.memoize=function(n,t){var r={};return function(){var e=L+(t?t.apply(this,arguments):arguments[0]);
|
||||||
|
return mt.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},t.min=function(n,t,r){var e=1/0,u=e,o=-1,i=n?n.length:0;if(t||typeof i!="number")t=P(t,r),E(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},t.omit=function(n){var t=ht.apply(ct,Bt.call(arguments,1)),r={};return Tt(n,function(n,e){0>T(t,e)&&(r[e]=n)}),r},t.once=function(n){var t,r;return function(){return t?r:(t=!0,r=n.apply(this,arguments),n=null,r)}},t.pairs=function(n){for(var t=-1,r=Rt(n),e=r.length,u=Array(e);++t<e;){var o=r[t];
|
||||||
|
u[t]=[o,n[o]]}return u},t.partial=function(n){return e(n,Bt.call(arguments,1))},t.pick=function(n){for(var t=-1,r=ht.apply(ct,Bt.call(arguments,1)),e=r.length,u={};++t<e;){var o=r[t];o in n&&(u[o]=n[o])}return u},t.pluck=N,t.range=function(n,t,r){n=+n||0,r=+r||1,null==t&&(t=n,n=0);var e=-1;t=Ot(0,vt((t-n)/r));for(var u=Array(t);++e<t;)u[e]=n,n+=r;return u},t.reject=function(n,t,r){return t=P(t,r),A(n,function(n,r,e){return!t(n,r,e)})},t.rest=$,t.shuffle=function(n){var t=-1,r=n?n.length:0,e=Array(typeof r=="number"?r:0);
|
||||||
|
return E(n,function(n){var r=yt(Nt()*(++t+1));e[t]=e[r],e[r]=n}),e},t.sortBy=function(n,t,e){var u=-1,o=n?n.length:0,i=Array(typeof o=="number"?o:0);for(t=P(t,e),E(n,function(n,r,e){i[++u]={a:t(n,r,e),b:u,c:n}}),o=i.length,i.sort(r);o--;)i[o]=i[o].c;return i},t.tap=function(n,t){return t(n),n},t.throttle=function(n,t){function r(){a=new Date,i=null,u=n.apply(o,e)}var e,u,o,i,a=0;return function(){var f=new Date,l=t-(f-a);return e=arguments,o=this,0<l?i||(i=bt(r,l)):(gt(i),i=null,a=f,u=n.apply(o,e)),u
|
||||||
|
}},t.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},t.toArray=function(n){return Ft(n)?Bt.call(n):n&&typeof n.length=="number"?O(n):d(n)},t.union=function(n){return Ft(n)||(arguments[0]=n?Bt.call(n):ct),z(ht.apply(ct,arguments))},t.uniq=z,t.values=d,t.where=F,t.without=function(n){return R(n,Bt.call(arguments,1))},t.wrap=function(n,t){return function(){var r=[n];return _t.apply(r,arguments),t.apply(this,r)}},t.zip=function(n){for(var t=-1,r=n?S(N(arguments,"length")):0,e=Array(r);++t<r;)e[t]=N(arguments,t);
|
||||||
|
return e},t.collect=O,t.drop=$,t.each=E,t.extend=c,t.methods=s,t.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},t.select=A,t.tail=$,t.unique=z,t.clone=function(n){return m(n)?Ft(n)?Bt.call(n):c({},n):n},t.contains=j,t.escape=function(n){return null==n?"":(n+"").replace(Y,o)},t.every=w,t.find=x,t.findWhere=function(n,t){return F(n,t,!0)},t.has=function(n,t){return n?mt.call(n,t):!1},t.identity=U,t.indexOf=T,t.isArguments=l,t.isArray=Ft,t.isBoolean=function(n){return!0===n||!1===n||dt.call(n)==rt
|
||||||
|
},t.isDate=function(n){return n?typeof n=="object"&&dt.call(n)==et:!1},t.isElement=function(n){return n?1===n.nodeType:!1},t.isEmpty=g,t.isEqual=h,t.isFinite=function(n){return At(n)&&!xt(parseFloat(n))},t.isFunction=y,t.isNaN=function(n){return _(n)&&n!=+n},t.isNull=function(n){return null===n},t.isNumber=_,t.isObject=m,t.isRegExp=function(n){return n?ft[typeof n]&&dt.call(n)==it:!1},t.isString=b,t.isUndefined=function(n){return typeof n=="undefined"},t.lastIndexOf=function(n,t,r){var e=n?n.length:0;
|
||||||
|
for(typeof r=="number"&&(e=(0>r?Ot(0,e+r):St(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},t.mixin=V,t.noConflict=function(){return n._=pt,this},t.random=function(n,t){return null==n&&null==t&&(t=1),n=+n||0,null==t&&(t=n,n=0),n+yt(Nt()*((+t||0)-n+1))},t.reduce=B,t.reduceRight=k,t.result=function(n,t){var r=n?n[t]:null;return y(r)?n[t]():r},t.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Rt(n).length},t.some=q,t.sortedIndex=I,t.template=function(n,r,e){n||(n=""),e=p({},e,t.templateSettings);
|
||||||
|
var o=0,i="__p+='",a=e.variable;n.replace(RegExp((e.escape||X).source+"|"+(e.interpolate||X).source+"|"+(e.evaluate||X).source+"|$","g"),function(t,r,e,a,f){return i+=n.slice(o,f).replace(Z,u),r&&(i+="'+_['escape']("+r+")+'"),a&&(i+="';"+a+";__p+='"),e&&(i+="'+((__t=("+e+"))==null?'':__t)+'"),o=f+t.length,t}),i+="';\n",a||(a="obj",i="with("+a+"||{}){"+i+"}"),i="function("+a+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+i+"return __p}";try{var f=Function("_","return "+i)(t)
|
||||||
|
}catch(l){throw l.source=i,l}return r?f(r):(f.source=i,f)},t.unescape=function(n){return null==n?"":(n+"").replace(Q,f)},t.uniqueId=function(n){var t=++J+"";return n?n+t:t},t.all=w,t.any=q,t.detect=x,t.foldl=B,t.foldr=k,t.include=j,t.inject=B,t.first=D,t.last=function(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&null!=t){var o=u;for(t=P(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,null==e||r)return n[u-1];return Bt.call(n,Ot(0,u-e))}},t.take=D,t.head=D,t.chain=function(n){return n=new i(n),n.__chain__=!0,n
|
||||||
|
},t.VERSION="1.2.1",V(t),t.prototype.chain=function(){return this.__chain__=!0,this},t.prototype.value=function(){return this.__wrapped__},E("pop push reverse shift sort splice unshift".split(" "),function(n){var r=ct[n];t.prototype[n]=function(){var n=this.__wrapped__;return r.apply(n,arguments),!qt.spliceObjects&&0===n.length&&delete n[0],this}}),E(["concat","join","slice"],function(n){var r=ct[n];t.prototype[n]=function(){var n=r.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new i(n),n.__chain__=!0),n
|
||||||
|
}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=t,define(function(){return t})):W&&!W.nodeType?G?(G.exports=t)._=t:W._=t:n._=t})(this);
|
||||||
5364
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.2.1</sup>',
|
||||||
'url' => 'https://github.com/bestiejs/lodash/blob/master/lodash.js'
|
'toc' => 'categories',
|
||||||
|
'url' => 'https://github.com/lodash/lodash/blob/1.2.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);
|
|
||||||
27
package.json
@@ -1,9 +1,10 @@
|
|||||||
{
|
{
|
||||||
"name": "lodash",
|
"name": "lodash",
|
||||||
"version": "0.1.0",
|
"version": "1.2.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,14 @@
|
|||||||
"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"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
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));
|
||||||
1858
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
|
||||||
54
test/backbone.html
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
<!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
|
||||||
|
});
|
||||||
|
if (!_.chain) {
|
||||||
|
_.mixin({
|
||||||
|
'chain': function(value) {
|
||||||
|
return new _(value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</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>
|
||||||
|
|||||||
@@ -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 @@
|
|||||||
|
Hello {{ name }}!
|
||||||
1552
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));
|
||||||
3441
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) {
|
||||||
|
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~26, Firefox 2~20, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.10.5, 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*[^\n]+#', $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('/\* *@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('#\* *@alias\s+([^\n]+)#', $this->entry, $result);
|
||||||
|
|
||||||
|
if (count($result)) {
|
||||||
|
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $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('#\* *@name\s+([^\n]+)#', $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('#\* *@category\s+([^\n]+)#', $this->entry, $result);
|
||||||
|
if (count($result)) {
|
||||||
|
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $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 *\* */', ":<br>\n", $result[1]);
|
||||||
|
$result = preg_replace('/(?:^|\n) *\*\n *\* */', "\n\n", $result);
|
||||||
|
$result = preg_replace('/(?:^|\n) *\* ?/', ' ', $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('#\* *@example\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
|
||||||
|
if (count($result)) {
|
||||||
|
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', "\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('/\* *@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('/\* *@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('/\* *@private\b/', $this->entry) || !preg_match('/\* *@[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('/\* *@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('#\* *@member(?:Of)?\s+([^\n]+)#', $this->entry, $result);
|
||||||
|
if (count($result)) {
|
||||||
|
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $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('#\* *@name\s+([^\n]+)#', $this->entry, $result);
|
||||||
|
if (count($result)) {
|
||||||
|
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $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('#\* *@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)\s*\* */', ' ', $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('#\* *@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)\s*\* ?/', ' ', $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('#\* *@type\s+([^\n]+)#', $this->entry, $result);
|
||||||
|
if (count($result)) {
|
||||||
|
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
|
||||||
|
} else {
|
||||||
|
$result = $this->isFunction() ? 'Function' : 'Unknown';
|
||||||
|
}
|
||||||
|
$this->_type = $result;
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
565
vendor/docdown/src/DocDown/Generator.php
vendored
Normal file
@@ -0,0 +1,565 @@
|
|||||||
|
<?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('/ (-?\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] = $alias;
|
||||||
|
$alias->static = array();
|
||||||
|
$alias->plugin = array();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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('/ +\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 |