mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update live tv database
This commit is contained in:
parent
8e0dc6d8e4
commit
d4abbd5560
9 changed files with 116 additions and 25 deletions
|
@ -140,10 +140,21 @@
|
|||
$('.inAppPurchaseOverlay').remove();
|
||||
}
|
||||
|
||||
var currentDisplayingProductInfo = null;
|
||||
var currentDisplayingDeferred = null;
|
||||
|
||||
function clearCurrentDisplayingInfo() {
|
||||
currentDisplayingProductInfo = null;
|
||||
currentDisplayingDeferred = null;
|
||||
}
|
||||
|
||||
function showInAppPurchaseInfo(info, serverRegistrationInfo, deferred) {
|
||||
|
||||
var elem = getInAppPurchaseElement(info);
|
||||
|
||||
currentDisplayingProductInfo = info;
|
||||
currentDisplayingDeferred = deferred;
|
||||
|
||||
$('.inAppPurchaseForm', elem).on('submit', function () {
|
||||
|
||||
IapManager.beginPurchase(info.id);
|
||||
|
@ -151,6 +162,8 @@
|
|||
});
|
||||
|
||||
$('.btnCancel', elem).on('click', function () {
|
||||
|
||||
clearCurrentDisplayingInfo();
|
||||
cancelInAppPurchase();
|
||||
|
||||
// For testing purposes
|
||||
|
@ -162,6 +175,8 @@
|
|||
});
|
||||
$('.btnSignInSupporter', elem).on('click', function () {
|
||||
|
||||
clearCurrentDisplayingInfo();
|
||||
|
||||
Dashboard.alert({
|
||||
message: Globalize.translate('MessagePleaseSignInLocalNetwork'),
|
||||
callback: function () {
|
||||
|
@ -172,6 +187,21 @@
|
|||
});
|
||||
}
|
||||
|
||||
function onProductUpdated(e, product) {
|
||||
|
||||
var currentInfo = currentDisplayingProductInfo;
|
||||
var deferred = currentDisplayingDeferred;
|
||||
|
||||
if (currentInfo && deferred) {
|
||||
if (product.owned && product.id == currentInfo.id) {
|
||||
|
||||
clearCurrentDisplayingInfo();
|
||||
cancelInAppPurchase();
|
||||
deferred.resolve();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
window.RegistrationServices = {
|
||||
|
||||
renderPluginInfo: function (page, pkg, pluginSecurityInfo) {
|
||||
|
@ -203,10 +233,14 @@
|
|||
}
|
||||
};
|
||||
|
||||
function onIapManagerLoaded() {
|
||||
Events.on(IapManager, 'productupdated', onProductUpdated);
|
||||
}
|
||||
|
||||
if (isAndroid()) {
|
||||
requirejs(['thirdparty/cordova/android/iap']);
|
||||
requirejs(['thirdparty/cordova/android/iap', onIapManagerLoaded]);
|
||||
} else {
|
||||
requirejs(['thirdparty/cordova/iap']);
|
||||
requirejs(['thirdparty/cordova/iap', onIapManagerLoaded]);
|
||||
}
|
||||
|
||||
})();
|
Loading…
Add table
Add a link
Reference in a new issue