summaryrefslogtreecommitdiff
path: root/Project-Unite/Views/Shared/_Layout.cshtml
diff options
context:
space:
mode:
Diffstat (limited to 'Project-Unite/Views/Shared/_Layout.cshtml')
-rw-r--r--Project-Unite/Views/Shared/_Layout.cshtml18
1 files changed, 17 insertions, 1 deletions
diff --git a/Project-Unite/Views/Shared/_Layout.cshtml b/Project-Unite/Views/Shared/_Layout.cshtml
index 1e28411..bb3ea5e 100644
--- a/Project-Unite/Views/Shared/_Layout.cshtml
+++ b/Project-Unite/Views/Shared/_Layout.cshtml
@@ -22,7 +22,7 @@
@Styles.Render("~/Content/bootstrap-theme.css")
@Styles.Render("~/Content/Site.css")
<link rel="stylesheet" href="https://cdn.rawgit.com/xcatliu/simplemde-theme-dark/master/dist/simplemde-theme-dark.min.css" />
-
+ @Scripts.Render("~/signalr/hubs")
@Scripts.Render("~/Scripts/simplemde.js")
@Scripts.Render("~/bundles/modernizr")
</head>
@@ -238,6 +238,22 @@
<script type="text/javascript">
var mde = new SimpleMDE({forceSync: true});
mde.options.forceSync();
+
+ var notificationHub = $.connection.notificationHub;
+
+ $.connection.hub.start(function () {
+ notificationHub.activate(function (response) {
+ $("#notifications_body")
+ .find('ul')
+ .append($("<li></li>").html(response));
+ $.ajax({
+ url: "/API/GetNotificationCount",
+ success: function (result) {
+ $("#notification_count").html(result);
+ }
+ });
+ });
+ });
</script>
</body>