This commit is contained in:
Michael 2017-04-17 08:54:18 -04:00
parent a9b8092732
commit fd59deeac1
4 changed files with 19 additions and 16 deletions

Binary file not shown.

View file

@ -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" />

View file

@ -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>

View file

@ -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)