mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
vulcanize
This commit is contained in:
parent
07df993238
commit
55e40bdcf7
52 changed files with 12309 additions and 33 deletions
46
dashboard-ui/cordova/android/androidcredentials.js
vendored
Normal file
46
dashboard-ui/cordova/android/androidcredentials.js
vendored
Normal file
|
@ -0,0 +1,46 @@
|
|||
(function () {
|
||||
|
||||
function updateCredentials() {
|
||||
|
||||
console.log('sending updated credentials to ApiClientBridge');
|
||||
|
||||
var json = JSON.stringify(ConnectionManager.credentialProvider().credentials());
|
||||
var credentials = JSON.parse(json);
|
||||
|
||||
for (var i = 0, length = credentials.Servers.length; i < length; i++) {
|
||||
var server = credentials.Servers[i];
|
||||
|
||||
if (server.DateLastAccessed != null) {
|
||||
server.DateLastAccessed = new Date(server.DateLastAccessed).toISOString();
|
||||
}
|
||||
}
|
||||
|
||||
json = JSON.stringify(credentials);
|
||||
ApiClientBridge.updateCredentials(json);
|
||||
}
|
||||
|
||||
function initNativeConnectionManager() {
|
||||
|
||||
console.log('initNativeConnectionManager');
|
||||
|
||||
var capabilities = ConnectionManager.capabilities();
|
||||
|
||||
ApiClientBridge.init(AppInfo.appName, AppInfo.appVersion, AppInfo.deviceId, AppInfo.deviceName, JSON.stringify(capabilities));
|
||||
|
||||
//initAjax();
|
||||
}
|
||||
|
||||
Events.on(ConnectionManager.credentialProvider(), 'credentialsupdated', updateCredentials);
|
||||
|
||||
updateCredentials();
|
||||
initNativeConnectionManager();
|
||||
|
||||
window.AndroidAjax = {
|
||||
|
||||
onResponse: function (id, status, response) {
|
||||
|
||||
Events.trigger(AndroidAjax, 'response' + id, [status, response]);
|
||||
}
|
||||
};
|
||||
|
||||
})();
|
Loading…
Add table
Add a link
Reference in a new issue