mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	Added show/hide line numbers button to show config page
This commit is contained in:
		@@ -223,3 +223,24 @@ $(document).on("click", '.collapse-neighbors', function(event)
 | 
			
		||||
    list.toggle();
 | 
			
		||||
    continued.toggle();
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
$(document).ready(function() {
 | 
			
		||||
    var lines = 'on';
 | 
			
		||||
    $("#linenumbers").button().click(function() {
 | 
			
		||||
        if (lines == 'on') {
 | 
			
		||||
            $($('.config').find('ol').get().reverse()).each(function(){
 | 
			
		||||
                $(this).replaceWith($('<ul>'+$(this).html()+'</ul>'))
 | 
			
		||||
                lines = 'off';
 | 
			
		||||
                $('#linenumbers').val('Show line numbers');
 | 
			
		||||
            });
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            $($('.config').find('ul').get().reverse()).each(function(){
 | 
			
		||||
                $(this).replaceWith($('<ol>'+$(this).html()+'</ol>'));
 | 
			
		||||
                lines = 'on';
 | 
			
		||||
                $('#linenumbers').val('Hide line numbers');
 | 
			
		||||
            });
 | 
			
		||||
        }
 | 
			
		||||
    });
 | 
			
		||||
});
 | 
			
		||||
 
 | 
			
		||||
@@ -182,7 +182,10 @@ if ($_SESSION['userlevel'] >= '7') {
 | 
			
		||||
        $geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS);
 | 
			
		||||
        $geshi->set_overall_style('color: black;');
 | 
			
		||||
        // $geshi->set_line_style('color: #999999');
 | 
			
		||||
        echo '<div class="config">';
 | 
			
		||||
        echo '<input id="linenumbers" class="btn btn-primary" type="submit" value="Hide line numbers"/>';
 | 
			
		||||
        echo $geshi->parse_code();
 | 
			
		||||
        echo '</div>';
 | 
			
		||||
    }
 | 
			
		||||
}//end if
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user