parent
28afa0fc45
commit
28e3b65028
1 changed files with 18 additions and 0 deletions
|
|
@ -108,6 +108,13 @@ messagesInputStyle.textContent = `
|
||||||
#mzta-custom_info span{
|
#mzta-custom_info span{
|
||||||
font-size:0.8em;
|
font-size:0.8em;
|
||||||
}
|
}
|
||||||
|
#mzta-custom_step{
|
||||||
|
position: absolute;
|
||||||
|
bottom: 5px;
|
||||||
|
right: 10px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #ccc;
|
||||||
|
}
|
||||||
@media (prefers-color-scheme: dark) {
|
@media (prefers-color-scheme: dark) {
|
||||||
#messageInputField {
|
#messageInputField {
|
||||||
background-color: #303030;
|
background-color: #303030;
|
||||||
|
|
@ -197,6 +204,9 @@ customBtn.id = 'mzta-custom_btn';
|
||||||
customBtn.textContent = browser.i18n.getMessage("chatgpt_win_send");
|
customBtn.textContent = browser.i18n.getMessage("chatgpt_win_send");
|
||||||
customBtn.classList.add('mzta-btn');
|
customBtn.classList.add('mzta-btn');
|
||||||
customDiv.appendChild(customBtn);
|
customDiv.appendChild(customBtn);
|
||||||
|
const customStep = document.createElement('div');
|
||||||
|
customStep.id = 'mzta-custom_step';
|
||||||
|
customDiv.appendChild(customStep);
|
||||||
messageInputTemplate.content.appendChild(customDiv);
|
messageInputTemplate.content.appendChild(customDiv);
|
||||||
|
|
||||||
class MessageInput extends HTMLElement {
|
class MessageInput extends HTMLElement {
|
||||||
|
|
@ -223,6 +233,7 @@ class MessageInput extends HTMLElement {
|
||||||
this._customTextArea = shadowRoot.querySelector('#mzta-custom_textarea');
|
this._customTextArea = shadowRoot.querySelector('#mzta-custom_textarea');
|
||||||
this._customLoading = shadowRoot.querySelector('#mzta-custom_loading');
|
this._customLoading = shadowRoot.querySelector('#mzta-custom_loading');
|
||||||
this._customBtn = shadowRoot.querySelector('#mzta-custom_btn');
|
this._customBtn = shadowRoot.querySelector('#mzta-custom_btn');
|
||||||
|
this._customStep = shadowRoot.querySelector('#mzta-custom_step');
|
||||||
this._customBtn.addEventListener("click", () => { this._customTextBtnClick({customBtn:this._customBtn,customLoading:this._customLoading,customDiv:this._customText}) });
|
this._customBtn.addEventListener("click", () => { this._customTextBtnClick({customBtn:this._customBtn,customLoading:this._customLoading,customDiv:this._customText}) });
|
||||||
this._customTextArea.addEventListener("keydown", (event) => { if(event.code == "Enter" && event.ctrlKey) this._customTextBtnClick({customBtn:this._customBtn,customLoading:this._customLoading,customDiv:this._customText}) });
|
this._customTextArea.addEventListener("keydown", (event) => { if(event.code == "Enter" && event.ctrlKey) this._customTextBtnClick({customBtn:this._customBtn,customLoading:this._customLoading,customDiv:this._customText}) });
|
||||||
}
|
}
|
||||||
|
|
@ -340,6 +351,13 @@ class MessageInput extends HTMLElement {
|
||||||
infoSpan.textContent = "[" + browser.i18n.getMessage("customPrompts_form_label_ID") + ": " + currentItem.info + "]";
|
infoSpan.textContent = "[" + browser.i18n.getMessage("customPrompts_form_label_ID") + ": " + currentItem.info + "]";
|
||||||
infoDiv.appendChild(infoSpan);
|
infoDiv.appendChild(infoSpan);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(this._customTextArray.length > 1) {
|
||||||
|
this._customStep.textContent = (this._currentCustomTextIndex + 1) + "/" + this._customTextArray.length;
|
||||||
|
this._customStep.style.display = 'block';
|
||||||
|
} else {
|
||||||
|
this._customStep.style.display = 'none';
|
||||||
|
}
|
||||||
|
|
||||||
this._customTextArea.focus();
|
this._customTextArea.focus();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue