client/src/components/SlateEditor.js
changeset 143 cfcbf4bc66f1
parent 138 a1fb2ced3049
child 157 5c3af4f10e92
equal deleted inserted replaced
142:56850f5c73f6 143:cfcbf4bc66f1
     1 import { Editor, Plain, Raw } from 'slate'
     1 import { Editor, Plain, Raw } from 'slate'
     2 import React from 'react'
     2 import React from 'react'
     3 import Portal from 'react-portal'
     3 import Portal from 'react-portal'
     4 import { Button } from 'react-bootstrap'
       
     5 import Immutable from 'immutable'
     4 import Immutable from 'immutable'
     6 import HtmlSerializer from '../HtmlSerializer'
     5 import HtmlSerializer from '../HtmlSerializer'
     7 import AnnotationPlugin from '../AnnotationPlugin'
     6 import AnnotationPlugin from '../AnnotationPlugin'
     8 import CategoriesTooltip from './CategoriesTooltip'
     7 import CategoriesTooltip from './CategoriesTooltip'
     9 import { now } from '../utils';
     8 import { now } from '../utils';
   437 
   436 
   438   renderToolbarCheckbox = () => {
   437   renderToolbarCheckbox = () => {
   439     return (
   438     return (
   440       <div className="checkbox">
   439       <div className="checkbox">
   441         <label>
   440         <label>
   442           <input type="checkbox" checked={this.props.isChecked} onChange={this.onCheckboxChange} /> <kbd>Enter</kbd> = add note
   441           <input type="checkbox" checked={this.props.isChecked} onChange={this.onCheckboxChange} /> <kbd>Entrée</kbd>= Ajouter une note
   443         </label>
   442         </label>
   444       </div>
   443       </div>
   445     )
   444     )
   446   }
   445   }
   447 
   446 
   448   renderToolbarButtons = () => {
   447   renderToolbarButtons = () => {
   449     return (
   448     return (
   450       <div>
   449       <div>
   451         { !this.props.note && this.renderToolbarCheckbox() }
   450         { !this.props.note && this.renderToolbarCheckbox() }
   452         <Button bsStyle="primary" disabled={this.props.isButtonDisabled} onClick={this.onButtonClick}>
   451         <button type="button" className="btn btn-primary btn-lg" disabled={this.props.isButtonDisabled} onClick={this.onButtonClick}>
   453         { this.props.note ? 'Save note' : 'Add note' }
   452           { this.props.note ? 'Save note' : 'Ajouter' }
   454         </Button>
   453         </button>
   455       </div>
   454       </div>
   456     );
   455     );
   457   }
   456   }
   458 
   457 
   459   /**
   458   /**