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:
parent
ea9e79f4d3
commit
ed1b35f50f
8 changed files with 34 additions and 53 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue