Skip to content

Commit

Permalink
Merge pull request #28 from subodh30/documentation
Browse files Browse the repository at this point in the history
Documentation + UI changes
  • Loading branch information
subodh30 authored Dec 5, 2022
2 parents 4ec4a1e + 3cfbf05 commit 7dde8d6
Show file tree
Hide file tree
Showing 36 changed files with 9,517 additions and 29 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docs-gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
./docs_generator.sh ${{ env.MODULE_PATHS }}
- name: Commit changes
run: |
git config --global user.name "TejasPrabhu"
git config --global user.email "tejas.prabhu29n@gmail.com"
git config --global user.name "subodh30"
git config --global user.email "subodhsgujar@gmail.com"
git add .
git commit -m "Update documentation" -a || true
git push
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
with:
mongodb-version: 6.0
- name: Run flake8
run: flake8 --max-line-length=120 --extend-ignore=E225
run: flake8 --ignore=E1,E2,E3,E4,W2,F4 --max-line-length=120 --extend-ignore=E225
- name: Run All tests and generate Report
run: |
coverage run -m pytest -rA
Expand Down
50 changes: 50 additions & 0 deletions docs/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 7dde8d6

Please sign in to comment.