зеркало из https://github.com/nextcloud/notes.git
feat: Add setting for rich mode and make markdown the default
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Родитель
a84387c69b
Коммит
54669f13a1
|
@ -18,7 +18,7 @@ class SettingsService {
|
|||
/* Allowed attributes */
|
||||
private array $attrs;
|
||||
|
||||
private $defaultSuffixes = [ '.txt', '.md' ];
|
||||
private $defaultSuffixes = [ '.md', '.txt' ];
|
||||
|
||||
public function __construct(
|
||||
IConfig $config,
|
||||
|
@ -48,7 +48,7 @@ class SettingsService {
|
|||
return implode(DIRECTORY_SEPARATOR, $path);
|
||||
},
|
||||
],
|
||||
'noteMode' => $this->getListAttrs('noteMode', ['edit', 'preview']),
|
||||
'noteMode' => $this->getListAttrs('noteMode', ['rich', 'edit', 'preview']),
|
||||
'customSuffix' => [
|
||||
'default' => $this->defaultSuffixes[0],
|
||||
'validate' => function ($value) {
|
||||
|
|
|
@ -63,11 +63,12 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
extensions: [
|
||||
{ value: '.txt', label: '.txt' },
|
||||
{ value: '.md', label: '.md' },
|
||||
{ value: '.txt', label: '.txt' },
|
||||
{ value: 'custom', label: t('notes', 'User defined') },
|
||||
],
|
||||
noteModes: [
|
||||
{ value: 'rich', label: t('notes', 'Open in rich text mode') },
|
||||
{ value: 'edit', label: t('notes', 'Open in edit mode') },
|
||||
{ value: 'preview', label: t('notes', 'Open in preview mode') },
|
||||
],
|
||||
|
|
|
@ -195,14 +195,14 @@ class APIv1Test extends CommonAPITest {
|
|||
$this->updateSettings($settings, (object)[
|
||||
'fileSuffix' => '',
|
||||
], (object)[
|
||||
'fileSuffix' => '.txt',
|
||||
'fileSuffix' => '.md',
|
||||
], 'Update fileSuffix with empty value');
|
||||
$this->updateSettings($settings, (object)[
|
||||
'notesPath' => null,
|
||||
'fileSuffix' => null,
|
||||
], (object)[
|
||||
'notesPath' => 'Notes',
|
||||
'fileSuffix' => '.txt',
|
||||
'fileSuffix' => '.md',
|
||||
], 'Update settings with default values');
|
||||
$this->updateSettings($settings, (object)[
|
||||
'notesPath' => $originalPath,
|
||||
|
|
Загрузка…
Ссылка в новой задаче