summaryrefslogtreecommitdiff
path: root/Project-Unite/Views/Shared
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-04-17 08:30:58 -0400
committerMichael <[email protected]>2017-04-17 08:30:58 -0400
commita9b8092732e2012ffadc552052e2e070cbf380e4 (patch)
tree73be56bcba46bddc04bd728e932d438912276d1a /Project-Unite/Views/Shared
parentc018558559b5454210d301ba693a046a07ea4cae (diff)
downloadproject-unite-a9b8092732e2012ffadc552052e2e070cbf380e4.tar.gz
project-unite-a9b8092732e2012ffadc552052e2e070cbf380e4.tar.bz2
project-unite-a9b8092732e2012ffadc552052e2e070cbf380e4.zip
SignalR notifications
Diffstat (limited to 'Project-Unite/Views/Shared')
-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>