├── version.json ├── Procfile ├── deployed.json ├── public ├── test │ └── lol.txt ├── components │ ├── chai │ │ ├── test │ │ │ ├── auth │ │ │ │ └── .gitkeep │ │ │ ├── mocha.opts │ │ │ ├── display │ │ │ │ ├── errors.js │ │ │ │ └── message.js │ │ │ ├── globalShould.js │ │ │ ├── bootstrap │ │ │ │ └── index.js │ │ │ ├── plugins.js │ │ │ ├── browser │ │ │ │ ├── sauce.html │ │ │ │ ├── index.html │ │ │ │ └── component.html │ │ │ └── configuration.js │ │ ├── index.js │ │ ├── .mailmap │ │ ├── .travis.yml │ │ ├── .npmignore │ │ ├── .gitignore │ │ ├── lib │ │ │ ├── chai │ │ │ │ ├── interface │ │ │ │ │ └── expect.js │ │ │ │ ├── utils │ │ │ │ │ ├── getName.js │ │ │ │ │ ├── getActual.js │ │ │ │ │ ├── test.js │ │ │ │ │ ├── getEnumerableProperties.js │ │ │ │ │ ├── flag.js │ │ │ │ │ ├── getProperties.js │ │ │ │ │ ├── addMethod.js │ │ │ │ │ ├── addProperty.js │ │ │ │ │ ├── type.js │ │ │ │ │ ├── objDisplay.js │ │ │ │ │ ├── getMessage.js │ │ │ │ │ ├── transferFlags.js │ │ │ │ │ ├── overwriteMethod.js │ │ │ │ │ ├── overwriteProperty.js │ │ │ │ │ └── index.js │ │ │ │ └── error.js │ │ │ └── chai.js │ │ └── package.json │ ├── mocha │ │ ├── lib │ │ │ ├── browser │ │ │ │ ├── fs.js │ │ │ │ ├── path.js │ │ │ │ ├── debug.js │ │ │ │ └── tty.js │ │ │ ├── interfaces │ │ │ │ ├── index.js │ │ │ │ └── exports.js │ │ │ ├── reporters │ │ │ │ ├── templates │ │ │ │ │ ├── menu.jade │ │ │ │ │ ├── script.html │ │ │ │ │ └── coverage.jade │ │ │ │ ├── index.js │ │ │ │ ├── min.js │ │ │ │ ├── html-cov.js │ │ │ │ ├── json-stream.js │ │ │ │ ├── doc.js │ │ │ │ ├── json.js │ │ │ │ ├── dot.js │ │ │ │ ├── list.js │ │ │ │ ├── tap.js │ │ │ │ └── teamcity.js │ │ │ ├── template.html │ │ │ ├── hook.js │ │ │ └── context.js │ │ ├── support │ │ │ ├── foot.js │ │ │ └── head.js │ │ ├── test │ │ │ ├── acceptance │ │ │ │ ├── test.foo │ │ │ │ ├── pending.js │ │ │ │ ├── test.coffee │ │ │ │ ├── fixtures │ │ │ │ │ ├── css.in │ │ │ │ │ └── css.out │ │ │ │ ├── misc │ │ │ │ │ ├── asyncOnly.js │ │ │ │ │ ├── nontty.js │ │ │ │ │ ├── grep.js │ │ │ │ │ ├── bail.js │ │ │ │ │ └── cascade.js │ │ │ │ ├── root.js │ │ │ │ ├── multiple.done.js │ │ │ │ ├── http.js │ │ │ │ ├── uncaught.js │ │ │ │ ├── fs.js │ │ │ │ ├── timeout.js │ │ │ │ ├── interfaces │ │ │ │ │ ├── qunit.js │ │ │ │ │ ├── bdd.js │ │ │ │ │ ├── tdd.js │ │ │ │ │ └── exports.js │ │ │ │ ├── duration.js │ │ │ │ ├── context.js │ │ │ │ ├── diffs.js │ │ │ │ └── globals.js │ │ │ ├── browser │ │ │ │ ├── opts.js │ │ │ │ ├── large.html │ │ │ │ ├── large.js │ │ │ │ ├── opts.html │ │ │ │ ├── index.html │ │ │ │ └── array.js │ │ │ ├── mocha.opts │ │ │ ├── hook.timeout.js │ │ │ ├── compiler │ │ │ │ └── foo.js │ │ │ ├── jsapi │ │ │ │ └── index.js │ │ │ ├── http.meta.js │ │ │ ├── grep.js │ │ │ ├── hook.sync.nested.js │ │ │ └── hook.sync.js │ │ ├── .travis.yml │ │ ├── .npmignore │ │ ├── images │ │ │ ├── ok.png │ │ │ └── error.png │ │ ├── index.js │ │ ├── .gitignore │ │ ├── editors │ │ │ └── JavaScript mocha.tmbundle │ │ │ │ ├── Snippets │ │ │ │ ├── tdd - assert.tmSnippet │ │ │ │ ├── tdd - assert_fail.tmSnippet │ │ │ │ ├── bdd - after.tmSnippet │ │ │ │ ├── bdd - before.tmSnippet │ │ │ │ ├── tdd - assert_equal.tmSnippet │ │ │ │ ├── bdd - it.tmSnippet │ │ │ │ ├── tdd - setup.tmSnippet │ │ │ │ ├── tdd - test.tmSnippet │ │ │ │ ├── tdd - assert_deepEqual.tmSnippet │ │ │ │ ├── tdd - assert_isFunction.tmSnippet │ │ │ │ ├── tdd - suite.tmSnippet │ │ │ │ ├── bdd - after each.tmSnippet │ │ │ │ ├── bdd - before each.tmSnippet │ │ │ │ ├── bdd - describe.tmSnippet │ │ │ │ └── tdd - teardown.tmSnippet │ │ │ │ └── info.plist │ │ ├── package.json │ │ ├── LICENSE │ │ └── bin │ │ │ └── mocha │ ├── q │ │ ├── .coverignore │ │ ├── .travis.yml │ │ ├── .mailmap │ │ ├── q.min.js.gz │ │ ├── .gitignore │ │ ├── component.json │ │ ├── examples │ │ │ ├── delay.js │ │ │ ├── all.js │ │ │ └── async-generators │ │ │ │ ├── 4-shim.html │ │ │ │ ├── 3-wishful-thinking.html │ │ │ │ ├── 1-return.html │ │ │ │ ├── 2-error-propagation.html │ │ │ │ └── 0.html │ │ ├── .npmignore │ │ ├── spec │ │ │ ├── aplus-adapter.js │ │ │ ├── lib │ │ │ │ ├── jasmine-promise.js │ │ │ │ └── jasmine-1.2.0 │ │ │ │ │ └── MIT.LICENSE │ │ │ └── q-spec.html │ │ ├── .jshintrc │ │ ├── design │ │ │ ├── q0.js │ │ │ ├── q1.js │ │ │ ├── q3.js │ │ │ ├── q2.js │ │ │ ├── q4.js │ │ │ └── q5.js │ │ ├── VERSIONS.md │ │ ├── queue.js │ │ ├── LICENSE │ │ └── ref_send.md │ ├── sinon │ │ ├── .gitignore │ │ ├── test │ │ │ ├── resources │ │ │ │ └── xhr_target.txt │ │ │ ├── node │ │ │ │ └── run.js │ │ │ └── rhino │ │ │ │ └── run.js │ │ ├── .travis.yml │ │ ├── component.json │ │ ├── release.sh │ │ ├── lib │ │ │ └── sinon │ │ │ │ └── util │ │ │ │ ├── xhr_ie.js │ │ │ │ └── timers_ie.js │ │ ├── package.json │ │ ├── jsl.conf │ │ ├── AUTHORS │ │ └── LICENSE │ ├── underscore │ │ ├── CNAME │ │ ├── .gitignore │ │ ├── .npmignore │ │ ├── index.js │ │ ├── .travis.yml │ │ ├── favicon.ico │ │ ├── docs │ │ │ ├── favicon.ico │ │ │ └── images │ │ │ │ ├── background.png │ │ │ │ └── underscore.png │ │ ├── component.json │ │ ├── Rakefile │ │ ├── CONTRIBUTING.md │ │ ├── package.json │ │ ├── LICENSE │ │ ├── README.md │ │ └── test │ │ │ └── index.html │ ├── eventEmitter │ │ ├── tools │ │ │ ├── server.sh │ │ │ ├── deps.sh │ │ │ ├── doc.sh │ │ │ └── dist.sh │ │ ├── .gitignore │ │ ├── .gitmodules │ │ ├── tests │ │ │ └── index.html │ │ ├── docs │ │ │ ├── api.dust │ │ │ └── render.js │ │ └── EventEmitter.min.js │ └── qunit │ │ └── component.json ├── thaiWitter.png └── thaiWitter │ ├── icns.png │ ├── favicon.ico │ ├── startup.png │ ├── touch-icon.png │ ├── fb-page.html │ └── custom-css.html ├── resources ├── version.json ├── deployed.json ├── assets │ ├── thaiWitterAsset1.js.gz │ └── thaiWitterAsset1.css.gz ├── error-template.html └── configuration.json ├── test ├── fixtures │ └── asset-processor │ │ ├── file1.js │ │ ├── file2.js │ │ ├── test.js │ │ ├── error.er │ │ ├── translator.th │ │ ├── aggregate4.ag │ │ ├── aggregate.ag │ │ ├── aggregate2.ag │ │ └── aggregate3.ag ├── mocha.opts ├── setup.js └── text-conformance-test.coffee ├── .bowerrc ├── lib ├── thaijs │ ├── index.js │ └── package.json ├── error.js ├── middleware │ ├── error-handler.js │ ├── main-server.js │ ├── api-loader.js │ ├── asset-server.js │ ├── main-page-server.js │ └── dev-file-server.js ├── processors │ └── script-aggregator.js ├── powered.js └── stats.js ├── .gitignore ├── docs └── images │ ├── screenshot1.png │ ├── screenshot2.png │ ├── screenshot3.png │ ├── screenshot4.png │ └── screenshot5.png ├── style ├── inline-graphics │ ├── delete.png │ ├── facebook.png │ ├── geolocation.png │ ├── facebook-favicon.png │ ├── delete.js │ ├── facebook.js │ └── geolocation.js └── compass │ ├── config.rb │ └── scss │ ├── _bottombuttons.scss │ ├── _splashnoti.scss │ ├── _select.scss │ ├── _upic.scss │ ├── _dialog.scss │ └── _hardcore.scss ├── bin ├── cp_vendor ├── client_unit_test └── gen-regex.js ├── Makefile ├── component.json ├── features ├── home_page.feature └── step_definitions │ └── browser_steps.rb ├── client ├── main.ag ├── T │ ├── Y.js │ ├── request.js │ ├── task.js │ ├── future.js │ ├── date.js │ ├── T.js │ └── events.js ├── test │ ├── spec_helper.coffee │ ├── request_spec.coffee │ ├── Y_spec.coffee │ ├── future_spec.coffee │ └── date_spec.coffee ├── conf │ ├── config.js │ └── twitter-config.js ├── vendor │ └── EventEmitter.min.js └── lib │ └── twcs.js ├── views └── error.hjs └── package.json /version.json: -------------------------------------------------------------------------------- 1 | "3.1.2" 2 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: node server.js 2 | -------------------------------------------------------------------------------- /deployed.json: -------------------------------------------------------------------------------- 1 | 1360336159000 2 | -------------------------------------------------------------------------------- /public/test/lol.txt: -------------------------------------------------------------------------------- 1 | lol!!! 2 | -------------------------------------------------------------------------------- /resources/version.json: -------------------------------------------------------------------------------- 1 | "3.0.10*" 2 | -------------------------------------------------------------------------------- /public/components/chai/test/auth/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/components/mocha/lib/browser/fs.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/components/mocha/lib/browser/path.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/components/q/.coverignore: -------------------------------------------------------------------------------- 1 | spec/ 2 | -------------------------------------------------------------------------------- /resources/deployed.json: -------------------------------------------------------------------------------- 1 | 1355411016491 2 | -------------------------------------------------------------------------------- /public/components/mocha/support/foot.js: -------------------------------------------------------------------------------- 1 | })(); -------------------------------------------------------------------------------- /test/fixtures/asset-processor/file1.js: -------------------------------------------------------------------------------- 1 | file1 2 | -------------------------------------------------------------------------------- /test/fixtures/asset-processor/file2.js: -------------------------------------------------------------------------------- 1 | hahaha 2 | -------------------------------------------------------------------------------- /test/fixtures/asset-processor/test.js: -------------------------------------------------------------------------------- 1 | hello world 2 | -------------------------------------------------------------------------------- /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "public/components" 3 | } 4 | -------------------------------------------------------------------------------- /public/components/mocha/support/head.js: -------------------------------------------------------------------------------- 1 | ;(function(){ 2 | -------------------------------------------------------------------------------- /public/components/mocha/test/acceptance/test.foo: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /public/components/sinon/.gitignore: -------------------------------------------------------------------------------- 1 | pkg 2 | node_modules -------------------------------------------------------------------------------- /public/components/underscore/CNAME: -------------------------------------------------------------------------------- 1 | underscorejs.org 2 | -------------------------------------------------------------------------------- /test/fixtures/asset-processor/error.er: -------------------------------------------------------------------------------- 1 | this is an error 2 | -------------------------------------------------------------------------------- /test/fixtures/asset-processor/translator.th: -------------------------------------------------------------------------------- 1 | hello world 2 | -------------------------------------------------------------------------------- /lib/thaijs/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./lib/thaiJS'); 2 | -------------------------------------------------------------------------------- /public/components/underscore/.gitignore: -------------------------------------------------------------------------------- 1 | raw 2 | node_modules 3 | -------------------------------------------------------------------------------- /test/fixtures/asset-processor/aggregate4.ag: -------------------------------------------------------------------------------- 1 | [ "nonexistant.js" ] 2 | -------------------------------------------------------------------------------- /test/fixtures/asset-processor/aggregate.ag: -------------------------------------------------------------------------------- 1 | [ "file1.js", "file2.js" ] 2 | -------------------------------------------------------------------------------- /public/components/chai/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./lib/chai'); 2 | -------------------------------------------------------------------------------- /public/components/sinon/test/resources/xhr_target.txt: -------------------------------------------------------------------------------- 1 | loaded successfully 2 | -------------------------------------------------------------------------------- /public/components/chai/.mailmap: -------------------------------------------------------------------------------- 1 | Domenic Denicola 2 | -------------------------------------------------------------------------------- /public/components/sinon/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.6 4 | -------------------------------------------------------------------------------- /public/components/underscore/.npmignore: -------------------------------------------------------------------------------- 1 | test/ 2 | Rakefile 3 | docs/ 4 | raw/ 5 | -------------------------------------------------------------------------------- /public/components/underscore/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./underscore'); 2 | -------------------------------------------------------------------------------- /test/fixtures/asset-processor/aggregate2.ag: -------------------------------------------------------------------------------- 1 | [ "file2.js", "translator.js" ] 2 | -------------------------------------------------------------------------------- /test/fixtures/asset-processor/aggregate3.ag: -------------------------------------------------------------------------------- 1 | [ "aggregate2.js", "aggregate.js" ] 2 | -------------------------------------------------------------------------------- /public/components/eventEmitter/tools/server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | python -m SimpleHTTPServer -------------------------------------------------------------------------------- /test/mocha.opts: -------------------------------------------------------------------------------- 1 | --compilers coffee:coffee-script 2 | -r ./test/setup 3 | -R spec 4 | -------------------------------------------------------------------------------- /public/components/q/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.6 4 | - 0.8 5 | -------------------------------------------------------------------------------- /public/components/chai/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.8 4 | - 0.10 5 | -------------------------------------------------------------------------------- /public/components/mocha/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.8 4 | - 0.10 5 | -------------------------------------------------------------------------------- /public/thaiWitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtinth/thaiWitter3/HEAD/public/thaiWitter.png -------------------------------------------------------------------------------- /public/components/chai/test/mocha.opts: -------------------------------------------------------------------------------- 1 | --require ./test/bootstrap/ 2 | --ui tdd 3 | --reporter dot 4 | -------------------------------------------------------------------------------- /public/components/mocha/.npmignore: -------------------------------------------------------------------------------- 1 | test 2 | examples 3 | *.sock 4 | lib-cov 5 | editors 6 | support 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | node_modules 3 | tw-dev 4 | npm-debug.log 5 | .DS_Store 6 | .sass-cache 7 | .env 8 | -------------------------------------------------------------------------------- /docs/images/screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtinth/thaiWitter3/HEAD/docs/images/screenshot1.png -------------------------------------------------------------------------------- /docs/images/screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtinth/thaiWitter3/HEAD/docs/images/screenshot2.png -------------------------------------------------------------------------------- /docs/images/screenshot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtinth/thaiWitter3/HEAD/docs/images/screenshot3.png -------------------------------------------------------------------------------- /docs/images/screenshot4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtinth/thaiWitter3/HEAD/docs/images/screenshot4.png -------------------------------------------------------------------------------- /docs/images/screenshot5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtinth/thaiWitter3/HEAD/docs/images/screenshot5.png -------------------------------------------------------------------------------- /public/components/eventEmitter/.gitignore: -------------------------------------------------------------------------------- 1 | /docs/data.json 2 | /docs/api.dust.js 3 | /node_modules/ 4 | /dist/ -------------------------------------------------------------------------------- /public/thaiWitter/icns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtinth/thaiWitter3/HEAD/public/thaiWitter/icns.png -------------------------------------------------------------------------------- /public/thaiWitter/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtinth/thaiWitter3/HEAD/public/thaiWitter/favicon.ico -------------------------------------------------------------------------------- /public/thaiWitter/startup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtinth/thaiWitter3/HEAD/public/thaiWitter/startup.png -------------------------------------------------------------------------------- /public/components/q/.mailmap: -------------------------------------------------------------------------------- 1 | Domenic Denicola 2 | Kris Kowal 3 | -------------------------------------------------------------------------------- /public/components/q/q.min.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtinth/thaiWitter3/HEAD/public/components/q/q.min.js.gz -------------------------------------------------------------------------------- /public/thaiWitter/touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtinth/thaiWitter3/HEAD/public/thaiWitter/touch-icon.png -------------------------------------------------------------------------------- /style/inline-graphics/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtinth/thaiWitter3/HEAD/style/inline-graphics/delete.png -------------------------------------------------------------------------------- /public/components/mocha/test/acceptance/pending.js: -------------------------------------------------------------------------------- 1 | 2 | describe('pending', function(){ 3 | it('should be allowed') 4 | }) -------------------------------------------------------------------------------- /style/inline-graphics/facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtinth/thaiWitter3/HEAD/style/inline-graphics/facebook.png -------------------------------------------------------------------------------- /public/components/mocha/images/ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtinth/thaiWitter3/HEAD/public/components/mocha/images/ok.png -------------------------------------------------------------------------------- /public/components/mocha/lib/browser/debug.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = function(type){ 3 | return function(){ 4 | } 5 | }; 6 | -------------------------------------------------------------------------------- /public/components/underscore/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.8 4 | notifications: 5 | email: false 6 | -------------------------------------------------------------------------------- /style/inline-graphics/geolocation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtinth/thaiWitter3/HEAD/style/inline-graphics/geolocation.png -------------------------------------------------------------------------------- /resources/assets/thaiWitterAsset1.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtinth/thaiWitter3/HEAD/resources/assets/thaiWitterAsset1.js.gz -------------------------------------------------------------------------------- /public/components/mocha/images/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtinth/thaiWitter3/HEAD/public/components/mocha/images/error.png -------------------------------------------------------------------------------- /public/components/mocha/index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = process.env.COV 3 | ? require('./lib-cov/mocha') 4 | : require('./lib/mocha'); -------------------------------------------------------------------------------- /public/components/underscore/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtinth/thaiWitter3/HEAD/public/components/underscore/favicon.ico -------------------------------------------------------------------------------- /resources/assets/thaiWitterAsset1.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtinth/thaiWitter3/HEAD/resources/assets/thaiWitterAsset1.css.gz -------------------------------------------------------------------------------- /style/inline-graphics/facebook-favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtinth/thaiWitter3/HEAD/style/inline-graphics/facebook-favicon.png -------------------------------------------------------------------------------- /lib/thaijs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "thaijs", 3 | "version": "0.0.1", 4 | "dependencies": { 5 | "coffee-script": "1.1.1" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /public/components/eventEmitter/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "tests/jasmine"] 2 | path = tests/jasmine 3 | url = git://github.com/pivotal/jasmine.git 4 | -------------------------------------------------------------------------------- /public/components/underscore/docs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtinth/thaiWitter3/HEAD/public/components/underscore/docs/favicon.ico -------------------------------------------------------------------------------- /lib/error.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = function error(message, status) { 3 | var err = new Error(message) 4 | if (status) err.status = status 5 | return err 6 | } 7 | -------------------------------------------------------------------------------- /public/components/underscore/docs/images/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtinth/thaiWitter3/HEAD/public/components/underscore/docs/images/background.png -------------------------------------------------------------------------------- /public/components/underscore/docs/images/underscore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtinth/thaiWitter3/HEAD/public/components/underscore/docs/images/underscore.png -------------------------------------------------------------------------------- /public/components/mocha/test/acceptance/test.coffee: -------------------------------------------------------------------------------- 1 | 2 | obj = foo: 'bar' 3 | 4 | describe 'coffeescript', -> 5 | it 'should work', -> 6 | obj.should.eql foo: 'bar' -------------------------------------------------------------------------------- /public/components/q/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | npm-debug.log 3 | CHANGES.html 4 | README.html 5 | .tmp 6 | 7 | .coverage_data/ 8 | .coverage_debug/ 9 | cover_html/ 10 | -------------------------------------------------------------------------------- /public/components/mocha/test/browser/opts.js: -------------------------------------------------------------------------------- 1 | describe('Options', function() { 2 | it('should set timeout value', function() { 3 | assert(this.test._timeout === 1500); 4 | }); 5 | }) 6 | -------------------------------------------------------------------------------- /public/components/mocha/test/mocha.opts: -------------------------------------------------------------------------------- 1 | --require should 2 | --reporter dot 3 | --ui bdd 4 | --globals okGlobalA,okGlobalB 5 | --globals okGlobalC 6 | --globals callback* 7 | --timeout 200 8 | -------------------------------------------------------------------------------- /public/components/q/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "q", 3 | "version": "0.8.12", 4 | "repository": { 5 | "type": "git", 6 | "url": "git://github.com/kriskowal/q.git" 7 | } 8 | } -------------------------------------------------------------------------------- /public/components/mocha/test/hook.timeout.js: -------------------------------------------------------------------------------- 1 | 2 | before(function(done){ 3 | this.timeout(100); 4 | setTimeout(done, 50); 5 | }) 6 | 7 | it('should work', function(done) { 8 | done(); 9 | }); -------------------------------------------------------------------------------- /public/components/eventEmitter/tools/deps.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Git submodules 4 | git submodule update --init 5 | 6 | # NPM packages 7 | npm install dox dustjs-linkedin requirejs uglify-js@2.2.0 -------------------------------------------------------------------------------- /public/components/mocha/lib/browser/tty.js: -------------------------------------------------------------------------------- 1 | 2 | exports.isatty = function(){ 3 | return true; 4 | }; 5 | 6 | exports.getWindowSize = function(){ 7 | return [window.innerHeight, window.innerWidth]; 8 | }; -------------------------------------------------------------------------------- /public/components/mocha/lib/interfaces/index.js: -------------------------------------------------------------------------------- 1 | 2 | exports.bdd = require('./bdd'); 3 | exports.tdd = require('./tdd'); 4 | exports.qunit = require('./qunit'); 5 | exports.exports = require('./exports'); 6 | -------------------------------------------------------------------------------- /public/components/sinon/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sinon", 3 | "version": "1.5.2", 4 | "repository": { 5 | "type": "git", 6 | "url": "git://github.com/cjohansen/Sinon.JS.git" 7 | } 8 | } -------------------------------------------------------------------------------- /public/components/eventEmitter/tools/doc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | node_modules/.bin/dox < EventEmitter.js > docs/data.json 3 | node_modules/.bin/dustc --name=api docs/api.dust docs/api.dust.js 4 | node docs/render.js -------------------------------------------------------------------------------- /public/components/mocha/test/acceptance/fixtures/css.in: -------------------------------------------------------------------------------- 1 | body { 2 | font: "Helvetica Neue", Helvetica, arial, sans-serif; 3 | background: black; 4 | color: white; 5 | } 6 | 7 | a { 8 | color: blue 9 | } -------------------------------------------------------------------------------- /public/components/underscore/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "underscore", 3 | "version": "1.4.4", 4 | "repository": { 5 | "type": "git", 6 | "url": "git://github.com/documentcloud/underscore.git" 7 | } 8 | } -------------------------------------------------------------------------------- /public/components/mocha/.gitignore: -------------------------------------------------------------------------------- 1 | coverage.html 2 | lib-cov 3 | .DS_Store 4 | node_modules 5 | *.sock 6 | testing 7 | _mocha.js 8 | test.js 9 | my-reporter.js 10 | *.sw* 11 | lib/browser/diff.js 12 | .idea 13 | *.iml 14 | -------------------------------------------------------------------------------- /public/components/chai/.npmignore: -------------------------------------------------------------------------------- 1 | .git* 2 | docs/ 3 | test/ 4 | support/ 5 | component.json 6 | components/ 7 | build/ 8 | lib-cov/ 9 | coverage.html 10 | .travis.yml 11 | .mailmap 12 | Makefile 13 | *.swp 14 | .DS_Store 15 | -------------------------------------------------------------------------------- /public/components/mocha/test/acceptance/misc/asyncOnly.js: -------------------------------------------------------------------------------- 1 | 2 | describe('asyncOnly', function(){ 3 | it('should display an error', function(){ 4 | 5 | }) 6 | 7 | it('should pass', function(done){ 8 | done(); 9 | }) 10 | }) 11 | -------------------------------------------------------------------------------- /public/components/eventEmitter/tools/dist.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | node_modules/.bin/uglifyjs\ 3 | --comments\ 4 | --mangle sort=true\ 5 | --compress\ 6 | --output EventEmitter.min.js EventEmitter.js 7 | cp EventEmitter.min.js dist/EventEmitter-${1-dev}.min.js -------------------------------------------------------------------------------- /public/components/mocha/test/acceptance/misc/nontty.js: -------------------------------------------------------------------------------- 1 | 2 | describe('tests for non-tty', function(){ 3 | it('should pass', function(){ 4 | 5 | }) 6 | 7 | it('should fail', function(){ 8 | throw new Error('oh noes') 9 | }) 10 | }) 11 | -------------------------------------------------------------------------------- /public/components/mocha/test/acceptance/fixtures/css.out: -------------------------------------------------------------------------------- 1 | body { 2 | font: "Helvetica Neue", Helvetica, arial, sans-serif; 3 | background: black; 4 | color: #fff; 5 | } 6 | 7 | a { 8 | color: blue; 9 | } 10 | 11 | foo { 12 | bar: 'baz'; 13 | } -------------------------------------------------------------------------------- /bin/cp_vendor: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cp public/components/q/q.min.js client/vendor/q.min.js 4 | cp public/components/eventEmitter/EventEmitter.min.js client/vendor/EventEmitter.min.js 5 | cp public/components/underscore/underscore-min.js client/vendor/underscore-min.js 6 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | 2 | 3 | all : config deploy 4 | 5 | config : 6 | echo 'TWITTER_CONFIG=' > client/twitter-config.js 7 | curl https://api.twitter.com/1/help/configuration.json >> client/twitter-config.js 8 | 9 | deploy : 10 | date '+%s000' > deployed.json 11 | 12 | 13 | -------------------------------------------------------------------------------- /public/components/mocha/test/acceptance/root.js: -------------------------------------------------------------------------------- 1 | 2 | var calls = []; 3 | 4 | before(function(){ 5 | calls.push('before'); 6 | }) 7 | 8 | describe('root', function(){ 9 | it('should be a valid suite', function(){ 10 | calls.should.eql(['before']); 11 | }) 12 | }) -------------------------------------------------------------------------------- /bin/client_unit_test: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export PORT=65432 4 | NODE_ENV=production node server.js & 5 | PID=$! 6 | URL="http://localhost:$PORT/test/index.html" 7 | echo "$URL" 8 | node_modules/.bin/mocha-phantomjs "$URL" 9 | STATUS=$? 10 | kill -INT $PID 11 | exit $STATUS 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /public/components/chai/.gitignore: -------------------------------------------------------------------------------- 1 | lib-cov 2 | *.seed 3 | *.log 4 | *.csv 5 | *.dat 6 | *.out 7 | *.pid 8 | *.gz 9 | 10 | pids 11 | logs 12 | results 13 | build 14 | components 15 | 16 | node_modules 17 | npm-debug.log 18 | 19 | coverage.html 20 | 21 | test/auth/* 22 | !test/auth/.gitkeep 23 | -------------------------------------------------------------------------------- /component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tw3", 3 | "version": "0.0.0", 4 | "dependencies": { 5 | "underscore": "~1.4.4", 6 | "q": "~0.8.12", 7 | "eventEmitter": "~4.0.5", 8 | "qunit": "~1.10.0", 9 | "sinon": "~1.5.2", 10 | "mocha": "~1.9.0", 11 | "chai": "~1.6.0" 12 | } 13 | } -------------------------------------------------------------------------------- /features/home_page.feature: -------------------------------------------------------------------------------- 1 | 2 | 3 | Feature: Home Page 4 | 5 | Scenario: User goes to home page 6 | When I go to home page 7 | Then I should see a link to thaiWitter 8 | And I should see a link to thaiWitterDownload 9 | And I should see a link to twitter.com/dtinth 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /public/components/underscore/Rakefile: -------------------------------------------------------------------------------- 1 | desc "Use Uglify JS to compress Underscore.js" 2 | task :build do 3 | sh "uglifyjs underscore.js -c \"evaluate=false\" -m -o underscore-min.js" 4 | end 5 | 6 | desc "Build the docco documentation" 7 | task :doc do 8 | sh "docco underscore.js" 9 | end 10 | 11 | -------------------------------------------------------------------------------- /public/components/q/examples/delay.js: -------------------------------------------------------------------------------- 1 | 2 | var Q = require("q"); 3 | 4 | var delay = function (delay) { 5 | var d = Q.defer(); 6 | setTimeout(d.resolve, delay); 7 | return d.promise; 8 | }; 9 | 10 | Q.when(delay(1000), function () { 11 | console.log('Hello, World!'); 12 | }); 13 | 14 | -------------------------------------------------------------------------------- /public/components/chai/test/display/errors.js: -------------------------------------------------------------------------------- 1 | if (!chai) 2 | var chai = require('../..'); 3 | 4 | var expect = chai.expect; 5 | 6 | chai.Assertion.includeStack = true; 7 | 8 | suite('error display', function () { 9 | 10 | test('show error line', function () { 11 | expect(4).to.equal(2); 12 | }); 13 | 14 | }); 15 | -------------------------------------------------------------------------------- /public/components/chai/lib/chai/interface/expect.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * chai 3 | * Copyright(c) 2011-2013 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | module.exports = function (chai, util) { 8 | chai.expect = function (val, message) { 9 | return new chai.Assertion(val, message); 10 | }; 11 | }; 12 | 13 | -------------------------------------------------------------------------------- /lib/middleware/error-handler.js: -------------------------------------------------------------------------------- 1 | 2 | var fs = require('fs'); 3 | 4 | module.exports = function thaiWitterErrorHandler() { 5 | return function(err, req, res, next) { 6 | res.status(err.status || 500) 7 | res.render('error', { text: err + '' }) 8 | console.log(err) 9 | if (err && err.stack) console.log(err.stack) 10 | }; 11 | }; 12 | -------------------------------------------------------------------------------- /public/components/mocha/test/compiler/foo.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | require.extensions['.foo'] = function(module, filename) { 3 | var content; 4 | content = fs.readFileSync(filename, 'utf8'); 5 | var test = 'describe("custom compiler",function(){ it("should work",function() { ' 6 | + content + '.should.eql(1); }); });'; 7 | return module._compile(test, filename); 8 | }; 9 | -------------------------------------------------------------------------------- /public/components/q/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | npm-debug.log 3 | CHANGES.html 4 | README.html 5 | 6 | .coverage_data/ 7 | .coverage_debug/ 8 | .tmp 9 | cover_html/ 10 | 11 | design 12 | examples 13 | spec 14 | .coverignore 15 | .jshintrc 16 | .mailmap 17 | .npmignore 18 | .travis.yml 19 | CHANGES.md 20 | LICENSE 21 | VERSIONS.md 22 | q.min.js 23 | q.min.js.gz 24 | ref_send.md 25 | -------------------------------------------------------------------------------- /public/components/mocha/test/acceptance/multiple.done.js: -------------------------------------------------------------------------------- 1 | 2 | describe('multiple calls to done()', function(){ 3 | beforeEach(function(done){ 4 | done() 5 | // uncomment 6 | // done() 7 | }) 8 | 9 | it('should fail in a test-case', function(done){ 10 | process.nextTick(function(){ 11 | done(); 12 | // uncomment 13 | // done(); 14 | }); 15 | }) 16 | }) -------------------------------------------------------------------------------- /public/components/q/spec/aplus-adapter.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var Q = require("../q"); 4 | 5 | exports.fulfilled = Q.resolve; 6 | exports.rejected = Q.reject; 7 | exports.pending = function () { 8 | var deferred = Q.defer(); 9 | 10 | return { 11 | promise: deferred.promise, 12 | fulfill: deferred.resolve, 13 | reject: deferred.reject 14 | }; 15 | }; 16 | -------------------------------------------------------------------------------- /client/main.ag: -------------------------------------------------------------------------------- 1 | [ 2 | "conf/config.js", 3 | "conf/twitter-config.js", 4 | "conf/regex.js", 5 | "lib/dtjs2.js", 6 | "lib/twcs.js", 7 | "vendor/underscore-min.js", 8 | "vendor/q.min.js", 9 | "T/Y.js", 10 | "T/T.js", 11 | "T/twitter-regex.js", 12 | "T/future.js", 13 | "T/date.js", 14 | "T/text.js", 15 | "js/js.js", 16 | "js/mixin-media-preview.js", 17 | "js/mixin-autocomplete.js" 18 | ] 19 | -------------------------------------------------------------------------------- /test/setup.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | require('mocha-as-promised')() 4 | require('js-yaml') 5 | 6 | var chai = require('chai') 7 | , chaiAsPromised = require('chai-as-promised') 8 | , sinon = require('sinon') 9 | , sinonChai = require('sinon-chai') 10 | 11 | global.sinon = sinon 12 | global.Q = require('q') 13 | global.expect = chai.expect 14 | chai.use(chaiAsPromised) 15 | chai.use(sinonChai) 16 | chai.should() 17 | -------------------------------------------------------------------------------- /public/components/chai/test/globalShould.js: -------------------------------------------------------------------------------- 1 | suite('global should', function () { 2 | test('works', function () { 3 | var theGlobal = typeof window !== 'undefined' 4 | ? window 5 | : global; 6 | 7 | theGlobal.globalShould = chai.should(); 8 | 9 | try { 10 | globalShould.not.exist(undefined); 11 | } finally { 12 | delete theGlobal.globalShould; 13 | } 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /public/components/q/examples/all.js: -------------------------------------------------------------------------------- 1 | 2 | var Q = require("../q"); 3 | 4 | var eventually = function (eventually) { 5 | return Q.delay(eventually, 1000); 6 | }; 7 | 8 | var x = Q.all([1, 2, 3].map(eventually)); 9 | Q.when(x, function (x) { 10 | console.log(x); 11 | }); 12 | 13 | Q.all([ 14 | eventually(10), 15 | eventually(20) 16 | ]) 17 | .spread(function (x, y) { 18 | console.log(x, y); 19 | }); 20 | 21 | -------------------------------------------------------------------------------- /style/compass/config.rb: -------------------------------------------------------------------------------- 1 | # Require any additional compass plugins here. 2 | # Set this to the root of your project when deployed: 3 | http_path = "/" 4 | css_dir = "../../client/css" 5 | sass_dir = "scss" 6 | images_dir = ".." 7 | javascripts_dir = "javascripts" 8 | output_style = :nested 9 | line_comments = false 10 | # To enable relative paths to assets via compass helper functions. Uncomment: 11 | relative_assets = true 12 | -------------------------------------------------------------------------------- /client/T/Y.js: -------------------------------------------------------------------------------- 1 | 2 | var Y = {} 3 | 4 | Y.get = function(name) { 5 | return function(subject) { 6 | return subject[name] 7 | } 8 | } 9 | 10 | Y.isNull = function(f) { 11 | return function(subject) { 12 | return f(subject) == null 13 | } 14 | } 15 | 16 | Y.not = function(f) { 17 | return function(subject) { 18 | return !f(subject) 19 | } 20 | } 21 | 22 | Y.notNull = function(f) { 23 | return Y.not(Y.isNull(f)) 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /public/components/mocha/test/acceptance/http.js: -------------------------------------------------------------------------------- 1 | 2 | var http = require('http'); 3 | 4 | var server = http.createServer(function(req, res){ 5 | res.end('Hello World\n'); 6 | }) 7 | 8 | server.listen(8888); 9 | 10 | describe('http', function(){ 11 | it('should provide an example', function(done){ 12 | http.get({ path: '/', port: 8888 }, function(res){ 13 | res.should.have.status(200); 14 | done(); 15 | }) 16 | }) 17 | }) -------------------------------------------------------------------------------- /lib/middleware/main-server.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | module.exports = function mainServer(resources, powered, version) { 4 | var locals = Object.create(resources) 5 | locals.powered = powered 6 | locals.version = version 7 | return function(req, res, next) { 8 | if (req.path == '/thaiWitter') { 9 | res.redirect('/thaiWitter/') 10 | return 11 | } 12 | if (req.path != '/thaiWitter/') return next() 13 | res.render('template', locals) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /style/inline-graphics/delete.js: -------------------------------------------------------------------------------- 1 | 2 | var w, h; 3 | w = h = 16; 4 | 5 | newFile(w, h); 6 | ctx.fillStyle = 'white'; 7 | ctx.strokeStyle = 'white'; 8 | ctx.lineWidth = 2; 9 | 10 | var inset = 4; 11 | ctx.beginPath(); 12 | ctx.moveTo(inset, inset); 13 | ctx.lineTo(w - inset, h - inset); 14 | ctx.stroke(); 15 | 16 | ctx.beginPath(); 17 | ctx.moveTo(w - inset, inset); 18 | ctx.lineTo(inset, h - inset); 19 | ctx.stroke(); 20 | 21 | saveFile('delete'); 22 | -------------------------------------------------------------------------------- /public/components/mocha/test/acceptance/uncaught.js: -------------------------------------------------------------------------------- 1 | 2 | describe('uncaught', function(){ 3 | beforeEach(function(done){ 4 | process.nextTick(function(){ 5 | // throw new Error('oh noes'); 6 | done(); 7 | }); 8 | }) 9 | 10 | it('should report properly', function(done){ 11 | process.nextTick(function(){ 12 | // if you uncomment this :) 13 | // throw new Error("I'm uncaught!"); 14 | done(); 15 | }) 16 | }) 17 | }) -------------------------------------------------------------------------------- /public/components/qunit/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "qunit", 3 | "version": "1.10.0", 4 | "main": [ 5 | "./qunit.js", 6 | "./qunit.css" 7 | ], 8 | "gitHead": "c34f18a5e81b72c2f1706a8ea1d22cd5dc898279", 9 | "_id": "qunit@1.10.0", 10 | "readme": "ERROR: No README.md file found!", 11 | "description": "ERROR: No README.md file found!", 12 | "repository": { 13 | "type": "git", 14 | "url": "git://github.com/components/qunit.git" 15 | } 16 | } -------------------------------------------------------------------------------- /public/components/q/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "browser": true, 3 | "node": true, 4 | 5 | "curly": true, 6 | "eqeqeq": true, 7 | "noarg": true, 8 | "nonew": true, 9 | "trailing": true, 10 | "undef": true, 11 | 12 | "globals": { 13 | "bootstrap": false, 14 | "cajaVM": false, 15 | "define": false, 16 | "Q": true, 17 | "ReturnValue": false, 18 | "ses": false, 19 | "setImmediate": false 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /views/error.hjs: -------------------------------------------------------------------------------- 1 | 2 | ?!? 3 | 6 |

{{ text }}

~ SRSLY, thaiWitter ~
7 | -------------------------------------------------------------------------------- /public/components/mocha/test/acceptance/misc/grep.js: -------------------------------------------------------------------------------- 1 | 2 | describe('grep', function(){ 3 | describe('fast', function(){ 4 | it('should run fast', function(){ 5 | 6 | }) 7 | 8 | it('should run fast again', function(){ 9 | 10 | }) 11 | }) 12 | 13 | describe('slow', function(){ 14 | it('should run slow', function(done){ 15 | setTimeout(done, 1000); 16 | }) 17 | 18 | it('should run slow again', function(done){ 19 | setTimeout(done, 1000); 20 | }) 21 | }) 22 | }) 23 | -------------------------------------------------------------------------------- /resources/error-template.html: -------------------------------------------------------------------------------- 1 | 2 | ?!? 3 | 6 |

TEXT

~ SRSLY, thaiWitter ~
7 | -------------------------------------------------------------------------------- /public/components/mocha/test/acceptance/misc/bail.js: -------------------------------------------------------------------------------- 1 | 2 | describe('bail', function(){ 3 | it('should only display this error', function(done){ 4 | throw new Error('this should be displayed'); 5 | }) 6 | 7 | it('should not display this error', function(done){ 8 | throw new Error('this should not be displayed'); 9 | }) 10 | }) 11 | 12 | describe('bail-2', function(){ 13 | it('should not display this error', function(done){ 14 | throw new Error('this should not be displayed'); 15 | }) 16 | }) 17 | -------------------------------------------------------------------------------- /public/components/sinon/release.sh: -------------------------------------------------------------------------------- 1 | git push 2 | git push --tags 3 | npm publish 4 | rm -f pkg/* 5 | ruby -rubygems build 6 | cp pkg/* ../sinon-web/releases/. 7 | cp Changelog.txt ../sinon-web/. 8 | cd ../sinon-web 9 | sed -i "s/2012\-[0-9][0-9]\-[0-9][0-9] \-/`date +%Y`-`date +%m`-`date +%d` -/" index.html 10 | sed -i "s/2012\-[0-9][0-9]\-[0-9][0-9] \-/`date +%Y`-`date +%m`-`date +%d` -/" qunit/index.html 11 | sed -i "s/$1/$2/g" index.html 12 | sed -i "s/$1/$2/g" qunit/index.html 13 | sed -i "s/$1/$2/g" docs/index.html 14 | -------------------------------------------------------------------------------- /public/components/mocha/lib/reporters/templates/menu.jade: -------------------------------------------------------------------------------- 1 | #menu 2 | li 3 | a(href='#overview') overview 4 | for file in cov.files 5 | li 6 | span.cov(class=coverageClass(file.coverage)) #{file.coverage | 0} 7 | a(href='##{file.filename}') 8 | segments = file.filename.split('/') 9 | basename = segments.pop() 10 | if segments.length 11 | span.dirname= segments.join('/') + '/' 12 | span.basename= basename 13 | a#logo(href='http://visionmedia.github.com/mocha/') m -------------------------------------------------------------------------------- /public/components/mocha/test/acceptance/fs.js: -------------------------------------------------------------------------------- 1 | 2 | var fs = require('fs'); 3 | 4 | describe('fs.readFile()', function(){ 5 | describe('when the file exists', function(){ 6 | it('should succeed', function(done){ 7 | fs.writeFile('/tmp/mocha', 'wahoo', done) 8 | }) 9 | }) 10 | 11 | describe('when the file does not exist', function(){ 12 | it('should fail', function(done){ 13 | // uncomment 14 | // fs.readFile('/tmp/does-not-exist', done); 15 | done(); 16 | }) 17 | }) 18 | }) 19 | -------------------------------------------------------------------------------- /public/components/mocha/test/acceptance/timeout.js: -------------------------------------------------------------------------------- 1 | 2 | describe('timeouts', function(){ 3 | beforeEach(function(done){ 4 | // uncomment 5 | // setTimeout(done, 3000); 6 | done(); 7 | }) 8 | 9 | it('should error on timeout', function(done){ 10 | // uncomment 11 | // setTimeout(done, 3000); 12 | done(); 13 | }) 14 | 15 | it('should allow overriding per-test', function(done){ 16 | this.timeout(1000); 17 | setTimeout(function(){ 18 | done(); 19 | }, 300); 20 | }) 21 | }) 22 | -------------------------------------------------------------------------------- /public/components/mocha/test/acceptance/interfaces/qunit.js: -------------------------------------------------------------------------------- 1 | 2 | function ok(expr, msg) { 3 | if (!expr) throw new Error(msg); 4 | } 5 | 6 | suite('Array'); 7 | 8 | test('#length', function(){ 9 | var arr = [1,2,3]; 10 | ok(arr.length == 3); 11 | }); 12 | 13 | test('#indexOf()', function(){ 14 | var arr = [1,2,3]; 15 | ok(arr.indexOf(1) == 0); 16 | ok(arr.indexOf(2) == 1); 17 | ok(arr.indexOf(3) == 2); 18 | }); 19 | 20 | suite('String'); 21 | 22 | test('#length', function(){ 23 | ok('foo'.length == 3); 24 | }); -------------------------------------------------------------------------------- /public/components/chai/lib/chai/utils/getName.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Chai - getName utility 3 | * Copyright(c) 2012-2013 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | /** 8 | * # getName(func) 9 | * 10 | * Gets the name of a function, in a cross-browser way. 11 | * 12 | * @param {Function} a function (usually a constructor) 13 | */ 14 | 15 | module.exports = function (func) { 16 | if (func.name) return func.name; 17 | 18 | var match = /^\s?function ([^(]*)\(/.exec(func); 19 | return match && match[1] ? match[1] : ""; 20 | }; 21 | -------------------------------------------------------------------------------- /public/components/chai/lib/chai/utils/getActual.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Chai - getActual utility 3 | * Copyright(c) 2012-2013 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | /** 8 | * # getActual(object, [actual]) 9 | * 10 | * Returns the `actual` value for an Assertion 11 | * 12 | * @param {Object} object (constructed Assertion) 13 | * @param {Arguments} chai.Assertion.prototype.assert arguments 14 | */ 15 | 16 | module.exports = function (obj, args) { 17 | var actual = args[4]; 18 | return 'undefined' !== typeof actual ? actual : obj._obj; 19 | }; 20 | -------------------------------------------------------------------------------- /public/components/mocha/lib/template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Mocha 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /public/components/mocha/editors/JavaScript mocha.tmbundle/Snippets/tdd - assert.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | assert($0); 7 | name 8 | tdd - assert 9 | scope 10 | source.js 11 | tabTrigger 12 | as 13 | uuid 14 | 9D920EC2-6A72-4108-B5A0-591AFA61C740 15 | 16 | 17 | -------------------------------------------------------------------------------- /lib/middleware/api-loader.js: -------------------------------------------------------------------------------- 1 | 2 | var fs = require('fs'); 3 | 4 | module.exports = function handlerLoaderMiddleware() { 5 | return function(req, res, next) { 6 | runHandlerLoader(req, res, next); 7 | } 8 | }; 9 | 10 | function runHandlerLoader(req, res, next) { 11 | fs.readFile(__dirname + '/api.js', 'utf-8', function(err, data) { 12 | if (err) return next(err); 13 | try { 14 | execModule(data)()(req, res, next); 15 | } catch (e) { 16 | return next(e); 17 | } 18 | }); 19 | }; 20 | 21 | function execModule() { 22 | var module = {}; 23 | eval(arguments[0]); 24 | return module.exports; 25 | } 26 | -------------------------------------------------------------------------------- /public/components/mocha/editors/JavaScript mocha.tmbundle/Snippets/tdd - assert_fail.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | assert.fail($0); 7 | name 8 | tdd - assert.fail 9 | scope 10 | source.js 11 | tabTrigger 12 | fail 13 | uuid 14 | 11756F3A-5F08-445C-B5B6-30605838BC6F 15 | 16 | 17 | -------------------------------------------------------------------------------- /public/components/mocha/editors/JavaScript mocha.tmbundle/Snippets/bdd - after.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | after(function(){ 7 | $0 8 | }) 9 | name 10 | bdd - after 11 | scope 12 | source.js 13 | tabTrigger 14 | a 15 | uuid 16 | A49A87F9-399E-4D74-A489-C535BB06D487 17 | 18 | 19 | -------------------------------------------------------------------------------- /public/components/mocha/editors/JavaScript mocha.tmbundle/Snippets/bdd - before.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | before(function(){ 7 | $0 8 | }) 9 | name 10 | bdd - before 11 | scope 12 | source.js 13 | tabTrigger 14 | b 15 | uuid 16 | DF6F1F42-F80A-4A24-AF78-376F19070C4C 17 | 18 | 19 | -------------------------------------------------------------------------------- /public/components/mocha/editors/JavaScript mocha.tmbundle/Snippets/tdd - assert_equal.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | assert.equal($1, $2); 7 | name 8 | tdd - assert.equal 9 | scope 10 | source.js 11 | tabTrigger 12 | eq 13 | uuid 14 | 4868D5C0-075D-44A8-B41B-A14E8350C0F8 15 | 16 | 17 | -------------------------------------------------------------------------------- /public/components/mocha/editors/JavaScript mocha.tmbundle/Snippets/bdd - it.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | it('should $1', function(){ 7 | $0 8 | }) 9 | name 10 | bdd - it 11 | scope 12 | source.js 13 | tabTrigger 14 | it 15 | uuid 16 | 591AE071-95E4-4E1E-B0F3-A7DAF41595EE 17 | 18 | 19 | -------------------------------------------------------------------------------- /public/components/mocha/editors/JavaScript mocha.tmbundle/Snippets/tdd - setup.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | setup(function() { 7 | $0 8 | }); 9 | name 10 | tdd - setup 11 | scope 12 | source.js 13 | tabTrigger 14 | setup 15 | uuid 16 | DCEE796A-900D-4922-BAF0-39C9B91A15E1 17 | 18 | 19 | -------------------------------------------------------------------------------- /public/components/mocha/editors/JavaScript mocha.tmbundle/Snippets/tdd - test.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | test('$1', function() { 7 | $0 8 | }); 9 | name 10 | tdd - test 11 | scope 12 | source.js 13 | tabTrigger 14 | test 15 | uuid 16 | F6E3DF27-3458-4ADD-91A3-B6EF11E1D81E 17 | 18 | 19 | -------------------------------------------------------------------------------- /public/thaiWitter/fb-page.html: -------------------------------------------------------------------------------- 1 | Facebook API Handler 2 | 3 | 4 |

hold on a sec

5 | 18 | -------------------------------------------------------------------------------- /public/components/eventEmitter/tests/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Jasmine Spec Runner 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /public/components/mocha/editors/JavaScript mocha.tmbundle/Snippets/tdd - assert_deepEqual.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | assert.deepEqual($1, $2); 7 | name 8 | tdd - assert.deepEqual 9 | scope 10 | source.js 11 | tabTrigger 12 | deq 13 | uuid 14 | 7D21FF16-E2E1-46BB-AD6B-82AD767A0822 15 | 16 | 17 | -------------------------------------------------------------------------------- /public/components/mocha/editors/JavaScript mocha.tmbundle/Snippets/tdd - assert_isFunction.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | assert.isFunction($0); 7 | name 8 | tdd - assert.isFunction 9 | scope 10 | source.js 11 | tabTrigger 12 | isf 13 | uuid 14 | 83DFFD36-2C46-4C92-8950-64665D32DC8E 15 | 16 | 17 | -------------------------------------------------------------------------------- /public/components/mocha/editors/JavaScript mocha.tmbundle/Snippets/tdd - suite.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | suite('$1', function() { 7 | $0 8 | }); 9 | name 10 | tdd - suite 11 | scope 12 | source.js 13 | tabTrigger 14 | suite 15 | uuid 16 | 2E65C1BE-A568-4868-95BF-E8C958EA5BA5 17 | 18 | 19 | -------------------------------------------------------------------------------- /public/components/mocha/editors/JavaScript mocha.tmbundle/Snippets/bdd - after each.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | afterEach(function(){ 7 | $0 8 | }) 9 | name 10 | bdd - after each 11 | scope 12 | source.js 13 | tabTrigger 14 | ae 15 | uuid 16 | 7B4DA8F4-2064-468B-B252-054148419B4B 17 | 18 | 19 | -------------------------------------------------------------------------------- /public/components/mocha/editors/JavaScript mocha.tmbundle/Snippets/bdd - before each.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | beforeEach(function(){ 7 | $0 8 | }) 9 | name 10 | bdd - before each 11 | scope 12 | source.js 13 | tabTrigger 14 | be 15 | uuid 16 | 7AB064E3-EFBB-4FA7-98CA-9E87C10CC04E 17 | 18 | 19 | -------------------------------------------------------------------------------- /public/components/mocha/editors/JavaScript mocha.tmbundle/Snippets/bdd - describe.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | describe('$1', function(){ 7 | $0 8 | }) 9 | name 10 | bdd - describe 11 | scope 12 | source.js 13 | tabTrigger 14 | des 15 | uuid 16 | 4AA1FB50-9BB9-400E-A140-D61C39BDFDF5 17 | 18 | 19 | -------------------------------------------------------------------------------- /public/components/mocha/editors/JavaScript mocha.tmbundle/Snippets/tdd - teardown.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | teardown(function() { 7 | $0 8 | }); 9 | name 10 | tdd - teardown 11 | scope 12 | source.js 13 | tabTrigger 14 | teardown 15 | uuid 16 | 9472B167-BEC1-45FD-BA1C-68A99961D8FF 17 | 18 | 19 | -------------------------------------------------------------------------------- /client/T/request.js: -------------------------------------------------------------------------------- 1 | 2 | T.request = function(url) { 3 | 4 | var r = { 5 | url: url, 6 | method: 'GET' 7 | }; 8 | 9 | r.send = function() { 10 | return T.request.send(r) 11 | }; 12 | 13 | return r; 14 | 15 | }; 16 | 17 | T.request.send = function(opt) { 18 | return T.future(function(resolver) { 19 | var xh = new XMLHttpRequest(); 20 | xh.open('GET', opt.url, true); 21 | xh.onreadystatechange = function() { 22 | if (xh.readyState != 4) return; 23 | if (xh.status == 200) { 24 | resolver.resolve(xh); 25 | } else { 26 | resolver.reject(xh); 27 | } 28 | }; 29 | xh.send(''); 30 | }); 31 | }; 32 | 33 | -------------------------------------------------------------------------------- /public/components/chai/test/bootstrap/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Attach chai to global should 3 | */ 4 | 5 | global.chai = (process && process.env && process.env.CHAI_COV) 6 | ? require('../../lib-cov/chai') 7 | : require('../..'); 8 | 9 | /*! 10 | * Provide check for fail function. 11 | */ 12 | 13 | global.err = function (fn, msg) { 14 | try { 15 | fn(); 16 | throw new chai.AssertionError({ message: 'Expected an error' }); 17 | } catch (err) { 18 | if ('string' === typeof msg) { 19 | chai.expect(err.message).to.equal(msg); 20 | } else { 21 | chai.expect(err.message).to.match(msg); 22 | } 23 | } 24 | }; 25 | -------------------------------------------------------------------------------- /public/components/q/design/q0.js: -------------------------------------------------------------------------------- 1 | 2 | var defer = function () { 3 | var pending = [], value; 4 | return { 5 | resolve: function (_value) { 6 | value = _value; 7 | for (var i = 0, ii = pending.length; i < ii; i++) { 8 | var callback = pending[i]; 9 | callback(value); 10 | } 11 | pending = undefined; 12 | }, 13 | then: function (callback) { 14 | if (pending) { 15 | pending.push(callback); 16 | } else { 17 | callback(value); 18 | } 19 | } 20 | } 21 | }; 22 | 23 | -------------------------------------------------------------------------------- /public/components/chai/lib/chai/utils/test.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Chai - test utility 3 | * Copyright(c) 2012-2013 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | /*! 8 | * Module dependancies 9 | */ 10 | 11 | var flag = require('./flag'); 12 | 13 | /** 14 | * # test(object, expression) 15 | * 16 | * Test and object for expression. 17 | * 18 | * @param {Object} object (constructed Assertion) 19 | * @param {Arguments} chai.Assertion.prototype.assert arguments 20 | */ 21 | 22 | module.exports = function (obj, args) { 23 | var negate = flag(obj, 'negate') 24 | , expr = args[0]; 25 | return negate ? !expr : expr; 26 | }; 27 | -------------------------------------------------------------------------------- /public/components/chai/test/plugins.js: -------------------------------------------------------------------------------- 1 | suite('plugins', function () { 2 | 3 | function plugin (chai) { 4 | if (chai.Assertion.prototype.testing) return; 5 | 6 | Object.defineProperty(chai.Assertion.prototype, 'testing', { 7 | get: function () { 8 | return 'successful'; 9 | } 10 | }); 11 | } 12 | 13 | test('basic usage', function () { 14 | chai.use(plugin); 15 | var expect = chai.expect; 16 | expect(expect('').testing).to.equal('successful'); 17 | }); 18 | 19 | test('double plugin', function () { 20 | chai.expect(function () { 21 | chai.use(plugin); 22 | }).to.not.throw(); 23 | }); 24 | }); 25 | -------------------------------------------------------------------------------- /client/test/spec_helper.coffee: -------------------------------------------------------------------------------- 1 | 2 | 3 | expectFuture = (future) -> 4 | 5 | expector = { 6 | resolve: (fn) -> 7 | future.then( 8 | (val) -> fn(val); val 9 | (val) -> throw new Error('future is rejected with ' + val + (if typeof val == 'object' then " @ #{val.stack}" else '')) 10 | ) 11 | reject: (fn) -> 12 | future.then( 13 | (val) -> throw new Error('future is resolved') 14 | (val) -> fn(val); val 15 | ) 16 | } 17 | 18 | expector.to = expector 19 | return expector 20 | 21 | 22 | testFuture = (fn) -> (resume) -> 23 | fn().then( 24 | (val) -> resume() 25 | (val) -> resume(val) 26 | ) 27 | -------------------------------------------------------------------------------- /style/compass/scss/_bottombuttons.scss: -------------------------------------------------------------------------------- 1 | 2 | .bottom-buttons { 3 | position: fixed; 4 | bottom: 4px; 5 | right: 4px; 6 | } 7 | 8 | .bottom-button { 9 | opacity: 0.5; 10 | width: 20px; height: 20px; display: inline-block; 11 | margin-left: 6px; cursor: pointer; 12 | } 13 | 14 | .btn-facebook { background: inline-image("inline-graphics/facebook.png") center center no-repeat; cursor: pointer; } 15 | .btn-geolocation { background: inline-image("inline-graphics/geolocation.png") center center no-repeat; } 16 | 17 | .btn-invisible { display: none; } 18 | .btn-fb-noupdate { opacity: 0.3; } 19 | .btn-fb-update { opacity: 0.8; } 20 | .btn-dimmed { opacity: 0.2; } 21 | -------------------------------------------------------------------------------- /style/compass/scss/_splashnoti.scss: -------------------------------------------------------------------------------- 1 | .splash-noti { 2 | @include fixed; 3 | top: 100px; 4 | left: 0; 5 | width: 100%; 6 | font: 25pt "Lucida Grande", "Segoe UI", Verdana, sans-serif; 7 | text-align: center; 8 | color: #ffffff; 9 | display: none; 10 | z-index: 999999; 11 | } 12 | .spn-inner { 13 | display: -moz-inline-box; 14 | display: inline-block; 15 | zoom: 1; 16 | padding: 3px 10px; 17 | background: #000000; 18 | background: rgba(0, 0, 0, 0.5); 19 | -moz-border-radius: 4px; 20 | -webkit-border-radius: 4px; 21 | border-radius: 4px; 22 | } 23 | .spn-cool { 24 | color: rgba(0, 0, 0, 0) 25 | } 26 | .spn-cool .spn-inner { 27 | background: transparent; 28 | } 29 | -------------------------------------------------------------------------------- /public/components/mocha/test/acceptance/duration.js: -------------------------------------------------------------------------------- 1 | 2 | describe('durations', function(){ 3 | describe('when slow', function(){ 4 | it('should highlight in red', function(done){ 5 | setTimeout(function(){ 6 | done(); 7 | }, 100); 8 | }) 9 | }) 10 | 11 | describe('when reasonable', function(){ 12 | it('should highlight in yellow', function(done){ 13 | setTimeout(function(){ 14 | done(); 15 | }, 50); 16 | }) 17 | }) 18 | 19 | describe('when fast', function(){ 20 | it('should highlight in green', function(done){ 21 | setTimeout(function(){ 22 | done(); 23 | }, 10); 24 | }) 25 | }) 26 | }) 27 | -------------------------------------------------------------------------------- /public/components/chai/lib/chai/utils/getEnumerableProperties.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Chai - getEnumerableProperties utility 3 | * Copyright(c) 2012-2013 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | /** 8 | * ### .getEnumerableProperties(object) 9 | * 10 | * This allows the retrieval of enumerable property names of an object, 11 | * inherited or not. 12 | * 13 | * @param {Object} object 14 | * @returns {Array} 15 | * @name getEnumerableProperties 16 | * @api public 17 | */ 18 | 19 | module.exports = function getEnumerableProperties(object) { 20 | var result = []; 21 | for (var name in object) { 22 | result.push(name); 23 | } 24 | return result; 25 | }; 26 | -------------------------------------------------------------------------------- /public/thaiWitter/custom-css.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Custom CSS Editor 5 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /public/components/underscore/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## How to contribute to Underscore.js 2 | 3 | * Before you open a ticket or send a pull request, [search](https://github.com/documentcloud/underscore/issues) for previous discussions about the same feature or issue. Add to the earlier ticket if you find one. 4 | 5 | * Before sending a pull request for a feature, be sure to have [tests](http://underscorejs.org/test/). 6 | 7 | * Use the same coding style as the rest of the [codebase](https://github.com/documentcloud/underscore/blob/master/underscore.js). 8 | 9 | * In your pull request, do not add documentation or re-build the minified `underscore-min.js` file. We'll do those things before cutting a new release. 10 | -------------------------------------------------------------------------------- /public/components/underscore/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "underscore", 3 | "description" : "JavaScript's functional programming helper library.", 4 | "homepage" : "http://underscorejs.org", 5 | "keywords" : ["util", "functional", "server", "client", "browser"], 6 | "author" : "Jeremy Ashkenas ", 7 | "repository" : {"type": "git", "url": "git://github.com/documentcloud/underscore.git"}, 8 | "main" : "underscore.js", 9 | "version" : "1.4.4", 10 | "devDependencies": { 11 | "phantomjs": "0.2.2" 12 | }, 13 | "scripts": { 14 | "test": "phantomjs test/vendor/runner.js test/index.html?noglobals=true" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /public/components/mocha/test/acceptance/context.js: -------------------------------------------------------------------------------- 1 | 2 | describe('Context', function(){ 3 | beforeEach(function(){ 4 | this.calls = ['before']; 5 | }) 6 | 7 | describe('nested', function(){ 8 | beforeEach(function(){ 9 | this.calls.push('before two'); 10 | }) 11 | 12 | it('should work', function(){ 13 | this.calls.should.eql(['before', 'before two']); 14 | this.calls.push('test'); 15 | }) 16 | 17 | after(function(){ 18 | this.calls.should.eql(['before', 'before two', 'test']); 19 | this.calls.push('after two'); 20 | }) 21 | }) 22 | 23 | after(function(){ 24 | this.calls.should.eql(['before', 'before two', 'test', 'after two']); 25 | }) 26 | }) -------------------------------------------------------------------------------- /features/step_definitions/browser_steps.rb: -------------------------------------------------------------------------------- 1 | 2 | require "watir-webdriver" 3 | 4 | 5 | Before do 6 | @host = 'localhost' 7 | case ENV['BROWSER'] 8 | when "ie" 9 | @browser = Watir::Browser.new(:remote, { :url => 'http://192.168.105.196:4444/wd/hub', 10 | :desired_capabilities => :internet_explorer }) 11 | @host = '192.168.105.1' 12 | else 13 | @browser = Watir::Browser.new(:firefox) 14 | end 15 | end 16 | 17 | When /^I go to home page$/ do 18 | @browser.goto "http://#{@host}:3003/" 19 | end 20 | 21 | Then /^I should see a link to (.*)$/ do |href| 22 | @browser.links.find { |link| link.href.include? href }.should exist 23 | end 24 | 25 | After do 26 | @browser.close 27 | end 28 | 29 | 30 | -------------------------------------------------------------------------------- /lib/processors/script-aggregator.js: -------------------------------------------------------------------------------- 1 | 2 | var Q = require('q') 3 | 4 | function ScriptAggregator(options) { 5 | var dev = options.development 6 | function aggregatorDev(content, next) { 7 | var js = JSON.parse(content).map(function(filename) { 8 | return '' 9 | }).join('') 10 | return 'document.write(' + JSON.stringify(js) + ')' 11 | } 12 | function aggregator(content, next) { 13 | return Q.all(JSON.parse(content).map(next)) 14 | .then(function(array) { 15 | return array.join('\n;\n') 16 | }) 17 | } 18 | return { 19 | pattern: /\.js$/, 20 | extension: '.ag', 21 | process: dev ? aggregatorDev : aggregator 22 | } 23 | } 24 | 25 | module.exports = ScriptAggregator 26 | -------------------------------------------------------------------------------- /style/compass/scss/_select.scss: -------------------------------------------------------------------------------- 1 | .selectliek-container { 2 | display: inline-block; 3 | vertical-align: middle; 4 | overflow: hidden; 5 | position: relative; 6 | cursor: pointer; 7 | border: 1px solid #222324; 8 | z-index: 1; 9 | color: #fff; 10 | &:hover { 11 | border: 1px solid #464748; 12 | } 13 | } 14 | .selectliek-choice { 15 | background: #565859; 16 | } 17 | .selectliek-choice-select { 18 | background: #818385; 19 | } 20 | .selectliek-closed .selectliek-choice { 21 | background: #222324; 22 | } 23 | .selectliek-open { 24 | z-index: 2; 25 | } 26 | .selectliek-text { 27 | display: inline-block; 28 | padding: 0 10px; 29 | line-height: 24px; 30 | white-space: nowrap; 31 | } 32 | .selecti { 33 | padding: 0 0 4px; 34 | } 35 | -------------------------------------------------------------------------------- /style/inline-graphics/facebook.js: -------------------------------------------------------------------------------- 1 | 2 | newFile(16, 16); 3 | 4 | var img = new (require('canvas').Image); 5 | img.src = require('fs').readFileSync('facebook-favicon.png'); 6 | ctx.clearRect(0, 0, w, h); 7 | ctx.drawImage(img, 0, 0); 8 | 9 | var imgd = ctx.getImageData(0, 0, w, h); 10 | for (var i = 0; i < imgd.data.length; i += 4) { 11 | var x = (imgd.data[i] + imgd.data[i + 1] + imgd.data[i + 2]) / 3; 12 | var o = ((1 - x / 255) * imgd.data[i + 3] / 255); 13 | imgd.data[i] = imgd.data[i + 1] = imgd.data[i + 2] = 255; 14 | o *= 1.2; 15 | o = Math.min(1, o); 16 | o = Math.sqrt(o); 17 | o *= 255; 18 | imgd.data[i + 3] = o; 19 | } 20 | 21 | ctx.clearRect(0, 0, w, h); 22 | ctx.putImageData(imgd, 0, 0); 23 | 24 | saveFile('facebook'); 25 | 26 | -------------------------------------------------------------------------------- /public/components/q/VERSIONS.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | This library has the following policy about versions. 4 | 5 | - Presently, all planned versions have a major version number of 0. 6 | - The minor version number increases for every backward-incompatible 7 | change to a documented behavior. 8 | - The patch version number increases for every added feature, 9 | backward-incompatible changes to undocumented features, and 10 | bug-fixes. 11 | 12 | Upon the release of a version 1.0.0, the strategy will be revised. 13 | 14 | - The major version will increase for any backward-incompatible 15 | changes. 16 | - The minor version will increase for added features. 17 | - The patch version will increase for bug-fixes. 18 | 19 | -------------------------------------------------------------------------------- /public/components/mocha/test/browser/large.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Mocha 4 | 5 | 6 | 7 | 8 | 9 | 14 | 15 | 20 | 21 | 22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /public/components/mocha/lib/reporters/index.js: -------------------------------------------------------------------------------- 1 | 2 | exports.Base = require('./base'); 3 | exports.Dot = require('./dot'); 4 | exports.Doc = require('./doc'); 5 | exports.TAP = require('./tap'); 6 | exports.JSON = require('./json'); 7 | exports.HTML = require('./html'); 8 | exports.List = require('./list'); 9 | exports.Min = require('./min'); 10 | exports.Spec = require('./spec'); 11 | exports.Nyan = require('./nyan'); 12 | exports.XUnit = require('./xunit'); 13 | exports.Markdown = require('./markdown'); 14 | exports.Progress = require('./progress'); 15 | exports.Landing = require('./landing'); 16 | exports.JSONCov = require('./json-cov'); 17 | exports.HTMLCov = require('./html-cov'); 18 | exports.JSONStream = require('./json-stream'); 19 | exports.Teamcity = require('./teamcity'); 20 | -------------------------------------------------------------------------------- /public/components/sinon/lib/sinon/util/xhr_ie.js: -------------------------------------------------------------------------------- 1 | /*global sinon*/ 2 | /** 3 | * Helps IE run the fake XMLHttpRequest. By defining global functions, IE allows 4 | * them to be overwritten at a later point. If these are not defined like 5 | * this, overwriting them will result in anything from an exception to browser 6 | * crash. 7 | * 8 | * If you don't require fake XHR to work in IE, don't include this file. 9 | * 10 | * @author Christian Johansen (christian@cjohansen.no) 11 | * @license BSD 12 | * 13 | * Copyright (c) 2010-2011 Christian Johansen 14 | */ 15 | function XMLHttpRequest() {} 16 | 17 | // Reassign the original function. Now its writable attribute 18 | // should be true. Hackish, I know, but it works. 19 | XMLHttpRequest = sinon.xhr.XMLHttpRequest || undefined; 20 | -------------------------------------------------------------------------------- /client/test/request_spec.coffee: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | describe 'T.request', -> 5 | 6 | describe '.send', -> 7 | 8 | it 'should send an XMLHttpRequest and get the response', testFuture -> 9 | expectFuture(T.request.send({ method: 'GET', url: 'lol.txt' })) 10 | .to.resolve((response) -> expect(response.responseText.replace(/\s*$/, '')).to.equal('lol!!!')) 11 | 12 | it 'should reject with invalid url', testFuture -> 13 | expectFuture(T.request.send({ method: 'GET', url: 'wtf.txt' })) 14 | .to.reject(->) 15 | 16 | describe '#send', -> 17 | it 'should perform a request', testFuture -> 18 | expectFuture(T.request('lol.txt').send()) 19 | .to.resolve((response) -> expect(response.responseText.replace(/\s*$/, '')).to.equal('lol!!!')) 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /client/T/task.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | ;(function() { 4 | 5 | T.task = function createTask(title, worker) { 6 | var task, resolver 7 | task = T.future(function taskFutureWrapper(r) { 8 | resolver = r 9 | }) 10 | resolver.text = function setText(text) { 11 | task.status.text = text 12 | task.emit('text', text, true) 13 | } 14 | resolver.progress = function setProgress(progress) { 15 | task.status.progress = progress 16 | task.emit('progress', progress, true) 17 | } 18 | resolver.onabort = function defaultOnAbort() { 19 | } 20 | T.supportEvent(task) 21 | task.title = title 22 | task.status = { text: 'Working...', progress: -1 } 23 | task.abort = function abort() { 24 | resolver.onabort() 25 | } 26 | worker(resolver) 27 | return task 28 | } 29 | 30 | })() 31 | 32 | -------------------------------------------------------------------------------- /public/components/mocha/test/acceptance/diffs.js: -------------------------------------------------------------------------------- 1 | 2 | var fs = require('fs') 3 | , cssin = fs.readFileSync('test/acceptance/fixtures/css.in', 'ascii') 4 | , cssout = fs.readFileSync('test/acceptance/fixtures/css.out', 'ascii'); 5 | 6 | describe('diffs', function(){ 7 | it('should display a char diff for small strings', function(){ 8 | var a = 'foo bar baz' 9 | , b = 'foo rar baz'; 10 | 11 | // a.should.equal(b); 12 | }) 13 | 14 | it('should display a word diff for medium strings', function(){ 15 | var a = 'foo bar baz\nfoo bar baz\nfoo bar baz' 16 | , b = 'foo bar baz\nfoo rar baz\nfoo bar raz'; 17 | 18 | // a.should.equal(b); 19 | }) 20 | 21 | it('should display a word diff for large strings', function(){ 22 | // cssin.should.equal(cssout); 23 | }) 24 | }) -------------------------------------------------------------------------------- /client/T/future.js: -------------------------------------------------------------------------------- 1 | 2 | ;(function() { 3 | function makeResolve(d) { 4 | return function(what) { 5 | Q.when(what).then(d.accept, d.reject) 6 | } 7 | } 8 | T.future = function(callback) { 9 | var I = Q.defer(); 10 | var resolver = { 11 | accept: I.resolve, 12 | reject: I.reject 13 | } 14 | resolver.resolve = makeResolve(resolver) 15 | try { 16 | callback(resolver); 17 | } catch (e) { 18 | resolver.reject(e); 19 | } 20 | var promise = I.promise; 21 | return { 22 | then: promise.then.bind(promise) 23 | } 24 | }; 25 | T.future.accept = function(value) { 26 | return T.future(function(resolver) { resolver.accept(value); }); 27 | }; 28 | T.future.reject = function(value) { 29 | return T.future(function(resolver) { resolver.reject(value); }); 30 | }; 31 | })() 32 | 33 | -------------------------------------------------------------------------------- /public/components/mocha/lib/reporters/min.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var Base = require('./base'); 7 | 8 | /** 9 | * Expose `Min`. 10 | */ 11 | 12 | exports = module.exports = Min; 13 | 14 | /** 15 | * Initialize a new `Min` minimal test reporter (best used with --watch). 16 | * 17 | * @param {Runner} runner 18 | * @api public 19 | */ 20 | 21 | function Min(runner) { 22 | Base.call(this, runner); 23 | 24 | runner.on('start', function(){ 25 | // clear screen 26 | process.stdout.write('\u001b[2J'); 27 | // set cursor position 28 | process.stdout.write('\u001b[1;3H'); 29 | }); 30 | 31 | runner.on('end', this.epilogue.bind(this)); 32 | } 33 | 34 | /** 35 | * Inherit from `Base.prototype`. 36 | */ 37 | 38 | Min.prototype.__proto__ = Base.prototype; 39 | -------------------------------------------------------------------------------- /public/components/mocha/lib/reporters/templates/script.html: -------------------------------------------------------------------------------- 1 | 35 | -------------------------------------------------------------------------------- /client/conf/config.js: -------------------------------------------------------------------------------- 1 | TWCONFIG = { 2 | api: { 3 | relogin: 'api/relogin', 4 | stream: 'api/stream', 5 | fave: 'api/fave', 6 | user: 'api/user', 7 | show: 'api/show', 8 | follow: 'api/follow', 9 | get: 'api/get', 10 | post: 'api/post', 11 | token: 'api/token', 12 | geo: 'api/address', 13 | echo: 'api/echo', 14 | auto: 'api/autologin', 15 | fbcheck: 'api/fbcheck', 16 | fbpost: 'api/fbpost', 17 | imgecho: 'api/imgecho', 18 | connections: 'api/connections', 19 | completedb: 'api/completedb', 20 | mt: 'api/mt', 21 | upload: 'https://tw3.herokuapp.com/upload', 22 | rmtweet: 'api/rmtweet' 23 | }, 24 | autologinCheck: function(cookie) { 25 | return cookie.match(/tw3et=ernity/) && cookie.match(/tw3tk=[\w+]/); 26 | } 27 | }; 28 | APP_NAME='- thaiWitter3'; 29 | TWITTER_CONFIG={}; 30 | -------------------------------------------------------------------------------- /public/components/q/design/q1.js: -------------------------------------------------------------------------------- 1 | 2 | var defer = function () { 3 | var pending = [], value; 4 | return { 5 | resolve: function (_value) { 6 | if (pending) { 7 | value = _value; 8 | for (var i = 0, ii = pending.length; i < ii; i++) { 9 | var callback = pending[i]; 10 | callback(value); 11 | } 12 | pending = undefined; 13 | } else { 14 | throw new Error("A promise can only be resolved once."); 15 | } 16 | }, 17 | then: function (callback) { 18 | if (pending) { 19 | pending.push(callback); 20 | } else { 21 | callback(value); 22 | } 23 | } 24 | } 25 | }; 26 | 27 | -------------------------------------------------------------------------------- /public/components/mocha/editors/JavaScript mocha.tmbundle/info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | JavaScript mocha 7 | ordering 8 | 9 | 4AA1FB50-9BB9-400E-A140-D61C39BDFDF5 10 | 591AE071-95E4-4E1E-B0F3-A7DAF41595EE 11 | DF6F1F42-F80A-4A24-AF78-376F19070C4C 12 | A49A87F9-399E-4D74-A489-C535BB06D487 13 | 7AB064E3-EFBB-4FA7-98CA-9E87C10CC04E 14 | 7B4DA8F4-2064-468B-B252-054148419B4B 15 | 16 | uuid 17 | 094ACE33-0C0E-422A-B3F7-5B919F5B1239 18 | 19 | 20 | -------------------------------------------------------------------------------- /public/components/mocha/test/browser/large.js: -------------------------------------------------------------------------------- 1 | 2 | var n = 30; 3 | while (n--) { 4 | describe('Array ' + n, function(){ 5 | var arr; 6 | 7 | beforeEach(function(){ 8 | arr = [1,2,3]; 9 | }) 10 | 11 | describe('#indexOf()', function(){ 12 | it('should return -1 when the value is not present', function(){ 13 | assert(-1 == arr.indexOf(5)); 14 | }) 15 | 16 | it('should return the correct index when the value is present', function(done){ 17 | assert(0 == arr.indexOf(1)); 18 | assert(1 == arr.indexOf(2)); 19 | done(); 20 | }) 21 | }) 22 | }) 23 | } 24 | 25 | describe('something', function(){ 26 | it('should provide a useful error', function(done){ 27 | setTimeout(function(){ 28 | throw new Error('boom'); 29 | done(); 30 | }, 1); 31 | }) 32 | }) -------------------------------------------------------------------------------- /public/components/q/spec/lib/jasmine-promise.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | jasmine.Block.prototype.execute = function (onComplete) { 4 | var spec = this.spec; 5 | var result; 6 | try { 7 | result = this.func.call(spec, onComplete); 8 | 9 | // It seems Jasmine likes to return the suite if you pass it anything. 10 | // So make sure it's a promise first. 11 | if (result && typeof result.then === "function") { 12 | result.then(function () { 13 | onComplete(); 14 | }, function (error) { 15 | spec.fail(error); 16 | onComplete(); 17 | }); 18 | } else if (this.func.length === 0) { 19 | onComplete(); 20 | } 21 | } catch (error) { 22 | spec.fail(error); 23 | onComplete(); 24 | } 25 | }; 26 | 27 | -------------------------------------------------------------------------------- /public/components/sinon/test/node/run.js: -------------------------------------------------------------------------------- 1 | require("../sinon_test.js"); 2 | require("../sinon/spy_test.js"); 3 | require("../sinon/stub_test.js"); 4 | require("../sinon/mock_test.js"); 5 | require("../sinon/util/fake_timers_test.js"); 6 | require("../sinon/collection_test.js"); 7 | require("../sinon/sandbox_test.js"); 8 | require("../sinon/assert_test.js"); 9 | require("../sinon/test_test.js"); 10 | require("../sinon/test_case_test.js"); 11 | require("../sinon/match_test.js"); 12 | var buster = require("../runner"); 13 | 14 | buster.testRunner.onCreate(function (runner) { 15 | runner.on("suite:end", function (results) { 16 | // Reporter will be set up after delay, allow 17 | // it to finish before we exit the process 18 | process.nextTick(function () { 19 | process.exit(results.ok ? 0 : 1); 20 | }); 21 | }); 22 | }); 23 | -------------------------------------------------------------------------------- /public/components/eventEmitter/docs/api.dust: -------------------------------------------------------------------------------- 1 | # API{~n} 2 | {~n} 3 | Each of the methods listed in the API are accessed through an instance of EventEmitter. You can create an instance with `var ee = new EventEmitter();`. Then you can call API methods from `ee`, for example `ee.emitEvent('foo');`.{~n} 4 | {~n} 5 | You may also be interested in [the guide](https://github.com/Wolfy87/EventEmitter/blob/master/docs/guide.md) which highlights some key features of EventEmitter and how to use them. It is a broad overview of the script whereas this is concise information about each method in the API.{~n} 6 | {~n} 7 | {#.} 8 | ## {ctx.name}{~n} 9 | {~n} 10 | {description.full|s}{~n} 11 | {~n} 12 | {#tags} 13 | {~s}* **{type}**{?types} ({#types}{.}{@sep} | {/sep}{/types}){/types}{?name} _{name}_{/name}{?description} - {description}{/description}{~n} 14 | {/tags} 15 | {@sep}{~n}{/sep} 16 | {/.} -------------------------------------------------------------------------------- /style/compass/scss/_upic.scss: -------------------------------------------------------------------------------- 1 | 2 | // == Upic Upload == 3 | .upic, .upicup { 4 | width: 300px; 5 | margin: 0 auto 5px; 6 | height: 32px; 7 | position: relative; 8 | text-align: left; 9 | background: top left no-repeat image-url("upic/drop.gif"); 10 | } 11 | .upic { 12 | .upicfilename { display: none; } 13 | .upicmask { display: none; } 14 | } 15 | .upicup { 16 | background-position: bottom left; 17 | .upicfilename { 18 | color: #e9e7e5; 19 | font: 14px Verdana, sans-serif; 20 | text-shadow: 0 -1px 0 rgba(0,0,0,0.4); 21 | text-indent: 16px; 22 | line-height: 29px; 23 | height: 32px; 24 | overflow: hidden; 25 | white-space: nowrap; 26 | width: 236px; 27 | } 28 | .upicmask { 29 | position: absolute; 30 | left: 197px; 31 | top: 0; 32 | width: 40px; 33 | height: 32px; 34 | background: image-url("upic/mask.png") top right no-repeat; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /public/components/q/design/q3.js: -------------------------------------------------------------------------------- 1 | 2 | var isPromise = function (value) { 3 | return value && typeof value.then === "function"; 4 | }; 5 | 6 | var defer = function () { 7 | var pending = [], value; 8 | return { 9 | resolve: function (_value) { 10 | if (pending) { 11 | value = _value; 12 | for (var i = 0, ii = pending.length; i < ii; i++) { 13 | var callback = pending[i]; 14 | callback(value); 15 | } 16 | pending = undefined; 17 | } 18 | }, 19 | promise: { 20 | then: function (callback) { 21 | if (pending) { 22 | pending.push(callback); 23 | } else { 24 | callback(value); 25 | } 26 | } 27 | } 28 | }; 29 | }; 30 | 31 | -------------------------------------------------------------------------------- /public/components/q/design/q2.js: -------------------------------------------------------------------------------- 1 | 2 | var Promise = function () { 3 | }; 4 | 5 | var isPromise = function (value) { 6 | return value instanceof Promise; 7 | }; 8 | 9 | var defer = function () { 10 | var pending = [], value; 11 | var promise = new Promise(); 12 | promise.then = function (callback) { 13 | if (pending) { 14 | pending.push(callback); 15 | } else { 16 | callback(value); 17 | } 18 | }; 19 | return { 20 | resolve: function (_value) { 21 | if (pending) { 22 | value = _value; 23 | for (var i = 0, ii = pending.length; i < ii; i++) { 24 | var callback = pending[i]; 25 | callback(value); 26 | } 27 | pending = undefined; 28 | } 29 | }, 30 | promise: promise 31 | }; 32 | }; 33 | 34 | -------------------------------------------------------------------------------- /public/components/chai/test/display/message.js: -------------------------------------------------------------------------------- 1 | var chai = require('../..') 2 | , should = chai.should(); 3 | 4 | var deepObj = { 5 | green: { tea: 'matcha' } 6 | , teas: [ 7 | 'chai' 8 | , 'matcha' 9 | , { tea: 'konacha' } 10 | ] 11 | }; 12 | 13 | var deepObj2 = { 14 | green: { tea: 'matcha' } 15 | , teas: [ 16 | 'chai' 17 | , 'oolong' 18 | , { tea: 'konacha' } 19 | ] 20 | }; 21 | 22 | chai.Assertion.includeStack = true; 23 | 24 | suite('object display', function () { 25 | 26 | test('property', function () { 27 | deepObj.should.have.property('chai'); 28 | }); 29 | 30 | test('deep equal', function () { 31 | deepObj.should.deep.equal(deepObj2); 32 | }); 33 | 34 | test('deep equal no diff', function () { 35 | chai.Assertion.showDiff = false; 36 | deepObj.should.deep.equal(deepObj2); 37 | chai.Assertion.showDiff = true; 38 | }); 39 | 40 | }); 41 | -------------------------------------------------------------------------------- /style/compass/scss/_dialog.scss: -------------------------------------------------------------------------------- 1 | 2 | .tw-dialog { 3 | border: 2px solid #737271; 4 | @include fixed; 5 | left: 50%; 6 | background: #000; 7 | text-align: center; display: none; z-index: 3; 8 | } 9 | .tw-dialog-title { 10 | font: bold 14pt "Verdana", Tahoma, sans-serif; 11 | color: #797877; 12 | padding: 0.7em 0 0.6em; 13 | } 14 | .tw-dialog-footer { 15 | color: #696867; 16 | padding: 0.8em 1.5em 1.2em; 17 | font: 8pt "Verdana", Tahoma, sans-serif; 18 | } 19 | 20 | 21 | .uploadform { 22 | @extend .tw-dialog; 23 | z-index: 4; 24 | } 25 | .uptitle { 26 | @extend .tw-dialog-title; 27 | } 28 | .upthx { 29 | @extend .tw-dialog-footer; 30 | } 31 | .uplnk { 32 | @extend .link; 33 | } 34 | 35 | 36 | .relogin { 37 | @extend .tw-dialog; 38 | } 39 | .rltitle { 40 | @extend .tw-dialog-title; 41 | } 42 | .rldata { 43 | padding: 0.4em 1.4em; 44 | } 45 | .rllnk { 46 | @extend .link; 47 | @extend .status-username; 48 | } 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /public/components/chai/lib/chai/utils/flag.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Chai - flag utility 3 | * Copyright(c) 2012-2013 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | /** 8 | * ### flag(object ,key, [value]) 9 | * 10 | * Get or set a flag value on an object. If a 11 | * value is provided it will be set, else it will 12 | * return the currently set value or `undefined` if 13 | * the value is not set. 14 | * 15 | * utils.flag(this, 'foo', 'bar'); // setter 16 | * utils.flag(this, 'foo'); // getter, returns `bar` 17 | * 18 | * @param {Object} object (constructed Assertion 19 | * @param {String} key 20 | * @param {Mixed} value (optional) 21 | * @name flag 22 | * @api private 23 | */ 24 | 25 | module.exports = function (obj, key, value) { 26 | var flags = obj.__flags || (obj.__flags = Object.create(null)); 27 | if (arguments.length === 3) { 28 | flags[key] = value; 29 | } else { 30 | return flags[key]; 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /public/components/mocha/lib/hook.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var Runnable = require('./runnable'); 7 | 8 | /** 9 | * Expose `Hook`. 10 | */ 11 | 12 | module.exports = Hook; 13 | 14 | /** 15 | * Initialize a new `Hook` with the given `title` and callback `fn`. 16 | * 17 | * @param {String} title 18 | * @param {Function} fn 19 | * @api private 20 | */ 21 | 22 | function Hook(title, fn) { 23 | Runnable.call(this, title, fn); 24 | this.type = 'hook'; 25 | } 26 | 27 | /** 28 | * Inherit from `Runnable.prototype`. 29 | */ 30 | 31 | Hook.prototype.__proto__ = Runnable.prototype; 32 | 33 | /** 34 | * Get or set the test `err`. 35 | * 36 | * @param {Error} err 37 | * @return {Error} 38 | * @api public 39 | */ 40 | 41 | Hook.prototype.error = function(err){ 42 | if (0 == arguments.length) { 43 | var err = this._error; 44 | this._error = null; 45 | return err; 46 | } 47 | 48 | this._error = err; 49 | }; 50 | -------------------------------------------------------------------------------- /lib/middleware/asset-server.js: -------------------------------------------------------------------------------- 1 | 2 | var send = require('send') 3 | , url = require('url') 4 | 5 | module.exports = function(processor, options) { 6 | 7 | var cache = 'no-cache' 8 | if (options.cache) cache = 'public, max-age=' + (86400 * 7) 9 | 10 | return function(req, res, next) { 11 | var pathname = decodeURIComponent(url.parse(req.url).pathname) 12 | , re = /^\/asset(?:s|\/[0-9a-fA-F]+)\// 13 | 14 | if (!pathname.match(re)) return next() 15 | var path = pathname.replace(re, '') 16 | if (path.indexOf('\0') != -1) return next(error('wtf MAN?', 400)) 17 | 18 | processor.process(path) 19 | .then(function(data) { 20 | res.setHeader('Content-Type', send.mime.lookup(path)) 21 | res.setHeader('Cache-Control', cache) 22 | res.end(data) 23 | }) 24 | .fail(next) 25 | 26 | } 27 | 28 | } 29 | 30 | module.exports.url = function(hash, pathname) { 31 | return '/asset' + (hash ? '/' + hash.substr(0,16) + '/' : 's/') + pathname 32 | } 33 | -------------------------------------------------------------------------------- /lib/powered.js: -------------------------------------------------------------------------------- 1 | exports.getPowered = function() { 2 | function link(url, contents) { 3 | return '' + contents + '' 5 | } 6 | function html(html) { 7 | return { html: html } 8 | } 9 | var poweredByNode = link('http://nodejs.org/', 'powered by node.js') + link('http://expressjs.com/', ' + express'); 10 | var POWERED_BY = process.env.POWERED_BY; 11 | if (POWERED_BY == 'heroku') { 12 | return [ 13 | html('running on Heroku'), 14 | html(link('http://heroku.com/', '(http://heroku.com/)')), 15 | html(poweredByNode) 16 | ]; 17 | } 18 | if (POWERED_BY == 'icez') { 19 | return [ 20 | html('hosting provided by icez network'), 21 | html(link('https://twitter.com/icez', '(@icez)')), 22 | html(poweredByNode) 23 | ]; 24 | } 25 | return [ 26 | html('local testing version'), 27 | html(poweredByNode) 28 | ]; 29 | }; 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /public/components/chai/lib/chai/utils/getProperties.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Chai - getProperties utility 3 | * Copyright(c) 2012-2013 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | /** 8 | * ### .getProperties(object) 9 | * 10 | * This allows the retrieval of property names of an object, enumerable or not, 11 | * inherited or not. 12 | * 13 | * @param {Object} object 14 | * @returns {Array} 15 | * @name getProperties 16 | * @api public 17 | */ 18 | 19 | module.exports = function getProperties(object) { 20 | var result = Object.getOwnPropertyNames(subject); 21 | 22 | function addProperty(property) { 23 | if (result.indexOf(property) === -1) { 24 | result.push(property); 25 | } 26 | } 27 | 28 | var proto = Object.getPrototypeOf(subject); 29 | while (proto !== null) { 30 | Object.getOwnPropertyNames(proto).forEach(addProperty); 31 | proto = Object.getPrototypeOf(proto); 32 | } 33 | 34 | return result; 35 | }; 36 | -------------------------------------------------------------------------------- /public/components/mocha/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mocha", 3 | "version": "1.9.0", 4 | "description": "simple, flexible, fun test framework", 5 | "keywords": [ 6 | "mocha", 7 | "test", 8 | "bdd", 9 | "tdd", 10 | "tap" 11 | ], 12 | "author": "TJ Holowaychuk ", 13 | "repository": { 14 | "type": "git", 15 | "url": "git://github.com/visionmedia/mocha.git" 16 | }, 17 | "main": "./index", 18 | "bin": { 19 | "mocha": "./bin/mocha", 20 | "_mocha": "./bin/_mocha" 21 | }, 22 | "engines": { 23 | "node": ">= 0.4.x" 24 | }, 25 | "scripts": { 26 | "test": "make test-all" 27 | }, 28 | "dependencies": { 29 | "commander": "0.6.1", 30 | "growl": "1.7.x", 31 | "jade": "0.26.3", 32 | "diff": "1.0.2", 33 | "debug": "*", 34 | "mkdirp": "0.3.3", 35 | "ms": "0.3.0" 36 | }, 37 | "devDependencies": { 38 | "should": "*", 39 | "coffee-script": "1.2" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /public/components/mocha/test/jsapi/index.js: -------------------------------------------------------------------------------- 1 | 2 | var Mocha = require('../../') 3 | , path = require('path'); 4 | 5 | var mocha = new Mocha({ 6 | ui: 'bdd', 7 | globals: ['okGlobalA', 'okGlobalB', 'okGlobalC', 'callback*'], 8 | // ignoreLeaks: true, 9 | growl: true 10 | }); 11 | 12 | // mocha.reporter('spec'); 13 | require('should'); 14 | 15 | mocha.addFile('test/suite.js'); 16 | mocha.addFile('test/runner.js'); 17 | mocha.addFile('test/runnable.js'); 18 | mocha.addFile('test/hook.sync.js'); 19 | mocha.addFile('test/hook.sync.nested.js'); 20 | mocha.addFile('test/hook.async.js'); 21 | mocha.addFile('test/acceptance/duration.js'); 22 | mocha.addFile('test/acceptance/fs.js'); 23 | mocha.addFile('test/acceptance/globals.js'); 24 | mocha.addFile('test/acceptance/pending.js'); 25 | mocha.addFile('test/acceptance/timeout.js'); 26 | 27 | mocha.run(function(){ 28 | console.log('done'); 29 | }).on('pass', function(test){ 30 | // console.log('... %s', test.title); 31 | }); 32 | -------------------------------------------------------------------------------- /public/components/mocha/test/browser/opts.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Mocha 4 | 5 | 6 | 7 | 8 | 14 | 19 | 20 | 21 | 26 | 27 | 28 |
29 | 30 | 31 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "thaiwitterserver", 3 | "version": "0.3.0", 4 | "private": true, 5 | "dependencies": { 6 | "coffee-script": "~1.4.0", 7 | "connect": "2.7.1", 8 | "dotenv": "^5.0.1", 9 | "express": "3.0.4", 10 | "hjs": "0.0.4", 11 | "levenshtein": "1.0.1", 12 | "oauth": "0.9.9", 13 | "q": "0.8.11", 14 | "request": "2.12.0", 15 | "send": "~0.1.0" 16 | }, 17 | "engines": { 18 | "node": "0.10.10", 19 | "npm": "1.2.25" 20 | }, 21 | "devDependencies": { 22 | "should": "~1.2.1", 23 | "mocha-as-promised": "~1.2.1", 24 | "chai-as-promised": "~3.2.4", 25 | "chai": "~1.5.0", 26 | "sinon-chai": "~2.3.1", 27 | "sinon": "~1.5.2", 28 | "mocha-phantomjs": "~2.0.2", 29 | "mocha": "~1.10.0", 30 | "js-yaml": "~2.0.5", 31 | "twitter-text": "~1.6.1" 32 | }, 33 | "scripts": { 34 | "test-server": "node_modules/.bin/mocha", 35 | "test-client": "bin/client_unit_test", 36 | "test": "npm run test-server && npm run test-client" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /public/components/mocha/test/acceptance/interfaces/bdd.js: -------------------------------------------------------------------------------- 1 | 2 | describe('Array', function(){ 3 | describe('#indexOf()', function(){ 4 | it('should return -1 when the value is not present', function(){ 5 | [1,2,3].indexOf(5).should.equal(-1); 6 | [1,2,3].indexOf(0).should.equal(-1); 7 | }) 8 | 9 | it('should return the correct index when the value is present', function(){ 10 | [1,2,3].indexOf(1).should.equal(0); 11 | [1,2,3].indexOf(2).should.equal(1); 12 | [1,2,3].indexOf(3).should.equal(2); 13 | }) 14 | }) 15 | }) 16 | 17 | describe('Array', function(){ 18 | describe('#pop()', function(){ 19 | it('should remove and return the last value', function(){ 20 | var arr = [1,2,3]; 21 | arr.pop().should.equal(3); 22 | arr.should.eql([1,2]); 23 | }) 24 | }) 25 | }) 26 | 27 | context('Array', function(){ 28 | beforeEach(function(){ 29 | this.arr = [1,2,3]; 30 | }) 31 | 32 | specify('has a length property', function(){ 33 | this.arr.length.should.equal(3); 34 | }) 35 | }) 36 | -------------------------------------------------------------------------------- /style/inline-graphics/geolocation.js: -------------------------------------------------------------------------------- 1 | 2 | var w, h; 3 | w = h = 16; 4 | 5 | newFile(w, h); 6 | 7 | ctx.fillStyle = 'white'; 8 | ctx.globalCompositeOperation = 'source-over'; 9 | ctx.fillRect (0, 0, w, h); 10 | 11 | function circle(x) { 12 | ctx.beginPath (); 13 | ctx.arc (w / 2, h / 2, w / 2 * x, 0, Math.PI * 2, false); 14 | ctx.fill (); 15 | } 16 | 17 | function triangle(x) { 18 | ctx.save (); 19 | ctx.translate (w / 2, h / 2); 20 | ctx.rotate (x); 21 | ctx.beginPath (); 22 | ctx.moveTo (w * 0, h * -0.25); 23 | ctx.lineTo (w * -0.14, h * -0.5); 24 | ctx.lineTo (w * 0.14, h * -0.5); 25 | ctx.fill (); 26 | ctx.restore (); 27 | } 28 | 29 | ctx.globalCompositeOperation = 'destination-out'; 30 | circle (0.8); 31 | 32 | ctx.globalCompositeOperation = 'source-over'; 33 | triangle (Math.PI * 0); 34 | triangle (Math.PI * 0.5); 35 | triangle (Math.PI * 1); 36 | triangle (Math.PI * 1.5); 37 | 38 | ctx.fillStyle = 'rgba(0,0,0,1)'; 39 | ctx.globalCompositeOperation = 'destination-in'; 40 | circle (1); 41 | 42 | saveFile('geolocation'); 43 | -------------------------------------------------------------------------------- /bin/gen-regex.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | var txt = require('twitter-text'), 4 | fs = require('fs') 5 | 6 | function nonasciiescape(s) { 7 | var o = "" 8 | for (var i = 0; i < s.length; i ++) { 9 | if (s.charCodeAt(i) <= 127) { 10 | o += s.charAt(i) 11 | } else { 12 | var c = '0000' + s.charCodeAt(i).toString(16).toUpperCase() 13 | o += '\\u' + c.substr(c.length - 4) 14 | } 15 | } 16 | if (eval(s) !== eval(o)) { 17 | throw new Error('wtf') 18 | } 19 | return o 20 | } 21 | 22 | function regex(rgx) { 23 | var s = JSON.stringify(rgx.source) 24 | if (process.argv[2] != '-n') s = nonasciiescape(s) 25 | return s 26 | } 27 | 28 | var o = [] 29 | 30 | o.push('T.regex = {};') 31 | o.push('T.regex.hashtag = new RegExp(' + regex(txt.regexen.validHashtag) + ', "g");') 32 | o.push('T.regex.mentionOrList = new RegExp(' + regex(txt.regexen.validMentionOrList) + ', "g");') 33 | 34 | if (process.argv[2] != '-n') { 35 | fs.writeFileSync(__dirname + '/../' + 'client/T/twitter-regex.js', o.join('\n'), 'utf-8') 36 | } else { 37 | console.log(o.join('\n')) 38 | } 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /public/components/mocha/test/browser/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Mocha 4 | 5 | 6 | 7 | 8 | 9 | 14 | 15 | 16 | 17 | 28 | 29 | 30 |
31 | 32 | 33 | -------------------------------------------------------------------------------- /public/components/mocha/test/acceptance/interfaces/tdd.js: -------------------------------------------------------------------------------- 1 | 2 | suite('Array', function(){ 3 | suite('#indexOf()', function(){ 4 | var initialValue = 32; 5 | 6 | suiteSetup(function(done){ 7 | initialValue.should.eql(32); 8 | initialValue = 42; 9 | done(); 10 | }); 11 | 12 | test('should return -1 when the value is not present', function(){ 13 | initialValue.should.eql(42); 14 | [1,2,3].indexOf(5).should.equal(-1); 15 | [1,2,3].indexOf(0).should.equal(-1); 16 | }); 17 | 18 | test('should return the correct index when the value is present', function(){ 19 | initialValue.should.eql(42); 20 | [1,2,3].indexOf(1).should.equal(0); 21 | [1,2,3].indexOf(2).should.equal(1); 22 | [1,2,3].indexOf(3).should.equal(2); 23 | }); 24 | 25 | test.skip('should skip this test', function(){ 26 | var zero = 0; 27 | zero.should.equal(1, 'this test should have been skipped'); 28 | }); 29 | 30 | suiteTeardown(function(done){ 31 | initialValue.should.eql(42); 32 | done(); 33 | }); 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /public/components/sinon/lib/sinon/util/timers_ie.js: -------------------------------------------------------------------------------- 1 | /*global sinon, setTimeout, setInterval, clearTimeout, clearInterval, Date*/ 2 | /** 3 | * Helps IE run the fake timers. By defining global functions, IE allows 4 | * them to be overwritten at a later point. If these are not defined like 5 | * this, overwriting them will result in anything from an exception to browser 6 | * crash. 7 | * 8 | * If you don't require fake timers to work in IE, don't include this file. 9 | * 10 | * @author Christian Johansen (christian@cjohansen.no) 11 | * @license BSD 12 | * 13 | * Copyright (c) 2010-2011 Christian Johansen 14 | */ 15 | function setTimeout() {} 16 | function clearTimeout() {} 17 | function setInterval() {} 18 | function clearInterval() {} 19 | function Date() {} 20 | 21 | // Reassign the original functions. Now their writable attribute 22 | // should be true. Hackish, I know, but it works. 23 | setTimeout = sinon.timers.setTimeout; 24 | clearTimeout = sinon.timers.clearTimeout; 25 | setInterval = sinon.timers.setInterval; 26 | clearInterval = sinon.timers.clearInterval; 27 | Date = sinon.timers.Date; 28 | -------------------------------------------------------------------------------- /public/components/q/queue.js: -------------------------------------------------------------------------------- 1 | 2 | var Q = require("./q"); 3 | 4 | module.exports = Queue; 5 | function Queue() { 6 | var ends = Q.defer(); 7 | var closed = Q.defer(); 8 | return { 9 | put: function (value) { 10 | var next = Q.defer(); 11 | ends.resolve({ 12 | head: value, 13 | tail: next.promise 14 | }); 15 | ends.resolve = next.resolve; 16 | }, 17 | get: function () { 18 | var result = ends.promise.get("head"); 19 | ends.promise = ends.promise.get("tail"); 20 | return result.fail(function (reason) { 21 | closed.resolve(); 22 | throw reason; 23 | }); 24 | }, 25 | closed: closed.promise, 26 | close: function (reason) { 27 | reason = reason || new Error("Can't get value from closed queue"); 28 | var end = {head: Q.reject(reason)}; 29 | end.tail = end; 30 | ends.resolve(end); 31 | return closed.promise; 32 | } 33 | }; 34 | } 35 | 36 | -------------------------------------------------------------------------------- /public/components/mocha/test/browser/array.js: -------------------------------------------------------------------------------- 1 | describe('Array', function(){ 2 | describe('#push()', function(){ 3 | it('should append a value', function(){ 4 | foo = 'asdf' 5 | var arr = []; 6 | arr.push('foo'); 7 | arr.push('bar'); 8 | arr.push('baz'); 9 | assert('foo' == arr[0]); // to test indentation 10 | assert('bar' == arr[1]); 11 | assert('baz' == arr[2]); 12 | }) 13 | 14 | it('should return the length', function(){ 15 | var arr = []; 16 | assert(1 == arr.push('foo')); 17 | assert(2 == arr.push('bar')); 18 | assert(3 == arr.push('baz')); 19 | }) 20 | }) 21 | }) 22 | 23 | describe('Array', function(){ 24 | describe('#pop()', function(){ 25 | it('should remove and return the last value', function(){ 26 | var arr = [1,2,3]; 27 | assert(arr.pop() == 3); 28 | assert(arr.pop() == 2); 29 | assert(arr.pop() == -1); 30 | }) 31 | 32 | it('should adjust .length', function(){ 33 | var arr = [1,2,3]; 34 | arr.pop(); 35 | assert(arr.length == 2); 36 | }) 37 | }) 38 | }) 39 | -------------------------------------------------------------------------------- /public/components/mocha/test/acceptance/globals.js: -------------------------------------------------------------------------------- 1 | 2 | describe('global leaks', function(){ 3 | before(function(){ 4 | // uncomment to test 5 | // foo = 'hey'; 6 | // bar = 'hey'; 7 | }) 8 | 9 | beforeEach(function(){ 10 | // uncomment to test 11 | // foo = 'bar' 12 | }); 13 | 14 | it('should cause tests to fail', function(){ 15 | // uncomment to test 16 | // foo = 'bar'; 17 | // bar = 'baz'; 18 | // baz = 'raz'; 19 | }); 20 | 21 | it('should pass when accepted', function(){ 22 | global.okGlobalA = 1; 23 | global.okGlobalB = 1; 24 | global.okGlobalC = 1; 25 | }) 26 | 27 | it('should pass with wildcard', function(){ 28 | global.callback123 = 'foo'; 29 | global.callback345 = 'bar'; 30 | }); 31 | 32 | it('should pass when prefixed "mocha-"', function(){ 33 | // Opera and IE do this for HTML element IDs anyway 34 | // but to sure we can assert this in any browser, simulate it. 35 | global['mocha-example'] = { nodeType: 1 }; 36 | }); 37 | 38 | afterEach(function(){ 39 | // uncomment to test 40 | // foo = 'bar' 41 | }); 42 | }); 43 | -------------------------------------------------------------------------------- /public/components/sinon/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sinon", 3 | "description": "JavaScript test spies, stubs and mocks.", 4 | "version": "1.5.2", 5 | "homepage": "http://cjohansen.no/sinon/", 6 | "author": "Christian Johansen", 7 | "repository": { 8 | "type": "git", 9 | "url": "http://github.com/cjohansen/Sinon.JS.git" 10 | }, 11 | "bugs": { 12 | "mail": "christian@cjohansen.no", 13 | "url": "http://github.com/cjohansen/Sinon.JS/issues" 14 | }, 15 | "licenses": [ 16 | { "type": "BSD", 17 | "url": "http://github.com/cjohansen/Sinon.JS/blob/master/LICENSE" 18 | } 19 | ], 20 | "scripts": { 21 | "test": "node test/node/run.js" 22 | }, 23 | "dependencies": { 24 | "buster-format": "~0.5" 25 | }, 26 | "devDependencies": { 27 | "buster-core": ">=0.6.4", 28 | "buster-assertions": "~0.10", 29 | "buster-evented-logger": "~0.4", 30 | "buster-test": "~0.5", 31 | "http-server": "*" 32 | }, 33 | "main": "./lib/sinon.js", 34 | "engines": { "node": ">=0.1.103" } 35 | } 36 | -------------------------------------------------------------------------------- /public/components/mocha/lib/reporters/html-cov.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var JSONCov = require('./json-cov') 7 | , fs = require('fs'); 8 | 9 | /** 10 | * Expose `HTMLCov`. 11 | */ 12 | 13 | exports = module.exports = HTMLCov; 14 | 15 | /** 16 | * Initialize a new `JsCoverage` reporter. 17 | * 18 | * @param {Runner} runner 19 | * @api public 20 | */ 21 | 22 | function HTMLCov(runner) { 23 | var jade = require('jade') 24 | , file = __dirname + '/templates/coverage.jade' 25 | , str = fs.readFileSync(file, 'utf8') 26 | , fn = jade.compile(str, { filename: file }) 27 | , self = this; 28 | 29 | JSONCov.call(this, runner, false); 30 | 31 | runner.on('end', function(){ 32 | process.stdout.write(fn({ 33 | cov: self.cov 34 | , coverageClass: coverageClass 35 | })); 36 | }); 37 | } 38 | 39 | /** 40 | * Return coverage class for `n`. 41 | * 42 | * @return {String} 43 | * @api private 44 | */ 45 | 46 | function coverageClass(n) { 47 | if (n >= 75) return 'high'; 48 | if (n >= 50) return 'medium'; 49 | if (n >= 25) return 'low'; 50 | return 'terrible'; 51 | } -------------------------------------------------------------------------------- /public/components/mocha/test/acceptance/interfaces/exports.js: -------------------------------------------------------------------------------- 1 | 2 | var calls = []; 3 | 4 | exports.Array = { 5 | before: function(){ 6 | calls.push('before'); 7 | }, 8 | 9 | after: function(){ 10 | calls.push('after'); 11 | calls.should.eql([ 12 | 'before' 13 | , 'before each' 14 | , 'one' 15 | , 'after each' 16 | , 'before each' 17 | , 'two' 18 | , 'after each' 19 | , 'after']); 20 | }, 21 | 22 | '#indexOf()': { 23 | beforeEach: function(){ 24 | calls.push('before each'); 25 | }, 26 | 27 | afterEach: function(){ 28 | calls.push('after each'); 29 | }, 30 | 31 | 'should return -1 when the value is not present': function(){ 32 | calls.push('one'); 33 | [1,2,3].indexOf(5).should.equal(-1); 34 | [1,2,3].indexOf(0).should.equal(-1); 35 | }, 36 | 37 | 'should return the correct index when the value is present': function(){ 38 | calls.push('two'); 39 | [1,2,3].indexOf(1).should.equal(0); 40 | [1,2,3].indexOf(2).should.equal(1); 41 | [1,2,3].indexOf(3).should.equal(2); 42 | } 43 | } 44 | }; 45 | -------------------------------------------------------------------------------- /public/components/q/examples/async-generators/4-shim.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 32 | 33 | 34 |
35 | 36 | 37 | -------------------------------------------------------------------------------- /public/components/chai/lib/chai/utils/addMethod.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Chai - addMethod utility 3 | * Copyright(c) 2012-2013 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | /** 8 | * ### .addMethod (ctx, name, method) 9 | * 10 | * Adds a method to the prototype of an object. 11 | * 12 | * utils.addMethod(chai.Assertion.prototype, 'foo', function (str) { 13 | * var obj = utils.flag(this, 'object'); 14 | * new chai.Assertion(obj).to.be.equal(str); 15 | * }); 16 | * 17 | * Can also be accessed directly from `chai.Assertion`. 18 | * 19 | * chai.Assertion.addMethod('foo', fn); 20 | * 21 | * Then can be used as any other assertion. 22 | * 23 | * expect(fooStr).to.be.foo('bar'); 24 | * 25 | * @param {Object} ctx object to which the method is added 26 | * @param {String} name of method to add 27 | * @param {Function} method function to be used for name 28 | * @name addMethod 29 | * @api public 30 | */ 31 | 32 | module.exports = function (ctx, name, method) { 33 | ctx[name] = function () { 34 | var result = method.apply(this, arguments); 35 | return result === undefined ? this : result; 36 | }; 37 | }; 38 | -------------------------------------------------------------------------------- /public/components/chai/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Jake Luer ", 3 | "name": "chai", 4 | "description": "BDD/TDD assertion library for node.js and the browser. Test framework agnostic.", 5 | "keywords": [ "test", "assertion", "assert", "testing", "chai" ], 6 | "homepage": "http://chaijs.com", 7 | "license": "MIT", 8 | "contributors": [ 9 | "Jake Luer ", 10 | "Domenic Denicola (http://domenicdenicola.com)", 11 | "Veselin Todorov ", 12 | "John Firebaugh " 13 | ], 14 | "version": "1.6.0", 15 | "repository": { 16 | "type": "git", 17 | "url": "https://github.com/chaijs/chai" 18 | }, 19 | "bugs": { 20 | "url": "https://github.com/chaijs/chai/issues" 21 | }, 22 | "main": "./index", 23 | "scripts": { 24 | "test": "make test" 25 | }, 26 | "engines": { 27 | "node": ">= 0.4.0" 28 | }, 29 | "dependencies": {}, 30 | "devDependencies": { 31 | "component": "*" 32 | , "mocha": "*" 33 | , "mocha-cloud": "*" 34 | , "mocha-phantomjs": "*" 35 | , "connect": "2.7.x" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /public/components/q/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Copyright 2009–2012 Kristopher Michael Kowal. All rights reserved. 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 5 | deal in the Software without restriction, including without limitation the 6 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | sell 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 18 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | IN THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /public/components/q/spec/lib/jasmine-1.2.0/MIT.LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2008-2011 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 | -------------------------------------------------------------------------------- /public/components/underscore/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2013 Jeremy Ashkenas, DocumentCloud 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /public/components/q/examples/async-generators/3-wishful-thinking.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 32 | 33 | 34 |
35 | 36 | 37 | -------------------------------------------------------------------------------- /public/components/q/examples/async-generators/1-return.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 32 | 33 | 34 |
35 | 36 | 37 | -------------------------------------------------------------------------------- /public/components/mocha/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2011-2013 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. 23 | -------------------------------------------------------------------------------- /public/components/underscore/README.md: -------------------------------------------------------------------------------- 1 | __ 2 | /\ \ __ 3 | __ __ ___ \_\ \ __ _ __ ____ ___ ___ _ __ __ /\_\ ____ 4 | /\ \/\ \ /' _ `\ /'_ \ /'__`\/\ __\/ ,__\ / ___\ / __`\/\ __\/'__`\ \/\ \ /',__\ 5 | \ \ \_\ \/\ \/\ \/\ \ \ \/\ __/\ \ \//\__, `\/\ \__//\ \ \ \ \ \//\ __/ __ \ \ \/\__, `\ 6 | \ \____/\ \_\ \_\ \___,_\ \____\\ \_\\/\____/\ \____\ \____/\ \_\\ \____\/\_\ _\ \ \/\____/ 7 | \/___/ \/_/\/_/\/__,_ /\/____/ \/_/ \/___/ \/____/\/___/ \/_/ \/____/\/_//\ \_\ \/___/ 8 | \ \____/ 9 | \/___/ 10 | 11 | Underscore.js is a utility-belt library for JavaScript that provides 12 | support for the usual functional suspects (each, map, reduce, filter...) 13 | without extending any core JavaScript objects. 14 | 15 | For Docs, License, Tests, and pre-packed downloads, see: 16 | http://underscorejs.org 17 | 18 | Many thanks to our contributors: 19 | https://github.com/documentcloud/underscore/contributors 20 | -------------------------------------------------------------------------------- /test/text-conformance-test.coffee: -------------------------------------------------------------------------------- 1 | 2 | fs = require 'fs' 3 | vm = require 'vm' 4 | { tests } = require './twitter-text-conformance/extract' 5 | 6 | describe 'T.text conformance', -> 7 | 8 | context = vm.createContext({ T: {} }) 9 | vm.runInContext(fs.readFileSync(__dirname + '/../' + './client/vendor/underscore-min.js', 'utf-8'), context) 10 | vm.runInContext(fs.readFileSync(__dirname + '/../' + './client/T/Y.js', 'utf-8'), context) 11 | vm.runInContext(fs.readFileSync(__dirname + '/../' + './client/T/twitter-regex.js', 'utf-8'), context) 12 | vm.runInContext(fs.readFileSync(__dirname + '/../' + './client/T/text.js', 'utf-8'), context) 13 | 14 | eachTest = (list, callback) -> 15 | list.forEach (testcase) -> 16 | it 'should ' + testcase.description.replace(/^[a-z]/, (a) -> a.toLowerCase()), -> 17 | callback(testcase) 18 | 19 | testExtract = (type, twtype) -> -> 20 | eachTest tests[type], (testcase) -> 21 | text = context.T.text(testcase.text) 22 | list = (c.text.substr(1) for c in text.entities when c.type == twtype) 23 | expect(list).to.deep.equal(testcase.expected) 24 | 25 | describe.skip 'mentions', testExtract('mentions', 'user') 26 | describe.skip 'hashtags', testExtract('hashtags', 'hashtag') 27 | 28 | 29 | -------------------------------------------------------------------------------- /public/components/chai/lib/chai/utils/addProperty.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Chai - addProperty utility 3 | * Copyright(c) 2012-2013 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | /** 8 | * ### addProperty (ctx, name, getter) 9 | * 10 | * Adds a property to the prototype of an object. 11 | * 12 | * utils.addProperty(chai.Assertion.prototype, 'foo', function () { 13 | * var obj = utils.flag(this, 'object'); 14 | * new chai.Assertion(obj).to.be.instanceof(Foo); 15 | * }); 16 | * 17 | * Can also be accessed directly from `chai.Assertion`. 18 | * 19 | * chai.Assertion.addProperty('foo', fn); 20 | * 21 | * Then can be used as any other assertion. 22 | * 23 | * expect(myFoo).to.be.foo; 24 | * 25 | * @param {Object} ctx object to which the property is added 26 | * @param {String} name of property to add 27 | * @param {Function} getter function to be used for name 28 | * @name addProperty 29 | * @api public 30 | */ 31 | 32 | module.exports = function (ctx, name, getter) { 33 | Object.defineProperty(ctx, name, 34 | { get: function () { 35 | var result = getter.call(this); 36 | return result === undefined ? this : result; 37 | } 38 | , configurable: true 39 | }); 40 | }; 41 | -------------------------------------------------------------------------------- /public/components/chai/test/browser/sauce.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Mocha 5 | 6 | 7 | 8 | 9 | 10 | 11 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 32 | 33 | 34 |
35 | 36 | 37 | -------------------------------------------------------------------------------- /client/conf/twitter-config.js: -------------------------------------------------------------------------------- 1 | TWITTER_CONFIG= 2 | {"photo_size_limit":3145728,"short_url_length_https":23,"characters_reserved_per_media":23,"photo_sizes":{"large":{"w":1024,"resize":"fit","h":2048},"medium":{"w":600,"resize":"fit","h":1200},"small":{"w":340,"resize":"fit","h":480},"thumb":{"w":150,"resize":"crop","h":150}},"max_media_per_upload":1,"non_username_paths":["about","account","accounts","activity","all","announcements","anywhere","api_rules","api_terms","apirules","apps","auth","badges","blog","business","buttons","contacts","devices","direct_messages","download","downloads","edit_announcements","faq","favorites","find_sources","find_users","followers","following","friend_request","friendrequest","friends","goodies","help","home","im_account","inbox","invitations","invite","jobs","list","login","logo","logout","me","mentions","messages","mockview","newtwitter","notifications","nudge","oauth","phoenix_search","positions","privacy","public_timeline","related_tweets","replies","retweeted_of_mine","retweets","retweets_by_others","rules","saved_searches","search","sent","settings","share","signup","signin","similar_to","statistics","terms","tos","translate","trends","tweetbutton","twttr","update_discoverability","users","welcome","who_to_follow","widgets","zendesk_auth","media_signup"],"short_url_length":22} -------------------------------------------------------------------------------- /public/components/q/examples/async-generators/2-error-propagation.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 33 | 34 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /resources/configuration.json: -------------------------------------------------------------------------------- 1 | {"short_url_length_https":21,"characters_reserved_per_media":21,"photo_size_limit":3145728,"photo_sizes":{"small":{"h":480,"w":340,"resize":"fit"},"large":{"h":2048,"w":1024,"resize":"fit"},"medium":{"h":1200,"w":600,"resize":"fit"},"thumb":{"h":150,"w":150,"resize":"crop"}},"short_url_length":20,"non_username_paths":["about","account","accounts","activity","all","announcements","anywhere","api_rules","api_terms","apirules","apps","auth","badges","blog","business","buttons","contacts","devices","direct_messages","download","downloads","edit_announcements","faq","favorites","find_sources","find_users","followers","following","friend_request","friendrequest","friends","goodies","help","home","im_account","inbox","invitations","invite","jobs","list","login","logout","me","mentions","messages","mockview","newtwitter","notifications","nudge","oauth","phoenix_search","positions","privacy","public_timeline","related_tweets","replies","retweeted_of_mine","retweets","retweets_by_others","rules","saved_searches","search","sent","settings","share","signup","signin","similar_to","statistics","terms","tos","translate","trends","tweetbutton","twttr","update_discoverability","users","welcome","who_to_follow","widgets","zendesk_auth","media_signup","t1_qunit_tests","phoenix_qunit_tests"],"max_media_per_upload":1} -------------------------------------------------------------------------------- /public/components/mocha/bin/mocha: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /** 4 | * This tiny wrapper file checks for known node flags and appends them 5 | * when found, before invoking the "real" _mocha(1) executable. 6 | */ 7 | 8 | var spawn = require('child_process').spawn 9 | , args = [ __dirname + '/_mocha' ]; 10 | 11 | process.argv.slice(2).forEach(function (arg) { 12 | switch (arg) { 13 | case '-d': 14 | args.unshift('--debug'); 15 | break; 16 | case 'debug': 17 | case '--debug': 18 | case '--debug-brk': 19 | args.unshift(arg); 20 | break; 21 | case '-gc': 22 | case '--expose-gc': 23 | args.unshift('--expose-gc'); 24 | break; 25 | case '--gc-global': 26 | case '--harmony': 27 | case '--harmony-proxies': 28 | case '--harmony-collections': 29 | args.unshift(arg); 30 | break; 31 | default: 32 | if (0 == arg.indexOf('--trace')) args.unshift(arg); 33 | else args.push(arg); 34 | break; 35 | } 36 | }); 37 | 38 | var proc = spawn(process.argv[0], args, { customFds: [0,1,2] }); 39 | proc.on('exit', function (code, signal) { 40 | process.on('exit', function(){ 41 | if (signal) { 42 | process.kill(process.pid, signal); 43 | } else { 44 | process.exit(code); 45 | } 46 | }); 47 | }); 48 | -------------------------------------------------------------------------------- /public/components/chai/lib/chai/utils/type.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Chai - type utility 3 | * Copyright(c) 2012-2013 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | /*! 8 | * Detectable javascript natives 9 | */ 10 | 11 | var natives = { 12 | '[object Arguments]': 'arguments' 13 | , '[object Array]': 'array' 14 | , '[object Date]': 'date' 15 | , '[object Function]': 'function' 16 | , '[object Number]': 'number' 17 | , '[object RegExp]': 'regexp' 18 | , '[object String]': 'string' 19 | }; 20 | 21 | /** 22 | * ### type(object) 23 | * 24 | * Better implementation of `typeof` detection that can 25 | * be used cross-browser. Handles the inconsistencies of 26 | * Array, `null`, and `undefined` detection. 27 | * 28 | * utils.type({}) // 'object' 29 | * utils.type(null) // `null' 30 | * utils.type(undefined) // `undefined` 31 | * utils.type([]) // `array` 32 | * 33 | * @param {Mixed} object to detect type of 34 | * @name type 35 | * @api private 36 | */ 37 | 38 | module.exports = function (obj) { 39 | var str = Object.prototype.toString.call(obj); 40 | if (natives[str]) return natives[str]; 41 | if (obj === null) return 'null'; 42 | if (obj === undefined) return 'undefined'; 43 | if (obj === Object(obj)) return 'object'; 44 | return typeof obj; 45 | }; 46 | -------------------------------------------------------------------------------- /public/components/q/ref_send.md: -------------------------------------------------------------------------------- 1 | 2 | This API varies from Tyler Closes ref_send in the 3 | following ways: 4 | 5 | * Promises can be resolved to function values. 6 | * Promises can be resolved to null or undefined. 7 | * Promises are distinguishable from arbitrary functions. 8 | * The promise API is abstracted with a Promise constructor 9 | that accepts a descriptor that receives all of the 10 | messages forwarded to that promise and handles the 11 | common patterns for message receivers. The promise 12 | constructor also takes optional fallback and valueOf 13 | methods which handle the cases for missing handlers on 14 | the descriptor (rejection by default) and the valueOf 15 | call (which returns the promise itself by default) 16 | * near(ref) has been changed to Promise.valueOf() in 17 | keeping with JavaScript's existing Object.valueOf(). 18 | * post(promise, name, args) has been altered to a variadic 19 | post(promise, name ...args) 20 | * variadic arguments are used internally where 21 | applicable. However, I have not altered the Q.post() 22 | API to expand variadic arguments since Tyler Close 23 | informed the CommonJS list that it would restrict 24 | usage patterns for web_send, posting arbitrary JSON 25 | objects as the "arguments" over HTTP. 26 | 27 | -------------------------------------------------------------------------------- /public/components/sinon/jsl.conf: -------------------------------------------------------------------------------- 1 | -inc_dec_within_stmt 2 | -unreferenced_function 3 | -unreferenced_variable 4 | -unreferenced_argument 5 | -want_assign_or_call 6 | -anon_no_return_value 7 | 8 | +define module 9 | +define require 10 | +define __dirname 11 | +define document 12 | +define sinon 13 | +define ActiveXObject 14 | +define window 15 | +define DOMParser 16 | +define setTimeout 17 | +define clearTimeout 18 | +define setInterval 19 | +define clearInterval 20 | +define XMLHttpRequest 21 | +define testCase 22 | +define jstestdriver 23 | +define TestCase 24 | +define QUnit 25 | +define test 26 | +define ok 27 | +define assert 28 | +define assertBoolean 29 | +define assertTrue 30 | +define assertFalse 31 | +define assertNumber 32 | +define assertNull 33 | +define assertNotNull 34 | +define assertException 35 | +define assertNoException 36 | +define assertFunction 37 | +define assertUndefined 38 | +define assertObject 39 | +define assertArray 40 | +define assertSame 41 | +define assertNotSame 42 | +define assertEquals 43 | +define assertNotEquals 44 | +define assertCalled 45 | +define assertCalledOn 46 | +define assertCalledWith 47 | +define assertCalledWithExactly 48 | +define assertThrew 49 | +define assertCallCount 50 | +define assertString 51 | +define fail 52 | +define failException 53 | 54 | +output-format __FILENAME__(__LINE__): __ERROR__ -------------------------------------------------------------------------------- /public/components/sinon/test/rhino/run.js: -------------------------------------------------------------------------------- 1 | var jstestdriver = {}; 2 | 3 | load("test/rhino/env.rhino.1.2.js"); 4 | load("test/Asserts.js"); 5 | load("test/test_case_shim.js"); 6 | 7 | load("lib/sinon.js"); 8 | load("lib/sinon/assert.js"); 9 | load("lib/sinon/collection.js"); 10 | load("lib/sinon/mock.js"); 11 | load("lib/sinon/sandbox.js"); 12 | load("lib/sinon/spy.js"); 13 | load("lib/sinon/stub.js"); 14 | load("lib/sinon/test_case.js"); 15 | load("lib/sinon/test.js"); 16 | load("lib/sinon/match.js"); 17 | load("lib/sinon/util/fake_server.js"); 18 | load("lib/sinon/util/fake_server_with_clock.js"); 19 | load("lib/sinon/util/fake_timers.js"); 20 | load("lib/sinon/util/fake_xml_http_request.js"); 21 | load("lib/sinon/util/timers_ie.js"); 22 | 23 | load("test/sinon_test.js"); 24 | load("test/sinon/assert_test.js"); 25 | load("test/sinon/collection_test.js"); 26 | load("test/sinon/mock_test.js"); 27 | load("test/sinon/sandbox_test.js"); 28 | load("test/sinon/spy_test.js"); 29 | load("test/sinon/stub_test.js"); 30 | load("test/sinon/test_case_test.js"); 31 | load("test/sinon/test_test.js"); 32 | load("test/sinon/match_test.js"); 33 | load("test/sinon/util/fake_server_test.js"); 34 | load("test/sinon/util/fake_server_with_clock_test.js"); 35 | load("test/sinon/util/fake_timers_test.js"); 36 | load("test/sinon/util/fake_xml_http_request_test.js"); 37 | -------------------------------------------------------------------------------- /public/components/mocha/test/acceptance/misc/cascade.js: -------------------------------------------------------------------------------- 1 | 2 | describe('one', function(){ 3 | before(function(){ 4 | console.log('before one'); 5 | }) 6 | 7 | after(function(){ 8 | console.log('after one'); 9 | }) 10 | 11 | beforeEach(function(){ 12 | console.log(' before each one'); 13 | }) 14 | 15 | afterEach(function(){ 16 | console.log(' after each one'); 17 | }) 18 | 19 | describe('two', function(){ 20 | before(function(){ 21 | console.log(' before two'); 22 | }) 23 | 24 | after(function(){ 25 | console.log(' after two'); 26 | }) 27 | 28 | beforeEach(function(){ 29 | console.log(' before each two'); 30 | }) 31 | 32 | afterEach(function(){ 33 | console.log(' after each two'); 34 | }) 35 | 36 | describe('three', function(){ 37 | before(function(){ 38 | console.log(' before three'); 39 | }) 40 | 41 | after(function(){ 42 | console.log(' after three'); 43 | }) 44 | 45 | beforeEach(function(){ 46 | console.log(' before each three'); 47 | }) 48 | 49 | afterEach(function(){ 50 | console.log(' after each three'); 51 | }) 52 | 53 | it('should three', function(){ 54 | console.log(' TEST three'); 55 | }) 56 | }) 57 | }) 58 | }) 59 | -------------------------------------------------------------------------------- /public/components/chai/lib/chai/utils/objDisplay.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Chai - flag utility 3 | * Copyright(c) 2012-2013 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | /*! 8 | * Module dependancies 9 | */ 10 | 11 | var inspect = require('./inspect'); 12 | 13 | /** 14 | * ### .objDisplay (object) 15 | * 16 | * Determines if an object or an array matches 17 | * criteria to be inspected in-line for error 18 | * messages or should be truncated. 19 | * 20 | * @param {Mixed} javascript object to inspect 21 | * @name objDisplay 22 | * @api public 23 | */ 24 | 25 | module.exports = function (obj) { 26 | var str = inspect(obj) 27 | , type = Object.prototype.toString.call(obj); 28 | 29 | if (str.length >= 40) { 30 | if (type === '[object Function]') { 31 | return !obj.name || obj.name === '' 32 | ? '[Function]' 33 | : '[Function: ' + obj.name + ']'; 34 | } else if (type === '[object Array]') { 35 | return '[ Array(' + obj.length + ') ]'; 36 | } else if (type === '[object Object]') { 37 | var keys = Object.keys(obj) 38 | , kstr = keys.length > 2 39 | ? keys.splice(0, 2).join(', ') + ', ...' 40 | : keys.join(', '); 41 | return '{ Object (' + kstr + ') }'; 42 | } else { 43 | return str; 44 | } 45 | } else { 46 | return str; 47 | } 48 | }; 49 | -------------------------------------------------------------------------------- /public/components/mocha/lib/reporters/json-stream.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var Base = require('./base') 7 | , color = Base.color; 8 | 9 | /** 10 | * Expose `List`. 11 | */ 12 | 13 | exports = module.exports = List; 14 | 15 | /** 16 | * Initialize a new `List` test reporter. 17 | * 18 | * @param {Runner} runner 19 | * @api public 20 | */ 21 | 22 | function List(runner) { 23 | Base.call(this, runner); 24 | 25 | var self = this 26 | , stats = this.stats 27 | , total = runner.total; 28 | 29 | runner.on('start', function(){ 30 | console.log(JSON.stringify(['start', { total: total }])); 31 | }); 32 | 33 | runner.on('pass', function(test){ 34 | console.log(JSON.stringify(['pass', clean(test)])); 35 | }); 36 | 37 | runner.on('fail', function(test, err){ 38 | console.log(JSON.stringify(['fail', clean(test)])); 39 | }); 40 | 41 | runner.on('end', function(){ 42 | process.stdout.write(JSON.stringify(['end', self.stats])); 43 | }); 44 | } 45 | 46 | /** 47 | * Return a plain-object representation of `test` 48 | * free of cyclic properties etc. 49 | * 50 | * @param {Object} test 51 | * @return {Object} 52 | * @api private 53 | */ 54 | 55 | function clean(test) { 56 | return { 57 | title: test.title 58 | , fullTitle: test.fullTitle() 59 | , duration: test.duration 60 | } 61 | } -------------------------------------------------------------------------------- /client/test/Y_spec.coffee: -------------------------------------------------------------------------------- 1 | 2 | 3 | describe 'Y', -> 4 | 5 | 6 | describe '.get', -> 7 | it 'should get a property from an object', -> 8 | expect(Y.get('a')(a: 123)).to.equal(123) 9 | expect(Y.get('z')(a: 123)).to.equal(undefined) 10 | 11 | 12 | describe '.isNull', -> 13 | it 'should return true when yield not null', -> 14 | expect(Y.isNull(-> true)()).to.equal(false) 15 | expect(Y.isNull(-> false)()).to.equal(false) 16 | expect(Y.isNull(-> undefined)()).to.equal(true) 17 | expect(Y.isNull(-> null)()).to.equal(true) 18 | 19 | 20 | describe '.not', -> 21 | it 'should return true when yield falsy value, vice versa', -> 22 | expect(Y.not(-> true)()).to.equal(false) 23 | expect(Y.not(-> false)()).to.equal(true) 24 | expect(Y.not(-> undefined)()).to.equal(true) 25 | expect(Y.not(-> '')()).to.equal(true) 26 | expect(Y.not(-> 0)()).to.equal(true) 27 | expect(Y.not(-> '0')()).to.equal(false) 28 | expect(Y.not(-> 'zz')()).to.equal(false) 29 | 30 | describe '.notNull', -> 31 | it 'should return true when the subject is not null', -> 32 | expect(Y.notNull(-> true)()).to.equal(true) 33 | expect(Y.notNull(-> false)()).to.equal(true) 34 | expect(Y.notNull(-> undefined)()).to.equal(false) 35 | expect(Y.notNull(-> null)()).to.equal(false) 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /public/components/mocha/test/http.meta.js: -------------------------------------------------------------------------------- 1 | 2 | var http = require('http'); 3 | 4 | var server = http.createServer(function(req, res){ 5 | var accept = req.headers.accept || '' 6 | , json = ~accept.indexOf('json'); 7 | 8 | switch (req.url) { 9 | case '/': 10 | res.end('hello'); 11 | break; 12 | case '/users': 13 | if (json) { 14 | res.end('["tobi","loki","jane"]'); 15 | } else { 16 | res.end('tobi, loki, jane'); 17 | } 18 | break; 19 | } 20 | }) 21 | 22 | server.listen(8889); 23 | 24 | function get(url, body, header) { 25 | return function(done){ 26 | http.get({ path: url, port: 8889, headers: header }, function(res){ 27 | var buf = ''; 28 | res.should.have.status(200); 29 | res.setEncoding('utf8'); 30 | res.on('data', function(chunk){ buf += chunk }); 31 | res.on('end', function(){ 32 | buf.should.equal(body); 33 | done(); 34 | }); 35 | }) 36 | } 37 | } 38 | 39 | describe('http requests', function(){ 40 | describe('GET /', function(){ 41 | it('should respond with hello', 42 | get('/', 'hello')) 43 | }) 44 | 45 | describe('GET /users', function(){ 46 | it('should respond with users', 47 | get('/users', 'tobi, loki, jane')) 48 | 49 | it('should respond with users', 50 | get('/users', '["tobi","loki","jane"]', { Accept: 'application/json' })) 51 | }) 52 | }) -------------------------------------------------------------------------------- /client/test/future_spec.coffee: -------------------------------------------------------------------------------- 1 | 2 | 3 | describe 'T.future', -> 4 | 5 | 6 | it 'should call the init function synchronously', -> 7 | ok = false 8 | T.future(-> ok = true) 9 | expect(ok).to.be.ok 10 | 11 | 12 | it 'should be able to accept', testFuture -> 13 | 14 | expectFuture(T.future((r) -> r.accept('123'))) 15 | .to.resolve((value) -> expect(value).to.equal('123')) 16 | 17 | 18 | it 'should be able to resolve', testFuture -> 19 | 20 | expectFuture(T.future((r) -> r.resolve(T.future((s) -> s.resolve('555'))))) 21 | .to.resolve((value) -> expect(value).to.equal('555')) 22 | 23 | 24 | it 'should be able to reject', testFuture -> 25 | 26 | expectFuture(T.future((r) -> r.reject('456'))) 27 | .to.reject((value) -> expect(value).to.equal('456')) 28 | 29 | 30 | it 'should reject when init throws', testFuture -> 31 | 32 | expectFuture(T.future((r) -> throw new Error('wtf'))) 33 | .to.reject((e) -> expect(e.message).to.equal('wtf')) 34 | 35 | 36 | describe '.accept', -> 37 | it 'should create an accepted future', testFuture -> 38 | expectFuture(T.future.accept('hello')) 39 | .to.resolve((value) -> expect(value).to.equal('hello')) 40 | 41 | 42 | describe '.reject', -> 43 | it 'should create a rejected future', testFuture -> 44 | expectFuture(T.future.reject('wtf')) 45 | .to.reject((value) -> expect(value).to.equal('wtf')) 46 | 47 | -------------------------------------------------------------------------------- /public/components/mocha/lib/context.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Expose `Context`. 4 | */ 5 | 6 | module.exports = Context; 7 | 8 | /** 9 | * Initialize a new `Context`. 10 | * 11 | * @api private 12 | */ 13 | 14 | function Context(){} 15 | 16 | /** 17 | * Set or get the context `Runnable` to `runnable`. 18 | * 19 | * @param {Runnable} runnable 20 | * @return {Context} 21 | * @api private 22 | */ 23 | 24 | Context.prototype.runnable = function(runnable){ 25 | if (0 == arguments.length) return this._runnable; 26 | this.test = this._runnable = runnable; 27 | return this; 28 | }; 29 | 30 | /** 31 | * Set test timeout `ms`. 32 | * 33 | * @param {Number} ms 34 | * @return {Context} self 35 | * @api private 36 | */ 37 | 38 | Context.prototype.timeout = function(ms){ 39 | this.runnable().timeout(ms); 40 | return this; 41 | }; 42 | 43 | /** 44 | * Set test slowness threshold `ms`. 45 | * 46 | * @param {Number} ms 47 | * @return {Context} self 48 | * @api private 49 | */ 50 | 51 | Context.prototype.slow = function(ms){ 52 | this.runnable().slow(ms); 53 | return this; 54 | }; 55 | 56 | /** 57 | * Inspect the context void of `._runnable`. 58 | * 59 | * @return {String} 60 | * @api private 61 | */ 62 | 63 | Context.prototype.inspect = function(){ 64 | return JSON.stringify(this, function(key, val){ 65 | if ('_runnable' == key) return; 66 | if ('test' == key) return; 67 | return val; 68 | }, 2); 69 | }; 70 | -------------------------------------------------------------------------------- /public/components/mocha/lib/reporters/doc.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var Base = require('./base') 7 | , utils = require('../utils'); 8 | 9 | /** 10 | * Expose `Doc`. 11 | */ 12 | 13 | exports = module.exports = Doc; 14 | 15 | /** 16 | * Initialize a new `Doc` reporter. 17 | * 18 | * @param {Runner} runner 19 | * @api public 20 | */ 21 | 22 | function Doc(runner) { 23 | Base.call(this, runner); 24 | 25 | var self = this 26 | , stats = this.stats 27 | , total = runner.total 28 | , indents = 2; 29 | 30 | function indent() { 31 | return Array(indents).join(' '); 32 | } 33 | 34 | runner.on('suite', function(suite){ 35 | if (suite.root) return; 36 | ++indents; 37 | console.log('%s
', indent()); 38 | ++indents; 39 | console.log('%s

%s

', indent(), utils.escape(suite.title)); 40 | console.log('%s
', indent()); 41 | }); 42 | 43 | runner.on('suite end', function(suite){ 44 | if (suite.root) return; 45 | console.log('%s
', indent()); 46 | --indents; 47 | console.log('%s
', indent()); 48 | --indents; 49 | }); 50 | 51 | runner.on('pass', function(test){ 52 | console.log('%s
%s
', indent(), utils.escape(test.title)); 53 | var code = utils.escape(utils.clean(test.fn.toString())); 54 | console.log('%s
%s
', indent(), code); 55 | }); 56 | } 57 | -------------------------------------------------------------------------------- /public/components/mocha/test/grep.js: -------------------------------------------------------------------------------- 1 | 2 | var Mocha = require('../'); 3 | 4 | describe('Mocha', function(){ 5 | describe('"grep" option', function(){ 6 | it('should add a RegExp to the mocha.options object', function(){ 7 | var mocha = new Mocha({ grep: /foo/ }); 8 | mocha.options.grep.toString().should.equal('/foo/'); 9 | }) 10 | 11 | it('should convert grep string to a RegExp', function(){ 12 | var mocha = new Mocha({ grep: 'foo' }); 13 | mocha.options.grep.toString().should.equal('/foo/'); 14 | }) 15 | }) 16 | 17 | describe('.grep()', function(){ 18 | it('should add a RegExp to the mocha.options object', function(){ 19 | var mocha = new Mocha; 20 | mocha.grep(/foo/); 21 | mocha.options.grep.toString().should.equal('/foo/'); 22 | }) 23 | 24 | it('should convert grep string to a RegExp', function(){ 25 | var mocha = new Mocha; 26 | mocha.grep('foo'); 27 | mocha.options.grep.toString().should.equal('/foo/'); 28 | }) 29 | 30 | it('should return it\'s parent Mocha object for chainability', function(){ 31 | var mocha = new Mocha; 32 | mocha.grep().should.equal(mocha); 33 | }) 34 | }) 35 | 36 | describe('"invert" option', function(){ 37 | it('should add a Boolean to the mocha.options object', function(){ 38 | var mocha = new Mocha({ invert: true }); 39 | mocha.options.invert.should.be.ok; 40 | }) 41 | }) 42 | }) 43 | -------------------------------------------------------------------------------- /public/components/q/examples/async-generators/0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | 39 | 40 | 41 |
42 | 43 | 44 | -------------------------------------------------------------------------------- /public/components/chai/lib/chai/error.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * chai 3 | * Copyright(c) 2011-2013 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | /*! 8 | * Main export 9 | */ 10 | 11 | module.exports = AssertionError; 12 | 13 | /** 14 | * # AssertionError (constructor) 15 | * 16 | * Create a new assertion error based on the Javascript 17 | * `Error` prototype. 18 | * 19 | * **Options** 20 | * - message 21 | * - actual 22 | * - expected 23 | * - operator 24 | * - startStackFunction 25 | * 26 | * @param {Object} options 27 | * @api public 28 | */ 29 | 30 | function AssertionError (options) { 31 | options = options || {}; 32 | this.message = options.message; 33 | this.actual = options.actual; 34 | this.expected = options.expected; 35 | this.operator = options.operator; 36 | this.showDiff = options.showDiff; 37 | 38 | if (options.stackStartFunction && Error.captureStackTrace) { 39 | var stackStartFunction = options.stackStartFunction; 40 | Error.captureStackTrace(this, stackStartFunction); 41 | } 42 | } 43 | 44 | /*! 45 | * Inherit from Error 46 | */ 47 | 48 | AssertionError.prototype = Object.create(Error.prototype); 49 | AssertionError.prototype.name = 'AssertionError'; 50 | AssertionError.prototype.constructor = AssertionError; 51 | 52 | /** 53 | * # toString() 54 | * 55 | * Override default to string method 56 | */ 57 | 58 | AssertionError.prototype.toString = function() { 59 | return this.message; 60 | }; 61 | -------------------------------------------------------------------------------- /public/components/mocha/lib/reporters/json.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var Base = require('./base') 7 | , cursor = Base.cursor 8 | , color = Base.color; 9 | 10 | /** 11 | * Expose `JSON`. 12 | */ 13 | 14 | exports = module.exports = JSONReporter; 15 | 16 | /** 17 | * Initialize a new `JSON` reporter. 18 | * 19 | * @param {Runner} runner 20 | * @api public 21 | */ 22 | 23 | function JSONReporter(runner) { 24 | var self = this; 25 | Base.call(this, runner); 26 | 27 | var tests = [] 28 | , failures = [] 29 | , passes = []; 30 | 31 | runner.on('test end', function(test){ 32 | tests.push(test); 33 | }); 34 | 35 | runner.on('pass', function(test){ 36 | passes.push(test); 37 | }); 38 | 39 | runner.on('fail', function(test){ 40 | failures.push(test); 41 | }); 42 | 43 | runner.on('end', function(){ 44 | var obj = { 45 | stats: self.stats 46 | , tests: tests.map(clean) 47 | , failures: failures.map(clean) 48 | , passes: passes.map(clean) 49 | }; 50 | 51 | process.stdout.write(JSON.stringify(obj, null, 2)); 52 | }); 53 | } 54 | 55 | /** 56 | * Return a plain-object representation of `test` 57 | * free of cyclic properties etc. 58 | * 59 | * @param {Object} test 60 | * @return {Object} 61 | * @api private 62 | */ 63 | 64 | function clean(test) { 65 | return { 66 | title: test.title 67 | , fullTitle: test.fullTitle() 68 | , duration: test.duration 69 | } 70 | } -------------------------------------------------------------------------------- /public/components/mocha/lib/reporters/dot.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var Base = require('./base') 7 | , color = Base.color; 8 | 9 | /** 10 | * Expose `Dot`. 11 | */ 12 | 13 | exports = module.exports = Dot; 14 | 15 | /** 16 | * Initialize a new `Dot` matrix test reporter. 17 | * 18 | * @param {Runner} runner 19 | * @api public 20 | */ 21 | 22 | function Dot(runner) { 23 | Base.call(this, runner); 24 | 25 | var self = this 26 | , stats = this.stats 27 | , width = Base.window.width * .75 | 0 28 | , n = 0; 29 | 30 | runner.on('start', function(){ 31 | process.stdout.write('\n '); 32 | }); 33 | 34 | runner.on('pending', function(test){ 35 | process.stdout.write(color('pending', Base.symbols.dot)); 36 | }); 37 | 38 | runner.on('pass', function(test){ 39 | if (++n % width == 0) process.stdout.write('\n '); 40 | if ('slow' == test.speed) { 41 | process.stdout.write(color('bright yellow', Base.symbols.dot)); 42 | } else { 43 | process.stdout.write(color(test.speed, Base.symbols.dot)); 44 | } 45 | }); 46 | 47 | runner.on('fail', function(test, err){ 48 | if (++n % width == 0) process.stdout.write('\n '); 49 | process.stdout.write(color('fail', Base.symbols.dot)); 50 | }); 51 | 52 | runner.on('end', function(){ 53 | console.log(); 54 | self.epilogue(); 55 | }); 56 | } 57 | 58 | /** 59 | * Inherit from `Base.prototype`. 60 | */ 61 | 62 | Dot.prototype.__proto__ = Base.prototype; -------------------------------------------------------------------------------- /public/components/chai/test/browser/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Mocha 5 | 6 | 7 | 8 | 9 | 10 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 40 | 41 | 42 |
43 | 44 | 45 | -------------------------------------------------------------------------------- /public/components/chai/lib/chai.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * chai 3 | * Copyright(c) 2011-2013 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | var used = [] 8 | , exports = module.exports = {}; 9 | 10 | /*! 11 | * Chai version 12 | */ 13 | 14 | exports.version = '1.6.0'; 15 | 16 | /*! 17 | * Primary `Assertion` prototype 18 | */ 19 | 20 | exports.Assertion = require('./chai/assertion'); 21 | 22 | /*! 23 | * Assertion Error 24 | */ 25 | 26 | exports.AssertionError = require('./chai/error'); 27 | 28 | /*! 29 | * Utils for plugins (not exported) 30 | */ 31 | 32 | var util = require('./chai/utils'); 33 | 34 | /** 35 | * # .use(function) 36 | * 37 | * Provides a way to extend the internals of Chai 38 | * 39 | * @param {Function} 40 | * @returns {this} for chaining 41 | * @api public 42 | */ 43 | 44 | exports.use = function (fn) { 45 | if (!~used.indexOf(fn)) { 46 | fn(this, util); 47 | used.push(fn); 48 | } 49 | 50 | return this; 51 | }; 52 | 53 | /*! 54 | * Core Assertions 55 | */ 56 | 57 | var core = require('./chai/core/assertions'); 58 | exports.use(core); 59 | 60 | /*! 61 | * Expect interface 62 | */ 63 | 64 | var expect = require('./chai/interface/expect'); 65 | exports.use(expect); 66 | 67 | /*! 68 | * Should interface 69 | */ 70 | 71 | var should = require('./chai/interface/should'); 72 | exports.use(should); 73 | 74 | /*! 75 | * Assert interface 76 | */ 77 | 78 | var assert = require('./chai/interface/assert'); 79 | exports.use(assert); 80 | -------------------------------------------------------------------------------- /public/components/chai/lib/chai/utils/getMessage.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Chai - message composition utility 3 | * Copyright(c) 2012-2013 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | /*! 8 | * Module dependancies 9 | */ 10 | 11 | var flag = require('./flag') 12 | , getActual = require('./getActual') 13 | , inspect = require('./inspect') 14 | , objDisplay = require('./objDisplay'); 15 | 16 | /** 17 | * ### .getMessage(object, message, negateMessage) 18 | * 19 | * Construct the error message based on flags 20 | * and template tags. Template tags will return 21 | * a stringified inspection of the object referenced. 22 | * 23 | * Messsage template tags: 24 | * - `#{this}` current asserted object 25 | * - `#{act}` actual value 26 | * - `#{exp}` expected value 27 | * 28 | * @param {Object} object (constructed Assertion) 29 | * @param {Arguments} chai.Assertion.prototype.assert arguments 30 | * @name getMessage 31 | * @api public 32 | */ 33 | 34 | module.exports = function (obj, args) { 35 | var negate = flag(obj, 'negate') 36 | , val = flag(obj, 'object') 37 | , expected = args[3] 38 | , actual = getActual(obj, args) 39 | , msg = negate ? args[2] : args[1] 40 | , flagMsg = flag(obj, 'message'); 41 | 42 | msg = msg || ''; 43 | msg = msg 44 | .replace(/#{this}/g, objDisplay(val)) 45 | .replace(/#{act}/g, objDisplay(actual)) 46 | .replace(/#{exp}/g, objDisplay(expected)); 47 | 48 | return flagMsg ? flagMsg + ': ' + msg : msg; 49 | }; 50 | -------------------------------------------------------------------------------- /public/components/chai/lib/chai/utils/transferFlags.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Chai - transferFlags utility 3 | * Copyright(c) 2012-2013 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | /** 8 | * ### transferFlags(assertion, object, includeAll = true) 9 | * 10 | * Transfer all the flags for `assertion` to `object`. If 11 | * `includeAll` is set to `false`, then the base Chai 12 | * assertion flags (namely `object`, `ssfi`, and `message`) 13 | * will not be transferred. 14 | * 15 | * 16 | * var newAssertion = new Assertion(); 17 | * utils.transferFlags(assertion, newAssertion); 18 | * 19 | * var anotherAsseriton = new Assertion(myObj); 20 | * utils.transferFlags(assertion, anotherAssertion, false); 21 | * 22 | * @param {Assertion} assertion the assertion to transfer the flags from 23 | * @param {Object} object the object to transfer the flags too; usually a new assertion 24 | * @param {Boolean} includeAll 25 | * @name getAllFlags 26 | * @api private 27 | */ 28 | 29 | module.exports = function (assertion, object, includeAll) { 30 | var flags = assertion.__flags || (assertion.__flags = Object.create(null)); 31 | 32 | if (!object.__flags) { 33 | object.__flags = Object.create(null); 34 | } 35 | 36 | includeAll = arguments.length === 3 ? includeAll : true; 37 | 38 | for (var flag in flags) { 39 | if (includeAll || 40 | (flag !== 'object' && flag !== 'ssfi' && flag != 'message')) { 41 | object.__flags[flag] = flags[flag]; 42 | } 43 | } 44 | }; 45 | -------------------------------------------------------------------------------- /public/components/mocha/lib/interfaces/exports.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var Suite = require('../suite') 7 | , Test = require('../test'); 8 | 9 | /** 10 | * TDD-style interface: 11 | * 12 | * exports.Array = { 13 | * '#indexOf()': { 14 | * 'should return -1 when the value is not present': function(){ 15 | * 16 | * }, 17 | * 18 | * 'should return the correct index when the value is present': function(){ 19 | * 20 | * } 21 | * } 22 | * }; 23 | * 24 | */ 25 | 26 | module.exports = function(suite){ 27 | var suites = [suite]; 28 | 29 | suite.on('require', visit); 30 | 31 | function visit(obj) { 32 | var suite; 33 | for (var key in obj) { 34 | if ('function' == typeof obj[key]) { 35 | var fn = obj[key]; 36 | switch (key) { 37 | case 'before': 38 | suites[0].beforeAll(fn); 39 | break; 40 | case 'after': 41 | suites[0].afterAll(fn); 42 | break; 43 | case 'beforeEach': 44 | suites[0].beforeEach(fn); 45 | break; 46 | case 'afterEach': 47 | suites[0].afterEach(fn); 48 | break; 49 | default: 50 | suites[0].addTest(new Test(key, fn)); 51 | } 52 | } else { 53 | var suite = Suite.create(suites[0], key); 54 | suites.unshift(suite); 55 | visit(obj[key]); 56 | suites.shift(); 57 | } 58 | } 59 | } 60 | }; 61 | -------------------------------------------------------------------------------- /public/components/mocha/lib/reporters/list.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var Base = require('./base') 7 | , cursor = Base.cursor 8 | , color = Base.color; 9 | 10 | /** 11 | * Expose `List`. 12 | */ 13 | 14 | exports = module.exports = List; 15 | 16 | /** 17 | * Initialize a new `List` test reporter. 18 | * 19 | * @param {Runner} runner 20 | * @api public 21 | */ 22 | 23 | function List(runner) { 24 | Base.call(this, runner); 25 | 26 | var self = this 27 | , stats = this.stats 28 | , n = 0; 29 | 30 | runner.on('start', function(){ 31 | console.log(); 32 | }); 33 | 34 | runner.on('test', function(test){ 35 | process.stdout.write(color('pass', ' ' + test.fullTitle() + ': ')); 36 | }); 37 | 38 | runner.on('pending', function(test){ 39 | var fmt = color('checkmark', ' -') 40 | + color('pending', ' %s'); 41 | console.log(fmt, test.fullTitle()); 42 | }); 43 | 44 | runner.on('pass', function(test){ 45 | var fmt = color('checkmark', ' '+Base.symbols.dot) 46 | + color('pass', ' %s: ') 47 | + color(test.speed, '%dms'); 48 | cursor.CR(); 49 | console.log(fmt, test.fullTitle(), test.duration); 50 | }); 51 | 52 | runner.on('fail', function(test, err){ 53 | cursor.CR(); 54 | console.log(color('fail', ' %d) %s'), ++n, test.fullTitle()); 55 | }); 56 | 57 | runner.on('end', self.epilogue.bind(self)); 58 | } 59 | 60 | /** 61 | * Inherit from `Base.prototype`. 62 | */ 63 | 64 | List.prototype.__proto__ = Base.prototype; 65 | -------------------------------------------------------------------------------- /public/components/chai/test/browser/component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Mocha 5 | 6 | 7 | 8 | 9 | 10 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 41 | 42 | 43 |
44 | 45 | 46 | -------------------------------------------------------------------------------- /public/components/underscore/test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Underscore Test Suite 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |

Underscore Speed Suite

29 |

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

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

36 |
37 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /client/vendor/EventEmitter.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * EventEmitter v4.0.5 - git.io/ee 3 | * Oliver Caldwell 4 | * MIT license 5 | * @preserve 6 | */ 7 | (function(e){"use strict";function t(){}function n(e,t){if(r)return t.indexOf(e);for(var n=t.length;n--;)if(t[n]===e)return n;return-1}var i=t.prototype,r=Array.prototype.indexOf?!0:!1;i._getEvents=function(){return this._events||(this._events={})},i.getListeners=function(e){var t=this._getEvents();return t[e]||(t[e]=[])},i.addListener=function(e,t){var i=this.getListeners(e);return-1===n(t,i)&&i.push(t),this},i.on=i.addListener,i.removeListener=function(e,t){var i=this.getListeners(e),r=n(t,i);return-1!==r&&(i.splice(r,1),0===i.length&&this.removeEvent(e)),this},i.off=i.removeListener,i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var i,r,s=e?this.removeListener:this.addListener,o=e?this.removeListeners:this.addListeners;if("object"==typeof t)for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?s.call(this,i,r):o.call(this,i,r));else for(i=n.length;i--;)s.call(this,t,n[i]);return this},i.removeEvent=function(e){return e?delete this._getEvents()[e]:delete this._events,this},i.emitEvent=function(e,t){for(var n,i=this.getListeners(e),r=i.length;r--;)n=t?i[r].apply(null,t):i[r](),n===!0&&this.removeListener(e,i[r]);return this},i.trigger=i.emitEvent,i.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},"function"==typeof define&&define.amd?define(function(){return t}):e.EventEmitter=t})(this); -------------------------------------------------------------------------------- /public/components/q/spec/q-spec.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Jasmine Spec Runner 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /client/T/date.js: -------------------------------------------------------------------------------- 1 | 2 | T.module('date') 3 | 4 | // formats date - cdate is date to check, now is the current time 5 | T.date.format = function dateFormat(cdate, now) { 6 | var fdate = ''; 7 | var sameDay = cdate.getDate() == now.getDate() 8 | && cdate.getMonth() == now.getMonth() 9 | && cdate.getFullYear() == now.getFullYear(); 10 | if (!sameDay) { 11 | fdate = (cdate.getFullYear() != now.getFullYear() ? cdate.getFullYear() + '-' : '') 12 | + T.twoDigits(cdate.getMonth() + 1) + '-' 13 | + T.twoDigits(cdate.getDate()) + ' '; 14 | } 15 | return fdate + cdate.getHours() + ':' + T.twoDigits(cdate.getMinutes()) + ':' + T.twoDigits(cdate.getSeconds()); 16 | } 17 | 18 | // create date object from date string in Twitter's API 19 | T.date.parse = function dateParse(str) { 20 | 21 | // hack for internet explorer 22 | var pattern = /\w+ (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d+) (\d+):(\d+):(\d+) \+0000 (\d+)/ 23 | , m = (str + '').match(pattern) 24 | if (m) { 25 | return new Date(Date.UTC(parseInt(m[6], 10), T.date.parseMonth(m[1]), parseInt(m[2], 10) 26 | , parseInt(m[3], 10), parseInt(m[4], 10), parseInt(m[5]))) 27 | } 28 | 29 | // this code works in all version of Firefox and Chrome I tested so far 30 | // but never worked on internet explorer 31 | return new Date(str); 32 | 33 | } 34 | 35 | T.date.months = 'Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec'.split('|') 36 | T.date.parseMonth = function parseMonths(str) { 37 | var months = T.date.months 38 | for (var i = 0; i < 12; i ++) if (months[i] === str) return i 39 | } 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /public/components/eventEmitter/EventEmitter.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * EventEmitter v4.0.5 - git.io/ee 3 | * Oliver Caldwell 4 | * MIT license 5 | * @preserve 6 | */ 7 | (function(e){"use strict";function t(){}function n(e,t){if(r)return t.indexOf(e);for(var n=t.length;n--;)if(t[n]===e)return n;return-1}var i=t.prototype,r=Array.prototype.indexOf?!0:!1;i._getEvents=function(){return this._events||(this._events={})},i.getListeners=function(e){var t=this._getEvents();return t[e]||(t[e]=[])},i.addListener=function(e,t){var i=this.getListeners(e);return-1===n(t,i)&&i.push(t),this},i.on=i.addListener,i.removeListener=function(e,t){var i=this.getListeners(e),r=n(t,i);return-1!==r&&(i.splice(r,1),0===i.length&&this.removeEvent(e)),this},i.off=i.removeListener,i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var i,r,s=e?this.removeListener:this.addListener,o=e?this.removeListeners:this.addListeners;if("object"==typeof t)for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?s.call(this,i,r):o.call(this,i,r));else for(i=n.length;i--;)s.call(this,t,n[i]);return this},i.removeEvent=function(e){return e?delete this._getEvents()[e]:delete this._events,this},i.emitEvent=function(e,t){for(var n,i=this.getListeners(e),r=i.length;r--;)n=t?i[r].apply(null,t):i[r](),n===!0&&this.removeListener(e,i[r]);return this},i.trigger=i.emitEvent,i.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},"function"==typeof define&&define.amd?define(function(){return t}):e.EventEmitter=t})(this); -------------------------------------------------------------------------------- /public/components/q/design/q4.js: -------------------------------------------------------------------------------- 1 | 2 | var isPromise = function (value) { 3 | return value && typeof value.then === "function"; 4 | }; 5 | 6 | var defer = function () { 7 | var pending = [], value; 8 | return { 9 | resolve: function (_value) { 10 | if (pending) { 11 | value = ref(_value); // values wrapped in a promise 12 | for (var i = 0, ii = pending.length; i < ii; i++) { 13 | var callback = pending[i]; 14 | value.then(callback); // then called instead 15 | } 16 | pending = undefined; 17 | } 18 | }, 19 | promise: { 20 | then: function (_callback) { 21 | var result = defer(); 22 | // callback is wrapped so that its return 23 | // value is captured and used to resolve the promise 24 | // that "then" returns 25 | var callback = function (value) { 26 | result.resolve(_callback(value)); 27 | }; 28 | if (pending) { 29 | pending.push(callback); 30 | } else { 31 | value.then(callback); 32 | } 33 | return result.promise; 34 | } 35 | } 36 | }; 37 | }; 38 | 39 | var ref = function (value) { 40 | if (value && typeof value.then === "function") 41 | return value; 42 | return { 43 | then: function (callback) { 44 | return ref(callback(value)); 45 | } 46 | }; 47 | }; 48 | 49 | -------------------------------------------------------------------------------- /public/components/mocha/lib/reporters/templates/coverage.jade: -------------------------------------------------------------------------------- 1 | !!! 5 2 | html 3 | head 4 | title Coverage 5 | include script.html 6 | include style.html 7 | body 8 | #coverage 9 | h1#overview Coverage 10 | include menu 11 | 12 | #stats(class=coverageClass(cov.coverage)) 13 | .percentage #{cov.coverage | 0}% 14 | .sloc= cov.sloc 15 | .hits= cov.hits 16 | .misses= cov.misses 17 | 18 | #files 19 | for file in cov.files 20 | .file 21 | h2(id=file.filename)= file.filename 22 | #stats(class=coverageClass(file.coverage)) 23 | .percentage #{file.coverage | 0}% 24 | .sloc= file.sloc 25 | .hits= file.hits 26 | .misses= file.misses 27 | 28 | table#source 29 | thead 30 | tr 31 | th Line 32 | th Hits 33 | th Source 34 | tbody 35 | for line, number in file.source 36 | if line.coverage > 0 37 | tr.hit 38 | td.line= number 39 | td.hits= line.coverage 40 | td.source= line.source 41 | else if 0 === line.coverage 42 | tr.miss 43 | td.line= number 44 | td.hits 0 45 | td.source= line.source 46 | else 47 | tr 48 | td.line= number 49 | td.hits 50 | td.source= line.source || ' ' 51 | -------------------------------------------------------------------------------- /public/components/sinon/AUTHORS: -------------------------------------------------------------------------------- 1 | Sinon.JS was written by 2 | Christian Johansen, christian@cjohansen.no 3 | 4 | Contributors 5 | Adrian Phinney, 6 | August Lilleaas, august.lilleaas@gmail.com 7 | Ben Hockey, neonstalwart@gmail.com 8 | Cormac Flynn, cormac.flynn@viadeoteam.com 9 | Cory, seeflanigan@gmail.com 10 | Domenic Denicola, domenic@domenicdenicola.com 11 | Felix Geisendörfer, felix@debuggable.com 12 | Gavin Huang, gravof@gmail.com 13 | Giorgos Giannoutsos, contact@nuc.gr 14 | Glen Mailer, glen.mailer@bskyb.com 15 | Gord Tanner, gord@tinyhippos.com 16 | Gregers Gram Rygg, http://github.com/gregersrygg 17 | Irina Dumitrascu, me@dira.ro 18 | Jan Kopriva, jan.kopriva@gooddata.com 19 | kbackowski, 20 | kpdecker, 21 | Keith Cirkel, github@keithcirkel.co.uk 22 | Kevin Turner, kevin@decipherinc.com 23 | Konrad Holowinski, konrad.holowinski@gmail.com 24 | Kevin Decker, kpdecker@gmail.com 25 | Martin Brochhaus, mbrochh@gmail.com 26 | Maximilian Antoni, mail@maxantoni.de 27 | Max Klymyshyn, klymyshyn@gmail.com 28 | Olmo Maldonado, olmo.maldonado@gmail.com 29 | Raynos, raynos2@gmail.com 30 | Rodion Vynnychenko, roddiku@gmail.com 31 | Scott Andrews, 32 | Shawn Krisman 33 | Sven Fuchs, svenfuchs@artweb-design.de 34 | TEHEK Firefox, tehek@tehek.net 35 | Tek Nynja, github@teknynja.com 36 | Thomas Meyer, 37 | Tim Ruffles, timruffles@googlemail.com 38 | Tobias Ebnöther, ebi@gorn.ch 39 | Tomás Corral Casas, amischol@gmail.com 40 | Tristan Koch, tristan.koch@1und1.de 41 | Will Butler, will@butlerhq.com 42 | Wesley Walser, waw325@gmail.com 43 | -------------------------------------------------------------------------------- /public/components/mocha/test/hook.sync.nested.js: -------------------------------------------------------------------------------- 1 | 2 | describe('serial', function(){ 3 | describe('nested', function(){ 4 | var calls = []; 5 | 6 | beforeEach(function(){ 7 | calls.push('parent before'); 8 | }) 9 | 10 | afterEach(function(){ 11 | calls.push('parent after'); 12 | }); 13 | 14 | it('foo', function(){ 15 | calls.should.eql(['parent before']); 16 | calls.push('foo'); 17 | }) 18 | 19 | it('bar', function(){ 20 | calls.should.eql([ 21 | 'parent before' 22 | , 'foo' 23 | , 'parent after' 24 | , 'parent before']); 25 | }) 26 | 27 | describe('hooks', function(){ 28 | beforeEach(function(){ 29 | calls.push('before'); 30 | }) 31 | 32 | it('one', function(){ 33 | calls.should.eql([ 34 | 'parent before' 35 | , 'foo' 36 | , 'parent after' 37 | , 'parent before' 38 | , 'parent after' 39 | , 'parent before' 40 | , 'before']); 41 | calls.push('one'); 42 | }) 43 | 44 | it('two', function(){ 45 | calls.should.eql([ 46 | 'parent before' 47 | , 'foo' 48 | , 'parent after' 49 | , 'parent before' 50 | , 'parent after' 51 | , 'parent before' 52 | , 'before' 53 | , 'one' 54 | , 'after' 55 | , 'parent after' 56 | , 'parent before' 57 | , 'before']); 58 | calls.push('two'); 59 | }); 60 | 61 | afterEach(function(){ 62 | calls.push('after'); 63 | }) 64 | }) 65 | }) 66 | }) 67 | -------------------------------------------------------------------------------- /public/components/mocha/lib/reporters/tap.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var Base = require('./base') 7 | , cursor = Base.cursor 8 | , color = Base.color; 9 | 10 | /** 11 | * Expose `TAP`. 12 | */ 13 | 14 | exports = module.exports = TAP; 15 | 16 | /** 17 | * Initialize a new `TAP` reporter. 18 | * 19 | * @param {Runner} runner 20 | * @api public 21 | */ 22 | 23 | function TAP(runner) { 24 | Base.call(this, runner); 25 | 26 | var self = this 27 | , stats = this.stats 28 | , n = 1 29 | , passes = 0 30 | , failures = 0; 31 | 32 | runner.on('start', function(){ 33 | var total = runner.grepTotal(runner.suite); 34 | console.log('%d..%d', 1, total); 35 | }); 36 | 37 | runner.on('test end', function(){ 38 | ++n; 39 | }); 40 | 41 | runner.on('pending', function(test){ 42 | console.log('ok %d %s # SKIP -', n, title(test)); 43 | }); 44 | 45 | runner.on('pass', function(test){ 46 | passes++; 47 | console.log('ok %d %s', n, title(test)); 48 | }); 49 | 50 | runner.on('fail', function(test, err){ 51 | failures++; 52 | console.log('not ok %d %s', n, title(test)); 53 | if (err.stack) console.log(err.stack.replace(/^/gm, ' ')); 54 | }); 55 | 56 | runner.on('end', function(){ 57 | console.log('# tests ' + (passes + failures)); 58 | console.log('# pass ' + passes); 59 | console.log('# fail ' + failures); 60 | }); 61 | } 62 | 63 | /** 64 | * Return a TAP-safe title of `test` 65 | * 66 | * @param {Object} test 67 | * @return {String} 68 | * @api private 69 | */ 70 | 71 | function title(test) { 72 | return test.fullTitle().replace(/#/g, ''); 73 | } 74 | -------------------------------------------------------------------------------- /public/components/sinon/LICENSE: -------------------------------------------------------------------------------- 1 | (The BSD License) 2 | 3 | Copyright (c) 2010-2012, Christian Johansen, christian@cjohansen.no 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without modification, 7 | are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 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 | * Neither the name of Christian Johansen nor the names of his contributors 15 | may be used to endorse or promote products derived from this software 16 | without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /public/components/chai/lib/chai/utils/overwriteMethod.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Chai - overwriteMethod utility 3 | * Copyright(c) 2012-2013 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | /** 8 | * ### overwriteMethod (ctx, name, fn) 9 | * 10 | * Overwites an already existing method and provides 11 | * access to previous function. Must return function 12 | * to be used for name. 13 | * 14 | * utils.overwriteMethod(chai.Assertion.prototype, 'equal', function (_super) { 15 | * return function (str) { 16 | * var obj = utils.flag(this, 'object'); 17 | * if (obj instanceof Foo) { 18 | * new chai.Assertion(obj.value).to.equal(str); 19 | * } else { 20 | * _super.apply(this, arguments); 21 | * } 22 | * } 23 | * }); 24 | * 25 | * Can also be accessed directly from `chai.Assertion`. 26 | * 27 | * chai.Assertion.overwriteMethod('foo', fn); 28 | * 29 | * Then can be used as any other assertion. 30 | * 31 | * expect(myFoo).to.equal('bar'); 32 | * 33 | * @param {Object} ctx object whose method is to be overwritten 34 | * @param {String} name of method to overwrite 35 | * @param {Function} method function that returns a function to be used for name 36 | * @name overwriteMethod 37 | * @api public 38 | */ 39 | 40 | module.exports = function (ctx, name, method) { 41 | var _method = ctx[name] 42 | , _super = function () { return this; }; 43 | 44 | if (_method && 'function' === typeof _method) 45 | _super = _method; 46 | 47 | ctx[name] = function () { 48 | var result = method(_super).apply(this, arguments); 49 | return result === undefined ? this : result; 50 | } 51 | }; 52 | -------------------------------------------------------------------------------- /public/components/chai/test/configuration.js: -------------------------------------------------------------------------------- 1 | suite('configuration', function () { 2 | var assert = chai.assert; 3 | 4 | function fooThrows () { 5 | assert.equal('foo', 'bar'); 6 | } 7 | 8 | test('Assertion.includeStack is true', function () { 9 | var orig = chai.Assertion.includeStack; 10 | chai.Assertion.includeStack = true; 11 | 12 | try { 13 | fooThrows(); 14 | assert.ok(false, 'should not get here because error thrown'); 15 | } catch (err) { 16 | chai.Assertion.includeStack = orig; 17 | // not all browsers support err.stack 18 | if ('undefined' !== typeof err.stack) { 19 | assert.include(err.stack, 'fooThrows', 'should have stack trace in error message'); 20 | } 21 | } 22 | 23 | }); 24 | 25 | test('Assertion.includeStack is false', function () { 26 | var orig = chai.Assertion.includeStack; 27 | chai.Assertion.includeStack = false; 28 | 29 | try { 30 | fooThrows(); 31 | assert.ok(false, 'should not get here because error thrown'); 32 | } catch (err) { 33 | chai.Assertion.includeStack = orig; 34 | 35 | // IE 10 supports err.stack in Chrome format, but without 36 | // `Error.captureStackTrace` support that allows tuning of the error 37 | // message. 38 | if ('undefined' !== typeof Error.captureStackTrace) { 39 | assert.ok(!err.stack || err.stack.indexOf('at fooThrows') === -1, 'should not have stack trace in error message'); 40 | } 41 | } 42 | }); 43 | 44 | test('AssertionError Properties', function () { 45 | var err = new chai.AssertionError({ message: 'Chai!' }); 46 | assert.equal(err.toString(), 'Chai!'); 47 | }); 48 | }); 49 | -------------------------------------------------------------------------------- /client/T/T.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | var T = this.T = {} 4 | 5 | T.module = function(name) { 6 | T[name] = T[name] || {} 7 | }; 8 | 9 | T.parseJSON = function parseJSON(x) { 10 | if (typeof JSON != 'undefined' && JSON.parse) return JSON.parse(x); 11 | var y = x.replace(/[\[\]{}:,]|"(?:\\[\s\S]|[^"])*"|\-?\d+(?:\.\d+)?|null|true|false/g, ''); 12 | if (y != '') throw new Error('unsafe json D:'); 13 | return eval('(' + x + ')'); 14 | }; 15 | 16 | T.changer = function changer(fn) { 17 | var d; 18 | return function(x) { 19 | if (x !== d) { 20 | fn (x); 21 | d = x; 22 | } 23 | }; 24 | }; 25 | 26 | T.digits = function digits(str, length) { 27 | str = str + ''; 28 | while (str.length < length) str = '0' + str; 29 | return str; 30 | }; 31 | 32 | T.partialRight = function partialRight(f) { 33 | var args = _.rest(arguments) 34 | , sole = args.length == 1 // stupid optimization 35 | return function partialRightOutput() { 36 | if (arguments.length == 1 && sole) { // stupid optimization 37 | return f.call(this, arguments[0], args[0]) 38 | } 39 | return f.apply(this, _.toArray(arguments).concat(args)) 40 | }; 41 | }; 42 | 43 | T.twoDigits = T.partialRight(T.digits, 2); 44 | 45 | T.decodeUTF = function decodeUTF(x, z) { 46 | return x.replace(/%([cd][0-9a-f]%[89ab][0-9a-f]|e[0-9a-f](?:%[89ab][0-9a-f]){2}|f[0-7](?:%[89ab][0-9a-f]){3}|f[89ab](?:%[89ab][0-9a-f]){4}|f[cd](?:%[89ab][0-9a-f]){5})/ig, function(a) { 47 | return z ? '&#' + decodeURIComponent(a).charCodeAt(0) + ';' : decodeURIComponent(a); 48 | }); 49 | }; 50 | 51 | T.count = function(array, iterator) { 52 | var out = 0; 53 | for (var i = 0; i < array.length; i ++) if (iterator(array[i])) out++; 54 | return out; 55 | }; 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /lib/middleware/main-page-server.js: -------------------------------------------------------------------------------- 1 | 2 | var fs = require('fs'); 3 | var compile = require('./../template-compiler'); 4 | var postprocess = require('./../template-postprocessor'); 5 | 6 | function compileTemplate(template) { 7 | return compile(template, 8 | function(files) { 9 | return files.map(function(x) { return ''; }).join(''); 10 | }, 11 | function(files) { 12 | return files.map(function(x) { return ''; }).join(''); 13 | } 14 | ); 15 | } 16 | 17 | module.exports = function mainPageServer(fileName, productionMode) { 18 | 19 | var templateData = null; 20 | 21 | function getContent(cont) { 22 | if (productionMode && templateData != null) { 23 | return cont(null, templateData); 24 | } else { 25 | console.log('compiling template...'); 26 | return fs.readFile(fileName, 'utf-8', function(err, data) { 27 | if (err) return cont(err, null); 28 | require('./../twitter-config').getConfiguration(function(config) { 29 | templateData = postprocess(compileTemplate(data), config); 30 | console.log('compiling template : done, size = ' + templateData.length); 31 | return cont(null, templateData); 32 | }); 33 | }); 34 | } 35 | } 36 | 37 | if (productionMode) { 38 | getContent(function() { 39 | }); 40 | } 41 | 42 | return function(req, res, next) { 43 | var pathname = require('url').parse(req.url).pathname; 44 | if (pathname == '/thaiWitter') { 45 | return res.redirect('/thaiWitter/'); 46 | } 47 | if (pathname == '/thaiWitter/') { 48 | return getContent(function(err, data) { 49 | if (err) return next(err); 50 | res.send(data); 51 | }); 52 | } 53 | return next(); 54 | }; 55 | 56 | }; 57 | 58 | -------------------------------------------------------------------------------- /style/compass/scss/_hardcore.scss: -------------------------------------------------------------------------------- 1 | .hardcore { 2 | 3 | #status-chars, .tweet-bar { 4 | -moz-transition: 0.3s opacity, 0.5s -moz-transform, 0.5s margin-bottom; 5 | } 6 | .bottom-buttons { -moz-transition: 0.3s opacity; } 7 | 8 | .empty { 9 | #status-chars, &.tweet-bar { opacity: 0; pointer-events: none; } 10 | #status-chars { -moz-transform: translate(0, -20px); } 11 | &.tweet-bar { margin-bottom: -20px; } 12 | &.bottom-buttons { opacity: 0; } 13 | } 14 | .not-empty { 15 | #status-chars, &.tweet-bar { opacity: 1; } 16 | &.bottom-buttons { opacity: 1; } 17 | } 18 | 19 | .tweet-bar { 20 | height: 0; 21 | border: 0; background: transparent; 22 | } 23 | 24 | .tweet-bar-container { 25 | position: absolute; 26 | width: auto; right: 20px; left: 20px; bottom: 20px; 27 | border: 1px solid #454443; 28 | background: rgba(9,8,7,0.9); 29 | border-radius: 4px; 30 | box-shadow: 0 1px 7px #000; 31 | padding: 0; 32 | } 33 | 34 | .tweet-area { 35 | -moz-box-sizing: border-box; 36 | height: 50px; 37 | padding: 4px 8px; 38 | } 39 | 40 | #status-chars { 41 | position: absolute; 42 | top: 40px; right: 20px; 43 | font: bold 30px Helvetica; 44 | text-shadow: 0 1px 4px rgba(0,0,0,0.6); 45 | } 46 | 47 | #status-scroll { background: #353433; } 48 | 49 | .head { z-index: 100; width: auto; left: auto; right: 0; border: 0; background: transparent; } 50 | .head .menu-item:not(#menu-additional) { display: none; } 51 | #menu-additional { position: absolute; z-index: 1; top: 0; right: 0; bottom: 0; left: 0; color: transparent; } 52 | #menu-additional.menu-item-open, #menu-additional:hover { background: transparent; } 53 | .options { margin-top: -25px; } 54 | 55 | .bottom-buttons { bottom: 24px; right: 10px; } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /public/components/mocha/test/hook.sync.js: -------------------------------------------------------------------------------- 1 | 2 | describe('serial', function(){ 3 | var calls = []; 4 | 5 | beforeEach(function(){ 6 | calls.push('parent before'); 7 | }) 8 | 9 | afterEach(function(){ 10 | calls.push('parent after'); 11 | }) 12 | 13 | describe('hooks', function(){ 14 | beforeEach(function(){ 15 | calls.push('before'); 16 | }) 17 | 18 | it('one', function(){ 19 | calls.should.eql(['parent before', 'before']); 20 | calls.push('one'); 21 | }) 22 | 23 | it('two', function(){ 24 | calls.should.eql([ 25 | 'parent before' 26 | , 'before' 27 | , 'one' 28 | , 'after' 29 | , 'parent after' 30 | , 'parent before' 31 | , 'before']); 32 | calls.push('two'); 33 | }) 34 | 35 | it('three', function(){ 36 | calls.should.eql([ 37 | 'parent before' 38 | , 'before' 39 | , 'one' 40 | , 'after' 41 | , 'parent after' 42 | , 'parent before' 43 | , 'before' 44 | , 'two' 45 | , 'after' 46 | , 'parent after' 47 | , 'parent before' 48 | , 'before']); 49 | calls.push('three'); 50 | }) 51 | 52 | afterEach(function(){ 53 | calls.push('after'); 54 | }) 55 | 56 | after(function(){ 57 | calls.should.eql([ 58 | 'parent before' 59 | , 'before' 60 | , 'one' 61 | , 'after' 62 | , 'parent after' 63 | , 'parent before' 64 | , 'before' 65 | , 'two' 66 | , 'after' 67 | , 'parent after' 68 | , 'parent before' 69 | , 'before' 70 | , 'three' 71 | , 'after' 72 | , 'parent after']); 73 | }) 74 | }) 75 | }) -------------------------------------------------------------------------------- /public/components/q/design/q5.js: -------------------------------------------------------------------------------- 1 | 2 | var isPromise = function (value) { 3 | return value && typeof value.then === "function"; 4 | }; 5 | 6 | var defer = function () { 7 | var pending = [], value; 8 | return { 9 | resolve: function (_value) { 10 | if (pending) { 11 | value = ref(_value); 12 | for (var i = 0, ii = pending.length; i < ii; i++) { 13 | // apply the pending arguments to "then" 14 | value.then.apply(value, pending[i]); 15 | } 16 | pending = undefined; 17 | } 18 | }, 19 | promise: { 20 | then: function (_callback, _errback) { 21 | var result = defer(); 22 | var callback = function (value) { 23 | result.resolve(_callback(value)); 24 | }; 25 | var errback = function (reason) { 26 | result.resolve(_errback(reason)); 27 | }; 28 | if (pending) { 29 | pending.push([callback, errback]); 30 | } else { 31 | value.then(callback, errback); 32 | } 33 | return result.promise; 34 | } 35 | } 36 | }; 37 | }; 38 | 39 | var ref = function (value) { 40 | if (value && typeof value.then === "function") 41 | return value; 42 | return { 43 | then: function (callback) { 44 | return ref(callback(value)); 45 | } 46 | }; 47 | }; 48 | 49 | var reject = function (reason) { 50 | return { 51 | then: function (callback, errback) { 52 | return ref(errback(reason)); 53 | } 54 | }; 55 | }; 56 | 57 | -------------------------------------------------------------------------------- /public/components/chai/lib/chai/utils/overwriteProperty.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Chai - overwriteProperty utility 3 | * Copyright(c) 2012-2013 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | /** 8 | * ### overwriteProperty (ctx, name, fn) 9 | * 10 | * Overwites an already existing property getter and provides 11 | * access to previous value. Must return function to use as getter. 12 | * 13 | * utils.overwriteProperty(chai.Assertion.prototype, 'ok', function (_super) { 14 | * return function () { 15 | * var obj = utils.flag(this, 'object'); 16 | * if (obj instanceof Foo) { 17 | * new chai.Assertion(obj.name).to.equal('bar'); 18 | * } else { 19 | * _super.call(this); 20 | * } 21 | * } 22 | * }); 23 | * 24 | * 25 | * Can also be accessed directly from `chai.Assertion`. 26 | * 27 | * chai.Assertion.overwriteProperty('foo', fn); 28 | * 29 | * Then can be used as any other assertion. 30 | * 31 | * expect(myFoo).to.be.ok; 32 | * 33 | * @param {Object} ctx object whose property is to be overwritten 34 | * @param {String} name of property to overwrite 35 | * @param {Function} getter function that returns a getter function to be used for name 36 | * @name overwriteProperty 37 | * @api public 38 | */ 39 | 40 | module.exports = function (ctx, name, getter) { 41 | var _get = Object.getOwnPropertyDescriptor(ctx, name) 42 | , _super = function () {}; 43 | 44 | if (_get && 'function' === typeof _get.get) 45 | _super = _get.get 46 | 47 | Object.defineProperty(ctx, name, 48 | { get: function () { 49 | var result = getter(_super).call(this); 50 | return result === undefined ? this : result; 51 | } 52 | , configurable: true 53 | }); 54 | }; 55 | -------------------------------------------------------------------------------- /public/components/eventEmitter/docs/render.js: -------------------------------------------------------------------------------- 1 | // Load the require modules 2 | var dust = require('../node_modules/dustjs-linkedin'), 3 | fs = require('fs'); 4 | 5 | // Load the rendered template 6 | fs.readFile('docs/api.dust.js', function(err, data) { 7 | // Throw any errors 8 | if(err) { 9 | throw err; 10 | } 11 | 12 | // Load the rendered template into dust 13 | dust.loadSource(data); 14 | 15 | // Load the data 16 | fs.readFile('docs/data.json', function(err, rawJSON) { 17 | // Throw any errors 18 | if(err) { 19 | throw err; 20 | } 21 | 22 | // Parse the JSON 23 | var raw = JSON.parse(rawJSON); 24 | 25 | // Build the data array 26 | var data = []; 27 | 28 | // Loop over all JSDoc block 29 | for(var i = 0; i < raw.length; i += 1) { 30 | // Loop over any tags found in the block 31 | if(raw[i].tags) { 32 | for(var t = 0; t < raw[i].tags.length; t += 1) { 33 | // If it is a doc tag then add method to the data array 34 | if(raw[i].tags[t].type === 'doc') { 35 | // Add the method to the data object 36 | data.push(raw[i]); 37 | 38 | // And remove the doc tag 39 | raw[i].tags.splice(t, 1); 40 | } 41 | } 42 | } 43 | } 44 | 45 | // Pipe the data into the template 46 | dust.render('api', data, function(err, out) { 47 | // Throw any errors 48 | if(err) { 49 | throw err; 50 | } 51 | 52 | // Write the data to the output 53 | fs.writeFile('docs/api.md', out); 54 | }); 55 | }); 56 | }); -------------------------------------------------------------------------------- /public/components/mocha/lib/reporters/teamcity.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Module dependencies. 4 | */ 5 | 6 | var Base = require('./base'); 7 | 8 | /** 9 | * Expose `Teamcity`. 10 | */ 11 | 12 | exports = module.exports = Teamcity; 13 | 14 | /** 15 | * Initialize a new `Teamcity` reporter. 16 | * 17 | * @param {Runner} runner 18 | * @api public 19 | */ 20 | 21 | function Teamcity(runner) { 22 | Base.call(this, runner); 23 | var stats = this.stats; 24 | 25 | runner.on('start', function() { 26 | console.log("##teamcity[testSuiteStarted name='mocha.suite']"); 27 | }); 28 | 29 | runner.on('test', function(test) { 30 | console.log("##teamcity[testStarted name='" + escape(test.fullTitle()) + "']"); 31 | }); 32 | 33 | runner.on('fail', function(test, err) { 34 | console.log("##teamcity[testFailed name='" + escape(test.fullTitle()) + "' message='" + escape(err.message) + "']"); 35 | }); 36 | 37 | runner.on('pending', function(test) { 38 | console.log("##teamcity[testIgnored name='" + escape(test.fullTitle()) + "' message='pending']"); 39 | }); 40 | 41 | runner.on('test end', function(test) { 42 | console.log("##teamcity[testFinished name='" + escape(test.fullTitle()) + "' duration='" + test.duration + "']"); 43 | }); 44 | 45 | runner.on('end', function() { 46 | console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='" + stats.duration + "']"); 47 | }); 48 | } 49 | 50 | /** 51 | * Escape the given `str`. 52 | */ 53 | 54 | function escape(str) { 55 | return str 56 | .replace(/\|/g, "||") 57 | .replace(/\n/g, "|n") 58 | .replace(/\r/g, "|r") 59 | .replace(/\[/g, "|[") 60 | .replace(/\]/g, "|]") 61 | .replace(/\u0085/g, "|x") 62 | .replace(/\u2028/g, "|l") 63 | .replace(/\u2029/g, "|p") 64 | .replace(/'/g, "|'"); 65 | } 66 | -------------------------------------------------------------------------------- /client/T/events.js: -------------------------------------------------------------------------------- 1 | 2 | T.supportEvent = function(object) { 3 | 4 | var listeners = {} 5 | var sticky = {} 6 | 7 | object.on = on 8 | object.emit = emit 9 | object.off = function(type, listener) { 10 | if (listener) removeListener(type, listener) 11 | else removeAllListeners(type) 12 | } 13 | 14 | object.removeListener = removeListener 15 | object.removeAllListeners = removeAllListeners 16 | 17 | function on(type, listener) { 18 | var arr = listeners[type] 19 | if (!arr) { 20 | listeners[type] = listener 21 | } else { 22 | if (!arr._listenerArray) { 23 | arr = listeners[type] = [ arr ] 24 | arr._listenerArray = true 25 | } 26 | arr[arr.length] = listener 27 | } 28 | if (type in sticky) { 29 | listener.call(object, sticky[type]) 30 | } 31 | } 32 | 33 | function emit(type, arg, stickyFlag) { 34 | var arr = listeners[type] 35 | if (stickyFlag) { 36 | sticky[type] = arg 37 | } else { 38 | delete sticky[type] 39 | } 40 | if (!arr) return 41 | if (arr._listenerArray) { 42 | for (var i = 0; i < arr.length; i ++) { 43 | arr[i].call(object, arg) 44 | } 45 | } else { 46 | arr.call(object, arg) 47 | } 48 | } 49 | 50 | function removeListener(type, listener) { 51 | var arr = listeners[type] 52 | if (!arr) return 53 | if (arr === listener) { 54 | delete listeners[type] 55 | return 56 | } 57 | if (arr._listenerArray) { 58 | for (var i = 0; i < arr.length; i ++) { 59 | if (arr[i] === listener) { 60 | arr.splice(i, 1) 61 | if (arr.length === 0) delete listeners[type] 62 | return 63 | } 64 | } 65 | } 66 | } 67 | 68 | function removeAllListeners(type) { 69 | if (type == null) { 70 | listeners = {} 71 | return 72 | } 73 | delete listeners[type] 74 | } 75 | 76 | return object 77 | 78 | } 79 | 80 | 81 | -------------------------------------------------------------------------------- /lib/middleware/dev-file-server.js: -------------------------------------------------------------------------------- 1 | 2 | var fs = require('fs'); 3 | var thaiJS = require('../thaijs'); 4 | 5 | module.exports = function(base) { 6 | return function(req, res, next) { 7 | if (req.url.match(/\.\./)) return next(); 8 | if (req.url.match(/\0/)) return next(); 9 | readPublicFileList(base + '/public-files.txt', function(err, list) { 10 | if (err) return next(err); 11 | list.push('js'); 12 | handleFileList(base, list, req, res, next); 13 | }); 14 | }; 15 | }; 16 | 17 | function readPublicFileList(fileName, callback) { 18 | fs.readFile(fileName, 'utf-8', function(err, data) { 19 | if (err) return callback(err, null); 20 | var list = data.split('\n').map(function(x) { return x.replace(/^\s+|\s+$/g, ''); }).filter(function(x) { return x != ''; }); 21 | return callback(null, list); 22 | }); 23 | } 24 | 25 | function handleFileList(base, list, req, res, next) { 26 | var pathname = require('url').parse(req.url).pathname; 27 | for (var i = 0; i < list.length; i ++) { 28 | var virtual = '/thaiWitter/' + list[i]; 29 | if (pathname == virtual || pathname.substr(0, virtual.length + 1) == virtual + '/') { 30 | return serveFile(base + list[i] + pathname.substr(virtual.length), res, next); 31 | } 32 | } 33 | return next(); 34 | } 35 | 36 | function serveFile(file, res, next) { 37 | return fs.stat(file, function(err, stat) { 38 | if (err) return next(err); 39 | if (!stat.isFile()) return next(new Error('ITZ NOT A FIEL')); 40 | res.header('Cache-Control', 'nocache'); 41 | res.header('Pragma', 'nocache'); 42 | if (file.match(/\.thaijs$/)) { 43 | res.header('Content-Type', 'text/javascript; charset=utf-8'); 44 | return fs.readFile(file, 'utf-8', function(err, data) { 45 | try { 46 | return res.send(thaiJS.compile(data)); 47 | } catch (e) { return next(e); } 48 | }); 49 | } 50 | return res.sendfile(file); 51 | }); 52 | } 53 | -------------------------------------------------------------------------------- /client/lib/twcs.js: -------------------------------------------------------------------------------- 1 | /* 2 | * thaiWitter Class System 3 | * 4 | * (c) Thai Pangsakulyanont. twcs.js is released under WTFPL. 5 | */ 6 | 7 | function BaseClass() {} 8 | function Class(b) { 9 | var c = function() { if (this.init) this.init.apply(this, arguments); }; 10 | return c.extendFrom(b ? b : BaseClass); 11 | } 12 | function defClass(name, b) { 13 | return (function() { 14 | if (!this[name]) this[name] = new Class(b); 15 | return this[name]; 16 | })(); 17 | } 18 | 19 | Function.prototype.implement = BaseClass.prototype.implement = function(x) { 20 | function createProxy(implementor, name) { 21 | return function() { 22 | return implementor[name].apply(this, arguments); 23 | }; 24 | } 25 | for (var i in x) { 26 | if (x.hasOwnProperty(i)) { 27 | if (typeof x[i] === 'function') { 28 | if (this.hasOwnProperty(i)) { 29 | x[i]._super = this[i]; // function replace 30 | } else if (i in this && 'implementor' in this[i]) { 31 | x[i]._super = createProxy(this[i].implementor, i); // cross prototype 32 | } 33 | x[i].implementor = this; 34 | } 35 | this[i] = x[i]; 36 | } 37 | } 38 | return this; 39 | }; 40 | 41 | Function.prototype.extendFrom = function(b) { 42 | var c = function() {}; 43 | c.prototype = b.prototype; 44 | this.implement(b); 45 | this.prototype = new c(); 46 | this.prototype.constructor = this; 47 | return this; 48 | }; 49 | 50 | Function.prototype.proxy = BaseClass.prototype.proxy = function(name) { 51 | if (!this.hasOwnProperty('_tw_proxies')) { 52 | this._tw_proxies = {}; 53 | } 54 | if (!(name in this._tw_proxies)) { 55 | this._tw_proxies[name] = function() { 56 | return this[name].apply(this, arguments); 57 | }.b(this); 58 | } 59 | return this._tw_proxies[name]; 60 | }; 61 | 62 | Function.prototype.b = function(ctx) { 63 | var fn = this; 64 | return function() { 65 | return fn.apply(ctx, arguments); 66 | }; 67 | }; 68 | 69 | -------------------------------------------------------------------------------- /lib/stats.js: -------------------------------------------------------------------------------- 1 | 2 | var start; 3 | var deployed; 4 | var fs = require('fs'); 5 | 6 | exports.init = function() { 7 | start = new Date().getTime(); 8 | deployed = process.env.TW_DEPLOYED; 9 | if (deployed == null) { 10 | deployed = JSON.parse(fs.readFileSync(__dirname + '/../deployed.json', 'utf-8')); 11 | } 12 | console.log('deployed: ' + new Date(deployed)); 13 | }; 14 | 15 | exports.getUptime = function() { 16 | return new Date().getTime() - start; 17 | }; 18 | 19 | exports.getDeployedDiff = function() { 20 | var d = parseInt(deployed, 10); 21 | if (d) { 22 | return new Date().getTime() - d; 23 | } 24 | return 0; 25 | }; 26 | 27 | exports.TimedStatHash = function(thresh) { 28 | 29 | var data = {}; 30 | var max = 0; 31 | 32 | function prune() { 33 | var min = new Date().getTime() - thresh; 34 | var count = 0; 35 | for (var k in data) { 36 | if (data[k] < min) delete data[k]; 37 | else count++; 38 | } 39 | if (count > max) max = count; 40 | return count; 41 | } 42 | 43 | return { 44 | log: function(k) { 45 | data[k] = new Date().getTime(); 46 | prune(); 47 | }, 48 | getCount: function() { 49 | return prune(); 50 | }, 51 | getMax: function() { 52 | return max; 53 | } 54 | } 55 | 56 | }; 57 | 58 | exports.TimedStatQueue = function(thresh) { 59 | 60 | var data = []; 61 | var max = 0; 62 | 63 | function prune() { 64 | var min = new Date().getTime() - thresh; 65 | while (data.length > 0 && data[0] < min) { 66 | data.shift(); 67 | } 68 | if (data.length > max) max = data.length; 69 | return data.length; 70 | } 71 | 72 | return { 73 | log: function() { 74 | data.push(new Date().getTime()); 75 | }, 76 | getCount: function() { 77 | return prune(); 78 | }, 79 | getMax: function() { 80 | return max; 81 | } 82 | }; 83 | 84 | }; 85 | 86 | exports.users = new exports.TimedStatHash(3600000); 87 | exports.requests = new exports.TimedStatQueue(3600000); 88 | 89 | -------------------------------------------------------------------------------- /public/components/chai/lib/chai/utils/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * chai 3 | * Copyright(c) 2011 Jake Luer 4 | * MIT Licensed 5 | */ 6 | 7 | /*! 8 | * Main exports 9 | */ 10 | 11 | var exports = module.exports = {}; 12 | 13 | /*! 14 | * test utility 15 | */ 16 | 17 | exports.test = require('./test'); 18 | 19 | /*! 20 | * type utility 21 | */ 22 | 23 | exports.type = require('./type'); 24 | 25 | /*! 26 | * message utility 27 | */ 28 | 29 | exports.getMessage = require('./getMessage'); 30 | 31 | /*! 32 | * actual utility 33 | */ 34 | 35 | exports.getActual = require('./getActual'); 36 | 37 | /*! 38 | * Inspect util 39 | */ 40 | 41 | exports.inspect = require('./inspect'); 42 | 43 | /*! 44 | * Object Display util 45 | */ 46 | 47 | exports.objDisplay = require('./objDisplay'); 48 | 49 | /*! 50 | * Flag utility 51 | */ 52 | 53 | exports.flag = require('./flag'); 54 | 55 | /*! 56 | * Flag transferring utility 57 | */ 58 | 59 | exports.transferFlags = require('./transferFlags'); 60 | 61 | /*! 62 | * Deep equal utility 63 | */ 64 | 65 | exports.eql = require('./eql'); 66 | 67 | /*! 68 | * Deep path value 69 | */ 70 | 71 | exports.getPathValue = require('./getPathValue'); 72 | 73 | /*! 74 | * Function name 75 | */ 76 | 77 | exports.getName = require('./getName'); 78 | 79 | /*! 80 | * add Property 81 | */ 82 | 83 | exports.addProperty = require('./addProperty'); 84 | 85 | /*! 86 | * add Method 87 | */ 88 | 89 | exports.addMethod = require('./addMethod'); 90 | 91 | /*! 92 | * overwrite Property 93 | */ 94 | 95 | exports.overwriteProperty = require('./overwriteProperty'); 96 | 97 | /*! 98 | * overwrite Method 99 | */ 100 | 101 | exports.overwriteMethod = require('./overwriteMethod'); 102 | 103 | /*! 104 | * Add a chainable method 105 | */ 106 | 107 | exports.addChainableMethod = require('./addChainableMethod'); 108 | 109 | -------------------------------------------------------------------------------- /client/test/date_spec.coffee: -------------------------------------------------------------------------------- 1 | 2 | describe 'T.date', -> 3 | 4 | describe '.format', -> 5 | 6 | now = new Date(2013, 1, 9, 12, 34, 56) 7 | check = (i, o) -> expect(T.date.format(i, now)).to.equal(o) 8 | 9 | describe 'when only time differs', -> 10 | it 'should just show the time', -> 11 | check(new Date(2013, 1, 9, 12, 34, 56), '12:34:56') 12 | check(new Date(2013, 1, 9, 20, 34, 56), '20:34:56') 13 | 14 | describe 'when either date or month differ', -> 15 | it 'show both the month and date', -> 16 | check(new Date(2013, 1, 8, 20, 34, 56), '02-08 20:34:56') 17 | check(new Date(2013, 1, 10, 20, 34, 56), '02-10 20:34:56') # future 18 | check(new Date(2013, 2, 8, 20, 34, 56), '03-08 20:34:56') 19 | check(new Date(2013, 0, 1, 1, 2, 3), '01-01 1:02:03') 20 | 21 | describe 'when year differ', -> 22 | it 'should also show year', -> 23 | check(new Date(2012, 0, 1, 1, 2, 3), '2012-01-01 1:02:03') 24 | check(new Date(2014, 0, 1, 1, 2, 3), '2014-01-01 1:02:03') 25 | 26 | describe 'even when only year differ', -> 27 | it 'should still show the year', -> 28 | check(new Date(2010, 1, 9, 20, 34, 56), '2010-02-09 20:34:56') 29 | 30 | 31 | describe '.parseMonth', -> 32 | 33 | it 'should parse month name and return month index', -> 34 | for c, i in 'Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec'.split('|') 35 | expect(T.date.parseMonth(c)).to.equal(i) 36 | 37 | 38 | describe '.parse', -> 39 | 40 | it 'should parse the date according to Twitter API\'s return result', -> 41 | str = 'Sat Feb 09 04:50:56 +0000 2013' 42 | date = T.date.parse(str) 43 | expect(date.getUTCDate()).to.equal(9) 44 | expect(date.getUTCMonth()).to.equal(1) 45 | expect(date.getUTCFullYear()).to.equal(2013) 46 | expect(date.getUTCHours()).to.equal(4) 47 | expect(date.getUTCMinutes()).to.equal(50) 48 | expect(date.getUTCSeconds()).to.equal(56) 49 | 50 | --------------------------------------------------------------------------------