Skip to content

Commit c5990a8

Browse files
committed
refactor
1 parent 61f2fcc commit c5990a8

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

index.html

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
<!-- S3 Bucket Explorer Version: 3.0.7 -->
1+
<!-- S3 Bucket Explorer Version: 3.0.8 -->
22

33
<!DOCTYPE html>
44
<html lang="en" style="overflow-y: auto;">
55

66
<head>
7+
<!-- Configuration -->
78
<script>
89
const config = {
910
title: 'Bucket Browser', // prefix value with `HTML> ` to render as html, see subtitle
@@ -68,7 +69,7 @@
6869
integrity="sha384-rEobhniwlwAquQiUTy2McGJWpm0H1EpkURdLKoThh6Lv2fkuM2NPIX64ptgfC8Me"
6970
crossorigin="anonymous"></script>
7071

71-
<!-- Style -->
72+
<!-- Explorer App Style -->
7273
<style>
7374
body {
7475
width: 100vw;
@@ -225,7 +226,7 @@
225226
<body>
226227

227228
<!-- Explorer App-->
228-
<div id="app" v-cloak>
229+
<div id="app" style="display: none;">
229230
<div :style="cssVars">
230231
<!-- Header -->
231232
<div class="level">
@@ -569,7 +570,7 @@ <h2 class="subtitle" v-html="config.subtitleHTML"></h2>
569570
}
570571
</script>
571572

572-
<!-- Main Script -->
573+
<!-- Config Script -->
573574
<script>
574575
const htmlPrefix = 'HTML>'
575576
if (config.title) {
@@ -652,9 +653,13 @@ <h2 class="subtitle" v-html="config.subtitleHTML"></h2>
652653

653654
document.title = config.title
654655
document.getElementById('favicon').href = config.favicon
656+
</script>
655657

658+
<!-- Main Script -->
659+
<script>
656660
const initialHashValue = decodeURIComponent(window.location.hash).replace(/^#/, '') || ''
657661
const initialHashValueParams = new URLSearchParams(initialHashValue.replace(/^.*?(\?|$)/, ''))
662+
// preview mode
658663
if (initialHashValueParams.get('preview')) {
659664
document.getElementById('app').remove()
660665
document.getElementById('preview').style.display = 'block'
@@ -680,8 +685,11 @@ <h2 class="subtitle" v-html="config.subtitleHTML"></h2>
680685
function urlFromFilePath(filePath) {
681686
return `${(config.bucketMaskUrl || config.bucketUrl).replace(/\/*$/, '')}/${encodePath(filePath)}`
682687
}
683-
} else {
688+
}
689+
// explorer mode
690+
else {
684691
document.getElementById('preview').remove()
692+
document.getElementById('app').style.display = 'block'
685693

686694
const app = Vue.createApp({
687695
data() {

0 commit comments

Comments
 (0)