mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-30 06:57:49 +00:00
Compare commits
79 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
064fd497ae | ||
|
|
49c60b6b75 | ||
|
|
ca7f36506c | ||
|
|
155f0a9736 | ||
|
|
25e1eb3ce9 | ||
|
|
f2f980928b | ||
|
|
1d121a97a7 | ||
|
|
211d13da09 | ||
|
|
11343d469e | ||
|
|
d7c8041aa1 | ||
|
|
9587e30af8 | ||
|
|
76fa7affaf | ||
|
|
2971dd8672 | ||
|
|
2a33fe3564 | ||
|
|
46cdf5da70 | ||
|
|
28c801bfd4 | ||
|
|
c22cd40293 | ||
|
|
56bd430983 | ||
|
|
d873890e46 | ||
|
|
d29b8eca3c | ||
|
|
6f258000fe | ||
|
|
255211cd07 | ||
|
|
f6d28a90e3 | ||
|
|
ed66ff88a1 | ||
|
|
82e58f2bf9 | ||
|
|
797a87ca26 | ||
|
|
ec6a709393 | ||
|
|
07cbfdb424 | ||
|
|
3b9bd944fb | ||
|
|
934e585cb3 | ||
|
|
3a68f4cf54 | ||
|
|
bd00fcb875 | ||
|
|
905dd5a70f | ||
|
|
c65250ec39 | ||
|
|
607eec6ff0 | ||
|
|
14fb3bde60 | ||
|
|
6782bc8ca2 | ||
|
|
3db6841305 | ||
|
|
f478fa8029 | ||
|
|
d255f8400f | ||
|
|
a1545c60d6 | ||
|
|
ed48603ab5 | ||
|
|
23a0507439 | ||
|
|
482e013887 | ||
|
|
265727c30f | ||
|
|
4d3f4e096b | ||
|
|
7629bca62d | ||
|
|
2712f17262 | ||
|
|
86a37559ba | ||
|
|
b504a557f4 | ||
|
|
e849b46f6b | ||
|
|
738dc50a6f | ||
|
|
3138523b5b | ||
|
|
537643a4c3 | ||
|
|
04bfe098ed | ||
|
|
c507887bdd | ||
|
|
ee261313ac | ||
|
|
c9c152bc8a | ||
|
|
6c8e19a321 | ||
|
|
218e3b66f2 | ||
|
|
1d3488fa8e | ||
|
|
f4c1682592 | ||
|
|
28ac6623c7 | ||
|
|
16ab179e1d | ||
|
|
a8ff5385dc | ||
|
|
9dc33c6086 | ||
|
|
b17c576705 | ||
|
|
96f8f2891b | ||
|
|
581d73afe0 | ||
|
|
1baefebe8f | ||
|
|
39fb05033f | ||
|
|
c6093c084c | ||
|
|
dfec6d9a6d | ||
|
|
08b1261c75 | ||
|
|
2ad6faae3a | ||
|
|
4eff301db3 | ||
|
|
447e43e8f4 | ||
|
|
7457001275 | ||
|
|
fcabd5e79e |
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
||||
* text=auto
|
||||
@@ -1,9 +1,11 @@
|
||||
.*
|
||||
*.custom.*
|
||||
*.md
|
||||
*.txt
|
||||
build.js
|
||||
index.js
|
||||
build/
|
||||
doc/*.php
|
||||
doc/
|
||||
node_modules/
|
||||
perf/
|
||||
test/
|
||||
|
||||
@@ -15,8 +15,11 @@ vendor/benchmark.js/*.jar
|
||||
vendor/closure-compiler
|
||||
vendor/docdown
|
||||
vendor/firebug-lite/
|
||||
vendor/json3/
|
||||
vendor/jquery/
|
||||
vendor/qunit/qunit/*.css
|
||||
vendor/qunit/qunit/*-1.8.0.js
|
||||
vendor/requirejs/
|
||||
vendor/underscore/*-min.js
|
||||
vendor/uglifyjs
|
||||
vendor/underscore/test/
|
||||
|
||||
@@ -3,5 +3,5 @@ node_js:
|
||||
- 0.6
|
||||
- 0.8
|
||||
before_script:
|
||||
- "curl -H 'Accept: application/vnd.github.v3.raw' https://api.github.com/repos/bestiejs/lodash/git/blobs/aa29a2ecf6f51d4da5a2a418c0d4ea0e368ee80d | tar xvz -C vendor"
|
||||
- "curl -H 'Accept: application/vnd.github.v3.raw' https://api.github.com/repos/bestiejs/lodash/git/blobs/9869c4443fb22598235d1019fcc8245be41e8889 | tar xvz -C vendor"
|
||||
- "curl -H 'Accept: application/vnd.github.v3.raw' https://api.github.com/repos/bestiejs/lodash/git/blobs/a2787b470c577cee2404d186c562dd9835f779f5 | tar xvz -C vendor"
|
||||
- "curl -H 'Accept: application/vnd.github.v3.raw' https://api.github.com/repos/bestiejs/lodash/git/blobs/3390b259e04829538e4d3635d12b317dd6103eca | tar xvz -C vendor"
|
||||
|
||||
92
README.md
92
README.md
@@ -1,4 +1,4 @@
|
||||
# Lo-Dash <sup>v0.9.0</sup>
|
||||
# Lo-Dash <sup>v0.10.0</sup>
|
||||
[](http://travis-ci.org/bestiejs/lodash)
|
||||
|
||||
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).
|
||||
@@ -7,10 +7,10 @@ Lo-Dash’s performance is gained by avoiding slower native methods, instead opt
|
||||
|
||||
## Download
|
||||
|
||||
* [Development build](https://raw.github.com/bestiejs/lodash/v0.9.0/lodash.js)
|
||||
* [Production build](https://raw.github.com/bestiejs/lodash/v0.9.0/lodash.min.js)
|
||||
* [Underscore build](https://raw.github.com/bestiejs/lodash/v0.9.0/lodash.underscore.min.js) tailored for projects already using Underscore
|
||||
* CDN copies of ≤ [v0.9.0](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.9.0/lodash.min.js) are available on [cdnjs](http://cdnjs.com/) thanks to [CloudFlare](http://www.cloudflare.com/)
|
||||
* [Development build](https://raw.github.com/bestiejs/lodash/v0.10.0/lodash.js)
|
||||
* [Production build](https://raw.github.com/bestiejs/lodash/v0.10.0/lodash.min.js)
|
||||
* [Underscore build](https://raw.github.com/bestiejs/lodash/v0.10.0/lodash.underscore.min.js) tailored for projects already using Underscore
|
||||
* CDN copies of ≤ v0.10.0’s [Production](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.10.0/lodash.min.js), [Underscore](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.10.0/lodash.underscore.min.js), and [Development](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.10.0/lodash.js) builds 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
|
||||
|
||||
## Dive in
|
||||
@@ -30,26 +30,28 @@ For more information check out these screencasts over Lo-Dash:
|
||||
* [Lo-Dash’s origin and why it’s a better utility belt](https://vimeo.com/44154600)
|
||||
* [Unit testing in Lo-Dash](https://vimeo.com/45865290)
|
||||
* [Lo-Dash’s approach to native method use](https://vimeo.com/48576012)
|
||||
* [CascadiaJS: Lo-Dash for a better utility belt](http://www.youtube.com/watch?v=dpPy4f_SeEk)
|
||||
|
||||
## Features
|
||||
|
||||
* AMD loader support ([RequireJS](http://requirejs.org/), [curl.js](https://github.com/cujojs/curl), etc.)
|
||||
* [_.clone](http://lodash.com/docs#clone) supports *“deep”* cloning
|
||||
* [_.contains](http://lodash.com/docs#contains) accepts a `fromIndex` argument
|
||||
* [_.forEach](http://lodash.com/docs#forEach) is chainable and supports exiting iteration early
|
||||
* [_.forIn](http://lodash.com/docs#forIn) for iterating over an object’s own and inherited properties
|
||||
* [_.forOwn](http://lodash.com/docs#forOwn) for iterating over an object’s own properties
|
||||
* [_.isPlainObject](http://lodash.com/docs#isPlainObject) checks if values are created by the `Object` constructor
|
||||
* [_.lateBind](http://lodash.com/docs#lateBind) for late binding
|
||||
* [_.bindKey](http://lodash.com/docs#bindKey) for binding [*“lazy”* defined](http://michaux.ca/articles/lazy-function-definition-pattern) methods
|
||||
* [_.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
|
||||
* [_.pick](http://lodash.com/docs#pick) and [_.omit](http://lodash.com/docs#omit) accepts `callback` and `thisArg` arguments
|
||||
* [_.template](http://lodash.com/docs#template) supports [ES6 delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6) and utilizes [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) for easier debugging
|
||||
* [_.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
|
||||
[and more…](http://lodash.com/docs "_.countBy, _.every, _.filter, _.find, _.forEach, _.groupBy, _.invoke, _.map, _.max, _.min, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.some, _.sortBy, _.where") accept strings
|
||||
|
||||
## 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.12, Narwhal 0.3.2, RingoJS 0.8, and Rhino 1.7RC5.
|
||||
Lo-Dash has been tested in at least Chrome 5~23, Firefox 1~16, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.8.14, Narwhal 0.3.2, RingoJS 0.8, and Rhino 1.7RC5.
|
||||
|
||||
## Custom builds
|
||||
|
||||
@@ -61,7 +63,8 @@ To top it off, we handle all method dependency and alias mapping for you.
|
||||
lodash backbone
|
||||
```
|
||||
|
||||
* CSP builds, supporting default Content Security Policy restrictions, may be created using the `csp` modifier argument.
|
||||
* CSP builds, supporting default [Content Security Policy](http://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html) restrictions, may be created using the `csp` modifier argument.
|
||||
The `csp` modifier is an alais of the `mobile` modifier. Chrome extensions will require [sandboxing](http://developer.chrome.com/trunk/extensions/sandboxingEval.html) or the use of either the `csp`, `mobile`, or `underscore` build.
|
||||
```bash
|
||||
lodash csp
|
||||
```
|
||||
@@ -125,14 +128,19 @@ 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
|
||||
* 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
|
||||
* Use the `settings` argument to pass the template settings used when precompiling templates.
|
||||
```bash
|
||||
lodash settings="{interpolate:/\\{\\{([\\s\\S]+?)\\}\\}/g}"
|
||||
```
|
||||
|
||||
* Use the `moduleId` argument to specify the AMD module ID of Lo-Dash, which defaults to “lodash”, used by precompiled templates.
|
||||
```bash
|
||||
lodash moduleId="underscore"
|
||||
```
|
||||
|
||||
All arguments, except `legacy` with `csp` or `mobile`, may be combined.<br>
|
||||
@@ -158,7 +166,7 @@ In browsers:
|
||||
<script src="lodash.js"></script>
|
||||
```
|
||||
|
||||
Using [npm](http://npmjs.org/):
|
||||
Using [`npm`](http://npmjs.org/):
|
||||
|
||||
```bash
|
||||
npm install lodash
|
||||
@@ -167,6 +175,12 @@ npm install -g lodash
|
||||
npm link lodash
|
||||
```
|
||||
|
||||
To avoid potential issues, update `npm` before installing Lo-Dash:
|
||||
|
||||
```bash
|
||||
npm install npm -g
|
||||
```
|
||||
|
||||
In [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/):
|
||||
|
||||
```js
|
||||
@@ -202,36 +216,34 @@ require({
|
||||
|
||||
## Resolved Underscore.js issues
|
||||
|
||||
* Add AMD loader support [[#431](https://github.com/documentcloud/underscore/pull/431), [test](https://github.com/bestiejs/lodash/blob/v0.9.0/test/test.js#L116-138)]
|
||||
* Allow iteration of objects with a `length` property [[#799](https://github.com/documentcloud/underscore/pull/799), [test](https://github.com/bestiejs/lodash/blob/v0.9.0/test/test.js#L508-514)]
|
||||
* 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.9.0/test/test.js#L468-485)]
|
||||
* 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.9.0/test/test.js#L521-545)]
|
||||
* 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.9.0/test/test.js#L140-146)]
|
||||
* `_.clone` should allow `deep` cloning [[#595](https://github.com/documentcloud/underscore/pull/595), [test](https://github.com/bestiejs/lodash/blob/v0.9.0/test/test.js#L212-223)]
|
||||
* `_.contains` should work with strings [[#667](https://github.com/documentcloud/underscore/pull/667), [test](https://github.com/bestiejs/lodash/blob/v0.9.0/test/test.js#L265-274)]
|
||||
* `_.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.9.0/test/test.js#L989-1011)]
|
||||
* `_.forEach` should be chainable [[#142](https://github.com/documentcloud/underscore/issues/142), [test](https://github.com/bestiejs/lodash/blob/v0.9.0/test/test.js#L463-466)]
|
||||
* `_.forEach` should allow exiting iteration early [[#211](https://github.com/documentcloud/underscore/issues/211), [test](https://github.com/bestiejs/lodash/blob/v0.9.0/test/test.js#L551-569)]
|
||||
* `_.isEmpty` should support jQuery/MooTools DOM query collections [[#690](https://github.com/documentcloud/underscore/pull/690), [test](https://github.com/bestiejs/lodash/blob/v0.9.0/test/test.js#L710-715)]
|
||||
* `_.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.9.0/test/test.js#L770-782)]
|
||||
* `_.keys` should work with `arguments` objects cross-browser [[#396](https://github.com/documentcloud/underscore/issues/396), [test](https://github.com/bestiejs/lodash/blob/v0.9.0/test/test.js#L863-865)]
|
||||
* `_.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.9.0/test/test.js#L1264-1267)]
|
||||
* Allow iteration of objects with a `length` property [[#799](https://github.com/documentcloud/underscore/pull/799), [test](https://github.com/bestiejs/lodash/blob/v0.10.0/test/test.js#L590-L596)]
|
||||
* 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.10.0/test/test.js#L603-L627)]
|
||||
* 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.10.0/test/test.js#L140-L146)]
|
||||
* `_.isEmpty` should support jQuery/MooTools DOM query collections [[#690](https://github.com/documentcloud/underscore/pull/690), [test](https://github.com/bestiejs/lodash/blob/v0.10.0/test/test.js#L792-L797)]
|
||||
* `_.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.10.0/test/test.js#L873-L885)]
|
||||
* `_.keys` should work with `arguments` objects cross-browser [[#396](https://github.com/documentcloud/underscore/issues/396), [test](https://github.com/bestiejs/lodash/blob/v0.10.0/test/test.js#L966-L968)]
|
||||
* `_.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.10.0/test/test.js#L1367-L1370)]
|
||||
|
||||
## Release Notes
|
||||
|
||||
### <sup>v0.9.0</sup>
|
||||
### <sup>v0.10.0</sup>
|
||||
|
||||
* Added a `sourceURL` option to `_.template`
|
||||
* Ensured `_.where` returns an empty array if passed an empty `properties` object
|
||||
* Expanded `_.isFinite` to return `true` for numeric strings
|
||||
* Reduced `_.intersection`, `_.omit`, `_.pick`, `_.sortedIndex`, and `_.where`
|
||||
* Reduced the `npm` package file size by only downloading the minifiers for global installs
|
||||
* Reduced Lo-Dash's file size
|
||||
* Removed compilation from `_.bindAll`, `_.contains`, `_.countBy`, `_.every`,
|
||||
`_.filter`, `_.find`, `_.functions`, `_.groupBy`, `_.invert`, `_.invoke`,
|
||||
`_.isEmpty`, `_.map`, `_.merge`, `_.omit`, `_.pairs`, `_.pick`, `_.pluck`,
|
||||
`_.reduce`, `_.reject`, `_.some`, `_.sortBy`, `_.values`, `_.where`, and
|
||||
internal `shimKeys`
|
||||
#### Compatibility Warnings ####
|
||||
|
||||
* Aligned `_.defaults` and `_.extend` with ES6 [Object.assign](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-15.2.3.15)
|
||||
* Renamed `_.lateBind` to `_.bindKey`
|
||||
|
||||
#### Changes ####
|
||||
|
||||
* Added the build commands used to custom build copyright/license headers
|
||||
* Added `_.assign`
|
||||
* Ensured the `underscore` build of `_.find` returns the first, not last, matched value
|
||||
* Ensured `_defaults`, `_.extends`, and `_.merge` works with `_.reduce`
|
||||
* Made Lo-Dash’s `npm` package installation work with more system configurations
|
||||
* Made `_.extend` an alias of `_.assign`
|
||||
* Optimized `_.contains`, `_.defaults`, `_.extend`, and `_.filter`
|
||||
* Restricted `_.where` to iterate only own properties of the `source` object
|
||||
* Updated `backbone` build Lo-Dash method dependencies
|
||||
|
||||
The full changelog is available [here](https://github.com/bestiejs/lodash/wiki/Changelog).
|
||||
|
||||
|
||||
440
build.js
440
build.js
@@ -6,8 +6,8 @@
|
||||
var fs = require('fs'),
|
||||
path = require('path'),
|
||||
vm = require('vm'),
|
||||
minify = require(path.join(__dirname, 'build', 'minify')),
|
||||
_ = require(path.join(__dirname, 'lodash'));
|
||||
minify = require(path.join(__dirname, 'build', 'minify.js')),
|
||||
_ = require(path.join(__dirname, 'lodash.js'));
|
||||
|
||||
/** The current working directory */
|
||||
var cwd = process.cwd();
|
||||
@@ -32,6 +32,7 @@
|
||||
'detect': 'find',
|
||||
'drop': 'rest',
|
||||
'each': 'forEach',
|
||||
'extend': 'assign',
|
||||
'foldl': 'reduce',
|
||||
'foldr': 'reduceRight',
|
||||
'head': 'first',
|
||||
@@ -46,6 +47,7 @@
|
||||
|
||||
/** Used to associate real names with their aliases */
|
||||
var realToAliasMap = {
|
||||
'assign': ['extend'],
|
||||
'contains': ['include'],
|
||||
'every': ['all'],
|
||||
'filter': ['select'],
|
||||
@@ -64,13 +66,15 @@
|
||||
/** Used to track function dependencies */
|
||||
var dependencyMap = {
|
||||
'after': [],
|
||||
'bind': ['isFunction'],
|
||||
'assign': ['isArguments'],
|
||||
'bind': ['isFunction', 'isObject'],
|
||||
'bindAll': ['bind', 'functions'],
|
||||
'bindKey': ['isFunction', 'isObject'],
|
||||
'chain': ['mixin'],
|
||||
'clone': ['extend', 'forEach', 'forOwn', 'isArguments', 'isPlainObject'],
|
||||
'clone': ['assign', 'forEach', 'forOwn', 'isArguments', 'isObject', 'isPlainObject'],
|
||||
'compact': [],
|
||||
'compose': [],
|
||||
'contains': ['indexOf', 'some'],
|
||||
'contains': ['forEach', 'indexOf', 'isString'],
|
||||
'countBy': ['forEach'],
|
||||
'debounce': [],
|
||||
'defaults': ['isArguments'],
|
||||
@@ -78,13 +82,12 @@
|
||||
'delay': [],
|
||||
'difference': ['indexOf'],
|
||||
'escape': [],
|
||||
'every': ['forEach'],
|
||||
'extend': ['isArguments'],
|
||||
'filter': ['forEach'],
|
||||
'find': ['some'],
|
||||
'every': ['forEach', 'isArray'],
|
||||
'filter': ['forEach', 'isArray'],
|
||||
'find': ['forEach'],
|
||||
'first': [],
|
||||
'flatten': ['isArray'],
|
||||
'forEach': ['identity'],
|
||||
'forEach': ['identity', 'isString'],
|
||||
'forIn': ['identity', 'isArguments'],
|
||||
'forOwn': ['identity', 'isArguments'],
|
||||
'functions': ['forIn', 'isFunction'],
|
||||
@@ -113,34 +116,33 @@
|
||||
'isRegExp': [],
|
||||
'isString': [],
|
||||
'isUndefined': [],
|
||||
'keys': ['forOwn', 'isArguments'],
|
||||
'keys': ['forOwn', 'isArguments', 'isObject'],
|
||||
'last': [],
|
||||
'lastIndexOf': [],
|
||||
'lateBind': ['isFunction'],
|
||||
'map': ['forEach', 'isArray'],
|
||||
'max': ['forEach'],
|
||||
'max': ['forEach', 'isArray', 'isString'],
|
||||
'memoize': [],
|
||||
'merge': ['forOwn', 'isArray', 'isPlainObject'],
|
||||
'min': ['forEach'],
|
||||
'min': ['forEach', 'isArray', 'isString'],
|
||||
'mixin': ['forEach', 'functions'],
|
||||
'noConflict': [],
|
||||
'object': [],
|
||||
'omit': ['forIn', 'indexOf'],
|
||||
'once': [],
|
||||
'pairs': ['forOwn'],
|
||||
'partial': ['isFunction'],
|
||||
'partial': ['isFunction', 'isObject'],
|
||||
'pick': ['forIn'],
|
||||
'pluck': ['forEach'],
|
||||
'random': [],
|
||||
'range': [],
|
||||
'reduce': ['forEach'],
|
||||
'reduceRight': ['forEach', 'keys'],
|
||||
'reduceRight': ['forEach', 'isString', 'keys'],
|
||||
'reject': ['filter'],
|
||||
'rest': [],
|
||||
'result': ['isFunction'],
|
||||
'shuffle': ['forEach'],
|
||||
'size': ['keys'],
|
||||
'some': ['forEach'],
|
||||
'some': ['forEach', 'isArray'],
|
||||
'sortBy': ['forEach'],
|
||||
'sortedIndex': ['identity'],
|
||||
'tap': ['mixin'],
|
||||
@@ -149,12 +151,12 @@
|
||||
'times': [],
|
||||
'toArray': ['values'],
|
||||
'unescape': [],
|
||||
'union': ['indexOf'],
|
||||
'union': ['uniq'],
|
||||
'uniq': ['identity', 'indexOf'],
|
||||
'uniqueId': [],
|
||||
'value': ['mixin'],
|
||||
'values': ['forOwn'],
|
||||
'where': ['filter', 'forIn'],
|
||||
'where': ['filter', 'keys'],
|
||||
'without': ['indexOf'],
|
||||
'wrap': [],
|
||||
'zip': ['max', 'pluck']
|
||||
@@ -180,12 +182,15 @@
|
||||
/** List of all Lo-Dash methods */
|
||||
var allMethods = _.keys(dependencyMap);
|
||||
|
||||
/** List Backbone's Lo-Dash dependencies */
|
||||
/** List of Backbone's Lo-Dash dependencies */
|
||||
var backboneDependencies = [
|
||||
'bind',
|
||||
'bindAll',
|
||||
'chain',
|
||||
'clone',
|
||||
'contains',
|
||||
'countBy',
|
||||
'defaults',
|
||||
'escape',
|
||||
'every',
|
||||
'extend',
|
||||
@@ -204,14 +209,15 @@
|
||||
'isFunction',
|
||||
'isObject',
|
||||
'isRegExp',
|
||||
'isString',
|
||||
'keys',
|
||||
'last',
|
||||
'lastIndexOf',
|
||||
'lateBind',
|
||||
'map',
|
||||
'max',
|
||||
'min',
|
||||
'mixin',
|
||||
'pick',
|
||||
'reduce',
|
||||
'reduceRight',
|
||||
'reject',
|
||||
@@ -224,15 +230,16 @@
|
||||
'sortedIndex',
|
||||
'toArray',
|
||||
'uniqueId',
|
||||
'value',
|
||||
'without'
|
||||
];
|
||||
|
||||
/** List of methods used by Underscore */
|
||||
var underscoreMethods = _.without.apply(_, [allMethods].concat([
|
||||
'bindKey',
|
||||
'forIn',
|
||||
'forOwn',
|
||||
'isPlainObject',
|
||||
'lateBind',
|
||||
'merge',
|
||||
'partial'
|
||||
]));
|
||||
@@ -247,6 +254,42 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Adds the given build `commands` to the copyright/license header of `source`.
|
||||
*
|
||||
* @private
|
||||
* @param {String} source The source to process.
|
||||
* @param {Array} [commands=[]] An array of commands.
|
||||
* @returns {String} Returns the modified source.
|
||||
*/
|
||||
function addCommandsToHeader(source, commands) {
|
||||
return source.replace(/(\/\*!\n)( \*)?( *Lo-Dash [0-9.]+)(.*)/, function() {
|
||||
// convert unmatched groups to empty strings
|
||||
var parts = _.map(slice.call(arguments, 1), function(part) {
|
||||
return part || '';
|
||||
});
|
||||
|
||||
// remove `node path/to/build.js` from `commands`
|
||||
if (commands[0] == 'node') {
|
||||
commands.splice(0, 2);
|
||||
}
|
||||
// add quotes to commands with spaces or equals signs
|
||||
commands = _.map(commands, function(command) {
|
||||
var separator = (command.match(/[= ]/) || [''])[0];
|
||||
if (separator) {
|
||||
var pair = command.split(separator);
|
||||
command = pair[0] + separator + '"' + pair[1] + '"';
|
||||
}
|
||||
return command;
|
||||
});
|
||||
// add build commands to copyright/license header
|
||||
return (
|
||||
parts[0] + parts[1] + parts[2] + ' (Custom Build)' + parts[3] + '\n' +
|
||||
parts[1] + ' Build: `lodash ' + commands.join(' ') + '`'
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Compiles template files matched by the given file path `pattern` into a
|
||||
* single source, extending `_.templates` with precompiled templates named after
|
||||
@@ -254,17 +297,14 @@
|
||||
*
|
||||
* @private
|
||||
* @param {String} [pattern='<cwd>/*.jst'] The file path pattern.
|
||||
* @param {Object} [options=_.templateSettings] The options object.
|
||||
* @param {Object} options The options object.
|
||||
* @returns {String} Returns the compiled source.
|
||||
*/
|
||||
function buildTemplate(pattern, options) {
|
||||
pattern || (pattern = path.join(cwd, '*.jst'));
|
||||
options || (options = _.templateSettings);
|
||||
|
||||
var directory = path.dirname(pattern);
|
||||
|
||||
var moduleName = 'lodash';
|
||||
|
||||
var source = [
|
||||
';(function(window) {',
|
||||
" var freeExports = typeof exports == 'object' && exports &&",
|
||||
@@ -295,7 +335,7 @@
|
||||
|
||||
source.push(
|
||||
" if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {",
|
||||
" define(['" + moduleName + "'], function(lodash) {",
|
||||
" define(['" + options.moduleId + "'], function(lodash) {",
|
||||
' lodash.templates = lodash.extend(lodash.templates || {}, templates);',
|
||||
' });',
|
||||
" } else if (freeExports) {",
|
||||
@@ -346,7 +386,7 @@
|
||||
' lodash csp Build supporting default Content Security Policy restrictions',
|
||||
' lodash legacy Build tailored for older browsers without ES5 support',
|
||||
' lodash mobile Build with IE < 9 bug fixes & method compilation removed',
|
||||
' lodash strict Build with `_.bindAll`, `_.defaults`, & `_.extend` in strict mode',
|
||||
' lodash strict Build with `_.assign`, `_.bindAll`, & `_.defaults` in strict mode',
|
||||
' lodash underscore Build tailored for projects already using Underscore',
|
||||
' lodash include=... Comma separated method/category names to include in the build',
|
||||
' lodash minus=... Comma separated method/category names to remove from those included in the build',
|
||||
@@ -362,6 +402,7 @@
|
||||
' (e.g. `lodash template=./*.jst`)',
|
||||
' lodash settings=... Template settings used when precompiling templates',
|
||||
' (e.g. `lodash settings="{interpolate:/\\\\{\\\\{([\\\\s\\\\S]+?)\\\\}\\\\}/g}"`)',
|
||||
' lodash moduleId=... The AMD module ID of Lo-Dash, which defaults to “lodash”, used by precompiled templates',
|
||||
'',
|
||||
' All arguments, except `legacy` with `csp` or `mobile`, may be combined.',
|
||||
' Unless specified by `-o` or `--output`, all files created are saved to the current working directory.',
|
||||
@@ -469,7 +510,7 @@
|
||||
* @returns {String} Returns the `isArguments` fallback.
|
||||
*/
|
||||
function getIsArgumentsFallback(source) {
|
||||
return (source.match(/(?:\s*\/\/.*)*\n( +)if *\(noArgsClass\)[\s\S]+?};\n\1}/) || [''])[0];
|
||||
return (source.match(/(?:\s*\/\/.*)*\n( *)if *\(noArgsClass\)[\s\S]+?};\n\1}/) || [''])[0];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -480,7 +521,7 @@
|
||||
* @returns {String} Returns the `isFunction` fallback.
|
||||
*/
|
||||
function getIsFunctionFallback(source) {
|
||||
return (source.match(/(?:\s*\/\/.*)*\n( +)if *\(isFunction\(\/x\/[\s\S]+?};\n\1}/) || [''])[0];
|
||||
return (source.match(/(?:\s*\/\/.*)*\n( *)if *\(isFunction\(\/x\/[\s\S]+?};\n\1}/) || [''])[0];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -538,11 +579,11 @@
|
||||
// begin non-capturing group
|
||||
'(?:' +
|
||||
// match a function declaration
|
||||
'( +)function ' + funcName + '\\b[\\s\\S]+?\\n\\1}|' +
|
||||
'( *)function ' + funcName + '\\b[\\s\\S]+?\\n\\1}|' +
|
||||
// match a variable declaration with `createIterator`
|
||||
' +var ' + funcName + ' *=.*?createIterator\\((?:{|[a-zA-Z])[\\s\\S]+?\\);|' +
|
||||
// match a variable declaration with function expression
|
||||
'( +)var ' + funcName + ' *=.*?function[\\s\\S]+?\\n\\2};' +
|
||||
'( *)var ' + funcName + ' *=.*?function[\\s\\S]+?\\n\\2};' +
|
||||
// end non-capturing group
|
||||
')\\n'
|
||||
));
|
||||
@@ -617,13 +658,10 @@
|
||||
var modified,
|
||||
snippet = matchFunction(source, funcName);
|
||||
|
||||
// exit early if function is not found
|
||||
if (!snippet) {
|
||||
return source;
|
||||
}
|
||||
// remove function
|
||||
source = source.replace(snippet, '');
|
||||
|
||||
if (snippet) {
|
||||
source = source.replace(snippet, '');
|
||||
}
|
||||
// grab the method assignments snippet
|
||||
snippet = getMethodAssignments(source);
|
||||
|
||||
@@ -728,7 +766,7 @@
|
||||
// match multi-line comment block
|
||||
'(?:\\n +/\\*[^*]*\\*+(?:[^/][^*]*\\*+)*/)?\\n' +
|
||||
// match a variable declaration that's not part of a declaration list
|
||||
'( +)var ' + varName + ' *= *(?:.+?(?:;|&&\\n[^;]+;)|(?:\\w+\\(|{)[\\s\\S]+?\\n\\1.+?;)\\n|' +
|
||||
'( *)var ' + varName + ' *= *(?:.+?(?:;|&&\\n[^;]+;)|(?:\\w+\\(|{)[\\s\\S]+?\\n\\1.+?;)\\n|' +
|
||||
// match a variable in a declaration list
|
||||
'\\n +' + varName + ' *=.+?,'
|
||||
), '');
|
||||
@@ -757,7 +795,7 @@
|
||||
function replaceVar(source, varName, varValue) {
|
||||
// replace a variable that's not part of a declaration list
|
||||
var result = source.replace(RegExp(
|
||||
'(( +)var ' + varName + ' *= *)' +
|
||||
'(( *)var ' + varName + ' *= *)' +
|
||||
'(?:.+?;|(?:Function\\(.+?|.*?[^,])\\n[\\s\\S]+?\\n\\2.+?;)\\n'
|
||||
), '$1' + varValue + ';\n');
|
||||
|
||||
@@ -809,7 +847,7 @@
|
||||
// used to report invalid command-line arguments
|
||||
var invalidArgs = _.reject(options.slice(options[0] == 'node' ? 2 : 0), function(value, index, options) {
|
||||
if (/^(?:-o|--output)$/.test(options[index - 1]) ||
|
||||
/^(?:category|exclude|exports|iife|include|minus|plus|settings|template)=.*$/.test(value)) {
|
||||
/^(?:category|exclude|exports|iife|include|moduleId|minus|plus|settings|template)=.*$/i.test(value)) {
|
||||
return true;
|
||||
}
|
||||
return [
|
||||
@@ -894,7 +932,7 @@
|
||||
// flag used to specify skipping status updates normally logged to the console
|
||||
var isSilent = isStdOut || options.indexOf('-s') > -1 || options.indexOf('--silent') > -1;
|
||||
|
||||
// flag used to specify `_.bindAll`, `_.extend`, and `_.defaults` are
|
||||
// flag used to specify `_.assign`, `_.bindAll`, and `_.defaults` are
|
||||
// constructed using the "use strict" directive
|
||||
var isStrict = options.indexOf('strict') > -1;
|
||||
|
||||
@@ -906,6 +944,12 @@
|
||||
: exportsAll.slice()
|
||||
);
|
||||
|
||||
// used to specify the AMD module ID of Lo-Dash used by precompiled templates
|
||||
var moduleId = options.reduce(function(result, value) {
|
||||
var match = value.match(/moduleId=(.*)/);
|
||||
return match ? match[1] : result;
|
||||
}, 'lodash');
|
||||
|
||||
// used to specify the output path for builds
|
||||
var outputPath = options.reduce(function(result, value, index) {
|
||||
if (/-o|--output/.test(value)) {
|
||||
@@ -929,7 +973,9 @@
|
||||
return match
|
||||
? Function('return {' + match[1].replace(/^{|}$/g, '') + '}')()
|
||||
: result;
|
||||
}, _.clone(_.templateSettings));
|
||||
}, _.assign(_.clone(_.templateSettings), {
|
||||
'moduleId': moduleId
|
||||
}));
|
||||
|
||||
// flag used to specify a template build
|
||||
var isTemplate = !!templatePattern;
|
||||
@@ -941,7 +987,8 @@
|
||||
var useUnderscoreClone = isUnderscore;
|
||||
|
||||
// flags used to specify exposing Lo-Dash methods in an Underscore build
|
||||
var exposeForIn = !isUnderscore,
|
||||
var exposeAssign = !isUnderscore,
|
||||
exposeForIn = !isUnderscore,
|
||||
exposeForOwn = !isUnderscore,
|
||||
exposeIsPlainObject = !isUnderscore;
|
||||
|
||||
@@ -963,17 +1010,6 @@
|
||||
: accumulator;
|
||||
}, []);
|
||||
|
||||
// update dependencies
|
||||
if (isUnderscore) {
|
||||
dependencyMap.isEqual = ['isArray', 'isFunction'];
|
||||
dependencyMap.isEmpty = ['isArray', 'isString'];
|
||||
dependencyMap.pick = [];
|
||||
dependencyMap.template = ['defaults', 'escape'];
|
||||
|
||||
if (useUnderscoreClone) {
|
||||
dependencyMap.clone = ['extend', 'isArray'];
|
||||
}
|
||||
}
|
||||
// add method names explicitly
|
||||
options.some(function(value) {
|
||||
return /include/.test(value) &&
|
||||
@@ -981,12 +1017,30 @@
|
||||
});
|
||||
|
||||
// include Lo-Dash's methods if explicitly requested
|
||||
if (result) {
|
||||
if (isUnderscore && result) {
|
||||
exposeAssign = result.indexOf('assign') > -1;
|
||||
exposeForIn = result.indexOf('forIn') > -1;
|
||||
exposeForOwn = result.indexOf('forOwn') > -1;
|
||||
exposeIsPlainObject = result.indexOf('isPlainObject') > -1;
|
||||
useUnderscoreClone = result.indexOf('clone') < 0;
|
||||
}
|
||||
// update dependencies
|
||||
if (isMobile) {
|
||||
dependencyMap.reduceRight = ['forEach', 'keys'];
|
||||
}
|
||||
if (isUnderscore) {
|
||||
dependencyMap.contains = ['forEach', 'indexOf'];
|
||||
dependencyMap.isEqual = ['isArray', 'isFunction'];
|
||||
dependencyMap.isEmpty = ['isArray', 'isString'];
|
||||
dependencyMap.max = ['forEach', 'isArray'];
|
||||
dependencyMap.min = ['forEach', 'isArray'];
|
||||
dependencyMap.pick = [];
|
||||
dependencyMap.template = ['defaults', 'escape'];
|
||||
|
||||
if (useUnderscoreClone) {
|
||||
dependencyMap.clone = ['assign', 'isArray'];
|
||||
}
|
||||
}
|
||||
// add method names required by Backbone and Underscore builds
|
||||
if (isBackbone && !result) {
|
||||
result = getDependencies(backboneDependencies);
|
||||
@@ -1051,17 +1105,33 @@
|
||||
|
||||
// replace `_.clone`
|
||||
if (useUnderscoreClone) {
|
||||
source = source.replace(/^( +)function clone[\s\S]+?\n\1}/m, [
|
||||
source = source.replace(/^( *)function clone[\s\S]+?\n\1}/m, [
|
||||
' function clone(value) {',
|
||||
' return value && objectTypes[typeof value]',
|
||||
' ? (isArray(value) ? slice.call(value) : extend({}, value))',
|
||||
' ? (isArray(value) ? slice.call(value) : assign({}, value))',
|
||||
' : value',
|
||||
' }'
|
||||
].join('\n'));
|
||||
}
|
||||
|
||||
// replace `_.contains`
|
||||
source = source.replace(/^( *)function contains[\s\S]+?\n\1}/m, [
|
||||
' function contains(collection, target) {',
|
||||
' var length = collection ? collection.length : 0,',
|
||||
' result = false;',
|
||||
" if (typeof length == 'number') {",
|
||||
' result = indexOf(collection, target) > -1;',
|
||||
' } else {',
|
||||
' forEach(collection, function(value) {',
|
||||
' return (result = value === target) && indicatorObject;',
|
||||
' });',
|
||||
' }',
|
||||
' return result;',
|
||||
' }'
|
||||
].join('\n'));
|
||||
|
||||
// replace `_.difference`
|
||||
source = source.replace(/^( +)function difference[\s\S]+?\n\1}/m, [
|
||||
source = source.replace(/^( *)function difference[\s\S]+?\n\1}/m, [
|
||||
' function difference(array) {',
|
||||
' var index = -1,',
|
||||
' length = array.length,',
|
||||
@@ -1078,8 +1148,46 @@
|
||||
' }'
|
||||
].join('\n'));
|
||||
|
||||
// replace `_.assign`
|
||||
source = source.replace(/^( *)var assign *= *createIterator[\s\S]+?\);/m, [
|
||||
' function assign(object) {',
|
||||
' if (!object) {',
|
||||
' return object;',
|
||||
' }',
|
||||
' for (var argsIndex = 1, argsLength = arguments.length; argsIndex < argsLength; argsIndex++) {',
|
||||
' var iteratee = arguments[argsIndex];',
|
||||
' if (iteratee) {',
|
||||
' for (var key in iteratee) {',
|
||||
' object[key] = iteratee[key];',
|
||||
' }',
|
||||
' }',
|
||||
' }',
|
||||
' return object;',
|
||||
' }'
|
||||
].join('\n'));
|
||||
|
||||
// replace `_.defaults`
|
||||
source = source.replace(/^( *)var defaults *= *createIterator[\s\S]+?\);/m, [
|
||||
' function defaults(object) {',
|
||||
' if (!object) {',
|
||||
' return object;',
|
||||
' }',
|
||||
' for (var argsIndex = 1, argsLength = arguments.length; argsIndex < argsLength; argsIndex++) {',
|
||||
' var iteratee = arguments[argsIndex];',
|
||||
' if (iteratee) {',
|
||||
' for (var key in iteratee) {',
|
||||
' if (object[key] == null) {',
|
||||
' object[key] = iteratee[key];',
|
||||
' }',
|
||||
' }',
|
||||
' }',
|
||||
' }',
|
||||
' return object;',
|
||||
' }'
|
||||
].join('\n'));
|
||||
|
||||
// replace `_.intersection`
|
||||
source = source.replace(/^( +)function intersection[\s\S]+?\n\1}/m, [
|
||||
source = source.replace(/^( *)function intersection[\s\S]+?\n\1}/m, [
|
||||
' function intersection(array) {',
|
||||
' var args = arguments,',
|
||||
' argsLength = args.length,',
|
||||
@@ -1101,7 +1209,7 @@
|
||||
].join('\n'));
|
||||
|
||||
// replace `_.isEmpty`
|
||||
source = source.replace(/^( +)function isEmpty[\s\S]+?\n\1}/m, [
|
||||
source = source.replace(/^( *)function isEmpty[\s\S]+?\n\1}/m, [
|
||||
' function isEmpty(value) {',
|
||||
' if (!value) {',
|
||||
' return true;',
|
||||
@@ -1118,8 +1226,15 @@
|
||||
' }'
|
||||
].join('\n'));
|
||||
|
||||
// replace `_.isFinite`
|
||||
source = source.replace(/^( *)function isFinite[\s\S]+?\n\1}/m, [
|
||||
' function isFinite(value) {',
|
||||
' return nativeIsFinite(value) && toString.call(value) == numberClass;',
|
||||
' }'
|
||||
].join('\n'));
|
||||
|
||||
// replace `_.omit`
|
||||
source = source.replace(/^( +)function omit[\s\S]+?\n\1}/m, [
|
||||
source = source.replace(/^( *)function omit[\s\S]+?\n\1}/m, [
|
||||
' function omit(object) {',
|
||||
' var props = concat.apply(arrayRef, arguments),',
|
||||
' result = {};',
|
||||
@@ -1134,7 +1249,7 @@
|
||||
].join('\n'));
|
||||
|
||||
// replace `_.pick`
|
||||
source = source.replace(/^( +)function pick[\s\S]+?\n\1}/m, [
|
||||
source = source.replace(/^( *)function pick[\s\S]+?\n\1}/m, [
|
||||
' function pick(object) {',
|
||||
' var index = 0,',
|
||||
' props = concat.apply(arrayRef, arguments),',
|
||||
@@ -1151,8 +1266,91 @@
|
||||
' }'
|
||||
].join('\n'));
|
||||
|
||||
// replace `_.template`
|
||||
source = source.replace(/^( *)function template[\s\S]+?\n\1}/m, function() {
|
||||
return [
|
||||
' function template(text, data, options) {',
|
||||
" text || (text = '');",
|
||||
' options = defaults({}, options, lodash.templateSettings);',
|
||||
'',
|
||||
' var index = 0,',
|
||||
' source = "__p += \'",',
|
||||
' variable = options.variable;',
|
||||
'',
|
||||
' var reDelimiters = RegExp(',
|
||||
" (options.escape || reNoMatch).source + '|' +",
|
||||
" (options.interpolate || reNoMatch).source + '|' +",
|
||||
" (options.evaluate || reNoMatch).source + '|$'",
|
||||
" , 'g');",
|
||||
'',
|
||||
' text.replace(reDelimiters, function(match, escapeValue, interpolateValue, evaluateValue, offset) {',
|
||||
' source += text.slice(index, offset).replace(reUnescapedString, escapeStringChar);',
|
||||
' source +=',
|
||||
' escapeValue ? "\' +\\n_.escape(" + escapeValue + ") +\\n\'" :',
|
||||
' evaluateValue ? "\';\\n" + evaluateValue + ";\\n__p += \'" :',
|
||||
' interpolateValue ? "\' +\\n((__t = (" + interpolateValue + ")) == null ? \'\' : __t) +\\n\'" : \'\';',
|
||||
'',
|
||||
' index = offset + match.length;',
|
||||
' });',
|
||||
'',
|
||||
' source += "\';\\n";',
|
||||
' if (!variable) {',
|
||||
" variable = 'obj';",
|
||||
" source = 'with (' + variable + ' || {}) {\\n' + source + '\\n}\\n';",
|
||||
' }',
|
||||
" source = 'function(' + variable + ') {\\n' +",
|
||||
" 'var __t, __p = \\'\\', __j = Array.prototype.join;\\n' +",
|
||||
" 'function print() { __p += __j.call(arguments, \\'\\') }\\n' +",
|
||||
' source +',
|
||||
" 'return __p\\n}';",
|
||||
'',
|
||||
' try {',
|
||||
" var result = Function('_', 'return ' + source)(lodash);",
|
||||
' } catch(e) {',
|
||||
' e.source = source;',
|
||||
' throw e;',
|
||||
' }',
|
||||
' if (data) {',
|
||||
' return result(data);',
|
||||
' }',
|
||||
' result.source = source;',
|
||||
' return result;',
|
||||
' }'
|
||||
].join('\n');
|
||||
});
|
||||
|
||||
// replace `_.uniq`
|
||||
source = source.replace(/^( *)function uniq[\s\S]+?\n\1}/m, [
|
||||
' function uniq(array, isSorted, callback, thisArg) {',
|
||||
' var index = -1,',
|
||||
' length = array ? array.length : 0,',
|
||||
' result = [],',
|
||||
' seen = result;',
|
||||
'',
|
||||
' if (callback) {',
|
||||
' seen = [];',
|
||||
' callback = createCallback(callback, thisArg);',
|
||||
' }',
|
||||
' while (++index < length) {',
|
||||
' var value = array[index],',
|
||||
' computed = callback ? callback(value, index, array) : value;',
|
||||
'',
|
||||
' if (isSorted',
|
||||
' ? !index || seen[seen.length - 1] !== computed',
|
||||
' : indexOf(seen, computed) < 0',
|
||||
' ) {',
|
||||
' if (callback) {',
|
||||
' seen.push(computed);',
|
||||
' }',
|
||||
' result.push(value);',
|
||||
' }',
|
||||
' }',
|
||||
' return result;',
|
||||
' }'
|
||||
].join('\n'));
|
||||
|
||||
// replace `_.without`
|
||||
source = source.replace(/^( +)function without[\s\S]+?\n\1}/m, [
|
||||
source = source.replace(/^( *)function without[\s\S]+?\n\1}/m, [
|
||||
' function without(array) {',
|
||||
' var index = -1,',
|
||||
' length = array.length,',
|
||||
@@ -1168,8 +1366,12 @@
|
||||
' }'
|
||||
].join('\n'));
|
||||
|
||||
// remove string support from `_.contains`
|
||||
source = source.replace(/return *\(toString\.call.+?stringClass[\s\S]+?;/, 'return indexOf(collection, target) > -1;');
|
||||
// remove unneeded template related variables
|
||||
source = removeVar(source, 'reComplexDelimiter');
|
||||
source = removeVar(source, 'reEmptyStringLeading');
|
||||
source = removeVar(source, 'reEmptyStringMiddle');
|
||||
source = removeVar(source, 'reEmptyStringTrailing');
|
||||
source = removeVar(source, 'reInsertVariable');
|
||||
|
||||
// remove `arguments` object check from `_.isEqual`
|
||||
source = source.replace(/ *\|\| *className *== *argsClass/, '');
|
||||
@@ -1177,10 +1379,8 @@
|
||||
// simplify DOM node check from `_.isEqual`
|
||||
source = source.replace(/(if *\(className *!= *objectClass).+?noNodeClass[\s\S]+?{/, '$1) {');
|
||||
|
||||
// remove arguments juggling from `_.uniq`
|
||||
source = source.replace(matchFunction(source, 'uniq'), function(match) {
|
||||
return match.replace(/(?: *\/\/.*\n)*( +)if *\(typeof isSorted[^}]+?}\n/, '');
|
||||
});
|
||||
// remove conditional `charCodeCallback` use from `_.max` and `_.min`
|
||||
source = source.replace(/!callback *&& *isString\(collection\)[\s\S]+?: */g, '');
|
||||
|
||||
// remove unused features from `createBound`
|
||||
if (buildMethods.indexOf('partial') == -1) {
|
||||
@@ -1196,7 +1396,7 @@
|
||||
source = removeKeysOptimization(source);
|
||||
|
||||
// remove `prototype` [[Enumerable]] fix from `_.keys`
|
||||
source = source.replace(/(?:\s*\/\/.*)*\n( +)if *\(.+?propertyIsEnumerable[\s\S]+?\n\1}/, '');
|
||||
source = source.replace(/(?:\s*\/\/.*)*(\s*return *).+?propertyIsEnumerable[\s\S]+?: */, '$1');
|
||||
|
||||
// remove `prototype` [[Enumerable]] fix from `iteratorTemplate`
|
||||
source = source
|
||||
@@ -1296,11 +1496,14 @@
|
||||
});
|
||||
|
||||
if (isUnderscore) {
|
||||
// remove `_.forIn`, `_.forOwn`, and `_.isPlainObject` assignments
|
||||
// remove `_.assign`, `_.forIn`, `_.forOwn`, and `_.isPlainObject` assignments
|
||||
(function() {
|
||||
var snippet = getMethodAssignments(source),
|
||||
modified = snippet;
|
||||
|
||||
if (!exposeAssign) {
|
||||
modified = modified.replace(/(?:\n *\/\/.*\s*)* *lodash\.assign *= *.+\n/, '');
|
||||
}
|
||||
if (!exposeForIn) {
|
||||
modified = modified.replace(/(?:\n *\/\/.*\s*)* *lodash\.forIn *= *.+\n/, '');
|
||||
}
|
||||
@@ -1327,6 +1530,11 @@
|
||||
});
|
||||
}());
|
||||
|
||||
// remove chainability from `_.forEach`
|
||||
source = source.replace(matchFunction(source, 'forEach'), function(match) {
|
||||
return match.replace(/return result([};\s]+)$/, '$1');
|
||||
});
|
||||
|
||||
// unexpose "exit early" feature from `_.forEach`, `_.forIn`, and `_.forOwn`
|
||||
_.each(['forEach', 'forIn', 'forOwn'], function(methodName) {
|
||||
source = source.replace(matchFunction(source, methodName), function(match) {
|
||||
@@ -1334,81 +1542,25 @@
|
||||
});
|
||||
});
|
||||
|
||||
// modify `_.every` and `_.some` to use the private `indicatorObject`
|
||||
// modify `_.every`, `_.find`, and `_.some` to use the private `indicatorObject`
|
||||
source = source.replace(matchFunction(source, 'every'), function(match) {
|
||||
return match.replace(/\(result *= *(.+?)\);/, '!(result = $1) && indicatorObject;');
|
||||
});
|
||||
|
||||
source = source.replace(matchFunction(source, 'find'), function(match) {
|
||||
return match.replace(/return false/, 'return indicatorObject');
|
||||
});
|
||||
|
||||
source = source.replace(matchFunction(source, 'some'), function(match) {
|
||||
return match.replace(/!\(result *= *(.+?)\);/, '(result = $1) && indicatorObject;');
|
||||
});
|
||||
|
||||
// replace `_.template`
|
||||
source = source.replace(/^( +)function template[\s\S]+?\n\1}/m, function() {
|
||||
return [
|
||||
' function template(text, data, options) {',
|
||||
" text || (text = '');",
|
||||
' options = defaults({}, options, lodash.templateSettings);',
|
||||
'',
|
||||
' var index = 0,',
|
||||
' source = "__p += \'",',
|
||||
" variable = options.variable;",
|
||||
'',
|
||||
' var reDelimiters = RegExp(',
|
||||
" (options.escape || reNoMatch).source + '|' +",
|
||||
" (options.interpolate || reNoMatch).source + '|' +",
|
||||
" (options.evaluate || reNoMatch).source + '|$'",
|
||||
" , 'g');",
|
||||
'',
|
||||
' text.replace(reDelimiters, function(match, escapeValue, interpolateValue, evaluateValue, offset) {',
|
||||
' source += text.slice(index, offset).replace(reUnescapedString, escapeStringChar);',
|
||||
' source +=',
|
||||
' escapeValue ? "\' +\\n_.escape(" + escapeValue + ") +\\n\'" :',
|
||||
' evaluateValue ? "\';\\n" + evaluateValue + ";\\n__p += \'" :',
|
||||
' interpolateValue ? "\' +\\n((__t = (" + interpolateValue + ")) == null ? \'\' : __t) +\\n\'" : \'\';',
|
||||
'',
|
||||
' index = offset + match.length;',
|
||||
' });',
|
||||
'',
|
||||
' source += "\';\\n";',
|
||||
' if (!variable) {',
|
||||
" variable = 'obj';",
|
||||
" source = 'with (' + variable + ' || {}) {\\n' + source + '\\n}\\n';",
|
||||
' }',
|
||||
" source = 'function(' + variable + ') {\\n' +",
|
||||
" 'var __t, __p = \\'\\', __j = Array.prototype.join;\\n' +",
|
||||
" 'function print() { __p += __j.call(arguments, \\'\\') }\\n' +",
|
||||
' source +',
|
||||
" 'return __p\\n}';",
|
||||
'',
|
||||
' try {',
|
||||
" var result = Function('_', 'return ' + source)(lodash);",
|
||||
' } catch(e) {',
|
||||
' e.source = source;',
|
||||
' throw e;',
|
||||
' }',
|
||||
' if (data) {',
|
||||
' return result(data);',
|
||||
' }',
|
||||
' result.source = source;',
|
||||
' return result;',
|
||||
' }'
|
||||
].join('\n');
|
||||
});
|
||||
|
||||
// remove unneeded template related variables
|
||||
source = removeVar(source, 'reComplexDelimiter');
|
||||
source = removeVar(source, 'reEmptyStringLeading');
|
||||
source = removeVar(source, 'reEmptyStringMiddle');
|
||||
source = removeVar(source, 'reEmptyStringTrailing');
|
||||
source = removeVar(source, 'reInsertVariable');
|
||||
}
|
||||
else {
|
||||
source = removeIsArgumentsFallback(source);
|
||||
source = removeVar(source, 'hasObjectSpliceBug');
|
||||
|
||||
// remove `hasObjectSpliceBug` fix from the mutator Array functions mixin
|
||||
source = source.replace(/(?:\s*\/\/.*)*\n( +)if *\(hasObjectSpliceBug[\s\S]+?\n\1}/, '');
|
||||
source = source.replace(/(?:\s*\/\/.*)*\n( *)if *\(hasObjectSpliceBug[\s\S]+?\n\1}/, '');
|
||||
}
|
||||
|
||||
// remove `thisArg` from unexposed `forIn` and `forOwn`
|
||||
@@ -1429,10 +1581,10 @@
|
||||
.replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *var (?:hasDontEnumBug|iteratesOwnLast|noArgsEnum).+\n/g, '');
|
||||
|
||||
// remove `iteratesOwnLast` from `isPlainObject`
|
||||
source = source.replace(/(?:\s*\/\/.*)*\n( +)if *\(iteratesOwnLast[\s\S]+?\n\1}/, '');
|
||||
source = source.replace(/(?:\s*\/\/.*)*\n( *)if *\(iteratesOwnLast[\s\S]+?\n\1}/, '');
|
||||
|
||||
// remove JScript [[DontEnum]] fix from `_.isEqual`
|
||||
source = source.replace(/(?:\s*\/\/.*)*\n( +)if *\(hasDontEnumBug[\s\S]+?\n\1}/, '');
|
||||
source = source.replace(/(?:\s*\/\/.*)*\n( *)if *\(hasDontEnumBug[\s\S]+?\n\1}/, '');
|
||||
|
||||
// remove `noArraySliceOnStrings` from `_.toArray`
|
||||
source = source.replace(/noArraySliceOnStrings *\?[^:]+: *([^)]+)/g, '$1');
|
||||
@@ -1449,7 +1601,7 @@
|
||||
}
|
||||
else {
|
||||
// inline `iteratorTemplate` template
|
||||
source = source.replace(/(( +)var iteratorTemplate *= *)[\s\S]+?\n\2.+?;\n/, (function() {
|
||||
source = source.replace(/(( *)var iteratorTemplate *= *)[\s\S]+?\n\2.+?;\n/, (function() {
|
||||
var snippet = getFunctionSource(lodash._iteratorTemplate);
|
||||
|
||||
// prepend data object references to property names to avoid having to
|
||||
@@ -1509,16 +1661,16 @@
|
||||
isNode = exportsOptions.indexOf('node') > -1;
|
||||
|
||||
if (!isAMD) {
|
||||
source = source.replace(/(?: *\/\/.*\n)*( +)if *\(typeof +define[\s\S]+?else /, '$1');
|
||||
source = source.replace(/(?: *\/\/.*\n)*( *)if *\(typeof +define[\s\S]+?else /, '$1');
|
||||
}
|
||||
if (!isNode) {
|
||||
source = source.replace(/(?: *\/\/.*\n)*( +)if *\(typeof +module[\s\S]+?else *{([\s\S]+?\n)\1}\n/, '$1$2');
|
||||
source = source.replace(/(?: *\/\/.*\n)*( *)if *\(typeof +module[\s\S]+?else *{([\s\S]+?\n)\1}\n/, '$1$2');
|
||||
}
|
||||
if (!isCommonJS) {
|
||||
source = source.replace(/(?: *\/\/.*\n)*(?:( +)else *{)?\s*freeExports\.\w+ *=[\s\S]+?(?:\n\1})?\n/, '');
|
||||
source = source.replace(/(?: *\/\/.*\n)*(?:( *)else *{)?\s*freeExports\.\w+ *=[\s\S]+?(?:\n\1})?\n/, '');
|
||||
}
|
||||
if (!isGlobal) {
|
||||
source = source.replace(/(?:( +)(})? *else(?: *if *\(_\))? *{)?(?:\s*\/\/.*)*\s*(?:window\._|_\.templates) *=[\s\S]+?(?:\n\1})?\n/g, '$1$2\n');
|
||||
source = source.replace(/(?:( *)(})? *else(?: *if *\(_\))? *{)?(?:\s*\/\/.*)*\s*(?:window\._|_\.templates) *=[\s\S]+?(?:\n\1})?\n/g, '$1$2\n');
|
||||
}
|
||||
// remove `if (freeExports) {...}` if it's empty
|
||||
if (isAMD && isGlobal) {
|
||||
@@ -1631,6 +1783,9 @@
|
||||
|
||||
// output debug build
|
||||
if (!isMinify && (isCustom || isDebug || isTemplate)) {
|
||||
if (isCustom) {
|
||||
debugSource = addCommandsToHeader(debugSource, options);
|
||||
}
|
||||
if (isDebug && isStdOut) {
|
||||
stdout.write(debugSource);
|
||||
callback(debugSource);
|
||||
@@ -1651,6 +1806,9 @@
|
||||
if (isStrict) {
|
||||
source = source.replace(/^([\s\S]*?function[^{]+{)([^'"])/, '$1"use strict";$2');
|
||||
}
|
||||
if (isCustom) {
|
||||
source = addCommandsToHeader(source, options);
|
||||
}
|
||||
if (isStdOut) {
|
||||
stdout.write(source);
|
||||
callback(source);
|
||||
|
||||
220
build/minify.js
220
build/minify.js
@@ -15,15 +15,18 @@
|
||||
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');
|
||||
var preprocess = require('./pre-compile.js'),
|
||||
postprocess = require('./post-compile.js'),
|
||||
uglifyJS = require('../vendor/uglifyjs/uglify-js.js');
|
||||
|
||||
/** The Closure Compiler command-line options */
|
||||
var closureOptions = [
|
||||
'--compilation_level=ADVANCED_OPTIMIZATIONS',
|
||||
'--warning_level=QUIET'
|
||||
];
|
||||
var closureOptions = ['--warning_level=QUIET'];
|
||||
|
||||
/** The Closure Compiler optimization modes */
|
||||
var optimizationModes = {
|
||||
'simple': 'SIMPLE_OPTIMIZATIONS',
|
||||
'advanced': 'ADVANCED_OPTIMIZATIONS'
|
||||
};
|
||||
|
||||
/** Reassign `existsSync` for older versions of Node */
|
||||
fs.existsSync || (fs.existsSync = path.existsSync);
|
||||
@@ -97,9 +100,10 @@
|
||||
options = source || options;
|
||||
source = options.source || '';
|
||||
}
|
||||
this.compiled = {};
|
||||
this.hybrid = {};
|
||||
this.compiled = { 'simple': {}, 'advanced': {} };
|
||||
this.hybrid = { 'simple': {}, 'advanced': {} };
|
||||
this.uglified = {};
|
||||
|
||||
this.isSilent = !!options.isSilent;
|
||||
this.isTemplate = !!options.isTemplate;
|
||||
this.outputPath = options.outputPath;
|
||||
@@ -112,7 +116,7 @@
|
||||
};
|
||||
|
||||
// begin the minification process
|
||||
closureCompile.call(this, source, onClosureCompile.bind(this));
|
||||
closureCompile.call(this, source, 'simple', onClosureSimpleCompile.bind(this));
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
@@ -123,33 +127,21 @@
|
||||
*
|
||||
* @private
|
||||
* @param {String} source The JavaScript source to minify.
|
||||
* @param {String} [message] The message to log.
|
||||
* @param {String} mode The optimization mode.
|
||||
* @param {Function} callback The function called once the process has completed.
|
||||
*/
|
||||
function closureCompile(source, message, callback) {
|
||||
var options = closureOptions.slice();
|
||||
|
||||
function closureCompile(source, mode, callback) {
|
||||
// use simple optimizations when minifying template files
|
||||
if (this.isTemplate) {
|
||||
options = options.map(function(value) {
|
||||
return value.replace(/^(--compilation_level)=.+$/, '$1=SIMPLE_OPTIMIZATIONS');
|
||||
});
|
||||
}
|
||||
var options = closureOptions.slice();
|
||||
options.push('--compilation_level=' + optimizationModes[this.isTemplate ? 'simple' : mode]);
|
||||
|
||||
// the standard error stream, standard output stream, and the 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
|
||||
);
|
||||
console.log('Compressing ' + path.basename(this.outputPath, '.js') + ' using the Closure Compiler (' + mode + ')...');
|
||||
}
|
||||
compiler.stdout.on('data', function(data) {
|
||||
// append the data to the output stream
|
||||
@@ -162,9 +154,8 @@
|
||||
});
|
||||
|
||||
compiler.on('exit', function(status) {
|
||||
var exception = null;
|
||||
|
||||
// `status` contains the process exit code
|
||||
var exception = null;
|
||||
if (status) {
|
||||
exception = new Error(error);
|
||||
exception.status = status;
|
||||
@@ -183,24 +174,16 @@
|
||||
*
|
||||
* @private
|
||||
* @param {String} source The JavaScript source to minify.
|
||||
* @param {String} [message] The message to log.
|
||||
* @param {String} label The label to log.
|
||||
* @param {Function} callback The function called once the process has completed.
|
||||
*/
|
||||
function uglify(source, message, callback) {
|
||||
function uglify(source, label, 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
|
||||
);
|
||||
console.log('Compressing ' + path.basename(this.outputPath, '.js') + ' using ' + label + '...');
|
||||
}
|
||||
try {
|
||||
result = ugly.gen_code(
|
||||
@@ -225,44 +208,79 @@
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* The `closureCompile()` callback.
|
||||
* The Closure Compiler callback for simple optimizations.
|
||||
*
|
||||
* @private
|
||||
* @param {Object|Undefined} exception The error object.
|
||||
* @param {String} result The resulting minified source.
|
||||
*/
|
||||
function onClosureCompile(exception, result) {
|
||||
function onClosureSimpleCompile(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));
|
||||
result = postprocess(result);
|
||||
this.compiled.simple.source = result;
|
||||
gzip(result, onClosureSimpleGzip.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
* The Closure Compiler `gzip` callback.
|
||||
* The Closure Compiler `gzip` callback for simple optimizations.
|
||||
*
|
||||
* @private
|
||||
* @param {Object|Undefined} exception The error object.
|
||||
* @param {Buffer} result The resulting gzipped source.
|
||||
*/
|
||||
function onClosureGzip(exception, result) {
|
||||
function onClosureSimpleGzip(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;
|
||||
this.compiled.simple.gzip = result;
|
||||
|
||||
// next, minify the source using only UglifyJS
|
||||
uglify.call(this, this.source, onUglify.bind(this));
|
||||
// next, compile the source using advanced optimizations
|
||||
closureCompile.call(this, this.source, 'advanced', onClosureAdvancedCompile.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
* The `uglify()` callback.
|
||||
* The Closure Compiler callback for advanced optimizations.
|
||||
*
|
||||
* @private
|
||||
* @param {Object|Undefined} exception The error object.
|
||||
* @param {String} result The resulting minified source.
|
||||
*/
|
||||
function onClosureAdvancedCompile(exception, result) {
|
||||
if (exception) {
|
||||
throw exception;
|
||||
}
|
||||
result = postprocess(result);
|
||||
this.compiled.advanced.source = result;
|
||||
gzip(result, onClosureAdvancedGzip.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
* The Closure Compiler `gzip` callback for advanced optimizations.
|
||||
*
|
||||
* @private
|
||||
* @param {Object|Undefined} exception The error object.
|
||||
* @param {Buffer} result The resulting gzipped source.
|
||||
*/
|
||||
function onClosureAdvancedGzip(exception, result) {
|
||||
if (exception) {
|
||||
throw exception;
|
||||
}
|
||||
if (!this.isSilent) {
|
||||
console.log('Done. Size: %d bytes.', result.length);
|
||||
}
|
||||
this.compiled.advanced.gzip = result;
|
||||
|
||||
// next, minify the source using only UglifyJS
|
||||
uglify.call(this, this.source, 'UglifyJS', onUglify.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
* The UglifyJS callback.
|
||||
*
|
||||
* @private
|
||||
* @param {Object|Undefined} exception The error object.
|
||||
@@ -272,8 +290,8 @@
|
||||
if (exception) {
|
||||
throw exception;
|
||||
}
|
||||
// store the post-processed Uglified result and gzip it
|
||||
this.uglified.source = result = postprocess(result);
|
||||
result = postprocess(result);
|
||||
this.uglified.source = result;
|
||||
gzip(result, onUglifyGzip.bind(this));
|
||||
}
|
||||
|
||||
@@ -291,74 +309,112 @@
|
||||
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));
|
||||
// next, minify the already Closure Compiler simple optimized source using UglifyJS
|
||||
uglify.call(this, this.compiled.simple.source, 'hybrid (simple)', onSimpleHybrid.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
* The hybrid `uglify()` callback.
|
||||
* The hybrid callback for simple optimizations.
|
||||
*
|
||||
* @private
|
||||
* @param {Object|Undefined} exception The error object.
|
||||
* @param {String} result The resulting minified source.
|
||||
*/
|
||||
function onHybrid(exception, result) {
|
||||
function onSimpleHybrid(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));
|
||||
result = postprocess(result);
|
||||
this.hybrid.simple.source = result;
|
||||
gzip(result, onSimpleHybridGzip.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
* The hybrid `gzip` callback.
|
||||
* The hybrid `gzip` callback for simple optimizations.
|
||||
*
|
||||
* @private
|
||||
* @param {Object|Undefined} exception The error object.
|
||||
* @param {Buffer} result The resulting gzipped source.
|
||||
*/
|
||||
function onHybridGzip(exception, result) {
|
||||
function onSimpleHybridGzip(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;
|
||||
this.hybrid.simple.gzip = result;
|
||||
|
||||
// next, minify the already Closure Compiler advance optimized source using UglifyJS
|
||||
uglify.call(this, this.compiled.advanced.source, 'hybrid (advanced)', onAdvancedHybrid.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
* The hybrid callback for advanced optimizations.
|
||||
*
|
||||
* @private
|
||||
* @param {Object|Undefined} exception The error object.
|
||||
* @param {String} result The resulting minified source.
|
||||
*/
|
||||
function onAdvancedHybrid(exception, result) {
|
||||
if (exception) {
|
||||
throw exception;
|
||||
}
|
||||
result = postprocess(result);
|
||||
this.hybrid.advanced.source = result;
|
||||
gzip(result, onAdvancedHybridGzip.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
* The hybrid `gzip` callback for advanced optimizations.
|
||||
*
|
||||
* @private
|
||||
* @param {Object|Undefined} exception The error object.
|
||||
* @param {Buffer} result The resulting gzipped source.
|
||||
*/
|
||||
function onAdvancedHybridGzip(exception, result) {
|
||||
if (exception) {
|
||||
throw exception;
|
||||
}
|
||||
if (!this.isSilent) {
|
||||
console.log('Done. Size: %d bytes.', result.length);
|
||||
}
|
||||
this.hybrid.advanced.gzip = result;
|
||||
|
||||
// finish by choosing the smallest compressed file
|
||||
onComplete.call(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* The callback executed after JavaScript source is minified and gzipped.
|
||||
* The callback executed after the source is minified and gzipped.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
function onComplete() {
|
||||
var compiled = this.compiled,
|
||||
hybrid = this.hybrid,
|
||||
uglified = this.uglified;
|
||||
var compiledSimple = this.compiled.simple,
|
||||
compiledAdvanced = this.compiled.advanced,
|
||||
uglified = this.uglified,
|
||||
hybridSimple = this.hybrid.simple,
|
||||
hybridAdvanced = this.hybrid.advanced;
|
||||
|
||||
// select the smallest gzipped file and use its minified counterpart as the
|
||||
// official minified release (ties go to the Closure Compiler)
|
||||
var min = Math.min(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
|
||||
var min = Math.min(
|
||||
compiledSimple.gzip.length,
|
||||
compiledAdvanced.gzip.length,
|
||||
uglified.gzip.length,
|
||||
hybridSimple.gzip.length,
|
||||
hybridAdvanced.gzip.length
|
||||
);
|
||||
|
||||
// pass the minified source to the "onComplete" callback
|
||||
[compiledSimple, compiledAdvanced, uglified, hybridSimple, hybridAdvanced].some(function(data) {
|
||||
if (data.gzip.length == min) {
|
||||
this.onComplete(data.source);
|
||||
}
|
||||
}, this);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
@@ -29,13 +29,8 @@
|
||||
// move vars exposed by the Closure Compiler into the IIFE
|
||||
source = source.replace(/^((?:(['"])use strict\2;)?(?:var (?:[a-z]+=(?:!0|!1|null)[,;])+)?)([\s\S]*?function[^)]+\){)/, '$3$1');
|
||||
|
||||
// avoid bugs with the Closure Compiler
|
||||
source = source
|
||||
// correct overly aggressive Closure Compiler minification
|
||||
.replace(/prototype\s*=\s*{\s*valueOf\s*:\s*1\s*}/, 'prototype={valueOf:1,y:1}')
|
||||
// restore `arrayRef` and `objectRef` values modified by pre-compile.js
|
||||
.replace(/= *Array.prototype/, '=[]')
|
||||
.replace(/= *Object.prototype/, '={}');
|
||||
// correct overly aggressive Closure Compiler advanced optimizations
|
||||
source = source.replace(/prototype\s*=\s*{\s*valueOf\s*:\s*1\s*}/, 'prototype={valueOf:1,y:1}');
|
||||
|
||||
// unescape properties (i.e. foo["bar"] => foo.bar)
|
||||
source = source.replace(/(\w)\["([^."]+)"\]/g, function(match, left, right) {
|
||||
@@ -54,7 +49,7 @@
|
||||
if (!snippet) {
|
||||
return source;
|
||||
}
|
||||
// add license
|
||||
// add copyright/license header
|
||||
return licenseTemplate[/call\(this\);?$/.test(source) ? 'underscore' : 'lodash']
|
||||
.replace('@VERSION', snippet[2]) + '\n;' + source;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env node
|
||||
;(function () {
|
||||
;(function() {
|
||||
'use strict';
|
||||
|
||||
/** Load Node modules */
|
||||
@@ -7,7 +7,7 @@
|
||||
fs = require('fs'),
|
||||
https = require('https'),
|
||||
path = require('path'),
|
||||
tar = require('tar'),
|
||||
tar = require('../vendor/tar/tar.js'),
|
||||
zlib = require('zlib');
|
||||
|
||||
/** The path of the directory that is the base of the repository */
|
||||
@@ -17,10 +17,27 @@
|
||||
var vendorPath = path.join(basePath, 'vendor');
|
||||
|
||||
/** The Git object ID of `closure-compiler.tar.gz` */
|
||||
var closureId = 'aa29a2ecf6f51d4da5a2a418c0d4ea0e368ee80d';
|
||||
var closureId = 'a2787b470c577cee2404d186c562dd9835f779f5';
|
||||
|
||||
/** The Git object ID of `uglifyjs.tar.gz` */
|
||||
var uglifyId = '9869c4443fb22598235d1019fcc8245be41e8889';
|
||||
var uglifyId = '3390b259e04829538e4d3635d12b317dd6103eca';
|
||||
|
||||
/** The media type for raw blob data */
|
||||
var mediaType = 'application/vnd.github.v3.raw';
|
||||
|
||||
/** Used to reference parts of the blob href */
|
||||
var location = (function() {
|
||||
var host = 'api.github.com',
|
||||
origin = 'https://api.github.com',
|
||||
pathname = '/repos/bestiejs/lodash/git/blobs';
|
||||
|
||||
return {
|
||||
'host': host,
|
||||
'href': host + origin + pathname,
|
||||
'origin': origin,
|
||||
'pathname': pathname
|
||||
};
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
@@ -31,7 +48,6 @@
|
||||
*
|
||||
* @private
|
||||
* @param {Object} options The options object.
|
||||
*
|
||||
* id - The Git object ID of the `.tar.gz` file.
|
||||
* onComplete - The function, invoked with one argument (exception),
|
||||
* called once the extraction has finished.
|
||||
@@ -41,12 +57,18 @@
|
||||
function getDependency(options) {
|
||||
options || (options = {});
|
||||
|
||||
var onComplete = options.onComplete,
|
||||
var id = options.id,
|
||||
onComplete = options.onComplete,
|
||||
path = options.path,
|
||||
title = options.title;
|
||||
|
||||
function callback(exception) {
|
||||
if (exception) {
|
||||
console.error('There was a problem downloading ' + title + '.');
|
||||
console.error([
|
||||
'There was a problem installing ' + title + '. To manually install, run:',
|
||||
'',
|
||||
"curl -H 'Accept: " + mediaType + "' " + location.href + '/' + id + " | tar xvz -C '" + path + "'"
|
||||
].join('\n'));
|
||||
}
|
||||
onComplete(exception);
|
||||
}
|
||||
@@ -54,35 +76,45 @@
|
||||
console.log('Downloading ' + title + '...');
|
||||
|
||||
https.get({
|
||||
'host': 'api.github.com',
|
||||
'path': '/repos/bestiejs/lodash/git/blobs/' + options.id,
|
||||
'host': location.host,
|
||||
'path': location.pathname + '/' + id,
|
||||
'headers': {
|
||||
// By default, all GitHub blob API endpoints return a JSON document
|
||||
// containing Base64-encoded blob data. Overriding the `Accept` header
|
||||
// with the GitHub raw media type returns the blob data directly.
|
||||
'Accept': 'application/vnd.github.v3.raw'
|
||||
// See http://developer.github.com/v3/media/.
|
||||
'Accept': mediaType
|
||||
}
|
||||
}, function(response) {
|
||||
var parser = new tar.Extract({
|
||||
'path': options.path
|
||||
})
|
||||
.on('end', callback)
|
||||
.on('error', callback);
|
||||
var decompressor = zlib.createUnzip(),
|
||||
parser = new tar.Extract({ 'path': path });
|
||||
|
||||
response.pipe(zlib.createUnzip()).pipe(parser);
|
||||
decompressor.on('error', callback)
|
||||
parser.on('end', callback).on('error', callback);
|
||||
response.pipe(decompressor).pipe(parser);
|
||||
})
|
||||
.on('error', callback);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
exec('npm -g root', function(exception, stdout, stderr) {
|
||||
if (exception || stderr) {
|
||||
console.error('There was a problem loading the npm registry.');
|
||||
process.exit(1);
|
||||
exec('npm -g root', function(exception, stdout) {
|
||||
if (exception) {
|
||||
console.error([
|
||||
'There was a problem loading the npm registry. If you’re installing the Lo-Dash',
|
||||
'command-line executable (via `npm install -g lodash`), you’ll need to manually',
|
||||
'install UglifyJS and the Closure Compiler by running:',
|
||||
'',
|
||||
"curl -H 'Accept: " + mediaType + "' " + location.href + '/' + closureId + " | tar xvz -C '" + vendorPath + "'",
|
||||
"curl -H 'Accept: " + mediaType + "' " + location.href + '/' + uglifyId + " | tar xvz -C '" + vendorPath + "'",
|
||||
'',
|
||||
'Please submit an issue on the GitHub issue tracker: ' + process.env.npm_package_bugs_url + '.'
|
||||
].join('\n'));
|
||||
console.error(exception);
|
||||
process.exit();
|
||||
}
|
||||
// exit early if not a global install
|
||||
if (path.resolve(basePath, '..') != stdout.trim()) {
|
||||
if (path.resolve(basePath, '..') != fs.realpathSync(stdout.trim())) {
|
||||
return;
|
||||
}
|
||||
// download the Closure Compiler
|
||||
@@ -90,14 +122,14 @@
|
||||
'title': 'the Closure Compiler',
|
||||
'id': closureId,
|
||||
'path': vendorPath,
|
||||
'onComplete':function(exceptionA) {
|
||||
'onComplete': function() {
|
||||
// download UglifyJS
|
||||
getDependency({
|
||||
'title': 'UglifyJS',
|
||||
'id': uglifyId,
|
||||
'path': vendorPath,
|
||||
'onComplete': function(exceptionB) {
|
||||
process.exit(exceptionA || exceptionB ? 1 : 0);
|
||||
'onComplete': function() {
|
||||
process.exit();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -13,9 +13,11 @@
|
||||
'collection',
|
||||
'createCallback',
|
||||
'ctor',
|
||||
'guard',
|
||||
'hasOwnProperty',
|
||||
'index',
|
||||
'isArguments',
|
||||
'isString',
|
||||
'iteratee',
|
||||
'length',
|
||||
'nativeKeys',
|
||||
@@ -26,9 +28,8 @@
|
||||
'propertyIsEnumerable',
|
||||
'result',
|
||||
'skipProto',
|
||||
'stringClass',
|
||||
'source',
|
||||
'thisArg',
|
||||
'toString',
|
||||
'value'
|
||||
];
|
||||
|
||||
@@ -64,9 +65,11 @@
|
||||
'all',
|
||||
'amd',
|
||||
'any',
|
||||
'assign',
|
||||
'attachEvent',
|
||||
'bind',
|
||||
'bindAll',
|
||||
'bindKey',
|
||||
'chain',
|
||||
'clone',
|
||||
'collect',
|
||||
@@ -135,7 +138,6 @@
|
||||
'keys',
|
||||
'last',
|
||||
'lastIndexOf',
|
||||
'lateBind',
|
||||
'map',
|
||||
'max',
|
||||
'memoize',
|
||||
@@ -213,14 +215,9 @@
|
||||
return source;
|
||||
}
|
||||
|
||||
// remove copyright to add later in post-compile.js
|
||||
// remove copyright/license header to add later in post-compile.js
|
||||
source = source.replace(/\/\*![\s\S]+?\*\//, '');
|
||||
|
||||
// replace `arrayRef` and `objectRef` values to avoid a bug in the Closure Compiler
|
||||
source = source
|
||||
.replace(/(arrayRef *= *)\[\]/, '$1Array.prototype')
|
||||
.replace(/(objectRef *= *)\{\}/, '$1Object.prototype');
|
||||
|
||||
// add brackets to whitelisted properties so the Closure Compiler won't mung them
|
||||
// http://code.google.com/closure/compiler/docs/api-tutorial3.html#export
|
||||
source = source.replace(RegExp('\\.(' + propWhitelist.join('|') + ')\\b', 'g'), "['$1']");
|
||||
|
||||
412
doc/README.md
412
doc/README.md
File diff suppressed because it is too large
Load Diff
@@ -21,7 +21,7 @@
|
||||
// generate Markdown
|
||||
$markdown = docdown(array(
|
||||
'path' => '../' . $file,
|
||||
'title' => 'Lo-Dash <sup>v0.9.0</sup>',
|
||||
'title' => 'Lo-Dash <sup>v0.10.0</sup>',
|
||||
'toc' => 'categories',
|
||||
'url' => 'https://github.com/bestiejs/lodash/blob/master/lodash.js'
|
||||
));
|
||||
|
||||
467
lodash.js
467
lodash.js
@@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Lo-Dash v0.9.0 <http://lodash.com>
|
||||
* Lo-Dash 0.10.0 <http://lodash.com>
|
||||
* (c) 2012 John-David Dalton <http://allyoucanleet.com/>
|
||||
* Based on Underscore.js 1.4.2 <http://underscorejs.org>
|
||||
* (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
|
||||
@@ -18,13 +18,14 @@
|
||||
|
||||
/** Used for array and object method references */
|
||||
var arrayRef = [],
|
||||
objectRef = {};
|
||||
// avoid a Closure Compiler bug by creatively creating an object
|
||||
objectRef = new function(){};
|
||||
|
||||
/** Used to generate unique IDs */
|
||||
var idCounter = 0;
|
||||
|
||||
/** Used internally to indicate various things */
|
||||
var indicatorObject = {};
|
||||
var indicatorObject = objectRef;
|
||||
|
||||
/** Used by `cachedContains` as the default size when optimizations are enabled for large arrays */
|
||||
var largeArraySize = 30;
|
||||
@@ -32,7 +33,7 @@
|
||||
/** Used to restore the original `_` reference in `noConflict` */
|
||||
var oldDash = window._;
|
||||
|
||||
/** Used to detect delimiter values that should be processed by `tokenizeEvaluate` */
|
||||
/** Used to detect template delimiter values that require a with-statement */
|
||||
var reComplexDelimiter = /[-?+=!~*%&^<>|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/;
|
||||
|
||||
/** Used to match HTML entities */
|
||||
@@ -56,7 +57,16 @@
|
||||
.replace(/valueOf|for [^\]]+/g, '.+?') + '$'
|
||||
);
|
||||
|
||||
/** Used to ensure capturing order and avoid matches for undefined delimiters */
|
||||
/**
|
||||
* Used to match ES6 template delimiters
|
||||
* http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6
|
||||
*/
|
||||
var reEsTemplate = /\$\{((?:(?=\\?)\\?[\s\S])*?)}/g;
|
||||
|
||||
/** Used to match "interpolate" template delimiters */
|
||||
var reInterpolate = /<%=([\s\S]+?)%>/g;
|
||||
|
||||
/** Used to ensure capturing order of template delimiters */
|
||||
var reNoMatch = /($^)/;
|
||||
|
||||
/** Used to match HTML characters */
|
||||
@@ -89,6 +99,7 @@
|
||||
var nativeBind = reNative.test(nativeBind = slice.bind) && nativeBind,
|
||||
nativeIsArray = reNative.test(nativeIsArray = Array.isArray) && nativeIsArray,
|
||||
nativeIsFinite = window.isFinite,
|
||||
nativeIsNaN = window.isNaN,
|
||||
nativeKeys = reNative.test(nativeKeys = Object.keys) && nativeKeys,
|
||||
nativeMax = Math.max,
|
||||
nativeMin = Math.min,
|
||||
@@ -276,7 +287,7 @@
|
||||
* @memberOf _.templateSettings
|
||||
* @type RegExp
|
||||
*/
|
||||
'interpolate': /<%=([\s\S]+?)%>/g,
|
||||
'interpolate': reInterpolate,
|
||||
|
||||
/**
|
||||
* Used to reference the data object in the template text.
|
||||
@@ -317,7 +328,7 @@
|
||||
|
||||
// add support for accessing string characters by index if needed
|
||||
' <% if (noCharByIndex) { %>\n' +
|
||||
' if (toString.call(iteratee) == stringClass) {\n' +
|
||||
' if (isString(iteratee)) {\n' +
|
||||
' iteratee = iteratee.split(\'\')\n' +
|
||||
' }' +
|
||||
' <% } %>\n' +
|
||||
@@ -406,6 +417,16 @@
|
||||
'return result'
|
||||
);
|
||||
|
||||
/** Reusable iterator options for `assign` and `defaults` */
|
||||
var assignIteratorOptions = {
|
||||
'args': 'object, source, guard',
|
||||
'top':
|
||||
'for (var argsIndex = 1, argsLength = typeof guard == \'number\' ? 2 : arguments.length; argsIndex < argsLength; argsIndex++) {\n' +
|
||||
' if ((iteratee = arguments[argsIndex])) {',
|
||||
'objectLoop': 'result[index] = value',
|
||||
'bottom': ' }\n}'
|
||||
};
|
||||
|
||||
/**
|
||||
* Reusable iterator options shared by `forEach`, `forIn`, and `forOwn`.
|
||||
*/
|
||||
@@ -416,17 +437,6 @@
|
||||
'objectLoop': 'if (callback(value, index, collection) === false) return result'
|
||||
};
|
||||
|
||||
/** Reusable iterator options for `defaults`, and `extend` */
|
||||
var extendIteratorOptions = {
|
||||
'useHas': false,
|
||||
'args': 'object',
|
||||
'top':
|
||||
'for (var argsIndex = 1, argsLength = arguments.length; argsIndex < argsLength; argsIndex++) {\n' +
|
||||
' if (iteratee = arguments[argsIndex]) {',
|
||||
'objectLoop': 'result[index] = value',
|
||||
'bottom': ' }\n}'
|
||||
};
|
||||
|
||||
/** Reusable iterator options for `forIn` and `forOwn` */
|
||||
var forOwnIteratorOptions = {
|
||||
'arrayLoop': null
|
||||
@@ -435,13 +445,13 @@
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Creates a function optimized for searching large arrays for a given `value`,
|
||||
* Creates a function optimized to search large arrays for a given `value`,
|
||||
* starting at `fromIndex`, using strict equality for comparisons, i.e. `===`.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to search.
|
||||
* @param {Mixed} value The value to search for.
|
||||
* @param {Number} [fromIndex=0] The index to start searching from.
|
||||
* @param {Number} [fromIndex=0] The index to search from.
|
||||
* @param {Number} [largeSize=30] The length at which an array is considered large.
|
||||
* @returns {Boolean} Returns `true` if `value` is found, else `false`.
|
||||
*/
|
||||
@@ -449,14 +459,14 @@
|
||||
fromIndex || (fromIndex = 0);
|
||||
|
||||
var length = array.length,
|
||||
isLarge = (length - fromIndex) >= (largeSize || largeArraySize),
|
||||
cache = isLarge ? {} : array;
|
||||
isLarge = (length - fromIndex) >= (largeSize || largeArraySize);
|
||||
|
||||
if (isLarge) {
|
||||
// init value cache
|
||||
var index = fromIndex - 1;
|
||||
var cache = {},
|
||||
index = fromIndex - 1;
|
||||
|
||||
while (++index < length) {
|
||||
// manually coerce `value` to string because `hasOwnProperty`, in some
|
||||
// manually coerce `value` to a string because `hasOwnProperty`, in some
|
||||
// older versions of Firefox, coerces objects incorrectly
|
||||
var key = array[index] + '';
|
||||
(hasOwnProperty.call(cache, key) ? cache[key] : (cache[key] = [])).push(array[index]);
|
||||
@@ -467,10 +477,22 @@
|
||||
var key = value + '';
|
||||
return hasOwnProperty.call(cache, key) && indexOf(cache[key], value) > -1;
|
||||
}
|
||||
return indexOf(cache, value, fromIndex) > -1;
|
||||
return indexOf(array, value, fromIndex) > -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Used by `_.max` and `_.min` as the default `callback` when a given
|
||||
* `collection` is a string value.
|
||||
*
|
||||
* @private
|
||||
* @param {String} value The character to inspect.
|
||||
* @returns {Number} Returns the code unit of given character.
|
||||
*/
|
||||
function charAtCallback(value) {
|
||||
return value.charCodeAt(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Used by `sortBy` to compare transformed `collection` values, stable sorting
|
||||
* them in ascending order.
|
||||
@@ -514,12 +536,15 @@
|
||||
function createBound(func, thisArg, partialArgs) {
|
||||
var isFunc = isFunction(func),
|
||||
isPartial = !partialArgs,
|
||||
methodName = func;
|
||||
key = thisArg;
|
||||
|
||||
// juggle arguments
|
||||
if (isPartial) {
|
||||
partialArgs = thisArg;
|
||||
}
|
||||
if (!isFunc) {
|
||||
thisArg = func;
|
||||
}
|
||||
|
||||
function bound() {
|
||||
// `Function#bind` spec
|
||||
@@ -528,7 +553,7 @@
|
||||
thisBinding = isPartial ? this : thisArg;
|
||||
|
||||
if (!isFunc) {
|
||||
func = thisArg[methodName];
|
||||
func = thisArg[key];
|
||||
}
|
||||
if (partialArgs.length) {
|
||||
args = args.length
|
||||
@@ -543,7 +568,7 @@
|
||||
// mimic the constructor's `return` behavior
|
||||
// http://es5.github.com/#x13.2.2
|
||||
var result = func.apply(thisBinding, args);
|
||||
return result && objectTypes[typeof result]
|
||||
return isObject(result)
|
||||
? result
|
||||
: thisBinding
|
||||
}
|
||||
@@ -618,14 +643,14 @@
|
||||
|
||||
// create the function factory
|
||||
var factory = Function(
|
||||
'createCallback, hasOwnProperty, isArguments, objectTypes, nativeKeys, ' +
|
||||
'propertyIsEnumerable, stringClass, toString',
|
||||
'createCallback, hasOwnProperty, isArguments, isString, objectTypes, ' +
|
||||
'nativeKeys, propertyIsEnumerable',
|
||||
'return function(' + args + ') {\n' + iteratorTemplate(data) + '\n}'
|
||||
);
|
||||
// return the compiled function
|
||||
return factory(
|
||||
createCallback, hasOwnProperty, isArguments, objectTypes, nativeKeys,
|
||||
propertyIsEnumerable, stringClass, toString
|
||||
createCallback, hasOwnProperty, isArguments, isString, objectTypes,
|
||||
nativeKeys, propertyIsEnumerable
|
||||
);
|
||||
}
|
||||
|
||||
@@ -674,6 +699,25 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Assigns own enumerable properties of source object(s) to the `destination`
|
||||
* object. Subsequent sources will overwrite propery assignments of previous
|
||||
* sources.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @alias extend
|
||||
* @category Objects
|
||||
* @param {Object} object The destination object.
|
||||
* @param {Object} [source1, source2, ...] The source objects.
|
||||
* @returns {Object} Returns the destination object.
|
||||
* @example
|
||||
*
|
||||
* _.assign({ 'name': 'moe' }, { 'age': 40 });
|
||||
* // => { 'name': 'moe', 'age': 40 }
|
||||
*/
|
||||
var assign = createIterator(assignIteratorOptions);
|
||||
|
||||
/**
|
||||
* Checks if `value` is an `arguments` object.
|
||||
*
|
||||
@@ -733,7 +777,7 @@
|
||||
});
|
||||
|
||||
/**
|
||||
* Iterates over `object`'s own enumerable properties, executing the `callback`
|
||||
* Iterates over an object's own enumerable properties, executing the `callback`
|
||||
* for each property. The `callback` is bound to `thisArg` and invoked with three
|
||||
* arguments; (value, key, object). Callbacks may exit iteration early by explicitly
|
||||
* returning `false`.
|
||||
@@ -878,7 +922,7 @@
|
||||
deep = false;
|
||||
}
|
||||
// inspect [[Class]]
|
||||
var isObj = objectTypes[typeof value];
|
||||
var isObj = isObject(value);
|
||||
if (isObj) {
|
||||
// don't clone `arguments` objects, functions, or non-object Objects
|
||||
var className = toString.call(value);
|
||||
@@ -892,7 +936,7 @@
|
||||
if (!isObj || !deep) {
|
||||
// don't clone functions
|
||||
return isObj
|
||||
? (isArr ? slice.call(value) : extend({}, value))
|
||||
? (isArr ? slice.call(value) : assign({}, value))
|
||||
: value;
|
||||
}
|
||||
|
||||
@@ -936,7 +980,7 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Assigns enumerable properties of the default object(s) to the `destination`
|
||||
* Assigns own enumerable properties of source object(s) to the `destination`
|
||||
* object for all `destination` properties that resolve to `null`/`undefined`.
|
||||
* Once a property is set, additional defaults of the same property will be
|
||||
* ignored.
|
||||
@@ -953,28 +997,10 @@
|
||||
* _.defaults(iceCream, { 'flavor': 'vanilla', 'sprinkles': 'rainbow' });
|
||||
* // => { 'flavor': 'chocolate', 'sprinkles': 'rainbow' }
|
||||
*/
|
||||
var defaults = createIterator(extendIteratorOptions, {
|
||||
'objectLoop': 'if (result[index] == null) ' + extendIteratorOptions.objectLoop
|
||||
var defaults = createIterator(assignIteratorOptions, {
|
||||
'objectLoop': 'if (result[index] == null) ' + assignIteratorOptions.objectLoop
|
||||
});
|
||||
|
||||
/**
|
||||
* Assigns enumerable properties of the source object(s) to the `destination`
|
||||
* object. Subsequent sources will overwrite propery assignments of previous
|
||||
* sources.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Objects
|
||||
* @param {Object} object The destination object.
|
||||
* @param {Object} [source1, source2, ...] The source objects.
|
||||
* @returns {Object} Returns the destination object.
|
||||
* @example
|
||||
*
|
||||
* _.extend({ 'name': 'moe' }, { 'age': 40 });
|
||||
* // => { 'name': 'moe', 'age': 40 }
|
||||
*/
|
||||
var extend = createIterator(extendIteratorOptions);
|
||||
|
||||
/**
|
||||
* Creates a sorted array of all enumerable properties, own and inherited,
|
||||
* of `object` that have function values.
|
||||
@@ -1337,7 +1363,7 @@
|
||||
* // => false
|
||||
*/
|
||||
function isFinite(value) {
|
||||
return nativeIsFinite(value ? +value : parseFloat(value));
|
||||
return nativeIsFinite(value) && !nativeIsNaN(parseFloat(value));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1563,15 +1589,10 @@
|
||||
* // => ['one', 'two', 'three'] (order is not guaranteed)
|
||||
*/
|
||||
var keys = !nativeKeys ? shimKeys : function(object) {
|
||||
var type = typeof object;
|
||||
|
||||
// avoid iterating over the `prototype` property
|
||||
if (type == 'function' && propertyIsEnumerable.call(object, 'prototype')) {
|
||||
return shimKeys(object);
|
||||
}
|
||||
return object && objectTypes[type]
|
||||
? nativeKeys(object)
|
||||
: [];
|
||||
return typeof object == 'function' && propertyIsEnumerable.call(object, 'prototype')
|
||||
? shimKeys(object)
|
||||
: (isObject(object) ? nativeKeys(object) : []);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1615,7 +1636,11 @@
|
||||
if (indicator !== indicatorObject) {
|
||||
stackA = [];
|
||||
stackB = [];
|
||||
length = args.length;
|
||||
|
||||
// work with `_.reduce` by only using its callback `accumulator` and `value` arguments
|
||||
if (typeof indicator != 'number') {
|
||||
length = args.length;
|
||||
}
|
||||
}
|
||||
while (++index < length) {
|
||||
forOwn(args[index], function(source, key) {
|
||||
@@ -1791,7 +1816,8 @@
|
||||
|
||||
/**
|
||||
* Checks if a given `target` element is present in a `collection` using strict
|
||||
* equality for comparisons, i.e. `===`.
|
||||
* equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used
|
||||
* as the offset from the end of the collection.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -1799,29 +1825,41 @@
|
||||
* @category Collections
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {Mixed} target The value to check for.
|
||||
* @param {Number} [fromIndex=0] The index to search from.
|
||||
* @returns {Boolean} Returns `true` if the `target` element is found, else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.contains([1, 2, 3], 3);
|
||||
* _.contains([1, 2, 3], 1);
|
||||
* // => true
|
||||
*
|
||||
* _.contains([1, 2, 3], 1, 2);
|
||||
* // => false
|
||||
*
|
||||
* _.contains({ 'name': 'moe', 'age': 40 }, 'moe');
|
||||
* // => true
|
||||
*
|
||||
* _.contains('curly', 'ur');
|
||||
* // => true
|
||||
*/
|
||||
function contains(collection, target) {
|
||||
var length = collection ? collection.length : 0;
|
||||
function contains(collection, target, fromIndex) {
|
||||
var index = -1,
|
||||
length = collection ? collection.length : 0,
|
||||
result = false;
|
||||
|
||||
fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex) || 0;
|
||||
if (typeof length == 'number') {
|
||||
return (toString.call(collection) == stringClass
|
||||
? collection.indexOf(target)
|
||||
: indexOf(collection, target)
|
||||
result = (isString(collection)
|
||||
? collection.indexOf(target, fromIndex)
|
||||
: indexOf(collection, target, fromIndex)
|
||||
) > -1;
|
||||
} else {
|
||||
forEach(collection, function(value) {
|
||||
if (++index >= fromIndex) {
|
||||
return !(result = value === target);
|
||||
}
|
||||
});
|
||||
}
|
||||
return some(collection, function(value) {
|
||||
return value === target;
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1882,10 +1920,22 @@
|
||||
function every(collection, callback, thisArg) {
|
||||
var result = true;
|
||||
callback = createCallback(callback, thisArg);
|
||||
forEach(collection, function(value, index, collection) {
|
||||
return (result = callback(value, index, collection));
|
||||
});
|
||||
return !!result;
|
||||
|
||||
if (isArray(collection)) {
|
||||
var index = -1,
|
||||
length = collection.length;
|
||||
|
||||
while (++index < length) {
|
||||
if (!(result = !!callback(collection[index], index, collection))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
forEach(collection, function(value, index, collection) {
|
||||
return (result = !!callback(value, index, collection));
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1909,11 +1959,24 @@
|
||||
function filter(collection, callback, thisArg) {
|
||||
var result = [];
|
||||
callback = createCallback(callback, thisArg);
|
||||
forEach(collection, function(value, index, collection) {
|
||||
if (callback(value, index, collection)) {
|
||||
result.push(value);
|
||||
|
||||
if (isArray(collection)) {
|
||||
var index = -1,
|
||||
length = collection.length;
|
||||
|
||||
while (++index < length) {
|
||||
var value = collection[index];
|
||||
if (callback(value, index, collection)) {
|
||||
result.push(value);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
forEach(collection, function(value, index, collection) {
|
||||
if (callback(value, index, collection)) {
|
||||
result.push(value);
|
||||
}
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1940,8 +2003,11 @@
|
||||
function find(collection, callback, thisArg) {
|
||||
var result;
|
||||
callback = createCallback(callback, thisArg);
|
||||
some(collection, function(value, index, collection) {
|
||||
return callback(value, index, collection) && (result = value, true);
|
||||
forEach(collection, function(value, index, collection) {
|
||||
if (callback(value, index, collection)) {
|
||||
result = value;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
@@ -2087,7 +2153,7 @@
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Collections
|
||||
* @param {Array} collection The collection to iterate over.
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {Function} [callback] The function called per iteration.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Mixed} Returns the maximum value.
|
||||
@@ -2108,8 +2174,11 @@
|
||||
length = collection ? collection.length : 0,
|
||||
result = computed;
|
||||
|
||||
if (callback || typeof length != 'number') {
|
||||
callback = createCallback(callback, thisArg);
|
||||
if (callback || !isArray(collection)) {
|
||||
callback = !callback && isString(collection)
|
||||
? charAtCallback
|
||||
: createCallback(callback, thisArg);
|
||||
|
||||
forEach(collection, function(value, index, collection) {
|
||||
var current = callback(value, index, collection);
|
||||
if (current > computed) {
|
||||
@@ -2136,7 +2205,7 @@
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Collections
|
||||
* @param {Array} collection The collection to iterate over.
|
||||
* @param {Array|Object|String} collection The collection to iterate over.
|
||||
* @param {Function} [callback] The function called per iteration.
|
||||
* @param {Mixed} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Mixed} Returns the minimum value.
|
||||
@@ -2151,8 +2220,11 @@
|
||||
length = collection ? collection.length : 0,
|
||||
result = computed;
|
||||
|
||||
if (callback || typeof length != 'number') {
|
||||
callback = createCallback(callback, thisArg);
|
||||
if (callback || !isArray(collection)) {
|
||||
callback = !callback && isString(collection)
|
||||
? charAtCallback
|
||||
: createCallback(callback, thisArg);
|
||||
|
||||
forEach(collection, function(value, index, collection) {
|
||||
var current = callback(value, index, collection);
|
||||
if (current < computed) {
|
||||
@@ -2256,7 +2328,7 @@
|
||||
if (typeof length != 'number') {
|
||||
var props = keys(collection);
|
||||
length = props.length;
|
||||
} else if (noCharByIndex && toString.call(collection) == stringClass) {
|
||||
} else if (noCharByIndex && isString(collection)) {
|
||||
iteratee = collection.split('');
|
||||
}
|
||||
forEach(collection, function(value, index, collection) {
|
||||
@@ -2299,7 +2371,7 @@
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Collections
|
||||
* @param {Array} collection The collection to shuffle.
|
||||
* @param {Array|Object|String} collection The collection to shuffle.
|
||||
* @returns {Array} Returns a new shuffled collection.
|
||||
* @example
|
||||
*
|
||||
@@ -2360,15 +2432,27 @@
|
||||
* else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.some([null, 0, 'yes', false]);
|
||||
* _.some([null, 0, 'yes', false], Boolean);
|
||||
* // => true
|
||||
*/
|
||||
function some(collection, callback, thisArg) {
|
||||
var result;
|
||||
callback = createCallback(callback, thisArg);
|
||||
forEach(collection, function(value, index, collection) {
|
||||
return !(result = callback(value, index, collection));
|
||||
});
|
||||
|
||||
if (isArray(collection)) {
|
||||
var index = -1,
|
||||
length = collection.length;
|
||||
|
||||
while (++index < length) {
|
||||
if ((result = callback(collection[index], index, collection))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
forEach(collection, function(value, index, collection) {
|
||||
return !(result = callback(value, index, collection));
|
||||
});
|
||||
}
|
||||
return !!result;
|
||||
}
|
||||
|
||||
@@ -2431,7 +2515,7 @@
|
||||
*/
|
||||
function toArray(collection) {
|
||||
if (collection && typeof collection.length == 'number') {
|
||||
return (noArraySliceOnStrings ? toString.call(collection) == stringClass : typeof collection == 'string')
|
||||
return (noArraySliceOnStrings ? isString(collection) : typeof collection == 'string')
|
||||
? collection.split('')
|
||||
: slice.call(collection);
|
||||
}
|
||||
@@ -2460,10 +2544,7 @@
|
||||
* // => [{ 'name': 'moe', 'age': 40 }]
|
||||
*/
|
||||
function where(collection, properties) {
|
||||
var props = [];
|
||||
forIn(properties, function(value, prop) {
|
||||
props.push(prop);
|
||||
});
|
||||
var props = keys(properties);
|
||||
return filter(collection, function(object) {
|
||||
var length = props.length;
|
||||
while (length--) {
|
||||
@@ -2609,8 +2690,8 @@
|
||||
* @category Arrays
|
||||
* @param {Array} array The array to search.
|
||||
* @param {Mixed} value The value to search for.
|
||||
* @param {Boolean|Number} [fromIndex=0] The index to start searching from or
|
||||
* `true` to perform a binary search on a sorted `array`.
|
||||
* @param {Boolean|Number} [fromIndex=0] The index to search from or `true` to
|
||||
* perform a binary search on a sorted `array`.
|
||||
* @returns {Number} Returns the index of the matched value or `-1`.
|
||||
* @example
|
||||
*
|
||||
@@ -2649,7 +2730,7 @@
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
* @param {Array} array The array to query.
|
||||
* @param {Number} [n] The number of elements to return.
|
||||
* @param {Number} [n=1] The number of elements to exclude.
|
||||
* @param- {Object} [guard] Internally used to allow this method to work with
|
||||
* others like `_.map` without using their callback `index` argument for `n`.
|
||||
* @returns {Array} Returns all but the last element or `n` elements of `array`.
|
||||
@@ -2725,15 +2806,16 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the index at which the last occurrence of `value` is found using
|
||||
* strict equality for comparisons, i.e. `===`.
|
||||
* Gets the index at which the last occurrence of `value` is found using strict
|
||||
* equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used
|
||||
* as the offset from the end of the collection.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
* @param {Array} array The array to search.
|
||||
* @param {Mixed} value The value to search for.
|
||||
* @param {Number} [fromIndex=array.length-1] The index to start searching from.
|
||||
* @param {Number} [fromIndex=array.length-1] The index to search from.
|
||||
* @returns {Number} Returns the index of the matched value or `-1`.
|
||||
* @example
|
||||
*
|
||||
@@ -2848,7 +2930,7 @@
|
||||
* @alias drop, tail
|
||||
* @category Arrays
|
||||
* @param {Array} array The array to query.
|
||||
* @param {Number} [n] The number of elements to return.
|
||||
* @param {Number} [n=1] The number of elements to exclude.
|
||||
* @param- {Object} [guard] Internally used to allow this method to work with
|
||||
* others like `_.map` without using their callback `index` argument for `n`.
|
||||
* @returns {Array} Returns all but the first value or `n` values of `array`.
|
||||
@@ -2935,18 +3017,7 @@
|
||||
* // => [1, 2, 3, 101, 10]
|
||||
*/
|
||||
function union() {
|
||||
var index = -1,
|
||||
flattened = concat.apply(arrayRef, arguments),
|
||||
length = flattened.length,
|
||||
result = [];
|
||||
|
||||
while (++index < length) {
|
||||
var value = flattened[index];
|
||||
if (indexOf(result, value) < 0) {
|
||||
result.push(value);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return uniq(concat.apply(arrayRef, arguments));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2983,7 +3054,7 @@
|
||||
var index = -1,
|
||||
length = array ? array.length : 0,
|
||||
result = [],
|
||||
seen = [];
|
||||
seen = result;
|
||||
|
||||
// juggle arguments
|
||||
if (typeof isSorted == 'function') {
|
||||
@@ -2991,15 +3062,32 @@
|
||||
callback = isSorted;
|
||||
isSorted = false;
|
||||
}
|
||||
callback = createCallback(callback, thisArg);
|
||||
// init value cache for large arrays
|
||||
var isLarge = !isSorted && length > 74;
|
||||
if (isLarge) {
|
||||
var cache = {};
|
||||
}
|
||||
if (callback) {
|
||||
seen = [];
|
||||
callback = createCallback(callback, thisArg);
|
||||
}
|
||||
while (++index < length) {
|
||||
var computed = callback(array[index], index, array);
|
||||
var value = array[index],
|
||||
computed = callback ? callback(value, index, array) : value;
|
||||
|
||||
if (isLarge) {
|
||||
// manually coerce `computed` to a string because `hasOwnProperty`, in
|
||||
// some older versions of Firefox, coerces objects incorrectly
|
||||
seen = hasOwnProperty.call(cache, computed + '') ? cache[computed] : (cache[computed] = []);
|
||||
}
|
||||
if (isSorted
|
||||
? !index || seen[seen.length - 1] !== computed
|
||||
: indexOf(seen, computed) < 0
|
||||
) {
|
||||
seen.push(computed);
|
||||
result.push(array[index]);
|
||||
if (callback || isLarge) {
|
||||
seen.push(computed);
|
||||
}
|
||||
result.push(value);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@@ -3065,8 +3153,9 @@
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Creates a function that is restricted to executing only after it is
|
||||
* called `n` times.
|
||||
* Creates a function that is restricted to executing `func` only after it is
|
||||
* called `n` times. The `func` is executed with the `this` binding of the
|
||||
* created function.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -3158,10 +3247,49 @@
|
||||
return object;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that, when called, invokes the method at `object[key]`
|
||||
* and prepends any additional `bindKey` arguments to those passed to the bound
|
||||
* function. This method differs from `_.bind` by allowing bound functions to
|
||||
* reference methods that will be redefined or don't yet exist.
|
||||
* See http://michaux.ca/articles/lazy-function-definition-pattern.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Functions
|
||||
* @param {Object} object The object the method belongs to.
|
||||
* @param {String} key The key of the method.
|
||||
* @param {Mixed} [arg1, arg2, ...] Arguments to be partially applied.
|
||||
* @returns {Function} Returns the new bound function.
|
||||
* @example
|
||||
*
|
||||
* var object = {
|
||||
* 'name': 'moe',
|
||||
* 'greet': function(greeting) {
|
||||
* return greeting + ' ' + this.name;
|
||||
* }
|
||||
* };
|
||||
*
|
||||
* var func = _.bindKey(object, 'greet', 'hi');
|
||||
* func();
|
||||
* // => 'hi moe'
|
||||
*
|
||||
* object.greet = function(greeting) {
|
||||
* return greeting + ', ' + this.name + '!';
|
||||
* };
|
||||
*
|
||||
* func();
|
||||
* // => 'hi, moe!'
|
||||
*/
|
||||
function bindKey(object, key) {
|
||||
return createBound(object, key, slice.call(arguments, 2));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that is the composition of the passed functions,
|
||||
* where each function consumes the return value of the function that follows.
|
||||
* In math terms, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`.
|
||||
* Each function is executed with the `this` binding of the composed function.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -3278,48 +3406,12 @@
|
||||
return setTimeout(function() { func.apply(undefined, args); }, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that, when called, invokes `object[methodName]` and
|
||||
* prepends any additional `lateBind` arguments to those passed to the bound
|
||||
* function. This method differs from `_.bind` by allowing bound functions to
|
||||
* reference methods that will be redefined or don't yet exist.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Functions
|
||||
* @param {Object} object The object the method belongs to.
|
||||
* @param {String} methodName The method name.
|
||||
* @param {Mixed} [arg1, arg2, ...] Arguments to be partially applied.
|
||||
* @returns {Function} Returns the new bound function.
|
||||
* @example
|
||||
*
|
||||
* var object = {
|
||||
* 'name': 'moe',
|
||||
* 'greet': function(greeting) {
|
||||
* return greeting + ' ' + this.name;
|
||||
* }
|
||||
* };
|
||||
*
|
||||
* var func = _.lateBind(object, 'greet', 'hi');
|
||||
* func();
|
||||
* // => 'hi moe'
|
||||
*
|
||||
* object.greet = function(greeting) {
|
||||
* return greeting + ', ' + this.name + '!';
|
||||
* };
|
||||
*
|
||||
* func();
|
||||
* // => 'hi, moe!'
|
||||
*/
|
||||
function lateBind(object, methodName) {
|
||||
return createBound(methodName, object, slice.call(arguments, 2));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that memoizes the result of `func`. If `resolver` is
|
||||
* passed, it will be used to determine the cache key for storing the result
|
||||
* based on the arguments passed to the memoized function. By default, the first
|
||||
* argument passed to the memoized function is used as the cache key.
|
||||
* argument passed to the memoized function is used as the cache key. The `func`
|
||||
* is executed with the `this` binding of the memoized function.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -3344,8 +3436,9 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that is restricted to one execution. Repeat calls to
|
||||
* the function will return the value of the first call.
|
||||
* Creates a function that is restricted to execute `func` once. Repeat calls to
|
||||
* the function will return the value of the first call. The `func` is executed
|
||||
* with the `this` binding of the created function.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -3378,8 +3471,8 @@
|
||||
|
||||
/**
|
||||
* Creates a function that, when called, invokes `func` with any additional
|
||||
* `partial` arguments prepended to those passed to the new function. This method
|
||||
* is similar to `bind`, except it does **not** alter the `this` binding.
|
||||
* `partial` arguments prepended to those passed to the new function. This
|
||||
* method is similar to `bind`, except it does **not** alter the `this` binding.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -3449,8 +3542,9 @@
|
||||
|
||||
/**
|
||||
* Creates a function that passes `value` to the `wrapper` function as its
|
||||
* first argument. Additional arguments passed to the new function are appended
|
||||
* to those passed to the `wrapper` function.
|
||||
* first argument. Additional arguments passed to the function are appended
|
||||
* to those passed to the `wrapper` function. The `wrapper` is executed with
|
||||
* the `this` binding of the created function.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -3674,7 +3768,11 @@
|
||||
*
|
||||
* // using the "escape" delimiter to escape HTML in data property values
|
||||
* _.template('<b><%- value %></b>', { 'value': '<script>' });
|
||||
* // => '<b><script></b>'
|
||||
* // => '<b><script></b>'
|
||||
*
|
||||
* // using the ES6 delimiter as an alternative to the default "interpolate" delimiter
|
||||
* _.template('hello ${ name }', { 'name': 'curly' });
|
||||
* // => 'hello curly'
|
||||
*
|
||||
* // using the internal `print` function in "evaluate" delimiters
|
||||
* _.template('<% print("hello " + epithet); %>!', { 'epithet': 'stooge' });
|
||||
@@ -3682,7 +3780,7 @@
|
||||
*
|
||||
* // using custom template delimiters
|
||||
* _.templateSettings = {
|
||||
* 'interpolate': /\{\{([\s\S]+?)\}\}/g
|
||||
* 'interpolate': /{{([\s\S]+?)}}/g
|
||||
* };
|
||||
*
|
||||
* _.template('hello {{ name }}!', { 'name': 'mustache' });
|
||||
@@ -3720,8 +3818,9 @@
|
||||
|
||||
var isEvaluating,
|
||||
result,
|
||||
index = 0,
|
||||
settings = lodash.templateSettings,
|
||||
index = 0,
|
||||
interpolate = options.interpolate || settings.interpolate || reNoMatch,
|
||||
source = "__p += '",
|
||||
variable = options.variable || settings.variable,
|
||||
hasVariable = variable;
|
||||
@@ -3729,11 +3828,14 @@
|
||||
// compile regexp to match each delimiter
|
||||
var reDelimiters = RegExp(
|
||||
(options.escape || settings.escape || reNoMatch).source + '|' +
|
||||
(options.interpolate || settings.interpolate || reNoMatch).source + '|' +
|
||||
interpolate.source + '|' +
|
||||
(interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
|
||||
(options.evaluate || settings.evaluate || reNoMatch).source + '|$'
|
||||
, 'g');
|
||||
|
||||
text.replace(reDelimiters, function(match, escapeValue, interpolateValue, evaluateValue, offset) {
|
||||
text.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
|
||||
interpolateValue || (interpolateValue = esTemplateValue);
|
||||
|
||||
// escape characters that cannot be included in string literals
|
||||
source += text.slice(index, offset).replace(reUnescapedString, escapeStringChar);
|
||||
|
||||
@@ -3978,12 +4080,14 @@
|
||||
* @memberOf _
|
||||
* @type String
|
||||
*/
|
||||
lodash.VERSION = '0.9.0';
|
||||
lodash.VERSION = '0.10.0';
|
||||
|
||||
// assign static methods
|
||||
lodash.assign = assign;
|
||||
lodash.after = after;
|
||||
lodash.bind = bind;
|
||||
lodash.bindAll = bindAll;
|
||||
lodash.bindKey = bindKey;
|
||||
lodash.chain = chain;
|
||||
lodash.clone = clone;
|
||||
lodash.compact = compact;
|
||||
@@ -3997,7 +4101,6 @@
|
||||
lodash.difference = difference;
|
||||
lodash.escape = escape;
|
||||
lodash.every = every;
|
||||
lodash.extend = extend;
|
||||
lodash.filter = filter;
|
||||
lodash.find = find;
|
||||
lodash.first = first;
|
||||
@@ -4034,7 +4137,6 @@
|
||||
lodash.keys = keys;
|
||||
lodash.last = last;
|
||||
lodash.lastIndexOf = lastIndexOf;
|
||||
lodash.lateBind = lateBind;
|
||||
lodash.map = map;
|
||||
lodash.max = max;
|
||||
lodash.memoize = memoize;
|
||||
@@ -4083,6 +4185,7 @@
|
||||
lodash.detect = find;
|
||||
lodash.drop = rest;
|
||||
lodash.each = forEach;
|
||||
lodash.extend = assign;
|
||||
lodash.foldl = reduce;
|
||||
lodash.foldr = reduceRight;
|
||||
lodash.head = first;
|
||||
|
||||
73
lodash.min.js
vendored
73
lodash.min.js
vendored
@@ -1,39 +1,40 @@
|
||||
/*!
|
||||
Lo-Dash 0.9.0 lodash.com/license
|
||||
Lo-Dash 0.10.0 lodash.com/license
|
||||
Underscore.js 1.4.2 underscorejs.org/LICENSE
|
||||
*/
|
||||
;(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||Q),s=i?{}:e;if(i)for(n=t-1;++n<r;){var o=e[n]+"";(dt.call(s,o)?s[o]:s[o]=[]).push(e[n])}return function(e){if(i){var n=e+"";return dt.call(s,n)&&-1<j(s[n],e)}return-1<j(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(gt.call(u)):n),this instanceof r?(p.prototype=e.prototype,a=new p,(u=e.apply(a,u))&&Vt[typeof u]?u:a):e.apply(a,u)}var i=S(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:U}function l(){for(var e={b:"",c:"",e:Pt,f:Wt,g:"",h:jt,i:qt,j:ft,k:"",l:n},t,r=0;t=arguments[r];r++)for(var i in t)e[i]=t[i];t=e.a,e.d=/^[^,]+/.exec(t)[0],r="var h,w,j="+
|
||||
e.d+",r="+e.d+";if(!"+e.d+")return r;"+e.k+";",e.b?(r+="var k=j.length;h=-1;if(typeof k=='number'){",e.i&&(r+="if(v.call(j)==t){j=j.split('')}"),r+="while(++h<k){w=j[h];"+e.b+"}}else {"):e.h&&(r+="var k=j.length;h=-1;if(k&&i(j)){while(++h<k){w=j[h+=''];"+e.g+"}}else {"),e.e||(r+="var s=typeof j=='function'&&q.call(j,'prototype');");if(e.f&&e.l)r+="var o=-1,p=n[typeof j]?l(j):[],k=p.length;while(++o<k){h=p[o];",e.e||(r+="if(!(s&&h=='prototype')){"),r+="w=j[h];"+e.g+"",e.e||(r+="}");else{r+="for(h in j){"
|
||||
;if(!e.e||e.l)r+="if(",e.e||(r+="!(s&&h=='prototype')"),!e.e&&e.l&&(r+="&&"),e.l&&(r+="g.call(j,h)"),r+="){";r+="w=j[h];"+e.g+";";if(!e.e||e.l)r+="}"}r+="}";if(e.e){r+="var f=j.constructor;";for(i=0;7>i;i++)r+="h='"+e.j[i]+"';if(","constructor"==e.j[i]&&(r+="!(f&&f.prototype===j)&&"),r+="g.call(j,h)){w=j[h];"+e.g+"}"}if(e.b||e.h)r+="}";return r+=e.c+";return r",Function("e,g,i,n,l,q,t,v","return function("+t+"){"+r+"}")(f,dt,v,Vt,St,mt,Dt,yt)}function c(e){return"\\"+$t[e]}function h(e){return Zt
|
||||
[e]}function p(){}function d(e){return en[e]}function v(e){return yt.call(e)==Ct}function m(e){var t=i;if(!e||"object"!=typeof e||v(e))return t;var n=e.constructor;return(!Rt||"function"==typeof e.toString||"string"!=typeof (e+""))&&(!S(n)||n instanceof n)?Ht?(Gt(e,function(e,n,r){return t=!dt.call(r,n),i}),t===i):(Gt(e,function(e,n){t=n}),t===i||dt.call(e,t)):t}function g(e){var t=[];return Yt(e,function(e,n){t.push(n)}),t}function y(e,t,n,s,o){if(e==r)return e;n&&(t=i);if(n=Vt[typeof e]){var u=
|
||||
yt.call(e);if(!Xt[u]||Ft&&v(e))return e;var a=u==kt,n=a||(u==Mt?sn(e):n)}if(!n||!t)return n?a?gt.call(e):nn({},e):e;n=e.constructor;switch(u){case Lt:case At:return new n(+e);case Ot:case Dt:return new n(e);case _t:return n(e.source,rt.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?un:Yt)(e,function(e,n){f[n]=y(e,t,r,s,o)}),f}function b(e){var t=[];return Gt(e,function(e,n){S(e)&&t.push(n)}),t.sort()}function w(e){var t=
|
||||
{};return Yt(e,function(e,n){t[e]=n}),t}function E(e,t,s,o){if(e===t)return 0!==e||1/e==1/t;if(e==r||t==r)return e===t;var u=yt.call(e);if(u!=yt.call(t))return i;switch(u){case Lt:case At:return+e==+t;case Ot:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case _t:case Dt:return e==t+""}var a=u==kt||u==Ct;if(Ft&&!a&&(a=v(e))&&!v(t))return i;if(!a){if(e.__wrapped__||t.__wrapped__)return E(e.__wrapped__||e,t.__wrapped__||t);if(u!=Mt||Rt&&("function"!=typeof e.toString&&"string"==typeof (e+"")||"function"!=typeof
|
||||
t.toString&&"string"==typeof (t+"")))return i;var u=e.constructor,f=t.constructor;if(u!=f&&(!S(u)||!(u instanceof u&&S(f)&&f instanceof f)))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=E(e[l],t[l],s,o)););return f}for(var c in e)if(dt.call(e,c)&&(l++,!dt.call(t,c)||!E(e[c],t[c],s,o)))return i;for(c in t)if(dt.call(t,c)&&!(l--))return i;if(Pt)for(;7>++u;)if(c=ft[u],dt.call(e,c)&&(!dt.call
|
||||
(t,c)||!E(e[c],t[c],s,o)))return i;return n}function S(e){return"function"==typeof e}function x(e,t,n){var i=arguments,s=0,o=2,u=i[3],a=i[4];n!==K&&(u=[],a=[],o=i.length);for(;++s<o;)Yt(i[s],function(t,n){var i,s,o;if(t&&((s=rn(t))||sn(t))){for(var f=u.length;f--;)if(i=u[f]==t)break;i?e[n]=a[f]:(u.push(t),a.push(o=(o=e[n],s)?rn(o)?o:[]:sn(o)?o:{}),e[n]=x(o,t,K,u,a))}else t!=r&&(e[n]=t)});return e}function T(e){var t=[];return Yt(e,function(e){t.push(e)}),t}function N(e,t){return"number"==typeof (
|
||||
e?e.length:0)?-1<(yt.call(e)==Dt?e.indexOf(t):j(e,t)):P(e,function(e){return e===t})}function C(e,t,r){var i=n,t=f(t,r);return un(e,function(e,n,r){return i=t(e,n,r)}),!!i}function k(e,t,n){var r=[],t=f(t,n);return un(e,function(e,n,i){t(e,n,i)&&r.push(e)}),r}function L(e,t,r){var i,t=f(t,r);return P(e,function(e,r,s){return t(e,r,s)&&(i=e,n)}),i}function A(e,t,n){var r=-1,i=e?e.length:0,s=Array("number"==typeof i?i:0),t=f(t,n);if(rn(e))for(;++r<i;)s[r]=t(e[r],r,e);else un(e,function(e,n,i){s[++r
|
||||
]=t(e,n,i)});return s}function O(e,t,n){var r=-Infinity,i=-1,s=e?e.length:0,o=r;if(t||"number"!=typeof s)t=f(t,n),un(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 M(e,t){var n=[];return un(e,function(e){n.push(e[t])}),n}function _(e,t,n,r){var s=3>arguments.length,t=f(t,r);return un(e,function(e,r,o){n=s?(s=i,e):t(n,e,r,o)}),n}function D(e,t,n,r){var s=e,o=e?e.length:0,u=3>arguments.length;if("number"!=typeof o)var a=on(e),o=a.length;else qt&&yt
|
||||
.call(e)==Dt&&(s=e.split(""));return un(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 P(e,t,n){var r,t=f(t,n);return un(e,function(e,n,i){return!(r=t(e,n,i))}),!!r}function H(e,t,n){if(e)return t==r||n?e[0]:gt.call(e,0,t)}function B(e,t){for(var n=-1,r=e?e.length:0,i=[];++n<r;){var s=e[n];rn(s)?vt.apply(i,t?s:B(s)):i.push(s)}return i}function j(e,t,n){var r=-1,i=e?e.length:0;if("number"==typeof n)r=(0>n?xt(0,i+n):n||0)-1;else if(n)return r=I(e,t),e[r]===t?r:-1;
|
||||
for(;++r<i;)if(e[r]===t)return r;return-1}function F(e,t,n){return e?gt.call(e,t==r||n?1:t):[]}function I(e,t,n,r){for(var i=0,s=e?e.length:i,n=n?f(n,r):U,t=n(t);i<s;)r=i+s>>>1,n(e[r])<t?i=r+1:s=r;return i}function q(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>j(a,r))a.push(r),u.push(e[s]);return u}function R(e,t){return zt||bt&&2<arguments.length?bt.call.apply(bt,arguments):a(e,t,gt.call(arguments,2
|
||||
))}function U(e){return e}function z(e){un(b(e),function(t){var r=s[t]=e[t];s.prototype[t]=function(){var e=[this.__wrapped__];return vt.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,W="object"==typeof exports&&exports,X="object"==typeof global&&global;X.global===X&&(e=X);var V=[],$={},J=0,K={},Q=30,G=e._,Y=/[-?+=!~*%&^<>|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/,Z=/&(?:amp|lt|gt|quot|#x27);/g,et=/\b__p\+='';/g,tt=/\b(__p\+=)''\+/g
|
||||
,nt=/(__e\(.*?\)|\b__t\))\+'';/g,rt=/\w*$/,it=/(?:__e|__t=)\(\s*(?![\d\s"']|this\.)/g,st=RegExp("^"+($.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),ot=/($^)/,ut=/[&<>"']/g,at=/['\n\r\t\u2028\u2029\\]/g,ft="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),lt=Math.ceil,ct=V.concat,ht=Math.floor,pt=st.test(pt=Object.getPrototypeOf)&&pt,dt=$.hasOwnProperty,vt=V.push,mt=$.propertyIsEnumerable,gt=
|
||||
V.slice,yt=$.toString,bt=st.test(bt=gt.bind)&&bt,wt=st.test(wt=Array.isArray)&&wt,Et=e.isFinite,St=st.test(St=Object.keys)&&St,xt=Math.max,Tt=Math.min,Nt=Math.random,Ct="[object Arguments]",kt="[object Array]",Lt="[object Boolean]",At="[object Date]",Ot="[object Number]",Mt="[object Object]",_t="[object RegExp]",Dt="[object String]",Pt,Ht,Bt=(Bt={0:1,length:1},V.splice.call(Bt,0,1),Bt[0]),jt=n;(function(){function e(){this.x=1}var t=[];e.prototype={valueOf:1,y:1};for(var n in new e)t.push(n);for(
|
||||
n in arguments)jt=!n;Pt=!/valueOf/.test(t),Ht="x"!=t[0]})(1);var Ft=!v(arguments),It="x"!=gt.call("x")[0],qt="xx"!="x"[0]+Object("x")[0];try{var Rt=("[object Object]",yt.call(e.document||0)==Mt)}catch(Ut){}var zt=bt&&/\n|Opera/.test(bt+yt.call(e.opera)),Wt=St&&/^.+$|true/.test(St+!!e.attachEvent),Xt={};Xt[Ct]=Xt["[object Function]"]=i,Xt[kt]=Xt[Lt]=Xt[At]=Xt[Ot]=Xt[Mt]=Xt[_t]=Xt[Dt]=n;var Vt={"boolean":i,"function":n,object:n,number:i,string:i,"undefined":i},$t={"\\":"\\","'":"'","\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,u",k:"c=e(c,u)",b:"if(c(w,h,d)===false)return r",g:"if(c(w,h,d)===false)return r"},Kt={l:i,a:"m",k:"for(var a=1,b=arguments.length;a<b;a++){if(j=arguments[a]){",g:"r[h]=w",c:"}}"},Qt={b:r};Ft&&(v=function(e){return e?dt.call(e,"callee"):i});var Gt=l(Jt,Qt,{l:i}),Yt=l(Jt,Qt),Zt={"&":"&","<":"<",">":">",'"':"""
|
||||
,"'":"'"},en=w(Zt),tn=l(Kt,{g:"if(r[h]==null)"+Kt.g}),nn=l(Kt),rn=wt||function(e){return yt.call(e)==kt};S(/x/)&&(S=function(e){return"[object Function]"==yt.call(e)});var sn=pt?function(e){if(!e||"object"!=typeof e)return i;var t=e.valueOf,n="function"==typeof t&&(n=pt(t))&&pt(n);return n?e==n||pt(e)==n&&!v(e):m(e)}:m,on=St?function(e){var t=typeof e;return"function"==t&&mt.call(e,"prototype")?g(e):e&&Vt[t]?St(e):[]}:g,un=l(Jt);s.VERSION="0.9.0",s.after=function(e,t){return 1>e?t():function(
|
||||
){if(1>--e)return t.apply(this,arguments)}},s.bind=R,s.bindAll=function(e){for(var t=arguments,n=1<t.length?0:(t=b(e),-1),r=t.length;++n<r;){var i=t[n];e[i]=R(e[i],e)}return e},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=N,s.countBy=function(e,
|
||||
t,n){var r={},t=f(t,n);return un(e,function(e,n,i){n=t(e,n,i),dt.call(r,n)?r[n]++:r[n]=1}),r},s.debounce=function(e,t,n){function i(){a=r,n||(o=e.apply(u,s))}var s,o,u,a;return function(){var r=n&&!a;return s=arguments,u=this,clearTimeout(a),a=setTimeout(i,t),r&&(o=e.apply(u,s)),o}},s.defaults=tn,s.defer=function(e){var n=gt.call(arguments,1);return setTimeout(function(){e.apply(t,n)},1)},s.delay=function(e,n){var r=gt.call(arguments,2);return setTimeout(function(){e.apply(t,r)},n)},s.difference=
|
||||
function(e){for(var t=-1,n=e?e.length:0,r=ct.apply(V,arguments),r=o(r,n),i=[];++t<n;){var s=e[t];r(s)||i.push(s)}return i},s.escape=function(e){return e==r?"":(e+"").replace(ut,h)},s.every=C,s.extend=nn,s.filter=k,s.find=L,s.first=H,s.flatten=B,s.forEach=un,s.forIn=Gt,s.forOwn=Yt,s.functions=b,s.groupBy=function(e,t,n){var r={},t=f(t,n);return un(e,function(e,n,i){n=t(e,n,i),(dt.call(r,n)?r[n]:r[n]=[]).push(e)}),r},s.has=function(e,t){return e?dt.call(e,t):i},s.identity=U,s.indexOf=j,s.initial=function(
|
||||
e,t,n){return e?gt.call(e,0,-(t==r||n?1:t)):[]},s.intersection=function(e){var t=arguments,n=t.length,r={},i=[];return un(e,function(e){if(0>j(i,e)){for(var s=n;--s;)if(!(r[s]||(r[s]=o(t[s])))(e))return;i.push(e)}}),i},s.invert=w,s.invoke=function(e,t){var n=gt.call(arguments,2),r="function"==typeof t,i=[];return un(e,function(e){i.push((r?t:e[t]).apply(e,n))}),i},s.isArguments=v,s.isArray=rn,s.isBoolean=function(e){return e===n||e===i||yt.call(e)==Lt},s.isDate=function(e){return yt.call(e)==At},
|
||||
s.isElement=function(e){return e?1===e.nodeType:i},s.isEmpty=function(e){var t=n;if(!e)return t;var r=yt.call(e),s=e.length;return r==kt||r==Dt||r==Ct||Ft&&v(e)||r==Mt&&"number"==typeof s&&S(e.splice)?!s:(Yt(e,function(){return t=i}),t)},s.isEqual=E,s.isFinite=function(e){return Et(e?+e:parseFloat(e))},s.isFunction=S,s.isNaN=function(e){return yt.call(e)==Ot&&e!=+e},s.isNull=function(e){return e===r},s.isNumber=function(e){return yt.call(e)==Ot},s.isObject=function(e){return e?Vt[typeof e]:i},s.isPlainObject=
|
||||
sn,s.isRegExp=function(e){return yt.call(e)==_t},s.isString=function(e){return yt.call(e)==Dt},s.isUndefined=function(e){return e===t},s.keys=on,s.last=function(e,t,n){if(e){var i=e.length;return t==r||n?e[i-1]:gt.call(e,-t||i)}},s.lastIndexOf=function(e,t,n){var r=e?e.length:0;for("number"==typeof n&&(r=(0>n?xt(0,r+n):Tt(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},s.lateBind=function(e,t){return a(t,e,gt.call(arguments,2))},s.map=A,s.max=O,s.memoize=function(e,t){var n={};return function(){var r=
|
||||
t?t.apply(this,arguments):arguments[0];return dt.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},s.merge=x,s.min=function(e,t,n){var r=Infinity,i=-1,s=e?e.length:0,o=r;if(t||"number"!=typeof s)t=f(t,n),un(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=z,s.noConflict=function(){return e._=G,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=function(e,t,n){var r="function"==typeof
|
||||
t,i={};if(r)t=f(t,n);else var s=ct.apply(V,arguments);return Gt(e,function(e,n,o){if(r?!t(e,n,o):0>j(s,n,1))i[n]=e}),i},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=function(e){var t=[];return Yt(e,function(e,n){t.push([n,e])}),t},s.partial=function(e){return a(e,gt.call(arguments,1))},s.pick=function(e,t,n){var r={};if("function"!=typeof t)for(var i=0,s=ct.apply(V,arguments),o=s.length;++i<o;){var u=s[i];u in e&&(r[u]=e[u])}else t=f(t,
|
||||
n),Gt(e,function(e,n,i){t(e,n,i)&&(r[n]=e)});return r},s.pluck=M,s.random=function(e,t){return e==r&&t==r&&(t=1),e=+e||0,t==r&&(t=e,e=0),e+ht(Nt()*((+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=xt(0,lt((t-e)/n)),s=Array(t);++i<t;)s[i]=e,e+=n;return s},s.reduce=_,s.reduceRight=D,s.reject=function(e,t,n){return t=f(t,n),k(e,function(e,n,r){return!t(e,n,r)})},s.rest=F,s.result=function(e,t){var n=e?e[t]:r;return S(n)?e[t]():n},s.shuffle=function(e){var t=-1,n=
|
||||
Array(e?e.length:0);return un(e,function(e){var r=ht(Nt()*(++t+1));n[t]=n[r],n[r]=e}),n},s.size=function(e){var t=e?e.length:0;return"number"==typeof t?t:on(e).length},s.some=P,s.sortBy=function(e,t,n){var r=[],t=f(t,n);un(e,function(e,n,i){r.push({a:t(e,n,i),b:n,c:e})}),e=r.length;for(r.sort(u);e--;)r[e]=r[e].c;return r},s.sortedIndex=I,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||ot).source+"|"+(n.interpolate||u.interpolate||ot).source+"|"+(n.evaluate||u.evaluate||ot).source+"|$","g"),function(t,n,i,s,u){a+=e.slice(o,u).replace(at,c),a+=n?"'+__e("+n+")+'":s?"';"+s+";__p+='":i?"'+((__t=("+i+"))==null?'':__t)+'":"",r||(r=s||Y.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(it,"$&"+f+".").replace(n,"$1__d"))),a=(r?a.replace(et,""):a).replace(tt,"$1").replace(nt,"$1;"),
|
||||
a="function("+f+"){"+(l?"":f+"||("+f+"={});")+"var __t,__p='',__e=_.escape"+(r?",__j=[].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?(clearTimeout(u),a=r,s=e.apply(o,i)):u||(u=setTimeout
|
||||
(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){return e&&"number"==typeof e.length?(It?yt.call(e)==Dt:"string"==typeof e)?e.split(""):gt.call(e):T(e)},s.unescape=function(e){return e==r?"":(e+"").replace(Z,d)},s.union=function(){for(var e=-1,t=ct.apply(V,arguments),n=t.length,r=[];++e<n;){var i=t[e];0>j(r,i)&&r.push(i)}return r},s.uniq=q,s.uniqueId=function(e){var t=J++;return e?e+t:t},s.values=T,s.where=function(e,t){var n=
|
||||
[];return Gt(t,function(e,t){n.push(t)}),k(e,function(e){for(var r=n.length;r--;){var i=e[n[r]]===t[n[r]];if(!i)break}return!!i})},s.without=function(e){for(var t=-1,n=e?e.length:0,r=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 vt.apply(n,arguments),t.apply(this,n)}},s.zip=function(e){for(var t=-1,n=e?O(M(arguments,"length")):0,r=Array(n);++t<n;)r[t]=M(arguments,t);return r},s.all=C,s.any=P,s.collect=A,s.detect=L,s.drop=
|
||||
F,s.each=un,s.foldl=_,s.foldr=D,s.head=H,s.include=N,s.inject=_,s.methods=b,s.select=k,s.tail=F,s.take=H,s.unique=q,z(s),s.prototype.chain=function(){return this.__chain__=n,this},s.prototype.value=function(){return this.__wrapped__},un("pop push reverse shift sort splice unshift".split(" "),function(e){var t=V[e];s.prototype[e]=function(){var e=this.__wrapped__;return t.apply(e,arguments),Bt&&e.length===0&&delete e[0],this.__chain__&&(e=new s(e),e.__chain__=n),e}}),un(["concat","join","slice"],function(
|
||||
e){var t=V[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})):W?"object"==typeof module&&module&&module.exports==W?(module.exports=s)._=s:W._=s:e._=s})(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||Z);if(i)for(var s={},n=t-1;++n<r;){var o=e[n]+"";(bt.call(s,o)?s[o]:s[o]=[]).push(e[n])}return function(n){if(i){var r=n+"";return bt.call(s,r)&&-1<q(s[r],n)}return-1<q(e,n,t)}}function u(e){return e.charCodeAt(0)}function a(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 f
|
||||
(e,t,n){function r(){var u=arguments,a=s?this:t;return i||(e=t[o]),n.length&&(u=u.length?n.concat(St.call(u)):n),this instanceof r?(d.prototype=e.prototype,a=new d,u=e.apply(a,u),T(u)?u:a):e.apply(a,u)}var i=x(e),s=!n,o=t;return s&&(n=t),i||(t=e),r}function l(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:X}function c(){for(var e={b:"",c:"",e:qt,f:Qt,g:"",h:zt,i:Vt,j:dt,k:"",l:n},t,r=0;t=arguments[r];r++)for(var i in t)e[i]=t[i];t=e.a,e
|
||||
.d=/^[^,]+/.exec(t)[0],r="var i,x,l="+e.d+",t="+e.d+";if(!"+e.d+")return t;"+e.k+";",e.b?(r+="var m=l.length;i=-1;if(typeof m=='number'){",e.i&&(r+="if(k(l)){l=l.split('')}"),r+="while(++i<m){x=l[i];"+e.b+"}}else {"):e.h&&(r+="var m=l.length;i=-1;if(m&&j(l)){while(++i<m){x=l[i+=''];"+e.g+"}}else {"),e.e||(r+="var u=typeof l=='function'&&s.call(l,'prototype');");if(e.f&&e.l)r+="var q=-1,r=p[typeof l]?n(l):[],m=r.length;while(++q<m){i=r[q];",e.e||(r+="if(!(u&&i=='prototype')){"),r+="x=l[i];"+e.g+""
|
||||
,e.e||(r+="}");else{r+="for(i in l){";if(!e.e||e.l)r+="if(",e.e||(r+="!(u&&i=='prototype')"),!e.e&&e.l&&(r+="&&"),e.l&&(r+="h.call(l,i)"),r+="){";r+="x=l[i];"+e.g+";";if(!e.e||e.l)r+="}"}r+="}";if(e.e){r+="var f=l.constructor;";for(i=0;7>i;i++)r+="i='"+e.j[i]+"';if(","constructor"==e.j[i]&&(r+="!(f&&f.prototype===l)&&"),r+="h.call(l,i)){x=l[i];"+e.g+"}"}if(e.b||e.h)r+="}";return r+=e.c+";return t",Function("e,h,j,k,p,n,s","return function("+t+"){"+r+"}")(l,bt,m,N,Yt,Lt,Et)}function h(e){return"\\"+
|
||||
Zt[e]}function p(e){return un[e]}function d(){}function v(e){return an[e]}function m(e){return xt.call(e)==_t}function g(e){var t=i;if(!e||"object"!=typeof e||m(e))return t;var n=e.constructor;return(!$t||"function"==typeof e.toString||"string"!=typeof (e+""))&&(!x(n)||n instanceof n)?Rt?(sn(e,function(e,n,r){return t=!bt.call(r,n),i}),t===i):(sn(e,function(e,n){t=n}),t===i||bt.call(e,t)):t}function y(e){var t=[];return on(e,function(e,n){t.push(n)}),t}function b(e,t,n,s,o){if(e==r)return e;n&&(t=
|
||||
i);if(n=T(e)){var u=xt.call(e);if(!Gt[u]||Wt&&m(e))return e;var a=u==Dt,n=a||(u==jt?cn(e):n)}if(!n||!t)return n?a?St.call(e):rn({},e):e;n=e.constructor;switch(u){case Pt:case Ht:return new n(+e);case Bt:case It:return new n(e);case Ft:return n(e.source,ot.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?pn:on)(e,function(e,n){f[n]=b(e,t,r,s,o)}),f}function w(e){var t=[];return sn(e,function(e,n){x(e)&&t.push(n)}),t.sort()
|
||||
}function E(e){var t={};return on(e,function(e,n){t[e]=n}),t}function S(e,t,s,o){if(e===t)return 0!==e||1/e==1/t;if(e==r||t==r)return e===t;var u=xt.call(e);if(u!=xt.call(t))return i;switch(u){case Pt:case Ht:return+e==+t;case Bt:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case Ft:case It:return e==t+""}var a=u==Dt||u==_t;if(Wt&&!a&&(a=m(e))&&!m(t))return i;if(!a){if(e.__wrapped__||t.__wrapped__)return S(e.__wrapped__||e,t.__wrapped__||t);if(u!=jt||$t&&("function"!=typeof e.toString&&"string"==typeof
|
||||
(e+"")||"function"!=typeof t.toString&&"string"==typeof (t+"")))return i;var u=e.constructor,f=t.constructor;if(u!=f&&(!x(u)||!(u instanceof u&&x(f)&&f instanceof f)))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=S(e[l],t[l],s,o)););return f}for(var c in e)if(bt.call(e,c)&&(l++,!bt.call(t,c)||!S(e[c],t[c],s,o)))return i;for(c in t)if(bt.call(t,c)&&!(l--))return i;if(qt)for(;7>++u;)if(c=
|
||||
dt[u],bt.call(e,c)&&(!bt.call(t,c)||!S(e[c],t[c],s,o)))return i;return n}function x(e){return"function"==typeof e}function T(e){return e?Yt[typeof e]:i}function N(e){return xt.call(e)==It}function C(e,t,n){var i=arguments,s=0,o=2,u=i[3],a=i[4];n!==Y&&(u=[],a=[],"number"!=typeof n&&(o=i.length));for(;++s<o;)on(i[s],function(t,n){var i,s,o;if(t&&((s=ln(t))||cn(t))){for(var f=u.length;f--;)if(i=u[f]==t)break;i?e[n]=a[f]:(u.push(t),a.push(o=(o=e[n],s)?ln(o)?o:[]:cn(o)?o:{}),e[n]=C(o,t,Y,u,a))}else t!=
|
||||
r&&(e[n]=t)});return e}function k(e){var t=[];return on(e,function(e){t.push(e)}),t}function L(e,t,n){var r=-1,s=e?e.length:0,o=i,n=(0>n?At(0,s+n):n)||0;return"number"==typeof s?o=-1<(N(e)?e.indexOf(t,n):q(e,t,n)):pn(e,function(e){if(++r>=n)return!(o=e===t)}),o}function A(e,t,r){var i=n,t=l(t,r);if(ln(e))for(var r=-1,s=e.length;++r<s&&(i=!!t(e[r],r,e)););else pn(e,function(e,n,r){return i=!!t(e,n,r)});return i}function O(e,t,n){var r=[],t=l(t,n);if(ln(e))for(var n=-1,i=e.length;++n<i;){var s=e[n]
|
||||
;t(s,n,e)&&r.push(s)}else pn(e,function(e,n,i){t(e,n,i)&&r.push(e)});return r}function M(e,t,n){var r,t=l(t,n);return pn(e,function(e,n,s){if(t(e,n,s))return r=e,i}),r}function _(e,t,n){var r=-1,i=e?e.length:0,s=Array("number"==typeof i?i:0),t=l(t,n);if(ln(e))for(;++r<i;)s[r]=t(e[r],r,e);else pn(e,function(e,n,i){s[++r]=t(e,n,i)});return s}function D(e,t,n){var r=-Infinity,i=-1,s=e?e.length:0,o=r;if(t||!ln(e))t=!t&&N(e)?u:l(t,n),pn(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 P(e,t){var n=[];return pn(e,function(e){n.push(e[t])}),n}function H(e,t,n,r){var s=3>arguments.length,t=l(t,r);return pn(e,function(e,r,o){n=s?(s=i,e):t(n,e,r,o)}),n}function B(e,t,n,r){var s=e,o=e?e.length:0,u=3>arguments.length;if("number"!=typeof o)var a=hn(e),o=a.length;else Vt&&N(e)&&(s=e.split(""));return pn(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 j(e,t,n){var r,t=l(t,n);if(ln(e))for(var n=-1,i=e.length;++n<i&&!(r=t(
|
||||
e[n],n,e)););else pn(e,function(e,n,i){return!(r=t(e,n,i))});return!!r}function F(e,t,n){if(e)return t==r||n?e[0]:St.call(e,0,t)}function I(e,t){for(var n=-1,r=e?e.length:0,i=[];++n<r;){var s=e[n];ln(s)?wt.apply(i,t?s:I(s)):i.push(s)}return i}function q(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=U(e,t),e[r]===t?r:-1;for(;++r<i;)if(e[r]===t)return r;return-1}function R(e,t,n){return e?St.call(e,t==r||n?1:t):[]}function U(e,t,n,r){for(var i=0,s=
|
||||
e?e.length:i,n=n?l(n,r):X,t=n(t);i<s;)r=i+s>>>1,n(e[r])<t?i=r+1:s=r;return i}function z(e,t,n,r){var s=-1,o=e?e.length:0,u=[],a=u;"function"==typeof t&&(r=n,n=t,t=i);var f=!t&&74<o;if(f)var c={};n&&(a=[],n=l(n,r));for(;++s<o;){var r=e[s],h=n?n(r,s,e):r;f&&(a=bt.call(c,h+"")?c[h]:c[h]=[]);if(t?!s||a[a.length-1]!==h:0>q(a,h))(n||f)&&a.push(h),u.push(r)}return u}function W(e,t){return Kt||Tt&&2<arguments.length?Tt.call.apply(Tt,arguments):f(e,t,St.call(arguments,2))}function X(e){return e}function V
|
||||
(e){pn(w(e),function(t){var r=s[t]=e[t];s.prototype[t]=function(){var e=[this.__wrapped__];return wt.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,$="object"==typeof exports&&exports,J="object"==typeof global&&global;J.global===J&&(e=J);var K=[],Q=new function(){},G=0,Y=Q,Z=30,et=e._,tt=/[-?+=!~*%&^<>|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/,nt=/&(?:amp|lt|gt|quot|#x27);/g,rt=/\b__p\+='';/g,it=/\b(__p\+=)''\+/g,st=/(__e\(.*?\)|\b__t\))\+'';/g
|
||||
,ot=/\w*$/,ut=/(?:__e|__t=)\(\s*(?![\d\s"']|this\.)/g,at=RegExp("^"+(Q.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),ft=/\$\{((?:(?=\\?)\\?[\s\S])*?)}/g,lt=/<%=([\s\S]+?)%>/g,ct=/($^)/,ht=/[&<>"']/g,pt=/['\n\r\t\u2028\u2029\\]/g,dt="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),vt=Math.ceil,mt=K.concat,gt=Math.floor,yt=at.test(yt=Object.getPrototypeOf)&&yt,bt=Q.hasOwnProperty,wt=K.push,Et=
|
||||
Q.propertyIsEnumerable,St=K.slice,xt=Q.toString,Tt=at.test(Tt=St.bind)&&Tt,Nt=at.test(Nt=Array.isArray)&&Nt,Ct=e.isFinite,kt=e.isNaN,Lt=at.test(Lt=Object.keys)&&Lt,At=Math.max,Ot=Math.min,Mt=Math.random,_t="[object Arguments]",Dt="[object Array]",Pt="[object Boolean]",Ht="[object Date]",Bt="[object Number]",jt="[object Object]",Ft="[object RegExp]",It="[object String]",qt,Rt,Ut=(Ut={0:1,length:1},K.splice.call(Ut,0,1),Ut[0]),zt=n;(function(){function e(){this.x=1}var t=[];e.prototype={valueOf:1,y
|
||||
:1};for(var n in new e)t.push(n);for(n in arguments)zt=!n;qt=!/valueOf/.test(t),Rt="x"!=t[0]})(1);var Wt=!m(arguments),Xt="x"!=St.call("x")[0],Vt="xx"!="x"[0]+Object("x")[0];try{var $t=("[object Object]",xt.call(e.document||0)==jt)}catch(Jt){}var Kt=Tt&&/\n|Opera/.test(Tt+xt.call(e.opera)),Qt=Lt&&/^.+$|true/.test(Lt+!!e.attachEvent),Gt={};Gt[_t]=Gt["[object Function]"]=i,Gt[Dt]=Gt[Pt]=Gt[Ht]=Gt[Bt]=Gt[jt]=Gt[Ft]=Gt[It]=n;var Yt={"boolean":i,"function":n,object:n,number:i,string:i,"undefined":i},Zt=
|
||||
{"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};s.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:lt,variable:""};var en={a:"o,v,g",k:"for(var a=1,b=typeof g=='number'?2:arguments.length;a<b;a++){if((l=arguments[a])){",g:"t[i]=x",c:"}}"},tn={a:"d,c,w",k:"c=e(c,w)",b:"if(c(x,i,d)===false)return t",g:"if(c(x,i,d)===false)return t"},nn={b:r},rn=c(en);Wt&&(m=function(e){return e?bt.call(e,"callee"):i});var sn=c(tn,nn,{l:i}),on=c(tn,nn
|
||||
),un={"&":"&","<":"<",">":">",'"':""","'":"'"},an=E(un),fn=c(en,{g:"if(t[i]==null)"+en.g}),ln=Nt||function(e){return xt.call(e)==Dt};x(/x/)&&(x=function(e){return"[object Function]"==xt.call(e)});var cn=yt?function(e){if(!e||"object"!=typeof e)return i;var t=e.valueOf,n="function"==typeof t&&(n=yt(t))&&yt(n);return n?e==n||yt(e)==n&&!m(e):g(e)}:g,hn=Lt?function(e){return"function"==typeof e&&Et.call(e,"prototype")?y(e):T(e)?Lt(e):[]}:y,pn=c(tn);s.VERSION="0.10.0",s.assign=rn,s
|
||||
.after=function(e,t){return 1>e?t():function(){if(1>--e)return t.apply(this,arguments)}},s.bind=W,s.bindAll=function(e){for(var t=arguments,n=1<t.length?0:(t=w(e),-1),r=t.length;++n<r;){var i=t[n];e[i]=W(e[i],e)}return e},s.bindKey=function(e,t){return f(e,t,St.call(arguments,2))},s.chain=function(e){return e=new s(e),e.__chain__=n,e},s.clone=b,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=L,s.countBy=function(e,t,n){var r={},t=l(t,n);return pn(e,function(e,n,i){n=t(e,n,i),bt.call(r,n)?r[n]++:r[n]=1}),r},s.debounce=function(e,t,n){function i(){a=r,n||(o=e.apply(u,s))}var s,o,u,a;return function(){var r=n&&!a;return s=arguments,u=this,clearTimeout(a),a=setTimeout(i,t),r&&(o=e.apply(u,s)),o}},s.defaults=fn,s.defer=function(e){var n=St.call(arguments,1);return setTimeout(function(){e.apply(t,n)},1)},s.delay=
|
||||
function(e,n){var r=St.call(arguments,2);return setTimeout(function(){e.apply(t,r)},n)},s.difference=function(e){for(var t=-1,n=e?e.length:0,r=mt.apply(K,arguments),r=o(r,n),i=[];++t<n;){var s=e[t];r(s)||i.push(s)}return i},s.escape=function(e){return e==r?"":(e+"").replace(ht,p)},s.every=A,s.filter=O,s.find=M,s.first=F,s.flatten=I,s.forEach=pn,s.forIn=sn,s.forOwn=on,s.functions=w,s.groupBy=function(e,t,n){var r={},t=l(t,n);return pn(e,function(e,n,i){n=t(e,n,i),(bt.call(r,n)?r[n]:r[n]=[]).push(e
|
||||
)}),r},s.has=function(e,t){return e?bt.call(e,t):i},s.identity=X,s.indexOf=q,s.initial=function(e,t,n){return e?St.call(e,0,-(t==r||n?1:t)):[]},s.intersection=function(e){var t=arguments,n=t.length,r={},i=[];return pn(e,function(e){if(0>q(i,e)){for(var s=n;--s;)if(!(r[s]||(r[s]=o(t[s])))(e))return;i.push(e)}}),i},s.invert=E,s.invoke=function(e,t){var n=St.call(arguments,2),r="function"==typeof t,i=[];return pn(e,function(e){i.push((r?t:e[t]).apply(e,n))}),i},s.isArguments=m,s.isArray=ln,s.isBoolean=
|
||||
function(e){return e===n||e===i||xt.call(e)==Pt},s.isDate=function(e){return xt.call(e)==Ht},s.isElement=function(e){return e?1===e.nodeType:i},s.isEmpty=function(e){var t=n;if(!e)return t;var r=xt.call(e),s=e.length;return r==Dt||r==It||r==_t||Wt&&m(e)||r==jt&&"number"==typeof s&&x(e.splice)?!s:(on(e,function(){return t=i}),t)},s.isEqual=S,s.isFinite=function(e){return Ct(e)&&!kt(parseFloat(e))},s.isFunction=x,s.isNaN=function(e){return xt.call(e)==Bt&&e!=+e},s.isNull=function(e){return e===r},s
|
||||
.isNumber=function(e){return xt.call(e)==Bt},s.isObject=T,s.isPlainObject=cn,s.isRegExp=function(e){return xt.call(e)==Ft},s.isString=N,s.isUndefined=function(e){return e===t},s.keys=hn,s.last=function(e,t,n){if(e){var i=e.length;return t==r||n?e[i-1]:St.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):Ot(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},s.map=_,s.max=D,s.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments
|
||||
):arguments[0];return bt.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},s.merge=C,s.min=function(e,t,n){var r=Infinity,i=-1,s=e?e.length:0,o=r;if(t||!ln(e))t=!t&&N(e)?u:l(t,n),pn(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=V,s.noConflict=function(){return e._=et,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=function(e,t,n){var r="function"==typeof t,i={};if(r)t=l(t,n);
|
||||
else var s=mt.apply(K,arguments);return sn(e,function(e,n,o){if(r?!t(e,n,o):0>q(s,n,1))i[n]=e}),i},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=function(e){var t=[];return on(e,function(e,n){t.push([n,e])}),t},s.partial=function(e){return f(e,St.call(arguments,1))},s.pick=function(e,t,n){var r={};if("function"!=typeof t)for(var i=0,s=mt.apply(K,arguments),o=s.length;++i<o;){var u=s[i];u in e&&(r[u]=e[u])}else t=l(t,n),sn(e,function(e,n,
|
||||
i){t(e,n,i)&&(r[n]=e)});return r},s.pluck=P,s.random=function(e,t){return e==r&&t==r&&(t=1),e=+e||0,t==r&&(t=e,e=0),e+gt(Mt()*((+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,vt((t-e)/n)),s=Array(t);++i<t;)s[i]=e,e+=n;return s},s.reduce=H,s.reduceRight=B,s.reject=function(e,t,n){return t=l(t,n),O(e,function(e,n,r){return!t(e,n,r)})},s.rest=R,s.result=function(e,t){var n=e?e[t]:r;return x(n)?e[t]():n},s.shuffle=function(e){var t=-1,n=Array(e?e.length:0);return pn
|
||||
(e,function(e){var r=gt(Mt()*(++t+1));n[t]=n[r],n[r]=e}),n},s.size=function(e){var t=e?e.length:0;return"number"==typeof t?t:hn(e).length},s.some=j,s.sortBy=function(e,t,n){var r=[],t=l(t,n);pn(e,function(e,n,i){r.push({a:t(e,n,i),b:n,c:e})}),e=r.length;for(r.sort(a);e--;)r[e]=r[e].c;return r},s.sortedIndex=U,s.tap=function(e,t){return t(e),e},s.template=function(e,t,n){e||(e=""),n||(n={});var r,i,o=s.templateSettings,u=0,a=n.interpolate||o.interpolate||ct,f="__p += '",l=n.variable||o.variable,c=
|
||||
l;e.replace(RegExp((n.escape||o.escape||ct).source+"|"+a.source+"|"+(a===lt?ft:ct).source+"|"+(n.evaluate||o.evaluate||ct).source+"|$","g"),function(t,n,i,s,o,a){i||(i=s),f+=e.slice(u,a).replace(pt,h),f+=n?"'+__e("+n+")+'":o?"';"+o+";__p+='":i?"'+((__t=("+i+"))==null?'':__t)+'":"",r||(r=o||tt.test(n||i)),u=a+t.length}),f+="';",c||(l="obj",r?f="with("+l+"){"+f+"}":(n=RegExp("(\\(\\s*)"+l+"\\."+l+"\\b","g"),f=f.replace(ut,"$&"+l+".").replace(n,"$1__d"))),f=(r?f.replace(rt,""):f).replace(it,"$1").replace
|
||||
(st,"$1;"),f="function("+l+"){"+(c?"":l+"||("+l+"={});")+"var __t,__p='',__e=_.escape"+(r?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(c?"":",__d="+l+"."+l+"||"+l)+";")+f+"return __p}";try{i=Function("_","return "+f)(s)}catch(p){throw p.source=f,p}return t?i(t):(i.source=f,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?(clearTimeout(u),a=r,s=e.apply(o,i)
|
||||
):u||(u=setTimeout(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){return e&&"number"==typeof e.length?(Xt?N(e):"string"==typeof e)?e.split(""):St.call(e):k(e)},s.unescape=function(e){return e==r?"":(e+"").replace(nt,v)},s.union=function(){return z(mt.apply(K,arguments))},s.uniq=z,s.uniqueId=function(e){var t=G++;return e?e+t:t},s.values=k,s.where=function(e,t){var n=hn(t);return O(e,function(e){for(var r=n.length;r--;){var i=
|
||||
e[n[r]]===t[n[r]];if(!i)break}return!!i})},s.without=function(e){for(var t=-1,n=e?e.length:0,r=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 wt.apply(n,arguments),t.apply(this,n)}},s.zip=function(e){for(var t=-1,n=e?D(P(arguments,"length")):0,r=Array(n);++t<n;)r[t]=P(arguments,t);return r},s.all=A,s.any=j,s.collect=_,s.detect=M,s.drop=R,s.each=pn,s.extend=rn,s.foldl=H,s.foldr=B,s.head=F,s.include=L,s.inject=H,s.methods=
|
||||
w,s.select=O,s.tail=R,s.take=F,s.unique=z,V(s),s.prototype.chain=function(){return this.__chain__=n,this},s.prototype.value=function(){return this.__wrapped__},pn("pop push reverse shift sort splice unshift".split(" "),function(e){var t=K[e];s.prototype[e]=function(){var e=this.__wrapped__;return t.apply(e,arguments),Ut&&e.length===0&&delete e[0],this.__chain__&&(e=new s(e),e.__chain__=n),e}}),pn(["concat","join","slice"],function(e){var t=K[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})):$?"object"==typeof module&&module&&module.exports==$?(module.exports=s)._=s:$._=s:e._=s})(this);
|
||||
57
lodash.underscore.min.js
vendored
57
lodash.underscore.min.js
vendored
@@ -1,31 +1,32 @@
|
||||
/*!
|
||||
Lo-Dash 0.9.0 lodash.com/license
|
||||
Lo-Dash 0.10.0 (Custom Build) lodash.com/license
|
||||
Build: `lodash underscore -m -o ./lodash.underscore.min.js`
|
||||
Underscore.js 1.4.2 underscorejs.org/LICENSE
|
||||
*/
|
||||
;(function(e,t){function s(e,t,n){var r;if(!e)return e;var t=p(t,n),i=e.length,n=-1;if("number"==typeof i)for(;++n<i&&(r=e[n],t(r,n,e)!==J););else for(n in e)if(it.call(e,n)&&(r=e[n],t(r,n,e)===J))break;return e}function o(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 u(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}function a(e,t)
|
||||
{var n,r;if(e)for(n in t=p(t),e)if(it.call(e,n)&&(r=e[n],t(r,n,e)===J))break}function f(e,t){var n,r;if(e)for(n in t=p(t),e)if(r=e[n],t(r,n,e)===J)break}function l(e){if(e&&e.__wrapped__)return e;if(!(this instanceof l))return new l(e);this.__wrapped__=e}function c(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 h(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?(m.prototype=
|
||||
e.prototype,s=new m,(i=e.apply(s,i))&&Tt[typeof i]?i:s):e.apply(s,i)}return r}function p(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:U}function d(e){return"\\"+Nt[e]}function v(e){return Ct[e]}function m(){}function g(e){return kt[e]}function y(e){var t=[];return a(e,function(e,n){t.push(n)}),t}function b(e){var t=[];return f(e,function(e,n){S(e)&&t.push(n)}),t.sort()}function w(e){var t={};return a(e,function(e,n){t[e]=n}),t}function E
|
||||
(e,t,s,o){if(e===t)return 0!==e||1/e==1/t;if(e==r||t==r)return e===t;var u=ut.call(e);if(u!=ut.call(t))return i;switch(u){case mt:case gt:return+e==+t;case yt:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case wt:case Et:return e==t+""}var a=u==vt;if(!a){if(e.__wrapped__||t.__wrapped__)return E(e.__wrapped__||e,t.__wrapped__||t);if(u!=bt)return i;var u=e.constructor,f=t.constructor;if(u!=f&&(!S(u)||!(u instanceof u&&S(f)&&f instanceof f)))return i}s||(s=[]),o||(o=[]);for(u=s.length;u--;)if(s[u]==e)return o
|
||||
[u]==t;u=n,f=0,s.push(e),o.push(t);if(a){f=e.length;if(u=f==t.length)for(;f--&&(u=E(e[f],t[f],s,o)););return u}for(var l in e)if(it.call(e,l)&&(f++,!it.call(t,l)||!E(e[l],t[l],s,o)))return i;for(l in t)if(it.call(t,l)&&!(f--))return i;return n}function S(e){return"function"==typeof e}function x(e){return ut.call(e)==Et}function T(e){var t=[];return a(e,function(e){t.push(e)}),t}function N(e,t){return"number"==typeof (e?e.length:0)?-1<j(e,t):P(e,function(e){return e===t})}function C(e,t,r){var i=n
|
||||
,t=p(t,r);return s(e,function(e,n,r){return!(i=t(e,n,r))&&J}),!!i}function k(e,t,n){var r=[],t=p(t,n);return s(e,function(e,n,i){t(e,n,i)&&r.push(e)}),r}function L(e,t,r){var i,t=p(t,r);return P(e,function(e,r,s){return t(e,r,s)&&(i=e,n)}),i}function A(e,t,n){var r=-1,i=e?e.length:0,o=Array("number"==typeof i?i:0),t=p(t,n);if(Lt(e))for(;++r<i;)o[r]=t(e[r],r,e);else s(e,function(e,n,i){o[++r]=t(e,n,i)});return o}function O(e,t,n){var r=-Infinity,i=-1,o=e?e.length:0,u=r;if(t||"number"!=typeof o)t=p
|
||||
(t,n),s(e,function(e,n,i){n=t(e,n,i),n>r&&(r=n,u=e)});else for(;++i<o;)e[i]>u&&(u=e[i]);return u}function M(e,t){var n=[];return s(e,function(e){n.push(e[t])}),n}function _(e,t,n,r){var o=3>arguments.length,t=p(t,r);return s(e,function(e,r,s){n=o?(o=i,e):t(n,e,r,s)}),n}function D(e,t,n,r){var o=e?e.length:0,u=3>arguments.length;if("number"!=typeof o)var a=At(e),o=a.length;return s(e,function(s,f,l){f=a?a[--o]:--o,n=u?(u=i,e[f]):t.call(r,n,e[f],f,l)}),n}function P(e,t,n){var r,t=p(t,n);return s(e,
|
||||
function(e,n,i){return(r=t(e,n,i))&&J}),!!r}function H(e,t,n){if(e)return t==r||n?e[0]:ot.call(e,0,t)}function B(e,t){for(var n=-1,r=e?e.length:0,i=[];++n<r;){var s=e[n];Lt(s)?st.apply(i,t?s:B(s)):i.push(s)}return i}function j(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=I(e,t),e[r]===t?r:-1;for(;++r<i;)if(e[r]===t)return r;return-1}function F(e,t,n){return e?ot.call(e,t==r||n?1:t):[]}function I(e,t,n,r){for(var i=0,s=e?e.length:i,n=n?p(n,r):U,t=
|
||||
n(t);i<s;)r=i+s>>>1,n(e[r])<t?i=r+1:s=r;return i}function q(e,t,n,r){for(var i=-1,s=e?e.length:0,o=[],u=[],n=p(n,r);++i<s;)if(r=n(e[i],i,e),t?!i||u[u.length-1]!==r:0>j(u,r))u.push(r),o.push(e[i]);return o}function R(e,t){return xt||at&&2<arguments.length?at.call.apply(at,arguments):h(e,t,ot.call(arguments,2))}function U(e){return e}function z(e){s(b(e),function(t){var r=l[t]=e[t];l.prototype[t]=function(){var e=[this.__wrapped__];return st.apply(e,arguments),e=r.apply(l,e),this.__chain__&&(e=new
|
||||
l(e),e.__chain__=n),e}})}var n=!0,r=null,i=!1,W="object"==typeof exports&&exports,X="object"==typeof global&&global;X.global===X&&(e=X);var V=[],X={},$=0,J={},K=e._,Q=/&(?:amp|lt|gt|quot|#x27);/g,G=RegExp("^"+(X.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),Y=/($^)/,Z=/[&<>"']/g,et=/['\n\r\t\u2028\u2029\\]/g,tt=Math.ceil,nt=V.concat,rt=Math.floor,it=X.hasOwnProperty,st=V.push,ot=V.slice,ut=X.toString,at=G.test(at=ot.bind)&&at,ft=G.test(ft=Array.isArray
|
||||
)&&ft,lt=e.isFinite,ct=G.test(ct=Object.keys)&&ct,ht=Math.max,pt=Math.min,dt=Math.random,vt="[object Array]",mt="[object Boolean]",gt="[object Date]",yt="[object Number]",bt="[object Object]",wt="[object RegExp]",Et="[object String]",St=(St={0:1,length:1},V.splice.call(St,0,1),St[0]),xt=at&&/\n|Opera/.test(at+ut.call(e.opera)),Tt={"boolean":i,"function":n,object:n,number:i,string:i,"undefined":i},Nt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};l.templateSettings=
|
||||
{escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},l.isArguments=function(e){return"[object Arguments]"==ut.call(e)},l.isArguments(arguments)||(l.isArguments=function(e){return e?it.call(e,"callee"):i});var Ct={"&":"&","<":"<",">":">",'"':""","'":"'"},kt=w(Ct),Lt=ft||function(e){return ut.call(e)==vt};S(/x/)&&(S=function(e){return"[object Function]"==ut.call(e)});var At=ct?function(e){return e&&Tt[typeof e]?ct(e):[]}:y;l.VERSION="0.9.0"
|
||||
,l.after=function(e,t){return 1>e?t():function(){if(1>--e)return t.apply(this,arguments)}},l.bind=R,l.bindAll=function(e){for(var t=arguments,n=1<t.length?0:(t=b(e),-1),r=t.length;++n<r;){var i=t[n];e[i]=R(e[i],e)}return e},l.chain=function(e){return e=new l(e),e.__chain__=n,e},l.clone=function(e){return e&&Tt[typeof e]?Lt(e)?ot.call(e):o({},e):e},l.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},l.compose=function(){var e=arguments;return function()
|
||||
{for(var t=arguments,n=e.length;n--;)t=[e[n].apply(this,t)];return t[0]}},l.contains=N,l.countBy=function(e,t,n){var r={},t=p(t,n);return s(e,function(e,n,i){n=t(e,n,i),it.call(r,n)?r[n]++:r[n]=1}),r},l.debounce=function(e,t,n){function i(){a=r,n||(o=e.apply(u,s))}var s,o,u,a;return function(){var r=n&&!a;return s=arguments,u=this,clearTimeout(a),a=setTimeout(i,t),r&&(o=e.apply(u,s)),o}},l.defaults=u,l.defer=function(e){var n=ot.call(arguments,1);return setTimeout(function(){e.apply(t,n)},1)},l.delay=
|
||||
function(e,n){var r=ot.call(arguments,2);return setTimeout(function(){e.apply(t,r)},n)},l.difference=function(e){for(var t=-1,n=e.length,r=nt.apply(V,arguments),i=[];++t<n;){var s=e[t];0>j(r,s,n)&&i.push(s)}return i},l.escape=function(e){return e==r?"":(e+"").replace(Z,v)},l.every=C,l.extend=o,l.filter=k,l.find=L,l.first=H,l.flatten=B,l.forEach=s,l.functions=b,l.groupBy=function(e,t,n){var r={},t=p(t,n);return s(e,function(e,n,i){n=t(e,n,i),(it.call(r,n)?r[n]:r[n]=[]).push(e)}),r},l.has=function(
|
||||
e,t){return e?it.call(e,t):i},l.identity=U,l.indexOf=j,l.initial=function(e,t,n){return e?ot.call(e,0,-(t==r||n?1:t)):[]},l.intersection=function(e){var t=arguments,n=t.length,r=[];return s(e,function(e){if(0>j(r,e)){for(var i=n;--i;)if(0>j(t[i],e))return;r.push(e)}}),r},l.invert=w,l.invoke=function(e,t){var n=ot.call(arguments,2),r="function"==typeof t,i=[];return s(e,function(e){i.push((r?t:e[t]).apply(e,n))}),i},l.isArray=Lt,l.isBoolean=function(e){return e===n||e===i||ut.call(e)==mt},l.isDate=
|
||||
function(e){return ut.call(e)==gt},l.isElement=function(e){return e?1===e.nodeType:i},l.isEmpty=function(e){if(!e)return n;if(Lt(e)||x(e))return!e.length;for(var t in e)if(it.call(e,t))return i;return n},l.isEqual=E,l.isFinite=function(e){return lt(e?+e:parseFloat(e))},l.isFunction=S,l.isNaN=function(e){return ut.call(e)==yt&&e!=+e},l.isNull=function(e){return e===r},l.isNumber=function(e){return ut.call(e)==yt},l.isObject=function(e){return e?Tt[typeof e]:i},l.isRegExp=function(e){return ut.call
|
||||
(e)==wt},l.isString=x,l.isUndefined=function(e){return e===t},l.keys=At,l.last=function(e,t,n){if(e){var i=e.length;return t==r||n?e[i-1]:ot.call(e,-t||i)}},l.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},l.map=A,l.max=O,l.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)}},l.min=function(e,t,n){var r=Infinity
|
||||
,i=-1,o=e?e.length:0,u=r;if(t||"number"!=typeof o)t=p(t,n),s(e,function(e,n,i){n=t(e,n,i),n<r&&(r=n,u=e)});else for(;++i<o;)e[i]<u&&(u=e[i]);return u},l.mixin=z,l.noConflict=function(){return e._=K,this},l.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},l.omit=function(e){var t=nt.apply(V,arguments),n={};return f(e,function(e,r){0>j(t,r,1)&&(n[r]=e)}),n},l.once=function(e){var t,s=i;return function(){return s?t:(s=n,t=e.apply(this,arguments
|
||||
),e=r,t)}},l.pairs=function(e){var t=[];return a(e,function(e,n){t.push([n,e])}),t},l.pick=function(e){for(var t=0,n=nt.apply(V,arguments),r=n.length,i={};++t<r;){var s=n[t];s in e&&(i[s]=e[s])}return i},l.pluck=M,l.random=function(e,t){return e==r&&t==r&&(t=1),e=+e||0,t==r&&(t=e,e=0),e+rt(dt()*((+t||0)-e+1))},l.range=function(e,t,n){e=+e||0,n=+n||1,t==r&&(t=e,e=0);for(var i=-1,t=ht(0,tt((t-e)/n)),s=Array(t);++i<t;)s[i]=e,e+=n;return s},l.reduce=_,l.reduceRight=D,l.reject=function(e,t,n){return t=
|
||||
p(t,n),k(e,function(e,n,r){return!t(e,n,r)})},l.rest=F,l.result=function(e,t){var n=e?e[t]:r;return S(n)?e[t]():n},l.shuffle=function(e){var t=-1,n=Array(e?e.length:0);return s(e,function(e){var r=rt(dt()*(++t+1));n[t]=n[r],n[r]=e}),n},l.size=function(e){var t=e?e.length:0;return"number"==typeof t?t:At(e).length},l.some=P,l.sortBy=function(e,t,n){var r=[],t=p(t,n);s(e,function(e,n,i){r.push({a:t(e,n,i),b:n,c:e})}),e=r.length;for(r.sort(c);e--;)r[e]=r[e].c;return r},l.sortedIndex=I,l.tap=function(
|
||||
e,t){return t(e),e},l.template=function(e,t,n){e||(e="");var n=u({},n,l.templateSettings),r=0,i="__p += '",s=n.variable;e.replace(RegExp((n.escape||Y).source+"|"+(n.interpolate||Y).source+"|"+(n.evaluate||Y).source+"|$","g"),function(t,n,s,o,u){i+=e.slice(r,u).replace(et,d),i+=n?"'+_['escape']("+n+")+'":o?"';"+o+";__p+='":s?"'+((__t=("+s+"))==null?'':__t)+'":"",r=u+t.length}),i+="';",s||(s="obj",i="with("+s+"||{}){"+i+"}"),i="function("+s+"){var __t,__p='',__j=[].join;function print(){__p+=__j.call(arguments,'')}"+
|
||||
i+"return __p}";try{var o=Function("_","return "+i)(l)}catch(a){throw a.source=i,a}return t?o(t):(o.source=i,o)},l.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?(clearTimeout(u),a=r,s=e.apply(o,i)):u||(u=setTimeout(n,f)),s}},l.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},l.toArray=function(e){return e&&"number"==typeof e.length?"string"==typeof e?
|
||||
e.split(""):ot.call(e):T(e)},l.unescape=function(e){return e==r?"":(e+"").replace(Q,g)},l.union=function(){for(var e=-1,t=nt.apply(V,arguments),n=t.length,r=[];++e<n;){var i=t[e];0>j(r,i)&&r.push(i)}return r},l.uniq=q,l.uniqueId=function(e){var t=$++;return e?e+t:t},l.values=T,l.where=function(e,t){var n=[];return f(t,function(e,t){n.push(t)}),k(e,function(e){for(var r=n.length;r--;){var i=e[n[r]]===t[n[r]];if(!i)break}return!!i})},l.without=function(e){for(var t=-1,n=e.length,r=[];++t<n;){var i=
|
||||
e[t];0>j(arguments,i,1)&&r.push(i)}return r},l.wrap=function(e,t){return function(){var n=[e];return st.apply(n,arguments),t.apply(this,n)}},l.zip=function(e){for(var t=-1,n=e?O(M(arguments,"length")):0,r=Array(n);++t<n;)r[t]=M(arguments,t);return r},l.all=C,l.any=P,l.collect=A,l.detect=L,l.drop=F,l.each=s,l.foldl=_,l.foldr=D,l.head=H,l.include=N,l.inject=_,l.methods=b,l.select=k,l.tail=F,l.take=H,l.unique=q,z(l),l.prototype.chain=function(){return this.__chain__=n,this},l.prototype.value=function(
|
||||
){return this.__wrapped__},s("pop push reverse shift sort splice unshift".split(" "),function(e){var t=V[e];l.prototype[e]=function(){var e=this.__wrapped__;return t.apply(e,arguments),St&&e.length===0&&delete e[0],this.__chain__&&(e=new l(e),e.__chain__=n),e}}),s(["concat","join","slice"],function(e){var t=V[e];l.prototype[e]=function(){var e=t.apply(this.__wrapped__,arguments);return this.__chain__&&(e=new l(e),e.__chain__=n),e}}),W?"object"==typeof module&&module&&module.exports==W?(module.exports=
|
||||
l)._=l:W._=l:e._=l})(this);
|
||||
;(function(e,t){function n(e){if(e&&e.__wrapped__)return e;if(!(this instanceof n))return new n(e);this.__wrapped__=e}function r(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 i(e,t,n){function r(){var i=arguments,s=t;return n.length&&(i=i.length?n.concat(tt.call(i)):n),this instanceof r?(a.prototype=e.prototype,s=new a,i=e.apply(s,i),g(i)?i:s):e.apply(s,i)}return r}function s(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:j}function o(e){return"\\"+wt[e]}function u(e){return xt[e]}function a(){}function f(e){return Tt[e]}function l(e){if(!e)return e;for(var t=1,n=arguments.length;t<n;t++){var r=arguments[t];if(r)for(var i in r)e[i]=r[i]}return e}function c(e){var t=[];return St(e,function(e,n){t.push(n)}),t}function h(e){if(!e)return e;for(var t=1,n=arguments.length;t<n;t++){var r=arguments[t];if(r)for(var i in r)null==e[i]&&(e[i]=r[i])}return e}function p(e){var t=
|
||||
[];return Et(e,function(e,n){m(e)&&t.push(n)}),t.sort()}function d(e){var t={};return St(e,function(e,n){t[e]=n}),t}function v(e,t,n,r){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return e===t;var i=nt.call(e);if(i!=nt.call(t))return!1;switch(i){case ct:case ht:return+e==+t;case pt:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case vt:case mt:return e==t+""}var s=i==lt;if(!s){if(e.__wrapped__||t.__wrapped__)return v(e.__wrapped__||e,t.__wrapped__||t);if(i!=dt)return!1;var i=e.constructor,o=t.constructor
|
||||
;if(i!=o&&(!m(i)||!(i instanceof i&&m(o)&&o instanceof o)))return!1}n||(n=[]),r||(r=[]);for(i=n.length;i--;)if(n[i]==e)return r[i]==t;i=!0,o=0,n.push(e),r.push(t);if(s){o=e.length;if(i=o==t.length)for(;o--&&(i=v(e[o],t[o],n,r)););return i}for(var u in e)if(Z.call(e,u)&&(o++,!Z.call(t,u)||!v(e[u],t[u],n,r)))return!1;for(u in t)if(Z.call(t,u)&&!(o--))return!1;return!0}function m(e){return"function"==typeof e}function g(e){return e?bt[typeof e]:!1}function y(e){return nt.call(e)==mt}function b(e){var t=
|
||||
[];return St(e,function(e){t.push(e)}),t}function w(e,t){var n=!1;return"number"==typeof (e?e.length:0)?n=-1<_(e,t):kt(e,function(e){return(n=e===t)&&z}),n}function E(e,t,n){var r=!0,t=s(t,n);if(Nt(e))for(var n=-1,i=e.length;++n<i&&(r=!!t(e[n],n,e)););else kt(e,function(e,n,i){return!(r=!!t(e,n,i))&&z});return r}function S(e,t,n){var r=[],t=s(t,n);if(Nt(e))for(var n=-1,i=e.length;++n<i;){var o=e[n];t(o,n,e)&&r.push(o)}else kt(e,function(e,n,i){t(e,n,i)&&r.push(e)});return r}function x(e,t,n){var r
|
||||
,t=s(t,n);return kt(e,function(e,n,i){if(t(e,n,i))return r=e,z}),r}function T(e,t,n){var r=-1,i=e?e.length:0,o=Array("number"==typeof i?i:0),t=s(t,n);if(Nt(e))for(;++r<i;)o[r]=t(e[r],r,e);else kt(e,function(e,n,i){o[++r]=t(e,n,i)});return o}function N(e,t,n){var r=-Infinity,i=-1,o=e?e.length:0,u=r;if(t||!Nt(e))t=s(t,n),kt(e,function(e,n,i){n=t(e,n,i),n>r&&(r=n,u=e)});else for(;++i<o;)e[i]>u&&(u=e[i]);return u}function C(e,t){var n=[];return kt(e,function(e){n.push(e[t])}),n}function k(e,t,n,r){var i=3>
|
||||
arguments.length,t=s(t,r);return kt(e,function(e,r,s){n=i?(i=!1,e):t(n,e,r,s)}),n}function L(e,t,n,r){var i=e?e.length:0,s=3>arguments.length;if("number"!=typeof i)var o=Ct(e),i=o.length;return kt(e,function(u,a,f){a=o?o[--i]:--i,n=s?(s=!1,e[a]):t.call(r,n,e[a],a,f)}),n}function A(e,t,n){var r,t=s(t,n);if(Nt(e))for(var n=-1,i=e.length;++n<i&&!(r=t(e[n],n,e)););else kt(e,function(e,n,i){return(r=t(e,n,i))&&z});return!!r}function O(e,t,n){if(e)return null==t||n?e[0]:tt.call(e,0,t)}function M(e,t){for(
|
||||
var n=-1,r=e?e.length:0,i=[];++n<r;){var s=e[n];Nt(s)?et.apply(i,t?s:M(s)):i.push(s)}return i}function _(e,t,n){var r=-1,i=e?e.length:0;if("number"==typeof n)r=(0>n?ut(0,i+n):n||0)-1;else if(n)return r=P(e,t),e[r]===t?r:-1;for(;++r<i;)if(e[r]===t)return r;return-1}function D(e,t,n){return e?tt.call(e,null==t||n?1:t):[]}function P(e,t,n,r){for(var i=0,o=e?e.length:i,n=n?s(n,r):j,t=n(t);i<o;)r=i+o>>>1,n(e[r])<t?i=r+1:o=r;return i}function H(e,t,n,r){var i=-1,o=e?e.length:0,u=[],a=u;n&&(a=[],n=s(n,r
|
||||
));for(;++i<o;){var r=e[i],f=n?n(r,i,e):r;if(t?!i||a[a.length-1]!==f:0>_(a,f))n&&a.push(f),u.push(r)}return u}function B(e,t){return yt||rt&&2<arguments.length?rt.call.apply(rt,arguments):i(e,t,tt.call(arguments,2))}function j(e){return e}function F(e){kt(p(e),function(t){var r=n[t]=e[t];n.prototype[t]=function(){var e=[this.__wrapped__];return et.apply(e,arguments),e=r.apply(n,e),this.__chain__&&(e=new n(e),e.__chain__=!0),e}})}var I="object"==typeof exports&&exports,q="object"==typeof global&&global
|
||||
;q.global===q&&(e=q);var R=[],q=new function(){},U=0,z=q,W=e._,X=/&(?:amp|lt|gt|quot|#x27);/g,V=RegExp("^"+(q.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),$=/($^)/,J=/[&<>"']/g,K=/['\n\r\t\u2028\u2029\\]/g,Q=Math.ceil,G=R.concat,Y=Math.floor,Z=q.hasOwnProperty,et=R.push,tt=R.slice,nt=q.toString,rt=V.test(rt=tt.bind)&&rt,it=V.test(it=Array.isArray)&&it,st=e.isFinite,ot=V.test(ot=Object.keys)&&ot,ut=Math.max,at=Math.min,ft=Math.random,lt="[object Array]"
|
||||
,ct="[object Boolean]",ht="[object Date]",pt="[object Number]",dt="[object Object]",vt="[object RegExp]",mt="[object String]",gt=(gt={0:1,length:1},R.splice.call(gt,0,1),gt[0]),yt=rt&&/\n|Opera/.test(rt+nt.call(e.opera)),bt={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,"undefined":!1},wt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};n.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},n.isArguments=
|
||||
function(e){return"[object Arguments]"==nt.call(e)},n.isArguments(arguments)||(n.isArguments=function(e){return e?Z.call(e,"callee"):!1});var Et=function(e,t){var n,r;if(!e)return e;t=s(t);for(n in e)if(r=e[n],t(r,n,e)===z)break;return e},St=function(e,t){var n,r;if(!e)return e;t=s(t);for(n in e)if(Z.call(e,n)&&(r=e[n],t(r,n,e)===z))break;return e},xt={"&":"&","<":"<",">":">",'"':""","'":"'"},Tt=d(xt),Nt=it||function(e){return nt.call(e)==lt};m(/x/)&&(m=function(e){return"[object Function]"==
|
||||
nt.call(e)});var Ct=ot?function(e){return g(e)?ot(e):[]}:c,kt=function(e,t,n){var r;if(!e)return e;var t=s(t,n),i=e.length,n=-1;if("number"==typeof i){for(;++n<i;)if(r=e[n],t(r,n,e)===z)return e}else for(n in e)if(Z.call(e,n)&&(r=e[n],t(r,n,e)===z))return e};n.VERSION="0.10.0",n.after=function(e,t){return 1>e?t():function(){if(1>--e)return t.apply(this,arguments)}},n.bind=B,n.bindAll=function(e){for(var t=arguments,n=1<t.length?0:(t=p(e),-1),r=t.length;++n<r;){var i=t[n];e[i]=B(e[i],e)}return e},
|
||||
n.chain=function(e){return e=new n(e),e.__chain__=!0,e},n.clone=function(e){return e&&bt[typeof e]?Nt(e)?tt.call(e):l({},e):e},n.compact=function(e){for(var t=-1,n=e?e.length:0,r=[];++t<n;){var i=e[t];i&&r.push(i)}return r},n.compose=function(){var e=arguments;return function(){for(var t=arguments,n=e.length;n--;)t=[e[n].apply(this,t)];return t[0]}},n.contains=w,n.countBy=function(e,t,n){var r={},t=s(t,n);return kt(e,function(e,n,i){n=t(e,n,i),Z.call(r,n)?r[n]++:r[n]=1}),r},n.debounce=function(e,
|
||||
t,n){function r(){u=null,n||(s=e.apply(o,i))}var i,s,o,u;return function(){var a=n&&!u;return i=arguments,o=this,clearTimeout(u),u=setTimeout(r,t),a&&(s=e.apply(o,i)),s}},n.defaults=h,n.defer=function(e){var n=tt.call(arguments,1);return setTimeout(function(){e.apply(t,n)},1)},n.delay=function(e,n){var r=tt.call(arguments,2);return setTimeout(function(){e.apply(t,r)},n)},n.difference=function(e){for(var t=-1,n=e.length,r=G.apply(R,arguments),i=[];++t<n;){var s=e[t];0>_(r,s,n)&&i.push(s)}return i}
|
||||
,n.escape=function(e){return null==e?"":(e+"").replace(J,u)},n.every=E,n.filter=S,n.find=x,n.first=O,n.flatten=M,n.forEach=kt,n.functions=p,n.groupBy=function(e,t,n){var r={},t=s(t,n);return kt(e,function(e,n,i){n=t(e,n,i),(Z.call(r,n)?r[n]:r[n]=[]).push(e)}),r},n.has=function(e,t){return e?Z.call(e,t):!1},n.identity=j,n.indexOf=_,n.initial=function(e,t,n){return e?tt.call(e,0,-(null==t||n?1:t)):[]},n.intersection=function(e){var t=arguments,n=t.length,r=[];return kt(e,function(e){if(0>_(r,e)){for(
|
||||
var i=n;--i;)if(0>_(t[i],e))return;r.push(e)}}),r},n.invert=d,n.invoke=function(e,t){var n=tt.call(arguments,2),r="function"==typeof t,i=[];return kt(e,function(e){i.push((r?t:e[t]).apply(e,n))}),i},n.isArray=Nt,n.isBoolean=function(e){return!0===e||!1===e||nt.call(e)==ct},n.isDate=function(e){return nt.call(e)==ht},n.isElement=function(e){return e?1===e.nodeType:!1},n.isEmpty=function(e){if(!e)return!0;if(Nt(e)||y(e))return!e.length;for(var t in e)if(Z.call(e,t))return!1;return!0},n.isEqual=v,n.
|
||||
isFinite=function(e){return st(e)&&nt.call(e)==pt},n.isFunction=m,n.isNaN=function(e){return nt.call(e)==pt&&e!=+e},n.isNull=function(e){return null===e},n.isNumber=function(e){return nt.call(e)==pt},n.isObject=g,n.isRegExp=function(e){return nt.call(e)==vt},n.isString=y,n.isUndefined=function(e){return e===t},n.keys=Ct,n.last=function(e,t,n){if(e){var r=e.length;return null==t||n?e[r-1]:tt.call(e,-t||r)}},n.lastIndexOf=function(e,t,n){var r=e?e.length:0;for("number"==typeof n&&(r=(0>n?ut(0,r+n):
|
||||
at(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},n.map=T,n.max=N,n.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)}},n.min=function(e,t,n){var r=Infinity,i=-1,o=e?e.length:0,u=r;if(t||!Nt(e))t=s(t,n),kt(e,function(e,n,i){n=t(e,n,i),n<r&&(r=n,u=e)});else for(;++i<o;)e[i]<u&&(u=e[i]);return u},n.mixin=F,n.noConflict=function(){return e._=W,this},n.object=function(e,t){for(var n=-1,r=e?e.length:0,i={}
|
||||
;++n<r;){var s=e[n];t?i[s]=t[n]:i[s[0]]=s[1]}return i},n.omit=function(e){var t=G.apply(R,arguments),n={};return Et(e,function(e,r){0>_(t,r,1)&&(n[r]=e)}),n},n.once=function(e){var t,n=!1;return function(){return n?t:(n=!0,t=e.apply(this,arguments),e=null,t)}},n.pairs=function(e){var t=[];return St(e,function(e,n){t.push([n,e])}),t},n.pick=function(e){for(var t=0,n=G.apply(R,arguments),r=n.length,i={};++t<r;){var s=n[t];s in e&&(i[s]=e[s])}return i},n.pluck=C,n.random=function(e,t){return null==e&&
|
||||
null==t&&(t=1),e=+e||0,null==t&&(t=e,e=0),e+Y(ft()*((+t||0)-e+1))},n.range=function(e,t,n){e=+e||0,n=+n||1,null==t&&(t=e,e=0);for(var r=-1,t=ut(0,Q((t-e)/n)),i=Array(t);++r<t;)i[r]=e,e+=n;return i},n.reduce=k,n.reduceRight=L,n.reject=function(e,t,n){return t=s(t,n),S(e,function(e,n,r){return!t(e,n,r)})},n.rest=D,n.result=function(e,t){var n=e?e[t]:null;return m(n)?e[t]():n},n.shuffle=function(e){var t=-1,n=Array(e?e.length:0);return kt(e,function(e){var r=Y(ft()*(++t+1));n[t]=n[r],n[r]=e}),n},n.size=
|
||||
function(e){var t=e?e.length:0;return"number"==typeof t?t:Ct(e).length},n.some=A,n.sortBy=function(e,t,n){var i=[],t=s(t,n);kt(e,function(e,n,r){i.push({a:t(e,n,r),b:n,c:e})}),e=i.length;for(i.sort(r);e--;)i[e]=i[e].c;return i},n.sortedIndex=P,n.tap=function(e,t){return t(e),e},n.template=function(e,t,r){e||(e="");var r=h({},r,n.templateSettings),i=0,s="__p += '",u=r.variable;e.replace(RegExp((r.escape||$).source+"|"+(r.interpolate||$).source+"|"+(r.evaluate||$).source+"|$","g"),function(t,n,r,u,
|
||||
a){s+=e.slice(i,a).replace(K,o),s+=n?"'+_['escape']("+n+")+'":u?"';"+u+";__p+='":r?"'+((__t=("+r+"))==null?'':__t)+'":"",i=a+t.length}),s+="';",u||(u="obj",s="with("+u+"||{}){"+s+"}"),s="function("+u+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+s+"return __p}";try{var a=Function("_","return "+s)(n)}catch(f){throw f.source=s,f}return t?a(t):(a.source=s,a)},n.throttle=function(e,t){function n(){u=new Date,o=null,i=e.apply(s,r)}var r,i,s,o,u=0;return function(
|
||||
){var a=new Date,f=t-(a-u);return r=arguments,s=this,0>=f?(clearTimeout(o),u=a,i=e.apply(s,r)):o||(o=setTimeout(n,f)),i}},n.times=function(e,t,n){for(var e=+e||0,r=-1,i=Array(e);++r<e;)i[r]=t.call(n,r);return i},n.toArray=function(e){return e&&"number"==typeof e.length?"string"==typeof e?e.split(""):tt.call(e):b(e)},n.unescape=function(e){return null==e?"":(e+"").replace(X,f)},n.union=function(){return H(G.apply(R,arguments))},n.uniq=H,n.uniqueId=function(e){var t=U++;return e?e+t:t},n.values=b,n
|
||||
.where=function(e,t){var n=Ct(t);return S(e,function(e){for(var r=n.length;r--;){var i=e[n[r]]===t[n[r]];if(!i)break}return!!i})},n.without=function(e){for(var t=-1,n=e.length,r=[];++t<n;){var i=e[t];0>_(arguments,i,1)&&r.push(i)}return r},n.wrap=function(e,t){return function(){var n=[e];return et.apply(n,arguments),t.apply(this,n)}},n.zip=function(e){for(var t=-1,n=e?N(C(arguments,"length")):0,r=Array(n);++t<n;)r[t]=C(arguments,t);return r},n.all=E,n.any=A,n.collect=T,n.detect=x,n.drop=D,n.each=
|
||||
kt,n.extend=l,n.foldl=k,n.foldr=L,n.head=O,n.include=w,n.inject=k,n.methods=p,n.select=S,n.tail=D,n.take=O,n.unique=H,F(n),n.prototype.chain=function(){return this.__chain__=!0,this},n.prototype.value=function(){return this.__wrapped__},kt("pop push reverse shift sort splice unshift".split(" "),function(e){var t=R[e];n.prototype[e]=function(){var e=this.__wrapped__;return t.apply(e,arguments),gt&&e.length===0&&delete e[0],this.__chain__&&(e=new n(e),e.__chain__=!0),e}}),kt(["concat","join","slice"
|
||||
],function(e){var t=R[e];n.prototype[e]=function(){var e=t.apply(this.__wrapped__,arguments);return this.__chain__&&(e=new n(e),e.__chain__=!0),e}}),I?"object"==typeof module&&module&&module.exports==I?(module.exports=n)._=n:I._=n:e._=n})(this);
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lodash",
|
||||
"version": "0.9.0",
|
||||
"version": "0.10.0",
|
||||
"description": "A drop-in replacement for Underscore.js delivering performance, bug fixes, and additional features.",
|
||||
"homepage": "http://lodash.com",
|
||||
"main": "./lodash",
|
||||
@@ -24,9 +24,6 @@
|
||||
"email": "john.david.dalton@gmail.com",
|
||||
"web": "http://allyoucanleet.com/"
|
||||
},
|
||||
"dependencies": {
|
||||
"tar": "~0.1.13"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/bestiejs/lodash/issues"
|
||||
},
|
||||
|
||||
44
perf/perf.js
44
perf/perf.js
@@ -1577,11 +1577,11 @@
|
||||
Benchmark.Suite('`_.times`')
|
||||
.add(buildName, '\
|
||||
var result = [];\
|
||||
lodash.times(length, function(n) { result.push(n); })'
|
||||
lodash.times(limit, function(n) { result.push(n); })'
|
||||
)
|
||||
.add(otherName, '\
|
||||
var result = [];\
|
||||
_.times(length, function(n) { result.push(n); })'
|
||||
_.times(limit, function(n) { result.push(n); })'
|
||||
)
|
||||
);
|
||||
|
||||
@@ -1589,11 +1589,11 @@
|
||||
Benchmark.Suite('`_.times` with `thisArg`')
|
||||
.add(buildName, '\
|
||||
var result = [];\
|
||||
lodash.times(length, function(n) { result.push(this.sin(n)); }, Math)'
|
||||
lodash.times(limit, function(n) { result.push(this.sin(n)); }, Math)'
|
||||
)
|
||||
.add(otherName, '\
|
||||
var result = [];\
|
||||
_.times(length, function(n) { result.push(this.sin(n)); }, Math)'
|
||||
_.times(limit, function(n) { result.push(this.sin(n)); }, Math)'
|
||||
)
|
||||
);
|
||||
|
||||
@@ -1657,6 +1657,42 @@
|
||||
)
|
||||
);
|
||||
|
||||
suites.push(
|
||||
Benchmark.Suite('`_.uniq` iterating an array of 50 elements')
|
||||
.add(buildName, {
|
||||
'fn': 'lodash.uniq(twentyFiveValues.concat(twentyFiveValues2));',
|
||||
'teardown': 'function multiArrays(){}'
|
||||
})
|
||||
.add(otherName, {
|
||||
'fn': '_.uniq(twentyFiveValues.concat(twentyFiveValues2));',
|
||||
'teardown': 'function multiArrays(){}'
|
||||
})
|
||||
);
|
||||
|
||||
suites.push(
|
||||
Benchmark.Suite('`_.uniq` iterating an array of 75 elements')
|
||||
.add(buildName, {
|
||||
'fn': 'lodash.uniq(fiftyValues.concat(twentyFiveValues2));',
|
||||
'teardown': 'function multiArrays(){}'
|
||||
})
|
||||
.add(otherName, {
|
||||
'fn': '_.uniq(fiftyValues.concat(twentyFiveValues2));',
|
||||
'teardown': 'function multiArrays(){}'
|
||||
})
|
||||
);
|
||||
|
||||
suites.push(
|
||||
Benchmark.Suite('`_.uniq` iterating an array of 100 elements')
|
||||
.add(buildName, {
|
||||
'fn': 'lodash.uniq(seventyFiveValues.concat(twentyFiveValues2));',
|
||||
'teardown': 'function multiArrays(){}'
|
||||
})
|
||||
.add(otherName, {
|
||||
'fn': '_.uniq(seventyFiveValues.concat(twentyFiveValues2));',
|
||||
'teardown': 'function multiArrays(){}'
|
||||
})
|
||||
);
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
suites.push(
|
||||
|
||||
1
test/template/c.jst
Normal file
1
test/template/c.jst
Normal file
@@ -0,0 +1 @@
|
||||
Hello ${ name }!
|
||||
@@ -22,6 +22,7 @@
|
||||
'detect': 'find',
|
||||
'drop': 'rest',
|
||||
'each': 'forEach',
|
||||
'extend': 'assign',
|
||||
'foldl': 'reduce',
|
||||
'foldr': 'reduceRight',
|
||||
'head': 'first',
|
||||
@@ -36,6 +37,7 @@
|
||||
|
||||
/** Used to associate real names with their aliases */
|
||||
var realToAliasMap = {
|
||||
'assign': ['extend'],
|
||||
'contains': ['include'],
|
||||
'every': ['all'],
|
||||
'filter': ['select'],
|
||||
@@ -130,11 +132,11 @@
|
||||
'after',
|
||||
'bind',
|
||||
'bindAll',
|
||||
'bindKey',
|
||||
'compose',
|
||||
'debounce',
|
||||
'defer',
|
||||
'delay',
|
||||
'lateBind',
|
||||
'memoize',
|
||||
'once',
|
||||
'partial',
|
||||
@@ -144,6 +146,7 @@
|
||||
|
||||
/** List of "Objects" category methods */
|
||||
var objectsMethods = [
|
||||
'assign',
|
||||
'clone',
|
||||
'defaults',
|
||||
'extend',
|
||||
@@ -195,8 +198,11 @@
|
||||
var backboneDependencies = [
|
||||
'bind',
|
||||
'bindAll',
|
||||
'chain',
|
||||
'clone',
|
||||
'contains',
|
||||
'countBy',
|
||||
'defaults',
|
||||
'escape',
|
||||
'every',
|
||||
'extend',
|
||||
@@ -215,6 +221,7 @@
|
||||
'isFunction',
|
||||
'isObject',
|
||||
'isRegExp',
|
||||
'isString',
|
||||
'keys',
|
||||
'last',
|
||||
'lastIndexOf',
|
||||
@@ -222,6 +229,7 @@
|
||||
'max',
|
||||
'min',
|
||||
'mixin',
|
||||
'pick',
|
||||
'reduce',
|
||||
'reduceRight',
|
||||
'reject',
|
||||
@@ -234,15 +242,16 @@
|
||||
'sortedIndex',
|
||||
'toArray',
|
||||
'uniqueId',
|
||||
'value',
|
||||
'without'
|
||||
];
|
||||
|
||||
/** List of methods used by Underscore */
|
||||
var underscoreMethods = _.without.apply(_, [allMethods].concat([
|
||||
'bindKey',
|
||||
'forIn',
|
||||
'forOwn',
|
||||
'isPlainObject',
|
||||
'lateBind',
|
||||
'merge',
|
||||
'partial'
|
||||
]));
|
||||
@@ -393,7 +402,7 @@
|
||||
func(1, noop);
|
||||
} else if (methodName == 'bindAll') {
|
||||
func({ 'noop': noop });
|
||||
} else if (methodName == 'lateBind') {
|
||||
} else if (methodName == 'bindKey') {
|
||||
func(lodash, 'identity', array, string);
|
||||
} else if (/^(?:bind|partial)$/.test(methodName)) {
|
||||
func(noop, object, array, string);
|
||||
@@ -474,7 +483,8 @@
|
||||
|
||||
var data = {
|
||||
'a': { 'people': ['moe', 'larry', 'curly'] },
|
||||
'b': { 'epithet': 'stooge' }
|
||||
'b': { 'epithet': 'stooge' },
|
||||
'c': { 'name': 'ES6' }
|
||||
};
|
||||
|
||||
context._ = _;
|
||||
@@ -483,30 +493,37 @@
|
||||
|
||||
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);
|
||||
equal(templates.c(data.c), 'Hello ES6!', basename);
|
||||
delete _.templates;
|
||||
start();
|
||||
});
|
||||
});
|
||||
|
||||
asyncTest('`lodash template=*.jst` exports=amd', function() {
|
||||
var start = _.after(2, _.once(QUnit.start));
|
||||
['', 'moduleId=underscore'].forEach(function(command) {
|
||||
asyncTest('`lodash template=*.jst` exports=amd' + (command ? ' ' + command : ''), function() {
|
||||
var start = _.after(2, _.once(QUnit.start));
|
||||
|
||||
build(['-s', 'template=' + templatePath + '/*.jst', 'exports=amd'], function(source, filePath) {
|
||||
var basename = path.basename(filePath, '.js'),
|
||||
context = createContext(),
|
||||
pass = false;
|
||||
build(['-s', 'template=' + templatePath + '/*.jst', 'exports=amd'].concat(command || []), function(source, filePath) {
|
||||
var moduleId,
|
||||
basename = path.basename(filePath, '.js'),
|
||||
context = createContext(),
|
||||
pass = false;
|
||||
|
||||
(context.define = function(requires, factory) {
|
||||
factory(_);
|
||||
var templates = _.templates;
|
||||
pass = 'a' in templates && 'b' in templates;
|
||||
})
|
||||
.amd = {};
|
||||
(context.define = function(requires, factory) {
|
||||
factory(_);
|
||||
var templates = _.templates;
|
||||
moduleId = requires + '';
|
||||
pass = 'a' in templates && 'b' in templates;
|
||||
})
|
||||
.amd = {};
|
||||
|
||||
vm.runInContext(source, context);
|
||||
ok(pass, basename);
|
||||
delete _.templates;
|
||||
start();
|
||||
vm.runInContext(source, context);
|
||||
|
||||
equal(moduleId, command ? 'underscore' : 'lodash');
|
||||
ok(pass, basename);
|
||||
delete _.templates;
|
||||
start();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -518,14 +535,14 @@
|
||||
context = createContext();
|
||||
|
||||
var data = {
|
||||
'c': { 'name': 'Mustache' }
|
||||
'd': { 'name': 'Mustache' }
|
||||
};
|
||||
|
||||
context._ = _;
|
||||
vm.runInContext(source, context);
|
||||
var templates = context._.templates;
|
||||
|
||||
equal(templates.c(data.c), 'Hello Mustache!', basename);
|
||||
equal(templates.d(data.d), 'Hello Mustache!', basename);
|
||||
start();
|
||||
});
|
||||
});
|
||||
@@ -544,7 +561,7 @@
|
||||
});
|
||||
});
|
||||
|
||||
asyncTest('debug custom', function () {
|
||||
asyncTest('debug custom', function() {
|
||||
var start = _.once(QUnit.start);
|
||||
build(['-d', '-s', 'backbone'], function(source, filePath) {
|
||||
equal(path.basename(filePath, '.js'), 'lodash.custom');
|
||||
@@ -560,7 +577,7 @@
|
||||
});
|
||||
});
|
||||
|
||||
asyncTest('minified custom', function () {
|
||||
asyncTest('minified custom', function() {
|
||||
var start = _.once(QUnit.start);
|
||||
build(['-m', '-s', 'backbone'], function(source, filePath) {
|
||||
equal(path.basename(filePath, '.js'), 'lodash.custom.min');
|
||||
@@ -625,37 +642,59 @@
|
||||
|
||||
build(['-s', 'underscore'], function(source, filePath) {
|
||||
var last,
|
||||
array = [{ 'value': 1 }, { 'value': 2 }],
|
||||
array = [{ 'a': 1, 'b': 2 }, { 'a': 2, 'b': 2 }],
|
||||
basename = path.basename(filePath, '.js'),
|
||||
context = createContext();
|
||||
|
||||
vm.runInContext(source, context);
|
||||
var lodash = context._;
|
||||
|
||||
lodash.each(array, function(value) {
|
||||
var object = { 'fn': lodash.bind(function(foo) { return foo + this.bar; }, { 'bar': 1 }, 1) };
|
||||
equal(object.fn(), 2, '_.bind: ' + basename);
|
||||
|
||||
ok(lodash.clone(array, true)[0] === array[0], '_.clone should be shallow: ' + basename);
|
||||
equal(lodash.contains({ 'a': 1, 'b': 2 }, 1), true, '_.contains should work with objects: ' + basename);
|
||||
equal(lodash.contains([1, 2, 3], 1, 2), true, '_.contains should ignore `fromIndex`: ' + basename);
|
||||
equal(lodash.every([true, false, true]), false, '_.every: ' + basename);
|
||||
|
||||
function Foo() {}
|
||||
Foo.prototype = { 'a': 1 };
|
||||
|
||||
deepEqual(lodash.defaults({}, new Foo), Foo.prototype, '_.defaults should assign inherited `source` properties: ' + basename);
|
||||
deepEqual(lodash.extend({}, new Foo), Foo.prototype, '_.extend should assign inherited `source` properties: ' + basename);
|
||||
|
||||
actual = lodash.find(array, function(value) {
|
||||
return 'a' in value;
|
||||
});
|
||||
|
||||
equal(actual, _.first(array), '_.find: ' + basename);
|
||||
|
||||
actual = lodash.forEach(array, function(value) {
|
||||
last = value;
|
||||
return false;
|
||||
});
|
||||
|
||||
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);
|
||||
equal(last.value, 2, '_.each: ' + basename);
|
||||
equal(lodash.every([true, false, true]), false, '_.every: ' + basename);
|
||||
equal(last, _.last(array), '_.forEach should not exit early: ' + basename);
|
||||
equal(actual, undefined, '_.forEach should return `undefined`: ' + basename);
|
||||
|
||||
object = { 'length': 0, 'splice': Array.prototype.splice };
|
||||
equal(lodash.isEmpty(object), false, '_.isEmpty: ' + basename);
|
||||
equal(lodash.isEmpty(object), false, '_.isEmpty should return `false` for jQuery/MooTools DOM query collections: ' + basename);
|
||||
|
||||
equal(lodash.isFinite('2'), false, '_.isFinite should return `false` for numeric string values: ' + basename);
|
||||
equal(lodash.max('abc'), -Infinity, '_.max should return `-Infinity` for strings: ' + basename);
|
||||
equal(lodash.min('abc'), Infinity, '_.min should return `Infinity` for strings: ' + basename);
|
||||
|
||||
// avoid issues comparing objects with `deepEqual`
|
||||
object = { 'a': 1, 'b': 2, 'c': 3 };
|
||||
var actual = lodash.omit(object, function(value) { return value == 3; });
|
||||
deepEqual(_.keys(actual).sort(), ['a', 'b', 'c'], '_.omit: ' + basename);
|
||||
deepEqual(_.keys(actual).sort(), ['a', 'b', 'c'], '_.omit should not accept a `callback`: ' + basename);
|
||||
|
||||
actual = lodash.pick(object, function(value) { return value != 3; });
|
||||
deepEqual(_.keys(actual), [], '_.pick: ' + basename);
|
||||
deepEqual(_.keys(actual), [], '_.pick should not accept a `callback`: ' + basename);
|
||||
|
||||
equal(lodash.some([false, true, false]), true, '_.some: ' + basename);
|
||||
equal(lodash.template('${a}', object), '${a}', '_.template should ignore ES6 delimiters: ' + basename);
|
||||
|
||||
start();
|
||||
});
|
||||
});
|
||||
@@ -671,14 +710,15 @@
|
||||
var lodash = context._;
|
||||
|
||||
_.each([
|
||||
'assign',
|
||||
'bindKey',
|
||||
'forIn',
|
||||
'forOwn',
|
||||
'isPlainObject',
|
||||
'lateBind',
|
||||
'merge',
|
||||
'partial'
|
||||
], function(methodName) {
|
||||
equal(lodash[methodName], undefined, '_.' + methodName + ' exists: ' + basename);
|
||||
equal(lodash[methodName], undefined, '_.' + methodName + ' should not exist: ' + basename);
|
||||
});
|
||||
|
||||
start();
|
||||
@@ -970,7 +1010,9 @@
|
||||
build(['--silent'].concat(command.split(' ')), function(source, filePath) {
|
||||
var methodNames,
|
||||
basename = path.basename(filePath, '.js'),
|
||||
context = createContext();
|
||||
context = createContext(),
|
||||
isUnderscore = /underscore/.test(command),
|
||||
exposeAssign = !isUnderscore;
|
||||
|
||||
try {
|
||||
vm.runInContext(source, context);
|
||||
@@ -985,8 +1027,12 @@
|
||||
if (/backbone/.test(command) && !methodNames) {
|
||||
methodNames = backboneDependencies.slice();
|
||||
}
|
||||
if (/underscore/.test(command) && !methodNames) {
|
||||
methodNames = underscoreMethods.slice();
|
||||
if (isUnderscore) {
|
||||
if (methodNames) {
|
||||
exposeAssign = methodNames.indexOf('assign') > -1;
|
||||
} else {
|
||||
methodNames = underscoreMethods.slice();
|
||||
}
|
||||
}
|
||||
// add method names explicitly by category
|
||||
if (/category/.test(command)) {
|
||||
@@ -1020,6 +1066,9 @@
|
||||
// remove nonexistent and duplicate method names
|
||||
methodNames = _.uniq(_.intersection(allMethods, expandMethodNames(methodNames)));
|
||||
|
||||
if (!exposeAssign) {
|
||||
methodNames = _.without(methodNames, 'assign');
|
||||
}
|
||||
var lodash = context._ || {};
|
||||
methodNames.forEach(function(methodName) {
|
||||
testMethod(lodash, methodName, basename);
|
||||
|
||||
254
test/test.js
254
test/test.js
@@ -163,6 +163,42 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.assign');
|
||||
|
||||
(function() {
|
||||
test('should not error on `null` or `undefined` sources (test in IE < 9)', function() {
|
||||
try {
|
||||
deepEqual(_.assign({}, null, undefined, { 'a': 1 }), { 'a': 1 });
|
||||
} catch(e) {
|
||||
ok(false);
|
||||
}
|
||||
});
|
||||
|
||||
test('skips the prototype property of functions (test in Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1)', function() {
|
||||
function Foo() {}
|
||||
Foo.prototype.c = 3;
|
||||
|
||||
Foo.a = 1;
|
||||
Foo.b = 2;
|
||||
|
||||
var expected = { 'a': 1, 'b': 2 };
|
||||
deepEqual(_.assign({}, Foo), expected);
|
||||
|
||||
Foo.prototype = { 'c': 3 };
|
||||
deepEqual(_.assign({}, Foo), expected);
|
||||
});
|
||||
|
||||
test('should work with `_.reduce`', function() {
|
||||
var actual = { 'a': 1},
|
||||
array = [{ 'b': 2 }, { 'c': 3 }];
|
||||
|
||||
_.reduce(array, _.assign, actual);
|
||||
deepEqual(actual, { 'a': 1, 'b': 2, 'c': 3});
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.bind');
|
||||
|
||||
(function() {
|
||||
@@ -177,6 +213,29 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.bindKey');
|
||||
|
||||
(function() {
|
||||
test('should work when the target function is overwritten', function() {
|
||||
var object = {
|
||||
'name': 'moe',
|
||||
'greet': function(greeting) {
|
||||
return greeting + ': ' + this.name;
|
||||
}
|
||||
};
|
||||
|
||||
var func = _.bindKey(object, 'greet', 'hi');
|
||||
equal(func(), 'hi: moe');
|
||||
|
||||
object.greet = function(greeting) {
|
||||
return greeting + ' ' + this.name + '!';
|
||||
};
|
||||
equal(func(), 'hi moe!');
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.clone');
|
||||
|
||||
(function() {
|
||||
@@ -262,6 +321,33 @@
|
||||
QUnit.module('lodash.contains');
|
||||
|
||||
(function() {
|
||||
_.each({
|
||||
'an array': [1, 2, 3, 1, 2, 3],
|
||||
'an object': { 'a': 1, 'b': 2, 'c': 3, 'd': 1, 'e': 2, 'f': 3 },
|
||||
'a string': '123123'
|
||||
},
|
||||
function(collection, key) {
|
||||
test('should work with ' + key + ' and a positive `fromIndex`', function() {
|
||||
equal(_.contains(collection, 1, 2), true);
|
||||
});
|
||||
|
||||
test('should work with ' + key + ' and a `fromIndex` >= collection\'s length', function() {
|
||||
equal(_.contains(collection, 1, 6), false);
|
||||
equal(_.contains(collection, undefined, 6), false);
|
||||
equal(_.contains(collection, 1, 8), false);
|
||||
equal(_.contains(collection, undefined, 8), false);
|
||||
});
|
||||
|
||||
test('should work with ' + key + ' and a negative `fromIndex`', function() {
|
||||
equal(_.contains(collection, 2, -3), true);
|
||||
});
|
||||
|
||||
test('should work with ' + key + ' and a negative `fromIndex` <= negative collection\'s length', function() {
|
||||
equal(_.contains(collection, 1, -6), true);
|
||||
equal(_.contains(collection, 2, -8), true);
|
||||
});
|
||||
});
|
||||
|
||||
_.each({
|
||||
'literal': 'abc',
|
||||
'object': Object('abc')
|
||||
@@ -295,17 +381,17 @@
|
||||
|
||||
(function() {
|
||||
asyncTest('subsequent debounced calls return the last `func` result', function() {
|
||||
var debounced = _.debounce(function(value) { return value; }, 100);
|
||||
var debounced = _.debounce(function(value) { return value; }, 90);
|
||||
debounced('x');
|
||||
|
||||
setTimeout(function() {
|
||||
equal(debounced('y'), 'x');
|
||||
QUnit.start();
|
||||
}, 220);
|
||||
}, 120);
|
||||
});
|
||||
|
||||
test('subsequent "immediate" debounced calls return the last `func` result', function() {
|
||||
var debounced = _.debounce(function(value) { return value; }, 100, true),
|
||||
var debounced = _.debounce(function(value) { return value; }, 90, true),
|
||||
result = [debounced('x'), debounced('y')];
|
||||
|
||||
deepEqual(result, ['x', 'x']);
|
||||
@@ -348,37 +434,33 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.extend');
|
||||
QUnit.module('lodash.every');
|
||||
|
||||
(function() {
|
||||
test('should not error on `null` or `undefined` sources (test in IE < 9)', function() {
|
||||
try {
|
||||
deepEqual(_.extend({}, null, undefined, { 'a': 1 }), { 'a': 1 });
|
||||
} catch(e) {
|
||||
ok(false);
|
||||
}
|
||||
});
|
||||
|
||||
test('skips the prototype property of functions (test in Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1)', function() {
|
||||
function Foo() {}
|
||||
Foo.prototype.c = 3;
|
||||
|
||||
Foo.a = 1;
|
||||
Foo.b = 2;
|
||||
|
||||
var expected = { 'a': 1, 'b': 2 };
|
||||
deepEqual(_.extend({}, Foo), expected);
|
||||
|
||||
Foo.prototype = { 'c': 3 };
|
||||
deepEqual(_.extend({}, Foo), expected);
|
||||
test('should return `false` as soon as the `callback` result is falsey', function() {
|
||||
equal(_.every([true, null, true], _.identity), false);
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('source property checks');
|
||||
|
||||
_.each(['assign', 'defaults'], function(methodName) {
|
||||
var func = _[methodName];
|
||||
|
||||
test('lodash.' + methodName + ' should not assign inherited `source` properties', function() {
|
||||
function Foo() {}
|
||||
Foo.prototype = { 'a': 1 };
|
||||
deepEqual(func({}, new Foo), {});
|
||||
});
|
||||
});
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('strict mode checks');
|
||||
|
||||
_.each(['bindAll', 'defaults', 'extend'], function(methodName) {
|
||||
_.each(['assign', 'bindAll', 'defaults'], function(methodName) {
|
||||
var func = _[methodName];
|
||||
|
||||
test('lodash.' + methodName + ' should not throw strict mode errors', function() {
|
||||
@@ -764,6 +846,27 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.isFinite');
|
||||
|
||||
(function() {
|
||||
test('should return `false` for non-numeric values', function() {
|
||||
equal(_.isFinite(null), false);
|
||||
equal(_.isFinite([]), false);
|
||||
equal(_.isFinite(true), false);
|
||||
equal(_.isFinite(''), false);
|
||||
equal(_.isFinite(' '), false);
|
||||
equal(_.isFinite('2px'), false);
|
||||
});
|
||||
|
||||
test('should return `true` for numeric string values', function() {
|
||||
equal(_.isFinite('2'), true);
|
||||
equal(_.isFinite('0'), true);
|
||||
equal(_.isFinite('08'), true);
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.isObject');
|
||||
|
||||
(function() {
|
||||
@@ -922,29 +1025,6 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.lateBind');
|
||||
|
||||
(function() {
|
||||
test('should work when the target function is overwritten', function() {
|
||||
var object = {
|
||||
'name': 'moe',
|
||||
'greet': function(greeting) {
|
||||
return greeting + ': ' + this.name;
|
||||
}
|
||||
};
|
||||
|
||||
var func = _.lateBind(object, 'greet', 'hi');
|
||||
equal(func(), 'hi: moe');
|
||||
|
||||
object.greet = function(greeting) {
|
||||
return greeting + ' ' + this.name + '!';
|
||||
};
|
||||
equal(func(), 'hi moe!');
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.map');
|
||||
|
||||
(function() {
|
||||
@@ -981,6 +1061,21 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.max and lodash.min string iteration');
|
||||
|
||||
_.each(['max', 'min'], function(methodName) {
|
||||
var func = _[methodName];
|
||||
|
||||
test('lodash.' + methodName + ' should iterate a string', function() {
|
||||
_.each(['abc', Object('abc')], function(value) {
|
||||
var actual = func(value);
|
||||
equal(actual, methodName == 'max' ? 'c' : 'a');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.merge');
|
||||
|
||||
(function() {
|
||||
@@ -1062,6 +1157,14 @@
|
||||
var expected = { 'a': 4 };
|
||||
deepEqual(_.merge({ 'a': 1 }, { 'a': 2 }, { 'a': 3 }, expected), expected);
|
||||
});
|
||||
|
||||
test('should work with `_.reduce`', function() {
|
||||
var actual = { 'a': 1},
|
||||
array = [{ 'b': 2 }, { 'c': 3 }];
|
||||
|
||||
_.reduce(array, _.merge, actual);
|
||||
deepEqual(actual, { 'a': 1, 'b': 2, 'c': 3});
|
||||
});
|
||||
}(1, 2, 3));
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
@@ -1393,6 +1496,17 @@
|
||||
});
|
||||
}(1, 2, 3));
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.some');
|
||||
|
||||
(function() {
|
||||
test('should return `true` as soon as the `callback` result is truthy', function() {
|
||||
equal(_.some([null, true, null], _.identity), true);
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.sortBy');
|
||||
@@ -1576,6 +1690,12 @@
|
||||
|
||||
equal(compiled({ 'value': true }), expected);
|
||||
});
|
||||
|
||||
test('should parse ES6 template delimiters', function() {
|
||||
var data = { 'value': 2 };
|
||||
equal(_.template('1${value}3', data), '123');
|
||||
equal(_.template('${"{" + value + "\\}"}', data), '{2}');
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
@@ -1584,7 +1704,7 @@
|
||||
|
||||
(function() {
|
||||
test('subsequent calls should return the result of the first call', function() {
|
||||
var throttled = _.throttle(function(value) { return value; }, 100),
|
||||
var throttled = _.throttle(function(value) { return value; }, 90),
|
||||
result = [throttled('x'), throttled('y')];
|
||||
|
||||
deepEqual(result, ['x', 'x']);
|
||||
@@ -1592,9 +1712,9 @@
|
||||
|
||||
test('supports calls in a loop', function() {
|
||||
var counter = 0,
|
||||
throttled = _.throttle(function() { counter++; }, 100),
|
||||
throttled = _.throttle(function() { counter++; }, 90),
|
||||
start = new Date,
|
||||
limit = 220;
|
||||
limit = 180;
|
||||
|
||||
while ((new Date - start) < limit) {
|
||||
throttled();
|
||||
@@ -1609,12 +1729,12 @@
|
||||
if (counter < 4) {
|
||||
throttled();
|
||||
}
|
||||
}, 100);
|
||||
}, 90);
|
||||
|
||||
setTimeout(function() {
|
||||
ok(counter > 1);
|
||||
QUnit.start();
|
||||
}, 220);
|
||||
}, 180);
|
||||
|
||||
throttled();
|
||||
});
|
||||
@@ -1625,12 +1745,12 @@
|
||||
|
||||
var throttled = _.throttle(function() {
|
||||
times.push(new Date - now);
|
||||
}, 20);
|
||||
}, 32);
|
||||
|
||||
setTimeout(throttled, 20);
|
||||
setTimeout(throttled, 20);
|
||||
setTimeout(throttled, 40);
|
||||
setTimeout(throttled, 40);
|
||||
setTimeout(throttled, 32);
|
||||
setTimeout(throttled, 32);
|
||||
setTimeout(throttled, 64);
|
||||
setTimeout(throttled, 64);
|
||||
|
||||
setTimeout(function() {
|
||||
var actual = _.every(times, function(value, index) {
|
||||
@@ -1641,7 +1761,7 @@
|
||||
|
||||
ok(actual);
|
||||
QUnit.start();
|
||||
}, 120);
|
||||
}, 260);
|
||||
});
|
||||
}());
|
||||
|
||||
@@ -1712,6 +1832,13 @@
|
||||
|
||||
deepEqual(actual, [1, 2, 3]);
|
||||
});
|
||||
|
||||
test('should distinguish between numbers and numeric strings', function() {
|
||||
var expected = ['2', 2, Object('2'), Object(2)],
|
||||
actual = _.uniq(expected);
|
||||
|
||||
deepEqual(actual, expected);
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
@@ -1736,14 +1863,13 @@
|
||||
deepEqual(_.where(array, { 'a': 1, 'b': 2 }), [{ 'a': 1, 'b': 2 }]);
|
||||
});
|
||||
|
||||
test('should filter by inherited properties', function() {
|
||||
test('should not filter by inherited properties', function() {
|
||||
function Foo() {}
|
||||
Foo.prototype = { 'b': 2 };
|
||||
Foo.prototype = { 'a': 2 };
|
||||
|
||||
var properties = new Foo;
|
||||
properties.a = 1;
|
||||
|
||||
deepEqual(_.where(array, properties), [{ 'a': 1, 'b': 2 }]);
|
||||
properties.b = 2;
|
||||
deepEqual(_.where(array, properties), [{ 'a': 1, 'b': 2 }, { 'a': 2, 'b': 2 }]);
|
||||
});
|
||||
|
||||
test('should filter by problem JScript properties (test in IE < 9)', function() {
|
||||
|
||||
56
vendor/backbone/backbone.js
vendored
56
vendor/backbone/backbone.js
vendored
@@ -185,16 +185,16 @@
|
||||
var defaults;
|
||||
var attrs = attributes || {};
|
||||
if (options && options.collection) this.collection = options.collection;
|
||||
if (options && options.parse) attrs = this.parse(attrs);
|
||||
if (defaults = _.result(this, 'defaults')) {
|
||||
attrs = _.extend({}, defaults, attrs);
|
||||
}
|
||||
this.attributes = {};
|
||||
this._escapedAttributes = {};
|
||||
this.cid = _.uniqueId('c');
|
||||
this.changed = {};
|
||||
this._changes = {};
|
||||
this._pending = {};
|
||||
if (options && options.parse) attrs = this.parse(attrs);
|
||||
if (defaults = _.result(this, 'defaults')) {
|
||||
attrs = _.extend({}, defaults, attrs);
|
||||
}
|
||||
this.set(attrs, {silent: true});
|
||||
// Reset change tracking.
|
||||
this.changed = {};
|
||||
@@ -261,15 +261,16 @@
|
||||
|
||||
// Set a hash of model attributes on the object, firing `"change"` unless
|
||||
// you choose to silence it.
|
||||
set: function(attrs, options) {
|
||||
var attr, key, val;
|
||||
if (attrs == null) return this;
|
||||
set: function(key, val, options) {
|
||||
var attr, attrs;
|
||||
if (key == null) return this;
|
||||
|
||||
// Handle both `"key", value` and `{key: value}` -style arguments.
|
||||
if (!_.isObject(attrs)) {
|
||||
key = attrs;
|
||||
(attrs = {})[key] = options;
|
||||
options = arguments[2];
|
||||
if (_.isObject(key)) {
|
||||
attrs = key;
|
||||
options = val;
|
||||
} else {
|
||||
(attrs = {})[key] = val;
|
||||
}
|
||||
|
||||
// Extract attributes and options.
|
||||
@@ -352,14 +353,15 @@
|
||||
// Set a hash of model attributes, and sync the model to the server.
|
||||
// If the server returns an attributes hash that differs, the model's
|
||||
// state will be `set` again.
|
||||
save: function(attrs, options) {
|
||||
var key, current, done;
|
||||
save: function(key, val, options) {
|
||||
var attrs, current, done;
|
||||
|
||||
// Handle both `"key", value` and `{key: value}` -style arguments.
|
||||
if (attrs != null && !_.isObject(attrs)) {
|
||||
key = attrs;
|
||||
(attrs = {})[key] = options;
|
||||
options = arguments[2];
|
||||
if (key == null || _.isObject(key)) {
|
||||
attrs = key;
|
||||
options = val;
|
||||
} else if (key != null) {
|
||||
(attrs = {})[key] = val;
|
||||
}
|
||||
options = options ? _.clone(options) : {};
|
||||
|
||||
@@ -948,8 +950,7 @@
|
||||
if (!this.routes) return;
|
||||
var route, routes = _.keys(this.routes);
|
||||
while ((route = routes.pop()) != null) {
|
||||
var name = this.routes[route];
|
||||
this.route(route, name, this[name]);
|
||||
this.route(route, this.routes[route]);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -987,8 +988,8 @@
|
||||
}
|
||||
};
|
||||
|
||||
// Cached regex for cleaning leading hashes and slashes.
|
||||
var routeStripper = /^[#\/]/;
|
||||
// Cached regex for stripping a leading hash/slash and trailing space.
|
||||
var routeStripper = /^[#\/]|\s+$/g;
|
||||
|
||||
// Cached regex for stripping leading and trailing slashes.
|
||||
var rootStripper = /^\/+|\/+$/g;
|
||||
@@ -1364,7 +1365,10 @@
|
||||
var type = methodMap[method];
|
||||
|
||||
// Default options, unless specified.
|
||||
options || (options = {});
|
||||
_.defaults(options || (options = {}), {
|
||||
emulateHTTP: Backbone.emulateHTTP,
|
||||
emulateJSON: Backbone.emulateJSON
|
||||
});
|
||||
|
||||
// Default JSON-request options.
|
||||
var params = {type: type, dataType: 'json'};
|
||||
@@ -1381,16 +1385,16 @@
|
||||
}
|
||||
|
||||
// For older servers, emulate JSON by encoding the request into an HTML-form.
|
||||
if (Backbone.emulateJSON) {
|
||||
if (options.emulateJSON) {
|
||||
params.contentType = 'application/x-www-form-urlencoded';
|
||||
params.data = params.data ? {model: params.data} : {};
|
||||
}
|
||||
|
||||
// For older servers, emulate HTTP by mimicking the HTTP method with `_method`
|
||||
// And an `X-HTTP-Method-Override` header.
|
||||
if (Backbone.emulateHTTP && (type === 'PUT' || type === 'DELETE')) {
|
||||
if (options.emulateHTTP && (type === 'PUT' || type === 'DELETE')) {
|
||||
params.type = 'POST';
|
||||
if (Backbone.emulateJSON) params.data._method = type;
|
||||
if (options.emulateJSON) params.data._method = type;
|
||||
var beforeSend = options.beforeSend;
|
||||
options.beforeSend = function(xhr) {
|
||||
xhr.setRequestHeader('X-HTTP-Method-Override', type);
|
||||
@@ -1399,7 +1403,7 @@
|
||||
}
|
||||
|
||||
// Don't process data on a non-GET request.
|
||||
if (params.type !== 'GET' && !Backbone.emulateJSON) {
|
||||
if (params.type !== 'GET' && !options.emulateJSON) {
|
||||
params.processData = false;
|
||||
}
|
||||
|
||||
|
||||
15
vendor/backbone/test/collection.js
vendored
15
vendor/backbone/test/collection.js
vendored
@@ -701,4 +701,19 @@ $(document).ready(function() {
|
||||
collection.add([{id: 1, x: 1}, {id: 2, x: 2}]);
|
||||
deepEqual(added, [1, 2]);
|
||||
});
|
||||
|
||||
test("fetch parses models by default", 1, function() {
|
||||
var model = {};
|
||||
var Collection = Backbone.Collection.extend({
|
||||
url: 'test',
|
||||
model: Backbone.Model.extend({
|
||||
parse: function(resp) {
|
||||
strictEqual(resp, model);
|
||||
}
|
||||
})
|
||||
});
|
||||
new Collection().fetch();
|
||||
this.ajaxSettings.success([model]);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
6
vendor/backbone/test/environment.js
vendored
6
vendor/backbone/test/environment.js
vendored
@@ -8,6 +8,10 @@
|
||||
|
||||
sync: Backbone.sync,
|
||||
|
||||
emulateHTTP: Backbone.emulateHTTP,
|
||||
|
||||
emulateJSON: Backbone.emulateJSON,
|
||||
|
||||
setup: function() {
|
||||
var env = this;
|
||||
|
||||
@@ -32,6 +36,8 @@
|
||||
this.ajaxSettings = null;
|
||||
Backbone.sync = this.sync;
|
||||
Backbone.ajax = this.ajax;
|
||||
Backbone.emulateHTTP = this.emulateHTTP;
|
||||
Backbone.emulateJSON = this.emulateJSON;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
8
vendor/backbone/test/model.js
vendored
8
vendor/backbone/test/model.js
vendored
@@ -889,4 +889,12 @@ $(document).ready(function() {
|
||||
deepEqual(changes, ['a',1,'item']);
|
||||
});
|
||||
|
||||
test("#1791 - `attributes` is available for `parse`", function() {
|
||||
var Model = Backbone.Model.extend({
|
||||
parse: function() { this.has('a'); } // shouldn't throw an error
|
||||
});
|
||||
var model = new Model(null, {parse: true});
|
||||
expect(0);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
10
vendor/backbone/test/router.js
vendored
10
vendor/backbone/test/router.js
vendored
@@ -492,4 +492,14 @@ $(document).ready(function() {
|
||||
new Router;
|
||||
});
|
||||
|
||||
test("#1794 - Trailing space in fragments.", 1, function() {
|
||||
var history = new Backbone.History;
|
||||
strictEqual(history.getFragment('fragment '), 'fragment');
|
||||
});
|
||||
|
||||
test("#1820 - Leading slash and trailing space.", 1, function() {
|
||||
var history = new Backbone.History;
|
||||
strictEqual(history.getFragment('/fragment '), 'fragment');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
52
vendor/backbone/test/sync.js
vendored
52
vendor/backbone/test/sync.js
vendored
@@ -64,8 +64,10 @@ $(document).ready(function() {
|
||||
});
|
||||
|
||||
test("update with emulateHTTP and emulateJSON", 7, function() {
|
||||
Backbone.emulateHTTP = Backbone.emulateJSON = true;
|
||||
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'});
|
||||
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'}, {
|
||||
emulateHTTP: true,
|
||||
emulateJSON: true
|
||||
});
|
||||
equal(this.ajaxSettings.url, '/library/2-the-tempest');
|
||||
equal(this.ajaxSettings.type, 'POST');
|
||||
equal(this.ajaxSettings.dataType, 'json');
|
||||
@@ -74,12 +76,12 @@ $(document).ready(function() {
|
||||
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'});
|
||||
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'}, {
|
||||
emulateHTTP: true
|
||||
});
|
||||
equal(this.ajaxSettings.url, '/library/2-the-tempest');
|
||||
equal(this.ajaxSettings.type, 'POST');
|
||||
equal(this.ajaxSettings.contentType, 'application/json');
|
||||
@@ -87,12 +89,12 @@ $(document).ready(function() {
|
||||
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'});
|
||||
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'}, {
|
||||
emulateJSON: true
|
||||
});
|
||||
equal(this.ajaxSettings.url, '/library/2-the-tempest');
|
||||
equal(this.ajaxSettings.type, 'PUT');
|
||||
equal(this.ajaxSettings.contentType, 'application/x-www-form-urlencoded');
|
||||
@@ -100,7 +102,6 @@ $(document).ready(function() {
|
||||
equal(data.id, '2-the-tempest');
|
||||
equal(data.author, 'Tim Shakespeare');
|
||||
equal(data.length, 123);
|
||||
Backbone.emulateJSON = false;
|
||||
});
|
||||
|
||||
test("read model", 3, function() {
|
||||
@@ -121,12 +122,13 @@ $(document).ready(function() {
|
||||
|
||||
test("destroy with emulateHTTP", 3, function() {
|
||||
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'});
|
||||
Backbone.emulateHTTP = Backbone.emulateJSON = true;
|
||||
library.first().destroy();
|
||||
library.first().destroy({
|
||||
emulateHTTP: true,
|
||||
emulateJSON: true
|
||||
});
|
||||
equal(this.ajaxSettings.url, '/library/2-the-tempest');
|
||||
equal(this.ajaxSettings.type, 'POST');
|
||||
equal(JSON.stringify(this.ajaxSettings.data), '{"_method":"DELETE"}');
|
||||
Backbone.emulateHTTP = Backbone.emulateJSON = false;
|
||||
});
|
||||
|
||||
test("urlError", 2, function() {
|
||||
@@ -162,6 +164,32 @@ $(document).ready(function() {
|
||||
this.ajaxSettings.error();
|
||||
});
|
||||
|
||||
test('Use Backbone.emulateHTTP as default.', 2, function() {
|
||||
var model = new Backbone.Model;
|
||||
model.url = '/test';
|
||||
|
||||
Backbone.emulateHTTP = true;
|
||||
model.sync('create', model);
|
||||
strictEqual(this.ajaxSettings.emulateHTTP, true);
|
||||
|
||||
Backbone.emulateHTTP = false;
|
||||
model.sync('create', model);
|
||||
strictEqual(this.ajaxSettings.emulateHTTP, false);
|
||||
});
|
||||
|
||||
test('Use Backbone.emulateJSON as default.', 2, function() {
|
||||
var model = new Backbone.Model;
|
||||
model.url = '/test';
|
||||
|
||||
Backbone.emulateJSON = true;
|
||||
model.sync('create', model);
|
||||
strictEqual(this.ajaxSettings.emulateJSON, true);
|
||||
|
||||
Backbone.emulateJSON = false;
|
||||
model.sync('create', model);
|
||||
strictEqual(this.ajaxSettings.emulateJSON, false);
|
||||
});
|
||||
|
||||
test("#1756 - Call user provided beforeSend function.", 4, function() {
|
||||
Backbone.emulateHTTP = true;
|
||||
var model = new Backbone.Model;
|
||||
|
||||
1049
vendor/firebug-lite/changelog.txt
vendored
1049
vendor/firebug-lite/changelog.txt
vendored
File diff suppressed because it is too large
Load Diff
662
vendor/firebug-lite/skin/xp/debugger.css
vendored
662
vendor/firebug-lite/skin/xp/debugger.css
vendored
@@ -1,331 +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;
|
||||
}
|
||||
/* 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;
|
||||
}
|
||||
|
||||
1634
vendor/firebug-lite/skin/xp/firebug-1.3a2.css
vendored
1634
vendor/firebug-lite/skin/xp/firebug-1.3a2.css
vendored
File diff suppressed because it is too large
Load Diff
40
vendor/firebug-lite/skin/xp/firebug.IE6.css
vendored
40
vendor/firebug-lite/skin/xp/firebug.IE6.css
vendored
@@ -1,20 +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;
|
||||
}
|
||||
/************************************************************************************************/
|
||||
#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;
|
||||
}
|
||||
|
||||
6294
vendor/firebug-lite/skin/xp/firebug.css
vendored
6294
vendor/firebug-lite/skin/xp/firebug.css
vendored
File diff suppressed because it is too large
Load Diff
428
vendor/firebug-lite/skin/xp/firebug.html
vendored
428
vendor/firebug-lite/skin/xp/firebug.html
vendored
@@ -1,215 +1,215 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/DTD/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Firebug Lite</title>
|
||||
<!-- An empty script to avoid FOUC when loading the stylesheet -->
|
||||
<script type="text/javascript"></script>
|
||||
<style type="text/css" media="screen">@import "firebug.css";</style>
|
||||
<style>html,body{margin:0;padding:0;overflow:hidden;}</style>
|
||||
</head>
|
||||
<body class="fbBody">
|
||||
<table id="fbChrome" cellpadding="0" cellspacing="0" border="0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<!-- Interface - Top Area -->
|
||||
<td id="fbTop" colspan="2">
|
||||
|
||||
<!--
|
||||
<div>
|
||||
--><!-- <span id="fbToolbarErrors" class="fbErrors">2 errors</span> --><!--
|
||||
<input type="text" id="fbToolbarSearch" />
|
||||
</div>
|
||||
-->
|
||||
|
||||
<!-- Window Buttons -->
|
||||
<div id="fbWindowButtons">
|
||||
<a id="fbWindow_btDeactivate" class="fbSmallButton fbHover" title="Deactivate Firebug for this web page"> </a>
|
||||
<a id="fbWindow_btDetach" class="fbSmallButton fbHover" title="Open Firebug in popup window"> </a>
|
||||
<a id="fbWindow_btClose" class="fbSmallButton fbHover" title="Minimize Firebug"> </a>
|
||||
</div>
|
||||
|
||||
<!-- Toolbar buttons and Status Bar -->
|
||||
<div id="fbToolbar">
|
||||
<div id="fbToolbarContent">
|
||||
|
||||
<!-- Firebug Button -->
|
||||
<span id="fbToolbarIcon">
|
||||
<a id="fbFirebugButton" class="fbIconButton" class="fbHover" target="_blank"> </a>
|
||||
</span>
|
||||
|
||||
<!--
|
||||
<span id="fbLeftToolbarErrors" class="fbErrors">2 errors</span>
|
||||
-->
|
||||
|
||||
<!-- Toolbar Buttons -->
|
||||
<span id="fbToolbarButtons">
|
||||
<!-- Fixed Toolbar Buttons -->
|
||||
<span id="fbFixedButtons">
|
||||
<a id="fbChrome_btInspect" class="fbButton fbHover" title="Click an element in the page to inspect">Inspect</a>
|
||||
</span>
|
||||
|
||||
<!-- Console Panel Toolbar Buttons -->
|
||||
<span id="fbConsoleButtons" class="fbToolbarButtons">
|
||||
<a id="fbConsole_btClear" class="fbButton fbHover" title="Clear the console">Clear</a>
|
||||
</span>
|
||||
|
||||
<!-- HTML Panel Toolbar Buttons -->
|
||||
<!--
|
||||
<span id="fbHTMLButtons" class="fbToolbarButtons">
|
||||
<a id="fbHTML_btEdit" class="fbHover" title="Edit this HTML">Edit</a>
|
||||
</span>
|
||||
-->
|
||||
</span>
|
||||
|
||||
<!-- Status Bar -->
|
||||
<span id="fbStatusBarBox">
|
||||
<span class="fbToolbarSeparator"></span>
|
||||
<!-- HTML Panel Status Bar -->
|
||||
<!--
|
||||
<span id="fbHTMLStatusBar" class="fbStatusBar fbToolbarButtons">
|
||||
</span>
|
||||
-->
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- PanelBars -->
|
||||
<div id="fbPanelBarBox">
|
||||
|
||||
<!-- Main PanelBar -->
|
||||
<div id="fbPanelBar1" class="fbPanelBar">
|
||||
<a id="fbConsoleTab" class="fbTab fbHover">
|
||||
<span class="fbTabL"></span>
|
||||
<span class="fbTabText">Console</span>
|
||||
<span class="fbTabMenuTarget"></span>
|
||||
<span class="fbTabR"></span>
|
||||
</a>
|
||||
<a id="fbHTMLTab" class="fbTab fbHover">
|
||||
<span class="fbTabL"></span>
|
||||
<span class="fbTabText">HTML</span>
|
||||
<span class="fbTabR"></span>
|
||||
</a>
|
||||
<a class="fbTab fbHover">
|
||||
<span class="fbTabL"></span>
|
||||
<span class="fbTabText">CSS</span>
|
||||
<span class="fbTabR"></span>
|
||||
</a>
|
||||
<a class="fbTab fbHover">
|
||||
<span class="fbTabL"></span>
|
||||
<span class="fbTabText">Script</span>
|
||||
<span class="fbTabR"></span>
|
||||
</a>
|
||||
<a class="fbTab fbHover">
|
||||
<span class="fbTabL"></span>
|
||||
<span class="fbTabText">DOM</span>
|
||||
<span class="fbTabR"></span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Side PanelBars -->
|
||||
<div id="fbPanelBar2Box" class="hide">
|
||||
<div id="fbPanelBar2" class="fbPanelBar">
|
||||
<!--
|
||||
<a class="fbTab fbHover">
|
||||
<span class="fbTabL"></span>
|
||||
<span class="fbTabText">Style</span>
|
||||
<span class="fbTabR"></span>
|
||||
</a>
|
||||
<a class="fbTab fbHover">
|
||||
<span class="fbTabL"></span>
|
||||
<span class="fbTabText">Layout</span>
|
||||
<span class="fbTabR"></span>
|
||||
</a>
|
||||
<a class="fbTab fbHover">
|
||||
<span class="fbTabL"></span>
|
||||
<span class="fbTabText">DOM</span>
|
||||
<span class="fbTabR"></span>
|
||||
</a>
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Horizontal Splitter -->
|
||||
<div id="fbHSplitter"> </div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- Interface - Main Area -->
|
||||
<tr id="fbContent">
|
||||
|
||||
<!-- Panels -->
|
||||
<td id="fbPanelBox1">
|
||||
<div id="fbPanel1" class="fbFitHeight">
|
||||
<div id="fbConsole" class="fbPanel"></div>
|
||||
<div id="fbHTML" class="fbPanel"></div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<!-- Side Panel Box -->
|
||||
<td id="fbPanelBox2" class="hide">
|
||||
|
||||
<!-- VerticalSplitter -->
|
||||
<div id="fbVSplitter" class="fbVSplitter"> </div>
|
||||
|
||||
<!-- Side Panels -->
|
||||
<div id="fbPanel2" class="fbFitHeight">
|
||||
|
||||
<!-- HTML Side Panels -->
|
||||
<div id="fbHTML_Style" class="fbPanel"></div>
|
||||
<div id="fbHTML_Layout" class="fbPanel"></div>
|
||||
<div id="fbHTML_DOM" class="fbPanel"></div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Large Command Line -->
|
||||
<textarea id="fbLargeCommandLine" class="fbFitHeight"></textarea>
|
||||
|
||||
<!-- Large Command Line Buttons -->
|
||||
<div id="fbLargeCommandButtons">
|
||||
<a id="fbCommand_btRun" class="fbButton fbHover">Run</a>
|
||||
<a id="fbCommand_btClear" class="fbButton fbHover">Clear</a>
|
||||
|
||||
<a id="fbSmallCommandLineIcon" class="fbSmallButton fbHover"></a>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<!-- Interface - Bottom Area -->
|
||||
<tr id="fbBottom" class="hide">
|
||||
|
||||
<!-- Command Line -->
|
||||
<td id="fbCommand" colspan="2">
|
||||
<div id="fbCommandBox">
|
||||
<div id="fbCommandIcon">>>></div>
|
||||
<input id="fbCommandLine" name="fbCommandLine" type="text" />
|
||||
<a id="fbLargeCommandLineIcon" class="fbSmallButton fbHover"></a>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<span id="fbMiniChrome">
|
||||
<span id="fbMiniContent">
|
||||
<span id="fbMiniIcon" title="Open Firebug Lite"></span>
|
||||
<span id="fbMiniErrors" class="fbErrors"><!-- 2 errors --></span>
|
||||
</span>
|
||||
</span>
|
||||
<!--
|
||||
<div id="fbErrorPopup">
|
||||
<div id="fbErrorPopupContent">
|
||||
<div id="fbErrorIndicator" class="fbErrors">2 errors</div>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
</body>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/DTD/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Firebug Lite</title>
|
||||
<!-- An empty script to avoid FOUC when loading the stylesheet -->
|
||||
<script type="text/javascript"></script>
|
||||
<style type="text/css" media="screen">@import "firebug.css";</style>
|
||||
<style>html,body{margin:0;padding:0;overflow:hidden;}</style>
|
||||
</head>
|
||||
<body class="fbBody">
|
||||
<table id="fbChrome" cellpadding="0" cellspacing="0" border="0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<!-- Interface - Top Area -->
|
||||
<td id="fbTop" colspan="2">
|
||||
|
||||
<!--
|
||||
<div>
|
||||
--><!-- <span id="fbToolbarErrors" class="fbErrors">2 errors</span> --><!--
|
||||
<input type="text" id="fbToolbarSearch" />
|
||||
</div>
|
||||
-->
|
||||
|
||||
<!-- Window Buttons -->
|
||||
<div id="fbWindowButtons">
|
||||
<a id="fbWindow_btDeactivate" class="fbSmallButton fbHover" title="Deactivate Firebug for this web page"> </a>
|
||||
<a id="fbWindow_btDetach" class="fbSmallButton fbHover" title="Open Firebug in popup window"> </a>
|
||||
<a id="fbWindow_btClose" class="fbSmallButton fbHover" title="Minimize Firebug"> </a>
|
||||
</div>
|
||||
|
||||
<!-- Toolbar buttons and Status Bar -->
|
||||
<div id="fbToolbar">
|
||||
<div id="fbToolbarContent">
|
||||
|
||||
<!-- Firebug Button -->
|
||||
<span id="fbToolbarIcon">
|
||||
<a id="fbFirebugButton" class="fbIconButton" class="fbHover" target="_blank"> </a>
|
||||
</span>
|
||||
|
||||
<!--
|
||||
<span id="fbLeftToolbarErrors" class="fbErrors">2 errors</span>
|
||||
-->
|
||||
|
||||
<!-- Toolbar Buttons -->
|
||||
<span id="fbToolbarButtons">
|
||||
<!-- Fixed Toolbar Buttons -->
|
||||
<span id="fbFixedButtons">
|
||||
<a id="fbChrome_btInspect" class="fbButton fbHover" title="Click an element in the page to inspect">Inspect</a>
|
||||
</span>
|
||||
|
||||
<!-- Console Panel Toolbar Buttons -->
|
||||
<span id="fbConsoleButtons" class="fbToolbarButtons">
|
||||
<a id="fbConsole_btClear" class="fbButton fbHover" title="Clear the console">Clear</a>
|
||||
</span>
|
||||
|
||||
<!-- HTML Panel Toolbar Buttons -->
|
||||
<!--
|
||||
<span id="fbHTMLButtons" class="fbToolbarButtons">
|
||||
<a id="fbHTML_btEdit" class="fbHover" title="Edit this HTML">Edit</a>
|
||||
</span>
|
||||
-->
|
||||
</span>
|
||||
|
||||
<!-- Status Bar -->
|
||||
<span id="fbStatusBarBox">
|
||||
<span class="fbToolbarSeparator"></span>
|
||||
<!-- HTML Panel Status Bar -->
|
||||
<!--
|
||||
<span id="fbHTMLStatusBar" class="fbStatusBar fbToolbarButtons">
|
||||
</span>
|
||||
-->
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- PanelBars -->
|
||||
<div id="fbPanelBarBox">
|
||||
|
||||
<!-- Main PanelBar -->
|
||||
<div id="fbPanelBar1" class="fbPanelBar">
|
||||
<a id="fbConsoleTab" class="fbTab fbHover">
|
||||
<span class="fbTabL"></span>
|
||||
<span class="fbTabText">Console</span>
|
||||
<span class="fbTabMenuTarget"></span>
|
||||
<span class="fbTabR"></span>
|
||||
</a>
|
||||
<a id="fbHTMLTab" class="fbTab fbHover">
|
||||
<span class="fbTabL"></span>
|
||||
<span class="fbTabText">HTML</span>
|
||||
<span class="fbTabR"></span>
|
||||
</a>
|
||||
<a class="fbTab fbHover">
|
||||
<span class="fbTabL"></span>
|
||||
<span class="fbTabText">CSS</span>
|
||||
<span class="fbTabR"></span>
|
||||
</a>
|
||||
<a class="fbTab fbHover">
|
||||
<span class="fbTabL"></span>
|
||||
<span class="fbTabText">Script</span>
|
||||
<span class="fbTabR"></span>
|
||||
</a>
|
||||
<a class="fbTab fbHover">
|
||||
<span class="fbTabL"></span>
|
||||
<span class="fbTabText">DOM</span>
|
||||
<span class="fbTabR"></span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Side PanelBars -->
|
||||
<div id="fbPanelBar2Box" class="hide">
|
||||
<div id="fbPanelBar2" class="fbPanelBar">
|
||||
<!--
|
||||
<a class="fbTab fbHover">
|
||||
<span class="fbTabL"></span>
|
||||
<span class="fbTabText">Style</span>
|
||||
<span class="fbTabR"></span>
|
||||
</a>
|
||||
<a class="fbTab fbHover">
|
||||
<span class="fbTabL"></span>
|
||||
<span class="fbTabText">Layout</span>
|
||||
<span class="fbTabR"></span>
|
||||
</a>
|
||||
<a class="fbTab fbHover">
|
||||
<span class="fbTabL"></span>
|
||||
<span class="fbTabText">DOM</span>
|
||||
<span class="fbTabR"></span>
|
||||
</a>
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Horizontal Splitter -->
|
||||
<div id="fbHSplitter"> </div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- Interface - Main Area -->
|
||||
<tr id="fbContent">
|
||||
|
||||
<!-- Panels -->
|
||||
<td id="fbPanelBox1">
|
||||
<div id="fbPanel1" class="fbFitHeight">
|
||||
<div id="fbConsole" class="fbPanel"></div>
|
||||
<div id="fbHTML" class="fbPanel"></div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<!-- Side Panel Box -->
|
||||
<td id="fbPanelBox2" class="hide">
|
||||
|
||||
<!-- VerticalSplitter -->
|
||||
<div id="fbVSplitter" class="fbVSplitter"> </div>
|
||||
|
||||
<!-- Side Panels -->
|
||||
<div id="fbPanel2" class="fbFitHeight">
|
||||
|
||||
<!-- HTML Side Panels -->
|
||||
<div id="fbHTML_Style" class="fbPanel"></div>
|
||||
<div id="fbHTML_Layout" class="fbPanel"></div>
|
||||
<div id="fbHTML_DOM" class="fbPanel"></div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Large Command Line -->
|
||||
<textarea id="fbLargeCommandLine" class="fbFitHeight"></textarea>
|
||||
|
||||
<!-- Large Command Line Buttons -->
|
||||
<div id="fbLargeCommandButtons">
|
||||
<a id="fbCommand_btRun" class="fbButton fbHover">Run</a>
|
||||
<a id="fbCommand_btClear" class="fbButton fbHover">Clear</a>
|
||||
|
||||
<a id="fbSmallCommandLineIcon" class="fbSmallButton fbHover"></a>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<!-- Interface - Bottom Area -->
|
||||
<tr id="fbBottom" class="hide">
|
||||
|
||||
<!-- Command Line -->
|
||||
<td id="fbCommand" colspan="2">
|
||||
<div id="fbCommandBox">
|
||||
<div id="fbCommandIcon">>>></div>
|
||||
<input id="fbCommandLine" name="fbCommandLine" type="text" />
|
||||
<a id="fbLargeCommandLineIcon" class="fbSmallButton fbHover"></a>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<span id="fbMiniChrome">
|
||||
<span id="fbMiniContent">
|
||||
<span id="fbMiniIcon" title="Open Firebug Lite"></span>
|
||||
<span id="fbMiniErrors" class="fbErrors"><!-- 2 errors --></span>
|
||||
</span>
|
||||
</span>
|
||||
<!--
|
||||
<div id="fbErrorPopup">
|
||||
<div id="fbErrorPopupContent">
|
||||
<div id="fbErrorIndicator" class="fbErrors">2 errors</div>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
</body>
|
||||
</html>
|
||||
542
vendor/firebug-lite/skin/xp/html.css
vendored
542
vendor/firebug-lite/skin/xp/html.css
vendored
@@ -1,272 +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;
|
||||
/* 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;
|
||||
}
|
||||
12
vendor/firebug-lite/skin/xp/roundCorner.svg
vendored
12
vendor/firebug-lite/skin/xp/roundCorner.svg
vendored
@@ -1,6 +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>
|
||||
|
||||
<?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>
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 234 B After Width: | Height: | Size: 228 B |
3328
vendor/jquery/jquery.js
vendored
3328
vendor/jquery/jquery.js
vendored
File diff suppressed because it is too large
Load Diff
6
vendor/json3/README.md
vendored
6
vendor/json3/README.md
vendored
@@ -4,8 +4,8 @@
|
||||
|
||||
**JSON 3** is a modern JSON implementation compatible with a variety of JavaScript platforms, including Internet Explorer 6, Opera 7, Safari 2, and Netscape 6. The current version is **3.2.4**.
|
||||
|
||||
- [Development Version](http://bestiejs.github.com/json3/lib/json3.js) *(36.5 KB; uncompressed with comments)*
|
||||
- [Production Version](http://bestiejs.github.com/json3/lib/json3.min.js) *(3.0 KB; compressed and `gzip`-ped)*
|
||||
- [Development Version](http://cdnjs.cloudflare.com/ajax/libs/json3/3.2.4/json3.js) *(36.5 KB; uncompressed with comments)*
|
||||
- [Production Version](http://cdnjs.cloudflare.com/ajax/libs/json3/3.2.4/json3.min.js) *(3.0 KB; compressed and `gzip`-ped)*
|
||||
|
||||
[JSON](http://json.org/) is a language-independent data interchange format based on a loose subset of the JavaScript grammar. Originally popularized by [Douglas Crockford](http://www.crockford.com/), the format was standardized in the [fifth edition](http://es5.github.com/) of the ECMAScript specification. The 5.1 edition, ratified in June 2011, incorporates several modifications to the grammar pertaining to the serialization of dates.
|
||||
|
||||
@@ -42,7 +42,7 @@ Portions of the date serialization code are adapted from the [`date-shim`](https
|
||||
|
||||
## Web Browsers
|
||||
|
||||
<script src="http://bestiejs.github.com/json3/lib/json3.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/json3/3.2.4/json3.min.js"></script>
|
||||
<script>
|
||||
JSON.stringify({"Hello": 123});
|
||||
// => '{"Hello":123}'
|
||||
|
||||
17
vendor/json3/lib/json3.min.js
vendored
17
vendor/json3/lib/json3.min.js
vendored
@@ -1,17 +0,0 @@
|
||||
/*! JSON v3.2.4 | http://bestiejs.github.com/json3 | Copyright 2012, Kit Cambridge | http://kit.mit-license.org */
|
||||
;(function(){var e=void 0,i=!0,k=null,l={}.toString,m,n,p="function"===typeof define&&define.c,q=!p&&"object"==typeof exports&&exports;q||p?"object"==typeof JSON&&JSON?p?q=JSON:(q.stringify=JSON.stringify,q.parse=JSON.parse):p&&(q=this.JSON={}):q=this.JSON||(this.JSON={});var r,t,u,x,z,B,C,D,E,F,G,H,I,J=new Date(-3509827334573292),K,O,P;try{J=-109252==J.getUTCFullYear()&&0===J.getUTCMonth()&&1==J.getUTCDate()&&10==J.getUTCHours()&&37==J.getUTCMinutes()&&6==J.getUTCSeconds()&&708==J.getUTCMilliseconds()}catch(Q){}
|
||||
function R(b){var c,a,d,j=b=="json";if(j||b=="json-stringify"||b=="json-parse"){if(b=="json-stringify"||j){if(c=typeof q.stringify=="function"&&J){(d=function(){return 1}).toJSON=d;try{c=q.stringify(0)==="0"&&q.stringify(new Number)==="0"&&q.stringify(new String)=='""'&&q.stringify(l)===e&&q.stringify(e)===e&&q.stringify()===e&&q.stringify(d)==="1"&&q.stringify([d])=="[1]"&&q.stringify([e])=="[null]"&&q.stringify(k)=="null"&&q.stringify([e,l,k])=="[null,null,null]"&&q.stringify({A:[d,i,false,k,"\x00\u0008\n\u000c\r\t"]})==
|
||||
'{"A":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}'&&q.stringify(k,d)==="1"&&q.stringify([1,2],k,1)=="[\n 1,\n 2\n]"&&q.stringify(new Date(-864E13))=='"-271821-04-20T00:00:00.000Z"'&&q.stringify(new Date(864E13))=='"+275760-09-13T00:00:00.000Z"'&&q.stringify(new Date(-621987552E5))=='"-000001-01-01T00:00:00.000Z"'&&q.stringify(new Date(-1))=='"1969-12-31T23:59:59.999Z"'}catch(f){c=false}}if(!j)return c}if(b=="json-parse"||j){if(typeof q.parse=="function")try{if(q.parse("0")===0&&!q.parse(false)){d=
|
||||
q.parse('{"A":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}');if(a=d.a.length==5&&d.a[0]==1){try{a=!q.parse('"\t"')}catch(o){}if(a)try{a=q.parse("01")!=1}catch(g){}}}}catch(h){a=false}if(!j)return a}return c&&a}}
|
||||
if(!R("json")){J||(K=Math.floor,O=[0,31,59,90,120,151,181,212,243,273,304,334],P=function(b,c){return O[c]+365*(b-1970)+K((b-1969+(c=+(c>1)))/4)-K((b-1901+c)/100)+K((b-1601+c)/400)});if(!(m={}.hasOwnProperty))m=function(b){var c={},a;if((c.__proto__=k,c.__proto__={toString:1},c).toString!=l)m=function(a){var b=this.__proto__,a=a in(this.__proto__=k,this);this.__proto__=b;return a};else{a=c.constructor;m=function(b){var c=(this.constructor||a).prototype;return b in this&&!(b in c&&this[b]===c[b])}}c=
|
||||
k;return m.call(this,b)};n=function(b,c){var a=0,d,j,f;(d=function(){this.valueOf=0}).prototype.valueOf=0;j=new d;for(f in j)m.call(j,f)&&a++;d=j=k;if(a)a=a==2?function(a,b){var c={},d=l.call(a)=="[object Function]",f;for(f in a)!(d&&f=="prototype")&&!m.call(c,f)&&(c[f]=1)&&m.call(a,f)&&b(f)}:function(a,b){var c=l.call(a)=="[object Function]",d,f;for(d in a)!(c&&d=="prototype")&&m.call(a,d)&&!(f=d==="constructor")&&b(d);(f||m.call(a,d="constructor"))&&b(d)};else{j=["valueOf","toString","toLocaleString",
|
||||
"propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"];a=function(a,b){var c=l.call(a)=="[object Function]",d;for(d in a)!(c&&d=="prototype")&&m.call(a,d)&&b(d);for(c=j.length;d=j[--c];m.call(a,d)&&b(d));}}a(b,c)};R("json-stringify")||(r={"\\":"\\\\",'"':'\\"',"\u0008":"\\b","\u000c":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},t=function(b,c){return("000000"+(c||0)).slice(-b)},u=function(b){for(var c='"',a=0,d;d=b.charAt(a);a++)c=c+('\\"\u0008\u000c\n\r\t'.indexOf(d)>-1?r[d]:r[d]=d<" "?
|
||||
"\\u00"+t(2,d.charCodeAt(0).toString(16)):d);return c+'"'},x=function(b,c,a,d,j,f,o){var g=c[b],h,s,v,w,L,M,N,y,A;if(typeof g=="object"&&g){h=l.call(g);if(h=="[object Date]"&&!m.call(g,"toJSON"))if(g>-1/0&&g<1/0){if(P){v=K(g/864E5);for(h=K(v/365.2425)+1970-1;P(h+1,0)<=v;h++);for(s=K((v-P(h,0))/30.42);P(h,s+1)<=v;s++);v=1+v-P(h,s);w=(g%864E5+864E5)%864E5;L=K(w/36E5)%24;M=K(w/6E4)%60;N=K(w/1E3)%60;w=w%1E3}else{h=g.getUTCFullYear();s=g.getUTCMonth();v=g.getUTCDate();L=g.getUTCHours();M=g.getUTCMinutes();
|
||||
N=g.getUTCSeconds();w=g.getUTCMilliseconds()}g=(h<=0||h>=1E4?(h<0?"-":"+")+t(6,h<0?-h:h):t(4,h))+"-"+t(2,s+1)+"-"+t(2,v)+"T"+t(2,L)+":"+t(2,M)+":"+t(2,N)+"."+t(3,w)+"Z"}else g=k;else if(typeof g.toJSON=="function"&&(h!="[object Number]"&&h!="[object String]"&&h!="[object Array]"||m.call(g,"toJSON")))g=g.toJSON(b)}a&&(g=a.call(c,b,g));if(g===k)return"null";h=l.call(g);if(h=="[object Boolean]")return""+g;if(h=="[object Number]")return g>-1/0&&g<1/0?""+g:"null";if(h=="[object String]")return u(g);if(typeof g==
|
||||
"object"){for(b=o.length;b--;)if(o[b]===g)throw TypeError();o.push(g);y=[];c=f;f=f+j;if(h=="[object Array]"){s=0;for(b=g.length;s<b;A||(A=i),s++){h=x(s,g,a,d,j,f,o);y.push(h===e?"null":h)}b=A?j?"[\n"+f+y.join(",\n"+f)+"\n"+c+"]":"["+y.join(",")+"]":"[]"}else{n(d||g,function(b){var c=x(b,g,a,d,j,f,o);c!==e&&y.push(u(b)+":"+(j?" ":"")+c);A||(A=i)});b=A?j?"{\n"+f+y.join(",\n"+f)+"\n"+c+"}":"{"+y.join(",")+"}":"{}"}o.pop();return b}},q.stringify=function(b,c,a){var d,j,f,o,g,h;if(typeof c=="function"||
|
||||
typeof c=="object"&&c)if(l.call(c)=="[object Function]")j=c;else if(l.call(c)=="[object Array]"){f={};o=0;for(g=c.length;o<g;h=c[o++],(l.call(h)=="[object String]"||l.call(h)=="[object Number]")&&(f[h]=1));}if(a)if(l.call(a)=="[object Number]"){if((a=a-a%1)>0){d="";for(a>10&&(a=10);d.length<a;d=d+" ");}}else l.call(a)=="[object String]"&&(d=a.length<=10?a:a.slice(0,10));return x("",(h={},h[""]=b,h),j,f,d,"",[])});R("json-parse")||(z=String.fromCharCode,B={"\\":"\\",'"':'"',"/":"/",b:"\u0008",t:"\t",
|
||||
n:"\n",f:"\u000c",r:"\r"},C=function(){H=I=k;throw SyntaxError();},D=function(){for(var b=I,c=b.length,a,d,j,f,o;H<c;){a=b.charAt(H);if("\t\r\n ".indexOf(a)>-1)H++;else{if("{}[]:,".indexOf(a)>-1){H++;return a}if(a=='"'){d="@";for(H++;H<c;){a=b.charAt(H);if(a<" ")C();else if(a=="\\"){a=b.charAt(++H);if('\\"/btnfr'.indexOf(a)>-1){d=d+B[a];H++}else if(a=="u"){j=++H;for(f=H+4;H<f;H++){a=b.charAt(H);a>="0"&&a<="9"||a>="a"&&a<="f"||a>="A"&&a<="F"||C()}d=d+z("0x"+b.slice(j,H))}else C()}else{if(a=='"')break;
|
||||
d=d+a;H++}}if(b.charAt(H)=='"'){H++;return d}}else{j=H;if(a=="-"){o=i;a=b.charAt(++H)}if(a>="0"&&a<="9"){for(a=="0"&&(a=b.charAt(H+1),a>="0"&&a<="9")&&C();H<c&&(a=b.charAt(H),a>="0"&&a<="9");H++);if(b.charAt(H)=="."){for(f=++H;f<c&&(a=b.charAt(f),a>="0"&&a<="9");f++);f==H&&C();H=f}a=b.charAt(H);if(a=="e"||a=="E"){a=b.charAt(++H);(a=="+"||a=="-")&&H++;for(f=H;f<c&&(a=b.charAt(f),a>="0"&&a<="9");f++);f==H&&C();H=f}return+b.slice(j,H)}o&&C();if(b.slice(H,H+4)=="true"){H=H+4;return i}if(b.slice(H,H+5)==
|
||||
"false"){H=H+5;return false}if(b.slice(H,H+4)=="null"){H=H+4;return k}}C()}}return"$"},E=function(b){var c,a;b=="$"&&C();if(typeof b=="string"){if(b.charAt(0)=="@")return b.slice(1);if(b=="["){for(c=[];;a||(a=i)){b=D();if(b=="]")break;if(a)if(b==","){b=D();b=="]"&&C()}else C();b==","&&C();c.push(E(b))}return c}if(b=="{"){for(c={};;a||(a=i)){b=D();if(b=="}")break;if(a)if(b==","){b=D();b=="}"&&C()}else C();(b==","||typeof b!="string"||b.charAt(0)!="@"||D()!=":")&&C();c[b.slice(1)]=E(D())}return c}C()}return b},
|
||||
G=function(b,c,a){a=F(b,c,a);a===e?delete b[c]:b[c]=a},F=function(b,c,a){var d=b[c],j;if(typeof d=="object"&&d)if(l.call(d)=="[object Array]")for(j=d.length;j--;)G(d,j,a);else n(d,function(b){G(d,b,a)});return a.call(b,c,d)},q.parse=function(b,c){var a,d;H=0;I=b;a=E(D());D()!="$"&&C();H=I=k;return c&&l.call(c)=="[object Function]"?F((d={},d[""]=a,d),"",c):a})}p&&define(function(){return q});
|
||||
}());
|
||||
2
vendor/underscore/test/arrays.js
vendored
2
vendor/underscore/test/arrays.js
vendored
@@ -91,6 +91,8 @@ $(document).ready(function() {
|
||||
var iterator = function(value) { return value.name; };
|
||||
equal(_.map(_.uniq(list, false, iterator), iterator).join(', '), 'moe, curly, larry', 'can find the unique values of an array using a custom iterator');
|
||||
|
||||
equal(_.map(_.uniq(list, iterator), iterator).join(', '), 'moe, curly, larry', 'can find the unique values of an array using a custom iterator without specifying whether array is sorted');
|
||||
|
||||
var iterator = function(value) { return value +1; };
|
||||
var list = [1, 2, 2, 3, 4, 4];
|
||||
equal(_.uniq(list, true, iterator).join(', '), '1, 2, 3, 4', 'iterator works with sorted array');
|
||||
|
||||
2
vendor/underscore/test/collections.js
vendored
2
vendor/underscore/test/collections.js
vendored
@@ -268,6 +268,7 @@ $(document).ready(function() {
|
||||
|
||||
equal(-Infinity, _.max({}), 'Maximum value of an empty object');
|
||||
equal(-Infinity, _.max([]), 'Maximum value of an empty array');
|
||||
equal(_.max({'a': 'a'}), -Infinity, 'Maximum value of a non-numeric collection');
|
||||
|
||||
equal(299999, _.max(_.range(1,300000)), "Maximum value of a too-big array");
|
||||
});
|
||||
@@ -280,6 +281,7 @@ $(document).ready(function() {
|
||||
|
||||
equal(Infinity, _.min({}), 'Minimum value of an empty object');
|
||||
equal(Infinity, _.min([]), 'Minimum value of an empty array');
|
||||
equal(_.min({'a': 'a'}), Infinity, 'Minimum value of a non-numeric collection');
|
||||
|
||||
var now = new Date(9999999999);
|
||||
var then = new Date(0);
|
||||
|
||||
2
vendor/underscore/underscore-min.js
vendored
2
vendor/underscore/underscore-min.js
vendored
File diff suppressed because one or more lines are too long
21
vendor/underscore/underscore.js
vendored
21
vendor/underscore/underscore.js
vendored
@@ -61,7 +61,7 @@
|
||||
}
|
||||
exports._ = _;
|
||||
} else {
|
||||
root['_'] = _;
|
||||
root._ = _;
|
||||
}
|
||||
|
||||
// Current version.
|
||||
@@ -130,7 +130,7 @@
|
||||
if (obj == null) obj = [];
|
||||
if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {
|
||||
if (context) iterator = _.bind(iterator, context);
|
||||
return arguments.length > 2 ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);
|
||||
return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);
|
||||
}
|
||||
var length = obj.length;
|
||||
if (length !== +length) {
|
||||
@@ -213,13 +213,11 @@
|
||||
// Determine if the array or object contains a given value (using `===`).
|
||||
// Aliased as `include`.
|
||||
_.contains = _.include = function(obj, target) {
|
||||
var found = false;
|
||||
if (obj == null) return found;
|
||||
if (obj == null) return false;
|
||||
if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;
|
||||
found = any(obj, function(value) {
|
||||
return any(obj, function(value) {
|
||||
return value === target;
|
||||
});
|
||||
return found;
|
||||
};
|
||||
|
||||
// Invoke a method (with arguments) on every item in a collection.
|
||||
@@ -241,7 +239,7 @@
|
||||
if (_.isEmpty(attrs)) return [];
|
||||
return _.filter(obj, function(value) {
|
||||
for (var key in attrs) {
|
||||
if (attrs[key] !== value[key]) return false;
|
||||
if (_.has(attrs, key) && attrs[key] !== value[key]) return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
@@ -255,7 +253,7 @@
|
||||
return Math.max.apply(Math, obj);
|
||||
}
|
||||
if (!iterator && _.isEmpty(obj)) return -Infinity;
|
||||
var result = {computed : -Infinity};
|
||||
var result = {computed : -Infinity, value: -Infinity};
|
||||
each(obj, function(value, index, list) {
|
||||
var computed = iterator ? iterator.call(context, value, index, list) : value;
|
||||
computed >= result.computed && (result = {value : value, computed : computed});
|
||||
@@ -269,7 +267,7 @@
|
||||
return Math.min.apply(Math, obj);
|
||||
}
|
||||
if (!iterator && _.isEmpty(obj)) return Infinity;
|
||||
var result = {computed : Infinity};
|
||||
var result = {computed : Infinity, value: Infinity};
|
||||
each(obj, function(value, index, list) {
|
||||
var computed = iterator ? iterator.call(context, value, index, list) : value;
|
||||
computed < result.computed && (result = {value : value, computed : computed});
|
||||
@@ -439,6 +437,11 @@
|
||||
// been sorted, you have the option of using a faster algorithm.
|
||||
// Aliased as `unique`.
|
||||
_.uniq = _.unique = function(array, isSorted, iterator, context) {
|
||||
if (_.isFunction(isSorted)) {
|
||||
context = iterator;
|
||||
iterator = isSorted;
|
||||
isSorted = false;
|
||||
}
|
||||
var initial = iterator ? _.map(array, iterator, context) : array;
|
||||
var results = [];
|
||||
var seen = [];
|
||||
|
||||
Reference in New Issue
Block a user