mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-21 05:43:19 -07:00
All Sln changes
This commit is contained in:
parent
b5855f2644
commit
796f0fc188
615 changed files with 68 additions and 747 deletions
101
Ombi.UI/Views/Shared/Partial/_LayoutScripts.cshtml
Normal file
101
Ombi.UI/Views/Shared/Partial/_LayoutScripts.cshtml
Normal file
|
@ -0,0 +1,101 @@
|
|||
@using Nancy.Security
|
||||
@using Nancy.Session
|
||||
@using Ombi.UI.Helpers
|
||||
@using PlexRequests.UI.Resources
|
||||
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<dynamic>
|
||||
<script>
|
||||
var urlBase = '@Html.GetBaseUrl()';
|
||||
|
||||
$(function () {
|
||||
|
||||
// Check for update
|
||||
var url = createBaseUrl(urlBase, '/layout');
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response.updateAvailable) {
|
||||
var status = createBaseUrl(urlBase, '/admin/status');
|
||||
$('#updateAvailable').html("<i class='fa fa-cloud-download' aria-hidden='true'></i> @UI.Layout_UpdateAvailablePart1 <a style='color: white' href='" + status + "'>@UI.Layout_UpdateAvailablePart2</a>");
|
||||
$('#updateAvailable').removeAttr("hidden");
|
||||
//$('body').addClass('update-available');
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
}
|
||||
});
|
||||
// End Check for update
|
||||
|
||||
checkCacheInProgress();
|
||||
|
||||
// Scroller
|
||||
$(document).on('scroll', function () {
|
||||
|
||||
if ($(window).scrollTop() > 100) {
|
||||
$('.scroll-top-wrapper').addClass('show');
|
||||
} else {
|
||||
$('.scroll-top-wrapper').removeClass('show');
|
||||
}
|
||||
});
|
||||
|
||||
$('.scroll-top-wrapper').on('click', scrollToTop);
|
||||
// End Scroller
|
||||
|
||||
// Get Issue count
|
||||
var issueUrl = createBaseUrl(urlBase, '/issues/issuecount');
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: issueUrl,
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response) {
|
||||
if (response > 0)
|
||||
$('#issueCount').addClass("badge");
|
||||
$('#issueCount').html(+response);
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
}
|
||||
});
|
||||
// End issue count
|
||||
|
||||
|
||||
|
||||
|
||||
$('#donate').click(function () {
|
||||
ga('send', 'event', 'Navbar', 'Donate', 'Donate Clicked');
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
function scrollToTop() {
|
||||
verticalOffset = typeof (verticalOffset) != 'undefined' ? verticalOffset : 0;
|
||||
element = $('body');
|
||||
offset = element.offset();
|
||||
offsetTop = offset.top;
|
||||
$('html, body').animate({ scrollTop: offsetTop }, 500, 'linear');
|
||||
}
|
||||
|
||||
function checkCacheInProgress() {
|
||||
|
||||
var url = createBaseUrl(urlBase, '/layout/cacher');
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response.currentlyRunning) {
|
||||
$('#cacherRunning').html("@UI.Layout_CacherRunning");
|
||||
$('#cacherRunning').removeAttr("hidden");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue