Skip to content
This repository has been archived by the owner on Jul 19, 2021. It is now read-only.

Commit

Permalink
First release
Browse files Browse the repository at this point in the history
  • Loading branch information
hho committed Dec 6, 2018
1 parent 191691d commit 34fe75d
Show file tree
Hide file tree
Showing 6 changed files with 194 additions and 0 deletions.
161 changes: 161 additions & 0 deletions dist/css/terminal-colors.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
/* Terminal */

body {
background-color: #000;
color: #c4c4c4;
}

pre {
font-family: "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace;
font-size: 12px;
line-height: 18px;
margin: 4px;
}

/* Characters */

span.sgr-1 {
/* Bold Characters */
font-weight: bold;
}

span.sgr-4 {
/* Underlined Characters */
text-decoration: underline;
}

span.sgr-5 {
/* Blinking Characters */
text-decoration: blink;
}

span.sgr-7 {
/* Reverse video Characters */
/* Not yet implemented */
}

/* Foreground colors */

span.sgr-30 {
/* Black */
color: #000;
}

span.sgr-31 {
/* Red */
color: #ea1010;
}

span.sgr-32 {
/* Green */
color: #090;
}

span.sgr-33 {
/* Yellow */
color: #990;
}

span.sgr-34 {
/* Blue */
color: #0073e6;
}

span.sgr-35 {
/* Magenta */
color: #d411d4;
}

span.sgr-36 {
/* Cyan */
color: #099;
}

span.sgr-37 {
/* White */
color: #ccc;
}

/* Bright foreground colors (= with bold) */

span.sgr-30.sgr-1 {
/* Black */
color: #373b41
}

span.sgr-31.sgr-1 {
/* Red */
color: #ff6161
}

span.sgr-32.sgr-1 {
/* Green */
color: #00d600;
}

span.sgr-33.sgr-1 {
/* Yellow */
color: #bdbd00
}

span.sgr-34.sgr-1 {
/* Blue */
color: #5797ff
}

span.sgr-35.sgr-1 {
/* Magenta */
color: #d96dd9
}

span.sgr-36.sgr-1 {
/* Cyan */
color: #00bdbd
}

span.sgr-37.sgr-1 {
/* White */
color: #fff
}

/* Background colors */

span.sgr-40 {
/* Black */
background-color: #000;
}

span.sgr-41 {
/* Red (Orange) */
background-color: #ea1010;
}

span.sgr-42 {
/* Green */
background-color: #090;
}

span.sgr-43 {
/* Yellow */
background-color: #990;
}

span.sgr-44 {
/* Blue */
background-color: #0073e6;
}

span.sgr-45 {
/* Magenta */
background-color: #d411d4;
}

span.sgr-46 {
/* Cyan */
background-color: #099;
}

span.sgr-47 {
/* White */
background-color: #ccc;
}
Binary file added dist/img/icon128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/img/icon32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/img/icon64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions dist/js/terminal-colors.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* jshint strict:global, browser:true */
'use strict';

var pre = document.getElementsByTagName("pre")[0];
var text = pre.innerHTML;
var html = text.replace(/\x1b\[0K|section_(start|end):\d+:[a-z_]+\n/g, '')
.replace(/\x1b\[(0;?)?m/g, '</span>')
.replace(/\x1b\[([0-9;]+)m/g, function (_1, code, _2, _3) {
return '</span><span class="sgr-' + code.replace(/;/g, ' sgr-') + '">';
});

if (text.length != html.length) {
pre.innerHTML = html;
}
19 changes: 19 additions & 0 deletions dist/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"manifest_version": 2,
"name": "Terminal Colors for GitLab CI",
"version": "1.0.0",
"description": "Provides terminal colors for GitLab CI raw build logs",
"icons": {
"32": "img/icon32.png",
"64": "img/icon64.png",
"128": "img/icon128.png"
},
"content_scripts": [{
"matches": [
"*://*/*/jobs/*/raw"
],
"run_at": "document_idle",
"css": ["css/terminal-colors.css"],
"js": ["js/terminal-colors.js"]
}]
}

0 comments on commit 34fe75d

Please sign in to comment.