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

removed ProcessManager

This commit is contained in:
Luke Pulverenti 2015-03-24 21:14:24 -04:00
parent 8830ee7c30
commit 50a6a77dbe
4 changed files with 43 additions and 21 deletions

View file

@ -253,7 +253,7 @@
<div id="scenesCollapsible" style="display: none;" class="detailSection"> <div id="scenesCollapsible" style="display: none;" class="detailSection">
<div class="detailSectionHeader"> <div class="detailSectionHeader">
${HeaderScenes} ${HeaderScenes}
<a class="detailSectionHeaderButton" href="metadataadvanced.html" data-role="button" data-icon="gear" data-iconpos="notext" data-inline="true" title="${ButtonSettings}">${ButtonSettings}</a> <a class="detailSectionHeaderButton chapterSettingsButton" href="metadataadvanced.html" data-role="button" data-icon="gear" data-iconpos="notext" data-inline="true" title="${ButtonSettings}" style="display:none;">${ButtonSettings}</a>
</div> </div>
<div id="scenesContent" class="detailSectionContent smallItemsContainer"></div> <div id="scenesContent" class="detailSectionContent smallItemsContainer"></div>
</div> </div>

View file

@ -1,6 +1,8 @@
(function ($, document) { (function ($, document) {
function loadSections(page, userId) { function loadSections(page, user) {
var userId = user.Id;
var i, length; var i, length;
var sectionCount = 3; var sectionCount = 3;
@ -21,7 +23,7 @@
var latestMediElem = $('.section0', page); var latestMediElem = $('.section0', page);
Sections.loadRecentlyAdded(latestMediElem, userId, context).done(function () { Sections.loadRecentlyAdded(latestMediElem, user, context).done(function () {
$('h1', latestMediElem).addClass('firstListHeader'); $('h1', latestMediElem).addClass('firstListHeader');
}); });
@ -33,9 +35,9 @@
var page = this; var page = this;
var userId = Dashboard.getCurrentUserId(); Dashboard.getCurrentUser().done(function (user) {
loadSections(page, user);
loadSections(page, userId); });
}); });

View file

@ -119,7 +119,7 @@
}); });
} }
function loadRecentlyAdded(elem, userId, context) { function loadRecentlyAdded(elem, user, context) {
var options = { var options = {
@ -130,14 +130,18 @@
EnableImageTypes: "Primary,Backdrop,Banner,Thumb" EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
}; };
return ApiClient.getJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).done(function (items) { return ApiClient.getJSON(ApiClient.getUrl('Users/' + user.Id + '/Items/Latest', options)).done(function (items) {
var html = ''; var html = '';
if (items.length) { if (items.length) {
html += '<div>'; html += '<div>';
html += '<h1 style="display:inline-block; vertical-align:middle;" class="listHeader">' + Globalize.translate('HeaderLatestMedia') + '</h1>'; html += '<h1 style="display:inline-block; vertical-align:middle;" class="listHeader">' + Globalize.translate('HeaderLatestMedia') + '</h1>';
if (user.Policy.EnableUserPreferenceAccess) {
html += '<a href="mypreferencesdisplay.html" class="accentButton"><i class="fa fa-pencil"></i>' + Globalize.translate('ButtonEdit') + '</a>'; html += '<a href="mypreferencesdisplay.html" class="accentButton"><i class="fa fa-pencil"></i>' + Globalize.translate('ButtonEdit') + '</a>';
}
html += '</div>'; html += '</div>';
html += '<div class="itemsContainer">'; html += '<div class="itemsContainer">';
html += LibraryBrowser.getPosterViewHtml({ html += LibraryBrowser.getPosterViewHtml({
@ -192,7 +196,7 @@
}); });
} }
function loadLibraryTiles(elem, userId, shape, index, autoHideOnMobile, showTitles) { function loadLibraryTiles(elem, user, shape, index, autoHideOnMobile, showTitles) {
if (autoHideOnMobile) { if (autoHideOnMobile) {
$(elem).addClass('hiddenSectionOnMobile'); $(elem).addClass('hiddenSectionOnMobile');
@ -200,7 +204,7 @@
$(elem).removeClass('hiddenSectionOnMobile'); $(elem).removeClass('hiddenSectionOnMobile');
} }
getUserViews(userId).done(function (items) { getUserViews(user.Id).done(function (items) {
var html = ''; var html = '';
@ -210,7 +214,11 @@
html += '<div>'; html += '<div>';
html += '<h1 style="display:inline-block; vertical-align:middle;" class="' + cssClass + '">' + Globalize.translate('HeaderMyViews') + '</h1>'; html += '<h1 style="display:inline-block; vertical-align:middle;" class="' + cssClass + '">' + Globalize.translate('HeaderMyViews') + '</h1>';
if (user.Policy.EnableUserPreferenceAccess) {
html += '<a href="mypreferencesdisplay.html" class="accentButton"><i class="fa fa-pencil"></i>' + Globalize.translate('ButtonEdit') + '</a>'; html += '<a href="mypreferencesdisplay.html" class="accentButton"><i class="fa fa-pencil"></i>' + Globalize.translate('ButtonEdit') + '</a>';
}
html += '</div>'; html += '</div>';
html += '<div>'; html += '<div>';
@ -475,7 +483,9 @@
} }
function loadSection(page, userId, displayPreferences, index) { function loadSection(page, user, displayPreferences, index) {
var userId = user.Id;
var section = displayPreferences.CustomPrefs['home' + index] || getDefaultSection(index); var section = displayPreferences.CustomPrefs['home' + index] || getDefaultSection(index);
@ -484,19 +494,19 @@
var elem = $('.section' + index, page); var elem = $('.section' + index, page);
if (section == 'latestmedia') { if (section == 'latestmedia') {
Sections.loadRecentlyAdded(elem, userId); Sections.loadRecentlyAdded(elem, user);
} }
else if (section == 'librarytiles') { else if (section == 'librarytiles') {
Sections.loadLibraryTiles(elem, userId, 'backdrop', index, false, showLibraryTileNames); Sections.loadLibraryTiles(elem, user, 'backdrop', index, false, showLibraryTileNames);
} }
else if (section == 'smalllibrarytiles') { else if (section == 'smalllibrarytiles') {
Sections.loadLibraryTiles(elem, userId, 'homePageSmallBackdrop', index, false, showLibraryTileNames); Sections.loadLibraryTiles(elem, user, 'homePageSmallBackdrop', index, false, showLibraryTileNames);
} }
else if (section == 'smalllibrarytiles-automobile') { else if (section == 'smalllibrarytiles-automobile') {
Sections.loadLibraryTiles(elem, userId, 'homePageSmallBackdrop', index, true, showLibraryTileNames); Sections.loadLibraryTiles(elem, user, 'homePageSmallBackdrop', index, true, showLibraryTileNames);
} }
else if (section == 'librarytiles-automobile') { else if (section == 'librarytiles-automobile') {
Sections.loadLibraryTiles(elem, userId, 'backdrop', index, true, showLibraryTileNames); Sections.loadLibraryTiles(elem, user, 'backdrop', index, true, showLibraryTileNames);
} }
else if (section == 'librarybuttons') { else if (section == 'librarybuttons') {
Sections.loadlibraryButtons(elem, userId, index); Sections.loadlibraryButtons(elem, userId, index);
@ -521,7 +531,7 @@
} }
} }
function loadSections(page, userId, displayPreferences) { function loadSections(page, user, displayPreferences) {
var i, length; var i, length;
var sectionCount = 4; var sectionCount = 4;
@ -540,7 +550,7 @@
for (i = 0, length = sectionCount; i < length; i++) { for (i = 0, length = sectionCount; i < length; i++) {
loadSection(page, userId, displayPreferences, i); loadSection(page, user, displayPreferences, i);
} }
} }
@ -623,7 +633,11 @@
ApiClient.getDisplayPreferences('home', userId, 'webclient').done(function (result) { ApiClient.getDisplayPreferences('home', userId, 'webclient').done(function (result) {
showWelcomeIfNeeded(page, result); showWelcomeIfNeeded(page, result);
loadSections(page, userId, result);
Dashboard.getCurrentUser().done(function (user) {
loadSections(page, user, result);
});
}); });
}); });

View file

@ -101,6 +101,12 @@
} else { } else {
$('.btnMoreCommands', page).show(); $('.btnMoreCommands', page).show();
} }
if (user.Policy.IsAdministrator) {
$('.chapterSettingsButton', page).show();
} else {
$('.chapterSettingsButton', page).hide();
}
}); });
if (item.LocationType == "Offline") { if (item.LocationType == "Offline") {