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

support video_ts.nfo

This commit is contained in:
Luke Pulverenti 2015-05-15 11:46:20 -04:00
parent 4b2be0b97a
commit 91f96dbe68
42 changed files with 343 additions and 510 deletions

View file

@ -80,10 +80,6 @@
margin: 8px; margin: 8px;
} }
.largeCardMargin .visualCardBox {
margin: 12px;
}
.ui-page-theme-b .visualCardBox { .ui-page-theme-b .visualCardBox {
background: rgba(45,45,45,.85); background: rgba(45,45,45,.85);
border-radius: 3px; border-radius: 3px;

View file

@ -1565,16 +1565,14 @@ span.itemCommunityRating:not(:empty) + .userDataIcons {
.detailsMenuButtonContainer { .detailsMenuButtonContainer {
display: inline-block; display: inline-block;
margin-left: .5em;
margin-right: .5em;
} }
.detailsMenuButtonContainer span { .detailsMenuButtonContainer span {
padding-left: 1em; padding-left: 1em;
} }
.detailsMenuButtonContainer + .detailsMenuButtonContainer {
margin-left: 1em;
}
.detailsMenu h3 { .detailsMenu h3 {
padding: 0 30px; padding: 0 30px;
} }
@ -1586,7 +1584,18 @@ span.itemCommunityRating:not(:empty) + .userDataIcons {
} }
.detailsMenuOverview { .detailsMenuOverview {
max-height: 120px; max-height: 60px;
}
}
@media all and (min-height:540px) {
.detailsMenuContentInner {
height: 340px;
}
.detailsMenuOverview {
max-height: 100px;
} }
} }
@ -1597,6 +1606,6 @@ span.itemCommunityRating:not(:empty) + .userDataIcons {
} }
.detailsMenuOverview { .detailsMenuOverview {
max-height: 220px; max-height: 160px;
} }
} }

View file

@ -4,7 +4,7 @@
<title>${TitleDevices}</title> <title>${TitleDevices}</title>
</head> </head>
<body> <body>
<div id="devicePage" data-role="page" class="page type-interior devicesPage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Devices"> <div id="devicePage" data-role="page" class="page type-interior devicesPage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Devices" data-require="scripts/device">
<div data-role="content"> <div data-role="content">
<div class="content-primary"> <div class="content-primary">
@ -54,9 +54,6 @@
</div> </div>
</div> </div>
</div> </div>
<script type="text/javascript">
$('.deviceForm').off('submit', DevicePage.onSubmit).on('submit', DevicePage.onSubmit);
</script>
</div> </div>
</body> </body>
</html> </html>

View file

@ -4,7 +4,7 @@
<title>${TitleDevices}</title> <title>${TitleDevices}</title>
</head> </head>
<body> <body>
<div id="devicesPage" data-role="page" class="page type-interior devicesPage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Devices"> <div id="devicesPage" data-role="page" class="page type-interior devicesPage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Devices" data-require="scripts/devices">
<div data-role="content"> <div data-role="content">
<div class="content-primary"> <div class="content-primary">

View file

@ -4,7 +4,7 @@
<title>Emby</title> <title>Emby</title>
</head> </head>
<body> <body>
<div id="episodesPage" data-role="page" class="page libraryPage"> <div id="episodesPage" data-role="page" class="page libraryPage" data-require="scripts/episodes">
<div class="libraryViewNav scopedLibraryViewNav"> <div class="libraryViewNav scopedLibraryViewNav">
<a href="tvrecommended.html">${TabSuggestions}</a> <a href="tvrecommended.html">${TabSuggestions}</a>

View file

@ -4,7 +4,7 @@
<title>Emby</title> <title>Emby</title>
</head> </head>
<body> <body>
<div id="gameGenresPage" data-role="page" class="page libraryPage listPage"> <div id="gameGenresPage" data-role="page" class="page libraryPage listPage" data-require="scripts/gamegenrepage">
<div class="libraryViewNav scopedLibraryViewNav"> <div class="libraryViewNav scopedLibraryViewNav">
<a href="gamesrecommended.html">${TabSuggestions}</a> <a href="gamesrecommended.html">${TabSuggestions}</a>
<a href="games.html">${TabGames}</a> <a href="games.html">${TabGames}</a>

View file

@ -4,7 +4,7 @@
<title>Emby</title> <title>Emby</title>
</head> </head>
<body> <body>
<div id="gamesPage" data-role="page" class="page libraryPage listPage"> <div id="gamesPage" data-role="page" class="page libraryPage listPage" data-require="scripts/gamespage">
<div class="libraryViewNav scopedLibraryViewNav"> <div class="libraryViewNav scopedLibraryViewNav">
<a href="gamesrecommended.html">${TabSuggestions}</a> <a href="gamesrecommended.html">${TabSuggestions}</a>
<a href="#" class="ui-btn-active">${TabGames}</a> <a href="#" class="ui-btn-active">${TabGames}</a>

View file

@ -4,7 +4,7 @@
<title>Emby</title> <title>Emby</title>
</head> </head>
<body> <body>
<div id="gamesRecommendedPage" data-role="page" class="page libraryPage backdropPage" data-backdroptype="game"> <div id="gamesRecommendedPage" data-role="page" class="page libraryPage backdropPage" data-backdroptype="game" data-require="scripts/gamesrecommendedpage">
<div class="libraryViewNav scopedLibraryViewNav"> <div class="libraryViewNav scopedLibraryViewNav">
<a href="#" class="ui-btn-active">${TabSuggestions}</a> <a href="#" class="ui-btn-active">${TabSuggestions}</a>
<a href="games.html">${TabGames}</a> <a href="games.html">${TabGames}</a>

View file

@ -4,7 +4,7 @@
<title>Emby</title> <title>Emby</title>
</head> </head>
<body> <body>
<div id="gameStudiosPage" data-role="page" class="page libraryPage listPage"> <div id="gameStudiosPage" data-role="page" class="page libraryPage listPage" data-require="scripts/gamestudiospage">
<div class="libraryViewNav scopedLibraryViewNav"> <div class="libraryViewNav scopedLibraryViewNav">
<a href="gamesrecommended.html">${TabSuggestions}</a> <a href="gamesrecommended.html">${TabSuggestions}</a>
<a href="games.html">${TabGames}</a> <a href="games.html">${TabGames}</a>

View file

@ -4,7 +4,7 @@
<title>Emby</title> <title>Emby</title>
</head> </head>
<body> <body>
<div id="gamesystemsPage" data-role="page" class="page libraryPage backdropPage" data-backdroptype="gamesystem"> <div id="gamesystemsPage" data-role="page" class="page libraryPage backdropPage" data-backdroptype="gamesystem" data-require="scripts/gamesystemspage">
<div class="libraryViewNav scopedLibraryViewNav"> <div class="libraryViewNav scopedLibraryViewNav">
<a href="gamesrecommended.html">${TabSuggestions}</a> <a href="gamesrecommended.html">${TabSuggestions}</a>
<a href="games.html">${TabGames}</a> <a href="games.html">${TabGames}</a>

View file

@ -4,7 +4,7 @@
<title></title> <title></title>
</head> </head>
<body> <body>
<div id="itemListPage" data-role="page" class="page libraryPage folderListPage noSecondaryNavPage"> <div id="itemListPage" data-role="page" class="page libraryPage folderListPage noSecondaryNavPage" data-require="scripts/itemlistpage">
<div class="alphabetPicker"> <div class="alphabetPicker">
</div> </div>
<div data-role="content" class="itemListContent"> <div data-role="content" class="itemListContent">

View file

@ -4,7 +4,7 @@
<title>Emby</title> <title>Emby</title>
</head> </head>
<body> <body>
<div id="musicGenresPage" data-role="page" class="page libraryPage"> <div id="musicGenresPage" data-role="page" class="page libraryPage" data-require="scripts/musicgenres">
<div class="libraryViewNav scopedLibraryViewNav"> <div class="libraryViewNav scopedLibraryViewNav">
<a href="musicrecommended.html">${TabSuggestions}</a> <a href="musicrecommended.html">${TabSuggestions}</a>
<a href="songs.html" class="musicSongsTab">${TabSongs}</a> <a href="songs.html" class="musicSongsTab">${TabSongs}</a>

View file

@ -4,7 +4,7 @@
<title>Emby</title> <title>Emby</title>
</head> </head>
<body> <body>
<div id="musicVideosPage" data-role="page" class="page libraryPage"> <div id="musicVideosPage" data-role="page" class="page libraryPage" data-require="scripts/musicvideos">
<div class="libraryViewNav scopedLibraryViewNav"> <div class="libraryViewNav scopedLibraryViewNav">
<a href="musicrecommended.html">${TabSuggestions}</a> <a href="musicrecommended.html">${TabSuggestions}</a>

View file

@ -16,7 +16,7 @@
}).fail(function () { }).fail(function () {
Dashboard.hideLoadingMsg(); Dashboard.hideModalLoadingMsg();
Dashboard.alert({ Dashboard.alert({
message: Globalize.translate('MessageInvalidUser'), message: Globalize.translate('MessageInvalidUser'),
@ -31,7 +31,7 @@
function handleConnectionResult(page, result) { function handleConnectionResult(page, result) {
Dashboard.hideLoadingMsg(); Dashboard.hideModalLoadingMsg();
switch (result.State) { switch (result.State) {
@ -46,7 +46,7 @@
break; break;
case MediaBrowser.ConnectionState.ServerSignIn: case MediaBrowser.ConnectionState.ServerSignIn:
{ {
window.location = 'login.html?serverid=' + result.Servers[0].Id; Dashboard.navigate('login.html?serverid=' + result.Servers[0].Id);
} }
break; break;
case MediaBrowser.ConnectionState.ServerSelection: case MediaBrowser.ConnectionState.ServerSelection:

View file

@ -49,7 +49,16 @@
}).done(Dashboard.processServerConfigurationUpdateResult); }).done(Dashboard.processServerConfigurationUpdateResult);
} }
$(document).on('pageinit', "#devicePage", function () { function onSubmit() {
var form = this;
var page = $(form).parents('.page');
save(page);
return false;
}
$(document).on('pageinitdepends', "#devicePage", function () {
var page = this; var page = this;
@ -71,25 +80,13 @@
}); });
}); });
$('.deviceForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshow', "#devicePage", function () { }).on('pageshown', "#devicePage", function () {
var page = this; var page = this;
loadData(page); loadData(page);
}); });
window.DevicePage = {
onSubmit: function () {
var form = this;
var page = $(form).parents('.page');
save(page);
return false;
}
};
})(); })();

View file

@ -89,7 +89,7 @@
}); });
} }
$(document).on('pageshow', "#devicesPage", function () { $(document).on('pageshown', "#devicesPage", function () {
var page = this; var page = this;

View file

@ -162,7 +162,7 @@
$('#selectPageSize', page).val(query.Limit).selectmenu('refresh'); $('#selectPageSize', page).val(query.Limit).selectmenu('refresh');
} }
$(document).on('pageinit', "#episodesPage", function () { $(document).on('pageinitdepends', "#episodesPage", function () {
var page = this; var page = this;
@ -327,7 +327,7 @@
reloadItems(page); reloadItems(page);
}); });
}).on('pagebeforeshow', "#episodesPage", function () { }).on('pageshown', "#episodesPage", function () {
var page = this; var page = this;
query.ParentId = LibraryMenu.getTopParentId(); query.ParentId = LibraryMenu.getTopParentId();
@ -368,9 +368,8 @@
} }
}); });
}).on('pageshow', "#episodesPage", function () {
updateFilterControls(this); updateFilterControls(this);
}); });
})(jQuery, document); })(jQuery, document);

View file

@ -69,7 +69,7 @@
$('#selectPageSize', page).val(query.Limit).selectmenu('refresh'); $('#selectPageSize', page).val(query.Limit).selectmenu('refresh');
} }
$(document).on('pageinit', "#gameGenresPage", function () { $(document).on('pageinitdepends', "#gameGenresPage", function () {
var page = this; var page = this;
@ -96,7 +96,7 @@
reloadItems(page); reloadItems(page);
}); });
}).on('pagebeforeshow', "#gameGenresPage", function () { }).on('pageshown', "#gameGenresPage", function () {
query.ParentId = LibraryMenu.getTopParentId(); query.ParentId = LibraryMenu.getTopParentId();
@ -112,8 +112,6 @@
reloadItems(this); reloadItems(this);
}).on('pageshow', "#gameGenresPage", function () {
updateFilterControls(this); updateFilterControls(this);
}); });

View file

@ -152,7 +152,7 @@
} }
} }
$(document).on('pageinit', "#gamesPage", function () { $(document).on('pageinitdepends', "#gamesPage", function () {
var page = this; var page = this;
@ -239,7 +239,7 @@
reloadItems(page); reloadItems(page);
}); });
}).on('pagebeforeshow', "#gamesPage", function () { }).on('pageshown', "#gamesPage", function () {
var page = this; var page = this;
query.ParentId = LibraryMenu.getTopParentId(); query.ParentId = LibraryMenu.getTopParentId();
@ -266,8 +266,6 @@
} }
}); });
}).on('pageshow', "#gamesPage", function () {
updateFilterControls(this); updateFilterControls(this);
}); });

View file

@ -1,6 +1,6 @@
(function ($, document) { (function ($, document) {
$(document).on('pagebeforeshow', "#gamesRecommendedPage", function () { $(document).on('pageshown', "#gamesRecommendedPage", function () {
var parentId = LibraryMenu.getTopParentId(); var parentId = LibraryMenu.getTopParentId();
var userId = Dashboard.getCurrentUserId(); var userId = Dashboard.getCurrentUserId();

View file

@ -71,7 +71,7 @@
$('#selectPageSize', page).val(query.Limit).selectmenu('refresh'); $('#selectPageSize', page).val(query.Limit).selectmenu('refresh');
} }
$(document).on('pageinit', "#gameStudiosPage", function () { $(document).on('pageinitdepends', "#gameStudiosPage", function () {
var page = this; var page = this;
@ -98,7 +98,7 @@
reloadItems(page); reloadItems(page);
}); });
}).on('pagebeforeshow', "#gameStudiosPage", function () { }).on('pageshown', "#gameStudiosPage", function () {
query.ParentId = LibraryMenu.getTopParentId(); query.ParentId = LibraryMenu.getTopParentId();
@ -114,8 +114,6 @@
reloadItems(this); reloadItems(this);
}).on('pageshow', "#gameStudiosPage", function () {
updateFilterControls(this); updateFilterControls(this);
}); });

View file

@ -52,7 +52,7 @@
// Reset form values using the last used query // Reset form values using the last used query
} }
$(document).on('pagebeforeshow', "#gamesystemsPage", function () { $(document).on('pageshown', "#gamesystemsPage", function () {
query.ParentId = LibraryMenu.getTopParentId(); query.ParentId = LibraryMenu.getTopParentId();
@ -68,8 +68,6 @@
reloadItems(this); reloadItems(this);
}).on('pageshow', "#gamesystemsPage", function () {
updateFilterControls(this); updateFilterControls(this);
}); });

View file

@ -181,7 +181,7 @@
} }
} }
$(document).on('pageinit', "#itemListPage", function () { $(document).on('pageinitdepends', "#itemListPage", function () {
var page = this; var page = this;
@ -250,7 +250,7 @@
$(page).on('click', '.mediaItem', onListItemClick); $(page).on('click', '.mediaItem', onListItemClick);
}).on('pageshow', "#itemListPage", function () { }).on('pageshown', "#itemListPage", function () {
var page = this; var page = this;

View file

@ -535,7 +535,7 @@
html += '</div>'; html += '</div>';
html += '<div class="detailsMenuContent" style="background-position:center center;background-repeat:no-repeat;background-size:cover;">'; html += '<div class="detailsMenuContent" style="background-position:center center;background-repeat:no-repeat;background-size:cover;">';
html += '<div style="padding:.5em 1em 1em;background:rgba(0,0,0,.80);" class="detailsMenuContentInner">'; html += '<div style="padding:.5em 1em 1em;background:rgba(10,10,10,.80);" class="detailsMenuContentInner">';
html += '</div>'; html += '</div>';
html += '</div>'; html += '</div>';
@ -594,7 +594,7 @@
var background = 'none'; var background = 'none';
if (!AppInfo.hasLowImageBandwidth) { if (AppInfo.enableDetailsMenuImages) {
var backdropUrl; var backdropUrl;
var screenWidth = $(window).width(); var screenWidth = $(window).width();
var backdropWidth = Math.min(screenWidth, 800); var backdropWidth = Math.min(screenWidth, 800);
@ -627,7 +627,7 @@
var headerHtml = LibraryBrowser.getPosterViewDisplayName(item); var headerHtml = LibraryBrowser.getPosterViewDisplayName(item);
$('.detailsMenuHeader', elem).removeClass('detailsMenuHeaderWithLogo'); $('.detailsMenuHeader', elem).removeClass('detailsMenuHeaderWithLogo');
if (!AppInfo.hasLowImageBandwidth) { if (AppInfo.enableDetailsMenuImages) {
var logoUrl; var logoUrl;

View file

@ -406,7 +406,8 @@
var options = { var options = {
Recursive: true, Recursive: true,
IncludeItemTypes: "BoxSet" IncludeItemTypes: "BoxSet",
SortBy: "SortName"
}; };
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) { ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {

View file

@ -93,7 +93,7 @@
$('#selectPageSize', page).val(query.Limit).selectmenu('refresh'); $('#selectPageSize', page).val(query.Limit).selectmenu('refresh');
} }
$(document).on('pageinit', "#musicGenresPage", function () { $(document).on('pageinitdepends', "#musicGenresPage", function () {
var page = this; var page = this;
@ -120,7 +120,7 @@
reloadItems(page); reloadItems(page);
}); });
}).on('pagebeforeshow', "#musicGenresPage", function () { }).on('pageshown', "#musicGenresPage", function () {
query.ParentId = LibraryMenu.getTopParentId(); query.ParentId = LibraryMenu.getTopParentId();
@ -136,8 +136,6 @@
reloadItems(this); reloadItems(this);
}).on('pageshow', "#musicGenresPage", function () {
updateFilterControls(this); updateFilterControls(this);
}); });

View file

@ -131,7 +131,7 @@
} }
} }
$(document).on('pageinit', "#musicVideosPage", function () { $(document).on('pageinitdepends', "#musicVideosPage", function () {
var page = this; var page = this;
@ -189,7 +189,7 @@
reloadItems(page); reloadItems(page);
}); });
}).on('pagebeforeshow', "#musicVideosPage", function () { }).on('pageshown', "#musicVideosPage", function () {
var page = this; var page = this;
@ -208,8 +208,6 @@
reloadItems(page); reloadItems(page);
}).on('pageshow', "#musicVideosPage", function () {
updateFilterControls(this); updateFilterControls(this);
}); });

View file

@ -95,29 +95,7 @@
}); });
} }
$(document).on('pageinit', "#serverSecurityPage", function () { function onSubmit() {
var page = this;
$('.btnNewKey', page).on('click', function () {
$('.newKeyPanel', page).panel('toggle');
$('#txtAppName', page).val('').focus();
});
}).on('pageshow', "#serverSecurityPage", function () {
var page = this;
loadData(page);
});
window.ServerSecurityPage = {
onSubmit: function(e) {
var form = this; var form = this;
var page = $(form).parents('.page'); var page = $(form).parents('.page');
@ -140,6 +118,26 @@
return false; return false;
} }
};
$(document).on('pageinitdepends', "#serverSecurityPage", function () {
var page = this;
$('.btnNewKey', page).on('click', function () {
$('.newKeyPanel', page).panel('toggle');
$('#txtAppName', page).val('').focus();
});
$('.newKeyForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshown', "#serverSecurityPage", function () {
var page = this;
loadData(page);
});
})(jQuery, document); })(jQuery, document);

View file

@ -34,7 +34,12 @@ var Dashboard = {
//$.mobile.popup.prototype.options.theme = "c"; //$.mobile.popup.prototype.options.theme = "c";
$.mobile.popup.prototype.options.transition = "fade"; $.mobile.popup.prototype.options.transition = "fade";
if ($.browser.mobile) {
$.mobile.defaultPageTransition = "slide";
} else {
$.mobile.defaultPageTransition = "none"; $.mobile.defaultPageTransition = "none";
}
//$.mobile.collapsible.prototype.options.contentTheme = "a"; //$.mobile.collapsible.prototype.options.contentTheme = "a";
// Make panels a little larger than the defaults // Make panels a little larger than the defaults
@ -776,7 +781,7 @@ var Dashboard = {
if (item.selected) { if (item.selected) {
menuHtml += '<a class="sidebarLink selectedSidebarLink" href="' + item.href + '">'; menuHtml += '<a class="sidebarLink selectedSidebarLink" href="' + item.href + '">';
} else { } else {
menuHtml += '<a class="sidebarLink" href="' + item.href + '">'; menuHtml += '<a data-transition="none" class="sidebarLink" href="' + item.href + '">';
} }
menuHtml += '<span class="fa ' + item.icon + ' sidebarLinkIcon"' + style + '></span>'; menuHtml += '<span class="fa ' + item.icon + ' sidebarLinkIcon"' + style + '></span>';
@ -802,7 +807,7 @@ var Dashboard = {
html += '<div data-role="panel" id="dashboardPanel" class="dashboardPanel" data-position="left" data-display="overlay" data-position-fixed="true" data-theme="a">'; html += '<div data-role="panel" id="dashboardPanel" class="dashboardPanel" data-position="left" data-display="overlay" data-position-fixed="true" data-theme="a">';
html += '<p class="libraryPanelHeader" style="margin: 15px 0 15px 15px;"><a href="index.html" class="imageLink"><img src="css/images/mblogoicon.png" /><span style="color:#333;">EMBY</span></a></p>'; html += '<p class="libraryPanelHeader" style="margin: 15px 0 15px 15px;"><a href="index.html" data-transition="none" class="imageLink"><img src="css/images/mblogoicon.png" /><span style="color:#333;">EMBY</span></a></p>';
html += '<div class="sidebarLinks">'; html += '<div class="sidebarLinks">';
html += menuHtml; html += menuHtml;
@ -1367,10 +1372,18 @@ var Dashboard = {
if (AppInfo.hasLowImageBandwidth) { if (AppInfo.hasLowImageBandwidth) {
quality -= 50; // The native app can handle a little bit more than safari
if (Dashboard.isRunningInCordova()) {
quality -= 30;
if (isBackdrop) { if (isBackdrop) {
//quality -= 20; quality -= 10;
}
} else {
quality -= 50;
} }
} }
@ -1383,6 +1396,11 @@ var Dashboard = {
options.enableImageEnhancers = false; options.enableImageEnhancers = false;
} }
if (AppInfo.forcedImageFormat && options.type != 'Logo') {
options.format = AppInfo.forcedImageFormat;
options.backgroundColor = '#1f1f1f';
}
}, },
getAppInfo: function () { getAppInfo: function () {
@ -1488,14 +1506,19 @@ var AppInfo = {};
if ($.browser.mobile) { if ($.browser.mobile) {
AppInfo.hasLowImageBandwidth = true; AppInfo.hasLowImageBandwidth = true;
AppInfo.enableDetailsMenuImages = false;
AppInfo.forcedImageFormat = 'jpg';
} }
if (isCordova) { if (isCordova) {
AppInfo.enableBottomTabs = true; AppInfo.enableBottomTabs = true;
AppInfo.enableDetailsMenuImages = true;
} }
} }
else { else {
AppInfo.enableDetailsMenuImages = true;
if (!$.browser.tv) { if (!$.browser.tv) {
AppInfo.enableHeadRoom = true; AppInfo.enableHeadRoom = true;
} }
@ -1768,7 +1791,8 @@ var AppInfo = {};
'*': { '*': {
'css': 'thirdparty/requirecss' // or whatever the path to require-css is 'css': 'thirdparty/requirecss' // or whatever the path to require-css is
} }
} },
urlArgs: "v=" + window.dashboardVersion
}); });
// Required since jQuery is loaded before requireJs // Required since jQuery is loaded before requireJs
@ -1783,6 +1807,10 @@ var AppInfo = {};
document.addEventListener("deviceready", function () { document.addEventListener("deviceready", function () {
if ($.browser.safari) {
requirejs(['thirdparty/cordova/imagestore.js']);
}
$(onReady); $(onReady);
}, false); }, false);
@ -1841,6 +1869,8 @@ $(document).on('pagecreate', ".page", function () {
$(page).trigger('pageinitdepends'); $(page).trigger('pageinitdepends');
} }
$('.localnav a, .libraryViewNav a').attr('data-transition', 'none');
}).on('pageshow', ".page", function () { }).on('pageshow', ".page", function () {
var page = this; var page = this;

View file

@ -133,7 +133,7 @@
$('#selectView', page).val(view).selectmenu('refresh'); $('#selectView', page).val(view).selectmenu('refresh');
} }
$(document).on('pageinit', "#tvGenresPage", function () { $(document).on('pageinitdepends', "#tvGenresPage", function () {
var page = this; var page = this;
@ -178,7 +178,7 @@
LibraryBrowser.saveViewSetting(getSavedQueryKey(), view); LibraryBrowser.saveViewSetting(getSavedQueryKey(), view);
}); });
}).on('pagebeforeshow', "#tvGenresPage", function () { }).on('pageshown', "#tvGenresPage", function () {
query.ParentId = LibraryMenu.getTopParentId(); query.ParentId = LibraryMenu.getTopParentId();
var page = this; var page = this;
@ -203,8 +203,6 @@
} }
}); });
}).on('pageshow', "#tvGenresPage", function () {
updateFilterControls(this); updateFilterControls(this);
}); });

View file

@ -95,7 +95,7 @@
$('.alphabetPicker', page).alphaValue(query.NameStartsWithOrGreater); $('.alphabetPicker', page).alphaValue(query.NameStartsWithOrGreater);
} }
$(document).on('pageinit', "#tvPeoplePage", function () { $(document).on('pageinitdepends', "#tvPeoplePage", function () {
var page = this; var page = this;
@ -147,7 +147,7 @@
reloadItems(page); reloadItems(page);
}); });
}).on('pagebeforeshow', "#tvPeoplePage", function () { }).on('pageshown', "#tvPeoplePage", function () {
query.ParentId = LibraryMenu.getTopParentId(); query.ParentId = LibraryMenu.getTopParentId();
@ -163,8 +163,6 @@
reloadItems(this); reloadItems(this);
}).on('pageshow', "#tvPeoplePage", function () {
updateFilterControls(this); updateFilterControls(this);
}); });

View file

@ -81,7 +81,7 @@
$('#selectPageSize', page).val(query.Limit).selectmenu('refresh'); $('#selectPageSize', page).val(query.Limit).selectmenu('refresh');
} }
$(document).on('pageinit', "#tvStudiosPage", function () { $(document).on('pageinitdepends', "#tvStudiosPage", function () {
var page = this; var page = this;
@ -108,7 +108,7 @@
reloadItems(page); reloadItems(page);
}); });
}).on('pagebeforeshow', "#tvStudiosPage", function () { }).on('pageshown', "#tvStudiosPage", function () {
query.ParentId = LibraryMenu.getTopParentId(); query.ParentId = LibraryMenu.getTopParentId();
@ -124,8 +124,6 @@
reloadItems(this); reloadItems(this);
}).on('pageshow', "#tvStudiosPage", function () {
updateFilterControls(this); updateFilterControls(this);
}); });

View file

@ -1,6 +1,6 @@
(function ($, document) { (function ($, document) {
$(document).on('pagebeforeshow', "#tvUpcomingPage", function () { $(document).on('pageshown', "#tvUpcomingPage", function () {
var page = this; var page = this;

View file

@ -4,7 +4,7 @@
<title>${TitleAdvanced}</title> <title>${TitleAdvanced}</title>
</head> </head>
<body> <body>
<div id="serverSecurityPage" data-role="page" class="page type-interior advancedConfigurationPage"> <div id="serverSecurityPage" data-role="page" class="page type-interior advancedConfigurationPage" data-require="scripts/serversecurity">
<div data-role="content"> <div data-role="content">
<div class="content-primary"> <div class="content-primary">
@ -55,10 +55,6 @@
</p> </p>
</form> </form>
</div> </div>
<script type="text/javascript">
$('.newKeyForm').off('submit', ServerSecurityPage.onSubmit).on('submit', ServerSecurityPage.onSubmit);
</script>
</div> </div>
</body> </body>
</html> </html>

View file

@ -0,0 +1,185 @@
(function () {
function setImageIntoElement(elem, url) {
if (elem.tagName === "DIV") {
elem.style.backgroundImage = "url('" + url + "')";
} else {
elem.setAttribute("src", url);
}
}
function onDbOpened(imageStore, db) {
imageStore._db = db;
window.ImageStore = imageStore;
}
function openDb(imageStore) {
// Create/open database
var db = window.sqlitePlugin.openDatabase({ name: "my.db" });
db.transaction(function (tx) {
tx.executeSql('CREATE TABLE IF NOT EXISTS images (id text primary key, data text)');
tx.executeSql('create index if not exists idx_images on images(id)');
onDbOpened(imageStore, db);
});
}
function sqliteImageStore() {
var self = this;
self.addImageToDatabase = function (blob, key) {
var deferred = DeferredBuilder.Deferred();
console.log("addImageToDatabase");
self.db().transaction(function (tx) {
tx.executeSql("INSERT INTO images (id, data) VALUES (?,?)", [key, blob], function (tx, res) {
deferred.resolve();
}, function (e) {
deferred.reject();
});
});
return deferred.promise();
};
self.db = function () {
return self._db;
};
self.get = function (key) {
var deferred = DeferredBuilder.Deferred();
self.db().transaction(function (tx) {
tx.executeSql("SELECT data from images where id=?", [key], function (tx, res) {
if (res.rows.length) {
deferred.resolveWith(null, [res.rows.item(0).data]);
} else {
deferred.reject();
}
}, function (e) {
deferred.reject();
});
});
return deferred.promise();
};
self.getImageUrl = function (originalUrl) {
console.log('getImageUrl:' + originalUrl);
var key = CryptoJS.SHA1(originalUrl).toString();
var deferred = DeferredBuilder.Deferred();
self.get(key).done(function (url) {
deferred.resolveWith(null, [url]);
}).fail(function () {
self.downloadImage(originalUrl, key).done(function () {
self.get(key).done(function (url) {
deferred.resolveWith(null, [url]);
}).fail(function () {
deferred.reject();
});
}).fail(function () {
deferred.reject();
});
});
return deferred.promise();
};
self.downloadImage = function (url, key) {
var deferred = DeferredBuilder.Deferred();
console.log('downloadImage:' + url);
// Create XHR
var xhr = new XMLHttpRequest();
xhr.open("GET", url, true);
// Set the responseType to blob
xhr.responseType = "arraybuffer";
xhr.addEventListener("load", function () {
if (xhr.status === 200) {
console.log("Image retrieved");
try {
var arr = new Uint8Array(this.response);
// Convert the int array to a binary string
// We have to use apply() as we are converting an *array*
// and String.fromCharCode() takes one or more single values, not
// an array.
var raw = String.fromCharCode.apply(null, arr);
// This works!!!
var b64 = btoa(raw);
var dataURL = "data:image/jpeg;base64," + b64;
// Put the received blob into the database
self.addImageToDatabase(dataURL, key).done(function () {
deferred.resolve();
}).fail(function () {
deferred.reject();
});
} catch (err) {
console.log("Error adding image to database");
deferred.reject();
}
} else {
deferred.reject();
}
}, false);
// Send XHR
xhr.send();
return deferred.promise();
};
self.setImageInto = function (elem, url) {
function onFail() {
setImageIntoElement(elem, url);
}
self.getImageUrl(url).done(function (localUrl) {
setImageIntoElement(elem, localUrl);
}).fail(onFail);
};
openDb(self);
}
new sqliteImageStore();
})();

View file

@ -85,12 +85,19 @@
chrome.sockets.udp.bind(createInfo.socketId, '0.0.0.0', port, function (result) { chrome.sockets.udp.bind(createInfo.socketId, '0.0.0.0', port, function (result) {
if (result != 0) {
console.log('bind fail: ' + result);
deferred.resolveWith(null, [servers]);
chrome.sockets.udp.close(createInfo.socketId);
return;
}
var data = stringToArrayBuffer('who is EmbyServer?'); var data = stringToArrayBuffer('who is EmbyServer?');
console.log('chrome.sockets.udp.send'); console.log('chrome.sockets.udp.send');
chrome.sockets.udp.send(createInfo.socketId, data, '255.255.255.255', port, function (result) { chrome.sockets.udp.send(createInfo.socketId, data, '255.255.255.255', port, function (result) {
if (result < 0) { if (result != 0) {
console.log('send fail: ' + result); console.log('send fail: ' + result);
deferred.resolveWith(null, [servers]); deferred.resolveWith(null, [servers]);
chrome.sockets.udp.close(createInfo.socketId); chrome.sockets.udp.close(createInfo.socketId);

View file

@ -94,19 +94,6 @@
(function () { (function () {
// IndexedDB
var indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.OIndexedDB || window.msIndexedDB,
dbVersion = 1.0;
var dbName = "emby4";
var imagesStoreName = "images";
function createObjectStore(dataBase) {
// Create an objectStore
console.log("Creating objectStore");
dataBase.createObjectStore(imagesStoreName);
}
function setImageIntoElement(elem, url) { function setImageIntoElement(elem, url) {
if (elem.tagName === "DIV") { if (elem.tagName === "DIV") {
@ -118,345 +105,6 @@
} }
} }
function openDb() {
var deferred = $.Deferred();
// Create/open database
var request = indexedDB.open(dbName, dbVersion);
request.onerror = function (event) {
console.log("Error creating/accessing IndexedDB database");
deferred.reject();
};
request.onsuccess = function (event) {
console.log("Success creating/accessing IndexedDB database");
var db = request.result || event.target.result;
db.onerror = function (event) {
console.log("Error creating/accessing IndexedDB database");
};
// Interim solution for Google Chrome to create an objectStore. Will be deprecated
if (db.setVersion) {
if (db.version != dbVersion) {
var setVersion = db.setVersion(dbVersion);
setVersion.onsuccess = function () {
createObjectStore(db);
deferred.resolveWith(null, [db]);
};
} else {
deferred.resolveWith(null, [db]);
}
} else {
deferred.resolveWith(null, [db]);
}
}
// For future use. Currently only in latest Firefox versions
request.onupgradeneeded = function (event) {
createObjectStore(event.target.result);
};
return deferred.promise();
}
function indexedDbImageStore() {
var self = this;
openDb().done(function (db) {
self._db = db;
window.ImageStore = self;
});
self.addImageToDatabase = function (blob, key) {
console.log("addImageToDatabase");
// Open a transaction to the database
var transaction = self.db().transaction([imagesStoreName], "readwrite");
// Put the blob into the dabase
var put = transaction.objectStore(imagesStoreName).put(blob, key);
};
self.db = function () {
return self._db;
};
self.get = function (key) {
var deferred = DeferredBuilder.Deferred();
var transaction = self.db().transaction([imagesStoreName], "readonly");
// Open a transaction to the database
var getRequest = transaction.objectStore(imagesStoreName).get(key);
getRequest.onsuccess = function (event) {
var imgFile = event.target.result;
if (imgFile) {
deferred.resolveWith(null, [imgFile]);
} else {
deferred.reject();
}
};
getRequest.onerror = function () {
deferred.reject();
};
return deferred.promise();
};
self.getImageUrl = function (originalUrl) {
console.log('getImageUrl:' + originalUrl);
var key = CryptoJS.SHA1(originalUrl).toString();
var deferred = DeferredBuilder.Deferred();
self.get(key).done(function (url) {
deferred.resolveWith(null, [url]);
}).fail(function () {
self.downloadImage(originalUrl, key).done(function () {
self.get(key).done(function (url) {
deferred.resolveWith(null, [url]);
}).fail(function () {
deferred.reject();
});
}).fail(function () {
deferred.reject();
});
});
return deferred.promise();
};
self.downloadImage = function (url, key) {
var deferred = DeferredBuilder.Deferred();
console.log('downloadImage:' + url);
// Create XHR
var xhr = new XMLHttpRequest();
xhr.open("GET", url, true);
// Set the responseType to blob
xhr.responseType = "arraybuffer";
xhr.addEventListener("load", function () {
if (xhr.status === 200) {
console.log("Image retrieved");
try {
var arr = new Uint8Array(this.response);
// Convert the int array to a binary string
// We have to use apply() as we are converting an *array*
// and String.fromCharCode() takes one or more single values, not
// an array.
var raw = String.fromCharCode.apply(null, arr);
// This works!!!
var b64 = btoa(raw);
var dataURL = "data:image/jpeg;base64," + b64;
// Put the received blob into IndexedDB
self.addImageToDatabase(dataURL, key);
deferred.resolve();
} catch (err) {
console.log("Error adding image to database");
deferred.reject();
}
} else {
deferred.reject();
}
}, false);
// Send XHR
xhr.send();
return deferred.promise();
};
self.setImageInto = function (elem, url) {
function onFail() {
setImageIntoElement(elem, url);
}
self.getImageUrl(url).done(function (localUrl) {
setImageIntoElement(elem, localUrl);
}).fail(onFail);
};
}
function indexedDbBlobImageStore() {
var self = this;
openDb().done(function (db) {
self._db = db;
window.ImageStore = self;
});
self.addImageToDatabase = function (blob, key) {
console.log("addImageToDatabase");
// Open a transaction to the database
var transaction = self.db().transaction([imagesStoreName], "readwrite");
// Put the blob into the dabase
var put = transaction.objectStore(imagesStoreName).put(blob, key);
};
self.db = function () {
return self._db;
};
self.get = function (key) {
var deferred = DeferredBuilder.Deferred();
var transaction = self.db().transaction([imagesStoreName], "readonly");
// Open a transaction to the database
var getRequest = transaction.objectStore(imagesStoreName).get(key);
getRequest.onsuccess = function (event) {
var imgFile = event.target.result;
if (imgFile) {
// Get window.URL object
var URL = window.URL || window.webkitURL;
// Create and revoke ObjectURL
var imgUrl = URL.createObjectURL(imgFile);
deferred.resolveWith(null, [imgUrl]);
} else {
deferred.reject();
}
};
getRequest.onerror = function () {
deferred.reject();
};
return deferred.promise();
};
self.getImageUrl = function (originalUrl) {
console.log('getImageUrl:' + originalUrl);
var key = CryptoJS.SHA1(originalUrl + "1").toString();
var deferred = DeferredBuilder.Deferred();
self.get(key).done(function (url) {
deferred.resolveWith(null, [url]);
}).fail(function () {
self.downloadImage(originalUrl, key).done(function () {
self.get(key).done(function (url) {
deferred.resolveWith(null, [url]);
}).fail(function () {
deferred.reject();
});
}).fail(function () {
deferred.reject();
});
});
return deferred.promise();
};
self.downloadImage = function (url, key) {
var deferred = DeferredBuilder.Deferred();
console.log('downloadImage:' + url);
// Create XHR
var xhr = new XMLHttpRequest();
xhr.open("GET", url, true);
// Set the responseType to blob
xhr.responseType = "arraybuffer";
xhr.addEventListener("load", function () {
if (xhr.status === 200) {
console.log("Image retrieved");
try {
var blob = new Blob([this.response], { type: this.getResponseHeader('content-type') });
// Put the received blob into IndexedDB
self.addImageToDatabase(blob, key);
deferred.resolve();
} catch (err) {
console.log("Error adding blob to database");
alert("Error adding blob to database");
deferred.reject();
}
} else {
deferred.reject();
}
}, false);
// Send XHR
xhr.send();
return deferred.promise();
};
self.setImageInto = function (elem, url) {
function onFail() {
setImageIntoElement(elem, url);
}
self.getImageUrl(url).done(function (localUrl) {
setImageIntoElement(elem, localUrl);
}).fail(onFail);
};
}
function simpleImageStore() { function simpleImageStore() {
var self = this; var self = this;
@ -467,13 +115,4 @@
console.log('creating simpleImageStore'); console.log('creating simpleImageStore');
window.ImageStore = new simpleImageStore(); window.ImageStore = new simpleImageStore();
//if ($.browser.safari && indexedDB && window.Blob) {
// console.log('creating indexedDbBlobImageStore');
// new indexedDbBlobImageStore();
//}
//else if ($.browser.safari && indexedDB) {
// console.log('creating indexedDbImageStore');
// new indexedDbImageStore();
//}
})(); })();

View file

@ -4,7 +4,7 @@
<title>Emby</title> <title>Emby</title>
</head> </head>
<body> <body>
<div id="tvGenresPage" data-role="page" class="page libraryPage"> <div id="tvGenresPage" data-role="page" class="page libraryPage" data-require="scripts/tvgenres">
<div class="libraryViewNav scopedLibraryViewNav"> <div class="libraryViewNav scopedLibraryViewNav">
<a href="tvrecommended.html">${TabSuggestions}</a> <a href="tvrecommended.html">${TabSuggestions}</a>
<a href="tvlatest.html">${TabLatest}</a> <a href="tvlatest.html">${TabLatest}</a>

View file

@ -4,7 +4,7 @@
<title>Emby</title> <title>Emby</title>
</head> </head>
<body> <body>
<div id="tvPeoplePage" data-role="page" class="page libraryPage"> <div id="tvPeoplePage" data-role="page" class="page libraryPage" data-require="scripts/tvpeople">
<div class="libraryViewNav scopedLibraryViewNav"> <div class="libraryViewNav scopedLibraryViewNav">
<a href="tvrecommended.html">${TabSuggestions}</a> <a href="tvrecommended.html">${TabSuggestions}</a>
<a href="tvlatest.html">${TabLatest}</a> <a href="tvlatest.html">${TabLatest}</a>

View file

@ -26,8 +26,7 @@
<div data-role="content"> <div data-role="content">
<div class="ehsContent"> <div class="ehsContent">
<div class="scopedContent"> <div id="resumableSection" style="display: none;" class="scopedContent homePageSection">
<div id="resumableSection" style="display: none;">
<div> <div>
<h1 class="listHeader firstListHeader" style="display:inline-block;vertical-align:middle;">${HeaderResume}</h1> <h1 class="listHeader firstListHeader" style="display:inline-block;vertical-align:middle;">${HeaderResume}</h1>
<a href="#" class="accentButton categorySyncButton" data-category="Resume"><i class="fa fa-cloud"></i>${ButtonSync}</a> <a href="#" class="accentButton categorySyncButton" data-category="Resume"><i class="fa fa-cloud"></i>${ButtonSync}</a>
@ -37,9 +36,7 @@
</div> </div>
</div> </div>
</div> <div class="homePageSection">
<div>
<div> <div>
<h1 class="listHeader nextUpHeader" style="display:inline-block;vertical-align:middle;">${HeaderNextUp}</h1> <h1 class="listHeader nextUpHeader" style="display:inline-block;vertical-align:middle;">${HeaderNextUp}</h1>
<a href="#" class="accentButton categorySyncButton" data-category="NextUp"><i class="fa fa-cloud"></i>${ButtonSync}</a> <a href="#" class="accentButton categorySyncButton" data-category="NextUp"><i class="fa fa-cloud"></i>${ButtonSync}</a>

View file

@ -4,7 +4,7 @@
<title>Emby</title> <title>Emby</title>
</head> </head>
<body> <body>
<div id="tvStudiosPage" data-role="page" class="page libraryPage"> <div id="tvStudiosPage" data-role="page" class="page libraryPage" data-require="scripts/tvstudios">
<div class="libraryViewNav scopedLibraryViewNav"> <div class="libraryViewNav scopedLibraryViewNav">
<a href="tvrecommended.html">${TabSuggestions}</a> <a href="tvrecommended.html">${TabSuggestions}</a>
<a href="tvlatest.html">${TabLatest}</a> <a href="tvlatest.html">${TabLatest}</a>

View file

@ -4,7 +4,7 @@
<title>Emby</title> <title>Emby</title>
</head> </head>
<body> <body>
<div id="tvUpcomingPage" data-role="page" class="page libraryPage backdropPage" data-backdroptype="series"> <div id="tvUpcomingPage" data-role="page" class="page libraryPage backdropPage" data-backdroptype="series" data-require="scripts/tvupcoming">
<div class="libraryViewNav globalNav" style="display: none;"> <div class="libraryViewNav globalNav" style="display: none;">
<a href="index.html">${TabHome}</a> <a href="index.html">${TabHome}</a>
<a href="homelatest.html" class="homeLatestTab">${TabLatest}</a> <a href="homelatest.html" class="homeLatestTab">${TabLatest}</a>