mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-04 07:48:49 +01:00
🐛 ga
This commit is contained in:
parent
1b5bc9f396
commit
72a1dc05dd
2 changed files with 24 additions and 30 deletions
2
app/src/types/index.d.ts
vendored
2
app/src/types/index.d.ts
vendored
|
|
@ -46,8 +46,6 @@ interface Window {
|
|||
showKeyboardToolbar(bottom?: number): void
|
||||
|
||||
hideKeyboardToolbar(): void
|
||||
|
||||
gtag(name: string, key: string | Date, value?: IObject): void;
|
||||
}
|
||||
|
||||
interface ITextOption {
|
||||
|
|
|
|||
|
|
@ -124,33 +124,29 @@ export const initAssets = () => {
|
|||
|
||||
export const addGA = () => {
|
||||
if (!window.siyuan.config.system.disableGoogleAnalytics) {
|
||||
addScript("https://www.googletagmanager.com/gtag/js?id=G-L7WEXVQCR9", "gaScript").then(() => {
|
||||
try {
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
window.gtag = function (...args) {
|
||||
window.dataLayer.push(args);
|
||||
};
|
||||
window.gtag("js", new Date());
|
||||
window.gtag("config", "G-L7WEXVQCR9");
|
||||
const para = {
|
||||
"version": Constants.SIYUAN_VERSION,
|
||||
"container": window.siyuan.config.system.container,
|
||||
"isLoggedIn": "false",
|
||||
"subscriptionStatus": "-1",
|
||||
"subscriptionPlan": "-1",
|
||||
"subscriptionType": "-1",
|
||||
};
|
||||
if (window.siyuan.user) {
|
||||
para.isLoggedIn = "true";
|
||||
para.subscriptionStatus = window.siyuan.user.userSiYuanSubscriptionStatus.toString();
|
||||
para.subscriptionPlan = window.siyuan.user.userSiYuanSubscriptionPlan.toString();
|
||||
para.subscriptionType = window.siyuan.user.userSiYuanSubscriptionType.toString();
|
||||
}
|
||||
window.gtag("event", Constants.ANALYTICS_EVT_ON_GET_CONFIG, para);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
});
|
||||
addScript("https://www.googletagmanager.com/gtag/js?id=G-L7WEXVQCR9", "gaScript");
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
const gtag = function (...args: any[]) {
|
||||
// eslint-disable-next-line prefer-rest-params
|
||||
window.dataLayer.push(arguments);
|
||||
};
|
||||
gtag("js", new Date());
|
||||
gtag("config", "G-L7WEXVQCR9");
|
||||
const para = {
|
||||
version: Constants.SIYUAN_VERSION,
|
||||
container: window.siyuan.config.system.container,
|
||||
isLoggedIn: "false",
|
||||
subscriptionStatus: "-1",
|
||||
subscriptionPlan: "-1",
|
||||
subscriptionType: "-1",
|
||||
};
|
||||
if (window.siyuan.user) {
|
||||
para.isLoggedIn = "true";
|
||||
para.subscriptionStatus = window.siyuan.user.userSiYuanSubscriptionStatus.toString();
|
||||
para.subscriptionPlan = window.siyuan.user.userSiYuanSubscriptionPlan.toString();
|
||||
para.subscriptionType = window.siyuan.user.userSiYuanSubscriptionType.toString();
|
||||
}
|
||||
gtag("event", Constants.ANALYTICS_EVT_ON_GET_CONFIG, para);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -163,7 +159,7 @@ export const setInlineStyle = (set = true) => {
|
|||
.protyle-wysiwyg [data-node-id].li > .protyle-action:after {height: ${window.siyuan.config.editor.fontSize}px;width: ${window.siyuan.config.editor.fontSize}px;margin:-${window.siyuan.config.editor.fontSize / 2}px 0 0 -${window.siyuan.config.editor.fontSize / 2}px}
|
||||
.protyle-wysiwyg [data-node-id].li > .protyle-action svg {height: ${Math.max(14, window.siyuan.config.editor.fontSize - 8)}px}
|
||||
.protyle-wysiwyg [data-node-id] [spellcheck="false"] {min-height:${height}px;}
|
||||
.protyle-wysiwyg [data-node-id] {${window.siyuan.config.editor.rtl?" direction: rtl;":""}${window.siyuan.config.editor.justify?" text-align: justify;":""}}
|
||||
.protyle-wysiwyg [data-node-id] {${window.siyuan.config.editor.rtl ? " direction: rtl;" : ""}${window.siyuan.config.editor.justify ? " text-align: justify;" : ""}}
|
||||
.protyle-wysiwyg .li {min-height:${height + 8}px}
|
||||
.protyle-gutters button svg {height:${height}px}
|
||||
.protyle-wysiwyg img.emoji, .b3-typography img.emoji {width:${height - 8}px}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue