Skip to content

Commit

Permalink
Change doc format
Browse files Browse the repository at this point in the history
  • Loading branch information
rachfop committed May 11, 2024
1 parent def9db1 commit 8a39835
Show file tree
Hide file tree
Showing 250 changed files with 64,801 additions and 2,515 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI-api-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
--make-html \
--html-output=./docs/api \
--project-base-dir="." \
--docformat=restructuredtext \
--docformat=epytext \
--intersphinx=https://docs.python.org/3/objects.inv \
./runpod
Expand Down
50 changes: 50 additions & 0 deletions docs/api/ajax.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// Implement simple cached AJAX functions.

var _cache = {};

/*
* Get a promise for the HTTP get responseText.
*/
function httpGetPromise(url) {
const promise = new Promise((_resolve, _reject) => {
httpGet(url, (responseText) => {
_resolve(responseText);
},
(error) => {
_reject(error);
});
});
return promise
}

function httpGet(url, onload, onerror) {
if (_cache[url]) {
_cachedHttpGet(url, onload, onerror);
}
else{
_httpGet(url, onload, onerror);
}
}

function _cachedHttpGet(url, onload, onerror) {
setTimeout(() => { onload(_cache[url]) }, 0);
}

function _httpGet(url, onload, onerror) {

var xobj = new XMLHttpRequest();
xobj.open('GET', url, true); // Asynchronous

xobj.onload = function () {
// add document to cache.
_cache[url] = xobj.responseText;
onload(xobj.responseText);
};

xobj.onerror = function (error) {
console.log(error)
onerror(error)
};

xobj.send(null);
}
Loading

0 comments on commit 8a39835

Please sign in to comment.