-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
51 changed files
with
11,874 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities. | ||
version: v1.7.0 | ||
ignore: {} | ||
# patches apply the minimum changes required to fix a vulnerability | ||
patch: | ||
'npm:ms:20170412': | ||
- compression > debug > ms: | ||
patched: '2017-05-23T01:35:11.139Z' | ||
- mongoose > ms: | ||
patched: '2017-05-23T01:35:11.139Z' | ||
- mongo-throttle > mongoose > ms: | ||
patched: '2017-05-23T01:35:11.139Z' | ||
- express-status-monitor > socket.io > engine.io > debug > ms: | ||
patched: '2017-05-23T01:35:11.139Z' | ||
- socket.io > socket.io-adapter > debug > ms: | ||
patched: '2017-05-23T01:35:11.139Z' | ||
- express-status-monitor > socket.io > socket.io-adapter > debug > ms: | ||
patched: '2017-05-23T01:35:11.139Z' | ||
- socket.io > socket.io-client > debug > ms: | ||
patched: '2017-05-23T01:35:11.139Z' | ||
- express-status-monitor > socket.io > socket.io-client > debug > ms: | ||
patched: '2017-05-23T01:35:11.139Z' | ||
- express-status-monitor > socket.io > debug > ms: | ||
patched: '2017-05-23T01:35:11.139Z' | ||
- express-status-monitor > socket.io > socket.io-client > engine.io-client > debug > ms: | ||
patched: '2017-05-23T01:35:11.139Z' | ||
- buildreq > mongoose > ms: | ||
patched: '2017-05-23T01:35:11.139Z' | ||
- morgan > debug > ms: | ||
patched: '2017-05-23T01:35:11.139Z' | ||
- buildreq > compression > debug > ms: | ||
patched: '2017-05-23T01:35:11.139Z' | ||
- buildreq > helmet > connect > debug > ms: | ||
patched: '2017-05-23T01:35:11.139Z' | ||
- buildreq > helmet > connect > finalhandler > debug > ms: | ||
patched: '2017-05-23T01:35:11.139Z' | ||
- mongoose > mquery > debug > ms: | ||
patched: '2017-05-23T01:35:11.139Z' | ||
- mongo-throttle > mongoose > mquery > debug > ms: | ||
patched: '2017-05-23T01:35:11.139Z' | ||
- buildreq > mongoose > mquery > debug > ms: | ||
patched: '2017-05-23T01:35:11.139Z' | ||
- express-status-monitor > socket.io > socket.io-parser > debug > ms: | ||
patched: '2017-05-23T01:35:11.139Z' | ||
- socket.io > socket.io-adapter > socket.io-parser > debug > ms: | ||
patched: '2017-05-23T01:35:11.139Z' | ||
- express-status-monitor > socket.io > socket.io-adapter > socket.io-parser > debug > ms: | ||
patched: '2017-05-23T01:35:11.139Z' | ||
- express-status-monitor > socket.io > socket.io-client > socket.io-parser > debug > ms: | ||
patched: '2017-05-23T01:35:11.139Z' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
;(function () { | ||
'use strict' | ||
|
||
angular | ||
.module('app.chat', []) | ||
.controller('ChatController', ChatController) | ||
|
||
ChatController.$inject = ['$http', '$stateParams', 'logger', '$location', 'UserFactory', 'MeanSocket'] | ||
/* @ngInject */ | ||
function ChatController ($http, $stateParams, logger, $location, UserFactory, MeanSocket) { | ||
var vm = this | ||
vm.title = 'chat' | ||
vm.chat = {} | ||
vm.UserFactory = UserFactory | ||
activate() | ||
|
||
vm.messages = [] | ||
MeanSocket.on('message', function (msg) { | ||
var message = _.clone(msg) | ||
message.date = Date.now() | ||
vm.messages.unshift(message) | ||
}) | ||
vm.chat = function () { | ||
if (!vm.message) return | ||
MeanSocket.emit('message', { | ||
message: vm.message, | ||
user: vm.UserFactory.user.profile.name || 'Unknown' | ||
}) | ||
vm.message = '' | ||
} | ||
|
||
function activate () { | ||
logger.info('Activated Chat View') | ||
} | ||
} | ||
})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
;(function () { | ||
'use strict' | ||
angular.module('app.chat', ['app.core']) | ||
})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
;(function () { | ||
'use strict' | ||
|
||
angular | ||
.module('app.chat') | ||
.run(appRun) | ||
|
||
appRun.$inject = ['routerHelper'] | ||
/* @ngInject */ | ||
function appRun (routerHelper) { | ||
routerHelper.configureStates(getStates()) | ||
} | ||
|
||
function getStates () { | ||
return [ | ||
{ | ||
state: 'chat', | ||
config: { | ||
url: '/chat', | ||
templateUrl: 'modules/chat/chat.view.html', | ||
controller: 'ChatController', | ||
controllerAs: 'vm' | ||
} | ||
} | ||
] | ||
} | ||
})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<div class="container" ng-init="vm.list()"> | ||
<div class="row"> | ||
<div class="col-sm-12 chat-header text-center"> | ||
<h1 class="chat-title">MeanStackJS Chatroom</h1> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="input-group"> | ||
<input ng-model="vm.message" ng-enter="vm.chat()" type="text" class="form-control" placeholder="Enter Message Here..."> | ||
<span class="input-group-btn"> | ||
<button ng-click="vm.chat()" class="btn btn-primary" type="button">Send</button> | ||
</span> | ||
</div> | ||
<p ng-repeat="chat in vm.messages| limitTo:10">{{chat.message}} - by {{chat.user}} on {{chat.date|date:'medium'}}</p> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
;(function () { | ||
'use strict' | ||
|
||
angular | ||
.module('app.core') | ||
.factory('$localStorage', localStorage) | ||
|
||
localStorage.$inject = ['$window'] | ||
|
||
function localStorage ($window) { | ||
return { | ||
set: function (key, value) { | ||
$window.localStorage[key] = value | ||
}, | ||
get: function (key, defaultValue) { | ||
return $window.localStorage[key] || false | ||
}, | ||
setObject: function (key, value) { | ||
$window.localStorage[key] = JSON.stringify(value) | ||
}, | ||
getObject: function (key) { | ||
if ($window.localStorage[key] !== undefined) { | ||
return JSON.parse($window.localStorage[key] || false) | ||
} | ||
return false | ||
}, | ||
remove: function (key) { | ||
$window.localStorage.removeItem(key) | ||
}, | ||
clear: function () { | ||
$window.localStorage.clear() | ||
} | ||
} | ||
} | ||
}()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
var <%= name %> = require('./<%= name %>.controller.js') | ||
|
||
module.exports = function (io, socket) { | ||
// Socket | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -651,7 +651,6 @@ function ask () { | |
break | ||
case 'Exit': | ||
process.exit() | ||
break | ||
} | ||
}) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
var <%= name %> = require('./<%= name %>.controller.js') | ||
|
||
module.exports = function (io, socket) { | ||
socket.on('<%= name %>', <%= name %>.on<%= Name %>(io, socket)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.