jasmine-headless-webkit/vendor/assets/javascripts/intense.js

38 lines
756 B
JavaScript
Raw Normal View History

(function() {
var code, method, _ref;
window.Intense = {
colors: {
black: 0,
red: 1,
green: 2,
yellow: 3,
blue: 4,
magenta: 5,
cyan: 6,
white: 7
},
methods: {
foreground: function(color) {
if (Intense.useColors) {
return "\033[3" + Intense.colors[color] + "m" + this + "\033[0m";
} else {
return this;
}
},
bright: function() {
if (Intense.useColors) {
return "\033[1m" + this + "\033[0m";
} else {
return this;
}
}
},
useColors: true
};
_ref = Intense.methods;
for (method in _ref) {
code = _ref[method];
String.prototype[method] = code;
}
}).call(this);