the next generation of the in-browser educational proof assistant
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

text editors again

+10 -13
+8 -11
src/Editable.res
··· 20 20 21 21 module type COMPONENT = { 22 22 module Ports : PORTS 23 - type props = { content: string, imports: Ports.t, onChange: (string,~exports:Ports.t) => (), onLoad: (~exports:Ports.t) => () } 23 + type props = { content: string, imports: Ports.t, onLoad: (~exports:Ports.t) => (),onChange: (string,~exports:Ports.t) => () } 24 24 let make : props => React.element 25 25 } 26 26 ··· 75 75 } 76 76 if editing { 77 77 <div> 78 - <textarea className="editor-textArea" onChange={onTextChange}> 79 - {React.string(text)} 80 - </textarea> 78 + <textarea className="editor-textArea" value={text} onChange={onTextChange} /> 81 79 <div className="editor-controls"> 82 80 <span className="editor-button button-icon button-icon-blue typcn typcn-tick" onClick={done}> 83 81 </span> ··· 85 83 </div> 86 84 } else { 87 85 <div> 88 - {Underlying.make({ 89 - content:text, 90 - imports: props.imports, 91 - onLoad: props.onLoad, 92 - onChange: (string, ~exports) => { 86 + <Underlying 87 + content={text} 88 + imports={props.imports} 89 + onLoad={props.onLoad} 90 + onChange={(string, ~exports) => { 93 91 setText(_=>string) 94 92 props.onChange(string,~exports) 95 - } 96 - })} 93 + }} /> 97 94 <div className="editor-controls"> 98 95 <span className="editor-button button-icon button-icon-blue typcn typcn-edit" onClick={_ => setEditing(_ => true)}> 99 96 </span>
+2 -2
src/Scratch.res
··· 1 1 open Editable 2 2 open Method 3 3 open Util 4 - module AxiomS = AxiomSet(SExp,SExp,SExpJView) 4 + module AxiomS = TextAreaEditor(AxiomSet(SExp,SExp,SExpJView)) 5 5 module DerivationsOrLemmas = Combine(SExp,SExp,Derivation(SExp,SExp),Lemma(SExp,SExp)) 6 - module TheoremS = Theorem(SExp,SExp,SExpJView,DerivationsOrLemmas) 6 + module TheoremS = TextAreaEditor(Theorem(SExp,SExp,SExpJView,DerivationsOrLemmas)) 7 7 module Conf = Config(SExp,SExp) 8 8 //module RuleSExpTE = RuleSetSB(SExp,SExp,SExpJView) 9 9 //module RuleSExpView = WithTextArea(RuleSExpTE)