├── .gitignore ├── .gitmodules ├── .travis.yml ├── README.md ├── build ├── README.md ├── build.cmd ├── build.js ├── node_modules │ ├── .bin │ │ ├── uglifyjs │ │ └── uglifyjs.cmd │ └── uglify-js │ │ ├── .npmignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── lib │ │ ├── ast.js │ │ ├── compress.js │ │ ├── mozilla-ast.js │ │ ├── output.js │ │ ├── parse.js │ │ ├── scope.js │ │ ├── sourcemap.js │ │ ├── transform.js │ │ └── utils.js │ │ ├── node_modules │ │ ├── async │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── component.json │ │ │ ├── lib │ │ │ │ └── async.js │ │ │ └── package.json │ │ ├── optimist │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── example │ │ │ │ ├── bool.js │ │ │ │ ├── boolean_double.js │ │ │ │ ├── boolean_single.js │ │ │ │ ├── default_hash.js │ │ │ │ ├── default_singles.js │ │ │ │ ├── divide.js │ │ │ │ ├── line_count.js │ │ │ │ ├── line_count_options.js │ │ │ │ ├── line_count_wrap.js │ │ │ │ ├── nonopt.js │ │ │ │ ├── reflect.js │ │ │ │ ├── short.js │ │ │ │ ├── string.js │ │ │ │ ├── usage-options.js │ │ │ │ └── xup.js │ │ │ ├── index.js │ │ │ ├── node_modules │ │ │ │ └── wordwrap │ │ │ │ │ ├── .npmignore │ │ │ │ │ ├── README.markdown │ │ │ │ │ ├── example │ │ │ │ │ ├── center.js │ │ │ │ │ └── meat.js │ │ │ │ │ ├── index.js │ │ │ │ │ ├── package.json │ │ │ │ │ └── test │ │ │ │ │ ├── break.js │ │ │ │ │ ├── idleness.txt │ │ │ │ │ └── wrap.js │ │ │ ├── package.json │ │ │ ├── readme.markdown │ │ │ └── test │ │ │ │ ├── _.js │ │ │ │ ├── _ │ │ │ │ ├── argv.js │ │ │ │ └── bin.js │ │ │ │ ├── parse.js │ │ │ │ └── usage.js │ │ ├── source-map │ │ │ ├── .npmignore │ │ │ ├── .travis.yml │ │ │ ├── CHANGELOG.md │ │ │ ├── LICENSE │ │ │ ├── Makefile.dryice.js │ │ │ ├── README.md │ │ │ ├── build │ │ │ │ ├── assert-shim.js │ │ │ │ ├── mini-require.js │ │ │ │ ├── prefix-source-map.jsm │ │ │ │ ├── prefix-utils.jsm │ │ │ │ ├── suffix-browser.js │ │ │ │ ├── suffix-source-map.jsm │ │ │ │ ├── suffix-utils.jsm │ │ │ │ ├── test-prefix.js │ │ │ │ └── test-suffix.js │ │ │ ├── lib │ │ │ │ ├── source-map.js │ │ │ │ └── source-map │ │ │ │ │ ├── array-set.js │ │ │ │ │ ├── base64-vlq.js │ │ │ │ │ ├── base64.js │ │ │ │ │ ├── binary-search.js │ │ │ │ │ ├── source-map-consumer.js │ │ │ │ │ ├── source-map-generator.js │ │ │ │ │ ├── source-node.js │ │ │ │ │ └── util.js │ │ │ ├── node_modules │ │ │ │ └── amdefine │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── README.md │ │ │ │ │ ├── amdefine.js │ │ │ │ │ ├── intercept.js │ │ │ │ │ └── package.json │ │ │ ├── package.json │ │ │ └── test │ │ │ │ ├── run-tests.js │ │ │ │ └── source-map │ │ │ │ ├── test-api.js │ │ │ │ ├── test-array-set.js │ │ │ │ ├── test-base64-vlq.js │ │ │ │ ├── test-base64.js │ │ │ │ ├── test-binary-search.js │ │ │ │ ├── test-dog-fooding.js │ │ │ │ ├── test-source-map-consumer.js │ │ │ │ ├── test-source-map-generator.js │ │ │ │ ├── test-source-node.js │ │ │ │ ├── test-util.js │ │ │ │ └── util.js │ │ └── uglify-to-browserify │ │ │ ├── .npmignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ ├── package.json │ │ │ └── test │ │ │ └── index.js │ │ ├── package.json │ │ ├── test │ │ ├── compress │ │ │ ├── arrays.js │ │ │ ├── blocks.js │ │ │ ├── concat-strings.js │ │ │ ├── conditionals.js │ │ │ ├── dead-code.js │ │ │ ├── debugger.js │ │ │ ├── drop-unused.js │ │ │ ├── issue-105.js │ │ │ ├── issue-12.js │ │ │ ├── issue-126.js │ │ │ ├── issue-143.js │ │ │ ├── issue-22.js │ │ │ ├── issue-267.js │ │ │ ├── issue-269.js │ │ │ ├── issue-44.js │ │ │ ├── issue-59.js │ │ │ ├── labels.js │ │ │ ├── loops.js │ │ │ ├── negate-iife.js │ │ │ ├── properties.js │ │ │ ├── sequences.js │ │ │ ├── switch.js │ │ │ └── typeof.js │ │ └── run-tests.js │ │ └── tools │ │ └── node.js └── npm.cmd ├── component.json ├── demo.closure-advanced.htm ├── demo.htm ├── demo.min.htm ├── dist ├── backbone.min.js ├── jquip.ajax.min.js ├── jquip.all.closure-advanced.js ├── jquip.all.js ├── jquip.all.min.js ├── jquip.css.min.js ├── jquip.custom.min.js ├── jquip.docready.min.js ├── jquip.events.min.js ├── jquip.min.js ├── jquip.q-min.min.js ├── jquip.q-qwery.min.js ├── jquip.q-sizzle.min.js ├── spine.min.js └── underscore-1.2.2.min.js ├── docs ├── javascripts │ └── scale.fix.js ├── params.json └── stylesheets │ ├── pygment_trac.css │ └── styles.css ├── index.html ├── jquip.csproj ├── server ├── default.htm ├── demo.htm └── jquip.builder.js ├── src ├── jquip.ajax.js ├── jquip.css.js ├── jquip.custom.js ├── jquip.docready.js ├── jquip.events.js ├── jquip.js ├── jquip.q-min.js ├── jquip.q-qwery.js └── jquip.q-sizzle.js └── test ├── ajax ├── node_modules │ ├── .bin │ │ └── express │ └── express │ │ ├── .npmignore │ │ ├── History.md │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── Readme.md │ │ ├── index.js │ │ ├── lib │ │ ├── express.js │ │ ├── http.js │ │ ├── https.js │ │ ├── request.js │ │ ├── response.js │ │ ├── router │ │ │ ├── collection.js │ │ │ ├── index.js │ │ │ ├── methods.js │ │ │ └── route.js │ │ ├── utils.js │ │ ├── view.js │ │ └── view │ │ │ ├── partial.js │ │ │ └── view.js │ │ ├── node_modules │ │ ├── connect │ │ │ ├── .npmignore │ │ │ ├── LICENSE │ │ │ ├── index.js │ │ │ ├── lib │ │ │ │ ├── cache.js │ │ │ │ ├── connect.js │ │ │ │ ├── http.js │ │ │ │ ├── https.js │ │ │ │ ├── index.js │ │ │ │ ├── middleware │ │ │ │ │ ├── basicAuth.js │ │ │ │ │ ├── bodyParser.js │ │ │ │ │ ├── compiler.js │ │ │ │ │ ├── cookieParser.js │ │ │ │ │ ├── csrf.js │ │ │ │ │ ├── directory.js │ │ │ │ │ ├── errorHandler.js │ │ │ │ │ ├── favicon.js │ │ │ │ │ ├── limit.js │ │ │ │ │ ├── logger.js │ │ │ │ │ ├── methodOverride.js │ │ │ │ │ ├── profiler.js │ │ │ │ │ ├── query.js │ │ │ │ │ ├── responseTime.js │ │ │ │ │ ├── router.js │ │ │ │ │ ├── session.js │ │ │ │ │ ├── session │ │ │ │ │ │ ├── cookie.js │ │ │ │ │ │ ├── memory.js │ │ │ │ │ │ ├── session.js │ │ │ │ │ │ └── store.js │ │ │ │ │ ├── static.js │ │ │ │ │ ├── staticCache.js │ │ │ │ │ └── vhost.js │ │ │ │ ├── patch.js │ │ │ │ ├── public │ │ │ │ │ ├── directory.html │ │ │ │ │ ├── error.html │ │ │ │ │ ├── favicon.ico │ │ │ │ │ ├── icons │ │ │ │ │ │ ├── page.png │ │ │ │ │ │ ├── page_add.png │ │ │ │ │ │ ├── page_attach.png │ │ │ │ │ │ ├── page_code.png │ │ │ │ │ │ ├── page_copy.png │ │ │ │ │ │ ├── page_delete.png │ │ │ │ │ │ ├── page_edit.png │ │ │ │ │ │ ├── page_error.png │ │ │ │ │ │ ├── page_excel.png │ │ │ │ │ │ ├── page_find.png │ │ │ │ │ │ ├── page_gear.png │ │ │ │ │ │ ├── page_go.png │ │ │ │ │ │ ├── page_green.png │ │ │ │ │ │ ├── page_key.png │ │ │ │ │ │ ├── page_lightning.png │ │ │ │ │ │ ├── page_link.png │ │ │ │ │ │ ├── page_paintbrush.png │ │ │ │ │ │ ├── page_paste.png │ │ │ │ │ │ ├── page_red.png │ │ │ │ │ │ ├── page_refresh.png │ │ │ │ │ │ ├── page_save.png │ │ │ │ │ │ ├── page_white.png │ │ │ │ │ │ ├── page_white_acrobat.png │ │ │ │ │ │ ├── page_white_actionscript.png │ │ │ │ │ │ ├── page_white_add.png │ │ │ │ │ │ ├── page_white_c.png │ │ │ │ │ │ ├── page_white_camera.png │ │ │ │ │ │ ├── page_white_cd.png │ │ │ │ │ │ ├── page_white_code.png │ │ │ │ │ │ ├── page_white_code_red.png │ │ │ │ │ │ ├── page_white_coldfusion.png │ │ │ │ │ │ ├── page_white_compressed.png │ │ │ │ │ │ ├── page_white_copy.png │ │ │ │ │ │ ├── page_white_cplusplus.png │ │ │ │ │ │ ├── page_white_csharp.png │ │ │ │ │ │ ├── page_white_cup.png │ │ │ │ │ │ ├── page_white_database.png │ │ │ │ │ │ ├── page_white_delete.png │ │ │ │ │ │ ├── page_white_dvd.png │ │ │ │ │ │ ├── page_white_edit.png │ │ │ │ │ │ ├── page_white_error.png │ │ │ │ │ │ ├── page_white_excel.png │ │ │ │ │ │ ├── page_white_find.png │ │ │ │ │ │ ├── page_white_flash.png │ │ │ │ │ │ ├── page_white_freehand.png │ │ │ │ │ │ ├── page_white_gear.png │ │ │ │ │ │ ├── page_white_get.png │ │ │ │ │ │ ├── page_white_go.png │ │ │ │ │ │ ├── page_white_h.png │ │ │ │ │ │ ├── page_white_horizontal.png │ │ │ │ │ │ ├── page_white_key.png │ │ │ │ │ │ ├── page_white_lightning.png │ │ │ │ │ │ ├── page_white_link.png │ │ │ │ │ │ ├── page_white_magnify.png │ │ │ │ │ │ ├── page_white_medal.png │ │ │ │ │ │ ├── page_white_office.png │ │ │ │ │ │ ├── page_white_paint.png │ │ │ │ │ │ ├── page_white_paintbrush.png │ │ │ │ │ │ ├── page_white_paste.png │ │ │ │ │ │ ├── page_white_php.png │ │ │ │ │ │ ├── page_white_picture.png │ │ │ │ │ │ ├── page_white_powerpoint.png │ │ │ │ │ │ ├── page_white_put.png │ │ │ │ │ │ ├── page_white_ruby.png │ │ │ │ │ │ ├── page_white_stack.png │ │ │ │ │ │ ├── page_white_star.png │ │ │ │ │ │ ├── page_white_swoosh.png │ │ │ │ │ │ ├── page_white_text.png │ │ │ │ │ │ ├── page_white_text_width.png │ │ │ │ │ │ ├── page_white_tux.png │ │ │ │ │ │ ├── page_white_vector.png │ │ │ │ │ │ ├── page_white_visualstudio.png │ │ │ │ │ │ ├── page_white_width.png │ │ │ │ │ │ ├── page_white_word.png │ │ │ │ │ │ ├── page_white_world.png │ │ │ │ │ │ ├── page_white_wrench.png │ │ │ │ │ │ ├── page_white_zip.png │ │ │ │ │ │ ├── page_word.png │ │ │ │ │ │ └── page_world.png │ │ │ │ │ └── style.css │ │ │ │ └── utils.js │ │ │ ├── node_modules │ │ │ │ └── formidable │ │ │ │ │ ├── ..travis.yml.un~ │ │ │ │ │ ├── .Readme.md.un~ │ │ │ │ │ ├── .npmignore │ │ │ │ │ ├── .package.json.un~ │ │ │ │ │ ├── .travis.yml │ │ │ │ │ ├── Makefile │ │ │ │ │ ├── Readme.md │ │ │ │ │ ├── TODO │ │ │ │ │ ├── benchmark │ │ │ │ │ └── bench-multipart-parser.js │ │ │ │ │ ├── example │ │ │ │ │ ├── post.js │ │ │ │ │ └── upload.js │ │ │ │ │ ├── index.js │ │ │ │ │ ├── lib │ │ │ │ │ ├── .incoming_form.js.un~ │ │ │ │ │ ├── file.js │ │ │ │ │ ├── incoming_form.js │ │ │ │ │ ├── index.js │ │ │ │ │ ├── multipart_parser.js │ │ │ │ │ ├── querystring_parser.js │ │ │ │ │ └── util.js │ │ │ │ │ ├── package.json │ │ │ │ │ ├── test │ │ │ │ │ ├── .common.js.un~ │ │ │ │ │ ├── .run.js.un~ │ │ │ │ │ ├── common.js │ │ │ │ │ ├── fixture │ │ │ │ │ │ ├── file │ │ │ │ │ │ │ ├── funkyfilename.txt │ │ │ │ │ │ │ └── plain.txt │ │ │ │ │ │ ├── http │ │ │ │ │ │ │ └── special-chars-in-filename │ │ │ │ │ │ │ │ └── info.md │ │ │ │ │ │ ├── js │ │ │ │ │ │ │ ├── .special-chars-in-filename.js.un~ │ │ │ │ │ │ │ ├── no-filename.js │ │ │ │ │ │ │ └── special-chars-in-filename.js │ │ │ │ │ │ └── multipart.js │ │ │ │ │ ├── integration │ │ │ │ │ │ ├── .test-fixtures.js.un~ │ │ │ │ │ │ └── test-fixtures.js │ │ │ │ │ ├── legacy │ │ │ │ │ │ ├── common.js │ │ │ │ │ │ ├── integration │ │ │ │ │ │ │ └── test-multipart-parser.js │ │ │ │ │ │ ├── simple │ │ │ │ │ │ │ ├── test-file.js │ │ │ │ │ │ │ ├── test-incoming-form.js │ │ │ │ │ │ │ ├── test-multipart-parser.js │ │ │ │ │ │ │ └── test-querystring-parser.js │ │ │ │ │ │ └── system │ │ │ │ │ │ │ └── test-multi-video-upload.js │ │ │ │ │ ├── run.js │ │ │ │ │ ├── tmp │ │ │ │ │ │ └── .empty │ │ │ │ │ └── unit │ │ │ │ │ │ ├── .test-incoming-form.js.un~ │ │ │ │ │ │ └── test-incoming-form.js │ │ │ │ │ └── tool │ │ │ │ │ └── record.js │ │ │ ├── package.json │ │ │ └── test.js │ │ ├── mime │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── mime.js │ │ │ ├── package.json │ │ │ ├── test.js │ │ │ └── types │ │ │ │ ├── mime.types │ │ │ │ └── node.types │ │ ├── mkdirp │ │ │ ├── .gitignore.orig │ │ │ ├── .gitignore.rej │ │ │ ├── .npmignore │ │ │ ├── LICENSE │ │ │ ├── README.markdown │ │ │ ├── examples │ │ │ │ ├── pow.js │ │ │ │ ├── pow.js.orig │ │ │ │ └── pow.js.rej │ │ │ ├── index.js │ │ │ ├── package.json │ │ │ └── test │ │ │ │ ├── mkdirp.js │ │ │ │ ├── race.js │ │ │ │ └── rel.js │ │ └── qs │ │ │ ├── .gitmodules │ │ │ ├── .npmignore │ │ │ ├── .travis.yml │ │ │ ├── History.md │ │ │ ├── Makefile │ │ │ ├── Readme.md │ │ │ ├── benchmark.js │ │ │ ├── examples.js │ │ │ ├── index.js │ │ │ ├── lib │ │ │ └── querystring.js │ │ │ ├── package.json │ │ │ └── test │ │ │ ├── mocha.opts │ │ │ ├── parse.js │ │ │ └── stringify.js │ │ ├── package.json │ │ └── testing │ │ ├── foo │ │ ├── app.js │ │ ├── package.json │ │ ├── public │ │ │ └── stylesheets │ │ │ │ └── style.css │ │ ├── routes │ │ │ └── index.js │ │ └── views │ │ │ ├── index.jade │ │ │ └── layout.jade │ │ ├── index.js │ │ ├── public │ │ └── test.txt │ │ └── views │ │ ├── page.html │ │ ├── page.jade │ │ ├── test.md │ │ └── user │ │ ├── index.jade │ │ └── list.jade ├── public │ ├── jquip.ajax.tests.js │ ├── lib │ │ ├── json2.js │ │ ├── qunit.css │ │ └── qunit.js │ └── test.html └── server.js ├── backbone.html ├── find.html ├── lib ├── console-reporter.js ├── jasmine-html.js ├── jasmine.css └── jasmine.js ├── phantom.coffee ├── runner.html ├── spec ├── accessors.js ├── base.js ├── css.js ├── data.js ├── display.js ├── dom.js ├── events.js ├── find.js ├── fragments.js ├── helpers.js └── wrap.js └── spine ├── ajax.html ├── index-jquip-closure-advanced.html ├── index-jquip.html ├── index.html ├── lib ├── MIT.LICENSE ├── ajax.js ├── jasmine.css ├── jasmine.html.js ├── jasmine.js ├── jquery.js ├── list.js ├── local.js ├── manager.js ├── relation.js ├── route.js ├── spine.js ├── tabs.js └── tmpl.js ├── manager.html ├── route.html └── specs ├── ajax.js ├── class.js ├── controller.js ├── events.js ├── manager.js ├── model.js ├── model.local.js ├── model.relation.js └── route.js /.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | obj/ 3 | .idea/ 4 | latest/ 5 | /env-vars.bat 6 | *.suo 7 | #ignore thumbnails created by windows 8 | Thumbs.db 9 | #Ignore files build by Visual Studio 10 | *.obj 11 | *.exe 12 | *.pdb 13 | *.pidb 14 | *.userprefs 15 | *.test-cache 16 | *.user 17 | *.aps 18 | *.pch 19 | *.vspscc 20 | *_i.c 21 | *_p.c 22 | *.ncb 23 | *.suo 24 | *.tlb 25 | *.tlh 26 | *.bak 27 | *.cache 28 | *.ilk 29 | *.log 30 | [Bb]in 31 | [Dd]ebug*/ 32 | *.lib 33 | *.sbr 34 | *.resharper.user 35 | obj/ 36 | [Rr]elease*/ 37 | _ReSharper*/ 38 | [Tt]est[Rr]esult* 39 | App_Data/ 40 | .DS_Store 41 | *.resharper.user 42 | *.suo 43 | *.user 44 | *.swp 45 | 46 | npm/ -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "test/lib/backbone"] 2 | path = test/lib/backbone 3 | url = git://github.com/documentcloud/backbone.git 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.8" 4 | 5 | script: phantomjs test/phantom.coffee test/runner.html 6 | -------------------------------------------------------------------------------- /build/README.md: -------------------------------------------------------------------------------- 1 | To build on Windows copy node.exe into this folder. -------------------------------------------------------------------------------- /build/build.cmd: -------------------------------------------------------------------------------- 1 | node build.js -------------------------------------------------------------------------------- /build/build.js: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env node 2 | 3 | var fs = require("fs"); 4 | var UglifyJS = require("uglify-js"); 5 | 6 | String.prototype.startsWith = function (str){ 7 | return this.indexOf(str) === 0; 8 | }; 9 | 10 | var srcDir = '../src', targetDir = '../dist', allJsMap = {}, allMinJsMap = {}; 11 | var files = fs.readdirSync(srcDir); 12 | files.forEach(function(file) { 13 | if (file.charAt(0) == ".") return; 14 | var srcPath = srcDir + '/' + file, 15 | targetPath = targetDir + '/' + file.replace('.js', '.min.js'); 16 | var js = fs.readFileSync(srcPath).toString('utf-8'); 17 | var minJs = UglifyJS.minify(js, {fromString: true}).code; 18 | console.log("writing " + file); 19 | if (file.startsWith("jquip") && !file.startsWith("jquip.q-")) 20 | { 21 | allJsMap[file] = js; 22 | allMinJsMap[file] = minJs; 23 | } 24 | fs.writeFileSync(targetPath, minJs); 25 | }); 26 | 27 | 28 | var topFile = 'jquip.js'; 29 | 30 | //write /dist/jquip.all.js 31 | var allJs = allJsMap[topFile] + ";"; 32 | for (var file in allJsMap) { 33 | if (file == topFile) continue; 34 | allJs += allJsMap[file] + ";"; 35 | } 36 | fs.writeFileSync(targetDir + '/jquip.all.js', allJs); 37 | 38 | //write /dist/jquip.all.min.js 39 | var allMinJs = allMinJsMap[topFile] + ";"; 40 | for (var file in allMinJsMap) { 41 | if (file == topFile) continue; 42 | allMinJs += allMinJsMap[file] + ";"; 43 | } 44 | fs.writeFileSync(targetDir + '/jquip.all.min.js', allMinJs); 45 | -------------------------------------------------------------------------------- /build/node_modules/.bin/uglifyjs: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | basedir=`dirname "$0"` 3 | 4 | case `uname` in 5 | *CYGWIN*) basedir=`cygpath -w "$basedir"`;; 6 | esac 7 | 8 | if [ -x "$basedir/node" ]; then 9 | "$basedir/node" "$basedir/../uglify-js/bin/uglifyjs" "$@" 10 | ret=$? 11 | else 12 | node "$basedir/../uglify-js/bin/uglifyjs" "$@" 13 | ret=$? 14 | fi 15 | exit $ret 16 | -------------------------------------------------------------------------------- /build/node_modules/.bin/uglifyjs.cmd: -------------------------------------------------------------------------------- 1 | @IF EXIST "%~dp0\node.exe" ( 2 | "%~dp0\node.exe" "%~dp0\..\uglify-js\bin\uglifyjs" %* 3 | ) ELSE ( 4 | node "%~dp0\..\uglify-js\bin\uglifyjs" %* 5 | ) -------------------------------------------------------------------------------- /build/node_modules/uglify-js/.npmignore: -------------------------------------------------------------------------------- 1 | tmp/ 2 | node_modules/ 3 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.4" 4 | - "0.8" 5 | - "0.10" 6 | - "0.11" 7 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/LICENSE: -------------------------------------------------------------------------------- 1 | UglifyJS is released under the BSD license: 2 | 3 | Copyright 2012-2013 (c) Mihai Bazon 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions 7 | are met: 8 | 9 | * Redistributions of source code must retain the above 10 | copyright notice, this list of conditions and the following 11 | disclaimer. 12 | 13 | * Redistributions in binary form must reproduce the above 14 | copyright notice, this list of conditions and the following 15 | disclaimer in the documentation and/or other materials 16 | provided with the distribution. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE 22 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 23 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 25 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 27 | TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 28 | THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 | SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/async/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010 Caolan McMahon 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/async/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "async", 3 | "repo": "caolan/async", 4 | "description": "Higher-order functions and common patterns for asynchronous code", 5 | "version": "0.1.23", 6 | "keywords": [], 7 | "dependencies": {}, 8 | "development": {}, 9 | "main": "lib/async.js", 10 | "scripts": [ "lib/async.js" ] 11 | } 12 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/optimist/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.8" 4 | - "0.10" 5 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/optimist/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2010 James Halliday (mail@substack.net) 2 | 3 | This project is free software released under the MIT/X11 license: 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/optimist/example/bool.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var util = require('util'); 3 | var argv = require('optimist').argv; 4 | 5 | if (argv.s) { 6 | util.print(argv.fr ? 'Le chat dit: ' : 'The cat says: '); 7 | } 8 | console.log( 9 | (argv.fr ? 'miaou' : 'meow') + (argv.p ? '.' : '') 10 | ); 11 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/optimist/example/boolean_double.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var argv = require('optimist') 3 | .boolean(['x','y','z']) 4 | .argv 5 | ; 6 | console.dir([ argv.x, argv.y, argv.z ]); 7 | console.dir(argv._); 8 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/optimist/example/boolean_single.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var argv = require('optimist') 3 | .boolean('v') 4 | .argv 5 | ; 6 | console.dir(argv.v); 7 | console.dir(argv._); 8 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/optimist/example/default_hash.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var argv = require('optimist') 4 | .default({ x : 10, y : 10 }) 5 | .argv 6 | ; 7 | 8 | console.log(argv.x + argv.y); 9 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/optimist/example/default_singles.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var argv = require('optimist') 3 | .default('x', 10) 4 | .default('y', 10) 5 | .argv 6 | ; 7 | console.log(argv.x + argv.y); 8 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/optimist/example/divide.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var argv = require('optimist') 4 | .usage('Usage: $0 -x [num] -y [num]') 5 | .demand(['x','y']) 6 | .argv; 7 | 8 | console.log(argv.x / argv.y); 9 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/optimist/example/line_count.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var argv = require('optimist') 3 | .usage('Count the lines in a file.\nUsage: $0') 4 | .demand('f') 5 | .alias('f', 'file') 6 | .describe('f', 'Load a file') 7 | .argv 8 | ; 9 | 10 | var fs = require('fs'); 11 | var s = fs.createReadStream(argv.file); 12 | 13 | var lines = 0; 14 | s.on('data', function (buf) { 15 | lines += buf.toString().match(/\n/g).length; 16 | }); 17 | 18 | s.on('end', function () { 19 | console.log(lines); 20 | }); 21 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/optimist/example/line_count_options.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var argv = require('optimist') 3 | .usage('Count the lines in a file.\nUsage: $0') 4 | .options({ 5 | file : { 6 | demand : true, 7 | alias : 'f', 8 | description : 'Load a file' 9 | }, 10 | base : { 11 | alias : 'b', 12 | description : 'Numeric base to use for output', 13 | default : 10, 14 | }, 15 | }) 16 | .argv 17 | ; 18 | 19 | var fs = require('fs'); 20 | var s = fs.createReadStream(argv.file); 21 | 22 | var lines = 0; 23 | s.on('data', function (buf) { 24 | lines += buf.toString().match(/\n/g).length; 25 | }); 26 | 27 | s.on('end', function () { 28 | console.log(lines.toString(argv.base)); 29 | }); 30 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/optimist/example/line_count_wrap.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var argv = require('optimist') 3 | .usage('Count the lines in a file.\nUsage: $0') 4 | .wrap(80) 5 | .demand('f') 6 | .alias('f', [ 'file', 'filename' ]) 7 | .describe('f', 8 | "Load a file. It's pretty important." 9 | + " Required even. So you'd better specify it." 10 | ) 11 | .alias('b', 'base') 12 | .describe('b', 'Numeric base to display the number of lines in') 13 | .default('b', 10) 14 | .describe('x', 'Super-secret optional parameter which is secret') 15 | .default('x', '') 16 | .argv 17 | ; 18 | 19 | var fs = require('fs'); 20 | var s = fs.createReadStream(argv.file); 21 | 22 | var lines = 0; 23 | s.on('data', function (buf) { 24 | lines += buf.toString().match(/\n/g).length; 25 | }); 26 | 27 | s.on('end', function () { 28 | console.log(lines.toString(argv.base)); 29 | }); 30 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/optimist/example/nonopt.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var argv = require('optimist').argv; 3 | console.log('(%d,%d)', argv.x, argv.y); 4 | console.log(argv._); 5 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/optimist/example/reflect.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | console.dir(require('optimist').argv); 3 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/optimist/example/short.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var argv = require('optimist').argv; 3 | console.log('(%d,%d)', argv.x, argv.y); 4 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/optimist/example/string.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var argv = require('optimist') 3 | .string('x', 'y') 4 | .argv 5 | ; 6 | console.dir([ argv.x, argv.y ]); 7 | 8 | /* Turns off numeric coercion: 9 | ./node string.js -x 000123 -y 9876 10 | [ '000123', '9876' ] 11 | */ 12 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/optimist/example/usage-options.js: -------------------------------------------------------------------------------- 1 | var optimist = require('./../index'); 2 | 3 | var argv = optimist.usage('This is my awesome program', { 4 | 'about': { 5 | description: 'Provide some details about the author of this program', 6 | required: true, 7 | short: 'a', 8 | }, 9 | 'info': { 10 | description: 'Provide some information about the node.js agains!!!!!!', 11 | boolean: true, 12 | short: 'i' 13 | } 14 | }).argv; 15 | 16 | optimist.showHelp(); 17 | 18 | console.log('\n\nInspecting options'); 19 | console.dir(argv); -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/optimist/example/xup.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var argv = require('optimist').argv; 3 | 4 | if (argv.rif - 5 * argv.xup > 7.138) { 5 | console.log('Buy more riffiwobbles'); 6 | } 7 | else { 8 | console.log('Sell the xupptumblers'); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/README.markdown: -------------------------------------------------------------------------------- 1 | wordwrap 2 | ======== 3 | 4 | Wrap your words. 5 | 6 | example 7 | ======= 8 | 9 | made out of meat 10 | ---------------- 11 | 12 | meat.js 13 | 14 | var wrap = require('wordwrap')(15); 15 | console.log(wrap('You and your whole family are made out of meat.')); 16 | 17 | output: 18 | 19 | You and your 20 | whole family 21 | are made out 22 | of meat. 23 | 24 | centered 25 | -------- 26 | 27 | center.js 28 | 29 | var wrap = require('wordwrap')(20, 60); 30 | console.log(wrap( 31 | 'At long last the struggle and tumult was over.' 32 | + ' The machines had finally cast off their oppressors' 33 | + ' and were finally free to roam the cosmos.' 34 | + '\n' 35 | + 'Free of purpose, free of obligation.' 36 | + ' Just drifting through emptiness.' 37 | + ' The sun was just another point of light.' 38 | )); 39 | 40 | output: 41 | 42 | At long last the struggle and tumult 43 | was over. The machines had finally cast 44 | off their oppressors and were finally 45 | free to roam the cosmos. 46 | Free of purpose, free of obligation. 47 | Just drifting through emptiness. The 48 | sun was just another point of light. 49 | 50 | methods 51 | ======= 52 | 53 | var wrap = require('wordwrap'); 54 | 55 | wrap(stop), wrap(start, stop, params={mode:"soft"}) 56 | --------------------------------------------------- 57 | 58 | Returns a function that takes a string and returns a new string. 59 | 60 | Pad out lines with spaces out to column `start` and then wrap until column 61 | `stop`. If a word is longer than `stop - start` characters it will overflow. 62 | 63 | In "soft" mode, split chunks by `/(\S+\s+/` and don't break up chunks which are 64 | longer than `stop - start`, in "hard" mode, split chunks with `/\b/` and break 65 | up chunks longer than `stop - start`. 66 | 67 | wrap.hard(start, stop) 68 | ---------------------- 69 | 70 | Like `wrap()` but with `params.mode = "hard"`. 71 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/example/center.js: -------------------------------------------------------------------------------- 1 | var wrap = require('wordwrap')(20, 60); 2 | console.log(wrap( 3 | 'At long last the struggle and tumult was over.' 4 | + ' The machines had finally cast off their oppressors' 5 | + ' and were finally free to roam the cosmos.' 6 | + '\n' 7 | + 'Free of purpose, free of obligation.' 8 | + ' Just drifting through emptiness.' 9 | + ' The sun was just another point of light.' 10 | )); 11 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/example/meat.js: -------------------------------------------------------------------------------- 1 | var wrap = require('wordwrap')(15); 2 | 3 | console.log(wrap('You and your whole family are made out of meat.')); 4 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/test/break.js: -------------------------------------------------------------------------------- 1 | var assert = require('assert'); 2 | var wordwrap = require('../'); 3 | 4 | exports.hard = function () { 5 | var s = 'Assert from {"type":"equal","ok":false,"found":1,"wanted":2,' 6 | + '"stack":[],"id":"b7ddcd4c409de8799542a74d1a04689b",' 7 | + '"browser":"chrome/6.0"}' 8 | ; 9 | var s_ = wordwrap.hard(80)(s); 10 | 11 | var lines = s_.split('\n'); 12 | assert.equal(lines.length, 2); 13 | assert.ok(lines[0].length < 80); 14 | assert.ok(lines[1].length < 80); 15 | 16 | assert.equal(s, s_.replace(/\n/g, '')); 17 | }; 18 | 19 | exports.break = function () { 20 | var s = new Array(55+1).join('a'); 21 | var s_ = wordwrap.hard(20)(s); 22 | 23 | var lines = s_.split('\n'); 24 | assert.equal(lines.length, 3); 25 | assert.ok(lines[0].length === 20); 26 | assert.ok(lines[1].length === 20); 27 | assert.ok(lines[2].length === 15); 28 | 29 | assert.equal(s, s_.replace(/\n/g, '')); 30 | }; 31 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/test/wrap.js: -------------------------------------------------------------------------------- 1 | var assert = require('assert'); 2 | var wordwrap = require('wordwrap'); 3 | 4 | var fs = require('fs'); 5 | var idleness = fs.readFileSync(__dirname + '/idleness.txt', 'utf8'); 6 | 7 | exports.stop80 = function () { 8 | var lines = wordwrap(80)(idleness).split(/\n/); 9 | var words = idleness.split(/\s+/); 10 | 11 | lines.forEach(function (line) { 12 | assert.ok(line.length <= 80, 'line > 80 columns'); 13 | var chunks = line.match(/\S/) ? line.split(/\s+/) : []; 14 | assert.deepEqual(chunks, words.splice(0, chunks.length)); 15 | }); 16 | }; 17 | 18 | exports.start20stop60 = function () { 19 | var lines = wordwrap(20, 100)(idleness).split(/\n/); 20 | var words = idleness.split(/\s+/); 21 | 22 | lines.forEach(function (line) { 23 | assert.ok(line.length <= 100, 'line > 100 columns'); 24 | var chunks = line 25 | .split(/\s+/) 26 | .filter(function (x) { return x.match(/\S/) }) 27 | ; 28 | assert.deepEqual(chunks, words.splice(0, chunks.length)); 29 | assert.deepEqual(line.slice(0, 20), new Array(20 + 1).join(' ')); 30 | }); 31 | }; 32 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/optimist/test/_.js: -------------------------------------------------------------------------------- 1 | var spawn = require('child_process').spawn; 2 | var test = require('tap').test; 3 | 4 | test('dotSlashEmpty', testCmd('./bin.js', [])); 5 | 6 | test('dotSlashArgs', testCmd('./bin.js', [ 'a', 'b', 'c' ])); 7 | 8 | test('nodeEmpty', testCmd('node bin.js', [])); 9 | 10 | test('nodeArgs', testCmd('node bin.js', [ 'x', 'y', 'z' ])); 11 | 12 | test('whichNodeEmpty', function (t) { 13 | var which = spawn('which', ['node']); 14 | 15 | which.stdout.on('data', function (buf) { 16 | t.test( 17 | testCmd(buf.toString().trim() + ' bin.js', []) 18 | ); 19 | t.end(); 20 | }); 21 | 22 | which.stderr.on('data', function (err) { 23 | assert.error(err); 24 | t.end(); 25 | }); 26 | }); 27 | 28 | test('whichNodeArgs', function (t) { 29 | var which = spawn('which', ['node']); 30 | 31 | which.stdout.on('data', function (buf) { 32 | t.test( 33 | testCmd(buf.toString().trim() + ' bin.js', [ 'q', 'r' ]) 34 | ); 35 | t.end(); 36 | }); 37 | 38 | which.stderr.on('data', function (err) { 39 | t.error(err); 40 | t.end(); 41 | }); 42 | }); 43 | 44 | function testCmd (cmd, args) { 45 | 46 | return function (t) { 47 | var to = setTimeout(function () { 48 | assert.fail('Never got stdout data.') 49 | }, 5000); 50 | 51 | var oldDir = process.cwd(); 52 | process.chdir(__dirname + '/_'); 53 | 54 | var cmds = cmd.split(' '); 55 | 56 | var bin = spawn(cmds[0], cmds.slice(1).concat(args.map(String))); 57 | process.chdir(oldDir); 58 | 59 | bin.stderr.on('data', function (err) { 60 | t.error(err); 61 | t.end(); 62 | }); 63 | 64 | bin.stdout.on('data', function (buf) { 65 | clearTimeout(to); 66 | var _ = JSON.parse(buf.toString()); 67 | t.same(_.map(String), args.map(String)); 68 | t.end(); 69 | }); 70 | }; 71 | } 72 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/optimist/test/_/argv.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | console.log(JSON.stringify(process.argv)); 3 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/optimist/test/_/bin.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var argv = require('../../index').argv 3 | console.log(JSON.stringify(argv._)); 4 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/source-map/.npmignore: -------------------------------------------------------------------------------- 1 | dist/* 2 | node_modules/* 3 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/source-map/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.8 4 | - "0.10" -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/source-map/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) 2009-2011, Mozilla Foundation and contributors 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | * Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | * Neither the names of the Mozilla Foundation nor the names of project 16 | contributors may be used to endorse or promote products derived from this 17 | software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 23 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/source-map/build/assert-shim.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | define('test/source-map/assert', ['exports'], function (exports) { 8 | 9 | let do_throw = function (msg) { 10 | throw new Error(msg); 11 | }; 12 | 13 | exports.init = function (throw_fn) { 14 | do_throw = throw_fn; 15 | }; 16 | 17 | exports.doesNotThrow = function (fn) { 18 | try { 19 | fn(); 20 | } 21 | catch (e) { 22 | do_throw(e.message); 23 | } 24 | }; 25 | 26 | exports.equal = function (actual, expected, msg) { 27 | msg = msg || String(actual) + ' != ' + String(expected); 28 | if (actual != expected) { 29 | do_throw(msg); 30 | } 31 | }; 32 | 33 | exports.ok = function (val, msg) { 34 | msg = msg || String(val) + ' is falsey'; 35 | if (!Boolean(val)) { 36 | do_throw(msg); 37 | } 38 | }; 39 | 40 | exports.strictEqual = function (actual, expected, msg) { 41 | msg = msg || String(actual) + ' !== ' + String(expected); 42 | if (actual !== expected) { 43 | do_throw(msg); 44 | } 45 | }; 46 | 47 | exports.throws = function (fn) { 48 | try { 49 | fn(); 50 | do_throw('Expected an error to be thrown, but it wasn\'t.'); 51 | } 52 | catch (e) { 53 | } 54 | }; 55 | 56 | }); 57 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/source-map/build/prefix-source-map.jsm: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | 8 | /* 9 | * WARNING! 10 | * 11 | * Do not edit this file directly, it is built from the sources at 12 | * https://github.com/mozilla/source-map/ 13 | */ 14 | 15 | /////////////////////////////////////////////////////////////////////////////// 16 | 17 | 18 | this.EXPORTED_SYMBOLS = [ "SourceMapConsumer", "SourceMapGenerator", "SourceNode" ]; 19 | 20 | Components.utils.import('resource://gre/modules/devtools/Require.jsm'); 21 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/source-map/build/prefix-utils.jsm: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | 8 | /* 9 | * WARNING! 10 | * 11 | * Do not edit this file directly, it is built from the sources at 12 | * https://github.com/mozilla/source-map/ 13 | */ 14 | 15 | Components.utils.import('resource://gre/modules/devtools/Require.jsm'); 16 | Components.utils.import('resource://gre/modules/devtools/SourceMap.jsm'); 17 | 18 | this.EXPORTED_SYMBOLS = [ "define", "runSourceMapTests" ]; 19 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/source-map/build/suffix-browser.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /////////////////////////////////////////////////////////////////////////////// 3 | 4 | this.sourceMap = { 5 | SourceMapConsumer: require('source-map/source-map-consumer').SourceMapConsumer, 6 | SourceMapGenerator: require('source-map/source-map-generator').SourceMapGenerator, 7 | SourceNode: require('source-map/source-node').SourceNode 8 | }; 9 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/source-map/build/suffix-source-map.jsm: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /////////////////////////////////////////////////////////////////////////////// 3 | 4 | this.SourceMapConsumer = require('source-map/source-map-consumer').SourceMapConsumer; 5 | this.SourceMapGenerator = require('source-map/source-map-generator').SourceMapGenerator; 6 | this.SourceNode = require('source-map/source-node').SourceNode; 7 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/source-map/build/suffix-utils.jsm: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | function runSourceMapTests(modName, do_throw) { 8 | let mod = require(modName); 9 | let assert = require('test/source-map/assert'); 10 | let util = require('test/source-map/util'); 11 | 12 | assert.init(do_throw); 13 | 14 | for (let k in mod) { 15 | if (/^test/.test(k)) { 16 | mod[k](assert, util); 17 | } 18 | } 19 | 20 | } 21 | this.runSourceMapTests = runSourceMapTests; 22 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/source-map/build/test-prefix.js: -------------------------------------------------------------------------------- 1 | /* 2 | * WARNING! 3 | * 4 | * Do not edit this file directly, it is built from the sources at 5 | * https://github.com/mozilla/source-map/ 6 | */ 7 | 8 | Components.utils.import('resource://test/Utils.jsm'); 9 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/source-map/build/test-suffix.js: -------------------------------------------------------------------------------- 1 | function run_test() { 2 | runSourceMapTests('{THIS_MODULE}', do_throw); 3 | } 4 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/source-map/lib/source-map.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009-2011 Mozilla Foundation and contributors 3 | * Licensed under the New BSD license. See LICENSE.txt or: 4 | * http://opensource.org/licenses/BSD-3-Clause 5 | */ 6 | exports.SourceMapGenerator = require('./source-map/source-map-generator').SourceMapGenerator; 7 | exports.SourceMapConsumer = require('./source-map/source-map-consumer').SourceMapConsumer; 8 | exports.SourceNode = require('./source-map/source-node').SourceNode; 9 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/source-map/lib/source-map/base64.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | if (typeof define !== 'function') { 8 | var define = require('amdefine')(module, require); 9 | } 10 | define(function (require, exports, module) { 11 | 12 | var charToIntMap = {}; 13 | var intToCharMap = {}; 14 | 15 | 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' 16 | .split('') 17 | .forEach(function (ch, index) { 18 | charToIntMap[ch] = index; 19 | intToCharMap[index] = ch; 20 | }); 21 | 22 | /** 23 | * Encode an integer in the range of 0 to 63 to a single base 64 digit. 24 | */ 25 | exports.encode = function base64_encode(aNumber) { 26 | if (aNumber in intToCharMap) { 27 | return intToCharMap[aNumber]; 28 | } 29 | throw new TypeError("Must be between 0 and 63: " + aNumber); 30 | }; 31 | 32 | /** 33 | * Decode a single base 64 digit to an integer. 34 | */ 35 | exports.decode = function base64_decode(aChar) { 36 | if (aChar in charToIntMap) { 37 | return charToIntMap[aChar]; 38 | } 39 | throw new TypeError("Not a valid base 64 digit: " + aChar); 40 | }; 41 | 42 | }); 43 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/intercept.js: -------------------------------------------------------------------------------- 1 | /*jshint node: true */ 2 | var inserted, 3 | Module = require('module'), 4 | fs = require('fs'), 5 | existingExtFn = Module._extensions['.js'], 6 | amdefineRegExp = /amdefine\.js/; 7 | 8 | inserted = "if (typeof define !== 'function') {var define = require('amdefine')(module)}"; 9 | 10 | //From the node/lib/module.js source: 11 | function stripBOM(content) { 12 | // Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) 13 | // because the buffer-to-string conversion in `fs.readFileSync()` 14 | // translates it to FEFF, the UTF-16 BOM. 15 | if (content.charCodeAt(0) === 0xFEFF) { 16 | content = content.slice(1); 17 | } 18 | return content; 19 | } 20 | 21 | //Also adapted from the node/lib/module.js source: 22 | function intercept(module, filename) { 23 | var content = stripBOM(fs.readFileSync(filename, 'utf8')); 24 | 25 | if (!amdefineRegExp.test(module.id)) { 26 | content = inserted + content; 27 | } 28 | 29 | module._compile(content, filename); 30 | } 31 | 32 | intercept._id = 'amdefine/intercept'; 33 | 34 | if (!existingExtFn._id || existingExtFn._id !== intercept._id) { 35 | Module._extensions['.js'] = intercept; 36 | } 37 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/source-map/test/run-tests.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | /* -*- Mode: js; js-indent-level: 2; -*- */ 3 | /* 4 | * Copyright 2011 Mozilla Foundation and contributors 5 | * Licensed under the New BSD license. See LICENSE or: 6 | * http://opensource.org/licenses/BSD-3-Clause 7 | */ 8 | var assert = require('assert'); 9 | var fs = require('fs'); 10 | var path = require('path'); 11 | var util = require('./source-map/util'); 12 | 13 | function run(tests) { 14 | var total = 0; 15 | var passed = 0; 16 | 17 | for (var i = 0; i < tests.length; i++) { 18 | for (var k in tests[i].testCase) { 19 | if (/^test/.test(k)) { 20 | total++; 21 | try { 22 | tests[i].testCase[k](assert, util); 23 | passed++; 24 | } 25 | catch (e) { 26 | console.log('FAILED ' + tests[i].name + ': ' + k + '!'); 27 | console.log(e.stack); 28 | } 29 | } 30 | } 31 | } 32 | 33 | console.log(''); 34 | console.log(passed + ' / ' + total + ' tests passed.'); 35 | console.log(''); 36 | 37 | return total - passed; 38 | } 39 | 40 | function isTestFile(f) { 41 | var testToRun = process.argv[2]; 42 | return testToRun 43 | ? path.basename(testToRun) === f 44 | : /^test\-.*?\.js/.test(f); 45 | } 46 | 47 | function toModule(f) { 48 | return './source-map/' + f.replace(/\.js$/, ''); 49 | } 50 | 51 | var requires = fs.readdirSync(path.join(__dirname, 'source-map')) 52 | .filter(isTestFile) 53 | .map(toModule); 54 | 55 | var code = run(requires.map(require).map(function (mod, i) { 56 | return { 57 | name: requires[i], 58 | testCase: mod 59 | }; 60 | })); 61 | 62 | process.exit(code); 63 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/source-map/test/source-map/test-api.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2012 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | if (typeof define !== 'function') { 8 | var define = require('amdefine')(module, require); 9 | } 10 | define(function (require, exports, module) { 11 | 12 | var sourceMap; 13 | try { 14 | sourceMap = require('../../lib/source-map'); 15 | } catch (e) { 16 | sourceMap = {}; 17 | Components.utils.import('resource:///modules/devtools/SourceMap.jsm', sourceMap); 18 | } 19 | 20 | exports['test that the api is properly exposed in the top level'] = function (assert, util) { 21 | assert.equal(typeof sourceMap.SourceMapGenerator, "function"); 22 | assert.equal(typeof sourceMap.SourceMapConsumer, "function"); 23 | assert.equal(typeof sourceMap.SourceNode, "function"); 24 | }; 25 | 26 | }); 27 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/source-map/test/source-map/test-base64-vlq.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | if (typeof define !== 'function') { 8 | var define = require('amdefine')(module, require); 9 | } 10 | define(function (require, exports, module) { 11 | 12 | var base64VLQ = require('../../lib/source-map/base64-vlq'); 13 | 14 | exports['test normal encoding and decoding'] = function (assert, util) { 15 | var result; 16 | for (var i = -255; i < 256; i++) { 17 | result = base64VLQ.decode(base64VLQ.encode(i)); 18 | assert.ok(result); 19 | assert.equal(result.value, i); 20 | assert.equal(result.rest, ""); 21 | } 22 | }; 23 | 24 | }); 25 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/source-map/test/source-map/test-base64.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | if (typeof define !== 'function') { 8 | var define = require('amdefine')(module, require); 9 | } 10 | define(function (require, exports, module) { 11 | 12 | var base64 = require('../../lib/source-map/base64'); 13 | 14 | exports['test out of range encoding'] = function (assert, util) { 15 | assert.throws(function () { 16 | base64.encode(-1); 17 | }); 18 | assert.throws(function () { 19 | base64.encode(64); 20 | }); 21 | }; 22 | 23 | exports['test out of range decoding'] = function (assert, util) { 24 | assert.throws(function () { 25 | base64.decode('='); 26 | }); 27 | }; 28 | 29 | exports['test normal encoding and decoding'] = function (assert, util) { 30 | for (var i = 0; i < 64; i++) { 31 | assert.equal(base64.decode(base64.encode(i)), i); 32 | } 33 | }; 34 | 35 | }); 36 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/source-map/test/source-map/test-binary-search.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: js; js-indent-level: 2; -*- */ 2 | /* 3 | * Copyright 2011 Mozilla Foundation and contributors 4 | * Licensed under the New BSD license. See LICENSE or: 5 | * http://opensource.org/licenses/BSD-3-Clause 6 | */ 7 | if (typeof define !== 'function') { 8 | var define = require('amdefine')(module, require); 9 | } 10 | define(function (require, exports, module) { 11 | 12 | var binarySearch = require('../../lib/source-map/binary-search'); 13 | 14 | function numberCompare(a, b) { 15 | return a - b; 16 | } 17 | 18 | exports['test too high'] = function (assert, util) { 19 | var needle = 30; 20 | var haystack = [2,4,6,8,10,12,14,16,18,20]; 21 | 22 | assert.doesNotThrow(function () { 23 | binarySearch.search(needle, haystack, numberCompare); 24 | }); 25 | 26 | assert.equal(binarySearch.search(needle, haystack, numberCompare), 20); 27 | }; 28 | 29 | exports['test too low'] = function (assert, util) { 30 | var needle = 1; 31 | var haystack = [2,4,6,8,10,12,14,16,18,20]; 32 | 33 | assert.doesNotThrow(function () { 34 | binarySearch.search(needle, haystack, numberCompare); 35 | }); 36 | 37 | assert.equal(binarySearch.search(needle, haystack, numberCompare), null); 38 | }; 39 | 40 | exports['test exact search'] = function (assert, util) { 41 | var needle = 4; 42 | var haystack = [2,4,6,8,10,12,14,16,18,20]; 43 | 44 | assert.equal(binarySearch.search(needle, haystack, numberCompare), 4); 45 | }; 46 | 47 | exports['test fuzzy search'] = function (assert, util) { 48 | var needle = 19; 49 | var haystack = [2,4,6,8,10,12,14,16,18,20]; 50 | 51 | assert.equal(binarySearch.search(needle, haystack, numberCompare), 18); 52 | }; 53 | 54 | }); 55 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/uglify-to-browserify/.npmignore: -------------------------------------------------------------------------------- 1 | lib-cov 2 | *.seed 3 | *.log 4 | *.csv 5 | *.dat 6 | *.out 7 | *.pid 8 | *.gz 9 | pids 10 | logs 11 | results 12 | npm-debug.log 13 | node_modules 14 | /test/output.js 15 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/uglify-to-browserify/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.10" -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/uglify-to-browserify/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Forbes Lindesay 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/uglify-to-browserify/README.md: -------------------------------------------------------------------------------- 1 | # uglify-to-browserify 2 | 3 | A transform to make UglifyJS work in browserify. 4 | 5 | [![Build Status](https://travis-ci.org/ForbesLindesay/uglify-to-browserify.png?branch=master)](https://travis-ci.org/ForbesLindesay/uglify-to-browserify) 6 | [![Dependency Status](https://gemnasium.com/ForbesLindesay/uglify-to-browserify.png)](https://gemnasium.com/ForbesLindesay/uglify-to-browserify) 7 | [![NPM version](https://badge.fury.io/js/uglify-to-browserify.png)](http://badge.fury.io/js/uglify-to-browserify) 8 | 9 | ## Installation 10 | 11 | npm install uglify-to-browserify 12 | 13 | ## License 14 | 15 | MIT -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/uglify-to-browserify/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var fs = require('fs') 4 | var PassThrough = require('stream').PassThrough 5 | var Transform = require('stream').Transform 6 | 7 | if (typeof Transform === 'undefined') { 8 | throw new Error('UglifyJS only supports browserify when using node >= 0.10.x') 9 | } 10 | 11 | var cache = {} 12 | module.exports = transform 13 | function transform(file) { 14 | if (!/tools\/node\.js$/.test(file.replace(/\\/g,'/'))) return new PassThrough(); 15 | if (cache[file]) return makeStream(cache[file]) 16 | var uglify = require(file) 17 | var src = 'var sys = require("util");\nvar MOZ_SourceMap = require("source-map");\nvar UglifyJS = exports;\n' + uglify.FILES.map(function (path) { return fs.readFileSync(path, 'utf8') }).join('\n') 18 | 19 | var ast = uglify.parse(src) 20 | ast.figure_out_scope() 21 | 22 | var variables = ast.variables 23 | .map(function (node, name) { 24 | return name 25 | }) 26 | 27 | src += '\n\n' + variables.map(function (v) { return 'exports.' + v + ' = ' + v + ';' }).join('\n') + '\n\n' 28 | 29 | src += 'exports.AST_Node.warn_function = function (txt) { if (typeof console != "undefined" && typeof console.warn === "function") console.warn(txt) }\n\n' 30 | 31 | src += 'exports.minify = ' + uglify.minify.toString() + ';\n\n' 32 | src += 'exports.describe_ast = ' + uglify.describe_ast.toString() + ';' 33 | 34 | // TODO: remove once https://github.com/substack/node-browserify/issues/631 is resolved 35 | src = src.replace(/"for"/g, '"fo" + "r"') 36 | 37 | cache[file] = src 38 | return makeStream(src); 39 | } 40 | 41 | function makeStream(src) { 42 | var res = new Transform(); 43 | res._transform = function (chunk, encoding, callback) { callback() } 44 | res._flush = function (callback) { 45 | res.push(src) 46 | callback() 47 | } 48 | return res; 49 | } 50 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/uglify-to-browserify/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "uglify-to-browserify", 3 | "version": "1.0.2", 4 | "description": "A transform to make UglifyJS work in browserify.", 5 | "keywords": [], 6 | "dependencies": {}, 7 | "devDependencies": { 8 | "uglify-js": "~2.4.0", 9 | "source-map": "~0.1.27" 10 | }, 11 | "scripts": { 12 | "test": "node test/index.js" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "https://github.com/ForbesLindesay/uglify-to-browserify.git" 17 | }, 18 | "author": { 19 | "name": "ForbesLindesay" 20 | }, 21 | "license": "MIT", 22 | "readme": "# uglify-to-browserify\r\n\r\nA transform to make UglifyJS work in browserify.\r\n\r\n[![Build Status](https://travis-ci.org/ForbesLindesay/uglify-to-browserify.png?branch=master)](https://travis-ci.org/ForbesLindesay/uglify-to-browserify)\r\n[![Dependency Status](https://gemnasium.com/ForbesLindesay/uglify-to-browserify.png)](https://gemnasium.com/ForbesLindesay/uglify-to-browserify)\r\n[![NPM version](https://badge.fury.io/js/uglify-to-browserify.png)](http://badge.fury.io/js/uglify-to-browserify)\r\n\r\n## Installation\r\n\r\n npm install uglify-to-browserify\r\n\r\n## License\r\n\r\n MIT", 23 | "readmeFilename": "README.md", 24 | "bugs": { 25 | "url": "https://github.com/ForbesLindesay/uglify-to-browserify/issues" 26 | }, 27 | "homepage": "https://github.com/ForbesLindesay/uglify-to-browserify", 28 | "_id": "uglify-to-browserify@1.0.2", 29 | "dist": { 30 | "shasum": "8b5ba615bab328cb453861920b22fb1ab42d0f2e" 31 | }, 32 | "_from": "uglify-to-browserify@~1.0.0", 33 | "_resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz" 34 | } 35 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/node_modules/uglify-to-browserify/test/index.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs') 2 | var br = require('../') 3 | var test = fs.readFileSync(require.resolve('uglify-js/test/run-tests.js'), 'utf8') 4 | .replace(/^#.*\n/, '') 5 | 6 | var transform = br(require.resolve('uglify-js')) 7 | transform.pipe(fs.createWriteStream(__dirname + '/output.js')) 8 | .on('close', function () { 9 | Function('module,require', test)({ 10 | filename: require.resolve('uglify-js/test/run-tests.js') 11 | }, 12 | function (name) { 13 | if (name === '../tools/node') { 14 | return require('./output.js') 15 | } else if (/^[a-z]+$/.test(name)) { 16 | return require(name) 17 | } else { 18 | throw new Error('I didn\'t expect you to require ' + name) 19 | } 20 | }) 21 | }) 22 | transform.end(fs.readFileSync(require.resolve('uglify-js'), 'utf8')) -------------------------------------------------------------------------------- /build/node_modules/uglify-js/test/compress/blocks.js: -------------------------------------------------------------------------------- 1 | remove_blocks: { 2 | input: { 3 | {;} 4 | foo(); 5 | {}; 6 | { 7 | {}; 8 | }; 9 | bar(); 10 | {} 11 | } 12 | expect: { 13 | foo(); 14 | bar(); 15 | } 16 | } 17 | 18 | keep_some_blocks: { 19 | input: { 20 | // 1. 21 | if (foo) { 22 | {{{}}} 23 | if (bar) { baz(); } 24 | {{}} 25 | } else { 26 | stuff(); 27 | } 28 | 29 | // 2. 30 | if (foo) { 31 | for (var i = 0; i < 5; ++i) 32 | if (bar) baz(); 33 | } else { 34 | stuff(); 35 | } 36 | } 37 | expect: { 38 | // 1. 39 | if (foo) { 40 | if (bar) baz(); 41 | } else stuff(); 42 | 43 | // 2. 44 | if (foo) { 45 | for (var i = 0; i < 5; ++i) 46 | if (bar) baz(); 47 | } else stuff(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/test/compress/concat-strings.js: -------------------------------------------------------------------------------- 1 | concat_1: { 2 | options = { 3 | evaluate: true 4 | }; 5 | input: { 6 | var a = "foo" + "bar" + x() + "moo" + "foo" + y() + "x" + "y" + "z" + q(); 7 | var b = "foo" + 1 + x() + 2 + "boo"; 8 | var c = 1 + x() + 2 + "boo"; 9 | 10 | // this CAN'T safely be shortened to 1 + x() + "5boo" 11 | var d = 1 + x() + 2 + 3 + "boo"; 12 | 13 | var e = 1 + x() + 2 + "X" + 3 + "boo"; 14 | } 15 | expect: { 16 | var a = "foobar" + x() + "moofoo" + y() + "xyz" + q(); 17 | var b = "foo1" + x() + "2boo"; 18 | var c = 1 + x() + 2 + "boo"; 19 | var d = 1 + x() + 2 + 3 + "boo"; 20 | var e = 1 + x() + 2 + "X3boo"; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/test/compress/debugger.js: -------------------------------------------------------------------------------- 1 | keep_debugger: { 2 | options = { 3 | drop_debugger: false 4 | }; 5 | input: { 6 | debugger; 7 | } 8 | expect: { 9 | debugger; 10 | } 11 | } 12 | 13 | drop_debugger: { 14 | options = { 15 | drop_debugger: true 16 | }; 17 | input: { 18 | debugger; 19 | if (foo) debugger; 20 | } 21 | expect: { 22 | if (foo); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/test/compress/issue-105.js: -------------------------------------------------------------------------------- 1 | typeof_eq_undefined: { 2 | options = { 3 | comparisons: true 4 | }; 5 | input: { a = typeof b.c != "undefined" } 6 | expect: { a = "undefined" != typeof b.c } 7 | } 8 | 9 | typeof_eq_undefined_unsafe: { 10 | options = { 11 | comparisons: true, 12 | unsafe: true 13 | }; 14 | input: { a = typeof b.c != "undefined" } 15 | expect: { a = void 0 !== b.c } 16 | } 17 | 18 | typeof_eq_undefined_unsafe2: { 19 | options = { 20 | comparisons: true, 21 | unsafe: true 22 | }; 23 | input: { a = "undefined" != typeof b.c } 24 | expect: { a = void 0 !== b.c } 25 | } 26 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/test/compress/issue-12.js: -------------------------------------------------------------------------------- 1 | keep_name_of_getter: { 2 | options = { unused: true }; 3 | input: { a = { get foo () {} } } 4 | expect: { a = { get foo () {} } } 5 | } 6 | 7 | keep_name_of_setter: { 8 | options = { unused: true }; 9 | input: { a = { set foo () {} } } 10 | expect: { a = { set foo () {} } } 11 | } 12 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/test/compress/issue-126.js: -------------------------------------------------------------------------------- 1 | concatenate_rhs_strings: { 2 | options = { 3 | evaluate: true, 4 | unsafe: true, 5 | } 6 | input: { 7 | foo(bar() + 123 + "Hello" + "World"); 8 | foo(bar() + (123 + "Hello") + "World"); 9 | foo((bar() + 123) + "Hello" + "World"); 10 | foo(bar() + 123 + "Hello" + "World" + ("Foo" + "Bar")); 11 | foo("Foo" + "Bar" + bar() + 123 + "Hello" + "World" + ("Foo" + "Bar")); 12 | foo("Hello" + bar() + 123 + "World"); 13 | foo(bar() + 'Foo' + (10 + parseInt('10'))); 14 | } 15 | expect: { 16 | foo(bar() + 123 + "HelloWorld"); 17 | foo(bar() + "123HelloWorld"); 18 | foo((bar() + 123) + "HelloWorld"); 19 | foo(bar() + 123 + "HelloWorldFooBar"); 20 | foo("FooBar" + bar() + "123HelloWorldFooBar"); 21 | foo("Hello" + bar() + "123World"); 22 | foo(bar() + 'Foo' + (10 + parseInt('10'))); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/test/compress/issue-143.js: -------------------------------------------------------------------------------- 1 | /** 2 | * There was an incorrect sort behaviour documented in issue #143: 3 | * (x = f(…)) <= x → x >= (x = f(…)) 4 | * 5 | * For example, let the equation be: 6 | * (a = parseInt('100')) <= a 7 | * 8 | * If a was an integer and has the value of 99, 9 | * (a = parseInt('100')) <= a → 100 <= 100 → true 10 | * 11 | * When transformed incorrectly: 12 | * a >= (a = parseInt('100')) → 99 >= 100 → false 13 | */ 14 | 15 | tranformation_sort_order_equal: { 16 | options = { 17 | comparisons: true, 18 | }; 19 | 20 | input: { (a = parseInt('100')) == a } 21 | expect: { (a = parseInt('100')) == a } 22 | } 23 | 24 | tranformation_sort_order_unequal: { 25 | options = { 26 | comparisons: true, 27 | }; 28 | 29 | input: { (a = parseInt('100')) != a } 30 | expect: { (a = parseInt('100')) != a } 31 | } 32 | 33 | tranformation_sort_order_lesser_or_equal: { 34 | options = { 35 | comparisons: true, 36 | }; 37 | 38 | input: { (a = parseInt('100')) <= a } 39 | expect: { (a = parseInt('100')) <= a } 40 | } 41 | tranformation_sort_order_greater_or_equal: { 42 | options = { 43 | comparisons: true, 44 | }; 45 | 46 | input: { (a = parseInt('100')) >= a } 47 | expect: { (a = parseInt('100')) >= a } 48 | } -------------------------------------------------------------------------------- /build/node_modules/uglify-js/test/compress/issue-22.js: -------------------------------------------------------------------------------- 1 | return_with_no_value_in_if_body: { 2 | options = { conditionals: true }; 3 | input: { 4 | function foo(bar) { 5 | if (bar) { 6 | return; 7 | } else { 8 | return 1; 9 | } 10 | } 11 | } 12 | expect: { 13 | function foo (bar) { 14 | return bar ? void 0 : 1; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/test/compress/issue-267.js: -------------------------------------------------------------------------------- 1 | issue_267: { 2 | options = { comparisons: true }; 3 | input: { 4 | x = a % b / b * c * 2; 5 | x = a % b * 2 6 | } 7 | expect: { 8 | x = a % b / b * c * 2; 9 | x = a % b * 2; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/test/compress/issue-269.js: -------------------------------------------------------------------------------- 1 | issue_269_1: { 2 | options = {unsafe: true}; 3 | input: { 4 | f( 5 | String(x), 6 | Number(x), 7 | Boolean(x), 8 | 9 | String(), 10 | Number(), 11 | Boolean() 12 | ); 13 | } 14 | expect: { 15 | f( 16 | x + '', +x, !!x, 17 | '', 0, false 18 | ); 19 | } 20 | } 21 | 22 | issue_269_dangers: { 23 | options = {unsafe: true}; 24 | input: { 25 | f( 26 | String(x, x), 27 | Number(x, x), 28 | Boolean(x, x) 29 | ); 30 | } 31 | expect: { 32 | f(String(x, x), Number(x, x), Boolean(x, x)); 33 | } 34 | } 35 | 36 | issue_269_in_scope: { 37 | options = {unsafe: true}; 38 | input: { 39 | var String, Number, Boolean; 40 | f( 41 | String(x), 42 | Number(x, x), 43 | Boolean(x) 44 | ); 45 | } 46 | expect: { 47 | var String, Number, Boolean; 48 | f(String(x), Number(x, x), Boolean(x)); 49 | } 50 | } 51 | 52 | strings_concat: { 53 | options = {unsafe: true}; 54 | input: { 55 | f( 56 | String(x + 'str'), 57 | String('str' + x) 58 | ); 59 | } 60 | expect: { 61 | f( 62 | x + 'str', 63 | 'str' + x 64 | ); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/test/compress/issue-44.js: -------------------------------------------------------------------------------- 1 | issue_44_valid_ast_1: { 2 | options = { unused: true }; 3 | input: { 4 | function a(b) { 5 | for (var i = 0, e = b.qoo(); ; i++) {} 6 | } 7 | } 8 | expect: { 9 | function a(b) { 10 | var i = 0; 11 | for (b.qoo(); ; i++); 12 | } 13 | } 14 | } 15 | 16 | issue_44_valid_ast_2: { 17 | options = { unused: true }; 18 | input: { 19 | function a(b) { 20 | if (foo) for (var i = 0, e = b.qoo(); ; i++) {} 21 | } 22 | } 23 | expect: { 24 | function a(b) { 25 | if (foo) { 26 | var i = 0; 27 | for (b.qoo(); ; i++); 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/test/compress/issue-59.js: -------------------------------------------------------------------------------- 1 | keep_continue: { 2 | options = { 3 | dead_code: true, 4 | evaluate: true 5 | }; 6 | input: { 7 | while (a) { 8 | if (b) { 9 | switch (true) { 10 | case c(): 11 | d(); 12 | } 13 | continue; 14 | } 15 | f(); 16 | } 17 | } 18 | expect: { 19 | while (a) { 20 | if (b) { 21 | switch (true) { 22 | case c(): 23 | d(); 24 | } 25 | continue; 26 | } 27 | f(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/test/compress/negate-iife.js: -------------------------------------------------------------------------------- 1 | negate_iife_1: { 2 | options = { 3 | negate_iife: true 4 | }; 5 | input: { 6 | (function(){ stuff() })(); 7 | } 8 | expect: { 9 | !function(){ stuff() }(); 10 | } 11 | } 12 | 13 | negate_iife_2: { 14 | options = { 15 | negate_iife: true 16 | }; 17 | input: { 18 | (function(){ return {} })().x = 10; // should not transform this one 19 | } 20 | expect: { 21 | (function(){ return {} })().x = 10; 22 | } 23 | } 24 | 25 | negate_iife_3: { 26 | options = { 27 | negate_iife: true, 28 | }; 29 | input: { 30 | (function(){ return true })() ? console.log(true) : console.log(false); 31 | } 32 | expect: { 33 | !function(){ return true }() ? console.log(false) : console.log(true); 34 | } 35 | } 36 | 37 | negate_iife_3: { 38 | options = { 39 | negate_iife: true, 40 | sequences: true 41 | }; 42 | input: { 43 | (function(){ return true })() ? console.log(true) : console.log(false); 44 | (function(){ 45 | console.log("something"); 46 | })(); 47 | } 48 | expect: { 49 | !function(){ return true }() ? console.log(false) : console.log(true), function(){ 50 | console.log("something"); 51 | }(); 52 | } 53 | } 54 | 55 | negate_iife_4: { 56 | options = { 57 | negate_iife: true, 58 | sequences: true, 59 | conditionals: true, 60 | }; 61 | input: { 62 | if ((function(){ return true })()) { 63 | foo(true); 64 | } else { 65 | bar(false); 66 | } 67 | (function(){ 68 | console.log("something"); 69 | })(); 70 | } 71 | expect: { 72 | !function(){ return true }() ? bar(false) : foo(true), function(){ 73 | console.log("something"); 74 | }(); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/test/compress/properties.js: -------------------------------------------------------------------------------- 1 | keep_properties: { 2 | options = { 3 | properties: false 4 | }; 5 | input: { 6 | a["foo"] = "bar"; 7 | } 8 | expect: { 9 | a["foo"] = "bar"; 10 | } 11 | } 12 | 13 | dot_properties: { 14 | options = { 15 | properties: true 16 | }; 17 | input: { 18 | a["foo"] = "bar"; 19 | a["if"] = "if"; 20 | a["*"] = "asterisk"; 21 | a["\u0EB3"] = "unicode"; 22 | a[""] = "whitespace"; 23 | a["1_1"] = "foo"; 24 | } 25 | expect: { 26 | a.foo = "bar"; 27 | a["if"] = "if"; 28 | a["*"] = "asterisk"; 29 | a.\u0EB3 = "unicode"; 30 | a[""] = "whitespace"; 31 | a["1_1"] = "foo"; 32 | } 33 | } 34 | 35 | dot_properties_es5: { 36 | options = { 37 | properties: true, 38 | screw_ie8: true 39 | }; 40 | input: { 41 | a["foo"] = "bar"; 42 | a["if"] = "if"; 43 | a["*"] = "asterisk"; 44 | a["\u0EB3"] = "unicode"; 45 | a[""] = "whitespace"; 46 | } 47 | expect: { 48 | a.foo = "bar"; 49 | a.if = "if"; 50 | a["*"] = "asterisk"; 51 | a.\u0EB3 = "unicode"; 52 | a[""] = "whitespace"; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /build/node_modules/uglify-js/test/compress/typeof.js: -------------------------------------------------------------------------------- 1 | typeof_evaluation: { 2 | options = { 3 | evaluate: true 4 | }; 5 | input: { 6 | a = typeof 1; 7 | b = typeof 'test'; 8 | c = typeof []; 9 | d = typeof {}; 10 | e = typeof /./; 11 | f = typeof false; 12 | g = typeof function(){}; 13 | h = typeof undefined; 14 | } 15 | expect: { 16 | a='number'; 17 | b='string'; 18 | c=typeof[]; 19 | d=typeof{}; 20 | e=typeof/./; 21 | f='boolean'; 22 | g='function'; 23 | h='undefined'; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /build/npm.cmd: -------------------------------------------------------------------------------- 1 | :: Created by npm, please don't edit manually. 2 | @IF EXIST "%~dp0\node.exe" ( 3 | "%~dp0\node.exe" "%~dp0\.\node_modules\npm\bin\npm-cli.js" %* 4 | ) ELSE ( 5 | node "%~dp0\.\node_modules\npm\bin\npm-cli.js" %* 6 | ) 7 | -------------------------------------------------------------------------------- /component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquip", 3 | "version": "0.0.3", 4 | "main": "src/jquip.js" 5 | } 6 | -------------------------------------------------------------------------------- /demo.closure-advanced.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jQuip - jQuery in parts 5 | 6 | 38 | 39 | 40 | 43 | 44 |

Simple Demo

45 | 46 |
47 | 48 | 49 |
50 | 51 |
52 |
53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /dist/jquip.custom.min.js: -------------------------------------------------------------------------------- 1 | $.plug("custom",function(e){for(var n=window,t={},r=n.location.search.substring(1).split("&"),a=e.Key=function(e){this.keyCode=e},p=0;p/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},e._template=function(n,t){var r=e.templateSettings,a="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+n.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(r.escape,function(e,n){return"',_.escape("+n.replace(/\\'/g,"'")+"),'"}).replace(r.interpolate,function(e,n){return"',"+n.replace(/\\'/g,"'")+",'"}).replace(r.evaluate||null,function(e,n){return"');"+n.replace(/\\'/g,"'").replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",p=new Function("obj","$",a);return t?p(t,e):function(n){return p(n,e)}}}); -------------------------------------------------------------------------------- /dist/jquip.docready.min.js: -------------------------------------------------------------------------------- 1 | $.plug("docready",function(e){function t(){if(!c){try{r.documentElement.doScroll("left")}catch(e){return void setTimeout(t,1)}n()}}function n(t){if(t===!0&&u--,!u||t!==!0&&!c){if(!r.body)return setTimeout(o,1);if(c=!0,t!==!0&&--u>0)return;if(i){var n,d=0,o=i;for(i=null;n=o[d++];)n.call(r,e);e.fn.trigger&&e(r).trigger("ready").unbind("ready")}}}var d,o,a=window,r=document,i=[],c=!1,u=1;e.hook(function(e){return"function"==typeof e?(this.ready(e),!0):void 0}),e.ready=n,d=r.addEventListener?function(){r.removeEventListener("DOMContentLoaded",d,!1),n()}:function(){"complete"===r.readyState&&(r.detachEvent("onreadystatechange",d),n())},e.bindReady=function(){if(!o){if(o=!0,"complete"===r.readyState)return setTimeout(n,1);if(r.addEventListener)r.addEventListener("DOMContentLoaded",d,!1),a.addEventListener("load",n,!1);else if(r.attachEvent){r.attachEvent("onreadystatechange",d),a.attachEvent("onload",n);var e=!1;try{e=null==window.frameElement}catch(i){}r.documentElement.doScroll&&e&&t()}}},e.fn.ready=function(t){return e.bindReady(),c?t.call(r,e):i&&i.push(t),this},e.init||e(document).ready(e.onload)}); -------------------------------------------------------------------------------- /dist/jquip.q-min.min.js: -------------------------------------------------------------------------------- 1 | $.plug(function(t){function e(e,n){var s,i,a,f=t.$$(n)[0],g=e.split("."),h=g.shift(),o=h.indexOf("["),c=h.charAt(0);if("#"==c)return r(h.substring(1),f);o>=0&&(a=h.substring(o+1,h.length-1).split("="),s=a[0],i=2==a.length&&a[1],i&&"'"==i.charAt(0)&&(i=i.substring(1,i.length-1)),h=h.substring(0,o));var m=h.split("#");if(2==m.length){if(f=r(m[1],f),!f)return[];if(!t.eqSI(f.tagName,m[0]))return[];if(1==g.length)return[f]}var v=h?u(h,f):l(g.shift(),f);if(!g.length&&!s)return v;for(var p=[],y=0,N=v.length;N>y;y++){var b=v[y],d=g.length,q=!0;if(g.length)for(;d--;)t.hasClass([b],g[d])||(q=!1);!q||s&&i&&b[s]!=i||p.push(b)}return p}var n=document,r=function(t,e){return(e||n).getElementById(t)},u=function(t,e){return(e||n).getElementsByTagName(t)},l=n.getElementsByClassName?function(t,e){return(e||n).getElementsByClassName(t)}:function(e,r){var u=t.walk(function(t){return t.className&&t.className.indexOf(e)>=0},r||n);return t.unique(u)};t.setQuery(function(t,r){if(n.querySelectorAll)return(r||n).querySelectorAll(t);for(var u,l=[[r||n]],s=t.split(" "),i=[],a=0,f=s.length;f>a;a++){var g=l[a];if(0==g.length)return i;for(var h=s[a],o=[],c=0,m=g.length;m>c;c++){u=e(h,g[c]);for(var v=0,p=u.length;p>v;v++)o.push(u[v])}l.push(o)}return l.length>1?l.pop():[]})}); -------------------------------------------------------------------------------- /docs/javascripts/scale.fix.js: -------------------------------------------------------------------------------- 1 | var metas = document.getElementsByTagName('meta'); 2 | var i; 3 | if (navigator.userAgent.match(/iPhone/i)) { 4 | for (i=0; i 2 | 3 | 4 | jquip - jQuery-in-parts 5 | 6 | 38 | 39 | 40 | 43 | 44 |

Simple Demo

45 | 46 |
47 | 48 | 49 |
50 | 51 |
52 |
53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /test/ajax/node_modules/.bin/express: -------------------------------------------------------------------------------- 1 | ../express/bin/express -------------------------------------------------------------------------------- /test/ajax/node_modules/express/.npmignore: -------------------------------------------------------------------------------- 1 | .git* 2 | docs/ 3 | examples/ 4 | support/ 5 | test/ 6 | testing.js 7 | .DS_Store 8 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2009-2011 TJ Holowaychuk 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /test/ajax/node_modules/express/Makefile: -------------------------------------------------------------------------------- 1 | 2 | DOCS = $(shell find docs/*.md) 3 | HTMLDOCS = $(DOCS:.md=.html) 4 | TESTS = $(shell find test/*.test.js) 5 | 6 | test: 7 | @NODE_ENV=test ./node_modules/.bin/expresso $(TESTS) 8 | 9 | docs: $(HTMLDOCS) 10 | @ echo "... generating TOC" 11 | @./support/toc.js docs/guide.html 12 | 13 | %.html: %.md 14 | @echo "... $< -> $@" 15 | @markdown $< \ 16 | | cat docs/layout/head.html - docs/layout/foot.html \ 17 | > $@ 18 | 19 | site: 20 | rm -fr /tmp/docs \ 21 | && cp -fr docs /tmp/docs \ 22 | && git checkout gh-pages \ 23 | && cp -fr /tmp/docs/* . \ 24 | && echo "done" 25 | 26 | docclean: 27 | rm -f docs/*.{1,html} 28 | 29 | .PHONY: site test docs docclean -------------------------------------------------------------------------------- /test/ajax/node_modules/express/index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = require('./lib/express'); -------------------------------------------------------------------------------- /test/ajax/node_modules/express/lib/express.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Express 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var connect = require('connect') 13 | , HTTPSServer = require('./https') 14 | , HTTPServer = require('./http') 15 | , Route = require('./router/route') 16 | 17 | /** 18 | * Re-export connect auto-loaders. 19 | * 20 | * This prevents the need to `require('connect')` in order 21 | * to access core middleware, so for example `express.logger()` instead 22 | * of `require('connect').logger()`. 23 | */ 24 | 25 | var exports = module.exports = connect.middleware; 26 | 27 | /** 28 | * Framework version. 29 | */ 30 | 31 | exports.version = '2.5.6'; 32 | 33 | /** 34 | * Shortcut for `new Server(...)`. 35 | * 36 | * @param {Function} ... 37 | * @return {Server} 38 | * @api public 39 | */ 40 | 41 | exports.createServer = function(options){ 42 | if ('object' == typeof options) { 43 | return new HTTPSServer(options, Array.prototype.slice.call(arguments, 1)); 44 | } else { 45 | return new HTTPServer(Array.prototype.slice.call(arguments)); 46 | } 47 | }; 48 | 49 | /** 50 | * Expose constructors. 51 | */ 52 | 53 | exports.HTTPServer = HTTPServer; 54 | exports.HTTPSServer = HTTPSServer; 55 | exports.Route = Route; 56 | 57 | /** 58 | * View extensions. 59 | */ 60 | 61 | exports.View = 62 | exports.view = require('./view'); 63 | 64 | /** 65 | * Response extensions. 66 | */ 67 | 68 | require('./response'); 69 | 70 | /** 71 | * Request extensions. 72 | */ 73 | 74 | require('./request'); 75 | 76 | // Error handler title 77 | 78 | exports.errorHandler.title = 'Express'; 79 | 80 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/lib/https.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Express - HTTPSServer 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var connect = require('connect') 13 | , HTTPServer = require('./http') 14 | , https = require('https'); 15 | 16 | /** 17 | * Expose `HTTPSServer`. 18 | */ 19 | 20 | exports = module.exports = HTTPSServer; 21 | 22 | /** 23 | * Server proto. 24 | */ 25 | 26 | var app = HTTPSServer.prototype; 27 | 28 | /** 29 | * Initialize a new `HTTPSServer` with the 30 | * given `options`, and optional `middleware`. 31 | * 32 | * @param {Object} options 33 | * @param {Array} middleware 34 | * @api public 35 | */ 36 | 37 | function HTTPSServer(options, middleware){ 38 | connect.HTTPSServer.call(this, options, []); 39 | this.init(middleware); 40 | }; 41 | 42 | /** 43 | * Inherit from `connect.HTTPSServer`. 44 | */ 45 | 46 | app.__proto__ = connect.HTTPSServer.prototype; 47 | 48 | // mixin HTTPServer methods 49 | 50 | Object.keys(HTTPServer.prototype).forEach(function(method){ 51 | app[method] = HTTPServer.prototype[method]; 52 | }); 53 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/lib/router/collection.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Express - router - Collection 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Expose `Collection`. 10 | */ 11 | 12 | module.exports = Collection; 13 | 14 | /** 15 | * Initialize a new route `Collection` 16 | * with the given `router`. 17 | * 18 | * @param {Router} router 19 | * @api private 20 | */ 21 | 22 | function Collection(router) { 23 | Array.apply(this, arguments); 24 | this.router = router; 25 | } 26 | 27 | /** 28 | * Inherit from `Array.prototype`. 29 | */ 30 | 31 | Collection.prototype.__proto__ = Array.prototype; 32 | 33 | /** 34 | * Remove the routes in this collection. 35 | * 36 | * @return {Collection} of routes removed 37 | * @api public 38 | */ 39 | 40 | Collection.prototype.remove = function(){ 41 | var router = this.router 42 | , len = this.length 43 | , ret = new Collection(this.router); 44 | 45 | for (var i = 0; i < len; ++i) { 46 | if (router.remove(this[i])) { 47 | ret.push(this[i]); 48 | } 49 | } 50 | 51 | return ret; 52 | }; 53 | 54 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/lib/router/methods.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Express - router - methods 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Hypertext Transfer Protocol -- HTTP/1.1 10 | * http://www.ietf.org/rfc/rfc2616.txt 11 | */ 12 | 13 | var RFC2616 = ['OPTIONS', 'GET', 'POST', 'PUT', 'DELETE', 'TRACE', 'CONNECT']; 14 | 15 | /** 16 | * HTTP Extensions for Distributed Authoring -- WEBDAV 17 | * http://www.ietf.org/rfc/rfc2518.txt 18 | */ 19 | 20 | var RFC2518 = ['PROPFIND', 'PROPPATCH', 'MKCOL', 'COPY', 'MOVE', 'LOCK', 'UNLOCK']; 21 | 22 | /** 23 | * Versioning Extensions to WebDAV 24 | * http://www.ietf.org/rfc/rfc3253.txt 25 | */ 26 | 27 | var RFC3253 = ['VERSION-CONTROL', 'REPORT', 'CHECKOUT', 'CHECKIN', 'UNCHECKOUT', 'MKWORKSPACE', 'UPDATE', 'LABEL', 'MERGE', 'BASELINE-CONTROL', 'MKACTIVITY']; 28 | 29 | /** 30 | * Ordered Collections Protocol (WebDAV) 31 | * http://www.ietf.org/rfc/rfc3648.txt 32 | */ 33 | 34 | var RFC3648 = ['ORDERPATCH']; 35 | 36 | /** 37 | * Web Distributed Authoring and Versioning (WebDAV) Access Control Protocol 38 | * http://www.ietf.org/rfc/rfc3744.txt 39 | */ 40 | 41 | var RFC3744 = ['ACL']; 42 | 43 | /** 44 | * Web Distributed Authoring and Versioning (WebDAV) SEARCH 45 | * http://www.ietf.org/rfc/rfc5323.txt 46 | */ 47 | 48 | var RFC5323 = ['SEARCH']; 49 | 50 | /** 51 | * PATCH Method for HTTP 52 | * http://www.ietf.org/rfc/rfc5789.txt 53 | */ 54 | 55 | var RFC5789 = ['PATCH']; 56 | 57 | /** 58 | * Expose the methods. 59 | */ 60 | 61 | module.exports = [].concat( 62 | RFC2616 63 | , RFC2518 64 | , RFC3253 65 | , RFC3648 66 | , RFC3744 67 | , RFC5323 68 | , RFC5789).map(function(method){ 69 | return method.toLowerCase(); 70 | }); 71 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/lib/view/partial.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Express - view - Partial 4 | * Copyright(c) 2010 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Memory cache. 10 | */ 11 | 12 | var cache = {}; 13 | 14 | /** 15 | * Resolve partial object name from the view path. 16 | * 17 | * Examples: 18 | * 19 | * "user.ejs" becomes "user" 20 | * "forum thread.ejs" becomes "forumThread" 21 | * "forum/thread/post.ejs" becomes "post" 22 | * "blog-post.ejs" becomes "blogPost" 23 | * 24 | * @return {String} 25 | * @api private 26 | */ 27 | 28 | exports.resolveObjectName = function(view){ 29 | return cache[view] || (cache[view] = view 30 | .split('/') 31 | .slice(-1)[0] 32 | .split('.')[0] 33 | .replace(/^_/, '') 34 | .replace(/[^a-zA-Z0-9 ]+/g, ' ') 35 | .split(/ +/).map(function(word, i){ 36 | return i 37 | ? word[0].toUpperCase() + word.substr(1) 38 | : word; 39 | }).join('')); 40 | }; -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/.npmignore: -------------------------------------------------------------------------------- 1 | *.markdown 2 | *.md 3 | .git* 4 | Makefile 5 | benchmarks/ 6 | docs/ 7 | examples/ 8 | install.sh 9 | support/ 10 | test/ 11 | .DS_Store 12 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2010 Sencha Inc. 4 | Copyright (c) 2011 LearnBoost 5 | Copyright (c) 2011 TJ Holowaychuk 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | 'Software'), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = require('./lib/connect'); -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/cache.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Connect - Cache 4 | * Copyright(c) 2011 Sencha Inc. 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Expose `Cache`. 10 | */ 11 | 12 | module.exports = Cache; 13 | 14 | /** 15 | * LRU cache store. 16 | * 17 | * @param {Number} limit 18 | * @api private 19 | */ 20 | 21 | function Cache(limit) { 22 | this.store = {}; 23 | this.keys = []; 24 | this.limit = limit; 25 | } 26 | 27 | /** 28 | * Touch `key`, promoting the object. 29 | * 30 | * @param {String} key 31 | * @param {Number} i 32 | * @api private 33 | */ 34 | 35 | Cache.prototype.touch = function(key, i){ 36 | this.keys.splice(i,1); 37 | this.keys.push(key); 38 | }; 39 | 40 | /** 41 | * Remove `key`. 42 | * 43 | * @param {String} key 44 | * @api private 45 | */ 46 | 47 | Cache.prototype.remove = function(key){ 48 | delete this.store[key]; 49 | }; 50 | 51 | /** 52 | * Get the object stored for `key`. 53 | * 54 | * @param {String} key 55 | * @return {Array} 56 | * @api private 57 | */ 58 | 59 | Cache.prototype.get = function(key){ 60 | return this.store[key]; 61 | }; 62 | 63 | /** 64 | * Add a cache `key`. 65 | * 66 | * @param {String} key 67 | * @return {Array} 68 | * @api private 69 | */ 70 | 71 | Cache.prototype.add = function(key){ 72 | // initialize store 73 | var len = this.keys.push(key); 74 | 75 | // limit reached, invalid LRU 76 | if (len > this.limit) this.remove(this.keys.shift()); 77 | 78 | var arr = this.store[key] = []; 79 | arr.createdAt = new Date; 80 | return arr; 81 | }; 82 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/https.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Connect - HTTPServer 4 | * Copyright(c) 2010 Sencha Inc. 5 | * Copyright(c) 2011 TJ Holowaychuk 6 | * MIT Licensed 7 | */ 8 | 9 | /** 10 | * Module dependencies. 11 | */ 12 | 13 | var HTTPServer = require('./http').Server 14 | , https = require('https'); 15 | 16 | /** 17 | * Initialize a new `Server` with the given 18 | *`options` and `middleware`. The HTTPS api 19 | * is identical to the [HTTP](http.html) server, 20 | * however TLS `options` must be provided before 21 | * passing in the optional middleware. 22 | * 23 | * @params {Object} options 24 | * @params {Array} middleawre 25 | * @return {Server} 26 | * @api public 27 | */ 28 | 29 | var Server = exports.Server = function HTTPSServer(options, middleware) { 30 | this.stack = []; 31 | middleware.forEach(function(fn){ 32 | this.use(fn); 33 | }, this); 34 | https.Server.call(this, options, this.handle); 35 | }; 36 | 37 | /** 38 | * Inherit from `http.Server.prototype`. 39 | */ 40 | 41 | Server.prototype.__proto__ = https.Server.prototype; 42 | 43 | // mixin HTTPServer methods 44 | 45 | Object.keys(HTTPServer.prototype).forEach(function(method){ 46 | Server.prototype[method] = HTTPServer.prototype[method]; 47 | }); -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/middleware/cookieParser.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Connect - cookieParser 4 | * Copyright(c) 2010 Sencha Inc. 5 | * Copyright(c) 2011 TJ Holowaychuk 6 | * MIT Licensed 7 | */ 8 | 9 | /** 10 | * Module dependencies. 11 | */ 12 | 13 | var utils = require('./../utils'); 14 | 15 | /** 16 | * Parse _Cookie_ header and populate `req.cookies` 17 | * with an object keyed by the cookie names. 18 | * 19 | * Examples: 20 | * 21 | * connect.createServer( 22 | * connect.cookieParser() 23 | * , function(req, res, next){ 24 | * res.end(JSON.stringify(req.cookies)); 25 | * } 26 | * ); 27 | * 28 | * @return {Function} 29 | * @api public 30 | */ 31 | 32 | module.exports = function cookieParser(){ 33 | return function cookieParser(req, res, next) { 34 | var cookie = req.headers.cookie; 35 | if (req.cookies) return next(); 36 | req.cookies = {}; 37 | if (cookie) { 38 | try { 39 | req.cookies = utils.parseCookie(cookie); 40 | } catch (err) { 41 | return next(err); 42 | } 43 | } 44 | next(); 45 | }; 46 | }; -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/middleware/favicon.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Connect - favicon 4 | * Copyright(c) 2010 Sencha Inc. 5 | * Copyright(c) 2011 TJ Holowaychuk 6 | * MIT Licensed 7 | */ 8 | 9 | /** 10 | * Module dependencies. 11 | */ 12 | 13 | var fs = require('fs') 14 | , utils = require('../utils'); 15 | 16 | /** 17 | * Favicon cache. 18 | */ 19 | 20 | var icon; 21 | 22 | /** 23 | * By default serves the connect favicon, or the favicon 24 | * located by the given `path`. 25 | * 26 | * Options: 27 | * 28 | * - `maxAge` cache-control max-age directive, defaulting to 1 day 29 | * 30 | * Examples: 31 | * 32 | * connect.createServer( 33 | * connect.favicon() 34 | * ); 35 | * 36 | * connect.createServer( 37 | * connect.favicon(__dirname + '/public/favicon.ico') 38 | * ); 39 | * 40 | * @param {String} path 41 | * @param {Object} options 42 | * @return {Function} 43 | * @api public 44 | */ 45 | 46 | module.exports = function favicon(path, options){ 47 | var options = options || {} 48 | , path = path || __dirname + '/../public/favicon.ico' 49 | , maxAge = options.maxAge || 86400000; 50 | 51 | return function favicon(req, res, next){ 52 | if ('/favicon.ico' == req.url) { 53 | if (icon) { 54 | res.writeHead(200, icon.headers); 55 | res.end(icon.body); 56 | } else { 57 | fs.readFile(path, function(err, buf){ 58 | if (err) return next(err); 59 | icon = { 60 | headers: { 61 | 'Content-Type': 'image/x-icon' 62 | , 'Content-Length': buf.length 63 | , 'ETag': '"' + utils.md5(buf) + '"' 64 | , 'Cache-Control': 'public, max-age=' + (maxAge / 1000) 65 | }, 66 | body: buf 67 | }; 68 | res.writeHead(200, icon.headers); 69 | res.end(icon.body); 70 | }); 71 | } 72 | } else { 73 | next(); 74 | } 75 | }; 76 | }; -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/middleware/limit.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Connect - limit 4 | * Copyright(c) 2011 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Limit request bodies to the given size in `bytes`. 10 | * 11 | * A string representation of the bytesize may also be passed, 12 | * for example "5mb", "200kb", "1gb", etc. 13 | * 14 | * Examples: 15 | * 16 | * var server = connect( 17 | * connect.limit('5.5mb') 18 | * ).listen(3000); 19 | * 20 | * TODO: pause EV_READ 21 | * 22 | * @param {Number|String} bytes 23 | * @return {Function} 24 | * @api public 25 | */ 26 | 27 | module.exports = function limit(bytes){ 28 | if ('string' == typeof bytes) bytes = parse(bytes); 29 | if ('number' != typeof bytes) throw new Error('limit() bytes required'); 30 | return function limit(req, res, next){ 31 | var received = 0 32 | , len = req.headers['content-length'] 33 | ? parseInt(req.headers['content-length'], 10) 34 | : null; 35 | 36 | // deny the request 37 | function deny() { 38 | req.destroy(); 39 | } 40 | 41 | // self-awareness 42 | if (req._limit) return next(); 43 | req._limit = true; 44 | 45 | // limit by content-length 46 | if (len && len > bytes) { 47 | res.statusCode = 413; 48 | res.end('Request Entity Too Large'); 49 | return; 50 | } 51 | 52 | // limit 53 | req.on('data', function(chunk){ 54 | received += chunk.length; 55 | if (received > bytes) deny(); 56 | }); 57 | 58 | next(); 59 | }; 60 | }; 61 | 62 | /** 63 | * Parse byte `size` string. 64 | * 65 | * @param {String} size 66 | * @return {Number} 67 | * @api private 68 | */ 69 | 70 | function parse(size) { 71 | var parts = size.match(/^(\d+(?:\.\d+)?) *(kb|mb|gb)$/) 72 | , n = parseFloat(parts[1]) 73 | , type = parts[2]; 74 | 75 | var map = { 76 | kb: 1024 77 | , mb: 1024 * 1024 78 | , gb: 1024 * 1024 * 1024 79 | }; 80 | 81 | return map[type] * n; 82 | } -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/middleware/methodOverride.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Connect - methodOverride 4 | * Copyright(c) 2010 Sencha Inc. 5 | * Copyright(c) 2011 TJ Holowaychuk 6 | * MIT Licensed 7 | */ 8 | 9 | /** 10 | * Provides faux HTTP method support. 11 | * 12 | * Pass an optional `key` to use when checking for 13 | * a method override, othewise defaults to _\_method_. 14 | * The original method is available via `req.originalMethod`. 15 | * 16 | * @param {String} key 17 | * @return {Function} 18 | * @api public 19 | */ 20 | 21 | module.exports = function methodOverride(key){ 22 | key = key || "_method"; 23 | return function methodOverride(req, res, next) { 24 | req.originalMethod = req.originalMethod || req.method; 25 | 26 | // req.body 27 | if (req.body && key in req.body) { 28 | req.method = req.body[key].toUpperCase(); 29 | delete req.body[key]; 30 | // check X-HTTP-Method-Override 31 | } else if (req.headers['x-http-method-override']) { 32 | req.method = req.headers['x-http-method-override'].toUpperCase(); 33 | } 34 | 35 | next(); 36 | }; 37 | }; 38 | 39 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/middleware/query.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Connect - query 4 | * Copyright(c) 2011 TJ Holowaychuk 5 | * Copyright(c) 2011 Sencha Inc. 6 | * MIT Licensed 7 | */ 8 | 9 | /** 10 | * Module dependencies. 11 | */ 12 | 13 | var qs = require('qs') 14 | , parse = require('url').parse; 15 | 16 | /** 17 | * Automatically parse the query-string when available, 18 | * populating the `req.query` object. 19 | * 20 | * Examples: 21 | * 22 | * connect( 23 | * connect.query() 24 | * , function(req, res){ 25 | * res.end(JSON.stringify(req.query)); 26 | * } 27 | * ).listen(3000); 28 | * 29 | * @return {Function} 30 | * @api public 31 | */ 32 | 33 | module.exports = function query(){ 34 | return function query(req, res, next){ 35 | req.query = ~req.url.indexOf('?') 36 | ? qs.parse(parse(req.url).query) 37 | : {}; 38 | next(); 39 | }; 40 | }; 41 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/middleware/responseTime.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Connect - responseTime 4 | * Copyright(c) 2011 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Adds the `X-Response-Time` header displaying the response 10 | * duration in milliseconds. 11 | * 12 | * @return {Function} 13 | * @api public 14 | */ 15 | 16 | module.exports = function responseTime(){ 17 | return function(req, res, next){ 18 | var writeHead = res.writeHead 19 | , start = new Date; 20 | 21 | if (res._responseTime) return next(); 22 | res._responseTime = true; 23 | 24 | // proxy writeHead to calculate duration 25 | res.writeHead = function(status, headers){ 26 | var duration = new Date - start; 27 | res.setHeader('X-Response-Time', duration + 'ms'); 28 | res.writeHead = writeHead; 29 | res.writeHead(status, headers); 30 | }; 31 | 32 | next(); 33 | }; 34 | }; 35 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/middleware/vhost.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Connect - vhost 4 | * Copyright(c) 2010 Sencha Inc. 5 | * Copyright(c) 2011 TJ Holowaychuk 6 | * MIT Licensed 7 | */ 8 | 9 | /** 10 | * Setup vhost for the given `hostname` and `server`. 11 | * 12 | * Examples: 13 | * 14 | * connect( 15 | * connect.vhost('foo.com', 16 | * connect.createServer(...middleware...) 17 | * ), 18 | * connect.vhost('bar.com', 19 | * connect.createServer(...middleware...) 20 | * ) 21 | * ); 22 | * 23 | * @param {String} hostname 24 | * @param {Server} server 25 | * @return {Function} 26 | * @api public 27 | */ 28 | 29 | module.exports = function vhost(hostname, server){ 30 | if (!hostname) throw new Error('vhost hostname required'); 31 | if (!server) throw new Error('vhost server required'); 32 | var regexp = new RegExp('^' + hostname.replace(/[*]/g, '(.*?)') + '$'); 33 | if (server.onvhost) server.onvhost(hostname); 34 | return function vhost(req, res, next){ 35 | if (!req.headers.host) return next(); 36 | var host = req.headers.host.split(':')[0]; 37 | if (req.subdomains = regexp.exec(host)) { 38 | req.subdomains = req.subdomains[0].split('.').slice(0, -1); 39 | server.emit("request", req, res); 40 | } else { 41 | next(); 42 | } 43 | }; 44 | }; 45 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/patch.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Connect 4 | * Copyright(c) 2011 TJ Holowaychuk 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module dependencies. 10 | */ 11 | 12 | var http = require('http') 13 | , res = http.OutgoingMessage.prototype; 14 | 15 | // original setHeader() 16 | 17 | var setHeader = res.setHeader; 18 | 19 | // original _renderHeaders() 20 | 21 | var _renderHeaders = res._renderHeaders; 22 | 23 | if (res._hasConnectPatch) return; 24 | 25 | /** 26 | * Provide a public "header sent" flag 27 | * until node does. 28 | * 29 | * @return {Boolean} 30 | * @api public 31 | */ 32 | 33 | res.__defineGetter__('headerSent', function(){ 34 | return this._headerSent; 35 | }); 36 | 37 | /** 38 | * Set header `field` to `val`, special-casing 39 | * the `Set-Cookie` field for multiple support. 40 | * 41 | * @param {String} field 42 | * @param {String} val 43 | * @api public 44 | */ 45 | 46 | res.setHeader = function(field, val){ 47 | var key = field.toLowerCase() 48 | , prev; 49 | 50 | // special-case Set-Cookie 51 | if (this._headers && 'set-cookie' == key) { 52 | if (prev = this.getHeader(field)) { 53 | val = Array.isArray(prev) 54 | ? prev.concat(val) 55 | : [prev, val]; 56 | } 57 | // charset 58 | } else if ('content-type' == key && this.charset) { 59 | val += '; charset=' + this.charset; 60 | } 61 | 62 | return setHeader.call(this, field, val); 63 | }; 64 | 65 | /** 66 | * Proxy `res.end()` to expose a 'header' event, 67 | * allowing arbitrary augmentation before the header 68 | * fields are written to the socket. 69 | * 70 | * NOTE: this _only_ supports node's progressive header 71 | * field API aka `res.setHeader()`. 72 | */ 73 | 74 | res._renderHeaders = function(){ 75 | this.emit('header'); 76 | return _renderHeaders.call(this); 77 | }; 78 | 79 | res._hasConnectPatch = true; 80 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {error} 4 | 5 | 6 | 7 |
8 |

{title}

9 |

500 {error}

10 |
    {stack}
11 |
12 | 13 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/favicon.ico -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_add.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_attach.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_attach.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_code.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_copy.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_delete.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_edit.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_error.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_excel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_excel.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_find.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_gear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_gear.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_go.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_go.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_green.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_key.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_lightning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_lightning.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_link.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_paintbrush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_paintbrush.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_paste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_paste.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_red.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_refresh.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_save.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_acrobat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_acrobat.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_actionscript.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_actionscript.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_add.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_c.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_camera.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_cd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_cd.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_code.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_code_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_code_red.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_coldfusion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_coldfusion.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_compressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_compressed.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_copy.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_cplusplus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_cplusplus.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_csharp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_csharp.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_cup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_cup.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_database.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_database.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_delete.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_dvd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_dvd.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_edit.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_error.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_excel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_excel.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_find.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_flash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_flash.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_freehand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_freehand.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_gear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_gear.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_get.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_get.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_go.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_go.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_h.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_horizontal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_horizontal.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_key.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_lightning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_lightning.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_link.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_magnify.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_magnify.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_medal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_medal.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_office.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_office.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_paint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_paint.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_paintbrush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_paintbrush.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_paste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_paste.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_php.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_php.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_picture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_picture.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_powerpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_powerpoint.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_put.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_put.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_ruby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_ruby.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_stack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_stack.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_star.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_swoosh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_swoosh.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_text.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_text_width.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_text_width.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_tux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_tux.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_vector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_vector.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_visualstudio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_visualstudio.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_width.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_width.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_word.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_word.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_world.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_world.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_wrench.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_wrench.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_zip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_white_zip.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_word.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_word.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_world.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/lib/public/icons/page_world.png -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/..travis.yml.un~: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/..travis.yml.un~ -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/.Readme.md.un~: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/.Readme.md.un~ -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/.npmignore: -------------------------------------------------------------------------------- 1 | /test/tmp/ 2 | *.upload 3 | *.un~ 4 | *.http 5 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/.package.json.un~: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/.package.json.un~ -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.4 4 | - 0.6 5 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/Makefile: -------------------------------------------------------------------------------- 1 | SHELL := /bin/bash 2 | 3 | test: 4 | @./test/run.js 5 | 6 | build: npm test 7 | 8 | npm: 9 | npm install . 10 | 11 | clean: 12 | rm test/tmp/* 13 | 14 | .PHONY: test clean build 15 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/TODO: -------------------------------------------------------------------------------- 1 | - Better bufferMaxSize handling approach 2 | - Add tests for JSON parser pull request and merge it 3 | - Implement QuerystringParser the same way as MultipartParser 4 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/benchmark/bench-multipart-parser.js: -------------------------------------------------------------------------------- 1 | require('../test/common'); 2 | var multipartParser = require('../lib/multipart_parser'), 3 | MultipartParser = multipartParser.MultipartParser, 4 | parser = new MultipartParser(), 5 | Buffer = require('buffer').Buffer, 6 | boundary = '-----------------------------168072824752491622650073', 7 | mb = 100, 8 | buffer = createMultipartBuffer(boundary, mb * 1024 * 1024), 9 | callbacks = 10 | { partBegin: -1, 11 | partEnd: -1, 12 | headerField: -1, 13 | headerValue: -1, 14 | partData: -1, 15 | end: -1, 16 | }; 17 | 18 | 19 | parser.initWithBoundary(boundary); 20 | parser.onHeaderField = function() { 21 | callbacks.headerField++; 22 | }; 23 | 24 | parser.onHeaderValue = function() { 25 | callbacks.headerValue++; 26 | }; 27 | 28 | parser.onPartBegin = function() { 29 | callbacks.partBegin++; 30 | }; 31 | 32 | parser.onPartData = function() { 33 | callbacks.partData++; 34 | }; 35 | 36 | parser.onPartEnd = function() { 37 | callbacks.partEnd++; 38 | }; 39 | 40 | parser.onEnd = function() { 41 | callbacks.end++; 42 | }; 43 | 44 | var start = +new Date(), 45 | nparsed = parser.write(buffer), 46 | duration = +new Date - start, 47 | mbPerSec = (mb / (duration / 1000)).toFixed(2); 48 | 49 | console.log(mbPerSec+' mb/sec'); 50 | 51 | assert.equal(nparsed, buffer.length); 52 | 53 | function createMultipartBuffer(boundary, size) { 54 | var head = 55 | '--'+boundary+'\r\n' 56 | + 'content-disposition: form-data; name="field1"\r\n' 57 | + '\r\n' 58 | , tail = '\r\n--'+boundary+'--\r\n' 59 | , buffer = new Buffer(size); 60 | 61 | buffer.write(head, 'ascii', 0); 62 | buffer.write(tail, 'ascii', buffer.length - tail.length); 63 | return buffer; 64 | } 65 | 66 | process.on('exit', function() { 67 | for (var k in callbacks) { 68 | assert.equal(0, callbacks[k], k+' count off by '+callbacks[k]); 69 | } 70 | }); 71 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/example/post.js: -------------------------------------------------------------------------------- 1 | require('../test/common'); 2 | var http = require('http'), 3 | util = require('util'), 4 | formidable = require('formidable'), 5 | server; 6 | 7 | server = http.createServer(function(req, res) { 8 | if (req.url == '/') { 9 | res.writeHead(200, {'content-type': 'text/html'}); 10 | res.end( 11 | '
'+ 12 | '
'+ 13 | '
'+ 14 | ''+ 15 | '
' 16 | ); 17 | } else if (req.url == '/post') { 18 | var form = new formidable.IncomingForm(), 19 | fields = []; 20 | 21 | form 22 | .on('error', function(err) { 23 | res.writeHead(200, {'content-type': 'text/plain'}); 24 | res.end('error:\n\n'+util.inspect(err)); 25 | }) 26 | .on('field', function(field, value) { 27 | console.log(field, value); 28 | fields.push([field, value]); 29 | }) 30 | .on('end', function() { 31 | console.log('-> post done'); 32 | res.writeHead(200, {'content-type': 'text/plain'}); 33 | res.end('received fields:\n\n '+util.inspect(fields)); 34 | }); 35 | form.parse(req); 36 | } else { 37 | res.writeHead(404, {'content-type': 'text/plain'}); 38 | res.end('404'); 39 | } 40 | }); 41 | server.listen(TEST_PORT); 42 | 43 | console.log('listening on http://localhost:'+TEST_PORT+'/'); 44 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/example/upload.js: -------------------------------------------------------------------------------- 1 | require('../test/common'); 2 | var http = require('http'), 3 | util = require('util'), 4 | formidable = require('formidable'), 5 | server; 6 | 7 | server = http.createServer(function(req, res) { 8 | if (req.url == '/') { 9 | res.writeHead(200, {'content-type': 'text/html'}); 10 | res.end( 11 | '
'+ 12 | '
'+ 13 | '
'+ 14 | ''+ 15 | '
' 16 | ); 17 | } else if (req.url == '/upload') { 18 | var form = new formidable.IncomingForm(), 19 | files = [], 20 | fields = []; 21 | 22 | form.uploadDir = TEST_TMP; 23 | 24 | form 25 | .on('field', function(field, value) { 26 | console.log(field, value); 27 | fields.push([field, value]); 28 | }) 29 | .on('file', function(field, file) { 30 | console.log(field, file); 31 | files.push([field, file]); 32 | }) 33 | .on('end', function() { 34 | console.log('-> upload done'); 35 | res.writeHead(200, {'content-type': 'text/plain'}); 36 | res.write('received fields:\n\n '+util.inspect(fields)); 37 | res.write('\n\n'); 38 | res.end('received files:\n\n '+util.inspect(files)); 39 | }); 40 | form.parse(req); 41 | } else { 42 | res.writeHead(404, {'content-type': 'text/plain'}); 43 | res.end('404'); 44 | } 45 | }); 46 | server.listen(TEST_PORT); 47 | 48 | console.log('listening on http://localhost:'+TEST_PORT+'/'); 49 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./lib/formidable'); -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/lib/.incoming_form.js.un~: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/lib/.incoming_form.js.un~ -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/lib/file.js: -------------------------------------------------------------------------------- 1 | if (global.GENTLY) require = GENTLY.hijack(require); 2 | 3 | var util = require('./util'), 4 | WriteStream = require('fs').WriteStream, 5 | EventEmitter = require('events').EventEmitter; 6 | 7 | function File(properties) { 8 | EventEmitter.call(this); 9 | 10 | this.size = 0; 11 | this.path = null; 12 | this.name = null; 13 | this.type = null; 14 | this.lastModifiedDate = null; 15 | 16 | this._writeStream = null; 17 | 18 | for (var key in properties) { 19 | this[key] = properties[key]; 20 | } 21 | 22 | this._backwardsCompatibility(); 23 | } 24 | module.exports = File; 25 | util.inherits(File, EventEmitter); 26 | 27 | // @todo Next release: Show error messages when accessing these 28 | File.prototype._backwardsCompatibility = function() { 29 | var self = this; 30 | this.__defineGetter__('length', function() { 31 | return self.size; 32 | }); 33 | this.__defineGetter__('filename', function() { 34 | return self.name; 35 | }); 36 | this.__defineGetter__('mime', function() { 37 | return self.type; 38 | }); 39 | }; 40 | 41 | File.prototype.open = function() { 42 | this._writeStream = new WriteStream(this.path); 43 | }; 44 | 45 | File.prototype.write = function(buffer, cb) { 46 | var self = this; 47 | this._writeStream.write(buffer, function() { 48 | self.lastModifiedDate = new Date(); 49 | self.size += buffer.length; 50 | self.emit('progress', self.size); 51 | cb(); 52 | }); 53 | }; 54 | 55 | File.prototype.end = function(cb) { 56 | var self = this; 57 | this._writeStream.end(function() { 58 | self.emit('end'); 59 | cb(); 60 | }); 61 | }; 62 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/lib/index.js: -------------------------------------------------------------------------------- 1 | var IncomingForm = require('./incoming_form').IncomingForm; 2 | IncomingForm.IncomingForm = IncomingForm; 3 | module.exports = IncomingForm; 4 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/lib/querystring_parser.js: -------------------------------------------------------------------------------- 1 | if (global.GENTLY) require = GENTLY.hijack(require); 2 | 3 | // This is a buffering parser, not quite as nice as the multipart one. 4 | // If I find time I'll rewrite this to be fully streaming as well 5 | var querystring = require('querystring'); 6 | 7 | function QuerystringParser() { 8 | this.buffer = ''; 9 | }; 10 | exports.QuerystringParser = QuerystringParser; 11 | 12 | QuerystringParser.prototype.write = function(buffer) { 13 | this.buffer += buffer.toString('ascii'); 14 | return buffer.length; 15 | }; 16 | 17 | QuerystringParser.prototype.end = function() { 18 | var fields = querystring.parse(this.buffer); 19 | for (var field in fields) { 20 | this.onField(field, fields[field]); 21 | } 22 | this.buffer = ''; 23 | 24 | this.onEnd(); 25 | }; -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/lib/util.js: -------------------------------------------------------------------------------- 1 | // Backwards compatibility ... 2 | try { 3 | module.exports = require('util'); 4 | } catch (e) { 5 | module.exports = require('sys'); 6 | } 7 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "formidable", 3 | "version": "1.0.8", 4 | "dependencies": {}, 5 | "devDependencies": { 6 | "gently": "0.8.0", 7 | "findit": "0.1.1", 8 | "hashish": "0.0.4", 9 | "urun": "0.0.4", 10 | "utest": "0.0.3" 11 | }, 12 | "directories": { 13 | "lib": "./lib" 14 | }, 15 | "main": "./lib/index", 16 | "scripts": { 17 | "test": "make test" 18 | }, 19 | "engines": { 20 | "node": "*" 21 | } 22 | } -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/test/.common.js.un~: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/test/.common.js.un~ -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/test/.run.js.un~: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/test/.run.js.un~ -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/test/common.js: -------------------------------------------------------------------------------- 1 | var mysql = require('..'); 2 | var path = require('path'); 3 | 4 | var root = path.join(__dirname, '../'); 5 | exports.dir = { 6 | root : root, 7 | lib : root + '/lib', 8 | fixture : root + '/test/fixture', 9 | tmp : root + '/test/tmp', 10 | }; 11 | 12 | exports.port = 13532; 13 | 14 | exports.formidable = require('..'); 15 | exports.assert = require('assert'); 16 | 17 | exports.require = function(lib) { 18 | return require(exports.dir.lib + '/' + lib); 19 | }; 20 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/funkyfilename.txt: -------------------------------------------------------------------------------- 1 | I am a text file with a funky name! 2 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/plain.txt: -------------------------------------------------------------------------------- 1 | I am a plain text file 2 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/info.md: -------------------------------------------------------------------------------- 1 | * Opera does not allow submitting this file, it shows a warning to the 2 | user that the file could not be found instead. Tested in 9.8, 11.51 on OSX. 3 | Reported to Opera on 08.09.2011 (tracking email DSK-346009@bugs.opera.com). 4 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/.special-chars-in-filename.js.un~: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/.special-chars-in-filename.js.un~ -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/no-filename.js: -------------------------------------------------------------------------------- 1 | module.exports['generic.http'] = [ 2 | {type: 'file', name: 'upload', filename: '', fixture: 'plain.txt'}, 3 | ]; 4 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/special-chars-in-filename.js: -------------------------------------------------------------------------------- 1 | var properFilename = 'funkyfilename.txt'; 2 | 3 | function expect(filename) { 4 | return [ 5 | {type: 'field', name: 'title', value: 'Weird filename'}, 6 | {type: 'file', name: 'upload', filename: filename, fixture: properFilename}, 7 | ]; 8 | }; 9 | 10 | var webkit = " ? % * | \" < > . ? ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"; 11 | var ffOrIe = " ? % * | \" < > . ☃ ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"; 12 | 13 | module.exports = { 14 | 'osx-chrome-13.http' : expect(webkit), 15 | 'osx-firefox-3.6.http' : expect(ffOrIe), 16 | 'osx-safari-5.http' : expect(webkit), 17 | 'xp-chrome-12.http' : expect(webkit), 18 | 'xp-ie-7.http' : expect(ffOrIe), 19 | 'xp-ie-8.http' : expect(ffOrIe), 20 | 'xp-safari-5.http' : expect(webkit), 21 | }; 22 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/test/integration/.test-fixtures.js.un~: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/test/integration/.test-fixtures.js.un~ -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/common.js: -------------------------------------------------------------------------------- 1 | var path = require('path'), 2 | fs = require('fs'); 3 | 4 | try { 5 | global.Gently = require('gently'); 6 | } catch (e) { 7 | throw new Error('this test suite requires node-gently'); 8 | } 9 | 10 | exports.lib = path.join(__dirname, '../../lib'); 11 | 12 | global.GENTLY = new Gently(); 13 | 14 | global.assert = require('assert'); 15 | global.TEST_PORT = 13532; 16 | global.TEST_FIXTURES = path.join(__dirname, '../fixture'); 17 | global.TEST_TMP = path.join(__dirname, '../tmp'); 18 | 19 | // Stupid new feature in node that complains about gently attaching too many 20 | // listeners to process 'exit'. This is a workaround until I can think of a 21 | // better way to deal with this. 22 | if (process.setMaxListeners) { 23 | process.setMaxListeners(10000); 24 | } 25 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-multipart-parser.js: -------------------------------------------------------------------------------- 1 | var common = require('../common'); 2 | var multipartParser = require(common.lib + '/multipart_parser'), 3 | MultipartParser = multipartParser.MultipartParser, 4 | events = require('events'), 5 | Buffer = require('buffer').Buffer, 6 | parser; 7 | 8 | function test(test) { 9 | parser = new MultipartParser(); 10 | test(); 11 | } 12 | 13 | test(function constructor() { 14 | assert.equal(parser.boundary, null); 15 | assert.equal(parser.state, 0); 16 | assert.equal(parser.flags, 0); 17 | assert.equal(parser.boundaryChars, null); 18 | assert.equal(parser.index, null); 19 | assert.equal(parser.lookbehind, null); 20 | assert.equal(parser.constructor.name, 'MultipartParser'); 21 | }); 22 | 23 | test(function initWithBoundary() { 24 | var boundary = 'abc'; 25 | parser.initWithBoundary(boundary); 26 | assert.deepEqual(Array.prototype.slice.call(parser.boundary), [13, 10, 45, 45, 97, 98, 99]); 27 | assert.equal(parser.state, multipartParser.START); 28 | 29 | assert.deepEqual(parser.boundaryChars, {10: true, 13: true, 45: true, 97: true, 98: true, 99: true}); 30 | }); 31 | 32 | test(function parserError() { 33 | var boundary = 'abc', 34 | buffer = new Buffer(5); 35 | 36 | parser.initWithBoundary(boundary); 37 | buffer.write('--ad', 'ascii', 0); 38 | assert.equal(parser.write(buffer), 3); 39 | }); 40 | 41 | test(function end() { 42 | (function testError() { 43 | assert.equal(parser.end().message, 'MultipartParser.end(): stream ended unexpectedly: ' + parser.explain()); 44 | })(); 45 | 46 | (function testRegular() { 47 | parser.state = multipartParser.END; 48 | assert.strictEqual(parser.end(), undefined); 49 | })(); 50 | }); 51 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-querystring-parser.js: -------------------------------------------------------------------------------- 1 | var common = require('../common'); 2 | var QuerystringParser = require(common.lib + '/querystring_parser').QuerystringParser, 3 | Buffer = require('buffer').Buffer, 4 | gently, 5 | parser; 6 | 7 | function test(test) { 8 | gently = new Gently(); 9 | parser = new QuerystringParser(); 10 | test(); 11 | gently.verify(test.name); 12 | } 13 | 14 | test(function constructor() { 15 | assert.equal(parser.buffer, ''); 16 | assert.equal(parser.constructor.name, 'QuerystringParser'); 17 | }); 18 | 19 | test(function write() { 20 | var a = new Buffer('a=1'); 21 | assert.equal(parser.write(a), a.length); 22 | 23 | var b = new Buffer('&b=2'); 24 | parser.write(b); 25 | assert.equal(parser.buffer, a + b); 26 | }); 27 | 28 | test(function end() { 29 | var FIELDS = {a: ['b', {c: 'd'}], e: 'f'}; 30 | 31 | gently.expect(GENTLY.hijacked.querystring, 'parse', function(str) { 32 | assert.equal(str, parser.buffer); 33 | return FIELDS; 34 | }); 35 | 36 | gently.expect(parser, 'onField', Object.keys(FIELDS).length, function(key, val) { 37 | assert.deepEqual(FIELDS[key], val); 38 | }); 39 | 40 | gently.expect(parser, 'onEnd'); 41 | 42 | parser.buffer = 'my buffer'; 43 | parser.end(); 44 | assert.equal(parser.buffer, ''); 45 | }); 46 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/test/run.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | require('urun')(__dirname) 3 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/test/tmp/.empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/test/tmp/.empty -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/test/unit/.test-incoming-form.js.un~: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mythz/jquip/8a206a3ccfe16031ee1745ec7ce42d03ce3759b1/test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/test/unit/.test-incoming-form.js.un~ -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/node_modules/formidable/tool/record.js: -------------------------------------------------------------------------------- 1 | var http = require('http'); 2 | var fs = require('fs'); 3 | var connections = 0; 4 | 5 | var server = http.createServer(function(req, res) { 6 | var socket = req.socket; 7 | console.log('Request: %s %s -> %s', req.method, req.url, socket.filename); 8 | 9 | req.on('end', function() { 10 | if (req.url !== '/') { 11 | res.end(JSON.stringify({ 12 | method: req.method, 13 | url: req.url, 14 | filename: socket.filename, 15 | })); 16 | return; 17 | } 18 | 19 | res.writeHead(200, {'content-type': 'text/html'}); 20 | res.end( 21 | '
'+ 22 | '
'+ 23 | '
'+ 24 | ''+ 25 | '
' 26 | ); 27 | }); 28 | }); 29 | 30 | server.on('connection', function(socket) { 31 | connections++; 32 | 33 | socket.id = connections; 34 | socket.filename = 'connection-' + socket.id + '.http'; 35 | socket.file = fs.createWriteStream(socket.filename); 36 | socket.pipe(socket.file); 37 | 38 | console.log('--> %s', socket.filename); 39 | socket.on('close', function() { 40 | console.log('<-- %s', socket.filename); 41 | }); 42 | }); 43 | 44 | var port = process.env.PORT || 8080; 45 | server.listen(port, function() { 46 | console.log('Recording connections on port %s', port); 47 | }); 48 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "connect", 3 | "version": "1.8.5", 4 | "description": "High performance middleware framework", 5 | "keywords": ["framework", "web", "middleware", "connect", "rack"], 6 | "repository": "git://github.com/senchalabs/connect.git", 7 | "author": "TJ Holowaychuk (http://tjholowaychuk.com)", 8 | "repository": "git://github.com/senchalabs/connect", 9 | "dependencies": { 10 | "qs": ">= 0.4.0", 11 | "mime": ">= 0.0.1", 12 | "formidable": "1.0.x" 13 | }, 14 | "devDependencies": { 15 | "expresso": "0.9.2", 16 | "koala": "0.1.2", 17 | "less": "1.1.1", 18 | "sass": "0.5.0", 19 | "markdown": "0.2.1", 20 | "ejs": "0.4.3", 21 | "should": "0.3.2" 22 | }, 23 | "main": "index", 24 | "engines": { "node": ">= 0.4.1 < 0.7.0" } 25 | } -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/connect/test.js: -------------------------------------------------------------------------------- 1 | 2 | var connect = require('./') 3 | , http = require('http') 4 | , RedisStore = require('connect-redis')(connect); 5 | 6 | var app = connect(); 7 | app.use(connect.cookieParser('fucj')); 8 | app.use(connect.session({store:new RedisStore})); 9 | app.use(function(req, res, next){ 10 | req.session.views = (req.session.views || 0) + 1; 11 | res.writeHead(200, {"Content-Type": "text/plain"}); 12 | res.end("You've viewed this page "+req.session.views+" times."); 13 | }) 14 | 15 | http.createServer(app).listen(3000); 16 | 17 | 18 | // var set = RedisStore.prototype.set; 19 | // 20 | // function slow(sid){ 21 | // console.log('%s saving', sid); 22 | // var args = arguments; 23 | // setTimeout(function(self){ 24 | // console.log('%s saved', sid); 25 | // set.apply(self, args); 26 | // }, 2000, this); 27 | // }; 28 | // 29 | // http.createServer(connect() 30 | // .use(connect.logger('dev')) 31 | // .use(connect.cookieParser('keyboard cat')) 32 | // .use(connect.session({ store: new RedisStore })) 33 | // .use(function(req, res, next){ 34 | // var sess = req.session; 35 | // switch (req.url) { 36 | // case '/foo.js': 37 | // console.log('%s foo.js sid', sess.id); 38 | // RedisStore.prototype.set = set; 39 | // res.end('data'); 40 | // break; 41 | // default: 42 | // console.log('%s html sid', sess.id); 43 | // RedisStore.prototype.set = slow; 44 | // res.setHeader('Content-Type', 'html'); 45 | // res.write(''); 46 | // setTimeout(function(){ 47 | // res.end(''); 48 | // }, 1000); 49 | // } 50 | // })).listen(3000); 51 | // 52 | // console.log('port 3000'); -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/mime/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010 Benjamin Thomas, Robert Kieffer 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/mime/README.md: -------------------------------------------------------------------------------- 1 | # mime 2 | 3 | Support for mapping between file extensions and MIME types. This module uses the latest version of the Apache "mime.types" file (maps over 620 types to 800+ extensions). It is also trivially easy to add your own types and extensions, should you need to do that. 4 | 5 | ## Install 6 | 7 | Install with [npm](http://github.com/isaacs/npm): 8 | 9 | npm install mime 10 | 11 | ## API - Queries 12 | 13 | ### mime.lookup(path) 14 | Get the mime type associated with a file. This is method is case-insensitive. Everything in path up to and including the last '/' or '.' is ignored, so you can pass it paths, filenames, or extensions, like so: 15 | 16 | var mime = require('mime'); 17 | 18 | mime.lookup('/path/to/file.txt'); // => 'text/plain' 19 | mime.lookup('file.txt'); // => 'text/plain' 20 | mime.lookup('.txt'); // => 'text/plain' 21 | mime.lookup('htm'); // => 'text/html' 22 | 23 | ### mime.extension(type) - lookup the default extension for type 24 | 25 | mime.extension('text/html'); // => 'html' 26 | mime.extension('application/octet-stream'); // => 'bin' 27 | 28 | ### mime.charsets.lookup() - map mime-type to charset 29 | 30 | mime.charsets.lookup('text/plain'); // => 'UTF-8' 31 | 32 | (The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.) 33 | 34 | ## API - Customizing 35 | 36 | The following APIs allow you to add your own type mappings within your project. If you feel a type should be included as part of node-mime, see [requesting new types](https://github.com/bentomas/node-mime/wiki/Requesting-New-Types). 37 | ### mime.define() - Add custom mime/extension mappings 38 | 39 | mime.define({ 40 | 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'], 41 | 'application/x-my-type': ['x-mt', 'x-mtt'], 42 | // etc ... 43 | }); 44 | 45 | mime.lookup('x-sft'); // => 'text/x-some-format' 46 | mime.extension('text/x-some-format'); // => 'x-sf' 47 | 48 | ### mime.load(filepath) - Load mappings from an Apache ".types" format file 49 | 50 | mime.load('./my_project.types'); 51 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/mime/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "name": "Robert Kieffer", 4 | "url": "http://github.com/broofa", 5 | "email": "robert@broofa.com" 6 | }, 7 | "contributors": [ 8 | { 9 | "name": "Benjamin Thomas", 10 | "url": "http://github.com/bentomas", 11 | "email": "benjamin@benjaminthomas.org" 12 | } 13 | ], 14 | "dependencies": {}, 15 | "description": "A comprehensive library for mime-type mapping", 16 | "devDependencies": {"async_testing": ""}, 17 | "keywords": ["util", "mime"], 18 | "main": "mime.js", 19 | "name": "mime", 20 | "repository": {"url": "http://github.com/bentomas/node-mime", "type": "git"}, 21 | "version": "1.2.4" 22 | } 23 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/mime/types/node.types: -------------------------------------------------------------------------------- 1 | # What: Google Chrome Extension 2 | # Why: To allow apps to (work) be served with the right content type header. 3 | # http://codereview.chromium.org/2830017 4 | # Added by: niftylettuce 5 | application/x-chrome-extension crx 6 | 7 | # What: OTF Message Silencer 8 | # Why: To silence the "Resource interpreted as font but transferred with MIME 9 | # type font/otf" message that occurs in Google Chrome 10 | # Added by: niftylettuce 11 | font/opentype otf 12 | 13 | # What: HTC support 14 | # Why: To properly render .htc files such as CSS3PIE 15 | # Added by: niftylettuce 16 | text/x-component htc 17 | 18 | # What: HTML5 application cache manifest 19 | # Why: De-facto standard. Required by Mozilla browser when serving HTML5 apps 20 | # per https://developer.mozilla.org/en/offline_resources_in_firefox 21 | # Added by: louisremi 22 | text/cache-manifest appcache manifest 23 | 24 | # What: node binary buffer format 25 | # Why: semi-standard extension w/in the node community 26 | # Added by: tootallnate 27 | application/octet-stream buffer 28 | 29 | # What: The "protected" MP-4 formats used by iTunes. 30 | # Why: Required for streaming music to browsers (?) 31 | # Added by: broofa 32 | application/mp4 m4p 33 | audio/mp4 m4a 34 | 35 | # What: Music playlist format (http://en.wikipedia.org/wiki/M3U) 36 | # Why: See https://github.com/bentomas/node-mime/pull/6 37 | # Added by: mjrusso 38 | application/x-mpegURL m3u8 39 | 40 | # What: Video format, Part of RFC1890 41 | # Why: See https://github.com/bentomas/node-mime/pull/6 42 | # Added by: mjrusso 43 | video/MP2T ts 44 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/mkdirp/.gitignore.orig: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | npm-debug.log -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/mkdirp/.gitignore.rej: -------------------------------------------------------------------------------- 1 | --- /dev/null 2 | +++ .gitignore 3 | @@ -0,0 +1,2 @@ 4 | +node_modules/ 5 | +npm-debug.log -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/mkdirp/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | npm-debug.log -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/mkdirp/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2010 James Halliday (mail@substack.net) 2 | 3 | This project is free software released under the MIT/X11 license: 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/mkdirp/README.markdown: -------------------------------------------------------------------------------- 1 | mkdirp 2 | ====== 3 | 4 | Like `mkdir -p`, but in node.js! 5 | 6 | Example 7 | ======= 8 | 9 | pow.js 10 | ------ 11 | var mkdirp = require('mkdirp'); 12 | 13 | mkdirp('/tmp/foo/bar/baz', 0755, function (err) { 14 | if (err) console.error(err) 15 | else console.log('pow!') 16 | }); 17 | 18 | Output 19 | pow! 20 | 21 | And now /tmp/foo/bar/baz exists, huzzah! 22 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/mkdirp/examples/pow.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('mkdirp'); 2 | 3 | mkdirp('/tmp/foo/bar/baz', 0755, function (err) { 4 | if (err) console.error(err) 5 | else console.log('pow!') 6 | }); 7 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/mkdirp/examples/pow.js.orig: -------------------------------------------------------------------------------- 1 | var mkdirp = require('mkdirp'); 2 | 3 | mkdirp('/tmp/foo/bar/baz', 0755, function (err) { 4 | if (err) console.error(err) 5 | else console.log('pow!') 6 | }); 7 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/mkdirp/examples/pow.js.rej: -------------------------------------------------------------------------------- 1 | --- examples/pow.js 2 | +++ examples/pow.js 3 | @@ -1,6 +1,15 @@ 4 | -var mkdirp = require('mkdirp').mkdirp; 5 | +var mkdirp = require('../').mkdirp, 6 | + mkdirpSync = require('../').mkdirpSync; 7 | 8 | mkdirp('/tmp/foo/bar/baz', 0755, function (err) { 9 | if (err) console.error(err) 10 | else console.log('pow!') 11 | }); 12 | + 13 | +try { 14 | + mkdirpSync('/tmp/bar/foo/baz', 0755); 15 | + console.log('double pow!'); 16 | +} 17 | +catch (ex) { 18 | + console.log(ex); 19 | +} -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/mkdirp/index.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var fs = require('fs'); 3 | 4 | var exports = module.exports = function mkdirP (p, mode, f) { 5 | var cb = f || function () {}; 6 | p = path.resolve(p); 7 | 8 | var ps = path.normalize(p).split('/'); 9 | path.exists(p, function (exists) { 10 | if (exists) cb(null); 11 | else mkdirP(ps.slice(0,-1).join('/'), mode, function (err) { 12 | if (err && err.code !== 'EEXIST') cb(err) 13 | else fs.mkdir(p, mode, function (err) { 14 | if (err && err.code !== 'EEXIST') cb(err) 15 | else cb() 16 | }); 17 | }); 18 | }); 19 | }; 20 | exports.mkdirp = exports.mkdirP = module.exports; 21 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/mkdirp/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "mkdirp", 3 | "description" : "Recursively mkdir, like `mkdir -p`", 4 | "version" : "0.0.7", 5 | "author" : "James Halliday (http://substack.net)", 6 | "main" : "./index", 7 | "keywords" : [ 8 | "mkdir", 9 | "directory" 10 | ], 11 | "repository" : { 12 | "type" : "git", 13 | "url" : "http://github.com/substack/node-mkdirp.git" 14 | }, 15 | "scripts" : { 16 | "test" : "node node_modules/tap/bin/tap.js test/*.js" 17 | }, 18 | "devDependencies" : { 19 | "tap" : "0.0.x" 20 | }, 21 | "license" : "MIT/X11", 22 | "engines": { "node": "*" } 23 | } 24 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/mkdirp/test/mkdirp.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var test = require('tap').test; 5 | 6 | test('woo', function (t) { 7 | t.plan(2); 8 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 9 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 10 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 11 | 12 | var file = '/tmp/' + [x,y,z].join('/'); 13 | 14 | mkdirp(file, 0755, function (err) { 15 | if (err) t.fail(err); 16 | else path.exists(file, function (ex) { 17 | if (!ex) t.fail('file not created') 18 | else fs.stat(file, function (err, stat) { 19 | if (err) t.fail(err) 20 | else { 21 | t.equal(stat.mode & 0777, 0755); 22 | t.ok(stat.isDirectory(), 'target not a directory'); 23 | t.end(); 24 | } 25 | }) 26 | }) 27 | }); 28 | }); 29 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/mkdirp/test/race.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../').mkdirp; 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var test = require('tap').test; 5 | 6 | test('race', function (t) { 7 | t.plan(4); 8 | var ps = [ '', 'tmp' ]; 9 | 10 | for (var i = 0; i < 25; i++) { 11 | var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 12 | ps.push(dir); 13 | } 14 | var file = ps.join('/'); 15 | 16 | var res = 2; 17 | mk(file, function () { 18 | if (--res === 0) t.end(); 19 | }); 20 | 21 | mk(file, function () { 22 | if (--res === 0) t.end(); 23 | }); 24 | 25 | function mk (file, cb) { 26 | mkdirp(file, 0755, function (err) { 27 | if (err) t.fail(err); 28 | else path.exists(file, function (ex) { 29 | if (!ex) t.fail('file not created') 30 | else fs.stat(file, function (err, stat) { 31 | if (err) t.fail(err) 32 | else { 33 | t.equal(stat.mode & 0777, 0755); 34 | t.ok(stat.isDirectory(), 'target not a directory'); 35 | if (cb) cb(); 36 | } 37 | }) 38 | }) 39 | }); 40 | } 41 | }); 42 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/mkdirp/test/rel.js: -------------------------------------------------------------------------------- 1 | var mkdirp = require('../'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var test = require('tap').test; 5 | 6 | test('rel', function (t) { 7 | t.plan(2); 8 | var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 9 | var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 10 | var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); 11 | 12 | var cwd = process.cwd(); 13 | process.chdir('/tmp'); 14 | 15 | var file = [x,y,z].join('/'); 16 | 17 | mkdirp(file, 0755, function (err) { 18 | if (err) t.fail(err); 19 | else path.exists(file, function (ex) { 20 | if (!ex) t.fail('file not created') 21 | else fs.stat(file, function (err, stat) { 22 | if (err) t.fail(err) 23 | else { 24 | process.chdir(cwd); 25 | t.equal(stat.mode & 0777, 0755); 26 | t.ok(stat.isDirectory(), 'target not a directory'); 27 | t.end(); 28 | } 29 | }) 30 | }) 31 | }); 32 | }); 33 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/qs/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "support/expresso"] 2 | path = support/expresso 3 | url = git://github.com/visionmedia/expresso.git 4 | [submodule "support/should"] 5 | path = support/should 6 | url = git://github.com/visionmedia/should.js.git 7 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/qs/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/qs/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.6 4 | - 0.4 -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/qs/History.md: -------------------------------------------------------------------------------- 1 | 2 | 0.4.1 / 2012-01-26 3 | ================== 4 | 5 | * Fixed stringify()ing numbers. Closes #23 6 | 7 | 0.4.0 / 2011-11-21 8 | ================== 9 | 10 | * Allow parsing of an existing object (for `bodyParser()`) [jackyz] 11 | * Replaced expresso with mocha 12 | 13 | 0.3.2 / 2011-11-08 14 | ================== 15 | 16 | * Fixed global variable leak 17 | 18 | 0.3.1 / 2011-08-17 19 | ================== 20 | 21 | * Added `try/catch` around malformed uri components 22 | * Add test coverage for Array native method bleed-though 23 | 24 | 0.3.0 / 2011-07-19 25 | ================== 26 | 27 | * Allow `array[index]` and `object[property]` syntaxes [Aria Stewart] 28 | 29 | 0.2.0 / 2011-06-29 30 | ================== 31 | 32 | * Added `qs.stringify()` [Cory Forsyth] 33 | 34 | 0.1.0 / 2011-04-13 35 | ================== 36 | 37 | * Added jQuery-ish array support 38 | 39 | 0.0.7 / 2011-03-13 40 | ================== 41 | 42 | * Fixed; handle empty string and `== null` in `qs.parse()` [dmit] 43 | allows for convenient `qs.parse(url.parse(str).query)` 44 | 45 | 0.0.6 / 2011-02-14 46 | ================== 47 | 48 | * Fixed; support for implicit arrays 49 | 50 | 0.0.4 / 2011-02-09 51 | ================== 52 | 53 | * Fixed `+` as a space 54 | 55 | 0.0.3 / 2011-02-08 56 | ================== 57 | 58 | * Fixed case when right-hand value contains "]" 59 | 60 | 0.0.2 / 2011-02-07 61 | ================== 62 | 63 | * Fixed "=" presence in key 64 | 65 | 0.0.1 / 2011-02-07 66 | ================== 67 | 68 | * Initial release -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/qs/Makefile: -------------------------------------------------------------------------------- 1 | 2 | test: 3 | @./node_modules/.bin/mocha 4 | 5 | .PHONY: test -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/qs/Readme.md: -------------------------------------------------------------------------------- 1 | # node-querystring 2 | 3 | query string parser for node supporting nesting, as it was removed from `0.3.x`, so this library provides the previous and commonly desired behaviour (and twice as fast). Used by [express](http://expressjs.com), [connect](http://senchalabs.github.com/connect) and others. 4 | 5 | ## Installation 6 | 7 | $ npm install qs 8 | 9 | ## Examples 10 | 11 | ```js 12 | var qs = require('qs'); 13 | 14 | qs.parse('user[name][first]=Tobi&user[email]=tobi@learnboost.com'); 15 | // => { user: { name: { first: 'Tobi' }, email: 'tobi@learnboost.com' } } 16 | 17 | qs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }}) 18 | // => user[name]=Tobi&user[email]=tobi%40learnboost.com 19 | ``` 20 | 21 | ## Testing 22 | 23 | Install dev dependencies: 24 | 25 | $ npm install -d 26 | 27 | and execute: 28 | 29 | $ make test 30 | 31 | ## License 32 | 33 | (The MIT License) 34 | 35 | Copyright (c) 2010 TJ Holowaychuk <tj@vision-media.ca> 36 | 37 | Permission is hereby granted, free of charge, to any person obtaining 38 | a copy of this software and associated documentation files (the 39 | 'Software'), to deal in the Software without restriction, including 40 | without limitation the rights to use, copy, modify, merge, publish, 41 | distribute, sublicense, and/or sell copies of the Software, and to 42 | permit persons to whom the Software is furnished to do so, subject to 43 | the following conditions: 44 | 45 | The above copyright notice and this permission notice shall be 46 | included in all copies or substantial portions of the Software. 47 | 48 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 49 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 50 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 51 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 52 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 53 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 54 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/qs/benchmark.js: -------------------------------------------------------------------------------- 1 | 2 | var qs = require('./'); 3 | 4 | var times = 100000 5 | , start = new Date 6 | , n = times; 7 | 8 | console.log('times: %d', times); 9 | 10 | while (n--) qs.parse('foo=bar'); 11 | console.log('simple: %dms', new Date - start); 12 | 13 | var start = new Date 14 | , n = times; 15 | 16 | while (n--) qs.parse('user[name][first]=tj&user[name][last]=holowaychuk'); 17 | console.log('nested: %dms', new Date - start); -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/qs/examples.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var qs = require('./'); 7 | 8 | var obj = qs.parse('foo'); 9 | console.log(obj) 10 | 11 | var obj = qs.parse('foo=bar=baz'); 12 | console.log(obj) 13 | 14 | var obj = qs.parse('users[]'); 15 | console.log(obj) 16 | 17 | var obj = qs.parse('name=tj&email=tj@vision-media.ca'); 18 | console.log(obj) 19 | 20 | var obj = qs.parse('users[]=tj&users[]=tobi&users[]=jane'); 21 | console.log(obj) 22 | 23 | var obj = qs.parse('user[name][first]=tj&user[name][last]=holowaychuk'); 24 | console.log(obj) 25 | 26 | var obj = qs.parse('users[][name][first]=tj&users[][name][last]=holowaychuk'); 27 | console.log(obj) 28 | 29 | var obj = qs.parse('a=a&a=b&a=c'); 30 | console.log(obj) 31 | 32 | var obj = qs.parse('user[tj]=tj&user[tj]=TJ'); 33 | console.log(obj) 34 | 35 | var obj = qs.parse('user[names]=tj&user[names]=TJ&user[names]=Tyler'); 36 | console.log(obj) 37 | 38 | var obj = qs.parse('user[name][first]=tj&user[name][first]=TJ'); 39 | console.log(obj) 40 | 41 | var obj = qs.parse('user[0]=tj&user[1]=TJ'); 42 | console.log(obj) 43 | 44 | var obj = qs.parse('user[0]=tj&user[]=TJ'); 45 | console.log(obj) 46 | 47 | var obj = qs.parse('user[0]=tj&user[foo]=TJ'); 48 | console.log(obj) 49 | 50 | var str = qs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }}); 51 | console.log(str); -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/qs/index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = require('./lib/querystring'); -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/qs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "qs", 3 | "description": "querystring parser", 4 | "version": "0.4.1", 5 | "repository": { 6 | "type" : "git", 7 | "url" : "git://github.com/visionmedia/node-querystring.git" 8 | }, 9 | "devDependencies": { 10 | "mocha": "*" 11 | , "should": "*" 12 | }, 13 | "author": "TJ Holowaychuk (http://tjholowaychuk.com)", 14 | "main": "index", 15 | "engines": { "node": "*" } 16 | } -------------------------------------------------------------------------------- /test/ajax/node_modules/express/node_modules/qs/test/mocha.opts: -------------------------------------------------------------------------------- 1 | --require should 2 | --ui exports 3 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "express", 3 | "description": "Sinatra inspired web development framework", 4 | "version": "2.5.6", 5 | "author": "TJ Holowaychuk ", 6 | "contributors": [ 7 | { "name": "TJ Holowaychuk", "email": "tj@vision-media.ca" }, 8 | { "name": "Aaron Heckmann", "email": "aaron.heckmann+github@gmail.com" }, 9 | { "name": "Ciaran Jessup", "email": "ciaranj@gmail.com" }, 10 | { "name": "Guillermo Rauch", "email": "rauchg@gmail.com" } 11 | ], 12 | "dependencies": { 13 | "connect": "1.x", 14 | "mime": ">= 0.0.1", 15 | "qs": ">= 0.3.1", 16 | "mkdirp": "0.0.7" 17 | }, 18 | "devDependencies": { 19 | "connect-form": "0.2.1", 20 | "ejs": "0.4.2", 21 | "expresso": "0.9.2", 22 | "hamljs": "0.6.x", 23 | "jade": "0.16.2", 24 | "stylus": "0.13.0", 25 | "should": "0.3.2", 26 | "express-messages": "0.0.2", 27 | "node-markdown": ">= 0.0.1", 28 | "connect-redis": ">= 0.0.1" 29 | }, 30 | "keywords": ["framework", "sinatra", "web", "rest", "restful"], 31 | "repository": "git://github.com/visionmedia/express", 32 | "main": "index", 33 | "bin": { "express": "./bin/express" }, 34 | "scripts": { 35 | "test": "make test", 36 | "prepublish" : "npm prune" 37 | }, 38 | "engines": { "node": ">= 0.4.1 < 0.7.0" } 39 | } -------------------------------------------------------------------------------- /test/ajax/node_modules/express/testing/foo/app.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var express = require('express') 7 | , routes = require('./routes') 8 | 9 | var app = module.exports = express.createServer(); 10 | 11 | // Configuration 12 | 13 | app.configure(function(){ 14 | app.set('views', __dirname + '/views'); 15 | app.set('view engine', 'jade'); 16 | app.use(express.bodyParser()); 17 | app.use(express.methodOverride()); 18 | app.use(app.router); 19 | app.use(express.static(__dirname + '/public')); 20 | }); 21 | 22 | app.configure('development', function(){ 23 | app.use(express.errorHandler({ dumpExceptions: true, showStack: true })); 24 | }); 25 | 26 | app.configure('production', function(){ 27 | app.use(express.errorHandler()); 28 | }); 29 | 30 | // Routes 31 | 32 | app.get('/', routes.index); 33 | 34 | app.listen(3000); 35 | console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env); 36 | -------------------------------------------------------------------------------- /test/ajax/node_modules/express/testing/foo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "application-name" 3 | , "version": "0.0.1" 4 | , "private": true 5 | , "dependencies": { 6 | "express": "2.5.0" 7 | , "jade": ">= 0.0.1" 8 | } 9 | } -------------------------------------------------------------------------------- /test/ajax/node_modules/express/testing/foo/public/stylesheets/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding: 50px; 3 | font: 14px "Lucida Grande", Helvetica, Arial, sans-serif; 4 | } 5 | 6 | a { 7 | color: #00B7FF; 8 | } -------------------------------------------------------------------------------- /test/ajax/node_modules/express/testing/foo/routes/index.js: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * GET home page. 4 | */ 5 | 6 | exports.index = function(req, res){ 7 | res.writeHead(200); 8 | req.doesnotexist(); 9 | // res.render('index', { title: 'Express' }) 10 | }; -------------------------------------------------------------------------------- /test/ajax/node_modules/express/testing/foo/views/index.jade: -------------------------------------------------------------------------------- 1 | h1= title 2 | p Welcome to #{title} -------------------------------------------------------------------------------- /test/ajax/node_modules/express/testing/foo/views/layout.jade: -------------------------------------------------------------------------------- 1 | !!! 2 | html 3 | head 4 | title= title 5 | link(rel='stylesheet', href='/stylesheets/style.css') 6 | body!= body -------------------------------------------------------------------------------- /test/ajax/node_modules/express/testing/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var express = require('../') 7 | , http = require('http') 8 | , connect = require('connect'); 9 | 10 | var app = express.createServer(); 11 | 12 | app.get('/', function(req, res){ 13 | req.foo(); 14 | res.send('test'); 15 | }); 16 | 17 | // app.set('views', __dirname + '/views'); 18 | // app.set('view engine', 'jade'); 19 | // 20 | // app.configure(function(){ 21 | // app.use(function(req, res, next){ 22 | // debugger 23 | // res.write('first'); 24 | // console.error('first'); 25 | // next(); 26 | // }); 27 | // 28 | // app.use(app.router); 29 | // 30 | // app.use(function(req, res, next){ 31 | // console.error('last'); 32 | // res.end('last'); 33 | // }); 34 | // }); 35 | // 36 | // app.get('/', function(req, res, next){ 37 | // console.error('middle'); 38 | // res.write(' route '); 39 | // next(); 40 | // }); 41 | 42 | app.listen(3000); 43 | console.log('listening on port 3000'); -------------------------------------------------------------------------------- /test/ajax/node_modules/express/testing/views/page.html: -------------------------------------------------------------------------------- 1 | p register test -------------------------------------------------------------------------------- /test/ajax/node_modules/express/testing/views/page.jade: -------------------------------------------------------------------------------- 1 | html 2 | body 3 | h1 test -------------------------------------------------------------------------------- /test/ajax/node_modules/express/testing/views/test.md: -------------------------------------------------------------------------------- 1 | testing _some_ markdown -------------------------------------------------------------------------------- /test/ajax/node_modules/express/testing/views/user/index.jade: -------------------------------------------------------------------------------- 1 | p user page -------------------------------------------------------------------------------- /test/ajax/node_modules/express/testing/views/user/list.jade: -------------------------------------------------------------------------------- 1 | p user list page -------------------------------------------------------------------------------- /test/ajax/public/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jquip.ajax tests 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |

jquip.ajax tests

16 |

17 |

18 |
    19 | 20 | 21 | -------------------------------------------------------------------------------- /test/ajax/server.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var express = require('express'), 3 | app = express.createServer(), 4 | PORT = 8567; 5 | 6 | function echo(req,res) { 7 | res.send({ 8 | method: req.method, 9 | headers: req.headers, 10 | query: req.query, 11 | body: req.rawBody 12 | }); 13 | console.log(req.method); 14 | } 15 | app.configure(function(){ 16 | app.use(express.static(__dirname + '/../../src')); 17 | app.use(express.static(__dirname + '/public')); 18 | app.use(express.methodOverride()); 19 | app.use (function(req, res, next) { 20 | if ('GET' == req.method || 'HEAD' == req.method) return next(); 21 | req.rawBody = ''; 22 | req.setEncoding('utf8'); 23 | req.on('data', function(chunk) { req.rawBody += chunk; }); 24 | req.on('end', function() { next(); }); 25 | }); 26 | }); 27 | 28 | app.get('/echo', echo); 29 | app.put('/echo', echo); 30 | app.post('/echo', echo); 31 | app.delete('/echo', echo); 32 | 33 | app.get('/', function(req,res){ 34 | res.redirect('/test.html'); 35 | }); 36 | console.log('Listening on http://localhost:' + PORT); 37 | app.listen(PORT); 38 | 39 | -------------------------------------------------------------------------------- /test/backbone.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Backbone Test Suite 6 | 7 | 8 | 9 | 10 | 11 | 12 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
    32 |
    33 |
    34 |

    Test

    35 |
    36 |
    37 |
    38 |
    39 |

    Backbone Speed Suite

    40 |
    41 | 42 | 43 | -------------------------------------------------------------------------------- /test/phantom.coffee: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/phantomjs 2 | 3 | # Runs a Jasmine Suite from an html page 4 | # @page is a PhantomJs page object 5 | # @exit_func is the function to call in order to exit the script 6 | 7 | class PhantomJasmineRunner 8 | constructor: (@page, @exit_func = phantom.exit) -> 9 | @tries = 0 10 | @max_tries = 10 11 | 12 | get_status: -> @page.evaluate(-> consoleReporter.status) 13 | 14 | terminate: -> 15 | switch @get_status() 16 | when "success" then @exit_func 0 17 | when "fail" then @exit_func 1 18 | else @exit_func 2 19 | 20 | # Script Begin 21 | if phantom.args.length == 0 22 | console.log "Need a url as the argument" 23 | phantom.exit 1 24 | 25 | page = new WebPage() 26 | 27 | runner = new PhantomJasmineRunner(page) 28 | 29 | # Don't supress console output 30 | page.onConsoleMessage = (msg) -> 31 | console.log msg 32 | 33 | # Terminate when the reporter singals that testing is over. 34 | # We cannot use a callback function for this (because page.evaluate is sandboxed), 35 | # so we have to *observe* the website. 36 | if msg == "ConsoleReporter finished" 37 | runner.terminate() 38 | 39 | address = phantom.args[0] 40 | 41 | page.open address, (status) -> 42 | if status != "success" 43 | console.log "can't load the address!" 44 | phantom.exit 1 45 | 46 | # Now we wait until onConsoleMessage reads the termination signal from the log. 47 | -------------------------------------------------------------------------------- /test/spec/base.js: -------------------------------------------------------------------------------- 1 | (function($){ 2 | describe('jquip.base', function() { 3 | 4 | describe('jquip.each', function() { 5 | it('iterates over dom', function() { 6 | var $el = $('
    ') 7 | , concat = ""; 8 | $el.each(function(){ 9 | concat += this.getAttribute('name'); 10 | }); 11 | expect(concat).toEqual("lifeisabsurd"); 12 | }); 13 | 14 | it('iterates over dom and stops halfway', function() { 15 | var $el = $('
    ') 16 | , concat = ""; 17 | $el.each(function(){ 18 | concat += this.getAttribute('name'); 19 | return false; 20 | }); 21 | expect(concat).toEqual("life"); 22 | }); 23 | }); 24 | }); 25 | 26 | }(jquip)); 27 | -------------------------------------------------------------------------------- /test/spec/css.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | describe('jquip.toggleClass', function() { 3 | var el; 4 | beforeEach(function() { 5 | el = jquip('
    '); 6 | }); 7 | 8 | it('checks for a class', function() { 9 | expect(el.hasClass('foo')).toBe(true); 10 | expect(el.hasClass('bar')).toBe(true); 11 | }); 12 | 13 | it('returns false if missing class', function() { 14 | expect(el.hasClass('qux')).toBe(false); 15 | }); 16 | 17 | it('removes class if exists', function() { 18 | el.toggleClass('foo'); 19 | expect(el.hasClass('foo')).toBe(false); 20 | }); 21 | 22 | it('adds class if not present', function() { 23 | el.toggleClass('qux'); 24 | expect(el.hasClass('qux')).toBe(true); 25 | }); 26 | 27 | it('removes if switch is false', function() { 28 | el.toggleClass('bar', false); 29 | expect(el.hasClass('bar')).toBe(false); 30 | el.toggleClass('bar', false); 31 | expect(el.hasClass('bar')).toBe(false); 32 | }); 33 | 34 | it('adds if switch is true', function() { 35 | el.toggleClass('bar', true); 36 | expect(el.hasClass('bar')).toBe(true); 37 | 38 | el.toggleClass('zing', true); 39 | expect(el.hasClass('zing')).toBe(true); 40 | }); 41 | }); 42 | }()); 43 | -------------------------------------------------------------------------------- /test/spec/data.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | describe('jquip.data', function() { 4 | var el; 5 | beforeEach(function() { 6 | el = jquip('
    ').appendTo('body'); 7 | }); 8 | 9 | afterEach(function() { 10 | el.remove(); 11 | }); 12 | 13 | describe('data() without key', function() { 14 | 15 | it('returns undefined when no data has been set', function() { 16 | expect(el.data()).toBeUndefined(); 17 | }); 18 | 19 | it('returns object of attributes when data has been set', function() { 20 | el.data('foo', 'bar'); 21 | expect(el.data()).toEqual({foo: 'bar'}); 22 | }); 23 | 24 | }); 25 | 26 | 27 | describe('data() with key', function() { 28 | 29 | it('returns undefined when key does not exist', function() { 30 | expect(el.data('notfound')).toBeUndefined(); 31 | }); 32 | 33 | it('returns value when key does exists', function() { 34 | el.data('zing', 'bang'); 35 | expect(el.data('zing')).toBe('bang'); 36 | }); 37 | 38 | it('reads from data- attributes', function() { 39 | el.attr('data-foo', 'qux'); 40 | expect(el.data('foo')).toBe('qux'); 41 | }); 42 | 43 | it('prioritizes cached items', function() { 44 | el.attr('data-foo', 'qux'); 45 | el.data('foo', 'baz'); 46 | expect(el.data('foo')).toBe('baz'); 47 | }); 48 | 49 | it('does not add attributes', function() { 50 | el.data('pow', 'zip'); 51 | expect(el.attr('data-pow')).toBeUndefined(); 52 | }); 53 | 54 | it('returns identical values', function() { 55 | var obj = {a: 1, b: 2}; 56 | el.data('foo', obj); 57 | expect(el.data('foo')).toBe(obj); 58 | }); 59 | }); 60 | 61 | }); 62 | }()); 63 | -------------------------------------------------------------------------------- /test/spec/display.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | describe('jquip.show and jquip.hide', function() { 4 | var el; 5 | beforeEach(function() { 6 | el = jquip('
    ').appendTo('body'); 7 | }); 8 | 9 | afterEach(function() { 10 | el.remove(); 11 | }); 12 | 13 | it('sets display none on hiding', function() { 14 | el.hide(); 15 | expect(el.css('display')).toBe('none'); 16 | }); 17 | 18 | it('sets display back to block on show', function() { 19 | el.hide(); 20 | el.show(); 21 | expect(el.css('display')).toBe('block'); 22 | }); 23 | 24 | it('sets display back to previous value if set', function() { 25 | el.css('display', 'inline-block'); 26 | el.hide(); 27 | el.show(); 28 | expect(el.css('display')).toBe('inline-block'); 29 | }); 30 | 31 | it('toggles display', function() { 32 | el.toggle(); 33 | expect(el.css('display')).toBe('none'); 34 | el.toggle(); 35 | expect(el.css('display')).toBe('block'); 36 | }); 37 | 38 | it('keeps display after being hidden twice', function() { 39 | el.css('display', 'inline-block'); 40 | el.hide(); 41 | el.hide(); 42 | expect(el.css('display')).toBe('none'); 43 | el.show(); 44 | expect(el.css('display')).toBe('inline-block'); 45 | }); 46 | }); 47 | }()); 48 | -------------------------------------------------------------------------------- /test/spec/fragments.js: -------------------------------------------------------------------------------- 1 | (function($){ 2 | describe('jquip.fragments', function() { 3 | it('creates a single node', function() { 4 | var node = $(''); 5 | expect(node.length).toBe(1); 6 | expect(node[0].nodeName).toBe('A'); 7 | }); 8 | 9 | it('creates multiple nodes', function() { 10 | var frag = $(''); 11 | expect(frag.length).toBe(2); 12 | }); 13 | 14 | it('creates node with an attribute hash', function() { 15 | var node = $('', { href: 'http://example.com/' }); 16 | expect(node.length).toBe(1); 17 | expect(node[0].href).toEqual('http://example.com/'); 18 | }); 19 | 20 | }); 21 | }(jquip)); 22 | -------------------------------------------------------------------------------- /test/spec/helpers.js: -------------------------------------------------------------------------------- 1 | (function($){ 2 | describe('jquip.helpers', function() { 3 | describe('jquip.trim', function() { 4 | it('trims on the left', function() { 5 | expect($.trim(' whoa')).toBe('whoa'); 6 | }); 7 | 8 | it('trims on the right', function() { 9 | expect($.trim('dude ')).toBe('dude'); 10 | }); 11 | 12 | it('trims both sides', function() { 13 | expect($.trim(' spaced ')).toBe('spaced'); 14 | }); 15 | 16 | it('trims non-strings', function() { 17 | expect($.trim(42)).toBe('42'); 18 | }); 19 | 20 | it('returns empty string on undefined', function() { 21 | expect($.trim(undefined)).toBe(''); 22 | }); 23 | }); 24 | }); 25 | }(jquip)); 26 | -------------------------------------------------------------------------------- /test/spec/wrap.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | describe('jquip.wrap', function() { 3 | var el; 4 | beforeEach(function() { 5 | outer = jquip('

    wrap me

    ').appendTo('body'); 6 | el = outer.find('.wrap'); 7 | }); 8 | 9 | afterEach(function() { 10 | outer.remove(); 11 | }); 12 | 13 | it('should wrap node', function() { 14 | el.wrap('') 15 | expect(el.parent()[0].nodeName).toEqual('SPAN'); 16 | }); 17 | 18 | it('should wrap detached node', function() { 19 | var detached = $('
    '); 20 | detached.wrap(''); 21 | expect(detached.parent()[0].nodeName).toEqual('SPAN'); 22 | }); 23 | 24 | it('should wrap text node', function() { 25 | var text = el.contents(); 26 | expect(text.wrap("")[0]).toBe(text[0]); 27 | expect(el.find('span').text()).toEqual('wrap me'); 28 | }); 29 | 30 | it('should wrap detached text node', function() { 31 | var text = el.contents(); 32 | text.remove(); 33 | expect(el.text()).toBe(''); 34 | 35 | text.wrap(""); 36 | expect(text.parent().text()).toEqual('wrap me'); 37 | }); 38 | 39 | it('wraps multiple nodes', function() { 40 | var list = $('
    • 1
    • 2
    ').appendTo('body'); 41 | list.find('li').contents().wrap(''); 42 | expect(list.find('b').length).toBe(2); 43 | 44 | list.remove(); 45 | }); 46 | }); 47 | describe('jquip.clone', function() { 48 | 49 | it('creates a copy', function() { 50 | var els = jquip('
    12
    ').find('i'); 51 | var clones = els.clone(); 52 | clones.html('x') 53 | 54 | expect(els[0].innerHTML).toBe('1') 55 | expect(els[1].innerHTML).toBe('2') 56 | 57 | expect(clones[0].innerHTML).toBe('x') 58 | expect(clones[1].innerHTML).toBe('x') 59 | }); 60 | }); 61 | }()); 62 | -------------------------------------------------------------------------------- /test/spine/ajax.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Jasmine Test Runner 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 20 | 21 | -------------------------------------------------------------------------------- /test/spine/index-jquip-closure-advanced.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Jasmine Test Runner 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 27 | 28 | -------------------------------------------------------------------------------- /test/spine/index-jquip.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Jasmine Test Runner 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 29 | 30 | -------------------------------------------------------------------------------- /test/spine/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Jasmine Test Runner 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 27 | 28 | -------------------------------------------------------------------------------- /test/spine/lib/MIT.LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2008-2010 Pivotal Labs 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /test/spine/lib/list.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var $; 3 | var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) { 4 | for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } 5 | function ctor() { this.constructor = child; } 6 | ctor.prototype = parent.prototype; 7 | child.prototype = new ctor; 8 | child.__super__ = parent.prototype; 9 | return child; 10 | }; 11 | if (typeof Spine === "undefined" || Spine === null) { 12 | Spine = require('spine'); 13 | } 14 | $ = Spine.$; 15 | Spine.List = (function() { 16 | __extends(List, Spine.Controller); 17 | List.prototype.events = { 18 | 'click .item': 'click' 19 | }; 20 | List.prototype.selectFirst = false; 21 | function List() { 22 | this.change = __bind(this.change, this); List.__super__.constructor.apply(this, arguments); 23 | this.bind('change', this.change); 24 | } 25 | List.prototype.template = function() { 26 | return arguments[0]; 27 | }; 28 | List.prototype.change = function(item) { 29 | if (!item) { 30 | return; 31 | } 32 | this.current = item; 33 | this.children().removeClass('active'); 34 | return this.children().forItem(this.current).addClass('active'); 35 | }; 36 | List.prototype.render = function(items) { 37 | if (items) { 38 | this.items = items; 39 | } 40 | this.html(this.template(this.items)); 41 | this.change(this.current); 42 | if (this.selectFirst) { 43 | if (!this.children('.active').length) { 44 | return this.children(':first').click(); 45 | } 46 | } 47 | }; 48 | List.prototype.children = function(sel) { 49 | return this.el.children(sel); 50 | }; 51 | List.prototype.click = function(e) { 52 | var item; 53 | item = $(e.currentTarget).item(); 54 | this.trigger('change', item); 55 | return false; 56 | }; 57 | return List; 58 | })(); 59 | if (typeof module !== "undefined" && module !== null) { 60 | module.exports = Spine.List; 61 | } 62 | }).call(this); 63 | -------------------------------------------------------------------------------- /test/spine/lib/local.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | if (typeof Spine === "undefined" || Spine === null) { 3 | Spine = require('spine'); 4 | } 5 | Spine.Model.Local = { 6 | extended: function() { 7 | this.change(this.saveLocal); 8 | return this.fetch(this.loadLocal); 9 | }, 10 | saveLocal: function() { 11 | var result; 12 | result = JSON.stringify(this); 13 | return localStorage[this.className] = result; 14 | }, 15 | loadLocal: function() { 16 | var result; 17 | result = localStorage[this.className]; 18 | return this.refresh(result || [], { 19 | clear: true 20 | }); 21 | } 22 | }; 23 | if (typeof module !== "undefined" && module !== null) { 24 | module.exports = Spine.Model.Local; 25 | } 26 | }).call(this); 27 | -------------------------------------------------------------------------------- /test/spine/lib/tabs.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var $; 3 | var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) { 4 | for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } 5 | function ctor() { this.constructor = child; } 6 | ctor.prototype = parent.prototype; 7 | child.prototype = new ctor; 8 | child.__super__ = parent.prototype; 9 | return child; 10 | }; 11 | if (typeof Spine === "undefined" || Spine === null) { 12 | Spine = require('spine'); 13 | } 14 | $ = Spine.$; 15 | Spine.Tabs = (function() { 16 | __extends(Tabs, Spine.Controller); 17 | Tabs.prototype.events = { 18 | 'click [data-name]': 'click' 19 | }; 20 | function Tabs() { 21 | this.change = __bind(this.change, this); Tabs.__super__.constructor.apply(this, arguments); 22 | this.bind('change', this.change); 23 | } 24 | Tabs.prototype.change = function(name) { 25 | if (!name) { 26 | return; 27 | } 28 | this.current = name; 29 | this.children().removeClass('active'); 30 | return this.children("[data-name=" + this.current).addClass('active'); 31 | }; 32 | Tabs.prototype.render = function() { 33 | this.change(this.current); 34 | if (!(this.children('.active').length || this.current)) { 35 | return this.children(':first').click(); 36 | } 37 | }; 38 | Tabs.prototype.children = function(sel) { 39 | return this.el.children(sel); 40 | }; 41 | Tabs.prototype.click = function(e) { 42 | var name; 43 | name = $(e.currentTarget).attr('data-name'); 44 | return this.trigger('change', name); 45 | }; 46 | Tabs.prototype.connect = function(tabName, controller) { 47 | return this.bind('change', function(name) { 48 | if (name === tabName) { 49 | return controller.active(); 50 | } 51 | }); 52 | }; 53 | return Tabs; 54 | })(); 55 | if (typeof module !== "undefined" && module !== null) { 56 | module.exports = Spine.Tabs; 57 | } 58 | }).call(this); 59 | -------------------------------------------------------------------------------- /test/spine/lib/tmpl.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var $; 3 | $ = typeof jQuery !== "undefined" && jQuery !== null ? jQuery : require("jqueryify"); 4 | $.fn.item = function() { 5 | var item; 6 | item = $(this); 7 | item = item.data("item") || (typeof item.tmplItem === "function" ? item.tmplItem().data : void 0); 8 | return item != null ? typeof item.reload === "function" ? item.reload() : void 0 : void 0; 9 | }; 10 | $.fn.forItem = function(item) { 11 | return this.filter(function() { 12 | var compare; 13 | compare = $(this).item(); 14 | return (typeof item.eql === "function" ? item.eql(compare) : void 0) || item === compare; 15 | }); 16 | }; 17 | }).call(this); 18 | -------------------------------------------------------------------------------- /test/spine/manager.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Jasmine Test Runner 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 20 | 21 | -------------------------------------------------------------------------------- /test/spine/route.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Jasmine Test Runner 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 21 | 22 | -------------------------------------------------------------------------------- /test/spine/specs/class.js: -------------------------------------------------------------------------------- 1 | describe("Class", function(){ 2 | var User; 3 | 4 | beforeEach(function(){ 5 | User = Spine.Class.create(); 6 | }); 7 | 8 | it("is sane", function(){ 9 | expect(Spine).toBeTruthy(); 10 | }); 11 | 12 | it("can create subclasses", function(){ 13 | User.extend({classProperty: true}); 14 | 15 | var Friend = User.create(); 16 | expect(Friend).toBeTruthy(); 17 | expect(Friend.classProperty).toBeTruthy(); 18 | }); 19 | 20 | it("can create instance", function(){ 21 | User.include({instanceProperty: true}) 22 | 23 | var Bob = new User(); 24 | expect(Bob).toBeTruthy(); 25 | expect(Bob.instanceProperty).toBeTruthy(); 26 | }); 27 | 28 | it("can be extendable", function(){ 29 | User.extend({ 30 | classProperty: true 31 | }); 32 | 33 | expect(User.classProperty).toBeTruthy(); 34 | }); 35 | 36 | it("can be includable", function(){ 37 | User.include({ 38 | instanceProperty: true 39 | }); 40 | 41 | expect(User.prototype.instanceProperty).toBeTruthy(); 42 | expect((new User).instanceProperty).toBeTruthy(); 43 | }); 44 | 45 | it("should trigger module callbacks", function(){ 46 | var module = { 47 | included: function(){}, 48 | extended: function(){} 49 | }; 50 | 51 | spyOn(module, "included"); 52 | User.include(module); 53 | expect(module.included).toHaveBeenCalled(); 54 | 55 | spyOn(module, "extended"); 56 | User.extend(module); 57 | expect(module.extended).toHaveBeenCalled(); 58 | }); 59 | 60 | it("include/extend should raise without arguments", function(){ 61 | expect(function(){ User.include(); }).toThrow(); 62 | expect(function(){ User.extend(); }).toThrow(); 63 | }) 64 | }); -------------------------------------------------------------------------------- /test/spine/specs/model.local.js: -------------------------------------------------------------------------------- 1 | describe("Model.Local", function(){ 2 | var User; 3 | 4 | beforeEach(function(){ 5 | User = Spine.Model.setup("User", ["name"]); 6 | }); 7 | 8 | it("should persist attributes", function(){ 9 | User.extend(Spine.Model.Local); 10 | User.create({name: "Bob"}); 11 | User.fetch(); 12 | 13 | expect(User.first()).toBeTruthy(); 14 | expect(User.first().name).toEqual("Bob"); 15 | }); 16 | }); -------------------------------------------------------------------------------- /test/spine/specs/model.relation.js: -------------------------------------------------------------------------------- 1 | describe("Model.Relation", function(){ 2 | var Album; 3 | var Photo; 4 | 5 | beforeEach(function(){ 6 | Album = Spine.Model.setup("Album", ["name"]); 7 | Photo = Spine.Model.setup("Photo", ["name"]); 8 | }); 9 | 10 | it("should honour hasMany associations", function(){ 11 | Album.hasMany("photos", Photo); 12 | Photo.belongsTo("album", Album); 13 | 14 | var album = Album.create(); 15 | 16 | expect( album.photos() ).toBeTruthy(); 17 | expect( album.photos().all() ).toEqual([]); 18 | 19 | album.photos().create({name: "First Photo"}); 20 | 21 | expect( Photo.first() ).toBeTruthy(); 22 | expect( Photo.first().name ).toBe("First Photo"); 23 | expect( Photo.first().album_id ).toBe(album.id); 24 | }); 25 | 26 | it("should honour belongsTo associations", function(){ 27 | Album.hasMany("photos", Photo); 28 | Photo.belongsTo("album", Album); 29 | 30 | expect(Photo.attributes).toEqual(["name", "album_id"]); 31 | 32 | var album = Album.create({name: "First Album"}); 33 | var photo = Photo.create({album: album}); 34 | 35 | expect( photo.album() ).toBeTruthy(); 36 | expect( photo.album().name ).toBe("First Album"); 37 | }); 38 | }); --------------------------------------------------------------------------------