1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

3.0.5306.42925

This commit is contained in:
Luke Pulverenti 2014-07-13 00:55:56 -04:00
parent 7f17e93738
commit 2d1a56ded3
5 changed files with 55 additions and 34 deletions

View file

@ -33,6 +33,8 @@
<div id="divUsers"></div> <div id="divUsers"></div>
<p class="localhostMessage" style="text-align: center; display: none;">${PasswordLocalhostMessage}</p> <p class="localhostMessage" style="text-align: center; display: none;">${PasswordLocalhostMessage}</p>
<p><a href="#" class="lnkManualLogin" onclick="LoginPage.showManualForm($.mobile.activePage, true);">${ButtonManualLogin}</a></p>
</div> </div>

View file

@ -41,15 +41,6 @@
$('#imagesByNamePath', page).html(systemInfo.ItemsByNamePath); $('#imagesByNamePath', page).html(systemInfo.ItemsByNamePath);
$('#transcodingTemporaryPath', page).html(systemInfo.TranscodingTempPath); $('#transcodingTemporaryPath', page).html(systemInfo.TranscodingTempPath);
$('#metadataPath', page).html(systemInfo.InternalMetadataPath); $('#metadataPath', page).html(systemInfo.InternalMetadataPath);
if (systemInfo.WanAddress) {
var externalUrl = systemInfo.WanAddress + "/mediabrowser";
$('.externalUrl', page).html('Remote access: <a href="' + externalUrl + '" target="_blank">' + externalUrl + '</a>').show().trigger('create');
} else {
$('.externalUrl', page).hide();
}
}, },
refreshSessionsLocally: function () { refreshSessionsLocally: function () {
@ -742,13 +733,9 @@
renderUrls: function (page, systemInfo) { renderUrls: function (page, systemInfo) {
var url = ApiClient.serverAddress() + "/mediabrowser";
$('#bookmarkUrl', page).html(url).attr("href", url);
if (systemInfo.WanAddress) { if (systemInfo.WanAddress) {
var externalUrl = systemInfo.WanAddress + "/mediabrowser"; var externalUrl = systemInfo.WanAddress + ApiClient.apiPrefix();
var remoteAccessHtml = Globalize.translate('LabelRemoteAccessUrl').replace('{0}', '<a href="' + externalUrl + '" target="_blank">' + externalUrl + '</a>'); var remoteAccessHtml = Globalize.translate('LabelRemoteAccessUrl').replace('{0}', '<a href="' + externalUrl + '" target="_blank">' + externalUrl + '</a>');

View file

@ -9,7 +9,7 @@
return LibraryBrowser.getPosterViewHtml({ return LibraryBrowser.getPosterViewHtml({
items: channels, items: channels,
shape: "smallBackdrop", shape: "miniBackdrop",
centerText: true centerText: true
}); });
} }

View file

@ -1,20 +1,42 @@
$.ajaxSetup({ (function() {
crossDomain: true,
function onAuthFailure(data, textStatus, xhr) {
error: function (event) { var url = (this.url || '').toLowerCase();
Dashboard.hideLoadingMsg();
if (!Dashboard.suppressAjaxErrors) { // Bounce to the login screen, but not if a password entry fails, obviously
setTimeout(function () { if (url.indexOf('/password') == -1 && url.indexOf('/authenticate') == -1) {
Dashboard.logout(false);
var msg = event.getResponseHeader("X-Application-Error-Code") || Dashboard.defaultErrorMessage;
Dashboard.showError(msg);
}, 500);
} }
} }
});
$.ajaxSetup({
crossDomain: true,
statusCode: {
401: onAuthFailure,
403: onAuthFailure
},
error: function (event) {
Dashboard.hideLoadingMsg();
if (!Dashboard.suppressAjaxErrors) {
setTimeout(function () {
var msg = event.getResponseHeader("X-Application-Error-Code") || Dashboard.defaultErrorMessage;
Dashboard.showError(msg);
}, 500);
}
}
});
})();
if ($.browser.msie) { if ($.browser.msie) {
@ -102,16 +124,21 @@ var Dashboard = {
Dashboard.getUserPromise = null; Dashboard.getUserPromise = null;
}, },
logout: function () { logout: function (logoutWithServer) {
if (window.localStorage) { if (window.localStorage) {
localStorage.removeItem("userId"); localStorage.removeItem("userId");
localStorage.removeItem("token"); localStorage.removeItem("token");
} }
ApiClient.logout().done(function () { if (logoutWithServer === false) {
window.location = "login.html"; window.location = "login.html";
}); } else {
ApiClient.logout().done(function () {
window.location = "login.html";
});
}
}, },
showError: function (message) { showError: function (message) {

View file

@ -57,6 +57,11 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
return serverAddress; return serverAddress;
}; };
self.apiPrefix = function () {
return "/mediabrowser";
};
/** /**
* Gets or sets the current user id. * Gets or sets the current user id.
*/ */
@ -176,7 +181,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
var url = serverAddress; var url = serverAddress;
url += "/mediabrowser/" + name; url += self.apiPrefix() + "/" + name;
if (params) { if (params) {
url += "?" + $.param(params); url += "?" + $.param(params);
@ -187,7 +192,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
self.openWebSocket = function (webSocketAddress) { self.openWebSocket = function (webSocketAddress) {
var url = webSocketAddress + "/mediabrowser"; var url = webSocketAddress + self.apiPrefix();
webSocket = new WebSocket(url); webSocket = new WebSocket(url);
@ -2159,7 +2164,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
options.maxHeight = Math.round(options.maxHeight * ratio); options.maxHeight = Math.round(options.maxHeight * ratio);
} }
} }
options.quality = options.quality || (options.type.toLowerCase() == 'backdrop' ? 80 : 90); options.quality = options.quality || (options.type.toLowerCase() == 'backdrop' ? 80 : 90);
} }