Last active
August 29, 2015 14:15
-
-
Save danni/a4031ac57e75cb375ec1 to your computer and use it in GitHub Desktop.
View CI Images
This file contains hidden or 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 View CI Images | |
// @namespace io.ixa.ci | |
// @description View CI Images | |
// @version 1 | |
// @match https://gitlabci/projects/*/builds/* | |
// ==/UserScript== | |
(function ($) { | |
var text = $('#build-trace').html(); | |
/* HACKY: we can't consume any of the buffer else we can't replace | |
* the next image */ | |
text = text.replace(/(Test_.+\.png)\n([A-Za-z0-9\n\/\+=]+)\nEOF\n/g, | |
'<h2>$1</h2><img src="data:image/png;base64,$2" ' + | |
'style="display:block; max-width:800px; width: auto; height: auto;" ' + | |
'/>'); | |
$('#build-trace').html(text); | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment