@@ -75,10 +75,10 @@ cls.JsSourceView = function(id, name, container_class)
7575
7676 templates . line_nummer = function ( )
7777 {
78- return [ 'li' ,
79- [ 'input' ] ,
80- [ 'span' , 'handler' , 'set-break-point' ] ,
81- ] ;
78+ return (
79+ [ "li" ,
80+ [ "input" ] ,
81+ [ "span" , "handler" , "set-break-point" , "class" , "break-point" ] ] ) ;
8282 }
8383
8484 var updateLineNumbers = function ( fromLine )
@@ -450,16 +450,27 @@ cls.JsSourceView = function(id, name, container_class)
450450 }
451451 }
452452
453- this . show_and_flash_line = function ( script_id , line_no )
453+ this . show_and_flash_line = function ( script_id , line_no_start , line_no_end )
454454 {
455- this . showLine ( script_id , line_no ) ;
456- var line = this . get_line_element ( line_no ) ;
457- if ( line && typeof line_no == "number" )
455+ if ( typeof line_no_start != "number" )
456+ return ;
457+
458+ line_no_end || ( line_no_end = line_no_start ) ;
459+ this . showLine ( script_id , line_no_start ) ;
460+ this . _change_highlight_class_lines ( "addClass" , line_no_start , line_no_end ) ;
461+ var cb = this . _change_highlight_class_lines . bind ( this , "removeClass" ,
462+ line_no_start , line_no_end ) ;
463+ setTimeout ( cb , 1000 ) ;
464+ } ;
465+
466+ this . _change_highlight_class_lines = function ( method , start , end )
467+ {
468+ for ( var i = start , line ; i <= end ; i ++ )
458469 {
459- line . addClass ( 'selected-js-source-line' ) ;
460- setTimeout ( function ( ) { line . removeClass ( ' selected-js-source-line' ) } , 800 ) ;
470+ if ( line = this . get_line_element ( i ) )
471+ line [ method ] ( " selected-js-source-line" ) ;
461472 }
462- }
473+ } ;
463474
464475 this . get_line_element = function ( line_no )
465476 {
@@ -1002,12 +1013,12 @@ cls.JsSourceView = function(id, name, container_class)
10021013cls . JsSourceView . update_breakpoints = function ( script , line_numbers , top_line )
10031014{
10041015 var BP_IMAGE_LINE_HEIGHT = 24 ;
1005- var lines = line_numbers && line_numbers . querySelectorAll ( "span " ) ;
1016+ var lines = line_numbers && line_numbers . querySelectorAll ( ".break-point " ) ;
10061017 var bp_states = script && script . breakpoint_states ;
10071018 if ( typeof top_line != "number" )
10081019 {
1009- var input = line_numbers . querySelector ( "input " ) ;
1010- top_line = input && Number ( input . value ) ;
1020+ var span = line_numbers . querySelector ( ".line-number " ) ;
1021+ top_line = span && Number ( span . textContent ) ;
10111022 }
10121023 if ( lines && bp_states && typeof top_line == "number" )
10131024 {
0 commit comments