Created
December 15, 2014 14:23
-
-
Save adamchainz/5ba26a1bb93fe78a6d9c to your computer and use it in GitHub Desktop.
Highlight 'messages' text on logentries
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Highlight 'messages' text on logentries | |
// @namespace http://adamj.eu/ | |
// @version 0.1 | |
// @author me@adamj.eu | |
// @match https://logentries.com/app/* | |
// @grant none | |
// ==/UserScript== | |
var highlightMessageKey = function () { | |
$('.highlighted-key[data-query=\'"message"\']').each(function () { | |
var $this = $(this); | |
var contents = $this.parent().contents(); | |
var text = contents[contents.index(this) + 1]; | |
// If it be a DOM Text node, embolden its stripped contents | |
if (text instanceof Text) { | |
$this.after('<strong>' + text.data.replace(/\\n/g, "<br>") + '</strong>'); | |
text.remove(); | |
} | |
}); | |
}; | |
setInterval(highlightMessageKey, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment