mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
break up jquery mobile
This commit is contained in:
parent
4565ac78ab
commit
973b43989d
25 changed files with 899 additions and 144 deletions
|
@ -193,7 +193,6 @@
|
|||
}
|
||||
|
||||
function supportInAppSignup() {
|
||||
return false;
|
||||
return AppInfo.isNativeApp;
|
||||
return AppInfo.isNativeApp || getWindowUrl().toLowerCase().indexOf('https') == 0;
|
||||
}
|
||||
|
|
|
@ -1090,7 +1090,7 @@
|
|||
}
|
||||
|
||||
if (limit && result.TotalRecordCount > limit) {
|
||||
html += '<p style="margin: 0;"><paper-button raised class="more mini moreCriticReviews">' + Globalize.translate('ButtonMoreItems') + '</paper-button></p>';
|
||||
html += '<p style="margin: 0;"><paper-button raised class="more moreCriticReviews">' + Globalize.translate('ButtonMoreItems') + '</paper-button></p>';
|
||||
}
|
||||
|
||||
$('#criticReviewsContent', page).html(html).trigger('create');
|
||||
|
@ -1248,7 +1248,7 @@
|
|||
}
|
||||
|
||||
if (limit && chapters.length > limit) {
|
||||
html += '<p style="margin: 0;"><paper-button raised class="more mini moreScenes">' + Globalize.translate('ButtonMoreItems') + '</paper-button></p>';
|
||||
html += '<p style="margin: 0;"><paper-button raised class="more moreScenes">' + Globalize.translate('ButtonMoreItems') + '</paper-button></p>';
|
||||
}
|
||||
|
||||
$('#scenesContent', page).html(html).trigger('create').lazyChildren();
|
||||
|
@ -1480,7 +1480,7 @@
|
|||
}
|
||||
|
||||
if (limit && items.length > limit) {
|
||||
html += '<p style="margin: 0;"><paper-button raised class="more mini ' + moreButtonClass + '">' + Globalize.translate('ButtonMoreItems') + '</paper-button></p>';
|
||||
html += '<p style="margin: 0;padding-left:5px;"><paper-button raised class="more ' + moreButtonClass + '">' + Globalize.translate('ButtonMoreItems') + '</paper-button></p>';
|
||||
}
|
||||
|
||||
return html;
|
||||
|
@ -1557,7 +1557,7 @@
|
|||
}
|
||||
|
||||
if (limit && casts.length > limit) {
|
||||
html += '<p style="margin: 0;"><paper-button raised class="more mini morePeople">' + Globalize.translate('ButtonMoreItems') + '</paper-button></p>';
|
||||
html += '<p style="margin: 0;padding-left:5px;"><paper-button raised class="more morePeople">' + Globalize.translate('ButtonMoreItems') + '</paper-button></p>';
|
||||
}
|
||||
|
||||
$('#castContent', page).html(html).lazyChildren().trigger('create');
|
||||
|
|
|
@ -4,7 +4,9 @@
|
|||
|
||||
var html = '<div class="viewMenuBar ui-bar-b">';
|
||||
|
||||
html += '<button type="button" data-role="none" class="headerButton headerButtonLeft headerBackButton"><div class="fa fa-arrow-left"></div></button>';
|
||||
if (AppInfo.enableBackButton) {
|
||||
html += '<button type="button" data-role="none" class="headerButton headerButtonLeft headerBackButton"><div class="fa fa-arrow-left"></div></button>';
|
||||
}
|
||||
|
||||
html += '<button type="button" data-role="none" title="Menu" class="headerButton dashboardMenuButton barsMenuButton headerButtonLeft">';
|
||||
html += '<div class="barMenuInner fa fa-bars">';
|
||||
|
@ -16,7 +18,7 @@
|
|||
html += '</div>';
|
||||
html += '</button>';
|
||||
|
||||
html += '<div class="libraryMenuButtonText headerButton"><span>EMBY</span></div>';
|
||||
html += '<div class="libraryMenuButtonText headerButton">' + Globalize.translate('ButtonHome') + '</div>';
|
||||
|
||||
html += '<div class="viewMenuSecondary">';
|
||||
|
||||
|
@ -584,7 +586,7 @@
|
|||
|
||||
}
|
||||
else if (jPage.hasClass('allLibraryPage') || jPage.hasClass('type-interior')) {
|
||||
$('.libraryMenuButtonText').html('<span class="logoLibraryMenuButtonText">EMBY</span>');
|
||||
$('.libraryMenuButtonText').html(Globalize.translate('ButtonHome'));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -23,10 +23,7 @@
|
|||
|
||||
LoginPage.getApiClient().done(function (apiClient) {
|
||||
|
||||
// Show all users on localhost
|
||||
var promise1 = apiClient.getPublicUsers();
|
||||
|
||||
promise1.done(function (users) {
|
||||
apiClient.getPublicUsers().done(function (users) {
|
||||
|
||||
var showManualForm = !users.length;
|
||||
|
||||
|
@ -110,6 +107,8 @@
|
|||
newUrl = "index.html";
|
||||
}
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
|
||||
Dashboard.onServerChanged(user.Id, result.AccessToken, apiClient);
|
||||
Dashboard.navigate(newUrl);
|
||||
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
|
||||
function loadLatest(page, parentId) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
var options = {
|
||||
|
@ -42,6 +44,7 @@
|
|||
|
||||
})).lazyChildren();
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -50,13 +50,15 @@ var Dashboard = {
|
|||
|
||||
$.event.special.swipe.verticalDistanceThreshold = 40;
|
||||
$.mobile.loader.prototype.options.disabled = true;
|
||||
//$.mobile.page.prototype.options.domCache = true;
|
||||
$.mobile.page.prototype.options.domCache = true;
|
||||
|
||||
$.mobile.loadingMessage = false;
|
||||
$.mobile.loader.prototype.options.html = "";
|
||||
$.mobile.loader.prototype.options.textVisible = false;
|
||||
$.mobile.loader.prototype.options.textOnly = true;
|
||||
$.mobile.loader.prototype.options.text = "";
|
||||
|
||||
$.mobile.changePage.defaults.showLoadMsg = false;
|
||||
},
|
||||
|
||||
isConnectMode: function () {
|
||||
|
@ -481,7 +483,7 @@ var Dashboard = {
|
|||
|
||||
setTimeout(function () {
|
||||
elem.active = false;
|
||||
}, 300);
|
||||
}, 100);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -711,6 +713,8 @@ var Dashboard = {
|
|||
ConnectionManager.user(window.ApiClient).done(function (user) {
|
||||
Dashboard.updateUserFlyout(elem, user);
|
||||
});
|
||||
|
||||
require(['jqmicons']);
|
||||
},
|
||||
|
||||
updateUserFlyout: function (elem, user) {
|
||||
|
@ -1473,7 +1477,7 @@ var Dashboard = {
|
|||
// The native app can handle a little bit more than safari
|
||||
if (AppInfo.isNativeApp) {
|
||||
|
||||
quality -= 20;
|
||||
quality -= 15;
|
||||
|
||||
if (isBackdrop) {
|
||||
quality -= 20;
|
||||
|
@ -1782,60 +1786,70 @@ var AppInfo = {};
|
|||
|
||||
}
|
||||
|
||||
function onDocumentReady() {
|
||||
function setDocumentClasses() {
|
||||
|
||||
var elem = $(document.documentElement);
|
||||
|
||||
if (AppInfo.enableBottomTabs) {
|
||||
elem.addClass('bottomSecondaryNav');
|
||||
}
|
||||
|
||||
if (AppInfo.isTouchPreferred) {
|
||||
$(document.body).addClass('touch');
|
||||
elem.addClass('touch');
|
||||
}
|
||||
|
||||
if (AppInfo.cardMargin) {
|
||||
elem.addClass(AppInfo.cardMargin);
|
||||
}
|
||||
|
||||
if (!AppInfo.enableLatestChannelItems) {
|
||||
elem.addClass('latestChannelItemsDisabled');
|
||||
}
|
||||
|
||||
if (!AppInfo.enableStudioTabs) {
|
||||
elem.addClass('studioTabDisabled');
|
||||
}
|
||||
|
||||
if (!AppInfo.enablePeopleTabs) {
|
||||
elem.addClass('peopleTabDisabled');
|
||||
}
|
||||
|
||||
if (!AppInfo.enableTvEpisodesTab) {
|
||||
elem.addClass('tvEpisodesTabDisabled');
|
||||
}
|
||||
|
||||
if (!AppInfo.enableMusicSongsTab) {
|
||||
elem.addClass('musicSongsTabDisabled');
|
||||
}
|
||||
|
||||
if (!AppInfo.enableMusicArtistsTab) {
|
||||
elem.addClass('musicArtistsTabDisabled');
|
||||
}
|
||||
|
||||
if (!AppInfo.enableMovieTrailersTab) {
|
||||
elem.addClass('movieTrailersTabDisabled');
|
||||
}
|
||||
|
||||
if (!AppInfo.enableSupporterMembership) {
|
||||
elem.addClass('supporterMembershipDisabled');
|
||||
}
|
||||
|
||||
if (AppInfo.isNativeApp) {
|
||||
elem.addClass('nativeApp');
|
||||
}
|
||||
}
|
||||
|
||||
function onDocumentReady() {
|
||||
|
||||
// Do these now to prevent a flash of content
|
||||
if (AppInfo.isNativeApp && $.browser.safari) {
|
||||
Dashboard.importCss('themes/ios.css');
|
||||
}
|
||||
|
||||
if ($.browser.safari && $.browser.mobile) {
|
||||
initFastClick();
|
||||
}
|
||||
|
||||
if (AppInfo.cardMargin) {
|
||||
$(document.body).addClass(AppInfo.cardMargin);
|
||||
}
|
||||
|
||||
if (!AppInfo.enableLatestChannelItems) {
|
||||
$(document.body).addClass('latestChannelItemsDisabled');
|
||||
}
|
||||
|
||||
if (!AppInfo.enableStudioTabs) {
|
||||
$(document.body).addClass('studioTabDisabled');
|
||||
}
|
||||
|
||||
if (!AppInfo.enablePeopleTabs) {
|
||||
$(document.body).addClass('peopleTabDisabled');
|
||||
}
|
||||
|
||||
if (!AppInfo.enableTvEpisodesTab) {
|
||||
$(document.body).addClass('tvEpisodesTabDisabled');
|
||||
}
|
||||
|
||||
if (!AppInfo.enableMusicSongsTab) {
|
||||
$(document.body).addClass('musicSongsTabDisabled');
|
||||
}
|
||||
|
||||
if (!AppInfo.enableMusicArtistsTab) {
|
||||
$(document.body).addClass('musicArtistsTabDisabled');
|
||||
}
|
||||
|
||||
if (!AppInfo.enableMovieTrailersTab) {
|
||||
$(document.body).addClass('movieTrailersTabDisabled');
|
||||
}
|
||||
|
||||
if (!AppInfo.enableSupporterMembership) {
|
||||
$(document.body).addClass('supporterMembershipDisabled');
|
||||
}
|
||||
|
||||
if (AppInfo.isNativeApp) {
|
||||
$(document).addClass('nativeApp');
|
||||
}
|
||||
|
||||
if (AppInfo.enableBackButton) {
|
||||
$(document.body).addClass('enableBackButton');
|
||||
}
|
||||
|
||||
var videoPlayerHtml = '<div id="mediaPlayer" data-theme="b" class="ui-bar-b" style="display: none;">';
|
||||
|
||||
videoPlayerHtml += '<div class="videoBackdrop">';
|
||||
|
@ -1962,6 +1976,9 @@ var AppInfo = {};
|
|||
require(['scripts/chromecast']);
|
||||
}
|
||||
}
|
||||
|
||||
// just until this can be removed
|
||||
require(['jqmicons']);
|
||||
}
|
||||
|
||||
function init(deferred, capabilities, appName, deviceId, deviceName) {
|
||||
|
@ -2029,22 +2046,15 @@ var AppInfo = {};
|
|||
Dashboard.importCss('thirdparty/paper-button/paper-button-style.css');
|
||||
return {};
|
||||
});
|
||||
define("jqmicons", [], function () {
|
||||
Dashboard.importCss('thirdparty/jquerymobile-1.4.5/jquery.mobile.custom.icons.css');
|
||||
return {};
|
||||
});
|
||||
|
||||
//requirejs(['http://viblast.com/player/free-version/qy2fdwajo1/viblast.js']);
|
||||
|
||||
setAppInfo();
|
||||
|
||||
$.extend(AppInfo, Dashboard.getAppInfo(appName, deviceId, deviceName));
|
||||
|
||||
// Do these now to prevent a flash of content
|
||||
if (AppInfo.isNativeApp && $.browser.safari) {
|
||||
Dashboard.importCss('themes/ios.css');
|
||||
}
|
||||
|
||||
if (AppInfo.enableBottomTabs) {
|
||||
$(document.body).addClass('bottomSecondaryNav');
|
||||
}
|
||||
|
||||
$(document).on('WebComponentsReady', function () {
|
||||
if (Dashboard.isConnectMode()) {
|
||||
|
||||
|
@ -2100,6 +2110,9 @@ var AppInfo = {};
|
|||
var initDeferred = $.Deferred();
|
||||
Dashboard.initPromise = initDeferred.promise();
|
||||
|
||||
setAppInfo();
|
||||
setDocumentClasses();
|
||||
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
initCordova(initDeferred);
|
||||
} else {
|
||||
|
@ -2216,4 +2229,8 @@ $(document).on('pagecreate', ".page", function () {
|
|||
if (apiClient && !apiClient.isWebSocketOpen()) {
|
||||
Dashboard.refreshSystemInfoFromServer();
|
||||
}
|
||||
|
||||
if (!page.hasClass('libraryPage')) {
|
||||
require(['jqmicons']);
|
||||
}
|
||||
});
|
|
@ -2,10 +2,6 @@
|
|||
|
||||
function getView() {
|
||||
|
||||
if (AppInfo.hasLowImageBandwidth) {
|
||||
return 'ThumbCard';
|
||||
}
|
||||
|
||||
return 'Thumb';
|
||||
}
|
||||
|
||||
|
|
|
@ -2,19 +2,11 @@
|
|||
|
||||
function getView() {
|
||||
|
||||
if (AppInfo.hasLowImageBandwidth) {
|
||||
return 'ThumbCard';
|
||||
}
|
||||
|
||||
return 'Thumb';
|
||||
}
|
||||
|
||||
function getResumeView() {
|
||||
|
||||
if (AppInfo.hasLowImageBandwidth) {
|
||||
return 'PosterCard';
|
||||
}
|
||||
|
||||
return 'Poster';
|
||||
}
|
||||
|
||||
|
@ -119,9 +111,7 @@
|
|||
|
||||
var screenWidth = $(window).width();
|
||||
|
||||
var limit = AppInfo.hasLowImageBandwidth ?
|
||||
4 :
|
||||
6;
|
||||
var limit = 6;
|
||||
|
||||
var options = {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue