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

use shared prompt

This commit is contained in:
Luke Pulverenti 2016-02-04 15:51:13 -05:00
parent 4c2a7ed02d
commit adb3a60373
10 changed files with 215 additions and 36 deletions

View file

@ -1810,10 +1810,8 @@ var AppInfo = {};
return obj;
}
function initRequire() {
var urlArgs = "v=" + (window.dashboardVersion || new Date().getDate());
function getBowerPath() {
var bowerPath = "bower_components";
// Put the version into the bower path since we can't easily put a query string param on html imports
@ -1822,6 +1820,15 @@ var AppInfo = {};
bowerPath += window.dashboardVersion;
}
return bowerPath;
}
function initRequire() {
var urlArgs = "v=" + (window.dashboardVersion || new Date().getDate());
var bowerPath = getBowerPath();
var apiClientBowerPath = bowerPath + "/emby-apiclient";
var embyWebComponentsBowerPath = bowerPath + '/emby-webcomponents';
@ -1870,14 +1877,12 @@ var AppInfo = {};
if (Dashboard.isRunningInCordova()) {
paths.dialog = "cordova/dialog";
paths.prompt = "cordova/prompt";
paths.sharingwidget = "cordova/sharingwidget";
paths.serverdiscovery = "cordova/serverdiscovery";
paths.wakeonlan = "cordova/wakeonlan";
paths.actionsheet = "cordova/actionsheet";
} else {
paths.dialog = "components/dialog";
paths.prompt = "components/prompt";
paths.sharingwidget = "components/sharingwidget";
paths.serverdiscovery = apiClientBowerPath + "/serverdiscovery";
paths.wakeonlan = apiClientBowerPath + "/wakeonlan";
@ -2035,6 +2040,21 @@ var AppInfo = {};
});
}
function initRequireWithBrowser(browser) {
var bowerPath = getBowerPath();
var embyWebComponentsBowerPath = bowerPath + '/emby-webcomponents';
if (Dashboard.isRunningInCordova()) {
define("prompt", ["cordova/prompt"], returnFirstDependency);
} else if (browser.mobile) {
define("prompt", [embyWebComponentsBowerPath + "/prompt/nativeprompt"], returnFirstDependency);
} else {
define("prompt", [embyWebComponentsBowerPath + "/prompt/prompt"], returnFirstDependency);
}
}
function init(hostingAppInfo) {
if (Dashboard.isRunningInCordova() && browserInfo.android) {
@ -2448,6 +2468,8 @@ var AppInfo = {};
require(initialDependencies, function (browser, appStorage) {
initRequireWithBrowser(browser);
window.browserInfo = browser;
window.appStorage = appStorage;