Make request GET method and fix fullscreen

This commit is contained in:
kwaroran
2024-03-21 03:27:22 +09:00
parent 327cd701b0
commit 495dd64eb7
4 changed files with 9 additions and 21 deletions

View File

@@ -26,6 +26,7 @@ body{
--risu-theme-textcolor2: #64748b;
--risu-theme-darkborderc: #4b5563;
--risu-theme-darkbutton: #374151;
--risu-height-size: 100%;
}
@@ -36,7 +37,7 @@ body{
}
html, body{
height: 100%
height: var(--risu-height-size);
}
.chattext p{

View File

@@ -169,12 +169,7 @@ export async function characterURLImport() {
url.searchParams.delete('realm');
window.history.pushState(null, '', url.toString());
const res = await fetch(`${hubURL}/hub/info`,{
method: "POST",
body: JSON.stringify({
id: realmPath
})
})
const res = await fetch(`${hubURL}/hub/info/${realmPath}`)
if(res.status !== 200){
alertError(await res.text())
return
@@ -826,13 +821,7 @@ export async function downloadRisuHub(id:string) {
type: "wait",
msg: "Downloading..."
})
const res = await fetch(hubURL + '/hub/get', {
method: "POST",
body: JSON.stringify({
id: id,
apiver: 3
})
})
const res = await fetch(hubURL + '/hub/get/' + id)
if(res.status !== 200){
alertError(await res.text())
return

View File

@@ -376,6 +376,7 @@ export function setDatabase(data:Database){
data.modules ??= []
data.enabledModules ??= []
data.additionalParams ??= []
data.heightMode ??= 0
changeLanguage(data.language)
DataBase.set(data)
@@ -602,6 +603,7 @@ export interface Database{
sideMenuRerollButton?:boolean
requestInfoInsideChat?:boolean
additionalParams:[string, string][]
heightMode:number
}
export interface customscript{

View File

@@ -1560,13 +1560,9 @@ export function textifyReadableStream(stream:ReadableStream<Uint8Array>){
}
export function toggleFullscreen(){
// @ts-ignore
const requestFullscreen = document.documentElement.requestFullscreen ?? document.documentElement.webkitRequestFullscreen as typeof document.documentElement.requestFullscreen
// @ts-ignore
const exitFullscreen = document.exitFullscreen ?? document.webkitExitFullscreen as typeof document.exitFullscreen
// @ts-ignore
const fullscreenElement = document.fullscreenElement ?? document.webkitFullscreenElement as typeof document.fullscreenElement
fullscreenElement ? exitFullscreen() : requestFullscreen({
const fullscreenElement = document.fullscreenElement
fullscreenElement ? document.exitFullscreen() : document.documentElement.requestFullscreen({
navigationUI: "hide"
})
}