jellyfin-web/dashboard-ui/thirdparty/cordova/registrationservices.js
2015-05-23 16:44:15 -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(deferred);
} else if (name == 'livetv') {
validateLiveTV(deferred);
} else {
deferred.resolve();
}
return deferred.promise();
}
};
})();