-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#137138341 Game group chat feature #32
base: development
Are you sure you want to change the base?
Conversation
@@ -66,5 +66,7 @@ console.log(' Express app started on port ' + port); | |||
|
|||
// Initializing logger | |||
logger.init(app, passport, mongoose); | |||
// expose ap | |||
|
|||
//expose app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected space or tab after '//' in comment spaced-comment
public/js/controllers/game.js
Outdated
@@ -147,6 +152,12 @@ angular.module('mean.system') | |||
return game.curQuestion.numAnswers > 1 && $scope.pickedCards[0] === card.id; | |||
}; | |||
|
|||
$scope.isPlayer = function($index) { | |||
$window.sessionStorage.setItem('Username', game.players[game.playerIndex].username); | |||
$window.sessionStorage.setItem('Avatar', game.players[game.playerIndex].avatar); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strings must use doublequote quotes
public/js/controllers/game.js
Outdated
@@ -147,6 +152,12 @@ angular.module('mean.system') | |||
return game.curQuestion.numAnswers > 1 && $scope.pickedCards[0] === card.id; | |||
}; | |||
|
|||
$scope.isPlayer = function($index) { | |||
$window.sessionStorage.setItem('Username', game.players[game.playerIndex].username); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strings must use doublequote quotes
public/js/controllers/game.js
Outdated
@@ -147,6 +152,12 @@ angular.module('mean.system') | |||
return game.curQuestion.numAnswers > 1 && $scope.pickedCards[0] === card.id; | |||
}; | |||
|
|||
$scope.isPlayer = function($index) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space before function parentheses space-before-function-paren
public/js/controllers/game.js
Outdated
var makeAWishFacts = MakeAWishFactsService.getMakeAWishFacts(); | ||
$scope.makeAWishFact = makeAWishFacts.pop(); | ||
|
||
$scope.pickCard = function (card) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 2 spaces but found 4 indent
public/js/controllers/game.js
Outdated
$scope.hasPickedCards = false; | ||
$scope.winningCardPicked = false; | ||
$scope.showTable = false; | ||
$scope.modalShown = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 2 spaces but found 4 indent
public/js/controllers/game.js
Outdated
.controller('GameController', ['$scope', 'game', '$timeout', '$http', '$location', 'MakeAWishFactsService', '$dialog', '$window', function ($scope, game, $timeout, $http, $location, MakeAWishFactsService, $dialog, $window) { | ||
$scope.hasPickedCards = false; | ||
$scope.winningCardPicked = false; | ||
$scope.showTable = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 2 spaces but found 4 indent
public/js/controllers/game.js
Outdated
} else if (game.curQuestion.numAnswers === 2 && | ||
.controller('GameController', ['$scope', 'game', '$timeout', '$http', '$location', 'MakeAWishFactsService', '$dialog', '$window', function ($scope, game, $timeout, $http, $location, MakeAWishFactsService, $dialog, $window) { | ||
$scope.hasPickedCards = false; | ||
$scope.winningCardPicked = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 2 spaces but found 4 indent
public/js/controllers/game.js
Outdated
$scope.hasPickedCards = true; | ||
} else if (game.curQuestion.numAnswers === 2 && | ||
.controller('GameController', ['$scope', 'game', '$timeout', '$http', '$location', 'MakeAWishFactsService', '$dialog', '$window', function ($scope, game, $timeout, $http, $location, MakeAWishFactsService, $dialog, $window) { | ||
$scope.hasPickedCards = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 2 spaces but found 4 indent
public/js/controllers/game.js
Outdated
$scope.sendPickedCards(); | ||
$scope.hasPickedCards = true; | ||
} else if (game.curQuestion.numAnswers === 2 && | ||
.controller('GameController', ['$scope', 'game', '$timeout', '$http', '$location', 'MakeAWishFactsService', '$dialog', '$window', function ($scope, game, $timeout, $http, $location, MakeAWishFactsService, $dialog, $window) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 2 exceeds the maximum line length of 160 max-len
Strings must use doublequote quotes
var msgElement = document.createElement('div'); | ||
|
||
msgElement.className = 'msg'; | ||
$('#results').append(msgAvatarElement).append(msgUsernameElement).append(msgTextElement); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strings must use doublequote quotes
|
||
var msgElement = document.createElement('div'); | ||
|
||
msgElement.className = 'msg'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strings must use doublequote quotes
// msgTextElement.append(`${msgUsernameElement.text()}: `); | ||
msgTextElement.append(msg.text); | ||
|
||
var msgElement = document.createElement('div'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strings must use doublequote quotes
msgAvatarElement.attr('src', msg.avatar); | ||
var msgUsernameElement = $('<b />'); | ||
msgUsernameElement.html(msg.username); | ||
var msgTextElement = $('<p />'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strings must use doublequote quotes
var msg = snapshot.val(); | ||
var msgAvatarElement = $("<img />"); | ||
msgAvatarElement.attr('src', msg.avatar); | ||
var msgUsernameElement = $('<b />'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strings must use doublequote quotes
var msgAvatar = avatarInput; | ||
var msgText = textInput.value; | ||
// replace myFirebase.set(...); with the next line | ||
database.ref('msg').push({ avatar: msgAvatar, username: msgUser, text: msgText }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strings must use doublequote quotes
const gameID = sessionStorage.getItem('gameID'); | ||
const usernameInput = sessionStorage.getItem('Username'); | ||
const avatarInput = sessionStorage.getItem('Avatar'); | ||
const textInput = document.querySelector('#text'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strings must use doublequote quotes
const database = firebase.database(); | ||
const gameID = sessionStorage.getItem('gameID'); | ||
const usernameInput = sessionStorage.getItem('Username'); | ||
const avatarInput = sessionStorage.getItem('Avatar'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strings must use doublequote quotes
$('#post').on('click', function () { | ||
const database = firebase.database(); | ||
const gameID = sessionStorage.getItem('gameID'); | ||
const usernameInput = sessionStorage.getItem('Username'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strings must use doublequote quotes
link: function(scope, elem, attr) { | ||
$('#post').on('click', function () { | ||
const database = firebase.database(); | ||
const gameID = sessionStorage.getItem('gameID'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strings must use doublequote quotes
What does this PR do?
Implementation of group chat feature
Description of Task to be completed?
Allow users in a game to chat with one another
How should this be manually tested?
N/A
Any background context you want to provide?
N/A
What are the relevant pivotal tracker stories?
Users should be able to chat with the group while they are in a game.
As a registered user in a game I want to be able to chat with the other players so that I can communicate with other players and have a more enjoyable experience using the app.
Screenshots (if appropriate)
Questions:
N/A