jellyfin-web/dashboard-ui/thirdparty/cordova/registrationservices.js
2015-05-22 16:15:29 -04:00

60 lines
1.3 KiB
JavaScript

(function () {
function validatePlayback(deferred) {
var platform = (device.platform || '').toLowerCase();
// Don't require validation on android
if (platform.indexOf('android') != -1) {
deferred.resolve();
return;
}
deferred.resolve();
}
function validateLiveTV(deferred) {
var platform = (device.platform || '').toLowerCase();
// Don't require validation if not android
if (platform.indexOf('android') == -1) {
deferred.resolve();
return;
}
deferred.resolve();
}
window.RegistrationServices = {
renderPluginInfo: function (page, pkg, pluginSecurityInfo) {
},
addRecurringFields: function (page, period) {
},
initSupporterForm: function (page) {
$('.recurringSubscriptionCancellationHelp', page).html('');
},
validateFeature: function (name) {
var deferred = DeferredBuilder.Deferred();
if (name == 'playback') {
validatePlayback();
} else if (name == 'livetv') {
validateLiveTV();
} else {
deferred.resolve();
}
return deferred.promise();
}
};
})();