2021-03-08 18:45:06 +00:00
|
|
|
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) {
|
2021-12-12 16:31:15 +00:00
|
|
|
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;
|
2021-03-08 18:45:06 +00:00
|
|
|
} else {
|
|
|
|
functions = result;
|
2021-12-12 16:31:15 +00:00
|
|
|
if(!link_mode) {
|
|
|
|
get_stats();
|
|
|
|
} else {
|
|
|
|
load_page(results);
|
|
|
|
}
|
2021-03-08 18:45:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
xhttp.withCredentials = true;
|
2021-10-11 12:25:19 +00:00
|
|
|
xhttp.open("post", root + "api/get_functions.php");
|
2021-03-08 18:45:06 +00:00
|
|
|
xhttp.send(config_data);
|
|
|
|
}
|