mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
refactor(text): move license key management to config
This commit is contained in:
parent
248f6d6a7d
commit
b809137c93
@ -16,6 +16,7 @@ const TEXT_FORMATTING_GROUP = {
|
|||||||
|
|
||||||
export async function buildConfig(): Promise<EditorConfig> {
|
export async function buildConfig(): Promise<EditorConfig> {
|
||||||
return {
|
return {
|
||||||
|
licenseKey: getLicenseKey(),
|
||||||
image: {
|
image: {
|
||||||
styles: {
|
styles: {
|
||||||
options: [
|
options: [
|
||||||
@ -276,3 +277,13 @@ export function buildFloatingToolbar() {
|
|||||||
]
|
]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getLicenseKey() {
|
||||||
|
const premiumLicenseKey = import.meta.env.VITE_CKEDITOR_KEY;
|
||||||
|
if (!premiumLicenseKey) {
|
||||||
|
logError("CKEditor license key is not set, premium features will not be available.");
|
||||||
|
return "GPL";
|
||||||
|
}
|
||||||
|
|
||||||
|
return premiumLicenseKey;
|
||||||
|
}
|
||||||
|
@ -201,8 +201,7 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
|
|||||||
styles: true,
|
styles: true,
|
||||||
classes: true,
|
classes: true,
|
||||||
attributes: true
|
attributes: true
|
||||||
},
|
}
|
||||||
licenseKey: getLicenseKey()
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const contentLanguage = this.note?.getLabelValue("language");
|
const contentLanguage = this.note?.getLabelValue("language");
|
||||||
@ -656,12 +655,3 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getLicenseKey() {
|
|
||||||
const premiumLicenseKey = import.meta.env.VITE_CKEDITOR_KEY;
|
|
||||||
if (!premiumLicenseKey) {
|
|
||||||
logError("CKEditor license key is not set, premium features will not be available.");
|
|
||||||
return "GPL";
|
|
||||||
}
|
|
||||||
|
|
||||||
return premiumLicenseKey;
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user