app/views/logs/index.erb in tailog-0.3.2 vs app/views/logs/index.erb in tailog-0.3.3

- old
+ new

@@ -8,17 +8,23 @@ <% File.open file_path do |file| %> <div id="content" class="content-hover"></div> <% end %> + <a id="add_divider" class="btn btn-danger pull-right">Add Divider</a> + <script type="text/javascript"> window.fileSize = {}; window.fileSizeDone = {}; var $window = $(window), $document = $(document), $content = $("#content"); + $("#add_divider").click(function() { + $content.append('<span class="divider">' + new Date() + '</span>'); + }); + function loadMore() { $.post(window.location.href, { seek: window.fileSize }, function(json) { try { var data = JSON.parse(json); @@ -28,10 +34,10 @@ window.fileSize[data.server_hostname] = data.file_size; if (!data.content) return; var shouldScrollToBottom = $window.scrollTop() + $window.height() == $document.height(); $content - .append('<span class="text-info">' + data.server_hostname + '</span>') + .append('<span class="text-info">' + data.server_hostname + ' - ' + data.file_size + '</span>') .append(data.content); if (shouldScrollToBottom) { $window.scrollTop($document.height() - $window.height()); }