@@ -70,12 +70,13 @@ const Front = (function() {
7070 } ;
7171
7272 var pressedHintKeys = "" ;
73+ var _display ;
7374 self . addEventListener ( 'keydown' , function ( event ) {
7475 if ( Mode . isSpecialKeyOf ( "<Esc>" , event . sk_keyName ) ) {
7576 self . hidePopup ( ) ;
7677 event . sk_stopPropagation = true ;
77- } else if ( _tabs . style . display !== "none" ) {
78- const tabHints = _tabs . querySelectorAll ( 'div>div.sk_tab_hint' ) ;
78+ } else if ( _display && _display . style . display !== "none" ) {
79+ const tabHints = _display . querySelectorAll ( 'div>div.sk_tab_hint' ) ;
7980 if ( tabHints . length > 0 ) {
8081 const key = event . sk_keyName ;
8182 const characters = hints . getCharacters ( ) . toLowerCase ( ) ;
@@ -88,7 +89,7 @@ const Front = (function() {
8889 pressedHintKeys = pressedHintKeys + key . toUpperCase ( ) ;
8990 const hintState = refreshHints ( tabHints , pressedHintKeys ) ;
9091 if ( hintState . matched ) {
91- _tabs . onHit ( hintState . matched ) ;
92+ _display . onHit ( hintState . matched ) ;
9293 pressedHintKeys = "" ;
9394 self . hidePopup ( ) ;
9495 } else if ( hintState . candidates === 0 ) {
@@ -203,7 +204,6 @@ const Front = (function() {
203204 } ;
204205 var keystroke = document . getElementById ( 'sk_keystroke' ) ;
205206
206- var _display ;
207207 self . startInputGuard = ( ) => {
208208 if ( getBrowserName ( ) . startsWith ( "Safari" ) ) {
209209 var inputGuard = setInterval ( ( ) => {
@@ -487,6 +487,24 @@ const Front = (function() {
487487 showPopup ( message . content ) ;
488488 } ;
489489
490+ _actions [ 'showDialog' ] = function ( message ) {
491+ showElement ( _popup , ( ) => {
492+ const hintLabels = hints . genLabels ( 2 ) ;
493+ setSanitizedContent ( _popup , `<div>${ message . question } </div><div><div class=sk_tab_hint>${ hintLabels [ 0 ] } </div><span class=sk_tab_group_title>Ok</span><div class=sk_tab_hint>${ hintLabels [ 1 ] } </div><span class=sk_tab_group_title>Cancel</span></div>` ) ;
494+ const tabHints = _popup . querySelectorAll ( "div.sk_tab_hint" ) ;
495+ _popup . style . textAlign = "center" ;
496+ tabHints [ 0 ] . link = "Ok" ;
497+ tabHints [ 0 ] . label = hintLabels [ 0 ] ;
498+ tabHints [ 1 ] . link = "Cancel" ;
499+ tabHints [ 1 ] . label = hintLabels [ 1 ] ;
500+ } , ( matched ) => {
501+ self . contentCommand ( {
502+ action : 'dialogResponse' ,
503+ result : matched
504+ } ) ;
505+ } ) ;
506+ } ;
507+
490508 self . vimMappings = [ ] ;
491509 let _aceEditor = null ;
492510 function renderAceEditor ( message ) {
0 commit comments