🚨
This commit is contained in:
parent
b7b83fac0a
commit
6eb2387aba
7 changed files with 12 additions and 14 deletions
|
@ -3,7 +3,7 @@ import {fetchPost} from "../util/fetch";
|
|||
export const ai = {
|
||||
element: undefined as Element,
|
||||
genHTML: () => {
|
||||
let responsiveHTML = ""
|
||||
let responsiveHTML = "";
|
||||
/// #if MOBILE
|
||||
responsiveHTML = `<div class="b3-label">
|
||||
${window.siyuan.languages.apiTimeout}
|
||||
|
|
|
@ -3,7 +3,7 @@ import {fetchPost} from "../util/fetch";
|
|||
export const flashcard = {
|
||||
element: undefined as Element,
|
||||
genHTML: () => {
|
||||
let responsiveHTML = ""
|
||||
let responsiveHTML = "";
|
||||
/// #if MOBILE
|
||||
responsiveHTML = `<div class="b3-label">
|
||||
${window.siyuan.languages.flashcardNewCardLimit}
|
||||
|
@ -16,7 +16,7 @@ export const flashcard = {
|
|||
<div class="fn__hr"></div>
|
||||
<input class="b3-text-field fn__flex-center fn__block" id="reviewCardLimit" step="1" min="1" type="number"${window.siyuan.config.flashcard.reviewCardLimit ? " checked" : ""} value="${window.siyuan.config.flashcard.reviewCardLimit}"/>
|
||||
<div class="b3-label__text">${window.siyuan.languages.flashcardReviewCardLimitTip}</div>
|
||||
</div>`
|
||||
</div>`;
|
||||
/// #else
|
||||
responsiveHTML = `<label class="fn__flex b3-label">
|
||||
<div class="fn__flex-1">
|
||||
|
@ -33,7 +33,7 @@ export const flashcard = {
|
|||
</div>
|
||||
<span class="fn__space"></span>
|
||||
<input class="b3-text-field fn__flex-center fn__size200" id="reviewCardLimit" step="1" min="1" type="number"${window.siyuan.config.flashcard.reviewCardLimit ? " checked" : ""} value="${window.siyuan.config.flashcard.reviewCardLimit}"/>
|
||||
</label>`
|
||||
</label>`;
|
||||
/// #endif
|
||||
return `${responsiveHTML}
|
||||
<label class="fn__flex b3-label">
|
||||
|
|
|
@ -87,7 +87,7 @@ export const showAccountInfo = () => {
|
|||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
};
|
||||
|
||||
export const login = () => {
|
||||
|
|
|
@ -10,5 +10,5 @@ export const initAI = () => {
|
|||
ai.element = modelMainElement;
|
||||
ai.bindEvent();
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
@ -65,8 +65,6 @@ export class MobileTags {
|
|||
});
|
||||
}
|
||||
} else {
|
||||
const modelElement = document.getElementById("model");
|
||||
const modelMainElement = document.getElementById("modelMain");
|
||||
popSearch();
|
||||
(document.getElementById("toolbarSearch") as HTMLInputElement).value = `#${element.getAttribute("data-label")}#`;
|
||||
toolbarSearchEvent();
|
||||
|
|
|
@ -4,11 +4,11 @@ export const openModel = (obj: {
|
|||
title: string,
|
||||
bindEvent: (element: HTMLElement) => void
|
||||
}) => {
|
||||
const modelElement = document.getElementById("model")
|
||||
const modelElement = document.getElementById("model");
|
||||
modelElement.style.top = "0";
|
||||
modelElement.querySelector(".toolbar__icon use").setAttribute("xlink:href", "#" + obj.icon);
|
||||
modelElement.querySelector(".toolbar__text").innerHTML = obj.title
|
||||
modelElement.querySelector(".toolbar__text").innerHTML = obj.title;
|
||||
const modelMainElement = modelElement.querySelector("#modelMain") as HTMLElement;
|
||||
modelMainElement.innerHTML = obj.html;
|
||||
obj.bindEvent(modelMainElement);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -67,7 +67,7 @@ export const popSearch = () => {
|
|||
title: '<input id="toolbarSearch" style="background-color: var(--b3-theme-surface);border: 0;" class="b3-text-field fn__block">',
|
||||
icon:"iconSearch",
|
||||
html: '<div id="searchPanel"></div>',
|
||||
bindEvent(modelMainElement: HTMLElement) {
|
||||
bindEvent(HTMLElement) {
|
||||
initToolbarSearch();
|
||||
const searchElement = document.getElementById("searchPanel");
|
||||
// 不能使用 getEventName() https://ld246.com/article/1638887457149
|
||||
|
@ -92,5 +92,5 @@ export const popSearch = () => {
|
|||
}, false);
|
||||
toolbarSearchEvent();
|
||||
}
|
||||
})
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue