mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update dialogs
This commit is contained in:
parent
fb358ecdb7
commit
14c155bdc1
11 changed files with 135 additions and 108 deletions
|
@ -1,6 +1,7 @@
|
|||
define(['appSettings', 'loading', 'apphost', 'iapManager', 'events', 'shell', 'globalize', 'dialogHelper', 'connectionManager', 'layoutManager', 'emby-button'], function (appSettings, loading, appHost, iapManager, events, shell, globalize, dialogHelper, connectionManager, layoutManager) {
|
||||
|
||||
var validatedFeatures = [];
|
||||
var currentDisplayingProductInfos = [];
|
||||
var currentDisplayingResolve = null;
|
||||
|
||||
function alertText(options) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
@ -23,14 +24,12 @@
|
|||
});
|
||||
}
|
||||
|
||||
function validateFeature(feature) {
|
||||
function validateFeature(feature, options) {
|
||||
|
||||
options = options || {};
|
||||
|
||||
console.log('validateFeature: ' + feature);
|
||||
|
||||
if (validatedFeatures.indexOf(feature) != -1) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
return iapManager.isUnlockedByDefault(feature).catch(function () {
|
||||
|
||||
var unlockableFeatureCacheKey = 'featurepurchased-' + feature;
|
||||
|
@ -79,6 +78,10 @@
|
|||
feature: feature
|
||||
};
|
||||
|
||||
if (options.showDialog === false) {
|
||||
return Promise.reject();
|
||||
}
|
||||
|
||||
return showInAppPurchaseInfo(subscriptionOptions, unlockableProductInfo, dialogOptions);
|
||||
});
|
||||
});
|
||||
|
@ -93,9 +96,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
var currentDisplayingProductInfos = [];
|
||||
var currentDisplayingResolve = null;
|
||||
|
||||
function clearCurrentDisplayingInfo() {
|
||||
currentDisplayingProductInfos = [];
|
||||
currentDisplayingResolve = null;
|
||||
|
@ -211,7 +211,7 @@
|
|||
btnPurchases[i].addEventListener('click', onPurchaseButtonClick);
|
||||
}
|
||||
|
||||
var btnPurchases = dlg.querySelectorAll('.buttonPremiereInfo');
|
||||
btnPurchases = dlg.querySelectorAll('.buttonPremiereInfo');
|
||||
for (i = 0, length = btnPurchases.length; i < length; i++) {
|
||||
btnPurchases[i].addEventListener('click', showExternalPremiereInfo);
|
||||
}
|
||||
|
@ -242,7 +242,7 @@
|
|||
}
|
||||
|
||||
var btnCloseDialogs = dlg.querySelectorAll('.btnCloseDialog');
|
||||
for (var i = 0, length = btnCloseDialogs.length; i < length; i++) {
|
||||
for (i = 0, length = btnCloseDialogs.length; i < length; i++) {
|
||||
btnCloseDialogs[i].addEventListener('click', onCloseButtonClick);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue