提交 f982dfae 编写于 作者: D duaraghav8@gmail

Merge remote-tracking branch 'upstream/gh-pages' into gh-pages

......@@ -65,7 +65,7 @@ button:not([disabled]):hover {
.btn.active,
button.active {
background: rgba(0, 0, 0, .28);
background: rgb(38, 38, 38);
}
.btn input,
......@@ -138,7 +138,7 @@ nav h3 {
}
.sidemenu #footer {
border-top: 2px solid rgba(0, 0, 0, .28);
border-top: 2px solid rgb(38, 38, 38);
}
.sidemenu button {
......@@ -181,7 +181,7 @@ section,
nav,
section {
border: 1px solid rgba(0, 0, 0, .28);
border: 1px solid rgb(38, 38, 38);
box-sizing: border-box;
}
......@@ -227,7 +227,7 @@ section {
z-index: 5;
padding: 4px;
font-size: 14px;
background: rgba(0, 0, 0, .28);
background: rgba(0, 0, 0, .4);
}
.module_wrapper > .wrapper {
......@@ -299,10 +299,11 @@ section {
}
.explanation_container {
border: none;
top: 30px;
height: 30px;
background: rgba(0, 0, 0, .28);
padding: 7px;
background: rgb(38, 38, 38);
padding: 8px;
font-size: 12px;
}
......
......@@ -100,7 +100,7 @@ Array2DTracer.prototype = $.extend(true, Object.create(Tracer.prototype), {
case 'notify':
if (step.v) {
var $row = this.$table.find('.mtbl-row').eq(step.x);
$row.find('.mtbl-cell').eq(step.y).text(TracerUtil.refineNumber(step.v));
$row.find('.mtbl-cell').eq(step.y).text(TracerUtil.refineByType(step.v));
}
case 'denotify':
case 'select':
......@@ -130,7 +130,7 @@ Array2DTracer.prototype = $.extend(true, Object.create(Tracer.prototype), {
if (Tracer.prototype.setData.apply(this, arguments)) {
this.$table.find('.mtbl-row').each(function (i) {
$(this).children().each(function (j) {
$(this).text(TracerUtil.refineNumber(D[i][j]));
$(this).text(TracerUtil.refineByType(D[i][j]));
});
});
return true;
......@@ -143,7 +143,7 @@ Array2DTracer.prototype = $.extend(true, Object.create(Tracer.prototype), {
for (var j = 0; j < D[i].length; j++) {
var $cell = $('<div class="mtbl-cell">')
.css(this.getCellCss())
.text(TracerUtil.refineNumber(D[i][j]));
.text(TracerUtil.refineByType(D[i][j]));
$row.append($cell);
}
}
......
......@@ -45,7 +45,7 @@ WeightedDirectedGraphTracer.prototype = $.extend(true, Object.create(DirectedGra
switch (step.type) {
case 'weight':
var targetNode = this.graph.nodes(this.n(step.target));
if (step.weight !== undefined) targetNode.weight = TracerUtil.refineNumber(step.weight);
if (step.weight !== undefined) targetNode.weight = TracerUtil.refineByType(step.weight);
break;
case 'visit':
case 'leave':
......@@ -53,7 +53,7 @@ WeightedDirectedGraphTracer.prototype = $.extend(true, Object.create(DirectedGra
var targetNode = this.graph.nodes(this.n(step.target));
var color = visit ? this.color.visited : this.color.left;
targetNode.color = color;
if (step.weight !== undefined) targetNode.weight = TracerUtil.refineNumber(step.weight);
if (step.weight !== undefined) targetNode.weight = TracerUtil.refineByType(step.weight);
if (step.source !== undefined) {
var edgeId = this.e(step.source, step.target);
var edge = this.graph.edges(edgeId);
......@@ -97,7 +97,7 @@ WeightedDirectedGraphTracer.prototype = $.extend(true, Object.create(DirectedGra
target: this.n(j),
color: this.color.default,
size: 1,
weight: TracerUtil.refineNumber(G[i][j])
weight: TracerUtil.refineByType(G[i][j])
});
}
}
......
......@@ -189,6 +189,12 @@ var TracerUtil = {
return value === "Infinity" ? Infinity : value;
});
},
refineByType: function (item) {
return $.isNumeric(item) ? this.refineNumber(item) : this.refineString(item);
},
refineString: function (string) {
return string === '' ? ' ' : string;
},
refineNumber: function (number) {
return number === Infinity ? '' : number;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册