Skip to content

Commit

Permalink
Пауза логгирования на SPACE и при выделении текста
Browse files Browse the repository at this point in the history
  • Loading branch information
kohver committed Aug 14, 2012
1 parent c759a9a commit 3740547
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions public/index.html
Expand Up @@ -138,6 +138,21 @@ <h3>Settings</h3>
<script type="text/javascript" src="/socket.io/socket.io.js"></script>
<script type="text/javascript">
jQuery(document).ready(function() {
var KEY = window.KEY = {
LEFT: 37,
UP: 38,
RIGHT: 39,
DOWN: 40,
DEL: 8,
TAB: 9,
RETURN: 13,
ENTER: 13,
ESC: 27,
PAGEUP: 33,
PAGEDOWN: 34,
SPACE: 32
};

var logLinesTable = jQuery("#log-lines"),
logsListContainer = jQuery("#logs-list"),
logsList = jQuery(),
Expand All @@ -152,6 +167,7 @@ <h3>Settings</h3>
currentLog = undefined,
bufferLength = 20,
outputPaused = false,
mouseDowned = false,
linkSeparator = '!!!';

pauseButton.click(function() {
Expand Down Expand Up @@ -312,6 +328,27 @@ <h3>Settings</h3>
rebuildCurrentLink();
});

jQuery(window).keydown(function(e) {
if (e.keyCode == KEY.SPACE) {
pauseButton.click();
return false;
}
});

logLinesTable.mousedown(function() {
if (!outputPaused) {
outputPaused = true;
mouseDowned = true;
}
});

logLinesTable.mouseup(function() {
if (mouseDowned) {
outputPaused = false;
mouseDowned = false;
}
});

(function initFromURI() {
function getURLParameter(name) {
var value = (RegExp(name + '=' + '(.*?)(&|$)').exec(location.search)||[,null])[1];
Expand Down

0 comments on commit 3740547

Please sign in to comment.