1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
This commit is contained in:
Techywarrior 2013-03-28 22:52:21 -07:00
commit f3bdc1163e
5 changed files with 90 additions and 23 deletions

View file

@ -5,9 +5,7 @@
</head> </head>
<body> <body>
<div id="itemByNameDetailPage" data-role="page" class="page libraryPage" data-theme="a"> <div id="itemByNameDetailPage" data-role="page" class="page libraryPage" data-theme="a">
<div data-role="content" style="padding-top: 0;"> <div data-role="content">
<h1 id="itemName" style="padding-left: 10px; margin: 0;"></h1>
<div style="padding: 10px;"> <div style="padding: 10px;">
<div class="itemImageBlock"> <div class="itemImageBlock">
@ -17,6 +15,7 @@
</div> </div>
<div class="itemDetailBlock"> <div class="itemDetailBlock">
<h1 id="itemName" style="margin-top: 0;"></h1>
<p id="itemOverview"></p> <p id="itemOverview"></p>
</div> </div>

View file

@ -6,17 +6,62 @@
<body> <body>
<div id="itemListPage" data-role="page" class="page libraryPage" data-theme="a"> <div id="itemListPage" data-role="page" class="page libraryPage" data-theme="a">
<div data-role="content" class="itemListContent"> <div data-role="content" class="itemListContent">
<div style="text-align: right;">
<button type="button" onclick="$( '#optionsPanel', $.mobile.activePage ).panel( 'open' );" data-mini="true" data-inline="true">Options</button>
</div>
<h1 id="itemName" class="listHeader"></h1>
<h1 class="listHeader" style="margin-top: 0;">
<span id="itemName"></span>
<div style="display: inline-block; margin-left: 50px;">
<button id="btnSort" type="button" data-icon="sort" data-mini="true" data-inline="true" onclick="$('#sortPanel', $.mobile.activePage).panel( 'toggle' );">Sort</button>
</div>
</h1>
<div id="listItems"></div> <div id="listItems"></div>
</div>
<div data-role="panel" id="optionsPanel" data-position="right" data-display="overlay" data-position-fixed="true" data-theme="a"> <div data-role="panel" id="sortPanel" data-position="right" data-display="overlay" data-theme="b" data-position-fixed="true">
<div>Panel content</div>
<form>
<fieldset data-role="controlgroup">
<legend>
<h3>Sort By:</h3>
</legend>
<input data-theme="c" type="radio" name="radioSortBy" id="radio-choice-v-2a" value="on" checked="checked">
<label for="radio-choice-v-2a" onclick="ItemListPage.sortBy('SortName');">Name</label>
<input data-theme="c" type="radio" name="radioSortBy" id="radioCommunityRating" value="other">
<label for="radioCommunityRating" onclick="ItemListPage.sortBy('CommunityRating');">Community Rating</label>
<input data-theme="c" type="radio" name="radioSortBy" id="radio-choice-v-2c" value="other">
<label for="radio-choice-v-2c" onclick="ItemListPage.sortBy('DateCreated');">Date Added</label>
<input data-theme="c" type="radio" name="radioSortBy" id="radioDatePlayed" value="other">
<label for="radioDatePlayed" onclick="ItemListPage.sortBy('DatePlayed');">Date Played</label>
<input data-theme="c" type="radio" name="radioSortBy" id="radioPremiereDate" value="other">
<label for="radioPremiereDate" onclick="ItemListPage.sortBy('PremiereDate');">Date Released</label>
<input data-theme="c" type="radio" name="radioSortBy" id="radio-choice-v-2b" value="off">
<label for="radio-choice-v-2b" onclick="ItemListPage.sortBy('Random');">Random</label>
<input data-theme="c" type="radio" name="radioSortBy" id="radioRuntime" value="off">
<label for="radioRuntime" onclick="ItemListPage.sortBy('Runtime');">Runtime</label>
</fieldset>
<fieldset data-role="controlgroup">
<legend>
<h3>Sort Order:</h3>
</legend>
<input data-theme="c" type="radio" name="radioSortOrder" id="radioAscending" value="on" checked="checked">
<label for="radioAscending" onclick="ItemListPage.sortOrder('Ascending');">Ascending</label>
<input data-theme="c" type="radio" name="radioSortOrder" id="radioDescending" value="other">
<label for="radioDescending" onclick="ItemListPage.sortOrder('Descending');">Descending</label>
</fieldset>
</form>
</div>
</div> </div>
</div> </div>
</body> </body>

View file

@ -152,7 +152,7 @@
if (userId) { if (userId) {
Dashboard.alert("Settings saved."); Dashboard.alert("Settings saved.");
} else { } else {
Dashboard.navigate("userProfiles.html"); Dashboard.navigate("userprofiles.html");
} }
}, },

View file

@ -7,23 +7,32 @@
reload: function () { reload: function () {
var userId = Dashboard.getCurrentUserId();
var parentId = getParameterByName('parentId'); var parentId = getParameterByName('parentId');
var query = { var query = {
SortBy: "SortName", Fields: "PrimaryImageAspectRatio",
SortBy: "SortName"
Fields: "PrimaryImageAspectRatio"
}; };
if (parentId) { if (parentId) {
query.parentId = parentId; query.parentId = parentId;
ApiClient.getItem(userId, parentId).done(ItemListPage.renderTitle); ApiClient.getItem(Dashboard.getCurrentUserId(), parentId).done(ItemListPage.renderTitle);
} }
ApiClient.getItems(userId, query).done(ItemListPage.renderItems); ItemListPage.refreshItems(query);
},
refreshItems: function (query) {
var page = $.mobile.activePage;
page.itemQuery = query;
$('#btnSort', page).html(query.SortBy).button("refresh");
ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(ItemListPage.renderItems);
}, },
renderItems: function (result) { renderItems: function (result) {
@ -45,6 +54,20 @@
$('#itemName', $.mobile.activePage).html(item.Name); $('#itemName', $.mobile.activePage).html(item.Name);
},
sortBy: function (sortBy) {
var query = $.mobile.activePage.itemQuery;
query.SortBy = sortBy;
ItemListPage.refreshItems(query);
},
sortOrder: function (order) {
var query = $.mobile.activePage.itemQuery;
query.SortOrder = order;
ItemListPage.refreshItems(query);
} }
}; };

View file

@ -434,7 +434,7 @@ var Dashboard = {
var hasPrimaryImage = item.ImageTags && item.ImageTags.Primary; var hasPrimaryImage = item.ImageTags && item.ImageTags.Primary;
var href = item.IsFolder ? (item.Id ? "itemList.html?parentId=" + item.Id : "#") : "itemDetails.html?id=" + item.Id; var href = item.IsFolder ? (item.Id ? "itemList.html?parentId=" + item.Id : "#") : "itemdetails.html?id=" + item.Id;
var showText = options.showTitle || !hasPrimaryImage || (item.Type !== 'Movie' && item.Type !== 'Series' && item.Type !== 'Season' && item.Type !== 'Trailer'); var showText = options.showTitle || !hasPrimaryImage || (item.Type !== 'Movie' && item.Type !== 'Series' && item.Type !== 'Season' && item.Type !== 'Trailer');
@ -539,7 +539,7 @@ var Dashboard = {
html += '<img style="max-height:125px;max-width:200px;" src="' + imageUrl + '" />'; html += '<img style="max-height:125px;max-width:200px;" src="' + imageUrl + '" />';
html += '</p>'; html += '</p>';
html += '<p><button type="button" onclick="Dashboard.navigate(\'editUser.html?userId=' + user.Id + '\');" data-icon="user">View Profile</button></p>'; html += '<p><button type="button" onclick="Dashboard.navigate(\'edituser.html?userId=' + user.Id + '\');" data-icon="user">View Profile</button></p>';
html += '<p><button type="button" onclick="Dashboard.logout();" data-icon="lock">Sign Out</button></p>'; html += '<p><button type="button" onclick="Dashboard.logout();" data-icon="lock">Sign Out</button></p>';
html += '</div>'; html += '</div>';
@ -859,11 +859,11 @@ var Dashboard = {
selected: page.hasClass("pluginConfigurationPage") selected: page.hasClass("pluginConfigurationPage")
}, { }, {
name: "User Profiles", name: "User Profiles",
href: "userProfiles.html", href: "userprofiles.html",
selected: page.hasClass("userProfilesConfigurationPage") selected: page.hasClass("userProfilesConfigurationPage")
}, { }, {
name: "Display Settings", name: "Display Settings",
href: "uiSettings.html", href: "uisettings.html",
selected: pageElem.id == "displaySettingsPage" selected: pageElem.id == "displaySettingsPage"
}, { }, {
name: "Advanced", name: "Advanced",
@ -871,7 +871,7 @@ var Dashboard = {
selected: pageElem.id == "advancedConfigurationPage" selected: pageElem.id == "advancedConfigurationPage"
}, { }, {
name: "Scheduled Tasks", name: "Scheduled Tasks",
href: "scheduledTasks.html", href: "scheduledtasks.html",
selected: pageElem.id == "scheduledTasksPage" || pageElem.id == "scheduledTaskPage" selected: pageElem.id == "scheduledTasksPage" || pageElem.id == "scheduledTaskPage"
}, { }, {
name: "Help", name: "Help",