Skip to content
Snippets Groups Projects
Commit 88819792 authored by Matthias Konitzny's avatar Matthias Konitzny :fire:
Browse files

Merge branch 'master' into gitlab-ci

parents 26ffc5d4 923e0576
No related branches found
No related tags found
No related merge requests found
Pipeline #49466 failed
/*global ks_global*/
export const COLOR_PALETTE = [ export const COLOR_PALETTE = [
"rgb(104, 169, 77)", "rgb(104, 169, 77)",
"rgb(102, 75, 154)", "rgb(102, 75, 154)",
......
import { PLUGIN_PATH } from "../config"; /*global ks_global*/
import jQuery from "jquery"; import jQuery from "jquery";
/** /**
...@@ -55,9 +56,11 @@ export function listAllSpaces() { ...@@ -55,9 +56,11 @@ export function listAllSpaces() {
action: "list_spaces", action: "list_spaces",
}; };
return jQuery.ajax({ return jQuery
type: "POST", .ajax({
url: ks_global.ajax_url, type: "POST",
data: payload, url: ks_global.ajax_url,
}).then((data) => JSON.parse(data)["spaces"]); data: payload,
})
.then((data) => JSON.parse(data)["spaces"]);
} }
...@@ -15,7 +15,7 @@ function ks_add_graph($atts = []): string ...@@ -15,7 +15,7 @@ function ks_add_graph($atts = []): string
$script_path = 'build' . DIRECTORY_SEPARATOR . $GLOBALS['build'] . DIRECTORY_SEPARATOR . 'graph.js'; $script_path = 'build' . DIRECTORY_SEPARATOR . $GLOBALS['build'] . DIRECTORY_SEPARATOR . 'graph.js';
wp_enqueue_script("ks-display-js", plugins_url($script_path, __FILE__), array('jquery'), false); wp_enqueue_script("ks-display-js", plugins_url($script_path, __FILE__), array('jquery'), false);
ks_localize("ks-display-js"); ks_localize("ks-display-js", $atts);
return $div; return $div;
} }
...@@ -25,7 +25,7 @@ function ks_echo_graph($atts = []): void ...@@ -25,7 +25,7 @@ function ks_echo_graph($atts = []): void
echo ks_add_graph($atts); echo ks_add_graph($atts);
} }
function ks_localize($handle) function ks_localize($handle, $atts)
{ {
$space_id = kg_get_space_id_from_atts($atts); $space_id = kg_get_space_id_from_atts($atts);
$plugin_dir = plugin_dir_url(__FILE__); $plugin_dir = plugin_dir_url(__FILE__);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment