File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
lib/better_errors/templates Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 849849 this . inputElement = this . container . querySelector ( "input" ) ;
850850 this . outputElement = this . container . querySelector ( "pre" ) ;
851851
852+ this . hasUsedConsole = document . cookie . split ( '; ' ) . find ( function ( cookie ) {
853+ return cookie . startsWith ( 'BetterErrors-has-used-console=' ) ;
854+ } ) ;
855+ if ( this . hasUsedConsole ) {
856+ this . hideConsoleHint ( ) ;
857+ }
858+
852859 var self = this ;
853860 this . inputElement . onkeydown = function ( ev ) {
854861 self . onKeyDown ( ev ) ;
862+ if ( ! self . hasUsedConsole ) {
863+ self . hideConsoleHint ( ) ;
864+ self . hasUsedConsole = true ;
865+ document . cookie = "BetterErrors-has-used-console=true;path=/;max-age=31536000;samesite"
866+ }
855867 } ;
856868
857869 this . setPrompt ( ">>" ) ;
858870
859871 REPL . all [ this . index ] = this ;
860- }
872+ } ;
873+
874+ REPL . prototype . hideConsoleHint = function ( ) {
875+ document . querySelector ( '#live-shell-hint' ) . style [ "display" ] = "none" ;
876+ } ;
861877
862878 REPL . prototype . focus = function ( ) {
863879 this . inputElement . focus ( ) ;
Original file line number Diff line number Diff line change 2525</ header >
2626
2727<% if BetterErrors . binding_of_caller_available? && @frame . frame_binding %>
28- < div class ="hint ">
28+ < div class ="hint " id =' live-shell-hint ' >
2929 This is a live shell. Type in here.
3030 </ div >
3131
You can’t perform that action at this time.
0 commit comments