mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 08:30:12 +01:00
This commit is contained in:
parent
1cca66f9bb
commit
9d89e28e4e
4 changed files with 12 additions and 2 deletions
|
|
@ -34,7 +34,7 @@ ${window.siyuan.languages.account2}
|
|||
<span class="b3-chip b3-chip--primary fn__pointer" id="trialSub">
|
||||
<svg class="ft__secondary"><use xlink:href="#iconVIP"></use></svg>
|
||||
${window.siyuan.languages.freeSub}
|
||||
</>
|
||||
</span>
|
||||
<div class="fn__hr--b"></div>`;
|
||||
if (window.siyuan.user) {
|
||||
let userTitlesHTML = "";
|
||||
|
|
@ -368,6 +368,9 @@ ${window.siyuan.languages.account8}`;
|
|||
}
|
||||
}
|
||||
}
|
||||
if (!window.siyuan.user || (window.siyuan.user && window.siyuan.user.userSiYuanSubscriptionStatus === -1)){
|
||||
html = `<div class="toolbar__item b3-tooltips b3-tooltips__se" aria-label="${window.siyuan.languages.freeSub}"><svg class="ft__error"><use xlink:href="#iconVIP"></use></svg></div>`;
|
||||
}
|
||||
if (window.siyuan.config.account.displayTitle && window.siyuan.user) {
|
||||
window.siyuan.user.userTitles.forEach(item => {
|
||||
html += `<div class="toolbar__item fn__a b3-tooltips b3-tooltips__se" aria-label="${item.name}:${item.desc}">${item.icon}</div>`;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ export const openSetting = () => {
|
|||
}
|
||||
});
|
||||
if (exitDialog) {
|
||||
return;
|
||||
return exitDialog;
|
||||
}
|
||||
const height = Math.min(window.innerHeight * .9, Math.max(window.innerHeight * .7, 52 * 11));
|
||||
const dialog = new Dialog({
|
||||
|
|
@ -128,4 +128,5 @@ export const openSetting = () => {
|
|||
});
|
||||
editor.element = dialog.element.querySelector('.b3-tab-container[data-name="editor"]');
|
||||
editor.bindEvent();
|
||||
return dialog;
|
||||
};
|
||||
|
|
|
|||
1
app/src/types/index.d.ts
vendored
1
app/src/types/index.d.ts
vendored
|
|
@ -99,6 +99,7 @@ interface ISiyuan {
|
|||
userSiYuanProExpireTime: number // -1 终身会员;0 普通用户;> 0 过期时间
|
||||
userSiYuanSubscriptionPlan: number // 0 年付订阅/终生;1 教育优惠;2 订阅试用
|
||||
userSiYuanSubscriptionType: number // 0 年付;1 终生;2 月付
|
||||
userSiYuanSubscriptionStatus: number // -1:未订阅,0:订阅可用,1:订阅封禁,2:订阅过期
|
||||
userToken: string
|
||||
userTitles: { name: string, icon: string, desc: string }[]
|
||||
},
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import {getOpenNotebookCount} from "./pathName";
|
|||
import {openFileById} from "../editor/util";
|
||||
import {focusByRange} from "../protyle/util/selection";
|
||||
import {exitSiYuan} from "../dialog/processSystem";
|
||||
import {openSetting} from "../config";
|
||||
|
||||
const matchKeymap = (keymap: Record<string, IKeymapItem>, key1: "general" | "editor", key2?: "general" | "insert" | "heading" | "list" | "table") => {
|
||||
if (key1 === "general") {
|
||||
|
|
@ -270,6 +271,10 @@ const initBar = () => {
|
|||
});
|
||||
resizeTabs();
|
||||
});
|
||||
document.getElementById("toolbarVIP").addEventListener("click", (event) => {
|
||||
const dialogSetting = openSetting();
|
||||
dialogSetting.element.querySelector('.b3-tab-bar [data-name="account"]').dispatchEvent(new CustomEvent("click"));
|
||||
});
|
||||
document.getElementById("barDailyNote").addEventListener("click", (event) => {
|
||||
if (getOpenNotebookCount() < 2) {
|
||||
newDailyNote();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue