Show console log

by patelsan

HTML

<script src="http://cdn.craig.is/js/mousetrap/mousetrap.min.js?9d308"></script>

JavaScript

Mousetrap.bind('shift+p', function(){
  console.log("Launch");
    
    $("body").append("<div id='traceViewer'></div>");

   $("#traceViewer")
      .height('140px')
      .css({
         'opacity' : 0.4,
         'position': 'absolute',
         'top': 0,
         'right': 0,
         'background-color': 'black',
         'width': '70%',
         'z-index': 5000,
         'color': 'white',
         'padding': '6px',
         'margin': '6px'
      });
    
    //In the log function
    var message = document.createTextNode("Sample here" + "\n");
    $("#traceViewer").append(message);
    
    Mousetrap.bind('shift+c', function(){
        $("#traceViewer").empty();
    });
});