start project
This commit is contained in:
1 parent
88f09b93d5
commit
c7373eb7c0
618 files changed
+281982
-1
No files matched your search
@@ -0,0 +1,194 @@
|
||||
JSCovFileReporter = Backbone.View.extend({
|
||||
initialize: function () {
|
||||
_.bindAll(this);
|
||||
this.open = '<tr class="{class}"><td class="line">{line_number}</td><td class="hits">{count}</td><td class="source">';
|
||||
this.close = '</td></tr>';
|
||||
|
||||
this.coverObject = this.options.coverObject;
|
||||
|
||||
this.error = 0;
|
||||
this.pass = 0;
|
||||
this.total = 0;
|
||||
},
|
||||
|
||||
// substitute credits: MooTools
|
||||
substitute: function(string, object){
|
||||
return string.replace(/\\?\{([^{}]+)\}/g, function(match, name){
|
||||
if (match.charAt(0) == '\\') return match.slice(1);
|
||||
return (object[name] !== null) ? object[name] : '';
|
||||
});
|
||||
},
|
||||
|
||||
generateClose: function(count){
|
||||
return this.substitute(this.close, {
|
||||
count: count
|
||||
});
|
||||
},
|
||||
|
||||
generateOpen: function(hit_count, line_number){
|
||||
return this.substitute(this.open, {
|
||||
'count': hit_count,
|
||||
'line_number': line_number,
|
||||
'class': hit_count ? 'hit' : 'miss'
|
||||
});
|
||||
},
|
||||
|
||||
report: function () {
|
||||
var thisview = this;
|
||||
var i, l, k;
|
||||
|
||||
var code = this.coverObject.__code;
|
||||
|
||||
// generate array of all tokens
|
||||
var codez = [];
|
||||
for (i = 0, l = code.length; i < l; i++){
|
||||
codez.push({
|
||||
pos: i,
|
||||
value: code.slice(i, i + 1)
|
||||
});
|
||||
}
|
||||
|
||||
// CoverObject has keys like "12:200" which means from char 12 to 200
|
||||
// This orders all first gaps in a list of dictionaries to ease drawing table lines
|
||||
var gaps = Object.keys(this.coverObject);
|
||||
gaps = _.without(gaps, '__code');
|
||||
var first_gaps = _.map(gaps, function ( gap ) {
|
||||
return {
|
||||
gap: parseInt(gap.split(':')[0], 10),
|
||||
hit_count: thisview.coverObject[gap]
|
||||
};
|
||||
}).sort(function (a, b) {
|
||||
if (a['gap'] > b['gap']) return 1;
|
||||
if (b['gap'] > a['gap']) return -1;
|
||||
return 0;
|
||||
});
|
||||
|
||||
var second_gaps = _.map(gaps, function ( gap ) {
|
||||
return {
|
||||
gap: parseInt(gap.split(':')[1], 10),
|
||||
hit_count: thisview.coverObject[gap]
|
||||
};
|
||||
}).sort(function (a, b) {
|
||||
if (a['gap'] > b['gap']) return 1;
|
||||
if (b['gap'] > a['gap']) return -1;
|
||||
return 0;
|
||||
});
|
||||
|
||||
|
||||
// If it doesn't start from 0 it's because there are comments in the beginning
|
||||
// We add a initial gap with one hit
|
||||
if (first_gaps[0] !== 0) {
|
||||
first_gaps.splice(0, 0, {gap: 0, hit_count: 1});
|
||||
}
|
||||
|
||||
var result = '';
|
||||
var number_trailing_whitespaces = 0;
|
||||
var trailing_whitespaces = '';
|
||||
|
||||
|
||||
// We will go from one gap to the next wrapping them in table lines
|
||||
for (i=0, l = first_gaps.length; i < l; i++){
|
||||
|
||||
var hit_count = first_gaps[i]['hit_count'];
|
||||
|
||||
this.total++;
|
||||
if (hit_count) this.pass++;
|
||||
else this.error++;
|
||||
|
||||
var limit = null;
|
||||
if (i+1 >= l) {
|
||||
limit = codez.length;
|
||||
}
|
||||
else {
|
||||
limit = first_gaps[i+1]['gap'];
|
||||
}
|
||||
|
||||
// Table line opening
|
||||
result += this.generateOpen(hit_count, this.total);
|
||||
|
||||
// Add trailing white space if it existed from previous line without carriage returns
|
||||
if (number_trailing_whitespaces > 0 ) {
|
||||
result += trailing_whitespaces.replace(/(\r\n|\n|\r)/gm,"");
|
||||
}
|
||||
|
||||
// Add lines of code without initial white spaces, and replacing conflictive chars
|
||||
result += _.map(codez.slice(first_gaps[i]['gap'], limit), function (loc) {
|
||||
return loc['value'];
|
||||
}).join('').trimLeft().replace(/</g, '<').replace(/>/g, '>');
|
||||
|
||||
// Count trailing white spaces for future line, then remove them
|
||||
var matches = result.match(/(\s+)$/);
|
||||
result = result.trimRight();
|
||||
|
||||
if (matches !== null) {
|
||||
number_trailing_whitespaces = matches[0].length;
|
||||
trailing_whitespaces = matches[0];
|
||||
}
|
||||
else {
|
||||
number_trailing_whitespaces = 0;
|
||||
}
|
||||
|
||||
// Generate table line closing
|
||||
result += this.generateClose(hit_count);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
JSCovReporter = Backbone.View.extend({
|
||||
initialize: function () {
|
||||
this.coverObject = this.options.coverObject;
|
||||
|
||||
// Generate the report
|
||||
this.report();
|
||||
|
||||
// Activate reporter.js scrolling UX
|
||||
onload();
|
||||
},
|
||||
|
||||
report: function () {
|
||||
var result = '';
|
||||
var index = '';
|
||||
|
||||
for (var file in this.coverObject) {
|
||||
var fileReporter = new JSCovFileReporter({ coverObject: this.coverObject[file] });
|
||||
|
||||
var fileReport = fileReporter.report();
|
||||
var percentage = Math.round(fileReporter.pass / fileReporter.total * 100);
|
||||
|
||||
this.error += fileReporter.error;
|
||||
this.pass += fileReporter.pass;
|
||||
this.total += fileReporter.total;
|
||||
|
||||
var type_coverage = "high";
|
||||
if (percentage < 75 && percentage >= 50) {
|
||||
type_coverage = 'medium';
|
||||
}
|
||||
else if (percentage < 50 && percentage >= 25) {
|
||||
type_coverage = 'low';
|
||||
}
|
||||
else if (percentage < 25) {
|
||||
type_coverage = 'terrible';
|
||||
}
|
||||
|
||||
// Title
|
||||
result += '<h2 id="' + file + '" class="file-title">' + file + '</h2>';
|
||||
// Stats
|
||||
result += '<div class="stats ' + type_coverage + '"><div class="percentage">'+ percentage + '%</div>';
|
||||
result += '<div class="sloc">' + fileReporter.total + '</div><div class="hits">' + fileReporter.pass + '</div>';
|
||||
result += '<div class="misses">' + fileReporter.error + '</div></div>';
|
||||
// Report
|
||||
result += '<div class="file-report">';
|
||||
result += '<table id="source"><tbody>' + fileReport + '</tbody></table>';
|
||||
result += '</div>';
|
||||
|
||||
// Menu index
|
||||
index += '<li><span class="cov ' + type_coverage + '">' + percentage + '</span><a href="#' + file+ '">' + file + '</a></li>';
|
||||
}
|
||||
|
||||
$('#coverage').html(result);
|
||||
$('#menu').html('<ul id="toc">' + index + '</ul>');
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,4 @@
|
||||
(function(){var t=this;var e=t.Backbone;var i=[];var r=i.push;var s=i.slice;var n=i.splice;var a;if(typeof exports!=="undefined"){a=exports}else{a=t.Backbone={}}a.VERSION="1.0.0";var h=t._;if(!h&&typeof require!=="undefined")h=require("underscore");a.$=t.jQuery||t.Zepto||t.ender||t.$;a.noConflict=function(){t.Backbone=e;return this};a.emulateHTTP=false;a.emulateJSON=false;var o=a.Events={on:function(t,e,i){if(!l(this,"on",t,[e,i])||!e)return this;this._events||(this._events={});var r=this._events[t]||(this._events[t]=[]);r.push({callback:e,context:i,ctx:i||this});return this},once:function(t,e,i){if(!l(this,"once",t,[e,i])||!e)return this;var r=this;var s=h.once(function(){r.off(t,s);e.apply(this,arguments)});s._callback=e;return this.on(t,s,i)},off:function(t,e,i){var r,s,n,a,o,u,c,f;if(!this._events||!l(this,"off",t,[e,i]))return this;if(!t&&!e&&!i){this._events={};return this}a=t?[t]:h.keys(this._events);for(o=0,u=a.length;o<u;o++){t=a[o];if(n=this._events[t]){this._events[t]=r=[];if(e||i){for(c=0,f=n.length;c<f;c++){s=n[c];if(e&&e!==s.callback&&e!==s.callback._callback||i&&i!==s.context){r.push(s)}}}if(!r.length)delete this._events[t]}}return this},trigger:function(t){if(!this._events)return this;var e=s.call(arguments,1);if(!l(this,"trigger",t,e))return this;var i=this._events[t];var r=this._events.all;if(i)c(i,e);if(r)c(r,arguments);return this},stopListening:function(t,e,i){var r=this._listeners;if(!r)return this;var s=!e&&!i;if(typeof e==="object")i=this;if(t)(r={})[t._listenerId]=t;for(var n in r){r[n].off(e,i,this);if(s)delete this._listeners[n]}return this}};var u=/\s+/;var l=function(t,e,i,r){if(!i)return true;if(typeof i==="object"){for(var s in i){t[e].apply(t,[s,i[s]].concat(r))}return false}if(u.test(i)){var n=i.split(u);for(var a=0,h=n.length;a<h;a++){t[e].apply(t,[n[a]].concat(r))}return false}return true};var c=function(t,e){var i,r=-1,s=t.length,n=e[0],a=e[1],h=e[2];switch(e.length){case 0:while(++r<s)(i=t[r]).callback.call(i.ctx);return;case 1:while(++r<s)(i=t[r]).callback.call(i.ctx,n);return;case 2:while(++r<s)(i=t[r]).callback.call(i.ctx,n,a);return;case 3:while(++r<s)(i=t[r]).callback.call(i.ctx,n,a,h);return;default:while(++r<s)(i=t[r]).callback.apply(i.ctx,e)}};var f={listenTo:"on",listenToOnce:"once"};h.each(f,function(t,e){o[e]=function(e,i,r){var s=this._listeners||(this._listeners={});var n=e._listenerId||(e._listenerId=h.uniqueId("l"));s[n]=e;if(typeof i==="object")r=this;e[t](i,r,this);return this}});o.bind=o.on;o.unbind=o.off;h.extend(a,o);var d=a.Model=function(t,e){var i;var r=t||{};e||(e={});this.cid=h.uniqueId("c");this.attributes={};h.extend(this,h.pick(e,p));if(e.parse)r=this.parse(r,e)||{};if(i=h.result(this,"defaults")){r=h.defaults({},r,i)}this.set(r,e);this.changed={};this.initialize.apply(this,arguments)};var p=["url","urlRoot","collection"];h.extend(d.prototype,o,{changed:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(t){return h.clone(this.attributes)},sync:function(){return a.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return h.escape(this.get(t))},has:function(t){return this.get(t)!=null},set:function(t,e,i){var r,s,n,a,o,u,l,c;if(t==null)return this;if(typeof t==="object"){s=t;i=e}else{(s={})[t]=e}i||(i={});if(!this._validate(s,i))return false;n=i.unset;o=i.silent;a=[];u=this._changing;this._changing=true;if(!u){this._previousAttributes=h.clone(this.attributes);this.changed={}}c=this.attributes,l=this._previousAttributes;if(this.idAttribute in s)this.id=s[this.idAttribute];for(r in s){e=s[r];if(!h.isEqual(c[r],e))a.push(r);if(!h.isEqual(l[r],e)){this.changed[r]=e}else{delete this.changed[r]}n?delete c[r]:c[r]=e}if(!o){if(a.length)this._pending=true;for(var f=0,d=a.length;f<d;f++){this.trigger("change:"+a[f],this,c[a[f]],i)}}if(u)return this;if(!o){while(this._pending){this._pending=false;this.trigger("change",this,i)}}this._pending=false;this._changing=false;return this},unset:function(t,e){return this.set(t,void 0,h.extend({},e,{unset:true}))},clear:function(t){var e={};for(var i in this.attributes)e[i]=void 0;return this.set(e,h.extend({},t,{unset:true}))},hasChanged:function(t){if(t==null)return!h.isEmpty(this.changed);return h.has(this.changed,t)},changedAttributes:function(t){if(!t)return this.hasChanged()?h.clone(this.changed):false;var e,i=false;var r=this._changing?this._previousAttributes:this.attributes;for(var s in t){if(h.isEqual(r[s],e=t[s]))continue;(i||(i={}))[s]=e}return i},previous:function(t){if(t==null||!this._previousAttributes)return null;return this._previousAttributes[t]},previousAttributes:function(){return h.clone(this._previousAttributes)},fetch:function(t){t=t?h.clone(t):{};if(t.parse===void 0)t.parse=true;var e=this;var i=t.success;t.success=function(r){if(!e.set(e.parse(r,t),t))return false;if(i)i(e,r,t);e.trigger("sync",e,r,t)};R(this,t);return this.sync("read",this,t)},save:function(t,e,i){var r,s,n,a=this.attributes;if(t==null||typeof t==="objecLine truncated
|
||||
/*
|
||||
//@ sourceMappingURL=backbone-min.map
|
||||
*/
|
||||
@@ -0,0 +1,310 @@
|
||||
body {
|
||||
font: 14px/1.6 "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
margin: 0;
|
||||
color: #2C2C2C;
|
||||
border-top: 2px solid #ddd;
|
||||
}
|
||||
|
||||
#coverage {
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
h1 a {
|
||||
color: inherit;
|
||||
font-weight: inherit;
|
||||
}
|
||||
|
||||
h1 a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.onload h1 {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
#menu h2 {
|
||||
width: 80%;
|
||||
margin-top: 80px;
|
||||
margin-bottom: 0;
|
||||
font-weight: 100;
|
||||
letter-spacing: 1px;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #8A6343;
|
||||
font-weight: bold;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#menu a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
code {
|
||||
font: 12px monaco, monospace;
|
||||
}
|
||||
|
||||
pre {
|
||||
margin: 30px;
|
||||
padding: 30px;
|
||||
border: 1px solid #eee;
|
||||
border-bottom-color: #ddd;
|
||||
-webkit-border-radius: 2px;
|
||||
-moz-border-radius: 2px;
|
||||
-webkit-box-shadow: inset 0 0 10px #eee;
|
||||
-moz-box-shadow: inset 0 0 10px #eee;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
img {
|
||||
margin: 30px;
|
||||
padding: 1px;
|
||||
-webkit-border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-box-shadow: 0 3px 10px #dedede, 0 1px 5px #888;
|
||||
-moz-box-shadow: 0 3px 10px #dedede, 0 1px 5px #888;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
footer {
|
||||
background: #eee;
|
||||
width: 100%;
|
||||
padding: 50px 0;
|
||||
text-align: right;
|
||||
border-top: 1px solid #ddd;
|
||||
}
|
||||
|
||||
footer span {
|
||||
display: block;
|
||||
margin-right: 30px;
|
||||
color: #888;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
#menu {
|
||||
position: fixed;
|
||||
overflow: auto;
|
||||
top: 0;
|
||||
right: 0;
|
||||
margin: 0;
|
||||
height: 100%;
|
||||
padding: 15px 0 15px 0;
|
||||
min-width: 285px;
|
||||
border-left: 1px solid #eee;
|
||||
|
||||
text-align: right;
|
||||
font-size: 12px;
|
||||
|
||||
-moz-box-shadow: 0 0 2px #888
|
||||
, inset 5px 0 20px rgba(0,0,0,.5)
|
||||
, inset 5px 0 3px rgba(0,0,0,.3);
|
||||
-webkit-box-shadow: 0 0 2px #888
|
||||
, inset 5px 0 20px rgba(0,0,0,.5)
|
||||
, inset 5px 0 3px rgba(0,0,0,.3);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGYAAABmCAMAAAAOARRQAAABelBMVEUjJSU6OzshIyM5OjoqKy02NjgsLS01NTYjJCUzNTUgISMlJSc0NTUvMDA6PDwlJyg1NjYoKis2NjYrLS02ODkpKyw0NDYrLC04ODovLzA4Ojo0NDUtLy86OjwjIyU4OTosLS82ODgtLS8hIyQvMTEnKCooKSsrKy0qLCwkJSUnKCkrLCwpKiwwMjIxMzMqLC0tLS0pKissLC00NTYwMDIwMTQpKysoKSovMDEtLzA2OTkxMzUrKywvLy8qKyszNTY5OzsqKiw6OjswMDExNDUoKiozNDUvMDIyNDY1Njg2Njk5OTozMzU0NjY4ODkiIyUiIyQ4OTkuMDEmKCowMjQwMTErLS4qKywwMTMhIiMpKiopKy0tLjAkJScxNDQvLzExNDYyNDQmKCk5OTslJig5OjskJSYxMzQrLS8gISIwMTIoKCk1NTUlJSUnJygwMDA4ODgiIiMhISI8PDw6Ojo5OTkpKSojIyQ7OzsyMjIpKSssLCw6Ozw1NjlrfLakAAAg2UlEQVR42jR6i3ea6rYvPgANIAhVXh8WvkQlioUiFlFcBtAmoiRNdzxqu9p0J7vrdK29zuPeex77nnvO/35n1r1ndHRktI0jTOacv/l7lCBK5UqVpOha/YxmWK7BC4TQFKVXrbYsnimqxuuMVlOQ0XltWjUdCwRJ1M+tC1KudOs9q6+da2adUewG0SC0SwELfHtgDds93VEuydEbl3QMWeNoYkR7b/0x1ZRobGI3mLwzAhePqTAwhg6aogjNsGy7/jwQ4rkdqe7CWLxF8k9LfMVFyRS7VJqtkrW8Vt/bkR8FZJao16ipknbC3Yw2lM7laO6HBEOadEZ2tpf65c4v8e3u7FyU6qbiNNyCuzXZ6pawgnwgmrpTT/Q7w2EZmiIJ0dzWDI7mhQ80IfRnMu2kzA5r5r1pIFoia+/d93HRYp1GV8TbrkWoU/+jdI0Ff6yGwTjT1Hn8J+8m1r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blrWuE2K9WEO/hcRp5e9oOF/QBmOaDtgil+oaU6szPrdwW65fOB0KUTsVUn7LFU7J8e6cxJIl9+FHw5MQMzuQJ+4oxMH3iW/5GK+hWuG0T+gTLs+fAjdtUd58TmIUq04EeyRCYCjkldow234aIgR5bqwrtZosZ+6YEqAmDqatJ9lWasz4IquKALPtd92hGI3Z2BdzzZue+REl1Om4DIWD+RrtUTOJLI+S0jHowXXdAxsGLSd40zYNuEUlOGhrwL6c7tcOtUOvpJCP7QBQS19H+GvZn05ewjlVLz+IGKoC9TyfQjLMBNmXCuqqtTdOSukZW48B0HqgSTCBrBnlFvF4CG2Su7yFzqmJFURK3UmTT3ru050r0ptUpMilYnBJWfl2Bv6kPlUuE1kxxpdzui9AubsR2N2boVSu81OulAwBqoSr1LZ0LLYOomyZHmjqnXlP72s8LnDouEJjtodBvdHaG1jMySYO7crWd90MpCRyCG14vb5IE7Arupw/y/RcCm/Tm3zK6zYj8PYNaGldiUfkB/LHWcmf2lVM+mwyU27a0qq2tscrQ/vzBjN26DnntIrOyGizzXK35yKQdYnUABkyN4saz3WD/viF+eCcsXnIajdWYJWaYHRstIis9CS+tqnFGmz2j5uzfr3Z4prqgK4XOT/PyftvjZqIm8lhkfxJ7Ol3CJF1piYBGAG8wtAkLine truncated
|
||||
}
|
||||
|
||||
#menu ul {
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
#logo {
|
||||
position: fixed;
|
||||
bottom: 10px;
|
||||
right: 10px;
|
||||
background: rgba(255,255,255,.1);
|
||||
font-size: 11px;
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
text-align: center;
|
||||
-webkit-border-radius: 20px;
|
||||
-moz-border-radius: 20px;
|
||||
-webkit-box-shadow: 0 0 3px rgba(0,0,0,.2);
|
||||
-moz-box-shadow: 0 0 3px rgba(0,0,0,.2);
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
#menu li a {
|
||||
display: block;
|
||||
color: white;
|
||||
padding: 0 35px 0 25px;
|
||||
-webkit-transition: background 300ms;
|
||||
-moz-transition: background 300ms;
|
||||
}
|
||||
|
||||
#menu li {
|
||||
position: relative;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
#menu a:hover,
|
||||
#menu a.active {
|
||||
text-decoration: none;
|
||||
background: rgba(255,255,255,.1);
|
||||
}
|
||||
|
||||
#menu li:hover .cov {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
#menu li .dirname {
|
||||
opacity: .60;
|
||||
padding-right: 2px;
|
||||
}
|
||||
|
||||
#menu li .basename {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
#menu .cov {
|
||||
background: rgba(0,0,0,.4);
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 8px;
|
||||
font-size: 9px;
|
||||
opacity: .6;
|
||||
text-align: left;
|
||||
width: 17px;
|
||||
-webkit-border-radius: 10px;
|
||||
-moz-border-radius: 10px;
|
||||
padding: 2px 3px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.stats {
|
||||
display: inline-block;
|
||||
margin-top: 15px;
|
||||
border: 1px solid #eee;
|
||||
padding: 10px;
|
||||
-webkit-box-shadow: inset 0 0 2px #eee;
|
||||
-moz-box-shadow: inset 0 0 2px #eee;
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
}
|
||||
|
||||
.stats div {
|
||||
float: left;
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
.stats::after {
|
||||
display: block;
|
||||
content: '';
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.stats .sloc::after {
|
||||
content: ' SLOC';
|
||||
color: #b6b6b6;
|
||||
}
|
||||
|
||||
.stats .percentage::after {
|
||||
content: ' coverage';
|
||||
color: #b6b6b6;
|
||||
}
|
||||
|
||||
.stats .hits,
|
||||
.stats .misses {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.high {
|
||||
color: #00d4b4;
|
||||
}
|
||||
.medium {
|
||||
color: #e87d0d;
|
||||
}
|
||||
.low {
|
||||
color: #d4081a;
|
||||
}
|
||||
.terrible {
|
||||
color: #d4081a;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table {
|
||||
width: 80%;
|
||||
margin-top: 10px;
|
||||
border-collapse: collapse;
|
||||
border: 1px solid #cbcbcb;
|
||||
color: #363636;
|
||||
-webkit-border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
}
|
||||
|
||||
table thead {
|
||||
display: none;
|
||||
}
|
||||
|
||||
table td.line,
|
||||
table td.hits {
|
||||
width: 20px;
|
||||
background: #eaeaea;
|
||||
text-align: center;
|
||||
font-size: 11px;
|
||||
padding: 0 10px;
|
||||
color: #949494;
|
||||
}
|
||||
|
||||
table td.hits {
|
||||
width: 10px;
|
||||
padding: 2px 5px;
|
||||
color: rgba(0,0,0,.2);
|
||||
background: #f0f0f0;
|
||||
}
|
||||
|
||||
tr.miss td.line,
|
||||
tr.miss td.hits {
|
||||
background: #e6c3c7;
|
||||
}
|
||||
|
||||
tr.miss td {
|
||||
background: #f8d5d8;
|
||||
}
|
||||
|
||||
td.source {
|
||||
padding-left: 15px;
|
||||
line-height: 15px;
|
||||
white-space: pre;
|
||||
font: 12px monaco, monospace;
|
||||
}
|
||||
|
||||
code .comment { color: #ddd }
|
||||
code .init { color: #2F6FAD }
|
||||
code .string { color: #5890AD }
|
||||
code .keyword { color: #8A6343 }
|
||||
code .number { color: #2F6FAD }
|
||||
|
||||
|
||||
#stats {
|
||||
z-index: 1;
|
||||
color: #BBB;
|
||||
}
|
||||
#stats em {
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.file-title {
|
||||
width: 80%;
|
||||
margin-bottom: 0;
|
||||
font-weight: 100;
|
||||
letter-spacing: 1px;
|
||||
border-bottom: 1px solid #EEE;
|
||||
cursor: pointer;
|
||||
padding-left: 15px;
|
||||
}
|
||||
.file-title:hover {
|
||||
color: #444;
|
||||
text-shadow: 1px 1px 1px #CCC;
|
||||
}
|
||||
|
||||
.error { background: #F8D5D8 }
|
||||
.count { font-weight: bold; border-radius: 3px }
|
||||
.pass .count { background: #BFFFBF;}
|
||||
.error .count { background: #F8D5D8; color: red}
|
||||
#coverage { font-size: 12px; }
|
||||
@@ -0,0 +1,31 @@
|
||||
headings = [];
|
||||
|
||||
onload = function(){
|
||||
headings = document.querySelectorAll('h2');
|
||||
};
|
||||
|
||||
onscroll = function(e){
|
||||
var heading = find(window.scrollY);
|
||||
if (!heading) return;
|
||||
var links = document.querySelectorAll('#menu a')
|
||||
, link;
|
||||
|
||||
for (var i = 0, len = links.length; i < len; ++i) {
|
||||
link = links[i];
|
||||
link.className = link.getAttribute('href') == '#' + heading.id
|
||||
? 'active'
|
||||
: '';
|
||||
}
|
||||
};
|
||||
|
||||
function find(y) {
|
||||
var i = headings.length
|
||||
, heading;
|
||||
|
||||
while (i--) {
|
||||
heading = headings[i];
|
||||
if (y > heading.offsetTop) {
|
||||
return heading;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
(function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,h=e.reduce,v=e.reduceRight,d=e.filter,g=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,_=Object.keys,j=i.bind,w=function(n){return n instanceof w?n:this instanceof w?(this._wrapped=n,void 0):new w(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=w),exports._=w):n._=w,w.VERSION="1.4.4";var A=w.each=w.forEach=function(n,t,e){if(null!=n)if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a in n)if(w.has(n,a)&&t.call(e,n[a],a,n)===r)return};w.map=w.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e[e.length]=t.call(r,n,u,i)}),e)};var O="Reduce of empty array with no initial value";w.reduce=w.foldl=w.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=w.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(O);return r},w.reduceRight=w.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=w.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=w.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(O);return r},w.find=w.detect=function(n,t,r){var e;return E(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},w.filter=w.select=function(n,t,r){var e=[];return null==n?e:d&&n.filter===d?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&(e[e.length]=n)}),e)},w.reject=function(n,t,r){return w.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},w.every=w.all=function(n,t,e){t||(t=w.identity);var u=!0;return null==n?u:g&&n.every===g?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var E=w.some=w.any=function(n,t,e){t||(t=w.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};w.contains=w.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:E(n,function(n){return n===t})},w.invoke=function(n,t){var r=o.call(arguments,2),e=w.isFunction(t);return w.map(n,function(n){return(e?t:n[t]).apply(n,r)})},w.pluck=function(n,t){return w.map(n,function(n){return n[t]})},w.where=function(n,t,r){return w.isEmpty(t)?r?null:[]:w[r?"find":"filter"](n,function(n){for(var r in t)if(t[r]!==n[r])return!1;return!0})},w.findWhere=function(n,t){return w.where(n,t,!0)},w.max=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.max.apply(Math,n);if(!t&&w.isEmpty(n))return-1/0;var e={computed:-1/0,value:-1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a>=e.computed&&(e={value:n,computed:a})}),e.value},w.min=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.min.apply(Math,n);if(!t&&w.isEmpty(n))return 1/0;var e={computed:1/0,value:1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;e.computed>a&&(e={value:n,computed:a})}),e.value},w.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=w.random(r++),e[r-1]=e[t],e[t]=n}),e};var k=function(n){return w.isFunction(n)?n:function(t){return t[n]}};w.sortBy=function(n,t,r){var e=k(t);return w.pluck(w.map(n,function(n,t,u){return{value:n,index:t,criteria:e.call(r,n,t,u)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index<t.index?-1:1}),"value")};var F=function(n,t,r,e){var u={},i=k(t||w.identity);return A(n,function(t,a){var o=i.call(r,t,a,n);e(u,o,t)}),u};w.groupBy=function(n,t,r){return F(n,t,r,function(n,t,r){(w.has(n,t)?n[t]:n[t]=[]).push(r)})},w.countBy=function(n,t,r){return F(n,t,r,function(n,t){w.has(n,t)||(n[t]=0),n[t]++})},w.sortedIndex=function(n,t,r,e){r=null==r?w.identity:k(r);for(var u=r.call(e,t),i=0,a=n.length;a>i;){var o=i+a>>>1;u>r.call(e,n[o])?i=o+1:a=o}return i},w.toArray=function(n){return n?w.isArray(n)?o.call(n):n.length===+n.length?w.map(n,w.identity):w.values(n):[]},w.size=function(n){return null==n?0:n.length===+n.length?n.length:w.keys(n).length},w.first=w.head=w.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:o.call(n,0,t)},w.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},w.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},w.rest=w.tail=w.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},w.compact=function(n){return w.filter(n,w.identity)};var R=function(n,t,r){return A(n,function(n){w.isArray(n)?t?a.apply(r,n):R(n,t,r):r.push(n)}),r};w.flatten=function(n,t){return R(n,t,[])},w.without=function(n){return w.difference(n,o.call(arguments,1))},w.uniq=w.unique=function(n,t,r,e){w.isFuncLine truncated
|
||||
Reference in new issue
Block a user