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

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,21 +1,43 @@
$.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, crossDomain: true,
statusCode: {
401: onAuthFailure,
403: onAuthFailure
},
error: function (event) { error: function (event) {
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
if (!Dashboard.suppressAjaxErrors) { if (!Dashboard.suppressAjaxErrors) {
setTimeout(function () { setTimeout(function () {
var msg = event.getResponseHeader("X-Application-Error-Code") || Dashboard.defaultErrorMessage; var msg = event.getResponseHeader("X-Application-Error-Code") || Dashboard.defaultErrorMessage;
Dashboard.showError(msg); Dashboard.showError(msg);
}, 500); }, 500);
} }
} }
}); });
})();
if ($.browser.msie) { if ($.browser.msie) {
// This is unfortuantely required due to IE's over-aggressive caching. // This is unfortuantely required due to IE's over-aggressive caching.
@ -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");
} }
if (logoutWithServer === false) {
window.location = "login.html";
} else {
ApiClient.logout().done(function () { ApiClient.logout().done(function () {
window.location = "login.html"; 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);