Skip to content
This repository
Browse code

Update vendors and add Lo-Dash dependency.

  • Loading branch information...
commit a421927f4075716355e5eb45b4bd905bb8011b80 1 parent bb3d770
John-David Dalton jdalton authored
22 vendor/lodash/LICENSE.txt
... ... @@ -0,0 +1,22 @@
  1 +Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
  2 +Based on Underscore.js 1.4.3, copyright 2009-2013 Jeremy Ashkenas,
  3 +DocumentCloud Inc. <http://underscorejs.org/>
  4 +
  5 +Permission is hereby granted, free of charge, to any person obtaining
  6 +a copy of this software and associated documentation files (the
  7 +"Software"), to deal in the Software without restriction, including
  8 +without limitation the rights to use, copy, modify, merge, publish,
  9 +distribute, sublicense, and/or sell copies of the Software, and to
  10 +permit persons to whom the Software is furnished to do so, subject to
  11 +the following conditions:
  12 +
  13 +The above copyright notice and this permission notice shall be
  14 +included in all copies or substantial portions of the Software.
  15 +
  16 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  17 +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  18 +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  19 +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  20 +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  21 +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  22 +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
278 vendor/lodash/README.md
Source Rendered
... ... @@ -0,0 +1,278 @@
  1 +# Lo-Dash <sup>v1.1.0</sup>
  2 +[![build status](https://secure.travis-ci.org/bestiejs/lodash.png)](http://travis-ci.org/bestiejs/lodash)
  3 +
  4 +A low-level utility library delivering consistency, [customization](https://github.com/bestiejs/lodash#custom-builds), [performance](http://lodash.com/benchmarks), and [extra features](https://github.com/bestiejs/lodash#features).
  5 +
  6 +## Download
  7 +
  8 +* Lo-Dash builds (for modern environments):<br>
  9 +[Development](https://raw.github.com/bestiejs/lodash/v1.1.0/dist/lodash.js) and
  10 +[Production](https://raw.github.com/bestiejs/lodash/v1.1.0/dist/lodash.min.js)
  11 +
  12 +* Lo-Dash compatibility builds (for legacy and modern environments):<br>
  13 +[Development](https://raw.github.com/bestiejs/lodash/v1.1.0/dist/lodash.compat.js) and
  14 +[Production](https://raw.github.com/bestiejs/lodash/v1.1.0/dist/lodash.compat.min.js)
  15 +
  16 +* Underscore compatibility builds:<br>
  17 +[Development](https://raw.github.com/bestiejs/lodash/v1.1.0/dist/lodash.underscore.js) and
  18 +[Production](https://raw.github.com/bestiejs/lodash/v1.1.0/dist/lodash.underscore.min.js)
  19 +
  20 +* CDN copies of ≤ v1.1.0’s builds are available on [cdnjs](http://cdnjs.com/) thanks to [CloudFlare](http://www.cloudflare.com/):<br>
  21 +[Lo-Dash dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.1.0/lodash.js),
  22 +[Lo-Dash prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.1.0/lodash.min.js),<br>
  23 +[Lo-Dash compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.1.0/lodash.compat.js),
  24 +[Lo-Dash compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.1.0/lodash.compat.min.js),<br>
  25 +[Underscore compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.1.0/lodash.underscore.js), and
  26 +[Underscore compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.1.0/lodash.underscore.min.js)
  27 +
  28 +* For optimal file size, [create a custom build](https://github.com/bestiejs/lodash#custom-builds) with only the features you need
  29 +
  30 +## Dive in
  31 +
  32 +We’ve got [API docs](http://lodash.com/docs), [benchmarks](http://lodash.com/benchmarks), and [unit tests](http://lodash.com/tests).
  33 +
  34 +For a list of upcoming features, check out our [roadmap](https://github.com/bestiejs/lodash/wiki/Roadmap).
  35 +
  36 +## Resources
  37 +
  38 +For more information check out these articles, screencasts, and other videos over Lo-Dash:
  39 +
  40 + * Posts
  41 + - [Say “Hello” to Lo-Dash](http://kitcambridge.be/blog/say-hello-to-lo-dash/)
  42 +
  43 + * Videos
  44 + - [Introducing Lo-Dash](https://vimeo.com/44154599)
  45 + - [Lo-Dash optimizations and custom builds](https://vimeo.com/44154601)
  46 + - [Lo-Dash’s origin and why it’s a better utility belt](https://vimeo.com/44154600)
  47 + - [Unit testing in Lo-Dash](https://vimeo.com/45865290)
  48 + - [Lo-Dash’s approach to native method use](https://vimeo.com/48576012)
  49 + - [CascadiaJS: Lo-Dash for a better utility belt](http://www.youtube.com/watch?v=dpPy4f_SeEk)
  50 +
  51 +## Features
  52 +
  53 + * AMD loader support ([RequireJS](http://requirejs.org/), [curl.js](https://github.com/cujojs/curl), etc.)
  54 + * [_(…)](http://lodash.com/docs#_) supports intuitive chaining
  55 + * [_.at](http://lodash.com/docs#at) for cherry-picking collection values
  56 + * [_.bindKey](http://lodash.com/docs#bindKey) for binding [*“lazy”* defined](http://michaux.ca/articles/lazy-function-definition-pattern) methods
  57 + * [_.cloneDeep](http://lodash.com/docs#cloneDeep) for deep cloning arrays and objects
  58 + * [_.contains](http://lodash.com/docs#contains) accepts a `fromIndex` argument
  59 + * [_.forEach](http://lodash.com/docs#forEach) is chainable and supports exiting iteration early
  60 + * [_.forIn](http://lodash.com/docs#forIn) for iterating over an object’s own and inherited properties
  61 + * [_.forOwn](http://lodash.com/docs#forOwn) for iterating over an object’s own properties
  62 + * [_.isPlainObject](http://lodash.com/docs#isPlainObject) checks if values are created by the `Object` constructor
  63 + * [_.merge](http://lodash.com/docs#merge) for a deep [_.extend](http://lodash.com/docs#extend)
  64 + * [_.partial](http://lodash.com/docs#partial) and [_.partialRight](http://lodash.com/docs#partialRight) for partial application without `this` binding
  65 + * [_.template](http://lodash.com/docs#template) supports [*“imports”* options](http://lodash.com/docs#templateSettings_imports), [ES6 template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6), and [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  66 + * [_.where](http://lodash.com/docs#where) supports deep object comparisons
  67 + * [_.clone](http://lodash.com/docs#clone), [_.omit](http://lodash.com/docs#omit), [_.pick](http://lodash.com/docs#pick),
  68 + [and more…](http://lodash.com/docs "_.assign, _.cloneDeep, _.first, _.initial, _.isEqual, _.last, _.merge, _.rest") accept `callback` and `thisArg` arguments
  69 + * [_.contains](http://lodash.com/docs#contains), [_.size](http://lodash.com/docs#size), [_.toArray](http://lodash.com/docs#toArray),
  70 + [and more…](http://lodash.com/docs "_.at, _.countBy, _.every, _.filter, _.find, _.forEach, _.groupBy, _.invoke, _.map, _.max, _.min, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.some, _.sortBy, _.where") accept strings
  71 + * [_.filter](http://lodash.com/docs#filter), [_.find](http://lodash.com/docs#find), [_.map](http://lodash.com/docs#map),
  72 + [and more…](http://lodash.com/docs "_.countBy, _.every, _.first, _.groupBy, _.initial, _.last, _.max, _.min, _.reject, _.rest, _.some, _.sortBy, _.sortedIndex, _.uniq") support *“_.pluck”* and *“_.where”* `callback` shorthands
  73 +
  74 +## Support
  75 +
  76 +Lo-Dash has been tested in at least Chrome 5~25, Firefox 1~19, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.8.22, Narwhal 0.3.2, PhantomJS 1.8.1, RingoJS 0.9, and Rhino 1.7RC5.
  77 +
  78 +## Custom builds
  79 +
  80 +Custom builds make it easy to create lightweight versions of Lo-Dash containing only the methods you need.
  81 +To top it off, we handle all method dependency and alias mapping for you.
  82 +
  83 + * Backbone builds, with only methods required by Backbone, may be created using the `backbone` modifier argument.
  84 +```bash
  85 +lodash backbone
  86 +```
  87 +
  88 + * CSP builds, supporting default [Content Security Policy](https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html) restrictions, may be created using the `csp` modifier argument.
  89 + The `csp` modifier is an alias of the `mobile` modifier. Lo-Dash may be used in Chrome extensions by using either the `csp`, `mobile`, or `underscore` build and using precompiled templates, or loading Lo-Dash in a [sandbox](http://developer.chrome.com/stable/extensions/sandboxingEval.html).
  90 +```bash
  91 +lodash csp
  92 +```
  93 +
  94 + * Legacy builds, tailored for older environments without [ES5 support](http://es5.github.com/), may be created using the `legacy` modifier argument.
  95 +```bash
  96 +lodash legacy
  97 +```
  98 +
  99 + * Modern builds, tailored for newer environments with ES5 support, may be created using the `modern` modifier argument.
  100 +```bash
  101 +lodash modern
  102 +```
  103 +
  104 + * Mobile builds, without method compilation and most bug fixes for old browsers, may be created using the `mobile` modifier argument.
  105 +```bash
  106 +lodash mobile
  107 +```
  108 +
  109 + * Strict builds, with `_.bindAll`, `_.defaults`, and `_.extend` in [strict mode](http://es5.github.com/#C), may be created using the `strict` modifier argument.
  110 +```bash
  111 +lodash strict
  112 +```
  113 +
  114 + * Underscore builds, tailored for projects already using Underscore, may be created using the `underscore` modifier argument.
  115 +```bash
  116 +lodash underscore
  117 +```
  118 +
  119 +Custom builds may be created using the following commands:
  120 +
  121 + * Use the `category` argument to pass comma separated categories of methods to include in the build.<br>
  122 + Valid categories (case-insensitive) are *“arrays”*, *“chaining”*, *“collections”*, *“functions”*, *“objects”*, and *“utilities”*.
  123 +```bash
  124 +lodash category=collections,functions
  125 +lodash category="collections, functions"
  126 +```
  127 +
  128 + * Use the `exports` argument to pass comma separated names of ways to export the `LoDash` function.<br>
  129 + Valid exports are *“amd”*, *“commonjs”*, *“global”*, *“node”*, and *“none”*.
  130 +```bash
  131 +lodash exports=amd,commonjs,node
  132 +lodash exports="amd, commonjs, node"
  133 +```
  134 +
  135 + * Use the `iife` argument to specify code to replace the immediately-invoked function expression that wraps Lo-Dash.
  136 +```bash
  137 +lodash iife="!function(window,undefined){%output%}(this)"
  138 +```
  139 +
  140 + * Use the `include` argument to pass comma separated method/category names to include in the build.
  141 +```bash
  142 +lodash include=each,filter,map
  143 +lodash include="each, filter, map"
  144 +```
  145 +
  146 + * Use the `minus` argument to pass comma separated method/category names to remove from those included in the build.
  147 +```bash
  148 +lodash underscore minus=result,shuffle
  149 +lodash underscore minus="result, shuffle"
  150 +```
  151 +
  152 + * Use the `plus` argument to pass comma separated method/category names to add to those included in the build.
  153 +```bash
  154 +lodash backbone plus=random,template
  155 +lodash backbone plus="random, template"
  156 +```
  157 +
  158 + * Use the `template` argument to pass the file path pattern used to match template files to precompile.
  159 +```bash
  160 +lodash template="./*.jst"
  161 +```
  162 +
  163 + * Use the `settings` argument to pass the template settings used when precompiling templates.
  164 +```bash
  165 +lodash settings="{interpolate:/\{\{([\s\S]+?)\}\}/g}"
  166 +```
  167 +
  168 + * Use the `moduleId` argument to specify the AMD module ID of Lo-Dash, which defaults to “lodash”, used by precompiled templates.
  169 +```bash
  170 +lodash moduleId="underscore"
  171 +```
  172 +
  173 +All arguments, except `legacy` with `csp`, `mobile`, `modern`, or `underscore`, may be combined.<br>
  174 +Unless specified by `-o` or `--output`, all files created are saved to the current working directory.
  175 +
  176 +The following options are also supported:
  177 +
  178 + * `-c`, `--stdout` ......... Write output to standard output
  179 + * `-d`, `--debug` ........... Write only the non-minified development output
  180 + * `-h`, `--help` ............. Display help information
  181 + * `-m`, `--minify` ......... Write only the minified production output
  182 + * `-o`, `--output` ......... Write output to a given path/filename
  183 + * `-p`, `--source-map` .. Generate a source map for the minified output, using an optional source map URL
  184 + * `-s`, `--silent` ......... Skip status updates normally logged to the console
  185 + * `-V`, `--version` ....... Output current version of Lo-Dash
  186 +
  187 +The `lodash` command-line utility is available when Lo-Dash is installed as a global package (i.e. `npm install -g lodash`).
  188 +
  189 +## Installation and usage
  190 +
  191 +In browsers:
  192 +
  193 +```html
  194 +<script src="lodash.js"></script>
  195 +```
  196 +
  197 +Using [`npm`](http://npmjs.org/):
  198 +
  199 +```bash
  200 +npm install lodash
  201 +
  202 +npm install -g lodash
  203 +npm link lodash
  204 +```
  205 +
  206 +To avoid potential issues, update `npm` before installing Lo-Dash:
  207 +
  208 +```bash
  209 +npm install npm -g
  210 +```
  211 +
  212 +In [Node.js](http://nodejs.org/) and [RingoJS ≥ v0.8.0](http://ringojs.org/):
  213 +
  214 +```js
  215 +var _ = require('lodash');
  216 +
  217 +// or as a drop-in replacement for Underscore
  218 +var _ = require('lodash/dist/lodash.underscore');
  219 +```
  220 +
  221 +**Note:** If Lo-Dash is installed globally, run [`npm link lodash`](http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation/) in your project’s root directory before requiring it.
  222 +
  223 +In [RingoJS ≤ v0.7.0](http://ringojs.org/):
  224 +
  225 +```js
  226 +var _ = require('lodash')._;
  227 +```
  228 +
  229 +In [Rhino](http://www.mozilla.org/rhino/):
  230 +
  231 +```js
  232 +load('lodash.js');
  233 +```
  234 +
  235 +In an AMD loader like [RequireJS](http://requirejs.org/):
  236 +
  237 +```js
  238 +require({
  239 + 'paths': {
  240 + 'underscore': 'path/to/lodash'
  241 + }
  242 +},
  243 +['underscore'], function(_) {
  244 + console.log(_.VERSION);
  245 +});
  246 +```
  247 +
  248 +## Release Notes
  249 +
  250 +### <sup>v1.1.0</sup>
  251 +
  252 + * Added `rhino -require` support
  253 + * Added `_.createCallback`, `_.parseInt`, `_.runInContext`, and `_.support`
  254 + * Added support for `callback` and `thisArg` arguments to `_.flatten`
  255 + * Added CommonJS/Node support to precompiled templates
  256 + * Ensured the `exports` object is not a DOM element
  257 + * Made `_.cloneDeep`’s `callback` support more closely follow its documentation
  258 + * Made the template precompiler create nonexistent directories of `--output` paths
  259 + * Made `_.object` an alias of `_.zipObject`
  260 + * Optimized method chaining
  261 +
  262 +The full changelog is available [here](https://github.com/bestiejs/lodash/wiki/Changelog).
  263 +
  264 +## BestieJS
  265 +
  266 +Lo-Dash is part of the BestieJS *“Best in Class”* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation.
  267 +
  268 +## Author
  269 +
  270 +* [John-David Dalton](http://allyoucanleet.com/)
  271 + [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter")
  272 +
  273 +## Contributors
  274 +
  275 +* [Kit Cambridge](http://kitcambridge.github.com/)
  276 + [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter")
  277 +* [Mathias Bynens](http://mathiasbynens.be/)
  278 + [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter")
5,381 vendor/lodash/lodash.js
5,381 additions, 0 deletions not shown
2  vendor/platform.js/README.md
Source Rendered
@@ -18,7 +18,7 @@ For a list of upcoming features, check out our [roadmap](https://github.com/best
18 18
19 19 ## Support
20 20
21   -Platform.js has been tested in at least Adobe AIR 3.1, Chrome 5-21, Firefox 1-14, IE 6-9, Opera 9.25-12, Safari 3-6, Node.js 0.8.6, Narwhal 0.3.2, RingoJS 0.8, and Rhino 1.7RC5.
  21 +Platform.js has been tested in at least Adobe AIR 3.1, Chrome 5~25, Firefox 1~19, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.8.22, Narwhal 0.3.2, PhantomJS 1.8.1, RingoJS 0.9, and Rhino 1.7RC5.
22 22
23 23 ## Installation and usage
24 24
43 vendor/platform.js/platform.js
@@ -25,6 +25,9 @@
25 25 /** Detect Java environment */
26 26 var java = /Java/.test(getClassOf(window.java)) && window.java;
27 27
  28 + /** Detect Rhino */
  29 + var rhino = java && getClassOf(window.environment) == 'Environment';
  30 +
28 31 /** A character to represent alpha */
29 32 var alpha = java ? 'a' : '\u03b1';
30 33
@@ -581,10 +584,11 @@
581 584 // detect stubborn layout engines
582 585 if (layout == 'iCab' && parseFloat(version) > 3) {
583 586 layout = ['WebKit'];
584   - } else if (data =
585   - /Opera/.test(name) && 'Presto' ||
586   - /\b(?:Midori|Nook|Safari)\b/i.test(ua) && 'WebKit' ||
587   - !layout && /\bMSIE\b/i.test(ua) && (/^Mac/.test(os) ? 'Tasman' : 'Trident')) {
  587 + } else if ((data =
  588 + /Opera/.test(name) && 'Presto' ||
  589 + /\b(?:Midori|Nook|Safari)\b/i.test(ua) && 'WebKit' ||
  590 + !layout && /\bMSIE\b/i.test(ua) && (/^Mac/.test(os) ? 'Tasman' : 'Trident')
  591 + )) {
588 592 layout = [data];
589 593 }
590 594 // leverage environment features
@@ -597,7 +601,7 @@
597 601 arch = data.getProperty('os.arch');
598 602 os = os || data.getProperty('os.name') + ' ' + data.getProperty('os.version');
599 603 }
600   - if (typeof exports == 'object' && exports) {
  604 + if (freeExports) {
601 605 // if `thisBinding` is the [ModuleScope]
602 606 if (thisBinding == oldWin && typeof system == 'object' && (data = [system])[0]) {
603 607 os || (os = data[0].os || null);
@@ -610,23 +614,28 @@
610 614 name = 'Narwhal';
611 615 }
612 616 }
613   - } else if (typeof process == 'object' && (data = process)) {
  617 + }
  618 + else if (typeof process == 'object' && (data = process)) {
614 619 name = 'Node.js';
615 620 arch = data.arch;
616 621 os = data.platform;
617 622 version = /[\d.]+/.exec(data.version)[0];
618 623 }
619   - } else if (getClassOf(window.environment) == 'Environment') {
  624 + else if (rhino) {
  625 + name = 'Rhino';
  626 + }
  627 + }
  628 + else if (rhino) {
620 629 name = 'Rhino';
621 630 }
622 631 }
623 632 // detect Adobe AIR
624   - else if (getClassOf(data = window.runtime) == 'ScriptBridgingProxyObject') {
  633 + else if (getClassOf((data = window.runtime)) == 'ScriptBridgingProxyObject') {
625 634 name = 'Adobe AIR';
626 635 os = data.flash.system.Capabilities.os;
627 636 }
628 637 // detect PhantomJS
629   - else if (getClassOf(data = window.phantom) == 'RuntimeObject') {
  638 + else if (getClassOf((data = window.phantom)) == 'RuntimeObject') {
630 639 name = 'PhantomJS';
631 640 version = (data = data.version || null) && (data.major + '.' + data.minor + '.' + data.patch);
632 641 }
@@ -646,9 +655,10 @@
646 655 }
647 656 // detect prerelease phases
648 657 if (version && (data =
649   - /(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(version) ||
650   - /(?:alpha|beta)(?: ?\d)?/i.exec(ua + ';' + (useFeatures && nav.appMinorVersion)) ||
651   - /\bMinefield\b/i.test(ua) && 'a')) {
  658 + /(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(version) ||
  659 + /(?:alpha|beta)(?: ?\d)?/i.exec(ua + ';' + (useFeatures && nav.appMinorVersion)) ||
  660 + /\bMinefield\b/i.test(ua) && 'a'
  661 + )) {
652 662 prerelease = /b/i.test(data) ? 'beta' : 'alpha';
653 663 version = version.replace(RegExp(data + '\\+?$'), '') +
654 664 (prerelease == 'beta' ? beta : alpha) + (/\d+\+?/.exec(data) || '');
@@ -689,8 +699,9 @@
689 699 // detect BlackBerry OS version
690 700 // http://docs.blackberry.com/en/developers/deliverables/18169/HTTP_headers_sent_by_BB_Browser_1234911_11.jsp
691 701 else if (/BlackBerry/.test(product) && (data =
692   - (RegExp(product.replace(/ +/g, ' *') + '/([.\\d]+)', 'i').exec(ua) || 0)[1] ||
693   - version)) {
  702 + (RegExp(product.replace(/ +/g, ' *') + '/([.\\d]+)', 'i').exec(ua) || 0)[1] ||
  703 + version
  704 + )) {
694 705 os = 'Device Software ' + data;
695 706 version = null;
696 707 }
@@ -705,7 +716,7 @@
705 716 /Windows XP/.test(os) && version > 8 ||
706 717 version == 8 && !/Trident/.test(ua)
707 718 ))
708   - ) && !reOpera.test(data = parse.call(forOwn, ua.replace(reOpera, '') + ';')) && data.name) {
  719 + ) && !reOpera.test((data = parse.call(forOwn, ua.replace(reOpera, '') + ';'))) && data.name) {
709 720
710 721 // when "indentifying", the UA contains both Opera and the other browser's name
711 722 data = 'ing as ' + data.name + ((data = data.version) ? ' ' + data : '');
@@ -793,7 +804,7 @@
793 804 }
794 805 }
795 806 // strip incorrect OS versions
796   - if (version && version.indexOf(data = /[\d.]+$/.exec(os)) == 0 &&
  807 + if (version && version.indexOf((data = /[\d.]+$/.exec(os))) == 0 &&
797 808 ua.indexOf('/' + data + '-') > -1) {
798 809 os = trim(os.replace(data, ''));
799 810 }
29 vendor/qunit-clib/README.md
Source Rendered
... ... @@ -1,4 +1,4 @@
1   -# QUnit CLIB <sup>v1.2.0</sup>
  1 +# QUnit CLIB <sup>v1.3.0</sup>
2 2 ## command-line interface boilerplate
3 3
4 4 QUnit CLIB helps extend QUnit's CLI support to many common CLI environments.
@@ -9,26 +9,29 @@ QUnit CLIB helps extend QUnit's CLI support to many common CLI environments.
9 9
10 10 ## Support
11 11
12   -QUnit CLIB has been tested in at least Node.js 0.4.8-0.8.19, Narwhal v0.3.2, PhantomJS 1.8.1, RingoJS v0.9, and Rhino v1.7RC5.
  12 +QUnit CLIB has been tested in at least Node.js 0.4.8-0.8.22, Narwhal 0.3.2, PhantomJS 1.8.1, RingoJS 0.9, and Rhino 1.7RC5.
13 13
14 14 ## Usage
15 15
16 16 ```js
17   -(function(window) {
  17 +;(function(window) {
  18 + 'use strict';
18 19
19 20 // use a single "load" function
20 21 var load = typeof require == 'function' ? require : window.load;
21 22
22 23 // load QUnit and CLIB if needed
23   - var QUnit =
24   - window.QUnit || (
25   - window.addEventListener || (window.addEventListener = Function.prototype),
26   - window.setTimeout || (window.setTimeout = Function.prototype),
27   - window.QUnit = load('path/to/qunit.js') || window.QUnit,
28   - load('path/to/qunit-clib.js'),
29   - window.addEventListener === Function.prototype && delete window.addEventListener,
  24 + var QUnit = (function() {
  25 + var noop = Function.prototype;
  26 + return window.QUnit || (
  27 + window.addEventListener || (window.addEventListener = noop),
  28 + window.setTimeout || (window.setTimeout = noop),
  29 + window.QUnit = load('../vendor/qunit/qunit/qunit.js') || window.QUnit,
  30 + (load('../vendor/qunit-clib/qunit-clib.js') || { 'runInContext': noop }).runInContext(window),
  31 + addEventListener === noop && delete window.addEventListener,
30 32 window.QUnit
31 33 );
  34 + }());
32 35
33 36 // explicitly call `QUnit.module()` instead of `module()`
34 37 // in case we are in a CLI environment
@@ -38,9 +41,8 @@ QUnit CLIB has been tested in at least Node.js 0.4.8-0.8.19, Narwhal v0.3.2, Pha
38 41 // ...
39 42 });
40 43
41   - // must call `QUnit.start()` if using QUnit < 1.3.0 with Node.js or any
42   - // version of QUnit with Narwhal, PhantomJS, Rhino, or RingoJS
43   - if (!window.document) {
  44 + // call `QUnit.start()` for Narwhal, Node.js, PhantomJS, Rhino, and RingoJS
  45 + if (!window.document || window.phantom) {
44 46 QUnit.start();
45 47 }
46 48 }(typeof global == 'object' && global || this));
@@ -49,7 +51,6 @@ QUnit CLIB has been tested in at least Node.js 0.4.8-0.8.19, Narwhal v0.3.2, Pha
49 51 ## Footnotes
50 52
51 53 1. QUnit v1.3.0 does not work with Narwhal or Ringo < v0.8.0
52   -
53 54 2. Rhino v1.7RC4 does not support timeout fallbacks `clearTimeout` and `setTimeout`
54 55
55 56 ## Author
107 vendor/qunit-clib/qunit-clib.js
@@ -7,12 +7,28 @@
7 7 ;(function(window) {
8 8 'use strict';
9 9
  10 + /** Detect free variable `exports` */
  11 + var freeExports = typeof exports == 'object' && exports;
  12 +
  13 + /** Detect free variable `global` and use it as `window` */
  14 + var freeGlobal = typeof global == 'object' && global;
  15 + if (freeGlobal.global === freeGlobal) {
  16 + window = freeGlobal;
  17 + }
  18 +
  19 + /*--------------------------------------------------------------------------*/
  20 +
10 21 /**
11   - * Timeout fallbacks based on the work of Andrea Giammarchi and Weston C.
12   - * https://github.com/WebReflection/wru/blob/master/src/rhinoTimers.js
13   - * http://stackoverflow.com/questions/2261705/how-to-run-a-javascript-function-asynchronously-without-using-settimeout
  22 + * Installs the CLI boilerplate additions on the given `context` object.
  23 + *
  24 + * @memberOf exports
  25 + * @param {Object} context The context object.
14 26 */
15   - (function() {
  27 + function runInContext(context) {
  28 + // exit early if no `context` is provided or if `QUnit` does not exist
  29 + if (!context || !context.QUnit) {
  30 + return;
  31 + }
16 32
17 33 /**
18 34 * Schedules timer-based callbacks.
@@ -29,7 +45,7 @@
29 45 // https://bugzilla.mozilla.org/show_bug.cgi?id=775566
30 46 var task = ids[++counter] = new JavaAdapter(java.util.TimerTask, {
31 47 'run': function() {
32   - fn.apply(window, args);
  48 + fn.apply(context, args);
33 49 }
34 50 });
35 51 // support non-functions
@@ -53,7 +69,7 @@
53 69 /**
54 70 * Clears the delay set by `setInterval` or `setTimeout`.
55 71 *
56   - * @memberOf window
  72 + * @memberOf context
57 73 * @param {Number} id The ID of the timeout to be cleared.
58 74 */
59 75 function clearTimer(id) {
@@ -67,7 +83,7 @@
67 83 /**
68 84 * Executes a code snippet or function repeatedly, with a delay between each call.
69 85 *
70   - * @memberOf window
  86 + * @memberOf context
71 87 * @param {Function|String} fn The function to call or string to evaluate.
72 88 * @oaram {Number} delay The number of milliseconds to delay each `fn` call.
73 89 * @param [arg1, arg2, ...] Arguments to invoke `fn` with.
@@ -80,7 +96,7 @@
80 96 /**
81 97 * Executes a code snippet or a function after specified delay.
82 98 *
83   - * @memberOf window
  99 + * @memberOf context
84 100 * @param {Function|String} fn The function to call or string to evaluate.
85 101 * @oaram {Number} delay The number of milliseconds to delay the `fn` call.
86 102 * @param [arg1, arg2, ...] Arguments to invoke `fn` with.
@@ -90,29 +106,17 @@
90 106 return schedule(fn, delay, slice.call(arguments, 2));
91 107 }
92 108
93   - try {
94   - var counter = 0,
95   - ids = {},
96   - slice = Array.prototype.slice,
97   - timer = new java.util.Timer;
98   -
99   - window.clearInterval =
100   - window.clearTimeout = clearTimer;
101   - window.setInterval = setInterval;
102   - window.setTimeout = setTimeout;
103   - } catch(e) { }
104   - }());
  109 + /*------------------------------------------------------------------------*/
105 110
106   - /*--------------------------------------------------------------------------*/
  111 + /** Add `console.log()` support for Narwhal, Rhino, and RingoJS */
  112 + var console = context.console || (context.console = { 'log': context.print });
107 113
108   - (function() {
  114 + /** Shorten `context.QUnit.QUnit` to `context.QUnit` */
  115 + var QUnit = context.QUnit = context.QUnit.QUnit || context.QUnit;
109 116
110 117 /** Used as a horizontal rule in console output */
111 118 var hr = '----------------------------------------';
112 119
113   - /** Shorten `window.QUnit.QUnit` to `window.QUnit` */
114   - window.QUnit && (QUnit = QUnit.QUnit || QUnit);
115   -
116 120 /**
117 121 * A logging callback triggered when all testing is completed.
118 122 *
@@ -134,14 +138,14 @@
134 138 console.log(' Finished in ' + details.runtime + ' milliseconds.');
135 139 console.log(hr);
136 140
137   - // exit out of Rhino
  141 + // exit out of Narhwal, Rhino, or Ringo
138 142 try {
139 143 quit();
140 144 } catch(e) { }
141 145
142 146 // exit out of Node.js or PhantomJS
143 147 try {
144   - var process = window.process || window.phantom;
  148 + var process = context.process || context.phantom;
145 149 if (details.failed) {
146 150 console.error('Error: ' + details.failed + ' of ' + details.total + ' tests failed.');
147 151 process.exit(1);
@@ -247,23 +251,42 @@
247 251 */
248 252 'assertions': []
249 253 };
250   - }());
251 254
252   - /*--------------------------------------------------------------------------*/
  255 + /*------------------------------------------------------------------------*/
  256 +
  257 + // Timeout fallbacks based on the work of Andrea Giammarchi and Weston C.
  258 + // https://github.com/WebReflection/wru/blob/master/src/rhinoTimers.js
  259 + // http://stackoverflow.com/questions/2261705/how-to-run-a-javascript-function-asynchronously-without-using-settimeout
  260 + try {
  261 + var counter = 0,
  262 + ids = {},
  263 + slice = Array.prototype.slice,
  264 + timer = new java.util.Timer;
  265 +
  266 + context.clearInterval =
  267 + context.clearTimeout = clearTimer;
  268 + context.setInterval = setInterval;
  269 + context.setTimeout = setTimeout;
  270 + } catch(e) { }
253 271
254   - // expose shortcuts
255   - // exclude `module` because some environments have it as a built-in object
256   - ('asyncTest deepEqual equal equals expect notDeepEqual notEqual notStrictEqual ' +
257   - 'ok raises same start stop strictEqual test throws').replace(/\S+/g, function(methodName) {
258   - window[methodName] = QUnit[methodName];
259   - });
  272 + // expose shortcuts
  273 + // exclude `module` because some environments have it as a built-in object
  274 + ('asyncTest deepEqual equal equals expect notDeepEqual notEqual notStrictEqual ' +
  275 + 'ok raises same start stop strictEqual test throws').replace(/\S+/g, function(methodName) {
  276 + context[methodName] = QUnit[methodName];
  277 + });
260 278
261   - // add `console.log()` support for Narwhal, Rhino, and RingoJS
262   - if (!window.console && window.print) {
263   - window.console = { 'log': window.print };
  279 + // must call `QUnit.start()` in the test file if using QUnit < 1.3.0 with
  280 + // Node.js or any version of QUnit with Narwhal, PhantomJS, Rhino, or RingoJS
  281 + QUnit.init();
264 282 }
265   - // must call `QUnit.start()` in the test file if using QUnit < 1.3.0 with
266   - // Node.js or any version of QUnit with Narwhal, PhantomJS, Rhino, or RingoJS
267   - QUnit.init();
268 283
269   -}(typeof global == 'object' && global || this));
  284 + /*--------------------------------------------------------------------------*/
  285 +
  286 + // expose QUnit CLIB
  287 + if (freeExports) {
  288 + freeExports.runInContext = runInContext;
  289 + } else {
  290 + runInContext(window);
  291 + }
  292 +}(this));
69 vendor/requirejs/require.js
... ... @@ -1,5 +1,5 @@
1 1 /** vim: et:ts=4:sw=4:sts=4
2   - * @license RequireJS 2.1.4 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
  2 + * @license RequireJS 2.1.5 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
3 3 * Available via the MIT or new BSD license.
4 4 * see: http://github.com/jrburke/requirejs for details
5 5 */
@@ -12,7 +12,7 @@ var requirejs, require, define;
12 12 (function (global) {
13 13 var req, s, head, baseElement, dataMain, src,
14 14 interactiveScript, currentlyAddingScript, mainScript, subPath,
15   - version = '2.1.4',
  15 + version = '2.1.5',
16 16 commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
17 17 cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
18 18 jsSuffixRegExp = /\.js$/,
@@ -191,15 +191,21 @@ var requirejs, require, define;
191 191 var inCheckLoaded, Module, context, handlers,
192 192 checkLoadedTimeoutId,
193 193 config = {
  194 + //Defaults. Do not set a default for map
  195 + //config to speed up normalize(), which
  196 + //will run faster if there is no default.
194 197 waitSeconds: 7,
195 198 baseUrl: './',
196 199 paths: {},
197 200 pkgs: {},
198 201 shim: {},
199   - map: {},
200 202 config: {}
201 203 },
202 204 registry = {},
  205 + //registry of just enabled modules, to speed
  206 + //cycle breaking code when lots of modules
  207 + //are registered, but not activated.
  208 + enabledRegistry = {},
203 209 undefEvents = {},
204 210 defQueue = [],
205 211 defined = {},
@@ -295,7 +301,7 @@ var requirejs, require, define;
295 301 }
296 302
297 303 //Apply map config if available.
298   - if (applyMap && (baseParts || starMap) && map) {
  304 + if (applyMap && map && (baseParts || starMap)) {
299 305 nameParts = name.split('/');
300 306
301 307 for (i = nameParts.length; i > 0; i -= 1) {
@@ -576,6 +582,7 @@ var requirejs, require, define;
576 582 function cleanRegistry(id) {
577 583 //Clean up machinery used for waiting modules.
578 584 delete registry[id];
  585 + delete enabledRegistry[id];
579 586 }
580 587
581 588 function breakCycle(mod, traced, processed) {
@@ -624,7 +631,7 @@ var requirejs, require, define;
624 631 inCheckLoaded = true;
625 632
626 633 //Figure out the state of all the modules.
627   - eachProp(registry, function (mod) {
  634 + eachProp(enabledRegistry, function (mod) {
628 635 map = mod.map;
629 636 modId = map.id;
630 637
@@ -805,7 +812,7 @@ var requirejs, require, define;
805 812 },
806 813
807 814 /**
808   - * Checks is the module is ready to define itself, and if so,
  815 + * Checks if the module is ready to define itself, and if so,
809 816 * define it.
810 817 */
811 818 check: function () {
@@ -883,7 +890,7 @@ var requirejs, require, define;
883 890 }
884 891
885 892 //Clean up
886   - delete registry[id];
  893 + cleanRegistry(id);
887 894
888 895 this.defined = true;
889 896 }
@@ -1049,6 +1056,7 @@ var requirejs, require, define;
1049 1056 },
1050 1057
1051 1058 enable: function () {
  1059 + enabledRegistry[this.map.id] = this;
1052 1060 this.enabled = true;
1053 1061
1054 1062 //Set flag mentioning that the module is enabling,
@@ -1208,6 +1216,7 @@ var requirejs, require, define;
1208 1216 Module: Module,
1209 1217 makeModuleMap: makeModuleMap,
1210 1218 nextTick: req.nextTick,
  1219 + onError: onError,
1211 1220
1212 1221 /**
1213 1222 * Set a configuration for the context.
@@ -1234,6 +1243,9 @@ var requirejs, require, define;
1234 1243 eachProp(cfg, function (value, prop) {
1235 1244 if (objs[prop]) {
1236 1245 if (prop === 'map') {
  1246 + if (!config.map) {
  1247 + config.map = {};
  1248 + }
1237 1249 mixin(config[prop], value, true, true);
1238 1250 } else {
1239 1251 mixin(config[prop], value, true);
@@ -1345,7 +1357,7 @@ var requirejs, require, define;
1345 1357 //Synchronous access to one module. If require.get is
1346 1358 //available (as in the Node adapter), prefer that.
1347 1359 if (req.get) {
1348   - return req.get(context, deps, relMap);
  1360 + return req.get(context, deps, relMap, localRequire);
1349 1361 }
1350 1362
1351 1363 //Normalize module name, if it contains . or ..
@@ -1396,7 +1408,7 @@ var requirejs, require, define;
1396 1408 * plain URLs like nameToUrl.
1397 1409 */
1398 1410 toUrl: function (moduleNamePlusExt) {
1399   - var ext, url,
  1411 + var ext,
1400 1412 index = moduleNamePlusExt.lastIndexOf('.'),
1401 1413 segment = moduleNamePlusExt.split('/')[0],
1402 1414 isRelative = segment === '.' || segment === '..';
@@ -1408,9 +1420,8 @@ var requirejs, require, define;
1408 1420 moduleNamePlusExt = moduleNamePlusExt.substring(0, index);
1409 1421 }
1410 1422
1411   - url = context.nameToUrl(normalize(moduleNamePlusExt,
1412   - relMap && relMap.id, true), ext || '.fake');
1413   - return ext ? url : url.substring(0, url.length - 5);
  1423 + return context.nameToUrl(normalize(moduleNamePlusExt,
  1424 + relMap && relMap.id, true), ext, true);
1414 1425 },
1415 1426
1416 1427 defined: function (id) {
@@ -1529,7 +1540,7 @@ var requirejs, require, define;
1529 1540 * it is assumed to have already been normalized. This is an
1530 1541 * internal API, not a public one. Use toUrl for the public API.
1531 1542 */
1532   - nameToUrl: function (moduleName, ext) {
  1543 + nameToUrl: function (moduleName, ext, skipExt) {
1533 1544 var paths, pkgs, pkg, pkgPath, syms, i, parentModule, url,
1534 1545 parentPath;
1535 1546
@@ -1578,7 +1589,7 @@ var requirejs, require, define;
1578 1589
1579 1590 //Join the path parts together, then figure out if baseUrl is needed.
1580 1591 url = syms.join('/');
1581   - url += (ext || (/\?/.test(url) ? '' : '.js'));
  1592 + url += (ext || (/\?/.test(url) || skipExt ? '' : '.js'));
1582 1593 url = (url.charAt(0) === '/' || url.match(/^[\w\+\.\-]+:/) ? '' : config.baseUrl) + url;
1583 1594 }
1584 1595
@@ -1817,7 +1828,7 @@ var requirejs, require, define;
1817 1828 node.attachEvent('onreadystatechange', context.onScriptLoad);
1818 1829 //It would be great to add an error handler here to catch
1819 1830 //404s in IE9+. However, onreadystatechange will fire before
1820   - //the error handler, so that does not help. If addEvenListener
  1831 + //the error handler, so that does not help. If addEventListener
1821 1832 //is used, then IE will fire error before load, but we cannot
1822 1833 //use that pathway given the connect.microsoft.com issue
1823 1834 //mentioned above about not doing the 'script execute,
@@ -1846,16 +1857,24 @@ var requirejs, require, define;
1846 1857
1847 1858 return node;
1848 1859 } else if (isWebWorker) {
1849   - //In a web worker, use importScripts. This is not a very
1850   - //efficient use of importScripts, importScripts will block until
1851   - //its script is downloaded and evaluated. However, if web workers
1852   - //are in play, the expectation that a build has been done so that
1853   - //only one script needs to be loaded anyway. This may need to be
1854   - //reevaluated if other use cases become common.
1855   - importScripts(url);
1856   -
1857   - //Account for anonymous modules
1858   - context.completeLoad(moduleName);
  1860 + try {
  1861 + //In a web worker, use importScripts. This is not a very
  1862 + //efficient use of importScripts, importScripts will block until
  1863 + //its script is downloaded and evaluated. However, if web workers
  1864 + //are in play, the expectation that a build has been done so that
  1865 + //only one script needs to be loaded anyway. This may need to be
  1866 + //reevaluated if other use cases become common.
  1867 + importScripts(url);
  1868 +
  1869 + //Account for anonymous modules
  1870 + context.completeLoad(moduleName);
  1871 + } catch (e) {
  1872 + context.onError(makeError('importscripts',
  1873 + 'importScripts failed for ' +
  1874 + moduleName + ' at ' + url,
  1875 + e,
  1876 + [moduleName]));
  1877 + }
1859 1878 }
1860 1879 };
1861 1880

0 comments on commit a421927

Please sign in to comment.
Something went wrong with that request. Please try again.