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

update translations

This commit is contained in:
Luke Pulverenti 2015-05-26 11:31:50 -04:00
parent 4e86a39f8c
commit 28f378f8db
19 changed files with 284 additions and 64 deletions

View file

@ -1082,6 +1082,17 @@
});
};
self.getRegistrationInfo = function (feature) {
var url = self.getUrl("Registrations/" + feature);
return self.ajax({
type: "GET",
url: url,
dataType: "json"
});
};
/**
* Gets the current server status
*/

View file

@ -1221,6 +1221,12 @@
});
};
self.getRegistrationInfo = function (feature, apiClient) {
return apiClient.getRegistrationInfo(feature);
};
return self;
};

View file

@ -0,0 +1,34 @@
(function () {
function onSuccess() {
console.log('Immersive mode succeeded');
}
function onError() {
console.log('Immersive mode failed');
}
//// Is this plugin supported?
//AndroidFullScreen.isSupported();
//// Is immersive mode supported?
//AndroidFullScreen.isImmersiveModeSupported(successFunction, errorFunction);
//// The width of the screen in immersive mode
//AndroidFullScreen.immersiveWidth(trace, errorFunction);
//// The height of the screen in immersive mode
//AndroidFullScreen.immersiveHeight(trace, errorFunction);
//// Hide system UI until user interacts
//AndroidFullScreen.leanMode(successFunction, errorFunction);
//// Show system UI
//AndroidFullScreen.showSystemUI(successFunction, errorFunction);
//// Extend your app underneath the system UI (Android 4.4+ only)
//AndroidFullScreen.showUnderSystemUI(successFunction, errorFunction);
//// Hide system UI and keep it hidden (Android 4.4+ only)
//AndroidFullScreen.immersiveMode(successFunction, errorFunction);
})();

View file

@ -92,7 +92,7 @@
getEndpointInfo().done(function (endpoint) {
if (endpoint.IsLocal || endpoint.IsInNetwork) {
ApiClient.getSystemInfo().done(function (info) {
ApiClient.getPublicSystemInfo().done(function (info) {
message.serverAddress = info.LocalAddress;
sendMessageInternal(message);

View file

@ -18,33 +18,6 @@
});
}
function getExternalPlayers(url, mimeType) {
var deferred = $.Deferred();
window.plugins.launcher.canLaunch({
uri: url,
dataType: mimeType,
getAppList: true
}, function (data) {
console.log('plugin canLaunch succcess');
var players = data.appList.map(function (p) {
});
deferred.resolveWith(null, [players]);
}, function () {
console.log('plugin canLaunch error');
deferred.reject();
});
deferred.resolveWith(null, [players]);
return deferred.promise();
}
window.ExternalPlayer.getExternalPlayers = getExternalPlayers;
window.ExternalPlayer.showPlayerSelectionMenu = showPlayerSelectionMenu;
})();

View file

@ -1,28 +1,105 @@
(function () {
function validatePlayback(deferred) {
var updatedProducts = [];
function updateProductInfo(p) {
updatedProducts = updatedProducts.filter(function (r) {
return r.alias != p.alias;
});
updatedProducts.push(p);
}
function isAndroid() {
var platform = (device.platform || '').toLowerCase();
return platform.indexOf('android') != -1;
}
function validatePlayback(deferred) {
// Don't require validation on android
if (platform.indexOf('android') != -1) {
if (isAndroid()) {
deferred.resolve();
return;
}
deferred.resolve();
validateFeature({
id: 'appunlock',
alias: "premium features"
}, deferred);
}
function validateLiveTV(deferred) {
var platform = (device.platform || '').toLowerCase();
// Don't require validation if not android
if (platform.indexOf('android') == -1) {
if (!isAndroid()) {
deferred.resolve();
return;
}
validateFeature({
id: 'premiumunlock',
alias: "premium features"
}, deferred);
}
function validateSmb(deferred) {
// Don't require validation if not android
if (!isAndroid()) {
deferred.resolve();
return;
}
validateFeature({
id: 'premiumunlock',
alias: "premium features"
}, deferred);
}
function validateFeature(info, deferred) {
var products = updatedProducts.filter(function (r) {
return r.alias == info.alias;
});
var product = products.length ? products[0] : null;
if (product && product.owned) {
deferred.resolve();
return;
}
// Get supporter status
ConnectionManager.getRegistrationInfo('appunlock', ApiClient).done(function (registrationInfo) {
if (registrationInfo.IsRegistered) {
deferred.resolve();
return;
}
showInAppPurchaseInfo(info, product, registrationInfo, deferred);
}).fail(function () {
deferred.reject();
});
}
function showInAppPurchaseInfo(info, product, serverRegistrationInfo, deferred) {
var requiresLocalValidation = serverRegistrationInfo.IsLocalValidationRequired;
var canPurchase = product != null && product.canPurchase;
// Can only purchase if product != null
deferred.resolve();
}
@ -57,4 +134,82 @@
}
};
function validateProduct(product, callback) {
// product attributes:
// https://github.com/j3k0/cordova-plugin-purchase/blob/master/doc/api.md#validation-error-codes
callback(true, {
});
//callback(true, { ... transaction details ... }); // success!
//// OR
//callback(false, {
// error: {
// code: store.PURCHASE_EXPIRED,
// message: "XYZ"
// }
//});
//// OR
//callback(false, "Impossible to proceed with validation");
}
function initializeStore() {
// Let's set a pretty high verbosity level, so that we see a lot of stuff
// in the console (reassuring us that something is happening).
store.verbosity = store.INFO;
store.validator = validateProduct;
if (isAndroid) {
store.register({
id: "premiumunlock",
alias: "premium features",
type: store.NON_CONSUMABLE
});
} else {
// iOS
store.register({
id: "appunlock",
alias: "premium features",
type: store.NON_CONSUMABLE
});
}
// When purchase of the full version is approved,
// show some logs and finish the transaction.
store.when("premium feautres").approved(function (order) {
log('You just unlocked the FULL VERSION!');
order.finish();
});
// The play button can only be accessed when the user
// owns the full version.
store.when("premium feautres").updated(function (product) {
updateProductInfo(product);
});
// When every goes as expected, it's time to celebrate!
// The "ready" event should be welcomed with music and fireworks,
// go ask your boss about it! (just in case)
store.ready(function () {
console.log("Store ready");
// After we've done our setup, we tell the store to do
// it's first refresh. Nothing will happen if we do not call store.refresh()
store.refresh();
});
}
// We must wait for the "deviceready" event to fire
// before we can use the store object.
initializeStore();
})();

View file

@ -90,6 +90,17 @@
console.log('chrome.sockets.udp.create');
chrome.sockets.udp.create(function (createInfo) {
if (!createInfo) {
console.log('create fail');
deferred.resolveWith(null, [servers]);
return;
}
if (!createInfo.socketId) {
console.log('create fail');
deferred.resolveWith(null, [servers]);
return;
}
socketId = createInfo.socketId;
console.log('chrome.sockets.udp.bind');