fixes #762 - Marking unwatched doesn't update display
This commit is contained in:
parent
5bec78f61f
commit
41825781d2
49 changed files with 443 additions and 505 deletions
|
@ -3,7 +3,6 @@
|
|||
function loadPage(page, config) {
|
||||
|
||||
$('#txtCachePath', page).val(config.CachePath || '');
|
||||
$('#txtTranscodingTempPath', page).val(config.TranscodingTempPath || '');
|
||||
$('#txtItemsByNamePath', page).val(config.ItemsByNamePath || '');
|
||||
$('#txtMetadataPath', page).val(config.MetadataPath || '');
|
||||
|
||||
|
@ -46,26 +45,6 @@
|
|||
});
|
||||
});
|
||||
|
||||
$('#btnSelectTranscodingTempPath', page).on("click.selectDirectory", function () {
|
||||
|
||||
var picker = new DirectoryBrowser(page);
|
||||
|
||||
picker.show({
|
||||
|
||||
callback: function (path) {
|
||||
|
||||
if (path) {
|
||||
$('#txtTranscodingTempPath', page).val(path);
|
||||
}
|
||||
picker.close();
|
||||
},
|
||||
|
||||
header: Globalize.translate('HeaderSelectTranscodingPath'),
|
||||
|
||||
instruction: Globalize.translate('HeaderSelectTranscodingPathHelp')
|
||||
});
|
||||
});
|
||||
|
||||
$('#btnSelectIBNPath', page).on("click.selectDirectory", function () {
|
||||
|
||||
var picker = new DirectoryBrowser(page);
|
||||
|
@ -119,7 +98,6 @@
|
|||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
|
||||
config.CachePath = $('#txtCachePath', form).val();
|
||||
config.TranscodingTempPath = $('#txtTranscodingTempPath', form).val();
|
||||
config.ItemsByNamePath = $('#txtItemsByNamePath', form).val();
|
||||
config.MetadataPath = $('#txtMetadataPath', form).val();
|
||||
|
||||
|
|
|
@ -1,48 +0,0 @@
|
|||
(function ($, document, window) {
|
||||
|
||||
function loadPage(page, config) {
|
||||
|
||||
$('#chkMobileClients', page).checked(config.RequireMobileManualLogin).checkboxradio("refresh");
|
||||
$('#chkOtherApps', page).checked(config.RequireNonMobileManualLogin).checkboxradio("refresh");
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
$(document).on('pageshow', "#allUserSettingsPage", function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var page = this;
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
|
||||
loadPage(page, config);
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
function allUserSettingsPage() {
|
||||
|
||||
var self = this;
|
||||
|
||||
self.onSubmit = function () {
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var form = this;
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
|
||||
config.RequireMobileManualLogin = $('#chkMobileClients', form).checked();
|
||||
config.RequireNonMobileManualLogin = $('#chkOtherApps', form).checked();
|
||||
|
||||
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
|
||||
});
|
||||
|
||||
// Disable default form submission
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
window.AllUserSettingsPage = new allUserSettingsPage();
|
||||
|
||||
})(jQuery, document, window);
|
|
@ -1,41 +0,0 @@
|
|||
(function ($, document, window) {
|
||||
|
||||
$(document).on('pageshow', "#appsWeatherPage", function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var page = this;
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
|
||||
$('#txtWeatherLocation', page).val(config.WeatherLocation);
|
||||
$('#selectWeatherUnit', page).val(config.WeatherUnit).selectmenu("refresh");
|
||||
|
||||
$('input:first', page).focus();
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
});
|
||||
|
||||
window.AppsWeatherPage = {
|
||||
|
||||
onSubmit: function () {
|
||||
var form = this;
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
|
||||
config.WeatherLocation = $('#txtWeatherLocation', form).val();
|
||||
config.WeatherUnit = $('#selectWeatherUnit', form).val();
|
||||
|
||||
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
|
||||
});
|
||||
|
||||
// Disable default form submission
|
||||
return false;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
})($, document, window);
|
45
dashboard-ui/scripts/branding.js
Normal file
45
dashboard-ui/scripts/branding.js
Normal file
|
@ -0,0 +1,45 @@
|
|||
(function ($, document, window) {
|
||||
|
||||
var brandingConfigKey = "branding";
|
||||
|
||||
function loadPage(page, config) {
|
||||
|
||||
$('#txtLoginDisclaimer', page).val(config.LoginDisclaimer || '');
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
$(document).on('pageshow', "#dashboardBrandingPage", function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var page = this;
|
||||
|
||||
ApiClient.getNamedConfiguration(brandingConfigKey).done(function (config) {
|
||||
|
||||
loadPage(page, config);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
window.BrandingPage = {
|
||||
|
||||
onSubmit: function () {
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var form = this;
|
||||
|
||||
ApiClient.getNamedConfiguration(brandingConfigKey).done(function (config) {
|
||||
|
||||
config.LoginDisclaimer = $('#txtLoginDisclaimer', form).val();
|
||||
|
||||
ApiClient.updateNamedConfiguration(brandingConfigKey, config).done(Dashboard.processServerConfigurationUpdateResult);
|
||||
});
|
||||
|
||||
// Disable default form submission
|
||||
return false;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
})(jQuery, document, window);
|
|
@ -117,7 +117,7 @@
|
|||
return i.getAttribute('data-channelid');
|
||||
});
|
||||
|
||||
ApiClient.updateNamedConfiguration(config).done("channels", Dashboard.processServerConfigurationUpdateResult);
|
||||
ApiClient.updateNamedConfiguration("channels", config).done(Dashboard.processServerConfigurationUpdateResult);
|
||||
});
|
||||
|
||||
// Disable default form submission
|
||||
|
|
|
@ -987,6 +987,13 @@
|
|||
return false;
|
||||
};
|
||||
|
||||
self.onRefreshFormSubmit = function() {
|
||||
var page = $(this).parents('.page');
|
||||
|
||||
refreshFromPopupOptions(page);
|
||||
return false;
|
||||
};
|
||||
|
||||
self.onPersonInfoFormSubmit = function () {
|
||||
|
||||
var page = $(this).parents('.page');
|
||||
|
@ -1197,31 +1204,65 @@
|
|||
});
|
||||
}
|
||||
|
||||
function performAdvancedRefresh(page) {
|
||||
|
||||
$('.popupAdvancedRefresh', page).popup('open');
|
||||
|
||||
$('#selectMetadataRefreshMode', page).val('all').selectmenu('refresh');
|
||||
$('#selectImageRefreshMode', page).val('missing').selectmenu('refresh');
|
||||
}
|
||||
|
||||
function refreshFromPopupOptions(page) {
|
||||
|
||||
var metadataRefreshMode = $('#selectMetadataRefreshMode', page).val();
|
||||
var imageRefreshMode = $('#selectImageRefreshMode', page).val();
|
||||
|
||||
refreshWithOptions(page, {
|
||||
|
||||
Recursive: true,
|
||||
ImageRefreshMode: imageRefreshMode == 'none' ? 'None' : 'FullRefresh',
|
||||
MetadataRefreshMode: metadataRefreshMode == 'none' ? 'None' : 'FullRefresh',
|
||||
ReplaceAllImages: imageRefreshMode == imageRefreshMode == 'all',
|
||||
ReplaceAllMetadata: metadataRefreshMode == 'all'
|
||||
});
|
||||
|
||||
$('.popupAdvancedRefresh', page).popup('close');
|
||||
}
|
||||
|
||||
function refreshWithOptions(page, options) {
|
||||
$('#refreshLoading', page).show();
|
||||
|
||||
$('#btnDelete', page).buttonEnabled(false);
|
||||
$('#btnRefresh', page).buttonEnabled(false);
|
||||
$('.btnSave', page).buttonEnabled(false);
|
||||
|
||||
ApiClient.refreshItem(currentItem.Id, options).done(function () {
|
||||
|
||||
reload(page);
|
||||
});
|
||||
}
|
||||
|
||||
$(document).on('pageinit', "#editItemMetadataPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$('#btnRefresh', this).on('click', function () {
|
||||
|
||||
$('#btnDelete', page).buttonEnabled(false);
|
||||
$('#btnRefresh', page).buttonEnabled(false);
|
||||
$('.btnSave', page).buttonEnabled(false);
|
||||
var metadataRefreshMode = $('#selectRefreshMode', page).val();
|
||||
|
||||
$('#refreshLoading', page).show();
|
||||
if (metadataRefreshMode == 'advanced') {
|
||||
performAdvancedRefresh(page);
|
||||
} else {
|
||||
|
||||
var mode = $('#selectRefreshMode', page).val();
|
||||
refreshWithOptions(page, {
|
||||
|
||||
ApiClient.refreshItem(currentItem.Id, {
|
||||
|
||||
forced: mode == 'allandimages' || mode == 'all',
|
||||
recursive: true,
|
||||
replaceAllImages: mode == 'allandimages'
|
||||
|
||||
}).done(function () {
|
||||
|
||||
reload(page);
|
||||
|
||||
});
|
||||
Recursive: true,
|
||||
ImageRefreshMode: 'FullRefresh',
|
||||
MetadataRefreshMode: 'FullRefresh',
|
||||
ReplaceAllImages: false,
|
||||
ReplaceAllMetadata: metadataRefreshMode == 'all'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('#btnIdentify', page).on('click', function () {
|
||||
|
|
|
@ -11,11 +11,36 @@
|
|||
}).checkboxradio('refresh');
|
||||
|
||||
$('#txtDownMixAudioBoost', page).val(config.DownMixAudioBoost);
|
||||
$('#txtTranscodingTempPath', page).val(config.TranscodingTempPath || '');
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
$(document).on('pageshow', "#encodingSettingsPage", function () {
|
||||
$(document).on('pageinit', "#encodingSettingsPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$('#btnSelectTranscodingTempPath', page).on("click.selectDirectory", function () {
|
||||
|
||||
var picker = new DirectoryBrowser(page);
|
||||
|
||||
picker.show({
|
||||
|
||||
callback: function (path) {
|
||||
|
||||
if (path) {
|
||||
$('#txtTranscodingTempPath', page).val(path);
|
||||
}
|
||||
picker.close();
|
||||
},
|
||||
|
||||
header: Globalize.translate('HeaderSelectTranscodingPath'),
|
||||
|
||||
instruction: Globalize.translate('HeaderSelectTranscodingPathHelp')
|
||||
});
|
||||
});
|
||||
|
||||
}).on('pageshow', "#encodingSettingsPage", function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
|
@ -41,6 +66,7 @@
|
|||
config.EnableDebugEncodingLogging = $('#chkEnableDebugEncodingLogging', form).checked();
|
||||
config.MediaEncodingQuality = $('.radioEncodingQuality:checked', form).val();
|
||||
config.DownMixAudioBoost = $('#txtDownMixAudioBoost', form).val();
|
||||
config.TranscodingTempPath = $('#txtTranscodingTempPath', form).val();
|
||||
|
||||
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
|
||||
});
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
try {
|
||||
localStorage.setItem(key + '_' + Dashboard.getCurrentUserId(), JSON.stringify(values));
|
||||
} catch (e) {
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -810,7 +810,7 @@
|
|||
dataSrc = ' data-src="' + imgUrl + '"';
|
||||
}
|
||||
|
||||
var progressHtml = options.showProgress === false ? '' : LibraryBrowser.getItemProgressBarHtml(item);
|
||||
var progressHtml = options.showProgress === false || item.IsFolder ? '' : LibraryBrowser.getItemProgressBarHtml((item.Type == 'Recording' ? item : item.UserData));
|
||||
|
||||
html += '<div class="' + imageCssClass + '" style="' + style + '"' + dataSrc + '>';
|
||||
|
||||
|
@ -842,9 +842,9 @@
|
|||
if (!options.overlayText) {
|
||||
|
||||
if (progressHtml) {
|
||||
html += '<div class="posterItemTextOverlay posterItemProgressContainer">';
|
||||
html += '<div class="posterItemTextOverlay">';
|
||||
html += "<div class='posterItemProgress miniPosterItemProgress'>";
|
||||
html += progressHtml;
|
||||
html += progressHtml || " ";
|
||||
html += "</div>";
|
||||
html += "</div>";
|
||||
}
|
||||
|
@ -903,7 +903,7 @@
|
|||
if (options.overlayText) {
|
||||
|
||||
if (progressHtml) {
|
||||
html += "<div class='posterItemText posterItemProgress posterItemProgressContainer'>";
|
||||
html += "<div class='posterItemText posterItemProgress'>";
|
||||
html += progressHtml || " ";
|
||||
html += "</div>";
|
||||
}
|
||||
|
@ -1094,15 +1094,12 @@
|
|||
|
||||
getPlayedIndicatorHtml: function (item) {
|
||||
|
||||
if (item.Type == "TvChannel") {
|
||||
return '';
|
||||
}
|
||||
if (item.Type == "Series" || item.Type == "Season" || item.Type == "BoxSet" || item.MediaType == "Video" || item.MediaType == "Game" || item.MediaType == "Book") {
|
||||
if (item.RecursiveUnplayedItemCount) {
|
||||
return '<div class="unplayedIndicator">' + item.RecursiveUnplayedItemCount + '</div>';
|
||||
if (item.UserData.UnplayedItemCount) {
|
||||
return '<div class="playedIndicator">' + item.UserData.UnplayedItemCount + '</div>';
|
||||
}
|
||||
|
||||
if (item.PlayedPercentage == 100 || (item.UserData && item.UserData.Played)) {
|
||||
if (item.UserData.PlayedPercentage >= 100 || (item.UserData && item.UserData.Played)) {
|
||||
return '<div class="playedIndicator"><div class="ui-icon-check ui-btn-icon-notext"></div></div>';
|
||||
}
|
||||
}
|
||||
|
@ -1393,16 +1390,11 @@
|
|||
return '<progress class="itemProgressBar recordingProgressBar" min="0" max="100" value="' + item.CompletionPercentage + '"></progress>';
|
||||
}
|
||||
|
||||
if (item.UserData && item.UserData.PlaybackPositionTicks && item.RunTimeTicks) {
|
||||
var pct = item.PlayedPercentage;
|
||||
|
||||
var tooltip = Dashboard.getDisplayTime(item.UserData.PlaybackPositionTicks) + " / " + Dashboard.getDisplayTime(item.RunTimeTicks);
|
||||
if (pct && pct < 100) {
|
||||
|
||||
var pct = (item.UserData.PlaybackPositionTicks / item.RunTimeTicks) * 100;
|
||||
|
||||
if (pct && pct < 100) {
|
||||
|
||||
return '<progress title="' + tooltip + '" class="itemProgressBar" min="0" max="100" value="' + pct + '"></progress>';
|
||||
}
|
||||
return '<progress class="itemProgressBar" min="0" max="100" value="' + pct + '"></progress>';
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -1640,7 +1632,7 @@
|
|||
html += "</a>";
|
||||
}
|
||||
|
||||
var progressHtml = LibraryBrowser.getItemProgressBarHtml(item);
|
||||
var progressHtml = item.IsFolder ? '' : LibraryBrowser.getItemProgressBarHtml((item.Type == 'Recording' ? item : item.UserData));
|
||||
|
||||
if (progressHtml) {
|
||||
html += '<div class="detailImageProgressContainer">';
|
||||
|
|
|
@ -499,17 +499,27 @@
|
|||
|
||||
if (!$('.playedIndicator', posterItem).length) {
|
||||
|
||||
var html = '<div class="unplayedIndicator"><div class="ui-icon-check ui-btn-icon-notext"></div></div>';
|
||||
|
||||
$(html).insertAfter($('.posterItemOverlayTarget', posterItem));
|
||||
$('<div class="playedIndicator"></div>').insertAfter($('.posterItemOverlayTarget', posterItem));
|
||||
}
|
||||
|
||||
} else {
|
||||
$('.playedIndicator', posterItem).remove();
|
||||
$('.playedIndicator', posterItem).html('<div class="ui-icon-check ui-btn-icon-notext"></div>');
|
||||
$('.posterItemProgress', posterItem).remove();
|
||||
}
|
||||
else if (userData.UnplayedItemCount) {
|
||||
|
||||
// TODO: Handle progress bar
|
||||
// $('.posterItemProgressContainer').remove();
|
||||
if (!$('.playedIndicator', posterItem).length) {
|
||||
|
||||
$('<div class="playedIndicator"></div>').insertAfter($('.posterItemOverlayTarget', posterItem));
|
||||
}
|
||||
$('.playedIndicator', posterItem).html(userData.UnplayedItemCount);
|
||||
}
|
||||
else {
|
||||
|
||||
$('.playedIndicator', posterItem).remove();
|
||||
|
||||
var progressHtml = LibraryBrowser.getItemProgressBarHtml(userData);
|
||||
|
||||
$('.posterItemProgress', posterItem).html(progressHtml);
|
||||
}
|
||||
}
|
||||
|
||||
function onUserDataChanged(userData) {
|
||||
|
|
|
@ -1,23 +1,13 @@
|
|||
var LoginPage = {
|
||||
|
||||
onPageInit: function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$("#popupLogin", page).popup({
|
||||
afteropen: function (event, ui) {
|
||||
$('#pw').focus();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
onPageShow: function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var page = this;
|
||||
|
||||
var isLocalhost = window.location.toString().toLowerCase().indexOf('localhost') != -1;
|
||||
var location = window.location.toString().toLowerCase();
|
||||
var isLocalhost = location.indexOf('localhost') != -1 || location.indexOf('127.0.0.1') != -1;
|
||||
|
||||
if (isLocalhost) {
|
||||
$('.localhostMessage', page).show();
|
||||
|
@ -27,31 +17,38 @@
|
|||
|
||||
// Show all users on localhost
|
||||
var promise1 = !isLocalhost ? ApiClient.getPublicUsers() : ApiClient.getUsers({ IsDisabled: false });
|
||||
var promise2 = ApiClient.getServerConfiguration();
|
||||
|
||||
$.when(promise1, promise2).done(function (response1, response2) {
|
||||
promise1.done(function (users) {
|
||||
|
||||
var users = response1[0];
|
||||
var config = response2[0];
|
||||
|
||||
var showManualForm = config.RequireMobileManualLogin || !users.length;
|
||||
var showManualForm = !users.length || !isLocalhost;
|
||||
|
||||
if (showManualForm) {
|
||||
|
||||
$('.visualLoginForm', page).hide();
|
||||
$('#manualLoginForm', page).show();
|
||||
$('#txtManualName', page).focus();
|
||||
LoginPage.showManualForm(page);
|
||||
|
||||
} else {
|
||||
|
||||
$('.visualLoginForm', page).show();
|
||||
$('#manualLoginForm', page).hide();
|
||||
|
||||
LoginPage.showVisualForm(page);
|
||||
LoginPage.loadUserList(users);
|
||||
}
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('Branding/Configuration')).done(function (options) {
|
||||
|
||||
$('.disclaimer', page).html(options.LoginDisclaimer || '');
|
||||
});
|
||||
},
|
||||
|
||||
showManualForm: function (page) {
|
||||
$('.visualLoginForm', page).hide();
|
||||
$('#manualLoginForm', page).show();
|
||||
$('#txtManualName', page).focus();
|
||||
},
|
||||
|
||||
showVisualForm: function (page) {
|
||||
$('.visualLoginForm', page).show();
|
||||
$('#manualLoginForm', page).hide();
|
||||
},
|
||||
|
||||
getLastSeenText: function (lastActivityDate) {
|
||||
|
@ -126,21 +123,12 @@
|
|||
loadUserList: function (users) {
|
||||
var html = "";
|
||||
|
||||
var isLocalhost = window.location.toString().toLowerCase().indexOf('localhost') != -1;
|
||||
|
||||
for (var i = 0, length = users.length; i < length; i++) {
|
||||
var user = users[i];
|
||||
|
||||
var linkId = "lnkUser" + i;
|
||||
|
||||
if (isLocalhost) {
|
||||
html += "<a class='posterItem squarePosterItem' id='" + linkId + "' data-userid='" + user.Id + "' href='index.html?u=" + user.Id + "' data-ajax='false' \">";
|
||||
}
|
||||
else if (user.HasPassword) {
|
||||
html += "<a class='posterItem squarePosterItem' id='" + linkId + "' data-userid='" + user.Id + "' href='#popupLogin' data-rel='popup' onclick='LoginPage.authenticatingLinkId=this.id;' \">";
|
||||
} else {
|
||||
html += "<a class='posterItem squarePosterItem' id='" + linkId + "' data-userid='" + user.Id + "' href='#' onclick='LoginPage.authenticateUserLink(this);' \">";
|
||||
}
|
||||
html += "<a class='posterItem squarePosterItem' id='" + linkId + "' data-userid='" + user.Id + "' href='index.html?u=" + user.Id + "' data-ajax='false' \">";
|
||||
|
||||
if (user.PrimaryImageTag) {
|
||||
|
||||
|
@ -178,18 +166,6 @@
|
|||
|
||||
},
|
||||
|
||||
onSubmit: function () {
|
||||
|
||||
$('#popupLogin', '#loginPage').popup('close');
|
||||
|
||||
var link = $('#' + LoginPage.authenticatingLinkId)[0];
|
||||
|
||||
LoginPage.authenticateUser(link.getAttribute('data-userid'), $('#pw', '#loginPage').val());
|
||||
|
||||
// Disable default form submission
|
||||
return false;
|
||||
},
|
||||
|
||||
onManualSubmit: function () {
|
||||
|
||||
LoginPage.authenticateUserByName($('#txtManualName', '#loginPage').val(), $('#txtManualPassword', '#loginPage').val());
|
||||
|
@ -199,4 +175,4 @@
|
|||
}
|
||||
};
|
||||
|
||||
$(document).on('pageshow', "#loginPage", LoginPage.onPageShow).on('pageinit', "#loginPage", LoginPage.onPageInit);
|
||||
$(document).on('pagebeforeshow', "#loginPage", LoginPage.onPageShow);
|
||||
|
|
|
@ -1,83 +1,48 @@
|
|||
var LogPage = {
|
||||
(function () {
|
||||
|
||||
onPageShow: function () {
|
||||
$(document).on('pagebeforeshow', "#logPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
LogPage.startLine = 0;
|
||||
|
||||
$('#logContents', page).html('');
|
||||
ApiClient.getJSON(ApiClient.getUrl('System/Logs')).done(function (logs) {
|
||||
|
||||
$(ApiClient).on("websocketmessage", LogPage.onWebSocketMessage).on("websocketopen", LogPage.onWebSocketConnectionChange).on("websocketerror", LogPage.onWebSocketConnectionChange).on("websocketclose", LogPage.onWebSocketConnectionChange);
|
||||
var html = '';
|
||||
|
||||
LogPage.startInterval();
|
||||
html += '<ul data-role="listview" data-inset="true">';
|
||||
|
||||
ApiClient.getSystemInfo().done(function(systemInfo) {
|
||||
html += logs.map(function (log) {
|
||||
|
||||
$('#logPath', page).html(systemInfo.LogPath);
|
||||
var logUrl = ApiClient.getUrl('System/Logs/Log', {
|
||||
name: log.Name
|
||||
});
|
||||
var logHtml = '<li><a href="' + logUrl + '" target="_blank">';
|
||||
|
||||
logHtml += '<h3>';
|
||||
logHtml += log.Name;
|
||||
logHtml += '</h3>';
|
||||
|
||||
var date = parseISO8601Date(log.DateModified, { toLocal: true });
|
||||
|
||||
var text = date.toLocaleDateString();
|
||||
|
||||
text += ' ' + LiveTvHelpers.getDisplayTime(date);
|
||||
|
||||
logHtml += '<p>' + text + '</p>';
|
||||
|
||||
logHtml += '</li>';
|
||||
|
||||
return logHtml;
|
||||
|
||||
})
|
||||
.join('');
|
||||
|
||||
html += '</ul>';
|
||||
|
||||
$('.serverLogs', page).html(html).trigger('create');
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
onPageHide: function () {
|
||||
|
||||
$(ApiClient).off("websocketmessage", LogPage.onWebSocketMessage).off("websocketopen", LogPage.onWebSocketConnectionChange).off("websocketerror", LogPage.onWebSocketConnectionChange).off("websocketclose", LogPage.onWebSocketConnectionChange);
|
||||
});
|
||||
|
||||
LogPage.stopInterval();
|
||||
},
|
||||
|
||||
startInterval: function () {
|
||||
|
||||
if (ApiClient.isWebSocketOpen()) {
|
||||
ApiClient.sendWebSocketMessage("LogFileStart", "0,2000");
|
||||
}
|
||||
},
|
||||
|
||||
stopInterval: function () {
|
||||
|
||||
if (ApiClient.isWebSocketOpen()) {
|
||||
ApiClient.sendWebSocketMessage("LogFileStop");
|
||||
}
|
||||
},
|
||||
|
||||
onWebSocketConnectionChange: function () {
|
||||
LogPage.stopInterval();
|
||||
LogPage.startInterval();
|
||||
},
|
||||
|
||||
onWebSocketMessage: function (e, msg) {
|
||||
|
||||
if (msg.MessageType == "LogFile") {
|
||||
LogPage.appendLines(msg.Data);
|
||||
}
|
||||
},
|
||||
|
||||
appendLines: function (lines) {
|
||||
|
||||
if (!lines.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
LogPage.startLine += lines.length;
|
||||
|
||||
lines = lines.join('\n') + '\n';
|
||||
|
||||
var elem = $('#logContents', $.mobile.activePage).append(lines)[0];
|
||||
|
||||
elem.style.height = (elem.scrollHeight) + 'px';
|
||||
|
||||
if ($('#chkAutoScroll', $.mobile.activePage).checked()) {
|
||||
$('html, body').animate({ scrollTop: $(document).height() }, 'slow');
|
||||
}
|
||||
},
|
||||
|
||||
updateAutoScroll: function (value) {
|
||||
|
||||
var page = $.mobile.activePage;
|
||||
|
||||
$('#chkAutoScrollBottom', page).checked(value).checkboxradio('refresh');
|
||||
$('#chkAutoScroll', page).checked(value).checkboxradio('refresh');
|
||||
}
|
||||
};
|
||||
|
||||
$(document).on('pageshow', "#logPage", LogPage.onPageShow).on('pagehide', "#logPage", LogPage.onPageHide);
|
||||
})();
|
|
@ -31,10 +31,8 @@
|
|||
|
||||
if (remoteFullscreen) {
|
||||
exitFullScreenToWindow();
|
||||
$('.hiddenOnIdle').removeClass("inactive");
|
||||
} else {
|
||||
enterFullScreen();
|
||||
$('.hiddenOnIdle').addClass("inactive");
|
||||
}
|
||||
|
||||
remoteFullscreen = !remoteFullscreen;
|
||||
|
@ -835,7 +833,7 @@
|
|||
}
|
||||
|
||||
// Some 1080- videos are reported as 1912?
|
||||
if (maxAllowedWidth >= 1910) {
|
||||
if (maxAllowedWidth >= 1900) {
|
||||
options.push({ name: '1080p - 30Mbps', maxWidth: 1920, bitrate: 30000000 });
|
||||
options.push({ name: '1080p - 25Mbps', maxWidth: 1920, bitrate: 25000000 });
|
||||
options.push({ name: '1080p - 20Mbps', maxWidth: 1920, bitrate: 20000000 });
|
||||
|
@ -845,13 +843,13 @@
|
|||
options.push({ name: '1080p - 6Mbps', maxWidth: 1920, bitrate: 6000000 });
|
||||
options.push({ name: '1080p - 5Mbps', maxWidth: 1920, bitrate: 5000000 });
|
||||
}
|
||||
else if (maxAllowedWidth >= 1270) {
|
||||
else if (maxAllowedWidth >= 1260) {
|
||||
options.push({ name: '720p - 10Mbps', maxWidth: 1280, bitrate: 10000000 });
|
||||
options.push({ name: '720p - 8Mbps', maxWidth: 1280, bitrate: 8000000 });
|
||||
options.push({ name: '720p - 6Mbps', maxWidth: 1280, bitrate: 6000000 });
|
||||
options.push({ name: '720p - 5Mbps', maxWidth: 1280, bitrate: 5000000 });
|
||||
}
|
||||
else if (maxAllowedWidth >= 470) {
|
||||
else if (maxAllowedWidth >= 460) {
|
||||
options.push({ name: '480p - 4Mbps', maxWidth: 720, bitrate: 4000000 });
|
||||
options.push({ name: '480p - 3.5Mbps', maxWidth: 720, bitrate: 3500000 });
|
||||
options.push({ name: '480p - 3Mbps', maxWidth: 720, bitrate: 3000000 });
|
||||
|
@ -860,7 +858,7 @@
|
|||
options.push({ name: '480p - 1.5Mbps', maxWidth: 720, bitrate: 1500000 });
|
||||
}
|
||||
|
||||
if (maxAllowedWidth >= 1270) {
|
||||
if (maxAllowedWidth >= 1260) {
|
||||
options.push({ name: '720p - 4Mbps', maxWidth: 1280, bitrate: 4000000 });
|
||||
options.push({ name: '720p - 3Mbps', maxWidth: 1280, bitrate: 3000000 });
|
||||
options.push({ name: '720p - 2Mbps', maxWidth: 1280, bitrate: 2000000 });
|
||||
|
@ -898,18 +896,20 @@
|
|||
|
||||
function bindEventsForPlayback() {
|
||||
|
||||
$(document).on('webkitfullscreenchange.videoplayer mozfullscreenchange.videoplayer fullscreenchange.videoplayer', function (e) {
|
||||
|
||||
var hideElementsOnIdle = !$.browser.mobile;
|
||||
|
||||
if (hideElementsOnIdle) {
|
||||
$('.itemVideo').off('mousemove.videoplayer keydown.videoplayer scroll.videoplayer', idleHandler);
|
||||
$('.itemVideo').on('mousemove.videoplayer keydown.videoplayer scroll.videoplayer', idleHandler).trigger('mousemove');
|
||||
}
|
||||
|
||||
$(document).on('webkitfullscreenchange.videoplayer mozfullscreenchange.videoplayer fullscreenchange.videoplayer', function (e) {
|
||||
|
||||
if (self.isFullScreen()) {
|
||||
enterFullScreen();
|
||||
idleState = true;
|
||||
$('.itemVideo').on('mousemove.videoplayer keydown.videoplayer scroll.videoplayer', idleHandler).trigger('mousemove');
|
||||
|
||||
} else {
|
||||
$('.hiddenOnIdle').removeClass("inactive");
|
||||
|
||||
exitFullScreenToWindow();
|
||||
}
|
||||
|
||||
|
@ -938,10 +938,12 @@
|
|||
return;
|
||||
});
|
||||
|
||||
$(document.body).on("mousemove.videplayer", "#videoPlayer.fullscreenVideo #itemVideo", function () {
|
||||
if (hideElementsOnIdle) {
|
||||
$(document.body).on("mousemove.videplayer", "#itemVideo", function () {
|
||||
|
||||
idleHandler(this);
|
||||
});
|
||||
idleHandler(this);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function unbindEventsForPlayback() {
|
||||
|
@ -951,7 +953,7 @@
|
|||
// Stop playback on browser back button nav
|
||||
$(window).off("popstate.videoplayer");
|
||||
|
||||
$(document.body).off("mousemove.videplayer", "#videoPlayer.fullscreenVideo #itemVideo");
|
||||
$(document.body).off("mousemove.videplayer");
|
||||
|
||||
$('.itemVideo').off('mousemove.videoplayer keydown.videoplayer scroll.videoplayer');
|
||||
}
|
||||
|
@ -1156,7 +1158,12 @@
|
|||
volumeSlider.val(initialVolume).slider('refresh');
|
||||
updateVolumeButtons(initialVolume);
|
||||
|
||||
video.on("volumechange.mediaplayerevent", function (e) {
|
||||
video.on("loadstart.mediaplayerevent", function (e) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
|
||||
}).on("volumechange.mediaplayerevent", function (e) {
|
||||
|
||||
var vol = this.volume;
|
||||
|
||||
|
@ -1182,6 +1189,8 @@
|
|||
|
||||
}).on("playing.mediaplayerevent", function (e) {
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
|
||||
$('#video-playButton', videoControls).hide();
|
||||
$('#video-pauseButton', videoControls).show();
|
||||
$("#play", videoElement).show().addClass("fadeOut");
|
||||
|
|
|
@ -360,7 +360,7 @@
|
|||
return;
|
||||
}
|
||||
|
||||
html += '<div class="ui-controlgroup-label" style="margin-bottom:0;padding-left:2px;">Preferred Local Metadata:</div>';
|
||||
html += '<div class="ui-controlgroup-label" style="margin-bottom:0;padding-left:2px;">Metadata Readers:</div>';
|
||||
html += '<ul data-role="listview" data-inset="true" data-mini="true" style="margin-top:.5em;margin-bottom:.5em;">';
|
||||
|
||||
for (var i = 0, length = plugins.length; i < length; i++) {
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
$('#selectReleaseDateFormat', page).val(config.ReleaseDateFormat).selectmenu('refresh');
|
||||
$('#chkSaveImagePaths', page).checked(config.SaveImagePathsInNfo).checkboxradio('refresh');
|
||||
$('#chkEnablePathSubstitution', page).checked(config.EnablePathSubstitution).checkboxradio('refresh');
|
||||
$('#chkEnableExtraThumbs', page).checked(config.EnableExtraThumbsDuplication).checkboxradio('refresh');
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
@ -47,6 +48,7 @@
|
|||
config.ReleaseDateFormat = $('#selectReleaseDateFormat', form).val();
|
||||
config.SaveImagePathsInNfo = $('#chkSaveImagePaths', form).checked();
|
||||
config.EnablePathSubstitution = $('#chkEnablePathSubstitution', form).checked();
|
||||
config.EnableExtraThumbsDuplication = $('#chkEnableExtraThumbs', form).checked();
|
||||
|
||||
ApiClient.updateNamedConfiguration(metadataKey, config).done(Dashboard.processServerConfigurationUpdateResult);
|
||||
});
|
||||
|
|
|
@ -684,10 +684,6 @@ var Dashboard = {
|
|||
divider: true,
|
||||
href: "userprofiles.html",
|
||||
selected: page.hasClass("userProfilesConfigurationPage") || (pageElem.id == "mediaLibraryPage" && getParameterByName('userId'))
|
||||
}, {
|
||||
name: "App Settings",
|
||||
href: "appsplayback.html",
|
||||
selected: page.hasClass("appsPage")
|
||||
}, {
|
||||
name: "Advanced",
|
||||
divider: true,
|
||||
|
@ -1190,23 +1186,29 @@ var Dashboard = {
|
|||
}
|
||||
};
|
||||
|
||||
if (!window.WebSocket) {
|
||||
(function () {
|
||||
|
||||
alert("This browser does not support web sockets. For a better experience, try a newer browser such as Chrome, Firefox, IE10+, Safari (iOS) or Opera.");
|
||||
}
|
||||
if (!window.WebSocket) {
|
||||
|
||||
else if (!IsStorageEnabled()) {
|
||||
alert("This browser does not support local storage or is running in private mode. For a better experience, try a newer browser such as Chrome, Firefox, IE10+, Safari (iOS) or Opera.");
|
||||
}
|
||||
alert("This browser does not support web sockets. For a better experience, try a newer browser such as Chrome, Firefox, IE10+, Safari (iOS) or Opera.");
|
||||
}
|
||||
|
||||
var ApiClient = MediaBrowser.ApiClient.create("Dashboard", window.dashboardVersion);
|
||||
else if (!IsStorageEnabled()) {
|
||||
alert("This browser does not support local storage or is running in private mode. For a better experience, try a newer browser such as Chrome, Firefox, IE10+, Safari (iOS) or Opera.");
|
||||
}
|
||||
|
||||
$(ApiClient).on("websocketopen", Dashboard.onWebSocketOpened).on("websocketmessage", Dashboard.onWebSocketMessageReceived);
|
||||
window.ApiClient = MediaBrowser.ApiClient.create("Dashboard", window.dashboardVersion);
|
||||
|
||||
$(function () {
|
||||
$(ApiClient).on("websocketopen", Dashboard.onWebSocketOpened)
|
||||
.on("websocketmessage", Dashboard.onWebSocketMessageReceived);
|
||||
|
||||
ApiClient.currentUserId(Dashboard.getCurrentUserId());
|
||||
|
||||
})();
|
||||
|
||||
|
||||
$(function () {
|
||||
|
||||
var videoPlayerHtml = '<div id="mediaPlayer" data-theme="b" class="ui-bar-b" style="display: none;">';
|
||||
|
||||
videoPlayerHtml += '<div class="videoBackdrop">';
|
||||
|
@ -1321,7 +1323,6 @@ $(document).on('pagebeforeshow', ".page", function () {
|
|||
var page = $(this);
|
||||
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
ApiClient.currentUserId(userId);
|
||||
|
||||
if (userId) {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue