aboutsummaryrefslogtreecommitdiff
path: root/common/ajax.js
blob: 8082bbedcadc7b7b3fa25a36cbb33bacd6053a74 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
 * part of Hachette
 * Wrapping XMLHttpRequest into a Promise.
 *
 * Copyright (C) 2021 Wojtek Kosior
 * Redistribution terms are gathered in the `copyright' file.
 */

function ajax_callback()
{
    if (this.readyState == 4)
	this.resolve_callback(this);
}

function initiate_ajax_request(resolve, reject, method, url)
{
    const xhttp = new XMLHttpRequest();
    xhttp.resolve_callback = resolve;
    xhttp.onreadystatechange = ajax_callback;
    xhttp.open(method, url, true);
    try {
	xhttp.send();
    } catch(e) {
	console.log(e);
	setTimeout(reject, 0);
    }
}

function make_ajax_request(method, url)
{
    return new Promise((resolve, reject) =>
		       initiate_ajax_request(resolve, reject, method, url));
}

/*
 * EXPORTS_START
 * EXPORT make_ajax_request
 * EXPORTS_END
 */
ource snippet a bit, leveraging the new support for using an external plfit library. Maxim Cournoyer 2022-01-10gnu: python-plotly: Remove obsolete phase....* gnu/packages/graph.scm (python-plotly)[arguments]<#:phases>: Remove 'make-files-writable phase. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Sarah Morgensen 2022-01-10gnu: python-igraph: Update to 0.9.8....* gnu/packages/graph.scm (python-igraph): Update to 0.9.8. [origin]: Fetch from git. [configure-flags]: Delete argument. [phases]{build}: No longer override phase. {check}: Preserve ordering and streamline. {specify-libigraph-location}: New phase. [native-inputs]: Remove pkg-config. [home-page]: Update. Maxim Cournoyer 2022-01-10gnu: igraph: Update to 0.9.5....* gnu/packages/graph.scm (igraph): Update to 0.9.5. [source]: Add snippet to fully unbundle. [build-system]: Use cmake-build-system. [configure-flags]: Replace all by just '-DBUILD_SHARED_LIBS=ON'. [native-inputs]: Add pkg-config. [inputs]{zlib}: Delete input. {arpack-ng, plfit, suitesparse}: New inputs. Maxim Cournoyer 2022-01-10gnu: Add plfit....* gnu/packages/graph.scm (plfit): New variable. Maxim Cournoyer 2021-12-29gnu: python-plotly: Fix trailing whitespace in description....* gnu/packages/graph.scm (python-plotly)[description]: Fix trailing whitespace. Vagrant Cascadian 2021-12-17gnu: python-graph-tool: Remove input labels....* gnu/packages/graph.scm (python-graph-tool)[arguments]: Import SITE-PACKAGES from (guix build python-build-system), and use instead of homegrown procedure. [native-inputs, inputs]: Remove labels. Marius Bakke 2021-12-17gnu: python-graph-tool: Build with Cairomm 1.14....* gnu/packages/graph.scm (python-graph-tool)[inputs]: Change from CAIROMM to CAIROMM-1.14. Marius Bakke 2021-12-17gnu: Remove unneeded uses of custom GCC versions....* gnu/packages/bioinformatics.scm (libmaus2, biobambam2)[native-inputs]: Remove GCC-10. * gnu/packages/game-development.scm (libresprite, python-pyxel)[native-inputs]: Likewise. * gnu/packages/lua.scm (emilua)[native-inputs]: Likewise. * gnu/packages/radio.scm (sdr++)[native-inputs]: Likewise. * gnu/packages/wm.scm (fnott)[native-inputs]: Likewise. * gnu/packages/text-editors.scm (kakoune)[native-inputs]: Likewise. (scintilla)[native-inputs]: Remove GCC-9. * gnu/packages/build-tools.scm (bear)[native-inputs]: Likewise. * gnu/packages/cpp.scm (magic-enum)[native-inputs]: Likewise. * gnu/packages/games.scm (openttd)[native-inputs]: Likewise. (schiffbruch)[native-inputs]: Remove GCC-11. * gnu/packages/music.scm (liquidsfz, geonkick)[native-inputs]: Remove GCC-9. * gnu/packages/fcitx5.scm (fcitx5, libime, fcitx5-configtool)[native-inputs]: Likewise. * gnu/packages/wine.scm (dxvk32)[native-inputs]: Likewise. * gnu/packages/ftp.scm (libfilezilla)[native-inputs]: Remove GCC-8. * gnu/packages/image.scm (blurhash)[native-inputs]: Likewise. * gnu/packages/jami.scm (libring)[native-inputs]: Likewise. * gnu/packages/pdf.scm (xournalpp)[native-inputs]: Likewise. * gnu/packages/telegram.scm (webrtc-for-telegram-desktop, telegram-desktop)[native-inputs]: Likewise. Marius Bakke 2021-12-13gnu: Simplify package inputs....This commit was obtained by running: ./pre-inst-env guix style without any additional argument. Ludovic Courtès 2021-07-20gnu: python-graph-tool: Sort inputs alphabetically....* gnu/packages/graph.scm (python-graph-tool)[native-inputs]: Sort alphabetically. [inputs]: Same. [propagated-inputs]: Same. Efraim Flashner 2021-07-20gnu: python-graph-tool: Update to 2.43....* gnu/packages/graph.scm (python-graph-tool): Update to 2.43. Signed-off-by: Efraim Flashner <efraim@flashner.co.il> Alexandre Hannud Abdo 2021-06-29gnu: python2-plotly: Remove package....* gnu/packages/graph.scm (python2-plotly): Remove variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> zimoun 2021-05-15gnu: Add python-graph-tool....* gnu/packages/graph.scm (python-graph-tool): New variable. Signed-off-by: Marius Bakke <marius@gnu.org> Alexandre Hannud Abdo 2021-04-25gnu: Add python-louvain 0.15....* gnu/packages/graph.scm (python-louvain): Rename variable to python-louvain-0.6. (python-louvain): New variable. * gnu/packages/bioinformatics.scm (python-scanpy)[propagated-inputs]: Use python-louvain-0.6. Co-authored-by: Leo Famulari <leo@famulari.name> Vinicius Monego 2021-03-04gnu: python-plotly: Allow test phase to be skipped....* gnu/packages/graph.scm (python-plotly)[arguments]: Wrap custom 'check phase tests with test with tests? keyword. Efraim Flashner 2021-03-04gnu: python-plotly: Update to 4.14.3....* gnu/packages/graph.scm (python-plotly): Update to 4.14.3. [propagated-inputs]: Remove python-decorator. Add python-ipython, python-pillow. Move python-ipywidgets, python-xarray ... [native-inputs]: ... to here. Efraim Flashner