From 27349d8cd0c528c540bb6a0ae237f99315f91fdf Mon Sep 17 00:00:00 2001 From: sharadit47 Date: Tue, 18 Aug 2015 23:51:21 +0530 Subject: [PATCH 1/2] Multiple windows --- IMChatApp/App_Start/BundleConfig.cs | 5 + IMChatApp/ChatScripts/Directives.js | 65 +++++ IMChatApp/ChatScripts/Factories.js | 130 +++++----- IMChatApp/ChatScripts/Template.js | 38 +++ IMChatApp/Content/Site.css | 305 ++++++++++++++++++++++++ IMChatApp/Content/sample/fb.html | 18 ++ IMChatApp/Content/sample/popup.html | 287 ++++++++++++++++++++++ IMChatApp/Controllers/HomeController.cs | 5 +- IMChatApp/Global.asax.cs | 23 +- IMChatApp/Hubs/ChatHub.cs | 47 ++-- IMChatApp/IMChatApp.csproj | 58 +++++ IMChatApp/Models/ChatModels.cs | 63 ++++- IMChatApp/Scripts/_references.js | Bin 1000 -> 2106 bytes IMChatApp/Startup.cs | 9 + IMChatApp/Views/Home/Index.cshtml | 2 +- IMChatApp/Web.config | 18 +- 16 files changed, 989 insertions(+), 84 deletions(-) create mode 100644 IMChatApp/ChatScripts/Directives.js create mode 100644 IMChatApp/ChatScripts/Template.js create mode 100644 IMChatApp/Content/sample/fb.html create mode 100644 IMChatApp/Content/sample/popup.html diff --git a/IMChatApp/App_Start/BundleConfig.cs b/IMChatApp/App_Start/BundleConfig.cs index 7b14045..2076617 100644 --- a/IMChatApp/App_Start/BundleConfig.cs +++ b/IMChatApp/App_Start/BundleConfig.cs @@ -10,6 +10,11 @@ public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new ScriptBundle("~/bundles/jquery").Include( "~/Scripts/jquery-{version}.js")); + + + + bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( + "~/Scripts/jquery.validate*")); // Use the development version of Modernizr to develop with and learn from. Then, when you're // ready for production, use the build tool at http://modernizr.com to pick only the tests you need. bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( diff --git a/IMChatApp/ChatScripts/Directives.js b/IMChatApp/ChatScripts/Directives.js new file mode 100644 index 0000000..fc59767 --- /dev/null +++ b/IMChatApp/ChatScripts/Directives.js @@ -0,0 +1,65 @@ +(function () { + 'use strict' + //if (app != undefined) { + app.directive("addbuttonsbutton", function () { + return { + restrict: "E", + template: "" + } + }); + + //Directive for adding buttons on click that show an alert on click + app.directive("addbuttons", function ($compile) { + return function (scope, element, attrs) { + element.bind("click", function () { + scope.count++; + + var elementE = ''; + // document.getElementsByTagName("body")[0].innerHTML = document.getElementsByTagName("body")[0].innerHTML + element; + //console.log(elementE); + //$compile(elementE)($scope); + //angular.element("#ChatRoomsContainer").append(elementE); + angular.element(document.getElementById('ChatRoomsContainer')).append($compile(elementE)(scope)); + }); + }; + }); + +// +// angular.module("exampleApp", []) +//.directive("unorderedList", function () { +// return { +// link: function (scope, element, attrs) { +// var data = scope[attrs["unorderedList"] || attrs["listSource"]]; +// var propertyExpression = attrs["listProperty"] || "price | currency"; +// if (angular.isArray(data)) { +// var listElem = angular.element("