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

update some strings and use fetch for the global config

This commit is contained in:
dkanada 2020-02-16 22:11:36 +09:00
parent ea9e79f4d3
commit ed1b35f50f
8 changed files with 34 additions and 53 deletions

View file

@ -1,29 +1,16 @@
define(['appStorage', 'events'], function (appStorage, events) {
'use strict';
function readConfig(path, callback) {
var file = new XMLHttpRequest();
file.overrideMimeType("application/json");
file.open("GET", path, true);
file.onreadystatechange = function() {
if (file.readyState === 4 && file.status == "200") {
callback(file.responseText);
}
}
file.send(null);
}
var data = {};
function WebSettings() {
readConfig("/config.json", function(text) {
data = JSON.parse(text);
});
fetch("/config.json").then(function (response) {
data = response.json();
})
}
WebSettings.prototype.getMultiserver = function () {
return data.multiserver !== false;
WebSettings.prototype.getMultiServer = function () {
return data.multiServer || false;
};
return new WebSettings();