gristlabs_grist-core/test/fixtures/sites/probe/page.js
Jarosław Sadziński 2438a63255 (core) Moving widget tests to core
Summary:
- Custom widget tests are now in grist-core
- Adding buildtools for grist-plugin-api.js

Test Plan: Existing tests

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D3617
2022-09-06 17:17:14 +02:00

21 lines
521 B
JavaScript

/* global document, grist, window */
grist.ready();
function readDoc() {
const api = grist.rpc.getStub("GristDocAPI@grist", grist.checkers.GristDocAPI);
const placeholder = document.getElementById('placeholder');
const fallback = setTimeout(() => {
placeholder.innerHTML = '<div id="output">no joy</div>';
}, 1000);
api.listTables()
.then(tables => {
clearTimeout(fallback);
placeholder.innerHTML = `<div id="output">${JSON.stringify(tables)}</div>`;
});
}
window.onload = readDoc;