Skip to content

Commit

Permalink
html script
Browse files Browse the repository at this point in the history
  • Loading branch information
wwayne committed May 27, 2024
1 parent 55ce2ee commit 4cafdbf
Showing 1 changed file with 27 additions and 24 deletions.
51 changes: 27 additions & 24 deletions clients/vscode/src/ChatViewProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,27 +59,15 @@ export class ChatViewProvider implements WebviewViewProvider {
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Tabby</title>
</head>
<style>
html, body {
background: transparent;
}
html, body, iframe {
padding: 0;
margin: 0;
box-sizing: border-box;
overflow: hidden;
}
iframe {
border-width: 0;
width: 100%;
height: 100vh;
}
</style>
<body>
<script>const vscode = acquireVsCodeApi();</script>
<title>Tabby</title>
<link rel="preconnect" href="${server.endpoint}">
<script defer>
const vscode = acquireVsCodeApi();
function iframeLoaded () {
vscode.postMessage({ action: 'rendered' });
}
window.onload = function () {
const chatIframe = document.getElementById("chat");
Expand Down Expand Up @@ -108,15 +96,30 @@ export class ChatViewProvider implements WebviewViewProvider {
});
}
</script>
<script>
function iframeLoaded () {
vscode.postMessage({ action: 'rendered' });
<style>
html, body {
background: transparent;
}
</script>
html, body, iframe {
padding: 0;
margin: 0;
box-sizing: border-box;
overflow: hidden;
}
iframe {
border-width: 0;
width: 100%;
height: 100vh;
}
</style>
</head>
<body>
<iframe
id="chat"
src="${server.endpoint}/chat?max-width=5xl"
onload="iframeLoaded(this)" />
</body>
</html>
`;
Expand Down

0 comments on commit 4cafdbf

Please sign in to comment.