Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ErykKul committed Oct 13, 2023
1 parent a141d22 commit f18ca32
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 5 additions & 0 deletions previewers/betatest/ROCrateDeltablot.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ <h1 class="page-title rocratePreviewText">RO-Crate Preview</h1>
<div class='preview-container'>
<div class='preview-header'></div>
<div class='preview'>
<script type="module">
import { Builder } from 'https://unpkg.com/@deltablot/[email protected]/dist/main.js';
const deltablot = {};
deltablot.Builder = Builder;
</script>
<div id='ro-crate-metadata'></div>
</div>
</div>
Expand Down
4 changes: 1 addition & 3 deletions previewers/betatest/js/rocrate-deltablot.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { Builder } from 'https://unpkg.com/@deltablot/[email protected]/dist/main.js';

document.querySelectorAll('[data-file]').forEach(el => {
displayContent(el.dataset.file);
});
Expand All @@ -13,7 +11,7 @@ function translateBaseHtmlPage() {
}

function writeContentAndData(data, fileUrl, file, title, authors) {
const builder = new Builder();
const builder = new deltablot.Builder();
const result = builder.parse(data);
const targetDiv = document.getElementById('ro-crate-metadata');
result.forEach(el => targetDiv.appendChild(el));
Expand Down

0 comments on commit f18ca32

Please sign in to comment.