@@ -371,8 +371,6 @@ export class KatexInputHelper implements IKatexInputHelper {
371371 await vme . initialiseCodeMirror ( ) ;
372372 this . localizer . subscribe ( this . onLocaleChanged . bind ( this ) ) ;
373373 await this . localizer . initialiseLanguageChoice ( this . localType ) ; // Progress dialog uses localized text
374- // NO ACTION on language choice dialog
375- // await this.parser.parseAsync('#wLANGUAGE_CHOISE');
376374
377375 $ . messager . progress ( {
378376 title : "Katex Input Helper" ,
@@ -397,7 +395,7 @@ export class KatexInputHelper implements IKatexInputHelper {
397395 await this . themes . initialiseThemeChoice ( this . style , this . rtlStyle ) ; // RTL STYLE defined after locale language
398396
399397 if ( ! this . platformInfo . isMobile ) {
400- $ ( '#myContainer' ) . layout ( { fit : true } ) ;
398+ $ ( '#myContainer' ) . layout ( { fit : true } ) ; // myContainer is only on desktop a layout
401399 }
402400 $ ( '#innerLayout' ) . layout ( { fit : true } ) ;
403401 vme . endWait ( ) ;
@@ -425,19 +423,6 @@ export class KatexInputHelper implements IKatexInputHelper {
425423 panel . panel ( 'resize' , { height : `${ part } %` } ) ;
426424 $ ( selector ) . layout ( 'resize' ) ;
427425 }
428-
429- // Intent: to restore original web page structure (required by Joplin plugin).
430- // Here: the viewport
431- // TODO: required? CHECK FUNCTIONALITY WITHOUT THIS
432- // It seems the functionality is given without this !!
433- /*
434- const content = $("body meta[name='viewport']").attr('content');
435- if (content) {
436- const html = `<meta name="viewport" content="${content}" ></meta>`;
437- $("meta[name='viewport']").remove();
438- $('html > head').append(html);
439- }
440- */
441426
442427 // Here: the body content
443428 $ ( 'body' ) . prepend ( $ ( '#joplin-plugin-content > div' ) ) ;
@@ -462,6 +447,7 @@ export class KatexInputHelper implements IKatexInputHelper {
462447
463448 console . log ( `Menu4 : ${ $ ( '#main-menu' ) . html ( ) } ` ) ;
464449 $ ( 'body' ) . prepend ( $ ( 'div:has(> .easyui-navpanel)' ) ) ;
450+
465451 // Placement of "navpanels" in body initiates buggy behavior
466452 //$('body').prepend($('.easyui-navpanel'));
467453
@@ -670,15 +656,11 @@ export class KatexInputHelper implements IKatexInputHelper {
670656 let vme = this ;
671657 const codeMirrorEditor = this . codeMirrorEditor ;
672658 await this . versions . init ( codeMirrorEditor . version ) ;
673- // Reserved.
674- const option = vme . platformInfo . isMobile ? 'contenteditable' : 'textarea' ; // RESERVED
675- try { codeMirrorEditor . setOption ( 'inputStyle' , option ) ; } catch ( e ) { }
659+
676660 codeMirrorEditor . on ( "change" , function ( ) { vme . autoUpdateOutput ( ) ; } ) ;
677661
678662 if ( vme . platformInfo . isMobile ) {
679663 $ ( vme . cmSelector ) . css ( 'font-size' , '1.3em' ) ;
680- // NO ACTION on Android
681- // $('.cm-content').attr('inputmethod', 'none');
682664 } else {
683665 /* The context menu appears but throws on click or mouse move afterwards:
684666 * NO OWNER => special handling.
@@ -793,8 +775,7 @@ export class KatexInputHelper implements IKatexInputHelper {
793775 }
794776
795777 // Configures Clicks on close buttons and Key handlers, Context menus and others
796- /* Moved to panels : Close button click handler
797- */
778+ // Moved to panels : Close button click handler
798779
799780 $ ( '#btRESET_WINDOW_POSITIONS' ) . on ( 'click' , function ( event ) {
800781 event . preventDefault ( ) ;
@@ -856,6 +837,8 @@ export class KatexInputHelper implements IKatexInputHelper {
856837 /**
857838 * Handles menu clicks of the main menu. This handler performs an additional
858839 * handling of the side menu.
840+ *
841+ * @param item - the clicked menu item
859842 */
860843 async onMenuClick ( item : any ) {
861844 let vme = this ;
@@ -926,8 +909,8 @@ export class KatexInputHelper implements IKatexInputHelper {
926909
927910 /**
928911 * Registers events for a window and opens it.
929- *
930912 * This whole effort is done to get the window position and size persisted.
913+ * Delegated to the panels instance.
931914 *
932915 * @param id - the HTML id of the window
933916 */
@@ -937,7 +920,6 @@ export class KatexInputHelper implements IKatexInputHelper {
937920
938921 /**
939922 * Registers events for a window and opens it.
940- *
941923 * This whole effort is done to get the window position and size persisted.
942924 *
943925 * @param id - the HTML id of the window
@@ -1087,7 +1069,7 @@ export class KatexInputHelper implements IKatexInputHelper {
10871069
10881070 /**
10891071 * Wrapper of the appropriate Math routine. Updates the math in the
1090- * output window.
1072+ * output window.
10911073 */
10921074 updateOutput ( ) {
10931075 this . math . updateOutput ( ) ;
@@ -1103,16 +1085,7 @@ export class KatexInputHelper implements IKatexInputHelper {
11031085 }
11041086
11051087 /**
1106- * OBSOLETE. NOT USED.
1107- *
1108- insertBeforeEachLine(b) {
1109- this.encloseSelection("", "", function(a) { a = a.replace(/\r/g, "");
1110- return b + a.replace(/\n/g, "\n" + b) })
1111- }
1112- */
1113-
1114- /**
1115- * For insertion of formulae with insertion point..
1088+ * For insertion of formulae with insertion point.
11161089 */
11171090 tag ( b : any , a : any ) {
11181091 b = b || null ;
0 commit comments