Merge pull request #4 from sebastienlevert/master
Adding AceEditor as the default Code editor
This commit is contained in:
commit
04d7a3f9ef
|
@ -16,6 +16,8 @@
|
||||||
"@types/react-addons-update": "0.14.14",
|
"@types/react-addons-update": "0.14.14",
|
||||||
"@types/react-dom": "0.14.18",
|
"@types/react-dom": "0.14.18",
|
||||||
"@types/webpack-env": ">=1.12.1 <1.14.0",
|
"@types/webpack-env": ">=1.12.1 <1.14.0",
|
||||||
|
"brace": "^0.10.0",
|
||||||
|
"react-ace": "^4.2.1",
|
||||||
"handlebars": "^4.0.6",
|
"handlebars": "^4.0.6",
|
||||||
"handlebars-helpers": "^0.8.2",
|
"handlebars-helpers": "^0.8.2",
|
||||||
"moment": "^2.18.1",
|
"moment": "^2.18.1",
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
.ace_editor.ace_autocomplete {
|
||||||
|
z-index: 2000000 !important;
|
||||||
|
}
|
|
@ -4,7 +4,14 @@ import { Button, ButtonType, Label } from 'office-ui-fabric-react';
|
||||||
import { TextField } from 'office-ui-fabric-react';
|
import { TextField } from 'office-ui-fabric-react';
|
||||||
import { ITextDialogProps } from './ITextDialogProps';
|
import { ITextDialogProps } from './ITextDialogProps';
|
||||||
import { ITextDialogState } from './ITextDialogState';
|
import { ITextDialogState } from './ITextDialogState';
|
||||||
|
import AceEditor from 'react-ace';
|
||||||
import styles from './TextDialog.module.scss';
|
import styles from './TextDialog.module.scss';
|
||||||
|
import './AceEditor.scss';
|
||||||
|
|
||||||
|
import 'brace';
|
||||||
|
import 'brace/mode/html';
|
||||||
|
import 'brace/theme/monokai';
|
||||||
|
import 'brace/ext/language_tools';
|
||||||
|
|
||||||
export class TextDialog extends React.Component<ITextDialogProps, ITextDialogState> {
|
export class TextDialog extends React.Component<ITextDialogProps, ITextDialogState> {
|
||||||
|
|
||||||
|
@ -83,11 +90,16 @@ export class TextDialog extends React.Component<ITextDialogProps, ITextDialogSta
|
||||||
isBlocking={ true }
|
isBlocking={ true }
|
||||||
containerClassName={ 'ms-dialogMainOverride ' + styles.textDialog }>
|
containerClassName={ 'ms-dialogMainOverride ' + styles.textDialog }>
|
||||||
|
|
||||||
<TextField placeholder={ this.props.strings.dialogTextBoxPlaceholder }
|
<AceEditor
|
||||||
value={ this.state.dialogText }
|
width="100%"
|
||||||
multiline rows={ 20 }
|
mode="html"
|
||||||
resizable={ true }
|
theme="monokai"
|
||||||
onChanged={ this.onDialogTextChanged.bind(this) } />
|
enableLiveAutocompletion={ true }
|
||||||
|
showPrintMargin={ false }
|
||||||
|
onChange={ this.onDialogTextChanged.bind(this) }
|
||||||
|
value={ this.state.dialogText }
|
||||||
|
name="CodeEditor"
|
||||||
|
editorProps={{$blockScrolling: 0}} />
|
||||||
|
|
||||||
<DialogFooter>
|
<DialogFooter>
|
||||||
<Button buttonType={ ButtonType.primary } onClick={ this.saveDialog.bind(this) }>{ this.props.strings.saveButtonText }</Button>
|
<Button buttonType={ ButtonType.primary } onClick={ this.saveDialog.bind(this) }>{ this.props.strings.saveButtonText }</Button>
|
||||||
|
|
Loading…
Reference in New Issue