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

update dependency loading

This commit is contained in:
Luke Pulverenti 2015-12-05 14:42:11 -05:00
parent ac90f38b8e
commit e1b37cf634
9 changed files with 67 additions and 58 deletions

View file

@ -29,14 +29,14 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"ignore": [],
"homepage": "https://github.com/polymerelements/iron-behaviors",
"homepage": "https://github.com/PolymerElements/iron-behaviors",
"_release": "1.0.11",
"_resolution": {
"type": "version",
"tag": "v1.0.11",
"commit": "084fbc7f60343d717bb2208f350774f4c9899777"
},
"_source": "git://github.com/polymerelements/iron-behaviors.git",
"_source": "git://github.com/PolymerElements/iron-behaviors.git",
"_target": "^1.0.0",
"_originalSource": "polymerelements/iron-behaviors"
"_originalSource": "PolymerElements/iron-behaviors"
}

View file

@ -31,14 +31,14 @@
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/iron-icon",
"homepage": "https://github.com/polymerelements/iron-icon",
"_release": "1.0.7",
"_resolution": {
"type": "version",
"tag": "v1.0.7",
"commit": "6f4d152dc3998a6cc12a5a585a654f893dc99381"
},
"_source": "git://github.com/PolymerElements/iron-icon.git",
"_source": "git://github.com/polymerelements/iron-icon.git",
"_target": "^1.0.0",
"_originalSource": "PolymerElements/iron-icon"
"_originalSource": "polymerelements/iron-icon"
}

View file

@ -40,7 +40,7 @@
"tag": "v1.0.5",
"commit": "39da54afbc17af343d1f95e62c5c0c477492677a"
},
"_source": "git://github.com/PolymerElements/iron-icons.git",
"_source": "git://github.com/polymerelements/iron-icons.git",
"_target": "^1.0.0",
"_originalSource": "PolymerElements/iron-icons"
"_originalSource": "polymerelements/iron-icons"
}

View file

@ -36,7 +36,7 @@
"tag": "v1.0.8",
"commit": "e9a66727f3da0446f04956d4e4f1dcd51cdec2ff"
},
"_source": "git://github.com/polymerelements/iron-selector.git",
"_source": "git://github.com/PolymerElements/iron-selector.git",
"_target": "^1.0.0",
"_originalSource": "polymerelements/iron-selector"
"_originalSource": "PolymerElements/iron-selector"
}

View file

@ -178,7 +178,7 @@
window.ImageStore = self;
}
require(['cryptojs-sha1'], function () {
require(['cryptojs-md5'], function () {
new imageFileStore();
});

View file

@ -2,11 +2,15 @@
function onPageShow() {
if (!browserInfo.android) {
return;
}
var msg;
var settingsKey = "betatester";
var expectedValue = new Date().toDateString() + "3";
var expectedValue = new Date().toDateString() + "5";
if (appStorage.getItem(settingsKey) == expectedValue) {
return;
}
@ -18,10 +22,12 @@
Dashboard.alert({
message: msg,
title: 'Hello Emby Beta Tester!'
title: 'Hello Emby Beta Tester!',
callback: function () {
appStorage.setItem(settingsKey, expectedValue);
}
});
appStorage.setItem(settingsKey, expectedValue);
}
pageClassOn('pageshow', "homePage", onPageShow);

View file

@ -1546,7 +1546,7 @@ progress {
z-index: 9999998;
}
.nativeApp * {
.nativeApp *:not(input):not(select):not(textarea) {
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;

View file

@ -560,7 +560,9 @@ var Dashboard = {
navigator.notification.alert(options.message, options.callback || function () { }, options.title || Globalize.translate('HeaderAlert'));
} else {
require(['paper-dialog', 'fade-in-animation', 'fade-out-animation'], function () {
Dashboard.confirmInternal(options.message, options.title || Globalize.translate('HeaderAlert'), false, options.callback);
});
}
},
@ -587,9 +589,15 @@ var Dashboard = {
confirmInternal: function (message, title, showCancel, callback) {
var id = 'paperdlg' + new Date().getTime();
var dlg = document.createElement('paper-dialog');
var html = '<paper-dialog id="' + id + '" role="alertdialog" entry-animation="fade-in-animation" exit-animation="fade-out-animation" with-backdrop>';
dlg.setAttribute('with-backdrop', 'with-backdrop');
dlg.setAttribute('role', 'alertdialog');
dlg.entryAnimation = 'fade-in-animation';
dlg.exitAnimation = 'fade-out-animation';
dlg.setAttribute('with-backdrop', 'with-backdrop');
var html = '';
html += '<h2>' + title + '</h2>';
html += '<div>' + message + '</div>';
html += '<div class="buttons">';
@ -601,15 +609,9 @@ var Dashboard = {
}
html += '</div>';
html += '</paper-dialog>';
$(document.body).append(html);
// This timeout is obviously messy but it's unclear how to determine when the webcomponent is ready for use
// element onload never fires
setTimeout(function () {
var dlg = document.getElementById(id);
dlg.innerHTML = html;
document.body.appendChild(dlg);
// Has to be assigned a z-index after the call to .open()
dlg.addEventListener('iron-overlay-closed', function (e) {
@ -623,8 +625,6 @@ var Dashboard = {
});
dlg.open();
}, 300);
},
refreshSystemInfoFromServer: function () {
@ -1806,6 +1806,7 @@ var AppInfo = {};
define("paper-slider", ["html!bower_components/paper-slider/paper-slider.html"]);
define("paper-tabs", ["html!bower_components/paper-tabs/paper-tabs.html"]);
define("paper-menu", ["html!bower_components/paper-menu/paper-menu.html"]);
define("paper-dialog", ["html!bower_components/paper-dialog/paper-dialog.html"]);
define("paper-dialog-scrollable", ["html!bower_components/paper-dialog-scrollable/paper-dialog-scrollable.html"]);
define("paper-button", ["html!bower_components/paper-button/paper-button.html"]);
define("paper-icon-button", ["html!bower_components/paper-icon-button/paper-icon-button.html"]);
@ -1824,7 +1825,6 @@ var AppInfo = {};
define("fade-in-animation", ["html!bower_components/neon-animation/animations/fade-in-animation.html"]);
define("fade-out-animation", ["html!bower_components/neon-animation/animations/fade-out-animation.html"]);
define("scale-up-animation", ["html!bower_components/neon-animation/animations/scale-up-animation.html"]);
define("paper-dialog", ["html!bower_components/paper-dialog/paper-dialog.html"]);
define("paper-fab", ["html!bower_components/paper-fab/paper-fab.html"]);
define("paper-progress", ["html!bower_components/paper-progress/paper-progress.html"]);
define("paper-input", ["html!bower_components/paper-input/paper-input.html"]);
@ -1968,6 +1968,14 @@ var AppInfo = {};
});
}
function getRequirePromise(deps) {
return new Promise(function (resolve, reject) {
require(deps, resolve);
});
}
function initAfterDependencies(promiseResolve) {
var drawer = document.querySelector('.mainDrawerPanel');
@ -1991,20 +1999,13 @@ var AppInfo = {};
require(['cordova/android/logging']);
}
deps.push('scripts/librarybrowser');
deps.push('appstorage');
deps.push('scripts/mediaplayer');
deps.push('scripts/appsettings');
deps.push('apiclient/apiclient');
deps.push('apiclient/connectionmanager');
deps.push('apiclient/deferred');
deps.push('apiclient/credentials');
deps.push('thirdparty/jquerymobile-1.4.5/jquery.mobile.custom.js');
deps.push('paper-button');
deps.push('paper-icon-button');
require(deps, function () {
// TODO: This needs to be deprecated, but it's used heavily
@ -2044,11 +2045,21 @@ var AppInfo = {};
capabilities.DeviceProfile = MediaPlayer.getDeviceProfile(Math.max(screen.height, screen.width));
var promises = [];
deps = [];
deps.push(Globalize.ensure());
deps.push(createConnectionManager(capabilities));
deps.push('thirdparty/jquery.unveil-custom.js');
deps.push('html!thirdparty/emby-icons.html');
deps.push('paper-icon-button');
deps.push('paper-button');
deps.push('thirdparty/jquerymobile-1.4.5/jquery.mobile.custom.js');
deps.push('scripts/librarybrowser');
promises.push(getRequirePromise(deps));
Promise.all(deps).then(function () {
promises.push(Globalize.ensure());
promises.push(createConnectionManager(capabilities));
Promise.all(promises).then(function () {
document.title = Globalize.translateDocument(document.title, 'html');
@ -2142,11 +2153,11 @@ var AppInfo = {};
deps.push('scripts/search');
deps.push('scripts/librarylist');
deps.push('scripts/alphapicker');
deps.push('thirdparty/jquery.unveil-custom.js');
deps.push('scripts/playlistmanager');
deps.push('scripts/sync');
deps.push('scripts/backdrops');
deps.push('scripts/librarymenu');
deps.push('apiclient/deferred');
require(deps, function () {
@ -2197,7 +2208,7 @@ var AppInfo = {};
postInitDependencies.push('scripts/nowplayingbar');
}
//postInitDependencies.push('components/testermessage');
postInitDependencies.push('components/testermessage');
require(postInitDependencies);
});
@ -2387,7 +2398,6 @@ var AppInfo = {};
function onWebComponentsReady() {
var polymerDependencies = [];
polymerDependencies.push('html!thirdparty/emby-icons.html');
require(polymerDependencies, function () {

View file

@ -98,13 +98,6 @@
unveil();
}
function bindEvent(elems, method, name, fn) {
for (var i = 0, length = elems.length; i < length; i++) {
elems[i][method](name, fn);
}
}
function fillImages(elems) {
for (var i = 0, length = elems.length; i < length; i++) {