mirror of
https://github.com/Threnklyn/MinecraftChat.git
synced 2026-05-19 12:53:27 +02:00
25 lines
438 B
JavaScript
25 lines
438 B
JavaScript
/**
|
|
* Connect Controller
|
|
*/
|
|
|
|
module.exports = function($scope, socket) {
|
|
|
|
$scope.chat = '';
|
|
|
|
if (window.location.hostname === 'chat.alexkvazos.com') {
|
|
socket.emit('chat', { message: 'Connected via web chat client / chat.alexkvazos.me.' });
|
|
}
|
|
|
|
$scope.send = function() {
|
|
if ($scope.chat.trim().length > 0) {
|
|
|
|
socket.emit('chat', {
|
|
message: $scope.chat.trim()
|
|
});
|
|
$scope.chat = '';
|
|
|
|
}
|
|
};
|
|
|
|
};
|