Compare commits

...

669 Commits
0.1.0 ... 0.8.2

Author SHA1 Message Date
John-David Dalton
219138ade6 Bump to v0.8.2.
Former-commit-id: edbb9d995a63ec8fd5a3b1a47ccda7b30c353b35
2012-10-10 00:03:39 -07:00
John-David Dalton
9086d189b9 Update vendors.
Former-commit-id: e88301bddf23f177a2d14f2c729877eaede022e5
2012-10-09 20:11:57 -07:00
Kit Cambridge
d1178defe0 Add a note about npm link. See #88.
Former-commit-id: 11c4a9bce02e5f143b09d0edff80362e2e824b10
2012-10-09 15:22:26 -07:00
John-David Dalton
691a561a95 Merge pull request #87 from danheberden/typo_fix
Fix typo in `_.indexOf` docs.

Former-commit-id: 25305344f272cb875a612e37a93ae252a53e1b4b
2012-10-09 13:56:59 -07:00
Dan Heberden
aaaac93bd0 fix tiny baby super small almost didn't need to worry about fixing typo from isSorted to fromIndex for indexOf method
Former-commit-id: 6f2a7b3e11c4830ec47c174f24badca3ef2e6530
2012-10-09 16:53:56 -04:00
John-David Dalton
fd790566b2 Ensure _.throttle clears the timeout when func is called. [closes #86]
Former-commit-id: 6f3b777aa247f059d97f965c02323d4ee6ab8464
2012-10-09 02:15:06 -07:00
John-David Dalton
db3b429784 Update _.min, _.max, _.shuffle build dependencies.
Former-commit-id: 21c4c99f8ead92b90b46c299fee59098131758b1
2012-10-09 01:43:24 -07:00
John-David Dalton
40ed3278d4 Rebuild minified files and docs.
Former-commit-id: b14af8d9fcb9046c2faf4374fe2e6e83c4f4f835
2012-10-09 01:02:14 -07:00
John-David Dalton
d174b13111 Add object iteration unit tests for _.max, _.min, _.shuffle.
Former-commit-id: 45129100fbbfa14610cacb055c1fa393ae6ce153
2012-10-09 00:59:55 -07:00
John-David Dalton
1708663b32 Move _.max, _.min, _.shuffle back to "Collections" methods for compat but still optimized for arrays.
Former-commit-id: 28cd9298915ad123445400a5d061ac8e9432eb6b
2012-10-09 00:48:02 -07:00
John-David Dalton
6fdce4ad0d Re-optimize _.max, _.min, and _.sortedIndex.
Former-commit-id: 7f449a4fde6777f14a1def0d767f2926bdea07c9
2012-10-09 00:17:10 -07:00
John-David Dalton
fff8d5f07d Cleanup var names in lodash.js and continue to optimize for gzip.
Former-commit-id: 00d76bd7ab8b35d2b45237224662849e42d00bac
2012-10-07 22:26:23 -07:00
John-David Dalton
9c8e1f4706 Reduce _.compact and revert _.random use in _.shuffle.
Former-commit-id: 17d153cb09c262830f1497f93c0f3d9b279c8f8a
2012-10-07 19:32:56 -07:00
John-David Dalton
0a1036c78f Add unit tests to check "Collections" methods return values.
Former-commit-id: 6ac6cd97414035f74a102a51e913099e744d9a93
2012-10-07 18:18:20 -07:00
John-David Dalton
0e881a7972 Simplify _.shuffle and iterator options.
Former-commit-id: 341fd577d65725d47b26172d25b46dec2ac8e67f
2012-10-07 17:43:38 -07:00
John-David Dalton
839e52ba30 Organize docs by category. [closes #84]
Former-commit-id: f4ebda7c32a0ce9c5a86cdb0fd1e689f76557e42
2012-10-07 12:21:01 -07:00
John-David Dalton
8f7d5dcb4d Reduce lodash file size.
Former-commit-id: c6c309cbbc5f93bffb852726e831ba9f90c332a0
2012-10-06 23:39:41 -07:00
John-David Dalton
1104b28bc1 Update README.md to remove fixed Underscore issue.
Former-commit-id: 16fc177c33c2f2522fd9080c0974091ef8e97850
2012-10-06 23:38:25 -07:00
John-David Dalton
48521cb1e4 Update DocDown and Underscore.
Former-commit-id: 7744ef274a9d8b47975dc9f3e3283bd778bc5403
2012-10-06 22:31:08 -07:00
John-David Dalton
17e113dafb Update _.map to return an empty array when falsey values are passed.
Former-commit-id: 2f091fbeb140cbc0b8f3bd2df7a449a06239be0b
2012-10-06 21:17:50 -07:00
John-David Dalton
c33825a904 Reduce Underscore build and update Underscore version number.
Former-commit-id: fd631cd5525fa287c2af493bfe4a93668678977d
2012-10-06 20:58:21 -07:00
John-David Dalton
b07ef98c8f Update Backbone/Underscore vendor folders.
Former-commit-id: 3317d501fe535d91eefab8a5dcb3a88a791e20ac
2012-10-06 20:56:42 -07:00
John-David Dalton
b3d68893df Reduce deep _.clone array iteration and add _.each dependency.
Former-commit-id: 3cb599d294a693974483b892748e6f60186d0c50
2012-10-06 18:15:30 -07:00
John-David Dalton
1329599987 Simplify how deep _.clone handles booleans.
Former-commit-id: adf1d03677336131da2f62bd2fb6e2900c9889a4
2012-10-06 17:32:18 -07:00
John-David Dalton
2adf3f364c Add _.isPlainObject to the list of features in README.md. [ci skip]
Former-commit-id: ec81cdc9e7fef775871cc1c4a497e4d17e7716aa
2012-10-06 15:45:48 -07:00
John-David Dalton
436ee34a02 Simplify createIterator.
Former-commit-id: 0530a9db49488900843c6312cc0d30b1dc641120
2012-10-06 14:43:34 -07:00
John-David Dalton
4a6e17b214 Reduce lodash builds and cleanup README.md.
Former-commit-id: 3c6bbc236a35687c843a8cb27c29f71ed89d0ab0
2012-10-04 23:35:36 -07:00
John-David Dalton
6e9cbccde6 Bump to v0.8.1.
Former-commit-id: 1b63f03d4a7ca0cdc66e44cd987fddecaf88f9ce
2012-10-04 01:40:17 -07:00
John-David Dalton
a0cb8ec124 Cleanup lodash.js.
Former-commit-id: 7a2443719a96b36ae53b2f7d0fe2a1867d650f02
2012-10-04 00:28:45 -07:00
John-David Dalton
21217dfda3 Reduce createIterator.
Former-commit-id: 8c27ca8e4d1f71b2727dd988bc62194510a850dc
2012-10-04 00:02:43 -07:00
John-David Dalton
25ba18e570 Update vendors.
Former-commit-id: 94bb6b8541c223d3ef6eb8aad5fb5925f2d3be48
2012-10-03 23:21:51 -07:00
John-David Dalton
a210377f35 Add unit tests for passing falsey values to _.initial and _.rest.
Former-commit-id: 9d5d4960c175a3dd90af977b605ce309bc6446d3
2012-10-03 20:12:03 -07:00
John-David Dalton
07b9ca457f Cleanup build.js regexes.
Former-commit-id: 0d23053cd8ae20fa2268ba24b15db72c6cd7a85e
2012-10-03 09:09:40 -07:00
John-David Dalton
5f1372d39c Rebuild minified files and docs.
Former-commit-id: d8d8453fa79ab026be0acd44a1af967bdb0bc4cc
2012-10-03 09:09:20 -07:00
John-David Dalton
01b84c79f0 Revert removing falsey guards.
Former-commit-id: b5eeb5d4a0896eb030f20e7e91e54bf101535abc
2012-10-03 09:08:51 -07:00
John-David Dalton
4017443b1e Allow deep clone if requested via include or plus with the underscore build.
Former-commit-id: e86dba41f7265700330e57346a112b578873b390
2012-10-02 21:39:18 -07:00
John-David Dalton
fd2a17d244 Reduce lodash.underscore.min.js.
Former-commit-id: a5032bc542e1166fab6acfd7313c305dd8236d36
2012-10-02 01:43:49 -07:00
John-David Dalton
126804f7c3 Cleanup _.difference, _.intersecton, _.without.
Former-commit-id: 1ca8edb52a1c403fc2d8a8e1b3fd113ced9ff39e
2012-10-02 01:43:30 -07:00
John-David Dalton
5167bbf59e Fix _.lateBind doc typo.
Former-commit-id: 3284bee699837ab380a3e8fd2853f8bdcf0684b6
2012-10-01 23:33:35 -07:00
John-David Dalton
8bcdfa2793 Add identitydependencies to build dependency map.
Former-commit-id: e466c8547888755b9e3d645d555298b21b5a6849
2012-10-01 08:31:23 -07:00
John-David Dalton
2f9cb6a91e Add more to .jamignore.
Former-commit-id: aaa51092bb28995478e4cf8cf1b5ff249880a99c
2012-09-30 23:29:43 -07:00
John-David Dalton
662be14535 Tweak whitespace in README.md and update QUnit-CLIB.
Former-commit-id: b8fed819580bf7db926b8a4cfb794aa7666c5f58
2012-09-30 23:06:40 -07:00
John-David Dalton
d6d065cd61 Cleanup settings=.. build option usage.
Former-commit-id: 33506d9cfc2101cba8d160169c5d27861f8c7064
2012-09-30 22:52:34 -07:00
John-David Dalton
ac7f045708 Correct bullets in README.md.
Former-commit-id: fb75befff853071b7ad5dde3f3a575c707930cc4
2012-09-30 22:47:29 -07:00
John-David Dalton
ffe02ad7bf Reduce the size of lodash.underscore.min.js.
Former-commit-id: fd7d512e104c6325a38a7d0e09015235ca69b1da
2012-09-30 22:36:57 -07:00
John-David Dalton
db1a87d10c Bump to v0.8.0.
Former-commit-id: b5bed986eed052cab3f927a928d92d58044a4798
2012-09-30 21:49:12 -07:00
John-David Dalton
4bae41ffd8 Use a better strict mode detect for tests.js so older versions of Node.js pass.
Former-commit-id: fd9f6ea35c71a8183ce0dcf4a6ec6e6afe13c39e
2012-09-30 21:45:50 -07:00
John-David Dalton
be36fb979f Make .jamignore ignore test-build.js and test/template/.
Former-commit-id: cc6e5e744e81cfb92ae46a4991a39b5c925a0727
2012-09-30 21:39:00 -07:00
John-David Dalton
0f66d763e0 No longer create/use the dist/ folder during the build process.
Former-commit-id: d8d298d5ce21032542d21c4d4fbc7e0112f6ad65
2012-09-30 15:05:17 -07:00
John-David Dalton
06f4743f51 Add lodash.underscore.min.js.
Former-commit-id: 15592a33a6f6979a1d60632a6ade3c341f13d0e7
2012-09-30 02:49:48 -07:00
John-David Dalton
9cc11b8774 Cleanup build files.
Former-commit-id: d19939a34688a8a63979f84eb1a5c5f9c926897b
2012-09-30 01:55:26 -07:00
John-David Dalton
de821e55ae Add template and settings build options unit tests and tweak _.template docs.
Former-commit-id: c814799c82e5a1dde60e5eda4dda5cb192d437f9
2012-09-30 01:03:43 -07:00
John-David Dalton
463b5c6e49 Tweak build option internals and add test template files.
Former-commit-id: ed5ec6ed7886a066c8c727de19dc0fe6548a276d
2012-09-30 00:57:09 -07:00
John-David Dalton
65ab5fdb34 Ensured failed tests trigger travis fails.
Former-commit-id: d513b5b1bae77ab1f4aa9e98ec3622e143048def
2012-09-29 19:54:39 -07:00
John-David Dalton
d2f7a035b3 Add test-build.js to npm test.
Former-commit-id: c915ba8401c1c1b11aa69d155cebe2a0a81eb2d1
2012-09-29 17:20:51 -07:00
John-David Dalton
bc0b924283 Reorganize tests.
Former-commit-id: 5293cdc1206af20824e8aec86b892afd4badf639
2012-09-29 16:42:13 -07:00
John-David Dalton
56ad6af5b2 Add travis integration.
Former-commit-id: 293478e5175ff94dab92bc340034d8d83e3e4773
2012-09-29 16:05:17 -07:00
John-David Dalton
c50bb3a5a9 Remove component.json and add index.js.
Former-commit-id: 16718a8ee6c4b6c834fe96feb58404311b82e3a0
2012-09-29 15:31:47 -07:00
John-David Dalton
d993a62263 Use invert to assign htmlUnescapes.
Former-commit-id: 20f9f29d622643e2f59bbc4a57fd2456c09ef49e
2012-09-29 14:36:23 -07:00
John-David Dalton
82bc52b909 Reduce underscore build size.
Former-commit-id: 207d4ab49063483245dc951d4646413d6d4a1903
2012-09-29 12:21:34 -07:00
John-David Dalton
f31598f916 Update README.md and rebuild minified file.
Former-commit-id: 0b37eebda0d1a82d0bb62cf2ba6e5b190e176547
2012-09-29 03:48:15 -07:00
John-David Dalton
6a9efd8ac6 Ensure build tests pass.
Former-commit-id: 9b91f0d884fe96dce1df34a6c0b659619276b83e
2012-09-29 03:41:00 -07:00
John-David Dalton
a9dddb6066 Update vendors.
Former-commit-id: 31e8de8842ed9ea020f54ca06cdb87b1478e3b08
2012-09-29 03:14:03 -07:00
John-David Dalton
40cf5c99ef Update reduce repeated code.
Former-commit-id: 3412cde47a136dab5c241c67d1c29f2e676c38d1
2012-09-29 03:13:45 -07:00
John-David Dalton
42f58cbbb3 Fix perf.js.
Former-commit-id: 4eef40ddbcb851aca3a87813a17dc329f9ecb071
2012-09-29 00:17:27 -07:00
John-David Dalton
fd9c780015 Reduce file size further.
Former-commit-id: 009540db12d86f0fb79ccd493b61c4fa2cdd9b1f
2012-09-28 07:58:16 -07:00
John-David Dalton
383b92b207 Update build.js, test-build.js and rebuild docs.
Former-commit-id: 385c6b4cb127ad8089622416758021556e413a0a
2012-09-28 02:14:59 -07:00
John-David Dalton
7036ed5e2f Remove falsey checks and reduce file size.
Former-commit-id: 5263a0beaffe2a987eb65fd3631ea4aff8d9f000
2012-09-28 00:46:57 -07:00
John-David Dalton
30666aa111 Update vendor.
Former-commit-id: 9f433cc31e3c70dddba332346c7d053539f54ab5
2012-09-27 20:53:49 -07:00
John-David Dalton
9614d68baa Cleanup test-build.js.
Former-commit-id: d6588b8cc7cebe0ce44392269cdda1ebd851f1ae
2012-09-26 23:08:19 -07:00
John-David Dalton
c25fb4c743 Merge branch 'master' of github.com:bestiejs/lodash
Former-commit-id: a8dbad27cb89e403dbdafcc7cc69a397ae1e5bbd
2012-09-26 22:31:18 -07:00
John-David Dalton
09d5222b1f Allow _.sortedIndex to accept a string value.
Former-commit-id: 7ac17a6bb620ad16ecce17718a8110d422d49118
2012-09-26 22:30:15 -07:00
John-David Dalton
426ca78bf7 Update vendors.
Former-commit-id: 48e14b4b41c9b26382b09294127e552a794e49be
2012-09-26 20:42:52 -07:00
Kit Cambridge
a77a0945fe Add tests for the -d and -m options.
Former-commit-id: def5bcf323aaed96c037fea3e15c4a5c8c72a977
2012-09-26 09:26:40 -06:00
Kit Cambridge
5311a0f903 Allow the -d option to be used independently.
Former-commit-id: cb838b158edb8360d6d7c98ee18f2a7fbb4e9bb4
2012-09-26 08:59:33 -06:00
John-David Dalton
d421656be8 Cleanup build exports options.
Former-commit-id: 75a5f57c0c9f71067cf6d55006f59fa0296a82e2
2012-09-25 23:06:30 -07:00
John-David Dalton
04459eaa50 Remove internal skipArgsCheck from _.isPlainObject and add unit tests.
Former-commit-id: 213c1e95f61368eb8912850248a97f44664384d8
2012-09-25 09:05:09 -07:00
John-David Dalton
3beda8eea0 Add _ references to precompiled templates.
Former-commit-id: 4a6f38ec03790d647de4923262bba8d73378ce14
2012-09-25 02:10:35 -07:00
Mathias Bynens
5e894be06b Fix typo
Former-commit-id: b9fa32da8453a1a928b16bc712a9f2ec53722341
2012-09-24 15:22:55 +03:00
John-David Dalton
bc8f93b596 Remove internal params from built docs.
Former-commit-id: 8b0be9d888ef88dae74554101463f4fa8d268dbc
2012-09-24 01:15:46 -07:00
John-David Dalton
2fb93bac99 Use a different private indicator for _.merge now that isPlainObject is exposed.
Former-commit-id: 5c75de935eb3e5e9e035bd6520398c7fbd811ea6
2012-09-24 01:06:58 -07:00
John-David Dalton
d0c94c1aef Cleanup template build option.
Former-commit-id: 38b94dad822dd9030a6a71f66e65ff7aec0726cc
2012-09-24 00:03:41 -07:00
John-David Dalton
77242bfb95 Expose _.isPlainObject.
Former-commit-id: 884bc87df7773ef3cb5e52725d5a37f07812385a
2012-09-23 21:30:14 -07:00
John-David Dalton
5d2d86bffc Initial lodash template=… build support.
Former-commit-id: 9d13021463380556a997cb53f5ae89eb22a7b98b
2012-09-23 21:29:20 -07:00
John-David Dalton
8492c13e72 Remove DRY modifications for smaller gzip size.
Former-commit-id: 69391d792d76c6592e7d48aec44165a8db388f81
2012-09-22 20:50:59 -07:00
John-David Dalton
e4eb5dadda Modify "underscore" build methods in prep for Underscore.next.
Former-commit-id: 22503a046256915aa6667e32f6efb992c6ddbce9
2012-09-22 20:03:43 -07:00
John-David Dalton
8532dc4b75 Refactor reduceRight and modify a _.difference benchmark.
Former-commit-id: b70272ac5316fe1bee52b9611a1a5ea4d761dd3c
2012-09-22 16:11:23 -07:00
John-David Dalton
1ca26ce676 Ensure methods accepting a thisArg argument allow null values.
Former-commit-id: 368b943687291f0d7ed02304284ac076ef86e02b
2012-09-22 15:39:37 -07:00
John-David Dalton
d8e3e823a7 Removed Underscore's fixed issues from README.md and rebuild docs.
Former-commit-id: 08db54926a791ab32b7e003143ae0f70a251068e
2012-09-20 21:13:36 -07:00
John-David Dalton
473dd7660b Reduce _.reduceRight and update vendors.
Former-commit-id: f7250ccb4b8f15052c1f1420947c2ac68963a92c
2012-09-20 21:06:32 -07:00
John-David Dalton
5afeed56ef Cleanup _.difference and _.union.
Former-commit-id: 1fcaab3989caaaacd9fe73de071d8f360f52b715
2012-09-19 22:15:15 -07:00
John-David Dalton
b91b04f652 Update vendors and add _.reduce, _.reduceRight, and _.where benchmarks.
Former-commit-id: c1b4bc7f8aaf08c429ae918f5d528401f1a66255
2012-09-19 21:40:39 -07:00
John-David Dalton
25de44a23d Cleanup _.template.
Former-commit-id: dc3fa2d02a9a4a2d4034136d2ce7f03d0b67224a
2012-09-19 01:06:45 -07:00
John-David Dalton
00cfb95971 Update vendors.
Former-commit-id: fddaef2be532e30f197f8bdff70dc6ec9bfa3cfc
2012-09-18 23:42:52 -07:00
John-David Dalton
f4ba0e1191 Simplify _.template and remove superfluous caching.
Former-commit-id: f9f18a63a77376471e69c95d5046dfe0146b9887
2012-09-18 23:42:26 -07:00
John-David Dalton
6499643769 Make _.random return 0 or 1 when no arguments are passed.
Former-commit-id: 7d20f5240d534f0091757f613c664b08e0d45759
2012-09-18 20:29:36 -07:00
John-David Dalton
f85287a444 Add "category" options unit tests to test-build.js.
Former-commit-id: 0499317babeb422e88700edd0f1e46c1fa6196fd
2012-09-18 01:22:10 -07:00
John-David Dalton
483bc9ad87 Add unit test to confirm correctly parsing delimiters.
Former-commit-id: 71aa7a240d2becb8082e36f9aa4874eb0aed09d3
2012-09-17 23:49:03 -07:00
John-David Dalton
93b89a93c1 Make _.times return an array of the results of each callback execution. [Closes #73]
Former-commit-id: 808af6b9eb07bf1fada8221ca659558d82e6eb57
2012-09-17 21:48:26 -07:00
John-David Dalton
10064c046c Allow build "plus", "minus", and "include" to accept case-sensitive category names.
Former-commit-id: f74d4cda73195854b3471ddce0afaab099dcfe77
2012-09-16 18:11:53 -07:00
John-David Dalton
a5aecb9d0e Add minus and plus commands to build.js.
Former-commit-id: fcdd2e829de5a6a29ebc342e694b7986d9a5eade
2012-09-16 13:22:26 -07:00
John-David Dalton
de1e889f1d Make lodash underscore build smaller and rebuild docs.
Former-commit-id: 19405bc4e490588d7a55379974d2d7d81d1cf5f7
2012-09-15 19:24:26 -07:00
John-David Dalton
16f89b40c3 Remove issues resolved by Underscore from README.md.
Former-commit-id: 27510827a1e60dd4cf81f5306991e3f63e8cedb5
2012-09-15 08:47:22 -07:00
John-David Dalton
0e387d2cda Remove custom toArray checks in _.toArray and simplify array-like object checks in "Collections" methods.
Former-commit-id: 6b7678de16907f44c1b079a22a6a2e091a638d4b
2012-09-15 08:46:49 -07:00
John-David Dalton
837c15e4f9 Update vendors.
Former-commit-id: 1e93a793891e5f4e2c0d3927f3f38b25bd182263
2012-09-15 08:21:44 -07:00
John-David Dalton
ae7e353169 DRY more code in the "underscore" build.
Former-commit-id: c1dbc3daccb1efba371c38f20b9a4ff96a7171a4
2012-09-14 01:09:02 -07:00
John-David Dalton
6c1bbd2344 Tweak iteratorTemplate formatting and remove more code from "underscore" builds.
Former-commit-id: cbaa8e41a9a60b5828d2c0da7188d483702c55e1
2012-09-13 23:51:52 -07:00
John-David Dalton
27247e8e56 Remove freeExports var when not used via exports build option.
Former-commit-id: 66950af3a18b35412fbe1092e19c5d7ef0c9a029
2012-09-13 19:28:56 -07:00
John-David Dalton
08249d78ea Add RequireJS "shim" test and a build test to ensure the AMD snippet is maintained for r.js.
Former-commit-id: 708c07877cfca0022d6d56c16c36d8bae79e4796
2012-09-13 19:11:48 -07:00
John-David Dalton
827091e522 Remove "lazy" bind from README.md until next version bump.
Former-commit-id: f132182f32670aa7df7ac418f58db0a1fb0f8547
2012-09-13 02:10:23 -07:00
John-David Dalton
13d901bf8d Make the IIFE Closure Compiler regexp in post process more restrictive to work better with the "iife" build option.
Former-commit-id: 999602451e50850eb82680b9c377d97605be8af4
2012-09-13 01:40:28 -07:00
John-David Dalton
e69bdabc99 Rename makeBound to createBound for naming consistency.
Former-commit-id: ec6845badba06231af0b1341b1f1efedb8adbc88
2012-09-13 00:46:47 -07:00
John-David Dalton
e8d19265e4 Cleanup component.json.
Former-commit-id: 0761bb592e5c643223848e2cd7fca0efc5b9c725
2012-09-13 00:10:16 -07:00
John-David Dalton
49e3a49dc5 Update docs, minified, build, and vendors.
Former-commit-id: 8b1425b8c4a5238a42185dfa974bb3b2468eebea
2012-09-13 00:08:52 -07:00
John-David Dalton
82a7c01898 Simplify "underscore" build of _.clone.
Former-commit-id: 32975bb5966f1ded4f007eb76dcf2d4677478e7d
2012-09-13 00:04:53 -07:00
John-David Dalton
c0d7dbf639 Reduce code around _.bind and _.partial, and add _.lateBind.
Former-commit-id: 4c962d066ecfa54882cee2216a7310ab34b3b5a3
2012-09-13 00:04:00 -07:00
John-David Dalton
569caa0bf2 Remove custom isEqual checks from _.isEqual and custom clone checks from _.clone and simply _.clone, _.isEqual, and _.merge.
Former-commit-id: 45e90ab1494e46e281265f660c87e27f59581308
2012-09-12 22:00:23 -07:00
John-David Dalton
f88ea1ee7d Re-order test-build unit tests and make the iife test a bit more thorough.
Former-commit-id: f798639cfa58241b052d16b9ca6fbf4537482349
2012-09-12 08:40:01 -07:00
John-David Dalton
d5a8fa0b97 Update underscore unit tests.
Former-commit-id: ae00a864c7cb3bff9970289917df681ad5e295d9
2012-09-12 08:39:18 -07:00
John-David Dalton
3f8f96edea Add "mobile" build unit test.
Former-commit-id: f067b42618abe6a9f747fea000522de6a9117b3c
2012-09-11 22:30:23 -07:00
John-David Dalton
04fb4aff28 Update underscore.
Former-commit-id: 7041883ef258e3dc80d3c3751a5e4beecf0b4767
2012-09-11 20:15:13 -07:00
John-David Dalton
83c6fb089e Ensure mobile build has properties correctly minified.
Former-commit-id: 61da738afbcefc7ecd277190147041d884002af1
2012-09-11 09:15:32 -07:00
John-David Dalton
9d8d17b964 Update cdn link in README.md.
Former-commit-id: 5da17daf1a6d1d5c9f6e9ba7875f45bd2d763cda
2012-09-11 07:41:47 -07:00
John-David Dalton
39d4842ff5 Bump to v0.7.0.
Former-commit-id: 7c51a310c7c62bfe0ba9a2cdea4e074e633cee70
2012-09-11 02:53:12 -07:00
John-David Dalton
cad8473986 Re-add overwritten _.isEqual unit test.
Former-commit-id: 52d4e3bc02a6fd0ac30177c9da82dec60ee6eb81
2012-09-10 23:41:20 -07:00
John-David Dalton
5f085ccb52 Fix typo in _.isEqual.
Former-commit-id: 9d5065953c51d12f1308dd8c0c142b6505efe765
2012-09-10 23:04:42 -07:00
John-David Dalton
b406246689 Add "iife=.." command to build.js.
Former-commit-id: 85d8c7ea550403663a878f2713ce93ae8c2dbc6a
2012-09-10 22:52:28 -07:00
John-David Dalton
cbe46afdff Minor lodash.js cleanup.
Former-commit-id: 544f2a2690b48b52870b3ab62509221a82ed4173
2012-09-10 21:04:04 -07:00
John-David Dalton
a59d6dc3c7 Add minify.js Underscore unit test.
Former-commit-id: 1db7b19709ef953dd1996a082e73a2ba542f29f7
2012-09-10 20:35:27 -07:00
John-David Dalton
2afb2dd5fd Reduce temporary objects created in _.merge, _.clone, and _.isEqual.
Former-commit-id: e6696642505f39eefdf59075ff8a993ab033465a
2012-09-10 20:12:42 -07:00
John-David Dalton
4fc3c969d3 Add component.json for Bower.
Former-commit-id: d681c2300b4e79fb168793aed34b82c3021647d1
2012-09-10 00:48:12 -07:00
John-David Dalton
1796ce324b Cleanup build.js
Former-commit-id: 6a4502883d7431f5dcedbf7f7d3bfb871ce1c0f4
2012-09-09 23:30:38 -07:00
John-David Dalton
5e04c7f827 Add "output" and "stdout" build option unit tests.
Former-commit-id: 2adcdbff4cd1ef6319e33c69fd5ed3b07b205cfe
2012-09-09 20:33:08 -07:00
John-David Dalton
20fcede440 Add "-o" and "--output" build options.
Former-commit-id: 154c0a6b749ff2439c024602fb9ec781e293f511
2012-09-09 17:26:30 -07:00
John-David Dalton
012c1833f2 Added "-c" and "--stdout" options to build.js.
Former-commit-id: 388c529ca1836ee7cd65517d2e9f8533e480b8cd
2012-09-09 16:33:57 -07:00
John-David Dalton
32e8e03256 Add build "exports" unit tests.
Former-commit-id: afe0fe59933d272bfa597be835011b3c81b28dda
2012-09-09 16:00:11 -07:00
John-David Dalton
dca653cb92 Update minified build and docs.
Former-commit-id: a7719898e67aab04d37e775f4794b0be7a4a2e24
2012-09-09 14:13:18 -07:00
John-David Dalton
0805eca979 Remove Object.keys optimization from the "legacy" build iteratorTemplate.
Former-commit-id: 5a63b627c4982ca43a46a830722513cab2c7b633
2012-09-09 14:11:46 -07:00
John-David Dalton
17935a78ff Make previous _.isEqual fix pass Underscore unit tests.
Former-commit-id: 2b3563bb628b307ad2e4a2ef00ed5afec2f59506
2012-09-09 14:11:07 -07:00
John-David Dalton
e16918ee32 Add "exports" option to build.js.
Former-commit-id: cc1572dbe9d1367f806a44597cbcec8508f51ad6
2012-09-09 13:12:44 -07:00
John-David Dalton
78471b4595 Cleanup test files.
Former-commit-id: 3b138bc74c2f4c2c6d374893c0f90a8422a7248b
2012-09-09 11:55:24 -07:00
John-David Dalton
c30bcdd515 Ensure _.isEqual matches values with circular references correctly.
Former-commit-id: 07968aeb430f56c32aab22dfda919706da840680
2012-09-09 11:54:32 -07:00
John-David Dalton
ac78c5f4e5 Make minify.js support passing minify an array of command-line arguments.
Former-commit-id: fd67d3d6dd8b19c88c74529a33fd50b2fbd0db01
2012-09-08 23:43:36 -07:00
John-David Dalton
57a990ce25 Add "underscore" build test.
Former-commit-id: 8050e285fae94c96e7db1c8847ace45ae5cade33
2012-09-08 19:30:58 -07:00
John-David Dalton
24825b42a2 Cleanup and add test-build to run-test.sh.
Former-commit-id: 29d198ca03dbd23b864a96ea48348fb22728056a
2012-09-08 14:20:46 -07:00
John-David Dalton
4f7323f7fc Add test/test-build.js.
Former-commit-id: b0c28b814dec71095a927469cbbda766fd9fc701
2012-09-08 14:03:21 -07:00
John-David Dalton
a228be85e2 Cleanup compareAscending.
Former-commit-id: c11be9f8211242a8d25a2cd06e20efefa685c3ee
2012-09-07 23:56:28 -07:00
John-David Dalton
fa565bdbdf Hold off on the version bump until test-build.js is finished.
Former-commit-id: a627062b1133cdb5a06a3fd960bbeaddfd0f9a54
2012-09-07 22:00:27 -07:00
John-David Dalton
2dc53223e5 Ensure _.template works with "interpolate" delimiters containing ternary operators. [closes #68]
Former-commit-id: 287df2ef5802ea6db743da5f211e480d6b0f85c9
2012-09-07 21:17:00 -07:00
John-David Dalton
958ac72805 Ensure the internal stack argument of _.merge doesn't pave the 4th argument passed to it. [closes #69]
Former-commit-id: b33e1cb7795294b9481e2c9c6888d0f37419208d
2012-09-07 21:09:21 -07:00
John-David Dalton
f7297b84e7 Tweak text of build.js help message.
Former-commit-id: 755872c9ae5670cc3a33aa158be4478eafacc574
2012-09-06 23:27:00 -07:00
John-David Dalton
9a7d9e7bb8 Ensure _.sortBy is stable for undefined values.
Former-commit-id: bf250150d27de050ea7a6fa376aacdc8d1ba7716
2012-09-06 22:35:20 -07:00
John-David Dalton
fa9df75cf7 Rework build.js to work as a module and add a "silent" mode to minify.js.
Former-commit-id: cf62532b957d37da77a2d64aa64d2d388e6382ae
2012-09-06 22:19:43 -07:00
John-David Dalton
e3ec76418b Update Underscore/Backbone vendors.
Former-commit-id: beb38126acaebf1045c2676aeda037e35f0b99c8
2012-09-06 20:56:02 -07:00
John-David Dalton
102d6d8c84 Capture the result of the last func call in _.throttle and _.debounce.
Former-commit-id: 2e783fad2e86824bf098bdb24ca6911317576f32
2012-09-06 20:49:06 -07:00
John-David Dalton
a742b5f3e2 Rewrite build.js to be used as a module.
Former-commit-id: bf6425925e511a327b5297f9b17620a97ff53b67
2012-09-06 20:36:24 -07:00
John-David Dalton
a2a3bb291f Let build.js handle the "use strict" directive and not minify.js.
Former-commit-id: 741eb692b158e22aa688d6dac1b63fc2787cc426
2012-09-06 00:41:18 -07:00
John-David Dalton
b7c0ac7d67 Tweak test/test-ui.js for QUnit v1.10.0.
Former-commit-id: 6481cce305fb4d69bba22ba2186a30ee13bb2282
2012-09-06 00:40:26 -07:00
John-David Dalton
13b1fc6b44 Remove an unneeded _.object unit test.
Former-commit-id: 2334bda13fbd9bd683b3f650ff47f1a676139319
2012-09-06 00:38:22 -07:00
John-David Dalton
3939fcf6e7 Allow unit tests to run when testing custom builds without noConflict.
Former-commit-id: 2aee7eb872144583df1f22743f5d3f7102d14eae
2012-09-05 07:12:35 -07:00
John-David Dalton
13abbb81af Bump to v0.7.0.
Former-commit-id: 4ab5bfe3bba14182ffe24c05792b3b8f194afa0c
2012-09-05 01:12:57 -07:00
John-David Dalton
019f0153c8 Update alias style in docs.
Former-commit-id: d7b1eb9999f535c365ce3ea6251a359c7d901769
2012-09-04 23:47:27 -07:00
John-David Dalton
8abc2925e0 Fix invalid doc entry in doc/README.md.
Former-commit-id: 64721e5c3417a25b2f34f1f380b0cecc6561fa35
2012-09-04 22:29:06 -07:00
John-David Dalton
996c9a032a Update docs to include method aliases.
Former-commit-id: b93b13a42381ba28b84a3e279d5157673b20fdce
2012-09-04 21:40:29 -07:00
John-David Dalton
22d3794d22 Update vendors.
Former-commit-id: ad3284b1e77cfb0b17af99e0ddaf00618e4485b7
2012-09-04 21:37:01 -07:00
John-David Dalton
ba948a38e9 Ensure to escape exports property for Closure Compiler.
Former-commit-id: 9b6bd1201e74d9e85fbc340bcabce40039239a59
2012-09-04 15:25:47 -07:00
John-David Dalton
e8a522c4df Update README to reflect Underscore patches.
Former-commit-id: b0222d92b90e190c7c322e409ec877ca473f3594
2012-09-04 11:27:23 -07:00
John-David Dalton
c60f3da32e Reduce size of "mobile" and "underscore" builds.
Former-commit-id: 062dc03e3d3dd7a8e1ceb6a8b4ea155394a9b899
2012-09-03 23:20:18 -07:00
John-David Dalton
0c92d3cbb2 Fix how post-compile.js unescapes properties to avoid extra work in pre-compile.js.
Former-commit-id: f604f706af358288877763681243f4816d5cbe9e
2012-09-03 21:40:23 -07:00
John-David Dalton
e4fc8dd6fe Remove older Opera fixes from the "underscore" build.
Former-commit-id: a012ed6957b4d964b5f2dc1a636d7f5f19fbf307
2012-09-03 16:30:55 -07:00
John-David Dalton
1a849e2de0 Update docs and minified build.
Former-commit-id: 62f3293c13d5fa08f857ca455506b4762aa65416
2012-09-03 16:07:46 -07:00
John-David Dalton
ffdd79f86b Adjust how _.template handles compiled syntax errors for compatibility with Underscore.
Former-commit-id: ba84c5b468938a1be1a1fd0afd31cb83f563e1ca
2012-09-03 16:05:47 -07:00
John-David Dalton
e87e46b1b6 Remove deep clone from "underscore" build and fix how invalidArgs are detected in build.js.
Former-commit-id: 5038d1541fa7d0c062e5a48004a60fb9140778d7
2012-09-03 15:42:02 -07:00
John-David Dalton
3ca81a4ff7 Fix Underscore detection in post-compile.js.
Former-commit-id: ad3c5cd28bc9ac0f6c9e5801c3849acd4305c528
2012-09-03 15:40:47 -07:00
John-David Dalton
5477d3c292 Cleanup iteratorTemplate and isPlainObject.
Former-commit-id: a96b8716cfd0efbc46daf2307fae8f1ee5969862
2012-09-03 15:36:18 -07:00
John-David Dalton
08300183b3 Cleanup build.js help message.
Former-commit-id: 36edcf06e78580835f33872f0c72a233604a4adc
2012-09-03 12:58:46 -07:00
John-David Dalton
095c77f22c Inform users of invalid arguments passed to build.js.
Former-commit-id: 1b15dd2242387c7037678a3348931f5430612a8b
2012-09-03 10:50:25 -07:00
John-David Dalton
09926e63a3 Add 4th screencast link to README.md.
Former-commit-id: 07d890b65e7e4ed600173634f04a9783d18bc701
2012-09-02 16:15:56 -07:00
John-David Dalton
87d70f29a1 Make pre-compile.js and post-compile.js support underscore.js.
Former-commit-id: 76d040f630faf03bd5a8eb168259814f5662ba50
2012-09-02 16:11:29 -07:00
John-David Dalton
3a7661b111 Make _chain and _wrapped double underscored to further avoid conflicts.
Former-commit-id: 27f545d99cc383be05509ac7382e42fc727e0215
2012-09-02 12:57:53 -07:00
John-David Dalton
ec976953cd Simplify wrapper inference in _.isEqual.
Former-commit-id: b4fda683ebee4c3f7dddd0cb87201306c08fa7d5
2012-09-02 12:04:35 -07:00
John-David Dalton
1837562b50 Cleanup README.md, update Backbone, rebuild docs and minified build.
Former-commit-id: 8f54e0a4b76cf1a42c11ca37f3e8672a75178d30
2012-09-02 02:44:26 -07:00
John-David Dalton
f3bec4fc37 Ensure optimized isPlainObject works with objects from other documents.
Former-commit-id: 2f782b3dfc19e7ea3274132c31cd408ee2387021
2012-09-02 02:35:02 -07:00
John-David Dalton
c2117ef4fd Add _.result to "backbone" build.
Former-commit-id: c04ddcdbfb229440b19b268d51887bf31ae11296
2012-09-01 14:58:35 -07:00
John-David Dalton
910804ecd1 Avoid arguments object in _.random.
Former-commit-id: 24e54869ae03c0251f419c922f59f53f01b8fa35
2012-08-31 18:03:10 -07:00
John-David Dalton
ce5ae1dfdd Simplify _.size.
Former-commit-id: a7d3338cbd5784ec6b9b6a25e18acd9507f4b21c
2012-08-31 17:58:34 -07:00
John-David Dalton
2c31411ffb Optimize _.pairs.
Former-commit-id: 1de87609a8635fb8d48bc558fbdabc545da53b4b
2012-08-31 15:45:27 -07:00
John-David Dalton
84d69fa2a1 Update resolved issue count in README.md.
Former-commit-id: 41a22ec12d02a1cff5b172022c8260b80c63fe9b
2012-08-31 13:57:23 -07:00
John-David Dalton
2aea296d19 Update minified build and docs.
Former-commit-id: aed499a9ffee5fd7c1f29dad13a8c4e756b431d8
2012-08-31 13:53:04 -07:00
John-David Dalton
2b0bffc362 Ensure template delimiters are tokenized correctly. [closes #64]
Former-commit-id: 814f3f8a840a70a9b455e5f91da0e21174f08787
2012-08-31 13:50:10 -07:00
John-David Dalton
83356142c1 Update README.md with API changes.
Former-commit-id: 4571a2331d433af28ae33813780f8abc9477437e
2012-08-31 13:36:16 -07:00
John-David Dalton
24dcc6947c Update build.js and pre-compile.js for _.invert, _.pairs, and _.random.
Former-commit-id: 0dc281f6e1a07f0a4121f71c37e15a7ca0e18960
2012-08-31 13:35:40 -07:00
John-David Dalton
a7e3136a0b Add _.random.
Former-commit-id: cf720b9187b0b54b43773a9f5f02fb475d786bfa
2012-08-31 13:33:44 -07:00
John-David Dalton
71639cfea7 Cleanup _.times documentation.
Former-commit-id: 59ce4b689bb280650d28944664abd6a38f1c43a0
2012-08-31 13:05:12 -07:00
John-David Dalton
8c2d39fb82 Add _.invert and _.pairs.
Former-commit-id: b265ed3f148e5e951b8d061107bb376e0b2e651e
2012-08-31 13:02:55 -07:00
John-David Dalton
e060d29337 Rename _.drop and _.zipObject unit tests.
Former-commit-id: d68abda2400244b7801eac9ad90de88b2f99a1f4
2012-08-31 12:59:18 -07:00
John-David Dalton
79e9156d2f Make _.drop an alias of _.rest and rename _.zipObject to _.object.
Former-commit-id: 08cb9ec2d5009b9a9f959b2341f8b78f6bbd37a0
2012-08-31 12:57:52 -07:00
John-David Dalton
9100db55b0 Update vendors.
Former-commit-id: 88e9746e94e8ec899227b1a925bea4ab4d373fb0
2012-08-31 12:47:55 -07:00
John-David Dalton
141c10f6fe Ensure noArgsClass references aren't removed for "underscore" builds.
Former-commit-id: 697e2d29d5fef32b0b10d775eee7a12d193ff1a9
2012-08-30 00:58:54 -07:00
John-David Dalton
4613ab9dc3 Update cdn links and tested browsers in README.md.
Former-commit-id: db952c5d72fa9e4d6ce3280574b9e4e26da8c928
2012-08-29 18:03:03 -07:00
John-David Dalton
061ad41b51 Cleanup link hashes in generated docs and update vendors.
Former-commit-id: 278366a7dacea91d965835b24ae7ec046f455110
2012-08-29 08:28:37 -07:00
John-David Dalton
3a0007cd18 Remove pseudo private properties from debug builds.
Former-commit-id: 839c2e47e19ba163f0c69d3c115ec9ee262d5d6b
2012-08-29 01:17:28 -07:00
John-David Dalton
0044917943 Ensure Closure Compiler removes isPlainObject when it's no longer needed in build.js.
Former-commit-id: 748de0f28f4e0733ef83a77fe2b1f6e40e4f8ce2
2012-08-29 00:34:58 -07:00
John-David Dalton
0337c04278 Bump to v0.6.1.
Former-commit-id: 68b59ea3e76d06d60acc81e30770b5899b8ea761
2012-08-29 00:14:40 -07:00
John-David Dalton
4585acf70b Optimize isPlainObject.
Former-commit-id: 37754e27d03929927d8b8653bd7e44ad3ce2b23c
2012-08-29 00:05:02 -07:00
John-David Dalton
2ad9bbae25 Avoid issues in IE with other code containing comments like //@todo xyz.
Former-commit-id: 92ec6258539bf48144e9af05d0e326651a5fedda
2012-08-28 23:58:07 -07:00
John-David Dalton
cf075df7d1 Update cdnjs link in README.md.
Former-commit-id: 50a52807a505d0d559f9977e3b5c9532fa3f131e
2012-08-28 08:58:47 -07:00
John-David Dalton
11cd9905c4 Bump to v0.6.0.
Former-commit-id: 7339c27ba63208f23d94ae4a29dec53a43220bad
2012-08-28 01:47:22 -07:00
John-David Dalton
cf462542e9 Cleanup iteratorTemplate and remove more code from the "underscore" build.
Former-commit-id: 3f4c283f0aa205dbcce1940f7222b594284263c4
2012-08-28 00:30:52 -07:00
John-David Dalton
b63f25a1ae Simplify _.unescape to match the behavior of _.escape.
Former-commit-id: ec7f4cf9a6f44b1ba99f467c47d7e04d5596d76e
2012-08-27 07:54:03 -07:00
John-David Dalton
7de69a21c5 Cleanup unescape comments.
Former-commit-id: 4c0a66d28ed8b04748e4d97755983ec328e53ca4
2012-08-27 02:54:55 -07:00
John-David Dalton
21783e4ea0 Add unescape to the dependency map and exclude unescape from the "underscore" build.
Former-commit-id: 20656e5226207e55713a286c7d7069b73170272f
2012-08-27 02:33:38 -07:00
John-David Dalton
53e5a756d7 Update minified build, docdown, and rebuild docs.
Former-commit-id: f198b30ba8963d8b69838ba31d2e3d8085537629
2012-08-27 02:09:04 -07:00
John-David Dalton
8c911a2fd0 Add _.unescape method. [closes #63]
Former-commit-id: 10eada385fd0e1157271a2da6fb32de047d6d88a
2012-08-27 02:05:37 -07:00
John-David Dalton
ce440e9f43 Add hasObjectSpliceBug to avoid unnecessary use of the delete operator from the mutator Array function mixin.
Former-commit-id: 8e92914f451454323a1ff6ef8ec1886b41e54ced
2012-08-26 12:54:03 -07:00
John-David Dalton
6465f8d8e6 Cleanup docs for _.drop, _.pick, _.countBy, _.groupBy, and _.sortBy.
Former-commit-id: 0dc89937d067c996fd28b585f42c1e01e928441b
2012-08-26 11:41:17 -07:00
John-David Dalton
4bdf28059a Cleanup unit tests, update minified build, and docs.
Former-commit-id: 5bca51894bf2fb01732a1ecc5873711d8abf3f9c
2012-08-26 03:09:19 -07:00
John-David Dalton
21010c6540 Add callback and thisArg arguments to _.drop and _.pick. [closes #62]
Former-commit-id: 990655e9e849348c287b3d994d2e2dc741f78fbf
2012-08-26 03:06:43 -07:00
John-David Dalton
a5a6cabac6 Cleanup createIterator and _.contains.
Former-commit-id: 39d4c33e5af0d9338a1725b5c07332a14f453374
2012-08-26 01:07:36 -07:00
John-David Dalton
f460c77f2c Ensure _.reduce works with string Objects in IE < 9.
Former-commit-id: 0ee3496e52f4c393900f37f03e451b8e4abba206
2012-08-26 01:04:09 -07:00
John-David Dalton
1c69d9213e Update minified build and rebuild docs.
Former-commit-id: e9da1d37b6741caf19c47e8dd81b89df60e8410f
2012-08-25 21:50:52 -07:00
John-David Dalton
c02c2d3b2c Optimize _.intersection, move largeSize default to largeArraySize, and cleanup _.where.
Former-commit-id: 9eaea7922623f1bd69f2b18578468a6fc9ba13fc
2012-08-25 21:50:08 -07:00
John-David Dalton
7adf5e763b Cleanup benchmarks in perf.js.
Former-commit-id: f845855383e01c63d513cea53cec86abb4f4fb65
2012-08-25 20:13:24 -07:00
John-David Dalton
0e4afefc7f Add more _.omit benchmarks and update Underscore.
Former-commit-id: b8de29706b381ebc000a7cbaa19aa0a2a628d6a8
2012-08-25 01:04:33 -07:00
John-David Dalton
c7f290f42e Cleanup unit tests and update ticket reference in README.md.
Former-commit-id: c2433e841c20eb17334d375deabcf0605ed49a3b
2012-08-25 01:00:19 -07:00
John-David Dalton
bb553b8a6a Update whitespace removal for delete operators in pre-compile.js.
Former-commit-id: 8dddeed54f8f13268f777d829ba52363706b9f4a
2012-08-25 00:56:00 -07:00
John-David Dalton
21eda2a1a3 Add _.omit as an alias of _.drop.
Former-commit-id: 630b0897bb49161fbc3b51a38c816b4bce548fba
2012-08-24 09:46:44 -07:00
John-David Dalton
48c13c990f Update vendors.
Former-commit-id: f2a09b6501a34b2ae2d8e996b13c9da4fb048535
2012-08-24 08:26:34 -07:00
John-David Dalton
a2665529f6 Optimize method compilation with/without strict mode.
Former-commit-id: 05e4d9282116987b53a817b406c82c140a25c761
2012-08-23 01:49:44 -07:00
John-David Dalton
8d35d78eff Ensure debug builds work against more build options.
Former-commit-id: 121b3605026d8f936e2ca0e3a03142cb08e75e66
2012-08-22 09:13:50 -07:00
John-David Dalton
a82a364c22 Update dependencies in build.js.
Former-commit-id: 020a52bdd604b55b078637aeb59e2e53483c950d
2012-08-21 21:21:24 -07:00
John-David Dalton
cc150ff9d2 Cleanup test.js and README.md.
Former-commit-id: af3372f58ecf8d979d22c88193589857c06ff7c1
2012-08-21 02:31:40 -07:00
John-David Dalton
feeb38293d Update cdnjs link to v0.5.2 in README.md.
Former-commit-id: e519a03ad9016f8aebd2c703f29bb350bcd442f1
2012-08-21 02:13:53 -07:00
John-David Dalton
5b9271ccfe Add isType benchmarks.
Former-commit-id: 875af51200d60eb6105eb36ab090e9f307a15340
2012-08-21 01:59:56 -07:00
John-David Dalton
e60bbc2fb7 Bump to v0.5.2.
Former-commit-id: 43998ef8cf3cbdb9205d702d950f9f59febc420b
2012-08-21 01:32:41 -07:00
John-David Dalton
387cc184e6 Keep test count consistent for Node.js.
Former-commit-id: ca0452ff4511c946946a2208b44471b1e2c6fc43
2012-08-21 01:31:54 -07:00
John-David Dalton
a830ddcb43 Cleanup perf/index.html.
Former-commit-id: 7592ee8ec0c6b2bb85d93d7dc599d814ef5a1eef
2012-08-20 22:46:35 -07:00
John-David Dalton
35fea30191 Cleanup string tests and add string test to _.toArray.
Former-commit-id: 3565f7233f1f7662604e3b8e1f07eead62349454
2012-08-20 22:45:57 -07:00
John-David Dalton
24b672b968 Update vendors.
Former-commit-id: 4ccda4fafe86514cdb45d191cb743baca9b1baa4
2012-08-20 22:43:43 -07:00
John-David Dalton
de6a3c5ab1 Switch order of performance.now check in perf/index.html and convert benchmarks to strings in perf.js for better compatibility with older browsers.
Former-commit-id: d766316c9c162e31dd0471d80b50ecfd1da2c9a8
2012-08-19 23:45:16 -07:00
John-David Dalton
260ff6de3e Avoid using the nano applet in perf/index.html if it isn't needed.
Former-commit-id: 342983337140dd5608848b7f09d24038ea61d1a1
2012-08-19 15:35:38 -07:00
John-David Dalton
7cb37411c9 Ensure _.template won't error when passed falsey values, add _.template documentation, and DRY out tokenizeEvaluate.
Former-commit-id: b575de8bf968c2fc2655eadff0a09bcbff1e1753
2012-08-19 13:34:58 -07:00
John-David Dalton
e4e41e5ef8 Cleanup _.template docs and generate less unused code in compiled templates.
Former-commit-id: e6703414b83e9286d9ce5e14214375bbbaf9285f
2012-08-19 02:13:43 -07:00
John-David Dalton
985f4aafca Update minified build and rebuild docs.
Former-commit-id: 0c2c5769a94c0591359fcc7d0ae55ccfe975c38b
2012-08-18 21:44:35 -07:00
John-David Dalton
0c25dd44b3 Ensure _.isElement uses strict equality in its duck type check.
Former-commit-id: 6348026ebdc219ef1df9926aca1d8df66e472de9
2012-08-18 21:41:29 -07:00
John-David Dalton
285f0bc6dd Ensure isXYZ methods return boolean values and almost all methods allow falsey arguments.
Former-commit-id: a842eaf2fd262bed03df4a71b560b91801b7a75f
2012-08-18 20:52:31 -07:00
John-David Dalton
07a370fd24 Update cdnjs link to v0.5.1 in README.md.
Former-commit-id: 3c00694a949b4f30be48a898f1f2a9046b2573d1
2012-08-18 10:02:38 -07:00
John-David Dalton
95f07ea38a Add stable-sort note to _.sortBy documentation.
Former-commit-id: 17b9818baa6ff72ce5762ec8b3cc01bbac8725bb
2012-08-18 03:40:42 -07:00
John-David Dalton
2890b92b21 Tweak to _.bind unit test for Narwhal.
Former-commit-id: 5df60a9d1e46b09253151ab39281c5af0c48544f
2012-08-18 03:37:43 -07:00
John-David Dalton
8b80c5d0b5 Bump v0.5.1.
Former-commit-id: 09922fa2e936e0b112100690a04d6437131904a8
2012-08-18 02:20:30 -07:00
John-David Dalton
04425786a1 Ensure _.bind correctly appends array arguments to partially applied arguments.
Former-commit-id: 4fdb100f83ff9a0eafcba3f5bf91872748205595
2012-08-18 02:11:40 -07:00
John-David Dalton
15b14e12e2 Change to triple-backtick code fences.
Former-commit-id: 81d38ed0155734a72d98b2e16425635da907aa01
2012-08-18 00:04:17 -07:00
Mathias Bynens
b328972c4d README: Switch to the triple backtick syntax for highlighted code blocks
Former-commit-id: c4fba0c9cf7e8b0fdfc846260b148ecd327c0a1f
2012-08-17 19:31:03 +02:00
John-David Dalton
da3156047f Update minified build and rebuild documentation.
Former-commit-id: ab353b4c73c47b51144f5a917aeb53682b40552e
2012-08-17 08:17:14 -07:00
John-David Dalton
f9f08ba54f Optimize isPlainObject use in _.clone.
Former-commit-id: 7bb48bc5f9276c730f947b6e75b6fba4588f17c1
2012-08-17 08:16:31 -07:00
John-David Dalton
b43684262f Cleanup _.template documentation.
Former-commit-id: 7b45705bd8a4661dbf824912798ccba15e5ed989
2012-08-17 04:05:50 -07:00
John-David Dalton
2120f78bd7 Fix typos in README.md.
Former-commit-id: fb31a291a3afe799d2e9809f17420eda10888250
2012-08-17 02:54:19 -07:00
John-David Dalton
2d896f22d6 Bump to v0.5.0.
Former-commit-id: f30f4b99104c94fb52df4c90dcda24b8ac51432c
2012-08-17 02:28:42 -07:00
John-David Dalton
9fa0aebfe9 Add check for V8 bug #2291.
Former-commit-id: 245f156a2ce1ee92c8f8f8f34b9891ba4eff0d23
2012-08-17 02:12:17 -07:00
John-David Dalton
2ddc3af5ff Fix jQuery/MooTools DOM collection unit tests in IE6.
Former-commit-id: b9c3dbcffb28b0088018614e21fbe313b0d53713
2012-08-17 00:25:52 -07:00
John-David Dalton
fd80e096ea Remove noArgsClass check from isPlainObject.
Former-commit-id: bab7a68e8eaa21679b33b2ab70a9f8e47758ebc1
2012-08-17 00:10:03 -07:00
John-David Dalton
fab2d69fce Ensure _.sortBy performs a stable sort. [closes #59]
Former-commit-id: 09c5ff85ef0f1d054579ec4260a7f76d9c0da281
2012-08-16 23:24:59 -07:00
John-David Dalton
83d08e3aba Avoid false positives for arguments objects in IE < 9 when using isPlainObject.
Former-commit-id: 19e5a6efed32f26d0c908771eec40e7fb2ecf265
2012-08-16 22:22:08 -07:00
John-David Dalton
bfea6bcacf Maintain up-to-date minified underscore-min.js and use in perf tests.
Former-commit-id: 6317df872bd6136d81763d27a62a444f6e392537
2012-08-16 21:21:48 -07:00
John-David Dalton
feff34b021 Update vendors.
Former-commit-id: 44c2fe9fbfbf50aa64663d46b45d6fd2c778f2b7
2012-08-16 21:20:54 -07:00
John-David Dalton
79fbade92a Minor unit test cleanup.
Former-commit-id: 3243247d9da53f3a12cd19bec822bb43eb7f315e
2012-08-16 21:20:05 -07:00
John-David Dalton
bf508e453e Remove unused funcClass variable from compiled functions.
Former-commit-id: f47b8e412b5151e69a3ab78f03243c461b5ab072
2012-08-16 21:19:47 -07:00
John-David Dalton
47b51c22fa Ensure build tweaks are applied when new lines break up specific patterns.
Former-commit-id: 085a837521750457db9f20f3701984cba24a4f4f
2012-08-14 23:15:04 -07:00
John-David Dalton
ebd16105f2 Detect and remove additional unnecessary brackets from template strings during the build process.
Former-commit-id: 0b9786e7d41497fd1627e31401a5e7e0926eea9c
2012-08-14 00:12:27 -07:00
John-David Dalton
01fb1a5775 Optimize _.isFunction.
Former-commit-id: 0aaaa6d166c7eea94237388d61a11c6d183cbe1f
2012-08-13 23:11:01 -07:00
John-David Dalton
b8c2a05db9 Add strict comparison note to _.intersection and _.union documentation.
Former-commit-id: 47792d96e77fdeb6f00db1e4d30b41a6f1a59dbb
2012-08-13 07:37:26 -07:00
John-David Dalton
4087dc5fe4 Reword unit jQuery/MooTools DOM query collection unit test.
Former-commit-id: c80673f799ce6f1449d043eabf76fd6970a70b77
2012-08-13 00:45:38 -07:00
John-David Dalton
408029e6e0 Don't expose _.forIn or _.forOwn if underscore build modifier is present and include doesn't contain forIn or forOwn.
Former-commit-id: 6ebd0bc61d3ae6e2d0506fe72dd22ed59c601c70
2012-08-13 00:44:37 -07:00
John-David Dalton
23ff403529 Update vendors.
Former-commit-id: b239f365c9d8e012bf20525167e6d1a412ce828e
2012-08-12 22:33:27 -07:00
John-David Dalton
be4f81f584 Remove more unnecessary brackets from template strings during the build process.
Former-commit-id: c8e3dfe7d34f9c61fff75512fb4587a987bdf49f
2012-08-12 21:41:41 -07:00
John-David Dalton
361c91e610 Add support in _.isEmpty and _.size for jQuery/MooTools DOM query collections.
Former-commit-id: dc834256d09d7a3f2797ba65690961aad00717bf
2012-08-12 21:40:46 -07:00
John-David Dalton
2aa2ea9675 Fix edge issue with Opera 10.53-10.60.
Former-commit-id: 60014a8e3855bcbf0e4c6f47461123cacafcf668
2012-08-11 21:47:04 -07:00
John-David Dalton
e084225edf Cleanup .npmignore and ensure perf.js will work in the package.
Former-commit-id: e03213fba34c38af2be9003f5be4837d293198e1
2012-08-11 21:36:14 -07:00
John-David Dalton
9ce342205b Add Jam package support.
Former-commit-id: 399caeea73fc79dd340baa7e34b46179ff2beb86
2012-08-11 21:35:06 -07:00
John-David Dalton
0edf50e00e Update edge links in README.md to v0.5.0-rc.1 tagged links.
Former-commit-id: 1f9fea70c6608d980cc8c8fd7d0a39764cf14fa2
2012-08-09 00:24:53 -07:00
John-David Dalton
1ea19daad9 Clear the func variable in _.once so the function may be garbage collected.
Former-commit-id: 521a9d997cb206a5c468b30e5dfa8e096e1a13d5
2012-08-09 00:16:35 -07:00
John-David Dalton
32b302314e Add doc links to the change log entry in README.md.
Former-commit-id: 3c6c79de33331f14af2d5d2c64d1286c67bfb774
2012-08-07 08:20:00 -07:00
John-David Dalton
ee197e02a2 Updated tested environments and resolved issues in README.md.
Former-commit-id: 7d8cc17bad215d87c8c11210d58e1927c5766145
2012-08-07 08:04:46 -07:00
John-David Dalton
7cd6ffec2a Bump to v0.5.0-rc.1.
Former-commit-id: f5a29fd34de5aced3287413f40a0a36226465c84
2012-08-07 00:47:15 -07:00
John-David Dalton
0077580838 Fix failing unit tests in various browsers.
Former-commit-id: 9b5c6e82e0dfed79c505f41b66030ede81ca9a1c
2012-08-07 00:17:04 -07:00
John-David Dalton
4d85a79fd1 Add note about Chrome extensions to _.template.
Former-commit-id: 97b5220ebc3dbbd30b0e52f6c804b449b8d451ca
2012-08-06 08:03:54 -07:00
John-David Dalton
a35139bb61 Fix typo in test-ui.js.
Former-commit-id: 95057e80cfac9d7d776170d66f2c2bfdd364944f
2012-08-06 02:02:23 -07:00
John-David Dalton
f72b833724 Ensure _.keys works with arguments objets cross-browser.
Former-commit-id: 1238c9efcfc13a420804c26c5edee1e4aa5a4238
2012-08-06 01:51:47 -07:00
John-David Dalton
0e16bac6e2 Rebuild documentation.
Former-commit-id: d24c2fb65a54b018da9ad08aa3a67363a31c1122
2012-08-05 23:38:23 -07:00
John-David Dalton
e17564b362 Add unit tests for exiting early from _.forEach, _.forIn, _.forOwn.
Former-commit-id: 18d55054989d3b55afce1f4d604cd274eb9289c8
2012-08-05 23:09:05 -07:00
John-David Dalton
90b66eddf5 Add _.keys unit test for arguments objects.
Former-commit-id: dd90a9d3dc973a6ea8dce0c10ad511cce82097dd
2012-08-05 22:37:43 -07:00
John-David Dalton
2862a5849f Document how _.each, _.forIn, and _.forOwn may terminate iteration early by explicitly returning false in the callback.
Former-commit-id: e218eae83de880deecf1e45d32ca019efd25b548
2012-08-05 00:29:18 -07:00
John-David Dalton
7e839231ed Add iteratesOwnLast bug check.
Former-commit-id: fcc42a42f08e60acc1252ec06b045cfee17bd020
2012-08-05 00:09:00 -07:00
John-David Dalton
fa56a4bb73 Cleanup build.js and update dependencies for _.clone, _.isEmpty, _.isEqual, _.merge, and _.size.
Former-commit-id: df19990609a3dd8432694798149a5eb5bda142c4
2012-08-05 00:02:33 -07:00
John-David Dalton
dff950748c Fix the build to work with _.merge.
Former-commit-id: cb1d9897b97b357197bb6933c65f4afbecea1aea
2012-08-04 17:13:09 -07:00
John-David Dalton
b7374e3f8e Ensure merge works with sources containing circular references.
Former-commit-id: cb3301868299c4e4d32a3d3608199e4269d951ec
2012-08-04 17:12:25 -07:00
John-David Dalton
4244b92b08 Update minified build and rebuild docs.
Former-commit-id: f80bacba89ab171aae61d5ce7269e8507117bffa
2012-08-02 00:33:39 -07:00
John-David Dalton
4f688028ad Update vendors.
Former-commit-id: d1dd2ecf337cf8cda71e0da2af0647813b8de24a
2012-08-02 00:32:15 -07:00
John-David Dalton
5a9a18501d Add _.merge.
Former-commit-id: e393655b1fa41c8eb6ae1b925f456aa05231078a
2012-08-02 00:28:19 -07:00
John-David Dalton
896b8f7cf1 Remove noNodeClass from "mobile" and "csp" builds.
Former-commit-id: 0773f7b1c1ea637d0d519a3015d1534863a9be11
2012-07-29 23:54:52 -07:00
John-David Dalton
95bd1b014f Rework the noNodeClass inference to detect the JScript quirk too.
Former-commit-id: 3a6b73509490d7e87d2322fe1c09890f5f6b57ea
2012-07-29 23:48:07 -07:00
John-David Dalton
dbdf8642bb Rebuild documentation and update the minified build.
Former-commit-id: c4d4281f16250f50ea4d5337a53acceedd2ce660
2012-07-29 14:18:05 -07:00
John-David Dalton
c3cd9007d2 Add unit tests for _.where.
Former-commit-id: 5247bba20d7aa772867e29def99221faea376db1
2012-07-29 14:17:34 -07:00
John-David Dalton
8079fb5bc5 Reorganize and cleanup code for _.where.
Former-commit-id: 769dfafc1701c5ebc2d351abeb729ca6fcfa12e9
2012-07-29 13:49:23 -07:00
John-David Dalton
80d0b5d4ed Add _.where. [closes #22].
Former-commit-id: dec7a9d0df4158a395ec84fb9e774ed20205d421
2012-07-29 13:48:21 -07:00
John-David Dalton
86bd847bf9 Ensure _.isEqual works correctly for objects from another document and add _.clone benchmark.
Former-commit-id: b1ef745ec6c24e8ea0c8fae304ead80c60dfd5aa
2012-07-29 00:58:23 -07:00
John-David Dalton
943004844a Ensure the callback of _.filter can't modify the resulting value.
Former-commit-id: 6652dc5926390e8418b524c7ffd2347c2fa65c82
2012-07-26 23:24:17 -07:00
John-David Dalton
4ff12e0426 Fix recent typo in isEqual.
Former-commit-id: 84cdf90de59c8184a0ac1f78704f61dcc88c91f1
2012-07-25 01:35:56 -07:00
John-David Dalton
0d7bdb6fa8 Make _.range coerce arguments to numbers.
Former-commit-id: 5408800fef0bc8a418c298a112049232b6d85e78
2012-07-25 01:32:28 -07:00
John-David Dalton
6d488b6a81 Update minified build and rebuild documentation.
Former-commit-id: 5f0ea311b51723c225774d735f67fc58f55a4d6e
2012-07-24 02:15:20 -07:00
John-David Dalton
f1d0263ffa Add csp Content Security Policy build.
Former-commit-id: f922046de5150c098eb7f6d3b6901552117631e7
2012-07-24 02:13:31 -07:00
John-David Dalton
24035caadb Keep objects in the stack array of _.isEqual in case a cyclical object is used in a sibling property.
Former-commit-id: 33ffcec837322f4d479f64f9ec6b14184bf5f7a2
2012-07-24 02:13:07 -07:00
John-David Dalton
ed89a3e0f8 Check for custom isEqual methods in _.isEqual before other comparisons and add cross-browser support for arguments objects.
Former-commit-id: 56e40f670309aeb0dcda7868c8aa84b5909db1f1
2012-07-24 01:45:34 -07:00
John-David Dalton
7088ab89f1 Add deep clone support via the deep argument to _.clone.
Former-commit-id: d4fad45364489efb957d29e201846e8c1875b9ed
2012-07-24 01:41:38 -07:00
John-David Dalton
d4688bd76b Adjust _.wrap docs and rebuild/update the minified build/docs.
Former-commit-id: b33c4489bde49c98e7e161d0f831e07388a9da22
2012-07-20 03:22:13 -04:00
John-David Dalton
befe0fccaf Cleanup _.isEqual comments and ensure _.isEmpty/_.size detect arguments objects correctly.
Former-commit-id: 75b044d27b990d55393bf27234aad6ce369f6abe
2012-07-20 02:06:13 -04:00
John-David Dalton
a192410498 Remove Narwhal link from README.md.
Former-commit-id: b8bd53c9a19ef18480db14cfa82545aa872416b1
2012-07-19 09:15:04 -04:00
John-David Dalton
d43ede3a11 Update vendor/underscore and backbone.
Former-commit-id: 614926653b0b1669f8a5533666adb0aecbd46c03
2012-07-19 01:32:47 -04:00
John-David Dalton
9848ffb77f Add _.countBy and related unit tests, benchmarks, and documentation.
Former-commit-id: 915eaf414883a1dc344a558b08c7a1337ab5a225
2012-07-19 01:29:51 -04:00
John-David Dalton
7487497d1f Update minified build and rebuild documentation.
Former-commit-id: e674d7a30c1e5745b0acf90e38aa5757b15a3423
2012-07-18 04:52:13 -04:00
John-David Dalton
be11c848f4 Add "underscore" build.
Former-commit-id: 44e9f4543631cbf342ae7571cf540214623352db
2012-07-18 04:51:08 -04:00
John-David Dalton
9836b274b9 Add _.drop, unit tests, and cleanup documentation for _.extend, _.defaults, and _.pick.
Former-commit-id: a45b0c45d52fdbe5f71984412d631f3dfe87965b
2012-07-18 03:55:16 -04:00
John-David Dalton
a96d14566f Add Underscore ticket reference to Fix cross-browser object iteration bugs bullet in README.md.
Former-commit-id: 9814daf6b81f1c60b3c6681c10c1fc7b94ac61b8
2012-07-18 02:15:16 -04:00
John-David Dalton
1c8cd8c168 Ensure reEvaluateDelimiter is assigned an initial value if evaluateDelimiter is undefined by default. [closes #52]
Former-commit-id: 6cefeeca164901e611009ce1413e5080027592c9
2012-07-18 01:53:15 -04:00
John-David Dalton
5f5806a98e Update CDN link and rebuild documentation.
Former-commit-id: 32210baffaed31b7fb4daed58a0c0a4f22daf4f0
2012-07-17 01:41:21 -04:00
John-David Dalton
624b045ac0 Add unit tests and code comments for the conditional compilation patch.
Former-commit-id: 557aa43dc7c8db738452a9f3afb8ff2aadf8061a
2012-07-17 01:39:51 -04:00
Jay Phelps
0f8bae950e Ensure running in IE if concated with other files that enable conditional compilation /*@cc_on @/`.
Former-commit-id: cf2d9c01ce92b8b85149116d48145bc4342471a4
2012-07-16 20:07:55 -04:00
John-David Dalton
fcede42903 Add Unit testing video link to README and minor cleanup to build.js help text.
Former-commit-id: 504b69acede1bb4759ba942d01dfd0b899715f00
2012-07-16 18:28:34 -04:00
John-David Dalton
5defe7d975 Bump to v0.4.2.
Former-commit-id: 48638d63970b9d4300661620b881ea34854d24d2
2012-07-16 14:34:48 -04:00
John-David Dalton
7e79903fe8 Update tests to work around QUnit 1.9.0 bug in Narwhal/older-Firefox and add platform.js to test/index.html.
Former-commit-id: eed8246c795735558ba9f499b86f08ed3970ccaf
2012-07-16 13:58:36 -04:00
John-David Dalton
a2fa52504c Ensure stringClass isn't stripped out when needed for certain builds and update dependencies for arrayClass, funcClass, objectTypes, and reNative.
Former-commit-id: 334973dcab4660733e1d081efe3602a167c452d9
2012-07-15 07:01:44 -04:00
John-David Dalton
2629f85e73 Update minified build and rebuild documentation.
Former-commit-id: 5b434ca8c22a44d1603dcc1e92bf4caea6fe00a1
2012-07-15 03:52:22 -04:00
John-David Dalton
8577816234 Add optimizations for large arrays to _.difference, _.intersection, and _.without.
Former-commit-id: 26d55a6a3340e77b5269b2003d20def3fe77bca9
2012-07-15 03:51:28 -04:00
John-David Dalton
e58d47a3b2 Add "strict" build.
Former-commit-id: fcdd8d36c9e0c6d698059541b97915ae1b28650e
2012-07-14 08:59:50 -04:00
John-David Dalton
c9c83ee7e6 Add _.invoke benchmark to perf.js and a link to the compatibility changes wiki entry in README.md.
Former-commit-id: 51296709ea8d9dd6e951530b9874b90af3c764a2
2012-07-14 06:21:59 -04:00
John-David Dalton
139693dce6 Optimize benchmark setups, cleanup perf/index.html, and add platform.js.
Former-commit-id: 228b7b6fd230638f9ec8c79eafa56506fc84b79a
2012-07-14 04:51:50 -04:00
John-David Dalton
f98193d822 Poll until Firebug-lite is loaded.
Former-commit-id: c568ed963fc5716c2c84d63aba45a8ef258c1e7b
2012-07-13 14:41:21 -04:00
John-David Dalton
8052f1ac9d Revert unstable Closure Compiler.
Former-commit-id: 81716f0c269ac8a5befbf584c0dc964777cc1e1a
2012-07-13 04:33:50 -04:00
John-David Dalton
4f78a06993 Add _.isEqual benchmarks.
Former-commit-id: 5b3ee06ea3f31f10e8fac96da8766cc1c4c2d3bb
2012-07-13 04:17:38 -04:00
John-David Dalton
6c4b4b392b Avoid expensive test setup in perf.js.
Former-commit-id: f1c1ed41cb86c83aba2c3f7da1dedf6a280221ad
2012-07-12 18:19:23 -04:00
John-David Dalton
268fe34238 Update Closure Compiler.
Former-commit-id: bfdbe43546f3861cbeaaa99644af68e95f2175d5
2012-07-12 16:54:17 -04:00
John-David Dalton
cc620205d6 Control "use strict" directive use in builds.
Former-commit-id: 66a9bdee5cc61710d7d42d685feba616ec855322
2012-07-12 16:25:30 -04:00
John-David Dalton
f0d7c97b7b Update test-ui.js to better integrate with QUnit 1.9.0.
Former-commit-id: 7e6083ebb54fde0ebaa9f4f4551bb190e602a370
2012-07-12 15:48:52 -04:00
John-David Dalton
660a6e9e4c Update minified build and rebuild documentation.
Former-commit-id: 6e747961d3d756d016a27b530bf961841a93bd00
2012-07-12 15:27:25 -04:00
John-David Dalton
3386c2a7a5 Avoid enforcing strict mode in _.defaults, _.extend, and _.bindAll and add benchmarks for _.bindAll and _.functions. [closes #45]
Former-commit-id: 1bb0b5155d3ae46052b4a06cb538dff307e8ec5e
2012-07-12 15:25:18 -04:00
John-David Dalton
9530efb4d4 Update vendor folder.
Former-commit-id: 363508c8d79afa1ec8c1aba48b5be58a8a572367
2012-07-12 13:32:48 -04:00
John-David Dalton
4293515b3d Add help and version options to build.js.
Former-commit-id: 95a9fdaa7a00550922e71ce01a3f742b845d082c
2012-07-12 13:31:42 -04:00
John-David Dalton
61105e0679 Cleanup inline documentation.
Former-commit-id: 1fa95d45c2c3d1fe50f5827f4743aad3c8b75f95
2012-07-12 03:27:15 -04:00
John-David Dalton
79a289c7e2 Update CDN copy link.
Former-commit-id: 4d0d26292eef227f343f6b482856482f8f554a43
2012-07-12 02:06:55 -04:00
John-David Dalton
46781e7614 Bump to v0.4.1.
Former-commit-id: ef73c95edc22d59412affba898d9820251c06b5b
2012-07-12 00:47:24 -04:00
John-David Dalton
1f3546a9f6 Cleanup pre-compile.js and build.js removing more unused vars missed by minifiers.
Former-commit-id: 198715b39ced1a33bd55109099af462ae96a7188
2012-07-11 23:37:12 -04:00
John-David Dalton
0dc88bb412 Fix template regressions. [Closes #44]
Former-commit-id: 15e98d86c290fea74780822b49b5d71e54064e01
2012-07-11 22:46:16 -04:00
John-David Dalton
971a26c123 Remove noArraySliceOnStrings from the mobile build.
Former-commit-id: 943f907672f211be4f3d1c2e8fe8d5769a0a569e
2012-07-11 12:48:37 -04:00
John-David Dalton
0976a3b721 Bump version to 0.4.0.
Former-commit-id: e3606a629e44711ad9174ac7c6690f2a53f088b9
2012-07-11 11:59:04 -04:00
John-David Dalton
d496361555 Fix failing unit test in Opera < 10.52 and add _.toArray benchmarks.
Former-commit-id: 0ed6d5c52b2486be4ccc212da7bbc7cb6d67cf7f
2012-07-11 11:29:44 -04:00
John-David Dalton
60ed65a73a Add utf8 encoding to the generated minified file in minify.js.
Former-commit-id: 2765e28a177ae2703d3b1a6328a35cf5c92fa6ef
2012-07-11 05:54:19 -04:00
John-David Dalton
d1407b3bd0 Add unneeded vendor folders to .npmignore.
Former-commit-id: 7be56b8081be64d41cc66914dce577695d9d0747
2012-07-11 05:40:25 -04:00
John-David Dalton
5ca2da76df Make build.js work as a npm executable.
Former-commit-id: fff327957854aa85a5abfe80994b59f3d0d24370
2012-07-11 05:39:30 -04:00
John-David Dalton
2ac887ff74 Make compiled templates more debuggable.
Former-commit-id: aba1aa3efcea6695632aae0eb61148aa3174debd
2012-07-11 01:52:50 -04:00
John-David Dalton
cbdc9c0be1 Make _.contains work with strings similar ES6 draft String#contains.
Former-commit-id: 3cfffdcddec3e1e8175da95043ec86ac3c6a85fe
2012-07-11 01:11:25 -04:00
John-David Dalton
b9bade8d5a Remove unused UglifyJS file.
Former-commit-id: cfefdb6796583cc55a16ce02533541e6395e4356
2012-07-10 23:22:01 -04:00
John-David Dalton
eb43786641 Cleanup unit tests.
Former-commit-id: 460ffc3bd38c98dd86fc8c74d4720eed5d50433d
2012-07-10 22:04:40 -04:00
John-David Dalton
0515db3d7c Add more false values unit tests for _.size and "Arrays"/"Collections" methods.
Former-commit-id: 475941321404ceec4eabb56fb9ee10855a653e12
2012-07-10 21:41:38 -04:00
John-David Dalton
db257778c0 Update vendor folder.
Former-commit-id: dde7c53eee254e2f50608e65540893764ab8d9cb
2012-07-10 18:14:15 -04:00
John-David Dalton
3b37d7489f Add legacy build info to README.md and rebuild minified file and documentation.
Former-commit-id: 83560976f173a3c797128b08fb184cc7c1e77319
2012-07-10 01:27:07 -04:00
John-David Dalton
329c7e8e05 Add custom-debug build to unit test runners and add unit tests for passing strings to "Collections" methods.
Former-commit-id: cb6c66d01a9f30908a27e689f8ffba5fa9f04299
2012-07-10 01:06:06 -04:00
John-David Dalton
fad9b4fa72 Add support for strings in "Collections" methods.
Former-commit-id: 1abb252101d20c9a01291f4cef19db8a7eeda743
2012-07-10 01:05:22 -04:00
John-David Dalton
c1a81279ed Rename test/ui.js to test/test-ui.js and add to .npmignore. [closes #40]
Former-commit-id: 80165ec342e8b833a28bbe66f59e074c8f4f5185
2012-07-09 07:54:35 -04:00
John-David Dalton
8bb35a17d2 Allow different builds to be tested more easily with a dropdown menu.
Former-commit-id: a692bda9708523aa0443acb35dd8fcc5a342ef3f
2012-07-09 03:56:43 -04:00
John-David Dalton
36415054ea Update minified build and documentation.
Former-commit-id: fc680301b9ae378139e5174e48eb8e4708fddba0
2012-07-08 18:10:10 -04:00
John-David Dalton
3e84cbae69 Add removeKeysOptimization function to build.js.
Former-commit-id: ce13e7b7a1f12199cdddcccbf0b7e0d98d6438ec
2012-07-08 18:08:41 -04:00
John-David Dalton
f5f2bf7f46 Cleanup iteratorTemplate and optimize methods that use mapIteratorOptions.
Former-commit-id: a0f876250a1c7875745e9080bf75546e16fbf6e7
2012-07-08 10:05:04 -04:00
John-David Dalton
acb6656958 Update minified build and documentation.
Former-commit-id: 19462dc946eca093f4265620b8e063b8c162c27d
2012-07-08 03:40:51 -04:00
John-David Dalton
9d70d7c27e Fix _.sortBy in the mobile build attempt two.
Former-commit-id: 8f54b16a901acc4ce91f071c5b36c632334f7dde
2012-07-08 03:39:38 -04:00
John-David Dalton
648a6afb25 Add object iteration benchmarks for _.filter, _.find, _.groupBy, and _.map to perf.js.
Former-commit-id: dc30e2c0e4f88b2a0164f02bf3bf92fd40a87012
2012-07-08 03:31:40 -04:00
John-David Dalton
57ae1925b1 Fix _.sortBy in the mobile build.
Former-commit-id: 0af3778e89e61effbe60347d6f0bcb33d8c37a2e
2012-07-08 03:30:16 -04:00
John-David Dalton
d49318582f Adjust how "mobile" build is created and add first pass at "legacy" build.
Former-commit-id: 740cc40c21d33353f34796ae6da3bc8ce015ab6c
2012-07-08 03:28:18 -04:00
John-David Dalton
83e3f830e6 Rename useNativeBind and useNativeKeys to isBindFast and isKeysFast.
Former-commit-id: 9f001b030dc49146b177678443406720c436ac0b
2012-07-08 02:47:01 -04:00
John-David Dalton
04d4353c0f Optimize object iteration using Object.keys where faster than for-in loops.
Former-commit-id: 8826f75cf6eaf4233758684e3aae2ccdc3c9f262
2012-07-08 02:04:57 -04:00
John-David Dalton
6d217fc097 Add propertyIsEnumerable check to _.keys.
Former-commit-id: 1dcd532d29b3e99ce54a18f4489c766652d56d83
2012-07-06 14:14:44 -04:00
John-David Dalton
9d7136c63c Add more checks to the reComplexDelimiter regexp.
Former-commit-id: 87fba2813619882d388261a1226e75503ec9b8d0
2012-07-05 15:04:09 -04:00
John-David Dalton
51a679d60a Add _.template unit test to ensure complex "interpolate" delimiters work.
Former-commit-id: bdfdbf00b1a1838e104919214012a9cfb39dda19
2012-07-05 13:19:45 -04:00
John-David Dalton
7d4d28614a Remove more unnecessary code from custom builds.
Former-commit-id: 7df2ebc805072456b9f0565a0a33fc1bcf2a4049
2012-07-05 11:51:40 -04:00
John-David Dalton
c75cfaf692 Update minified build and documentation.
Former-commit-id: 401c87b9755301440d2c86f7bfe618cc68db7e1e
2012-07-05 11:29:28 -04:00
John-David Dalton
fe6aa8a6fc Further optimize _.template by controlling how the with-statement is inserted.
Former-commit-id: a62331e771302f9390d5aca04f878b839fe11b69
2012-07-05 11:28:41 -04:00
John-David Dalton
a5fe1eb5fb Optimize how with-statements are inserted into compiled templates.
Former-commit-id: aabb0b1f8c6e910532464b7a007767801c00a640
2012-07-04 20:07:25 -04:00
John-David Dalton
5afd37c92c Update package.json and .npmignore to allow build.js.
Former-commit-id: 782a448163baa27275ca87da209db53441bdcb08
2012-07-04 20:06:35 -04:00
John-David Dalton
293d0409c6 Remove Cloning this repo from the README.md.
Former-commit-id: 4f95f8b9a6781b5b6207a95082415f97e4d4236b
2012-07-03 12:06:14 -04:00
John-David Dalton
4352f18dd3 Cleanup perf.js.
Former-commit-id: 53285a24dcb27857a05b07aa7a6a8840026f8c42
2012-07-02 17:59:09 -04:00
John-David Dalton
0ae7fe9df5 Add non-submodule vendor directory.
Former-commit-id: 392cdade55487e774e959013d8d25ae0b1dfe93b
2012-07-02 15:35:36 -04:00
John-David Dalton
5048f0422d Delete vendor directory.
Former-commit-id: 3d866435290966ec2f0d00561dcd99d0dfad29e0
2012-07-02 15:31:27 -04:00
John-David Dalton
c46a36f8ed Remove submodules and cleanup repo.
Former-commit-id: f3950601f2001ceb4f36db2a7f2efa28acc8472d
2012-07-02 15:22:48 -04:00
John-David Dalton
90e2bd0372 Correct variable declaration order.
Former-commit-id: 5f5a36057b065799dcc05b0054a2c88f00fad8c0
2012-07-02 03:43:01 -04:00
John-David Dalton
10fbc8a04b Update minified build and documentation.
Former-commit-id: 03b6f5fdf71ab1dab48f3fb06d60b6ec8a8e494c
2012-07-02 03:01:03 -04:00
John-David Dalton
fb818f3775 Cleanup lodash.js.
Former-commit-id: a1b7dc187dbd562b62d3446ce731674e0bb539d9
2012-07-02 03:00:01 -04:00
John-David Dalton
434e23c209 Add _.template benchmarks.
Former-commit-id: 97c5a90825d6a9a0b876d8c9f90e621f00389766
2012-07-02 02:59:33 -04:00
John-David Dalton
fe53bd6475 Fix build for _.bind.
Former-commit-id: 59ef841bca271bed05555c4b40e32b85ee1a4d37
2012-07-02 00:26:16 -04:00
John-David Dalton
268ce91c65 Add _.bind and _.size benchmarks.
Former-commit-id: bb3517e9517db81de56e3794abc256cd2dac59b5
2012-07-02 00:07:55 -04:00
John-David Dalton
3b4074bfc7 Optimize _.template when no evaluate delimiters are used and optimize _.bind when partially applied in V8.
Former-commit-id: 25489d41ba3cac7ac3f1414e09f1971a11a779be
2012-07-02 00:07:22 -04:00
John-David Dalton
6af4652161 Optimize inlining the iteratorTemplate for builds.
Former-commit-id: 8b7ac4622e51dbe5c0364f3c6781aa474dcfa96e
2012-06-30 03:06:21 -04:00
John-David Dalton
3717d30188 Update Backbone and Underscore submodules.
Former-commit-id: 0cdf988c89269ff95eb0d7fbd0bc51cbe95d3524
2012-06-29 20:41:51 -04:00
John-David Dalton
4cf2e83418 Add _.zipObject.
Former-commit-id: 0fe17adc359fbc608025dced32f6dd509d019413
2012-06-29 20:41:12 -04:00
John-David Dalton
1228639103 Cleanup build.js.
Former-commit-id: 01f5488ddba9f51344561c8df493d4f1bc6b0ef9
2012-06-29 19:33:36 -04:00
John-David Dalton
e12d67de94 Update minified build and documentation.
Former-commit-id: f4c5987a37d5c22f9705495e3a49a497f009d01c
2012-06-29 19:09:13 -04:00
John-David Dalton
10bcb37ca5 Inline more functionality into _.sortBy.
Former-commit-id: 6549e86881b7a93d96854a9ac1b04f0f5a5db0f1
2012-06-29 19:07:05 -04:00
John-David Dalton
e973598bff DRY out isType methods and simplify templates during the build process.
Former-commit-id: cd982282a5de63fddc36d1dc4759c8982e1c5ad4
2012-06-29 19:05:30 -04:00
John-David Dalton
3a5129694d Update documentation and minified build.
Former-commit-id: 193568c6f99736971ef93f9c4d63bc72195b8b2b
2012-06-29 04:03:02 -04:00
John-David Dalton
a1e0fbea8b Add issue reference to README.md.
Former-commit-id: 09ed4e386b55f657d8710f40c14fb3b283d66b7c
2012-06-29 04:01:58 -04:00
John-David Dalton
0bf374454e Add scripts entry to package.json.
Former-commit-id: 9ab2b915ea8aa6c3b8c28b5d14eaa32613db7ed0
2012-06-29 04:00:35 -04:00
John-David Dalton
5e592fbf29 Merge branch 'master' of github.com:bestiejs/lodash
Former-commit-id: a4de2b320b871d2bfd689890fc526605215091bf
2012-06-29 03:58:54 -04:00
John-David Dalton
ad4101bc99 Optimize _.sortBy and remove the _.map dependency from _.sortBy.
Former-commit-id: f6a133f0d27e7a00cb54e2e8478066dcfbe05659
2012-06-29 03:11:31 -04:00
John-David Dalton
2d057d92cf Merge pull request #38 from davidmurdoch/00d1cc9bf84355f35268d24201e02feaec6a00b1 [formerly d387147685f95cf88a437e678c873181cbcb907f]
Use `null` when comparing `null`/`undefined`.

Former-commit-id: 16c513648279e37a72eb433bd9b5fbe840854376
2012-06-28 22:21:18 -07:00
David Murdoch
00d1cc9bf8 Use null when comparing null/undefined
for non-strict equals. Saves 2 gzipped bytes.


Former-commit-id: d387147685f95cf88a437e678c873181cbcb907f
2012-06-28 09:56:10 -04:00
David Murdoch
2c1ec5fe75 Save 2 gzipped bytes by flipping args in math.max
Also, remove some stray whitespace.


Former-commit-id: 98b4711bc7d978ef66a693593d6be108f6bcfd8d
2012-06-28 09:45:14 -04:00
John-David Dalton
81b28d005d Remove arguments object from _.range.
Former-commit-id: d3da531e33bcd00a00ff80986f56196ac1b6f2c5
2012-06-27 13:51:46 -04:00
John-David Dalton
6a90616b99 Cleanup README.md.
Former-commit-id: 1a07361430f1d20382beb277db17e94967fd791d
2012-06-26 04:08:11 -04:00
John-David Dalton
d5be43695a Merge pull request #35 from tomByrer/master
Add CDN and jsPerf links to README.md.

Former-commit-id: b2ba93fb493536060c9abb13f406db9fd84d0ea4
2012-06-26 00:31:43 -07:00
John-David Dalton
0a93b81ae7 Update minified build and documentation.
Former-commit-id: 3b2d6cbd0c91933043c64b6f15a4c990a5c400c5
2012-06-26 03:28:08 -04:00
John-David Dalton
65f8da1654 Make _.size work consistently cross-browser with arguments objects and avoid erroring when falsey values are passed.
Former-commit-id: 76dc852a4e1fd84218f9c57f44c93e483a3680d9
2012-06-26 03:23:53 -04:00
John-David Dalton
911014db95 Avoid compiling unnecessary _.template code.
Former-commit-id: 74006fd2df2b5d2ba8a222baf21574f729f34bcb
2012-06-26 02:32:43 -04:00
John-David Dalton
313ee13f18 Move _.groupBy and _.sortBy back to the "Collections" category. [closes #34]
Former-commit-id: ce0f7f906758ce13cc2ea927520ac401e6bba9f6
2012-06-26 02:18:44 -04:00
tomByrer
addad04c44 Update master
Former-commit-id: c61735bdbf4dbad6dfd15a03660901fca9043327
2012-06-19 20:34:28 -06:00
tomByrer
e3789e5b64 merged tests with Dive in section
Former-commit-id: 1b32a93390d9b806bd66a298d558e68588ba7574
2012-06-19 20:32:49 -06:00
tomByrer
410315ce35 + CDN usage link
+ testing links

Former-commit-id: 79740ec7b2ac8c088545ca585ab5d3d94c804e2a
2012-06-19 20:23:58 -06:00
tomByrer
90998da308 + cdn js' hosting
Former-commit-id: 4276796f0fa31602060860da9c45c43dce34e8c4
2012-06-19 19:53:50 -06:00
John-David Dalton
6fa5b13e10 Add comment explaining a V8 optimization.
Former-commit-id: 733f0985509467291287e1e0a95fcd22114cdbcf
2012-06-19 11:42:27 +02:00
John-David Dalton
93067c2d52 Update documentation and minified build.
Former-commit-id: 156cdcff42eb4fef4a982e5b3016030246ba9f63
2012-06-19 10:56:05 +02:00
John-David Dalton
b2079b7007 Leverage _.indexOf's fromIndex in _.difference and _.without.
Former-commit-id: 0fd092d2ee109b99a50791899e7f2d690b3852af
2012-06-19 10:54:23 +02:00
John-David Dalton
b643dd074c Clarify benchmark descriptions.
Former-commit-id: 79c71d7d2c034ebe31f20f5d10251a8ba175cfd8
2012-06-16 20:35:55 -04:00
John-David Dalton
a3932c75e1 Move screencast links to Vimeo.
Former-commit-id: d9f48294d88ff50889c0859b3c1956d0e49a3bd4
2012-06-16 09:34:36 -04:00
John-David Dalton
1cd3b9ec47 Add 3rd screencast link to README.md.
Former-commit-id: c714180beab13c911f9d1676cb65117186a9524a
2012-06-15 17:21:45 -04:00
John-David Dalton
0c77f42080 Fix documentation typo, s/uiq/uniq. [closes #32] [cheeaun]
Former-commit-id: 343ff0d9a7238ab7eec6d5cc75b5c7dff3de1925
2012-06-15 09:12:03 -04:00
John-David Dalton
cea122db38 Update submodules.
Former-commit-id: 53394993a20cacf965de52e382ff72399d2b89ad
2012-06-15 00:12:06 -04:00
John-David Dalton
966f9fcd07 Update unit test link in README.md.
Former-commit-id: 0c11e69795cd0a28f0b370c40b7a6197fe712d0a
2012-06-14 15:30:37 -04:00
John-David Dalton
6ce9df8504 Bump to v0.3.2.
Former-commit-id: ff3cac0ce890b46a45c8738d559f68ac63b80caf
2012-06-14 15:19:09 -04:00
John-David Dalton
2a0b223896 Simplify dependencies in build.js.
Former-commit-id: 2d154d1dfb4d639aa32c5e9aeaeea6942965aee7
2012-06-14 02:17:09 -04:00
John-David Dalton
c2db180829 Tweak _.sortedIndex for Chrome optimizations.
Former-commit-id: d1d9f1bd1ecfd3bcde98aa51423e05e128f6ffd4
2012-06-14 01:06:08 -04:00
John-David Dalton
3223e4ffa5 Update documentation and minified build.
Former-commit-id: 5472dccceb33c3575c538190472dde0e82bcfcde
2012-06-14 00:29:14 -04:00
John-David Dalton
24c9b6e211 Move _.pluck and _.invoke back to the "Collections" category and optimize _.sortedIndex when a callback is passed.
Former-commit-id: d16763e7d35660d8ba9ea976c8b2a4dc20f1211f
2012-06-14 00:28:36 -04:00
John-David Dalton
e5555dd26a Move _.tap to the "Chaining" category, and deprecate _(…).chain, _.isNull, _.isUndefined, _.result, and _.size.
Former-commit-id: 64ee67758b8730fd70cbb28af4230bb336b91214
2012-06-13 15:26:46 -04:00
John-David Dalton
ee2d0ddf8a Ensure custom builds generate lodash.custom files.
Former-commit-id: c89ee640688f6f598bb2d3834f714f0edc4ce7a4
2012-06-13 15:15:20 -04:00
John-David Dalton
aef130b396 Update submodules.
Former-commit-id: 801d3c7413cb5906b4a517639098a6a32d015cba
2012-06-13 00:21:03 -04:00
John-David Dalton
fbdadec5e5 Add _.throttle unit test for recursive calls.
Former-commit-id: 7208516b56905c83df73aef6b02cee0101602349
2012-06-12 23:53:03 -04:00
John-David Dalton
a068339079 Indicate slow paths in perf.js.
Former-commit-id: 561e4f0957934b25422f7f515678705be4af726f
2012-06-12 23:44:21 -04:00
John-David Dalton
3f07d3ec55 Remove the useSourceURL variable from the minified build.
Former-commit-id: c0f02e7e87c533220a99ebe99c9ee08516fb9deb
2012-06-12 20:15:52 -04:00
John-David Dalton
62e7da9d8a Update docs and minified build.
Former-commit-id: d0673323dc850f4e7936f00374905cd29c5d6e24
2012-06-12 19:29:01 -04:00
John-David Dalton
b60d43e5f6 Ensure sourceURL support doesn't cause errors in Adobe's JS engine.
Former-commit-id: 2ad1214e6a58832c732499b272ebfc434953213b
2012-06-12 19:28:47 -04:00
John-David Dalton
a5873a3158 Add comments, documentation, and update the minified build.
Former-commit-id: c65665063f254b1ba9dab9c6948fedf29f1e795f
2012-06-11 22:49:24 -04:00
John-David Dalton
3a698eb0ed Make _.escape match _.template's escape delimiter results for null and undefined values.
Former-commit-id: b6717c6debf3bc308cf12b778916f5a46dbb954d
2012-06-11 22:37:54 -04:00
John-David Dalton
1e2ef542e4 Bump to v0.3.1.
Former-commit-id: 2e1e3b7e47b1f98d2ca20a89a4570a0b958d4323
2012-06-11 00:09:29 -04:00
John-David Dalton
94e8af4d93 Update submodules.
Former-commit-id: 0658ae9b9e49c468f839738f34c9f6361b90897e
2012-06-10 23:58:43 -04:00
John-David Dalton
250a0ab5eb Add _.shuffle benchmark.
Former-commit-id: 13a0a7392108571d4ebced5e6e6ff66048091983
2012-06-10 13:46:45 -04:00
John-David Dalton
2da05d88a0 Add another code example to _.invoke documentation.
Former-commit-id: 0bea74a470771ebc5cf2110243b38db3698cde52
2012-06-10 12:59:42 -04:00
John-David Dalton
7faa849a89 Cleanup README.md.
Former-commit-id: 1cc58476c5737624b97801aabc0dc7368c43c0d3
2012-06-09 03:23:39 -04:00
John-David Dalton
c5bceb8fc8 Update documentation and minified build.
Former-commit-id: edc6264f5721cbdb080c4f7772263848c125b3e2
2012-06-09 03:11:36 -04:00
John-David Dalton
1e94b93ce6 Add Backbone build and correct dependencies for _.bindAll, _.mixin, and _.sortBy.
Former-commit-id: 3d4413d6ab3b41471be6336d138a4b4bfa97fde7
2012-06-09 03:10:57 -04:00
John-David Dalton
3f7bccf2e6 Update Backbone and Underscore submodules.
Former-commit-id: 6f938216d0bb26347ce7fd42169f926e2ae04e0e
2012-06-09 00:31:03 -04:00
John-David Dalton
181b869109 Remove _.map and _.pluck dependency from _.sortBy and simplify method wrappers.
Former-commit-id: 915af96abd41e8da7bba88cd57eb703f8129107f
2012-06-09 00:29:51 -04:00
John-David Dalton
2332245be1 Update minified build and documentation.
Former-commit-id: 6790d25b2164f0df2dcce63d5a5780343f3b5e63
2012-06-07 12:44:53 -04:00
John-David Dalton
3c6999f3a4 Ensure all "Arrays" category methods allow a falsey array argument. [closes #23, #24]
Former-commit-id: 66d09d3c8f3c045daf310c46581afa085daa57de
2012-06-07 12:42:33 -04:00
John-David Dalton
5f2f15b976 Remove _.isArguments fallback from mobile build.
Former-commit-id: d98ac9953e9b403e17bdcef099caafe09873980f
2012-06-07 03:27:01 -04:00
John-David Dalton
47dfb5b6b7 Fix typo in _.values benchmark and tweak how percents are displayed in perf.js.
Former-commit-id: 49be4600561e55e134d3152b00c765e305af98b5
2012-06-07 00:07:33 -04:00
John-David Dalton
c410c1293e Update minified build and documentation.
Former-commit-id: e489b826c65d908b934e13d032ed866d68edd576
2012-06-06 23:48:41 -04:00
John-David Dalton
ca1c732f31 Move _.values to Objects category.
Former-commit-id: e85229b53a7697c11f76eae02aef8a4fce3aec3a
2012-06-06 23:45:30 -04:00
John-David Dalton
5e8c373bf4 Move _.pluck to the Arrays category.
Former-commit-id: a3ba36c1c320c8685c25fcb0bbe16ba2baeb6731
2012-06-06 23:11:25 -04:00
John-David Dalton
51a459fe48 Simplify function checks and cleanup documentation.
Former-commit-id: 460f34725e212ced27831b9aad1e9e7e2fc02cf1
2012-06-06 15:56:40 -04:00
John-David Dalton
03c07abbc3 Update README.md.
Former-commit-id: 64ce8f122be084fd93fd711a6ca207fc4ae6b870
2012-06-06 15:05:52 -04:00
John-David Dalton
5eabe1a172 Add sourceURL support to _.template.
Former-commit-id: 31d40d57f903098fe1678777aa7921e72d1dca9e
2012-06-06 15:05:41 -04:00
John-David Dalton
5b6ea7afb2 Bump to v0.3.0.
Former-commit-id: 2b713b3d926e3dbba80eab6e1e14d080f169bf39
2012-06-06 00:52:57 -04:00
John-David Dalton
7c1c5e70ca Update Backbone and RequireJS submodules.
Former-commit-id: 145455767d22eb1b03a751024e69826e2387fd04
2012-06-06 00:50:31 -04:00
John-David Dalton
d475f8f965 Fix documentation typo.
Former-commit-id: 85e89c893d358d196a3f0f04b95acb10bbca2771
2012-06-05 01:44:50 -04:00
John-David Dalton
fd239076dd Fix minified build for _.forIn.
Former-commit-id: 1d5d41fe63a10ccae8fcf4a91e7e77526a7c0d9c
2012-06-05 01:07:46 -04:00
John-David Dalton
5f786bbe47 Add category build option.
Former-commit-id: 4adea9367949985a1218cff58ff856184fd11db7
2012-06-05 00:41:20 -04:00
John-David Dalton
f66dc6bed8 Fix typo in iteratorTemplate.
Former-commit-id: b787391db088e672c55ca56ca246147557b3694f
2012-06-04 22:49:33 -04:00
John-David Dalton
52c36ac445 Fix documentation typo.
Former-commit-id: defc89d6a8267a4a6626ca6ac7345db1d55cb9b6
2012-06-04 16:54:47 -04:00
John-David Dalton
8f6a78cba5 Update documentation and package.json.
Former-commit-id: 4ab7d954b7abc5f73269eb7c74a39b02fa04970d
2012-06-04 16:38:37 -04:00
John-David Dalton
7053e9113f Add unit test for _.sortedIndex to ensure it supports arrays with high length values.
Former-commit-id: 8956495dfa40c75dcb3c0585e78913607bf92e99
2012-06-04 16:18:23 -04:00
John-David Dalton
89f9ab9940 Bump to v0.3.0-pre.
Former-commit-id: 1e7958b4b1cdffd962a51edf3e3695cea960d8c9
2012-06-04 15:44:54 -04:00
John-David Dalton
240bc40b39 Ensure collection methods treat array-like objects with invalid length properties as regular objects.
Former-commit-id: dd8b382635bc30dc6e417cd9b47c36abfdf5ddcb
2012-06-04 15:36:27 -04:00
John-David Dalton
74649b5f28 Add _.forOwn and _.forIn.
Former-commit-id: f4e94a0fd15318063eec16c464435b07f419fa6a
2012-06-04 14:45:06 -04:00
John-David Dalton
b484d4b2dc Update minified build and documentation.
Former-commit-id: 592319b69487858794529d789383af1b38d55632
2012-06-04 02:23:16 -04:00
John-David Dalton
da1124dd37 Switch to an htmlEscapes object for use in _.escape.
Former-commit-id: bc449b5d6868c846d599840e5c0d90d0314fe4b8
2012-06-04 02:12:41 -04:00
John-David Dalton
210485d0be Update Benchmark.js and UglifyJS submodules.
Former-commit-id: 78611de2f992dc4d6cc4d336bfb761b98b22ce79
2012-06-04 00:08:26 -04:00
John-David Dalton
d9aee5ae60 Update minified build, documentation, and Backbone submodule.
Former-commit-id: cca2cf2f55e2750486d1d32b8da26fbc5576a65b
2012-06-03 21:58:35 -04:00
John-David Dalton
9ac64623fc Added thisArg argument to _.sortedIndex and _.uniq, benchmarks, unit tests, and adjusted related dependencies in build.js.
Former-commit-id: a97aa769d760c7cc4d0df6307cebc860345a0da0
2012-06-03 21:56:36 -04:00
John-David Dalton
6ea4226680 Remove unneeded Closure Compiler export around the template string _.escape(__t) in pre-compile.js.
Former-commit-id: 812bd220cd3baca30a100f07e1d47cd6745a3602
2012-06-03 20:36:31 -04:00
John-David Dalton
c1416bba39 Cleanup console messages in perf.js.
Former-commit-id: b3e669d46f21d39f96873167557b4ede80458beb
2012-06-03 20:35:22 -04:00
John-David Dalton
ddb3ab3238 Tweak indexOf isSorted benchmark.
Former-commit-id: 0183b35929a2c1f7113747a67f55abbc797fab8c
2012-06-03 01:06:12 -04:00
John-David Dalton
5e7c9698c7 Use typeof == 'number' more, and default callback values to docs.
Former-commit-id: 02786903a510d0cc837eeeb7e9f42db2ecd634a4
2012-06-03 01:05:40 -04:00
John-David Dalton
4c66b95516 Make Firebug Lite console fullscreen in more browsers.
Former-commit-id: a42e7d187a582a1caea721860cf3ed4bd0f94368
2012-06-01 07:41:29 -06:00
John-David Dalton
2d03060a0d Make previous build.js regexp simplification non-greedy.
Former-commit-id: e58cfb5e5143e12721bb08445dfd4a6fec119cd1
2012-05-31 23:18:44 -06:00
John-David Dalton
3313b0aa42 Update minified build and docs.
Former-commit-id: 3c0463d77c9091c1e66c7d68240de8b7ab2e499f
2012-05-31 22:54:50 -06:00
John-David Dalton
5d2928d2b3 Simplify regexps in build.js.
Former-commit-id: 7640f90b6aeca0438579c15c9eef270904c2c523
2012-05-31 22:54:37 -06:00
John-David Dalton
f6e2ae41d6 Add more benchmarks.
Former-commit-id: bddb4a26073ecd5aaf622f9726be940b6340cc07
2012-05-31 22:11:07 -06:00
John-David Dalton
7ccb038b6d Add _.isEmpty unit test.
Former-commit-id: 066961a929da280421083d3f9d66b838d3d29dfd
2012-05-31 17:40:47 -06:00
John-David Dalton
7d62bbf74f Optimize _.times.
Former-commit-id: beae48853d0e9be1c3016c11bee86a272964dfa2
2012-05-31 17:37:01 -06:00
John-David Dalton
3d8cc32302 Add fromIndex to _.indexOf and _.lastIndexOf. [closes #20]
Former-commit-id: 3ab67c318a5a7fc2e521a9a2573b694e6920b14d
2012-05-31 17:26:45 -06:00
John-David Dalton
861eea5148 Fix "prototype" iteration bug with _.keys.
Former-commit-id: 1e072b2639e21a5c0a920db0ac27693ade34b009
2012-05-31 10:29:33 -05:00
John-David Dalton
b432721fe5 Optimize this binding in iterator methods and remove _.bind as a dependency for several methods.
Former-commit-id: 60af002cd80758fea81fbff9c2b20b1ccf3ccffd
2012-05-31 10:21:38 -05:00
John-David Dalton
f13a0cc7e0 Format numbers and scroll down results panel in perf.js.
Former-commit-id: 9f80b5534e3b46be7ad9c84ebb7e9ed5afdc35b8
2012-05-30 09:19:58 -04:00
John-David Dalton
1f7e37a1a3 Change performance link in README.md to lodash.com benchmarks.
Former-commit-id: 5c851961fd1b8e46599c28967d782551722a03d4
2012-05-30 04:03:14 -04:00
John-David Dalton
548e9cac26 Update documentation.
Former-commit-id: 6d1aa50111b34e0548f96a55fe3dcca0b7e91b5e
2012-05-30 03:52:59 -04:00
John-David Dalton
0d2a1641c9 Add percent faster than to pref.js results and link to benchmarks in README.md.
Former-commit-id: 1c5fb820fe070599aba780f1765538d408105af3
2012-05-30 03:51:44 -04:00
John-David Dalton
a67281f8e7 Cleanup README.md.
Former-commit-id: b0d0a22ff427b6a5754e2850e2a420e764a1eb39
2012-05-30 01:48:28 -04:00
John-David Dalton
281475e6ef Bump to v0.2.2.
Former-commit-id: c4516d1e2dd2ab4359233121a7f86c356425cebf
2012-05-30 00:21:06 -04:00
John-David Dalton
a5712fc873 Cleanup build.js and fix regression in minified build. [closes #19]
Former-commit-id: 3b455cb277fa8c3fc70efca7b54c6746cde2ea6b
2012-05-29 15:52:02 -04:00
John-David Dalton
205ded45e2 Update submodules, minified build, and documentation.
Former-commit-id: 526a3d4e7b68da2072163a656566ff777b591b2d
2012-05-29 10:18:32 -04:00
John-David Dalton
8ef039b9db Update unit test with _.templateSettings.variable change.
Former-commit-id: e29718c70b0b0bcfeaf54909a32366d12663984d
2012-05-29 10:17:55 -04:00
John-David Dalton
3d2428b278 Merge branch 'master' of github.com:bestiejs/lodash
Former-commit-id: a2b22208dc08b404bd1fbdde9f1d05253c0fc047
2012-05-29 10:14:54 -04:00
John-David Dalton
35d5704e3f Change the default value of _.templateSettings.variable to obj for Underscore.js compatibility. [closes #16]
Former-commit-id: da91e5c881e6b3f9e2108cc231e57c023884b251
2012-05-29 10:14:40 -04:00
Mathias Bynens
c1860d30d6 Optimize escape() by not needlessly escaping the / character
Ref. #18.


Former-commit-id: 82a29019daa15c83cb2159685ca5d575265cd902
2012-05-29 16:11:08 +02:00
Mathias Bynens
e0fba5cb51 Fix typo in build script
Former-commit-id: 1f5327ea167ba88c00c6fcff5bbad3d64be6049b
2012-05-29 14:40:03 +03:00
John-David Dalton
570ba189ed Update docs and minified build.
Former-commit-id: d07b191ef424d6dce31e690e4af5293eb1525313
2012-05-26 03:40:27 -04:00
John-David Dalton
e335e0fd72 Add mobile build support. [closes #14]
Former-commit-id: a73e3ea444f04027e28beeb9d007a19c169c4fa9
2012-05-26 03:40:06 -04:00
John-David Dalton
74a2d8dcb1 Update Backbone and Underscore submodules.
Former-commit-id: 13de1bae42bbbae7ca138bc5d26b83fd66367343
2012-05-26 00:12:43 -04:00
John-David Dalton
43ea0c9072 Reword unit test and add entry to README.md.
Former-commit-id: e5d68317bb8f2688c256de096c58e1b49014a68c
2012-05-26 00:09:41 -04:00
John-David Dalton
dde3eb2e36 Update _.find dependencies.
Former-commit-id: 88e6c8dec2cf62d348bc570c0f3f9bfa23a9dc5c
2012-05-26 00:09:11 -04:00
John-David Dalton
2008bf90af Tweak _.find to avoid using _.identity and add benchmark.
Former-commit-id: a881f90d00828ed6af5b2b0bc80c9ae6e2cb2da8
2012-05-26 00:07:50 -04:00
John-David Dalton
06ffa93bd0 Update minified build and docs.
Former-commit-id: f9c076e5254c563c714bccf7cd5d65b6716cd427
2012-05-25 15:46:29 -04:00
John-David Dalton
5da03cac79 Add pseudo private property in preparation for mobile builds.
Former-commit-id: d5812d968b7694c9778f1be7efa8d05f95789ec8
2012-05-25 15:16:39 -04:00
John-David Dalton
8a5eb89aa8 Ensure _.find returns undefinedwhen a value cannot be found. [closes #15]
Former-commit-id: e6dc89f98a1df81e1b1d67c5e8f5725e4df3bc5a
2012-05-25 15:15:16 -04:00
John-David Dalton
f81ede2fd6 Update changelog with intersect removal.
Former-commit-id: 5902c720c1403b856ac213e293619c31ea6834f5
2012-05-24 18:02:35 -04:00
John-David Dalton
6f7df67ded Cleanup README.md.
Former-commit-id: 6ad747a8ae56f32fd558bd141af6fe95847569ad
2012-05-24 17:50:20 -04:00
John-David Dalton
bb9ad69219 Bump to v0.2.1.
Former-commit-id: d433d39ac7269479f1b9ac3803e62c5021f41e11
2012-05-24 17:08:26 -04:00
John-David Dalton
8f7667a524 Simplify _.max, _.min, and _.bind.
Former-commit-id: 1da0b013d0c47748d757e90248eebe9ed51918ae
2012-05-24 10:02:32 -04:00
John-David Dalton
86e125a6f3 Update minified build and docs.
Former-commit-id: 8c96c3812064f93d404e6d6dda68ab7a865d4228
2012-05-24 02:24:40 -04:00
John-David Dalton
8b3ba13ff0 Cleanup perf.js.
Former-commit-id: 8799b7d384cc48bc1c8ea3289aa12e021be2b97b
2012-05-24 02:23:55 -04:00
John-David Dalton
82f062caf2 Sync with Underscore.
Former-commit-id: 2e3aacd53fef6d22d830dbc2d6c220808aea8739
2012-05-24 02:06:10 -04:00
John-David Dalton
67303eb9fb Update Backbone and Underscore submodules.
Former-commit-id: 43178330e273531286982e34acf96dadf9586f03
2012-05-24 01:43:54 -04:00
John-David Dalton
af3ded68c4 Cleanup _.bind.
Former-commit-id: d974cdfa52c3f6c175e57f0970380bcc9276c35d
2012-05-24 01:40:24 -04:00
John-David Dalton
b94eb44e18 Update minified build and docs.
Former-commit-id: 525d891914a86b1f7167c9dd82b9deaaad453058
2012-05-24 01:30:48 -04:00
John-David Dalton
c62b24b024 Make _.bind follow ES5 spec so it will work with a common Backbone pattern. [closes #11]
Former-commit-id: 8d5e399ca9727a32604601f81fffd9134104c8f4
2012-05-24 01:25:08 -04:00
John-David Dalton
baa37450cc Tweak export order for r.js.
Former-commit-id: 81f8f3feae9228e99978710c0193a9d26bb9b519
2012-05-23 17:06:21 -04:00
John-David Dalton
231fd46cd2 Ensure applet is hidden in perf/index.html.
Former-commit-id: ee23b966eca9148bbecd8d0826d954e755d232fe
2012-05-23 17:00:49 -04:00
John-David Dalton
b2728d9902 Update docs.
Former-commit-id: 462a64eeb8f8afb0951d8449f0f7b766abbcf5cc
2012-05-23 14:52:15 -04:00
John-David Dalton
451a33f526 Add _.difference, _.pick, and _.union benchmarks.
Former-commit-id: 1dd1e577520dfc1a69876eeccadce871f1f05916
2012-05-23 14:30:45 -04:00
John-David Dalton
3670bce918 Add _.flatten test to ensure consistent behavior with sparse arrays.
Former-commit-id: 5505f4d0542596e4c6469aa038fa1bfecaa79800
2012-05-23 14:28:51 -04:00
John-David Dalton
afb041b23c Update docs and minified build.
Former-commit-id: 8ece30dc91c7cd9fe9f936fdf09e6d673566eaef
2012-05-23 02:20:25 -04:00
John-David Dalton
5315058e2d Simplify _.flatten and add benchmarks.
Former-commit-id: f541328bf680a75abea68bce813820def375f4a0
2012-05-23 02:19:35 -04:00
John-David Dalton
26d9cc972e Add unit test to test to ensure _.groupBy only adds elements to own, not inherited, properties of the result object.
Former-commit-id: 61dcdd0f6172db66d62e97873c1bc3053e339342
2012-05-23 01:25:34 -04:00
John-David Dalton
52ae87812e Update docs and minified build.
Former-commit-id: f019b90d5e866bf2a6da1c003001d0e9345bb0b1
2012-05-23 01:01:35 -04:00
John-David Dalton
f8af24b383 Remove unneeded variable references.
Former-commit-id: ab2f5f4408db25dc63b5d85b4adf156f9f978711
2012-05-23 00:52:39 -04:00
John-David Dalton
b38947146e Move _.groupBy and _.size to the "Objects" category and shuffle method order to avoid extra private variables.
Former-commit-id: 8dc89136a3bf2ed94f594f5c1c1f97a0dd7291c4
2012-05-23 00:43:23 -04:00
John-David Dalton
5c48abff4b Add links to relevant sections in the description.
Former-commit-id: da9e65fadae73792cfb2ec885318bc073d4468c3
2012-05-22 13:10:43 -04:00
John-David Dalton
3994c7fc2b Update docdown submodule and README.md.
Former-commit-id: 745eccb03a7eed1f3f2ef696002c57d6fcc44d25
2012-05-22 13:01:14 -04:00
John-David Dalton
859f2b2f3b Cleanup README.md.
Former-commit-id: 378c558d55f267b0469be8622881b1501c4907fc
2012-05-22 00:11:41 -04:00
John-David Dalton
f5040a7bec Cleanup .npmignore, and .gitignore.
Former-commit-id: 2309e25274dcceca8e05c2c570594d9adbe1c669
2012-05-22 00:11:27 -04:00
John-David Dalton
a604494aa9 Bump to v0.2.0.
Former-commit-id: 4b5cfd178edce968244a1fcad8c7b74e336e0f08
2012-05-21 15:55:52 -04:00
John-David Dalton
eaaef83ace Update README.md for version bump.
Former-commit-id: dceae7cfcfade966145032cbf1d787e309e529c2
2012-05-21 15:34:09 -04:00
John-David Dalton
9cf1424d8f Cleanup JSDoc comments.
Former-commit-id: ce8e7885528c1a7097cf6b73a713c960a20f85f6
2012-05-21 15:33:45 -04:00
John-David Dalton
cb74e45b89 Cleanup docs.
Former-commit-id: 346b2f7c55e3d0eb3b86f19c05fa9964f998b483
2012-05-21 12:26:53 -04:00
John-David Dalton
1da0498f74 Cleanup the README.md.
Former-commit-id: a01247eeb5c4602a3c209ed15753cbf2af32fdbf
2012-05-21 12:09:11 -04:00
John-David Dalton
754b1de597 Cleanup and prep for v0.2.0.
Former-commit-id: 27fb5b6ce649bedae9ba8127278322a037075e41
2012-05-21 11:32:43 -04:00
John-David Dalton
7e39941ad3 Reverse order of environments in run-perf.sh.
Former-commit-id: 8ee0ed5dd569c4e7dd32badd7aabe2e29b579b60
2012-05-21 10:05:08 -04:00
John-David Dalton
79a27b18ce Fix regression on adding the copyright comment header to minified builds.
Former-commit-id: b3ec50141716e9132ea629de3a14c22f718d25ab
2012-05-21 09:59:06 -04:00
John-David Dalton
194551fdbf Make build.js less picky about comma separated method names.
Former-commit-id: 8624cfaad62ddd4921baaea1ece20730ced680bf
2012-05-20 23:40:18 -04:00
John-David Dalton
5a82c8f89b Update minified build and docs.
Former-commit-id: 3aa2cb29b041c4031dd196d06c1914b42e4773c2
2012-05-20 23:18:09 -04:00
John-David Dalton
2e540368eb Fix _.extend regression in IE < 9.
Former-commit-id: 65632fbbf3aaba0d9cd8578300f8025e311faff0
2012-05-20 23:11:04 -04:00
John-David Dalton
d5966ae5db Update minified build and docs.
Former-commit-id: 4ad3460c6b1a518c5299a8d11fbd322705b3a963
2012-05-20 20:39:41 -04:00
John-David Dalton
97f4dfc089 Add comment explaining JavaScript engine's arguments.length limit and add shim file to underscore.html.
Former-commit-id: ace6dae609cab05b86ddc60a7f8c980447da2bdc
2012-05-20 20:38:32 -04:00
John-David Dalton
b03c2b3b8f Make custom build regexp less picky and fix typo in build.js.
Former-commit-id: 6be9d35758f5a3f82ff1a01d02d8a3f17e0d9a97
2012-05-20 20:37:13 -04:00
John-David Dalton
9a81df6d77 Hide unused element in backbone.html and make perf tests use the minified versions of each lib.
Former-commit-id: 45cfd91d41dc454399be35004ed8bcf5d6293554
2012-05-20 19:12:22 -04:00
John-David Dalton
a9d55121bb Fix regression in CLI test runner for Narwhal, Rhino, and RingoJS.
Former-commit-id: e58807535bc42f1922b4484caeb336d7a9da5aaf
2012-05-20 19:11:36 -04:00
John-David Dalton
88327aeba2 Use nano.jar in perf/index.html.
Former-commit-id: a5a3d79dd2c940dd654d2c91cf80665d72b22080
2012-05-20 05:26:39 -04:00
John-David Dalton
8e2d972281 Make indistinguishable results in perf.js the same score.
Former-commit-id: 550c42ba8d07bde5fe1cf57d5bd27df7bc42dd12
2012-05-20 04:46:18 -04:00
John-David Dalton
7b44ef1664 Cleanup pref.'s style and add comment.
Former-commit-id: ab01044b50ef4a6d447e3e937c31cf5747b3113b
2012-05-20 04:32:57 -04:00
John-David Dalton
5204fac055 Rename /benchmark to /perf.
Former-commit-id: 3688f3aeaf1e7d290d863cdba0d2277afcffa2e8
2012-05-20 04:25:19 -04:00
John-David Dalton
c2a1f50dc0 Cleanup benchmark/benchmark.js, add firebug-lite, and add support for Narwhal, Rhino, and Ringo.
Former-commit-id: e08ede5bee3fdfbeb648b855dfb3082e66e68c0b
2012-05-20 04:14:56 -04:00
John-David Dalton
c8f3b128cb Merge pull request #9 from sindresorhus/benchmark
Add Node.js benchmarks. [fixes #8]

Former-commit-id: 28c7f83738da1f34dfdf5c2f1998834d6c802d0f
2012-05-19 21:11:09 -07:00
John-David Dalton
b32ed95597 Update Benchmark.js submodule.
Former-commit-id: 884ce35aa3e829109be55f96fa796a2af37d97a4
2012-05-20 00:09:04 -04:00
John-David Dalton
57da1d3062 Update docs and builds.
Former-commit-id: 5cc75c2294af4022855c18a9f1e6d82a2e50c244
2012-05-19 23:56:29 -04:00
John-David Dalton
6dfe18fe18 Add custom build options to build.js.
Former-commit-id: 4df20584d5c8852caf0f123d618dbf61f18c220c
2012-05-19 23:54:07 -04:00
John-David Dalton
1dd9ee2397 Switch to non-deprecated fs.existsSync.
Former-commit-id: 616863cf7e7edfdf919750773a12e8cd2a42ddf1
2012-05-19 23:53:35 -04:00
John-David Dalton
d31471c6a1 Correct the minified AMD signature for AMD build optimizers and unescape whitelisted properties from Uglified source.
Former-commit-id: 93ccbb77d376b39a1b5dd38cbe74f9b4d4382e3f
2012-05-19 23:53:00 -04:00
John-David Dalton
930f04951f Add more properties to the pre-compile whitelist and cleanup regexps.
Former-commit-id: c2d557b7bfd882b3a3b1f75011c6f32de8058350
2012-05-19 23:51:40 -04:00
John-David Dalton
8846835ab8 Remove extend as a core dependency, and avoid uncatchable error in Java environments, and ensure templates are inlineable.
Former-commit-id: d7a4de60cf264893d9db68b97940744c6dd3cc3a
2012-05-19 23:50:47 -04:00
John-David Dalton
b080cc4d23 Update submodules and unit test setup.
Former-commit-id: 705059ee5d27e828cd216ecdd164c4c9bceae26c
2012-05-19 23:48:40 -04:00
Sindre Sorhus
c910a95ee4 Add Node.js benchmark. Fixes #8
Former-commit-id: b60a09b6f0ed1d0880fb83f519c3755fa14cd625
2012-05-15 21:43:48 +02:00
John-David Dalton
4601129fc7 Cleanup and comment lodash.js.
Former-commit-id: 468f9e107959c6d637a4acd0dea0cf8f4eb921c2
2012-05-15 11:52:22 -04:00
John-David Dalton
9c79259e9c Add JScript [[DontEnum]] _.size unit test.
Former-commit-id: 734b1943bb7c5f9111f170afccdf0b169fb2cca7
2012-05-15 11:26:56 -04:00
John-David Dalton
bdca0cf668 Update docdown/benchmark.js submodules.
Former-commit-id: 5945b39eb0fcde967c6747ba2c36e94072580805
2012-05-15 11:20:30 -04:00
John-David Dalton
628ad0fcb2 Add comment to _.escape.
Former-commit-id: bee148c238552d3cdb6bba3a3511f3d0c5484850
2012-05-15 02:16:50 -04:00
John-David Dalton
793332beb8 Further simplify _.forEach.
Former-commit-id: 0d6363219836706c411473187dbf6b5516f8574a
2012-05-15 01:58:31 -04:00
John-David Dalton
4e9688cc18 Cleanup build scripts.
Former-commit-id: 7b3bd75f3482297baacc60479579ff74c56e8966
2012-05-15 01:58:31 -04:00
John-David Dalton
ef9a6a0027 Update submodules and add Backbone.js tests.
Former-commit-id: ed8bf8bbaa9ecb268252c5d5b47de85282fb0ff4
2012-05-15 01:58:30 -04:00
John-David Dalton
9e9222c65d Change reported minified size from KB to bytes.
Former-commit-id: 35276bfeda03ca7158f19b265cc5d0863dd9286f
2012-05-15 01:58:30 -04:00
John-David Dalton
9ef0d9084f Optimize _.forEach, cleanup _.after and _.isArguments.
Former-commit-id: 3e3e9539ee6429a72f74f184f45f9c4c52bb621a
2012-05-14 18:48:53 -04:00
John-David Dalton
36df8f7828 Add custom build include and exclude options to build.js.
Former-commit-id: 5d61f47840e51937506d94f65bb55b4f97fe9f19
2012-05-14 18:47:11 -04:00
John-David Dalton
8ee1cc8d27 Minor cleanup in post-compile.js.
Former-commit-id: 94ec69e163de2874385e0a2abaa7ef62c075005e
2012-05-14 18:43:57 -04:00
John-David Dalton
e4e2658a3b Make pre-compile.js avoid erroring when lodash functions are missing.
Former-commit-id: 61f56f206225e1bb0232faea5624d541bc905aa0
2012-05-14 18:43:32 -04:00
John-David Dalton
ae8e7ae992 Rename Minify to minify.
Former-commit-id: 595b9dbeab4f2822626c74a18379262a8d583cfd
2012-05-14 18:38:42 -04:00
John-David Dalton
e0c936ba03 Update minified build and docs.
Former-commit-id: 37fc52f39bcdfdadb1cdbd49d9f8b2a70a134d5f
2012-05-13 17:53:42 -04:00
John-David Dalton
0297e31893 Simplify createIterator.
Former-commit-id: 3058b25bf7677a45261b640bd6ff6e1af1849c2c
2012-05-13 17:53:10 -04:00
John-David Dalton
5b975adc8e Cleanup build files.
Former-commit-id: eac9437648d2bb7260dba5eacfc7076867975134
2012-05-13 17:52:44 -04:00
John-David Dalton
12fc6b3a67 Update the build process.
Former-commit-id: bc80960e1608982354366a37813785c277868d52
2012-05-13 17:21:22 -04:00
John-David Dalton
cb4cc61c5b Update submodules.
Former-commit-id: 51c59d57252147d4af8049eeb5fa1325e747ab4d
2012-05-12 19:05:29 -04:00
John-David Dalton
9f4404628b Rename combine to hybrid.
Former-commit-id: 39180b07379581db688ddb066807dba1928cb27c
2012-05-12 01:41:51 -04:00
John-David Dalton
5441f6b55b Refresh docs and minified build.
Former-commit-id: e853a3363a8824eebbea69e0f16bfdb645619600
2012-05-12 01:12:53 -04:00
John-David Dalton
258fc518a6 Add _.isEmpty JScript [[DontEnum]] bug test.
Former-commit-id: 3815abeb1d802bd6fc2aada64f7a105aa77a6467
2012-05-12 01:11:54 -04:00
John-David Dalton
6a06bf5efa Optimize _.isObject. [ninjainvisible]
Former-commit-id: aa139d3eac1c9913ba6dc85c63145a121ab40cba
2012-05-12 01:11:25 -04:00
John-David Dalton
ff93f7cbb5 Add a default _.templateSettings.variable value.
Former-commit-id: 504aff143cd1dabdb7e8cd089ed3ed1bf9d8f896
2012-05-12 00:31:13 -04:00
John-David Dalton
2e291396bd Touch license and .gitignore.
Former-commit-id: d18484b4608c8514cee78ad699e6150c4cfb0c6c
2012-05-10 01:52:28 -04:00
John-David Dalton
b779f8b029 Optimize the [[DontEnum]] snippet of iteratorTemplate.
Former-commit-id: 23b2b27ee017092066526bba030f680d20bee211
2012-05-10 01:51:17 -04:00
John-David Dalton
04a05b4c02 Cleanup _.max and _.min unit tests.
Former-commit-id: 5bfdd6d441f20879f3352f260b9b08e714c7b836
2012-05-10 01:48:20 -04:00
John-David Dalton
90989a816d Detect the argument length limit instead of using a fixed limit.
Former-commit-id: 24875b0f67c7c92a37c315d3e8a33f23b5372119
2012-05-10 01:40:42 -04:00
John-David Dalton
9b26b96836 Implement a more robust native function detection. [Krinkle]
Former-commit-id: 8d915a0dd12f08e1860122189b57b12382efb144
2012-05-09 02:14:03 -04:00
John-David Dalton
972a716600 Small change to _.max.
Former-commit-id: ee7a5a78087ce8a92b06b7cd542903433053e649
2012-05-09 02:02:29 -04:00
John-David Dalton
b5c4a9241b Add instance pass through unit test, and ensure the pre-compile step escapes the "_wrapped" property for Closure Compiler.
Former-commit-id: 4bb8f77bacdafdd6822564c18751310235679476
2012-05-09 01:43:40 -04:00
John-David Dalton
45f9d80a81 Move _.max and _.min to the "Arrays" category and verify unit tests, rework _.isEqual [[DontEnum]] fix, and cleanup iteratorTemplate,
Former-commit-id: 9f4700b9db5767f314a44d6a83a3552d58ae6872
2012-05-09 01:05:47 -04:00
John-David Dalton
98435d2d92 Remove debug and tweak template whitespace for pretty printing.
Former-commit-id: 1f00899af1210dd367718aad4db38453509747c2
2012-05-08 17:34:13 -04:00
John-David Dalton
ccbf965bd9 Cleanup iterator template, make _.isEqual avoid the JScript [[DontEnum]] bug and add unit tests.
Former-commit-id: 1325f2184a8572ba688bcf697892782b8a0972e7
2012-05-08 17:11:32 -04:00
John-David Dalton
5c82104d7b Cleanup code and rework the pre-compile step.
Former-commit-id: cb62236ee0396e5e08defcbfee526265f9cf042e
2012-05-08 12:15:01 -04:00
John-David Dalton
4c29fbb36d lodash: Cleanup compilation. [jddalton]
Former-commit-id: e51b6742db1aeb103534d98c8354c65454d25a23
2012-05-08 10:29:36 -04:00
John-David Dalton
88e754850d lodash: Fix JSDoc entries, rename private constructor Lodash to LoDash, and optimize wrapper methods. [jddalton]
Former-commit-id: 1a2541900aa93c4c19c1eee12132bce89200b564
2012-05-07 13:58:51 -04:00
John-David Dalton
21b86980a7 lodash: Add a combined minified mode. [jddalton]
Former-commit-id: ba37c06ce553a2e8f366952432ad7fb9903ca577
2012-05-07 13:50:18 -04:00
John-David Dalton
98942c5e1a lodash: Simplify reUnescaped. [jddalton]
Former-commit-id: 5daf301fb60580248d765f5d3d49e10e9fa7104b
2012-05-07 00:47:27 -04:00
John-David Dalton
9c54df2de5 lodash: Add unit tests for buggy shift and splice in IE. [jddalton]
Former-commit-id: 574e4adcd024ef667302e97fffebc9bee5cbfacf
2012-05-06 22:40:58 -04:00
John-David Dalton
f31c2d24f9 lodash: Add the JScript [[DontEnum]] and Firefox, Opera, and Safari "prototype" property iteration fixes to iterationFactory. [jddalton]
Former-commit-id: f5be5c1e0828c3850936ba13ce19d0bfb8988d05
2012-05-06 22:16:03 -04:00
John-David Dalton
52cf17b24a lodash: Ensure max and min do not error when computing the result of massive arrays. [cederberg, jddalton, jeeyoungk]
Former-commit-id: af982790c3bb62777523f972a95b7115fb645180
2012-05-06 19:38:15 -04:00
John-David Dalton
d26fc7154c lodash: Add partial. [closes #5] [gf3, jddalton]
Former-commit-id: 7f95e60e93d463aeac936bcf0868fe2cb5494d6e
2012-05-06 19:17:13 -04:00
John-David Dalton
14c8863657 lodash: Add native method overwrite detection and optimize bind for native bind. [jddalton]
Former-commit-id: d968957e494fb828df155d2f9b0d3faf24e38b5e
2012-05-06 17:57:39 -04:00
John-David Dalton
6d3d5f77bc lodash: Add comments explaining the iterationFactory options object. [jddalton]
Former-commit-id: a5869f89b25b22b661c9f997dc96029ea0c82dbc
2012-05-06 00:05:04 -04:00
John-David Dalton
293fc695a4 lodash: Update documentation and submodules. [jddalton]
Former-commit-id: 9948b9ad5b2dc34a8f442e881f1d75178622364f
2012-05-03 14:28:13 -04:00
John-David Dalton
a317d2471f lodash: Add whitespace to strings. [jddalton]
Former-commit-id: ea4e6a6a894bb596be61df59239bc7f8c2ecd75d
2012-05-03 10:50:27 -04:00
John-David Dalton
afe7ff6d2c lodash: Tweak comment. [jddalton]
Former-commit-id: 309c501800ab2a6234992dafe629a6cd9f8f20ad
2012-05-03 10:42:28 -04:00
John-David Dalton
2f908870e7 lodash: Cleanup template. [jddalton]
Former-commit-id: 286af73ea3a4d798afd4baa01e586ada0305e66b
2012-05-03 10:12:45 -04:00
John-David Dalton
312f0310dc lodash: Update the minified build, README.md, and Benchmark.js submodule. [jddalton]
Former-commit-id: deb6bce113b8739f6f09462f3067263ac48a8f44
2012-05-03 00:46:41 -04:00
John-David Dalton
1a1bd5322c lodash: No longer have escape translate the ">" character. [jddalton, mathiasbynens]
Former-commit-id: 58d8ef98f3699a62b57a460b45921785fa2440b0
2012-05-03 00:45:21 -04:00
John-David Dalton
04ca0ae309 lodash: Cleanup code. [jddalton, mathiasbynens]
Former-commit-id: 639655426b7b928ca756993227bc6f80484deae2
2012-05-03 00:31:25 -04:00
John-David Dalton
221f70e609 lodash: Optimize template. [jddalton]
Former-commit-id: 2cd61549491714e6796308ec437fa8dff8fa9a1b
2012-05-03 00:23:57 -04:00
John-David Dalton
a426109c1c lodash: Update minified build, documentation, and Underscore submodule. [jddalton]
Former-commit-id: 35fb63c16127413ff283fcd3075e1dea38ebef8c
2012-05-01 21:14:30 -04:00
John-David Dalton
d5e2489cad lodash: Make deb ounce match throttle's return value behavior. [jddalton]
Former-commit-id: 2d4073c8a2ba20b98344c19cbfaf388a2683ef19
2012-05-01 21:13:02 -04:00
John-David Dalton
367f0bd6a9 lodash: Optimize and simplify throttle. [cowboy, jddalton]
Former-commit-id: 52e19aeb8671e86a13bf54876bf1f3f1b4644437
2012-05-01 21:11:40 -04:00
John-David Dalton
8396ed3167 lodash: Simplify first argument checks in "Collections" methods. [jddalton]
Former-commit-id: f3b658acccc20d864cf4987f2d2473453297a1c8
2012-05-01 10:47:15 -04:00
John-David Dalton
6cc360d613 lodash: Add @mathiasbynens as a contributor. [jddalton]
Former-commit-id: fd286bc6665ba819be5d4ce379fd0359559cc236
2012-05-01 00:37:25 -04:00
John-David Dalton
e86eef5905 lodash: Update documentation and lodash.min.js. [jddalton]
Former-commit-id: 0fa786b309e699dcf586e5606b7f3c82ac5e460f
2012-05-01 00:35:50 -04:00
John-David Dalton
24d5fbb595 lodash: Add support for "lazy" bind. [jddalton]
Former-commit-id: 472c0436f7de4e636dd878900119008bf39592fa
2012-05-01 00:34:40 -04:00
John-David Dalton
6fb7681a2d lodash: Reduce functions created in debounce and throttle and make each work when called recursively. [int3, jddalton]
Former-commit-id: 8d8d1966f7b8710d1bd51c830c4d3c08643ba21a
2012-05-01 00:05:26 -04:00
John-David Dalton
0b404d4bb1 lodash: Avoid extraneous empty array in pick. [jddalton]
Former-commit-id: 581eb1264aed6f0904d794cad53462ae80a1c3d0
2012-04-30 23:26:12 -04:00
John-David Dalton
464826e81d lodash: Move sortedIndex to the "Arrays" category. [jddalton]
Former-commit-id: fb9d6afc3c805ac25c8e6e7968fdcb4e8da93d30
2012-04-30 23:22:49 -04:00
John-David Dalton
e871ffeff0 lodash: Cleanup flatten avoiding the use of an extraneous empty array. [jddalton]
Former-commit-id: 6a1eebceb77dd59d34659a295c4a7a2dce92e8a9
2012-04-30 22:51:14 -04:00
John-David Dalton
2847b1f08e lodash: Move shuffle to the "Arrays" category and optimize. [jddalton]
Former-commit-id: 6f08cc15a5a1b0197e080d5fc21309b84cabaf6a
2012-04-30 22:49:29 -04:00
John-David Dalton
d702e00446 lodash: Optimize intersection. [jddalton]
Former-commit-id: f15eb7429ab4f14a4b096f5ba72f3662f9ed23d7
2012-04-30 22:32:07 -04:00
John-David Dalton
142ee20bca lodash: Fix post-compile.js VERSION detection to allow newlines. [jddalton]
Former-commit-id: 2e0d342cf66c4507a2956eeac912333cfdca5817
2012-04-30 22:16:21 -04:00
John-David Dalton
e3f03fa2ce lodash: Update Underscore submodule. [jddalton]
Former-commit-id: 98f22ee0e2d0b5d4908b3f8eaa929181e9167cb3
2012-04-30 22:15:28 -04:00
John-David Dalton
8dc3fb86db lodash: Tweak map's result assignment. [jddalton]
Former-commit-id: eb047e50e485fb1df387648fc1815e405b9d18ef
2012-04-27 01:11:48 -04:00
John-David Dalton
358ec3fb39 lodash: Inline isFunction calls. [jddalton]
Former-commit-id: d2929d4cbc1f2fb32dc94deba9dc44e5d51b4235
2012-04-27 00:43:42 -04:00
John-David Dalton
f4a38a25c8 lodash: Minor build.js cleanup. [jddalton]
Former-commit-id: ca0ba49f4e1670196912cbbd237a3a1a8f72e2a7
2012-04-26 23:38:42 -04:00
John-David Dalton
dcb62a3df5 Merge branch 'master' of github.com:bestiejs/lodash
Former-commit-id: 5a73314c99eb56eb4e2a13ff931e76db48c17f04
2012-04-26 23:34:10 -04:00
John-David Dalton
59c26957bb lodash: Optimize uniq and union, and inflate methods in the "Arrays" category. [jddalton]
Former-commit-id: b54d0bc2a77d1589d4b53b20a2f5ec175ab6c5cc
2012-04-26 23:33:53 -04:00
Kit Cambridge
09d8561b3c build.js: Merge invoke() into closureCompile().
Former-commit-id: 0fbdeffeba06c49db1d8b0801c8e3b721c3a5a43
2012-04-26 20:06:47 -06:00
Kit Cambridge
6246e71c87 Use the Node zlib module instead of shelling out to gzip.
Former-commit-id: f73339f6fd421ec4ddd1ec13ef13a18926419cdb
2012-04-26 19:56:31 -06:00
John-David Dalton
adcc2dd8d2 lodash: Simplify _.keys fallback. [jddalton]
Former-commit-id: 15d265f4f16ab2418bb5dcddf68a2fd43ebdf5b2
2012-04-26 15:46:47 -04:00
John-David Dalton
947fc9ce97 lodash: Fix syntax error in IE < 9 related to return throw …. [jddalton]
Former-commit-id: 8de2886801d447d6c0db119fe061d2fafd49958b
2012-04-26 11:29:13 -04:00
John-David Dalton
5caca9175d lodash: Update doc line numbers. [jddalton]
Former-commit-id: f7000abe7f38af81b54a277f54f1ebb6e7b37966
2012-04-26 09:18:11 -04:00
John-David Dalton
520d09e81e lodash: Avoid an extra callback call in the sortedIndex while loop. [jddalton, spadgos]
Former-commit-id: 87228c7308475f9430e5bcb0bc0d647b2210388f
2012-04-26 09:05:45 -04:00
John-David Dalton
7fa4304097 lodash: Change invoke's category to "Arrays". [jddalton]
Former-commit-id: e8e176bacf72f721fce62630984778e4d2ff08be
2012-04-26 01:27:50 -04:00
John-David Dalton
ceed641730 lodash: Update doc line numbers. [jddalton]
Former-commit-id: 765b1e55407c59bb76a7ec5af0c86bbd42156c23
2012-04-26 01:12:27 -04:00
John-David Dalton
1d4ce28b62 lodash: Remove unused afterLoop iterationFactory option, optimize sortedIndex, and optimize exiting early from compiled functions. [jddalton]
Former-commit-id: f56c93bfed623c5100d7cdf1c0d30b1e557d8a97
2012-04-26 01:10:45 -04:00
John-David Dalton
a551992c3f lodash: Remove unneeded slice call in pick. [jddalton, sindresorhus]
Former-commit-id: fbc5e2d918f31d2cd59bb9708c055c60592add10
2012-04-25 14:22:32 -04:00
John-David Dalton
23b8d083a4 lodash: Add spaces to compiled / template strings. [jddalton]
Former-commit-id: e28bb94dfb8f315f62dd942765752739f30950dc
2012-04-25 14:19:44 -04:00
John-David Dalton
b3d249f2ef lodash: Tweak bug fix link in README.md. [jddalton]
Former-commit-id: 383b811759e042cd93f6d852a0cda02a26af0de0
2012-04-25 14:05:47 -04:00
John-David Dalton
647633a1a0 lodash: Update doc line numbers. [jddalton]
Former-commit-id: 27edd51a81b000308128a097a024c81e5de2c773
2012-04-25 00:09:08 -04:00
John-David Dalton
313ffb8821 lodash: Add thisArg to groupBy and optimize invoke. [jddalton]
Former-commit-id: 74b0105af083471a56d60ac423409ae39e17d44a
2012-04-25 00:08:46 -04:00
John-David Dalton
774f159e67 lodash: Optimize groupBy, union, and pick. [jddalton]
Former-commit-id: 5109fd3868751f34f5a54ebafdbd43fa26f96754
2012-04-24 23:12:08 -04:00
John-David Dalton
f9358531ad lodash: Add support for more AMD build optimizers and allow aliasing as the "underscore" module. [jddalton]
Former-commit-id: 6b3fa45d19f6a55aa7565bcb4d9221f6f159e9c9
2012-04-24 18:15:47 -04:00
John-David Dalton
bb09d77eb5 lodash: Fix typo in build.js. [jddalton]
Former-commit-id: 1dce55619a345bec6c5ebda1490a1015bfb30210
2012-04-24 12:26:32 -04:00
John-David Dalton
ba8cc970d0 lodash: Move Underscore's unit tests to a submodule. [fat, jddalton]
Former-commit-id: c0518256e2ff02386452cd62c81964cc2a3da3cc
2012-04-24 09:03:03 -04:00
John-David Dalton
89c986d50f lodash: Move the screencast note higher in the README.md. [jddalton]
Former-commit-id: dc22ba34a0764add4871426c33ace76fea30bd1b
2012-04-24 03:13:28 -04:00
160 changed files with 93145 additions and 5899 deletions

3
.gitignore vendored
View File

@@ -1,2 +1,3 @@
*.custom.*
.DS_Store
node_modules/
node_modules/

18
.gitmodules vendored
View File

@@ -1,18 +0,0 @@
[submodule "vendor/benchmark.js"]
path = vendor/benchmark.js
url = git://github.com/bestiejs/benchmark.js.git
[submodule "vendor/docdown"]
path = vendor/docdown
url = git://github.com/jdalton/docdown.git
[submodule "vendor/qunit"]
path = vendor/qunit
url = git://github.com/jquery/qunit.git
[submodule "vendor/qunit-clib"]
path = vendor/qunit-clib
url = git://github.com/jdalton/qunit-clib.git
[submodule "vendor/requirejs"]
path = vendor/requirejs
url = git://github.com/jrburke/requirejs.git
[submodule "vendor/uglifyjs"]
path = vendor/uglifyjs
url = git://github.com/mishoo/UglifyJS.git

14
.jamignore Normal file
View File

@@ -0,0 +1,14 @@
*.custom.*
.*
build.js
index.js
build/
doc/*.php
node_modules/
perf/*.sh
test/*.sh
test/test-build.js
test/template/
vendor/closure-compiler
vendor/docdown
vendor/uglifyjs

View File

@@ -1,5 +1,15 @@
*.custom.*
.*
dist/*
doc/*.php
node_modules/
perf/*.html
perf/*.sh
test/*.html
vendor/
test/*-ui.js
test/*.sh
vendor/backbone/
vendor/docdown/
vendor/firebug-lite/
vendor/qunit/qunit/*.css
vendor/requirejs/
vendor/underscore/test/

4
.travis.yml Normal file
View File

@@ -0,0 +1,4 @@
language: node_js
node_js:
- 0.6
- 0.8

293
README.md
View File

@@ -1,97 +1,296 @@
# Lo-Dash <sup>v0.1.0</sup>
# Lo-Dash <sup>v0.8.2</sup>
[![build status](https://secure.travis-ci.org/bestiejs/lodash.png)](http://travis-ci.org/bestiejs/lodash)
A drop-in replacement for [Underscore.js](https://github.com/documentcloud/underscore/) that delivers up to [8x performance improvements](http://jsperf.com/lodash-underscore#chart=bar), [bug fixes](https://github.com/bestiejs/lodash/blob/master/test/test.js#L71), and additional features.
A drop-in replacement<sup>[*](https://github.com/bestiejs/lodash/wiki/Drop-in-Disclaimer)</sup> for Underscore.js, from the devs behind [jsPerf.com](http://jsperf.com), delivering [performance](http://lodash.com/benchmarks), [bug fixes](https://github.com/bestiejs/lodash#resolved-underscorejs-issues), and [additional features](http://lodash.com/#features).
## BestieJS
Lo-Dashs performance is gained by avoiding slower native methods, instead opting for simplified non-ES5 compliant methods optimized for common usage, and by leveraging function compilation to reduce the number of overall function calls.
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.
## Download
## Documentation
* [Development build](https://raw.github.com/bestiejs/lodash/v0.8.2/lodash.js)
* [Production build](https://raw.github.com/bestiejs/lodash/v0.8.2/lodash.min.js)
* [Underscore build](https://raw.github.com/bestiejs/lodash/v0.8.2/lodash.underscore.min.js) tailored for projects already using Underscore
* CDN copies of ≤ [v0.8.2](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.8.2/lodash.min.js) are available on [cdnjs](http://cdnjs.com/) thanks to [CloudFlare](http://www.cloudflare.com/)
* For optimal file size, [create a custom build](https://github.com/bestiejs/lodash#custom-builds) with only the features you need
The documentation for Lo-Dash can be viewed here: [/doc/README.md](https://github.com/bestiejs/lodash/blob/master/doc/README.md#readme)
## Dive in
Underscore's [documentation](http://documentcloud.github.com/underscore/) may also be used.
Weve 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).
## So What's The Secret?
## Screencasts
Lo-Dash's performance is gained by avoiding native methods, instead opting for simplified non-ES5 compliant methods optimized for common usage, and by leveraging function compilation to reduce the number of overall function calls.
For more information check out these screencasts over Lo-Dash:
## What else?
* [Introducing Lo-Dash](https://vimeo.com/44154599)
* [Lo-Dash optimizations and custom builds](https://vimeo.com/44154601)
* [Lo-Dashs origin and why its a better utility belt](https://vimeo.com/44154600)
* [Unit testing in Lo-Dash](https://vimeo.com/45865290)
* [Lo-Dashs approach to native method use](https://vimeo.com/48576012)
Lo-Dash comes with AMD loader support baked in, chainable `_.each`, and will [soon address](https://github.com/bestiejs/lodash/wiki/Roadmap) cross-browser object iteration issues.
## Features
## Screencast
* AMD loader support ([RequireJS](http://requirejs.org/), [curl.js](https://github.com/cujojs/curl), etc.)
* [_.clone](http://lodash.com/docs#clone) supports *“deep”* cloning
* [_.forEach](http://lodash.com/docs#forEach) is chainable and supports exiting iteration early
* [_.forIn](http://lodash.com/docs#forIn) for iterating over an objects own and inherited properties
* [_.forOwn](http://lodash.com/docs#forOwn) for iterating over an objects own properties
* [_.isPlainObject](http://lodash.com/docs#isPlainObject) checks if values are created by the `Object` constructor
* [_.lateBind](http://lodash.com/docs#lateBind) for late binding
* [_.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) accept `callback` and `thisArg` arguments
* [_.template](http://lodash.com/docs#template) utilizes [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) for easier debugging
* [_.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, _.pluck, _.reduce, _.reduceRight, _.reject, _.some, _.sortBy, _.where") accept strings
For more information check out [this screencast](http://dl.dropbox.com/u/513327/allyoucanleet/post/20/file/screencast.mp4) over Lo-Dash.
## Support
Lo-Dash has been tested in at least Chrome 5~22, Firefox 1~16, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.8.11, Narwhal 0.3.2, RingoJS 0.8, 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.
* 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 restrictions, may be created using the `csp` modifier argument.
```bash
lodash csp
```
* Legacy builds, tailored for older browsers 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.
```bash
lodash mobile
```
* Strict builds, with `_.bindAll`, `_.defaults`, and `_.extend` in [strict mode](http://es5.github.com/#C), may be created using the `strict` modifier argument.
```bash
lodash strict
```
* Underscore builds, tailored for projects already using Underscore, may be created using the `underscore` modifier argument.
```bash
lodash underscore
```
Custom builds may be created using the following commands:
* Use the `category` argument to pass comma separated categories of methods to include in the build.<br>
Valid categories (case-insensitive) are *“arrays”*, *“chaining”*, *“collections”*, *“functions”*, *“objects”*, and *“utilities”*.
```bash
lodash category=collections,functions
lodash category="collections, functions"
```
* Use the `exports` argument to pass comma separated names of ways to export the `LoDash` function.<br>
Valid exports are *“amd”*, *“commonjs”*, *“global”*, *“node”*, and *“none”*.
```bash
lodash exports=amd,commonjs,node
lodash exports="amd, commonjs, node"
```
* Use the `iife` argument to specify code to replace the immediately-invoked function expression that wraps Lo-Dash.
```bash
lodash iife="!function(window,undefined){%output%}(this)"
```
* Use the `include` argument to pass comma separated method/category names to include in the build.
```bash
lodash include=each,filter,map
lodash include="each, filter, map"
```
* Use the `minus` argument to pass comma separated method/category names to remove from those included in the build.
```bash
lodash underscore minus=result,shuffle
lodash underscore minus="result, shuffle"
```
* Use the `plus` argument to pass comma separated method/category names to add to those included in the build.
```bash
lodash backbone plus=random,template
lodash backbone plus="random, template"
```
* Use the `template` argument to pass the file path pattern used to match template files to precompile
```bash
lodash template="./*.jst"
```
* Use the `settings` argument to pass the template settings used when precompiling templates
```bash
lodash settings="{interpolate:/\\{\\{([\\s\\S]+?)\\}\\}/g}"
```
All arguments, except `legacy` with `csp` or `mobile`, 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`&nbsp;&nbsp;&nbsp;&nbsp; Write output to standard output
* `-d`, `--debug`&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Write only the debug output
* `-h`, `--help`&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Display help information
* `-m`, `--minify`&nbsp;&nbsp;&nbsp;&nbsp; Write only the minified output
* `-o`, `--output`&nbsp;&nbsp;&nbsp;&nbsp; Write output to a given path/filename
* `-s`, `--silent`&nbsp;&nbsp;&nbsp;&nbsp; Skip status updates normally logged to the console
* `-V`, `--version`&nbsp;&nbsp; Output current version of Lo-Dash
The `lodash` command-line utility is available when Lo-Dash is installed as a global package (i.e. `npm install -g lodash`).
## Installation and usage
In a browser:
In browsers:
~~~ html
```html
<script src="lodash.js"></script>
~~~
```
Via [npm](http://npmjs.org/):
Using [npm](http://npmjs.org/):
~~~ bash
```bash
npm install lodash
~~~
npm install -g lodash
npm link lodash
```
In [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/):
~~~ js
```js
var _ = require('lodash');
~~~
```
In [Narwhal](http://narwhaljs.org/) and [RingoJS v0.7.0-](http://ringojs.org/):
**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 projects root directory before attempting to `require` it.
~~~ js
In [RingoJS v0.7.0-](http://ringojs.org/):
```js
var _ = require('lodash')._;
~~~
```
In [Rhino](http://www.mozilla.org/rhino/):
~~~ js
```js
load('lodash.js');
~~~
```
In an AMD loader like [RequireJS](http://requirejs.org/):
~~~ js
// opt-in
define.amd.lodash = true;
```js
require({
'paths': {
'lodash': 'path/to/lodash'
'underscore': 'path/to/lodash'
}
},
['lodash'], function(_) {
['underscore'], function(_) {
console.log(_.VERSION);
});
~~~
```
## Cloning this repo
## Resolved Underscore.js issues
To clone this repository including all submodules, using Git 1.6.5 or later:
* Add AMD loader support [[#431](https://github.com/documentcloud/underscore/pull/431), [test](https://github.com/bestiejs/lodash/blob/v0.8.2/test/test.js#L118-140)]
* Allow iteration of objects with a `length` property [[#799](https://github.com/documentcloud/underscore/pull/799), [test](https://github.com/bestiejs/lodash/blob/v0.8.2/test/test.js#L510-516)]
* Ensure *“Collections”* methods allow string `collection` arguments [[#247](https://github.com/documentcloud/underscore/issues/247), [#276](https://github.com/documentcloud/underscore/issues/276), [#561](https://github.com/documentcloud/underscore/pull/561), [test](https://github.com/bestiejs/lodash/blob/v0.8.2/test/test.js#L470-487)]
* 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/v0.8.2/test/test.js#L523-547)]
* 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/v0.8.2/test/test.js#L142-148)]
* `_.clone` should allow `deep` cloning [[#595](https://github.com/documentcloud/underscore/pull/595), [test](https://github.com/bestiejs/lodash/blob/v0.8.2/test/test.js#L214-225)]
* `_.contains` should work with strings [[#667](https://github.com/documentcloud/underscore/pull/667), [test](https://github.com/bestiejs/lodash/blob/v0.8.2/test/test.js#L267-276)]
* `_.extend` should recursively extend objects [[#379](https://github.com/documentcloud/underscore/pull/379), [#718](https://github.com/documentcloud/underscore/issues/718), [test](https://github.com/bestiejs/lodash/blob/v0.8.2/test/test.js#L968-990)]
* `_.forEach` should be chainable [[#142](https://github.com/documentcloud/underscore/issues/142), [test](https://github.com/bestiejs/lodash/blob/v0.8.2/test/test.js#L465-468)]
* `_.forEach` should allow exiting iteration early [[#211](https://github.com/documentcloud/underscore/issues/211), [test](https://github.com/bestiejs/lodash/blob/v0.8.2/test/test.js#L553-571)]
* `_.isEmpty` should support jQuery/MooTools DOM query collections [[#690](https://github.com/documentcloud/underscore/pull/690), [test](https://github.com/bestiejs/lodash/blob/v0.8.2/test/test.js#L712-717)]
* `_.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/v0.8.2/test/test.js#L772-784)]
* `_.keys` should work with `arguments` objects cross-browser [[#396](https://github.com/documentcloud/underscore/issues/396), [test](https://github.com/bestiejs/lodash/blob/v0.8.2/test/test.js#L865-867)]
* `_.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/v0.8.2/test/test.js#L1243-1246)]
~~~ bash
git clone --recursive https://github.com/bestiejs/lodash.git
cd lodash.js
~~~
## Optimized methods <sup>(50+)</sup>
For older Git versions, just use:
* `_.bind`
* `_.bindAll`
* `_.compact`
* `_.contains`, `_.include`
* `_.defaults`
* `_.difference`
* `_.each`
* `_.every`, `_.all`
* `_.extend`
* `_.filter`, `_.select`
* `_.find`, `_.detect`
* `_.flatten`
* `_.forEach`, `_.each`
* `_.functions`, `_.methods`
* `_.groupBy`
* `_.indexOf`
* `_.intersection`
* `_.invert`
* `_.invoke`
* `_.isArguments`
* `_.isDate`
* `_.isFinite`
* `_.isFunction`
* `_.isObject`
* `_.isNumber`
* `_.isRegExp`
* `_.isString`
* `_.keys`
* `_.lastIndexOf`
* `_.map`, `_.collect`
* `_.max`
* `_.memoize`
* `_.min`
* `_.mixin`
* `_.omit`
* `_.pairs`
* `_.pick`
* `_.pluck`
* `_.reduce`, `_.foldl`, `_.inject`
* `_.reject`
* `_.result`
* `_.shuffle`
* `_.some`, `_.any`
* `_.sortBy`
* `_.sortedIndex`
* `_.template`
* `_.throttle`
* `_.toArray`
* `_.union`
* `_.uniq`, `_.unique`
* `_.values`
* `_.where`
* `_.without`
* `_.wrap`
* `_.zip`
* plus all `_(…)` method wrappers
~~~ bash
git clone https://github.com/bestiejs/lodash.git
cd lodash
git submodule update --init
~~~
## Release Notes
Feel free to fork and send pull requests if you see improvements!
### <sup>v0.8.2</sup>
* Ensured `_.map` returns an array when passed a falsey collection
* Ensured `_.throttle` clears its timeout when `func` is called
* Made `_.max`, `_.min`, `_.shuffle` support iterating objects
* Reduced `createIterator`, `_.clone`, and `_.compact`
* Re-optimized `_.max`, `_.min`, and `_.sortedIndex`
The full changelog is available [here](https://github.com/bestiejs/lodash/wiki/Changelog).
## BestieJS
Lo-Dash is part of the BestieJS *“Best in Class”* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation.
## Author
@@ -102,3 +301,5 @@ Feel free to fork and send pull requests if you see improvements!
* [Kit Cambridge](http://kitcambridge.github.com/)
[![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter")
* [Mathias Bynens](http://mathiasbynens.be/)
[![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter")

1729
build.js

File diff suppressed because it is too large Load Diff

375
build/minify.js Executable file
View File

@@ -0,0 +1,375 @@
#!/usr/bin/env node
;(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;
/** The directory that is the base of the repository */
var basePath = fs.realpathSync(path.join(__dirname, '..'));
/** The directory where the Closure Compiler is located */
var closurePath = path.join(basePath, 'vendor', 'closure-compiler', 'compiler.jar');
/** Load other modules */
var preprocess = require('./pre-compile'),
postprocess = require('./post-compile'),
uglifyJS = require('../vendor/uglifyjs/uglify-js');
/** Closure Compiler command-line options */
var closureOptions = [
'--compilation_level=ADVANCED_OPTIMIZATIONS',
'--warning_level=QUIET'
];
/** Reassign `existsSync` for older versions of Node */
fs.existsSync || (fs.existsSync = path.existsSync);
/*--------------------------------------------------------------------------*/
/**
* The exposed `minify` function minifies a given Lo-Dash `source` and invokes
* the `onComplete` callback when finished.
*
* @param {Array|String} [source=''] The source to minify or array of commands.
* @param {Object} [options={}] The options object.
*/
function minify(source, options) {
source || (source = '');
options || (options = {});
// juggle arguments
if (Array.isArray(source)) {
// convert commands to an options object
options = source;
var filePath = options[options.length - 1],
isSilent = options.indexOf('-s') > -1 || options.indexOf('--silent') > -1,
isTemplate = options.indexOf('-t') > -1 || options.indexOf('--template') > -1,
outputPath = path.join(path.dirname(filePath), path.basename(filePath, '.js') + '.min.js');
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));
}
return result;
}, outputPath);
options = {
'isSilent': isSilent,
'isTemplate': isTemplate,
'outputPath': outputPath
};
source = fs.readFileSync(filePath, 'utf8');
}
new Minify(source, options);
}
/**
* The Minify constructor used to keep state of each `minify` invocation.
*
* @private
* @constructor
* @param {String} source The source to minify.
* @param {Object} options The options object.
*/
function Minify(source, options) {
// juggle arguments
if (typeof source == 'object' && source) {
options = source || options;
source = options.source || '';
}
this.compiled = {};
this.hybrid = {};
this.uglified = {};
this.isSilent = !!options.isSilent;
this.isTemplate = !!options.isTemplate;
this.outputPath = options.outputPath;
source = preprocess(source, options);
this.source = source;
this.onComplete = options.onComplete || function(source) {
fs.writeFileSync(this.outputPath, source, 'utf8');
};
// begin the minification process
closureCompile.call(this, source, onClosureCompile.bind(this));
}
/*--------------------------------------------------------------------------*/
/**
* Compresses a `source` string using the Closure Compiler. Yields the
* minified result, and any exceptions encountered, to a `callback` function.
*
* @private
* @param {String} source The JavaScript source to minify.
* @param {String} [message] The message to log.
* @param {Function} callback The function to call once the process completes.
*/
function closureCompile(source, message, callback) {
var options = closureOptions.slice();
// use simple optimizations when minifying template files
if (this.isTemplate) {
options = options.map(function(value) {
return value.replace(/^(compilation_level)=.+$/, '$1=SIMPLE_OPTIMIZATIONS');
});
}
// the standard error stream, standard output stream, and Closure Compiler process
var error = '',
output = '',
compiler = spawn('java', ['-jar', closurePath].concat(options));
// juggle arguments
if (typeof message == 'function') {
callback = message;
message = null;
}
if (!this.isSilent) {
console.log(message == null
? 'Compressing ' + path.basename(this.outputPath, '.js') + ' using the Closure Compiler...'
: message
);
}
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;
});
compiler.on('exit', function(status) {
var exception = null;
// `status` contains the process exit code
if (status) {
exception = new Error(error);
exception.status = status;
}
callback(exception, output);
});
// proxy the standard input to the Closure Compiler
compiler.stdin.end(source);
}
/**
* Compresses a `source` string using UglifyJS. Yields the result to a
* `callback` function. This function is synchronous; the `callback` is used
* for symmetry.
*
* @private
* @param {String} source The JavaScript source to minify.
* @param {String} [message] The message to log.
* @param {Function} callback The function to call once the process completes.
*/
function uglify(source, message, callback) {
var exception,
result,
ugly = uglifyJS.uglify;
// juggle arguments
if (typeof message == 'function') {
callback = message;
message = null;
}
if (!this.isSilent) {
console.log(message == null
? 'Compressing ' + path.basename(this.outputPath, '.js') + ' using UglifyJS...'
: message
);
}
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
});
} catch(e) {
exception = e;
}
// lines are restricted to 500 characters for consistency with the Closure Compiler
callback(exception, result && ugly.split_lines(result, 500));
}
/*--------------------------------------------------------------------------*/
/**
* The `closureCompile()` callback.
*
* @private
* @param {Object|Undefined} exception The error object.
* @param {String} result The resulting minified source.
*/
function onClosureCompile(exception, result) {
if (exception) {
throw exception;
}
// store the post-processed Closure Compiler result and gzip it
this.compiled.source = result = postprocess(result);
gzip(result, onClosureGzip.bind(this));
}
/**
* The Closure Compiler `gzip` callback.
*
* @private
* @param {Object|Undefined} exception The error object.
* @param {Buffer} result The resulting gzipped source.
*/
function onClosureGzip(exception, result) {
if (exception) {
throw exception;
}
if (!this.isSilent) {
console.log('Done. Size: %d bytes.', result.length);
}
// store the gzipped result and report the size
this.compiled.gzip = result;
// next, minify the source using only UglifyJS
uglify.call(this, this.source, onUglify.bind(this));
}
/**
* The `uglify()` callback.
*
* @private
* @param {Object|Undefined} exception The error object.
* @param {String} result The resulting minified source.
*/
function onUglify(exception, result) {
if (exception) {
throw exception;
}
// store the post-processed Uglified result and gzip it
this.uglified.source = result = postprocess(result);
gzip(result, onUglifyGzip.bind(this));
}
/**
* The UglifyJS `gzip` callback.
*
* @private
* @param {Object|Undefined} exception The error object.
* @param {Buffer} result The resulting gzipped source.
*/
function onUglifyGzip(exception, result) {
if (exception) {
throw exception;
}
if (!this.isSilent) {
console.log('Done. Size: %d bytes.', result.length);
}
var message = 'Compressing ' + path.basename(this.outputPath, '.js') + ' using hybrid minification...';
// store the gzipped result and report the size
this.uglified.gzip = result;
// next, minify the Closure Compiler minified source using UglifyJS
uglify.call(this, this.compiled.source, message, onHybrid.bind(this));
}
/**
* The hybrid `uglify()` callback.
*
* @private
* @param {Object|Undefined} exception The error object.
* @param {String} result The resulting minified source.
*/
function onHybrid(exception, result) {
if (exception) {
throw exception;
}
// store the post-processed Uglified result and gzip it
this.hybrid.source = result = postprocess(result);
gzip(result, onHybridGzip.bind(this));
}
/**
* The hybrid `gzip` callback.
*
* @private
* @param {Object|Undefined} exception The error object.
* @param {Buffer} result The resulting gzipped source.
*/
function onHybridGzip(exception, result) {
if (exception) {
throw exception;
}
if (!this.isSilent) {
console.log('Done. Size: %d bytes.', result.length);
}
// store the gzipped result and report the size
this.hybrid.gzip = result;
// finish by choosing the smallest compressed file
onComplete.call(this);
}
/**
* The callback executed after JavaScript source is minified and gzipped.
*
* @private
*/
function onComplete() {
var compiled = this.compiled,
hybrid = this.hybrid,
uglified = this.uglified;
// select the smallest gzipped file and use its minified counterpart as the
// official minified release (ties go to Closure Compiler)
var min = Math.min(compiled.gzip.length, hybrid.gzip.length, uglified.gzip.length);
// pass the minified source to the minify instances "onComplete" callback
this.onComplete(
compiled.gzip.length == min
? compiled.source
: uglified.gzip.length == min
? uglified.source
: hybrid.source
);
}
/*--------------------------------------------------------------------------*/
// expose `minify`
if (module != require.main) {
module.exports = minify;
}
else {
// read the Lo-Dash source file from the first argument if the script
// was invoked directly (e.g. `node minify.js source.js`) and write to
// `<filename>.min.js`
(function() {
var options = process.argv;
if (options.length < 3) {
return;
}
minify(options);
}());
}
}());

View File

@@ -6,31 +6,49 @@
var fs = require('fs');
/** The minimal license/copyright template */
var licenseTemplate =
'/*!\n' +
' Lo-Dash @VERSION github.com/bestiejs/lodash/blob/master/LICENSE.txt\n' +
' Underscore.js 1.3.3 github.com/documentcloud/underscore/blob/master/LICENSE\n' +
'*/';
var licenseTemplate = {
'lodash':
'/*!\n' +
' Lo-Dash @VERSION lodash.com/license\n' +
' Underscore.js 1.4.2 underscorejs.org/LICENSE\n' +
'*/',
'underscore':
'/*! Underscore.js @VERSION underscorejs.org/LICENSE */'
};
/*--------------------------------------------------------------------------*/
/**
* Post-process a given minified JavaScript `source`, preparing it for
* Post-process a given minified Lo-Dash `source`, preparing it for
* deployment.
*
* @private
* @param {String} source The source to process.
* @returns {String} Returns the processed source.
*/
function postprocess(source) {
// set the version
var license = licenseTemplate.replace('@VERSION', (/VERSION:([\'"])(.*?)\1/).exec(source).pop());
// move vars exposed by Closure Compiler into the IIFE
source = source.replace(/^([^(\n]+)\s*(\(function[^)]+\){)/, '$2$1');
// use double quotes consistently
source = source.replace(/'use strict'/, '"use strict"');
source = source.replace(/^((?:(['"])use strict\2;)?(?:var (?:[a-z]+=(?:!0|!1|null)[,;])+)?)([\s\S]*?function[^)]+\){)/, '$3$1');
// unescape properties (i.e. foo["bar"] => foo.bar)
source = source.replace(/(\w)\["([^."]+)"\]/g, function(match, left, right) {
return /\W/.test(right) ? match : (left + '.' + right);
});
// 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');
// add trailing semicolon
if (source) {
source = source.replace(/[\s;]*$/, ';');
}
// exit early if version snippet isn't found
var snippet = /VERSION\s*[=:]\s*([\'"])(.*?)\1/.exec(source);
if (!snippet) {
return source;
}
// add license
return license + '\n;' + source;
return licenseTemplate[/call\(this\);?$/.test(source) ? 'underscore' : 'lodash']
.replace('@VERSION', snippet[2]) + '\n;' + source;
}
/*--------------------------------------------------------------------------*/
@@ -38,13 +56,20 @@
// expose `postprocess`
if (module != require.main) {
module.exports = postprocess;
} else {
// read the JavaScript source file from the first argument if the script
}
else {
// read the Lo-Dash source file from the first argument if the script
// was invoked directly (e.g. `node post-compile.js source.js`) and write to
// the same file
(function() {
var source = fs.readFileSync(process.argv[2], 'utf8');
fs.writeFileSync(process.argv[2], postprocess(source), 'utf8');
var options = process.argv;
if (options.length < 3) {
return;
}
var filePath = options[options.length - 1],
source = fs.readFileSync(filePath, 'utf8');
fs.writeFileSync(filePath, postprocess(source), 'utf8');
}());
}
}());

View File

@@ -5,189 +5,431 @@
/** The Node filesystem module */
var fs = require('fs');
/** Used to minify string values embedded in compiled strings */
var compiledValues = [
'arrays',
'objects'
];
/** Used to minify variables embedded in compiled strings */
var compiledVars = [
'accumulator',
'array',
'arrayClass',
'bind',
'argsIndex',
'argsLength',
'callback',
'className',
'collection',
'computed',
'concat',
'current',
'false',
'funcClass',
'createCallback',
'ctor',
'hasOwnProperty',
'identity',
'index',
'indexOf',
'Infinity',
'initial',
'isArray',
'isEmpty',
'iteratee',
'length',
'nativeKeys',
'object',
'Math',
'property',
'ownIndex',
'ownProps',
'prop',
'propertyIsEnumerable',
'propIndex',
'props',
'result',
'skipProto',
'slice',
'source',
'stringClass',
'target',
'thisArg',
'toString',
'true',
'undefined',
'value',
'values'
// lesser used variables
'accumulator',
'args',
'arrayLikeClasses',
'ArrayProto',
'bind',
'callee',
'className',
'compareAscending',
'forIn',
'found',
'funcs',
'indexOf',
'indicator',
'isArguments',
'isArr',
'isArray',
'isFunc',
'isFunction',
'isPlainObject',
'methodName',
'noaccum',
'noop',
'objectClass',
'objectTypes',
'pass',
'properties',
'property',
'propsLength',
'source',
'stackA',
'stackB',
'stackLength',
'target'
];
/** Used to minify `iterationFactory` option properties */
var iterationFactoryOptions = [
'afterLoop',
/** Used to minify `compileIterator` option properties */
var iteratorOptions = [
'args',
'array',
'arrayBranch',
'beforeLoop',
'bottom',
'exits',
'firstArg',
'hasDontEnumBug',
'inLoop',
'init',
'iterate',
'loopExp',
'isKeysFast',
'object',
'returns',
'objectBranch',
'noArgsEnum',
'noCharByIndex',
'shadowed',
'top',
'useHas'
'useHas',
'useStrict'
];
/** Used to minify variables and string values to a single character */
var minNames = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');
minNames.push.apply(minNames, minNames.map(function(value) {
return value + value;
}));
/** Used protect the specified properties from getting minified */
/** Used to protect the specified properties from getting minified */
var propWhitelist = [
'_',
'__chain__',
'__wrapped__',
'after',
'all',
'amd',
'any',
'attachEvent',
'bind',
'bindAll',
'chain',
'clearTimeout',
'clone',
'collect',
'compact',
'compose',
'contains',
'countBy',
'criteria',
'debounce',
'defaults',
'defer',
'delay',
'detect',
'difference',
'drop',
'each',
'environment',
'escape',
'evaluate',
'every',
'exports',
'extend',
'filter',
'find',
'first',
'flatten',
'foldl',
'foldr',
'forEach',
'forIn',
'forOwn',
'functions',
'groupBy',
'has',
'head',
'identity',
'include',
'index',
'indexOf',
'initial',
'inject',
'interpolate',
'intersection',
'invert',
'invoke',
'isArguments',
'isArray',
'isBoolean',
'isDate',
'isElement',
'isEmpty',
'isEqual',
'isEqual',
'isFinite',
'lodash',
'isFinite',
'isFunction',
'isNaN',
'isNull',
'isNumber',
'isObject',
'isPlainObject',
'isRegExp',
'isString',
'isUndefined',
'keys',
'last',
'lastIndexOf',
'lateBind',
'map',
'max',
'memoize',
'merge',
'methods',
'min',
'mixin',
'noConflict',
'object',
'omit',
'once',
'opera',
'pairs',
'partial',
'pick',
'pluck',
'random',
'range',
'reduce',
'reduceRight',
'reject',
'rest',
'result',
'select',
'setTimeout',
'shuffle',
'size',
'some',
'sortBy',
'sortedIndex',
'source',
'tail',
'take',
'tap',
'template',
'templates',
'templateSettings',
'throttle',
'times',
'toArray',
'unescape',
'union',
'uniq',
'unique',
'uniqueId',
'value',
'variable'
'values',
'variable',
'VERSION',
'where',
'without',
'wrap',
'zip',
// properties used by underscore.js
'_chain',
'_wrapped'
];
/*--------------------------------------------------------------------------*/
/**
* Pre-process a given JavaScript `source`, preparing it for minification.
* Pre-process a given Lo-Dash `source`, preparing it for minification.
*
* @private
* @param {String} source The source to process.
* @param {String} [source=''] The source to process.
* @param {Object} [options={}] The options object.
* @returns {String} Returns the processed source.
*/
function preprocess(source) {
function preprocess(source, options) {
source || (source = '');
options || (options = {});
// remove unrecognized JSDoc tags so Closure Compiler won't complain
source = source.replace(/@(?:alias|category)\b.*/g, '');
if (options.isTemplate) {
return source;
}
// remove copyright to add later in post-compile.js
source = source.replace(/\/\*![\s\S]+?\*\//, '');
// correct JSDoc tags for Closure Compiler
source = source.replace(/@(?:alias|category)[^\n]*/g, '');
// add brackets to whitelisted properties so Closure Compiler won't mung them.
// add brackets to whitelisted properties so Closure Compiler won't mung them
// http://code.google.com/closure/compiler/docs/api-tutorial3.html#export
source = source.replace(RegExp('\\.(' + iterationFactoryOptions.concat(propWhitelist).join('|') + ')\\b', 'g'), "['$1']");
source = source.replace(RegExp('\\.(' + propWhitelist.join('|') + ')\\b', 'g'), "['$1']");
// minify `sortBy` and `template` methods
['sortBy', 'template'].forEach(function(methodName) {
var properties = ['criteria', 'value'],
snippet = source.match(RegExp('(\\n\\s*)function ' + methodName + '[\\s\\S]+?\\1}'))[0],
result = snippet;
// remove brackets from `_.escape()` in `_.template`
source = source.replace(/__e *= *_\['escape']/g, '__e=_.escape');
// minify property strings
properties.forEach(function(property, index) {
result = result.replace(RegExp("'" + property + "'", 'g'), "'" + minNames[index] + "'");
// remove brackets from `_.escape()` in underscore.js `_.template`
source = source.replace(/_\['escape'\]\(__t'/g, '_.escape(__t');
// remove brackets from `collection.indexOf` in `_.contains`
source = source.replace("collection['indexOf'](target)", 'collection.indexOf(target)');
// remove brackets from `result[length].value` in `_.sortBy`
source = source.replace("result[length]['value']", 'result[length].value');
// remove whitespace from string literals
source = source.replace(/'(?:(?=(\\?))\1.)*?'/g, function(string) {
// avoids removing the '\n' of the `stringEscapes` object
return string.replace(/\[object |delete |else |function | in |return\s+[\w']|throw |typeof |use strict|var |@ |'\\n'|\\\\n|\\n|\s+/g, function(match) {
return match == false || match == '\\n' ? '' : match;
});
// remove escaped newlines in strings
result = result.replace(/\\n/g, '');
// replace with modified snippet
source = source.replace(snippet, result);
});
// minify all `iterationFactory` related snippets
source.match(
// add newline to `+"__p+='"` in underscore.js `_.template`
source = source.replace(/\+"__p\+='"/g, '+"\\n__p+=\'"');
// remove whitespace from `_.template` related regexes
source = source.replace(/(?:reEmptyString\w+|reInsertVariable) *=.+/g, function(match) {
return match.replace(/ |\\n/g, '');
});
// remove newline from double-quoted strings in `_.template`
source = source
.replace('"\';\\n__with ("', '"\';__with("')
.replace('"\\n}__\\n__p += \'"', '"}____p+=\'"')
.replace('"__p = \'"', '"__p=\'"')
.replace('"\';\\n"', '"\';"')
.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', `_.merge`, and `_.sortBy`
(function() {
var properties = ['criteria', 'index', 'value'],
snippets = source.match(/( +)(?:function compareAscending|var merge|var sortBy)\b[\s\S]+?\n\1}/g);
if (!snippets) {
return;
}
snippets.forEach(function(snippet) {
var modified = snippet,
isCompilable = /(?:var merge|var sortBy)\b/.test(modified),
isInlined = !/\bcreateIterator\b/.test(modified);
// 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');
if (isCompilable) {
// add quotes around properties in the inlined `_.merge` and `_.sortBy`
// of the mobile build so Closure Compiler won't mung them
if (isInlined) {
modified = modified
.replace(reBracketProp, "['" + minNames[index] + "']")
.replace(reDotProp, "['" + minNames[index] + "']")
.replace(rePropColon, "$1'" + minNames[index] + "':");
}
else {
modified = modified
.replace(reBracketProp, '.' + minNames[index])
.replace(reDotProp, '.' + minNames[index])
.replace(rePropColon, '$1' + minNames[index] + ':');
}
}
else {
modified = modified
.replace(reBracketProp, "['" + minNames[index] + "']")
.replace(reDotProp, '.' + minNames[index])
.replace(rePropColon, "$1'" + minNames[index] + "':")
// correct `value.source` in regexp branch of `_.clone`
if (property == 'source') {
modified = modified.replace("value['" + minNames[index] + "']", "value['source']");
}
}
});
// replace with modified snippet
source = source.replace(snippet, modified);
});
}());
// minify all compilable snippets
var snippets = source.match(
RegExp([
// match variables storing `iterationFactory` options
'var [a-zA-Z]+FactoryOptions\\s*=\\s*\\{[\\s\\S]+?};\\n',
// match the the `iterationFactory` function
'(\\n\\s*)function iterationFactory[\\s\\S]+?\\1}',
// match methods created by `iterationFactor` calls
'iterationFactory\\((?:[\'{]|[a-zA-Z]+,)[\\s\\S]+?\\);\\n'
// match the `iteratorTemplate`
'( +)var iteratorTemplate\\b[\\s\\S]+?\\n\\1}',
// match methods created by `createIterator` calls
'createIterator\\((?:{|[a-zA-Z]+)[\\s\\S]+?\\);\\n',
// match variables storing `createIterator` options
'( +)var [a-zA-Z]+IteratorOptions\\b[\\s\\S]+?\\n\\2}',
// match the the `createIterator` function
'( +)function createIterator\\b[\\s\\S]+?\\n\\3}'
].join('|'), 'g')
)
.forEach(function(snippet, index) {
var result = snippet;
);
// add `true` and `false` arguments to be minified
if (/function iterationFactory/.test(snippet)) {
result = result
.replace(/(Function\('[\s\S]+?)undefined/, '$1true,false,undefined')
.replace(/\)\([^)]+/, '$&,true,false');
// exit early if no compilable snippets
if (!snippets) {
return source;
}
// replace with modified snippet early and clip snippet
source = source.replace(snippet, result);
snippet = result = result.replace(/\)\([\s\S]+$/, '');
snippets.forEach(function(snippet, index) {
var isCreateIterator = /function createIterator\b/.test(snippet),
isIteratorTemplate = /var iteratorTemplate\b/.test(snippet),
modified = snippet;
// add brackets to whitelisted properties so Closure Compiler won't mung them
modified = modified.replace(RegExp('\\.(' + iteratorOptions.join('|') + ')\\b', 'g'), "['$1']");
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
// minify snippet variables / arguments
compiledVars.forEach(function(variable, index) {
result = result.replace(RegExp('([^.]\\b|\\\\n)' + variable + '\\b(?!\'\\s*[\\]:])', 'g'), '$1' + minNames[index]);
// ensure properties in compiled strings aren't minified
modified = modified.replace(RegExp('([^.]\\b)' + variable + '\\b(?!\' *[\\]:])', 'g'), '$1' + minNames[index]);
// correct `typeof x == 'object'`
if (variable == 'object') {
result = result.replace(RegExp("(typeof [^']+')" + minNames[index] + "'", 'g'), "$1object'");
}
// correct boolean literals
if (variable == 'true' || variable == 'false') {
result = result
.replace(RegExp(':\\s*' + minNames[index] + '\\s*,', 'g'), ':' + variable + ',')
.replace(RegExp('\\s*' + minNames[index] + '\\s*;', 'g'), variable + ';');
modified = modified.replace(RegExp("(typeof [^']+')" + minNames[index] + "'", 'g'), "$1object'");
}
});
// minify snippet values
compiledValues.forEach(function(value, index) {
result = result.replace(RegExp("'" + value + "'", 'g'), "'" + minNames[index] + "'");
});
// minify iterationFactory option property strings
iterationFactoryOptions.forEach(function(property, index) {
if (property == 'array' || property == 'object') {
result = result.replace(RegExp("'" + property + "'(\\s*[\\]:])", 'g'), "'" + minNames[index] + "'$1");
} else {
result = result.replace(RegExp("'" + property + "'", 'g'), "'" + minNames[index] + "'");
// 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]);
}
else {
if (property == 'array' || property == 'object') {
// minify "array" and "object" sub property names
modified = modified.replace(RegExp("'" + property + "'( *[\\]:])", 'g'), "'" + minNames[index] + "'$1");
}
else {
// minify property name strings
modified = modified.replace(RegExp("'" + property + "'", 'g'), "'" + minNames[index] + "'");
// minify property names in regexes and accessors
if (isCreateIterator) {
modified = modified.replace(RegExp('([\\.|/])' + property + '\\b' , 'g'), '$1' + minNames[index]);
}
}
}
});
// remove escaped newlines in strings
result = result.replace(/\\n/g, '');
// replace with modified snippet
source = source.replace(snippet, result);
source = source.replace(snippet, modified);
});
return source;
@@ -198,13 +440,23 @@
// expose `preprocess`
if (module != require.main) {
module.exports = preprocess;
} else {
// read the JavaScript source file from the first argument if the script
}
else {
// read the Lo-Dash source file from the first argument if the script
// was invoked directly (e.g. `node pre-compile.js source.js`) and write to
// the same file
(function() {
var source = fs.readFileSync(process.argv[2], 'utf8');
fs.writeFileSync(process.argv[2], preprocess(source), 'utf8');
var options = process.argv;
if (options.length < 3) {
return;
}
var filePath = options[options.length - 1],
isTemplate = options.indexOf('-t') > -1 || options.indexOf('--template') > -1,
source = fs.readFileSync(filePath, 'utf8');
fs.writeFileSync(filePath, preprocess(source, {
'isTemplate': isTemplate
}), 'utf8');
}());
}
}());

File diff suppressed because it is too large Load Diff

View File

@@ -20,9 +20,10 @@
// generate Markdown
$markdown = docdown(array(
'path' => '../' . $file,
'title' => 'Lo-Dash <sup>v0.1.0</sup>',
'url' => 'https://github.com/bestiejs/lodash/blob/master/lodash.js'
'path' => '../' . $file,
'title' => 'Lo-Dash <sup>v0.8.2</sup>',
'toc' => 'categories',
'url' => 'https://github.com/bestiejs/lodash/blob/master/lodash.js'
));
// save to a .md file

1
index.js Executable file
View File

@@ -0,0 +1 @@
module.exports = require('./lodash');

4723
lodash.js

File diff suppressed because it is too large Load Diff

61
lodash.min.js vendored
View File

@@ -1,26 +1,39 @@
/*!
Lo-Dash 0.1.0 github.com/bestiejs/lodash/blob/master/LICENSE.txt
Underscore.js 1.3.3 github.com/documentcloud/underscore/blob/master/LICENSE
Lo-Dash 0.8.2 lodash.com/license
Underscore.js 1.4.2 underscorejs.org/LICENSE
*/
;(function(r,h){"use strict";var n=!0,o=!1;function Q(a){return"[object Arguments]"==k.call(a)}function i(a){return new p(a)}function p(a){this.o=a}function g(){for(var a,b=-1,c={},d={},f={},e=["d","j","g","a"];++b<arguments.length;)for(a in arguments[b])f[a]=arguments[b][a];for(;a=e.pop();)"object"==typeof f[a]?(c[a]=f[a].c,d[a]=f[a].k):c[a]=d[a]=f[a]||"";a=f.b;var b=/^[^,]+/.exec(a)[0],e=f.h,j=f.i,g=!("v"==a||"b"==j),j=!("b"==a||"a"==j),h=f.n!==o;return Function("c,d,i,l,m,n,p,q,s,t,w,z,B,E,F,k,G",'"use strict";return function('+
a+"){"+(f.m||"")+";"+("var o, y"+(e?"="+e:""))+";if("+b+"==G)return "+(f.f||"y")+";"+(g?"var u="+b+".length;o=-1;"+((j?"if(u===+u){":"")+(c.d||"")+";while("+(c.j||"++o<u")+"){"+c.g+"}"+(c.a||"")+";"+(j?"}":"")):"")+(j?(g?"else{":"")+(d.d||"")+";for("+(d.j||"o in "+b)+"){"+(h?"if(m.call("+/\S+$/.exec(d.j||b)[0]+",o)){":"")+d.g+(h?"}":"")+"}"+(d.a||"")+";"+(g?"}":""):"")+(f.e||"")+";return "+(f.l||"y")+"}")(D,u,ba,ca,s,R,E,Infinity,F,da,Math,l,G,k,n,o)}function S(a){return a.replace(ua,function(a,c){return y[c]})}
function ea(a,b,c,d){var f=2<arguments.length;if(a==h)return c;d&&(b=u(b,d));var e=a.length;if(e===+e){for(e&&!f&&(c=a[--e]);e--;)c=b(c,a[e],e,a);return c}var j=T(a);for((e=j.length)&&!f&&(c=a[j[--e]]);e--;)f=j[e],c=b(c,a[f],f,a);return c}function fa(a,b,c){var d=0,f=a.length;for(c||(c=R);d<f;){var e=d+f>>1;c(a[e])<c(b)?d=e+1:f=e}return d}function U(a,b,c){return b==h||c?a[0]:l.call(a,0,b)}function H(a,b){return b?ba.apply([],a):z(a,function(a,b){if(F(b))return V.apply(a,H(b)),a;a.push(b);return a},
[])}function E(a,b,c){var d;if(a==h)return-1;if(c)return c=fa(a,b),a[c]===b?c:-1;c=0;for(d=a.length;c<d;c++)if(a[c]===b)return c;return-1}function ga(a){var b=l.call(arguments,1);return W(I(a),function(a){return X(b,function(b){return 0<=E(b,a)})})}function ha(a,b,c){var d=a.length;return b==h||c?a[d-1]:l.call(a,-b||d)}function ia(a,b,c){return l.call(a,b==h||c?1:b)}function I(a,b,c){var c=c?A(a,c):a,d=[];3>a.length&&(b=n);z(c,function(c,e,j){if(b?ha(c)!==e||!c.length:0>E(c,e))c.push(e),d.push(a[j]);
return c},[]);return d}function u(a,b){var c=l.call(arguments,2),d=c.length;return function(){c.length=d;V.apply(c,arguments);return a.apply(b,c)}}function ja(a,b,c){var d;return function(){var f=arguments,e=this;c&&!d&&a.apply(e,f);va(d);d=J(function(){d=h;c||a.apply(e,f)},b)}}function Y(a,b,c){c||(c=[]);if(a===b)return 0!==a||1/a==1/b;if(a==h||b==h)return a===b;a.p&&(a=a.o);b.p&&(b=b.o);if(a.isEqual&&q(a.isEqual))return a.isEqual(b);if(b.isEqual&&q(b.isEqual))return b.isEqual(a);var d=k.call(a);
if(d!=k.call(b))return o;switch(d){case G:return a==""+b;case K:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case ka:case la:return+a==+b;case ma:return a.source==b.source&&a.global==b.global&&a.multiline==b.multiline&&a.ignoreCase==b.ignoreCase}if("object"!=typeof a||"object"!=typeof b)return o;for(var f=c.length;f--;)if(c[f]==a)return n;var f=n,e=0;c.push(a);if(d==D){if(e=a.length,f=e==b.length)for(;e--&&(f=e in a==e in b&&Y(a[e],b[e],c)););}else{if("constructor"in a!="constructor"in b||a.constructor!=
b.constructor)return o;for(var j in a)if(s.call(a,j)&&(e++,!(f=s.call(b,j)&&Y(a[j],b[j],c))))break;if(f){for(j in b)if(s.call(b,j)&&!e--)break;f=!e}}c.pop();return f}function q(a){return k.call(a)==ca}function R(a){return a}function na(a){t(L(a),function(b){var c=i[b]=a[b];i.prototype[b]=function(){var a=l.call(arguments);wa.call(a,this.o);a=c.apply(i,a);return this.p?(new p(a)).chain():a}})}var y={"\\":"\\","'":"'",r:"\r",n:"\n",t:"\t",u2028:"\u2028",u2029:"\u2029"};(function(){for(var a in y)y[y[a]]=
a})();var Z="object"==typeof exports&&exports&&("object"==typeof global&&global&&global==global.global&&(r=global),exports),xa=0,ya=r._,za=/\\|'|\r|\n|\t|\u2028|\u2029/g,$=/.^/,ua=/\\(\\|'|r|n|t|u2028|u2029)/g,D="[object Array]",ka="[object Boolean]",la="[object Date]",ca="[object Function]",K="[object Number]",ma="[object RegExp]",G="[object String]",v=Array.prototype,M=Object.prototype,ba=v.concat,s=M.hasOwnProperty,V=v.push,l=v.slice,k=M.toString,wa=v.unshift,Aa=r.isFinite,M=Object.keys,va=r.clearTimeout,
J=r.setTimeout,N={b:"b",m:"var I=i.apply([],z.call(arguments,1))",h:"[]",g:"if(p(I,b[o])<0)y.push(b[o])"},w={h:"F",g:"if(!e(g[o],o,g))return !y"},aa={b:"v",h:"v",d:"for(var A,j=1,u=arguments.length;j<u;j++){A=arguments[j]",j:"o in A",g:"v[o]=A[o]",n:o,a:"}"},B={h:"[]",g:"e(g[o],o,g)&&y.push(g[o])"},m={b:"g,e,D",m:"if(!e){e=n}else if(D){e=d(e,D)}",h:"g",g:"e(g[o],o,g)"},oa={b:"v",m:"if(v!==Object(v))throw TypeError()",h:"[]",g:"y.push(o)"},C={h:"",f:"[]",d:{c:"y=Array(u)",k:"y=[]"},g:{c:"y[o]=e(g[o],o,g)",
k:"y[y.length]=e(g[o],o,g)"}},x={m:"var j,y=-q,h=y;if(!e){if(s(g)&&g[0]===+g[0])return w.max.apply(w,g);if(t(g))return y;}else if(D)e=d(e,D)",g:"j=e?e(g[o],o,g):g[o];if(j>=h)h=j,y=g[o]"},F=Array.isArray||function(a){return k.call(a)==D},da=g({b:"H",i:"b",m:"var f=E.call(H)",h:"F",d:"if(f==c||f==B)return !H.length",g:"return k"}),pa=g({b:"g,C",h:"k",g:"if(g[o]===C)return F"}),X=g(m,w),W=g(m,B),qa=g(m,{g:"if(e(g[o],o,g))return g[o]"}),t=g(m),A=g(m,C),ra=g(m,x),x=g(m,x,{m:x.m.replace("-","").replace("max",
"min"),g:x.g.replace(">=","<")}),O=g(C,{b:"g,x",g:{c:"y[o]=g[o][x]",k:"y[y.length]=g[o][x]"}}),z=g({b:"g,e,a,D",m:"var r=arguments.length>2;if(D)e=d(e,D)",h:"a",d:{c:"if(!r)y=g[++o]"},g:{c:"y=e(y,g[o],o,g)",k:"y=r?e(y,g[o],o,g):(r=F,g[o])"}}),B=g(m,B,{g:"!"+B.g}),w=g(m,w,{h:"k",g:w.g.replace("!","")}),sa=g(C,{b:"g",g:{c:"y[o]=g[o]",k:"y[y.length]=g[o]"}}),C=g({b:"b",h:"[]",g:"if(b[o])y.push(b[o])"}),m=g(N),N=g(N,{m:"var I=z.call(arguments,1)",h:"[]"}),ta=g(aa,{g:"if(v[o]==G)"+aa.g}),P=g(aa),L=g(oa,
{m:"",n:o,g:"if(E.call(v[o])==l)y.push(o)",l:"y.sort()"});Q(arguments)||(Q=function(a){return!(!a||!s.call(a,"callee"))});var T=M||g(oa);P(i,{VERSION:"0.1.0",templateSettings:{escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g},after:function(a,b){return 1>a?b():function(){if(1>--a)return b.apply(this,arguments)}},bind:u,bindAll:function(a){var b=arguments,c=1;1==b.length&&(c=0,b=L(a));for(var d=b.length;c<d;c++)a[b[c]]=u(a[b[c]],a);return a},chain:function(a){return(new p(a)).chain()},
clone:function(a){return a!==Object(a)?a:F(a)?a.slice():P({},a)},compact:C,compose:function(){var a=arguments;return function(){for(var b=arguments,c=a.length;c--;)b=[a[c].apply(this,b)];return b[0]}},contains:pa,debounce:ja,defaults:ta,defer:function(a){var b=l.call(arguments,1);return J(function(){return a.apply(h,b)},1)},delay:function(a,b){var c=l.call(arguments,2);return J(function(){return a.apply(h,c)},b)},difference:m,escape:function(a){return(a+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,
"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;")},every:X,extend:P,filter:W,find:qa,first:U,flatten:H,forEach:t,functions:L,groupBy:function(a,b){var c={};if(!q(b))var d=b,b=function(a){return a[d]};t(a,function(a,e,d){e=b(a,e,d);(c[e]||(c[e]=[])).push(a)});return c},has:function(a,b){return s.call(a,b)},identity:R,indexOf:E,initial:function(a,b,c){return l.call(a,0,-(b==h||c?1:b))},intersection:ga,invoke:function(a,b){var c=l.call(arguments,2),d=q(b);return A(a,function(a){return(d?
b||a:a[b]).apply(a,c)})},isArguments:Q,isArray:F,isBoolean:function(a){return a===n||a===o||k.call(a)==ka},isDate:function(a){return k.call(a)==la},isElement:function(a){return!!(a&&1==a.nodeType)},isEmpty:da,isEqual:Y,isFinite:function(a){return Aa(a)&&k.call(a)==K},isFunction:q,isNaN:function(a){return k.call(a)==K&&a!=+a},isNull:function(a){return null===a},isNumber:function(a){return k.call(a)==K},isObject:function(a){return a===Object(a)},isRegExp:function(a){return k.call(a)==ma},isString:function(a){return k.call(a)==
G},isUndefined:function(a){return a===h},keys:T,last:ha,lastIndexOf:function(a,b){if(a==h)return-1;for(var c=a.length;c--;)if(a[c]===b)return c;return-1},map:A,max:ra,memoize:function(a,b){var c={};return function(){var d=b?b.apply(this,arguments):arguments[0];return s.call(c,d)?c[d]:c[d]=a.apply(this,arguments)}},min:x,mixin:na,noConflict:function(){r._=ya;return this},once:function(a){var b,c=o;return function(){if(c)return b;c=n;return b=a.apply(this,arguments)}},pick:function(a){for(var b,c=-1,
d=H(l.call(arguments,1)),f=d.length,e={};++c<f;)b=d[c],b in a&&(e[b]=a[b]);return e},pluck:O,range:function(a,b,c){c||(c=1);2>arguments.length&&(b=a||0,a=0);for(var d=-1,f=Math.max(Math.ceil((b-a)/c),0),e=Array(f);++d<f;)e[d]=a,a+=c;return e},reduce:z,reduceRight:ea,reject:B,rest:ia,result:function(a,b){if(a==h)return null;var c=a[b];return q(c)?a[b]():c},shuffle:function(a){var b,c=[];t(a,function(a,f){b=Math.floor(Math.random()*(f+1));c[f]=c[b];c[b]=a});return c},size:function(a){var b=k.call(a);
return b==D||b==G?a.length:T(a).length},some:w,sortBy:function(a,b,c){if(q(b))c&&(b=u(b,c));else var d=b,b=function(a){return a[d]};return O(A(a,function(c,e){return{a:b(c,e,a),b:c}}).sort(function(a,b){var c=a.a,d=b.a;return c===h?1:d===h?-1:c<d?-1:c>d?1:0}),"b")},sortedIndex:fa,tap:function(a,b){b(a);return a},template:function(a,b,c){function d(a){return f.call(this,a,i)}c=ta(c||{},i.templateSettings);a="__p+='"+a.replace(za,function(a){return"\\"+y[a]}).replace(c.escape||$,function(a,b){return"'+((__t=("+
S(b)+"))==null?'':_['escape'](__t))+'"}).replace(c.interpolate||$,function(a,b){return"'+((__t=("+S(b)+"))==null?'':__t)+'"}).replace(c.evaluate||$,function(a,b){return"';"+S(b)+";__p+='"})+"';";c.variable||(a="with(object||{}){"+a+"}");var a='var __t,__j=Array.prototype.join,__p="";function print(){__p+=__j.call(arguments,"")}'+a+"return __p",f=Function(c.variable||"object","_",a);if(b)return f(b,i);d.source="function("+(c.variable||"object")+"){"+a+"}";return d},throttle:function(a,b){var c,d,f,
e,g,i,k=ja(function(){d=g=o},b);return function(){c=arguments;e=this;i||(i=J(function(){i=h;d&&a.apply(e,c);k()},b));g?d=n:f=a.apply(e,c);k();g=n;return f}},times:function(a,b,c){c&&(b=u(b,c));for(c=0;c<a;c++)b(c)},toArray:function(a){if(!a)return[];if(q(a.toArray))return a.toArray();var b=a.length;return b===+b?l.call(a):sa(a)},union:function(){return I(H(arguments,n))},uniq:I,uniqueId:function(a){var b=xa++;return a?a+b:b},values:sa,without:N,wrap:function(a,b){return function(){var c=[a];V.apply(c,
arguments);return b.apply(this,c)}},zip:function(){for(var a=-1,b=ra(O(arguments,"length")),c=Array(b);++a<b;)c[a]=O(arguments,a);return c},all:X,any:w,collect:A,detect:qa,each:t,foldl:z,foldr:ea,head:U,include:pa,inject:z,intersect:ga,methods:L,select:W,tail:ia,take:U,unique:I});p.prototype=i.prototype;na(i);t("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=v[a];i.prototype[a]=function(){var a=this.o;b.apply(a,arguments);a.length===0&&delete a[0];return this.p?(new p(a)).chain():
a}});t(["concat","join","slice"],function(a){var b=v[a];p.prototype[a]=function(){var a=b.apply(this.o,arguments);return this.p?(new p(a)).chain():a}});P(p.prototype,{chain:function(){this.p=n;return this},value:function(){return this.o}});Z?"object"==typeof module&&module&&module.q==Z?(module.q=i)._=i:Z._=i:(r._=i,"function"==typeof define&&"object"==typeof define.amd&&define.amd&&define.amd.lodash&&define("lodash",function(){return i}))})(this);
;(function(e,t){function s(e){if(e&&e.__wrapped__)return e;if(!(this instanceof s))return new s(e);this.__wrapped__=e}function o(e,t,n){t||(t=0);var r=e.length,i=r-t>=(n||H),s=i?{}:e;if(i)for(n=t-1;++n<r;){var o=e[n]+"";(Z.call(s,o)?s[o]:s[o]=[]).push(e[n])}return function(e){if(i){var n=e+"";return Z.call(s,n)&&-1<T(s[n],e)}return-1<T(s,e,t)}}function u(e,n){var r=e.b,i=n.b,e=e.a,n=n.a;if(e!==n){if(e>n||e===t)return 1;if(e<n||n===t)return-1}return r<i?-1:1}function a(e,t,n){function r(){var u=arguments
,a=s?this:t;return i||(e=t[o]),n.length&&(u=u.length?n.concat(nt.call(u)):n),this instanceof r?(p.prototype=e.prototype,a=new p,(u=e.apply(a,u))&&Ht[typeof u]?u:a):e.apply(a,u)}var i=m(e),s=!n,o=e;return s&&(n=t),r}function f(e,n){return e?"function"!=typeof e?function(t){return t[e]}:n!==t?function(t,r,i){return e.call(n,t,r,i)}:e:A}function l(){for(var e={e:"",g:Et,i:"",j:Mt,m:Tt,n:kt,o:J,p:"",q:n,r:_t,c:{d:""},l:{d:""}},t,i=-1;t=arguments[++i];)for(var s in t){var o=t[s];/d|h/.test(s)?("string"==typeof
o&&(o={b:o,k:o}),e.c[s]=o.b,e.l[s]=o.k):e[s]=o}t=e.a;if("d"!=(e.f=/^[^,]+/.exec(t)[0])||!e.c.h)e.c=r;i="",e.r&&(i+="'use strict';"),i+="var i,A,j="+e.f+",t="+(e.i||e.f)+";if(!"+e.f+")return t;"+e.p+";",e.c&&(i+="var k=j.length;i=-1;",e.l&&(i+="if(k===+k){"),e.n&&(i+="if(y.call(j)==w){j=j.split('')}"),i+=e.c.d+";while(++i<k){A=j[i];"+e.c.h+"}",e.l&&(i+="}"));if(e.l){e.c?i+="else {":e.m&&(i+="var k=j.length;i=-1;if(k&&O(j)){while(++i<k){A=j[i+=''];"+e.l.h+"}}else {"),e.g||(i+="var u=typeof j=='function'&&q.call(j,'prototype');"
);if(e.j&&e.q)i+="var n=-1,o=Y[typeof j]?l(j):[],k=o.length;"+e.l.d+";while(++n<k){i=o[n];",e.g||(i+="if(!(u&&i=='prototype')){"),i+="A=j[i];"+e.l.h+"",e.g||(i+="}");else{i+=e.l.d+";for(i in j){";if(!e.g||e.q)i+="if(",e.g||(i+="!(u&&i=='prototype')"),!e.g&&e.q&&(i+="&&"),e.q&&(i+="h.call(j,i)"),i+="){";i+="A=j[i];"+e.l.h+";";if(!e.g||e.q)i+="}"}i+="}";if(e.g){i+="var g=j.constructor;";for(s=0;7>s;s++)i+="i='"+e.o[s]+"';if(","constructor"==e.o[s]&&(i+="!(g&&g.prototype===j)&&"),i+="h.call(j,i)){A=j[i];"+
e.l.h+"}"}if(e.c||e.m)i+="}"}return i+=e.e+";return t",Function("D,E,F,I,e,f,J,h,M,O,Q,S,T,X,Y,l,q,v,w,y,z","var G=function("+t+"){"+i+"};return G")(Dt,_,L,u,Q,f,en,Z,T,v,$t,m,Jt,mt,Ht,ut,tt,nt,yt,rt)}function c(e){return"\\"+Bt[e]}function h(e){return Qt[e]}function p(){}function d(e){return Gt[e]}function v(e){return rt.call(e)==ct}function m(e){return"function"==typeof e}function g(e){var t=i;if(!e||"object"!=typeof e||v(e))return t;var n=e.constructor;return(!Lt||"function"==typeof e.toString||"string"!=typeof
(e+""))&&(!m(n)||n instanceof n)?xt?(en(e,function(e,n,r){return t=!Z.call(r,n),i}),t===i):(en(e,function(e,n){t=n}),t===i||Z.call(e,t)):t}function y(e,t,n,s,o){if(e==r)return e;n&&(t=i);if(n=Ht[typeof e]){var u=rt.call(e);if(!Pt[u]||Nt&&v(e))return e;var a=u==ht,n=a||(u==mt?Jt(e):n)}if(!n||!t)return n?a?nt.call(e):Zt({},e):e;n=e.constructor;switch(u){case pt:case dt:return new n(+e);case vt:case yt:return new n(e);case gt:return n(e.source,U.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?mn:tn)(e,function(e,n){f[n]=y(e,t,r,s,o)}),f}function b(e,t,s,o){if(e==r||t==r)return e===t;if(e===t)return 0!==e||1/e==1/t;if(Ht[typeof e]||Ht[typeof t])e=e.__wrapped__||e,t=t.__wrapped__||t;var u=rt.call(e);if(u!=rt.call(t))return i;switch(u){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+""}var a=Dt[u];if(Nt&&!a&&(a=v(e))&&!v(t)||!a&&(u!=mt||Lt&&("function"!=typeof e.
toString&&"string"==typeof (e+"")||"function"!=typeof t.toString&&"string"==typeof (t+""))))return i;s||(s=[]),o||(o=[]);for(u=s.length;u--;)if(s[u]==e)return o[u]==t;var u=-1,f=n,l=0;s.push(e),o.push(t);if(a){l=e.length;if(f=l==t.length)for(;l--&&(f=b(e[l],t[l],s,o)););return f}a=e.constructor,f=t.constructor;if(a!=f&&(!m(a)||!(a instanceof a&&m(f)&&f instanceof f)))return i;for(var c in e)if(Z.call(e,c)&&(l++,!Z.call(t,c)||!b(e[c],t[c],s,o)))return i;for(c in t)if(Z.call(t,c)&&!(l--))return i;if(
Et)for(;7>++u;)if(c=J[u],Z.call(e,c)&&(!Z.call(t,c)||!b(e[c],t[c],s,o)))return i;return n}function w(e,t,n){var r=-Infinity,i=-1,s=e?e.length:0,o=r;if(t||s!==+s)t=f(t,n),mn(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 E(e,t,n,r){var s=e,o=e?e.length:0,u=3>arguments.length;if(o!==+o)var a=sn(e),o=a.length;else kt&&rt.call(e)==yt&&(s=e.split(""));return mn(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 S(e,t,n){
if(e)return t==r||n?e[0]:nt.call(e,0,t)}function x(e,t){for(var n=-1,r=e?e.length:0,i=[];++n<r;){var s=e[n];$t(s)?et.apply(i,t?s:x(s)):i.push(s)}return i}function T(e,t,n){var r=-1,i=e?e.length:0;if("number"==typeof n)r=(0>n?at(0,i+n):n||0)-1;else if(n)return r=C(e,t),e[r]===t?r:-1;for(;++r<i;)if(e[r]===t)return r;return-1}function N(e,t,n){return e?nt.call(e,t==r||n?1:t):[]}function C(e,t,n,r){var i=0,s=e?e.length:i;if(n){n=f(n,r);for(t=n(t);i<s;)r=i+s>>>1,n(e[r])<t?i=r+1:s=r}else for(;i<s;)r=i+
s>>>1,e[r]<t?i=r+1:s=r;return i}function k(e,t,n,r){var s=-1,o=e?e.length:0,u=[],a=[];"function"==typeof t&&(r=n,n=t,t=i);for(n=f(n,r);++s<o;)if(r=n(e[s],s,e),t?!s||a[a.length-1]!==r:0>T(a,r))a.push(r),u.push(e[s]);return u}function L(e,t){return Ot||it&&2<arguments.length?it.call.apply(it,arguments):a(e,t,nt.call(arguments,2))}function A(e){return e}function O(e){mn(nn(e),function(t){var r=s[t]=e[t];s.prototype[t]=function(){var e=[this.__wrapped__];return arguments.length&&et.apply(e,arguments)
,e=r.apply(s,e),this.__chain__&&(e=new s(e),e.__chain__=n),e}})}var n=!0,r=null,i=!1,M="object"==typeof exports&&exports&&("object"==typeof global&&global&&global==global.global&&(e=global),exports),_=Array.prototype,D=Object.prototype,P=0,H=30,B=e._,j=/[-?+=!~*%&^<>|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/,F=/&(?:amp|lt|gt|quot|#x27);/g,I=/\b__p\+='';/g,q=/\b(__p\+=)''\+/g,R=/(__e\(.*?\)|\b__t\))\+'';/g,U=/\w*$/,z=/(?:__e|__t=)\(\s*(?![\d\s"']|this\.)/g,W=RegExp("^"+(D.valueOf+""
).replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),X=/($^)/,V=/[&<>"']/g,$=/['\n\r\t\u2028\u2029\\]/g,J="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),K=Math.ceil,Q=_.concat,G=Math.floor,Y=W.test(Y=Object.getPrototypeOf)&&Y,Z=D.hasOwnProperty,et=_.push,tt=D.propertyIsEnumerable,nt=_.slice,rt=D.toString,it=W.test(it=nt.bind)&&it,st=W.test(st=Array.isArray)&&st,ot=e.isFinite,ut=W.test(ut=Object.keys)&&ut
,at=Math.max,ft=Math.min,lt=Math.random,ct="[object Arguments]",ht="[object Array]",pt="[object Boolean]",dt="[object Date]",vt="[object Number]",mt="[object Object]",gt="[object RegExp]",yt="[object String]",bt=e.clearTimeout,wt=e.setTimeout,Et,St,xt,Tt=n;(function(){function e(){this.x=1}var t={0:1,length:1},n=[];e.prototype={valueOf:1,y:1};for(var r in new e)n.push(r);for(r in arguments)Tt=!r;Et=4>(n+"").length,xt="x"!=n[0],St=(n.splice.call(t,0,1),t[0])})(1);var Nt=!v(arguments),Ct="x"!=nt.call("x"
)[0],kt="xx"!="x"[0]+Object("x")[0];try{var Lt=("[object Object]",rt.call(e.document||0)==mt)}catch(At){}var Ot=it&&/\n|Opera/.test(it+rt.call(e.opera)),Mt=ut&&/^.+$|true/.test(ut+!!e.attachEvent),_t=!Ot,Dt={};Dt[pt]=Dt[dt]=Dt["[object Function]"]=Dt[vt]=Dt[mt]=Dt[gt]=i,Dt[ct]=Dt[ht]=Dt[yt]=n;var Pt={};Pt[ct]=Pt["[object Function]"]=i,Pt[ht]=Pt[pt]=Pt[dt]=Pt[vt]=Pt[mt]=Pt[gt]=Pt[yt]=n;var Ht={"boolean":i,"function":n,object:n,number:i,string:i,"undefined":i,unknown:n},Bt={"\\":"\\","'":"'","\n":"n"
,"\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};s.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""};var jt={a:"d,c,x",p:"c=f(c,x)",h:"if(c(A,i,d)===false)return t"},Ft={i:"{}",p:"c=f(c,x)",h:"var p=c(A,i,d);(h.call(t,p)?t[p]++:t[p]=1)"},It={i:"true",h:"if(!c(A,i,d))return!t"},qt={q:i,r:i,a:"m",p:"for(var a=1,b=arguments.length;a<b;a++){if(j=arguments[a]){",h:"t[i]=A",e:"}}"},Rt={i:"[]",h:"c(A,i,d)&&t.push(A)"},Ut={p:"c=f(c,x)"}
,zt={h:{k:jt.h}},Wt={i:"d||[]",d:{b:"t=Array(k)",k:"t="+(Mt?"Array(k)":"[]")},h:{b:"t[i]=c(A,i,d)",k:"t"+(Mt?"[n]=":".push")+"(c(A,i,d))"}},Xt={q:i,a:"m,c,x",i:"{}",p:"var R=typeof c=='function';if(R)c=f(c,x);else var s=e.apply(E,arguments)",h:"if(R?!c(A,i,m):M(s,i)<0)t[i]=A"},Vt=l({a:"m",i:"{}",h:"t[A]=i"});Nt&&(v=function(e){return e?Z.call(e,"callee"):i});var $t=st||function(e){return rt.call(e)==ht};m(/x/)&&(m=function(e){return"[object Function]"==rt.call(e)});var Jt=Y?function(e){if(!e||"object"!=typeof
e)return i;var t=e.valueOf,n="function"==typeof t&&(n=Y(t))&&Y(n);return n?e==n||Y(e)==n&&!v(e):g(e)}:g,Kt=l({a:"m",i:"[]",h:"t.push(i)"}),Qt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},Gt=Vt(Qt),Yt=l(qt,{h:"if(t[i]==null)"+qt.h}),Zt=l(qt),en=l(jt,Ut,zt,{q:i}),tn=l(jt,Ut,zt),nn=l({q:i,a:"m",i:"[]",h:"S(A)&&t.push(i)",e:"t.sort()"}),rn=l({a:"A",i:"true",p:"var H=y.call(A),k=A.length;if(D[H]"+(Nt?"||O(A)":"")+"||(H==X&&k===+k&&S(A.splice)))return!k",h:{k:"return false"}}),sn=ut?function(
e){var t=typeof e;return"function"==t&&tt.call(e,"prototype")?Kt(e):e&&Ht[t]?ut(e):[]}:Kt,on=l(qt,{a:"m,dd,N",p:"var P,C=arguments,a=0;if(N==I){var b=2,ee=C[3],ff=C[4]}else var b=C.length,ee=[],ff=[];while(++a<b){if(j=C[a]){",h:"if((dd=A)&&((P=Q(dd))||T(dd))){var K=false,gg=ee.length;while(gg--)if(K=ee[gg]==dd)break;if(K){t[i]=ff[gg]}else {ee.push(dd);ff.push(A=(A=t[i],P)?(Q(A)?A:[]):(T(A)?A:{}));t[i]=G(A,dd,I,ee,ff)}}else if(dd!=null)t[i]=dd"}),un=l(Xt),an=l({a:"m",i:"[]",h:"t"+(Mt?"[n]=":".push"
)+"([i,A])"}),fn=l(Xt,{p:"if(typeof c!='function'){var i=0,s=e.apply(E,arguments),k=s.length;while(++i<k){var p=s[i];if(p in m)t[p]=m[p]}}else {c=f(c,x)",h:"if(c(A,i,m))t[i]=A",e:"}"}),ln=l({a:"m",i:"[]",h:"t.push(A)"}),cn=l({a:"d,hh",i:"false",n:i,d:{b:"if(y.call(d)==w)return d.indexOf(hh)>-1"},h:"if(A===hh)return true"}),hn=l(jt,Ft),pn=l(jt,It),dn=l(jt,Rt),vn=l(jt,Ut,{i:"z",h:"if(c(A,i,d))return A"}),mn=l(jt,Ut),gn=l(jt,Ft,{h:"var p=c(A,i,d);(h.call(t,p)?t[p]:t[p]=[]).push(A)"}),yn=l(Wt,{a:"d,U"
,p:"var C=v.call(arguments,2),R=typeof U=='function'",h:{b:"t[i]=(R?U:A[U]).apply(A,C)",k:"t"+(Mt?"[n]=":".push")+"((R?U:A[U]).apply(A,C))"}}),bn=l(jt,Wt),wn=l(Wt,{a:"d,bb",h:{b:"t[i]=A[bb]",k:"t"+(Mt?"[n]=":".push")+"(A[bb])"}}),En=l({a:"d,c,B,x",i:"B",p:"var V=arguments.length<3;c=f(c,x)",d:{b:"if(V)t=j[++i]"},h:{b:"t=c(t,A,i,d)",k:"t=V?(V=false,A):c(t,A,i,d)"}}),Sn=l(jt,Rt,{h:"!"+Rt.h}),xn=l(jt,It,{i:"false",h:It.h.replace("!","")}),Tn=l(jt,Ft,Wt,{h:{b:"t[i]={a:c(A,i,d),b:i,c:A}",k:"t"+(Mt?"[n]="
:".push")+"({a:c(A,i,d),b:i,c:A})"},e:"t.sort(I);k=t.length;while(k--)t[k]=t[k].c"}),Nn=l(Rt,{a:"d,aa",p:"var s=[];J(aa,function(A,p){s.push(p)});var cc=s.length",h:"for(var Z=true,r=0;r<cc;r++){var p=s[r];if(!(Z=A[p]===aa[p]))break}Z&&t.push(A)"}),Cn=l({q:i,r:i,a:"m",p:"var L=arguments,i=0,k=L.length;if(k>1){while(++i<k)t[L[i]]=F(t[L[i]],t);return t}",h:"if(S(A))t[i]=F(A,t)"});s.VERSION="0.8.2",s.after=function(e,t){return 1>e?t():function(){if(1>--e)return t.apply(this,arguments)}},s.bind=L,s.bindAll=
Cn,s.chain=function(e){return e=new s(e),e.__chain__=n,e},s.clone=y,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.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=cn,s.countBy=hn,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,bt(a),a=wt(i,t),r&&(o=e.apply(u,s)),o}},s.defaults=
Yt,s.defer=function(e){var n=nt.call(arguments,1);return wt(function(){return e.apply(t,n)},1)},s.delay=function(e,n){var r=nt.call(arguments,2);return wt(function(){return e.apply(t,r)},n)},s.difference=function(e){var t=[];if(!e)return t;for(var n=-1,r=e.length,i=Q.apply(_,arguments),i=o(i,r);++n<r;){var s=e[n];i(s)||t.push(s)}return t},s.escape=function(e){return e==r?"":(e+"").replace(V,h)},s.every=pn,s.extend=Zt,s.filter=dn,s.find=vn,s.first=S,s.flatten=x,s.forEach=mn,s.forIn=en,s.forOwn=tn,
s.functions=nn,s.groupBy=gn,s.has=function(e,t){return e?Z.call(e,t):i},s.identity=A,s.indexOf=T,s.initial=function(e,t,n){return e?nt.call(e,0,-(t==r||n?1:t)):[]},s.intersection=function(e){var t=arguments.length,n=[],r=-1,i=e?e.length:0,s=[];e:for(;++r<i;){var u=e[r];if(0>T(s,u)){for(var a=1;a<t;a++)if(!(n[a]||(n[a]=o(arguments[a])))(u))continue e;s.push(u)}}return s},s.invert=Vt,s.invoke=yn,s.isArguments=v,s.isArray=$t,s.isBoolean=function(e){return e===n||e===i||rt.call(e)==pt},s.isDate=function(
e){return rt.call(e)==dt},s.isElement=function(e){return e?1===e.nodeType:i},s.isEmpty=rn,s.isEqual=b,s.isFinite=function(e){return ot(e)&&rt.call(e)==vt},s.isFunction=m,s.isNaN=function(e){return rt.call(e)==vt&&e!=+e},s.isNull=function(e){return e===r},s.isNumber=function(e){return rt.call(e)==vt},s.isObject=function(e){return e?Ht[typeof e]:i},s.isPlainObject=Jt,s.isRegExp=function(e){return rt.call(e)==gt},s.isString=function(e){return rt.call(e)==yt},s.isUndefined=function(e){return e===t},s
.keys=sn,s.last=function(e,t,n){if(e){var i=e.length;return t==r||n?e[i-1]:nt.call(e,-t||i)}},s.lastIndexOf=function(e,t,n){var r=e?e.length:0;for("number"==typeof n&&(r=(0>n?at(0,r+n):ft(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},s.lateBind=function(e,t){return a(t,e,nt.call(arguments,2))},s.map=bn,s.max=w,s.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return Z.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},s.merge=on,s.min=function(e,t,n){var r=
Infinity,i=-1,s=e?e.length:0,o=r;if(t||s!==+s)t=f(t,n),mn(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.mixin=O,s.noConflict=function(){return e._=B,this},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=un,s.once=function(e){var t,s=i;return function(){return s?t:(s=n,t=e.apply(this,arguments),e=r,t)}},s.pairs=an,s.partial=function(e){return a(e,nt.call(arguments,1))},s.pick=fn,s.pluck=
wn,s.random=function(e,t){return e==r&&t==r&&(t=1),e=+e||0,t==r&&(t=e,e=0),e+G(lt()*((+t||0)-e+1))},s.range=function(e,t,n){e=+e||0,n=+n||1,t==r&&(t=e,e=0);for(var i=-1,t=at(0,K((t-e)/n)),s=Array(t);++i<t;)s[i]=e,e+=n;return s},s.reduce=En,s.reduceRight=E,s.reject=Sn,s.rest=N,s.result=function(e,t){var n=e?e[t]:r;return m(n)?e[t]():n},s.shuffle=function(e){var t=-1,n=Array(e?e.length:0);return mn(e,function(e){var r=G(lt()*(++t+1));n[t]=n[r],n[r]=e}),n},s.size=function(e){var t=e?e.length:0;return t===+
t?t:sn(e).length},s.some=xn,s.sortBy=Tn,s.sortedIndex=C,s.tap=function(e,t){return t(e),e},s.template=function(e,t,n){e||(e=""),n||(n={});var r,i,o=0,u=s.templateSettings,a="__p += '",f=n.variable||u.variable,l=f;e.replace(RegExp((n.escape||u.escape||X).source+"|"+(n.interpolate||u.interpolate||X).source+"|"+(n.evaluate||u.evaluate||X).source+"|$","g"),function(t,n,i,s,u){a+=e.slice(o,u).replace($,c),a+=n?"'+__e("+n+")+'":s?"';"+s+";__p+='":i?"'+((__t=("+i+"))==null?'':__t)+'":"",r||(r=s||j.test(
n||i)),o=u+t.length}),a+="';",l||(f="obj",r?a="with("+f+"){"+a+"}":(n=RegExp("(\\(\\s*)"+f+"\\."+f+"\\b","g"),a=a.replace(z,"$&"+f+".").replace(n,"$1__d"))),a=(r?a.replace(I,""):a).replace(q,"$1").replace(R,"$1;"),a="function("+f+"){"+(l?"":f+"||("+f+"={});")+"var __t,__p='',__e=_.escape"+(r?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(l?"":",__d="+f+"."+f+"||"+f)+";")+a+"return __p}";try{i=Function("_","return "+a)(s)}catch(h){throw h.source=a,h}return t?i(t):(i.source=
a,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 r=new Date,f=t-(r-a);return i=arguments,o=this,0>=f?(bt(u),a=r,s=e.apply(o,i)):u||(u=wt(n,f)),s}},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){if(!e)return[];var t=e.length;return t===+t?(Ct?rt.call(e)==yt:"string"==typeof e)?e.split(""):nt.call(e):ln(e)},s.unescape=function(e){return e==r?"":(e+"").replace(F,d)},s.union=
function(){for(var e=-1,t=Q.apply(_,arguments),n=t.length,r=[];++e<n;){var i=t[e];0>T(r,i)&&r.push(i)}return r},s.uniq=k,s.uniqueId=function(e){var t=P++;return e?e+t:t},s.values=ln,s.where=Nn,s.without=function(e){for(var t=-1,n=e?e.length:0,r=o(arguments,1,20),i=[];++t<n;){var s=e[t];r(s)||i.push(s)}return i},s.wrap=function(e,t){return function(){var n=[e];return arguments.length&&et.apply(n,arguments),t.apply(this,n)}},s.zip=function(e){for(var t=-1,n=e?w(wn(arguments,"length")):0,r=Array(n);++
t<n;)r[t]=wn(arguments,t);return r},s.all=pn,s.any=xn,s.collect=bn,s.detect=vn,s.drop=N,s.each=mn,s.foldl=En,s.foldr=E,s.head=S,s.include=cn,s.inject=En,s.methods=nn,s.select=dn,s.tail=N,s.take=S,s.unique=k,O(s),s.prototype.chain=function(){return this.__chain__=n,this},s.prototype.value=function(){return this.__wrapped__},mn("pop push reverse shift sort splice unshift".split(" "),function(e){var t=_[e];s.prototype[e]=function(){var e=this.__wrapped__;return t.apply(e,arguments),St&&e.length===0&&delete
e[0],this.__chain__&&(e=new s(e),e.__chain__=n),e}}),mn(["concat","join","slice"],function(e){var t=_[e];s.prototype[e]=function(){var e=t.apply(this.__wrapped__,arguments);return this.__chain__&&(e=new s(e),e.__chain__=n),e}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(e._=s,define(function(){return s})):M?"object"==typeof module&&module&&module.exports==M?(module.exports=s)._=s:M._=s:e._=s})(this);

36
lodash.underscore.min.js vendored Normal file
View File

@@ -0,0 +1,36 @@
/*!
Lo-Dash 0.8.2 lodash.com/license
Underscore.js 1.4.2 underscorejs.org/LICENSE
*/
;(function(e,t){function s(e,t,r){var s;if(!e)return i;var t=x(t,r),o=e.length,r=-1;if(o===+o){for(;++r<o;)if(s=e[r],t(s,r,e))return n}else for(r in e)if(it.call(e,r)&&(s=e[r],t(s,r,e)))return n;return i}function o(e,t,n,r){var s,o,u=n;if(!e)return u;var a=3>arguments.length,t=x(t,r),f=e.length;s=-1;if(f===+f)for(a&&(u=e[++s]);++s<f;)o=e[s],u=t(u,o,s,e);else for(s in e)it.call(e,s)&&(o=e[s],u=a?(a=i,o):t(u,o,s,e));return u}function u(e,t){var n,r,i=e||[];if(!e)return i;var s=e.length;n=-1;if(s===+
s)for(i=Array(s);++n<s;)r=e[n],i[n]=r[t];else for(n in i=[],e)it.call(e,n)&&(r=e[n],i.push(r[t]));return i}function a(e,t,n){var r,i=e||[];if(!e)return i;var t=x(t,n),s=e.length,n=-1;if(s===+s)for(i=Array(s);++n<s;)r=e[n],i[n]=t(r,n,e);else for(n in i=[],e)it.call(e,n)&&(r=e[n],i.push(t(r,n,e)));return i}function f(e,t,n){var r;if(!e)return e;var t=x(t,n),i=e.length,n=-1;if(i===+i)for(;++n<i;)r=e[n],t(r,n,e);else for(n in e)it.call(e,n)&&(r=e[n],t(r,n,e));return e}function l(e,n,r){var i,s=t;if(!
e)return s;var n=x(n,r),o=e.length,r=-1;if(o===+o){for(;++r<o;)if(i=e[r],n(i,r,e))return i}else for(r in e)if(it.call(e,r)&&(i=e[r],n(i,r,e)))return i;return s}function c(e,t,n){var r,i=[];if(!e)return i;var t=x(t,n),s=e.length,n=-1;if(s===+s)for(;++n<s;)r=e[n],t(r,n,e)&&i.push(r);else for(n in e)it.call(e,n)&&(r=e[n],t(r,n,e)&&i.push(r));return i}function h(e,t,r){var s;if(!e)return n;var t=x(t,r),o=e.length,r=-1;if(o===+o){for(;++r<o;)if(s=e[r],!t(s,r,e))return i}else for(r in e)if(it.call(e,r)&&
(s=e[r],!t(s,r,e)))return i;return n}function p(e,t){var r,s;if(!e)return i;var o=e.length;r=-1;if(o===+o){if(ut.call(e)==wt)return-1<e.indexOf(t);for(;++r<o;)if(s=e[r],s===t)return n}else for(r in e)if(it.call(e,r)&&(s=e[r],s===t))return n;return i}function d(e){var t,n,r=[];if(!e)return r;for(t in e)it.call(e,t)&&(n=e[t],r.push(n));return r}function v(e){var t,n,r=[];if(!e)return r;for(t in e)n=e[t],L(n)&&r.push(t);return r.sort(),r}function m(e,t,n){var r;if(!e)return e;t=x(t,n);for(r in e)n=e
[r],t(n,r,e);return e}function g(e){var t,n,r=e;if(!e)return e;for(var i=1,s=arguments.length;i<s;i++)if(r=arguments[i])for(t in r)n=r[t],e[t]=n;return e}function y(e){var t,n=[];if(!e)return n;for(t in e)it.call(e,t)&&n.push(t);return n}function b(e){var t,n,r={};if(!e)return r;for(t in e)it.call(e,t)&&(n=e[t],r[n]=t);return r}function w(e){if(e&&e.__wrapped__)return e;if(!(this instanceof w))return new w(e);this.__wrapped__=e}function E(e,n){var r=e.b,i=n.b,e=e.a,n=n.a;if(e!==n){if(e>n||e===t)return 1
;if(e<n||n===t)return-1}return r<i?-1:1}function S(e,t,n){function r(){var i=arguments,s=t;return n.length&&(i=i.length?n.concat(ot.call(i)):n),this instanceof r?(C.prototype=e.prototype,s=new C,(i=e.apply(s,i))&&Tt[typeof i]?i:s):e.apply(s,i)}return r}function x(e,n){return e?"function"!=typeof e?function(t){return t[e]}:n!==t?function(t,r,i){return e.call(n,t,r,i)}:e:q}function T(e){return"\\"+Nt[e]}function N(e){return kt[e]}function C(){}function k(e){return Lt[e]}function L(e){return"function"==typeof
e}function A(e){var t=i;if(!e||"object"!=typeof e||isArguments(e))return t;var n=e.constructor;return!L(n)||n instanceof n?(m(e,function(e,n){t=n}),t===i||it.call(e,t)):t}function O(e,t,s,o){if(e==r||t==r)return e===t;if(e===t)return 0!==e||1/e==1/t;if(Tt[typeof e]||Tt[typeof t])e=e.__wrapped__||e,t=t.__wrapped__||t;var u=ut.call(e);if(u!=ut.call(t))return i;switch(u){case vt:case mt:return+e==+t;case gt:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case bt:case wt:return e==t+""}var a=Ct(e);if(!a&&u!=yt
)return i;s||(s=[]),o||(o=[]);for(u=s.length;u--;)if(s[u]==e)return o[u]==t;var f=n,u=0;s.push(e),o.push(t);if(a){u=e.length;if(f=u==t.length)for(;u--&&(f=O(e[u],t[u],s,o)););return f}a=e.constructor,f=t.constructor;if(a!=f&&(!L(a)||!(a instanceof a&&L(f)&&f instanceof f)))return i;for(var l in e)if(it.call(e,l)&&(u++,!it.call(t,l)||!O(e[l],t[l],s,o)))return i;for(l in t)if(it.call(t,l)&&!(u--))return i;return n}function M(e,t,n){var r=-Infinity,i=-1,s=e?e.length:0,o=r;if(t||s!==+s)t=x(t,n),f(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 _(e,t,n,r){var s=e?e.length:0,o=3>arguments.length;if(s!==+s)var u=At(e),s=u.length;return f(e,function(a,f,l){f=u?u[--s]:--s,n=o?(o=i,e[f]):t.call(r,n,e[f],f,l)}),n}function D(e,t,n){if(e)return t==r||n?e[0]:ot.call(e,0,t)}function P(e,t){for(var n=-1,r=e?e.length:0,i=[];++n<r;){var s=e[n];Ct(s)?st.apply(i,t?s:P(s)):i.push(s)}return i}function H(e,t,n){var r=-1,i=e?e.length:0;if("number"==typeof n)r=(0>n?ht(0,
i+n):n||0)-1;else if(n)return r=j(e,t),e[r]===t?r:-1;for(;++r<i;)if(e[r]===t)return r;return-1}function B(e,t,n){return e?ot.call(e,t==r||n?1:t):[]}function j(e,t,n,r){var i=0,s=e?e.length:i;if(n){n=x(n,r);for(t=n(t);i<s;)r=i+s>>>1,n(e[r])<t?i=r+1:s=r}else for(;i<s;)r=i+s>>>1,e[r]<t?i=r+1:s=r;return i}function F(e,t,n,r){var s=-1,o=e?e.length:0,u=[],a=[];"function"==typeof t&&(r=n,n=t,t=i);for(n=x(n,r);++s<o;)if(r=n(e[s],s,e),t?!s||a[a.length-1]!==r:0>H(a,r))a.push(r),u.push(e[s]);return u}function I
(e,t){return xt||at&&2<arguments.length?at.call.apply(at,arguments):S(e,t,ot.call(arguments,2))}function q(e){return e}function R(e){f(v(e),function(t){var r=w[t]=e[t];w.prototype[t]=function(){var e=[this.__wrapped__];return arguments.length&&st.apply(e,arguments),e=r.apply(w,e),this.__chain__&&(e=new w(e),e.__chain__=n),e}})}var n=!0,r=null,i=!1,U="object"==typeof exports&&exports&&("object"==typeof global&&global&&global==global.global&&(e=global),exports),z=Array.prototype,W=Object.prototype,
X=0,V=e._,$=/[-?+=!~*%&^<>|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/,J=/&(?:amp|lt|gt|quot|#x27);/g,K=/(?:__e|__t=)\(\s*(?![\d\s"']|this\.)/g,Q=RegExp("^"+(W.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),G=/($^)/,Y=/[&<>"']/g,Z=/['\n\r\t\u2028\u2029\\]/g,et=Math.ceil,tt=z.concat,nt=Math.floor,rt=Q.test(rt=Object.getPrototypeOf)&&rt,it=W.hasOwnProperty,st=z.push,ot=z.slice,ut=W.toString,at=Q.test(at=ot.bind)&&at,ft=Q.test(ft=Array.isArray
)&&ft,lt=e.isFinite,ct=Q.test(ct=Object.keys)&&ct,ht=Math.max,pt=Math.min,dt=Math.random,vt="[object Boolean]",mt="[object Date]",gt="[object Number]",yt="[object Object]",bt="[object RegExp]",wt="[object String]",Et=e.clearTimeout,St=e.setTimeout,xt=at&&/\n|Opera/.test(at+ut.call(e.opera)),Tt={"boolean":i,"function":n,object:n,number:i,string:i,"undefined":i,unknown:n},Nt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};w.templateSettings={escape:/<%-([\s\S]+?)%>/g
,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},w.isArguments=function(e){return"[object Arguments]"==ut.call(e)},w.isArguments(arguments)||(w.isArguments=function(e){return e?it.call(e,"callee"):i});var Ct=ft||function(e){return"[object Array]"==ut.call(e)};L(/x/)&&(L=function(e){return"[object Function]"==ut.call(e)});var W=rt?function(e){if(!e||"object"!=typeof e)return i;var t=e.valueOf,n="function"==typeof t&&(n=rt(t))&&rt(n);return n?e==n||rt(e)==n&&!isArguments(e):A
(e)}:A,kt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},Lt=b(kt),At=ct?function(e){return e&&Tt[typeof e]?ct(e):[]}:y;w.VERSION="0.8.2",w.after=function(e,t){return 1>e?t():function(){if(1>--e)return t.apply(this,arguments)}},w.bind=I,w.bindAll=function(e){var t,n,r=e,i=e;if(!e)return i;n=arguments,t=0;var s=n.length;if(1<s){for(;++t<s;)i[n[t]]=I(i[n[t]],i);return i}for(t in r)n=r[t],L(n)&&(i[t]=I(n,i));return i},w.chain=function(e){return e=new w(e),e.__chain__=n,e},w.clone=function(
e){return e&&Tt[typeof e]?Ct(e)?ot.call(e):g({},e):e},w.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},w.compose=function(){var e=arguments;return function(){for(var t=arguments,n=e.length;n--;)t=[e[n].apply(this,t)];return t[0]}},w.contains=p,w.countBy=function(e,t,n){var r,i={};if(!e)return i;var t=x(t,n),s=e.length,n=-1;if(s===+s)for(;++n<s;)r=e[n],r=t(r,n,e),it.call(i,r)?i[r]++:i[r]=1;else for(n in e)it.call(e,n)&&(r=e[n],r=t(r,n,e),it.call(i,r)?
i[r]++:i[r]=1);return i},w.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,Et(a),a=St(i,t),r&&(o=e.apply(u,s)),o}},w.defaults=function(e){var t,n,i=e;if(!e)return e;for(var s=1,o=arguments.length;s<o;s++)if(i=arguments[s])for(t in i)n=i[t],e[t]==r&&(e[t]=n);return e},w.defer=function(e){var n=ot.call(arguments,1);return St(function(){return e.apply(t,n)},1)},w.delay=function(e,n){var r=ot.call(arguments,2);return St
(function(){return e.apply(t,r)},n)},w.difference=function(e){for(var t=-1,n=e.length,r=tt.apply(z,arguments),i=[];++t<n;){var s=e[t];0>H(r,s,n)&&i.push(s)}return i},w.escape=function(e){return e==r?"":(e+"").replace(Y,N)},w.every=h,w.extend=g,w.filter=c,w.find=l,w.first=D,w.flatten=P,w.forEach=f,w.forIn=m,w.forOwn=function(e,t,n){var r;if(!e)return e;t=x(t,n);for(r in e)it.call(e,r)&&(n=e[r],t(n,r,e));return e},w.functions=v,w.groupBy=function(e,t,n){var r,i={};if(!e)return i;var t=x(t,n),s=e.length
,n=-1;if(s===+s)for(;++n<s;){r=e[n];var o=t(r,n,e);(it.call(i,o)?i[o]:i[o]=[]).push(r)}else for(n in e)it.call(e,n)&&(r=e[n],o=t(r,n,e),(it.call(i,o)?i[o]:i[o]=[]).push(r));return i},w.has=function(e,t){return e?it.call(e,t):i},w.identity=q,w.indexOf=H,w.initial=function(e,t,n){return e?ot.call(e,0,-(t==r||n?1:t)):[]},w.intersection=function(e){var t=arguments.length,n=-1,r=e.length,i=[];e:for(;++n<r;){var s=e[n];if(0>H(i,s)){for(var o=1;o<t;o++)if(0>H(arguments[o],s))continue e;i.push(s)}}return i
},w.invert=b,w.invoke=function(e,t){var n,r,i=e,s=e||[];if(!e)return s;var o=ot.call(arguments,2),u="function"==typeof t,a=i.length;n=-1;if(a===+a)for(s=Array(a);++n<a;)r=i[n],s[n]=(u?t:r[t]).apply(r,o);else for(n in s=[],i)it.call(i,n)&&(r=i[n],s.push((u?t:r[t]).apply(r,o)));return s},w.isArray=Ct,w.isBoolean=function(e){return e===n||e===i||ut.call(e)==vt},w.isDate=function(e){return ut.call(e)==mt},w.isElement=function(e){return e?1===e.nodeType:i},w.isEmpty=function(e){var t;if(!e)return n;var r=
ut.call(e),s=e.length;if(Ct(e)||r==wt||r==yt&&s===+s&&L(e.splice))return!s;for(t in e)if(it.call(e,t))return i;return n},w.isEqual=O,w.isFinite=function(e){return lt(e)&&ut.call(e)==gt},w.isFunction=L,w.isNaN=function(e){return ut.call(e)==gt&&e!=+e},w.isNull=function(e){return e===r},w.isNumber=function(e){return ut.call(e)==gt},w.isObject=function(e){return e?Tt[typeof e]:i},w.isPlainObject=W,w.isRegExp=function(e){return ut.call(e)==bt},w.isString=function(e){return ut.call(e)==wt},w.isUndefined=
function(e){return e===t},w.keys=At,w.last=function(e,t,n){if(e){var i=e.length;return t==r||n?e[i-1]:ot.call(e,-t||i)}},w.lastIndexOf=function(e,t,n){var r=e?e.length:0;for("number"==typeof n&&(r=(0>n?ht(0,r+n):pt(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},w.map=a,w.max=M,w.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return it.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},w.min=function(e,t,n){var r=Infinity,i=-1,s=e?e.length:0,o=r;if(t||s!==+
s)t=x(t,n),f(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},w.mixin=R,w.noConflict=function(){return e._=V,this},w.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},w.omit=function(e,t,n){var r,i,s=e,o={};if(!e)return o;var u="function"==typeof t;if(u)t=x(t,n);else var a=tt.apply(z,arguments);for(r in s)if(i=s[r],u?!t(i,r,e):0>H(a,r))o[r]=i;return o},w.once=function(e){var t,s=i;return function(){
return s?t:(s=n,t=e.apply(this,arguments),e=r,t)}},w.pairs=function(e){var t,n,r=[];if(!e)return r;for(t in e)it.call(e,t)&&(n=e[t],r.push([t,n]));return r},w.pick=function(e,t,n){var r,i,s=e,o={};if(!e)return o;if("function"!=typeof t){r=0,i=tt.apply(z,arguments);for(s=i.length;++r<s;){var u=i[r];u in e&&(o[u]=e[u])}}else for(r in t=x(t,n),s)i=s[r],t(i,r,e)&&(o[r]=i);return o},w.pluck=u,w.random=function(e,t){return e==r&&t==r&&(t=1),e=+e||0,t==r&&(t=e,e=0),e+nt(dt()*((+t||0)-e+1))},w.range=function(
e,t,n){e=+e||0,n=+n||1,t==r&&(t=e,e=0);for(var i=-1,t=ht(0,et((t-e)/n)),s=Array(t);++i<t;)s[i]=e,e+=n;return s},w.reduce=o,w.reduceRight=_,w.reject=function(e,t,n){var r,i=[];if(!e)return i;var t=x(t,n),s=e.length,n=-1;if(s===+s)for(;++n<s;)r=e[n],!t(r,n,e)&&i.push(r);else for(n in e)it.call(e,n)&&(r=e[n],!t(r,n,e)&&i.push(r));return i},w.rest=B,w.result=function(e,t){var n=e?e[t]:r;return L(n)?e[t]():n},w.shuffle=function(e){var t=-1,n=Array(e?e.length:0);return f(e,function(e){var r=nt(dt()*(++
t+1));n[t]=n[r],n[r]=e}),n},w.size=function(e){var t=e?e.length:0;return t===+t?t:At(e).length},w.some=s,w.sortBy=function(e,t,n){var r,i=e||[];if(!e)return i;var t=x(t,n),s=e.length,n=-1;if(s===+s)for(i=Array(s);++n<s;)r=e[n],i[n]={a:t(r,n,e),b:n,c:r};else for(n in i=[],e)it.call(e,n)&&(r=e[n],i.push({a:t(r,n,e),b:n,c:r}));i.sort(E);for(s=i.length;s--;)i[s]=i[s].c;return i},w.sortedIndex=j,w.tap=function(e,t){return t(e),e},w.template=function(e,t,n){e||(e=""),n||(n={});var r,i,s=0,o=w.templateSettings
,u="__p += '",a=n.variable||o.variable,f=a;e.replace(RegExp((n.escape||o.escape||G).source+"|"+(n.interpolate||o.interpolate||G).source+"|"+(n.evaluate||o.evaluate||G).source+"|$","g"),function(t,n,i,o,a){u+=e.slice(s,a).replace(Z,T),u+=n?"'+__e("+n+")+'":o?"';"+o+";__p+='":i?"'+((__t=("+i+"))==null?'':__t)+'":"",r||(r=o||$.test(n||i)),s=a+t.length}),u+="';",f||(a="obj",r?u="with("+a+"){"+u+"}":(n=RegExp("(\\(\\s*)"+a+"\\."+a+"\\b","g"),u=u.replace(K,"$&"+a+".").replace(n,"$1__d"))),u="function("+
a+"){"+(f?"":a+"||("+a+"={});")+"var __t,__p='',__e=_.escape"+(r?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(f?"":",__d="+a+"."+a+"||"+a)+";")+u+"return __p}";try{i=Function("_","return "+u)(w)}catch(l){throw l.source=u,l}return t?i(t):(i.source=u,i)},w.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 r=new Date,f=t-(r-a);return i=arguments,o=this,0>=f?(Et(u),a=r,s=e.apply(o,i)):u||(u=St(n,f)),s}},w.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},w.toArray=function(e){if(!e)return[];var t=e.length;return t===+t?"string"==typeof e?e.split(""):ot.call(e):d(e)},w.unescape=function(e){return e==r?"":(e+"").replace(J,k)},w.union=function(){for(var e=-1,t=tt.apply(z,arguments),n=t.length,r=[];++e<n;){var i=t[e];0>H(r,i)&&r.push(i)}return r},w.uniq=F,w.uniqueId=function(e){var t=X++;return e?e+t:t},w.values=d,w.where=function(e,t){var r,i,s=[];if(!e)return s;var o=[];m(t,function(
e,t){o.push(t)});var u=o.length,a=e.length;r=-1;if(a===+a)for(;++r<a;){i=e[r];for(var f=n,l=0;l<u&&(f=o[l],f=i[f]===t[f]);l++);f&&s.push(i)}else for(r in e)if(it.call(e,r)){i=e[r],f=n;for(l=0;l<u&&(f=o[l],f=i[f]===t[f]);l++);f&&s.push(i)}return s},w.without=function(e){for(var t=-1,n=e.length,r=[];++t<n;){var i=e[t];0>H(arguments,i,1)&&r.push(i)}return r},w.wrap=function(e,t){return function(){var n=[e];return arguments.length&&st.apply(n,arguments),t.apply(this,n)}},w.zip=function(e){for(var t=-1
,n=e?M(u(arguments,"length")):0,r=Array(n);++t<n;)r[t]=u(arguments,t);return r},w.all=h,w.any=s,w.collect=a,w.detect=l,w.drop=B,w.each=f,w.foldl=o,w.foldr=_,w.head=D,w.include=p,w.inject=o,w.methods=v,w.select=c,w.tail=B,w.take=D,w.unique=F,R(w),w.prototype.chain=function(){return this.__chain__=n,this},w.prototype.value=function(){return this.__wrapped__},f("pop push reverse shift sort splice unshift".split(" "),function(e){var t=z[e];w.prototype[e]=function(){var e=this.__wrapped__;return t.apply
(e,arguments),this.__chain__&&(e=new w(e),e.__chain__=n),e}}),f(["concat","join","slice"],function(e){var t=z[e];w.prototype[e]=function(){var e=t.apply(this.__wrapped__,arguments);return this.__chain__&&(e=new w(e),e.__chain__=n),e}}),U?"object"==typeof module&&module&&module.exports==U?(module.exports=w)._=w:U._=w:e._=w})(this);

View File

@@ -1,9 +1,9 @@
{
"name": "lodash",
"version": "0.1.0",
"description": "A drop-in replacement for Underscore.js that delivers up to 8x performance improvements, bug fixes, and additional features.",
"homepage": "https://github.com/bestiejs/lodash",
"main": "lodash",
"version": "0.8.2",
"description": "A drop-in replacement for Underscore.js delivering performance, bug fixes, and additional features.",
"homepage": "http://lodash.com",
"main": "./lodash",
"keywords": [
"browser",
"client",
@@ -16,12 +16,12 @@
"licenses": [
{
"type": "MIT",
"url": "http://mths.be/mit"
"url": "http://lodash.com/license"
}
],
"author": {
"name": "John-David Dalton",
"email": "john@fusejs.com",
"email": "john.david.dalton@gmail.com",
"web": "http://allyoucanleet.com/"
},
"bugs": {
@@ -31,12 +31,22 @@
"type": "git",
"url": "https://github.com/bestiejs/lodash.git"
},
"bin": {
"lodash": "./build.js"
},
"directories": {
"doc": "./doc",
"test": "./test"
},
"engines": [
"node",
"rhino"
],
"directories": {
"doc": "./doc",
"test": "./test"
"jam": {
"main": "./lodash.js"
},
"scripts": {
"build": "node build",
"test": "node test/test && node test/test-build"
}
}
}

59
perf/index.html Normal file
View File

@@ -0,0 +1,59 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Lo-Dash Performance Suite</title>
<style>
html, body {
margin: 0;
padding: 0;
height: 100%;
}
applet {
position: absolute;
left: -9999em;
}
</style>
</head>
<body>
<script src="../lodash.min.js"></script>
<script>
var lodash = _.noConflict();
</script>
<script src="../vendor/underscore/underscore-min.js"></script>
<script src="../vendor/platform.js/platform.js"></script>
<script src="../vendor/benchmark.js/benchmark.js"></script>
<script src="../vendor/firebug-lite/src/firebug-lite-debug.js"></script>
<script src="perf.js"></script>
<script>
(function() {
var measured,
perfNow,
begin = new Date;
function init() {
var fbUI = document.getElementById('FirebugUI'),
fbDoc = fbUI && (fbDoc = fbUI.contentWindow || fbUI.contentDocument).document || fbDoc,
fbCommandLine = fbDoc && fbDoc.getElementById('fbCommandLine');
if (!fbCommandLine) {
return setTimeout(init, 15);
}
fbUI.style.height = fbDoc.body.style.height = fbDoc.documentElement.style.height = '100%';
setTimeout(run, 15);
}
// is the applet permitted?
if (!/[?&]nojava=true(?:&|$)/.test(location.search)) {
// is the applet really needed?
while (!(measured = new Date - begin)) { }
if (measured != 1 && !((perfNow = window.performance) && typeof (perfNow.now || perfNow.webkitNow) == 'function')) {
// load applet
document.write('<applet code="nano" archive="../vendor/benchmark.js/nano.jar"></applet>');
}
}
window.onload = init;
}());
</script>
</body>
</html>

1549
perf/perf.js Normal file

File diff suppressed because it is too large Load Diff

9
perf/run-perf.sh Executable file
View File

@@ -0,0 +1,9 @@
cd "$(dirname "$0")"
for cmd in node narwhal ringo rhino; do
echo ""
echo "Running performance suite in $cmd..."
$cmd perf.js
done
echo ""
echo "Running performance suite in a browser..."
open index.html

49
test/backbone.html Normal file
View File

@@ -0,0 +1,49 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Backbone Test Suite</title>
<link rel="stylesheet" href="../vendor/backbone/test/vendor/qunit.css">
<style>
body > #qunit-header {
display: none;
}
#jslitmus {
display: none;
}
</style>
</head>
<body>
<div id="qunit"></div>
<h1 id="qunit-header"><a href="#">Backbone Speed Suite</a></h1>
<div id="qunit-fixture">
<div id='testElement'>
<h1>Test</h1>
</div>
</div>
<script src="../vendor/backbone/test/vendor/json2.js"></script>
<script src="../vendor/backbone/test/vendor/jquery-1.7.1.js"></script>
<script src="../vendor/backbone/test/vendor/jslitmus.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>
<script>
document.write('<script src="../' + QUnit.config.lodashFilename + '.js"><\/script>');
</script>
<script src="../vendor/backbone/backbone.js"></script>
<script src="../vendor/backbone/test/environment.js"></script>
<script src="../vendor/backbone/test/noconflict.js"></script>
<script src="../vendor/backbone/test/events.js"></script>
<script src="../vendor/backbone/test/model.js"></script>
<script src="../vendor/backbone/test/collection.js"></script>
<script src="../vendor/backbone/test/router.js"></script>
<script src="../vendor/backbone/test/view.js"></script>
<script src="../vendor/backbone/test/sync.js"></script>
</body>
</html>

View File

@@ -6,34 +6,87 @@
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css">
</head>
<body>
<h1 id="qunit-header">Lo-Dash Test Suite</h1>
<h2 id="qunit-banner"></h2>
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<script src="../vendor/qunit/qunit/qunit.js"></script>
<script>var _2, _ = 1;</script>
<script src="../lodash.js"></script>
<script src="../vendor/requirejs/require.js"></script>
<div id="qunit"></div>
<script src="../vendor/platform.js/platform.js"></script>
<script>
if (/[?&]norequire=true(?:&|$)/.test(location.search)) {
require = define = null;
document.write('<script src="test.js"><\/script>');
}
else {
define.amd.lodash = true;
require({
'baseUrl': '../vendor/requirejs/',
'urlArgs': 't=' + (+new Date),
'paths': {
'lodash': '../../lodash'
}
// 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>
<script>
// set a bad shim
Object._keys = Object.keys;
Object.keys = function() { return []; };
// load Lo-Dash and expose it to the bad `Object.keys` shim
document.write('<script src="../' + QUnit.config.lodashFilename + '.js"><\/script>');
</script>
<script>
// store Lo-Dash to test for bad shim detection
var lodashBadShim = _;
// restore nativeKeys
Object.keys = Object._keys;
delete Object._keys;
// load Lo-Dash again to overwrite the existing `_` value
document.write('<script src="../' + QUnit.config.lodashFilename + '.js"><\/script>');
// load test.js if not using require.js
document.write(QUnit.urlParams.norequire
? '<script src="test.js"><\/script>'
: '<script src="../vendor/requirejs/require.js"><\/script>'
);
</script>
<script>
// load Lo-Dash as a module
var lodashModule,
shimmedModule,
underscoreModule;
window.require && require({
'baseUrl': '../vendor/requirejs/',
'urlArgs': 't=' + (+new Date),
'paths': {
'lodash': '../../' + QUnit.config.lodashFilename,
'shimmed': './../../' + QUnit.config.lodashFilename,
'underscore': '../underscore/../../' + QUnit.config.lodashFilename
},
['lodash'], function(_) {
_2 = _.noConflict();
require(['test.js']);
});
}
'shim': {
'shimmed': {
'exports': '_'
}
}
},
['lodash', 'shimmed', 'underscore'], function(lodash, shimmed, underscore) {
if (lodash && lodash.noConflict) {
lodashModule = lodash.noConflict();
lodashModule.moduleName = 'lodash';
}
if (shimmed.noConflict) {
shimmedModule = shimmed.noConflict();
shimmedModule.moduleName = 'shimmed';
}
if (underscore && underscore.noConflict) {
underscoreModule = underscore.noConflict();
underscoreModule.moduleName = 'underscore';
}
require(['test.js']);
});
// set a more readable browser name
window.onload = function() {
var timeoutId = setInterval(function() {
var ua = document.getElementById('qunit-userAgent');
if (ua) {
ua.innerHTML = platform;
clearInterval(timeoutId);
}
}, 15);
};
</script>
</body>
</html>
</html>

View File

@@ -1,7 +1,14 @@
cd "$(dirname "$0")"
for cmd in rhino ringo narwhal node; do
echo "Testing in $cmd..."
$cmd test.js
echo ""
echo "Testing in $cmd..."
$cmd test.js
done
echo ""
echo "Testing build..."
node test-build.js
echo ""
echo "Testing in a browser..."
open index.html
open index.html

3
test/template/a.jst Normal file
View File

@@ -0,0 +1,3 @@
<ul>
<% _.forEach(people, function(name) { %><li><%= name %></li><% }); %>
</ul>

1
test/template/b.jst Normal file
View File

@@ -0,0 +1 @@
<% print("Hello " + epithet); %>.

1
test/template/c.tpl Normal file
View File

@@ -0,0 +1 @@
Hello {{ name }}!

968
test/test-build.js Normal file
View File

@@ -0,0 +1,968 @@
#!/usr/bin/env node
;(function(undefined) {
'use strict';
/** Load modules */
var fs = require('fs'),
path = require('path'),
vm = require('vm'),
build = require('../build.js'),
minify = require('../build/minify'),
_ = require('../lodash.js');
/** The unit testing framework */
var QUnit = global.QUnit = require('../vendor/qunit/qunit/qunit.js');
require('../vendor/qunit-clib/qunit-clib.js');
/** Used to associate aliases with their real names */
var aliasToRealMap = {
'all': 'every',
'any': 'some',
'collect': 'map',
'detect': 'find',
'drop': 'rest',
'each': 'forEach',
'foldl': 'reduce',
'foldr': 'reduceRight',
'head': 'first',
'include': 'contains',
'inject': 'reduce',
'methods': 'functions',
'select': 'filter',
'tail': 'rest',
'take': 'first',
'unique': 'uniq'
};
/** Used to associate real names with their aliases */
var realToAliasMap = {
'contains': ['include'],
'every': ['all'],
'filter': ['select'],
'find': ['detect'],
'first': ['head', 'take'],
'forEach': ['each'],
'functions': ['methods'],
'map': ['collect'],
'reduce': ['foldl', 'inject'],
'reduceRight': ['foldr'],
'rest': ['drop', 'tail'],
'some': ['any'],
'uniq': ['unique']
};
/** List of all Lo-Dash methods */
var allMethods = _.functions(_).filter(function(methodName) {
return !/^_/.test(methodName);
});
/** List of "Arrays" category methods */
var arraysMethods = [
'compact',
'difference',
'drop',
'first',
'flatten',
'head',
'indexOf',
'initial',
'intersection',
'last',
'lastIndexOf',
'object',
'range',
'rest',
'sortedIndex',
'tail',
'take',
'union',
'uniq',
'unique',
'without',
'zip'
];
/** List of "Chaining" category methods */
var chainingMethods = [
'chain',
'mixin',
'tap',
'value'
];
/** List of "Collections" category methods */
var collectionsMethods = [
'all',
'any',
'collect',
'contains',
'countBy',
'detect',
'each',
'every',
'filter',
'find',
'foldl',
'foldr',
'forEach',
'groupBy',
'include',
'inject',
'invoke',
'map',
'max',
'min',
'pluck',
'reduce',
'reduceRight',
'reject',
'select',
'shuffle',
'size',
'some',
'sortBy',
'toArray',
'where'
];
/** List of "Functions" category methods */
var functionsMethods = [
'after',
'bind',
'bindAll',
'compose',
'debounce',
'defer',
'delay',
'lateBind',
'memoize',
'once',
'partial',
'throttle',
'wrap'
];
/** List of "Objects" category methods */
var objectsMethods = [
'clone',
'defaults',
'extend',
'forIn',
'forOwn',
'functions',
'has',
'invert',
'isArguments',
'isArray',
'isBoolean',
'isDate',
'isElement',
'isEmpty',
'isEqual',
'isFinite',
'isFunction',
'isNaN',
'isNull',
'isNumber',
'isObject',
'isPlainObject',
'isRegExp',
'isString',
'isUndefined',
'keys',
'methods',
'merge',
'omit',
'pairs',
'pick',
'values'
];
/** List of "Utilities" category methods */
var utilityMethods = [
'escape',
'identity',
'noConflict',
'random',
'result',
'template',
'times',
'unescape',
'uniqueId'
];
/** List of Backbone's Lo-Dash dependencies */
var backboneDependencies = [
'bind',
'bindAll',
'clone',
'contains',
'escape',
'every',
'extend',
'filter',
'find',
'first',
'forEach',
'groupBy',
'has',
'indexOf',
'initial',
'invoke',
'isArray',
'isEmpty',
'isEqual',
'isFunction',
'isObject',
'isRegExp',
'keys',
'last',
'lastIndexOf',
'map',
'max',
'min',
'mixin',
'reduce',
'reduceRight',
'reject',
'rest',
'result',
'shuffle',
'size',
'some',
'sortBy',
'sortedIndex',
'toArray',
'uniqueId',
'without'
];
/** List of methods used by Underscore */
var underscoreMethods = _.without.apply(_, [allMethods].concat([
'forIn',
'forOwn',
'isPlainObject',
'lateBind',
'merge',
'partial'
]));
/*--------------------------------------------------------------------------*/
/**
* Creates a context object to use with `vm.runInContext`.
*
* @private
* @returns {Object} Returns a new context object.
*/
function createContext() {
return vm.createContext({
'clearTimeout': clearTimeout,
'setTimeout': setTimeout
});
}
/**
* Expands a list of method names to include real and alias names.
*
* @private
* @param {Array} methodNames The array of method names to expand.
* @returns {Array} Returns a new array of expanded method names.
*/
function expandMethodNames(methodNames) {
return methodNames.reduce(function(result, methodName) {
var realName = getRealName(methodName);
result.push.apply(result, [realName].concat(getAliases(realName)));
return result;
}, []);
}
/**
* Gets the aliases associated with a given function name.
*
* @private
* @param {String} funcName The name of the function to get aliases for.
* @returns {Array} Returns an array of aliases.
*/
function getAliases(funcName) {
return realToAliasMap[funcName] || [];
}
/**
* Gets the names of methods belonging to the given `category`.
*
* @private
* @param {String} category The category to filter by.
* @returns {Array} Returns a new array of method names belonging to the given category.
*/
function getMethodsByCategory(category) {
switch (category) {
case 'Arrays':
return arraysMethods.slice();
case 'Chaining':
return chainingMethods.slice();
case 'Collections':
return collectionsMethods.slice();
case 'Functions':
return functionsMethods.slice();
case 'Objects':
return objectsMethods.slice();
case 'Utilities':
return utilityMethods.slice();
}
return [];
}
/**
* Gets the real name, not alias, of a given function name.
*
* @private
* @param {String} funcName The name of the function to resolve.
* @returns {String} Returns the real name.
*/
function getRealName(funcName) {
return aliasToRealMap[funcName] || funcName;
}
/**
* Tests if a given method on the `lodash` object can be called successfully.
*
* @private
* @param {Object} lodash The built Lo-Dash object.
* @param {String} methodName The name of the Lo-Dash method to test.
* @param {String} message The unit test message.
*/
function testMethod(lodash, methodName, message) {
var pass = true,
array = [['a', 1], ['b', 2], ['c', 3]],
object = { 'a': 1, 'b': 2, 'c': 3 },
noop = function() {},
string = 'abc',
func = lodash[methodName];
try {
if (arraysMethods.indexOf(methodName) > -1) {
if (/(?:indexOf|sortedIndex|without)$/i.test(methodName)) {
func(array, string);
} else if (/^(?:difference|intersection|union|uniq|zip)/.test(methodName)) {
func(array, array);
} else if (methodName == 'range') {
func(2, 4);
} else {
func(array);
}
}
else if (chainingMethods.indexOf(methodName) > -1) {
if (methodName == 'chain') {
lodash.chain(array);
lodash(array).chain();
}
else if (methodName == 'mixin') {
lodash.mixin({});
}
else {
lodash(array)[methodName](noop);
}
}
else if (collectionsMethods.indexOf(methodName) > -1) {
if (/^(?:count|group|sort)By$/.test(methodName)) {
func(array, noop);
func(array, string);
func(object, noop);
func(object, string);
}
else if (/^(?:size|toArray)$/.test(methodName)) {
func(array);
func(object);
}
else if (methodName == 'invoke') {
func(array, 'slice');
func(object, 'toFixed');
}
else if (methodName == 'where') {
func(array, object);
func(object, object);
}
else {
func(array, noop, object);
func(object, noop, object);
}
}
else if (functionsMethods.indexOf(methodName) > -1) {
if (methodName == 'after') {
func(1, noop);
} else if (methodName == 'bindAll') {
func({ 'noop': noop });
} else if (methodName == 'lateBind') {
func(lodash, 'identity', array, string);
} else if (/^(?:bind|partial)$/.test(methodName)) {
func(noop, object, array, string);
} else if (/^(?:compose|memoize|wrap)$/.test(methodName)) {
func(noop, noop);
} else if (/^(?:debounce|throttle)$/.test(methodName)) {
func(noop, 100);
} else {
func(noop);
}
}
else if (objectsMethods.indexOf(methodName) > -1) {
if (methodName == 'clone') {
func(object);
func(object, true);
}
else if (/^(?:defaults|extend|merge)$/.test(methodName)) {
func({}, object);
} else if (/^(?:forIn|forOwn)$/.test(methodName)) {
func(object, noop);
} else if (/^(?:omit|pick)$/.test(methodName)) {
func(object, 'b');
} else if (methodName == 'has') {
func(object, string);
} else {
func(object);
}
}
else if (utilityMethods.indexOf(methodName) > -1) {
if (methodName == 'result') {
func(object, 'b');
} else if (methodName == 'times') {
func(2, noop, object);
} else {
func(string, object);
}
}
}
catch(e) {
console.log(e);
pass = false;
}
equal(pass, true, '_.' + methodName + ': ' + message);
}
/*--------------------------------------------------------------------------*/
QUnit.module('minified AMD snippet');
(function() {
var start = _.once(QUnit.start);
asyncTest('`lodash`', function() {
build(['-s'], function(source, filePath) {
// used by r.js build optimizer
var defineHasRegExp = /typeof\s+define\s*==(=)?\s*['"]function['"]\s*&&\s*typeof\s+define\.amd\s*==(=)?\s*['"]object['"]\s*&&\s*define\.amd/g,
basename = path.basename(filePath, '.js');
ok(!!defineHasRegExp.exec(source), basename);
start();
});
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('template builds');
(function() {
var templatePath = __dirname + '/template';
asyncTest('`lodash template=*.jst`', function() {
var start = _.after(2, _.once(QUnit.start));
build(['-s', 'template=' + templatePath + '/*.jst'], function(source, filePath) {
var basename = path.basename(filePath, '.js'),
context = createContext();
var data = {
'a': { 'people': ['moe', 'larry', 'curly'] },
'b': { 'epithet': 'stooge' }
};
context._ = _;
vm.runInContext(source, context);
var templates = context._.templates;
equal(templates.a(data.a).replace(/[\r\n]+/g, ''), '<ul><li>moe</li><li>larry</li><li>curly</li></ul>', basename);
equal(templates.b(data.b), 'Hello stooge.', basename);
start();
});
});
asyncTest('`lodash settings=...`', function() {
var start = _.after(2, _.once(QUnit.start));
build(['-s', 'template=' + templatePath + '/*.tpl', 'settings={interpolate:/\\{\\{([\\s\\S]+?)\\}\\}/}'], function(source, filePath) {
var basename = path.basename(filePath, '.js'),
context = createContext();
var data = {
'c': { 'name': 'Mustache' }
};
context._ = _;
vm.runInContext(source, context);
var templates = context._.templates;
equal(templates.c(data.c), 'Hello Mustache!', basename);
start();
});
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('independent builds');
(function() {
asyncTest('debug only', function() {
var start = _.once(QUnit.start);
build(['-d', '-s'], function(source, filePath) {
equal(path.basename(filePath, '.js'), 'lodash');
start();
});
});
asyncTest('debug custom', function () {
var start = _.once(QUnit.start);
build(['-d', '-s', 'backbone'], function(source, filePath) {
equal(path.basename(filePath, '.js'), 'lodash.custom');
start();
});
});
asyncTest('minified only', function() {
var start = _.once(QUnit.start);
build(['-m', '-s'], function(source, filePath) {
equal(path.basename(filePath, '.js'), 'lodash.min');
start();
});
});
asyncTest('minified custom', function () {
var start = _.once(QUnit.start);
build(['-m', '-s', 'backbone'], function(source, filePath) {
equal(path.basename(filePath, '.js'), 'lodash.custom.min');
start();
});
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('strict modifier');
(function() {
var object = Object.create(Object.prototype, {
'a': { 'value': _.identify },
'b': { 'value': null }
});
['non-strict', 'strict'].forEach(function(strictMode, index) {
asyncTest(strictMode + ' should ' + (index ? 'error': 'silently fail') + ' attempting to overwrite read-only properties', function() {
var commands = ['-s', 'include=bindAll,defaults,extend'],
start = _.after(2, _.once(QUnit.start));
if (index) {
commands.push('strict');
}
build(commands, function(source, filePath) {
var basename = path.basename(filePath, '.js'),
context = createContext(),
pass = !index;
vm.runInContext(source, context);
var lodash = context._;
try {
lodash.bindAll(object);
lodash.extend(object, { 'a': 1 });
lodash.defaults(object, { 'b': 2 });
} catch(e) {
pass = !!index;
}
equal(pass, true, basename);
start();
});
});
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('underscore modifier');
(function() {
asyncTest('modified methods should work correctly', function() {
var start = _.after(2, _.once(QUnit.start));
build(['-s', 'underscore'], function(source, filePath) {
var last,
array = [{ 'value': 1 }, { 'value': 2 }],
basename = path.basename(filePath, '.js'),
context = createContext();
vm.runInContext(source, context);
var lodash = context._;
lodash.each(array, function(value) {
last = value;
return false;
});
equal(last.value, 2, '_.each: ' + basename);
equal(lodash.isEmpty('moe'), false, '_.isEmpty: ' + basename);
var object = { 'fn': lodash.bind(function(x) { return this.x + x; }, { 'x': 1 }, 1) };
equal(object.fn(), 2, '_.bind: ' + basename);
ok(lodash.clone(array, true)[0] === array[0], '_.clone: ' + basename);
start();
});
});
asyncTest('`lodash underscore include=partial`', function() {
var start = _.after(2, _.once(QUnit.start));
build(['-s', 'underscore', 'include=partial'], function(source, filePath) {
var basename = path.basename(filePath, '.js'),
context = createContext();
vm.runInContext(source, context);
var lodash = context._;
equal(lodash.partial(_.identity, 2)(), 2, '_.partial: ' + basename);
start();
});
});
asyncTest('`lodash underscore plus=clone`', function() {
var start = _.after(2, _.once(QUnit.start));
build(['-s', 'underscore', 'plus=clone'], function(source, filePath) {
var array = [{ 'value': 1 }],
basename = path.basename(filePath, '.js'),
context = createContext();
vm.runInContext(source, context);
var lodash = context._,
clone = lodash.clone(array, true);
deepEqual(array, clone, basename);
notEqual(array, clone, basename);
start();
});
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('exports command');
(function() {
var commands = [
'exports=amd',
'exports=commonjs',
'exports=global',
'exports=node',
'exports=none'
];
commands.forEach(function(command, index) {
asyncTest('`lodash ' + command +'`', function() {
var start = _.after(2, _.once(QUnit.start));
build(['-s', command], function(source, filePath) {
var basename = path.basename(filePath, '.js'),
context = createContext(),
pass = false;
switch(index) {
case 0:
context.define = function(fn) {
pass = true;
context._ = fn();
};
context.define.amd = {};
vm.runInContext(source, context);
ok(pass, basename);
break;
case 1:
context.exports = {};
vm.runInContext(source, context);
ok(context._ === undefined, basename);
ok(_.isFunction(context.exports._), basename)
break;
case 2:
vm.runInContext(source, context);
ok(_.isFunction(context._), basename);
break;
case 3:
context.exports = {};
context.module = { 'exports': context.exports };
vm.runInContext(source, context);
ok(context._ === undefined, basename);
ok(_.isFunction(context.module.exports), basename);
break;
case 4:
vm.runInContext(source, context);
ok(context._ === undefined, basename);
}
start();
});
});
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('iife command');
(function() {
var commands = [
'iife=this["lodash"]=(function(window,undefined){%output%;return lodash}(this))',
'iife=define(function(window,undefined){return function(){%output%;return lodash}}(this));'
];
commands.forEach(function(command) {
asyncTest('`lodash ' + command +'`', function() {
var start = _.after(2, _.once(QUnit.start));
build(['-s', 'exports=none', command], function(source, filePath) {
var basename = path.basename(filePath, '.js'),
context = createContext();
context.define = function(func) {
context.lodash = func();
};
try {
vm.runInContext(source, context);
} catch(e) {
console.log(e);
}
var lodash = context.lodash || {};
ok(_.isString(lodash.VERSION), basename);
start();
});
});
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('output options');
(function() {
['-o a.js', '--output a.js'].forEach(function(command, index) {
asyncTest('`lodash ' + command +'`', function() {
var start = _.once(QUnit.start);
build(['-s'].concat(command.split(' ')), function(source, filePath) {
equal(path.basename(filePath, '.js'), 'a', command);
start();
});
});
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('stdout options');
(function() {
['-c', '--stdout'].forEach(function(command, index) {
asyncTest('`lodash ' + command +'`', function() {
var written,
start = _.once(QUnit.start),
write = process.stdout.write;
process.stdout.write = function(string) {
written = string;
};
build([command, 'exports=', 'include='], function(source) {
process.stdout.write = write;
equal(written, source);
equal(arguments.length, 1);
start();
});
});
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('minify underscore');
(function() {
asyncTest('`node minify underscore.js`', function() {
var source = fs.readFileSync(path.join(__dirname, '..', 'vendor', 'underscore', 'underscore.js'), 'utf8'),
start = _.once(QUnit.start);
minify(source, {
'isSilent': true,
'workingName': 'underscore.min',
'onComplete': function(result) {
var context = createContext();
try {
vm.runInContext(result, context);
} catch(e) {
console.log(e);
}
var underscore = context._ || {};
ok(_.isString(underscore.VERSION));
ok(!/Lo-Dash/.test(result) && result.match(/\n/g).length < source.match(/\n/g).length);
start();
}
});
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('mobile build');
(function() {
asyncTest('`lodash mobile`', function() {
var start = _.after(2, _.once(QUnit.start));
build(['-s', 'mobile'], function(source, filePath) {
var basename = path.basename(filePath, '.js'),
context = createContext();
try {
vm.runInContext(source, context);
} catch(e) {
console.log(e);
}
var array = [1, 2, 3],
object1 = [{ 'a': 1 }],
object2 = [{ 'b': 2 }],
object3 = [{ 'a': 1, 'b': 2 }],
circular1 = { 'a': 1 },
circular2 = { 'a': 1 },
lodash = context._;
circular1.b = circular1;
circular2.b = circular2;
deepEqual(lodash.merge(object1, object2), object3, basename);
deepEqual(lodash.sortBy([3, 2, 1], _.identity), array, basename);
equal(lodash.isEqual(circular1, circular2), true, basename);
var actual = lodash.clone(circular1, true);
ok(actual != circular1 && actual.b == actual, basename);
start();
});
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('lodash build');
(function() {
var commands = [
'backbone',
'csp',
'legacy',
'mobile',
'strict',
'underscore',
'category=arrays',
'category=chaining',
'category=collections',
'category=functions',
'category=objects',
'category=utilities',
'exclude=union,uniq,zip',
'include=each,filter,map',
'include=once plus=bind,Chaining',
'category=collections,functions',
'underscore backbone',
'backbone legacy category=utilities minus=first,last',
'underscore include=debounce,throttle plus=after minus=throttle',
'underscore mobile strict category=functions exports=amd,global plus=pick,uniq',
]
.concat(
allMethods.map(function(methodName) {
return 'include=' + methodName;
})
);
commands.forEach(function(command) {
asyncTest('`lodash ' + command +'`', function() {
var start = _.after(2, _.once(QUnit.start));
build(['--silent'].concat(command.split(' ')), function(source, filePath) {
var methodNames,
basename = path.basename(filePath, '.js'),
context = createContext();
try {
vm.runInContext(source, context);
} catch(e) {
console.log(e);
}
// add method names explicitly
if (/include/.test(command)) {
methodNames = command.match(/include=(\S*)/)[1].split(/, */);
}
// add method names required by Backbone and Underscore builds
if (/backbone/.test(command) && !methodNames) {
methodNames = backboneDependencies.slice();
}
if (/underscore/.test(command) && !methodNames) {
methodNames = underscoreMethods.slice();
}
// add method names explicitly by category
if (/category/.test(command)) {
// resolve method names belonging to each category (case-insensitive)
methodNames = command.match(/category=(\S*)/)[1].split(/, */).reduce(function(result, category) {
var capitalized = category[0].toUpperCase() + category.toLowerCase().slice(1);
return result.concat(getMethodsByCategory(capitalized));
}, methodNames || []);
}
// init `methodNames` if it hasn't been inited
if (!methodNames) {
methodNames = allMethods.slice();
}
if (/plus/.test(command)) {
methodNames = methodNames.concat(command.match(/plus=(\S*)/)[1].split(/, */));
}
if (/minus/.test(command)) {
methodNames = _.without.apply(_, [methodNames]
.concat(expandMethodNames(command.match(/minus=(\S*)/)[1].split(/, */))));
}
if (/exclude/.test(command)) {
methodNames = _.without.apply(_, [methodNames]
.concat(expandMethodNames(command.match(/exclude=(\S*)/)[1].split(/, */))));
}
// expand aliases and categories to real method names
methodNames = expandMethodNames(methodNames).reduce(function(result, methodName) {
return result.concat(methodName, getMethodsByCategory(methodName));
}, []);
// remove nonexistent and duplicate method names
methodNames = _.uniq(_.intersection(allMethods, expandMethodNames(methodNames)));
var lodash = context._ || {};
methodNames.forEach(function(methodName) {
testMethod(lodash, methodName, basename);
});
start();
});
});
});
}());
}());

93
test/test-ui.js Normal file
View File

@@ -0,0 +1,93 @@
;(function(window) {
'use strict';
/** `QUnit.addEvent` shortcut */
var addEvent = QUnit.addEvent;
/** The Lo-Dash build to load */
var build = (/build=([^&]+)/.exec(location.search) || [])[1];
/** A flag to determine if RequireJS should be loaded */
var norequire = /[?&]norequire=true(?:&|$)/.test(location.search);
/*--------------------------------------------------------------------------*/
// assign `QUnit.config` properties
QUnit.config.lodashFilename = (function() {
switch (build) {
case 'prod': return 'lodash.min';
case 'custom': return 'lodash.custom.min';
case 'custom-debug': return 'lodash.custom';
}
return 'lodash';
}());
// assign `QUnit.urlParams` properties
QUnit.extend(QUnit.urlParams, {
'build': build,
'norequire': norequire
});
// initialize the build dropdown
addEvent(window, 'load', function() {
function eventHandler(event) {
var search = location.search.replace(/^\?|&?(?:build|norequire)=[^&]*&?/g, '');
if (event.stopPropagation) {
event.stopPropagation();
} else {
event.cancelBubble = true;
}
location.href =
location.href.split('?')[0] + '?' +
(search ? search + '&' : '') + 'build=' +
dropdown[dropdown.selectedIndex].value +
(checkbox.checked ? '&norequire=true' : '');
}
function init() {
var toolbar = document.getElementById('qunit-testrunner-toolbar');
if (toolbar) {
toolbar.appendChild(span1);
toolbar.appendChild(span2);
dropdown.selectedIndex = (function() {
switch (build) {
case 'prod': return 1;
case 'custom': return 2;
case 'custom-debug': return 3;
}
return 0;
}());
checkbox.checked = norequire;
addEvent(checkbox, 'click', eventHandler);
addEvent(dropdown, 'change', eventHandler);
}
else {
setTimeout(init, 15);
}
}
var span1 = document.createElement('span');
span1.innerHTML =
'<input id="qunit-norequire" type="checkbox">' +
'<label for="qunit-norequire">No RequireJS</label>';
var span2 = document.createElement('span');
span2.style.cssText = 'float:right';
span2.innerHTML =
'<label for="qunit-build">Build: </label>' +
'<select id="qunit-build">' +
'<option value="dev">Developement</option>' +
'<option value="prod">Production</option>' +
'<option value="custom">Custom</option>' +
'<option value="custom-debug">Custom (debug)</option>' +
'</select>';
var checkbox = span1.firstChild,
dropdown = span2.lastChild;
init();
});
}(this));

File diff suppressed because it is too large Load Diff

49
test/underscore.html Normal file
View File

@@ -0,0 +1,49 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Underscore Test Suite</title>
<link rel="stylesheet" href="../vendor/underscore/test/vendor/qunit.css">
<style>
#jslitmus, iframe {
display: none;
}
</style>
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture">
<div id="map-test">
<div id="id1"></div>
<div id="id2"></div>
</div>
</div>
<script src="../vendor/backbone/test/vendor/json2.js"></script>
<script src="../vendor/underscore/test/vendor/jquery.js"></script>
<script src="../vendor/underscore/test/vendor/jslitmus.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>
<script>
document.write('<script src="../' + QUnit.config.lodashFilename + '.js"><\/script>');
</script>
<script src="../vendor/underscore/test/collections.js"></script>
<script src="../vendor/underscore/test/arrays.js"></script>
<script src="../vendor/underscore/test/functions.js"></script>
<script src="../vendor/underscore/test/objects.js"></script>
<script src="../vendor/underscore/test/utility.js"></script>
<script src="../vendor/underscore/test/chaining.js"></script>
<script type="text/html" id="template">
<%
// a comment
if (data) { data += 12345; }; %>
<li><%= data %></li>
</script>
</body>
</html>

View File

@@ -1,44 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Underscore Test Suite</title>
<link rel="stylesheet" href="vendor/qunit.css" type="text/css" media="screen" />
<script type="text/javascript" src="vendor/jquery.js"></script>
<script type="text/javascript" src="vendor/qunit.js"></script>
<script type="text/javascript" src="vendor/jslitmus.js"></script>
<script type="text/javascript" src="../../lodash.js"></script>
<script type="text/javascript" src="collections.js"></script>
<script type="text/javascript" src="arrays.js"></script>
<script type="text/javascript" src="functions.js"></script>
<script type="text/javascript" src="objects.js"></script>
<script type="text/javascript" src="utility.js"></script>
<script type="text/javascript" src="chaining.js"></script>
<script type="text/javascript" src="speed.js"></script>
</head>
<body>
<div class="underscore-test">
<h1 id="qunit-header">Underscore Test Suite</h1>
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-banner"></h2>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<br />
<h1 class="qunit-header">Underscore Speed Suite</h1>
<p>
A representative sample of the functions are benchmarked here, to provide
a sense of how fast they might run in different browsers.
Each iteration runs on an array of 1000 elements.<br /><br />
For example, the 'intersect' test measures the number of times you can
find the intersection of two thousand-element arrays in one second.
</p>
<br />
<script type="text/html" id="template">
<%
// a comment
if (data) { data += 12345; }; %>
<li><%= data %></li>
</script>
</div>
</body>
</html>

View File

@@ -1,70 +0,0 @@
(function() {
var numbers = [];
for (var i=0; i<1000; i++) numbers.push(i);
var objects = _.map(numbers, function(n){ return {num : n}; });
var randomized = _.sortBy(numbers, function(){ return Math.random(); });
JSLitmus.test('_.each()', function() {
var timesTwo = [];
_.each(numbers, function(num){ timesTwo.push(num * 2); });
return timesTwo;
});
JSLitmus.test('_(list).each()', function() {
var timesTwo = [];
_(numbers).each(function(num){ timesTwo.push(num * 2); });
return timesTwo;
});
JSLitmus.test('jQuery.each()', function() {
var timesTwo = [];
jQuery.each(numbers, function(){ timesTwo.push(this * 2); });
return timesTwo;
});
JSLitmus.test('_.map()', function() {
return _.map(objects, function(obj){ return obj.num; });
});
JSLitmus.test('jQuery.map()', function() {
return jQuery.map(objects, function(obj){ return obj.num; });
});
JSLitmus.test('_.pluck()', function() {
return _.pluck(objects, 'num');
});
JSLitmus.test('_.uniq()', function() {
return _.uniq(randomized);
});
JSLitmus.test('_.uniq() (sorted)', function() {
return _.uniq(numbers, true);
});
JSLitmus.test('_.sortBy()', function() {
return _.sortBy(numbers, function(num){ return -num; });
});
JSLitmus.test('_.isEqual()', function() {
return _.isEqual(numbers, randomized);
});
JSLitmus.test('_.keys()', function() {
return _.keys(objects);
});
JSLitmus.test('_.values()', function() {
return _.values(objects);
});
JSLitmus.test('_.intersect()', function() {
return _.intersect(numbers, randomized);
});
JSLitmus.test('_.range()', function() {
return _.range(1000);
});
})();

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

22
vendor/backbone/LICENSE vendored Normal file
View File

@@ -0,0 +1,22 @@
Copyright (c) 2010-2012 Jeremy Ashkenas, DocumentCloud
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

26
vendor/backbone/README.md vendored Normal file
View File

@@ -0,0 +1,26 @@
____ __ __
/\ _`\ /\ \ /\ \ __
\ \ \ \ \ __ ___\ \ \/'\\ \ \____ ___ ___ __ /\_\ ____
\ \ _ <' /'__`\ /'___\ \ , < \ \ '__`\ / __`\ /' _ `\ /'__`\ \/\ \ /',__\
\ \ \ \ \/\ \ \.\_/\ \__/\ \ \\`\\ \ \ \ \/\ \ \ \/\ \/\ \/\ __/ __ \ \ \/\__, `\
\ \____/\ \__/.\_\ \____\\ \_\ \_\ \_,__/\ \____/\ \_\ \_\ \____\/\_\_\ \ \/\____/
\/___/ \/__/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/_/\/_/\/____/\/_/\ \_\ \/___/
\ \____/
\/___/
(_'_______________________________________________________________________________'_)
(_.———————————————————————————————————————————————————————————————————————————————._)
Backbone supplies structure to JavaScript-heavy applications by providing models key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing application over a RESTful JSON interface.
For Docs, License, Tests, pre-packed downloads, and everything else, really, see:
http://backbonejs.org
To suggest a feature, report a bug, or general discussion:
http://github.com/documentcloud/backbone/issues/
All contributors are listed here:
http://github.com/documentcloud/backbone/contributors
Special thanks to Robert Kieffer for the original philosophy behind Backbone.
http://github.com/broofa

1479
vendor/backbone/backbone.js vendored Normal file

File diff suppressed because it is too large Load Diff

704
vendor/backbone/test/collection.js vendored Normal file
View File

@@ -0,0 +1,704 @@
$(document).ready(function() {
var a, b, c, d, e, col, otherCol;
module("Backbone.Collection", _.extend(new Environment, {
setup: function() {
Environment.prototype.setup.apply(this, arguments);
a = new Backbone.Model({id: 3, label: 'a'});
b = new Backbone.Model({id: 2, label: 'b'});
c = new Backbone.Model({id: 1, label: 'c'});
d = new Backbone.Model({id: 0, label: 'd'});
e = null;
col = new Backbone.Collection([a,b,c,d]);
otherCol = new Backbone.Collection();
}
}));
test("new and sort", 7, function() {
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(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(col.first(), d, "d should be first");
equal(col.last(), a, "a should be last");
equal(col.length, 4);
});
test("String comparator.", 1, function() {
var collection = new Backbone.Collection([
{id: 3},
{id: 1},
{id: 2}
], {comparator: 'id'});
deepEqual(collection.pluck('id'), [1, 2, 3]);
});
test("new and parse", 3, function() {
var Collection = Backbone.Collection.extend({
parse : function(data) {
return _.filter(data, function(datum) {
return datum.a % 2 === 0;
});
}
});
var models = [{a: 1}, {a: 2}, {a: 3}, {a: 4}];
var collection = new Collection(models, {parse: true});
strictEqual(collection.length, 2);
strictEqual(collection.first().get('a'), 2);
strictEqual(collection.last().get('a'), 4);
});
test("get, getByCid", 3, function() {
equal(col.get(0), d);
equal(col.get(2), b);
equal(col.getByCid(col.first().cid), col.first());
});
test("get with non-default ids", 2, function() {
var col = new Backbone.Collection();
var MongoModel = Backbone.Model.extend({
idAttribute: '_id'
});
var model = new MongoModel({_id: 100});
col.push(model);
equal(col.get(100), model);
model.set({_id: 101});
equal(col.get(101), model);
});
test("update index when id changes", 3, function() {
var col = new Backbone.Collection();
col.add([
{id : 0, name : 'one'},
{id : 1, name : 'two'}
]);
var one = col.get(0);
equal(one.get('name'), 'one');
one.set({id : 101});
equal(col.get(0), null);
equal(col.get(101).get('name'), 'one');
});
test("at", 1, function() {
equal(col.at(2), c);
});
test("pluck", 1, function() {
equal(col.pluck('label').join(' '), 'a b c d');
});
test("add", 10, function() {
var added, opts, secondAdded;
added = opts = secondAdded = null;
e = new Backbone.Model({id: 10, label : 'e'});
otherCol.add(e);
otherCol.on('add', function() {
secondAdded = true;
});
col.on('add', function(model, collection, options){
added = model.get('label');
opts = options;
});
col.add(e, {amazing: true});
equal(added, 'e');
equal(col.length, 5);
equal(col.last(), e);
equal(otherCol.length, 1);
equal(secondAdded, null);
ok(opts.amazing);
var f = new Backbone.Model({id: 20, label : 'f'});
var g = new Backbone.Model({id: 21, label : 'g'});
var h = new Backbone.Model({id: 22, label : 'h'});
var atCol = new Backbone.Collection([f, g, h]);
equal(atCol.length, 3);
atCol.add(e, {at: 1});
equal(atCol.length, 4);
equal(atCol.at(1), e);
equal(atCol.last(), h);
});
test("add multiple models", 6, function() {
var col = new Backbone.Collection([{at: 0}, {at: 1}, {at: 9}]);
col.add([{at: 2}, {at: 3}, {at: 4}, {at: 5}, {at: 6}, {at: 7}, {at: 8}], {at: 2});
for (var i = 0; i <= 5; i++) {
equal(col.at(i).get('at'), i);
}
});
test("add; at should have preference over comparator", 1, function() {
var Col = Backbone.Collection.extend({
comparator: function(a,b) {
return a.id > b.id ? -1 : 1;
}
});
var col = new Col([{id: 2}, {id: 3}]);
col.add(new Backbone.Model({id: 1}), {at: 1});
equal(col.pluck('id').join(' '), '3 1 2');
});
test("can't add model to collection twice", function() {
var col = new Backbone.Collection([{id: 1}, {id: 2}, {id: 1}, {id: 2}, {id: 3}]);
equal(col.pluck('id').join(' '), '1 2 3');
});
test("can't add different model with same id to collection twice", 1, function() {
var col = new Backbone.Collection;
col.unshift({id: 101});
col.add({id: 101});
equal(col.length, 1);
});
test("merge in duplicate models with {merge: true}", 3, function() {
var col = new Backbone.Collection;
col.add([{id: 1, name: 'Moe'}, {id: 2, name: 'Curly'}, {id: 3, name: 'Larry'}]);
col.add({id: 1, name: 'Moses'});
equal(col.first().get('name'), 'Moe');
col.add({id: 1, name: 'Moses'}, {merge: true});
equal(col.first().get('name'), 'Moses');
col.add({id: 1, name: 'Tim'}, {merge: true, silent: true});
equal(col.first().get('name'), 'Tim');
});
test("add model to multiple collections", 10, function() {
var counter = 0;
var e = new Backbone.Model({id: 10, label : 'e'});
e.on('add', function(model, collection) {
counter++;
equal(e, model);
if (counter > 1) {
equal(collection, colF);
} else {
equal(collection, colE);
}
});
var colE = new Backbone.Collection([]);
colE.on('add', function(model, collection) {
equal(e, model);
equal(colE, collection);
});
var colF = new Backbone.Collection([]);
colF.on('add', function(model, collection) {
equal(e, model);
equal(colF, collection);
});
colE.add(e);
equal(e.collection, colE);
colF.add(e);
equal(e.collection, colE);
});
test("add model with parse", 1, function() {
var Model = Backbone.Model.extend({
parse: function(obj) {
obj.value += 1;
return obj;
}
});
var Col = Backbone.Collection.extend({model: Model});
var col = new Col;
col.add({value: 1}, {parse: true});
equal(col.at(0).get('value'), 2);
});
test("add model to collection with sort()-style comparator", 3, function() {
var col = new Backbone.Collection;
col.comparator = function(a, b) {
return a.get('name') < b.get('name') ? -1 : 1;
};
var tom = new Backbone.Model({name: 'Tom'});
var rob = new Backbone.Model({name: 'Rob'});
var tim = new Backbone.Model({name: 'Tim'});
col.add(tom);
col.add(rob);
col.add(tim);
equal(col.indexOf(rob), 0);
equal(col.indexOf(tim), 1);
equal(col.indexOf(tom), 2);
});
test("comparator that depends on `this`", 2, function() {
var col = new Backbone.Collection;
col.negative = function(num) {
return -num;
};
col.comparator = function(a) {
return this.negative(a.id);
};
col.add([{id: 1}, {id: 2}, {id: 3}]);
deepEqual(col.pluck('id'), [3, 2, 1]);
col.comparator = function(a, b) {
return this.negative(b.id) - this.negative(a.id);
};
col.sort();
deepEqual(col.pluck('id'), [1, 2, 3]);
});
test("remove", 5, function() {
var removed = null;
var otherRemoved = null;
col.on('remove', function(model, col, options) {
removed = model.get('label');
equal(options.index, 3);
});
otherCol.on('remove', function(model, col, options) {
otherRemoved = true;
});
col.remove(d);
equal(removed, 'd');
equal(col.length, 3);
equal(col.first(), a);
equal(otherRemoved, null);
});
test("shift and pop", 2, function() {
var col = new Backbone.Collection([{a: 'a'}, {b: 'b'}, {c: 'c'}]);
equal(col.shift().get('a'), 'a');
equal(col.pop().get('c'), 'c');
});
test("slice", 2, function() {
var col = new Backbone.Collection([{a: 'a'}, {b: 'b'}, {c: 'c'}]);
var array = col.slice(1, 3);
equal(array.length, 2);
equal(array[0].get('b'), 'b');
});
test("events are unbound on remove", 3, function() {
var counter = 0;
var dj = new Backbone.Model();
var emcees = new Backbone.Collection([dj]);
emcees.on('change', function(){ counter++; });
dj.set({name : 'Kool'});
equal(counter, 1);
emcees.reset([]);
equal(dj.collection, undefined);
dj.set({name : 'Shadow'});
equal(counter, 1);
});
test("remove in multiple collections", 7, function() {
var modelData = {
id : 5,
title : 'Othello'
};
var passed = false;
var e = new Backbone.Model(modelData);
var f = new Backbone.Model(modelData);
f.on('remove', function() {
passed = true;
});
var colE = new Backbone.Collection([e]);
var colF = new Backbone.Collection([f]);
ok(e != f);
ok(colE.length == 1);
ok(colF.length == 1);
colE.remove(e);
equal(passed, false);
ok(colE.length == 0);
colF.remove(e);
ok(colF.length == 0);
equal(passed, true);
});
test("remove same model in multiple collection", 16, function() {
var counter = 0;
var e = new Backbone.Model({id: 5, title: 'Othello'});
e.on('remove', function(model, collection) {
counter++;
equal(e, model);
if (counter > 1) {
equal(collection, colE);
} else {
equal(collection, colF);
}
});
var colE = new Backbone.Collection([e]);
colE.on('remove', function(model, collection) {
equal(e, model);
equal(colE, collection);
});
var colF = new Backbone.Collection([e]);
colF.on('remove', function(model, collection) {
equal(e, model);
equal(colF, collection);
});
equal(colE, e.collection);
colF.remove(e);
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);
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({}); };
var colE = new Backbone.Collection([e]);
var colF = new Backbone.Collection([e]);
e.destroy();
ok(colE.length == 0);
ok(colF.length == 0);
equal(undefined, e.collection);
});
test("Colllection: non-persisted model destroy removes from all collections", 3, function() {
var e = new Backbone.Model({title: 'Othello'});
e.sync = function(method, model, options) { throw "should not be called"; };
var colE = new Backbone.Collection([e]);
var colF = new Backbone.Collection([e]);
e.destroy();
ok(colE.length == 0);
ok(colF.length == 0);
equal(undefined, e.collection);
});
test("fetch", 4, function() {
var collection = new Backbone.Collection;
collection.url = '/test';
collection.fetch();
equal(this.syncArgs.method, 'read');
equal(this.syncArgs.model, collection);
equal(this.syncArgs.options.parse, true);
collection.fetch({parse: false});
equal(this.syncArgs.options.parse, false);
});
test("create", 4, function() {
var collection = new Backbone.Collection;
collection.url = '/test';
var model = collection.create({label: 'f'}, {wait: true});
equal(this.syncArgs.method, 'create');
equal(this.syncArgs.model, model);
equal(model.get('label'), 'f');
equal(model.collection, collection);
});
test("create enforces validation", 1, function() {
var ValidatingModel = Backbone.Model.extend({
validate: function(attrs) {
return "fail";
}
});
var ValidatingCollection = Backbone.Collection.extend({
model: ValidatingModel
});
var col = new ValidatingCollection();
equal(col.create({"foo":"bar"}), false);
});
test("a failing create runs the error callback", 1, function() {
var ValidatingModel = Backbone.Model.extend({
validate: function(attrs) {
return "fail";
}
});
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);
});
test("initialize", 1, function() {
var Collection = Backbone.Collection.extend({
initialize: function() {
this.one = 1;
}
});
var coll = new Collection;
equal(coll.one, 1);
});
test("toJSON", 1, 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() {
var coll = new Backbone.Collection([
{a: 1},
{a: 1},
{a: 1, b: 2},
{a: 2, b: 2},
{a: 3}
]);
equal(coll.where({a: 1}).length, 3);
equal(coll.where({a: 2}).length, 1);
equal(coll.where({a: 3}).length, 1);
equal(coll.where({b: 1}).length, 0);
equal(coll.where({b: 2}).length, 2);
equal(coll.where({a: 1, b: 2}).length, 1);
});
test("Underscore methods", 13, function() {
equal(col.map(function(model){ return model.get('label'); }).join(' '), 'a b c d');
equal(col.any(function(model){ return model.id === 100; }), false);
equal(col.any(function(model){ return model.id === 0; }), true);
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(!col.isEmpty());
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()
.filter(function(o){ return o.id % 2 === 0; })
.map(function(o){ return o.id * 2; })
.value(),
[4, 0]);
});
test("reset", 10, function() {
var resetCount = 0;
var models = col.models;
col.on('reset', function() { resetCount += 1; });
col.reset([]);
equal(resetCount, 1);
equal(col.length, 0);
equal(col.last(), null);
col.reset(models);
equal(resetCount, 2);
equal(col.length, 4);
equal(col.last(), d);
col.reset(_.map(models, function(m){ return m.attributes; }));
equal(resetCount, 3);
equal(col.length, 4);
ok(col.last() !== d);
ok(_.isEqual(col.last().attributes, d.attributes));
});
test("reset passes caller options", 3, function() {
var Model = Backbone.Model.extend({
initialize: function(attrs, options) {
this.model_parameter = options.model_parameter;
}
});
var col = new (Backbone.Collection.extend({ model: Model }))();
col.reset([{ astring: "green", anumber: 1 }, { astring: "blue", anumber: 2 }], { model_parameter: 'model parameter' });
equal(col.length, 2);
col.each(function(model) {
equal(model.model_parameter, 'model parameter');
});
});
test("trigger custom events on models", 1, function() {
var fired = null;
a.on("custom", function() { fired = true; });
a.trigger("custom");
equal(fired, true);
});
test("add does not alter arguments", 2, function(){
var attrs = {};
var models = [attrs];
new Backbone.Collection().add(models);
equal(models.length, 1);
ok(attrs === models[0]);
});
test("#714: access `model.collection` in a brand new model.", 2, function() {
var collection = new Backbone.Collection;
collection.url = '/test';
var Model = Backbone.Model.extend({
set: function(attrs) {
equal(attrs.prop, 'value');
equal(this.collection, collection);
return this;
}
});
collection.model = Model;
collection.create({prop: 'value'});
});
test("#574, remove its own reference to the .models array.", 2, function() {
var col = new Backbone.Collection([
{id: 1}, {id: 2}, {id: 3}, {id: 4}, {id: 5}, {id: 6}
]);
equal(col.length, 6);
col.remove(col.models);
equal(col.length, 0);
});
test("#861, adding models to a collection which do not pass validation", 1, function() {
raises(function() {
var Model = Backbone.Model.extend({
validate: function(attrs) {
if (attrs.id == 3) return "id can't be 3";
}
});
var Collection = Backbone.Collection.extend({
model: Model
});
var col = new Collection;
col.add([{id: 1}, {id: 2}, {id: 3}, {id: 4}, {id: 5}, {id: 6}]);
}, function(e) {
return e.message === "Can't add an invalid model to a collection";
});
});
test("throwing during add leaves consistent state", 4, function() {
var col = new Backbone.Collection();
col.on('test', function() { ok(false); });
col.model = Backbone.Model.extend({
validate: function(attrs){ if (!attrs.valid) return 'invalid'; }
});
var model = new col.model({id: 1, valid: true});
raises(function() { col.add([model, {id: 2}]); });
model.trigger('test');
ok(!col.getByCid(model.cid));
ok(!col.get(1));
equal(col.length, 0);
});
test("multiple copies of the same model", 3, function() {
var col = new Backbone.Collection();
var model = new Backbone.Model();
col.add([model, model]);
equal(col.length, 1);
col.add([{id: 1}, {id: 1}]);
equal(col.length, 2);
equal(col.last().id, 1);
});
test("#964 - collection.get return inconsistent", 2, function() {
var c = new Backbone.Collection();
ok(c.get(null) === undefined);
ok(c.get() === undefined);
});
test("#1112 - passing options.model sets collection.model", 2, function() {
var Model = Backbone.Model.extend({});
var c = new Backbone.Collection([{id: 1}], {model: Model});
ok(c.model === Model);
ok(c.at(0) instanceof Model);
});
test("null and undefined are invalid ids.", 2, function() {
var model = new Backbone.Model({id: 1});
var collection = new Backbone.Collection([model]);
model.set({id: null});
ok(!collection.get('null'));
model.set({id: 1});
model.set({id: undefined});
ok(!collection.get('undefined'));
});
test("falsy comparator", 4, function(){
var Col = Backbone.Collection.extend({
comparator: function(model){ return model.id; }
});
var col = new Col();
var colFalse = new Col(null, {comparator: false});
var colNull = new Col(null, {comparator: null});
var colUndefined = new Col(null, {comparator: undefined});
ok(col.comparator);
ok(!colFalse.comparator);
ok(!colNull.comparator);
ok(colUndefined.comparator);
});
test("#1355 - `options` is passed to success callbacks", 2, function(){
var m = new Backbone.Model({x:1});
var col = new Backbone.Collection();
var opts = {
success: function(collection, resp, options){
ok(options);
}
};
col.sync = m.sync = function( method, collection, options ){
options.success();
};
col.fetch(opts);
col.create(m, opts);
});
test("#1412 - Trigger 'sync' event.", 2, function() {
var collection = new Backbone.Collection;
collection.url = '/test';
collection.on('sync', function() { ok(true); });
Backbone.ajax = function(settings){ settings.success(); };
collection.fetch();
collection.create({id: 1});
});
test("#1447 - create with wait adds model.", 1, function() {
var collection = new Backbone.Collection;
var model = new Backbone.Model;
model.sync = function(method, model, options){ options.success(); };
collection.on('add', function(){ ok(true); });
collection.create(model, {wait: true});
});
test("#1448 - add sorts collection after merge.", 1, function() {
var collection = new Backbone.Collection([
{id: 1, x: 1},
{id: 2, x: 2}
]);
collection.comparator = function(model){ return model.get('x'); };
collection.add({id: 1, x: 3}, {merge: true});
deepEqual(collection.pluck('id'), [2, 1]);
});
test("#1655 - groupBy can be used with a string argument.", 3, function() {
var collection = new Backbone.Collection([{x: 1}, {x: 2}]);
var grouped = collection.groupBy('x');
strictEqual(_.keys(grouped).length, 2);
strictEqual(grouped[1][0].get('x'), 1);
strictEqual(grouped[2][0].get('x'), 2);
});
test("#1655 - sortBy can be used with a string argument.", 1, function() {
var collection = new Backbone.Collection([{x: 3}, {x: 1}, {x: 2}]);
var values = _.map(collection.sortBy('x'), function(model) {
return model.get('x');
});
deepEqual(values, [1, 2, 3]);
});
test("#1604 - Removal during iteration.", 0, function() {
var collection = new Backbone.Collection([{}, {}]);
collection.on('add', function() {
collection.at(0).destroy();
});
collection.add({}, {at: 0});
});
test("#1638 - `sort` during `add` triggers correctly.", function() {
var collection = new Backbone.Collection;
collection.comparator = function(model) { return model.get('x'); };
var added = [];
collection.on('add', function(model) {
model.set({x: 3});
collection.sort();
added.push(model.id);
});
collection.add([{id: 1, x: 1}, {id: 2, x: 2}]);
deepEqual(added, [1, 2]);
});
});

39
vendor/backbone/test/environment.js vendored Normal file
View File

@@ -0,0 +1,39 @@
(function() {
var Environment = this.Environment = function(){};
_.extend(Environment.prototype, {
ajax: Backbone.ajax,
sync: Backbone.sync,
setup: function() {
var env = this;
// Capture ajax settings for comparison.
Backbone.ajax = function(settings) {
env.ajaxSettings = settings;
};
// Capture the arguments to Backbone.sync for comparison.
Backbone.sync = function(method, model, options) {
env.syncArgs = {
method: method,
model: model,
options: options
};
env.sync.apply(this, arguments);
};
},
teardown: function() {
this.syncArgs = null;
this.ajaxSettings = null;
Backbone.sync = this.sync;
Backbone.ajax = this.ajax;
}
});
})();

195
vendor/backbone/test/events.js vendored Normal file
View File

@@ -0,0 +1,195 @@
$(document).ready(function() {
module("Backbone.Events");
test("on and trigger", 2, function() {
var obj = { counter: 0 };
_.extend(obj,Backbone.Events);
obj.on('event', function() { obj.counter += 1; });
obj.trigger('event');
equal(obj.counter,1,'counter should be incremented.');
obj.trigger('event');
obj.trigger('event');
obj.trigger('event');
obj.trigger('event');
equal(obj.counter, 5, 'counter should be incremented five times.');
});
test("binding and triggering multiple events", 4, function() {
var obj = { counter: 0 };
_.extend(obj,Backbone.Events);
obj.on('a b c', function() { obj.counter += 1; });
obj.trigger('a');
equal(obj.counter, 1);
obj.trigger('a b');
equal(obj.counter, 3);
obj.trigger('c');
equal(obj.counter, 4);
obj.off('a c');
obj.trigger('a b c');
equal(obj.counter, 5);
});
test("trigger all for each event", 3, function() {
var a, b, obj = { counter: 0 };
_.extend(obj, Backbone.Events);
obj.on('all', function(event) {
obj.counter++;
if (event == 'a') a = true;
if (event == 'b') b = true;
})
.trigger('a b');
ok(a);
ok(b);
equal(obj.counter, 2);
});
test("on, then unbind all functions", 1, function() {
var obj = { counter: 0 };
_.extend(obj,Backbone.Events);
var callback = function() { obj.counter += 1; };
obj.on('event', callback);
obj.trigger('event');
obj.off('event');
obj.trigger('event');
equal(obj.counter, 1, 'counter should have only been incremented once.');
});
test("bind two callbacks, unbind only one", 2, function() {
var obj = { counterA: 0, counterB: 0 };
_.extend(obj,Backbone.Events);
var callback = function() { obj.counterA += 1; };
obj.on('event', callback);
obj.on('event', function() { obj.counterB += 1; });
obj.trigger('event');
obj.off('event', callback);
obj.trigger('event');
equal(obj.counterA, 1, 'counterA should have only been incremented once.');
equal(obj.counterB, 2, 'counterB should have been incremented twice.');
});
test("unbind a callback in the midst of it firing", 1, function() {
var obj = {counter: 0};
_.extend(obj, Backbone.Events);
var callback = function() {
obj.counter += 1;
obj.off('event', callback);
};
obj.on('event', callback);
obj.trigger('event');
obj.trigger('event');
obj.trigger('event');
equal(obj.counter, 1, 'the callback should have been unbound.');
});
test("two binds that unbind themeselves", 2, function() {
var obj = { counterA: 0, counterB: 0 };
_.extend(obj,Backbone.Events);
var incrA = function(){ obj.counterA += 1; obj.off('event', incrA); };
var incrB = function(){ obj.counterB += 1; obj.off('event', incrB); };
obj.on('event', incrA);
obj.on('event', incrB);
obj.trigger('event');
obj.trigger('event');
obj.trigger('event');
equal(obj.counterA, 1, 'counterA should have only been incremented once.');
equal(obj.counterB, 1, 'counterB should have only been incremented once.');
});
test("bind a callback with a supplied context", 1, function () {
var TestClass = function () {
return this;
};
TestClass.prototype.assertTrue = function () {
ok(true, '`this` was bound to the callback');
};
var obj = _.extend({},Backbone.Events);
obj.on('event', function () { this.assertTrue(); }, (new TestClass));
obj.trigger('event');
});
test("nested trigger with unbind", 1, function () {
var obj = { counter: 0 };
_.extend(obj, Backbone.Events);
var incr1 = function(){ obj.counter += 1; obj.off('event', incr1); obj.trigger('event'); };
var incr2 = function(){ obj.counter += 1; };
obj.on('event', incr1);
obj.on('event', incr2);
obj.trigger('event');
equal(obj.counter, 3, 'counter should have been incremented three times');
});
test("callback list is not altered during trigger", 2, function () {
var counter = 0, obj = _.extend({}, Backbone.Events);
var incr = function(){ counter++; };
obj.on('event', function(){ obj.on('event', incr).on('all', incr); })
.trigger('event');
equal(counter, 0, 'bind does not alter callback list');
obj.off()
.on('event', function(){ obj.off('event', incr).off('all', incr); })
.on('event', incr)
.on('all', incr)
.trigger('event');
equal(counter, 2, 'unbind does not alter callback list');
});
test("#1282 - 'all' callback list is retrieved after each event.", 1, function() {
var counter = 0;
var obj = _.extend({}, Backbone.Events);
var incr = function(){ counter++; };
obj.on('x', function() {
obj.on('y', incr).on('all', incr);
})
.trigger('x y');
strictEqual(counter, 2);
});
test("if no callback is provided, `on` is a noop", 0, function() {
_.extend({}, Backbone.Events).on('test').trigger('test');
});
test("remove all events for a specific context", 4, function() {
var obj = _.extend({}, Backbone.Events);
obj.on('x y all', function() { ok(true); });
obj.on('x y all', function() { ok(false); }, obj);
obj.off(null, null, obj);
obj.trigger('x y');
});
test("remove all events for a specific callback", 4, function() {
var obj = _.extend({}, Backbone.Events);
var success = function() { ok(true); };
var fail = function() { ok(false); };
obj.on('x y all', success);
obj.on('x y all', fail);
obj.off(null, fail);
obj.trigger('x y');
});
test("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);
obj.on('event', function() { ok(false); }, obj);
obj.off(null, null, obj);
obj.trigger('event');
});
});

881
vendor/backbone/test/model.js vendored Normal file
View File

@@ -0,0 +1,881 @@
$(document).ready(function() {
var proxy = Backbone.Model.extend();
var klass = Backbone.Collection.extend({
url : function() { return '/collection'; }
});
var doc, collection;
module("Backbone.Model", _.extend(new Environment, {
setup: function() {
Environment.prototype.setup.apply(this, arguments);
doc = new proxy({
id : '1-the-tempest',
title : "The Tempest",
author : "Bill Shakespeare",
length : 123
});
collection = new klass();
collection.add(doc);
}
}));
test("initialize", 3, function() {
var Model = Backbone.Model.extend({
initialize: function() {
this.one = 1;
equal(this.collection, collection);
}
});
var model = new Model({}, {collection: collection});
equal(model.one, 1);
equal(model.collection, collection);
});
test("initialize with attributes and options", 1, function() {
var Model = Backbone.Model.extend({
initialize: function(attributes, options) {
this.one = options.one;
}
});
var model = new Model({}, {one: 1});
equal(model.one, 1);
});
test("initialize with parsed attributes", 1, function() {
var Model = Backbone.Model.extend({
parse: function(obj) {
obj.value += 1;
return obj;
}
});
var model = new Model({value: 1}, {parse: true});
equal(model.get('value'), 2);
});
test("url", 3, function() {
doc.urlRoot = null;
equal(doc.url(), '/collection/1-the-tempest');
doc.collection.url = '/collection/';
equal(doc.url(), '/collection/1-the-tempest');
doc.collection = null;
raises(function() { doc.url(); });
doc.collection = collection;
});
test("url when using urlRoot, and uri encoding", 2, function() {
var Model = Backbone.Model.extend({
urlRoot: '/collection'
});
var model = new Model();
equal(model.url(), '/collection');
model.set({id: '+1+'});
equal(model.url(), '/collection/%2B1%2B');
});
test("url when using urlRoot as a function to determine urlRoot at runtime", 2, function() {
var Model = Backbone.Model.extend({
urlRoot: function() {
return '/nested/' + this.get('parent_id') + '/collection';
}
});
var model = new Model({parent_id: 1});
equal(model.url(), '/nested/1/collection');
model.set({id: 2});
equal(model.url(), '/nested/1/collection/2');
});
test("clone", 8, function() {
var a = new Backbone.Model({ 'foo': 1, 'bar': 2, 'baz': 3});
var b = a.clone();
equal(a.get('foo'), 1);
equal(a.get('bar'), 2);
equal(a.get('baz'), 3);
equal(b.get('foo'), a.get('foo'), "Foo should be the same on the clone.");
equal(b.get('bar'), a.get('bar'), "Bar should be the same on the clone.");
equal(b.get('baz'), a.get('baz'), "Baz should be the same on the clone.");
a.set({foo : 100});
equal(a.get('foo'), 100);
equal(b.get('foo'), 1, "Changing a parent attribute does not change the clone.");
});
test("isNew", 6, function() {
var a = new Backbone.Model({ 'foo': 1, 'bar': 2, 'baz': 3});
ok(a.isNew(), "it should be new");
a = new Backbone.Model({ 'foo': 1, 'bar': 2, 'baz': 3, 'id': -5 });
ok(!a.isNew(), "any defined ID is legal, negative or positive");
a = new Backbone.Model({ 'foo': 1, 'bar': 2, 'baz': 3, 'id': 0 });
ok(!a.isNew(), "any defined ID is legal, including zero");
ok( new Backbone.Model({ }).isNew(), "is true when there is no id");
ok(!new Backbone.Model({ 'id': 2 }).isNew(), "is false for a positive integer");
ok(!new Backbone.Model({ 'id': -5 }).isNew(), "is false for a negative integer");
});
test("get", 2, function() {
equal(doc.get('title'), 'The Tempest');
equal(doc.get('author'), 'Bill Shakespeare');
});
test("escape", 5, function() {
equal(doc.escape('title'), 'The Tempest');
doc.set({audience: 'Bill & Bob'});
equal(doc.escape('audience'), 'Bill &amp; Bob');
doc.set({audience: 'Tim > Joan'});
equal(doc.escape('audience'), 'Tim &gt; Joan');
doc.set({audience: 10101});
equal(doc.escape('audience'), '10101');
doc.unset('audience');
equal(doc.escape('audience'), '');
});
test("has", 10, function() {
var model = new Backbone.Model();
strictEqual(model.has('name'), false);
model.set({
'0': 0,
'1': 1,
'true': true,
'false': false,
'empty': '',
'name': 'name',
'null': null,
'undefined': undefined
});
strictEqual(model.has('0'), true);
strictEqual(model.has('1'), true);
strictEqual(model.has('true'), true);
strictEqual(model.has('false'), true);
strictEqual(model.has('empty'), true);
strictEqual(model.has('name'), true);
model.unset('name');
strictEqual(model.has('name'), false);
strictEqual(model.has('null'), false);
strictEqual(model.has('undefined'), false);
});
test("set and unset", 8, function() {
var a = new Backbone.Model({id: 'id', foo: 1, bar: 2, baz: 3});
var changeCount = 0;
a.on("change:foo", function() { changeCount += 1; });
a.set({'foo': 2});
ok(a.get('foo') == 2, "Foo should have changed.");
ok(changeCount == 1, "Change count should have incremented.");
a.set({'foo': 2}); // set with value that is not new shouldn't fire change event
ok(a.get('foo') == 2, "Foo should NOT have changed, still 2");
ok(changeCount == 1, "Change count should NOT have incremented.");
a.validate = function(attrs) {
equal(attrs.foo, void 0, "don't ignore values when unsetting");
};
a.unset('foo');
equal(a.get('foo'), void 0, "Foo should have changed");
delete a.validate;
ok(changeCount == 2, "Change count should have incremented for unset.");
a.unset('id');
equal(a.id, undefined, "Unsetting the id should remove the id property.");
});
test("multiple unsets", 1, function() {
var i = 0;
var counter = function(){ i++; };
var model = new Backbone.Model({a: 1});
model.on("change:a", counter);
model.set({a: 2});
model.unset('a');
model.unset('a');
equal(i, 2, 'Unset does not fire an event for missing attributes.');
});
test("unset and changedAttributes", 2, 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.');
});
test("using a non-default id attribute.", 5, function() {
var MongoModel = Backbone.Model.extend({idAttribute : '_id'});
var model = new MongoModel({id: 'eye-dee', _id: 25, title: 'Model'});
equal(model.get('id'), 'eye-dee');
equal(model.id, 25);
equal(model.isNew(), false);
model.unset('_id');
equal(model.id, undefined);
equal(model.isNew(), true);
});
test("set an empty string", 1, function() {
var model = new Backbone.Model({name : "Model"});
model.set({name : ''});
equal(model.get('name'), '');
});
test("clear", 3, function() {
var changed;
var model = new Backbone.Model({id: 1, name : "Model"});
model.on("change:name", function(){ changed = true; });
model.on("change", function() {
var changedAttrs = model.changedAttributes();
ok('name' in changedAttrs);
});
model.clear();
equal(changed, true);
equal(model.get('name'), undefined);
});
test("defaults", 4, function() {
var Defaulted = Backbone.Model.extend({
defaults: {
"one": 1,
"two": 2
}
});
var model = new Defaulted({two: null});
equal(model.get('one'), 1);
equal(model.get('two'), null);
Defaulted = Backbone.Model.extend({
defaults: function() {
return {
"one": 3,
"two": 4
};
}
});
var model = new Defaulted({two: null});
equal(model.get('one'), 3);
equal(model.get('two'), null);
});
test("change, hasChanged, changedAttributes, previous, previousAttributes", 12, function() {
var model = new Backbone.Model({name : "Tim", age : 10});
equal(model.changedAttributes(), false);
model.on('change', function() {
ok(model.hasChanged('name'), 'name changed');
ok(!model.hasChanged('age'), 'age did not');
ok(_.isEqual(model.changedAttributes(), {name : 'Rob'}), 'changedAttributes returns the changed attrs');
equal(model.previous('name'), 'Tim');
ok(_.isEqual(model.previousAttributes(), {name : "Tim", age : 10}), 'previousAttributes is correct');
});
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();
equal(model.get('name'), 'Rob');
});
test("changedAttributes", 3, function() {
var model = new Backbone.Model({a: 'a', b: 'b'});
equal(model.changedAttributes(), false);
equal(model.changedAttributes({a: 'a'}), false);
equal(model.changedAttributes({a: 'b'}).a, 'b');
});
test("change with options", 2, function() {
var value;
var model = new Backbone.Model({name: 'Rob'});
model.on('change', function(model, options) {
value = options.prefix + model.get('name');
});
model.set({name: 'Bob'}, {silent: true});
model.change({prefix: 'Mr. '});
equal(value, 'Mr. Bob');
model.set({name: 'Sue'}, {prefix: 'Ms. '});
equal(value, 'Ms. Sue');
});
test("change after initialize", 1, function () {
var changed = 0;
var attrs = {id: 1, label: 'c'};
var obj = new Backbone.Model(attrs);
obj.on('change', function() { changed += 1; });
obj.set(attrs);
equal(changed, 0);
});
test("save within change event", 1, function () {
var env = this;
var model = new Backbone.Model({firstName : "Taylor", lastName: "Swift"});
model.url = '/test';
model.on('change', function () {
model.save();
ok(_.isEqual(env.syncArgs.model, model));
});
model.set({lastName: 'Hicks'});
});
test("validate after save", 1, function() {
var lastError, model = new Backbone.Model();
model.validate = function(attrs) {
if (attrs.admin) return "Can't change admin status.";
};
model.sync = function(method, model, options) {
options.success.call(this, {admin: true});
};
model.save(null, {error: function(model, error) {
lastError = error;
}});
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);
});
test("save", 2, function() {
doc.save({title : "Henry V"});
equal(this.syncArgs.method, 'update');
ok(_.isEqual(this.syncArgs.model, doc));
});
test("save in positional style", 1, function() {
var model = new Backbone.Model();
model.sync = function(method, model, options) {
options.success();
};
model.save('title', 'Twelfth Night');
equal(model.get('title'), 'Twelfth Night');
});
test("fetch", 2, function() {
doc.fetch();
equal(this.syncArgs.method, 'read');
ok(_.isEqual(this.syncArgs.model, doc));
});
test("destroy", 3, function() {
doc.destroy();
equal(this.syncArgs.method, 'delete');
ok(_.isEqual(this.syncArgs.model, doc));
var newModel = new Backbone.Model;
equal(newModel.destroy(), false);
});
test("non-persisted destroy", 1, function() {
var a = new Backbone.Model({ 'foo': 1, 'bar': 2, 'baz': 3});
a.sync = function() { throw "should not be called"; };
a.destroy();
ok(true, "non-persisted model should not call sync");
});
test("validate", 7, 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) {
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});
equal(model.get('admin'), true);
result = model.set({a: 200, admin: false});
equal(lastError, "Can't change admin status.");
equal(result, false);
equal(model.get('a'), 100);
});
test("validate on unset and clear", 6, function() {
var error;
var model = new Backbone.Model({name: "One"});
model.validate = function(attrs) {
if (!attrs.name) {
error = true;
return "No thanks.";
}
};
model.set({name: "Two"});
equal(model.get('name'), 'Two');
equal(error, undefined);
model.unset('name');
equal(error, true);
equal(model.get('name'), 'Two');
model.clear();
equal(model.get('name'), 'Two');
delete model.validate;
model.clear();
equal(model.get('name'), undefined);
});
test("validate with error callback", 8, function() {
var lastError, boundError;
var model = new Backbone.Model();
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) {
boundError = true;
});
var result = model.set({a: 100}, {error: callback});
equal(result, model);
equal(model.get('a'), 100);
equal(lastError, undefined);
equal(boundError, undefined);
result = model.set({a: 200, admin: true}, {error: callback});
equal(result, false);
equal(model.get('a'), 100);
equal(lastError, "Can't change admin status.");
equal(boundError, true);
});
test("defaults always extend attrs (#459)", 2, function() {
var Defaulted = Backbone.Model.extend({
defaults: {one: 1},
initialize : function(attrs, opts) {
equal(this.attributes.one, 1);
}
});
var providedattrs = new Defaulted({});
var emptyattrs = new Defaulted();
});
test("Inherit class properties", 6, function() {
var Parent = Backbone.Model.extend({
instancePropSame: function() {},
instancePropDiff: function() {}
}, {
classProp: function() {}
});
var Child = Parent.extend({
instancePropDiff: function() {}
});
var adult = new Parent;
var kid = new Child;
equal(Child.classProp, Parent.classProp);
notEqual(Child.classProp, undefined);
equal(kid.instancePropSame, adult.instancePropSame);
notEqual(kid.instancePropSame, undefined);
notEqual(Child.prototype.instancePropDiff, Parent.prototype.instancePropDiff);
notEqual(Child.prototype.instancePropDiff, undefined);
});
test("Nested change events don't clobber previous attributes", 4, function() {
new Backbone.Model()
.on('change:state', function(model, newState) {
equal(model.previous('state'), undefined);
equal(newState, 'hello');
// Fire a nested change event.
model.set({other: 'whatever'});
})
.on('change:state', function(model, newState) {
equal(model.previous('state'), undefined);
equal(newState, 'hello');
})
.set({state: 'hello'});
});
test("hasChanged/set should use same comparison", 2, function() {
var changed = 0, model = new Backbone.Model({a: null});
model.on('change', function() {
ok(this.hasChanged('a'));
})
.on('change:a', function() {
changed++;
})
.set({a: undefined});
equal(changed, 1);
});
test("#582, #425, change:attribute callbacks should fire after all changes have occurred", 9, function() {
var model = new Backbone.Model;
var assertion = function() {
equal(model.get('a'), 'a');
equal(model.get('b'), 'b');
equal(model.get('c'), 'c');
};
model.on('change:a', assertion);
model.on('change:b', assertion);
model.on('change:c', assertion);
model.set({a: 'a', b: 'b', c: 'c'});
});
test("#871, set with attributes property", 1, function() {
var model = new Backbone.Model();
model.set({attributes: true});
ok(model.has('attributes'));
});
test("set value regardless of equality/change", 1, function() {
var model = new Backbone.Model({x: []});
var a = [];
model.set({x: a});
ok(model.get('x') === a);
});
test("unset fires change for undefined attributes", 1, function() {
var model = new Backbone.Model({x: undefined});
model.on('change:x', function(){ ok(true); });
model.unset('x');
});
test("set: undefined values", 1, function() {
var model = new Backbone.Model({x: undefined});
ok('x' in model.attributes);
});
test("change fires change:attr", 1, 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.set({x: 2}, {silent: true});
ok(model.hasChanged());
model.set({x: 1}, {silent: true});
ok(!model.hasChanged());
});
test("save with `wait` succeeds without `validate`", 1, function() {
var model = new Backbone.Model();
model.url = '/test';
model.save({x: 1}, {wait: true});
ok(this.syncArgs.model === model);
});
test("`hasChanged` for falsey keys", 2, function() {
var model = new Backbone.Model();
model.set({x: true}, {silent: true});
ok(!model.hasChanged(0));
ok(!model.hasChanged(''));
});
test("`previous` for falsey keys", 2, function() {
var model = new Backbone.Model({0: true, '': true});
model.set({0: false, '': false}, {silent: true});
equal(model.previous(0), true);
equal(model.previous(''), true);
});
test("`save` with `wait` sends correct attributes", 5, function() {
var changed = 0;
var model = new Backbone.Model({x: 1, y: 2});
model.url = '/test';
model.on('change:x', function() { changed++; });
model.save({x: 3}, {wait: true});
deepEqual(JSON.parse(this.ajaxSettings.data), {x: 3, y: 2});
equal(model.get('x'), 1);
equal(changed, 0);
this.syncArgs.options.success({});
equal(model.get('x'), 3);
equal(changed, 1);
});
test("a failed `save` with `wait` doesn't leave attributes behind", 1, function() {
var model = new Backbone.Model;
model.url = '/test';
model.save({x: 1}, {wait: true});
equal(model.get('x'), void 0);
});
test("#1030 - `save` with `wait` results in correct attributes if success is called during sync", 2, function() {
var model = new Backbone.Model({x: 1, y: 2});
model.sync = function(method, model, options) {
options.success();
};
model.on("change:x", function() { ok(true); });
model.save({x: 3}, {wait: true});
equal(model.get('x'), 3);
});
test("save with wait validates attributes", 1, function() {
var model = new Backbone.Model();
model.url = '/test';
model.validate = function() { ok(true); };
model.save({x: 1}, {wait: true});
});
test("nested `set` during `'change:attr'`", 2, function() {
var events = [];
var model = new Backbone.Model();
model.on('all', function(event) { events.push(event); });
model.on('change', function() {
model.set({z: true}, {silent:true});
});
model.on('change:x', function() {
model.set({y: true});
});
model.set({x: true});
deepEqual(events, ['change:y', 'change:x', 'change']);
events = [];
model.change();
deepEqual(events, ['change:z', 'change']);
});
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});
});
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();
model.on('change', function() {
switch(count++) {
case 0:
deepEqual(this.changedAttributes(), {x: true});
equal(model.previous('x'), undefined);
model.set({y: true});
break;
case 1:
deepEqual(this.changedAttributes(), {y: true});
equal(model.previous('x'), true);
model.set({z: true});
break;
case 2:
deepEqual(this.changedAttributes(), {z: true});
equal(model.previous('y'), true);
break;
default:
ok(false);
}
});
model.set({x: true});
});
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', function() {
switch(count++) {
case 0:
deepEqual(this.changedAttributes(), {x: true});
model.set({y: true}, {silent: true});
break;
case 1:
deepEqual(this.changedAttributes(), {y: true, z: true});
break;
default:
ok(false);
}
});
model.set({x: true});
model.set({z: true});
});
test("nested `'change:attr'` with silent", 1, function() {
var model = new Backbone.Model();
model.on('change:y', function(){ ok(true); });
model.on('change', function() {
model.set({y: true}, {silent: true});
model.set({z: true});
});
model.set({x: true});
});
test("multiple nested changes with silent", 1, function() {
var model = new Backbone.Model();
model.on('change:x', function() {
model.set({y: 1}, {silent: true});
model.set({y: 2});
});
model.on('change:y', function(model, val) {
equal(val, 2);
});
model.set({x: true});
model.change();
});
test("multiple nested changes with silent", 2, 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("nested set multiple times", 1, function() {
var model = new Backbone.Model();
model.on('change:b', function() {
ok(true);
});
model.on('change:a', function() {
model.set({b: true});
model.set({b: true});
});
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 = {};
model.clear(options);
ok(!options.unset);
});
test("#1122 - unset does not alter options.", 1, function() {
var model = new Backbone.Model();
var options = {};
model.unset('x', options);
ok(!options.unset);
});
test("#1355 - `options` is passed to success callbacks", 3, function() {
var model = new Backbone.Model();
var opts = {
success: function( model, resp, options ) {
ok(options);
}
};
model.sync = function(method, model, options) {
options.success();
};
model.save({id: 1}, opts);
model.fetch(opts);
model.destroy(opts);
});
test("#1412 - Trigger 'sync' event.", 3, function() {
var model = new Backbone.Model({id: 1});
model.url = '/test';
model.on('sync', function(){ ok(true); });
Backbone.ajax = function(settings){ settings.success(); };
model.fetch();
model.save();
model.destroy();
});
test("#1365 - Destroy: New models execute success callback.", 2, function() {
new Backbone.Model()
.on('sync', function() { ok(false); })
.on('destroy', function(){ ok(true); })
.destroy({ success: function(){ ok(true); }});
});
test("#1433 - Save: An invalid model cannot be persisted.", 1, function() {
var model = new Backbone.Model;
model.validate = function(){ return 'invalid'; };
model.sync = function(){ ok(false); };
strictEqual(model.save(), false);
});
test("#1377 - Save without attrs triggers 'error'.", 1, function() {
var Model = Backbone.Model.extend({
url: '/test/',
sync: function(method, model, options){ options.success(); },
validate: function(){ return 'invalid'; }
});
var model = new Model({id: 1});
model.on('error', function(){ ok(true); });
model.save();
});
test("#1545 - `undefined` can be passed to a model constructor without coersion", function() {
var Model = Backbone.Model.extend({
defaults: { one: 1 },
initialize : function(attrs, opts) {
equal(attrs, undefined);
}
});
var emptyattrs = new Model();
var undefinedattrs = new Model(undefined);
});
asyncTest("#1478 - Model `save` does not trigger change on unchanged attributes", 0, function() {
var Model = Backbone.Model.extend({
sync: function(method, model, options) {
setTimeout(function(){
options.success();
start();
}, 0);
}
});
new Model({x: true})
.on('change:x', function(){ ok(false); })
.save(null, {wait: true});
});
test("#1664 - Changing from one value, silently to another, back to original does not trigger change.", 0, function() {
var model = new Backbone.Model({x:1});
model.on('change:x', function() { ok(false); });
model.set({x:2},{silent:true});
model.set({x:3},{silent:true});
model.set({x:1});
});
test("#1664 - multiple silent changes nested inside a change event", 2, function() {
var changes = [];
var model = new Backbone.Model();
model.on('change', 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']);
});
});

12
vendor/backbone/test/noconflict.js vendored Normal file
View File

@@ -0,0 +1,12 @@
$(document).ready(function() {
module("Backbone.noConflict");
test('noConflict', 2, function() {
var noconflictBackbone = Backbone.noConflict();
equal(window.Backbone, undefined, 'Returned window.Backbone');
window.Backbone = noconflictBackbone;
equal(window.Backbone, noconflictBackbone, 'Backbone is still pointing to the original Backbone');
});
});

484
vendor/backbone/test/router.js vendored Normal file
View File

@@ -0,0 +1,484 @@
$(document).ready(function() {
var router = null;
var location = null;
var lastRoute = null;
var lastArgs = [];
function onRoute(router, route, args) {
lastRoute = route;
lastArgs = args;
}
var Location = function(href) {
this.replace(href);
};
_.extend(Location.prototype, {
replace: function(href) {
_.extend(this, _.pick($('<a></a>', {href: href})[0],
'href',
'hash',
'host',
'search',
'fragment',
'pathname',
'protocol'
));
// In IE, anchor.pathname does not contain a leading slash though
// window.location.pathname does.
if (!/^\//.test(this.pathname)) this.pathname = '/' + this.pathname;
},
toString: function() {
return this.href;
}
});
module("Backbone.Router", {
setup: function() {
location = new Location('http://example.com');
Backbone.history = _.extend(new Backbone.History, {location: location});
router = new Router({testing: 101});
Backbone.history.interval = 9;
Backbone.history.start({pushState: false});
lastRoute = null;
lastArgs = [];
Backbone.history.on('route', onRoute);
},
teardown: function() {
Backbone.history.stop();
Backbone.history.off('route', onRoute);
}
});
var Router = Backbone.Router.extend({
count: 0,
routes: {
"noCallback": "noCallback",
"counter": "counter",
"search/:query": "search",
"search/:query/p:page": "search",
"contacts": "contacts",
"contacts/new": "newContact",
"contacts/:id": "loadContact",
"optional(/:item)": "optionalItem",
"splat/*args/end": "splat",
"*first/complex-:part/*rest": "complex",
":entity?*args": "query",
"*anything": "anything"
},
initialize : function(options) {
this.testing = options.testing;
this.route('implicit', 'implicit');
},
counter: function() {
this.count++;
},
implicit: function() {
this.count++;
},
search : function(query, page) {
this.query = query;
this.page = page;
},
contacts: function(){
this.contact = 'index';
},
newContact: function(){
this.contact = 'new';
},
loadContact: function(){
this.contact = 'load';
},
optionalItem: function(arg){
this.arg = arg !== undefined ? arg : null;
},
splat : function(args) {
this.args = args;
},
complex : function(first, part, rest) {
this.first = first;
this.part = part;
this.rest = rest;
},
query : function(entity, args) {
this.entity = entity;
this.queryArgs = args;
},
anything : function(whatever) {
this.anything = whatever;
}
});
test("initialize", 1, function() {
equal(router.testing, 101);
});
test("routes (simple)", 4, function() {
location.replace('http://example.com#search/news');
Backbone.history.checkUrl();
equal(router.query, 'news');
equal(router.page, undefined);
equal(lastRoute, 'search');
equal(lastArgs[0], 'news');
});
test("routes (two part)", 2, function() {
location.replace('http://example.com#search/nyc/p10');
Backbone.history.checkUrl();
equal(router.query, 'nyc');
equal(router.page, '10');
});
test("routes via navigate", 2, function() {
Backbone.history.navigate('search/manhattan/p20', {trigger: true});
equal(router.query, 'manhattan');
equal(router.page, '20');
});
test("routes via navigate for backwards-compatibility", 2, function() {
Backbone.history.navigate('search/manhattan/p20', true);
equal(router.query, 'manhattan');
equal(router.page, '20');
});
test("route precedence via navigate", 6, function(){
// check both 0.9.x and backwards-compatibility options
_.each([ { trigger: true }, true ], function( options ){
Backbone.history.navigate('contacts', options);
equal(router.contact, 'index');
Backbone.history.navigate('contacts/new', options);
equal(router.contact, 'new');
Backbone.history.navigate('contacts/foo', options);
equal(router.contact, 'load');
});
});
test("loadUrl is not called for identical routes.", 0, function() {
Backbone.history.loadUrl = function(){ ok(false); };
location.replace('http://example.com#route');
Backbone.history.navigate('route');
Backbone.history.navigate('/route');
Backbone.history.navigate('/route');
});
test("use implicit callback if none provided", 1, function() {
router.count = 0;
router.navigate('implicit', {trigger: true});
equal(router.count, 1);
});
test("routes via navigate with {replace: true}", 1, function() {
location.replace('http://example.com#start_here');
Backbone.history.checkUrl();
location.replace = function(href) {
strictEqual(href, new Location('http://example.com#end_here').href);
};
Backbone.history.navigate('end_here', {replace: true});
});
test("routes (splats)", 1, function() {
location.replace('http://example.com#splat/long-list/of/splatted_99args/end');
Backbone.history.checkUrl();
equal(router.args, 'long-list/of/splatted_99args');
});
test("routes (optional)", 2, function() {
location.replace('http://example.com#optional');
Backbone.history.checkUrl();
equal(router.arg, null);
location.replace('http://example.com#optional/thing');
Backbone.history.checkUrl();
equal(router.arg, 'thing');
});
test("routes (complex)", 3, function() {
location.replace('http://example.com#one/two/three/complex-part/four/five/six/seven');
Backbone.history.checkUrl();
equal(router.first, 'one/two/three');
equal(router.part, 'part');
equal(router.rest, 'four/five/six/seven');
});
test("routes (query)", 5, function() {
location.replace('http://example.com#mandel?a=b&c=d');
Backbone.history.checkUrl();
equal(router.entity, 'mandel');
equal(router.queryArgs, 'a=b&c=d');
equal(lastRoute, 'query');
equal(lastArgs[0], 'mandel');
equal(lastArgs[1], 'a=b&c=d');
});
test("routes (anything)", 1, function() {
location.replace('http://example.com#doesnt-match-a-route');
Backbone.history.checkUrl();
equal(router.anything, 'doesnt-match-a-route');
});
test("fires event when router doesn't have callback on it", 1, function() {
router.on("route:noCallback", function(){ ok(true); });
location.replace('http://example.com#noCallback');
Backbone.history.checkUrl();
});
test("#933, #908 - leading slash", 2, function() {
location.replace('http://example.com/root/foo');
Backbone.history.stop();
Backbone.history = _.extend(new Backbone.History, {location: location});
Backbone.history.start({root: '/root', hashChange: false, silent: true});
strictEqual(Backbone.history.getFragment(), 'foo');
Backbone.history.stop();
Backbone.history = _.extend(new Backbone.History, {location: location});
Backbone.history.start({root: '/root/', hashChange: false, silent: true});
strictEqual(Backbone.history.getFragment(), 'foo');
});
test("#1003 - History is started before navigate is called", 1, function() {
Backbone.history.stop();
Backbone.history.navigate = function(){ ok(Backbone.History.started); };
Backbone.history.start();
// If this is not an old IE navigate will not be called.
if (!Backbone.history.iframe) ok(true);
});
test("route callback gets passed decoded 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');
});
test("correctly handles URLs with % (#868)", 3, function() {
location.replace('http://example.com#search/fat%3A1.5%25');
Backbone.history.checkUrl();
location.replace('http://example.com#search/fat');
Backbone.history.checkUrl();
equal(router.query, 'fat');
equal(router.page, undefined);
equal(lastRoute, 'search');
});
test("#1185 - Use pathname when hashChange is not wanted.", 1, function() {
Backbone.history.stop();
location.replace('http://example.com/path/name#hash');
Backbone.history = _.extend(new Backbone.History, {location: location});
Backbone.history.start({hashChange: false});
var fragment = Backbone.history.getFragment();
strictEqual(fragment, location.pathname.replace(/^\//, ''));
});
test("#1206 - Strip leading slash before location.assign.", 1, function() {
Backbone.history.stop();
location.replace('http://example.com/root/');
Backbone.history = _.extend(new Backbone.History, {location: location});
Backbone.history.start({hashChange: false, root: '/root/'});
location.assign = function(pathname) {
strictEqual(pathname, '/root/fragment');
};
Backbone.history.navigate('/fragment');
});
test("#1387 - Root fragment without trailing slash.", 1, function() {
Backbone.history.stop();
location.replace('http://example.com/root');
Backbone.history = _.extend(new Backbone.History, {location: location});
Backbone.history.start({hashChange: false, root: '/root/', silent: true});
strictEqual(Backbone.history.getFragment(), '');
});
test("#1366 - History does not prepend root to fragment.", 2, function() {
Backbone.history.stop();
location.replace('http://example.com/root/');
Backbone.history = _.extend(new Backbone.History, {
location: location,
history: {
pushState: function(state, title, url) {
strictEqual(url, '/root/x');
}
}
});
Backbone.history.start({
root: '/root/',
pushState: true,
hashChange: false
});
Backbone.history.navigate('x');
strictEqual(Backbone.history.fragment, 'x');
});
test("Normalize root.", 1, function() {
Backbone.history.stop();
location.replace('http://example.com/root');
Backbone.history = _.extend(new Backbone.History, {
location: location,
history: {
pushState: function(state, title, url) {
strictEqual(url, '/root/fragment');
}
}
});
Backbone.history.start({
pushState: true,
root: '/root',
hashChange: false
});
Backbone.history.navigate('fragment');
});
test("Normalize root.", 1, function() {
Backbone.history.stop();
location.replace('http://example.com/root#fragment');
Backbone.history = _.extend(new Backbone.History, {
location: location,
history: {
pushState: function(state, title, url) {},
replaceState: function(state, title, url) {
strictEqual(url, '/root/fragment');
}
}
});
Backbone.history.start({
pushState: true,
root: '/root'
});
});
test("Normalize root.", 1, function() {
Backbone.history.stop();
location.replace('http://example.com/root');
Backbone.history = _.extend(new Backbone.History, {location: location});
Backbone.history.loadUrl = function() { ok(true); };
Backbone.history.start({
pushState: true,
root: '/root'
});
});
test("Normalize root - leading slash.", 1, function() {
Backbone.history.stop();
location.replace('http://example.com/root');
Backbone.history = _.extend(new Backbone.History, {
location: location,
history: {
pushState: function(){},
replaceState: function(){}
}
});
Backbone.history.start({root: 'root'});
strictEqual(Backbone.history.root, '/root/');
});
test("Transition from hashChange to pushState.", 1, function() {
Backbone.history.stop();
location.replace('http://example.com/root#x/y');
Backbone.history = _.extend(new Backbone.History, {
location: location,
history: {
pushState: function(){},
replaceState: function(state, title, url){
strictEqual(url, '/root/x/y');
}
}
});
Backbone.history.start({
root: 'root',
pushState: true
});
});
test("#1619: Router: Normalize empty root", 1, function() {
Backbone.history.stop();
location.replace('http://example.com/');
Backbone.history = _.extend(new Backbone.History, {
location: location,
history: {
pushState: function(){},
replaceState: function(){}
}
});
Backbone.history.start({root: ''});
strictEqual(Backbone.history.root, '/');
});
test("#1619: Router: nagivate with empty root", 1, function() {
Backbone.history.stop();
location.replace('http://example.com/');
Backbone.history = _.extend(new Backbone.History, {
location: location,
history: {
pushState: function(state, title, url) {
strictEqual(url, '/fragment');
}
}
});
Backbone.history.start({
pushState: true,
root: '',
hashChange: false
});
Backbone.history.navigate('fragment');
});
test("Transition from pushState to hashChange.", 1, function() {
Backbone.history.stop();
location.replace('http://example.com/root/x/y?a=b');
location.replace = function(url) {
strictEqual(url, '/root/?a=b#x/y');
};
Backbone.history = _.extend(new Backbone.History, {
location: location,
history: {
pushState: null,
replaceState: null
}
});
Backbone.history.start({
root: 'root',
pushState: true
});
});
test("#1695 - hashChange to pushState with search.", 1, function() {
Backbone.history.stop();
location.replace('http://example.com/root?a=b#x/y');
Backbone.history = _.extend(new Backbone.History, {
location: location,
history: {
pushState: function(){},
replaceState: function(state, title, url){
strictEqual(url, '/root/x/y?a=b');
}
}
});
Backbone.history.start({
root: 'root',
pushState: true
});
});
});

160
vendor/backbone/test/sync.js vendored Normal file
View File

@@ -0,0 +1,160 @@
$(document).ready(function() {
var Library = Backbone.Collection.extend({
url : function() { return '/library'; }
});
var library;
var attrs = {
title : "The Tempest",
author : "Bill Shakespeare",
length : 123
};
module("Backbone.sync", _.extend(new Environment, {
setup : function() {
Environment.prototype.setup.apply(this, arguments);
library = new Library;
library.create(attrs, {wait: false});
}
}));
test("read", 4, function() {
library.fetch();
equal(this.ajaxSettings.url, '/library');
equal(this.ajaxSettings.type, 'GET');
equal(this.ajaxSettings.dataType, 'json');
ok(_.isEmpty(this.ajaxSettings.data));
});
test("passing data", 3, function() {
library.fetch({data: {a: 'a', one: 1}});
equal(this.ajaxSettings.url, '/library');
equal(this.ajaxSettings.data.a, 'a');
equal(this.ajaxSettings.data.one, 1);
});
test("create", 6, function() {
equal(this.ajaxSettings.url, '/library');
equal(this.ajaxSettings.type, 'POST');
equal(this.ajaxSettings.dataType, 'json');
var data = JSON.parse(this.ajaxSettings.data);
equal(data.title, 'The Tempest');
equal(data.author, 'Bill Shakespeare');
equal(data.length, 123);
});
test("update", 7, function() {
library.first().save({id: '1-the-tempest', author: 'William Shakespeare'});
equal(this.ajaxSettings.url, '/library/1-the-tempest');
equal(this.ajaxSettings.type, 'PUT');
equal(this.ajaxSettings.dataType, 'json');
var data = JSON.parse(this.ajaxSettings.data);
equal(data.id, '1-the-tempest');
equal(data.title, 'The Tempest');
equal(data.author, 'William Shakespeare');
equal(data.length, 123);
});
test("update with emulateHTTP and emulateJSON", 7, function() {
Backbone.emulateHTTP = Backbone.emulateJSON = true;
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'});
equal(this.ajaxSettings.url, '/library/2-the-tempest');
equal(this.ajaxSettings.type, 'POST');
equal(this.ajaxSettings.dataType, 'json');
equal(this.ajaxSettings.data._method, 'PUT');
var data = JSON.parse(this.ajaxSettings.data.model);
equal(data.id, '2-the-tempest');
equal(data.author, 'Tim Shakespeare');
equal(data.length, 123);
Backbone.emulateHTTP = Backbone.emulateJSON = false;
});
test("update with just emulateHTTP", 6, function() {
Backbone.emulateHTTP = true;
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'});
equal(this.ajaxSettings.url, '/library/2-the-tempest');
equal(this.ajaxSettings.type, 'POST');
equal(this.ajaxSettings.contentType, 'application/json');
var data = JSON.parse(this.ajaxSettings.data);
equal(data.id, '2-the-tempest');
equal(data.author, 'Tim Shakespeare');
equal(data.length, 123);
Backbone.emulateHTTP = false;
});
test("update with just emulateJSON", 6, function() {
Backbone.emulateJSON = true;
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'});
equal(this.ajaxSettings.url, '/library/2-the-tempest');
equal(this.ajaxSettings.type, 'PUT');
equal(this.ajaxSettings.contentType, 'application/x-www-form-urlencoded');
var data = JSON.parse(this.ajaxSettings.data.model);
equal(data.id, '2-the-tempest');
equal(data.author, 'Tim Shakespeare');
equal(data.length, 123);
Backbone.emulateJSON = false;
});
test("read model", 3, function() {
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'});
library.first().fetch();
equal(this.ajaxSettings.url, '/library/2-the-tempest');
equal(this.ajaxSettings.type, 'GET');
ok(_.isEmpty(this.ajaxSettings.data));
});
test("destroy", 3, function() {
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'});
library.first().destroy({wait: true});
equal(this.ajaxSettings.url, '/library/2-the-tempest');
equal(this.ajaxSettings.type, 'DELETE');
equal(this.ajaxSettings.data, null);
});
test("destroy with emulateHTTP", 3, function() {
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'});
Backbone.emulateHTTP = Backbone.emulateJSON = true;
library.first().destroy();
equal(this.ajaxSettings.url, '/library/2-the-tempest');
equal(this.ajaxSettings.type, 'POST');
equal(JSON.stringify(this.ajaxSettings.data), '{"_method":"DELETE"}');
Backbone.emulateHTTP = Backbone.emulateJSON = false;
});
test("urlError", 2, function() {
var model = new Backbone.Model();
raises(function() {
model.fetch();
});
model.fetch({url: '/one/two'});
equal(this.ajaxSettings.url, '/one/two');
});
test("#1052 - `options` is optional.", 0, function() {
var model = new Backbone.Model();
model.url = '/test';
Backbone.sync('create', model);
});
test("Backbone.ajax", 1, function() {
Backbone.ajax = function(settings){
strictEqual(settings.url, '/test');
};
var model = new Backbone.Model();
model.url = '/test';
Backbone.sync('create', model);
});
test("Call provided error callback on error.", 1, function() {
var model = new Backbone.Model;
model.url = '/test';
Backbone.sync('read', model, {
error: function() { ok(true); }
});
this.ajaxSettings.error();
});
});

File diff suppressed because it is too large Load Diff

649
vendor/backbone/test/vendor/jslitmus.js vendored Normal file
View File

@@ -0,0 +1,649 @@
// JSLitmus.js
//
// Copyright (c) 2010, Robert Kieffer, http://broofa.com
// Available under MIT license (http://en.wikipedia.org/wiki/MIT_License)
(function() {
// Private methods and state
// Get platform info but don't go crazy trying to recognize everything
// that's out there. This is just for the major platforms and OSes.
var platform = 'unknown platform', ua = navigator.userAgent;
// Detect OS
var oses = ['Windows','iPhone OS','(Intel |PPC )?Mac OS X','Linux'].join('|');
var pOS = new RegExp('((' + oses + ') [^ \);]*)').test(ua) ? RegExp.$1 : null;
if (!pOS) pOS = new RegExp('((' + oses + ')[^ \);]*)').test(ua) ? RegExp.$1 : null;
// Detect browser
var pName = /(Chrome|MSIE|Safari|Opera|Firefox)/.test(ua) ? RegExp.$1 : null;
// Detect version
var vre = new RegExp('(Version|' + pName + ')[ \/]([^ ;]*)');
var pVersion = (pName && vre.test(ua)) ? RegExp.$2 : null;
var platform = (pOS && pName && pVersion) ? pName + ' ' + pVersion + ' on ' + pOS : 'unknown platform';
/**
* A smattering of methods that are needed to implement the JSLitmus testbed.
*/
var jsl = {
/**
* Enhanced version of escape()
*/
escape: function(s) {
s = s.replace(/,/g, '\\,');
s = escape(s);
s = s.replace(/\+/g, '%2b');
s = s.replace(/ /g, '+');
return s;
},
/**
* Get an element by ID.
*/
$: function(id) {
return document.getElementById(id);
},
/**
* Null function
*/
F: function() {},
/**
* Set the status shown in the UI
*/
status: function(msg) {
var el = jsl.$('jsl_status');
if (el) el.innerHTML = msg || '';
},
/**
* Convert a number to an abbreviated string like, "15K" or "10M"
*/
toLabel: function(n) {
if (n == Infinity) {
return 'Infinity';
} else if (n > 1e9) {
n = Math.round(n/1e8);
return n/10 + 'B';
} else if (n > 1e6) {
n = Math.round(n/1e5);
return n/10 + 'M';
} else if (n > 1e3) {
n = Math.round(n/1e2);
return n/10 + 'K';
}
return n;
},
/**
* Copy properties from src to dst
*/
extend: function(dst, src) {
for (var k in src) dst[k] = src[k]; return dst;
},
/**
* Like Array.join(), but for the key-value pairs in an object
*/
join: function(o, delimit1, delimit2) {
if (o.join) return o.join(delimit1); // If it's an array
var pairs = [];
for (var k in o) pairs.push(k + delimit1 + o[k]);
return pairs.join(delimit2);
},
/**
* Array#indexOf isn't supported in IE, so we use this as a cross-browser solution
*/
indexOf: function(arr, o) {
if (arr.indexOf) return arr.indexOf(o);
for (var i = 0; i < this.length; i++) if (arr[i] === o) return i;
return -1;
}
};
/**
* Test manages a single test (created with
* JSLitmus.test())
*
* @private
*/
var Test = function (name, f) {
if (!f) throw new Error('Undefined test function');
if (!/function[^\(]*\(([^,\)]*)/.test(f.toString())) {
throw new Error('"' + name + '" test: Test is not a valid Function object');
}
this.loopArg = RegExp.$1;
this.name = name;
this.f = f;
};
jsl.extend(Test, /** @lends Test */ {
/** Calibration tests for establishing iteration loop overhead */
CALIBRATIONS: [
new Test('calibrating loop', function(count) {while (count--);}),
new Test('calibrating function', jsl.F)
],
/**
* Run calibration tests. Returns true if calibrations are not yet
* complete (in which case calling code should run the tests yet again).
* onCalibrated - Callback to invoke when calibrations have finished
*/
calibrate: function(onCalibrated) {
for (var i = 0; i < Test.CALIBRATIONS.length; i++) {
var cal = Test.CALIBRATIONS[i];
if (cal.running) return true;
if (!cal.count) {
cal.isCalibration = true;
cal.onStop = onCalibrated;
//cal.MIN_TIME = .1; // Do calibrations quickly
cal.run(2e4);
return true;
}
}
return false;
}
});
jsl.extend(Test.prototype, {/** @lends Test.prototype */
/** Initial number of iterations */
INIT_COUNT: 10,
/** Max iterations allowed (i.e. used to detect bad looping functions) */
MAX_COUNT: 1e9,
/** Minimum time a test should take to get valid results (secs) */
MIN_TIME: .5,
/** Callback invoked when test state changes */
onChange: jsl.F,
/** Callback invoked when test is finished */
onStop: jsl.F,
/**
* Reset test state
*/
reset: function() {
delete this.count;
delete this.time;
delete this.running;
delete this.error;
},
/**
* Run the test (in a timeout). We use a timeout to make sure the browser
* has a chance to finish rendering any UI changes we've made, like
* updating the status message.
*/
run: function(count) {
count = count || this.INIT_COUNT;
jsl.status(this.name + ' x ' + count);
this.running = true;
var me = this;
setTimeout(function() {me._run(count);}, 200);
},
/**
* The nuts and bolts code that actually runs a test
*/
_run: function(count) {
var me = this;
// Make sure calibration tests have run
if (!me.isCalibration && Test.calibrate(function() {me.run(count);})) return;
this.error = null;
try {
var start, f = this.f, now, i = count;
// Start the timer
start = new Date();
// Now for the money shot. If this is a looping function ...
if (this.loopArg) {
// ... let it do the iteration itself
f(count);
} else {
// ... otherwise do the iteration for it
while (i--) f();
}
// Get time test took (in secs)
this.time = Math.max(1,new Date() - start)/1000;
// Store iteration count and per-operation time taken
this.count = count;
this.period = this.time/count;
// Do we need to do another run?
this.running = this.time <= this.MIN_TIME;
// ... if so, compute how many times we should iterate
if (this.running) {
// Bump the count to the nearest power of 2
var x = this.MIN_TIME/this.time;
var pow = Math.pow(2, Math.max(1, Math.ceil(Math.log(x)/Math.log(2))));
count *= pow;
if (count > this.MAX_COUNT) {
throw new Error('Max count exceeded. If this test uses a looping function, make sure the iteration loop is working properly.');
}
}
} catch (e) {
// Exceptions are caught and displayed in the test UI
this.reset();
this.error = e;
}
// Figure out what to do next
if (this.running) {
me.run(count);
} else {
jsl.status('');
me.onStop(me);
}
// Finish up
this.onChange(this);
},
/**
* Get the number of operations per second for this test.
*
* @param normalize if true, iteration loop overhead taken into account
*/
getHz: function(/**Boolean*/ normalize) {
var p = this.period;
// Adjust period based on the calibration test time
if (normalize && !this.isCalibration) {
var cal = Test.CALIBRATIONS[this.loopArg ? 0 : 1];
// If the period is within 20% of the calibration time, then zero the
// it out
p = p < cal.period*1.2 ? 0 : p - cal.period;
}
return Math.round(1/p);
},
/**
* Get a friendly string describing the test
*/
toString: function() {
return this.name + ' - ' + this.time/this.count + ' secs';
}
});
// CSS we need for the UI
var STYLESHEET = '<style> \
#jslitmus {font-family:sans-serif; font-size: 12px;} \
#jslitmus a {text-decoration: none;} \
#jslitmus a:hover {text-decoration: underline;} \
#jsl_status { \
margin-top: 10px; \
font-size: 10px; \
color: #888; \
} \
A IMG {border:none} \
#test_results { \
margin-top: 10px; \
font-size: 12px; \
font-family: sans-serif; \
border-collapse: collapse; \
border-spacing: 0px; \
} \
#test_results th, #test_results td { \
border: solid 1px #ccc; \
vertical-align: top; \
padding: 3px; \
} \
#test_results th { \
vertical-align: bottom; \
background-color: #ccc; \
padding: 1px; \
font-size: 10px; \
} \
#test_results #test_platform { \
color: #444; \
text-align:center; \
} \
#test_results .test_row { \
color: #006; \
cursor: pointer; \
} \
#test_results .test_nonlooping { \
border-left-style: dotted; \
border-left-width: 2px; \
} \
#test_results .test_looping { \
border-left-style: solid; \
border-left-width: 2px; \
} \
#test_results .test_name {white-space: nowrap;} \
#test_results .test_pending { \
} \
#test_results .test_running { \
font-style: italic; \
} \
#test_results .test_done {} \
#test_results .test_done { \
text-align: right; \
font-family: monospace; \
} \
#test_results .test_error {color: #600;} \
#test_results .test_error .error_head {font-weight:bold;} \
#test_results .test_error .error_body {font-size:85%;} \
#test_results .test_row:hover td { \
background-color: #ffc; \
text-decoration: underline; \
} \
#chart { \
margin: 10px 0px; \
width: 250px; \
} \
#chart img { \
border: solid 1px #ccc; \
margin-bottom: 5px; \
} \
#chart #tiny_url { \
height: 40px; \
width: 250px; \
} \
#jslitmus_credit { \
font-size: 10px; \
color: #888; \
margin-top: 8px; \
} \
</style>';
// HTML markup for the UI
var MARKUP = '<div id="jslitmus"> \
<button onclick="JSLitmus.runAll(event)">Run Tests</button> \
<button id="stop_button" disabled="disabled" onclick="JSLitmus.stop()">Stop Tests</button> \
<br \> \
<br \> \
<input type="checkbox" style="vertical-align: middle" id="test_normalize" checked="checked" onchange="JSLitmus.renderAll()""> Normalize results \
<table id="test_results"> \
<colgroup> \
<col /> \
<col width="100" /> \
</colgroup> \
<tr><th id="test_platform" colspan="2">' + platform + '</th></tr> \
<tr><th>Test</th><th>Ops/sec</th></tr> \
<tr id="test_row_template" class="test_row" style="display:none"> \
<td class="test_name"></td> \
<td class="test_result">Ready</td> \
</tr> \
</table> \
<div id="jsl_status"></div> \
<div id="chart" style="display:none"> \
<a id="chart_link" target="_blank"><img id="chart_image"></a> \
TinyURL (for chart): \
<iframe id="tiny_url" frameBorder="0" scrolling="no" src=""></iframe> \
</div> \
<a id="jslitmus_credit" title="JSLitmus home page" href="http://code.google.com/p/jslitmus" target="_blank">Powered by JSLitmus</a> \
</div>';
/**
* The public API for creating and running tests
*/
window.JSLitmus = {
/** The list of all tests that have been registered with JSLitmus.test */
_tests: [],
/** The queue of tests that need to be run */
_queue: [],
/**
* The parsed query parameters the current page URL. This is provided as a
* convenience for test functions - it's not used by JSLitmus proper
*/
params: {},
/**
* Initialize
*/
_init: function() {
// Parse query params into JSLitmus.params[] hash
var match = (location + '').match(/([^?#]*)(#.*)?$/);
if (match) {
var pairs = match[1].split('&');
for (var i = 0; i < pairs.length; i++) {
var pair = pairs[i].split('=');
if (pair.length > 1) {
var key = pair.shift();
var value = pair.length > 1 ? pair.join('=') : pair[0];
this.params[key] = value;
}
}
}
// Write out the stylesheet. We have to do this here because IE
// doesn't honor sheets written after the document has loaded.
document.write(STYLESHEET);
// Setup the rest of the UI once the document is loaded
if (window.addEventListener) {
window.addEventListener('load', this._setup, false);
} else if (document.addEventListener) {
document.addEventListener('load', this._setup, false);
} else if (window.attachEvent) {
window.attachEvent('onload', this._setup);
}
return this;
},
/**
* Set up the UI
*/
_setup: function() {
var el = jsl.$('jslitmus_container');
if (!el) document.body.appendChild(el = document.createElement('div'));
el.innerHTML = MARKUP;
// Render the UI for all our tests
for (var i=0; i < JSLitmus._tests.length; i++)
JSLitmus.renderTest(JSLitmus._tests[i]);
},
/**
* (Re)render all the test results
*/
renderAll: function() {
for (var i = 0; i < JSLitmus._tests.length; i++)
JSLitmus.renderTest(JSLitmus._tests[i]);
JSLitmus.renderChart();
},
/**
* (Re)render the chart graphics
*/
renderChart: function() {
var url = JSLitmus.chartUrl();
jsl.$('chart_link').href = url;
jsl.$('chart_image').src = url;
jsl.$('chart').style.display = '';
// Update the tiny URL
jsl.$('tiny_url').src = 'http://tinyurl.com/api-create.php?url='+escape(url);
},
/**
* (Re)render the results for a specific test
*/
renderTest: function(test) {
// Make a new row if needed
if (!test._row) {
var trow = jsl.$('test_row_template');
if (!trow) return;
test._row = trow.cloneNode(true);
test._row.style.display = '';
test._row.id = '';
test._row.onclick = function() {JSLitmus._queueTest(test);};
test._row.title = 'Run ' + test.name + ' test';
trow.parentNode.appendChild(test._row);
test._row.cells[0].innerHTML = test.name;
}
var cell = test._row.cells[1];
var cns = [test.loopArg ? 'test_looping' : 'test_nonlooping'];
if (test.error) {
cns.push('test_error');
cell.innerHTML =
'<div class="error_head">' + test.error + '</div>' +
'<ul class="error_body"><li>' +
jsl.join(test.error, ': ', '</li><li>') +
'</li></ul>';
} else {
if (test.running) {
cns.push('test_running');
cell.innerHTML = 'running';
} else if (jsl.indexOf(JSLitmus._queue, test) >= 0) {
cns.push('test_pending');
cell.innerHTML = 'pending';
} else if (test.count) {
cns.push('test_done');
var hz = test.getHz(jsl.$('test_normalize').checked);
cell.innerHTML = hz != Infinity ? hz : '&infin;';
cell.title = 'Looped ' + test.count + ' times in ' + test.time + ' seconds';
} else {
cell.innerHTML = 'ready';
}
}
cell.className = cns.join(' ');
},
/**
* Create a new test
*/
test: function(name, f) {
// Create the Test object
var test = new Test(name, f);
JSLitmus._tests.push(test);
// Re-render if the test state changes
test.onChange = JSLitmus.renderTest;
// Run the next test if this one finished
test.onStop = function(test) {
if (JSLitmus.onTestFinish) JSLitmus.onTestFinish(test);
JSLitmus.currentTest = null;
JSLitmus._nextTest();
};
// Render the new test
this.renderTest(test);
},
/**
* Add all tests to the run queue
*/
runAll: function(e) {
e = e || window.event;
var reverse = e && e.shiftKey, len = JSLitmus._tests.length;
for (var i = 0; i < len; i++) {
JSLitmus._queueTest(JSLitmus._tests[!reverse ? i : (len - i - 1)]);
}
},
/**
* Remove all tests from the run queue. The current test has to finish on
* it's own though
*/
stop: function() {
while (JSLitmus._queue.length) {
var test = JSLitmus._queue.shift();
JSLitmus.renderTest(test);
}
},
/**
* Run the next test in the run queue
*/
_nextTest: function() {
if (!JSLitmus.currentTest) {
var test = JSLitmus._queue.shift();
if (test) {
jsl.$('stop_button').disabled = false;
JSLitmus.currentTest = test;
test.run();
JSLitmus.renderTest(test);
if (JSLitmus.onTestStart) JSLitmus.onTestStart(test);
} else {
jsl.$('stop_button').disabled = true;
JSLitmus.renderChart();
}
}
},
/**
* Add a test to the run queue
*/
_queueTest: function(test) {
if (jsl.indexOf(JSLitmus._queue, test) >= 0) return;
JSLitmus._queue.push(test);
JSLitmus.renderTest(test);
JSLitmus._nextTest();
},
/**
* Generate a Google Chart URL that shows the data for all tests
*/
chartUrl: function() {
var n = JSLitmus._tests.length, markers = [], data = [];
var d, min = 0, max = -1e10;
var normalize = jsl.$('test_normalize').checked;
// Gather test data
for (var i=0; i < JSLitmus._tests.length; i++) {
var test = JSLitmus._tests[i];
if (test.count) {
var hz = test.getHz(normalize);
var v = hz != Infinity ? hz : 0;
data.push(v);
markers.push('t' + jsl.escape(test.name + '(' + jsl.toLabel(hz)+ ')') + ',000000,0,' +
markers.length + ',10');
max = Math.max(v, max);
}
}
if (markers.length <= 0) return null;
// Build chart title
var title = document.getElementsByTagName('title');
title = (title && title.length) ? title[0].innerHTML : null;
var chart_title = [];
if (title) chart_title.push(title);
chart_title.push('Ops/sec (' + platform + ')');
// Build labels
var labels = [jsl.toLabel(min), jsl.toLabel(max)];
var w = 250, bw = 15;
var bs = 5;
var h = markers.length*(bw + bs) + 30 + chart_title.length*20;
var params = {
chtt: escape(chart_title.join('|')),
chts: '000000,10',
cht: 'bhg', // chart type
chd: 't:' + data.join(','), // data set
chds: min + ',' + max, // max/min of data
chxt: 'x', // label axes
chxl: '0:|' + labels.join('|'), // labels
chsp: '0,1',
chm: markers.join('|'), // test names
chbh: [bw, 0, bs].join(','), // bar widths
// chf: 'bg,lg,0,eeeeee,0,eeeeee,.5,ffffff,1', // gradient
chs: w + 'x' + h
};
return 'http://chart.apis.google.com/chart?' + jsl.join(params, '=', '&');
}
};
JSLitmus._init();
})();

481
vendor/backbone/test/vendor/json2.js vendored Normal file
View File

@@ -0,0 +1,481 @@
/*
http://www.JSON.org/json2.js
2009-09-29
Public Domain.
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
See http://www.JSON.org/js.html
This code should be minified before deployment.
See http://javascript.crockford.com/jsmin.html
USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
NOT CONTROL.
This file creates a global JSON object containing two methods: stringify
and parse.
JSON.stringify(value, replacer, space)
value any JavaScript value, usually an object or array.
replacer an optional parameter that determines how object
values are stringified for objects. It can be a
function or an array of strings.
space an optional parameter that specifies the indentation
of nested structures. If it is omitted, the text will
be packed without extra whitespace. If it is a number,
it will specify the number of spaces to indent at each
level. If it is a string (such as '\t' or '&nbsp;'),
it contains the characters used to indent at each level.
This method produces a JSON text from a JavaScript value.
When an object value is found, if the object contains a toJSON
method, its toJSON method will be called and the result will be
stringified. A toJSON method does not serialize: it returns the
value represented by the name/value pair that should be serialized,
or undefined if nothing should be serialized. The toJSON method
will be passed the key associated with the value, and this will be
bound to the value
For example, this would serialize Dates as ISO strings.
Date.prototype.toJSON = function (key) {
function f(n) {
// Format integers to have at least two digits.
return n < 10 ? '0' + n : n;
}
return this.getUTCFullYear() + '-' +
f(this.getUTCMonth() + 1) + '-' +
f(this.getUTCDate()) + 'T' +
f(this.getUTCHours()) + ':' +
f(this.getUTCMinutes()) + ':' +
f(this.getUTCSeconds()) + 'Z';
};
You can provide an optional replacer method. It will be passed the
key and value of each member, with this bound to the containing
object. The value that is returned from your method will be
serialized. If your method returns undefined, then the member will
be excluded from the serialization.
If the replacer parameter is an array of strings, then it will be
used to select the members to be serialized. It filters the results
such that only members with keys listed in the replacer array are
stringified.
Values that do not have JSON representations, such as undefined or
functions, will not be serialized. Such values in objects will be
dropped; in arrays they will be replaced with null. You can use
a replacer function to replace those with JSON values.
JSON.stringify(undefined) returns undefined.
The optional space parameter produces a stringification of the
value that is filled with line breaks and indentation to make it
easier to read.
If the space parameter is a non-empty string, then that string will
be used for indentation. If the space parameter is a number, then
the indentation will be that many spaces.
Example:
text = JSON.stringify(['e', {pluribus: 'unum'}]);
// text is '["e",{"pluribus":"unum"}]'
text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
// text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
text = JSON.stringify([new Date()], function (key, value) {
return this[key] instanceof Date ?
'Date(' + this[key] + ')' : value;
});
// text is '["Date(---current time---)"]'
JSON.parse(text, reviver)
This method parses a JSON text to produce an object or array.
It can throw a SyntaxError exception.
The optional reviver parameter is a function that can filter and
transform the results. It receives each of the keys and values,
and its return value is used instead of the original value.
If it returns what it received, then the structure is not modified.
If it returns undefined then the member is deleted.
Example:
// Parse the text. Values that look like ISO date strings will
// be converted to Date objects.
myData = JSON.parse(text, function (key, value) {
var a;
if (typeof value === 'string') {
a =
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
if (a) {
return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
+a[5], +a[6]));
}
}
return value;
});
myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
var d;
if (typeof value === 'string' &&
value.slice(0, 5) === 'Date(' &&
value.slice(-1) === ')') {
d = new Date(value.slice(5, -1));
if (d) {
return d;
}
}
return value;
});
This is a reference implementation. You are free to copy, modify, or
redistribute.
*/
/*jslint evil: true, strict: false */
/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
lastIndex, length, parse, prototype, push, replace, slice, stringify,
test, toJSON, toString, valueOf
*/
// Create a JSON object only if one does not already exist. We create the
// methods in a closure to avoid creating global variables.
if (!this.JSON) {
this.JSON = {};
}
(function () {
function f(n) {
// Format integers to have at least two digits.
return n < 10 ? '0' + n : n;
}
if (typeof Date.prototype.toJSON !== 'function') {
Date.prototype.toJSON = function (key) {
return isFinite(this.valueOf()) ?
this.getUTCFullYear() + '-' +
f(this.getUTCMonth() + 1) + '-' +
f(this.getUTCDate()) + 'T' +
f(this.getUTCHours()) + ':' +
f(this.getUTCMinutes()) + ':' +
f(this.getUTCSeconds()) + 'Z' : null;
};
String.prototype.toJSON =
Number.prototype.toJSON =
Boolean.prototype.toJSON = function (key) {
return this.valueOf();
};
}
var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
gap,
indent,
meta = { // table of character substitutions
'\b': '\\b',
'\t': '\\t',
'\n': '\\n',
'\f': '\\f',
'\r': '\\r',
'"' : '\\"',
'\\': '\\\\'
},
rep;
function quote(string) {
// If the string contains no control characters, no quote characters, and no
// backslash characters, then we can safely slap some quotes around it.
// Otherwise we must also replace the offending characters with safe escape
// sequences.
escapable.lastIndex = 0;
return escapable.test(string) ?
'"' + string.replace(escapable, function (a) {
var c = meta[a];
return typeof c === 'string' ? c :
'\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
}) + '"' :
'"' + string + '"';
}
function str(key, holder) {
// Produce a string from holder[key].
var i, // The loop counter.
k, // The member key.
v, // The member value.
length,
mind = gap,
partial,
value = holder[key];
// If the value has a toJSON method, call it to obtain a replacement value.
if (value && typeof value === 'object' &&
typeof value.toJSON === 'function') {
value = value.toJSON(key);
}
// If we were called with a replacer function, then call the replacer to
// obtain a replacement value.
if (typeof rep === 'function') {
value = rep.call(holder, key, value);
}
// What happens next depends on the value's type.
switch (typeof value) {
case 'string':
return quote(value);
case 'number':
// JSON numbers must be finite. Encode non-finite numbers as null.
return isFinite(value) ? String(value) : 'null';
case 'boolean':
case 'null':
// If the value is a boolean or null, convert it to a string. Note:
// typeof null does not produce 'null'. The case is included here in
// the remote chance that this gets fixed someday.
return String(value);
// If the type is 'object', we might be dealing with an object or an array or
// null.
case 'object':
// Due to a specification blunder in ECMAScript, typeof null is 'object',
// so watch out for that case.
if (!value) {
return 'null';
}
// Make an array to hold the partial results of stringifying this object value.
gap += indent;
partial = [];
// Is the value an array?
if (Object.prototype.toString.apply(value) === '[object Array]') {
// The value is an array. Stringify every element. Use null as a placeholder
// for non-JSON values.
length = value.length;
for (i = 0; i < length; i += 1) {
partial[i] = str(i, value) || 'null';
}
// Join all of the elements together, separated with commas, and wrap them in
// brackets.
v = partial.length === 0 ? '[]' :
gap ? '[\n' + gap +
partial.join(',\n' + gap) + '\n' +
mind + ']' :
'[' + partial.join(',') + ']';
gap = mind;
return v;
}
// If the replacer is an array, use it to select the members to be stringified.
if (rep && typeof rep === 'object') {
length = rep.length;
for (i = 0; i < length; i += 1) {
k = rep[i];
if (typeof k === 'string') {
v = str(k, value);
if (v) {
partial.push(quote(k) + (gap ? ': ' : ':') + v);
}
}
}
} else {
// Otherwise, iterate through all of the keys in the object.
for (k in value) {
if (Object.hasOwnProperty.call(value, k)) {
v = str(k, value);
if (v) {
partial.push(quote(k) + (gap ? ': ' : ':') + v);
}
}
}
}
// Join all of the member texts together, separated with commas,
// and wrap them in braces.
v = partial.length === 0 ? '{}' :
gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' +
mind + '}' : '{' + partial.join(',') + '}';
gap = mind;
return v;
}
}
// If the JSON object does not yet have a stringify method, give it one.
if (typeof JSON.stringify !== 'function') {
JSON.stringify = function (value, replacer, space) {
// The stringify method takes a value and an optional replacer, and an optional
// space parameter, and returns a JSON text. The replacer can be a function
// that can replace values, or an array of strings that will select the keys.
// A default replacer method can be provided. Use of the space parameter can
// produce text that is more easily readable.
var i;
gap = '';
indent = '';
// If the space parameter is a number, make an indent string containing that
// many spaces.
if (typeof space === 'number') {
for (i = 0; i < space; i += 1) {
indent += ' ';
}
// If the space parameter is a string, it will be used as the indent string.
} else if (typeof space === 'string') {
indent = space;
}
// If there is a replacer, it must be a function or an array.
// Otherwise, throw an error.
rep = replacer;
if (replacer && typeof replacer !== 'function' &&
(typeof replacer !== 'object' ||
typeof replacer.length !== 'number')) {
throw new Error('JSON.stringify');
}
// Make a fake root object containing our value under the key of ''.
// Return the result of stringifying the value.
return str('', {'': value});
};
}
// If the JSON object does not yet have a parse method, give it one.
if (typeof JSON.parse !== 'function') {
JSON.parse = function (text, reviver) {
// The parse method takes a text and an optional reviver function, and returns
// a JavaScript value if the text is a valid JSON text.
var j;
function walk(holder, key) {
// The walk method is used to recursively walk the resulting structure so
// that modifications can be made.
var k, v, value = holder[key];
if (value && typeof value === 'object') {
for (k in value) {
if (Object.hasOwnProperty.call(value, k)) {
v = walk(value, k);
if (v !== undefined) {
value[k] = v;
} else {
delete value[k];
}
}
}
}
return reviver.call(holder, key, value);
}
// Parsing happens in four stages. In the first stage, we replace certain
// Unicode characters with escape sequences. JavaScript handles many characters
// incorrectly, either silently deleting them, or treating them as line endings.
cx.lastIndex = 0;
if (cx.test(text)) {
text = text.replace(cx, function (a) {
return '\\u' +
('0000' + a.charCodeAt(0).toString(16)).slice(-4);
});
}
// In the second stage, we run the text against regular expressions that look
// for non-JSON patterns. We are especially concerned with '()' and 'new'
// because they can cause invocation, and '=' because it can cause mutation.
// But just to be safe, we want to reject all unexpected forms.
// We split the second stage into 4 regexp operations in order to work around
// crippling inefficiencies in IE's and Safari's regexp engines. First we
// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
// replace all simple value tokens with ']' characters. Third, we delete all
// open brackets that follow a colon or comma or that begin the text. Finally,
// we look to see that the remaining characters are only whitespace or ']' or
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
if (/^[\],:{}\s]*$/.
test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@').
replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
// In the third stage we use the eval function to compile the text into a
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
// in JavaScript: it can begin a block or an object literal. We wrap the text
// in parens to eliminate the ambiguity.
j = eval('(' + text + ')');
// In the optional fourth stage, we recursively walk the new structure, passing
// each name/value pair to a reviver function for possible transformation.
return typeof reviver === 'function' ?
walk({'': j}, '') : j;
}
// If the text is not JSON parseable, then a SyntaxError is thrown.
throw new SyntaxError('JSON.parse');
};
}
}());

235
vendor/backbone/test/vendor/qunit.css vendored Executable file
View File

@@ -0,0 +1,235 @@
/**
* QUnit v1.10.0 - A JavaScript Unit Testing Framework
*
* http://qunitjs.com
*
* Copyright 2012 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*/
/** Font Family and Sizes */
#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult {
font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
}
#qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; }
#qunit-tests { font-size: smaller; }
/** Resets */
#qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter {
margin: 0;
padding: 0;
}
/** Header */
#qunit-header {
padding: 0.5em 0 0.5em 1em;
color: #8699a4;
background-color: #0d3349;
font-size: 1.5em;
line-height: 1em;
font-weight: normal;
border-radius: 5px 5px 0 0;
-moz-border-radius: 5px 5px 0 0;
-webkit-border-top-right-radius: 5px;
-webkit-border-top-left-radius: 5px;
}
#qunit-header a {
text-decoration: none;
color: #c2ccd1;
}
#qunit-header a:hover,
#qunit-header a:focus {
color: #fff;
}
#qunit-testrunner-toolbar label {
display: inline-block;
padding: 0 .5em 0 .1em;
}
#qunit-banner {
height: 5px;
}
#qunit-testrunner-toolbar {
padding: 0.5em 0 0.5em 2em;
color: #5E740B;
background-color: #eee;
overflow: hidden;
}
#qunit-userAgent {
padding: 0.5em 0 0.5em 2.5em;
background-color: #2b81af;
color: #fff;
text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
}
#qunit-modulefilter-container {
float: right;
}
/** Tests: Pass/Fail */
#qunit-tests {
list-style-position: inside;
}
#qunit-tests li {
padding: 0.4em 0.5em 0.4em 2.5em;
border-bottom: 1px solid #fff;
list-style-position: inside;
}
#qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running {
display: none;
}
#qunit-tests li strong {
cursor: pointer;
}
#qunit-tests li a {
padding: 0.5em;
color: #c2ccd1;
text-decoration: none;
}
#qunit-tests li a:hover,
#qunit-tests li a:focus {
color: #000;
}
#qunit-tests ol {
margin-top: 0.5em;
padding: 0.5em;
background-color: #fff;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
#qunit-tests table {
border-collapse: collapse;
margin-top: .2em;
}
#qunit-tests th {
text-align: right;
vertical-align: top;
padding: 0 .5em 0 0;
}
#qunit-tests td {
vertical-align: top;
}
#qunit-tests pre {
margin: 0;
white-space: pre-wrap;
word-wrap: break-word;
}
#qunit-tests del {
background-color: #e0f2be;
color: #374e0c;
text-decoration: none;
}
#qunit-tests ins {
background-color: #ffcaca;
color: #500;
text-decoration: none;
}
/*** Test Counts */
#qunit-tests b.counts { color: black; }
#qunit-tests b.passed { color: #5E740B; }
#qunit-tests b.failed { color: #710909; }
#qunit-tests li li {
padding: 5px;
background-color: #fff;
border-bottom: none;
list-style-position: inside;
}
/*** Passing Styles */
#qunit-tests li li.pass {
color: #3c510c;
background-color: #fff;
border-left: 10px solid #C6E746;
}
#qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; }
#qunit-tests .pass .test-name { color: #366097; }
#qunit-tests .pass .test-actual,
#qunit-tests .pass .test-expected { color: #999999; }
#qunit-banner.qunit-pass { background-color: #C6E746; }
/*** Failing Styles */
#qunit-tests li li.fail {
color: #710909;
background-color: #fff;
border-left: 10px solid #EE5757;
white-space: pre;
}
#qunit-tests > li:last-child {
border-radius: 0 0 5px 5px;
-moz-border-radius: 0 0 5px 5px;
-webkit-border-bottom-right-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
}
#qunit-tests .fail { color: #000000; background-color: #EE5757; }
#qunit-tests .fail .test-name,
#qunit-tests .fail .module-name { color: #000000; }
#qunit-tests .fail .test-actual { color: #EE5757; }
#qunit-tests .fail .test-expected { color: green; }
#qunit-banner.qunit-fail { background-color: #EE5757; }
/** Result */
#qunit-testresult {
padding: 0.5em 0.5em 0.5em 2.5em;
color: #2b81af;
background-color: #D2E0E6;
border-bottom: 1px solid white;
}
#qunit-testresult .module-name {
font-weight: bold;
}
/** Fixture */
#qunit-fixture {
position: absolute;
top: -10000px;
left: -10000px;
width: 1000px;
height: 1000px;
}

1977
vendor/backbone/test/vendor/qunit.js vendored Executable file

File diff suppressed because it is too large Load Diff

331
vendor/backbone/test/view.js vendored Normal file
View File

@@ -0,0 +1,331 @@
$(document).ready(function() {
var view;
module("Backbone.View", {
setup: function() {
view = new Backbone.View({
id : 'test-view',
className : 'test-view'
});
}
});
test("constructor", 4, function() {
equal(view.el.id, 'test-view');
equal(view.el.className, 'test-view');
equal(view.options.id, 'test-view');
equal(view.options.className, 'test-view');
});
test("jQuery", 1, function() {
var view = new Backbone.View;
view.setElement('<p><a><b>test</b></a></p>');
strictEqual(view.$('a b').html(), 'test');
});
test("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() {
this.one = 1;
}
});
strictEqual(new View().one, 1);
});
test("delegateEvents", 6, function() {
var counter1 = 0, counter2 = 0;
var view = new Backbone.View({el: '<p><a id="test"></a></p>'});
view.increment = function(){ counter1++; };
view.$el.on('click', function(){ counter2++; });
var events = {'click #test': 'increment'};
view.delegateEvents(events);
view.$('#test').trigger('click');
equal(counter1, 1);
equal(counter2, 1);
view.$('#test').trigger('click');
equal(counter1, 2);
equal(counter2, 2);
view.delegateEvents(events);
view.$('#test').trigger('click');
equal(counter1, 3);
equal(counter2, 3);
});
test("delegateEvents allows functions for callbacks", 3, function() {
var view = new Backbone.View({el: '<p></p>'});
view.counter = 0;
var events = {
click: function() {
this.counter++;
}
};
view.delegateEvents(events);
view.$el.trigger('click');
equal(view.counter, 1);
view.$el.trigger('click');
equal(view.counter, 2);
view.delegateEvents(events);
view.$el.trigger('click');
equal(view.counter, 3);
});
test("undelegateEvents", 6, function() {
var counter1 = 0, counter2 = 0;
var view = new Backbone.View({el: '<p><a id="test"></a></p>'});
view.increment = function(){ counter1++; };
view.$el.on('click', function(){ counter2++; });
var events = {'click #test': 'increment'};
view.delegateEvents(events);
view.$('#test').trigger('click');
equal(counter1, 1);
equal(counter2, 1);
view.undelegateEvents();
view.$('#test').trigger('click');
equal(counter1, 1);
equal(counter2, 2);
view.delegateEvents(events);
view.$('#test').trigger('click');
equal(counter1, 2);
equal(counter2, 3);
});
test("_ensureElement with DOM node el", 1, function() {
var View = Backbone.View.extend({
el: document.body
});
equal(new View().el, document.body);
});
test("_ensureElement with string el", 3, function() {
var View = Backbone.View.extend({
el: "body"
});
strictEqual(new View().el, document.body);
View = Backbone.View.extend({
el: "#testElement > h1"
});
strictEqual(new View().el, $("#testElement > h1").get(0));
View = Backbone.View.extend({
el: "#nonexistent"
});
ok(!new View().el);
});
test("with className and id functions", 2, function() {
var View = Backbone.View.extend({
className: function() {
return 'className';
},
id: function() {
return 'id';
}
});
strictEqual(new View().el.className, 'className');
strictEqual(new View().el.id, 'id');
});
test("with attributes", 2, function() {
var View = Backbone.View.extend({
attributes: {
id: 'id',
'class': 'class'
}
});
strictEqual(new View().el.className, 'class');
strictEqual(new View().el.id, 'id');
});
test("with attributes as a function", 1, function() {
var View = Backbone.View.extend({
attributes: function() {
return {'class': 'dynamic'};
}
});
strictEqual(new View().el.className, 'dynamic');
});
test("multiple views per element", 3, function() {
var count = 0;
var $el = $('<p></p>');
var View = Backbone.View.extend({
el: $el,
events: {
click: function() {
count++;
}
}
});
var view1 = new View;
$el.trigger("click");
equal(1, count);
var view2 = new View;
$el.trigger("click");
equal(3, count);
view1.delegateEvents();
$el.trigger("click");
equal(5, count);
});
test("custom events, with namespaces", 2, function() {
var count = 0;
var View = Backbone.View.extend({
el: $('body'),
events: function() {
return {"fake$event.namespaced": "run"};
},
run: function() {
count++;
}
});
var view = new View;
$('body').trigger('fake$event').trigger('fake$event');
equal(count, 2);
$('body').unbind('.namespaced');
$('body').trigger('fake$event');
equal(count, 2);
});
test("#1048 - setElement uses provided object.", 2, function() {
var $el = $('body');
var view = new Backbone.View({el: $el});
ok(view.$el === $el);
view.setElement($el = $($el));
ok(view.$el === $el);
});
test("#986 - Undelegate before changing element.", 1, function() {
var button1 = $('<button></button>');
var button2 = $('<button></button>');
var View = Backbone.View.extend({
events: {
click: function(e) {
ok(view.el === e.target);
}
}
});
var view = new View({el: button1});
view.setElement(button2);
button1.trigger('click');
button2.trigger('click');
});
test("#1172 - Clone attributes object", 2, function() {
var View = Backbone.View.extend({
attributes: {foo: 'bar'}
});
var view1 = new View({id: 'foo'});
strictEqual(view1.el.id, 'foo');
var view2 = new View();
ok(!view2.el.id);
});
test("#1228 - tagName can be provided as a function", 1, function() {
var View = Backbone.View.extend({
tagName: function() {
return 'p';
}
});
ok(new View().$el.is('p'));
});
test("dispose", 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);
}
});
var view = new View({
model: new Backbone.Model,
collection: new Backbone.Collection
});
view.dispose();
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() {
var View = Backbone.View.extend({
el: function() {
return "<p><a></a></p>";
}
});
var view = new View;
ok(view.$el.is('p:has(a)'));
});
});

1
vendor/benchmark.js vendored

Submodule vendor/benchmark.js deleted from 2f1af5879a

22
vendor/benchmark.js/LICENSE.txt vendored Normal file
View File

@@ -0,0 +1,22 @@
Copyright 2010-2012 Mathias Bynens <http://mathiasbynens.be/>
Based on JSLitmus.js, copyright Robert Kieffer <http://broofa.com/>
Modified by John-David Dalton <http://allyoucanleet.com/>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

136
vendor/benchmark.js/README.md vendored Normal file
View File

@@ -0,0 +1,136 @@
# Benchmark.js <sup>v1.0.0</sup>
[![build status](https://secure.travis-ci.org/bestiejs/benchmark.js.png)](http://travis-ci.org/bestiejs/benchmark.js)
A [robust](http://calendar.perfplanet.com/2010/bulletproof-javascript-benchmarks/ "Bulletproof JavaScript benchmarks") benchmarking library that works on nearly all JavaScript platforms<sup><a name="fnref1" href="#fn1">1</a></sup>, supports high-resolution timers, and returns statistically significant results. As seen on [jsPerf](http://jsperf.com/).
## Download
* [Development source](https://raw.github.com/bestiejs/benchmark.js/v1.0.0/benchmark.js)
## Dive in
Weve got [API docs](http://benchmarkjs.com/docs) and [unit tests](http://benchmarkjs.com/tests).
For a list of upcoming features, check out our [roadmap](https://github.com/bestiejs/benchmark.js/wiki/Roadmap).
## Support
Benchmark.js has been tested in at least 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.
## Installation and usage
In a browser or Adobe AIR:
```html
<script src="benchmark.js"></script>
```
Optionally, expose Javas nanosecond timer by adding the `nano` applet to the `<body>`:
```html
<applet code="nano" archive="nano.jar"></applet>
```
Or enable Chromes microsecond timer by using the [command line switch](http://peter.sh/experiments/chromium-command-line-switches/#enable-benchmarking):
--enable-benchmarking
Via [npm](http://npmjs.org/):
```bash
npm install benchmark
```
In [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/):
```js
var Benchmark = require('benchmark');
```
Optionally, use the [microtime module](https://github.com/wadey/node-microtime) by Wade Simmons:
```bash
npm install microtime
```
In [RingoJS v0.7.0-](http://ringojs.org/):
```js
var Benchmark = require('benchmark').Benchmark;
```
In [Rhino](http://www.mozilla.org/rhino/):
```js
load('benchmark.js');
```
In an AMD loader like [RequireJS](http://requirejs.org/):
```js
require({
'paths': {
'benchmark': 'path/to/benchmark'
}
},
['benchmark'], function(Benchmark) {
console.log(Benchmark.version);
});
// or with platform.js
// https://github.com/bestiejs/platform.js
require({
'paths': {
'benchmark': 'path/to/benchmark',
'platform': 'path/to/platform'
}
},
['benchmark', 'platform'], function(Benchmark, platform) {
Benchmark.platform = platform;
console.log(Benchmark.platform.name);
});
```
Usage example:
```js
var suite = new Benchmark.Suite;
// add tests
suite.add('RegExp#test', function() {
/o/.test('Hello World!');
})
.add('String#indexOf', function() {
'Hello World!'.indexOf('o') > -1;
})
// add listeners
.on('cycle', function(event) {
console.log(String(event.target));
})
.on('complete', function() {
console.log('Fastest is ' + this.filter('fastest').pluck('name'));
})
// run async
.run({ 'async': true });
// logs:
// > RegExp#test x 4,161,532 +-0.99% (59 cycles)
// > String#indexOf x 6,139,623 +-1.00% (131 cycles)
// > Fastest is String#indexOf
```
## BestieJS
Benchmark.js is part of the BestieJS *"Best in Class"* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation.
## Authors
* [Mathias Bynens](http://mathiasbynens.be/)
[![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter")
* [John-David Dalton](http://allyoucanleet.com/)
[![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter")
## Contributors
* [Kit Cambridge](http://kitcambridge.github.com/)
[![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter")

3919
vendor/benchmark.js/benchmark.js vendored Normal file

File diff suppressed because it is too large Load Diff

BIN
vendor/benchmark.js/nano.jar vendored Normal file

Binary file not shown.

1
vendor/docdown vendored

Submodule vendor/docdown deleted from 3a65504fc6

20
vendor/docdown/LICENSE.txt vendored Normal file
View File

@@ -0,0 +1,20 @@
Copyright 2011-2012 John-David Dalton <http://allyoucanleet.com/>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

33
vendor/docdown/README.md vendored Normal file
View File

@@ -0,0 +1,33 @@
# Docdown <sup>v1.0.0</sup>
A simple JSDoc to Markdown documentation generator.
## Documentation
The documentation for Docdown can be viewed here: [/doc/README.md](https://github.com/jdalton/docdown/blob/master/doc/README.md#readme)
For a list of upcoming features, check out our [roadmap](https://github.com/jdalton/docdown/wiki/Roadmap).
## Installation and usage
Usage example:
```php
require("docdown.php");
// generate Markdown
$markdown = docdown(array(
"path" => $filepath,
"url" => "https://github.com/username/project/blob/master/my.js"
));
```
## Author
* [John-David Dalton](http://allyoucanleet.com/)
[![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter")
## Contributors
* [Mathias Bynens](http://mathiasbynens.be/)
[![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter")

38
vendor/docdown/docdown.php vendored Normal file
View File

@@ -0,0 +1,38 @@
<?php
/*!
* Docdown v1.0.0-pre
* Copyright 2011-2012 John-David Dalton <http://allyoucanleet.com/>
* Available under MIT license <http://mths.be/mit>
*/
require(dirname(__FILE__) . '/src/DocDown/Generator.php');
/**
* Generates Markdown from JSDoc entries in a given file.
*
* @param {Array} [$options=array()] The options array.
* @returns {String} The generated Markdown.
* @example
*
* // specify a file path
* $markdown = docdown(array(
* // path to js file
* 'path' => $filepath,
* // url used to reference line numbers in code
* 'url' => 'https://github.com/username/project/blob/master/my.js'
* ));
*
* // or pass raw js
* $markdown = docdown(array(
* // raw JavaScript source
* 'source' => $rawJS,
* // documentation title
* 'title' => 'My API Documentation',
* // url used to reference line numbers in code
* 'url' => 'https://github.com/username/project/blob/master/my.js'
* ));
*/
function docdown( $options = array() ) {
$gen = new Generator($options);
return $gen->generate();
}
?>

215
vendor/docdown/src/DocDown/Alias.php vendored Normal file
View File

@@ -0,0 +1,215 @@
<?php
/**
* A class to represent a JSDoc entry alias.
*/
class Alias {
/**
* The alias owner.
*
* @memberOf Alias
* @type Object
*/
public $owner;
/*--------------------------------------------------------------------------*/
/**
* The Alias constructor.
*
* @constructor
* @param {String} $name The alias name.
* @param {Object} $owner The alias owner.
*/
public function __construct( $name, $owner ) {
$this->owner = $owner;
$this->_name = $name;
$this->_call = $owner->getCall();
$this->_category = $owner->getCategory();
$this->_desc = $owner->getDesc();
$this->_example = $owner->getExample();
$this->_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();
}
/*--------------------------------------------------------------------------*/
/**
* Extracts the entry's `alias` objects.
*
* @memberOf Alias
* @param {Number} $index The index of the array value to return.
* @returns {Array|String} The entry's `alias` objects.
*/
public function getAliases( $index = null ) {
$result = array();
return $index !== null
? @$result[$index]
: $result;
}
/**
* Extracts the function call from the owner entry.
*
* @memberOf Alias
* @returns {String} The function call.
*/
public function getCall() {
return $this->_call;
}
/**
* Extracts the owner entry's `category` data.
*
* @memberOf Alias
* @returns {String} The owner entry's `category` data.
*/
public function getCategory() {
return $this->_category;
}
/**
* Extracts the owner entry's description.
*
* @memberOf Alias
* @returns {String} The owner entry's description.
*/
public function getDesc() {
return $this->_desc;
}
/**
* Extracts the owner entry's `example` data.
*
* @memberOf Alias
* @returns {String} The owner entry's `example` data.
*/
public function getExample() {
return $this->_example;
}
/**
* Resolves the owner entry's line number.
*
* @memberOf Alias
* @returns {Number} The owner entry's line number.
*/
public function getLineNumber() {
return $this->_lineNumber;
}
/**
* Extracts the owner entry's `member` data.
*
* @memberOf Alias
* @param {Number} $index The index of the array value to return.
* @returns {Array|String} The owner entry's `member` data.
*/
public function getMembers( $index = null ) {
return $index !== null
? @$this->_members[$index]
: $this->_members;
}
/**
* Extracts the owner entry's `name` data.
*
* @memberOf Alias
* @returns {String} The owner entry's `name` data.
*/
public function getName() {
return $this->_name;
}
/**
* Extracts the owner entry's `param` data.
*
* @memberOf Alias
* @param {Number} $index The index of the array value to return.
* @returns {Array} The owner entry's `param` data.
*/
public function getParams( $index = null ) {
return $index !== null
? @$this->_params[$index]
: $this->_params;
}
/**
* Extracts the owner entry's `returns` data.
*
* @memberOf Alias
* @returns {String} The owner entry's `returns` data.
*/
public function getReturns() {
return $this->_returns;
}
/**
* Extracts the owner entry's `type` data.
*
* @memberOf Alias
* @returns {String} The owner entry's `type` data.
*/
public function getType() {
return $this->_type;
}
/**
* 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;
}
}
?>

426
vendor/docdown/src/DocDown/Entry.php vendored Normal file
View File

@@ -0,0 +1,426 @@
<?php
require(dirname(__FILE__) . "/Alias.php");
/**
* A class to simplify parsing a single JSDoc entry.
*/
class Entry {
/**
* The documentation entry.
*
* @memberOf Entry
* @type String
*/
public $entry = '';
/**
* The language highlighter used for code examples.
*
* @memberOf Entry
* @type String
*/
public $lang = '';
/**
* The source code.
*
* @memberOf Entry
* @type String
*/
public $source = '';
/*--------------------------------------------------------------------------*/
/**
* The Entry constructor.
*
* @constructor
* @param {String} $entry The documentation entry to analyse.
* @param {String} $source The source code.
* @param {String} [$lang ='js'] The language highlighter used for code examples.
*/
public function __construct( $entry, $source, $lang = 'js' ) {
$this->entry = $entry;
$this->lang = $lang;
$this->source = str_replace(PHP_EOL, "\n", $source);
}
/*--------------------------------------------------------------------------*/
/**
* Extracts the documentation entries from source code.
*
* @static
* @memberOf Entry
* @param {String} $source The source code.
* @returns {Array} The array of entries.
*/
public static function getEntries( $source ) {
preg_match_all('#/\*\*(?![-!])[\s\S]*?\*/\s*[^\n]+#', $source, $result);
return array_pop($result);
}
/*--------------------------------------------------------------------------*/
/**
* Checks if the entry is a function reference.
*
* @private
* @memberOf Entry
* @returns {Boolean} Returns `true` if the entry is a function reference, else `false`.
*/
private function isFunction() {
if (!isset($this->_isFunction)) {
$this->_isFunction = !!(
$this->isCtor() ||
count($this->getParams()) ||
count($this->getReturns()) ||
preg_match('/\* *@function\b/', $this->entry)
);
}
return $this->_isFunction;
}
/*--------------------------------------------------------------------------*/
/**
* Extracts the entry's `alias` objects.
*
* @memberOf Entry
* @param {Number} $index The index of the array value to return.
* @returns {Array|String} The entry's `alias` objects.
*/
public function getAliases( $index = null ) {
if (!isset($this->_aliases)) {
preg_match('#\* *@alias\s+([^\n]+)#', $this->entry, $result);
if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
$result = preg_split('/,\s*/', $result);
natsort($result);
foreach ($result as $resultIndex => $value) {
$result[$resultIndex] = new Alias($value, $this);
}
}
$this->_aliases = $result;
}
return $index !== null
? @$this->_aliases[$index]
: $this->_aliases;
}
/**
* Extracts the function call from the entry.
*
* @memberOf Entry
* @returns {String} The function call.
*/
public function getCall() {
if (isset($this->_call)) {
return $this->_call;
}
preg_match('#\*/\s*(?:function ([^(]*)|(.*?)(?=[:=,]|return\b))#', $this->entry, $result);
if ($result = array_pop($result)) {
$result = array_pop(explode('var ', trim(trim(array_pop(explode('.', $result))), "'")));
}
// resolve name
// avoid $this->getName() because it calls $this->getCall()
preg_match('#\* *@name\s+([^\n]+)#', $this->entry, $name);
if (count($name)) {
$name = trim($name[1]);
} else {
$name = $result;
}
// compile function call syntax
if ($this->isFunction()) {
// compose parts
$result = array($result);
$params = $this->getParams();
foreach ($params as $param) {
$result[] = $param[1];
}
// format
$result = $name .'('. implode(array_slice($result, 1), ', ') .')';
$result = str_replace(', [', ' [, ', str_replace('], [', ', ', $result));
}
$this->_call = $result ? $result : $name;
return $this->_call;
}
/**
* Extracts the entry's `category` data.
*
* @memberOf Entry
* @returns {String} The entry's `category` data.
*/
public function getCategory() {
if (isset($this->_category)) {
return $this->_category;
}
preg_match('#\* *@category\s+([^\n]+)#', $this->entry, $result);
if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
} else {
$result = $this->getType() == 'Function' ? 'Methods' : 'Properties';
}
$this->_category = $result;
return $result;
}
/**
* Extracts the entry's description.
*
* @memberOf Entry
* @returns {String} The entry's description.
*/
public function getDesc() {
if (isset($this->_desc)) {
return $this->_desc;
}
preg_match('#/\*\*(?:\s*\*)?([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
if (count($result)) {
$type = $this->getType();
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
$result = ($type == 'Function' ? '' : '(' . str_replace('|', ', ', trim($type, '{}')) . '): ') . $result;
}
$this->_desc = $result;
return $result;
}
/**
* Extracts the entry's `example` data.
*
* @memberOf Entry
* @returns {String} The entry's `example` data.
*/
public function getExample() {
if (isset($this->_example)) {
return $this->_example;
}
preg_match('#\* *@example\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', "\n", $result[1]));
$result = '```' . $this->lang . "\n" . $result . "\n```";
}
$this->_example = $result;
return $result;
}
/**
* Resolves the entry's line number.
*
* @memberOf Entry
* @returns {Number} The entry's line number.
*/
public function getLineNumber() {
if (!isset($this->_lineNumber)) {
preg_match_all('/\n/', substr($this->source, 0, strrpos($this->source, $this->entry) + strlen($this->entry)), $lines);
$this->_lineNumber = count(array_pop($lines)) + 1;
}
return $this->_lineNumber;
}
/**
* Extracts the entry's `member` data.
*
* @memberOf Entry
* @param {Number} $index The index of the array value to return.
* @returns {Array|String} The entry's `member` data.
*/
public function getMembers( $index = null ) {
if (!isset($this->_members)) {
preg_match('#\* *@member(?:Of)?\s+([^\n]+)#', $this->entry, $result);
if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
$result = preg_split('/,\s*/', $result);
natsort($result);
}
$this->_members = $result;
}
return $index !== null
? @$this->_members[$index]
: $this->_members;
}
/**
* Extracts the entry's `name` data.
*
* @memberOf Entry
* @returns {String} The entry's `name` data.
*/
public function getName() {
if (isset($this->_name)) {
return $this->_name;
}
preg_match('#\* *@name\s+([^\n]+)#', $this->entry, $result);
if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
} else {
$result = array_shift(explode('(', $this->getCall()));
}
$this->_name = $result;
return $result;
}
/**
* Extracts the entry's `param` data.
*
* @memberOf Entry
* @param {Number} $index The index of the array value to return.
* @returns {Array} The entry's `param` data.
*/
public function getParams( $index = null ) {
if (!isset($this->_params)) {
preg_match_all('#\* *@param\s+\{([^}]+)\}\s+(\[.+\]|[$\w|]+(?:\[.+\])?)\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#i', $this->entry, $result);
if (count($result = array_filter(array_slice($result, 1)))) {
// repurpose array
foreach ($result as $param) {
foreach ($param as $key => $value) {
if (!is_array($result[0][$key])) {
$result[0][$key] = array();
}
$result[0][$key][] = trim(preg_replace('/(?:^|\n)\s*\* */', ' ', $value));
}
}
$result = $result[0];
}
$this->_params = $result;
}
return $index !== null
? @$this->_params[$index]
: $this->_params;
}
/**
* Extracts the entry's `returns` data.
*
* @memberOf Entry
* @returns {String} The entry's `returns` data.
*/
public function getReturns() {
if (isset($this->_returns)) {
return $this->_returns;
}
preg_match('#\* *@returns\s+\{([^}]+)\}\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
if (count($result)) {
$result = array_map('trim', array_slice($result, 1));
$result[0] = str_replace('|', ', ', $result[0]);
$result[1] = preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]);
}
$this->_returns = $result;
return $result;
}
/**
* Extracts the entry's `type` data.
*
* @memberOf Entry
* @returns {String} The entry's `type` data.
*/
public function getType() {
if (isset($this->_type)) {
return $this->_type;
}
preg_match('#\* *@type\s+([^\n]+)#', $this->entry, $result);
if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
} else {
$result = $this->isFunction() ? 'Function' : 'Unknown';
}
$this->_type = $result;
return $result;
}
/**
* 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;
}
}
?>

565
vendor/docdown/src/DocDown/Generator.php vendored Normal file
View File

@@ -0,0 +1,565 @@
<?php
require(dirname(__FILE__) . "/Entry.php");
/**
* Generates Markdown from JSDoc entries.
*/
class Generator {
/**
* The HTML for the close tag.
*
* @static
* @memberOf Generator
* @type String
*/
public $closeTag = "\n<!-- /div -->\n";
/**
* An array of JSDoc entries.
*
* @memberOf Generator
* @type Array
*/
public $entries = array();
/**
* The HTML for the open tag.
*
* @static
* @memberOf Generator
* @type String
*/
public $openTag = "\n<!-- div -->\n";
/**
* An options array used to configure the generator.
*
* @memberOf Generator
* @type Array
*/
public $options = array();
/**
* The file's source code.
*
* @memberOf Generator
* @type String
*/
public $source = '';
/*--------------------------------------------------------------------------*/
/**
* The Generator constructor.
*
* @constructor
* @param {String} $source The source code to parse.
* @param {Array} $options The options array.
*/
public function __construct( $source, $options = array() ) {
// juggle arguments
if (is_array($source)) {
$options = $source;
} else {
$options['source'] = $source;
}
if (isset($options['source']) && realpath($options['source'])) {
$options['path'] = $options['source'];
}
if (isset($options['path'])) {
preg_match('/(?<=\.)[a-z]+$/', $options['path'], $ext);
$options['source'] = file_get_contents($options['path']);
$ext = array_pop($ext);
if (!isset($options['lang']) && $ext) {
$options['lang'] = $ext;
}
if (!isset($options['title'])) {
$options['title'] = ucfirst(basename($options['path'])) . ' API documentation';
}
}
if (!isset($options['lang'])) {
$options['lang'] = 'js';
}
if (!isset($options['toc'])) {
$options['toc'] = 'properties';
}
$this->options = $options;
$this->source = str_replace(PHP_EOL, "\n", $options['source']);
$this->entries = Entry::getEntries($this->source);
foreach ($this->entries as $index => $value) {
$this->entries[$index] = new Entry($value, $this->source, $options['lang']);
}
}
/*--------------------------------------------------------------------------*/
/**
* Performs common string formatting operations.
*
* @private
* @static
* @memberOf Generator
* @param {String} $string The string to format.
* @returns {String} The formatted string.
*/
private static function format( $string ) {
$counter = 0;
// tokenize inline code snippets
preg_match_all('/`[^`]+`/', $string, $tokenized);
$tokenized = $tokenized[0];
foreach ($tokenized as $snippet) {
$string = str_replace($snippet, '__token' . ($counter++) .'__', $string);
}
// italicize parentheses
$string = preg_replace('/(^|\s)(\([^)]+\))/', '$1*$2*', $string);
// mark numbers as inline code
$string = preg_replace('/ (-?\d+(?:.\d+)?)(?!\.[^\n])/', ' `$1`', $string);
// detokenize inline code snippets
$counter = 0;
foreach ($tokenized as $snippet) {
$string = str_replace('__token' . ($counter++) . '__', $snippet, $string);
}
return trim($string);
}
/**
* Modify a string by replacing named tokens with matching assoc. array values.
*
* @private
* @static
* @memberOf Generator
* @param {String} $string The string to modify.
* @param {Array|Object} $object The template object.
* @returns {String} The modified string.
*/
private static function interpolate( $string, $object ) {
preg_match_all('/#\{([^}]+)\}/', $string, $tokens);
$tokens = array_unique(array_pop($tokens));
foreach ($tokens as $token) {
$pattern = '/#\{' . $token . '\}/';
$replacement = '';
if (is_object($object)) {
preg_match('/\(([^)]+?)\)$/', $token, $args);
$args = preg_split('/,\s*/', array_pop($args));
$method = 'get' . ucfirst(str_replace('/\([^)]+?\)$/', '', $token));
if (method_exists($object, $method)) {
$replacement = (string) call_user_func_array(array($object, $method), $args);
} else if (isset($object->{$token})) {
$replacement = (string) $object->{$token};
}
} else if (isset($object[$token])) {
$replacement = (string) $object[$token];
}
$string = preg_replace($pattern, trim($replacement), $string);
}
return Generator::format($string);
}
/*--------------------------------------------------------------------------*/
/**
* Adds the given `$entries` to the `$result` array.
*
* @private
* @memberOf Generator
* @param {Array} $result The result array to modify.
* @param {Array} $entries The entries to add to the `$result`.
*/
private function addEntries( &$result, $entries ) {
foreach ($entries as $entry) {
// skip aliases
if ($entry->isAlias()) {
continue;
}
// name and description
array_push(
$result,
$this->openTag,
Generator::interpolate("### <a id=\"#{hash}\"></a>`#{member}#{separator}#{call}`\n<a href=\"##{hash}\">#</a> [&#x24C8;](#{href} \"View in source\") [&#x24C9;][1]\n\n#{desc}", $entry)
);
// @alias
if (count($aliases = $entry->getAliases())) {
array_push($result, '', '#### Aliases');
foreach ($aliases as $index => $alias) {
$aliases[$index] = $alias->getName();
}
$result[] = '*' . implode(', ', $aliases) . '*';
}
// @param
if (count($params = $entry->getParams())) {
array_push($result, '', '#### Arguments');
foreach ($params as $index => $param) {
$result[] = Generator::interpolate('#{num}. `#{name}` (#{type}): #{desc}', array(
'desc' => $param[2],
'name' => $param[1],
'num' => $index + 1,
'type' => $param[0]
));
}
}
// @returns
if (count($returns = $entry->getReturns())) {
array_push(
$result, '',
'#### Returns',
Generator::interpolate('(#{type}): #{desc}', array('desc' => $returns[1], 'type' => $returns[0]))
);
}
// @example
if ($example = $entry->getExample()) {
array_push($result, '', '#### Example', $example);
}
array_push($result, "\n* * *", $this->closeTag);
}
}
/**
* Resolves the entry's hash used to navigate the documentation.
*
* @private
* @memberOf Generator
* @param {Number|Object} $entry The entry object.
* @param {String} $member The name of the member.
* @returns {String} The url hash.
*/
private function getHash( $entry, $member = '' ) {
$entry = is_numeric($entry) ? $this->entries[$entry] : $entry;
$member = !$member ? $entry->getMembers(0) : $member;
$result = ($member ? $member . ($entry->isPlugin() ? 'prototype' : '') : '') . $entry->getCall();
$result = preg_replace('/\(\[|\[\]/', '', $result);
$result = preg_replace('/[ =|\'"{}.()\]]/', '', $result);
$result = preg_replace('/[[#,]/', '-', $result);
return strtolower($result);
}
/**
* Resolves the entry's url for the specific line number.
*
* @private
* @memberOf Generator
* @param {Number|Object} $entry The entry object.
* @returns {String} The url.
*/
private function getLineUrl( $entry ) {
$entry = is_numeric($entry) ? $this->entries($entry) : $entry;
return $this->options['url'] . '#L' . $entry->getLineNumber();
}
/**
* Extracts the character used to separate the entry's name from its member.
*
* @private
* @memberOf Generator
* @param {Number|Object} $entry The entry object.
* @returns {String} The separator.
*/
private function getSeparator( $entry ) {
$entry = is_numeric($entry) ? $this->entries($entry) : $entry;
return $entry->isPlugin() ? '.prototype.' : '.';
}
/*--------------------------------------------------------------------------*/
/**
* Generates Markdown from JSDoc entries.
*
* @memberOf Generator
* @returns {String} The rendered Markdown.
*/
public function generate() {
$api = array();
$byCategory = $this->options['toc'] == 'categories';
$categories = array();
$closeTag = $this->closeTag;
$compiling = false;
$openTag = $this->openTag;
$result = array('# ' . $this->options['title']);
$toc = 'toc';
// initialize $api array
foreach ($this->entries as $entry) {
// skip invalid or private entries
$name = $entry->getName();
if (!$name || $entry->isPrivate()) {
continue;
}
$members = $entry->getMembers();
$members = count($members) ? $members : array('');
foreach ($members as $member) {
// create api category arrays
if ($member && !isset($api[$member])) {
// create temporary entry to be replaced later
$api[$member] = new stdClass;
$api[$member]->static = array();
$api[$member]->plugin = array();
}
// append entry to api member
if (!$member || $entry->isCtor() || ($entry->getType() == 'Object' &&
!preg_match('/[=:]\s*(?:null|undefined)\s*[,;]?$/', $entry->entry))) {
// assign the real entry, replacing the temporary entry if it exist
$member = ($member ? $member . ($entry->isPlugin() ? '#' : '.') : '') . $name;
$entry->static = @$api[$member] ? $api[$member]->static : array();
$entry->plugin = @$api[$member] ? $api[$member]->plugin : array();
$api[$member] = $entry;
foreach ($entry->getAliases() as $alias) {
$api[$member] = $alias;
$alias->static = array();
$alias->plugin = array();
}
}
else if ($entry->isStatic()) {
$api[$member]->static[] = $entry;
foreach ($entry->getAliases() as $alias) {
$api[$member]->static[] = $alias;
}
}
else if (!$entry->isCtor()) {
$api[$member]->plugin[] = $entry;
foreach ($entry->getAliases() as $alias) {
$api[$member]->plugin[] = $alias;
}
}
}
}
// add properties to each entry
foreach ($api as $entry) {
$entry->hash = $this->getHash($entry);
$entry->href = $this->getLineUrl($entry);
$member = $entry->getMembers(0);
$member = ($member ? $member . ($entry->isPlugin() ? '.prototype.' : '.') : '') . $entry->getName();
$entry->member = preg_replace('/' . $entry->getName() . '$/', '', $member);
// add properties to static and plugin sub-entries
foreach (array('static', 'plugin') as $kind) {
foreach ($entry->{$kind} as $subentry) {
$subentry->hash = $this->getHash($subentry);
$subentry->href = $this->getLineUrl($subentry);
$subentry->member = $member;
$subentry->separator = $this->getSeparator($subentry);
}
}
}
/*------------------------------------------------------------------------*/
// custom sort for root level entries
// TODO: see how well it handles deeper namespace traversal
function sortCompare($a, $b) {
$score = array( 'a' => 0, 'b' => 0);
foreach (array( 'a' => $a, 'b' => $b) as $key => $value) {
// capitalized properties are last
if (preg_match('/[#.][A-Z]/', $value)) {
$score[$key] = 0;
}
// lowercase prototype properties are next to last
else if (preg_match('/#[a-z]/', $value)) {
$score[$key] = 1;
}
// lowercase static properties next to first
else if (preg_match('/\.[a-z]/', $value)) {
$score[$key] = 2;
}
// root properties are first
else if (preg_match('/^[^#.]+$/', $value)) {
$score[$key] = 3;
}
}
$score = $score['b'] - $score['a'];
return $score ? $score : strcasecmp($a, $b);
}
uksort($api, 'sortCompare');
// sort static and plugin sub-entries
foreach ($api as $entry) {
foreach (array('static', 'plugin') as $kind) {
$sortBy = array( 'a' => array(), 'b' => array(), 'c' => array() );
foreach ($entry->{$kind} as $subentry) {
$name = $subentry->getName();
// functions w/o ALL-CAPs names are last
$sortBy['a'][] = $subentry->getType() == 'Function' && !preg_match('/^[A-Z_]+$/', $name);
// ALL-CAPs properties first
$sortBy['b'][] = preg_match('/^[A-Z_]+$/', $name);
// lowercase alphanumeric sort
$sortBy['c'][] = strtolower($name);
}
array_multisort($sortBy['a'], SORT_ASC, $sortBy['b'], SORT_DESC, $sortBy['c'], SORT_ASC, $entry->{$kind});
}
}
/*------------------------------------------------------------------------*/
// add categories
foreach ($api as $entry) {
$categories[$entry->getCategory()][] = $entry;
foreach (array('static', 'plugin') as $kind) {
foreach ($entry->{$kind} as $subentry) {
$categories[$subentry->getCategory()][] = $subentry;
}
}
}
// sort categories
ksort($categories);
foreach(array('Methods', 'Properties') as $category) {
if (isset($categories[$category])) {
$entries = $categories[$category];
unset($categories[$category]);
$categories[$category] = $entries;
}
}
/*------------------------------------------------------------------------*/
// compile TOC
$result[] = $openTag;
// compile TOC by categories
if ($byCategory) {
foreach ($categories as $category => $entries) {
if ($compiling) {
$result[] = $closeTag;
} else {
$compiling = true;
}
// assign TOC hash
if (count($result) == 2) {
$toc = $category;
}
// add category
array_push(
$result,
$openTag, '## ' . (count($result) == 2 ? '<a id="' . $toc . '"></a>' : '') . '`' . $category . '`'
);
// add entries
foreach ($entries as $entry) {
$result[] = Generator::interpolate('* [`#{member}#{separator}#{name}`](##{hash})', $entry);
}
}
}
// compile TOC by namespace
else {
foreach ($api as $entry) {
if ($compiling) {
$result[] = $closeTag;
} else {
$compiling = true;
}
$member = $entry->member . $entry->getName();
// assign TOC hash
if (count($result) == 2) {
$toc = $member;
}
// add root entry
array_push(
$result,
$openTag, '## ' . (count($result) == 2 ? '<a id="' . $toc . '"></a>' : '') . '`' . $member . '`',
Generator::interpolate('* [`' . $member . '`](##{hash})', $entry)
);
// add static and plugin sub-entries
foreach (array('static', 'plugin') as $kind) {
if ($kind == 'plugin' && count($entry->plugin)) {
array_push(
$result,
$closeTag,
$openTag,
'## `' . $member . ($entry->isCtor() ? '.prototype`' : '`')
);
}
foreach ($entry->{$kind} as $subentry) {
$subentry->member = $member;
$result[] = Generator::interpolate('* [`#{member}#{separator}#{name}`](##{hash})', $subentry);
}
}
}
}
array_push($result, $closeTag, $closeTag);
/*------------------------------------------------------------------------*/
// compile content
$compiling = false;
$result[] = $openTag;
if ($byCategory) {
foreach ($categories as $category => $entries) {
if ($compiling) {
$result[] = $closeTag;
} else {
$compiling = true;
}
if ($category != 'Methods' && $category != 'Properties') {
$category = '“' . $category . '” Methods';
}
array_push($result, $openTag, '## `' . $category . '`');
$this->addEntries($result, $entries);
}
}
else {
foreach ($api as $entry) {
// skip aliases
if ($entry->isAlias()) {
continue;
}
if ($compiling) {
$result[] = $closeTag;
} else {
$compiling = true;
}
// add root entry name
$member = $entry->member . $entry->getName();
array_push($result, $openTag, '## `' . $member . '`');
foreach (array($entry, 'static', 'plugin') as $kind) {
$subentries = is_string($kind) ? $entry->{$kind} : array($kind);
// add sub-entry name
if ($kind != 'static' && $entry->getType() != 'Object' &&
count($subentries) && $subentries[0] != $kind) {
if ($kind == 'plugin') {
$result[] = $closeTag;
}
array_push(
$result,
$openTag,
'## `' . $member . ($kind == 'plugin' ? '.prototype`' : '`')
);
}
$this->addEntries($result, $subentries);
}
}
}
// close tags add TOC link reference
array_push($result, $closeTag, $closeTag, '', ' [1]: #' . $toc . ' "Jump back to the TOC."');
// cleanup whitespace
return trim(preg_replace('/ +\n/', "\n", join($result, "\n")));
}
}
?>

1049
vendor/firebug-lite/changelog.txt vendored Normal file

File diff suppressed because it is too large Load Diff

30
vendor/firebug-lite/license.txt vendored Normal file
View File

@@ -0,0 +1,30 @@
Software License Agreement (BSD License)
Copyright (c) 2007, Parakey Inc.
All rights reserved.
Redistribution and use of this software in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other
materials provided with the distribution.
* Neither the name of Parakey Inc. nor the names of its
contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of Parakey Inc.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

BIN
vendor/firebug-lite/skin/xp/blank.gif vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

BIN
vendor/firebug-lite/skin/xp/buttonBg.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 B

331
vendor/firebug-lite/skin/xp/debugger.css vendored Normal file
View File

@@ -0,0 +1,331 @@
/* See license.txt for terms of usage */
.panelNode-script {
overflow: hidden;
font-family: monospace;
}
/************************************************************************************************/
.scriptTooltip {
position: fixed;
z-index: 2147483647;
padding: 2px 3px;
border: 1px solid #CBE087;
background: LightYellow;
font-family: monospace;
color: #000000;
}
/************************************************************************************************/
.sourceBox {
/* TODO: xxxpedro problem with sourceBox and scrolling elements */
/*overflow: scroll; /* see issue 1479 */
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.sourceRow {
white-space: nowrap;
-moz-user-select: text;
}
.sourceRow.hovered {
background-color: #EEEEEE;
}
/************************************************************************************************/
.sourceLine {
-moz-user-select: none;
margin-right: 10px;
border-right: 1px solid #CCCCCC;
padding: 0px 4px 0 20px;
background: #EEEEEE no-repeat 2px 0px;
color: #888888;
white-space: pre;
font-family: monospace; /* see issue 2953 */
}
.noteInToolTip { /* below sourceLine, so it overrides it */
background-color: #FFD472;
}
.useA11y .sourceBox .sourceViewport:focus .sourceLine {
background-color: #FFFFC0;
color: navy;
border-right: 1px solid black;
}
.useA11y .sourceBox .sourceViewport:focus {
outline: none;
}
.a11y1emSize {
width: 1em;
height: 1em;
position: absolute;
}
.useA11y .panelStatusLabel:focus {
outline-offset: -2px !important;
}
.sourceBox > .sourceRow > .sourceLine {
cursor: pointer;
}
.sourceLine:hover {
text-decoration: none;
}
.sourceRowText {
white-space: pre;
}
.sourceRow[exe_line="true"] {
outline: 1px solid #D9D9B6;
margin-right: 1px;
background-color: lightgoldenrodyellow;
}
.sourceRow[executable="true"] > .sourceLine {
content: "-";
color: #4AA02C; /* Spring Green */
font-weight: bold;
}
.sourceRow[exe_line="true"] > .sourceLine {
background-image: url(chrome://firebug/skin/exe.png);
color: #000000;
}
.sourceRow[breakpoint="true"] > .sourceLine {
background-image: url(chrome://firebug/skin/breakpoint.png);
}
.sourceRow[breakpoint="true"][condition="true"] > .sourceLine {
background-image: url(chrome://firebug/skin/breakpointCondition.png);
}
.sourceRow[breakpoint="true"][disabledBreakpoint="true"] > .sourceLine {
background-image: url(chrome://firebug/skin/breakpointDisabled.png);
}
.sourceRow[breakpoint="true"][exe_line="true"] > .sourceLine {
background-image: url(chrome://firebug/skin/breakpointExe.png);
}
.sourceRow[breakpoint="true"][exe_line="true"][disabledBreakpoint="true"] > .sourceLine {
background-image: url(chrome://firebug/skin/breakpointDisabledExe.png);
}
.sourceLine.editing {
background-image: url(chrome://firebug/skin/breakpoint.png);
}
/************************************************************************************************/
.conditionEditor {
z-index: 2147483647;
position: absolute;
margin-top: 0;
left: 2px;
width: 90%;
}
.conditionEditorInner {
position: relative;
top: -26px;
height: 0;
}
.conditionCaption {
margin-bottom: 2px;
font-family: Lucida Grande, sans-serif;
font-weight: bold;
font-size: 11px;
color: #226679;
}
.conditionInput {
width: 100%;
border: 1px solid #0096C0;
font-family: monospace;
font-size: inherit;
}
.conditionEditorInner1 {
padding-left: 37px;
background: url(condBorders.png) repeat-y;
}
.conditionEditorInner2 {
padding-right: 25px;
background: url(condBorders.png) repeat-y 100% 0;
}
.conditionEditorTop1 {
background: url(condCorners.png) no-repeat 100% 0;
margin-left: 37px;
height: 35px;
}
.conditionEditorTop2 {
position: relative;
left: -37px;
width: 37px;
height: 35px;
background: url(condCorners.png) no-repeat;
}
.conditionEditorBottom1 {
background: url(condCorners.png) no-repeat 100% 100%;
margin-left: 37px;
height: 33px;
}
.conditionEditorBottom2 {
position: relative; left: -37px;
width: 37px;
height: 33px;
background: url(condCorners.png) no-repeat 0 100%;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
.upsideDown {
margin-top: 2px;
}
.upsideDown .conditionEditorInner {
top: -8px;
}
.upsideDown .conditionEditorInner1 {
padding-left: 33px;
background: url(condBordersUps.png) repeat-y;
}
.upsideDown .conditionEditorInner2 {
padding-right: 25px;
background: url(condBordersUps.png) repeat-y 100% 0;
}
.upsideDown .conditionEditorTop1 {
background: url(condCornersUps.png) no-repeat 100% 0;
margin-left: 33px;
height: 25px;
}
.upsideDown .conditionEditorTop2 {
position: relative;
left: -33px;
width: 33px;
height: 25px;
background: url(condCornersUps.png) no-repeat;
}
.upsideDown .conditionEditorBottom1 {
background: url(condCornersUps.png) no-repeat 100% 100%;
margin-left: 33px;
height: 43px;
}
.upsideDown .conditionEditorBottom2 {
position: relative;
left: -33px;
width: 33px;
height: 43px;
background: url(condCornersUps.png) no-repeat 0 100%;
}
/************************************************************************************************/
.breakpointsGroupListBox {
overflow: hidden;
}
.breakpointBlockHead {
position: relative;
padding-top: 4px;
}
.breakpointBlockHead > .checkbox {
margin-right: 4px;
}
.breakpointBlockHead > .objectLink-sourceLink {
top: 4px;
right: 20px;
background-color: #FFFFFF; /* issue 3308 */
}
.breakpointBlockHead > .closeButton {
position: absolute;
top: 2px;
right: 2px;
}
.breakpointCheckbox {
margin-top: 0;
vertical-align: top;
}
.breakpointName {
margin-left: 4px;
font-weight: bold;
}
.breakpointRow[aria-checked="false"] > .breakpointBlockHead > *,
.breakpointRow[aria-checked="false"] > .breakpointCode {
opacity: 0.5;
}
.breakpointRow[aria-checked="false"] .breakpointCheckbox,
.breakpointRow[aria-checked="false"] .objectLink-sourceLink,
.breakpointRow[aria-checked="false"] .closeButton,
.breakpointRow[aria-checked="false"] .breakpointMutationType {
opacity: 1.0 !important;
}
.breakpointCode {
overflow: hidden;
white-space: nowrap;
padding-left: 24px;
padding-bottom: 2px;
border-bottom: 1px solid #D7D7D7;
font-family: monospace;
color: DarkGreen;
}
.breakpointCondition {
white-space: nowrap;
padding-left: 24px;
padding-bottom: 2px;
border-bottom: 1px solid #D7D7D7;
font-family: monospace;
color: Gray;
}
.breakpointBlock-breakpoints > .groupHeader {
display: none;
}
.breakpointBlock-monitors > .breakpointCode {
padding: 0;
}
.breakpointBlock-errorBreakpoints .breakpointCheckbox,
.breakpointBlock-monitors .breakpointCheckbox {
display: none;
}
.breakpointHeader {
margin: 0 !important;
border-top: none !important;
}

BIN
vendor/firebug-lite/skin/xp/detach.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 655 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 586 B

BIN
vendor/firebug-lite/skin/xp/disable.gif vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

BIN
vendor/firebug-lite/skin/xp/disable.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 512 B

BIN
vendor/firebug-lite/skin/xp/down.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 526 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 447 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 365 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 B

View File

@@ -0,0 +1,817 @@
.fbBtnPressed {
background: #ECEBE3;
padding: 3px 6px 2px 7px !important;
margin: 1px 0 0 1px;
_margin: 1px -1px 0 1px;
border: 1px solid #ACA899 !important;
border-color: #ACA899 #ECEBE3 #ECEBE3 #ACA899 !important;
}
.fbToolbarButtons {
display: none;
}
#fbStatusBarBox {
display: none;
}
/************************************************************************************************
Error Popup
*************************************************************************************************/
#fbErrorPopup {
position: absolute;
right: 0;
bottom: 0;
height: 19px;
width: 75px;
background: url(sprite.png) #f1f2ee 0 0;
z-index: 999;
}
#fbErrorPopupContent {
position: absolute;
right: 0;
top: 1px;
height: 18px;
width: 75px;
_width: 74px;
border-left: 1px solid #aca899;
}
#fbErrorIndicator {
position: absolute;
top: 2px;
right: 5px;
}
.fbBtnInspectActive {
background: #aaa;
color: #fff !important;
}
/************************************************************************************************
General
*************************************************************************************************/
html, body {
margin: 0;
padding: 0;
overflow: hidden;
}
body {
font-family: Lucida Grande, Tahoma, sans-serif;
font-size: 11px;
background: #fff;
}
.clear {
clear: both;
}
/************************************************************************************************
Mini Chrome
*************************************************************************************************/
#fbMiniChrome {
display: none;
right: 0;
height: 27px;
background: url(sprite.png) #f1f2ee 0 0;
margin-left: 1px;
}
#fbMiniContent {
display: block;
position: relative;
left: -1px;
right: 0;
top: 1px;
height: 25px;
border-left: 1px solid #aca899;
}
#fbToolbarSearch {
float: right;
border: 1px solid #ccc;
margin: 0 5px 0 0;
background: #fff url(search.png) no-repeat 4px 2px;
padding-left: 20px;
font-size: 11px;
}
#fbToolbarErrors {
float: right;
margin: 1px 4px 0 0;
font-size: 11px;
}
#fbLeftToolbarErrors {
float: left;
margin: 7px 0px 0 5px;
font-size: 11px;
}
.fbErrors {
padding-left: 20px;
height: 14px;
background: url(errorIcon.png) no-repeat;
color: #f00;
font-weight: bold;
}
#fbMiniErrors {
display: inline;
display: none;
float: right;
margin: 5px 2px 0 5px;
}
#fbMiniIcon {
float: right;
margin: 3px 4px 0;
height: 20px;
width: 20px;
float: right;
background: url(sprite.png) 0 -135px;
cursor: pointer;
}
/************************************************************************************************
Master Layout
*************************************************************************************************/
#fbChrome {
position: fixed;
overflow: hidden;
height: 100%;
width: 100%;
border-collapse: collapse;
background: #fff;
}
#fbTop {
height: 49px;
}
#fbToolbar {
position: absolute;
z-index: 5;
width: 100%;
top: 0;
background: url(sprite.png) #f1f2ee 0 0;
height: 27px;
font-size: 11px;
overflow: hidden;
}
#fbPanelBarBox {
top: 27px;
position: absolute;
z-index: 8;
width: 100%;
background: url(sprite.png) #dbd9c9 0 -27px;
height: 22px;
}
#fbContent {
height: 100%;
vertical-align: top;
}
#fbBottom {
height: 18px;
background: #fff;
}
/************************************************************************************************
Sub-Layout
*************************************************************************************************/
/* fbToolbar
*************************************************************************************************/
#fbToolbarIcon {
float: left;
padding: 4px 5px 0;
}
#fbToolbarIcon a {
display: block;
height: 20px;
width: 20px;
background: url(sprite.png) 0 -135px;
text-decoration: none;
cursor: default;
}
#fbToolbarButtons {
float: left;
padding: 4px 2px 0 5px;
}
#fbToolbarButtons a {
text-decoration: none;
display: block;
float: left;
color: #000;
padding: 4px 8px 4px;
cursor: default;
}
#fbToolbarButtons a:hover {
color: #333;
padding: 3px 7px 3px;
border: 1px solid #fff;
border-bottom: 1px solid #bbb;
border-right: 1px solid #bbb;
}
#fbStatusBarBox {
position: relative;
top: 5px;
line-height: 19px;
cursor: default;
}
.fbToolbarSeparator{
overflow: hidden;
border: 1px solid;
border-color: transparent #fff transparent #777;
_border-color: #eee #fff #eee #777;
height: 7px;
margin: 10px 6px 0 0;
float: left;
}
.fbStatusBar span {
color: #808080;
padding: 0 4px 0 0;
}
.fbStatusBar span a {
text-decoration: none;
color: black;
}
.fbStatusBar span a:hover {
color: blue;
cursor: pointer;
}
#fbWindowButtons {
position: absolute;
white-space: nowrap;
right: 0;
top: 0;
height: 17px;
_width: 50px;
padding: 5px 0 5px 5px;
z-index: 6;
background: url(sprite.png) #f1f2ee 0 0;
}
/* fbPanelBarBox
*************************************************************************************************/
#fbPanelBar1 {
width: 255px; /* fixed width to avoid tabs breaking line */
z-index: 8;
left: 0;
white-space: nowrap;
background: url(sprite.png) #dbd9c9 0 -27px;
position: absolute;
left: 4px;
}
#fbPanelBar2Box {
background: url(sprite.png) #dbd9c9 0 -27px;
position: absolute;
height: 22px;
width: 300px; /* fixed width to avoid tabs breaking line */
z-index: 9;
right: 0;
}
#fbPanelBar2 {
position: absolute;
width: 290px; /* fixed width to avoid tabs breaking line */
height: 22px;
padding-left: 10px;
}
/* body
*************************************************************************************************/
.fbPanel {
display: none;
}
#fbPanelBox1, #fbPanelBox2 {
max-height: inherit;
height: 100%;
font-size: 11px;
}
#fbPanelBox2 {
background: #fff;
}
#fbPanelBox2 {
width: 300px;
background: #fff;
}
#fbPanel2 {
padding-left: 6px;
background: #fff;
}
.hide {
overflow: hidden !important;
position: fixed !important;
display: none !important;
visibility: hidden !important;
}
/* fbBottom
*************************************************************************************************/
#fbCommand {
height: 18px;
}
#fbCommandBox {
position: absolute;
width: 100%;
height: 18px;
bottom: 0;
overflow: hidden;
z-index: 9;
background: #fff;
border: 0;
border-top: 1px solid #ccc;
}
#fbCommandIcon {
position: absolute;
color: #00f;
top: 2px;
left: 7px;
display: inline;
font: 11px Monaco, monospace;
z-index: 10;
}
#fbCommandLine {
position: absolute;
width: 100%;
top: 0;
left: 0;
border: 0;
margin: 0;
padding: 2px 0 2px 32px;
font: 11px Monaco, monospace;
z-index: 9;
}
div.fbFitHeight {
overflow: auto;
_position: absolute;
}
/************************************************************************************************
Layout Controls
*************************************************************************************************/
/* fbToolbar buttons
*************************************************************************************************/
#fbWindowButtons a {
font-size: 1px;
width: 16px;
height: 16px;
display: block;
float: right;
margin-right: 4px;
text-decoration: none;
cursor: default;
}
#fbWindow_btClose {
background: url(sprite.png) 0 -119px;
}
#fbWindow_btClose:hover {
background: url(sprite.png) -16px -119px;
}
#fbWindow_btDetach {
background: url(sprite.png) -32px -119px;
}
#fbWindow_btDetach:hover {
background: url(sprite.png) -48px -119px;
}
/* fbPanelBarBox tabs
*************************************************************************************************/
.fbTab {
text-decoration: none;
display: none;
float: left;
width: auto;
float: left;
cursor: default;
font-family: Lucida Grande, Tahoma, sans-serif;
font-size: 11px;
font-weight: bold;
height: 22px;
color: #565656;
}
.fbPanelBar span {
display: block;
float: left;
}
.fbPanelBar .fbTabL,.fbPanelBar .fbTabR {
height: 22px;
width: 8px;
}
.fbPanelBar .fbTabText {
padding: 4px 1px 0;
}
a.fbTab:hover {
background: url(sprite.png) 0 -73px;
}
a.fbTab:hover .fbTabL {
background: url(sprite.png) -16px -96px;
}
a.fbTab:hover .fbTabR {
background: url(sprite.png) -24px -96px;
}
.fbSelectedTab {
background: url(sprite.png) #f1f2ee 0 -50px !important;
color: #000;
}
.fbSelectedTab .fbTabL {
background: url(sprite.png) 0 -96px !important;
}
.fbSelectedTab .fbTabR {
background: url(sprite.png) -8px -96px !important;
}
/* splitters
*************************************************************************************************/
#fbHSplitter {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 5px;
overflow: hidden;
cursor: n-resize !important;
background: url(pixel_transparent.gif);
z-index: 9;
}
#fbHSplitter.fbOnMovingHSplitter {
height: 100%;
z-index: 100;
}
.fbVSplitter {
background: #ece9d8;
color: #000;
border: 1px solid #716f64;
border-width: 0 1px;
border-left-color: #aca899;
width: 4px;
cursor: e-resize;
overflow: hidden;
right: 294px;
text-decoration: none;
z-index: 9;
position: absolute;
height: 100%;
top: 27px;
_width: 6px;
}
/************************************************************************************************/
div.lineNo {
font: 11px Monaco, monospace;
float: left;
display: inline;
position: relative;
margin: 0;
padding: 0 5px 0 20px;
background: #eee;
color: #888;
border-right: 1px solid #ccc;
text-align: right;
}
pre.nodeCode {
font: 11px Monaco, monospace;
margin: 0;
padding-left: 10px;
overflow: hidden;
/*
_width: 100%;
/**/
}
/************************************************************************************************/
.nodeControl {
margin-top: 3px;
margin-left: -14px;
float: left;
width: 9px;
height: 9px;
overflow: hidden;
cursor: default;
background: url(tree_open.gif);
_float: none;
_display: inline;
_position: absolute;
}
div.nodeMaximized {
background: url(tree_close.gif);
}
div.objectBox-element {
padding: 1px 3px;
}
.objectBox-selector{
cursor: default;
}
.selectedElement{
background: highlight;
/* background: url(roundCorner.svg); Opera */
color: #fff !important;
}
.selectedElement span{
color: #fff !important;
}
/* Webkit CSS Hack - bug in "highlight" named color */
@media screen and (-webkit-min-device-pixel-ratio:0) {
.selectedElement{
background: #316AC5;
color: #fff !important;
}
}
/************************************************************************************************/
/************************************************************************************************/
.logRow * {
font-size: 11px;
}
.logRow {
position: relative;
border-bottom: 1px solid #D7D7D7;
padding: 2px 4px 1px 6px;
background-color: #FFFFFF;
}
.logRow-command {
font-family: Monaco, monospace;
color: blue;
}
.objectBox-string,
.objectBox-text,
.objectBox-number,
.objectBox-function,
.objectLink-element,
.objectLink-textNode,
.objectLink-function,
.objectBox-stackTrace,
.objectLink-profile {
font-family: Monaco, monospace;
}
.objectBox-null {
padding: 0 2px;
border: 1px solid #666666;
background-color: #888888;
color: #FFFFFF;
}
.objectBox-string {
color: red;
white-space: pre;
}
.objectBox-number {
color: #000088;
}
.objectBox-function {
color: DarkGreen;
}
.objectBox-object {
color: DarkGreen;
font-weight: bold;
font-family: Lucida Grande, sans-serif;
}
.objectBox-array {
color: #000;
}
/************************************************************************************************/
.logRow-info,.logRow-error,.logRow-warning {
background: #fff no-repeat 2px 2px;
padding-left: 20px;
padding-bottom: 3px;
}
.logRow-info {
background-image: url(infoIcon.png);
}
.logRow-warning {
background-color: cyan;
background-image: url(warningIcon.png);
}
.logRow-error {
background-color: LightYellow;
background-image: url(errorIcon.png);
color: #f00;
}
.errorMessage {
vertical-align: top;
color: #f00;
}
.objectBox-sourceLink {
position: absolute;
right: 4px;
top: 2px;
padding-left: 8px;
font-family: Lucida Grande, sans-serif;
font-weight: bold;
color: #0000FF;
}
/************************************************************************************************/
.logRow-group {
background: #EEEEEE;
border-bottom: none;
}
.logGroup {
background: #EEEEEE;
}
.logGroupBox {
margin-left: 24px;
border-top: 1px solid #D7D7D7;
border-left: 1px solid #D7D7D7;
}
/************************************************************************************************/
.selectorTag,.selectorId,.selectorClass {
font-family: Monaco, monospace;
font-weight: normal;
}
.selectorTag {
color: #0000FF;
}
.selectorId {
color: DarkBlue;
}
.selectorClass {
color: red;
}
/************************************************************************************************/
.objectBox-element {
font-family: Monaco, monospace;
color: #000088;
}
.nodeChildren {
padding-left: 26px;
}
.nodeTag {
color: blue;
cursor: pointer;
}
.nodeValue {
color: #FF0000;
font-weight: normal;
}
.nodeText,.nodeComment {
margin: 0 2px;
vertical-align: top;
}
.nodeText {
color: #333333;
font-family: Monaco, monospace;
}
.nodeComment {
color: DarkGreen;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
.nodeHidden, .nodeHidden * {
color: #888888;
}
.nodeHidden .nodeTag {
color: #5F82D9;
}
.nodeHidden .nodeValue {
color: #D86060;
}
.selectedElement .nodeHidden, .selectedElement .nodeHidden * {
color: SkyBlue !important;
}
/************************************************************************************************/
.log-object {
/*
_position: relative;
_height: 100%;
/**/
}
.property {
position: relative;
clear: both;
height: 15px;
}
.propertyNameCell {
vertical-align: top;
float: left;
width: 28%;
position: absolute;
left: 0;
z-index: 0;
}
.propertyValueCell {
float: right;
width: 68%;
background: #fff;
position: absolute;
padding-left: 5px;
display: table-cell;
right: 0;
z-index: 1;
/*
_position: relative;
/**/
}
.propertyName {
font-weight: bold;
}
.FirebugPopup {
height: 100% !important;
}
.FirebugPopup #fbWindowButtons {
display: none !important;
}
.FirebugPopup #fbHSplitter {
display: none !important;
}

View File

@@ -0,0 +1,20 @@
/************************************************************************************************/
#fbToolbarSearch {
background-image: url(search.gif) !important;
}
/************************************************************************************************/
.fbErrors {
background-image: url(errorIcon.gif) !important;
}
/************************************************************************************************/
.logRow-info {
background-image: url(infoIcon.gif) !important;
}
.logRow-warning {
background-image: url(warningIcon.gif) !important;
}
.logRow-error {
background-image: url(errorIcon.gif) !important;
}

3147
vendor/firebug-lite/skin/xp/firebug.css vendored Normal file

File diff suppressed because it is too large Load Diff

215
vendor/firebug-lite/skin/xp/firebug.html vendored Normal file
View File

@@ -0,0 +1,215 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/DTD/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Firebug Lite</title>
<!-- An empty script to avoid FOUC when loading the stylesheet -->
<script type="text/javascript"></script>
<style type="text/css" media="screen">@import "firebug.css";</style>
<style>html,body{margin:0;padding:0;overflow:hidden;}</style>
</head>
<body class="fbBody">
<table id="fbChrome" cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr>
<!-- Interface - Top Area -->
<td id="fbTop" colspan="2">
<!--
<div>
--><!-- <span id="fbToolbarErrors" class="fbErrors">2 errors</span> --><!--
<input type="text" id="fbToolbarSearch" />
</div>
-->
<!-- Window Buttons -->
<div id="fbWindowButtons">
<a id="fbWindow_btDeactivate" class="fbSmallButton fbHover" title="Deactivate Firebug for this web page">&nbsp;</a>
<a id="fbWindow_btDetach" class="fbSmallButton fbHover" title="Open Firebug in popup window">&nbsp;</a>
<a id="fbWindow_btClose" class="fbSmallButton fbHover" title="Minimize Firebug">&nbsp;</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">&nbsp;</a>
</span>
<!--
<span id="fbLeftToolbarErrors" class="fbErrors">2 errors</span>
-->
<!-- Toolbar Buttons -->
<span id="fbToolbarButtons">
<!-- Fixed Toolbar Buttons -->
<span id="fbFixedButtons">
<a id="fbChrome_btInspect" class="fbButton fbHover" title="Click an element in the page to inspect">Inspect</a>
</span>
<!-- Console Panel Toolbar Buttons -->
<span id="fbConsoleButtons" class="fbToolbarButtons">
<a id="fbConsole_btClear" class="fbButton fbHover" title="Clear the console">Clear</a>
</span>
<!-- HTML Panel Toolbar Buttons -->
<!--
<span id="fbHTMLButtons" class="fbToolbarButtons">
<a id="fbHTML_btEdit" class="fbHover" title="Edit this HTML">Edit</a>
</span>
-->
</span>
<!-- Status Bar -->
<span id="fbStatusBarBox">
<span class="fbToolbarSeparator"></span>
<!-- HTML Panel Status Bar -->
<!--
<span id="fbHTMLStatusBar" class="fbStatusBar fbToolbarButtons">
</span>
-->
</span>
</div>
</div>
<!-- PanelBars -->
<div id="fbPanelBarBox">
<!-- Main PanelBar -->
<div id="fbPanelBar1" class="fbPanelBar">
<a id="fbConsoleTab" class="fbTab fbHover">
<span class="fbTabL"></span>
<span class="fbTabText">Console</span>
<span class="fbTabMenuTarget"></span>
<span class="fbTabR"></span>
</a>
<a id="fbHTMLTab" class="fbTab fbHover">
<span class="fbTabL"></span>
<span class="fbTabText">HTML</span>
<span class="fbTabR"></span>
</a>
<a class="fbTab fbHover">
<span class="fbTabL"></span>
<span class="fbTabText">CSS</span>
<span class="fbTabR"></span>
</a>
<a class="fbTab fbHover">
<span class="fbTabL"></span>
<span class="fbTabText">Script</span>
<span class="fbTabR"></span>
</a>
<a class="fbTab fbHover">
<span class="fbTabL"></span>
<span class="fbTabText">DOM</span>
<span class="fbTabR"></span>
</a>
</div>
<!-- Side PanelBars -->
<div id="fbPanelBar2Box" class="hide">
<div id="fbPanelBar2" class="fbPanelBar">
<!--
<a class="fbTab fbHover">
<span class="fbTabL"></span>
<span class="fbTabText">Style</span>
<span class="fbTabR"></span>
</a>
<a class="fbTab fbHover">
<span class="fbTabL"></span>
<span class="fbTabText">Layout</span>
<span class="fbTabR"></span>
</a>
<a class="fbTab fbHover">
<span class="fbTabL"></span>
<span class="fbTabText">DOM</span>
<span class="fbTabR"></span>
</a>
-->
</div>
</div>
</div>
<!-- Horizontal Splitter -->
<div id="fbHSplitter">&nbsp;</div>
</td>
</tr>
<!-- Interface - Main Area -->
<tr id="fbContent">
<!-- Panels -->
<td id="fbPanelBox1">
<div id="fbPanel1" class="fbFitHeight">
<div id="fbConsole" class="fbPanel"></div>
<div id="fbHTML" class="fbPanel"></div>
</div>
</td>
<!-- Side Panel Box -->
<td id="fbPanelBox2" class="hide">
<!-- VerticalSplitter -->
<div id="fbVSplitter" class="fbVSplitter">&nbsp;</div>
<!-- Side Panels -->
<div id="fbPanel2" class="fbFitHeight">
<!-- HTML Side Panels -->
<div id="fbHTML_Style" class="fbPanel"></div>
<div id="fbHTML_Layout" class="fbPanel"></div>
<div id="fbHTML_DOM" class="fbPanel"></div>
</div>
<!-- Large Command Line -->
<textarea id="fbLargeCommandLine" class="fbFitHeight"></textarea>
<!-- Large Command Line Buttons -->
<div id="fbLargeCommandButtons">
<a id="fbCommand_btRun" class="fbButton fbHover">Run</a>
<a id="fbCommand_btClear" class="fbButton fbHover">Clear</a>
<a id="fbSmallCommandLineIcon" class="fbSmallButton fbHover"></a>
</div>
</td>
</tr>
<!-- Interface - Bottom Area -->
<tr id="fbBottom" class="hide">
<!-- Command Line -->
<td id="fbCommand" colspan="2">
<div id="fbCommandBox">
<div id="fbCommandIcon">&gt;&gt;&gt;</div>
<input id="fbCommandLine" name="fbCommandLine" type="text" />
<a id="fbLargeCommandLineIcon" class="fbSmallButton fbHover"></a>
</div>
</td>
</tr>
</tbody>
</table>
<span id="fbMiniChrome">
<span id="fbMiniContent">
<span id="fbMiniIcon" title="Open Firebug Lite"></span>
<span id="fbMiniErrors" class="fbErrors"><!-- 2 errors --></span>
</span>
</span>
<!--
<div id="fbErrorPopup">
<div id="fbErrorPopupContent">
<div id="fbErrorIndicator" class="fbErrors">2 errors</div>
</div>
</div>
-->
</body>
</html>

BIN
vendor/firebug-lite/skin/xp/firebug.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
vendor/firebug-lite/skin/xp/group.gif vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 B

272
vendor/firebug-lite/skin/xp/html.css vendored Normal file
View File

@@ -0,0 +1,272 @@
/* See license.txt for terms of usage */
.panelNode-html {
-moz-box-sizing: padding-box;
padding: 4px 0 0 2px;
}
.nodeBox {
position: relative;
font-family: Monaco, monospace;
padding-left: 13px;
-moz-user-select: -moz-none;
}
.nodeBox.search-selection {
-moz-user-select: text;
}
.twisty {
position: absolute;
left: 0px;
top: 0px;
width: 14px;
height: 14px;
}
.nodeChildBox {
margin-left: 12px;
display: none;
}
.nodeLabel,
.nodeCloseLabel {
margin: -2px 2px 0 2px;
border: 2px solid transparent;
-moz-border-radius: 3px;
padding: 0 2px;
color: #000088;
}
.nodeCloseLabel {
display: none;
}
.nodeTag {
cursor: pointer;
color: blue;
}
.nodeValue {
color: #FF0000;
font-weight: normal;
}
.nodeText,
.nodeComment {
margin: 0 2px;
vertical-align: top;
}
.nodeText {
color: #333333;
}
.nodeWhiteSpace {
border: 1px solid LightGray;
white-space: pre; /* otherwise the border will be collapsed around zero pixels */
margin-left: 1px;
color: gray;
}
.nodeWhiteSpace_Space {
border: 1px solid #ddd;
}
.nodeTextEntity {
border: 1px solid gray;
white-space: pre; /* otherwise the border will be collapsed around zero pixels */
margin-left: 1px;
}
.nodeComment {
color: DarkGreen;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
.nodeBox.highlightOpen > .nodeLabel {
background-color: #EEEEEE;
}
.nodeBox.highlightOpen > .nodeCloseLabel,
.nodeBox.highlightOpen > .nodeChildBox,
.nodeBox.open > .nodeCloseLabel,
.nodeBox.open > .nodeChildBox {
display: block;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
.nodeBox.selected > .nodeLabel > .nodeLabelBox,
.nodeBox.selected > .nodeLabel {
border-color: Highlight;
background-color: Highlight;
color: HighlightText !important;
}
.nodeBox.selected > .nodeLabel > .nodeLabelBox,
.nodeBox.selected > .nodeLabel > .nodeLabelBox > .nodeTag,
.nodeBox.selected > .nodeLabel > .nodeLabelBox > .nodeAttr > .nodeValue,
.nodeBox.selected > .nodeLabel > .nodeLabelBox > .nodeText {
color: inherit !important;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
.nodeBox.highlighted > .nodeLabel {
border-color: Highlight !important;
background-color: cyan !important;
color: #000000 !important;
}
.nodeBox.highlighted > .nodeLabel > .nodeLabelBox,
.nodeBox.highlighted > .nodeLabel > .nodeLabelBox > .nodeTag,
.nodeBox.highlighted > .nodeLabel > .nodeLabelBox > .nodeAttr > .nodeValue,
.nodeBox.highlighted > .nodeLabel > .nodeLabelBox > .nodeText {
color: #000000 !important;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
.nodeBox.nodeHidden .nodeLabel > .nodeLabelBox,
.nodeBox.nodeHidden .nodeCloseLabel,
.nodeBox.nodeHidden .nodeLabel > .nodeLabelBox > .nodeText,
.nodeBox.nodeHidden .nodeText {
color: #888888;
}
.nodeBox.nodeHidden .nodeLabel > .nodeLabelBox > .nodeTag,
.nodeBox.nodeHidden .nodeCloseLabel > .nodeCloseLabelBox > .nodeTag {
color: #5F82D9;
}
.nodeBox.nodeHidden .nodeLabel > .nodeLabelBox > .nodeAttr > .nodeValue {
color: #D86060;
}
.nodeBox.nodeHidden.selected > .nodeLabel > .nodeLabelBox,
.nodeBox.nodeHidden.selected > .nodeLabel > .nodeLabelBox > .nodeTag,
.nodeBox.nodeHidden.selected > .nodeLabel > .nodeLabelBox > .nodeAttr > .nodeValue,
.nodeBox.nodeHidden.selected > .nodeLabel > .nodeLabelBox > .nodeText {
color: SkyBlue !important;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
.nodeBox.mutated > .nodeLabel,
.nodeAttr.mutated,
.nodeValue.mutated,
.nodeText.mutated,
.nodeBox.mutated > .nodeText {
background-color: #EFFF79;
color: #FF0000 !important;
}
.nodeBox.selected.mutated > .nodeLabel,
.nodeBox.selected.mutated > .nodeLabel > .nodeLabelBox,
.nodeBox.selected > .nodeLabel > .nodeLabelBox > .nodeAttr.mutated > .nodeValue,
.nodeBox.selected > .nodeLabel > .nodeLabelBox > .nodeAttr > .nodeValue.mutated,
.nodeBox.selected > .nodeLabel > .nodeLabelBox > .nodeText.mutated {
background-color: #EFFF79;
border-color: #EFFF79;
color: #FF0000 !important;
}
/************************************************************************************************/
.logRow-dirxml {
padding-left: 0;
}
.soloElement > .nodeBox {
padding-left: 0;
}
.useA11y .nodeLabel.focused {
outline: 2px solid #FF9933;
-moz-outline-radius: 3px;
outline-offset: -2px;
}
.useA11y .nodeLabelBox:focus {
outline: none;
}
/************************************************************************************************/
.breakpointCode .twisty {
display: none;
}
.breakpointCode .nodeBox.containerNodeBox,
.breakpointCode .nodeLabel {
padding-left: 0px;
margin-left: 0px;
font-family: Monaco, monospace !important;
}
.breakpointCode .nodeTag,
.breakpointCode .nodeAttr,
.breakpointCode .nodeText,
.breakpointCode .nodeValue,
.breakpointCode .nodeLabel {
color: DarkGreen !important;
}
.breakpointMutationType {
position: absolute;
top: 4px;
right: 20px;
color: gray;
}
/************************************************************************************************/
/************************************************************************************************/
/************************************************************************************************/
/************************************************************************************************/
/************************************************************************************************/
/************************************************************************************************/
/************************************************************************************************/
/************************************************************************************************/
/************************************************************************************************/
/************************************************************************************************/
/************************************************************************************************/
/* Twisties */
.twisty,
.logRow-errorMessage > .hasTwisty > .errorTitle,
.logRow-log > .objectBox-array.hasTwisty,
.logRow-spy .spyHead .spyTitle,
.logGroup > .logRow,
.memberRow.hasChildren > .memberLabelCell > .memberLabel,
.hasHeaders .netHrefLabel,
.netPageRow > .netCol > .netPageTitle {
background-image: url(twistyClosed.png);
background-repeat: no-repeat;
background-position: 2px 2px;
min-height: 12px;
}
.logRow-errorMessage > .hasTwisty.opened > .errorTitle,
.logRow-log > .objectBox-array.hasTwisty.opened,
.logRow-spy.opened .spyHead .spyTitle,
.logGroup.opened > .logRow,
.memberRow.hasChildren.opened > .memberLabelCell > .memberLabel,
.nodeBox.highlightOpen > .nodeLabel > .twisty,
.nodeBox.open > .nodeLabel > .twisty,
.netRow.opened > .netCol > .netHrefLabel,
.netPageRow.opened > .netCol > .netPageTitle {
background-image: url(twistyOpen.png);
}
.twisty {
background-position: 4px 4px;
}

BIN
vendor/firebug-lite/skin/xp/infoIcon.gif vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 359 B

BIN
vendor/firebug-lite/skin/xp/infoIcon.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
vendor/firebug-lite/skin/xp/min.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 552 B

BIN
vendor/firebug-lite/skin/xp/minHover.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 485 B

BIN
vendor/firebug-lite/skin/xp/off.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 742 B

BIN
vendor/firebug-lite/skin/xp/offHover.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 680 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg">
<rect fill="white" x="0" y="0" width="100%" height="100%" />
<rect fill="highlight" x="0" y="0" width="100%" height="100%" rx="2px"/>
</svg>

After

Width:  |  Height:  |  Size: 234 B

BIN
vendor/firebug-lite/skin/xp/search.gif vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 550 B

BIN
vendor/firebug-lite/skin/xp/search.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 685 B

BIN
vendor/firebug-lite/skin/xp/shadow.gif vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

BIN
vendor/firebug-lite/skin/xp/shadow2.gif vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Some files were not shown because too many files have changed in this diff Show More