diff --git a/bower.json b/bower.json index 4243631..92cd565 100755 --- a/bower.json +++ b/bower.json @@ -15,7 +15,6 @@ "angular-resource": ">=1.2.*", "angular-sanitize": ">=1.2.*", "angular-smilies": "~1.2.0", - "angular-socket-io": "~0.6.0", "angular-ui-router": "~0.2.10", "angulartics": "~0.18.0", "bootstrap": "~3.3.5", @@ -41,7 +40,10 @@ "zeroclipboard": "~2.2.0", "ng-clip": "~0.2.6", "satellizer": "~0.13.3", - "ngInfiniteScroll": "1.2.1" + "ngInfiniteScroll": "1.2.1", + "angular-socket-io": "^0.7.0", + "socket.io-client": "^1.4.6", + "angular-toastr": "^1.7.0" }, "devDependencies": { "angular-mocks": ">=1.2.*", diff --git a/client/app/app.js b/client/app/app.js index b34b411..4fdbf16 100755 --- a/client/app/app.js +++ b/client/app/app.js @@ -19,6 +19,7 @@ angular.module('dssWebApp', [ 'angular-jwt', 'angular-smilies', 'satellizer', + 'toastr', 'angulartics.google.analytics' ]) .config(function ($stateProvider, $sceDelegateProvider, $httpProvider, $urlRouterProvider, $locationProvider, $provide, $authProvider, @@ -85,12 +86,11 @@ angular.module('dssWebApp', [ $rootScope.isPlaying = false; $rootScope.setCurrentUser = function (user) { - console.log('Current user', user); $rootScope.currentUser = user; }; $rootScope.connectSockets = function () { - SocketService.connectSocket(Session.getSession()); - SocketService.registerHandler('site:broadcast', function (data) { + //SocketService.connectSocket(Session.getSession()); + SocketService.on('socket:site:broadcast', function (data) { console.log(data); $.notify({ message: data, diff --git a/client/app/app.less b/client/app/app.less index 26620c6..61773ca 100755 --- a/client/app/app.less +++ b/client/app/app.less @@ -4,6 +4,7 @@ @fa-font-path: '/bower_components/font-awesome/fonts'; // injector +@import 'components/chatbar/chatbar.less'; @import 'components/comments/comments.less'; @import 'components/footer/footer.less'; @import 'components/messagepopup/messagepopup.less'; @@ -24,61 +25,83 @@ // endinjector #page-content { - min-height: 894px; + min-height: 894px; } .list-nostyle { - list-style: none outside none; - margin: 0; + list-style: none outside none; + margin: 0; } .list-horiz li { - float: left; - list-style-type: none; - position: relative; - padding-right: 20px; + float: left; + list-style-type: none; + position: relative; + padding-right: 20px; } .truncate { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; } .non-url-button { - cursor: default; + cursor: default; } .chat-talk { - padding-top: 5px; + padding-top: 5px; } .slimScrollDiv { - padding-left: 5px; - padding-right: 5px; + padding-left: 5px; + padding-right: 5px; } .sidebar-alt-visible-lg #sidebar-alt { - width: 300px !important; + width: 300px !important; } .sidebar-alt-visible-lg #main-container { - margin-right: 300px !important; + margin-right: 300px !important; } .sidebar-alt-visible-lg.header-fixed-top header.navbar-fixed-top, .sidebar-alt-visible-lg.header-fixed-bottom header.navbar-fixed-bottom, .sidebar-alt-visible-lg.footer-fixed #main-container #page-content + footer { - right: 300px !important; + right: 300px !important; } .sidebar-content { - width: 100% !important; + width: 100% !important; } -.search-result-image{ - width: 32px; - height: 32px; +.search-result-image { + width: 32px; + height: 32px; } + .fa-1-3x { - font-size: 1.3em; + font-size: 1.3em; +} + +/* +.select2-choices { + position: relative; +} +.ui-select-multiple input.ui-select-search { + width: 100% !important; + position: absolute; +} +*/ +.override-text-align { + text-align: left !important; +} + +h6.description { + font-weight: bold; + letter-spacing: 2px; + color: #999; + border-bottom: 1px solid rgba(0, 0, 0, 0.1); + padding-bottom: 5px; } \ No newline at end of file diff --git a/client/app/components/chatbar/chatbar.controller.js b/client/app/components/chatbar/chatbar.controller.js index 2f19a13..b43d27f 100755 --- a/client/app/components/chatbar/chatbar.controller.js +++ b/client/app/components/chatbar/chatbar.controller.js @@ -1,16 +1,17 @@ 'use strict'; angular.module('dssWebApp') - .controller('ChatbarCtrl', function ($scope, $rootScope, $http, SocketService, SERVER_CONFIG, AUTH_EVENTS) { + .controller('ChatbarCtrl', function ($scope, $rootScope, $http, SocketService, SERVER_CONFIG, AUTH_EVENTS, toastr) { console.log('ChatbarCtrl', $scope); $scope.messages = []; $scope.chatMessage = ''; function _registerChatHandler() { console.log('Registering chat handler'); - SocketService.registerHandler('chat', function (message) { + SocketService.on('chat', function (message) { var data = JSON.parse(message); console.log("Received chat message: " + data); + toastr.success(data); $scope.$apply(function () { $scope.messages.push(data); $scope.chatMessage = ''; @@ -28,7 +29,7 @@ angular.module('dssWebApp') $scope.postMessage = function () { $http.post(SERVER_CONFIG.apiUrl + '/_chat/', { - user: 'Someone', + user: '2', message: $scope.chatMessage }); }; diff --git a/client/app/components/chatbar/chatbar.html b/client/app/components/chatbar/chatbar.html index 58e09e9..da61260 100644 --- a/client/app/components/chatbar/chatbar.html +++ b/client/app/components/chatbar/chatbar.html @@ -1,48 +1,84 @@ -