nl_tokens: Prompt the user to confirm an action .
pl_tokens: function confirm ( params ) { params = _ . extend ( { text : 'Are you sure?' , yesText : 'Yes' , yesClass : 'btn-danger' , noText : 'Cancel' , escapedHtml : false , msgConfirmation : false , additionalText : '' , name : '' } , params ) ; $ ( '#g-dialog-container' ) . html ( ConfirmDialogTemplate ( { params : params } ) ) . girderModal ( false ) . one ( 'hidden.bs.modal' , function ( ) { $ ( '#g-confirm-button' ) . off ( 'click' ) ; } ) ; const el = $ ( '#g-dialog-container' ) . find ( '.modal-body>p:first-child' ) ; if ( params . escapedHtml ) { el . html ( params . text ) ; } else { el . text ( params . text ) ; } if ( params [ 'msgConfirmation' ] ) { if ( params . escapedHtml ) { $ ( '.g-additional-text' ) . html ( params . additionalText ) ; } else { $ ( '.g-additional-text' ) . text ( params . additionalText ) ; } } $ ( '#g-confirm-button' ) . off ( 'click' ) . click ( function ( ) { if ( params [ 'msgConfirmation' ] ) { const key = ` ${ params . yesText . toUpperCase ( ) } ${ params . name } ` ; const msg = $ ( '#g-confirm-text' ) . val ( ) ; if ( <mask> . toUpperCase ( ) === key . toUpperCase ( ) ) { $ ( '#g-dialog-container' ) . modal ( 'hide' ) ; params . confirmCallback ( ) ; } else if ( msg . toUpperCase ( ) === '' ) { $ ( '.g-msg-error' ) . html ( ` ${ key } ` ) ; $ ( '.g-msg-error' ) . css ( 'color' , 'red' ) ; } else { $ ( '.g-msg-error' ) . html ( ` ${ msg } ${ key } ` ) ; $ ( '.g-msg-error' ) . css ( 'color' , 'red' ) ; } } else { $ ( '#g-dialog-container' ) . modal ( 'hide' ) ; params . confirmCallback ( ) ; } } ) ; }