Compare commits
596 Commits
1.0.0-rc.2
...
1.3.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ac57c2785 | ||
|
|
f90f2e051a | ||
|
|
24f49c8d83 | ||
|
|
a4ebaf15ab | ||
|
|
54a46dccc3 | ||
|
|
9747d5057d | ||
|
|
7f5c97d0be | ||
|
|
1933a76631 | ||
|
|
c20d7f9754 | ||
|
|
6b46dc7e89 | ||
|
|
0c1a26170c | ||
|
|
244ee08d7d | ||
|
|
a3acbca24b | ||
|
|
d77e4ed581 | ||
|
|
b928abb956 | ||
|
|
a46ef8d1a6 | ||
|
|
a5d459749f | ||
|
|
7dfa383968 | ||
|
|
036483d195 | ||
|
|
2c950f74bc | ||
|
|
2c59dcd929 | ||
|
|
658d14f31d | ||
|
|
819f4d2151 | ||
|
|
9b214d75df | ||
|
|
e0891a2d71 | ||
|
|
34a4876761 | ||
|
|
13ead0085d | ||
|
|
9e63270fc5 | ||
|
|
eccab3cd57 | ||
|
|
6446daf1a6 | ||
|
|
821602ef1c | ||
|
|
dc3512de9f | ||
|
|
36e9cb7108 | ||
|
|
42f4531720 | ||
|
|
d1fb379a40 | ||
|
|
e27bdb965c | ||
|
|
54fc6df3da | ||
|
|
9dd8f62c8a | ||
|
|
1db19148e7 | ||
|
|
93a01506e4 | ||
|
|
4767ed790c | ||
|
|
e39211347c | ||
|
|
a8cdbb65fe | ||
|
|
ff74ff4149 | ||
|
|
96e47f3d27 | ||
|
|
be52c181ea | ||
|
|
507f2ec544 | ||
|
|
fe00c628f4 | ||
|
|
e9387d322c | ||
|
|
2e3b135fe9 | ||
|
|
d28cc15be2 | ||
|
|
d15bd23800 | ||
|
|
90fe45c52d | ||
|
|
8f7be71905 | ||
|
|
5d583637c4 | ||
|
|
0efb4285c1 | ||
|
|
6dc543ca18 | ||
|
|
e93e1ddeb9 | ||
|
|
d5459f5996 | ||
|
|
c6420a910d | ||
|
|
f8e67b8e68 | ||
|
|
9ffcd382b4 | ||
|
|
725746badf | ||
|
|
9d5290de91 | ||
|
|
1bb0b58cce | ||
|
|
32f0ebbe61 | ||
|
|
25a1d74627 | ||
|
|
355b2f09bf | ||
|
|
01621f75b6 | ||
|
|
242e8a3bd6 | ||
|
|
010c26e716 | ||
|
|
e7bad10663 | ||
|
|
16242f98ce | ||
|
|
14a447b3d8 | ||
|
|
a2088fa500 | ||
|
|
87af68c092 | ||
|
|
06daad87ca | ||
|
|
0b4b86f6c9 | ||
|
|
10626904af | ||
|
|
90cca8a3eb | ||
|
|
8da0141cac | ||
|
|
39e123aaf4 | ||
|
|
24fd17f072 | ||
|
|
9270cc47b5 | ||
|
|
3721db34ab | ||
|
|
e85ae351c7 | ||
|
|
a56ba245ea | ||
|
|
d162eed4c7 | ||
|
|
43fea34f61 | ||
|
|
f7c960fc0d | ||
|
|
ee1933389a | ||
|
|
fdc9d5f1fd | ||
|
|
bad40b6125 | ||
|
|
d76ce85327 | ||
|
|
d3df072a22 | ||
|
|
4b3009a195 | ||
|
|
b72b0d60cb | ||
|
|
5841e62c66 | ||
|
|
9bd0c01702 | ||
|
|
6d86b3a950 | ||
|
|
5ff9b02c89 | ||
|
|
80934ea232 | ||
|
|
5acfa2bf3a | ||
|
|
4fada52e04 | ||
|
|
e1c8e95e11 | ||
|
|
1dfebad790 | ||
|
|
37ffe63d13 | ||
|
|
cc14c34dc2 | ||
|
|
e0cf4e644b | ||
|
|
aad55fc3db | ||
|
|
ba2b459220 | ||
|
|
086669fbe0 | ||
|
|
4cc3fcb6e8 | ||
|
|
8781053dbe | ||
|
|
bdac8974d8 | ||
|
|
9ae24141a3 | ||
|
|
e773efdc59 | ||
|
|
8f94bd1fbd | ||
|
|
d24d83d52a | ||
|
|
c938017baa | ||
|
|
728eea3ae1 | ||
|
|
88f9c1e539 | ||
|
|
76540c20f3 | ||
|
|
70761cf1d9 | ||
|
|
ace913a97d | ||
|
|
d6e269c7f6 | ||
|
|
ec10550b3a | ||
|
|
86e2374b48 | ||
|
|
d156dacbb9 | ||
|
|
1af5517da0 | ||
|
|
e5d34890a9 | ||
|
|
183b2548cf | ||
|
|
d2de489e3a | ||
|
|
90f8dbd86e | ||
|
|
3508ce19f3 | ||
|
|
00188c9818 | ||
|
|
499232f0e6 | ||
|
|
17471a12d2 | ||
|
|
de4b5eeda7 | ||
|
|
d0a0193707 | ||
|
|
5269a26b69 | ||
|
|
8dc6ad587f | ||
|
|
757339c52d | ||
|
|
6e289339d7 | ||
|
|
3ff0a44a1c | ||
|
|
0562228e9a | ||
|
|
0b6993bb7c | ||
|
|
4a19d90d48 | ||
|
|
038b1bcf7b | ||
|
|
a707c2fe8e | ||
|
|
3bb119f578 | ||
|
|
2a92600fa7 | ||
|
|
e80e1dab4d | ||
|
|
45d59d75ba | ||
|
|
28cd4c3ee9 | ||
|
|
e7c44274b0 | ||
|
|
3b2e0e34ef | ||
|
|
2276df07bd | ||
|
|
758ff03520 | ||
|
|
c3ac172960 | ||
|
|
562b4eb531 | ||
|
|
b1f8e845df | ||
|
|
bda869ea54 | ||
|
|
19cfbf082a | ||
|
|
07078bdd1f | ||
|
|
03657a98e1 | ||
|
|
b3f64abfae | ||
|
|
5d73c8f002 | ||
|
|
ba0882762d | ||
|
|
bb8855b628 | ||
|
|
883d5917f5 | ||
|
|
0275e99fe2 | ||
|
|
5d109077e5 | ||
|
|
540851ab6a | ||
|
|
6b920fa5e6 | ||
|
|
d1498bb9fb | ||
|
|
54eeef173a | ||
|
|
723ddf8cda | ||
|
|
9f12552907 | ||
|
|
a8b6fa413e | ||
|
|
76aae8ce42 | ||
|
|
ad0c287053 | ||
|
|
4a11a3559d | ||
|
|
1faa5a80e4 | ||
|
|
f1d3df1ec0 | ||
|
|
e7c94d3351 | ||
|
|
954f76dcf5 | ||
|
|
43037c0ff9 | ||
|
|
93df901b71 | ||
|
|
e97e645eda | ||
|
|
4a03ba3874 | ||
|
|
7f637e4acc | ||
|
|
8f3eeefafd | ||
|
|
5dc550a0ce | ||
|
|
6fe322da27 | ||
|
|
3cfe7c9a56 | ||
|
|
be7d5917cb | ||
|
|
ca28aa6ebd | ||
|
|
e76360c1b5 | ||
|
|
265ca8ba67 | ||
|
|
b0d942d0ec | ||
|
|
6c25905ae4 | ||
|
|
80a39393fe | ||
|
|
d4aed71abf | ||
|
|
ebb72bb992 | ||
|
|
8ffcd30b4d | ||
|
|
06804c37e2 | ||
|
|
1acca0278c | ||
|
|
639c8d4171 | ||
|
|
d77c9d3fca | ||
|
|
2c7cc2c191 | ||
|
|
d7c74b8004 | ||
|
|
aaa8003418 | ||
|
|
86890b13c6 | ||
|
|
39158b0eb6 | ||
|
|
87f1d55bc2 | ||
|
|
14343b5410 | ||
|
|
ffdac30b3c | ||
|
|
244c8dc391 | ||
|
|
e593344461 | ||
|
|
74c46f6e93 | ||
|
|
bbfd8aa249 | ||
|
|
2705a488ad | ||
|
|
850c253e08 | ||
|
|
80e0e3fcd7 | ||
|
|
2cc2d696f1 | ||
|
|
8a83a6b5be | ||
|
|
002d5338a0 | ||
|
|
743aa472f0 | ||
|
|
ba85d5d351 | ||
|
|
4e2ef908dc | ||
|
|
f5dd05ba8e | ||
|
|
17eda2a4cc | ||
|
|
d219c6e019 | ||
|
|
2dc539747b | ||
|
|
e941de50e8 | ||
|
|
63052257a2 | ||
|
|
ac5d2a714e | ||
|
|
59f78c16b1 | ||
|
|
3f7f8133df | ||
|
|
fef5e1ce2c | ||
|
|
0b97b3864f | ||
|
|
3d1330c85d | ||
|
|
041c0cc322 | ||
|
|
e72712640c | ||
|
|
6830195127 | ||
|
|
f9b5d6644d | ||
|
|
40f9eeda36 | ||
|
|
0fa0b0b1ea | ||
|
|
ff0b23f200 | ||
|
|
5456d4081b | ||
|
|
8948fae780 | ||
|
|
ee4542a699 | ||
|
|
31e4e631f9 | ||
|
|
cbf20b3271 | ||
|
|
a65fd50723 | ||
|
|
63a6aac2d8 | ||
|
|
afde4804c9 | ||
|
|
bc8ec9cd3e | ||
|
|
b63ab18e29 | ||
|
|
e7325f58c3 | ||
|
|
7b35bb8c96 | ||
|
|
e84671ce5d | ||
|
|
b01d50fe05 | ||
|
|
3f163051b1 | ||
|
|
4f1d03e1d4 | ||
|
|
fc39e4a225 | ||
|
|
bf88ad7fc8 | ||
|
|
11ba02067e | ||
|
|
952afa05ce | ||
|
|
3131cc3160 | ||
|
|
792f768479 | ||
|
|
ff312a15dd | ||
|
|
36207c9a98 | ||
|
|
b92105e888 | ||
|
|
35bd7c55d0 | ||
|
|
9f19c302d8 | ||
|
|
87b1ac776f | ||
|
|
41e401b05e | ||
|
|
d88da3589d | ||
|
|
9638c393bb | ||
|
|
9961ddc2a8 | ||
|
|
2d40dfd8d4 | ||
|
|
99c9bdf71d | ||
|
|
4fcd25ec88 | ||
|
|
440218da67 | ||
|
|
fefdb9fc8d | ||
|
|
21a0eff593 | ||
|
|
8825a094ae | ||
|
|
aa49ce5c56 | ||
|
|
1522d3385d | ||
|
|
510c41440a | ||
|
|
aa0c34ba1c | ||
|
|
af87e6ef62 | ||
|
|
30291ce6e6 | ||
|
|
890c2eb564 | ||
|
|
67a269b89c | ||
|
|
4b9ee81a78 | ||
|
|
4343f4d229 | ||
|
|
2162baa6c0 | ||
|
|
7e7f792710 | ||
|
|
1bbd9e24b0 | ||
|
|
6435aaa64f | ||
|
|
999aae0a33 | ||
|
|
ba795639b4 | ||
|
|
4c4b205721 | ||
|
|
b3c550b7c0 | ||
|
|
eb8953e784 | ||
|
|
b88b292d5d | ||
|
|
5f42c3b319 | ||
|
|
5b27ae0371 | ||
|
|
f26b1da1b5 | ||
|
|
7a853e2dcb | ||
|
|
9b22748bd0 | ||
|
|
c1e9dd3373 | ||
|
|
8cbbc47043 | ||
|
|
81b3567133 | ||
|
|
fc6568f390 | ||
|
|
8e30fe2946 | ||
|
|
6c811a3261 | ||
|
|
afbe5aa540 | ||
|
|
324afd2d6c | ||
|
|
58d94ef61e | ||
|
|
39974b0982 | ||
|
|
323d7306e2 | ||
|
|
251e228ce4 | ||
|
|
a99f3f217a | ||
|
|
e2acbee113 | ||
|
|
37b69eddf2 | ||
|
|
f0322e6f2c | ||
|
|
756587d080 | ||
|
|
1ad2c92324 | ||
|
|
e5433adf78 | ||
|
|
ed765f75d8 | ||
|
|
4136f1b377 | ||
|
|
860339b90e | ||
|
|
03254a0c0f | ||
|
|
a76081c979 | ||
|
|
71a207079f | ||
|
|
f6e724c4c5 | ||
|
|
4251b36b25 | ||
|
|
b8f39cbfdf | ||
|
|
088c621862 | ||
|
|
2459a53350 | ||
|
|
7093e9c0d4 | ||
|
|
4bc49978d1 | ||
|
|
96bac9c149 | ||
|
|
8dcc15f4d3 | ||
|
|
8183740c04 | ||
|
|
25e4231d7b | ||
|
|
3ed9e0e905 | ||
|
|
45bec0c440 | ||
|
|
5133e39d45 | ||
|
|
cb3b4e446e | ||
|
|
9829a2f3b4 | ||
|
|
7eadf11145 | ||
|
|
2a2bc44f43 | ||
|
|
9ccfa5cec9 | ||
|
|
02687f3c78 | ||
|
|
7ea7a6cbb1 | ||
|
|
a15a28fe5b | ||
|
|
265dedfae1 | ||
|
|
5ddbb8bc56 | ||
|
|
4101b8e937 | ||
|
|
56b6d50479 | ||
|
|
506f585d78 | ||
|
|
577dfb7220 | ||
|
|
7e4286adde | ||
|
|
1090228628 | ||
|
|
aeea861b73 | ||
|
|
997c43bbdd | ||
|
|
958d4dbd2e | ||
|
|
f2b350eb62 | ||
|
|
a3464780a1 | ||
|
|
fe1eb92196 | ||
|
|
0b2d26ec92 | ||
|
|
8024a25f2b | ||
|
|
d287ecbb34 | ||
|
|
d9c95e7730 | ||
|
|
c3b1af31ce | ||
|
|
465576b5cb | ||
|
|
9ecbcd0075 | ||
|
|
c1f62d72ae | ||
|
|
1b27834c41 | ||
|
|
77804907b6 | ||
|
|
9dfa2609be | ||
|
|
8ffb3ab3c4 | ||
|
|
65e1da34fa | ||
|
|
282110807c | ||
|
|
25e5f43d1c | ||
|
|
ce0441694d | ||
|
|
db29699927 | ||
|
|
9a4e2d7617 | ||
|
|
fbf64585b7 | ||
|
|
6d1c6dfd16 | ||
|
|
e78df4d981 | ||
|
|
a757b4d5dc | ||
|
|
d28036ee91 | ||
|
|
d2ba0d4e7a | ||
|
|
5787436177 | ||
|
|
f5ab24b8d2 | ||
|
|
05c0f32a24 | ||
|
|
7b918f77a9 | ||
|
|
d87929d61c | ||
|
|
a926829c33 | ||
|
|
d58e366c40 | ||
|
|
0fb4f7e1c4 | ||
|
|
6ee606e3e2 | ||
|
|
22d4a7690f | ||
|
|
f3a2f5018a | ||
|
|
d2a7589f7c | ||
|
|
f87b4e04f1 | ||
|
|
b5aa4c1f0c | ||
|
|
0c1eb6d288 | ||
|
|
8a03c5f998 | ||
|
|
60aa50ae45 | ||
|
|
aae6bbbb66 | ||
|
|
5ca903c428 | ||
|
|
e86b07f760 | ||
|
|
d7fea5dc78 | ||
|
|
c1eff5aebb | ||
|
|
f2dc490d6f | ||
|
|
b296e1b340 | ||
|
|
8adb060edb | ||
|
|
c3b984fea7 | ||
|
|
afbb2c338b | ||
|
|
6632241ab5 | ||
|
|
be50df81db | ||
|
|
9763b6e2cf | ||
|
|
812b848daf | ||
|
|
4907a7389f | ||
|
|
17dff36b65 | ||
|
|
904921d8c4 | ||
|
|
ac4c075d32 | ||
|
|
ddde64ece9 | ||
|
|
91c097e88d | ||
|
|
894658a3f5 | ||
|
|
a4454ea5f9 | ||
|
|
8ea8fa3a8a | ||
|
|
7480603295 | ||
|
|
079b749d5d | ||
|
|
4815600e85 | ||
|
|
1c63e2d295 | ||
|
|
cf13eca58c | ||
|
|
3cf4607870 | ||
|
|
23c3ba6ad7 | ||
|
|
17fc3c2317 | ||
|
|
af234cbe54 | ||
|
|
c8517c0ec9 | ||
|
|
20b226454b | ||
|
|
98eccf223a | ||
|
|
0fc2ab4d41 | ||
|
|
641b6efe7f | ||
|
|
4c83435b4b | ||
|
|
9f7319cff4 | ||
|
|
dd9baa1502 | ||
|
|
41b4d0daa1 | ||
|
|
e41b181163 | ||
|
|
288ac115d0 | ||
|
|
6774d46a6f | ||
|
|
607abf89f7 | ||
|
|
27f1e5e2f2 | ||
|
|
a457675ce1 | ||
|
|
82049096e6 | ||
|
|
6c965e0223 | ||
|
|
8b4d952929 | ||
|
|
873cc63f94 | ||
|
|
39fc839ff2 | ||
|
|
4edef4c959 | ||
|
|
1d9ced8037 | ||
|
|
4cb77d1429 | ||
|
|
b52d9d1bdd | ||
|
|
5fe7ca5e70 | ||
|
|
62fb440de2 | ||
|
|
96fbd7c7ba | ||
|
|
c9bec8e636 | ||
|
|
769e03e7f2 | ||
|
|
ab83f2d5e2 | ||
|
|
b60d0cdb17 | ||
|
|
677503dbf1 | ||
|
|
25efa29470 | ||
|
|
21a90f8f8f | ||
|
|
64e8d6ae99 | ||
|
|
16a204335e | ||
|
|
0a53f762fe | ||
|
|
6ba4778c1b | ||
|
|
0404c2266c | ||
|
|
e5e914282f | ||
|
|
9867d4bdc3 | ||
|
|
e4cb7112cf | ||
|
|
2d202e90b7 | ||
|
|
016391e442 | ||
|
|
1eff48a429 | ||
|
|
ce33af6bb5 | ||
|
|
fb9d4303f1 | ||
|
|
4e631c9e8f | ||
|
|
766d67d80d | ||
|
|
e2c2a37221 | ||
|
|
2b23020695 | ||
|
|
8d43c6b1a8 | ||
|
|
7362dd1a7c | ||
|
|
316caf7e8c | ||
|
|
87dc6631ee | ||
|
|
62246d7d43 | ||
|
|
a14be3a42c | ||
|
|
7fdf00d5e9 | ||
|
|
99e02f30fb | ||
|
|
716a5b9b5a | ||
|
|
87f880ca52 | ||
|
|
8ec7b84a78 | ||
|
|
05cf5bc8db | ||
|
|
ac25e21a0c | ||
|
|
cc1e0daaa4 | ||
|
|
f4120a9c8c | ||
|
|
e3b80a5e09 | ||
|
|
ef7cb26b01 | ||
|
|
408a5c168f | ||
|
|
0ad6ac95b2 | ||
|
|
bda4747e9c | ||
|
|
bd8f882c94 | ||
|
|
32b5b5b1c4 | ||
|
|
c1e543c9fe | ||
|
|
3908fa5c57 | ||
|
|
1b347fc185 | ||
|
|
282a5e0b01 | ||
|
|
e9d23cc1ea | ||
|
|
34173fd60f | ||
|
|
d0d3c8ef57 | ||
|
|
11912008dd | ||
|
|
c122007e17 | ||
|
|
69dfa1a175 | ||
|
|
bfea443e55 | ||
|
|
680798c28f | ||
|
|
9f0cc45c45 | ||
|
|
0ac97f467f | ||
|
|
647746ea72 | ||
|
|
7bea30b2e6 | ||
|
|
12bc852c89 | ||
|
|
0d42e84045 | ||
|
|
897b85b607 | ||
|
|
5c55cf0efb | ||
|
|
eccd6463f6 | ||
|
|
4a0897c734 | ||
|
|
c86a16df7f | ||
|
|
2ae0e9d902 | ||
|
|
bba18cd56b | ||
|
|
2f20781e16 | ||
|
|
3bee212876 | ||
|
|
6c8893a550 | ||
|
|
9c52ecc19b | ||
|
|
692c884ca2 | ||
|
|
3ef51d7fae | ||
|
|
73d95de122 | ||
|
|
04a568ac9b | ||
|
|
a45499cf04 | ||
|
|
b847d672ab | ||
|
|
3ffefdf6b5 | ||
|
|
cca4c4be80 | ||
|
|
cb9e044cb3 | ||
|
|
fd25dd83bd | ||
|
|
584bb00cfc | ||
|
|
5b9369d344 | ||
|
|
a64506a0de | ||
|
|
2fc83ef80b | ||
|
|
8bee3ebd65 | ||
|
|
99686fdd73 | ||
|
|
33bc3d6a1e | ||
|
|
90597530a4 | ||
|
|
b2af8da9a2 | ||
|
|
05dbf41fdc | ||
|
|
c56bb56708 | ||
|
|
4def1ea1dc | ||
|
|
0ba05e4de0 | ||
|
|
24fce89155 | ||
|
|
1a3c20f91d | ||
|
|
fe3e78cc1c | ||
|
|
749f49b1a0 | ||
|
|
f14010a09d | ||
|
|
0b48b9c7d4 | ||
|
|
13d62b01d1 | ||
|
|
4e7b71db1d | ||
|
|
069fc1f97b | ||
|
|
8684f75254 | ||
|
|
11cd924ce1 | ||
|
|
e2fd0cfc4e | ||
|
|
5eb3106706 | ||
|
|
1831efbe9d | ||
|
|
38edbadca5 | ||
|
|
6fcd80b979 | ||
|
|
cf5e5dbe55 | ||
|
|
a451861bf1 | ||
|
|
7313dd74a6 | ||
|
|
32b9de05f2 | ||
|
|
c79bed22f8 | ||
|
|
cdeb50132d | ||
|
|
090fb09955 |
4
.gitattributes
vendored
@@ -1 +1,5 @@
|
||||
* text=auto
|
||||
*.js text eol=lf
|
||||
*.jst text eol=lf
|
||||
*.sh text eol=lf
|
||||
*.tpl text eol=lf
|
||||
|
||||
9
.gitignore
vendored
@@ -1,5 +1,8 @@
|
||||
.DS_Store
|
||||
*.custom.*
|
||||
node_modules/
|
||||
vendor/closure-compiler/
|
||||
vendor/uglifyjs/
|
||||
*.template.*
|
||||
*.d.ts
|
||||
*.map
|
||||
node_modules
|
||||
vendor/closure-compiler
|
||||
vendor/uglifyjs
|
||||
|
||||
18
.jamignore
@@ -1,12 +1,18 @@
|
||||
.*
|
||||
*.custom.*
|
||||
*.template.*
|
||||
*.d.ts
|
||||
*.map
|
||||
*.md
|
||||
*.txt
|
||||
build.js
|
||||
lodash.js
|
||||
index.js
|
||||
build/
|
||||
doc/
|
||||
node_modules/
|
||||
perf/
|
||||
test/
|
||||
vendor/
|
||||
bower.json
|
||||
component.json
|
||||
build
|
||||
doc
|
||||
node_modules
|
||||
perf
|
||||
test
|
||||
vendor
|
||||
|
||||
36
.npmignore
@@ -1,25 +1,25 @@
|
||||
.*
|
||||
*.custom.*
|
||||
*.template.*
|
||||
*.d.ts
|
||||
doc/*.php
|
||||
node_modules/
|
||||
perf/*.html
|
||||
perf/*-ui.js
|
||||
perf/*.sh
|
||||
test/*.html
|
||||
test/*-ui.js
|
||||
test/*.sh
|
||||
*.map
|
||||
*.md
|
||||
bower.json
|
||||
component.json
|
||||
doc
|
||||
perf
|
||||
test
|
||||
vendor/*.gz
|
||||
vendor/backbone/
|
||||
vendor/benchmark.js/*.jar
|
||||
vendor/backbone
|
||||
vendor/benchmark.js
|
||||
vendor/closure-compiler
|
||||
vendor/docdown
|
||||
vendor/firebug-lite/
|
||||
vendor/json3/
|
||||
vendor/jquery/
|
||||
vendor/qunit/qunit/*.css
|
||||
vendor/qunit/qunit/*-1.8.0.js
|
||||
vendor/requirejs/
|
||||
vendor/underscore/*-min.js
|
||||
vendor/firebug-lite
|
||||
vendor/jquery
|
||||
vendor/json3
|
||||
vendor/platform.js
|
||||
vendor/qunit
|
||||
vendor/qunit-clib
|
||||
vendor/requirejs
|
||||
vendor/uglifyjs
|
||||
vendor/underscore/test/
|
||||
vendor/underscore
|
||||
|
||||
22
.travis.yml
@@ -1,7 +1,23 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 0.6
|
||||
- 0.8
|
||||
- 0.9
|
||||
- 0.10
|
||||
env:
|
||||
- TEST_COMMAND="istanbul cover ./test/test.js"
|
||||
- TEST_COMMAND="phantomjs ./test/test.js ../dist/lodash.compat.js"
|
||||
- TEST_COMMAND="phantomjs ./test/test.js ../dist/lodash.compat.min.js"
|
||||
- TEST_COMMAND="node ./test/test.js ../dist/lodash.js"
|
||||
- TEST_COMMAND="node ./test/test.js ../dist/lodash.min.js"
|
||||
- TEST_COMMAND="node ./test/test-build.js --time-limit 48m"
|
||||
git:
|
||||
depth: 1
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
before_script:
|
||||
- "curl -H 'Accept: application/vnd.github.v3.raw' https://api.github.com/repos/bestiejs/lodash/git/blobs/a2787b470c577cee2404d186c562dd9835f779f5 | tar xvz -C vendor"
|
||||
- "curl -H 'Accept: application/vnd.github.v3.raw' https://api.github.com/repos/bestiejs/lodash/git/blobs/3390b259e04829538e4d3635d12b317dd6103eca | tar xvz -C vendor"
|
||||
- "tar -xzvf vendor/closure-compiler.tar.gz -C vendor"
|
||||
- "tar -xzvf vendor/uglifyjs.tar.gz -C vendor"
|
||||
- "npm install -g istanbul"
|
||||
script:
|
||||
$TEST_COMMAND
|
||||
|
||||
35
CONTRIBUTING.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# Contributing to Lo-Dash
|
||||
|
||||
If you’d like to contribute a feature or bug fix, you can [fork](https://help.github.com/articles/fork-a-repo) Lo-Dash, commit your changes, and [send a pull request](https://help.github.com/articles/using-pull-requests).
|
||||
Please make sure to [search the issue tracker](https://github.com/bestiejs/lodash/issues) first; your issue may have already been discussed or fixed in `master`.
|
||||
|
||||
## Tests
|
||||
|
||||
Include updated unit tests in the `test` directory as part of your pull request.
|
||||
You can run the tests from the command line via `npm test`, or open `test/index.html` in a web browser.
|
||||
The `test/run-test.sh` script attempts to run the tests in [Rhino](https://developer.mozilla.org/en-US/docs/Rhino), [Narwhal](https://github.com/280north/narwhal), [RingoJS](http://ringojs.org/), [PhantomJS](http://phantomjs.org/), and [Node](http://nodejs.org/), before running them in your default browser.
|
||||
The [Backbone](http://backbonejs.org/) and [Underscore](http://http://underscorejs.org/) test suites are included as well.
|
||||
|
||||
## Contributor License Agreement
|
||||
|
||||
Lo-Dash is a member of the [Dojo Foundation](http://dojofoundation.org/).
|
||||
As such, we request that all contributors sign the Dojo Foundation [contributor license agreement](http://dojofoundation.org/about/claForm).
|
||||
|
||||
For more information about CLAs, please check out Alex Russell’s excellent post, ["Why Do I Need to Sign This?"](http://infrequently.org/2008/06/why-do-i-need-to-sign-this/).
|
||||
|
||||
## Coding Guidelines
|
||||
|
||||
In addition to the following guidelines, please follow the conventions already established in the code.
|
||||
|
||||
- **Spacing**:<br>
|
||||
Use two spaces for indentation. No tabs.
|
||||
|
||||
- **Naming**:<br>
|
||||
Keep variable and method names concise and descriptive.<br>
|
||||
Variable names `index`, `collection`, and `callback` are preferable to `i`, `arr`, and `fn`.
|
||||
|
||||
- **Quotes**:<br>
|
||||
Single-quoted strings are preferred to double-quoted strings; however, please use a double-quoted string if the value contains a single-quote character to avoid unnecessary escaping.
|
||||
|
||||
- **Comments**:<br>
|
||||
Please use single-line comments to annotate significant additions, and [JSDoc-style](http://www.2ality.com/2011/08/jsdoc-intro.html) comments for new methods.
|
||||
@@ -1,6 +1,6 @@
|
||||
Copyright 2012 John-David Dalton <http://allyoucanleet.com/>
|
||||
Based on Underscore.js 1.3.3, copyright 2009-2012 Jeremy Ashkenas,
|
||||
DocumentCloud Inc. <http://documentcloud.github.com/underscore>
|
||||
Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||
Based on Underscore.js 1.4.3, copyright 2009-2013 Jeremy Ashkenas,
|
||||
DocumentCloud Inc. <http://underscorejs.org/>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
203
README.md
@@ -1,23 +1,28 @@
|
||||
# Lo-Dash <sup>v1.0.0-rc.2</sup>
|
||||
[](http://travis-ci.org/bestiejs/lodash)
|
||||
# Lo-Dash <sup>v1.3.0</sup>
|
||||
|
||||
A utility library, usable as a drop-in replacement for Underscore, delivering [performance](http://lodash.com/benchmarks), [bug fixes](https://github.com/bestiejs/lodash#resolved-underscorejs-issues), and [additional features](http://lodash.com/#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).
|
||||
|
||||
## Download
|
||||
|
||||
* Lo-Dash builds:<br>
|
||||
[Development](https://raw.github.com/bestiejs/lodash/v1.0.0-rc.2/lodash.js) and
|
||||
[Production](https://raw.github.com/bestiejs/lodash/v1.0.0-rc.2/lodash.min.js)
|
||||
* Lo-Dash builds (for modern environments):<br>
|
||||
[Development](https://raw.github.com/bestiejs/lodash/v1.3.0/dist/lodash.js) and
|
||||
[Production](https://raw.github.com/bestiejs/lodash/v1.3.0/dist/lodash.min.js)
|
||||
|
||||
* Underscore builds:<br>
|
||||
[Development](https://raw.github.com/bestiejs/lodash/v1.0.0-rc.2/lodash.underscore.js) and
|
||||
[Production](https://raw.github.com/bestiejs/lodash/v1.0.0-rc.2/lodash.underscore.min.js)
|
||||
* Lo-Dash compatibility builds (for legacy and modern environments):<br>
|
||||
[Development](https://raw.github.com/bestiejs/lodash/v1.3.0/dist/lodash.compat.js) and
|
||||
[Production](https://raw.github.com/bestiejs/lodash/v1.3.0/dist/lodash.compat.min.js)
|
||||
|
||||
* CDN copies of ≤ v1.0.0-rc.2’s builds are available on [cdnjs](http://cdnjs.com/) thanks to [CloudFlare](http://www.cloudflare.com/):<br>
|
||||
[Lo-Dash development](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.0-rc.2/lodash.js),
|
||||
[Lo-Dash production](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.0-rc.2/lodash.min.js),
|
||||
[Underscore development](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.0-rc.2/lodash.underscore.js), and
|
||||
[Underscore production](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.0-rc.2/lodash.underscore.min.js)
|
||||
* Underscore compatibility builds:<br>
|
||||
[Development](https://raw.github.com/bestiejs/lodash/v1.3.0/dist/lodash.underscore.js) and
|
||||
[Production](https://raw.github.com/bestiejs/lodash/v1.3.0/dist/lodash.underscore.min.js)
|
||||
|
||||
* CDN copies of ≤ v1.3.0’s builds are available on [cdnjs](http://cdnjs.com/) thanks to [CloudFlare](http://www.cloudflare.com/):<br>
|
||||
[Lo-Dash dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.3.0/lodash.js),
|
||||
[Lo-Dash prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.3.0/lodash.min.js),<br>
|
||||
[Lo-Dash compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.3.0/lodash.compat.js),
|
||||
[Lo-Dash compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.3.0/lodash.compat.min.js),<br>
|
||||
[Underscore compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.3.0/lodash.underscore.js), and
|
||||
[Underscore compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.3.0/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
|
||||
|
||||
@@ -25,65 +30,80 @@ A utility library, usable as a drop-in replacement for Underscore, delivering [p
|
||||
|
||||
We’ve got [API docs](http://lodash.com/docs), [benchmarks](http://lodash.com/benchmarks), and [unit tests](http://lodash.com/tests).
|
||||
|
||||
Create your own benchmarks at [jsPerf](http://jsperf.com), or [search](http://jsperf.com/search?q=lodash) for existing ones.
|
||||
|
||||
For a list of upcoming features, check out our [roadmap](https://github.com/bestiejs/lodash/wiki/Roadmap).
|
||||
|
||||
## Screencasts
|
||||
## Resources
|
||||
|
||||
For more information check out these screencasts over Lo-Dash:
|
||||
For more information check out these articles, screencasts, and other videos over Lo-Dash:
|
||||
|
||||
* [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)
|
||||
* Posts
|
||||
- [Say “Hello” to Lo-Dash](http://kitcambridge.be/blog/say-hello-to-lo-dash/)
|
||||
|
||||
* 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)
|
||||
|
||||
## Features
|
||||
|
||||
* AMD loader support ([RequireJS](http://requirejs.org/), [curl.js](https://github.com/cujojs/curl), etc.)
|
||||
* [_(…)](http://lodash.com/docs#_) supports intuitive chaining without calling [_(…).chain](http://lodash.com/docs#prototype_chain)
|
||||
* [_(…)](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
|
||||
* [_.clone](http://lodash.com/docs#clone) supports *“deep”* cloning
|
||||
* [_.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)
|
||||
* [_.partial](http://lodash.com/docs#partial) for partial application without `this` binding
|
||||
* [_.pick](http://lodash.com/docs#pick) and [_.omit](http://lodash.com/docs#omit) accepts `callback` and `thisArg` arguments
|
||||
* [_.template](http://lodash.com/docs#template) supports [ES6 template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6) and utilizes [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) for easier debugging
|
||||
* [_.merge](http://lodash.com/docs#merge) for a deep [_.extend](http://lodash.com/docs#extend)
|
||||
* [_.parseInt](http://lodash.com/docs#parseInt) for consistent cross-environment behavior
|
||||
* [_.partial](http://lodash.com/docs#partial) and [_.partialRight](http://lodash.com/docs#partialRight) for partial application without `this` binding
|
||||
* [_.runInContext](http://lodash.com/docs#runInContext) for easier mocking and extended environment support
|
||||
* [_.support](http://lodash.com/docs#support) to flag environment features
|
||||
* [_.template](http://lodash.com/docs#template) supports [*“imports”* options](http://lodash.com/docs#templateSettings_imports), [ES6 template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6), and [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
|
||||
* [_.transform](http://lodash.com/docs#transform) as a powerful alternative to [_.reduce](http://lodash.com/docs#reduce) for transforming objects
|
||||
* [_.unzip](http://lodash.com/docs#unzip) as the inverse of [_.zip](http://lodash.com/docs#zip)
|
||||
* [_.where](http://lodash.com/docs#where) supports deep object comparisons
|
||||
* [_.clone](http://lodash.com/docs#clone), [_.omit](http://lodash.com/docs#omit), [_.pick](http://lodash.com/docs#pick),
|
||||
[and more…](http://lodash.com/docs "_.assign, _.cloneDeep, _.first, _.initial, _.isEqual, _.last, _.merge, _.rest") accept `callback` and `thisArg` arguments
|
||||
* [_.contains](http://lodash.com/docs#contains), [_.size](http://lodash.com/docs#size), [_.toArray](http://lodash.com/docs#toArray),
|
||||
[and more…](http://lodash.com/docs "_.countBy, _.every, _.filter, _.find, _.forEach, _.groupBy, _.invoke, _.map, _.max, _.min, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.some, _.sortBy, _.where") accept strings
|
||||
[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~23, Firefox 1~16, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.8.15, Narwhal 0.3.2, RingoJS 0.8, and Rhino 1.7RC5.
|
||||
Lo-Dash has been tested in at least Chrome 5~27, Firefox 2~21, IE 6-10, Opera 9.25~12, Safari 3-6, Node.js 0.4.8-0.10.7 (Node bug [#5622](https://github.com/joyent/node/issues/5622) prevents 0.10.8-0.10.10 from working), Narwhal 0.3.2, PhantomJS 1.9.0, RingoJS 0.9, and Rhino 1.7RC5.
|
||||
|
||||
## Custom builds
|
||||
|
||||
Custom builds make it easy to create lightweight versions of Lo-Dash containing only the methods you need.
|
||||
To top it off, we handle all method dependency and alias mapping for you.
|
||||
For a more detailed summary over the differences between various builds, check out the [wiki page](https://github.com/bestiejs/lodash/wiki/build-differences).
|
||||
|
||||
* Backbone builds, with only methods required by Backbone, may be created using the `backbone` modifier argument.
|
||||
```bash
|
||||
lodash backbone
|
||||
```
|
||||
|
||||
* CSP builds, supporting default [Content Security Policy](http://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html) restrictions, may be created using the `csp` modifier argument.
|
||||
The `csp` modifier is an alais of the `mobile` modifier. Chrome extensions will require [sandboxing](http://developer.chrome.com/trunk/extensions/sandboxingEval.html) or the use of either the `csp`, `mobile`, or `underscore` build.
|
||||
```bash
|
||||
lodash csp
|
||||
```
|
||||
|
||||
* Legacy builds, tailored for older browsers without [ES5 support](http://es5.github.com/), may be created using the `legacy` modifier argument.
|
||||
* Legacy builds, tailored for older environments without [ES5 support](http://es5.github.com/), may be created using the `legacy` modifier argument.
|
||||
```bash
|
||||
lodash legacy
|
||||
```
|
||||
|
||||
* Mobile builds, with IE < 9 bug fixes and method compilation removed, may be created using the `mobile` modifier argument.
|
||||
* 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
|
||||
```
|
||||
@@ -144,7 +164,7 @@ lodash template="./*.jst"
|
||||
|
||||
* Use the `settings` argument to pass the template settings used when precompiling templates.
|
||||
```bash
|
||||
lodash settings="{interpolate:/\\{\\{([\\s\\S]+?)\\}\\}/g}"
|
||||
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.
|
||||
@@ -152,18 +172,19 @@ lodash settings="{interpolate:/\\{\\{([\\s\\S]+?)\\}\\}/g}"
|
||||
lodash moduleId="underscore"
|
||||
```
|
||||
|
||||
All arguments, except `legacy` with `csp` or `mobile`, may be combined.<br>
|
||||
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 debug output
|
||||
* `-h`, `--help` Display help information
|
||||
* `-m`, `--minify` Write only the minified output
|
||||
* `-o`, `--output` Write output to a given path/filename
|
||||
* `-s`, `--silent` Skip status updates normally logged to the console
|
||||
* `-V`, `--version` Output current version of Lo-Dash
|
||||
* `-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`).
|
||||
|
||||
@@ -190,18 +211,18 @@ To avoid potential issues, update `npm` before installing Lo-Dash:
|
||||
npm install npm -g
|
||||
```
|
||||
|
||||
In [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/):
|
||||
In [Node.js](http://nodejs.org/) and [RingoJS ≥ v0.8.0](http://ringojs.org/):
|
||||
|
||||
```js
|
||||
var _ = require('lodash');
|
||||
|
||||
// or as a drop-in replacement for Underscore
|
||||
var _ = require('lodash/lodash.underscore');
|
||||
var _ = require('lodash/dist/lodash.underscore');
|
||||
```
|
||||
|
||||
**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/):
|
||||
In [RingoJS ≤ v0.7.0](http://ringojs.org/):
|
||||
|
||||
```js
|
||||
var _ = require('lodash')._;
|
||||
@@ -226,56 +247,56 @@ require({
|
||||
});
|
||||
```
|
||||
|
||||
## Resolved Underscore.js issues
|
||||
|
||||
* Allow iteration of objects with a `length` property [[#799](https://github.com/documentcloud/underscore/pull/799), [test](https://github.com/bestiejs/lodash/blob/v1.0.0-rc.2/test/test.js#L605-L611)]
|
||||
* Fix cross-browser object iteration bugs [[#60](https://github.com/documentcloud/underscore/issues/60), [#376](https://github.com/documentcloud/underscore/issues/376), [test](https://github.com/bestiejs/lodash/blob/v1.0.0-rc.2/test/test.js#L618-L642)]
|
||||
* Methods should work on pages with incorrectly shimmed native methods [[#7](https://github.com/documentcloud/underscore/issues/7), [#742](https://github.com/documentcloud/underscore/issues/742), [test](https://github.com/bestiejs/lodash/blob/v1.0.0-rc.2/test/test.js#L140-L146)]
|
||||
* `_.isEmpty` should support jQuery/MooTools DOM query collections [[#690](https://github.com/documentcloud/underscore/pull/690), [test](https://github.com/bestiejs/lodash/blob/v1.0.0-rc.2/test/test.js#L807-L812)]
|
||||
* `_.isObject` should avoid V8 bug [#2291](http://code.google.com/p/v8/issues/detail?id=2291) [[#605](https://github.com/documentcloud/underscore/issues/605), [test](https://github.com/bestiejs/lodash/blob/v1.0.0-rc.2/test/test.js#L888-L900)]
|
||||
* `_.keys` should work with `arguments` objects cross-browser [[#396](https://github.com/documentcloud/underscore/issues/396), [test](https://github.com/bestiejs/lodash/blob/v1.0.0-rc.2/test/test.js#L981-L983)]
|
||||
* `_.range` should coerce arguments to numbers [[#634](https://github.com/documentcloud/underscore/issues/634), [#683](https://github.com/documentcloud/underscore/issues/683), [test](https://github.com/bestiejs/lodash/blob/v1.0.0-rc.2/test/test.js#L1382-L1385)]
|
||||
|
||||
## Release Notes
|
||||
|
||||
### <sup>v1.0.0-rc.2</sup> ###
|
||||
### <sup>v1.3.0</sup>
|
||||
|
||||
* Specified more method chaining behaviors
|
||||
* Updated `underscore` build compatibility to v1.4.3
|
||||
|
||||
### <sup>v1.0.0-rc.1</sup> ###
|
||||
|
||||
#### Compatibility Warnings ####
|
||||
|
||||
* Made `_(…)` chain automatically without needing to call `_#chain`
|
||||
* Made `_.isEqual` equate `arguments` objects to similar `Object` objects
|
||||
* Made `_.clone` copy the enumerable properties of `arguments` objects and objects<br>
|
||||
created by constructors other than `Object` are cloned to plain `Object` objects
|
||||
|
||||
#### Changes ####
|
||||
|
||||
* Ensure Lo-Dash runs in the JS engine embedded in Adobe products
|
||||
* Ensured `_.reduce` and `_.reduceRight` pass the correct number of `callback` arguments
|
||||
* Ensured `_.throttle` nulls the `timeoutId`
|
||||
* Made deep `_.clone` more closely follow the structured clone algorithm and copy array properties assigned by `RegExp#exec`
|
||||
* Optimized compiled templates in Firefox
|
||||
* Optimized `_.forEach`, `_.forOwn`, `_.isNumber`, and `_.isString`
|
||||
* Simplified `iteratorTemplate`
|
||||
* Added `_.transform` method
|
||||
* Added `_.chain` and `_.findWhere` aliases
|
||||
* Added internal array and object pooling
|
||||
* Added Istanbul test coverage reports to Travis CI
|
||||
* Added `maxWait` option to `_.debounce`
|
||||
* Added support for floating point numbers to `_.random`
|
||||
* Added Volo configuration to package.json
|
||||
* Adjusted UMD for `component build`
|
||||
* Allowed more stable mixing of `lodash` and `underscore` build methods
|
||||
* Ensured debounced function with, `leading` and `trailing` options, works as expected
|
||||
* Ensured minified builds work with the Dojo builder
|
||||
* Ensured minification avoids deoptimizing expressions containing boolean values
|
||||
* Ensured unknown types return `false` in `_.isObject` and `_.isRegExp`
|
||||
* Ensured `_.clone`, `_.flatten`, and `_.uniq` can be used as a `callback` for methods like `_.map`
|
||||
* Ensured `_.forIn` works on objects with longer inheritance chains in IE < 9
|
||||
* Ensured `_.isPlainObject` returns `true` for empty objects in IE < 9
|
||||
* Ensured `_.max` and `_.min` chain correctly
|
||||
* Ensured `clearTimeout` use doesn’t cause errors in Titanium
|
||||
* Ensured that the `--stdout` build option doesn't write to a file
|
||||
* Exposed memoized function’s `cache`
|
||||
* Fixed `Error.prototype` iteration bugs
|
||||
* Fixed "scripts" paths in component.json
|
||||
* Made methods support customizing `_.indexOf`
|
||||
* Made the build track dependencies of private functions
|
||||
* Made the `template` pre-compiler build option avoid escaping non-ascii characters
|
||||
* Made `_.createCallback` avoid binding functions if they don’t reference `this`
|
||||
* Optimized the Closure Compiler minification process
|
||||
* Optimized the large array cache for `_.difference`, `_.intersection`, and `_.uniq`
|
||||
* Optimized internal `_.flatten` and `_.indexOf` use
|
||||
* Reduced `_.unzip` and `_.zip`
|
||||
* Removed special handling of arrays in `_.assign` and `_.defaults`
|
||||
|
||||
The full changelog is available [here](https://github.com/bestiejs/lodash/wiki/Changelog).
|
||||
|
||||
## BestieJS
|
||||
|
||||
Lo-Dash is part of the BestieJS *“Best in Class”* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation.
|
||||
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
|
||||
|
||||
* [John-David Dalton](http://allyoucanleet.com/)
|
||||
[](https://twitter.com/jdalton "Follow @jdalton on Twitter")
|
||||
| [](http://twitter.com/jdalton "Follow @jdalton on Twitter") |
|
||||
|---|
|
||||
| [John-David Dalton](http://allyoucanleet.com/) |
|
||||
|
||||
## Contributors
|
||||
|
||||
* [Kit Cambridge](http://kitcambridge.github.com/)
|
||||
[](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter")
|
||||
* [Mathias Bynens](http://mathiasbynens.be/)
|
||||
[](https://twitter.com/mathias "Follow @mathias on Twitter")
|
||||
| [](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [](http://twitter.com/mathias "Follow @mathias on Twitter") |
|
||||
|---|---|
|
||||
| [Kit Cambridge](http://kitcambridge.github.io/) | [Mathias Bynens](http://mathiasbynens.be/) |
|
||||
|
||||
24
bower.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "lodash",
|
||||
"version": "1.3.0",
|
||||
"main": "./dist/lodash.compat.js",
|
||||
"ignore": [
|
||||
".*",
|
||||
"*.custom.*",
|
||||
"*.template.*",
|
||||
"*.d.ts",
|
||||
"*.map",
|
||||
"*.md",
|
||||
"*.txt",
|
||||
"build.js",
|
||||
"index.js",
|
||||
"component.json",
|
||||
"package.json",
|
||||
"build",
|
||||
"doc",
|
||||
"node_modules",
|
||||
"perf",
|
||||
"test",
|
||||
"vendor"
|
||||
]
|
||||
}
|
||||
591
build/minify.js
@@ -2,35 +2,69 @@
|
||||
;(function() {
|
||||
'use strict';
|
||||
|
||||
/** The Node filesystem, path, `zlib`, and child process modules */
|
||||
var fs = require('fs'),
|
||||
gzip = require('zlib').gzip,
|
||||
path = require('path'),
|
||||
spawn = require('child_process').spawn;
|
||||
/** Load Node.js modules */
|
||||
var cp = require('child_process'),
|
||||
https = require('https'),
|
||||
zlib = require('zlib');
|
||||
|
||||
/** Load other modules */
|
||||
var _ = require('../lodash.js'),
|
||||
preprocess = require('./pre-compile.js'),
|
||||
postprocess = require('./post-compile.js'),
|
||||
tar = require('../vendor/tar/tar.js'),
|
||||
util = require('./util.js');
|
||||
|
||||
/** Module shortcuts */
|
||||
var fs = util.fs,
|
||||
path = util.path;
|
||||
|
||||
/** The Git object ID of `closure-compiler.tar.gz` */
|
||||
var closureId = '9fd5d61c1b706e7505aeb5187941c2c5497e5fd8';
|
||||
|
||||
/** The Git object ID of `uglifyjs.tar.gz` */
|
||||
var uglifyId = '7de2795a3af58d1b293e3b0e83cdbc994f4941dc';
|
||||
|
||||
/** The path of the directory that is the base of the repository */
|
||||
var basePath = fs.realpathSync(path.join(__dirname, '..'));
|
||||
|
||||
/** The path of the directory where the Closure Compiler is located */
|
||||
var closurePath = path.join(basePath, 'vendor', 'closure-compiler', 'compiler.jar');
|
||||
/** The path of the `vendor` directory */
|
||||
var vendorPath = path.join(basePath, 'vendor');
|
||||
|
||||
/** Load other modules */
|
||||
var preprocess = require('./pre-compile.js'),
|
||||
postprocess = require('./post-compile.js'),
|
||||
uglifyJS = require('../vendor/uglifyjs/uglify-js.js');
|
||||
/** 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'
|
||||
};
|
||||
|
||||
/** Reassign `existsSync` for older versions of Node */
|
||||
fs.existsSync || (fs.existsSync = path.existsSync);
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
@@ -50,6 +84,12 @@
|
||||
* 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 = {});
|
||||
|
||||
@@ -58,28 +98,106 @@
|
||||
// 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],
|
||||
isSilent = options.indexOf('-s') > -1 || options.indexOf('--silent') > -1,
|
||||
isTemplate = options.indexOf('-t') > -1 || options.indexOf('--template') > -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];
|
||||
result = path.join(fs.realpathSync(path.dirname(result)), path.basename(result));
|
||||
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,
|
||||
'outputPath': outputPath
|
||||
'modes': modes,
|
||||
'outputPath': outputPath,
|
||||
'sourceMapURL': sourceMapURL
|
||||
};
|
||||
|
||||
source = fs.readFileSync(filePath, 'utf8');
|
||||
}
|
||||
new Minify(source, options);
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -104,19 +222,141 @@
|
||||
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;
|
||||
|
||||
source = preprocess(source, options);
|
||||
this.source = source;
|
||||
var modes = this.modes = options.modes;
|
||||
source = this.source = preprocess(source, options);
|
||||
|
||||
this.onComplete = options.onComplete || function(source) {
|
||||
fs.writeFileSync(this.outputPath, source, 'utf8');
|
||||
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
|
||||
closureCompile.call(this, source, 'simple', onClosureSimpleCompile.bind(this));
|
||||
if (_.contains(modes, 'simple')) {
|
||||
closureCompile.call(this, source, 'simple', onClosureSimpleCompile.bind(this));
|
||||
} else if (_.contains(modes, 'advanced')) {
|
||||
onClosureSimpleGzip.call(this);
|
||||
} else {
|
||||
onClosureAdvancedGzip.call(this);
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Fetches a required `.tar.gz` dependency with the given Git object ID from
|
||||
* the Lo-Dash repo on GitHub. The object ID may be obtained by running
|
||||
* `git hash-object path/to/dependency.tar.gz`.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} options The options object.
|
||||
* id - The Git object ID of the `.tar.gz` file.
|
||||
* onComplete - The function called once the extraction has finished.
|
||||
* path - The path of the extraction directory.
|
||||
* title - The dependency's title used in status updates logged to the console.
|
||||
*/
|
||||
function getDependency(options) {
|
||||
options || (options = {});
|
||||
|
||||
var ran,
|
||||
destPath = options.path,
|
||||
hashId = options.hashId,
|
||||
id = options.id,
|
||||
onComplete = options.onComplete,
|
||||
title = options.title;
|
||||
|
||||
// exit early if dependency exists
|
||||
if (fs.existsSync(path.join(destPath, id))) {
|
||||
onComplete();
|
||||
return;
|
||||
}
|
||||
var callback = function(exception) {
|
||||
if (ran) {
|
||||
return;
|
||||
}
|
||||
if (exception) {
|
||||
console.error([
|
||||
'There was a problem installing ' + title + '.',
|
||||
'Try running the command as root, via `sudo`, or manually install by running:',
|
||||
'',
|
||||
"curl -H 'Accept: " + mediaType + "' " + location.href + '/' + hashId + " | tar xvz -C '" + destPath + "'",
|
||||
''
|
||||
].join('\n'));
|
||||
}
|
||||
ran = true;
|
||||
process.removeListener('uncaughtException', callback);
|
||||
onComplete(exception);
|
||||
};
|
||||
|
||||
console.log('Downloading ' + title + '...');
|
||||
process.on('uncaughtException', callback);
|
||||
|
||||
https.get({
|
||||
'host': location.host,
|
||||
'path': location.pathname + '/' + hashId,
|
||||
'headers': {
|
||||
// By default, all GitHub blob API endpoints return a JSON document
|
||||
// containing Base64-encoded blob data. Overriding the `Accept` header
|
||||
// with the GitHub raw media type returns the blob data directly.
|
||||
// See http://developer.github.com/v3/media/.
|
||||
'Accept': mediaType,
|
||||
// As of 2013-04-24, the GitHub API mandates the `User-Agent` header
|
||||
// for all requests.
|
||||
'User-Agent': 'Lo-Dash/' + _.VERSION
|
||||
}
|
||||
}, function(response) {
|
||||
var decompressor = zlib.createUnzip(),
|
||||
parser = new tar.Extract({ 'path': destPath });
|
||||
|
||||
parser.on('end', callback);
|
||||
response.pipe(decompressor).pipe(parser);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the Java command-line options used for faster minification by
|
||||
* the Closure Compiler, invoking the `callback` when finished. Subsequent
|
||||
* calls will lazily return the previously retrieved options. The `callback`
|
||||
* is invoked with one argument; (options).
|
||||
*
|
||||
* See https://code.google.com/p/closure-compiler/wiki/FAQ#What_are_the_recommended_Java_VM_command-line_options?.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} callback The function called once the options have been retrieved.
|
||||
*/
|
||||
function getJavaOptions(callback) {
|
||||
var result = [];
|
||||
cp.exec('java -version -client -d32', function(error) {
|
||||
if (!error && process.platform != 'win32') {
|
||||
result.push('-client', '-d32');
|
||||
}
|
||||
getJavaOptions = function(callback) {
|
||||
_.defer(callback, result);
|
||||
};
|
||||
callback(result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves the source map path from the given output path.
|
||||
*
|
||||
* @private
|
||||
* @param {String} outputPath The output path.
|
||||
* @returns {String} Returns the source map path.
|
||||
*/
|
||||
function getMapPath(outputPath) {
|
||||
return path.join(path.dirname(outputPath), path.basename(outputPath, '.js') + '.map');
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
@@ -131,40 +371,93 @@
|
||||
* @param {Function} callback The function called once the process has completed.
|
||||
*/
|
||||
function closureCompile(source, mode, callback) {
|
||||
// use simple optimizations when minifying template files
|
||||
var options = closureOptions.slice();
|
||||
options.push('--compilation_level=' + optimizationModes[this.isTemplate ? 'simple' : mode]);
|
||||
var filePath = this.filePath,
|
||||
isAdvanced = mode == 'advanced',
|
||||
isMapped = this.isMapped,
|
||||
isSilent = this.isSilent,
|
||||
isTemplate = this.isTemplate,
|
||||
options = closureOptions.slice(),
|
||||
outputPath = this.outputPath,
|
||||
mapPath = getMapPath(outputPath),
|
||||
sourceMapURL = this.sourceMapURL || path.basename(mapPath);
|
||||
|
||||
// the standard error stream, standard output stream, and the Closure Compiler process
|
||||
var error = '',
|
||||
output = '',
|
||||
compiler = spawn('java', ['-jar', closurePath].concat(options));
|
||||
|
||||
if (!this.isSilent) {
|
||||
console.log('Compressing ' + path.basename(this.outputPath, '.js') + ' using the Closure Compiler (' + mode + ')...');
|
||||
// remove copyright header to make other modifications easier
|
||||
var license = (/^(?:\s*\/\/.*\s*|\s*\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/\s*)*/.exec(source) || [''])[0];
|
||||
if (license) {
|
||||
source = source.replace(license, '');
|
||||
}
|
||||
compiler.stdout.on('data', function(data) {
|
||||
// append the data to the output stream
|
||||
output += data;
|
||||
});
|
||||
|
||||
compiler.stderr.on('data', function(data) {
|
||||
// append the error message to the error stream
|
||||
error += data;
|
||||
});
|
||||
var hasIIFE = /^;?\(function[^{]+{/.test(source),
|
||||
isStrict = hasIIFE && /^;?\(function[^{]+{\s*["']use strict["']/.test(source);
|
||||
|
||||
compiler.on('exit', function(status) {
|
||||
// `status` contains the process exit code
|
||||
var exception = null;
|
||||
if (status) {
|
||||
exception = new Error(error);
|
||||
exception.status = status;
|
||||
// to avoid stripping the IIFE, convert it to a function call
|
||||
if (hasIIFE && isAdvanced) {
|
||||
source = source
|
||||
.replace(/\(function/, '__iife__$&')
|
||||
.replace(/\(this\)\)([\s;]*(\n\/\/.+)?)$/, ', this)$1');
|
||||
}
|
||||
|
||||
options.push('--compilation_level=' + optimizationModes[mode]);
|
||||
if (isMapped) {
|
||||
options.push('--create_source_map=' + mapPath, '--source_map_format=V3');
|
||||
}
|
||||
if (isTemplate) {
|
||||
options.push('--charset=UTF-8');
|
||||
}
|
||||
|
||||
getJavaOptions(function(javaOptions) {
|
||||
var compiler = cp.spawn('java', javaOptions.concat('-jar', closurePath, options));
|
||||
if (!isSilent) {
|
||||
console.log('Compressing ' + path.basename(outputPath, '.js') + ' using the Closure Compiler (' + mode + ')...');
|
||||
}
|
||||
callback(exception, output);
|
||||
});
|
||||
|
||||
// proxy the standard input to the Closure Compiler
|
||||
compiler.stdin.end(source);
|
||||
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);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -178,31 +471,47 @@
|
||||
* @param {Function} callback The function called once the process has completed.
|
||||
*/
|
||||
function uglify(source, label, callback) {
|
||||
var exception,
|
||||
result,
|
||||
ugly = uglifyJS.uglify;
|
||||
|
||||
if (!this.isSilent) {
|
||||
console.log('Compressing ' + path.basename(this.outputPath, '.js') + ' using ' + label + '...');
|
||||
}
|
||||
try {
|
||||
result = ugly.gen_code(
|
||||
// enable unsafe transformations
|
||||
ugly.ast_squeeze_more(
|
||||
ugly.ast_squeeze(
|
||||
// munge variable and function names, excluding the special `define`
|
||||
// function exposed by AMD loaders
|
||||
ugly.ast_mangle(uglifyJS.parser.parse(source), {
|
||||
'except': ['define']
|
||||
}
|
||||
))), {
|
||||
'ascii_only': true
|
||||
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']
|
||||
});
|
||||
} catch(e) {
|
||||
exception = e;
|
||||
|
||||
// 4. output
|
||||
// restrict lines to 500 characters for consistency with the Closure Compiler
|
||||
var stream = uglifyJS.OutputStream({
|
||||
'ascii_only': !this.isTemplate,
|
||||
'comments': /@cc_on|@license|@preserve/i,
|
||||
'max_line_len': 500,
|
||||
});
|
||||
|
||||
toplevel.print(stream);
|
||||
}
|
||||
// lines are restricted to 500 characters for consistency with the Closure Compiler
|
||||
callback(exception, result && ugly.split_lines(result, 500));
|
||||
catch(e) {
|
||||
var exception = e;
|
||||
}
|
||||
callback(exception, stream && String(stream));
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
@@ -213,14 +522,18 @@
|
||||
* @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) {
|
||||
function onClosureSimpleCompile(exception, result, map) {
|
||||
if (exception) {
|
||||
throw exception;
|
||||
}
|
||||
result = postprocess(result);
|
||||
this.compiled.simple.source = result;
|
||||
gzip(result, onClosureSimpleGzip.bind(this));
|
||||
|
||||
var simple = this.compiled.simple;
|
||||
simple.source = result;
|
||||
simple.sourceMap = map;
|
||||
zlib.gzip(result, onClosureSimpleGzip.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -234,13 +547,18 @@
|
||||
if (exception) {
|
||||
throw exception;
|
||||
}
|
||||
if (!this.isSilent) {
|
||||
console.log('Done. Size: %d bytes.', result.length);
|
||||
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);
|
||||
}
|
||||
this.compiled.simple.gzip = result;
|
||||
|
||||
// next, compile the source using advanced optimizations
|
||||
closureCompile.call(this, this.source, 'advanced', onClosureAdvancedCompile.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -249,14 +567,18 @@
|
||||
* @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) {
|
||||
function onClosureAdvancedCompile(exception, result, map) {
|
||||
if (exception) {
|
||||
throw exception;
|
||||
}
|
||||
result = postprocess(result);
|
||||
this.compiled.advanced.source = result;
|
||||
gzip(result, onClosureAdvancedGzip.bind(this));
|
||||
|
||||
var advanced = this.compiled.advanced;
|
||||
advanced.source = result;
|
||||
advanced.sourceMap = map;
|
||||
zlib.gzip(result, onClosureAdvancedGzip.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -270,13 +592,18 @@
|
||||
if (exception) {
|
||||
throw exception;
|
||||
}
|
||||
if (!this.isSilent) {
|
||||
console.log('Done. Size: %d bytes.', result.length);
|
||||
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);
|
||||
}
|
||||
this.compiled.advanced.gzip = result;
|
||||
|
||||
// next, minify the source using only UglifyJS
|
||||
uglify.call(this, this.source, 'UglifyJS', onUglify.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -292,7 +619,7 @@
|
||||
}
|
||||
result = postprocess(result);
|
||||
this.uglified.source = result;
|
||||
gzip(result, onUglifyGzip.bind(this));
|
||||
zlib.gzip(result, onUglifyGzip.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -306,13 +633,23 @@
|
||||
if (exception) {
|
||||
throw exception;
|
||||
}
|
||||
if (!this.isSilent) {
|
||||
console.log('Done. Size: %d bytes.', result.length);
|
||||
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);
|
||||
}
|
||||
this.uglified.gzip = result;
|
||||
|
||||
// next, minify the already Closure Compiler simple optimized source using UglifyJS
|
||||
uglify.call(this, this.compiled.simple.source, 'hybrid (simple)', onSimpleHybrid.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -328,7 +665,7 @@
|
||||
}
|
||||
result = postprocess(result);
|
||||
this.hybrid.simple.source = result;
|
||||
gzip(result, onSimpleHybridGzip.bind(this));
|
||||
zlib.gzip(result, onSimpleHybridGzip.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -342,13 +679,18 @@
|
||||
if (exception) {
|
||||
throw exception;
|
||||
}
|
||||
if (!this.isSilent) {
|
||||
console.log('Done. Size: %d bytes.', result.length);
|
||||
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);
|
||||
}
|
||||
this.hybrid.simple.gzip = result;
|
||||
|
||||
// next, minify the already Closure Compiler advance optimized source using UglifyJS
|
||||
uglify.call(this, this.compiled.advanced.source, 'hybrid (advanced)', onAdvancedHybrid.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -364,7 +706,7 @@
|
||||
}
|
||||
result = postprocess(result);
|
||||
this.hybrid.advanced.source = result;
|
||||
gzip(result, onAdvancedHybridGzip.bind(this));
|
||||
zlib.gzip(result, onAdvancedHybridGzip.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -378,11 +720,12 @@
|
||||
if (exception) {
|
||||
throw exception;
|
||||
}
|
||||
if (!this.isSilent) {
|
||||
console.log('Done. Size: %d bytes.', result.length);
|
||||
if (result != null) {
|
||||
if (!this.isSilent) {
|
||||
console.log('Done. Size: %d bytes.', result.length);
|
||||
}
|
||||
this.hybrid.advanced.gzip = result;
|
||||
}
|
||||
this.hybrid.advanced.gzip = result;
|
||||
|
||||
// finish by choosing the smallest compressed file
|
||||
onComplete.call(this);
|
||||
}
|
||||
@@ -399,20 +742,32 @@
|
||||
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 = Math.min(
|
||||
compiledSimple.gzip.length,
|
||||
compiledAdvanced.gzip.length,
|
||||
uglified.gzip.length,
|
||||
hybridSimple.gzip.length,
|
||||
hybridAdvanced.gzip.length
|
||||
);
|
||||
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
|
||||
[compiledSimple, compiledAdvanced, uglified, hybridSimple, hybridAdvanced].some(function(data) {
|
||||
if (data.gzip.length == min) {
|
||||
this.onComplete(data.source);
|
||||
objects.some(function(data) {
|
||||
var gzip = data.gzip;
|
||||
if (gzip && gzip.length == min) {
|
||||
data.outputPath = this.outputPath;
|
||||
this.onComplete(data);
|
||||
return true;
|
||||
}
|
||||
}, this);
|
||||
}
|
||||
|
||||
@@ -2,19 +2,18 @@
|
||||
;(function() {
|
||||
'use strict';
|
||||
|
||||
/** The Node filesystem module */
|
||||
var fs = require('fs');
|
||||
/** Load Node.js modules */
|
||||
var fs = require('fs'),
|
||||
vm = require('vm');
|
||||
|
||||
/** The minimal license/copyright template */
|
||||
var licenseTemplate = {
|
||||
'lodash':
|
||||
'/*!\n' +
|
||||
' Lo-Dash @VERSION lodash.com/license\n' +
|
||||
' Underscore.js 1.4.3 underscorejs.org/LICENSE\n' +
|
||||
'*/',
|
||||
'underscore':
|
||||
'/*! Underscore.js @VERSION underscorejs.org/LICENSE */'
|
||||
};
|
||||
var licenseTemplate = [
|
||||
'/**',
|
||||
' * @license',
|
||||
' * Lo-Dash <%= VERSION %> lodash.com/license',
|
||||
' * Underscore.js 1.4.4 underscorejs.org/LICENSE',
|
||||
' */'
|
||||
].join('\n');
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
@@ -26,32 +25,73 @@
|
||||
* @returns {String} Returns the processed source.
|
||||
*/
|
||||
function postprocess(source) {
|
||||
// move vars exposed by the Closure Compiler into the IIFE
|
||||
source = source.replace(/^((?:(['"])use strict\2;)?(?:var (?:[a-z]+=(?:!0|!1|null)[,;])+)?)([\s\S]*?function[^)]+\){)/, '$3$1');
|
||||
// correct overly aggressive Closure Compiler advanced optimization
|
||||
source = source
|
||||
.replace(/(document[^&]+&&)\s*(?:\w+|!\d)/, '$1!({toString:0}+"")')
|
||||
.replace(/"\t"/g, '"\\t"')
|
||||
.replace(/"[^"]*?\\f[^"]*?"/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"'
|
||||
);
|
||||
|
||||
// correct overly aggressive Closure Compiler advanced optimizations
|
||||
source = source.replace(/prototype\s*=\s*{\s*valueOf\s*:\s*1\s*}/, 'prototype={valueOf:1,y:1}');
|
||||
try {
|
||||
var context = vm.createContext({});
|
||||
vm.runInContext(source, context);
|
||||
} catch(e) { }
|
||||
|
||||
// unescape properties (i.e. foo["bar"] => foo.bar)
|
||||
source = source.replace(/(\w)\["([^."]+)"\]/g, function(match, left, right) {
|
||||
return /\W/.test(right) ? match : (left + '.' + right);
|
||||
['forEach', 'forIn', 'forOwn'].forEach(function(methodName) {
|
||||
var pairs = /[!=]==\s*([a-zA-Z]+)(?!\()|([a-zA-Z]+)\s*[!=]==/.exec((context._ || {})[methodName]),
|
||||
varName = pairs && (pairs[1] || pairs[2]),
|
||||
value = (value = varName && RegExp('\\b' + varName + '\\s*=\\s*!([01])\\b').exec(source)) && !+value[1];
|
||||
|
||||
if (typeof value == 'boolean') {
|
||||
// replace vars for `false` and `true` with boolean literals
|
||||
source = source.replace(RegExp('([!=]==\\s*)' + varName + '\\b(?!\\()|\\b' + varName + '(\\s*[!=]==)', 'g'), function(match, prelude, postlude, at) {
|
||||
// avoid replacing local variables with the same name
|
||||
return RegExp('\\b' + varName + '\\s*(?:,|=[^=])').test(source.slice(at - 10, at))
|
||||
? match
|
||||
: (prelude || '') + value + (postlude || '');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// correct AMD module definition for AMD build optimizers
|
||||
source = source.replace(/("function")\s*==\s*(typeof define)\s*&&\s*\(?\s*("object")\s*==\s*(typeof define\.amd)\s*&&\s*(define\.amd)\s*\)?/, '$2==$1&&$4==$3&&$5');
|
||||
// replace `!1` and `!0` in expressions with `false` and `true` values
|
||||
[/([!=]==)\s*!1\b|(.)!1\s*([!=]==)/g, /([!=]==)\s*!0\b|(.)!0\s*([!=]==)/g].forEach(function(regexp, index) {
|
||||
source = source.replace(regexp, function(match, prelude, chr, postlude) {
|
||||
return (prelude || chr + (/\w/.test(chr) ? ' ' : '')) + !!index + (postlude || '');
|
||||
});
|
||||
});
|
||||
|
||||
// flip `typeof` expressions to help optimize Safari and
|
||||
// correct the AMD module definition for AMD build optimizers
|
||||
// (e.g. from `"number" == typeof x` to `typeof x == "number")
|
||||
source = source.replace(/(\w)?("[^"]+")\s*([!=]=)\s*(typeof(?:\s*\([^)]+\)|\s+[.\w]+(?!\[)))/g, function(match, other, type, equality, expression) {
|
||||
return (other ? other + ' ' : '') + expression + equality + type;
|
||||
});
|
||||
|
||||
// add a space so `define` is detected by the Dojo builder
|
||||
source = source.replace(/(.)(define\()/, function(match, prelude, define) {
|
||||
return prelude + (/^\S/.test(prelude) ? ' ' : '') + define;
|
||||
});
|
||||
|
||||
// add trailing semicolon
|
||||
if (source) {
|
||||
source = source.replace(/[\s;]*$/, ';');
|
||||
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 copyright/license header
|
||||
return licenseTemplate[/call\(this\);?$/.test(source) ? 'underscore' : 'lodash']
|
||||
.replace('@VERSION', snippet[2]) + '\n;' + source;
|
||||
// remove copyright header
|
||||
source = source.replace(/^\/\**[\s\S]+?\*\/\n/, '');
|
||||
|
||||
// add new copyright header
|
||||
var version = snippet[2];
|
||||
source = licenseTemplate.replace('<%= VERSION %>', version) + '\n;' + source;
|
||||
|
||||
return source;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
@@ -1,144 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
;(function() {
|
||||
'use strict';
|
||||
|
||||
/** Load Node modules */
|
||||
var exec = require('child_process').exec,
|
||||
fs = require('fs'),
|
||||
https = require('https'),
|
||||
path = require('path'),
|
||||
tar = require('../vendor/tar/tar.js'),
|
||||
zlib = require('zlib');
|
||||
|
||||
/** 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 Git object ID of `closure-compiler.tar.gz` */
|
||||
var closureId = 'a2787b470c577cee2404d186c562dd9835f779f5';
|
||||
|
||||
/** The Git object ID of `uglifyjs.tar.gz` */
|
||||
var uglifyId = '3390b259e04829538e4d3635d12b317dd6103eca';
|
||||
|
||||
/** The media type for raw blob data */
|
||||
var mediaType = 'application/vnd.github.v3.raw';
|
||||
|
||||
/** 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': host + origin + pathname,
|
||||
'origin': origin,
|
||||
'pathname': pathname
|
||||
};
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* 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, invoked with one argument (exception),
|
||||
* 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 id = options.id,
|
||||
onComplete = options.onComplete,
|
||||
path = options.path,
|
||||
title = options.title;
|
||||
|
||||
function callback(exception) {
|
||||
if (exception) {
|
||||
console.error([
|
||||
'There was a problem installing ' + title + '. To manually install, run:',
|
||||
'',
|
||||
"curl -H 'Accept: " + mediaType + "' " + location.href + '/' + id + " | tar xvz -C '" + path + "'"
|
||||
].join('\n'));
|
||||
}
|
||||
onComplete(exception);
|
||||
}
|
||||
|
||||
console.log('Downloading ' + title + '...');
|
||||
|
||||
https.get({
|
||||
'host': location.host,
|
||||
'path': location.pathname + '/' + id,
|
||||
'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
|
||||
}
|
||||
}, function(response) {
|
||||
var decompressor = zlib.createUnzip(),
|
||||
parser = new tar.Extract({ 'path': path });
|
||||
|
||||
decompressor.on('error', callback)
|
||||
parser.on('end', callback).on('error', callback);
|
||||
response.pipe(decompressor).pipe(parser);
|
||||
})
|
||||
.on('error', callback);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
exec('npm -g root', function(exception, stdout) {
|
||||
if (!exception) {
|
||||
try {
|
||||
var isGlobal = path.resolve(basePath, '..') == fs.realpathSync(stdout.trim());
|
||||
} catch(e) {
|
||||
exception = e;
|
||||
}
|
||||
}
|
||||
if (exception) {
|
||||
console.error([
|
||||
'Oops! There was a problem detecting the install mode. If you’re installing the',
|
||||
'Lo-Dash command-line executable (via `npm install -g lodash`), you’ll need to',
|
||||
'manually install UglifyJS and the Closure Compiler by running:',
|
||||
'',
|
||||
"curl -H 'Accept: " + mediaType + "' " + location.href + '/' + closureId + " | tar xvz -C '" + vendorPath + "'",
|
||||
"curl -H 'Accept: " + mediaType + "' " + location.href + '/' + uglifyId + " | tar xvz -C '" + vendorPath + "'",
|
||||
'',
|
||||
'Please submit an issue on the GitHub issue tracker: ' + process.env.npm_package_bugs_url
|
||||
].join('\n'));
|
||||
|
||||
console.error(exception);
|
||||
}
|
||||
if (!isGlobal) {
|
||||
return;
|
||||
}
|
||||
// download the Closure Compiler
|
||||
getDependency({
|
||||
'title': 'the Closure Compiler',
|
||||
'id': closureId,
|
||||
'path': vendorPath,
|
||||
'onComplete': function() {
|
||||
// download UglifyJS
|
||||
getDependency({
|
||||
'title': 'UglifyJS',
|
||||
'id': uglifyId,
|
||||
'path': vendorPath,
|
||||
'onComplete': function() {
|
||||
process.exit();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}());
|
||||
@@ -2,51 +2,61 @@
|
||||
;(function() {
|
||||
'use strict';
|
||||
|
||||
/** The Node filesystem module */
|
||||
/** The Node.js filesystem module */
|
||||
var fs = require('fs');
|
||||
|
||||
/** Used to minify variables embedded in compiled strings */
|
||||
var compiledVars = [
|
||||
'args',
|
||||
'argsIndex',
|
||||
'argsLength',
|
||||
'callback',
|
||||
'className',
|
||||
'collection',
|
||||
'createCallback',
|
||||
'conditions',
|
||||
'ctor',
|
||||
'errorClass',
|
||||
'errorProto',
|
||||
'guard',
|
||||
'hasOwnProperty',
|
||||
'index',
|
||||
'isArguments',
|
||||
'isArray',
|
||||
'isProto',
|
||||
'isString',
|
||||
'iteratee',
|
||||
'iterable',
|
||||
'length',
|
||||
'nativeKeys',
|
||||
'keys',
|
||||
'lodash',
|
||||
'nonEnum',
|
||||
'nonEnumProps',
|
||||
'object',
|
||||
'objectProto',
|
||||
'objectTypes',
|
||||
'ownIndex',
|
||||
'ownProps',
|
||||
'propertyIsEnumerable',
|
||||
'result',
|
||||
'skipErrorProps',
|
||||
'skipProto',
|
||||
'source',
|
||||
'thisArg'
|
||||
'stringClass',
|
||||
'stringProto',
|
||||
'thisArg',
|
||||
'toString'
|
||||
];
|
||||
|
||||
/** Used to minify `compileIterator` option properties */
|
||||
/** Used to minify `iteratorTemplate` data properties */
|
||||
var iteratorOptions = [
|
||||
'args',
|
||||
'arrayLoop',
|
||||
'array',
|
||||
'bottom',
|
||||
'firstArg',
|
||||
'hasDontEnumBug',
|
||||
'isKeysFast',
|
||||
'objectLoop',
|
||||
'noArgsEnum',
|
||||
'noCharByIndex',
|
||||
'shadowed',
|
||||
'init',
|
||||
'loop',
|
||||
'shadowedProps',
|
||||
'top',
|
||||
'useHas',
|
||||
'useStrict'
|
||||
'useKeys'
|
||||
];
|
||||
|
||||
/** Used to minify variables and string values to a single character */
|
||||
@@ -57,24 +67,43 @@
|
||||
|
||||
/** Used to protect the specified properties from getting minified */
|
||||
var propWhitelist = [
|
||||
'Array',
|
||||
'Boolean',
|
||||
'Date',
|
||||
'Error',
|
||||
'Function',
|
||||
'Math',
|
||||
'Number',
|
||||
'Object',
|
||||
'RegExp',
|
||||
'String',
|
||||
'TypeError',
|
||||
'VERSION',
|
||||
'_',
|
||||
'__wrapped__',
|
||||
'after',
|
||||
'all',
|
||||
'amd',
|
||||
'any',
|
||||
'argsClass',
|
||||
'argsObject',
|
||||
'array',
|
||||
'assign',
|
||||
'at',
|
||||
'attachEvent',
|
||||
'bind',
|
||||
'bindAll',
|
||||
'bindKey',
|
||||
'chain',
|
||||
'cache',
|
||||
'clearTimeout',
|
||||
'clone',
|
||||
'cloneDeep',
|
||||
'collect',
|
||||
'compact',
|
||||
'compose',
|
||||
'contains',
|
||||
'countBy',
|
||||
'createCallback',
|
||||
'criteria',
|
||||
'debounce',
|
||||
'defaults',
|
||||
@@ -84,14 +113,20 @@
|
||||
'difference',
|
||||
'drop',
|
||||
'each',
|
||||
'enumErrorProps',
|
||||
'enumPrototypes',
|
||||
'environment',
|
||||
'escape',
|
||||
'evaluate',
|
||||
'every',
|
||||
'exports',
|
||||
'extend',
|
||||
'fastBind',
|
||||
'fastKeys',
|
||||
'filter',
|
||||
'find',
|
||||
'findIndex',
|
||||
'findKey',
|
||||
'first',
|
||||
'flatten',
|
||||
'foldl',
|
||||
@@ -99,12 +134,14 @@
|
||||
'forEach',
|
||||
'forIn',
|
||||
'forOwn',
|
||||
'function',
|
||||
'functions',
|
||||
'global',
|
||||
'groupBy',
|
||||
'has',
|
||||
'head',
|
||||
'identity',
|
||||
'imports',
|
||||
'include',
|
||||
'index',
|
||||
'indexOf',
|
||||
@@ -136,20 +173,29 @@
|
||||
'keys',
|
||||
'last',
|
||||
'lastIndexOf',
|
||||
'leading',
|
||||
'map',
|
||||
'max',
|
||||
'maxWait',
|
||||
'memoize',
|
||||
'merge',
|
||||
'methods',
|
||||
'min',
|
||||
'mixin',
|
||||
'noConflict',
|
||||
'nodeClass',
|
||||
'nonEnumArgs',
|
||||
'nonEnumShadows',
|
||||
'null',
|
||||
'number',
|
||||
'object',
|
||||
'omit',
|
||||
'once',
|
||||
'opera',
|
||||
'ownLast',
|
||||
'pairs',
|
||||
'parseInt',
|
||||
'partial',
|
||||
'partialRight',
|
||||
'pick',
|
||||
'pluck',
|
||||
'random',
|
||||
@@ -159,13 +205,19 @@
|
||||
'reject',
|
||||
'rest',
|
||||
'result',
|
||||
'runInContext',
|
||||
'select',
|
||||
'setImmediate',
|
||||
'setTimeout',
|
||||
'shuffle',
|
||||
'size',
|
||||
'some',
|
||||
'sortBy',
|
||||
'sortedIndex',
|
||||
'source',
|
||||
'spliceObjects',
|
||||
'string',
|
||||
'support',
|
||||
'tail',
|
||||
'take',
|
||||
'tap',
|
||||
@@ -174,26 +226,30 @@
|
||||
'throttle',
|
||||
'times',
|
||||
'toArray',
|
||||
'trailing',
|
||||
'transform',
|
||||
'undefined',
|
||||
'unescape',
|
||||
'unindexedChars',
|
||||
'union',
|
||||
'uniq',
|
||||
'unique',
|
||||
'uniqueId',
|
||||
'unzip',
|
||||
'value',
|
||||
'values',
|
||||
'variable',
|
||||
'VERSION',
|
||||
'where',
|
||||
'window',
|
||||
'without',
|
||||
'wrap',
|
||||
'zip',
|
||||
'zipObject',
|
||||
|
||||
// property used by the `lodash underscore` build
|
||||
// properties used by the `backbone` and `underscore` builds
|
||||
'__chain__',
|
||||
|
||||
// properties used by underscore.js
|
||||
'_chain',
|
||||
'_wrapped'
|
||||
'chain',
|
||||
'findWhere'
|
||||
];
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
@@ -215,20 +271,20 @@
|
||||
if (options.isTemplate) {
|
||||
return source;
|
||||
}
|
||||
// remove copyright/license header to add later in post-compile.js
|
||||
source = source.replace(/\/\*![\s\S]+?\*\//, '');
|
||||
|
||||
// add brackets to whitelisted properties so the Closure Compiler won't mung them
|
||||
// http://code.google.com/closure/compiler/docs/api-tutorial3.html#export
|
||||
source = source.replace(RegExp('\\.(' + propWhitelist.join('|') + ')\\b', 'g'), function(match, prop) {
|
||||
return "['" + prop.replace(/['\n\r\t]/g, '\\$&') + "']";
|
||||
});
|
||||
|
||||
// remove brackets from `_.escape()` in `_.template`
|
||||
source = source.replace(/__e *= *_\['escape']/g, '__e=_.escape');
|
||||
// remove brackets from `lodash.createCallback` in `eachIteratorOptions`
|
||||
source = source.replace('lodash[\'createCallback\'](callback, thisArg)"', 'lodash.createCallback(callback, thisArg)"');
|
||||
|
||||
// remove brackets from `_.escape()` in underscore.js `_.template`
|
||||
source = source.replace(/_\['escape'\]\(__t'/g, '_.escape(__t');
|
||||
// remove brackets from `lodash.createCallback` in `_.assign`
|
||||
source = source.replace("' var callback = lodash['createCallback']", "'var callback=lodash.createCallback");
|
||||
|
||||
// remove brackets from `_.escape` in `_.template`
|
||||
source = source.replace(/__e *= *_\['escape']/g, '__e=_.escape');
|
||||
|
||||
// remove brackets from `collection.indexOf` in `_.contains`
|
||||
source = source.replace("collection['indexOf'](target)", 'collection.indexOf(target)');
|
||||
@@ -237,27 +293,21 @@
|
||||
source = source.replace("result[length]['value']", 'result[length].value');
|
||||
|
||||
// remove whitespace from string literals
|
||||
source = source.replace(/^([ "'\w]+:)? *"(?:(?=(\\?))\2.)*?"|'(?:(?=(\\?))\3.)*?'/gm, function(string, captured) {
|
||||
// remove object literal property name
|
||||
if (/:$/.test(captured)) {
|
||||
string = string.slice(captured.length);
|
||||
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) {
|
||||
string = string.replace(/\[object |delete |else (?!{)|function | in | instanceof |return\s+[\w"']|throw |typeof |use strict|var |@ |(["'])\\n\1|\\\\n|\\n|\s+/g, function(match) {
|
||||
return match == false || match == '\\n' ? '' : match;
|
||||
});
|
||||
// prepend object literal property name
|
||||
return (captured || '') + string;
|
||||
// unclip
|
||||
return (left || '') + string;
|
||||
});
|
||||
|
||||
// add newline to `+"__p+='"` in underscore.js `_.template`
|
||||
source = source.replace(/\+"__p\+='"/g, '+"\\n__p+=\'"');
|
||||
|
||||
// add newline to `body + '}'` in `createFunction`
|
||||
source = source.replace(/body *\+ *'}'/, 'body+"\\n}"');
|
||||
|
||||
// remove whitespace from `_.template` related regexes
|
||||
source = source.replace(/(?:reEmptyString\w+|reInsertVariable) *=.+/g, function(match) {
|
||||
source = source.replace(/reEmptyString\w+ *=.+/g, function(match) {
|
||||
return match.replace(/ |\\n/g, '');
|
||||
});
|
||||
|
||||
@@ -266,17 +316,30 @@
|
||||
.replace('"__p += \'"', '"__p+=\'"')
|
||||
.replace('"\';\n"', '"\';"')
|
||||
|
||||
// remove `useSourceURL` variable
|
||||
source = source.replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *try *\{(?:\s*\/\/.*)*\n *var useSourceURL[\s\S]+?catch[^}]+}\n/, '');
|
||||
|
||||
// remove debug sourceURL use in `_.template`
|
||||
source = source.replace(/(?:\s*\/\/.*\n)* *var sourceURL[^;]+;|\+ *sourceURL/g, '');
|
||||
|
||||
// minify internal properties used by 'compareAscending' and `_.sortBy`
|
||||
// minify internal properties
|
||||
(function() {
|
||||
var properties = ['criteria', 'index', 'value'],
|
||||
snippets = source.match(/( +)function (?:compareAscending|sortBy)\b[\s\S]+?\n\1}/g);
|
||||
var methods = [
|
||||
'cacheIndexOf',
|
||||
'cachePush',
|
||||
'compareAscending',
|
||||
'createCache',
|
||||
'getObject',
|
||||
'releaseObject',
|
||||
'sortBy',
|
||||
'uniq'
|
||||
];
|
||||
|
||||
var props = [
|
||||
'cache',
|
||||
'criteria',
|
||||
'index',
|
||||
'value'
|
||||
];
|
||||
|
||||
var snippets = source.match(RegExp('^( *)(?:var|function) +(?:' + methods.join('|') + ')\\b[\\s\\S]+?\\n\\1}', 'gm'));
|
||||
if (!snippets) {
|
||||
return;
|
||||
}
|
||||
@@ -284,19 +347,23 @@
|
||||
var modified = snippet;
|
||||
|
||||
// minify properties
|
||||
properties.forEach(function(property, index) {
|
||||
var reBracketProp = RegExp("\\['(" + property + ")'\\]", 'g'),
|
||||
reDotProp = RegExp('\\.' + property + '\\b', 'g'),
|
||||
rePropColon = RegExp("([^?\\s])\\s*([\"'])?\\b" + property + "\\2 *:", 'g');
|
||||
props.forEach(function(prop, index) {
|
||||
// use minified names different than those chosen for `iteratorOptions`
|
||||
var minName = minNames[iteratorOptions.length + index],
|
||||
reBracketProp = RegExp("\\['(" + prop + ")'\\]", 'g'),
|
||||
reDotProp = RegExp('\\.' + prop + '\\b', 'g'),
|
||||
rePropColon = RegExp("([^?\\s])\\s*([\"'])?\\b" + prop + "\\2 *:", 'g');
|
||||
|
||||
modified = modified
|
||||
.replace(reBracketProp, "['" + minNames[index] + "']")
|
||||
.replace(reDotProp, "['" + minNames[index] + "']")
|
||||
.replace(rePropColon, "$1'" + minNames[index] + "':");
|
||||
.replace(reBracketProp, "['" + minName + "']")
|
||||
.replace(reDotProp, "['" + minName + "']")
|
||||
.replace(rePropColon, "$1'" + minName + "':");
|
||||
});
|
||||
|
||||
// replace with modified snippet
|
||||
source = source.replace(snippet, modified);
|
||||
source = source.replace(snippet, function() {
|
||||
return modified;
|
||||
});
|
||||
});
|
||||
}());
|
||||
|
||||
@@ -304,14 +371,14 @@
|
||||
var snippets = source.match(
|
||||
RegExp([
|
||||
// match the `iteratorTemplate`
|
||||
'( +)var iteratorTemplate\\b[\\s\\S]+?\\n\\1}',
|
||||
'^( *)var iteratorTemplate\\b[\\s\\S]+?\\n\\1}',
|
||||
// match methods created by `createIterator` calls
|
||||
'createIterator\\((?:{|[a-zA-Z]+)[\\s\\S]+?\\);\\n',
|
||||
'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')
|
||||
'^( *)var [a-zA-Z]+IteratorOptions\\b[\\s\\S]+?\\n\\2}',
|
||||
// match `cachePush`, `createCache`, `createIterator`, `getObject`, `releaseObject`, and `uniq` functions
|
||||
'^( *)(?:var|function) +(?:cachePush|createCache|createIterator|getObject|releaseObject|uniq)\\b[\\s\\S]+?\\n\\3}'
|
||||
].join('|'), 'gm')
|
||||
);
|
||||
|
||||
// exit early if no compilable snippets
|
||||
@@ -320,7 +387,7 @@
|
||||
}
|
||||
|
||||
snippets.forEach(function(snippet, index) {
|
||||
var isCreateIterator = /function createIterator\b/.test(snippet),
|
||||
var isFunc = /\bfunction *[ \w]*\(/.test(snippet),
|
||||
isIteratorTemplate = /var iteratorTemplate\b/.test(snippet),
|
||||
modified = snippet;
|
||||
|
||||
@@ -329,42 +396,51 @@
|
||||
return "['" + prop.replace(/['\n\r\t]/g, '\\$&') + "']";
|
||||
});
|
||||
|
||||
if (isCreateIterator) {
|
||||
// replace with modified snippet early and clip snippet to the `factory`
|
||||
// call so other arguments aren't minified
|
||||
source = source.replace(snippet, modified);
|
||||
snippet = modified = modified.replace(/factory\([\s\S]+$/, '');
|
||||
}
|
||||
|
||||
// minify snippet variables / arguments
|
||||
compiledVars.forEach(function(variable, index) {
|
||||
// ensure properties in compiled strings aren't minified
|
||||
modified = modified.replace(RegExp('([^.]\\b)' + variable + '\\b(?!\' *[\\]:])', 'g'), '$1' + minNames[index]);
|
||||
|
||||
// correct `typeof` values
|
||||
if (/^(?:boolean|function|object|number|string|undefined)$/.test(variable)) {
|
||||
modified = modified.replace(RegExp("(typeof [^']+')" + minNames[index] + "'", 'g'), '$1' + variable + "'");
|
||||
}
|
||||
// remove unnecessary semicolons in strings
|
||||
modified = modified.replace(/;(?:}["']|(?:\\n|\s)*["']\s*\+\s*["'](?:\\n|\s)*})/g, function(match) {
|
||||
return match.slice(1);
|
||||
});
|
||||
|
||||
// minify `createIterator` option property names
|
||||
iteratorOptions.forEach(function(property, index) {
|
||||
if (isIteratorTemplate) {
|
||||
// minify property names as interpolated template variables
|
||||
modified = modified.replace(RegExp('\\b' + property + '\\b', '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 snippet variables / arguments
|
||||
compiledVars.forEach(function(varName, index) {
|
||||
var minName = minNames[index];
|
||||
|
||||
// minify variable names present in strings
|
||||
if (isFunc && !isIteratorTemplate) {
|
||||
modified = modified.replace(RegExp('((["\'])[^\\n\\2]*?)\\b' + varName + '\\b(?=[^\\n\\2]*\\2[ ,+;]+$)', 'gm'), function(match, prelude) {
|
||||
return prelude + minName;
|
||||
});
|
||||
}
|
||||
// ensure properties in compiled strings aren't minified
|
||||
else {
|
||||
// minify property name strings
|
||||
modified = modified.replace(RegExp("'" + property + "'", 'g'), "'" + minNames[index] + "'");
|
||||
// minify property names in accessors
|
||||
if (isCreateIterator) {
|
||||
modified = modified.replace(RegExp('\\.' + property + '\\b' , 'g'), '.' + minNames[index]);
|
||||
}
|
||||
modified = modified.replace(RegExp('([^.])\\b' + varName + '\\b(?!\' *[\\]:])', 'g'), function(match, prelude) {
|
||||
return prelude + minName;
|
||||
});
|
||||
}
|
||||
// correct `typeof` string values
|
||||
if (/^(?:boolean|function|object|number|string|undefined)$/.test(varName)) {
|
||||
modified = modified.replace(RegExp('(= *)(["\'])' + minName + '\\2|(["\'])' + minName + '\\3( *=)', 'g'), function(match, prelude, preQuote, postQuote, postlude) {
|
||||
return prelude
|
||||
? prelude + preQuote + varName + preQuote
|
||||
: postQuote + varName + postQuote + postlude;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// replace with modified snippet
|
||||
source = source.replace(snippet, modified);
|
||||
source = source.replace(snippet, function() {
|
||||
return modified;
|
||||
});
|
||||
});
|
||||
|
||||
return source;
|
||||
|
||||
98
build/util.js
Executable file
@@ -0,0 +1,98 @@
|
||||
#!/usr/bin/env node
|
||||
;(function() {
|
||||
'use strict';
|
||||
|
||||
/** Load Node.js modules */
|
||||
var fs = require('fs'),
|
||||
path = require('path');
|
||||
|
||||
/** Load other modules */
|
||||
var _ = require('../lodash.js');
|
||||
|
||||
/** Used to indicate if running in Windows */
|
||||
var isWindows = process.platform == 'win32';
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* The path separator.
|
||||
*
|
||||
* @memberOf util.path
|
||||
* @type String
|
||||
*/
|
||||
var sep = path.sep || (isWindows ? '\\' : '/');
|
||||
|
||||
/**
|
||||
* The escaped path separator used for inclusion in RegExp strings.
|
||||
*
|
||||
* @memberOf util.path
|
||||
* @type String
|
||||
*/
|
||||
var sepEscaped = sep.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
||||
|
||||
/** Used to determine if a path is prefixed with a drive letter, dot, or slash */
|
||||
var rePrefixed = RegExp('^(?:' + (isWindows ? '[a-zA-Z]:|' : '') + '\\.?)' + sepEscaped);
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Makes the given `dirname` directory, without throwing errors for existing
|
||||
* directories and making parent directories as needed.
|
||||
*
|
||||
* @memberOf util.fs
|
||||
* @param {String} dirname The path of the directory.
|
||||
* @param {Number|String} [mode='0777'] The permission mode.
|
||||
*/
|
||||
function mkdirpSync(dirname, mode) {
|
||||
// ensure relative paths are prefixed with `./`
|
||||
if (!rePrefixed.test(dirname)) {
|
||||
dirname = '.' + sep + dirname;
|
||||
}
|
||||
dirname.split(sep).reduce(function(currPath, segment) {
|
||||
currPath += sep + segment;
|
||||
try {
|
||||
currPath = fs.realpathSync(currPath);
|
||||
} catch(e) {
|
||||
fs.mkdirSync(currPath, mode);
|
||||
}
|
||||
return currPath;
|
||||
});
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* The utility object.
|
||||
*
|
||||
* @type Object
|
||||
*/
|
||||
var util = {
|
||||
|
||||
/**
|
||||
* The file system object.
|
||||
*
|
||||
* @memberOf util
|
||||
* @type Object
|
||||
*/
|
||||
'fs': _.defaults(_.cloneDeep(fs), {
|
||||
'existsSync': fs.existsSync || path.existsSync,
|
||||
'mkdirpSync': mkdirpSync
|
||||
}),
|
||||
|
||||
/**
|
||||
* The path object.
|
||||
*
|
||||
* @memberOf util
|
||||
* @type Object
|
||||
*/
|
||||
'path': _.defaults(_.cloneDeep(path), {
|
||||
'sep': sep,
|
||||
'sepEscaped': sepEscaped
|
||||
})
|
||||
};
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
// expose
|
||||
module.exports = util;
|
||||
}());
|
||||
20
component.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "lodash",
|
||||
"repo": "bestiejs/lodash",
|
||||
"version": "1.3.0",
|
||||
"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"
|
||||
]
|
||||
}
|
||||
5910
dist/lodash.compat.js
vendored
Normal file
51
dist/lodash.compat.min.js
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* @license
|
||||
* Lo-Dash 1.3.0 (Custom Build) lodash.com/license
|
||||
* Build: `lodash -o ./dist/lodash.compat.js`
|
||||
* Underscore.js 1.4.4 underscorejs.org/LICENSE
|
||||
*/
|
||||
;!function(n){function t(n,t,r){r=(r||0)-1;for(var e=n.length;++r<e;)if(n[r]===t)return r;return-1}function r(n,r){var e=typeof r;if(n=n.k,"boolean"==e||r==d)return n[r];"number"!=e&&"string"!=e&&(e="object");var u="number"==e?r:x+r;return n=n[e]||(n[e]={}),"object"==e?n[u]&&-1<t(n[u],r)?0:-1:n[u]?0:-1}function e(n){var t=this.k,r=typeof n;if("boolean"==r||n==d)t[n]=y;else{"number"!=r&&"string"!=r&&(r="object");var e="number"==r?n:x+n,u=t[r]||(t[r]={});"object"==r?(u[e]||(u[e]=[])).push(n)==this.b.length&&(t[r]=b):u[e]=y
|
||||
}}function u(n){return n.charCodeAt(0)}function a(n,t){var r=n.m,e=t.m;if(n=n.l,t=t.l,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1}return r<e?-1:1}function o(n){var t=-1,r=n.length,u=c();u["false"]=u["null"]=u["true"]=u.undefined=b;var a=c();for(a.b=n,a.k=u,a.push=e;++t<r;)a.push(n[t]);return u.object===false?(g(a),d):a}function i(n){return"\\"+tt[n]}function l(){return _.pop()||[]}function c(){return C.pop()||{a:"",b:d,c:"",l:d,"false":b,d:"",m:0,e:"",leading:b,f:"",maxWait:0,"null":b,number:d,object:d,push:d,g:d,string:d,h:"",trailing:b,"true":b,undefined:b,i:b,j:b,n:d}
|
||||
}function f(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function p(){}function s(n){_.length==E&&(_.length=E-1),n.length=0,_.push(n)}function g(n){var t=n.k;t&&g(t),C.length==E&&(C.length=E-1),n.b=n.k=n.l=n.object=n.number=n.string=n.n=d,C.push(n)}function v(n,t,r){t||(t=0),typeof r=="undefined"&&(r=n?n.length:0);var e=-1;r=r-t||0;for(var u=Array(0>r?0:r);++e<r;)u[e]=n[t+e];return u}function h(e){function _(n){return n&&typeof n=="object"&&!qr(n)&&sr.call(n,"__wrapped__")?n:new C(n)
|
||||
}function C(n){this.__wrapped__=n}function E(n,t,r,e){function u(){var e=arguments,c=o?this:t;return a||(n=t[i]),r.length&&(e=e.length?(e=Sr.call(e),l?e.concat(r):r.concat(e)):r),this instanceof u?(c=rt(n.prototype),e=n.apply(c,e),mt(e)?e:c):n.apply(c,e)}var a=ht(n),o=!r,i=t;if(o){var l=e;r=t}else if(!a){if(!e)throw new Zt;t=n}return u}function tt(){var n=c();n.g=L,n.b=n.c=n.f=n.h="",n.e="r",n.i=y,n.j=!!Rr;for(var t,r=0;t=arguments[r];r++)for(var e in t)n[e]=t[e];r=n.a,n.d=/^[^,]+/.exec(r)[0],t=Mt,r="return function("+r+"){",e="var m,r="+n.d+",C="+n.e+";if(!r)return C;"+n.h+";",n.b?(e+="var s=r.length;m=-1;if("+n.b+"){",Pr.unindexedChars&&(e+="if(q(r)){r=r.split('')}"),e+="while(++m<s){"+n.f+";}}else{"):Pr.nonEnumArgs&&(e+="var s=r.length;m=-1;if(s&&n(r)){while(++m<s){m+='';"+n.f+";}}else{"),Pr.enumPrototypes&&(e+="var E=typeof r=='function';"),Pr.enumErrorProps&&(e+="var D=r===j||r instanceof Error;");
|
||||
var u=[];if(Pr.enumPrototypes&&u.push('!(E&&m=="prototype")'),Pr.enumErrorProps&&u.push('!(D&&(m=="message"||m=="name"))'),n.i&&n.j)e+="var A=-1,B=z[typeof r]&&t(r),s=B?B.length:0;while(++A<s){m=B[A];",u.length&&(e+="if("+u.join("&&")+"){"),e+=n.f+";",u.length&&(e+="}"),e+="}";else if(e+="for(m in r){",n.i&&u.push("l.call(r, m)"),u.length&&(e+="if("+u.join("&&")+"){"),e+=n.f+";",u.length&&(e+="}"),e+="}",Pr.nonEnumShadows){for(e+="if(r!==y){var h=r.constructor,p=r===(h&&h.prototype),e=r===H?G:r===j?i:J.call(r),v=w[e];",k=0;7>k;k++)e+="m='"+n.g[k]+"';if((!(p&&v[m])&&l.call(r,m))",n.i||(e+="||(!v[m]&&r[m]!==y[m])"),e+="){"+n.f+"}";
|
||||
e+="}"}return(n.b||Pr.nonEnumArgs)&&(e+="}"),e+=n.c+";return C",t=t("i,j,l,n,o,q,t,u,y,z,w,G,H,J",r+e+"}"),g(n),t(M,tr,sr,ft,qr,dt,Rr,_,rr,nt,Nr,Y,er,yr)}function rt(n){return mt(n)?br(n):{}}function ut(n){return Wr[n]}function ot(){var n=(n=_.indexOf)===Pt?t:n;return n}function it(n){return function(t,r,e,u){return typeof r!="boolean"&&r!=d&&(u=e,e=u&&u[r]===t?m:r,r=b),e!=d&&(e=_.createCallback(e,u)),n(t,r,e,u)}}function lt(n){var t,r;return!n||yr.call(n)!=Q||(t=n.constructor,ht(t)&&!(t instanceof t))||!Pr.argsClass&&ft(n)||!Pr.nodeClass&&f(n)?b:Pr.ownLast?(Jr(n,function(n,t,e){return r=sr.call(e,t),b
|
||||
}),r!==false):(Jr(n,function(n,t){r=t}),r===m||sr.call(n,r))}function ct(n){return Lr[n]}function ft(n){return yr.call(n)==G}function pt(n,t,r,e,u,a){var o=n;if(typeof t!="boolean"&&t!=d&&(e=r,r=t,t=b),typeof r=="function"){if(r=typeof e=="undefined"?r:_.createCallback(r,e,1),o=r(o),typeof o!="undefined")return o;o=n}if(e=mt(o)){var i=yr.call(o);if(!Z[i]||!Pr.nodeClass&&f(o))return o;var c=qr(o)}if(!e||!t)return e?c?v(o):Gr({},o):o;switch(e=Br[i],i){case J:case K:return new e(+o);case V:case Y:return new e(o);
|
||||
case X:return e(o.source,P.exec(o))}i=!u,u||(u=l()),a||(a=l());for(var p=u.length;p--;)if(u[p]==n)return a[p];return o=c?e(o.length):{},c&&(sr.call(n,"index")&&(o.index=n.index),sr.call(n,"input")&&(o.input=n.input)),u.push(n),a.push(o),(c?Tr:Kr)(n,function(n,e){o[e]=pt(n,t,r,m,u,a)}),i&&(s(u),s(a)),o}function st(n){var t=[];return Jr(n,function(n,r){ht(n)&&t.push(r)}),t.sort()}function gt(n){for(var t=-1,r=Rr(n),e=r.length,u={};++t<e;){var a=r[t];u[n[a]]=a}return u}function vt(n,t,r,e,u,a){var o=r===w;
|
||||
if(typeof r=="function"&&!o){r=_.createCallback(r,e,2);var i=r(n,t);if(typeof i!="undefined")return!!i}if(n===t)return 0!==n||1/n==1/t;var c=typeof n,p=typeof t;if(n===n&&(!n||"function"!=c&&"object"!=c)&&(!t||"function"!=p&&"object"!=p))return b;if(n==d||t==d)return n===t;if(p=yr.call(n),c=yr.call(t),p==G&&(p=Q),c==G&&(c=Q),p!=c)return b;switch(p){case J:case K:return+n==+t;case V:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case X:case Y:return n==Yt(t)}if(c=p==H,!c){if(sr.call(n,"__wrapped__")||sr.call(t,"__wrapped__"))return vt(n.__wrapped__||n,t.__wrapped__||t,r,e,u,a);
|
||||
if(p!=Q||!Pr.nodeClass&&(f(n)||f(t)))return b;var p=!Pr.argsObject&&ft(n)?Qt:n.constructor,g=!Pr.argsObject&&ft(t)?Qt:t.constructor;if(p!=g&&(!ht(p)||!(p instanceof p&&ht(g)&&g instanceof g)))return b}for(g=!u,u||(u=l()),a||(a=l()),p=u.length;p--;)if(u[p]==n)return a[p]==t;var v=0,i=y;if(u.push(n),a.push(t),c){if(p=n.length,v=t.length,i=v==n.length,!i&&!o)return i;for(;v--;)if(c=p,g=t[v],o)for(;c--&&!(i=vt(n[c],g,r,e,u,a)););else if(!(i=vt(n[v],g,r,e,u,a)))break;return i}return Jr(t,function(t,o,l){return sr.call(l,o)?(v++,i=sr.call(n,o)&&vt(n[o],t,r,e,u,a)):void 0
|
||||
}),i&&!o&&Jr(n,function(n,t,r){return sr.call(r,t)?i=-1<--v:void 0}),g&&(s(u),s(a)),i}function ht(n){return typeof n=="function"}function mt(n){return!(!n||!nt[typeof n])}function yt(n){return typeof n=="number"||yr.call(n)==V}function dt(n){return typeof n=="string"||yr.call(n)==Y}function bt(n,t,r){var e=arguments,u=0,a=2;if(!mt(n))return n;if(r===w)var o=e[3],i=e[4],c=e[5];else{var f=y,i=l(),c=l();typeof r!="number"&&(a=e.length),3<a&&"function"==typeof e[a-2]?o=_.createCallback(e[--a-1],e[a--],2):2<a&&"function"==typeof e[a-1]&&(o=e[--a])
|
||||
}for(;++u<a;)(qr(e[u])?xt:Kr)(e[u],function(t,r){var e,u,a=t,l=n[r];if(t&&((u=qr(t))||Mr(t))){for(a=i.length;a--;)if(e=i[a]==t){l=c[a];break}if(!e){var f;o&&(a=o(l,t),f=typeof a!="undefined")&&(l=a),f||(l=u?qr(l)?l:[]:Mr(l)?l:{}),i.push(t),c.push(l),f||(l=bt(l,t,w,o,i,c))}}else o&&(a=o(l,t),typeof a=="undefined"&&(a=t)),typeof a!="undefined"&&(l=a);n[r]=l});return f&&(s(i),s(c)),n}function _t(n){for(var t=-1,r=Rr(n),e=r.length,u=Ht(e);++t<e;)u[t]=n[r[t]];return u}function Ct(n,t,r){var e=-1,u=ot(),a=n?n.length:0,o=b;
|
||||
return r=(0>r?kr(0,a+r):r)||0,a&&typeof a=="number"?o=-1<(dt(n)?n.indexOf(t,r):u(n,t,r)):Tr(n,function(n){return++e<r?void 0:!(o=n===t)}),o}function jt(n,t,r){var e=y;if(t=_.createCallback(t,r),qr(n)){r=-1;for(var u=n.length;++r<u&&(e=!!t(n[r],r,n)););}else Tr(n,function(n,r,u){return e=!!t(n,r,u)});return e}function wt(n,t,r){var e=[];if(t=_.createCallback(t,r),qr(n)){r=-1;for(var u=n.length;++r<u;){var a=n[r];t(a,r,n)&&e.push(a)}}else Tr(n,function(n,r,u){t(n,r,u)&&e.push(n)});return e}function kt(n,t,r){if(t=_.createCallback(t,r),!qr(n)){var e;
|
||||
return Tr(n,function(n,r,u){return t(n,r,u)?(e=n,b):void 0}),e}r=-1;for(var u=n.length;++r<u;){var a=n[r];if(t(a,r,n))return a}}function xt(n,t,r){if(t&&typeof r=="undefined"&&qr(n)){r=-1;for(var e=n.length;++r<e&&t(n[r],r,n)!==false;);}else Tr(n,t,r);return n}function Ot(n,t,r){var e=-1,u=n?n.length:0,a=Ht(typeof u=="number"?u:0);if(t=_.createCallback(t,r),qr(n))for(;++e<u;)a[e]=t(n[e],e,n);else Tr(n,function(n,r,u){a[++e]=t(n,r,u)});return a}function Et(n,t,r){var e=-1/0,a=e;if(!t&&qr(n)){r=-1;for(var o=n.length;++r<o;){var i=n[r];
|
||||
i>a&&(a=i)}}else t=!t&&dt(n)?u:_.createCallback(t,r),Tr(n,function(n,r,u){r=t(n,r,u),r>e&&(e=r,a=n)});return a}function St(n,t,r,e){var u=3>arguments.length;if(t=_.createCallback(t,e,4),qr(n)){var a=-1,o=n.length;for(u&&(r=n[++a]);++a<o;)r=t(r,n[a],a,n)}else Tr(n,function(n,e,a){r=u?(u=b,n):t(r,n,e,a)});return r}function At(n,t,r,e){var u=n,a=n?n.length:0,o=3>arguments.length;if(typeof a!="number")var i=Rr(n),a=i.length;else Pr.unindexedChars&&dt(n)&&(u=n.split(""));return t=_.createCallback(t,e,4),xt(n,function(n,e,l){e=i?i[--a]:--a,r=o?(o=b,u[e]):t(r,u[e],e,l)
|
||||
}),r}function It(n,t,r){var e;if(t=_.createCallback(t,r),qr(n)){r=-1;for(var u=n.length;++r<u&&!(e=t(n[r],r,n)););}else Tr(n,function(n,r,u){return!(e=t(n,r,u))});return!!e}function Bt(n){var e=-1,u=ot(),a=n?n.length:0,i=lr.apply(nr,Sr.call(arguments,1)),l=[],c=a>=O&&u===t;if(c){var f=o(i);f?(u=r,i=f):c=b}for(;++e<a;)f=n[e],0>u(i,f)&&l.push(f);return c&&g(i),l}function Nt(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=d){var a=-1;for(t=_.createCallback(t,r);++a<u&&t(n[a],a,n);)e++}else if(e=t,e==d||r)return n[0];
|
||||
return v(n,0,xr(kr(0,e),u))}}function Pt(n,r,e){if(typeof e=="number"){var u=n?n.length:0;e=0>e?kr(0,u+e):e||0}else if(e)return e=Ft(n,r),n[e]===r?e:-1;return n?t(n,r,e):-1}function zt(n,t,r){if(typeof t!="number"&&t!=d){var e=0,u=-1,a=n?n.length:0;for(t=_.createCallback(t,r);++u<a&&t(n[u],u,n);)e++}else e=t==d||r?1:kr(0,t);return v(n,e)}function Ft(n,t,r,e){var u=0,a=n?n.length:u;for(r=r?_.createCallback(r,e,1):Wt,t=r(t);u<a;)e=u+a>>>1,r(n[e])<t?u=e+1:a=e;return u}function $t(n){for(var t=-1,r=n?Et(Ur(n,"length")):0,e=Ht(0>r?0:r);++t<r;)e[t]=Ur(n,t);
|
||||
return e}function qt(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var a=n[r];t?u[a]=t[r]:u[a[0]]=a[1]}return u}function Dt(n,t){return Pr.fastBind||dr&&2<arguments.length?dr.call.apply(dr,arguments):E(n,t,Sr.call(arguments,2))}function Rt(n,t,r){function e(){ir(s),ir(g),c=0,s=g=d}function u(){var t=v&&(!h||1<c);e(),t&&(p!==false&&(f=new Kt),i=n.apply(l,o))}function a(){e(),(v||p!==t)&&(f=new Kt,i=n.apply(l,o))}var o,i,l,c=0,f=0,p=b,s=d,g=d,v=y;if(t=kr(0,t||0),r===y)var h=y,v=b;else mt(r)&&(h=r.leading,p="maxWait"in r&&kr(t,r.maxWait||0),v="trailing"in r?r.trailing:v);
|
||||
return function(){if(o=arguments,l=this,c++,ir(g),p===false)h&&2>c&&(i=n.apply(l,o));else{var r=new Kt;!s&&!h&&(f=r);var e=p-(r-f);0<e?s||(s=mr(a,e)):(ir(s),s=d,f=r,i=n.apply(l,o))}return t!==p&&(g=mr(u,t)),i}}function Tt(n){var t=Sr.call(arguments,1);return mr(function(){n.apply(m,t)},1)}function Wt(n){return n}function Lt(n){xt(st(n),function(t){var r=_[t]=n[t];_.prototype[t]=function(){var n=this.__wrapped__,t=[n];return gr.apply(t,arguments),t=r.apply(_,t),n&&typeof n=="object"&&n===t?this:new C(t)
|
||||
}})}function Gt(){return this.__wrapped__}e=e?at.defaults(n.Object(),e,at.pick(n,W)):n;var Ht=e.Array,Jt=e.Boolean,Kt=e.Date,Mt=e.Function,Ut=e.Math,Vt=e.Number,Qt=e.Object,Xt=e.RegExp,Yt=e.String,Zt=e.TypeError,nr=[],tr=e.Error.prototype,rr=Qt.prototype,er=Yt.prototype,ur=e._,ar=Xt("^"+Yt(rr.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),or=Ut.ceil,ir=e.clearTimeout,lr=nr.concat,cr=Ut.floor,fr=Mt.prototype.toString,pr=ar.test(pr=Qt.getPrototypeOf)&&pr,sr=rr.hasOwnProperty,gr=nr.push,vr=rr.propertyIsEnumerable,hr=e.setImmediate,mr=e.setTimeout,yr=rr.toString,dr=ar.test(dr=yr.bind)&&dr,br=ar.test(br=Qt.create)&&br,_r=ar.test(_r=Ht.isArray)&&_r,Cr=e.isFinite,jr=e.isNaN,wr=ar.test(wr=Qt.keys)&&wr,kr=Ut.max,xr=Ut.min,Or=e.parseInt,Er=Ut.random,Sr=nr.slice,Ar=ar.test(e.attachEvent),Ir=dr&&!/\n|true/.test(dr+Ar),Br={};
|
||||
Br[H]=Ht,Br[J]=Jt,Br[K]=Kt,Br[U]=Mt,Br[Q]=Qt,Br[V]=Vt,Br[X]=Xt,Br[Y]=Yt;var Nr={};Nr[H]=Nr[K]=Nr[V]={constructor:y,toLocaleString:y,toString:y,valueOf:y},Nr[J]=Nr[Y]={constructor:y,toString:y,valueOf:y},Nr[M]=Nr[U]=Nr[X]={constructor:y,toString:y},Nr[Q]={constructor:y},function(){for(var n=L.length;n--;){var t,r=L[n];for(t in Nr)sr.call(Nr,t)&&!sr.call(Nr[t],r)&&(Nr[t][r]=b)}}(),C.prototype=_.prototype;var Pr=_.support={};!function(){function n(){this.x=1}var t={0:1,length:1},r=[];n.prototype={valueOf:1};
|
||||
for(var e in new n)r.push(e);for(e in arguments);Pr.argsObject=arguments.constructor==Qt&&!(arguments instanceof Ht),Pr.argsClass=ft(arguments),Pr.enumErrorProps=vr.call(tr,"message")||vr.call(tr,"name"),Pr.enumPrototypes=vr.call(n,"prototype"),Pr.fastBind=dr&&!Ir,Pr.ownLast="x"!=r[0],Pr.nonEnumArgs=0!=e,Pr.nonEnumShadows=!/valueOf/.test(r),Pr.spliceObjects=(nr.splice.call(t,0,1),!t[0]),Pr.unindexedChars="xx"!="x"[0]+Qt("x")[0];try{Pr.nodeClass=!(yr.call(document)==Q&&!({toString:0}+""))}catch(u){Pr.nodeClass=y
|
||||
}}(1),_.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:z,variable:"",imports:{_:_}};var zr={a:"x,F,k",h:"var a=arguments,b=0,c=typeof k=='number'?2:a.length;while(++b<c){r=a[b];if(r&&z[typeof r]){",f:"if(typeof C[m]=='undefined')C[m]=r[m]",c:"}}"},Fr={a:"f,d,I",h:"d=d&&typeof I=='undefined'?d:u.createCallback(d,I)",b:"typeof s=='number'",f:"if(d(r[m],m,f)===false)return C"},$r={h:"if(!z[typeof r])return C;"+Fr.h,b:b};br||(rt=function(n){if(mt(n)){p.prototype=n;
|
||||
var t=new p;p.prototype=d}return t||{}}),Pr.argsClass||(ft=function(n){return n?sr.call(n,"callee"):b});var qr=_r||function(n){return n?typeof n=="object"&&yr.call(n)==H:b},Dr=tt({a:"x",e:"[]",h:"if(!(z[typeof x]))return C",f:"C.push(m)"}),Rr=wr?function(n){return mt(n)?Pr.enumPrototypes&&typeof n=="function"||Pr.nonEnumArgs&&n.length&&ft(n)?Dr(n):wr(n):[]}:Dr,Tr=tt(Fr),Wr={"&":"&","<":"<",">":">",'"':""","'":"'"},Lr=gt(Wr),Gr=tt(zr,{h:zr.h.replace(";",";if(c>3&&typeof a[c-2]=='function'){var d=u.createCallback(a[--c-1],a[c--],2)}else if(c>2&&typeof a[c-1]=='function'){d=a[--c]}"),f:"C[m]=d?d(C[m],r[m]):r[m]"}),Hr=tt(zr),Jr=tt(Fr,$r,{i:b}),Kr=tt(Fr,$r);
|
||||
ht(/x/)&&(ht=function(n){return typeof n=="function"&&yr.call(n)==U});var Mr=pr?function(n){if(!n||yr.call(n)!=Q||!Pr.argsClass&&ft(n))return b;var t=n.valueOf,r=typeof t=="function"&&(r=pr(t))&&pr(r);return r?n==r||pr(n)==r:lt(n)}:lt,Ur=Ot,Vr=it(function Yr(n,t,r){for(var e=-1,u=n?n.length:0,a=[];++e<u;){var o=n[e];r&&(o=r(o,e,n)),qr(o)?gr.apply(a,t?o:Yr(o)):a.push(o)}return a}),Qr=it(function(n,e,u){var a=-1,i=ot(),c=n?n.length:0,f=[],p=!e&&c>=O&&i===t,v=u||p?l():f;if(p){var h=o(v);h?(i=r,v=h):(p=b,v=u?v:(s(v),f))
|
||||
}for(;++a<c;){var h=n[a],m=u?u(h,a,n):h;(e?!a||v[v.length-1]!==m:0>i(v,m))&&((u||p)&&v.push(m),f.push(h))}return p?(s(v.b),g(v)):u&&s(v),f});Ir&&et&&typeof hr=="function"&&(Tt=Dt(hr,e));var Xr=8==Or($+"08")?Or:function(n,t){return Or(dt(n)?n.replace(q,""):n,t||0)};return _.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},_.assign=Gr,_.at=function(n){var t=-1,r=lr.apply(nr,Sr.call(arguments,1)),e=r.length,u=Ht(e);for(Pr.unindexedChars&&dt(n)&&(n=n.split(""));++t<e;)u[t]=n[r[t]];
|
||||
return u},_.bind=Dt,_.bindAll=function(n){for(var t=1<arguments.length?lr.apply(nr,Sr.call(arguments,1)):st(n),r=-1,e=t.length;++r<e;){var u=t[r];n[u]=Dt(n[u],n)}return n},_.bindKey=function(n,t){return E(n,t,Sr.call(arguments,2),w)},_.compact=function(n){for(var t=-1,r=n?n.length:0,e=[];++t<r;){var u=n[t];u&&e.push(u)}return e},_.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},_.countBy=function(n,t,r){var e={};return t=_.createCallback(t,r),xt(n,function(n,r,u){r=Yt(t(n,r,u)),sr.call(e,r)?e[r]++:e[r]=1
|
||||
}),e},_.createCallback=function(n,t,r){if(n==d)return Wt;var e=typeof n;if("function"!=e){if("object"!=e)return function(t){return t[n]};var u=Rr(n);return function(t){for(var r=u.length,e=b;r--&&(e=vt(t[u[r]],n[u[r]],w)););return e}}return typeof t=="undefined"||F&&!F.test(fr.call(n))?n:1===r?function(r){return n.call(t,r)}:2===r?function(r,e){return n.call(t,r,e)}:4===r?function(r,e,u,a){return n.call(t,r,e,u,a)}:function(r,e,u){return n.call(t,r,e,u)}},_.debounce=Rt,_.defaults=Hr,_.defer=Tt,_.delay=function(n,t){var r=Sr.call(arguments,2);
|
||||
return mr(function(){n.apply(m,r)},t)},_.difference=Bt,_.filter=wt,_.flatten=Vr,_.forEach=xt,_.forIn=Jr,_.forOwn=Kr,_.functions=st,_.groupBy=function(n,t,r){var e={};return t=_.createCallback(t,r),xt(n,function(n,r,u){r=Yt(t(n,r,u)),(sr.call(e,r)?e[r]:e[r]=[]).push(n)}),e},_.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t!="number"&&t!=d){var a=u;for(t=_.createCallback(t,r);a--&&t(n[a],a,n);)e++}else e=t==d||r?1:t||e;return v(n,0,xr(kr(0,u-e),u))},_.intersection=function(n){for(var e=arguments,u=e.length,a=-1,i=l(),c=-1,f=ot(),p=n?n.length:0,v=[],h=l();++a<u;){var m=e[a];
|
||||
i[a]=f===t&&(m?m.length:0)>=O&&o(a?e[a]:h)}n:for(;++c<p;){var y=i[0],m=n[c];if(0>(y?r(y,m):f(h,m))){for(a=u,(y||h).push(m);--a;)if(y=i[a],0>(y?r(y,m):f(e[a],m)))continue n;v.push(m)}}for(;u--;)(y=i[u])&&g(y);return s(i),s(h),v},_.invert=gt,_.invoke=function(n,t){var r=Sr.call(arguments,2),e=-1,u=typeof t=="function",a=n?n.length:0,o=Ht(typeof a=="number"?a:0);return xt(n,function(n){o[++e]=(u?t:n[t]).apply(n,r)}),o},_.keys=Rr,_.map=Ot,_.max=Et,_.memoize=function(n,t){function r(){var e=r.cache,u=x+(t?t.apply(this,arguments):arguments[0]);
|
||||
return sr.call(e,u)?e[u]:e[u]=n.apply(this,arguments)}return r.cache={},r},_.merge=bt,_.min=function(n,t,r){var e=1/0,a=e;if(!t&&qr(n)){r=-1;for(var o=n.length;++r<o;){var i=n[r];i<a&&(a=i)}}else t=!t&&dt(n)?u:_.createCallback(t,r),Tr(n,function(n,r,u){r=t(n,r,u),r<e&&(e=r,a=n)});return a},_.omit=function(n,t,r){var e=ot(),u=typeof t=="function",a={};if(u)t=_.createCallback(t,r);else var o=lr.apply(nr,Sr.call(arguments,1));return Jr(n,function(n,r,i){(u?!t(n,r,i):0>e(o,r))&&(a[r]=n)}),a},_.once=function(n){var t,r;
|
||||
return function(){return t?r:(t=y,r=n.apply(this,arguments),n=d,r)}},_.pairs=function(n){for(var t=-1,r=Rr(n),e=r.length,u=Ht(e);++t<e;){var a=r[t];u[t]=[a,n[a]]}return u},_.partial=function(n){return E(n,Sr.call(arguments,1))},_.partialRight=function(n){return E(n,Sr.call(arguments,1),d,w)},_.pick=function(n,t,r){var e={};if(typeof t!="function")for(var u=-1,a=lr.apply(nr,Sr.call(arguments,1)),o=mt(n)?a.length:0;++u<o;){var i=a[u];i in n&&(e[i]=n[i])}else t=_.createCallback(t,r),Jr(n,function(n,r,u){t(n,r,u)&&(e[r]=n)
|
||||
});return e},_.pluck=Ur,_.range=function(n,t,r){n=+n||0,r=+r||1,t==d&&(t=n,n=0);var e=-1;t=kr(0,or((t-n)/r));for(var u=Ht(t);++e<t;)u[e]=n,n+=r;return u},_.reject=function(n,t,r){return t=_.createCallback(t,r),wt(n,function(n,r,e){return!t(n,r,e)})},_.rest=zt,_.shuffle=function(n){var t=-1,r=n?n.length:0,e=Ht(typeof r=="number"?r:0);return xt(n,function(n){var r=cr(Er()*(++t+1));e[t]=e[r],e[r]=n}),e},_.sortBy=function(n,t,r){var e=-1,u=n?n.length:0,o=Ht(typeof u=="number"?u:0);for(t=_.createCallback(t,r),xt(n,function(n,r,u){var a=o[++e]=c();
|
||||
a.l=t(n,r,u),a.m=e,a.n=n}),u=o.length,o.sort(a);u--;)n=o[u],o[u]=n.n,g(n);return o},_.tap=function(n,t){return t(n),n},_.throttle=function(n,t,r){var e=y,u=y;return r===false?e=b:mt(r)&&(e="leading"in r?r.leading:e,u="trailing"in r?r.trailing:u),r=c(),r.leading=e,r.maxWait=t,r.trailing=u,n=Rt(n,t,r),g(r),n},_.times=function(n,t,r){n=-1<(n=+n)?n:0;var e=-1,u=Ht(n);for(t=_.createCallback(t,r,1);++e<n;)u[e]=t(e);return u},_.toArray=function(n){return n&&typeof n.length=="number"?Pr.unindexedChars&&dt(n)?n.split(""):v(n):_t(n)
|
||||
},_.transform=function(n,t,r,e){var u=qr(n);return t=_.createCallback(t,e,4),r==d&&(u?r=[]:(e=n&&n.constructor,r=rt(e&&e.prototype))),(u?Tr:Kr)(n,function(n,e,u){return t(r,n,e,u)}),r},_.union=function(n){return qr(n)||(arguments[0]=n?Sr.call(n):nr),Qr(lr.apply(nr,arguments))},_.uniq=Qr,_.unzip=$t,_.values=_t,_.where=wt,_.without=function(n){return Bt(n,Sr.call(arguments,1))},_.wrap=function(n,t){return function(){var r=[n];return gr.apply(r,arguments),t.apply(this,r)}},_.zip=function(n){return n?$t(arguments):[]
|
||||
},_.zipObject=qt,_.collect=Ot,_.drop=zt,_.each=xt,_.extend=Gr,_.methods=st,_.object=qt,_.select=wt,_.tail=zt,_.unique=Qr,Lt(_),_.chain=_,_.prototype.chain=function(){return this},_.clone=pt,_.cloneDeep=function(n,t,r){return pt(n,y,t,r)},_.contains=Ct,_.escape=function(n){return n==d?"":Yt(n).replace(R,ut)},_.every=jt,_.find=kt,_.findIndex=function(n,t,r){var e=-1,u=n?n.length:0;for(t=_.createCallback(t,r);++e<u;)if(t(n[e],e,n))return e;return-1},_.findKey=function(n,t,r){var e;return t=_.createCallback(t,r),Kr(n,function(n,r,u){return t(n,r,u)?(e=r,b):void 0
|
||||
}),e},_.has=function(n,t){return n?sr.call(n,t):b},_.identity=Wt,_.indexOf=Pt,_.isArguments=ft,_.isArray=qr,_.isBoolean=function(n){return n===y||n===false||yr.call(n)==J},_.isDate=function(n){return n?typeof n=="object"&&yr.call(n)==K:b},_.isElement=function(n){return n?1===n.nodeType:b},_.isEmpty=function(n){var t=y;if(!n)return t;var r=yr.call(n),e=n.length;return r==H||r==Y||(Pr.argsClass?r==G:ft(n))||r==Q&&typeof e=="number"&&ht(n.splice)?!e:(Kr(n,function(){return t=b}),t)},_.isEqual=vt,_.isFinite=function(n){return Cr(n)&&!jr(parseFloat(n))
|
||||
},_.isFunction=ht,_.isNaN=function(n){return yt(n)&&n!=+n},_.isNull=function(n){return n===d},_.isNumber=yt,_.isObject=mt,_.isPlainObject=Mr,_.isRegExp=function(n){return!(!n||!nt[typeof n])&&yr.call(n)==X},_.isString=dt,_.isUndefined=function(n){return typeof n=="undefined"},_.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?kr(0,e+r):xr(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},_.mixin=Lt,_.noConflict=function(){return e._=ur,this},_.parseInt=Xr,_.random=function(n,t){n==d&&t==d&&(t=1),n=+n||0,t==d?(t=n,n=0):t=+t||0;
|
||||
var r=Er();return n%1||t%1?n+xr(r*(t-n+parseFloat("1e-"+((r+"").length-1))),t):n+cr(r*(t-n+1))},_.reduce=St,_.reduceRight=At,_.result=function(n,t){var r=n?n[t]:m;return ht(r)?n[t]():r},_.runInContext=h,_.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Rr(n).length},_.some=It,_.sortedIndex=Ft,_.template=function(n,t,r){var e=_.templateSettings;n||(n=""),r=Hr({},r,e);var u,a=Hr({},r.imports,e.imports),e=Rr(a),a=_t(a),o=0,l=r.interpolate||D,c="__p+='",l=Xt((r.escape||D).source+"|"+l.source+"|"+(l===z?N:D).source+"|"+(r.evaluate||D).source+"|$","g");
|
||||
n.replace(l,function(t,r,e,a,l,f){return e||(e=a),c+=n.slice(o,f).replace(T,i),r&&(c+="'+__e("+r+")+'"),l&&(u=y,c+="';"+l+";__p+='"),e&&(c+="'+((__t=("+e+"))==null?'':__t)+'"),o=f+t.length,t}),c+="';\n",l=r=r.variable,l||(r="obj",c="with("+r+"){"+c+"}"),c=(u?c.replace(S,""):c).replace(A,"$1").replace(I,"$1;"),c="function("+r+"){"+(l?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+c+"return __p}";try{var f=Mt(e,"return "+c).apply(m,a)
|
||||
}catch(p){throw p.source=c,p}return t?f(t):(f.source=c,f)},_.unescape=function(n){return n==d?"":Yt(n).replace(B,ct)},_.uniqueId=function(n){var t=++j;return Yt(n==d?"":n)+t},_.all=jt,_.any=It,_.detect=kt,_.findWhere=kt,_.foldl=St,_.foldr=At,_.include=Ct,_.inject=St,Kr(_,function(n,t){_.prototype[t]||(_.prototype[t]=function(){var t=[this.__wrapped__];return gr.apply(t,arguments),n.apply(_,t)})}),_.first=Nt,_.last=function(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=d){var a=u;for(t=_.createCallback(t,r);a--&&t(n[a],a,n);)e++
|
||||
}else if(e=t,e==d||r)return n[u-1];return v(n,kr(0,u-e))}},_.take=Nt,_.head=Nt,Kr(_,function(n,t){_.prototype[t]||(_.prototype[t]=function(t,r){var e=n(this.__wrapped__,t,r);return t==d||r&&typeof t!="function"?e:new C(e)})}),_.VERSION="1.3.0",_.prototype.toString=function(){return Yt(this.__wrapped__)},_.prototype.value=Gt,_.prototype.valueOf=Gt,Tr(["join","pop","shift"],function(n){var t=nr[n];_.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),Tr(["push","reverse","sort","unshift"],function(n){var t=nr[n];
|
||||
_.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Tr(["concat","slice","splice"],function(n){var t=nr[n];_.prototype[n]=function(){return new C(t.apply(this.__wrapped__,arguments))}}),Pr.spliceObjects||Tr(["pop","shift","splice"],function(n){var t=nr[n],r="splice"==n;_.prototype[n]=function(){var n=this.__wrapped__,e=t.apply(n,arguments);return 0===n.length&&delete n[0],r?new C(e):e}}),_}var m,y=!0,d=null,b=!1,_=[],C=[],j=0,w={},x=+new Date+"",O=75,E=10,S=/\b__p\+='';/g,A=/\b(__p\+=)''\+/g,I=/(__e\(.*?\)|\b__t\))\+'';/g,B=/&(?:amp|lt|gt|quot|#39);/g,N=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,P=/\w*$/,z=/<%=([\s\S]+?)%>/g,F=(F=/\bthis\b/)&&F.test(h)&&F,$=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",q=RegExp("^["+$+"]*0+(?=.$)"),D=/($^)/,R=/[&<>"']/g,T=/['\n\r\t\u2028\u2029\\]/g,W="Array Boolean Date Error Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),L="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),G="[object Arguments]",H="[object Array]",J="[object Boolean]",K="[object Date]",M="[object Error]",U="[object Function]",V="[object Number]",Q="[object Object]",X="[object RegExp]",Y="[object String]",Z={};
|
||||
Z[U]=b,Z[G]=Z[H]=Z[J]=Z[K]=Z[V]=Z[Q]=Z[X]=Z[Y]=y;var nt={"boolean":b,"function":y,object:y,number:b,string:b,undefined:b},tt={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},rt=nt[typeof exports]&&exports,et=nt[typeof module]&&module&&module.exports==rt&&module,ut=nt[typeof global]&&global;!ut||ut.global!==ut&&ut.window!==ut||(n=ut);var at=h();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=at, define(function(){return at})):rt&&!rt.nodeType?et?(et.exports=at)._=at:rt._=at:n._=at
|
||||
}(this);
|
||||
5556
dist/lodash.js
vendored
Normal file
48
dist/lodash.min.js
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* @license
|
||||
* Lo-Dash 1.3.0 (Custom Build) lodash.com/license
|
||||
* Build: `lodash modern -o ./dist/lodash.js`
|
||||
* Underscore.js 1.4.4 underscorejs.org/LICENSE
|
||||
*/
|
||||
;!function(n){function t(n,t,e){e=(e||0)-1;for(var r=n.length;++e<r;)if(n[e]===t)return e;return-1}function e(n,e){var r=typeof e;if(n=n.k,"boolean"==r||e==y)return n[e];"number"!=r&&"string"!=r&&(r="object");var u="number"==r?e:j+e;return n=n[r]||(n[r]={}),"object"==r?n[u]&&-1<t(n[u],e)?0:-1:n[u]?0:-1}function r(n){var t=this.k,e=typeof n;if("boolean"==e||n==y)t[n]=h;else{"number"!=e&&"string"!=e&&(e="object");var r="number"==e?n:j+n,u=t[e]||(t[e]={});"object"==e?(u[r]||(u[r]=[])).push(n)==this.b.length&&(t[e]=b):u[r]=h
|
||||
}}function u(n){return n.charCodeAt(0)}function a(n,t){var e=n.m,r=t.m;if(n=n.l,t=t.l,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1}return e<r?-1:1}function o(n){var t=-1,e=n.length,u=l();u["false"]=u["null"]=u["true"]=u.undefined=b;var a=l();for(a.b=n,a.k=u,a.push=r;++t<e;)a.push(n[t]);return u.object===false?(p(a),y):a}function i(n){return"\\"+Q[n]}function f(){return m.pop()||[]}function l(){return d.pop()||{b:y,l:y,"false":b,m:0,leading:b,maxWait:0,"null":b,number:y,object:y,push:y,string:y,trailing:b,"true":b,undefined:b,n:y}
|
||||
}function c(n){m.length==C&&(m.length=C-1),n.length=0,m.push(n)}function p(n){var t=n.k;t&&p(t),d.length==C&&(d.length=C-1),n.b=n.k=n.l=n.object=n.number=n.string=n.n=y,d.push(n)}function s(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Array(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function v(r){function m(n){if(!n||ve.call(n)!=V)return b;var t=n.valueOf,e=typeof t=="function"&&(e=fe(t))&&fe(e);return e?n==e||fe(n)==e:it(n)}function d(n,t,e){if(!n||!L[typeof n])return n;
|
||||
t=t&&typeof e=="undefined"?t:tt.createCallback(t,e);for(var r=-1,u=L[typeof n]&&Se(n),a=u?u.length:0;++r<a&&(e=u[r],!(t(n[e],e,n)===false)););return n}function C(n,t,e){var r;if(!n||!L[typeof n])return n;t=t&&typeof e=="undefined"?t:tt.createCallback(t,e);for(r in n)if(t(n[r],r,n)===false)break;return n}function Q(n,t,e){var r,u=n,a=u;if(!u)return a;for(var o=arguments,i=0,f=typeof e=="number"?2:o.length;++i<f;)if((u=o[i])&&L[typeof u])for(var l=-1,c=L[typeof u]&&Se(u),p=c?c.length:0;++l<p;)r=c[l],"undefined"==typeof a[r]&&(a[r]=u[r]);
|
||||
return a}function X(n,t,e){var r,u=n,a=u;if(!u)return a;var o=arguments,i=0,f=typeof e=="number"?2:o.length;if(3<f&&"function"==typeof o[f-2])var l=tt.createCallback(o[--f-1],o[f--],2);else 2<f&&"function"==typeof o[f-1]&&(l=o[--f]);for(;++i<f;)if((u=o[i])&&L[typeof u])for(var c=-1,p=L[typeof u]&&Se(u),s=p?p.length:0;++c<s;)r=p[c],a[r]=l?l(a[r],u[r]):u[r];return a}function Z(n){var t,e=[];if(!n||!L[typeof n])return e;for(t in n)le.call(n,t)&&e.push(t);return e}function tt(n){return n&&typeof n=="object"&&!Ee(n)&&le.call(n,"__wrapped__")?n:new et(n)
|
||||
}function et(n){this.__wrapped__=n}function rt(n,t,e,r){function u(){var r=arguments,l=o?this:t;return a||(n=t[i]),e.length&&(r=r.length?(r=Ce.call(r),f?r.concat(e):e.concat(r)):e),this instanceof u?(l=gt(n.prototype)?he(n.prototype):{},r=n.apply(l,r),gt(r)?r:l):n.apply(l,r)}var a=vt(n),o=!e,i=t;if(o){var f=r;e=t}else if(!a){if(!r)throw new Yt;t=n}return u}function ut(n){return Ie[n]}function at(){var n=(n=tt.indexOf)===$t?t:n;return n}function ot(n){return function(t,e,r,u){return typeof e!="boolean"&&e!=y&&(u=r,r=u&&u[e]===t?g:e,e=b),r!=y&&(r=tt.createCallback(r,u)),n(t,e,r,u)
|
||||
}}function it(n){var t,e;return n&&ve.call(n)==V&&(t=n.constructor,!vt(t)||t instanceof t)?(C(n,function(n,t){e=t}),e===g||le.call(n,e)):b}function ft(n){return Ae[n]}function lt(n,t,e,r,u,a){var o=n;if(typeof t!="boolean"&&t!=y&&(r=e,e=t,t=b),typeof e=="function"){if(e=typeof r=="undefined"?e:tt.createCallback(e,r,1),o=e(o),typeof o!="undefined")return o;o=n}if(r=gt(o)){var i=ve.call(o);if(!J[i])return o;var l=Ee(o)}if(!r||!t)return r?l?s(o):X({},o):o;switch(r=xe[i],i){case P:case K:return new r(+o);
|
||||
case U:case H:return new r(o);case G:return r(o.source,A.exec(o))}i=!u,u||(u=f()),a||(a=f());for(var p=u.length;p--;)if(u[p]==n)return a[p];return o=l?r(o.length):{},l&&(le.call(n,"index")&&(o.index=n.index),le.call(n,"input")&&(o.input=n.input)),u.push(n),a.push(o),(l?wt:d)(n,function(n,r){o[r]=lt(n,t,e,g,u,a)}),i&&(c(u),c(a)),o}function ct(n){var t=[];return C(n,function(n,e){vt(n)&&t.push(e)}),t.sort()}function pt(n){for(var t=-1,e=Se(n),r=e.length,u={};++t<r;){var a=e[t];u[n[a]]=a}return u}function st(n,t,e,r,u,a){var o=e===k;
|
||||
if(typeof e=="function"&&!o){e=tt.createCallback(e,r,2);var i=e(n,t);if(typeof i!="undefined")return!!i}if(n===t)return 0!==n||1/n==1/t;var l=typeof n,p=typeof t;if(n===n&&(!n||"function"!=l&&"object"!=l)&&(!t||"function"!=p&&"object"!=p))return b;if(n==y||t==y)return n===t;if(p=ve.call(n),l=ve.call(t),p==z&&(p=V),l==z&&(l=V),p!=l)return b;switch(p){case P:case K:return+n==+t;case U:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case G:case H:return n==Xt(t)}if(l=p==W,!l){if(le.call(n,"__wrapped__")||le.call(t,"__wrapped__"))return st(n.__wrapped__||n,t.__wrapped__||t,e,r,u,a);
|
||||
if(p!=V)return b;var p=n.constructor,s=t.constructor;if(p!=s&&(!vt(p)||!(p instanceof p&&vt(s)&&s instanceof s)))return b}for(s=!u,u||(u=f()),a||(a=f()),p=u.length;p--;)if(u[p]==n)return a[p]==t;var v=0,i=h;if(u.push(n),a.push(t),l){if(p=n.length,v=t.length,i=v==n.length,!i&&!o)return i;for(;v--;)if(l=p,s=t[v],o)for(;l--&&!(i=st(n[l],s,e,r,u,a)););else if(!(i=st(n[v],s,e,r,u,a)))break;return i}return C(t,function(t,o,f){return le.call(f,o)?(v++,i=le.call(n,o)&&st(n[o],t,e,r,u,a)):void 0}),i&&!o&&C(n,function(n,t,e){return le.call(e,t)?i=-1<--v:void 0
|
||||
}),s&&(c(u),c(a)),i}function vt(n){return typeof n=="function"}function gt(n){return!(!n||!L[typeof n])}function ht(n){return typeof n=="number"||ve.call(n)==U}function yt(n){return typeof n=="string"||ve.call(n)==H}function bt(n,t,e){var r=arguments,u=0,a=2;if(!gt(n))return n;if(e===k)var o=r[3],i=r[4],l=r[5];else{var p=h,i=f(),l=f();typeof e!="number"&&(a=r.length),3<a&&"function"==typeof r[a-2]?o=tt.createCallback(r[--a-1],r[a--],2):2<a&&"function"==typeof r[a-1]&&(o=r[--a])}for(;++u<a;)(Ee(r[u])?wt:d)(r[u],function(t,e){var r,u,a=t,f=n[e];
|
||||
if(t&&((u=Ee(t))||m(t))){for(a=i.length;a--;)if(r=i[a]==t){f=l[a];break}if(!r){var c;o&&(a=o(f,t),c=typeof a!="undefined")&&(f=a),c||(f=u?Ee(f)?f:[]:m(f)?f:{}),i.push(t),l.push(f),c||(f=bt(f,t,k,o,i,l))}}else o&&(a=o(f,t),typeof a=="undefined"&&(a=t)),typeof a!="undefined"&&(f=a);n[e]=f});return p&&(c(i),c(l)),n}function mt(n){for(var t=-1,e=Se(n),r=e.length,u=Mt(r);++t<r;)u[t]=n[e[t]];return u}function dt(n,t,e){var r=-1,u=at(),a=n?n.length:0,o=b;return e=(0>e?_e(0,a+e):e)||0,a&&typeof a=="number"?o=-1<(yt(n)?n.indexOf(t,e):u(n,t,e)):d(n,function(n){return++r<e?void 0:!(o=n===t)
|
||||
}),o}function _t(n,t,e){var r=h;t=tt.createCallback(t,e),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u&&(r=!!t(n[e],e,n)););else d(n,function(n,e,u){return r=!!t(n,e,u)});return r}function kt(n,t,e){var r=[];t=tt.createCallback(t,e),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u;){var a=n[e];t(a,e,n)&&r.push(a)}else d(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function jt(n,t,e){t=tt.createCallback(t,e),e=-1;var r=n?n.length:0;if(typeof r!="number"){var u;return d(n,function(n,e,r){return t(n,e,r)?(u=n,b):void 0
|
||||
}),u}for(;++e<r;){var a=n[e];if(t(a,e,n))return a}}function wt(n,t,e){var r=-1,u=n?n.length:0;if(t=t&&typeof e=="undefined"?t:tt.createCallback(t,e),typeof u=="number")for(;++r<u&&t(n[r],r,n)!==false;);else d(n,t);return n}function Ct(n,t,e){var r=-1,u=n?n.length:0;if(t=tt.createCallback(t,e),typeof u=="number")for(var a=Mt(u);++r<u;)a[r]=t(n[r],r,n);else a=[],d(n,function(n,e,u){a[++r]=t(n,e,u)});return a}function xt(n,t,e){var r=-1/0,a=r;if(!t&&Ee(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];i>a&&(a=i)
|
||||
}}else t=!t&&yt(n)?u:tt.createCallback(t,e),wt(n,function(n,e,u){e=t(n,e,u),e>r&&(r=e,a=n)});return a}function Ot(n,t){var e=-1,r=n?n.length:0;if(typeof r=="number")for(var u=Mt(r);++e<r;)u[e]=n[e][t];return u||Ct(n,t)}function Et(n,t,e,r){if(!n)return e;var u=3>arguments.length;t=tt.createCallback(t,r,4);var a=-1,o=n.length;if(typeof o=="number")for(u&&(e=n[++a]);++a<o;)e=t(e,n[a],a,n);else d(n,function(n,r,a){e=u?(u=b,n):t(e,n,r,a)});return e}function St(n,t,e,r){var u=n?n.length:0,a=3>arguments.length;
|
||||
if(typeof u!="number")var o=Se(n),u=o.length;return t=tt.createCallback(t,r,4),wt(n,function(r,i,f){i=o?o[--u]:--u,e=a?(a=b,n[i]):t(e,n[i],i,f)}),e}function It(n,t,e){var r;t=tt.createCallback(t,e),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u&&!(r=t(n[e],e,n)););else d(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function At(n){var r=-1,u=at(),a=n?n.length:0,i=ae.apply(Zt,Ce.call(arguments,1)),f=[],l=a>=w&&u===t;if(l){var c=o(i);c?(u=e,i=c):l=b}for(;++r<a;)c=n[r],0>u(i,c)&&f.push(c);
|
||||
return l&&p(i),f}function Nt(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&t!=y){var a=-1;for(t=tt.createCallback(t,e);++a<u&&t(n[a],a,n);)r++}else if(r=t,r==y||e)return n[0];return s(n,0,ke(_e(0,r),u))}}function $t(n,e,r){if(typeof r=="number"){var u=n?n.length:0;r=0>r?_e(0,u+r):r||0}else if(r)return r=Ft(n,e),n[r]===e?r:-1;return n?t(n,e,r):-1}function Bt(n,t,e){if(typeof t!="number"&&t!=y){var r=0,u=-1,a=n?n.length:0;for(t=tt.createCallback(t,e);++u<a&&t(n[u],u,n);)r++}else r=t==y||e?1:_e(0,t);
|
||||
return s(n,r)}function Ft(n,t,e,r){var u=0,a=n?n.length:u;for(e=e?tt.createCallback(e,r,1):Wt,t=e(t);u<a;)r=u+a>>>1,e(n[r])<t?u=r+1:a=r;return u}function Rt(n){for(var t=-1,e=n?xt(Ot(n,"length")):0,r=Mt(0>e?0:e);++t<e;)r[t]=Ot(n,t);return r}function Tt(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var a=n[e];t?u[a]=t[e]:u[a[0]]=a[1]}return u}function qt(n,t){return Oe.fastBind||ge&&2<arguments.length?ge.call.apply(ge,arguments):rt(n,t,Ce.call(arguments,2))}function Dt(n,t,e){function r(){ue(s),ue(v),l=0,s=v=y
|
||||
}function u(){var t=g&&(!m||1<l);r(),t&&(p!==false&&(c=new Vt),i=n.apply(f,o))}function a(){r(),(g||p!==t)&&(c=new Vt,i=n.apply(f,o))}var o,i,f,l=0,c=0,p=b,s=y,v=y,g=h;if(t=_e(0,t||0),e===h)var m=h,g=b;else gt(e)&&(m=e.leading,p="maxWait"in e&&_e(t,e.maxWait||0),g="trailing"in e?e.trailing:g);return function(){if(o=arguments,f=this,l++,ue(v),p===false)m&&2>l&&(i=n.apply(f,o));else{var e=new Vt;!s&&!m&&(c=e);var r=p-(e-c);0<r?s||(s=se(a,r)):(ue(s),s=y,c=e,i=n.apply(f,o))}return t!==p&&(v=se(u,t)),i}}function zt(n){var t=Ce.call(arguments,1);
|
||||
return se(function(){n.apply(g,t)},1)}function Wt(n){return n}function Pt(n){wt(ct(n),function(t){var e=tt[t]=n[t];tt.prototype[t]=function(){var n=this.__wrapped__,t=[n];return ce.apply(t,arguments),t=e.apply(tt,t),n&&typeof n=="object"&&n===t?this:new et(t)}})}function Kt(){return this.__wrapped__}r=r?nt.defaults(n.Object(),r,nt.pick(n,D)):n;var Mt=r.Array,Ut=r.Boolean,Vt=r.Date,Gt=r.Function,Ht=r.Math,Jt=r.Number,Lt=r.Object,Qt=r.RegExp,Xt=r.String,Yt=r.TypeError,Zt=[],ne=Lt.prototype,te=r._,ee=Qt("^"+Xt(ne.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),re=Ht.ceil,ue=r.clearTimeout,ae=Zt.concat,oe=Ht.floor,ie=Gt.prototype.toString,fe=ee.test(fe=Lt.getPrototypeOf)&&fe,le=ne.hasOwnProperty,ce=Zt.push,pe=r.setImmediate,se=r.setTimeout,ve=ne.toString,ge=ee.test(ge=ve.bind)&&ge,he=ee.test(he=Lt.create)&&he,ye=ee.test(ye=Mt.isArray)&&ye,be=r.isFinite,me=r.isNaN,de=ee.test(de=Lt.keys)&&de,_e=Ht.max,ke=Ht.min,je=r.parseInt,we=Ht.random,Ce=Zt.slice,Ht=ee.test(r.attachEvent),Ht=ge&&!/\n|true/.test(ge+Ht),xe={};
|
||||
xe[W]=Mt,xe[P]=Ut,xe[K]=Vt,xe[M]=Gt,xe[V]=Lt,xe[U]=Jt,xe[G]=Qt,xe[H]=Xt,et.prototype=tt.prototype;var Oe=tt.support={};Oe.fastBind=ge&&!Ht,tt.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:N,variable:"",imports:{_:tt}};var Ee=ye,Se=de?function(n){return gt(n)?de(n):[]}:Z,Ie={"&":"&","<":"<",">":">",'"':""","'":"'"},Ae=pt(Ie),Ut=ot(function $e(n,t,e){for(var r=-1,u=n?n.length:0,a=[];++r<u;){var o=n[r];e&&(o=e(o,r,n)),Ee(o)?ce.apply(a,t?o:$e(o)):a.push(o)
|
||||
}return a}),Ne=ot(function(n,r,u){var a=-1,i=at(),l=n?n.length:0,s=[],v=!r&&l>=w&&i===t,g=u||v?f():s;if(v){var h=o(g);h?(i=e,g=h):(v=b,g=u?g:(c(g),s))}for(;++a<l;){var h=n[a],y=u?u(h,a,n):h;(r?!a||g[g.length-1]!==y:0>i(g,y))&&((u||v)&&g.push(y),s.push(h))}return v?(c(g.b),p(g)):u&&c(g),s});return Ht&&Y&&typeof pe=="function"&&(zt=qt(pe,r)),pe=8==je(B+"08")?je:function(n,t){return je(yt(n)?n.replace(F,""):n,t||0)},tt.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0
|
||||
}},tt.assign=X,tt.at=function(n){for(var t=-1,e=ae.apply(Zt,Ce.call(arguments,1)),r=e.length,u=Mt(r);++t<r;)u[t]=n[e[t]];return u},tt.bind=qt,tt.bindAll=function(n){for(var t=1<arguments.length?ae.apply(Zt,Ce.call(arguments,1)):ct(n),e=-1,r=t.length;++e<r;){var u=t[e];n[u]=qt(n[u],n)}return n},tt.bindKey=function(n,t){return rt(n,t,Ce.call(arguments,2),k)},tt.compact=function(n){for(var t=-1,e=n?n.length:0,r=[];++t<e;){var u=n[t];u&&r.push(u)}return r},tt.compose=function(){var n=arguments;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];
|
||||
return t[0]}},tt.countBy=function(n,t,e){var r={};return t=tt.createCallback(t,e),wt(n,function(n,e,u){e=Xt(t(n,e,u)),le.call(r,e)?r[e]++:r[e]=1}),r},tt.createCallback=function(n,t,e){if(n==y)return Wt;var r=typeof n;if("function"!=r){if("object"!=r)return function(t){return t[n]};var u=Se(n);return function(t){for(var e=u.length,r=b;e--&&(r=st(t[u[e]],n[u[e]],k)););return r}}return typeof t=="undefined"||$&&!$.test(ie.call(n))?n:1===e?function(e){return n.call(t,e)}:2===e?function(e,r){return n.call(t,e,r)
|
||||
}:4===e?function(e,r,u,a){return n.call(t,e,r,u,a)}:function(e,r,u){return n.call(t,e,r,u)}},tt.debounce=Dt,tt.defaults=Q,tt.defer=zt,tt.delay=function(n,t){var e=Ce.call(arguments,2);return se(function(){n.apply(g,e)},t)},tt.difference=At,tt.filter=kt,tt.flatten=Ut,tt.forEach=wt,tt.forIn=C,tt.forOwn=d,tt.functions=ct,tt.groupBy=function(n,t,e){var r={};return t=tt.createCallback(t,e),wt(n,function(n,e,u){e=Xt(t(n,e,u)),(le.call(r,e)?r[e]:r[e]=[]).push(n)}),r},tt.initial=function(n,t,e){if(!n)return[];
|
||||
var r=0,u=n.length;if(typeof t!="number"&&t!=y){var a=u;for(t=tt.createCallback(t,e);a--&&t(n[a],a,n);)r++}else r=t==y||e?1:t||r;return s(n,0,ke(_e(0,u-r),u))},tt.intersection=function(n){for(var r=arguments,u=r.length,a=-1,i=f(),l=-1,s=at(),v=n?n.length:0,g=[],h=f();++a<u;){var y=r[a];i[a]=s===t&&(y?y.length:0)>=w&&o(a?r[a]:h)}n:for(;++l<v;){var b=i[0],y=n[l];if(0>(b?e(b,y):s(h,y))){for(a=u,(b||h).push(y);--a;)if(b=i[a],0>(b?e(b,y):s(r[a],y)))continue n;g.push(y)}}for(;u--;)(b=i[u])&&p(b);return c(i),c(h),g
|
||||
},tt.invert=pt,tt.invoke=function(n,t){var e=Ce.call(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=Mt(typeof a=="number"?a:0);return wt(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},tt.keys=Se,tt.map=Ct,tt.max=xt,tt.memoize=function(n,t){function e(){var r=e.cache,u=j+(t?t.apply(this,arguments):arguments[0]);return le.call(r,u)?r[u]:r[u]=n.apply(this,arguments)}return e.cache={},e},tt.merge=bt,tt.min=function(n,t,e){var r=1/0,a=r;if(!t&&Ee(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];
|
||||
i<a&&(a=i)}}else t=!t&&yt(n)?u:tt.createCallback(t,e),wt(n,function(n,e,u){e=t(n,e,u),e<r&&(r=e,a=n)});return a},tt.omit=function(n,t,e){var r=at(),u=typeof t=="function",a={};if(u)t=tt.createCallback(t,e);else var o=ae.apply(Zt,Ce.call(arguments,1));return C(n,function(n,e,i){(u?!t(n,e,i):0>r(o,e))&&(a[e]=n)}),a},tt.once=function(n){var t,e;return function(){return t?e:(t=h,e=n.apply(this,arguments),n=y,e)}},tt.pairs=function(n){for(var t=-1,e=Se(n),r=e.length,u=Mt(r);++t<r;){var a=e[t];u[t]=[a,n[a]]
|
||||
}return u},tt.partial=function(n){return rt(n,Ce.call(arguments,1))},tt.partialRight=function(n){return rt(n,Ce.call(arguments,1),y,k)},tt.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,a=ae.apply(Zt,Ce.call(arguments,1)),o=gt(n)?a.length:0;++u<o;){var i=a[u];i in n&&(r[i]=n[i])}else t=tt.createCallback(t,e),C(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},tt.pluck=Ot,tt.range=function(n,t,e){n=+n||0,e=+e||1,t==y&&(t=n,n=0);var r=-1;t=_e(0,re((t-n)/e));for(var u=Mt(t);++r<t;)u[r]=n,n+=e;
|
||||
return u},tt.reject=function(n,t,e){return t=tt.createCallback(t,e),kt(n,function(n,e,r){return!t(n,e,r)})},tt.rest=Bt,tt.shuffle=function(n){var t=-1,e=n?n.length:0,r=Mt(typeof e=="number"?e:0);return wt(n,function(n){var e=oe(we()*(++t+1));r[t]=r[e],r[e]=n}),r},tt.sortBy=function(n,t,e){var r=-1,u=n?n.length:0,o=Mt(typeof u=="number"?u:0);for(t=tt.createCallback(t,e),wt(n,function(n,e,u){var a=o[++r]=l();a.l=t(n,e,u),a.m=r,a.n=n}),u=o.length,o.sort(a);u--;)n=o[u],o[u]=n.n,p(n);return o},tt.tap=function(n,t){return t(n),n
|
||||
},tt.throttle=function(n,t,e){var r=h,u=h;return e===false?r=b:gt(e)&&(r="leading"in e?e.leading:r,u="trailing"in e?e.trailing:u),e=l(),e.leading=r,e.maxWait=t,e.trailing=u,n=Dt(n,t,e),p(e),n},tt.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Mt(n);for(t=tt.createCallback(t,e,1);++r<n;)u[r]=t(r);return u},tt.toArray=function(n){return n&&typeof n.length=="number"?s(n):mt(n)},tt.transform=function(n,t,e,r){var u=Ee(n);return t=tt.createCallback(t,r,4),e==y&&(u?e=[]:(r=n&&n.constructor,e=gt(r&&r.prototype)?he(r&&r.prototype):{})),(u?wt:d)(n,function(n,r,u){return t(e,n,r,u)
|
||||
}),e},tt.union=function(n){return Ee(n)||(arguments[0]=n?Ce.call(n):Zt),Ne(ae.apply(Zt,arguments))},tt.uniq=Ne,tt.unzip=Rt,tt.values=mt,tt.where=kt,tt.without=function(n){return At(n,Ce.call(arguments,1))},tt.wrap=function(n,t){return function(){var e=[n];return ce.apply(e,arguments),t.apply(this,e)}},tt.zip=function(n){return n?Rt(arguments):[]},tt.zipObject=Tt,tt.collect=Ct,tt.drop=Bt,tt.each=wt,tt.extend=X,tt.methods=ct,tt.object=Tt,tt.select=kt,tt.tail=Bt,tt.unique=Ne,Pt(tt),tt.chain=tt,tt.prototype.chain=function(){return this
|
||||
},tt.clone=lt,tt.cloneDeep=function(n,t,e){return lt(n,h,t,e)},tt.contains=dt,tt.escape=function(n){return n==y?"":Xt(n).replace(T,ut)},tt.every=_t,tt.find=jt,tt.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=tt.createCallback(t,e);++r<u;)if(t(n[r],r,n))return r;return-1},tt.findKey=function(n,t,e){var r;return t=tt.createCallback(t,e),d(n,function(n,e,u){return t(n,e,u)?(r=e,b):void 0}),r},tt.has=function(n,t){return n?le.call(n,t):b},tt.identity=Wt,tt.indexOf=$t,tt.isArguments=function(n){return ve.call(n)==z
|
||||
},tt.isArray=Ee,tt.isBoolean=function(n){return n===h||n===false||ve.call(n)==P},tt.isDate=function(n){return n?typeof n=="object"&&ve.call(n)==K:b},tt.isElement=function(n){return n?1===n.nodeType:b},tt.isEmpty=function(n){var t=h;if(!n)return t;var e=ve.call(n),r=n.length;return e==W||e==H||e==z||e==V&&typeof r=="number"&&vt(n.splice)?!r:(d(n,function(){return t=b}),t)},tt.isEqual=st,tt.isFinite=function(n){return be(n)&&!me(parseFloat(n))},tt.isFunction=vt,tt.isNaN=function(n){return ht(n)&&n!=+n
|
||||
},tt.isNull=function(n){return n===y},tt.isNumber=ht,tt.isObject=gt,tt.isPlainObject=m,tt.isRegExp=function(n){return n?typeof n=="object"&&ve.call(n)==G:b},tt.isString=yt,tt.isUndefined=function(n){return typeof n=="undefined"},tt.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?_e(0,r+e):ke(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},tt.mixin=Pt,tt.noConflict=function(){return r._=te,this},tt.parseInt=pe,tt.random=function(n,t){n==y&&t==y&&(t=1),n=+n||0,t==y?(t=n,n=0):t=+t||0;
|
||||
var e=we();return n%1||t%1?n+ke(e*(t-n+parseFloat("1e-"+((e+"").length-1))),t):n+oe(e*(t-n+1))},tt.reduce=Et,tt.reduceRight=St,tt.result=function(n,t){var e=n?n[t]:g;return vt(e)?n[t]():e},tt.runInContext=v,tt.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Se(n).length},tt.some=It,tt.sortedIndex=Ft,tt.template=function(n,t,e){var r=tt.templateSettings;n||(n=""),e=Q({},e,r);var u,a=Q({},e.imports,r.imports),r=Se(a),a=mt(a),o=0,f=e.interpolate||R,l="__p+='",f=Qt((e.escape||R).source+"|"+f.source+"|"+(f===N?I:R).source+"|"+(e.evaluate||R).source+"|$","g");
|
||||
n.replace(f,function(t,e,r,a,f,c){return r||(r=a),l+=n.slice(o,c).replace(q,i),e&&(l+="'+__e("+e+")+'"),f&&(u=h,l+="';"+f+";__p+='"),r&&(l+="'+((__t=("+r+"))==null?'':__t)+'"),o=c+t.length,t}),l+="';\n",f=e=e.variable,f||(e="obj",l="with("+e+"){"+l+"}"),l=(u?l.replace(x,""):l).replace(O,"$1").replace(E,"$1;"),l="function("+e+"){"+(f?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";try{var c=Gt(r,"return "+l).apply(g,a)
|
||||
}catch(p){throw p.source=l,p}return t?c(t):(c.source=l,c)},tt.unescape=function(n){return n==y?"":Xt(n).replace(S,ft)},tt.uniqueId=function(n){var t=++_;return Xt(n==y?"":n)+t},tt.all=_t,tt.any=It,tt.detect=jt,tt.findWhere=jt,tt.foldl=Et,tt.foldr=St,tt.include=dt,tt.inject=Et,d(tt,function(n,t){tt.prototype[t]||(tt.prototype[t]=function(){var t=[this.__wrapped__];return ce.apply(t,arguments),n.apply(tt,t)})}),tt.first=Nt,tt.last=function(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&t!=y){var a=u;
|
||||
for(t=tt.createCallback(t,e);a--&&t(n[a],a,n);)r++}else if(r=t,r==y||e)return n[u-1];return s(n,_e(0,u-r))}},tt.take=Nt,tt.head=Nt,d(tt,function(n,t){tt.prototype[t]||(tt.prototype[t]=function(t,e){var r=n(this.__wrapped__,t,e);return t==y||e&&typeof t!="function"?r:new et(r)})}),tt.VERSION="1.3.0",tt.prototype.toString=function(){return Xt(this.__wrapped__)},tt.prototype.value=Kt,tt.prototype.valueOf=Kt,wt(["join","pop","shift"],function(n){var t=Zt[n];tt.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)
|
||||
}}),wt(["push","reverse","sort","unshift"],function(n){var t=Zt[n];tt.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),wt(["concat","slice","splice"],function(n){var t=Zt[n];tt.prototype[n]=function(){return new et(t.apply(this.__wrapped__,arguments))}}),tt}var g,h=!0,y=null,b=!1,m=[],d=[],_=0,k={},j=+new Date+"",w=75,C=10,x=/\b__p\+='';/g,O=/\b(__p\+=)''\+/g,E=/(__e\(.*?\)|\b__t\))\+'';/g,S=/&(?:amp|lt|gt|quot|#39);/g,I=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,A=/\w*$/,N=/<%=([\s\S]+?)%>/g,$=($=/\bthis\b/)&&$.test(v)&&$,B=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",F=RegExp("^["+B+"]*0+(?=.$)"),R=/($^)/,T=/[&<>"']/g,q=/['\n\r\t\u2028\u2029\\]/g,D="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),z="[object Arguments]",W="[object Array]",P="[object Boolean]",K="[object Date]",M="[object Function]",U="[object Number]",V="[object Object]",G="[object RegExp]",H="[object String]",J={};
|
||||
J[M]=b,J[z]=J[W]=J[P]=J[K]=J[U]=J[V]=J[G]=J[H]=h;var L={"boolean":b,"function":h,object:h,number:b,string:b,undefined:b},Q={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},X=L[typeof exports]&&exports,Y=L[typeof module]&&module&&module.exports==X&&module,Z=L[typeof global]&&global;!Z||Z.global!==Z&&Z.window!==Z||(n=Z);var nt=v();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=nt, define(function(){return nt})):X&&!X.nodeType?Y?(Y.exports=nt)._=nt:X._=nt:n._=nt
|
||||
}(this);
|
||||
2973
lodash.underscore.js → dist/lodash.underscore.js
vendored
35
dist/lodash.underscore.min.js
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* @license
|
||||
* Lo-Dash 1.3.0 (Custom Build) lodash.com/license
|
||||
* Build: `lodash underscore exports="amd,commonjs,global,node" -o ./dist/lodash.underscore.js`
|
||||
* Underscore.js 1.4.4 underscorejs.org/LICENSE
|
||||
*/
|
||||
;!function(n){function t(n,t){var r;if(n&>[typeof n])for(r in n)if(Et.call(n,r)&&t(n[r],r,n)===nt)break}function r(n,t){var r;if(n&>[typeof n])for(r in n)if(t(n[r],r,n)===nt)break}function e(n){var t,r=[];if(!n||!gt[typeof n])return r;for(t in n)Et.call(n,t)&&r.push(t);return r}function u(n,t,r){r=(r||0)-1;for(var e=n.length;++r<e;)if(n[r]===t)return r;return-1}function o(n,t){var r=n.m,e=t.m;if(n=n.l,t=t.l,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1}return r<e?-1:1
|
||||
}function i(n){return"\\"+ht[n]}function a(){}function f(n){return n instanceof f?n:new c(n)}function c(n){this.__wrapped__=n}function l(n,t,r){function e(){var f=arguments,c=o?this:t;return u||(n=t[i]),r.length&&(f=f.length?(f=zt.call(f),a?f.concat(r):r.concat(f)):r),this instanceof e?(c=p(n.prototype),f=n.apply(c,f),A(f)?f:c):n.apply(c,f)}var u=w(n),o=!r,i=t;if(o){var a=void 0;r=t}else if(!u)throw new TypeError;return e}function p(n){return A(n)?Ft(n):{}}function s(n){return Wt[n]}function v(){var n=(n=f.indexOf)===U?u:n;
|
||||
return n}function g(n){return Gt[n]}function h(n){return kt.call(n)==it}function y(n){if(!n)return n;for(var t=1,r=arguments.length;t<r;t++){var e=arguments[t];if(e)for(var u in e)n[u]=e[u]}return n}function m(n){if(!n)return n;for(var t=1,r=arguments.length;t<r;t++){var e=arguments[t];if(e)for(var u in e)n[u]==X&&(n[u]=e[u])}return n}function _(n){var t=[];return r(n,function(n,r){w(n)&&t.push(r)}),t.sort()}function d(n){for(var t=-1,r=Vt(n),e=r.length,u={};++t<e;){var o=r[t];u[n[o]]=o}return u}function b(n){if(!n)return Q;
|
||||
if(Ut(n)||O(n))return!n.length;for(var t in n)if(Et.call(n,t))return Y;return Q}function j(n,t,e,u){if(n===t)return 0!==n||1/n==1/t;var o=typeof n,i=typeof t;if(n===n&&(!n||"function"!=o&&"object"!=o)&&(!t||"function"!=i&&"object"!=i))return Y;if(n==X||t==X)return n===t;if(i=kt.call(n),o=kt.call(t),i!=o)return Y;switch(i){case ft:case ct:return+n==+t;case lt:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case st:case vt:return n==t+""}if(o=i==at,!o){if(n instanceof f||t instanceof f)return j(n.__wrapped__||n,t.__wrapped__||t,e,u);
|
||||
if(i!=pt)return Y;var i=n.constructor,a=t.constructor;if(i!=a&&(!w(i)||!(i instanceof i&&w(a)&&a instanceof a)))return Y}for(e||(e=[]),u||(u=[]),i=e.length;i--;)if(e[i]==n)return u[i]==t;var c=Q,l=0;if(e.push(n),u.push(t),o){if(l=t.length,c=l==n.length)for(;l--&&(c=j(n[l],t[l],e,u)););return c}return r(t,function(t,r,o){return Et.call(o,r)?(l++,!(c=Et.call(n,r)&&j(n[r],t,e,u))&&nt):void 0}),c&&r(n,function(n,t,r){return Et.call(r,t)?!(c=-1<--l)&&nt:void 0}),c}function w(n){return typeof n=="function"
|
||||
}function A(n){return!(!n||!gt[typeof n])}function x(n){return typeof n=="number"||kt.call(n)==lt}function O(n){return typeof n=="string"||kt.call(n)==vt}function E(n){for(var t=-1,r=Vt(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function S(n,r){var e=v(),u=n?n.length:0,o=Y;return u&&typeof u=="number"?o=-1<e(n,r):t(n,function(n){return(o=n===r)&&nt}),o}function N(n,r,e){var u=Q;r=J(r,e),e=-1;var o=n?n.length:0;if(typeof o=="number")for(;++e<o&&(u=!!r(n[e],e,n)););else t(n,function(n,t,e){return!(u=!!r(n,t,e))&&nt
|
||||
});return u}function k(n,r,e){var u=[];r=J(r,e),e=-1;var o=n?n.length:0;if(typeof o=="number")for(;++e<o;){var i=n[e];r(i,e,n)&&u.push(i)}else t(n,function(n,t,e){r(n,t,e)&&u.push(n)});return u}function B(n,r,e){r=J(r,e),e=-1;var u=n?n.length:0;if(typeof u!="number"){var o;return t(n,function(n,t,e){return r(n,t,e)?(o=n,nt):void 0}),o}for(;++e<u;){var i=n[e];if(r(i,e,n))return i}}function F(n,r,e){var u=-1,o=n?n.length:0;if(r=r&&typeof e=="undefined"?r:J(r,e),typeof o=="number")for(;++u<o&&r(n[u],u,n)!==nt;);else t(n,r)
|
||||
}function q(n,r,e){var u=-1,o=n?n.length:0;if(r=J(r,e),typeof o=="number")for(var i=Array(o);++u<o;)i[u]=r(n[u],u,n);else i=[],t(n,function(n,t,e){i[++u]=r(n,t,e)});return i}function R(n,t,r){var e=-1/0,u=e,o=-1,i=n?n.length:0;if(t||typeof i!="number")t=J(t,r),F(n,function(n,r,o){r=t(n,r,o),r>e&&(e=r,u=n)});else for(;++o<i;)r=n[o],r>u&&(u=r);return u}function D(n,t){var r=-1,e=n?n.length:0;if(typeof e=="number")for(var u=Array(e);++r<e;)u[r]=n[r][t];return u||q(n,t)}function M(n,r,e,u){if(!n)return e;
|
||||
var o=3>arguments.length;r=J(r,u,4);var i=-1,a=n.length;if(typeof a=="number")for(o&&(e=n[++i]);++i<a;)e=r(e,n[i],i,n);else t(n,function(n,t,u){e=o?(o=Y,n):r(e,n,t,u)});return e}function T(n,t,r,e){var u=n?n.length:0,o=3>arguments.length;if(typeof u!="number")var i=Vt(n),u=i.length;return t=J(t,e,4),F(n,function(e,a,f){a=i?i[--u]:--u,r=o?(o=Y,n[a]):t(r,n[a],a,f)}),r}function $(n,r,e){var u;r=J(r,e),e=-1;var o=n?n.length:0;if(typeof o=="number")for(;++e<o&&!(u=r(n[e],e,n)););else t(n,function(n,t,e){return(u=r(n,t,e))&&nt
|
||||
});return!!u}function I(n,t,r){return r&&b(t)?X:(r?B:k)(n,t)}function z(n){for(var t=-1,r=v(),e=n.length,u=xt.apply(dt,zt.call(arguments,1)),o=[];++t<e;){var i=n[t];0>r(u,i)&&o.push(i)}return o}function C(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=X){var o=-1;for(t=J(t,r);++o<u&&t(n[o],o,n);)e++}else if(e=t,e==X||r)return n[0];return zt.call(n,0,$t(Tt(0,e),u))}}function P(n,t){for(var r=-1,e=n?n.length:0,u=[];++r<e;){var o=n[r];Ut(o)?St.apply(u,t?o:P(o)):u.push(o)}return u}function U(n,t,r){if(typeof r=="number"){var e=n?n.length:0;
|
||||
r=0>r?Tt(0,e+r):r||0}else if(r)return r=W(n,t),n[r]===t?r:-1;return n?u(n,t,r):-1}function V(n,t,r){if(typeof t!="number"&&t!=X){var e=0,u=-1,o=n?n.length:0;for(t=J(t,r);++u<o&&t(n[u],u,n);)e++}else e=t==X||r?1:Tt(0,t);return zt.call(n,e)}function W(n,t,r,e){var u=0,o=n?n.length:u;for(r=r?J(r,e,1):K,t=r(t);u<o;)e=u+o>>>1,r(n[e])<t?u=e+1:o=e;return u}function G(n,t,r,e){var u=-1,o=v(),i=n?n.length:0,a=[],f=a;for(typeof t!="boolean"&&t!=X&&(e=r,r=t,t=Y),r!=X&&(f=[],r=J(r,e));++u<i;){e=n[u];var c=r?r(e,u,n):e;
|
||||
(t?!u||f[f.length-1]!==c:0>o(f,c))&&(r&&f.push(c),a.push(e))}return a}function H(n,t){return Pt.fastBind||Bt&&2<arguments.length?Bt.call.apply(Bt,arguments):l(n,t,zt.call(arguments,2))}function J(n,t,r){if(n==X)return K;var e=typeof n;if("function"!=e){if("object"!=e)return function(t){return t[n]};var u=Vt(n);return function(t){for(var r=u.length,e=Y;r--&&(e=t[u[r]]===n[u[r]]););return e}}return typeof t=="undefined"?n:1===r?function(r){return n.call(t,r)}:2===r?function(r,e){return n.call(t,r,e)
|
||||
}:4===r?function(r,e,u,o){return n.call(t,r,e,u,o)}:function(r,e,u){return n.call(t,r,e,u)}}function K(n){return n}function L(n){F(_(n),function(t){var r=f[t]=n[t];f.prototype[t]=function(){var n=[this.__wrapped__];return St.apply(n,arguments),n=r.apply(f,n),this.__chain__&&(n=new c(n),n.__chain__=Q),n}})}var Q=!0,X=null,Y=!1,Z=0,nt={},tt=+new Date+"",rt=/&(?:amp|lt|gt|quot|#39);/g,et=/($^)/,ut=/[&<>"']/g,ot=/['\n\r\t\u2028\u2029\\]/g,it="[object Arguments]",at="[object Array]",ft="[object Boolean]",ct="[object Date]",lt="[object Number]",pt="[object Object]",st="[object RegExp]",vt="[object String]",gt={"boolean":Y,"function":Q,object:Q,number:Y,string:Y,undefined:Y},ht={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},yt=gt[typeof exports]&&exports,mt=gt[typeof module]&&module&&module.exports==yt&&module,_t=gt[typeof global]&&global;
|
||||
!_t||_t.global!==_t&&_t.window!==_t||(n=_t);var dt=[],_t=Object.prototype,bt=n._,jt=RegExp("^"+(_t.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),wt=Math.ceil,At=n.clearTimeout,xt=dt.concat,Ot=Math.floor,Et=_t.hasOwnProperty,St=dt.push,Nt=n.setTimeout,kt=_t.toString,Bt=jt.test(Bt=kt.bind)&&Bt,Ft=jt.test(Ft=Object.create)&&Ft,qt=jt.test(qt=Array.isArray)&&qt,Rt=n.isFinite,Dt=n.isNaN,Mt=jt.test(Mt=Object.keys)&&Mt,Tt=Math.max,$t=Math.min,It=Math.random,zt=dt.slice,_t=jt.test(n.attachEvent),Ct=Bt&&!/\n|true/.test(Bt+_t);
|
||||
c.prototype=f.prototype;var Pt={};!function(){var n={0:1,length:1};Pt.fastBind=Bt&&!Ct,Pt.spliceObjects=(dt.splice.call(n,0,1),!n[0])}(1),f.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Ft||(p=function(n){if(A(n)){a.prototype=n;var t=new a;a.prototype=X}return t||{}}),h(arguments)||(h=function(n){return n?Et.call(n,"callee"):Y});var Ut=qt||function(n){return n?typeof n=="object"&&kt.call(n)==at:Y},Vt=Mt?function(n){return A(n)?Mt(n):[]
|
||||
}:e,Wt={"&":"&","<":"<",">":">",'"':""","'":"'"},Gt=d(Wt);w(/x/)&&(w=function(n){return typeof n=="function"&&"[object Function]"==kt.call(n)}),f.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},f.bind=H,f.bindAll=function(n){for(var t=1<arguments.length?xt.apply(dt,zt.call(arguments,1)):_(n),r=-1,e=t.length;++r<e;){var u=t[r];n[u]=H(n[u],n)}return n},f.compact=function(n){for(var t=-1,r=n?n.length:0,e=[];++t<r;){var u=n[t];u&&e.push(u)
|
||||
}return e},f.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},f.countBy=function(n,t,r){var e={};return t=J(t,r),F(n,function(n,r,u){r=t(n,r,u)+"",Et.call(e,r)?e[r]++:e[r]=1}),e},f.debounce=function(n,t,r){function e(){a=X,r||(o=n.apply(i,u))}var u,o,i,a=X;return function(){var f=r&&!a;return u=arguments,i=this,At(a),a=Nt(e,t),f&&(o=n.apply(i,u)),o}},f.defaults=m,f.defer=function(n){var t=zt.call(arguments,1);return Nt(function(){n.apply(void 0,t)
|
||||
},1)},f.delay=function(n,t){var r=zt.call(arguments,2);return Nt(function(){n.apply(void 0,r)},t)},f.difference=z,f.filter=k,f.flatten=P,f.forEach=F,f.functions=_,f.groupBy=function(n,t,r){var e={};return t=J(t,r),F(n,function(n,r,u){r=t(n,r,u)+"",(Et.call(e,r)?e[r]:e[r]=[]).push(n)}),e},f.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t!="number"&&t!=X){var o=u;for(t=J(t,r);o--&&t(n[o],o,n);)e++}else e=t==X||r?1:t||e;return zt.call(n,0,$t(Tt(0,u-e),u))},f.intersection=function(n){var t=arguments,r=t.length,e=-1,u=v(),o=n?n.length:0,i=[];
|
||||
n:for(;++e<o;){var a=n[e];if(0>u(i,a)){for(var f=r;--f;)if(0>u(t[f],a))continue n;i.push(a)}}return i},f.invert=d,f.invoke=function(n,t){var r=zt.call(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);return F(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},f.keys=Vt,f.map=q,f.max=R,f.memoize=function(n,t){var r={};return function(){var e=tt+(t?t.apply(this,arguments):arguments[0]);return Et.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},f.min=function(n,t,r){var e=1/0,u=e,o=-1,i=n?n.length:0;
|
||||
if(t||typeof i!="number")t=J(t,r),F(n,function(n,r,o){r=t(n,r,o),r<e&&(e=r,u=n)});else for(;++o<i;)r=n[o],r<u&&(u=r);return u},f.omit=function(n){var t=v(),e=xt.apply(dt,zt.call(arguments,1)),u={};return r(n,function(n,r){0>t(e,r)&&(u[r]=n)}),u},f.once=function(n){var t,r;return function(){return t?r:(t=Q,r=n.apply(this,arguments),n=X,r)}},f.pairs=function(n){for(var t=-1,r=Vt(n),e=r.length,u=Array(e);++t<e;){var o=r[t];u[t]=[o,n[o]]}return u},f.partial=function(n){return l(n,zt.call(arguments,1))
|
||||
},f.pick=function(n){for(var t=-1,r=xt.apply(dt,zt.call(arguments,1)),e=r.length,u={};++t<e;){var o=r[t];o in n&&(u[o]=n[o])}return u},f.pluck=D,f.range=function(n,t,r){n=+n||0,r=+r||1,t==X&&(t=n,n=0);var e=-1;t=Tt(0,wt((t-n)/r));for(var u=Array(t);++e<t;)u[e]=n,n+=r;return u},f.reject=function(n,t,r){return t=J(t,r),k(n,function(n,r,e){return!t(n,r,e)})},f.rest=V,f.shuffle=function(n){var t=-1,r=n?n.length:0,e=Array(typeof r=="number"?r:0);return F(n,function(n){var r=Ot(It()*(++t+1));e[t]=e[r],e[r]=n
|
||||
}),e},f.sortBy=function(n,t,r){var e=-1,u=n?n.length:0,i=Array(typeof u=="number"?u:0);for(t=J(t,r),F(n,function(n,r,u){i[++e]={l:t(n,r,u),m:e,n:n}}),u=i.length,i.sort(o);u--;)i[u]=i[u].n;return i},f.tap=function(n,t){return t(n),n},f.throttle=function(n,t){function r(){i=new Date,a=X,u=n.apply(o,e)}var e,u,o,i=0,a=X;return function(){var f=new Date,c=t-(f-i);return e=arguments,o=this,0<c?a||(a=Nt(r,c)):(At(a),a=X,i=f,u=n.apply(o,e)),u}},f.times=function(n,t,r){for(var e=-1,u=Array(-1<n?n:0);++e<n;)u[e]=t.call(r,e);
|
||||
return u},f.toArray=function(n){return Ut(n)?zt.call(n):n&&typeof n.length=="number"?q(n):E(n)},f.union=function(n){return Ut(n)||(arguments[0]=n?zt.call(n):dt),G(xt.apply(dt,arguments))},f.uniq=G,f.values=E,f.where=I,f.without=function(n){return z(n,zt.call(arguments,1))},f.wrap=function(n,t){return function(){var r=[n];return St.apply(r,arguments),t.apply(this,r)}},f.zip=function(n){for(var t=-1,r=n?R(D(arguments,"length")):0,e=Array(0>r?0:r);++t<r;)e[t]=D(arguments,t);return e},f.collect=q,f.drop=V,f.each=F,f.extend=y,f.methods=_,f.object=function(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var o=n[r];
|
||||
t?u[o]=t[r]:u[o[0]]=o[1]}return u},f.select=k,f.tail=V,f.unique=G,f.chain=function(n){return n=new c(n),n.__chain__=Q,n},f.clone=function(n){return A(n)?Ut(n)?zt.call(n):y({},n):n},f.contains=S,f.escape=function(n){return n==X?"":(n+"").replace(ut,s)},f.every=N,f.find=B,f.has=function(n,t){return n?Et.call(n,t):Y},f.identity=K,f.indexOf=U,f.isArguments=h,f.isArray=Ut,f.isBoolean=function(n){return n===Q||n===Y||kt.call(n)==ft},f.isDate=function(n){return n?typeof n=="object"&&kt.call(n)==ct:Y},f.isElement=function(n){return n?1===n.nodeType:Y
|
||||
},f.isEmpty=b,f.isEqual=j,f.isFinite=function(n){return Rt(n)&&!Dt(parseFloat(n))},f.isFunction=w,f.isNaN=function(n){return x(n)&&n!=+n},f.isNull=function(n){return n===X},f.isNumber=x,f.isObject=A,f.isRegExp=function(n){return!(!n||!gt[typeof n])&&kt.call(n)==st},f.isString=O,f.isUndefined=function(n){return typeof n=="undefined"},f.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?Tt(0,e+r):$t(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},f.mixin=L,f.noConflict=function(){return n._=bt,this
|
||||
},f.random=function(n,t){n==X&&t==X&&(t=1),n=+n||0,t==X?(t=n,n=0):t=+t||0;var r=It();return n%1||t%1?n+$t(r*(t-n+parseFloat("1e-"+((r+"").length-1))),t):n+Ot(r*(t-n+1))},f.reduce=M,f.reduceRight=T,f.result=function(n,t){var r=n?n[t]:X;return w(r)?n[t]():r},f.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Vt(n).length},f.some=$,f.sortedIndex=W,f.template=function(n,t,r){var e=f.templateSettings;n||(n=""),r=m({},r,e);var u=0,o="__p+='",e=r.variable;n.replace(RegExp((r.escape||et).source+"|"+(r.interpolate||et).source+"|"+(r.evaluate||et).source+"|$","g"),function(t,r,e,a,f){return o+=n.slice(u,f).replace(ot,i),r&&(o+="'+_['escape']("+r+")+'"),a&&(o+="';"+a+";__p+='"),e&&(o+="'+((__t=("+e+"))==null?'':__t)+'"),u=f+t.length,t
|
||||
}),o+="';\n",e||(e="obj",o="with("+e+"||{}){"+o+"}"),o="function("+e+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+o+"return __p}";try{var a=Function("_","return "+o)(f)}catch(c){throw c.source=o,c}return t?a(t):(a.source=o,a)},f.unescape=function(n){return n==X?"":(n+"").replace(rt,g)},f.uniqueId=function(n){var t=++Z+"";return n?n+t:t},f.all=N,f.any=$,f.detect=B,f.findWhere=function(n,t){return I(n,t,Q)},f.foldl=M,f.foldr=T,f.include=S,f.inject=M,f.first=C,f.last=function(n,t,r){if(n){var e=0,u=n.length;
|
||||
if(typeof t!="number"&&t!=X){var o=u;for(t=J(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,e==X||r)return n[u-1];return zt.call(n,Tt(0,u-e))}},f.take=C,f.head=C,f.VERSION="1.3.0",L(f),f.prototype.chain=function(){return this.__chain__=Q,this},f.prototype.value=function(){return this.__wrapped__},F("pop push reverse shift sort splice unshift".split(" "),function(n){var t=dt[n];f.prototype[n]=function(){var n=this.__wrapped__;return t.apply(n,arguments),!Pt.spliceObjects&&0===n.length&&delete n[0],this}}),F(["concat","join","slice"],function(n){var t=dt[n];
|
||||
f.prototype[n]=function(){var n=t.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new c(n),n.__chain__=Q),n}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=f, define(function(){return f})):yt&&!yt.nodeType?mt?(mt.exports=f)._=f:yt._=f:n._=f}(this);
|
||||
1705
doc/README.md
@@ -21,9 +21,9 @@
|
||||
// generate Markdown
|
||||
$markdown = docdown(array(
|
||||
'path' => '../' . $file,
|
||||
'title' => 'Lo-Dash <sup>v1.0.0-rc.2</sup>',
|
||||
'title' => 'Lo-Dash <sup>v1.3.0</sup>',
|
||||
'toc' => 'categories',
|
||||
'url' => 'https://github.com/bestiejs/lodash/blob/master/lodash.js'
|
||||
'url' => 'https://github.com/lodash/lodash/blob/1.3.0/lodash.js'
|
||||
));
|
||||
|
||||
// save to a .md file
|
||||
@@ -33,4 +33,4 @@
|
||||
header('Content-Type: text/plain;charset=utf-8');
|
||||
echo $markdown . PHP_EOL;
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
2
index.js
@@ -1 +1 @@
|
||||
module.exports = require('./lodash');
|
||||
module.exports = require('./dist/lodash.compat.js');
|
||||
41
lodash.min.js
vendored
@@ -1,41 +0,0 @@
|
||||
/*!
|
||||
Lo-Dash 1.0.0-rc.2 lodash.com/license
|
||||
Underscore.js 1.4.3 underscorejs.org/LICENSE
|
||||
*/
|
||||
;(function(e,t){function s(e){if(e&&"object"==typeof e&&e.__wrapped__)return e;if(!(this instanceof s))return new s(e);this.__wrapped__=e}function o(t,n){return e.eval("(function("+t+"){"+n+"})")}function u(e,t,n){t||(t=0);var r=e.length,i=r-t>=(n||it);if(i)for(var s={},n=t-1;++n<r;){var o=e[n]+"";(Tt.call(s,o)?s[o]:s[o]=[]).push(e[n])}return function(n){if(i){var r=n+"";return Tt.call(s,r)&&-1<W(s[r],n)}return-1<W(e,n,t)}}function a(e){return e.charCodeAt(0)}function f(e,t){var n=e.b,r=t.b,e=e.a,
|
||||
t=t.a;if(e!==t){if(e>t||"undefined"==typeof e)return 1;if(e<t||"undefined"==typeof t)return-1}return n<r?-1:1}function l(e,t,n){function i(){var a=arguments,f=o?this:t;return s||(e=t[u]),n.length&&(a=a.length?n.concat(g(a)):n),this instanceof i?(m.prototype=e.prototype,f=new m,m.prototype=r,a=e.apply(f,a),k(a)?a:f):e.apply(f,a)}var s=C(e),o=!n,u=t;return o&&(n=t),s||(t=e),i}function c(e,t){return e?"function"!=typeof e?function(t){return t[e]}:"undefined"!=typeof t?function(n,r,i){return e.call(t
|
||||
,n,r,i)}:e:K}function h(){for(var e={b:"",c:"",e:Kt,f:Jt,g:"",h:Yt,i:en,j:bt,k:"",l:n},t,r=0;t=arguments[r];r++)for(var i in t)e[i]=t[i];t=e.a,e.d=/^[^,]+/.exec(t)[0],r="var i,l="+e.d+",t="+e.d+";if(!"+e.d+")return t;"+e.k+";",e.b?(r+="var m=l.length;i=-1;if(typeof m=='number'){",e.i&&(r+="if(k(l)){l=l.split('')}"),r+="while(++i<m){"+e.b+"}}else {"):e.h&&(r+="var m=l.length;i=-1;if(m&&j(l)){while(++i<m){i+='';"+e.g+"}}else {"),e.e||(r+="var u=typeof l=='function'&&s.call(l,'prototype');");if(e.f&&
|
||||
e.l)r+="var q=-1,r=p[typeof l]?n(l):[],m=r.length;while(++q<m){i=r[q];",e.e||(r+="if(!(u&&i=='prototype')){"),r+=e.g+"",e.e||(r+="}");else{r+="for(i in l){";if(!e.e||e.l)r+="if(",e.e||(r+="!(u&&i=='prototype')"),!e.e&&e.l&&(r+="&&"),e.l&&(r+="h.call(l,i)"),r+="){";r+=e.g+";";if(!e.e||e.l)r+="}"}r+="}";if(e.e){r+="var f=l.constructor;";for(i=0;7>i;i++)r+="i='"+e.j[i]+"';if(","constructor"==e.j[i]&&(r+="!(f&&f.prototype===l)&&"),r+="h.call(l,i)){"+e.g+"}"}if(e.b||e.h)r+="}";return r+=e.c+";return t"
|
||||
,o("e,h,j,k,p,n,s","return function("+t+"){"+r+"}")(c,Tt,b,A,on,_t,Ct)}function p(e){return"\\"+un[e]}function d(e){return dn[e]}function v(e){return"function"!=typeof e.toString&&"string"==typeof (e+"")}function m(){}function g(e,t,n){t||(t=0),"undefined"==typeof n&&(n=e?e.length:0);for(var r=-1,n=n-t||0,i=Array(0>n?0:n);++r<n;)i[r]=e[t+r];return i}function y(e){return vn[e]}function b(e){return kt.call(e)==Bt}function w(e){var t=i;if(!e||"object"!=typeof e||b(e))return t;var n=e.constructor;return!
|
||||
C(n)&&(!tn||!v(e))||n instanceof n?Qt?(hn(e,function(e,n,r){return t=!Tt.call(r,n),i}),t===i):(hn(e,function(e,n){t=n}),t===i||Tt.call(e,t)):t}function E(e){var t=[];return pn(e,function(e,n){t.push(n)}),t}function S(e,t,n,s,o){if(e==r)return e;n&&(t=i);if(n=k(e)){var u=kt.call(e);if(!rn[u]||tn&&v(e))return e;var a=gn(e)}if(!n||!t)return n?a?g(e):cn({},e):e;n=sn[u];switch(u){case Ft:case It:return new n(+e);case qt:case zt:return new n(e);case Ut:return n(e.source,ct.exec(e))}s||(s=[]),o||(o=[]);
|
||||
for(u=s.length;u--;)if(s[u]==e)return o[u];var f=a?n(e.length):{};return s.push(e),o.push(f),(a?wn:pn)(e,function(e,n){f[n]=S(e,t,r,s,o)}),a&&(Tt.call(e,"index")&&(f.index=e.index),Tt.call(e,"input")&&(f.input=e.input)),f}function x(e){var t=[];return hn(e,function(e,n){C(e)&&t.push(n)}),t.sort()}function T(e){var t={};return pn(e,function(e,n){t[e]=n}),t}function N(e,t,s,o){if(e===t)return 0!==e||1/e==1/t;if(e==r||t==r)return e===t;var u=kt.call(e),a=kt.call(t);u==Bt&&(u=Rt),a==Bt&&(a=Rt);if(u!=
|
||||
a)return i;switch(u){case Ft:case It:return+e==+t;case qt:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case Ut:case zt:return e==t+""}a=u==jt;if(!a){if(e.__wrapped__||t.__wrapped__)return N(e.__wrapped__||e,t.__wrapped__||t);if(u!=Rt||tn&&(v(e)||v(t)))return i;var u=Zt&&b(e)?Object:e.constructor,f=Zt&&b(t)?Object:t.constructor;if(u!=f&&(!C(u)||!(u instanceof u&&C(f)&&f instanceof f)))return i}s||(s=[]),o||(o=[]);for(u=s.length;u--;)if(s[u]==e)return o[u]==t;var l=n,c=0;s.push(e),o.push(t);if(a){c=e.length
|
||||
;if(l=c==t.length)for(;c--&&(l=N(e[c],t[c],s,o)););return l}return hn(e,function(e,n,r){if(Tt.call(r,n))return c++,l=Tt.call(t,n)&&N(e,t[n],s,o)}),l&&hn(t,function(e,t,n){if(Tt.call(n,t))return l=-1<--c}),l}function C(e){return"function"==typeof e}function k(e){return e?on[typeof e]:i}function L(e){return"number"==typeof e||kt.call(e)==qt}function A(e){return"string"==typeof e||kt.call(e)==zt}function O(e,t,n){var i=arguments,s=0,o=2,u=i[3],a=i[4];n!==rt&&(u=[],a=[],"number"!=typeof n&&(o=i.length
|
||||
));for(;++s<o;)pn(i[s],function(t,n){var i,s,o;if(t&&((s=gn(t))||yn(t))){for(var f=u.length;f--;)if(i=u[f]==t)break;i?e[n]=a[f]:(u.push(t),a.push(o=(o=e[n],s)?gn(o)?o:[]:yn(o)?o:{}),e[n]=O(o,t,rt,u,a))}else t!=r&&(e[n]=t)});return e}function M(e){var t=[];return pn(e,function(e){t.push(e)}),t}function _(e,t,n){var r=-1,s=e?e.length:0,o=i,n=(0>n?Dt(0,s+n):n)||0;return"number"==typeof s?o=-1<(A(e)?e.indexOf(t,n):W(e,t,n)):wn(e,function(e){if(++r>=n)return!(o=e===t)}),o}function D(e,t,r){var i=n,t=c
|
||||
(t,r);if(gn(e))for(var r=-1,s=e.length;++r<s&&(i=!!t(e[r],r,e)););else wn(e,function(e,n,r){return i=!!t(e,n,r)});return i}function P(e,t,n){var r=[],t=c(t,n);if(gn(e))for(var n=-1,i=e.length;++n<i;){var s=e[n];t(s,n,e)&&r.push(s)}else wn(e,function(e,n,i){t(e,n,i)&&r.push(e)});return r}function H(e,t,n){var r,t=c(t,n);return wn(e,function(e,n,s){if(t(e,n,s))return r=e,i}),r}function B(e,t,n){var r=-1,i=e?e.length:0,s=Array("number"==typeof i?i:0),t=c(t,n);if(gn(e))for(;++r<i;)s[r]=t(e[r],r,e);else wn
|
||||
(e,function(e,n,i){s[++r]=t(e,n,i)});return s}function j(e,t,n){var r=-Infinity,i=-1,s=e?e.length:0,o=r;if(t||!gn(e))t=!t&&A(e)?a:c(t,n),wn(e,function(e,n,i){n=t(e,n,i),n>r&&(r=n,o=e)});else for(;++i<s;)e[i]>o&&(o=e[i]);return o}function F(e,t){return B(e,t+"")}function I(e,t,n,r){var s=3>arguments.length;return t||(t=K),wn(e,function(e,o,u){n=s?(s=i,e):t.call(r,n,e,o,u)}),n}function q(e,t,n,r){var s=e,o=e?e.length:0,u=3>arguments.length;if("number"!=typeof o)var a=bn(e),o=a.length;else en&&A(e)&&
|
||||
(s=e.split(""));return t||(t=K),wn(e,function(e,f,l){f=a?a[--o]:--o,n=u?(u=i,s[f]):t.call(r,n,s[f],f,l)}),n}function R(e,t,n){var r,t=c(t,n);if(gn(e))for(var n=-1,i=e.length;++n<i&&!(r=t(e[n],n,e)););else wn(e,function(e,n,i){return!(r=t(e,n,i))});return!!r}function U(e,t,n){if(e){var i=e.length;return t==r||n?e[0]:g(e,0,Pt(Dt(0,t),i))}}function z(e,t){for(var n=-1,r=e?e.length:0,i=[];++n<r;){var s=e[n];gn(s)?Nt.apply(i,t?s:z(s)):i.push(s)}return i}function W(e,t,n){var r=-1,i=e?e.length:0;if("number"==typeof
|
||||
n)r=(0>n?Dt(0,i+n):n||0)-1;else if(n)return r=V(e,t),e[r]===t?r:-1;for(;++r<i;)if(e[r]===t)return r;return-1}function X(e,t,n){return g(e,t==r||n?1:Dt(0,t))}function V(e,t,n,r){for(var i=0,s=e?e.length:i,n=n?c(n,r):K,t=n(t);i<s;)r=i+s>>>1,n(e[r])<t?i=r+1:s=r;return i}function $(e,t,n,r){var s=-1,o=e?e.length:0,u=[],a=u;"function"==typeof t&&(r=n,n=t,t=i);var f=!t&&74<o;if(f)var l={};n&&(a=[],n=c(n,r));for(;++s<o;){var r=e[s],h=n?n(r,s,e):r;f&&(a=Tt.call(l,h+"")?l[h]:l[h]=[]);if(t?!s||a[a.length-1
|
||||
]!==h:0>W(a,h))(n||f)&&a.push(h),u.push(r)}return u}function J(e,t){return $t||Lt&&2<arguments.length?Lt.call.apply(Lt,arguments):l(e,t,g(arguments,2))}function K(e){return e}function Q(e){wn(x(e),function(t){var n=s[t]=e[t];s.prototype[t]=function(){var e=[this.__wrapped__];return Nt.apply(e,arguments),e=n.apply(s,e),new s(e)}})}function G(){return this.__wrapped__}var n=!0,r=null,i=!1,Y="object"==typeof exports&&exports,Z="object"==typeof global&&global;Z.global===Z&&(e=Z);var et=[],tt=new function(
|
||||
){},nt=0,rt=tt,it=30,st=e._,ot=/[-?+=!~*%&^<>|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/,ut=/&(?:amp|lt|gt|quot|#x27);/g,at=/\b__p\+='';/g,ft=/\b(__p\+=)''\+/g,lt=/(__e\(.*?\)|\b__t\))\+'';/g,ct=/\w*$/,ht=/(?:__e|__t=)\(\s*(?![\d\s"']|this\.)/g,pt=RegExp("^"+(tt.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),dt=/\$\{((?:(?=\\?)\\?[\s\S])*?)}/g,vt=/<%=([\s\S]+?)%>/g,mt=/($^)/,gt=/[&<>"']/g,yt=/['\n\r\t\u2028\u2029\\]/g,bt="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf"
|
||||
.split(" "),wt=Math.ceil,Et=et.concat,St=Math.floor,xt=pt.test(xt=Object.getPrototypeOf)&&xt,Tt=tt.hasOwnProperty,Nt=et.push,Ct=tt.propertyIsEnumerable,kt=tt.toString,Lt=pt.test(Lt=g.bind)&&Lt,At=pt.test(At=Array.isArray)&&At,Ot=e.isFinite,Mt=e.isNaN,_t=pt.test(_t=Object.keys)&&_t,Dt=Math.max,Pt=Math.min,Ht=Math.random,Bt="[object Arguments]",jt="[object Array]",Ft="[object Boolean]",It="[object Date]",qt="[object Number]",Rt="[object Object]",Ut="[object RegExp]",zt="[object String]",Wt=!/1/.test
|
||||
(Function("1")),Xt=!!e.attachEvent,Vt=Lt&&!/\n|true/.test(Lt+Xt),$t=Lt&&!Vt,Jt=_t&&(Xt||Vt),Kt,Qt,Gt=(Gt={0:1,length:1},et.splice.call(Gt,0,1),Gt[0]),Yt=n;(function(){function e(){this.x=1}var t=[];e.prototype={valueOf:1,y:1};for(var n in new e)t.push(n);for(n in arguments)Yt=!n;Kt=!/valueOf/.test(t),Qt="x"!=t[0]})(1);var Zt=!b(arguments),en="xx"!="x"[0]+Object("x")[0];try{var tn=("[object Object]",kt.call(document)==Rt)}catch(nn){}var rn={"[object Function]":i};rn[Bt]=rn[jt]=rn[Ft]=rn[It]=rn[qt]=
|
||||
rn[Rt]=rn[Ut]=rn[zt]=n;var sn={};sn[jt]=Array,sn[Ft]=Boolean,sn[It]=Date,sn[Rt]=Object,sn[qt]=Number,sn[Ut]=RegExp,sn[zt]=String;var on={"boolean":i,"function":n,object:n,number:i,string:i,"undefined":i},un={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};s.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:vt,variable:""};if(Xt||Vt||!Wt)o=Function;var an={a:"o,v,g",k:"for(var a=1,b=typeof g=='number'?2:arguments.length;a<b;a++){if((l=arguments[a])){"
|
||||
,g:"t[i]=l[i]",c:"}}"},fn={a:"d,c,w",k:"c=c&&typeof w=='undefined'?c:e(c,w)",b:"if(c(l[i],i,d)===false)return t",g:"if(c(l[i],i,d)===false)return t"},ln={b:r},cn=h(an);Zt&&(b=function(e){return e?Tt.call(e,"callee"):i});var hn=h(fn,ln,{l:i}),pn=h(fn,ln),dn={"&":"&","<":"<",">":">",'"':""","'":"'"},vn=T(dn),mn=h(an,{g:"if(t[i]==null)"+an.g}),gn=At||function(e){return kt.call(e)==jt};C(/x/)&&(C=function(e){return"[object Function]"==kt.call(e)});var yn=xt?function(e){if(!e||"object"!=typeof
|
||||
e)return i;var t=e.valueOf,n="function"==typeof t&&(n=xt(t))&&xt(n);return n?e==n||xt(e)==n&&!b(e):w(e)}:w,bn=_t?function(e){return"function"==typeof e&&Ct.call(e,"prototype")?E(e):k(e)?_t(e):[]}:E,wn=h(fn);s.assign=cn,s.bindAll=function(e){for(var t=arguments,n=1<t.length?0:(t=x(e),-1),r=t.length;++n<r;){var i=t[n];e[i]=J(e[i],e)}return e},s.chain=function(e){return new s(e)},s.compact=function(e){for(var t=-1,n=e?e.length:0,r=[];++t<n;){var i=e[t];i&&r.push(i)}return r},s.countBy=function(e,t,n
|
||||
){var r={},t=c(t,n);return wn(e,function(e,n,i){n=t(e,n,i),Tt.call(r,n)?r[n]++:r[n]=1}),r},s.defaults=mn,s.difference=function(e){for(var t=-1,n=e?e.length:0,r=Et.apply(et,arguments),r=u(r,n),i=[];++t<n;){var s=e[t];r(s)||i.push(s)}return i},s.filter=P,s.flatten=z,s.forEach=wn,s.forIn=hn,s.forOwn=pn,s.functions=x,s.groupBy=function(e,t,n){var r={},t=c(t,n);return wn(e,function(e,n,i){n=t(e,n,i),(Tt.call(r,n)?r[n]:r[n]=[]).push(e)}),r},s.initial=function(e,t,n){if(!e)return[];var i=e.length;return g
|
||||
(e,0,Pt(Dt(0,i-(t==r||n?1:t||0)),i))},s.intersection=function(e){var t=arguments,n=t.length,r={},i=[];return wn(e,function(e){if(0>W(i,e)){for(var s=n;--s;)if(!(r[s]||(r[s]=u(t[s])))(e))return;i.push(e)}}),i},s.invert=T,s.invoke=function(e,t){var n=g(arguments,2),r="function"==typeof t,i=[];return wn(e,function(e){i.push((r?t:e[t]).apply(e,n))}),i},s.keys=bn,s.map=B,s.max=j,s.merge=O,s.min=function(e,t,n){var r=Infinity,i=-1,s=e?e.length:0,o=r;if(t||!gn(e))t=!t&&A(e)?a:c(t,n),wn(e,function(e,n,i)
|
||||
{n=t(e,n,i),n<r&&(r=n,o=e)});else for(;++i<s;)e[i]<o&&(o=e[i]);return o},s.object=function(e,t){for(var n=-1,r=e?e.length:0,i={};++n<r;){var s=e[n];t?i[s]=t[n]:i[s[0]]=s[1]}return i},s.omit=function(e,t,n){var r="function"==typeof t,i={};if(r)t=c(t,n);else var s=Et.apply(et,arguments);return hn(e,function(e,n,o){if(r?!t(e,n,o):0>W(s,n,1))i[n]=e}),i},s.pairs=function(e){var t=[];return pn(e,function(e,n){t.push([n,e])}),t},s.pick=function(e,t,n){var r={};if("function"!=typeof t)for(var i=0,s=Et.apply
|
||||
(et,arguments),o=s.length;++i<o;){var u=s[i];u in e&&(r[u]=e[u])}else t=c(t,n),hn(e,function(e,n,i){t(e,n,i)&&(r[n]=e)});return r},s.pluck=F,s.range=function(e,t,n){e=+e||0,n=+n||1,t==r&&(t=e,e=0);for(var i=-1,t=Dt(0,wt((t-e)/n)),s=Array(t);++i<t;)s[i]=e,e+=n;return s},s.reject=function(e,t,n){return t=c(t,n),P(e,function(e,n,r){return!t(e,n,r)})},s.rest=X,s.shuffle=function(e){var t=-1,n=Array(e?e.length:0);return wn(e,function(e){var r=St(Ht()*(++t+1));n[t]=n[r],n[r]=e}),n},s.sortBy=function(e,
|
||||
t,n){var r=[],t=c(t,n);wn(e,function(e,n,i){r.push({a:t(e,n,i),b:n,c:e})}),e=r.length;for(r.sort(f);e--;)r[e]=r[e].c;return r},s.tap=function(e,t){return t(e),e},s.times=function(e,t,n){for(var e=+e||0,r=-1,i=Array(e);++r<e;)i[r]=t.call(n,r);return i},s.toArray=function(e){return"number"==typeof (e?e.length:0)?en&&A(e)?e.split(""):g(e):M(e)},s.union=function(){return $(Et.apply(et,arguments))},s.uniq=$,s.values=M,s.where=function(e,t){var n=bn(t);return P(e,function(e){for(var r=n.length;r--;){var i=
|
||||
e[n[r]]===t[n[r]];if(!i)break}return!!i})},s.without=function(e){for(var t=-1,n=e?e.length:0,r=u(arguments,1,20),i=[];++t<n;){var s=e[t];r(s)||i.push(s)}return i},s.zip=function(e){for(var t=-1,n=e?j(F(arguments,"length")):0,r=Array(n);++t<n;)r[t]=F(arguments,t);return r},s.collect=B,s.drop=X,s.each=wn,s.extend=cn,s.methods=x,s.select=P,s.tail=X,s.unique=$,Q(s),s.after=function(e,t){return 1>e?t():function(){if(1>--e)return t.apply(this,arguments)}},s.bind=J,s.bindKey=function(e,t){return l(e,t,g
|
||||
(arguments,2))},s.clone=S,s.compose=function(){var e=arguments;return function(){for(var t=arguments,n=e.length;n--;)t=[e[n].apply(this,t)];return t[0]}},s.contains=_,s.debounce=function(e,t,n){function i(){a=r,n||(o=e.apply(u,s))}var s,o,u,a;return function(){var r=n&&!a;return s=arguments,u=this,clearTimeout(a),a=setTimeout(i,t),r&&(o=e.apply(u,s)),o}},s.defer=function(e){var n=g(arguments,1);return setTimeout(function(){e.apply(t,n)},1)},s.delay=function(e,n){var r=g(arguments,2);return setTimeout
|
||||
(function(){e.apply(t,r)},n)},s.escape=function(e){return e==r?"":(e+"").replace(gt,d)},s.every=D,s.find=H,s.has=function(e,t){return e?Tt.call(e,t):i},s.identity=K,s.indexOf=W,s.isArguments=b,s.isArray=gn,s.isBoolean=function(e){return e===n||e===i||kt.call(e)==Ft},s.isDate=function(e){return kt.call(e)==It},s.isElement=function(e){return e?1===e.nodeType:i},s.isEmpty=function(e){var t=n;if(!e)return t;var r=kt.call(e),s=e.length;return r==jt||r==zt||r==Bt||Zt&&b(e)||r==Rt&&"number"==typeof s&&C
|
||||
(e.splice)?!s:(pn(e,function(){return t=i}),t)},s.isEqual=N,s.isFinite=function(e){return Ot(e)&&!Mt(parseFloat(e))},s.isFunction=C,s.isNaN=function(e){return L(e)&&e!=+e},s.isNull=function(e){return e===r},s.isNumber=L,s.isObject=k,s.isPlainObject=yn,s.isRegExp=function(e){return kt.call(e)==Ut},s.isString=A,s.isUndefined=function(e){return"undefined"==typeof e},s.lastIndexOf=function(e,t,n){var r=e?e.length:0;for("number"==typeof n&&(r=(0>n?Dt(0,r+n):Pt(n,r-1))+1);r--;)if(e[r]===t)return r;return-1
|
||||
},s.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return Tt.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},s.mixin=Q,s.noConflict=function(){return e._=st,this},s.once=function(e){var t,s=i;return function(){return s?t:(s=n,t=e.apply(this,arguments),e=r,t)}},s.partial=function(e){return l(e,g(arguments,1))},s.random=function(e,t){return e==r&&t==r&&(t=1),e=+e||0,t==r&&(t=e,e=0),e+St(Ht()*((+t||0)-e+1))},s.reduce=I,s.reduceRight=q,s.result=function(e,
|
||||
t){var n=e?e[t]:r;return C(n)?e[t]():n},s.size=function(e){var t=e?e.length:0;return"number"==typeof t?t:bn(e).length},s.some=R,s.sortedIndex=V,s.template=function(e,t,n){e||(e=""),n||(n={});var r,i,u=s.templateSettings,a=0,f=n.interpolate||u.interpolate||mt,l="__p+='",c=n.variable||u.variable,h=c;e.replace(RegExp((n.escape||u.escape||mt).source+"|"+f.source+"|"+(f===vt?dt:mt).source+"|"+(n.evaluate||u.evaluate||mt).source+"|$","g"),function(t,n,i,s,o,u){return i||(i=s),l+=e.slice(a,u).replace(yt
|
||||
,p),n&&(l+="'+__e("+n+")+'"),o&&(l+="';"+o+";__p+='"),i&&(l+="'+((__t=("+i+"))==null?'':__t)+'"),r||(r=o||ot.test(n||i)),a=u+t.length,t}),l+="';\n",h||(c="obj",r?l="with("+c+"){"+l+"}":(n=RegExp("(\\(\\s*)"+c+"\\."+c+"\\b","g"),l=l.replace(ht,"$&"+c+".").replace(n,"$1__d"))),l=(r?l.replace(at,""):l).replace(ft,"$1").replace(lt,"$1;"),l="function("+c+"){"+(h?"":c+"||("+c+"={});")+"var __t,__p='',__e=_.escape"+(r?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(h?"":",__d="+
|
||||
c+"."+c+"||"+c)+";")+l+"return __p}";try{i=o("_","return "+l)(s)}catch(d){throw d.source=l,d}return t?i(t):(i.source=l,i)},s.throttle=function(e,t){function n(){a=new Date,u=r,s=e.apply(o,i)}var i,s,o,u,a=0;return function(){var f=new Date,l=t-(f-a);return i=arguments,o=this,0>=l?(clearTimeout(u),u=r,a=f,s=e.apply(o,i)):u||(u=setTimeout(n,l)),s}},s.unescape=function(e){return e==r?"":(e+"").replace(ut,y)},s.uniqueId=function(e){return(e==r?"":e+"")+ ++nt},s.wrap=function(e,t){return function(){var n=
|
||||
[e];return Nt.apply(n,arguments),t.apply(this,n)}},s.all=D,s.any=R,s.detect=H,s.foldl=I,s.foldr=q,s.include=_,s.inject=I,pn(s,function(e,t){s.prototype[t]||(s.prototype[t]=function(){var t=[this.__wrapped__];return Nt.apply(t,arguments),e.apply(s,t)})}),s.first=U,s.last=function(e,t,n){if(e){var i=e.length;return t==r||n?e[i-1]:g(e,Dt(0,i-t))}},s.take=U,s.head=U,pn(s,function(e,t){s.prototype[t]||(s.prototype[t]=function(t,n){var i=e(this.__wrapped__,t,n);return t==r||n?i:new s(i)})}),s.VERSION="1.0.0-rc.2"
|
||||
,s.prototype.chain=function(){return this},s.prototype.toString=function(){return""+this.__wrapped__},s.prototype.value=G,s.prototype.valueOf=G,wn("pop push reverse shift sort splice unshift".split(" "),function(e){var t=et[e];s.prototype[e]=function(){var e=this.__wrapped__;return t.apply(e,arguments),Gt&&e.length===0&&delete e[0],this}}),wn(["concat","join","slice"],function(e){var t=et[e];s.prototype[e]=function(){var e=t.apply(this.__wrapped__,arguments);return new s(e)}}),typeof define=="function"&&typeof
|
||||
define.amd=="object"&&define.amd?(e._=s,define(function(){return s})):Y?"object"==typeof module&&module&&module.exports==Y?(module.exports=s)._=s:Y._=s:e._=s})(this);
|
||||
33
lodash.underscore.min.js
vendored
@@ -1,33 +0,0 @@
|
||||
/*!
|
||||
Lo-Dash 1.0.0-rc.2 (Custom Build) lodash.com/license
|
||||
Build: `lodash underscore -m -o ./lodash.underscore.min.js`
|
||||
Underscore.js 1.4.3 underscorejs.org/LICENSE
|
||||
*/
|
||||
;(function(e,t){function n(e){if(e&&"object"==typeof e&&e.__wrapped__)return e;if(!(this instanceof n))return new n(e);this.__wrapped__=e}function r(e,t){var n=e.b,r=t.b,e=e.a,t=t.a;if(e!==t){if(e>t||"undefined"==typeof e)return 1;if(e<t||"undefined"==typeof t)return-1}return n<r?-1:1}function i(e,t,n){function r(){var i=arguments,s=t;return n.length&&(i=i.length?n.concat(f(i)):n),this instanceof r?(a.prototype=e.prototype,s=new a,a.prototype=null,i=e.apply(s,i),y(i)?i:s):e.apply(s,i)}return r}function s
|
||||
(e,t){return e?"function"!=typeof e?function(t){return t[e]}:"undefined"!=typeof t?function(n,r,i){return e.call(t,n,r,i)}:e:I}function o(e){return"\\"+St[e]}function u(e){return Nt[e]}function a(){}function f(e,t,n){t||(t=0),"undefined"==typeof n&&(n=e?e.length:0);for(var r=-1,n=n-t||0,i=Array(0>n?0:n);++r<n;)i[r]=e[t+r];return i}function l(e){return Ct[e]}function c(e){if(!e)return e;for(var t=1,n=arguments.length;t<n;t++){var r=arguments[t];if(r)for(var i in r)e[i]=r[i]}return e}function h(e){
|
||||
var t=[];return Tt(e,function(e,n){t.push(n)}),t}function p(e){if(!e)return e;for(var t=1,n=arguments.length;t<n;t++){var r=arguments[t];if(r)for(var i in r)null==e[i]&&(e[i]=r[i])}return e}function d(e){var t=[];return xt(e,function(e,n){g(e)&&t.push(n)}),t.sort()}function v(e){var t={};return Tt(e,function(e,n){t[e]=n}),t}function m(e,t,n,r){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return e===t;var i=rt.call(e),s=rt.call(t);if(i!=s)return!1;switch(i){case pt:case dt:return+e==+t;case vt
|
||||
:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case gt:case yt:return e==t+""}s=i==ht;if(!s){if(e.__wrapped__||t.__wrapped__)return m(e.__wrapped__||e,t.__wrapped__||t);if(i!=mt)return!1;var i=e.constructor,o=t.constructor;if(i!=o&&(!g(i)||!(i instanceof i&&g(o)&&o instanceof o)))return!1}n||(n=[]),r||(r=[]);for(i=n.length;i--;)if(n[i]==e)return r[i]==t;var u=!0,a=0;n.push(e),r.push(t);if(s){a=e.length;if(u=a==t.length)for(;a--&&(u=m(e[a],t[a],n,r)););return u}return xt(e,function(e,i,s){if(tt.call(s,i)
|
||||
)return a++,!(u=tt.call(t,i)&&m(e,t[i],n,r))&&X}),u&&xt(t,function(e,t,n){if(tt.call(n,t))return!(u=-1<--a)&&X}),u}function g(e){return"function"==typeof e}function y(e){return e?Et[typeof e]:!1}function b(e){return"number"==typeof e||rt.call(e)==vt}function w(e){return"string"==typeof e||rt.call(e)==yt}function E(e){var t=[];return Tt(e,function(e){t.push(e)}),t}function S(e,t){var n=!1;return"number"==typeof (e?e.length:0)?n=-1<P(e,t):At(e,function(e){return(n=e===t)&&X}),n}function x(e,t,n){var r=!0
|
||||
,t=s(t,n);if(kt(e))for(var n=-1,i=e.length;++n<i&&(r=!!t(e[n],n,e)););else At(e,function(e,n,i){return!(r=!!t(e,n,i))&&X});return r}function T(e,t,n){var r=[],t=s(t,n);if(kt(e))for(var n=-1,i=e.length;++n<i;){var o=e[n];t(o,n,e)&&r.push(o)}else At(e,function(e,n,i){t(e,n,i)&&r.push(e)});return r}function N(e,t,n){var r,t=s(t,n);return At(e,function(e,n,i){if(t(e,n,i))return r=e,X}),r}function C(e,t,n){var r=-1,i=e?e.length:0,o=Array("number"==typeof i?i:0),t=s(t,n);if(kt(e))for(;++r<i;)o[r]=t(e[r
|
||||
],r,e);else At(e,function(e,n,i){o[++r]=t(e,n,i)});return o}function k(e,t,n){var r=-Infinity,i=-1,o=e?e.length:0,u=r;if(t||!kt(e))t=s(t,n),At(e,function(e,n,i){n=t(e,n,i),n>r&&(r=n,u=e)});else for(;++i<o;)e[i]>u&&(u=e[i]);return u}function L(e,t){return C(e,t+"")}function A(e,t,n,r){var i=3>arguments.length;return t||(t=I),At(e,function(e,s,o){n=i?(i=!1,e):t.call(r,n,e,s,o)}),n}function O(e,t,n,r){var i=e?e.length:0,s=3>arguments.length;if("number"!=typeof i)var o=Lt(e),i=o.length;return t||(t=I
|
||||
),At(e,function(u,a,f){a=o?o[--i]:--i,n=s?(s=!1,e[a]):t.call(r,n,e[a],a,f)}),n}function M(e,t,n){var r,t=s(t,n);if(kt(e))for(var n=-1,i=e.length;++n<i&&!(r=t(e[n],n,e)););else At(e,function(e,n,i){return(r=t(e,n,i))&&X});return!!r}function _(e,t,n){if(e){var r=e.length;return null==t||n?e[0]:f(e,0,lt(ft(0,t),r))}}function D(e,t){for(var n=-1,r=e?e.length:0,i=[];++n<r;){var s=e[n];kt(s)?nt.apply(i,t?s:D(s)):i.push(s)}return i}function P(e,t,n){var r=-1,i=e?e.length:0;if("number"==typeof n)r=(0>n?ft
|
||||
(0,i+n):n||0)-1;else if(n)return r=B(e,t),e[r]===t?r:-1;for(;++r<i;)if(e[r]===t)return r;return-1}function H(e,t,n){return f(e,null==t||n?1:ft(0,t))}function B(e,t,n,r){for(var i=0,o=e?e.length:i,n=n?s(n,r):I,t=n(t);i<o;)r=i+o>>>1,n(e[r])<t?i=r+1:o=r;return i}function j(e,t,n,r){var i=-1,o=e?e.length:0,u=[],a=u;"function"==typeof t&&(r=n,n=t,t=!1),n&&(a=[],n=s(n,r));for(;++i<o;){var r=e[i],f=n?n(r,i,e):r;if(t?!i||a[a.length-1]!==f:0>P(a,f))n&&a.push(f),u.push(r)}return u}function F(e,t){return bt||
|
||||
it&&2<arguments.length?it.call.apply(it,arguments):i(e,t,f(arguments,2))}function I(e){return e}function q(e){At(d(e),function(t){var r=n[t]=e[t];n.prototype[t]=function(){var e=[this.__wrapped__];return nt.apply(e,arguments),e=r.apply(n,e),this.__chain__&&(e=new n(e),e.__chain__=!0),e}})}var R="object"==typeof exports&&exports,U="object"==typeof global&&global;U.global===U&&(e=U);var z=[],U=new function(){},W=0,X=U,V=e._,$=/&(?:amp|lt|gt|quot|#x27);/g,J=RegExp("^"+(U.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g
|
||||
,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),K=/($^)/,Q=/[&<>"']/g,G=/['\n\r\t\u2028\u2029\\]/g,Y=Math.ceil,Z=z.concat,et=Math.floor,tt=U.hasOwnProperty,nt=z.push,rt=U.toString,it=J.test(it=f.bind)&&it,st=J.test(st=Array.isArray)&&st,ot=e.isFinite,ut=e.isNaN,at=J.test(at=Object.keys)&&at,ft=Math.max,lt=Math.min,ct=Math.random,ht="[object Array]",pt="[object Boolean]",dt="[object Date]",vt="[object Number]",mt="[object Object]",gt="[object RegExp]",yt="[object String]",U=!!e.attachEvent,U=it&&!/\n|true/
|
||||
.test(it+U),bt=it&&!U,wt=(wt={0:1,length:1},z.splice.call(wt,0,1),wt[0]),Et={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,"undefined":!1},St={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};n.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},n.isArguments=function(e){return"[object Arguments]"==rt.call(e)},n.isArguments(arguments)||(n.isArguments=function(e){return e?tt.call(e,"callee"):!1}
|
||||
);var xt=function(e,t){var n;if(!e)return e;t||(t=I);for(n in e)if(t(e[n],n,e)===X)break;return e},Tt=function(e,t){var n;if(!e)return e;t||(t=I);for(n in e)if(tt.call(e,n)&&t(e[n],n,e)===X)break;return e},Nt={"&":"&","<":"<",">":">",'"':""","'":"'"},Ct=v(Nt),kt=st||function(e){return rt.call(e)==ht};g(/x/)&&(g=function(e){return"[object Function]"==rt.call(e)});var Lt=at?function(e){return y(e)?at(e):[]}:h,At=function(e,t,n){if(!e)return e;var t=t&&"undefined"==typeof n?t:s(t
|
||||
,n),r=e.length,n=-1;if("number"==typeof r){for(;++n<r;)if(t(e[n],n,e)===X)return e}else for(n in e)if(tt.call(e,n)&&t(e[n],n,e)===X)return e};n.bindAll=function(e){for(var t=arguments,n=1<t.length?0:(t=d(e),-1),r=t.length;++n<r;){var i=t[n];e[i]=F(e[i],e)}return e},n.chain=function(e){return e=new n(e),e.__chain__=!0,e},n.compact=function(e){for(var t=-1,n=e?e.length:0,r=[];++t<n;){var i=e[t];i&&r.push(i)}return r},n.countBy=function(e,t,n){var r={},t=s(t,n);return At(e,function(e,n,i){n=t(e,n,i)
|
||||
,tt.call(r,n)?r[n]++:r[n]=1}),r},n.defaults=p,n.difference=function(e){for(var t=-1,n=e.length,r=Z.apply(z,arguments),i=[];++t<n;){var s=e[t];0>P(r,s,n)&&i.push(s)}return i},n.filter=T,n.flatten=D,n.forEach=At,n.functions=d,n.groupBy=function(e,t,n){var r={},t=s(t,n);return At(e,function(e,n,i){n=t(e,n,i),(tt.call(r,n)?r[n]:r[n]=[]).push(e)}),r},n.initial=function(e,t,n){if(!e)return[];var r=e.length;return f(e,0,lt(ft(0,r-(null==t||n?1:t||0)),r))},n.intersection=function(e){var t=arguments,n=t.length
|
||||
,r=[];return At(e,function(e){if(0>P(r,e)){for(var i=n;--i;)if(0>P(t[i],e))return;r.push(e)}}),r},n.invert=v,n.invoke=function(e,t){var n=f(arguments,2),r="function"==typeof t,i=[];return At(e,function(e){i.push((r?t:e[t]).apply(e,n))}),i},n.keys=Lt,n.map=C,n.max=k,n.min=function(e,t,n){var r=Infinity,i=-1,o=e?e.length:0,u=r;if(t||!kt(e))t=s(t,n),At(e,function(e,n,i){n=t(e,n,i),n<r&&(r=n,u=e)});else for(;++i<o;)e[i]<u&&(u=e[i]);return u},n.object=function(e,t){for(var n=-1,r=e?e.length:0,i={};++n<
|
||||
r;){var s=e[n];t?i[s]=t[n]:i[s[0]]=s[1]}return i},n.omit=function(e){var t=Z.apply(z,arguments),n={};return xt(e,function(e,r){0>P(t,r,1)&&(n[r]=e)}),n},n.pairs=function(e){var t=[];return Tt(e,function(e,n){t.push([n,e])}),t},n.pick=function(e){for(var t=0,n=Z.apply(z,arguments),r=n.length,i={};++t<r;){var s=n[t];s in e&&(i[s]=e[s])}return i},n.pluck=L,n.range=function(e,t,n){e=+e||0,n=+n||1,null==t&&(t=e,e=0);for(var r=-1,t=ft(0,Y((t-e)/n)),i=Array(t);++r<t;)i[r]=e,e+=n;return i},n.reject=function(
|
||||
e,t,n){return t=s(t,n),T(e,function(e,n,r){return!t(e,n,r)})},n.rest=H,n.shuffle=function(e){var t=-1,n=Array(e?e.length:0);return At(e,function(e){var r=et(ct()*(++t+1));n[t]=n[r],n[r]=e}),n},n.sortBy=function(e,t,n){var i=[],t=s(t,n);At(e,function(e,n,r){i.push({a:t(e,n,r),b:n,c:e})}),e=i.length;for(i.sort(r);e--;)i[e]=i[e].c;return i},n.tap=function(e,t){return t(e),e},n.times=function(e,t,n){for(var e=+e||0,r=-1,i=Array(e);++r<e;)i[r]=t.call(n,r);return i},n.toArray=function(e){return"number"==typeof
|
||||
(e?e.length:0)?f(e):E(e)},n.union=function(){return j(Z.apply(z,arguments))},n.uniq=j,n.values=E,n.where=function(e,t){var n=Lt(t);return T(e,function(e){for(var r=n.length;r--;){var i=e[n[r]]===t[n[r]];if(!i)break}return!!i})},n.without=function(e){for(var t=-1,n=e.length,r=[];++t<n;){var i=e[t];0>P(arguments,i,1)&&r.push(i)}return r},n.zip=function(e){for(var t=-1,n=e?k(L(arguments,"length")):0,r=Array(n);++t<n;)r[t]=L(arguments,t);return r},n.collect=C,n.drop=H,n.each=At,n.extend=c,n.methods=d
|
||||
,n.select=T,n.tail=H,n.unique=j,n.after=function(e,t){return 1>e?t():function(){if(1>--e)return t.apply(this,arguments)}},n.bind=F,n.clone=function(e){return e&&Et[typeof e]?kt(e)?f(e):c({},e):e},n.compose=function(){var e=arguments;return function(){for(var t=arguments,n=e.length;n--;)t=[e[n].apply(this,t)];return t[0]}},n.contains=S,n.debounce=function(e,t,n){function r(){u=null,n||(s=e.apply(o,i))}var i,s,o,u;return function(){var a=n&&!u;return i=arguments,o=this,clearTimeout(u),u=setTimeout(
|
||||
r,t),a&&(s=e.apply(o,i)),s}},n.defer=function(e){var n=f(arguments,1);return setTimeout(function(){e.apply(t,n)},1)},n.delay=function(e,n){var r=f(arguments,2);return setTimeout(function(){e.apply(t,r)},n)},n.escape=function(e){return null==e?"":(e+"").replace(Q,u)},n.every=x,n.find=N,n.has=function(e,t){return e?tt.call(e,t):!1},n.identity=I,n.indexOf=P,n.isArray=kt,n.isBoolean=function(e){return!0===e||!1===e||rt.call(e)==pt},n.isDate=function(e){return rt.call(e)==dt},n.isElement=function(e){return e?1===
|
||||
e.nodeType:!1},n.isEmpty=function(e){if(!e)return!0;if(kt(e)||w(e))return!e.length;for(var t in e)if(tt.call(e,t))return!1;return!0},n.isEqual=m,n.isFinite=function(e){return ot(e)&&!ut(parseFloat(e))},n.isFunction=g,n.isNaN=function(e){return b(e)&&e!=+e},n.isNull=function(e){return null===e},n.isNumber=b,n.isObject=y,n.isRegExp=function(e){return rt.call(e)==gt},n.isString=w,n.isUndefined=function(e){return"undefined"==typeof e},n.lastIndexOf=function(e,t,n){var r=e?e.length:0;for("number"==typeof
|
||||
n&&(r=(0>n?ft(0,r+n):lt(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},n.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return tt.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},n.mixin=q,n.noConflict=function(){return e._=V,this},n.once=function(e){var t,n=!1;return function(){return n?t:(n=!0,t=e.apply(this,arguments),e=null,t)}},n.random=function(e,t){return null==e&&null==t&&(t=1),e=+e||0,null==t&&(t=e,e=0),e+et(ct()*((+t||0)-e+1))},n.reduce=A,n.reduceRight=
|
||||
O,n.result=function(e,t){var n=e?e[t]:null;return g(n)?e[t]():n},n.size=function(e){var t=e?e.length:0;return"number"==typeof t?t:Lt(e).length},n.some=M,n.sortedIndex=B,n.template=function(e,t,r){e||(e="");var r=p({},r,n.templateSettings),i=0,s="__p+='",u=r.variable;e.replace(RegExp((r.escape||K).source+"|"+(r.interpolate||K).source+"|"+(r.evaluate||K).source+"|$","g"),function(t,n,r,u,a){s+=e.slice(i,a).replace(G,o),s+=n?"'+_['escape']("+n+")+'":u?"';"+u+";__p+='":r?"'+((__t=("+r+"))==null?'':__t)+'"
|
||||
:"",i=a+t.length}),s+="';\n",u||(u="obj",s="with("+u+"||{}){"+s+"}"),s="function("+u+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+s+"return __p}";try{var a=Function("_","return "+s)(n)}catch(f){throw f.source=s,f}return t?a(t):(a.source=s,a)},n.throttle=function(e,t){function n(){u=new Date,o=null,i=e.apply(s,r)}var r,i,s,o,u=0;return function(){var a=new Date,f=t-(a-u);return r=arguments,s=this,0>=f?(clearTimeout(o),o=null,u=a,i=e.apply(s,r)):o||(o=setTimeout
|
||||
(n,f)),i}},n.unescape=function(e){return null==e?"":(e+"").replace($,l)},n.uniqueId=function(e){var t=++W+"";return e?e+t:t},n.wrap=function(e,t){return function(){var n=[e];return nt.apply(n,arguments),t.apply(this,n)}},n.all=x,n.any=M,n.detect=N,n.foldl=A,n.foldr=O,n.include=S,n.inject=A,n.first=_,n.last=function(e,t,n){if(e){var r=e.length;return null==t||n?e[r-1]:f(e,ft(0,r-t))}},n.take=_,n.head=_,n.VERSION="1.0.0-rc.2",q(n),n.prototype.chain=function(){return this.__chain__=!0,this},n.prototype
|
||||
.value=function(){return this.__wrapped__},At("pop push reverse shift sort splice unshift".split(" "),function(e){var t=z[e];n.prototype[e]=function(){var e=this.__wrapped__;return t.apply(e,arguments),wt&&e.length===0&&delete e[0],this}}),At(["concat","join","slice"],function(e){var t=z[e];n.prototype[e]=function(){var e=t.apply(this.__wrapped__,arguments);return this.__chain__&&(e=new n(e),e.__chain__=!0),e}}),R?"object"==typeof module&&module&&module.exports==R?(module.exports=n)._=n:R._=n:e._=
|
||||
n})(this);
|
||||
47
package.json
@@ -1,9 +1,10 @@
|
||||
{
|
||||
"name": "lodash",
|
||||
"version": "1.0.0-rc.2",
|
||||
"description": "A utility library, usable as a drop-in replacement for Underscore, delivering performance, bug fixes, and additional features.",
|
||||
"homepage": "http://lodash.com",
|
||||
"main": "./lodash",
|
||||
"version": "1.3.0",
|
||||
"description": "A low-level utility library delivering consistency, customization, performance, and extra features.",
|
||||
"homepage": "http://lodash.com/",
|
||||
"license": "MIT",
|
||||
"main": "./dist/lodash.js",
|
||||
"keywords": [
|
||||
"browser",
|
||||
"client",
|
||||
@@ -13,12 +14,6 @@
|
||||
"speed",
|
||||
"util"
|
||||
],
|
||||
"licenses": [
|
||||
{
|
||||
"type": "MIT",
|
||||
"url": "http://lodash.com/license"
|
||||
}
|
||||
],
|
||||
"author": {
|
||||
"name": "John-David Dalton",
|
||||
"email": "john.david.dalton@gmail.com",
|
||||
@@ -34,20 +29,34 @@
|
||||
"bin": {
|
||||
"lodash": "./build.js"
|
||||
},
|
||||
"directories": {
|
||||
"doc": "./doc",
|
||||
"test": "./test"
|
||||
},
|
||||
"engines": [
|
||||
"node",
|
||||
"rhino"
|
||||
],
|
||||
"jam": {
|
||||
"main": "./lodash.js"
|
||||
"main": "./dist/lodash.compat.js"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "node build",
|
||||
"test": "node test/test && node test/test-build",
|
||||
"install": "node build/post-install"
|
||||
"volo": {
|
||||
"type": "directory",
|
||||
"ignore": [
|
||||
".*",
|
||||
"*.custom.*",
|
||||
"*.template.*",
|
||||
"*.d.ts",
|
||||
"*.map",
|
||||
"*.md",
|
||||
"*.txt",
|
||||
"build.js",
|
||||
"lodash.js",
|
||||
"index.js",
|
||||
"bower.json",
|
||||
"component.json",
|
||||
"build",
|
||||
"doc",
|
||||
"node_modules",
|
||||
"perf",
|
||||
"test",
|
||||
"vendor"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,17 +29,18 @@
|
||||
<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>');
|
||||
document.write('<script src="' + ui.buildPath + '"><\/script>');
|
||||
</script>
|
||||
<script>
|
||||
var lodash = _.noConflict();
|
||||
</script>
|
||||
<script>
|
||||
document.write('<script src="../' + ui.otherPath + '"><\/script>');
|
||||
document.write('<script src="' + ui.otherPath + '"><\/script>');
|
||||
</script>
|
||||
<script src="perf.js"></script>
|
||||
<script>
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
;(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];
|
||||
|
||||
@@ -33,24 +36,38 @@
|
||||
|
||||
// expose Lo-Dash build file path
|
||||
ui.buildPath = (function() {
|
||||
var result;
|
||||
switch (build) {
|
||||
case 'lodash-dev': return 'lodash.js';
|
||||
case 'lodash-underscore': return 'lodash.underscore.min.js';
|
||||
case 'lodash-custom': return 'lodash.custom.min.js';
|
||||
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 'lodash.min.js';
|
||||
return result == build ? result : (basePath + result);
|
||||
}());
|
||||
|
||||
// expose other library file path
|
||||
ui.otherPath = (function() {
|
||||
var result;
|
||||
switch (other) {
|
||||
case 'lodash-dev': return 'lodash.js';
|
||||
case 'lodash-prod': return 'lodash.min.js';
|
||||
case 'lodash-underscore': return 'lodash.underscore.min.js';
|
||||
case 'lodash-custom': return 'lodash.custom.min.js';
|
||||
case 'underscore-dev': return 'vendor/underscore/underscore.js';
|
||||
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 'vendor/underscore/underscore-min.js';
|
||||
return result == other ? result : (basePath + result);
|
||||
}());
|
||||
|
||||
// initialize controls
|
||||
@@ -74,10 +91,13 @@
|
||||
span1.innerHTML =
|
||||
'<label for="perf-build">Build: </label>' +
|
||||
'<select id="perf-build">' +
|
||||
'<option value="lodash-dev">Lo-Dash</option>' +
|
||||
'<option value="lodash-prod">Lo-Dash (minified)</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">Lo-Dash (custom)</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');
|
||||
@@ -85,12 +105,15 @@
|
||||
span2.innerHTML =
|
||||
'<label for="perf-other">Other Library: </label>' +
|
||||
'<select id="perf-other">' +
|
||||
'<option value="underscore-dev">Underscore</option>' +
|
||||
'<option value="underscore-prod">Underscore (minified)</option>' +
|
||||
'<option value="lodash-dev">Lo-Dash</option>' +
|
||||
'<option value="lodash-prod">Lo-Dash (minified)</option>' +
|
||||
'<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">Lo-Dash (custom)</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,
|
||||
@@ -102,22 +125,32 @@
|
||||
|
||||
buildList.selectedIndex = (function() {
|
||||
switch (build) {
|
||||
case 'lodash-dev': return 0;
|
||||
case 'lodash-underscore': return 2;
|
||||
case 'lodash-custom': return 3;
|
||||
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;
|
||||
return -1;
|
||||
}());
|
||||
|
||||
otherList.selectedIndex = (function() {
|
||||
switch (other) {
|
||||
case 'underscore-dev': return 0;
|
||||
case 'lodash-dev': return 2;
|
||||
case 'lodash-prod': return 3;
|
||||
case 'lodash-underscore': return 4;
|
||||
case 'lodash-custom': return 5;
|
||||
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;
|
||||
return -1;
|
||||
}());
|
||||
|
||||
addListener(buildList, 'change', eventHandler);
|
||||
|
||||
848
perf/perf.js
@@ -1,9 +1,14 @@
|
||||
cd "$(dirname "$0")"
|
||||
for cmd in node narwhal ringo rhino; do
|
||||
echo ""
|
||||
echo "Running performance suite in $cmd..."
|
||||
$cmd perf.js
|
||||
|
||||
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
|
||||
open index.html
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<div id="qunit"></div>
|
||||
<h1 id="qunit-header"><a href="#">Backbone Speed Suite</a></h1>
|
||||
<h1 id="qunit-header"></h1>
|
||||
<div id="qunit-fixture">
|
||||
<div id='testElement'>
|
||||
<h1>Test</h1>
|
||||
@@ -21,17 +21,19 @@
|
||||
<script src="../vendor/json3/lib/json3.js"></script>
|
||||
<script src="../vendor/jquery/jquery.js"></script>
|
||||
<script src="../vendor/platform.js/platform.js"></script>
|
||||
<script>
|
||||
// avoid syntax errors for `QUnit.throws` in older Firefoxes
|
||||
document.write(platform.name == 'Firefox' && /^1\b/.test(platform.version)
|
||||
? '<script src="../vendor/qunit/qunit/qunit-1.8.0.js"><\/script>'
|
||||
: '<script src="../vendor/qunit/qunit/qunit.js"><\/script>'
|
||||
);
|
||||
</script>
|
||||
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
||||
<script src="test-ui.js"></script>
|
||||
<script src="../lodash.js"></script>
|
||||
<script>
|
||||
var lodash = _.noConflict();
|
||||
document.write('<script src="../' + ui.buildPath + '"><\/script>');
|
||||
</script>
|
||||
<script>
|
||||
_.mixin({
|
||||
'debounce': lodash.debounce,
|
||||
'defer': lodash.defer
|
||||
});
|
||||
</script>
|
||||
<script src="../vendor/backbone/backbone.js"></script>
|
||||
<script src="../vendor/backbone/test/environment.js"></script>
|
||||
<script src="../vendor/backbone/test/noconflict.js"></script>
|
||||
|
||||
@@ -4,18 +4,18 @@
|
||||
<meta charset="utf-8">
|
||||
<title>Lo-Dash Test Suite</title>
|
||||
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css">
|
||||
<style>
|
||||
#exports {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="qunit"></div>
|
||||
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
||||
<script src="../vendor/platform.js/platform.js"></script>
|
||||
<script>
|
||||
// avoid syntax errors for `QUnit.throws` in older Firefoxes
|
||||
document.write(platform.name == 'Firefox' && /^1\b/.test(platform.version)
|
||||
? '<script src="../vendor/qunit/qunit/qunit-1.8.0.js"><\/script>'
|
||||
: '<script src="../vendor/qunit/qunit/qunit.js"><\/script>'
|
||||
);
|
||||
</script>
|
||||
<script src="test-ui.js"></script>
|
||||
<div id="qunit"></div>
|
||||
<div id="exports"></div>
|
||||
<script>
|
||||
// set a bad shim
|
||||
Object._keys = Object.keys;
|
||||
|
||||
10
test/run-test.sh
Executable file → Normal file
@@ -1,10 +1,14 @@
|
||||
cd "$(dirname "$0")"
|
||||
for cmd in rhino ringo narwhal node; do
|
||||
echo ""
|
||||
|
||||
for cmd in rhino "rhino -require" narwhal ringo phantomjs; do
|
||||
echo "Testing in $cmd..."
|
||||
$cmd test.js
|
||||
$cmd test.js ../dist/lodash.compat.js && $cmd test.js ../dist/lodash.compat.min.js
|
||||
echo ""
|
||||
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
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<ul>
|
||||
<% _.forEach(people, function(name) { %><li><%= name %></li><% }); %>
|
||||
<% _.forEach(people, function(name) { %><li><%- name %></li><% }); %>
|
||||
</ul>
|
||||
@@ -1 +1 @@
|
||||
Hello {{ name }}!
|
||||
Hallå {{ name }}!
|
||||
1213
test/test-build.js
@@ -18,10 +18,14 @@
|
||||
// expose Lo-Dash build file path
|
||||
ui.buildPath = (function() {
|
||||
switch (build) {
|
||||
case 'lodash-prod': return 'lodash.min.js';
|
||||
case 'lodash-underscore': return 'lodash.underscore.min.js';
|
||||
case 'lodash-custom': return 'lodash.custom.min.js';
|
||||
case 'lodash-custom-debug': return 'lodash.custom.js';
|
||||
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';
|
||||
}());
|
||||
@@ -56,10 +60,14 @@
|
||||
|
||||
buildList.selectedIndex = (function() {
|
||||
switch (build) {
|
||||
case 'lodash-prod': return 1;
|
||||
case 'lodash-underscore': return 2;
|
||||
case 'lodash-custom': return 3;
|
||||
case 'lodash-custom-debug': return 4;
|
||||
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;
|
||||
}());
|
||||
@@ -83,11 +91,15 @@
|
||||
span2.innerHTML =
|
||||
'<label for="qunit-build">Build: </label>' +
|
||||
'<select id="qunit-build">' +
|
||||
'<option value="lodash-dev">Developement</option>' +
|
||||
'<option value="lodash-prod">Production</option>' +
|
||||
'<option value="lodash-underscore">Underscore</option>' +
|
||||
'<option value="lodash-custom">Custom</option>' +
|
||||
'<option value="lodash-custom-debug">Custom (debug)</option>' +
|
||||
'<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,
|
||||
|
||||
2322
test/test.js
@@ -5,7 +5,7 @@
|
||||
<title>Underscore Test Suite</title>
|
||||
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css">
|
||||
<style>
|
||||
iframe, img {
|
||||
iframe {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
@@ -21,17 +21,71 @@
|
||||
</div>
|
||||
<script src="../vendor/jquery/jquery.js"></script>
|
||||
<script src="../vendor/platform.js/platform.js"></script>
|
||||
<script>
|
||||
// avoid syntax errors for `QUnit.throws` in older Firefoxes
|
||||
document.write(platform.name == 'Firefox' && /^1\b/.test(platform.version)
|
||||
? '<script src="../vendor/qunit/qunit/qunit-1.8.0.js"><\/script>'
|
||||
: '<script src="../vendor/qunit/qunit/qunit.js"><\/script>'
|
||||
);
|
||||
</script>
|
||||
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
||||
<script src="test-ui.js"></script>
|
||||
<script>
|
||||
document.write('<script src="../' + ui.buildPath + '"><\/script>');
|
||||
</script>
|
||||
<script>
|
||||
(function() {
|
||||
var arrayProto = Array.prototype,
|
||||
concat = arrayProto.concat,
|
||||
pop = arrayProto.pop,
|
||||
push = arrayProto.push,
|
||||
slice = arrayProto.slice;
|
||||
|
||||
if (_.chain().__chain__) {
|
||||
return;
|
||||
}
|
||||
_.mixin = function(object) {
|
||||
_.forEach(_.functions(object), function(methodName) {
|
||||
var func = _[methodName] = object[methodName];
|
||||
_.prototype[methodName] = function() {
|
||||
var args = [this.__wrapped__];
|
||||
push.apply(args, arguments);
|
||||
|
||||
var result = func.apply(_, args);
|
||||
if (this.__chain__) {
|
||||
result = new _(result);
|
||||
result.__chain__ = true;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
_.mixin(_);
|
||||
|
||||
_.mixin({
|
||||
'findWhere': _.find
|
||||
});
|
||||
|
||||
_.chain = function(value) {
|
||||
value = new _(value);
|
||||
value.__chain__ = true;
|
||||
return value;
|
||||
};
|
||||
|
||||
_.prototype.chain = function() {
|
||||
this.__chain__ = true;
|
||||
return this;
|
||||
};
|
||||
|
||||
_.prototype.concat = function() {
|
||||
var result = concat.apply(this.__wrapped__, arguments);
|
||||
if (this.__chain__) {
|
||||
result = new _(result);
|
||||
result.__chain__ = true;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
_.prototype.pop = function() {
|
||||
pop.apply(this.__wrapped__, arguments);
|
||||
return this;
|
||||
};
|
||||
}());
|
||||
</script>
|
||||
<script src="../vendor/underscore/test/collections.js"></script>
|
||||
<script src="../vendor/underscore/test/arrays.js"></script>
|
||||
<script src="../vendor/underscore/test/functions.js"></script>
|
||||
|
||||
4
vendor/backbone/LICENSE
vendored
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2010-2012 Jeremy Ashkenas, DocumentCloud
|
||||
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
|
||||
@@ -19,4 +19,4 @@ 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.
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
1431
vendor/backbone/backbone.js
vendored
457
vendor/backbone/test/collection.js
vendored
@@ -18,17 +18,21 @@ $(document).ready(function() {
|
||||
|
||||
}));
|
||||
|
||||
test("new and sort", 7, function() {
|
||||
test("new and sort", 9, function() {
|
||||
var counter = 0;
|
||||
col.on('sort', function(){ counter++; });
|
||||
equal(col.first(), a, "a should be first");
|
||||
equal(col.last(), d, "d should be last");
|
||||
col.comparator = function(a, b) {
|
||||
return a.id > b.id ? -1 : 1;
|
||||
};
|
||||
col.sort();
|
||||
equal(counter, 1);
|
||||
equal(col.first(), a, "a should be first");
|
||||
equal(col.last(), d, "d should be last");
|
||||
col.comparator = function(model) { return model.id; };
|
||||
col.sort();
|
||||
equal(counter, 2);
|
||||
equal(col.first(), d, "d should be first");
|
||||
equal(col.last(), a, "a should be last");
|
||||
equal(col.length, 4);
|
||||
@@ -58,22 +62,29 @@ $(document).ready(function() {
|
||||
strictEqual(collection.last().get('a'), 4);
|
||||
});
|
||||
|
||||
test("get, getByCid", 3, function() {
|
||||
test("get", 6, function() {
|
||||
equal(col.get(0), d);
|
||||
equal(col.get(d.clone()), d);
|
||||
equal(col.get(2), b);
|
||||
equal(col.getByCid(col.first().cid), col.first());
|
||||
equal(col.get({id: 1}), c);
|
||||
equal(col.get(c.clone()), c);
|
||||
equal(col.get(col.first().cid), col.first());
|
||||
});
|
||||
|
||||
test("get with non-default ids", 2, function() {
|
||||
test("get with non-default ids", 5, function() {
|
||||
var col = new Backbone.Collection();
|
||||
var MongoModel = Backbone.Model.extend({
|
||||
idAttribute: '_id'
|
||||
});
|
||||
var MongoModel = Backbone.Model.extend({idAttribute: '_id'});
|
||||
var model = new MongoModel({_id: 100});
|
||||
col.push(model);
|
||||
col.add(model);
|
||||
equal(col.get(100), model);
|
||||
model.set({_id: 101});
|
||||
equal(col.get(101), model);
|
||||
equal(col.get(model.cid), model);
|
||||
equal(col.get(model), model);
|
||||
equal(col.get(101), void 0);
|
||||
|
||||
var col2 = new Backbone.Collection();
|
||||
col2.model = MongoModel;
|
||||
col2.add(model.attributes);
|
||||
equal(col2.get(model.clone()), col2.first());
|
||||
});
|
||||
|
||||
test("update index when id changes", 3, function() {
|
||||
@@ -214,6 +225,19 @@ $(document).ready(function() {
|
||||
equal(col.at(0).get('value'), 2);
|
||||
});
|
||||
|
||||
test("add with parse and merge", function() {
|
||||
var Model = Backbone.Model.extend({
|
||||
parse: function (data) {
|
||||
return data.model;
|
||||
}
|
||||
});
|
||||
var collection = new Backbone.Collection();
|
||||
collection.model = Model;
|
||||
collection.add({id: 1});
|
||||
collection.add({model: {id: 1, name: 'Alf'}}, {parse: true, merge: true});
|
||||
equal(collection.first().get('name'), 'Alf');
|
||||
});
|
||||
|
||||
test("add model to collection with sort()-style comparator", 3, function() {
|
||||
var col = new Backbone.Collection;
|
||||
col.comparator = function(a, b) {
|
||||
@@ -304,13 +328,13 @@ $(document).ready(function() {
|
||||
var colE = new Backbone.Collection([e]);
|
||||
var colF = new Backbone.Collection([f]);
|
||||
ok(e != f);
|
||||
ok(colE.length == 1);
|
||||
ok(colF.length == 1);
|
||||
ok(colE.length === 1);
|
||||
ok(colF.length === 1);
|
||||
colE.remove(e);
|
||||
equal(passed, false);
|
||||
ok(colE.length == 0);
|
||||
ok(colE.length === 0);
|
||||
colF.remove(e);
|
||||
ok(colF.length == 0);
|
||||
ok(colF.length === 0);
|
||||
equal(passed, true);
|
||||
});
|
||||
|
||||
@@ -338,24 +362,24 @@ $(document).ready(function() {
|
||||
});
|
||||
equal(colE, e.collection);
|
||||
colF.remove(e);
|
||||
ok(colF.length == 0);
|
||||
ok(colE.length == 1);
|
||||
ok(colF.length === 0);
|
||||
ok(colE.length === 1);
|
||||
equal(counter, 1);
|
||||
equal(colE, e.collection);
|
||||
colE.remove(e);
|
||||
equal(null, e.collection);
|
||||
ok(colE.length == 0);
|
||||
ok(colE.length === 0);
|
||||
equal(counter, 2);
|
||||
});
|
||||
|
||||
test("model destroy removes from all collections", 3, function() {
|
||||
var e = new Backbone.Model({id: 5, title: 'Othello'});
|
||||
e.sync = function(method, model, options) { options.success({}); };
|
||||
e.sync = function(method, model, options) { options.success(); };
|
||||
var colE = new Backbone.Collection([e]);
|
||||
var colF = new Backbone.Collection([e]);
|
||||
e.destroy();
|
||||
ok(colE.length == 0);
|
||||
ok(colF.length == 0);
|
||||
ok(colE.length === 0);
|
||||
ok(colF.length === 0);
|
||||
equal(undefined, e.collection);
|
||||
});
|
||||
|
||||
@@ -365,8 +389,8 @@ $(document).ready(function() {
|
||||
var colE = new Backbone.Collection([e]);
|
||||
var colF = new Backbone.Collection([e]);
|
||||
e.destroy();
|
||||
ok(colE.length == 0);
|
||||
ok(colF.length == 0);
|
||||
ok(colE.length === 0);
|
||||
ok(colF.length === 0);
|
||||
equal(undefined, e.collection);
|
||||
});
|
||||
|
||||
@@ -382,6 +406,28 @@ $(document).ready(function() {
|
||||
equal(this.syncArgs.options.parse, false);
|
||||
});
|
||||
|
||||
test("fetch with an error response triggers an error event", 1, function () {
|
||||
var collection = new Backbone.Collection();
|
||||
collection.on('error', function () {
|
||||
ok(true);
|
||||
});
|
||||
collection.sync = function (method, model, options) { options.error(); };
|
||||
collection.fetch();
|
||||
});
|
||||
|
||||
test("ensure fetch only parses once", 1, function() {
|
||||
var collection = new Backbone.Collection;
|
||||
var counter = 0;
|
||||
collection.parse = function(models) {
|
||||
counter++;
|
||||
return models;
|
||||
};
|
||||
collection.url = '/test';
|
||||
collection.fetch();
|
||||
this.syncArgs.options.success();
|
||||
equal(counter, 1);
|
||||
});
|
||||
|
||||
test("create", 4, function() {
|
||||
var collection = new Backbone.Collection;
|
||||
collection.url = '/test';
|
||||
@@ -392,7 +438,7 @@ $(document).ready(function() {
|
||||
equal(model.collection, collection);
|
||||
});
|
||||
|
||||
test("create enforces validation", 1, function() {
|
||||
test("create with validate:true enforces validation", 2, function() {
|
||||
var ValidatingModel = Backbone.Model.extend({
|
||||
validate: function(attrs) {
|
||||
return "fail";
|
||||
@@ -402,10 +448,13 @@ $(document).ready(function() {
|
||||
model: ValidatingModel
|
||||
});
|
||||
var col = new ValidatingCollection();
|
||||
equal(col.create({"foo":"bar"}), false);
|
||||
col.on('invalid', function (collection, attrs, options) {
|
||||
equal(options.validationError, 'fail');
|
||||
});
|
||||
equal(col.create({"foo":"bar"}, {validate:true}), false);
|
||||
});
|
||||
|
||||
test("a failing create runs the error callback", 1, function() {
|
||||
test("a failing create returns model with errors", function() {
|
||||
var ValidatingModel = Backbone.Model.extend({
|
||||
validate: function(attrs) {
|
||||
return "fail";
|
||||
@@ -414,11 +463,10 @@ $(document).ready(function() {
|
||||
var ValidatingCollection = Backbone.Collection.extend({
|
||||
model: ValidatingModel
|
||||
});
|
||||
var flag = false;
|
||||
var callback = function(model, error) { flag = true; };
|
||||
var col = new ValidatingCollection();
|
||||
col.create({"foo":"bar"}, { error: callback });
|
||||
equal(flag, true);
|
||||
var m = col.create({"foo":"bar"});
|
||||
equal(m.validationError, 'fail');
|
||||
equal(col.length, 1);
|
||||
});
|
||||
|
||||
test("initialize", 1, function() {
|
||||
@@ -435,9 +483,10 @@ $(document).ready(function() {
|
||||
equal(JSON.stringify(col), '[{"id":3,"label":"a"},{"id":2,"label":"b"},{"id":1,"label":"c"},{"id":0,"label":"d"}]');
|
||||
});
|
||||
|
||||
test("where", 6, function() {
|
||||
test("where and findWhere", 8, function() {
|
||||
var model = new Backbone.Model({a: 1});
|
||||
var coll = new Backbone.Collection([
|
||||
{a: 1},
|
||||
model,
|
||||
{a: 1},
|
||||
{a: 1, b: 2},
|
||||
{a: 2, b: 2},
|
||||
@@ -449,6 +498,8 @@ $(document).ready(function() {
|
||||
equal(coll.where({b: 1}).length, 0);
|
||||
equal(coll.where({b: 2}).length, 2);
|
||||
equal(coll.where({a: 1, b: 2}).length, 1);
|
||||
equal(coll.findWhere({a: 1}), model);
|
||||
equal(coll.findWhere({a: 4}), void 0);
|
||||
});
|
||||
|
||||
test("Underscore methods", 13, function() {
|
||||
@@ -458,10 +509,10 @@ $(document).ready(function() {
|
||||
equal(col.indexOf(b), 1);
|
||||
equal(col.size(), 4);
|
||||
equal(col.rest().length, 3);
|
||||
ok(!_.include(col.rest()), a);
|
||||
ok(!_.include(col.rest()), d);
|
||||
ok(!_.include(col.rest(), a));
|
||||
ok(_.include(col.rest(), d));
|
||||
ok(!col.isEmpty());
|
||||
ok(!_.include(col.without(d)), d);
|
||||
ok(!_.include(col.without(d), d));
|
||||
equal(col.max(function(model){ return model.id; }).id, 3);
|
||||
equal(col.min(function(model){ return model.id; }).id, 0);
|
||||
deepEqual(col.chain()
|
||||
@@ -471,7 +522,19 @@ $(document).ready(function() {
|
||||
[4, 0]);
|
||||
});
|
||||
|
||||
test("reset", 10, function() {
|
||||
test("sortedIndex", function () {
|
||||
var model = new Backbone.Model({key: 2});
|
||||
var collection = new (Backbone.Collection.extend({
|
||||
comparator: 'key'
|
||||
}))([model, {key: 1}]);
|
||||
equal(collection.sortedIndex(model), 1);
|
||||
equal(collection.sortedIndex(model, 'key'), 1);
|
||||
equal(collection.sortedIndex(model, function (model) {
|
||||
return model.get('key');
|
||||
}), 1);
|
||||
});
|
||||
|
||||
test("reset", 12, function() {
|
||||
var resetCount = 0;
|
||||
var models = col.models;
|
||||
col.on('reset', function() { resetCount += 1; });
|
||||
@@ -488,6 +551,22 @@ $(document).ready(function() {
|
||||
equal(col.length, 4);
|
||||
ok(col.last() !== d);
|
||||
ok(_.isEqual(col.last().attributes, d.attributes));
|
||||
col.reset();
|
||||
equal(col.length, 0);
|
||||
equal(resetCount, 4);
|
||||
});
|
||||
|
||||
test ("reset with different values", function(){
|
||||
var col = new Backbone.Collection({id: 1});
|
||||
col.reset({id: 1, a: 1});
|
||||
equal(col.get(1).get('a'), 1);
|
||||
});
|
||||
|
||||
test("same references in reset", function() {
|
||||
var model = new Backbone.Model({id: 1});
|
||||
var collection = new Backbone.Collection({id: 1});
|
||||
collection.reset(model);
|
||||
equal(collection.get(1), model);
|
||||
});
|
||||
|
||||
test("reset passes caller options", 3, function() {
|
||||
@@ -542,7 +621,7 @@ $(document).ready(function() {
|
||||
equal(col.length, 0);
|
||||
});
|
||||
|
||||
test("#861, adding models to a collection which do not pass validation", 2, function() {
|
||||
test("#861, adding models to a collection which do not pass validation, with validate:true", function() {
|
||||
var Model = Backbone.Model.extend({
|
||||
validate: function(attrs) {
|
||||
if (attrs.id == 3) return "id can't be 3";
|
||||
@@ -556,20 +635,20 @@ $(document).ready(function() {
|
||||
var collection = new Collection;
|
||||
collection.on("error", function() { ok(true); });
|
||||
|
||||
collection.add([{id: 1}, {id: 2}, {id: 3}, {id: 4}, {id: 5}, {id: 6}]);
|
||||
collection.add([{id: 1}, {id: 2}, {id: 3}, {id: 4}, {id: 5}, {id: 6}], {validate:true});
|
||||
deepEqual(collection.pluck('id'), [1, 2, 4, 5, 6]);
|
||||
});
|
||||
|
||||
test("Invalid models are discarded.", 5, function() {
|
||||
test("Invalid models are discarded with validate:true.", 5, function() {
|
||||
var collection = new Backbone.Collection;
|
||||
collection.on('test', function() { ok(true); });
|
||||
collection.model = Backbone.Model.extend({
|
||||
validate: function(attrs){ if (!attrs.valid) return 'invalid'; }
|
||||
});
|
||||
var model = new collection.model({id: 1, valid: true});
|
||||
collection.add([model, {id: 2}]);;
|
||||
collection.add([model, {id: 2}], {validate:true});
|
||||
model.trigger('test');
|
||||
ok(collection.getByCid(model.cid));
|
||||
ok(collection.get(model.cid));
|
||||
ok(collection.get(1));
|
||||
ok(!collection.get(2));
|
||||
equal(collection.length, 1);
|
||||
@@ -631,19 +710,34 @@ $(document).ready(function() {
|
||||
}
|
||||
};
|
||||
col.sync = m.sync = function( method, collection, options ){
|
||||
options.success();
|
||||
options.success(collection, [], options);
|
||||
};
|
||||
col.fetch(opts);
|
||||
col.create(m, opts);
|
||||
});
|
||||
|
||||
test("#1412 - Trigger 'sync' event.", 2, function() {
|
||||
test("#1412 - Trigger 'request' and 'sync' events.", 4, function() {
|
||||
var collection = new Backbone.Collection;
|
||||
collection.url = '/test';
|
||||
collection.on('sync', function() { ok(true); });
|
||||
Backbone.ajax = function(settings){ settings.success(); };
|
||||
|
||||
collection.on('request', function(obj, xhr, options) {
|
||||
ok(obj === collection, "collection has correct 'request' event after fetching");
|
||||
});
|
||||
collection.on('sync', function(obj, response, options) {
|
||||
ok(obj === collection, "collection has correct 'sync' event after fetching");
|
||||
});
|
||||
collection.fetch();
|
||||
collection.off();
|
||||
|
||||
collection.on('request', function(obj, xhr, options) {
|
||||
ok(obj === collection.get(1), "collection has correct 'request' event after one of its models save");
|
||||
});
|
||||
collection.on('sync', function(obj, response, options) {
|
||||
ok(obj === collection.get(1), "collection has correct 'sync' event after one of its models save");
|
||||
});
|
||||
collection.create({id: 1});
|
||||
collection.off();
|
||||
});
|
||||
|
||||
test("#1447 - create with wait adds model.", 1, function() {
|
||||
@@ -726,4 +820,281 @@ $(document).ready(function() {
|
||||
c.add({id: 4});
|
||||
});
|
||||
|
||||
test("#1407 parse option on constructor parses collection and models", 2, function() {
|
||||
var model = {
|
||||
namespace : [{id: 1}, {id:2}]
|
||||
};
|
||||
var Collection = Backbone.Collection.extend({
|
||||
model: Backbone.Model.extend({
|
||||
parse: function(model) {
|
||||
model.name = 'test';
|
||||
return model;
|
||||
}
|
||||
}),
|
||||
parse: function(model) {
|
||||
return model.namespace;
|
||||
}
|
||||
});
|
||||
var c = new Collection(model, {parse:true});
|
||||
|
||||
equal(c.length, 2);
|
||||
equal(c.at(0).get('name'), 'test');
|
||||
});
|
||||
|
||||
test("#1407 parse option on reset parses collection and models", 2, function() {
|
||||
var model = {
|
||||
namespace : [{id: 1}, {id:2}]
|
||||
};
|
||||
var Collection = Backbone.Collection.extend({
|
||||
model: Backbone.Model.extend({
|
||||
parse: function(model) {
|
||||
model.name = 'test';
|
||||
return model;
|
||||
}
|
||||
}),
|
||||
parse: function(model) {
|
||||
return model.namespace;
|
||||
}
|
||||
});
|
||||
var c = new Collection();
|
||||
c.reset(model, {parse:true});
|
||||
|
||||
equal(c.length, 2);
|
||||
equal(c.at(0).get('name'), 'test');
|
||||
});
|
||||
|
||||
|
||||
test("Reset includes previous models in triggered event.", 1, function() {
|
||||
var model = new Backbone.Model();
|
||||
var collection = new Backbone.Collection([model])
|
||||
.on('reset', function(collection, options) {
|
||||
deepEqual(options.previousModels, [model]);
|
||||
});
|
||||
collection.reset([]);
|
||||
});
|
||||
|
||||
test("set", function() {
|
||||
var m1 = new Backbone.Model();
|
||||
var m2 = new Backbone.Model({id: 2});
|
||||
var m3 = new Backbone.Model();
|
||||
var c = new Backbone.Collection([m1, m2]);
|
||||
|
||||
// Test add/change/remove events
|
||||
c.on('add', function(model) {
|
||||
strictEqual(model, m3);
|
||||
});
|
||||
c.on('change', function(model) {
|
||||
strictEqual(model, m2);
|
||||
});
|
||||
c.on('remove', function(model) {
|
||||
strictEqual(model, m1);
|
||||
});
|
||||
|
||||
// remove: false doesn't remove any models
|
||||
c.set([], {remove: false});
|
||||
strictEqual(c.length, 2);
|
||||
|
||||
// add: false doesn't add any models
|
||||
c.set([m1, m2, m3], {add: false});
|
||||
strictEqual(c.length, 2);
|
||||
|
||||
// merge: false doesn't change any models
|
||||
c.set([m1, {id: 2, a: 1}], {merge: false});
|
||||
strictEqual(m2.get('a'), void 0);
|
||||
|
||||
// add: false, remove: false only merges existing models
|
||||
c.set([m1, {id: 2, a: 0}, m3, {id: 4}], {add: false, remove: false});
|
||||
strictEqual(c.length, 2);
|
||||
strictEqual(m2.get('a'), 0);
|
||||
|
||||
// default options add/remove/merge as appropriate
|
||||
c.set([{id: 2, a: 1}, m3]);
|
||||
strictEqual(c.length, 2);
|
||||
strictEqual(m2.get('a'), 1);
|
||||
|
||||
// Test removing models not passing an argument
|
||||
c.off('remove').on('remove', function(model) {
|
||||
ok(model === m2 || model === m3);
|
||||
});
|
||||
c.set([]);
|
||||
strictEqual(c.length, 0);
|
||||
});
|
||||
|
||||
test("set with only cids", 3, function() {
|
||||
var m1 = new Backbone.Model;
|
||||
var m2 = new Backbone.Model;
|
||||
var c = new Backbone.Collection;
|
||||
c.set([m1, m2]);
|
||||
equal(c.length, 2);
|
||||
c.set([m1]);
|
||||
equal(c.length, 1);
|
||||
c.set([m1, m1, m1, m2, m2], {remove: false});
|
||||
equal(c.length, 2);
|
||||
});
|
||||
|
||||
test("set with only idAttribute", 3, function() {
|
||||
var m1 = { _id: 1 };
|
||||
var m2 = { _id: 2 };
|
||||
var col = Backbone.Collection.extend({
|
||||
model: Backbone.Model.extend({
|
||||
idAttribute: '_id'
|
||||
})
|
||||
});
|
||||
var c = new col;
|
||||
c.set([m1, m2]);
|
||||
equal(c.length, 2);
|
||||
c.set([m1]);
|
||||
equal(c.length, 1);
|
||||
c.set([m1, m1, m1, m2, m2], {remove: false});
|
||||
equal(c.length, 2);
|
||||
});
|
||||
|
||||
test("set + merge with default values defined", function() {
|
||||
var Model = Backbone.Model.extend({
|
||||
defaults: {
|
||||
key: 'value'
|
||||
}
|
||||
});
|
||||
var m = new Model({id: 1});
|
||||
var col = new Backbone.Collection([m], {model: Model});
|
||||
equal(col.first().get('key'), 'value');
|
||||
|
||||
col.set({id: 1, key: 'other'});
|
||||
equal(col.first().get('key'), 'other');
|
||||
|
||||
col.set({id: 1, other: 'value'});
|
||||
equal(col.first().get('key'), 'value');
|
||||
equal(col.length, 1);
|
||||
});
|
||||
|
||||
test("`set` and model level `parse`", function() {
|
||||
var Model = Backbone.Model.extend({
|
||||
parse: function (res) { return res.model; }
|
||||
});
|
||||
var Collection = Backbone.Collection.extend({
|
||||
model: Model,
|
||||
parse: function (res) { return res.models; }
|
||||
});
|
||||
var model = new Model({id: 1});
|
||||
var collection = new Collection(model);
|
||||
collection.set({models: [
|
||||
{model: {id: 1}},
|
||||
{model: {id: 2}}
|
||||
]}, {parse: true});
|
||||
equal(collection.first(), model);
|
||||
});
|
||||
|
||||
test("`set` data is only parsed once", function() {
|
||||
var collection = new Backbone.Collection();
|
||||
collection.model = Backbone.Model.extend({
|
||||
parse: function (data) {
|
||||
equal(data.parsed, void 0);
|
||||
data.parsed = true;
|
||||
return data;
|
||||
}
|
||||
});
|
||||
collection.set({}, {parse: true});
|
||||
});
|
||||
|
||||
test("#1894 - Push should not trigger a sort", 0, function() {
|
||||
var Collection = Backbone.Collection.extend({
|
||||
comparator: 'id',
|
||||
sort: function() {
|
||||
ok(false);
|
||||
}
|
||||
});
|
||||
new Collection().push({id: 1});
|
||||
});
|
||||
|
||||
test("`set` with non-normal id", function() {
|
||||
var Collection = Backbone.Collection.extend({
|
||||
model: Backbone.Model.extend({idAttribute: '_id'})
|
||||
});
|
||||
var collection = new Collection({_id: 1});
|
||||
collection.set([{_id: 1, a: 1}], {add: false});
|
||||
equal(collection.first().get('a'), 1);
|
||||
});
|
||||
|
||||
test("#1894 - `sort` can optionally be turned off", 0, function() {
|
||||
var Collection = Backbone.Collection.extend({
|
||||
comparator: 'id',
|
||||
sort: function() { ok(true); }
|
||||
});
|
||||
new Collection().add({id: 1}, {sort: false});
|
||||
});
|
||||
|
||||
test("#1915 - `parse` data in the right order in `set`", function() {
|
||||
var collection = new (Backbone.Collection.extend({
|
||||
parse: function (data) {
|
||||
strictEqual(data.status, 'ok');
|
||||
return data.data;
|
||||
}
|
||||
}));
|
||||
var res = {status: 'ok', data:[{id: 1}]};
|
||||
collection.set(res, {parse: true});
|
||||
});
|
||||
|
||||
asyncTest("#1939 - `parse` is passed `options`", 1, function () {
|
||||
var collection = new (Backbone.Collection.extend({
|
||||
url: '/',
|
||||
parse: function (data, options) {
|
||||
strictEqual(options.xhr.someHeader, 'headerValue');
|
||||
return data;
|
||||
}
|
||||
}));
|
||||
var ajax = Backbone.ajax;
|
||||
Backbone.ajax = function (params) {
|
||||
_.defer(params.success);
|
||||
return {someHeader: 'headerValue'};
|
||||
};
|
||||
collection.fetch({
|
||||
success: function () { start(); }
|
||||
});
|
||||
Backbone.ajax = ajax;
|
||||
});
|
||||
|
||||
test("`add` only `sort`s when necessary", 2, function () {
|
||||
var collection = new (Backbone.Collection.extend({
|
||||
comparator: 'a'
|
||||
}))([{id: 1}, {id: 2}, {id: 3}]);
|
||||
collection.on('sort', function () { ok(true); });
|
||||
collection.add({id: 4}); // do sort, new model
|
||||
collection.add({id: 1, a: 1}, {merge: true}); // do sort, comparator change
|
||||
collection.add({id: 1, b: 1}, {merge: true}); // don't sort, no comparator change
|
||||
collection.add({id: 1, a: 1}, {merge: true}); // don't sort, no comparator change
|
||||
collection.add(collection.models); // don't sort, nothing new
|
||||
collection.add(collection.models, {merge: true}); // don't sort
|
||||
});
|
||||
|
||||
test("`add` only `sort`s when necessary with comparator function", 3, function () {
|
||||
var collection = new (Backbone.Collection.extend({
|
||||
comparator: function(a, b) {
|
||||
return a.get('a') > b.get('a') ? 1 : (a.get('a') < b.get('a') ? -1 : 0);
|
||||
}
|
||||
}))([{id: 1}, {id: 2}, {id: 3}]);
|
||||
collection.on('sort', function () { ok(true); });
|
||||
collection.add({id: 4}); // do sort, new model
|
||||
collection.add({id: 1, a: 1}, {merge: true}); // do sort, model change
|
||||
collection.add({id: 1, b: 1}, {merge: true}); // do sort, model change
|
||||
collection.add({id: 1, a: 1}, {merge: true}); // don't sort, no model change
|
||||
collection.add(collection.models); // don't sort, nothing new
|
||||
collection.add(collection.models, {merge: true}); // don't sort
|
||||
});
|
||||
|
||||
test("Attach options to collection.", 3, function() {
|
||||
var url = '/somewhere';
|
||||
var model = new Backbone.Model;
|
||||
var comparator = function(){};
|
||||
|
||||
var collection = new Backbone.Collection([], {
|
||||
url: url,
|
||||
model: model,
|
||||
comparator: comparator
|
||||
});
|
||||
|
||||
strictEqual(collection.url, url);
|
||||
ok(collection.model === model);
|
||||
ok(collection.comparator === comparator);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
283
vendor/backbone/test/events.js
vendored
@@ -17,7 +17,7 @@ $(document).ready(function() {
|
||||
|
||||
test("binding and triggering multiple events", 4, function() {
|
||||
var obj = { counter: 0 };
|
||||
_.extend(obj,Backbone.Events);
|
||||
_.extend(obj, Backbone.Events);
|
||||
|
||||
obj.on('a b c', function() { obj.counter += 1; });
|
||||
|
||||
@@ -35,6 +35,130 @@ $(document).ready(function() {
|
||||
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);
|
||||
@@ -154,6 +278,13 @@ $(document).ready(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); });
|
||||
@@ -172,18 +303,6 @@ $(document).ready(function() {
|
||||
obj.trigger('x y');
|
||||
});
|
||||
|
||||
test("off is chainable", 3, function() {
|
||||
var obj = _.extend({}, Backbone.Events);
|
||||
// With no events
|
||||
ok(obj.off() === obj);
|
||||
// When removing all events
|
||||
obj.on('event', function(){}, obj);
|
||||
ok(obj.off() === obj);
|
||||
// When removing some events
|
||||
obj.on('event', function(){}, obj);
|
||||
ok(obj.off('event') === obj);
|
||||
});
|
||||
|
||||
test("#1310 - off does not skip consecutive events", 0, function() {
|
||||
var obj = _.extend({}, Backbone.Events);
|
||||
obj.on('event', function() { ok(false); }, obj);
|
||||
@@ -192,4 +311,142 @@ $(document).ready(function() {
|
||||
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());
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
418
vendor/backbone/test/model.js
vendored
@@ -46,19 +46,31 @@ $(document).ready(function() {
|
||||
|
||||
test("initialize with parsed attributes", 1, function() {
|
||||
var Model = Backbone.Model.extend({
|
||||
parse: function(obj) {
|
||||
obj.value += 1;
|
||||
return obj;
|
||||
parse: function(attrs) {
|
||||
attrs.value += 1;
|
||||
return attrs;
|
||||
}
|
||||
});
|
||||
var model = new Model({value: 1}, {parse: true});
|
||||
equal(model.get('value'), 2);
|
||||
});
|
||||
|
||||
test("initialize with defaults", 2, function() {
|
||||
var Model = Backbone.Model.extend({
|
||||
defaults: {
|
||||
first_name: 'Unknown',
|
||||
last_name: 'Unknown'
|
||||
}
|
||||
});
|
||||
var model = new Model({'first_name': 'John'});
|
||||
equal(model.get('first_name'), 'John');
|
||||
equal(model.get('last_name'), 'Unknown');
|
||||
});
|
||||
|
||||
test("parse can return null", 1, function() {
|
||||
var Model = Backbone.Model.extend({
|
||||
parse: function(obj) {
|
||||
obj.value += 1;
|
||||
parse: function(attrs) {
|
||||
attrs.value += 1;
|
||||
return null;
|
||||
}
|
||||
});
|
||||
@@ -99,6 +111,23 @@ $(document).ready(function() {
|
||||
equal(model.url(), '/nested/1/collection/2');
|
||||
});
|
||||
|
||||
test('url and urlRoot are directly attached if passed in the options', 2, function () {
|
||||
var model = new Backbone.Model({a: 1}, {url: '/test'});
|
||||
var model2 = new Backbone.Model({a: 2}, {urlRoot: '/test2'});
|
||||
equal(model.url, '/test');
|
||||
equal(model2.urlRoot, '/test2');
|
||||
});
|
||||
|
||||
test("underscore methods", 5, function() {
|
||||
var model = new Backbone.Model({ 'foo': 'a', 'bar': 'b', 'baz': 'c' });
|
||||
var model2 = model.clone();
|
||||
deepEqual(model.keys(), ['foo', 'bar', 'baz']);
|
||||
deepEqual(model.values(), ['a', 'b', 'c']);
|
||||
deepEqual(model.invert(), { 'a': 'foo', 'b': 'bar', 'c': 'baz' });
|
||||
deepEqual(model.pick('foo', 'baz'), {'foo': 'a', 'baz': 'c'});
|
||||
deepEqual(model.omit('foo', 'bar'), {'baz': 'c'});
|
||||
});
|
||||
|
||||
test("clone", 10, function() {
|
||||
var a = new Backbone.Model({ 'foo': 1, 'bar': 2, 'baz': 3});
|
||||
var b = a.clone();
|
||||
@@ -114,7 +143,7 @@ $(document).ready(function() {
|
||||
|
||||
var foo = new Backbone.Model({p: 1});
|
||||
var bar = new Backbone.Model({p: 2});
|
||||
bar.set(foo.clone(), {unset: true});
|
||||
bar.set(foo.clone().attributes, {unset: true});
|
||||
equal(foo.get('p'), 1);
|
||||
equal(bar.get('p'), undefined);
|
||||
});
|
||||
@@ -190,9 +219,9 @@ $(document).ready(function() {
|
||||
ok(changeCount == 1, "Change count should NOT have incremented.");
|
||||
|
||||
a.validate = function(attrs) {
|
||||
equal(attrs.foo, void 0, "don't ignore values when unsetting");
|
||||
equal(attrs.foo, void 0, "validate:true passed while unsetting");
|
||||
};
|
||||
a.unset('foo');
|
||||
a.unset('foo', {validate: true});
|
||||
equal(a.get('foo'), void 0, "Foo should have changed");
|
||||
delete a.validate;
|
||||
ok(changeCount == 2, "Change count should have incremented for unset.");
|
||||
@@ -201,6 +230,46 @@ $(document).ready(function() {
|
||||
equal(a.id, undefined, "Unsetting the id should remove the id property.");
|
||||
});
|
||||
|
||||
test("#2030 - set with failed validate, followed by another set triggers change", function () {
|
||||
var attr = 0, main = 0, error = 0;
|
||||
var Model = Backbone.Model.extend({
|
||||
validate: function (attr) {
|
||||
if (attr.x > 1) {
|
||||
error++;
|
||||
return "this is an error";
|
||||
}
|
||||
}
|
||||
});
|
||||
var model = new Model({x:0});
|
||||
model.on('change:x', function () { attr++; });
|
||||
model.on('change', function () { main++; });
|
||||
model.set({x:2}, {validate:true});
|
||||
model.set({x:1}, {validate:true});
|
||||
deepEqual([attr, main, error], [1, 1, 1]);
|
||||
});
|
||||
|
||||
test("set triggers changes in the correct order", function() {
|
||||
var value = null;
|
||||
var model = new Backbone.Model;
|
||||
model.on('last', function(){ value = 'last'; });
|
||||
model.on('first', function(){ value = 'first'; });
|
||||
model.trigger('first');
|
||||
model.trigger('last');
|
||||
equal(value, 'last');
|
||||
});
|
||||
|
||||
test("set falsy values in the correct order", 2, function() {
|
||||
var model = new Backbone.Model({result: 'result'});
|
||||
model.on('change', function() {
|
||||
equal(model.changed.result, void 0);
|
||||
equal(model.previous('result'), false);
|
||||
});
|
||||
model.set({result: void 0}, {silent: true});
|
||||
model.set({result: null}, {silent: true});
|
||||
model.set({result: false}, {silent: true});
|
||||
model.set({result: void 0});
|
||||
});
|
||||
|
||||
test("multiple unsets", 1, function() {
|
||||
var i = 0;
|
||||
var counter = function(){ i++; };
|
||||
@@ -212,14 +281,12 @@ $(document).ready(function() {
|
||||
equal(i, 2, 'Unset does not fire an event for missing attributes.');
|
||||
});
|
||||
|
||||
test("unset and changedAttributes", 2, function() {
|
||||
test("unset and changedAttributes", 1, function() {
|
||||
var model = new Backbone.Model({a: 1});
|
||||
model.unset('a', {silent: true});
|
||||
var changedAttributes = model.changedAttributes();
|
||||
ok('a' in changedAttributes, 'changedAttributes should contain unset properties');
|
||||
|
||||
changedAttributes = model.changedAttributes();
|
||||
ok('a' in changedAttributes, 'changedAttributes should contain unset properties when running changedAttributes again after an unset.');
|
||||
model.on('change', function() {
|
||||
ok('a' in model.changedAttributes(), 'changedAttributes should contain unset properties');
|
||||
});
|
||||
model.unset('a');
|
||||
});
|
||||
|
||||
test("using a non-default id attribute.", 5, function() {
|
||||
@@ -239,6 +306,21 @@ $(document).ready(function() {
|
||||
equal(model.get('name'), '');
|
||||
});
|
||||
|
||||
test("setting an object", 1, function() {
|
||||
var model = new Backbone.Model({
|
||||
custom: { foo: 1 }
|
||||
});
|
||||
model.on('change', function() {
|
||||
ok(1);
|
||||
});
|
||||
model.set({
|
||||
custom: { foo: 1 } // no change should be fired
|
||||
});
|
||||
model.set({
|
||||
custom: { foo: 2 } // change event should be fired
|
||||
});
|
||||
});
|
||||
|
||||
test("clear", 3, function() {
|
||||
var changed;
|
||||
var model = new Backbone.Model({id: 1, name : "Model"});
|
||||
@@ -259,9 +341,9 @@ $(document).ready(function() {
|
||||
"two": 2
|
||||
}
|
||||
});
|
||||
var model = new Defaulted({two: null});
|
||||
var model = new Defaulted({two: undefined});
|
||||
equal(model.get('one'), 1);
|
||||
equal(model.get('two'), null);
|
||||
equal(model.get('two'), 2);
|
||||
Defaulted = Backbone.Model.extend({
|
||||
defaults: function() {
|
||||
return {
|
||||
@@ -270,14 +352,14 @@ $(document).ready(function() {
|
||||
};
|
||||
}
|
||||
});
|
||||
var model = new Defaulted({two: null});
|
||||
model = new Defaulted({two: undefined});
|
||||
equal(model.get('one'), 3);
|
||||
equal(model.get('two'), null);
|
||||
equal(model.get('two'), 4);
|
||||
});
|
||||
|
||||
test("change, hasChanged, changedAttributes, previous, previousAttributes", 12, function() {
|
||||
var model = new Backbone.Model({name : "Tim", age : 10});
|
||||
equal(model.changedAttributes(), false);
|
||||
test("change, hasChanged, changedAttributes, previous, previousAttributes", 9, function() {
|
||||
var model = new Backbone.Model({name: "Tim", age: 10});
|
||||
deepEqual(model.changedAttributes(), false);
|
||||
model.on('change', function() {
|
||||
ok(model.hasChanged('name'), 'name changed');
|
||||
ok(!model.hasChanged('age'), 'age did not');
|
||||
@@ -287,18 +369,13 @@ $(document).ready(function() {
|
||||
});
|
||||
equal(model.hasChanged(), false);
|
||||
equal(model.hasChanged(undefined), false);
|
||||
model.set({name : 'Rob'}, {silent : true});
|
||||
equal(model.hasChanged(), true);
|
||||
equal(model.hasChanged(undefined), true);
|
||||
equal(model.hasChanged('name'), true);
|
||||
model.change();
|
||||
model.set({name : 'Rob'});
|
||||
equal(model.get('name'), 'Rob');
|
||||
|
||||
});
|
||||
|
||||
test("changedAttributes", 3, function() {
|
||||
var model = new Backbone.Model({a: 'a', b: 'b'});
|
||||
equal(model.changedAttributes(), false);
|
||||
deepEqual(model.changedAttributes(), false);
|
||||
equal(model.changedAttributes({a: 'a'}), false);
|
||||
equal(model.changedAttributes({a: 'b'}).a, 'b');
|
||||
});
|
||||
@@ -309,8 +386,7 @@ $(document).ready(function() {
|
||||
model.on('change', function(model, options) {
|
||||
value = options.prefix + model.get('name');
|
||||
});
|
||||
model.set({name: 'Bob'}, {silent: true});
|
||||
model.change({prefix: 'Mr. '});
|
||||
model.set({name: 'Bob'}, {prefix: 'Mr. '});
|
||||
equal(value, 'Mr. Bob');
|
||||
model.set({name: 'Sue'}, {prefix: 'Ms. '});
|
||||
equal(value, 'Ms. Sue');
|
||||
@@ -336,7 +412,7 @@ $(document).ready(function() {
|
||||
model.set({lastName: 'Hicks'});
|
||||
});
|
||||
|
||||
test("validate after save", 1, function() {
|
||||
test("validate after save", 2, function() {
|
||||
var lastError, model = new Backbone.Model();
|
||||
model.validate = function(attrs) {
|
||||
if (attrs.admin) return "Can't change admin status.";
|
||||
@@ -344,23 +420,13 @@ $(document).ready(function() {
|
||||
model.sync = function(method, model, options) {
|
||||
options.success.call(this, {admin: true});
|
||||
};
|
||||
model.save(null, {error: function(model, error) {
|
||||
model.on('invalid', function(model, error) {
|
||||
lastError = error;
|
||||
}});
|
||||
});
|
||||
model.save(null);
|
||||
|
||||
equal(lastError, "Can't change admin status.");
|
||||
});
|
||||
|
||||
test("isValid", 5, function() {
|
||||
var model = new Backbone.Model({valid: true});
|
||||
model.validate = function(attrs) {
|
||||
if (!attrs.valid) return "invalid";
|
||||
};
|
||||
equal(model.isValid(), true);
|
||||
equal(model.set({valid: false}), false);
|
||||
equal(model.isValid(), true);
|
||||
ok(model.set('valid', false, {silent: true}));
|
||||
equal(model.isValid(), false);
|
||||
equal(model.validationError, "Can't change admin status.");
|
||||
});
|
||||
|
||||
test("save", 2, function() {
|
||||
@@ -369,6 +435,33 @@ $(document).ready(function() {
|
||||
ok(_.isEqual(this.syncArgs.model, doc));
|
||||
});
|
||||
|
||||
test("save, fetch, destroy triggers error event when an error occurs", 3, function () {
|
||||
var model = new Backbone.Model();
|
||||
model.on('error', function () {
|
||||
ok(true);
|
||||
});
|
||||
model.sync = function (method, model, options) {
|
||||
options.error();
|
||||
};
|
||||
model.save({data: 2, id: 1});
|
||||
model.fetch();
|
||||
model.destroy();
|
||||
});
|
||||
|
||||
test("save with PATCH", function() {
|
||||
doc.clear().set({id: 1, a: 1, b: 2, c: 3, d: 4});
|
||||
doc.save();
|
||||
equal(this.syncArgs.method, 'update');
|
||||
equal(this.syncArgs.options.attrs, undefined);
|
||||
|
||||
doc.save({b: 2, d: 4}, {patch: true});
|
||||
equal(this.syncArgs.method, 'patch');
|
||||
equal(_.size(this.syncArgs.options.attrs), 2);
|
||||
equal(this.syncArgs.options.attrs.d, 4);
|
||||
equal(this.syncArgs.options.attrs.a, undefined);
|
||||
equal(this.ajaxSettings.data, "{\"b\":2,\"d\":4}");
|
||||
});
|
||||
|
||||
test("save in positional style", 1, function() {
|
||||
var model = new Backbone.Model();
|
||||
model.sync = function(method, model, options) {
|
||||
@@ -378,7 +471,18 @@ $(document).ready(function() {
|
||||
equal(model.get('title'), 'Twelfth Night');
|
||||
});
|
||||
|
||||
|
||||
test("save with non-object success response", 2, function () {
|
||||
var model = new Backbone.Model();
|
||||
model.sync = function(method, model, options) {
|
||||
options.success('', options);
|
||||
options.success(null, options);
|
||||
};
|
||||
model.save({testing:'empty'}, {
|
||||
success: function (model) {
|
||||
deepEqual(model.attributes, {testing:'empty'});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
test("fetch", 2, function() {
|
||||
doc.fetch();
|
||||
@@ -402,22 +506,22 @@ $(document).ready(function() {
|
||||
ok(true, "non-persisted model should not call sync");
|
||||
});
|
||||
|
||||
test("validate", 7, function() {
|
||||
test("validate", function() {
|
||||
var lastError;
|
||||
var model = new Backbone.Model();
|
||||
model.validate = function(attrs) {
|
||||
if (attrs.admin != this.get('admin')) return "Can't change admin status.";
|
||||
};
|
||||
model.on('error', function(model, error) {
|
||||
model.on('invalid', function(model, error) {
|
||||
lastError = error;
|
||||
});
|
||||
var result = model.set({a: 100});
|
||||
equal(result, model);
|
||||
equal(model.get('a'), 100);
|
||||
equal(lastError, undefined);
|
||||
result = model.set({admin: true}, {silent: true});
|
||||
result = model.set({admin: true});
|
||||
equal(model.get('admin'), true);
|
||||
result = model.set({a: 200, admin: false});
|
||||
result = model.set({a: 200, admin: false}, {validate:true});
|
||||
equal(lastError, "Can't change admin status.");
|
||||
equal(result, false);
|
||||
equal(model.get('a'), 100);
|
||||
@@ -435,10 +539,10 @@ $(document).ready(function() {
|
||||
model.set({name: "Two"});
|
||||
equal(model.get('name'), 'Two');
|
||||
equal(error, undefined);
|
||||
model.unset('name');
|
||||
model.unset('name', {validate: true});
|
||||
equal(error, true);
|
||||
equal(model.get('name'), 'Two');
|
||||
model.clear();
|
||||
model.clear({validate:true});
|
||||
equal(model.get('name'), 'Two');
|
||||
delete model.validate;
|
||||
model.clear();
|
||||
@@ -451,21 +555,18 @@ $(document).ready(function() {
|
||||
model.validate = function(attrs) {
|
||||
if (attrs.admin) return "Can't change admin status.";
|
||||
};
|
||||
var callback = function(model, error) {
|
||||
lastError = error;
|
||||
};
|
||||
model.on('error', function(model, error) {
|
||||
model.on('invalid', function(model, error) {
|
||||
boundError = true;
|
||||
});
|
||||
var result = model.set({a: 100}, {error: callback});
|
||||
var result = model.set({a: 100}, {validate:true});
|
||||
equal(result, model);
|
||||
equal(model.get('a'), 100);
|
||||
equal(lastError, undefined);
|
||||
equal(model.validationError, null);
|
||||
equal(boundError, undefined);
|
||||
result = model.set({a: 200, admin: true}, {error: callback});
|
||||
result = model.set({a: 200, admin: true}, {validate:true});
|
||||
equal(result, false);
|
||||
equal(model.get('a'), 100);
|
||||
equal(lastError, "Can't change admin status.");
|
||||
equal(model.validationError, "Can't change admin status.");
|
||||
equal(boundError, true);
|
||||
});
|
||||
|
||||
@@ -560,9 +661,16 @@ $(document).ready(function() {
|
||||
ok(model.get('x') === a);
|
||||
});
|
||||
|
||||
test("unset fires change for undefined attributes", 1, function() {
|
||||
test("set same value does not trigger change", 0, function() {
|
||||
var model = new Backbone.Model({x: 1});
|
||||
model.on('change change:x', function() { ok(false); });
|
||||
model.set({x: 1});
|
||||
model.set({x: 1});
|
||||
});
|
||||
|
||||
test("unset does not fire a change for undefined attributes", 0, function() {
|
||||
var model = new Backbone.Model({x: undefined});
|
||||
model.on('change:x', function(){ ok(true); });
|
||||
model.on('change:x', function(){ ok(false); });
|
||||
model.unset('x');
|
||||
});
|
||||
|
||||
@@ -571,19 +679,29 @@ $(document).ready(function() {
|
||||
ok('x' in model.attributes);
|
||||
});
|
||||
|
||||
test("change fires change:attr", 1, function() {
|
||||
test("hasChanged works outside of change events, and true within", 6, function() {
|
||||
var model = new Backbone.Model({x: 1});
|
||||
model.set({x: 2}, {silent: true});
|
||||
model.on('change:x', function(){ ok(true); });
|
||||
model.change();
|
||||
});
|
||||
|
||||
test("hasChanged is false after original values are set", 2, function() {
|
||||
var model = new Backbone.Model({x: 1});
|
||||
model.on('change:x', function(){ ok(false); });
|
||||
model.on('change:x', function() {
|
||||
ok(model.hasChanged('x'));
|
||||
equal(model.get('x'), 1);
|
||||
});
|
||||
model.set({x: 2}, {silent: true});
|
||||
ok(model.hasChanged());
|
||||
model.set({x: 1}, {silent: true});
|
||||
equal(model.hasChanged('x'), true);
|
||||
model.set({x: 1});
|
||||
ok(model.hasChanged());
|
||||
equal(model.hasChanged('x'), true);
|
||||
});
|
||||
|
||||
test("hasChanged gets cleared on the following set", 4, function() {
|
||||
var model = new Backbone.Model;
|
||||
model.set({x: 1});
|
||||
ok(model.hasChanged());
|
||||
model.set({x: 1});
|
||||
ok(!model.hasChanged());
|
||||
model.set({x: 2});
|
||||
ok(model.hasChanged());
|
||||
model.set({});
|
||||
ok(!model.hasChanged());
|
||||
});
|
||||
|
||||
@@ -639,13 +757,20 @@ $(document).ready(function() {
|
||||
equal(model.get('x'), 3);
|
||||
});
|
||||
|
||||
test("save with wait validates attributes", 1, function() {
|
||||
test("save with wait validates attributes", function() {
|
||||
var model = new Backbone.Model();
|
||||
model.url = '/test';
|
||||
model.validate = function() { ok(true); };
|
||||
model.save({x: 1}, {wait: true});
|
||||
});
|
||||
|
||||
test("save turns on parse flag", function () {
|
||||
var Model = Backbone.Model.extend({
|
||||
sync: function(method, model, options) { ok(options.parse); }
|
||||
});
|
||||
new Model().save();
|
||||
});
|
||||
|
||||
test("nested `set` during `'change:attr'`", 2, function() {
|
||||
var events = [];
|
||||
var model = new Backbone.Model();
|
||||
@@ -659,25 +784,19 @@ $(document).ready(function() {
|
||||
model.set({x: true});
|
||||
deepEqual(events, ['change:y', 'change:x', 'change']);
|
||||
events = [];
|
||||
model.change();
|
||||
deepEqual(events, ['change:z', 'change']);
|
||||
model.set({z: true});
|
||||
deepEqual(events, []);
|
||||
});
|
||||
|
||||
test("nested `change` only fires once", 1, function() {
|
||||
var model = new Backbone.Model();
|
||||
model.on('change', function() {
|
||||
ok(true);
|
||||
model.change();
|
||||
model.set({x: true});
|
||||
});
|
||||
model.set({x: true});
|
||||
});
|
||||
|
||||
test("no `'change'` event if no changes", 0, function() {
|
||||
var model = new Backbone.Model();
|
||||
model.on('change', function() { ok(false); });
|
||||
model.change();
|
||||
});
|
||||
|
||||
test("nested `set` during `'change'`", 6, function() {
|
||||
var count = 0;
|
||||
var model = new Backbone.Model();
|
||||
@@ -689,13 +808,13 @@ $(document).ready(function() {
|
||||
model.set({y: true});
|
||||
break;
|
||||
case 1:
|
||||
deepEqual(this.changedAttributes(), {y: true});
|
||||
equal(model.previous('x'), true);
|
||||
deepEqual(this.changedAttributes(), {x: true, y: true});
|
||||
equal(model.previous('x'), undefined);
|
||||
model.set({z: true});
|
||||
break;
|
||||
case 2:
|
||||
deepEqual(this.changedAttributes(), {z: true});
|
||||
equal(model.previous('y'), true);
|
||||
deepEqual(this.changedAttributes(), {x: true, y: true, z: true});
|
||||
equal(model.previous('y'), undefined);
|
||||
break;
|
||||
default:
|
||||
ok(false);
|
||||
@@ -704,30 +823,34 @@ $(document).ready(function() {
|
||||
model.set({x: true});
|
||||
});
|
||||
|
||||
test("nested `'change'` with silent", 3, function() {
|
||||
test("nested `change` with silent", 3, function() {
|
||||
var count = 0;
|
||||
var model = new Backbone.Model();
|
||||
model.on('change:y', function() { ok(true); });
|
||||
model.on('change:y', function() { ok(false); });
|
||||
model.on('change', function() {
|
||||
switch(count++) {
|
||||
case 0:
|
||||
deepEqual(this.changedAttributes(), {x: true});
|
||||
model.set({y: true}, {silent: true});
|
||||
model.set({z: true});
|
||||
break;
|
||||
case 1:
|
||||
deepEqual(this.changedAttributes(), {y: true, z: true});
|
||||
deepEqual(this.changedAttributes(), {x: true, y: true, z: true});
|
||||
break;
|
||||
case 2:
|
||||
deepEqual(this.changedAttributes(), {z: false});
|
||||
break;
|
||||
default:
|
||||
ok(false);
|
||||
}
|
||||
});
|
||||
model.set({x: true});
|
||||
model.set({z: true});
|
||||
model.set({z: false});
|
||||
});
|
||||
|
||||
test("nested `'change:attr'` with silent", 1, function() {
|
||||
test("nested `change:attr` with silent", 0, function() {
|
||||
var model = new Backbone.Model();
|
||||
model.on('change:y', function(){ ok(true); });
|
||||
model.on('change:y', function(){ ok(false); });
|
||||
model.on('change', function() {
|
||||
model.set({y: true}, {silent: true});
|
||||
model.set({z: true});
|
||||
@@ -745,21 +868,25 @@ $(document).ready(function() {
|
||||
equal(val, 2);
|
||||
});
|
||||
model.set({x: true});
|
||||
model.change();
|
||||
});
|
||||
|
||||
test("multiple nested changes with silent", 2, function() {
|
||||
test("multiple nested changes with silent", 1, function() {
|
||||
var changes = [];
|
||||
var model = new Backbone.Model();
|
||||
model.on('change:b', function(model, val) { changes.push(val); });
|
||||
model.on('change', function() {
|
||||
model.set({b: 1});
|
||||
model.set({b: 2}, {silent: true});
|
||||
});
|
||||
model.set({b: 0});
|
||||
deepEqual(changes, [0, 1]);
|
||||
model.change();
|
||||
deepEqual(changes, [0, 1, 2, 1]);
|
||||
});
|
||||
|
||||
test("basic silent change semantics", 1, function() {
|
||||
var model = new Backbone.Model;
|
||||
model.set({x: 1});
|
||||
model.on('change', function(){ ok(true); });
|
||||
model.set({x: 2}, {silent: true});
|
||||
model.set({x: 1});
|
||||
});
|
||||
|
||||
test("nested set multiple times", 1, function() {
|
||||
@@ -774,12 +901,6 @@ $(document).ready(function() {
|
||||
model.set({a: true});
|
||||
});
|
||||
|
||||
test("#1179 - isValid returns true in the absence of validate.", 1, function() {
|
||||
var model = new Backbone.Model();
|
||||
model.validate = null;
|
||||
ok(model.isValid());
|
||||
});
|
||||
|
||||
test("#1122 - clear does not alter options.", 1, function() {
|
||||
var model = new Backbone.Model();
|
||||
var options = {};
|
||||
@@ -811,9 +932,8 @@ $(document).ready(function() {
|
||||
|
||||
test("#1412 - Trigger 'sync' event.", 3, function() {
|
||||
var model = new Backbone.Model({id: 1});
|
||||
model.url = '/test';
|
||||
model.sync = function (method, model, options) { options.success(); };
|
||||
model.on('sync', function(){ ok(true); });
|
||||
Backbone.ajax = function(settings){ settings.success(); };
|
||||
model.fetch();
|
||||
model.save();
|
||||
model.destroy();
|
||||
@@ -840,7 +960,7 @@ $(document).ready(function() {
|
||||
validate: function(){ return 'invalid'; }
|
||||
});
|
||||
var model = new Model({id: 1});
|
||||
model.on('error', function(){ ok(true); });
|
||||
model.on('invalid', function(){ ok(true); });
|
||||
model.save();
|
||||
});
|
||||
|
||||
@@ -869,9 +989,9 @@ $(document).ready(function() {
|
||||
.save(null, {wait: true});
|
||||
});
|
||||
|
||||
test("#1664 - Changing from one value, silently to another, back to original does not trigger change.", 0, function() {
|
||||
test("#1664 - Changing from one value, silently to another, back to original triggers a change.", 1, function() {
|
||||
var model = new Backbone.Model({x:1});
|
||||
model.on('change:x', function() { ok(false); });
|
||||
model.on('change:x', function() { ok(true); });
|
||||
model.set({x:2},{silent:true});
|
||||
model.set({x:3},{silent:true});
|
||||
model.set({x:1});
|
||||
@@ -884,15 +1004,11 @@ $(document).ready(function() {
|
||||
model.set({a:'c'}, {silent:true});
|
||||
model.set({b:2}, {silent:true});
|
||||
model.unset('c', {silent:true});
|
||||
model.set({a:'a'}, {silent:true});
|
||||
model.set({b:1}, {silent:true});
|
||||
model.set({c:'item'}, {silent:true});
|
||||
});
|
||||
model.on('change:a change:b change:c', function(model, val) { changes.push(val); });
|
||||
model.set({a:'a', b:1, c:'item'});
|
||||
deepEqual(changes, ['a',1,'item']);
|
||||
model.change();
|
||||
deepEqual(changes, ['a',1,'item']);
|
||||
deepEqual(model.attributes, {a: 'c', b: 2});
|
||||
});
|
||||
|
||||
test("#1791 - `attributes` is available for `parse`", function() {
|
||||
@@ -903,7 +1019,7 @@ $(document).ready(function() {
|
||||
expect(0);
|
||||
});
|
||||
|
||||
test("silent changes in last `change` event back to original does not trigger change", 2, function() {
|
||||
test("silent changes in last `change` event back to original triggers change", 2, function() {
|
||||
var changes = [];
|
||||
var model = new Backbone.Model();
|
||||
model.on('change:a change:b change:c', function(model, val) { changes.push(val); });
|
||||
@@ -912,9 +1028,75 @@ $(document).ready(function() {
|
||||
});
|
||||
model.set({a:'a'});
|
||||
deepEqual(changes, ['a']);
|
||||
model.set({a:'a'}, {silent:true});
|
||||
model.change();
|
||||
deepEqual(changes, ['a']);
|
||||
model.set({a:'a'});
|
||||
deepEqual(changes, ['a', 'a']);
|
||||
});
|
||||
|
||||
test("#1943 change calculations should use _.isEqual", function() {
|
||||
var model = new Backbone.Model({a: {key: 'value'}});
|
||||
model.set('a', {key:'value'}, {silent:true});
|
||||
equal(model.changedAttributes(), false);
|
||||
});
|
||||
|
||||
test("#1964 - final `change` event is always fired, regardless of interim changes", 1, function () {
|
||||
var model = new Backbone.Model();
|
||||
model.on('change:property', function() {
|
||||
model.set('property', 'bar');
|
||||
});
|
||||
model.on('change', function() {
|
||||
ok(true);
|
||||
});
|
||||
model.set('property', 'foo');
|
||||
});
|
||||
|
||||
test("isValid", function() {
|
||||
var model = new Backbone.Model({valid: true});
|
||||
model.validate = function(attrs) {
|
||||
if (!attrs.valid) return "invalid";
|
||||
};
|
||||
equal(model.isValid(), true);
|
||||
equal(model.set({valid: false}, {validate:true}), false);
|
||||
equal(model.isValid(), true);
|
||||
model.set({valid:false});
|
||||
equal(model.isValid(), false);
|
||||
ok(!model.set('valid', false, {validate: true}));
|
||||
});
|
||||
|
||||
test("#1179 - isValid returns true in the absence of validate.", 1, function() {
|
||||
var model = new Backbone.Model();
|
||||
model.validate = null;
|
||||
ok(model.isValid());
|
||||
});
|
||||
|
||||
test("#1961 - Creating a model with {validate:true} will call validate and use the error callback", function () {
|
||||
var Model = Backbone.Model.extend({
|
||||
validate: function (attrs) {
|
||||
if (attrs.id === 1) return "This shouldn't happen";
|
||||
}
|
||||
});
|
||||
var model = new Model({id: 1}, {validate: true});
|
||||
equal(model.validationError, "This shouldn't happen");
|
||||
});
|
||||
|
||||
test("toJSON receives attrs during save(..., {wait: true})", 1, function() {
|
||||
var Model = Backbone.Model.extend({
|
||||
url: '/test',
|
||||
toJSON: function() {
|
||||
strictEqual(this.attributes.x, 1);
|
||||
return _.clone(this.attributes);
|
||||
}
|
||||
});
|
||||
var model = new Model;
|
||||
model.save({x: 1}, {wait: true});
|
||||
});
|
||||
|
||||
test("#2034 - nested set with silent only triggers one change", 1, function() {
|
||||
var model = new Backbone.Model();
|
||||
model.on('change', function() {
|
||||
model.set({b: true}, {silent: true});
|
||||
ok(true);
|
||||
});
|
||||
model.set({a: true});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
133
vendor/backbone/test/router.js
vendored
@@ -57,6 +57,15 @@ $(document).ready(function() {
|
||||
|
||||
});
|
||||
|
||||
var ExternalObject = {
|
||||
value: 'unset',
|
||||
|
||||
routingFunction: function(value) {
|
||||
this.value = value;
|
||||
}
|
||||
};
|
||||
_.bindAll(ExternalObject);
|
||||
|
||||
var Router = Backbone.Router.extend({
|
||||
|
||||
count: 0,
|
||||
@@ -69,10 +78,15 @@ $(document).ready(function() {
|
||||
"contacts": "contacts",
|
||||
"contacts/new": "newContact",
|
||||
"contacts/:id": "loadContact",
|
||||
"route-event/:arg": "routeEvent",
|
||||
"optional(/:item)": "optionalItem",
|
||||
"named/optional/(y:z)": "namedOptional",
|
||||
"splat/*args/end": "splat",
|
||||
"*first/complex-:part/*rest": "complex",
|
||||
":repo/compare/*from...*to": "github",
|
||||
"decode/:named/*splat": "decode",
|
||||
"*first/complex-*part/*rest": "complex",
|
||||
":entity?*args": "query",
|
||||
"function/:value": ExternalObject.routingFunction,
|
||||
"*anything": "anything"
|
||||
},
|
||||
|
||||
@@ -107,26 +121,44 @@ $(document).ready(function() {
|
||||
},
|
||||
|
||||
optionalItem: function(arg){
|
||||
this.arg = arg !== undefined ? arg : null;
|
||||
this.arg = arg != void 0 ? arg : null;
|
||||
},
|
||||
|
||||
splat : function(args) {
|
||||
splat: function(args) {
|
||||
this.args = args;
|
||||
},
|
||||
|
||||
complex : function(first, part, rest) {
|
||||
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) {
|
||||
query: function(entity, args) {
|
||||
this.entity = entity;
|
||||
this.queryArgs = args;
|
||||
},
|
||||
|
||||
anything : function(whatever) {
|
||||
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) {
|
||||
}
|
||||
|
||||
});
|
||||
@@ -139,11 +171,20 @@ $(document).ready(function() {
|
||||
location.replace('http://example.com#search/news');
|
||||
Backbone.history.checkUrl();
|
||||
equal(router.query, 'news');
|
||||
equal(router.page, undefined);
|
||||
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();
|
||||
@@ -204,10 +245,18 @@ $(document).ready(function() {
|
||||
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();
|
||||
equal(router.arg, null);
|
||||
ok(!router.arg);
|
||||
location.replace('http://example.com#optional/thing');
|
||||
Backbone.history.checkUrl();
|
||||
equal(router.arg, 'thing');
|
||||
@@ -237,6 +286,23 @@ $(document).ready(function() {
|
||||
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');
|
||||
@@ -265,12 +331,12 @@ $(document).ready(function() {
|
||||
if (!Backbone.history.iframe) ok(true);
|
||||
});
|
||||
|
||||
test("route callback gets passed decoded values", 3, function() {
|
||||
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});
|
||||
equal(router.first, 'has/slash');
|
||||
equal(router.part, 'has#hash');
|
||||
equal(router.rest, 'has space');
|
||||
strictEqual(router.first, 'has/slash');
|
||||
strictEqual(router.part, 'has#hash');
|
||||
strictEqual(router.rest, 'has space');
|
||||
});
|
||||
|
||||
test("correctly handles URLs with % (#868)", 3, function() {
|
||||
@@ -279,7 +345,7 @@ $(document).ready(function() {
|
||||
location.replace('http://example.com#search/fat');
|
||||
Backbone.history.checkUrl();
|
||||
equal(router.query, 'fat');
|
||||
equal(router.page, undefined);
|
||||
equal(router.page, void 0);
|
||||
equal(lastRoute, 'search');
|
||||
});
|
||||
|
||||
@@ -502,4 +568,45 @@ $(document).ready(function() {
|
||||
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);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
55
vendor/backbone/test/view.js
vendored
@@ -29,22 +29,6 @@ $(document).ready(function() {
|
||||
strictEqual(view.$('a b').html(), 'test');
|
||||
});
|
||||
|
||||
test("make", 3, function() {
|
||||
var div = view.make('div', {id: 'test-div'}, "one two three");
|
||||
|
||||
equal(div.tagName.toLowerCase(), 'div');
|
||||
equal(div.id, 'test-div');
|
||||
equal($(div).text(), 'one two three');
|
||||
});
|
||||
|
||||
test("make can take falsy values for content", 2, function() {
|
||||
var div = view.make('div', {id: 'test-div'}, 0);
|
||||
equal($(div).text(), '0');
|
||||
|
||||
var div = view.make('div', {id: 'test-div'}, '');
|
||||
equal($(div).text(), '');
|
||||
});
|
||||
|
||||
test("initialize", 1, function() {
|
||||
var View = Backbone.View.extend({
|
||||
initialize: function() {
|
||||
@@ -101,6 +85,13 @@ $(document).ready(function() {
|
||||
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;
|
||||
|
||||
@@ -171,7 +162,7 @@ $(document).ready(function() {
|
||||
return {
|
||||
title: 'title1',
|
||||
acceptText: 'confirm'
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
@@ -310,14 +301,11 @@ $(document).ready(function() {
|
||||
ok(new View().$el.is('p'));
|
||||
});
|
||||
|
||||
test("dispose", 0, function() {
|
||||
test("views stopListening", 0, function() {
|
||||
var View = Backbone.View.extend({
|
||||
events: {
|
||||
click: function() { ok(false); }
|
||||
},
|
||||
initialize: function() {
|
||||
this.model.on('all x', function(){ ok(false); }, this);
|
||||
this.collection.on('all x', function(){ ok(false); }, this);
|
||||
this.listenTo(this.model, 'all x', function(){ ok(false); }, this);
|
||||
this.listenTo(this.collection, 'all x', function(){ ok(false); }, this);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -326,22 +314,9 @@ $(document).ready(function() {
|
||||
collection: new Backbone.Collection
|
||||
});
|
||||
|
||||
view.dispose();
|
||||
view.stopListening();
|
||||
view.model.trigger('x');
|
||||
view.collection.trigger('x');
|
||||
view.$el.click();
|
||||
});
|
||||
|
||||
test("dispose with non Backbone objects", 0, function() {
|
||||
var view = new Backbone.View({model: {}, collection: {}});
|
||||
view.dispose();
|
||||
});
|
||||
|
||||
test("view#remove calls dispose.", 1, function() {
|
||||
var view = new Backbone.View();
|
||||
|
||||
view.dispose = function() { ok(true); };
|
||||
view.remove();
|
||||
});
|
||||
|
||||
test("Provide function for el.", 1, function() {
|
||||
@@ -364,16 +339,16 @@ $(document).ready(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);
|
||||
|
||||
4
vendor/benchmark.js/LICENSE.txt
vendored
@@ -1,4 +1,4 @@
|
||||
Copyright 2010-2012 Mathias Bynens <http://mathiasbynens.be/>
|
||||
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/>
|
||||
|
||||
@@ -19,4 +19,4 @@ 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.
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
36
vendor/benchmark.js/README.md
vendored
@@ -15,13 +15,16 @@ For a list of upcoming features, check out our [roadmap](https://github.com/best
|
||||
|
||||
## Support
|
||||
|
||||
Benchmark.js has been tested in at least Adobe AIR 3.1, Chrome 5-21, Firefox 1-15, IE 6-9, Opera 9.25-12, Safari 3-6, Node.js 0.8.8, Narwhal 0.3.2, RingoJS 0.8, and Rhino 1.7RC5.
|
||||
Benchmark.js has been tested in at least Chrome 5~27, Firefox 2~21, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.10.7, Narwhal 0.3.2, PhantomJS 1.9.0, RingoJS 0.9, and Rhino 1.7RC5.
|
||||
|
||||
## Installation and usage
|
||||
|
||||
In a browser or Adobe AIR:
|
||||
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>
|
||||
```
|
||||
|
||||
@@ -68,25 +71,14 @@ load('benchmark.js');
|
||||
In an AMD loader like [RequireJS](http://requirejs.org/):
|
||||
|
||||
```js
|
||||
require({
|
||||
'paths': {
|
||||
'benchmark': 'path/to/benchmark'
|
||||
}
|
||||
},
|
||||
['benchmark'], function(Benchmark) {
|
||||
console.log(Benchmark.version);
|
||||
});
|
||||
|
||||
// or with platform.js
|
||||
// https://github.com/bestiejs/platform.js
|
||||
require({
|
||||
'paths': {
|
||||
'benchmark': 'path/to/benchmark',
|
||||
'lodash': 'path/to/lodash',
|
||||
'platform': 'path/to/platform'
|
||||
}
|
||||
},
|
||||
['benchmark', 'platform'], function(Benchmark, platform) {
|
||||
Benchmark.platform = platform;
|
||||
['benchmark'], function(Benchmark) {
|
||||
console.log(Benchmark.platform.name);
|
||||
});
|
||||
```
|
||||
@@ -121,16 +113,16 @@ suite.add('RegExp#test', function() {
|
||||
|
||||
## 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.
|
||||
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
|
||||
|
||||
* [Mathias Bynens](http://mathiasbynens.be/)
|
||||
[](https://twitter.com/mathias "Follow @mathias on Twitter")
|
||||
* [John-David Dalton](http://allyoucanleet.com/)
|
||||
[](https://twitter.com/jdalton "Follow @jdalton on Twitter")
|
||||
| [](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
|
||||
|
||||
* [Kit Cambridge](http://kitcambridge.github.com/)
|
||||
[](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter")
|
||||
| [](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") |
|
||||
|---|
|
||||
| [Kit Cambridge](http://kitcambridge.github.io/) |
|
||||
|
||||
6481
vendor/benchmark.js/benchmark.js
vendored
2
vendor/docdown/LICENSE.txt
vendored
@@ -1,4 +1,4 @@
|
||||
Copyright 2011-2012 John-David Dalton <http://allyoucanleet.com/>
|
||||
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
|
||||
|
||||
10
vendor/docdown/README.md
vendored
@@ -24,10 +24,12 @@ $markdown = docdown(array(
|
||||
|
||||
## Author
|
||||
|
||||
* [John-David Dalton](http://allyoucanleet.com/)
|
||||
[](https://twitter.com/jdalton "Follow @jdalton on Twitter")
|
||||
| [](http://twitter.com/jdalton "Follow @jdalton on Twitter") |
|
||||
|---|
|
||||
| [John-David Dalton](http://allyoucanleet.com/) |
|
||||
|
||||
## Contributors
|
||||
|
||||
* [Mathias Bynens](http://mathiasbynens.be/)
|
||||
[](https://twitter.com/mathias "Follow @mathias on Twitter")
|
||||
| [](http://twitter.com/mathias "Follow @mathias on Twitter") |
|
||||
|---|
|
||||
| [Mathias Bynens](http://mathiasbynens.be/) |
|
||||
|
||||
2
vendor/docdown/docdown.php
vendored
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*!
|
||||
* Docdown v1.0.0-pre
|
||||
* Copyright 2011-2012 John-David Dalton <http://allyoucanleet.com/>
|
||||
* Copyright 2011-2013 John-David Dalton <http://allyoucanleet.com/>
|
||||
* Available under MIT license <http://mths.be/mit>
|
||||
*/
|
||||
require(dirname(__FILE__) . '/src/DocDown/Generator.php');
|
||||
|
||||
119
vendor/docdown/src/DocDown/Alias.php
vendored
@@ -29,15 +29,16 @@ class Alias {
|
||||
$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();
|
||||
$this->_isCtor = $owner->isCtor();
|
||||
$this->_isPlugin = $owner->isPlugin();
|
||||
$this->_isPrivate = $owner->isPrivate();
|
||||
$this->_isStatic = $owner->isStatic();
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
@@ -96,6 +97,66 @@ class Alias {
|
||||
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.
|
||||
*
|
||||
@@ -161,55 +222,5 @@ class Alias {
|
||||
public function getType() {
|
||||
return $this->_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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* 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;
|
||||
}
|
||||
}
|
||||
?>
|
||||
218
vendor/docdown/src/DocDown/Entry.php
vendored
@@ -58,7 +58,7 @@ class Entry {
|
||||
* @returns {Array} The array of entries.
|
||||
*/
|
||||
public static function getEntries( $source ) {
|
||||
preg_match_all('#/\*\*(?![-!])[\s\S]*?\*/\s*[^\n]+#', $source, $result);
|
||||
preg_match_all('#/\*\*(?![-!])[\s\S]*?\*/\s*.+#', $source, $result);
|
||||
return array_pop($result);
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ class Entry {
|
||||
$this->isCtor() ||
|
||||
count($this->getParams()) ||
|
||||
count($this->getReturns()) ||
|
||||
preg_match('/\* *@function\b/', $this->entry)
|
||||
preg_match('/\*[\t ]*@function\b/', $this->entry)
|
||||
);
|
||||
}
|
||||
return $this->_isFunction;
|
||||
@@ -94,10 +94,10 @@ class Entry {
|
||||
*/
|
||||
public function getAliases( $index = null ) {
|
||||
if (!isset($this->_aliases)) {
|
||||
preg_match('#\* *@alias\s+([^\n]+)#', $this->entry, $result);
|
||||
preg_match('#\*[\t ]*@alias\s+(.+)#', $this->entry, $result);
|
||||
|
||||
if (count($result)) {
|
||||
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
|
||||
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
|
||||
$result = preg_split('/,\s*/', $result);
|
||||
natsort($result);
|
||||
|
||||
@@ -129,7 +129,7 @@ class Entry {
|
||||
}
|
||||
// resolve name
|
||||
// avoid $this->getName() because it calls $this->getCall()
|
||||
preg_match('#\* *@name\s+([^\n]+)#', $this->entry, $name);
|
||||
preg_match('#\*[\t ]*@name\s+(.+)#', $this->entry, $name);
|
||||
if (count($name)) {
|
||||
$name = trim($name[1]);
|
||||
} else {
|
||||
@@ -163,9 +163,9 @@ class Entry {
|
||||
return $this->_category;
|
||||
}
|
||||
|
||||
preg_match('#\* *@category\s+([^\n]+)#', $this->entry, $result);
|
||||
preg_match('#\*[\t ]*@category\s+(.+)#', $this->entry, $result);
|
||||
if (count($result)) {
|
||||
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
|
||||
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
|
||||
} else {
|
||||
$result = $this->getType() == 'Function' ? 'Methods' : 'Properties';
|
||||
}
|
||||
@@ -187,7 +187,10 @@ class Entry {
|
||||
preg_match('#/\*\*(?:\s*\*)?([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
|
||||
if (count($result)) {
|
||||
$type = $this->getType();
|
||||
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
|
||||
$result = preg_replace('/:\n[\t ]*\*[\t ]*/', ":<br>\n", $result[1]);
|
||||
$result = preg_replace('/(?:^|\n)[\t ]*\*\n[\t ]*\*[\t ]*/', "\n\n", $result);
|
||||
$result = preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result);
|
||||
$result = trim($result);
|
||||
$result = ($type == 'Function' ? '' : '(' . str_replace('|', ', ', trim($type, '{}')) . '): ') . $result;
|
||||
}
|
||||
$this->_desc = $result;
|
||||
@@ -205,15 +208,109 @@ class Entry {
|
||||
return $this->_example;
|
||||
}
|
||||
|
||||
preg_match('#\* *@example\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
|
||||
preg_match('#\*[\t ]*@example\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
|
||||
if (count($result)) {
|
||||
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', "\n", $result[1]));
|
||||
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', "\n", $result[1]));
|
||||
$result = '```' . $this->lang . "\n" . $result . "\n```";
|
||||
}
|
||||
$this->_example = $result;
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the entry is an alias.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {Boolean} Returns `false`.
|
||||
*/
|
||||
public function isAlias() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the entry is a constructor.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {Boolean} Returns `true` if a constructor, else `false`.
|
||||
*/
|
||||
public function isCtor() {
|
||||
if (!isset($this->_isCtor)) {
|
||||
$this->_isCtor = !!preg_match('/\*[\t ]*@constructor\b/', $this->entry);
|
||||
}
|
||||
return $this->_isCtor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the entry is a license.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {Boolean} Returns `true` if a license, else `false`.
|
||||
*/
|
||||
public function isLicense() {
|
||||
if (!isset($this->_isLicense)) {
|
||||
$this->_isLicense = !!preg_match('/\*[\t ]*@license\b/', $this->entry);
|
||||
}
|
||||
return $this->_isLicense;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the entry *is* assigned to a prototype.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {Boolean} Returns `true` if assigned to a prototype, else `false`.
|
||||
*/
|
||||
public function isPlugin() {
|
||||
if (!isset($this->_isPlugin)) {
|
||||
$this->_isPlugin = !$this->isCtor() && !$this->isPrivate() && !$this->isStatic();
|
||||
}
|
||||
return $this->_isPlugin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the entry is private.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {Boolean} Returns `true` if private, else `false`.
|
||||
*/
|
||||
public function isPrivate() {
|
||||
if (!isset($this->_isPrivate)) {
|
||||
$this->_isPrivate = $this->isLicense() || !!preg_match('/\*[\t ]*@private\b/', $this->entry) || !preg_match('/\*[\t ]*@[a-z]+\b/', $this->entry);
|
||||
}
|
||||
return $this->_isPrivate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the entry is *not* assigned to a prototype.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {Boolean} Returns `true` if not assigned to a prototype, else `false`.
|
||||
*/
|
||||
public function isStatic() {
|
||||
if (isset($this->_isStatic)) {
|
||||
return $this->_isStatic;
|
||||
}
|
||||
|
||||
$public = !$this->isPrivate();
|
||||
$result = $public && !!preg_match('/\*[\t ]*@static\b/', $this->entry);
|
||||
|
||||
// set in cases where it isn't explicitly stated
|
||||
if ($public && !$result) {
|
||||
if ($parent = array_pop(preg_split('/[#.]/', $this->getMembers(0)))) {
|
||||
foreach (Entry::getEntries($this->source) as $entry) {
|
||||
$entry = new Entry($entry, $this->source);
|
||||
if ($entry->getName() == $parent) {
|
||||
$result = !$entry->isCtor();
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$result = true;
|
||||
}
|
||||
}
|
||||
$this->_isStatic = $result;
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves the entry's line number.
|
||||
*
|
||||
@@ -237,9 +334,9 @@ class Entry {
|
||||
*/
|
||||
public function getMembers( $index = null ) {
|
||||
if (!isset($this->_members)) {
|
||||
preg_match('#\* *@member(?:Of)?\s+([^\n]+)#', $this->entry, $result);
|
||||
preg_match('#\*[\t ]*@member(?:Of)?\s+(.+)#', $this->entry, $result);
|
||||
if (count($result)) {
|
||||
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
|
||||
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
|
||||
$result = preg_split('/,\s*/', $result);
|
||||
natsort($result);
|
||||
}
|
||||
@@ -261,9 +358,9 @@ class Entry {
|
||||
return $this->_name;
|
||||
}
|
||||
|
||||
preg_match('#\* *@name\s+([^\n]+)#', $this->entry, $result);
|
||||
preg_match('#\*[\t ]*@name\s+(.+)#', $this->entry, $result);
|
||||
if (count($result)) {
|
||||
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
|
||||
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
|
||||
} else {
|
||||
$result = array_shift(explode('(', $this->getCall()));
|
||||
}
|
||||
@@ -280,7 +377,7 @@ class Entry {
|
||||
*/
|
||||
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);
|
||||
preg_match_all('#\*[\t ]*@param\s+\{([^}]+)\}\s+(\[.+\]|[$\w|]+(?:\[.+\])?)\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#i', $this->entry, $result);
|
||||
if (count($result = array_filter(array_slice($result, 1)))) {
|
||||
// repurpose array
|
||||
foreach ($result as $param) {
|
||||
@@ -288,7 +385,7 @@ class Entry {
|
||||
if (!is_array($result[0][$key])) {
|
||||
$result[0][$key] = array();
|
||||
}
|
||||
$result[0][$key][] = trim(preg_replace('/(?:^|\n)\s*\* */', ' ', $value));
|
||||
$result[0][$key][] = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]*/', ' ', $value));
|
||||
}
|
||||
}
|
||||
$result = $result[0];
|
||||
@@ -311,11 +408,11 @@ class Entry {
|
||||
return $this->_returns;
|
||||
}
|
||||
|
||||
preg_match('#\* *@returns\s+\{([^}]+)\}\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
|
||||
preg_match('#\*[\t ]*@returns\s+\{([^}]+)\}\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
|
||||
if (count($result)) {
|
||||
$result = array_map('trim', array_slice($result, 1));
|
||||
$result[0] = str_replace('|', ', ', $result[0]);
|
||||
$result[1] = preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]);
|
||||
$result[1] = preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]);
|
||||
}
|
||||
$this->_returns = $result;
|
||||
return $result;
|
||||
@@ -332,95 +429,14 @@ class Entry {
|
||||
return $this->_type;
|
||||
}
|
||||
|
||||
preg_match('#\* *@type\s+([^\n]+)#', $this->entry, $result);
|
||||
preg_match('#\*[\t ]*@type\s+(.+)#', $this->entry, $result);
|
||||
if (count($result)) {
|
||||
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
|
||||
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
|
||||
} else {
|
||||
$result = $this->isFunction() ? 'Function' : 'Unknown';
|
||||
}
|
||||
$this->_type = $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* 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 = !!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;
|
||||
}
|
||||
}
|
||||
?>
|
||||
8
vendor/docdown/src/DocDown/Generator.php
vendored
@@ -121,7 +121,7 @@ class Generator {
|
||||
$string = preg_replace('/(^|\s)(\([^)]+\))/', '$1*$2*', $string);
|
||||
|
||||
// mark numbers as inline code
|
||||
$string = preg_replace('/ (-?\d+(?:.\d+)?)(?!\.[^\n])/', ' `$1`', $string);
|
||||
$string = preg_replace('/[\t ](-?\d+(?:.\d+)?)(?!\.[^\n])/', ' `$1`', $string);
|
||||
|
||||
// detokenize inline code snippets
|
||||
$counter = 0;
|
||||
@@ -321,9 +321,7 @@ class Generator {
|
||||
|
||||
$api[$member] = $entry;
|
||||
foreach ($entry->getAliases() as $alias) {
|
||||
$api[$member] = $alias;
|
||||
$alias->static = array();
|
||||
$alias->plugin = array();
|
||||
$api[$member]->static[] = $alias;
|
||||
}
|
||||
}
|
||||
else if ($entry->isStatic()) {
|
||||
@@ -559,7 +557,7 @@ class Generator {
|
||||
array_push($result, $closeTag, $closeTag, '', ' [1]: #' . $toc . ' "Jump back to the TOC."');
|
||||
|
||||
// cleanup whitespace
|
||||
return trim(preg_replace('/ +\n/', "\n", join($result, "\n")));
|
||||
return trim(preg_replace('/[\t ]+\n/', "\n", join($result, "\n")));
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
0
vendor/firebug-lite/license.txt
vendored
Normal file → Executable file
0
vendor/firebug-lite/skin/xp/blank.gif
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 43 B After Width: | Height: | Size: 43 B |
0
vendor/firebug-lite/skin/xp/buttonBg.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 167 B After Width: | Height: | Size: 167 B |
0
vendor/firebug-lite/skin/xp/buttonBgHover.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 171 B After Width: | Height: | Size: 171 B |
0
vendor/firebug-lite/skin/xp/debugger.css
vendored
Normal file → Executable file
0
vendor/firebug-lite/skin/xp/detach.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 655 B After Width: | Height: | Size: 655 B |
0
vendor/firebug-lite/skin/xp/detachHover.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 586 B After Width: | Height: | Size: 586 B |
0
vendor/firebug-lite/skin/xp/disable.gif
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 340 B After Width: | Height: | Size: 340 B |
0
vendor/firebug-lite/skin/xp/disable.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 543 B After Width: | Height: | Size: 543 B |
0
vendor/firebug-lite/skin/xp/disableHover.gif
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 344 B After Width: | Height: | Size: 344 B |
0
vendor/firebug-lite/skin/xp/disableHover.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 512 B After Width: | Height: | Size: 512 B |
0
vendor/firebug-lite/skin/xp/down.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 637 B After Width: | Height: | Size: 637 B |
0
vendor/firebug-lite/skin/xp/downActive.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 543 B After Width: | Height: | Size: 543 B |
0
vendor/firebug-lite/skin/xp/downHover.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 526 B After Width: | Height: | Size: 526 B |
0
vendor/firebug-lite/skin/xp/errorIcon-sm.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 447 B After Width: | Height: | Size: 447 B |
0
vendor/firebug-lite/skin/xp/errorIcon.gif
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 365 B After Width: | Height: | Size: 365 B |
0
vendor/firebug-lite/skin/xp/errorIcon.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 457 B After Width: | Height: | Size: 457 B |
28
vendor/firebug-lite/skin/xp/firebug-1.3a2.css
vendored
Normal file → Executable file
@@ -70,7 +70,7 @@ html, body {
|
||||
body {
|
||||
font-family: Lucida Grande, Tahoma, sans-serif;
|
||||
font-size: 11px;
|
||||
background: #fff;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.clear {
|
||||
@@ -103,7 +103,7 @@ body {
|
||||
border: 1px solid #ccc;
|
||||
margin: 0 5px 0 0;
|
||||
background: #fff url(search.png) no-repeat 4px 2px;
|
||||
padding-left: 20px;
|
||||
padding-left: 20px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ body {
|
||||
height: 14px;
|
||||
background: url(errorIcon.png) no-repeat;
|
||||
color: #f00;
|
||||
font-weight: bold;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#fbMiniErrors {
|
||||
@@ -139,7 +139,7 @@ body {
|
||||
margin: 3px 4px 0;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
float: right;
|
||||
float: right;
|
||||
background: url(sprite.png) 0 -135px;
|
||||
cursor: pointer;
|
||||
}
|
||||
@@ -192,10 +192,10 @@ body {
|
||||
}
|
||||
|
||||
/************************************************************************************************
|
||||
Sub-Layout
|
||||
Sub-Layout
|
||||
*************************************************************************************************/
|
||||
|
||||
/* fbToolbar
|
||||
/* fbToolbar
|
||||
*************************************************************************************************/
|
||||
#fbToolbarIcon {
|
||||
float: left;
|
||||
@@ -237,7 +237,7 @@ body {
|
||||
position: relative;
|
||||
top: 5px;
|
||||
line-height: 19px;
|
||||
cursor: default;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.fbToolbarSeparator{
|
||||
@@ -262,7 +262,7 @@ body {
|
||||
|
||||
.fbStatusBar span a:hover {
|
||||
color: blue;
|
||||
cursor: pointer;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
||||
@@ -307,7 +307,7 @@ body {
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
/* body
|
||||
/* body
|
||||
*************************************************************************************************/
|
||||
.fbPanel {
|
||||
display: none;
|
||||
@@ -340,7 +340,7 @@ body {
|
||||
visibility: hidden !important;
|
||||
}
|
||||
|
||||
/* fbBottom
|
||||
/* fbBottom
|
||||
*************************************************************************************************/
|
||||
|
||||
#fbCommand {
|
||||
@@ -391,7 +391,7 @@ div.fbFitHeight {
|
||||
Layout Controls
|
||||
*************************************************************************************************/
|
||||
|
||||
/* fbToolbar buttons
|
||||
/* fbToolbar buttons
|
||||
*************************************************************************************************/
|
||||
#fbWindowButtons a {
|
||||
font-size: 1px;
|
||||
@@ -420,7 +420,7 @@ div.fbFitHeight {
|
||||
background: url(sprite.png) -48px -119px;
|
||||
}
|
||||
|
||||
/* fbPanelBarBox tabs
|
||||
/* fbPanelBarBox tabs
|
||||
*************************************************************************************************/
|
||||
.fbTab {
|
||||
text-decoration: none;
|
||||
@@ -475,7 +475,7 @@ a.fbTab:hover .fbTabR {
|
||||
background: url(sprite.png) -8px -96px !important;
|
||||
}
|
||||
|
||||
/* splitters
|
||||
/* splitters
|
||||
*************************************************************************************************/
|
||||
#fbHSplitter {
|
||||
position: absolute;
|
||||
@@ -571,7 +571,7 @@ div.objectBox-element {
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
/* Webkit CSS Hack - bug in "highlight" named color */
|
||||
/* Webkit CSS Hack - bug in "highlight" named color */
|
||||
@media screen and (-webkit-min-device-pixel-ratio:0) {
|
||||
.selectedElement{
|
||||
background: #316AC5;
|
||||
|
||||
0
vendor/firebug-lite/skin/xp/firebug.IE6.css
vendored
Normal file → Executable file
68
vendor/firebug-lite/skin/xp/firebug.css
vendored
Normal file → Executable file
@@ -136,10 +136,10 @@ h1.groupHeader {
|
||||
position: relative;
|
||||
top: -7px;
|
||||
left: -5px;
|
||||
|
||||
|
||||
outline: none;
|
||||
resize: none;
|
||||
|
||||
|
||||
/*
|
||||
_border: 1px solid #999 !important;
|
||||
_padding: 1px !important;
|
||||
@@ -311,17 +311,17 @@ h1.groupHeader {
|
||||
outline: none;
|
||||
background-color: transparent
|
||||
}
|
||||
|
||||
.useA11y .a11yCSSView .focusRow:focus .cssSelector,
|
||||
.useA11y .a11yCSSView .focusRow:focus .cssPropName,
|
||||
|
||||
.useA11y .a11yCSSView .focusRow:focus .cssSelector,
|
||||
.useA11y .a11yCSSView .focusRow:focus .cssPropName,
|
||||
.useA11y .a11yCSSView .focusRow:focus .cssPropValue,
|
||||
.useA11y .a11yCSSView .computedStyleRow:focus,
|
||||
.useA11y .a11yCSSView .computedStyleRow:focus,
|
||||
.useA11y .a11yCSSView .groupHeader:focus {
|
||||
outline: 2px solid #FF9933;
|
||||
outline-offset: -2px;
|
||||
background-color: #FFFFD6;
|
||||
}
|
||||
|
||||
|
||||
.useA11y .a11yCSSView .groupHeader:focus {
|
||||
outline-offset: -2px;
|
||||
}
|
||||
@@ -731,7 +731,7 @@ h1.groupHeader {
|
||||
/* Time Info tip */
|
||||
|
||||
.timeInfoTip {
|
||||
width: 150px;
|
||||
width: 150px;
|
||||
height: 40px
|
||||
}
|
||||
|
||||
@@ -944,7 +944,7 @@ h1.groupHeader {
|
||||
/*overflow-x: auto; HTML is damaged in case of big (2-3MB) responses */
|
||||
}
|
||||
|
||||
/* replaced by .netInfoTextSelected for IE6 support
|
||||
/* replaced by .netInfoTextSelected for IE6 support
|
||||
.netInfoText[selected="true"] {
|
||||
display: block;
|
||||
}
|
||||
@@ -963,7 +963,7 @@ h1.groupHeader {
|
||||
}
|
||||
|
||||
.netInfoPostText .netInfoParamName {
|
||||
width: 1px; /* Google Chrome need this otherwise the first column of
|
||||
width: 1px; /* Google Chrome need this otherwise the first column of
|
||||
the post variables table will be larger than expected */
|
||||
}
|
||||
|
||||
@@ -1148,7 +1148,7 @@ h1.groupHeader {
|
||||
}
|
||||
|
||||
* html .opened .spyHead .spyTitle,
|
||||
* html .opened .logGroupLabel,
|
||||
* html .opened .logGroupLabel,
|
||||
* html .opened .memberLabelCell .memberLabel {
|
||||
background-image: url(tree_close.gif);
|
||||
background-repeat: no-repeat;
|
||||
@@ -1677,7 +1677,7 @@ h1.groupHeader {
|
||||
/*
|
||||
.logRow-errorMessage > .hasTwisty > .errorTitle,
|
||||
.logRow-spy .spyHead .spyTitle,
|
||||
.logGroup > .logRow
|
||||
.logGroup > .logRow
|
||||
*/
|
||||
.logRow-errorMessage .hasTwisty .errorTitle,
|
||||
.logRow-spy .spyHead .spyTitle,
|
||||
@@ -2056,11 +2056,11 @@ h1.groupHeader {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
margin-top: 6px;
|
||||
background: url(tabMenuTarget.png);
|
||||
background: url(tabMenuTarget.png);
|
||||
}
|
||||
|
||||
.fbTabMenuTarget:hover {
|
||||
background: url(tabMenuTargetHover.png);
|
||||
background: url(tabMenuTargetHover.png);
|
||||
}
|
||||
|
||||
.fbShadow {
|
||||
@@ -2098,7 +2098,7 @@ h1.groupHeader {
|
||||
padding: 1px 18px 0;
|
||||
text-decoration: none;
|
||||
color: #000;
|
||||
cursor: default;
|
||||
cursor: default;
|
||||
background: #ACA899;
|
||||
margin: 4px 0;
|
||||
}
|
||||
@@ -2149,7 +2149,7 @@ h1.groupHeader {
|
||||
}
|
||||
|
||||
.fbMenuShortcut {
|
||||
padding-right: 85px;
|
||||
padding-right: 85px;
|
||||
}
|
||||
|
||||
.fbMenuShortcutKey {
|
||||
@@ -2274,7 +2274,7 @@ h1.groupHeader {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
|
||||
|
||||
font-family: Lucida Grande, Tahoma, sans-serif;
|
||||
font-size: 11px;
|
||||
background: #fff;
|
||||
@@ -2311,7 +2311,7 @@ h1.groupHeader {
|
||||
margin: 0 5px 0 0;
|
||||
background: #fff url(search.png) no-repeat 4px 2px !important;
|
||||
background: #fff url(search.gif) no-repeat 4px 2px;
|
||||
padding-left: 20px;
|
||||
padding-left: 20px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
@@ -2333,7 +2333,7 @@ h1.groupHeader {
|
||||
background: url(errorIcon.png) no-repeat !important;
|
||||
background: url(errorIcon.gif) no-repeat;
|
||||
color: #f00;
|
||||
font-weight: bold;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#fbMiniErrors {
|
||||
@@ -2348,7 +2348,7 @@ h1.groupHeader {
|
||||
margin: 3px 4px 0;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
float: right;
|
||||
float: right;
|
||||
background: url(sprite.png) 0 -135px;
|
||||
cursor: pointer;
|
||||
}
|
||||
@@ -2403,10 +2403,10 @@ h1.groupHeader {
|
||||
}
|
||||
|
||||
/************************************************************************************************
|
||||
Sub-Layout
|
||||
Sub-Layout
|
||||
*************************************************************************************************/
|
||||
|
||||
/* fbToolbar
|
||||
/* fbToolbar
|
||||
*************************************************************************************************/
|
||||
#fbToolbarIcon {
|
||||
float: left;
|
||||
@@ -2472,7 +2472,7 @@ h1.groupHeader {
|
||||
|
||||
#fbStatusBarBox {
|
||||
top: 4px;
|
||||
cursor: default;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.fbToolbarSeparator {
|
||||
@@ -2500,7 +2500,7 @@ h1.groupHeader {
|
||||
|
||||
.fbStatusBar a:hover {
|
||||
color: blue;
|
||||
cursor: pointer;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
||||
@@ -2545,7 +2545,7 @@ h1.groupHeader {
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
/* body
|
||||
/* body
|
||||
*************************************************************************************************/
|
||||
.fbPanel {
|
||||
display: none;
|
||||
@@ -2609,7 +2609,7 @@ h1.groupHeader {
|
||||
position: absolute;
|
||||
right: 2px;
|
||||
bottom: 3px;
|
||||
|
||||
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
@@ -2624,7 +2624,7 @@ h1.groupHeader {
|
||||
visibility: hidden !important;
|
||||
}
|
||||
|
||||
/* fbBottom
|
||||
/* fbBottom
|
||||
*************************************************************************************************/
|
||||
|
||||
#fbCommand {
|
||||
@@ -2689,7 +2689,7 @@ div.fbFitHeight {
|
||||
Layout Controls
|
||||
*************************************************************************************************/
|
||||
|
||||
/* fbToolbar buttons
|
||||
/* fbToolbar buttons
|
||||
*************************************************************************************************/
|
||||
.fbSmallButton {
|
||||
overflow: hidden;
|
||||
@@ -2729,7 +2729,7 @@ div.fbFitHeight {
|
||||
}
|
||||
|
||||
|
||||
/* fbPanelBarBox tabs
|
||||
/* fbPanelBarBox tabs
|
||||
*************************************************************************************************/
|
||||
.fbTab {
|
||||
text-decoration: none;
|
||||
@@ -2785,7 +2785,7 @@ a.fbTab:hover .fbTabR {
|
||||
background: url(sprite.png) -8px -96px !important;
|
||||
}
|
||||
|
||||
/* splitters
|
||||
/* splitters
|
||||
*************************************************************************************************/
|
||||
#fbHSplitter {
|
||||
position: fixed;
|
||||
@@ -2888,7 +2888,7 @@ div.objectBox-element {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* Webkit CSS Hack - bug in "highlight" named color */
|
||||
/* Webkit CSS Hack - bug in "highlight" named color */
|
||||
@media screen and (-webkit-min-device-pixel-ratio:0) {
|
||||
.selectedElement{
|
||||
background: #316AC5;
|
||||
@@ -2903,7 +2903,7 @@ div.objectBox-element {
|
||||
}
|
||||
|
||||
/* TODO: remove this? */
|
||||
/* TODO: xxxpedro - IE need this in windowless mode (cnn.com) check if the issue is related to
|
||||
/* TODO: xxxpedro - IE need this in windowless mode (cnn.com) check if the issue is related to
|
||||
position. if so, override it at chrome.js initialization when creating the div */
|
||||
.logRow {
|
||||
position: relative;
|
||||
@@ -2939,9 +2939,9 @@ position. if so, override it at chrome.js initialization when creating the div *
|
||||
|
||||
.objectBox-string {
|
||||
color: red;
|
||||
|
||||
|
||||
/* TODO: xxxpedro make long strings break line */
|
||||
/*white-space: pre; */
|
||||
/*white-space: pre; */
|
||||
}
|
||||
|
||||
.objectBox-number {
|
||||
|
||||
80
vendor/firebug-lite/skin/xp/firebug.html
vendored
Normal file → Executable file
@@ -14,71 +14,71 @@
|
||||
<tr>
|
||||
<!-- Interface - Top Area -->
|
||||
<td id="fbTop" colspan="2">
|
||||
|
||||
<!--
|
||||
|
||||
<!--
|
||||
<div>
|
||||
--><!-- <span id="fbToolbarErrors" class="fbErrors">2 errors</span> --><!--
|
||||
--><!-- <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">
|
||||
@@ -112,7 +112,7 @@
|
||||
<!-- 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>
|
||||
@@ -131,18 +131,18 @@
|
||||
-->
|
||||
</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">
|
||||
@@ -150,41 +150,41 @@
|
||||
<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">
|
||||
@@ -193,18 +193,18 @@
|
||||
<a id="fbLargeCommandLineIcon" class="fbSmallButton fbHover"></a>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</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>
|
||||
|
||||
0
vendor/firebug-lite/skin/xp/firebug.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
0
vendor/firebug-lite/skin/xp/group.gif
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 158 B After Width: | Height: | Size: 158 B |
0
vendor/firebug-lite/skin/xp/html.css
vendored
Normal file → Executable file
0
vendor/firebug-lite/skin/xp/infoIcon.gif
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 359 B After Width: | Height: | Size: 359 B |
0
vendor/firebug-lite/skin/xp/infoIcon.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 524 B After Width: | Height: | Size: 524 B |
0
vendor/firebug-lite/skin/xp/loading_16.gif
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
0
vendor/firebug-lite/skin/xp/min.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 552 B After Width: | Height: | Size: 552 B |
0
vendor/firebug-lite/skin/xp/minHover.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 485 B After Width: | Height: | Size: 485 B |
0
vendor/firebug-lite/skin/xp/off.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 742 B After Width: | Height: | Size: 742 B |
0
vendor/firebug-lite/skin/xp/offHover.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 680 B After Width: | Height: | Size: 680 B |
0
vendor/firebug-lite/skin/xp/pixel_transparent.gif
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 43 B After Width: | Height: | Size: 43 B |
0
vendor/firebug-lite/skin/xp/roundCorner.svg
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 228 B After Width: | Height: | Size: 228 B |
0
vendor/firebug-lite/skin/xp/search.gif
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 550 B After Width: | Height: | Size: 550 B |
0
vendor/firebug-lite/skin/xp/search.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 685 B After Width: | Height: | Size: 685 B |
0
vendor/firebug-lite/skin/xp/shadow.gif
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
0
vendor/firebug-lite/skin/xp/shadow2.gif
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
0
vendor/firebug-lite/skin/xp/shadowAlpha.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
0
vendor/firebug-lite/skin/xp/sprite.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
0
vendor/firebug-lite/skin/xp/tabHoverLeft.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 438 B After Width: | Height: | Size: 438 B |
0
vendor/firebug-lite/skin/xp/tabHoverMid.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 261 B After Width: | Height: | Size: 261 B |
0
vendor/firebug-lite/skin/xp/tabHoverRight.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 436 B After Width: | Height: | Size: 436 B |