Skip to content

Instantly share code, notes, and snippets.

@danni
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danni/a4031ac57e75cb375ec1 to your computer and use it in GitHub Desktop.
Save danni/a4031ac57e75cb375ec1 to your computer and use it in GitHub Desktop.
View CI Images
// ==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