/// <reference path="../../../Scripts/underscore.js" /> /// <reference path="../../common/utils/enums.js" /> /// <reference path="../nav-bar-util.js" /> // AppNavBarController controller for the navigation bar of the application. This controller is responsible for // manage the different types of the tabs and corresponding menus. frameworkModule.controller('AppMessageBoxController', ['$scope', '$log', function ($scope, $log) { 'use strict'; $log.debug('AppNavController.ctor()...'); var mlist = []; $scope.size = 0; var addMessage = function (Title, Message, Content, CssClass) { mlist.push({ message: Message , title: Title ,content: Content , cssClass: CssClass }); $scope.messageList = mlist; $scope.size = mlist.length; }; // Just test code (function initialize() { // Reference the auto-generated proxy for the hub. var chat = $.connection.messageBoxHub; // Create a function that the hub can call back to display messages. chat.client.addNewMessageToPage = function (title, message, cssClass) { //Add the message to the page. var content = message; if(message.length > 20){ message = message.substring(0, 19) + '...'; cssClass += ' cursorpointer'; } $('.cursorpointer').popover({ placement: "right", container: 'body' }); addMessage(title, message, content, cssClass); $scope.$apply(); }; $.connection.hub.start().done(function () { // Call the Send method on the hub. chat.server.send('hello', 'test Info', 'alert-info'); }); })(); } ]);