Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Lint some files

  • Loading branch information...
commit d0418b8cd67c64d434866fff7f99c820adbb3e4a 1 parent 4b0f740
@spicyj spicyj authored
View
10 lint_blacklist.txt
@@ -15,6 +15,7 @@ jquery-ui.js
jquery.js
jquery.qtip.js
utils/d3.js
+utils/jquery.mobile.vmouse.js
utils/MathJax/
utils/raphael.js
utils/underscore.js
@@ -26,16 +27,7 @@ test/exercises/
build/kathjax-config.js
khan-exercise.js
test/exercise-runner.js
-utils/answer-types.js
-utils/congruency.js
-utils/derivative-intuition.js
-utils/exponents.js
-utils/expressions.js
-utils/graphie-helpers-arithmetic.js
-utils/graphie-helpers.js
-utils/graphie.js
utils/interactive.js
-utils/jquery.mobile.vmouse.js
utils/math-format.js
utils/mean-and-median.js
utils/polynomials.js
View
4 utils/answer-types.js
@@ -913,8 +913,8 @@ $.extend(Khan.answerTypes, {
var choices = $.tmpl.getVAR($(solution).data("choices"));
$.each(choices, function(index, value) {
- input.append('<option value="' + value + '">'
- + value + "</option>");
+ input.append('<option value="' + value + '">' + value +
+ "</option>");
});
var correct = $(solution).text();
View
10 utils/congruency.js
@@ -91,9 +91,9 @@ $.extend(KhanUtil, {
ang.coord = [0, 0];
- ang.coord[0] = (ang.line1.slope * ang.line1.start[0]
- - ang.line2.slope * ang.line2.start[0]
- + ang.line2.start[1] - ang.line1.start[1]) /
+ ang.coord[0] = (ang.line1.slope * ang.line1.start[0] -
+ ang.line2.slope * ang.line2.start[0] +
+ ang.line2.start[1] - ang.line1.start[1]) /
(ang.line1.slope - ang.line2.slope);
ang.coord[1] = ang.line1.func(ang.coord[0]);
@@ -136,8 +136,8 @@ $.extend(KhanUtil, {
$(arc.point.mouseTarget[0]).css("cursor", "pointer");
// Increase the point's size
- var pointRadius = Math.sin(KhanUtil.toRadians(arc.angle) / 2)
- * arc.radius * graph.scale[0];
+ var pointRadius = Math.sin(KhanUtil.toRadians(arc.angle) / 2) *
+ arc.radius * graph.scale[0];
arc.point.mouseTarget.attr({ r: pointRadius });
// replace the shape with our arc
View
5 utils/derivative-intuition.js
@@ -209,7 +209,8 @@ $.extend(KhanUtil, {
if (event.type === "vmousemove") {
$($("div#solutionarea :text")[index]).val(KhanUtil.roundTo(2, coordY));
$($("div#solutionarea .answer-label")[index]).text(KhanUtil.roundTo(2, coordY));
- graph.tangentLines[index].transform("R"+(-Math.atan(coordY * (graph.scale[1] / graph.scale[0])) * (180 / Math.PI)));
+ graph.tangentLines[index].transform(
+ "R" + (-Math.atan(coordY * (graph.scale[1] / graph.scale[0])) * (180 / Math.PI)));
graph.slopePoints[index].attr("cy", mouseY);
graph.mouseTargets[index].attr("cy", mouseY);
@@ -258,7 +259,7 @@ $.extend(KhanUtil, {
$($("div#solutionarea :text")[index]).val(KhanUtil.roundTo(2, coordY));
$($("div#solutionarea .answer-label")[index]).text(KhanUtil.roundTo(2, coordY));
- graph.tangentLines[index].transform("R"+(-Math.atan(coordY * (graph.scale[1] / graph.scale[0])) * (180 / Math.PI)));
+ graph.tangentLines[index].transform("R" + (-Math.atan(coordY * (graph.scale[1] / graph.scale[0])) * (180 / Math.PI)));
graph.slopePoints[index].attr("cy", (graph.range[1][1] - coordY) * graph.scale[1]);
graph.mouseTargets[index].attr("cy", (graph.range[1][1] - coordY) * graph.scale[1]);
},
View
4 utils/exponents.js
@@ -68,8 +68,8 @@ $.extend(KhanUtil, {
steps.unshift(
(i === exp - 1 ? parens : noParens)
- .call(this, mult_n, mult_d)
- + expansion);
+ .call(this, mult_n, mult_d) +
+ expansion);
expansion += "\\cdot " + base_str;
}
View
4 utils/expressions.js
@@ -189,8 +189,8 @@ $.extend(KhanUtil, {
if (arguments.length > 1) {
var args = [].slice.call(arguments, 0);
- var parenthesizeRest = KhanUtil.exprType(arguments[0]) === "number"
- && KhanUtil.exprType(arguments[1]) === "number";
+ var parenthesizeRest = KhanUtil.exprType(arguments[0]) === "number" &&
+ KhanUtil.exprType(arguments[1]) === "number";
var factors = $.map(args, function(factor, i) {
var parenthesize;
switch (KhanUtil.exprType(factor)) {
View
82 utils/graphie-helpers-arithmetic.js
@@ -69,14 +69,14 @@ function Adder(a, b, digitsA, digitsB) {
carryStr = "\\color{#FFA500}{" + carry + "}";
}
- this.showSideLabel("\\Large{"
- + prevCarryStr
- + "\\color{#6495ED}{" + digitsA[index] + "}"
- + addendStr
- + " = "
- + carryStr
- + "\\color{#28AE7B}{" + sum % 10 + "}"
- + "}");
+ this.showSideLabel("\\Large{" +
+ prevCarryStr +
+ "\\color{#6495ED}{" + digitsA[index] + "}" +
+ addendStr +
+ " = " +
+ carryStr +
+ "\\color{#28AE7B}{" + sum % 10 + "}" +
+ "}");
index++;
};
@@ -88,11 +88,11 @@ function Adder(a, b, digitsA, digitsB) {
highlights.push(graph.label([pos.max - index, pos.sum],
"\\Huge{\\color{#28AE7B}{" + carry + "}}"));
- this.showSideLabel("\\Large{"
- + "\\color{#6495ED}{" + carry + "}"
- + " = "
- + "\\color{#28AE7B}{" + carry + "}"
- + "}");
+ this.showSideLabel("\\Large{" +
+ "\\color{#6495ED}{" + carry + "}" +
+ " = " +
+ "\\color{#28AE7B}{" + carry + "}" +
+ "}");
};
this.getNumHints = function() {
@@ -223,11 +223,11 @@ function Subtractor(a, b, digitsA, digitsB, decimalPlaces) {
subStr = "- \\color{#6495ED}{ 0 }";
}
- this.showSideLabel("\\Large{"
- + "\\color{#6495ED}{" + workingDigitsA[index] + "}"
- + subStr
- + " = "
- + "\\color{#28AE7B}{" + diff + "}}");
+ this.showSideLabel("\\Large{" +
+ "\\color{#6495ED}{" + workingDigitsA[index] + "}" +
+ subStr +
+ " = " +
+ "\\color{#28AE7B}{" + diff + "}}");
index++;
};
@@ -456,12 +456,12 @@ function Multiplier(a, b, digitsA, digitsB, deciA, deciB) {
highlights = highlights.concat(graph.label([-indexA, 3], "\\color{#FFA500}{" + carry + "}", "below"));
}
graph.label([2, -indexB * digitsA.length - indexA + 2],
- "\\color{#6495ED}{" + bigDigit + "}"
- + "\\times"
- + "\\color{#FF00AF}{" + smallDigit + "}"
- + (carry ? "+\\color{#FFA500}{" + carry + "}" : "")
- + "="
- + "\\color{#28AE7B}{" + product + "}", "right");
+ "\\color{#6495ED}{" + bigDigit + "}" +
+ "\\times" +
+ "\\color{#FF00AF}{" + smallDigit + "}" +
+ (carry ? "+\\color{#FFA500}{" + carry + "}" : "") +
+ "=" +
+ "\\color{#28AE7B}{" + product + "}", "right");
drawDigits([ones], -indexB - indexA, -indexB);
highlights = highlights.concat(drawDigits([ones], -indexB - indexA, -indexB, KhanUtil.GREEN));
@@ -518,8 +518,8 @@ function Multiplier(a, b, digitsA, digitsB, deciA, deciB) {
graph.label([x, y + 1],
"\\text{The bottom number has " + KhanUtil.plural(deciB, "digit") + " to the right of the decimal.}", "right");
graph.label([x, y],
- "\\text{The product has " + deciA + " + " + deciB + " = " + (deciA + deciB)
- + " digits to the right of the decimal.}", "right");
+ "\\text{The product has " + deciA + " + " + deciB + " = " + (deciA + deciB) +
+ " digits to the right of the decimal.}", "right");
graph.style({
fill: "#000"
}, function() {
@@ -597,11 +597,11 @@ function Divider(divisor, dividend, deciDivisor, deciDividend) {
highlights = highlights.concat(drawDigits(totalDigits, index - totalDigits.length + 1, -2 * index, KhanUtil.BLUE));
graph.label([digitsDividend.length + 0.5, -2 * index],
- "\\text{How many times does }"
- + divisor
- + "\\text{ go into }"
- + "\\color{#6495ED}{" + total + "}"
- + "\\text{?}", "right");
+ "\\text{How many times does }" +
+ divisor +
+ "\\text{ go into }" +
+ "\\color{#6495ED}{" + total + "}" +
+ "\\text{?}", "right");
fShowFirstHalf = false;
} else {
@@ -627,16 +627,16 @@ function Divider(divisor, dividend, deciDivisor, deciDividend) {
graph.path([[index - product.length - 0.25, -2 * index - 1.5], [index + 0.5, -2 * index - 1.5]]);
graph.label([digitsDividend.length + 0.5, -2 * index - 1],
- "\\color{#6495ED}{" + value + "}"
- + "\\div"
- + divisor + "="
- + "\\color{#28AE7B}{" + quotient + "}"
- + "\\text{ or }"
- + divisor
- + "\\times"
- + "\\color{#28AE7B}{" + quotient + "}"
- + " = "
- + "\\color{#FFA500}{" + (divisor * quotient) + "}", "right");
+ "\\color{#6495ED}{" + value + "}" +
+ "\\div" +
+ divisor + "=" +
+ "\\color{#28AE7B}{" + quotient + "}" +
+ "\\text{ or }" +
+ divisor +
+ "\\times" +
+ "\\color{#28AE7B}{" + quotient + "}" +
+ " = " +
+ "\\color{#FFA500}{" + (divisor * quotient) + "}", "right");
index++;
fShowFirstHalf = true;
}
View
4 utils/graphie-helpers.js
@@ -124,8 +124,8 @@ function changeIntercept(dir) {
var graph = KhanUtil.currentGraph;
var prevDenominator = graph.BD;
graph.BD = KhanUtil.getLCM(prevDenominator, graph.INCR);
- graph.BN = (graph.BD / prevDenominator * graph.BN)
- + (dir * graph.BD / graph.INCR);
+ graph.BN = (graph.BD / prevDenominator * graph.BN) +
+ (dir * graph.BD / graph.INCR);
updateEquation();
}
View
4 utils/graphie.js
@@ -470,8 +470,8 @@
// allow options to be specified by a single number for shorthand if
// the horizontal and vertical components are the same
- if (!prop.match(/.*Opacity$/) && prop !== "range"
- && typeof val === "number") {
+ if (!prop.match(/.*Opacity$/) && prop !== "range" &&
+ typeof val === "number") {
options[prop] = [val, val];
}
Please sign in to comment.
Something went wrong with that request. Please try again.