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-04-03 23:17:27 -07:00
commit af156714ee
6 changed files with 181 additions and 184 deletions

View file

@ -572,9 +572,12 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
/** /**
* Gets a list of plugins that are available to be installed * Gets a list of plugins that are available to be installed
*/ */
self.getAvailablePlugins = function () { self.getAvailablePlugins = function (options) {
var url = self.getUrl("Packages", { PackageType: "UserInstalled" }); options = $.extend({}, options || {});
options.PackageType = "UserInstalled";
var url = self.getUrl("Packages", options);
return self.ajax({ return self.ajax({
type: "GET", type: "GET",

View file

@ -1,77 +1,77 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>Media Browser</title> <title>Media Browser</title>
</head> </head>
<body> <body>
<div id="boxsetsPage" data-role="page" class="page libraryPage noLogoPage" data-theme="a"> <div id="boxsetsPage" data-role="page" class="page libraryPage noLogoPage" data-theme="a">
<h1 class="libraryPageHeader"><a href="index.html" class="imageLink"> <h1 class="libraryPageHeader"><a href="index.html" class="imageLink">
<img src="css/images/home.png"></a>Box Sets</h1> <img src="css/images/home.png"></a>Movies</h1>
<div data-role="content"> <div data-role="content">
<div data-role="controlgroup" data-type="horizontal" class="libraryViewNav" data-mini="true"> <div data-role="controlgroup" data-type="horizontal" class="libraryViewNav" data-mini="true">
<a href="moviesrecommended.html" data-role="button">Recommended</a> <a href="moviesrecommended.html" data-role="button">Recommended</a>
<a href="movies.html" data-role="button" class="ui-btn-active">Movies</a> <a href="movies.html" data-role="button">Movies</a>
<a href="boxsets.html" data-role="button">Box Sets</a> <a href="boxsets.html" data-role="button" class="ui-btn-active">Box Sets</a>
<a href="#" data-role="button">Genres</a> <a href="#" data-role="button">Genres</a>
<a href="#" data-role="button">Actors</a> <a href="#" data-role="button">Actors</a>
<a href="#" data-role="button">Directors</a> <a href="#" data-role="button">Directors</a>
</div> </div>
<div class="viewSettings"> <div class="viewSettings">
<button data-mini="true" data-icon="sort" data-inline="true" onclick="$('#sortPanel', $.mobile.activePage).panel( 'toggle' );">Sort</button> <button data-mini="true" data-icon="sort" data-inline="true" onclick="$('#sortPanel', $.mobile.activePage).panel( 'toggle' );">Sort</button>
<button data-mini="true" data-icon="filter" data-inline="true" onclick="$('#filterPanel', $.mobile.activePage).panel( 'toggle' );">Filter</button> <button data-mini="true" data-icon="filter" data-inline="true" onclick="$('#filterPanel', $.mobile.activePage).panel( 'toggle' );">Filter</button>
</div> </div>
<div id="items"></div> <div id="items"></div>
</div> </div>
<div data-role="panel" id="sortPanel" data-position="right" data-display="overlay" data-theme="b" data-position-fixed="true"> <div data-role="panel" id="sortPanel" data-position="right" data-display="overlay" data-theme="b" data-position-fixed="true">
<form> <form>
<div id="sortpanel"> <div id="sortpanel">
<fieldset data-role="controlgroup"> <fieldset data-role="controlgroup">
<legend> <legend>
<h3>Sort By:</h3> <h3>Sort By:</h3>
</legend> </legend>
<input class="radioSortBy" data-theme="c" type="radio" name="radioSortBy" id="radioSortName" value="on" checked="checked" data-sortby="SortName"> <input class="radioSortBy" data-theme="c" type="radio" name="radioSortBy" id="radioSortName" value="on" checked="checked" data-sortby="SortName">
<label for="radioSortName">Name</label> <label for="radioSortName">Name</label>
<input class="radioSortBy" data-theme="c" type="radio" name="radioSortBy" id="radioCommunityRating" value="off" data-sortby="CommunityRating"> <input class="radioSortBy" data-theme="c" type="radio" name="radioSortBy" id="radioCommunityRating" value="off" data-sortby="CommunityRating">
<label for="radioCommunityRating">Community Rating</label> <label for="radioCommunityRating">Community Rating</label>
<input class="radioSortBy" data-theme="c" type="radio" name="radioSortBy" id="radioDateCreated" value="off" data-sortby="DateCreated"> <input class="radioSortBy" data-theme="c" type="radio" name="radioSortBy" id="radioDateCreated" value="off" data-sortby="DateCreated">
<label for="radioDateCreated">Date Added</label> <label for="radioDateCreated">Date Added</label>
</fieldset> </fieldset>
<fieldset data-role="controlgroup"> <fieldset data-role="controlgroup">
<legend> <legend>
<h3>Sort Order:</h3> <h3>Sort Order:</h3>
</legend> </legend>
<input class="radioSortOrder" data-theme="c" type="radio" name="radioSortOrder" id="radioAscending" value="on" checked="checked" data-sortorder="Ascending"> <input class="radioSortOrder" data-theme="c" type="radio" name="radioSortOrder" id="radioAscending" value="on" checked="checked" data-sortorder="Ascending">
<label for="radioAscending">Ascending</label> <label for="radioAscending">Ascending</label>
<input class="radioSortOrder" data-theme="c" type="radio" name="radioSortOrder" id="radioDescending" value="off" data-sortorder="Descending"> <input class="radioSortOrder" data-theme="c" type="radio" name="radioSortOrder" id="radioDescending" value="off" data-sortorder="Descending">
<label for="radioDescending">Descending</label> <label for="radioDescending">Descending</label>
</fieldset> </fieldset>
</div> </div>
</form> </form>
</div> </div>
<div data-role="panel" id="filterPanel" data-position="right" data-display="overlay" data-theme="b" data-position-fixed="true"> <div data-role="panel" id="filterPanel" data-position="right" data-display="overlay" data-theme="b" data-position-fixed="true">
<form> <form>
<fieldset data-role="controlgroup"> <fieldset data-role="controlgroup">
<legend> <legend>
<h3>Filters:</h3> <h3>Filters:</h3>
</legend> </legend>
<input class="chkStandardFilter" type="checkbox" name="chkIsFavorite" id="chkIsFavorite" data-theme="c" data-filter="IsFavorite"> <input class="chkStandardFilter" type="checkbox" name="chkIsFavorite" id="chkIsFavorite" data-theme="c" data-filter="IsFavorite">
<label for="chkIsFavorite">Favorite</label> <label for="chkIsFavorite">Favorite</label>
<input class="chkStandardFilter" type="checkbox" name="chkLikes" id="chkLikes" data-theme="c" data-filter="Likes"> <input class="chkStandardFilter" type="checkbox" name="chkLikes" id="chkLikes" data-theme="c" data-filter="Likes">
<label for="chkLikes">Likes</label> <label for="chkLikes">Likes</label>
<input class="chkStandardFilter" type="checkbox" name="chkDislikes" id="chkDislikes" data-theme="c" data-filter="Dislikes"> <input class="chkStandardFilter" type="checkbox" name="chkDislikes" id="chkDislikes" data-theme="c" data-filter="Dislikes">
<label for="chkDislikes">Dislikes</label> <label for="chkDislikes">Dislikes</label>
</fieldset> </fieldset>
</form> </form>
</div> </div>
</div> </div>
</body> </body>
</html> </html>

View file

@ -8,44 +8,44 @@
<div data-role="content"> <div data-role="content">
<div class="content-primary"> <div class="content-primary">
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true"> <div data-role="controlgroup" data-type="horizontal" data-mini="true">
<a href="plugins.html" data-role="button">Installed Plugins</a> <a href="plugins.html" data-role="button">Installed Plugins</a>
<a href="plugincatalog.html" data-role="button" class="ui-btn-active">Plugin Catalog</a> <a href="plugincatalog.html" data-role="button" class="ui-btn-active">Plugin Catalog</a>
<a href="pluginupdates.html" data-role="button">Automatic Updates</a> <a href="pluginupdates.html" data-role="button">Automatic Updates</a>
</div> </div>
<div class="viewSettings"> <div class="viewSettings">
<button data-mini="true" data-icon="filter" data-inline="true" onclick="$('#filterPanel', $.mobile.activePage).panel( 'toggle' );">Filter</button> <button data-mini="true" data-icon="filter" data-inline="true" onclick="$('#filterPanel', $.mobile.activePage).panel( 'toggle' );">Filter</button>
</div> </div>
<div id="pluginTiles"></div> <div id="pluginTiles"></div>
</div> </div>
</div> </div>
<div data-role="panel" id="filterPanel" data-position="right" data-display="overlay" data-theme="b" data-position-fixed="true"> <div data-role="panel" id="filterPanel" data-position="right" data-display="overlay" data-theme="b" data-position-fixed="true">
<form> <form>
<fieldset data-role="controlgroup"> <fieldset data-role="controlgroup">
<legend> <legend>
<h3>Application:</h3> <h3>Application:</h3>
</legend> </legend>
<input class="chkStandardFilter" type="checkbox" name="chkServer" id="chkServer" data-theme="c" data-filter="Server"> <input class="chkStandardFilter" type="checkbox" name="chkServer" id="chkServer" data-theme="c" data-filter="Server">
<label for="chkServer">Media Browser Server</label> <label for="chkServer">MB Server</label>
<input class="chkStandardFilter" type="checkbox" name="chkTheatre" id="chkTheatre" data-theme="c" data-filter="MBTheatre"> <input class="chkStandardFilter" type="checkbox" name="chkTheatre" id="chkTheatre" data-theme="c" data-filter="MBTheater">
<label for="chkTheatre">Media Browser Theatre</label> <label for="chkTheatre">MB Theater</label>
<input class="chkStandardFilter" type="checkbox" name="chkClassic" id="chkClassic" data-theme="c" data-filter="MBClassic"> <input class="chkStandardFilter" type="checkbox" name="chkClassic" id="chkClassic" data-theme="c" data-filter="MBClassic">
<label for="chkClassic">Media Browser Classic</label> <label for="chkClassic">MB Classic</label>
</fieldset> </fieldset>
<fieldset data-role="controlgroup"> <fieldset data-role="controlgroup">
<legend> <legend>
<h3> </h3> <h3>Pricing:</h3>
</legend> </legend>
<input class="chkPremiumFilter" type="checkbox" name="chkPremium" id="chkPremium" data-theme="c" data-filter="IsPremium"> <input class="chkPremiumFilter" type="checkbox" name="chkPremium" id="chkPremium" data-theme="c" data-filter="IsPremium">
<label for="chkPremium">Premium</label> <label for="chkPremium">Premium</label>
</fieldset> </fieldset>
</form> </form>
</div> </div>
</div> </div>
</body> </body>
</html> </html>

View file

@ -1,139 +1,133 @@
(function ($, document) { (function ($, document) {
// The base query options // The base query options
var query = { var query = {
IsPremium: false, };
TargetSystems: ""
};
function reloadList() { function reloadList(page) {
Dashboard.showLoadingMsg(); Dashboard.showLoadingMsg();
var promise1 = ApiClient.getAvailablePlugins(query); var promise1 = ApiClient.getAvailablePlugins(query);
var promise2 = ApiClient.getInstalledPlugins(); var promise2 = ApiClient.getInstalledPlugins();
$.when(promise1, promise2).done(function (response1, response2) { $.when(promise1, promise2).done(function (response1, response2) {
populateList(response1[0], response2[0]); populateList(page, response1[0], response2[0]);
}); });
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
} }
function populateList(availablePlugins, installedPlugins) { function populateList(page, availablePlugins, installedPlugins) {
var page = $($.mobile.activePage); availablePlugins = availablePlugins.filter(function (p) {
availablePlugins = availablePlugins.filter(function (p) { return p.type == "UserInstalled";
return p.type == "UserInstalled"; }).sort(function (a, b) {
}).sort(function (a, b) { return a.name > b.name ? 1 : -1;
return a.name > b.name ? 1 : -1; });
});
var html = ""; var html = "";
for (var i = 0, length = availablePlugins.length; i < length; i++) { for (var i = 0, length = availablePlugins.length; i < length; i++) {
var plugin = availablePlugins[i]; var plugin = availablePlugins[i];
html += "<div class='posterViewItem'><a href='addPlugin.html?name=" + encodeURIComponent(plugin.name) + "'>"; html += "<div class='posterViewItem'><a href='addPlugin.html?name=" + encodeURIComponent(plugin.name) + "'>";
if (plugin.thumbImage) { if (plugin.thumbImage) {
html += "<img src='" + plugin.thumbImage + "' />"; html += "<img src='" + plugin.thumbImage + "' />";
} else { } else {
html += "<img style='background:#444444;' src='css/images/items/list/collection.png' />"; html += "<img style='background:#444444;' src='css/images/items/list/collection.png' />";
} }
if (plugin.isPremium) { if (plugin.isPremium) {
if (plugin.price > 0) { if (plugin.price > 0) {
html += "<div class='premiumBanner'><img src='css/images/supporter/premiumflag.png' /></div>"; html += "<div class='premiumBanner'><img src='css/images/supporter/premiumflag.png' /></div>";
} else { } else {
html += "<div class='premiumBanner'><img src='css/images/supporter/supporterflag.png' /></div>"; html += "<div class='premiumBanner'><img src='css/images/supporter/supporterflag.png' /></div>";
} }
} }
var color = plugin.tileColor || LibraryBrowser.getMetroColor(plugin.name); var color = plugin.tileColor || LibraryBrowser.getMetroColor(plugin.name);
html += "<div class='posterViewItemText' style='background:" + color + "'>"; html += "<div class='posterViewItemText' style='background:" + color + "'>";
var installedPlugin = installedPlugins.filter(function (ip) { var installedPlugin = installedPlugins.filter(function (ip) {
return ip.Name == plugin.name; return ip.Name == plugin.name;
})[0]; })[0];
html += "<div>"; html += "<div>";
if (installedPlugin) { if (installedPlugin) {
html += plugin.name + " (Installed)"; html += plugin.name + " (Installed)";
} else { } else {
html += plugin.name; html += plugin.name;
} }
html += "</div>"; html += "</div>";
html += "</div>"; html += "</div>";
html += "</a></div>"; html += "</a></div>";
} }
$('#pluginTiles', page).html(html); $('#pluginTiles', page).html(html);
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
} }
$(document).on('pageinit', "#pluginCatalogPage", function () { $(document).on('pageinit', "#pluginCatalogPage", function () {
var page = this; var page = this;
$('.chkStandardFilter', this).on('change', function () {
$('.chkStandardFilter', this).on('change', function () { var filterName = this.getAttribute('data-filter');
var filters = query.TargetSystems || "";
var filterName = this.getAttribute('data-filter'); filters = (',' + filters).replace(',' + filterName, '').substring(1);
var filters = query.TargetSystems || "";
filters = (',' + filters).replace(',' + filterName, '').substring(1); if (this.checked) {
filters = filters ? (filters + ',' + filterName) : filterName;
}
if (this.checked) { query.TargetSystems = filters;
filters = filters ? (filters + ',' + filterName) : filterName;
}
query.TargetSystems = filters; reloadList(page);
});
reloadList(); $('.chkPremiumFilter', this).on('change', function () {
});
$('.chkPremiumFilter', this).on('change', function () { if (this.checked) {
query.IsPremium = true;
} else {
query.IsPremium = null;
}
var filterName = this.getAttribute('data-filter'); reloadList(page);
});
if (this.checked) { }).on('pageshow', "#pluginCatalogPage", function () {
query.IsPremium = true;
}else {
query.IsPremium = false;
}
reloadList(); reloadList(this);
});
}).on('pageshow', "#pluginCatalogPage", function () { // Reset form values using the last used query
reloadList(); $('.chkStandardFilter', this).each(function () {
// Reset form values using the last used query var filters = "," + (query.TargetSystems || "");
var filterName = this.getAttribute('data-filter');
$('.chkStandardFilter', this).each(function () { this.checked = filters.indexOf(',' + filterName) != -1;
var filters = "," + (query.TargetSystems || ""); }).checkboxradio('refresh');
var filterName = this.getAttribute('data-filter');
this.checked = filters.indexOf(',' + filterName) != -1; $('.chkPremiumFilter', this).each(function () {
}).checkboxradio('refresh'); var filters = query.IsPremium || false;
$('.chkPremiumFilter', this).each(function () { this.checked = filters;
var filters = query.IsPremium || false; }).checkboxradio('refresh');
});
this.checked = filters;
}).checkboxradio('refresh');
});
})(jQuery, document); })(jQuery, document);

View file

@ -1009,7 +1009,7 @@ var Dashboard = {
type: "Primary" type: "Primary"
}); });
if (!item.Id || !data.icon) { if (!item.Id || !data.icon || data.icon == "undefined") {
alert("bad image url: " + JSON.stringify(item)); alert("bad image url: " + JSON.stringify(item));
console.log("bad image url: " + JSON.stringify(item)); console.log("bad image url: " + JSON.stringify(item));

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.70" targetFramework="net45" /> <package id="MediaBrowser.ApiClient.Javascript" version="3.0.71" targetFramework="net45" />
<package id="ServiceStack.Common" version="3.9.42" targetFramework="net45" /> <package id="ServiceStack.Common" version="3.9.43" targetFramework="net45" />
<package id="ServiceStack.Text" version="3.9.42" targetFramework="net45" /> <package id="ServiceStack.Text" version="3.9.43" targetFramework="net45" />
</packages> </packages>