XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 1
返回提交历史

XFEstudio/gpt4free

Fix show new Window Button

ad5d09fb
hlohaus <983577+hlohaus@users.noreply.github.com>
提交于

代码差异

2 个文件 +9 -10
Modified g4f/gui/client/demo.html +5 -5
@@ -181,7 +181,6 @@
181 181 <script>
182 182 (async () => {
183 183 const isIframe = window.self !== window.top;
184 const button = document.querySelector('form a.button');
185 184 let url = new URL(window.location.href)
186 185 let params = new URLSearchParams(url.search);
187 186 if (params.get("__sign")) {
@@ -190,9 +189,6 @@
190 189 window.location.replace("/");
191 190 }
192 191 }
193 if (isIframe) {
194 button.classList.remove('hidden');
195 }
196 192 })();
197 193 </script>
198 194 <script src="https://unpkg.com/es-module-shims@1.7.0/dist/es-module-shims.js"></script>
@@ -236,7 +232,11 @@
236 232 import * as hub from "@huggingface/hub";
237 233 import { init } from "@huggingface/space-header";
238 234
239 if (window.self === window.top) {
235 const isIframe = window.self !== window.top;
236 const button = document.querySelector('form a.button');
237 if (isIframe) {
238 button.classList.remove('hidden');
239 } else {
240 240 init("roxky/g4f-space");
241 241 }
242 242
Modified g4f/gui/client/static/js/chat.v1.js +4 -5
@@ -811,19 +811,18 @@ async function add_message_chunk(message, message_id, provider, scroll, finish_m
811 811 log_storage.appendChild(p);
812 812 await api("log", {...message, provider: provider_storage[message_id]});
813 813 } else if (message.type == "preview") {
814 if (content_map.inner.clientHeight > 200)
815 content_map.inner.style.height = content_map.inner.clientHeight + "px";
816 814 if (img = content_map.inner.querySelector("img"))
817 815 if (!img.complete)
818 816 return;
819 817 else
820 818 img.src = message.images;
821 else
822 content_map.inner.innerHTML = markdown_render(message.preview);
819 else {
820 content_map.inner.innerHTML = markdown_render(message.preview);
821 await register_message_images();
822 }
823 823 } else if (message.type == "content") {
824 824 message_storage[message_id] += message.content;
825 825 update_message(content_map, message_id, null, scroll);
826 content_map.inner.style.height = "";
827 826 } else if (message.type == "log") {
828 827 let p = document.createElement("p");
829 828 p.innerText = message.log;