summaryrefslogtreecommitdiff
path: root/coverage/htmlfiles/coverage_html.js
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2010-11-05 17:23:56 -0400
committerNed Batchelder <ned@nedbatchelder.com>2010-11-05 17:23:56 -0400
commitb804e1dda73237287fd5bdfcc8234261243f7cdf (patch)
treefed8161ed41a79ab1d03fefaef1a4bda9d32adc2 /coverage/htmlfiles/coverage_html.js
parenta1bcb2f1b57efedb78d1f8861202dcceba99c884 (diff)
downloadpython-coveragepy-git-b804e1dda73237287fd5bdfcc8234261243f7cdf.tar.gz
Put the Javascript into an object.
Diffstat (limited to 'coverage/htmlfiles/coverage_html.js')
-rw-r--r--coverage/htmlfiles/coverage_html.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/coverage/htmlfiles/coverage_html.js b/coverage/htmlfiles/coverage_html.js
index 5219e36b..f9ba3cf3 100644
--- a/coverage/htmlfiles/coverage_html.js
+++ b/coverage/htmlfiles/coverage_html.js
@@ -1,7 +1,9 @@
// Coverage.py HTML report browser code.
+coverage = {};
+
// Loaded on index.html
-function index_ready($) {
+coverage.index_ready = function($) {
// Look for a cookie containing previous sort settings:
sort_list = [];
cookie_name = "COVERAGE_INDEX_SORT";
@@ -65,7 +67,7 @@ function index_ready($) {
// -- pyfile stuff --
-function pyfile_ready($) {
+coverage.pyfile_ready = function($) {
// If we're directed to a particular line number, highlight the line.
var frag = location.hash;
if (frag.length > 2 && frag[1] == 'n') {
@@ -73,7 +75,7 @@ function pyfile_ready($) {
}
}
-function toggle_lines(btn, cls) {
+coverage.toggle_lines = function(btn, cls) {
btn = $(btn);
var hide = "hide_"+cls;
if (btn.hasClass(hide)) {
@@ -85,3 +87,4 @@ function toggle_lines(btn, cls) {
btn.addClass(hide);
}
}
+