class BookmarkMenu { constructor(num, part) { this.num = num this.part = part this.bookmark_op_sel = Globalx[part].bookmark_op_sel this.bookmark_mgr = Globalx[part].bookmark_mgr this.bookmark_sel = Globalx[part].bookmark_sel this.key_sel = Globalx[part].key_sel this.editor = Globalx[part].editor this.textarea_sel = Globalx[part].textarea_sel this.menu_sel = Globalx[part].menu_sel } add_bookmark() { $( '#bookmark_displayname' ).val( Globalx[this.part].bookmark_mgr.get_restricted_display_name( Globalx[this.part].key ) ) $( '#bookmark_path' ).val( Globalx[this.part].key ) $( '#bookmarkDlg' ).dialog("open") } remove_bookmark() { this.bookmark_mgr.remove( Globalx[this.part].key ) this.rebuild_bookmark_menu() } bookmark_op() { if( $( this.bookmark_op_sel ).is(':checked') == true ){ this.add_bookmark() } else{ this.remove_bookmark() } } set_click_handler() { console.log( "set_click_handler() part=" + this.part + " num=" + this.num ) $( this.bookmark_op_sel ).on( 'click' , () => { this.bookmark_op() } ) } register_bookmark_( path, displayname ) { this.bookmark_mgr.add( path , displayname ) this.rebuild_bookmark_menu() } rebuild_bookmark_menu() { $( this.bookmark_sel ).empty() const array = this.bookmark_mgr.get_paths() array.map( ( path ) => { const display_name = this.bookmark_mgr.display_name( path ) content = `