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 |
--------------------------------------------------------------------------------
/angular-frontend/app/bower_components/socket.io/Makefile:
--------------------------------------------------------------------------------
1 |
2 | ALL_TESTS = $(shell find test/ -name '*.test.js')
3 | ALL_BENCH = $(shell find benchmarks -name '*.bench.js')
4 |
5 | run-tests:
6 | @./node_modules/.bin/expresso \
7 | -t 3000 \
8 | -I support \
9 | --serial \
10 | $(TESTFLAGS) \
11 | $(TESTS)
12 |
13 | test:
14 | @$(MAKE) NODE_PATH=lib TESTS="$(ALL_TESTS)" run-tests
15 |
16 | test-cov:
17 | @TESTFLAGS=--cov $(MAKE) test
18 |
19 | test-leaks:
20 | @ls test/leaks/* | xargs node --expose_debug_as=debug --expose_gc
21 |
22 | run-bench:
23 | @node $(PROFILEFLAGS) benchmarks/runner.js
24 |
25 | bench:
26 | @$(MAKE) BENCHMARKS="$(ALL_BENCH)" run-bench
27 |
28 | profile:
29 | @PROFILEFLAGS='--prof --trace-opt --trace-bailout --trace-deopt' $(MAKE) bench
30 |
31 | .PHONY: test bench profile
32 |
--------------------------------------------------------------------------------
/angular-frontend/app/bower_components/socket.io/benchmarks/runner.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Benchmark runner dependencies
3 | */
4 |
5 | var colors = require('colors')
6 | , path = require('path');
7 |
8 | /**
9 | * Find all the benchmarks
10 | */
11 |
12 | var benchmarks_files = process.env.BENCHMARKS.split(' ')
13 | , all = [].concat(benchmarks_files)
14 | , first = all.shift()
15 | , benchmarks = {};
16 |
17 | // find the benchmarks and load them all in our obj
18 | benchmarks_files.forEach(function (file) {
19 | benchmarks[file] = require(path.join(__dirname, '..', file));
20 | });
21 |
22 | // setup the complete listeners
23 | benchmarks_files.forEach(function (file) {
24 | var benchmark = benchmarks[file]
25 | , next_file = all.shift()
26 | , next = benchmarks[next_file];
27 |
28 | /**
29 | * Generate a oncomplete function for the tests, either we are done or we
30 | * have more benchmarks to process.
31 | */
32 |
33 | function complete () {
34 | if (!next) {
35 | console.log(
36 | '\n\nBenchmark completed in'.grey
37 | , (Date.now() - start).toString().green + ' ms'.grey
38 | );
39 | } else {
40 | console.log('\nStarting benchmark '.grey + next_file.yellow);
41 | next.run();
42 | }
43 | }
44 |
45 | // attach the listener
46 | benchmark.on('complete', complete);
47 | });
48 |
49 | /**
50 | * Start the benchmark
51 | */
52 |
53 | var start = Date.now();
54 | console.log('Starting benchmark '.grey + first.yellow);
55 | benchmarks[first].run();
56 |
--------------------------------------------------------------------------------
/angular-frontend/app/bower_components/socket.io/examples/chat/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "chat.io"
3 | , "description": "example chat application with socket.io"
4 | , "version": "0.0.1"
5 | , "dependencies": {
6 | "express": "2.5.5"
7 | , "jade": "0.16.4"
8 | , "stylus": "0.19.0"
9 | , "nib": "0.2.0"
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/angular-frontend/app/bower_components/socket.io/examples/irc-output/index.jade:
--------------------------------------------------------------------------------
1 | doctype 5
2 | html
3 | head
4 | link(href='/stylesheets/style.css', rel='stylesheet')
5 | script(src='http://code.jquery.com/jquery-1.6.1.min.js')
6 | script(src='/socket.io/socket.io.js')
7 | script
8 | var socket = io.connect();
9 |
10 | socket.on('connect', function () {
11 | $('#irc').addClass('connected');
12 | });
13 |
14 | socket.on('announcement', function (msg) {
15 | $('#messages').append($('').append($('').text(msg)));
16 | $('#messages').get(0).scrollTop = 10000000;
17 | });
18 |
19 | socket.on('irc message', function (user, msg) {
20 | $('#messages').append($('').append($('').text(user), msg));
21 | $('#messages').get(0).scrollTop = 10000000;
22 | });
23 | body
24 | h2 Node.JS IRC
25 | #irc
26 | #connecting
27 | .wrap Connecting to socket.io server
28 | #messages
29 |
--------------------------------------------------------------------------------
/angular-frontend/app/bower_components/socket.io/examples/irc-output/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "socket.io-irc"
3 | , "version": "0.0.1"
4 | , "dependencies": {
5 | "express": "2.5.5"
6 | , "jade": "0.16.4"
7 | , "stylus": "0.19.0"
8 | , "nib": "0.2.0"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/angular-frontend/app/bower_components/socket.io/examples/irc-output/public/stylesheets/style.styl:
--------------------------------------------------------------------------------
1 | @import 'nib'
2 |
3 | h2
4 | font bold 18px Helvetica Neue, Arial
5 |
6 | #irc, #messages
7 | width 600px
8 |
9 | #irc
10 | position relative
11 | border 1px solid #ccc
12 |
13 | #connecting
14 | position absolute
15 | height 410px
16 | z-index 100
17 | left 0
18 | top 0
19 | background #fff
20 | text-align center
21 | width 600px
22 | font 15px Georgia
23 | color #666
24 | display block
25 | .wrap
26 | padding-top 150px
27 |
28 | .connected
29 | #connecting
30 | display none
31 |
32 | #messages
33 | height 380px
34 | background #eee
35 | overflow auto
36 | overflow-x hidden
37 | overflow-y auto
38 | &::-webkit-scrollbar
39 | width 6px
40 | height 6px
41 | &::-webkit-scrollbar-button:start:decrement, ::-webkit-scrollbar-button:end:increment
42 | display block
43 | height 10px
44 | &::-webkit-scrollbar-button:vertical:increment
45 | background-color #fff
46 | &::-webkit-scrollbar-track-piece
47 | background-color #fff
48 | -webkit-border-radius 3px
49 | &::-webkit-scrollbar-thumb:vertical
50 | height 50px
51 | background-color #ccc
52 | -webkit-border-radius 3px
53 | &::-webkit-scrollbar-thumb:horizontal
54 | width 50px
55 | background-color #fff
56 | -webkit-border-radius 3px
57 | em
58 | text-shadow 0 1px 0 #fff
59 | color #999
60 | p
61 | padding 0
62 | margin 0
63 | font 12px Helvetica, Arial
64 | padding 5px 10px
65 | b
66 | display inline-block
67 | padding-right 10px
68 | p:nth-child(even)
69 | background #fafafa
70 |
--------------------------------------------------------------------------------
/angular-frontend/app/bower_components/socket.io/index.js:
--------------------------------------------------------------------------------
1 |
2 | /*!
3 | * socket.io-node
4 | * Copyright(c) 2011 LearnBoost
5 | * MIT Licensed
6 | */
7 |
8 | module.exports = require('./lib/socket.io');
9 |
--------------------------------------------------------------------------------
/angular-frontend/app/bower_components/socket.io/lib/transports/htmlfile.js:
--------------------------------------------------------------------------------
1 |
2 | /*!
3 | * socket.io-node
4 | * Copyright(c) 2011 LearnBoost
5 | * MIT Licensed
6 | */
7 |
8 | /**
9 | * Module requirements.
10 | */
11 |
12 | var HTTPTransport = require('./http');
13 |
14 | /**
15 | * Export the constructor.
16 | */
17 |
18 | exports = module.exports = HTMLFile;
19 |
20 | /**
21 | * HTMLFile transport constructor.
22 | *
23 | * @api public
24 | */
25 |
26 | function HTMLFile (mng, data, req) {
27 | HTTPTransport.call(this, mng, data, req);
28 | };
29 |
30 | /**
31 | * Inherits from Transport.
32 | */
33 |
34 | HTMLFile.prototype.__proto__ = HTTPTransport.prototype;
35 |
36 | /**
37 | * Transport name
38 | *
39 | * @api public
40 | */
41 |
42 | HTMLFile.prototype.name = 'htmlfile';
43 |
44 | /**
45 | * Handles the request.
46 | *
47 | * @api private
48 | */
49 |
50 | HTMLFile.prototype.handleRequest = function (req) {
51 | HTTPTransport.prototype.handleRequest.call(this, req);
52 |
53 | if (req.method == 'GET') {
54 | req.res.writeHead(200, {
55 | 'Content-Type': 'text/html; charset=UTF-8'
56 | , 'Connection': 'keep-alive'
57 | , 'Transfer-Encoding': 'chunked'
58 | });
59 |
60 | req.res.write(
61 | ''
62 | + ''
63 | + new Array(174).join(' ')
64 | );
65 | }
66 | };
67 |
68 | /**
69 | * Performs the write.
70 | *
71 | * @api private
72 | */
73 |
74 | HTMLFile.prototype.write = function (data) {
75 | // escape all forward slashes. see GH-1251
76 | data = '';
77 |
78 | if (this.response.write(data)) {
79 | this.drained = true;
80 | }
81 |
82 | this.log.debug(this.name + ' writing', data);
83 | };
84 |
--------------------------------------------------------------------------------
/angular-frontend/app/bower_components/socket.io/lib/transports/index.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Export transports.
4 | */
5 |
6 | module.exports = {
7 | websocket: require('./websocket')
8 | , flashsocket: require('./flashsocket')
9 | , htmlfile: require('./htmlfile')
10 | , 'xhr-polling': require('./xhr-polling')
11 | , 'jsonp-polling': require('./jsonp-polling')
12 | };
13 |
--------------------------------------------------------------------------------
/angular-frontend/app/bower_components/socket.io/lib/transports/websocket.js:
--------------------------------------------------------------------------------
1 |
2 | /*!
3 | * socket.io-node
4 | * Copyright(c) 2011 LearnBoost
5 | * MIT Licensed
6 | */
7 |
8 | /**
9 | * Module requirements.
10 | */
11 |
12 | var protocolVersions = require('./websocket/');
13 |
14 | /**
15 | * Export the constructor.
16 | */
17 |
18 | exports = module.exports = WebSocket;
19 |
20 | /**
21 | * HTTP interface constructor. Interface compatible with all transports that
22 | * depend on request-response cycles.
23 | *
24 | * @api public
25 | */
26 |
27 | function WebSocket (mng, data, req) {
28 | var transport
29 | , version = req.headers['sec-websocket-version'];
30 | if (typeof version !== 'undefined' && typeof protocolVersions[version] !== 'undefined') {
31 | transport = new protocolVersions[version](mng, data, req);
32 | }
33 | else transport = new protocolVersions['default'](mng, data, req);
34 | if (typeof this.name !== 'undefined') transport.name = this.name;
35 | return transport;
36 | };
37 |
--------------------------------------------------------------------------------
/angular-frontend/app/bower_components/socket.io/lib/transports/websocket/index.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Export websocket versions.
4 | */
5 |
6 | module.exports = {
7 | 7: require('./hybi-07-12'),
8 | 8: require('./hybi-07-12'),
9 | 13: require('./hybi-16'),
10 | default: require('./default')
11 | };
12 |
--------------------------------------------------------------------------------
/angular-frontend/app/bower_components/socket.io/lib/transports/xhr-polling.js:
--------------------------------------------------------------------------------
1 |
2 | /*!
3 | * socket.io-node
4 | * Copyright(c) 2011 LearnBoost
5 | * MIT Licensed
6 | */
7 |
8 | /**
9 | * Module requirements.
10 | */
11 |
12 | var HTTPPolling = require('./http-polling');
13 |
14 | /**
15 | * Export the constructor.
16 | */
17 |
18 | exports = module.exports = XHRPolling;
19 |
20 | /**
21 | * Ajax polling transport.
22 | *
23 | * @api public
24 | */
25 |
26 | function XHRPolling (mng, data, req) {
27 | HTTPPolling.call(this, mng, data, req);
28 | };
29 |
30 | /**
31 | * Inherits from Transport.
32 | */
33 |
34 | XHRPolling.prototype.__proto__ = HTTPPolling.prototype;
35 |
36 | /**
37 | * Transport name
38 | *
39 | * @api public
40 | */
41 |
42 | XHRPolling.prototype.name = 'xhr-polling';
43 |
44 | /**
45 | * Frames data prior to write.
46 | *
47 | * @api private
48 | */
49 |
50 | XHRPolling.prototype.doWrite = function (data) {
51 | HTTPPolling.prototype.doWrite.call(this);
52 |
53 | var origin = this.req.headers.origin
54 | , headers = {
55 | 'Content-Type': 'text/plain; charset=UTF-8'
56 | , 'Content-Length': data === undefined ? 0 : Buffer.byteLength(data)
57 | , 'Connection': 'Keep-Alive'
58 | };
59 |
60 | if (origin) {
61 | // https://developer.mozilla.org/En/HTTP_Access_Control
62 | headers['Access-Control-Allow-Origin'] = origin;
63 | headers['Access-Control-Allow-Credentials'] = 'true';
64 | }
65 |
66 | this.response.writeHead(200, headers);
67 | this.response.write(data);
68 | this.log.debug(this.name + ' writing', data);
69 | };
70 |
--------------------------------------------------------------------------------
/angular-frontend/app/bower_components/socket.io/lib/util.js:
--------------------------------------------------------------------------------
1 |
2 | /*!
3 | * socket.io-node
4 | * Copyright(c) 2011 LearnBoost
5 | * MIT Licensed
6 | */
7 |
8 | /**
9 | * Module dependencies.
10 | */
11 |
12 | /**
13 | * Converts an enumerable to an array.
14 | *
15 | * @api public
16 | */
17 |
18 | exports.toArray = function (enu) {
19 | var arr = [];
20 |
21 | for (var i = 0, l = enu.length; i < l; i++)
22 | arr.push(enu[i]);
23 |
24 | return arr;
25 | };
26 |
27 | /**
28 | * Unpacks a buffer to a number.
29 | *
30 | * @api public
31 | */
32 |
33 | exports.unpack = function (buffer) {
34 | var n = 0;
35 | for (var i = 0; i < buffer.length; ++i) {
36 | n = (i == 0) ? buffer[i] : (n * 256) + buffer[i];
37 | }
38 | return n;
39 | }
40 |
41 | /**
42 | * Left pads a string.
43 | *
44 | * @api public
45 | */
46 |
47 | exports.padl = function (s,n,c) {
48 | return new Array(1 + n - s.length).join(c) + s;
49 | }
50 |
51 |
--------------------------------------------------------------------------------
/angular-frontend/app/bower_components/socket.io/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "socket.io"
3 | , "version": "0.9.15"
4 | , "description": "Real-time apps made cross-browser & easy with a WebSocket-like API"
5 | , "homepage": "http://socket.io"
6 | , "keywords": ["websocket", "socket", "realtime", "socket.io", "comet", "ajax"]
7 | , "author": "Guillermo Rauch "
8 | , "contributors": [
9 | { "name": "Guillermo Rauch", "email": "rauchg@gmail.com" }
10 | , { "name": "Arnout Kazemier", "email": "info@3rd-eden.com" }
11 | , { "name": "Vladimir Dronnikov", "email": "dronnikov@gmail.com" }
12 | , { "name": "Einar Otto Stangvik", "email": "einaros@gmail.com" }
13 | ]
14 | , "repository":{
15 | "type": "git"
16 | , "url": "https://github.com/LearnBoost/socket.io.git"
17 | }
18 | , "dependencies": {
19 | "socket.io-client": "0.9.15"
20 | , "policyfile": "0.0.4"
21 | , "base64id": "0.1.0"
22 | }
23 | , "devDependencies": {
24 | "expresso": "0.9.2"
25 | , "should": "*"
26 | , "benchmark": "0.2.2"
27 | , "microtime": "0.1.3-1"
28 | , "colors": "0.5.1"
29 | }
30 | , "optionalDependencies": {
31 | "redis": "0.7.3"
32 | }
33 | , "main": "index"
34 | , "engines": { "node": ">= 0.4.0" }
35 | , "scripts": {
36 | "test": "make test"
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/angular-frontend/app/bower_components/socket.io/support/node-websocket-client/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2010, Peter Griess
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 |
7 | * Redistributions of source code must retain the above copyright notice,
8 | this list of conditions and the following disclaimer.
9 |
10 | * Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 |
14 | * Neither the name of node-websocket-client nor the names of its
15 | contributors may be used to endorse or promote products derived from this
16 | software 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
27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
--------------------------------------------------------------------------------
/angular-frontend/app/bower_components/socket.io/support/node-websocket-client/Makefile:
--------------------------------------------------------------------------------
1 | # This makefile exists to help run tests.
2 | #
3 | # If TEST_UNIX is a non-empty value, runs tests for UNIX sockets. This
4 | # functionality is not in node-websocket-server at the moment.
5 |
6 | .PHONY: test
7 |
8 | all: test test-unix
9 |
10 | test:
11 | for f in `ls -1 test/test-*.js | grep -v unix` ; do \
12 | echo $$f ; \
13 | node $$f ; \
14 | done
15 |
16 | test-unix:
17 | if [[ -n "$$TEST_UNIX" ]] ; then \
18 | for f in `ls -1 test/test-*.js | grep unix` ; do \
19 | echo $$f ; \
20 | node $$f ; \
21 | done \
22 | fi
23 |
--------------------------------------------------------------------------------
/angular-frontend/app/bower_components/socket.io/support/node-websocket-client/README.md:
--------------------------------------------------------------------------------
1 | A prototype [Web Socket](http://www.whatwg.org/specs/web-socket-protocol/)
2 | client implementation for [node.js](http://nodejs.org).
3 |
4 | Tested with
5 | [miksago/node-websocket-server](http://github.com/miksago/node-websocket-server)
6 | v1.2.00.
7 |
8 | Requires [nodejs](http://nodejs.org) 0.1.98 or later.
9 |
10 | ## Installation
11 |
12 | Install this using `npm` as follows
13 |
14 | npm install websocket-client
15 |
16 | ... or just dump `lib/websocket.js` in your `$NODE_PATH`.
17 |
18 | ## Usage
19 |
20 | var sys = require('sys');
21 | var WebSocket = require('websocket').WebSocket;
22 |
23 | var ws = new WebSocket('ws://localhost:8000/biff', 'borf');
24 | ws.addListener('data', function(buf) {
25 | sys.debug('Got data: ' + sys.inspect(buf));
26 | });
27 | ws.onmessage = function(m) {
28 | sys.debug('Got message: ' + m);
29 | }
30 |
31 | ## API
32 |
33 | This supports the `send()` and `onmessage()` APIs. The `WebSocket` object will
34 | also emit `data` events that are node `Buffer` objects, in case you want to
35 | work with something lower-level than strings.
36 |
37 | ## Transports
38 |
39 | Multiple transports are supported, indicated by the scheme provided to the
40 | `WebSocket` constructor. `ws://` is a standard TCP-based Web Socket;
41 | `ws+unix://` allows connection to a UNIX socket at the given path.
42 |
--------------------------------------------------------------------------------
/angular-frontend/app/bower_components/socket.io/support/node-websocket-client/examples/client-unix.js:
--------------------------------------------------------------------------------
1 | var sys = require('sys');
2 | var WebSocket = require('../lib/websocket').WebSocket;
3 |
4 | var ws = new WebSocket('ws+unix://' + process.argv[2], 'boffo');
5 |
6 | ws.addListener('message', function(d) {
7 | sys.debug('Received message: ' + d.toString('utf8'));
8 | });
9 |
10 | ws.addListener('open', function() {
11 | ws.send('This is a message', 1);
12 | });
13 |
--------------------------------------------------------------------------------
/angular-frontend/app/bower_components/socket.io/support/node-websocket-client/examples/client.js:
--------------------------------------------------------------------------------
1 | var sys = require('sys');
2 | var WebSocket = require('../lib/websocket').WebSocket;
3 |
4 | var ws = new WebSocket('ws://localhost:8000/biff', 'borf');
5 | ws.addListener('data', function(buf) {
6 | sys.debug('Got data: ' + sys.inspect(buf));
7 | });
8 | ws.onmessage = function(m) {
9 | sys.debug('Got message: ' + m);
10 | }
11 |
--------------------------------------------------------------------------------
/angular-frontend/app/bower_components/socket.io/support/node-websocket-client/examples/server-unix.js:
--------------------------------------------------------------------------------
1 | var sys = require('sys');
2 | var ws = require('websocket-server/ws');
3 |
4 | var srv = ws.createServer({ debug : true});
5 | srv.addListener('connection', function(s) {
6 | sys.debug('Got a connection!');
7 |
8 | s._req.socket.addListener('fd', function(fd) {
9 | sys.debug('Got an fd: ' + fd);
10 | });
11 | });
12 |
13 | srv.listen(process.argv[2]);
14 |
--------------------------------------------------------------------------------
/angular-frontend/app/bower_components/socket.io/support/node-websocket-client/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "websocket-client",
3 | "version" : "1.0.0",
4 | "description" : "An HTML5 Web Sockets client",
5 | "author" : "Peter Griess ",
6 | "engines" : {
7 | "node" : ">=0.1.98"
8 | },
9 | "repositories" : [
10 | {
11 | "type" : "git",
12 | "url" : "http://github.com/pgriess/node-websocket-client.git"
13 | }
14 | ],
15 | "licenses" : [
16 | {
17 | "type" : "BSD",
18 | "url" : "http://github.com/pgriess/node-websocket-client/blob/master/LICENSE"
19 | }
20 | ],
21 | "main" : "./lib/websocket"
22 | }
23 |
--------------------------------------------------------------------------------
/angular-frontend/app/bower_components/socket.io/support/node-websocket-client/test/test-client-close.js:
--------------------------------------------------------------------------------
1 | // Verify that a connection can be closed gracefully from the client.
2 |
3 | var assert = require('assert');
4 | var WebSocket = require('../lib/websocket').WebSocket;
5 | var WebSocketServer = require('websocket-server/ws/server').Server;
6 |
7 | var PORT = 1024 + Math.floor(Math.random() * 4096);
8 | var C_MSG = 'Client test: ' + (Math.random() * 100);
9 |
10 | var serverGotClientMessage = false;
11 | var clientGotServerClose = false;
12 | var serverGotClientClose = false;
13 |
14 | var wss = new WebSocketServer();
15 | wss.listen(PORT, 'localhost');
16 | wss.on('connection', function(c) {
17 | c.on('message', function(m) {
18 | assert.equal(m, C_MSG);
19 | serverGotClientMessage = true;
20 | });
21 | c.on('close', function() {
22 | serverGotClientClose = true;
23 | wss.close();
24 | });
25 | });
26 |
27 | var ws = new WebSocket('ws://localhost:' + PORT);
28 | ws.onopen = function() {
29 | ws.send(C_MSG);
30 |
31 | // XXX: Add a timeout here
32 | ws.close(5);
33 | };
34 | ws.onclose = function() {
35 | assert.equal(ws.CLOSED, ws.readyState);
36 | clientGotServerClose = true;
37 | };
38 |
39 | process.on('exit', function() {
40 | assert.ok(serverGotClientMessage);
41 | assert.ok(clientGotServerClose);
42 | assert.ok(serverGotClientClose);
43 | });
44 |
--------------------------------------------------------------------------------
/angular-frontend/app/bower_components/socket.io/support/node-websocket-client/test/test-readonly-attrs.js:
--------------------------------------------------------------------------------
1 | // Verify that some attributes of a WebSocket object are read-only.
2 |
3 | var assert = require('assert');
4 | var sys = require('sys');
5 | var WebSocket = require('../lib/websocket').WebSocket;
6 | var WebSocketServer = require('websocket-server/ws/server').Server;
7 |
8 | var PORT = 1024 + Math.floor(Math.random() * 4096);
9 |
10 | var wss = new WebSocketServer();
11 | wss.listen(PORT, 'localhost');
12 | wss.on('connection', function(c) {
13 | c.close();
14 | wss.close();
15 | });
16 | var ws = new WebSocket('ws://localhost:' + PORT + '/', 'biff');
17 | ws.on('open', function() {
18 | assert.equal(ws.CONNECTING, 0);
19 | try {
20 | ws.CONNECTING = 13;
21 | assert.equal(
22 | ws.CONNECTING, 0,
23 | 'Should not have been able to set read-only CONNECTING attribute'
24 | );
25 | } catch (e) {
26 | assert.equal(e.type, 'no_setter_in_callback');
27 | }
28 |
29 | assert.equal(ws.OPEN, 1);
30 | assert.equal(ws.CLOSING, 2);
31 | assert.equal(ws.CLOSED, 3);
32 |
33 | assert.equal(ws.url, 'ws://localhost:' + PORT + '/');
34 | try {
35 | ws.url = 'foobar';
36 | assert.equal(
37 | ws.url, 'ws://localhost:' + PORT + '/',
38 | 'Should not have been able to set read-only url attribute'
39 | );
40 | } catch (e) {
41 | assert.equal(e.type, 'no_setter_in_callback');
42 | }
43 | });
44 |
--------------------------------------------------------------------------------
/angular-frontend/app/bower_components/socket.io/support/node-websocket-client/test/test-ready-state.js:
--------------------------------------------------------------------------------
1 | // Verify that readyState transitions are implemented correctly
2 |
3 | var assert = require('assert');
4 | var WebSocket = require('../lib/websocket').WebSocket;
5 | var WebSocketServer = require('websocket-server/ws/server').Server;
6 |
7 | var PORT = 1024 + Math.floor(Math.random() * 4096);
8 |
9 | var wss = new WebSocketServer();
10 | wss.listen(PORT, 'localhost');
11 | wss.on('connection', function(c) {
12 | c.close();
13 | });
14 |
15 | var ws = new WebSocket('ws://localhost:' + PORT);
16 | assert.equal(ws.readyState, ws.CONNECTING);
17 | ws.onopen = function() {
18 | assert.equal(ws.readyState, ws.OPEN);
19 |
20 | ws.close();
21 | assert.ok(ws.readyState == ws.CLOSING);
22 | };
23 | ws.onclose = function() {
24 | assert.equal(ws.readyState, ws.CLOSED);
25 | wss.close();
26 | };
27 |
--------------------------------------------------------------------------------
/angular-frontend/app/bower_components/socket.io/support/node-websocket-client/test/test-server-close.js:
--------------------------------------------------------------------------------
1 | // Verify that a connection can be closed gracefully from the server.
2 |
3 | var assert = require('assert');
4 | var WebSocket = require('../lib/websocket').WebSocket;
5 | var WebSocketServer = require('websocket-server/ws/server').Server;
6 |
7 | var PORT = 1024 + Math.floor(Math.random() * 4096);
8 | var S_MSG = 'Server test: ' + (Math.random() * 100);
9 |
10 | var clientGotServerMessage = false;
11 | var clientGotServerClose = false;
12 | var serverGotClientClose = false;
13 |
14 | var wss = new WebSocketServer();
15 | wss.listen(PORT, 'localhost');
16 | wss.on('connection', function(c) {
17 | c.on('close', function() {
18 | serverGotClientClose = true;
19 | wss.close();
20 | });
21 |
22 | c.write(S_MSG);
23 | c.close();
24 | });
25 |
26 | var ws = new WebSocket('ws://localhost:' + PORT);
27 | ws.onmessage = function(m) {
28 | assert.deepEqual(m, {data: S_MSG});
29 |
30 | clientGotServerMessage = true;
31 | };
32 | ws.onclose = function() {
33 | assert.equal(ws.CLOSED, ws.readyState);
34 | clientGotServerClose = true;
35 | };
36 |
37 | process.on('exit', function() {
38 | assert.ok(clientGotServerMessage);
39 | assert.ok(clientGotServerClose);
40 | assert.ok(serverGotClientClose);
41 | });
42 |
--------------------------------------------------------------------------------
/angular-frontend/app/bower_components/socket.io/support/node-websocket-client/test/test-unix-sockets.js:
--------------------------------------------------------------------------------
1 | // Verify that we can connect to a server over UNIX domain sockets.
2 |
3 | var assert = require('assert');
4 | var fs = require('fs');
5 | var path = require('path');
6 | var sys = require('sys');
7 | var WebSocket = require('../lib/websocket').WebSocket;
8 | var WebSocketServer = require('websocket-server/ws/server').Server;
9 |
10 | var PATH = path.join(__dirname, 'sock.' + process.pid);
11 | var S_MSG = 'Server test: ' + (Math.random() * 100);
12 |
13 | var serverGotConnection = false;
14 | var clientGotOpen = false;
15 | var clientGotData = false;
16 |
17 | var wss = new WebSocketServer();
18 | wss.on('listening', function() {
19 | var ws = new WebSocket('ws+unix://' + PATH);
20 | ws.on('open', function() {
21 | clientGotOpen = true;
22 |
23 | ws.close();
24 | });
25 | ws.on('data', function(d) {
26 | assert.equal(d.toString('utf8'), S_MSG);
27 | clientGotData = true;
28 | });
29 | });
30 | wss.on('connection', function(c) {
31 | serverGotConnection = true;
32 |
33 | c.write(S_MSG);
34 | wss.close();
35 | });
36 | wss.listen(PATH);
37 |
38 | process.on('exit', function() {
39 | assert.ok(serverGotConnection);
40 | assert.ok(clientGotOpen);
41 | assert.ok(clientGotData);
42 |
43 | try {
44 | fs.unlinkSync(PATH);
45 | } catch(e) { }
46 | });
47 |
--------------------------------------------------------------------------------
/angular-frontend/app/bower_components/socket.io/test/fixtures/cert.crt:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIIDXTCCAkWgAwIBAgIJAMUSOvlaeyQHMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV
3 | BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX
4 | aWRnaXRzIFB0eSBMdGQwHhcNMTAxMTE2MDkzMjQ5WhcNMTMxMTE1MDkzMjQ5WjBF
5 | MQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50
6 | ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
7 | CgKCAQEAz+LXZOjcQCJq3+ZKUFabj71oo/ex/XsBcFqtBThjjTw9CVEVwfPQQp4X
8 | wtPiB204vnYXwQ1/R2NdTQqCZu47l79LssL/u2a5Y9+0NEU3nQA5qdt+1FAE0c5o
9 | exPimXOrR3GWfKz7PmZ2O0117IeCUUXPG5U8umhDe/4mDF4ZNJiKc404WthquTqg
10 | S7rLQZHhZ6D0EnGnOkzlmxJMYPNHSOY1/6ivdNUUcC87awNEA3lgfhy25IyBK3QJ
11 | c+aYKNTbt70Lery3bu2wWLFGtmNiGlQTS4JsxImRsECTI727ObS7/FWAQsqW+COL
12 | 0Sa5BuMFrFIpjPrEe0ih7vRRbdmXRwIDAQABo1AwTjAdBgNVHQ4EFgQUDnV4d6mD
13 | tOnluLoCjkUHTX/n4agwHwYDVR0jBBgwFoAUDnV4d6mDtOnluLoCjkUHTX/n4agw
14 | DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAFwV4MQfTo+qMv9JMiyno
15 | IEiqfOz4RgtmBqRnXUffcjS2dhc7/z+FPZnM79Kej8eLHoVfxCyWRHFlzm93vEdv
16 | wxOCrD13EDOi08OOZfxWyIlCa6Bg8cMAKqQzd2OvQOWqlRWBTThBJIhWflU33izX
17 | Qn5GdmYqhfpc+9ZHHGhvXNydtRQkdxVK2dZNzLBvBlLlRmtoClU7xm3A+/5dddeP
18 | AQHEPtyFlUw49VYtZ3ru6KqPms7MKvcRhYLsy9rwSfuuniMlx4d0bDR7TOkw0QQS
19 | A0N8MGQRQpzl4mw4jLzyM5d5QtuGBh2P6hPGa0YQxtI3RPT/p6ENzzBiAKXiSfzo
20 | xw==
21 | -----END CERTIFICATE-----
22 |
--------------------------------------------------------------------------------
/angular-frontend/app/bower_components/socket.io/test/fixtures/key.key:
--------------------------------------------------------------------------------
1 | -----BEGIN RSA PRIVATE KEY-----
2 | MIIEowIBAAKCAQEAz+LXZOjcQCJq3+ZKUFabj71oo/ex/XsBcFqtBThjjTw9CVEV
3 | wfPQQp4XwtPiB204vnYXwQ1/R2NdTQqCZu47l79LssL/u2a5Y9+0NEU3nQA5qdt+
4 | 1FAE0c5oexPimXOrR3GWfKz7PmZ2O0117IeCUUXPG5U8umhDe/4mDF4ZNJiKc404
5 | WthquTqgS7rLQZHhZ6D0EnGnOkzlmxJMYPNHSOY1/6ivdNUUcC87awNEA3lgfhy2
6 | 5IyBK3QJc+aYKNTbt70Lery3bu2wWLFGtmNiGlQTS4JsxImRsECTI727ObS7/FWA
7 | QsqW+COL0Sa5BuMFrFIpjPrEe0ih7vRRbdmXRwIDAQABAoIBAGe4+9VqZfJN+dsq
8 | 8Osyuz01uQ8OmC0sAWTIqUlQgENIyf9rCJsUBlYmwR5BT6Z69XP6QhHdpSK+TiAR
9 | XUz0EqG9HYzcxHIBaACP7j6iRoQ8R4kbbiWKo0z3WqQGIOqFjvD/mKEuQdE5mEYw
10 | eOUCG6BnX1WY2Yr8WKd2AA/tp0/Y4d8z04u9eodMpSTbHTzYMJb5SbBN1vo6FY7q
11 | 8zSuO0BMzXlAxUsCwHsk1GQHFr8Oh3zIR7bQGtMBouI+6Lhh7sjFYsfxJboqMTBV
12 | IKaA216M6ggHG7MU1/jeKcMGDmEfqQLQoyWp29rMK6TklUgipME2L3UD7vTyAVzz
13 | xbVOpZkCgYEA8CXW4sZBBrSSrLR5SB+Ubu9qNTggLowOsC/kVKB2WJ4+xooc5HQo
14 | mFhq1v/WxPQoWIxdYsfg2odlL+JclK5Qcy6vXmRSdAQ5lK9gBDKxZSYc3NwAw2HA
15 | zyHCTK+I0n8PBYQ+yGcrxu0WqTGnlLW+Otk4CejO34WlgHwbH9bbY5UCgYEA3ZvT
16 | C4+OoMHXlmICSt29zUrYiL33IWsR3/MaONxTEDuvgkOSXXQOl/8Ebd6Nu+3WbsSN
17 | bjiPC/JyL1YCVmijdvFpl4gjtgvfJifs4G+QHvO6YfsYoVANk4u6g6rUuBIOwNK4
18 | RwYxwDc0oysp+g7tPxoSgDHReEVKJNzGBe9NGGsCgYEA4O4QP4gCEA3B9BF2J5+s
19 | n9uPVxmiyvZUK6Iv8zP4pThTBBMIzNIf09G9AHPQ7djikU2nioY8jXKTzC3xGTHM
20 | GJZ5m6fLsu7iH+nDvSreDSeNkTBfZqGAvoGYQ8uGE+L+ZuRfCcXYsxIOT5s6o4c3
21 | Dle2rVFpsuKzCY00urW796ECgYBn3go75+xEwrYGQSer6WR1nTgCV29GVYXKPooy
22 | zmmMOT1Yw80NSkEw0pFD4cTyqVYREsTrPU0mn1sPfrOXxnGfZSVFpcR/Je9QVfQ7
23 | eW7GYxwfom335aqHVj10SxRqteP+UoWWnHujCPz94VRKZMakBddYCIGSan+G6YdS
24 | 7sdmwwKBgBc2qj0wvGXDF2kCLwSGfWoMf8CS1+5fIiUIdT1e/+7MfDdbmLMIFVjF
25 | QKS3zVViXCbrG5SY6wS9hxoc57f6E2A8vcaX6zy2xkZlGHQCpWRtEM5R01OWJQaH
26 | HsHMmQZGUQVoDm1oRkDhrTFK4K3ukc3rAxzeTZ96utOQN8/KJsTv
27 | -----END RSA PRIVATE KEY-----
28 |
--------------------------------------------------------------------------------
/angular-frontend/app/bower_components/socket.io/test/leaks/socket.leaktest.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * socket.io-node
3 | * Copyright(c) 2011 LearnBoost
4 | * MIT Licensed
5 | */
6 |
7 | /**
8 | * Test dependencies.
9 | */
10 |
11 | require.paths.unshift(__dirname + '/../../lib');
12 |
13 | var assertvanish = require('assertvanish')
14 | , common = require('../common')
15 | , ports = 15800;
16 |
17 | function resultCallback (leaks, leakedSocket) {
18 | if (leaks) {
19 | console.error('Leak detected');
20 | process.exit(1);
21 | } else {
22 | console.error('No leaks');
23 | process.exit(0);
24 | }
25 | };
26 |
27 | /**
28 | * Test.
29 | */
30 |
31 | var cl = client(++ports);
32 | var io = create(cl);
33 |
34 | io.sockets.on('connection', function (socket) {
35 | console.log('connected');
36 |
37 | socket.on('disconnect', function() {
38 | console.log("client gone");
39 | setTimeout(gc, 1000);
40 | assertvanish(socket, 2000, {silent: true, callback: resultCallback});
41 | });
42 | });
43 |
44 | setTimeout(function() {
45 | cl.handshake(function (sid) {
46 | var ws = websocket(cl, sid);
47 | ws.on('open', function () {
48 | console.log('open!');
49 | setTimeout(function() {
50 | ws.close();
51 | }, 500);
52 | });
53 | });
54 | }, 100);
55 |
--------------------------------------------------------------------------------
/angular-frontend/app/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/krimple/angular-socketio-chat/218a26fb6528b29fe37a2615c9c85fb9a3997907/angular-frontend/app/favicon.ico
--------------------------------------------------------------------------------
/angular-frontend/app/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/krimple/angular-socketio-chat/218a26fb6528b29fe37a2615c9c85fb9a3997907/angular-frontend/app/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/angular-frontend/app/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/krimple/angular-socketio-chat/218a26fb6528b29fe37a2615c9c85fb9a3997907/angular-frontend/app/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/angular-frontend/app/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/krimple/angular-socketio-chat/218a26fb6528b29fe37a2615c9c85fb9a3997907/angular-frontend/app/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/angular-frontend/app/images/yeoman.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/krimple/angular-socketio-chat/218a26fb6528b29fe37a2615c9c85fb9a3997907/angular-frontend/app/images/yeoman.png
--------------------------------------------------------------------------------
/angular-frontend/app/robots.txt:
--------------------------------------------------------------------------------
1 | # robotstxt.org
2 |
3 | User-agent: *
4 |
--------------------------------------------------------------------------------
/angular-frontend/app/scripts/app.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | angular
4 | .module('chatApp', [
5 | 'ngCookies',
6 | 'ngResource',
7 | 'ngSanitize',
8 | 'btford.socket-io'
9 | ])
10 | .value('nickName', 'anonymous');
11 |
--------------------------------------------------------------------------------
/angular-frontend/app/scripts/controllers/socket.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | angular.module('chatApp')
4 | .controller('SocketCtrl', function ($log, $scope, chatSocket, messageFormatter, nickName) {
5 | $scope.nickName = nickName;
6 | $scope.messageLog = 'Ready to chat!';
7 | $scope.sendMessage = function() {
8 | var match = $scope.message.match('^\/nick (.*)');
9 |
10 | if (angular.isDefined(match) && angular.isArray(match) && match.length === 2) {
11 | var oldNick = nickName;
12 | nickName = match[1];
13 | $scope.message = '';
14 | $scope.messageLog = messageFormatter(new Date(),
15 | nickName, 'nickname changed - from ' +
16 | oldNick + ' to ' + nickName + '!') + $scope.messageLog;
17 | $scope.nickName = nickName;
18 | }
19 |
20 | $log.debug('sending message', $scope.message);
21 | chatSocket.emit('message', nickName, $scope.message);
22 | $scope.message = '';
23 | };
24 |
25 | $scope.$on('socket:broadcast', function(event, data) {
26 | $log.debug('got a message', event.name);
27 | if (!data.payload) {
28 | $log.error('invalid message', 'event', event, 'data', JSON.stringify(data));
29 | return;
30 | }
31 | $scope.$apply(function() {
32 | $scope.messageLog = $scope.messageLog + messageFormatter(new Date(), data.source, data.payload);
33 | });
34 | });
35 | });
36 |
--------------------------------------------------------------------------------
/angular-frontend/app/scripts/directives/chatbox.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | 'use strict';
3 |
4 | angular.module('chatApp')
5 | .directive('chatBox', function() {
6 | return {
7 | restrict: 'E',
8 | template: '',
9 | controller: function($scope, $element) {
10 | $scope.$watch('messageLog', function() {
11 | var textArea = $element[0].children[0];
12 | textArea.scrollTop = textArea.scrollHeight;
13 | });
14 | }
15 | };
16 | });
17 |
18 | }());
19 |
--------------------------------------------------------------------------------
/angular-frontend/app/scripts/services/messageformatter.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | angular.module('chatApp')
4 | .value('messageFormatter', function(date, nick, message) {
5 | return date.toLocaleTimeString() + ' - ' +
6 | nick + ' - ' +
7 | message + '\n';
8 |
9 | });
10 |
--------------------------------------------------------------------------------
/angular-frontend/app/scripts/services/socket.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | angular.module('chatApp')
3 | .factory('chatSocket', function (socketFactory) {
4 | var socket = socketFactory();
5 | socket.forward('broadcast');
6 | return socket;
7 | });
8 |
--------------------------------------------------------------------------------
/angular-frontend/app/styles/main.css:
--------------------------------------------------------------------------------
1 | /* Space out content a bit */
2 | body {
3 | padding-top: 20px;
4 | padding-bottom: 20px;
5 | }
6 |
7 | /* Everything but the jumbotron gets side spacing for mobile first views */
8 | .header,
9 | .marketing,
10 | .footer {
11 | padding-left: 15px;
12 | padding-right: 15px;
13 | }
14 |
15 | /* Custom page header */
16 | .header {
17 | border-bottom: 1px solid #e5e5e5;
18 | }
19 | /* Make the masthead heading the same height as the navigation */
20 | .header h3 {
21 | margin-top: 0;
22 | margin-bottom: 0;
23 | line-height: 40px;
24 | padding-bottom: 19px;
25 | }
26 |
27 | /* Custom page footer */
28 | .footer {
29 | padding-top: 19px;
30 | color: #777;
31 | border-top: 1px solid #e5e5e5;
32 | }
33 |
34 | /* Customize container */
35 | @media (min-width: 768px) {
36 | .container {
37 | max-width: 730px;
38 | }
39 | }
40 | .container-narrow > hr {
41 | margin: 30px 0;
42 | }
43 |
44 | /* Main marketing message and sign up button */
45 | .jumbotron {
46 | text-align: center;
47 | border-bottom: 1px solid #e5e5e5;
48 | }
49 | .jumbotron .btn {
50 | font-size: 21px;
51 | padding: 14px 24px;
52 | }
53 |
54 | /* Supporting marketing content */
55 | .marketing {
56 | margin: 40px 0;
57 | }
58 | .marketing p + h4 {
59 | margin-top: 28px;
60 | }
61 |
62 | /* Responsive: Portrait tablets and up */
63 | @media screen and (min-width: 768px) {
64 | /* Remove the padding we set earlier */
65 | .header,
66 | .marketing,
67 | .footer {
68 | padding-left: 0;
69 | padding-right: 0;
70 | }
71 | /* Space out the masthead */
72 | .header {
73 | margin-bottom: 30px;
74 | }
75 | /* Remove the bottom border on the jumbotron for visual effect */
76 | .jumbotron {
77 | border-bottom: 0;
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/angular-frontend/app/views/main.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/angular-frontend/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "app",
3 | "version": "0.0.0",
4 | "dependencies": {
5 | "angular": "1.2.15",
6 | "json3": "~3.2.6",
7 | "es5-shim": "~2.1.0",
8 | "jquery": "~1.11.0",
9 | "bootstrap": "~3.0.3",
10 | "angular-resource": "1.2.15",
11 | "angular-cookies": "1.2.15",
12 | "angular-sanitize": "1.2.15",
13 | "angular-route": "1.2.15",
14 | "socket.io-client": "~0.9.16",
15 | "angular-socket-io": "~0.4.1",
16 | "socket.io": "~0.9.15"
17 | },
18 | "devDependencies": {
19 | "angular-mocks": "1.2.15",
20 | "angular-scenario": "1.2.15"
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/angular-frontend/karma-e2e.conf.js:
--------------------------------------------------------------------------------
1 | // Karma configuration
2 | // http://karma-runner.github.io/0.10/config/configuration-file.html
3 |
4 | module.exports = function(config) {
5 | config.set({
6 | // base path, that will be used to resolve files and exclude
7 | basePath: '',
8 |
9 | // testing framework to use (jasmine/mocha/qunit/...)
10 | frameworks: ['ng-scenario'],
11 |
12 | // list of files / patterns to load in the browser
13 | files: [
14 | 'test/e2e/**/*.js'
15 | ],
16 |
17 | // list of files / patterns to exclude
18 | exclude: [],
19 |
20 | // web server port
21 | port: 8080,
22 |
23 | // level of logging
24 | // possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
25 | logLevel: config.LOG_INFO,
26 |
27 |
28 | // enable / disable watching file and executing tests whenever any file changes
29 | autoWatch: false,
30 |
31 |
32 | // Start these browsers, currently available:
33 | // - Chrome
34 | // - ChromeCanary
35 | // - Firefox
36 | // - Opera
37 | // - Safari (only Mac)
38 | // - PhantomJS
39 | // - IE (only Windows)
40 | browsers: ['Chrome'],
41 |
42 |
43 | // Continuous Integration mode
44 | // if true, it capture browsers, run tests and exit
45 | singleRun: false
46 |
47 | // Uncomment the following lines if you are using grunt's server to run the tests
48 | // proxies: {
49 | // '/': 'http://localhost:9000/'
50 | // },
51 | // URL root prevent conflicts with the site root
52 | // urlRoot: '_karma_'
53 | });
54 | };
55 |
--------------------------------------------------------------------------------
/angular-frontend/karma.conf.js:
--------------------------------------------------------------------------------
1 | // Karma configuration
2 | // http://karma-runner.github.io/0.10/config/configuration-file.html
3 |
4 | module.exports = function(config) {
5 | config.set({
6 | // base path, that will be used to resolve files and exclude
7 | basePath: '',
8 |
9 | // testing framework to use (jasmine/mocha/qunit/...)
10 | frameworks: ['jasmine'],
11 |
12 | // list of files / patterns to load in the browser
13 | files: [
14 | 'app/bower_components/angular/angular.js',
15 | 'app/bower_components/angular-mocks/angular-mocks.js',
16 | 'app/bower_components/angular-resource/angular-resource.js',
17 | 'app/bower_components/angular-cookies/angular-cookies.js',
18 | 'app/bower_components/angular-sanitize/angular-sanitize.js',
19 | 'app/bower_components/angular-route/angular-route.js',
20 | 'app/scripts/*.js',
21 | 'app/scripts/**/*.js',
22 | 'test/mock/**/*.js',
23 | 'test/spec/**/*.js'
24 | ],
25 |
26 | // list of files / patterns to exclude
27 | exclude: [],
28 |
29 | // web server port
30 | port: 8080,
31 |
32 | // level of logging
33 | // possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
34 | logLevel: config.LOG_INFO,
35 |
36 |
37 | // enable / disable watching file and executing tests whenever any file changes
38 | autoWatch: false,
39 |
40 |
41 | // Start these browsers, currently available:
42 | // - Chrome
43 | // - ChromeCanary
44 | // - Firefox
45 | // - Opera
46 | // - Safari (only Mac)
47 | // - PhantomJS
48 | // - IE (only Windows)
49 | browsers: ['Chrome'],
50 |
51 |
52 | // Continuous Integration mode
53 | // if true, it capture browsers, run tests and exit
54 | singleRun: false
55 | });
56 | };
57 |
--------------------------------------------------------------------------------
/angular-frontend/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "app",
3 | "version": "0.0.0",
4 | "dependencies": {},
5 | "devDependencies": {
6 | "grunt": "~0.4.1",
7 | "grunt-autoprefixer": "~0.4.0",
8 | "grunt-bower-install": "~1.0.0",
9 | "grunt-concurrent": "~0.5.0",
10 | "grunt-contrib-clean": "~0.5.0",
11 | "grunt-contrib-concat": "~0.3.0",
12 | "grunt-contrib-connect": "~0.5.0",
13 | "grunt-contrib-copy": "~0.4.1",
14 | "grunt-contrib-cssmin": "~0.7.0",
15 | "grunt-contrib-htmlmin": "~0.1.3",
16 | "grunt-contrib-imagemin": "~0.3.0",
17 | "grunt-contrib-jshint": "~0.7.1",
18 | "grunt-contrib-uglify": "~0.2.0",
19 | "grunt-contrib-watch": "~0.5.2",
20 | "grunt-google-cdn": "~0.2.0",
21 | "grunt-newer": "~0.6.1",
22 | "grunt-ngmin": "~0.0.2",
23 | "grunt-rev": "~0.1.0",
24 | "grunt-svgmin": "~0.2.0",
25 | "grunt-usemin": "~2.0.0",
26 | "jshint-stylish": "~0.1.3",
27 | "load-grunt-tasks": "~0.4.0",
28 | "time-grunt": "~0.2.1",
29 | "karma": "^0.12.9"
30 | },
31 | "engines": {
32 | "node": ">=0.10.0"
33 | },
34 | "scripts": {
35 | "test": "grunt test"
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/angular-frontend/test/.jshintrc:
--------------------------------------------------------------------------------
1 | {
2 | "node": true,
3 | "browser": true,
4 | "esnext": true,
5 | "bitwise": true,
6 | "camelcase": true,
7 | "curly": true,
8 | "eqeqeq": true,
9 | "immed": true,
10 | "indent": 2,
11 | "latedef": true,
12 | "newcap": true,
13 | "noarg": true,
14 | "quotmark": "single",
15 | "regexp": true,
16 | "undef": true,
17 | "unused": true,
18 | "strict": true,
19 | "trailing": true,
20 | "smarttabs": true,
21 | "globals": {
22 | "after": false,
23 | "afterEach": false,
24 | "angular": false,
25 | "before": false,
26 | "beforeEach": false,
27 | "browser": false,
28 | "describe": false,
29 | "expect": false,
30 | "inject": false,
31 | "it": false,
32 | "jasmine": false,
33 | "spyOn": false
34 | }
35 | }
36 |
37 |
--------------------------------------------------------------------------------
/angular-frontend/test/runner.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | End2end Test Runner
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/angular-frontend/test/spec/controllers/main.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | describe('Controller: MainCtrl', function () {
4 |
5 | // load the controller's module
6 | beforeEach(module('appApp'));
7 |
8 | var MainCtrl,
9 | scope;
10 |
11 | // Initialize the controller and a mock scope
12 | beforeEach(inject(function ($controller, $rootScope) {
13 | scope = $rootScope.$new();
14 | MainCtrl = $controller('MainCtrl', {
15 | $scope: scope
16 | });
17 | }));
18 |
19 | it('should attach a list of awesomeThings to the scope', function () {
20 | expect(scope.awesomeThings.length).toBe(3);
21 | });
22 | });
23 |
--------------------------------------------------------------------------------
/angular-frontend/test/spec/controllers/nick.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | describe('Controller: NickCtrl', function () {
4 |
5 | // load the controller's module
6 | beforeEach(module('appApp'));
7 |
8 | var NickCtrl,
9 | scope;
10 |
11 | // Initialize the controller and a mock scope
12 | beforeEach(inject(function ($controller, $rootScope) {
13 | scope = $rootScope.$new();
14 | NickCtrl = $controller('NickCtrl', {
15 | $scope: scope
16 | });
17 | }));
18 |
19 | it('should attach a list of awesomeThings to the scope', function () {
20 | expect(scope.awesomeThings.length).toBe(3);
21 | });
22 | });
23 |
--------------------------------------------------------------------------------
/angular-frontend/test/spec/controllers/socket.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | describe('Controller: SocketCtrl', function () {
4 |
5 | // load the controller's module
6 | beforeEach(module('appApp'));
7 |
8 | var SocketCtrl,
9 | scope;
10 |
11 | // Initialize the controller and a mock scope
12 | beforeEach(inject(function ($controller, $rootScope) {
13 | scope = $rootScope.$new();
14 | SocketCtrl = $controller('SocketCtrl', {
15 | $scope: scope
16 | });
17 | }));
18 |
19 | it('should attach a list of awesomeThings to the scope', function () {
20 | expect(scope.awesomeThings.length).toBe(3);
21 | });
22 | });
23 |
--------------------------------------------------------------------------------
/angular-frontend/test/spec/services/messageformatter.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | describe('Service: messageFormatter', function () {
4 |
5 | // load the service's module
6 | beforeEach(module('appApp'));
7 |
8 | // instantiate service
9 | var messageFormatter;
10 | beforeEach(inject(function (_messageFormatter_) {
11 | messageFormatter = _messageFormatter_;
12 | }));
13 |
14 | it('should do something', function () {
15 | expect(!!messageFormatter).toBe(true);
16 | });
17 |
18 | });
19 |
--------------------------------------------------------------------------------
/angular-frontend/test/spec/services/socket.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | describe('Service: Socket', function () {
4 |
5 | // load the service's module
6 | beforeEach(module('appApp'));
7 |
8 | // instantiate service
9 | var Socket;
10 | beforeEach(inject(function (_Socket_) {
11 | Socket = _Socket_;
12 | }));
13 |
14 | it('should do something', function () {
15 | expect(!!Socket).toBe(true);
16 | });
17 |
18 | });
19 |
--------------------------------------------------------------------------------
/bin/www:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env nodemon
2 | var debug = require('debug')('my-application');
3 | var app = require('../app');
4 |
5 | app.set('port', process.env.PORT || 3000);
6 |
7 | var server = app.listen(app.get('port'), function() {
8 | debug('Express server listening on port ' + server.address().port);
9 | });
10 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "application-name",
3 | "version": "0.0.1",
4 | "private": true,
5 | "scripts": {
6 | "start": "node ./bin/www"
7 | },
8 | "dependencies": {
9 | "express": "~3.5.0",
10 | "static-favicon": "~1.0.0",
11 | "morgan": "~1.0.0",
12 | "cookie-parser": "~1.0.1",
13 | "body-parser": "~1.0.0",
14 | "debug": "~0.7.4",
15 | "jade": "~1.3.0",
16 | "stylus": "0.42.3",
17 | "socket.io": "^0.9.16"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/krimple/angular-socketio-chat/218a26fb6528b29fe37a2615c9c85fb9a3997907/public/favicon.ico
--------------------------------------------------------------------------------
/public/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/krimple/angular-socketio-chat/218a26fb6528b29fe37a2615c9c85fb9a3997907/public/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/public/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/krimple/angular-socketio-chat/218a26fb6528b29fe37a2615c9c85fb9a3997907/public/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/public/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/krimple/angular-socketio-chat/218a26fb6528b29fe37a2615c9c85fb9a3997907/public/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/public/images/47b431ed.yeoman.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/krimple/angular-socketio-chat/218a26fb6528b29fe37a2615c9c85fb9a3997907/public/images/47b431ed.yeoman.png
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 | Angular Chatter
You are known as:
.
Change your nickname with
/nick [yourNewNick]
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # robotstxt.org
2 |
3 | User-agent: *
4 |
--------------------------------------------------------------------------------
/public/scripts/e6702acc.scripts.js:
--------------------------------------------------------------------------------
1 | "use strict";angular.module("chatApp",["ngCookies","ngResource","ngSanitize","btford.socket-io"]).value("nickName","anonymous"),angular.module("chatApp").controller("SocketCtrl",["$log","$scope","chatSocket","messageFormatter","nickName",function(a,b,c,d,e){b.nickName=e,b.messageLog="Ready to chat!",b.sendMessage=function(){var f=b.message.match("^/nick (.*)");if(angular.isDefined(f)&&angular.isArray(f)&&2===f.length){var g=e;e=f[1],b.message="",b.messageLog=d(new Date,e,"nickname changed - from "+g+" to "+e+"!")+b.messageLog,b.nickName=e}a.debug("sending message",b.message),c.emit("message",e,b.message),b.message=""},b.$on("socket:broadcast",function(c,e){return a.debug("got a message",c.name),e.payload?void b.$apply(function(){b.messageLog=b.messageLog+d(new Date,e.source,e.payload)}):void a.error("invalid message","event",c,"data",JSON.stringify(e))})}]),angular.module("chatApp").factory("chatSocket",["socketFactory",function(a){var b=a();return b.forward("broadcast"),b}]),angular.module("chatApp").value("messageFormatter",function(a,b,c){return a.toLocaleTimeString()+" - "+b+" - "+c+"\n"}),function(){angular.module("chatApp").directive("chatBox",function(){return{restrict:"E",template:'',controller:["$scope","$element",function(a,b){a.$watch("messageLog",function(){var a=b[0].children[0];a.scrollTop=a.scrollHeight})}]}})}();
--------------------------------------------------------------------------------
/public/styles/5a3706b1.main.css:
--------------------------------------------------------------------------------
1 | body{padding-top:20px;padding-bottom:20px}.footer,.header,.marketing{padding-left:15px;padding-right:15px}.header{border-bottom:1px solid #e5e5e5}.header h3{margin-top:0;margin-bottom:0;line-height:40px;padding-bottom:19px}.footer{padding-top:19px;color:#777;border-top:1px solid #e5e5e5}@media (min-width:768px){.container{max-width:730px}}.container-narrow>hr{margin:30px 0}.jumbotron{text-align:center;border-bottom:1px solid #e5e5e5}.jumbotron .btn{font-size:21px;padding:14px 24px}.marketing{margin:40px 0}.marketing p+h4{margin-top:28px}@media screen and (min-width:768px){.footer,.header,.marketing{padding-left:0;padding-right:0}.header{margin-bottom:30px}.jumbotron{border-bottom:0}}body{padding-top:20px;padding-bottom:20px}.footer,.header,.marketing{padding-left:15px;padding-right:15px}.header{border-bottom:1px solid #e5e5e5}.header h3{margin-top:0;margin-bottom:0;line-height:40px;padding-bottom:19px}.footer{padding-top:19px;color:#777;border-top:1px solid #e5e5e5}@media (min-width:768px){.container{max-width:730px}}.container-narrow>hr{margin:30px 0}.jumbotron{text-align:center;border-bottom:1px solid #e5e5e5}.jumbotron .btn{font-size:21px;padding:14px 24px}.marketing{margin:40px 0}.marketing p+h4{margin-top:28px}@media screen and (min-width:768px){.footer,.header,.marketing{padding-left:0;padding-right:0}.header{margin-bottom:30px}.jumbotron{border-bottom:0}}
--------------------------------------------------------------------------------
/public/views/main.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/routes/api.js:
--------------------------------------------------------------------------------
1 | module.exports = function(app) {
2 | 'use strict';
3 |
4 | /* GET users listing. */
5 | app.get('/api/test', function(req, res) {
6 | res.send([
7 | {
8 | a: 'b',
9 | c: 'd'
10 | }]);
11 | });
12 | };
13 |
14 |
15 |
--------------------------------------------------------------------------------
/routes/users.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var express = require('express'),
4 | router = express.Router();
5 |
6 | /* GET users listing. */
7 | router.get('/', function(req, res) {
8 | res.send('respond with a resource');
9 | });
10 |
11 | module.exports = router;
12 |
--------------------------------------------------------------------------------
/sockets/base.js:
--------------------------------------------------------------------------------
1 | module.exports = function (io) {
2 | 'use strict';
3 | io.on('connection', function (socket) {
4 | socket.broadcast.emit('user connected');
5 |
6 | socket.on('message', function (from, msg) {
7 |
8 | console.log('recieved message from', from, 'msg', JSON.stringify(msg));
9 |
10 | console.log('broadcasting message');
11 | console.log('payload is', msg);
12 | io.sockets.emit('broadcast', {
13 | payload: msg,
14 | source: from
15 | });
16 | console.log('broadcast complete');
17 | });
18 | });
19 | };
20 |
21 |
--------------------------------------------------------------------------------
/views/error.jade:
--------------------------------------------------------------------------------
1 | extends layout
2 |
3 | block content
4 | h1= message
5 | h2= error.status
6 | pre #{error.stack}
7 |
--------------------------------------------------------------------------------
/views/index.jade:
--------------------------------------------------------------------------------
1 | extends layout
2 |
3 | block content
4 | h1= title
5 | p Welcome to #{title}
6 |
--------------------------------------------------------------------------------
/views/layout.jade:
--------------------------------------------------------------------------------
1 | doctype html
2 | html
3 | head
4 | title= title
5 | link(rel='stylesheet', href='/stylesheets/style.css')
6 | body
7 | block content
--------------------------------------------------------------------------------