wrapperr/web/get_functions.js
aunefyren 266c51556e Many changes
Rewrote file write/read process
Frontend and backend now respects the root setting
Fixed some form bugs
2022-12-03 13:06:48 +01:00

30 lines
No EOL
1.2 KiB
JavaScript

function get_functions() {
config_form = {};
var config_data = JSON.stringify(config_form);
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var result = JSON.parse(this.responseText);
if(result.error) {
document.getElementById("search_wrapped_button").disabled = false;
document.getElementById("search_wrapped_button").style.opacity = '1';
document.getElementById("plex_signout_button").disabled = false;
document.getElementById("plex_signout_button").style.opacity = '1';
document.getElementById('results_error').innerHTML = result.message;
} else {
functions = result.wrapperr_customize;
functions.plex_auth = result.plex_auth
functions.create_share_links = result.create_share_links
functions.wrapperr_version = result.wrapperr_version
get_stats();
}
}
};
xhttp.withCredentials = true;
xhttp.open("post", api_url + "get/functions");
xhttp.send(config_data);
}