29 lines
894 B
JavaScript
29 lines
894 B
JavaScript
import PickleComplate from "../vendor/picomplete/picomplete";
|
|
|
|
(function () {
|
|
const pickle_config = {
|
|
target: '#from_select',
|
|
suggest: ["alias", "abbr"],
|
|
clickCallback: (target, node) => {
|
|
target.value = node.value;
|
|
}
|
|
};
|
|
let local_data_string = window.localStorage.getItem("append_from_list");
|
|
if (!local_data_string) {
|
|
return fetch("/construct/programs/append/from_list", {
|
|
"method": "GET",
|
|
}).then((response) => response.json()).then((data) => {
|
|
window.localStorage.setItem("append_from_list", JSON.stringify(data));
|
|
new PickleComplate({
|
|
data: data,
|
|
config: pickle_config,
|
|
})
|
|
});
|
|
} else {
|
|
new PickleComplate({
|
|
data: JSON.parse(local_data_string),
|
|
config: pickle_config,
|
|
})
|
|
}
|
|
})()
|