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

@ -34,6 +34,8 @@
<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>
<p class="disclaimer" style="text-align: center; margin-top: 2em;"></p>

View file

@ -41,15 +41,6 @@
$('#imagesByNamePath', page).html(systemInfo.ItemsByNamePath);
$('#transcodingTemporaryPath', page).html(systemInfo.TranscodingTempPath);
$('#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 () {
@ -742,13 +733,9 @@
renderUrls: function (page, systemInfo) {
var url = ApiClient.serverAddress() + "/mediabrowser";
$('#bookmarkUrl', page).html(url).attr("href", url);
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>');

View file

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

View file

@ -1,20 +1,42 @@
$.ajaxSetup({
(function() {
function onAuthFailure(data, textStatus, xhr) {
var url = (this.url || '').toLowerCase();
// Bounce to the login screen, but not if a password entry fails, obviously
if (url.indexOf('/password') == -1 && url.indexOf('/authenticate') == -1) {
Dashboard.logout(false);
}
}
$.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) {
@ -102,16 +124,21 @@ var Dashboard = {
Dashboard.getUserPromise = null;
},
logout: function () {
logout: function (logoutWithServer) {
if (window.localStorage) {
localStorage.removeItem("userId");
localStorage.removeItem("token");
}
if (logoutWithServer === false) {
window.location = "login.html";
} else {
ApiClient.logout().done(function () {
window.location = "login.html";
});
}
},
showError: function (message) {

View file

@ -57,6 +57,11 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
return serverAddress;
};
self.apiPrefix = function () {
return "/mediabrowser";
};
/**
* Gets or sets the current user id.
*/
@ -176,7 +181,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
var url = serverAddress;
url += "/mediabrowser/" + name;
url += self.apiPrefix() + "/" + name;
if (params) {
url += "?" + $.param(params);
@ -187,7 +192,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
self.openWebSocket = function (webSocketAddress) {
var url = webSocketAddress + "/mediabrowser";
var url = webSocketAddress + self.apiPrefix();
webSocket = new WebSocket(url);