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

Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Tim Hobbs 2014-03-30 19:42:45 -07:00
commit bb54d12ca8
27 changed files with 263 additions and 1419 deletions

View file

@ -14,7 +14,6 @@
$('#txtPortNumber', page).val(config.HttpServerPortNumber);
$('#txtDdns', page).val(config.WanDdns || '');
$('#txtServerName', page).val(config.ServerName || '');
$('#chkEnableUpnp', page).checked(config.EnableUPnP).checkboxradio('refresh');
@ -53,7 +52,6 @@
config.EnableUPnP = $('#chkEnableUpnp', form).checked();
config.WanDdns = $('#txtDdns', form).val();
config.ServerName = $('#txtServerName', form).val();
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
});

View file

@ -0,0 +1,55 @@
(function ($, document, window) {
function loadPage(page, config, languageOptions) {
$('#txtServerName', page).val(config.ServerName || '');
$('#selectLocalizationLanguage', page).html(languageOptions.map(function (l) {
return '<option value="' + l.Value + '">' + l.Name + '</option>';
})).val(config.UICulture).selectmenu('refresh');
Dashboard.hideLoadingMsg();
}
$(document).on('pageshow', "#dashboardGeneralPage", function () {
Dashboard.showLoadingMsg();
var page = this;
var promise1 = ApiClient.getServerConfiguration();
var promise2 = $.getJSON(ApiClient.getUrl("Localization/Options"));
$.when(promise1, promise2).done(function (response1, response2) {
loadPage(page, response1[0], response2[0]);
});
});
window.DashboardGeneralPage = {
onSubmit: function () {
Dashboard.showLoadingMsg();
var form = this;
ApiClient.getServerConfiguration().done(function (config) {
config.ServerName = $('#txtServerName', form).val();
config.UICulture = $('#selectLocalizationLanguage', form).val();
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
});
// Disable default form submission
return false;
}
};
})(jQuery, document, window);

View file

@ -1,5 +1,5 @@
function IsStorageEnabled() {
if (!window.localStorage) {
return false;
}
@ -36,7 +36,7 @@ $.fn.checked = function (value) {
}
};
$.fn.buttonEnabled = function(enabled) {
$.fn.buttonEnabled = function (enabled) {
return enabled ? this.attr('disabled', '').removeAttr('disabled') : this.attr('disabled', 'disabled');
};
@ -132,8 +132,8 @@ var WebNotifications = {
}
}
},
supported: function() {
supported: function () {
return window.Notification || window.webkitNotifications;
}
};
@ -460,4 +460,20 @@ function ticks_to_human(str) {
};
});
})();
})();
(function (window) {
// Mimic Globalize api
// https://github.com/jquery/globalize
// Maybe later switch to it
window.Globalize = {
translate: function (key) {
return window.localizationGlossary[key] || key;
}
};
})(window);

View file

@ -103,8 +103,6 @@
$('#missingIndicator', page).hide();
}
$(".autoNumeric").autoNumeric('init');
setPeopleHeader(page, item);
if (ApiClient.isWebSocketOpen()) {

View file

@ -508,6 +508,15 @@
tag: item.ImageTags.Thumb
});
}
else if (options.preferBanner && item.ImageTags && item.ImageTags.Banner) {
imgUrl = ApiClient.getImageUrl(item.Id, {
type: "Banner",
maxwidth: 1200,
tag: item.ImageTags.Banner
});
}
else if (options.preferThumb && item.SeriesThumbImageTag) {
@ -1683,7 +1692,7 @@
renderBudget: function (elem, item) {
if (item.Budget) {
elem.show().html('Budget:&nbsp;&nbsp;$<span class="autoNumeric" data-a-pad="false">' + item.Budget + '</span>');
elem.show().html('Budget:&nbsp;&nbsp;$<span>' + item.Budget + '</span>');
} else {
elem.hide();
}
@ -1692,7 +1701,7 @@
renderRevenue: function (elem, item) {
if (item.Revenue) {
elem.show().html('Revenue:&nbsp;&nbsp;$<span class="autoNumeric" data-a-pad="false">' + item.Revenue + '</span>');
elem.show().html('Revenue:&nbsp;&nbsp;$<span>' + item.Revenue + '</span>');
} else {
elem.hide();
}

View file

@ -39,6 +39,16 @@
$('.itemsContainer', page).removeClass('timelineItemsContainer');
}
else if (view == "Banner") {
html = LibraryBrowser.getPosterViewHtml({
items: result.Items,
shape: "banner",
preferBanner: true,
context: 'tv'
});
$('.itemsContainer', page).removeClass('timelineItemsContainer');
}
else if (view == "Poster") {
html = LibraryBrowser.getPosterViewHtml({

View file

@ -12,7 +12,7 @@
$('#featureAccessFields', page).show();
}
Dashboard.setPageTitle(user.Name || "Add User");
Dashboard.setPageTitle(user.Name || Globalize.translate("AddUser"));
$('#txtUserName', page).val(user.Name);
@ -40,7 +40,7 @@
Dashboard.validateCurrentUser(page);
if (userId) {
Dashboard.alert("Settings saved.");
Dashboard.alert(Globalize.translate("SettingsSaved"));
} else {
Dashboard.navigate("userprofiles.html");
}

View file

@ -53,15 +53,15 @@
switch (evt.target.error.code) {
case evt.target.error.NOT_FOUND_ERR:
Dashboard.showError('File Not Found!');
Dashboard.showError(Globalize.translate("FileNotFound"));
break;
case evt.target.error.NOT_READABLE_ERR:
Dashboard.showError('File is not readable');
Dashboard.showError(Globalize.translate("FileReadError"));
break;
case evt.target.error.ABORT_ERR:
break; // noop
default:
Dashboard.showError('An error occurred reading this file.');
Dashboard.showError(Globalize.translate("FileReadError"));
};
}
@ -73,7 +73,7 @@
function onFileReaderAbort(evt) {
Dashboard.hideLoadingMsg();
Dashboard.showError('File read cancelled');
Dashboard.showError(Globalize.translate("FileReadCancelled"));
}
function setFiles(page, files) {
@ -156,7 +156,7 @@
self.deleteImage = function () {
Dashboard.confirm("Are you sure you wish to delete the image?", "Delete Image", function (result) {
Dashboard.confirm(Globalize.translate("DeleteImageConfirmation"), Globalize.translate("DeleteImage"), function (result) {
if (result) {

View file

@ -134,7 +134,7 @@
Dashboard.validateCurrentUser(page);
Dashboard.alert("Settings saved.");
Dashboard.alert(Globalize.translate("SettingsSaved"));
}
function saveUser(user, page) {

View file

@ -15,7 +15,7 @@
} else {
$('#btnResetPassword', page).hide();
$('#fldCurrentPassword', page).hide();
$('.formheader', page).html('Create Password').show();
$('.formheader', page).html(Globalize.translate("CreatePassword")).show();
}
});
@ -36,7 +36,7 @@
Dashboard.hideLoadingMsg();
Dashboard.alert("Password saved.");
Dashboard.alert(Globalize.translate("PasswordSaved"));
loadUser(page);
});
@ -53,7 +53,7 @@
if ($('#txtNewPassword', page).val() != $('#txtNewPasswordConfirm', page).val()) {
Dashboard.showError("Password and password confirmation must match.");
Dashboard.showError(Globalize.translate("PasswordMatchError"));
return false;
}
@ -68,11 +68,11 @@
self.resetPassword = function () {
var msg = "Are you sure you wish to reset the password?";
var msg = Globalize.translate("PasswordResetConfirmation");
var page = $.mobile.activePage;
Dashboard.confirm(msg, "Password Reset", function (result) {
Dashboard.confirm(msg, Globalize.translate("PasswordResetHeader"), function (result) {
if (result) {
var userId = getParameterByName("userId");
@ -84,10 +84,10 @@
Dashboard.hideLoadingMsg();
Dashboard.alert({
message: "The password has been reset.",
title: "Password Reset"
message: Globalize.translate("PasswordResetComplete"),
title: Globalize.translate("PasswordResetHeader")
});
loadUser(page);
});

View file

@ -14,7 +14,7 @@
var html = "";
html += '<li data-role="list-divider"><h3>Users</h3></li>';
html += '<li data-role="list-divider"><h3>' + Globalize.translate("Users") + '</h3></li>';
for (var i = 0, length = users.length; i < length; i++) {
@ -41,15 +41,15 @@
html += "</h3>";
html += "<p class='ui-li-aside'>";
if (user.Configuration.HasPassword) html += '<img src="css/images/userdata/password.png" alt="Password" title="Password" class="userProfileIcon" />';
if (user.Configuration.IsAdministrator) html += '<img src="css/images/userdata/administrator.png" alt="Administrator" title="Administrator" class="userProfileIcon" />';
if (user.Configuration.HasPassword) html += '<img src="css/images/userdata/password.png" alt="' + Globalize.translate("Password") + '" title="' + Globalize.translate("Password") + '" class="userProfileIcon" />';
if (user.Configuration.IsAdministrator) html += '<img src="css/images/userdata/administrator.png" alt="' + Globalize.translate("Administrator") + '" title="' + Globalize.translate("Administrator") + '" class="userProfileIcon" />';
html += "</p>";
html += "</a>";
html += "<a onclick='UserProfilesPage.deleteUser(this);' data-userid='" + user.Id + "' data-username='" + user.Name + "' href='#'>Delete</a>";
html += "<a onclick='UserProfilesPage.deleteUser(this);' data-userid='" + user.Id + "' data-username='" + user.Name + "' href='#'>" + Globalize.translate("Delete") + "</a>";
html += "</li>";
}
@ -64,9 +64,9 @@
var page = $.mobile.activePage;
var name = link.getAttribute('data-username');
var msg = "Are you sure you wish to delete " + name + "?";
var msg = Globalize.translate("DeleteUserConfirmation").replace('{0}', name);
Dashboard.confirm(msg, "Delete User", function (result) {
Dashboard.confirm(msg, Globalize.translate("DeleteUser"), function (result) {
if (result) {
Dashboard.showLoadingMsg();

View file

@ -29,7 +29,7 @@
Dashboard.validateCurrentUser(page);
if (userId) {
Dashboard.alert("Settings saved.");
Dashboard.alert(Globalize.translate("SettingsSaved"));
} else {
Dashboard.navigate("userprofiles.html");
}