frtk 4 years ago
parent
commit
3d360494cf

+ 0
- 8
client/js/NPGClient.js View File

@@ -1,8 +0,0 @@
1
-/**
2
- * @file NPGClient.js
3
- * @author frtk
4
- */
5
-
6
-var NPGClient = { 'version': '' };
7
-
8
-

+ 0
- 13
client/js/config/NPGClientConfig.js View File

@@ -1,13 +0,0 @@
1
-/**
2
- * @file NPGClientConfig.js
3
- */
4
-
5
-var NPGClient.Config = {
6
-
7
-       
8
-
9
-
10
-
11
-
12
-
13
-}

+ 0
- 114
client/js/core/page_base.js~ View File

@@ -1,114 +0,0 @@
1
-/**
2
- * @file AppPage.js
3
- * @author frtk@tetalab
4
- */
5
-
6
-NPGClient.AppPage = function(n) { 
7
-    
8
-  Object.defineProperty(this, 'id', { value: NPGClient.pageCount++ });
9
-   
10
-  this.name = n || '';
11
-  // draw loop paramaters
12
-  this.loopIntervalId = 0;
13
-  this.loopDelay = 40; 
14
-  // canvas 
15
-  this.canvas_id = "";
16
-  this.canvas_bcol = "";
17
-  this.canvas = {};
18
-  this.ctx = {};
19
-
20
-  // ui elements   
21
-  this.uiElems = [];
22
-
23
-};
24
-
25
-NPGClient.AppPage.prototype = {
26
-
27
-  constructor: NPGClient.AppPage,
28
-
29
-  //
30
-  setLoopDelay: function(d) {
31
-    this.loopDelay = d;
32
-  },
33
-
34
-  //
35
-  startDrawLoop: function() {
36
-    var self = this;
37
-    self.loopIntervalId = setInterval(function() { 
38
-      self.run(); 
39
-    }, self.loopDelay);
40
-  },
41
-
42
-  //
43
-  stopDrawLoop: function() {
44
-    var self = this;
45
-    clearInterval(self.loopIntervalId); 
46
-    self.loopIntervalId = 0;            
47
-  },
48
-
49
-  //
50
-  run: function() {
51
-    var self = this;
52
-    self.drawUI();
53
-  },
54
-
55
-  //
56
-  configUI: function(id, w, h, c) {
57
-    var self = this;
58
-    self.canvas_id = id;
59
-    self.canvas = document.getElementById(id); 
60
-    self.ctx = self.canvas.getContext("2d");
61
-    self.canvas.width = w;
62
-    self.canvas.height = h;
63
-    self.canvas_bcol = c;
64
-  },
65
-
66
-  //
67
-  addUIObject: function(c) {
68
-    var self = this;
69
-    self.uiElems.push(c);
70
-  },
71
-
72
-  //
73
-  getUIElemByName: function(name) {
74
-    var self = this;
75
-    if (self.uiElems.length > 0) {
76
-      for (var i = 0; i < self.uiElems.length; i++)
77
- 	if (self.uiElems[i].name == name) return self.uiElems[i];
78
-    }
79
-    return undefined;
80
-  },
81
-
82
-  //
83
-  drawUI: function() {
84
-    var self = this;
85
-    self.clear();
86
-    self.drawUIBackground();
87
-    self.drawUIObjects();	
88
-  },
89
-
90
-  //
91
-  drawUIBackground: function() {
92
-    var self = this;
93
-    self.ctx.fillStyle = self.canvas_bcol;
94
-    self.ctx.fillRect(0, 0, self.canvas.width, self.canvas.height);
95
-  },
96
-  
97
-  //
98
-  drawUIObjects: function() {
99
-    var self = this;
100
-    if (self.uiElems.length > 0) {
101
-      for (var i = 0; i < self.uiElems.length; i++)
102
-	self.uiElems[i].draw(self.ctx);
103
-    }
104
-  },
105
-
106
-  //
107
-  clear: function() {
108
-    var self = this;
109
-    self.ctx.clearRect(0, 0, self.canvas.width, self.canvas.height); 
110
-  },
111
-
112
-    
113
-};
114
-

+ 0
- 51
client/js/keyboard/event_handler.js View File

@@ -1,51 +0,0 @@
1
-/**
2
- * @file event_handling.js
3
- * @autour frtk@tetalab
4
- */
5
-
6
-NPGClient.evtHandler = {
7
-
8
-  keysList: {
9
-    F1 : 112,
10
-    SPACE : 32,
11
-    ESC : 27,
12
-    ARROW_UP : 38,
13
-    ARROW_DOWN : 40,
14
-    ENTER : 13,
15
-    DELETE : 46,
16
-    BACKSPACE : 8,
17
-  },  
18
-    
19
-  keyState: {},
20
-  
21
-  //
22
-  init: function() {
23
-    var self = this;
24
-    //
25
-    self.keyState = {};
26
-    for (k in self.keyList) {
27
-      self.keyState[self.keysList[k]] = false;
28
-    }               
29
-    //
30
-    document.addEventListener('keydown',function(e) {
31
-      self.keyState[e.keyCode || e.which] = true;
32
-      self.onKeyDown(e);
33
-    }, true);
34
-    //
35
-    document.addEventListener('keyup',function(e){
36
-      self.keyState[e.keyCode || e.which] = false;
37
-    }, true);                       
38
-  },
39
-
40
-  // 
41
-  loginValidKey: function(k) {
42
-    return (key >= 48 && key <= 90);
43
-  },
44
-   
45
-  //
46
-  onKeyDown : function(evt) {
47
-    console.log(evt.keyCode); 
48
-  },
49
-
50
-
51
-}

+ 0
- 8
client/js/npg_client.js View File

@@ -1,8 +0,0 @@
1
-/**
2
- * @file NPGClient.js
3
- * @author frtk
4
- */
5
-
6
-var NPGClient = { 'version': '' };
7
-
8
-

+ 0
- 13
client/js/pages/login_page.js View File

@@ -1,13 +0,0 @@
1
-/**
2
- * @file login_page.js
3
- * @author frtk@tetalab
4
- */
5
-
6
-NPGClient.LoginPage = {
7
-
8
-    pageIdx: 0,
9
-    page: new NPGClient.AppPage('login'),
10
-    
11
-    
12
-}; 
13
-

+ 0
- 77
client/js/socket/SocketIO.js View File

@@ -1,77 +0,0 @@
1
-/**
2
- * @file SocketIO.js
3
- * @author frtk
4
- */
5
-
6
-NPGClient.SocketIO = { 
7
-
8
-  // Connection to server  
9
-  conn_nAttempts: 0,
10
-  conn_IntervalID: 0,
11
-  socket: {},
12
-  isConnected: false,
13
-
14
-  // start connection loop
15
-  initConnectLoop:  function() { 
16
-    var self = this;
17
-      console.log();  
18
-      self.startConnectLoop();
19
-  },
20
-  // start connection loop
21
-  startConnectLoop:  function() { 
22
-    var self = this;
23
-    self.conn_IntervalID = setInterval(function() { self.connect(); }, 1500); 
24
-  },
25
-  // stop connection loop
26
-  stopConnectLoop:  function() { 
27
-    var self =  this;
28
-    clearInterval(self.conn_IntervalID);
29
-    self.conn_IntervalID = 0;
30
-    self.conn_nAttempts = 0;
31
-  },
32
-  // connect socket
33
-  connect: function() {
34
-    var self = this;  
35
-    // check for connection
36
-    if (self.isConnected) {
37
-      return false;  
38
-    }
39
-    //
40
-    if (typeof io !== 'object') {
41
-      //console.log('[NPGClient.SocketIO] io object is unknown');
42
-    }
43
-    if ((typeof self.socket.socket === 'undefined')) {      
44
-      console.log('[NPGClient.SocketIO] attempting server connection...');
45
-      self.socket = io.connect();  
46
-      self.defineSocketMsgs();
47
-    } else if (!self.socket.socket.connected && !self.socket.socket.connecting) {
48
-      console.log('[NPGClient.SocketIO] attempting server connection...');
49
-      self.socket.socket.connect();   
50
-    }
51
-  },
52
-  // Define Socket Messages
53
-  defineSocketMsgs: function() {
54
-    var self = this;  
55
-    if (typeof self.socket === 'undefined') {
56
-      return false;
57
-    }
58
-    console.log('[NPGClient.SocketIO] deploying socket object features.');
59
-    // 'connecting' 
60
-    self.socket.on('connecting', function () {
61
-      console.log('[NPGClient.SocketIO] connecting ...');
62
-    });
63
-    // 'connect'
64
-    self.socket.on('connect', function() {
65
-      console.log('[NPGClient.SocketIO] connected to server');
66
-      self.stopConnectLoop();
67
-      self.isConnected = true;
68
-    });
69
-    // 'disconnect'
70
-    self.socket.on('disconnect', function() {
71
-      console.log('[NPGClient.SocketIO] > Server: socket disconnected.');
72
-      self.startConnectLoop();
73
-      self.isConnected = false;
74
-    });     
75
-  }
76
-  
77
-};

+ 0
- 77
client/js/socket/socketio_handler.js View File

@@ -1,77 +0,0 @@
1
-/**
2
- * @file SocketIO.js
3
- * @author frtk
4
- */
5
-
6
-NPGClient.SocketIO = { 
7
-
8
-  // Connection to server  
9
-  conn_nAttempts: 0,
10
-  conn_IntervalID: 0,
11
-  socket: {},
12
-  isConnected: false,
13
-
14
-  // start connection loop
15
-  initConnectLoop:  function() { 
16
-    var self = this;
17
-      console.log();  
18
-      self.startConnectLoop();
19
-  },
20
-  // start connection loop
21
-  startConnectLoop:  function() { 
22
-    var self = this;
23
-    self.conn_IntervalID = setInterval(function() { self.connect(); }, 1500); 
24
-  },
25
-  // stop connection loop
26
-  stopConnectLoop:  function() { 
27
-    var self =  this;
28
-    clearInterval(self.conn_IntervalID);
29
-    self.conn_IntervalID = 0;
30
-    self.conn_nAttempts = 0;
31
-  },
32
-  // connect socket
33
-  connect: function() {
34
-    var self = this;  
35
-    // check for connection
36
-    if (self.isConnected) {
37
-      return false;  
38
-    }
39
-    //
40
-    if (typeof io !== 'object') {
41
-      //console.log('[NPGClient.SocketIO] io object is unknown');
42
-    }
43
-    if ((typeof self.socket.socket === 'undefined')) {      
44
-      console.log('[NPGClient.SocketIO] attempting server connection...');
45
-      self.socket = io.connect();  
46
-      self.defineSocketMsgs();
47
-    } else if (!self.socket.socket.connected && !self.socket.socket.connecting) {
48
-      console.log('[NPGClient.SocketIO] attempting server connection...');
49
-      self.socket.socket.connect();   
50
-    }
51
-  },
52
-  // Define Socket Messages
53
-  defineSocketMsgs: function() {
54
-    var self = this;  
55
-    if (typeof self.socket === 'undefined') {
56
-      return false;
57
-    }
58
-    console.log('[NPGClient.SocketIO] deploying socket object features.');
59
-    // 'connecting' 
60
-    self.socket.on('connecting', function () {
61
-      console.log('[NPGClient.SocketIO] connecting ...');
62
-    });
63
-    // 'connect'
64
-    self.socket.on('connect', function() {
65
-      console.log('[NPGClient.SocketIO] connected to server');
66
-      self.stopConnectLoop();
67
-      self.isConnected = true;
68
-    });
69
-    // 'disconnect'
70
-    self.socket.on('disconnect', function() {
71
-      console.log('[NPGClient.SocketIO] > Server: socket disconnected.');
72
-      self.startConnectLoop();
73
-      self.isConnected = false;
74
-    });     
75
-  }
76
-  
77
-};

+ 0
- 4
client/src/jquery-2.1.3.min.js
File diff suppressed because it is too large
View File


+ 0
- 50
nodePong.js View File

@@ -1,50 +0,0 @@
1
-/**
2
- * @file nodePong.js
3
- * @author frtk
4
- */
5
-
6
-
7
-/*
8
- * nodejs modules
9
- */
10
-//--- 
11
-var fs = require('fs');
12
-var express = require('express');
13
-var http = require('http');
14
-//--- server app libs & params
15
-//var servP = require('./server/server_config.js');  
16
-var npg = require('./server/server_core.js');
17
-//--- nodePong config
18
-var cfg = require('./server/server_config.js');
19
-
20
-
21
-//
22
-npg.NPGServer.init(cfg.Config);
23
-
24
-
25
-/*
26
- * starting HTTP and socket.io services
27
- */
28
-//--- HTTP server
29
-npg.NPGServer.log("$ # starting http service on port " + npg.NPGServer.port);
30
-var app = express();
31
-var httpserv = http.createServer(app);
32
-httpserv.listen(npg.NPGServer.port);
33
-//--- allow access to static files from "/client" directory
34
-app.use(express.static(__dirname + '/client/'));
35
-
36
-//--- socket.io
37
-npg.NPGServer.log('$ # registering socket.io service on port ' + npg.NPGServer.port);  
38
-var io = require('socket.io').listen(httpserv, { log: true } );
39
-//-- setup server socket handling features
40
-npg.NPGServer.socketHandling(io);
41
-//
42
-npg.NPGServer.log('$ #####');
43
-
44
-
45
-
46
-/*
47
- * running nodePong server
48
- */
49
-//---
50
-

+ 0
- 23
node_modules/colors/LICENSE View File

@@ -1,23 +0,0 @@
1
-Original Library
2
-  - Copyright (c) Marak Squires
3
-
4
-Additional Functionality
5
- - Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
6
-
7
-Permission is hereby granted, free of charge, to any person obtaining a copy
8
-of this software and associated documentation files (the "Software"), to deal
9
-in the Software without restriction, including without limitation the rights
10
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
-copies of the Software, and to permit persons to whom the Software is
12
-furnished to do so, subject to the following conditions:
13
-
14
-The above copyright notice and this permission notice shall be included in
15
-all copies or substantial portions of the Software.
16
-
17
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
-THE SOFTWARE.

+ 0
- 178
node_modules/colors/ReadMe.md View File

@@ -1,178 +0,0 @@
1
-# colors.js [![Build Status](https://travis-ci.org/Marak/colors.js.svg?branch=master)](https://travis-ci.org/Marak/colors.js)
2
-
3
-## get color and style in your node.js console
4
-
5
-![Demo](https://raw.githubusercontent.com/Marak/colors.js/master/screenshots/colors.png)
6
-
7
-## Installation
8
-
9
-    npm install colors
10
-
11
-## colors and styles!
12
-
13
-### text colors
14
-
15
-  - black
16
-  - red
17
-  - green
18
-  - yellow
19
-  - blue
20
-  - magenta
21
-  - cyan
22
-  - white
23
-  - gray
24
-  - grey
25
-
26
-### background colors
27
-
28
-  - bgBlack
29
-  - bgRed
30
-  - bgGreen
31
-  - bgYellow
32
-  - bgBlue
33
-  - bgMagenta
34
-  - bgCyan
35
-  - bgWhite
36
-
37
-### styles
38
-
39
-  - reset
40
-  - bold
41
-  - dim
42
-  - italic
43
-  - underline
44
-  - inverse
45
-  - hidden
46
-  - strikethrough
47
-
48
-### extras
49
-
50
-  - rainbow
51
-  - zebra
52
-  - america
53
-  - trap
54
-  - random
55
-
56
-
57
-## Usage
58
-
59
-By popular demand, `colors` now ships with two types of usages!
60
-
61
-The super nifty way
62
-
63
-```js
64
-var colors = require('colors');
65
-
66
-console.log('hello'.green); // outputs green text
67
-console.log('i like cake and pies'.underline.red) // outputs red underlined text
68
-console.log('inverse the color'.inverse); // inverses the color
69
-console.log('OMG Rainbows!'.rainbow); // rainbow
70
-console.log('Run the trap'.trap); // Drops the bass
71
-
72
-```
73
-
74
-or a slightly less nifty way which doesn't extend `String.prototype`
75
-
76
-```js
77
-var colors = require('colors/safe');
78
-
79
-console.log(colors.green('hello')); // outputs green text
80
-console.log(colors.red.underline('i like cake and pies')) // outputs red underlined text
81
-console.log(colors.inverse('inverse the color')); // inverses the color
82
-console.log(colors.rainbow('OMG Rainbows!')); // rainbow
83
-console.log(colors.trap('Run the trap')); // Drops the bass
84
-
85
-```
86
-
87
-I prefer the first way. Some people seem to be afraid of extending `String.prototype` and prefer the second way. 
88
-
89
-If you are writing good code you will never have an issue with the first approach. If you really don't want to touch `String.prototype`, the second usage will not touch `String` native object.
90
-
91
-## Disabling Colors
92
-
93
-To disable colors you can pass the following arguments in the command line to your application:
94
-
95
-```bash
96
-node myapp.js --no-color
97
-```
98
-
99
-## Console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data)
100
-
101
-```js
102
-var name = 'Marak';
103
-console.log(colors.green('Hello %s'), name);
104
-// outputs -> 'Hello Marak'
105
-```
106
-
107
-## Custom themes
108
-
109
-### Using standard API
110
-
111
-```js
112
-
113
-var colors = require('colors');
114
-
115
-colors.setTheme({
116
-  silly: 'rainbow',
117
-  input: 'grey',
118
-  verbose: 'cyan',
119
-  prompt: 'grey',
120
-  info: 'green',
121
-  data: 'grey',
122
-  help: 'cyan',
123
-  warn: 'yellow',
124
-  debug: 'blue',
125
-  error: 'red'
126
-});
127
-
128
-// outputs red text
129
-console.log("this is an error".error);
130
-
131
-// outputs yellow text
132
-console.log("this is a warning".warn);
133
-```
134
-
135
-### Using string safe API
136
-
137
-```js
138
-var colors = require('colors/safe');
139
-
140
-// set single property
141
-var error = colors.red;
142
-error('this is red');
143
-
144
-// set theme
145
-colors.setTheme({
146
-  silly: 'rainbow',
147
-  input: 'grey',
148
-  verbose: 'cyan',
149
-  prompt: 'grey',
150
-  info: 'green',
151
-  data: 'grey',
152
-  help: 'cyan',
153
-  warn: 'yellow',
154
-  debug: 'blue',
155
-  error: 'red'
156
-});
157
-
158
-// outputs red text
159
-console.log(colors.error("this is an error"));
160
-
161
-// outputs yellow text
162
-console.log(colors.warn("this is a warning"));
163
-
164
-```
165
-
166
-You can also combine them:
167
-
168
-```javascript
169
-var colors = require('colors');
170
-
171
-colors.setTheme({
172
-  custom: ['red', 'underline']
173
-});
174
-
175
-console.log('test'.custom);
176
-```
177
-
178
-*Protip: There is a secret undocumented style in `colors`. If you find the style you can summon him.*

+ 0
- 74
node_modules/colors/examples/normal-usage.js View File

@@ -1,74 +0,0 @@
1
-var colors = require('../lib/index');
2
-
3
-console.log("First some yellow text".yellow);
4
-
5
-console.log("Underline that text".yellow.underline);
6
-
7
-console.log("Make it bold and red".red.bold);
8
-
9
-console.log(("Double Raindows All Day Long").rainbow)
10
-
11
-console.log("Drop the bass".trap)
12
-
13
-console.log("DROP THE RAINBOW BASS".trap.rainbow)
14
-
15
-
16
-console.log('Chains are also cool.'.bold.italic.underline.red); // styles not widely supported
17
-
18
-console.log('So '.green + 'are'.underline + ' ' + 'inverse'.inverse + ' styles! '.yellow.bold); // styles not widely supported
19
-console.log("Zebras are so fun!".zebra);
20
-
21
-//
22
-// Remark: .strikethrough may not work with Mac OS Terminal App
23
-//
24
-console.log("This is " + "not".strikethrough + " fun.");
25
-
26
-console.log('Background color attack!'.black.bgWhite)
27
-console.log('Use random styles on everything!'.random)
28
-console.log('America, Heck Yeah!'.america)
29
-
30
-
31
-console.log('Setting themes is useful')
32
-
33
-//
34
-// Custom themes
35
-//
36
-console.log('Generic logging theme as JSON'.green.bold.underline);
37
-// Load theme with JSON literal
38
-colors.setTheme({
39
-  silly: 'rainbow',
40
-  input: 'grey',
41
-  verbose: 'cyan',
42
-  prompt: 'grey',
43
-  info: 'green',
44
-  data: 'grey',
45
-  help: 'cyan',
46
-  warn: 'yellow',
47
-  debug: 'blue',
48
-  error: 'red'
49
-});
50
-
51
-// outputs red text
52
-console.log("this is an error".error);
53
-
54
-// outputs yellow text
55
-console.log("this is a warning".warn);
56
-
57
-// outputs grey text
58
-console.log("this is an input".input);
59
-
60
-console.log('Generic logging theme as file'.green.bold.underline);
61
-
62
-// Load a theme from file
63
-colors.setTheme(__dirname + '/../themes/generic-logging.js');
64
-
65
-// outputs red text
66
-console.log("this is an error".error);
67
-
68
-// outputs yellow text
69
-console.log("this is a warning".warn);
70
-
71
-// outputs grey text
72
-console.log("this is an input".input);
73
-
74
-//console.log("Don't summon".zalgo)

+ 0
- 76
node_modules/colors/examples/safe-string.js View File

@@ -1,76 +0,0 @@
1
-var colors = require('../safe');
2
-
3
-console.log(colors.yellow("First some yellow text"));
4
-
5
-console.log(colors.yellow.underline("Underline that text"));
6
-
7
-console.log(colors.red.bold("Make it bold and red"));
8
-
9
-console.log(colors.rainbow("Double Raindows All Day Long"))
10
-
11
-console.log(colors.trap("Drop the bass"))
12
-
13
-console.log(colors.rainbow(colors.trap("DROP THE RAINBOW BASS")));
14
-
15
-console.log(colors.bold.italic.underline.red('Chains are also cool.')); // styles not widely supported
16
-
17
-
18
-console.log(colors.green('So ') + colors.underline('are') + ' ' + colors.inverse('inverse') + colors.yellow.bold(' styles! ')); // styles not widely supported
19
-
20
-console.log(colors.zebra("Zebras are so fun!"));
21
-
22
-console.log("This is " + colors.strikethrough("not") + " fun.");
23
-
24
-
25
-console.log(colors.black.bgWhite('Background color attack!'));
26
-console.log(colors.random('Use random styles on everything!'))
27
-console.log(colors.america('America, Heck Yeah!'));
28
-
29
-console.log('Setting themes is useful')
30
-
31
-//
32
-// Custom themes
33
-//
34
-//console.log('Generic logging theme as JSON'.green.bold.underline);
35
-// Load theme with JSON literal
36
-colors.setTheme({
37
-  silly: 'rainbow',
38
-  input: 'grey',
39
-  verbose: 'cyan',
40
-  prompt: 'grey',
41
-  info: 'green',
42
-  data: 'grey',
43
-  help: 'cyan',
44
-  warn: 'yellow',
45
-  debug: 'blue',
46
-  error: 'red'
47
-});
48
-
49
-// outputs red text
50
-console.log(colors.error("this is an error"));
51
-
52
-// outputs yellow text
53
-console.log(colors.warn("this is a warning"));
54
-
55
-// outputs grey text
56
-console.log(colors.input("this is an input"));
57
-
58
-
59
-// console.log('Generic logging theme as file'.green.bold.underline);
60
-
61
-// Load a theme from file
62
-colors.setTheme(__dirname + '/../themes/generic-logging.js');
63
-
64
-// outputs red text
65
-console.log(colors.error("this is an error"));
66
-
67
-// outputs yellow text
68
-console.log(colors.warn("this is a warning"));
69
-
70
-// outputs grey text
71
-console.log(colors.input("this is an input"));
72
-
73
-// console.log(colors.zalgo("Don't summon him"))
74
-
75
-
76
-

+ 0
- 187
node_modules/colors/lib/colors.js View File

@@ -1,187 +0,0 @@
1
-/*
2
-
3
-The MIT License (MIT)
4
-
5
-Original Library 
6
-  - Copyright (c) Marak Squires
7
-
8
-Additional functionality
9
- - Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
10
-
11
-Permission is hereby granted, free of charge, to any person obtaining a copy
12
-of this software and associated documentation files (the "Software"), to deal
13
-in the Software without restriction, including without limitation the rights
14
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
-copies of the Software, and to permit persons to whom the Software is
16
-furnished to do so, subject to the following conditions:
17
-
18
-The above copyright notice and this permission notice shall be included in
19
-all copies or substantial portions of the Software.
20
-
21
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27
-THE SOFTWARE.
28
-
29
-*/
30
-
31
-var colors = {};
32
-module['exports'] = colors;
33
-
34
-colors.themes = {};
35
-
36
-var ansiStyles = colors.styles = require('./styles');
37
-var defineProps = Object.defineProperties;
38
-
39
-colors.supportsColor = require('./system/supports-colors');
40
-
41
-if (typeof colors.enabled === "undefined") {
42
-  colors.enabled = colors.supportsColor;
43
-}
44
-
45
-colors.stripColors = colors.strip = function(str){
46
-  return ("" + str).replace(/\x1B\[\d+m/g, '');
47
-};
48
-
49
-
50
-var stylize = colors.stylize = function stylize (str, style) {
51
-  if (!colors.enabled) {
52
-    return str+'';
53
-  }
54
-
55
-  return ansiStyles[style].open + str + ansiStyles[style].close;
56
-}
57
-
58
-var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
59
-var escapeStringRegexp = function (str) {
60
-  if (typeof str !== 'string') {
61
-    throw new TypeError('Expected a string');
62
-  }
63
-  return str.replace(matchOperatorsRe,  '\\$&');
64
-}
65
-
66
-function build(_styles) {
67
-  var builder = function builder() {
68
-    return applyStyle.apply(builder, arguments);
69
-  };
70
-  builder._styles = _styles;
71
-  // __proto__ is used because we must return a function, but there is
72
-  // no way to create a function with a different prototype.
73
-  builder.__proto__ = proto;
74
-  return builder;
75
-}
76
-
77
-var styles = (function () {
78
-  var ret = {};
79
-  ansiStyles.grey = ansiStyles.gray;
80
-  Object.keys(ansiStyles).forEach(function (key) {
81
-    ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
82
-    ret[key] = {
83
-      get: function () {
84
-        return build(this._styles.concat(key));
85
-      }
86
-    };
87
-  });
88
-  return ret;
89
-})();
90
-
91
-var proto = defineProps(function colors() {}, styles);
92
-
93
-function applyStyle() {
94
-  var args = arguments;
95
-  var argsLen = args.length;
96
-  var str = argsLen !== 0 && String(arguments[0]);
97
-  if (argsLen > 1) {
98
-    for (var a = 1; a < argsLen; a++) {
99
-      str += ' ' + args[a];
100
-    }
101
-  }
102
-
103
-  if (!colors.enabled || !str) {
104
-    return str;
105
-  }
106
-
107
-  var nestedStyles = this._styles;
108
-
109
-  var i = nestedStyles.length;
110
-  while (i--) {
111
-    var code = ansiStyles[nestedStyles[i]];
112
-    str = code.open + str.replace(code.closeRe, code.open) + code.close;
113
-  }
114
-
115
-  return str;
116
-}
117
-
118
-function applyTheme (theme) {
119
-  for (var style in theme) {
120
-    (function(style){
121
-      colors[style] = function(str){
122
-        if (typeof theme[style] === 'object'){
123
-          var out = str;
124
-          for (var i in theme[style]){
125
-            out = colors[theme[style][i]](out);
126
-          }
127
-          return out;
128
-        }
129
-        return colors[theme[style]](str);
130
-      };
131
-    })(style)
132
-  }
133
-}
134
-
135
-colors.setTheme = function (theme) {
136
-  if (typeof theme === 'string') {
137
-    try {
138
-      colors.themes[theme] = require(theme);
139
-      applyTheme(colors.themes[theme]);
140
-      return colors.themes[theme];
141
-    } catch (err) {
142
-      console.log(err);
143
-      return err;
144
-    }
145
-  } else {
146
-    applyTheme(theme);
147
-  }
148
-};
149
-
150
-function init() {
151
-  var ret = {};
152
-  Object.keys(styles).forEach(function (name) {
153
-    ret[name] = {
154
-      get: function () {
155
-        return build([name]);
156
-      }
157
-    };
158
-  });
159
-  return ret;
160
-}
161
-
162
-var sequencer = function sequencer (map, str) {
163
-  var exploded = str.split(""), i = 0;
164
-  exploded = exploded.map(map);
165
-  return exploded.join("");
166
-};
167
-
168
-// custom formatter methods
169
-colors.trap = require('./custom/trap');
170
-colors.zalgo = require('./custom/zalgo');
171
-
172
-// maps
173
-colors.maps = {};
174
-colors.maps.america = require('./maps/america');
175
-colors.maps.zebra = require('./maps/zebra');
176
-colors.maps.rainbow = require('./maps/rainbow');
177
-colors.maps.random = require('./maps/random')
178
-
179
-for (var map in colors.maps) {
180
-  (function(map){
181
-    colors[map] = function (str) {
182
-      return sequencer(colors.maps[map], str);
183
-    }
184
-  })(map)
185
-}
186
-
187
-defineProps(colors, init());

+ 0
- 45
node_modules/colors/lib/custom/trap.js View File

@@ -1,45 +0,0 @@
1
-module['exports'] = function runTheTrap (text, options) {
2
-  var result = "";
3
-  text = text || "Run the trap, drop the bass";
4
-  text = text.split('');
5
-  var trap = {
6
-    a: ["\u0040", "\u0104", "\u023a", "\u0245", "\u0394", "\u039b", "\u0414"],
7
-    b: ["\u00df", "\u0181", "\u0243", "\u026e", "\u03b2", "\u0e3f"],
8
-    c: ["\u00a9", "\u023b", "\u03fe"],
9
-    d: ["\u00d0", "\u018a", "\u0500" , "\u0501" ,"\u0502", "\u0503"],
10
-    e: ["\u00cb", "\u0115", "\u018e", "\u0258", "\u03a3", "\u03be", "\u04bc", "\u0a6c"],
11
-    f: ["\u04fa"],
12
-    g: ["\u0262"],
13
-    h: ["\u0126", "\u0195", "\u04a2", "\u04ba", "\u04c7", "\u050a"],
14
-    i: ["\u0f0f"],
15
-    j: ["\u0134"],
16
-    k: ["\u0138", "\u04a0", "\u04c3", "\u051e"],
17
-    l: ["\u0139"],
18
-    m: ["\u028d", "\u04cd", "\u04ce", "\u0520", "\u0521", "\u0d69"],
19
-    n: ["\u00d1", "\u014b", "\u019d", "\u0376", "\u03a0", "\u048a"],
20
-    o: ["\u00d8", "\u00f5", "\u00f8", "\u01fe", "\u0298", "\u047a", "\u05dd", "\u06dd", "\u0e4f"],
21
-    p: ["\u01f7", "\u048e"],
22
-    q: ["\u09cd"],
23
-    r: ["\u00ae", "\u01a6", "\u0210", "\u024c", "\u0280", "\u042f"],
24
-    s: ["\u00a7", "\u03de", "\u03df", "\u03e8"],
25
-    t: ["\u0141", "\u0166", "\u0373"],
26
-    u: ["\u01b1", "\u054d"],
27
-    v: ["\u05d8"],
28
-    w: ["\u0428", "\u0460", "\u047c", "\u0d70"],
29
-    x: ["\u04b2", "\u04fe", "\u04fc", "\u04fd"],
30
-    y: ["\u00a5", "\u04b0", "\u04cb"],
31
-    z: ["\u01b5", "\u0240"]
32
-  }
33
-  text.forEach(function(c){
34
-    c = c.toLowerCase();
35
-    var chars = trap[c] || [" "];
36
-    var rand = Math.floor(Math.random() * chars.length);
37
-    if (typeof trap[c] !== "undefined") {
38
-      result += trap[c][rand];
39
-    } else {
40
-      result += c;
41
-    }
42
-  });
43
-  return result;
44
-
45
-}

+ 0
- 104
node_modules/colors/lib/custom/zalgo.js View File

@@ -1,104 +0,0 @@
1
-// please no
2
-module['exports'] = function zalgo(text, options) {
3
-  text = text || "   he is here   ";
4
-  var soul = {
5
-    "up" : [
6
-      '̍', '̎', '̄', '̅',
7
-      '̿', '̑', '̆', '̐',
8
-      '͒', '͗', '͑', '̇',
9
-      '̈', '̊', '͂', '̓',
10
-      '̈', '͊', '͋', '͌',
11
-      '̃', '̂', '̌', '͐',
12
-      '̀', '́', '̋', '̏',
13
-      '̒', '̓', '̔', '̽',
14
-      '̉', 'ͣ', 'ͤ', 'ͥ',
15
-      'ͦ', 'ͧ', 'ͨ', 'ͩ',
16
-      'ͪ', 'ͫ', 'ͬ', 'ͭ',
17
-      'ͮ', 'ͯ', '̾', '͛',
18
-      '͆', '̚'
19
-    ],
20
-    "down" : [
21
-      '̖', '̗', '̘', '̙',
22
-      '̜', '̝', '̞', '̟',
23
-      '̠', '̤', '̥', '̦',
24
-      '̩', '̪', '̫', '̬',
25
-      '̭', '̮', '̯', '̰',
26
-      '̱', '̲', '̳', '̹',
27
-      '̺', '̻', '̼', 'ͅ',
28
-      '͇', '͈', '͉', '͍',
29
-      '͎', '͓', '͔', '͕',
30
-      '͖', '͙', '͚', '̣'
31
-    ],
32
-    "mid" : [
33
-      '̕', '̛', '̀', '́',
34
-      '͘', '̡', '̢', '̧',
35
-      '̨', '̴', '̵', '̶',
36
-      '͜', '͝', '͞',
37
-      '͟', '͠', '͢', '̸',
38
-      '̷', '͡', ' ҉'
39
-    ]
40
-  },
41
-  all = [].concat(soul.up, soul.down, soul.mid),
42
-  zalgo = {};
43
-
44
-  function randomNumber(range) {
45
-    var r = Math.floor(Math.random() * range);
46
-    return r;
47
-  }
48
-
49
-  function is_char(character) {
50
-    var bool = false;
51
-    all.filter(function (i) {
52
-      bool = (i === character);
53
-    });
54
-    return bool;
55
-  }
56
-  
57
-
58
-  function heComes(text, options) {
59
-    var result = '', counts, l;
60
-    options = options || {};
61
-    options["up"] =   typeof options["up"]   !== 'undefined' ? options["up"]   : true;
62
-    options["mid"] =  typeof options["mid"]  !== 'undefined' ? options["mid"]  : true;
63
-    options["down"] = typeof options["down"] !== 'undefined' ? options["down"] : true;
64
-    options["size"] = typeof options["size"] !== 'undefined' ? options["size"] : "maxi";
65
-    text = text.split('');
66
-    for (l in text) {
67
-      if (is_char(l)) {
68
-        continue;
69
-      }
70
-      result = result + text[l];
71
-      counts = {"up" : 0, "down" : 0, "mid" : 0};
72
-      switch (options.size) {
73
-      case 'mini':
74
-        counts.up = randomNumber(8);
75
-        counts.mid = randomNumber(2);
76
-        counts.down = randomNumber(8);
77
-        break;
78
-      case 'maxi':
79
-        counts.up = randomNumber(16) + 3;
80
-        counts.mid = randomNumber(4) + 1;
81
-        counts.down = randomNumber(64) + 3;
82
-        break;
83
-      default:
84
-        counts.up = randomNumber(8) + 1;
85
-        counts.mid = randomNumber(6) / 2;
86
-        counts.down = randomNumber(8) + 1;
87
-        break;
88
-      }
89
-
90
-      var arr = ["up", "mid", "down"];
91
-      for (var d in arr) {
92
-        var index = arr[d];
93
-        for (var i = 0 ; i <= counts[index]; i++) {
94
-          if (options[index]) {
95
-            result = result + soul[index][randomNumber(soul[index].length)];
96
-          }
97
-        }
98
-      }
99
-    }
100
-    return result;
101
-  }
102
-  // don't summon him
103
-  return heComes(text, options);
104
-}

+ 0
- 113
node_modules/colors/lib/extendStringPrototype.js View File

@@ -1,113 +0,0 @@
1
-var colors = require('./colors');
2
-
3
-module['exports'] = function () {
4
-
5
-  //
6
-  // Extends prototype of native string object to allow for "foo".red syntax
7
-  //
8
-  var addProperty = function (color, func) {
9
-    String.prototype.__defineGetter__(color, func);
10
-  };
11
-
12
-  var sequencer = function sequencer (map, str) {
13
-      return function () {
14
-        var exploded = this.split(""), i = 0;
15
-        exploded = exploded.map(map);
16
-        return exploded.join("");
17
-      }
18
-  };
19
-
20
-  addProperty('strip', function () {
21
-    return colors.strip(this);
22
-  });
23
-
24
-  addProperty('stripColors', function () {
25
-    return colors.strip(this);
26
-  });
27
-
28
-  addProperty("trap", function(){
29
-    return colors.trap(this);
30
-  });
31
-
32
-  addProperty("zalgo", function(){
33
-    return colors.zalgo(this);
34
-  });
35
-
36
-  addProperty("zebra", function(){
37
-    return colors.zebra(this);
38
-  });
39
-
40
-  addProperty("rainbow", function(){
41
-    return colors.rainbow(this);
42
-  });
43
-
44
-  addProperty("random", function(){
45
-    return colors.random(this);
46
-  });
47
-
48
-  addProperty("america", function(){
49
-    return colors.america(this);
50
-  });
51
-
52
-  //
53
-  // Iterate through all default styles and colors
54
-  //
55
-  var x = Object.keys(colors.styles);
56
-  x.forEach(function (style) {
57
-    addProperty(style, function () {
58
-      return colors.stylize(this, style);
59
-    });
60
-  });
61
-
62
-  function applyTheme(theme) {
63
-    //
64
-    // Remark: This is a list of methods that exist
65
-    // on String that you should not overwrite.
66
-    //
67
-    var stringPrototypeBlacklist = [
68
-      '__defineGetter__', '__defineSetter__', '__lookupGetter__', '__lookupSetter__', 'charAt', 'constructor',
69
-      'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf', 'charCodeAt',
70
-      'indexOf', 'lastIndexof', 'length', 'localeCompare', 'match', 'replace', 'search', 'slice', 'split', 'substring',
71
-      'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toUpperCase', 'trim', 'trimLeft', 'trimRight'
72
-    ];
73
-
74
-    Object.keys(theme).forEach(function (prop) {
75
-      if (stringPrototypeBlacklist.indexOf(prop) !== -1) {
76
-        console.log('warn: '.red + ('String.prototype' + prop).magenta + ' is probably something you don\'t want to override. Ignoring style name');
77
-      }
78
-      else {
79
-        if (typeof(theme[prop]) === 'string') {
80
-          colors[prop] = colors[theme[prop]];
81
-          addProperty(prop, function () {
82
-            return colors[theme[prop]](this);
83
-          });
84
-        }
85
-        else {
86
-          addProperty(prop, function () {
87
-            var ret = this;
88
-            for (var t = 0; t < theme[prop].length; t++) {
89
-              ret = colors[theme[prop][t]](ret);
90
-            }
91
-            return ret;
92
-          });
93
-        }
94
-      }
95
-    });
96
-  }
97
-
98
-  colors.setTheme = function (theme) {
99
-    if (typeof theme === 'string') {
100
-      try {
101
-        colors.themes[theme] = require(theme);
102
-        applyTheme(colors.themes[theme]);
103
-        return colors.themes[theme];
104
-      } catch (err) {
105
-        console.log(err);
106
-        return err;
107
-      }
108
-    } else {
109
-      applyTheme(theme);
110
-    }
111
-  };
112
-
113
-};

+ 0
- 12
node_modules/colors/lib/index.js View File

@@ -1,12 +0,0 @@
1
-var colors = require('./colors');
2
-module['exports'] = colors;
3
-
4
-// Remark: By default, colors will add style properties to String.prototype
5
-//
6
-// If you don't wish to extend String.prototype you can do this instead and native String will not be touched
7
-//
8
-//   var colors = require('colors/safe);
9
-//   colors.red("foo")
10
-//
11
-//
12
-require('./extendStringPrototype')();

+ 0
- 12
node_modules/colors/lib/maps/america.js View File

@@ -1,12 +0,0 @@
1
-var colors = require('../colors');
2
-
3
-module['exports'] = (function() {
4
-  return function (letter, i, exploded) {
5
-    if(letter === " ") return letter;
6
-    switch(i%3) {
7
-      case 0: return colors.red(letter);
8
-      case 1: return colors.white(letter)
9
-      case 2: return colors.blue(letter)
10
-    }
11
-  }
12
-})();

+ 0
- 13
node_modules/colors/lib/maps/rainbow.js View File

@@ -1,13 +0,0 @@
1
-var colors = require('../colors');
2
-
3
-module['exports'] = (function () {
4
-  var rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta']; //RoY G BiV
5
-  return function (letter, i, exploded) {
6
-    if (letter === " ") {
7
-      return letter;
8
-    } else {
9
-      return colors[rainbowColors[i++ % rainbowColors.length]](letter);
10
-    }
11
-  };
12
-})();
13
-

+ 0
- 8
node_modules/colors/lib/maps/random.js View File

@@ -1,8 +0,0 @@
1
-var colors = require('../colors');
2
-
3
-module['exports'] = (function () {
4
-  var available = ['underline', 'inverse', 'grey', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta'];
5
-  return function(letter, i, exploded) {
6
-    return letter === " " ? letter : colors[available[Math.round(Math.random() * (available.length - 1))]](letter);
7
-  };
8
-})();

+ 0
- 5
node_modules/colors/lib/maps/zebra.js View File

@@ -1,5 +0,0 @@
1
-var colors = require('../colors');
2
-
3
-module['exports'] = function (letter, i, exploded) {
4
-  return i % 2 === 0 ? letter : colors.inverse(letter);
5
-};

+ 0
- 77
node_modules/colors/lib/styles.js View File

@@ -1,77 +0,0 @@
1
-/*
2
-The MIT License (MIT)
3
-
4
-Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
5
-
6
-Permission is hereby granted, free of charge, to any person obtaining a copy
7
-of this software and associated documentation files (the "Software"), to deal
8
-in the Software without restriction, including without limitation the rights
9
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
-copies of the Software, and to permit persons to whom the Software is
11
-furnished to do so, subject to the following conditions:
12
-
13
-The above copyright notice and this permission notice shall be included in
14
-all copies or substantial portions of the Software.
15
-
16
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
-THE SOFTWARE.
23
-
24
-*/
25
-
26
-var styles = {};
27
-module['exports'] = styles;
28
-
29
-var codes = {
30
-  reset: [0, 0],
31
-
32
-  bold: [1, 22],
33
-  dim: [2, 22],
34
-  italic: [3, 23],
35
-  underline: [4, 24],
36
-  inverse: [7, 27],
37
-  hidden: [8, 28],
38
-  strikethrough: [9, 29],
39
-
40
-  black: [30, 39],
41
-  red: [31, 39],
42
-  green: [32, 39],
43
-  yellow: [33, 39],
44
-  blue: [34, 39],
45
-  magenta: [35, 39],
46
-  cyan: [36, 39],
47
-  white: [37, 39],
48
-  gray: [90, 39],
49
-  grey: [90, 39],
50
-
51
-  bgBlack: [40, 49],
52
-  bgRed: [41, 49],
53
-  bgGreen: [42, 49],
54
-  bgYellow: [43, 49],
55
-  bgBlue: [44, 49],
56
-  bgMagenta: [45, 49],
57
-  bgCyan: [46, 49],
58
-  bgWhite: [47, 49],
59
-
60
-  // legacy styles for colors pre v1.0.0
61
-  blackBG: [40, 49],
62
-  redBG: [41, 49],
63
-  greenBG: [42, 49],
64
-  yellowBG: [43, 49],
65
-  blueBG: [44, 49],
66
-  magentaBG: [45, 49],
67
-  cyanBG: [46, 49],
68
-  whiteBG: [47, 49]
69
-
70
-};
71
-
72
-Object.keys(codes).forEach(function (key) {
73
-  var val = codes[key];
74
-  var style = styles[key] = [];
75
-  style.open = '\u001b[' + val[0] + 'm';
76
-  style.close = '\u001b[' + val[1] + 'm';
77
-});

+ 0
- 61
node_modules/colors/lib/system/supports-colors.js View File

@@ -1,61 +0,0 @@
1
-/*
2
-The MIT License (MIT)
3
-
4
-Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
5
-
6
-Permission is hereby granted, free of charge, to any person obtaining a copy
7
-of this software and associated documentation files (the "Software"), to deal
8
-in the Software without restriction, including without limitation the rights
9
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
-copies of the Software, and to permit persons to whom the Software is
11
-furnished to do so, subject to the following conditions:
12
-
13
-The above copyright notice and this permission notice shall be included in
14
-all copies or substantial portions of the Software.
15
-
16
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
-THE SOFTWARE.
23
-
24
-*/
25
-
26
-var argv = process.argv;
27
-
28
-module.exports = (function () {
29
-  if (argv.indexOf('--no-color') !== -1 ||
30
-    argv.indexOf('--color=false') !== -1) {
31
-    return false;
32
-  }
33
-
34
-  if (argv.indexOf('--color') !== -1 ||
35
-    argv.indexOf('--color=true') !== -1 ||
36
-    argv.indexOf('--color=always') !== -1) {
37
-    return true;
38
-  }
39
-
40
-  if (process.stdout && !process.stdout.isTTY) {
41
-    return false;
42
-  }
43
-
44
-  if (process.platform === 'win32') {
45
-    return true;
46
-  }
47
-
48
-  if ('COLORTERM' in process.env) {
49
-    return true;
50
-  }
51
-
52
-  if (process.env.TERM === 'dumb') {
53
-    return false;
54
-  }
55
-
56
-  if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) {
57
-    return true;
58
-  }
59
-
60
-  return false;
61
-})();

+ 0
- 58
node_modules/colors/package.json View File

@@ -1,58 +0,0 @@
1
-{
2
-  "name": "colors",
3
-  "description": "get colors in your node.js console",
4
-  "version": "1.1.2",
5
-  "author": {
6
-    "name": "Marak Squires"
7
-  },
8
-  "homepage": "https://github.com/Marak/colors.js",
9
-  "bugs": {
10
-    "url": "https://github.com/Marak/colors.js/issues"
11
-  },
12
-  "keywords": [
13
-    "ansi",
14
-    "terminal",
15
-    "colors"
16
-  ],
17
-  "repository": {
18
-    "type": "git",
19
-    "url": "http://github.com/Marak/colors.js.git"
20
-  },
21
-  "license": "MIT",
22
-  "scripts": {
23
-    "test": "node tests/basic-test.js && node tests/safe-test.js"
24
-  },
25
-  "engines": {
26
-    "node": ">=0.1.90"
27
-  },
28
-  "main": "lib",
29
-  "files": [
30
-    "examples",
31
-    "lib",
32
-    "LICENSE",
33
-    "safe.js",
34
-    "themes"
35
-  ],
36
-  "gitHead": "8bf2ad9fa695dcb30b7e9fd83691b139fd6655c4",
37
-  "_id": "colors@1.1.2",
38
-  "_shasum": "168a4701756b6a7f51a12ce0c97bfa28c084ed63",
39
-  "_from": "colors@",
40
-  "_npmVersion": "2.1.8",
41
-  "_nodeVersion": "0.11.13",
42
-  "_npmUser": {
43
-    "name": "marak",
44
-    "email": "marak.squires@gmail.com"
45
-  },
46
-  "maintainers": [
47
-    {
48
-      "name": "marak",
49
-      "email": "marak.squires@gmail.com"
50
-    }
51
-  ],
52
-  "dist": {
53
-    "shasum": "168a4701756b6a7f51a12ce0c97bfa28c084ed63",
54
-    "tarball": "http://registry.npmjs.org/colors/-/colors-1.1.2.tgz"
55
-  },
56
-  "directories": {},
57
-  "_resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz"
58
-}

+ 0
- 9
node_modules/colors/safe.js View File

@@ -1,9 +0,0 @@
1
-//
2
-// Remark: Requiring this file will use the "safe" colors API which will not touch String.prototype
3
-//
4
-//   var colors = require('colors/safe);
5
-//   colors.red("foo")
6
-//
7
-//
8
-var colors = require('./lib/colors');
9
-module['exports'] = colors;

+ 0
- 12
node_modules/colors/themes/generic-logging.js View File

@@ -1,12 +0,0 @@
1
-module['exports'] = {
2
-  silly: 'rainbow',
3
-  input: 'grey',
4
-  verbose: 'cyan',
5
-  prompt: 'grey',
6
-  info: 'green',
7
-  data: 'grey',
8
-  help: 'cyan',
9
-  warn: 'yellow',
10
-  debug: 'blue',
11
-  error: 'red'
12
-};

+ 0
- 23
server/server_config.js View File

@@ -1,23 +0,0 @@
1
-/**
2
- * @file server_config.js
3
- * @author frtk
4
- */
5
-
6
-var Config = {
7
-  VERSION : '0.0.8',
8
-  HTTP: {
9
-    host: '127.0.0.1',
10
-    port: 8042
11
-  },
12
-}
13
-
14
-
15
-
16
-/**
17
- *
18
- * EXPORTS
19
- *
20
- */
21
-if (typeof exports !== "undefined") {
22
-  exports.Config = Config;
23
-}

+ 0
- 141
server/server_core.js View File

@@ -1,141 +0,0 @@
1
-/**
2
- * @file server_core.js
3
- * @author frtk                                                                                 
4
- */
5
-
6
-
7
-
8
-/**
9
- *
10
- * nodePong Server Object
11
- *
12
- */
13
-var NPGServer = {
14
-  
15
-  /*
16
-   * Data 
17
-   */
18
-  // app
19
-  version: '',
20
-  host: '',
21
-  port: 0,
22
-
23
-  // Users and Games
24
-  users: [],
25
-  games: [],
26
-
27
-
28
-  /*
29
-   *
30
-   */
31
-  //--- init()
32
-  init: function(o) {
33
-    var self = this;
34
-    self.version = o.VERSION || '';  
35
-    self.host = o.HTTP.host || ''; 
36
-    self.port = o.HTTP.port || 8042;  
37
-    self.log('$ ##### nodePong - v'+self.version);  
38
-  },
39
-
40
-
41
-  //--- setVersion(s)
42
-  setVersion: function(s) {
43
-    this.version = s;
44
-  },
45
-
46
-
47
-  /*
48
-   * Server Messages
49
-   */ 
50
-  //--- 
51
-  log: function(msg) {
52
-    var self = this;
53
-    return console.log(self.newDateToString() + msg);
54
-  },
55
-  //--- dateToString
56
-  dateToString: function(date) {
57
-    var self = this;
58
-    return '[' + self.addZero(date.getHours(), 'h') + ':' 
59
-               + self.addZero(date.getMinutes(), 'm') + ':' 
60
-               + self.addZero(date.getSeconds(), 's') + ':' 
61
-               + self.addZero(date.getMilliseconds(), 'ms') + ']';
62
-  },
63
-  //--- addZero
64
-  addZero: function(value, type) {
65
-    switch(type) {
66
-      case 'h':
67
-      case 'm':
68
-      case 's':
69
-        if (value < 10) value = '0' + value;
70
-          break;
71
-      case 'ms':
72
-        if (value < 10) value = '00' + value;
73
-        else if (value >= 10 && value < 100) value = '0' + value;
74
-        break;
75
-      default:
76
-        break;                  
77
-    };
78
-    return value;
79
-  },
80
-  //--- return new date string
81
-  newDateToString: function() {
82
-    var self = this;  
83
-    return self.dateToString(new Date());
84
-  },
85
-
86
-
87
-   
88
-  /*
89
-   * Socket.io handling
90
-   */ 
91
-  //--- 
92
-  socketHandling: function(io) {
93
-    var self = this;
94
-    io.sockets.on('connection', function (socket) {
95
-      //
96
-      self.log('$ User connected : id=' + socket.id);
97
-
98
-      // 'disconnect'
99
-      socket.on('disconnect', function () {                                                                                 self.log('$ User disconnected : id=' + socket.id);                                                         
100
-      });
101
-
102
-      //  
103
-    });
104
-  },
105
-
106
-
107
-};
108
-
109
-
110
-
111
-/**
112
- *
113
- * nodePong User Object
114
- *
115
- */
116
-var User = function(name) {
117
-};
118
-
119
-
120
-
121
-/**
122
- *
123
- * nodePong Game Object
124
- *
125
- */
126
-var Game = function() {
127
-};
128
-
129
-
130
-
131
-
132
-/**
133
- *
134
- * EXPORT
135
- *
136
- */
137
-if (typeof exports !== "undefined") {
138
-  exports.NPGServer = NPGServer;
139
-  exports.User = User;
140
-  exports.Game = Game;
141
-}

Loading…
Cancel
Save