change browser object

This commit is contained in:
Luke Pulverenti 2015-11-28 15:48:35 -05:00
parent 27c3bdc042
commit 7b5f61d2d2
32 changed files with 106 additions and 106 deletions

View File

@ -6,7 +6,7 @@
var hasChanges = false;
// These images can be large and we're seeing memory problems in safari
var browsableImagePageSize = $.browser.safari ? 6 : 10;
var browsableImagePageSize = browserInfo.safari ? 6 : 10;
var browsableImageStartIndex = 0;
var browsableImageType = 'Primary';

View File

@ -52,10 +52,10 @@
function enableHashChange() {
// It's not firing popstate in response to hashbang changes
if ($.browser.msie) {
if (browserInfo.msie) {
return false;
}
if ($.browser.edge) {
if (browserInfo.edge) {
return false;
}
return true;
@ -92,7 +92,7 @@
// but not needed here since this is already on top of an existing dialog
// but skip it in IE because it's causing the entire browser to hang
// Also have to disable for firefox because it's causing select elements to not be clickable
if (!$.browser.msie && !$.browser.mozilla) {
if (!browserInfo.msie && !browserInfo.mozilla) {
if (options.modal !== false) {
dlg.setAttribute('modal', 'modal');
}

View File

@ -483,7 +483,7 @@
onProgramGridScroll(tabContent, this);
});
if ($.browser.mobile) {
if (browserInfo.mobile) {
tabContent.querySelector('.tvGuide').classList.add('mobileGuide');
} else {

View File

@ -510,7 +510,7 @@
currentSession.on('message', handleMessage);
currentSession.on('disconnect', handleSessionDisconnect);
if (connectToSession || $.browser.safari) {
if (connectToSession || browserInfo.safari) {
currentSession.connect().success(function () {
onWebAppSessionConnect(currentSession, device);

View File

@ -52,7 +52,7 @@
}
function normalizeReturnUrl(url) {
if ($.browser.safari) {
if (browserInfo.safari) {
// Use the embedded server for iOS8, and also if we don't know the iOS version, just to be safe
var index = url.indexOf('/Documents');
@ -68,7 +68,7 @@
self.getImageUrl = function (originalUrl) {
if ($.browser.android && originalUrl.indexOf('tag=') != -1) {
if (browserInfo.android && originalUrl.indexOf('tag=') != -1) {
originalUrl += "&accept=webp";
}
@ -108,7 +108,7 @@
setImageIntoElement(elem, url);
}
//if ($.browser.safari) {
//if (browserInfo.safari) {
// setImageWithSdWebImage(elem, url);
// return;
//}

View File

@ -886,7 +886,7 @@
var deferred = DeferredBuilder.Deferred();
if ($.browser.android) {
if (browserInfo.android) {
deferred.resolveWith(null, ['file://' + path]);
return deferred.promise();
}

View File

@ -22,7 +22,7 @@
} : null;
var prefix = $.browser.android ? 'android' : 'ios';
var prefix = browserInfo.android ? 'android' : 'ios';
IapManager.isUnlockedOverride(feature).then(function (isUnlocked) {
@ -430,7 +430,7 @@
Events.on(IapManager, 'productupdated', onProductUpdated);
}
if ($.browser.android) {
if (browserInfo.android) {
requirejs(['cordova/android/iap'], onIapManagerLoaded);
} else {
requirejs(['cordova/iap'], onIapManagerLoaded);

View File

@ -54,7 +54,7 @@
}
// There seems to be a bug with this in safari causing it to immediately roll up to 0 height
var isScrollable = !$.browser.safari;
var isScrollable = !browserInfo.safari;
if (isScrollable) {
html += '<paper-dialog-scrollable>';
@ -108,7 +108,7 @@
});
// Seeing an issue in some non-chrome browsers where this is requiring a double click
var eventName = $.browser.chrome || $.browser.safari ? 'click' : 'mousedown';
var eventName = browserInfo.chrome || browserInfo.safari ? 'click' : 'mousedown';
$('.actionSheetMenuItem', dlg).on(eventName, function () {

View File

@ -68,7 +68,7 @@
return val != 'false';
}
if ($.browser.mobile) {
if (browserInfo.mobile) {
return false;
}

View File

@ -1,7 +1,7 @@
(function ($, document) {
function enableScrollX() {
return $.browser.mobile && AppInfo.enableAppLayouts;
return browserInfo.mobile && AppInfo.enableAppLayouts;
}
function getThumbShape() {

View File

@ -36,7 +36,7 @@
}
function enableScrollX() {
return $.browser.mobile && AppInfo.enableAppLayouts;
return browserInfo.mobile && AppInfo.enableAppLayouts;
}
function getThumbShape() {

View File

@ -137,7 +137,7 @@
// Appending #t=xxx to the query string doesn't seem to work with HLS
if (startPositionInSeekParam && src.indexOf('.m3u8') != -1) {
var delay = $.browser.safari ? 2500 : 0;
var delay = browserInfo.safari ? 2500 : 0;
var element = this;
if (delay) {
setTimeout(function () {
@ -202,10 +202,10 @@
var requiresNativeControls = !self.enableCustomVideoControls();
// Safari often displays the poster under the video and it doesn't look good
var poster = !$.browser.safari && options.poster ? (' poster="' + options.poster + '"') : '';
var poster = !browserInfo.safari && options.poster ? (' poster="' + options.poster + '"') : '';
// Can't autoplay in these browsers so we need to use the full controls
if (requiresNativeControls && AppInfo.isNativeApp && $.browser.android) {
if (requiresNativeControls && AppInfo.isNativeApp && browserInfo.android) {
html += '<video class="itemVideo" id="itemVideo" preload="metadata" autoplay="autoplay" crossorigin="anonymous"' + poster + ' webkit-playsinline>';
}
else if (requiresNativeControls) {
@ -321,7 +321,7 @@
elem.src = "";
// When the browser regains focus it may start auto-playing the last video
if ($.browser.safari) {
if (browserInfo.safari) {
elem.src = 'files/dummy.mp4';
elem.play();
}
@ -331,7 +331,7 @@
var val = streamInfo.url;
if (AppInfo.isNativeApp && $.browser.safari) {
if (AppInfo.isNativeApp && browserInfo.safari) {
val = val.replace('file://', '');
}
@ -558,7 +558,7 @@
self.enableCustomVideoControls = function () {
if (AppInfo.isNativeApp && $.browser.safari) {
if (AppInfo.isNativeApp && browserInfo.safari) {
if (navigator.userAgent.toLowerCase().indexOf('iphone') != -1) {
return true;
@ -568,7 +568,7 @@
return false;
}
return self.canAutoPlayVideo() && !$.browser.mobile;
return self.canAutoPlayVideo() && !browserInfo.mobile;
};
self.canAutoPlayVideo = function () {
@ -577,7 +577,7 @@
return true;
}
if ($.browser.mobile) {
if (browserInfo.mobile) {
return false;
}

View File

@ -4,7 +4,7 @@
function getDefaultSection(index) {
if (AppInfo.isNativeApp && $.browser.safari) {
if (AppInfo.isNativeApp && browserInfo.safari) {
switch (index) {

View File

@ -644,7 +644,7 @@
}
function enableScrollX() {
return $.browser.mobile && AppInfo.enableAppLayouts;
return browserInfo.mobile && AppInfo.enableAppLayouts;
}
function getPortraitShape() {

View File

@ -48,7 +48,7 @@
getDefaultItemsView: function (view, mobileView) {
return $.browser.mobile ? mobileView : view;
return browserInfo.mobile ? mobileView : view;
},
@ -132,7 +132,7 @@
if (AppInfo.isNativeApp) {
cacheDuration = 300000;
} else if ($.browser.ipad || $.browser.iphone || $.browser.android) {
} else if (browserInfo.ipad || browserInfo.iphone || browserInfo.android) {
cacheDuration = 10000;
} else {
cacheDuration = 30000;
@ -162,7 +162,7 @@
return false;
}
if ($.browser.safari) {
if (browserInfo.safari) {
return false;
}
@ -245,13 +245,13 @@
configurePaperLibraryTabs: function (ownerpage, tabs, pages) {
// Causing iron-select to not fire in IE and safari
if ($.browser.chrome) {
if (browserInfo.chrome) {
tabs.noink = true;
}
if (LibraryBrowser.enableFullPaperTabs()) {
if ($.browser.safari) {
if (browserInfo.safari) {
tabs.noSlide = true;
tabs.noBar = true;
} else {
@ -298,7 +298,7 @@
if (!LibraryBrowser.navigateOnLibraryTabSelect()) {
tabs.addEventListener('iron-select', function () {
var animateTab = !$.browser.safari;
var animateTab = !browserInfo.safari;
animateTab = false;
var selected = pages.selected;
@ -413,7 +413,7 @@
var tabs = this.querySelector('paper-tabs');
// For some reason the live tv page will not switch tabs in IE and safari
var delay = $.browser.chrome ? 0 : 100;
var delay = browserInfo.chrome ? 0 : 100;
setTimeout(function () {
var noSlide = tabs.noSlide;
@ -1648,7 +1648,7 @@
var shapeWidth = screenWidth / imagesPerRow[currentShape];
if (!$.browser.mobile) {
if (!browserInfo.mobile) {
shapeWidth = Math.round(shapeWidth / roundTo) * roundTo;
}
@ -2798,7 +2798,7 @@
// There seems to be a bug with this in safari causing it to immediately roll up to 0 height
// Have to disable this right now because it's causing the radio buttons to not function properly in other browsers besides chrome
var isScrollable = false;
if ($.browser.android) {
if (browserInfo.android) {
isScrollable = true;
}

View File

@ -942,7 +942,7 @@
$(btnSelectionPanelOptions).on('click', showMenuForSelectedItems);
if (!$.browser.mobile) {
if (!browserInfo.mobile) {
shake(btnSelectionPanelOptions, 1);
}
}

View File

@ -4,7 +4,7 @@
var html = '';
var backIcon = $.browser.safari ? 'chevron-left' : 'arrow-back';
var backIcon = browserInfo.safari ? 'chevron-left' : 'arrow-back';
html += '<paper-icon-button icon="' + backIcon + '" class="headerButton headerButtonLeft headerBackButton hide"></paper-icon-button>';
@ -37,7 +37,7 @@
html += '<paper-icon-button icon="person" class="headerButton headerButtonRight headerUserButton" onclick="return Dashboard.showUserFlyout(this);"></paper-icon-button>';
}
if (!$.browser.mobile && !Dashboard.isConnectMode()) {
if (!browserInfo.mobile && !Dashboard.isConnectMode()) {
html += '<paper-icon-button icon="settings" class="headerButton headerButtonRight dashboardEntryHeaderButton" onclick="return LibraryMenu.onSettingsClicked(event);"></paper-icon-button>';
}
@ -162,7 +162,7 @@
}
function onMainDrawerOpened() {
if ($.browser.mobile) {
if (browserInfo.mobile) {
document.body.classList.add('bodyWithPopupOpen');
}
@ -330,7 +330,7 @@
html += '<a class="sidebarLink lnkMediaFolder lnkManageServer" data-itemid="dashboard" href="#"><iron-icon icon="dashboard" class="sidebarLinkIcon"></iron-icon><span class="sidebarLinkText">' + Globalize.translate('ButtonManageServer') + '</span></a>';
html += '<a class="sidebarLink lnkMediaFolder editorViewMenu" data-itemid="editor" onclick="return LibraryMenu.onLinkClicked(event, this);" href="edititemmetadata.html"><iron-icon icon="mode-edit" class="sidebarLinkIcon"></iron-icon><span class="sidebarLinkText">' + Globalize.translate('ButtonMetadataManager') + '</span></a>';
if (!$.browser.mobile) {
if (!browserInfo.mobile) {
html += '<a class="sidebarLink lnkMediaFolder" data-itemid="reports" onclick="return LibraryMenu.onLinkClicked(event, this);" href="reports.html"><iron-icon icon="insert-chart" class="sidebarLinkIcon"></iron-icon><span class="sidebarLinkText">' + Globalize.translate('ButtonReports') + '</span></a>';
}
html += '</div>';
@ -514,7 +514,7 @@
}
function showUserAtTop() {
return Dashboard.isConnectMode() || $.browser.mobile;
return Dashboard.isConnectMode() || browserInfo.mobile;
}
var requiresLibraryMenuRefresh = false;
@ -548,7 +548,7 @@
closeMainDrawer();
// On mobile devices don't navigate until after the closing animation has completed or it may stutter
var delay = $.browser.mobile ? 350 : 0;
var delay = browserInfo.mobile ? 350 : 0;
setTimeout(function () {
if (action) {
@ -573,7 +573,7 @@
closeMainDrawer();
// On mobile devices don't navigate until after the closing animation has completed or it may stutter
var delay = $.browser.mobile ? 350 : 0;
var delay = browserInfo.mobile ? 350 : 0;
setTimeout(function () {
Dashboard.logout();
@ -620,7 +620,7 @@
var mainDrawerButton = document.querySelector('.mainDrawerButton');
if (mainDrawerButton) {
if (!visible && $.browser.mobile) {
if (!visible && browserInfo.mobile) {
mainDrawerButton.classList.remove('hide');
} else {
mainDrawerButton.classList.remove('hide');
@ -837,7 +837,7 @@
var mainDrawerButton = document.querySelector('.mainDrawerButton');
if (mainDrawerButton) {
if (page.getAttribute('data-menubutton') == 'false' && $.browser.mobile) {
if (page.getAttribute('data-menubutton') == 'false' && browserInfo.mobile) {
mainDrawerButton.classList.remove('hide');
} else {
mainDrawerButton.classList.remove('hide');
@ -868,7 +868,7 @@
document.body.classList.add('hideMainDrawer');
}
if (!Dashboard.isConnectMode() && !$.browser.mobile) {
if (!Dashboard.isConnectMode() && !browserInfo.mobile) {
darkDrawer = true;
}

View File

@ -1,7 +1,7 @@
(function ($, document) {
function enableScrollX() {
return $.browser.mobile && AppInfo.enableAppLayouts;
return browserInfo.mobile && AppInfo.enableAppLayouts;
}
function getPortraitShape() {

View File

@ -959,7 +959,7 @@
// Huge hack alert. Safari doesn't seem to like if the segments aren't available right away when playback starts
// This will start the transcoding process before actually feeding the video url into the player
if ($.browser.safari && !mediaSource.RunTimeTicks) {
if (browserInfo.safari && !mediaSource.RunTimeTicks) {
Dashboard.showLoadingMsg();
@ -1110,7 +1110,7 @@
}).on("click.mediaplayerevent", function (e) {
if (!$.browser.mobile) {
if (!browserInfo.mobile) {
if (this.paused()) {
self.unpause();
} else {
@ -1120,7 +1120,7 @@
}).on("dblclick.mediaplayerevent", function () {
if (!$.browser.mobile) {
if (!browserInfo.mobile) {
self.toggleFullscreen();
}
});

View File

@ -120,7 +120,7 @@
})[0].maxHeight;
}
var isVlc = AppInfo.isNativeApp && $.browser.android;
var isVlc = AppInfo.isNativeApp && browserInfo.android;
var bitrateSetting = AppSettings.maxStreamingBitrate();
var supportedFormats = getSupportedFormats();
@ -147,7 +147,7 @@
});
}
if ($.browser.chrome) {
if (browserInfo.chrome) {
profile.DirectPlayProfiles.push({
Container: 'mkv,mov',
Type: 'Video',
@ -211,7 +211,7 @@
Protocol: 'hls'
});
if (canPlayAac && $.browser.safari && !AppInfo.isNativeApp) {
if (canPlayAac && browserInfo.safari && !AppInfo.isNativeApp) {
profile.TranscodingProfiles.push({
Container: 'ts',
Type: 'Audio',
@ -252,7 +252,7 @@
Protocol: 'http'
});
if (canPlayAac && $.browser.safari) {
if (canPlayAac && browserInfo.safari) {
profile.TranscodingProfiles.push({
Container: 'aac',
@ -542,7 +542,7 @@
var intervalTime = ApiClient.isWebSocketOpen() ? 1200 : 5000;
// Ease up with safari because it doesn't perform as well
if ($.browser.safari) {
if (browserInfo.safari) {
intervalTime = Math.max(intervalTime, 5000);
}
self.lastProgressReport = 0;
@ -1881,7 +1881,7 @@
return true;
}
if ($.browser.mobile) {
if (browserInfo.mobile) {
return false;
}

View File

@ -11,7 +11,7 @@
}
function enableScrollX() {
return $.browser.mobile && AppInfo.enableAppLayouts;
return browserInfo.mobile && AppInfo.enableAppLayouts;
}
function getPortraitShape() {

View File

@ -8,7 +8,7 @@
}
function enableScrollX() {
return $.browser.mobile && AppInfo.enableAppLayouts;
return browserInfo.mobile && AppInfo.enableAppLayouts;
}
function getSquareShape() {

View File

@ -31,14 +31,14 @@ pageIdOn('pageshow', 'myPreferencesMenuPage', function () {
page.querySelector('.headerUser').innerHTML = user.Name;
if (AppInfo.isNativeApp && $.browser.safari && user.Policy.IsAdministrator) {
if (AppInfo.isNativeApp && browserInfo.safari && user.Policy.IsAdministrator) {
page.querySelector('.adminSection').classList.remove('hide');
} else {
page.querySelector('.adminSection').classList.add('hide');
}
});
if (AppInfo.isNativeApp && $.browser.safari) {
if (AppInfo.isNativeApp && browserInfo.safari) {
page.querySelector('.userSection').classList.remove('hide');
} else {
page.querySelector('.userSection').classList.add('hide');

View File

@ -205,7 +205,7 @@
elem = $(getNowPlayingBarHtml()).appendTo(document.body)[0];
if (($.browser.safari || !AppInfo.isNativeApp) && $.browser.mobile) {
if ((browserInfo.safari || !AppInfo.isNativeApp) && browserInfo.mobile) {
// Not handled well here. The wrong elements receive events, bar doesn't update quickly enough, etc.
elem.classList.add('noMediaProgress');
}

View File

@ -605,7 +605,7 @@
// This should be outside of the IF
// But for now, if you change songs but keep the same artist, the backdrop will flicker because in-between songs it clears out the image
if (!$.browser.safari) {
if (!browserInfo.safari) {
// Exclude from safari because it just doesn't perform well
Backdrops.setBackdropUrl(page, backdropUrl);
}

View File

@ -14,7 +14,7 @@
var view = items[i];
if (AppInfo.isNativeApp && $.browser.safari && view.CollectionType == 'livetv') {
if (AppInfo.isNativeApp && browserInfo.safari && view.CollectionType == 'livetv') {
continue;
}
@ -52,7 +52,7 @@
function enableScrollX() {
return $.browser.mobile && AppInfo.enableAppLayouts;
return browserInfo.mobile && AppInfo.enableAppLayouts;
}
function getThumbShape() {
@ -374,7 +374,7 @@
html += '</div>';
var scrollX = enableScrollX() && $.browser.safari && screenWidth > 800;
var scrollX = enableScrollX() && browserInfo.safari && screenWidth > 800;
if (scrollX) {
html += '<div class="hiddenScrollX itemsContainer homeTopViews">';

View File

@ -1505,7 +1505,7 @@ var Dashboard = {
SupportedLiveMediaTypes: ['Audio', 'Video']
};
if (Dashboard.isRunningInCordova() && !$.browser.safari) {
if (Dashboard.isRunningInCordova() && !browserInfo.safari) {
caps.SupportsOfflineAccess = true;
caps.SupportsSync = true;
caps.SupportsContentUploading = true;
@ -1558,27 +1558,27 @@ var Dashboard = {
var name;
if ($.browser.chrome) {
if (browserInfo.chrome) {
name = "Chrome";
} else if ($.browser.edge) {
} else if (browserInfo.edge) {
name = "Edge";
} else if ($.browser.mozilla) {
} else if (browserInfo.mozilla) {
name = "Firefox";
} else if ($.browser.msie) {
} else if (browserInfo.msie) {
name = "Internet Explorer";
} else {
name = "Web Browser";
}
if ($.browser.version) {
name += " " + $.browser.version;
if (browserInfo.version) {
name += " " + browserInfo.version;
}
if ($.browser.ipad) {
if (browserInfo.ipad) {
name += " Ipad";
} else if ($.browser.iphone) {
} else if (browserInfo.iphone) {
name += " Iphone";
} else if ($.browser.android) {
} else if (browserInfo.android) {
name += " Android";
}
return name;
@ -1680,9 +1680,9 @@ var AppInfo = {};
AppInfo.enableAppStorePolicy = isCordova;
var isIOS = $.browser.ipad || $.browser.iphone;
var isAndroid = $.browser.android;
var isMobile = $.browser.mobile;
var isIOS = browserInfo.ipad || browserInfo.iphone;
var isAndroid = browserInfo.android;
var isMobile = browserInfo.mobile;
if (isIOS) {
@ -1949,7 +1949,7 @@ var AppInfo = {};
return jQuery;
});
if (Dashboard.isRunningInCordova() && $.browser.android) {
if (Dashboard.isRunningInCordova() && browserInfo.android) {
define("appstorage", ["cordova/android/appstorage"]);
} else {
define('appstorage', [], function () {
@ -1970,15 +1970,15 @@ var AppInfo = {};
define("localassetmanager", ["apiclient/localassetmanager"]);
}
if (Dashboard.isRunningInCordova() && $.browser.android) {
if (Dashboard.isRunningInCordova() && browserInfo.android) {
define("nativedirectorychooser", ["cordova/android/nativedirectorychooser"]);
}
if (Dashboard.isRunningInCordova() && $.browser.android) {
if (Dashboard.isRunningInCordova() && browserInfo.android) {
define("audiorenderer", ["cordova/android/vlcplayer"]);
define("videorenderer", ["cordova/android/vlcplayer"]);
}
else if (Dashboard.isRunningInCordova() && $.browser.safari) {
else if (Dashboard.isRunningInCordova() && browserInfo.safari) {
define("audiorenderer", ["cordova/ios/vlcplayer"]);
define("videorenderer", ["scripts/htmlmediarenderer"]);
}
@ -1987,7 +1987,7 @@ var AppInfo = {};
define("videorenderer", ["scripts/htmlmediarenderer"]);
}
if (Dashboard.isRunningInCordova() && $.browser.android) {
if (Dashboard.isRunningInCordova() && browserInfo.android) {
define("localsync", ["cordova/android/localsync"]);
}
else {
@ -2029,7 +2029,7 @@ var AppInfo = {};
define("sharingwidget", ["scripts/sharingwidget"]);
}
if (Dashboard.isRunningInCordova() && $.browser.safari) {
if (Dashboard.isRunningInCordova() && browserInfo.safari) {
define("searchmenu", ["cordova/searchmenu"]);
} else {
define("searchmenu", ["scripts/searchmenu"]);
@ -2131,13 +2131,13 @@ var AppInfo = {};
drawer.drawerWidth = drawerWidth + "px";
if ($.browser.safari) {
if (browserInfo.safari) {
drawer.disableEdgeSwipe = true;
}
var deps = [];
if (AppInfo.isNativeApp && $.browser.android) {
if (AppInfo.isNativeApp && browserInfo.android) {
require(['cordova/android/logging']);
}
@ -2153,7 +2153,7 @@ var AppInfo = {};
require(deps, function () {
if (Dashboard.isRunningInCordova() && $.browser.android) {
if (Dashboard.isRunningInCordova() && browserInfo.android) {
AppInfo.directPlayAudioContainers = "aac,mp3,mpa,wav,wma,mp2,ogg,oga,webma,ape,opus".split(',');
// TODO: This is going to exclude it from both playback and sync, so improve on this
@ -2163,7 +2163,7 @@ var AppInfo = {};
AppInfo.directPlayVideoContainers = "m4v,3gp,ts,mpegts,mov,xvid,vob,mkv,wmv,asf,ogm,ogv,m2v,avi,mpg,mpeg,mp4,webm".split(',');
}
else if (Dashboard.isRunningInCordova() && $.browser.safari) {
else if (Dashboard.isRunningInCordova() && browserInfo.safari) {
AppInfo.directPlayAudioContainers = "aac,mp3,mpa,wav,wma,mp2,ogg,oga,webma,ape,opus".split(',');
@ -2226,47 +2226,47 @@ var AppInfo = {};
function onAppReady(promiseResolve) {
if ($.browser.msie) {
if (browserInfo.msie) {
require(['devices/ie/ie']);
}
// Do these now to prevent a flash of content
if (AppInfo.isNativeApp && $.browser.android) {
if (AppInfo.isNativeApp && browserInfo.android) {
Dashboard.importCss('devices/android/android.css');
} else if (AppInfo.isNativeApp && $.browser.safari) {
} else if (AppInfo.isNativeApp && browserInfo.safari) {
Dashboard.importCss('devices/ios/ios.css');
} else if (!$.browser.android) {
} else if (!browserInfo.android) {
Dashboard.importCss('devices/android/android.css');
}
loadTheme();
if ($.browser.safari && $.browser.mobile) {
if (browserInfo.safari && browserInfo.mobile) {
initFastClick();
}
if (Dashboard.isRunningInCordova()) {
require(['cordova/connectsdk', 'scripts/registrationservices', 'cordova/back']);
if ($.browser.android) {
if (browserInfo.android) {
require(['cordova/android/androidcredentials', 'cordova/android/immersive', 'cordova/android/mediasession']);
} else {
require(['cordova/volume']);
}
if ($.browser.safari) {
if (browserInfo.safari) {
require(['cordova/ios/orientation']);
}
} else {
if ($.browser.chrome) {
if (browserInfo.chrome) {
require(['scripts/chromecast']);
}
}
var deps = [];
if (AppInfo.isNativeApp && $.browser.safari) {
if (AppInfo.isNativeApp && browserInfo.safari) {
if (Dashboard.capabilities().SupportsSync) {
deps.push('cordova/ios/backgroundfetch');
@ -2317,7 +2317,7 @@ var AppInfo = {};
cordova.getAppVersion.getVersionNumber(function (appVersion) {
var capablities = Dashboard.capabilities();
var name = $.browser.android ? "Emby for Android Mobile" : ($.browser.safari ? "Emby for iOS" : "Emby Mobile");
var name = browserInfo.android ? "Emby for Android Mobile" : (browserInfo.safari ? "Emby for iOS" : "Emby Mobile");
// Remove special characters
var cleanDeviceName = device.model.replace(/[^\w\s]/gi, '');
@ -2399,7 +2399,7 @@ var AppInfo = {};
browser.mobile = true;
}
jQuery.browser = browser;
window.browserInfo = browser;
}
initRequire();
@ -2519,7 +2519,7 @@ pageClassOn('pageshow', "page", function () {
page.classList.remove('ui-body-a');
}
if (currentTheme != 'a' && !$.browser.mobile) {
if (currentTheme != 'a' && !browserInfo.mobile) {
document.body.classList.add('darkScrollbars');
} else {
document.body.classList.remove('darkScrollbars');

View File

@ -94,7 +94,7 @@
}
function enableScrollX() {
return $.browser.mobile && AppInfo.enableAppLayouts;
return browserInfo.mobile && AppInfo.enableAppLayouts;
}
function getThumbShape() {

View File

@ -40,7 +40,7 @@
}
function enableScrollX() {
return $.browser.mobile && AppInfo.enableAppLayouts;
return browserInfo.mobile && AppInfo.enableAppLayouts;
}
function getThumbShape() {

View File

@ -20,7 +20,7 @@
Dashboard.importCss('themes/halloween/style.css');
if (!$.browser.mobile) {
if (!browserInfo.mobile) {
if (!page.classList.contains('itemDetailPage')) {
Backdrops.setBackdropUrl(page, 'themes/halloween/bg.jpg');

View File

@ -204,7 +204,7 @@
elem.setAttribute("src", url);
}
if ($.browser.chrome && !$.browser.mobile) {
if (browserInfo.chrome && !browserInfo.mobile) {
if (!elem.classList.contains('noFade')) {
fadeIn(elem, 1);
}

View File

@ -2081,7 +2081,7 @@
}
// TODO deprecate prevPage in favor of previous
if (!prefix && $.browser.msie) {
if (!prefix && browserInfo.msie) {
// Add a delay for IE because it seems to be having issues with web components
var curr = this;