move all viewer scripts to javascript

This commit is contained in:
Fornax committed 2020-01-21 15:33:09 +01:00
1 parent 10cbc809ad
commit df278b5e7d
14 files changed
+329 -411

No files matched your search

+5 -2
View File
@@ -92,7 +92,7 @@
</div>
<div id="filepreview" class="file_viewer_file_preview">
<div class="image" style="margin-top: 20%; width: 100px; height: 100px;">{{template "spinner.svg" .}}</div>
<div class="center" style="width: 100px; height: 100px;">{{template "spinner.svg" .}}</div>
</div>
</div>
<div id="sponsors" class="sponsors">
@@ -163,11 +163,14 @@
{{template `ImageViewer.js`}}
{{template `VideoViewer.js`}}
{{template `AudioViewer.js`}}
{{template `PDFViewer.js`}}
{{template `TextViewer.js`}}
{{template `FileViewer.js`}}
// This info gets filled in on the server side to prevent having to make an API call right after the page loads.
// Just to slice another few milliseconds from the load time :)
window.addEventListener("load", function(){
new Viewer('{{.Other.Type}}', {{.Other.APIResponse}});
new Viewer('{{.Other.Type}}', '{{.Other.ViewToken}}', {{.Other.APIResponse}});
});
</script>