app/assets/javascripts/pghero/application.js in pghero-1.7.0 vs app/assets/javascripts/pghero/application.js in pghero-2.0.0

- old
+ new

@@ -1,10 +1,17 @@ //= require ./jquery //= require ./jquery.nouislider.min //= require ./Chart.bundle //= require ./chartkick +//= require ./highlight.pack +function highlightQueries() { + $("pre code").each(function(i, block) { + hljs.highlightBlock(block); + }); +} + function initSlider() { function roundTime(time) { var period = 1000 * 60 * 5; return new Date(Math.ceil(time.getTime() / period) * period); } @@ -120,9 +127,11 @@ var callback = function (response, status, xhr) { if (status === "error" ) { $(".queries-info").css("color", "red").html(xhr.status + " " + xhr.statusText); + } else { + highlightQueries(); } }; $("#queries").html('<tr><td colspan="3"><p class="queries-info text-muted">...</p></td></tr>').load(path, callback); if (push && history.pushState) {