@@ -16,7 +16,7 @@ const toastsE = document.getElementById("toasts")
1616document . getElementById ( "downgradeframe" ) . src = `https://oculusdb.rui2015.me/search?query=Beat+Saber&headsets=MONTEREY%2CHOLLYWOOD${ IsOnQuest ( ) ? `&isqavs=true` : `` } `
1717
1818function IsOnQuest ( ) {
19- return location . host . startsWith ( "127.0.0.1" )
19+ return location . host . startsWith ( "127.0.0.1" ) || location . host . startsWith ( "localhost" )
2020}
2121
2222function BrowserGo ( direction ) {
@@ -69,17 +69,21 @@ function UpdatePatchingStatus() {
6969 res . json ( ) . then ( res => {
7070 if ( res . isPatched ) {
7171 document . getElementById ( "modsButton" ) . style . visibility = "visible"
72+ document . getElementById ( "getModsButton" ) . style . visibility = "visible"
7273 patchStatus . innerHTML = "<h2>Game is already patched. You can install mods</h2>"
7374 } else if ( ! res . isInstalled ) {
7475 patchStatus . innerHTML = `<h2>Game is not installed. Please restore a backup or install the app so the game can get patched</h2>`
7576 document . getElementById ( "modsButton" ) . style . visibility = "hidden"
77+ document . getElementById ( "getModsButton" ) . style . visibility = "hidden"
7678 } else if ( res . canBePatched ) {
7779 patchStatus . innerHTML = `<h2>Game is not patched.</h2>
7880 <div class="button" onclick="PatchGame()">Patch it now</div>`
7981 document . getElementById ( "modsButton" ) . style . visibility = "hidden"
82+ document . getElementById ( "getModsButton" ) . style . visibility = "hidden"
8083 } else {
8184 patchStatus . innerHTML = "<h2>Game can not be modded</h2>"
8285 document . getElementById ( "modsButton" ) . style . visibility = "hidden"
86+ document . getElementById ( "getModsButton" ) . style . visibility = "hidden"
8387 }
8488
8589 if ( ! IsOnQuest ( ) && ! res . isPatched && false ) {
@@ -388,6 +392,7 @@ setInterval(() => {
388392 <div class="downloadProgressContainer">
389393 <div class="downloadProgressBar" style="width: ${ d . percentage * 100 } %;"></div>
390394 </div>
395+ <input type="button" class="DownloadText" value="Cancel" onclick="StopDownload('${ d . backupName } ')">
391396 <div class="DownloadText" style="color: ${ d . textColor } ;">
392397 ${ d . backupName } ${ d . percentageString } ${ d . doneString } / ${ d . totalString } ${ d . speedString } ETA ${ d . eTAString }
393398 </div>
@@ -738,6 +743,8 @@ window.onmessage = (e) => {
738743 OpenGetPasswordPopup ( )
739744}
740745document . getElementById ( "abortPassword" ) . onclick = ( ) => {
746+ document . getElementById ( "abortPassword" ) . innerHTML = "Abort Download"
747+ document . getElementById ( "confirmPassword" ) . style . display = "block"
741748 CloseGetPasswordPopup ( )
742749}
743750document . getElementById ( "confirmPassword" ) . onclick = ( ) => {
@@ -749,14 +756,17 @@ document.getElementById("confirmPassword").onclick = () => {
749756 TextBoxError ( "step7box" , text )
750757 } else if ( res . status == 200 ) {
751758 TextBoxGood ( "step7box" , text )
752- setTimeout ( ( ) => {
753- CloseGetPasswordPopup ( )
754- } , 5000 )
759+ document . getElementById ( "abortPassword" ) . innerHTML = "Close Popup"
760+ document . getElementById ( "confirmPassword" ) . style . display = "none"
755761 }
756762 } )
757763 } )
758764}
759765
766+ function StopDownload ( name ) {
767+ fetch ( `/canceldownload?name=${ name } ` )
768+ }
769+
760770document . getElementById ( "logs" ) . onclick = ( ) => {
761771 TextBoxText ( "logsText" , "Working.. please wait" )
762772 fetch ( "/questappversionswitcher/uploadlogs?password=" + document . getElementById ( "logspwd" ) . value ) . then ( res => {
0 commit comments