diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2011-04-17 22:22:30 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2011-04-17 22:22:30 -0400 |
commit | 1a585ae90f9ea2a1a30ee73880c222674e21c188 (patch) | |
tree | 0872066e13929a81781879ecd0728fe60fab77f1 | |
parent | 83cf37421e5ca9636b40064c9d8174634fabd455 (diff) | |
download | python-coveragepy-git-1a585ae90f9ea2a1a30ee73880c222674e21c188.tar.gz |
Style
-rw-r--r-- | coverage/htmlfiles/coverage_html.js | 6 | ||||
-rw-r--r-- | test/js/tests.js | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/coverage/htmlfiles/coverage_html.js b/coverage/htmlfiles/coverage_html.js index 6798b2ad..e01793f4 100644 --- a/coverage/htmlfiles/coverage_html.js +++ b/coverage/htmlfiles/coverage_html.js @@ -90,7 +90,7 @@ coverage.pyfile_ready = function ($) { var frag = location.hash; if (frag.length > 2 && frag[1] === 'n') { $(frag).addClass('highlight'); - coverage.set_sel(parseInt(frag.substr(2))); + coverage.set_sel(parseInt(frag.substr(2), 10)); } else { coverage.set_sel(0); @@ -132,7 +132,7 @@ coverage.num_elt = function (n) { // Return the container of all the code. coverage.code_container = function (n) { return $(".linenos"); -} +}; coverage.set_sel = function (b, e) { // The first line selected. @@ -234,7 +234,7 @@ coverage.scroll_to_selection = function () { if (!top.isOnScreen() || !next.isOnScreen()) { // Need to move the page. - var top_pos = parseInt(top.offset().top); + var top_pos = parseInt(top.offset().top, 10); $("html").animate({scrollTop: top_pos-30}, 300); } }; diff --git a/test/js/tests.js b/test/js/tests.js index b468b38d..3c04e075 100644 --- a/test/js/tests.js +++ b/test/js/tests.js @@ -1,4 +1,5 @@ // Tests of coverage.py HTML report chunk navigation. +/* global: coverage, test, module, equals, jQuery, $ */ // Test helpers @@ -10,9 +11,10 @@ function selection_is(sel) { } function build_fixture(spec) { + var i, data; $("#fixture-template").tmpl().appendTo("#qunit-fixture"); - for (var i = 0; i < spec.length; i++) { - var data = {number: i+1, klass: spec.substr(i, 1)}; + for (i = 0; i < spec.length; i++) { + data = {number: i+1, klass: spec.substr(i, 1)}; $("#lineno-template").tmpl(data).appendTo("#qunit-fixture .linenos"); $("#text-template").tmpl(data).appendTo("#qunit-fixture .text"); } |