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

74 lines
1.8 KiB
JavaScript
Raw Normal View History

2016-10-14 12:22:04 -04:00
define(['apphost', 'globalize', 'shell'], function (appHost, globalize, shell) {
2016-10-23 01:11:46 -04:00
'use strict';
2016-10-14 12:22:04 -04:00
function getProductInfo(feature) {
return null;
}
function showExternalPremiereInfo() {
shell.openUrl('https://emby.media/premiere');
}
function beginPurchase(feature, email) {
showExternalPremiereInfo();
return Promise.reject();
}
function restorePurchase(id) {
return Promise.reject();
}
function getSubscriptionOptions() {
var options = [];
options.push({
id: 'embypremiere',
title: globalize.translate('sharedcomponents#HeaderBecomeProjectSupporter'),
requiresEmail: false
});
return Promise.resolve(options);
}
function isUnlockedByDefault(feature, options) {
var autoUnlockedFeatures = appHost.unlockedFeatures ? appHost.unlockedFeatures() : [];
if (autoUnlockedFeatures.indexOf(feature) != -1) {
return Promise.resolve();
}
return Promise.reject();
}
function getAdminFeatureName(feature) {
return feature;
}
function getRestoreButtonText() {
return globalize.translate('sharedcomponents#ButtonAlreadyPaid');
}
2016-10-15 18:12:16 -04:00
function getPeriodicMessageIntervalMs(feature) {
if (feature == 'playback') {
return 259200000;
}
return 0;
}
2016-10-14 12:22:04 -04:00
return {
getProductInfo: getProductInfo,
beginPurchase: beginPurchase,
restorePurchase: restorePurchase,
getSubscriptionOptions: getSubscriptionOptions,
isUnlockedByDefault: isUnlockedByDefault,
getAdminFeatureName: getAdminFeatureName,
2016-10-15 18:12:16 -04:00
getRestoreButtonText: getRestoreButtonText,
getPeriodicMessageIntervalMs: getPeriodicMessageIntervalMs
2016-10-14 12:22:04 -04:00
};
});