mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-10 02:02:35 -05:00
Notebooks: Add setting for default text cell edit behavior (#12245)
* Add setting for default text cell edit behavior * string updates
This commit is contained in:
@@ -38,9 +38,9 @@ export class MarkdownToolbarComponent {
|
||||
public optionHeading3 = localize('optionHeading3', "Heading 3");
|
||||
public optionParagraph = localize('optionParagraph', "Paragraph");
|
||||
|
||||
public textViewButton = localize('textViewButton', "View as Text");
|
||||
public splitViewButton = localize('splitViewButton', "View as Split");
|
||||
public markdownButton = localize('markdownButton', "View as Markdown");
|
||||
public richTextViewButton = localize('richTextViewButton', "Rich Text View");
|
||||
public splitViewButton = localize('splitViewButton', "Split View");
|
||||
public markdownViewButton = localize('markdownViewButton', "Markdown View");
|
||||
|
||||
private _taskbarContent: Array<ITaskbarContent>;
|
||||
private _wysiwygTaskbarContent: Array<ITaskbarContent>;
|
||||
@@ -77,9 +77,9 @@ export class MarkdownToolbarComponent {
|
||||
let heading3 = this._instantiationService.createInstance(TransformMarkdownAction, 'notebook.heading3', this.optionHeading3, 'heading 3', this.optionHeading3, this.cellModel, MarkdownButtonType.HEADING3);
|
||||
let paragraph = this._instantiationService.createInstance(TransformMarkdownAction, 'notebook.paragraph', this.optionParagraph, 'paragraph', this.optionParagraph, this.cellModel, MarkdownButtonType.PARAGRAPH);
|
||||
|
||||
this._toggleTextViewAction = this._instantiationService.createInstance(ToggleViewAction, 'notebook.toggleTextView', '', 'masked-icon show-text active', this.textViewButton, true, false);
|
||||
this._toggleSplitViewAction = this._instantiationService.createInstance(ToggleViewAction, 'notebook.toggleSplitView', '', 'masked-icon split-toggle-on', this.splitViewButton, true, true);
|
||||
this._toggleMarkdownViewAction = this._instantiationService.createInstance(ToggleViewAction, 'notebook.toggleMarkdownView', '', 'masked-icon show-markdown', this.markdownButton, false, true);
|
||||
this._toggleTextViewAction = this._instantiationService.createInstance(ToggleViewAction, 'notebook.toggleTextView', '', this.cellModel.defaultToWYSIWYG ? 'masked-icon show-text active' : 'masked-icon show-text', this.richTextViewButton, true, false);
|
||||
this._toggleSplitViewAction = this._instantiationService.createInstance(ToggleViewAction, 'notebook.toggleSplitView', '', this.cellModel.defaultToWYSIWYG ? 'masked-icon split-toggle-on' : 'masked-icon split-toggle-on active', this.splitViewButton, true, true);
|
||||
this._toggleMarkdownViewAction = this._instantiationService.createInstance(ToggleViewAction, 'notebook.toggleMarkdownView', '', 'masked-icon show-markdown', this.markdownViewButton, false, true);
|
||||
|
||||
let taskbar = <HTMLElement>this.mdtoolbar.nativeElement;
|
||||
this._actionBar = new Taskbar(taskbar);
|
||||
|
||||
@@ -217,9 +217,9 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges {
|
||||
this._lastTrustedMode = this.cellModel.trustedMode;
|
||||
if ((!cellModelSourceJoined) && !this.isEditMode) {
|
||||
if (this.doubleClickEditEnabled) {
|
||||
this._content = localize('doubleClickEdit', "Double-click to edit");
|
||||
this._content = localize('doubleClickEdit', "<i>Double-click to edit</i>");
|
||||
} else {
|
||||
this._content = localize('addContent', "Add content here...");
|
||||
this._content = localize('addContent', "<i>Add content here...</i>");
|
||||
}
|
||||
} else {
|
||||
this._content = this.cellModel.source[0] === '' ? '<p> </p>' : this.cellModel.source;
|
||||
@@ -280,6 +280,8 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges {
|
||||
if (!this.isEditMode) {
|
||||
this.cellModel.showPreview = true;
|
||||
this.cellModel.showMarkdown = false;
|
||||
} else {
|
||||
this.markdownMode = this.cellModel.showMarkdown;
|
||||
}
|
||||
this.updatePreview();
|
||||
this._changeRef.detectChanges();
|
||||
|
||||
@@ -225,6 +225,11 @@ configurationRegistry.registerConfiguration({
|
||||
'type': 'boolean',
|
||||
'default': true,
|
||||
'description': localize('notebook.enableDoubleClickEdit', "Enable double click to edit for text cells in notebooks")
|
||||
},
|
||||
'notebook.setRichTextViewByDefault': {
|
||||
'type': 'boolean',
|
||||
'default': true,
|
||||
'description': localize('notebook.setRichTextViewByDefault', "Set Rich Text View mode by default for text cells")
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user