Skip to content

Commit

Permalink
ro-crate previewer
Browse files Browse the repository at this point in the history
  • Loading branch information
ErykKul committed Sep 29, 2023
1 parent 45fd6fe commit c50f970
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
1 change: 1 addition & 0 deletions previewers/betatest/ROCrate.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<title class="rocratePreviewText">RO-Crate Preview</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript" src="js/xss.js"></script>
<script type="text/javascript" src="js/ro-crate-dynamic.js"></script>
<script type="text/javascript" src="js/rocrate.js"></script>
<script src="lib/jquery.i18n.js"></script>
<script src="lib/jquery.i18n.messagestore.js"></script>
Expand Down
10 changes: 0 additions & 10 deletions previewers/betatest/js/ro-crate-dynamic.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,6 @@ async function load() {
updatePage();
}

window.onhashchange = function () {
load();
};

window.onload = function () {
load();
};



async function updatePage() {
var hash = location.hash;

Expand Down
10 changes: 7 additions & 3 deletions previewers/betatest/js/rocrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ function translateBaseHtmlPage() {
async function writeContentAndData(data, fileUrl, file, title, authors) {
addStandardPreviewHeader(file, title, authors);
$('.preview').append($("<script type=\"application/ld+json\"/>").html(data));
var s = document.createElement('script');
s.setAttribute('src', 'js/ro-crate-dynamic.js');
document.body.appendChild(s);
window.onhashchange = function () {
load();
};
window.onload = function () {
load();
};
load();
}

0 comments on commit c50f970

Please sign in to comment.