99 IKatexInputHelper ,
1010 ILocalizer , localizerId ,
1111 IMessager , messagerId ,
12- IUtilities , utilitiesId ,
12+ IUtilities , utilitiesId , State ,
1313 parametersId ,
1414 IThemes , themesId ,
1515 IParser , parserId ,
@@ -166,6 +166,8 @@ export class KatexInputHelper implements IKatexInputHelper {
166166 parser : IParser = null ;
167167 VKI_show : any = null ;
168168 sidemenuData : any = { } ;
169+ customEquationsToggler = null ;
170+ unicodeToggler = null ;
169171
170172 /**
171173 * Constructor
@@ -356,13 +358,15 @@ export class KatexInputHelper implements IKatexInputHelper {
356358 vme . initialiseCodeMirror ( ) ;
357359 this . localizer . subscribe ( this . onLocaleChanged . bind ( this ) ) ;
358360 await this . localizer . initialiseLanguageChoice ( this . localType ) ; // Progress dialog uses localized text
361+ // NO ACTION on language choice dialog
362+ // await this.parser.parseAsync('#wLANGUAGE_CHOISE');
359363
360364 $ . messager . progress ( {
361365 title : "Katex Input Helper" ,
362366 text : vme . getLocalText ( "WAIT_FOR_EDITOR_DOWNLOAD" ) ,
363367 msg : "<center>© " +
364- "<a href='mailto:juergen@habelt-jena.de?subject=Katex%20Input%20Helper' target='_blank' class='bt' >Jürgen Habelt</a> -" +
365- "<a href='https://github.com/Mick2nd/Katex-Input-Helper' target='_blank' class='bt' >A Joplin plug-in</a><br/><br/>" +
368+ "<a href='mailto:juergen@habelt-jena.de?subject=Katex%20Input%20Helper' target='_blank' class='bt progress ' >Jürgen Habelt</a> -" +
369+ "<a href='https://github.com/Mick2nd/Katex-Input-Helper' target='_blank' class='bt progress ' >A Joplin plug-in</a><br/><br/>" +
366370 "</center>" ,
367371 interval : 300
368372 } ) ;
@@ -482,11 +486,11 @@ export class KatexInputHelper implements IKatexInputHelper {
482486 event . preventDefault ( ) ;
483487 $ . mobile . go ( '#wrapperPanelMenu' , 'slide' , 'left' ) ;
484488 } ) ;
485- $ ( "header:has(+ #wrapperPanel) a.m- back" ) . on ( 'click' , function ( _ ) {
489+ $ ( "header:has(+ #wrapperPanel) a.back" ) . on ( 'click' , function ( _ ) {
486490 inst . panels . closeOpen ( ) ;
487491 inst . codeMirrorEditor . activateEditor ( ) ; // workaround to re-activate the editor
488492 } ) ;
489- $ ( "header:has(+ #westRegion) a.m- back, header:has(+ #eastRegion) a.m- back, header:has(+ #wrapperPanelMenu) a.m- back" ) . on ( 'click' , function ( _ ) {
493+ $ ( "header:has(+ #westRegion) a.back, header:has(+ #eastRegion) a.back, header:has(+ #wrapperPanelMenu) a.back" ) . on ( 'click' , function ( _ ) {
490494 inst . codeMirrorEditor . activateEditor ( ) ; // workaround to re-activate the editor
491495 } ) ;
492496
@@ -613,7 +617,6 @@ export class KatexInputHelper implements IKatexInputHelper {
613617 onSelect : this . onMenuClick . bind ( this )
614618 } ) ;
615619 $ ( '#sm' ) . sidemenu ( 'expand' ) ;
616- $ ( '#sm' ) . sidemenu ( 'resize' , { width : 300 } ) ;
617620 }
618621
619622 /**
@@ -668,7 +671,7 @@ export class KatexInputHelper implements IKatexInputHelper {
668671 const codeMirrorEditor = this . codeMirrorEditor ;
669672 // Reserved.
670673 const option = vme . platformInfo . isMobile ? 'contenteditable' : 'textarea' ; // RESERVED
671- try { codeMirrorEditor . setOption ( 'inputStyle' , 'textarea' ) ; } catch ( e ) { }
674+ try { codeMirrorEditor . setOption ( 'inputStyle' , option ) ; } catch ( e ) { }
672675 codeMirrorEditor . on ( "change" , function ( ) { vme . autoUpdateOutput ( ) ; } ) ;
673676
674677 if ( vme . platformInfo . isMobile ) {
@@ -712,8 +715,8 @@ export class KatexInputHelper implements IKatexInputHelper {
712715 } ;
713716
714717 this . logProperties ( selector ) ;
715- // this code uses CSS to shift the context menu to the desired location (and its)
716- // shadow
718+ // this code uses CSS to shift the context menu to the desired location (and its
719+ // shadow)
717720 try {
718721 $ ( selector ) . menu ( 'show' , { left : event . pageX , top : event . pageY } ) ;
719722 $ ( `${ selector } ` ) . css ( {
@@ -787,21 +790,9 @@ export class KatexInputHelper implements IKatexInputHelper {
787790 }
788791
789792 // Configures Clicks on close buttons and Key handlers, Context menus and others
790- $ ( '#btSTYLE_CHOISE_CLOSE' ) . on ( 'click' , function ( event ) {
791- event . preventDefault ( ) ;
792- $ ( '#wSTYLE_CHOISE' ) . dialog ( 'close' ) ;
793- vme . setFocus ( ) ;
794- } ) ;
795- $ ( '#btLANGUAGE_CHOISE_CLOSE' ) . on ( 'click' , function ( event ) {
796- event . preventDefault ( ) ;
797- $ ( '#wLANGUAGE_CHOISE' ) . dialog ( 'close' ) ;
798- vme . setFocus ( ) ;
799- } ) ;
800- $ ( '#btEDITOR_PARAMETERS_CLOSE' ) . on ( 'click' , function ( event ) {
801- event . preventDefault ( ) ;
802- $ ( '#wEDITOR_PARAMETERS' ) . dialog ( 'close' ) ;
803- vme . setFocus ( ) ;
804- } ) ;
793+ /* Moved to panels : Close button click handler
794+ */
795+
805796 $ ( '#btRESET_WINDOW_POSITIONS' ) . on ( 'click' , function ( event ) {
806797 event . preventDefault ( ) ;
807798 vme . parameters . resetWindowPositions ( ) ;
@@ -844,6 +835,17 @@ export class KatexInputHelper implements IKatexInputHelper {
844835 }
845836 });
846837 */
838+
839+ this . customEquationsToggler = this . utilities . regionToggler (
840+ '#toggle_btn_1' ,
841+ '#CUSTOM_EQUATIONS_LAYOUT' ,
842+ this . platformInfo . isMobile ? State . Second : State . Both
843+ ) ;
844+ this . unicodeToggler = this . utilities . containerToggler (
845+ '#toggle_btn_2' ,
846+ '#cUNICODES_LIST' ,
847+ ! this . platformInfo . isMobile // true for desktop variant
848+ ) ;
847849
848850 this . math . updateLatexMenu ( ) ;
849851 }
@@ -857,9 +859,9 @@ export class KatexInputHelper implements IKatexInputHelper {
857859 console . log ( `Click with id ${ item . target . id } of %O` , item ) ;
858860
859861 const functions = {
860- "mEDITOR_PARAMETERS" : ( ) => vme . openWindow ( 'wEDITOR_PARAMETERS' ) ,
861- "mSTYLE_CHOISE" : ( ) => vme . openWindow ( 'wSTYLE_CHOISE' ) ,
862- "mLANGUAGE_CHOISE" : ( ) => vme . openWindow ( 'wLANGUAGE_CHOISE' ) ,
862+ "mEDITOR_PARAMETERS" : ( ) => vme . openDialog ( 'wEDITOR_PARAMETERS' ) ,
863+ "mSTYLE_CHOISE" : ( ) => vme . openDialog ( 'wSTYLE_CHOISE' ) ,
864+ "mLANGUAGE_CHOISE" : ( ) => vme . openDialog ( 'wLANGUAGE_CHOISE' ) ,
863865 "mMATRIX" : ( ) => vme . showMatrixWindow ( 3 , 3 ) ,
864866 "mCOMMUTATIVE_DIAGRAM" : ( ) => vme . initialiseUImoreDialogs ( "f_COMMUTATIVE_DIAGRAM" ) ,
865867 "mCHEMICAL_FORMULAE" : ( ) => vme . initialiseUImoreDialogs ( "f_CHEMICAL_FORMULAE" ) ,
0 commit comments