forked from XimeX/usrspace-browser-addon
simplify updateSpaceApiJson
This commit is contained in:
parent
6c95aa978e
commit
859f9bce19
|
@ -109,14 +109,8 @@ function updateNextEvent(nextEvents) {
|
||||||
* @param {object} spaceApi
|
* @param {object} spaceApi
|
||||||
*/
|
*/
|
||||||
function updateSpaceApiJson(spaceApi) {
|
function updateSpaceApiJson(spaceApi) {
|
||||||
const json = JSON.stringify(spaceApi, null, 2)
|
|
||||||
.replace(/ /g, ' ')
|
|
||||||
.replace(/\n/g, '<br/>');
|
|
||||||
const spaceApiElement = document.querySelector('#space-api > code');
|
const spaceApiElement = document.querySelector('#space-api > code');
|
||||||
spaceApiElement.innerHTML = json;
|
spaceApiElement.textContent = JSON.stringify(spaceApi, null, 2);
|
||||||
// const jsonNode = document.createTextNode(json);
|
|
||||||
// spaceApiElement.innerText = '';
|
|
||||||
// spaceApiElement.append(jsonNode);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue