|
|
|
@ -42,7 +42,7 @@ export interface SettingItem {
|
|
|
|
|
label?(): string;
|
|
|
|
|
description?: Function;
|
|
|
|
|
options?(): any;
|
|
|
|
|
appTypes?: string[];
|
|
|
|
|
appTypes?: AppType[];
|
|
|
|
|
show?(settings: any): boolean;
|
|
|
|
|
filter?(value: any): any;
|
|
|
|
|
secure?: boolean;
|
|
|
|
@ -93,12 +93,18 @@ export enum Env {
|
|
|
|
|
Prod = 'prod',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export enum AppType {
|
|
|
|
|
Desktop = 'desktop',
|
|
|
|
|
Mobile = 'mobile',
|
|
|
|
|
Cli = 'cli',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface Constants {
|
|
|
|
|
env: Env;
|
|
|
|
|
isDemo: boolean;
|
|
|
|
|
appName: string;
|
|
|
|
|
appId: string;
|
|
|
|
|
appType: string;
|
|
|
|
|
appType: AppType;
|
|
|
|
|
resourceDirName: string;
|
|
|
|
|
resourceDir: string;
|
|
|
|
|
profileDir: string;
|
|
|
|
@ -180,7 +186,7 @@ class Setting extends BaseModel {
|
|
|
|
|
isDemo: false,
|
|
|
|
|
appName: 'joplin',
|
|
|
|
|
appId: 'SET_ME', // Each app should set this identifier
|
|
|
|
|
appType: 'SET_ME', // 'cli' or 'mobile'
|
|
|
|
|
appType: 'SET_ME' as any, // 'cli' or 'mobile'
|
|
|
|
|
resourceDirName: '',
|
|
|
|
|
resourceDir: '',
|
|
|
|
|
profileDir: '',
|
|
|
|
@ -290,7 +296,7 @@ class Setting extends BaseModel {
|
|
|
|
|
value: true,
|
|
|
|
|
type: SettingItemType.Bool,
|
|
|
|
|
public: false,
|
|
|
|
|
appTypes: ['desktop'],
|
|
|
|
|
appTypes: [AppType.Desktop],
|
|
|
|
|
storage: SettingStorage.File,
|
|
|
|
|
},
|
|
|
|
|
'sync.target': {
|
|
|
|
@ -300,7 +306,7 @@ class Setting extends BaseModel {
|
|
|
|
|
public: true,
|
|
|
|
|
section: 'sync',
|
|
|
|
|
label: () => _('Synchronisation target'),
|
|
|
|
|
description: (appType: string) => {
|
|
|
|
|
description: (appType: AppType) => {
|
|
|
|
|
return appType !== 'cli' ? null : _('The target to synchronise to. Each sync target may have additional parameters which are named as `sync.NUM.NAME` (all documented below).');
|
|
|
|
|
},
|
|
|
|
|
options: () => {
|
|
|
|
@ -553,7 +559,7 @@ class Setting extends BaseModel {
|
|
|
|
|
public: true,
|
|
|
|
|
advanced: true,
|
|
|
|
|
isEnum: true,
|
|
|
|
|
appTypes: ['mobile', 'desktop'],
|
|
|
|
|
appTypes: [AppType.Mobile, AppType.Desktop],
|
|
|
|
|
label: () => _('Attachment download behaviour'),
|
|
|
|
|
description: () => _('In "Manual" mode, attachments are downloaded only when you click on them. In "Auto", they are downloaded when you open the note. In "Always", all the attachments are downloaded whether you open the note or not.'),
|
|
|
|
|
options: () => {
|
|
|
|
@ -645,7 +651,7 @@ class Setting extends BaseModel {
|
|
|
|
|
value: Setting.THEME_LIGHT,
|
|
|
|
|
type: SettingItemType.Int,
|
|
|
|
|
public: true,
|
|
|
|
|
appTypes: ['mobile', 'desktop'],
|
|
|
|
|
appTypes: [AppType.Mobile, AppType.Desktop],
|
|
|
|
|
show: (settings) => {
|
|
|
|
|
return !settings['themeAutoDetect'];
|
|
|
|
|
},
|
|
|
|
@ -660,7 +666,7 @@ class Setting extends BaseModel {
|
|
|
|
|
value: false,
|
|
|
|
|
type: SettingItemType.Bool,
|
|
|
|
|
section: 'appearance',
|
|
|
|
|
appTypes: ['desktop'],
|
|
|
|
|
appTypes: [AppType.Desktop],
|
|
|
|
|
public: true,
|
|
|
|
|
label: () => _('Automatically switch theme to match system theme'),
|
|
|
|
|
storage: SettingStorage.File,
|
|
|
|
@ -673,7 +679,7 @@ class Setting extends BaseModel {
|
|
|
|
|
show: (settings) => {
|
|
|
|
|
return settings['themeAutoDetect'];
|
|
|
|
|
},
|
|
|
|
|
appTypes: ['desktop'],
|
|
|
|
|
appTypes: [AppType.Desktop],
|
|
|
|
|
isEnum: true,
|
|
|
|
|
label: () => _('Preferred light theme'),
|
|
|
|
|
section: 'appearance',
|
|
|
|
@ -688,7 +694,7 @@ class Setting extends BaseModel {
|
|
|
|
|
show: (settings) => {
|
|
|
|
|
return settings['themeAutoDetect'];
|
|
|
|
|
},
|
|
|
|
|
appTypes: ['desktop'],
|
|
|
|
|
appTypes: [AppType.Desktop],
|
|
|
|
|
isEnum: true,
|
|
|
|
|
label: () => _('Preferred dark theme'),
|
|
|
|
|
section: 'appearance',
|
|
|
|
@ -702,13 +708,13 @@ class Setting extends BaseModel {
|
|
|
|
|
public: false,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
showNoteCounts: { value: true, type: SettingItemType.Bool, storage: SettingStorage.File, public: false, advanced: true, appTypes: ['desktop'], label: () => _('Show note counts') },
|
|
|
|
|
showNoteCounts: { value: true, type: SettingItemType.Bool, storage: SettingStorage.File, public: false, advanced: true, appTypes: [AppType.Desktop], label: () => _('Show note counts') },
|
|
|
|
|
|
|
|
|
|
layoutButtonSequence: {
|
|
|
|
|
value: Setting.LAYOUT_ALL,
|
|
|
|
|
type: SettingItemType.Int,
|
|
|
|
|
public: false,
|
|
|
|
|
appTypes: ['desktop'],
|
|
|
|
|
appTypes: [AppType.Desktop],
|
|
|
|
|
isEnum: true,
|
|
|
|
|
options: () => ({
|
|
|
|
|
[Setting.LAYOUT_ALL]: _('%s / %s / %s', _('Editor'), _('Viewer'), _('Split View')),
|
|
|
|
@ -718,15 +724,15 @@ class Setting extends BaseModel {
|
|
|
|
|
}),
|
|
|
|
|
storage: SettingStorage.File,
|
|
|
|
|
},
|
|
|
|
|
uncompletedTodosOnTop: { value: true, type: SettingItemType.Bool, storage: SettingStorage.File, section: 'note', public: true, appTypes: ['cli'], label: () => _('Uncompleted to-dos on top') },
|
|
|
|
|
showCompletedTodos: { value: true, type: SettingItemType.Bool, storage: SettingStorage.File, section: 'note', public: true, appTypes: ['cli'], label: () => _('Show completed to-dos') },
|
|
|
|
|
uncompletedTodosOnTop: { value: true, type: SettingItemType.Bool, storage: SettingStorage.File, section: 'note', public: true, appTypes: [AppType.Cli], label: () => _('Uncompleted to-dos on top') },
|
|
|
|
|
showCompletedTodos: { value: true, type: SettingItemType.Bool, storage: SettingStorage.File, section: 'note', public: true, appTypes: [AppType.Cli], label: () => _('Show completed to-dos') },
|
|
|
|
|
'notes.sortOrder.field': {
|
|
|
|
|
value: 'user_updated_time',
|
|
|
|
|
type: SettingItemType.String,
|
|
|
|
|
section: 'note',
|
|
|
|
|
isEnum: true,
|
|
|
|
|
public: true,
|
|
|
|
|
appTypes: ['cli'],
|
|
|
|
|
appTypes: [AppType.Cli],
|
|
|
|
|
label: () => _('Sort notes by'),
|
|
|
|
|
options: () => {
|
|
|
|
|
const Note = require('./Note').default;
|
|
|
|
@ -744,17 +750,17 @@ class Setting extends BaseModel {
|
|
|
|
|
type: SettingItemType.Bool,
|
|
|
|
|
public: true,
|
|
|
|
|
section: 'note',
|
|
|
|
|
appTypes: ['desktop'],
|
|
|
|
|
appTypes: [AppType.Desktop],
|
|
|
|
|
label: () => _('Auto-pair braces, parenthesis, quotations, etc.'),
|
|
|
|
|
storage: SettingStorage.File,
|
|
|
|
|
},
|
|
|
|
|
'notes.sortOrder.reverse': { value: true, type: SettingItemType.Bool, storage: SettingStorage.File, section: 'note', public: true, label: () => _('Reverse sort order'), appTypes: ['cli'] },
|
|
|
|
|
'notes.sortOrder.reverse': { value: true, type: SettingItemType.Bool, storage: SettingStorage.File, section: 'note', public: true, label: () => _('Reverse sort order'), appTypes: [AppType.Cli] },
|
|
|
|
|
'folders.sortOrder.field': {
|
|
|
|
|
value: 'title',
|
|
|
|
|
type: SettingItemType.String,
|
|
|
|
|
isEnum: true,
|
|
|
|
|
public: true,
|
|
|
|
|
appTypes: ['cli'],
|
|
|
|
|
appTypes: [AppType.Cli],
|
|
|
|
|
label: () => _('Sort notebooks by'),
|
|
|
|
|
options: () => {
|
|
|
|
|
const Folder = require('./Folder').default;
|
|
|
|
@ -767,7 +773,7 @@ class Setting extends BaseModel {
|
|
|
|
|
},
|
|
|
|
|
storage: SettingStorage.File,
|
|
|
|
|
},
|
|
|
|
|
'folders.sortOrder.reverse': { value: false, type: SettingItemType.Bool, storage: SettingStorage.File, public: true, label: () => _('Reverse sort order'), appTypes: ['cli'] },
|
|
|
|
|
'folders.sortOrder.reverse': { value: false, type: SettingItemType.Bool, storage: SettingStorage.File, public: true, label: () => _('Reverse sort order'), appTypes: [AppType.Cli] },
|
|
|
|
|
trackLocation: { value: true, type: SettingItemType.Bool, section: 'note', storage: SettingStorage.File, public: true, label: () => _('Save geo-location with notes') },
|
|
|
|
|
|
|
|
|
|
// 2020-10-29: For now disable the beta editor due to
|
|
|
|
@ -780,7 +786,7 @@ class Setting extends BaseModel {
|
|
|
|
|
type: SettingItemType.Bool,
|
|
|
|
|
section: 'note',
|
|
|
|
|
public: false, // mobilePlatform === 'ios',
|
|
|
|
|
appTypes: ['mobile'],
|
|
|
|
|
appTypes: [AppType.Mobile],
|
|
|
|
|
label: () => 'Opt-in to the editor beta',
|
|
|
|
|
description: () => 'This beta adds list continuation, Markdown preview, and Markdown shortcuts. If you find bugs, please report them in the Discourse forum.',
|
|
|
|
|
},
|
|
|
|
@ -791,7 +797,7 @@ class Setting extends BaseModel {
|
|
|
|
|
section: 'note',
|
|
|
|
|
isEnum: true,
|
|
|
|
|
public: true,
|
|
|
|
|
appTypes: ['desktop'],
|
|
|
|
|
appTypes: [AppType.Desktop],
|
|
|
|
|
label: () => _('When creating a new to-do:'),
|
|
|
|
|
options: () => {
|
|
|
|
|
return {
|
|
|
|
@ -807,7 +813,7 @@ class Setting extends BaseModel {
|
|
|
|
|
section: 'note',
|
|
|
|
|
isEnum: true,
|
|
|
|
|
public: true,
|
|
|
|
|
appTypes: ['desktop'],
|
|
|
|
|
appTypes: [AppType.Desktop],
|
|
|
|
|
label: () => _('When creating a new note:'),
|
|
|
|
|
options: () => {
|
|
|
|
|
return {
|
|
|
|
@ -823,7 +829,7 @@ class Setting extends BaseModel {
|
|
|
|
|
type: SettingItemType.Object,
|
|
|
|
|
section: 'plugins',
|
|
|
|
|
public: true,
|
|
|
|
|
appTypes: ['desktop'],
|
|
|
|
|
appTypes: [AppType.Desktop],
|
|
|
|
|
needRestart: true,
|
|
|
|
|
autoSave: true,
|
|
|
|
|
},
|
|
|
|
@ -834,38 +840,38 @@ class Setting extends BaseModel {
|
|
|
|
|
section: 'plugins',
|
|
|
|
|
public: true,
|
|
|
|
|
advanced: true,
|
|
|
|
|
appTypes: ['desktop'],
|
|
|
|
|
appTypes: [AppType.Desktop],
|
|
|
|
|
label: () => 'Development plugins',
|
|
|
|
|
description: () => 'You may add multiple plugin paths, each separated by a comma. You will need to restart the application for the changes to take effect.',
|
|
|
|
|
storage: SettingStorage.File,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// Deprecated - use markdown.plugin.*
|
|
|
|
|
'markdown.softbreaks': { storage: SettingStorage.File, value: false, type: SettingItemType.Bool, public: false, appTypes: ['mobile', 'desktop'] },
|
|
|
|
|
'markdown.typographer': { storage: SettingStorage.File, value: false, type: SettingItemType.Bool, public: false, appTypes: ['mobile', 'desktop'] },
|
|
|
|
|
'markdown.softbreaks': { storage: SettingStorage.File, value: false, type: SettingItemType.Bool, public: false, appTypes: [AppType.Mobile, AppType.Desktop] },
|
|
|
|
|
'markdown.typographer': { storage: SettingStorage.File, value: false, type: SettingItemType.Bool, public: false, appTypes: [AppType.Mobile, AppType.Desktop] },
|
|
|
|
|
// Deprecated
|
|
|
|
|
|
|
|
|
|
'markdown.plugin.softbreaks': { storage: SettingStorage.File, value: false, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: ['mobile', 'desktop'], label: () => `${_('Enable soft breaks')}${wysiwygYes}` },
|
|
|
|
|
'markdown.plugin.typographer': { storage: SettingStorage.File, value: false, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: ['mobile', 'desktop'], label: () => `${_('Enable typographer support')}${wysiwygYes}` },
|
|
|
|
|
'markdown.plugin.linkify': { storage: SettingStorage.File, value: true, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: ['mobile', 'desktop'], label: () => `${_('Enable Linkify')}${wysiwygYes}` },
|
|
|
|
|
'markdown.plugin.softbreaks': { storage: SettingStorage.File, value: false, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: [AppType.Mobile, AppType.Desktop], label: () => `${_('Enable soft breaks')}${wysiwygYes}` },
|
|
|
|
|
'markdown.plugin.typographer': { storage: SettingStorage.File, value: false, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: [AppType.Mobile, AppType.Desktop], label: () => `${_('Enable typographer support')}${wysiwygYes}` },
|
|
|
|
|
'markdown.plugin.linkify': { storage: SettingStorage.File, value: true, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: [AppType.Mobile, AppType.Desktop], label: () => `${_('Enable Linkify')}${wysiwygYes}` },
|
|
|
|
|
|
|
|
|
|
'markdown.plugin.katex': { storage: SettingStorage.File, value: true, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: ['mobile', 'desktop'], label: () => `${_('Enable math expressions')}${wysiwygYes}` },
|
|
|
|
|
'markdown.plugin.fountain': { storage: SettingStorage.File, value: false, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: ['mobile', 'desktop'], label: () => `${_('Enable Fountain syntax support')}${wysiwygYes}` },
|
|
|
|
|
'markdown.plugin.mermaid': { storage: SettingStorage.File, value: true, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: ['mobile', 'desktop'], label: () => `${_('Enable Mermaid diagrams support')}${wysiwygYes}` },
|
|
|
|
|
'markdown.plugin.katex': { storage: SettingStorage.File, value: true, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: [AppType.Mobile, AppType.Desktop], label: () => `${_('Enable math expressions')}${wysiwygYes}` },
|
|
|
|
|
'markdown.plugin.fountain': { storage: SettingStorage.File, value: false, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: [AppType.Mobile, AppType.Desktop], label: () => `${_('Enable Fountain syntax support')}${wysiwygYes}` },
|
|
|
|
|
'markdown.plugin.mermaid': { storage: SettingStorage.File, value: true, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: [AppType.Mobile, AppType.Desktop], label: () => `${_('Enable Mermaid diagrams support')}${wysiwygYes}` },
|
|
|
|
|
|
|
|
|
|
'markdown.plugin.audioPlayer': { storage: SettingStorage.File, value: true, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: ['mobile', 'desktop'], label: () => `${_('Enable audio player')}${wysiwygNo}` },
|
|
|
|
|
'markdown.plugin.videoPlayer': { storage: SettingStorage.File, value: true, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: ['mobile', 'desktop'], label: () => `${_('Enable video player')}${wysiwygNo}` },
|
|
|
|
|
'markdown.plugin.pdfViewer': { storage: SettingStorage.File, value: !mobilePlatform, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: ['desktop'], label: () => `${_('Enable PDF viewer')}${wysiwygNo}` },
|
|
|
|
|
'markdown.plugin.mark': { storage: SettingStorage.File, value: true, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: ['mobile', 'desktop'], label: () => `${_('Enable ==mark== syntax')}${wysiwygYes}` },
|
|
|
|
|
'markdown.plugin.footnote': { storage: SettingStorage.File, value: true, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: ['mobile', 'desktop'], label: () => `${_('Enable footnotes')}${wysiwygNo}` },
|
|
|
|
|
'markdown.plugin.toc': { storage: SettingStorage.File, value: true, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: ['mobile', 'desktop'], label: () => `${_('Enable table of contents extension')}${wysiwygNo}` },
|
|
|
|
|
'markdown.plugin.sub': { storage: SettingStorage.File, value: false, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: ['mobile', 'desktop'], label: () => `${_('Enable ~sub~ syntax')}${wysiwygYes}` },
|
|
|
|
|
'markdown.plugin.sup': { storage: SettingStorage.File, value: false, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: ['mobile', 'desktop'], label: () => `${_('Enable ^sup^ syntax')}${wysiwygYes}` },
|
|
|
|
|
'markdown.plugin.deflist': { storage: SettingStorage.File, value: false, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: ['mobile', 'desktop'], label: () => `${_('Enable deflist syntax')}${wysiwygNo}` },
|
|
|
|
|
'markdown.plugin.abbr': { storage: SettingStorage.File, value: false, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: ['mobile', 'desktop'], label: () => `${_('Enable abbreviation syntax')}${wysiwygNo}` },
|
|
|
|
|
'markdown.plugin.emoji': { storage: SettingStorage.File, value: false, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: ['mobile', 'desktop'], label: () => `${_('Enable markdown emoji')}${wysiwygNo}` },
|
|
|
|
|
'markdown.plugin.insert': { storage: SettingStorage.File, value: false, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: ['mobile', 'desktop'], label: () => `${_('Enable ++insert++ syntax')}${wysiwygYes}` },
|
|
|
|
|
'markdown.plugin.multitable': { storage: SettingStorage.File, value: false, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: ['mobile', 'desktop'], label: () => `${_('Enable multimarkdown table extension')}${wysiwygNo}` },
|
|
|
|
|
'markdown.plugin.audioPlayer': { storage: SettingStorage.File, value: true, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: [AppType.Mobile, AppType.Desktop], label: () => `${_('Enable audio player')}${wysiwygNo}` },
|
|
|
|
|
'markdown.plugin.videoPlayer': { storage: SettingStorage.File, value: true, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: [AppType.Mobile, AppType.Desktop], label: () => `${_('Enable video player')}${wysiwygNo}` },
|
|
|
|
|
'markdown.plugin.pdfViewer': { storage: SettingStorage.File, value: !mobilePlatform, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: [AppType.Desktop], label: () => `${_('Enable PDF viewer')}${wysiwygNo}` },
|
|
|
|
|
'markdown.plugin.mark': { storage: SettingStorage.File, value: true, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: [AppType.Mobile, AppType.Desktop], label: () => `${_('Enable ==mark== syntax')}${wysiwygYes}` },
|
|
|
|
|
'markdown.plugin.footnote': { storage: SettingStorage.File, value: true, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: [AppType.Mobile, AppType.Desktop], label: () => `${_('Enable footnotes')}${wysiwygNo}` },
|
|
|
|
|
'markdown.plugin.toc': { storage: SettingStorage.File, value: true, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: [AppType.Mobile, AppType.Desktop], label: () => `${_('Enable table of contents extension')}${wysiwygNo}` },
|
|
|
|
|
'markdown.plugin.sub': { storage: SettingStorage.File, value: false, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: [AppType.Mobile, AppType.Desktop], label: () => `${_('Enable ~sub~ syntax')}${wysiwygYes}` },
|
|
|
|
|
'markdown.plugin.sup': { storage: SettingStorage.File, value: false, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: [AppType.Mobile, AppType.Desktop], label: () => `${_('Enable ^sup^ syntax')}${wysiwygYes}` },
|
|
|
|
|
'markdown.plugin.deflist': { storage: SettingStorage.File, value: false, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: [AppType.Mobile, AppType.Desktop], label: () => `${_('Enable deflist syntax')}${wysiwygNo}` },
|
|
|
|
|
'markdown.plugin.abbr': { storage: SettingStorage.File, value: false, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: [AppType.Mobile, AppType.Desktop], label: () => `${_('Enable abbreviation syntax')}${wysiwygNo}` },
|
|
|
|
|
'markdown.plugin.emoji': { storage: SettingStorage.File, value: false, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: [AppType.Mobile, AppType.Desktop], label: () => `${_('Enable markdown emoji')}${wysiwygNo}` },
|
|
|
|
|
'markdown.plugin.insert': { storage: SettingStorage.File, value: false, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: [AppType.Mobile, AppType.Desktop], label: () => `${_('Enable ++insert++ syntax')}${wysiwygYes}` },
|
|
|
|
|
'markdown.plugin.multitable': { storage: SettingStorage.File, value: false, type: SettingItemType.Bool, section: 'markdownPlugins', public: true, appTypes: [AppType.Mobile, AppType.Desktop], label: () => `${_('Enable multimarkdown table extension')}${wysiwygNo}` },
|
|
|
|
|
|
|
|
|
|
// Tray icon (called AppIndicator) doesn't work in Ubuntu
|
|
|
|
|
// http://www.webupd8.org/2017/04/fix-appindicator-not-working-for.html
|
|
|
|
@ -876,7 +882,7 @@ class Setting extends BaseModel {
|
|
|
|
|
type: SettingItemType.Bool,
|
|
|
|
|
section: 'application',
|
|
|
|
|
public: true,
|
|
|
|
|
appTypes: ['desktop'],
|
|
|
|
|
appTypes: [AppType.Desktop],
|
|
|
|
|
label: () => _('Show tray icon'),
|
|
|
|
|
description: () => {
|
|
|
|
|
return platform === 'linux' ? _('Note: Does not work in all desktop environments.') : _('This will allow Joplin to run in the background. It is recommended to enable this setting so that your notes are constantly being synchronised, thus reducing the number of conflicts.');
|
|
|
|
@ -884,7 +890,7 @@ class Setting extends BaseModel {
|
|
|
|
|
storage: SettingStorage.File,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
startMinimized: { value: false, type: SettingItemType.Bool, storage: SettingStorage.File, section: 'application', public: true, appTypes: ['desktop'], label: () => _('Start application minimised in the tray icon') },
|
|
|
|
|
startMinimized: { value: false, type: SettingItemType.Bool, storage: SettingStorage.File, section: 'application', public: true, appTypes: [AppType.Desktop], label: () => _('Start application minimised in the tray icon') },
|
|
|
|
|
|
|
|
|
|
collapsedFolderIds: { value: [], type: SettingItemType.Array, public: false },
|
|
|
|
|
|
|
|
|
@ -907,9 +913,9 @@ class Setting extends BaseModel {
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// Deprecated in favour of windowContentZoomFactor
|
|
|
|
|
'style.zoom': { value: 100, type: SettingItemType.Int, public: false, storage: SettingStorage.File, appTypes: ['desktop'], section: 'appearance', label: () => '', minimum: 50, maximum: 500, step: 10 },
|
|
|
|
|
'style.zoom': { value: 100, type: SettingItemType.Int, public: false, storage: SettingStorage.File, appTypes: [AppType.Desktop], section: 'appearance', label: () => '', minimum: 50, maximum: 500, step: 10 },
|
|
|
|
|
|
|
|
|
|
'style.editor.fontSize': { value: 13, type: SettingItemType.Int, public: true, storage: SettingStorage.File, appTypes: ['desktop'], section: 'appearance', label: () => _('Editor font size'), minimum: 4, maximum: 50, step: 1 },
|
|
|
|
|
'style.editor.fontSize': { value: 13, type: SettingItemType.Int, public: true, storage: SettingStorage.File, appTypes: [AppType.Desktop], section: 'appearance', label: () => _('Editor font size'), minimum: 4, maximum: 50, step: 1 },
|
|
|
|
|
'style.editor.fontFamily':
|
|
|
|
|
(mobilePlatform) ?
|
|
|
|
|
({
|
|
|
|
@ -918,7 +924,7 @@ class Setting extends BaseModel {
|
|
|
|
|
isEnum: true,
|
|
|
|
|
public: true,
|
|
|
|
|
label: () => _('Editor font'),
|
|
|
|
|
appTypes: ['mobile'],
|
|
|
|
|
appTypes: [AppType.Mobile],
|
|
|
|
|
section: 'appearance',
|
|
|
|
|
options: () => {
|
|
|
|
|
// IMPORTANT: The font mapping must match the one in global-styles.js::editorFont()
|
|
|
|
@ -940,7 +946,7 @@ class Setting extends BaseModel {
|
|
|
|
|
value: '',
|
|
|
|
|
type: SettingItemType.String,
|
|
|
|
|
public: true,
|
|
|
|
|
appTypes: ['desktop'],
|
|
|
|
|
appTypes: [AppType.Desktop],
|
|
|
|
|
section: 'appearance',
|
|
|
|
|
label: () => _('Editor font family'),
|
|
|
|
|
description: () =>
|
|
|
|
@ -951,7 +957,7 @@ class Setting extends BaseModel {
|
|
|
|
|
value: '',
|
|
|
|
|
type: SettingItemType.String,
|
|
|
|
|
public: true,
|
|
|
|
|
appTypes: ['desktop'],
|
|
|
|
|
appTypes: [AppType.Desktop],
|
|
|
|
|
section: 'appearance',
|
|
|
|
|
label: () => _('Editor monospace font family'),
|
|
|
|
|
description: () =>
|
|
|
|
@ -959,7 +965,7 @@ class Setting extends BaseModel {
|
|
|
|
|
storage: SettingStorage.File,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
'ui.layout': { value: {}, type: SettingItemType.Object, storage: SettingStorage.File, public: false, appTypes: ['desktop'] },
|
|
|
|
|
'ui.layout': { value: {}, type: SettingItemType.Object, storage: SettingStorage.File, public: false, appTypes: [AppType.Desktop] },
|
|
|
|
|
|
|
|
|
|
// TODO: Is there a better way to do this? The goal here is to simply have
|
|
|
|
|
// a way to display a link to the customizable stylesheets, not for it to
|
|
|
|
@ -978,7 +984,7 @@ class Setting extends BaseModel {
|
|
|
|
|
},
|
|
|
|
|
type: SettingItemType.Button,
|
|
|
|
|
public: true,
|
|
|
|
|
appTypes: ['desktop'],
|
|
|
|
|
appTypes: [AppType.Desktop],
|
|
|
|
|
label: () => _('Custom stylesheet for rendered Markdown'),
|
|
|
|
|
section: 'appearance',
|
|
|
|
|
advanced: true,
|
|
|
|
@ -995,7 +1001,7 @@ class Setting extends BaseModel {
|
|
|
|
|
},
|
|
|
|
|
type: SettingItemType.Button,
|
|
|
|
|
public: true,
|
|
|
|
|
appTypes: ['desktop'],
|
|
|
|
|
appTypes: [AppType.Desktop],
|
|
|
|
|
label: () => _('Custom stylesheet for Joplin-wide app styles'),
|
|
|
|
|
section: 'appearance',
|
|
|
|
|
advanced: true,
|
|
|
|
@ -1006,7 +1012,7 @@ class Setting extends BaseModel {
|
|
|
|
|
value: null,
|
|
|
|
|
type: SettingItemType.Button,
|
|
|
|
|
public: true,
|
|
|
|
|
appTypes: ['desktop'],
|
|
|
|
|
appTypes: [AppType.Desktop],
|
|
|
|
|
label: () => _('Re-upload local data to sync target'),
|
|
|
|
|
section: 'sync',
|
|
|
|
|
advanced: true,
|
|
|
|
@ -1017,7 +1023,7 @@ class Setting extends BaseModel {
|
|
|
|
|
value: null,
|
|
|
|
|
type: SettingItemType.Button,
|
|
|
|
|
public: true,
|
|
|
|
|
appTypes: ['desktop'],
|
|
|
|
|
appTypes: [AppType.Desktop],
|
|
|
|
|
label: () => _('Delete local data and re-download from sync target'),
|
|
|
|
|
section: 'sync',
|
|
|
|
|
advanced: true,
|
|
|
|
@ -1025,8 +1031,8 @@ class Setting extends BaseModel {
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
autoUpdateEnabled: { value: true, type: SettingItemType.Bool, storage: SettingStorage.File, section: 'application', public: platform !== 'linux', appTypes: ['desktop'], label: () => _('Automatically update the application') },
|
|
|
|
|
'autoUpdate.includePreReleases': { value: false, type: SettingItemType.Bool, section: 'application', storage: SettingStorage.File, public: true, appTypes: ['desktop'], label: () => _('Get pre-releases when checking for updates'), description: () => _('See the pre-release page for more details: %s', 'https://joplinapp.org/prereleases') },
|
|
|
|
|
autoUpdateEnabled: { value: true, type: SettingItemType.Bool, storage: SettingStorage.File, section: 'application', public: platform !== 'linux', appTypes: [AppType.Desktop], label: () => _('Automatically update the application') },
|
|
|
|
|
'autoUpdate.includePreReleases': { value: false, type: SettingItemType.Bool, section: 'application', storage: SettingStorage.File, public: true, appTypes: [AppType.Desktop], label: () => _('Get pre-releases when checking for updates'), description: () => _('See the pre-release page for more details: %s', 'https://joplinapp.org/prereleases') },
|
|
|
|
|
'clipperServer.autoStart': { value: false, type: SettingItemType.Bool, storage: SettingStorage.File, public: false },
|
|
|
|
|
'sync.interval': {
|
|
|
|
|
value: 300,
|
|
|
|
@ -1055,13 +1061,13 @@ class Setting extends BaseModel {
|
|
|
|
|
public: true,
|
|
|
|
|
label: () => _('Synchronise only over WiFi connection'),
|
|
|
|
|
storage: SettingStorage.File,
|
|
|
|
|
appTypes: ['mobile'],
|
|
|
|
|
appTypes: [AppType.Mobile],
|
|
|
|
|
},
|
|
|
|
|
noteVisiblePanes: { value: ['editor', 'viewer'], type: SettingItemType.Array, storage: SettingStorage.File, public: false, appTypes: ['desktop'] },
|
|
|
|
|
tagHeaderIsExpanded: { value: true, type: SettingItemType.Bool, public: false, appTypes: ['desktop'] },
|
|
|
|
|
folderHeaderIsExpanded: { value: true, type: SettingItemType.Bool, public: false, appTypes: ['desktop'] },
|
|
|
|
|
editor: { value: '', type: SettingItemType.String, subType: 'file_path_and_args', storage: SettingStorage.File, public: true, appTypes: ['cli', 'desktop'], label: () => _('Text editor command'), description: () => _('The editor command (may include arguments) that will be used to open a note. If none is provided it will try to auto-detect the default editor.') },
|
|
|
|
|
'export.pdfPageSize': { value: 'A4', type: SettingItemType.String, advanced: true, storage: SettingStorage.File, isEnum: true, public: true, appTypes: ['desktop'], label: () => _('Page size for PDF export'), options: () => {
|
|
|
|
|
noteVisiblePanes: { value: ['editor', 'viewer'], type: SettingItemType.Array, storage: SettingStorage.File, public: false, appTypes: [AppType.Desktop] },
|
|
|
|
|
tagHeaderIsExpanded: { value: true, type: SettingItemType.Bool, public: false, appTypes: [AppType.Desktop] },
|
|
|
|
|
folderHeaderIsExpanded: { value: true, type: SettingItemType.Bool, public: false, appTypes: [AppType.Desktop] },
|
|
|
|
|
editor: { value: '', type: SettingItemType.String, subType: 'file_path_and_args', storage: SettingStorage.File, public: true, appTypes: [AppType.Cli, AppType.Desktop], label: () => _('Text editor command'), description: () => _('The editor command (may include arguments) that will be used to open a note. If none is provided it will try to auto-detect the default editor.') },
|
|
|
|
|
'export.pdfPageSize': { value: 'A4', type: SettingItemType.String, advanced: true, storage: SettingStorage.File, isEnum: true, public: true, appTypes: [AppType.Desktop], label: () => _('Page size for PDF export'), options: () => {
|
|
|
|
|
return {
|
|
|
|
|
'A4': _('A4'),
|
|
|
|
|
'Letter': _('Letter'),
|
|
|
|
@ -1071,7 +1077,7 @@ class Setting extends BaseModel {
|
|
|
|
|
'Legal': _('Legal'),
|
|
|
|
|
};
|
|
|
|
|
} },
|
|
|
|
|
'export.pdfPageOrientation': { value: 'portrait', type: SettingItemType.String, storage: SettingStorage.File, advanced: true, isEnum: true, public: true, appTypes: ['desktop'], label: () => _('Page orientation for PDF export'), options: () => {
|
|
|
|
|
'export.pdfPageOrientation': { value: 'portrait', type: SettingItemType.String, storage: SettingStorage.File, advanced: true, isEnum: true, public: true, appTypes: [AppType.Desktop], label: () => _('Page orientation for PDF export'), options: () => {
|
|
|
|
|
return {
|
|
|
|
|
'portrait': _('Portrait'),
|
|
|
|
|
'landscape': _('Landscape'),
|
|
|
|
@ -1082,7 +1088,7 @@ class Setting extends BaseModel {
|
|
|
|
|
value: '',
|
|
|
|
|
type: SettingItemType.String,
|
|
|
|
|
public: true,
|
|
|
|
|
appTypes: ['desktop'],
|
|
|
|
|
appTypes: [AppType.Desktop],
|
|
|
|
|
isEnum: true,
|
|
|
|
|
advanced: true,
|
|
|
|
|
label: () => _('Keyboard Mode'),
|
|
|
|
@ -1100,7 +1106,7 @@ class Setting extends BaseModel {
|
|
|
|
|
value: false,
|
|
|
|
|
type: SettingItemType.Bool,
|
|
|
|
|
public: true,
|
|
|
|
|
appTypes: ['desktop'],
|
|
|
|
|
appTypes: [AppType.Desktop],
|
|
|
|
|
label: () => 'Enable spell checking in Markdown editor? (WARNING BETA feature)',
|
|
|
|
|
description: () => 'Spell checker in the Markdown editor was previously unstable (cursor location was not stable, sometimes edits would not be saved or reflected in the viewer, etc.) however it appears to be more reliable now. If you notice any issue, please report it on GitHub or the Joplin Forum (Help -> Joplin Forum)',
|
|
|
|
|
},
|
|
|
|
@ -1114,7 +1120,7 @@ class Setting extends BaseModel {
|
|
|
|
|
return [SyncTargetRegistry.nameToId('nextcloud'), SyncTargetRegistry.nameToId('webdav'), SyncTargetRegistry.nameToId('joplinServer')].indexOf(settings['sync.target']) >= 0;
|
|
|
|
|
},
|
|
|
|
|
public: true,
|
|
|
|
|
appTypes: ['desktop', 'cli'],
|
|
|
|
|
appTypes: [AppType.Desktop, AppType.Cli],
|
|
|
|
|
label: () => _('Custom TLS certificates'),
|
|
|
|
|
description: () => _('Comma-separated list of paths to directories to load the certificates from, or path to individual cert files. For example: /my/cert_dir, /other/custom.pem. Note that if you make changes to the TLS settings, you must save your changes before clicking on "Check synchronisation configuration".'),
|
|
|
|
|
storage: SettingStorage.File,
|
|
|
|
@ -1129,7 +1135,6 @@ class Setting extends BaseModel {
|
|
|
|
|
[SyncTargetRegistry.nameToId('nextcloud'), SyncTargetRegistry.nameToId('webdav'), SyncTargetRegistry.nameToId('joplinServer')].indexOf(settings['sync.target']) >= 0;
|
|
|
|
|
},
|
|
|
|
|
public: true,
|
|
|
|
|
appTypes: ['desktop', 'cli', 'mobile'],
|
|
|
|
|
label: () => _('Ignore TLS certificate errors'),
|
|
|
|
|
storage: SettingStorage.File,
|
|
|
|
|
},
|
|
|
|
@ -1146,7 +1151,7 @@ class Setting extends BaseModel {
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
'api.token': { value: null, type: SettingItemType.String, public: false, storage: SettingStorage.File },
|
|
|
|
|
'api.port': { value: null, type: SettingItemType.Int, storage: SettingStorage.File, public: true, appTypes: ['cli'], description: () => _('Specify the port that should be used by the API server. If not set, a default will be used.') },
|
|
|
|
|
'api.port': { value: null, type: SettingItemType.Int, storage: SettingStorage.File, public: true, appTypes: [AppType.Cli], description: () => _('Specify the port that should be used by the API server. If not set, a default will be used.') },
|
|
|
|
|
|
|
|
|
|
'resourceService.lastProcessedChangeId': { value: 0, type: SettingItemType.Int, public: false },
|
|
|
|
|
'searchEngine.lastProcessedChangeId': { value: 0, type: SettingItemType.Int, public: false },
|
|
|
|
@ -1175,8 +1180,8 @@ class Setting extends BaseModel {
|
|
|
|
|
'welcome.wasBuilt': { value: false, type: SettingItemType.Bool, public: false },
|
|
|
|
|
'welcome.enabled': { value: true, type: SettingItemType.Bool, public: false },
|
|
|
|
|
|
|
|
|
|
'camera.type': { value: 0, type: SettingItemType.Int, public: false, appTypes: ['mobile'] },
|
|
|
|
|
'camera.ratio': { value: '4:3', type: SettingItemType.String, public: false, appTypes: ['mobile'] },
|
|
|
|
|
'camera.type': { value: 0, type: SettingItemType.Int, public: false, appTypes: [AppType.Mobile] },
|
|
|
|
|
'camera.ratio': { value: '4:3', type: SettingItemType.String, public: false, appTypes: [AppType.Mobile] },
|
|
|
|
|
|
|
|
|
|
'spellChecker.enabled': { value: true, type: SettingItemType.Bool, storage: SettingStorage.File, public: false },
|
|
|
|
|
'spellChecker.language': { value: '', type: SettingItemType.String, storage: SettingStorage.File, public: false },
|
|
|
|
@ -1185,7 +1190,7 @@ class Setting extends BaseModel {
|
|
|
|
|
value: 100,
|
|
|
|
|
type: SettingItemType.Int,
|
|
|
|
|
public: false,
|
|
|
|
|
appTypes: ['desktop'],
|
|
|
|
|
appTypes: [AppType.Desktop],
|
|
|
|
|
minimum: 30,
|
|
|
|
|
maximum: 300,
|
|
|
|
|
step: 10,
|
|
|
|
@ -1197,7 +1202,7 @@ class Setting extends BaseModel {
|
|
|
|
|
type: SettingItemType.Int,
|
|
|
|
|
section: 'appearance',
|
|
|
|
|
public: true,
|
|
|
|
|
appTypes: ['cli'],
|
|
|
|
|
appTypes: [AppType.Cli],
|
|
|
|
|
label: () => _('Notebook list growth factor'),
|
|
|
|
|
description: () =>
|
|
|
|
|
_('The factor property sets how the item will grow or shrink ' +
|
|
|
|
@ -1211,7 +1216,7 @@ class Setting extends BaseModel {
|
|
|
|
|
type: SettingItemType.Int,
|
|
|
|
|
section: 'appearance',
|
|
|
|
|
public: true,
|
|
|
|
|
appTypes: ['cli'],
|
|
|
|
|
appTypes: [AppType.Cli],
|
|
|
|
|
label: () => _('Note list growth factor'),
|
|
|
|
|
description: () =>
|
|
|
|
|
_('The factor property sets how the item will grow or shrink ' +
|
|
|
|
@ -1225,7 +1230,7 @@ class Setting extends BaseModel {
|
|
|
|
|
type: SettingItemType.Int,
|
|
|
|
|
section: 'appearance',
|
|
|
|
|
public: true,
|
|
|
|
|
appTypes: ['cli'],
|
|
|
|
|
appTypes: [AppType.Cli],
|
|
|
|
|
label: () => _('Note area growth factor'),
|
|
|
|
|
description: () =>
|
|
|
|
|
_('The factor property sets how the item will grow or shrink ' +
|
|
|
|
@ -1239,7 +1244,7 @@ class Setting extends BaseModel {
|
|
|
|
|
value: false,
|
|
|
|
|
type: SettingItemType.Bool,
|
|
|
|
|
public: false,
|
|
|
|
|
appTypes: ['desktop'],
|
|
|
|
|
appTypes: [AppType.Desktop],
|
|
|
|
|
storage: SettingStorage.Database,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
@ -1264,6 +1269,11 @@ class Setting extends BaseModel {
|
|
|
|
|
return this.metadata_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static featureFlagKeys(appType: AppType): string[] {
|
|
|
|
|
const keys = this.keys(false, appType);
|
|
|
|
|
return keys.filter(k => k.indexOf('featureFlag.') === 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static validateKey(key: string) {
|
|
|
|
|
if (!key) throw new Error('Cannot register empty key');
|
|
|
|
|
if (key.length > 128) throw new Error(`Key length cannot be longer than 128 characters: ${key}`);
|
|
|
|
@ -1319,7 +1329,7 @@ class Setting extends BaseModel {
|
|
|
|
|
return key in this.metadata();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static keyDescription(key: string, appType: string = null) {
|
|
|
|
|
static keyDescription(key: string, appType: AppType = null) {
|
|
|
|
|
const md = this.settingMetadata(key);
|
|
|
|
|
if (!md.description) return null;
|
|
|
|
|
return md.description(appType);
|
|
|
|
@ -1329,7 +1339,7 @@ class Setting extends BaseModel {
|
|
|
|
|
return this.metadata()[key] && this.metadata()[key].secure === true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static keys(publicOnly: boolean = false, appType: string = null, options: KeysOptions = null) {
|
|
|
|
|
static keys(publicOnly: boolean = false, appType: AppType = null, options: KeysOptions = null) {
|
|
|
|
|
options = Object.assign({}, {
|
|
|
|
|
secureOnly: false,
|
|
|
|
|
}, options);
|
|
|
|
@ -1827,7 +1837,7 @@ class Setting extends BaseModel {
|
|
|
|
|
this.saveTimeoutId_ = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static publicSettings(appType: string) {
|
|
|
|
|
static publicSettings(appType: AppType) {
|
|
|
|
|
if (!appType) throw new Error('appType is required');
|
|
|
|
|
|
|
|
|
|
const metadata = this.metadata();
|
|
|
|
|