diff --git a/deps/.npm/connect/0.2.5/package/.gitignore b/deps/.npm/connect/0.2.5/package/.gitignore deleted file mode 100644 index 135ecf17..00000000 --- a/deps/.npm/connect/0.2.5/package/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -.DS_Store -pids -logs -results -*.pid -*.gz -*.log -lib-cov -test/fixtures/foo.bar.baz.css -test/fixtures/style.css -test/fixtures/script.js \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/.gitmodules b/deps/.npm/connect/0.2.5/package/.gitmodules deleted file mode 100644 index 5fb74233..00000000 --- a/deps/.npm/connect/0.2.5/package/.gitmodules +++ /dev/null @@ -1,21 +0,0 @@ -[submodule "examples/sousaball/support/microtemplates"] - path = examples/sousaball/support/microtemplates - url = git://github.com/creationix/microtemplates.git -[submodule "examples/sousaball/support/postgres-js"] - path = examples/sousaball/support/postgres-js - url = git://github.com/creationix/postgres-js.git -[submodule "support/expresso"] - path = support/expresso - url = git://github.com/visionmedia/expresso.git -[submodule "support/sass"] - path = support/sass - url = git://github.com/visionmedia/sass.js.git -[submodule "support/less"] - path = support/less - url = git://github.com/cloudhead/less.js.git -[submodule "support/koala"] - path = support/koala - url = git://github.com/visionmedia/koala.js.git -[submodule "support/coffee-script"] - path = support/coffee-script - url = http://github.com/jashkenas/coffee-script.git diff --git a/deps/.npm/connect/0.2.5/package/AUTHORS.markdown b/deps/.npm/connect/0.2.5/package/AUTHORS.markdown deleted file mode 100644 index 5ac88ffa..00000000 --- a/deps/.npm/connect/0.2.5/package/AUTHORS.markdown +++ /dev/null @@ -1,19 +0,0 @@ -# Authors ordered by first contribution - - - Tim Caswell - - TJ Holowaychuk - - Astro - - Guillermo Rauch - - Aaron Heckmann - -# People who have signed the [Connect CLA][] - - - TJ Holowaychuk - - Astro - - Guillermo Rauch - - Aaron Heckmann - - Nathan Rajlich - - Jakub Nešetřil - - Jacques Crocker - -[Connect CLA]: http://extjs.github.com/Connect/Connect%20Individual%20CLA.pdf \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/History.md b/deps/.npm/connect/0.2.5/package/History.md deleted file mode 100644 index a4f686cd..00000000 --- a/deps/.npm/connect/0.2.5/package/History.md +++ /dev/null @@ -1,162 +0,0 @@ - -1.0.0 / 2010-07-21 -================== - - * Added _staticGzip_ middleware - * Added `connect.utils` to expose utils - * Added `connect.session.Session` - * Added `connect.session.Store` - * Added `connect.session.MemoryStore` - * Added `connect.middleware` to expose the middleware getters - * Added `buffer` option to _logger_ for performance increase - * Added _favicon_ middleware for serving your own favicon or the connect default - * Added option support to _staticProvider_, can now pass _root_ and _lifetime_. - * Added; mounted `Server` instances now have the `route` property exposed for reflection - * Added support for callback as first arg to `Server#use()` - * Added support for `next(true)` in _router_ to bypass match attempts - * Added `Server#listen()` _host_ support - * Added `Server#route` when `Server#use()` is called with a route on a `Server` instance - * Added _methodOverride_ X-HTTP-Method-Override support - * Refactored session internals, adds _secret_ option - * Renamed `lifetime` option to `maxAge` in _staticProvider_ - * Removed connect(1), it is now [spark(1)](http://github.com/senchalabs/spark) - * Removed connect(1) dependency on examples, they can all now run with node(1) - * Remove a typo that was leaking a global. - * Removed `Object.prototype` forEach() and map() methods - * Removed a few utils not used - * Removed `connect.createApp()` - * Removed `res.simpleBody()` - * Removed _format_ middleware - * Removed _flash_ middleware - * Removed _redirect_ middleware - * Removed _jsonrpc_ middleware, use [visionmedia/connect-jsonrpc](http://github.com/visionmedia/connect-jsonrpc) - * Removed _pubsub_ middleware - * Removed need for `params.{captures,splat}` in _router_ middleware, `params` is an array - * Changed; _compiler_ no longer 404s - * Changed; _router_ signature now matches connect middleware signature - * Fixed a require in _session_ for default `MemoryStore` - * Fixed nasty request body bug in _router_. Closes #54 - * Fixed _less_ support in _compiler_ - * Fixed bug preventing proper bubbling of exceptions in mounted servers - * Fixed bug in `Server#use()` preventing `Server` instances as the first arg - * Fixed **ENOENT** special case, is now treated as any other exception - * Fixed spark env support - -0.2.1 / 2010-07-09 -================== - - * Added support for _router_ `next()` to continue calling matched routes - * Added mime type for _cache.manifest_ files. - * Changed _compiler_ middleware to use async require - * Changed session api, stores now only require `#get()`, and `#set()` - * Fixed _cacheManifest_ by adding `utils.find()` back - -0.2.0 / 2010-07-01 -================== - - * Added calls to `Session()` casts the given object as a `Session` instance - * Added passing of `next()` to _router_ callbacks. Closes #46 - * Changed; `MemoryStore#destroy()` removes `req.session` - * Changed `res.redirect("back")` to default to "/" when Referr?er is not present - * Fixed _staticProvider_ urlencoded paths issue. Closes #47 - * Fixed _staticProvider_ middleware responding to **GET** requests - * Fixed _jsonrpc_ middleware `Accept` header check. Closes #43 - * Fixed _logger_ format option - * Fixed typo in _compiler_ middleware preventing the _dest_ option from working - -0.1.0 / 2010-06-25 -================== - - * Revamped the api, view the [Connect documentation](http://extjs.github.com/Connect/index.html#Middleware-Authoring) for more info (hover on the right for menu) - * Added [extended api docs](http://extjs.github.com/Connect/api.html) - * Added docs for several more middleware layers - * Added `connect.Server#use()` - * Added _compiler_ middleware which provides arbitrary static compilation - * Added `req.originalUrl` - * Removed _blog_ example - * Removed _sass_ middleware (use _compiler_) - * Removed _less_ middleware (use _compiler_) - * Renamed middleware to be camelcase, _body-decoder_ is now _bodyDecoder_ etc. - * Fixed `req.url` mutation bug when matching `connect.Server#use()` routes - * Fixed `mkdir -p` implementation used in _bin/connect_. Closes #39 - * Fixed bug in _bodyDecoder_ throwing exceptions on request empty bodies - * `make install` installing lib to $LIB_PREFIX aka $HOME/.node_libraries - -0.0.6 / 2010-06-22 -================== - - * Added _static_ middleware usage example - * Added support for regular expressions as paths for _router_ - * Added `util.merge()` - * Increased performance of _static_ by ~ 200 rps - * Renamed the _rest_ middleware to _router_ - * Changed _rest_ api to accept a callback function - * Removed _router_ middleware - * Removed _proto.js_, only `Object#forEach()` remains - -0.0.5 / 2010-06-21 -================== - - * Added Server#use() which contains the Layer normalization logic - * Added documentation for several middleware - * Added several new examples - * Added _less_ middleware - * Added _repl_ middleware - * Added _vhost_ middleware - * Added _flash_ middleware - * Added _cookie_ middleware - * Added _session_ middleware - * Added `utils.htmlEscape()` - * Added `utils.base64Decode()` - * Added `utils.base64Encode()` - * Added `utils.uid()` - * Added bin/connect app path and --config path support for .js suffix, although optional. Closes #26 - * Moved mime code to `utils.mime`, ex `utils.mime.types`, and `utils.mime.type()` - * Renamed req.redirect() to res.redirect(). Closes #29 - * Fixed _sass_ 404 on **ENOENT** - * Fixed +new Date duplication. Closes #24 - -0.0.4 / 2010-06-16 -================== - - * Added workerPidfile() to bin/connect - * Added --workers support to bin/connect stop and status commands - * Added _redirect_ middleware - * Added better --config support to bin/connect. All flags can be utilized - * Added auto-detection of _./config.js_ - * Added config example - * Added `net.Server` support to bin/connect - * Writing worker pids relative to `env.pidfile` - * s/parseQuery/parse/g - * Fixed npm support - -0.0.3 / 2010-06-16 -================== - - * Fixed node dependency in package.json, now _">= 0.1.98-0"_ to support __HEAD__ - -0.0.2 / 2010-06-15 -================== - - * Added `-V, --version` to bin/connect - * Added `utils.parseCookie()` - * Added `utils.serializeCookie()` - * Added `utils.toBoolean()` - * Added _sass_ middleware - * Added _cookie_ middleware - * Added _format_ middleware - * Added _lint_ middleware - * Added _rest_ middleware - * Added _./package.json_ (npm install connect) - * Added `handleError()` support - * Added `process.connectEnv` - * Added custom log format support to _log_ middleware - * Added arbitrary env variable support to bin/connect (ext: --logFormat ":method :url") - * Added -w, --workers to bin/connect - * Added bin/connect support for --user NAME and --group NAME - * Fixed url re-writing support - -0.0.1 / 2010-06-03 -================== - - * Initial release diff --git a/deps/.npm/connect/0.2.5/package/LICENSE b/deps/.npm/connect/0.2.5/package/LICENSE deleted file mode 100644 index 38e656fc..00000000 --- a/deps/.npm/connect/0.2.5/package/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2010 Sencha Inc. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/Makefile b/deps/.npm/connect/0.2.5/package/Makefile deleted file mode 100644 index 9f100d51..00000000 --- a/deps/.npm/connect/0.2.5/package/Makefile +++ /dev/null @@ -1,85 +0,0 @@ - -NODE = node -TEST = support/expresso/bin/expresso -TESTS ?= test/*.test.js -PREFIX = /usr/local -LIB_PREFIX = $(HOME)/.node_libraries -DOCS = docs/index.md \ - docs/methodOverride.md \ - docs/conditionalGet.md \ - docs/cookieDecoder.md \ - docs/bodyDecoder.md \ - docs/errorHandler.md \ - docs/session.md \ - docs/jsonrpc.md \ - docs/staticProvider.md \ - docs/compiler.md \ - docs/router.md \ - docs/lint.md \ - docs/logger.md - -MANPAGES = $(DOCS:.md=.1) -HTMLDOCS = $(DOCS:.md=.html) - -test: - @CONNECT_ENV=test ./$(TEST) \ - -I lib \ - -I support/sass/lib \ - -I support/less/lib \ - $(TEST_FLAGS) $(TESTS) - -test-cov: - @$(MAKE) test TEST_FLAGS="--cov" - -install: install-docs - cp -fr lib/connect $(LIB_PREFIX)/connect - -uninstall: - rm -f $(PREFIX)/share/man/man1/connect.1 - rm -f $(PREFIX)/share/man/man1/connect-*.1 - rm -fr $(LIB_PREFIX)/connect - -install-docs: - cp -f docs/index.1 $(PREFIX)/share/man/man1/connect.1 - cp -f docs/bodyDecoder.1 $(PREFIX)/share/man/man1/connect-bodyDecoder.1 - cp -f docs/conditionalGet.1 $(PREFIX)/share/man/man1/connect-conditionalGet.1 - cp -f docs/errorHandler.1 $(PREFIX)/share/man/man1/connect-errorHandler.1 - cp -f docs/methodOverride.1 $(PREFIX)/share/man/man1/connect-methodOverride.1 - cp -f docs/lint.1 $(PREFIX)/share/man/man1/connect-lint.1 - cp -f docs/staticProvider.1 $(PREFIX)/share/man/man1/connect-staticProvider.1 - cp -f docs/logger.1 $(PREFIX)/share/man/man1/connect-logger.1 - cp -f docs/router.1 $(PREFIX)/share/man/man1/connect-router.1 - cp -f docs/cookieDecoder.1 $(PREFIX)/share/man/man1/connect-cookieDecoder.1 - cp -f docs/session.1 $(PREFIX)/share/man/man1/connect-session.1 - cp -f docs/jsonrpc.1 $(PREFIX)/share/man/man1/connect-jsonrpc.1 - cp -f docs/compiler.1 $(PREFIX)/share/man/man1/connect-compiler.1 - -benchmark: benchmarks/run - @./benchmarks/run - -graphs: benchmarks/graph - @./benchmarks/graph - -docs: docs/api.html $(MANPAGES) $(HTMLDOCS) - -docs/api.html: - dox --title Connect \ - --desc "High performance middleware for [node](http://nodejs.org)." \ - $(shell find lib/connect/middleware/* -type f) > $@ - -%.1: %.md - @echo "... $< -> $@" - @ronn -r --pipe $< > $@ & - -%.html: %.md - @echo "... $< -> $@" - @ronn -5 --pipe --fragment $< \ - | cat docs/layout/api.head.html - docs/layout/api.foot.html \ - | sed 's/NAME/Connect/g' \ - | node support/highlight.js \ - > $@ & - -docclean: - rm -f docs/*.{1,html} - -.PHONY: install uninstall docs test test-cov benchmark graphs install-docs docclean \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/README.md b/deps/.npm/connect/0.2.5/package/README.md deleted file mode 100644 index 37a3d1c9..00000000 --- a/deps/.npm/connect/0.2.5/package/README.md +++ /dev/null @@ -1,110 +0,0 @@ -# Connect - -Connect is a high performance middleware framework built by the combined forces of Tim Caswell ([creationix][]) and TJ Holowaychuk ([visionmedia][]) and the other skilled developers of [Sencha][]. Connect takes the familiar concepts of Ruby's [Rack](http://rack.rubyforge.org/) and applies it to the asynchronous world of [node](http://nodejs.org). - -ExtJS is releasing Connect under the very liberal MIT license in hopes that we can provide some level of leadership and stability for application frameworks to build on. - -## Features - - * High performance api, with nearly no overhead. - * Several bundled middleware implementations such as _log_, _static_, and _json-rpc_. - -## Hello World - -The simplest connect app looks just like `http.Server` instances from node. In fact `Connect.Server` inherits from `http.Server`. - - var Connect = require('connect'); - - var server = Connect.createServer(function(req, res) { - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.end('Hello World'); - }); - - server.listen(3000); - -Then if you want to add in a pre-built feature like logging just add it to the `createServer()` call. - - var server = Connect.createServer( - Connect.logger(), - function(req, res) { - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.end('Hello World'); - } - ); - -It's that simple. - -## Installation - -Via curl / sh: - - $ curl -# http://github.com/senchalabs/connect/raw/master/install.sh | sh - -Via git (or downloaded tarball): - - $ git clone git://github.com/senchalabs/connect.git && cd connect && make install - -Via [npm](http://github.com/isaacs/npm): - - $ npm install connect - -## Documentation - -View the man page: - - $ man connect - -View the HTML document: - - $ open docs/index.html - -View the online HTML documentation visit [http://senchalabs.github.com/connect](http://senchalabs.github.com/connect). - -View one of several examples located within [./examples](http://github.com/senchalabs/connect/tree/master/examples/). - -## Testing - -First update the git submodules, which includes -the [Expresso](http://github.com/visionmedia/expresso) TDD -framework: - - $ git submodule update --init - -Then run the test suites located in _./test_ with the following command: - - $ make test - -Run a single test, or use a custom glob pattern: - - $ make test TESTS=test/connect.test.js - -[creationix]: http://github.com/creationix -[visionmedia]: http://github.com/visionmedia -[Sencha]: http://www.sencha.com/ -[Rack]: http://rack.rubyforge.org/ -[Node.JS]: http://nodejs.org/ - -## License - -(The MIT License) - -Copyright (c) 2010 Sencha Inc. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/benchmarks/graph b/deps/.npm/connect/0.2.5/package/benchmarks/graph deleted file mode 100755 index b11e6d8f..00000000 --- a/deps/.npm/connect/0.2.5/package/benchmarks/graph +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env bash - -COL=${COL-9} -ABFLAGS=$(cat results/flags) - -# Log -# -# -# - -log(){ - echo "... $@" -} - -# -# Output gnuplot script for line graph. -# -# <node> <connect> -# - -function line() { - cat <<-EOF -set terminal png -set output "results/graphs/$1.png" -set title "$1 $ABFLAGS" -set size 1,0.7 -set grid y -set key left top -set xlabel "request" -set ylabel "response time (ms)" -plot "$2" using $COL smooth sbezier with lines title "node", \\ - "$3" using $COL smooth sbezier with lines title "connect", \\ - "$4" using $COL smooth sbezier with lines title "rack thin", \\ - "$5" using $COL smooth sbezier with lines title "sinatra thin" -EOF -} - -# -# Output gnuplot script for bar graph. -# -# <title> <node> <connect> -# - -function bar() { -cat <<-EOF -set terminal png -set output "results/graphs/$1.rps.png" -set title "$1 $ABFLAGS" -set size 0.7,0.5 -set grid y -set key left top -set ylabel "requests per second" -plot "$1.rps.dat" using 2: xtic(1) with histogram title "" -EOF -} - -# -# Graph the output of the given <dir>. -# -# <dir> -# - -function graph(){ - log graphing $1 - local dir=results/benchmarks/$1 - line $1 \ - $dir/node.js.dat \ - $dir/connect.js.dat \ - $dir/rack.thin.ru.dat \ - $dir/sinatra.thin.ru.dat \ - > results/$1.p - gnuplot results/$1.p -} - -# Make ./results/graphs -mkdir -p results/graphs - -graph hello-world -graph static \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/benchmarks/hello-world/connect.js b/deps/.npm/connect/0.2.5/package/benchmarks/hello-world/connect.js deleted file mode 100644 index 833201e9..00000000 --- a/deps/.npm/connect/0.2.5/package/benchmarks/hello-world/connect.js +++ /dev/null @@ -1,19 +0,0 @@ - -/** - * Module dependencies. - */ - -var connect = require('../../lib/connect'), - Buffer = require('buffer').Buffer, - body = new Buffer('Hello World', 'ascii'); - - -connect.createServer( - function(req, res, next){ - res.writeHead(200, { - 'Content-Type': 'text/plain', - 'Content-Length': body.length - }); - res.end(body); - } -).listen(3000); \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/benchmarks/hello-world/node.js b/deps/.npm/connect/0.2.5/package/benchmarks/hello-world/node.js deleted file mode 100644 index 8006ae31..00000000 --- a/deps/.npm/connect/0.2.5/package/benchmarks/hello-world/node.js +++ /dev/null @@ -1,16 +0,0 @@ - -/** - * Module dependencies. - */ - -var http = require('http'), - Buffer = require('buffer').Buffer, - body = new Buffer('Hello World', 'ascii'); - -http.createServer(function(req, res){ - res.writeHead(200, { - 'Content-Type': 'text/plain', - 'Content-Length': body.length - }); - res.end(body); -}).listen(3000); \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/benchmarks/hello-world/rack.thin.ru b/deps/.npm/connect/0.2.5/package/benchmarks/hello-world/rack.thin.ru deleted file mode 100644 index f06c6d30..00000000 --- a/deps/.npm/connect/0.2.5/package/benchmarks/hello-world/rack.thin.ru +++ /dev/null @@ -1,9 +0,0 @@ - -body = 'Hello World' - -run lambda { - [200, { - 'Content-Type' => 'text/plain', - 'Content-Length' => body.length.to_s - }, body] -} \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/benchmarks/hello-world/sinatra.thin.ru b/deps/.npm/connect/0.2.5/package/benchmarks/hello-world/sinatra.thin.ru deleted file mode 100644 index 39216bb1..00000000 --- a/deps/.npm/connect/0.2.5/package/benchmarks/hello-world/sinatra.thin.ru +++ /dev/null @@ -1,10 +0,0 @@ - -require 'rubygems' -require 'sinatra' - -get '/' do - 'Hello World' -end - -disable :logging -run Sinatra::Application diff --git a/deps/.npm/connect/0.2.5/package/benchmarks/public/jquery.js b/deps/.npm/connect/0.2.5/package/benchmarks/public/jquery.js deleted file mode 100644 index b1ae21d8..00000000 --- a/deps/.npm/connect/0.2.5/package/benchmarks/public/jquery.js +++ /dev/null @@ -1,19 +0,0 @@ -/* - * jQuery JavaScript Library v1.3.2 - * http://jquery.com/ - * - * Copyright (c) 2009 John Resig - * Dual licensed under the MIT and GPL licenses. - * http://docs.jquery.com/License - * - * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) - * Revision: 6246 - */ -(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); -/* - * Sizzle CSS Selector Engine - v0.9.3 - * Copyright 2009, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/benchmarks/run b/deps/.npm/connect/0.2.5/package/benchmarks/run deleted file mode 100755 index 47ba864d..00000000 --- a/deps/.npm/connect/0.2.5/package/benchmarks/run +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env bash - -ABFLAGS=${ABFLAGS-"-n 2000 -c 50 -k"} -ADDR=${ADDR-http://0.0.0.0:3000/} -AB=${AB-ab} - -# -# Log <msg ...> -# -# <msg ...> -# - -log(){ - echo "... $@" -} - -# -# Benchmark the given <dir> and [path]. -# -# <dir> [path] -# - -bm(){ - local dir=$1; - local path=${2-/}; - for file in benchmarks/$dir/*; do - log running $file - case $file in - *.js) - node $file & - sleep 2 - ;; - *.thin.ru) - thin -R $file -p 3000 start & - sleep 2 - ;; - *.mongrel.ru) - rackup $file -p 3000 -s mongrel & - sleep 2 - ;; - esac - local pid=$! - local dirname=results/$(dirname $file) - mkdir -p $dirname - $AB $ABFLAGS -g results/$file.dat $ADDR/$path > results/$file.out - log $(cat results/$file.out | grep Requests) - kill -9 $pid - done -} - -# Make ./results -mkdir -p results - -# Store flags -echo $ABFLAGS > results/flags - -# Run benchmarks -log $AB $ABFLAGS $ADDR -bm hello-world -bm static /jquery.js \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/benchmarks/static/connect.js b/deps/.npm/connect/0.2.5/package/benchmarks/static/connect.js deleted file mode 100644 index 5413ae69..00000000 --- a/deps/.npm/connect/0.2.5/package/benchmarks/static/connect.js +++ /dev/null @@ -1,10 +0,0 @@ - -/** - * Module dependencies. - */ - -var connect = require('../../lib/connect'); - -connect.createServer( - connect.staticProvider(__dirname + '/../public') -).listen(3000); \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/benchmarks/static/node.js b/deps/.npm/connect/0.2.5/package/benchmarks/static/node.js deleted file mode 100644 index 54e32fb5..00000000 --- a/deps/.npm/connect/0.2.5/package/benchmarks/static/node.js +++ /dev/null @@ -1,17 +0,0 @@ - -/** - * Module dependencies. - */ - -var http = require('http'), - fs = require('fs'), - body = fs.readFileSync(__dirname + '/../public/jquery.js'), - len = body.length; - -http.createServer(function(req, res){ - res.writeHead(200, { - 'Content-Type': 'application/javascript', - 'Content-Length': len - }); - res.end(body); -}).listen(3000); \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/benchmarks/static/sinatra.thin.ru b/deps/.npm/connect/0.2.5/package/benchmarks/static/sinatra.thin.ru deleted file mode 100644 index c3700715..00000000 --- a/deps/.npm/connect/0.2.5/package/benchmarks/static/sinatra.thin.ru +++ /dev/null @@ -1,10 +0,0 @@ - -require 'rubygems' -require 'sinatra' - -get '/jquery.js' do - send_file File.dirname(__FILE__) + '/../public/jquery.js' -end - -disable :logging -run Sinatra::Application diff --git a/deps/.npm/connect/0.2.5/package/docs/api.html b/deps/.npm/connect/0.2.5/package/docs/api.html deleted file mode 100644 index 53a3cb3a..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/api.html +++ /dev/null @@ -1,1911 +0,0 @@ -<html> - <head> - <title>Connect - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Connect

High performance middleware for node.

bodyDecoder

lib/connect/middleware/bodyDecoder.js
-

Module dependencies. -

-
-
var queryString = require('querystring');
-
-

Supported decoders.

- -
  • application/x-www-form-urlencoded
  • application/json
-
-
exports.decode = {
-    'application/x-www-form-urlencoded': queryString.parse,
-    'application/json': JSON.parse
-};
-
-

Decode request bodies.

- -

- -
  • return: Function

  • api: public

-
-
module.exports = function bodyDecoder(){
-    return function bodyDecoder(req, res, next) {
-        var decoder = exports.decode[mime(req)];
-        if (decoder) {
-            var data = '';
-            req.setEncoding('utf8');
-            req.addListener('data', function(chunk) { data += chunk; });
-            req.addListener('end', function() {
-                req.rawBody = data;
-                try {
-                    req.body = data
-                        ? decoder(data)
-                        : {};
-                } catch (err) {
-                    return next(err);
-                }
-                next();
-            });
-        } else {
-            next();
-        }
-    }
-};
-

cache

lib/connect/middleware/cache.js
-

Module dependencies. -

-
-
var Buffer = require('buffer').Buffer;
-
-

Cache in memory for the given cacheDuration.

- -

- -
  • param: Number cacheDuration

  • return: Function

  • api: public

-
-
module.exports = function cache(cacheDuration){
-    var cache = {},
-        queue = {};
-
-    return function cache(req, res, next) {
-
-        // Skip all requests that are not GET method
-        if (req.method !== &quot;GET&quot;) {
-            next();
-            return;
-        }
-
-        var key = req.headers[&quot;accept-encoding&quot;] + req.url,
-            writeHead = res.writeHead,
-            write = res.write,
-            end = res.end,
-            code,
-            headers,
-            chunks = [],
-            totalSize = 0;
-
-        function serve() {
-            var resp = cache[key];
-            var headers = resp.headers;
-            headers[&quot;Date&quot;] = (new Date).toUTCString();
-            headers[&quot;Content-Length&quot;] = resp.body.length;
-
-            if (localQueue) {
-                // Send everyone in the wait queue the response.
-                for (var i = 0, l = localQueue.length; i &lt; l; i++) {
-                    var localRes = localQueue[i];
-                    localRes.writeHead(resp.code, headers);
-                    localRes.end(resp.body);
-                }
-                // Kill the wait queue
-                delete queue[key];
-            } else {
-                res.writeHead(resp.code, headers);
-                res.end(resp.body);
-            }
-
-        }
-
-        // If there is a cache-hit, serve it right away!
-        if (cache[key]) {
-            serve();
-            return;
-        }
-
-        var localQueue = queue[key];
-        if (localQueue) {
-            localQueue[localQueue.length] = res;
-            return;
-        }
-        localQueue = queue[key] = [res];
-
-        // Defer the call to writeHead
-        res.writeHead = function (setCode, setHeaders) {
-            code = setCode;
-            headers = setHeaders;
-        };
-
-        // Buffer the response body as an array of Buffer objects
-        res.write = function (chunk, encoding) {
-            if (typeof chunk === 'string') {
-                var length;
-                if (!encoding || encoding === 'utf8') {
-                    length = Buffer.byteLength(chunk);
-                }
-                var buffer = new Buffer(length);
-                buffer.write(chunk, encoding);
-                chunks.push(buffer);
-            } else {
-                chunks.push(chunk);
-            }
-            totalSize += chunk.length;
-        };
-
-        res.end = function (chunk, encoding) {
-            if (chunk) {
-                res.write(chunk, encoding);
-            }
-
-            // Combine the buffer array into a single buffer
-            var body = new Buffer(totalSize);
-            var offset = 0;
-            chunks.forEach(function (chunk) {
-                chunk.copy(body, offset);
-                offset += chunk.length;
-            });
-
-            // Store the result in the cache
-            cache[key] = {
-                body: body,
-                code: code,
-                headers: headers
-            };
-
-            // Put the original methods back in place
-            res.writeHead = writeHead;
-            res.write = write;
-            res.end = end;
-
-            // Serve the response from the cache
-            serve();
-
-            if (cacheDuration) {
-                // Expire the ram cache after 100ms or the specified length
-                setTimeout(function(){
-                    delete cache[key];
-                }, cacheDuration);
-            } else {
-                // When the timeout is zero, just kill it right away
-                delete cache[key];
-            }
-
-        };
-
-        next();
-    };
-};
-

cacheManifest

lib/connect/middleware/cacheManifest.js
-

Module dependencies. -

-
-
var fs = require('fs'),
-    Utils = require('../utils'),
-    Url = require('url'),
-    Path = require('path');
-
-

Generate cache manifest for the given root, networks, -and fallbacks.

- -

- -
  • param: String root

  • param: Array networks

  • param: Array fallbacks

  • return: Function

  • api: public

-
-
module.exports = function cacheManifest(root, networks, fallbacks) {
-    root = root || process.cwd();
-    var suffix = &quot;&quot;;
-
-    // List of networks as an array of strings
-    if (networks) {
-        suffix += &quot;\n\nNETWORK:\n&quot; + networks.join(&quot;\n&quot;);
-    }
-
-    // List of fallbacks as key/value pairs
-    if (fallbacks) {
-        suffix += &quot;\n\nFALLBACK:\n&quot; +
-            fallbacks.map(function (second, first) {
-                return first + &quot; &quot; + second;
-            }).join(&quot;\n&quot;);
-    }
-
-    return function cacheManifest(req, res, next) {
-        if (Url.parse(req.url).pathname === &quot;/cache.manifest&quot;) {
-            Utils.find(root, (/./), function (err, files) {
-                var latestMtime = 0;
-                files = files.map(function (entry) {
-                    if (entry.mtime &gt; latestMtime) {
-                        latestMtime = entry.mtime;
-                    }
-                    return entry.path.substr(1);
-                });
-                var manifest = &quot;CACHE MANIFEST\n&quot;
-                    + &quot;# &quot; + latestMtime.toUTCString() + &quot;\n&quot;
-                    + files.join(&quot;\n&quot;)
-                    + suffix;
-
-                res.writeHead(200, {
-                    &quot;Content-Type&quot;: &quot;text/cache-manifest&quot;,
-                    &quot;Last-Modified&quot;: latestMtime.toUTCString(),
-                    &quot;Content-Length&quot;: manifest.length
-                });
-                res.end(manifest);
-            });
-            return;
-        }
-        next();
-    };
-};
-

compiler

lib/connect/middleware/compiler.js
-

Module dependencies. -

-
-
var fs = require('fs'),
-    path = require('path');
-
-

Bundled compilers:

- - -
-
var compilers = exports.compilers = {
-    sass: {
-        match: /\.css$/,
-        ext: '.sass',
-        compile: function(str, fn){
-            require.async('sass', function(err, sass){
-                if (err) {
-                    fn(err);
-                } else {
-                    try {
-                        fn(null, sass.render(str));
-                    } catch (err) {
-                        fn(err);
-                    }
-                }
-            });
-        }
-    },
-    less: {
-        match: /\.css$/,
-        ext: '.less',
-        compile: function(str, fn){
-            require.async('less', function(err, less){
-                if (err) {
-                    fn(err);
-                } else {
-                    try {
-                        less.render(str, fn);
-                    } catch (err) {
-                        fn(err);
-                    }
-                }
-            });
-        }
-    }
-};
-
-

Setup compiler.

- -

Options

- -
  • src Source directory, defaults to CWD.
  • dest Destination directory, defaults src.
  • enable Array of enabled compilers.
- -

Compilers

- -
  • sass Compiles cass to css
  • less Compiles less to css
- -

- -
  • param: Object options

  • api: public

-
-
module.exports = function compiler(options){
-    options = options || {};
-
-    var srcDir = process.connectEnv.compilerSrc || options.src || process.cwd(),
-        destDir = process.connectEnv.compilerDest || options.dest || srcDir,
-        enable = options.enable;
-
-    if (!enable || enable.length === 0) {
-        throw new Error(s &quot;enable&quot; option is not set, nothing will be compiled.');
-    }
-
-    return function compiler(req, res, next){
-        for (var i = 0, len = enable.length; i &lt; len; ++i) {
-            var name = enable[i],
-                compiler = compilers[name];
-            if (compiler.match.test(req.url)) {
-                var src = (srcDir + req.url).replace(compiler.match, compiler.ext),
-                    dest = destDir + req.url;
-
-                // Compare mtimes
-                fs.stat(src, function(err, srcStats){
-                    if (err) {
-                        if (err.errno === process.ENOENT) {
-                            res.writeHead(404, { 'Content-Type': 'text/plain' });
-                            res.end('Not Found');
-                        } else {
-                            next(err);
-                        }
-                    } else {
-                        fs.stat(dest, function(err, destStats){
-                            if (err) {
-                                // Oh snap! it does not exist, compile it
-                                if (err.errno === process.ENOENT) {
-                                    compile();
-                                } else {
-                                    next(err);
-                                }
-                            } else {
-                                // Source has changed, compile it
-                                if (srcStats.mtime &gt; destStats.mtime) {
-                                    compile();
-                                } else {
-                                    // Defer file serving
-                                    next();
-                                }
-                            }
-                        })
-                    }
-                });
-
-                // Compile to the destination
-                function compile() {
-                    fs.readFile(src, 'utf8', function(err, str){
-                        if (err) {
-                            next(err);
-                        } else {
-                            compiler.compile(str, function(err, str){
-                                if (err) {
-                                    next(err);
-                                } else {
-                                    fs.writeFile(dest, str, 'utf8', function(err){
-                                        next(err);
-                                    });
-                                }
-                            });
-                        }
-                    });
-                }
-                return;
-            }
-        }
-        next();
-    };
-};
-

conditionalGet

lib/connect/middleware/conditionalGet.js
-

Conditional GET request support.

- -

- -
  • return: Function

  • api: public

-
-
module.exports = function conditionalGet(){
-    return function conditionalGet(req, res, next) {
-        // Skip all requests that are not conditional gets.
-        if (!(req.method === &quot;GET&quot; &amp;&amp;
-             (req.headers[&quot;if-modified-since&quot;] || req.headers[&quot;if-none-match&quot;])
-           )) {
-            next();
-            return;
-        }
-
-        var since = req.headers[&quot;if-modified-since&quot;],
-            oldEtag = req.headers[&quot;if-none-match&quot;],
-            writeHead = res.writeHead,
-            write = res.write,
-            end = res.end;
-
-        since = since &amp;&amp; Date.parse(since).valueOf();
-
-        res.writeHead = function (code, headers) {
-            var lastModified = headers[&quot;Last-Modified&quot;],
-                etag = headers[&quot;Etag&quot;];
-            lastModified = lastModified &amp;&amp; Date.parse(lastModified).valueOf();
-
-            // If there is no match, then move on.
-            if (!(code === 200 &amp;&amp;
-                  (lastModified === since || oldEtag === etag)
-               )) {
-                res.writeHead = writeHead;
-                res.writeHead(code, headers);
-                return;
-            }
-
-            // Ignore writes
-            res.write = function () {};
-
-            res.end = function () {
-                // Put the original functions back on.
-                res.writeHead = writeHead;
-                res.write = write;
-                res.end = end;
-
-                // Filter out any Content based headers since there is no
-                // content.
-                var newHeaders = {};
-                headers.forEach(function (value, key) {
-                    if (key.indexOf(&quot;Content&quot;) &lt; 0) {
-                        newHeaders[key] = value;
-                    }
-                });
-                res.writeHead(304, newHeaders);
-                res.end();
-            };
-        };
-
-        next();
-    };
-};
-

cookieDecoder

lib/connect/middleware/cookieDecoder.js
-

Module dependencies. -

-
-
var utils = require('./../utils');
-
-

Parse Cookie header and populate req.cookies.

- -

- -
  • return: Function

  • api: public

-
-
module.exports = function cookieDecoder(){
-    return function cookieDecoder(req, res, next) {
-        var cookie = req.headers.cookie;
-        req.cookies = {};
-        if (cookie) {
-            try {
-                req.cookies = utils.parseCookie(cookie);
-                delete req.headers.cookie;
-            } catch (err) {
-                // Ignore
-            }
-            next();
-        } else {
-            next();
-        }
-    };
-};
-

errorHandler

lib/connect/middleware/errorHandler.js
-

Module dependencies. -

-
-
var utils = require('./../utils'),
-    sys = require('sys'),
-    fs = require('fs');
-
-

Setup error handler with the given options.

- -

Options

- -
  • showStack respond with both the error message and stack trace. Defaults to false
  • showMessage respond with the exception message only. Defaults to false
  • dumpExceptions dump exceptions to stderr (without terminating the process). Defaults to false
- -

- -
  • param: Object options

  • return: Function

  • api: public

-
-
module.exports = function errorHandler(options){
-    options = options || {};
-
-    // Defaults
-    var showStack = options.showStack,
-        showMessage = options.showMessage,
-        dumpExceptions = options.dumpExceptions;
-
-    // --showErrorStack
-    if (process.connectEnv.showErrorStack !== undefined) {
-        showStack = op = utils.toBoolean(process.connectEnv.showErrorStack);
-    }
-
-    // --showErrorMessage
-    if (process.connectEnv.showErrorMessage !== undefined) {
-        showMessage = utils.toBoolean(process.connectEnv.showErrorMessage);
-    }
-
-    // --dumpExceptions
-    if (process.connectEnv.dumpExceptions !== undefined) {
-        dumpExceptions = utils.toBoolean(process.connectEnv.dumpExceptions);
-    }
-
-    return function errorHandler(err, req, res, next){
-        if (dumpExceptions) {
-            sys.error(err.stack);
-        }
-        if (showStack) {
-            var accept = req.headers.accept || '';
-            if (accept.indexOf('html') !== -1) {
-                fs.readFile(__dirname + '/../public/style.css', function(e, style){
-                    style = style.toString('ascii');
-                    fs.readFile(__dirname + '/../public/error.html', function(e, html){
-                        var stack = err.stack
-                            .split('\n').slice(1)
-                            .map(function(v){ return '<li>' + v + '</li>'; }).join('');
-                        html = html
-                            .toString('utf8')
-                            .replace('{style}', style)
-                            .replace('{stack}', stack)
-                            .replace(/\{error\}/g, err.toString());
-                        res.writeHead(500, { 'Content-Type': 'text/html' });
-                        res.end(html);
-                    });
-                });
-            } else if (accept.indexOf('json') !== -1) {
-                var json = JSON.stringify({ error: err });
-                res.writeHead(500, { 'Content-Type': 'application/json' });
-                res.end(json);
-            } else {
-                res.writeHead(500, { 'Content-Type': 'application/json' });
-                res.end(err.stack);
-            }
-        } else {
-            var body = showMessage
-                ? err.toString()
-                : 'Internal Server Error';
-            res.writeHead(500, { 'Content-Type': 'text/plain' });
-            res.end(body);
-        }
-    };
-};
-
-

gzip-compress

lib/connect/middleware/gzip-compress.js
-

Module dependencies. -

-
-
var child_process = require('child_process'),
-    sys = require('sys'),
-    compress = require('compress');
-
-

Provides gzip compression via the node-compress library.

- -

- -
  • return: Function

  • api: public

-
-
module.exports = function gzip(){
-    return function gzip(req, res, next) {
-        var writeHead = res.writeHead,
-            write = res.write,
-            end = res.end;
-
-        res.writeHead = function (code, headers) {
-            var type = headers[&quot;Content-Type&quot;],
-                accept = req.headers[&quot;accept-encoding&quot;];
-
-            if (!(code === 200 &amp;&amp; accept &amp;&amp; accept.indexOf('gzip') &gt;= 0
-                  &amp;&amp; type &amp;&amp; (/(text|javascript|json)/).test(type)
-                  &amp;&amp; headers[&quot;Content-Encoding&quot;] === undefined)) {
-                res.writeHead = writeHead;
-                res.writeHead(code, headers);
-                return;
-            }
-
-            headers[&quot;Content-Encoding&quot;] = &quot;gzip&quot;;
-            delete headers[&quot;Content-Length&quot;];
-
-            var gzip = new compress.GzipStream();
-
-            res.write = function (chunk, encoding) {
-                gzip.setInputEncoding(encoding);
-                gzip.write(chunk);
-            };
-
-            res.end = function (chunk, encoding) {
-                if (chunk) {
-                    res.write(chunk, encoding);
-                }
-                gzip.close();
-            };
-
-            gzip.addListener('data', function (chunk) {
-                write.call(res, chunk);
-            });
-            gzip.addListener('error', function(err) {
-                res.write = write;
-                res.end = end;
-                next(err);
-            });
-            gzip.addListener('end', function (code) {
-                res.write = write;
-                res.end = end;
-                res.end();
-            });
-
-            res.writeHead = writeHead;
-            res.writeHead(code, headers);
-
-        };
-
-        next();
-    };
-};
-

gzip-proc

lib/connect/middleware/gzip-proc.js
-

Module dependencies. -

-
-
var child_process = require('child_process'),
-    sys = require('sys');
-
-

Provides gzip compression via the gzip executable.

- -

- -
  • return: Function

  • api: public

-
-
module.exports = function gzip(){
-    return function gzip(req, res, next) {
-        var writeHead = res.writeHead,
-            write = res.write,
-            end = res.end;
-
-        res.writeHead = function (code, headers) {
-            var type = headers[&quot;Content-Type&quot;],
-                accept = req.headers[&quot;accept-encoding&quot;];
-
-            if (!(code === 200 &amp;&amp; accept &amp;&amp; accept.indexOf('gzip') &gt;= 0
-                  &amp;&amp; type &amp;&amp; (/(text|javascript|json)/).test(type)
-                  &amp;&amp; headers[&quot;Content-Encoding&quot;] === undefined)) {
-                res.writeHead = writeHead;
-                res.writeHead(code, headers);
-                return;
-            }
-
-            headers[&quot;Content-Encoding&quot;] = &quot;gzip&quot;;
-            delete headers[&quot;Content-Length&quot;];
-
-            var gzip = child_process.spawn(&quot;gzip&quot;, [&quot;-9&quot;]);
-
-            res.write = function (chunk, encoding) {
-                gzip.stdin.write(chunk, encoding);
-            };
-
-            res.end = function (chunk, encoding) {
-                if (chunk) {
-                    res.write(chunk, encoding);
-                }
-                gzip.stdin.end();
-            };
-
-            gzip.stdout.addListener('data', function (chunk) {
-                write.call(res, chunk);
-            });
-
-            gzip.addListener(&quot;exit&quot;, function (code) {
-                res.write = write;
-                res.end = end;
-                res.end();
-            });
-
-            res.writeHead = writeHead;
-            res.writeHead(code, headers);
-
-        };
-
-        next();
-    };
-};
-
-

gzip

lib/connect/middleware/gzip.js
-

try { - module.exports = require('./gzip-compress'); -} catch (e) { - if (/^Cannot find module /.test(e.message)) - module.exports = require('./gzip-proc'); - else - throw e; -}

-
- -

jsonrpc

lib/connect/middleware/jsonrpc.js
-

Module dependencies. -

-
-
var sys = require('sys'),
-    parse = require('url').parse,
-    Buffer = require('buffer').Buffer,
-    http = require('http');
-
-

Export the setup() function. -

-
-
exports = module.exports = jsonrpc;
-
-

JSON-RPC version. -

-
-
var VERSION = exports.VERSION = '2.0';
-
-

JSON parse error. -

-
-
var PARSE_ERROR = exports.PARSE_ERROR = -32700;
-
-

Invalid request due to invalid or missing properties. -

-
-
var INVALID_REQUEST = exports.INVALID_REQUEST = -32600;
-
-

Service method does not exist. -

-
-
var METHOD_NOT_FOUND = exports.METHOD_NOT_FOUND = -32601;
-
-

Invalid parameters. -

-
-
var INVALID_PARAMS = exports.INVALID_PARAMS = -32602;
-
-

Internal JSON-RPC error. -

-
-
var INTERNAL_ERROR = exports.INTERNAL_ERROR = -32603;
-
-

Default error messages. -

-
-
var errorMessages = exports.errorMessages = {};
-errorMessages[PARSE_ERROR] = 'Parse Error.';
-errorMessages[INVALID_REQUEST] = 'Invalid Request.';
-errorMessages[METHOD_NOT_FOUND] = 'Method Not Found.';
-errorMessages[INVALID_PARAMS] = 'Invalid Params.';
-errorMessages[INTERNAL_ERROR] = 'Internal Error.';
-
-

Accepts any number of objects, exposing their methods.

- -

- -
  • param: Object ...

  • return: Function

  • api: public

-
-
function jsonrpc(services) {
-    services = services || {};
-
-    // Merge methods
-    for (var i = 0, len = arguments.length; i &lt; len; ++i) {
-        arguments[i].forEach(function(val, key){
-            services[key] = val;
-        });
-    }
-
-

Handle JSON-RPC request.

- -

- -
  • param: Object rpc

  • param: Function respond

-
-
function handleRequest(rpc, respond){
-        if (validRequest(rpc)) {
-            var method = services[rpc.method];
-            if (typeof method === 'function') {
-                var params = [];
-                if (rpc.params instanceof Array) {
-                    params = rpc.params;
-                } else if (typeof rpc.params === 'object') {
-                    var names = method.toString().match(/\((.*?)\)/)[1].match(/[\w]+/g);
-                    if (names) {
-                        for (var i = 0, len = names.length; i &lt; len; ++i) {
-                            params.push(rpc.params[names[i]]);
-                        }
-                    } else {
-                        // Function does not have named parameters
-                        return respond({ error: { code: INVALID_PARAMS, message: 'This service does not support named parameters.' }});
-                    }
-                }
-                function reply(err, result){
-                    if (err) {
-                        if (typeof err === 'number') {
-                            respond({
-                                error: {
-                                    code: err
-                                }
-                            });
-                        } else {
-                            respond({
-                                error: {
-                                    code: err.code || INTERNAL_ERROR,
-                                    message: err.message
-                                }
-                            });
-                        }
-                    } else {
-                        respond({
-                            result: result
-                        });
-                    }
-                }
-                method.apply(reply, params);
-            } else {
-                respond({ error: { code: METHOD_NOT_FOUND }});
-            }
-        } else {
-            respond({ error: { code: INVALID_REQUEST }});
-        }
-    }
-
-    return function jsonrpc(req, res, next) {
-        var me = this,
-            contentType = req.headers['content-type'] || '';
-        if (req.method === 'POST' &amp;&amp; contentType.indexOf('application/json') &gt;= 0) {
-            var data = '';
-            req.setEncoding('utf8');
-            req.addListener('data', function(chunk) { data += chunk; });
-            req.addListener('end', function() {
-
-                // Attempt to parse incoming JSON string
-
-                try {
-                    var rpc = JSON.parse(data),
-                        batch = rpc instanceof Array;
-                } catch (err) {
-                    return respond(normalize(rpc, { error: { code: PARSE_ERROR }}));
-                }
-
-

Normalize response object. -

-
-
function normalize(rpc, obj) {
-                    obj.id = rpc &amp;&amp; typeof rpc.id === 'number'
-                        ? rpc.id
-                        : null;
-                    obj.jsonrpc = VERSION;
-                    if (obj.error &amp;&amp; !obj.error.message) {
-                        obj.error.message = errorMessages[obj.error.code];
-                    }
-                    return obj;
-                }
-
-

Respond with the given response object. -

-
-
function respond(obj) {
-                    var body = JSON.stringify(obj);
-                    res.writeHead(200, {
-                        'Content-Type': 'application/json',
-                        'Content-Length': Buffer.byteLength(body)
-                    });
-                    res.end(body);
-                }
-
-                // Handle requests
-
-                if (batch) {
-                    var responses = [],
-                        len = rpc.length,
-                        pending = len;
-                    for (var i = 0; i &lt; len; ++i) {
-                        (function(rpc){
-                            handleRequest.call(me, rpc, function(obj){
-                                responses.push(normalize(rpc, obj));
-                                if (!--pending) {
-                                    respond(responses);
-                                }
-                            });
-                        })(rpc[i]);
-                    }
-                } else {
-                    handleRequest.call(me, rpc, function(obj){
-                        respond(normalize(rpc, obj));
-                    });
-                }
-            });
-        } else {
-            next();
-        }
-    };
-};
-

lint

lib/connect/middleware/lint.js
-

Module dependencies. -

-
-
var connect = require('./../index'),
-    sys = require('sys');
-
-

Setup lint for the given server.

- -

- -
  • return: Function

  • api: public

-
-
module.exports = function lint(server){
-
-    // Ensure a server is passed
-    if (!server) {
-        throw new Error('lint "server" must be passed.');
-    }
-
-    // Warn unless in development mode
-    if (process.connectEnv.name !== 'development') {
-        warn('"lint" middleware should never be enabled outside of the development environment');
-    }
-
-    // Check the stack
-    checkStack(server.stack);
-
-    // Do nothing
-    return function(req, res, next){
-        next();
-    }
-};
-

logger

lib/connect/middleware/logger.js
-

Log requests with the given options.

- -

Options

- -
  • format Format string, see below for tokens
  • stream Output stream, defaults to stdout
- -

Tokens

- -
  • :req[header] ex: :req[Accept]
  • :res[header] ex: :res[Content-Length]
  • :http-version
  • :response-time
  • :remote-addr
  • :date
  • :method
  • :url
  • :referrer
  • :user-agent
  • :status
- -

- -
  • return: Function

  • api: public

-
-
module.exports = function logger(options) {
-    options = options || {};
-
-    var fmt = process.connectEnv.logFormat || options.format,
-        stream = options.stream || process.stdout;
-
-    return function logger(req, res, next) {
-        var start = +new Date,
-            statusCode,
-            resHeaders,
-            writeHead = res.writeHead,
-            end = res.end,
-            url = req.url;
-
-        // Proxy for statusCode.
-        res.writeHead = function(code, headers){
-            res.writeHead = writeHead;
-            res.writeHead(code, headers);
-            res.statusCode = statusCode = code;
-            res.headers = resHeaders = headers;
-        };
-
-        // Proxy end to output a line to the provided logger.
-        if (fmt) {
-            res.end = function(chunk, encoding) {
-                res.end = end;
-                res.end(chunk, encoding);
-                res.responseTime = +new Date - start;
-                stream.write(format(fmt, req, res) + '\n', 'ascii');
-            };
-        } else {
-            res.end = function(chunk, encoding) {
-                res.end = end;
-                res.end(chunk, encoding);
-
-                stream.write((req.socket &amp;&amp; req.socket.remoteAddress)
-                 + ' - - [' + (new Date).toUTCString() + ']'
-                 + ' "' + req.method + ' ' + url
-                 + ' HTTP/' + req.httpVersionMajor + '.' + req.httpVersionMinor + '" '
-                 + statusCode + ' ' + (resHeaders['Content-Length'] || '-')
-                 + ' "' + (req.headers['referer'] || req.headers['referrer'] || '')
-                 + '" "' + (req.headers['user-agent'] || '') + '"\n', 'ascii');
-            };
-        }
-
-        // Fall through to the next layer.
-        next();
-    };
-
-};
-

methodOverride

lib/connect/middleware/methodOverride.js
-

Module dependencies. -

-
-
var queryString = require('querystring');
-
-

Valid http methods.

- -
  • type: Array

-
-
var methods = ['GET', 'POST', 'PUT', 'HEAD', 'DELETE', 'OPTIONS'];
-
-

Pass an optional key to use when checking for -a method override, othewise defaults to __method_.

- -

- -
  • param: String key

  • return: Function

  • api: public

-
-
module.exports = function methodOverride(key){
-    key = key || &quot;_method&quot;;
-    return function methodOverride(req, res, next) {
-        var method = req.method;
-
-        // Check req.body (bodyDecoder)
-        if (typeof req.body === 'object' &amp;&amp; key in req.body) {
-            method = req.body[key];
-            delete req.body[key];
-        // Check X-HTTP-Method-Override
-        } else if (req.headers['x-http-method-override']) {
-            method = req.headers['x-http-method-override'];
-        }
-
-        // Ensure method is valid, and normalize
-        method = method.toUpperCase();
-        if (methods.indexOf(method) &gt;= 0) {
-            req.method = method;
-        }
-        
-        next();
-    };
-};
-
-
-

repl

lib/connect/middleware/repl.js
-

Module dependencies. -

-
-
var net = require('net'),
-    repl = require('repl');
-
-

Start a REPL on the given unix domain socket path.

- -

Options

- -
  • sockect Unix domain socket path. Defaults to "/tmp/connect.sock"
  • prompt REPL prompt string. Defaults to "node> "
- -

Example

- -
$ rlwrap telnet /tmp/connect.sock
- -

- -
  • param: String prompt

  • param: String socket path

  • return: Function

  • api: public

-
-
module.exports = function repl(prompt, socket){
-    prompt = process.connectEnv.replPrompt || prompt || 'node> ';
-    socket = process.connectEnv.replSocket || socket || '/tmp/connect.sock';
-    net.createServer(function (stream) {
-        repl.start(prompt, stream);
-    }).listen(socket);
-    return function repl(req, res, next){
-        // Pass through for now
-        next();
-    }
-};
-
-

responseTime

lib/connect/middleware/responseTime.js
-

Responds with the X-Response-Time header in milliseconds.

- -

- -
  • return: Function

  • api: public

-
-
module.exports = function responseTime(){
-    return function responseTime(req, res, next){
-        var start = new Date,
-            writeHead = res.writeHead;
-
-        res.writeHead = function(code, headers){
-            res.writeHead = writeHead;
-            headers['X-Response-Time'] = (new Date - start) + &quot;ms&quot;;
-            res.writeHead(code, headers);
-        };
-
-        next();
-    };
-};
-

router

lib/connect/middleware/router.js
-

Module dependencies. -

-
-
var parse = require('url').parse;
-
-

Provides Sinatra and Express like routing capabilities.

- -

Examples

- -
connect.router(function(app){
-    app.get('/user/:id', function(req, res, params){
-        // populates params.id
-    });
-})
- -

- -
  • param: Function fn

  • return: Function

  • api: public

-
-
module.exports = function router(fn){
-    var routes;
-
-    if (fn) {
-        routes = {};
-        fn.call(this, {
-            post: method.call(this, 'post'),
-            get: method.call(this, 'get'),
-            put: method.call(this, 'put'),
-            del: method.call(this, 'del')
-        });
-    } else {
-        throw new Error('router provider requires a callback function');
-    }
-
-    function method(name) {
-        var self = this,
-            localRoutes = routes[name] = routes[name] || [];
-        return function(path, fn){
-            var keys = [];
-            path = path instanceof RegExp
-                ? path
-                : normalizePath(path, keys);
-            localRoutes.push(fn, path, keys);
-            return self;
-        };
-    }
-
-    return function router(req, res, next){
-        var route,
-            self = this;
-        (function pass(i){
-            if (route = match(req, routes, i)) {
-                req.params = req.params || {};
-                req.params.path = route._params;
-                try { 
-                    route.call(self, req, res, route._params, function(err){
-                        if (err) {
-                            next(err);
-                        } else {
-                            pass(++route._index);
-                        }
-                    });
-                } catch (err) {
-                    next(err);
-                }
-            } else {
-                next();
-            }
-        })();
-    };
-}
-

memory

lib/connect/middleware/session/memory.js
-

Module dependencies. -

-
-
var sys = require('sys'),
-    Store = require('./store'),
-    utils = require('./../../utils'),
-    Session = require('./session');
-
-

Initialize MemoryStore with the given options.

- -

- -
  • param: Object options

  • api: public

-
-
var MemoryStore = module.exports = function MemoryStore(options) {
-    options = options || {};
-    Store.call(this, options);
-    this.sessions = {};
-
-    // Default reapInterval to 10 minutes
-    this.reapInterval = options.reapInterval || 600000;
-
-    // Reap stale sessions
-    if (this.reapInterval !== -1) {
-        setInterval(function(self){
-            self.reap(self.maxAge);
-        }, this.reapInterval, this);
-    }
-};
-
-sys.inherits(MemoryStore, Store);
-
-

Attempt to fetch session by the given hash.

- -

- -
  • param: String hash

  • param: Function fn

  • api: public

-
-
MemoryStore.prototype.get = function(hash, fn){
-    if (hash in this.sessions) {
-        fn(null, this.sessions[hash]);
-    } else {
-        fn();
-    }
-};
-
-

Commit the given sess object associated with the given hash.

- -

- -
  • param: String hash

  • param: Session sess

  • param: Function fn

  • api: public

-
-
MemoryStore.prototype.set = function(hash, sess, fn){
-    this.sessions[hash] = sess;
-    fn &amp;&amp; fn();
-};
-
-

Destroy the session associated with the given hash.

- -

- -
  • param: String hash

  • api: public

-
-
MemoryStore.prototype.destroy = function(hash, fn){
-    delete this.sessions[hash];
-    fn &amp;&amp; fn();
-};
-
-

Invoke the given callback fn with all active sessions.

- -

- -
  • param: Function fn

  • api: public

-
-
MemoryStore.prototype.all = function(fn){
-    var arr = [],
-        keys = Object.keys(this.sessions);
-    for (var i = 0, len = keys.length; i &lt; len; ++i) {
-        arr.push(this.sessions[keys[i]]);
-    }
-    fn(null, arr);
-};
-
-

Clear all sessions.

- -

- -
  • param: Function fn

  • api: public

-
-
MemoryStore.prototype.clear = function(fn){
-    this.sessions = {};
-    fn &amp;&amp; fn();
-};
-
-

Fetch number of sessions.

- -

- -
  • param: Function fn

  • api: public

-
-
MemoryStore.prototype.length = function(fn){
-    fn(null, Object.keys(this.sessions).length);
-};
-
-

session

lib/connect/middleware/session/session.js
-

Module dependencies. -

-
-
var utils = require('./../../utils');
-
-

Update lastAccess timestamp.

- -
  • api: public

-
-
Session.prototype.touch = function(){
-    this.lastAccess = +new Date;
-};
-
-

Destroy this session.

- -

- -
  • param: Function fn

  • api: public

-
-
Session.prototype.destroy = function(fn){
-    delete this.req.session;
-    this.req.sessionStore.destroy(this.req.sessionHash, fn);
-};
-
-

Regenerate this request's session.

- -

- -
  • param: Function fn

  • api: public

-
-
Session.prototype.regenerate = function(fn){
-    this.req.sessionStore.regenerate(this.req, fn);
-};
-
-
-

store

lib/connect/middleware/session/store.js
-

Module dependencies. -

-
-
var Session = require('./session'),
-    utils = require('./../../utils');
-
-

Destroy session associated with the given hash -by passing null to Store#get().

- -

- -
  • param: String hash

  • param: Function fn

  • api: public

-
-
Store.prototype.destroy = function(hash, fn){
-    this.set(hash, null, fn);
-};
-
-

Re-generate the given requests's session.

- -

- -
  • param: IncomingRequest req

  • return: Function fn

  • api: public

-
-
Store.prototype.regenerate = function(req, fn){
-    var self = this;
-    this.destroy(req.sessionHash, function(err, destroyed){
-        req.session = new Session(req, utils.uid());
-        req.sessionHash = self.hash(req);
-        fn(err, destroyed);
-    });
-};
-

session

lib/connect/middleware/session.js
-

Module dependencies. -

-
-
var MemoryStore = require('./session/memory'),
-    Session = require('./session/session'),
-    utils = require('./../utils');
-
-

Setup session store with the given options.

- -

Options

- -
  • store Session store instance
  • fingerprint Custom fingerprint hashing function
- -

- -
  • param: Object options

  • return: Function

  • api: public

-
-
module.exports = function session(options){
-    options = options || {};
-    var key = 'connect.sid';
-
-    // Default memory store
-    store = options.store || new MemoryStore;
-
-    // Default fingerprint hashing function
-    var hash = store.hash = options.fingerprint || function(req){
-        return utils.md5(req.session.id
-            + req.socket.remoteAddress
-            + (req.headers['user-agent'] || ''));
-    };
-
-    return function session(req, res, next){
-        // Expose store
-        req.sessionStore = store;
-
-        if (req.cookies) {
-            // Commit session
-            var writeHead = res.writeHead;
-            res.writeHead = function(status, headers){
-                headers = headers || {};
-                res.writeHead = writeHead;
-                store.set(req.sessionHash, req.session);
-                store.cookie.expires = new Date(+new Date() + store.maxAge);
-                headers['Set-Cookie'] = utils.serializeCookie(key, req.session.id, store.cookie);
-                return res.writeHead(status, headers);
-            };
-
-            // Generates the new session
-            function generate() {
-                req.session = new Session(req, utils.uid());
-                req.sessionHash = hash(req);
-                next();
-            }
-            
-            // We have an sid
-            if (req.cookies[key]) {
-                req.session = new Session(req, req.cookies[key]);
-                req.sessionHash = hash(req);
-                // See if the hash is valid
-                store.get(req.sessionHash, function(err, sess){
-                    if (err) {
-                        next(err);
-                    } else if (sess) {
-                        // Valid; apply session data and update lastAccess
-                        req.session = new Session(req, sess);
-                        req.session.touch();
-                        next();
-                    } else {
-                        // Invalid; generate
-                        generate();
-                    }
-                });
-            } else {
-                // No sid; generate
-                generate();
-            }
-        } else {
-            next();
-        }
-    }
-};
-

staticProvider

lib/connect/middleware/staticProvider.js
-

Module dependencies. -

-
-
var fs = require('fs'),
-    Url = require('url'),
-    Buffer = require('buffer').Buffer,
-    Path = require('path'),
-    queryString = require('querystring'),
-    utils = require('./../utils');
-
-

Browser cache maxAge of one hour.

- -
  • type: Number

-
-
var maxAge = 1000 * 60 * 60;
-
-

Static file server.

- -

Options

- -
  • root Root path from which to serve static files.
- -

- -
  • param: String root

  • return: Function

  • api: public

-
-
module.exports = function staticProvider(root){
-    root = process.connectEnv.staticRoot || root || process.cwd();
-    return function staticProvider(req, res, next) {
-        if (req.method !== &quot;GET&quot;) {
-            next();
-            return;
-        }
-        var url = Url.parse(req.url);
-
-        var pathname = url.pathname.replace(/\.\.+/g, '.'),
-            filename = Path.join(root, queryString.unescape(pathname));
-
-        if (filename[filename.length - 1] === &quot;/&quot;) {
-            filename += &quot;index.html&quot;;
-        }
-
-        // Buffer any events that fire while waiting on the stat.
-        var events = [];
-        function onData() {
-            events.push([&quot;data&quot;].concat(toArray(arguments)));
-        }
-        function onEnd() {
-            events.push([&quot;end&quot;].concat(toArray(arguments)));
-        }
-        req.addListener(&quot;data&quot;, onData);
-        req.addListener(&quot;end&quot;, onEnd);
-
-        fs.stat(filename, function (err, stat) {
-
-            // Stop buffering events
-            req.removeListener(&quot;data&quot;, onData);
-            req.removeListener(&quot;end&quot;, onEnd);
-
-            // Fall through for missing files, thow error for other problems
-            if (err) {
-                if (err.errno === process.ENOENT) {
-                    next();
-                    // Refire the buffered events
-                    for (var i = 0, len = events.length; i &lt; len; ++i) {
-                        req.emit.apply(req, events[i]);
-                    }
-                    return;
-                }
-                next(err);
-                return;
-            }
-
-            // Serve the file directly using buffers
-            function onRead(err, data) {
-                if (err) {
-                    next(err);
-                    return;
-                }
-
-                // For older versions of node convert the string to a buffer.
-                if (typeof data === 'string') {
-                    var b = new Buffer(data.length);
-                    b.write(data, &quot;binary&quot;);
-                    data = b;
-                }
-
-                // Zero length buffers act funny, use a string
-                if (data.length === 0) {
-                  data = &quot;&quot;;
-                }
-
-                res.writeHead(200, {
-                    &quot;Content-Type&quot;: utils.mime.type(filename),
-                    &quot;Content-Length&quot;: data.length,
-                    &quot;Last-Modified&quot;: stat.mtime.toUTCString(),
-                    // Cache in browser for 1 year
-                    &quot;Cache-Control&quot;: &quot;public max-age=&quot; + 31536000
-                });
-                res.end(data);
-            }
-
-            // Node before 0.1.95 doesn't do buffers for fs.readFile
-            if (process.version &lt; &quot;0.1.95&quot; &amp;&amp; process.version &gt; &quot;0.1.100&quot;) {
-                // sys.debug("Warning: Old node version has slower static file loading");
-                fs.readFile(filename, &quot;binary&quot;, onRead);
-            } else {
-                fs.readFile(filename, onRead);
-            }
-        });
-    };
-
-};
-

vhost

lib/connect/middleware/vhost.js
-

Setup vhost for the given hostname and server.

- -

Examples

- -
connect.createServer(
-  connect.vhost('foo.com',
-     connect.createServer(...middleware...)
- ),
-  connect.vhost('bar.com',
-      connect.createServer(...middleware...)
-  )
-);
- -

- -
  • param: String hostname

  • param: Server server

  • return: Function

  • api: public

-
-
module.exports = function vhost(hostname, server){
-    if (!hostname) {
-        throw new Error('vhost hostname required');
-    }
-    if (!server) {
-        throw new Error('vhost server required');
-    }
-    return function vhost(req, res, next){
-        var host = req.headers.host.split(':')[0];
-        if (host === hostname) {
-            server.handle(req, res);
-        } else {
-            next();
-        }
-    };
-};
-
\ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/docs/bodyDecoder.1 b/deps/.npm/connect/0.2.5/package/docs/bodyDecoder.1 deleted file mode 100644 index 41578fcf..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/bodyDecoder.1 +++ /dev/null @@ -1,27 +0,0 @@ -.\" generated with Ronn/v0.6.6 -.\" http://github.com/rtomayko/ronn/ -. -.TH "BODYDECODER" "" "June 2010" "" "" -. -.SH "Body Decoder" -The \fIbodyDecoder\fR middleware sniffs the \fIContent\-Type\fR header, and decodes the request body appropriately\. Supported by default are the \fIapplication/x\-www\-form\-urlencoded\fR, and \fIapplication/json\fR content types\. To extend simply: -. -.IP "" 4 -. -.nf - -require(\'connect/filters/body\-decoder\')\.decode[\'some\-mime/type\'] = function(str){ - return \'whatever\'; -}; -. -.fi -. -.IP "" 0 -. -.SS "See Also" -. -.IP "\(bu" 4 -methodOverride -. -.IP "" 0 - diff --git a/deps/.npm/connect/0.2.5/package/docs/bodyDecoder.html b/deps/.npm/connect/0.2.5/package/docs/bodyDecoder.html deleted file mode 100644 index ea379a48..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/bodyDecoder.html +++ /dev/null @@ -1,163 +0,0 @@ - - - - Connect - - - - -
-
-

Body Decoder

- -

The bodyDecoder middleware sniffs the Content-Type header, and decodes the request body appropriately. Supported by default are the application/x-www-form-urlencoded, and application/json content types. To extend simply:

- -
require('connect/filters/body-decoder').decode['some-mime/type'] = function(str){
-    return 'whatever';
-};
-
- -

See Also

- -
    -
  • methodOverride
  • -
- - -
-
- - diff --git a/deps/.npm/connect/0.2.5/package/docs/bodyDecoder.md b/deps/.npm/connect/0.2.5/package/docs/bodyDecoder.md deleted file mode 100644 index f524000d..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/bodyDecoder.md +++ /dev/null @@ -1,11 +0,0 @@ -## Body Decoder - -The _bodyDecoder_ middleware sniffs the _Content-Type_ header, and decodes the request body appropriately. Supported by default are the _application/x-www-form-urlencoded_, and _application/json_ content types. To extend simply: - - connect.bodyDecoder.decode['some-mime/type'] = function(str){ - return 'whatever'; - }; - -### See Also - - * methodOverride \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/docs/compiler.1 b/deps/.npm/connect/0.2.5/package/docs/compiler.1 deleted file mode 100644 index 094a7add..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/compiler.1 +++ /dev/null @@ -1,66 +0,0 @@ -.\" generated with Ronn/v0.6.6 -.\" http://github.com/rtomayko/ronn/ -. -.TH "COMPILER" "" "June 2010" "" "" -. -.SH "Compiler" -The \fIcompiler\fR middleware compiles files that have not yet been compiled, or have been modified\. Good examples of this are \fIsass\fR and \fIless\fR, both of which compile to css\. The compiled data is written to disk, and serving is delegated to the \fIstatic\fR middleware, therefore the \fIdest\fR should be accessible (or the same) as \fIstatic\fR\'s \fIroot\fR option\. -. -.IP "" 4 -. -.nf - -connect\.createServer( - connect\.compiler({ src: __dirname + \'/public\', enable: [\'sass\'] }) -); -. -.fi -. -.IP "" 0 -. -.SS "Options" -. -.nf - -src Root directory from which to compile files\. Defaults to CWD\. -dest Destination directory of compiled files, defaults to src or CWD\. -enable Enabled compilers, currently supported are \"sass\", and \"less\"\. -. -.fi -. -.SS "Supported Compilers" -. -.IP "\(bu" 4 -sass -. -.IP "\(bu" 4 -less -. -.IP "" 0 -. -.SS "Environment Variables" -. -.nf - -\-\-compilerSrc -\-\-compilerDest -. -.fi -. -.SS "Links" -. -.IP "\(bu" 4 -Sass\.js \fIhttp://github\.com/visionmedia/sass\.js\fR -. -.IP "\(bu" 4 -Less\.js \fIhttp://github\.com/cloudhead/less\.js\fR -. -.IP "" 0 -. -.SS "See Also" -. -.IP "\(bu" 4 -staticProvider -. -.IP "" 0 - diff --git a/deps/.npm/connect/0.2.5/package/docs/compiler.html b/deps/.npm/connect/0.2.5/package/docs/compiler.html deleted file mode 100644 index 7ac09d2f..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/compiler.html +++ /dev/null @@ -1,192 +0,0 @@ - - - - Connect - - - - -
-
-

Compiler

- -

The compiler middleware compiles files that have not yet been compiled, or have been modified. Good examples of this are sass and less, both of which compile to css. The compiled data is written to disk, and serving is delegated to the static middleware, therefore the dest should be accessible (or the same) as static's root option.

- -
connect.createServer(
-    connect.compiler({ src: __dirname + '/public', enable: ['sass'] })
-);
-
- -

Options

- -
src      Root directory from which to compile files. Defaults to CWD.
-dest     Destination directory of compiled files, defaults to src or CWD.
-enable   Enabled compilers, currently supported are "sass", and "less".
-
- -

Supported Compilers

- -
    -
  • sass
  • -
  • less
  • -
- - -

Environment Variables

- -
--compilerSrc
---compilerDest
-
- - - - - - -

See Also

- -
    -
  • staticProvider
  • -
- - -
-
- - diff --git a/deps/.npm/connect/0.2.5/package/docs/compiler.md b/deps/.npm/connect/0.2.5/package/docs/compiler.md deleted file mode 100644 index 046b2fe5..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/compiler.md +++ /dev/null @@ -1,32 +0,0 @@ -## Compiler - -The _compiler_ middleware compiles files that have not yet been compiled, or have been modified. Good examples of this are _sass_ and _less_, both of which compile to css. The compiled data is written to disk, and serving is delegated to the _static_ middleware, therefore the _dest_ should be accessible (or the same) as _static_'s _root_ option. - - connect.createServer( - connect.compiler({ src: __dirname + '/public', enable: ['sass'] }) - ); - -### Options - - src Root directory from which to compile files. Defaults to CWD. - dest Destination directory of compiled files, defaults to src or CWD. - enable Enabled compilers, currently supported are "sass", and "less". - -### Supported Compilers - - * sass - * less - -### Environment Variables - - --compilerSrc - --compilerDest - -### Links - - * [Sass.js](http://github.com/visionmedia/sass.js) - * [Less.js](http://github.com/cloudhead/less.js) - -### See Also - - * staticProvider \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/docs/conditionalGet.1 b/deps/.npm/connect/0.2.5/package/docs/conditionalGet.1 deleted file mode 100644 index 0473498a..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/conditionalGet.1 +++ /dev/null @@ -1,16 +0,0 @@ -.\" generated with Ronn/v0.6.6 -.\" http://github.com/rtomayko/ronn/ -. -.TH "CONDITIONALGET" "" "June 2010" "" "" -. -.SH "Conditional GET" -The \fIconditionalGet\fR middleware supports conditional GET requests, which validates the \"freshness\" of a response body\. Currently supports: -. -.IP "\(bu" 4 -\fIIf\-Modified\-Since\fR\. When a response status is \fI200\fR, and \fILast\-Modified\fR less than or equal to this time, the response body and \fIContent\-*\fR headers will be stripped, responding with 304 \"Not Modified\"\. -. -.IP "\(bu" 4 -\fIIf\-None_Match\fR\. Performs a similar validation, however compares the \fIETag\fR for equality\. -. -.IP "" 0 - diff --git a/deps/.npm/connect/0.2.5/package/docs/conditionalGet.html b/deps/.npm/connect/0.2.5/package/docs/conditionalGet.html deleted file mode 100644 index 62f5d633..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/conditionalGet.html +++ /dev/null @@ -1,157 +0,0 @@ - - - - Connect - - - - -
-
-

Conditional GET

- -

The conditionalGet middleware supports conditional GET requests, which validates the "freshness" of a response body. Currently supports:

- -
    -
  • If-Modified-Since. When a response status is 200, and Last-Modified less than or equal to this time, the response body and Content-* headers will be stripped, responding with 304 "Not Modified".

  • -
  • If-None_Match. Performs a similar validation, however compares the ETag for equality.

  • -
- - -
-
- - diff --git a/deps/.npm/connect/0.2.5/package/docs/conditionalGet.md b/deps/.npm/connect/0.2.5/package/docs/conditionalGet.md deleted file mode 100644 index 44dec1b5..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/conditionalGet.md +++ /dev/null @@ -1,7 +0,0 @@ -## Conditional GET - -The _conditionalGet_ middleware supports conditional GET requests, which validates the "freshness" of a response body. Currently supports: - - * _If-Modified-Since_. When a response status is _200_, and _Last-Modified_ less than or equal to this time, the response body and _Content-*_ headers will be stripped, responding with 304 "Not Modified". - - * _If-None_Match_. Performs a similar validation, however compares the _ETag_ for equality. \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/docs/cookieDecoder.1 b/deps/.npm/connect/0.2.5/package/docs/cookieDecoder.1 deleted file mode 100644 index d5563e3b..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/cookieDecoder.1 +++ /dev/null @@ -1,27 +0,0 @@ -.\" generated with Ronn/v0.6.6 -.\" http://github.com/rtomayko/ronn/ -. -.TH "COOKIEDECODER" "" "June 2010" "" "" -. -.SH "Cookie Decoder" -The \fIcookieDecoder\fR middleware parses the \fICookie\fR header when present, and populates \fBreq\.cookies\fR: -. -.IP "" 4 -. -.nf - -connect\.createServer( - connect\.cookieDecoder() -]); -. -.fi -. -.IP "" 0 -. -.SH "See Also" -. -.IP "\(bu" 4 -session -. -.IP "" 0 - diff --git a/deps/.npm/connect/0.2.5/package/docs/cookieDecoder.html b/deps/.npm/connect/0.2.5/package/docs/cookieDecoder.html deleted file mode 100644 index 368ee990..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/cookieDecoder.html +++ /dev/null @@ -1,163 +0,0 @@ - - - - Connect - - - - -
-
- - -

The cookieDecoder middleware parses the Cookie header when present, and populates req.cookies:

- -
connect.createServer(
-    connect.cookieDecoder()
-]);
-
- -

See Also

- -
    -
  • session
  • -
- - -
-
- - diff --git a/deps/.npm/connect/0.2.5/package/docs/cookieDecoder.md b/deps/.npm/connect/0.2.5/package/docs/cookieDecoder.md deleted file mode 100644 index a3b1af15..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/cookieDecoder.md +++ /dev/null @@ -1,11 +0,0 @@ -## Cookie Decoder - -The _cookieDecoder_ middleware parses the _Cookie_ header when present, and populates `req.cookies`: - - connect.createServer( - connect.cookieDecoder() - ]); - -## See Also - - * session \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/docs/errorHandler.1 b/deps/.npm/connect/0.2.5/package/docs/errorHandler.1 deleted file mode 100644 index 523631b5..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/errorHandler.1 +++ /dev/null @@ -1,58 +0,0 @@ -.\" generated with Ronn/v0.6.6 -.\" http://github.com/rtomayko/ronn/ -. -.TH "ERRORHANDLER" "" "June 2010" "" "" -. -.SH "Error Handler" -The \fIerrorHandler\fR middleware responds to exceptions passed or caught from within middleware above it, according to the options shown below\. -. -.IP "" 4 -. -.nf - -connect\.createServer( - function(req, res, next){ - throw new Error(\'ahhhh!\'); - }, - connect\.errorHandler({ dumpExceptions: true }) -); -. -.fi -. -.IP "" 0 -. -.P -By default the response of \fIerrorHandler\fR is 500 \'Internal Server Error\'\. If \fIshowStack\fR is true, then Connect decides how to respond based on the \fIAccept\fR request header: -. -.IP "" 4 -. -.nf - -text/html Outputs an html version of the stack trace -application/json Outputs json { \'error\': { \'message\': \.\.\. }} -otherwise Outputs plain text stack trace -. -.fi -. -.IP "" 0 -. -.SS "Options" -. -.nf - -showMessage Show the exception message only -showStack Show the exception message and stack trace -dumpExceptions Output exception stack traces to stderr (does not re\-throw) -. -.fi -. -.SS "Environment Variables" -. -.nf - -\-\-showErrorMessage -\-\-showErrorStack -\-\-dumpExceptions -. -.fi - diff --git a/deps/.npm/connect/0.2.5/package/docs/errorHandler.html b/deps/.npm/connect/0.2.5/package/docs/errorHandler.html deleted file mode 100644 index f8887bd8..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/errorHandler.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - Connect - - - - -
-
-

Error Handler

- -

The errorHandler middleware responds to exceptions passed or caught from within middleware above it, according to the options shown below.

- -
connect.createServer(
-    function(req, res, next){
-        throw new Error('ahhhh!');
-    },
-    connect.errorHandler({ dumpExceptions: true })
-);
-
- -

By default the response of errorHandler is 500 'Internal Server Error'. If showStack is true, then Connect decides how to respond based on the Accept request header:

- -
text/html         Outputs an html version of the stack trace
-application/json  Outputs json { 'error': { 'message': ... }}
-otherwise         Outputs plain text stack trace
-
- -

Options

- -
showMessage     Show the exception message only  
-showStack       Show the exception message and stack trace
-dumpExceptions  Output exception stack traces to stderr (does not re-throw)
-
- -

Environment Variables

- -
--showErrorMessage
---showErrorStack
---dumpExceptions
-
- -
-
- - diff --git a/deps/.npm/connect/0.2.5/package/docs/errorHandler.md b/deps/.npm/connect/0.2.5/package/docs/errorHandler.md deleted file mode 100644 index d1f1454d..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/errorHandler.md +++ /dev/null @@ -1,28 +0,0 @@ -## Error Handler - -The _errorHandler_ middleware responds to exceptions passed or caught from within middleware above it, according to the options shown below. - - connect.createServer( - function(req, res, next){ - throw new Error('ahhhh!'); - }, - connect.errorHandler({ dumpExceptions: true }) - ); - -By default the response of _errorHandler_ is 500 'Internal Server Error'. If _showStack_ is true, then Connect decides how to respond based on the _Accept_ request header: - - text/html Outputs an html version of the stack trace - application/json Outputs json { 'error': { 'message': ... }} - otherwise Outputs plain text stack trace - -### Options - - showMessage Show the exception message only - showStack Show the exception message and stack trace - dumpExceptions Output exception stack traces to stderr (does not re-throw) - -### Environment Variables - - --showErrorMessage - --showErrorStack - --dumpExceptions \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/docs/index.1 b/deps/.npm/connect/0.2.5/package/docs/index.1 deleted file mode 100644 index ebb15b9d..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/index.1 +++ /dev/null @@ -1,173 +0,0 @@ -.\" generated with Ronn/v0.7.3 -.\" http://github.com/rtomayko/ronn/tree/0.7.3 -. -.TH "CONNECT" "1" "August 2010" "" "" -. -.SH "NAME" -\fBconnect\fR \- high performance middleware framework for node -. -.P -Connect is a high performance middleware framework for node \fIhttp://nodejs\.org\fR featuring robust middleware for serving static files, advanced routing, cookie and session implementations, error handling and much more\. -. -.SH "Middleware Usage" -Below is an example which shows usage of the \fIlogger\fR middleware bundled with Connect, as well as \fIstaticProvder\fR\. -. -.IP "" 4 -. -.nf - -var connect = require(\'connect\'); - -var server = connect\.createServer( - connect\.logger(), - connect\.staticProvider(__dirname + \'/public\') -); - -server\.listen(3000); -. -.fi -. -.IP "" 0 -. -.SH "Middleware Authoring" -Connect middleware is simply a function which accepts the \fIrequest\fR, \fIresponse\fR objects\. Optionally the third parameter \fInext\fR can be used to continue down the middleware stack\. For example below is a middleware layer that simply responds with "hello world"\. -. -.IP "" 4 -. -.nf - -function helloWorld(req, res) { - res\.writeHead(200, { \'Content\-Type\': \'text/plain\' }); - res\.end(\'hello world\'); -} - -connect\.createServer(helloWorld)\.listen(3000); -. -.fi -. -.IP "" 0 -. -.P -Lets say we now have some middleware that will require a setup step, this can be done by returning a closure: -. -.IP "" 4 -. -.nf - -function respond(msg) { - msg = msg || \'hello world\'; - return function(req, res) { - res\.writeHead(200, { \'Content\-Type\': \'text/plain\' }); - res\.end(msg); - } -} - -connect\.createServer(respond(\'wahoo\'))\.listen(3000); -. -.fi -. -.IP "" 0 -. -.P -To pass control to the next middleware layer, we may call the \fBnext()\fR function with an optional instanceof \fBError\fR\. Middleware with four parameters is an error handling middleware, the \fBerr\fR object can then be logged, used to issue a response, ignored, etc\. -. -.IP "" 4 -. -.nf - -function fail(req, res, next) { - // Exceptions thrown will be automatically passed to next() - // however for custom exceptions / async exceptions you may pass them - next(new Error(\'something broke!\')); -} - -function errorHandler(err, req, res, next) { - res\.writeHead(500, { \'Content\-Type\': \'text/plain\' }); - res\.end(err\.stack); -} - -connect\.createServer(fail, errorHandler)\.listen(3000); -. -.fi -. -.IP "" 0 -. -.P -To make your middleware available to others, typically you write a module, and export the function itself: -. -.IP "" 4 -. -.nf - - // delay\.js - module\.exports = function(ms){ - ms = ms || 1000; - return function(req, res, next){ - setTimeout(next, ms); - } - }; - - // app\.js - // delay one second before continuing down the stack - connect\.createServer(require(\'\./delay\')(1000))\.listen(3000); -. -.fi -. -.IP "" 0 -. -.SH "Bundled Middleware" -Connect ships with several helpful middleware modules, the following are currently provided out of the box: -. -.IP "" 4 -. -.nf - -bodyDecoder Buffers and parses json and urlencoded request bodies (extenable) -conditionalGet Provides 304 "Not Modified" support -errorHandler Handles exceptions thrown, or passed through the stack -gzip Compresses response bodies with gzip executable -lint Aids in middleware development -logger Provides common logger support, and custom log formats -methodOverride Provides faux HTTP method support by using the "_method" key by default -redirect Provides req\.redirect() with "magic" urls, ex: req\.redirect("back") -compiler Supports arbitrary static compilation of files, currently supports less and sass\. -cacheManifest Provides cache manifest for offline apps -jsonrpc Provides JSON\-RPC 2\.0 support -staticProvider Serves static files -router Provides a feature rich routing API similar to Sinatra and Express -cookieDecoder Provides cookie parsing support -session Provides session support -cache Provides memory caching -repl Read Evaluate Print Loop attached to "/tmp/connect\.sock" for inspecting live servers -vhost Virtual host support -. -.fi -. -.IP "" 0 -. -.SS "Middleware Documentation" -To view middleware specific documentation execute: -. -.IP "" 4 -. -.nf - -$ man connect\-MIDDLEWARE -. -.fi -. -.IP "" 0 -. -.P -For example: -. -.IP "" 4 -. -.nf - -$ man connect\-bodyDecoder -. -.fi -. -.IP "" 0 - diff --git a/deps/.npm/connect/0.2.5/package/docs/index.html b/deps/.npm/connect/0.2.5/package/docs/index.html deleted file mode 100644 index ddf578c6..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/index.html +++ /dev/null @@ -1,264 +0,0 @@ - - - - Connect - - - - -
-
-

Connect

-

- connect - high performance middleware framework for node -

- -

Connect is a high performance middleware framework for node featuring -robust middleware for serving static files, advanced routing, cookie and session implementations, -error handling and much more.

- -

Middleware Usage

- -

Below is an example which shows usage of the logger middleware bundled with Connect, as well as staticProvder.

- -
var connect = require('connect');
-
-var server = connect.createServer(
-    connect.logger(),
-    connect.staticProvider(__dirname + '/public')
-);
-
-server.listen(3000);
-
- -

Middleware Authoring

- -

Connect middleware is simply a function which accepts the request, response objects. Optionally -the third parameter next can be used to continue down the middleware stack. For example below is -a middleware layer that simply responds with "hello world".

- -
function helloWorld(req, res) {
-    res.writeHead(200, { 'Content-Type': 'text/plain' });
-    res.end('hello world');
-}
-
-connect.createServer(helloWorld).listen(3000);
-
- -

Lets say we now have some middleware that will require a setup step, this can be done by returning a closure:

- -
function respond(msg) {
-    msg = msg || 'hello world';
-    return function(req, res) {
-        res.writeHead(200, { 'Content-Type': 'text/plain' });
-        res.end(msg);
-    }
-}
-
-connect.createServer(respond('wahoo')).listen(3000);
-
- -

To pass control to the next middleware layer, we may call the next() function with an optional instanceof Error. -Middleware with four parameters is an error handling middleware, the err object can then be logged, used to issue a response, ignored, etc.

- -
function fail(req, res, next) {
-    // Exceptions thrown will be automatically passed to next()
-    // however for custom exceptions / async exceptions you may pass them
-    next(new Error('something broke!'));
-}
-
-function errorHandler(err, req, res, next) {
-    res.writeHead(500, { 'Content-Type': 'text/plain' });
-    res.end(err.stack);
-}
-
-connect.createServer(fail, errorHandler).listen(3000);
-
- -

To make your middleware available to others, typically you write a module, and export the function itself:

- -
  // delay.js
-  module.exports = function(ms){
-      ms = ms || 1000;
-      return function(req, res, next){
-        setTimeout(next, ms);
-      } 
-  };
-
- // app.js
- // delay one second before continuing down the stack
- connect.createServer(require('./delay')(1000)).listen(3000);
-
- -

Bundled Middleware

- -

Connect ships with several helpful middleware modules, -the following are currently provided out of the box:

- -
bodyDecoder      Buffers and parses json and urlencoded request bodies (extenable)
-conditionalGet   Provides 304 "Not Modified" support
-errorHandler     Handles exceptions thrown, or passed through the stack
-gzip             Compresses response bodies with gzip executable
-lint             Aids in middleware development
-logger           Provides common logger support, and custom log formats
-methodOverride   Provides faux HTTP method support by using the "_method" key by default 
-redirect         Provides req.redirect() with "magic" urls, ex: req.redirect("back")
-compiler         Supports arbitrary static compilation of files, currently supports less and sass.
-cacheManifest    Provides cache manifest for offline apps
-jsonrpc          Provides JSON-RPC 2.0 support
-staticProvider   Serves static files
-router           Provides a feature rich routing API similar to Sinatra and Express
-cookieDecoder    Provides cookie parsing support
-session          Provides session support
-cache            Provides memory caching
-repl             Read Evaluate Print Loop attached to "/tmp/connect.sock" for inspecting live servers 
-vhost            Virtual host support
-
- -

Middleware Documentation

- -

To view middleware specific documentation execute:

- -
$ man connect-MIDDLEWARE
-
- -

For example:

- -
$ man connect-bodyDecoder
-
- -
-
- - diff --git a/deps/.npm/connect/0.2.5/package/docs/index.md b/deps/.npm/connect/0.2.5/package/docs/index.md deleted file mode 100644 index a827754d..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/index.md +++ /dev/null @@ -1,108 +0,0 @@ -connect(1) -- high performance middleware framework for node -============================================================ - -Connect is a high performance middleware framework for [node](http://nodejs.org) featuring -robust middleware for serving static files, advanced routing, cookie and session implementations, -error handling and much more. - -## Middleware Usage - -Below is an example which shows usage of the _logger_ middleware bundled with Connect, as well as _staticProvder_. - - var connect = require('connect'); - - var server = connect.createServer( - connect.logger(), - connect.staticProvider(__dirname + '/public') - ); - - server.listen(3000); - -## Middleware Authoring - -Connect middleware is simply a function which accepts the _request_, _response_ objects. Optionally -the third parameter _next_ can be used to continue down the middleware stack. For example below is -a middleware layer that simply responds with "hello world". - - function helloWorld(req, res) { - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.end('hello world'); - } - - connect.createServer(helloWorld).listen(3000); - -Lets say we now have some middleware that will require a setup step, this can be done by returning a closure: - - function respond(msg) { - msg = msg || 'hello world'; - return function(req, res) { - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.end(msg); - } - } - - connect.createServer(respond('wahoo')).listen(3000); - -To pass control to the next middleware layer, we may call the `next()` function with an optional instanceof `Error`. -Middleware with four parameters is an error handling middleware, the `err` object can then be logged, used to issue a response, ignored, etc. - - function fail(req, res, next) { - // Exceptions thrown will be automatically passed to next() - // however for custom exceptions / async exceptions you may pass them - next(new Error('something broke!')); - } - - function errorHandler(err, req, res, next) { - res.writeHead(500, { 'Content-Type': 'text/plain' }); - res.end(err.stack); - } - - connect.createServer(fail, errorHandler).listen(3000); - -To make your middleware available to others, typically you write a module, and export the function itself: - - // delay.js - module.exports = function(ms){ - ms = ms || 1000; - return function(req, res, next){ - setTimeout(next, ms); - } - }; - - // app.js - // delay one second before continuing down the stack - connect.createServer(require('./delay')(1000)).listen(3000); - -## Bundled Middleware - -Connect ships with several helpful middleware modules, -the following are currently provided out of the box: - - bodyDecoder Buffers and parses json and urlencoded request bodies (extenable) - conditionalGet Provides 304 "Not Modified" support - errorHandler Handles exceptions thrown, or passed through the stack - gzip Compresses response bodies with gzip executable - lint Aids in middleware development - logger Provides common logger support, and custom log formats - methodOverride Provides faux HTTP method support by using the "_method" key by default - redirect Provides req.redirect() with "magic" urls, ex: req.redirect("back") - compiler Supports arbitrary static compilation of files, currently supports less and sass. - cacheManifest Provides cache manifest for offline apps - jsonrpc Provides JSON-RPC 2.0 support - staticProvider Serves static files - router Provides a feature rich routing API similar to Sinatra and Express - cookieDecoder Provides cookie parsing support - session Provides session support - cache Provides memory caching - repl Read Evaluate Print Loop attached to "/tmp/connect.sock" for inspecting live servers - vhost Virtual host support - -### Middleware Documentation - -To view middleware specific documentation execute: - - $ man connect-MIDDLEWARE - -For example: - - $ man connect-bodyDecoder \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/docs/jsonrpc.1 b/deps/.npm/connect/0.2.5/package/docs/jsonrpc.1 deleted file mode 100644 index 7b097b8f..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/jsonrpc.1 +++ /dev/null @@ -1,54 +0,0 @@ -.\" generated with Ronn/v0.6.6 -.\" http://github.com/rtomayko/ronn/ -. -.TH "JSONRPC" "" "August 2010" "" "" -. -.SH "JSON\-RPC" -The \fIjsonrpc\fR middleware provides JSON\-RPC 2\.0 support\. Below is an example exposing the \fIadd\fR and \fIsub\fR methods: -. -.IP "" 4 -. -.nf - -var math = { - add: function(a, b, fn){ - fn(null, a + b); - }, - sub: function(a, b, fn){ - fn(null, a \- b); - } -}; - -var date = { - time: function(fn){ - fn(null, new Date()\.toUTCString()); - } -}; - -connect\.createServer( - connect\.jsonrpc(math, date) -); -. -.fi -. -.IP "" 0 -. -.P -When you wish to pass an exception simply invoke \fBfn(err)\fR, or pass the error code \fBfn(jsonrpc\.INVALID_PARAMS)\fR\. Otherwise \fBfn(null, result)\fR will respond with the given results\. -. -.SS "Features" -. -.IP "\(bu" 4 -async support -. -.IP "\(bu" 4 -batch request support -. -.IP "\(bu" 4 -variable argument length -. -.IP "\(bu" 4 -named parameter support -. -.IP "" 0 - diff --git a/deps/.npm/connect/0.2.5/package/docs/jsonrpc.html b/deps/.npm/connect/0.2.5/package/docs/jsonrpc.html deleted file mode 100644 index c27b77f0..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/jsonrpc.html +++ /dev/null @@ -1,181 +0,0 @@ - - - - Connect - - - - -
-
-

JSON-RPC

- -

The jsonrpc middleware provides JSON-RPC 2.0 support. Below is an example exposing the add and sub methods:

- -
var math = {
-    add: function(a, b, fn){
-        fn(null, a + b);
-    },
-    sub: function(a, b, fn){
-        fn(null, a - b);
-    }
-};
-
-var date = {
-    time: function(fn){
-        fn(null, new Date().toUTCString());
-    }
-};
-
-connect.createServer(
-    connect.jsonrpc(math, date)
-);
-
- -

When you wish to pass an exception simply invoke fn(err), or pass the error code fn(jsonrpc.INVALID_PARAMS). Otherwise fn(null, result) will respond with the given results.

- -

Features

- -
    -
  • async support
  • -
  • batch request support
  • -
  • variable argument length
  • -
  • named parameter support
  • -
- - -
-
- - diff --git a/deps/.npm/connect/0.2.5/package/docs/jsonrpc.md b/deps/.npm/connect/0.2.5/package/docs/jsonrpc.md deleted file mode 100644 index d1606753..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/jsonrpc.md +++ /dev/null @@ -1,31 +0,0 @@ -## JSON-RPC - -The _jsonrpc_ middleware provides JSON-RPC 2.0 support. Below is an example exposing the _add_ and _sub_ methods: - - var math = { - add: function(a, b, fn){ - fn(null, a + b); - }, - sub: function(a, b, fn){ - fn(null, a - b); - } - }; - - var date = { - time: function(fn){ - fn(null, new Date().toUTCString()); - } - }; - - connect.createServer( - connect.jsonrpc(math, date) - ); - -When you wish to pass an exception simply invoke `fn(err)`, or pass the error code `fn(jsonrpc.INVALID_PARAMS)`. Otherwise `fn(null, result)` will respond with the given results. - -### Features - - * async support - * batch request support - * variable argument length - * named parameter support diff --git a/deps/.npm/connect/0.2.5/package/docs/layout/api.foot.html b/deps/.npm/connect/0.2.5/package/docs/layout/api.foot.html deleted file mode 100644 index afb7967f..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/layout/api.foot.html +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/docs/layout/api.head.html b/deps/.npm/connect/0.2.5/package/docs/layout/api.head.html deleted file mode 100644 index cd74151e..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/layout/api.head.html +++ /dev/null @@ -1,141 +0,0 @@ - - - - Connect - - - - -
- \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/docs/lint.1 b/deps/.npm/connect/0.2.5/package/docs/lint.1 deleted file mode 100644 index 31824e29..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/lint.1 +++ /dev/null @@ -1,102 +0,0 @@ -.\" generated with Ronn/v0.6.6 -.\" http://github.com/rtomayko/ronn/ -. -.TH "LINT" "" "July 2010" "" "" -. -.SH "Lint" -The \fIlint\fR middleware aids in middleware development, by performing basic cheques at boot, and during requests\. This process currently checks that the: -. -.IP "\(bu" 4 -first param of \fBhandle()\fR is \fIreq\fR or \fIrequest\fR -. -.IP "\(bu" 4 -second param of \fBhandle()\fR is \fIres\fR or \fIresponse\fR -. -.IP "\(bu" 4 -third param of \fBhandle()\fR is \fInext\fR -. -.IP "\(bu" 4 -source of \fBhandle()\fR to see if \fBnext()\fR is called, or if the request is responded to -. -.IP "\(bu" 4 -\fBreq\.headers\fR is accessed with lowercase -. -.IP "" 0 -. -.SS "Example" -. -.nf - -var server = connect\.createServer( - // No named params - function params(){ - arguments[2](); - }, - // Does not call next AND does not respond - function hang(req, res, next){ - // Call foo() instead so - // that our demo can still function\. - var foo = next; - foo(); - - // All good - var ct = req\.headers[\'content\-type\']; - }, - function allGood(req, res, next){ - // All good - next(); - }, - function reqHeaders(req, res, next){ - // Request headers are always normalized as - // lowercased by ryan\'s http parser\. - var ct = req\.headers[\'Content\-Type\']; - next(); - }, - function methodUppercase(req, res, next){ - // req\.method should be uppercase - req\.method = \'get\'; - next(); - } -); - -server\.use(\'/\', connect\.lint(server)); -. -.fi -. -.SS "Sample Output" -. -.nf - -Warning: layer params:0 First parameter should be named req or request, but is undefined -Warning: layer params:0 Second parameter should be named res or response, but is undefined -Warning: layer params:0 Third parameter should be named next, but is undefined -Warning: layer params:0 Does not seem to call next(), or respond to the request -Warning: layer hang:1 Does not seem to call next(), or respond to the request -Warning: layer req\.headers:3 Request headers are lowercased, seems to be accessed with capitals - -0) params: - function (){ - arguments[2](); - } - -1) hang: - function (req, res, next){ - // Call foo() instead so - // that our demo can still function\. - var foo = next; - foo(); - - // All good - var ct = req\.headers[\'content\-type\']; - } - -3) req\.headers: - function (req, res, next){ - // Request headers are always normalized as - // lowercased by ryan\'s http parser\. - var ct = req\.headers[\'Content\-Type\']; - next(); - } -. -.fi - diff --git a/deps/.npm/connect/0.2.5/package/docs/lint.html b/deps/.npm/connect/0.2.5/package/docs/lint.html deleted file mode 100644 index ed1a2792..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/lint.html +++ /dev/null @@ -1,229 +0,0 @@ - - - - Connect - - - - -
-
-

Lint

- -

The lint middleware aids in middleware development, by performing basic cheques at boot, and during requests. This process currently checks that the:

- -
    -
  • first param of handle() is req or request
  • -
  • second param of handle() is res or response
  • -
  • third param of handle() is next
  • -
  • source of handle() to see if next() is called, or if the request is responded to
  • -
  • req.headers is accessed with lowercase
  • -
- - -

Example

- -
var server = connect.createServer(
-    // No named params
-    function params(){
-        arguments[2]();
-    },
-    // Does not call next AND does not respond
-    function hang(req, res, next){
-        // Call foo() instead so
-        // that our demo can still function.
-        var foo = next;
-        foo();
-
-        // All good
-        var ct = req.headers['content-type'];
-    },
-    function allGood(req, res, next){
-        // All good
-        next();
-    },
-    function reqHeaders(req, res, next){
-        // Request headers are always normalized as
-        // lowercased by ryan's http parser.
-        var ct = req.headers['Content-Type'];
-        next();
-    },
-    function methodUppercase(req, res, next){
-        // req.method should be uppercase
-        req.method = 'get';
-        next();
-    }
-);
-
-server.use('/', connect.lint(server));
-
- -

Sample Output

- -
Warning: layer params:0 First parameter should be named req or request, but is undefined
-Warning: layer params:0 Second parameter should be named res or response, but is undefined
-Warning: layer params:0 Third parameter should be named next, but is undefined
-Warning: layer params:0 Does not seem to call next(), or respond to the request
-Warning: layer hang:1 Does not seem to call next(), or respond to the request
-Warning: layer req.headers:3 Request headers are lowercased, seems to be accessed with capitals
-
-0) params:
-    function (){
-        arguments[2]();
-    }
-
-1) hang:
-    function (req, res, next){
-        // Call foo() instead so
-        // that our demo can still function.
-        var foo = next;
-        foo();
-
-        // All good
-        var ct = req.headers['content-type'];
-    }
-
-3) req.headers:
-    function (req, res, next){
-        // Request headers are always normalized as
-        // lowercased by ryan's http parser.
-        var ct = req.headers['Content-Type'];
-        next();
-    }
-
- -
-
- - diff --git a/deps/.npm/connect/0.2.5/package/docs/lint.md b/deps/.npm/connect/0.2.5/package/docs/lint.md deleted file mode 100644 index 9ab77f2c..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/lint.md +++ /dev/null @@ -1,79 +0,0 @@ -## Lint - -The _lint_ middleware aids in middleware development, by performing basic cheques at boot, and during requests. This process currently checks that the: - - * first param of `handle()` is _req_ or _request_ - * second param of `handle()` is _res_ or _response_ - * third param of `handle()` is _next_ - * source of `handle()` to see if `next()` is called, or if the request is responded to - * `req.headers` is accessed with lowercase - -### Example - - var server = connect.createServer( - // No named params - function params(){ - arguments[2](); - }, - // Does not call next AND does not respond - function hang(req, res, next){ - // Call foo() instead so - // that our demo can still function. - var foo = next; - foo(); - - // All good - var ct = req.headers['content-type']; - }, - function allGood(req, res, next){ - // All good - next(); - }, - function reqHeaders(req, res, next){ - // Request headers are always normalized as - // lowercased by ryan's http parser. - var ct = req.headers['Content-Type']; - next(); - }, - function methodUppercase(req, res, next){ - // req.method should be uppercase - req.method = 'get'; - next(); - } - ); - - server.use('/', connect.lint(server)); - -### Sample Output - - Warning: layer params:0 First parameter should be named req or request, but is undefined - Warning: layer params:0 Second parameter should be named res or response, but is undefined - Warning: layer params:0 Third parameter should be named next, but is undefined - Warning: layer params:0 Does not seem to call next(), or respond to the request - Warning: layer hang:1 Does not seem to call next(), or respond to the request - Warning: layer req.headers:3 Request headers are lowercased, seems to be accessed with capitals - - 0) params: - function (){ - arguments[2](); - } - - 1) hang: - function (req, res, next){ - // Call foo() instead so - // that our demo can still function. - var foo = next; - foo(); - - // All good - var ct = req.headers['content-type']; - } - - 3) req.headers: - function (req, res, next){ - // Request headers are always normalized as - // lowercased by ryan's http parser. - var ct = req.headers['Content-Type']; - next(); - } - \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/docs/logger.1 b/deps/.npm/connect/0.2.5/package/docs/logger.1 deleted file mode 100644 index ad0b5ecd..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/logger.1 +++ /dev/null @@ -1,84 +0,0 @@ -.\" generated with Ronn/v0.7.3 -.\" http://github.com/rtomayko/ronn/tree/0.7.3 -. -.TH "LOGGER" "" "August 2010" "" "" -. -.SH "NAME" -\fBlogger\fR -. -.SH "Logger" -The \fIlogger\fR middleware provides common log format support, as well as custom formats, below is the default usage: -. -.IP "" 4 -. -.nf - -connect\.createServer( - connect\.logger(), -); -. -.fi -. -.IP "" 0 -. -.P -The logger also has built in buffering support to increase performance\. When the \fBbuffer\fR option is set to \fBtrue\fR it defaults to 1000 milliseconds, however you can specify your own duration\. When using the \fBbuffer\fR option log lines are not written to the stream immediately, they are buffered in an array, and flushed periodically\. -. -.IP "" 4 -. -.nf - -connect\.createServer( - connect\.logger({ buffer: 2000 }) -); -. -.fi -. -.IP "" 0 -. -.P -A custom format can also be passed: -. -.IP "" 4 -. -.nf - -connect\.createServer( - connect\.logger({ format: \':method :url :response\-time\' }) -); -. -.fi -. -.IP "" 0 -. -.P -The following format tokens are currently available: -. -.IP "" 4 -. -.nf - -:req[header] Arbitrary request header, ex: req[Accept] -:res[header] Arbitrary response header, ex: res[Content\-Type] -:http\-version HTTP request version -:response\-time Response time in milliseconds -:remote\-addr Remote address -:date UTC date -:method Request method -:url Request url -:referrer Request referrer / referer -:user\-agent User\-Agent string -:status Response status -. -.fi -. -.IP "" 0 -. -.SS "Environment Variables" -. -.nf - -\-\-logFormat -. -.fi - diff --git a/deps/.npm/connect/0.2.5/package/docs/logger.html b/deps/.npm/connect/0.2.5/package/docs/logger.html deleted file mode 100644 index 442da194..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/logger.html +++ /dev/null @@ -1,183 +0,0 @@ - - - - Connect - - - - -
-
-

Logger

- -

The logger middleware provides common log format support, as well as custom formats, below is the default usage:

- -
connect.createServer(
-    connect.logger(),
-);
-
- -

A custom format can also be passed:

- -
connect.createServer(
-    connect.logger({ format: ':method :url :response-time' })
-);
-
- -

The following format tokens are currently available:

- -
:req[header]    Arbitrary request header, ex: req[Accept]
-:res[header]    Arbitrary response header, ex: res[Content-Type]
-:http-version   HTTP request version
-:response-time  Response time in milliseconds
-:remote-addr    Remote address
-:date           UTC date
-:method         Request method
-:url            Request url
-:referrer       Request referrer / referer
-:user-agent     User-Agent string
-:status         Response status
-
- -

Environment Variables

- -
--logFormat
-
- -
-
- - diff --git a/deps/.npm/connect/0.2.5/package/docs/logger.md b/deps/.npm/connect/0.2.5/package/docs/logger.md deleted file mode 100644 index b1e5aa2d..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/logger.md +++ /dev/null @@ -1,37 +0,0 @@ -## Logger - -The _logger_ middleware provides common log format support, as well as custom formats, below is the default usage: - - connect.createServer( - connect.logger(), - ); - -The logger also has built in buffering support to increase performance. When the `buffer` option is set to `true` it defaults to 1000 milliseconds, however you can specify your own duration. When using the `buffer` option log lines are not written to the stream immediately, they are buffered in an array, and flushed periodically. - - connect.createServer( - connect.logger({ buffer: 2000 }) - ); - -A custom format can also be passed: - - connect.createServer( - connect.logger({ format: ':method :url :response-time' }) - ); - -The following format tokens are currently available: - - :req[header] Arbitrary request header, ex: req[Accept] - :res[header] Arbitrary response header, ex: res[Content-Type] - :http-version HTTP request version - :response-time Response time in milliseconds - :remote-addr Remote address - :date UTC date - :method Request method - :url Request url - :referrer Request referrer / referer - :user-agent User-Agent string - :status Response status - -### Environment Variables - - --logFormat \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/docs/methodOverride.1 b/deps/.npm/connect/0.2.5/package/docs/methodOverride.1 deleted file mode 100644 index ff969897..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/methodOverride.1 +++ /dev/null @@ -1,31 +0,0 @@ -.\" generated with Ronn/v0.6.6 -.\" http://github.com/rtomayko/ronn/ -. -.TH "METHODOVERRIDE" "" "June 2010" "" "" -. -.SH "Method Override" -The \fImethodOverride\fR middleware checks \fBreq\.body\._method\fR (by default) in order to swap out the http request method\. The \fIbodyDecoder\fR middleware will populate \fBreq\.body\fR when a form is submitted, which when paired with this middleware will allow the \fIrouter\fR middleware to support RESTful forms\. -. -.SS "Options" -. -.nf - -key Defaults to _method -. -.fi -. -.SS "Environment Variables" -. -.nf - -\-\-methodOverrideKey -. -.fi -. -.SS "See Also" -. -.IP "\(bu" 4 -body\-decoder -. -.IP "" 0 - diff --git a/deps/.npm/connect/0.2.5/package/docs/methodOverride.html b/deps/.npm/connect/0.2.5/package/docs/methodOverride.html deleted file mode 100644 index 011609da..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/methodOverride.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - Connect - - - - -
-
-

Method Override

- -

The methodOverride middleware checks req.body._method (by default) in order to swap out the http request method. -The bodyDecoder middleware will populate req.body when a form is submitted, which when paired with -this middleware will allow the router middleware to support RESTful forms.

- -

Options

- -
key   Defaults to _method
-
- -

Environment Variables

- -
--methodOverrideKey
-
- -

See Also

- -
    -
  • body-decoder
  • -
- - -
-
- - diff --git a/deps/.npm/connect/0.2.5/package/docs/methodOverride.md b/deps/.npm/connect/0.2.5/package/docs/methodOverride.md deleted file mode 100644 index 042525c6..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/methodOverride.md +++ /dev/null @@ -1,17 +0,0 @@ -## Method Override - -The _methodOverride_ middleware checks `req.body._method` (by default) in order to swap out the http request method. -The _bodyDecoder_ middleware will populate `req.body` when a form is submitted, which when paired with -this middleware will allow the _router_ middleware to support RESTful forms. - -### Options - - key Defaults to _method - -### Environment Variables - - --methodOverrideKey - -### See Also - - * body-decoder \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/docs/router.1 b/deps/.npm/connect/0.2.5/package/docs/router.1 deleted file mode 100644 index f48fd65b..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/router.1 +++ /dev/null @@ -1,75 +0,0 @@ -.\" generated with Ronn/v0.6.6 -.\" http://github.com/rtomayko/ronn/ -. -.TH "ROUTER" "" "July 2010" "" "" -. -.SH "Rest" -The \fIrouter\fR middleware provides a routing API similar to that of Sinatra and Express\. -. -.IP "" 4 -. -.nf - -function user(app) { - app\.get(\'/users/(all\.:format?)?\', function(req, res, next){ - // populates req\.format - // ex: - // GET /users - // GET /users/all - // GET /users/all\.json - // GET /users/all\.xml - }); - - app\.get(\'/users/:id\.:format?\', function(req, res, next){ - // populates req\.format - // populates req\.params\.id - // ex: - // GET /user/5 - // GET /user/5\.json - // GET /user/5\.xml - }); - - app\.put(\'/user/:id\', function(req, res, next){ - // populates req\.params\.id - // ex: - // PUT /user/2 - }); - - app\.del(\'/user/:id/file/*\', function(req, res, next){ - // populates req\.params\.id - // populates req\.params[0] - // ex: - // PUT /user/4/file/javascripts/jquery\.js - // PUT /user/4/file/stylecss - }); -} - -function commits(app) { - // RegExps too! - app\.get(/\\/commit\\/(\\w+)\\\.\\\.(\\w+)\\/?/i, function(req, res, next){ - // populates req\.params[0] with first capture group - // populates req\.params[1] with second capture group - // ex: - // GET /commit/kj4k\.\.d3sdf - }); -} - -connect\.createServer( - connect\.router(user), - connect\.router(commits), -); -. -.fi -. -.IP "" 0 -. -.P -Those of you looking for \fIPUT\fR and \fIDELETE\fR support may want to take a look at the \fImethodOverride\fR middleware\. -. -.SS "See Also" -. -.IP "\(bu" 4 -methodOverride -. -.IP "" 0 - diff --git a/deps/.npm/connect/0.2.5/package/docs/router.html b/deps/.npm/connect/0.2.5/package/docs/router.html deleted file mode 100644 index 77781a3c..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/router.html +++ /dev/null @@ -1,208 +0,0 @@ - - - - Connect - - - - -
-
-

Rest

- -

The router middleware provides a routing API similar to that of Sinatra and Express.

- -
function user(app) {
-    app.get('/users/(all.:format?)?', function(req, res, next){
-        // populates req.format
-        // ex:
-        //   GET /users
-        //   GET /users/all
-        //   GET /users/all.json
-        //   GET /users/all.xml
-    });
-
-    app.get('/users/:id.:format?': function(req, res, next){
-        // populates req.format
-        // populates req.params.id
-        // ex:
-        //   GET /user/5
-        //   GET /user/5.json
-        //   GET /user/5.xml
-    });
-
-    app.put('/user/:id', function(req, res, next){
-        // populates req.params.id
-        // ex:
-        //   PUT /user/2
-    });
-
-    app.del('/user/:id/file/*', function(req, res, next){
-        // populates req.params.id
-        // populates req.params[0]
-        // ex:
-        //   PUT /user/4/file/javascripts/jquery.js
-        //   PUT /user/4/file/stylecss
-    });
-}
-
-function commits(app) {
-    // RegExps too!
-    app.get(/\/commit\/(\w+)\.\.(\w+)\/?/i, function(req, res, next){
-        // populates req.params[0] with first capture group
-        // populates req.params[1] with second capture group
-        // ex:
-        //   GET /commit/kj4k..d3sdf
-    });
-}
-
-connect.createServer(
-    connect.router(user),
-    connect.router(commits),
-);
-
- -

Those of you looking for PUT and DELETE support may want to take a look at the methodOverride middleware.

- -

See Also

- -
    -
  • methodOverride
  • -
- - -
-
- - diff --git a/deps/.npm/connect/0.2.5/package/docs/router.md b/deps/.npm/connect/0.2.5/package/docs/router.md deleted file mode 100644 index 9969f3d0..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/router.md +++ /dev/null @@ -1,58 +0,0 @@ -## Rest - -The _router_ middleware provides a routing API similar to that of Sinatra and Express. - - function user(app) { - app.get('/users/(all.:format?)?', function(req, res, next){ - // populates req.format - // ex: - // GET /users - // GET /users/all - // GET /users/all.json - // GET /users/all.xml - }); - - app.get('/users/:id.:format?', function(req, res, next){ - // populates req.format - // populates req.params.id - // ex: - // GET /user/5 - // GET /user/5.json - // GET /user/5.xml - }); - - app.put('/user/:id', function(req, res, next){ - // populates req.params.id - // ex: - // PUT /user/2 - }); - - app.del('/user/:id/file/*', function(req, res, next){ - // populates req.params.id - // populates req.params[0] - // ex: - // PUT /user/4/file/javascripts/jquery.js - // PUT /user/4/file/stylecss - }); - } - - function commits(app) { - // RegExps too! - app.get(/\/commit\/(\w+)\.\.(\w+)\/?/i, function(req, res, next){ - // populates req.params[0] with first capture group - // populates req.params[1] with second capture group - // ex: - // GET /commit/kj4k..d3sdf - }); - } - - connect.createServer( - connect.router(user), - connect.router(commits), - ); - -Those of you looking for _PUT_ and _DELETE_ support may want to take a look at the _methodOverride_ middleware. - -### See Also - - * methodOverride \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/docs/session.1 b/deps/.npm/connect/0.2.5/package/docs/session.1 deleted file mode 100644 index 601aa18e..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/session.1 +++ /dev/null @@ -1,115 +0,0 @@ -.\" generated with Ronn/v0.6.6 -.\" http://github.com/rtomayko/ronn/ -. -.TH "SESSION" "" "July 2010" "" "" -. -.SH "Session" -The \fIsession\fR middleware provides persistence between requests\. If we wish to supply a custom \fBStore\fR subclass, or pass options to the store itself, we can configure it like so: -. -.IP "" 4 -. -.nf - -var MemoryStore = require(\'connect/middleware/session/memory\'); -connect\.createServer( - connect\.cookieDecoder(), - connect\.session({ store: new MemoryStore({ reapInterval: 60000 * 10 }) }), -); -. -.fi -. -.IP "" 0 -. -.P -\fBNOTE:\fR \fIcookieDecoder\fR must be above \fIsession\fR within the stack -. -.SS "Options" -. -.nf - -store Custom Store subclass -fingerprint Function passed the request which computes a fingerprint of the user\. - Defaults to an md5 hash of the session\.id, remoteAddress and User\-Agent strings\. -. -.fi -. -.SS "Store" -Abstract store which can be subclassed\. To comply with \fBStore\fR you should define: -. -.IP "" 4 -. -.nf - -#get(hash, callback) Fetch session data via the session fingerprint and callback(err, data) -#set(hash, data, callback) Commit the session for the fingerprint and callback(err) -. -.fi -. -.IP "" 0 -. -.P -Your store may also want to comply with the default \fBMemoryStore\fR, by providing: -. -.IP "" 4 -. -.nf - -#clear(callback) Clear all sessions and callback(err) -#all(callback) Fetches all active sessions and callback(err, sessions) -#length(callback) Fetches the total number of sessions and callback(err, len) -. -.fi -. -.IP "" 0 -. -.P -Inherited methods defined by Store: -. -.IP "" 4 -. -.nf - -#destroy(hash, callback) Calls #set(hash, null, callback) -#regenerate(req, callback) Destroys the session, creates a new one, and callback(err) -. -.fi -. -.IP "" 0 -. -.SS "MemoryStore" -Stores session data in memory, options are as follows: -. -.IP "" 4 -. -.nf - -reapInterval Interval in milliseconds used to reap stale sessions\. Defaults to 10 minutes -maxAage Maximum session age in milliseconds\. Defaults to 4 hours -cookie Session cookie options\. Defaults to { path: \'/\', httpOnly: true } -. -.fi -. -.IP "" 0 -. -.SS "Session" -Your store interacts with instances of \fBSession\fR\. The following methods are available: -. -.IP "" 4 -. -.nf - -#touch() Updates the lastAccess property -#destroy(callback) Destroy this session and callback(err, destroyedBoolean) -#regenerate(callback) Destroy this session, creates a new one and callback(err) -. -.fi -. -.IP "" 0 -. -.SS "See Also" -. -.IP "\(bu" 4 -cookieDecoder -. -.IP "" 0 - diff --git a/deps/.npm/connect/0.2.5/package/docs/session.html b/deps/.npm/connect/0.2.5/package/docs/session.html deleted file mode 100644 index 77cdcb7f..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/session.html +++ /dev/null @@ -1,211 +0,0 @@ - - - - Connect - - - - -
-
-

Session

- -

The session middleware provides persistence between requests. If we wish to supply a custom Store subclass, or pass options to the store itself, we can configure it like so:

- -
var MemoryStore = require('connect/middleware/session/memory');
-connect.createServer(
-    connect.cookieDecoder(),
-    connect.session({ store: new MemoryStore({ reapInterval: 60000 * 10 }) }),
-);
-
- -

NOTE: cookieDecoder must be above session within the stack

- -

Options

- -
store        Custom Store subclass
-fingerprint  Function passed the request which computes a fingerprint of the user.
-             Defaults to an md5 hash of the session.id, remoteAddress and User-Agent strings.
-
- -

Store

- -

Abstract store which can be subclassed. To comply with Store you should define:

- -
#get(hash, callback)         Fetch session data via the session fingerprint and callback(err, data)
-#set(hash, data, callback)   Commit the session for the fingerprint and callback(err)
-
- -

Your store may also want to comply with the default MemoryStore, by providing:

- -
#clear(callback)            Clear all sessions and callback(err)
-#all(callback)              Fetches all active sessions and callback(err, sessions)
-#length(callback)           Fetches the total number of sessions and callback(err, len)
-
- -

Inherited methods defined by Store:

- -
#destroy(hash, callback)    Calls #set(hash, null, callback)
-#regenerate(req, callback)  Destroys the session, creates a new one, and callback(err)
-
- -

MemoryStore

- -

Stores session data in memory, options are as follows:

- -
reapInterval    Interval in milliseconds used to reap stale sessions. Defaults to 10 minutes
-maxAage         Maximum session age in milliseconds. Defaults to 4 hours
-cookie          Session cookie options. Defaults to { path: '/', httpOnly: true }
-
- -

Session

- -

Your store interacts with instances of Session. The following methods are available:

- -
#touch()                 Updates the lastAccess property
-#destroy(callback)       Destroy this session and callback(err, destroyedBoolean)
-#regenerate(callback)    Destroy this session, creates a new one and callback(err)
-
- -

See Also

- -
    -
  • cookieDecoder
  • -
- - -
-
- - diff --git a/deps/.npm/connect/0.2.5/package/docs/session.md b/deps/.npm/connect/0.2.5/package/docs/session.md deleted file mode 100644 index f4827695..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/session.md +++ /dev/null @@ -1,55 +0,0 @@ -## Session - -The _session_ middleware provides persistence between requests. If we wish to supply a custom `Store` subclass, or pass options to the store itself, we can configure it like so: - - var MemoryStore = connect.session.MemoryStore; - connect.createServer( - connect.cookieDecoder(), - connect.session({ store: new MemoryStore({ reapInterval: 60000 * 10 }) }), - ); - -**NOTE:** _cookieDecoder_ must be above _session_ within the stack - -### Options - - store Custom Store subclass - fingerprint Function passed the request which computes a fingerprint of the user. - Defaults to an md5 hash of the session.id, remoteAddress and User-Agent strings. - -### Store - -Abstract store which can be subclassed. To comply with `Store` you should define: - - #get(hash, callback) Fetch session data via the session fingerprint and callback(err, data) - #set(hash, data, callback) Commit the session for the fingerprint and callback(err) - -Your store may also want to comply with the default `MemoryStore`, by providing: - - #clear(callback) Clear all sessions and callback(err) - #all(callback) Fetches all active sessions and callback(err, sessions) - #length(callback) Fetches the total number of sessions and callback(err, len) - -Inherited methods defined by Store: - - #destroy(hash, callback) Calls #set(hash, null, callback) - #regenerate(req, callback) Destroys the session, creates a new one, and callback(err) - -### MemoryStore - -Stores session data in memory, options are as follows: - - reapInterval Interval in milliseconds used to reap stale sessions. Defaults to 10 minutes - maxAage Maximum session age in milliseconds. Defaults to 4 hours - cookie Session cookie options. Defaults to { path: '/', httpOnly: true } - -### Session - -Your store interacts with instances of `Session`. The following methods are available: - - #touch() Updates the lastAccess property - #destroy(callback) Destroy this session and callback(err, destroyedBoolean) - #regenerate(callback) Destroy this session, creates a new one and callback(err) - -### See Also - - * cookieDecoder \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/docs/staticProvider.1 b/deps/.npm/connect/0.2.5/package/docs/staticProvider.1 deleted file mode 100644 index 67ca8fed..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/staticProvider.1 +++ /dev/null @@ -1,28 +0,0 @@ -.\" generated with Ronn/v0.6.6 -.\" http://github.com/rtomayko/ronn/ -. -.TH "STATICPROVIDER" "" "June 2010" "" "" -. -.SH "Static Provider" -The \fIstaticProvider\fR middleware provides static file serving to the given \fIroot\fR directory defaulting to the \fBCWD\fR, for example: -. -.IP "" 4 -. -.nf - -connect\.createServer( - connect\.staticProvider(__dirname + \'/public\') -); -. -.fi -. -.IP "" 0 -. -.SS "Environment Variables" -. -.nf - -\-\-staticRoot -. -.fi - diff --git a/deps/.npm/connect/0.2.5/package/docs/staticProvider.html b/deps/.npm/connect/0.2.5/package/docs/staticProvider.html deleted file mode 100644 index 6e0e09fd..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/staticProvider.html +++ /dev/null @@ -1,161 +0,0 @@ - - - - Connect - - - - -
-
-

Static Provider

- -

The staticProvider middleware provides static file serving to the given root directory defaulting to the CWD, for example:

- -
connect.createServer(
-    connect.staticProvider(__dirname + '/public')
-);
-
- -

Environment Variables

- -
--staticRoot
-
- -
-
- - diff --git a/deps/.npm/connect/0.2.5/package/docs/staticProvider.md b/deps/.npm/connect/0.2.5/package/docs/staticProvider.md deleted file mode 100644 index 28fb9a23..00000000 --- a/deps/.npm/connect/0.2.5/package/docs/staticProvider.md +++ /dev/null @@ -1,11 +0,0 @@ -## Static Provider - -The _staticProvider_ middleware provides static file serving to the given _root_ directory defaulting to the **CWD**, for example: - - connect.createServer( - connect.staticProvider(__dirname + '/public') - ); - -### Environment Variables - - --staticRoot \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/examples/embedding/app.js b/deps/.npm/connect/0.2.5/package/examples/embedding/app.js deleted file mode 100644 index 0699886d..00000000 --- a/deps/.npm/connect/0.2.5/package/examples/embedding/app.js +++ /dev/null @@ -1,14 +0,0 @@ -var http = require('http'), - Connect = require('../../lib/connect'); - -var server = http.createServer(function (req, res) { - res.writeHead(200, {"Content-Type":"text/plain"}); - res.end("This is a test of the connect embedding system...."); -}); - -module.exports = Connect.createServer( - Connect.logger(), - Connect.cache(), - Connect.gzip(), - server -); \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/examples/embedding/server.js b/deps/.npm/connect/0.2.5/package/examples/embedding/server.js deleted file mode 100755 index c4db906a..00000000 --- a/deps/.npm/connect/0.2.5/package/examples/embedding/server.js +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env node -require('./app').listen(3000); -console.log("Embedding example running at http://localhost:3000/"); \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/examples/error/app.js b/deps/.npm/connect/0.2.5/package/examples/error/app.js deleted file mode 100644 index 63af7c70..00000000 --- a/deps/.npm/connect/0.2.5/package/examples/error/app.js +++ /dev/null @@ -1,16 +0,0 @@ - -/** - * Module dependencies. - */ - -var connect = require('../../lib/connect'); - -var server = connect.createServer( - function(req, res, next){ - throw new Error('oh noes!'); - }, - connect.errorHandler({ showStack: true, dumpExceptions: true }) -); - -server.listen(3000); -console.log('Connect server listening on port 3000'); \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/examples/hello-world/app.js b/deps/.npm/connect/0.2.5/package/examples/hello-world/app.js deleted file mode 100644 index f655d5c5..00000000 --- a/deps/.npm/connect/0.2.5/package/examples/hello-world/app.js +++ /dev/null @@ -1,12 +0,0 @@ -// Note that even though this looks like a normal node http app, it's really a -// valid connect app using the connect middleware stack. - -var connect = require('../../lib/connect'); - -var server = connect.createServer(function(req, res){ - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.end('Hello World'); -}); - -server.listen(3000); -console.log('Connect server listening on port 3000'); \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/examples/less/app.js b/deps/.npm/connect/0.2.5/package/examples/less/app.js deleted file mode 100644 index ac7398ad..00000000 --- a/deps/.npm/connect/0.2.5/package/examples/less/app.js +++ /dev/null @@ -1,23 +0,0 @@ - -/** - * Module dependencies. - */ - -var connect = require('../../lib/connect'); - -var pub = __dirname + '/public'; - -/** - * Update development submodules (git submodule update --init) or - * comment out the next line if you have "less" installed. - */ - -require.paths.unshift(__dirname + '/../../support/less/lib'); - -var server = connect.createServer( - connect.compiler({ src: pub, enable: ['less'] }), - connect.staticProvider(pub) -); - -server.listen(3000); -console.log('Connect server listening on port 3000'); \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/examples/less/public/index.html b/deps/.npm/connect/0.2.5/package/examples/less/public/index.html deleted file mode 100644 index 89eee1b6..00000000 --- a/deps/.npm/connect/0.2.5/package/examples/less/public/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - - -

Wahoo!

- - \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/examples/less/public/style.less b/deps/.npm/connect/0.2.5/package/examples/less/public/style.less deleted file mode 100644 index ab3f00a1..00000000 --- a/deps/.npm/connect/0.2.5/package/examples/less/public/style.less +++ /dev/null @@ -1,8 +0,0 @@ - -@red: #cc0000; - -body { - font: 14px/1.4 "Lucida Grande", "Helvetica Nueue", Arial; - padding: 15px; - color: @red; -} \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/examples/lint/app.js b/deps/.npm/connect/0.2.5/package/examples/lint/app.js deleted file mode 100644 index ae98a0f5..00000000 --- a/deps/.npm/connect/0.2.5/package/examples/lint/app.js +++ /dev/null @@ -1,42 +0,0 @@ - -/** - * Module dependencies. - */ - -var connect = require('../../lib/connect'); - -var server = connect.createServer( - // No named params - function params(){ - arguments[2](); - }, - // Does not call next AND does not respond - function hang(req, res, next){ - // Call foo() instead so - // that our demo can still function. - var foo = next; - foo(); - - // All good - var ct = req.headers['content-type']; - }, - function allGood(req, res, next){ - // All good - next(); - }, - function reqHeaders(req, res, next){ - // Request headers are always normalized as - // lowercased by ryan's http parser. - var ct = req.headers['Content-Type']; - next(); - }, - function methodUppercase(req, res, next){ - // req.method should be uppercase - req.method = 'get'; - next(); - } -); - -server.use('/', connect.lint(server)); -server.listen(3000); -console.log('Connect server listening on port 3000'); \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/examples/multitouch/app.js b/deps/.npm/connect/0.2.5/package/examples/multitouch/app.js deleted file mode 100644 index 51fc9763..00000000 --- a/deps/.npm/connect/0.2.5/package/examples/multitouch/app.js +++ /dev/null @@ -1,65 +0,0 @@ -// NOTE: -// When testing this demo you need to ensure that the domain you're hosting -// it on is in the network section of the cache manifest (second argument) -// or the long-poll may not work. - -var connect = require('../../lib/connect'); -var root = __dirname + "/public"; - -var subscribers = []; - -function setupRoutes(app) { - var callbacks = []; - app.get("/:client_id", function (req, res, next) { - var localID = req.params.client_id; - function handler(sender, buffer) { - // Ignore responses to self - if (sender == localID) { - callbacks.push(handler); - return; - } - res.writeHead(200, { - "Content-Type": "application/json", - "Content-Length": buffer.length - }); - res.end(buffer); - } - callbacks.push(handler); - }); - app.post("/:client_id", function (req, res, next) { - var localID = req.params.client_id; - var message = new Buffer(JSON.stringify(req.body)); - for (var i = 0, l = callbacks.length; i < l; i++) { - callbacks[i](localID, message); - } - callbacks.splice(0, l); - res.writeHead(204, {}); - res.end(); - }); -} - -// Create a server with no initial setup -var server = connect.createServer(); - -// Add global filters -server.use("/", - connect.logger({format: ':method :url :status HTTP:http-version :remote-addr'}) -); - -// Serve dynamic responses -server.use("/stream", - connect.bodyDecoder(), - connect.router(setupRoutes) -); - -// Serve static resources -server.use("/", - connect.cacheManifest(root, ["http://localhost:3000/", "http://192.168.1.160:3000/"]), - connect.conditionalGet(), - connect.cache(), - connect.gzip(), - connect.staticProvider(root) -); - -server.listen(3000); -console.log('Connect server listening on port 3000'); diff --git a/deps/.npm/connect/0.2.5/package/examples/multitouch/public/client.js b/deps/.npm/connect/0.2.5/package/examples/multitouch/public/client.js deleted file mode 100644 index 20e414b5..00000000 --- a/deps/.npm/connect/0.2.5/package/examples/multitouch/public/client.js +++ /dev/null @@ -1,69 +0,0 @@ -var circles; -var localID = Math.floor(Math.random()*1024*1024); - -function longPoll() { - var req = new XMLHttpRequest(); - req.onreadystatechange = function(event) { - if (req.readyState == 4) { - if(req.status == 200) { - var message = JSON.parse(req.responseText); - for (var id in message.locs) { - circles[id].attr(message.locs[id]); - }; - longPoll(); - } else { - setTimeout(longPoll, 10000); - } - } - }; - req.open('GET', '/stream/' + localID, true); - req.send(); -} - -var pending = false; -var locs = {}; -function start() { - var R = Raphael(0, 0, "100%", "100%"), - r = R.circle(512, 200, 120).attr({fill: "hsb(0, 1, 1)", stroke: "none", opacity: 0.9}), - g = R.circle(328, 384, 120).attr({fill: "hsb(.3, 1, 1)", stroke: "none", opacity: 0.9}), - b = R.circle(696, 384, 120).attr({fill: "hsb(.6, 1, 1)", stroke: "none", opacity: 0.9}), - p = R.circle(512, 558, 120).attr({fill: "hsb(.8, 1, 1)", stroke: "none", opacity: 0.9}); - circles = [r, g, b, p]; - var start = function () { - this.ox = this.attr("cx"); - this.oy = this.attr("cy"); - this.animate({r: 150, opacity: 0.25}, 500, ">"); - }, - move = function (dx, dy) { - var loc = {cx: this.ox + dx, cy: this.oy + dy}; - this.attr(loc); - locs[this.id] = loc; - - function send() { - if (pending) { - return; - } - if (JSON.stringify(locs) === "{}") { - return; - } - var req = new XMLHttpRequest(); - req.onreadystatechange = function(event) { - pending = false; - setTimeout(send, 10); - }; - req.open('POST', '/stream/' + localID, true); - req.setRequestHeader("Content-Type", "application/json"); - req.send(JSON.stringify({sender: localID, locs: locs})); - pending = true; - locs = {}; - } - send(); - }, - up = function () { - this.animate({r: 120, opacity: 0.9}, 500, ">"); - }; - R.set(r, g, b, p).drag(move, start, up); - setTimeout(longPoll, 1000); -}; - -window.onload = start; diff --git a/deps/.npm/connect/0.2.5/package/examples/multitouch/public/favicon.ico b/deps/.npm/connect/0.2.5/package/examples/multitouch/public/favicon.ico deleted file mode 100644 index 79ddd5ab..00000000 Binary files a/deps/.npm/connect/0.2.5/package/examples/multitouch/public/favicon.ico and /dev/null differ diff --git a/deps/.npm/connect/0.2.5/package/examples/multitouch/public/index.html b/deps/.npm/connect/0.2.5/package/examples/multitouch/public/index.html deleted file mode 100644 index b4b1cc34..00000000 --- a/deps/.npm/connect/0.2.5/package/examples/multitouch/public/index.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - Node + Raphaël - - - - - -
- - \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/examples/multitouch/public/raphael.js b/deps/.npm/connect/0.2.5/package/examples/multitouch/public/raphael.js deleted file mode 100644 index 4a99e3ee..00000000 --- a/deps/.npm/connect/0.2.5/package/examples/multitouch/public/raphael.js +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Raphael 1.4.3 - JavaScript Vector Library - * - * Copyright (c) 2010 Dmitry Baranovskiy (http://raphaeljs.com) - * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license. - */ -Raphael=function(){function m(){if(m.is(arguments[0],U)){for(var a=arguments[0],b=Aa[K](m,a.splice(0,3+m.is(a[0],O))),c=b.set(),d=0,f=a[o];d

";if(ha.childNodes[o]!=2)return m.type=null;ha=null}m.svg=!(m.vml=m.type=="VML");G[p]=m[p];m._id=0;m._oid=0;m.fn={};m.is=function(a,b){b=ca.call(b);return b=="object"&&a===Object(a)||b=="undefined"&&typeof a==b||b=="null"&&a==null||ca.call(ob.call(a).slice(8,-1))==b};m.setWindow=function(a){X=a;C=X.document};function ra(a){if(m.vml){var b=/^\s+|\s+$/g;ra=T(function(d){var f;d=(d+s)[I](b, -s);try{var e=new X.ActiveXObject("htmlfile");e.write("");e.close();f=e.body}catch(g){f=X.createPopup().document.body}e=f.createTextRange();try{f.style.color=d;var h=e.queryCommandValue("ForeColor");h=(h&255)<<16|h&65280|(h&16711680)>>>16;return"#"+("000000"+h[N](16)).slice(-6)}catch(i){return"none"}})}else{var c=C.createElement("i");c.title="Rapha\u00ebl Colour Picker";c.style.display="none";C.body[y](c);ra=T(function(d){c.style.color=d;return C.defaultView.getComputedStyle(c,s).getPropertyValue("color")})}return ra(a)} -function qb(){return"hsb("+[this.h,this.s,this.b]+")"}function rb(){return this.hex}m.hsb2rgb=T(function(a,b,c){if(m.is(a,"object")&&"h"in a&&"s"in a&&"b"in a){c=a.b;b=a.s;a=a.h}var d;if(c==0)return{r:0,g:0,b:0,hex:"#000"};if(a>1||b>1||c>1){a/=255;b/=255;c/=255}d=~~(a*6);a=a*6-d;var f=c*(1-b),e=c*(1-b*a),g=c*(1-b*(1-a));a=[c,e,f,f,g,c,c][d];b=[g,c,c,e,f,f,g][d];d=[f,f,g,c,c,e,f][d];a*=255;b*=255;d*=255;c={r:a,g:b,b:d,toString:rb};a=(~~a)[N](16);b=(~~b)[N](16);d=(~~d)[N](16);a=a[I](ga,"0");b=b[I](ga, -"0");d=d[I](ga,"0");c.hex="#"+a+b+d;return c},m);m.rgb2hsb=T(function(a,b,c){if(m.is(a,"object")&&"r"in a&&"g"in a&&"b"in a){c=a.b;b=a.g;a=a.r}if(m.is(a,ea)){var d=m.getRGB(a);a=d.r;b=d.g;c=d.b}if(a>1||b>1||c>1){a/=255;b/=255;c/=255}var f=Y(a,b,c),e=$(a,b,c);d=f;if(e==f)return{h:0,s:0,b:f};else{var g=f-e;e=g/f;a=a==f?(b-c)/g:b==f?2+(c-a)/g:4+(a-b)/g;a/=6;a<0&&a++;a>1&&a--}return{h:a,s:e,b:d,toString:qb}},m);var sb=/,?([achlmqrstvxz]),?/gi,sa=/\s*,\s*/,tb={hs:1,rg:1};m._path2string=function(){return this.join(",")[I](sb, -"$1")};function T(a,b,c){function d(){var f=Array[p].slice.call(arguments,0),e=f[Q]("\u25ba"),g=d.cache=d.cache||{},h=d.count=d.count||[];if(g[z](e))return c?c(g[e]):g[e];h[o]>=1000&&delete g[h.shift()];h[E](e);g[e]=a[K](b,f);return c?c(g[e]):g[e]}return d}m.getRGB=T(function(a){if(!a||(a+=s).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1};if(a=="none")return{r:-1,g:-1,b:-1,hex:"none"};!(tb[z](a.substring(0,2))||a.charAt()=="#")&&(a=ra(a));var b,c,d,f,e;if(a=a.match(pb)){if(a[2]){d=da(a[2].substring(5), -16);c=da(a[2].substring(3,5),16);b=da(a[2].substring(1,3),16)}if(a[3]){d=da((e=a[3].charAt(3))+e,16);c=da((e=a[3].charAt(2))+e,16);b=da((e=a[3].charAt(1))+e,16)}if(a[4]){a=a[4][H](sa);b=A(a[0]);c=A(a[1]);d=A(a[2]);f=A(a[3])}if(a[5]){a=a[5][H](sa);b=A(a[0])*2.55;c=A(a[1])*2.55;d=A(a[2])*2.55;f=A(a[3])}if(a[6]){a=a[6][H](sa);b=A(a[0]);c=A(a[1]);d=A(a[2]);return m.hsb2rgb(b,c,d)}if(a[7]){a=a[7][H](sa);b=A(a[0])*2.55;c=A(a[1])*2.55;d=A(a[2])*2.55;return m.hsb2rgb(b,c,d)}a={r:b,g:c,b:d};b=(~~b)[N](16); -c=(~~c)[N](16);d=(~~d)[N](16);b=b[I](ga,"0");c=c[I](ga,"0");d=d[I](ga,"0");a.hex="#"+b+c+d;isFinite(A(f))&&(a.o=f);return a}return{r:-1,g:-1,b:-1,hex:"none",error:1}},m);m.getColor=function(a){a=this.getColor.start=this.getColor.start||{h:0,s:1,b:a||0.75};var b=this.hsb2rgb(a.h,a.s,a.b);a.h+=0.075;if(a.h>1){a.h=0;a.s-=0.2;a.s<=0&&(this.getColor.start={h:0,s:1,b:a.b})}return b.hex};m.getColor.reset=function(){delete this.start};var ub=/([achlmqstvz])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?\s*,?\s*)+)/ig, -vb=/(-?\d*\.?\d*(?:e[-+]?\d+)?)\s*,?\s*/ig;m.parsePathString=T(function(a){if(!a)return null;var b={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},c=[];if(m.is(a,U)&&m.is(a[0],U))c=ta(a);c[o]||(a+s)[I](ub,function(d,f,e){var g=[];d=ca.call(f);e[I](vb,function(h,i){i&&g[E](+i)});if(d=="m"&&g[o]>2){c[E]([f][M](g.splice(0,2)));d="l";f=f=="m"?"l":"L"}for(;g[o]>=b[d];){c[E]([f][M](g.splice(0,b[d])));if(!b[d])break}});c[N]=m._path2string;return c});m.findDotsAtSegment=function(a,b,c,d,f,e,g,h,i){var j=1-i,l= -D(j,3)*a+D(j,2)*3*i*c+j*3*i*i*f+D(i,3)*g;j=D(j,3)*b+D(j,2)*3*i*d+j*3*i*i*e+D(i,3)*h;var n=a+2*i*(c-a)+i*i*(f-2*c+a),r=b+2*i*(d-b)+i*i*(e-2*d+b),q=c+2*i*(f-c)+i*i*(g-2*f+c),k=d+2*i*(e-d)+i*i*(h-2*e+d);a=(1-i)*a+i*c;b=(1-i)*b+i*d;f=(1-i)*f+i*g;e=(1-i)*e+i*h;h=90-w.atan((n-q)/(r-k))*180/w.PI;(n>q||r1){B=w.sqrt(B);c=B*c;d=B*d}B=c*c;var L=d*d;B=(e==g?-1:1)*w.sqrt(w.abs((B*L-B*x*x-L*k*k)/(B*x*x+L*k*k)));e=B*c*x/d+(a+h)/2;var B= -B*-d*k/c+(b+i)/2,x=w.asin(((b-B)/d).toFixed(7));k=w.asin(((i-B)/d).toFixed(7));x=ak)x-=l*2;if(!g&&k>x)k-=l*2}l=k-x;if(w.abs(l)>n){q=k;l=h;L=i;k=x+n*(g&&k>x?1:-1);h=e+c*w.cos(k);i=B+d*w.sin(k);q=Qa(h,i,c,d,f,0,g,l,L,[k,q,e,B])}l=k-x;f=w.cos(x);e=w.sin(x);g=w.cos(k);k=w.sin(k);l=w.tan(l/4);c=4/3*c*l;l=4/3*d*l;d=[a,b];a=[a+c*e,b-l*f];b=[h+c*k,i-l*g];h=[h,i];a[0]=2*d[0]-a[0];a[1]=2*d[1]-a[1];if(j)return[a,b,h][M](q);else{q=[a,b,h][M](q)[Q]()[H](","); -j=[];h=0;for(i=q[o];h1000000000000&&(n=0.5);w.abs(i)>1000000000000&&(i=0.5);if(n>0&&n<1){n=la(a,b,c,d,f,e,g,h,n);q[E](n.x);r[E](n.y)}if(i> -0&&i<1){n=la(a,b,c,d,f,e,g,h,i);q[E](n.x);r[E](n.y)}i=e-2*d+b-(h-2*e+d);j=2*(d-b)-2*(e-d);l=b-d;n=(-j+w.sqrt(j*j-4*i*l))/2/i;i=(-j-w.sqrt(j*j-4*i*l))/2/i;w.abs(n)>1000000000000&&(n=0.5);w.abs(i)>1000000000000&&(i=0.5);if(n>0&&n<1){n=la(a,b,c,d,f,e,g,h,n);q[E](n.x);r[E](n.y)}if(i>0&&i<1){n=la(a,b,c,d,f,e,g,h,i);q[E](n.x);r[E](n.y)}return{min:{x:$[K](0,q),y:$[K](0,r)},max:{x:Y[K](0,q),y:Y[K](0,r)}}}),ua=T(function(a,b){var c=ka(a),d=b&&ka(b);a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null};b={x:0,y:0, -bx:0,by:0,X:0,Y:0,qx:null,qy:null};function f(q,k){var t;if(!q)return["C",k.x,k.y,k.x,k.y,k.x,k.y];!(q[0]in{T:1,Q:1})&&(k.qx=k.qy=null);switch(q[0]){case "M":k.X=q[1];k.Y=q[2];break;case "A":q=["C"][M](Qa[K](0,[k.x,k.y][M](q.slice(1))));break;case "S":t=k.x+(k.x-(k.bx||k.x));k=k.y+(k.y-(k.by||k.y));q=["C",t,k][M](q.slice(1));break;case "T":k.qx=k.x+(k.x-(k.qx||k.x));k.qy=k.y+(k.y-(k.qy||k.y));q=["C"][M](Pa(k.x,k.y,k.qx,k.qy,q[1],q[2]));break;case "Q":k.qx=q[1];k.qy=q[2];q=["C"][M](Pa(k.x,k.y,q[1], -q[2],q[3],q[4]));break;case "L":q=["C"][M](wa(k.x,k.y,q[1],q[2]));break;case "H":q=["C"][M](wa(k.x,k.y,q[1],k.y));break;case "V":q=["C"][M](wa(k.x,k.y,k.x,q[1]));break;case "Z":q=["C"][M](wa(k.x,k.y,k.X,k.Y));break}return q}function e(q,k){if(q[k][o]>7){q[k].shift();for(var t=q[k];t[o];)q.splice(k++,0,["C"][M](t.splice(0,6)));q.splice(k,1);i=Y(c[o],d&&d[o]||0)}}function g(q,k,t,L,B){if(q&&k&&q[B][0]=="M"&&k[B][0]!="M"){k.splice(B,0,["M",L.x,L.y]);t.bx=0;t.by=0;t.x=q[B][1];t.y=q[B][2];i=Y(c[o],d&& -d[o]||0)}}for(var h=0,i=Y(c[o],d&&d[o]||0);h0.5)*2-1;D(f-0.5,2)+D(e-0.5,2)>0.25&&(e=w.sqrt(0.25-D(f-0.5,2))*l+0.5)&&e!=0.5&&(e=e.toFixed(5)-1.0E-5*l)}return s});b=b[H](/\s*\-\s*/);if(d=="linear"){var h=b.shift();h=-A(h);if(isNaN(h))return null;h=[0,0,w.cos(h*w.PI/180),w.sin(h*w.PI/180)];var i=1/(Y(w.abs(h[2]),w.abs(h[3]))||1);h[2]*=i;h[3]*=i;if(h[2]<0){h[0]=-h[2];h[2]=0}if(h[3]<0){h[1]=-h[3];h[3]=0}}b=Ra(b);if(!b)return null; -i=a.getAttribute(aa);(i=i.match(/^url\(#(.*)\)$/))&&c.defs.removeChild(C.getElementById(i[1]));i=v(d+"Gradient");i.id="r"+(m._id++)[N](36);v(i,d=="radial"?{fx:f,fy:e}:{x1:h[0],y1:h[1],x2:h[2],y2:h[3]});c.defs[y](i);c=0;for(h=b[o];cb.height&&(b.height=e.y+e.height-b.y);e.x+e.width-b.x>b.width&&(b.width=e.x+e.width-b.x)}}a&&this.hide();return b};u[p].attr=function(a,b){if(this.removed)return this;if(a==null){a={};for(var c in this.attrs)if(this.attrs[z](c))a[c]=this.attrs[c];this._.rt.deg&&(a.rotation=this.rotate());(this._.sx!=1||this._.sy!= -1)&&(a.scale=this.scale());a.gradient&&a.fill=="none"&&(a.fill=a.gradient)&&delete a.gradient;return a}if(b==null&&m.is(a,ea)){if(a=="translation")return ya.call(this);if(a=="rotation")return this.rotate();if(a=="scale")return this.scale();if(a==aa&&this.attrs.fill=="none"&&this.attrs.gradient)return this.attrs.gradient;return this.attrs[a]}if(b==null&&m.is(a,U)){b={};c=0;for(var d=a.length;c1&&(a=1);f.opacity=a}b.fill&&(f.on=true);if(f.on==null||b.fill=="none")f.on=false;if(f.on&&b.fill)if(a=b.fill.match(Na)){f.src=a[1];f.type="tile"}else{f.color=m.getRGB(b.fill).hex;f.src= -s;f.type="solid";if(m.getRGB(b.fill).error&&(g.type in{circle:1,ellipse:1}||(b.fill+s).charAt()!="r")&&ma(g,b.fill)){d.fill="none";d.gradient=b.fill}}e&&c[y](f);f=c.getElementsByTagName("stroke")&&c.getElementsByTagName("stroke")[0];e=false;!f&&(e=f=R("stroke"));if(b.stroke&&b.stroke!="none"||b["stroke-width"]||b["stroke-opacity"]!=null||b["stroke-dasharray"]||b["stroke-miterlimit"]||b["stroke-linejoin"]||b["stroke-linecap"])f.on=true;(b.stroke=="none"||f.on==null||b.stroke==0||b["stroke-width"]== -0)&&(f.on=false);a=m.getRGB(b.stroke);f.on&&b.stroke&&(f.color=a.hex);a=((+d["stroke-opacity"]+1||2)-1)*((+d.opacity+1||2)-1)*((+a.o+1||2)-1);h=(A(b["stroke-width"])||1)*0.75;a<0&&(a=0);a>1&&(a=1);b["stroke-width"]==null&&(h=d["stroke-width"]);b["stroke-width"]&&(f.weight=h);h&&h<1&&(a*=h)&&(f.weight=1);f.opacity=a;b["stroke-linejoin"]&&(f.joinstyle=b["stroke-linejoin"]||"miter");f.miterlimit=b["stroke-miterlimit"]||8;b["stroke-linecap"]&&(f.endcap=b["stroke-linecap"]=="butt"?"flat":b["stroke-linecap"]== -"square"?"square":"round");if(b["stroke-dasharray"]){a={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};f.dashstyle=a[z](b["stroke-dasharray"])?a[b["stroke-dasharray"]]:s}e&&c[y](f)}if(g.type=="text"){f=g.paper.span.style;d.font&&(f.font=d.font);d["font-family"]&&(f.fontFamily=d["font-family"]);d["font-size"]&&(f.fontSize=d["font-size"]);d["font-weight"]&&(f.fontWeight=d["font-weight"]); -d["font-style"]&&(f.fontStyle=d["font-style"]);g.node.string&&(g.paper.span.innerHTML=(g.node.string+s)[I](/"));g.W=d.w=g.paper.span.offsetWidth;g.H=d.h=g.paper.span.offsetHeight;g.X=d.x;g.Y=d.y+F(g.H/2);switch(d["text-anchor"]){case "start":g.node.style["v-text-align"]="left";g.bbx=F(g.W/2);break;case "end":g.node.style["v-text-align"]="right";g.bbx=-F(g.W/2);break;default:g.node.style["v-text-align"]="center";break}}};ma=function(a,b){a.attrs=a.attrs|| -{};var c="linear",d=".5 .5";a.attrs.gradient=b;b=(b+s)[I](Ya,function(i,j,l){c="radial";if(j&&l){j=A(j);l=A(l);D(j-0.5,2)+D(l-0.5,2)>0.25&&(l=w.sqrt(0.25-D(j-0.5,2))*((l>0.5)*2-1)+0.5);d=j+P+l}return s});b=b[H](/\s*\-\s*/);if(c=="linear"){var f=b.shift();f=-A(f);if(isNaN(f))return null}var e=Ra(b);if(!e)return null;a=a.shape||a.node;b=a.getElementsByTagName(aa)[0]||R(aa);!b.parentNode&&a.appendChild(b);if(e[o]){b.on=true;b.method="none";b.color=e[0].color;b.color2=e[e[o]-1].color;a=[];for(var g=0, -h=e[o];g')}}catch(Kb){R=function(a){return C.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}Aa=function(){var a=Sa[K](0,arguments),b=a.container,c=a.height,d=a.width,f=a.x;a=a.y;if(!b)throw new Error("VML container not found.");var e=new G,g=e.canvas=C.createElement("div"),h=g.style;f=f||0;a=a||0;d=d||512; -c=c||342;d==+d&&(d+="px");c==+c&&(c+="px");e.width=1000;e.height=1000;e.coordsize=ja*1000+P+ja*1000;e.coordorigin="0 0";e.span=C.createElement("span");e.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";g[y](e.span);h.cssText=m.format("width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",d,c);if(b==1){C.body[y](g);h.left=f+"px";h.top=a+"px";h.position="absolute"}else b.firstChild?b.insertBefore(g, -b.firstChild):b[y](g);Fa.call(e,e,m.fn);return e};G[p].clear=function(){this.canvas.innerHTML=s;this.span=C.createElement("span");this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";this.canvas[y](this.span);this.bottom=this.top=null};G[p].remove=function(){this.canvas.parentNode.removeChild(this.canvas);for(var a in this)this[a]=Xa(a);return true}}G[p].safari=/^Apple|^Google/.test(X.navigator.vendor)&&(!(X.navigator.userAgent.indexOf("Version/4.0")+ -1)||X.navigator.platform.slice(0,2)=="iP")?function(){var a=this.rect(-99,-99,this.width+99,this.height+99);X.setTimeout(function(){a.remove()})}:function(){};function Db(){this.returnValue=false}function Eb(){return this.originalEvent.preventDefault()}function Fb(){this.cancelBubble=true}function Gb(){return this.originalEvent.stopPropagation()}var Hb=function(){if(C.addEventListener)return function(a,b,c,d){var f=Ba&&Ca[b]?Ca[b]:b;function e(g){if(Ba&&Ca[z](b))for(var h=0,i=g.targetTouches&&g.targetTouches.length;h< -i;h++)if(g.targetTouches[h].target==a){i=g;g=g.targetTouches[h];g.originalEvent=i;g.preventDefault=Eb;g.stopPropagation=Gb;break}return c.call(d,g)}a.addEventListener(f,e,false);return function(){a.removeEventListener(f,e,false);return true}};else if(C.attachEvent)return function(a,b,c,d){function f(g){g=g||X.event;g.preventDefault=g.preventDefault||Db;g.stopPropagation=g.stopPropagation||Fb;return c.call(d,g)}a.attachEvent("on"+b,f);function e(){a.detachEvent("on"+b,f);return true}return e}}();for(ha= -Ma[o];ha--;)(function(a){m[a]=u[p][a]=function(b){if(m.is(b,"function")){this.events=this.events||[];this.events.push({name:a,f:b,unbind:Hb(this.shape||this.node||C,a,b,this)})}return this};m["un"+a]=u[p]["un"+a]=function(b){for(var c=this.events,d=c[o];d--;)if(c[d].name==a&&c[d].f==b){c[d].unbind();c.splice(d,1);!c.length&&delete this.events;return this}return this}})(Ma[ha]);u[p].hover=function(a,b){return this.mouseover(a).mouseout(b)};u[p].unhover=function(a,b){return this.unmouseover(a).unmouseout(b)}; -u[p].drag=function(a,b,c){this._drag={};var d=this.mousedown(function(g){(g.originalEvent?g.originalEvent:g).preventDefault();this._drag.x=g.clientX;this._drag.y=g.clientY;this._drag.id=g.identifier;b&&b.call(this,g.clientX,g.clientY);Raphael.mousemove(f).mouseup(e)});function f(g){var h=g.clientX,i=g.clientY;if(Ba)for(var j=g.touches.length,l;j--;){l=g.touches[j];if(l.identifier==d._drag.id){h=l.clientX;i=l.clientY;(g.originalEvent?g.originalEvent:g).preventDefault();break}}else g.preventDefault(); -a&&a.call(d,h-d._drag.x,i-d._drag.y,h,i)}function e(){d._drag={};Raphael.unmousemove(f).unmouseup(e);c&&c.call(d)}return this};G[p].circle=function(a,b,c){return ab(this,a||0,b||0,c||0)};G[p].rect=function(a,b,c,d,f){return bb(this,a||0,b||0,c||0,d||0,f||0)};G[p].ellipse=function(a,b,c,d){return cb(this,a||0,b||0,c||0,d||0)};G[p].path=function(a){a&&!m.is(a,ea)&&!m.is(a[0],U)&&(a+=s);return Za(m.format[K](m,arguments),this)};G[p].image=function(a,b,c,d,f){return db(this,a||"about:blank",b||0,c||0, -d||0,f||0)};G[p].text=function(a,b,c){return eb(this,a||0,b||0,c||s)};G[p].set=function(a){arguments[o]>1&&(a=Array[p].splice.call(arguments,0,arguments[o]));return new Z(a)};G[p].setSize=fb;G[p].top=G[p].bottom=null;G[p].raphael=m;function ib(){return this.x+P+this.y}u[p].resetScale=function(){if(this.removed)return this;this._.sx=1;this._.sy=1;this.attrs.scale="1 1"};u[p].scale=function(a,b,c,d){if(this.removed)return this;if(a==null&&b==null)return{x:this._.sx,y:this._.sy,toString:ib};b=b||a;!+b&& -(b=a);var f,e,g=this.attrs;if(a!=0){var h=this.getBBox(),i=h.x+h.width/2,j=h.y+h.height/2;f=a/this._.sx;e=b/this._.sy;c=+c||c==0?c:i;d=+d||d==0?d:j;h=~~(a/w.abs(a));var l=~~(b/w.abs(b)),n=this.node.style,r=c+(i-c)*f;j=d+(j-d)*e;switch(this.type){case "rect":case "image":var q=g.width*h*f,k=g.height*l*e;this.attr({height:k,r:g.r*$(h*f,l*e),width:q,x:r-q/2,y:j-k/2});break;case "circle":case "ellipse":this.attr({rx:g.rx*h*f,ry:g.ry*l*e,r:g.r*$(h*f,l*e),cx:r,cy:j});break;case "text":this.attr({x:r,y:j}); -break;case "path":i=Oa(g.path);for(var t=true,L=0,B=i[o];L=i)return r;l=r}});function Ha(a,b){return function(c,d,f){c=ua(c); -for(var e,g,h,i,j="",l={},n=0,r=0,q=c.length;rd){if(b&&!l.start){e=jb(e,g,h[1],h[2],h[3],h[4],h[5],h[6],d-n);j+=["C",e.start.x,e.start.y,e.m.x,e.m.y,e.x,e.y];if(f)return j;l.start=j;j=["M",e.x,e.y+"C",e.n.x,e.n.y,e.end.x,e.end.y,h[5],h[6]][Q]();n+=i;e=+h[5];g=+h[6];continue}if(!a&&!b){e=jb(e,g,h[1],h[2],h[3],h[4],h[5],h[6],d-n);return{x:e.x,y:e.y,alpha:e.alpha}}}n+=i;e=+h[5];g=+h[6]}j+=h}l.end=j;e=a?n: -b?l:m.findDotsAtSegment(e,g,h[1],h[2],h[3],h[4],h[5],h[6],1);e.alpha&&(e={x:e.x,y:e.y,alpha:e.alpha});return e}}var Ib=T(function(a,b,c,d,f,e,g,h){for(var i={x:0,y:0},j=0,l=0;l<1.01;l+=0.01){var n=la(a,b,c,d,f,e,g,h,l);l&&(j+=D(D(i.x-n.x,2)+D(i.y-n.y,2),0.5));i=n}return j}),kb=Ha(1),za=Ha(),Ia=Ha(0,1);u[p].getTotalLength=function(){if(this.type=="path"){if(this.node.getTotalLength)return this.node.getTotalLength();return kb(this.attrs.path)}};u[p].getPointAtLength=function(a){if(this.type=="path")return za(this.attrs.path, -a)};u[p].getSubpath=function(a,b){if(this.type=="path"){if(w.abs(this.getTotalLength()-b)<1.0E-6)return Ia(this.attrs.path,a).end;b=Ia(this.attrs.path,b,1);return a?Ia(b,a).end:b}};m.easing_formulas={linear:function(a){return a},"<":function(a){return D(a,3)},">":function(a){return D(a-1,3)+1},"<>":function(a){a*=2;if(a<1)return D(a,3)/2;a-=2;return(D(a,3)+2)/2},backIn:function(a){var b=1.70158;return a*a*((b+1)*a-b)},backOut:function(a){a-=1;var b=1.70158;return a*a*((b+1)*a+b)+1},elastic:function(a){if(a== -0||a==1)return a;var b=0.3,c=b/4;return D(2,-10*a)*w.sin((a-c)*2*w.PI/b)+1},bounce:function(a){var b=7.5625,c=2.75;if(a<1/c)a=b*a*a;else if(a<2/c){a-=1.5/c;a=b*a*a+0.75}else if(a<2.5/c){a-=2.25/c;a=b*a*a+0.9375}else{a-=2.625/c;a=b*a*a+0.984375}return a}};var S={length:0};function lb(){var a=+new Date;for(var b in S)if(b!="length"&&S[z](b)){var c=S[b];if(c.stop||c.el.removed){delete S[b];S[o]--}else{var d=a-c.start,f=c.ms,e=c.easing,g=c.from,h=c.diff,i=c.to,j=c.t,l=c.prev||0,n=c.el,r=c.callback,q= -{},k;if(d' + user.name + ''; }).join('\n') - + ''; - res.writeHead(200, { - 'Content-Type': 'text/html', - 'Content-Length': body.length - }); - res.end(body); - - } - - }); - - app.get('/:id.:format', function(req, res, next){ - var user = users[req.params.id]; - if (user && req.params.format === 'json') { - user = JSON.stringify(user); - res.writeHead(200, { - 'Content-Type': 'application/json', - 'Content-Length': user.length - }); - res.end(user); - } else { - // When true is passed, provide control - // back to middleware, skipping route - // match attemps - next(true); - } - }); - - app.get('/:id/:op?', function(req, res){ - var body = users[req.params.id] - ? users[req.params.id].name - : 'User ' + req.params.id + ' does not exist'; - body = (req.params.op || 'view') + 'ing ' + body; - res.writeHead(200, { - 'Content-Type': 'text/html', - 'Content-Length': body.length - }); - res.end(body, 'utf8'); - }); -} - -function main(app){ - app.get('/', function(req, res){ - var examples = [ - '/users', - '/users.json', - '/users/0 (or /users/0/view)', - '/users/0/edit' - '/users/0.json' - ]; - var body = 'Visit one of the following:
    ' - + examples.map(function(str){ return '
  • ' + str + '
  • ' }).join('\n') - + '
'; - res.writeHead(200, { - 'Content-Type': 'text/html', - 'Content-Length': body.length - }); - res.end(body, 'utf8'); - }); -} - -var connect = require('./../../lib/connect'); - -var server = connect.createServer( - connect.logger({ buffer: true }) -); - -server.use("/users/", connect.router(user)); -server.use(connect.router(main)); -server.listen(3000); -console.log('Connect server listening on port 3000'); diff --git a/deps/.npm/connect/0.2.5/package/examples/sass/app.js b/deps/.npm/connect/0.2.5/package/examples/sass/app.js deleted file mode 100644 index 145a5f16..00000000 --- a/deps/.npm/connect/0.2.5/package/examples/sass/app.js +++ /dev/null @@ -1,25 +0,0 @@ - -/** - * Module dependencies. - */ - -var connect = require('../../lib/connect'); - -var pub = __dirname + '/public'; -var views = __dirname + '/views'; - -/** - * Update development submodules (git submodule update --init), - * or comment out the following line if you have "sass" installed. - */ - -require.paths.unshift(__dirname + '/../../support/sass/lib'); - -// To compile simply execute: -// $ curl http://localhost:3000/stylesheets/main.css - -connect.createServer( - connect.compiler({ src: views, dest: pub, enable: ['sass'] }), - connect.staticProvider(pub) -).listen(3000); -console.log('Connect server listening on port 3000'); \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/examples/sass/public/index.html b/deps/.npm/connect/0.2.5/package/examples/sass/public/index.html deleted file mode 100644 index 8c038854..00000000 --- a/deps/.npm/connect/0.2.5/package/examples/sass/public/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - - -

Wahoo!

- - \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/examples/sass/public/stylesheets/.gitignore b/deps/.npm/connect/0.2.5/package/examples/sass/public/stylesheets/.gitignore deleted file mode 100644 index e69de29b..00000000 diff --git a/deps/.npm/connect/0.2.5/package/examples/sass/views/stylesheets/main.sass b/deps/.npm/connect/0.2.5/package/examples/sass/views/stylesheets/main.sass deleted file mode 100644 index 0d6b9f65..00000000 --- a/deps/.npm/connect/0.2.5/package/examples/sass/views/stylesheets/main.sass +++ /dev/null @@ -1,4 +0,0 @@ -body - :padding 20px - :font 14px/1.3 "Lucida Grande", Arial, sans-serif - :text-shadow 2px 1px 2px rgba(0,0,0,0.2) \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/examples/session/app.js b/deps/.npm/connect/0.2.5/package/examples/session/app.js deleted file mode 100644 index 972c0204..00000000 --- a/deps/.npm/connect/0.2.5/package/examples/session/app.js +++ /dev/null @@ -1,65 +0,0 @@ - -/** - * Module dependencies. - */ - -var sys = require('sys'), - connect = require('./../../lib/connect'), - MemoryStore = connect.session.MemoryStore; - -// One minute -var minute = 60000; - -// Setup memory store -var memory = new connect.session.MemoryStore({ reapInterval: minute, maxAge: minute * 5 }); - -var server = connect.createServer( - connect.logger({ format: ':method :url' }), - connect.bodyDecoder(), - connect.cookieDecoder(), - connect.session({ store: memory, secret: 'foobar' }), - connect.router(app), - connect.errorHandler({ dumpExceptions: true, showStack: true }) -); - -server.listen(3000); -console.log('Connect server listening on port 3000'); - -function app(app) { - app.get('/', function(req, res){ - res.writeHead(200, { 'Content-Type': 'text/html' }); - // Fetch number of "online" users - req.sessionStore.length(function(err, n){ - // User joined - if (req.session.name) { - res.write('

Welcome ' + req.session.name + '

'); - // User has not "joined", display the form - } else { - res.write('
' - + 'Name: ' - + '' - + '
'); - } - - // Display online count - res.end('

Online: ' + n + '

'); - }); - }); - app.get('/logout', function(req, res){ - req.session.regenerate(function(err){ - res.writeHead(302, { Location: '/' }); - res.end(); - }); - }); - app.post('/', function(req, res){ - switch (req.body.op) { - case 'Join': - req.session.regenerate(function(err){ - var name = req.session.name = req.body.name; - res.writeHead(302, { Location: '/' }); - res.end(); - }); - break; - } - }); -} \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/examples/stack-middleware/app.js b/deps/.npm/connect/0.2.5/package/examples/stack-middleware/app.js deleted file mode 100644 index e27fe851..00000000 --- a/deps/.npm/connect/0.2.5/package/examples/stack-middleware/app.js +++ /dev/null @@ -1,18 +0,0 @@ - -/** - * Module dependencies. - */ - -var connect = require('./../../lib/connect'); - -var server = connect.createServer(); - -server.use('/', require('./hello')); -server.use('/my', require('./world')); -server.use('/', function(req, res){ - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.end('GET /hello or /my/world'); -}); - -server.listen(3000); -console.log('Connect server listening on port 3000'); \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/examples/stack-middleware/hello.js b/deps/.npm/connect/0.2.5/package/examples/stack-middleware/hello.js deleted file mode 100644 index 479fcc12..00000000 --- a/deps/.npm/connect/0.2.5/package/examples/stack-middleware/hello.js +++ /dev/null @@ -1,13 +0,0 @@ - -/** - * Module dependencies. - */ - -var Connect = require('./../../lib/connect'); - -var Server = module.exports = Connect.createServer(); - -Server.use('/hello', function(req, res){ - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.end('Hello'); -}); \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/examples/stack-middleware/world.js b/deps/.npm/connect/0.2.5/package/examples/stack-middleware/world.js deleted file mode 100644 index 0660b47f..00000000 --- a/deps/.npm/connect/0.2.5/package/examples/stack-middleware/world.js +++ /dev/null @@ -1,13 +0,0 @@ - -/** - * Module dependencies. - */ - -var Connect = require('./../../lib/connect'); - -var Server = module.exports = Connect.createServer(); - -Server.use('/world', function(req, res){ - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.end('World'); -}); \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/examples/static/app.js b/deps/.npm/connect/0.2.5/package/examples/static/app.js deleted file mode 100644 index 13d22744..00000000 --- a/deps/.npm/connect/0.2.5/package/examples/static/app.js +++ /dev/null @@ -1,13 +0,0 @@ - -/** - * Module dependencies. - */ - -var connect = require('./../../lib/connect'); - -// Visit /style.css - -connect.createServer( - connect.staticProvider(__dirname + '/public') -).listen(3000); -console.log('Connect server listening on port 3000'); \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/examples/static/public/style.css b/deps/.npm/connect/0.2.5/package/examples/static/public/style.css deleted file mode 100644 index 0e1e8ebb..00000000 --- a/deps/.npm/connect/0.2.5/package/examples/static/public/style.css +++ /dev/null @@ -1,3 +0,0 @@ -body { - color: #fff; -} \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/examples/staticGzip/app.js b/deps/.npm/connect/0.2.5/package/examples/staticGzip/app.js deleted file mode 100644 index c97e643d..00000000 --- a/deps/.npm/connect/0.2.5/package/examples/staticGzip/app.js +++ /dev/null @@ -1,18 +0,0 @@ - -/** - * Module dependencies. - */ - -var connect = require('../../lib/connect'); - -var server = connect.createServer( - connect.staticGzip({ root: __dirname, compress: ['text/css', 'text/html'] }), - connect.staticProvider({ root: __dirname }), - function(req, res){ - res.writeHead(200); - res.end('GET /test.css or GET /test.html'); - } -); - -server.listen(3000); -console.log('Connect server listening on port 3000'); \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/examples/staticGzip/test.css b/deps/.npm/connect/0.2.5/package/examples/staticGzip/test.css deleted file mode 100644 index 26b47fcf..00000000 --- a/deps/.npm/connect/0.2.5/package/examples/staticGzip/test.css +++ /dev/null @@ -1,195 +0,0 @@ -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} -body { - color: black; -} \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/examples/staticGzip/test.html b/deps/.npm/connect/0.2.5/package/examples/staticGzip/test.html deleted file mode 100644 index ece44b8b..00000000 --- a/deps/.npm/connect/0.2.5/package/examples/staticGzip/test.html +++ /dev/null @@ -1,44 +0,0 @@ - -> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/examples/url-rewrite/app.js b/deps/.npm/connect/0.2.5/package/examples/url-rewrite/app.js deleted file mode 100644 index 58a1c8db..00000000 --- a/deps/.npm/connect/0.2.5/package/examples/url-rewrite/app.js +++ /dev/null @@ -1,45 +0,0 @@ - -/** - * Module dependencies. - */ - -var sys = require('sys'), - connect = require('../../lib/connect'); - -/** - * Faux data. - */ - -var data = [1,2,3,4,5]; - -function format(req, res, next){ - if (/\.(\w+)$/.exec(req.url)) { - req.format = RegExp.$1; - req.originalUrl = req.url; - req.url = req.url.replace('.' + req.format, ''); - } - next(); -} - -function respond(req, res, next){ - var body = (function(){ - switch (req.format) { - case 'json': - return JSON.stringify(data); - case 'xml': - return '' + data.map(function(n){ - return '' + n + '' - }) + ''; - default: - return data.join(); - } - })(); - res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.end(body); -} - -connect.createServer( - format, - respond -).listen(3000); -console.log('Connect server listening on port 3000'); \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/examples/vhost/app.js b/deps/.npm/connect/0.2.5/package/examples/vhost/app.js deleted file mode 100644 index 15c1be29..00000000 --- a/deps/.npm/connect/0.2.5/package/examples/vhost/app.js +++ /dev/null @@ -1,26 +0,0 @@ - -/** - * Module dependencies. - */ - -var connect = require('./../../lib/connect'); - -var localhost = connect.vhost('localhost', connect.createServer(function(req, res){ - res.writeHead(200, {}); - res.end('local vhost'); -})); - -var dev = connect.vhost('dev', connect.createServer(function(req, res){ - res.writeHead(200, {}); - res.end('dev vhost'); -})); - -connect.createServer( - // Shared middleware - connect.logger(), - // http://localhost:3000 server with own middleware - localhost, - // http://dev:3000 server with own middleware - dev -).listen(3000); -console.log('Connect server listening on port 3000'); \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/install.sh b/deps/.npm/connect/0.2.5/package/install.sh deleted file mode 100755 index 8a676362..00000000 --- a/deps/.npm/connect/0.2.5/package/install.sh +++ /dev/null @@ -1,6 +0,0 @@ -mkdir /tmp/connect \ - && cd /tmp/connect \ - && curl -# -L http://github.com/senchalabs/connect/tarball/master \ - | tar xz --strip 1 \ - && make install \ - && echo "Installation complete" \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/lib/connect/index.js b/deps/.npm/connect/0.2.5/package/lib/connect/index.js deleted file mode 100644 index 2fc93798..00000000 --- a/deps/.npm/connect/0.2.5/package/lib/connect/index.js +++ /dev/null @@ -1,304 +0,0 @@ -/*! - * Ext JS Connect - * Copyright(c) 2010 Sencha Inc. - * MIT Licensed - */ - -/** - * Framework version. - */ -exports.version = '0.2.5'; - -/** - * Module dependencies. - */ -var sys = require('sys'), - fs = require('fs'), - Url = require('url'), - Path = require('path'), - http = require('http'), - assert = require('assert'); - -/** - * Default env for those who do not use _bin/connect_. - * - * @type Object - */ - -process.connectEnv = process.sparkEnv || { - name: process.env.CONNECT_ENV || 'development', - port: 3000, - host: null -}; - -/** - * Setup the given middleware layer callbacks. - * - * Examples: - * - * connect.createServer( - * connect.log(), - * connect.staticProvider(__dirname + '/public') - * ); - * - * var server = connect.createServer(); - * server.use('/', connect.log()); - * server.use('/', connect.static(__dirname + '/public')); - * - * @params {Function} ... - * @return {Server} - * @api public - */ - -var Server = exports.Server = function Server(layers) { - this.stack = []; - - // Stack layers - layers.forEach(function(layer){ - this.use("/", layer); - }, this); - - // Set up the request handler using the parent's constructor - http.Server.call(this, this.handle); -}; - -// Server is a subclass of http.Server -sys.inherits(Server, http.Server); - -/** - * Stack the given middleware `handle` to the given `route`. - * - * @param {String|Function} route or handle - * @param {Function} handle - * @return {Server} - * @api public - */ - -Server.prototype.use = function(route, handle){ - if (typeof route !== 'string') { - handle = route; - route = '/'; - } - - // Allow for more than one handle function to be added at a time - if (arguments.length > 2) { - Array.prototype.slice.call(arguments, 1).forEach(function (handle) { - this.use(route, handle); - }, this); - return this; - } - - // Wrap sub-apps - if (handle instanceof Server) { - var server = handle; - server.route = route; - handle = function(req, res, next) { - server.handle(req, res, next); - }; - } - - // Wrap vanilla http.Server instances too - // Maybe later we'll handle 404 and 500 responses and pass them to next() - // But for now, this is the end of the chain - if (handle instanceof http.Server) { - handle = handle.listeners('request')[0]; - } - - // Validate the input - if (!(typeof route === 'string' && typeof handle === 'function')) { - throw new Error("Each layer must have a route and a handle function"); - } - - // Normalize route to not trail with slash - if (route[route.length - 1] === '/') { - route = route.substr(0, route.length - 1); - } - - // Add the route, handle pair to the stack - this.stack.push({ route: route, handle: handle }); - - // Allow chaining - return this; -}; - - -/** - * Listen on the given `port` number, - * defaults to the current environment's port, - * or _3000_ when neither are present. - * - * @param {Number} port - * @param {String} host - * @return {Server} - * @api public - */ - -Server.prototype.listen = function(port, host) { - arguments[0] = port || process.connectEnv.port || 3000; - arguments[1] = host || process.connectEnv.host; - http.Server.prototype.listen.apply(this, arguments); - return this; -}; - - -/** - * Option to set "Server" and "X-Powered-By" headers - */ -Server.prototype.showVersion = true; - - -/** - * Handle server requests, punting them down - * the middleware stack. - * - * @api private - */ - -Server.prototype.handle = function(req, res, outerNext) { - var me = this, - writeHead = res.writeHead, - start = new Date, - removed = "", - stack = this.stack, - index = 0; - - res.writeHead = function (code, headers) { - var date = new Date; - res.writeHead = writeHead; - headers = headers || {}; - headers["Date"] = date.toUTCString(); - headers['X-Response-Time'] = (date - start) + "ms"; - if (me.showVersion) { - headers["X-Powered-By"] = "Connect " + exports.version; - headers["Server"] = "Node " + process.version; - } - res.writeHead(code, headers); - }; - - function next(err) { - // Put the prefix back on if it was removed - req.url = req.originalUrl = removed + req.url; - removed = ""; - - var layer = stack[index++]; - - // If we reached the end of the chain... - if (!layer) { - // ... and we're part of a bigger chain then forward to it. - if (outerNext) { - outerNext(err); - return; - } - // Otherwise send a proper error message to the browser. - if (err) { - var msg = process.connectEnv.name === 'production' - ? 'Internal Server Error' - : err.stack || err.toString(); - if (process.connectEnv.name !== 'test') { - sys.error(err.stack || err.toString()); - } - res.writeHead(500, { 'Content-Type': 'text/plain' }); - res.end(msg); - } else { - res.writeHead(404, { 'Content-Type': 'text/plain' }); - res.end('Cannot ' + req.method + ' ' + req.url); - } - return; - } - - try { - - var pathname = Url.parse(req.url).pathname; - if (pathname === undefined) pathname = '/'; - - // Skip this layer if the route doesn't match. - if (pathname.indexOf(layer.route) !== 0) { - next(err); - return; - } - - var nextChar = pathname[layer.route.length]; - if (nextChar && nextChar !== '/' && nextChar !== '.') { - next(err); - return; - } - - // Call the layer handler - // Trim off the part of the url that matches the route - removed = layer.route; - req.url = req.url.substr(removed.length); - - // Ensure leading slash - if (req.url[0] !== "/") { - req.url = "/" + req.url; - } - - var arity = layer.handle.length; - if (err) { - if (arity === 4) { - layer.handle(err, req, res, next); - } else { - next(err); - } - } else if (arity < 4) { - layer.handle(req, res, next); - } else { - next(); - } - } catch (e) { - if (e instanceof assert.AssertionError) { - sys.error(e.stack, '\n'); - next(e); - } else { - next(e); - } - } - } - next(); -}; - -/** - * Shortcut for `new connect.Server([ ... ])`. - * - * @param {Function} ... - * @param {Object} env - * @return {Server} - * @api public - */ - -exports.createServer = function() { - return new Server(Array.prototype.slice.call(arguments)); -}; - - -/** - * Auto-load getters. - */ - -exports.middleware = {}; - -/** - * Auto-load bundled middleware with getters. - */ - -fs.readdirSync(__dirname + '/middleware').forEach(function(filename){ - if (/\.js$/.test(filename)) { - var name = filename.substr(0, filename.lastIndexOf('.')); - Object.defineProperty(exports.middleware, name, { get: function(){ - return require('./middleware/' + name); - }}); - } -}); - -/** - * Expose getters as first-class exports. - */ - -exports.__proto__ = exports.middleware; - -/** - * Expose utils. - */ - -exports.utils = require('./utils'); - diff --git a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/bodyDecoder.js b/deps/.npm/connect/0.2.5/package/lib/connect/middleware/bodyDecoder.js deleted file mode 100644 index 1b6d4118..00000000 --- a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/bodyDecoder.js +++ /dev/null @@ -1,69 +0,0 @@ - -/*! - * Ext JS Connect - * Copyright(c) 2010 Sencha Inc. - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var queryString = require('querystring'); - -/** - * Extract the mime type from the given request's - * _Content-Type_ header. - * - * @param {IncomingMessage} req - * @return {String} - * @api private - */ - -function mime(req) { - var str = req.headers['content-type'] || ''; - return str.split(';')[0]; -} - -/** - * Decode request bodies. - * - * @return {Function} - * @api public - */ - -exports = module.exports = function bodyDecoder(){ - return function bodyDecoder(req, res, next) { - var decoder = exports.decode[mime(req)]; - if (decoder && !req.body) { - var data = ''; - req.setEncoding('utf8'); - req.addListener('data', function(chunk) { data += chunk; }); - req.addListener('end', function() { - req.rawBody = data; - try { - req.body = data - ? decoder(data) - : {}; - } catch (err) { - return next(err); - } - next(); - }); - } else { - next(); - } - } -}; - -/** - * Supported decoders. - * - * - application/x-www-form-urlencoded - * - application/json - */ - -exports.decode = { - 'application/x-www-form-urlencoded': queryString.parse, - 'application/json': JSON.parse -}; \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/cache.js b/deps/.npm/connect/0.2.5/package/lib/connect/middleware/cache.js deleted file mode 100644 index 2d6d3a13..00000000 --- a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/cache.js +++ /dev/null @@ -1,142 +0,0 @@ - -/*! - * Ext JS Connect - * Copyright(c) 2010 Sencha Inc. - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Buffer = require('buffer').Buffer; - -/** - * Cache in memory for the given `cacheDuration`. - * - * @param {Number} cacheDuration - * @return {Function} - * @api public - */ - -module.exports = function cache(cacheDuration){ - var cache = {}, - queue = {}; - - return function cache(req, res, next) { - - // Skip all requests that are not GET method - if (req.method !== "GET") { - next(); - return; - } - - var key = req.headers["accept-encoding"] + req.url, - writeHead = res.writeHead, - write = res.write, - end = res.end, - code, - headers, - chunks = [], - totalSize = 0; - - function serve() { - var resp = cache[key]; - var headers = resp.headers; - headers["Content-Length"] = resp.body.length; - if (!resp.body.length) resp.body = undefined; - - if (localQueue) { - // Send everyone in the wait queue the response. - for (var i = 0, l = localQueue.length; i < l; i++) { - var localRes = localQueue[i]; - localRes.writeHead(resp.code, headers); - localRes.end(resp.body); - } - // Kill the wait queue - delete queue[key]; - } else { - res.writeHead(resp.code, headers); - res.end(resp.body); - } - - } - - // If there is a cache-hit, serve it right away! - if (cache[key]) { - serve(); - return; - } - - var localQueue = queue[key]; - if (localQueue) { - localQueue[localQueue.length] = res; - return; - } - localQueue = queue[key] = [res]; - - // Defer the call to writeHead - res.writeHead = function (setCode, setHeaders) { - code = setCode; - headers = setHeaders; - }; - - // Buffer the response body as an array of Buffer objects - res.write = function (chunk, encoding) { - if (typeof chunk === 'string') { - var length; - if (!encoding || encoding === 'utf8') { - length = Buffer.byteLength(chunk); - } - var buffer = new Buffer(length); - buffer.write(chunk, encoding); - chunks.push(buffer); - } else { - chunks.push(chunk); - } - totalSize += chunk.length; - }; - - res.end = function (chunk, encoding) { - if (chunk && chunk.length) { - res.write(chunk, encoding); - } - - // Combine the buffer array into a single buffer - var body = new Buffer(totalSize); - var offset = 0; - chunks.forEach(function (chunk) { - chunk.copy(body, offset); - offset += chunk.length; - }); - - // Store the result in the cache - cache[key] = { - body: body, - code: code, - headers: headers - }; - - // Put the original methods back in place - res.writeHead = writeHead; - res.write = write; - res.end = end; - - // Serve the response from the cache - serve(); - - if (cacheDuration) { - // Expire the ram cache after 100ms or the specified length - setTimeout(function(){ - delete cache[key]; - }, cacheDuration); - } else { - // When the timeout is zero, just kill it right away - delete cache[key]; - } - - }; - - next(); - }; -}; \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/cacheManifest.js b/deps/.npm/connect/0.2.5/package/lib/connect/middleware/cacheManifest.js deleted file mode 100644 index daa336e4..00000000 --- a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/cacheManifest.js +++ /dev/null @@ -1,71 +0,0 @@ - -/*! - * Ext JS Connect 0.0.1 - * Copyright(c) 2010 Sencha Inc. - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var fs = require('fs'), - Utils = require('../utils'), - Url = require('url'), - Path = require('path'); - -/** - * Generate cache manifest for the given `root`, `networks`, - * and `fallbacks`. - * - * @param {String} root - * @param {Array} networks - * @param {Array} fallbacks - * @return {Function} - * @api public - */ - -module.exports = function cacheManifest(root, networks, fallbacks) { - root = root || process.cwd(); - var suffix = ""; - - // List of networks as an array of strings - if (networks) { - suffix += "\n\nNETWORK:\n" + networks.join("\n"); - } - - // List of fallbacks as key/value pairs - if (fallbacks) { - suffix += "\n\nFALLBACK:\n" + - fallbacks.map(function (second, first) { - return first + " " + second; - }).join("\n"); - } - - return function cacheManifest(req, res, next) { - if (Url.parse(req.url).pathname === "/cache.manifest") { - Utils.find(root, (/./), function (err, files) { - var latestMtime = 0; - files = files.map(function (entry) { - if (entry.mtime > latestMtime) { - latestMtime = entry.mtime; - } - return entry.path.substr(1); - }); - var manifest = "CACHE MANIFEST\n" - + "# " + latestMtime.toUTCString() + "\n" - + files.join("\n") - + suffix; - - res.writeHead(200, { - "Content-Type": "text/cache-manifest", - "Last-Modified": latestMtime.toUTCString(), - "Content-Length": manifest.length - }); - res.end(manifest); - }); - return; - } - next(); - }; -}; \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/compiler.js b/deps/.npm/connect/0.2.5/package/lib/connect/middleware/compiler.js deleted file mode 100644 index 8157fe8c..00000000 --- a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/compiler.js +++ /dev/null @@ -1,171 +0,0 @@ - -/*! - * Ext JS Connect - * Copyright(c) 2010 Sencha Inc. - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var fs = require('fs'), - path = require('path'), - url = require('url'); - -/** - * Setup compiler. - * - * Options: - * - * - `src` Source directory, defaults to **CWD**. - * - `dest` Destination directory, defaults `src`. - * - `enable` Array of enabled compilers. - * - * Compilers: - * - * - `sass` Compiles cass to css - * - `less` Compiles less to css - * - `coffeescript` Compiles coffee to js - * - * @param {Object} options - * @api public - */ - -exports = module.exports = function compiler(options){ - options = options || {}; - - var srcDir = process.connectEnv.compilerSrc || options.src || process.cwd(), - destDir = process.connectEnv.compilerDest || options.dest || srcDir, - enable = options.enable; - - if (!enable || enable.length === 0) { - throw new Error('compiler\'s "enable" option is not set, nothing will be compiled.'); - } - - return function compiler(req, res, next){ - if (req.method !== 'GET') return next(); - var pathname = url.parse(req.url).pathname; - for (var i = 0, len = enable.length; i < len; ++i) { - var name = enable[i], - compiler = compilers[name]; - if (compiler.match.test(pathname)) { - var src = (srcDir + pathname).replace(compiler.match, compiler.ext), - dest = destDir + pathname; - - // Compare mtimes - fs.stat(src, function(err, srcStats){ - if (err) { - if (err.errno === process.ENOENT) { - next(); - } else { - next(err); - } - } else { - fs.stat(dest, function(err, destStats){ - if (err) { - // Oh snap! it does not exist, compile it - if (err.errno === process.ENOENT) { - compile(); - } else { - next(err); - } - } else { - // Source has changed, compile it - if (srcStats.mtime > destStats.mtime) { - compile(); - } else { - // Defer file serving - next(); - } - } - }); - } - }); - - // Compile to the destination - function compile() { - fs.readFile(src, 'utf8', function(err, str){ - if (err) { - next(err); - } else { - compiler.compile(str, function(err, str){ - if (err) { - next(err); - } else { - fs.writeFile(dest, str, 'utf8', function(err){ - next(err); - }); - } - }); - } - }); - } - return; - } - } - next(); - }; -}; - -/** - * Bundled compilers: - * - * - [sass](http://github.com/visionmedia/sass.js) to _css_ - * - [less](http://github.com/cloudhead/less.js) to _css_ - * - [coffee](http://github.com/jashkenas/coffee-script) to _js_ - */ - -var compilers = exports.compilers = { - sass: { - match: /\.css$/, - ext: '.sass', - compile: function(str, fn){ - require.async('sass', function(err, sass){ - if (err) { - fn(err); - } else { - try { - fn(null, sass.render(str)); - } catch (err) { - fn(err); - } - } - }); - } - }, - less: { - match: /\.css$/, - ext: '.less', - compile: function(str, fn){ - require.async('less', function(err, less){ - if (err) { - fn(err); - } else { - try { - less.render(str, fn); - } catch (err) { - fn(err); - } - } - }); - } - }, - coffeescript: { - match: /\.js$/, - ext: '.coffee', - compile: function(str, fn){ - require.async('coffee-script', function(err, coffee){ - if (err) { - fn(err); - } else { - try { - fn(null, coffee.compile(str)); - } catch (err) { - fn(err); - } - } - }); - } - } -}; \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/conditionalGet.js b/deps/.npm/connect/0.2.5/package/lib/connect/middleware/conditionalGet.js deleted file mode 100644 index 4ae2f117..00000000 --- a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/conditionalGet.js +++ /dev/null @@ -1,71 +0,0 @@ - -/*! - * Ext JS Connect - * Copyright(c) 2010 Sencha Inc. - * MIT Licensed - */ - -/** - * Conditional GET request support. - * - * @return {Function} - * @api public - */ - -module.exports = function conditionalGet(){ - return function conditionalGet(req, res, next) { - // Skip all requests that are not conditional gets. - if (!(req.method === "GET" && - (req.headers["if-modified-since"] || req.headers["if-none-match"]) - )) { - next(); - return; - } - - var since = req.headers["if-modified-since"], - oldEtag = req.headers["if-none-match"], - writeHead = res.writeHead, - write = res.write, - end = res.end; - - since = since && Date.parse(since).valueOf(); - - res.writeHead = function (code, headers) { - var lastModified = headers["Last-Modified"], - etag = headers["ETag"]; - lastModified = lastModified && Date.parse(lastModified).valueOf(); - - // If there is no match, then move on. - if (!(code === 200 && - ((since && lastModified === since) || (etag && oldEtag === etag)) - )) { - res.writeHead = writeHead; - res.writeHead(code, headers); - return; - } - - // Ignore writes - res.write = function () {}; - - res.end = function () { - // Put the original functions back on. - res.writeHead = writeHead; - res.write = write; - res.end = end; - - // Filter out any Content based headers since there is no - // content. - var newHeaders = {}; - Object.keys(headers).forEach(function (key) { - if (key.indexOf("Content") < 0) { - newHeaders[key] = headers[key]; - } - }); - res.writeHead(304, newHeaders); - res.end(); - }; - }; - - next(); - }; -}; diff --git a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/cookieDecoder.js b/deps/.npm/connect/0.2.5/package/lib/connect/middleware/cookieDecoder.js deleted file mode 100644 index 1719e883..00000000 --- a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/cookieDecoder.js +++ /dev/null @@ -1,37 +0,0 @@ - -/*! - * Ext JS Connect - * Copyright(c) 2010 Sencha Inc. - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var utils = require('./../utils'); - -/** - * Parse _Cookie_ header and populate `req.cookies`. - * - * @return {Function} - * @api public - */ - -module.exports = function cookieDecoder(){ - return function cookieDecoder(req, res, next) { - var cookie = req.headers.cookie; - req.cookies = {}; - if (cookie) { - try { - req.cookies = utils.parseCookie(cookie); - delete req.headers.cookie; - } catch (err) { - // Ignore - } - next(); - } else { - next(); - } - }; -}; \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/errorHandler.js b/deps/.npm/connect/0.2.5/package/lib/connect/middleware/errorHandler.js deleted file mode 100644 index eaed0e40..00000000 --- a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/errorHandler.js +++ /dev/null @@ -1,91 +0,0 @@ - -/*! - * Ext JS Connect - * Copyright(c) 2010 Sencha Inc. - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var utils = require('./../utils'), - sys = require('sys'), - fs = require('fs'); - -/** - * Setup error handler with the given `options`. - * - * Options: - * - * - `showStack` respond with both the error message and stack trace. Defaults to `false` - * - `showMessage` respond with the exception message only. Defaults to `false` - * - `dumpExceptions` dump exceptions to stderr (without terminating the process). Defaults to `false` - * - * @param {Object} options - * @return {Function} - * @api public - */ - -module.exports = function errorHandler(options){ - options = options || {}; - - // Defaults - var showStack = options.showStack, - showMessage = options.showMessage, - dumpExceptions = options.dumpExceptions; - - // --showErrorStack - if (process.connectEnv.showErrorStack !== undefined) { - showStack = utils.toBoolean(process.connectEnv.showErrorStack); - } - - // --showErrorMessage - if (process.connectEnv.showErrorMessage !== undefined) { - showMessage = utils.toBoolean(process.connectEnv.showErrorMessage); - } - - // --dumpExceptions - if (process.connectEnv.dumpExceptions !== undefined) { - dumpExceptions = utils.toBoolean(process.connectEnv.dumpExceptions); - } - - return function errorHandler(err, req, res, next){ - if (dumpExceptions) { - sys.error(err.stack); - } - if (showStack) { - var accept = req.headers.accept || ''; - if (accept.indexOf('html') !== -1) { - fs.readFile(__dirname + '/../public/style.css', function(e, style){ - style = style.toString('ascii'); - fs.readFile(__dirname + '/../public/error.html', function(e, html){ - var stack = err.stack - .split('\n').slice(1) - .map(function(v){ return '
  • ' + v + '
  • '; }).join(''); - html = html - .toString('utf8') - .replace('{style}', style) - .replace('{stack}', stack) - .replace(/\{error\}/g, err.toString()); - res.writeHead(500, { 'Content-Type': 'text/html' }); - res.end(html); - }); - }); - } else if (accept.indexOf('json') !== -1) { - var json = JSON.stringify({ error: err }); - res.writeHead(500, { 'Content-Type': 'application/json' }); - res.end(json); - } else { - res.writeHead(500, { 'Content-Type': 'text/plain' }); - res.end(err.stack); - } - } else { - var body = showMessage - ? err.toString() - : 'Internal Server Error'; - res.writeHead(500, { 'Content-Type': 'text/plain' }); - res.end(body); - } - }; -}; diff --git a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/favicon.js b/deps/.npm/connect/0.2.5/package/lib/connect/middleware/favicon.js deleted file mode 100644 index 67f05087..00000000 --- a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/favicon.js +++ /dev/null @@ -1,69 +0,0 @@ - -/*! - * Ext JS Connect - * Copyright(c) 2010 Sencha Inc. - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var fs = require('fs'), - utils = require('../utils'); - -/** - * Favicon cache. - * - * @type Object - */ - -var icon; - -/** - * By default serves the connect favicon, or the favicon - * located by the given path. - * - * Examples: - * - * connect.createServer( - * connect.favicon() - * ); - * - * connect.createServer( - * connect.favicon(__dirname + '/public/favicon.ico') - * ); - * - * @param {String} path - * @return {Function} - * @api public - */ - -module.exports = function favicon(path){ - path = path || __dirname + '/../public/favicon.ico'; - return function favicon(req, res, next){ - if (req.url === '/favicon.ico') { - if (icon) { - res.writeHead(200, icon.headers); - res.end(icon.body); - } else { - fs.readFile(path, function(err, buf){ - if (err) return next(err); - icon = { - headers: { - 'Content-Type': 'image/x-icon', - 'Content-Length': buf.length, - 'ETag': utils.md5(buf), - 'Cache-Control': 'public max-age=3600' - }, - body: buf - } - res.writeHead(200, icon.headers); - res.end(icon.body); - }); - } - } else { - next(); - } - }; -}; \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/gzip-compress.js b/deps/.npm/connect/0.2.5/package/lib/connect/middleware/gzip-compress.js deleted file mode 100644 index 14c6f101..00000000 --- a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/gzip-compress.js +++ /dev/null @@ -1,77 +0,0 @@ - -/*! - * Ext JS Connect - * Copyright(c) 2010 Sencha Inc. - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var compress = require('compress'); - -/** - * Provides gzip compression via the node-compress library. - * - * @return {Function} - * @api public - */ - -module.exports = function gzip(){ - return function gzip(req, res, next) { - var writeHead = res.writeHead, - write = res.write, - end = res.end; - - res.writeHead = function (code, headers) { - var type = headers["Content-Type"], - accept = req.headers["accept-encoding"]; - - if (!(code === 200 && accept && accept.indexOf('gzip') >= 0 - && type && (/(text|javascript|json)/).test(type) - && headers["Content-Encoding"] === undefined)) { - res.writeHead = writeHead; - res.writeHead(code, headers); - return; - } - - headers["Content-Encoding"] = "gzip"; - delete headers["Content-Length"]; - - var gzip = new compress.GzipStream(); - - res.write = function (chunk, encoding) { - gzip.setInputEncoding(encoding); - gzip.write(chunk); - }; - - res.end = function (chunk, encoding) { - if (chunk) { - res.write(chunk, encoding); - } - gzip.close(); - }; - - gzip.addListener('data', function (chunk) { - write.call(res, chunk); - }); - gzip.addListener('error', function(err) { - res.write = write; - res.end = end; - next(err); - }); - gzip.addListener('end', function (code) { - res.write = write; - res.end = end; - res.end(); - }); - - res.writeHead = writeHead; - res.writeHead(code, headers); - - }; - - next(); - }; -}; \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/gzip-proc.js b/deps/.npm/connect/0.2.5/package/lib/connect/middleware/gzip-proc.js deleted file mode 100644 index 07cf9ac5..00000000 --- a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/gzip-proc.js +++ /dev/null @@ -1,73 +0,0 @@ - -/*! - * Ext JS Connect - * Copyright(c) 2010 Sencha Inc. - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var child_process = require('child_process'), - sys = require('sys'); - -/** - * Provides gzip compression via the `gzip` executable. - * - * @return {Function} - * @api public - */ - -module.exports = function gzip(){ - return function gzip(req, res, next) { - var writeHead = res.writeHead, - write = res.write, - end = res.end; - - res.writeHead = function (code, headers) { - var type = headers["Content-Type"], - accept = req.headers["accept-encoding"]; - - if (!(code === 200 && accept && accept.indexOf('gzip') >= 0 - && type && (/(text|javascript|json)/).test(type) - && headers["Content-Encoding"] === undefined)) { - res.writeHead = writeHead; - res.writeHead(code, headers); - return; - } - - headers["Content-Encoding"] = "gzip"; - delete headers["Content-Length"]; - - var gzip = child_process.spawn("gzip", ["-9"]); - - res.write = function (chunk, encoding) { - gzip.stdin.write(chunk, encoding); - }; - - res.end = function (chunk, encoding) { - if (chunk) { - res.write(chunk, encoding); - } - gzip.stdin.end(); - }; - - gzip.stdout.addListener('data', function (chunk) { - write.call(res, chunk); - }); - - gzip.addListener("exit", function (code) { - res.write = write; - res.end = end; - res.end(); - }); - - res.writeHead = writeHead; - res.writeHead(code, headers); - - }; - - next(); - }; -}; diff --git a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/gzip.js b/deps/.npm/connect/0.2.5/package/lib/connect/middleware/gzip.js deleted file mode 100644 index d71b52c3..00000000 --- a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/gzip.js +++ /dev/null @@ -1,8 +0,0 @@ -try { - module.exports = require('./gzip-compress'); -} catch (e) { - if (/^Cannot find module /.test(e.message)) - module.exports = require('./gzip-proc'); - else - throw e; -} \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/lint.js b/deps/.npm/connect/0.2.5/package/lib/connect/middleware/lint.js deleted file mode 100644 index 5884c7e5..00000000 --- a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/lint.js +++ /dev/null @@ -1,136 +0,0 @@ - -/*! - * Ext JS Connect - * Copyright(c) 2010 Sencha Inc. - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var connect = require('./../index'), - sys = require('sys'); - -/** - * Output the given warning message. - * - * @param {String} msg - * @api private - */ - -function warn(msg) { - sys.error('Warning: ' + msg); -} - -/** - * Setup lint for the given `server`. - * - * @return {Function} - * @api public - */ - -module.exports = function lint(server){ - - // Ensure a server is passed - if (!server) { - throw new Error('lint "server" must be passed.'); - } - - // Warn unless in development mode - if (process.connectEnv.name !== 'development') { - warn('"lint" middleware should never be enabled outside of the development environment'); - } - - // Check the stack - checkStack(server.stack); - - // Do nothing - return function(req, res, next){ - next(); - } -}; - -/** - * Validate middleware in the stack. - * - * @param {Array} stack - * @api private - */ - -function checkStack(stack) { - var layers = []; - stack.forEach(function(layer, i){ - if (layer.name !== 'lint') { - var handle = layer.handle, - handleParams = params(handle), - handleBody = contents(handle); - - function warn(msg) { - layers[i] = layer; - sys.error('Warning: layer \x1B[1m' + layer.handle.name - + '\x1B[0m:' + i + ' ' - + msg.replace(/\{(.*?)\}/g, '\x1B[1m$1\x1B[0m')); - } - - // Param names - - if (handleParams[0] !== 'req' && - handleParams[0] !== 'request') { - warn('First parameter should be named {req} or {request}, but is {' + handleParams[0] + '}'); - } - if (handleParams[1] !== 'res' && - handleParams[1] !== 'response') { - warn('Second parameter should be named {res} or {response}, but is {' + handleParams[1] + '}'); - } - if (handleParams[2] !== 'next') { - warn('Third parameter should be named {next}, but is {' + handleParams[2] + '}'); - } - - // Respond or call next() - - if (handleBody.indexOf('next(') === -1 && - handleBody.indexOf('writeHead') === -1) { - warn('Does not seem to call {next()}, or respond to the request'); - } - - // Check for request headers gotcha - - if (/req(uest)?\.headers\[("|')[A-Z]/.test(handleBody)) { - warn('Request headers are {lowercased}, seems to be accessed with {capitals}'); - } - } - }); - - // Output potentially problematic handlers - layers.forEach(function(layer, i){ - var str = layer.handle.toString(), - indents = str.match(/( *)\}$/)[1].length; - str = str.replace(new RegExp('^ {0,' + indents + '}', 'gm'), ' '); - sys.puts('\n' + i + ') \x1B[1m' + layer.handle.name + '\x1B[0m:', str); - }); -} - -/** - * Return the function body as a string. - * - * @param {Function} fn - * @return {String} - * @api private - */ - -function contents(fn){ - return fn.toString().match(/^[^\{]*{((.*\n*)*)}/m)[1]; -} - -/** - * Return array of function parameter names. - * - * @param {Function} fn - * @return {String} - * @api private - */ - -function params(fn){ - return fn.toString().match(/\((.*?)\)/)[1].match(/[\w]+/g) || []; -} \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/logger.js b/deps/.npm/connect/0.2.5/package/lib/connect/middleware/logger.js deleted file mode 100644 index 400ccddb..00000000 --- a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/logger.js +++ /dev/null @@ -1,141 +0,0 @@ - -/*! - * Ext JS Connect - * Copyright(c) 2010 Sencha Inc. - * MIT Licensed - */ - -/** - * Log buffer. - * - * @type Array - */ - -var buf = []; - -/** - * Default log buffer duration. - * - * @type Number - */ - -var defaultBufferDuration = 1000; - -/** - * Log requests with the given `options`. - * - * Options: - * - * - `format` Format string, see below for tokens - * - `stream` Output stream, defaults to _stdout_ - * - `buffer` Buffer duration, defaults to 1000ms when _true_ - * - * Tokens: - * - * - `:req[header]` ex: `:req[Accept]` - * - `:res[header]` ex: `:res[Content-Length]` - * - `:http-version` - * - `:response-time` - * - `:remote-addr` - * - `:date` - * - `:method` - * - `:url` - * - `:referrer` - * - `:user-agent` - * - `:status` - * - * @return {Function} - * @api public - */ - -module.exports = function logger(options) { - options = options || {}; - - var fmt = process.connectEnv.logFormat || options.format, - stream = options.stream || process.stdout, - buffer = options.buffer; - - // Buffering support - if (buffer) { - var realStream = stream; - setInterval(function(){ - if (buf.length) { - realStream.write(buf.join(''), 'ascii'); - buf.length = 0; - } - }, typeof buffer === 'number' ? buffer : defaultBufferDuration); - stream = { - write: function(str){ - buf.push(str); - } - }; - } - - return function logger(req, res, next) { - var start = +new Date, - statusCode, - resHeaders, - writeHead = res.writeHead, - end = res.end, - url = req.url; - - // Proxy for statusCode. - res.writeHead = function(code, headers){ - res.writeHead = writeHead; - res.writeHead(code, headers); - res.statusCode = statusCode = code; - res.headers = resHeaders = headers || {}; - }; - - // Proxy end to output a line to the provided logger. - if (fmt) { - res.end = function(chunk, encoding) { - res.end = end; - res.end(chunk, encoding); - res.responseTime = +new Date - start; - stream.write(format(fmt, req, res) + '\n', 'ascii'); - }; - } else { - res.end = function(chunk, encoding) { - res.end = end; - res.end(chunk, encoding); - - stream.write((req.socket && req.socket.remoteAddress) - + ' - - [' + (new Date).toUTCString() + ']' - + ' "' + req.method + ' ' + url - + ' HTTP/' + req.httpVersionMajor + '.' + req.httpVersionMinor + '" ' - + statusCode + ' ' + (resHeaders['Content-Length'] || '-') - + ' "' + (req.headers['referer'] || req.headers['referrer'] || '') - + '" "' + (req.headers['user-agent'] || '') + '"\n', 'ascii'); - }; - } - - // Fall through to the next layer. - next(); - }; - -}; - -/** - * Return formatted log line. - * - * @param {String} str - * @param {IncomingMessage} req - * @param {ServerResponse} res - * @return {String} - * @api private - */ -function format(str, req, res) { - return str - .replace(':url', req.url) - .replace(':method', req.method) - .replace(':status', res.statusCode) - .replace(':response-time', res.responseTime) - .replace(':date', new Date().toUTCString()) - .replace(':referrer', req.headers['referer'] || req.headers['referrer'] || '') - .replace(':http-version', req.httpVersionMajor + '.' + req.httpVersionMinor) - .replace(':remote-addr', req.socket && req.socket.remoteAddress) - .replace(':user-agent', req.headers['user-agent'] || '') - .replace(/:req\[([^\]]+)\]/g, function(_, header){ return req.headers[header]; }) - .replace(/:res\[([^\]]+)\]/g, function(_, header){ return res.headers[header]; }); -} \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/methodOverride.js b/deps/.npm/connect/0.2.5/package/lib/connect/middleware/methodOverride.js deleted file mode 100644 index 8042e776..00000000 --- a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/methodOverride.js +++ /dev/null @@ -1,54 +0,0 @@ - -/*! - * Ext JS Connect - * Copyright(c) 2010 Sencha Inc. - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var queryString = require('querystring'); - -/** - * Valid http methods. - * - * @type Array - */ - -var methods = ['GET', 'POST', 'PUT', 'HEAD', 'DELETE', 'OPTIONS']; - -/** - * Pass an optional `key` to use when checking for - * a method override, othewise defaults to __method_. - * - * @param {String} key - * @return {Function} - * @api public - */ - -module.exports = function methodOverride(key){ - key = key || "_method"; - return function methodOverride(req, res, next) { - var method = req.method; - - // Check req.body (bodyDecoder) - if (typeof req.body === 'object' && key in req.body) { - method = req.body[key]; - delete req.body[key]; - // Check X-HTTP-Method-Override - } else if (req.headers['x-http-method-override']) { - method = req.headers['x-http-method-override']; - } - - // Ensure method is valid, and normalize - method = method.toUpperCase(); - if (methods.indexOf(method) >= 0) { - req.method = method; - } - - next(); - }; -}; - diff --git a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/repl.js b/deps/.npm/connect/0.2.5/package/lib/connect/middleware/repl.js deleted file mode 100644 index b6031cc7..00000000 --- a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/repl.js +++ /dev/null @@ -1,43 +0,0 @@ - -/*! - * Ext JS Connect - * Copyright(c) 2010 Sencha Inc. - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var net = require('net'), - _repl = require('repl'); - -/** - * Start a **REPL** on the given unix domain `socket` path. - * - * Options: - * - * - `sockect` Unix domain socket path. Defaults to "/tmp/connect.sock" - * - `prompt` **REPL** prompt string. Defaults to "node> " - * - * Example: - * - * $ rlwrap telnet /tmp/connect.sock - * - * @param {String} prompt - * @param {String} socket path - * @return {Function} - * @api public - */ - -module.exports = function repl(prompt, socket){ - prompt = process.connectEnv.replPrompt || prompt || 'node> '; - socket = process.connectEnv.replSocket || socket || '/tmp/connect.sock'; - net.createServer(function(stream){ - _repl.start(prompt, stream); - }).listen(socket); - return function repl(req, res, next){ - // Pass through for now - next(); - } -}; diff --git a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/router.js b/deps/.npm/connect/0.2.5/package/lib/connect/middleware/router.js deleted file mode 100644 index 390ac5d6..00000000 --- a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/router.js +++ /dev/null @@ -1,166 +0,0 @@ - -/*! - * Ext JS Connect - * Copyright(c) 2010 Sencha Inc. - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var parse = require('url').parse, - querystring = require('querystring'); - -/** - * Provides Sinatra and Express like routing capabilities. - * - * Examples: - * - * connect.router(function(app){ - * app.get('/user/:id', function(req, res, next){ - * // populates req.params.id - * }); - * }) - * - * @param {Function} fn - * @return {Function} - * @api public - */ - -module.exports = function router(fn){ - var routes; - - if (fn) { - routes = {}; - fn.call(this, { - post: method.call(this, 'post'), - get: method.call(this, 'get'), - put: method.call(this, 'put'), - del: method.call(this, 'del') - }); - } else { - throw new Error('router provider requires a callback function'); - } - - function method(name) { - var self = this, - localRoutes = routes[name] = routes[name] || []; - return function(path, fn){ - var keys = []; - path = path instanceof RegExp - ? path - : normalizePath(path, keys); - localRoutes.push({ - fn: fn, - path: path, - keys: keys - }); - return self; - }; - } - - return function router(req, res, next){ - var route, - self = this; - (function pass(i){ - if (route = match(req, routes, i)) { - req.params = route._params; - try { - route.call(self, req, res, function(err){ - if (err === true) { - next(); - } else if (err) { - next(err); - } else { - pass(route._index+1); - } - }); - } catch (err) { - next(err); - } - } else { - next(); - } - })(); - }; -} - -/** - * Normalize the given path string, - * returning a regular expression. - * - * An empty array should be passed, - * which will contain the placeholder - * key names. For example "/user/:id" will - * then contain ["id"]. - * - * @param {String} path - * @param {Array} keys - * @return {RegExp} - * @api private - */ - -function normalizePath(path, keys) { - path = path - .concat('/?') - .replace(/\/\(/g, '(?:/') - .replace(/(\/)?(\.)?:(\w+)(\?)?/g, function(_, slash, format, key, optional){ - keys.push(key); - slash = slash || ''; - return '' - + (optional ? '' : slash) - + '(?:' - + (optional ? slash : '') - + (format || '') + '([^/.]+))' - + (optional || ''); - }) - .replace(/([\/.])/g, '\\$1') - .replace(/\*/g, '(.+)'); - return new RegExp('^' + path + '$', 'i'); -} - -/** - * Attempt to match the given request to - * one of the routes. When successful - * a route function is returned. - * - * @param {ServerRequest} req - * @param {Object} routes - * @return {Function} - * @api private - */ - -function match(req, routes, i) { - var captures, - method = req.method.toLowerCase(), - i = i || 0; - if ('delete' == method) method = 'del'; - if ('head' == method) method = 'get'; - if (routes = routes[method]) { - var url = parse(req.url), - pathname = url.pathname; - for (var len = routes.length; i < len; ++i) { - var route = routes[i], - fn = route.fn, - path = route.path, - keys = route.keys; - if (captures = path.exec(pathname)) { - fn._params = []; - for (var j = 1, len = captures.length; j < len; ++j) { - var key = keys[j-1], - val = typeof captures[j] === 'string' - ? querystring.unescape(captures[j]) - : captures[j]; - if (key) { - fn._params[key] = val; - } else { - fn._params.push(val); - } - } - fn._index = i; - return fn; - } - } - } -} \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/session.js b/deps/.npm/connect/0.2.5/package/lib/connect/middleware/session.js deleted file mode 100644 index a83cb167..00000000 --- a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/session.js +++ /dev/null @@ -1,149 +0,0 @@ - -/*! - * Ext JS Connect - * Copyright(c) 2010 Sencha Inc. - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Session = require('./session/session'), - utils = require('./../utils'); - -/** - * Setup session store with the given `options`. - * - * Options: - * - * - `store` Session store instance - * - `fingerprint` Custom fingerprint generating function - * - * @param {Object} options - * @return {Function} - * @api public - */ - -exports = module.exports = function sessionSetup(options){ - options = options || {}; - - // The cookie key to store the session id in. - var key = options.key || 'connect.sid'; - - // Default memory store - var store = options.store || new (require('./session/memory')); - - // Used to verify session ids / defaults to user agent - var fingerprint = options.fingerprint || function fingerprint(req) { - return req.headers['user-agent'] || ''; - }; - - // This should be set by the app to make the session key tamper proof - var secret = options.secret || "hackme"; - - return function sessionHandle(req, res, next) { - - if (!req.cookies) { - next(new Error("session requires cookieDecoder to work properly")); - return; - } - - // Wrap writeHead as a hook to save the session and send the cookie - var writeHead = res.writeHead; - res.writeHead = function(status, headers){ - - // Update the session in the store if there is one - if (req.session) { - req.session.touch(); - store.set(req.sessionID, req.session); - } - - // Send an updated cookie to the browser - store.cookie.expires = new Date(Date.now() + store.maxAge); - - // Multiple Set-Cookie headers - headers = headers || {}; - var cookie = utils.serializeCookie(key, req.sessionID, store.cookie); - if (headers['Set-Cookie']) { - headers['Set-Cookie'] += '\r\nSet-Cookie: ' + cookie; - } else { - headers['Set-Cookie'] = cookie; - } - - // Pass through the writeHead call - res.writeHead = writeHead; - return res.writeHead(status, headers); - }; - - // Calculates the security hash to prevent session hijacking - // Uses information on the user-agent that created the session as it's fingerprint - function hash(base) { - return utils.md5(base + fingerprint(req) + secret, 'base64').replace(/=*$/, ''); - } - - // Generates the new session - var generate = store.generate = function(){ - var base = utils.uid(); - var sessionID = base + "." + hash(base); - req.session = new Session(req, sessionID); - req.sessionID = sessionID; - }; - - // Expose store - req.sessionStore = store; - - // Get the sessionID from the cookie - req.sessionID = req.cookies[key]; - - // Make a new session if the browser doesn't send a sessionID - if (!req.sessionID) { - generate(); - next(); - return; - } - - // Check the fingerprint - var parts = req.sessionID.split('.'); - if (parts[1] !== hash(parts[0])) { - // Make a new session if it doesn't check out - generate(); - next(); - return; - } - - // Generate the session object - store.get(req.sessionID, function (err, sess) { - // Error/missing handling - if (err) { - if (err.errno === process.ENOENT) { - // If the session ID is invalid, generate a new session - generate(); - next(); - } else { - // Otherwise pass the exception along - next(err); - } - return; - } - if (!sess) { - // Some stores use a falsy result to signify no result - generate(); - next(); - return; - } - - // Load the session into the request - req.session = new Session(req, sess); - next(); - }); - }; -}; - -/** - * Expose constructors. - */ - -exports.Session = Session; -exports.Store = require('./session/store'); -exports.MemoryStore = require('./session/memory'); diff --git a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/session/memory.js b/deps/.npm/connect/0.2.5/package/lib/connect/middleware/session/memory.js deleted file mode 100644 index 39850d5d..00000000 --- a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/session/memory.js +++ /dev/null @@ -1,141 +0,0 @@ - -/*! - * Ext JS Connect - * Copyright(c) 2010 Sencha Inc. - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var sys = require('sys'), - Store = require('./store'), - utils = require('./../../utils'), - Session = require('./session'); - -/** - * Initialize MemoryStore with the given options. - * - * @param {Object} options - * @api public - */ - -var MemoryStore = module.exports = function MemoryStore(options) { - options = options || {}; - Store.call(this, options); - this.sessions = {}; - - // Default reapInterval to 10 minutes - this.reapInterval = options.reapInterval || 600000; - - // Reap stale sessions - if (this.reapInterval !== -1) { - setInterval(function(self){ - self.reap(self.maxAge); - }, this.reapInterval, this); - } -}; - -sys.inherits(MemoryStore, Store); - -/** - * Reap sessions older than the give milliseconds. - * - * @param {Number} ms - * @api private - */ - -MemoryStore.prototype.reap = function(ms){ - var threshold = +new Date - ms, - keys = Object.keys(this.sessions); - for (var i = 0, len = keys.length; i < len; ++i) { - var key = keys[i], - sess = this.sessions[key]; - if (sess.lastAccess < threshold) { - delete this.sessions[key]; - } - } -}; - -/** - * Attempt to fetch session by the given `sid`. - * - * @param {String} sid - * @param {Function} fn - * @api public - */ - -MemoryStore.prototype.get = function(sid, fn){ - if (sid in this.sessions) { - fn(null, this.sessions[sid]); - } else { - fn(); - } -}; - -/** - * Commit the given `sess` object associated with the given `sid`. - * - * @param {String} sid - * @param {Session} sess - * @param {Function} fn - * @api public - */ - -MemoryStore.prototype.set = function(sid, sess, fn){ - this.sessions[sid] = sess; - fn && fn(); -}; - -/** - * Destroy the session associated with the given `sid`. - * - * @param {String} sid - * @api public - */ - -MemoryStore.prototype.destroy = function(sid, fn){ - delete this.sessions[sid]; - fn && fn(); -}; - - -/** - * Invoke the given callback `fn` with all active sessions. - * - * @param {Function} fn - * @api public - */ - -MemoryStore.prototype.all = function(fn){ - var arr = [], - keys = Object.keys(this.sessions); - for (var i = 0, len = keys.length; i < len; ++i) { - arr.push(this.sessions[keys[i]]); - } - fn(null, arr); -}; - -/** - * Clear all sessions. - * - * @param {Function} fn - * @api public - */ - -MemoryStore.prototype.clear = function(fn){ - this.sessions = {}; - fn && fn(); -}; - -/** - * Fetch number of sessions. - * - * @param {Function} fn - * @api public - */ - -MemoryStore.prototype.length = function(fn){ - fn(null, Object.keys(this.sessions).length); -}; diff --git a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/session/session.js b/deps/.npm/connect/0.2.5/package/lib/connect/middleware/session/session.js deleted file mode 100644 index a63d5b5c..00000000 --- a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/session/session.js +++ /dev/null @@ -1,63 +0,0 @@ - -/*! - * Ext JS Connect - * Copyright(c) 2010 Sencha Inc. - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var utils = require('./../../utils'); - -/** - * Create a new `Session` with the given request and `data`. - * - * @param {IncomingRequest} req - * @param {Object} data - * @api private - */ - -var Session = module.exports = function Session(req, data) { - Object.defineProperty(this, 'req', { value: req }); - if (typeof data === 'object') { - utils.merge(this, data); - } else { - this.touch(); - } -}; - -/** - * Update lastAccess timestamp. - * - * @api public - */ - -Session.prototype.touch = function(){ - this.lastAccess = +new Date; -}; - -/** - * Destroy `this` session. - * - * @param {Function} fn - * @api public - */ - -Session.prototype.destroy = function(fn){ - delete this.req.session; - this.req.sessionStore.destroy(this.req.sessionID, fn); -}; - -/** - * Regenerate this request's session. - * - * @param {Function} fn - * @api public - */ - -Session.prototype.regenerate = function(fn){ - this.req.sessionStore.regenerate(this.req, fn); -}; - diff --git a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/session/store.js b/deps/.npm/connect/0.2.5/package/lib/connect/middleware/session/store.js deleted file mode 100644 index 69e17728..00000000 --- a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/session/store.js +++ /dev/null @@ -1,58 +0,0 @@ - -/*! - * Ext JS Connect - * Copyright(c) 2010 Sencha Inc. - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Session = require('./session'), - utils = require('./../../utils'); - -/** - * Initialize abstract Store. - * - * @api private - */ - -var Store = module.exports = function Store(options) { - options = options || {}; - - // Default maxAge to 4 hours - this.maxAge = options.maxAge || 14400000; - - // Cookie options - this.cookie = utils.merge({ path: '/', httpOnly: true }, options.cookie); -}; - -/** - * Destroy session associated with the given `sid` - * by passing `null` to `Store#get()`. - * - * @param {String} sid - * @param {Function} fn - * @api public - */ - -Store.prototype.destroy = function(sid, fn){ - this.set(sid, null, fn); -}; - -/** - * Re-generate the given requests's session. - * - * @param {IncomingRequest} req - * @return {Function} fn - * @api public - */ - -Store.prototype.regenerate = function(req, fn){ - var self = this; - this.destroy(req.sessionID, function(err, destroyed){ - self.generate(); - fn(err, destroyed); - }); -}; \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/staticGzip.js b/deps/.npm/connect/0.2.5/package/lib/connect/middleware/staticGzip.js deleted file mode 100644 index 79629fd3..00000000 --- a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/staticGzip.js +++ /dev/null @@ -1,147 +0,0 @@ - -/*! - * Ext JS Connect - * Copyright(c) 2010 Sencha Inc. - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var fs = require('fs'), - parse = require('url').parse - utils = require('../utils'), - path = require('path'), - exec = require('child_process').exec; - -/** - * Expose staticGzip as the module. - */ - -exports = module.exports = staticGzip; - -/** - * Gzip binary. - * - * @type String - */ - -exports.bin = 'gzip'; - -/** - * Flags passed to gzip. - * - * @type String - */ - -exports.flags = '--best'; - -/** - * staticGzip gzips statics via whitelist of mime types specified - * by the `compress` option. Once created `staticProvider` can continue - * on to serve the gzipped version of the file. - * - * Options: - * - * - `root` Root direction from which to generate gzipped statics - * - `compress` Array of mime types serving as a whitelist - * - `flags` String of flags passed to the binary - * - `bin` Binary executable defaulting to "gzip" - * - * @param {Object} options - * @api public - */ - -function staticGzip(options){ - var options = options || {}, - root = options.root, - compress = options.compress, - flags = options.flags || exports.flags, - bin = options.bin || exports.bin; - - if (!root) throw new Error('staticGzip root must be set'); - if (!compress) throw new Error('staticGzip compress array must be passed'); - - return function(req, res, next){ - if (req.method !== 'GET') return next(); - - var acceptEncoding = req.headers['accept-encoding'] || ''; - - // Ignore when Accept-Encoding does not allow gzip - if (acceptEncoding && !~acceptEncoding.indexOf('gzip')) return next(); - - // Parse the url - var url = parse(req.url), - filename = path.join(root, url.pathname), - mime = utils.mime.type(filename).split(';')[0]; - - // MIME type not white-listed - if (!~compress.indexOf(mime)) return next(); - - // Check if gzipped static is available - gzipped(filename, function(err, path, ext){ - if (err && err.errno === process.ENOENT) { - next(); - // We were looking for a gzipped static, - // so lets gzip it! - if (err.path.indexOf('.gz') === err.path.length - 3) { - gzip(filename, path, flags, bin); - } - } else if (err) { - next(err); - } else { - // Re-write the url to serve the gzipped static - req.url = url.pathname + ext; - var writeHead = res.writeHead; - res.writeHead = function(status, headers){ - headers = headers || {}; - res.writeHead = writeHead; - headers['Content-Type'] = mime; - headers['Content-Encoding'] = 'gzip'; - res.writeHead(status, headers); - }; - next(); - } - }); - } -}; - -/** - * Check for a gzipped version of the file at `path`. - * - * @param {String} path - * @param {Function} fn - * @api private - */ - -function gzipped(path, fn) { - fs.stat(path, function(err, stat){ - if (err) return fn(err); - var ext = '.' + Number(stat.mtime) + '.gz'; - path += ext; - fs.stat(path, function(err){ - fn(err, path, ext); - }); - }); -}; - -/** - * Gzip `src` to `dest`. - * - * @param {String} src - * @param {String} dest - * @param {String} flags - * @param {String} bin - * @api private - */ - -function gzip(src, dest, flags, bin) { - var cmd = bin + ' ' + flags + ' -c ' + src + ' > ' + dest; - exec(cmd, function(err, stdout, stderr){ - if (err) { - console.error('\n' + err.stack); - fs.unlink(dest); - } - }); -}; \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/staticProvider.js b/deps/.npm/connect/0.2.5/package/lib/connect/middleware/staticProvider.js deleted file mode 100644 index 8e4e2c64..00000000 --- a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/staticProvider.js +++ /dev/null @@ -1,96 +0,0 @@ - -/*! - * Ext JS Connect - * Copyright(c) 2010 Sencha Inc. - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var fs = require('fs'), - Path = require('path'), - utils = require('../utils'), - Buffer = require('buffer').Buffer, - parseUrl = require('url').parse, - queryString = require('querystring'); - -/** - * Default browser cache maxAge of one year. - */ - -const MAX_AGE = 31536000; - -/** - * Static file server. - * - * Options: - * - * - `root` Root path from which to serve static files. - * - `maxAge` Browser cache maxAge - * - * @param {Object} options - * @return {Function} - * @api public - */ - -module.exports = function staticProvider(options){ - var maxAge, - root; - - // Support options object and root string - if (typeof options == 'string') { - root = options; - maxAge = MAX_AGE; - } else { - options = options || {}; - maxAge = options.maxAge === undefined - ? MAX_AGE - : options.maxAge; - root = process.connectEnv.staticRoot || options.root || process.cwd(); - } - - return function staticProvider(req, res, next) { - if (req.method !== 'GET') return next(); - - var url = parseUrl(req.url), - pathname = url.pathname.replace(/\.\.+/g, '.'), - filename = Path.join(root, queryString.unescape(pathname)); - - if (filename[filename.length - 1] === '/') { - filename += "index.html"; - } - - fs.stat(filename, function(err, stat){ - - // Pass through for missing files, thow error for other problems - if (err) { - return err.errno === process.ENOENT - ? next() - : next(err); - } else if (stat.isDirectory()) { - return next(); - } - - // Serve the file directly using buffers - function onRead(err, data) { - if (err) return next(err); - - // Zero length buffers act funny, use a string - if (data.length === 0) data = ''; - - res.writeHead(200, { - "Content-Type": utils.mime.type(filename), - "Content-Length": data.length, - "Last-Modified": stat.mtime.toUTCString(), - "Cache-Control": "public max-age=" + maxAge - }); - res.end(data); - } - - fs.readFile(filename, onRead); - }); - }; - -}; diff --git a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/vhost.js b/deps/.npm/connect/0.2.5/package/lib/connect/middleware/vhost.js deleted file mode 100644 index 054b1da8..00000000 --- a/deps/.npm/connect/0.2.5/package/lib/connect/middleware/vhost.js +++ /dev/null @@ -1,43 +0,0 @@ - -/*! - * Ext JS Connect - * Copyright(c) 2010 Sencha Inc. - * MIT Licensed - */ - -/** - * Setup vhost for the given `hostname` and `server`. - * - * Examples: - * - * connect.createServer( - * connect.vhost('foo.com', - * connect.createServer(...middleware...) - * ), - * connect.vhost('bar.com', - * connect.createServer(...middleware...) - * ) - * ); - * - * @param {String} hostname - * @param {Server} server - * @return {Function} - * @api public - */ - -module.exports = function vhost(hostname, server){ - if (!hostname) { - throw new Error('vhost hostname required'); - } - if (!server) { - throw new Error('vhost server required'); - } - return function vhost(req, res, next){ - var host = req.headers.host.split(':')[0]; - if (host === hostname) { - server.handle(req, res); - } else { - next(); - } - }; -}; \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/lib/connect/public/error.html b/deps/.npm/connect/0.2.5/package/lib/connect/public/error.html deleted file mode 100644 index ea86aa3a..00000000 --- a/deps/.npm/connect/0.2.5/package/lib/connect/public/error.html +++ /dev/null @@ -1,13 +0,0 @@ - - - {error} - - - -
    -

    Connect

    -

    500 {error}

    -
      {stack}
    -
    - - \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/lib/connect/public/favicon.ico b/deps/.npm/connect/0.2.5/package/lib/connect/public/favicon.ico deleted file mode 100644 index 895fc96a..00000000 Binary files a/deps/.npm/connect/0.2.5/package/lib/connect/public/favicon.ico and /dev/null differ diff --git a/deps/.npm/connect/0.2.5/package/lib/connect/public/style.css b/deps/.npm/connect/0.2.5/package/lib/connect/public/style.css deleted file mode 100644 index ebf85300..00000000 --- a/deps/.npm/connect/0.2.5/package/lib/connect/public/style.css +++ /dev/null @@ -1,98 +0,0 @@ -body { - font: 13px "Helvetica Neue", "Lucida Grande", "Arial"; - text-align: center; - background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#ECE9E9)); - color: #555; - -webkit-text-stroke: 1px rgba(255, 255, 255, 0.1); -} -h1, h2, h3 { - margin: 0; - font-size: 22px; - color: #343434; -} -h1 em, h2 em { - padding: 0 5px; - font-weight: normal; -} -h1 { - text-shadow: 1px 2px 2px #ddd; - font-size: 60px; -} -h2 { - margin-top: 10px; -} -h3 { - margin: 5px 0 10px 0; - padding-bottom: 5px; - border-bottom: 1px solid #eee; - font-size: 18px; -} -ul { - margin: 0; - padding: 0; -} -ul li { - margin: 5px 0; - padding: 3px 8px; - list-style: none; - border: 1px solid #eee; - -webkit-border-radius: 3px; - -mox-border-radius: 3px; - -webkit-transition-property: color, padding; - -webkit-transition-duration: 0.1s; -} -ul li:hover { - padding: 3px 20px; - cursor: pointer; - color: #2E2E2E; -} -ul li .path { - padding-left: 5px; - font-weight: bold; -} -ul li .line { - padding-right: 5px; - font-style: italic; -} -ul li:first-child .path { - padding-left: 0; -} -p { - line-height: 1.5; -} -pre { - margin: 0; - padding: 10px; - border: 1px solid #eee; - -webkit-border-radius: 10px; - -moz-border-radius: 10px; - -webkit-box-shadow: 1px 1px 6px #ddd; - -moz-box-shadow: 1px 1px 6px #ddd; -} -table { - margin-bottom: 35px; - width: 100%; - border-collapse: collapse; -} -table td { - padding: 5px 10px; - font-size: 14px; -} -table tr { - border-bottom: 1px solid #fff; -} -table tr:last-child { - border-bottom: none; -} -table td:first-child { - width: 150px; - color: #343434; -} -#wrapper { - margin: 50px auto; - width: 750px; - text-align: left; -} -#stacktrace { - margin-top: 15px; -} \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/lib/connect/utils.js b/deps/.npm/connect/0.2.5/package/lib/connect/utils.js deleted file mode 100644 index bca41447..00000000 --- a/deps/.npm/connect/0.2.5/package/lib/connect/utils.js +++ /dev/null @@ -1,415 +0,0 @@ - -/*! - * Ext JS Connect - * Copyright(c) 2010 Sencha Inc. - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var queryString = require('querystring'), - crypto = require('crypto'), - Path = require('path'), - fs = require('fs'); - -/** - * Return md5 hash of the given string and optional encoding, - * defaulting to hex. - * - * @param {String} str - * @param {String} encoding - * @return {String} - * @api public - */ - -exports.md5 = function(str, encoding){ - return crypto.createHash('md5').update(str).digest(encoding || 'hex'); -}; - -/** - * Default mime type. - */ - -var defaultMime = exports.defaultMime = 'application/octet-stream'; - -/** - * Converts the given object to a Boolean. - * - * @param {Mixed} obj - * @return {Boolean} - * @api public - */ - -exports.toBoolean = function(obj){ - return typeof obj === 'string' - ? (/^(y(es)?|true|1)$/).test(obj) - : !! obj; -}; - -/** - * Merge object b with object a. - * - * @param {Object} a - * @param {Object} b - * @return {Object} - * @api public - */ - -exports.merge = function(a, b){ - if (a && b) { - var keys = Object.keys(b); - for (var i = 0, len = keys.length; i < len; ++i) { - a[keys[i]] = b[keys[i]]; - } - } - return a; -}; - -/** - * Return a unique identifier. - * - * @return {String} - * @api public - */ - -exports.uid = function() { - // First three digits are from the current timestamp, the rest is the full - // 32-bit precision of Math.random() - return (Date.now() & 0x7fff).toString(32) + (0x100000000 * Math.random()).toString(32); -}; - -/** - * Parse the given cookie string into an object. - * - * @param {String} str - * @return {Object} - * @api public - */ - -exports.parseCookie = function(str){ - var obj = {}, - pairs = str.split(/[;,] */); - for (var i = 0, len = pairs.length; i < len; ++i) { - var pair = pairs[i], - eqlIndex = pair.indexOf('='), - key = pair.substr(0, eqlIndex).trim().toLowerCase(), - val = pair.substr(++eqlIndex, pair.length).trim(); - // Quoted values - if (val[0] === '"') { - val = val.slice(1, -1); - } - // Only assign once - if (obj[key] === undefined) { - obj[key] = queryString.unescape(val, true); - } - } - return obj; -}; - -/** - * Serialize the given object into a cookie string. - * - * @param {String} name - * @param {String} val - * @param {Object} obj - * @return {String} - * @api public - */ - -exports.serializeCookie = function(name, val, obj){ - var pairs = [name + '=' + queryString.escape(val)], - obj = obj || {}, - keys = Object.keys(obj); - for (var i = 0, len = keys.length; i < len; ++i) { - var key = keys[i], - val = obj[key]; - if (val instanceof Date) { - val = val.toUTCString(); - } else if (typeof val === "boolean") { - if (val === true) { - pairs.push(key); - } - continue; - } - pairs.push(key + '=' + val); - } - return pairs.join('; '); -}; - -exports.mime = { - - /** - * Return mime type for the given path, - * otherwise default to exports.defaultMime - * ("application/octet-stream"). - * - * @param {String} path - * @return {String} - * @api public - */ - - type: function getMime(path) { - var index = String(path).lastIndexOf("."); - if (index < 0) { - return defaultMime; - } - var type = exports.mime.types[path.substring(index).toLowerCase()] || defaultMime; - return (/(text|javascript)/).test(type) - ? type + "; charset=utf-8" - : type; - }, - - /** - * Mime types. - */ - - types: { - ".3gp" : "video/3gpp", - ".a" : "application/octet-stream", - ".ai" : "application/postscript", - ".aif" : "audio/x-aiff", - ".aiff" : "audio/x-aiff", - ".asc" : "application/pgp-signature", - ".asf" : "video/x-ms-asf", - ".asm" : "text/x-asm", - ".asx" : "video/x-ms-asf", - ".atom" : "application/atom+xml", - ".au" : "audio/basic", - ".avi" : "video/x-msvideo", - ".bat" : "application/x-msdownload", - ".bin" : "application/octet-stream", - ".bmp" : "image/bmp", - ".bz2" : "application/x-bzip2", - ".c" : "text/x-c", - ".cab" : "application/vnd.ms-cab-compressed", - ".cc" : "text/x-c", - ".chm" : "application/vnd.ms-htmlhelp", - ".class" : "application/octet-stream", - ".com" : "application/x-msdownload", - ".conf" : "text/plain", - ".cpp" : "text/x-c", - ".crt" : "application/x-x509-ca-cert", - ".css" : "text/css", - ".csv" : "text/csv", - ".cxx" : "text/x-c", - ".deb" : "application/x-debian-package", - ".der" : "application/x-x509-ca-cert", - ".diff" : "text/x-diff", - ".djv" : "image/vnd.djvu", - ".djvu" : "image/vnd.djvu", - ".dll" : "application/x-msdownload", - ".dmg" : "application/octet-stream", - ".doc" : "application/msword", - ".dot" : "application/msword", - ".dtd" : "application/xml-dtd", - ".dvi" : "application/x-dvi", - ".ear" : "application/java-archive", - ".eml" : "message/rfc822", - ".eps" : "application/postscript", - ".exe" : "application/x-msdownload", - ".f" : "text/x-fortran", - ".f77" : "text/x-fortran", - ".f90" : "text/x-fortran", - ".flv" : "video/x-flv", - ".for" : "text/x-fortran", - ".gem" : "application/octet-stream", - ".gemspec" : "text/x-script.ruby", - ".gif" : "image/gif", - ".gz" : "application/x-gzip", - ".h" : "text/x-c", - ".hh" : "text/x-c", - ".htm" : "text/html", - ".html" : "text/html", - ".ico" : "image/vnd.microsoft.icon", - ".ics" : "text/calendar", - ".ifb" : "text/calendar", - ".iso" : "application/octet-stream", - ".jar" : "application/java-archive", - ".java" : "text/x-java-source", - ".jnlp" : "application/x-java-jnlp-file", - ".jpeg" : "image/jpeg", - ".jpg" : "image/jpeg", - ".js" : "application/javascript", - ".json" : "application/json", - ".log" : "text/plain", - ".m3u" : "audio/x-mpegurl", - ".m4v" : "video/mp4", - ".man" : "text/troff", - ".manifest": "text/cache-manifest", - ".mathml" : "application/mathml+xml", - ".mbox" : "application/mbox", - ".mdoc" : "text/troff", - ".me" : "text/troff", - ".mid" : "audio/midi", - ".midi" : "audio/midi", - ".mime" : "message/rfc822", - ".mml" : "application/mathml+xml", - ".mng" : "video/x-mng", - ".mov" : "video/quicktime", - ".mp3" : "audio/mpeg", - ".mp4" : "video/mp4", - ".mp4v" : "video/mp4", - ".mpeg" : "video/mpeg", - ".mpg" : "video/mpeg", - ".ms" : "text/troff", - ".msi" : "application/x-msdownload", - ".odp" : "application/vnd.oasis.opendocument.presentation", - ".ods" : "application/vnd.oasis.opendocument.spreadsheet", - ".odt" : "application/vnd.oasis.opendocument.text", - ".ogg" : "application/ogg", - ".p" : "text/x-pascal", - ".pas" : "text/x-pascal", - ".pbm" : "image/x-portable-bitmap", - ".pdf" : "application/pdf", - ".pem" : "application/x-x509-ca-cert", - ".pgm" : "image/x-portable-graymap", - ".pgp" : "application/pgp-encrypted", - ".pkg" : "application/octet-stream", - ".pl" : "text/x-script.perl", - ".pm" : "text/x-script.perl-module", - ".png" : "image/png", - ".pnm" : "image/x-portable-anymap", - ".ppm" : "image/x-portable-pixmap", - ".pps" : "application/vnd.ms-powerpoint", - ".ppt" : "application/vnd.ms-powerpoint", - ".ps" : "application/postscript", - ".psd" : "image/vnd.adobe.photoshop", - ".py" : "text/x-script.python", - ".qt" : "video/quicktime", - ".ra" : "audio/x-pn-realaudio", - ".rake" : "text/x-script.ruby", - ".ram" : "audio/x-pn-realaudio", - ".rar" : "application/x-rar-compressed", - ".rb" : "text/x-script.ruby", - ".rdf" : "application/rdf+xml", - ".roff" : "text/troff", - ".rpm" : "application/x-redhat-package-manager", - ".rss" : "application/rss+xml", - ".rtf" : "application/rtf", - ".ru" : "text/x-script.ruby", - ".s" : "text/x-asm", - ".sgm" : "text/sgml", - ".sgml" : "text/sgml", - ".sh" : "application/x-sh", - ".sig" : "application/pgp-signature", - ".snd" : "audio/basic", - ".so" : "application/octet-stream", - ".svg" : "image/svg+xml", - ".svgz" : "image/svg+xml", - ".swf" : "application/x-shockwave-flash", - ".t" : "text/troff", - ".tar" : "application/x-tar", - ".tbz" : "application/x-bzip-compressed-tar", - ".tci" : "application/x-topcloud", - ".tcl" : "application/x-tcl", - ".tex" : "application/x-tex", - ".texi" : "application/x-texinfo", - ".texinfo" : "application/x-texinfo", - ".text" : "text/plain", - ".tif" : "image/tiff", - ".tiff" : "image/tiff", - ".torrent" : "application/x-bittorrent", - ".tr" : "text/troff", - ".ttf" : "application/x-font-ttf", - ".txt" : "text/plain", - ".vcf" : "text/x-vcard", - ".vcs" : "text/x-vcalendar", - ".vrml" : "model/vrml", - ".war" : "application/java-archive", - ".wav" : "audio/x-wav", - ".wma" : "audio/x-ms-wma", - ".wmv" : "video/x-ms-wmv", - ".wmx" : "video/x-ms-wmx", - ".wrl" : "model/vrml", - ".wsdl" : "application/wsdl+xml", - ".xbm" : "image/x-xbitmap", - ".xhtml" : "application/xhtml+xml", - ".xls" : "application/vnd.ms-excel", - ".xml" : "application/xml", - ".xpm" : "image/x-xpixmap", - ".xsl" : "application/xml", - ".xslt" : "application/xslt+xml", - ".yaml" : "text/yaml", - ".yml" : "text/yaml", - ".zip" : "application/zip" - } -}; - -// Works like find on unix. Does a recursive readdir and filters by pattern. -exports.find = function find(root, pattern, callback) { - - function rfind(root, callback) { - fs.readdir(root, function (err, files) { - if (err) { - callback(err); - return; - } - var results = [], - counter = 0; - files.forEach(function (file) { - counter++; - function checkCounter() { - counter--; - if (counter === 0) { - callback(null, results); - } - } - var file = root + "/" + file; - fs.stat(file, function (err, stat) { - if (err) { - callback(err); - return; - } - if (stat.isDirectory()) { - rfind(file, function (err, files) { - if (err) { - callback(err); - return; - } - results.push.apply(results, files); - checkCounter(); - }); - checkCounter(); - return; - } - if (pattern.test(file)) { - stat.path = file; - results.push(stat); - } - checkCounter(); - }); - }); - }); - } - rfind(root, function (err, files) { - if (err) { - callback(err); - return; - } - callback(null, files.map(function (file) { - file.path = file.path.substr(root.length); - return file; - })); - }); -}; - -/** - * Convert array-like object to an Array. - * - * node-bench: "16.5 times faster than Array.prototype.slice.call()" - * - * @param {Object} obj - * @return {Array} - * @api private - */ - -function toArray(obj){ - var len = obj.length, - arr = new Array(len); - for (var i = 0; i < len; ++i) { - arr[i] = obj[i]; - } - return arr; -} diff --git a/deps/.npm/connect/0.2.5/package/package.json b/deps/.npm/connect/0.2.5/package/package.json deleted file mode 100644 index 0385f972..00000000 --- a/deps/.npm/connect/0.2.5/package/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "connect", - "description": "High performance middleware framework", - "version": "0.2.5", - "contributors": [ - { "name": "Tim Caswell", "email": "tim@sencha.com" }, - { "name": "TJ Holowaychuk", "email": "tj@sencha.com" } - ], - "directories": { "lib": "./lib/connect" }, - "engines": { "node": ">= 0.1.98" } -} \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/expresso/.gitignore b/deps/.npm/connect/0.2.5/package/support/expresso/.gitignore deleted file mode 100644 index 432563ff..00000000 --- a/deps/.npm/connect/0.2.5/package/support/expresso/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -.DS_Store -lib-cov -*.seed \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/expresso/.gitmodules b/deps/.npm/connect/0.2.5/package/support/expresso/.gitmodules deleted file mode 100644 index 191ddebd..00000000 --- a/deps/.npm/connect/0.2.5/package/support/expresso/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "deps/jscoverage"] - path = deps/jscoverage - url = git://github.com/visionmedia/node-jscoverage.git diff --git a/deps/.npm/connect/0.2.5/package/support/expresso/History.md b/deps/.npm/connect/0.2.5/package/support/expresso/History.md deleted file mode 100644 index e3b01412..00000000 --- a/deps/.npm/connect/0.2.5/package/support/expresso/History.md +++ /dev/null @@ -1,87 +0,0 @@ - -0.6.2 / 2010-08-03 -================== - - * Added `assert.type()` - * Renamed `assert.isNotUndefined()` to `assert.isDefined()` - * Fixed `assert.includes()` param ordering - -0.6.0 / 2010-07-31 -================== - - * Added _docs/api.html_ - * Added -w, --watch - * Added `Array` support to `assert.includes()` - * Added; outputting exceptions immediately. Closes #19 - * Fixed `assert.includes()` param ordering - * Fixed `assert.length()` param ordering - * Fixed jscoverage links - -0.5.0 / 2010-07-16 -================== - - * Added support for async exports - * Added timeout support to `assert.response()`. Closes #3 - * Added 4th arg callback support to `assert.response()` - * Added `assert.length()` - * Added `assert.match()` - * Added `assert.isUndefined()` - * Added `assert.isNull()` - * Added `assert.includes()` - * Added growlnotify support via -g, --growl - * Added -o, --only TESTS. Ex: --only "test foo()" --only "test foo(), test bar()" - * Removed profanity - -0.4.0 / 2010-07-09 -================== - - * Added reporting source coverage (respects --boring for color haters) - * Added callback to assert.response(). Closes #12 - * Fixed; putting exceptions to stderr. Closes #13 - -0.3.1 / 2010-06-28 -================== - - * Faster assert.response() - -0.3.0 / 2010-06-28 -================== - - * Added -p, --port NUM flags - * Added assert.response(). Closes #11 - -0.2.1 / 2010-06-25 -================== - - * Fixed issue with reporting object assertions - -0.2.0 / 2010-06-21 -================== - - * Added `make uninstall` - * Added better readdir() failure message - * Fixed `make install` for kiwi - -0.1.0 / 2010-06-15 -================== - - * Added better usage docs via --help - * Added better conditional color support - * Added pre exit assertion support - -0.0.3 / 2010-06-02 -================== - - * Added more room for filenames in test coverage - * Added boring output support via --boring (suppress colored output) - * Fixed async failure exit status - -0.0.2 / 2010-05-30 -================== - - * Fixed exit status for CI support - -0.0.1 / 2010-05-30 -================== - - * Initial release \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/expresso/Makefile b/deps/.npm/connect/0.2.5/package/support/expresso/Makefile deleted file mode 100644 index 9348bbd3..00000000 --- a/deps/.npm/connect/0.2.5/package/support/expresso/Makefile +++ /dev/null @@ -1,50 +0,0 @@ - -BIN = bin/expresso -PREFIX = /usr/local -JSCOV = deps/jscoverage/node-jscoverage -DOCS = docs/index.md -HTMLDOCS = $(DOCS:.md=.html) - -test: $(BIN) - @./$(BIN) -I lib --growl $(TEST_FLAGS) test/*.test.js - -test-cov: - @./$(BIN) -I lib --cov $(TEST_FLAGS) test/*.test.js - -install: install-jscov install-expresso - -uninstall: - rm -f $(PREFIX)/bin/expresso - rm -f $(PREFIX)/bin/node-jscoverage - -install-jscov: $(JSCOV) - install $(JSCOV) $(PREFIX)/bin - -install-expresso: - install $(BIN) $(PREFIX)/bin - -$(JSCOV): - cd deps/jscoverage && ./configure && make && mv jscoverage node-jscoverage - -clean: - @cd deps/jscoverage && git clean -fd - -docs: docs/api.html $(HTMLDOCS) - -%.html: %.md - @echo "... $< > $@" - @ronn -5 --pipe --fragment $< \ - | cat docs/layout/head.html - docs/layout/foot.html \ - > $@ - -docs/api.html: bin/expresso - dox \ - --title "Expresso" \ - --ribbon "http://github.com/visionmedia/expresso" \ - --desc "Insanely fast TDD framework for [node](http://nodejs.org) featuring code coverage reporting." \ - $< > $@ - -docclean: - rm -f docs/*.html - -.PHONY: test test-cov install uninstall install-expresso install-jscov clean docs docclean \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/expresso/Readme.md b/deps/.npm/connect/0.2.5/package/support/expresso/Readme.md deleted file mode 100644 index dcc1c85c..00000000 --- a/deps/.npm/connect/0.2.5/package/support/expresso/Readme.md +++ /dev/null @@ -1,39 +0,0 @@ - -# Expresso - - TDD framework for [nodejs](http://nodejs.org). - -## Features - - - light-weight - - intuitive async support - - intuitive test runner executable - - test coverage support and reporting - - uses the _assert_ module - - `assert.eql()` alias of `assert.deepEqual()` - - `assert.response()` http response utility - - `assert.includes()` - - `assert.type()` - - `assert.isNull()` - - `assert.isUndefined()` - - `assert.isNotNull()` - - `assert.isDefined()` - - `assert.match()` - - `assert.length()` - -## Installation - -To install both expresso _and_ node-jscoverage run: - - $ make install - -To install expresso alone (no build required) run: - - $ make install-expresso - -Install via npm: - - $ npm install expresso - - - diff --git a/deps/.npm/connect/0.2.5/package/support/expresso/bin/expresso b/deps/.npm/connect/0.2.5/package/support/expresso/bin/expresso deleted file mode 100755 index 34730b8d..00000000 --- a/deps/.npm/connect/0.2.5/package/support/expresso/bin/expresso +++ /dev/null @@ -1,776 +0,0 @@ -#!/usr/bin/env node - -/*! - * Expresso - * Copyright(c) TJ Holowaychuk - * (MIT Licensed) - */ - -/** - * Module dependencies. - */ - -var assert = require('assert'), - childProcess = require('child_process'), - http = require('http'), - path = require('path'), - sys = require('sys'), - cwd = process.cwd(), - fs = require('fs'), - defer; - -/** - * Expresso version. - */ - -var version = '0.6.1'; - -/** - * Failure count. - */ - -var failures = 0; - - -/** - * Number of tests executed. - */ - -var testcount = 0; - -/** - * Whitelist of tests to run. - */ - -var only = []; - -/** - * Boring output. - */ - -var boring = false; - -/** - * Growl notifications. - */ - -var growl = false; - -/** - * Server port. - */ - -var port = 5555; - -/** - * Watch mode. - */ - -var watch = false; - -/** - * Usage documentation. - */ - -var usage = '' - + '[bold]{Usage}: expresso [options] ' - + '\n' - + '\n[bold]{Options}:' - + '\n -w, --watch Watch for modifications and re-execute tests' - + '\n -g, --growl Enable growl notifications' - + '\n -c, --coverage Generate and report test coverage' - + '\n -r, --require PATH Require the given module path' - + '\n -o, --only TESTS Execute only the comma sperated TESTS (can be set several times)' - + '\n -I, --include PATH Unshift the given path to require.paths' - + '\n -p, --port NUM Port number for test servers, starts at 5555' - + '\n -b, --boring Suppress ansi-escape colors' - + '\n -v, --version Output version number' - + '\n -h, --help Display help information' - + '\n'; - -// Parse arguments - -var files = [], - args = process.argv.slice(2); - -while (args.length) { - var arg = args.shift(); - switch (arg) { - case '-h': - case '--help': - print(usage + '\n'); - process.exit(1); - break; - case '-v': - case '--version': - sys.puts(version); - process.exit(1); - break; - case '-i': - case '-I': - case '--include': - if (arg = args.shift()) { - require.paths.unshift(arg); - } else { - throw new Error('--include requires a path'); - } - break; - case '-o': - case '--only': - if (arg = args.shift()) { - only = only.concat(arg.split(/ *, */)); - } else { - throw new Error('--only requires comma-separated test names'); - } - break; - case '-p': - case '--port': - if (arg = args.shift()) { - port = parseInt(arg, 10); - } else { - throw new Error('--port requires a number'); - } - break; - case '-r': - case '--require': - if (arg = args.shift()) { - require(arg); - } else { - throw new Error('--require requires a path'); - } - break; - case '-c': - case '--cov': - case '--coverage': - defer = true; - childProcess.exec('rm -fr lib-cov && node-jscoverage lib lib-cov', function(err){ - if (err) throw err; - require.paths.unshift('lib-cov'); - run(files); - }) - break; - case '-b': - case '--boring': - boring = true; - break; - case '-w': - case '--watch': - watch = true; - break; - case '--g': - case '--growl': - growl = true; - break; - default: - if (/\.js$/.test(arg)) { - files.push(arg); - } - break; - } -} - -/** - * Colorized sys.error(). - * - * @param {String} str - */ - -function print(str){ - sys.error(colorize(str)); -} - -/** - * Colorize the given string using ansi-escape sequences. - * Disabled when --boring is set. - * - * @param {String} str - * @return {String} - */ - -function colorize(str){ - var colors = { bold: 1, red: 31, green: 32, yellow: 33 }; - return str.replace(/\[(\w+)\]\{([^]*?)\}/g, function(_, color, str){ - return boring - ? str - : '\x1B[' + colors[color] + 'm' + str + '\x1B[0m'; - }); -} - -// Alias deepEqual as eql for complex equality - -assert.eql = assert.deepEqual; - -/** - * Assert that `val` is null. - * - * @param {Mixed} val - * @param {String} msg - */ - -assert.isNull = function(val, msg) { - assert.strictEqual(null, val, msg); -}; - -/** - * Assert that `val` is not null. - * - * @param {Mixed} val - * @param {String} msg - */ - -assert.isNotNull = function(val, msg) { - assert.notStrictEqual(null, val, msg); -}; - -/** - * Assert that `val` is undefined. - * - * @param {Mixed} val - * @param {String} msg - */ - -assert.isUndefined = function(val, msg) { - assert.strictEqual(undefined, val, msg); -}; - -/** - * Assert that `val` is not undefined. - * - * @param {Mixed} val - * @param {String} msg - */ - -assert.isDefined = function(val, msg) { - assert.notStrictEqual(undefined, val, msg); -}; - -/** - * Assert that `obj` is `type`. - * - * @param {Mixed} obj - * @param {String} type - * @api public - */ - -assert.type = function(obj, type, msg){ - var real = typeof obj; - msg = msg || 'typeof ' + sys.inspect(obj) + ' is ' + real + ', expected ' + type; - assert.ok(type === real, msg); -}; - -/** - * Assert that `str` matches `regexp`. - * - * @param {String} str - * @param {RegExp} regexp - * @param {String} msg - */ - -assert.match = function(str, regexp, msg) { - msg = msg || sys.inspect(str) + ' does not match ' + sys.inspect(regexp); - assert.ok(regexp.test(str), msg); -}; - -/** - * Assert that `val` is within `obj`. - * - * Examples: - * - * assert.includes('foobar', 'bar'); - * assert.includes(['foo', 'bar'], 'foo'); - * - * @param {String|Array} obj - * @param {Mixed} val - * @param {String} msg - */ - -assert.includes = function(obj, val, msg) { - msg = msg || sys.inspect(obj) + ' does not include ' + sys.inspect(val); - assert.ok(obj.indexOf(val) >= 0, msg); -}; - -/** - * Assert length of `val` is `n`. - * - * @param {Mixed} val - * @param {Number} n - * @param {String} msg - */ - -assert.length = function(val, n, msg) { - msg = msg || sys.inspect(val) + ' has length of ' + val.length + ', expected ' + n; - assert.equal(n, val.length, msg); -}; - -/** - * Assert response from `server` with - * the given `req` object and `res` assertions object. - * - * @param {Server} server - * @param {Object} req - * @param {Object|Function} res - * @param {String} msg - */ - -assert.response = function(server, req, res, msg){ - // Callback as third or fourth arg - var callback = typeof res === 'function' - ? res - : typeof msg === 'function' - ? msg - : function(){}; - - // Default messate to test title - if (typeof msg === 'function') msg = null; - msg = msg || assert.testTitle; - msg += '. '; - - // Pending responses - server.__pending = server.__pending || 0; - server.__pending++; - - // Create client - if (!server.fd) { - server.listen(server.__port = port++); - server.client = http.createClient(server.__port); - } - - // Issue request - var timer, - client = server.client, - method = req.method || 'GET', - status = res.status || res.statusCode, - data = req.data || req.body, - timeout = req.timeout || 0; - - var request = client.request(method, req.url, req.headers); - - // Timeout - if (timeout) { - timer = setTimeout(function(){ - --server.__pending || server.close(); - delete req.timeout; - assert.fail(msg + 'Request timed out after ' + timeout + 'ms.'); - }, timeout); - } - - if (data) request.write(data); - request.addListener('response', function(response){ - response.body = ''; - response.setEncoding('utf8'); - response.addListener('data', function(chunk){ response.body += chunk; }); - response.addListener('end', function(){ - --server.__pending || server.close(); - if (timer) clearTimeout(timer); - - // Assert response body - if (res.body !== undefined) { - assert.equal( - response.body, - res.body, - msg + 'Invalid response body.\n' - + ' Expected: ' + sys.inspect(res.body) + '\n' - + ' Got: ' + sys.inspect(response.body) - ); - } - - // Assert response status - if (typeof status === 'number') { - assert.equal( - response.statusCode, - status, - msg + colorize('Invalid response status code.\n' - + ' Expected: [green]{' + status + '}\n' - + ' Got: [red]{' + response.statusCode + '}') - ); - } - - // Assert response headers - if (res.headers) { - var keys = Object.keys(res.headers); - for (var i = 0, len = keys.length; i < len; ++i) { - var name = keys[i], - actual = response.headers[name.toLowerCase()], - expected = res.headers[name]; - assert.equal( - actual, - expected, - msg + colorize('Invalid response header [bold]{' + name + '}.\n' - + ' Expected: [green]{' + expected + '}\n' - + ' Got: [red]{' + actual + '}') - ); - } - } - - // Callback - callback(response); - }); - }); - request.end(); -}; - -/** - * Pad the given string to the maximum width provided. - * - * @param {String} str - * @param {Number} width - * @return {String} - */ - -function lpad(str, width) { - str = String(str); - var n = width - str.length; - if (n < 1) return str; - while (n--) str = ' ' + str; - return str; -} - -/** - * Pad the given string to the maximum width provided. - * - * @param {String} str - * @param {Number} width - * @return {String} - */ - -function rpad(str, width) { - str = String(str); - var n = width - str.length; - if (n < 1) return str; - while (n--) str = str + ' '; - return str; -} - -/** - * Report test coverage. - * - * @param {Object} cov - */ - -function reportCoverage(cov) { - populateCoverage(cov); - // Stats - print('\n [bold]{Test Coverage}\n'); - var sep = ' +------------------------------------------+----------+------+------+--------+', - lastSep = ' +----------+------+------+--------+'; - sys.puts(sep); - sys.puts(' | filename | coverage | LOC | SLOC | missed |'); - sys.puts(sep); - for (var name in cov) { - var file = cov[name]; - if (Array.isArray(file)) { - sys.print(' | ' + rpad(name, 40)); - sys.print(' | ' + lpad(file.coverage.toFixed(2), 8)); - sys.print(' | ' + lpad(file.LOC, 4)); - sys.print(' | ' + lpad(file.SLOC, 4)); - sys.print(' | ' + lpad(file.totalMisses, 6)); - sys.print(' |\n'); - } - } - sys.puts(sep); - sys.print(' ' + rpad('', 40)); - sys.print(' | ' + lpad(cov.coverage.toFixed(2), 8)); - sys.print(' | ' + lpad(cov.LOC, 4)); - sys.print(' | ' + lpad(cov.SLOC, 4)); - sys.print(' | ' + lpad(cov.totalMisses, 6)); - sys.print(' |\n'); - sys.puts(lastSep); - // Source - for (var name in cov) { - if (name.match(/\.js$/)) { - var file = cov[name]; - print('\n [bold]{' + name + '}:'); - print(file.source); - sys.print('\n'); - } - } -} - -/** - * Populate code coverage data. - * - * @param {Object} cov - */ - -function populateCoverage(cov) { - cov.LOC = - cov.SLOC = - cov.totalFiles = - cov.totalHits = - cov.totalMisses = - cov.coverage = 0; - for (var name in cov) { - var file = cov[name]; - if (Array.isArray(file)) { - // Stats - ++cov.totalFiles; - cov.totalHits += file.totalHits = coverage(file, true); - cov.totalMisses += file.totalMisses = coverage(file, false); - file.totalLines = file.totalHits + file.totalMisses; - cov.SLOC += file.SLOC = file.totalLines; - if (!file.source) file.source = []; - cov.LOC += file.LOC = file.source.length; - file.coverage = (file.totalHits / file.totalLines) * 100; - // Source - var width = file.source.length.toString().length; - file.source = file.source.map(function(line, i){ - ++i; - var hits = file[i] === 0 ? 0 : (file[i] || ' '); - if (!boring) { - if (hits === 0) { - hits = '\x1b[31m' + hits + '\x1b[0m'; - line = '\x1b[41m' + line + '\x1b[0m'; - } else { - hits = '\x1b[32m' + hits + '\x1b[0m'; - } - } - return '\n ' + lpad(i, width) + ' | ' + hits + ' | ' + line; - }).join(''); - } - } - cov.coverage = (cov.totalHits / cov.SLOC) * 100; -} - -/** - * Total coverage for the given file data. - * - * @param {Array} data - * @return {Type} - */ - -function coverage(data, val) { - var n = 0; - for (var i = 0, len = data.length; i < len; ++i) { - if (data[i] !== undefined && data[i] == val) ++n; - } - return n; -} - -/** - * Run the given test `files`, or try _test/*_. - * - * @param {Array} files - */ - -function run(files) { - if (!files.length) { - try { - files = fs.readdirSync('test').map(function(file){ - return 'test/' + file; - }); - } catch (err) { - print('\n failed to load tests in [bold]{./test}\n'); - ++failures; - process.exit(1); - } - } - if (watch) watchFiles(files); - runFiles(files); -} - -/** - * Show the cursor when `show` is true, otherwise hide it. - * - * @param {Boolean} show - */ - -function cursor(show) { - if (show) { - sys.print('\x1b[?25h'); - } else { - sys.print('\x1b[?25l'); - } -} - -/** - * Run the given test `files`. - * - * @param {Array} files - */ - -function runFiles(files) { - files.forEach(runFile); -} - -/** - * Run tests for the given `file`. - * - * @param {String} file - */ - -function runFile(file) { - if (file.match(/\.js$/)) { - var title = path.basename(file), - file = path.join(cwd, file), - mod = require(file.replace(/\.js$/, '')); - (function check(){ - var len = Object.keys(mod).length; - if (len) { - runSuite(title, mod); - } else { - setTimeout(check, 20); - } - })(); - } -} - -/** - * Clear the module cache for the given `file`. - * - * @param {String} file - */ - -function clearCache(file) { - var keys = Object.keys(module.moduleCache); - for (var i = 0, len = keys.length; i < len; ++i) { - var key = keys[i]; - if (key.indexOf(file) === key.length - file.length) { - delete module.moduleCache[key]; - } - } -} - -/** - * Watch the given `files` for changes. - * - * @param {Array} files - */ - -function watchFiles(files) { - var p = 0, - c = ['▫ ', '▫▫ ', '▫▫▫ ', ' ▫▫▫', - ' ▫▫', ' ▫', ' ▫', ' ▫▫', - '▫▫▫ ', '▫▫ ', '▫ '], - l = c.length; - cursor(false); - setInterval(function(){ - sys.print(colorize(' [green]{' + c[p++ % l] + '} watching\r')); - }, 100); - files.forEach(function(file){ - fs.watchFile(file, { interval: 100 }, function(curr, prev){ - if (curr.mtime > prev.mtime) { - print(' [yellow]{◦} ' + file); - clearCache(file); - runFile(file); - } - }); - }); -} - -/** - * Report `err` for the given `test` and `suite`. - * - * @param {String} suite - * @param {String} test - * @param {Error} err - */ - -function error(suite, test, err) { - ++failures; - var name = err.name, - stack = err.stack.replace(err.name, ''), - label = test === 'uncaught' - ? test - : suite + ' ' + test; - print('\n [bold]{' + label + '}: [red]{' + name + '}' + stack + '\n'); - if (watch) notify(label + ' failed'); -} - -/** - * Run the given tests. - * - * @param {String} title - * @param {Object} tests - */ - -function runSuite(title, tests) { - var keys = only.length - ? only.slice(0) - : Object.keys(tests); - (function next(){ - if (keys.length) { - var key, - test = tests[key = keys.shift()]; - if (test) { - try { - ++testcount; - assert.testTitle = key; - test(assert, function(fn){ - process.addListener('beforeExit', function(){ - try { - fn(); - } catch (err) { - error(title, key, err); - } - }); - }); - } catch (err) { - error(title, key, err); - } - } - next(); - } - })(); -} - -/** - * Report exceptions. - */ - -function report() { - process.emit('beforeExit'); - if (failures) { - print('\n [bold]{Failures}: [red]{' + failures + '}\n\n'); - notify('Failures: ' + failures); - } else { - print('\n [green]{100%} ' + testcount + ' tests\n'); - notify('100% ok'); - } - if (typeof _$jscoverage === 'object') { - reportCoverage(_$jscoverage); - } -} - -/** - * Growl notify the given `msg`. - * - * @param {String} msg - */ - -function notify(msg) { - if (growl) { - childProcess.exec('growlnotify -name Expresso -m "' + msg + '"'); - } -} - -// Report uncaught exceptions - -process.addListener('uncaughtException', function(err){ - error('uncaught', 'uncaught', err); -}); - -// Show cursor - -['INT', 'TERM', 'QUIT'].forEach(function(sig){ - process.addListener('SIG' + sig, function(){ - cursor(true); - process.exit(1); - }); -}); - -// Report test coverage when available -// and emit "beforeExit" event to perform -// final assertions - -var orig = process.emit; -process.emit = function(event){ - if (event === 'exit') { - report(); - process.reallyExit(failures); - } - orig.apply(this, arguments); -}; - -// Run test files - -if (!defer) run(files); diff --git a/deps/.npm/connect/0.2.5/package/support/expresso/docs/api.html b/deps/.npm/connect/0.2.5/package/support/expresso/docs/api.html deleted file mode 100644 index 4496371f..00000000 --- a/deps/.npm/connect/0.2.5/package/support/expresso/docs/api.html +++ /dev/null @@ -1,989 +0,0 @@ -Fork me on GitHub - - Expresso - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Expresso

    Insanely fast TDD framework for node featuring code coverage reporting.

    expresso

    bin/expresso
    -

    !/usr/bin/env node

    -
    -
    !
    - * Expresso
    - * Copyright(c) TJ Holowaychuk &lt;tj@vision-media.ca&gt;
    - * (MIT Licensed)
    - 
    -
    -

    Module dependencies. -

    -
    -
    var assert = require('assert'),
    -    childProcess = require('child_process'),
    -    http = require('http'),
    -    path = require('path'),
    -    sys = require('sys'),
    -    cwd = process.cwd(),
    -    fs = require('fs'),
    -    defer;
    -
    -

    Expresso version. -

    -
    -
    var version = '0.6.0';
    -
    -

    Failure count. -

    -
    -
    var failures = 0;
    -
    -

    Whitelist of tests to run. -

    -
    -
    var only = [];
    -
    -

    Boring output. -

    -
    -
    var boring = false;
    -
    -

    Growl notifications. -

    -
    -
    var growl = false;
    -
    -

    Server port. -

    -
    -
    var port = 5555;
    -
    -

    Watch mode. -

    -
    -
    var watch = false;
    -
    -

    Usage documentation. -

    -
    -
    var usage = ''
    -    + '[bold]{Usage}: expresso [options] <file ...>'
    -    + '\n'
    -    + '\n[bold]{Options}:'
    -    + '\n  -w, --watch          Watch for modifications and re-execute tests'
    -    + '\n  -g, --growl          Enable growl notifications'
    -    + '\n  -c, --coverage       Generate and report test coverage'
    -    + '\n  -r, --require PATH   Require the given module path'
    -    + '\n  -o, --only TESTS     Execute only the comma sperated TESTS (can be set several times)'
    -    + '\n  -I, --include PATH   Unshift the given path to require.paths'
    -    + '\n  -p, --port NUM       Port number for test servers, starts at 5555'
    -    + '\n  -b, --boring         Suppress ansi-escape colors'
    -    + '\n  -v, --version        Output version number'
    -    + '\n  -h, --help           Display help information'
    -    + '\n';
    -
    -// Parse arguments
    -
    -var files = [],
    -    args = process.argv.slice(2);
    -
    -while (args.length) {
    -    var arg = args.shift();
    -    switch (arg) {
    -        case '-h':
    -        case '--help':
    -            print(usage + '\n');
    -            process.exit(1);
    -            break;
    -        case '-v':
    -        case '--version':
    -            sys.puts(version);
    -            process.exit(1);
    -            break;
    -        case '-i':
    -        case '-I':
    -        case '--include':
    -            if (arg = args.shift()) {
    -                require.paths.unshift(arg);
    -            } else {
    -                throw new Error('--include requires a path');
    -            }
    -            break;
    -        case '-o':
    -        case '--only':
    -            if (arg = args.shift()) {
    -                only = only.concat(arg.split(/ *, */));
    -            } else {
    -                throw new Error('--only requires comma-separated test names');
    -            }
    -            break;
    -        case '-p':
    -        case '--port':
    -            if (arg = args.shift()) {
    -                port = parseInt(arg, 10);
    -            } else {
    -                throw new Error('--port requires a number');
    -            }
    -            break;
    -        case '-r':
    -        case '--require':
    -            if (arg = args.shift()) {
    -                require(arg);
    -            } else {
    -                throw new Error('--require requires a path');
    -            }
    -            break;
    -        case '-c':
    -        case '--cov':
    -        case '--coverage':
    -            defer = true;
    -            childProcess.exec('rm -fr lib-cov && node-jscoverage lib lib-cov', function(err){
    -                if (err) throw err;
    -                require.paths.unshift('lib-cov');
    -                run(files);
    -            })
    -            break;
    -        case '-b':
    -        case '--boring':
    -        	boring = true;
    -        	break;
    -        case '-w':
    -        case '--watch':
    -            watch = true;
    -            break;
    -        case '--g':
    -        case '--growl':
    -            growl = true;
    -            break;
    -        default:
    -            if (/\.js$/.test(arg)) {
    -                files.push(arg);
    -            }
    -            break;
    -    }
    -}
    -
    -

    Colorized sys.error().

    - -

    - -
    • param: String str

    -
    -
    function print(str){
    -    sys.error(colorize(str));
    -}
    -
    -

    Colorize the given string using ansi-escape sequences. -Disabled when --boring is set.

    - -

    - -
    • param: String str

    • return: String

    -
    -
    function colorize(str){
    -    var colors = { bold: 1, red: 31, green: 32, yellow: 33 };
    -    return str.replace(/\[(\w+)\]\{([^]*?)\}/g, function(_, color, str){
    -        return boring
    -            ? str
    -            : '\x1B[' + colors[color] + 'm' + str + '\x1B[0m';
    -    });
    -}
    -
    -// Alias deepEqual as eql for complex equality
    -
    -assert.eql = assert.deepEqual;
    -
    -

    Assert that val is null.

    - -

    - -
    • param: Mixed val

    • param: String msg

    -
    -
    assert.isNull = function(val, msg) {
    -    assert.strictEqual(null, val, msg);
    -};
    -
    -

    Assert that val is not null.

    - -

    - -
    • param: Mixed val

    • param: String msg

    -
    -
    assert.isNotNull = function(val, msg) {
    -    assert.notStrictEqual(null, val, msg);
    -};
    -
    -

    Assert that val is undefined.

    - -

    - -
    • param: Mixed val

    • param: String msg

    -
    -
    assert.isUndefined = function(val, msg) {
    -    assert.strictEqual(undefined, val, msg);
    -};
    -
    -

    Assert that val is not undefined.

    - -

    - -
    • param: Mixed val

    • param: String msg

    -
    -
    assert.isDefined = function(val, msg) {
    -    assert.notStrictEqual(undefined, val, msg);
    -};
    -
    -

    Assert that obj is type.

    - -

    - -
    • param: Mixed obj

    • param: String type

    • api: public

    -
    -
    assert.type = function(obj, type, msg){
    -    var real = typeof obj;
    -    msg = msg || 'typeof ' + sys.inspect(obj) + ' is ' + real + ', expected ' + type;
    -    assert.ok(type === real, msg);
    -};
    -
    -

    Assert that str matches regexp.

    - -

    - -
    • param: String str

    • param: RegExp regexp

    • param: String msg

    -
    -
    assert.match = function(str, regexp, msg) {
    -    msg = msg || sys.inspect(str) + ' does not match ' + sys.inspect(regexp);
    -    assert.ok(regexp.test(str), msg);
    -};
    -
    -

    Assert that val is within obj.

    - -

    Examples

    - -

    assert.includes('foobar', 'bar'); - assert.includes(['foo', 'bar'], 'foo');

    - -

    - -
    • param: String | Array obj

    • param: Mixed val

    • param: String msg

    -
    -
    assert.includes = function(obj, val, msg) {
    -    msg = msg || sys.inspect(obj) + ' does not include ' + sys.inspect(val);
    -    assert.ok(obj.indexOf(val) &gt;= 0, msg);
    -};
    -
    -

    Assert length of val is n.

    - -

    - -
    • param: Mixed val

    • param: Number n

    • param: String msg

    -
    -
    assert.length = function(val, n, msg) {
    -    msg = msg || sys.inspect(val) + ' has length of ' + val.length + ', expected ' + n;
    -    assert.equal(n, val.length, msg);
    -};
    -
    -

    Assert response from server with -the given req object and res assertions object.

    - -

    - -
    • param: Server server

    • param: Object req

    • param: Object | Function res

    • param: String msg

    -
    -
    assert.response = function(server, req, res, msg){
    -    // Callback as third or fourth arg
    -    var callback = typeof res === 'function'
    -        ? res
    -        : typeof msg === 'function'
    -            ? msg
    -            : function(){};
    -
    -    // Default messate to test title
    -    msg = msg || assert.testTitle;
    -    msg += '. ';
    -
    -    // Pending responses
    -    server.__pending = server.__pending || 0;
    -    server.__pending++;
    -
    -    // Create client
    -    if (!server.fd) {
    -        server.listen(server.__port = port++);
    -        server.client = http.createClient(server.__port);
    -    }
    -
    -    // Issue request
    -    var timer,
    -        client = server.client,
    -        method = req.method || 'GET',
    -        status = res.status || res.statusCode,
    -        data = req.data || req.body,
    -        timeout = req.timeout || 0;
    -
    -    var request = client.request(method, req.url, req.headers);
    -
    -    // Timeout
    -    if (timeout) {
    -        timer = setTimeout(function(){
    -            --server.__pending || server.close();
    -            delete req.timeout;
    -            assert.fail(msg + 'Request timed out after ' + timeout + 'ms.');
    -        }, timeout);
    -    }
    -
    -    if (data) request.write(data);
    -    request.addListener('response', function(response){
    -        response.body = '';
    -        response.setEncoding('utf8');
    -        response.addListener('data', function(chunk){ response.body += chunk; });
    -        response.addListener('end', function(){
    -            --server.__pending || server.close();
    -            if (timer) clearTimeout(timer);
    -
    -            // Assert response body
    -            if (res.body !== undefined) {
    -                assert.equal(
    -                    response.body,
    -                    res.body,
    -                    msg + 'Invalid response body.\n'
    -                        + '    Expected: ' + sys.inspect(res.body) + '\n'
    -                        + '    Got: ' + sys.inspect(response.body)
    -                );
    -            }
    -
    -            // Assert response status
    -            if (typeof status === 'number') {
    -                assert.equal(
    -                    response.statusCode,
    -                    status,
    -                    msg + colorize('Invalid response status code.\n'
    -                        + '    Expected: [green]{' + status + '}\n'
    -                        + '    Got: [red]{' + response.statusCode + '}')
    -                );
    -            }
    -
    -            // Assert response headers
    -            if (res.headers) {
    -                var keys = Object.keys(res.headers);
    -                for (var i = 0, len = keys.length; i &lt; len; ++i) {
    -                    var name = keys[i],
    -                        actual = response.headers[name.toLowerCase()],
    -                        expected = res.headers[name];
    -                    assert.equal(
    -                        actual,
    -                        expected,
    -                        msg + colorize('Invalid response header [bold]{' + name + '}.\n'
    -                            + '    Expected: [green]{' + expected + '}\n'
    -                            + '    Got: [red]{' + actual + '}')
    -                    );
    -                }
    -            }
    -
    -            // Callback
    -            callback(response);
    -        });
    -    });
    -    request.end();
    -};
    -
    -

    Pad the given string to the maximum width provided.

    - -

    - -
    • param: String str

    • param: Number width

    • return: String

    -
    -
    function lpad(str, width) {
    -    str = String(str);
    -    var n = width - str.length;
    -    if (n &lt; 1) return str;
    -    while (n--) str = ' ' + str;
    -    return str;
    -}
    -
    -

    Pad the given string to the maximum width provided.

    - -

    - -
    • param: String str

    • param: Number width

    • return: String

    -
    -
    function rpad(str, width) {
    -    str = String(str);
    -    var n = width - str.length;
    -    if (n &lt; 1) return str;
    -    while (n--) str = str + ' ';
    -    return str;
    -}
    -
    -

    Report test coverage.

    - -

    - -
    • param: Object cov

    -
    -
    function reportCoverage(cov) {
    -    populateCoverage(cov);
    -    // Stats
    -    print('\n   [bold]{Test Coverage}\n');
    -    var sep = '   +------------------------------------------+----------+------+------+--------+',
    -        lastSep = '                                              +----------+------+------+--------+';
    -    sys.puts(sep);
    -    sys.puts('   | filename                                 | coverage | LOC  | SLOC | missed |');
    -    sys.puts(sep);
    -    for (var name in cov) {
    -        var file = cov[name];
    -        if (Array.isArray(file)) {
    -            sys.print('   | ' + rpad(name, 40));
    -            sys.print(' | ' + lpad(file.coverage.toFixed(2), 8));
    -            sys.print(' | ' + lpad(file.LOC, 4));
    -            sys.print(' | ' + lpad(file.SLOC, 4));
    -            sys.print(' | ' + lpad(file.totalMisses, 6));
    -            sys.print(' |\n');
    -        }
    -    }
    -    sys.puts(sep);
    -    sys.print('     ' + rpad('', 40));
    -    sys.print(' | ' + lpad(cov.coverage.toFixed(2), 8));
    -    sys.print(' | ' + lpad(cov.LOC, 4));
    -    sys.print(' | ' + lpad(cov.SLOC, 4));
    -    sys.print(' | ' + lpad(cov.totalMisses, 6));
    -    sys.print(' |\n');
    -    sys.puts(lastSep);
    -    // Source
    -    for (var name in cov) {
    -        if (name.match(/\.js$/)) {
    -            var file = cov[name];
    -            print('\n   [bold]{' + name + '}:');
    -            print(file.source);
    -            sys.print('\n');
    -        }
    -    }
    -}
    -
    -

    Populate code coverage data.

    - -

    - -
    • param: Object cov

    -
    -
    function populateCoverage(cov) {
    -    cov.LOC = 
    -    cov.SLOC =
    -    cov.totalFiles =
    -    cov.totalHits =
    -    cov.totalMisses = 
    -    cov.coverage = 0;
    -    for (var name in cov) {
    -        var file = cov[name];
    -        if (Array.isArray(file)) {
    -            // Stats
    -            ++cov.totalFiles;
    -            cov.totalHits += file.totalHits = coverage(file, true);
    -            cov.totalMisses += file.totalMisses = coverage(file, false);
    -            file.totalLines = file.totalHits + file.totalMisses;
    -            cov.SLOC += file.SLOC = file.totalLines;
    -            cov.LOC += file.LOC = file.source.length;
    -            file.coverage = (file.totalHits / file.totalLines) * 100;
    -            // Source
    -            var width = file.source.length.toString().length;
    -            file.source = file.source.map(function(line, i){
    -                ++i;
    -                var hits = file[i] === 0 ? 0 : (file[i] || ' ');
    -                if (!boring) {
    -                    if (hits === 0) {
    -                        hits = '\x1b[31m' + hits + '\x1b[0m';
    -                        line = '\x1b[41m' + line + '\x1b[0m';
    -                    } else {
    -                        hits = '\x1b[32m' + hits + '\x1b[0m';
    -                    }
    -                }
    -                return '\n     ' + lpad(i, width) + ' | ' + hits + ' | ' + line;
    -            }).join('');
    -        }
    -    }
    -    cov.coverage = (cov.totalHits / cov.SLOC) * 100;
    -}
    -
    -

    Total coverage for the given file data.

    - -

    - -
    • param: Array data

    • return: Type

    -
    -
    function coverage(data, val) {
    -    var n = 0;
    -    for (var i = 0, len = data.length; i &lt; len; ++i) {
    -        if (data[i] !== undefined &amp;&amp; data[i] == val) ++n;
    -    }
    -    return n;  
    -}
    -
    -

    Run the given test files, or try test/*.

    - -

    - -
    • param: Array files

    -
    -
    function run(files) {
    -    if (!files.length) {
    -        try {
    -            files = fs.readdirSync('test').map(function(file){
    -                return 'test/' + file;
    -            });
    -        } catch (err) {
    -            print('\n  failed to load tests in [bold]{./test}\n');
    -            ++failures;
    -            process.exit(1);
    -        }
    -    }
    -    if (watch) watchFiles(files);
    -    runFiles(files);
    -}
    -
    -

    Show the cursor when show is true, otherwise hide it.

    - -

    - -
    • param: Boolean show

    -
    -
    function cursor(show) {
    -    if (show) {
    -        sys.print('\x1b[?25h');
    -    } else {
    -        sys.print('\x1b[?25l');
    -    }
    -}
    -
    -

    Run the given test files.

    - -

    - -
    • param: Array files

    -
    -
    function runFiles(files) {
    -    files.forEach(runFile);
    -}
    -
    -

    Run tests for the given file.

    - -

    - -
    • param: String file

    -
    -
    function runFile(file) {
    -    if (file.match(/\.js$/)) {
    -        var title = path.basename(file),
    -            file = path.join(cwd, file),
    -            mod = require(file.replace(/\.js$/, ''));
    -        (function check(){
    -           var len = Object.keys(mod).length;
    -           if (len) {
    -               runSuite(title, mod);
    -           } else {
    -               setTimeout(check, 20);
    -           }
    -        })();
    -    }
    -}
    -
    -

    Clear the module cache for the given file.

    - -

    - -
    • param: String file

    -
    -
    function clearCache(file) {
    -    var keys = Object.keys(module.moduleCache);
    -    for (var i = 0, len = keys.length; i &lt; len; ++i) {
    -        var key = keys[i];
    -        if (key.indexOf(file) === key.length - file.length) {
    -            delete module.moduleCache[key];
    -        }
    -    }
    -}
    -
    -

    Watch the given files for changes.

    - -

    - -
    • param: Array files

    -
    -
    function watchFiles(files) {
    -    var p = 0,
    -        c = ['▫   ', '▫▫  ', '▫▫▫ ', ' ▫▫▫',
    -             '  ▫▫', '   ▫', '   ▫', '  ▫▫',
    -             '▫▫▫ ', '▫▫  ', '▫   '],
    -        l = c.length;
    -    cursor(false);
    -    setInterval(function(){
    -        sys.print(colorize('  [green]{' + c[p++ % l] + '} watching\r'));
    -    }, 100);
    -    files.forEach(function(file){
    -        fs.watchFile(file, { interval: 100 }, function(curr, prev){
    -            if (curr.mtime &gt; prev.mtime) {
    -                print('  [yellow]{◦} ' + file);
    -                clearCache(file);
    -                runFile(file);
    -            }
    -        });
    -    });
    -}
    -
    -

    Report err for the given test and suite.

    - -

    - -
    • param: String suite

    • param: String test

    • param: Error err

    -
    -
    function error(suite, test, err) {
    -    ++failures;
    -    var name = err.name,
    -        stack = err.stack.replace(err.name, ''),
    -        label = test === 'uncaught'
    -            ? test
    -            : suite + ' ' + test;
    -    print('\n   [bold]{' + label + '}: [red]{' + name + '}' + stack + '\n');
    -    if (watch) notify(label + ' failed');
    -}
    -
    -

    Run the given tests.

    - -

    - -
    • param: String title

    • param: Object tests

    -
    -
    function runSuite(title, tests) {
    -    var keys = only.length
    -        ? only.slice(0)
    -        : Object.keys(tests);
    -    (function next(){
    -        if (keys.length) {
    -            var key,
    -                test = tests[key = keys.shift()];
    -            if (test) {
    -                try {
    -                    assert.testTitle = key;
    -                    test(assert, function(fn){
    -                        process.addListener('beforeExit', function(){
    -                            try {
    -                                fn();
    -                            } catch (err) {
    -                                error(title, key, err);
    -                            }
    -                        });
    -                    });
    -                } catch (err) {
    -                    error(title, key, err);
    -                }
    -            }
    -            next();
    -        }
    -    })();
    -}
    -
    -

    Report exceptions. -

    -
    -
    function report() {
    -    process.emit('beforeExit');
    -    if (failures) {
    -        print('\n   [bold]{Failures}: [red]{' + failures + '}\n\n');
    -        notify('Failures: ' + failures);
    -    } else {
    -    	print('\n   [green]{100%} ok\n');
    -    	notify('100% ok');
    -    }
    -    if (typeof _$jscoverage === 'object') {
    -        reportCoverage(_$jscoverage);
    -    }
    -}
    -
    -

    Growl notify the given msg.

    - -

    - -
    • param: String msg

    -
    -
    function notify(msg) {
    -    if (growl) {
    -        childProcess.exec('growlnotify -name Expresso -m "' + msg + '"');
    -    }
    -}
    -
    -// Report uncaught exceptions
    -
    -process.addListener('uncaughtException', function(err){
    -    error('uncaught', 'uncaught', err);
    -});
    -
    -// Show cursor
    -
    -['INT', 'TERM', 'QUIT'].forEach(function(sig){
    -    process.addListener('SIG' + sig, function(){
    -        cursor(true);
    -        process.exit(1);
    -    });
    -});
    -
    -// Report test coverage when available
    -// and emit "beforeExit" event to perform
    -// final assertions
    -
    -var orig = process.emit;
    -process.emit = function(event){
    -    if (event === 'exit') {
    -        report();
    -        process.reallyExit(failures);
    -    }
    -    orig.apply(this, arguments);
    -};
    -
    -// Run test files
    -
    -if (!defer) run(files);
    -
    -
    \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/expresso/docs/index.html b/deps/.npm/connect/0.2.5/package/support/expresso/docs/index.html deleted file mode 100644 index 5ae18ab1..00000000 --- a/deps/.npm/connect/0.2.5/package/support/expresso/docs/index.html +++ /dev/null @@ -1,380 +0,0 @@ - - - Expresso - TDD Framework For Node - - - - - Fork me on GitHub - - -
    -

    Expresso

    -
    -

    Expresso is a JavaScript TDD framework written for nodejs. Expresso is extremely fast, and is packed with features such as additional assertion methods, code coverage reporting, CI support, and more.

    - -

    Features

    - -
      -
    • light-weight
    • -
    • intuitive async support
    • -
    • intuitive test runner executable
    • -
    • test coverage support and reporting via node-jscoverage
    • -
    • uses and extends the core assert module
    • -
    • assert.eql() alias of assert.deepEqual()
    • -
    • assert.response() http response utility
    • -
    • assert.includes()
    • -
    • assert.isNull()
    • -
    • assert.isUndefined()
    • -
    • assert.isNotNull()
    • -
    • assert.isDefined()
    • -
    • assert.match()
    • -
    • assert.length()
    • -
    - - -

    Installation

    - -

    To install both expresso and node-jscoverage run -the command below, which will first compile node-jscoverage:

    - -
    $ make install
    -
    - -

    To install expresso alone without coverage reporting run:

    - -
    $ make install-expresso
    -
    - -

    Install via npm:

    - -
    $ npm install expresso
    -
    - -

    Examples

    - -

    Examples

    - -

    To define tests we simply export several functions:

    - -
    exports['test String#length'] = function(assert){
    -    assert.equal(6, 'foobar'.length);
    -};
    -
    - -

    Alternatively for large numbers of tests you may want to -export your own object containing the tests, however this -is essentially the as above:

    - -
    module.exports = {
    -    'test String#length': function(assert){
    -        assert.equal(6, 'foobar'.length);
    -    }
    -};
    -
    - -

    If you prefer not to use quoted keys:

    - -
    exports.testsStringLength = function(assert){
    -    assert.equal(6, 'foobar'.length);
    -};
    -
    - -

    The second argument passed to each callback is beforeExit, -which is typically used to assert that callbacks have been -invoked.

    - -
    exports.testAsync = function(assert, beforeExit){
    -    var n = 0;
    -    setTimeout(function(){
    -        ++n;
    -        assert.ok(true);
    -    }, 200);
    -    setTimeout(function(){
    -        ++n;
    -        assert.ok(true);
    -    }, 200);
    -    beforeExit(function(){
    -        assert.equal(2, n, 'Ensure both timeouts are called');
    -    });
    -};
    -
    - -

    Assert Utilities

    - -

    assert.isNull(val[, msg])

    - -

    Asserts that the given val is null.

    - -
    assert.isNull(null);
    -
    - -

    assert.isNotNull(val[, msg])

    - -

    Asserts that the given val is not null.

    - -
    assert.isNotNull(undefined);
    -assert.isNotNull(false);
    -
    - -

    assert.isUndefined(val[, msg])

    - -

    Asserts that the given val is undefined.

    - -
    assert.isUndefined(undefined);
    -
    - -

    assert.isDefined(val[, msg])

    - -

    Asserts that the given val is not undefined.

    - -
    assert.isDefined(null);
    -assert.isDefined(false);
    -
    - -

    assert.match(str, regexp[, msg])

    - -

    Asserts that the given str matches regexp.

    - -
    assert.match('foobar', /^foo(bar)?/);
    -assert.match('foo', /^foo(bar)?/);
    -
    - -

    assert.length(val, n[, msg])

    - -

    Assert that the given val has a length of n.

    - -
    assert.length([1,2,3], 3);
    -assert.length('foo', 3);
    -
    - -

    assert.type(obj, type[, msg])

    - -

    Assert that the given obj is typeof type.

    - -
    assert.type(3, 'number');
    -
    - -

    assert.eql(a, b[, msg])

    - -

    Assert that object b is equal to object a. This is an -alias for the core assert.deepEqual() method which does complex -comparisons, opposed to assert.equal() which uses ==.

    - -
    assert.eql('foo', 'foo');
    -assert.eql([1,2], [1,2]);
    -assert.eql({ foo: 'bar' }, { foo: 'bar' });
    -
    - -

    assert.includes(obj, val[, msg])

    - -

    Assert that obj is within val. This method supports Array_s -and Strings_s.

    - -
    assert.includes([1,2,3], 3);
    -assert.includes('foobar', 'foo');
    -assert.includes('foobar', 'bar');
    -
    - -

    assert.response(server, req, res|fn[, msg|fn])

    - -

    Performs assertions on the given server, which should not call -listen(), as this is handled internally by expresso and the server -is killed after all responses have completed. This method works with -any http.Server instance, so Connect and Express servers will work -as well.

    - -

    The req object may contain:

    - -
      -
    • url request url
    • -
    • timeout timeout in milliseconds
    • -
    • method HTTP method
    • -
    • data request body
    • -
    • headers headers object
    • -
    - - -

    The res object may be a callback function which -receives the response for assertions, or an object -which is then used to perform several assertions -on the response with the following properties:

    - -
      -
    • body assert response body
    • -
    • status assert response status code
    • -
    • header assert that all given headers match (unspecified are ignored)
    • -
    - - -

    When providing res you may then also pass a callback function -as the fourth argument for additional assertions.

    - -

    Below are some examples:

    - -
    assert.response(server, {
    -    url: '/', timeout: 500
    -}, {
    -    body: 'foobar'
    -});
    -
    -assert.response(server, {
    -    url: '/',
    -    method: 'GET'
    -},{
    -    body: '{"name":"tj"}',
    -    status: 200,
    -    headers: {
    -        'Content-Type': 'application/json; charset=utf8',
    -        'X-Foo': 'bar'
    -    }
    -});
    -
    -assert.response(server, {
    -    url: '/foo',
    -    method: 'POST',
    -    data: 'bar baz'
    -},{
    -    body: '/foo bar baz',
    -    status: 200
    -}, 'Test POST');
    -
    -assert.response(server, {
    -    url: '/foo',
    -    method: 'POST',
    -    data: 'bar baz'
    -},{
    -    body: '/foo bar baz',
    -    status: 200
    -}, function(res){
    -    // All done, do some more tests if needed
    -});
    -
    -assert.response(server, {
    -    url: '/'
    -}, function(res){
    -    assert.ok(res.body.indexOf('tj') >= 0, 'Test assert.response() callback');
    -});
    -
    - -

    expresso(1)

    - -

    To run a single test suite (file) run:

    - -
    $ expresso test/a.test.js
    -
    - -

    To run several suites we may simply append another:

    - -
    $ expresso test/a.test.js test/b.test.js
    -
    - -

    We can also pass a whitelist of tests to run within all suites:

    - -
    $ expresso --only "foo()" --only "bar()"
    -
    - -

    Or several with one call:

    - -
    $ expresso --only "foo(), bar()"
    -
    - -

    Globbing is of course possible as well:

    - -
    $ expresso test/*
    -
    - -

    When expresso is called without any files, test/* is the default, -so the following is equivalent to the command above:

    - -
    $ expresso
    -
    - -

    If you wish to unshift a path to require.paths before -running tests, you may use the -I or --include flag.

    - -
    $ expresso --include lib test/*
    -
    - -

    The previous example is typically what I would recommend, since expresso -supports test coverage via node-jscoverage (bundled with expresso), -so you will need to expose an instrumented version of you library.

    - -

    To instrument your library, simply run node-jscoverage, -passing the src and dest directories:

    - -
    $ node-jscoverage lib lib-cov
    -
    - -

    Now we can run our tests again, using the lib-cov directory that has been -instrumented with coverage statements:

    - -
    $ expresso -I lib-cov test/*
    -
    - -

    The output will look similar to below, depending on your test coverage of course :)

    - -

    node coverage

    - -

    To make this process easier expresso has the -c or --cov which essentially -does the same as the two commands above. The following two commands will -run the same tests, however one will auto-instrument, and unshift lib-cov, -and the other will run tests normally:

    - -
    $ expresso -I lib test/*
    -$ expresso -I lib --cov test/*
    -
    - -

    Currently coverage is bound to the lib directory, however in the -future --cov will most likely accept a path.

    - -

    Async Exports

    - -

    Sometimes it is useful to postpone running of tests until a callback or event has fired, currently the exports.foo = function(){}; syntax is supported for this:

    - -
    setTimeout(function(){
    -    exports['test async exports'] = function(assert){
    -        assert.ok('wahoo');
    -    };
    -}, 100);
    -
    - -
    -
    - - \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/expresso/docs/index.md b/deps/.npm/connect/0.2.5/package/support/expresso/docs/index.md deleted file mode 100644 index 169b3356..00000000 --- a/deps/.npm/connect/0.2.5/package/support/expresso/docs/index.md +++ /dev/null @@ -1,292 +0,0 @@ - -[Expresso](http://github.com/visionmedia/expresso) is a JavaScript [TDD](http://en.wikipedia.org/wiki/Test-driven_development) framework written for [nodejs](http://nodejs.org). Expresso is extremely fast, and is packed with features such as additional assertion methods, code coverage reporting, CI support, and more. - -## Features - - - light-weight - - intuitive async support - - intuitive test runner executable - - test coverage support and reporting via [node-jscoverage](http://github.com/visionmedia/node-jscoverage) - - uses and extends the core _assert_ module - - `assert.eql()` alias of `assert.deepEqual()` - - `assert.response()` http response utility - - `assert.includes()` - - `assert.isNull()` - - `assert.isUndefined()` - - `assert.isNotNull()` - - `assert.isDefined()` - - `assert.match()` - - `assert.length()` - -## Installation - -To install both expresso _and_ node-jscoverage run -the command below, which will first compile node-jscoverage: - - $ make install - -To install expresso alone without coverage reporting run: - - $ make install-expresso - -Install via npm: - - $ npm install expresso - -## Examples - -## Examples - -To define tests we simply export several functions: - - exports['test String#length'] = function(assert){ - assert.equal(6, 'foobar'.length); - }; - -Alternatively for large numbers of tests you may want to -export your own object containing the tests, however this -is essentially the as above: - - module.exports = { - 'test String#length': function(assert){ - assert.equal(6, 'foobar'.length); - } - }; - -If you prefer not to use quoted keys: - - exports.testsStringLength = function(assert){ - assert.equal(6, 'foobar'.length); - }; - -The second argument passed to each callback is _beforeExit_, -which is typically used to assert that callbacks have been -invoked. - - exports.testAsync = function(assert, beforeExit){ - var n = 0; - setTimeout(function(){ - ++n; - assert.ok(true); - }, 200); - setTimeout(function(){ - ++n; - assert.ok(true); - }, 200); - beforeExit(function(){ - assert.equal(2, n, 'Ensure both timeouts are called'); - }); - }; - -## Assert Utilities - -### assert.isNull(val[, msg]) - -Asserts that the given _val_ is _null_. - - assert.isNull(null); - -### assert.isNotNull(val[, msg]) - -Asserts that the given _val_ is not _null_. - - assert.isNotNull(undefined); - assert.isNotNull(false); - -### assert.isUndefined(val[, msg]) - -Asserts that the given _val_ is _undefined_. - - assert.isUndefined(undefined); - -### assert.isDefined(val[, msg]) - -Asserts that the given _val_ is not _undefined_. - - assert.isDefined(null); - assert.isDefined(false); - -### assert.match(str, regexp[, msg]) - -Asserts that the given _str_ matches _regexp_. - - assert.match('foobar', /^foo(bar)?/); - assert.match('foo', /^foo(bar)?/); - -### assert.length(val, n[, msg]) - -Assert that the given _val_ has a length of _n_. - - assert.length([1,2,3], 3); - assert.length('foo', 3); - -### assert.type(obj, type[, msg]) - -Assert that the given _obj_ is typeof _type_. - - assert.type(3, 'number'); - -### assert.eql(a, b[, msg]) - -Assert that object _b_ is equal to object _a_. This is an -alias for the core _assert.deepEqual()_ method which does complex -comparisons, opposed to _assert.equal()_ which uses _==_. - - assert.eql('foo', 'foo'); - assert.eql([1,2], [1,2]); - assert.eql({ foo: 'bar' }, { foo: 'bar' }); - -### assert.includes(obj, val[, msg]) - -Assert that _obj_ is within _val_. This method supports _Array_s -and _Strings_s. - - assert.includes([1,2,3], 3); - assert.includes('foobar', 'foo'); - assert.includes('foobar', 'bar'); - -### assert.response(server, req, res|fn[, msg|fn]) - -Performs assertions on the given _server_, which should _not_ call -listen(), as this is handled internally by expresso and the server -is killed after all responses have completed. This method works with -any _http.Server_ instance, so _Connect_ and _Express_ servers will work -as well. - -The _req_ object may contain: - - - _url_ request url - - _timeout_ timeout in milliseconds - - _method_ HTTP method - - _data_ request body - - _headers_ headers object - -The _res_ object may be a callback function which -receives the response for assertions, or an object -which is then used to perform several assertions -on the response with the following properties: - - - _body_ assert response body - - _status_ assert response status code - - _header_ assert that all given headers match (unspecified are ignored) - -When providing _res_ you may then also pass a callback function -as the fourth argument for additional assertions. - -Below are some examples: - - assert.response(server, { - url: '/', timeout: 500 - }, { - body: 'foobar' - }); - - assert.response(server, { - url: '/', - method: 'GET' - },{ - body: '{"name":"tj"}', - status: 200, - headers: { - 'Content-Type': 'application/json; charset=utf8', - 'X-Foo': 'bar' - } - }); - - assert.response(server, { - url: '/foo', - method: 'POST', - data: 'bar baz' - },{ - body: '/foo bar baz', - status: 200 - }, 'Test POST'); - - assert.response(server, { - url: '/foo', - method: 'POST', - data: 'bar baz' - },{ - body: '/foo bar baz', - status: 200 - }, function(res){ - // All done, do some more tests if needed - }); - - assert.response(server, { - url: '/' - }, function(res){ - assert.ok(res.body.indexOf('tj') >= 0, 'Test assert.response() callback'); - }); - - -## expresso(1) - -To run a single test suite (file) run: - - $ expresso test/a.test.js - -To run several suites we may simply append another: - - $ expresso test/a.test.js test/b.test.js - -We can also pass a whitelist of tests to run within all suites: - - $ expresso --only "foo()" --only "bar()" - -Or several with one call: - - $ expresso --only "foo(), bar()" - -Globbing is of course possible as well: - - $ expresso test/* - -When expresso is called without any files, _test/*_ is the default, -so the following is equivalent to the command above: - - $ expresso - -If you wish to unshift a path to `require.paths` before -running tests, you may use the `-I` or `--include` flag. - - $ expresso --include lib test/* - -The previous example is typically what I would recommend, since expresso -supports test coverage via [node-jscoverage](http://github.com/visionmedia/node-jscoverage) (bundled with expresso), -so you will need to expose an instrumented version of you library. - -To instrument your library, simply run [node-jscoverage](http://github.com/visionmedia/node-jscoverage), -passing the _src_ and _dest_ directories: - - $ node-jscoverage lib lib-cov - -Now we can run our tests again, using the _lib-cov_ directory that has been -instrumented with coverage statements: - - $ expresso -I lib-cov test/* - -The output will look similar to below, depending on your test coverage of course :) - -![node coverage](http://dl.dropbox.com/u/6396913/cov.png) - -To make this process easier expresso has the _-c_ or _--cov_ which essentially -does the same as the two commands above. The following two commands will -run the same tests, however one will auto-instrument, and unshift _lib-cov_, -and the other will run tests normally: - - $ expresso -I lib test/* - $ expresso -I lib --cov test/* - -Currently coverage is bound to the _lib_ directory, however in the -future `--cov` will most likely accept a path. - -## Async Exports - -Sometimes it is useful to postpone running of tests until a callback or event has fired, currently the _exports.foo = function(){};_ syntax is supported for this: - - setTimeout(function(){ - exports['test async exports'] = function(assert){ - assert.ok('wahoo'); - }; - }, 100); diff --git a/deps/.npm/connect/0.2.5/package/support/expresso/docs/layout/foot.html b/deps/.npm/connect/0.2.5/package/support/expresso/docs/layout/foot.html deleted file mode 100644 index 44d85e96..00000000 --- a/deps/.npm/connect/0.2.5/package/support/expresso/docs/layout/foot.html +++ /dev/null @@ -1,3 +0,0 @@ -
    - - \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/expresso/docs/layout/head.html b/deps/.npm/connect/0.2.5/package/support/expresso/docs/layout/head.html deleted file mode 100644 index b2d42c36..00000000 --- a/deps/.npm/connect/0.2.5/package/support/expresso/docs/layout/head.html +++ /dev/null @@ -1,47 +0,0 @@ - - - Expresso - TDD Framework For Node - - - - - Fork me on GitHub - - -
    -

    Expresso

    diff --git a/deps/.npm/connect/0.2.5/package/support/expresso/lib/bar.js b/deps/.npm/connect/0.2.5/package/support/expresso/lib/bar.js deleted file mode 100644 index e15aad41..00000000 --- a/deps/.npm/connect/0.2.5/package/support/expresso/lib/bar.js +++ /dev/null @@ -1,4 +0,0 @@ - -exports.bar = function(msg){ - return msg || 'bar'; -}; \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/expresso/lib/foo.js b/deps/.npm/connect/0.2.5/package/support/expresso/lib/foo.js deleted file mode 100644 index 15701a54..00000000 --- a/deps/.npm/connect/0.2.5/package/support/expresso/lib/foo.js +++ /dev/null @@ -1,16 +0,0 @@ - -exports.foo = function(msg){ - if (msg) { - return msg; - } else { - return generateFoo(); - } -}; - -function generateFoo() { - return 'foo'; -} - -function Foo(msg){ - this.msg = msg || 'foo'; -} diff --git a/deps/.npm/connect/0.2.5/package/support/expresso/package.json b/deps/.npm/connect/0.2.5/package/support/expresso/package.json deleted file mode 100644 index ef89b5ef..00000000 --- a/deps/.npm/connect/0.2.5/package/support/expresso/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ "name": "expresso", - "version": "0.6.1", - "description": "TDD framework, light-weight, fast, CI-friendly", - "author": "TJ Holowaychuk ", - "bin": { "expresso": "./bin/expresso" }, - "scripts": { - "install": "make install-jscov" - } -} \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/expresso/test/assert.test.js b/deps/.npm/connect/0.2.5/package/support/expresso/test/assert.test.js deleted file mode 100644 index 6a5e7649..00000000 --- a/deps/.npm/connect/0.2.5/package/support/expresso/test/assert.test.js +++ /dev/null @@ -1,84 +0,0 @@ -module.exports = { - 'assert.eql()': function(assert){ - assert.equal(assert.deepEqual, assert.eql); - }, - - 'assert.type()': function(assert){ - assert.type('foobar', 'string'); - assert.type(2, 'number'); - assert.throws(function(){ - assert.type([1,2,3], 'string'); - }); - }, - - 'assert.includes()': function(assert){ - assert.includes('some random string', 'dom'); - assert.throws(function(){ - assert.include('some random string', 'foobar'); - }); - - assert.includes(['foo', 'bar'], 'bar'); - assert.includes(['foo', 'bar'], 'foo'); - assert.includes([1,2,3], 3); - assert.includes([1,2,3], 2); - assert.includes([1,2,3], 1); - assert.throws(function(){ - assert.includes(['foo', 'bar'], 'baz'); - }); - - assert.throws(function(){ - assert.includes({ wrong: 'type' }, 'foo'); - }); - }, - - 'assert.isNull()': function(assert){ - assert.isNull(null); - assert.throws(function(){ - assert.isNull(undefined); - }); - assert.throws(function(){ - assert.isNull(false); - }); - }, - - 'assert.isUndefined()': function(assert){ - assert.isUndefined(undefined); - assert.throws(function(){ - assert.isUndefined(null); - }); - assert.throws(function(){ - assert.isUndefined(false); - }); - }, - - 'assert.isNotNull()': function(assert){ - assert.isNotNull(false); - assert.isNotNull(undefined); - assert.throws(function(){ - assert.isNotNull(null); - }); - }, - - 'assert.isDefined()': function(assert){ - assert.isDefined(false); - assert.isDefined(null); - assert.throws(function(){ - assert.isDefined(undefined); - }); - }, - - 'assert.match()': function(assert){ - assert.match('foobar', /foo(bar)?/); - assert.throws(function(){ - assert.match('something', /rawr/); - }); - }, - - 'assert.length()': function(assert){ - assert.length('test', 4); - assert.length([1,2,3,4], 4); - assert.throws(function(){ - assert.length([1,2,3], 4); - }); - } -}; \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/expresso/test/async.test.js b/deps/.npm/connect/0.2.5/package/support/expresso/test/async.test.js deleted file mode 100644 index 0dc9016b..00000000 --- a/deps/.npm/connect/0.2.5/package/support/expresso/test/async.test.js +++ /dev/null @@ -1,6 +0,0 @@ - -setTimeout(function(){ - exports['test async exports'] = function(assert){ - assert.ok('wahoo'); - }; -}, 100); \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/expresso/test/bar.test.js b/deps/.npm/connect/0.2.5/package/support/expresso/test/bar.test.js deleted file mode 100644 index 68e8d48b..00000000 --- a/deps/.npm/connect/0.2.5/package/support/expresso/test/bar.test.js +++ /dev/null @@ -1,12 +0,0 @@ - -/** - * Module dependencies. - */ - -var bar = require('bar'); - -module.exports = { - 'bar()': function(assert){ - assert.equal('bar', bar.bar()); - } -}; \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/expresso/test/foo.test.js b/deps/.npm/connect/0.2.5/package/support/expresso/test/foo.test.js deleted file mode 100644 index 5d9d94ea..00000000 --- a/deps/.npm/connect/0.2.5/package/support/expresso/test/foo.test.js +++ /dev/null @@ -1,13 +0,0 @@ - -/** - * Module dependencies. - */ - -var foo = require('foo'); - -module.exports = { - 'foo()': function(assert){ - assert.equal('foo', foo.foo()); - assert.equal('foo', foo.foo()); - } -}; \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/expresso/test/http.test.js b/deps/.npm/connect/0.2.5/package/support/expresso/test/http.test.js deleted file mode 100644 index 8eff2b7c..00000000 --- a/deps/.npm/connect/0.2.5/package/support/expresso/test/http.test.js +++ /dev/null @@ -1,76 +0,0 @@ - -/** - * Module dependencies. - */ - -var http = require('http'); - -var server = http.createServer(function(req, res){ - if (req.method === 'GET') { - if (req.url === '/delay') { - setTimeout(function(){ - res.writeHead(200, {}); - res.end('delayed'); - }, 200); - } else { - var body = JSON.stringify({ name: 'tj' }); - res.writeHead(200, { - 'Content-Type': 'application/json; charset=utf8', - 'Content-Length': body.length - }); - res.end(body); - } - } else { - var body = ''; - req.setEncoding('utf8'); - req.addListener('data', function(chunk){ body += chunk }); - req.addListener('end', function(){ - res.writeHead(200, {}); - res.end(req.url + ' ' + body); - }); - } -}); - -module.exports = { - 'test assert.response()': function(assert, beforeExit){ - var called = 0; - - assert.response(server, { - url: '/', - method: 'GET' - },{ - body: '{"name":"tj"}', - status: 200, - headers: { - 'Content-Type': 'application/json; charset=utf8' - } - }); - - assert.response(server, { - url: '/foo', - method: 'POST', - data: 'bar baz' - },{ - body: '/foo bar baz', - status: 200 - }, function(res){ - ++called; - assert.ok(res); - }); - - assert.response(server, { - url: '/foo' - }, function(res){ - ++called; - assert.ok(res.body.indexOf('tj') >= 0, 'Test assert.response() callback'); - }); - - assert.response(server, - { url: '/delay', timeout: 300 }, - { body: 'delayed' }); - - beforeExit(function(){ - assert.equal(2, called); - }); - } -}; \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/highlight.js b/deps/.npm/connect/0.2.5/package/support/highlight.js deleted file mode 100644 index f8d1d7f3..00000000 --- a/deps/.npm/connect/0.2.5/package/support/highlight.js +++ /dev/null @@ -1,26 +0,0 @@ - -/** - * Module dependencies. - */ - -require.paths.unshift(__dirname + '/koala/lib'); -var koala = require('koala'), - sys = require('sys'), - stdin = process.openStdin(); - -var str = ''; -stdin.addListener('data', function(chunk){ - str += chunk; -}); -stdin.addListener('end', function(){ - sys.print(str.replace(/([^]+?)<\/code>/g, function(_, code){ - return looksLikeJavaScript(code) - ? '' + koala.render('.js', code) + '' - : '' + code + ''; - })); -}); - -function looksLikeJavaScript(code){ - return code.indexOf('{') >= 0 - && code.indexOf('(') >= 0; -} \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/koala/History.md b/deps/.npm/connect/0.2.5/package/support/koala/History.md deleted file mode 100644 index 1cb6f9b9..00000000 --- a/deps/.npm/connect/0.2.5/package/support/koala/History.md +++ /dev/null @@ -1,15 +0,0 @@ - -0.1.1 / 2010-06-22 -================== - - * Fixed for recent node - -0.1.0 / 2010-03-15 -================== - - * Added C proprocessor directive support (mapped to *.{h,c}) - -0.0.1 / YYYY-MM-DD ------------------- - -* Initial release diff --git a/deps/.npm/connect/0.2.5/package/support/koala/Makefile b/deps/.npm/connect/0.2.5/package/support/koala/Makefile deleted file mode 100644 index d13f991c..00000000 --- a/deps/.npm/connect/0.2.5/package/support/koala/Makefile +++ /dev/null @@ -1,8 +0,0 @@ - -test: - @node spec/node.js - -benchmark: - @node benchmarks/bm.js - -.PHONY: test benchmark \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/koala/Readme.md b/deps/.npm/connect/0.2.5/package/support/koala/Readme.md deleted file mode 100644 index fa083955..00000000 --- a/deps/.npm/connect/0.2.5/package/support/koala/Readme.md +++ /dev/null @@ -1,93 +0,0 @@ - -# Koala - -Koala is a node.js syntax highlighting library. - -## Features - - * Fast - * Pure JavaScript - * Simple grammar definitions - * Supported languages: - * JavaScript - * Ruby - * C - -## Installation - - Install the [Kiwi package manager for nodejs](http://github.com/visionmedia/kiwi) - and run: - - $ kiwi install koala - -## Example - - $ node examples/koala.js > yay.html && open -a Safari yay.html - $ node examples/koala.js examples/example.rb > yay.html && open -a Safari yay.html - -## Usage - -auto-detection approach: - - var sys = require('sys'), - fs = require('fs'), - koala = require('koala') - - var file = 'path/to/some.js', - var html = koala.render(file, fs.readFileSync(file)) - sys.puts(html) - -manual approach: - - var sys = require('sys'), - HTML = require('koala/formatters/html').HTML, - Ruby = require('koala/grammars/ruby').Ruby - - sys.puts(HTML.render(Ruby, 'a string of ruby')) - -## Benchmarks - -Extensive benchmarking and comparisons are not yet available, -however quick benchmarking on my macbook pro show the HTML formatter -can render a _1600 byte file_ of JavaScript (_65 lines_) **100 times** in -**0.5 seconds**. - -## Testing - -Koala uses [JSpec](http://jspec.info) for testing, to run -all sites simply run: - - $ make test - -or - - $ node spec/node.js - -## Contributors - - * TJ Holwaychuk (visionmedia) - -## License - -(The MIT License) - -Copyright (c) 2009 TJ Holowaychuk <tj@vision-media.ca> - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/koala/benchmarks/bm.js b/deps/.npm/connect/0.2.5/package/support/koala/benchmarks/bm.js deleted file mode 100644 index 50a60b9b..00000000 --- a/deps/.npm/connect/0.2.5/package/support/koala/benchmarks/bm.js +++ /dev/null @@ -1,15 +0,0 @@ - -require.paths.unshift('lib') - -var sys = require('sys'), - fs = require('fs'), - HTML = require('koala/formatters/html').HTML, - JavaScript = require('koala/grammars/javascript').JavaScript, - str = fs.readFileSync('examples/example.js'), - times = n = 100, - bytes = str.length - -var start = +new Date -while (n--) HTML.render(JavaScript, str) -var duration = +new Date - start -sys.puts('rendered ' + bytes + ' bytes of JavaScript ' + times + ' times in ' + duration + ' milliseconds') \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/koala/examples/example.c b/deps/.npm/connect/0.2.5/package/support/koala/examples/example.c deleted file mode 100644 index 9a92520b..00000000 --- a/deps/.npm/connect/0.2.5/package/support/koala/examples/example.c +++ /dev/null @@ -1,23 +0,0 @@ - -// -// example.c -// -// (c) 2009 TJ Holowaychuk (MIT Licensed) -// - -#ifndef __SOMETHING_H__ -#define __SOMETHING_H__ - -typedef struct { - unsigned int len; - char *keys; - char *vals; -} Array; - -int -main(int argc, char **argv) { - printf("Hello World\n"); - return 0; -} - -#endif \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/koala/examples/example.js b/deps/.npm/connect/0.2.5/package/support/koala/examples/example.js deleted file mode 100644 index d16dfb0c..00000000 --- a/deps/.npm/connect/0.2.5/package/support/koala/examples/example.js +++ /dev/null @@ -1,64 +0,0 @@ - -// Koala - Lexer - Copyright TJ Holowaychuk (MIT Licensed) - -/** - * Initialize with hash of _rules_. - */ - -function Lexer(rules) { - this.rules = rules -} - -Lexer.prototype = { - - /** - * Scan the given _str_ returning an - * array of tokens. - * - * @param {string} str - * @return {array} - * @api public - */ - - scan: function(str) { - var rule, token, fn, - str = String(str), - tokens = [] - while (str.length) { - for (var key in this.rules) - if (this.rules.hasOwnProperty(key)) - switch ((rule = this.rules[key]).constructor) { - case Function: - var buf - if ((buf = rule.call(str, str)) != null) - str = str.substr(buf.length), - token = [key, buf] - break - case String: - if (str.indexOf(rule) === 0) - str = str.substr(rule.length), - token = [key, rule] - break - case Array: - fn = rule[1], rule = rule[0] - case RegExp: - if (str.match(rule)) - str = str.substr(RegExp.$1.length), - token = [key, fn ? fn(RegExp.$1) : RegExp.$1], - fn = null - break - default: - throw new TypeError("rule `" + key + "' must be a String, RegExp, or Array") - } - if (token) - tokens.push(token), - token = null - else - tokens.push([null, str.charAt(0)]), - str = str.substr(1) - } - return tokens - } -} - -exports.Lexer = Lexer \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/koala/examples/example.rb b/deps/.npm/connect/0.2.5/package/support/koala/examples/example.rb deleted file mode 100644 index 640621ca..00000000 --- a/deps/.npm/connect/0.2.5/package/support/koala/examples/example.rb +++ /dev/null @@ -1,389 +0,0 @@ - -require 'optparse' - -module Commander - class Runner - - #-- - # Exceptions - #++ - - class CommandError < StandardError; end - class InvalidCommandError < CommandError; end - - ## - # Array of commands. - - attr_reader :commands - - ## - # Global options. - - attr_reader :options - - ## - # Hash of help formatter aliases. - - attr_reader :help_formatter_aliases - - ## - # Initialize a new command runner. Optionally - # supplying _args_ for mocking, or arbitrary usage. - - def initialize args = ARGV - @args, @commands, @aliases, @options = args, {}, {}, [] - @help_formatter_aliases = help_formatter_alias_defaults - @program = program_defaults - create_default_commands - end - - ## - # Return singleton Runner instance. - - def self.instance - @singleton ||= new - end - - ## - # Run command parsing and execution process. - - def run! - trace = false - require_program :version, :description - trap('INT') { abort program(:int_message) } if program(:int_message) - trap('INT') { program(:int_block).call } if program(:int_block) - global_option('-h', '--help', 'Display help documentation') { command(:help).run *@args[1..-1]; return } - global_option('-v', '--version', 'Display version information') { say version; return } - global_option('-t', '--trace', 'Display backtrace when an error occurs') { trace = true } - parse_global_options - remove_global_options options, @args - unless trace - begin - run_active_command - rescue InvalidCommandError => e - abort "#{e}. Use --help for more information" - rescue \ - OptionParser::InvalidOption, - OptionParser::InvalidArgument, - OptionParser::MissingArgument => e - abort e - rescue => e - abort "error: #{e}. Use --trace to view backtrace" - end - else - run_active_command - end - end - - ## - # Return program version. - - def version - '%s %s' % [program(:name), program(:version)] - end - - ## - # Assign program information. - # - # === Examples - # - # # Set data - # program :name, 'Commander' - # program :version, Commander::VERSION - # program :description, 'Commander utility program.' - # program :help, 'Copyright', '2008 TJ Holowaychuk' - # program :help, 'Anything', 'You want' - # program :int_message 'Bye bye!' - # program :help_formatter, :compact - # program :help_formatter, Commander::HelpFormatter::TerminalCompact - # - # # Get data - # program :name # => 'Commander' - # - # === Keys - # - # :version (required) Program version triple, ex: '0.0.1' - # :description (required) Program description - # :name Program name, defaults to basename of executable - # :help_formatter Defaults to Commander::HelpFormatter::Terminal - # :help Allows addition of arbitrary global help blocks - # :int_message Message to display when interrupted (CTRL + C) - # - - def program key, *args, &block - if key == :help and !args.empty? - @program[:help] ||= {} - @program[:help][args.first] = args.at(1) - elsif key == :help_formatter && !args.empty? - @program[key] = (@help_formatter_aliases[args.first] || args.first) - elsif block - @program[key] = block - else - @program[key] = *args unless args.empty? - @program[key] - end - end - - ## - # Creates and yields a command instance when a block is passed. - # Otherwise attempts to return the command, raising InvalidCommandError when - # it does not exist. - # - # === Examples - # - # command :my_command do |c| - # c.when_called do |args| - # # Code - # end - # end - # - - def command name, &block - yield add_command(Commander::Command.new(name)) if block - @commands[name.to_s] - end - - ## - # Add a global option; follows the same syntax as Command#option - # This would be used for switches such as --version, --trace, etc. - - def global_option *args, &block - switches, description = Runner.separate_switches_from_description *args - @options << { - :args => args, - :proc => block, - :switches => switches, - :description => description, - } - end - - ## - # Alias command _name_ with _alias_name_. Optionally _args_ may be passed - # as if they were being passed straight to the original command via the command-line. - - def alias_command alias_name, name, *args - @commands[alias_name.to_s] = command name - @aliases[alias_name.to_s] = args - end - - ## - # Default command _name_ to be used when no other - # command is found in the arguments. - - def default_command name - @default_command = name - end - - ## - # Add a command object to this runner. - - def add_command command - @commands[command.name] = command - end - - ## - # Check if command _name_ is an alias. - - def alias? name - @aliases.include? name.to_s - end - - ## - # Check if a command _name_ exists. - - def command_exists? name - @commands[name.to_s] - end - - #:stopdoc: - - ## - # Get active command within arguments passed to this runner. - - def active_command - @__active_command ||= command(command_name_from_args) - end - - ## - # Attempts to locate a command name from within the arguments. - # Supports multi-word commands, using the largest possible match. - - def command_name_from_args - @__command_name_from_args ||= (valid_command_names_from(*@args.dup).sort.last || @default_command) - end - - ## - # Returns array of valid command names found within _args_. - - def valid_command_names_from *args - arg_string = args.delete_if { |value| value =~ /^-/ }.join ' ' - commands.keys.find_all { |name| name if /^#{name}/.match arg_string } - end - - ## - # Help formatter instance. - - def help_formatter - @__help_formatter ||= program(:help_formatter).new self - end - - ## - # Return arguments without the command name. - - def args_without_command_name - removed = [] - parts = command_name_from_args.split rescue [] - @args.dup.delete_if do |arg| - removed << arg if parts.include?(arg) and not removed.include?(arg) - end - end - - ## - # Returns hash of help formatter alias defaults. - - def help_formatter_alias_defaults - return :compact => HelpFormatter::TerminalCompact - end - - ## - # Returns hash of program defaults. - - def program_defaults - return :help_formatter => HelpFormatter::Terminal, - :name => File.basename($0) - end - - ## - # Creates default commands such as 'help' which is - # essentially the same as using the --help switch. - - def create_default_commands - command :help do |c| - c.syntax = 'commander help [command]' - c.description = 'Display global or [command] help documentation.' - c.example 'Display global help', 'command help' - c.example "Display help for 'foo'", 'command help foo' - c.when_called do |args, options| - enable_paging - if args.empty? - say help_formatter.render - else - command = command args.join(' ') - require_valid_command command - say help_formatter.render_command(command) - end - end - end - end - - ## - # Raises InvalidCommandError when a _command_ is not found. - - def require_valid_command command = active_command - raise InvalidCommandError, 'invalid command', caller if command.nil? - end - - ## - # Removes global _options_ from _args_. This prevents an invalid - # option error from occurring when options are parsed - # again for the command. - - def remove_global_options options, args - # TODO: refactor with flipflop, please TJ ! have time to refactor me ! - options.each do |option| - switches = option[:switches] - past_switch, arg_removed = false, false - args.delete_if do |arg| - # TODO: clean this up, no rescuing ;) - if switches.any? { |switch| switch.match(/^#{arg}/) rescue false } - past_switch, arg_removed = true, false - true - elsif past_switch && !arg_removed && arg !~ /^-/ - arg_removed = true - else - arg_removed = true - false - end - end - end - end - - ## - # Parse global command options. - - def parse_global_options - options.inject OptionParser.new do |options, option| - options.on *option[:args], &global_option_proc(option[:switches], &option[:proc]) - end.parse! @args.dup - rescue OptionParser::InvalidOption - # Ignore invalid options since options will be further - # parsed by our sub commands. - end - - ## - # Returns a proc allowing for commands to inherit global options. - # This functionality works whether a block is present for the global - # option or not, so simple switches such as --verbose can be used - # without a block, and used throughout all commands. - - def global_option_proc switches, &block - lambda do |value| - unless active_command.nil? - active_command.proxy_options << [Runner.switch_to_sym(switches.last), value] - end - yield value if block and !value.nil? - end - end - - ## - # Raises a CommandError when the program any of the _keys_ are not present, or empty. - - def require_program *keys - keys.each do |key| - raise CommandError, "program #{key} required" if program(key).nil? or program(key).empty? - end - end - - ## - # Return switches and description separated from the _args_ passed. - - def self.separate_switches_from_description *args - switches = args.find_all { |arg| arg.to_s =~ /^-/ } - description = args.last unless !args.last.is_a? String or args.last.match(/^-/) - return switches, description - end - - ## - # Attempts to generate a method name symbol from +switch+. - # For example: - # - # -h # => :h - # --trace # => :trace - # --some-switch # => :some_switch - # --[no-]feature # => :feature - # --file FILE # => :file - # --list of,things # => :list - # - - def self.switch_to_sym switch - switch.scan(/[\-\]](\w+)/).join('_').to_sym rescue nil - end - - ## - # Run the active command. - - def run_active_command - require_valid_command - if alias? command_name_from_args - active_command.run *(@aliases[command_name_from_args.to_s] + args_without_command_name) - else - active_command.run *args_without_command_name - end - end - - def say *args #:nodoc: - $terminal.say *args - end - - end -end diff --git a/deps/.npm/connect/0.2.5/package/support/koala/examples/koala.js b/deps/.npm/connect/0.2.5/package/support/koala/examples/koala.js deleted file mode 100644 index ee8c4a16..00000000 --- a/deps/.npm/connect/0.2.5/package/support/koala/examples/koala.js +++ /dev/null @@ -1,24 +0,0 @@ - -require.paths.unshift('lib') - -var sys = require('sys'), - fs = require('fs'), - path = require('path'), - koala = require('koala') - -var file = process.argv[2] || 'examples/example.js' -var str = fs.readFileSync(file) -var html = koala.render(path.extname(file), str) - -sys.puts('') -sys.puts('
    ', '')
    -sys.puts(html)
    -sys.puts('', '
    ') diff --git a/deps/.npm/connect/0.2.5/package/support/koala/lib/koala.js b/deps/.npm/connect/0.2.5/package/support/koala/lib/koala.js deleted file mode 100644 index fe0c7fc8..00000000 --- a/deps/.npm/connect/0.2.5/package/support/koala/lib/koala.js +++ /dev/null @@ -1,48 +0,0 @@ - -// Koala - Core - Copyright TJ Holowaychuk (MIT Licensed) - -/** - * Version. - */ - -exports.version = '0.1.1' - -/** - * Module dependencies. - */ - -var path = require('path'), - HTML = require('koala/formatters/html').HTML, - JavaScript = require('koala/grammars/javascript').JavaScript, - Ruby = require('koala/grammars/ruby').Ruby, - C = require('koala/grammars/c').C - -/** - * Grammar map. - */ - -exports.map = { - '.js': JavaScript, - '.rb': Ruby, - '.h': C, - '.c': C -} - -/** - * Render _str_ as _type_, with optional _formatter_ - * defaulting to HTML. _str_ should be a filename or - * extension such as '.js'. - * - * @param {string} type - * @param {string} str - * @param {Formatter} formatter - * @return {string} - * @api public - */ - -exports.render = function(type, str, formatter) { - var grammar = exports.map[path.extname(type) || type], - formatter = formatter || HTML - if (!grammar) throw new Error("syntax highlighting for `" + type + "' is not supported") - return formatter.render(grammar, str) -} \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/koala/lib/koala/formatter.js b/deps/.npm/connect/0.2.5/package/support/koala/lib/koala/formatter.js deleted file mode 100644 index ec6a905c..00000000 --- a/deps/.npm/connect/0.2.5/package/support/koala/lib/koala/formatter.js +++ /dev/null @@ -1,32 +0,0 @@ - -// Koala - Formatter - Copyright TJ Holowaychuk (MIT Licensed) - -/** - * Initialize with formatter function. - */ - -function Formatter(fn) { - if (typeof fn !== 'function') - throw new TypeError('Formatter requires a function') - this.fn = fn -} - -/** - * Render _str_ using the given _lexer_. - * - * @param {Lexer} lexer - * @param {string} str - * @return {string} - * @api public - */ - -Formatter.prototype.render = function(lexer, str) { - var self = this - if (typeof lexer.scan !== 'function') - throw new TypeError('Formatter#render() requires a lexer to be passed') - return lexer.scan(str).map(function(token){ - return self.fn.call(self, token[0], token[1]) - }).join('') -} - -exports.Formatter = Formatter \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/koala/lib/koala/formatters/html.js b/deps/.npm/connect/0.2.5/package/support/koala/lib/koala/formatters/html.js deleted file mode 100644 index d5e958c1..00000000 --- a/deps/.npm/connect/0.2.5/package/support/koala/lib/koala/formatters/html.js +++ /dev/null @@ -1,32 +0,0 @@ - -// Koala - Formatters - HTML - Copyright TJ Holowaychuk (MIT Licensed) - -/** - * Module dependencies. - */ - -var Formatter = require('koala/formatter').Formatter - -/** - * Escapes html entities. - * - * @param {string} str - * @return {string} - * @api private - */ - -function escape(str) { - return String(str) - .replace(/&/g, '&') - .replace(/"/g, '"') - .replace(//g, '>') -} - -// --- Formatter - -exports.HTML = new Formatter(function(key, val){ - return key === null - ? val - : '' + val + '' -}) \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/koala/lib/koala/grammars/c.js b/deps/.npm/connect/0.2.5/package/support/koala/lib/koala/grammars/c.js deleted file mode 100644 index 16fe5890..00000000 --- a/deps/.npm/connect/0.2.5/package/support/koala/lib/koala/grammars/c.js +++ /dev/null @@ -1,35 +0,0 @@ - -// Koala - Grammars - C - Copyright TJ Holowaychuk (MIT Licensed) - -/** - * Module dependencies. - */ - -var Lexer = require('koala/lexer').Lexer - -// --- Grammar - -exports.C = new Lexer({ - 'directive': /^(#\w+ *\w+)/, - 'number float': /^(\d+\.\d+)/, - 'number integer': /^(\d+)/, - 'comment': /^(\/\/[^\n]*)/, - 'keyword': /^(auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/, - 'string': /^("(.*?)"|'(.*?)')/, - 'class': /^([A-Z]\w*)/, - 'variable': /^([a-z_]\w*)/, - 'multiline comment': function(str){ - var buf = '/*' - if (str.indexOf('/*') !== 0) - return - str = str.substr(2) - while (true) - if (str.indexOf('*/') === 0) - break - else - buf += str.charAt(0), - str = str.substr(1) - str = str.substr(2) - return buf + '*/' - } -}) \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/koala/lib/koala/grammars/javascript.js b/deps/.npm/connect/0.2.5/package/support/koala/lib/koala/grammars/javascript.js deleted file mode 100644 index 325810f8..00000000 --- a/deps/.npm/connect/0.2.5/package/support/koala/lib/koala/grammars/javascript.js +++ /dev/null @@ -1,38 +0,0 @@ - -// Koala - Grammars - JavaScript - Copyright TJ Holowaychuk (MIT Licensed) - -/** - * Module dependencies. - */ - -var Lexer = require('koala/lexer').Lexer - -// --- Grammar - -exports.JavaScript = new Lexer({ - 'this': 'this', - 'number float': /^(\d+\.\d+)/, - 'number integer': /^(\d+)/, - 'comment': /^(\/\/[^\n]*)/, - 'keyword': /^(null|break|continue|do|for|import|new|void|case|default|else|function|in|return|typeof|while|delete|export|if|else|label|switch|var|with|catch|class|const|debugger|enum|extends|throw|try|finally|super|NaN)\b/, - 'string': /^("(.*?)"|'(.*?)')/, - 'class': /^([A-Z]\w*)/, - 'variable': /^([a-z_]\w*)/, - 'multiline comment': function(str){ - var buf = '/*' - if (str.charAt(0) !== '/' || - str.charAt(1) !== '*') - return - str = str.substr(2) - while (true) - if (str.charAt(0) === '*' && - str.charAt(1) === '/') - break - else - buf += str.charAt(0), - str = str.substr(1) - str = str.substr(2) - return buf + '*/' - }, - 'regexp': /^(\/(.*?)\/[a-z]*)/ -}) \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/koala/lib/koala/grammars/ruby.js b/deps/.npm/connect/0.2.5/package/support/koala/lib/koala/grammars/ruby.js deleted file mode 100644 index 9104f4ab..00000000 --- a/deps/.npm/connect/0.2.5/package/support/koala/lib/koala/grammars/ruby.js +++ /dev/null @@ -1,40 +0,0 @@ - -// Koala - Grammars - Ruby - Copyright TJ Holowaychuk (MIT Licensed) - -/** - * Module dependencies. - */ - -var Lexer = require('koala/lexer').Lexer - -// --- Grammar - -exports.Ruby = new Lexer({ - 'this': 'self', - 'number float': /^(\d+\.\d+)/, - 'number integer': /^(\d+)/, - 'comment': /^(#[^\n]*)/, - 'keyword': /^(return|defined|alias|and|begin|BEGIN|break|case|class|def|do|else|if|END|end|ensure|false|true|for|in|module|next|nil|not|or|redo|rescue|retry|return|super|then|when|true|undef|unless|until|while|yield)\b/, - 'string': /^("(.*?)"|'(.*?)')/, - 'symbol string': /^(\:(\w+|".*?"|'.*?'))/, - 'class': /^((\:\:)?[A-Z]\w*)/, - 'global variable': /^(\$[!@&`'+~=\/\w\\,;<>*$?:"\-]+)/, - 'class variable': /^(@@\w+)/, - 'inst variable': /^(@\w+)/, - 'variable': /^([a-z_]\w*)/, - 'regexp': /^(\/(.*?)\/[a-z]*)/, - 'multiline comment': function(str){ - var buf = '=begin' - if (str.indexOf('=begin') !== 0) - return - str = str.substr(6) - while (true) - if (str.indexOf('=end') === 0) - break - else - buf += str.charAt(0), - str = str.substr(1) - str = str.substr(4) - return buf + '=end' - } -}) \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/koala/lib/koala/lexer.js b/deps/.npm/connect/0.2.5/package/support/koala/lib/koala/lexer.js deleted file mode 100644 index d16dfb0c..00000000 --- a/deps/.npm/connect/0.2.5/package/support/koala/lib/koala/lexer.js +++ /dev/null @@ -1,64 +0,0 @@ - -// Koala - Lexer - Copyright TJ Holowaychuk (MIT Licensed) - -/** - * Initialize with hash of _rules_. - */ - -function Lexer(rules) { - this.rules = rules -} - -Lexer.prototype = { - - /** - * Scan the given _str_ returning an - * array of tokens. - * - * @param {string} str - * @return {array} - * @api public - */ - - scan: function(str) { - var rule, token, fn, - str = String(str), - tokens = [] - while (str.length) { - for (var key in this.rules) - if (this.rules.hasOwnProperty(key)) - switch ((rule = this.rules[key]).constructor) { - case Function: - var buf - if ((buf = rule.call(str, str)) != null) - str = str.substr(buf.length), - token = [key, buf] - break - case String: - if (str.indexOf(rule) === 0) - str = str.substr(rule.length), - token = [key, rule] - break - case Array: - fn = rule[1], rule = rule[0] - case RegExp: - if (str.match(rule)) - str = str.substr(RegExp.$1.length), - token = [key, fn ? fn(RegExp.$1) : RegExp.$1], - fn = null - break - default: - throw new TypeError("rule `" + key + "' must be a String, RegExp, or Array") - } - if (token) - tokens.push(token), - token = null - else - tokens.push([null, str.charAt(0)]), - str = str.substr(1) - } - return tokens - } -} - -exports.Lexer = Lexer \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/koala/seed.yml b/deps/.npm/connect/0.2.5/package/support/koala/seed.yml deleted file mode 100644 index 4417473f..00000000 --- a/deps/.npm/connect/0.2.5/package/support/koala/seed.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- - name: Koala - description: Code syntax highlighting library - version: 0.1.1 diff --git a/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/images/bg.png b/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/images/bg.png deleted file mode 100644 index 947804ff..00000000 Binary files a/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/images/bg.png and /dev/null differ diff --git a/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/images/hr.png b/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/images/hr.png deleted file mode 100644 index 4a94d12f..00000000 Binary files a/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/images/hr.png and /dev/null differ diff --git a/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/images/loading.gif b/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/images/loading.gif deleted file mode 100644 index c69e9372..00000000 Binary files a/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/images/loading.gif and /dev/null differ diff --git a/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/images/sprites.bg.png b/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/images/sprites.bg.png deleted file mode 100644 index dc8790f3..00000000 Binary files a/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/images/sprites.bg.png and /dev/null differ diff --git a/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/images/sprites.png b/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/images/sprites.png deleted file mode 100644 index 010b98ee..00000000 Binary files a/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/images/sprites.png and /dev/null differ diff --git a/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/images/vr.png b/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/images/vr.png deleted file mode 100644 index b2e76175..00000000 Binary files a/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/images/vr.png and /dev/null differ diff --git a/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/jspec.css b/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/jspec.css deleted file mode 100644 index 629d41c5..00000000 --- a/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/jspec.css +++ /dev/null @@ -1,149 +0,0 @@ -body.jspec { - margin: 45px 0; - font: 12px "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif; - background: #efefef url(images/bg.png) top left repeat-x; - text-align: center; -} -#jspec { - margin: 0 auto; - padding-top: 30px; - width: 1008px; - background: url(images/vr.png) top left repeat-y; - text-align: left; -} -#jspec-top { - position: relative; - margin: 0 auto; - width: 1008px; - height: 40px; - background: url(images/sprites.bg.png) top left no-repeat; -} -#jspec-bottom { - margin: 0 auto; - width: 1008px; - height: 15px; - background: url(images/sprites.bg.png) bottom left no-repeat; -} -#jspec .loading { - margin-top: -45px; - width: 1008px; - height: 80px; - background: url(images/loading.gif) 50% 50% no-repeat; -} -#jspec-title { - position: absolute; - top: 15px; - left: 20px; - width: 160px; - font-size: 22px; - font-weight: normal; - background: url(images/sprites.png) 0 -126px no-repeat; - text-align: center; -} -#jspec-title em { - font-size: 10px; - font-style: normal; - color: #BCC8D1; -} -#jspec-report * { - margin: 0; - padding: 0; - background: none; - border: none; -} -#jspec-report { - padding: 15px 40px; - font: 11px "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif; - color: #7B8D9B; -} -#jspec-report.has-failures { - padding-bottom: 30px; -} -#jspec-report .hidden { - display: none; -} -#jspec-report .heading { - margin-bottom: 15px; -} -#jspec-report .heading span { - padding-right: 10px; -} -#jspec-report .heading .passes em { - color: #0ea0eb; -} -#jspec-report .heading .failures em { - color: #FA1616; -} -#jspec-report table { - font-size: 11px; - border-collapse: collapse; -} -#jspec-report td { - padding: 8px; - text-indent: 30px; - color: #7B8D9B; -} -#jspec-report tr.body { - display: none; -} -#jspec-report tr.body pre { - margin: 0; - padding: 0 0 5px 25px; -} -#jspec-report tr.even:hover + tr.body, -#jspec-report tr.odd:hover + tr.body { - display: block; -} -#jspec-report tr td:first-child em { - display: block; - clear: both; - font-style: normal; - font-weight: normal; - color: #7B8D9B; -} -#jspec-report tr.even:hover, -#jspec-report tr.odd:hover { - text-shadow: 1px 1px 1px #fff; - background: #F2F5F7; -} -#jspec-report td + td { - padding-right: 0; - width: 15px; -} -#jspec-report td.pass { - background: url(images/sprites.png) 3px -7px no-repeat; -} -#jspec-report td.fail { - background: url(images/sprites.png) 3px -158px no-repeat; - font-weight: bold; - color: #FC0D0D; -} -#jspec-report td.requires-implementation { - background: url(images/sprites.png) 3px -333px no-repeat; -} -#jspec-report tr.description td { - margin-top: 25px; - padding-top: 25px; - font-size: 12px; - font-weight: bold; - text-indent: 0; - color: #1a1a1a; -} -#jspec-report tr.description:first-child td { - border-top: none; -} -#jspec-report .assertion { - display: block; - float: left; - margin: 0 0 0 1px; - padding: 0; - width: 1px; - height: 5px; - background: #7B8D9B; -} -#jspec-report .assertion.failed { - background: red; -} -.jspec-sandbox { - display: none; -} \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/jspec.growl.js b/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/jspec.growl.js deleted file mode 100644 index a1502575..00000000 --- a/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/jspec.growl.js +++ /dev/null @@ -1,115 +0,0 @@ - -// JSpec - Growl - Copyright TJ Holowaychuk (MIT Licensed) - -;(function(){ - - Growl = { - - // --- Version - - version: '1.0.0', - - /** - * Execute the given _cmd_, returning an array of lines from stdout. - * - * Examples: - * - * Growl.exec('growlnotify', '-m', msg) - * - * @param {string ...} cmd - * @return {array} - * @api public - */ - - exec: function(cmd) { - var lines = [], line - with (JavaImporter(java.lang, java.io)) { - var proccess = Runtime.getRuntime().exec(Array.prototype.slice.call(arguments)) - var stream = new DataInputStream(proccess.getInputStream()) - while (line = stream.readLine()) - lines.push(line + '') - stream.close() - } - return lines - }, - - /** - * Return the extension of the given _path_ or null. - * - * @param {string} path - * @return {string} - * @api private - */ - - extname: function(path) { - return path.lastIndexOf('.') != -1 ? - path.slice(path.lastIndexOf('.') + 1, path.length) : - null - }, - - /** - * Version of the 'growlnotify' binary. - * - * @return {string} - * @api private - */ - - binVersion: function() { - try { return this.exec('growlnotify', '-v')[0].split(' ')[1] } catch (e) {} - }, - - /** - * Send growl notification _msg_ with _options_. - * - * Options: - * - * - title Notification title - * - sticky Make the notification stick (defaults to false) - * - name Application name (defaults to growlnotify) - * - image - * - path to an icon sets --iconpath - * - path to an image sets --image - * - capitalized word sets --appIcon - * - filename uses extname as --icon - * - otherwise treated as --icon - * - * Examples: - * - * Growl.notify('New email') - * Growl.notify('5 new emails', { title: 'Thunderbird' }) - * - * @param {string} msg - * @param {options} hash - * @api public - */ - - notify: function(msg, options) { - options = options || {} - var args = ['growlnotify', '-m', msg] - if (!this.binVersion()) throw new Error('growlnotify executable is required') - if (image = options.image) { - var flag, ext = this.extname(image) - flag = flag || ext == 'icns' && 'iconpath' - flag = flag || /^[A-Z]/.test(image) && 'appIcon' - flag = flag || /^png|gif|jpe?g$/.test(ext) && 'image' - flag = flag || ext && (image = ext) && 'icon' - flag = flag || 'icon' - args.push('--' + flag, image) - } - if (options.sticky) args.push('--sticky') - if (options.name) args.push('--name', options.name) - if (options.title) args.push(options.title) - this.exec.apply(this, args) - } - } - - JSpec.include({ - name: 'Growl', - reporting: function(options){ - var stats = JSpec.stats - if (stats.failures) Growl.notify('failed ' + stats.failures + ' assertions', { title: 'JSpec'}) - else Growl.notify('passed ' + stats.passes + ' assertions', { title: 'JSpec' }) - } - }) - -})() \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/jspec.jquery.js b/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/jspec.jquery.js deleted file mode 100644 index 46422ec5..00000000 --- a/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/jspec.jquery.js +++ /dev/null @@ -1,79 +0,0 @@ - -// JSpec - jQuery - Copyright TJ Holowaychuk (MIT Licensed) - -JSpec -.requires('jQuery', 'when using jspec.jquery.js') -.include({ - name: 'jQuery', - - // --- Initialize - - init : function() { - jQuery.ajaxSetup({ async: false }) - }, - - // --- Utilities - - utilities : { - element: jQuery, - elements: jQuery, - sandbox : function() { - return jQuery('
    ') - } - }, - - // --- Matchers - - matchers : { - have_tag : "jQuery(expected, actual).length === 1", - have_one : "alias have_tag", - have_tags : "jQuery(expected, actual).length > 1", - have_many : "alias have_tags", - have_any : "alias have_tags", - have_child : "jQuery(actual).children(expected).length === 1", - have_children : "jQuery(actual).children(expected).length > 1", - have_text : "jQuery(actual).text() === expected", - have_value : "jQuery(actual).val() === expected", - be_enabled : "!jQuery(actual).attr('disabled')", - have_class : "jQuery(actual).hasClass(expected)", - be_animated : "jQuery(actual).queue().length > 0", - - be_visible : function(actual) { - return jQuery(actual).css('display') != 'none' && - jQuery(actual).css('visibility') != 'hidden' && - jQuery(actual).attr('type') != 'hidden' - }, - - be_hidden : function(actual) { - return !JSpec.does(actual, 'be_visible') - }, - - have_classes : function(actual) { - return !JSpec.any(JSpec.toArray(arguments, 1), function(arg){ - return !JSpec.does(actual, 'have_class', arg) - }) - }, - - have_attr : function(actual, attr, value) { - return value ? jQuery(actual).attr(attr) == value: - jQuery(actual).attr(attr) - }, - - have_event_handlers : function(actual, expected) { - return jQuery(actual).data('events') ? - jQuery(actual).data('events').hasOwnProperty(expected) : - false - }, - - 'be disabled selected checked' : function(attr) { - return 'jQuery(actual).attr("' + attr + '")' - }, - - 'have type id title alt href src sel rev name target' : function(attr) { - return function(actual, value) { - return JSpec.does(actual, 'have_attr', attr, value) - } - } - } -}) - diff --git a/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/jspec.js b/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/jspec.js deleted file mode 100644 index 131c7450..00000000 --- a/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/jspec.js +++ /dev/null @@ -1,1893 +0,0 @@ - -// JSpec - Core - Copyright TJ Holowaychuk (MIT Licensed) - -;(function(){ - - JSpec = { - version : '4.3.2', - assert : true, - cache : {}, - suites : [], - modules : [], - allSuites : [], - sharedBehaviors: [], - matchers : {}, - stubbed : [], - options : {}, - request : 'XMLHttpRequest' in this ? XMLHttpRequest : null, - stats : { specs: 0, assertions: 0, failures: 0, passes: 0, specsFinished: 0, suitesFinished: 0 }, - - /** - * Default context in which bodies are evaluated. - * - * Replace context simply by setting JSpec.context - * to your own like below: - * - * JSpec.context = { foo : 'bar' } - * - * Contexts can be changed within any body, this can be useful - * in order to provide specific helper methods to specific suites. - * - * To reset (usually in after hook) simply set to null like below: - * - * JSpec.context = null - * - */ - - defaultContext : { - - /** - * Return an object used for proxy assertions. - * This object is used to indicate that an object - * should be an instance of _object_, not the constructor - * itself. - * - * @param {function} constructor - * @return {hash} - * @api public - */ - - an_instance_of : function(constructor) { - return { an_instance_of : constructor } - }, - - /** - * Load fixture at _path_. - * - * Fixtures are resolved as: - * - * - - * - .html - * - * @param {string} path - * @return {string} - * @api public - */ - - fixture : function(path) { - if (JSpec.cache[path]) return JSpec.cache[path] - return JSpec.cache[path] = - JSpec.tryLoading(JSpec.options.fixturePath + '/' + path) || - JSpec.tryLoading(JSpec.options.fixturePath + '/' + path + '.html') - }, - - /** - * Load json fixture at _path_. - * - * JSON fixtures are resolved as: - * - * - - * - .json - * - * @param {string} path - * @return {object} - * @api public - */ - - json_fixture: function(path) { - if (!JSpec.cache['json:' + path]) - JSpec.cache['json:' + path] = - JSpec.tryLoading(JSpec.options.fixturePath + '/' + path) || - JSpec.tryLoading(JSpec.options.fixturePath + '/' + path + '.json') - try { - return eval('(' + JSpec.cache['json:' + path] + ')') - } catch (e) { - throw 'json_fixture("' + path + '"): ' + e - } - } - }, - - // --- Objects - - reporters : { - - /** - * Report to server. - * - * Options: - * - uri specific uri to report to. - * - verbose weither or not to output messages - * - failuresOnly output failure messages only - * - * @api public - */ - - Server : function(results, options) { - var uri = options.uri || 'http://' + window.location.host + '/results' - JSpec.post(uri, { - stats: JSpec.stats, - options: options, - results: map(results.allSuites, function(suite) { - if (suite.isExecutable()) - return { - description: suite.description, - specs: map(suite.specs, function(spec) { - return { - description: spec.description, - message: !spec.passed() ? spec.failure().message : null, - status: spec.requiresImplementation() ? 'pending' : - spec.passed() ? 'pass' : - 'fail', - assertions: map(spec.assertions, function(assertion){ - return { - passed: assertion.passed - } - }) - } - }) - } - }) - }) - if ('close' in main) main.close() - }, - - /** - * Default reporter, outputting to the DOM. - * - * Options: - * - reportToId id of element to output reports to, defaults to 'jspec' - * - failuresOnly displays only suites with failing specs - * - * @api public - */ - - DOM : function(results, options) { - var id = option('reportToId') || 'jspec', - report = document.getElementById(id), - failuresOnly = option('failuresOnly'), - classes = results.stats.failures ? 'has-failures' : '' - if (!report) throw 'JSpec requires the element #' + id + ' to output its reports' - - function bodyContents(body) { - return JSpec. - escape(JSpec.contentsOf(body)). - replace(/^ */gm, function(a){ return (new Array(Math.round(a.length / 3))).join(' ') }). - replace(/\r\n|\r|\n/gm, '
    ') - } - - report.innerHTML = '
    \ - Passes: ' + results.stats.passes + ' \ - Failures: ' + results.stats.failures + ' \ - Duration: ' + results.duration + ' ms \ -
    ' + map(results.allSuites, function(suite) { - var displaySuite = failuresOnly ? suite.ran && !suite.passed() : suite.ran - if (displaySuite && suite.isExecutable()) - return '' + - map(suite.specs, function(i, spec) { - return '' + - (spec.requiresImplementation() ? - '' : - (spec.passed() && !failuresOnly) ? - '' : - !spec.passed() ? - '' : - '') + - '' - }).join('') + '' - }).join('') + '
    ' + escape(suite.description) + '
    ' + escape(spec.description) + '' + escape(spec.description)+ '' + spec.assertionsGraph() + '' + escape(spec.description) + - map(spec.failures(), function(a){ return '' + escape(a.message) + '' }).join('') + - '' + spec.assertionsGraph() + '
    ' + bodyContents(spec.body) + '
    ' - }, - - /** - * Terminal reporter. - * - * @api public - */ - - Terminal : function(results, options) { - var failuresOnly = option('failuresOnly') - print(color("\n Passes: ", 'bold') + color(results.stats.passes, 'green') + - color(" Failures: ", 'bold') + color(results.stats.failures, 'red') + - color(" Duration: ", 'bold') + color(results.duration, 'green') + " ms \n") - - function indent(string) { - return string.replace(/^(.)/gm, ' $1') - } - - each(results.allSuites, function(suite) { - var displaySuite = failuresOnly ? suite.ran && !suite.passed() : suite.ran - if (displaySuite && suite.isExecutable()) { - print(color(' ' + suite.description, 'bold')) - each(suite.specs, function(spec){ - var assertionsGraph = inject(spec.assertions, '', function(graph, assertion){ - return graph + color('.', assertion.passed ? 'green' : 'red') - }) - if (spec.requiresImplementation()) - print(color(' ' + spec.description, 'blue') + assertionsGraph) - else if (spec.passed() && !failuresOnly) - print(color(' ' + spec.description, 'green') + assertionsGraph) - else if (!spec.passed()) - print(color(' ' + spec.description, 'red') + assertionsGraph + - "\n" + indent(map(spec.failures(), function(a){ return a.message }).join("\n")) + "\n") - }) - print("") - } - }) - - quit(results.stats.failures) - } - }, - - Assertion : function(matcher, actual, expected, negate) { - extend(this, { - message: '', - passed: false, - actual: actual, - negate: negate, - matcher: matcher, - expected: expected, - - // Report assertion results - - report : function() { - if (JSpec.assert) - this.passed ? JSpec.stats.passes++ : JSpec.stats.failures++ - return this - }, - - // Run the assertion - - run : function() { - // TODO: remove unshifting - expected.unshift(actual) - this.result = matcher.match.apply(this, expected) - this.passed = negate ? !this.result : this.result - if (!this.passed) this.message = matcher.message.call(this, actual, expected, negate, matcher.name) - return this - } - }) - }, - - ProxyAssertion : function(object, method, times, negate) { - var self = this, - old = object[method] - - // Proxy - - object[method] = function(){ - var args = toArray(arguments), - result = old.apply(object, args) - self.calls.push({ args : args, result : result }) - return result - } - - // Times - - this.times = { - once : 1, - twice : 2 - }[times] || times || 1 - - extend(this, { - calls: [], - message: '', - defer: true, - passed: false, - negate: negate, - object: object, - method: method, - - // Proxy return value - - and_return : function(result) { - this.expectedResult = result - return this - }, - - // Proxy arguments passed - - with_args : function() { - this.expectedArgs = toArray(arguments) - return this - }, - - // Check if any calls have failing results - - anyResultsFail : function() { - return any(this.calls, function(call){ - return self.expectedResult.an_instance_of ? - call.result.constructor != self.expectedResult.an_instance_of: - !equal(self.expectedResult, call.result) - }) - }, - - // Check if any calls have passing results - - anyResultsPass : function() { - return any(this.calls, function(call){ - return self.expectedResult.an_instance_of ? - call.result.constructor == self.expectedResult.an_instance_of: - equal(self.expectedResult, call.result) - }) - }, - - // Return the passing result - - passingResult : function() { - return this.anyResultsPass().result - }, - - // Return the failing result - - failingResult : function() { - return this.anyResultsFail().result - }, - - // Check if any arguments fail - - anyArgsFail : function() { - return any(this.calls, function(call){ - return any(self.expectedArgs, function(i, arg){ - if (arg == null) return call.args[i] == null - return arg.an_instance_of ? - call.args[i].constructor != arg.an_instance_of: - !equal(arg, call.args[i]) - - }) - }) - }, - - // Check if any arguments pass - - anyArgsPass : function() { - return any(this.calls, function(call){ - return any(self.expectedArgs, function(i, arg){ - return arg.an_instance_of ? - call.args[i].constructor == arg.an_instance_of: - equal(arg, call.args[i]) - - }) - }) - }, - - // Return the passing args - - passingArgs : function() { - return this.anyArgsPass().args - }, - - // Return the failing args - - failingArgs : function() { - return this.anyArgsFail().args - }, - - // Report assertion results - - report : function() { - if (JSpec.assert) - this.passed ? ++JSpec.stats.passes : ++JSpec.stats.failures - return this - }, - - // Run the assertion - - run : function() { - var methodString = 'expected ' + object.toString() + '.' + method + '()' + (negate ? ' not' : '' ) - - function times(n) { - return n > 2 ? n + ' times' : { 1: 'once', 2: 'twice' }[n] - } - - if (this.expectedResult != null && (negate ? this.anyResultsPass() : this.anyResultsFail())) - this.message = methodString + ' to return ' + puts(this.expectedResult) + - ' but ' + (negate ? 'it did' : 'got ' + puts(this.failingResult())) - - if (this.expectedArgs && (negate ? !this.expectedResult && this.anyArgsPass() : this.anyArgsFail())) - this.message = methodString + ' to be called with ' + puts.apply(this, this.expectedArgs) + - ' but was' + (negate ? '' : ' called with ' + puts.apply(this, this.failingArgs())) - - if (negate ? !this.expectedResult && !this.expectedArgs && this.calls.length >= this.times : this.calls.length != this.times) - this.message = methodString + ' to be called ' + times(this.times) + - ', but ' + (this.calls.length == 0 ? ' was not called' : ' was called ' + times(this.calls.length)) - - if (!this.message.length) - this.passed = true - - return this - } - }) - }, - - /** - * Specification Suite block object. - * - * @param {string} description - * @param {function} body - * @api private - */ - - Suite : function(description, body, isShared) { - var self = this - extend(this, { - body: body, - description: description, - suites: [], - sharedBehaviors: [], - specs: [], - ran: false, - shared: isShared, - hooks: { 'before' : [], 'after' : [], - 'before_each' : [], 'after_each' : [], - 'before_nested' : [], 'after_nested' : []}, - - // Add a spec to the suite - - addSpec : function(description, body) { - var spec = new JSpec.Spec(description, body) - this.specs.push(spec) - JSpec.stats.specs++ // TODO: abstract - spec.suite = this - }, - - // Add a before hook to the suite - - addBefore : function(options, body) { - body.options = options || {} - this.befores.push(body) - }, - - // Add an after hook to the suite - - addAfter : function(options, body) { - body.options = options || {} - this.afters.unshift(body) - }, - - // Add a hook to the suite - - addHook : function(hook, body) { - this.hooks[hook].push(body) - }, - - // Add a nested suite - - addSuite : function(description, body, isShared) { - var suite = new JSpec.Suite(description, body, isShared) - JSpec.allSuites.push(suite) - suite.name = suite.description - suite.description = this.description + ' ' + suite.description - this.suites.push(suite) - suite.suite = this - }, - - // Invoke a hook in context to this suite - - hook : function(hook) { - if (hook != 'before' && hook != 'after') - if (this.suite) this.suite.hook(hook) - - each(this.hooks[hook], function(body) { - JSpec.evalBody(body, "Error in hook '" + hook + "', suite '" + self.description + "': ") - }) - }, - - // Check if nested suites are present - - hasSuites : function() { - return this.suites.length - }, - - // Check if this suite has specs - - hasSpecs : function() { - return this.specs.length - }, - - // Check if the entire suite passed - - passed : function() { - return !any(this.specs, function(spec){ - return !spec.passed() - }) - }, - - isShared : function(){ - return this.shared - }, - - isExecutable : function() { - return !this.isShared() && this.hasSpecs() - } - }) - }, - - /** - * Specification block object. - * - * @param {string} description - * @param {function} body - * @api private - */ - - Spec : function(description, body) { - extend(this, { - body: body, - description: description, - assertions: [], - - // Add passing assertion - - pass : function(message) { - this.assertions.push({ passed: true, message: message }) - if (JSpec.assert) ++JSpec.stats.passes - }, - - // Add failing assertion - - fail : function(message) { - this.assertions.push({ passed: false, message: message }) - if (JSpec.assert) ++JSpec.stats.failures - }, - - // Run deferred assertions - - runDeferredAssertions : function() { - each(this.assertions, function(assertion){ - if (assertion.defer) assertion.run().report(), hook('afterAssertion', assertion) - }) - }, - - // Find first failing assertion - - failure : function() { - return find(this.assertions, function(assertion){ - return !assertion.passed - }) - }, - - // Find all failing assertions - - failures : function() { - return select(this.assertions, function(assertion){ - return !assertion.passed - }) - }, - - // Weither or not the spec passed - - passed : function() { - return !this.failure() - }, - - // Weither or not the spec requires implementation (no assertions) - - requiresImplementation : function() { - return this.assertions.length == 0 - }, - - // Sprite based assertions graph - - assertionsGraph : function() { - return map(this.assertions, function(assertion){ - return '' - }).join('') - } - }) - }, - - Module : function(methods) { - extend(this, methods) - }, - - JSON : { - - /** - * Generic sequences. - */ - - meta : { - '\b' : '\\b', - '\t' : '\\t', - '\n' : '\\n', - '\f' : '\\f', - '\r' : '\\r', - '"' : '\\"', - '\\' : '\\\\' - }, - - /** - * Escapable sequences. - */ - - escapable : /[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, - - /** - * JSON encode _object_. - * - * @param {mixed} object - * @return {string} - * @api private - */ - - encode : function(object) { - var self = this - if (object == undefined || object == null) return 'null' - if (object === true) return 'true' - if (object === false) return 'false' - switch (typeof object) { - case 'number': return object - case 'string': return this.escapable.test(object) ? - '"' + object.replace(this.escapable, function (a) { - return typeof self.meta[a] === 'string' ? self.meta[a] : - '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4) - }) + '"' : - '"' + object + '"' - case 'object': - if (object.constructor == Array) - return '[' + map(object, function(val){ - return self.encode(val) - }).join(', ') + ']' - else if (object) - return '{' + map(object, function(key, val){ - return self.encode(key) + ':' + self.encode(val) - }).join(', ') + '}' - } - return 'null' - } - }, - - // --- DSLs - - DSLs : { - snake : { - expect : function(actual){ - return JSpec.expect(actual) - }, - - describe : function(description, body) { - return JSpec.currentSuite.addSuite(description, body, false) - }, - - it : function(description, body) { - return JSpec.currentSuite.addSpec(description, body) - }, - - before : function(body) { - return JSpec.currentSuite.addHook('before', body) - }, - - after : function(body) { - return JSpec.currentSuite.addHook('after', body) - }, - - before_each : function(body) { - return JSpec.currentSuite.addHook('before_each', body) - }, - - after_each : function(body) { - return JSpec.currentSuite.addHook('after_each', body) - }, - - before_nested : function(body) { - return JSpec.currentSuite.addHook('before_nested', body) - }, - - after_nested : function(body){ - return JSpec.currentSuite.addhook('after_nested', body) - }, - - shared_behaviors_for : function(description, body){ - return JSpec.currentSuite.addSuite(description, body, true) - }, - - should_behave_like : function(description) { - return JSpec.shareBehaviorsOf(description) - } - } - }, - - // --- Methods - - /** - * Check if _value_ is 'stop'. For use as a - * utility callback function. - * - * @param {mixed} value - * @return {bool} - * @api public - */ - - haveStopped : function(value) { - return value === 'stop' - }, - - /** - * Include _object_ which may be a hash or Module instance. - * - * @param {hash, Module} object - * @return {JSpec} - * @api public - */ - - include : function(object) { - var module = object.constructor == JSpec.Module ? object : new JSpec.Module(object) - this.modules.push(module) - if ('init' in module) module.init() - if ('utilities' in module) extend(this.defaultContext, module.utilities) - if ('matchers' in module) this.addMatchers(module.matchers) - if ('reporters' in module) extend(this.reporters, module.reporters) - if ('DSLs' in module) - each(module.DSLs, function(name, methods){ - JSpec.DSLs[name] = JSpec.DSLs[name] || {} - extend(JSpec.DSLs[name], methods) - }) - return this - }, - - /** - * Add a module hook _name_, which is immediately - * called per module with the _args_ given. An array of - * hook return values is returned. - * - * @param {name} string - * @param {...} args - * @return {array} - * @api private - */ - - hook : function(name, args) { - args = toArray(arguments, 1) - return inject(JSpec.modules, [], function(results, module){ - if (typeof module[name] == 'function') - results.push(JSpec.evalHook(module, name, args)) - }) - }, - - /** - * Eval _module_ hook _name_ with _args_. Evaluates in context - * to the module itself, JSpec, and JSpec.context. - * - * @param {Module} module - * @param {string} name - * @param {array} args - * @return {mixed} - * @api private - */ - - evalHook : function(module, name, args) { - hook('evaluatingHookBody', module, name) - return module[name].apply(module, args) - }, - - /** - * Same as hook() however accepts only one _arg_ which is - * considered immutable. This function passes the arg - * to the first module, then passes the return value of the last - * module called, to the following module. - * - * @param {string} name - * @param {mixed} arg - * @return {mixed} - * @api private - */ - - hookImmutable : function(name, arg) { - return inject(JSpec.modules, arg, function(result, module){ - if (typeof module[name] == 'function') - return JSpec.evalHook(module, name, [result]) - }) - }, - - /** - * Find a shared example suite by its description or name. - * First searches parent tree of suites for shared behavior - * before falling back to global scoped nested behaviors. - * - * @param {string} description - * @return {Suite} - * @api private - */ - - findSharedBehavior : function(description) { - var behavior - return (behavior = JSpec.findLocalSharedBehavior(description)) - ? behavior - : JSpec.findGlobalSharedBehavior(description) - }, - - /** - * Find a shared example suite within the current suite's - * parent tree by its description or name. - * - * @param {string} description - * @return {Suite} - * @api private - */ - - findLocalSharedBehavior : function(description) { - var behavior, - currentSuite = JSpec.currentSuite.suite - while (currentSuite) - if (behavior = find(currentSuite.suites, JSpec.suiteDescriptionPredicate(description))) - return behavior - else - currentSuite = currentSuite.suite - }, - - /** - * Find a shared example suite within the global - * scope by its description or name. - * - * @param {string} description - * @return {Suite} - * @api private - */ - - findGlobalSharedBehavior : function(description) { - return find(JSpec.suites, JSpec.suiteDescriptionPredicate(description)) - }, - - /** - * Build a predicate that will match a suite based on name or description - * - * @param {string} description - * @return {function} - * @api private - */ - - suiteDescriptionPredicate : function(description) { - return function(suite){ - return suite.name === description || - suite.description === description - } - }, - - /** - * Share behaviors (specs) of the given suite with - * the current suite. - * - * @param {string} description - * @api public - */ - - shareBehaviorsOf : function(description) { - var suite = JSpec.findSharedBehavior(description) - if (suite) - JSpec.evalBody(suite.body) - else - throw new Error("failed to find shared behaviors named `" + description + "'") - }, - - - /** - * Convert arguments to an array. - * - * @param {object} arguments - * @param {int} offset - * @return {array} - * @api public - */ - - toArray : function(arguments, offset) { - return Array.prototype.slice.call(arguments, offset || 0) - }, - - /** - * Return ANSI-escaped colored string. - * - * @param {string} string - * @param {string} color - * @return {string} - * @api public - */ - - color : function(string, color) { - if (option('disableColors')) { - return string - } else { - return "\u001B[" + { - bold : 1, - black : 30, - red : 31, - green : 32, - yellow : 33, - blue : 34, - magenta : 35, - cyan : 36, - white : 37 - }[color] + 'm' + string + "\u001B[0m" - } - }, - - /** - * Default matcher message callback. - * - * @api private - */ - - defaultMatcherMessage : function(actual, expected, negate, name) { - return 'expected ' + puts(actual) + ' to ' + - (negate ? 'not ' : '') + - name.replace(/_/g, ' ') + - ' ' + (expected.length > 1 ? - puts.apply(this, expected.slice(1)) : - '') - }, - - /** - * Normalize a matcher message. - * - * When no messge callback is present the defaultMatcherMessage - * will be assigned, will suffice for most matchers. - * - * @param {hash} matcher - * @return {hash} - * @api public - */ - - normalizeMatcherMessage : function(matcher) { - if (typeof matcher.message != 'function') - matcher.message = this.defaultMatcherMessage - return matcher - }, - - /** - * Normalize a matcher body - * - * This process allows the following conversions until - * the matcher is in its final normalized hash state. - * - * - '==' becomes 'actual == expected' - * - 'actual == expected' becomes 'return actual == expected' - * - function(actual, expected) { return actual == expected } becomes - * { match : function(actual, expected) { return actual == expected }} - * - * @param {mixed} body - * @return {hash} - * @api public - */ - - normalizeMatcherBody : function(body) { - var captures - switch (body.constructor) { - case String: - if (captures = body.match(/^alias (\w+)/)) return JSpec.matchers[last(captures)] - if (body.length < 4) body = 'actual ' + body + ' expected' - return { match: function(actual, expected) { return eval(body) }} - - case Function: - return { match: body } - - default: - return body - } - }, - - /** - * Get option value. This method first checks if - * the option key has been set via the query string, - * otherwise returning the options hash value. - * - * @param {string} key - * @return {mixed} - * @api public - */ - - option : function(key) { - return (value = query(key)) !== null ? value : - JSpec.options[key] || null - }, - - /** - * Check if object _a_, is equal to object _b_. - * - * @param {object} a - * @param {object} b - * @return {bool} - * @api private - */ - - equal: function(a, b) { - if (typeof a != typeof b) return - if (a === b) return true - if (a instanceof RegExp) - return a.toString() === b.toString() - if (a instanceof Date) - return Number(a) === Number(b) - if (typeof a != 'object') return - if (a.length !== undefined) - if (a.length !== b.length) return - else - for (var i = 0, len = a.length; i < len; ++i) - if (!equal(a[i], b[i])) - return - for (var key in a) - if (!equal(a[key], b[key])) - return - return true - }, - - /** - * Return last element of an array. - * - * @param {array} array - * @return {object} - * @api public - */ - - last : function(array) { - return array[array.length - 1] - }, - - /** - * Convert object(s) to a print-friend string. - * - * @param {...} object - * @return {string} - * @api public - */ - - puts : function(object) { - if (arguments.length > 1) - return map(toArray(arguments), function(arg){ - return puts(arg) - }).join(', ') - if (object === undefined) return 'undefined' - if (object === null) return 'null' - if (object === true) return 'true' - if (object === false) return 'false' - if (object.an_instance_of) return 'an instance of ' + object.an_instance_of.name - if (object.jquery && object.selector.length > 0) return 'selector ' + puts(object.selector) - if (object.jquery) return object.get(0).outerHTML - if (object.nodeName) return object.outerHTML - switch (object.constructor) { - case Function: return object.name || object - case String: - return '"' + object - .replace(/"/g, '\\"') - .replace(/\n/g, '\\n') - .replace(/\t/g, '\\t') - + '"' - case Array: - return inject(object, '[', function(b, v){ - return b + ', ' + puts(v) - }).replace('[,', '[') + ' ]' - case Object: - object.__hit__ = true - return inject(object, '{', function(b, k, v) { - if (k == '__hit__') return b - return b + ', ' + k + ': ' + (v && v.__hit__ ? '' : puts(v)) - }).replace('{,', '{') + ' }' - default: - return object.toString() - } - }, - - /** - * Parse an XML String and return a 'document'. - * - * @param {string} text - * @return {document} - * @api public - */ - - parseXML : function(text) { - var xmlDoc - if (window.DOMParser) - xmlDoc = (new DOMParser()).parseFromString(text, "text/xml") - else { - xmlDoc = new ActiveXObject("Microsoft.XMLDOM") - xmlDoc.async = "false" - xmlDoc.loadXML(text) - } - return xmlDoc - }, - - /** - * Escape HTML. - * - * @param {string} html - * @return {string} - * @api public - */ - - escape : function(html) { - return html.toString() - .replace(/&/gmi, '&') - .replace(/"/gmi, '"') - .replace(/>/gmi, '>') - .replace(/ current) while (++current <= end) values.push(current) - else while (--current >= end) values.push(current) - return '[' + values + ']' - }, - - /** - * Report on the results. - * - * @api public - */ - - report : function() { - this.duration = Number(new Date) - this.start - hook('reporting', JSpec.options) - new (JSpec.options.reporter || JSpec.reporters.DOM)(JSpec, JSpec.options) - }, - - /** - * Run the spec suites. Options are merged - * with JSpec options when present. - * - * @param {hash} options - * @return {JSpec} - * @api public - */ - - run : function(options) { - if (any(hook('running'), haveStopped)) return this - if (options) extend(this.options, options) - this.start = Number(new Date) - each(this.suites, function(suite) { JSpec.runSuite(suite) }) - return this - }, - - /** - * Run a suite. - * - * @param {Suite} suite - * @api public - */ - - runSuite : function(suite) { - if (!suite.isShared()) - { - this.currentSuite = suite - this.evalBody(suite.body) - suite.ran = true - hook('beforeSuite', suite), suite.hook('before'), suite.hook('before_nested') - each(suite.specs, function(spec) { - hook('beforeSpec', spec) - suite.hook('before_each') - JSpec.runSpec(spec) - hook('afterSpec', spec) - suite.hook('after_each') - }) - if (suite.hasSuites()) { - each(suite.suites, function(suite) { - JSpec.runSuite(suite) - }) - } - hook('afterSuite', suite), suite.hook('after_nested'), suite.hook('after') - this.stats.suitesFinished++ - } - }, - - /** - * Report a failure for the current spec. - * - * @param {string} message - * @api public - */ - - fail : function(message) { - JSpec.currentSpec.fail(message) - }, - - /** - * Report a passing assertion for the current spec. - * - * @param {string} message - * @api public - */ - - pass : function(message) { - JSpec.currentSpec.pass(message) - }, - - /** - * Run a spec. - * - * @param {Spec} spec - * @api public - */ - - runSpec : function(spec) { - this.currentSpec = spec - try { this.evalBody(spec.body) } - catch (e) { fail(e) } - spec.runDeferredAssertions() - destub() - this.stats.specsFinished++ - this.stats.assertions += spec.assertions.length - }, - - /** - * Require a dependency, with optional message. - * - * @param {string} dependency - * @param {string} message (optional) - * @return {JSpec} - * @api public - */ - - requires : function(dependency, message) { - hook('requiring', dependency, message) - try { eval(dependency) } - catch (e) { throw 'JSpec depends on ' + dependency + ' ' + message } - return this - }, - - /** - * Query against the current query strings keys - * or the queryString specified. - * - * @param {string} key - * @param {string} queryString - * @return {string, null} - * @api private - */ - - query : function(key, queryString) { - var queryString = (queryString || (main.location ? main.location.search : null) || '').substring(1) - return inject(queryString.split('&'), null, function(value, pair){ - parts = pair.split('=') - return parts[0] == key ? parts[1].replace(/%20|\+/gmi, ' ') : value - }) - }, - - /** - * Ad-hoc POST request for JSpec server usage. - * - * @param {string} uri - * @param {string} data - * @api private - */ - - post : function(uri, data) { - if (any(hook('posting', uri, data), haveStopped)) return - var request = this.xhr() - request.open('POST', uri, false) - request.setRequestHeader('Content-Type', 'application/json') - request.send(JSpec.JSON.encode(data)) - }, - - /** - * Instantiate an XMLHttpRequest. - * - * Here we utilize IE's lame ActiveXObjects first which - * allow IE access serve files via the file: protocol, otherwise - * we then default to XMLHttpRequest. - * - * @return {XMLHttpRequest, ActiveXObject} - * @api private - */ - - xhr : function() { - return this.ieXhr() || new JSpec.request - }, - - /** - * Return Microsoft piece of crap ActiveXObject. - * - * @return {ActiveXObject} - * @api public - */ - - ieXhr : function() { - function object(str) { - try { return new ActiveXObject(str) } catch(e) {} - } - return object('Msxml2.XMLHTTP.6.0') || - object('Msxml2.XMLHTTP.3.0') || - object('Msxml2.XMLHTTP') || - object('Microsoft.XMLHTTP') - }, - - /** - * Check for HTTP request support. - * - * @return {bool} - * @api private - */ - - hasXhr : function() { - return JSpec.request || 'ActiveXObject' in main - }, - - /** - * Try loading _file_ returning the contents - * string or null. Chain to locate / read a file. - * - * @param {string} file - * @return {string} - * @api public - */ - - tryLoading : function(file) { - try { return JSpec.load(file) } catch (e) {} - }, - - /** - * Load a _file_'s contents. - * - * @param {string} file - * @param {function} callback - * @return {string} - * @api public - */ - - load : function(file, callback) { - if (any(hook('loading', file), haveStopped)) return - if ('readFile' in main) - return readFile(file) - else if (this.hasXhr()) { - var request = this.xhr() - request.open('GET', file, false) - request.send(null) - if (request.readyState == 4 && - (request.status == 0 || - request.status.toString().charAt(0) == 2)) - return request.responseText - } - else - throw new Error("failed to load `" + file + "'") - }, - - /** - * Load, pre-process, and evaluate a file. - * - * @param {string} file - * @param {JSpec} - * @api public - */ - - exec : function(file) { - if (any(hook('executing', file), haveStopped)) return this - eval('with (JSpec){' + this.preprocess(this.load(file)) + '}') - return this - } - } - - // --- Node.js support - - if (typeof GLOBAL === 'object' && typeof exports === 'object') { - var fs = require('fs') - quit = process.exit - print = require('sys').puts - readFile = function(file){ - return fs.readFileSync(file).toString('utf8') - } - } - - // --- Utility functions - - var main = this, - find = JSpec.any, - utils = 'haveStopped stub hookImmutable hook destub map any last pass fail range each option inject select \ - error escape extend puts query strip color does addMatchers callIterator toArray equal'.split(/\s+/) - while (utils.length) eval('var ' + utils[0] + ' = JSpec.' + utils.shift()) - if (!main.setTimeout) main.setTimeout = function(callback){ callback() } - - // --- Matchers - - addMatchers({ - equal : "===", - eql : "equal(actual, expected)", - be : "alias equal", - be_greater_than : ">", - be_less_than : "<", - be_at_least : ">=", - be_at_most : "<=", - be_a : "actual.constructor == expected", - be_an : "alias be_a", - be_an_instance_of : "actual instanceof expected", - be_null : "actual == null", - be_true : "actual == true", - be_false : "actual == false", - be_undefined : "typeof actual == 'undefined'", - be_type : "typeof actual == expected", - match : "typeof actual == 'string' ? actual.match(expected) : false", - respond_to : "typeof actual[expected] == 'function'", - have_length : "actual.length == expected", - be_within : "actual >= expected[0] && actual <= last(expected)", - have_length_within : "actual.length >= expected[0] && actual.length <= last(expected)", - - receive : { defer : true, match : function(actual, method, times) { - var proxy = new JSpec.ProxyAssertion(actual, method, times, this.negate) - JSpec.currentSpec.assertions.push(proxy) - return proxy - }}, - - be_empty : function(actual) { - if (actual.constructor == Object && actual.length == undefined) - for (var key in actual) - return false; - return !actual.length - }, - - include : function(actual) { - for (var state = true, i = 1; i < arguments.length; i++) { - var arg = arguments[i] - switch (actual.constructor) { - case String: - case Number: - case RegExp: - case Function: - state = actual.toString().indexOf(arg) !== -1 - break - - case Object: - state = arg in actual - break - - case Array: - state = any(actual, function(value){ return equal(value, arg) }) - break - } - if (!state) return false - } - return true - }, - - throw_error : { match : function(actual, expected, message) { - try { actual() } - catch (e) { - this.e = e - var assert = function(arg) { - switch (arg.constructor) { - case RegExp : return arg.test(e.message || e.toString()) - case String : return arg == (e.message || e.toString()) - case Function : return e instanceof arg || e.name == arg.name - } - } - return message ? assert(expected) && assert(message) : - expected ? assert(expected) : - true - } - }, message : function(actual, expected, negate) { - // TODO: refactor when actual is not in expected [0] - var message_for = function(i) { - if (expected[i] == undefined) return 'exception' - switch (expected[i].constructor) { - case RegExp : return 'exception matching ' + puts(expected[i]) - case String : return 'exception of ' + puts(expected[i]) - case Function : return expected[i].name || 'Error' - } - } - var exception = message_for(1) + (expected[2] ? ' and ' + message_for(2) : '') - return 'expected ' + exception + (negate ? ' not ' : '' ) + - ' to be thrown, but ' + (this.e ? 'got ' + puts(this.e) : 'nothing was') - }}, - - have : function(actual, length, property) { - return actual[property] == null ? false : actual[property].length == length - }, - - have_at_least : function(actual, length, property) { - return actual[property] == null ? (length === 0) : actual[property].length >= length - }, - - have_at_most :function(actual, length, property) { - return actual[property] == null || actual[property].length <= length - }, - - have_within : function(actual, range, property) { - var length = actual[property] == undefined ? 0 : actual[property].length - return length >= range.shift() && length <= range.pop() - }, - - have_prop : function(actual, property, value) { - var actualVal = actual[property], actualType = typeof actualVal - return (actualType == 'function' || actualType == 'undefined') ? false : - typeof value === 'undefined' || - does(actual[property],'eql',value) - }, - - have_property : function(actual, property, value) { - var actualVal = actual[property], actualType = typeof actualVal - return (actualType == 'function' || actualType == 'undefined') ? false : - typeof value === 'undefined' || - value === actualVal - } - }) - -})() diff --git a/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/jspec.nodejs.js b/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/jspec.nodejs.js deleted file mode 100644 index 6765273c..00000000 --- a/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/jspec.nodejs.js +++ /dev/null @@ -1,18 +0,0 @@ - -// JSpec - node - Copyright TJ Holowaychuk (MIT Licensed) - -JSpec -.include({ - name: 'node', - - // --- Matchers - - matchers : { - have_enumerable_property: 'actual.propertyIsEnumerable(expected)', - have_writable_property: 'Object.getOwnPropertyDescriptor(actual, expected).writable === true', - have_configurable_property: 'Object.getOwnPropertyDescriptor(actual, expected).configurable === true', - have_keys: 'does(Object.keys(actual), "eql", expected)', - have_prototype: 'Object.getPrototypeOf(actual) === expected' - } -}) - diff --git a/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/jspec.shell.js b/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/jspec.shell.js deleted file mode 100644 index cb19c69f..00000000 --- a/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/jspec.shell.js +++ /dev/null @@ -1,39 +0,0 @@ - -// JSpec - Shell - Copyright TJ Holowaychuk (MIT Licensed) - -;(function(){ - - var _quit = quit - - Shell = { - - // --- Global - - main: this, - - // --- Commands - - commands: { - quit: ['Terminate the shell', function(){ _quit() }], - exit: ['Terminate the shell', function(){ _quit() }], - p: ['Inspect an object', function(o){ return o.toSource() }] - }, - - /** - * Start the interactive shell. - * - * @api public - */ - - start : function() { - for (var name in this.commands) - if (this.commands.hasOwnProperty(name)) - this.commands[name][1].length ? - this.main[name] = this.commands[name][1] : - this.main.__defineGetter__(name, this.commands[name][1]) - } - } - - Shell.start() - -})() \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/jspec.timers.js b/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/jspec.timers.js deleted file mode 100644 index c88d10b3..00000000 --- a/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/jspec.timers.js +++ /dev/null @@ -1,90 +0,0 @@ - -// JSpec - Mock Timers - Copyright TJ Holowaychuk (MIT Licensed) - -;(function(){ - - /** - * Version. - */ - - mockTimersVersion = '1.0.2' - - /** - * Localized timer stack. - */ - - var timers = [] - - /** - * Set mock timeout with _callback_ and timeout of _ms_. - * - * @param {function} callback - * @param {int} ms - * @return {int} - * @api public - */ - - setTimeout = function(callback, ms) { - var id - return id = setInterval(function(){ - callback() - clearInterval(id) - }, ms) - } - - /** - * Set mock interval with _callback_ and interval of _ms_. - * - * @param {function} callback - * @param {int} ms - * @return {int} - * @api public - */ - - setInterval = function(callback, ms) { - callback.step = ms, callback.current = callback.last = 0 - return timers[timers.length] = callback, timers.length - } - - /** - * Destroy timer with _id_. - * - * @param {int} id - * @return {bool} - * @api public - */ - - clearInterval = clearTimeout = function(id) { - return delete timers[--id] - } - - /** - * Reset timers. - * - * @return {array} - * @api public - */ - - resetTimers = function() { - return timers = [] - } - - /** - * Increment each timers internal clock by _ms_. - * - * @param {int} ms - * @api public - */ - - tick = function(ms) { - for (var i = 0, len = timers.length; i < len; ++i) - if (timers[i] && (timers[i].current += ms)) - if (timers[i].current - timers[i].last >= timers[i].step) { - var times = Math.floor((timers[i].current - timers[i].last) / timers[i].step) - var remainder = (timers[i].current - timers[i].last) % timers[i].step - timers[i].last = timers[i].current - remainder - while (times-- && timers[i]) timers[i]() - } - } - -})() \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/jspec.xhr.js b/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/jspec.xhr.js deleted file mode 100644 index 3b963105..00000000 --- a/deps/.npm/connect/0.2.5/package/support/koala/spec/lib/jspec.xhr.js +++ /dev/null @@ -1,210 +0,0 @@ - -// JSpec - XHR - Copyright TJ Holowaychuk (MIT Licensed) - -(function(){ - - var lastRequest - - // --- Original XMLHttpRequest - - var OriginalXMLHttpRequest = 'XMLHttpRequest' in this ? - XMLHttpRequest : - function(){} - var OriginalActiveXObject = 'ActiveXObject' in this ? - ActiveXObject : - undefined - - // --- MockXMLHttpRequest - - var MockXMLHttpRequest = function() { - this.requestHeaders = {} - } - - MockXMLHttpRequest.prototype = { - status: 0, - async: true, - readyState: 0, - responseXML: null, - responseText: '', - abort: function(){}, - onreadystatechange: function(){}, - - /** - * Return response headers hash. - */ - - getAllResponseHeaders : function(){ - return JSpec.inject(this.responseHeaders, '', function(buf, key, val){ - return buf + key + ': ' + val + '\r\n' - }) - }, - - /** - * Return case-insensitive value for header _name_. - */ - - getResponseHeader : function(name) { - return this.responseHeaders[name.toLowerCase()] - }, - - /** - * Set case-insensitive _value_ for header _name_. - */ - - setRequestHeader : function(name, value) { - this.requestHeaders[name.toLowerCase()] = value - }, - - /** - * Open mock request. - */ - - open : function(method, url, async, user, password) { - this.user = user - this.password = password - this.url = url - this.readyState = 1 - this.method = method.toUpperCase() - if (async != undefined) this.async = async - if (this.async) this.onreadystatechange() - }, - - /** - * Send request _data_. - */ - - send : function(data) { - var self = this - this.data = data - this.readyState = 4 - if (this.method == 'HEAD') this.responseText = null - this.responseHeaders['content-length'] = (this.responseText || '').length - if(this.async) this.onreadystatechange() - this.populateResponseXML() - lastRequest = function(){ - return self - } - }, - - /** - * Parse request body and populate responseXML if response-type is xml - * Based on the standard specification : http://www.w3.org/TR/XMLHttpRequest/ - */ - populateResponseXML: function() { - var type = this.getResponseHeader("content-type") - if (!type || !this.responseText || !type.match(/(text\/xml|application\/xml|\+xml$)/g)) - return - this.responseXML = JSpec.parseXML(this.responseText) - } - } - - // --- Response status codes - - JSpec.statusCodes = { - 100: 'Continue', - 101: 'Switching Protocols', - 200: 'OK', - 201: 'Created', - 202: 'Accepted', - 203: 'Non-Authoritative Information', - 204: 'No Content', - 205: 'Reset Content', - 206: 'Partial Content', - 300: 'Multiple Choice', - 301: 'Moved Permanently', - 302: 'Found', - 303: 'See Other', - 304: 'Not Modified', - 305: 'Use Proxy', - 307: 'Temporary Redirect', - 400: 'Bad Request', - 401: 'Unauthorized', - 402: 'Payment Required', - 403: 'Forbidden', - 404: 'Not Found', - 405: 'Method Not Allowed', - 406: 'Not Acceptable', - 407: 'Proxy Authentication Required', - 408: 'Request Timeout', - 409: 'Conflict', - 410: 'Gone', - 411: 'Length Required', - 412: 'Precondition Failed', - 413: 'Request Entity Too Large', - 414: 'Request-URI Too Long', - 415: 'Unsupported Media Type', - 416: 'Requested Range Not Satisfiable', - 417: 'Expectation Failed', - 422: 'Unprocessable Entity', - 500: 'Internal Server Error', - 501: 'Not Implemented', - 502: 'Bad Gateway', - 503: 'Service Unavailable', - 504: 'Gateway Timeout', - 505: 'HTTP Version Not Supported' - } - - /** - * Mock XMLHttpRequest requests. - * - * mockRequest().and_return('some data', 'text/plain', 200, { 'X-SomeHeader' : 'somevalue' }) - * - * @return {hash} - * @api public - */ - - function mockRequest() { - return { and_return : function(body, type, status, headers) { - XMLHttpRequest = MockXMLHttpRequest - ActiveXObject = false - status = status || 200 - headers = headers || {} - headers['content-type'] = type - JSpec.extend(XMLHttpRequest.prototype, { - responseText: body, - responseHeaders: headers, - status: status, - statusText: JSpec.statusCodes[status] - }) - }} - } - - /** - * Unmock XMLHttpRequest requests. - * - * @api public - */ - - function unmockRequest() { - XMLHttpRequest = OriginalXMLHttpRequest - ActiveXObject = OriginalActiveXObject - } - - JSpec.include({ - name: 'Mock XHR', - - // --- Utilities - - utilities : { - mockRequest: mockRequest, - unmockRequest: unmockRequest - }, - - // --- Hooks - - afterSpec : function() { - unmockRequest() - }, - - // --- DSLs - - DSLs : { - snake : { - mock_request: mockRequest, - unmock_request: unmockRequest, - last_request: function(){ return lastRequest() } - } - } - - }) -})() diff --git a/deps/.npm/connect/0.2.5/package/support/koala/spec/node.js b/deps/.npm/connect/0.2.5/package/support/koala/spec/node.js deleted file mode 100644 index 248ae60b..00000000 --- a/deps/.npm/connect/0.2.5/package/support/koala/spec/node.js +++ /dev/null @@ -1,16 +0,0 @@ - -require.paths.unshift('spec', './spec/lib', 'lib') -require('jspec') -require('unit/spec.helper') -koala = require('koala') - -JSpec - .exec('spec/unit/spec.js') - .exec('spec/unit/lexer.spec.js') - .exec('spec/unit/formatter.spec.js') - .exec('spec/unit/formatter.html.spec.js') - .exec('spec/unit/grammars.javascript.spec.js') - .exec('spec/unit/grammars.ruby.spec.js') - .exec('spec/unit/grammars.c.spec.js') - .run({ reporter: JSpec.reporters.Terminal, fixturePath: 'spec/fixtures', failuresOnly: true }) - .report() diff --git a/deps/.npm/connect/0.2.5/package/support/koala/spec/unit/formatter.html.spec.js b/deps/.npm/connect/0.2.5/package/support/koala/spec/unit/formatter.html.spec.js deleted file mode 100644 index 8f1d70fd..00000000 --- a/deps/.npm/connect/0.2.5/package/support/koala/spec/unit/formatter.html.spec.js +++ /dev/null @@ -1,22 +0,0 @@ - -HTML = require('koala/formatters/html').HTML - -describe 'formatters' - describe 'HTML' - describe '.render()' - it 'should render html' - var ruby = new Lexer({ - keyword: /^(def|end)\b/, - constant: /^([A-Z]\w*|__FILE__)/, - string: /^(".*?")/, - id: /^(\w+)/ - }) - var html = HTML.render(ruby, 'def foo\n "bar" & "that" end') - html.should.not.include ' ' - html.should.include 'def' - html.should.include '\n' - html.should.include '&' - end - end - end -end \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/koala/spec/unit/formatter.spec.js b/deps/.npm/connect/0.2.5/package/support/koala/spec/unit/formatter.spec.js deleted file mode 100644 index daea1434..00000000 --- a/deps/.npm/connect/0.2.5/package/support/koala/spec/unit/formatter.spec.js +++ /dev/null @@ -1,23 +0,0 @@ - -Formatter = require('koala/formatter').Formatter - -describe 'Formatter' - describe '.render()' - it 'should render using the given callback' - var ruby = new Lexer({ - keyword: /^(def|end)\b/, - constant: /^([A-Z]\w*|__FILE__)/, - string: /^(".*?")/, - id: /^(\w+)/ - }) - var formatter = new Formatter(function(key, val){ - return key === null - ? val - : '' + val + '' - }) - var html = formatter.render(ruby, 'def foo\n "bar"\nend') - html.should.not.include ' ' - html.should.include 'def' - end - end -end \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/koala/spec/unit/grammars.c.spec.js b/deps/.npm/connect/0.2.5/package/support/koala/spec/unit/grammars.c.spec.js deleted file mode 100644 index 20924300..00000000 --- a/deps/.npm/connect/0.2.5/package/support/koala/spec/unit/grammars.c.spec.js +++ /dev/null @@ -1,56 +0,0 @@ - -C = require('koala/grammars/c').C - -describe 'grammars' - describe 'C' - it 'should scan simple strings' - C.scan('"foo"').should.eql [['string', '"foo"']] - C.scan("'bar'").should.eql [['string', "'bar'"]] - end - - it 'should scan variables' - C.scan('fooBarBaz').should.eql [['variable', 'fooBarBaz']] - C.scan('foo_bar_baz64').should.eql [['variable', 'foo_bar_baz64']] - C.scan('__dirname').should.eql [['variable', '__dirname']] - end - - it 'should scan numbers' - C.scan('99').should.eql [['number integer', '99']] - C.scan('15.99').should.eql [['number float', '15.99']] - end - - it 'should scan uppercase ids as classes' - C.scan('B').should.eql [['class', 'B']] - C.scan('Array').should.eql [['class', 'Array']] - C.scan('Base64').should.eql [['class', 'Base64']] - C.scan('Base_64').should.eql [['class', 'Base_64']] - end - - it 'should scan keywords' - C.scan('return').should.eql [['keyword', 'return']] - C.scan('float').should.eql [['keyword', 'float']] - end - - it 'should scan pre-processor directives' - C.scan('#ifndef VERSION').should.eql [['directive', '#ifndef VERSION']] - C.scan('#define VERSION "0.0.1"').should.include ['directive', '#define VERSION'] - end - - it 'should not scan ids as keywords' - C.scan('returning').should.not.include ['keyword', 'returning'] - C.scan('floating').should.not.include ['keyword', 'floating'] - end - - it 'should scan single-line comments' - C.scan('// foo bar\nreturn').should.eql [['comment', '// foo bar'], [null, '\n'], ['keyword', 'return']] - end - - it 'should scan span comments' - C.scan('/* foo bar */').should.eql [['multiline comment', '/* foo bar */']] - end - - it 'should scan multi-line span comments' - C.scan('/* foo\n bar\n */').should.eql [['multiline comment', '/* foo\n bar\n */']] - end - end -end \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/koala/spec/unit/grammars.javascript.spec.js b/deps/.npm/connect/0.2.5/package/support/koala/spec/unit/grammars.javascript.spec.js deleted file mode 100644 index db86a07a..00000000 --- a/deps/.npm/connect/0.2.5/package/support/koala/spec/unit/grammars.javascript.spec.js +++ /dev/null @@ -1,60 +0,0 @@ - -JavaScript = require('koala/grammars/javascript').JavaScript - -describe 'grammars' - describe 'JavaScript' - it 'should scan this' - JavaScript.scan('this').should.eql [['this', 'this']] - end - - it 'should scan simple strings' - JavaScript.scan('"foo"').should.eql [['string', '"foo"']] - JavaScript.scan("'bar'").should.eql [['string', "'bar'"]] - end - - it 'should scan variables' - JavaScript.scan('fooBarBaz').should.eql [['variable', 'fooBarBaz']] - JavaScript.scan('foo_bar_baz64').should.eql [['variable', 'foo_bar_baz64']] - JavaScript.scan('__dirname').should.eql [['variable', '__dirname']] - end - - it 'should scan numbers' - JavaScript.scan('99').should.eql [['number integer', '99']] - JavaScript.scan('15.99').should.eql [['number float', '15.99']] - end - - it 'should scan uppercase ids as classes' - JavaScript.scan('B').should.eql [['class', 'B']] - JavaScript.scan('Array').should.eql [['class', 'Array']] - JavaScript.scan('Base64').should.eql [['class', 'Base64']] - JavaScript.scan('Base_64').should.eql [['class', 'Base_64']] - end - - it 'should scan keywords' - JavaScript.scan('new').should.eql [['keyword', 'new']] - JavaScript.scan('NaN').should.eql [['keyword', 'NaN']] - end - - it 'should not scan ids as keywords' - JavaScript.scan('newly').should.not.include ['keyword', 'new'] - JavaScript.scan('thevariable').should.not.include ['keyword', 'var'] - end - - it 'should scan regular expressions' - JavaScript.scan('/foo/gm').should.eql [['regexp', '/foo/gm']] - end - - it 'should scan single-line comments' - JavaScript.scan('// foo bar\nnew').should.eql [['comment', '// foo bar'], [null, '\n'], ['keyword', 'new']] - end - - it 'should scan span comments' - JavaScript.scan('/* foo bar */').should.eql [['multiline comment', '/* foo bar */']] - end - - it 'should scan multi-line span comments' - JavaScript.scan('/* foo\n bar\n */').should.eql [['multiline comment', '/* foo\n bar\n */']] - JavaScript.scan('/* foo\n *bar\n *\n *\n*/').should.eql [['multiline comment', '/* foo\n *bar\n *\n *\n*/']] - end - end -end \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/koala/spec/unit/grammars.ruby.spec.js b/deps/.npm/connect/0.2.5/package/support/koala/spec/unit/grammars.ruby.spec.js deleted file mode 100644 index d7783e84..00000000 --- a/deps/.npm/connect/0.2.5/package/support/koala/spec/unit/grammars.ruby.spec.js +++ /dev/null @@ -1,98 +0,0 @@ - -Ruby = require('koala/grammars/ruby').Ruby - -describe 'grammars' - describe 'Ruby' - it 'should scan self as "this"' - Ruby.scan('self').should.eql [['this', 'self']] - end - - it 'should scan simple strings' - Ruby.scan('"foo"').should.eql [['string', '"foo"']] - Ruby.scan("'bar'").should.eql [['string', "'bar'"]] - end - - it 'should scan symbols' - Ruby.scan(':foo').should.eql [['symbol string', ':foo']] - Ruby.scan(':Base64').should.eql [['symbol string', ':Base64']] - Ruby.scan(':foo_bar').should.eql [['symbol string', ':foo_bar']] - Ruby.scan(':"baz that"').should.eql [['symbol string', ':"baz that"']] - Ruby.scan(":'yay'").should.eql [['symbol string', ":'yay'"]] - end - - it 'should scan variables' - Ruby.scan('fooBarBaz').should.eql [['variable', 'fooBarBaz']] - Ruby.scan('foo_bar_baz64').should.eql [['variable', 'foo_bar_baz64']] - Ruby.scan('__dirname').should.eql [['variable', '__dirname']] - end - - it 'should scan global variables' - Ruby.scan('$foo').should.eql [['global variable', '$foo']] - Ruby.scan('$1').should.eql [['global variable', '$1']] - Ruby.scan('$$').should.eql [['global variable', '$$']] - Ruby.scan('$?').should.eql [['global variable', '$?']] - Ruby.scan('$:').should.eql [['global variable', '$:']] - Ruby.scan('$"').should.eql [['global variable', '$"']] - Ruby.scan('$-I').should.eql [['global variable', '$-I']] - Ruby.scan('($0)').should.eql [[null, '('], ['global variable', '$0'], [null, ')']] - Ruby.scan('$SomethingElse').should.eql [['global variable', '$SomethingElse']] - end - - it 'should scan instance variables' - Ruby.scan('@base64').should.eql [['inst variable', '@base64']] - Ruby.scan('@foo').should.eql [['inst variable', '@foo']] - Ruby.scan('@fooBarBaz').should.eql [['inst variable', '@fooBarBaz']] - Ruby.scan('@foo_bar').should.eql [['inst variable', '@foo_bar']] - Ruby.scan('@Bar').should.eql [['inst variable', '@Bar']] - end - - it 'should scan class variables' - Ruby.scan('@@base64').should.eql [['class variable', '@@base64']] - Ruby.scan('@@foo').should.eql [['class variable', '@@foo']] - Ruby.scan('@@fooBarBaz').should.eql [['class variable', '@@fooBarBaz']] - Ruby.scan('@@foo_bar').should.eql [['class variable', '@@foo_bar']] - Ruby.scan('@@Bar').should.eql [['class variable', '@@Bar']] - end - - it 'should scan numbers' - Ruby.scan('99').should.eql [['number integer', '99']] - Ruby.scan('15.99').should.eql [['number float', '15.99']] - end - - it 'should scan uppercase ids as classes' - Ruby.scan('B').should.eql [['class', 'B']] - Ruby.scan('Array').should.eql [['class', 'Array']] - Ruby.scan('Base64').should.eql [['class', 'Base64']] - Ruby.scan('Base_64').should.eql [['class', 'Base_64']] - Ruby.scan('Foo::Bar').should.eql [['class', 'Foo'], ['class', '::Bar']] - Ruby.scan('::Bar').should.eql [['class', '::Bar']] - end - - it 'should scan keywords' - Ruby.scan('return').should.eql [['keyword', 'return']] - Ruby.scan('defined').should.eql [['keyword', 'defined']] - end - - it 'should not scan ids as keywords' - Ruby.scan('returning').should.not.include ['keyword', 'returning'] - Ruby.scan('redefined').should.not.include ['keyword', 'redefined'] - end - - it 'should scan regular expressions' - Ruby.scan('/foo/gm').should.eql [['regexp', '/foo/gm']] - end - - it 'should scan single-line comments' - Ruby.scan('# foo bar\nreturn').should.eql [['comment', '# foo bar'], [null, '\n'], ['keyword', 'return']] - end - - it 'should scan span comments' - Ruby.scan('=begin foo bar =end').should.eql [['multiline comment', '=begin foo bar =end']] - end - - it 'should scan multi-line span comments' - Ruby.scan('=begin foo\n bar\n =end').should.eql [['multiline comment', '=begin foo\n bar\n =end']] - Ruby.scan('=begin foo\n *bar\n *\n *\n=end').should.eql [['multiline comment', '=begin foo\n *bar\n *\n *\n=end']] - end - end -end \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/koala/spec/unit/lexer.spec.js b/deps/.npm/connect/0.2.5/package/support/koala/spec/unit/lexer.spec.js deleted file mode 100644 index d190f467..00000000 --- a/deps/.npm/connect/0.2.5/package/support/koala/spec/unit/lexer.spec.js +++ /dev/null @@ -1,40 +0,0 @@ - -Lexer = require('koala/lexer').Lexer - -describe 'Lexer' - describe '#scan()' - it 'should scan the given hash of rules' - var lexer = new Lexer({ - keyword: /^(def|end)\b/, - constant: /^([A-Z]\w*|__FILE__)/, - string: function(str){ - if (str.charAt(0) !== '"') return - var buf = '"', - str = str.substr(1) - while (str.charAt(0) !== '' && str.charAt(0) !== '"') - buf += str.charAt(0), - str = str.substr(1) - return buf + '"' - }, - id: /^(\w+)/ - }) - var tokens = lexer.scan('\ndef foo; "bar" end Array __FILE__') - var expected = [ - [null, '\n'], - ['keyword', 'def'], - [null, ' '], - ['id', 'foo'], - [null, ';'], - [null, ' '], - ['string', '"bar"'], - [null, ' '], - ['keyword', 'end'], - [null, ' '], - ['constant', 'Array'], - [null, ' '], - ['constant', '__FILE__'] - ] - tokens.should.eql expected - end - end -end \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/koala/spec/unit/spec.helper.js b/deps/.npm/connect/0.2.5/package/support/koala/spec/unit/spec.helper.js deleted file mode 100644 index e69de29b..00000000 diff --git a/deps/.npm/connect/0.2.5/package/support/koala/spec/unit/spec.js b/deps/.npm/connect/0.2.5/package/support/koala/spec/unit/spec.js deleted file mode 100644 index a9e7f596..00000000 --- a/deps/.npm/connect/0.2.5/package/support/koala/spec/unit/spec.js +++ /dev/null @@ -1,19 +0,0 @@ - -describe 'koala' - describe '.version' - it 'should be a triplet' - koala.version.should.match(/^\d+\.\d+\.\d+$/) - end - end - - describe '.render()' - it 'should auto-detect the type of file' - koala.render('.js', '12').should.include '12' - koala.render('foo.bar.js', '12').should.include '12' - end - - it 'should throw an error when not supported' - -{ koala.render('.foo', 'something') }.should.throw_error "syntax highlighting for `.foo' is not supported" - end - end -end \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/less/LICENSE b/deps/.npm/connect/0.2.5/package/support/less/LICENSE deleted file mode 100644 index 40f3b781..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/LICENSE +++ /dev/null @@ -1,179 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -Copyright (c) 2009-2010 Alexis Sellier diff --git a/deps/.npm/connect/0.2.5/package/support/less/Makefile b/deps/.npm/connect/0.2.5/package/support/less/Makefile deleted file mode 100644 index ec3b16a3..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/Makefile +++ /dev/null @@ -1,44 +0,0 @@ -# -# Run all tests -# -test: - node test/less-test.js - -# -# Run benchmark -# -benchmark: - node benchmark/less-benchmark.js - -# -# Build less.js -# -SRC = lib/less -HEADER = build/header.js -VERSION = `cat package.json | grep version \ - | grep -o '[0-9]\.[0-9]\.[0-9]\+'` -DIST = dist/less-${VERSION}.js -DIST_MIN = dist/less-${VERSION}.min.js - -less: - @@mkdir -p dist - @@touch ${DIST} - @@cat ${HEADER} | sed s/@VERSION/${VERSION}/ > ${DIST} - @@echo "(function (window, undefined) {" >> ${DIST} - @@cat build/require.js\ - build/ecma-5.js\ - ${SRC}/parser.js\ - ${SRC}/functions.js\ - ${SRC}/tree/*.js\ - ${SRC}/tree.js\ - ${SRC}/browser.js >> ${DIST} - @@echo "})(window);" >> ${DIST} - @@echo ${DIST} built. - -min: less - @@echo minifying... - @@cat ${HEADER} | sed s/@VERSION/${VERSION}/ > ${DIST_MIN} - @@java -jar build/compiler.jar\ - --js ${DIST} >> ${DIST_MIN} - -.PHONY: test benchmark diff --git a/deps/.npm/connect/0.2.5/package/support/less/README.md b/deps/.npm/connect/0.2.5/package/support/less/README.md deleted file mode 100644 index 5359f9eb..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/README.md +++ /dev/null @@ -1,45 +0,0 @@ -less.js -======= - -about ------ - -less.js is the next evolution of [LESS](http://lesscss.org), eventually, it will become LESS 2.0. -less.js is a complete rewrite of LESS in JavaScript, and will be able to run directly in the browser, -as well as on the server, with node.js. - -where do I get it? ------------------- - -The latest builds are in the `dist/` folder. - -synopsis --------- - -### in node.js - - var less = require('less'); - - less.render(".class { width: 10px * 2 }", function (e, css) { - sys.puts(css); // .class { width: 20px } - }); - -### via the command-line (requires node) - - bin/lessc style.less - -### in the browser - -Get the pre-built version from the `dist/` folder, and include it as such: - - - - -Note the `rel="stylesheet/less"` for all stylesheets you want to parse with LESS. - -installation ------------- - -In node: - - $ npm install less diff --git a/deps/.npm/connect/0.2.5/package/support/less/benchmark/benchmark.less b/deps/.npm/connect/0.2.5/package/support/less/benchmark/benchmark.less deleted file mode 100644 index 6dd3d972..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/benchmark/benchmark.less +++ /dev/null @@ -1,3979 +0,0 @@ -@bg: #f01; -@white: #fff; -@grey: #eee; -@black: #000; -@blue: #000; -@accent_colour: #000; -@light_grey: #eee; -@dark_grey: #eee; -@yellow: #422; -@red: #ff0000; -@colour_positive: #ff0000; -@colour_negative: #ff0000; - -.box_shadow () { -} -.text_shadow () { -} -.border_radius () { -} -.border_radius_top_left () { -} -.border_radius_top_right () { -} -.border_radius_bottom_right () { -} -.border_radius_bottom_left () { -} -.border_radius_top () { -} -.border_radius_right () { -} -.border_radius_bottom () { -} -.border_radius_left () { -} -div.browse { - margin: 0 0 20px; - &.class { - padding: 0; - } - div.header { - padding: 10px 10px 9px; text-align: left; background: @bg url('/images/panel_header_bg.png') repeat-x top left; - border-bottom: 1px solid (@bg * 0.66 + @black * 0.33); line-height: 1; height: 18px; - .border_radius_top(3); color: @light_grey; - h3 { font-size: 16px; margin: 0; color: @white; .text_shadow(1, 1, 0, @bg * 0.66 + @black * 0.33); } - span.filter { - float: left; display: block; overflow: hidden; position: relative; z-index: 5; - a { - margin: 0 1px 0 0; display: block; float: left; padding: 0 8px; height: 18px; font-weight: bold; font-size: 10px; line-height: 18px; - text-transform: uppercase; background: url('/images/transparent_backgrounds/black_50.png'); color: @light_grey; text-decoration: none; position: relative; z-index: 3; - .active { - background: @white; color: @black; z-index: 4; - :hover { color: @black; } - } - :hover { color: @white; } - :first-child { .border_radius_left(2); } - :last-child { .border_radius_right(2); margin-right: 0; } - } - } - - span.filter.dropdown { - margin: 0; position: relative; overflow: visible; - a { - .border_radius(2); background: @white; color: @black; margin: 0; position: relative; padding-right: 25px; - img { float: left; margin: 4px 5px 0 0; } - b.arrow { - float: right; display: block; height: 0; width: 0; border: 5px solid transparent; border-top: 5px solid @black; border-bottom: none; - position: absolute; top: 6px; right: 10px; - } - :hover { - background: @accent_colour; color: @white; - b.arrow { border-top: 5px solid @white; } - } - } - ul { - position: absolute; top: 100%; left: 0; margin: 1px 0 0; padding: 0; background: @white; .border_radius(2); - .box_shadow(0, 1, 1, @black); - li { - list-style: none; display: block; padding: 0; margin: 0; - a { - display: block; height: 18px; line-height: 18px; color: @black; font-size: 10px; text-transform: uppercase; background: transparent; - border-bottom: 1px solid (@light_grey * 0.66 + @white * 0.33); float: none; margin: 0; .border_radius(0); white-space: nowrap; - :hover { background: url('/images/transparent_backgrounds/accent_colour_25.png'); color: @black; } - } - :last-child { - a { border: none; } - } - } - } - } - span.filter.dropdown.sort { float: left; margin: 0 0 0 10px; } - span.filter.dropdown.localisation { float: left; margin: 0 0 0 10px; } - a.more { - float: right; color: @white; .text_shadow(1, 1, 0, @bg * 0.66 + @black * 0.33); font-size: 14px; font-weight: bold; - position: relative; top: 2px; - :hover { text-decoration: none; } - } - } - > ul { - margin: 0; background: @white; padding: 10px 0 0 10px; .border_radius(3); position: relative; - li { - display: block; float: left; list-style: none; margin: 0 10px 10px 0; padding: 5px; position: relative; - background: @white; width: 130px; border: 1px solid (@light_grey * 0.33 + @white * 0.66); .border_radius(2); - a.remove { - position: absolute; height: 16px; width: 16px; padding: 3px; background: @accent_colour; - .border_radius(99); display: none; z-index: 3; top: -8px; right: -8px; - img { vertical-align: middle; } - } - div.thumbnail { - .border_radius_top(3); position: relative; z-index: 3; - .marker { - position: absolute; padding: 2px; .border_radius(2); z-index: 3; - background: url('/images/transparent_backgrounds/white_75.png'); height: 12px; width: 12px; - } - .marker.coupon { - height: auto; width: auto; top: 10px; right: -3px; padding: 0; background: transparent; overflow: hidden; position: absolute; - b { - display: block; height: 0; width: 0; float: left; border: 14px solid transparent; border-top: 14px solid @accent_colour; - border-bottom: none; border-right: none; float: left; - } - span { - color: @white; font-size: 10px; font-weight: bold; text-transform: uppercase; height: 14px; line-height: 14px; display: block; - padding: 0 4px 0 2px; background: @accent_colour; .text_shadow(1, 1, 0px, (@accent_colour * 0.75 + @black * 0.25)); margin: 0 0 0 14px; - } - } - .marker.video { - position: absolute; left: 50%; top: 50%; background: @white; width: 10px; height: 10px; - b { display: block; width: 0; height: 0; border: 5px solid transparent; border-left: 10px solid @black; border-right: none; } - } - .marker.endorsed_by_me { background: none; padding: 0; right: 0; bottom: -32px; .border_radius(2); background: @white; } - a.thumbnail { - display: block; overflow: hidden; position: relative; text-align: center; - img { position: relative; display: block; margin: auto; } - } - } - div.text { - margin: 3px 0 0; display: block; - a { text-decoration: none; } - a.title { - display: block; text-decoration: none; font-weight: bold; font-size: 12px; line-height: 16px; - white-space: nowrap; height: 16px; overflow: hidden; - :before { - display: block; height: 32px; width: 20px; content: " "; float: right; right: -15px; top: -8px; - background: @white; position: relative; z-index: 1; .box_shadow(-5, 0, 10, @white); - } - } - small { - font-size: 11px; line-height: 13px; color: @grey; display: block; height: 13px; overflow: hidden; white-space: nowrap; - a { font-weight: bold; } - :before { - display: block; height: 32px; width: 20px; content: " "; float: right; right: -15px; top: -8px; - background: @white; position: relative; z-index: 1; .box_shadow(-5, 0, 10, @white); - } - } - } - :hover { - background: @accent_colour; - a.remove { display: block; } - div.thumbnail { - a.marker.remove, a.marker.video { - b { display: inline-block; } - } - a.marker.video { .box_shadow(0, 0, 2, @black); } - } - div.text { - a { color: @white; } - a.title:before { background: @accent_colour; .box_shadow(-5, 0, 10, @accent_colour); } - small { - color: @white * 0.75 + @accent_colour * 0.25; - :before { background: @accent_colour; .box_shadow(-5, 0, 10, @accent_colour); } - } - } - div.footer a { color: @white; } - } - } - > li.ad div.thumbnail a.thumbnail { - width: 130px; height: 97px; - img { width: 100%; height: 100%; } - } - > li.brand div.thumbnail a.thumbnail { - width: 120px; height: 87px; padding: 5px; background: @white; .border_radius(2); - img { max-width: 120px; max-height: 87px; } - } - li.paginate { - margin-bottom: 0; - a { - display: block; position: relative; text-decoration: none; height: 131px; - div.arrow { - background: #81c153 url('/images/button_bg.png') repeat-x left top; border: 1px solid (@accent_colour * 0.75 + @black * 0.25); - height: 44px; .border_radius(99); width: 44px; margin: 0 auto; position: relative; top: 32px; - b { text-indent: -9000px; display: block; border: 10px solid transparent; width: 0; height: 0; position: relative; top: 12px; } - } - div.label { - position: absolute; bottom: 5px; left: 0; right: 0; line-height: 13px; - color: @accent_colour * 0.85 + @black * 0.15; text-decoration: none; - font-weight: bold; font-size: 12px; text-align: center; - } - :hover { - div.arrow { background: #abd56e url('/images/button_bg.png') repeat-x left -44px; } - } - } - :hover { background: transparent; } - } - li.paginate.previous a div b { border-right: 15px solid @white; border-left: none; left: 12px; } - li.paginate.next a div b { border-left: 15px solid @white; border-right: none; left: 16px; } - } - > div.footer { - padding: 9px 10px 10px; background: @light_grey * 0.75 + @white * 0.25; overflow: hidden; - border-top: 1px solid @light_grey; .border_radius_bottom(3); - div.info { - float: left; color: @grey; - strong { color: @black; font-weight: normal; } - } - div.pagination { - float: right; - > * { - display: inline-block; line-height: 1; padding: 0 6px; line-height: 18px; height: 18px; background: @white; - .border_radius(3); text-decoration: none; font-weight: bold; - font-size: 10px; text-transform: uppercase; - } - a { color: @grey; } - a:hover { color: @black; } - span.disabled { color: @light_grey; } - span.current { color: @white; background: @bg; border: none; } - span.current:hover { color: @white; } - } - } -} -div.browse.with_categories { margin: 0 0 0 160px; } -div.browse.with_options > ul { .border_radius_top(0); } -div.browse.with_footer > ul { .border_radius_bottom(0); } -/* Browse List */ -div.browse.list { -> ul { - margin: 0; min-height: 320px; - padding: 10px 0 0 10px; overflow: hidden; - > li { - display: block; list-style: none; margin: 0 10px 10px 0; padding: 5px; - .border_radius(3); position: relative; line-height: normal; - .marker { - position: absolute; padding: 2px; .border_radius(2); - background: url('/images/transparent_backgrounds/white_75.png'); - img { height: 12px; width: 12px; } - } - img.marker { height: 12px; width: 12px; } - span.marker.new { - color: black; left: -5px; top: -5px; background: none; background-color: @white * 0.1 + @yellow * 0.6 + @red * 0.3; line-height: 1; padding: 2px 5px; - font-weight: bold; - } - a.marker.media_type { - display: inline-block; text-decoration: none; top: 39px; left: 8px; - font-size: 10px; - b { font-weight: normal; margin: 0 0 0 2px; line-height: 1; display: none; } - img { vertical-align: middle; } - } - a.thumbnail { - float: left; - width: 68px; display: block; overflow: hidden; - border: 1px solid @light_grey; - :hover { border-color: @accent_colour; } - } - span.title_brand { - display: block; margin: 0 0 2px 75px; - a { margin: 0; display: inline; } - a.brand_name { font-weight: normal; font-size: 12px; } - } - a.ad_title { - font-weight: bold; font-size: 14px; margin: 0 0 0 75px; display: block; - } - a.brand_name { - font-weight: bold; font-size: 14px; margin: 0 0 0 75px; display: block; - } - small { - display: block; color: @grey; margin: 0 0 0 75px; font-size: 12px; - } - small.brand_name { display: inline; margin: 0; } - ul.chart { - margin: 0 0 0 80px; - height: 39px; - } - ul.networks { - margin: 3px 0 0 75px; padding: 0; overflow: hidden; - li { display: block; float: left; margin: 0 5px 0 0; line-height: 1; } - } - div.points { - display: none; - font-size: 12px; text-align: right; - label { color: @grey; } - } - a.remove { bottom: -3px; right: -3px; } - } - li.ad { - a.thumbnail { height: 51px; } - span.title_brand { - small.brand_name { - display: block; - } - } - } - li.brand { - a.thumbnail { height: 68px; } - } - } -} -div.browse.list.with_options ul { .border_radius_top(0); } -div.browse.list.with_footer ul { .border_radius_bottom(0); } -div.browse.list.cols_2 { - > ul { - > li { - width: 285px; float: left; - :hover { - background: @white; - } - } - } -} -div.browse.ads.list { - > ul { - > li { - height: 53px; - a.thumbnail { - height: 51px; - } - } - } -} -div.browse.brands.list { - > ul { - > li { - height: 68px; - a.thumbnail { - height: 66px; - } - } - } -} - -/* Categories List */ -#categories { - margin: 40px 0 0; width: 160px; float: left; position: relative; z-index: 1; - ul { - margin: 0; padding: 10px 0 0; - li { - list-style: none; margin: 0; padding: 0; font-size: 14px; - a { color: @grey; display: block; padding: 5px 10px 5px 15px; text-decoration: none; .border_radius_left(3); } - a:hover { color: @black; background: @light_grey * 0.15 + @white * 0.85; } - } - .all a { font-weight: bold; } - .current a { - background: @white; color: @black; border: 1px solid (@light_grey * 0.25 + @white * 0.75); border-right: none; border-left: 5px solid @bg; - padding-left: 10px; - } - } -} - -/* Ads > Show */ -#ad { - div.header { - overflow: hidden; - h3 { font-size: 16px; margin: 0 0 3px; } - small { - a.category { font-weight: bold; color: @accent_colour; } - span.networks img { position: relative; top: 3px; } - } - span.brand { - float: right; color: @white; - a.brand_name { font-weight: bold; color: @accent_colour; } - } - } - div.content { - padding: 0; position: relative; - a.toggle_size { - display: block; .border_radius(3); background-color: @black; padding: 0 5px 0 26px; - background-position: 5px center; background-repeat: no-repeat; text-decoration: none; margin: 5px 5px 0 0; - position: absolute; top: 0; right: 0; line-height: 25px; z-index: 45; - } - img.creative { margin: 0 auto; max-width: 540px; display: block; } - object { position: relative; z-index: 44; } - object.video { line-height: 0; font-size: 0; } - object embed { position: relative; z-index: 45; line-height: 0; font-size: 0; } - } - div.content.not_video { - padding: 40px; text-align: center; - * { margin-left: auto; margin-right: auto; } - object.flash { margin-bottom: 0; } - } - div.footer { - padding: 0; - div.vote_views { - padding: 5px 10px; overflow: hidden; - div.share { float: right; margin: 2px 0 0 0; } - #login_register_msg, #encourage_vote_msg { line-height: 22px; font-weight: bold; color: @black; } - } - } -} -#sidebar { - #meta { - table { - margin: 0; - tr:last-child td { padding-bottom: 0; } - td { - padding: 0 0 5px; - ul.networks { - margin: 0; padding: 0; - li { - list-style: none; display: inline; - } - li { - } - } - } - td.label { color: @grey; white-space: nowrap; width: 1%; text-align: right; padding-right: 5px; } - } - } -} - -/* Voting */ -div.voted { - font-size: 12px; line-height: 22px; color: @black; display: inline-block; font-weight: bold; - img { float: left; margin-right: 5px; padding: 3px; .border_radius(3); } -} -#voted_up { - img { background: @colour_positive * 0.66 + @bg * 0.15; } -} -#voted_down { - img { background: @colour_negative * 0.66 + @bg * 0.15; } -} -#encourage_comment { - display: inline-block; line-height: 22px; font-weight: bold; -} -#vote { - overflow: hidden; font-size: 12px; line-height: 22px; color: @black; float: left; - a { - color: @white; font-weight: bold; overflow: hidden; display: block; - width: 16px; text-decoration: none; text-align: center; font-size: 10px; padding: 3px; text-transform: uppercase; - } - a.up { - float: left; background: @colour_positive * 0.66 + @bg * 0.15; .border_radius_left(3); - :hover { background: @colour_positive * 0.85 + @bg * 0.15; } - } - a.down { - float: left; background: @colour_negative * 0.66 + @bg * 0.15; .border_radius_right(3); - margin: 0 5px 0 1px; - :hover { background: @colour_negative * 0.85 + @bg * 0.15; } - } -} -#vote.disabled { - a.up { - background: (@colour_positive * 0.66 + @bg * 0.15) * 0.15 + @grey * 0.85; - :hover { background: (@colour_positive * 0.85 + @bg * 0.15) * 0.25 + @grey * 0.75; } - } - a.down { - background: (@colour_negative * 0.66 + @bg * 0.15) * 0.15 + @grey * 0.85; - :hover { background: (@colour_negative * 0.85 + @bg * 0.15) * 0.25 + @grey * 0.75; } - } -} - -/* Panels */ -div.panel { - margin: 0 0 20px; position: relative; .box_shadow(0, 0, 3, @light_grey * 0.66 + @white * 0.33); .border_radius(3); - > div.header { - background: @bg url('/images/panel_header_bg.png') repeat-x top left; border-bottom: 1px solid (@bg * 0.66 + @black * 0.33); - padding: 5px 10px 4px; .border_radius_top(3); min-height: 18px; - h2 { font-size: 16px; margin: 0; color: @white; .text_shadow(1, 1, 0, @bg * 0.66 + @black * 0.33); } - h3 { color: @white; font-size: 14px; margin: 0; line-height: 18px; .text_shadow(1, 1, 0, @bg * 0.66 + @black * 0.33); } - small { display: block; font-size: 12px; color: @light_grey * 0.25 + @white * 0.75; } - span.filter { - float: left; display: block; overflow: hidden; position: relative; z-index: 5; - a { - margin: 0 1px 0 0; display: block; float: left; padding: 0 8px; height: 18px; font-weight: bold; font-size: 10px; line-height: 18px; - text-transform: uppercase; background: url('/images/transparent_backgrounds/black_50.png'); color: @light_grey; text-decoration: none; position: relative; z-index: 3; - } - a:first-child { .border_radius_left(2); } - a:last-child { .border_radius_right(2); margin-right: 0; } - a.active { background: @white; color: @black; z-index: 4; } - a:hover { color: @white; } - a.active:hover { color: @black; } - } - - span.filter.dropdown { - margin: 0; position: relative; overflow: visible; - a { - .border_radius(2); background: @white; color: @black; margin: 0; position: relative; padding-right: 25px; - img { float: left; margin: 4px 5px 0 0; } - b.arrow { - float: right; display: block; height: 0; width: 0; border: 5px solid transparent; border-top: 5px solid @black; border-bottom: none; - position: absolute; top: 6px; right: 10px; - } - :hover { - background: @accent_colour; color: @white; - b.arrow { border-top: 5px solid @white; } - } - } - - ul { - position: absolute; top: 100%; left: 0; margin: 1px 0 0; padding: 0; background: @white; .border_radius(2); - .box_shadow(0, 1, 1, @black); - li { - list-style: none; display: block; padding: 0; margin: 0; - a { - display: block; height: 18px; line-height: 18px; color: @black; font-size: 10px; text-transform: uppercase; background: transparent; - border-bottom: 1px solid (@light_grey * 0.66 + @white * 0.33); float: none; margin: 0; .border_radius(0); white-space: nowrap; - :hover { background: url('/images/transparent_backgrounds/accent_colour_25.png'); color: @black; } - } - } - li:last-child { - a { border: none; } - } - } - } - span.filter.dropdown.sort { float: left; margin: 0 0 0 10px; } - span.filter.dropdown.localisation { float: left; margin: 0 0 0 10px; } - - a.more { - float: right; color: @white; .text_shadow(1, 1, 0, @bg * 0.66 + @black * 0.33); font-size: 14px; font-weight: bold; - position: relative; top: 2px; - :hover { text-decoration: none; } - } - } - > div.content { - background: @white; padding: 10px; - .no_padding { padding: 0; } - } - > div.footer { - background: @light_grey * 0.33 + @white * 0.66; border-top: 1px solid (@light_grey * 0.5 + @white * 0.5); - padding: 4px 10px 5px; .border_radius_bottom(3); - } -} -div.panel.no_footer div.content { .border_radius_bottom(3); } -div.panel.no_header div.content { .border_radius_top(3); } -div.panel.collapsable { - div.header { - cursor: pointer; - b.toggle { float: right; border: 5px solid transparent; border-bottom: 5px solid @white; border-top: none; display: block; width: 0; height: 0; margin: 6px 0 0 0; } - } - div.header:hover { - background-color: @bg * 0.75 + @white * 0.25; - } -} -div.panel.collapsed { - div.header { - border-bottom: none; .border_radius(3); - b.toggle { border-bottom: none; border-top: 5px solid @white; } - } - div.blank { border-bottom: none; .border_radius_bottom(3); } - div.content, div.footer { display: none; } -} - - -/* Sidebar Actions */ -#sidebar { - #actions { - .box_shadow(0, 0, 0, transparent); - div.content { - background: url('/images/transparent_backgrounds/accent_colour_10.png'); text-align: center; - p.endorsement { - margin: 0 0 10px; font-size: 14px; font-weight: bold; - small { font-weight: normal; line-height: inherit; margin: 10px 0 0; } - :last-child { margin: 0; } - } - div.share { margin: 5px 0 0; } - a.button { - font-size: 16px; line-height: normal; height: auto; padding: 5px 10px 5px 35px; font-weight: bold; margin: 0; position: relative; - img { position: absolute; top: 3px; left: 6px; } - } - div.flash.notice { - margin: 10px 0 0; font-size: 22px; - small { font-weight: normal; margin: 0 0 10px; } - } - div.flash.notice.done { margin: 0; } - small { - display: block; margin: 10px 0 0; font-size: 11px; color: #808080; line-height: 12px; - img.favicon { vertical-align: middle; } - } - div.blank { - border: none; background: none; padding: 10px 0 0; border-top: 1px solid (@accent_colour * 0.5 + @white * 0.5); - margin: 10px 0 0; - } - } - } -} - -/* People Lists */ -ul.people { - margin: 0; padding: 10px 0 0 10px; background: @white; - > li { - display: block; margin: 0 10px 10px 0; float: left; padding: 2px; width: 57px; position: relative; - .border_radius(2); background: @white; list-style: none; border: 1px solid (@light_grey * 0.33 + @white * 0.66); - a.avatar { - display: block; width: 59px; height: 59px; overflow: hidden; - img { width: 100%; height: 100%; } - } - a.name { display: block; font-size: 10px; text-align: center; } - :hover { - background: @accent_colour; - a.name { color: @white; } - } - } -} -ul.people.list { - padding: 0; - > li { - margin: 0 0 10px; padding: 0 0 10px; overflow: hidden; float: none; width: auto; .border_radius(0); - border: none; border-bottom: 1px solid (@light_grey * 0.33 + @white * 0.66); - span.points { - float: right; display: block; padding: 5px; background: @light_grey * 0.15 + @white * 0.85; line-height: 1; - text-align: center; width: 50px; height: 30px; .border_radius(3); margin: 0 0 0 10px; - strong { display: block; color: @black; font-size: 16px; margin: 2px 0 0; } - label { color: @grey; text-transform: uppercase; font-size: 10px; } - label.long { display: block; } - label.short { display: none; } - } - a.avatar { float: left; width: 40px; height: 40px; } - a.name { font-size: 14px; font-weight: bold; margin: 0 0 0 50px; text-align: left; } - a.name.long { display: inline; } - a.name.short { display: none; } - span.networks { - display: block; margin: 0 0 0 50px; - img.favicon { vertical-align: middle; } - } - :hover { - background: transparent; - a.name { color: @accent_colour * 0.85 + @black * 0.15; } - } - :last-child { padding-bottom: 0; border-bottom: none; margin-bottom: 0; } - } -} -ul.people.list.small { - > li { - span.points { - padding: 3px 6px; height: 18px; font-size: 9px; line-height: 17px; width: 60px; - strong { font-size: 12px; margin: 0; display: inline; } - label { font-size: 9px; } - label.long { display: none; } - label.short { display: inline; } - } - a.avatar { width: 24px; height: 24px; } - a.name { display: inline; line-height: 24px; margin: 0 0 0 5px; font-size: 12px; height: 24px; } - a.name.long { display: none; } - a.name.short { display: inline; } - span.networks { display: inline; margin: 0; } - :last-child { padding-bottom: 0; border-bottom: none; margin-bottom: 0; } - } -} -ul.people.tiled { - > li { - width: 28px; padding: 2px; - a.avatar { width: 24px; height: 24px; background: @white; padding: 2px; } - a.name, small, span.networks, span.points { display: none; } - } -} - -/* Comments */ -#comments { - ul { - margin: 0 0 20px; padding: 0; - li { - display: block; list-style: none; padding: 0; margin: 0 0 10px; - span.meta { - margin: 0; overflow: hidden; display: block; - small { font-size: 12px; color: @light_grey; float: right; line-height: 16px; display: inline-block; } - a.avatar { - display: inline-block; height: 16px; width: 16px; position: relative; top: 3px; - img { height: 100%; width: 100%; } - } - a.name { font-weight: bold; line-height: 16px; display: inline-block; } - span.inactive { color: @grey; font-weight: bold; line-height: 16px; display: inline-block; } - } - b.tail { - display: block; width: 0; height: 0; margin: 3px 0 0 10px; border: 5px solid transparent; border-top: none; - border-bottom: 5px solid @white; position: relative; z-index: 2; - } - blockquote { - margin: 0; padding: 10px; .border_radius(3); font-style: normal; background: @white; - color: @dark_grey; .box_shadow(0, 0, 3, @light_grey * 0.66 + @white * 0.33); - } - } - } - form { - margin: 0; - textarea { width: 500px; } - } -} - -/* Sidebar Categories */ -#sidebar { - #categories { - margin: 0 0 20px; - width: auto; - p { margin: 0; } - } -} - -#sidebar { - #ads > ul li, #recommendations > ul li { - width: 81px; - div.thumbnail { - a.thumbnail { height: 60px; width: 81px; } - } - div.text { - a.title { font-size: 11px; height: 14px; line-height: 14px; } - small { display: none; } - } - } - #brands > ul li { - width: 55px; - div.thumbnail { - a.thumbnail { - height: 45px; width: 45px; - img { max-height: 45px; max-width: 45px; } - } - } - div.text { display: none; } - } -} - -/* My Account */ -#accounts_controller { - #top { - #page_title { - #page_options { - a.button.public_profile { - float: right; font-size: 16px; line-height: 1; height: auto; padding: 8px 35px 8px 15px; position: relative; - b.arrow { display: block; height: 0; width: 0; position: absolute; top: 10px; right: 15px; border: 6px solid transparent; border-right: none; border-left: 6px solid @white; margin: 0; } - } - a.button.goto_dashboard { - float: right; font-size: 16px; line-height: 1; height: auto; padding: 8px 15px 8px 35px; margin-right: 5px; position: relative; - b.arrow { display: block; height: 0; width: 0; position: absolute; top: 10px; left: 15px; border: 6px solid transparent; border-left: none; border-right: 6px solid @white; margin: 0; } - } - } - } - } - #account_nav { - float: left; width: 200px; margin: 0 20px 0 0; - ul.nav { - margin: 0; padding: 0; - li { - margin: 0 0 5px; display: block; list-style: none; padding: 0; - a { - display: block; height: 30px; text-decoration: none; color: @white; - b { - border: 15px solid transparent; border-right: none; border-left: 10px solid transparent; width: 0; - height: 0; float: right; display: none; - } - span { - .border_radius(3); background: @bg; display: block; - line-height: 30px; padding: 0 10px; font-size: 14px; font-weight: bold; margin: 0 10px 0 0; - } - } - :hover { - a { - color: @white; - b { border-left-color: @bg; display: block; } - span { background: @bg; .border_radius_right(0); } - } - } - } - li.current a { - b { border-left-color: @accent_colour; display: block; } - span { background: @accent_colour; color: @white; .border_radius_right(0); } - } - } - } - #main { - > div { - margin: 0 0 20px; - form { margin: 0; } - } - #profile { - a.avatar { - float: left; display: block; - width: 70px; overflow: hidden; position: relative; text-decoration: none; - img { width: 100%; } - span { - display: block; line-height: 1; padding: 3px; margin: 5px 0 0; color: @white; background: @accent_colour; - .border_radius(3); .text_shadow(1, 1, 0, @grey); - text-align: center; font-size: 10px; font-weight: bold; text-transform: uppercase; - } - } - form { - margin: 0 0 0 90px; - h4 { margin: 10px 0 20px; border-bottom: 1px solid (@light_grey * 0.5 + @white * 0.5); padding: 0; color: @bg; font-size: 16px; } - ul.choices { - li { width: 30%; } - } - div.extra { margin-top: 20px; } - } - } - - #networks { - ul { margin: 0 -10px -10px 0; padding: 0; overflow: hidden; - li:hover - { - background: @light_grey; display: block; float: left; width: 180px; - padding: 10px; margin: 0 10px 10px 0; list-style: none; .border_radius(3); - position: relative; - * { line-height: normal; } - img { vertical-align: middle; float: left; } - .name { font-weight: bold; font-size: 14px; display: block; margin: -2px 0 0 42px; } - small { - font-size: 12px; color: @grey; display: block; margin-left: 42px; - strong { color: @black; font-weight: normal; } - } - :hover { - } - } - li.installed { - background: @white; - border: 2px solid @accent_colour; padding: 8px; - } - li.unavailable { - .name { color: @black; } - :hover { - background: @light_grey; - } - } - li:hover { - background: @light_grey * 0.5 + @white * 0.5; - } - } - } - } -} - -/* Shopping Style Panel */ -#shopping_style { - div.header a.button.small { float: right; } - div.content { - p { - margin: 0 0 10px; - label { text-transform: uppercase; font-size: 11px; display: block; color: @bg; font-weight: bold; } - span { color: @black; } - span.toggle { white-space: nowrap; color: @grey; } - :last-child { margin: 0; } - } - p.more { text-align: left; font-weight: normal; } - p.less { display: none; margin: 0; } - } -} - -/* People Controller */ -#people_controller.index { - #main { - div.panel { - float: left; width: 300px; margin: 0 20px 0 0; - :last-child { margin-right: 0; } - } - } -} -#people_controller.show { - #person_overview, #shopping_style { - a.button.small { - } - } - #content { - #shopping_style { - float: left; width: 240px; margin: 0 20px 0 0; - } - #main { width: 360px; } - } -} - -/* Search Results */ -#search_results { - margin: 0 0 20px; - li { - :hover { - small { color: @white * 0.75 + @accent_colour * 0.25; } - } - } -} -#search { - div.content { - padding: 20px; - form { - margin: 0; float: none; - span.submit_and_options { - display: block; - } - } - p { margin: 0 0 15px; } - h4 { font-weight: normal; margin: 0 0 5px; } - } -} - -/* Recommendations */ -#recommendations { - div.browse { - margin: 0; padding: 0; background: none; - ul { min-height: 0; .border_radius(0); } - } -} - -/* Blank States */ -div.blank { - padding: 20px; background: @bg * 0.05 + @blue * 0.05 + @white * 0.9; position: relative; - border: 1px solid (@bg * 0.1 + @blue * 0.1 + @white * 0.8); z-index: 1; - h4 { font-size: 18px; margin: 0 0 10px; } - h4:last-child { margin: 0; } - p { font-size: 16px; margin: 0 0 10px; } - p:last-child { margin: 0; } - p.with_list_number.large { - span { margin-left: 48px; display: block; color: @white; } - } - p.earn span { font-size: 22px; color: @white; line-height: 48px; font-weight: bold; } - a { white-space: nowrap; } - a.hide { - position: absolute; top: -5px; right: -5px; display: block; height: 16px; width: 16px; padding: 3px; background: #E7E9F6; .border_radius(99); - } -} - -div.blank.small { - padding: 10px 20px; - h4 { font-weight: normal; font-size: 16px; } - p { margin: 0; } -} -div.blank.tiny { - padding: 10px 20px; - h4 { font-weight: normal; font-size: 14px; } - p { margin: 0; font-size: 12px; } -} -div.blank.rounded { - .border_radius(3); margin: 0 0 20px; -} -div.blank.rounded.bottom { .border_radius_top(0); } -div.blank.with_border_bottom { border-bottom: 1px solid (@bg * 0.1 + @blue * 0.1 + @white * 0.8); } -div.blank.no_border_top { border-top: none; } -div.blank.no_border_bottom { border-bottom: none; } -div.blank.no_side_borders { border-right: none; border-left: none; } -div.panel { - div.blank { - padding: 10px 20px; overflow: hidden; margin: 0; - h4 { font-weight: normal; font-size: 14px; } - p, ul { margin: 0 0 10px; font-size: 12px; } - p:last-child, ul:last-child { margin: 0; } - } -} - -/* Sidebar Browse */ -#sidebar { - div.panel { - div.content.browse { - padding: 0; margin: 0; - > ul { - min-height: 0; .border_radius(0); - > li { - div.thumbnail { - a.thumbnail { padding: 5px; } - img.marker.media_type { top: 48px; left: 8px; } - } - div.footer { - a.title, a.name { font-size: 11px; font-weight: normal; } - } - } - } - } - - div.content.browse.ads > ul > li { - width: 93px; - > div.thumbnail a.thumbnail { width: 83px; height: 62px; } - } - div.content.browse.brands { - .border_radius(3); - > ul { - background: none; - > li { - width: 52px; - > div.thumbnail { - padding: 3px; - a.thumbnail { width: 42px; height: 42px; padding: 2px; } - } - li.active { background: @accent_colour; } - } - } - } - div.footer { - div.info { float: none; } - div.pagination { float: none; margin: 3px 0 0; } - } - } -} - -/* List Numbers */ -label.list_number { - float: left; background: url('/images/transparent_backgrounds/black_15.png'); padding: 2px; width: 24px; height: 24px; display: block; - .border_radius(99); - b { - display: block; font-weight: bold; font-size: 14px; color: @white; background: @accent_colour; height: 20px; width: 20px; line-height: 20px; - text-align: center; .border_radius(99); .text_shadow(1, 1, 0px, (@accent_colour * 0.75 + @black * 0.25)); - border: 2px solid @white; - } -} -label.list_number.large { - padding: 4px; width: 48px; height: 48px; .border_radius(99); position: relative; left: -10px; - b { - font-size: 28px; height: 40px; width: 40px; .border_radius(99); line-height: 40px; - .text_shadow(2, 2, 0px, (@accent_colour * 0.75 + @black * 0.25)); border-width: 4px; - } -} - -/* Dashboard */ -#dashboard_controller { - #ads { - span.filter.state { float: right; } - } - #sidebar { - #shopping_style div.content { - p.less { display: block; } - p.more { display: none; } - } - #influences { - div.header { - padding-bottom: 0; - ul.tabs { - position: relative; top: 1px; z-index: 3; - li { - margin: 0 5px 0 0; - a { - border: none; background: url('/images/transparent_backgrounds/white_75.png'); - :hover { color: @black; } - } - } - li.active { - a { - background: @white; border: none; - :hover { color: @black; } - } - } - } - } - - div.tab_content { - overflow: hidden; padding: 0; - > ul { - padding: 10px 10px 0; max-height: 280px; min-height: 120px; overflow-y: scroll; .border_radius_bottom(3px); - } - } - div.footer { - form { - p { - margin: 0 0 5px; - img.marker { float: right; margin: 5px 0 0 0; } - span.invitee { - line-height: 26px; padding: 3px 3px 0; font-size: 14px; - small { color: @grey; font-size: 12px; } - } - } - p.indent { margin-left: 36px; } - p.submit { margin-top: 10px; } - } - } - } - } - - div.panel.full { - > div.content { - margin: 0; padding: 0; background: none; - ul { - li { - width: 148px; - div.thumbnail { - img.marker.media_type { top: 90px; } - a.thumbnail { width: 138px; height: 104px; } - } - } - } - } - } - #people { - form { - padding: 0 0 5px; - input { width: 225px; float: left; margin: 0 5px 0 0; } - a.button { height: 23px; line-height: 23px; width: 60px; padding: 0; text-align: center; } - } - } -} - -/* Remove Pages Titles when Browsing */ -#ads_controller, #brands_controller { - #page_title { display: none; } -} - -/* Brands > Show */ -#brands_controller.show { - #ads { - div.filters { - h3 { font-size: 16px; margin: 0; } - span.show { float: right; } - span.filter.dropdown.localisation { float: right; margin: 0 0 0 10px; } - span.filter.state { float: right; margin: 0 0 0 10px; } - } - } -} - -/* FAQ */ -#pages_controller.faq { - #answers { - h3 { margin-top: 20px; padding-top: 20px; border-top: 1px solid (@light_grey * 0.75 + @white * 0.25); } - h3.first { margin-top: 0; padding-top: 0; border: none; } - } - #questions { - div.content { - padding: 20px; - ul { - margin: 0; padding: 0; - li { - margin: 0 0 10px; list-style: none; display: block; padding: 0; - a { font-size: 14px; } - } - li:last-child { - margin: 0; - } - } - } - } -} - -/* Person Overview */ -#person_overview { - padding: 20px 10px; position: relative; z-index: 25; - #person { - float: left; width: 620px; - a.avatar { - display: block; float: left; width: 60px; height: 60px; - img { height: 100%; width: 100%; } - } - > div { - margin: 0 0 0 75px; color: @white; font-size: 14px; .text_shadow(1, 1, 0, @bg * 0.66 + @black * 0.33); - } - div.name { - h2 { - margin: 0 0 5px; display: inline; - a { - font-size: 20px; font-weight: bold; .text_shadow(1, 1, 0, @bg * 0.66 + @black * 0.33); - line-height: 1; color: @white; text-decoration: none; - :hover { text-decoration: underline; } - } - a.button.small { - font-size: 10px; - :hover { text-decoration: none; } - } - } - - span.points { - float: right; display: block; padding: 5px 10px; .border_radius(2); text-align: center; background: @white; position: relative; - min-width: 45px; - strong { color: @black; font-weight: bold; font-size: 24px; line-height: 1; display: block; .text_shadow(0, 0, 0, transparent); } - label { font-size: 9px; text-transform: uppercase; color: @grey; display: block; .text_shadow(0, 0, 0, transparent); font-weight: bold; } - } - span.points.with_redeem { - .border_radius_bottom(0); - a.button { - display: block; text-align: center; .border_radius_top(0); font-size: 10px; font-weight: bold; padding: 0; - position: absolute; height: 18px; left: 0; right: 0; bottom: -19px; line-height: 18px; text-transform: uppercase; border: none; - } - } - div.options { margin: 0; } - } - div.meta { - color: @white * 0.66 + @bg * 0.33; - span { color: @white; } - label { color: @white * 0.66 + @bg * 0.33; } - ul.networks { - display: inline; margin: 0; padding: 0; - li { - display: inline; line-height: 1; - img { position: relative; vertical-align: middle; top: -1px; } - } - } - } - - div.extra { - font-size: 12px; margin-top: 20px; margin-bottom: 20px; - span.toggle { - .text_shadow(1, 1, 0, @bg * 0.66 + @black * 0.33); - a { font-size: 10px; font-weight: bold; text-transform: uppercase; text-decoration: none; color: @accent_colour; } - b.arrow { display: inline-block; width: 0; height: 0; border: 5px solid transparent; position: relative; top: -2px; } - } - #less_info { - span.toggle { - b.arrow { border-top: 5px solid @accent_colour; border-bottom: 0; } - } - } - #more_info { - span.toggle { - float: right; - b.arrow { border-bottom: 5px solid @accent_colour; border-top: 0; } - } - h4 { - color: @white; margin: 0 0 10px 0; border-bottom: 1px solid (@white * 0.25 + @bg * 0.75); .text_shadow(1, 1, 0, @bg * 0.66 + @black * 0.33); - span { font-size: 12px; } - } - p { - margin: 0 0 5px; - label { display: block; float: left; width: 120px; color: @white * 0.66 + @bg * 0.33; } - span { display: block; margin: 0 0 0 130px; } - } - p:last-child { margin: 0; } - - } - } - div.login { - margin: 0 0 0 75px; - a.button { font-weight: bold; } - } - } -} - -/* Dashboard Nav */ -#dashboard_nav { - position: absolute; bottom: 0; left: 10px; margin: 0; padding: 0; overflow: hidden; - li { - display: block; float: left; margin: 0 5px 0 0; - a { - display: block; height: 28px; padding: 0 10px; line-height: 28px; .border_radius_top(2); - text-decoration: none; color: @white; background: url('/images/transparent_backgrounds/accent_colour_30.png'); font-size: 14px; - font-weight: bold; - :hover { background: url('/images/transparent_backgrounds/accent_colour_45.png'); } - } - } - li.active { - a { - background: @white; color: @black; - :hover { color: @black; } - } - } -} - -/* Dwellometer */ -#dwellometer { - z-index: 45; float: right; .box_shadow(0, 0, 0, transparent); margin: 0; - div.content { - text-align: center; position: relative; - object, object embed { position: relative; z-index: 46; line-height: 0; } - div.title { - position: absolute; bottom: 10px; left: 0; right: 0; z-index: 50; - img { width: 120px; display: block; margin: 0 auto; position: relative; left: -5px; } - } - } -} - -/* Activity Stream */ -#activity { - div.content { - ul.events { - padding: 0; margin: 0 0 -10px; - li { - margin: 0; padding: 10px 0; border-bottom: 1px solid (@light_grey * 0.33 + @white * 0.66); - list-style: none; overflow: hidden; - small.meta { - font-size: 12px; color: @light_grey; float: right; - } - a.button { float: right; margin: 0 0 10px 10px; } - a.avatar, a.logo, a.thumbnail { - height: 32px; display: block; float: left; - img { width: 100%; height: 100%; } - } - a.avatar, a.logo, a.icon { width: 32px; } - a.thumbnail { width: 42px; } - div.symbols { - float: left; overflow: hidden; - b { - display: block; float: left; margin: 10px 5px 0; - img { height: 12px; width: 12px; } - } - b.voted { margin: 10px 3px 0; padding: 2px; .border_radius(2); } - b.voted.for { background: @colour_positive * 0.33 + @white * 0.66; } - b.voted.against { background: @colour_negative * 0.33 + @white * 0.66; } - } - /* Temporarily removed avatar and symbol */ -/* div.symbols a.agent, b { display: none; }*/ - div.description { - font-size: 12px; color: @grey; - a.agent { font-weight: bold; } - } - div.comment { - margin-top: 2px; - b.tail { - display: block; margin: 0 0 0 10px; width: 0; height: 0; border: 5px solid transparent; - border-top: none; border-bottom: 5px solid (@light_grey * 0.25 + @white * 0.75); - } - blockquote { - margin: 0; font-style: normal; color: @dark_grey; - .border_radius(3); background: @light_grey * 0.25 + @white * 0.75; padding: 5px 10px; - span.view_comment { - color: @grey; - } - } - } - div.content { - overflow: hidden; - } - } - li.new_comment.ad, li.endorsed.ad, li.voted { - div.description, div.content { margin-left: 106px; } -/* div.description, div.content { margin-left: 53px; }*/ - } - li.new_comment.brand, li.replied_to, li.endorsed.brand, li.connected, li.sn_setup { - div.description, div.content { margin-left: 96px; } -/* div.description, div.content { margin-left: 43px; }*/ - } - li.replied_to { - div.content { - a.thumbnail, a.logo { margin-top: 7px; } - } - } - li.replied_to.ad { - div.content { - div.comment { margin-left: 52px; } - } - } - li.replied_to.brand { - div.content { - div.comment { margin-left: 42px; } - } - } - li.voted div.description span.action { .border_radius(2); color: @dark_grey; padding: 0 3px; white-space: nowrap; } - li.voted.for div.description span.action { background: @colour_positive * 0.15 + @white * 0.85; } - li.voted.against div.description span.action { background: @colour_negative * 0.15 + @white * 0.85; } - li:first-child { padding-top: 0; } - li:last-child { border-bottom: none; } - li:hover div.content div.comment blockquote span.view_comment { - } - } - } -} - -/* Login/Register Modal */ -#login_register { - div.location_select, - div.location_search { margin-left: 130px; } - h3 { - small { font-size: 14px; font-weight: normal; display: block; color: @grey; text-align: left; margin: 0; display: block; } - } -} - -/* Contact Form in Pages */ -#pages_controller { - #sidebar { - #contact { - margin: 15px 0 0; - form { - label { text-align: left; float: none; width: auto; font-size: 12px; font-weight: bold; line-height: 1; margin: 0 0 5px; } - p.submit.indent { - margin: 0; - span.with_cancel { display: none; } - } - } - } - } -} - -/* Exclusive Offers */ -#offers { - div.content { - a.gift { - display: block; text-align: center; - img { height: 100px; } - } - } -} - -div.browse { - margin: 0 0 20px; - &.class { - padding: 0; - } - div.header { - padding: 10px 10px 9px; text-align: left; background: @bg url('/images/panel_header_bg.png') repeat-x top left; - border-bottom: 1px solid (@bg * 0.66 + @black * 0.33); line-height: 1; height: 18px; - .border_radius_top(3); color: @light_grey; - h3 { font-size: 16px; margin: 0; color: @white; .text_shadow(1, 1, 0, @bg * 0.66 + @black * 0.33); } - span.filter { - float: left; display: block; overflow: hidden; position: relative; z-index: 5; - a { - margin: 0 1px 0 0; display: block; float: left; padding: 0 8px; height: 18px; font-weight: bold; font-size: 10px; line-height: 18px; - text-transform: uppercase; background: url('/images/transparent_backgrounds/black_50.png'); color: @light_grey; text-decoration: none; position: relative; z-index: 3; - .active { - background: @white; color: @black; z-index: 4; - :hover { color: @black; } - } - :hover { color: @white; } - :first-child { .border_radius_left(2); } - :last-child { .border_radius_right(2); margin-right: 0; } - } - } - - span.filter.dropdown { - margin: 0; position: relative; overflow: visible; - a { - .border_radius(2); background: @white; color: @black; margin: 0; position: relative; padding-right: 25px; - img { float: left; margin: 4px 5px 0 0; } - b.arrow { - float: right; display: block; height: 0; width: 0; border: 5px solid transparent; border-top: 5px solid @black; border-bottom: none; - position: absolute; top: 6px; right: 10px; - } - :hover { - background: @accent_colour; color: @white; - b.arrow { border-top: 5px solid @white; } - } - } - ul { - position: absolute; top: 100%; left: 0; margin: 1px 0 0; padding: 0; background: @white; .border_radius(2); - .box_shadow(0, 1, 1, @black); - li { - list-style: none; display: block; padding: 0; margin: 0; - a { - display: block; height: 18px; line-height: 18px; color: @black; font-size: 10px; text-transform: uppercase; background: transparent; - border-bottom: 1px solid (@light_grey * 0.66 + @white * 0.33); float: none; margin: 0; .border_radius(0); white-space: nowrap; - :hover { background: url('/images/transparent_backgrounds/accent_colour_25.png'); color: @black; } - } - :last-child { - a { border: none; } - } - } - } - } - span.filter.dropdown.sort { float: left; margin: 0 0 0 10px; } - span.filter.dropdown.localisation { float: left; margin: 0 0 0 10px; } - a.more { - float: right; color: @white; .text_shadow(1, 1, 0, @bg * 0.66 + @black * 0.33); font-size: 14px; font-weight: bold; - position: relative; top: 2px; - :hover { text-decoration: none; } - } - } - > ul { - margin: 0; background: @white; padding: 10px 0 0 10px; .border_radius(3); position: relative; - li { - display: block; float: left; list-style: none; margin: 0 10px 10px 0; padding: 5px; position: relative; - background: @white; width: 130px; border: 1px solid (@light_grey * 0.33 + @white * 0.66); .border_radius(2); - a.remove { - position: absolute; height: 16px; width: 16px; padding: 3px; background: @accent_colour; - .border_radius(99); display: none; z-index: 3; top: -8px; right: -8px; - img { vertical-align: middle; } - } - div.thumbnail { - .border_radius_top(3); position: relative; z-index: 3; - .marker { - position: absolute; padding: 2px; .border_radius(2); z-index: 3; - background: url('/images/transparent_backgrounds/white_75.png'); height: 12px; width: 12px; - } - .marker.coupon { - height: auto; width: auto; top: 10px; right: -3px; padding: 0; background: transparent; overflow: hidden; position: absolute; - b { - display: block; height: 0; width: 0; float: left; border: 14px solid transparent; border-top: 14px solid @accent_colour; - border-bottom: none; border-right: none; float: left; - } - span { - color: @white; font-size: 10px; font-weight: bold; text-transform: uppercase; height: 14px; line-height: 14px; display: block; - padding: 0 4px 0 2px; background: @accent_colour; .text_shadow(1, 1, 0px, (@accent_colour * 0.75 + @black * 0.25)); margin: 0 0 0 14px; - } - } - .marker.video { - position: absolute; left: 50%; top: 50%; background: @white; width: 10px; height: 10px; - b { display: block; width: 0; height: 0; border: 5px solid transparent; border-left: 10px solid @black; border-right: none; } - } - .marker.endorsed_by_me { background: none; padding: 0; right: 0; bottom: -32px; .border_radius(2); background: @white; } - a.thumbnail { - display: block; overflow: hidden; position: relative; text-align: center; - img { position: relative; display: block; margin: auto; } - } - } - div.text { - margin: 3px 0 0; display: block; - a { text-decoration: none; } - a.title { - display: block; text-decoration: none; font-weight: bold; font-size: 12px; line-height: 16px; - white-space: nowrap; height: 16px; overflow: hidden; - :before { - display: block; height: 32px; width: 20px; content: " "; float: right; right: -15px; top: -8px; - background: @white; position: relative; z-index: 1; .box_shadow(-5, 0, 10, @white); - } - } - small { - font-size: 11px; line-height: 13px; color: @grey; display: block; height: 13px; overflow: hidden; white-space: nowrap; - a { font-weight: bold; } - :before { - display: block; height: 32px; width: 20px; content: " "; float: right; right: -15px; top: -8px; - background: @white; position: relative; z-index: 1; .box_shadow(-5, 0, 10, @white); - } - } - } - :hover { - background: @accent_colour; - a.remove { display: block; } - div.thumbnail { - a.marker.remove, a.marker.video { - b { display: inline-block; } - } - a.marker.video { .box_shadow(0, 0, 2, @black); } - } - div.text { - a { color: @white; } - a.title:before { background: @accent_colour; .box_shadow(-5, 0, 10, @accent_colour); } - small { - color: @white * 0.75 + @accent_colour * 0.25; - :before { background: @accent_colour; .box_shadow(-5, 0, 10, @accent_colour); } - } - } - div.footer a { color: @white; } - } - } - > li.ad div.thumbnail a.thumbnail { - width: 130px; height: 97px; - img { width: 100%; height: 100%; } - } - > li.brand div.thumbnail a.thumbnail { - width: 120px; height: 87px; padding: 5px; background: @white; .border_radius(2); - img { max-width: 120px; max-height: 87px; } - } - li.paginate { - margin-bottom: 0; - a { - display: block; position: relative; text-decoration: none; height: 131px; - div.arrow { - background: #81c153 url('/images/button_bg.png') repeat-x left top; border: 1px solid (@accent_colour * 0.75 + @black * 0.25); - height: 44px; .border_radius(99); width: 44px; margin: 0 auto; position: relative; top: 32px; - b { text-indent: -9000px; display: block; border: 10px solid transparent; width: 0; height: 0; position: relative; top: 12px; } - } - div.label { - position: absolute; bottom: 5px; left: 0; right: 0; line-height: 13px; - color: @accent_colour * 0.85 + @black * 0.15; text-decoration: none; - font-weight: bold; font-size: 12px; text-align: center; - } - :hover { - div.arrow { background: #abd56e url('/images/button_bg.png') repeat-x left -44px; } - } - } - :hover { background: transparent; } - } - li.paginate.previous a div b { border-right: 15px solid @white; border-left: none; left: 12px; } - li.paginate.next a div b { border-left: 15px solid @white; border-right: none; left: 16px; } - } - > div.footer { - padding: 9px 10px 10px; background: @light_grey * 0.75 + @white * 0.25; overflow: hidden; - border-top: 1px solid @light_grey; .border_radius_bottom(3); - div.info { - float: left; color: @grey; - strong { color: @black; font-weight: normal; } - } - div.pagination { - float: right; - > * { - display: inline-block; line-height: 1; padding: 0 6px; line-height: 18px; height: 18px; background: @white; - .border_radius(3); text-decoration: none; font-weight: bold; - font-size: 10px; text-transform: uppercase; - } - a { color: @grey; } - a:hover { color: @black; } - span.disabled { color: @light_grey; } - span.current { color: @white; background: @bg; border: none; } - span.current:hover { color: @white; } - } - } -} -div.browse.with_categories { margin: 0 0 0 160px; } -div.browse.with_options > ul { .border_radius_top(0); } -div.browse.with_footer > ul { .border_radius_bottom(0); } -/* Browse List */ -div.browse.list { -> ul { - margin: 0; min-height: 320px; - padding: 10px 0 0 10px; overflow: hidden; - > li { - display: block; list-style: none; margin: 0 10px 10px 0; padding: 5px; - .border_radius(3); position: relative; line-height: normal; - .marker { - position: absolute; padding: 2px; .border_radius(2); - background: url('/images/transparent_backgrounds/white_75.png'); - img { height: 12px; width: 12px; } - } - img.marker { height: 12px; width: 12px; } - span.marker.new { - color: black; left: -5px; top: -5px; background: none; background-color: @white * 0.1 + @yellow * 0.6 + @red * 0.3; line-height: 1; padding: 2px 5px; - font-weight: bold; - } - a.marker.media_type { - display: inline-block; text-decoration: none; top: 39px; left: 8px; - font-size: 10px; - b { font-weight: normal; margin: 0 0 0 2px; line-height: 1; display: none; } - img { vertical-align: middle; } - } - a.thumbnail { - float: left; - width: 68px; display: block; overflow: hidden; - border: 1px solid @light_grey; - :hover { border-color: @accent_colour; } - } - span.title_brand { - display: block; margin: 0 0 2px 75px; - a { margin: 0; display: inline; } - a.brand_name { font-weight: normal; font-size: 12px; } - } - a.ad_title { - font-weight: bold; font-size: 14px; margin: 0 0 0 75px; display: block; - } - a.brand_name { - font-weight: bold; font-size: 14px; margin: 0 0 0 75px; display: block; - } - small { - display: block; color: @grey; margin: 0 0 0 75px; font-size: 12px; - } - small.brand_name { display: inline; margin: 0; } - ul.chart { - margin: 0 0 0 80px; - height: 39px; - } - ul.networks { - margin: 3px 0 0 75px; padding: 0; overflow: hidden; - li { display: block; float: left; margin: 0 5px 0 0; line-height: 1; } - } - div.points { - display: none; - font-size: 12px; text-align: right; - label { color: @grey; } - } - a.remove { bottom: -3px; right: -3px; } - } - li.ad { - a.thumbnail { height: 51px; } - span.title_brand { - small.brand_name { - display: block; - } - } - } - li.brand { - a.thumbnail { height: 68px; } - } - } -} -div.browse.list.with_options ul { .border_radius_top(0); } -div.browse.list.with_footer ul { .border_radius_bottom(0); } -div.browse.list.cols_2 { - > ul { - > li { - width: 285px; float: left; - :hover { - background: @white; - } - } - } -} -div.browse.ads.list { - > ul { - > li { - height: 53px; - a.thumbnail { - height: 51px; - } - } - } -} -div.browse.brands.list { - > ul { - > li { - height: 68px; - a.thumbnail { - height: 66px; - } - } - } -} - -/* Categories List */ -#categories { - margin: 40px 0 0; width: 160px; float: left; position: relative; z-index: 1; - ul { - margin: 0; padding: 10px 0 0; - li { - list-style: none; margin: 0; padding: 0; font-size: 14px; - a { color: @grey; display: block; padding: 5px 10px 5px 15px; text-decoration: none; .border_radius_left(3); } - a:hover { color: @black; background: @light_grey * 0.15 + @white * 0.85; } - } - .all a { font-weight: bold; } - .current a { - background: @white; color: @black; border: 1px solid (@light_grey * 0.25 + @white * 0.75); border-right: none; border-left: 5px solid @bg; - padding-left: 10px; - } - } -} - -/* Ads > Show */ -#ad { - div.header { - overflow: hidden; - h3 { font-size: 16px; margin: 0 0 3px; } - small { - a.category { font-weight: bold; color: @accent_colour; } - span.networks img { position: relative; top: 3px; } - } - span.brand { - float: right; color: @white; - a.brand_name { font-weight: bold; color: @accent_colour; } - } - } - div.content { - padding: 0; position: relative; - a.toggle_size { - display: block; .border_radius(3); background-color: @black; padding: 0 5px 0 26px; - background-position: 5px center; background-repeat: no-repeat; text-decoration: none; margin: 5px 5px 0 0; - position: absolute; top: 0; right: 0; line-height: 25px; z-index: 45; - } - img.creative { margin: 0 auto; max-width: 540px; display: block; } - object { position: relative; z-index: 44; } - object.video { line-height: 0; font-size: 0; } - object embed { position: relative; z-index: 45; line-height: 0; font-size: 0; } - } - div.content.not_video { - padding: 40px; text-align: center; - * { margin-left: auto; margin-right: auto; } - object.flash { margin-bottom: 0; } - } - div.footer { - padding: 0; - div.vote_views { - padding: 5px 10px; overflow: hidden; - div.share { float: right; margin: 2px 0 0 0; } - #login_register_msg, #encourage_vote_msg { line-height: 22px; font-weight: bold; color: @black; } - } - } -} -#sidebar { - #meta { - table { - margin: 0; - tr:last-child td { padding-bottom: 0; } - td { - padding: 0 0 5px; - ul.networks { - margin: 0; padding: 0; - li { - list-style: none; display: inline; - } - li { - } - } - } - td.label { color: @grey; white-space: nowrap; width: 1%; text-align: right; padding-right: 5px; } - } - } -} - -/* Voting */ -div.voted { - font-size: 12px; line-height: 22px; color: @black; display: inline-block; font-weight: bold; - img { float: left; margin-right: 5px; padding: 3px; .border_radius(3); } -} -#voted_up { - img { background: @colour_positive * 0.66 + @bg * 0.15; } -} -#voted_down { - img { background: @colour_negative * 0.66 + @bg * 0.15; } -} -#encourage_comment { - display: inline-block; line-height: 22px; font-weight: bold; -} -#vote { - overflow: hidden; font-size: 12px; line-height: 22px; color: @black; float: left; - a { - color: @white; font-weight: bold; overflow: hidden; display: block; - width: 16px; text-decoration: none; text-align: center; font-size: 10px; padding: 3px; text-transform: uppercase; - } - a.up { - float: left; background: @colour_positive * 0.66 + @bg * 0.15; .border_radius_left(3); - :hover { background: @colour_positive * 0.85 + @bg * 0.15; } - } - a.down { - float: left; background: @colour_negative * 0.66 + @bg * 0.15; .border_radius_right(3); - margin: 0 5px 0 1px; - :hover { background: @colour_negative * 0.85 + @bg * 0.15; } - } -} -#vote.disabled { - a.up { - background: (@colour_positive * 0.66 + @bg * 0.15) * 0.15 + @grey * 0.85; - :hover { background: (@colour_positive * 0.85 + @bg * 0.15) * 0.25 + @grey * 0.75; } - } - a.down { - background: (@colour_negative * 0.66 + @bg * 0.15) * 0.15 + @grey * 0.85; - :hover { background: (@colour_negative * 0.85 + @bg * 0.15) * 0.25 + @grey * 0.75; } - } -} -#sidebar { - #ads > ul li, #recommendations > ul li { - width: 81px; - div.thumbnail { - a.thumbnail { height: 60px; width: 81px; } - } - div.text { - a.title { font-size: 11px; height: 14px; line-height: 14px; } - small { display: none; } - } - } - #brands > ul li { - width: 55px; - div.thumbnail { - a.thumbnail { - height: 45px; width: 45px; - img { max-height: 45px; max-width: 45px; } - } - } - div.text { display: none; } - } -} - -/* My Account */ -#accounts_controller { - #top { - #page_title { - #page_options { - a.button.public_profile { - float: right; font-size: 16px; line-height: 1; height: auto; padding: 8px 35px 8px 15px; position: relative; - b.arrow { display: block; height: 0; width: 0; position: absolute; top: 10px; right: 15px; border: 6px solid transparent; border-right: none; border-left: 6px solid @white; margin: 0; } - } - a.button.goto_dashboard { - float: right; font-size: 16px; line-height: 1; height: auto; padding: 8px 15px 8px 35px; margin-right: 5px; position: relative; - b.arrow { display: block; height: 0; width: 0; position: absolute; top: 10px; left: 15px; border: 6px solid transparent; border-left: none; border-right: 6px solid @white; margin: 0; } - } - } - } - } - #account_nav { - float: left; width: 200px; margin: 0 20px 0 0; - ul.nav { - margin: 0; padding: 0; - li { - margin: 0 0 5px; display: block; list-style: none; padding: 0; - a { - display: block; height: 30px; text-decoration: none; color: @white; - b { - border: 15px solid transparent; border-right: none; border-left: 10px solid transparent; width: 0; - height: 0; float: right; display: none; - } - span { - .border_radius(3); background: @bg; display: block; - line-height: 30px; padding: 0 10px; font-size: 14px; font-weight: bold; margin: 0 10px 0 0; - } - } - :hover { - a { - color: @white; - b { border-left-color: @bg; display: block; } - span { background: @bg; .border_radius_right(0); } - } - } - } - li.current a { - b { border-left-color: @accent_colour; display: block; } - span { background: @accent_colour; color: @white; .border_radius_right(0); } - } - } - } - #main { - > div { - margin: 0 0 20px; - form { margin: 0; } - } - #profile { - a.avatar { - float: left; display: block; - width: 70px; overflow: hidden; position: relative; text-decoration: none; - img { width: 100%; } - span { - display: block; line-height: 1; padding: 3px; margin: 5px 0 0; color: @white; background: @accent_colour; - .border_radius(3); .text_shadow(1, 1, 0, @grey); - text-align: center; font-size: 10px; font-weight: bold; text-transform: uppercase; - } - } - form { - margin: 0 0 0 90px; - h4 { margin: 10px 0 20px; border-bottom: 1px solid (@light_grey * 0.5 + @white * 0.5); padding: 0; color: @bg; font-size: 16px; } - ul.choices { - li { width: 30%; } - } - div.extra { margin-top: 20px; } - } - } - - #networks { - ul { margin: 0 -10px -10px 0; padding: 0; overflow: hidden; - li:hover - { - background: @light_grey; display: block; float: left; width: 180px; - padding: 10px; margin: 0 10px 10px 0; list-style: none; .border_radius(3); - position: relative; - * { line-height: normal; } - img { vertical-align: middle; float: left; } - .name { font-weight: bold; font-size: 14px; display: block; margin: -2px 0 0 42px; } - small { - font-size: 12px; color: @grey; display: block; margin-left: 42px; - strong { color: @black; font-weight: normal; } - } - :hover { - } - } - li.installed { - background: @white; - border: 2px solid @accent_colour; padding: 8px; - } - li.unavailable { - .name { color: @black; } - :hover { - background: @light_grey; - } - } - li:hover { - background: @light_grey * 0.5 + @white * 0.5; - } - } - } - } -} - -/* Shopping Style Panel */ -#shopping_style { - div.header a.button.small { float: right; } - div.content { - p { - margin: 0 0 10px; - label { text-transform: uppercase; font-size: 11px; display: block; color: @bg; font-weight: bold; } - span { color: @black; } - span.toggle { white-space: nowrap; color: @grey; } - :last-child { margin: 0; } - } - p.more { text-align: left; font-weight: normal; } - p.less { display: none; margin: 0; } - } -} - -/* People Controller */ -#people_controller.index { - #main { - div.panel { - float: left; width: 300px; margin: 0 20px 0 0; - :last-child { margin-right: 0; } - } - } -} -#people_controller.show { - #person_overview, #shopping_style { - a.button.small { - } - } - #content { - #shopping_style { - float: left; width: 240px; margin: 0 20px 0 0; - } - #main { width: 360px; } - } -} - -/* Search Results */ -#search_results { - margin: 0 0 20px; - li { - :hover { - small { color: @white * 0.75 + @accent_colour * 0.25; } - } - } -} -#search { - div.content { - padding: 20px; - form { - margin: 0; float: none; - span.submit_and_options { - display: block; - } - } - p { margin: 0 0 15px; } - h4 { font-weight: normal; margin: 0 0 5px; } - } -} - -/* Recommendations */ -#recommendations { - div.browse { - margin: 0; padding: 0; background: none; - ul { min-height: 0; .border_radius(0); } - } -} - -/* Blank States */ -div.blank { - padding: 20px; background: @bg * 0.05 + @blue * 0.05 + @white * 0.9; position: relative; - border: 1px solid (@bg * 0.1 + @blue * 0.1 + @white * 0.8); z-index: 1; - h4 { font-size: 18px; margin: 0 0 10px; } - h4:last-child { margin: 0; } - p { font-size: 16px; margin: 0 0 10px; } - p:last-child { margin: 0; } - p.with_list_number.large { - span { margin-left: 48px; display: block; color: @white; } - } - p.earn span { font-size: 22px; color: @white; line-height: 48px; font-weight: bold; } - a { white-space: nowrap; } - a.hide { - position: absolute; top: -5px; right: -5px; display: block; height: 16px; width: 16px; padding: 3px; background: #E7E9F6; .border_radius(99); - } -} - -div.blank.small { - padding: 10px 20px; - h4 { font-weight: normal; font-size: 16px; } - p { margin: 0; } -} -div.blank.tiny { - padding: 10px 20px; - h4 { font-weight: normal; font-size: 14px; } - p { margin: 0; font-size: 12px; } -} -div.blank.rounded { - .border_radius(3); margin: 0 0 20px; -} -div.blank.rounded.bottom { .border_radius_top(0); } -div.blank.with_border_bottom { border-bottom: 1px solid (@bg * 0.1 + @blue * 0.1 + @white * 0.8); } -div.blank.no_border_top { border-top: none; } -div.blank.no_border_bottom { border-bottom: none; } -div.blank.no_side_borders { border-right: none; border-left: none; } -div.panel { - div.blank { - padding: 10px 20px; overflow: hidden; margin: 0; - h4 { font-weight: normal; font-size: 14px; } - p, ul { margin: 0 0 10px; font-size: 12px; } - p:last-child, ul:last-child { margin: 0; } - } -} - -#yelow { - #short { - color: #fea; - } - #long { - color: #ffeeaa; - } - #rgba { - color: rgba(255, 238, 170, 0.1); - } -} - -#blue { - #short { - color: #00f; - } - #long { - color: #0000ff; - } - #rgba { - color: rgba(0, 0, 255, 0.1); - } -} - -#overflow { - .a { color: #111111 - #444444; } // #000000 - .b { color: #eee + #fff; } // #ffffff - .c { color: #aaa * 3; } // #ffffff - .d { color: #00ee00 + #009900; } // #00ff00 -} - -#grey { - color: rgb(200, 200, 200); -} - -#808080 { - color: hsl(50, 0%, 50%); -} - -#00ff00 { - color: hsl(120, 100%, 50%); -} -/******************\ -* * -* Comment Header * -* * -\******************/ - -/* - - Comment - -*/ - -/* - * Comment Test - * - * - cloudhead (http://cloudhead.net) - * - */ - -//////////////// -@var: "content"; -//////////////// - -/* Colors - * ------ - * #EDF8FC (background blue) - * #166C89 (darkest blue) - * - * Text: - * #333 (standard text) // A comment within a comment! - * #1F9EC9 (standard link) - * - */ - -/* @group Variables -------------------- */ -#comments /* boo */ { - /**/ // An empty comment - color: red; /* A C-style comment */ - background-color: orange; // A little comment - font-size: 12px; - - /* lost comment */ content: @var; - - border: 1px solid black; - - // padding & margin // - padding: 0; - margin: 2em; -} // - -/* commented out - #more-comments { - color: grey; - } -*/ - -#last { color: blue } -// -.comma-delimited { - background: url(bg.jpg) no-repeat, url(bg.png) repeat-x top left, url(bg); - text-shadow: -1px -1px 1px red, 6px 5px 5px yellow; - -moz-box-shadow: 0pt 0pt 2px rgba(255, 255, 255, 0.4) inset, - 0pt 4px 6px rgba(255, 255, 255, 0.4) inset; -} -@font-face { - font-family: Headline; - src: local(Futura-Medium), - url(fonts.svg#MyGeometricModern) format("svg"); -} -.other { - -moz-transform: translate(0, 11em) rotate(-90deg); -} -p:not([class*="lead"]) { - color: black; -} - -input[type="text"].class#id[attr=32]:not(1) { - color: white; -} - -div#id.class[a=1][b=2].class:not(1) { - color: white; -} - -ul.comma > li:not(:only-child)::after { - color: white; -} - -ol.comma > li:nth-last-child(2)::after { - color: white; -} - -li:nth-child(4n+1), -li:nth-child(-5n), -li:nth-child(-n+2) { - color: white; -} - -a[href^="http://"] { - color: black; -} - -a[href$="http://"] { - color: black; -} - -form[data-disabled] { - color: black; -} - -p::before { - color: black; -} -@charset "utf-8"; -div { color: black; } -div { width: 99%; } - -* { - min-width: 45em; -} - -h1, h2 > a > p, h3 { - color: none; -} - -div.class { - color: blue; -} - -div#id { - color: green; -} - -.class#id { - color: purple; -} - -.one.two.three { - color: grey; -} - -@media print { - font-size: 3em; -} - -@media screen { - font-size: 10px; -} - -@font-face { - font-family: 'Garamond Pro'; - src: url("/fonts/garamond-pro.ttf"); -} - -a:hover, a:link { - color: #999; -} - -p, p:first-child { - text-transform: none; -} - -q:lang(no) { - quotes: none; -} - -p + h1 { - font-size: 2.2em; -} - -#shorthands { - border: 1px solid #000; - font: 12px/16px Arial; - margin: 1px 0; - padding: 0 auto; - background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px; -} - -#more-shorthands { - margin: 0; - padding: 1px 0 2px 0; - font: normal small/20px 'Trebuchet MS', Verdana, sans-serif; -} - -.misc { - -moz-border-radius: 2px; - display: -moz-inline-stack; - width: .1em; - background-color: #009998; - background-image: url(images/image.jpg); - background: -webkit-gradient(linear, left top, left bottom, from(red), to(blue)); - margin: ; -} - -#important { - color: red !important; - width: 100%!important; - height: 20px ! important; -} - -#functions { - @var: 10; - color: color("evil red"); // #660000 - width: increment(15); - height: undefined("self"); - border-width: add(2, 3); - variable: increment(@var); -} - -#built-in { - @r: 32; - escaped: e("-Some::weird(#thing, y)"); - lighten: lighten(#ff0000, 50%); - darken: darken(#ff0000, 50%); - saturate: saturate(#29332f, 20%); - desaturate: desaturate(#203c31, 20%); - greyscale: greyscale(#203c31); - format: %("rgb(%d, %d, %d)", @r, 128, 64); - format-string: %("hello %s", "world"); - eformat: e(%("rgb(%d, %d, %d)", @r, 128, 64)); -} - -@var: @a; -@a: 100%; - -.lazy-eval { - width: @var; -} -.mixin (@a: 1px, @b: 50%) { - width: @a * 5; - height: @b - 1%; -} - -.mixina (@style, @width, @color: black) { - border: @width @style @color; -} - -.mixiny -(@a: 0, @b: 0) { - margin: @a; - padding: @b; -} - -.hidden() { - color: transparent; -} - -.two-args { - color: blue; - .mixin(2px, 100%); - .mixina(dotted, 2px); -} - -.one-arg { - .mixin(3px); -} - -.no-parens { - .mixin; -} - -.no-args { - .mixin(); -} - -.var-args { - @var: 9; - .mixin(@var, @var * 2); -} - -.multi-mix { - .mixin(2px, 30%); - .mixiny(4, 5); -} - -.maxa(@arg1: 10, @arg2: #f00) { - padding: @arg1 * 2px; - color: @arg2; -} - -body { - .maxa(15); -} - -@glob: 5; -.global-mixin(@a:2) { - width: @glob + @a; -} - -.scope-mix { - .global-mixin(3); -} - -.nested-ruleset (@width: 200px) { - width: @width; - .column { margin: @width; } -} -.content { - .nested-ruleset(600px); -} - -// - -.same-var-name2(@radius) { - radius: @radius; -} -.same-var-name(@radius) { - .same-var-name2(@radius); -} -#same-var-name { - .same-var-name(5px); -} - -// - -.var-inside () { - @var: 10px; - width: @var; -} -#var-inside { .var-inside; } -.mix-inner (@var) { - border-width: @var; -} - -.mix (@a: 10) { - .inner { - height: @a * 10; - - .innest { - width: @a; - .mix-inner(@a * 2); - } - } -} - -.class { - .mix(30); -} -.mixin () { - zero: 0; -} -.mixin (@a: 1px) { - one: 1; -} -.mixin (@a) { - one-req: 1; -} -.mixin (@a: 1px, @b: 2px) { - two: 2; -} - -.mixin (@a, @b, @c) { - three-req: 3; -} - -.mixin (@a: 1px, @b: 2px, @c: 3px) { - three: 3; -} - -.zero { - .mixin(); -} - -.one { - .mixin(1); -} - -.two { - .mixin(1, 2); -} - -.three { - .mixin(1, 2, 3); -} - -// - -.mixout ('left') { - left: 1; -} - -.mixout ('right') { - right: 1; -} - -.left { - .mixout('left'); -} -.right { - .mixout('right'); -} - -// - -.border (@side, @width) { - color: black; - .border-side(@side, @width); -} -.border-side (left, @w) { - border-left: @w; -} -.border-side (right, @w) { - border-right: @w; -} - -.border-right { - .border(right, 4px); -} -.border-left { - .border(left, 4px); -} - -// - - -.border-radius (@r) { - both: @r * 10; -} -.border-radius (@r, left) { - left: @r; -} -.border-radius (@r, right) { - right: @r; -} - -.only-right { - .border-radius(33, right); -} -.only-left { - .border-radius(33, left); -} -.left-right { - .border-radius(33); -} -.mixin { border: 1px solid black; } -.mixout { border-color: orange; } -.borders { border-style: dashed; } - -#namespace { - .borders { - border-style: dotted; - } - .biohazard { - content: "death"; - .man { - color: transparent; - } - } -} -#theme { - > .mixin { - background-color: grey; - } -} -#container { - color: black; - .mixin; - .mixout; - #theme > .mixin; -} - -#header { - .milk { - color: white; - .mixin; - #theme > .mixin; - } - #cookie { - .chips { - #namespace .borders; - .calories { - #container; - } - } - .borders; - } -} -.secure-zone { #namespace .biohazard .man; } -.direct { - #namespace > .borders; -} -#operations { - color: #110000 + #000011 + #001100; // #111111 - height: 10px / 2px + 6px - 1px * 2; // 9px - width: 2 * 4 - 5em; // 3em - .spacing { - height: 10px / 2px+6px-1px*2; - width: 2 * 4-5em; - } - substraction: 20 - 10 - 5 - 5; // 0 - division: 20 / 5 / 4; // 1 -} - -@x: 4; -@y: 12em; - -.with-variables { - height: @x + @y; // 16em - width: 12 + @y; // 24em - size: 5cm - @x; // 1cm -} - -@z: -2; - -.negative { - height: 2px + @z; // 0px - width: 2px - @z; // 4px -} - -.shorthands { - padding: -1px 2px 0 -4px; // -} - -.colors { - color: #123; // #112233 - border-color: #234 + #111111; // #334455 - background-color: #222222 - #fff; // #000000 - .other { - color: 2 * #111; // #222222 - border-color: #333333 / 3 + #111; // #222222 - } -} -.parens { - @var: 1px; - border: (@var * 2) solid black; - margin: (@var * 1) (@var + 2) (4 * 4) 3; - width: (6 * 6); - padding: 2px (6px * 6px); -} - -.more-parens { - @var: (2 * 2); - padding: (2 * @var) 4 4 (@var * 1px); - width: (@var * @var) * 6; - height: (7 * 7) + (8 * 8); - margin: 4 * (5 + 5) / 2 - (@var * 2); - //margin: (6 * 6)px; -} - -.nested-parens { - width: 2 * (4 * (2 + (1 + 6))) - 1; - height: ((2+3)*(2+3) / (9-4)) + 1; -} - -.mixed-units { - margin: 2px 4em 1 5pc; - padding: (2px + 4px) 1em 2px 2; -} -#first > .one { - > #second .two > #deux { - width: 50%; - #third { - &:focus { - color: black; - #fifth { - > #sixth { - .seventh #eighth { - + #ninth { - color: purple; - } - } - } - } - } - height: 100%; - } - #fourth, #five, #six { - color: #110000; - .seven, .eight > #nine { - border: 1px solid black; - } - #ten { - color: red; - } - } - } - font-size: 2em; -} -@x: blue; -@z: transparent; -@mix: none; - -.mixin { - @mix: #989; -} - -.tiny-scope { - color: @mix; // #989 - .mixin; -} - -.scope1 { - @y: orange; - @z: black; - color: @x; // blue - border-color: @z; // black - .hidden { - @x: #131313; - } - .scope2 { - @y: red; - color: @x; // blue - .scope3 { - @local: white; - color: @y; // red - border-color: @z; // black - background-color: @local; // white - } - } -}h1, h2, h3 { - a, p { - &:hover { - color: red; - } - } -} - -#all { color: blue; } -#the { color: blue; } -#same { color: blue; } - -ul, li, div, q, blockquote, textarea { - margin: 0; -} - -td { - margin: 0; - padding: 0; -} - -td, input { - line-height: 1em; -} -#strings { - background-image: url("http://son-of-a-banana.com"); - quotes: "~" "~"; - content: "#*%:&^,)!.(~*})"; - empty: ""; - brackets: "{" "}"; -} -#comments { - content: "/* hello */ // not-so-secret"; -} -#single-quote { - quotes: "'" "'"; - content: '""#!&""'; - empty: ''; -} -@a: 2; -@x: @a * @a; -@y: @x + 1; -@z: @x * 2 + @y; - -.variables { - width: @z + 1cm; // 14cm -} - -@b: @a * 10; -@c: #888; - -@fonts: "Trebuchet MS", Verdana, sans-serif; -@f: @fonts; - -@quotes: "~" "~"; -@q: @quotes; - -.variables { - height: @b + @x + 0px; // 24px - color: @c; - font-family: @f; - quotes: @q; -} - -.redefinition { - @var: 4; - @var: 2; - @var: 3; - three: @var; -} - -.values { - @a: 'Trebuchet'; - font-family: @a, @a, @a; -} - - -.whitespace - { color: white; } - -.whitespace -{ - color: white; -} - .whitespace -{ color: white; } - -.whitespace{color:white;} -.whitespace { color : white ; } - -.white, -.space, -.mania -{ color: white; } - -.no-semi-column { color: white } -.no-semi-column { - color: white; - white-space: pre -} -.no-semi-column {border: 2px solid white} -.newlines { - background: the, - great, - wall; - border: 2px - solid - black; -} -.empty { - -} -#yelow { - #short { - color: #fea; - } - #long { - color: #ffeeaa; - } - #rgba { - color: rgba(255, 238, 170, 0.1); - } -} - -#blue { - #short { - color: #00f; - } - #long { - color: #0000ff; - } - #rgba { - color: rgba(0, 0, 255, 0.1); - } -} - -#overflow { - .a { color: #111111 - #444444; } // #000000 - .b { color: #eee + #fff; } // #ffffff - .c { color: #aaa * 3; } // #ffffff - .d { color: #00ee00 + #009900; } // #00ff00 -} - -#grey { - color: rgb(200, 200, 200); -} - -#808080 { - color: hsl(50, 0%, 50%); -} - -#00ff00 { - color: hsl(120, 100%, 50%); -} -/******************\ -* * -* Comment Header * -* * -\******************/ - -/* - - Comment - -*/ - -/* - * Comment Test - * - * - cloudhead (http://cloudhead.net) - * - */ - -//////////////// -@var: "content"; -//////////////// - -/* Colors - * ------ - * #EDF8FC (background blue) - * #166C89 (darkest blue) - * - * Text: - * #333 (standard text) // A comment within a comment! - * #1F9EC9 (standard link) - * - */ - -/* @group Variables -------------------- */ -#comments /* boo */ { - /**/ // An empty comment - color: red; /* A C-style comment */ - background-color: orange; // A little comment - font-size: 12px; - - /* lost comment */ content: @var; - - border: 1px solid black; - - // padding & margin // - padding: 0; - margin: 2em; -} // - -/* commented out - #more-comments { - color: grey; - } -*/ - -#last { color: blue } -// -.comma-delimited { - background: url(bg.jpg) no-repeat, url(bg.png) repeat-x top left, url(bg); - text-shadow: -1px -1px 1px red, 6px 5px 5px yellow; - -moz-box-shadow: 0pt 0pt 2px rgba(255, 255, 255, 0.4) inset, - 0pt 4px 6px rgba(255, 255, 255, 0.4) inset; -} -@font-face { - font-family: Headline; - src: local(Futura-Medium), - url(fonts.svg#MyGeometricModern) format("svg"); -} -.other { - -moz-transform: translate(0, 11em) rotate(-90deg); -} -p:not([class*="lead"]) { - color: black; -} - -input[type="text"].class#id[attr=32]:not(1) { - color: white; -} - -div#id.class[a=1][b=2].class:not(1) { - color: white; -} - -ul.comma > li:not(:only-child)::after { - color: white; -} - -ol.comma > li:nth-last-child(2)::after { - color: white; -} - -li:nth-child(4n+1), -li:nth-child(-5n), -li:nth-child(-n+2) { - color: white; -} - -a[href^="http://"] { - color: black; -} - -a[href$="http://"] { - color: black; -} - -form[data-disabled] { - color: black; -} - -p::before { - color: black; -} -@charset "utf-8"; -div { color: black; } -div { width: 99%; } - -* { - min-width: 45em; -} - -h1, h2 > a > p, h3 { - color: none; -} - -div.class { - color: blue; -} - -div#id { - color: green; -} - -.class#id { - color: purple; -} - -.one.two.three { - color: grey; -} - -@media print { - font-size: 3em; -} - -@media screen { - font-size: 10px; -} - -@font-face { - font-family: 'Garamond Pro'; - src: url("/fonts/garamond-pro.ttf"); -} - -a:hover, a:link { - color: #999; -} - -p, p:first-child { - text-transform: none; -} - -q:lang(no) { - quotes: none; -} - -p + h1 { - font-size: 2.2em; -} - -#shorthands { - border: 1px solid #000; - font: 12px/16px Arial; - margin: 1px 0; - padding: 0 auto; - background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px; -} - -#more-shorthands { - margin: 0; - padding: 1px 0 2px 0; - font: normal small/20px 'Trebuchet MS', Verdana, sans-serif; -} - -.misc { - -moz-border-radius: 2px; - display: -moz-inline-stack; - width: .1em; - background-color: #009998; - background-image: url(images/image.jpg); - background: -webkit-gradient(linear, left top, left bottom, from(red), to(blue)); - margin: ; -} - -#important { - color: red !important; - width: 100%!important; - height: 20px ! important; -} - -#functions { - @var: 10; - color: color("evil red"); // #660000 - width: increment(15); - height: undefined("self"); - border-width: add(2, 3); - variable: increment(@var); -} - -#built-in { - @r: 32; - escaped: e("-Some::weird(#thing, y)"); - lighten: lighten(#ff0000, 50%); - darken: darken(#ff0000, 50%); - saturate: saturate(#29332f, 20%); - desaturate: desaturate(#203c31, 20%); - greyscale: greyscale(#203c31); - format: %("rgb(%d, %d, %d)", @r, 128, 64); - format-string: %("hello %s", "world"); - eformat: e(%("rgb(%d, %d, %d)", @r, 128, 64)); -} - -@var: @a; -@a: 100%; - -.lazy-eval { - width: @var; -} -.mixin (@a: 1px, @b: 50%) { - width: @a * 5; - height: @b - 1%; -} - -.mixina (@style, @width, @color: black) { - border: @width @style @color; -} - -.mixiny -(@a: 0, @b: 0) { - margin: @a; - padding: @b; -} - -.hidden() { - color: transparent; -} - -.two-args { - color: blue; - .mixin(2px, 100%); - .mixina(dotted, 2px); -} - -.one-arg { - .mixin(3px); -} - -.no-parens { - .mixin; -} - -.no-args { - .mixin(); -} - -.var-args { - @var: 9; - .mixin(@var, @var * 2); -} - -.multi-mix { - .mixin(2px, 30%); - .mixiny(4, 5); -} - -.maxa(@arg1: 10, @arg2: #f00) { - padding: @arg1 * 2px; - color: @arg2; -} - -body { - .maxa(15); -} - -@glob: 5; -.global-mixin(@a:2) { - width: @glob + @a; -} - -.scope-mix { - .global-mixin(3); -} - -.nested-ruleset (@width: 200px) { - width: @width; - .column { margin: @width; } -} -.content { - .nested-ruleset(600px); -} - -// - -.same-var-name2(@radius) { - radius: @radius; -} -.same-var-name(@radius) { - .same-var-name2(@radius); -} -#same-var-name { - .same-var-name(5px); -} - -// - -.var-inside () { - @var: 10px; - width: @var; -} -#var-inside { .var-inside; } -.mix-inner (@var) { - border-width: @var; -} - -.mix (@a: 10) { - .inner { - height: @a * 10; - - .innest { - width: @a; - .mix-inner(@a * 2); - } - } -} - -.class { - .mix(30); -} -.mixin () { - zero: 0; -} -.mixin (@a: 1px) { - one: 1; -} -.mixin (@a) { - one-req: 1; -} -.mixin (@a: 1px, @b: 2px) { - two: 2; -} - -.mixin (@a, @b, @c) { - three-req: 3; -} - -.mixin (@a: 1px, @b: 2px, @c: 3px) { - three: 3; -} - -.zero { - .mixin(); -} - -.one { - .mixin(1); -} - -.two { - .mixin(1, 2); -} - -.three { - .mixin(1, 2, 3); -} - -// - -.mixout ('left') { - left: 1; -} - -.mixout ('right') { - right: 1; -} - -.left { - .mixout('left'); -} -.right { - .mixout('right'); -} - -// - -.border (@side, @width) { - color: black; - .border-side(@side, @width); -} -.border-side (left, @w) { - border-left: @w; -} -.border-side (right, @w) { - border-right: @w; -} - -.border-right { - .border(right, 4px); -} -.border-left { - .border(left, 4px); -} - -// - - -.border-radius (@r) { - both: @r * 10; -} -.border-radius (@r, left) { - left: @r; -} -.border-radius (@r, right) { - right: @r; -} - -.only-right { - .border-radius(33, right); -} -.only-left { - .border-radius(33, left); -} -.left-right { - .border-radius(33); -} -.mixin { border: 1px solid black; } -.mixout { border-color: orange; } -.borders { border-style: dashed; } - -#namespace { - .borders { - border-style: dotted; - } - .biohazard { - content: "death"; - .man { - color: transparent; - } - } -} -#theme { - > .mixin { - background-color: grey; - } -} -#container { - color: black; - .mixin; - .mixout; - #theme > .mixin; -} - -#header { - .milk { - color: white; - .mixin; - #theme > .mixin; - } - #cookie { - .chips { - #namespace .borders; - .calories { - #container; - } - } - .borders; - } -} -.secure-zone { #namespace .biohazard .man; } -.direct { - #namespace > .borders; -} -#operations { - color: #110000 + #000011 + #001100; // #111111 - height: 10px / 2px + 6px - 1px * 2; // 9px - width: 2 * 4 - 5em; // 3em - .spacing { - height: 10px / 2px+6px-1px*2; - width: 2 * 4-5em; - } - substraction: 20 - 10 - 5 - 5; // 0 - division: 20 / 5 / 4; // 1 -} - -@x: 4; -@y: 12em; - -.with-variables { - height: @x + @y; // 16em - width: 12 + @y; // 24em - size: 5cm - @x; // 1cm -} - -@z: -2; - -.negative { - height: 2px + @z; // 0px - width: 2px - @z; // 4px -} - -.shorthands { - padding: -1px 2px 0 -4px; // -} - -.colors { - color: #123; // #112233 - border-color: #234 + #111111; // #334455 - background-color: #222222 - #fff; // #000000 - .other { - color: 2 * #111; // #222222 - border-color: #333333 / 3 + #111; // #222222 - } -} -.parens { - @var: 1px; - border: (@var * 2) solid black; - margin: (@var * 1) (@var + 2) (4 * 4) 3; - width: (6 * 6); - padding: 2px (6px * 6px); -} - -.more-parens { - @var: (2 * 2); - padding: (2 * @var) 4 4 (@var * 1px); - width: (@var * @var) * 6; - height: (7 * 7) + (8 * 8); - margin: 4 * (5 + 5) / 2 - (@var * 2); - //margin: (6 * 6)px; -} - -.nested-parens { - width: 2 * (4 * (2 + (1 + 6))) - 1; - height: ((2+3)*(2+3) / (9-4)) + 1; -} - -.mixed-units { - margin: 2px 4em 1 5pc; - padding: (2px + 4px) 1em 2px 2; -} -#first > .one { - > #second .two > #deux { - width: 50%; - #third { - &:focus { - color: black; - #fifth { - > #sixth { - .seventh #eighth { - + #ninth { - color: purple; - } - } - } - } - } - height: 100%; - } - #fourth, #five, #six { - color: #110000; - .seven, .eight > #nine { - border: 1px solid black; - } - #ten { - color: red; - } - } - } - font-size: 2em; -} -@x: blue; -@z: transparent; -@mix: none; - -.mixin { - @mix: #989; -} - -.tiny-scope { - color: @mix; // #989 - .mixin; -} - -.scope1 { - @y: orange; - @z: black; - color: @x; // blue - border-color: @z; // black - .hidden { - @x: #131313; - } - .scope2 { - @y: red; - color: @x; // blue - .scope3 { - @local: white; - color: @y; // red - border-color: @z; // black - background-color: @local; // white - } - } -}h1, h2, h3 { - a, p { - &:hover { - color: red; - } - } -} - -#all { color: blue; } -#the { color: blue; } -#same { color: blue; } - -ul, li, div, q, blockquote, textarea { - margin: 0; -} - -td { - margin: 0; - padding: 0; -} - -td, input { - line-height: 1em; -} -#strings { - background-image: url("http://son-of-a-banana.com"); - quotes: "~" "~"; - content: "#*%:&^,)!.(~*})"; - empty: ""; - brackets: "{" "}"; -} -#comments { - content: "/* hello */ // not-so-secret"; -} -#single-quote { - quotes: "'" "'"; - content: '""#!&""'; - empty: ''; -} -@a: 2; -@x: @a * @a; -@y: @x + 1; -@z: @x * 2 + @y; - -.variables { - width: @z + 1cm; // 14cm -} - -@b: @a * 10; -@c: #888; - -@fonts: "Trebuchet MS", Verdana, sans-serif; -@f: @fonts; - -@quotes: "~" "~"; -@q: @quotes; - -.variables { - height: @b + @x + 0px; // 24px - color: @c; - font-family: @f; - quotes: @q; -} - -.redefinition { - @var: 4; - @var: 2; - @var: 3; - three: @var; -} - -.values { - @a: 'Trebuchet'; - font-family: @a, @a, @a; -} - - -.whitespace - { color: white; } - -.whitespace -{ - color: white; -} - .whitespace -{ color: white; } - -.whitespace{color:white;} -.whitespace { color : white ; } - -.white, -.space, -.mania -{ color: white; } - -.no-semi-column { color: white } -.no-semi-column { - color: white; - white-space: pre -} -.no-semi-column {border: 2px solid white} -.newlines { - background: the, - great, - wall; - border: 2px - solid - black; -} -.empty { - -} -#yelow { - #short { - color: #fea; - } - #long { - color: #ffeeaa; - } - #rgba { - color: rgba(255, 238, 170, 0.1); - } -} - -#blue { - #short { - color: #00f; - } - #long { - color: #0000ff; - } - #rgba { - color: rgba(0, 0, 255, 0.1); - } -} - -#overflow { - .a { color: #111111 - #444444; } // #000000 - .b { color: #eee + #fff; } // #ffffff - .c { color: #aaa * 3; } // #ffffff - .d { color: #00ee00 + #009900; } // #00ff00 -} - -#grey { - color: rgb(200, 200, 200); -} - -#808080 { - color: hsl(50, 0%, 50%); -} - -#00ff00 { - color: hsl(120, 100%, 50%); -} -/******************\ -* * -* Comment Header * -* * -\******************/ - -/* - - Comment - -*/ - -/* - * Comment Test - * - * - cloudhead (http://cloudhead.net) - * - */ - -//////////////// -@var: "content"; -//////////////// - -/* Colors - * ------ - * #EDF8FC (background blue) - * #166C89 (darkest blue) - * - * Text: - * #333 (standard text) // A comment within a comment! - * #1F9EC9 (standard link) - * - */ - -/* @group Variables -------------------- */ -#comments /* boo */ { - /**/ // An empty comment - color: red; /* A C-style comment */ - background-color: orange; // A little comment - font-size: 12px; - - /* lost comment */ content: @var; - - border: 1px solid black; - - // padding & margin // - padding: 0; - margin: 2em; -} // - -/* commented out - #more-comments { - color: grey; - } -*/ - -#last { color: blue } -// -.comma-delimited { - background: url(bg.jpg) no-repeat, url(bg.png) repeat-x top left, url(bg); - text-shadow: -1px -1px 1px red, 6px 5px 5px yellow; - -moz-box-shadow: 0pt 0pt 2px rgba(255, 255, 255, 0.4) inset, - 0pt 4px 6px rgba(255, 255, 255, 0.4) inset; -} -@font-face { - font-family: Headline; - src: local(Futura-Medium), - url(fonts.svg#MyGeometricModern) format("svg"); -} -.other { - -moz-transform: translate(0, 11em) rotate(-90deg); -} -p:not([class*="lead"]) { - color: black; -} - -input[type="text"].class#id[attr=32]:not(1) { - color: white; -} - -div#id.class[a=1][b=2].class:not(1) { - color: white; -} - -ul.comma > li:not(:only-child)::after { - color: white; -} - -ol.comma > li:nth-last-child(2)::after { - color: white; -} - -li:nth-child(4n+1), -li:nth-child(-5n), -li:nth-child(-n+2) { - color: white; -} - -a[href^="http://"] { - color: black; -} - -a[href$="http://"] { - color: black; -} - -form[data-disabled] { - color: black; -} - -p::before { - color: black; -} -@charset "utf-8"; -div { color: black; } -div { width: 99%; } - -* { - min-width: 45em; -} - -h1, h2 > a > p, h3 { - color: none; -} - -div.class { - color: blue; -} - -div#id { - color: green; -} - -.class#id { - color: purple; -} - -.one.two.three { - color: grey; -} - -@media print { - font-size: 3em; -} - -@media screen { - font-size: 10px; -} - -@font-face { - font-family: 'Garamond Pro'; - src: url("/fonts/garamond-pro.ttf"); -} - -a:hover, a:link { - color: #999; -} - -p, p:first-child { - text-transform: none; -} - -q:lang(no) { - quotes: none; -} - -p + h1 { - font-size: 2.2em; -} - -#shorthands { - border: 1px solid #000; - font: 12px/16px Arial; - margin: 1px 0; - padding: 0 auto; - background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px; -} - -#more-shorthands { - margin: 0; - padding: 1px 0 2px 0; - font: normal small/20px 'Trebuchet MS', Verdana, sans-serif; -} - -.misc { - -moz-border-radius: 2px; - display: -moz-inline-stack; - width: .1em; - background-color: #009998; - background-image: url(images/image.jpg); - background: -webkit-gradient(linear, left top, left bottom, from(red), to(blue)); - margin: ; -} - -#important { - color: red !important; - width: 100%!important; - height: 20px ! important; -} - -#functions { - @var: 10; - color: color("evil red"); // #660000 - width: increment(15); - height: undefined("self"); - border-width: add(2, 3); - variable: increment(@var); -} - -#built-in { - @r: 32; - escaped: e("-Some::weird(#thing, y)"); - lighten: lighten(#ff0000, 50%); - darken: darken(#ff0000, 50%); - saturate: saturate(#29332f, 20%); - desaturate: desaturate(#203c31, 20%); - greyscale: greyscale(#203c31); - format: %("rgb(%d, %d, %d)", @r, 128, 64); - format-string: %("hello %s", "world"); - eformat: e(%("rgb(%d, %d, %d)", @r, 128, 64)); -} - -@var: @a; -@a: 100%; - -.lazy-eval { - width: @var; -} -.mixin (@a: 1px, @b: 50%) { - width: @a * 5; - height: @b - 1%; -} - -.mixina (@style, @width, @color: black) { - border: @width @style @color; -} - -.mixiny -(@a: 0, @b: 0) { - margin: @a; - padding: @b; -} - -.hidden() { - color: transparent; -} - -.two-args { - color: blue; - .mixin(2px, 100%); - .mixina(dotted, 2px); -} - -.one-arg { - .mixin(3px); -} - -.no-parens { - .mixin; -} - -.no-args { - .mixin(); -} - -.var-args { - @var: 9; - .mixin(@var, @var * 2); -} - -.multi-mix { - .mixin(2px, 30%); - .mixiny(4, 5); -} - -.maxa(@arg1: 10, @arg2: #f00) { - padding: @arg1 * 2px; - color: @arg2; -} - -body { - .maxa(15); -} - -@glob: 5; -.global-mixin(@a:2) { - width: @glob + @a; -} - -.scope-mix { - .global-mixin(3); -} - -.nested-ruleset (@width: 200px) { - width: @width; - .column { margin: @width; } -} -.content { - .nested-ruleset(600px); -} - -// - -.same-var-name2(@radius) { - radius: @radius; -} -.same-var-name(@radius) { - .same-var-name2(@radius); -} -#same-var-name { - .same-var-name(5px); -} - -// - -.var-inside () { - @var: 10px; - width: @var; -} -#var-inside { .var-inside; } -.mix-inner (@var) { - border-width: @var; -} - -.mix (@a: 10) { - .inner { - height: @a * 10; - - .innest { - width: @a; - .mix-inner(@a * 2); - } - } -} - -.class { - .mix(30); -} -.mixin () { - zero: 0; -} -.mixin (@a: 1px) { - one: 1; -} -.mixin (@a) { - one-req: 1; -} -.mixin (@a: 1px, @b: 2px) { - two: 2; -} - -.mixin (@a, @b, @c) { - three-req: 3; -} - -.mixin (@a: 1px, @b: 2px, @c: 3px) { - three: 3; -} - -.zero { - .mixin(); -} - -.one { - .mixin(1); -} - -.two { - .mixin(1, 2); -} - -.three { - .mixin(1, 2, 3); -} - -// - -.mixout ('left') { - left: 1; -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/benchmark/less-benchmark.js b/deps/.npm/connect/0.2.5/package/support/less/benchmark/less-benchmark.js deleted file mode 100644 index c58816a5..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/benchmark/less-benchmark.js +++ /dev/null @@ -1,53 +0,0 @@ -var path = require('path'), - fs = require('fs'), - sys = require('sys'); - -require.paths.unshift(__dirname, path.join(__dirname, '..')); - -var less = require('lib/less'); -var file = path.join(__dirname, 'benchmark.less'); - -if (process.argv[2]) { file = path.join(process.cwd(), process.argv[2]) } - -fs.stat(file, function (e, stats) { - fs.open(file, process.O_RDONLY, stats.mode, function (e, fd) { - fs.read(fd, stats.size, 0, "utf8", function (e, data) { - var tree, css, start, end, total; - - sys.puts("Bechmarking...\n", path.basename(file) + " (" + - parseInt(data.length / 1024) + " KB)", ""); - - start = new(Date); - - new(less.Parser)({ optimization: 2 }).parse(data, function (err, tree) { - end = new(Date); - - total = end - start; - - sys.puts("Parsing: " + - total + " ms (" + - parseInt(1000 / total * - data.length / 1024) + " KB\/s)"); - - start = new(Date); - css = tree.toCSS(); - end = new(Date); - - sys.puts("Generation: " + (end - start) + " ms (" + - parseInt(1000 / (end - start) * - data.length / 1024) + " KB\/s)"); - - total += end - start; - - sys.puts("Total: " + total + "ms (" + - parseInt(1000 / total * data.length / 1024) + " KB/s)"); - - if (err) { - less.writeError(err); - process.exit(3); - } - }); - }); - }); -}); - diff --git a/deps/.npm/connect/0.2.5/package/support/less/bin/lessc b/deps/.npm/connect/0.2.5/package/support/less/bin/lessc deleted file mode 100755 index fb630c85..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/bin/lessc +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env node - -var path = require('path'), - fs = require('fs'), - sys = require('sys'); - -require.paths.unshift(path.join(__dirname, '..', 'lib')); - -var less = require('less'); -var args = process.argv.slice(1); -var options = { - compress: false, - optimization: 1, - silent: false -}; - -args = args.filter(function (arg) { - var match; - - if (match = arg.match(/^--?([a-z][0-9a-z-]*)$/i)) { arg = match[1] } - else { return arg } - - switch (arg) { - case 'v': - case 'version': - sys.puts("lessc " + less.version.join('.') + " (LESS Compiler) [JavaScript]"); - process.exit(0); - case 'verbose': - options.verbose = true; - break; - case 's': - case 'silent': - options.silent = true; - break; - case 'h': - case 'help': - sys.puts("usage: lessc source [destination]"); - process.exit(0); - case 'x': - case 'compress': - options.compress = true; - break; - case 'O0': options.optimization = 0; break; - case 'O1': options.optimization = 1; break; - case 'O2': options.optimization = 2; break; - } -}); - -var input = args[1]; -if (input && input[0] != '/') { - input = path.join(process.cwd(), input); -} -var output = args[2]; -if (output && output[0] != '/') { - output = path.join(process.cwd(), output); -} - -var css, fd, tree; - -if (! input) { - sys.puts("lessc: no input files"); - process.exit(1); -} - -fs.stat(input, function (e, stats) { - if (e) { - sys.puts("lessc: " + e.message); - process.exit(1); - } - fs.open(input, process.O_RDONLY, stats.mode, function (e, fd) { - fs.read(fd, stats.size, 0, "utf8", function (e, data) { - new(less.Parser)({ - paths: [path.dirname(input)], - optimization: options.optimization, - filename: input - }).parse(data, function (err, tree) { - if (err) { - less.writeError(err, options); - process.exit(1); - } else { - try { - css = tree.toCSS({ compress: options.compress }); - if (output) { - fd = fs.openSync(output, "w"); - fs.writeSync(fd, css, 0, "utf8"); - } else { - sys.print(css); - } - } catch (e) { - less.writeError(e, options); - process.exit(2); - } - } - }); - }); - }); -}); - diff --git a/deps/.npm/connect/0.2.5/package/support/less/dist/less-1.0.21.js b/deps/.npm/connect/0.2.5/package/support/less/dist/less-1.0.21.js deleted file mode 100644 index 98cc73c2..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/dist/less-1.0.21.js +++ /dev/null @@ -1,2313 +0,0 @@ -// -// LESS - Leaner CSS v1.0.21 -// http://lesscss.org -// -// Copyright (c) 2010, Alexis Sellier -// Licensed under the Apache 2.0 License. -// -(function (window, undefined) { -// -// Stub out `require` in the browser -// -function require(arg) { - return window.less[arg.split('/')[1]]; -}; - - -// ecma-5.js -// -// -- kriskowal Kris Kowal Copyright (C) 2009-2010 MIT License -// -- tlrobinson Tom Robinson -// dantman Daniel Friesen - -// -// Array -// -if (!Array.isArray) { - Array.isArray = function(obj) { - return Object.prototype.toString.call(obj) === "[object Array]" || - (obj instanceof Array); - }; -} -if (!Array.prototype.forEach) { - Array.prototype.forEach = function(block, thisObject) { - var len = this.length >>> 0; - for (var i = 0; i < len; i++) { - if (i in this) { - block.call(thisObject, this[i], i, this); - } - } - }; -} -if (!Array.prototype.map) { - Array.prototype.map = function(fun /*, thisp*/) { - var len = this.length >>> 0; - var res = new Array(len); - var thisp = arguments[1]; - - for (var i = 0; i < len; i++) { - if (i in this) { - res[i] = fun.call(thisp, this[i], i, this); - } - } - return res; - }; -} -if (!Array.prototype.filter) { - Array.prototype.filter = function (block /*, thisp */) { - var values = []; - var thisp = arguments[1]; - for (var i = 0; i < this.length; i++) { - if (block.call(thisp, this[i])) { - values.push(this[i]); - } - } - return values; - }; -} -if (!Array.prototype.reduce) { - Array.prototype.reduce = function(fun /*, initial*/) { - var len = this.length >>> 0; - var i = 0; - - // no value to return if no initial value and an empty array - if (len === 0 && arguments.length === 1) throw new TypeError(); - - if (arguments.length >= 2) { - var rv = arguments[1]; - } else { - do { - if (i in this) { - rv = this[i++]; - break; - } - // if array contains no values, no initial value to return - if (++i >= len) throw new TypeError(); - } while (true); - } - for (; i < len; i++) { - if (i in this) { - rv = fun.call(null, rv, this[i], i, this); - } - } - return rv; - }; -} -if (!Array.prototype.indexOf) { - Array.prototype.indexOf = function (value /*, fromIndex */ ) { - var length = this.length; - var i = arguments[1] || 0; - - if (!length) return -1; - if (i >= length) return -1; - if (i < 0) i += length; - - for (; i < length; i++) { - if (!Object.prototype.hasOwnProperty.call(this, i)) { continue } - if (value === this[i]) return i; - } - return -1; - }; -} - -// -// Object -// -if (!Object.keys) { - Object.keys = function (object) { - var keys = []; - for (var name in object) { - if (Object.prototype.hasOwnProperty.call(object, name)) { - keys.push(name); - } - } - return keys; - }; -} - -// -// String -// -if (!String.prototype.trim) { - String.prototype.trim = function () { - return String(this).replace(/^\s\s*/, '').replace(/\s\s*$/, ''); - }; -} -var less, tree; - -if (typeof(window) === 'undefined') { - less = exports, - tree = require('less/tree'); -} else { - less = window.less = {}, - tree = window.less.tree = {}; -} -// -// less.js - parser -// -// A relatively straight-forward recursive-descent parser. -// There is no tokenization/lexing stage, the input is parsed -// in one sweep. -// -// To make the parser fast enough to run in the browser, several -// optimization had to be made: -// -// - Instead of the more commonly used technique of slicing the -// input string on every match, we use global regexps (/g), -// and move the `lastIndex` pointer on match, foregoing `slice()` -// completely. This gives us a 3x speed-up. -// -// - Matching on a huge input is often cause of slowdowns, -// especially with the /g flag. The solution to that is to -// chunkify the input: we split it by /\n\n/, just to be on -// the safe side. The chunks are stored in the `chunks` var, -// `j` holds the current chunk index, and `current` holds -// the index of the current chunk in relation to `input`. -// This gives us an almost 4x speed-up. -// -// - In many cases, we don't need to match individual tokens; -// for example, if a value doesn't hold any variables, operations -// or dynamic references, the parser can effectively 'skip' it, -// treating it as a literal. -// An example would be '1px solid #000' - which evaluates to itself, -// we don't need to know what the individual components are. -// The drawback, of course is that you don't get the benefits of -// syntax-checking on the CSS. This gives us a 50% speed-up in the parser, -// and a smaller speed-up in the code-gen. -// -// -// Token matching is done with the `$` function, which either takes -// a terminal string or regexp, or a non-terminal function to call. -// It also takes care of moving all the indices forwards. -// -// -less.Parser = function Parser(env) { - var input, // LeSS input string - i, // current index in `input` - j, // current chunk - furthest, // furthest index the parser has gone to - chunks, // chunkified input - current, // index of current chunk, in `input` - inputLength, - parser; - - var that = this; - - // This function is called after all files - // have been imported through `@import`. - var finish = function () {}; - - var imports = this.imports = { - paths: env && env.paths || [], // Search paths, when importing - queue: [], // Files which haven't been imported yet - files: {}, // Holds the imported parse trees - push: function (path, callback) { - var that = this; - this.queue.push(path); - - // - // Import a file asynchronously - // - less.Parser.importer(path, this.paths, function (root) { - that.queue.splice(that.queue.indexOf(path), 1); // Remove the path from the queue - that.files[path] = root; // Store the root - - callback(root); - - if (that.queue.length === 0) { finish() } // Call `finish` if we're done importing - }); - } - }; - - // - // Parse from a token, regexp or string, and move forward if match - // - function $(tok) { - var match, args, length, c, index, endIndex; - - // - // Non-terminal - // - if (tok instanceof Function) { - return tok.call(parser.parsers); - // - // Terminal - // - // Either match a single character in the input, - // or match a regexp in the current chunk (chunk[j]). - // - } else if (typeof(tok) === 'string') { - match = input.charAt(i) === tok ? tok : null; - length = 1; - - // 1. We move to the next chunk, if necessary. - // 2. Set the `lastIndex` to be relative - // to the current chunk, and try to match in it. - // 3. Make sure we matched at `index`. Because we use - // the /g flag, the match could be anywhere in the - // chunk. We have to make sure it's at our previous - // index, which we stored in [2]. - // - } else { - if (i >= current + chunks[j].length && - j < chunks.length - 1) { // 1. - current += chunks[j++].length; - } - tok.lastIndex = index = i - current; // 2. - match = tok.exec(chunks[j]); - - if (match) { - length = match[0].length; - if (tok.lastIndex - length !== index) { return } // 3. - } - } - - // The match is confirmed, add the match length to `i`, - // and consume any extra white-space characters (' ' || '\n') - // which come after that. The reason for this is that LeSS's - // grammar is mostly white-space insensitive. - // - if (match) { - i += length; - endIndex = current + chunks[j].length; - - while (i <= endIndex) { - c = input.charCodeAt(i); - if (! (c === 32 || c === 10 || c === 9)) { break } - i++; - } - - if(typeof(match) === 'string') { - return match; - } else { - return match.length === 1 ? match[0] : match; - } - } - } - - // Same as $(), but don't change the state of the parser, - // just return the match. - function peek(tok) { - var match; - - if (typeof(tok) === 'string') { - return input.charAt(i) === tok; - } else { - tok.lastIndex = i; - - if ((match = tok.exec(input)) && - (tok.lastIndex - match[0].length === i)) { - return match; - } - } - } - - this.env = env || {}; - - // The optimization level dictates the thoroughness of the parser, - // the lower the number, the less nodes it will create in the tree. - // This could matter for debugging, or if you want to access - // the individual nodes in the tree. - this.optimization = ('optimization' in this.env) ? this.env.optimization : 1; - - // - // The Parser - // - return parser = { - - imports: imports, - // - // Parse an input string into an abstract syntax tree, - // call `callback` when done. - // - parse: function (str, callback) { - var root, start, end, zone, line, lines, buff = [], c, error = null; - - i = j = current = furthest = 0; - chunks = []; - input = str.replace(/\r\n/g, '\n'); - - // Split the input into chunks, - // delimited by /\n\n/ and - // removing comments (see rationale above), - // depending on the level of optimization. - if (that.optimization > 0) { - input = input.replace(/\/\*(?:[^*]|\*+[^\/*])*\*+\//g, function (comment) { - return that.optimization > 1 ? '' : comment.replace(/\n(\s*\n)+/g, '\n'); - }); - chunks = input.split(/^(?=\n)/mg); - } else { - chunks = [input]; - } - inputLength = input.length; - - // Start with the primary rule. - // The whole syntax tree is held under a Ruleset node, - // with the `root` property set to true, so no `{}` are - // output. The callback is called when the input is parsed. - root = new(tree.Ruleset)([], $(this.parsers.primary)); - root.root = true; - - root.toCSS = (function (toCSS) { - var line, lines, column; - - return function (options) { - options = options || {}; - try { - var css = toCSS.call(this, [], { - frames: [], - compress: options.compress || false - }); - if (options.compress) { - return css.replace(/(\s)+/g, "$1"); - } else { - return css; - } - } catch (e) { - lines = input.split('\n'); - line = getLine(e.index); - - for (var n = e.index, column = -1; - n >= 0 && input.charAt(n) !== '\n'; - n--) { column++ } - - throw { - name: "NameError", - message: e.message, - filename: env.filename, - index: e.index, - line: line + 1, - callLine: e.call && (getLine(e.call) + 1), - callExtract: lines[getLine(e.call) - 1], - stack: e.stack, - column: column, - extract: [ - lines[line - 1], - lines[line], - lines[line + 1] - ] - }; - } - - function getLine(index) { - return (input.slice(0, index).match(/\n/g) || "").length; - } - }; - })(root.toCSS); - - // If `i` is smaller than the `input.length - 1`, - // it means the parser wasn't able to parse the whole - // string, so we've got a parsing error. - // - // We try to extract a \n delimited string, - // showing the line where the parse error occured. - // We split it up into two parts (the part which parsed, - // and the part which didn't), so we can color them differently. - if (i < input.length - 1) { - i = furthest; - lines = input.split('\n'); - line = (input.slice(0, i).match(/\n/g) || "").length + 1; - - for (var n = i, column = -1; n >= 0 && input.charAt(n) !== '\n'; n--) { column++ } - - error = { - name: "ParseError", - message: "Syntax Error on line " + line, - filename: env.filename, - line: line, - column: column, - extract: [ - lines[line - 2], - lines[line - 1], - lines[line] - ] - }; - } - - if (this.imports.queue.length > 0) { - finish = function () { callback(error, root) }; - } else { - callback(error, root); - } - }, - - // - // Here in, the parsing rules/functions - // - // The basic structure of the syntax tree generated is as follows: - // - // Ruleset -> Rule -> Value -> Expression -> Entity - // - // Here's some LESS code: - // - // .class { - // color: #fff; - // border: 1px solid #000; - // width: @w + 4px; - // > .child {...} - // } - // - // And here's what the parse tree might look like: - // - // Ruleset (Selector '.class', [ - // Rule ("color", Value ([Expression [Color #fff]])) - // Rule ("border", Value ([Expression [Dimension 1px][Keyword "solid"][Color #000]])) - // Rule ("width", Value ([Expression [Operation "+" [Variable "@w"][Dimension 4px]]])) - // Ruleset (Selector [Element '>', '.child'], [...]) - // ]) - // - // In general, most rules will try to parse a token with the `$()` function, and if the return - // value is truly, will return a new node, of the relevant type. Sometimes, we need to check - // first, before parsing, that's when we use `peek()`. - // - parsers: { - // - // The `primary` rule is the *entry* and *exit* point of the parser. - // The rules here can appear at any level of the parse tree. - // - // The recursive nature of the grammar is an interplay between the `block` - // rule, which represents `{ ... }`, the `ruleset` rule, and this `primary` rule, - // as represented by this simplified grammar: - // - // primary → (ruleset | rule)+ - // ruleset → selector+ block - // block → '{' primary '}' - // - // Only at one point is the primary rule not called from the - // block rule: at the root level. - // - primary: function () { - var node, root = []; - - while (node = $(this.mixin.definition) || $(this.rule) || $(this.ruleset) || - $(this.mixin.call) || $(this.comment) || - $(/[\n\s]+/g) || $(this.directive)) { - root.push(node); - } - return root; - }, - - // We create a Comment node for CSS comments `/* */`, - // but keep the LeSS comments `//` silent, by just skipping - // over them. - comment: function () { - var comment; - - if (input.charAt(i) !== '/') return; - - if (input.charAt(i + 1) === '/') { - return new(tree.Comment)($(/\/\/.*/g), true); - } else if (comment = $(/\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/g)) { - return new(tree.Comment)(comment); - } - }, - - // - // Entities are tokens which can be found inside an Expression - // - entities: { - // - // A string, which supports escaping " and ' - // - // "milky way" 'he\'s the one!' - // - quoted: function () { - var str; - if (input.charAt(i) !== '"' && input.charAt(i) !== "'") return; - - if (str = $(/"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/g)) { - return new(tree.Quoted)(str[0], str[1] || str[2]); - } - }, - - // - // A catch-all word, such as: - // - // black border-collapse - // - keyword: function () { - var k; - if (k = $(/[A-Za-z-]+/g)) { return new(tree.Keyword)(k) } - }, - - // - // A function call - // - // rgb(255, 0, 255) - // - // We also try to catch IE's `alpha()`, but let the `alpha` parser - // deal with the details. - // - // The arguments are parsed with the `entities.arguments` parser. - // - call: function () { - var name, args; - - if (! (name = $(/([\w-]+|%)\(/g))) return; - - if (name[1].toLowerCase() === 'alpha') { return $(this.alpha) } - - args = $(this.entities.arguments); - - if (! $(')')) return; - - if (name) { return new(tree.Call)(name[1], args) } - }, - arguments: function () { - var args = [], arg; - - while (arg = $(this.expression)) { - args.push(arg); - if (! $(',')) { break } - } - return args; - }, - literal: function () { - return $(this.entities.dimension) || - $(this.entities.color) || - $(this.entities.quoted); - }, - - // - // Parse url() tokens - // - // We use a specific rule for urls, because they don't really behave like - // standard function calls. The difference is that the argument doesn't have - // to be enclosed within a string, so it can't be parsed as an Expression. - // - url: function () { - var value; - - if (input.charAt(i) !== 'u' || !$(/url\(/g)) return; - value = $(this.entities.quoted) || $(/[-\w%@$\/.&=:;#+?]+/g); - if (! $(')')) throw new(Error)("missing closing ) for url()"); - - return new(tree.URL)(value.value ? value : new(tree.Anonymous)(value)); - }, - - // - // A Variable entity, such as `@fink`, in - // - // width: @fink + 2px - // - // We use a different parser for variable definitions, - // see `parsers.variable`. - // - variable: function () { - var name, index = i; - - if (input.charAt(i) === '@' && (name = $(/@[\w-]+/g))) { - return new(tree.Variable)(name, index); - } - }, - - // - // A Hexadecimal color - // - // #4F3C2F - // - // `rgb` and `hsl` colors are parsed through the `entities.call` parser. - // - color: function () { - var rgb; - - if (input.charAt(i) === '#' && (rgb = $(/#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/g))) { - return new(tree.Color)(rgb[1]); - } - }, - - // - // A Dimension, that is, a number and a unit - // - // 0.5em 95% - // - dimension: function () { - var value, c = input.charCodeAt(i); - if ((c > 57 || c < 45) || c === 47) return; - - if (value = $(/(-?\d*\.?\d+)(px|%|em|pc|ex|in|deg|s|ms|pt|cm|mm)?/g)) { - return new(tree.Dimension)(value[1], value[2]); - } - } - }, - - // - // The variable part of a variable definition. Used in the `rule` parser - // - // @fink: - // - variable: function () { - var name; - - if (input.charAt(i) === '@' && (name = $(/(@[\w-]+)\s*:/g))) { return name[1] } - }, - - // - // A font size/line-height shorthand - // - // small/12px - // - // We need to peek first, or we'll match on keywords and dimensions - // - shorthand: function () { - var a, b; - - if (! peek(/[@\w.-]+\/[@\w.-]+/g)) return; - - if ((a = $(this.entity)) && $('/') && (b = $(this.entity))) { - return new(tree.Shorthand)(a, b); - } - }, - - // - // Mixins - // - mixin: { - // - // A Mixin call, with an optional argument list - // - // #mixins > .square(#fff); - // .rounded(4px, black); - // .button; - // - // The `while` loop is there because mixins can be - // namespaced, but we only support the child and descendant - // selector for now. - // - call: function () { - var elements = [], e, c, args, index = i; - - while (e = $(/[#.][\w-]+/g)) { - elements.push(new(tree.Element)(c, e)); - c = $('>'); - } - $('(') && (args = $(this.entities.arguments)) && $(')'); - - if (elements.length > 0 && ($(';') || peek('}'))) { - return new(tree.mixin.Call)(elements, args, index); - } - }, - - // - // A Mixin definition, with a list of parameters - // - // .rounded (@radius: 2px, @color) { - // ... - // } - // - // Until we have a finer grained state-machine, we have to - // do a look-ahead, to make sure we don't have a mixin call. - // See the `rule` function for more information. - // - // We start by matching `.rounded (`, and then proceed on to - // the argument list, which has optional default values. - // We store the parameters in `params`, with a `value` key, - // if there is a value, such as in the case of `@radius`. - // - // Once we've got our params list, and a closing `)`, we parse - // the `{...}` block. - // - definition: function () { - var name, params = [], match, ruleset, param, value; - - if (input.charAt(i) !== '.' || peek(/[^{]*(;|})/g)) return; - - if (match = $(/([#.][\w-]+)\s*\(/g)) { - name = match[1]; - - while (param = $(/@[\w-]+/g) || $(this.entities.literal) - || $(this.entities.keyword)) { - // Variable - if (param[0] === '@') { - if ($(':')) { - if (value = $(this.expression)) { - params.push({ name: param, value: value }); - } else { - throw new(Error)("Expected value"); - } - } else { - params.push({ name: param }); - } - } else { - params.push({ value: param }); - } - if (! $(',')) { break } - } - if (! $(')')) throw new(Error)("Expected )"); - - ruleset = $(this.block); - - if (ruleset) { - return new(tree.mixin.Definition)(name, params, ruleset); - } - } - } - }, - - // - // Entities are the smallest recognized token, - // and can be found inside a rule's value. - // - entity: function () { - return $(this.entities.literal) || $(this.entities.variable) || $(this.entities.url) || - $(this.entities.call) || $(this.entities.keyword); - }, - - // - // A Rule terminator. Note that we use `peek()` to check for '}', - // because the `block` rule will be expecting it, but we still need to make sure - // it's there, if ';' was ommitted. - // - end: function () { - return $(';') || peek('}'); - }, - - // - // IE's alpha function - // - // alpha(opacity=88) - // - alpha: function () { - var value; - - if (! $(/opacity=/gi)) return; - if (value = $(/\d+/g) || $(this.entities.variable)) { - if (! $(')')) throw new(Error)("missing closing ) for alpha()"); - return new(tree.Alpha)(value); - } - }, - - // - // A Selector Element - // - // div - // + h1 - // #socks - // input[type="text"] - // - // Elements are the building blocks for Selectors, - // they are made out of a `Combinator` (see combinator rule), - // and an element name, such as a tag a class, or `*`. - // - element: function () { - var e, t; - - c = $(this.combinator); - e = $(/[.#:]?[\w-]+/g) || $('*') || $(this.attribute) || $(/\([^)@]+\)/g); - - if (e) { return new(tree.Element)(c, e) } - }, - - // - // Combinators combine elements together, in a Selector. - // - // Because our parser isn't white-space sensitive, special care - // has to be taken, when parsing the descendant combinator, ` `, - // as it's an empty space. We have to check the previous character - // in the input, to see if it's a ` ` character. More info on how - // we deal with this in *combinator.js*. - // - combinator: function () { - var match; - if (match = $(/[+>~]/g) || $('&') || $(/::/g)) { - return new(tree.Combinator)(match); - } else { - return new(tree.Combinator)(input.charAt(i - 1) === " " ? " " : null); - } - }, - - // - // A CSS Selector - // - // .class > div + h1 - // li a:hover - // - // Selectors are made out of one or more Elements, see above. - // - selector: function () { - var sel, e, elements = [], match; - - while (e = $(this.element)) { elements.push(e) } - - if (elements.length > 0) { return new(tree.Selector)(elements) } - }, - tag: function () { - return $(/[a-zA-Z][a-zA-Z-]*[0-9]?/g) || $('*'); - }, - attribute: function () { - var attr = '', key, val, op; - - if (! $('[')) return; - - if (key = $(/[a-z-]+/g) || $(this.entities.quoted)) { - if ((op = $(/[|~*$^]?=/g)) && - (val = $(this.entities.quoted) || $(/[\w-]+/g))) { - attr = [key, op, val.toCSS ? val.toCSS() : val].join(''); - } else { attr = key } - } - - if (! $(']')) return; - - if (attr) { return "[" + attr + "]" } - }, - - // - // The `block` rule is used by `ruleset` and `mixin.definition`. - // It's a wrapper around the `primary` rule, with added `{}`. - // - block: function () { - var content; - - if ($('{') && (content = $(this.primary)) && $('}')) { - return content; - } - }, - - // - // div, .class, body > p {...} - // - ruleset: function () { - var selectors = [], s, rules, match, memo = i; - - if (match = peek(/([.#: \w-]+)[\s\n]*\{/g)) { - i += match[0].length - 1; - selectors = [new(tree.Selector)([new(tree.Element)(null, match[1])])]; - } else { - while (s = $(this.selector)) { - selectors.push(s); - if (! $(',')) { break } - } - if (s) $(this.comment); - } - - if (selectors.length > 0 && (rules = $(this.block))) { - return new(tree.Ruleset)(selectors, rules); - } else { - // Backtrack - furthest = i; - i = memo; - } - }, - rule: function () { - var value; - var memo = i; - - if (name = $(this.property) || $(this.variable)) { - if ((name.charAt(0) != '@') && (match = peek(/([^@+\/*(;{}-]*);/g))) { - i += match[0].length - 1; - value = new(tree.Anonymous)(match[1]); - } else if (name === "font") { - value = $(this.font); - } else { - value = $(this.value); - } - - if ($(this.end)) { - return new(tree.Rule)(name, value, memo); - } else { - furthest = i; - i = memo; - } - } - }, - - // - // An @import directive - // - // @import "lib"; - // - // Depending on our environemnt, importing is done differently: - // In the browser, it's an XHR request, in Node, it would be a - // file-system operation. The function used for importing is - // stored in `import`, which we pass to the Import constructor. - // - "import": function () { - var path; - if ($(/@import\s+/g) && - (path = $(this.entities.quoted) || $(this.entities.url)) && - $(';')) { - return new(tree.Import)(path, imports); - } - }, - - // - // A CSS Directive - // - // @charset "utf-8"; - // - directive: function () { - var name, value, rules, types; - - if (input.charAt(i) !== '@') return; - - if (value = $(this['import'])) { - return value; - } else if (name = $(/@media|@page/g)) { - types = $(/[^{]+/g).trim(); - if (rules = $(this.block)) { - return new(tree.Directive)(name + " " + types, rules); - } - } else if (name = $(/@[-a-z]+/g)) { - if (name === '@font-face') { - if (rules = $(this.block)) { - return new(tree.Directive)(name, rules); - } - } else if ((value = $(this.entity)) && $(';')) { - return new(tree.Directive)(name, value); - } - } - }, - font: function () { - var value = [], expression = [], weight, shorthand, font, e; - - while (e = $(this.shorthand) || $(this.entity)) { - expression.push(e); - } - value.push(new(tree.Expression)(expression)); - - if ($(',')) { - while (e = $(this.expression)) { - value.push(e); - if (! $(',')) { break } - } - } - return new(tree.Value)(value, $(this.important)); - }, - - // - // A Value is a comma-delimited list of Expressions - // - // font-family: Baskerville, Georgia, serif; - // - // In a Rule, a Value represents everything after the `:`, - // and before the `;`. - // - value: function () { - var e, expressions = [], important; - - while (e = $(this.expression)) { - expressions.push(e); - if (! $(',')) { break } - } - important = $(this.important); - - if (expressions.length > 0) { - return new(tree.Value)(expressions, important); - } - }, - important: function () { - return $(/!\s*important/g); - }, - sub: function () { - var e; - - if ($('(') && (e = $(this.expression)) && $(')')) { - return e; - } - }, - multiplication: function () { - var m, a, op, operation; - if (m = $(this.operand)) { - while ((op = $(/[\/*]/g)) && (a = $(this.operand))) { - operation = new(tree.Operation)(op, [operation || m, a]); - } - return operation || m; - } - }, - addition: function () { - var m, a, op, operation; - if (m = $(this.multiplication)) { - while ((op = $(/[-+]\s+/g) || (input.charAt(i - 1) != ' ' && $(/[-+]/g))) && - (a = $(this.multiplication))) { - operation = new(tree.Operation)(op, [operation || m, a]); - } - return operation || m; - } - }, - - // - // An operand is anything that can be part of an operation, - // such as a Color, or a Variable - // - operand: function () { - return $(this.sub) || $(this.entities.dimension) || - $(this.entities.color) || $(this.entities.variable); - }, - - // - // Expressions either represent mathematical operations, - // or white-space delimited Entities. - // - // 1px solid black - // @var * 2 - // - expression: function () { - var e, delim, entities = [], d; - - while (e = $(this.addition) || $(this.entity)) { - entities.push(e); - } - if (entities.length > 0) { - return new(tree.Expression)(entities); - } - }, - property: function () { - var name; - - if (name = $(/(\*?-?[-a-z_0-9]+)\s*:/g)) { - return name[1]; - } - } - } - }; -}; - -if (typeof(window) !== 'undefined') { - // - // Used by `@import` directives - // - less.Parser.importer = function (path, paths, callback) { - if (path[0] !== '/' && paths.length > 0) { - path = paths[0] + path; - } - loadStyleSheet({ href: path, title: path }, function (root) { - callback(root); - }); - }; -} - -(function (tree) { - -tree.functions = { - rgb: function (r, g, b) { - return this.rgba(r, g, b, 1.0); - }, - rgba: function (r, g, b, a) { - var rgb = [r, g, b].map(function (c) { return number(c) }), - a = number(a); - return new(tree.Color)(rgb, a); - }, - hsl: function (h, s, l) { - return this.hsla(h, s, l, 1.0); - }, - hsla: function (h, s, l, a) { - h = (number(h) % 360) / 360; - s = number(s); l = number(l); a = number(a); - - var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s; - var m1 = l * 2 - m2; - - return this.rgba(hue(h + 1/3) * 255, - hue(h) * 255, - hue(h - 1/3) * 255, - a); - - function hue(h) { - h = h < 0 ? h + 1 : (h > 1 ? h - 1 : h); - if (h * 6 < 1) return m1 + (m2 - m1) * h * 6; - else if (h * 2 < 1) return m2; - else if (h * 3 < 2) return m1 + (m2 - m1) * (2/3 - h) * 6; - else return m1; - } - }, - hue: function (color) { - return new(tree.Dimension)(Math.round(color.toHSL().h)); - }, - saturation: function (color) { - return new(tree.Dimension)(Math.round(color.toHSL().s * 100), '%'); - }, - lightness: function (color) { - return new(tree.Dimension)(Math.round(color.toHSL().l * 100), '%'); - }, - alpha: function (color) { - return new(tree.Dimension)(color.toHSL().a); - }, - saturate: function (color, amount) { - var hsl = color.toHSL(); - - hsl.s += amount.value / 100; - hsl.s = clamp(hsl.s); - return hsla(hsl); - }, - desaturate: function (color, amount) { - var hsl = color.toHSL(); - - hsl.s -= amount.value / 100; - hsl.s = clamp(hsl.s); - return hsla(hsl); - }, - lighten: function (color, amount) { - var hsl = color.toHSL(); - - hsl.l += amount.value / 100; - hsl.l = clamp(hsl.l); - return hsla(hsl); - }, - darken: function (color, amount) { - var hsl = color.toHSL(); - - hsl.l -= amount.value / 100; - hsl.l = clamp(hsl.l); - return hsla(hsl); - }, - spin: function (color, amount) { - var hsl = color.toHSL(); - var hue = (hsl.h + amount.value) % 360; - - hsl.h = hue < 0 ? 360 + hue : hue; - - return hsla(hsl); - }, - greyscale: function (color) { - return this.desaturate(color, new(tree.Dimension)(100)); - }, - e: function (str) { - return new(tree.Anonymous)(str); - }, - '%': function (quoted /* arg, arg, ...*/) { - var args = Array.prototype.slice.call(arguments, 1), - str = quoted.content; - - for (var i = 0; i < args.length; i++) { - str = str.replace(/%s/, args[i].content) - .replace(/%[da]/, args[i].toCSS()); - } - str = str.replace(/%%/g, '%'); - return new(tree.Quoted)('"' + str + '"', str); - } -}; - -function hsla(hsla) { - return tree.functions.hsla(hsla.h, hsla.s, hsla.l, hsla.a); -} - -function number(n) { - if (n instanceof tree.Dimension) { - return parseFloat(n.unit == '%' ? n.value / 100 : n.value); - } else if (typeof(n) === 'number') { - return n; - } else { - throw { - error: "RuntimeError", - message: "color functions take numbers as parameters" - }; - } -} - -function clamp(val) { - return Math.min(1, Math.max(0, val)); -} - -})(require('less/tree')); -(function (tree) { - -tree.Alpha = function (val) { - this.value = val; -}; -tree.Alpha.prototype = { - toCSS: function () { - return "alpha(opacity=" + this.value.toCSS() + ")"; - }, - eval: function () { return this } -}; - -})(require('less/tree')); -(function (tree) { - -tree.Anonymous = function (string) { - this.value = string.content || string; -}; -tree.Anonymous.prototype = { - toCSS: function () { - return this.value; - }, - eval: function () { return this } -}; - -})(require('less/tree')); -(function (tree) { - -// -// A function call node. -// -tree.Call = function (name, args) { - this.name = name; - this.args = args; -}; -tree.Call.prototype = { - // - // When evaluating a function call, - // we either find the function in `tree.functions` [1], - // in which case we call it, passing the evaluated arguments, - // or we simply print it out as it appeared originally [2]. - // - // The *functions.js* file contains the built-in functions. - // - // The reason why we evaluate the arguments, is in the case where - // we try to pass a variable to a function, like: `saturate(@color)`. - // The function should receive the value, not the variable. - // - eval: function (env) { - var args = this.args.map(function (a) { return a.eval(env) }); - - if (this.name in tree.functions) { // 1. - return tree.functions[this.name].apply(tree.functions, args); - } else { // 2. - return new(tree.Anonymous)(this.name + - "(" + args.map(function (a) { return a.toCSS() }).join(', ') + ")"); - } - }, - - toCSS: function (env) { - return this.eval(env).toCSS(); - } -}; - -})(require('less/tree')); -(function (tree) { -// -// RGB Colors - #ff0014, #eee -// -tree.Color = function (rgb, a) { - // - // The end goal here, is to parse the arguments - // into an integer triplet, such as `128, 255, 0` - // - // This facilitates operations and conversions. - // - if (Array.isArray(rgb)) { - this.rgb = rgb; - } else if (rgb.length == 6) { - this.rgb = rgb.match(/.{2}/g).map(function (c) { - return parseInt(c, 16); - }); - } else { - this.rgb = rgb.split('').map(function (c) { - return parseInt(c + c, 16); - }); - } - this.alpha = typeof(a) === 'number' ? a : 1; -}; -tree.Color.prototype = { - eval: function () { return this }, - - // - // If we have some transparency, the only way to represent it - // is via `rgba`. Otherwise, we use the hex representation, - // which has better compatibility with older browsers. - // Values are capped between `0` and `255`, rounded and zero-padded. - // - toCSS: function () { - if (this.alpha < 1.0) { - return "rgba(" + this.rgb.map(function (c) { - return Math.round(c); - }).concat(this.alpha).join(', ') + ")"; - } else { - return '#' + this.rgb.map(function (i) { - i = Math.round(i); - i = (i > 255 ? 255 : (i < 0 ? 0 : i)).toString(16); - return i.length === 1 ? '0' + i : i; - }).join(''); - } - }, - - // - // Operations have to be done per-channel, if not, - // channels will spill onto each other. Once we have - // our result, in the form of an integer triplet, - // we create a new Color node to hold the result. - // - operate: function (op, other) { - var result = []; - - if (! (other instanceof tree.Color)) { - other = other.toColor(); - } - - for (var c = 0; c < 3; c++) { - result[c] = tree.operate(op, this.rgb[c], other.rgb[c]); - } - return new(tree.Color)(result); - }, - - toHSL: function () { - var r = this.rgb[0] / 255, - g = this.rgb[1] / 255, - b = this.rgb[2] / 255, - a = this.alpha; - - var max = Math.max(r, g, b), min = Math.min(r, g, b); - var h, s, l = (max + min) / 2, d = max - min; - - if (max === min) { - h = s = 0; - } else { - s = l > 0.5 ? d / (2 - max - min) : d / (max + min); - - switch (max) { - case r: h = (g - b) / d + (g < b ? 6 : 0); break; - case g: h = (b - r) / d + 2; break; - case b: h = (r - g) / d + 4; break; - } - h /= 6; - } - return { h: h * 360, s: s, l: l, a: a }; - } -}; - - -})(require('less/tree')); -(function (tree) { - -tree.Comment = function (value, silent) { - this.value = value; - this.silent = !!silent; -}; -tree.Comment.prototype = { - toCSS: function (env) { - return env.compress ? '' : this.value; - }, - eval: function () { return this } -}; - -})(require('less/tree')); -(function (tree) { - -// -// A number with a unit -// -tree.Dimension = function (value, unit) { - this.value = parseFloat(value); - this.unit = unit || null; -}; - -tree.Dimension.prototype = { - eval: function () { return this }, - toColor: function () { - return new(tree.Color)([this.value, this.value, this.value]); - }, - toCSS: function () { - var css = this.value + this.unit; - return css; - }, - - // In an operation between two Dimensions, - // we default to the first Dimension's unit, - // so `1px + 2em` will yield `3px`. - // In the future, we could implement some unit - // conversions such that `100cm + 10mm` would yield - // `101cm`. - operate: function (op, other) { - return new(tree.Dimension) - (tree.operate(op, this.value, other.value), - this.unit || other.unit); - } -}; - -})(require('less/tree')); -(function (tree) { - -tree.Directive = function (name, value) { - this.name = name; - if (Array.isArray(value)) { - this.ruleset = new(tree.Ruleset)([], value); - } else { - this.value = value; - } -}; -tree.Directive.prototype = { - toCSS: function (ctx, env) { - if (this.ruleset) { - this.ruleset.root = true; - return this.name + (env.compress ? '{' : ' {\n ') + - this.ruleset.toCSS(ctx, env).trim().replace(/\n/g, '\n ') + - (env.compress ? '}': '\n}\n'); - } else { - return this.name + ' ' + this.value.toCSS() + ';\n'; - } - }, - eval: function (env) { - env.frames.unshift(this); - this.ruleset && this.ruleset.evalRules(env); - env.frames.shift(); - return this; - }, - variable: function (name) { return tree.Ruleset.prototype.variable.call(this.ruleset, name) }, - find: function () { return tree.Ruleset.prototype.find.apply(this.ruleset, arguments) }, - rulesets: function () { return tree.Ruleset.prototype.rulesets.apply(this.ruleset) } -}; - -})(require('less/tree')); -(function (tree) { - -tree.Element = function (combinator, value) { - this.combinator = combinator instanceof tree.Combinator ? - combinator : new(tree.Combinator)(combinator); - this.value = value.trim(); -}; -tree.Element.prototype.toCSS = function (env) { - return this.combinator.toCSS(env || {}) + this.value; -}; - -tree.Combinator = function (value) { - if (value === ' ') { - this.value = ' '; - } else { - this.value = value ? value.trim() : ""; - } -}; -tree.Combinator.prototype.toCSS = function (env) { - return { - '' : '', - ' ' : ' ', - '&' : '', - ':' : ' :', - '::': '::', - '+' : env.compress ? '+' : ' + ', - '~' : env.compress ? '~' : ' ~ ', - '>' : env.compress ? '>' : ' > ' - }[this.value]; -}; - -})(require('less/tree')); -(function (tree) { - -tree.Expression = function (value) { this.value = value }; -tree.Expression.prototype = { - eval: function (env) { - if (this.value.length > 1) { - return new(tree.Expression)(this.value.map(function (e) { - return e.eval(env); - })); - } else { - return this.value[0].eval(env); - } - }, - toCSS: function () { - return this.value.map(function (e) { - return e.toCSS(); - }).join(' '); - } -}; - -})(require('less/tree')); -(function (tree) { -// -// CSS @import node -// -// The general strategy here is that we don't want to wait -// for the parsing to be completed, before we start importing -// the file. That's because in the context of a browser, -// most of the time will be spent waiting for the server to respond. -// -// On creation, we push the import path to our import queue, though -// `import,push`, we also pass it a callback, which it'll call once -// the file has been fetched, and parsed. -// -tree.Import = function (path, imports) { - var that = this; - - this._path = path; - - // The '.less' extension is optional - if (path instanceof tree.Quoted) { - this.path = /\.(le?|c)ss$/.test(path.content) ? path.content : path.content + '.less'; - } else { - this.path = path.value.content || path.value; - } - - this.css = /css$/.test(this.path); - - // Only pre-compile .less files - if (! this.css) { - imports.push(this.path, function (root) { - if (! root) { - throw new(Error)("Error parsing " + that.path); - } - that.root = root; - }); - } -}; - -// -// The actual import node doesn't return anything, when converted to CSS. -// The reason is that it's used at the evaluation stage, so that the rules -// it imports can be treated like any other rules. -// -// In `eval`, we make sure all Import nodes get evaluated, recursively, so -// we end up with a flat structure, which can easily be imported in the parent -// ruleset. -// -tree.Import.prototype = { - toCSS: function () { - if (this.css) { - return "@import " + this._path.toCSS() + ';\n'; - } else { - return ""; - } - }, - eval: function () { - if (this.css) { - return this; - } else { - for (var i = 0; i < this.root.rules.length; i++) { - if (this.root.rules[i] instanceof tree.Import) { - Array.prototype - .splice - .apply(this.root.rules, - [i, 1].concat(this.root.rules[i].eval())); - } - } - return this.root.rules; - } - } -}; - -})(require('less/tree')); -(function (tree) { - -tree.Keyword = function (value) { this.value = value }; -tree.Keyword.prototype = { - eval: function () { return this }, - toCSS: function () { return this.value } -}; - -})(require('less/tree')); -(function (tree) { - -tree.mixin = {}; -tree.mixin.Call = function (elements, args, index) { - this.selector = new(tree.Selector)(elements); - this.arguments = args; - this.index = index; -}; -tree.mixin.Call.prototype = { - eval: function (env) { - var mixins, rules = [], match = false; - - for (var i = 0; i < env.frames.length; i++) { - if ((mixins = env.frames[i].find(this.selector)).length > 0) { - for (var m = 0; m < mixins.length; m++) { - if (mixins[m].match(this.arguments, env)) { - try { - Array.prototype.push.apply( - rules, mixins[m].eval(this.arguments, env).rules); - match = true; - } catch (e) { - throw { message: e.message, index: e.index, call: this.index }; - } - } - } - if (match) { - return rules; - } else { - throw { message: 'No matching definition was found for `' + - this.selector.toCSS().trim() + '(' + - this.arguments.map(function (a) { - return a.toCSS(); - }).join(', ') + ")`", - index: this.index }; - } - } - } - throw { message: this.selector.toCSS().trim() + " is undefined", - index: this.index }; - } -}; - -tree.mixin.Definition = function (name, params, rules) { - this.name = name; - this.selectors = [new(tree.Selector)([new(tree.Element)(null, name)])]; - this.params = params; - this.arity = params.length; - this.rules = rules; - this._lookups = {}; - this.required = params.reduce(function (count, p) { - if (p.name && !p.value) { return count + 1 } - else { return count } - }, 0); - this.parent = tree.Ruleset.prototype; -}; -tree.mixin.Definition.prototype = { - toCSS: function () { return "" }, - variable: function (name) { return this.parent.variable.call(this, name) }, - find: function () { return this.parent.find.apply(this, arguments) }, - rulesets: function () { return this.parent.rulesets.apply(this) }, - - eval: function (args, env) { - var frame = new(tree.Ruleset)(null, []), context; - - for (var i = 0, val; i < this.params.length; i++) { - if (this.params[i].name) { - if (val = (args && args[i]) || this.params[i].value) { - frame.rules.unshift(new(tree.Rule)(this.params[i].name, val.eval(env))); - } else { - throw { message: "wrong number of arguments for " + this.name + - ' (' + args.length + ' for ' + this.arity + ')' }; - } - } - } - return new(tree.Ruleset)(null, this.rules).evalRules({ - frames: [this, frame].concat(env.frames) - }); - }, - match: function (args, env) { - var argsLength = (args && args.length) || 0; - - if (argsLength < this.required) { - return false; - } - - for (var i = 0; i < Math.min(argsLength, this.arity); i++) { - if (!this.params[i].name) { - if (args[i].wildcard) { continue } - else if (args[i].eval(env).toCSS() != this.params[i].value.eval(env).toCSS()) { - return false; - } - } - } - return true; - } -}; - -})(require('less/tree')); -(function (tree) { - -tree.Operation = function (op, operands) { - this.op = op.trim(); - this.operands = operands; -}; -tree.Operation.prototype.eval = function (env) { - var a = this.operands[0].eval(env), - b = this.operands[1].eval(env), - temp; - - if (a instanceof tree.Dimension && b instanceof tree.Color) { - if (this.op === '*' || this.op === '+') { - temp = b, b = a, a = temp; - } else { - throw { name: "OperationError", - message: "Can't substract or divide a color from a number" }; - } - } - return a.operate(this.op, b); -}; - -tree.operate = function (op, a, b) { - switch (op) { - case '+': return a + b; - case '-': return a - b; - case '*': return a * b; - case '/': return a / b; - } -}; - -})(require('less/tree')); -(function (tree) { - -tree.Quoted = function (value, content) { - this.value = value; - this.content = content; -}; -tree.Quoted.prototype = { - toCSS: function () { - return this.value; - }, - eval: function () { - return this; - } -}; - -})(require('less/tree')); -(function (tree) { - -tree.Rule = function (name, value, index) { - this.name = name; - this.value = (value instanceof tree.Value) ? value : new(tree.Value)([value]); - this.index = index; - - if (name.charAt(0) === '@') { - this.variable = true; - } else { this.variable = false } -}; -tree.Rule.prototype.toCSS = function (env) { - if (this.variable) { return "" } - else { - return this.name + (env.compress ? ':' : ': ') + this.value.toCSS(env) + ";"; - } -}; - -tree.Rule.prototype.eval = function (context) { - return new(tree.Rule)(this.name, this.value.eval(context)); -}; - -tree.Shorthand = function (a, b) { - this.a = a; - this.b = b; -}; - -tree.Shorthand.prototype = { - toCSS: function (env) { - return this.a.toCSS(env) + "/" + this.b.toCSS(env); - }, - eval: function () { return this } -}; - -})(require('less/tree')); -(function (tree) { - -tree.Ruleset = function (selectors, rules) { - this.selectors = selectors; - this.rules = rules; - this._lookups = {}; -}; -tree.Ruleset.prototype = { - eval: function () { return this }, - evalRules: function (context) { - var rules = []; - - this.rules.forEach(function (rule) { - if (rule.evalRules) { - rules.push(rule.evalRules(context)); - } else if (rule instanceof tree.mixin.Call) { - Array.prototype.push.apply(rules, rule.eval(context)); - } else { - rules.push(rule.eval ? rule.eval(context) : ''); - } - }); - this.rules = rules; - return this; - }, - match: function (args) { - return !args || args.length === 0; - }, - variable: function (name) { - if (this._variables) { return this._variables[name] } - else { - return (this._variables = this.rules.reduce(function (hash, r) { - if (r instanceof tree.Rule && r.variable === true) { - hash[r.name] = r; - } - return hash; - }, {}))[name]; - } - }, - rulesets: function () { - if (this._rulesets) { return this._rulesets } - else { - return this._rulesets = this.rules.filter(function (r) { - if (r instanceof tree.Ruleset || r instanceof tree.mixin.Definition) { return r } - }); - } - }, - find: function (selector, self) { - self = self || this; - var rules = [], rule, match, - key = selector.toCSS(); - - if (key in this._lookups) { return this._lookups[key] } - - this.rulesets().forEach(function (rule) { - if (rule !== self) { - for (var j = 0; j < rule.selectors.length; j++) { - if (match = selector.match(rule.selectors[j])) { - if (selector.elements.length > 1) { - Array.prototype.push.apply(rules, rule.find( - new(tree.Selector)(selector.elements.slice(1)), self)); - } else { - rules.push(rule); - } - break; - } - } - } - }); - return this._lookups[key] = rules; - }, - // - // Entry point for code generation - // - // `context` holds an array of arrays. - // - toCSS: function (context, env) { - var css = [], // The CSS output - rules = [], // node.Rule instances - rulesets = [], // node.Ruleset instances - paths = [], // Current selectors - selector, // The fully rendered selector - rule; - - if (! this.root) { - if (context.length === 0) { - paths = this.selectors.map(function (s) { return [s] }); - } else { - for (var s = 0; s < this.selectors.length; s++) { - for (var c = 0; c < context.length; c++) { - paths.push(context[c].concat([this.selectors[s]])); - } - } - } - } else { - for (var i = 0; i < this.rules.length; i++) { - if (this.rules[i] instanceof tree.Import) { - Array.prototype.splice - .apply(this.rules, [i, 1].concat(this.rules[i].eval(env))); - } - } - } - - // push the current ruleset to the frames stack - env.frames.unshift(this); - - // Evaluate mixins - for (var i = 0; i < this.rules.length; i++) { - if (this.rules[i] instanceof tree.mixin.Call) { - Array.prototype.splice - .apply(this.rules, [i, 1].concat(this.rules[i].eval(env))); - } - } - - // Evaluate rules and rulesets - for (var i = 0; i < this.rules.length; i++) { - rule = this.rules[i]; - - if (rule instanceof tree.Directive) { - rulesets.push(rule.eval(env).toCSS(paths, env)); - } else if (rule.rules) { - rulesets.push(rule.toCSS(paths, env)); - } else if (rule instanceof tree.Comment) { - if (!rule.silent) { - if (this.root) { - rulesets.push(rule.toCSS(env)); - } else { - rules.push(rule.toCSS(env)); - } - } - } else { - if (rule.toCSS && !rule.variable) { - rules.push(rule.eval(env).toCSS(env)); - } else if (rule.value && !rule.variable) { - rules.push(rule.value.toString()); - } - } - } - - rulesets = rulesets.join(''); - - // If this is the root node, we don't render - // a selector, or {}. - // Otherwise, only output if this ruleset has rules. - if (this.root) { - css.push(rules.join(env.compress ? '' : '\n')); - } else { - if (rules.length > 0) { - selector = paths.map(function (p) { - return p.map(function (s) { - return s.toCSS(env); - }).join('').trim(); - }).join(env.compress ? ',' : (paths.length > 3 ? ',\n' : ', ')); - css.push(selector, - (env.compress ? '{' : ' {\n ') + - rules.join(env.compress ? '' : '\n ') + - (env.compress ? '}' : '\n}\n')); - } - } - css.push(rulesets); - - // Pop the stack - env.frames.shift(); - - return css.join('') + (env.compress ? '\n' : ''); - } -}; -})(require('less/tree')); -(function (tree) { - -tree.Selector = function (elements) { - this.elements = elements; - if (this.elements[0].combinator.value === "") { - this.elements[0].combinator.value = ' '; - } -}; -tree.Selector.prototype.match = function (other) { - if (this.elements[0].value === other.elements[0].value) { - return true; - } else { - return false; - } -}; -tree.Selector.prototype.toCSS = function (env) { - if (this._css) { return this._css } - - return this._css = this.elements.map(function (e) { - if (typeof(e) === 'string') { - return ' ' + e.trim(); - } else { - return e.toCSS(env); - } - }).join(''); -}; - -})(require('less/tree')); -(function (tree) { - -tree.URL = function (val) { - this.value = val; -}; -tree.URL.prototype = { - toCSS: function () { - return "url(" + this.value.toCSS() + ")"; - }, - eval: function () { return this } -}; - -})(require('less/tree')); -(function (tree) { - -tree.Value = function (value) { - this.value = value; - this.is = 'value'; -}; -tree.Value.prototype = { - eval: function (env) { - if (this.value.length === 1) { - return this.value[0].eval(env); - } else { - return new(tree.Value)(this.value.map(function (v) { - return v.eval(env); - })); - } - }, - toCSS: function (env) { - return this.value.map(function (e) { - return e.toCSS(env); - }).join(env.compress ? ',' : ', '); - } -}; - -})(require('less/tree')); -(function (tree) { - -tree.Variable = function (name, index) { this.name = name, this.index = index }; -tree.Variable.prototype = { - eval: function (env) { - var variable, v, name = this.name; - - if (variable = tree.find(env.frames, function (frame) { - if (v = frame.variable(name)) { - return v.value.eval(env); - } - })) { return variable } - else { - throw { message: "variable " + this.name + " is undefined", - index: this.index }; - } - } -}; - -})(require('less/tree')); -require('less/tree').find = function (obj, fun) { - for (var i = 0, r; i < obj.length; i++) { - if (r = fun.call(obj, obj[i])) { return r } - } - return null; -}; -// -// browser.js - client-side engine -// - -var isFileProtocol = location.protocol === 'file:'; - -less.env = location.hostname == '127.0.0.1' || - location.hostname == '0.0.0.0' || - location.hostname == 'localhost' || - location.port.length > 0 || - isFileProtocol ? 'development' - : 'production'; - -// Load styles asynchronously (default: false) -// -// This is set to `false` by default, so that the body -// doesn't start loading before the stylesheets are parsed. -// Setting this to `true` can result in flickering. -// -less.async = false; - -// Interval between watch polls -less.poll = isFileProtocol ? 1000 : 1500; - -// -// Watch mode -// -less.watch = function () { return this.watchMode = true }; -less.unwatch = function () { return this.watchMode = false }; - -if (less.env === 'development') { - less.optimization = 0; - - if (/!watch/.test(location.hash)) { - less.watch(); - } - less.watchTimer = setInterval(function () { - if (less.watchMode) { - loadStyleSheets(function (root, sheet, env) { - if (root) { - createCSS(root.toCSS(), sheet, env.lastModified); - } - }); - } - }, less.poll); -} else { - less.optimization = 3; -} - -var cache = (typeof(window.localStorage) === 'undefined') ? null : window.localStorage; - -// -// Select all links with the 'rel' attribute set to "less" -// -var sheets = select('link[rel="stylesheet/less"]'); - -var startTime = endTime = new(Date); - -less.refresh = function (reload) { - loadStyleSheets(function (root, sheet, env) { - if (env.local) { - log("loading " + sheet.href + " from cache."); - } else { - log("parsed " + sheet.href + " successfully."); - createCSS(root.toCSS(), sheet, env.lastModified); - } - log("css for " + sheet.href + " generated in " + (new(Date) - endTime) + 'ms'); - (env.remaining === 0) && log("css generated in " + (new(Date) - startTime) + 'ms'); - endTime = new(Date); - }, reload); -}; - -less.refresh(); - -function select(str) { - if (!document.querySelectorAll && typeof(jQuery) === "undefined") { - log("no selector method found."); - } else { - return (document.querySelectorAll || jQuery).call(document, str); - } -} - -function loadStyleSheets(callback, reload) { - for (var i = 0; i < sheets.length; i++) { - loadStyleSheet(sheets[i], callback, reload, sheets.length - (i + 1)); - } -} - -function loadStyleSheet(sheet, callback, reload, remaining) { - var href = sheet.href.replace(/\?.*$/, ''); - var css = cache && cache.getItem(href); - var timestamp = cache && cache.getItem(href + ':timestamp'); - var styles = { css: css, timestamp: timestamp }; - - xhr(sheet.href, function (data, lastModified) { - if (!reload && styles && - (new(Date)(lastModified).valueOf() === - new(Date)(styles.timestamp).valueOf())) { - // Use local copy - createCSS(styles.css, sheet); - callback(null, sheet, { local: true, remaining: remaining }); - } else { - // Use remote copy (re-parse) - new(less.Parser)({ - optimization: less.optimization, - paths: [href.replace(/[\w\.-]+$/, '')] - }).parse(data, function (e, root) { - if (e) { return error(e, href) } - try { - callback(root, sheet, { local: false, lastModified: lastModified, remaining: remaining }); - removeNode(document.getElementById('less-error-message:' + href.replace(/[^a-z]+/gi, '-'))); - } catch (e) { - error(e, href); - } - }); - } - }, function (status, url) { - throw new(Error)("Couldn't load " + url+ " (" + status + ")"); - }); -} - -function createCSS(styles, sheet, lastModified) { - var css; - - // Strip the query-string - var href = sheet.href ? sheet.href.replace(/\?.*$/, '') : ''; - - // If there is no title set, use the filename, minus the extension - var id = 'less:' + (sheet.title || href.match(/(?:^|\/)([-\w]+)\.[a-z]+$/i)[1]); - - // If the stylesheet doesn't exist, create a new node - if ((css = document.getElementById(id)) === null) { - css = document.createElement('style'); - css.type = 'text/css'; - css.media = 'screen'; - css.id = id; - document.getElementsByTagName('head')[0].appendChild(css); - } - - if (css.styleSheet) { // IE - try { - css.styleSheet.cssText = styles; - } catch (e) { - throw new(Error)("Couldn't reassign styleSheet.cssText."); - } - } else { - (function (node) { - if (css.childNodes.length > 0) { - if (css.firstChild.nodeValue !== node.nodeValue) { - css.replaceChild(node, css.firstChild); - } - } else { - css.appendChild(node); - } - })(document.createTextNode(styles)); - } - - // Don't update the local store if the file wasn't modified - if (lastModified && cache) { - log('saving ' + href + ' to cache.'); - cache.setItem(href, styles); - cache.setItem(href + ':timestamp', lastModified); - } -} - -function xhr(url, callback, errback) { - var xhr = getXMLHttpRequest(); - var async = isFileProtocol ? false : less.async; - - xhr.open('GET', url, async); - xhr.send(null); - - if (isFileProtocol) { - if (xhr.status === 0) { - callback(xhr.responseText); - } else { - errback(xhr.status); - } - } else if (async) { - xhr.onreadystatechange = function () { - if (xhr.readyState == 4) { - handleResponse(xhr, callback, errback); - } - }; - } else { - handleResponse(xhr, callback, errback); - } - - function handleResponse(xhr, callback, errback) { - if (xhr.status >= 200 && xhr.status < 300) { - callback(xhr.responseText, - xhr.getResponseHeader("Last-Modified")); - } else if (typeof(errback) === 'function') { - errback(xhr.status, url); - } - } -} - -function getXMLHttpRequest() { - if (window.XMLHttpRequest) { - return new(XMLHttpRequest); - } else { - try { - return new(ActiveXObject)("MSXML2.XMLHTTP.3.0"); - } catch (e) { - log("browser doesn't support AJAX."); - return null; - } - } -} - -function removeNode(node) { - return node && node.parentNode.removeChild(node); -} - -function log(str) { - if (less.env == 'development' && typeof(console) !== "undefined") { console.log('less: ' + str) } -} - -function error(e, href) { - var id = 'less-error-message:' + href.replace(/[^a-z]+/ig, '-'); - - if (! e.extract) { throw e } - - var template = ['
    ', - '
    [-1]{0}
    ', - '
    [0]{current}
    ', - '
    [1]{2}
    ', - '
    '].join('\n'); - - var elem = document.createElement('div'), timer; - elem.id = id; - elem.className = "less-error-message"; - elem.innerHTML = '

    ' + (e.message || 'There is an error in your .less file') + '

    ' + - '

    ' + href + " " + - 'on line ' + e.line + ', column ' + (e.column + 1) + ':

    ' + - template.replace(/\[(-?\d)\]/g, function (_, i) { - return (parseInt(e.line) + parseInt(i)) || ''; - }).replace(/\{(\d)\}/g, function (_, i) { - return e.extract[parseInt(i)] || ''; - }).replace(/\{current\}/, e.extract[1].slice(0, e.column) + - '' + - e.extract[1].slice(e.column) + - ''); - // CSS for error messages - createCSS([ - '.less-error-message span {', - 'margin-right: 15px;', - '}', - '.less-error-message pre {', - 'color: #ee4444;', - 'padding: 4px 0;', - 'margin: 0;', - '}', - '.less-error-message pre.ctx {', - 'color: #dd7777;', - '}', - '.less-error-message h3 {', - 'padding: 15px 0 5px 0;', - 'margin: 0;', - '}', - '.less-error-message a {', - 'color: #10a', - '}', - '.less-error-message .error {', - 'color: red;', - 'font-weight: bold;', - 'padding-bottom: 2px;', - 'border-bottom: 1px dashed red;', - '}' - ].join('\n'), { title: 'error-message' }); - - elem.style.cssText = [ - "font-family: Arial, sans-serif", - "border: 1px solid #e00", - "background-color: #eee", - "border-radius: 5px", - "-webkit-border-radius: 5px", - "-moz-border-radius: 5px", - "color: #e00", - "padding: 15px", - "margin-bottom: 15px" - ].join(';'); - - if (less.env == 'development') { - timer = setInterval(function () { - if (document.body) { - if (document.getElementById(id)) { - document.body.replaceChild(elem, document.getElementById(id)); - } else { - document.body.insertBefore(elem, document.body.firstChild); - } - clearInterval(timer); - } - }, 10); - } -} - -})(window); diff --git a/deps/.npm/connect/0.2.5/package/support/less/dist/less-1.0.21.min.js b/deps/.npm/connect/0.2.5/package/support/less/dist/less-1.0.21.min.js deleted file mode 100644 index fd14e69c..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/dist/less-1.0.21.min.js +++ /dev/null @@ -1,60 +0,0 @@ -// -// LESS - Leaner CSS v1.0.21 -// http://lesscss.org -// -// Copyright (c) 2010, Alexis Sellier -// Licensed under the Apache 2.0 License. -// -(function(u){function q(b){return u.less[b.split("/")[1]]}function O(b){if(!document.querySelectorAll&&typeof jQuery==="undefined")x("no selector method found.");else return(document.querySelectorAll||jQuery).call(document,b)}function K(b,a){for(var d=0;d0)f.firstChild.nodeValue!==j.nodeValue&&f.replaceChild(j,f.firstChild);else f.appendChild(j)})(document.createTextNode(b));if(d&&y){x("saving "+e+" to cache.");y.setItem(e,b);y.setItem(e+ -":timestamp",d)}}function P(b,a,d){function f(j,k,o){if(j.status>=200&&j.status<300)k(j.responseText,j.getResponseHeader("Last-Modified"));else typeof o==="function"&&o(j.status,b)}var e=R(),i=F?false:p.async;e.open("GET",b,i);e.send(null);if(F)e.status===0?a(e.responseText):d(e.status);else if(i)e.onreadystatechange=function(){e.readyState==4&&f(e,a,d)};else f(e,a,d)}function R(){if(u.XMLHttpRequest)return new XMLHttpRequest;else try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(b){x("browser doesn't support AJAX."); -return null}}function Q(b){return b&&b.parentNode.removeChild(b)}function x(b){p.env=="development"&&typeof console!=="undefined"&&console.log("less: "+b)}function M(b,a){var d="less-error-message:"+a.replace(/[^a-z]+/ig,"-");if(!b.extract)throw b;var f=document.createElement("div"),e;f.id=d;f.className="less-error-message";f.innerHTML="

    "+(b.message||"There is an error in your .less file")+'

    '+a+" on line "+b.line+", column "+(b.column+1)+":

    "+'
    \n
    [-1]{0}
    \n
    [0]{current}
    \n
    [1]{2}
    \n
    '.replace(/\[(-?\d)\]/g, -function(i,j){return parseInt(b.line)+parseInt(j)||""}).replace(/\{(\d)\}/g,function(i,j){return b.extract[parseInt(j)]||""}).replace(/\{current\}/,b.extract[1].slice(0,b.column)+''+b.extract[1].slice(b.column)+"");D(".less-error-message span {\nmargin-right: 15px;\n}\n.less-error-message pre {\ncolor: #ee4444;\npadding: 4px 0;\nmargin: 0;\n}\n.less-error-message pre.ctx {\ncolor: #dd7777;\n}\n.less-error-message h3 {\npadding: 15px 0 5px 0;\nmargin: 0;\n}\n.less-error-message a {\ncolor: #10a\n}\n.less-error-message .error {\ncolor: red;\nfont-weight: bold;\npadding-bottom: 2px;\nborder-bottom: 1px dashed red;\n}", -{title:"error-message"});f.style.cssText="font-family: Arial, sans-serif;border: 1px solid #e00;background-color: #eee;border-radius: 5px;-webkit-border-radius: 5px;-moz-border-radius: 5px;color: #e00;padding: 15px;margin-bottom: 15px";if(p.env=="development")e=setInterval(function(){if(document.body){document.getElementById(d)?document.body.replaceChild(f,document.getElementById(d)):document.body.insertBefore(f,document.body.firstChild);clearInterval(e)}},10)}if(!Array.isArray)Array.isArray=function(b){return Object.prototype.toString.call(b)=== -"[object Array]"||b instanceof Array};if(!Array.prototype.forEach)Array.prototype.forEach=function(b,a){for(var d=this.length>>>0,f=0;f>>0,f=new Array(d),e=0;e>>0,d=0;if(a===0&&arguments.length===1)throw new TypeError;if(arguments.length>=2)var f=arguments[1];else{do{if(d in this){f=this[d++];break}if(++d>=a)throw new TypeError;}while(1)}for(;d=d)return-1;if(a<0)a+=d;for(;a= -o+k[i].length&&i0){f=f.replace(/\/\*(?:[^*]|\*+[^\/*])*\*+\//g,function(H){return t.optimization>1?"":H.replace(/\n(\s*\n)+/g,"\n")});k=f.split(/^(?=\n)/mg)}else k= -[f];l=new m.Ruleset([],a(this.parsers.primary));l.root=true;l.toCSS=function(H){var A,B;return function(v){function I(S){return(f.slice(0,S).match(/\n/g)||"").length}v=v||{};try{var C=H.call(this,[],{frames:[],compress:v.compress||false});return v.compress?C.replace(/(\s)+/g,"$1"):C}catch(w){B=f.split("\n");A=I(w.index);v=w.index;for(C=-1;v>=0&&f.charAt(v)!=="\n";v--)C++;throw{name:"NameError",message:w.message,filename:b.filename,index:w.index,line:A+1,callLine:w.call&&I(w.call)+1,callExtract:B[I(w.call)- -1],stack:w.stack,column:C,extract:[B[A-1],B[A],B[A+1]]};}}}(l.toCSS);if(e=0&&f.charAt(J)!=="\n";J--)N++;z={name:"ParseError",message:"Syntax Error on line "+g,filename:b.filename,line:g,column:N,extract:[n[g-2],n[g-1],n[g]]}}if(this.imports.queue.length>0)s=function(){h(z,l)};else h(z,l)},parsers:{primary:function(){for(var g,h=[];g=a(this.mixin.definition)||a(this.rule)||a(this.ruleset)||a(this.mixin.call)|| -a(this.comment)||a(/[\n\s]+/g)||a(this.directive);)h.push(g);return h},comment:function(){var g;if(f.charAt(e)==="/")if(f.charAt(e+1)==="/")return new m.Comment(a(/\/\/.*/g),true);else if(g=a(/\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/g))return new m.Comment(g)},entities:{quoted:function(){var g;if(!(f.charAt(e)!=='"'&&f.charAt(e)!=="'"))if(g=a(/"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/g))return new m.Quoted(g[0],g[1]||g[2])},keyword:function(){var g;if(g=a(/[A-Za-z-]+/g))return new m.Keyword(g)},call:function(){var g, -h;if(g=a(/([\w-]+|%)\(/g)){if(g[1].toLowerCase()==="alpha")return a(this.alpha);h=a(this.entities.arguments);if(a(")"))if(g)return new m.Call(g[1],h)}},arguments:function(){for(var g=[],h;h=a(this.expression);){g.push(h);if(!a(","))break}return g},literal:function(){return a(this.entities.dimension)||a(this.entities.color)||a(this.entities.quoted)},url:function(){var g;if(!(f.charAt(e)!=="u"||!a(/url\(/g))){g=a(this.entities.quoted)||a(/[-\w%@$\/.&=:;#+?]+/g);if(!a(")"))throw new Error("missing closing ) for url()"); -return new m.URL(g.value?g:new m.Anonymous(g))}},variable:function(){var g,h=e;if(f.charAt(e)==="@"&&(g=a(/@[\w-]+/g)))return new m.Variable(g,h)},color:function(){var g;if(f.charAt(e)==="#"&&(g=a(/#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/g)))return new m.Color(g[1])},dimension:function(){var g;g=f.charCodeAt(e);if(!(g>57||g<45||g===47))if(g=a(/(-?\d*\.?\d+)(px|%|em|pc|ex|in|deg|s|ms|pt|cm|mm)?/g))return new m.Dimension(g[1],g[2])}},variable:function(){var g;if(f.charAt(e)==="@"&&(g=a(/(@[\w-]+)\s*:/g)))return g[1]}, -shorthand:function(){var g,h;if(d(/[@\w.-]+\/[@\w.-]+/g))if((g=a(this.entity))&&a("/")&&(h=a(this.entity)))return new m.Shorthand(g,h)},mixin:{call:function(){for(var g=[],h,l,n,z=e;h=a(/[#.][\w-]+/g);){g.push(new m.Element(l,h));l=a(">")}a("(")&&(n=a(this.entities.arguments))&&a(")");if(g.length>0&&(a(";")||d("}")))return new m.mixin.Call(g,n,z)},definition:function(){var g,h=[],l,n;if(!(f.charAt(e)!=="."||d(/[^{]*(;|})/g)))if(g=a(/([#.][\w-]+)\s*\(/g)){for(g=g[1];l=a(/@[\w-]+/g)||a(this.entities.literal)|| -a(this.entities.keyword);){if(l[0]==="@")if(a(":"))if(n=a(this.expression))h.push({name:l,value:n});else throw new Error("Expected value");else h.push({name:l});else h.push({value:l});if(!a(","))break}if(!a(")"))throw new Error("Expected )");if(l=a(this.block))return new m.mixin.Definition(g,h,l)}}},entity:function(){return a(this.entities.literal)||a(this.entities.variable)||a(this.entities.url)||a(this.entities.call)||a(this.entities.keyword)},end:function(){return a(";")||d("}")},alpha:function(){var g; -if(a(/opacity=/gi))if(g=a(/\d+/g)||a(this.entities.variable)){if(!a(")"))throw new Error("missing closing ) for alpha()");return new m.Alpha(g)}},element:function(){var g;c=a(this.combinator);if(g=a(/[.#:]?[\w-]+/g)||a("*")||a(this.attribute)||a(/\([^)@]+\)/g))return new m.Element(c,g)},combinator:function(){var g;return(g=a(/[+>~]/g)||a("&")||a(/::/g))?new m.Combinator(g):new m.Combinator(f.charAt(e-1)===" "?" ":null)},selector:function(){for(var g,h=[];g=a(this.element);)h.push(g);if(h.length>0)return new m.Selector(h)}, -tag:function(){return a(/[a-zA-Z][a-zA-Z-]*[0-9]?/g)||a("*")},attribute:function(){var g="",h,l,n;if(a("[")){if(h=a(/[a-z-]+/g)||a(this.entities.quoted))g=(n=a(/[|~*$^]?=/g))&&(l=a(this.entities.quoted)||a(/[\w-]+/g))?[h,n,l.toCSS?l.toCSS():l].join(""):h;if(a("]"))if(g)return"["+g+"]"}},block:function(){var g;if(a("{")&&(g=a(this.primary))&&a("}"))return g},ruleset:function(){var g=[],h,l,n=e;if(h=d(/([.#: \w-]+)[\s\n]*\{/g)){e+=h[0].length-1;g=[new m.Selector([new m.Element(null,h[1])])]}else{for(;h= -a(this.selector);){g.push(h);if(!a(","))break}h&&a(this.comment)}if(g.length>0&&(l=a(this.block)))return new m.Ruleset(g,l);else{j=e;e=n}},rule:function(){var g,h=e;if(name=a(this.property)||a(this.variable)){if(name.charAt(0)!="@"&&(match=d(/([^@+\/*(;{}-]*);/g))){e+=match[0].length-1;g=new m.Anonymous(match[1])}else g=name==="font"?a(this.font):a(this.value);if(a(this.end))return new m.Rule(name,g,h);else{j=e;e=h}}},"import":function(){var g;if(a(/@import\s+/g)&&(g=a(this.entities.quoted)||a(this.entities.url))&& -a(";"))return new m.Import(g,E)},directive:function(){var g,h,l;if(f.charAt(e)==="@")if(h=a(this["import"]))return h;else if(g=a(/@media|@page/g)){l=a(/[^{]+/g).trim();if(h=a(this.block))return new m.Directive(g+" "+l,h)}else if(g=a(/@[-a-z]+/g))if(g==="@font-face"){if(h=a(this.block))return new m.Directive(g,h)}else if((h=a(this.entity))&&a(";"))return new m.Directive(g,h)},font:function(){for(var g=[],h=[],l;l=a(this.shorthand)||a(this.entity);)h.push(l);g.push(new m.Expression(h));if(a(","))for(;l= -a(this.expression);){g.push(l);if(!a(","))break}return new m.Value(g,a(this.important))},value:function(){for(var g,h=[];g=a(this.expression);){h.push(g);if(!a(","))break}g=a(this.important);if(h.length>0)return new m.Value(h,g)},important:function(){return a(/!\s*important/g)},sub:function(){var g;if(a("(")&&(g=a(this.expression))&&a(")"))return g},multiplication:function(){var g,h,l,n;if(g=a(this.operand)){for(;(l=a(/[\/*]/g))&&(h=a(this.operand));)n=new m.Operation(l,[n||g,h]);return n||g}},addition:function(){var g, -h,l,n;if(g=a(this.multiplication)){for(;(l=a(/[-+]\s+/g)||f.charAt(e-1)!=" "&&a(/[-+]/g))&&(h=a(this.multiplication));)n=new m.Operation(l,[n||g,h]);return n||g}},operand:function(){return a(this.sub)||a(this.entities.dimension)||a(this.entities.color)||a(this.entities.variable)},expression:function(){for(var g,h=[];g=a(this.addition)||a(this.entity);)h.push(g);if(h.length>0)return new m.Expression(h)},property:function(){var g;if(g=a(/(\*?-?[-a-z_0-9]+)\s*:/g))return g[1]}}}};if(typeof u!=="undefined")p.Parser.importer= -function(b,a,d){if(b[0]!=="/"&&a.length>0)b=a[0]+b;L({href:b,title:b},function(f){d(f)})};(function(b){function a(e){return b.functions.hsla(e.h,e.s,e.l,e.a)}function d(e){if(e instanceof b.Dimension)return parseFloat(e.unit=="%"?e.value/100:e.value);else if(typeof e==="number")return e;else throw{error:"RuntimeError",message:"color functions take numbers as parameters"};}function f(e){return Math.min(1,Math.max(0,e))}b.functions={rgb:function(e,i,j){return this.rgba(e,i,j,1)},rgba:function(e,i,j, -k){e=[e,i,j].map(function(o){return d(o)});k=d(k);return new b.Color(e,k)},hsl:function(e,i,j){return this.hsla(e,i,j,1)},hsla:function(e,i,j,k){function o(s){s=s<0?s+1:s>1?s-1:s;return s*6<1?t+(r-t)*s*6:s*2<1?r:s*3<2?t+(r-t)*(2/3-s)*6:t}e=d(e)%360/360;i=d(i);j=d(j);k=d(k);var r=j<=0.5?j*(i+1):j+i-j*i,t=j*2-r;return this.rgba(o(e+1/3)*255,o(e)*255,o(e-1/3)*255,k)},hue:function(e){return new b.Dimension(Math.round(e.toHSL().h))},saturation:function(e){return new b.Dimension(Math.round(e.toHSL().s* -100),"%")},lightness:function(e){return new b.Dimension(Math.round(e.toHSL().l*100),"%")},alpha:function(e){return new b.Dimension(e.toHSL().a)},saturate:function(e,i){e=e.toHSL();e.s+=i.value/100;e.s=f(e.s);return a(e)},desaturate:function(e,i){e=e.toHSL();e.s-=i.value/100;e.s=f(e.s);return a(e)},lighten:function(e,i){e=e.toHSL();e.l+=i.value/100;e.l=f(e.l);return a(e)},darken:function(e,i){e=e.toHSL();e.l-=i.value/100;e.l=f(e.l);return a(e)},spin:function(e,i){e=e.toHSL();i=(e.h+i.value)%360;e.h= -i<0?360+i:i;return a(e)},greyscale:function(e){return this.desaturate(e,new b.Dimension(100))},e:function(e){return new b.Anonymous(e)},"%":function(e){for(var i=Array.prototype.slice.call(arguments,1),j=e.content,k=0;k255?255:a<0?0:a).toString(16);return a.length===1?"0"+ -a:a}).join("")},operate:function(a,d){var f=[];d instanceof b.Color||(d=d.toColor());for(var e=0;e<3;e++)f[e]=b.operate(a,this.rgb[e],d.rgb[e]);return new b.Color(f)},toHSL:function(){var a=this.rgb[0]/255,d=this.rgb[1]/255,f=this.rgb[2]/255,e=this.alpha,i=Math.max(a,d,f),j=Math.min(a,d,f),k,o=(i+j)/2,r=i-j;if(i===j)k=j=0;else{j=o>0.5?r/(2-i-j):r/(i+j);switch(i){case a:k=(d-f)/r+(d":a.compress?">":" > "}[this.value]}})(q("less/tree"));(function(b){b.Expression=function(a){this.value=a};b.Expression.prototype={eval:function(a){return this.value.length>1?new b.Expression(this.value.map(function(d){return d.eval(a)})):this.value[0].eval(a)},toCSS:function(){return this.value.map(function(a){return a.toCSS()}).join(" ")}}})(q("less/tree")); -(function(b){b.Import=function(a,d){var f=this;this._path=a;this.path=a instanceof b.Quoted?/\.(le?|c)ss$/.test(a.content)?a.content:a.content+".less":a.value.content||a.value;(this.css=/css$/.test(this.path))||d.push(this.path,function(e){if(!e)throw new Error("Error parsing "+f.path);f.root=e})};b.Import.prototype={toCSS:function(){return this.css?"@import "+this._path.toCSS()+";\n":""},eval:function(){if(this.css)return this;else{for(var a=0;a0){for(i=0;i1?Array.prototype.push.apply(f,i.find(new b.Selector(a.elements.slice(1)),d)):f.push(i);break}});return this._lookups[e]=f},toCSS:function(a,d){var f=[],e=[],i=[],j=[];if(this.root)for(var k=0;k0){j=j.map(function(r){return r.map(function(t){return t.toCSS(d)}).join("").trim()}).join(d.compress?",":j.length>3?",\n":", ");f.push(j,(d.compress?"{":" {\n ")+e.join(d.compress?"":"\n ")+(d.compress?"}":"\n}\n"))}f.push(i); -d.frames.shift();return f.join("")+(d.compress?"\n":"")}}})(q("less/tree"));(function(b){b.Selector=function(a){this.elements=a;if(this.elements[0].combinator.value==="")this.elements[0].combinator.value=" "};b.Selector.prototype.match=function(a){return this.elements[0].value===a.elements[0].value?true:false};b.Selector.prototype.toCSS=function(a){if(this._css)return this._css;return this._css=this.elements.map(function(d){return typeof d==="string"?" "+d.trim():d.toCSS(a)}).join("")}})(q("less/tree")); -(function(b){b.URL=function(a){this.value=a};b.URL.prototype={toCSS:function(){return"url("+this.value.toCSS()+")"},eval:function(){return this}}})(q("less/tree"));(function(b){b.Value=function(a){this.value=a;this.is="value"};b.Value.prototype={eval:function(a){return this.value.length===1?this.value[0].eval(a):new b.Value(this.value.map(function(d){return d.eval(a)}))},toCSS:function(a){return this.value.map(function(d){return d.toCSS(a)}).join(a.compress?",":", ")}}})(q("less/tree"));(function(b){b.Variable= -function(a,d){this.name=a;this.index=d};b.Variable.prototype={eval:function(a){var d,f,e=this.name;if(d=b.find(a.frames,function(i){if(f=i.variable(e))return f.value.eval(a)}))return d;else throw{message:"variable "+this.name+" is undefined",index:this.index};}}})(q("less/tree"));q("less/tree").find=function(b,a){for(var d=0,f;d0||F?"development":"production";p.async=false;p.poll=F?1E3:1500;p.watch=function(){return this.watchMode=true};p.unwatch=function(){return this.watchMode=false};if(p.env==="development"){p.optimization=0;/!watch/.test(location.hash)&&p.watch();p.watchTimer=setInterval(function(){p.watchMode&&K(function(b,a,d){b&&D(b.toCSS(),a,d.lastModified)})},p.poll)}else p.optimization=3;var y=typeof u.localStorage==="undefined"?null:u.localStorage,G=O('link[rel="stylesheet/less"]'), -T=endTime=new Date;p.refresh=function(b){K(function(a,d,f){if(f.local)x("loading "+d.href+" from cache.");else{x("parsed "+d.href+" successfully.");D(a.toCSS(),d,f.lastModified)}x("css for "+d.href+" generated in "+(new Date-endTime)+"ms");f.remaining===0&&x("css generated in "+(new Date-T)+"ms");endTime=new Date},b)};p.refresh()})(window); diff --git a/deps/.npm/connect/0.2.5/package/support/less/lib/less/browser.js b/deps/.npm/connect/0.2.5/package/support/less/lib/less/browser.js deleted file mode 100644 index bdf0a0b2..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/lib/less/browser.js +++ /dev/null @@ -1,298 +0,0 @@ -// -// browser.js - client-side engine -// - -var isFileProtocol = location.protocol === 'file:'; - -less.env = location.hostname == '127.0.0.1' || - location.hostname == '0.0.0.0' || - location.hostname == 'localhost' || - location.port.length > 0 || - isFileProtocol ? 'development' - : 'production'; - -// Load styles asynchronously (default: false) -// -// This is set to `false` by default, so that the body -// doesn't start loading before the stylesheets are parsed. -// Setting this to `true` can result in flickering. -// -less.async = false; - -// Interval between watch polls -less.poll = isFileProtocol ? 1000 : 1500; - -// -// Watch mode -// -less.watch = function () { return this.watchMode = true }; -less.unwatch = function () { return this.watchMode = false }; - -if (less.env === 'development') { - less.optimization = 0; - - if (/!watch/.test(location.hash)) { - less.watch(); - } - less.watchTimer = setInterval(function () { - if (less.watchMode) { - loadStyleSheets(function (root, sheet, env) { - if (root) { - createCSS(root.toCSS(), sheet, env.lastModified); - } - }); - } - }, less.poll); -} else { - less.optimization = 3; -} - -var cache = (typeof(window.localStorage) === 'undefined') ? null : window.localStorage; - -// -// Select all links with the 'rel' attribute set to "less" -// -var sheets = select('link[rel="stylesheet/less"]'); - -var startTime = endTime = new(Date); - -less.refresh = function (reload) { - loadStyleSheets(function (root, sheet, env) { - if (env.local) { - log("loading " + sheet.href + " from cache."); - } else { - log("parsed " + sheet.href + " successfully."); - createCSS(root.toCSS(), sheet, env.lastModified); - } - log("css for " + sheet.href + " generated in " + (new(Date) - endTime) + 'ms'); - (env.remaining === 0) && log("css generated in " + (new(Date) - startTime) + 'ms'); - endTime = new(Date); - }, reload); -}; - -less.refresh(); - -function select(str) { - if (!document.querySelectorAll && typeof(jQuery) === "undefined") { - log("no selector method found."); - } else { - return (document.querySelectorAll || jQuery).call(document, str); - } -} - -function loadStyleSheets(callback, reload) { - for (var i = 0; i < sheets.length; i++) { - loadStyleSheet(sheets[i], callback, reload, sheets.length - (i + 1)); - } -} - -function loadStyleSheet(sheet, callback, reload, remaining) { - var href = sheet.href.replace(/\?.*$/, ''); - var css = cache && cache.getItem(href); - var timestamp = cache && cache.getItem(href + ':timestamp'); - var styles = { css: css, timestamp: timestamp }; - - xhr(sheet.href, function (data, lastModified) { - if (!reload && styles && - (new(Date)(lastModified).valueOf() === - new(Date)(styles.timestamp).valueOf())) { - // Use local copy - createCSS(styles.css, sheet); - callback(null, sheet, { local: true, remaining: remaining }); - } else { - // Use remote copy (re-parse) - new(less.Parser)({ - optimization: less.optimization, - paths: [href.replace(/[\w\.-]+$/, '')] - }).parse(data, function (e, root) { - if (e) { return error(e, href) } - try { - callback(root, sheet, { local: false, lastModified: lastModified, remaining: remaining }); - removeNode(document.getElementById('less-error-message:' + href.replace(/[^a-z]+/gi, '-'))); - } catch (e) { - error(e, href); - } - }); - } - }, function (status, url) { - throw new(Error)("Couldn't load " + url+ " (" + status + ")"); - }); -} - -function createCSS(styles, sheet, lastModified) { - var css; - - // Strip the query-string - var href = sheet.href ? sheet.href.replace(/\?.*$/, '') : ''; - - // If there is no title set, use the filename, minus the extension - var id = 'less:' + (sheet.title || href.match(/(?:^|\/)([-\w]+)\.[a-z]+$/i)[1]); - - // If the stylesheet doesn't exist, create a new node - if ((css = document.getElementById(id)) === null) { - css = document.createElement('style'); - css.type = 'text/css'; - css.media = 'screen'; - css.id = id; - document.getElementsByTagName('head')[0].appendChild(css); - } - - if (css.styleSheet) { // IE - try { - css.styleSheet.cssText = styles; - } catch (e) { - throw new(Error)("Couldn't reassign styleSheet.cssText."); - } - } else { - (function (node) { - if (css.childNodes.length > 0) { - if (css.firstChild.nodeValue !== node.nodeValue) { - css.replaceChild(node, css.firstChild); - } - } else { - css.appendChild(node); - } - })(document.createTextNode(styles)); - } - - // Don't update the local store if the file wasn't modified - if (lastModified && cache) { - log('saving ' + href + ' to cache.'); - cache.setItem(href, styles); - cache.setItem(href + ':timestamp', lastModified); - } -} - -function xhr(url, callback, errback) { - var xhr = getXMLHttpRequest(); - var async = isFileProtocol ? false : less.async; - - xhr.open('GET', url, async); - xhr.send(null); - - if (isFileProtocol) { - if (xhr.status === 0) { - callback(xhr.responseText); - } else { - errback(xhr.status); - } - } else if (async) { - xhr.onreadystatechange = function () { - if (xhr.readyState == 4) { - handleResponse(xhr, callback, errback); - } - }; - } else { - handleResponse(xhr, callback, errback); - } - - function handleResponse(xhr, callback, errback) { - if (xhr.status >= 200 && xhr.status < 300) { - callback(xhr.responseText, - xhr.getResponseHeader("Last-Modified")); - } else if (typeof(errback) === 'function') { - errback(xhr.status, url); - } - } -} - -function getXMLHttpRequest() { - if (window.XMLHttpRequest) { - return new(XMLHttpRequest); - } else { - try { - return new(ActiveXObject)("MSXML2.XMLHTTP.3.0"); - } catch (e) { - log("browser doesn't support AJAX."); - return null; - } - } -} - -function removeNode(node) { - return node && node.parentNode.removeChild(node); -} - -function log(str) { - if (less.env == 'development' && typeof(console) !== "undefined") { console.log('less: ' + str) } -} - -function error(e, href) { - var id = 'less-error-message:' + href.replace(/[^a-z]+/ig, '-'); - - if (! e.extract) { throw e } - - var template = ['
    ', - '
    [-1]{0}
    ', - '
    [0]{current}
    ', - '
    [1]{2}
    ', - '
    '].join('\n'); - - var elem = document.createElement('div'), timer; - elem.id = id; - elem.className = "less-error-message"; - elem.innerHTML = '

    ' + (e.message || 'There is an error in your .less file') + '

    ' + - '

    ' + href + " " + - 'on line ' + e.line + ', column ' + (e.column + 1) + ':

    ' + - template.replace(/\[(-?\d)\]/g, function (_, i) { - return (parseInt(e.line) + parseInt(i)) || ''; - }).replace(/\{(\d)\}/g, function (_, i) { - return e.extract[parseInt(i)] || ''; - }).replace(/\{current\}/, e.extract[1].slice(0, e.column) + - '' + - e.extract[1].slice(e.column) + - ''); - // CSS for error messages - createCSS([ - '.less-error-message span {', - 'margin-right: 15px;', - '}', - '.less-error-message pre {', - 'color: #ee4444;', - 'padding: 4px 0;', - 'margin: 0;', - '}', - '.less-error-message pre.ctx {', - 'color: #dd7777;', - '}', - '.less-error-message h3 {', - 'padding: 15px 0 5px 0;', - 'margin: 0;', - '}', - '.less-error-message a {', - 'color: #10a', - '}', - '.less-error-message .error {', - 'color: red;', - 'font-weight: bold;', - 'padding-bottom: 2px;', - 'border-bottom: 1px dashed red;', - '}' - ].join('\n'), { title: 'error-message' }); - - elem.style.cssText = [ - "font-family: Arial, sans-serif", - "border: 1px solid #e00", - "background-color: #eee", - "border-radius: 5px", - "-webkit-border-radius: 5px", - "-moz-border-radius: 5px", - "color: #e00", - "padding: 15px", - "margin-bottom: 15px" - ].join(';'); - - if (less.env == 'development') { - timer = setInterval(function () { - if (document.body) { - if (document.getElementById(id)) { - document.body.replaceChild(elem, document.getElementById(id)); - } else { - document.body.insertBefore(elem, document.body.firstChild); - } - clearInterval(timer); - } - }, 10); - } -} - diff --git a/deps/.npm/connect/0.2.5/package/support/less/lib/less/functions.js b/deps/.npm/connect/0.2.5/package/support/less/lib/less/functions.js deleted file mode 100644 index e1fb6b7f..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/lib/less/functions.js +++ /dev/null @@ -1,123 +0,0 @@ -(function (tree) { - -tree.functions = { - rgb: function (r, g, b) { - return this.rgba(r, g, b, 1.0); - }, - rgba: function (r, g, b, a) { - var rgb = [r, g, b].map(function (c) { return number(c) }), - a = number(a); - return new(tree.Color)(rgb, a); - }, - hsl: function (h, s, l) { - return this.hsla(h, s, l, 1.0); - }, - hsla: function (h, s, l, a) { - h = (number(h) % 360) / 360; - s = number(s); l = number(l); a = number(a); - - var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s; - var m1 = l * 2 - m2; - - return this.rgba(hue(h + 1/3) * 255, - hue(h) * 255, - hue(h - 1/3) * 255, - a); - - function hue(h) { - h = h < 0 ? h + 1 : (h > 1 ? h - 1 : h); - if (h * 6 < 1) return m1 + (m2 - m1) * h * 6; - else if (h * 2 < 1) return m2; - else if (h * 3 < 2) return m1 + (m2 - m1) * (2/3 - h) * 6; - else return m1; - } - }, - hue: function (color) { - return new(tree.Dimension)(Math.round(color.toHSL().h)); - }, - saturation: function (color) { - return new(tree.Dimension)(Math.round(color.toHSL().s * 100), '%'); - }, - lightness: function (color) { - return new(tree.Dimension)(Math.round(color.toHSL().l * 100), '%'); - }, - alpha: function (color) { - return new(tree.Dimension)(color.toHSL().a); - }, - saturate: function (color, amount) { - var hsl = color.toHSL(); - - hsl.s += amount.value / 100; - hsl.s = clamp(hsl.s); - return hsla(hsl); - }, - desaturate: function (color, amount) { - var hsl = color.toHSL(); - - hsl.s -= amount.value / 100; - hsl.s = clamp(hsl.s); - return hsla(hsl); - }, - lighten: function (color, amount) { - var hsl = color.toHSL(); - - hsl.l += amount.value / 100; - hsl.l = clamp(hsl.l); - return hsla(hsl); - }, - darken: function (color, amount) { - var hsl = color.toHSL(); - - hsl.l -= amount.value / 100; - hsl.l = clamp(hsl.l); - return hsla(hsl); - }, - spin: function (color, amount) { - var hsl = color.toHSL(); - var hue = (hsl.h + amount.value) % 360; - - hsl.h = hue < 0 ? 360 + hue : hue; - - return hsla(hsl); - }, - greyscale: function (color) { - return this.desaturate(color, new(tree.Dimension)(100)); - }, - e: function (str) { - return new(tree.Anonymous)(str); - }, - '%': function (quoted /* arg, arg, ...*/) { - var args = Array.prototype.slice.call(arguments, 1), - str = quoted.content; - - for (var i = 0; i < args.length; i++) { - str = str.replace(/%s/, args[i].content) - .replace(/%[da]/, args[i].toCSS()); - } - str = str.replace(/%%/g, '%'); - return new(tree.Quoted)('"' + str + '"', str); - } -}; - -function hsla(hsla) { - return tree.functions.hsla(hsla.h, hsla.s, hsla.l, hsla.a); -} - -function number(n) { - if (n instanceof tree.Dimension) { - return parseFloat(n.unit == '%' ? n.value / 100 : n.value); - } else if (typeof(n) === 'number') { - return n; - } else { - throw { - error: "RuntimeError", - message: "color functions take numbers as parameters" - }; - } -} - -function clamp(val) { - return Math.min(1, Math.max(0, val)); -} - -})(require('less/tree')); diff --git a/deps/.npm/connect/0.2.5/package/support/less/lib/less/index.js b/deps/.npm/connect/0.2.5/package/support/less/lib/less/index.js deleted file mode 100644 index 737ed00d..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/lib/less/index.js +++ /dev/null @@ -1,145 +0,0 @@ -var path = require('path'), - sys = require('sys'), - fs = require('fs'); - -require.paths.unshift(path.join(__dirname, '..')); - -var less = { - version: [1, 0, 21], - Parser: require('less/parser').Parser, - importer: require('less/parser').importer, - tree: require('less/tree'), - render: function (input, options, callback) { - options = options || {}; - - if (typeof(options) === 'function') { - callback = options, options = {}; - } - - var parser = new(this.Parser)(options), - ee; - - if (callback) { - parser.parse(input, function (e, root) { - callback(e, root.toCSS()); - }); - } else { - ee = new(require('events').EventEmitter); - - process.nextTick(function () { - parser.parse(input, function (e, root) { - if (e) { ee.emit('error', e) } - else { ee.emit('success', root.toCSS()) } - }); - }); - return ee; - } - }, - writeError: function (ctx, options) { - var message = ""; - var extract = ctx.extract; - var error = []; - - options = options || {}; - - if (options.silent) { return } - - if (!ctx.index && ctx.stack) { - return sys.error(ctx.stack); - } - - if (typeof(extract[0]) === 'string') { - error.push(stylize((ctx.line - 1) + ' ' + extract[0], 'grey')); - } - - error.push(ctx.line + ' ' + extract[1].slice(0, ctx.column) - + stylize(stylize(extract[1][ctx.column], 'bold') - + extract[1].slice(ctx.column + 1), 'yellow')); - - if (typeof(extract[2]) === 'string') { - error.push(stylize((ctx.line + 1) + ' ' + extract[2], 'grey')); - } - error = error.join('\n') + '\033[0m\n'; - - message += stylize(ctx.message, 'red'); - ctx.filename && (message += stylize(' in ', 'red') + ctx.filename); - - sys.error(message, error); - - if (ctx.callLine) { - sys.error(stylize('from ', 'red') + (ctx.filename || '')); - sys.error(stylize(ctx.callLine, 'grey') + ' ' + ctx.callExtract); - } - if (ctx.stack) { sys.error(stylize(ctx.stack, 'red')) } - } -}; - -['color', 'directive', 'operation', 'dimension', - 'keyword', 'variable', 'ruleset', 'element', - 'selector', 'quoted', 'expression', 'rule', - 'call', 'url', 'alpha', 'import', - 'mixin', 'comment', 'anonymous', 'value' -].forEach(function (n) { - require(path.join('less', 'tree', n)); -}); - -less.Parser.importer = function (file, paths, callback) { - var pathname; - - paths.unshift('.'); - - for (var i = 0; i < paths.length; i++) { - try { - pathname = path.join(paths[i], file); - fs.statSync(pathname); - break; - } catch (e) { - pathname = null; - } - } - - if (pathname) { - fs.stat(pathname, function (e, stats) { - if (e) sys.error(e); - - fs.open(pathname, process.O_RDONLY, stats.mode, function (e, fd) { - if (e) sys.error(e); - - fs.read(fd, stats.size, 0, "utf8", function (e, data) { - if (e) sys.error(e); - - new(less.Parser)({ - paths: [path.dirname(pathname)], - filename: pathname - }).parse(data, function (e, root) { - if (e) less.writeError(e); - callback(root); - }); - }); - }); - }); - } else { - sys.error("file '" + file + "' wasn't found.\n"); - process.exit(1); - } -} - -require('less/functions'); - -for (var k in less) { exports[k] = less[k] } - -// Stylize a string -function stylize(str, style) { - var styles = { - 'bold' : [1, 22], - 'inverse' : [7, 27], - 'underline' : [4, 24], - 'yellow' : [33, 39], - 'green' : [32, 39], - 'red' : [31, 39], - 'grey' : [90, 39] - }; - return '\033[' + styles[style][0] + 'm' + str + - '\033[' + styles[style][1] + 'm'; -} - diff --git a/deps/.npm/connect/0.2.5/package/support/less/lib/less/parser.js b/deps/.npm/connect/0.2.5/package/support/less/lib/less/parser.js deleted file mode 100644 index 8d7eb2b5..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/lib/less/parser.js +++ /dev/null @@ -1,943 +0,0 @@ -var less, tree; - -if (typeof(window) === 'undefined') { - less = exports, - tree = require('less/tree'); -} else { - less = window.less = {}, - tree = window.less.tree = {}; -} -// -// less.js - parser -// -// A relatively straight-forward recursive-descent parser. -// There is no tokenization/lexing stage, the input is parsed -// in one sweep. -// -// To make the parser fast enough to run in the browser, several -// optimization had to be made: -// -// - Instead of the more commonly used technique of slicing the -// input string on every match, we use global regexps (/g), -// and move the `lastIndex` pointer on match, foregoing `slice()` -// completely. This gives us a 3x speed-up. -// -// - Matching on a huge input is often cause of slowdowns, -// especially with the /g flag. The solution to that is to -// chunkify the input: we split it by /\n\n/, just to be on -// the safe side. The chunks are stored in the `chunks` var, -// `j` holds the current chunk index, and `current` holds -// the index of the current chunk in relation to `input`. -// This gives us an almost 4x speed-up. -// -// - In many cases, we don't need to match individual tokens; -// for example, if a value doesn't hold any variables, operations -// or dynamic references, the parser can effectively 'skip' it, -// treating it as a literal. -// An example would be '1px solid #000' - which evaluates to itself, -// we don't need to know what the individual components are. -// The drawback, of course is that you don't get the benefits of -// syntax-checking on the CSS. This gives us a 50% speed-up in the parser, -// and a smaller speed-up in the code-gen. -// -// -// Token matching is done with the `$` function, which either takes -// a terminal string or regexp, or a non-terminal function to call. -// It also takes care of moving all the indices forwards. -// -// -less.Parser = function Parser(env) { - var input, // LeSS input string - i, // current index in `input` - j, // current chunk - furthest, // furthest index the parser has gone to - chunks, // chunkified input - current, // index of current chunk, in `input` - inputLength, - parser; - - var that = this; - - // This function is called after all files - // have been imported through `@import`. - var finish = function () {}; - - var imports = this.imports = { - paths: env && env.paths || [], // Search paths, when importing - queue: [], // Files which haven't been imported yet - files: {}, // Holds the imported parse trees - push: function (path, callback) { - var that = this; - this.queue.push(path); - - // - // Import a file asynchronously - // - less.Parser.importer(path, this.paths, function (root) { - that.queue.splice(that.queue.indexOf(path), 1); // Remove the path from the queue - that.files[path] = root; // Store the root - - callback(root); - - if (that.queue.length === 0) { finish() } // Call `finish` if we're done importing - }); - } - }; - - // - // Parse from a token, regexp or string, and move forward if match - // - function $(tok) { - var match, args, length, c, index, endIndex; - - // - // Non-terminal - // - if (tok instanceof Function) { - return tok.call(parser.parsers); - // - // Terminal - // - // Either match a single character in the input, - // or match a regexp in the current chunk (chunk[j]). - // - } else if (typeof(tok) === 'string') { - match = input.charAt(i) === tok ? tok : null; - length = 1; - - // 1. We move to the next chunk, if necessary. - // 2. Set the `lastIndex` to be relative - // to the current chunk, and try to match in it. - // 3. Make sure we matched at `index`. Because we use - // the /g flag, the match could be anywhere in the - // chunk. We have to make sure it's at our previous - // index, which we stored in [2]. - // - } else { - if (i >= current + chunks[j].length && - j < chunks.length - 1) { // 1. - current += chunks[j++].length; - } - tok.lastIndex = index = i - current; // 2. - match = tok.exec(chunks[j]); - - if (match) { - length = match[0].length; - if (tok.lastIndex - length !== index) { return } // 3. - } - } - - // The match is confirmed, add the match length to `i`, - // and consume any extra white-space characters (' ' || '\n') - // which come after that. The reason for this is that LeSS's - // grammar is mostly white-space insensitive. - // - if (match) { - i += length; - endIndex = current + chunks[j].length; - - while (i <= endIndex) { - c = input.charCodeAt(i); - if (! (c === 32 || c === 10 || c === 9)) { break } - i++; - } - - if(typeof(match) === 'string') { - return match; - } else { - return match.length === 1 ? match[0] : match; - } - } - } - - // Same as $(), but don't change the state of the parser, - // just return the match. - function peek(tok) { - var match; - - if (typeof(tok) === 'string') { - return input.charAt(i) === tok; - } else { - tok.lastIndex = i; - - if ((match = tok.exec(input)) && - (tok.lastIndex - match[0].length === i)) { - return match; - } - } - } - - this.env = env || {}; - - // The optimization level dictates the thoroughness of the parser, - // the lower the number, the less nodes it will create in the tree. - // This could matter for debugging, or if you want to access - // the individual nodes in the tree. - this.optimization = ('optimization' in this.env) ? this.env.optimization : 1; - - // - // The Parser - // - return parser = { - - imports: imports, - // - // Parse an input string into an abstract syntax tree, - // call `callback` when done. - // - parse: function (str, callback) { - var root, start, end, zone, line, lines, buff = [], c, error = null; - - i = j = current = furthest = 0; - chunks = []; - input = str.replace(/\r\n/g, '\n'); - - // Split the input into chunks, - // delimited by /\n\n/ and - // removing comments (see rationale above), - // depending on the level of optimization. - if (that.optimization > 0) { - input = input.replace(/\/\*(?:[^*]|\*+[^\/*])*\*+\//g, function (comment) { - return that.optimization > 1 ? '' : comment.replace(/\n(\s*\n)+/g, '\n'); - }); - chunks = input.split(/^(?=\n)/mg); - } else { - chunks = [input]; - } - inputLength = input.length; - - // Start with the primary rule. - // The whole syntax tree is held under a Ruleset node, - // with the `root` property set to true, so no `{}` are - // output. The callback is called when the input is parsed. - root = new(tree.Ruleset)([], $(this.parsers.primary)); - root.root = true; - - root.toCSS = (function (toCSS) { - var line, lines, column; - - return function (options) { - options = options || {}; - try { - var css = toCSS.call(this, [], { - frames: [], - compress: options.compress || false - }); - if (options.compress) { - return css.replace(/(\s)+/g, "$1"); - } else { - return css; - } - } catch (e) { - lines = input.split('\n'); - line = getLine(e.index); - - for (var n = e.index, column = -1; - n >= 0 && input.charAt(n) !== '\n'; - n--) { column++ } - - throw { - name: "NameError", - message: e.message, - filename: env.filename, - index: e.index, - line: line + 1, - callLine: e.call && (getLine(e.call) + 1), - callExtract: lines[getLine(e.call) - 1], - stack: e.stack, - column: column, - extract: [ - lines[line - 1], - lines[line], - lines[line + 1] - ] - }; - } - - function getLine(index) { - return (input.slice(0, index).match(/\n/g) || "").length; - } - }; - })(root.toCSS); - - // If `i` is smaller than the `input.length - 1`, - // it means the parser wasn't able to parse the whole - // string, so we've got a parsing error. - // - // We try to extract a \n delimited string, - // showing the line where the parse error occured. - // We split it up into two parts (the part which parsed, - // and the part which didn't), so we can color them differently. - if (i < input.length - 1) { - i = furthest; - lines = input.split('\n'); - line = (input.slice(0, i).match(/\n/g) || "").length + 1; - - for (var n = i, column = -1; n >= 0 && input.charAt(n) !== '\n'; n--) { column++ } - - error = { - name: "ParseError", - message: "Syntax Error on line " + line, - filename: env.filename, - line: line, - column: column, - extract: [ - lines[line - 2], - lines[line - 1], - lines[line] - ] - }; - } - - if (this.imports.queue.length > 0) { - finish = function () { callback(error, root) }; - } else { - callback(error, root); - } - }, - - // - // Here in, the parsing rules/functions - // - // The basic structure of the syntax tree generated is as follows: - // - // Ruleset -> Rule -> Value -> Expression -> Entity - // - // Here's some LESS code: - // - // .class { - // color: #fff; - // border: 1px solid #000; - // width: @w + 4px; - // > .child {...} - // } - // - // And here's what the parse tree might look like: - // - // Ruleset (Selector '.class', [ - // Rule ("color", Value ([Expression [Color #fff]])) - // Rule ("border", Value ([Expression [Dimension 1px][Keyword "solid"][Color #000]])) - // Rule ("width", Value ([Expression [Operation "+" [Variable "@w"][Dimension 4px]]])) - // Ruleset (Selector [Element '>', '.child'], [...]) - // ]) - // - // In general, most rules will try to parse a token with the `$()` function, and if the return - // value is truly, will return a new node, of the relevant type. Sometimes, we need to check - // first, before parsing, that's when we use `peek()`. - // - parsers: { - // - // The `primary` rule is the *entry* and *exit* point of the parser. - // The rules here can appear at any level of the parse tree. - // - // The recursive nature of the grammar is an interplay between the `block` - // rule, which represents `{ ... }`, the `ruleset` rule, and this `primary` rule, - // as represented by this simplified grammar: - // - // primary → (ruleset | rule)+ - // ruleset → selector+ block - // block → '{' primary '}' - // - // Only at one point is the primary rule not called from the - // block rule: at the root level. - // - primary: function () { - var node, root = []; - - while (node = $(this.mixin.definition) || $(this.rule) || $(this.ruleset) || - $(this.mixin.call) || $(this.comment) || - $(/[\n\s]+/g) || $(this.directive)) { - root.push(node); - } - return root; - }, - - // We create a Comment node for CSS comments `/* */`, - // but keep the LeSS comments `//` silent, by just skipping - // over them. - comment: function () { - var comment; - - if (input.charAt(i) !== '/') return; - - if (input.charAt(i + 1) === '/') { - return new(tree.Comment)($(/\/\/.*/g), true); - } else if (comment = $(/\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/g)) { - return new(tree.Comment)(comment); - } - }, - - // - // Entities are tokens which can be found inside an Expression - // - entities: { - // - // A string, which supports escaping " and ' - // - // "milky way" 'he\'s the one!' - // - quoted: function () { - var str; - if (input.charAt(i) !== '"' && input.charAt(i) !== "'") return; - - if (str = $(/"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/g)) { - return new(tree.Quoted)(str[0], str[1] || str[2]); - } - }, - - // - // A catch-all word, such as: - // - // black border-collapse - // - keyword: function () { - var k; - if (k = $(/[A-Za-z-]+/g)) { return new(tree.Keyword)(k) } - }, - - // - // A function call - // - // rgb(255, 0, 255) - // - // We also try to catch IE's `alpha()`, but let the `alpha` parser - // deal with the details. - // - // The arguments are parsed with the `entities.arguments` parser. - // - call: function () { - var name, args; - - if (! (name = $(/([\w-]+|%)\(/g))) return; - - if (name[1].toLowerCase() === 'alpha') { return $(this.alpha) } - - args = $(this.entities.arguments); - - if (! $(')')) return; - - if (name) { return new(tree.Call)(name[1], args) } - }, - arguments: function () { - var args = [], arg; - - while (arg = $(this.expression)) { - args.push(arg); - if (! $(',')) { break } - } - return args; - }, - literal: function () { - return $(this.entities.dimension) || - $(this.entities.color) || - $(this.entities.quoted); - }, - - // - // Parse url() tokens - // - // We use a specific rule for urls, because they don't really behave like - // standard function calls. The difference is that the argument doesn't have - // to be enclosed within a string, so it can't be parsed as an Expression. - // - url: function () { - var value; - - if (input.charAt(i) !== 'u' || !$(/url\(/g)) return; - value = $(this.entities.quoted) || $(/[-\w%@$\/.&=:;#+?]+/g); - if (! $(')')) throw new(Error)("missing closing ) for url()"); - - return new(tree.URL)(value.value ? value : new(tree.Anonymous)(value)); - }, - - // - // A Variable entity, such as `@fink`, in - // - // width: @fink + 2px - // - // We use a different parser for variable definitions, - // see `parsers.variable`. - // - variable: function () { - var name, index = i; - - if (input.charAt(i) === '@' && (name = $(/@[\w-]+/g))) { - return new(tree.Variable)(name, index); - } - }, - - // - // A Hexadecimal color - // - // #4F3C2F - // - // `rgb` and `hsl` colors are parsed through the `entities.call` parser. - // - color: function () { - var rgb; - - if (input.charAt(i) === '#' && (rgb = $(/#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/g))) { - return new(tree.Color)(rgb[1]); - } - }, - - // - // A Dimension, that is, a number and a unit - // - // 0.5em 95% - // - dimension: function () { - var value, c = input.charCodeAt(i); - if ((c > 57 || c < 45) || c === 47) return; - - if (value = $(/(-?\d*\.?\d+)(px|%|em|pc|ex|in|deg|s|ms|pt|cm|mm)?/g)) { - return new(tree.Dimension)(value[1], value[2]); - } - } - }, - - // - // The variable part of a variable definition. Used in the `rule` parser - // - // @fink: - // - variable: function () { - var name; - - if (input.charAt(i) === '@' && (name = $(/(@[\w-]+)\s*:/g))) { return name[1] } - }, - - // - // A font size/line-height shorthand - // - // small/12px - // - // We need to peek first, or we'll match on keywords and dimensions - // - shorthand: function () { - var a, b; - - if (! peek(/[@\w.-]+\/[@\w.-]+/g)) return; - - if ((a = $(this.entity)) && $('/') && (b = $(this.entity))) { - return new(tree.Shorthand)(a, b); - } - }, - - // - // Mixins - // - mixin: { - // - // A Mixin call, with an optional argument list - // - // #mixins > .square(#fff); - // .rounded(4px, black); - // .button; - // - // The `while` loop is there because mixins can be - // namespaced, but we only support the child and descendant - // selector for now. - // - call: function () { - var elements = [], e, c, args, index = i; - - while (e = $(/[#.][\w-]+/g)) { - elements.push(new(tree.Element)(c, e)); - c = $('>'); - } - $('(') && (args = $(this.entities.arguments)) && $(')'); - - if (elements.length > 0 && ($(';') || peek('}'))) { - return new(tree.mixin.Call)(elements, args, index); - } - }, - - // - // A Mixin definition, with a list of parameters - // - // .rounded (@radius: 2px, @color) { - // ... - // } - // - // Until we have a finer grained state-machine, we have to - // do a look-ahead, to make sure we don't have a mixin call. - // See the `rule` function for more information. - // - // We start by matching `.rounded (`, and then proceed on to - // the argument list, which has optional default values. - // We store the parameters in `params`, with a `value` key, - // if there is a value, such as in the case of `@radius`. - // - // Once we've got our params list, and a closing `)`, we parse - // the `{...}` block. - // - definition: function () { - var name, params = [], match, ruleset, param, value; - - if (input.charAt(i) !== '.' || peek(/[^{]*(;|})/g)) return; - - if (match = $(/([#.][\w-]+)\s*\(/g)) { - name = match[1]; - - while (param = $(/@[\w-]+/g) || $(this.entities.literal) - || $(this.entities.keyword)) { - // Variable - if (param[0] === '@') { - if ($(':')) { - if (value = $(this.expression)) { - params.push({ name: param, value: value }); - } else { - throw new(Error)("Expected value"); - } - } else { - params.push({ name: param }); - } - } else { - params.push({ value: param }); - } - if (! $(',')) { break } - } - if (! $(')')) throw new(Error)("Expected )"); - - ruleset = $(this.block); - - if (ruleset) { - return new(tree.mixin.Definition)(name, params, ruleset); - } - } - } - }, - - // - // Entities are the smallest recognized token, - // and can be found inside a rule's value. - // - entity: function () { - return $(this.entities.literal) || $(this.entities.variable) || $(this.entities.url) || - $(this.entities.call) || $(this.entities.keyword); - }, - - // - // A Rule terminator. Note that we use `peek()` to check for '}', - // because the `block` rule will be expecting it, but we still need to make sure - // it's there, if ';' was ommitted. - // - end: function () { - return $(';') || peek('}'); - }, - - // - // IE's alpha function - // - // alpha(opacity=88) - // - alpha: function () { - var value; - - if (! $(/opacity=/gi)) return; - if (value = $(/\d+/g) || $(this.entities.variable)) { - if (! $(')')) throw new(Error)("missing closing ) for alpha()"); - return new(tree.Alpha)(value); - } - }, - - // - // A Selector Element - // - // div - // + h1 - // #socks - // input[type="text"] - // - // Elements are the building blocks for Selectors, - // they are made out of a `Combinator` (see combinator rule), - // and an element name, such as a tag a class, or `*`. - // - element: function () { - var e, t; - - c = $(this.combinator); - e = $(/[.#:]?[\w-]+/g) || $('*') || $(this.attribute) || $(/\([^)@]+\)/g); - - if (e) { return new(tree.Element)(c, e) } - }, - - // - // Combinators combine elements together, in a Selector. - // - // Because our parser isn't white-space sensitive, special care - // has to be taken, when parsing the descendant combinator, ` `, - // as it's an empty space. We have to check the previous character - // in the input, to see if it's a ` ` character. More info on how - // we deal with this in *combinator.js*. - // - combinator: function () { - var match; - if (match = $(/[+>~]/g) || $('&') || $(/::/g)) { - return new(tree.Combinator)(match); - } else { - return new(tree.Combinator)(input.charAt(i - 1) === " " ? " " : null); - } - }, - - // - // A CSS Selector - // - // .class > div + h1 - // li a:hover - // - // Selectors are made out of one or more Elements, see above. - // - selector: function () { - var sel, e, elements = [], match; - - while (e = $(this.element)) { elements.push(e) } - - if (elements.length > 0) { return new(tree.Selector)(elements) } - }, - tag: function () { - return $(/[a-zA-Z][a-zA-Z-]*[0-9]?/g) || $('*'); - }, - attribute: function () { - var attr = '', key, val, op; - - if (! $('[')) return; - - if (key = $(/[a-z-]+/g) || $(this.entities.quoted)) { - if ((op = $(/[|~*$^]?=/g)) && - (val = $(this.entities.quoted) || $(/[\w-]+/g))) { - attr = [key, op, val.toCSS ? val.toCSS() : val].join(''); - } else { attr = key } - } - - if (! $(']')) return; - - if (attr) { return "[" + attr + "]" } - }, - - // - // The `block` rule is used by `ruleset` and `mixin.definition`. - // It's a wrapper around the `primary` rule, with added `{}`. - // - block: function () { - var content; - - if ($('{') && (content = $(this.primary)) && $('}')) { - return content; - } - }, - - // - // div, .class, body > p {...} - // - ruleset: function () { - var selectors = [], s, rules, match, memo = i; - - if (match = peek(/([.#: \w-]+)[\s\n]*\{/g)) { - i += match[0].length - 1; - selectors = [new(tree.Selector)([new(tree.Element)(null, match[1])])]; - } else { - while (s = $(this.selector)) { - selectors.push(s); - if (! $(',')) { break } - } - if (s) $(this.comment); - } - - if (selectors.length > 0 && (rules = $(this.block))) { - return new(tree.Ruleset)(selectors, rules); - } else { - // Backtrack - furthest = i; - i = memo; - } - }, - rule: function () { - var value; - var memo = i; - - if (name = $(this.property) || $(this.variable)) { - if ((name.charAt(0) != '@') && (match = peek(/([^@+\/*(;{}-]*);/g))) { - i += match[0].length - 1; - value = new(tree.Anonymous)(match[1]); - } else if (name === "font") { - value = $(this.font); - } else { - value = $(this.value); - } - - if ($(this.end)) { - return new(tree.Rule)(name, value, memo); - } else { - furthest = i; - i = memo; - } - } - }, - - // - // An @import directive - // - // @import "lib"; - // - // Depending on our environemnt, importing is done differently: - // In the browser, it's an XHR request, in Node, it would be a - // file-system operation. The function used for importing is - // stored in `import`, which we pass to the Import constructor. - // - "import": function () { - var path; - if ($(/@import\s+/g) && - (path = $(this.entities.quoted) || $(this.entities.url)) && - $(';')) { - return new(tree.Import)(path, imports); - } - }, - - // - // A CSS Directive - // - // @charset "utf-8"; - // - directive: function () { - var name, value, rules, types; - - if (input.charAt(i) !== '@') return; - - if (value = $(this['import'])) { - return value; - } else if (name = $(/@media|@page/g)) { - types = $(/[^{]+/g).trim(); - if (rules = $(this.block)) { - return new(tree.Directive)(name + " " + types, rules); - } - } else if (name = $(/@[-a-z]+/g)) { - if (name === '@font-face') { - if (rules = $(this.block)) { - return new(tree.Directive)(name, rules); - } - } else if ((value = $(this.entity)) && $(';')) { - return new(tree.Directive)(name, value); - } - } - }, - font: function () { - var value = [], expression = [], weight, shorthand, font, e; - - while (e = $(this.shorthand) || $(this.entity)) { - expression.push(e); - } - value.push(new(tree.Expression)(expression)); - - if ($(',')) { - while (e = $(this.expression)) { - value.push(e); - if (! $(',')) { break } - } - } - return new(tree.Value)(value, $(this.important)); - }, - - // - // A Value is a comma-delimited list of Expressions - // - // font-family: Baskerville, Georgia, serif; - // - // In a Rule, a Value represents everything after the `:`, - // and before the `;`. - // - value: function () { - var e, expressions = [], important; - - while (e = $(this.expression)) { - expressions.push(e); - if (! $(',')) { break } - } - important = $(this.important); - - if (expressions.length > 0) { - return new(tree.Value)(expressions, important); - } - }, - important: function () { - return $(/!\s*important/g); - }, - sub: function () { - var e; - - if ($('(') && (e = $(this.expression)) && $(')')) { - return e; - } - }, - multiplication: function () { - var m, a, op, operation; - if (m = $(this.operand)) { - while ((op = $(/[\/*]/g)) && (a = $(this.operand))) { - operation = new(tree.Operation)(op, [operation || m, a]); - } - return operation || m; - } - }, - addition: function () { - var m, a, op, operation; - if (m = $(this.multiplication)) { - while ((op = $(/[-+]\s+/g) || (input.charAt(i - 1) != ' ' && $(/[-+]/g))) && - (a = $(this.multiplication))) { - operation = new(tree.Operation)(op, [operation || m, a]); - } - return operation || m; - } - }, - - // - // An operand is anything that can be part of an operation, - // such as a Color, or a Variable - // - operand: function () { - return $(this.sub) || $(this.entities.dimension) || - $(this.entities.color) || $(this.entities.variable); - }, - - // - // Expressions either represent mathematical operations, - // or white-space delimited Entities. - // - // 1px solid black - // @var * 2 - // - expression: function () { - var e, delim, entities = [], d; - - while (e = $(this.addition) || $(this.entity)) { - entities.push(e); - } - if (entities.length > 0) { - return new(tree.Expression)(entities); - } - }, - property: function () { - var name; - - if (name = $(/(\*?-?[-a-z_0-9]+)\s*:/g)) { - return name[1]; - } - } - } - }; -}; - -if (typeof(window) !== 'undefined') { - // - // Used by `@import` directives - // - less.Parser.importer = function (path, paths, callback) { - if (path[0] !== '/' && paths.length > 0) { - path = paths[0] + path; - } - loadStyleSheet({ href: path, title: path }, function (root) { - callback(root); - }); - }; -} - diff --git a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree.js b/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree.js deleted file mode 100644 index a55aa990..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree.js +++ /dev/null @@ -1,6 +0,0 @@ -require('less/tree').find = function (obj, fun) { - for (var i = 0, r; i < obj.length; i++) { - if (r = fun.call(obj, obj[i])) { return r } - } - return null; -}; diff --git a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/alpha.js b/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/alpha.js deleted file mode 100644 index efe9c9c9..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/alpha.js +++ /dev/null @@ -1,14 +0,0 @@ -(function (tree) { - -tree.Alpha = function (val) { - this.value = val; -}; -tree.Alpha.prototype = { - toCSS: function () { - return "alpha(opacity=" + - (this.value.toCSS ? this.value.toCSS() : this.value) + ")"; - }, - eval: function () { return this } -}; - -})(require('less/tree')); diff --git a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/anonymous.js b/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/anonymous.js deleted file mode 100644 index e5c24032..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/anonymous.js +++ /dev/null @@ -1,13 +0,0 @@ -(function (tree) { - -tree.Anonymous = function (string) { - this.value = string.content || string; -}; -tree.Anonymous.prototype = { - toCSS: function () { - return this.value; - }, - eval: function () { return this } -}; - -})(require('less/tree')); diff --git a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/call.js b/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/call.js deleted file mode 100644 index c2353e54..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/call.js +++ /dev/null @@ -1,39 +0,0 @@ -(function (tree) { - -// -// A function call node. -// -tree.Call = function (name, args) { - this.name = name; - this.args = args; -}; -tree.Call.prototype = { - // - // When evaluating a function call, - // we either find the function in `tree.functions` [1], - // in which case we call it, passing the evaluated arguments, - // or we simply print it out as it appeared originally [2]. - // - // The *functions.js* file contains the built-in functions. - // - // The reason why we evaluate the arguments, is in the case where - // we try to pass a variable to a function, like: `saturate(@color)`. - // The function should receive the value, not the variable. - // - eval: function (env) { - var args = this.args.map(function (a) { return a.eval(env) }); - - if (this.name in tree.functions) { // 1. - return tree.functions[this.name].apply(tree.functions, args); - } else { // 2. - return new(tree.Anonymous)(this.name + - "(" + args.map(function (a) { return a.toCSS() }).join(', ') + ")"); - } - }, - - toCSS: function (env) { - return this.eval(env).toCSS(); - } -}; - -})(require('less/tree')); diff --git a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/color.js b/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/color.js deleted file mode 100644 index 18fd2167..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/color.js +++ /dev/null @@ -1,93 +0,0 @@ -(function (tree) { -// -// RGB Colors - #ff0014, #eee -// -tree.Color = function (rgb, a) { - // - // The end goal here, is to parse the arguments - // into an integer triplet, such as `128, 255, 0` - // - // This facilitates operations and conversions. - // - if (Array.isArray(rgb)) { - this.rgb = rgb; - } else if (rgb.length == 6) { - this.rgb = rgb.match(/.{2}/g).map(function (c) { - return parseInt(c, 16); - }); - } else { - this.rgb = rgb.split('').map(function (c) { - return parseInt(c + c, 16); - }); - } - this.alpha = typeof(a) === 'number' ? a : 1; -}; -tree.Color.prototype = { - eval: function () { return this }, - - // - // If we have some transparency, the only way to represent it - // is via `rgba`. Otherwise, we use the hex representation, - // which has better compatibility with older browsers. - // Values are capped between `0` and `255`, rounded and zero-padded. - // - toCSS: function () { - if (this.alpha < 1.0) { - return "rgba(" + this.rgb.map(function (c) { - return Math.round(c); - }).concat(this.alpha).join(', ') + ")"; - } else { - return '#' + this.rgb.map(function (i) { - i = Math.round(i); - i = (i > 255 ? 255 : (i < 0 ? 0 : i)).toString(16); - return i.length === 1 ? '0' + i : i; - }).join(''); - } - }, - - // - // Operations have to be done per-channel, if not, - // channels will spill onto each other. Once we have - // our result, in the form of an integer triplet, - // we create a new Color node to hold the result. - // - operate: function (op, other) { - var result = []; - - if (! (other instanceof tree.Color)) { - other = other.toColor(); - } - - for (var c = 0; c < 3; c++) { - result[c] = tree.operate(op, this.rgb[c], other.rgb[c]); - } - return new(tree.Color)(result); - }, - - toHSL: function () { - var r = this.rgb[0] / 255, - g = this.rgb[1] / 255, - b = this.rgb[2] / 255, - a = this.alpha; - - var max = Math.max(r, g, b), min = Math.min(r, g, b); - var h, s, l = (max + min) / 2, d = max - min; - - if (max === min) { - h = s = 0; - } else { - s = l > 0.5 ? d / (2 - max - min) : d / (max + min); - - switch (max) { - case r: h = (g - b) / d + (g < b ? 6 : 0); break; - case g: h = (b - r) / d + 2; break; - case b: h = (r - g) / d + 4; break; - } - h /= 6; - } - return { h: h * 360, s: s, l: l, a: a }; - } -}; - - -})(require('less/tree')); diff --git a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/comment.js b/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/comment.js deleted file mode 100644 index 2d95dff8..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/comment.js +++ /dev/null @@ -1,14 +0,0 @@ -(function (tree) { - -tree.Comment = function (value, silent) { - this.value = value; - this.silent = !!silent; -}; -tree.Comment.prototype = { - toCSS: function (env) { - return env.compress ? '' : this.value; - }, - eval: function () { return this } -}; - -})(require('less/tree')); diff --git a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/dimension.js b/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/dimension.js deleted file mode 100644 index 41f3ca2c..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/dimension.js +++ /dev/null @@ -1,34 +0,0 @@ -(function (tree) { - -// -// A number with a unit -// -tree.Dimension = function (value, unit) { - this.value = parseFloat(value); - this.unit = unit || null; -}; - -tree.Dimension.prototype = { - eval: function () { return this }, - toColor: function () { - return new(tree.Color)([this.value, this.value, this.value]); - }, - toCSS: function () { - var css = this.value + this.unit; - return css; - }, - - // In an operation between two Dimensions, - // we default to the first Dimension's unit, - // so `1px + 2em` will yield `3px`. - // In the future, we could implement some unit - // conversions such that `100cm + 10mm` would yield - // `101cm`. - operate: function (op, other) { - return new(tree.Dimension) - (tree.operate(op, this.value, other.value), - this.unit || other.unit); - } -}; - -})(require('less/tree')); diff --git a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/directive.js b/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/directive.js deleted file mode 100644 index 79779c03..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/directive.js +++ /dev/null @@ -1,33 +0,0 @@ -(function (tree) { - -tree.Directive = function (name, value) { - this.name = name; - if (Array.isArray(value)) { - this.ruleset = new(tree.Ruleset)([], value); - } else { - this.value = value; - } -}; -tree.Directive.prototype = { - toCSS: function (ctx, env) { - if (this.ruleset) { - this.ruleset.root = true; - return this.name + (env.compress ? '{' : ' {\n ') + - this.ruleset.toCSS(ctx, env).trim().replace(/\n/g, '\n ') + - (env.compress ? '}': '\n}\n'); - } else { - return this.name + ' ' + this.value.toCSS() + ';\n'; - } - }, - eval: function (env) { - env.frames.unshift(this); - this.ruleset && this.ruleset.evalRules(env); - env.frames.shift(); - return this; - }, - variable: function (name) { return tree.Ruleset.prototype.variable.call(this.ruleset, name) }, - find: function () { return tree.Ruleset.prototype.find.apply(this.ruleset, arguments) }, - rulesets: function () { return tree.Ruleset.prototype.rulesets.apply(this.ruleset) } -}; - -})(require('less/tree')); diff --git a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/element.js b/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/element.js deleted file mode 100644 index acf5e205..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/element.js +++ /dev/null @@ -1,32 +0,0 @@ -(function (tree) { - -tree.Element = function (combinator, value) { - this.combinator = combinator instanceof tree.Combinator ? - combinator : new(tree.Combinator)(combinator); - this.value = value.trim(); -}; -tree.Element.prototype.toCSS = function (env) { - return this.combinator.toCSS(env || {}) + this.value; -}; - -tree.Combinator = function (value) { - if (value === ' ') { - this.value = ' '; - } else { - this.value = value ? value.trim() : ""; - } -}; -tree.Combinator.prototype.toCSS = function (env) { - return { - '' : '', - ' ' : ' ', - '&' : '', - ':' : ' :', - '::': '::', - '+' : env.compress ? '+' : ' + ', - '~' : env.compress ? '~' : ' ~ ', - '>' : env.compress ? '>' : ' > ' - }[this.value]; -}; - -})(require('less/tree')); diff --git a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/expression.js b/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/expression.js deleted file mode 100644 index a356c242..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/expression.js +++ /dev/null @@ -1,21 +0,0 @@ -(function (tree) { - -tree.Expression = function (value) { this.value = value }; -tree.Expression.prototype = { - eval: function (env) { - if (this.value.length > 1) { - return new(tree.Expression)(this.value.map(function (e) { - return e.eval(env); - })); - } else { - return this.value[0].eval(env); - } - }, - toCSS: function () { - return this.value.map(function (e) { - return e.toCSS(); - }).join(' '); - } -}; - -})(require('less/tree')); diff --git a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/import.js b/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/import.js deleted file mode 100644 index 2a910656..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/import.js +++ /dev/null @@ -1,73 +0,0 @@ -(function (tree) { -// -// CSS @import node -// -// The general strategy here is that we don't want to wait -// for the parsing to be completed, before we start importing -// the file. That's because in the context of a browser, -// most of the time will be spent waiting for the server to respond. -// -// On creation, we push the import path to our import queue, though -// `import,push`, we also pass it a callback, which it'll call once -// the file has been fetched, and parsed. -// -tree.Import = function (path, imports) { - var that = this; - - this._path = path; - - // The '.less' extension is optional - if (path instanceof tree.Quoted) { - this.path = /\.(le?|c)ss$/.test(path.content) ? path.content : path.content + '.less'; - } else { - this.path = path.value.content || path.value; - } - - this.css = /css$/.test(this.path); - - // Only pre-compile .less files - if (! this.css) { - imports.push(this.path, function (root) { - if (! root) { - throw new(Error)("Error parsing " + that.path); - } - that.root = root; - }); - } -}; - -// -// The actual import node doesn't return anything, when converted to CSS. -// The reason is that it's used at the evaluation stage, so that the rules -// it imports can be treated like any other rules. -// -// In `eval`, we make sure all Import nodes get evaluated, recursively, so -// we end up with a flat structure, which can easily be imported in the parent -// ruleset. -// -tree.Import.prototype = { - toCSS: function () { - if (this.css) { - return "@import " + this._path.toCSS() + ';\n'; - } else { - return ""; - } - }, - eval: function () { - if (this.css) { - return this; - } else { - for (var i = 0; i < this.root.rules.length; i++) { - if (this.root.rules[i] instanceof tree.Import) { - Array.prototype - .splice - .apply(this.root.rules, - [i, 1].concat(this.root.rules[i].eval())); - } - } - return this.root.rules; - } - } -}; - -})(require('less/tree')); diff --git a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/keyword.js b/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/keyword.js deleted file mode 100644 index a4431ba3..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/keyword.js +++ /dev/null @@ -1,9 +0,0 @@ -(function (tree) { - -tree.Keyword = function (value) { this.value = value }; -tree.Keyword.prototype = { - eval: function () { return this }, - toCSS: function () { return this.value } -}; - -})(require('less/tree')); diff --git a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/mixin.js b/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/mixin.js deleted file mode 100644 index 11229b29..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/mixin.js +++ /dev/null @@ -1,98 +0,0 @@ -(function (tree) { - -tree.mixin = {}; -tree.mixin.Call = function (elements, args, index) { - this.selector = new(tree.Selector)(elements); - this.arguments = args; - this.index = index; -}; -tree.mixin.Call.prototype = { - eval: function (env) { - var mixins, rules = [], match = false; - - for (var i = 0; i < env.frames.length; i++) { - if ((mixins = env.frames[i].find(this.selector)).length > 0) { - for (var m = 0; m < mixins.length; m++) { - if (mixins[m].match(this.arguments, env)) { - try { - Array.prototype.push.apply( - rules, mixins[m].eval(this.arguments, env).rules); - match = true; - } catch (e) { - throw { message: e.message, index: e.index, call: this.index }; - } - } - } - if (match) { - return rules; - } else { - throw { message: 'No matching definition was found for `' + - this.selector.toCSS().trim() + '(' + - this.arguments.map(function (a) { - return a.toCSS(); - }).join(', ') + ")`", - index: this.index }; - } - } - } - throw { message: this.selector.toCSS().trim() + " is undefined", - index: this.index }; - } -}; - -tree.mixin.Definition = function (name, params, rules) { - this.name = name; - this.selectors = [new(tree.Selector)([new(tree.Element)(null, name)])]; - this.params = params; - this.arity = params.length; - this.rules = rules; - this._lookups = {}; - this.required = params.reduce(function (count, p) { - if (p.name && !p.value) { return count + 1 } - else { return count } - }, 0); - this.parent = tree.Ruleset.prototype; -}; -tree.mixin.Definition.prototype = { - toCSS: function () { return "" }, - variable: function (name) { return this.parent.variable.call(this, name) }, - find: function () { return this.parent.find.apply(this, arguments) }, - rulesets: function () { return this.parent.rulesets.apply(this) }, - - eval: function (args, env) { - var frame = new(tree.Ruleset)(null, []), context; - - for (var i = 0, val; i < this.params.length; i++) { - if (this.params[i].name) { - if (val = (args && args[i]) || this.params[i].value) { - frame.rules.unshift(new(tree.Rule)(this.params[i].name, val.eval(env))); - } else { - throw { message: "wrong number of arguments for " + this.name + - ' (' + args.length + ' for ' + this.arity + ')' }; - } - } - } - return new(tree.Ruleset)(null, this.rules).evalRules({ - frames: [this, frame].concat(env.frames) - }); - }, - match: function (args, env) { - var argsLength = (args && args.length) || 0; - - if (argsLength < this.required) { - return false; - } - - for (var i = 0; i < Math.min(argsLength, this.arity); i++) { - if (!this.params[i].name) { - if (args[i].wildcard) { continue } - else if (args[i].eval(env).toCSS() != this.params[i].value.eval(env).toCSS()) { - return false; - } - } - } - return true; - } -}; - -})(require('less/tree')); diff --git a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/operation.js b/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/operation.js deleted file mode 100644 index d2e4d578..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/operation.js +++ /dev/null @@ -1,32 +0,0 @@ -(function (tree) { - -tree.Operation = function (op, operands) { - this.op = op.trim(); - this.operands = operands; -}; -tree.Operation.prototype.eval = function (env) { - var a = this.operands[0].eval(env), - b = this.operands[1].eval(env), - temp; - - if (a instanceof tree.Dimension && b instanceof tree.Color) { - if (this.op === '*' || this.op === '+') { - temp = b, b = a, a = temp; - } else { - throw { name: "OperationError", - message: "Can't substract or divide a color from a number" }; - } - } - return a.operate(this.op, b); -}; - -tree.operate = function (op, a, b) { - switch (op) { - case '+': return a + b; - case '-': return a - b; - case '*': return a * b; - case '/': return a / b; - } -}; - -})(require('less/tree')); diff --git a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/quoted.js b/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/quoted.js deleted file mode 100644 index f415da09..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/quoted.js +++ /dev/null @@ -1,16 +0,0 @@ -(function (tree) { - -tree.Quoted = function (value, content) { - this.value = value; - this.content = content; -}; -tree.Quoted.prototype = { - toCSS: function () { - return this.value; - }, - eval: function () { - return this; - } -}; - -})(require('less/tree')); diff --git a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/rule.js b/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/rule.js deleted file mode 100644 index 9b9f6b93..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/rule.js +++ /dev/null @@ -1,35 +0,0 @@ -(function (tree) { - -tree.Rule = function (name, value, index) { - this.name = name; - this.value = (value instanceof tree.Value) ? value : new(tree.Value)([value]); - this.index = index; - - if (name.charAt(0) === '@') { - this.variable = true; - } else { this.variable = false } -}; -tree.Rule.prototype.toCSS = function (env) { - if (this.variable) { return "" } - else { - return this.name + (env.compress ? ':' : ': ') + this.value.toCSS(env) + ";"; - } -}; - -tree.Rule.prototype.eval = function (context) { - return new(tree.Rule)(this.name, this.value.eval(context)); -}; - -tree.Shorthand = function (a, b) { - this.a = a; - this.b = b; -}; - -tree.Shorthand.prototype = { - toCSS: function (env) { - return this.a.toCSS(env) + "/" + this.b.toCSS(env); - }, - eval: function () { return this } -}; - -})(require('less/tree')); diff --git a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/ruleset.js b/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/ruleset.js deleted file mode 100644 index 51323e5a..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/ruleset.js +++ /dev/null @@ -1,167 +0,0 @@ -(function (tree) { - -tree.Ruleset = function (selectors, rules) { - this.selectors = selectors; - this.rules = rules; - this._lookups = {}; -}; -tree.Ruleset.prototype = { - eval: function () { return this }, - evalRules: function (context) { - var rules = []; - - this.rules.forEach(function (rule) { - if (rule.evalRules) { - rules.push(rule.evalRules(context)); - } else if (rule instanceof tree.mixin.Call) { - Array.prototype.push.apply(rules, rule.eval(context)); - } else { - rules.push(rule.eval ? rule.eval(context) : ''); - } - }); - this.rules = rules; - return this; - }, - match: function (args) { - return !args || args.length === 0; - }, - variable: function (name) { - if (this._variables) { return this._variables[name] } - else { - return (this._variables = this.rules.reduce(function (hash, r) { - if (r instanceof tree.Rule && r.variable === true) { - hash[r.name] = r; - } - return hash; - }, {}))[name]; - } - }, - rulesets: function () { - if (this._rulesets) { return this._rulesets } - else { - return this._rulesets = this.rules.filter(function (r) { - if (r instanceof tree.Ruleset || r instanceof tree.mixin.Definition) { return r } - }); - } - }, - find: function (selector, self) { - self = self || this; - var rules = [], rule, match, - key = selector.toCSS(); - - if (key in this._lookups) { return this._lookups[key] } - - this.rulesets().forEach(function (rule) { - if (rule !== self) { - for (var j = 0; j < rule.selectors.length; j++) { - if (match = selector.match(rule.selectors[j])) { - if (selector.elements.length > 1) { - Array.prototype.push.apply(rules, rule.find( - new(tree.Selector)(selector.elements.slice(1)), self)); - } else { - rules.push(rule); - } - break; - } - } - } - }); - return this._lookups[key] = rules; - }, - // - // Entry point for code generation - // - // `context` holds an array of arrays. - // - toCSS: function (context, env) { - var css = [], // The CSS output - rules = [], // node.Rule instances - rulesets = [], // node.Ruleset instances - paths = [], // Current selectors - selector, // The fully rendered selector - rule; - - if (! this.root) { - if (context.length === 0) { - paths = this.selectors.map(function (s) { return [s] }); - } else { - for (var s = 0; s < this.selectors.length; s++) { - for (var c = 0; c < context.length; c++) { - paths.push(context[c].concat([this.selectors[s]])); - } - } - } - } else { - for (var i = 0; i < this.rules.length; i++) { - if (this.rules[i] instanceof tree.Import) { - Array.prototype.splice - .apply(this.rules, [i, 1].concat(this.rules[i].eval(env))); - } - } - } - - // push the current ruleset to the frames stack - env.frames.unshift(this); - - // Evaluate mixins - for (var i = 0; i < this.rules.length; i++) { - if (this.rules[i] instanceof tree.mixin.Call) { - Array.prototype.splice - .apply(this.rules, [i, 1].concat(this.rules[i].eval(env))); - } - } - - // Evaluate rules and rulesets - for (var i = 0; i < this.rules.length; i++) { - rule = this.rules[i]; - - if (rule instanceof tree.Directive) { - rulesets.push(rule.eval(env).toCSS(paths, env)); - } else if (rule.rules) { - rulesets.push(rule.toCSS(paths, env)); - } else if (rule instanceof tree.Comment) { - if (!rule.silent) { - if (this.root) { - rulesets.push(rule.toCSS(env)); - } else { - rules.push(rule.toCSS(env)); - } - } - } else { - if (rule.toCSS && !rule.variable) { - rules.push(rule.eval(env).toCSS(env)); - } else if (rule.value && !rule.variable) { - rules.push(rule.value.toString()); - } - } - } - - rulesets = rulesets.join(''); - - // If this is the root node, we don't render - // a selector, or {}. - // Otherwise, only output if this ruleset has rules. - if (this.root) { - css.push(rules.join(env.compress ? '' : '\n')); - } else { - if (rules.length > 0) { - selector = paths.map(function (p) { - return p.map(function (s) { - return s.toCSS(env); - }).join('').trim(); - }).join(env.compress ? ',' : (paths.length > 3 ? ',\n' : ', ')); - css.push(selector, - (env.compress ? '{' : ' {\n ') + - rules.join(env.compress ? '' : '\n ') + - (env.compress ? '}' : '\n}\n')); - } - } - css.push(rulesets); - - // Pop the stack - env.frames.shift(); - - return css.join('') + (env.compress ? '\n' : ''); - } -}; -})(require('less/tree')); diff --git a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/selector.js b/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/selector.js deleted file mode 100644 index eaaa0423..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/selector.js +++ /dev/null @@ -1,28 +0,0 @@ -(function (tree) { - -tree.Selector = function (elements) { - this.elements = elements; - if (this.elements[0].combinator.value === "") { - this.elements[0].combinator.value = ' '; - } -}; -tree.Selector.prototype.match = function (other) { - if (this.elements[0].value === other.elements[0].value) { - return true; - } else { - return false; - } -}; -tree.Selector.prototype.toCSS = function (env) { - if (this._css) { return this._css } - - return this._css = this.elements.map(function (e) { - if (typeof(e) === 'string') { - return ' ' + e.trim(); - } else { - return e.toCSS(env); - } - }).join(''); -}; - -})(require('less/tree')); diff --git a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/url.js b/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/url.js deleted file mode 100644 index 6ad97dc6..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/url.js +++ /dev/null @@ -1,13 +0,0 @@ -(function (tree) { - -tree.URL = function (val) { - this.value = val; -}; -tree.URL.prototype = { - toCSS: function () { - return "url(" + this.value.toCSS() + ")"; - }, - eval: function () { return this } -}; - -})(require('less/tree')); diff --git a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/value.js b/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/value.js deleted file mode 100644 index 922096cd..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/value.js +++ /dev/null @@ -1,24 +0,0 @@ -(function (tree) { - -tree.Value = function (value) { - this.value = value; - this.is = 'value'; -}; -tree.Value.prototype = { - eval: function (env) { - if (this.value.length === 1) { - return this.value[0].eval(env); - } else { - return new(tree.Value)(this.value.map(function (v) { - return v.eval(env); - })); - } - }, - toCSS: function (env) { - return this.value.map(function (e) { - return e.toCSS(env); - }).join(env.compress ? ',' : ', '); - } -}; - -})(require('less/tree')); diff --git a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/variable.js b/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/variable.js deleted file mode 100644 index 010761db..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/lib/less/tree/variable.js +++ /dev/null @@ -1,20 +0,0 @@ -(function (tree) { - -tree.Variable = function (name, index) { this.name = name, this.index = index }; -tree.Variable.prototype = { - eval: function (env) { - var variable, v, name = this.name; - - if (variable = tree.find(env.frames, function (frame) { - if (v = frame.variable(name)) { - return v.value.eval(env); - } - })) { return variable } - else { - throw { message: "variable " + this.name + " is undefined", - index: this.index }; - } - } -}; - -})(require('less/tree')); diff --git a/deps/.npm/connect/0.2.5/package/support/less/package.json b/deps/.npm/connect/0.2.5/package/support/less/package.json deleted file mode 100644 index 1943dcf2..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name" : "less", - "description" : "Leaner CSS", - "url" : "http://lesscss.org", - "keywords" : ["css", "parser", "lesscss", "browser"], - "author" : "Alexis Sellier ", - "contributors" : [], - "version" : "1.0.21", - "bin" : { "lessc": "./bin/lessc" }, - "main" : "./lib/less/index", - "directories" : { "lib": "./lib/less", "test": "./test" }, - "engines" : { "node": ">=0.1.93" } -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/css/colors.css b/deps/.npm/connect/0.2.5/package/support/less/test/css/colors.css deleted file mode 100644 index 373781df..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/css/colors.css +++ /dev/null @@ -1,42 +0,0 @@ -#yelow #short { - color: #fea; -} -#yelow #long { - color: #ffeeaa; -} -#yelow #rgba { - color: rgba(255, 238, 170, 0.1); -} -#blue #short { - color: #00f; -} -#blue #long { - color: #0000ff; -} -#blue #rgba { - color: rgba(0, 0, 255, 0.1); -} -#alpha #hsla { - color: rgba(61, 45, 41, 0.6); -} -#overflow .a { - color: #000000; -} -#overflow .b { - color: #ffffff; -} -#overflow .c { - color: #ffffff; -} -#overflow .d { - color: #00ff00; -} -#grey { - color: #c8c8c8; -} -#808080 { - color: #808080; -} -#00ff00 { - color: #00ff00; -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/css/comments.css b/deps/.npm/connect/0.2.5/package/support/less/test/css/comments.css deleted file mode 100644 index e7bfb8db..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/css/comments.css +++ /dev/null @@ -1,49 +0,0 @@ -/******************\ -* * -* Comment Header * -* * -\******************/ -/* - - Comment - -*/ -/* - * Comment Test - * - * - cloudhead (http://cloudhead.net) - * - */ -/* Colors - * ------ - * #EDF8FC (background blue) - * #166C89 (darkest blue) - * - * Text: - * #333 (standard text) // A comment within a comment! - * #1F9EC9 (standard link) - * - */ -/* @group Variables -------------------- */ -#comments { - /**/ - color: red; - /* A C-style comment */ - - background-color: orange; - font-size: 12px; - /* lost comment */ - content: "content"; - border: 1px solid black; - padding: 0; - margin: 2em; -} -/* commented out - #more-comments { - color: grey; - } -*/ -#last { - color: blue; -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/css/css-3.css b/deps/.npm/connect/0.2.5/package/support/less/test/css/css-3.css deleted file mode 100644 index 81a3535d..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/css/css-3.css +++ /dev/null @@ -1,42 +0,0 @@ -.comma-delimited { - background: url(bg.jpg) no-repeat, url(bg.png) repeat-x top left, url(bg); - text-shadow: -1px -1px 1px red, 6px 5px 5px yellow; - -moz-box-shadow: 0pt 0pt 2px rgba(255, 255, 255, 0.4) inset, 0pt 4px 6px rgba(255, 255, 255, 0.4) inset; -} -@font-face { - font-family: Headline; - src: local(Futura-Medium), url(fonts.svg#MyGeometricModern) format("svg"); -} -.other { - -moz-transform: translate(0, 11em) rotate(-90deg); -} -p:not([class*="lead"]) { - color: black; -} -input[type="text"].class#id[attr=32]:not(1) { - color: white; -} -div#id.class[a=1][b=2].class:not(1) { - color: white; -} -ul.comma > li:not(:only-child)::after { - color: white; -} -ol.comma > li:nth-last-child(2)::after { - color: white; -} -li:nth-child(4n+1), li:nth-child(-5n), li:nth-child(-n+2) { - color: white; -} -a[href^="http://"] { - color: black; -} -a[href$="http://"] { - color: black; -} -form[data-disabled] { - color: black; -} -p::before { - color: black; -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/css/css.css b/deps/.npm/connect/0.2.5/package/support/less/test/css/css.css deleted file mode 100644 index 31249547..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/css/css.css +++ /dev/null @@ -1,73 +0,0 @@ -@charset "utf-8"; -div { - color: black; -} -div { - width: 99%; -} -* { - min-width: 45em; -} -h1, h2 > a > p, h3 { - color: none; -} -div.class { - color: blue; -} -div#id { - color: green; -} -.class#id { - color: purple; -} -.one.two.three { - color: grey; -} -@media print { - font-size: 3em; -} -@media screen { - font-size: 10px; -} -@font-face { - font-family: 'Garamond Pro'; - src: url("/fonts/garamond-pro.ttf"); -} -a:hover, a:link { - color: #999; -} -p, p:first-child { - text-transform: none; -} -q:lang(no) { - quotes: none; -} -p + h1 { - font-size: 2.2em; -} -#shorthands { - border: 1px solid #000; - font: 12px/16px Arial; - margin: 1px 0; - padding: 0 auto; - background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px; -} -#more-shorthands { - margin: 0; - padding: 1px 0 2px 0; - font: normal small/20px 'Trebuchet MS', Verdana, sans-serif; -} -.misc { - -moz-border-radius: 2px; - display: -moz-inline-stack; - width: .1em; - background-color: #009998; - background-image: url(images/image.jpg); - background: -webkit-gradient(linear, left top, left bottom, from(red), to(blue)); - margin: ; -} -#important { - color: red !important; - width: 100%!important; - height: 20px ! important; -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/css/functions.css b/deps/.npm/connect/0.2.5/package/support/less/test/css/functions.css deleted file mode 100644 index fc839179..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/css/functions.css +++ /dev/null @@ -1,26 +0,0 @@ -#functions { - color: #660000; - width: 16; - height: undefined("self"); - border-width: 5; - variable: 11; -} -#built-in { - escaped: -Some::weird(#thing, y); - lighten: #ffcccc; - darken: #330000; - saturate: #203c31; - desaturate: #29332f; - greyscale: #2e2e2e; - spin-p: #bf6a40; - spin-n: #bf4055; - format: "rgb(32, 128, 64)"; - format-string: "hello world"; - eformat: rgb(32, 128, 64); - hue: 98; - saturation: 12%; - lightness: 95%; -} -#alpha { - alpha: rgba(153, 94, 51, 0.6); -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/css/import.css b/deps/.npm/connect/0.2.5/package/support/less/test/css/import.css deleted file mode 100644 index 378beb3b..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/css/import.css +++ /dev/null @@ -1,14 +0,0 @@ -@import "import-test-d.css"; -#import { - color: red; -} -.mixin { - height: 10px; - color: red; -} -#import-test { - height: 10px; - color: red; - width: 10px; - height: 30%; -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/css/lazy-eval.css b/deps/.npm/connect/0.2.5/package/support/less/test/css/lazy-eval.css deleted file mode 100644 index 1adfb8f3..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/css/lazy-eval.css +++ /dev/null @@ -1,3 +0,0 @@ -.lazy-eval { - width: 100%; -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/css/media.css b/deps/.npm/connect/0.2.5/package/support/less/test/css/media.css deleted file mode 100644 index 01539f60..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/css/media.css +++ /dev/null @@ -1,16 +0,0 @@ -@media print { - .class { - color: blue; - } - .class .sub { - width: 42; - } - .top, header > h1 { - color: #444444; - } -} -@media screen { - body { - max-width: 480; - } -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/css/mixins-args.css b/deps/.npm/connect/0.2.5/package/support/less/test/css/mixins-args.css deleted file mode 100644 index 27f4ac84..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/css/mixins-args.css +++ /dev/null @@ -1,51 +0,0 @@ -#hidden { - color: transparent; - color: transparent; -} -.two-args { - color: blue; - width: 10px; - height: 99%; - border: 2px dotted black; -} -.one-arg { - width: 15px; - height: 49%; -} -.no-parens { - width: 5px; - height: 49%; -} -.no-args { - width: 5px; - height: 49%; -} -.var-args { - width: 45; - height: 17%; -} -.multi-mix { - width: 10px; - height: 29%; - margin: 4; - padding: 5; -} -body { - padding: 30px; - color: #ff0000; -} -.scope-mix { - width: 8; -} -.content { - width: 600px; -} -.content .column { - margin: 600px; -} -#same-var-name { - radius: 5px; -} -#var-inside { - width: 10px; -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/css/mixins-nested.css b/deps/.npm/connect/0.2.5/package/support/less/test/css/mixins-nested.css deleted file mode 100644 index 048e2a01..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/css/mixins-nested.css +++ /dev/null @@ -1,7 +0,0 @@ -.class .inner { - height: 300; -} -.class .inner .innest { - width: 30; - border-width: 60; -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/css/mixins-pattern.css b/deps/.npm/connect/0.2.5/package/support/less/test/css/mixins-pattern.css deleted file mode 100644 index 2d68bfa9..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/css/mixins-pattern.css +++ /dev/null @@ -1,55 +0,0 @@ -.zero { - zero: 0; - one: 1; - two: 2; - three: 3; -} -.one { - zero: 0; - one: 1; - one-req: 1; - two: 2; - three: 3; -} -.two { - zero: 0; - one: 1; - one-req: 1; - two: 2; - three: 3; -} -.three { - zero: 0; - one: 1; - one-req: 1; - two: 2; - three-req: 3; - three: 3; -} -.left { - left: 1; -} -.right { - right: 1; -} -.border-right { - color: black; - border-right: 4px; -} -.border-left { - color: black; - border-left: 4px; -} -.only-right { - both: 330; - right: 33; -} -.only-left { - both: 330; - left: 33; -} -.left-right { - both: 330; - left: 33; - right: 33; -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/css/mixins.css b/deps/.npm/connect/0.2.5/package/support/less/test/css/mixins.css deleted file mode 100644 index 15f4c5f2..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/css/mixins.css +++ /dev/null @@ -1,50 +0,0 @@ -.mixin { - border: 1px solid black; -} -.mixout { - border-color: orange; -} -.borders { - border-style: dashed; -} -#namespace .borders { - border-style: dotted; -} -#namespace .biohazard { - content: "death"; -} -#namespace .biohazard .man { - color: transparent; -} -#theme > .mixin { - background-color: grey; -} -#container { - color: black; - border: 1px solid black; - border-color: orange; - background-color: grey; -} -#header .milk { - color: white; - border: 1px solid black; - background-color: grey; -} -#header #cookie { - border-style: dashed; -} -#header #cookie .chips { - border-style: dotted; -} -#header #cookie .chips .calories { - color: black; - border: 1px solid black; - border-color: orange; - background-color: grey; -} -.secure-zone { - color: transparent; -} -.direct { - border-style: dotted; -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/css/operations.css b/deps/.npm/connect/0.2.5/package/support/less/test/css/operations.css deleted file mode 100644 index c4c0e642..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/css/operations.css +++ /dev/null @@ -1,32 +0,0 @@ -#operations { - color: #111111; - height: 9px; - width: 3em; - substraction: 0; - division: 1; -} -#operations .spacing { - height: 9px; - width: 3em; -} -.with-variables { - height: 16em; - width: 24em; - size: 1cm; -} -.negative { - height: 0px; - width: 4px; -} -.shorthands { - padding: -1px 2px 0 -4px; -} -.colors { - color: #123; - border-color: #334455; - background-color: #000000; -} -.colors .other { - color: #222222; - border-color: #222222; -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/css/parens.css b/deps/.npm/connect/0.2.5/package/support/less/test/css/parens.css deleted file mode 100644 index 209255f7..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/css/parens.css +++ /dev/null @@ -1,20 +0,0 @@ -.parens { - border: 2px solid black; - margin: 1px 3px 16 3; - width: 36; - padding: 2px 36px; -} -.more-parens { - padding: 8 4 4 4px; - width: 96; - height: 113; - margin: 12; -} -.nested-parens { - width: 71; - height: 6; -} -.mixed-units { - margin: 2px 4em 1 5pc; - padding: 6px 1em 2px 2; -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/css/rulesets.css b/deps/.npm/connect/0.2.5/package/support/less/test/css/rulesets.css deleted file mode 100644 index 3e73bc0c..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/css/rulesets.css +++ /dev/null @@ -1,29 +0,0 @@ -#first > .one { - font-size: 2em; -} -#first > .one > #second .two > #deux { - width: 50%; -} -#first > .one > #second .two > #deux #third { - height: 100%; -} -#first > .one > #second .two > #deux #third:focus { - color: black; -} -#first > .one > #second .two > #deux #third:focus #fifth > #sixth .seventh #eighth + #ninth { - color: purple; -} -#first > .one > #second .two > #deux #fourth, #first > .one > #second .two > #deux #five, #first > .one > #second .two > #deux #six { - color: #110000; -} -#first > .one > #second .two > #deux #fourth .seven, -#first > .one > #second .two > #deux #five .seven, -#first > .one > #second .two > #deux #six .seven, -#first > .one > #second .two > #deux #fourth .eight > #nine, -#first > .one > #second .two > #deux #five .eight > #nine, -#first > .one > #second .two > #deux #six .eight > #nine { - border: 1px solid black; -} -#first > .one > #second .two > #deux #fourth #ten, #first > .one > #second .two > #deux #five #ten, #first > .one > #second .two > #deux #six #ten { - color: red; -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/css/scope.css b/deps/.npm/connect/0.2.5/package/support/less/test/css/scope.css deleted file mode 100644 index 926bfc58..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/css/scope.css +++ /dev/null @@ -1,15 +0,0 @@ -.tiny-scope { - color: #998899; -} -.scope1 { - color: blue; - border-color: black; -} -.scope1 .scope2 { - color: blue; -} -.scope1 .scope2 .scope3 { - color: red; - border-color: black; - background-color: white; -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/css/selectors.css b/deps/.npm/connect/0.2.5/package/support/less/test/css/selectors.css deleted file mode 100644 index 85916c35..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/css/selectors.css +++ /dev/null @@ -1,32 +0,0 @@ -h1 a:hover, -h2 a:hover, -h3 a:hover, -h1 p:hover, -h2 p:hover, -h3 p:hover { - color: red; -} -#all { - color: blue; -} -#the { - color: blue; -} -#same { - color: blue; -} -ul, -li, -div, -q, -blockquote, -textarea { - margin: 0; -} -td { - margin: 0; - padding: 0; -} -td, input { - line-height: 1em; -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/css/strings.css b/deps/.npm/connect/0.2.5/package/support/less/test/css/strings.css deleted file mode 100644 index 61c1f2c2..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/css/strings.css +++ /dev/null @@ -1,15 +0,0 @@ -#strings { - background-image: url("http://son-of-a-banana.com"); - quotes: "~" "~"; - content: "#*%:&^,)!.(~*})"; - empty: ""; - brackets: "{" "}"; -} -#comments { - content: "/* hello */ // not-so-secret"; -} -#single-quote { - quotes: "'" "'"; - content: '""#!&""'; - empty: ''; -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/css/variables.css b/deps/.npm/connect/0.2.5/package/support/less/test/css/variables.css deleted file mode 100644 index 6be99d34..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/css/variables.css +++ /dev/null @@ -1,15 +0,0 @@ -.variables { - width: 14cm; -} -.variables { - height: 24px; - color: #888888; - font-family: "Trebuchet MS", Verdana, sans-serif; - quotes: "~" "~"; -} -.redefinition { - three: 3; -} -.values { - font-family: 'Trebuchet', 'Trebuchet', 'Trebuchet'; -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/css/whitespace.css b/deps/.npm/connect/0.2.5/package/support/less/test/css/whitespace.css deleted file mode 100644 index d40d2fe0..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/css/whitespace.css +++ /dev/null @@ -1,36 +0,0 @@ -.whitespace { - color: white; -} -.whitespace { - color: white; -} -.whitespace { - color: white; -} -.whitespace { - color: white; -} -.whitespace { - color: white ; -} -.white, .space, .mania { - color: white; -} -.no-semi-column { - color: white; -} -.no-semi-column { - color: white; - white-space: pre; -} -.no-semi-column { - border: 2px solid white; -} -.newlines { - background: the, - great, - wall; - border: 2px - solid - black; -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/less-test.js b/deps/.npm/connect/0.2.5/package/support/less/test/less-test.js deleted file mode 100644 index 948fc492..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/less-test.js +++ /dev/null @@ -1,88 +0,0 @@ -var path = require('path'), - fs = require('fs'), - sys = require('sys'); - -require.paths.unshift(__dirname, path.join(__dirname, '..')); - -var less = require('lib/less'); - -less.tree.functions.add = function (a, b) { - return new(less.tree.Dimension)(a.value + b.value); -} -less.tree.functions.increment = function (a) { - return new(less.tree.Dimension)(a.value + 1); -} -less.tree.functions.color = function (str) { - if (str.content === "evil red") { return new(less.tree.Color)("600") } -} - -sys.puts("\n" + stylize("LESS", 'underline') + "\n"); - -fs.readdirSync('test/less').forEach(function (file) { - if (! /\.less/.test(file)) { return } - - toCSS('test/less/' + file, function (err, less) { - var name = path.basename(file, '.less'); - - read(path.join('test/css', name) + '.css', function (e, css) { - sys.print("- " + name + ": ") - if (less === css) { sys.print(stylize('OK', 'green')) } - else if (err) { - sys.print(stylize("ERROR: " + (err && err.message), 'red')); - } else { - sys.print(stylize("FAIL", 'yellow')); - } - sys.puts(""); - }); - }); -}); - -function toCSS(path, callback) { - var tree, css; - read(path, function (e, str) { - if (e) { return callback(e) } - - new(less.Parser)({ - paths: [require('path').dirname(path)], - optimization: 0 - }).parse(str, function (err, tree) { - if (err) { - callback(err); - } else { - try { - css = tree.toCSS(); - callback(null, css); - } catch (e) { - callback(e); - } - } - }); - }); -} - -function read(path, callback) { - fs.stat(path, function (e, stats) { - if (e) return callback(e); - fs.open(path, process.O_RDONLY, stats.mode, function (e, fd) { - if (e) return callback(e); - fs.read(fd, stats.size, 0, "utf8", function (e, data) { - if (e) return callback(e); - callback(null, data); - }); - }); - }); -} - -// Stylize a string -function stylize(str, style) { - var styles = { - 'bold' : [1, 22], - 'inverse' : [7, 27], - 'underline' : [4, 24], - 'yellow' : [33, 39], - 'green' : [32, 39], - 'red' : [31, 39] - }; - return '\033[' + styles[style][0] + 'm' + str + - '\033[' + styles[style][1] + 'm'; -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/less/colors.less b/deps/.npm/connect/0.2.5/package/support/less/test/less/colors.less deleted file mode 100644 index 5c90bcbb..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/less/colors.less +++ /dev/null @@ -1,46 +0,0 @@ -#yelow { - #short { - color: #fea; - } - #long { - color: #ffeeaa; - } - #rgba { - color: rgba(255, 238, 170, 0.1); - } -} - -#blue { - #short { - color: #00f; - } - #long { - color: #0000ff; - } - #rgba { - color: rgba(0, 0, 255, 0.1); - } -} - -#alpha #hsla { - color: hsla(11, 20%, 20%, 0.6); -} - -#overflow { - .a { color: #111111 - #444444; } // #000000 - .b { color: #eee + #fff; } // #ffffff - .c { color: #aaa * 3; } // #ffffff - .d { color: #00ee00 + #009900; } // #00ff00 -} - -#grey { - color: rgb(200, 200, 200); -} - -#808080 { - color: hsl(50, 0%, 50%); -} - -#00ff00 { - color: hsl(120, 100%, 50%); -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/less/comments.less b/deps/.npm/connect/0.2.5/package/support/less/test/less/comments.less deleted file mode 100644 index 2a560c64..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/less/comments.less +++ /dev/null @@ -1,59 +0,0 @@ -/******************\ -* * -* Comment Header * -* * -\******************/ - -/* - - Comment - -*/ - -/* - * Comment Test - * - * - cloudhead (http://cloudhead.net) - * - */ - -//////////////// -@var: "content"; -//////////////// - -/* Colors - * ------ - * #EDF8FC (background blue) - * #166C89 (darkest blue) - * - * Text: - * #333 (standard text) // A comment within a comment! - * #1F9EC9 (standard link) - * - */ - -/* @group Variables -------------------- */ -#comments /* boo */ { - /**/ // An empty comment - color: red; /* A C-style comment */ - background-color: orange; // A little comment - font-size: 12px; - - /* lost comment */ content: @var; - - border: 1px solid black; - - // padding & margin // - padding: 0; - margin: 2em; -} // - -/* commented out - #more-comments { - color: grey; - } -*/ - -#last { color: blue } -// diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/less/css-3.less b/deps/.npm/connect/0.2.5/package/support/less/test/less/css-3.less deleted file mode 100644 index f6959d5f..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/less/css-3.less +++ /dev/null @@ -1,55 +0,0 @@ -.comma-delimited { - background: url(bg.jpg) no-repeat, url(bg.png) repeat-x top left, url(bg); - text-shadow: -1px -1px 1px red, 6px 5px 5px yellow; - -moz-box-shadow: 0pt 0pt 2px rgba(255, 255, 255, 0.4) inset, - 0pt 4px 6px rgba(255, 255, 255, 0.4) inset; -} -@font-face { - font-family: Headline; - src: local(Futura-Medium), - url(fonts.svg#MyGeometricModern) format("svg"); -} -.other { - -moz-transform: translate(0, 11em) rotate(-90deg); -} -p:not([class*="lead"]) { - color: black; -} - -input[type="text"].class#id[attr=32]:not(1) { - color: white; -} - -div#id.class[a=1][b=2].class:not(1) { - color: white; -} - -ul.comma > li:not(:only-child)::after { - color: white; -} - -ol.comma > li:nth-last-child(2)::after { - color: white; -} - -li:nth-child(4n+1), -li:nth-child(-5n), -li:nth-child(-n+2) { - color: white; -} - -a[href^="http://"] { - color: black; -} - -a[href$="http://"] { - color: black; -} - -form[data-disabled] { - color: black; -} - -p::before { - color: black; -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/less/css.less b/deps/.npm/connect/0.2.5/package/support/less/test/less/css.less deleted file mode 100644 index 01489715..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/less/css.less +++ /dev/null @@ -1,87 +0,0 @@ -@charset "utf-8"; -div { color: black; } -div { width: 99%; } - -* { - min-width: 45em; -} - -h1, h2 > a > p, h3 { - color: none; -} - -div.class { - color: blue; -} - -div#id { - color: green; -} - -.class#id { - color: purple; -} - -.one.two.three { - color: grey; -} - -@media print { - font-size: 3em; -} - -@media screen { - font-size: 10px; -} - -@font-face { - font-family: 'Garamond Pro'; - src: url("/fonts/garamond-pro.ttf"); -} - -a:hover, a:link { - color: #999; -} - -p, p:first-child { - text-transform: none; -} - -q:lang(no) { - quotes: none; -} - -p + h1 { - font-size: 2.2em; -} - -#shorthands { - border: 1px solid #000; - font: 12px/16px Arial; - margin: 1px 0; - padding: 0 auto; - background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px; -} - -#more-shorthands { - margin: 0; - padding: 1px 0 2px 0; - font: normal small/20px 'Trebuchet MS', Verdana, sans-serif; -} - -.misc { - -moz-border-radius: 2px; - display: -moz-inline-stack; - width: .1em; - background-color: #009998; - background-image: url(images/image.jpg); - background: -webkit-gradient(linear, left top, left bottom, from(red), to(blue)); - margin: ; -} - -#important { - color: red !important; - width: 100%!important; - height: 20px ! important; -} - diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/less/functions.less b/deps/.npm/connect/0.2.5/package/support/less/test/less/functions.less deleted file mode 100644 index 1e67aeb5..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/less/functions.less +++ /dev/null @@ -1,31 +0,0 @@ -#functions { - @var: 10; - color: color("evil red"); // #660000 - width: increment(15); - height: undefined("self"); - border-width: add(2, 3); - variable: increment(@var); -} - -#built-in { - @r: 32; - escaped: e("-Some::weird(#thing, y)"); - lighten: lighten(#ff0000, 40%); - darken: darken(#ff0000, 40%); - saturate: saturate(#29332f, 20%); - desaturate: desaturate(#203c31, 20%); - greyscale: greyscale(#203c31); - spin-p: spin(hsl(340, 50%, 50%), 40); - spin-n: spin(hsl(30, 50%, 50%), -40); - format: %("rgb(%d, %d, %d)", @r, 128, 64); - format-string: %("hello %s", "world"); - eformat: e(%("rgb(%d, %d, %d)", @r, 128, 64)); - - hue: hue(hsl(98, 12%, 95%)); - saturation: saturation(hsl(98, 12%, 95%)); - lightness: lightness(hsl(98, 12%, 95%)); -} - -#alpha { - alpha: darken(hsla(25, 50%, 50%, 0.6), 10%); -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/less/import.less b/deps/.npm/connect/0.2.5/package/support/less/test/less/import.less deleted file mode 100644 index 08ad52c4..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/less/import.less +++ /dev/null @@ -1,8 +0,0 @@ -@import url("import/import-test-a.less"); -//@import url("import/import-test-a.less"); - -#import-test { - .mixin; - width: 10px; - height: @a + 10%; -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/less/import/import-test-a.less b/deps/.npm/connect/0.2.5/package/support/less/test/less/import/import-test-a.less deleted file mode 100644 index 7409d071..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/less/import/import-test-a.less +++ /dev/null @@ -1,2 +0,0 @@ -@import "import-test-b.less"; -@a: 20%; diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/less/import/import-test-b.less b/deps/.npm/connect/0.2.5/package/support/less/test/less/import/import-test-b.less deleted file mode 100644 index ce2d35a8..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/less/import/import-test-b.less +++ /dev/null @@ -1,8 +0,0 @@ -@import "import-test-c"; - -@b: 100%; - -.mixin { - height: 10px; - color: @c; -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/less/import/import-test-c.less b/deps/.npm/connect/0.2.5/package/support/less/test/less/import/import-test-c.less deleted file mode 100644 index 111266ba..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/less/import/import-test-c.less +++ /dev/null @@ -1,7 +0,0 @@ - -@import "import-test-d.css"; -@c: red; - -#import { - color: @c; -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/less/import/import-test-d.css b/deps/.npm/connect/0.2.5/package/support/less/test/less/import/import-test-d.css deleted file mode 100644 index 30575f01..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/less/import/import-test-d.css +++ /dev/null @@ -1 +0,0 @@ -#css { color: yellow; } diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/less/lazy-eval.less b/deps/.npm/connect/0.2.5/package/support/less/test/less/lazy-eval.less deleted file mode 100644 index 72b3fd46..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/less/lazy-eval.less +++ /dev/null @@ -1,6 +0,0 @@ -@var: @a; -@a: 100%; - -.lazy-eval { - width: @var; -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/less/media.less b/deps/.npm/connect/0.2.5/package/support/less/test/less/media.less deleted file mode 100644 index ccfcbbdc..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/less/media.less +++ /dev/null @@ -1,21 +0,0 @@ - -// For now, variables can't be declared inside @media blocks. - -@var: 42; - -@media print { - .class { - color: blue; - .sub { - width: @var; - } - } - .top, header > h1 { - color: #222 * 2; - } -} - -@media screen { - @base: 8; - body { max-width: @base * 60; } -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/less/mixins-args.less b/deps/.npm/connect/0.2.5/package/support/less/test/less/mixins-args.less deleted file mode 100644 index 382d2374..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/less/mixins-args.less +++ /dev/null @@ -1,97 +0,0 @@ -.mixin (@a: 1px, @b: 50%) { - width: @a * 5; - height: @b - 1%; -} - -.mixina (@style, @width, @color: black) { - border: @width @style @color; -} - -.mixiny -(@a: 0, @b: 0) { - margin: @a; - padding: @b; -} - -.hidden() { - color: transparent; // asd -} - -#hidden { - .hidden; - .hidden(); -} - -.two-args { - color: blue; - .mixin(2px, 100%); - .mixina(dotted, 2px); -} - -.one-arg { - .mixin(3px); -} - -.no-parens { - .mixin; -} - -.no-args { - .mixin(); -} - -.var-args { - @var: 9; - .mixin(@var, @var * 2); -} - -.multi-mix { - .mixin(2px, 30%); - .mixiny(4, 5); -} - -.maxa(@arg1: 10, @arg2: #f00) { - padding: @arg1 * 2px; - color: @arg2; -} - -body { - .maxa(15); -} - -@glob: 5; -.global-mixin(@a:2) { - width: @glob + @a; -} - -.scope-mix { - .global-mixin(3); -} - -.nested-ruleset (@width: 200px) { - width: @width; - .column { margin: @width; } -} -.content { - .nested-ruleset(600px); -} - -// - -.same-var-name2(@radius) { - radius: @radius; -} -.same-var-name(@radius) { - .same-var-name2(@radius); -} -#same-var-name { - .same-var-name(5px); -} - -// - -.var-inside () { - @var: 10px; - width: @var; -} -#var-inside { .var-inside; } diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/less/mixins-nested.less b/deps/.npm/connect/0.2.5/package/support/less/test/less/mixins-nested.less deleted file mode 100644 index 954353b4..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/less/mixins-nested.less +++ /dev/null @@ -1,18 +0,0 @@ -.mix-inner (@var) { - border-width: @var; -} - -.mix (@a: 10) { - .inner { - height: @a * 10; - - .innest { - width: @a; - .mix-inner(@a * 2); - } - } -} - -.class { - .mix(30); -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/less/mixins-pattern.less b/deps/.npm/connect/0.2.5/package/support/less/test/less/mixins-pattern.less deleted file mode 100644 index 6392df02..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/less/mixins-pattern.less +++ /dev/null @@ -1,96 +0,0 @@ -.mixin () { - zero: 0; -} -.mixin (@a: 1px) { - one: 1; -} -.mixin (@a) { - one-req: 1; -} -.mixin (@a: 1px, @b: 2px) { - two: 2; -} - -.mixin (@a, @b, @c) { - three-req: 3; -} - -.mixin (@a: 1px, @b: 2px, @c: 3px) { - three: 3; -} - -.zero { - .mixin(); -} - -.one { - .mixin(1); -} - -.two { - .mixin(1, 2); -} - -.three { - .mixin(1, 2, 3); -} - -// - -.mixout ('left') { - left: 1; -} - -.mixout ('right') { - right: 1; -} - -.left { - .mixout('left'); -} -.right { - .mixout('right'); -} - -// - -.border (@side, @width) { - color: black; - .border-side(@side, @width); -} -.border-side (left, @w) { - border-left: @w; -} -.border-side (right, @w) { - border-right: @w; -} - -.border-right { - .border(right, 4px); -} -.border-left { - .border(left, 4px); -} - -// - - -.border-radius (@r) { - both: @r * 10; -} -.border-radius (@r, left) { - left: @r; -} -.border-radius (@r, right) { - right: @r; -} - -.only-right { - .border-radius(33, right); -} -.only-left { - .border-radius(33, left); -} -.left-right { - .border-radius(33); -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/less/mixins.less b/deps/.npm/connect/0.2.5/package/support/less/test/less/mixins.less deleted file mode 100644 index 4bbfb1e7..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/less/mixins.less +++ /dev/null @@ -1,47 +0,0 @@ -.mixin { border: 1px solid black; } -.mixout { border-color: orange; } -.borders { border-style: dashed; } - -#namespace { - .borders { - border-style: dotted; - } - .biohazard { - content: "death"; - .man { - color: transparent; - } - } -} -#theme { - > .mixin { - background-color: grey; - } -} -#container { - color: black; - .mixin; - .mixout; - #theme > .mixin; -} - -#header { - .milk { - color: white; - .mixin; - #theme > .mixin; - } - #cookie { - .chips { - #namespace .borders; - .calories { - #container; - } - } - .borders; - } -} -.secure-zone { #namespace .biohazard .man; } -.direct { - #namespace > .borders; -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/less/operations.less b/deps/.npm/connect/0.2.5/package/support/less/test/less/operations.less deleted file mode 100644 index a38f28e7..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/less/operations.less +++ /dev/null @@ -1,41 +0,0 @@ -#operations { - color: #110000 + #000011 + #001100; // #111111 - height: 10px / 2px + 6px - 1px * 2; // 9px - width: 2 * 4 - 5em; // 3em - .spacing { - height: 10px / 2px+6px-1px*2; - width: 2 * 4-5em; - } - substraction: 20 - 10 - 5 - 5; // 0 - division: 20 / 5 / 4; // 1 -} - -@x: 4; -@y: 12em; - -.with-variables { - height: @x + @y; // 16em - width: 12 + @y; // 24em - size: 5cm - @x; // 1cm -} - -@z: -2; - -.negative { - height: 2px + @z; // 0px - width: 2px - @z; // 4px -} - -.shorthands { - padding: -1px 2px 0 -4px; // -} - -.colors { - color: #123; // #112233 - border-color: #234 + #111111; // #334455 - background-color: #222222 - #fff; // #000000 - .other { - color: 2 * #111; // #222222 - border-color: #333333 / 3 + #111; // #222222 - } -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/less/parens.less b/deps/.npm/connect/0.2.5/package/support/less/test/less/parens.less deleted file mode 100644 index e020c7eb..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/less/parens.less +++ /dev/null @@ -1,26 +0,0 @@ -.parens { - @var: 1px; - border: (@var * 2) solid black; - margin: (@var * 1) (@var + 2) (4 * 4) 3; - width: (6 * 6); - padding: 2px (6px * 6px); -} - -.more-parens { - @var: (2 * 2); - padding: (2 * @var) 4 4 (@var * 1px); - width: (@var * @var) * 6; - height: (7 * 7) + (8 * 8); - margin: 4 * (5 + 5) / 2 - (@var * 2); - //margin: (6 * 6)px; -} - -.nested-parens { - width: 2 * (4 * (2 + (1 + 6))) - 1; - height: ((2+3)*(2+3) / (9-4)) + 1; -} - -.mixed-units { - margin: 2px 4em 1 5pc; - padding: (2px + 4px) 1em 2px 2; -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/less/rulesets.less b/deps/.npm/connect/0.2.5/package/support/less/test/less/rulesets.less deleted file mode 100644 index e81192db..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/less/rulesets.less +++ /dev/null @@ -1,30 +0,0 @@ -#first > .one { - > #second .two > #deux { - width: 50%; - #third { - &:focus { - color: black; - #fifth { - > #sixth { - .seventh #eighth { - + #ninth { - color: purple; - } - } - } - } - } - height: 100%; - } - #fourth, #five, #six { - color: #110000; - .seven, .eight > #nine { - border: 1px solid black; - } - #ten { - color: red; - } - } - } - font-size: 2em; -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/less/scope.less b/deps/.npm/connect/0.2.5/package/support/less/test/less/scope.less deleted file mode 100644 index f8f59bfd..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/less/scope.less +++ /dev/null @@ -1,32 +0,0 @@ -@x: blue; -@z: transparent; -@mix: none; - -.mixin { - @mix: #989; -} - -.tiny-scope { - color: @mix; // #989 - .mixin; -} - -.scope1 { - @y: orange; - @z: black; - color: @x; // blue - border-color: @z; // black - .hidden { - @x: #131313; - } - .scope2 { - @y: red; - color: @x; // blue - .scope3 { - @local: white; - color: @y; // red - border-color: @z; // black - background-color: @local; // white - } - } -} \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/less/selectors.less b/deps/.npm/connect/0.2.5/package/support/less/test/less/selectors.less deleted file mode 100644 index 5691bb22..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/less/selectors.less +++ /dev/null @@ -1,24 +0,0 @@ -h1, h2, h3 { - a, p { - &:hover { - color: red; - } - } -} - -#all { color: blue; } -#the { color: blue; } -#same { color: blue; } - -ul, li, div, q, blockquote, textarea { - margin: 0; -} - -td { - margin: 0; - padding: 0; -} - -td, input { - line-height: 1em; -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/less/strings.less b/deps/.npm/connect/0.2.5/package/support/less/test/less/strings.less deleted file mode 100644 index 61c1f2c2..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/less/strings.less +++ /dev/null @@ -1,15 +0,0 @@ -#strings { - background-image: url("http://son-of-a-banana.com"); - quotes: "~" "~"; - content: "#*%:&^,)!.(~*})"; - empty: ""; - brackets: "{" "}"; -} -#comments { - content: "/* hello */ // not-so-secret"; -} -#single-quote { - quotes: "'" "'"; - content: '""#!&""'; - empty: ''; -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/less/variables.less b/deps/.npm/connect/0.2.5/package/support/less/test/less/variables.less deleted file mode 100644 index 2596616e..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/less/variables.less +++ /dev/null @@ -1,36 +0,0 @@ -@a: 2; -@x: @a * @a; -@y: @x + 1; -@z: @x * 2 + @y; - -.variables { - width: @z + 1cm; // 14cm -} - -@b: @a * 10; -@c: #888; - -@fonts: "Trebuchet MS", Verdana, sans-serif; -@f: @fonts; - -@quotes: "~" "~"; -@q: @quotes; - -.variables { - height: @b + @x + 0px; // 24px - color: @c; - font-family: @f; - quotes: @q; -} - -.redefinition { - @var: 4; - @var: 2; - @var: 3; - three: @var; -} - -.values { - @a: 'Trebuchet'; - font-family: @a, @a, @a; -} diff --git a/deps/.npm/connect/0.2.5/package/support/less/test/less/whitespace.less b/deps/.npm/connect/0.2.5/package/support/less/test/less/whitespace.less deleted file mode 100644 index cc0a8a32..00000000 --- a/deps/.npm/connect/0.2.5/package/support/less/test/less/whitespace.less +++ /dev/null @@ -1,37 +0,0 @@ - - -.whitespace - { color: white; } - -.whitespace -{ - color: white; -} - .whitespace -{ color: white; } - -.whitespace{color:white;} -.whitespace { color : white ; } - -.white, -.space, -.mania -{ color: white; } - -.no-semi-column { color: white } -.no-semi-column { - color: white; - white-space: pre -} -.no-semi-column {border: 2px solid white} -.newlines { - background: the, - great, - wall; - border: 2px - solid - black; -} -.empty { - -} diff --git a/deps/.npm/connect/0.2.5/package/support/sass/.gitignore b/deps/.npm/connect/0.2.5/package/support/sass/.gitignore deleted file mode 100644 index 4adf993a..00000000 --- a/deps/.npm/connect/0.2.5/package/support/sass/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -*.seed -*.cache -*.log -.DS_Store -pkg -build -bin \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/sass/History.md b/deps/.npm/connect/0.2.5/package/support/sass/History.md deleted file mode 100644 index f35d826a..00000000 --- a/deps/.npm/connect/0.2.5/package/support/sass/History.md +++ /dev/null @@ -1,32 +0,0 @@ - -0.4.0 / 2010-04-02 -================== - - * Added "cache" option - -0.3.0 / 2010-02-22 -================== - - * Added mixin support. Closes #1 - -0.2.0 / 2010-02-05 -================== - - * Added alternate variable syntax back ("var: val") - * Added a method to extract variables. Closes #3 - -0.1.0 / 2010-02-05 -================== - - * Added continuation support. Closes #15 - -0.0.2 / 2010-02-02 -================== - - * Fixed complex selectors - * Removed "var: val" syntax for variables - -0.0.1 / 2010-01-12 -================== - - * Initial release diff --git a/deps/.npm/connect/0.2.5/package/support/sass/Makefile b/deps/.npm/connect/0.2.5/package/support/sass/Makefile deleted file mode 100644 index f7e6985e..00000000 --- a/deps/.npm/connect/0.2.5/package/support/sass/Makefile +++ /dev/null @@ -1,11 +0,0 @@ - -all: test - -test: spec/node.js - @node spec/node.js - -benchmark: - @node benchmarks/large.js - -.PHONY: test benchmark - \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/sass/Readme.md b/deps/.npm/connect/0.2.5/package/support/sass/Readme.md deleted file mode 100644 index 7c5e9ce7..00000000 --- a/deps/.npm/connect/0.2.5/package/support/sass/Readme.md +++ /dev/null @@ -1,165 +0,0 @@ - -# Sass.js - - JavaScript implementation of Sass. Great for **node.js** and other - frameworks supporting the CommonJS module system. - -## Installation - - Install the [Kiwi package manager for nodejs](http://github.com/visionmedia/kiwi) - and run: - - $ kiwi -v install sass - -## Usage - -With sass.js in the load path you can then use: - - var sass = require('sass') - sass.render('... string of sass ...') - // => '... string of css ...' - - sass.collect('... string of sass ...') - // => { selectors: [...], variables: { ... }, mixins: { ... }} - -## Comments - - // foo - body - // bar - a - :color #fff - -compiles to - - body a { - color: #fff;} - -## Variables - - !red = #ff0000 - body - :color !red - -and - - red: #ff0000 - body - :color !red - -compile to - - body { - color: #ff0000;} - -## Selector Continuations - - a - :color #fff - &:hover - :color #000 - &.active - :background #888 - &:hover - :color #fff - -compiles to - - a { - color: #fff;} - - a:hover { - color: #000;} - - a.active { - background: #888;} - - a.active:hover { - color: #fff;} - -## Literal JavaScript - - type: "solid" - size: 1 - input - :border { parseInt(size) + 1 }px {type} #000 - -compiles to - - input { - border: 2px "solid" #000;} - -## Property Expansion - - div - =border-radius 5px - -compiles to - - div { - -webkit-border-radius: 5px; - -moz-border-radius: 5px;} - -## Mixins - - +large - :font-size 15px - +striped - tr - :background #fff - +large - &:odd - :background #000 - table - +striped - :border none - -compiles to - - table { - border: none;} - table tr { - background: #fff;} - table tr { - font-size: 15px;} - table tr:odd { - background: #000;} - - -## Testing - -Update Git submodules and execute: - $ make test -or - $ node spec/node.js -or - $ jspec --node - -## More Information - -* Featured in [Advanced JavaScript e-book](http://www.dev-mag.com/2010/02/18/advanced-javascript/) for only $4 - -## License - -(The MIT License) - -Copyright (c) 2009 TJ Holowaychuk <tj@vision-media.ca> - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/sass/lib/sass.js b/deps/.npm/connect/0.2.5/package/support/sass/lib/sass.js deleted file mode 100644 index 17eebd63..00000000 --- a/deps/.npm/connect/0.2.5/package/support/sass/lib/sass.js +++ /dev/null @@ -1,299 +0,0 @@ - -// Sass - Core - Copyright TJ Holowaychuk (MIT Licensed) - -/** - * Version triplet. - */ - -exports.version = '0.4.0' - -/** - * Compiled sass cache. - */ - -var cache = {} - -/** - * Sass grammar tokens. - */ - -var tokens = [ - ['indent', /^\n +/], - ['space', /^ +/], - ['nl', /^\n/], - ['js', /^{(.*?)}/], - ['comment', /^\/\/(.*)/], - ['string', /^(?:'(.*?)'|"(.*?)")/], - ['variable', /^!([\w\-]+) *= *([^\n]+)/], - ['variable.alternate', /^([\w\-]+): +([^\n]+)/], - ['property.expand', /^=([\w\-]+) *([^\n]+)/], - ['property', /^:([\w\-]+) *([^\n]+)/], - ['continuation', /^&(.+)/], - ['mixin', /^\+([\w\-]+)/], - ['selector', /^(.+)/] -] - -/** - * Vendor-specific expansion prefixes. - */ - -exports.expansions = ['-moz-', '-webkit-'] - -/** - * Tokenize the given _str_. - * - * @param {string} str - * @return {array} - * @api private - */ - -function tokenize(str) { - var token, captures, stack = [] - while (str.length) { - for (var i = 0, len = tokens.length; i < len; ++i) - if (captures = tokens[i][1].exec(str)) { - token = [tokens[i][0], captures], - str = str.replace(tokens[i][1], '') - break - } - if (token) - stack.push(token), - token = null - else - throw new Error("SyntaxError: near `" + str.slice(0, 25).replace('\n', '\\n') + "'") - } - return stack -} - -/** - * Parse the given _tokens_, returning - * and hash containing the properties below: - * - * selectors: array of top-level selectors - * variables: hash of variables defined - * - * @param {array} tokens - * @return {hash} - * @api private - */ - -function parse(tokens) { - var token, selector, - data = { variables: {}, mixins: {}, selectors: [] }, - line = 1, - lastIndents = 0, - indents = 0 - - /** - * Output error _msg_ in context to the current line. - */ - - function error(msg) { - throw new Error('ParseError: on line ' + line + '; ' + msg) - } - - /** - * Reset parents until the indentation levels match. - */ - - function reset() { - if (indents === 0) - return selector = null - while (lastIndents-- > indents) - selector = selector.parent - } - - // Parse tokens - - while (token = tokens.shift()) - switch (token[0]) { - case 'mixin': - if (indents) { - var mixin = data.mixins[token[1][1]] - if (!mixin) error("mixin `" + token[1][1] + "' does not exist") - mixin.parent = selector - selector.children.push(mixin) - } - else - data.mixins[token[1][1]] = selector = new Selector(token[1][1], null, 'mixin') - break - case 'continuation': - reset() - selector = new Selector(token[1][1], selector, 'continuation') - break - case 'selector': - reset() - selector = new Selector(token[1][1], selector) - if (!selector.parent) - data.selectors.push(selector) - break - case 'property': - reset() - if (!selector) error('properties must be nested within a selector') - var val = token[1][2] - .replace(/!([\w\-]+)/g, function(orig, name){ - return data.variables[name] || orig - }) - .replace(/\{(.*?)\}/g, function(_, js){ - with (data.variables){ return eval(js) } - }) - selector.properties.push(new Property(token[1][1], val)) - break - case 'property.expand': - exports.expansions.forEach(function(prefix){ - tokens.unshift(['property', [, prefix + token[1][1], token[1][2]]]) - }) - break - case 'variable': - case 'variable.alternate': - data.variables[token[1][1]] = token[1][2] - break - case 'js': - with (data.variables){ eval(token[1][1]) } - break - case 'nl': - ++line, indents = 0 - break - case 'comment': - break - case 'indent': - ++line - lastIndents = indents, - indents = (token[1][0].length - 1) / 2 - if (indents > lastIndents && - indents - 1 > lastIndents) - error('invalid indentation, to much nesting') - } - return data -} - -/** - * Compile _selectors_ to a string of css. - * - * @param {array} selectors - * @return {string} - * @api private - */ - -function compile(selectors) { - return selectors.join('\n') -} - -/** - * Collect data by parsing _sass_. - * Returns a hash containing the following properties: - * - * selectors: array of top-level selectors - * variables: hash of variables defined - * - * @param {string} sass - * @return {hash} - * @api public - */ - -exports.collect = function(sass) { - return parse(tokenize(sass)) -} - -/** - * Render a string of _sass_. - * - * Options: - * - * - filename Optional filename to aid in error reporting - * - cache Optional caching of compiled content. Requires "filename" option - * - * @param {string} sass - * @param {object} options - * @return {string} - * @api public - */ - -exports.render = function(sass, options) { - options = options || {} - if (options.cache && !options.filename) - throw new Error('filename option must be passed when cache is enabled') - if (options.cache) - return cache[options.filename] - ? cache[options.filename] - : cache[options.filename] = compile(exports.collect(sass).selectors) - return compile(exports.collect(sass).selectors) -} - -// --- Selector - -/** - * Initialize a selector with _string_ and - * optional _parent_. - * - * @param {string} string - * @param {Selector} parent - * @param {string} type - * @api private - */ - -function Selector(string, parent, type) { - this.string = string - this.parent = parent - this.properties = [] - this.children = [] - if (type) this[type] = true - if (parent) parent.children.push(this) -} - -/** - * Return selector string. - * - * @return {string} - * @api private - */ - -Selector.prototype.selector = function() { - var selector = this.string - if (this.parent) - selector = this.continuation - ? this.parent.selector() + selector - : this.mixin - ? this.parent.selector() - : this.parent.selector() + ' ' + selector - return selector -} - -/** - * Return selector and nested selectors as CSS. - * - * @return {string} - * @api private - */ - -Selector.prototype.toString = function() { - return (this.properties.length - ? this.selector() + ' {\n' + this.properties.join('\n') + '}\n' - : '') + this.children.join('') -} - -// --- Property - -/** - * Initialize property with _name_ and _val_. - * - * @param {string} name - * @param {string} val - * @api private - */ - -function Property(name, val) { - this.name = name - this.val = val -} - -/** - * Return CSS string representing a property. - * - * @return {string} - * @api private - */ - -Property.prototype.toString = function() { - return ' ' + this.name + ': ' + this.val + ';' -} diff --git a/deps/.npm/connect/0.2.5/package/support/sass/package.json b/deps/.npm/connect/0.2.5/package/support/sass/package.json deleted file mode 100644 index d34ced54..00000000 --- a/deps/.npm/connect/0.2.5/package/support/sass/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "Sass", - "description": "Syntactically Awesome Stylesheets (compiles to css)", - "keywords": ["sass", "template", "css", "view"], - "author": "TJ Holowaychuk (MIT Licensed) - -;(function(){ - - Growl = { - - // --- Version - - version: '1.0.0', - - /** - * Execute the given _cmd_, returning an array of lines from stdout. - * - * Examples: - * - * Growl.exec('growlnotify', '-m', msg) - * - * @param {string ...} cmd - * @return {array} - * @api public - */ - - exec: function(cmd) { - var lines = [], line - with (JavaImporter(java.lang, java.io)) { - var proccess = Runtime.getRuntime().exec(Array.prototype.slice.call(arguments)) - var stream = new DataInputStream(proccess.getInputStream()) - while (line = stream.readLine()) - lines.push(line + '') - stream.close() - } - return lines - }, - - /** - * Return the extension of the given _path_ or null. - * - * @param {string} path - * @return {string} - * @api private - */ - - extname: function(path) { - return path.lastIndexOf('.') != -1 ? - path.slice(path.lastIndexOf('.') + 1, path.length) : - null - }, - - /** - * Version of the 'growlnotify' binary. - * - * @return {string} - * @api private - */ - - binVersion: function() { - try { return this.exec('growlnotify', '-v')[0].split(' ')[1] } catch (e) {} - }, - - /** - * Send growl notification _msg_ with _options_. - * - * Options: - * - * - title Notification title - * - sticky Make the notification stick (defaults to false) - * - name Application name (defaults to growlnotify) - * - image - * - path to an icon sets --iconpath - * - path to an image sets --image - * - capitalized word sets --appIcon - * - filename uses extname as --icon - * - otherwise treated as --icon - * - * Examples: - * - * Growl.notify('New email') - * Growl.notify('5 new emails', { title: 'Thunderbird' }) - * - * @param {string} msg - * @param {options} hash - * @api public - */ - - notify: function(msg, options) { - options = options || {} - var args = ['growlnotify', '-m', msg] - if (!this.binVersion()) throw new Error('growlnotify executable is required') - if (image = options.image) { - var flag, ext = this.extname(image) - flag = flag || ext == 'icns' && 'iconpath' - flag = flag || /^[A-Z]/.test(image) && 'appIcon' - flag = flag || /^png|gif|jpe?g$/.test(ext) && 'image' - flag = flag || ext && (image = ext) && 'icon' - flag = flag || 'icon' - args.push('--' + flag, image) - } - if (options.sticky) args.push('--sticky') - if (options.name) args.push('--name', options.name) - if (options.title) args.push(options.title) - this.exec.apply(this, args) - } - } - - JSpec.include({ - name: 'Growl', - reporting: function(options){ - var stats = JSpec.stats - if (stats.failures) Growl.notify('failed ' + stats.failures + ' assertions', { title: 'JSpec'}) - else Growl.notify('passed ' + stats.passes + ' assertions', { title: 'JSpec' }) - } - }) - -})() \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/sass/spec/lib/jspec.jquery.js b/deps/.npm/connect/0.2.5/package/support/sass/spec/lib/jspec.jquery.js deleted file mode 100644 index 46422ec5..00000000 --- a/deps/.npm/connect/0.2.5/package/support/sass/spec/lib/jspec.jquery.js +++ /dev/null @@ -1,79 +0,0 @@ - -// JSpec - jQuery - Copyright TJ Holowaychuk (MIT Licensed) - -JSpec -.requires('jQuery', 'when using jspec.jquery.js') -.include({ - name: 'jQuery', - - // --- Initialize - - init : function() { - jQuery.ajaxSetup({ async: false }) - }, - - // --- Utilities - - utilities : { - element: jQuery, - elements: jQuery, - sandbox : function() { - return jQuery('
    ') - } - }, - - // --- Matchers - - matchers : { - have_tag : "jQuery(expected, actual).length === 1", - have_one : "alias have_tag", - have_tags : "jQuery(expected, actual).length > 1", - have_many : "alias have_tags", - have_any : "alias have_tags", - have_child : "jQuery(actual).children(expected).length === 1", - have_children : "jQuery(actual).children(expected).length > 1", - have_text : "jQuery(actual).text() === expected", - have_value : "jQuery(actual).val() === expected", - be_enabled : "!jQuery(actual).attr('disabled')", - have_class : "jQuery(actual).hasClass(expected)", - be_animated : "jQuery(actual).queue().length > 0", - - be_visible : function(actual) { - return jQuery(actual).css('display') != 'none' && - jQuery(actual).css('visibility') != 'hidden' && - jQuery(actual).attr('type') != 'hidden' - }, - - be_hidden : function(actual) { - return !JSpec.does(actual, 'be_visible') - }, - - have_classes : function(actual) { - return !JSpec.any(JSpec.toArray(arguments, 1), function(arg){ - return !JSpec.does(actual, 'have_class', arg) - }) - }, - - have_attr : function(actual, attr, value) { - return value ? jQuery(actual).attr(attr) == value: - jQuery(actual).attr(attr) - }, - - have_event_handlers : function(actual, expected) { - return jQuery(actual).data('events') ? - jQuery(actual).data('events').hasOwnProperty(expected) : - false - }, - - 'be disabled selected checked' : function(attr) { - return 'jQuery(actual).attr("' + attr + '")' - }, - - 'have type id title alt href src sel rev name target' : function(attr) { - return function(actual, value) { - return JSpec.does(actual, 'have_attr', attr, value) - } - } - } -}) - diff --git a/deps/.npm/connect/0.2.5/package/support/sass/spec/lib/jspec.js b/deps/.npm/connect/0.2.5/package/support/sass/spec/lib/jspec.js deleted file mode 100644 index 131c7450..00000000 --- a/deps/.npm/connect/0.2.5/package/support/sass/spec/lib/jspec.js +++ /dev/null @@ -1,1893 +0,0 @@ - -// JSpec - Core - Copyright TJ Holowaychuk (MIT Licensed) - -;(function(){ - - JSpec = { - version : '4.3.2', - assert : true, - cache : {}, - suites : [], - modules : [], - allSuites : [], - sharedBehaviors: [], - matchers : {}, - stubbed : [], - options : {}, - request : 'XMLHttpRequest' in this ? XMLHttpRequest : null, - stats : { specs: 0, assertions: 0, failures: 0, passes: 0, specsFinished: 0, suitesFinished: 0 }, - - /** - * Default context in which bodies are evaluated. - * - * Replace context simply by setting JSpec.context - * to your own like below: - * - * JSpec.context = { foo : 'bar' } - * - * Contexts can be changed within any body, this can be useful - * in order to provide specific helper methods to specific suites. - * - * To reset (usually in after hook) simply set to null like below: - * - * JSpec.context = null - * - */ - - defaultContext : { - - /** - * Return an object used for proxy assertions. - * This object is used to indicate that an object - * should be an instance of _object_, not the constructor - * itself. - * - * @param {function} constructor - * @return {hash} - * @api public - */ - - an_instance_of : function(constructor) { - return { an_instance_of : constructor } - }, - - /** - * Load fixture at _path_. - * - * Fixtures are resolved as: - * - * - - * - .html - * - * @param {string} path - * @return {string} - * @api public - */ - - fixture : function(path) { - if (JSpec.cache[path]) return JSpec.cache[path] - return JSpec.cache[path] = - JSpec.tryLoading(JSpec.options.fixturePath + '/' + path) || - JSpec.tryLoading(JSpec.options.fixturePath + '/' + path + '.html') - }, - - /** - * Load json fixture at _path_. - * - * JSON fixtures are resolved as: - * - * - - * - .json - * - * @param {string} path - * @return {object} - * @api public - */ - - json_fixture: function(path) { - if (!JSpec.cache['json:' + path]) - JSpec.cache['json:' + path] = - JSpec.tryLoading(JSpec.options.fixturePath + '/' + path) || - JSpec.tryLoading(JSpec.options.fixturePath + '/' + path + '.json') - try { - return eval('(' + JSpec.cache['json:' + path] + ')') - } catch (e) { - throw 'json_fixture("' + path + '"): ' + e - } - } - }, - - // --- Objects - - reporters : { - - /** - * Report to server. - * - * Options: - * - uri specific uri to report to. - * - verbose weither or not to output messages - * - failuresOnly output failure messages only - * - * @api public - */ - - Server : function(results, options) { - var uri = options.uri || 'http://' + window.location.host + '/results' - JSpec.post(uri, { - stats: JSpec.stats, - options: options, - results: map(results.allSuites, function(suite) { - if (suite.isExecutable()) - return { - description: suite.description, - specs: map(suite.specs, function(spec) { - return { - description: spec.description, - message: !spec.passed() ? spec.failure().message : null, - status: spec.requiresImplementation() ? 'pending' : - spec.passed() ? 'pass' : - 'fail', - assertions: map(spec.assertions, function(assertion){ - return { - passed: assertion.passed - } - }) - } - }) - } - }) - }) - if ('close' in main) main.close() - }, - - /** - * Default reporter, outputting to the DOM. - * - * Options: - * - reportToId id of element to output reports to, defaults to 'jspec' - * - failuresOnly displays only suites with failing specs - * - * @api public - */ - - DOM : function(results, options) { - var id = option('reportToId') || 'jspec', - report = document.getElementById(id), - failuresOnly = option('failuresOnly'), - classes = results.stats.failures ? 'has-failures' : '' - if (!report) throw 'JSpec requires the element #' + id + ' to output its reports' - - function bodyContents(body) { - return JSpec. - escape(JSpec.contentsOf(body)). - replace(/^ */gm, function(a){ return (new Array(Math.round(a.length / 3))).join(' ') }). - replace(/\r\n|\r|\n/gm, '
    ') - } - - report.innerHTML = '
    \ - Passes: ' + results.stats.passes + ' \ - Failures: ' + results.stats.failures + ' \ - Duration: ' + results.duration + ' ms \ -
    ' + map(results.allSuites, function(suite) { - var displaySuite = failuresOnly ? suite.ran && !suite.passed() : suite.ran - if (displaySuite && suite.isExecutable()) - return '' + - map(suite.specs, function(i, spec) { - return '' + - (spec.requiresImplementation() ? - '' : - (spec.passed() && !failuresOnly) ? - '' : - !spec.passed() ? - '' : - '') + - '' - }).join('') + '' - }).join('') + '
    ' + escape(suite.description) + '
    ' + escape(spec.description) + '' + escape(spec.description)+ '' + spec.assertionsGraph() + '' + escape(spec.description) + - map(spec.failures(), function(a){ return '' + escape(a.message) + '' }).join('') + - '' + spec.assertionsGraph() + '
    ' + bodyContents(spec.body) + '
    ' - }, - - /** - * Terminal reporter. - * - * @api public - */ - - Terminal : function(results, options) { - var failuresOnly = option('failuresOnly') - print(color("\n Passes: ", 'bold') + color(results.stats.passes, 'green') + - color(" Failures: ", 'bold') + color(results.stats.failures, 'red') + - color(" Duration: ", 'bold') + color(results.duration, 'green') + " ms \n") - - function indent(string) { - return string.replace(/^(.)/gm, ' $1') - } - - each(results.allSuites, function(suite) { - var displaySuite = failuresOnly ? suite.ran && !suite.passed() : suite.ran - if (displaySuite && suite.isExecutable()) { - print(color(' ' + suite.description, 'bold')) - each(suite.specs, function(spec){ - var assertionsGraph = inject(spec.assertions, '', function(graph, assertion){ - return graph + color('.', assertion.passed ? 'green' : 'red') - }) - if (spec.requiresImplementation()) - print(color(' ' + spec.description, 'blue') + assertionsGraph) - else if (spec.passed() && !failuresOnly) - print(color(' ' + spec.description, 'green') + assertionsGraph) - else if (!spec.passed()) - print(color(' ' + spec.description, 'red') + assertionsGraph + - "\n" + indent(map(spec.failures(), function(a){ return a.message }).join("\n")) + "\n") - }) - print("") - } - }) - - quit(results.stats.failures) - } - }, - - Assertion : function(matcher, actual, expected, negate) { - extend(this, { - message: '', - passed: false, - actual: actual, - negate: negate, - matcher: matcher, - expected: expected, - - // Report assertion results - - report : function() { - if (JSpec.assert) - this.passed ? JSpec.stats.passes++ : JSpec.stats.failures++ - return this - }, - - // Run the assertion - - run : function() { - // TODO: remove unshifting - expected.unshift(actual) - this.result = matcher.match.apply(this, expected) - this.passed = negate ? !this.result : this.result - if (!this.passed) this.message = matcher.message.call(this, actual, expected, negate, matcher.name) - return this - } - }) - }, - - ProxyAssertion : function(object, method, times, negate) { - var self = this, - old = object[method] - - // Proxy - - object[method] = function(){ - var args = toArray(arguments), - result = old.apply(object, args) - self.calls.push({ args : args, result : result }) - return result - } - - // Times - - this.times = { - once : 1, - twice : 2 - }[times] || times || 1 - - extend(this, { - calls: [], - message: '', - defer: true, - passed: false, - negate: negate, - object: object, - method: method, - - // Proxy return value - - and_return : function(result) { - this.expectedResult = result - return this - }, - - // Proxy arguments passed - - with_args : function() { - this.expectedArgs = toArray(arguments) - return this - }, - - // Check if any calls have failing results - - anyResultsFail : function() { - return any(this.calls, function(call){ - return self.expectedResult.an_instance_of ? - call.result.constructor != self.expectedResult.an_instance_of: - !equal(self.expectedResult, call.result) - }) - }, - - // Check if any calls have passing results - - anyResultsPass : function() { - return any(this.calls, function(call){ - return self.expectedResult.an_instance_of ? - call.result.constructor == self.expectedResult.an_instance_of: - equal(self.expectedResult, call.result) - }) - }, - - // Return the passing result - - passingResult : function() { - return this.anyResultsPass().result - }, - - // Return the failing result - - failingResult : function() { - return this.anyResultsFail().result - }, - - // Check if any arguments fail - - anyArgsFail : function() { - return any(this.calls, function(call){ - return any(self.expectedArgs, function(i, arg){ - if (arg == null) return call.args[i] == null - return arg.an_instance_of ? - call.args[i].constructor != arg.an_instance_of: - !equal(arg, call.args[i]) - - }) - }) - }, - - // Check if any arguments pass - - anyArgsPass : function() { - return any(this.calls, function(call){ - return any(self.expectedArgs, function(i, arg){ - return arg.an_instance_of ? - call.args[i].constructor == arg.an_instance_of: - equal(arg, call.args[i]) - - }) - }) - }, - - // Return the passing args - - passingArgs : function() { - return this.anyArgsPass().args - }, - - // Return the failing args - - failingArgs : function() { - return this.anyArgsFail().args - }, - - // Report assertion results - - report : function() { - if (JSpec.assert) - this.passed ? ++JSpec.stats.passes : ++JSpec.stats.failures - return this - }, - - // Run the assertion - - run : function() { - var methodString = 'expected ' + object.toString() + '.' + method + '()' + (negate ? ' not' : '' ) - - function times(n) { - return n > 2 ? n + ' times' : { 1: 'once', 2: 'twice' }[n] - } - - if (this.expectedResult != null && (negate ? this.anyResultsPass() : this.anyResultsFail())) - this.message = methodString + ' to return ' + puts(this.expectedResult) + - ' but ' + (negate ? 'it did' : 'got ' + puts(this.failingResult())) - - if (this.expectedArgs && (negate ? !this.expectedResult && this.anyArgsPass() : this.anyArgsFail())) - this.message = methodString + ' to be called with ' + puts.apply(this, this.expectedArgs) + - ' but was' + (negate ? '' : ' called with ' + puts.apply(this, this.failingArgs())) - - if (negate ? !this.expectedResult && !this.expectedArgs && this.calls.length >= this.times : this.calls.length != this.times) - this.message = methodString + ' to be called ' + times(this.times) + - ', but ' + (this.calls.length == 0 ? ' was not called' : ' was called ' + times(this.calls.length)) - - if (!this.message.length) - this.passed = true - - return this - } - }) - }, - - /** - * Specification Suite block object. - * - * @param {string} description - * @param {function} body - * @api private - */ - - Suite : function(description, body, isShared) { - var self = this - extend(this, { - body: body, - description: description, - suites: [], - sharedBehaviors: [], - specs: [], - ran: false, - shared: isShared, - hooks: { 'before' : [], 'after' : [], - 'before_each' : [], 'after_each' : [], - 'before_nested' : [], 'after_nested' : []}, - - // Add a spec to the suite - - addSpec : function(description, body) { - var spec = new JSpec.Spec(description, body) - this.specs.push(spec) - JSpec.stats.specs++ // TODO: abstract - spec.suite = this - }, - - // Add a before hook to the suite - - addBefore : function(options, body) { - body.options = options || {} - this.befores.push(body) - }, - - // Add an after hook to the suite - - addAfter : function(options, body) { - body.options = options || {} - this.afters.unshift(body) - }, - - // Add a hook to the suite - - addHook : function(hook, body) { - this.hooks[hook].push(body) - }, - - // Add a nested suite - - addSuite : function(description, body, isShared) { - var suite = new JSpec.Suite(description, body, isShared) - JSpec.allSuites.push(suite) - suite.name = suite.description - suite.description = this.description + ' ' + suite.description - this.suites.push(suite) - suite.suite = this - }, - - // Invoke a hook in context to this suite - - hook : function(hook) { - if (hook != 'before' && hook != 'after') - if (this.suite) this.suite.hook(hook) - - each(this.hooks[hook], function(body) { - JSpec.evalBody(body, "Error in hook '" + hook + "', suite '" + self.description + "': ") - }) - }, - - // Check if nested suites are present - - hasSuites : function() { - return this.suites.length - }, - - // Check if this suite has specs - - hasSpecs : function() { - return this.specs.length - }, - - // Check if the entire suite passed - - passed : function() { - return !any(this.specs, function(spec){ - return !spec.passed() - }) - }, - - isShared : function(){ - return this.shared - }, - - isExecutable : function() { - return !this.isShared() && this.hasSpecs() - } - }) - }, - - /** - * Specification block object. - * - * @param {string} description - * @param {function} body - * @api private - */ - - Spec : function(description, body) { - extend(this, { - body: body, - description: description, - assertions: [], - - // Add passing assertion - - pass : function(message) { - this.assertions.push({ passed: true, message: message }) - if (JSpec.assert) ++JSpec.stats.passes - }, - - // Add failing assertion - - fail : function(message) { - this.assertions.push({ passed: false, message: message }) - if (JSpec.assert) ++JSpec.stats.failures - }, - - // Run deferred assertions - - runDeferredAssertions : function() { - each(this.assertions, function(assertion){ - if (assertion.defer) assertion.run().report(), hook('afterAssertion', assertion) - }) - }, - - // Find first failing assertion - - failure : function() { - return find(this.assertions, function(assertion){ - return !assertion.passed - }) - }, - - // Find all failing assertions - - failures : function() { - return select(this.assertions, function(assertion){ - return !assertion.passed - }) - }, - - // Weither or not the spec passed - - passed : function() { - return !this.failure() - }, - - // Weither or not the spec requires implementation (no assertions) - - requiresImplementation : function() { - return this.assertions.length == 0 - }, - - // Sprite based assertions graph - - assertionsGraph : function() { - return map(this.assertions, function(assertion){ - return '' - }).join('') - } - }) - }, - - Module : function(methods) { - extend(this, methods) - }, - - JSON : { - - /** - * Generic sequences. - */ - - meta : { - '\b' : '\\b', - '\t' : '\\t', - '\n' : '\\n', - '\f' : '\\f', - '\r' : '\\r', - '"' : '\\"', - '\\' : '\\\\' - }, - - /** - * Escapable sequences. - */ - - escapable : /[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, - - /** - * JSON encode _object_. - * - * @param {mixed} object - * @return {string} - * @api private - */ - - encode : function(object) { - var self = this - if (object == undefined || object == null) return 'null' - if (object === true) return 'true' - if (object === false) return 'false' - switch (typeof object) { - case 'number': return object - case 'string': return this.escapable.test(object) ? - '"' + object.replace(this.escapable, function (a) { - return typeof self.meta[a] === 'string' ? self.meta[a] : - '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4) - }) + '"' : - '"' + object + '"' - case 'object': - if (object.constructor == Array) - return '[' + map(object, function(val){ - return self.encode(val) - }).join(', ') + ']' - else if (object) - return '{' + map(object, function(key, val){ - return self.encode(key) + ':' + self.encode(val) - }).join(', ') + '}' - } - return 'null' - } - }, - - // --- DSLs - - DSLs : { - snake : { - expect : function(actual){ - return JSpec.expect(actual) - }, - - describe : function(description, body) { - return JSpec.currentSuite.addSuite(description, body, false) - }, - - it : function(description, body) { - return JSpec.currentSuite.addSpec(description, body) - }, - - before : function(body) { - return JSpec.currentSuite.addHook('before', body) - }, - - after : function(body) { - return JSpec.currentSuite.addHook('after', body) - }, - - before_each : function(body) { - return JSpec.currentSuite.addHook('before_each', body) - }, - - after_each : function(body) { - return JSpec.currentSuite.addHook('after_each', body) - }, - - before_nested : function(body) { - return JSpec.currentSuite.addHook('before_nested', body) - }, - - after_nested : function(body){ - return JSpec.currentSuite.addhook('after_nested', body) - }, - - shared_behaviors_for : function(description, body){ - return JSpec.currentSuite.addSuite(description, body, true) - }, - - should_behave_like : function(description) { - return JSpec.shareBehaviorsOf(description) - } - } - }, - - // --- Methods - - /** - * Check if _value_ is 'stop'. For use as a - * utility callback function. - * - * @param {mixed} value - * @return {bool} - * @api public - */ - - haveStopped : function(value) { - return value === 'stop' - }, - - /** - * Include _object_ which may be a hash or Module instance. - * - * @param {hash, Module} object - * @return {JSpec} - * @api public - */ - - include : function(object) { - var module = object.constructor == JSpec.Module ? object : new JSpec.Module(object) - this.modules.push(module) - if ('init' in module) module.init() - if ('utilities' in module) extend(this.defaultContext, module.utilities) - if ('matchers' in module) this.addMatchers(module.matchers) - if ('reporters' in module) extend(this.reporters, module.reporters) - if ('DSLs' in module) - each(module.DSLs, function(name, methods){ - JSpec.DSLs[name] = JSpec.DSLs[name] || {} - extend(JSpec.DSLs[name], methods) - }) - return this - }, - - /** - * Add a module hook _name_, which is immediately - * called per module with the _args_ given. An array of - * hook return values is returned. - * - * @param {name} string - * @param {...} args - * @return {array} - * @api private - */ - - hook : function(name, args) { - args = toArray(arguments, 1) - return inject(JSpec.modules, [], function(results, module){ - if (typeof module[name] == 'function') - results.push(JSpec.evalHook(module, name, args)) - }) - }, - - /** - * Eval _module_ hook _name_ with _args_. Evaluates in context - * to the module itself, JSpec, and JSpec.context. - * - * @param {Module} module - * @param {string} name - * @param {array} args - * @return {mixed} - * @api private - */ - - evalHook : function(module, name, args) { - hook('evaluatingHookBody', module, name) - return module[name].apply(module, args) - }, - - /** - * Same as hook() however accepts only one _arg_ which is - * considered immutable. This function passes the arg - * to the first module, then passes the return value of the last - * module called, to the following module. - * - * @param {string} name - * @param {mixed} arg - * @return {mixed} - * @api private - */ - - hookImmutable : function(name, arg) { - return inject(JSpec.modules, arg, function(result, module){ - if (typeof module[name] == 'function') - return JSpec.evalHook(module, name, [result]) - }) - }, - - /** - * Find a shared example suite by its description or name. - * First searches parent tree of suites for shared behavior - * before falling back to global scoped nested behaviors. - * - * @param {string} description - * @return {Suite} - * @api private - */ - - findSharedBehavior : function(description) { - var behavior - return (behavior = JSpec.findLocalSharedBehavior(description)) - ? behavior - : JSpec.findGlobalSharedBehavior(description) - }, - - /** - * Find a shared example suite within the current suite's - * parent tree by its description or name. - * - * @param {string} description - * @return {Suite} - * @api private - */ - - findLocalSharedBehavior : function(description) { - var behavior, - currentSuite = JSpec.currentSuite.suite - while (currentSuite) - if (behavior = find(currentSuite.suites, JSpec.suiteDescriptionPredicate(description))) - return behavior - else - currentSuite = currentSuite.suite - }, - - /** - * Find a shared example suite within the global - * scope by its description or name. - * - * @param {string} description - * @return {Suite} - * @api private - */ - - findGlobalSharedBehavior : function(description) { - return find(JSpec.suites, JSpec.suiteDescriptionPredicate(description)) - }, - - /** - * Build a predicate that will match a suite based on name or description - * - * @param {string} description - * @return {function} - * @api private - */ - - suiteDescriptionPredicate : function(description) { - return function(suite){ - return suite.name === description || - suite.description === description - } - }, - - /** - * Share behaviors (specs) of the given suite with - * the current suite. - * - * @param {string} description - * @api public - */ - - shareBehaviorsOf : function(description) { - var suite = JSpec.findSharedBehavior(description) - if (suite) - JSpec.evalBody(suite.body) - else - throw new Error("failed to find shared behaviors named `" + description + "'") - }, - - - /** - * Convert arguments to an array. - * - * @param {object} arguments - * @param {int} offset - * @return {array} - * @api public - */ - - toArray : function(arguments, offset) { - return Array.prototype.slice.call(arguments, offset || 0) - }, - - /** - * Return ANSI-escaped colored string. - * - * @param {string} string - * @param {string} color - * @return {string} - * @api public - */ - - color : function(string, color) { - if (option('disableColors')) { - return string - } else { - return "\u001B[" + { - bold : 1, - black : 30, - red : 31, - green : 32, - yellow : 33, - blue : 34, - magenta : 35, - cyan : 36, - white : 37 - }[color] + 'm' + string + "\u001B[0m" - } - }, - - /** - * Default matcher message callback. - * - * @api private - */ - - defaultMatcherMessage : function(actual, expected, negate, name) { - return 'expected ' + puts(actual) + ' to ' + - (negate ? 'not ' : '') + - name.replace(/_/g, ' ') + - ' ' + (expected.length > 1 ? - puts.apply(this, expected.slice(1)) : - '') - }, - - /** - * Normalize a matcher message. - * - * When no messge callback is present the defaultMatcherMessage - * will be assigned, will suffice for most matchers. - * - * @param {hash} matcher - * @return {hash} - * @api public - */ - - normalizeMatcherMessage : function(matcher) { - if (typeof matcher.message != 'function') - matcher.message = this.defaultMatcherMessage - return matcher - }, - - /** - * Normalize a matcher body - * - * This process allows the following conversions until - * the matcher is in its final normalized hash state. - * - * - '==' becomes 'actual == expected' - * - 'actual == expected' becomes 'return actual == expected' - * - function(actual, expected) { return actual == expected } becomes - * { match : function(actual, expected) { return actual == expected }} - * - * @param {mixed} body - * @return {hash} - * @api public - */ - - normalizeMatcherBody : function(body) { - var captures - switch (body.constructor) { - case String: - if (captures = body.match(/^alias (\w+)/)) return JSpec.matchers[last(captures)] - if (body.length < 4) body = 'actual ' + body + ' expected' - return { match: function(actual, expected) { return eval(body) }} - - case Function: - return { match: body } - - default: - return body - } - }, - - /** - * Get option value. This method first checks if - * the option key has been set via the query string, - * otherwise returning the options hash value. - * - * @param {string} key - * @return {mixed} - * @api public - */ - - option : function(key) { - return (value = query(key)) !== null ? value : - JSpec.options[key] || null - }, - - /** - * Check if object _a_, is equal to object _b_. - * - * @param {object} a - * @param {object} b - * @return {bool} - * @api private - */ - - equal: function(a, b) { - if (typeof a != typeof b) return - if (a === b) return true - if (a instanceof RegExp) - return a.toString() === b.toString() - if (a instanceof Date) - return Number(a) === Number(b) - if (typeof a != 'object') return - if (a.length !== undefined) - if (a.length !== b.length) return - else - for (var i = 0, len = a.length; i < len; ++i) - if (!equal(a[i], b[i])) - return - for (var key in a) - if (!equal(a[key], b[key])) - return - return true - }, - - /** - * Return last element of an array. - * - * @param {array} array - * @return {object} - * @api public - */ - - last : function(array) { - return array[array.length - 1] - }, - - /** - * Convert object(s) to a print-friend string. - * - * @param {...} object - * @return {string} - * @api public - */ - - puts : function(object) { - if (arguments.length > 1) - return map(toArray(arguments), function(arg){ - return puts(arg) - }).join(', ') - if (object === undefined) return 'undefined' - if (object === null) return 'null' - if (object === true) return 'true' - if (object === false) return 'false' - if (object.an_instance_of) return 'an instance of ' + object.an_instance_of.name - if (object.jquery && object.selector.length > 0) return 'selector ' + puts(object.selector) - if (object.jquery) return object.get(0).outerHTML - if (object.nodeName) return object.outerHTML - switch (object.constructor) { - case Function: return object.name || object - case String: - return '"' + object - .replace(/"/g, '\\"') - .replace(/\n/g, '\\n') - .replace(/\t/g, '\\t') - + '"' - case Array: - return inject(object, '[', function(b, v){ - return b + ', ' + puts(v) - }).replace('[,', '[') + ' ]' - case Object: - object.__hit__ = true - return inject(object, '{', function(b, k, v) { - if (k == '__hit__') return b - return b + ', ' + k + ': ' + (v && v.__hit__ ? '' : puts(v)) - }).replace('{,', '{') + ' }' - default: - return object.toString() - } - }, - - /** - * Parse an XML String and return a 'document'. - * - * @param {string} text - * @return {document} - * @api public - */ - - parseXML : function(text) { - var xmlDoc - if (window.DOMParser) - xmlDoc = (new DOMParser()).parseFromString(text, "text/xml") - else { - xmlDoc = new ActiveXObject("Microsoft.XMLDOM") - xmlDoc.async = "false" - xmlDoc.loadXML(text) - } - return xmlDoc - }, - - /** - * Escape HTML. - * - * @param {string} html - * @return {string} - * @api public - */ - - escape : function(html) { - return html.toString() - .replace(/&/gmi, '&') - .replace(/"/gmi, '"') - .replace(/>/gmi, '>') - .replace(/ current) while (++current <= end) values.push(current) - else while (--current >= end) values.push(current) - return '[' + values + ']' - }, - - /** - * Report on the results. - * - * @api public - */ - - report : function() { - this.duration = Number(new Date) - this.start - hook('reporting', JSpec.options) - new (JSpec.options.reporter || JSpec.reporters.DOM)(JSpec, JSpec.options) - }, - - /** - * Run the spec suites. Options are merged - * with JSpec options when present. - * - * @param {hash} options - * @return {JSpec} - * @api public - */ - - run : function(options) { - if (any(hook('running'), haveStopped)) return this - if (options) extend(this.options, options) - this.start = Number(new Date) - each(this.suites, function(suite) { JSpec.runSuite(suite) }) - return this - }, - - /** - * Run a suite. - * - * @param {Suite} suite - * @api public - */ - - runSuite : function(suite) { - if (!suite.isShared()) - { - this.currentSuite = suite - this.evalBody(suite.body) - suite.ran = true - hook('beforeSuite', suite), suite.hook('before'), suite.hook('before_nested') - each(suite.specs, function(spec) { - hook('beforeSpec', spec) - suite.hook('before_each') - JSpec.runSpec(spec) - hook('afterSpec', spec) - suite.hook('after_each') - }) - if (suite.hasSuites()) { - each(suite.suites, function(suite) { - JSpec.runSuite(suite) - }) - } - hook('afterSuite', suite), suite.hook('after_nested'), suite.hook('after') - this.stats.suitesFinished++ - } - }, - - /** - * Report a failure for the current spec. - * - * @param {string} message - * @api public - */ - - fail : function(message) { - JSpec.currentSpec.fail(message) - }, - - /** - * Report a passing assertion for the current spec. - * - * @param {string} message - * @api public - */ - - pass : function(message) { - JSpec.currentSpec.pass(message) - }, - - /** - * Run a spec. - * - * @param {Spec} spec - * @api public - */ - - runSpec : function(spec) { - this.currentSpec = spec - try { this.evalBody(spec.body) } - catch (e) { fail(e) } - spec.runDeferredAssertions() - destub() - this.stats.specsFinished++ - this.stats.assertions += spec.assertions.length - }, - - /** - * Require a dependency, with optional message. - * - * @param {string} dependency - * @param {string} message (optional) - * @return {JSpec} - * @api public - */ - - requires : function(dependency, message) { - hook('requiring', dependency, message) - try { eval(dependency) } - catch (e) { throw 'JSpec depends on ' + dependency + ' ' + message } - return this - }, - - /** - * Query against the current query strings keys - * or the queryString specified. - * - * @param {string} key - * @param {string} queryString - * @return {string, null} - * @api private - */ - - query : function(key, queryString) { - var queryString = (queryString || (main.location ? main.location.search : null) || '').substring(1) - return inject(queryString.split('&'), null, function(value, pair){ - parts = pair.split('=') - return parts[0] == key ? parts[1].replace(/%20|\+/gmi, ' ') : value - }) - }, - - /** - * Ad-hoc POST request for JSpec server usage. - * - * @param {string} uri - * @param {string} data - * @api private - */ - - post : function(uri, data) { - if (any(hook('posting', uri, data), haveStopped)) return - var request = this.xhr() - request.open('POST', uri, false) - request.setRequestHeader('Content-Type', 'application/json') - request.send(JSpec.JSON.encode(data)) - }, - - /** - * Instantiate an XMLHttpRequest. - * - * Here we utilize IE's lame ActiveXObjects first which - * allow IE access serve files via the file: protocol, otherwise - * we then default to XMLHttpRequest. - * - * @return {XMLHttpRequest, ActiveXObject} - * @api private - */ - - xhr : function() { - return this.ieXhr() || new JSpec.request - }, - - /** - * Return Microsoft piece of crap ActiveXObject. - * - * @return {ActiveXObject} - * @api public - */ - - ieXhr : function() { - function object(str) { - try { return new ActiveXObject(str) } catch(e) {} - } - return object('Msxml2.XMLHTTP.6.0') || - object('Msxml2.XMLHTTP.3.0') || - object('Msxml2.XMLHTTP') || - object('Microsoft.XMLHTTP') - }, - - /** - * Check for HTTP request support. - * - * @return {bool} - * @api private - */ - - hasXhr : function() { - return JSpec.request || 'ActiveXObject' in main - }, - - /** - * Try loading _file_ returning the contents - * string or null. Chain to locate / read a file. - * - * @param {string} file - * @return {string} - * @api public - */ - - tryLoading : function(file) { - try { return JSpec.load(file) } catch (e) {} - }, - - /** - * Load a _file_'s contents. - * - * @param {string} file - * @param {function} callback - * @return {string} - * @api public - */ - - load : function(file, callback) { - if (any(hook('loading', file), haveStopped)) return - if ('readFile' in main) - return readFile(file) - else if (this.hasXhr()) { - var request = this.xhr() - request.open('GET', file, false) - request.send(null) - if (request.readyState == 4 && - (request.status == 0 || - request.status.toString().charAt(0) == 2)) - return request.responseText - } - else - throw new Error("failed to load `" + file + "'") - }, - - /** - * Load, pre-process, and evaluate a file. - * - * @param {string} file - * @param {JSpec} - * @api public - */ - - exec : function(file) { - if (any(hook('executing', file), haveStopped)) return this - eval('with (JSpec){' + this.preprocess(this.load(file)) + '}') - return this - } - } - - // --- Node.js support - - if (typeof GLOBAL === 'object' && typeof exports === 'object') { - var fs = require('fs') - quit = process.exit - print = require('sys').puts - readFile = function(file){ - return fs.readFileSync(file).toString('utf8') - } - } - - // --- Utility functions - - var main = this, - find = JSpec.any, - utils = 'haveStopped stub hookImmutable hook destub map any last pass fail range each option inject select \ - error escape extend puts query strip color does addMatchers callIterator toArray equal'.split(/\s+/) - while (utils.length) eval('var ' + utils[0] + ' = JSpec.' + utils.shift()) - if (!main.setTimeout) main.setTimeout = function(callback){ callback() } - - // --- Matchers - - addMatchers({ - equal : "===", - eql : "equal(actual, expected)", - be : "alias equal", - be_greater_than : ">", - be_less_than : "<", - be_at_least : ">=", - be_at_most : "<=", - be_a : "actual.constructor == expected", - be_an : "alias be_a", - be_an_instance_of : "actual instanceof expected", - be_null : "actual == null", - be_true : "actual == true", - be_false : "actual == false", - be_undefined : "typeof actual == 'undefined'", - be_type : "typeof actual == expected", - match : "typeof actual == 'string' ? actual.match(expected) : false", - respond_to : "typeof actual[expected] == 'function'", - have_length : "actual.length == expected", - be_within : "actual >= expected[0] && actual <= last(expected)", - have_length_within : "actual.length >= expected[0] && actual.length <= last(expected)", - - receive : { defer : true, match : function(actual, method, times) { - var proxy = new JSpec.ProxyAssertion(actual, method, times, this.negate) - JSpec.currentSpec.assertions.push(proxy) - return proxy - }}, - - be_empty : function(actual) { - if (actual.constructor == Object && actual.length == undefined) - for (var key in actual) - return false; - return !actual.length - }, - - include : function(actual) { - for (var state = true, i = 1; i < arguments.length; i++) { - var arg = arguments[i] - switch (actual.constructor) { - case String: - case Number: - case RegExp: - case Function: - state = actual.toString().indexOf(arg) !== -1 - break - - case Object: - state = arg in actual - break - - case Array: - state = any(actual, function(value){ return equal(value, arg) }) - break - } - if (!state) return false - } - return true - }, - - throw_error : { match : function(actual, expected, message) { - try { actual() } - catch (e) { - this.e = e - var assert = function(arg) { - switch (arg.constructor) { - case RegExp : return arg.test(e.message || e.toString()) - case String : return arg == (e.message || e.toString()) - case Function : return e instanceof arg || e.name == arg.name - } - } - return message ? assert(expected) && assert(message) : - expected ? assert(expected) : - true - } - }, message : function(actual, expected, negate) { - // TODO: refactor when actual is not in expected [0] - var message_for = function(i) { - if (expected[i] == undefined) return 'exception' - switch (expected[i].constructor) { - case RegExp : return 'exception matching ' + puts(expected[i]) - case String : return 'exception of ' + puts(expected[i]) - case Function : return expected[i].name || 'Error' - } - } - var exception = message_for(1) + (expected[2] ? ' and ' + message_for(2) : '') - return 'expected ' + exception + (negate ? ' not ' : '' ) + - ' to be thrown, but ' + (this.e ? 'got ' + puts(this.e) : 'nothing was') - }}, - - have : function(actual, length, property) { - return actual[property] == null ? false : actual[property].length == length - }, - - have_at_least : function(actual, length, property) { - return actual[property] == null ? (length === 0) : actual[property].length >= length - }, - - have_at_most :function(actual, length, property) { - return actual[property] == null || actual[property].length <= length - }, - - have_within : function(actual, range, property) { - var length = actual[property] == undefined ? 0 : actual[property].length - return length >= range.shift() && length <= range.pop() - }, - - have_prop : function(actual, property, value) { - var actualVal = actual[property], actualType = typeof actualVal - return (actualType == 'function' || actualType == 'undefined') ? false : - typeof value === 'undefined' || - does(actual[property],'eql',value) - }, - - have_property : function(actual, property, value) { - var actualVal = actual[property], actualType = typeof actualVal - return (actualType == 'function' || actualType == 'undefined') ? false : - typeof value === 'undefined' || - value === actualVal - } - }) - -})() diff --git a/deps/.npm/connect/0.2.5/package/support/sass/spec/lib/jspec.nodejs.js b/deps/.npm/connect/0.2.5/package/support/sass/spec/lib/jspec.nodejs.js deleted file mode 100644 index 6765273c..00000000 --- a/deps/.npm/connect/0.2.5/package/support/sass/spec/lib/jspec.nodejs.js +++ /dev/null @@ -1,18 +0,0 @@ - -// JSpec - node - Copyright TJ Holowaychuk (MIT Licensed) - -JSpec -.include({ - name: 'node', - - // --- Matchers - - matchers : { - have_enumerable_property: 'actual.propertyIsEnumerable(expected)', - have_writable_property: 'Object.getOwnPropertyDescriptor(actual, expected).writable === true', - have_configurable_property: 'Object.getOwnPropertyDescriptor(actual, expected).configurable === true', - have_keys: 'does(Object.keys(actual), "eql", expected)', - have_prototype: 'Object.getPrototypeOf(actual) === expected' - } -}) - diff --git a/deps/.npm/connect/0.2.5/package/support/sass/spec/lib/jspec.shell.js b/deps/.npm/connect/0.2.5/package/support/sass/spec/lib/jspec.shell.js deleted file mode 100644 index cb19c69f..00000000 --- a/deps/.npm/connect/0.2.5/package/support/sass/spec/lib/jspec.shell.js +++ /dev/null @@ -1,39 +0,0 @@ - -// JSpec - Shell - Copyright TJ Holowaychuk (MIT Licensed) - -;(function(){ - - var _quit = quit - - Shell = { - - // --- Global - - main: this, - - // --- Commands - - commands: { - quit: ['Terminate the shell', function(){ _quit() }], - exit: ['Terminate the shell', function(){ _quit() }], - p: ['Inspect an object', function(o){ return o.toSource() }] - }, - - /** - * Start the interactive shell. - * - * @api public - */ - - start : function() { - for (var name in this.commands) - if (this.commands.hasOwnProperty(name)) - this.commands[name][1].length ? - this.main[name] = this.commands[name][1] : - this.main.__defineGetter__(name, this.commands[name][1]) - } - } - - Shell.start() - -})() \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/sass/spec/lib/jspec.timers.js b/deps/.npm/connect/0.2.5/package/support/sass/spec/lib/jspec.timers.js deleted file mode 100644 index c88d10b3..00000000 --- a/deps/.npm/connect/0.2.5/package/support/sass/spec/lib/jspec.timers.js +++ /dev/null @@ -1,90 +0,0 @@ - -// JSpec - Mock Timers - Copyright TJ Holowaychuk (MIT Licensed) - -;(function(){ - - /** - * Version. - */ - - mockTimersVersion = '1.0.2' - - /** - * Localized timer stack. - */ - - var timers = [] - - /** - * Set mock timeout with _callback_ and timeout of _ms_. - * - * @param {function} callback - * @param {int} ms - * @return {int} - * @api public - */ - - setTimeout = function(callback, ms) { - var id - return id = setInterval(function(){ - callback() - clearInterval(id) - }, ms) - } - - /** - * Set mock interval with _callback_ and interval of _ms_. - * - * @param {function} callback - * @param {int} ms - * @return {int} - * @api public - */ - - setInterval = function(callback, ms) { - callback.step = ms, callback.current = callback.last = 0 - return timers[timers.length] = callback, timers.length - } - - /** - * Destroy timer with _id_. - * - * @param {int} id - * @return {bool} - * @api public - */ - - clearInterval = clearTimeout = function(id) { - return delete timers[--id] - } - - /** - * Reset timers. - * - * @return {array} - * @api public - */ - - resetTimers = function() { - return timers = [] - } - - /** - * Increment each timers internal clock by _ms_. - * - * @param {int} ms - * @api public - */ - - tick = function(ms) { - for (var i = 0, len = timers.length; i < len; ++i) - if (timers[i] && (timers[i].current += ms)) - if (timers[i].current - timers[i].last >= timers[i].step) { - var times = Math.floor((timers[i].current - timers[i].last) / timers[i].step) - var remainder = (timers[i].current - timers[i].last) % timers[i].step - timers[i].last = timers[i].current - remainder - while (times-- && timers[i]) timers[i]() - } - } - -})() \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/support/sass/spec/lib/jspec.xhr.js b/deps/.npm/connect/0.2.5/package/support/sass/spec/lib/jspec.xhr.js deleted file mode 100644 index 3b963105..00000000 --- a/deps/.npm/connect/0.2.5/package/support/sass/spec/lib/jspec.xhr.js +++ /dev/null @@ -1,210 +0,0 @@ - -// JSpec - XHR - Copyright TJ Holowaychuk (MIT Licensed) - -(function(){ - - var lastRequest - - // --- Original XMLHttpRequest - - var OriginalXMLHttpRequest = 'XMLHttpRequest' in this ? - XMLHttpRequest : - function(){} - var OriginalActiveXObject = 'ActiveXObject' in this ? - ActiveXObject : - undefined - - // --- MockXMLHttpRequest - - var MockXMLHttpRequest = function() { - this.requestHeaders = {} - } - - MockXMLHttpRequest.prototype = { - status: 0, - async: true, - readyState: 0, - responseXML: null, - responseText: '', - abort: function(){}, - onreadystatechange: function(){}, - - /** - * Return response headers hash. - */ - - getAllResponseHeaders : function(){ - return JSpec.inject(this.responseHeaders, '', function(buf, key, val){ - return buf + key + ': ' + val + '\r\n' - }) - }, - - /** - * Return case-insensitive value for header _name_. - */ - - getResponseHeader : function(name) { - return this.responseHeaders[name.toLowerCase()] - }, - - /** - * Set case-insensitive _value_ for header _name_. - */ - - setRequestHeader : function(name, value) { - this.requestHeaders[name.toLowerCase()] = value - }, - - /** - * Open mock request. - */ - - open : function(method, url, async, user, password) { - this.user = user - this.password = password - this.url = url - this.readyState = 1 - this.method = method.toUpperCase() - if (async != undefined) this.async = async - if (this.async) this.onreadystatechange() - }, - - /** - * Send request _data_. - */ - - send : function(data) { - var self = this - this.data = data - this.readyState = 4 - if (this.method == 'HEAD') this.responseText = null - this.responseHeaders['content-length'] = (this.responseText || '').length - if(this.async) this.onreadystatechange() - this.populateResponseXML() - lastRequest = function(){ - return self - } - }, - - /** - * Parse request body and populate responseXML if response-type is xml - * Based on the standard specification : http://www.w3.org/TR/XMLHttpRequest/ - */ - populateResponseXML: function() { - var type = this.getResponseHeader("content-type") - if (!type || !this.responseText || !type.match(/(text\/xml|application\/xml|\+xml$)/g)) - return - this.responseXML = JSpec.parseXML(this.responseText) - } - } - - // --- Response status codes - - JSpec.statusCodes = { - 100: 'Continue', - 101: 'Switching Protocols', - 200: 'OK', - 201: 'Created', - 202: 'Accepted', - 203: 'Non-Authoritative Information', - 204: 'No Content', - 205: 'Reset Content', - 206: 'Partial Content', - 300: 'Multiple Choice', - 301: 'Moved Permanently', - 302: 'Found', - 303: 'See Other', - 304: 'Not Modified', - 305: 'Use Proxy', - 307: 'Temporary Redirect', - 400: 'Bad Request', - 401: 'Unauthorized', - 402: 'Payment Required', - 403: 'Forbidden', - 404: 'Not Found', - 405: 'Method Not Allowed', - 406: 'Not Acceptable', - 407: 'Proxy Authentication Required', - 408: 'Request Timeout', - 409: 'Conflict', - 410: 'Gone', - 411: 'Length Required', - 412: 'Precondition Failed', - 413: 'Request Entity Too Large', - 414: 'Request-URI Too Long', - 415: 'Unsupported Media Type', - 416: 'Requested Range Not Satisfiable', - 417: 'Expectation Failed', - 422: 'Unprocessable Entity', - 500: 'Internal Server Error', - 501: 'Not Implemented', - 502: 'Bad Gateway', - 503: 'Service Unavailable', - 504: 'Gateway Timeout', - 505: 'HTTP Version Not Supported' - } - - /** - * Mock XMLHttpRequest requests. - * - * mockRequest().and_return('some data', 'text/plain', 200, { 'X-SomeHeader' : 'somevalue' }) - * - * @return {hash} - * @api public - */ - - function mockRequest() { - return { and_return : function(body, type, status, headers) { - XMLHttpRequest = MockXMLHttpRequest - ActiveXObject = false - status = status || 200 - headers = headers || {} - headers['content-type'] = type - JSpec.extend(XMLHttpRequest.prototype, { - responseText: body, - responseHeaders: headers, - status: status, - statusText: JSpec.statusCodes[status] - }) - }} - } - - /** - * Unmock XMLHttpRequest requests. - * - * @api public - */ - - function unmockRequest() { - XMLHttpRequest = OriginalXMLHttpRequest - ActiveXObject = OriginalActiveXObject - } - - JSpec.include({ - name: 'Mock XHR', - - // --- Utilities - - utilities : { - mockRequest: mockRequest, - unmockRequest: unmockRequest - }, - - // --- Hooks - - afterSpec : function() { - unmockRequest() - }, - - // --- DSLs - - DSLs : { - snake : { - mock_request: mockRequest, - unmock_request: unmockRequest, - last_request: function(){ return lastRequest() } - } - } - - }) -})() diff --git a/deps/.npm/connect/0.2.5/package/support/sass/spec/node.js b/deps/.npm/connect/0.2.5/package/support/sass/spec/node.js deleted file mode 100644 index 07d99340..00000000 --- a/deps/.npm/connect/0.2.5/package/support/sass/spec/node.js +++ /dev/null @@ -1,9 +0,0 @@ - -require.paths.unshift('spec', 'spec/lib', 'lib') -require('jspec') -sass = require('sass') - -JSpec - .exec('spec/spec.core.js') - .run({ reporter: JSpec.reporters.Terminal, fixturePath: 'spec/fixtures', failuresOnly: true }) - .report() diff --git a/deps/.npm/connect/0.2.5/package/support/sass/spec/spec.core.js b/deps/.npm/connect/0.2.5/package/support/sass/spec/spec.core.js deleted file mode 100644 index 5ee3cb76..00000000 --- a/deps/.npm/connect/0.2.5/package/support/sass/spec/spec.core.js +++ /dev/null @@ -1,134 +0,0 @@ - -describe 'Sass' - before - render = function(path, options) { - return sass.render(fixture(path + '.sass'), options) - } - - expected = function(path) { - return fixture(path + '.css') - } - - assert = function(path, options) { - render(path, options).should.eql expected(path) - } - end - - describe '.version' - it 'should be a triplet' - sass.version.should.match(/^\d+\.\d+\.\d+$/) - end - end - - describe '.render()' - describe 'with "cache" enabled' - describe 'without "filename"' - it 'should throw an error' - -{ assert('selectors', { cache: true }) }.should.throw_error 'filename option must be passed when cache is enabled' - end - end - - describe 'with "filename"' - it 'should still work' - assert('selectors', { cache: true, filename: 'style.sass' }) - end - end - end - - it 'should support complex selectors' - assert('selectors') - end - - describe '// ...' - it 'should be a sass-specific comment' - assert('comment') - end - end - - describe '& ...' - it 'should continue a selector' - assert('continuation') - end - end - - describe '{...}' - it 'should have access to variables' - assert('literal') - end - end - - describe ':key val' - it 'should define a property' - assert('properties') - end - - describe 'when nested' - it 'should traverse correctly' - assert('properties.nested') - end - - describe 'incorrectly' - it 'should throw an error' - try { assert('properties.nested.invalid') } - catch (e) { - e.message.should.eql 'ParseError: on line 3; invalid indentation, to much nesting' - } - end - end - end - - describe 'when at the top level' - it 'should throw an error' - try { assert('properties.invalid') } - catch (e) { - e.message.should.eql 'ParseError: on line 1; properties must be nested within a selector' - } - end - end - end - - describe '=:key val' - it 'should expand to -{moz, webkit}-border-radius' - assert('properties.expand') - end - end - - describe '!key = val' - it 'should define a variable' - assert('variables.regular') - end - end - - describe 'key: val' - it 'should define a variable' - assert('variables.alternate') - end - end - end - - describe '+mixin' - it 'should create a mixin' - assert('mixin') - end - - describe 'when the mixin does not exist' - try { assert('mixin.undefined') } - catch (e) { - e.message.should.eql 'ParseError: on line 2; mixin `large\' does not exist' - } - end - end - - describe '.collect()' - it 'should return variables defined' - var collected = sass.collect(fixture('collect.sass')) - collected.variables.should.eql { red: '#ff0000', black: '#000' } - end - - it 'should return mixins defined' - var collected = sass.collect(fixture('mixin.sass')) - collected.mixins.should.have_property 'large' - collected.mixins.should.have_property 'striped' - end - end -end \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/test/bodyDecoder.test.js b/deps/.npm/connect/0.2.5/package/test/bodyDecoder.test.js deleted file mode 100644 index 886c2d10..00000000 --- a/deps/.npm/connect/0.2.5/package/test/bodyDecoder.test.js +++ /dev/null @@ -1,91 +0,0 @@ - -/** - * Module dependencies. - */ - -var connect = require('connect'), - helpers = require('./helpers'), - assert = require('assert'), - http = require('http'); - -module.exports = { - 'test urlencoded body': function(){ - var server = helpers.run( - connect.bodyDecoder(), - function(req, res){ - assert.eql({ user: { name: 'tj' }}, req.body, 'Test body-decoder urlencoded req.body'); - res.writeHead(200); - res.end(); - } - ); - var req = server.request('POST', '/', { 'Content-Type': 'application/x-www-form-urlencoded' }); - req.write('user[name]=tj'); - req.end(); - }, - - 'test json body': function(){ - var server = helpers.run( - connect.bodyDecoder(), - function(req, res){ - assert.eql({ user: { name: 'tj' }}, req.body, 'Test body-decoder json req.body'); - res.writeHead(200); - res.end(); - } - ); - var req = server.request('POST', '/', { 'Content-Type': 'application/json; charset=utf8' }); - req.write('{"user":{"name":"tj"}}'); - req.end(); - }, - - 'test empty body': function(){ - var server = helpers.run( - connect.bodyDecoder(), - function(req, res){ - assert.eql({}, req.body, 'Test body-decoder empty req.body'); - res.writeHead(200); - res.end(); - } - ); - var req = server.request('POST', '/', { 'Content-Type': 'application/json; charset=utf8' }); - req.write(''); - req.end(); - }, - - 'test invalid body': function(){ - var server = helpers.run( - connect.bodyDecoder(), - function(err, req, res, next){ - assert.equal('unexpected_eos', err.type, 'Test body-decoder invalid json error'); - assert.equal('{"user":{"name":"tj"', req.rawBody, 'Test body-decoder req.rawBody'); - assert.strictEqual(undefined, req.body, 'Test body-decoder invalid json req.body'); - res.writeHead(200); - res.end(); - } - ); - var req = server.request('POST', '/', { 'Content-Type': 'application/json' }); - req.write('{"user":{"name":"tj"'); - req.end(); - }, - - 'test custom decoder': function(){ - connect.bodyDecoder.decode['my/type'] = function(str){ - return str.replace(/ +/g, ''); - }; - var server = helpers.run( - connect.bodyDecoder(), - function(req, res){ - res.writeHead(200); - res.end(req.body); - } - ); - var req = server.request('POST', '/', { 'Content-Type': 'my/type' }); - req.buffer = true; - req.on('response', function(res){ - res.on('end', function(){ - assert.equal('foobar', res.body, 'Test custom decoder function'); - }); - }); - req.write('f o o b a r'); - req.end(); - } -} \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/test/compiler.test.js b/deps/.npm/connect/0.2.5/package/test/compiler.test.js deleted file mode 100644 index 2a3fd3de..00000000 --- a/deps/.npm/connect/0.2.5/package/test/compiler.test.js +++ /dev/null @@ -1,28 +0,0 @@ - -/** - * Module dependencies. - */ - -var connect = require('connect'), - helpers = require('./helpers'), - assert = require('assert'), - http = require('http'); - -module.exports = { - test: function(){ - var server = helpers.run( - connect.compiler({ src: __dirname + '/fixtures', enable: ['sass', 'coffeescript'] }), - connect.staticProvider({ root: __dirname + '/fixtures' }) - ); - server.assertResponse('GET', '/doesnotexist.css', 404, 'Cannot GET /doesnotexist.css'); - server.assertResponse('GET', '/style.css', 200, 'body {\n font-size: 12px;\n color: #000;}\n'); - server.assertResponse('GET', '/style.css', 200, 'body {\n font-size: 12px;\n color: #000;}\n'); - server.assertResponse('GET', '/foo.bar.baz.css', 200, 'foo {\n color: #000;}\n'); - server.assertResponse('GET', '/foo.bar.baz.css', 200, 'foo {\n color: #000;}\n'); - server.assertResponse('GET', '/script.js', 200, '(function() {\n var $;\n $ = jQuery;\n $(document).ready(function() {\n return console.log("Say Hello to CoffeeScript");\n });\n})();\n'); - }, - - 'test .compilers': function(){ - assert.equal('object', typeof connect.compiler.compilers); - } -} diff --git a/deps/.npm/connect/0.2.5/package/test/connect.test.js b/deps/.npm/connect/0.2.5/package/test/connect.test.js deleted file mode 100644 index 8f5ace34..00000000 --- a/deps/.npm/connect/0.2.5/package/test/connect.test.js +++ /dev/null @@ -1,188 +0,0 @@ - -/** - * Module dependencies. - */ - -var connect = require('connect'), - helpers = require('./helpers'), - assert = require('assert'), - http = require('http'); - -module.exports = { - 'test version': function(){ - assert.ok(/^\d+\.\d+\.\d+$/.test(connect.version), 'Test framework version format'); - }, - - 'test use()': function(){ - var server = helpers.run(); - - server.use('/blog', function(req, res){ - res.writeHead(200, {}); - res.end('blog'); - }); - - var ret = server.use( - function(req, res){ - res.writeHead(200, {}); - res.end('wahoo'); - } - ); - - assert.equal(server, ret, 'Test Server#use() returns server for chaining'); - server.assertResponse('GET', '/', 200, 'wahoo'); - server.assertResponse('GET', '/blog', 200, 'blog'); - }, - - 'test path matching': function(){ - var n = 0; - var server = helpers.run(); - - server.use('/hello/world', function(req, res, next){ - switch (++n) { - case 1: - case 2: - assert.equal('/', req.url, 'Test request url after matching a path'); - break; - case 3: - assert.equal('/hello/world/and/more/segments', - req.originalUrl, - 'Test request originalUrl'); - assert.equal('/and/more/segments', - req.url, - 'Test request url after matching a path with additional segments'); - break; - case 4: - assert.equal('/images/foo.png?with=query&string', - req.url, - 'Test request url after matching a path with query string'); - break; - } - res.writeHead(200); - res.end('hello world'); - }); - - server.use('/hello', function(req, res, next){ - res.writeHead(200); - res.end('hello'); - }); - - server.assertResponse('GET', '/hello', 200, 'hello', 'Test path matching /hello'); - server.assertResponse('GET', '/hello/', 200, 'hello', 'Test path matching /hello/'); - server.assertResponse('GET', '/hello/world', 200, 'hello world', 'Test path matching /hello/world'); - server.assertResponse('GET', '/hello/world/', 200, 'hello world', 'Test path matching /hello/world/'); - server.assertResponse('GET', '/hello/world/and/more/segments', 200, 'hello world', 'Test path matching /hello/world/and/more/segments'); - server.assertResponse('GET', '/hello/world/images/foo.png?with=query&string', 200, 'hello world', 'Test path matching /hello/world/images/foo.png?with=query&string'); - }, - - 'test unmatched path': function(){ - var server = helpers.run(); - server.assertResponse('GET', '/', 404, 'Cannot GET /', 'Test unmatched path'); - server.assertResponse('GET', '/foo', 404, 'Cannot GET /foo', 'Test unmatched path'); - }, - - 'test handleError': function(){ - var called = 0; - var server = helpers.run( - function(req, res, next){ - // Pass error - next(new Error('shitty deal')); - }, - function(err, req, res, next){ - ++called; - assert.ok(err instanceof Error, 'Test handleError() Error as first param'); - assert.equal('object', typeof req); - assert.equal('object', typeof res); - assert.equal('function', typeof next); - req.body = err.message; - next(err); - }, - function(err, req, res, next){ - ++called; - assert.ok(err instanceof Error, 'Test handleError() next(error)'); - assert.equal('object', typeof req); - assert.equal('object', typeof res); - assert.equal('function', typeof next); - // Recover exceptional state - next(); - }, - function(req, res, next){ - res.writeHead(200, {}); - res.end(req.body); - }, - connect.errorHandler() - ); - server.assertResponse('GET', '/', 200, 'shitty deal', 'Test handleError next()', function(){ - var expected = 2; - assert.equal(expected, called, 'Test handleError calls, expected ' + expected + ' but got ' + called); - }); - }, - - 'test catch error': function(){ - var server = helpers.run( - function(req, res, next){ - doesNotExist(); - } - ); - - var req = server.request('GET', '/'); - req.buffer = true; - req.addListener('response', function(res){ - res.addListener('end', function(){ - assert.equal(500, res.statusCode, 'Test 500 by default on exception'); - }); - }); - req.end(); - }, - - 'test mounting': function(){ - var helloWorldServer = connect.createServer(); - helloWorldServer.use('/world', function(req, res){ - assert.equal('/hello', helloWorldServer.route); - res.writeHead(200); - res.end('hello world'); - }); - - var server = helpers.run(); - server.use('/hello', helloWorldServer); - server.use('/hello', function(req, res){ - res.writeHead(200); - res.end('hello'); - }); - - server.assertResponse('GET', '/hello/world', 200, 'hello world', 'Test mounting /hello/world'); - server.assertResponse('GET', '/hello', 200, 'hello', 'Test mounting /hello'); - }, - - 'test connect as middleware': function(){ - var inner = connect.createServer(); - inner.use('/inner', function(req, res){ - if (req.method === 'POST') { - res.writeHead(200); - res.end('inner stack'); - } else { - next(); - } - }); - - var middle = connect.createServer(inner); - middle.use('/', function(req, res, next){ - if (req.method === 'POST') { - res.writeHead(200); - res.end('middle stack'); - } else { - next(); - } - }); - - var server = helpers.run(middle); - server.use('/outer', function(req, res){ - res.writeHead(200); - res.end('outer stack'); - }); - - server.assertResponse('GET', '/outer', 200, 'outer stack', 'Test outer stack'); - server.assertResponse('POST', '/', 200, 'middle stack', 'Test middle stack'); - server.assertResponse('POST', '/inner', 200, 'inner stack', 'Test inner stack'); - server.assertResponse('GET', '/', 404, 'Cannot GET /', 'Test multiple stacks unmatched path'); - } -} \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/test/cookieDecoder.test.js b/deps/.npm/connect/0.2.5/package/test/cookieDecoder.test.js deleted file mode 100644 index 264cd20a..00000000 --- a/deps/.npm/connect/0.2.5/package/test/cookieDecoder.test.js +++ /dev/null @@ -1,31 +0,0 @@ - -/** - * Module dependencies. - */ - -var connect = require('connect'), - helpers = require('./helpers'), - assert = require('assert'), - http = require('http'); - -module.exports = { - test: function(){ - var n = 0; - var server = helpers.run( - connect.cookieDecoder(), - function(req, res, next){ - switch (n++) { - case 0: - assert.eql({}, req.cookies, 'Test cookies default to blank object'); - break; - case 1: - assert.eql({ sid: '123' }, req.cookies, 'Test cookie parsing'); - break; - } - next(); - } - ); - server.request('GET', '/').end(); - server.request('GET', '/', { 'Cookie': 'sid=123' }).end(); - } -} \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/test/errorHandler.test.js b/deps/.npm/connect/0.2.5/package/test/errorHandler.test.js deleted file mode 100644 index 5849e5d0..00000000 --- a/deps/.npm/connect/0.2.5/package/test/errorHandler.test.js +++ /dev/null @@ -1,61 +0,0 @@ - -/** - * Module dependencies. - */ - -var connect = require('connect'), - helpers = require('./helpers'), - assert = require('assert'), - http = require('http'); - -module.exports = { - 'test defaults': function(){ - var server = helpers.run( - function(req, res, next){ - next(new Error('keyboard cat!')); - }, - connect.errorHandler() - ); - server.assertResponse('GET', '/', 500, 'Internal Server Error', 'Test error-handler defaults'); - }, - - 'test defaults with caught exception': function(){ - var server = helpers.run( - function(req, res, next){ - throw new Error('keyboard cat!'); - }, - connect.errorHandler() - ); - server.assertResponse('GET', '/', 500, 'Internal Server Error', 'Test error-handler defaults'); - }, - - 'test showMessage': function(){ - var server = helpers.run( - function(req, res, next){ - next(new Error('keyboard cat!')); - }, - connect.errorHandler({ showMessage: true }) - ); - server.assertResponse('GET', '/', 500, 'Error: keyboard cat!', 'Test error-handler showMessage'); - }, - - 'test showStack': function(){ - var server = helpers.run( - function(req, res, next){ - next(new Error('keyboard cat!')); - }, - connect.errorHandler({ showStack: true }) - ); - var req = server.request('GET', '/'); - req.buffer = true; - req.addListener('response', function(res){ - res.addListener('end', function(){ - assert.equal('text/plain', res.headers['content-type']); - assert.equal(500, res.statusCode, 'Test error-handler 500 status code'); - assert.ok(res.body.indexOf('Error: keyboard cat!') !== -1, 'Test error-handler showStack message'); - assert.ok(res.body.indexOf('lib/connect/index.js') !== -1, 'Test error-handler showStack stack trace'); - }) - }) - req.end(); - } -} \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/test/favicon.test.js b/deps/.npm/connect/0.2.5/package/test/favicon.test.js deleted file mode 100644 index d2110379..00000000 --- a/deps/.npm/connect/0.2.5/package/test/favicon.test.js +++ /dev/null @@ -1,29 +0,0 @@ - -/** - * Module dependencies. - */ - -var connect = require('connect'), - helpers = require('./helpers'), - assert = require('assert'), - http = require('http'); - -module.exports = { - 'test headers': function(){ - var server = helpers.run(connect.favicon()); - var req = server.request('GET', '/favicon.ico'); - req.buffer = true; - req.addListener('response', function(res){ - assert.equal('image/x-icon', res.headers['content-type']); - assert.ok(res.headers['content-length'], 'Test favicon Content-Length'); - }); - req.end(); - }, - - 'test custom favicon': function(){ - var server = helpers.run( - connect.favicon(__dirname + '/../lib/connect/public/favicon.ico') - ); - server.assertResponse('GET', '/favicon.ico', 200); - } -} diff --git a/deps/.npm/connect/0.2.5/package/test/filters/uppercase.js b/deps/.npm/connect/0.2.5/package/test/filters/uppercase.js deleted file mode 100644 index 527e54d4..00000000 --- a/deps/.npm/connect/0.2.5/package/test/filters/uppercase.js +++ /dev/null @@ -1,14 +0,0 @@ - -module.exports = function(){ - return function(req, res, next){ - req.body = '' - req.setEncoding('utf8') - req.addListener('data', function(chunk){ - req.body += chunk - }) - req.addListener('end', function(){ - req.body = req.body.toUpperCase() - next(null, req, res) - }) - }; -}; \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/test/fixtures/foo.bar.baz.sass b/deps/.npm/connect/0.2.5/package/test/fixtures/foo.bar.baz.sass deleted file mode 100644 index b89f05eb..00000000 --- a/deps/.npm/connect/0.2.5/package/test/fixtures/foo.bar.baz.sass +++ /dev/null @@ -1,2 +0,0 @@ -foo - :color #000 \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/test/fixtures/index.html b/deps/.npm/connect/0.2.5/package/test/fixtures/index.html deleted file mode 100644 index 22595e55..00000000 --- a/deps/.npm/connect/0.2.5/package/test/fixtures/index.html +++ /dev/null @@ -1 +0,0 @@ -

    Wahoo!

    \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/test/fixtures/script.coffee b/deps/.npm/connect/0.2.5/package/test/fixtures/script.coffee deleted file mode 100644 index 0420ea71..00000000 --- a/deps/.npm/connect/0.2.5/package/test/fixtures/script.coffee +++ /dev/null @@ -1,3 +0,0 @@ -$ = jQuery -$(document).ready -> - console.log "Say Hello to CoffeeScript" diff --git a/deps/.npm/connect/0.2.5/package/test/fixtures/some text.txt b/deps/.npm/connect/0.2.5/package/test/fixtures/some text.txt deleted file mode 100644 index 5c5ce99a..00000000 --- a/deps/.npm/connect/0.2.5/package/test/fixtures/some text.txt +++ /dev/null @@ -1 +0,0 @@ -whoop \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/test/fixtures/style.less b/deps/.npm/connect/0.2.5/package/test/fixtures/style.less deleted file mode 100644 index 3a45443b..00000000 --- a/deps/.npm/connect/0.2.5/package/test/fixtures/style.less +++ /dev/null @@ -1,2 +0,0 @@ -@red: #cc0000; -body { color: @red } \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/test/fixtures/style.sass b/deps/.npm/connect/0.2.5/package/test/fixtures/style.sass deleted file mode 100644 index c53054ea..00000000 --- a/deps/.npm/connect/0.2.5/package/test/fixtures/style.sass +++ /dev/null @@ -1,3 +0,0 @@ -body - :font-size 12px - :color #000 \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/test/fixtures/user.json b/deps/.npm/connect/0.2.5/package/test/fixtures/user.json deleted file mode 100644 index 66b790d3..00000000 --- a/deps/.npm/connect/0.2.5/package/test/fixtures/user.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "tj", - "email": "tj@sencha.com" -} \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/test/gzip.test.js b/deps/.npm/connect/0.2.5/package/test/gzip.test.js deleted file mode 100644 index 658feac8..00000000 --- a/deps/.npm/connect/0.2.5/package/test/gzip.test.js +++ /dev/null @@ -1,55 +0,0 @@ -var connect = require('connect'), - helpers = require('./helpers'), - assert = require('assert'), - http = require('http'); - -function server(headers) { - headers = headers || {}; - headers['Content-Type'] = 'text/plain'; - return helpers.run( - connect.gzip(), - connect.createServer( - function(req, res){ - res.writeHead(200, headers); - res.end('can be compressed'); - }) - ); -} - -module.exports = { - 'test no compression': function(){ - var req = server().request('GET', '/', { }); - req.buffer = true; - req.addListener('response', function(res){ - res.addListener('end', function(){ - assert.equal('can be compressed', res.body); - }); - }); - req.end(); - }, - 'test compression': function(){ - var req = server().request('GET', '/', { 'Accept-Encoding': 'deflate, gzip' }); - req.buffer = true; - req.addListener('response', function(res){ - res.addListener('end', function(){ - assert.equal('gzip', res.headers['content-encoding']); - // we could uncompress in this test. for now, check - // only that it's not the original body: - assert.notEqual('can be compressed', res.body); - }); - }); - req.end(); - }, - 'test no compression with other content-encoding': function(){ - var req = server({ 'Content-Encoding': 'bogon' }). - request('GET', '/', { 'Accept-Encoding': 'bogon, gzip' }); - req.buffer = true; - req.addListener('response', function(res){ - res.addListener('end', function(){ - assert.equal('bogon', res.headers['content-encoding']); - assert.equal('can be compressed', res.body); - }); - }); - req.end(); - } -} diff --git a/deps/.npm/connect/0.2.5/package/test/helpers/http.js b/deps/.npm/connect/0.2.5/package/test/helpers/http.js deleted file mode 100644 index a0183d57..00000000 --- a/deps/.npm/connect/0.2.5/package/test/helpers/http.js +++ /dev/null @@ -1,89 +0,0 @@ - -/** - * Module dependencies. - */ - -var connect = require('connect'), - assert = require('assert'), - http = require('http'), - net = require('net'), - sys = require('sys'); - -/** - * Test base port. - */ - -var port = exports.port = process.env.CONNECT_TEST_PORT || 12345; - -connect.Server.prototype.listen = function(){ - var self = this, - client = http.createClient(port), - pending = 0; - - /** - * Request helper. - */ - - this.request = function(){ - if (self.pending === undefined) ++pending; - var req = client.request.apply(client, arguments); - req.addListener('response', function(res){ - if (req.buffer) { - res.body = ''; - res.setEncoding('utf8'); - res.addListener('data', function(chunk){ res.body += chunk }); - } - if (self.pending === undefined) { - if (!--pending) { - self.close(); - } - } else if (!--self.pending) { - self.close(); - } - }); - return req; - }; - - /** - * Response assertion helper. - */ - - this.assertResponse = function(method, path, expectedStatus, expectedBody, msg, fn){ - msg = msg || 'expected'; - var req = this.request(method, path); - req.buffer = true; - req.addListener('response', function(res){ - res.addListener('end', function(){ - if (expectedBody !== undefined) { - assert.equal(expectedBody, - res.body, - msg + ' response body of ' + sys.inspect(expectedBody) + ', got ' + sys.inspect(res.body)); - } - assert.equal(expectedStatus, - res.statusCode, - msg + ' status code of ' + expectedStatus + ', got ' + res.statusCode); - if (fn) fn(res); - }); - }); - req.end(); - }; - - /** - * Assert response headers. - */ - - this.assertResponseHeaders = function(method, path, headers){ - var req = this.request(method, path); - req.addListener('response', function(res){ - for (var key in headers) { - assert.equal(headers[key], res.headers[key], - 'expected response header ' + key + ' of "' + headers[key] + '"' - + ', got "' + res.headers[key] + '"'); - } - }); - req.end(); - }; - - net.Server.prototype.listen.call(this, this.port = port++, '127.0.0.1'); - return this; -} \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/test/helpers/index.js b/deps/.npm/connect/0.2.5/package/test/helpers/index.js deleted file mode 100644 index a2788a77..00000000 --- a/deps/.npm/connect/0.2.5/package/test/helpers/index.js +++ /dev/null @@ -1,12 +0,0 @@ - -/** - * Module dependencies. - */ - -var connect = require('connect'); - -exports.port = require('./http').port; - -exports.run = function run(){ - return connect.createServer.apply(this, arguments).listen(); -} \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/test/logger.test.js b/deps/.npm/connect/0.2.5/package/test/logger.test.js deleted file mode 100644 index 414a3a84..00000000 --- a/deps/.npm/connect/0.2.5/package/test/logger.test.js +++ /dev/null @@ -1,52 +0,0 @@ - -/** - * Module dependencies. - */ - -var connect = require('connect'), - helpers = require('./helpers'), - assert = require('assert'), - http = require('http'); - -module.exports = { - test: function(){ - var logs = []; - var fakeStream = { write: function(str){ logs.push(str); }}; - var orig = Date.prototype.toUTCString; - Date.prototype.toUTCString = function(){ - return 'Thu, 27 May 2010 03:23:50 GMT'; - } - var server = helpers.run( - connect.logger({ stream: fakeStream }), - require('./filters/uppercase')(), - require('./providers/echo')() - ); - - var req = server.request('POST', '/', { 'User-Agent': 'ext-test', 'Referrer': 'http://google.com' }); - req.buffer = true - req.addListener('response', function(res){ - res.addListener('end', function(){ - assert.equal('FOOBAR', res.body); - assert.equal( - '127.0.0.1 - - [Thu, 27 May 2010 03:23:50 GMT] "POST / HTTP/1.1" 200 - "http://google.com" "ext-test"\n', - logs[0]); - Date.prototype.toUTCString = orig; - }) - }) - req.write('foobar'); - req.end(); - }, - - 'test custom format': function(){ - var logs = []; - var fakeStream = { write: function(str){ logs.push(str); }}; - var server = helpers.run( - connect.logger({ stream: fakeStream, format: ':method :url' }), - require('./filters/uppercase')(), - require('./providers/echo')() - ); - server.assertResponse('GET', '/', 200, '', '', function(){ - assert.equal('GET /\n', logs[0], 'Test logger format option'); - }); - } -} \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/test/methodOverride.test.js b/deps/.npm/connect/0.2.5/package/test/methodOverride.test.js deleted file mode 100644 index 449ca689..00000000 --- a/deps/.npm/connect/0.2.5/package/test/methodOverride.test.js +++ /dev/null @@ -1,69 +0,0 @@ - -/** - * Module dependencies. - */ - -var connect = require('connect'), - helpers = require('./helpers'), - assert = require('assert'), - http = require('http'); - -module.exports = { - 'test valid http method': function(){ - var server = helpers.run( - connect.bodyDecoder(), - connect.methodOverride(), - function(req, res){ - assert.equal('PUT', req.method, 'Test method-override'); - res.writeHead(200); - res.end(); - } - ); - var req = server.request('POST', '/', { 'Content-Type': 'application/x-www-form-urlencoded' }); - req.write('_method=put'); - req.end(); - }, - - 'test invalid http method': function(){ - var server = helpers.run( - connect.bodyDecoder(), - connect.methodOverride(), - function(req, res){ - assert.equal('POST', req.method, 'Test method-override invalid method'); - res.writeHead(200); - res.end(); - } - ); - var req = server.request('POST', '/', { 'Content-Type': 'application/x-www-form-urlencoded' }); - req.write('_method=foobar'); - req.end(); - }, - - 'test custom key': function(){ - var server = helpers.run( - connect.bodyDecoder(), - connect.methodOverride('__method__'), - function(req, res){ - assert.equal('PUT', req.method, 'Test method-override custom key'); - res.writeHead(200); - res.end(); - } - ); - var req = server.request('POST', '/', { 'Content-Type': 'application/x-www-form-urlencoded' }); - req.write('__method__=put'); - req.end(); - }, - - 'test X-HTTP-Method-Override header': function(){ - var server = helpers.run( - connect.methodOverride(), - function(req, res){ - assert.equal('PUT', req.method, 'Test X-HTTP-Method-Override'); - res.writeHead(200); - res.end(); - } - ); - var req = server.request('POST', '/', { 'X-HTTP-Method-Override': 'PUT' }); - req.end(); - } -} \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/test/providers/echo.js b/deps/.npm/connect/0.2.5/package/test/providers/echo.js deleted file mode 100644 index 5a0a0dbe..00000000 --- a/deps/.npm/connect/0.2.5/package/test/providers/echo.js +++ /dev/null @@ -1,10 +0,0 @@ - -module.exports = function(){ - return function(req, res, next){ - res.writeHead(200, { - 'Content-Type': 'text/plain', - 'Conent-Length': req.body.length - }) - res.end(req.body) - }; -}; diff --git a/deps/.npm/connect/0.2.5/package/test/router.test.js b/deps/.npm/connect/0.2.5/package/test/router.test.js deleted file mode 100644 index 7d1fea43..00000000 --- a/deps/.npm/connect/0.2.5/package/test/router.test.js +++ /dev/null @@ -1,176 +0,0 @@ - -/** - * Module dependencies. - */ - -var connect = require('connect'), - helpers = require('./helpers'), - assert = require('assert'), - http = require('http'); - -/** - * Path to ./test/fixtures/ - */ - -var fixturesPath = __dirname + '/fixtures'; - -// Faux products app - -function products(app){ - app.get('/.:format?', function(req, res){ - res.writeHead(200, {}); - res.end('products' + (req.params.format ? ' as ' + req.params.format : '')); - }); - app.get('/:id', function(req, res){ - res.writeHead(200, {}); - res.end('product ' + req.params.id); - }); -} - -// Faux main app - -function main(app){ - app.post('/', function(req, res){ - res.writeHead(200, {}); - res.end('POST /'); - }); - app.put('/', function(req, res){ - res.writeHead(200, {}); - res.end('PUT /'); - }); - app.del('/', function(req, res){ - res.writeHead(200, {}); - res.end('DELETE /'); - }); - app.get('/', function(req, res){ - res.writeHead(200, {}); - res.end('GET /'); - }); - app.get('/public/*', function(req, res){ - res.writeHead(200, {}); - res.end('splat "' + req.params[0] + '"'); - }); - app.get('/files/*.*', function(req, res){ - res.writeHead(200, {}); - res.end('path: "' + req.params[0] + '" ext: "' + req.params[1] + '"'); - }); - app.get('/user/:id/:operation?', function(req, res){ - res.writeHead(200, {}); - res.end((req.params.operation || 'view') + 'ing user ' + req.params.id); - }); - app.get('/range/:from-:to?', function(req, res){ - res.writeHead(200, {}); - res.end('range ' + req.params.from + ' to ' + (req.params.to || 'HEAD')); - }); - app.get('/users.:format', function(req, res){ - res.writeHead(200, {}); - res.end(req.params.format + ' format'); - }); - app.get(/\/commit\/(\w+)\.\.(\w+)\/?/i, function(req, res){ - res.writeHead(200, {}); - res.end('captures: ' + [req.params[0], req.params[1]].join(', ')); - }); - app.get('/next', function(req, res, next){ - next(); - }); - app.get('/error', function(req, res, params, next){ - throw new Error('boom!'); - }); - app.get('/cookies.:format?', function(req, res, next){ - var cookies = ['num', 'num']; - res.writeHead(200, {}); - switch (req.params.format) { - case 'json': - res.end(JSON.stringify(cookies)); - break; - default: - res.end(cookies.join(' ')); - } - }); - app.get('/items/:id?', function(req, res, next){ - if (req.params.id) { - res.writeHead(200, {}); - res.end('item ' + req.params.id); - } else { - next(); - } - }); - app.get('/items', function(req, res, next){ - next() - }); - app.get('/items', function(req, res){ - res.writeHead(200, {}); - res.end('items'); - }); - app.get('/failure/:id?', function(req, res, next){ - next(new Error('fail boat')); - }); - app.get('/failure', function(req, res){ - assert.fail('next(new Error) passed to next matching router callback'); - }); - app.get('/out/:id?', function(req, res, next){ - next(true); - }); - app.get('/out', function(){ - assert.fail('Called /out'); - }); - app.get('/cars/:id.:format?', function(req, res, next){ - res.writeHead(200, {}); - res.end('format: ' + req.params.format + ' id: ' + req.params.id); - }); - app.get('/account/:id/files/:file', function(req, res){ - res.writeHead(200); - res.end('file: ' + req.params.file); - }); -} - -module.exports = { - 'test routing': function(){ - var server = helpers.run(); - server.use('/products', connect.router(products)); - server.use('/', connect.router(main)); - server.use('/', connect.errorHandler({ showMessage: true })); - - server.assertResponse('GET', '/out', 404, 'Cannot GET /out'); - - server.assertResponse('GET', '/items/12', 200, 'item 12'); - server.assertResponse('GET', '/items', 200, 'items'); - - server.assertResponse('GET', '/failure/12', 500, 'Error: fail boat'); - - server.assertResponse('GET', '/products', 200, 'products'); - server.assertResponse('GET', '/products/', 200, 'products'); - server.assertResponse('GET', '/products.json', 200, 'products as json'); - server.assertResponse('GET', '/products/12', 200, 'product 12'); - - server.assertResponse('GET', '/next', 404, 'Cannot GET /next'); - server.assertResponse('GET', '/error', 500, 'Error: boom!'); - - server.assertResponse('GET', '/cars/%5Bhey%5D', 200, 'format: undefined id: [hey]'); - server.assertResponse('GET', '/cars/12', 200, 'format: undefined id: 12'); - server.assertResponse('GET', '/cars/12.json', 200, 'format: json id: 12'); - - server.assertResponse('GET', '/account/12/files/jquery.js', 200, 'file: jquery.js'); - - server.assertResponse('GET', '/', 200, 'GET /', 'Test router GET /'); - server.assertResponse('POST', '/', 200, 'POST /', 'Test router POST /'); - server.assertResponse('PUT', '/', 200, 'PUT /', 'Test router PUT /'); - server.assertResponse('DELETE', '/', 200, 'DELETE /', 'Test router DELETE /'); - server.assertResponse('GET', '/user', 404, 'Cannot GET /user', 'Test router GET unmatched path param'); - server.assertResponse('GET', '/user/12', 200, 'viewing user 12', 'Test router GET matched path param'); - server.assertResponse('GET', '/user/12/', 200, 'viewing user 12', 'Test router GET matched path param with trailing slash'); - server.assertResponse('GET', '/user/99/edit', 200, 'editing user 99', 'Test router GET matched path with several params'); - server.assertResponse('GET', '/user/99/edit/', 200, 'editing user 99', 'Test router GET matched path with several params with trailing slash'); - server.assertResponse('GET', '/range/11-99', 200, 'range 11 to 99'); - server.assertResponse('GET', '/range/11-', 200, 'range 11 to HEAD'); - server.assertResponse('GET', '/users.json', 200, 'json format'); - server.assertResponse('GET', '/cookies', 200, 'num num', 'Test router optional placeholder without value'); - server.assertResponse('GET', '/cookies.json', 200, '["num","num"]', 'Test reset optional placeholder with value'); - server.assertResponse('GET', '/public', 404, 'Cannot GET /public', 'Test required splat without value'); - server.assertResponse('GET', '/public/jquery.js', 200, 'splat "jquery.js"', 'Test required splat with value'); - server.assertResponse('GET', '/public/javascripts/jquery.js', 200, 'splat "javascripts/jquery.js"', 'Test required splat with segmented'); - server.assertResponse('GET', '/files/jquery.js', 200, 'path: "jquery" ext: "js"', 'Test several required splats'); - server.assertResponse('GET', '/files/javascripts/jquery.js', 200, 'path: "javascripts/jquery" ext: "js"', 'Test several required splats'); - server.assertResponse('GET', '/commit/foo..bar', 200, 'captures: foo, bar', 'Test RegExp paths'); - } -} \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/test/session.test.js b/deps/.npm/connect/0.2.5/package/test/session.test.js deleted file mode 100644 index 091f7cf9..00000000 --- a/deps/.npm/connect/0.2.5/package/test/session.test.js +++ /dev/null @@ -1,123 +0,0 @@ - -/** - * Module dependencies. - */ - -var connect = require('connect'), - helpers = require('./helpers'), - assert = require('assert'), - http = require('http'); - -// Session - -var Session = connect.session.Session; - -// Stores - -var MemoryStore = connect.session.MemoryStore; - -module.exports = { - 'test MemoryStore': function(){ - var n = 0, sid; - var server = helpers.run( - connect.cookieDecoder(), - connect.session({ store: new MemoryStore({ reapInterval: -1 }) }), - function(req, res, next){ - assert.ok(req.sessionStore, 'Test req.sessionStore'); - assert.ok(req.sessionID, 'Test req.sessionID'); - switch (n++) { - case 0: - assert.eql(['lastAccess'], - Object.keys(req.session), - 'Test MemoryStore session initialization'); - break; - case 1: - req.sessionStore.length(function(err, len){ - assert.equal(1, len, 'Test MemoryStore#length()'); - }); - assert.eql(['lastAccess'], - Object.keys(req.session), - 'Test MemoryStore session initialization with invalid sid'); - assert.notEqual('123123', req.sessionID, 'Test MemoryStore sid regeneration'); - break; - case 3: - assert.equal(sid, req.sessionID, 'Test MemoryStore persistence'); - break; - case 4: - assert.notEqual(sid, req.sessionID, 'Test MemoryStore User-Agent fingerprint'); - break; - case 5: - req.sessionStore.destroy(req.sessionID, function(err){ - assert.ok(!err, 'Test MemoryStore#destroy() when present'); - }); - break; - case 6: - req.sessionStore.destroy(req, function(err, destroyed){ - assert.ok(!err); - assert.ok(!destroyed, 'Test MemoryStore#destroy()'); - }); - var sess = new Session(req, '12323'); - assert.eql(['lastAccess'], Object.keys(sess), 'Test new Session(req, sid)'); - assert.equal(req, sess.req, 'Test Session#req'); - - var sess = new Session(req, { name: 'tj', lastAccess: +new Date }); - assert.eql(['name', 'lastAccess'], Object.keys(sess)); - assert.equal(req, sess.req, 'Test Session#req'); - break; - case 7: - req.sessionStore.get(req.sessionID, function(err, sess){ - assert.ok(sess, 'Test MemoryStore#get() when present'); - req.session.destroy(function(err){ - assert.ok(!err); - req.sessionStore.get(req.sessionID, function(err, sess){ - assert.ok(!sess, 'Test MemoryStore#get() when not present'); - }); - }); - }); - break; - case 8: - var prev = req.sessionID; - req.session.regenerate(function(err){ - assert.ok(!err); - assert.notEqual(prev, req.sessionID, 'Test Session#regenerate()'); - }); - break; - case 9: - req.session.destroy(function(err){ - assert.ok(!err); - assert.ok(!req.session, 'Test Session#destroy()'); - }); - req.sessionStore.clear(function(err){ - assert.ok(!err); - req.sessionStore.length(function(err, len){ - assert.equal(0, len, 'Test MemoryStore#clear()'); - }); - }); - break; - } - next(); - } - ); - - server.pending = 10; - server.request('GET', '/').end(); - server.request('GET', '/', { 'Cookie': 'connect.sid=123123' }).end(); - - var req = server.request('GET', '/', { 'User-Agent': 'foo' }); - req.addListener('response', function(res){ - var setCookie = res.headers['set-cookie']; - sid = setCookie.match(/connect\.sid=([^;]+)/)[1]; - assert.ok(setCookie.indexOf('connect.sid=') === 0, 'Test MemoryStore Set-Cookie connect.sid'); - assert.ok(setCookie.indexOf('httpOnly') !== -1, 'Test MemoryStore Set-Cookie httpOnly'); - assert.ok(setCookie.indexOf('expires=') !== -1, 'Test MemoryStore Set-Cookie expires'); - server.request('GET', '/', { 'Cookie': 'connect.sid=' + sid, 'User-Agent': 'foo' }).end(); - server.request('GET', '/', { 'Cookie': 'connect.sid=' + sid, 'User-Agent': 'bar' }).end(); - server.request('GET', '/', { 'Cookie': 'connect.sid=' + sid, 'User-Agent': 'foo' }).end(); - server.request('GET', '/', { 'Cookie': 'connect.sid=' + sid, 'User-Agent': 'foo' }).end(); - server.request('GET', '/', { 'Cookie': 'connect.sid=' + sid, 'User-Agent': 'foo' }).end(); - server.request('GET', '/', { 'Cookie': 'connect.sid=' + sid, 'User-Agent': 'foo' }).end(); - server.request('GET', '/', { 'Cookie': 'connect.sid=' + sid, 'User-Agent': 'foo' }).end(); - }); - req.end(); - } -}; \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/test/static.test.js b/deps/.npm/connect/0.2.5/package/test/static.test.js deleted file mode 100644 index 1f3ddef0..00000000 --- a/deps/.npm/connect/0.2.5/package/test/static.test.js +++ /dev/null @@ -1,87 +0,0 @@ - -/** - * Module dependencies. - */ - -var connect = require('connect'), - helpers = require('./helpers'), - assert = require('assert'), - http = require('http'); - -/** - * Path to ./test/fixtures/ - */ - -var fixturesPath = __dirname + '/fixtures'; - -module.exports = { - 'test valid file': function(){ - var server = helpers.run( - connect.staticProvider(fixturesPath) - ); - var req = server.request('GET', '/user.json'); - req.buffer = true; - req.addListener('response', function(res){ - res.addListener('end', function(){ - var headers = res.headers, - body = '{\n "name": "tj",\n "email": "tj@sencha.com"\n}'; - assert.equal(200, res.statusCode, 'Test static with valid file status code'); - assert.equal(body, res.body, 'Test static with valid file response body'); - assert.equal('application/json', headers['content-type'], 'Test static with valid file Content-Type'); - assert.equal(body.length, headers['content-length'], 'Test static with valid file Content-Length'); - assert.ok(headers['last-modified'], 'Test static with valid file Last-Modified'); - assert.ok(headers['cache-control'] == 'public max-age=31536000', 'Test static with valid file Cache-Control'); - }); - }); - req.end(); - }, - - 'test configurable cache-control': function(){ - var server = helpers.run( - connect.staticProvider({ root: fixturesPath, maxAge: 60000 }) - ); - var req = server.request('GET', '/user.json'); - req.buffer = true; - req.addListener('response', function(res){ - res.addListener('end', function(){ - assert.ok(res.headers['cache-control'] == 'public max-age=60000', 'Test configurable Cache-Control support'); - }); - }); - req.end(); - }, - - 'test urlencoded': function(){ - var server = helpers.run( - connect.staticProvider({ root: fixturesPath }) - ); - server.assertResponse('GET', '/some%20text.txt', 200, 'whoop', 'Test urlencoded path'); - }, - - 'test index.html support': function(){ - var server = helpers.run( - connect.staticProvider({ root: fixturesPath }) - ); - server.assertResponse('GET', '/', 200, '

    Wahoo!

    ', 'Test static index.html support.'); - }, - - 'test index.html support when missing': function(){ - var server = helpers.run( - connect.staticProvider({ root: __dirname }) - ); - server.assertResponse('GET', '/', 404, 'Cannot GET /', 'Test static index.html support when missing.'); - }, - - 'test invalid file': function(){ - var server = helpers.run( - connect.staticProvider({ root: fixturesPath }) - ); - server.assertResponse('GET', '/foo.json', 404, 'Cannot GET /foo.json', 'Test invalid static file.'); - }, - - 'test directory': function(){ - var server = helpers.run( - connect.staticProvider({ root: __dirname }) - ); - server.assertResponse('GET', '/fixtures', 404, 'Cannot GET /fixtures'); - } -} diff --git a/deps/.npm/connect/0.2.5/package/test/staticGzip.test.js b/deps/.npm/connect/0.2.5/package/test/staticGzip.test.js deleted file mode 100644 index ed079620..00000000 --- a/deps/.npm/connect/0.2.5/package/test/staticGzip.test.js +++ /dev/null @@ -1,85 +0,0 @@ - -/** - * Module dependencies. - */ - -var connect = require('connect'), - helpers = require('./helpers'), - assert = require('assert'), - http = require('http'), - fs = require('fs'); - -/** - * Path to ./test/fixtures/ - */ - -var fixturesPath = __dirname + '/fixtures'; - -module.exports = { - 'test does not Accept gzip': function(){ - var server = helpers.run( - connect.staticGzip({ root: fixturesPath, compress: ['text/css'] }), - connect.staticProvider(fixturesPath) - ); - var req = server.request('GET', '/style.css'); - req.buffer = true; - req.on('response', function(res){ - res.on('end', function(){ - assert.notEqual('gzip', res.headers['content-encoding']); - }); - }); - req.end(); - }, - - 'test non-compressable': function(){ - var server = helpers.run( - connect.staticGzip({ root: fixturesPath, compress: ['text/html'] }), - connect.staticProvider(fixturesPath) - ); - var req = server.request('GET', '/style.css', { Accept: 'gzip' }); - req.buffer = true; - req.on('response', function(res){ - res.on('end', function(){ - assert.notEqual('gzip', res.headers['content-encoding']); - }); - }); - req.end(); - }, - - 'test compressable': function(){ - var server = helpers.run( - connect.staticGzip({ root: fixturesPath, compress: ['text/css', 'text/html'] }), - connect.staticProvider(fixturesPath) - ); - - try { - var stat = fs.statSync(fixturesPath + '/style.css'), - path = fixturesPath + '/style.css.' + Number(stat.mtime) + '.gz'; - fs.unlinkSync(path); - } catch (err) { - // Ignore - } - - server.pending = 2; - // Pre-compression - var req = server.request('GET', '/style.css', { 'Accept-Encoding': 'gzip' }); - req.buffer = true; - req.on('response', function(res){ - res.on('end', function(){ - assert.notEqual('gzip', res.headers['content-encoding'], 'Content-Encoding: gzip when not gzipped'); - - // Post-compression - var req = server.request('GET', '/style.css', { 'Accept-Encoding': 'gzip' }); - req.buffer = true; - req.on('response', function(res){ - res.on('end', function(){ - assert.equal('text/css', res.headers['content-type']); - assert.equal('gzip', res.headers['content-encoding'], 'missing Content-Encoding: gzip when gzipped'); - }); - }); - req.end(); - }); - }); - req.end(); - } -} diff --git a/deps/.npm/connect/0.2.5/package/test/utils.test.js b/deps/.npm/connect/0.2.5/package/test/utils.test.js deleted file mode 100644 index f5763a10..00000000 --- a/deps/.npm/connect/0.2.5/package/test/utils.test.js +++ /dev/null @@ -1,65 +0,0 @@ - -/** - * Module dependencies. - */ - -var utils = require('connect').utils, - assert = require('assert'); - -module.exports = { - 'test md5()': function(){ - assert.equal('5JMpgGF2EjbJawLqaqiirQ==', utils.md5('wahoo', 'base64')); - assert.equal('e493298061761236c96b02ea6aa8a2ad', utils.md5('wahoo')); - }, - - 'test merge()': function(){ - assert.eql({ foo: 'bar' }, utils.merge({ foo: 'bar' })); - assert.eql({ foo: 'bar', bar: 'baz' }, utils.merge({ foo: 'bar' }, { bar: 'baz' })); - assert.eql({ foo: 'baz' }, utils.merge({ foo: 'bar' }, { foo: 'baz' })); - }, - - 'test toBoolean()': function(){ - assert.strictEqual(true, utils.toBoolean(true)); - assert.strictEqual(true, utils.toBoolean(1)); - assert.strictEqual(true, utils.toBoolean('1')); - assert.strictEqual(true, utils.toBoolean('true')); - assert.strictEqual(true, utils.toBoolean('yes')); - assert.strictEqual(true, utils.toBoolean('y')); - - assert.strictEqual(false, utils.toBoolean(false)); - assert.strictEqual(false, utils.toBoolean(0)); - assert.strictEqual(false, utils.toBoolean('0')); - assert.strictEqual(false, utils.toBoolean('-1')); - assert.strictEqual(false, utils.toBoolean('false')); - assert.strictEqual(false, utils.toBoolean('no')); - assert.strictEqual(false, utils.toBoolean('n')); - assert.strictEqual(false, utils.toBoolean('awrasdfasdfas')); - assert.strictEqual(false, utils.toBoolean('')); - }, - - 'test parseCookie()': function(){ - assert.eql({ foo: 'bar' }, utils.parseCookie('foo=bar')); - assert.eql({ sid: '123' }, utils.parseCookie('SID=123')); - assert.eql({ sid: '123' }, utils.parseCookie('SID=123;SID=somethingElse')); - assert.eql({ foo: 'bar', baz: 'raz' }, utils.parseCookie('foo = bar; baz = raz')); - assert.eql({ fbs: 'uid=0987654321&name=Test User' }, utils.parseCookie('fbs="uid=0987654321&name=Test+User"')); - }, - - 'test serializeCookie()': function(){ - assert.equal('foo=bar; path=/', utils.serializeCookie('foo', 'bar', { path: '/' })); - assert.equal('foo=bar; secure', utils.serializeCookie('foo', 'bar', { secure: true })); - assert.equal('foo=bar', utils.serializeCookie('foo', 'bar', { secure: false })); - assert.equal('foo=foo%20bar', utils.serializeCookie('foo', 'foo bar')); - }, - - 'test mime.type()': function(){ - assert.equal('image/png', utils.mime.type('some.png')); - assert.equal('image/png', utils.mime.type('some.lame.PNG')); - assert.equal('image/png', utils.mime.type('some.lame.png')); - assert.equal('image/png', utils.mime.type('path/to/some/ super lame.png')); - assert.equal('application/octet-stream', utils.mime.type('foo.bar')); - assert.equal('application/octet-stream', utils.mime.type('')); - assert.equal('application/octet-stream', utils.mime.type()); - - } -}; \ No newline at end of file diff --git a/deps/.npm/connect/0.2.5/package/test/vhost.test.js b/deps/.npm/connect/0.2.5/package/test/vhost.test.js deleted file mode 100644 index a78e9076..00000000 --- a/deps/.npm/connect/0.2.5/package/test/vhost.test.js +++ /dev/null @@ -1,46 +0,0 @@ - -/** - * Module dependencies. - */ - -var connect = require('connect'), - helpers = require('./helpers'), - assert = require('assert'), - http = require('http'); - -module.exports = { - test: function(){ - var server = helpers.run( - connect.vhost('foo.com', connect.createServer( - function(req, res){ - res.writeHead(200, {}); - res.end('from foo'); - } - )), - connect.vhost('bar.com', connect.createServer( - function(req, res){ - res.writeHead(200, {}); - res.end('from bar'); - } - )) - ); - - var req = server.request('GET', '/', { Host: 'foo.com' }); - req.buffer = true; - req.addListener('response', function(res){ - res.addListener('end', function(){ - assert.equal('from foo', res.body); - }); - }); - req.end(); - - var req = server.request('GET', '/', { Host: 'bar.com' }); - req.buffer = true; - req.addListener('response', function(res){ - res.addListener('end', function(){ - assert.equal('from bar', res.body); - }); - }); - req.end(); - } -} \ No newline at end of file diff --git a/deps/.npm/connect/active b/deps/.npm/connect/active deleted file mode 120000 index 646bb720..00000000 --- a/deps/.npm/connect/active +++ /dev/null @@ -1 +0,0 @@ -./0.2.5 \ No newline at end of file diff --git a/deps/.npm/underscore/1.1.0/package/.DS_Store b/deps/.npm/underscore/1.1.0/package/.DS_Store deleted file mode 100644 index db363f3d..00000000 Binary files a/deps/.npm/underscore/1.1.0/package/.DS_Store and /dev/null differ diff --git a/deps/.npm/underscore/1.1.0/package/LICENSE b/deps/.npm/underscore/1.1.0/package/LICENSE deleted file mode 100644 index d8cef485..00000000 --- a/deps/.npm/underscore/1.1.0/package/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2010 Jeremy Ashkenas, DocumentCloud - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/deps/.npm/underscore/1.1.0/package/README b/deps/.npm/underscore/1.1.0/package/README deleted file mode 100644 index c7eb97bd..00000000 --- a/deps/.npm/underscore/1.1.0/package/README +++ /dev/null @@ -1,32 +0,0 @@ - __ - /\ \ __ - __ __ ___ \_\ \ __ _ __ ____ ___ ___ _ __ __ /\_\ ____ -/\ \/\ \ /' _ `\ /'_ \ /'__`\/\ __\/ ,__\ / ___\ / __`\/\ __\/'__`\ \/\ \ /',__\ -\ \ \_\ \/\ \/\ \/\ \ \ \/\ __/\ \ \//\__, `\/\ \__//\ \ \ \ \ \//\ __/ __ \ \ \/\__, `\ - \ \____/\ \_\ \_\ \___,_\ \____\\ \_\\/\____/\ \____\ \____/\ \_\\ \____\/\_\ _\ \ \/\____/ - \/___/ \/_/\/_/\/__,_ /\/____/ \/_/ \/___/ \/____/\/___/ \/_/ \/____/\/_//\ \_\ \/___/ - \ \____/ - \/___/ - -Underscore is a utility-belt library for JavaScript that provides -a lot of the functional programming support that you would expect -in Prototype.js (or Ruby), but without extending any of the built- -in JavaScript objects. It's the tie to go along with jQuery's tux. - -For Docs, License, Tests, and pre-packed downloads, see: -http://documentcloud.github.com/underscore/ - -Many thanks to our contributors: - - Dmitry Baranovskiy - Tim Caswell - Mathieu D'Amours - Rick Fletcher - Mike Frawley - Kirill Ishanov - Kris Kowal - Jed Schmidt - Noah Sloan - Nick Stenning - Luke Sutton - John Wright diff --git a/deps/.npm/underscore/1.1.0/package/Rakefile b/deps/.npm/underscore/1.1.0/package/Rakefile deleted file mode 100644 index 721c294b..00000000 --- a/deps/.npm/underscore/1.1.0/package/Rakefile +++ /dev/null @@ -1,10 +0,0 @@ -require 'rubygems' -require 'closure-compiler' - -desc "Use the Closure Compiler to compress Underscore.js" -task :build do - js = File.open('underscore.js', 'r') - min = Closure::Compiler.new.compile(js) - File.open('underscore-min.js', 'w') {|f| f.write(min) } -end - diff --git a/deps/.npm/underscore/1.1.0/package/index.html b/deps/.npm/underscore/1.1.0/package/index.html deleted file mode 100644 index 597d8f60..00000000 --- a/deps/.npm/underscore/1.1.0/package/index.html +++ /dev/null @@ -1,1410 +0,0 @@ - - - - - - Underscore.js - - - - -
    - -

    Underscore.js

    - -

    - Underscore is a - utility-belt library for JavaScript that provides a lot of the - functional programming support that you would expect in - Prototype.js - (or Ruby), - but without extending any of the built-in JavaScript objects. It's the - tie to go along with jQuery's tux. -

    - -

    - Underscore provides 60-odd functions that support both the usual - functional suspects: map, select, invoke — - as well as more specialized helpers: function binding, javascript - templating, deep equality testing, and so on. It delegates to built-in - functions, if present, so modern browsers will use the - native implementations of forEach, map, reduce, - filter, every, some and indexOf. -

    - -

    - A complete Test & Benchmark Suite - is included for your perusal. -

    - -

    - The unabridged source code is - available on GitHub. -

    - -

    - Underscore is an open-source component of DocumentCloud. -

    - -

    Downloads (Right-click, and use "Save As")

    - - - - - - - - - - -
    Development Version (1.1.0)25kb, Uncompressed with Comments
    Production Version (1.1.0)3kb, Packed and Gzipped
    - -

    Table of Contents

    - - Object-Oriented and Functional Styles - -

    - Collections -
    - each, map, - reduce, reduceRight, - detect, select, - reject, all, - any, include, - invoke, pluck, - max, min, - sortBy, sortedIndex, - toArray, size -

    - -

    - Arrays -
    - first, rest, last, - compact, flatten, without, uniq, - intersect, zip, indexOf, - lastIndexOf, range -

    - -

    - Functions -
    - bind, bindAll, - memoize, delay, defer, - wrap, compose -

    - -

    - Objects -
    - keys, values, - functions, extend, clone, tap, - isEqual, isEmpty, isElement, - isArray, isArguments, isFunction, isString, - isNumber, isBoolean, isDate, isRegExp - isNaN, isNull, - isUndefined - -

    - -

    - Utility -
    - noConflict, - identity, times, - breakLoop, mixin, - uniqueId, template -

    - -

    - Chaining -
    - chain, value -

    - -
    - -

    Object-Oriented and Functional Styles

    - -

    - You can use Underscore in either an object-oriented or a functional style, - depending on your preference. The following two lines of code are - identical ways to double a list of numbers. -

    - -
    -_.map([1, 2, 3], function(n){ return n * 2; });
    -_([1, 2, 3]).map(function(n){ return n * 2; });
    - -

    - Using the object-oriented style allows you to chain together methods. Calling - chain on a wrapped object will cause all future method calls to - return wrapped objects as well. When you've finished the computation, - use value to retrieve the final value. Here's an example of chaining - together a map/flatten/reduce, in order to get the word count of - every word in a song. -

    - -
    -var lyrics = [
    -  {line : 1, words : "I'm a lumberjack and I'm okay"},
    -  {line : 2, words : "I sleep all night and I work all day"},
    -  {line : 3, words : "He's a lumberjack and he's okay"},
    -  {line : 4, words : "He sleeps all night and he works all day"}
    -];
    -
    -_(lyrics).chain()
    -  .map(function(line) { return line.words.split(' '); })
    -  .flatten()
    -  .reduce(function(counts, word) {
    -    counts[word] = (counts[word] || 0) + 1;
    -    return counts;
    -}, {}).value();
    -
    -=> {lumberjack : 2, all : 4, night : 2 ... }
    - -

    - In addition, the - Array prototype's methods - are proxied through the chained Underscore object, so you can slip a - reverse or a push into your chain, and continue to - modify the array. -

    - -

    Collection Functions (Arrays or Objects)

    - -

    - each_.each(list, iterator, [context]) - Alias: forEach -
    - Iterates over a list of elements, yielding each in turn to an iterator - function. The iterator is bound to the context object, if one is - passed. Each invocation of iterator is called with three arguments: - (element, index, list). If list is a JavaScript object, iterator's - arguments will be (value, key, list). Use breakLoop - to break out of the iteration. Delegates to the native - forEach function if it exists. -

    -
    -_.each([1, 2, 3], function(num){ alert(num); });
    -=> alerts each number in turn...
    - -

    - map_.map(list, iterator, [context]) -
    - Produces a new array of values by mapping each value in list - through a transformation function (iterator). If the native - map method exists, it will be used instead. -

    -
    -_.map([1, 2, 3], function(num){ return num * 3 });
    -=> [3, 6, 9]
    - -

    - reduce_.reduce(list, iterator, memo, [context]) - Aliases: inject, foldl -
    - Also known as inject and foldl, reduce boils down a - list of values into a single value. Memo is the initial state - of the reduction, and each successive step of it should be returned by - iterator. -

    -
    -var sum = _.reduce([1, 2, 3], function(memo, num){ return memo + num }, 0);
    -=> 6
    -
    - -

    - reduceRight_.reduceRight(list, iterator, memo, [context]) - Alias: foldr -
    - The right-associative version of reduce. Delegates to the - JavaScript 1.8 version of reduceRight, if it exists. Foldr - is not as useful in JavaScript as it would be in a language with lazy - evaluation. -

    -
    -var list = [[0, 1], [2, 3], [4, 5]];
    -var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []);
    -=> [4, 5, 2, 3, 0, 1]
    -
    - -

    - detect_.detect(list, iterator, [context]) -
    - Looks through each value in the list, returning the first one that - passes a truth test (iterator). The function returns as - soon as it finds an acceptable element, and doesn't traverse the - entire list. -

    -
    -var even = _.detect([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; });
    -=> 2
    -
    - -

    - select_.select(list, iterator, [context]) - Alias: filter -
    - Looks through each value in the list, returning an array of all - the values that pass a truth test (iterator). Delegates to the - native filter method, if it exists. -

    -
    -var evens = _.select([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; });
    -=> [2, 4, 6]
    -
    - -

    - reject_.reject(list, iterator, [context]) -
    - Returns the values in list without the elements that the truth - test (iterator) passes. The opposite of select. -

    -
    -var odds = _.reject([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; });
    -=> [1, 3, 5]
    -
    - -

    - all_.all(list, [iterator], [context]) - Alias: every -
    - Returns true if all of the values in the list pass the iterator - truth test. If an iterator is not provided, the truthy value of - the element will be used instead. Delegates to the native method every, if - present. -

    -
    -_.all([true, 1, null, 'yes']);
    -=> false
    -
    - -

    - any_.any(list, [iterator], [context]) - Alias: some -
    - Returns true if any of the values in the list pass the - iterator truth test. Short-circuits and stops traversing the list - if a true element is found. Delegates to the native method some, - if present. -

    -
    -_.any([null, 0, 'yes', false]);
    -=> true
    -
    - -

    - include_.include(list, value) - Alias: contains -
    - Returns true if the value is present in the list, using - === to test equality. Uses indexOf internally, if list - is an Array. -

    -
    -_.include([1, 2, 3], 3);
    -=> true
    -
    - -

    - invoke_.invoke(list, methodName, [*arguments]) -
    - Calls the method named by methodName on each value in the list. - Any extra arguments passed to invoke will be forwarded on to the - method invocation. -

    -
    -_.invoke([[5, 1, 7], [3, 2, 1]], 'sort');
    -=> [[1, 5, 7], [1, 2, 3]]
    -
    - -

    - pluck_.pluck(list, propertyName) -
    - An convenient version of what is perhaps the most common use-case for - map: extracting a list of property values. -

    -
    -var stooges = [{name : 'moe', age : 40}, {name : 'larry', age : 50}, {name : 'curly', age : 60}];
    -_.pluck(stooges, 'name');
    -=> ["moe", "larry", "curly"]
    -
    - -

    - max_.max(list, [iterator], [context]) -
    - Returns the maximum value in list. If iterator is passed, - it will be used on each value to generate the criterion by which the - value is ranked. -

    -
    -var stooges = [{name : 'moe', age : 40}, {name : 'larry', age : 50}, {name : 'curly', age : 60}];
    -_.max(stooges, function(stooge){ return stooge.age; });
    -=> {name : 'curly', age : 60};
    -
    - -

    - min_.min(list, [iterator], [context]) -
    - Returns the minimum value in list. If iterator is passed, - it will be used on each value to generate the criterion by which the - value is ranked. -

    -
    -var numbers = [10, 5, 100, 2, 1000];
    -_.min(numbers);
    -=> 2
    -
    - -

    - sortBy_.sortBy(list, iterator, [context]) -
    - Returns a sorted list, ranked by the results of running each - value through iterator. -

    -
    -_.sortBy([1, 2, 3, 4, 5, 6], function(num){ return Math.sin(num); });
    -=> [5, 4, 6, 3, 1, 2]
    -
    - -

    - sortedIndex_.sortedIndex(list, value, [iterator]) -
    - Uses a binary search to determine the index at which the value - should be inserted into the list in order to maintain the list's - sorted order. If an iterator is passed, it will be used to compute - the sort ranking of each value. -

    -
    -_.sortedIndex([10, 20, 30, 40, 50], 35);
    -=> 3
    -
    - -

    - toArray_.toArray(list) -
    - Converts the list (anything that can be iterated over), into a - real Array. Useful for transmuting the arguments object. -

    -
    -(function(){ return _.toArray(arguments).slice(0); })(1, 2, 3);
    -=> [1, 2, 3]
    -
    - -

    - size_.size(list) -
    - Return the number of values in the list. -

    -
    -_.size({one : 1, two : 2, three : 3});
    -=> 3
    -
    - -

    Array Functions

    - -

    - Note: All array functions will also work on the arguments object. -

    - -

    - first_.first(array, [n]) - Alias: head -
    - Returns the first element of an array. Passing n will - return the first n elements of the array. -

    -
    -_.first([5, 4, 3, 2, 1]);
    -=> 5
    -
    - -

    - rest_.rest(array, [index]) - Alias: tail -
    - Returns the rest of the elements in an array. Pass an index - to return the values of the array from that index onward. -

    -
    -_.rest([5, 4, 3, 2, 1]);
    -=> [4, 3, 2, 1]
    -
    - -

    - last_.last(array) -
    - Returns the last element of an array. -

    -
    -_.last([5, 4, 3, 2, 1]);
    -=> 1
    -
    - -

    - compact_.compact(array) -
    - Returns a copy of the array with all falsy values removed. - In JavaScript, false, null, 0, "", - undefined and NaN are all falsy. -

    -
    -_.compact([0, 1, false, 2, '', 3]);
    -=> [1, 2, 3]
    -
    - -

    - flatten_.flatten(array) -
    - Flattens a nested array (the nesting can be to any depth). -

    -
    -_.flatten([1, [2], [3, [[[4]]]]]);
    -=> [1, 2, 3, 4];
    -
    - -

    - without_.without(array, [*values]) -
    - Returns a copy of the array with all instances of the values - removed. === is used for the equality test. -

    -
    -_.without([1, 2, 1, 0, 3, 1, 4], 0, 1);
    -=> [2, 3, 4]
    -
    - -

    - uniq_.uniq(array, [isSorted]) -
    - Produces a duplicate-free version of the array, using === to test - object equality. If you know in advance that the array is sorted, - passing true for isSorted will run a much faster algorithm. -

    -
    -_.uniq([1, 2, 1, 3, 1, 4]);
    -=> [1, 2, 3, 4]
    -
    - -

    - intersect_.intersect(*arrays) -
    - Computes the list of values that are the intersection of all the arrays. - Each value in the result is present in each of the arrays. -

    -
    -_.intersect([1, 2, 3], [101, 2, 1, 10], [2, 1]);
    -=> [1, 2]
    -
    - -

    - zip_.zip(*arrays) -
    - Merges together the values of each of the arrays with the - values at the corresponding position. Useful when you have separate - data sources that are coordinated through matching array indexes. -

    -
    -_.zip(['moe', 'larry', 'curly'], [30, 40, 50], [true, false, false]);
    -=> [["moe", 30, true], ["larry", 40, false], ["curly", 50, false]]
    -
    - -

    - indexOf_.indexOf(array, value) -
    - Returns the index at which value can be found in the array, - or -1 if value is not present in the array. Uses the native - indexOf function unless it's missing. -

    -
    -_.indexOf([1, 2, 3], 2);
    -=> 1
    -
    - -

    - lastIndexOf_.lastIndexOf(array, value) -
    - Returns the index of the last occurrence of value in the array, - or -1 if value is not present. Uses the native lastIndexOf - function if possible. -

    -
    -_.lastIndexOf([1, 2, 3, 1, 2, 3], 2);
    -=> 4
    -
    - -

    - range_.range([start], stop, [step]) -
    - A function to create flexibly-numbered lists of integers, handy for - each and map loops. start, if omitted, defaults - to 0; step defaults to 1. Returns a list of integers - from start to stop, incremented (or decremented) by step, - exclusive. -

    -
    -_.range(10);
    -=> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
    -_.range(1, 11);
    -=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
    -_.range(0, 30, 5);
    -=> [0, 5, 10, 15, 20, 25]
    -_.range(0, -10, -1);
    -=> [0, -1, -2, -3, -4, -5, -6, -7, -8, -9]
    -_.range(0);
    -=> []
    -
    - -

    Function (uh, ahem) Functions

    - -

    - bind_.bind(function, object, [*arguments]) -
    - Bind a function to an object, meaning that whenever - the function is called, the value of this will be the object. - Optionally, bind arguments to the function to pre-fill them, - also known as currying. -

    -
    -var func = function(greeting){ return greeting + ': ' + this.name };
    -func = _.bind(func, {name : 'moe'}, 'hi');
    -func();
    -=> 'hi: moe'
    -
    - -

    - bindAll_.bindAll(object, [*methodNames]) -
    - Binds a number of methods on the object, specified by - methodNames, to be run in the context of that object whenever they - are invoked. Very handy for binding functions that are going to be used - as event handlers, which would otherwise be invoked with a fairly useless - this. If no methodNames are provided, all of the object's - function properties will be bound to it. -

    -
    -var buttonView = {
    -  label   : 'underscore',
    -  onClick : function(){ alert('clicked: ' + this.label); },
    -  onHover : function(){ console.log('hovering: ' + this.label); }
    -};
    -_.bindAll(buttonView);
    -jQuery('#underscore_button').bind('click', buttonView.onClick);
    -=> When the button is clicked, this.label will have the correct value...
    -
    - -

    - memoize_.memoize(function, [hashFunction]) -
    - Memoizes a given function by caching the computed result. Useful - for speeding up slow-running computations. If passed an optional - hashFunction, it will be used to compute the hash key for storing - the result, based on the arguments to the original function. -

    -
    -var fibonacci = function(n) {
    -  return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2);
    -};
    -var fastFibonacci = _.memoize(fibonacci);
    -
    - -

    - delay_.delay(function, wait, [*arguments]) -
    - Much like setTimeout, invokes function after wait - milliseconds. If you pass the optional arguments, they will be - forwarded on to the function when it is invoked. -

    -
    -var log = _.bind(console.log, console);
    -_.delay(log, 1000, 'logged later');
    -=> 'logged later' // Appears after one second.
    -
    - -

    - defer_.defer(function) -
    - Defers invoking the function until the current call stack has cleared, - similar to using setTimeout with a delay of 0. Useful for performing - expensive computations or HTML rendering in chunks without blocking the UI thread - from updating. -

    -
    -_.defer(function(){ alert('deferred'); });
    -// Returns from the function before the alert runs.
    -
    - -

    - wrap_.wrap(function, wrapper) -
    - Wraps the first function inside of the wrapper function, - passing it as the first argument. This allows the wrapper to - execute code before and after the function runs, adjust the arguments, - and execute it conditionally. -

    -
    -var hello = function(name) { return "hello: " + name; };
    -hello = _.wrap(hello, function(func) {
    -  return "before, " + func("moe") + ", after";
    -});
    -hello();
    -=> 'before, hello: moe, after'
    -
    - -

    - compose_.compose(*functions) -
    - Returns the composition of a list of 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())). -

    -
    -var greet    = function(name){ return "hi: " + name; };
    -var exclaim  = function(statement){ return statement + "!"; };
    -var welcome = _.compose(greet, exclaim);
    -welcome('moe');
    -=> 'hi: moe!'
    -
    - -

    Object Functions

    - -

    - keys_.keys(object) -
    - Retrieve all the names of the object's properties. -

    -
    -_.keys({one : 1, two : 2, three : 3});
    -=> ["one", "two", "three"]
    -
    - -

    - values_.values(object) -
    - Return all of the values of the object's properties. -

    -
    -_.values({one : 1, two : 2, three : 3});
    -=> [1, 2, 3]
    -
    - -

    - functions_.functions(object) - Alias: methods -
    - Returns a sorted list of the names of every method in an object — - that is to say, the name of every function property of the object. -

    -
    -_.functions(_);
    -=> ["all", "any", "bind", "bindAll", "clone", "compact", "compose" ...
    -
    - -

    - extend_.extend(destination, *sources) -
    - Copy all of the properties in the source objects over to the - destination object. It's in-order, to the last source will override - properties of the same name in previous arguments. -

    -
    -_.extend({name : 'moe'}, {age : 50});
    -=> {name : 'moe', age : 50}
    -
    - -

    - clone_.clone(object) -
    - Create a shallow-copied clone of the object. Any nested objects - or arrays will be copied by reference, not duplicated. -

    -
    -_.clone({name : 'moe'});
    -=> {name : 'moe'};
    -
    - -

    - tap_.tap(object, interceptor) -
    - Invokes interceptor with the object, and then returns object. - The primary purpose of this method is to "tap into" a method chain, in order to perform operations on intermediate results within the chain. -

    -
    -_([1,2,3,200]).chain().
    -  select(function(num) { return num % 2 == 0; }).
    -  tap(console.log).
    -  map(function(num) { return num * num }).
    -  value();
    -=> [2, 200]
    -=> [4, 40000]
    -
    - -

    - isEqual_.isEqual(object, other) -
    - Performs an optimized deep comparison between the two objects, to determine - if they should be considered equal. -

    -
    -var moe   = {name : 'moe', luckyNumbers : [13, 27, 34]};
    -var clone = {name : 'moe', luckyNumbers : [13, 27, 34]};
    -moe == clone;
    -=> false
    -_.isEqual(moe, clone);
    -=> true
    -
    - -

    - isEmpty_.isEmpty(object) -
    - Returns true if object contains no values. -

    -
    -_.isEmpty([1, 2, 3]);
    -=> false
    -_.isEmpty({});
    -=> true
    -
    - -

    - isElement_.isElement(object) -
    - Returns true if object is a DOM element. -

    -
    -_.isElement(jQuery('body')[0]);
    -=> true
    -
    - -

    - isArray_.isArray(object) -
    - Returns true if object is an Array. -

    -
    -(function(){ return _.isArray(arguments); })();
    -=> false
    -_.isArray([1,2,3]);
    -=> true
    -
    - -

    - isArguments_.isArguments(object) -
    - Returns true if object is an Arguments object. -

    -
    -(function(){ return _.isArguments(arguments); })(1, 2, 3);
    -=> true
    -_.isArguments([1,2,3]);
    -=> false
    -
    - -

    - isFunction_.isFunction(object) -
    - Returns true if object is a Function. -

    -
    -_.isFunction(alert);
    -=> true
    -
    - -

    - isString_.isString(object) -
    - Returns true if object is a String. -

    -
    -_.isString("moe");
    -=> true
    -
    - -

    - isNumber_.isNumber(object) -
    - Returns true if object is a Number. -

    -
    -_.isNumber(8.4 * 5);
    -=> true
    -
    - -

    - isBoolean_.isBoolean(object) -
    - Returns true if object is either true or false. -

    -
    -_.isBoolean(null);
    -=> false
    -
    - -

    - isDate_.isDate(object) -
    - Returns true if object is a Date. -

    -
    -_.isDate(new Date());
    -=> true
    -
    - -

    - isRegExp_.isRegExp(object) -
    - Returns true if object is a RegExp. -

    -
    -_.isRegExp(/moe/);
    -=> true
    -
    - -

    - isNaN_.isNaN(object) -
    - Returns true if object is NaN.
    Note: this is not - the same as the native isNaN function, which will also return - true if the variable is undefined. -

    -
    -_.isNaN(NaN);
    -=> true
    -isNaN(undefined);
    -=> true
    -_.isNaN(undefined);
    -=> false
    -
    - -

    - isNull_.isNull(object) -
    - Returns true if the value of object is null. -

    -
    -_.isNull(null);
    -=> true
    -_.isNull(undefined);
    -=> false
    -
    - -

    - isUndefined_.isUndefined(variable) -
    - Returns true if variable is undefined. -

    -
    -_.isUndefined(window.missingVariable);
    -=> true
    -
    - -

    Utility Functions

    - -

    - noConflict_.noConflict() -
    - Give control of the "_" variable back to its previous owner. Returns - a reference to the Underscore object. -

    -
    -var underscore = _.noConflict();
    - -

    - identity_.identity(value) -
    - Returns the same value that is used as the argument. In math: - f(x) = x
    - This function looks useless, but is used throughout Underscore as - a default iterator. -

    -
    -var moe = {name : 'moe'};
    -moe === _.identity(moe);
    -=> true
    - -

    - times_.times(n, iterator) -
    - Invokes the given iterator function n times. -

    -
    -_(3).times(function(){ genie.grantWish(); });
    - -

    - breakLoop_.breakLoop() -
    - Breaks out of the current loop iteration. Similar to the break - keyword in regular "for" loop, but works within an iterator function. - Uses the native StopIteration object in JavaScript 1.7 compliant - browsers. -

    -
    -var result = null;
    -_.each([1, 2, 3], function(num) {
    -  if ((result = num) == 2) _.breakLoop();
    -});
    -result;
    -=> 2
    - -

    - mixin_.mixin(object) -
    - Allows you to extend Underscore with your own utility functions. Pass - a hash of {name: function} definitions to have your functions - added to the Underscore object, as well as the OOP wrapper. -

    -
    -_.mixin({
    -  capitalize : function(string) {
    -    return string.charAt(0).toUpperCase() + string.substring(1).toLowerCase();
    -  }
    -});
    -_("fabio").capitalize();
    -=> "Fabio"
    -
    - -

    - uniqueId_.uniqueId([prefix]) -
    - Generate a globally-unique id for client-side models or DOM elements - that need one. If prefix is passed, the id will be appended to it. -

    -
    -_.uniqueId('contact_');
    -=> 'contact_104'
    - -

    - template_.template(templateString, [context]) -
    - Compiles JavaScript templates into functions that can be evaluated - for rendering. Useful for rendering complicated bits of HTML from JSON - data sources. Template functions can both interpolate variables, using
    - <%= … %>, as well as execute arbitrary JavaScript code, with - <% … %>. When you evaluate a template function, pass in a - context object that has properties corresponding to the template's free - variables. If you're writing a one-off, you can pass the context - object as the second parameter to template in order to render - immediately instead of returning a template function. -

    -
    -var compiled = _.template("hello: <%= name %>");
    -compiled({name : 'moe'});
    -=> "hello: moe"
    -
    -var list = "<% _.each(people, function(name) { %> <li><%= name %></li> <% }); %>";
    -_.template(list, {people : ['moe', 'curly', 'larry']});
    -=> "<li>moe</li><li>curly</li><li>larry</li>"
    - -

    - If ERB-style delimiters aren't your cup of tea, you can change Underscore's - template settings to use different symbols to set off interpolated code. - Define start and end tokens, and an interpolate regex - to match expressions that should be evaluated and inserted. For example, - to perform - Mustache.js - style templating: -

    - -
    -_.templateSettings = {
    -  start       : '{{',
    -  end         : '}}',
    -  interpolate : /\{\{(.+?)\}\}/g
    -};
    -
    -var template = _.template("Hello {{ name }}!");
    -template({name : "Mustache"});
    -=> "Hello Mustache!"
    - -

    Chaining

    - -

    - chain_(obj).chain() -
    - Returns a wrapped object. Calling methods on this object will continue - to return wrapped objects until value is used. ( - A more realistic example.) -

    -
    -var stooges = [{name : 'curly', age : 25}, {name : 'moe', age : 21}, {name : 'larry', age : 23}];
    -var youngest = _(stooges).chain()
    -  .sortBy(function(stooge){ return stooge.age; })
    -  .map(function(stooge){ return stooge.name + ' is ' + stooge.age; })
    -  .first()
    -  .value();
    -=> "moe is 21"
    -
    - -

    - value_(obj).value() -
    - Extracts the value of a wrapped object. -

    -
    -_([1, 2, 3]).value();
    -=> [1, 2, 3]
    -
    - -

    Duck Typing

    - -

    - The isType (isArray, isFunction, isString ...) family of type-checking - functions use property detection to do their work, which, although - orders of magnitude faster than the alternative, isn't entirely safe when dealing - with objects that are used as hashes, where arbitrary strings are being - set for the keys. It's entirely possible for an object to masquerade as - another type, if you're setting properties with names like "concat" and - "charCodeAt". So be aware. -

    - - -

    Links & Suggested Reading

    - -

    - Underscore.lua, - a Lua port of the functions that are applicable in both languages. - Includes OOP-wrapping and chaining. - The source is - available on GitHub. -

    - -

    - Underscore.strings, - an Underscore extension that adds functions for string-manipulation: - trim, startsWith, contains, capitalize, - reverse, sprintf, and more. -

    - -

    - Ruby's Enumerable module. -

    - -

    - Prototype.js, which provides - JavaScript with collection functions in the manner closest to Ruby's Enumerable. -

    - -

    - Oliver Steele's - Functional JavaScript, - which includes comprehensive higher-order function support as well as string lambdas. -

    - -

    - Python's itertools. -

    - -

    Change Log

    - -

    - 1.1.0
    - The method signature of _.reduce has been changed to match - the ECMAScript 5 signature, instead of the Ruby/Prototype.js version. - This is a backwards-incompatible change. _.template may now be - called with no arguments, and preserves whitespace. _.contains - is a new alias for _.include. -

    - -

    - 1.0.4
    - Andri Möll contributed the _.memoize - function, which can be used to speed up expensive repeated computations - by caching the results. -

    - -

    - 1.0.3
    - Patch that makes _.isEqual return false if any property - of the compared object has a NaN value. Technically the correct - thing to do, but of questionable semantics. Watch out for NaN comparisons. -

    - -

    - 1.0.2
    - Fixes _.isArguments in recent versions of Opera, which have - arguments objects as real Arrays. -

    - -

    - 1.0.1
    - Bugfix for _.isEqual, when comparing two objects with the same - number of undefined keys, but with different names. -

    - -

    - 1.0.0
    - Things have been stable for many months now, so Underscore is now - considered to be out of beta, at 1.0. Improvements since 0.6 - include _.isBoolean, and the ability to have _.extend - take multiple source objects. -

    - -

    - 0.6.0
    - Major release. Incorporates a number of - Mile Frawley's refactors for - safer duck-typing on collection functions, and cleaner internals. A new - _.mixin method that allows you to extend Underscore with utility - functions of your own. Added _.times, which works the same as in - Ruby or Prototype.js. Native support for ECMAScript 5's Array.isArray, - and Object.keys. -

    - -

    - 0.5.8
    - Fixed Underscore's collection functions to work on - NodeLists and - HTMLCollections - once more, thanks to - Justin Tulloss. -

    - -

    - 0.5.7
    - A safer implementation of _.isArguments, and a - faster _.isNumber,
    thanks to - Jed Schmidt. -

    - -

    - 0.5.6
    - Customizable delimiters for _.template, contributed by - Noah Sloan. -

    - -

    - 0.5.5
    - Fix for a bug in MobileSafari's OOP-wrapper, with the arguments object. -

    - -

    - 0.5.4
    - Fix for multiple single quotes within a template string for - _.template. See: - Rick Strahl's blog post. -

    - -

    - 0.5.2
    - New implementations of isArray, isDate, isFunction, - isNumber, isRegExp, and isString, thanks to - a suggestion from - Robert Kieffer. - Instead of doing Object#toString - comparisons, they now check for expected properties, which is less safe, - but more than an order of magnitude faster. Most other Underscore - functions saw minor speed improvements as a result. - Evgeniy Dolzhenko - contributed _.tap, - similar to Ruby 1.9's, - which is handy for injecting side effects (like logging) into chained calls. -

    - -

    - 0.5.1
    - Added an _.isArguments function. Lots of little safety checks - and optimizations contributed by - Noah Sloan and - Andri Möll. -

    - -

    - 0.5.0
    - [API Changes] _.bindAll now takes the context object as - its first parameter. If no method names are passed, all of the context - object's methods are bound to it, enabling chaining and easier binding. - _.functions now takes a single argument and returns the names - of its Function properties. Calling _.functions(_) will get you - the previous behavior. - Added _.isRegExp so that isEqual can now test for RegExp equality. - All of the "is" functions have been shrunk down into a single definition. - Karl Guertin contributed patches. -

    - -

    - 0.4.7
    - Added isDate, isNaN, and isNull, for completeness. - Optimizations for isEqual when checking equality between Arrays - or Dates. _.keys is now 25%–2X faster (depending on your - browser) which speeds up the functions that rely on it, such as _.each. -

    - -

    - 0.4.6
    - Added the range function, a port of the - Python - function of the same name, for generating flexibly-numbered lists - of integers. Original patch contributed by - Kirill Ishanov. -

    - -

    - 0.4.5
    - Added rest for Arrays and arguments objects, and aliased - first as head, and rest as tail, - thanks to Luke Sutton's patches. - Added tests ensuring that all Underscore Array functions also work on - arguments objects. -

    - -

    - 0.4.4
    - Added isString, and isNumber, for consistency. Fixed - _.isEqual(NaN, NaN) to return true (which is debatable). -

    - -

    - 0.4.3
    - Started using the native StopIteration object in browsers that support it. - Fixed Underscore setup for CommonJS environments. -

    - -

    - 0.4.2
    - Renamed the unwrapping function to value, for clarity. -

    - -

    - 0.4.1
    - Chained Underscore objects now support the Array prototype methods, so - that you can perform the full range of operations on a wrapped array - without having to break your chain. Added a breakLoop method - to break in the middle of any Underscore iteration. Added an - isEmpty function that works on arrays and objects. -

    - -

    - 0.4.0
    - All Underscore functions can now be called in an object-oriented style, - like so: _([1, 2, 3]).map(...);. Original patch provided by - Marc-André Cournoyer. - Wrapped objects can be chained through multiple - method invocations. A functions method - was added, providing a sorted list of all the functions in Underscore. -

    - -

    - 0.3.3
    - Added the JavaScript 1.8 function reduceRight. Aliased it - as foldr, and aliased reduce as foldl. -

    - -

    - 0.3.2
    - Now runs on stock Rhino - interpreters with: load("underscore.js"). - Added identity as a utility function. -

    - -

    - 0.3.1
    - All iterators are now passed in the original collection as their third - argument, the same as JavaScript 1.6's forEach. Iterating over - objects is now called with (value, key, collection), for details - see _.each. -

    - -

    - 0.3.0
    - Added Dmitry Baranovskiy's - comprehensive optimizations, merged in - Kris Kowal's patches to make Underscore - CommonJS and - Narwhal compliant. -

    - -

    - 0.2.0
    - Added compose and lastIndexOf, renamed inject to - reduce, added aliases for inject, filter, - every, some, and forEach. -

    - -

    - 0.1.1
    - Added noConflict, so that the "Underscore" object can be assigned to - other variables. -

    - -

    - 0.1.0
    - Initial release of Underscore.js. -

    - -

    - - A DocumentCloud Project - -

    - -
    - -
    - - - - - - diff --git a/deps/.npm/underscore/1.1.0/package/package.json b/deps/.npm/underscore/1.1.0/package/package.json deleted file mode 100644 index f00dacc0..00000000 --- a/deps/.npm/underscore/1.1.0/package/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name" : "underscore", - "description" : "Functional programming aid for JavaScript. Works well with jQuery.", - "url" : "http://documentcloud.github.com/underscore/", - "keywords" : ["util", "functional", "server", "client", "browser"], - "author" : "Jeremy Ashkenas ", - "contributors" : [], - "dependencies" : [], - "lib" : ".", - "main" : "underscore.js", - "version" : "1.1.0" -} diff --git a/deps/.npm/underscore/1.1.0/package/test/arrays.js b/deps/.npm/underscore/1.1.0/package/test/arrays.js deleted file mode 100644 index 4b74ecad..00000000 --- a/deps/.npm/underscore/1.1.0/package/test/arrays.js +++ /dev/null @@ -1,108 +0,0 @@ -$(document).ready(function() { - - module("Array-only functions (last, compact, uniq, and so on...)"); - - test("arrays: first", function() { - equals(_.first([1,2,3]), 1, 'can pull out the first element of an array'); - equals(_([1, 2, 3]).first(), 1, 'can perform OO-style "first()"'); - equals(_.first([1,2,3], 2).join(', '), '1, 2', 'can pass an index to first'); - var result = (function(){ return _.first(arguments); })(4, 3, 2, 1); - equals(result, 4, 'works on an arguments object.'); - result = _.map([[1,2,3],[1,2,3]], _.first); - equals(result.join(','), '1,1', 'works well with _.map'); - }); - - test("arrays: rest", function() { - var numbers = [1, 2, 3, 4]; - equals(_.rest(numbers).join(", "), "2, 3, 4", 'working rest()'); - equals(_.rest(numbers, 2).join(', '), '3, 4', 'rest can take an index'); - var result = (function(){ return _(arguments).tail(); })(1, 2, 3, 4); - equals(result.join(', '), '2, 3, 4', 'aliased as tail and works on arguments object'); - result = _.map([[1,2,3],[1,2,3]], _.rest); - equals(_.flatten(result).join(','), '2,3,2,3', 'works well with _.map'); - }); - - test("arrays: last", function() { - equals(_.last([1,2,3]), 3, 'can pull out the last element of an array'); - var result = (function(){ return _(arguments).last(); })(1, 2, 3, 4); - equals(result, 4, 'works on an arguments object'); - }); - - test("arrays: compact", function() { - equals(_.compact([0, 1, false, 2, false, 3]).length, 3, 'can trim out all falsy values'); - var result = (function(){ return _(arguments).compact().length; })(0, 1, false, 2, false, 3); - equals(result, 3, 'works on an arguments object'); - }); - - test("arrays: flatten", function() { - var list = [1, [2], [3, [[[4]]]]]; - equals(_.flatten(list).join(', '), '1, 2, 3, 4', 'can flatten nested arrays'); - var result = (function(){ return _.flatten(arguments); })(1, [2], [3, [[[4]]]]); - equals(result.join(', '), '1, 2, 3, 4', 'works on an arguments object'); - }); - - test("arrays: without", function() { - var list = [1, 2, 1, 0, 3, 1, 4]; - equals(_.without(list, 0, 1).join(', '), '2, 3, 4', 'can remove all instances of an object'); - var result = (function(){ return _.without(arguments, 0, 1); })(1, 2, 1, 0, 3, 1, 4); - equals(result.join(', '), '2, 3, 4', 'works on an arguments object'); - - var list = [{one : 1}, {two : 2}]; - ok(_.without(list, {one : 1}).length == 2, 'uses real object identity for comparisons.'); - ok(_.without(list, list[0]).length == 1, 'ditto.'); - }); - - test("arrays: uniq", function() { - var list = [1, 2, 1, 3, 1, 4]; - equals(_.uniq(list).join(', '), '1, 2, 3, 4', 'can find the unique values of an unsorted array'); - - var list = [1, 1, 1, 2, 2, 3]; - equals(_.uniq(list, true).join(', '), '1, 2, 3', 'can find the unique values of a sorted array faster'); - - var result = (function(){ return _.uniq(arguments); })(1, 2, 1, 3, 1, 4); - equals(result.join(', '), '1, 2, 3, 4', 'works on an arguments object'); - }); - - test("arrays: intersect", function() { - var stooges = ['moe', 'curly', 'larry'], leaders = ['moe', 'groucho']; - equals(_.intersect(stooges, leaders).join(''), 'moe', 'can take the set intersection of two arrays'); - equals(_(stooges).intersect(leaders).join(''), 'moe', 'can perform an OO-style intersection'); - var result = (function(){ return _.intersect(arguments, leaders); })('moe', 'curly', 'larry'); - equals(result.join(''), 'moe', 'works an an arguments object'); - }); - - test('arrays: zip', function() { - var names = ['moe', 'larry', 'curly'], ages = [30, 40, 50], leaders = [true]; - var stooges = _.zip(names, ages, leaders); - equals(String(stooges), 'moe,30,true,larry,40,,curly,50,', 'zipped together arrays of different lengths'); - }); - - test("arrays: indexOf", function() { - var numbers = [1, 2, 3]; - numbers.indexOf = null; - equals(_.indexOf(numbers, 2), 1, 'can compute indexOf, even without the native function'); - var result = (function(){ return _.indexOf(arguments, 2); })(1, 2, 3); - equals(result, 1, 'works on an arguments object'); - }); - - test("arrays: lastIndexOf", function() { - var numbers = [1, 0, 1, 0, 0, 1, 0, 0, 0]; - numbers.lastIndexOf = null; - equals(_.lastIndexOf(numbers, 1), 5, 'can compute lastIndexOf, even without the native function'); - equals(_.lastIndexOf(numbers, 0), 8, 'lastIndexOf the other element'); - var result = (function(){ return _.lastIndexOf(arguments, 1); })(1, 0, 1, 0, 0, 1, 0, 0, 0); - equals(result, 5, 'works on an arguments object'); - }); - - test("arrays: range", function() { - equals(_.range(0).join(''), '', 'range with 0 as a first argument generates an empty array'); - equals(_.range(4).join(' '), '0 1 2 3', 'range with a single positive argument generates an array of elements 0,1,2,...,n-1'); - equals(_.range(5, 8).join(' '), '5 6 7', 'range with two arguments a & b, a b-a, a < b generates an array with a single element, equal to a'); - equals(_.range(12, 7, -2).join(' '), '12 10 8', 'range with three arguments a & b & c, a > b, c < 0 generates an array of elements a,a-c,a-2c and ends with the number not less than b'); - equals(_.range(0, -10, -1).join(' '), '0 -1 -2 -3 -4 -5 -6 -7 -8 -9', 'final example in the Python docs'); - }); - -}); diff --git a/deps/.npm/underscore/1.1.0/package/test/chaining.js b/deps/.npm/underscore/1.1.0/package/test/chaining.js deleted file mode 100644 index e633ba5a..00000000 --- a/deps/.npm/underscore/1.1.0/package/test/chaining.js +++ /dev/null @@ -1,47 +0,0 @@ -$(document).ready(function() { - - module("Underscore chaining."); - - test("chaining: map/flatten/reduce", function() { - var lyrics = [ - "I'm a lumberjack and I'm okay", - "I sleep all night and I work all day", - "He's a lumberjack and he's okay", - "He sleeps all night and he works all day" - ]; - var counts = _(lyrics).chain() - .map(function(line) { return line.split(''); }) - .flatten() - .reduce(function(hash, l) { - hash[l] = hash[l] || 0; - hash[l]++; - return hash; - }, {}).value(); - ok(counts['a'] == 16 && counts['e'] == 10, 'counted all the letters in the song'); - }); - - test("chaining: select/reject/sortBy", function() { - var numbers = [1,2,3,4,5,6,7,8,9,10]; - numbers = _(numbers).chain().select(function(n) { - return n % 2 == 0; - }).reject(function(n) { - return n % 4 == 0; - }).sortBy(function(n) { - return -n; - }).value(); - equals(numbers.join(', '), "10, 6, 2", "filtered and reversed the numbers"); - }); - - test("chaining: reverse/concat/unshift/pop/map", function() { - var numbers = [1,2,3,4,5]; - numbers = _(numbers).chain() - .reverse() - .concat([5, 5, 5]) - .unshift(17) - .pop() - .map(function(n){ return n * 2; }) - .value(); - equals(numbers.join(', '), "34, 10, 8, 6, 4, 2, 10, 10", 'can chain together array functions.'); - }); - -}); diff --git a/deps/.npm/underscore/1.1.0/package/test/collections.js b/deps/.npm/underscore/1.1.0/package/test/collections.js deleted file mode 100644 index 9c72e889..00000000 --- a/deps/.npm/underscore/1.1.0/package/test/collections.js +++ /dev/null @@ -1,168 +0,0 @@ -$(document).ready(function() { - - module("Collection functions (each, any, select, and so on...)"); - - test("collections: each", function() { - _.each([1, 2, 3], function(num, i) { - equals(num, i + 1, 'each iterators provide value and iteration count'); - }); - - var answer = null; - _.each([1, 2, 3], function(num){ if ((answer = num) == 2) _.breakLoop(); }); - equals(answer, 2, 'the loop broke in the middle'); - - var answers = []; - _.each([1, 2, 3], function(num){ answers.push(num * this.multiplier);}, {multiplier : 5}); - equals(answers.join(', '), '5, 10, 15', 'context object property accessed'); - - answers = []; - _.forEach([1, 2, 3], function(num){ answers.push(num); }); - equals(answers.join(', '), '1, 2, 3', 'aliased as "forEach"'); - - answers = []; - var obj = {one : 1, two : 2, three : 3}; - obj.constructor.prototype.four = 4; - _.each(obj, function(value, key){ answers.push(key); }); - equals(answers.join(", "), 'one, two, three', 'iterating over objects works, and ignores the object prototype.'); - delete obj.constructor.prototype.four; - - answer = null; - _.each([1, 2, 3], function(num, index, arr){ if (_.include(arr, num)) answer = true; }); - ok(answer, 'can reference the original collection from inside the iterator'); - - answers = []; - _.each({range : 1, speed : 2, length : 3}, function(v){ answers.push(v); }); - ok(answers.join(', '), '1, 2, 3', 'can iterate over objects with numeric length properties'); - }); - - test('collections: map', function() { - var doubled = _.map([1, 2, 3], function(num){ return num * 2; }); - equals(doubled.join(', '), '2, 4, 6', 'doubled numbers'); - - var tripled = _.map([1, 2, 3], function(num){ return num * this.multiplier; }, {multiplier : 3}); - equals(tripled.join(', '), '3, 6, 9', 'tripled numbers with context'); - - var doubled = _([1, 2, 3]).map(function(num){ return num * 2; }); - equals(doubled.join(', '), '2, 4, 6', 'OO-style doubled numbers'); - - var ids = _.map(document.body.childNodes, function(n){ return n.id; }); - ok(_.include(ids, 'qunit-header'), 'can use collection methods on NodeLists'); - - var ids = _.map(document.images, function(n){ return n.id; }); - ok(ids[0] == 'chart_image', 'can use collection methods on HTMLCollections'); - }); - - test('collections: reduce', function() { - var sum = _.reduce([1, 2, 3], function(sum, num){ return sum + num; }, 0); - equals(sum, 6, 'can sum up an array'); - - var context = {multiplier : 3}; - sum = _.reduce([1, 2, 3], function(sum, num){ return sum + num * this.multiplier; }, 0, context); - equals(sum, 18, 'can reduce with a context object'); - - sum = _.inject([1, 2, 3], function(sum, num){ return sum + num; }, 0); - equals(sum, 6, 'aliased as "inject"'); - - sum = _([1, 2, 3]).reduce(function(sum, num){ return sum + num; }, 0); - equals(sum, 6, 'OO-style reduce'); - }); - - test('collections: reduceRight', function() { - var list = _.foldr([1, 2, 3], function(memo, num){ return memo + num; }, ''); - equals(list, '321', 'can perform right folds'); - }); - - test('collections: detect', function() { - var result = _.detect([1, 2, 3], function(num){ return num * 2 == 4; }); - equals(result, 2, 'found the first "2" and broke the loop'); - }); - - test('collections: select', function() { - var evens = _.select([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; }); - equals(evens.join(', '), '2, 4, 6', 'selected each even number'); - - evens = _.filter([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; }); - equals(evens.join(', '), '2, 4, 6', 'aliased as "filter"'); - }); - - test('collections: reject', function() { - var odds = _.reject([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; }); - equals(odds.join(', '), '1, 3, 5', 'rejected each even number'); - }); - - test('collections: all', function() { - ok(_.all([]), 'the empty set'); - ok(_.all([true, true, true]), 'all true values'); - ok(!_.all([true, false, true]), 'one false value'); - ok(_.all([0, 10, 28], function(num){ return num % 2 == 0; }), 'even numbers'); - ok(!_.all([0, 11, 28], function(num){ return num % 2 == 0; }), 'an odd number'); - ok(_.every([true, true, true]), 'aliased as "every"'); - }); - - test('collections: any', function() { - ok(!_.any([]), 'the empty set'); - ok(!_.any([false, false, false]), 'all false values'); - ok(_.any([false, false, true]), 'one true value'); - ok(!_.any([1, 11, 29], function(num){ return num % 2 == 0; }), 'all odd numbers'); - ok(_.any([1, 10, 29], function(num){ return num % 2 == 0; }), 'an even number'); - ok(_.some([false, false, true]), 'aliased as "some"'); - }); - - test('collections: include', function() { - ok(_.include([1,2,3], 2), 'two is in the array'); - ok(!_.include([1,3,9], 2), 'two is not in the array'); - ok(_.contains({moe:1, larry:3, curly:9}, 3), '_.include on objects checks their values'); - ok(_([1,2,3]).include(2), 'OO-style include'); - }); - - test('collections: invoke', function() { - var list = [[5, 1, 7], [3, 2, 1]]; - var result = _.invoke(list, 'sort'); - equals(result[0].join(', '), '1, 5, 7', 'first array sorted'); - equals(result[1].join(', '), '1, 2, 3', 'second array sorted'); - }); - - test('collections: pluck', function() { - var people = [{name : 'moe', age : 30}, {name : 'curly', age : 50}]; - equals(_.pluck(people, 'name').join(', '), 'moe, curly', 'pulls names out of objects'); - }); - - test('collections: max', function() { - equals(3, _.max([1, 2, 3]), 'can perform a regular Math.max'); - - var neg = _.max([1, 2, 3], function(num){ return -num; }); - equals(neg, 1, 'can perform a computation-based max'); - }); - - test('collections: min', function() { - equals(1, _.min([1, 2, 3]), 'can perform a regular Math.min'); - - var neg = _.min([1, 2, 3], function(num){ return -num; }); - equals(neg, 3, 'can perform a computation-based min'); - }); - - test('collections: sortBy', function() { - var people = [{name : 'curly', age : 50}, {name : 'moe', age : 30}]; - people = _.sortBy(people, function(person){ return person.age; }); - equals(_.pluck(people, 'name').join(', '), 'moe, curly', 'stooges sorted by age'); - }); - - test('collections: sortedIndex', function() { - var numbers = [10, 20, 30, 40, 50], num = 35; - var index = _.sortedIndex(numbers, num); - equals(index, 3, '35 should be inserted at index 3'); - }); - - test('collections: toArray', function() { - ok(!_.isArray(arguments), 'arguments object is not an array'); - ok(_.isArray(_.toArray(arguments)), 'arguments object converted into array'); - - var numbers = _.toArray({one : 1, two : 2, three : 3}); - equals(numbers.join(', '), '1, 2, 3', 'object flattened into array'); - }); - - test('collections: size', function() { - equals(_.size({one : 1, two : 2, three : 3}), 3, 'can compute the size of an object'); - }); - -}); diff --git a/deps/.npm/underscore/1.1.0/package/test/functions.js b/deps/.npm/underscore/1.1.0/package/test/functions.js deleted file mode 100644 index eba6309d..00000000 --- a/deps/.npm/underscore/1.1.0/package/test/functions.js +++ /dev/null @@ -1,86 +0,0 @@ -$(document).ready(function() { - - module("Function functions (bind, bindAll, and so on...)"); - - test("functions: bind", function() { - var context = {name : 'moe'}; - var func = function(arg) { return "name: " + (this.name || arg); }; - var bound = _.bind(func, context); - equals(bound(), 'name: moe', 'can bind a function to a context'); - - bound = _(func).bind(context); - equals(bound(), 'name: moe', 'can do OO-style binding'); - - bound = _.bind(func, null, 'curly'); - equals(bound(), 'name: curly', 'can bind without specifying a context'); - - func = function(salutation, name) { return salutation + ': ' + name; }; - func = _.bind(func, this, 'hello'); - equals(func('moe'), 'hello: moe', 'the function was partially applied in advance'); - - var func = _.bind(func, this, 'curly'); - equals(func(), 'hello: curly', 'the function was completely applied in advance'); - }); - - test("functions: bindAll", function() { - var curly = {name : 'curly'}, moe = { - name : 'moe', - getName : function() { return 'name: ' + this.name; }, - sayHi : function() { return 'hi: ' + this.name; } - }; - curly.getName = moe.getName; - _.bindAll(moe, 'getName', 'sayHi'); - curly.sayHi = moe.sayHi; - equals(curly.getName(), 'name: curly', 'unbound function is bound to current object'); - equals(curly.sayHi(), 'hi: moe', 'bound function is still bound to original object'); - - curly = {name : 'curly'}; - moe = { - name : 'moe', - getName : function() { return 'name: ' + this.name; }, - sayHi : function() { return 'hi: ' + this.name; } - }; - _.bindAll(moe); - curly.sayHi = moe.sayHi; - equals(curly.sayHi(), 'hi: moe', 'calling bindAll with no arguments binds all functions to the object'); - }); - - test("functions: memoize", function() { - var fib = function(n) { - return n < 2 ? n : fib(n - 1) + fib(n - 2); - }; - var fastFib = _.memoize(fib); - equals(fib(10), 55, 'a memoized version of fibonacci produces identical results'); - equals(fastFib(10), 55, 'a memoized version of fibonacci produces identical results'); - }); - - asyncTest("functions: delay", function() { - var delayed = false; - _.delay(function(){ delayed = true; }, 100); - _.delay(function(){ ok(!delayed, "didn't delay the function quite yet"); }, 50); - _.delay(function(){ ok(delayed, 'delayed the function'); start(); }, 150); - }); - - asyncTest("functions: defer", function() { - var deferred = false; - _.defer(function(bool){ deferred = bool; }, true); - _.delay(function(){ ok(deferred, "deferred the function"); start(); }, 50); - }); - - test("functions: wrap", function() { - var greet = function(name){ return "hi: " + name; }; - var backwards = _.wrap(greet, function(func, name){ return func(name) + ' ' + name.split('').reverse().join(''); }); - equals(backwards('moe'), 'hi: moe eom', 'wrapped the saluation function'); - }); - - test("functions: compose", function() { - var greet = function(name){ return "hi: " + name; }; - var exclaim = function(sentence){ return sentence + '!'; }; - var composed = _.compose(exclaim, greet); - equals(composed('moe'), 'hi: moe!', 'can compose a function that takes another'); - - composed = _.compose(greet, exclaim); - equals(composed('moe'), 'hi: moe!', 'in this case, the functions are also commutative'); - }); - -}); diff --git a/deps/.npm/underscore/1.1.0/package/test/objects.js b/deps/.npm/underscore/1.1.0/package/test/objects.js deleted file mode 100644 index fc9c93d4..00000000 --- a/deps/.npm/underscore/1.1.0/package/test/objects.js +++ /dev/null @@ -1,214 +0,0 @@ -$(document).ready(function() { - - module("Object functions (values, extend, isEqual, and so on...)"); - - test("objects: keys", function() { - equals(_.keys({one : 1, two : 2}).join(', '), 'one, two', 'can extract the keys from an object'); - }); - - test("objects: values", function() { - equals(_.values({one : 1, two : 2}).join(', '), '1, 2', 'can extract the values from an object'); - }); - - test("objects: functions", function() { - var expected = ["all", "any", "bind", "bindAll", "breakLoop", "clone", "compact", - "compose", "contains", "defer", "delay", "detect", "each", "every", "extend", "filter", "first", - "flatten", "foldl", "foldr", "forEach", "functions", "head", "identity", "include", - "indexOf", "inject", "intersect", "invoke", "isArguments", "isArray", "isBoolean", "isDate", "isElement", "isEmpty", "isEqual", - "isFunction", "isNaN", "isNull", "isNumber", "isRegExp", "isString", "isUndefined", "keys", "last", "lastIndexOf", "map", "max", - "memoize", "methods", "min", "mixin", "noConflict", "pluck", "range", "reduce", "reduceRight", "reject", "rest", "select", - "size", "some", "sortBy", "sortedIndex", "tail", "tap", "template", "times", "toArray", "uniq", - "uniqueId", "values", "without", "wrap", "zip"]; - same(expected, _.methods(_), 'provides a sorted list of functions'); - var obj = {a : 'dash', b : _.map, c : (/yo/), d : _.reduce}; - ok(_.isEqual(['b', 'd'], _.functions(obj)), 'can grab the function names of any passed-in object'); - }); - - test("objects: extend", function() { - var result; - equals(_.extend({}, {a:'b'}).a, 'b', 'can extend an object with the attributes of another'); - equals(_.extend({a:'x'}, {a:'b'}).a, 'b', 'properties in source override destination'); - equals(_.extend({x:'x'}, {a:'b'}).x, 'x', 'properties not in source dont get overriden'); - result = _.extend({x:'x'}, {a:'a'}, {b:'b'}); - ok(_.isEqual(result, {x:'x', a:'a', b:'b'}), 'can extend from multiple source objects'); - result = _.extend({x:'x'}, {a:'a', x:2}, {a:'b'}); - ok(_.isEqual(result, {x:2, a:'b'}), 'extending from multiple source objects last property trumps'); - }); - - test("objects: clone", function() { - var moe = {name : 'moe', lucky : [13, 27, 34]}; - var clone = _.clone(moe); - equals(clone.name, 'moe', 'the clone as the attributes of the original'); - - clone.name = 'curly'; - ok(clone.name == 'curly' && moe.name == 'moe', 'clones can change shallow attributes without affecting the original'); - - clone.lucky.push(101); - equals(_.last(moe.lucky), 101, 'changes to deep attributes are shared with the original'); - }); - - test("objects: isEqual", function() { - var moe = {name : 'moe', lucky : [13, 27, 34]}; - var clone = {name : 'moe', lucky : [13, 27, 34]}; - ok(moe != clone, 'basic equality between objects is false'); - ok(_.isEqual(moe, clone), 'deep equality is true'); - ok(_(moe).isEqual(clone), 'OO-style deep equality works'); - ok(!_.isEqual(5, NaN), '5 is not equal to NaN'); - ok(NaN != NaN, 'NaN is not equal to NaN (native equality)'); - ok(NaN !== NaN, 'NaN is not equal to NaN (native identity)'); - ok(!_.isEqual(NaN, NaN), 'NaN is not equal to NaN'); - ok(_.isEqual(new Date(100), new Date(100)), 'identical dates are equal'); - ok(_.isEqual((/hello/ig), (/hello/ig)), 'identical regexes are equal'); - ok(!_.isEqual(null, [1]), 'a falsy is never equal to a truthy'); - ok(!_.isEqual({x: 1, y: undefined}, {x: 1, z: 2}), 'object with the same number of undefined keys are not equal'); - }); - - test("objects: isEmpty", function() { - ok(!_([1]).isEmpty(), '[1] is not empty'); - ok(_.isEmpty([]), '[] is empty'); - ok(!_.isEmpty({one : 1}), '{one : 1} is not empty'); - ok(_.isEmpty({}), '{} is empty'); - ok(_.isEmpty(new RegExp('')), 'objects with prototype properties are empty'); - ok(_.isEmpty(null), 'null is empty'); - ok(_.isEmpty(), 'undefined is empty'); - ok(_.isEmpty(''), 'the empty string is empty'); - ok(!_.isEmpty('moe'), 'but other strings are not'); - - var obj = {one : 1}; - delete obj.one; - ok(_.isEmpty(obj), 'deleting all the keys from an object empties it'); - }); - - // Setup remote variables for iFrame tests. - var iframe = document.createElement('iframe'); - jQuery(iframe).appendTo(document.body); - var iDoc = iframe.contentDocument || iframe.contentWindow.document; - iDoc.write( - "" - ); - iDoc.close(); - - test("objects: isElement", function() { - ok(!_.isElement('div'), 'strings are not dom elements'); - ok(_.isElement($('html')[0]), 'the html tag is a DOM element'); - ok(_.isElement(iElement), 'even from another frame'); - }); - - test("objects: isArguments", function() { - var args = (function(){ return arguments; })(1, 2, 3); - ok(!_.isArguments('string'), 'a string is not an arguments object'); - ok(!_.isArguments(_.isArguments), 'a function is not an arguments object'); - ok(_.isArguments(args), 'but the arguments object is an arguments object'); - ok(!_.isArguments(_.toArray(args)), 'but not when it\'s converted into an array'); - ok(!_.isArguments([1,2,3]), 'and not vanilla arrays.'); - ok(_.isArguments(iArguments), 'even from another frame'); - }); - - test("objects: isArray", function() { - ok(!_.isArray(arguments), 'the arguments object is not an array'); - ok(_.isArray([1, 2, 3]), 'but arrays are'); - ok(_.isArray(iArray), 'even from another frame'); - }); - - test("objects: isString", function() { - ok(!_.isString(document.body), 'the document body is not a string'); - ok(_.isString([1, 2, 3].join(', ')), 'but strings are'); - ok(_.isString(iString), 'even from another frame'); - }); - - test("objects: isNumber", function() { - ok(!_.isNumber('string'), 'a string is not a number'); - ok(!_.isNumber(arguments), 'the arguments object is not a number'); - ok(!_.isNumber(undefined), 'undefined is not a number'); - ok(_.isNumber(3 * 4 - 7 / 10), 'but numbers are'); - ok(_.isNumber(NaN), 'NaN is a number'); - ok(_.isNumber(Infinity), 'Infinity is a number'); - ok(_.isNumber(iNumber), 'even from another frame'); - }); - - test("objects: isBoolean", function() { - ok(!_.isBoolean(2), 'a number is not a boolean'); - ok(!_.isBoolean("string"), 'a string is not a boolean'); - ok(!_.isBoolean("false"), 'the string "false" is not a boolean'); - ok(!_.isBoolean("true"), 'the string "true" is not a boolean'); - ok(!_.isBoolean(arguments), 'the arguments object is not a boolean'); - ok(!_.isBoolean(undefined), 'undefined is not a boolean'); - ok(!_.isBoolean(NaN), 'NaN is not a boolean'); - ok(!_.isBoolean(null), 'null is not a boolean'); - ok(_.isBoolean(true), 'but true is'); - ok(_.isBoolean(false), 'and so is false'); - ok(_.isBoolean(iBoolean), 'even from another frame'); - }); - - test("objects: isFunction", function() { - ok(!_.isFunction([1, 2, 3]), 'arrays are not functions'); - ok(!_.isFunction('moe'), 'strings are not functions'); - ok(_.isFunction(_.isFunction), 'but functions are'); - ok(_.isFunction(iFunction), 'even from another frame'); - }); - - test("objects: isDate", function() { - ok(!_.isDate(100), 'numbers are not dates'); - ok(!_.isDate({}), 'objects are not dates'); - ok(_.isDate(new Date()), 'but dates are'); - ok(_.isDate(iDate), 'even from another frame'); - }); - - test("objects: isRegExp", function() { - ok(!_.isRegExp(_.identity), 'functions are not RegExps'); - ok(_.isRegExp(/identity/), 'but RegExps are'); - ok(_.isRegExp(iRegExp), 'even from another frame'); - }); - - test("objects: isNaN", function() { - ok(!_.isNaN(undefined), 'undefined is not NaN'); - ok(!_.isNaN(null), 'null is not NaN'); - ok(!_.isNaN(0), '0 is not NaN'); - ok(_.isNaN(NaN), 'but NaN is'); - ok(_.isNaN(iNaN), 'even from another frame'); - }); - - test("objects: isNull", function() { - ok(!_.isNull(undefined), 'undefined is not null'); - ok(!_.isNull(NaN), 'NaN is not null'); - ok(_.isNull(null), 'but null is'); - ok(_.isNull(iNull), 'even from another frame'); - }); - - test("objects: isUndefined", function() { - ok(!_.isUndefined(1), 'numbers are defined'); - ok(!_.isUndefined(null), 'null is defined'); - ok(!_.isUndefined(false), 'false is defined'); - ok(_.isUndefined(), 'nothing is undefined'); - ok(_.isUndefined(undefined), 'undefined is undefined'); - ok(_.isUndefined(iUndefined), 'even from another frame'); - }); - - test("objects: tap", function() { - var intercepted = null; - var interceptor = function(obj) { intercepted = obj; }; - var returned = _.tap(1, interceptor); - equals(intercepted, 1, "passes tapped object to interceptor"); - equals(returned, 1, "returns tapped object"); - - returned = _([1,2,3]).chain(). - map(function(n){ return n * 2; }). - max(). - tap(interceptor). - value(); - ok(returned == 6 && intercepted == 6, 'can use tapped objects in a chain'); - }); -}); diff --git a/deps/.npm/underscore/1.1.0/package/test/speed.js b/deps/.npm/underscore/1.1.0/package/test/speed.js deleted file mode 100644 index 86663a23..00000000 --- a/deps/.npm/underscore/1.1.0/package/test/speed.js +++ /dev/null @@ -1,70 +0,0 @@ -(function() { - - var numbers = []; - for (var i=0; i<1000; i++) numbers.push(i); - var objects = _.map(numbers, function(n){ return {num : n}; }); - var randomized = _.sortBy(numbers, function(){ return Math.random(); }); - - JSLitmus.test('_.each()', function() { - var timesTwo = []; - _.each(numbers, function(num){ timesTwo.push(num * 2); }); - return timesTwo; - }); - - JSLitmus.test('_(list).each()', function() { - var timesTwo = []; - _(numbers).each(function(num){ timesTwo.push(num * 2); }); - return timesTwo; - }); - - JSLitmus.test('jQuery.each()', function() { - var timesTwo = []; - jQuery.each(numbers, function(){ timesTwo.push(this * 2); }); - return timesTwo; - }); - - JSLitmus.test('_.map()', function() { - return _.map(objects, function(obj){ return obj.num; }); - }); - - JSLitmus.test('jQuery.map()', function() { - return jQuery.map(objects, function(obj){ return obj.num; }); - }); - - JSLitmus.test('_.pluck()', function() { - return _.pluck(objects, 'num'); - }); - - JSLitmus.test('_.uniq()', function() { - return _.uniq(randomized); - }); - - JSLitmus.test('_.uniq() (sorted)', function() { - return _.uniq(numbers, true); - }); - - JSLitmus.test('_.sortBy()', function() { - return _.sortBy(numbers, function(num){ return -num; }); - }); - - JSLitmus.test('_.isEqual()', function() { - return _.isEqual(numbers, randomized); - }); - - JSLitmus.test('_.keys()', function() { - return _.keys(objects); - }); - - JSLitmus.test('_.values()', function() { - return _.values(objects); - }); - - JSLitmus.test('_.intersect()', function() { - return _.intersect(numbers, randomized); - }); - - JSLitmus.test('_.range()', function() { - return _.range(1000); - }); - -})(); \ No newline at end of file diff --git a/deps/.npm/underscore/1.1.0/package/test/temp.js b/deps/.npm/underscore/1.1.0/package/test/temp.js deleted file mode 100644 index 68c39dc5..00000000 --- a/deps/.npm/underscore/1.1.0/package/test/temp.js +++ /dev/null @@ -1,27 +0,0 @@ -(function() { - - var func = function(){}; - var date = new Date(); - var str = "a string"; - var numbers = []; - for (var i=0; i<1000; i++) numbers.push(i); - var objects = _.map(numbers, function(n){ return {num : n}; }); - var randomized = _.sortBy(numbers, function(){ return Math.random(); }); - - JSLitmus.test('_.isNumber', function() { - return _.isNumber(1000) - }); - - JSLitmus.test('_.newIsNumber', function() { - return _.newIsNumber(1000) - }); - - JSLitmus.test('_.isNumber(NaN)', function() { - return _.isNumber(NaN) - }); - - JSLitmus.test('_.newIsNumber(NaN)', function() { - return _.newIsNumber(NaN) - }); - -})(); \ No newline at end of file diff --git a/deps/.npm/underscore/1.1.0/package/test/temp_tests.html b/deps/.npm/underscore/1.1.0/package/test/temp_tests.html deleted file mode 100644 index bd34f9dd..00000000 --- a/deps/.npm/underscore/1.1.0/package/test/temp_tests.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - Underscore Temporary Tests - - - - - - - -

    Underscore Temporary Tests

    -

    - A page for temporary speed tests, used for developing faster implementations - of existing Underscore methods. -

    -
    - - diff --git a/deps/.npm/underscore/1.1.0/package/test/test.html b/deps/.npm/underscore/1.1.0/package/test/test.html deleted file mode 100644 index c174ea0a..00000000 --- a/deps/.npm/underscore/1.1.0/package/test/test.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - Underscore Test Suite - - - - - - - - - - - - - - -

    Underscore Test Suite

    -

    -

    -
      -
      -

      Underscore Speed Suite

      -

      - A representative sample of the functions are benchmarked here, to provide - a sense of how fast they might run in different browsers. - Each iteration runs on an array of 1000 elements.

      - For example, the 'intersect' test measures the number of times you can - find the intersection of two thousand-element arrays in one second. -

      -
      - - diff --git a/deps/.npm/underscore/1.1.0/package/test/utility.js b/deps/.npm/underscore/1.1.0/package/test/utility.js deleted file mode 100644 index 8670a9fd..00000000 --- a/deps/.npm/underscore/1.1.0/package/test/utility.js +++ /dev/null @@ -1,117 +0,0 @@ -$(document).ready(function() { - - module("Utility functions (uniqueId, template)"); - - test("utility: noConflict", function() { - var underscore = _.noConflict(); - ok(underscore.isUndefined(_), "The '_' variable has been returned to its previous state."); - var intersection = underscore.intersect([-1, 0, 1, 2], [1, 2, 3, 4]); - equals(intersection.join(', '), '1, 2', 'but the intersection function still works'); - window._ = underscore; - }); - - test("utility: identity", function() { - var moe = {name : 'moe'}; - equals(_.identity(moe), moe, 'moe is the same as his identity'); - }); - - test('utility: breakLoop', function() { - var result = null; - _([1,2,3,4,5,6]).each(function(num) { - result = num; - if (num == 3) _.breakLoop(); - }); - equals(result, 3, 'broke out of a loop'); - }); - - test("utility: uniqueId", function() { - var ids = [], i = 0; - while(i++ < 100) ids.push(_.uniqueId()); - equals(_.uniq(ids).length, ids.length, 'can generate a globally-unique stream of ids'); - }); - - test("utility: times", function() { - var vals = []; - _.times(3, function (i) { vals.push(i); }); - ok(_.isEqual(vals, [0,1,2]), "is 0 indexed"); - // - vals = []; - _(3).times(function (i) { vals.push(i); }); - ok(_.isEqual(vals, [0,1,2]), "works as a wrapper"); - }); - - test("utility: mixin", function() { - _.mixin({ - myReverse: function(string) { - return string.split('').reverse().join(''); - } - }); - equals(_.myReverse('panacea'), 'aecanap', 'mixed in a function to _'); - equals(_('champ').myReverse(), 'pmahc', 'mixed in a function to the OOP wrapper'); - }); - - test("utility: template", function() { - var basicTemplate = _.template("<%= thing %> is gettin' on my noives!"); - var result = basicTemplate({thing : 'This'}); - equals(result, "This is gettin' on my noives!", 'can do basic attribute interpolation'); - - var fancyTemplate = _.template("
        <% for (key in people) { %>
      • <%= people[key] %>
      • <% } %>
      "); - result = fancyTemplate({people : {moe : "Moe", larry : "Larry", curly : "Curly"}}); - equals(result, "
      • Moe
      • Larry
      • Curly
      ", 'can run arbitrary javascript in templates'); - - var noInterpolateTemplate = _.template("

      Just some text. Hey, I know this is silly but it aids consistency.

      "); - result = noInterpolateTemplate(); - equals(result, "

      Just some text. Hey, I know this is silly but it aids consistency.

      "); - - var quoteTemplate = _.template("It's its, not it's"); - equals(quoteTemplate({}), "It's its, not it's"); - - var quoteInStatementAndBody = _.template("<% if(foo == 'bar'){ %>Statement quotes and 'quotes'.<% } %>"); - equals(quoteInStatementAndBody({foo: "bar"}), "Statement quotes and 'quotes'."); - - var withNewlinesAndTabs = _.template('This\n\t\tis: <%= x %>.\n\tok.\nend.'); - equals(withNewlinesAndTabs({x: 'that'}), 'This\n\t\tis: that.\n\tok.\nend.'); - - _.templateSettings = { - start : '{{', - end : '}}', - interpolate : /\{\{=(.+?)\}\}/g - }; - - var custom = _.template("
        {{ for (key in people) { }}
      • {{= people[key] }}
      • {{ } }}
      "); - result = custom({people : {moe : "Moe", larry : "Larry", curly : "Curly"}}); - equals(result, "
      • Moe
      • Larry
      • Curly
      ", 'can run arbitrary javascript in templates'); - - var customQuote = _.template("It's its, not it's"); - equals(customQuote({}), "It's its, not it's"); - - var quoteInStatementAndBody = _.template("{{ if(foo == 'bar'){ }}Statement quotes and 'quotes'.{{ } }}"); - equals(quoteInStatementAndBody({foo: "bar"}), "Statement quotes and 'quotes'."); - - _.templateSettings = { - start : '', - interpolate : /<\?=(.+?)\?>/g - }; - - var customWithSpecialChars = _.template("
      "); - result = customWithSpecialChars({people : {moe : "Moe", larry : "Larry", curly : "Curly"}}); - equals(result, "
      • Moe
      • Larry
      • Curly
      ", 'can run arbitrary javascript in templates'); - - var customWithSpecialCharsQuote = _.template("It's its, not it's"); - equals(customWithSpecialCharsQuote({}), "It's its, not it's"); - - var quoteInStatementAndBody = _.template("Statement quotes and 'quotes'."); - equals(quoteInStatementAndBody({foo: "bar"}), "Statement quotes and 'quotes'."); - - _.templateSettings = { - start : '{{', - end : '}}', - interpolate : /\{\{(.+?)\}\}/g - }; - - var mustache = _.template("Hello {{planet}}!"); - equals(mustache({planet : "World"}), "Hello World!", "can mimic mustache.js"); - }); - -}); diff --git a/deps/.npm/underscore/1.1.0/package/test/vendor/jquery.js b/deps/.npm/underscore/1.1.0/package/test/vendor/jquery.js deleted file mode 100644 index b1ae21d8..00000000 --- a/deps/.npm/underscore/1.1.0/package/test/vendor/jquery.js +++ /dev/null @@ -1,19 +0,0 @@ -/* - * jQuery JavaScript Library v1.3.2 - * http://jquery.com/ - * - * Copyright (c) 2009 John Resig - * Dual licensed under the MIT and GPL licenses. - * http://docs.jquery.com/License - * - * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) - * Revision: 6246 - */ -(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
      "]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
      ","
      "]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); -/* - * Sizzle CSS Selector Engine - v0.9.3 - * Copyright 2009, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return UT[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="

      ";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="
      ";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("
      ").append(M.responseText.replace(//g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='
      ';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file diff --git a/deps/.npm/underscore/1.1.0/package/test/vendor/jslitmus.js b/deps/.npm/underscore/1.1.0/package/test/vendor/jslitmus.js deleted file mode 100644 index a0e9f806..00000000 --- a/deps/.npm/underscore/1.1.0/package/test/vendor/jslitmus.js +++ /dev/null @@ -1,670 +0,0 @@ -// JSLitmus.js -// -// History: -// 2008-10-27: Initial release -// 2008-11-09: Account for iteration loop overhead -// 2008-11-13: Added OS detection -// 2009-02-25: Create tinyURL automatically, shift-click runs tests in reverse -// -// Copyright (c) 2008-2009, Robert Kieffer -// All Rights Reserved -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the -// Software), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -(function() { - // Private methods and state - - // Get platform info but don't go crazy trying to recognize everything - // that's out there. This is just for the major platforms and OSes. - var platform = 'unknown platform', ua = navigator.userAgent; - - // Detect OS - var oses = ['Windows','iPhone OS','(Intel |PPC )?Mac OS X','Linux'].join('|'); - var pOS = new RegExp('((' + oses + ') [^ \);]*)').test(ua) ? RegExp.$1 : null; - if (!pOS) pOS = new RegExp('((' + oses + ')[^ \);]*)').test(ua) ? RegExp.$1 : null; - - // Detect browser - var pName = /(Chrome|MSIE|Safari|Opera|Firefox)/.test(ua) ? RegExp.$1 : null; - - // Detect version - var vre = new RegExp('(Version|' + pName + ')[ \/]([^ ;]*)'); - var pVersion = (pName && vre.test(ua)) ? RegExp.$2 : null; - var platform = (pOS && pName && pVersion) ? pName + ' ' + pVersion + ' on ' + pOS : 'unknown platform'; - - /** - * A smattering of methods that are needed to implement the JSLitmus testbed. - */ - var jsl = { - /** - * Enhanced version of escape() - */ - escape: function(s) { - s = s.replace(/,/g, '\\,'); - s = escape(s); - s = s.replace(/\+/g, '%2b'); - s = s.replace(/ /g, '+'); - return s; - }, - - /** - * Get an element by ID. - */ - $: function(id) { - return document.getElementById(id); - }, - - /** - * Null function - */ - F: function() {}, - - /** - * Set the status shown in the UI - */ - status: function(msg) { - var el = jsl.$('jsl_status'); - if (el) el.innerHTML = msg || ''; - }, - - /** - * Convert a number to an abbreviated string like, "15K" or "10M" - */ - toLabel: function(n) { - if (n == Infinity) { - return 'Infinity'; - } else if (n > 1e9) { - n = Math.round(n/1e8); - return n/10 + 'B'; - } else if (n > 1e6) { - n = Math.round(n/1e5); - return n/10 + 'M'; - } else if (n > 1e3) { - n = Math.round(n/1e2); - return n/10 + 'K'; - } - return n; - }, - - /** - * Copy properties from src to dst - */ - extend: function(dst, src) { - for (var k in src) dst[k] = src[k]; return dst; - }, - - /** - * Like Array.join(), but for the key-value pairs in an object - */ - join: function(o, delimit1, delimit2) { - if (o.join) return o.join(delimit1); // If it's an array - var pairs = []; - for (var k in o) pairs.push(k + delimit1 + o[k]); - return pairs.join(delimit2); - }, - - /** - * Array#indexOf isn't supported in IE, so we use this as a cross-browser solution - */ - indexOf: function(arr, o) { - if (arr.indexOf) return arr.indexOf(o); - for (var i = 0; i < this.length; i++) if (arr[i] === o) return i; - return -1; - } - }; - - /** - * Test manages a single test (created with - * JSLitmus.test()) - * - * @private - */ - var Test = function (name, f) { - if (!f) throw new Error('Undefined test function'); - if (!(/function[^\(]*\(([^,\)]*)/).test(f.toString())) { - throw new Error('"' + name + '" test: Test is not a valid Function object'); - } - this.loopArg = RegExp.$1; - this.name = name; - this.f = f; - }; - - jsl.extend(Test, /** @lends Test */ { - /** Calibration tests for establishing iteration loop overhead */ - CALIBRATIONS: [ - new Test('calibrating loop', function(count) {while (count--);}), - new Test('calibrating function', jsl.F) - ], - - /** - * Run calibration tests. Returns true if calibrations are not yet - * complete (in which case calling code should run the tests yet again). - * onCalibrated - Callback to invoke when calibrations have finished - */ - calibrate: function(onCalibrated) { - for (var i = 0; i < Test.CALIBRATIONS.length; i++) { - var cal = Test.CALIBRATIONS[i]; - if (cal.running) return true; - if (!cal.count) { - cal.isCalibration = true; - cal.onStop = onCalibrated; - //cal.MIN_TIME = .1; // Do calibrations quickly - cal.run(2e4); - return true; - } - } - return false; - } - }); - - jsl.extend(Test.prototype, {/** @lends Test.prototype */ - /** Initial number of iterations */ - INIT_COUNT: 10, - /** Max iterations allowed (i.e. used to detect bad looping functions) */ - MAX_COUNT: 1e9, - /** Minimum time a test should take to get valid results (secs) */ - MIN_TIME: .5, - - /** Callback invoked when test state changes */ - onChange: jsl.F, - - /** Callback invoked when test is finished */ - onStop: jsl.F, - - /** - * Reset test state - */ - reset: function() { - delete this.count; - delete this.time; - delete this.running; - delete this.error; - }, - - /** - * Run the test (in a timeout). We use a timeout to make sure the browser - * has a chance to finish rendering any UI changes we've made, like - * updating the status message. - */ - run: function(count) { - count = count || this.INIT_COUNT; - jsl.status(this.name + ' x ' + count); - this.running = true; - var me = this; - setTimeout(function() {me._run(count);}, 200); - }, - - /** - * The nuts and bolts code that actually runs a test - */ - _run: function(count) { - var me = this; - - // Make sure calibration tests have run - if (!me.isCalibration && Test.calibrate(function() {me.run(count);})) return; - this.error = null; - - try { - var start, f = this.f, now, i = count; - - // Start the timer - start = new Date(); - - // Now for the money shot. If this is a looping function ... - if (this.loopArg) { - // ... let it do the iteration itself - f(count); - } else { - // ... otherwise do the iteration for it - while (i--) f(); - } - - // Get time test took (in secs) - this.time = Math.max(1,new Date() - start)/1000; - - // Store iteration count and per-operation time taken - this.count = count; - this.period = this.time/count; - - // Do we need to do another run? - this.running = this.time <= this.MIN_TIME; - - // ... if so, compute how many times we should iterate - if (this.running) { - // Bump the count to the nearest power of 2 - var x = this.MIN_TIME/this.time; - var pow = Math.pow(2, Math.max(1, Math.ceil(Math.log(x)/Math.log(2)))); - count *= pow; - if (count > this.MAX_COUNT) { - throw new Error('Max count exceeded. If this test uses a looping function, make sure the iteration loop is working properly.'); - } - } - } catch (e) { - // Exceptions are caught and displayed in the test UI - this.reset(); - this.error = e; - } - - // Figure out what to do next - if (this.running) { - me.run(count); - } else { - jsl.status(''); - me.onStop(me); - } - - // Finish up - this.onChange(this); - }, - - /** - * Get the number of operations per second for this test. - * - * @param normalize if true, iteration loop overhead taken into account - */ - getHz: function(/**Boolean*/ normalize) { - var p = this.period; - - // Adjust period based on the calibration test time - if (normalize && !this.isCalibration) { - var cal = Test.CALIBRATIONS[this.loopArg ? 0 : 1]; - - // If the period is within 20% of the calibration time, then zero the - // it out - p = p < cal.period*1.2 ? 0 : p - cal.period; - } - - return Math.round(1/p); - }, - - /** - * Get a friendly string describing the test - */ - toString: function() { - return this.name + ' - ' + this.time/this.count + ' secs'; - } - }); - - // CSS we need for the UI - var STYLESHEET = ''; - - // HTML markup for the UI - var MARKUP = '
      \ - \ - \ -
      \ -
      \ - Normalize results \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ -
      ' + platform + '
      TestOps/sec
      \ -
      \ - \ - Powered by JSLitmus \ -
      '; - - /** - * The public API for creating and running tests - */ - window.JSLitmus = { - /** The list of all tests that have been registered with JSLitmus.test */ - _tests: [], - /** The queue of tests that need to be run */ - _queue: [], - - /** - * The parsed query parameters the current page URL. This is provided as a - * convenience for test functions - it's not used by JSLitmus proper - */ - params: {}, - - /** - * Initialize - */ - _init: function() { - // Parse query params into JSLitmus.params[] hash - var match = (location + '').match(/([^?#]*)(#.*)?$/); - if (match) { - var pairs = match[1].split('&'); - for (var i = 0; i < pairs.length; i++) { - var pair = pairs[i].split('='); - if (pair.length > 1) { - var key = pair.shift(); - var value = pair.length > 1 ? pair.join('=') : pair[0]; - this.params[key] = value; - } - } - } - - // Write out the stylesheet. We have to do this here because IE - // doesn't honor sheets written after the document has loaded. - document.write(STYLESHEET); - - // Setup the rest of the UI once the document is loaded - if (window.addEventListener) { - window.addEventListener('load', this._setup, false); - } else if (document.addEventListener) { - document.addEventListener('load', this._setup, false); - } else if (window.attachEvent) { - window.attachEvent('onload', this._setup); - } - - return this; - }, - - /** - * Set up the UI - */ - _setup: function() { - var el = jsl.$('jslitmus_container'); - if (!el) document.body.appendChild(el = document.createElement('div')); - - el.innerHTML = MARKUP; - - // Render the UI for all our tests - for (var i=0; i < JSLitmus._tests.length; i++) - JSLitmus.renderTest(JSLitmus._tests[i]); - }, - - /** - * (Re)render all the test results - */ - renderAll: function() { - for (var i = 0; i < JSLitmus._tests.length; i++) - JSLitmus.renderTest(JSLitmus._tests[i]); - JSLitmus.renderChart(); - }, - - /** - * (Re)render the chart graphics - */ - renderChart: function() { - var url = JSLitmus.chartUrl(); - jsl.$('chart_link').href = url; - jsl.$('chart_image').src = url; - jsl.$('chart').style.display = ''; - - // Update the tiny URL - jsl.$('tiny_url').src = 'http://tinyurl.com/api-create.php?url='+escape(url); - }, - - /** - * (Re)render the results for a specific test - */ - renderTest: function(test) { - // Make a new row if needed - if (!test._row) { - var trow = jsl.$('test_row_template'); - if (!trow) return; - - test._row = trow.cloneNode(true); - test._row.style.display = ''; - test._row.id = ''; - test._row.onclick = function() {JSLitmus._queueTest(test);}; - test._row.title = 'Run ' + test.name + ' test'; - trow.parentNode.appendChild(test._row); - test._row.cells[0].innerHTML = test.name; - } - - var cell = test._row.cells[1]; - var cns = [test.loopArg ? 'test_looping' : 'test_nonlooping']; - - if (test.error) { - cns.push('test_error'); - cell.innerHTML = - '
      ' + test.error + '
      ' + - '
      • ' + - jsl.join(test.error, ': ', '
      • ') + - '
      '; - } else { - if (test.running) { - cns.push('test_running'); - cell.innerHTML = 'running'; - } else if (jsl.indexOf(JSLitmus._queue, test) >= 0) { - cns.push('test_pending'); - cell.innerHTML = 'pending'; - } else if (test.count) { - cns.push('test_done'); - var hz = test.getHz(jsl.$('test_normalize').checked); - cell.innerHTML = hz != Infinity ? hz : '∞'; - } else { - cell.innerHTML = 'ready'; - } - } - cell.className = cns.join(' '); - }, - - /** - * Create a new test - */ - test: function(name, f) { - // Create the Test object - var test = new Test(name, f); - JSLitmus._tests.push(test); - - // Re-render if the test state changes - test.onChange = JSLitmus.renderTest; - - // Run the next test if this one finished - test.onStop = function(test) { - if (JSLitmus.onTestFinish) JSLitmus.onTestFinish(test); - JSLitmus.currentTest = null; - JSLitmus._nextTest(); - }; - - // Render the new test - this.renderTest(test); - }, - - /** - * Add all tests to the run queue - */ - runAll: function(e) { - e = e || window.event; - var reverse = e && e.shiftKey, len = JSLitmus._tests.length; - for (var i = 0; i < len; i++) { - JSLitmus._queueTest(JSLitmus._tests[!reverse ? i : (len - i - 1)]); - } - }, - - /** - * Remove all tests from the run queue. The current test has to finish on - * it's own though - */ - stop: function() { - while (JSLitmus._queue.length) { - var test = JSLitmus._queue.shift(); - JSLitmus.renderTest(test); - } - }, - - /** - * Run the next test in the run queue - */ - _nextTest: function() { - if (!JSLitmus.currentTest) { - var test = JSLitmus._queue.shift(); - if (test) { - jsl.$('stop_button').disabled = false; - JSLitmus.currentTest = test; - test.run(); - JSLitmus.renderTest(test); - if (JSLitmus.onTestStart) JSLitmus.onTestStart(test); - } else { - jsl.$('stop_button').disabled = true; - JSLitmus.renderChart(); - } - } - }, - - /** - * Add a test to the run queue - */ - _queueTest: function(test) { - if (jsl.indexOf(JSLitmus._queue, test) >= 0) return; - JSLitmus._queue.push(test); - JSLitmus.renderTest(test); - JSLitmus._nextTest(); - }, - - /** - * Generate a Google Chart URL that shows the data for all tests - */ - chartUrl: function() { - var n = JSLitmus._tests.length, markers = [], data = []; - var d, min = 0, max = -1e10; - var normalize = jsl.$('test_normalize').checked; - - // Gather test data - for (var i=0; i < JSLitmus._tests.length; i++) { - var test = JSLitmus._tests[i]; - if (test.count) { - var hz = test.getHz(normalize); - var v = hz != Infinity ? hz : 0; - data.push(v); - markers.push('t' + jsl.escape(test.name + '(' + jsl.toLabel(hz)+ ')') + ',000000,0,' + - markers.length + ',10'); - max = Math.max(v, max); - } - } - if (markers.length <= 0) return null; - - // Build chart title - var title = document.getElementsByTagName('title'); - title = (title && title.length) ? title[0].innerHTML : null; - var chart_title = []; - if (title) chart_title.push(title); - chart_title.push('Ops/sec (' + platform + ')'); - - // Build labels - var labels = [jsl.toLabel(min), jsl.toLabel(max)]; - - var w = 250, bw = 15; - var bs = 5; - var h = markers.length*(bw + bs) + 30 + chart_title.length*20; - - var params = { - chtt: escape(chart_title.join('|')), - chts: '000000,10', - cht: 'bhg', // chart type - chd: 't:' + data.join(','), // data set - chds: min + ',' + max, // max/min of data - chxt: 'x', // label axes - chxl: '0:|' + labels.join('|'), // labels - chsp: '0,1', - chm: markers.join('|'), // test names - chbh: [bw, 0, bs].join(','), // bar widths - // chf: 'bg,lg,0,eeeeee,0,eeeeee,.5,ffffff,1', // gradient - chs: w + 'x' + h - }; - return 'http://chart.apis.google.com/chart?' + jsl.join(params, '=', '&'); - } - }; - - JSLitmus._init(); -})(); \ No newline at end of file diff --git a/deps/.npm/underscore/1.1.0/package/test/vendor/qunit.css b/deps/.npm/underscore/1.1.0/package/test/vendor/qunit.css deleted file mode 100644 index c12b16d8..00000000 --- a/deps/.npm/underscore/1.1.0/package/test/vendor/qunit.css +++ /dev/null @@ -1,17 +0,0 @@ -h1#qunit-header, h1.qunit-header { padding: 15px; font-size: large; background-color: #06b; color: white; font-family: 'trebuchet ms', verdana, arial; margin: 0; } -h1#qunit-header a { color: white; } - -h2#qunit-banner { height: 2em; border-bottom: 1px solid white; background-color: #eee; margin: 0; font-family: 'trebuchet ms', verdana, arial; } -h2#qunit-banner.pass { background-color: green; } -h2#qunit-banner.fail { background-color: red; } - -h2#qunit-userAgent, h2.qunit-userAgent { padding: 10px; background-color: #eee; color: black; margin: 0; font-size: small; font-weight: normal; font-family: 'trebuchet ms', verdana, arial; font-size: 10pt; } - -div#qunit-testrunner-toolbar { background: #eee; border-top: 1px solid black; padding: 10px; font-family: 'trebuchet ms', verdana, arial; margin: 0; font-size: 10pt; } - -ol#qunit-tests { font-family: 'trebuchet ms', verdana, arial; font-size: 10pt; } -ol#qunit-tests li strong { cursor:pointer; } -ol#qunit-tests .pass { color: green; } -ol#qunit-tests .fail { color: red; } - -p#qunit-testresult { margin-left: 1em; font-size: 10pt; font-family: 'trebuchet ms', verdana, arial; } \ No newline at end of file diff --git a/deps/.npm/underscore/1.1.0/package/test/vendor/qunit.js b/deps/.npm/underscore/1.1.0/package/test/vendor/qunit.js deleted file mode 100644 index 1fc2fe13..00000000 --- a/deps/.npm/underscore/1.1.0/package/test/vendor/qunit.js +++ /dev/null @@ -1,997 +0,0 @@ -/* - * QUnit - A JavaScript Unit Testing Framework - * - * http://docs.jquery.com/QUnit - * - * Copyright (c) 2009 John Resig, Jörn Zaefferer - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - */ - -(function(window) { - -var QUnit = { - - // Initialize the configuration options - init: function init() { - config = { - stats: { all: 0, bad: 0 }, - moduleStats: { all: 0, bad: 0 }, - started: +new Date, - blocking: false, - autorun: false, - assertions: [], - filters: [], - queue: [] - }; - - var tests = id("qunit-tests"), - banner = id("qunit-banner"), - result = id("qunit-testresult"); - - if ( tests ) { - tests.innerHTML = ""; - } - - if ( banner ) { - banner.className = ""; - } - - if ( result ) { - result.parentNode.removeChild( result ); - } - }, - - // call on start of module test to prepend name to all tests - module: function module(name, testEnvironment) { - - synchronize(function() { - if ( config.currentModule ) { - QUnit.moduleDone( config.currentModule, config.moduleStats.bad, config.moduleStats.all ); - } - - config.currentModule = name; - config.moduleTestEnvironment = testEnvironment; - config.moduleStats = { all: 0, bad: 0 }; - - QUnit.moduleStart( name, testEnvironment ); - }); - }, - - asyncTest: function asyncTest(testName, expected, callback) { - if ( arguments.length === 2 ) { - callback = expected; - expected = 0; - } - - QUnit.test(testName, expected, callback, true); - }, - - test: function test(testName, expected, callback, async) { - var name = testName, testEnvironment = {}; - - if ( arguments.length === 2 ) { - callback = expected; - expected = null; - } - - if ( config.currentModule ) { - name = config.currentModule + " module: " + name; - } - - if ( !validTest(name) ) { - return; - } - - synchronize(function() { - QUnit.testStart( testName ); - - testEnvironment = extend({ - setup: function() {}, - teardown: function() {} - }, config.moduleTestEnvironment); - - config.assertions = []; - config.expected = null; - - if ( arguments.length >= 3 ) { - config.expected = callback; - callback = arguments[2]; - } - - try { - if ( !config.pollution ) { - saveGlobal(); - } - - testEnvironment.setup.call(testEnvironment); - } catch(e) { - QUnit.ok( false, "Setup failed on " + name + ": " + e.message ); - } - - if ( async ) { - QUnit.stop(); - } - - try { - callback.call(testEnvironment); - } catch(e) { - fail("Test " + name + " died, exception and test follows", e, callback); - QUnit.ok( false, "Died on test #" + (config.assertions.length + 1) + ": " + e.message ); - // else next test will carry the responsibility - saveGlobal(); - - // Restart the tests if they're blocking - if ( config.blocking ) { - start(); - } - } - }); - - synchronize(function() { - try { - checkPollution(); - testEnvironment.teardown.call(testEnvironment); - } catch(e) { - QUnit.ok( false, "Teardown failed on " + name + ": " + e.message ); - } - - try { - QUnit.reset(); - } catch(e) { - fail("reset() failed, following Test " + name + ", exception and reset fn follows", e, reset); - } - - if ( config.expected && config.expected != config.assertions.length ) { - QUnit.ok( false, "Expected " + config.expected + " assertions, but " + config.assertions.length + " were run" ); - } - - var good = 0, bad = 0, - tests = id("qunit-tests"); - - config.stats.all += config.assertions.length; - config.moduleStats.all += config.assertions.length; - - if ( tests ) { - var ol = document.createElement("ol"); - ol.style.display = "none"; - - for ( var i = 0; i < config.assertions.length; i++ ) { - var assertion = config.assertions[i]; - - var li = document.createElement("li"); - li.className = assertion.result ? "pass" : "fail"; - li.innerHTML = assertion.message || "(no message)"; - ol.appendChild( li ); - - if ( assertion.result ) { - good++; - } else { - bad++; - config.stats.bad++; - config.moduleStats.bad++; - } - } - - var b = document.createElement("strong"); - b.innerHTML = name + " (" + bad + ", " + good + ", " + config.assertions.length + ")"; - - addEvent(b, "click", function() { - var next = b.nextSibling, display = next.style.display; - next.style.display = display === "none" ? "block" : "none"; - }); - - addEvent(b, "dblclick", function(e) { - var target = (e || window.event).target; - if ( target.nodeName.toLowerCase() === "strong" ) { - var text = "", node = target.firstChild; - - while ( node.nodeType === 3 ) { - text += node.nodeValue; - node = node.nextSibling; - } - - text = text.replace(/(^\s*|\s*$)/g, ""); - - if ( window.location ) { - window.location.href = window.location.href.match(/^(.+?)(\?.*)?$/)[1] + "?" + encodeURIComponent(text); - } - } - }); - - var li = document.createElement("li"); - li.className = bad ? "fail" : "pass"; - li.appendChild( b ); - li.appendChild( ol ); - tests.appendChild( li ); - - if ( bad ) { - var toolbar = id("qunit-testrunner-toolbar"); - if ( toolbar ) { - toolbar.style.display = "block"; - id("qunit-filter-pass").disabled = null; - id("qunit-filter-missing").disabled = null; - } - } - - } else { - for ( var i = 0; i < config.assertions.length; i++ ) { - if ( !config.assertions[i].result ) { - bad++; - config.stats.bad++; - config.moduleStats.bad++; - } - } - } - - QUnit.testDone( testName, bad, config.assertions.length ); - - if ( !window.setTimeout && !config.queue.length ) { - done(); - } - }); - - if ( window.setTimeout && !config.doneTimer ) { - config.doneTimer = window.setTimeout(function(){ - if ( !config.queue.length ) { - done(); - } else { - synchronize( done ); - } - }, 13); - } - }, - - /** - * Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through. - */ - expect: function expect(asserts) { - config.expected = asserts; - }, - - /** - * Asserts true. - * @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" ); - */ - ok: function ok(a, msg) { - QUnit.log(a, msg); - - config.assertions.push({ - result: !!a, - message: msg - }); - }, - - /** - * Checks that the first two arguments are equal, with an optional message. - * Prints out both actual and expected values. - * - * Prefered to ok( actual == expected, message ) - * - * @example equals( format("Received {0} bytes.", 2), "Received 2 bytes." ); - * - * @param Object actual - * @param Object expected - * @param String message (optional) - */ - equals: function equals(actual, expected, message) { - push(expected == actual, actual, expected, message); - }, - - same: function(a, b, message) { - push(QUnit.equiv(a, b), a, b, message); - }, - - start: function start() { - // A slight delay, to avoid any current callbacks - if ( window.setTimeout ) { - window.setTimeout(function() { - if ( config.timeout ) { - clearTimeout(config.timeout); - } - - config.blocking = false; - process(); - }, 13); - } else { - config.blocking = false; - process(); - } - }, - - stop: function stop(timeout) { - config.blocking = true; - - if ( timeout && window.setTimeout ) { - config.timeout = window.setTimeout(function() { - QUnit.ok( false, "Test timed out" ); - QUnit.start(); - }, timeout); - } - }, - - /** - * Resets the test setup. Useful for tests that modify the DOM. - */ - reset: function reset() { - if ( window.jQuery ) { - jQuery("#main").html( config.fixture ); - jQuery.event.global = {}; - jQuery.ajaxSettings = extend({}, config.ajaxSettings); - } - }, - - /** - * Trigger an event on an element. - * - * @example triggerEvent( document.body, "click" ); - * - * @param DOMElement elem - * @param String type - */ - triggerEvent: function triggerEvent( elem, type, event ) { - if ( document.createEvent ) { - event = document.createEvent("MouseEvents"); - event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView, - 0, 0, 0, 0, 0, false, false, false, false, 0, null); - elem.dispatchEvent( event ); - - } else if ( elem.fireEvent ) { - elem.fireEvent("on"+type); - } - }, - - // Logging callbacks - done: function done(failures, total) {}, - log: function log(result, message) {}, - testStart: function testStart(name) {}, - testDone: function testDone(name, failures, total) {}, - moduleStart: function moduleStart(name, testEnvironment) {}, - moduleDone: function moduleDone(name, failures, total) {} -}; - -// Maintain internal state -var config = { - // The queue of tests to run - queue: [], - - // block until document ready - blocking: true -}; - -// Load paramaters -(function() { - var location = window.location || { search: "", protocol: "file:" }, - GETParams = location.search.slice(1).split('&'); - - for ( var i = 0; i < GETParams.length; i++ ) { - GETParams[i] = decodeURIComponent( GETParams[i] ); - if ( GETParams[i] === "noglobals" ) { - GETParams.splice( i, 1 ); - i--; - config.noglobals = true; - } - } - - // restrict modules/tests by get parameters - config.filters = GETParams; - - // Figure out if we're running the tests from a server or not - QUnit.isLocal = !!(location.protocol === 'file:'); -})(); - -// Expose the API as global variables, unless an 'exports' -// object exists, in that case we assume we're in CommonJS -if ( typeof exports === "undefined" || typeof require === "undefined" ) { - extend(window, QUnit); - window.QUnit = QUnit; -} else { - extend(exports, QUnit); - exports.QUnit = QUnit; -} - -if ( typeof document === "undefined" || document.readyState === "complete" ) { - config.autorun = true; -} - -addEvent(window, "load", function() { - // Initialize the config, saving the execution queue - var oldconfig = extend({}, config); - QUnit.init(); - extend(config, oldconfig); - - config.blocking = false; - - var userAgent = id("qunit-userAgent"); - if ( userAgent ) { - userAgent.innerHTML = navigator.userAgent; - } - - var toolbar = id("qunit-testrunner-toolbar"); - if ( toolbar ) { - toolbar.style.display = "none"; - - var filter = document.createElement("input"); - filter.type = "checkbox"; - filter.id = "qunit-filter-pass"; - filter.disabled = true; - addEvent( filter, "click", function() { - var li = document.getElementsByTagName("li"); - for ( var i = 0; i < li.length; i++ ) { - if ( li[i].className.indexOf("pass") > -1 ) { - li[i].style.display = filter.checked ? "none" : "block"; - } - } - }); - toolbar.appendChild( filter ); - - var label = document.createElement("label"); - label.setAttribute("for", "filter-pass"); - label.innerHTML = "Hide passed tests"; - toolbar.appendChild( label ); - - var missing = document.createElement("input"); - missing.type = "checkbox"; - missing.id = "qunit-filter-missing"; - missing.disabled = true; - addEvent( missing, "click", function() { - var li = document.getElementsByTagName("li"); - for ( var i = 0; i < li.length; i++ ) { - if ( li[i].className.indexOf("fail") > -1 && li[i].innerHTML.indexOf('missing test - untested code is broken code') > - 1 ) { - li[i].parentNode.parentNode.style.display = missing.checked ? "none" : "block"; - } - } - }); - toolbar.appendChild( missing ); - - label = document.createElement("label"); - label.setAttribute("for", "filter-missing"); - label.innerHTML = "Hide missing tests (untested code is broken code)"; - toolbar.appendChild( label ); - } - - var main = id('main'); - if ( main ) { - config.fixture = main.innerHTML; - } - - if ( window.jQuery ) { - config.ajaxSettings = window.jQuery.ajaxSettings; - } - - QUnit.start(); -}); - -function done() { - if ( config.doneTimer && window.clearTimeout ) { - window.clearTimeout( config.doneTimer ); - config.doneTimer = null; - } - - if ( config.queue.length ) { - config.doneTimer = window.setTimeout(function(){ - if ( !config.queue.length ) { - done(); - } else { - synchronize( done ); - } - }, 13); - - return; - } - - config.autorun = true; - - // Log the last module results - if ( config.currentModule ) { - QUnit.moduleDone( config.currentModule, config.moduleStats.bad, config.moduleStats.all ); - } - - var banner = id("qunit-banner"), - tests = id("qunit-tests"), - html = ['Tests completed in ', - +new Date - config.started, ' milliseconds.
      ', - '', config.stats.all - config.stats.bad, ' tests of ', config.stats.all, ' passed, ', config.stats.bad,' failed.'].join(''); - - if ( banner ) { - banner.className += " " + (config.stats.bad ? "fail" : "pass"); - } - - if ( tests ) { - var result = id("qunit-testresult"); - - if ( !result ) { - result = document.createElement("p"); - result.id = "qunit-testresult"; - result.className = "result"; - tests.parentNode.insertBefore( result, tests.nextSibling ); - } - - result.innerHTML = html; - } - - QUnit.done( config.stats.bad, config.stats.all ); -} - -function validTest( name ) { - var i = config.filters.length, - run = false; - - if ( !i ) { - return true; - } - - while ( i-- ) { - var filter = config.filters[i], - not = filter.charAt(0) == '!'; - - if ( not ) { - filter = filter.slice(1); - } - - if ( name.indexOf(filter) !== -1 ) { - return !not; - } - - if ( not ) { - run = true; - } - } - - return run; -} - -function push(result, actual, expected, message) { - message = message || (result ? "okay" : "failed"); - QUnit.ok( result, result ? message + ": " + expected : message + ", expected: " + QUnit.jsDump.parse(expected) + " result: " + QUnit.jsDump.parse(actual) ); -} - -function synchronize( callback ) { - config.queue.push( callback ); - - if ( config.autorun && !config.blocking ) { - process(); - } -} - -function process() { - while ( config.queue.length && !config.blocking ) { - config.queue.shift()(); - } -} - -function saveGlobal() { - config.pollution = []; - - if ( config.noglobals ) { - for ( var key in window ) { - config.pollution.push( key ); - } - } -} - -function checkPollution( name ) { - var old = config.pollution; - saveGlobal(); - - var newGlobals = diff( old, config.pollution ); - if ( newGlobals.length > 0 ) { - ok( false, "Introduced global variable(s): " + newGlobals.join(", ") ); - config.expected++; - } - - var deletedGlobals = diff( config.pollution, old ); - if ( deletedGlobals.length > 0 ) { - ok( false, "Deleted global variable(s): " + deletedGlobals.join(", ") ); - config.expected++; - } -} - -// returns a new Array with the elements that are in a but not in b -function diff( a, b ) { - var result = a.slice(); - for ( var i = 0; i < result.length; i++ ) { - for ( var j = 0; j < b.length; j++ ) { - if ( result[i] === b[j] ) { - result.splice(i, 1); - i--; - break; - } - } - } - return result; -} - -function fail(message, exception, callback) { - if ( typeof console !== "undefined" && console.error && console.warn ) { - console.error(message); - console.error(exception); - console.warn(callback.toString()); - - } else if ( window.opera && opera.postError ) { - opera.postError(message, exception, callback.toString); - } -} - -function extend(a, b) { - for ( var prop in b ) { - a[prop] = b[prop]; - } - - return a; -} - -function addEvent(elem, type, fn) { - if ( elem.addEventListener ) { - elem.addEventListener( type, fn, false ); - } else if ( elem.attachEvent ) { - elem.attachEvent( "on" + type, fn ); - } else { - fn(); - } -} - -function id(name) { - return !!(typeof document !== "undefined" && document && document.getElementById) && - document.getElementById( name ); -} - -// Test for equality any JavaScript type. -// Discussions and reference: http://philrathe.com/articles/equiv -// Test suites: http://philrathe.com/tests/equiv -// Author: Philippe Rathé -QUnit.equiv = function () { - - var innerEquiv; // the real equiv function - var callers = []; // stack to decide between skip/abort functions - - - // Determine what is o. - function hoozit(o) { - if (o.constructor === String) { - return "string"; - - } else if (o.constructor === Boolean) { - return "boolean"; - - } else if (o.constructor === Number) { - - if (isNaN(o)) { - return "nan"; - } else { - return "number"; - } - - } else if (typeof o === "undefined") { - return "undefined"; - - // consider: typeof null === object - } else if (o === null) { - return "null"; - - // consider: typeof [] === object - } else if (o instanceof Array) { - return "array"; - - // consider: typeof new Date() === object - } else if (o instanceof Date) { - return "date"; - - // consider: /./ instanceof Object; - // /./ instanceof RegExp; - // typeof /./ === "function"; // => false in IE and Opera, - // true in FF and Safari - } else if (o instanceof RegExp) { - return "regexp"; - - } else if (typeof o === "object") { - return "object"; - - } else if (o instanceof Function) { - return "function"; - } else { - return undefined; - } - } - - // Call the o related callback with the given arguments. - function bindCallbacks(o, callbacks, args) { - var prop = hoozit(o); - if (prop) { - if (hoozit(callbacks[prop]) === "function") { - return callbacks[prop].apply(callbacks, args); - } else { - return callbacks[prop]; // or undefined - } - } - } - - var callbacks = function () { - - // for string, boolean, number and null - function useStrictEquality(b, a) { - if (b instanceof a.constructor || a instanceof b.constructor) { - // to catch short annotaion VS 'new' annotation of a declaration - // e.g. var i = 1; - // var j = new Number(1); - return a == b; - } else { - return a === b; - } - } - - return { - "string": useStrictEquality, - "boolean": useStrictEquality, - "number": useStrictEquality, - "null": useStrictEquality, - "undefined": useStrictEquality, - - "nan": function (b) { - return isNaN(b); - }, - - "date": function (b, a) { - return hoozit(b) === "date" && a.valueOf() === b.valueOf(); - }, - - "regexp": function (b, a) { - return hoozit(b) === "regexp" && - a.source === b.source && // the regex itself - a.global === b.global && // and its modifers (gmi) ... - a.ignoreCase === b.ignoreCase && - a.multiline === b.multiline; - }, - - // - skip when the property is a method of an instance (OOP) - // - abort otherwise, - // initial === would have catch identical references anyway - "function": function () { - var caller = callers[callers.length - 1]; - return caller !== Object && - typeof caller !== "undefined"; - }, - - "array": function (b, a) { - var i; - var len; - - // b could be an object literal here - if ( ! (hoozit(b) === "array")) { - return false; - } - - len = a.length; - if (len !== b.length) { // safe and faster - return false; - } - for (i = 0; i < len; i++) { - if ( ! innerEquiv(a[i], b[i])) { - return false; - } - } - return true; - }, - - "object": function (b, a) { - var i; - var eq = true; // unless we can proove it - var aProperties = [], bProperties = []; // collection of strings - - // comparing constructors is more strict than using instanceof - if ( a.constructor !== b.constructor) { - return false; - } - - // stack constructor before traversing properties - callers.push(a.constructor); - - for (i in a) { // be strict: don't ensures hasOwnProperty and go deep - - aProperties.push(i); // collect a's properties - - if ( ! innerEquiv(a[i], b[i])) { - eq = false; - } - } - - callers.pop(); // unstack, we are done - - for (i in b) { - bProperties.push(i); // collect b's properties - } - - // Ensures identical properties name - return eq && innerEquiv(aProperties.sort(), bProperties.sort()); - } - }; - }(); - - innerEquiv = function () { // can take multiple arguments - var args = Array.prototype.slice.apply(arguments); - if (args.length < 2) { - return true; // end transition - } - - return (function (a, b) { - if (a === b) { - return true; // catch the most you can - } else if (a === null || b === null || typeof a === "undefined" || typeof b === "undefined" || hoozit(a) !== hoozit(b)) { - return false; // don't lose time with error prone cases - } else { - return bindCallbacks(a, callbacks, [b, a]); - } - - // apply transition with (1..n) arguments - })(args[0], args[1]) && arguments.callee.apply(this, args.splice(1, args.length -1)); - }; - - return innerEquiv; - -}(); - -/** - * jsDump - * Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com - * Licensed under BSD (http://www.opensource.org/licenses/bsd-license.php) - * Date: 5/15/2008 - * @projectDescription Advanced and extensible data dumping for Javascript. - * @version 1.0.0 - * @author Ariel Flesler - * @link {http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html} - */ -QUnit.jsDump = (function() { - function quote( str ) { - return '"' + str.toString().replace(/"/g, '\\"') + '"'; - }; - function literal( o ) { - return o + ''; - }; - function join( pre, arr, post ) { - var s = jsDump.separator(), - base = jsDump.indent(), - inner = jsDump.indent(1); - if ( arr.join ) - arr = arr.join( ',' + s + inner ); - if ( !arr ) - return pre + post; - return [ pre, inner + arr, base + post ].join(s); - }; - function array( arr ) { - var i = arr.length, ret = Array(i); - this.up(); - while ( i-- ) - ret[i] = this.parse( arr[i] ); - this.down(); - return join( '[', ret, ']' ); - }; - - var reName = /^function (\w+)/; - - var jsDump = { - parse:function( obj, type ) { //type is used mostly internally, you can fix a (custom)type in advance - var parser = this.parsers[ type || this.typeOf(obj) ]; - type = typeof parser; - - return type == 'function' ? parser.call( this, obj ) : - type == 'string' ? parser : - this.parsers.error; - }, - typeOf:function( obj ) { - var type = typeof obj, - f = 'function';//we'll use it 3 times, save it - return type != 'object' && type != f ? type : - !obj ? 'null' : - obj.exec ? 'regexp' :// some browsers (FF) consider regexps functions - obj.getHours ? 'date' : - obj.scrollBy ? 'window' : - obj.nodeName == '#document' ? 'document' : - obj.nodeName ? 'node' : - obj.item ? 'nodelist' : // Safari reports nodelists as functions - obj.callee ? 'arguments' : - obj.call || obj.constructor != Array && //an array would also fall on this hack - (obj+'').indexOf(f) != -1 ? f : //IE reports functions like alert, as objects - 'length' in obj ? 'array' : - type; - }, - separator:function() { - return this.multiline ? this.HTML ? '
      ' : '\n' : this.HTML ? ' ' : ' '; - }, - indent:function( extra ) {// extra can be a number, shortcut for increasing-calling-decreasing - if ( !this.multiline ) - return ''; - var chr = this.indentChar; - if ( this.HTML ) - chr = chr.replace(/\t/g,' ').replace(/ /g,' '); - return Array( this._depth_ + (extra||0) ).join(chr); - }, - up:function( a ) { - this._depth_ += a || 1; - }, - down:function( a ) { - this._depth_ -= a || 1; - }, - setParser:function( name, parser ) { - this.parsers[name] = parser; - }, - // The next 3 are exposed so you can use them - quote:quote, - literal:literal, - join:join, - // - _depth_: 1, - // This is the list of parsers, to modify them, use jsDump.setParser - parsers:{ - window: '[Window]', - document: '[Document]', - error:'[ERROR]', //when no parser is found, shouldn't happen - unknown: '[Unknown]', - 'null':'null', - undefined:'undefined', - 'function':function( fn ) { - var ret = 'function', - name = 'name' in fn ? fn.name : (reName.exec(fn)||[])[1];//functions never have name in IE - if ( name ) - ret += ' ' + name; - ret += '('; - - ret = [ ret, this.parse( fn, 'functionArgs' ), '){'].join(''); - return join( ret, this.parse(fn,'functionCode'), '}' ); - }, - array: array, - nodelist: array, - arguments: array, - object:function( map ) { - var ret = [ ]; - this.up(); - for ( var key in map ) - ret.push( this.parse(key,'key') + ': ' + this.parse(map[key]) ); - this.down(); - return join( '{', ret, '}' ); - }, - node:function( node ) { - var open = this.HTML ? '<' : '<', - close = this.HTML ? '>' : '>'; - - var tag = node.nodeName.toLowerCase(), - ret = open + tag; - - for ( var a in this.DOMAttrs ) { - var val = node[this.DOMAttrs[a]]; - if ( val ) - ret += ' ' + a + '=' + this.parse( val, 'attribute' ); - } - return ret + close + open + '/' + tag + close; - }, - functionArgs:function( fn ) {//function calls it internally, it's the arguments part of the function - var l = fn.length; - if ( !l ) return ''; - - var args = Array(l); - while ( l-- ) - args[l] = String.fromCharCode(97+l);//97 is 'a' - return ' ' + args.join(', ') + ' '; - }, - key:quote, //object calls it internally, the key part of an item in a map - functionCode:'[code]', //function calls it internally, it's the content of the function - attribute:quote, //node calls it internally, it's an html attribute value - string:quote, - date:quote, - regexp:literal, //regex - number:literal, - 'boolean':literal - }, - DOMAttrs:{//attributes to dump from nodes, name=>realName - id:'id', - name:'name', - 'class':'className' - }, - HTML:true,//if true, entities are escaped ( <, >, \t, space and \n ) - indentChar:' ',//indentation unit - multiline:true //if true, items in a collection, are separated by a \n, else just a space. - }; - - return jsDump; -})(); - -})(this); \ No newline at end of file diff --git a/deps/.npm/underscore/1.1.0/package/underscore-min.js b/deps/.npm/underscore/1.1.0/package/underscore-min.js deleted file mode 100644 index 18fed07f..00000000 --- a/deps/.npm/underscore/1.1.0/package/underscore-min.js +++ /dev/null @@ -1,18 +0,0 @@ -(function(){var n=this,A=n._,r=typeof StopIteration!=="undefined"?StopIteration:"__break__",j=Array.prototype,l=Object.prototype,o=j.slice,B=j.unshift,C=l.toString,p=l.hasOwnProperty,s=j.forEach,t=j.map,u=j.reduce,v=j.reduceRight,w=j.filter,x=j.every,y=j.some,m=j.indexOf,z=j.lastIndexOf;l=Array.isArray;var D=Object.keys,b=function(a){return new k(a)};if(typeof exports!=="undefined")exports._=b;n._=b;b.VERSION="1.1.0";var i=b.forEach=function(a,c,d){try{if(s&&a.forEach===s)a.forEach(c,d);else if(b.isNumber(a.length))for(var e= -0,f=a.length;e=e.computed&&(e={value:f,computed:g})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);var e={computed:Infinity};i(a,function(f,g,h){g=c?c.call(d,f,g,h):f;gh? -1:0}),"value")};b.sortedIndex=function(a,c,d){d=d||b.identity;for(var e=0,f=a.length;e>1;d(a[g])=0})})};b.zip=function(){for(var a=b.toArray(arguments),c=b.max(b.pluck(a,"length")),d=new Array(c),e=0;e0?f-c:c-f)>=0)return e;e[g++]=f}};b.bind=function(a,c){var d=b.rest(arguments,2);return function(){return a.apply(c||{},d.concat(b.toArray(arguments)))}};b.bindAll=function(a){var c=b.rest(arguments);if(c.length==0)c=b.functions(a);i(c,function(d){a[d]=b.bind(a[d],a)});return a};b.memoize=function(a,c){var d={};c=c||b.identity;return function(){var e=c.apply(this,arguments);return e in -d?d[e]:(d[e]=a.apply(this,arguments))}};b.delay=function(a,c){var d=b.rest(arguments,2);return setTimeout(function(){return a.apply(a,d)},c)};b.defer=function(a){return b.delay.apply(b,[a,1].concat(b.rest(arguments)))};b.wrap=function(a,c){return function(){var d=[a].concat(b.toArray(arguments));return c.apply(c,d)}};b.compose=function(){var a=b.toArray(arguments);return function(){for(var c=b.toArray(arguments),d=a.length-1;d>=0;d--)c=[a[d].apply(this,c)];return c[0]}};b.keys=D||function(a){if(b.isArray(a))return b.range(0, -a.length);var c=[];for(var d in a)p.call(a,d)&&c.push(d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=function(a){return b.filter(b.keys(a),function(c){return b.isFunction(a[c])}).sort()};b.extend=function(a){i(b.rest(arguments),function(c){for(var d in c)a[d]=c[d]});return a};b.clone=function(a){if(b.isArray(a))return a.slice(0);return b.extend({},a)};b.tap=function(a,c){c(a);return a};b.isEqual=function(a,c){if(a===c)return true;var d=typeof a;if(d!=typeof c)return false; -if(a==c)return true;if(!a&&c||a&&!c)return false;if(a.isEqual)return a.isEqual(c);if(b.isDate(a)&&b.isDate(c))return a.getTime()===c.getTime();if(b.isNaN(a)&&b.isNaN(c))return false;if(b.isRegExp(a)&&b.isRegExp(c))return a.source===c.source&&a.global===c.global&&a.ignoreCase===c.ignoreCase&&a.multiline===c.multiline;if(d!=="object")return false;if(a.length&&a.length!==c.length)return false;d=b.keys(a);var e=b.keys(c);if(d.length!=e.length)return false;for(var f in a)if(!(f in c)||!b.isEqual(a[f], -c[f]))return false;return true};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(p.call(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=l||function(a){return!!(a&&a.concat&&a.unshift&&!a.callee)};b.isArguments=function(a){return a&&a.callee};b.isFunction=function(a){return!!(a&&a.constructor&&a.call&&a.apply)};b.isString=function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)};b.isNumber=function(a){return a=== -+a||C.call(a)==="[object Number]"};b.isBoolean=function(a){return a===true||a===false};b.isDate=function(a){return!!(a&&a.getTimezoneOffset&&a.setUTCFullYear)};b.isRegExp=function(a){return!!(a&&a.test&&a.exec&&(a.ignoreCase||a.ignoreCase===false))};b.isNaN=function(a){return b.isNumber(a)&&isNaN(a)};b.isNull=function(a){return a===null};b.isUndefined=function(a){return typeof a=="undefined"};b.noConflict=function(){n._=A;return this};b.identity=function(a){return a};b.times=function(a,c,d){for(var e= -0;e",interpolate:/<%=(.+?)%>/g};b.template=function(a,c){var d=b.templateSettings,e=new RegExp("'(?=[^"+d.end.substr(0,1)+"]*"+d.end.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")+")","g");d=new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj||{}){p.push('"+a.replace(/\r/g, -"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(e,"\u2704").split("'").join("\\'").split("\u2704").join("'").replace(d.interpolate,"',$1,'").split(d.start).join("');").split(d.end).join("p.push('")+"');}return p.join('');");return c?d(c):d};b.each=b.forEach;b.foldl=b.inject=b.reduce;b.foldr=b.reduceRight;b.select=b.filter;b.all=b.every;b.any=b.some;b.contains=b.include;b.head=b.first;b.tail=b.rest;b.methods=b.functions;var k=function(a){this._wrapped=a},q=function(a,c){return c?b(a).chain(): -a},E=function(a,c){k.prototype[a]=function(){var d=b.toArray(arguments);B.call(d,this._wrapped);return q(c.apply(b,d),this._chain)}};b.mixin(b);i(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var c=j[a];k.prototype[a]=function(){c.apply(this._wrapped,arguments);return q(this._wrapped,this._chain)}});i(["concat","join","slice"],function(a){var c=j[a];k.prototype[a]=function(){return q(c.apply(this._wrapped,arguments),this._chain)}});k.prototype.chain=function(){this._chain= -true;return this};k.prototype.value=function(){return this._wrapped}})(); diff --git a/deps/.npm/underscore/1.1.0/package/underscore.js b/deps/.npm/underscore/1.1.0/package/underscore.js deleted file mode 100644 index 60bf47cc..00000000 --- a/deps/.npm/underscore/1.1.0/package/underscore.js +++ /dev/null @@ -1,713 +0,0 @@ -// Underscore.js -// (c) 2010 Jeremy Ashkenas, DocumentCloud Inc. -// Underscore is freely distributable under the terms of the MIT license. -// Portions of Underscore are inspired by or borrowed from Prototype.js, -// Oliver Steele's Functional, and John Resig's Micro-Templating. -// For all details and documentation: -// http://documentcloud.github.com/underscore - -(function() { - // ------------------------- Baseline setup --------------------------------- - - // Establish the root object, "window" in the browser, or "global" on the server. - var root = this; - - // Save the previous value of the "_" variable. - var previousUnderscore = root._; - - // Establish the object that gets thrown to break out of a loop iteration. - var breaker = typeof StopIteration !== 'undefined' ? StopIteration : '__break__'; - - // Quick regexp-escaping function, because JS doesn't have RegExp.escape(). - var escapeRegExp = function(s) { return s.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1'); }; - - // Save bytes in the minified (but not gzipped) version: - var ArrayProto = Array.prototype, ObjProto = Object.prototype; - - // Create quick reference variables for speed access to core prototypes. - var slice = ArrayProto.slice, - unshift = ArrayProto.unshift, - toString = ObjProto.toString, - hasOwnProperty = ObjProto.hasOwnProperty, - propertyIsEnumerable = ObjProto.propertyIsEnumerable; - - // All ECMA5 native implementations we hope to use are declared here. - var - nativeForEach = ArrayProto.forEach, - nativeMap = ArrayProto.map, - nativeReduce = ArrayProto.reduce, - nativeReduceRight = ArrayProto.reduceRight, - nativeFilter = ArrayProto.filter, - nativeEvery = ArrayProto.every, - nativeSome = ArrayProto.some, - nativeIndexOf = ArrayProto.indexOf, - nativeLastIndexOf = ArrayProto.lastIndexOf, - nativeIsArray = Array.isArray, - nativeKeys = Object.keys; - - // Create a safe reference to the Underscore object for use below. - var _ = function(obj) { return new wrapper(obj); }; - - // Export the Underscore object for CommonJS. - if (typeof exports !== 'undefined') exports._ = _; - - // Export underscore to global scope. - root._ = _; - - // Current version. - _.VERSION = '1.1.0'; - - // ------------------------ Collection Functions: --------------------------- - - // The cornerstone, an each implementation. - // Handles objects implementing forEach, arrays, and raw objects. - // Delegates to JavaScript 1.6's native forEach if available. - var each = _.forEach = function(obj, iterator, context) { - try { - if (nativeForEach && obj.forEach === nativeForEach) { - obj.forEach(iterator, context); - } else if (_.isNumber(obj.length)) { - for (var i = 0, l = obj.length; i < l; i++) iterator.call(context, obj[i], i, obj); - } else { - for (var key in obj) { - if (hasOwnProperty.call(obj, key)) iterator.call(context, obj[key], key, obj); - } - } - } catch(e) { - if (e != breaker) throw e; - } - return obj; - }; - - // Return the results of applying the iterator to each element. - // Delegates to JavaScript 1.6's native map if available. - _.map = function(obj, iterator, context) { - if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); - var results = []; - each(obj, function(value, index, list) { - results.push(iterator.call(context, value, index, list)); - }); - return results; - }; - - // Reduce builds up a single result from a list of values, aka inject, or foldl. - // Delegates to JavaScript 1.8's native reduce if available. - _.reduce = function(obj, iterator, memo, context) { - if (nativeReduce && obj.reduce === nativeReduce) { - if (context) iterator = _.bind(iterator, context); - return obj.reduce(iterator, memo); - } - each(obj, function(value, index, list) { - memo = iterator.call(context, memo, value, index, list); - }); - return memo; - }; - - // The right-associative version of reduce, also known as foldr. Uses - // Delegates to JavaScript 1.8's native reduceRight if available. - _.reduceRight = function(obj, iterator, memo, context) { - if (nativeReduceRight && obj.reduceRight === nativeReduceRight) { - if (context) iterator = _.bind(iterator, context); - return obj.reduceRight(iterator, memo); - } - var reversed = _.clone(_.toArray(obj)).reverse(); - return _.reduce(reversed, iterator, memo, context); - }; - - // Return the first value which passes a truth test. - _.detect = function(obj, iterator, context) { - var result; - each(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) { - result = value; - _.breakLoop(); - } - }); - return result; - }; - - // Return all the elements that pass a truth test. - // Delegates to JavaScript 1.6's native filter if available. - _.filter = function(obj, iterator, context) { - if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context); - var results = []; - each(obj, function(value, index, list) { - iterator.call(context, value, index, list) && results.push(value); - }); - return results; - }; - - // Return all the elements for which a truth test fails. - _.reject = function(obj, iterator, context) { - var results = []; - each(obj, function(value, index, list) { - !iterator.call(context, value, index, list) && results.push(value); - }); - return results; - }; - - // Determine whether all of the elements match a truth test. - // Delegates to JavaScript 1.6's native every if available. - _.every = function(obj, iterator, context) { - iterator = iterator || _.identity; - if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context); - var result = true; - each(obj, function(value, index, list) { - if (!(result = result && iterator.call(context, value, index, list))) _.breakLoop(); - }); - return result; - }; - - // Determine if at least one element in the object matches a truth test. - // Delegates to JavaScript 1.6's native some if available. - _.some = function(obj, iterator, context) { - iterator = iterator || _.identity; - if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context); - var result = false; - each(obj, function(value, index, list) { - if (result = iterator.call(context, value, index, list)) _.breakLoop(); - }); - return result; - }; - - // Determine if a given value is included in the array or object using '==='. - _.include = function(obj, target) { - if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1; - var found = false; - each(obj, function(value) { - if (found = value === target) _.breakLoop(); - }); - return found; - }; - - // Invoke a method with arguments on every item in a collection. - _.invoke = function(obj, method) { - var args = _.rest(arguments, 2); - return _.map(obj, function(value) { - return (method ? value[method] : value).apply(value, args); - }); - }; - - // Convenience version of a common use case of map: fetching a property. - _.pluck = function(obj, key) { - return _.map(obj, function(value){ return value[key]; }); - }; - - // Return the maximum item or (item-based computation). - _.max = function(obj, iterator, context) { - if (!iterator && _.isArray(obj)) return Math.max.apply(Math, obj); - var result = {computed : -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}); - }); - return result.value; - }; - - // Return the minimum element (or element-based computation). - _.min = function(obj, iterator, context) { - if (!iterator && _.isArray(obj)) return Math.min.apply(Math, obj); - var result = {computed : 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}); - }); - return result.value; - }; - - // Sort the object's values by a criterion produced by an iterator. - _.sortBy = function(obj, iterator, context) { - return _.pluck(_.map(obj, function(value, index, list) { - return { - value : value, - criteria : iterator.call(context, value, index, list) - }; - }).sort(function(left, right) { - var a = left.criteria, b = right.criteria; - return a < b ? -1 : a > b ? 1 : 0; - }), 'value'); - }; - - // Use a comparator function to figure out at what index an object should - // be inserted so as to maintain order. Uses binary search. - _.sortedIndex = function(array, obj, iterator) { - iterator = iterator || _.identity; - var low = 0, high = array.length; - while (low < high) { - var mid = (low + high) >> 1; - iterator(array[mid]) < iterator(obj) ? low = mid + 1 : high = mid; - } - return low; - }; - - // Convert anything iterable into a real, live array. - _.toArray = function(iterable) { - if (!iterable) return []; - if (iterable.toArray) return iterable.toArray(); - if (_.isArray(iterable)) return iterable; - if (_.isArguments(iterable)) return slice.call(iterable); - return _.values(iterable); - }; - - // Return the number of elements in an object. - _.size = function(obj) { - return _.toArray(obj).length; - }; - - // -------------------------- Array Functions: ------------------------------ - - // Get the first element of an array. Passing "n" will return the first N - // values in the array. Aliased as "head". The "guard" check allows it to work - // with _.map. - _.first = function(array, n, guard) { - return n && !guard ? slice.call(array, 0, n) : array[0]; - }; - - // Returns everything but the first entry of the array. Aliased as "tail". - // Especially useful on the arguments object. Passing an "index" will return - // the rest of the values in the array from that index onward. The "guard" - //check allows it to work with _.map. - _.rest = function(array, index, guard) { - return slice.call(array, _.isUndefined(index) || guard ? 1 : index); - }; - - // Get the last element of an array. - _.last = function(array) { - return array[array.length - 1]; - }; - - // Trim out all falsy values from an array. - _.compact = function(array) { - return _.filter(array, function(value){ return !!value; }); - }; - - // Return a completely flattened version of an array. - _.flatten = function(array) { - return _.reduce(array, function(memo, value) { - if (_.isArray(value)) return memo.concat(_.flatten(value)); - memo.push(value); - return memo; - }, []); - }; - - // Return a version of the array that does not contain the specified value(s). - _.without = function(array) { - var values = _.rest(arguments); - return _.filter(array, function(value){ return !_.include(values, value); }); - }; - - // Produce a duplicate-free version of the array. If the array has already - // been sorted, you have the option of using a faster algorithm. - _.uniq = function(array, isSorted) { - return _.reduce(array, function(memo, el, i) { - if (0 == i || (isSorted === true ? _.last(memo) != el : !_.include(memo, el))) memo.push(el); - return memo; - }, []); - }; - - // Produce an array that contains every item shared between all the - // passed-in arrays. - _.intersect = function(array) { - var rest = _.rest(arguments); - return _.filter(_.uniq(array), function(item) { - return _.every(rest, function(other) { - return _.indexOf(other, item) >= 0; - }); - }); - }; - - // Zip together multiple lists into a single array -- elements that share - // an index go together. - _.zip = function() { - var args = _.toArray(arguments); - var length = _.max(_.pluck(args, 'length')); - var results = new Array(length); - for (var i = 0; i < length; i++) results[i] = _.pluck(args, String(i)); - return results; - }; - - // If the browser doesn't supply us with indexOf (I'm looking at you, MSIE), - // we need this function. Return the position of the first occurence of an - // item in an array, or -1 if the item is not included in the array. - // Delegates to JavaScript 1.8's native indexOf if available. - _.indexOf = function(array, item) { - if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item); - for (var i = 0, l = array.length; i < l; i++) if (array[i] === item) return i; - return -1; - }; - - - // Delegates to JavaScript 1.6's native lastIndexOf if available. - _.lastIndexOf = function(array, item) { - if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) return array.lastIndexOf(item); - var i = array.length; - while (i--) if (array[i] === item) return i; - return -1; - }; - - // Generate an integer Array containing an arithmetic progression. A port of - // the native Python range() function. See: - // http://docs.python.org/library/functions.html#range - _.range = function(start, stop, step) { - var a = _.toArray(arguments); - var solo = a.length <= 1; - var start = solo ? 0 : a[0], stop = solo ? a[0] : a[1], step = a[2] || 1; - var len = Math.ceil((stop - start) / step); - if (len <= 0) return []; - var range = new Array(len); - for (var i = start, idx = 0; true; i += step) { - if ((step > 0 ? i - stop : stop - i) >= 0) return range; - range[idx++] = i; - } - }; - - // ----------------------- Function Functions: ------------------------------ - - // Create a function bound to a given object (assigning 'this', and arguments, - // optionally). Binding with arguments is also known as 'curry'. - _.bind = function(func, obj) { - var args = _.rest(arguments, 2); - return function() { - return func.apply(obj || {}, args.concat(_.toArray(arguments))); - }; - }; - - // Bind all of an object's methods to that object. Useful for ensuring that - // all callbacks defined on an object belong to it. - _.bindAll = function(obj) { - var funcs = _.rest(arguments); - if (funcs.length == 0) funcs = _.functions(obj); - each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); }); - return obj; - }; - - // Memoize an expensive function by storing its results. - _.memoize = function(func, hasher) { - var memo = {}; - hasher = hasher || _.identity; - return function() { - var key = hasher.apply(this, arguments); - return key in memo ? memo[key] : (memo[key] = func.apply(this, arguments)); - }; - }; - - // Delays a function for the given number of milliseconds, and then calls - // it with the arguments supplied. - _.delay = function(func, wait) { - var args = _.rest(arguments, 2); - return setTimeout(function(){ return func.apply(func, args); }, wait); - }; - - // Defers a function, scheduling it to run after the current call stack has - // cleared. - _.defer = function(func) { - return _.delay.apply(_, [func, 1].concat(_.rest(arguments))); - }; - - // Returns the first function passed as an argument to the second, - // allowing you to adjust arguments, run code before and after, and - // conditionally execute the original function. - _.wrap = function(func, wrapper) { - return function() { - var args = [func].concat(_.toArray(arguments)); - return wrapper.apply(wrapper, args); - }; - }; - - // Returns a function that is the composition of a list of functions, each - // consuming the return value of the function that follows. - _.compose = function() { - var funcs = _.toArray(arguments); - return function() { - var args = _.toArray(arguments); - for (var i=funcs.length-1; i >= 0; i--) { - args = [funcs[i].apply(this, args)]; - } - return args[0]; - }; - }; - - // ------------------------- Object Functions: ------------------------------ - - // Retrieve the names of an object's properties. - // Delegates to ECMA5's native Object.keys - _.keys = nativeKeys || function(obj) { - if (_.isArray(obj)) return _.range(0, obj.length); - var keys = []; - for (var key in obj) if (hasOwnProperty.call(obj, key)) keys.push(key); - return keys; - }; - - // Retrieve the values of an object's properties. - _.values = function(obj) { - return _.map(obj, _.identity); - }; - - // Return a sorted list of the function names available on the object. - _.functions = function(obj) { - return _.filter(_.keys(obj), function(key){ return _.isFunction(obj[key]); }).sort(); - }; - - // Extend a given object with all the properties in passed-in object(s). - _.extend = function(obj) { - each(_.rest(arguments), function(source) { - for (var prop in source) obj[prop] = source[prop]; - }); - return obj; - }; - - // Create a (shallow-cloned) duplicate of an object. - _.clone = function(obj) { - if (_.isArray(obj)) return obj.slice(0); - return _.extend({}, obj); - }; - - // Invokes interceptor with the obj, and then returns obj. - // The primary purpose of this method is to "tap into" a method chain, in order to perform operations on intermediate results within the chain. - _.tap = function(obj, interceptor) { - interceptor(obj); - return obj; - }; - - // Perform a deep comparison to check if two objects are equal. - _.isEqual = function(a, b) { - // Check object identity. - if (a === b) return true; - // Different types? - var atype = typeof(a), btype = typeof(b); - if (atype != btype) return false; - // Basic equality test (watch out for coercions). - if (a == b) return true; - // One is falsy and the other truthy. - if ((!a && b) || (a && !b)) return false; - // One of them implements an isEqual()? - if (a.isEqual) return a.isEqual(b); - // Check dates' integer values. - if (_.isDate(a) && _.isDate(b)) return a.getTime() === b.getTime(); - // Both are NaN? - if (_.isNaN(a) && _.isNaN(b)) return false; - // Compare regular expressions. - if (_.isRegExp(a) && _.isRegExp(b)) - return a.source === b.source && - a.global === b.global && - a.ignoreCase === b.ignoreCase && - a.multiline === b.multiline; - // If a is not an object by this point, we can't handle it. - if (atype !== 'object') return false; - // Check for different array lengths before comparing contents. - if (a.length && (a.length !== b.length)) return false; - // Nothing else worked, deep compare the contents. - var aKeys = _.keys(a), bKeys = _.keys(b); - // Different object sizes? - if (aKeys.length != bKeys.length) return false; - // Recursive comparison of contents. - for (var key in a) if (!(key in b) || !_.isEqual(a[key], b[key])) return false; - return true; - }; - - // Is a given array or object empty? - _.isEmpty = function(obj) { - if (_.isArray(obj) || _.isString(obj)) return obj.length === 0; - for (var key in obj) if (hasOwnProperty.call(obj, key)) return false; - return true; - }; - - // Is a given value a DOM element? - _.isElement = function(obj) { - return !!(obj && obj.nodeType == 1); - }; - - // Is a given value an array? - // Delegates to ECMA5's native Array.isArray - _.isArray = nativeIsArray || function(obj) { - return !!(obj && obj.concat && obj.unshift && !obj.callee); - }; - - // Is a given variable an arguments object? - _.isArguments = function(obj) { - return obj && obj.callee; - }; - - // Is a given value a function? - _.isFunction = function(obj) { - return !!(obj && obj.constructor && obj.call && obj.apply); - }; - - // Is a given value a string? - _.isString = function(obj) { - return !!(obj === '' || (obj && obj.charCodeAt && obj.substr)); - }; - - // Is a given value a number? - _.isNumber = function(obj) { - return (obj === +obj) || (toString.call(obj) === '[object Number]'); - }; - - // Is a given value a boolean? - _.isBoolean = function(obj) { - return obj === true || obj === false; - }; - - // Is a given value a date? - _.isDate = function(obj) { - return !!(obj && obj.getTimezoneOffset && obj.setUTCFullYear); - }; - - // Is the given value a regular expression? - _.isRegExp = function(obj) { - return !!(obj && obj.test && obj.exec && (obj.ignoreCase || obj.ignoreCase === false)); - }; - - // Is the given value NaN -- this one is interesting. NaN != NaN, and - // isNaN(undefined) == true, so we make sure it's a number first. - _.isNaN = function(obj) { - return _.isNumber(obj) && isNaN(obj); - }; - - // Is a given value equal to null? - _.isNull = function(obj) { - return obj === null; - }; - - // Is a given variable undefined? - _.isUndefined = function(obj) { - return typeof obj == 'undefined'; - }; - - // -------------------------- Utility Functions: ---------------------------- - - // Run Underscore.js in noConflict mode, returning the '_' variable to its - // previous owner. Returns a reference to the Underscore object. - _.noConflict = function() { - root._ = previousUnderscore; - return this; - }; - - // Keep the identity function around for default iterators. - _.identity = function(value) { - return value; - }; - - // Run a function n times. - _.times = function (n, iterator, context) { - for (var i = 0; i < n; i++) iterator.call(context, i); - }; - - // Break out of the middle of an iteration. - _.breakLoop = function() { - throw breaker; - }; - - // Add your own custom functions to the Underscore object, ensuring that - // they're correctly added to the OOP wrapper as well. - _.mixin = function(obj) { - each(_.functions(obj), function(name){ - addToWrapper(name, _[name] = obj[name]); - }); - }; - - // Generate a unique integer id (unique within the entire client session). - // Useful for temporary DOM ids. - var idCounter = 0; - _.uniqueId = function(prefix) { - var id = idCounter++; - return prefix ? prefix + id : id; - }; - - // By default, Underscore uses ERB-style template delimiters, change the - // following template settings to use alternative delimiters. - _.templateSettings = { - start : '<%', - end : '%>', - interpolate : /<%=(.+?)%>/g - }; - - // JavaScript templating a-la ERB, pilfered from John Resig's - // "Secrets of the JavaScript Ninja", page 83. - // Single-quote fix from Rick Strahl's version. - // With alterations for arbitrary delimiters, and to preserve whitespace. - _.template = function(str, data) { - var c = _.templateSettings; - var endMatch = new RegExp("'(?=[^"+c.end.substr(0, 1)+"]*"+escapeRegExp(c.end)+")","g"); - var fn = new Function('obj', - 'var p=[],print=function(){p.push.apply(p,arguments);};' + - 'with(obj||{}){p.push(\'' + - str.replace(/\r/g, '\\r') - .replace(/\n/g, '\\n') - .replace(/\t/g, '\\t') - .replace(endMatch,"✄") - .split("'").join("\\'") - .split("✄").join("'") - .replace(c.interpolate, "',$1,'") - .split(c.start).join("');") - .split(c.end).join("p.push('") - + "');}return p.join('');"); - return data ? fn(data) : fn; - }; - - // ------------------------------- Aliases ---------------------------------- - - _.each = _.forEach; - _.foldl = _.inject = _.reduce; - _.foldr = _.reduceRight; - _.select = _.filter; - _.all = _.every; - _.any = _.some; - _.contains = _.include; - _.head = _.first; - _.tail = _.rest; - _.methods = _.functions; - - // ------------------------ Setup the OOP Wrapper: -------------------------- - - // If Underscore is called as a function, it returns a wrapped object that - // can be used OO-style. This wrapper holds altered versions of all the - // underscore functions. Wrapped objects may be chained. - var wrapper = function(obj) { this._wrapped = obj; }; - - // Helper function to continue chaining intermediate results. - var result = function(obj, chain) { - return chain ? _(obj).chain() : obj; - }; - - // A method to easily add functions to the OOP wrapper. - var addToWrapper = function(name, func) { - wrapper.prototype[name] = function() { - var args = _.toArray(arguments); - unshift.call(args, this._wrapped); - return result(func.apply(_, args), this._chain); - }; - }; - - // Add all of the Underscore functions to the wrapper object. - _.mixin(_); - - // Add all mutator Array functions to the wrapper. - each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { - var method = ArrayProto[name]; - wrapper.prototype[name] = function() { - method.apply(this._wrapped, arguments); - return result(this._wrapped, this._chain); - }; - }); - - // Add all accessor Array functions to the wrapper. - each(['concat', 'join', 'slice'], function(name) { - var method = ArrayProto[name]; - wrapper.prototype[name] = function() { - return result(method.apply(this._wrapped, arguments), this._chain); - }; - }); - - // Start chaining a wrapped Underscore object. - wrapper.prototype.chain = function() { - this._chain = true; - return this; - }; - - // Extracts the result from a wrapped and chained object. - wrapper.prototype.value = function() { - return this._wrapped; - }; - -})(); diff --git a/deps/.npm/underscore/active b/deps/.npm/underscore/active deleted file mode 120000 index e7a5332a..00000000 --- a/deps/.npm/underscore/active +++ /dev/null @@ -1 +0,0 @@ -./1.1.0 \ No newline at end of file diff --git a/deps/connect b/deps/connect deleted file mode 120000 index afda7818..00000000 --- a/deps/connect +++ /dev/null @@ -1 +0,0 @@ -./connect@0.2.5 \ No newline at end of file diff --git a/deps/connect@0.2.5/index.js b/deps/connect@0.2.5/index.js deleted file mode 100755 index 83c3a833..00000000 --- a/deps/connect@0.2.5/index.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../.npm/connect/0.2.5/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../.npm/connect/0.2.5/package/lib/connect/index" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/connect@0.2.5/middleware/bodyDecoder.js b/deps/connect@0.2.5/middleware/bodyDecoder.js deleted file mode 100755 index 5147b0e0..00000000 --- a/deps/connect@0.2.5/middleware/bodyDecoder.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/connect/0.2.5/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/connect/0.2.5/package/lib/connect/middleware/bodyDecoder" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/connect@0.2.5/middleware/cache.js b/deps/connect@0.2.5/middleware/cache.js deleted file mode 100755 index 606ff0ad..00000000 --- a/deps/connect@0.2.5/middleware/cache.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/connect/0.2.5/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/connect/0.2.5/package/lib/connect/middleware/cache" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/connect@0.2.5/middleware/cacheManifest.js b/deps/connect@0.2.5/middleware/cacheManifest.js deleted file mode 100755 index 7226691b..00000000 --- a/deps/connect@0.2.5/middleware/cacheManifest.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/connect/0.2.5/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/connect/0.2.5/package/lib/connect/middleware/cacheManifest" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/connect@0.2.5/middleware/compiler.js b/deps/connect@0.2.5/middleware/compiler.js deleted file mode 100755 index 0f7ac89a..00000000 --- a/deps/connect@0.2.5/middleware/compiler.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/connect/0.2.5/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/connect/0.2.5/package/lib/connect/middleware/compiler" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/connect@0.2.5/middleware/conditionalGet.js b/deps/connect@0.2.5/middleware/conditionalGet.js deleted file mode 100755 index 3d787e05..00000000 --- a/deps/connect@0.2.5/middleware/conditionalGet.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/connect/0.2.5/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/connect/0.2.5/package/lib/connect/middleware/conditionalGet" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/connect@0.2.5/middleware/cookieDecoder.js b/deps/connect@0.2.5/middleware/cookieDecoder.js deleted file mode 100755 index 088d8329..00000000 --- a/deps/connect@0.2.5/middleware/cookieDecoder.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/connect/0.2.5/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/connect/0.2.5/package/lib/connect/middleware/cookieDecoder" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/connect@0.2.5/middleware/errorHandler.js b/deps/connect@0.2.5/middleware/errorHandler.js deleted file mode 100755 index 6d2e25f6..00000000 --- a/deps/connect@0.2.5/middleware/errorHandler.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/connect/0.2.5/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/connect/0.2.5/package/lib/connect/middleware/errorHandler" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/connect@0.2.5/middleware/favicon.js b/deps/connect@0.2.5/middleware/favicon.js deleted file mode 100755 index 5dfb0095..00000000 --- a/deps/connect@0.2.5/middleware/favicon.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/connect/0.2.5/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/connect/0.2.5/package/lib/connect/middleware/favicon" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/connect@0.2.5/middleware/gzip-compress.js b/deps/connect@0.2.5/middleware/gzip-compress.js deleted file mode 100755 index 6b061a1f..00000000 --- a/deps/connect@0.2.5/middleware/gzip-compress.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/connect/0.2.5/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/connect/0.2.5/package/lib/connect/middleware/gzip-compress" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/connect@0.2.5/middleware/gzip-proc.js b/deps/connect@0.2.5/middleware/gzip-proc.js deleted file mode 100755 index ed2abcb9..00000000 --- a/deps/connect@0.2.5/middleware/gzip-proc.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/connect/0.2.5/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/connect/0.2.5/package/lib/connect/middleware/gzip-proc" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/connect@0.2.5/middleware/gzip.js b/deps/connect@0.2.5/middleware/gzip.js deleted file mode 100755 index 8203e247..00000000 --- a/deps/connect@0.2.5/middleware/gzip.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/connect/0.2.5/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/connect/0.2.5/package/lib/connect/middleware/gzip" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/connect@0.2.5/middleware/lint.js b/deps/connect@0.2.5/middleware/lint.js deleted file mode 100755 index 2407d479..00000000 --- a/deps/connect@0.2.5/middleware/lint.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/connect/0.2.5/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/connect/0.2.5/package/lib/connect/middleware/lint" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/connect@0.2.5/middleware/logger.js b/deps/connect@0.2.5/middleware/logger.js deleted file mode 100755 index 0592ee06..00000000 --- a/deps/connect@0.2.5/middleware/logger.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/connect/0.2.5/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/connect/0.2.5/package/lib/connect/middleware/logger" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/connect@0.2.5/middleware/methodOverride.js b/deps/connect@0.2.5/middleware/methodOverride.js deleted file mode 100755 index 230cf796..00000000 --- a/deps/connect@0.2.5/middleware/methodOverride.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/connect/0.2.5/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/connect/0.2.5/package/lib/connect/middleware/methodOverride" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/connect@0.2.5/middleware/repl.js b/deps/connect@0.2.5/middleware/repl.js deleted file mode 100755 index 521a618d..00000000 --- a/deps/connect@0.2.5/middleware/repl.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/connect/0.2.5/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/connect/0.2.5/package/lib/connect/middleware/repl" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/connect@0.2.5/middleware/router.js b/deps/connect@0.2.5/middleware/router.js deleted file mode 100755 index 860a9dc1..00000000 --- a/deps/connect@0.2.5/middleware/router.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/connect/0.2.5/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/connect/0.2.5/package/lib/connect/middleware/router" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/connect@0.2.5/middleware/session.js b/deps/connect@0.2.5/middleware/session.js deleted file mode 100755 index 63187052..00000000 --- a/deps/connect@0.2.5/middleware/session.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/connect/0.2.5/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/connect/0.2.5/package/lib/connect/middleware/session" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/connect@0.2.5/middleware/session/memory.js b/deps/connect@0.2.5/middleware/session/memory.js deleted file mode 100755 index 6f6543b6..00000000 --- a/deps/connect@0.2.5/middleware/session/memory.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../../.npm/connect/0.2.5/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../../.npm/connect/0.2.5/package/lib/connect/middleware/session/memory" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/connect@0.2.5/middleware/session/session.js b/deps/connect@0.2.5/middleware/session/session.js deleted file mode 100755 index fb391db5..00000000 --- a/deps/connect@0.2.5/middleware/session/session.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../../.npm/connect/0.2.5/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../../.npm/connect/0.2.5/package/lib/connect/middleware/session/session" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/connect@0.2.5/middleware/session/store.js b/deps/connect@0.2.5/middleware/session/store.js deleted file mode 100755 index 521fd5aa..00000000 --- a/deps/connect@0.2.5/middleware/session/store.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../../.npm/connect/0.2.5/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../../.npm/connect/0.2.5/package/lib/connect/middleware/session/store" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/connect@0.2.5/middleware/staticGzip.js b/deps/connect@0.2.5/middleware/staticGzip.js deleted file mode 100755 index df7c7097..00000000 --- a/deps/connect@0.2.5/middleware/staticGzip.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/connect/0.2.5/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/connect/0.2.5/package/lib/connect/middleware/staticGzip" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/connect@0.2.5/middleware/staticProvider.js b/deps/connect@0.2.5/middleware/staticProvider.js deleted file mode 100755 index 4656dfab..00000000 --- a/deps/connect@0.2.5/middleware/staticProvider.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/connect/0.2.5/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/connect/0.2.5/package/lib/connect/middleware/staticProvider" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/connect@0.2.5/middleware/vhost.js b/deps/connect@0.2.5/middleware/vhost.js deleted file mode 100755 index fd5623aa..00000000 --- a/deps/connect@0.2.5/middleware/vhost.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/connect/0.2.5/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/connect/0.2.5/package/lib/connect/middleware/vhost" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/connect@0.2.5/public/error.js b/deps/connect@0.2.5/public/error.js deleted file mode 100755 index 8a2b1a21..00000000 --- a/deps/connect@0.2.5/public/error.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/connect/0.2.5/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/connect/0.2.5/package/lib/connect/public/error.html" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/connect@0.2.5/public/favicon.js b/deps/connect@0.2.5/public/favicon.js deleted file mode 100755 index 91585477..00000000 --- a/deps/connect@0.2.5/public/favicon.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/connect/0.2.5/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/connect/0.2.5/package/lib/connect/public/favicon.ico" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/connect@0.2.5/public/style.js b/deps/connect@0.2.5/public/style.js deleted file mode 100755 index 5c21dd60..00000000 --- a/deps/connect@0.2.5/public/style.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/connect/0.2.5/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/connect/0.2.5/package/lib/connect/public/style.css" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/connect@0.2.5/utils.js b/deps/connect@0.2.5/utils.js deleted file mode 100755 index 4207b193..00000000 --- a/deps/connect@0.2.5/utils.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../.npm/connect/0.2.5/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../.npm/connect/0.2.5/package/lib/connect/utils" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/index.js b/deps/index.js index 77060d3f..712b3d9c 100644 --- a/deps/index.js +++ b/deps/index.js @@ -3,6 +3,5 @@ var i = require.paths.indexOf(__dirname) if (i && i + 1) require.paths.splice(i, 1) if (i) require.paths.shift(__dirname) exports["underscore"] = require('./'+"underscore") -exports["connect"] = require('./'+"connect") exports["vows"] = require('./'+"vows") exports["eyes"] = require('./'+"eyes") \ No newline at end of file diff --git a/deps/underscore b/deps/underscore deleted file mode 120000 index 577e0331..00000000 --- a/deps/underscore +++ /dev/null @@ -1 +0,0 @@ -./underscore@1.1.0 \ No newline at end of file diff --git a/deps/underscore@1.1.0/index.js b/deps/underscore@1.1.0/index.js deleted file mode 100755 index d423cbf3..00000000 --- a/deps/underscore@1.1.0/index.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../.npm/underscore/1.1.0/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../.npm/underscore/1.1.0/package/underscore" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/underscore@1.1.0/test/arrays.js b/deps/underscore@1.1.0/test/arrays.js deleted file mode 100755 index 82e146ce..00000000 --- a/deps/underscore@1.1.0/test/arrays.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/underscore/1.1.0/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/underscore/1.1.0/package/test/arrays" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/underscore@1.1.0/test/chaining.js b/deps/underscore@1.1.0/test/chaining.js deleted file mode 100755 index 1aeceb4c..00000000 --- a/deps/underscore@1.1.0/test/chaining.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/underscore/1.1.0/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/underscore/1.1.0/package/test/chaining" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/underscore@1.1.0/test/collections.js b/deps/underscore@1.1.0/test/collections.js deleted file mode 100755 index 5fb55be4..00000000 --- a/deps/underscore@1.1.0/test/collections.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/underscore/1.1.0/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/underscore/1.1.0/package/test/collections" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/underscore@1.1.0/test/functions.js b/deps/underscore@1.1.0/test/functions.js deleted file mode 100755 index 49aa4d27..00000000 --- a/deps/underscore@1.1.0/test/functions.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/underscore/1.1.0/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/underscore/1.1.0/package/test/functions" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/underscore@1.1.0/test/objects.js b/deps/underscore@1.1.0/test/objects.js deleted file mode 100755 index c6f49801..00000000 --- a/deps/underscore@1.1.0/test/objects.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/underscore/1.1.0/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/underscore/1.1.0/package/test/objects" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/underscore@1.1.0/test/speed.js b/deps/underscore@1.1.0/test/speed.js deleted file mode 100755 index 309a6ec9..00000000 --- a/deps/underscore@1.1.0/test/speed.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/underscore/1.1.0/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/underscore/1.1.0/package/test/speed" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/underscore@1.1.0/test/temp.js b/deps/underscore@1.1.0/test/temp.js deleted file mode 100755 index 990ab478..00000000 --- a/deps/underscore@1.1.0/test/temp.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/underscore/1.1.0/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/underscore/1.1.0/package/test/temp" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/underscore@1.1.0/test/temp_tests.js b/deps/underscore@1.1.0/test/temp_tests.js deleted file mode 100755 index 40273b86..00000000 --- a/deps/underscore@1.1.0/test/temp_tests.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/underscore/1.1.0/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/underscore/1.1.0/package/test/temp_tests.html" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/underscore@1.1.0/test/test.js b/deps/underscore@1.1.0/test/test.js deleted file mode 100755 index 99d5b48e..00000000 --- a/deps/underscore@1.1.0/test/test.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/underscore/1.1.0/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/underscore/1.1.0/package/test/test.html" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/underscore@1.1.0/test/utility.js b/deps/underscore@1.1.0/test/utility.js deleted file mode 100755 index b661246f..00000000 --- a/deps/underscore@1.1.0/test/utility.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../.npm/underscore/1.1.0/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../.npm/underscore/1.1.0/package/test/utility" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/underscore@1.1.0/test/vendor/jquery.js b/deps/underscore@1.1.0/test/vendor/jquery.js deleted file mode 100755 index 7a18b68d..00000000 --- a/deps/underscore@1.1.0/test/vendor/jquery.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../../.npm/underscore/1.1.0/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../../.npm/underscore/1.1.0/package/test/vendor/jquery" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/underscore@1.1.0/test/vendor/jslitmus.js b/deps/underscore@1.1.0/test/vendor/jslitmus.js deleted file mode 100755 index b120d6f7..00000000 --- a/deps/underscore@1.1.0/test/vendor/jslitmus.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../../.npm/underscore/1.1.0/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../../.npm/underscore/1.1.0/package/test/vendor/jslitmus" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/underscore@1.1.0/test/vendor/qunit.js b/deps/underscore@1.1.0/test/vendor/qunit.js deleted file mode 100755 index c6da7a09..00000000 --- a/deps/underscore@1.1.0/test/vendor/qunit.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../../../.npm/underscore/1.1.0/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../../../.npm/underscore/1.1.0/package/test/vendor/qunit" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/underscore@1.1.0/underscore-min.js b/deps/underscore@1.1.0/underscore-min.js deleted file mode 100755 index 88f06e66..00000000 --- a/deps/underscore@1.1.0/underscore-min.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../.npm/underscore/1.1.0/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../.npm/underscore/1.1.0/package/underscore-min" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/deps/underscore@1.1.0/underscore.js b/deps/underscore@1.1.0/underscore.js deleted file mode 100755 index d423cbf3..00000000 --- a/deps/underscore@1.1.0/underscore.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/Users/loren/local/bin/node -// generated by npm, please don't touch! -var dep = require('path').join(__dirname, "./../.npm/underscore/1.1.0/dependencies") -var depMet = require.paths.indexOf(dep) !== -1 -var from = "./../.npm/underscore/1.1.0/package/underscore" - -if (!depMet) require.paths.unshift(dep) -module.exports = require(from) - -if (!depMet) { - var i = require.paths.indexOf(dep) - if (i !== -1) require.paths.splice(i, 1) -} diff --git a/package.json b/package.json index 7ea5f736..5d278bb8 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,6 @@ "directories": {"lib": "./lib", "deps": "./deps", "test": "./test"}, "dependencies": { "underscore" : ">=1.1.0", - "connect" : ">=0.2.5", "vows" : ">=0.5.0", "eyes" : ">=0.1.6" },