mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 10:02:59 +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> {
|
||||
return {
|
||||
licenseKey: getLicenseKey(),
|
||||
image: {
|
||||
styles: {
|
||||
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,
|
||||
classes: true,
|
||||
attributes: true
|
||||
},
|
||||
licenseKey: getLicenseKey()
|
||||
}
|
||||
};
|
||||
|
||||
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