summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-04-17 08:54:18 -0400
committerMichael <[email protected]>2017-04-17 08:54:18 -0400
commitfd59deeac1ed3da76591a9ca372a7ae46d51e6c8 (patch)
tree78eeea159b8d73522c72e48917cd574ba2c9b9f0
parenta9b8092732e2012ffadc552052e2e070cbf380e4 (diff)
downloadproject-unite-fd59deeac1ed3da76591a9ca372a7ae46d51e6c8.tar.gz
project-unite-fd59deeac1ed3da76591a9ca372a7ae46d51e6c8.tar.bz2
project-unite-fd59deeac1ed3da76591a9ca372a7ae46d51e6c8.zip
test
-rw-r--r--Project-Unite/Content/infobox.wavbin0 -> 22256 bytes
-rw-r--r--Project-Unite/Project-Unite.csproj1
-rw-r--r--Project-Unite/Views/Shared/_Layout.cshtml32
-rw-r--r--Project-Unite/Views/Shared/_LoginPartial.cshtml2
4 files changed, 19 insertions, 16 deletions
diff --git a/Project-Unite/Content/infobox.wav b/Project-Unite/Content/infobox.wav
new file mode 100644
index 0000000..3c6f3f2
--- /dev/null
+++ b/Project-Unite/Content/infobox.wav
Binary files differ
diff --git a/Project-Unite/Project-Unite.csproj b/Project-Unite/Project-Unite.csproj
index 1064307..63c1206 100644
--- a/Project-Unite/Project-Unite.csproj
+++ b/Project-Unite/Project-Unite.csproj
@@ -456,6 +456,7 @@
<Content Include="Content\bootstrap-theme.css" />
<Content Include="Content\bootstrap.css" />
<Content Include="Content\bootstrap.min.css" />
+ <Content Include="Content\infobox.wav" />
<Content Include="Content\simplemde.css" />
<Content Include="favicon.ico" />
<Content Include="fonts\glyphicons-halflings-regular.svg" />
diff --git a/Project-Unite/Views/Shared/_Layout.cshtml b/Project-Unite/Views/Shared/_Layout.cshtml
index bb3ea5e..8b84017 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>
@@ -234,25 +234,27 @@
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap")
+ <script src="Scripts/jquery.signalR-2.2.2-preview1.min.js"></script>
+ <script src="signalr/hubs"></script>
@RenderSection("scripts", required: false)
<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);
- }
- });
+ var notificationHubProxy = $.connection.notificationHub;
+ notificationHubProxy.client.sendMessage = function (message) {
+ $("#notifications_body").find("ul").append("<li></li>").html(message);
+ $.ajax({
+ url : "/API/GetNotificationCount",
+ success : function(result){
+ $("#notification_count").html(result);
+ }
});
+ var audio = new Audio("/Content/infobox.wav");
+ audio.play();
+ };
+ $.connection.hub.start()
+ .done(function(){ console.log('Now connected, connection ID=' + $.connection.hub.id); })
+ .fail(function(){ console.log('Could not Connect!'); });
});
</script>
diff --git a/Project-Unite/Views/Shared/_LoginPartial.cshtml b/Project-Unite/Views/Shared/_LoginPartial.cshtml
index 7c1bfb3..d1ba671 100644
--- a/Project-Unite/Views/Shared/_LoginPartial.cshtml
+++ b/Project-Unite/Views/Shared/_LoginPartial.cshtml
@@ -11,7 +11,7 @@
<ul class="nav navbar-nav navbar-right" style="margin-right:15px;">
<li>@Html.NewestUser()</li>
<li><a href="@Url.Action("ViewUnread", "Forum")"><span class="glyphicon glyphicon-star-empty"></span> @ACL.UnreadPostsCount(User.Identity.Name) unread posts</a></li>
- <li class="dropdown"><a href="#" data-toggle="dropdown" class="dropdown-toggle"><span class="glyphicon glyphicon-bullhorn"></span> @Html.NotificationCount(User.Identity.GetUserId())</a>
+ <li id="notification_body" class="dropdown"><a href="#" data-toggle="dropdown" class="dropdown-toggle"><span class="glyphicon glyphicon-bullhorn"></span> <strong id="notification_count">@Html.NotificationCount(User.Identity.GetUserId())</strong></a>
<ul class="dropdown-menu">
<li class="dropdown-header">Notifications (@Html.NotificationCount(User.Identity.Name) unread)</li>
@Html.GetLatestUnread(User.Identity.Name)