再修改亿些细节

This commit is contained in:
w_xiaolizu
2023-06-27 11:29:35 +08:00
parent 6d0c55f2c8
commit df320ea4fc
6 changed files with 38 additions and 34 deletions

View File

@ -72,6 +72,14 @@ mspace {
.sm_btn {
position: relative;
bottom: 5px;
height: 10%;
border-radius: 20px!important;
min-width: min(10%,100%) !important;
}
/* usage_display */
.insert_block {
position: relative;
bottom: 2px;
min-width: min(110px,100%) !important;
}
@ -253,20 +261,7 @@ textarea.svelte-1pie7s6 {
font-size: 12px !important;
}
/* usage_display */
.insert_block {
position: relative;
margin: 0;
padding: .5em 1em;
box-shadow: var(--block-shadow);
border-width: var(--block-border-width);
border-color: var(--block-border-color);
border-radius: var(--block-radius);
background: var(--block-background-fill);
width: 100%;
line-height: var(--line-sm);
min-height: 2em;
}
#usage_display p, #usage_display span {
margin: 0;
font-size: .85em;

View File

@ -58,8 +58,8 @@ function gradioLoaded(mutations) {
chat_txt = document.getElementById('chat_txt');
userInfoDiv = document.getElementById("user_info");
appTitleDiv = document.getElementById("app_title");
chatbot = document.querySelector('#main_chatbot');
chatbotWrap = document.querySelector('#main_chatbot > .wrap');
chatbot = document.querySelector('#废弃');
chatbotWrap = document.querySelector('#废弃 > .wrap');
apSwitch = document.querySelector('.apSwitch input[type="checkbox"]');
if (loginUserForm) {
@ -414,7 +414,7 @@ var mObserver = new MutationObserver(function (mutationsList) {
for (var node of mmutation.addedNodes) {
if (node.nodeType === 1 && node.classList.contains('message') && node.getAttribute('data-testid') === 'bot') {
saveHistoryHtml();
document.querySelectorAll('#main_chatbot>.wrap>.message-wrap .message.bot').forEach(addChuanhuButton);
document.querySelectorAll('#废弃>.wrap>.message-wrap .message.bot').forEach(addChuanhuButton);
}
if (node.tagName === 'INPUT' && node.getAttribute('type') === 'range') {
setSlider();
@ -423,7 +423,7 @@ var mObserver = new MutationObserver(function (mutationsList) {
for (var node of mmutation.removedNodes) {
if (node.nodeType === 1 && node.classList.contains('message') && node.getAttribute('data-testid') === 'bot') {
saveHistoryHtml();
document.querySelectorAll('#main_chatbot>.wrap>.message-wrap .message.bot').forEach(addChuanhuButton);
document.querySelectorAll('#废弃>.wrap>.message-wrap .message.bot').forEach(addChuanhuButton);
}
}
} else if (mmutation.type === 'attributes') {
@ -433,7 +433,7 @@ var mObserver = new MutationObserver(function (mutationsList) {
clearTimeout(timeoutId);
timeoutId = setTimeout(() => {
isThrottled = false;
document.querySelectorAll('#main_chatbot>.wrap>.message-wrap .message.bot').forEach(addChuanhuButton);
document.querySelectorAll('#废弃>.wrap>.message-wrap .message.bot').forEach(addChuanhuButton);
saveHistoryHtml();
}, 500);
}
@ -444,7 +444,7 @@ mObserver.observe(document.documentElement, { attributes: true, childList: true,
var loadhistorytime = 0; // for debugging
function saveHistoryHtml() {
var historyHtml = document.querySelector('#main_chatbot > .wrap');
var historyHtml = document.querySelector('#废弃 > .wrap');
localStorage.setItem('chatHistory', historyHtml.innerHTML);
// console.log("History Saved")
historyLoaded = false;

View File

@ -1,7 +1,4 @@
<div style="display: flex; justify-content: space-between;">
<span style="margin-top: 4px !important;">
{label}
</span>
<span>
<label class="apSwitch" for="checkbox">
<input type="checkbox" id="checkbox">