aboutsummaryrefslogtreecommitdiffstats
path: root/tools/node_modules/expresso/deps/jscoverage/doc/example-inverted
diff options
context:
space:
mode:
Diffstat (limited to 'tools/node_modules/expresso/deps/jscoverage/doc/example-inverted')
-rw-r--r--tools/node_modules/expresso/deps/jscoverage/doc/example-inverted/index.html25
-rw-r--r--tools/node_modules/expresso/deps/jscoverage/doc/example-inverted/script.js20
2 files changed, 45 insertions, 0 deletions
diff --git a/tools/node_modules/expresso/deps/jscoverage/doc/example-inverted/index.html b/tools/node_modules/expresso/deps/jscoverage/doc/example-inverted/index.html
new file mode 100644
index 0000000..be0f8ea
--- /dev/null
+++ b/tools/node_modules/expresso/deps/jscoverage/doc/example-inverted/index.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title>Example</title>
+<script type="text/javascript" src="script.js"></script>
+<style>
+div.black {
+ color: black;
+}
+div.red {
+ color: red;
+ font-weight: bold;
+}
+</style>
+</head>
+<body>
+<div id="request" class="red">Please select your favorite number:</div>
+<input type="radio" name="number" id="radio1" onclick="go(this);"><label for="radio1">One</label><br>
+<input type="radio" name="number" id="radio2" onclick="go(this);"><label for="radio2">Two</label><br>
+<input type="radio" name="number" id="radio3" onclick="go(this);"><label for="radio3">Three</label><br>
+<input type="radio" name="number" id="radio4" onclick="go(this);"><label for="radio4">Four</label><br>
+<div id="result" class="red"></div>
+<button onclick='window.open("jscoverage.html");'>Coverage report</button>
+</body>
+</html>
diff --git a/tools/node_modules/expresso/deps/jscoverage/doc/example-inverted/script.js b/tools/node_modules/expresso/deps/jscoverage/doc/example-inverted/script.js
new file mode 100644
index 0000000..f36a51d
--- /dev/null
+++ b/tools/node_modules/expresso/deps/jscoverage/doc/example-inverted/script.js
@@ -0,0 +1,20 @@
+function go(element) {
+ var message;
+ if (element.id === 'radio1') {
+ message = 'You selected the number 1.';
+ }
+ else if (element.id === 'radio2') {
+ message = 'You selected the number 2.';
+ }
+ else if (element.id === 'radio3') {
+ message = 'You selected the number 3.';
+ }
+ else if (element.id === 'radio4') {
+ message = 'You selected the number 4.';
+ }
+ var div = document.getElementById('request');
+ div.className = 'black';
+ div = document.getElementById('result');
+ div.innerHTML = '<p>' + message + '</p>';
+ div.innerHTML += '<p>If you are running the instrumented version of this program, you can click the "Coverage report" button to view a coverage report.</p>';
+}