Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions Firebug Usage/fb_debug
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,8 +17,8 @@
<link rel="search" type="application/opensearchdescription+xml" title="Mozilla Add-ons"
href="/AMOSearch.xml" />

<link rel="stylesheet" type="text/css" href="/css/amo2009/style.min.css?52492" media="all" />

<link rel="stylesheet" type="text/css" href="/css/amo2009/style.min.css?52492" media="all" />
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="/css/amo2009/ie.css" media="screen,projection,tv" /> <![endif]-->
<!--[if IE 7]>
Expand DownExpand Up@@ -53,13 +53,13 @@
<li><a href="#categories">Skip to categories menu</a></li>
<li><a href="#other-apps">Skip to other applications menu</a></li>
</ul>

<div class="section">
<div id="header" role="banner">
<p id="title"><a href="/en-US/firefox/" title="Return to the Firefox Add-ons homepage">Add-ons <em>for</em> <img alt="Firefox" src="/img/amo2009/app-icons/firefox.png" /> <strong>Firefox</strong></a></p>
<p id="brand"><a href="http://www.mozilla.com/en-US/" title="Mozilla" accesskey="1">Mozilla</a></p>


<div id="aux-nav" role="navigation">
<ul id="other-apps" class="change" title="Find add-ons for other applications">
<li>
Expand All@@ -80,12 +80,12 @@
</li>
</ul>


<p class="context">
<a href="/en-US/firefox/users/register">Register</a> or <a href="/en-US/firefox/users/login?to=en-US%2Ffirefox%2Faddon%2F1843">Log in</a> </p>
</div>
</div>


<div class="stand-alone-options">
<div id="categories" class="categories">
Expand DownExpand Up@@ -154,7 +154,7 @@
</li>
</ul>
</div>

<div class="search-form expanded-search-form">
<form method="get" action="/en-US/firefox/search" id="search-form">
<div class="basic" id="search-query">
Expand All@@ -180,7 +180,7 @@
<option value="1,92">Toolbars</option>
<option value="1,4">Web Development</option>
<option value="1,73">Other</option>

<option class="cat-all" value="collections">all collections</option>
</select>
<button type="submit"><img src="/img/amo2009/blank.gif" alt="Search for add-ons"/></button>
Expand DownExpand Up@@ -295,7 +295,7 @@ versions[60] = {"0.1": "0.1", "0.7": "0.7", "1.0": "1.0", 'Any' : 'any' };

default_low = ( ('' == '-1' || '' == '') && current_app_id == 1) ? low_appversion : 'any';


$("#lver-td input").remove();

var verArr = versions[1];
Expand DownExpand Up@@ -334,7 +334,7 @@ versions[60] = {"0.1": "0.1", "0.7": "0.7", "1.0": "1.0", 'Any' : 'any' };
return true;
});


$(document).ready(function() {
var q = $("#query");
var l = $("#search-query label[for=query]");
Expand DownExpand Up@@ -406,15 +406,15 @@ Firebug 1.4 requires Firefox 3.0 or higher. </p>
<script type="text/javascript">
installVersusDownloadCheck("installTrigger65631-79ab13a7", "Add to Firefox ", "Download Now ");
</script>

<strong>recommended</strong>
</div>

<script type="text/javascript">setTimeout(function() {initExpConfirm('79554-79ab13a7');fixPlatformLinks('79554-79ab13a7', 'Firebug');addCompatibilityHints('1843', '79554-79ab13a7', '3.0', '3.5.*', '');},0);</script>

</div>


<table summary="Add-on Information">
<tbody>
<tr>
Expand DownExpand Up@@ -469,7 +469,7 @@ Firebug 1.4 requires Firefox 3.0 or higher. </p>
<a class="screenshot thumbnail" rel="lightbox" href="/en-US/firefox/images/p/9486/" title="">
<img alt="" src="/en-US/firefox/images/t/9486/" />
</a>

<div class="share-this">
<a class="share" href="#">Share this Add-on</a>
<div class="share-networks">
Expand DownExpand Up@@ -525,11 +525,11 @@ Visit the Firebug website for documentation, screen shots, and discussion forums
href="/en-US/firefox/images/p/11828/" title="Network">
<img src="/en-US/firefox/images/t/11828/" alt="" />
</a>

<h4>Support</h4>
<p>
Support for this add-on is provided by the developer at <a href="http://groups.google.com/group/firebug/topics" >http://groups.google.com/group/firebug/topics</a> </p>

<h4>Developer Comments</h4>
<p >
If you have any problems, please read the FireBug FAQ.<br />
Expand DownExpand Up@@ -572,15 +572,15 @@ I can&#039;t even think of working without this !</p>
See all 681 reviews of this add-on </a>
</p>
</div>


<h3>What do you think?</h3>
<div id="review-box" class="highlight">
<p>Please <a href="/en-US/firefox/users/login?to=en-US%2Ffirefox%2Faddon%2F1843">log in</a> to submit a review</p>

<form class="addon-feedback" method="post"
action="/en-US/firefox/reviews/add/1843">

<div class="container">
<label for="review">Review</label>
<textarea name="data[Review][body]" id="review" disabled="disabled" cols="30" rows="6"></textarea>
Expand DownExpand Up@@ -610,7 +610,7 @@ I can&#039;t even think of working without this !</p>
Detailed Review </a>
</p>
</div> <!-- highlight -->

<h3>Release Notes</h3>
<div class="article">
<a href="/en-US/firefox/addons/versions/1843#version-1.4.3" title="Permanent link to this version">Version 1.4.3</a> <span title="September 29, 2009, 11:35 AM">&mdash;
Expand All@@ -619,15 +619,15 @@ I can&#039;t even think of working without this !</p>
<br />
Replaced &quot;Off for All Web Pages&quot; with &quot;Clear Activation List&quot;. </p>


<ul class="further-navigation">
<li>
<a href="/en-US/firefox/addons/versions/1843">
View Older Versions </a>
</li>
</ul>
</div> <!-- Release Notes -->

</div> <!-- primary -->

<div class="secondary" role="secondary">
Expand DownExpand Up@@ -701,7 +701,7 @@ Replaced &quot;Off for All Web Pages&quot; with &quot;Clear Activation List&quot
</form>
</div>

<a href="/en-US/firefox/users/register">Register</a> or <a href="/en-US/firefox/users/login?to=en-US%2Ffirefox%2Faddon%2F1843">Log in</a> to add tags
<a href="/en-US/firefox/users/register">Register</a> or <a href="/en-US/firefox/users/login?to=en-US%2Ffirefox%2Faddon%2F1843">Log in</a> to add tags
</div>
<!-- /.highlight-->

Expand DownExpand Up@@ -730,7 +730,7 @@ Replaced &quot;Off for All Web Pages&quot; with &quot;Clear Activation List&quot
</li>
</ul>
</div>

<div class="collections-add">
<h3 class="compact-bottom">Related Collections</h3>

Expand DownExpand Up@@ -824,7 +824,7 @@ Replaced &quot;Off for All Web Pages&quot; with &quot;Clear Activation List&quot
<button type="submit">Go</button>
</div>
</form>

<p><strong>Copyright <span title="pm-app-amo15.mozilla.org">&#169;</span> 2005&#8211;2009 Mozilla.</strong> All rights reserved.</p>
<ul>
<li><a href="/en-US/firefox/pages/privacy" >Privacy Policy</a></li>
Expand Down
12 changes: 6 additions & 6 deletions README
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
=============================
Test Driving JavaScript Book
Test Driving JavaScript Book
=============================
This is the source code and actual book in open office formate (.odt), Test Driving JavaScript (aka TD JavaScript). It is licensed under the Creative Commons Attribution-Non Commercial-Share Alike 3.0 license. http://creativecommons.org/licenses/by-sa/3.0/us/

This is the source code and actual book in open office formate (.odt), Test Driving JavaScript (aka TD JavaScript). It is licensed under the Creative Commons Attribution-Non Commercial-Share Alike 3.0 license. http://creativecommons.org/licenses/by-sa/3.0/us/

Contributors
=====================
I am interested in contributors that may have relevant experience, information, that I am not already supplying. For example, here are some possible topics/chapters that would probably improve the book:
- IE specific debugging via the IE8 JavaScript debugger would be a great addition.
- Integration with a continuous integration system.
Note that the goal of the book is to be short and sweet so contributions will need to be to the point. Given that the main document is currently using Open Office, I'd ask that contributions come in that form. I still need to research merging a .odt document, so I'm still unsure of how to go about patches/contributions (in that regard). Please email me if you're serious about contributing.
Note that the goal of the book is to be short and sweet so contributions will need to be to the point. Given that the main document is currently using Open Office, I'd ask that contributions come in that form. I still need to research merging a .odt document, so I'm still unsure of how to go about patches/contributions (in that regard). Please email me if you're serious about contributing.

Errata
=====================
If you find any technical mistakes and/or parts of the book that are in need of correction,
please email me at roblevintennis at gmail dot com to inform me.
please email me at roblevintennis at gmail dot com to inform me.

Binary file modifiedTDD JavaScript.odt
Binary file not shown.
2 changes: 1 addition & 1 deletion code/5_min_drill/README.rdoc
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@

Description

== License
== License

(The MIT License)

Expand Down
4 changes: 2 additions & 2 deletions code/5_min_drill/lib/test_js_itself.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,12 +3,12 @@ JSTest.prototype = {
constructor: JSTest,
switchTest : function(c) {
switch(c) {
case 0:
case 0:
return "zero";
break;
case 1:
return "one";
break;
break;
case "no break case":
// do nothing...testing fall through
case "next case":
Expand Down
10 changes: 5 additions & 5 deletions code/5_min_drill/spec/spec.test_js_itself.js
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
describe 'TestJsItself'
before_each
jsTest = new JSTest
before_each
jsTest = new JSTest
arr = jsTest.arrayTest()
end
end
describe '.switchTest()'
it 'should return corresponding case primitive int as a string'
jsTest.switchTest(1).should.eql "one"
jsTest.switchTest(1).should.eql "one"
end
it 'should fall through to next case when omitting a break'
jsTest.switchTest("no break case").should.eql "next case"
Expand All@@ -16,7 +16,7 @@ describe 'TestJsItself'
(typeof arr == 'object').should.eql true
end
it 'should use zero based indexing'
arr[1].should.eql 2
arr[1].should.eql 2
end
end
end
2 changes: 1 addition & 1 deletion code/binary_tree/bin_tree/README.rdoc
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@

Description

== License
== License

(The MIT License)

Expand Down
6 changes: 3 additions & 3 deletions code/binary_tree/bin_tree/lib/yourlib.core.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,7 +10,7 @@ function BSTree(n) {
this.root = n;
};
BSTree.prototype = {
// Essentially have to go past node it should be connected to
// Essentially have to go past node it should be connected to
// looking for undefined, so we always need pointer to parent node
addNode: function(node) {
var current = this.root;
Expand DownExpand Up@@ -45,10 +45,10 @@ BSTree.prototype = {
}
}
}
return null;
return null;
},
// Builds an "in order" array of the list's nodes (eg [1,2,3,4...])
traverseInOrder: function(inOrdArray, cNode) {
traverseInOrder: function(inOrdArray, cNode) {
if(cNode !== undefined) {
this.traverseInOrder(inOrdArray, cNode.left);
inOrdArray.push(cNode);
Expand Down
16 changes: 8 additions & 8 deletions code/binary_tree/bin_tree/spec/spec.core.js
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
/*
------------------------- Binary Search Tree -------------------------
------------------------- Binary Search Tree -------------------------

NOTE: This is about the simplest Binary Search Tree we could make. It does NOT implement deletion
NOTE: This is about the simplest Binary Search Tree we could make. It does NOT implement deletion
which is rather complex. However, Zakas has a series of articles online (part II does the deletiation part):
http://www.nczonline.net/blog/2009/06/16/computer-science-in-javascript-binary-search-tree-part-2/
http://www.nczonline.net/blog/2009/06/09/computer-science-in-javascript-binary-search-tree-part-1/
Expand DownExpand Up@@ -40,7 +40,7 @@ the root. If we assume the root is Level 0, its children will be Level 1, its gr
will be Level 2, and so on.

-- Keys: We’ve seen that one data item in an object is usually designated a key value. This
value is used to search for the item or perform other operations on it.
value is used to search for the item or perform other operations on it.

-- Binary Trees: If every node in a tree can have at most two children, the tree is called a binary
tree.
Expand All@@ -64,10 +64,10 @@ describe 'Binary Search Tree'
tree = new BSTree(root)
tree.addNode(leftChild)
tree.addNode(rightChild)
end
end
it 'should create a node2 with left and right nodes'
// Node should be as initialized data, left/right null
node2.data.should.be 222
node2.data.should.be 222
node2['left'].should.be_null
node2['right'].should.be_null
// After assignment, left/right should be as assigned
Expand DownExpand Up@@ -104,8 +104,8 @@ describe 'Binary Search Tree'
tree.find(10).id.should.equal 10
tree.find(16).id.should.equal 16
tree.find(17).id.should.equal 17
tree.find(888).should.be_null
tree.find('abc').should.be_null
tree.find(888).should.be_null
tree.find('abc').should.be_null
end
it 'should add and find nodes even if negative numbers'
var negNode = new Node(-10)
Expand All@@ -115,7 +115,7 @@ describe 'Binary Search Tree'
it 'should traverse in order and return in order array'
var llGrandChild = new Node(5,5)
tree.addNode(llGrandChild)
var inOrderArray = tree.traverseInOrder([], root)
var inOrderArray = tree.traverseInOrder([], root)
inOrderArray[0].id.should.equal llGrandChild.id
inOrderArray[1].id.should.equal leftChild.id
inOrderArray[2].id.should.equal root.id
Expand Down
2 changes: 1 addition & 1 deletion code/gotchas/README.rdoc
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@

Description

== License
== License

(The MIT License)

Expand Down
4 changes: 2 additions & 2 deletions code/gotchas/lib/gotchas.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,8 +17,8 @@ var privileged_singleton = function() {
var obj = SomeObject;
obj.publicVar = 'this is public';
obj.publicFunc = function() {
var message = 'publicFunc is privileged, and hereby allows you to see private var: ' +
privateVar + ', as well as see the return value of privateFunc: ' + privateFunc();
var message = 'publicFunc is privileged, and hereby allows you to see private var: ' +
privateVar + ', as well as see the return value of privateFunc: ' + privateFunc();
return message;
};
return obj;
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions Firebug Usage/fb_debug
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,8 +17,8 @@
<link rel="search" type="application/opensearchdescription+xml" title="Mozilla Add-ons"
href="/AMOSearch.xml" />

<link rel="stylesheet" type="text/css" href="/css/amo2009/style.min.css?52492" media="all" />

<link rel="stylesheet" type="text/css" href="/css/amo2009/style.min.css?52492" media="all" />
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="/css/amo2009/ie.css" media="screen,projection,tv" /> <![endif]-->
<!--[if IE 7]>
Expand DownExpand Up@@ -53,13 +53,13 @@
<li><a href="#categories">Skip to categories menu</a></li>
<li><a href="#other-apps">Skip to other applications menu</a></li>
</ul>

<div class="section">
<div id="header" role="banner">
<p id="title"><a href="/en-US/firefox/" title="Return to the Firefox Add-ons homepage">Add-ons <em>for</em> <img alt="Firefox" src="/img/amo2009/app-icons/firefox.png" /> <strong>Firefox</strong></a></p>
<p id="brand"><a href="http://www.mozilla.com/en-US/" title="Mozilla" accesskey="1">Mozilla</a></p>


<div id="aux-nav" role="navigation">
<ul id="other-apps" class="change" title="Find add-ons for other applications">
<li>
Expand All@@ -80,12 +80,12 @@
</li>
</ul>


<p class="context">
<a href="/en-US/firefox/users/register">Register</a> or <a href="/en-US/firefox/users/login?to=en-US%2Ffirefox%2Faddon%2F1843">Log in</a> </p>
</div>
</div>


<div class="stand-alone-options">
<div id="categories" class="categories">
Expand DownExpand Up@@ -154,7 +154,7 @@
</li>
</ul>
</div>

<div class="search-form expanded-search-form">
<form method="get" action="/en-US/firefox/search" id="search-form">
<div class="basic" id="search-query">
Expand All@@ -180,7 +180,7 @@
<option value="1,92">Toolbars</option>
<option value="1,4">Web Development</option>
<option value="1,73">Other</option>

<option class="cat-all" value="collections">all collections</option>
</select>
<button type="submit"><img src="/img/amo2009/blank.gif" alt="Search for add-ons"/></button>
Expand DownExpand Up@@ -295,7 +295,7 @@ versions[60] = {"0.1": "0.1", "0.7": "0.7", "1.0": "1.0", 'Any' : 'any' };

default_low = ( ('' == '-1' || '' == '') && current_app_id == 1) ? low_appversion : 'any';


$("#lver-td input").remove();

var verArr = versions[1];
Expand DownExpand Up@@ -334,7 +334,7 @@ versions[60] = {"0.1": "0.1", "0.7": "0.7", "1.0": "1.0", 'Any' : 'any' };
return true;
});


$(document).ready(function() {
var q = $("#query");
var l = $("#search-query label[for=query]");
Expand DownExpand Up@@ -406,15 +406,15 @@ Firebug 1.4 requires Firefox 3.0 or higher. </p>
<script type="text/javascript">
installVersusDownloadCheck("installTrigger65631-79ab13a7", "Add to Firefox ", "Download Now ");
</script>

<strong>recommended</strong>
</div>

<script type="text/javascript">setTimeout(function() {initExpConfirm('79554-79ab13a7');fixPlatformLinks('79554-79ab13a7', 'Firebug');addCompatibilityHints('1843', '79554-79ab13a7', '3.0', '3.5.*', '');},0);</script>

</div>


<table summary="Add-on Information">
<tbody>
<tr>
Expand DownExpand Up@@ -469,7 +469,7 @@ Firebug 1.4 requires Firefox 3.0 or higher. </p>
<a class="screenshot thumbnail" rel="lightbox" href="/en-US/firefox/images/p/9486/" title="">
<img alt="" src="/en-US/firefox/images/t/9486/" />
</a>

<div class="share-this">
<a class="share" href="#">Share this Add-on</a>
<div class="share-networks">
Expand DownExpand Up@@ -525,11 +525,11 @@ Visit the Firebug website for documentation, screen shots, and discussion forums
href="/en-US/firefox/images/p/11828/" title="Network">
<img src="/en-US/firefox/images/t/11828/" alt="" />
</a>

<h4>Support</h4>
<p>
Support for this add-on is provided by the developer at <a href="http://groups.google.com/group/firebug/topics" >http://groups.google.com/group/firebug/topics</a> </p>

<h4>Developer Comments</h4>
<p >
If you have any problems, please read the FireBug FAQ.<br />
Expand DownExpand Up@@ -572,15 +572,15 @@ I can&#039;t even think of working without this !</p>
See all 681 reviews of this add-on </a>
</p>
</div>


<h3>What do you think?</h3>
<div id="review-box" class="highlight">
<p>Please <a href="/en-US/firefox/users/login?to=en-US%2Ffirefox%2Faddon%2F1843">log in</a> to submit a review</p>

<form class="addon-feedback" method="post"
action="/en-US/firefox/reviews/add/1843">

<div class="container">
<label for="review">Review</label>
<textarea name="data[Review][body]" id="review" disabled="disabled" cols="30" rows="6"></textarea>
Expand DownExpand Up@@ -610,7 +610,7 @@ I can&#039;t even think of working without this !</p>
Detailed Review </a>
</p>
</div> <!-- highlight -->

<h3>Release Notes</h3>
<div class="article">
<a href="/en-US/firefox/addons/versions/1843#version-1.4.3" title="Permanent link to this version">Version 1.4.3</a> <span title="September 29, 2009, 11:35 AM">&mdash;
Expand All@@ -619,15 +619,15 @@ I can&#039;t even think of working without this !</p>
<br />
Replaced &quot;Off for All Web Pages&quot; with &quot;Clear Activation List&quot;. </p>


<ul class="further-navigation">
<li>
<a href="/en-US/firefox/addons/versions/1843">
View Older Versions </a>
</li>
</ul>
</div> <!-- Release Notes -->

</div> <!-- primary -->

<div class="secondary" role="secondary">
Expand DownExpand Up@@ -701,7 +701,7 @@ Replaced &quot;Off for All Web Pages&quot; with &quot;Clear Activation List&quot
</form>
</div>

<a href="/en-US/firefox/users/register">Register</a> or <a href="/en-US/firefox/users/login?to=en-US%2Ffirefox%2Faddon%2F1843">Log in</a> to add tags
<a href="/en-US/firefox/users/register">Register</a> or <a href="/en-US/firefox/users/login?to=en-US%2Ffirefox%2Faddon%2F1843">Log in</a> to add tags
</div>
<!-- /.highlight-->

Expand DownExpand Up@@ -730,7 +730,7 @@ Replaced &quot;Off for All Web Pages&quot; with &quot;Clear Activation List&quot
</li>
</ul>
</div>

<div class="collections-add">
<h3 class="compact-bottom">Related Collections</h3>

Expand DownExpand Up@@ -824,7 +824,7 @@ Replaced &quot;Off for All Web Pages&quot; with &quot;Clear Activation List&quot
<button type="submit">Go</button>
</div>
</form>

<p><strong>Copyright <span title="pm-app-amo15.mozilla.org">&#169;</span> 2005&#8211;2009 Mozilla.</strong> All rights reserved.</p>
<ul>
<li><a href="/en-US/firefox/pages/privacy" >Privacy Policy</a></li>
Expand Down
12 changes: 6 additions & 6 deletions README
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
=============================
Test Driving JavaScript Book
Test Driving JavaScript Book
=============================
This is the source code and actual book in open office formate (.odt), Test Driving JavaScript (aka TD JavaScript). It is licensed under the Creative Commons Attribution-Non Commercial-Share Alike 3.0 license. http://creativecommons.org/licenses/by-sa/3.0/us/

This is the source code and actual book in open office formate (.odt), Test Driving JavaScript (aka TD JavaScript). It is licensed under the Creative Commons Attribution-Non Commercial-Share Alike 3.0 license. http://creativecommons.org/licenses/by-sa/3.0/us/

Contributors
=====================
I am interested in contributors that may have relevant experience, information, that I am not already supplying. For example, here are some possible topics/chapters that would probably improve the book:
- IE specific debugging via the IE8 JavaScript debugger would be a great addition.
- Integration with a continuous integration system.
Note that the goal of the book is to be short and sweet so contributions will need to be to the point. Given that the main document is currently using Open Office, I'd ask that contributions come in that form. I still need to research merging a .odt document, so I'm still unsure of how to go about patches/contributions (in that regard). Please email me if you're serious about contributing.
Note that the goal of the book is to be short and sweet so contributions will need to be to the point. Given that the main document is currently using Open Office, I'd ask that contributions come in that form. I still need to research merging a .odt document, so I'm still unsure of how to go about patches/contributions (in that regard). Please email me if you're serious about contributing.

Errata
=====================
If you find any technical mistakes and/or parts of the book that are in need of correction,
please email me at roblevintennis at gmail dot com to inform me.
please email me at roblevintennis at gmail dot com to inform me.

Binary file modifiedTDD JavaScript.odt
Binary file not shown.
2 changes: 1 addition & 1 deletion code/5_min_drill/README.rdoc
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@

Description

== License
== License

(The MIT License)

Expand Down
4 changes: 2 additions & 2 deletions code/5_min_drill/lib/test_js_itself.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,12 +3,12 @@ JSTest.prototype = {
constructor: JSTest,
switchTest : function(c) {
switch(c) {
case 0:
case 0:
return "zero";
break;
case 1:
return "one";
break;
break;
case "no break case":
// do nothing...testing fall through
case "next case":
Expand Down
10 changes: 5 additions & 5 deletions code/5_min_drill/spec/spec.test_js_itself.js
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
describe 'TestJsItself'
before_each
jsTest = new JSTest
before_each
jsTest = new JSTest
arr = jsTest.arrayTest()
end
end
describe '.switchTest()'
it 'should return corresponding case primitive int as a string'
jsTest.switchTest(1).should.eql "one"
jsTest.switchTest(1).should.eql "one"
end
it 'should fall through to next case when omitting a break'
jsTest.switchTest("no break case").should.eql "next case"
Expand All@@ -16,7 +16,7 @@ describe 'TestJsItself'
(typeof arr == 'object').should.eql true
end
it 'should use zero based indexing'
arr[1].should.eql 2
arr[1].should.eql 2
end
end
end
2 changes: 1 addition & 1 deletion code/binary_tree/bin_tree/README.rdoc
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@

Description

== License
== License

(The MIT License)

Expand Down
6 changes: 3 additions & 3 deletions code/binary_tree/bin_tree/lib/yourlib.core.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,7 +10,7 @@ function BSTree(n) {
this.root = n;
};
BSTree.prototype = {
// Essentially have to go past node it should be connected to
// Essentially have to go past node it should be connected to
// looking for undefined, so we always need pointer to parent node
addNode: function(node) {
var current = this.root;
Expand DownExpand Up@@ -45,10 +45,10 @@ BSTree.prototype = {
}
}
}
return null;
return null;
},
// Builds an "in order" array of the list's nodes (eg [1,2,3,4...])
traverseInOrder: function(inOrdArray, cNode) {
traverseInOrder: function(inOrdArray, cNode) {
if(cNode !== undefined) {
this.traverseInOrder(inOrdArray, cNode.left);
inOrdArray.push(cNode);
Expand Down
16 changes: 8 additions & 8 deletions code/binary_tree/bin_tree/spec/spec.core.js
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
/*
------------------------- Binary Search Tree -------------------------
------------------------- Binary Search Tree -------------------------

NOTE: This is about the simplest Binary Search Tree we could make. It does NOT implement deletion
NOTE: This is about the simplest Binary Search Tree we could make. It does NOT implement deletion
which is rather complex. However, Zakas has a series of articles online (part II does the deletiation part):
http://www.nczonline.net/blog/2009/06/16/computer-science-in-javascript-binary-search-tree-part-2/
http://www.nczonline.net/blog/2009/06/09/computer-science-in-javascript-binary-search-tree-part-1/
Expand DownExpand Up@@ -40,7 +40,7 @@ the root. If we assume the root is Level 0, its children will be Level 1, its gr
will be Level 2, and so on.

-- Keys: We’ve seen that one data item in an object is usually designated a key value. This
value is used to search for the item or perform other operations on it.
value is used to search for the item or perform other operations on it.

-- Binary Trees: If every node in a tree can have at most two children, the tree is called a binary
tree.
Expand All@@ -64,10 +64,10 @@ describe 'Binary Search Tree'
tree = new BSTree(root)
tree.addNode(leftChild)
tree.addNode(rightChild)
end
end
it 'should create a node2 with left and right nodes'
// Node should be as initialized data, left/right null
node2.data.should.be 222
node2.data.should.be 222
node2['left'].should.be_null
node2['right'].should.be_null
// After assignment, left/right should be as assigned
Expand DownExpand Up@@ -104,8 +104,8 @@ describe 'Binary Search Tree'
tree.find(10).id.should.equal 10
tree.find(16).id.should.equal 16
tree.find(17).id.should.equal 17
tree.find(888).should.be_null
tree.find('abc').should.be_null
tree.find(888).should.be_null
tree.find('abc').should.be_null
end
it 'should add and find nodes even if negative numbers'
var negNode = new Node(-10)
Expand All@@ -115,7 +115,7 @@ describe 'Binary Search Tree'
it 'should traverse in order and return in order array'
var llGrandChild = new Node(5,5)
tree.addNode(llGrandChild)
var inOrderArray = tree.traverseInOrder([], root)
var inOrderArray = tree.traverseInOrder([], root)
inOrderArray[0].id.should.equal llGrandChild.id
inOrderArray[1].id.should.equal leftChild.id
inOrderArray[2].id.should.equal root.id
Expand Down
2 changes: 1 addition & 1 deletion code/gotchas/README.rdoc
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@

Description

== License
== License

(The MIT License)

Expand Down
4 changes: 2 additions & 2 deletions code/gotchas/lib/gotchas.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,8 +17,8 @@ var privileged_singleton = function() {
var obj = SomeObject;
obj.publicVar = 'this is public';
obj.publicFunc = function() {
var message = 'publicFunc is privileged, and hereby allows you to see private var: ' +
privateVar + ', as well as see the return value of privateFunc: ' + privateFunc();
var message = 'publicFunc is privileged, and hereby allows you to see private var: ' +
privateVar + ', as well as see the return value of privateFunc: ' + privateFunc();
return message;
};
return obj;
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions Firebug Usage/fb_debug
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,8 +17,8 @@
<link rel="search" type="application/opensearchdescription+xml" title="Mozilla Add-ons"
href="/AMOSearch.xml" />

<link rel="stylesheet" type="text/css" href="/css/amo2009/style.min.css?52492" media="all" />

<link rel="stylesheet" type="text/css" href="/css/amo2009/style.min.css?52492" media="all" />
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="/css/amo2009/ie.css" media="screen,projection,tv" /> <![endif]-->
<!--[if IE 7]>
Expand DownExpand Up@@ -53,13 +53,13 @@
<li><a href="#categories">Skip to categories menu</a></li>
<li><a href="#other-apps">Skip to other applications menu</a></li>
</ul>

<div class="section">
<div id="header" role="banner">
<p id="title"><a href="/en-US/firefox/" title="Return to the Firefox Add-ons homepage">Add-ons <em>for</em> <img alt="Firefox" src="/img/amo2009/app-icons/firefox.png" /> <strong>Firefox</strong></a></p>
<p id="brand"><a href="http://www.mozilla.com/en-US/" title="Mozilla" accesskey="1">Mozilla</a></p>


<div id="aux-nav" role="navigation">
<ul id="other-apps" class="change" title="Find add-ons for other applications">
<li>
Expand All@@ -80,12 +80,12 @@
</li>
</ul>


<p class="context">
<a href="/en-US/firefox/users/register">Register</a> or <a href="/en-US/firefox/users/login?to=en-US%2Ffirefox%2Faddon%2F1843">Log in</a> </p>
</div>
</div>


<div class="stand-alone-options">
<div id="categories" class="categories">
Expand DownExpand Up@@ -154,7 +154,7 @@
</li>
</ul>
</div>

<div class="search-form expanded-search-form">
<form method="get" action="/en-US/firefox/search" id="search-form">
<div class="basic" id="search-query">
Expand All@@ -180,7 +180,7 @@
<option value="1,92">Toolbars</option>
<option value="1,4">Web Development</option>
<option value="1,73">Other</option>

<option class="cat-all" value="collections">all collections</option>
</select>
<button type="submit"><img src="/img/amo2009/blank.gif" alt="Search for add-ons"/></button>
Expand DownExpand Up@@ -295,7 +295,7 @@ versions[60] = {"0.1": "0.1", "0.7": "0.7", "1.0": "1.0", 'Any' : 'any' };

default_low = ( ('' == '-1' || '' == '') && current_app_id == 1) ? low_appversion : 'any';


$("#lver-td input").remove();

var verArr = versions[1];
Expand DownExpand Up@@ -334,7 +334,7 @@ versions[60] = {"0.1": "0.1", "0.7": "0.7", "1.0": "1.0", 'Any' : 'any' };
return true;
});


$(document).ready(function() {
var q = $("#query");
var l = $("#search-query label[for=query]");
Expand DownExpand Up@@ -406,15 +406,15 @@ Firebug 1.4 requires Firefox 3.0 or higher. </p>
<script type="text/javascript">
installVersusDownloadCheck("installTrigger65631-79ab13a7", "Add to Firefox ", "Download Now ");
</script>

<strong>recommended</strong>
</div>

<script type="text/javascript">setTimeout(function() {initExpConfirm('79554-79ab13a7');fixPlatformLinks('79554-79ab13a7', 'Firebug');addCompatibilityHints('1843', '79554-79ab13a7', '3.0', '3.5.*', '');},0);</script>

</div>


<table summary="Add-on Information">
<tbody>
<tr>
Expand DownExpand Up@@ -469,7 +469,7 @@ Firebug 1.4 requires Firefox 3.0 or higher. </p>
<a class="screenshot thumbnail" rel="lightbox" href="/en-US/firefox/images/p/9486/" title="">
<img alt="" src="/en-US/firefox/images/t/9486/" />
</a>

<div class="share-this">
<a class="share" href="#">Share this Add-on</a>
<div class="share-networks">
Expand DownExpand Up@@ -525,11 +525,11 @@ Visit the Firebug website for documentation, screen shots, and discussion forums
href="/en-US/firefox/images/p/11828/" title="Network">
<img src="/en-US/firefox/images/t/11828/" alt="" />
</a>

<h4>Support</h4>
<p>
Support for this add-on is provided by the developer at <a href="http://groups.google.com/group/firebug/topics" >http://groups.google.com/group/firebug/topics</a> </p>

<h4>Developer Comments</h4>
<p >
If you have any problems, please read the FireBug FAQ.<br />
Expand DownExpand Up@@ -572,15 +572,15 @@ I can&#039;t even think of working without this !</p>
See all 681 reviews of this add-on </a>
</p>
</div>


<h3>What do you think?</h3>
<div id="review-box" class="highlight">
<p>Please <a href="/en-US/firefox/users/login?to=en-US%2Ffirefox%2Faddon%2F1843">log in</a> to submit a review</p>

<form class="addon-feedback" method="post"
action="/en-US/firefox/reviews/add/1843">

<div class="container">
<label for="review">Review</label>
<textarea name="data[Review][body]" id="review" disabled="disabled" cols="30" rows="6"></textarea>
Expand DownExpand Up@@ -610,7 +610,7 @@ I can&#039;t even think of working without this !</p>
Detailed Review </a>
</p>
</div> <!-- highlight -->

<h3>Release Notes</h3>
<div class="article">
<a href="/en-US/firefox/addons/versions/1843#version-1.4.3" title="Permanent link to this version">Version 1.4.3</a> <span title="September 29, 2009, 11:35 AM">&mdash;
Expand All@@ -619,15 +619,15 @@ I can&#039;t even think of working without this !</p>
<br />
Replaced &quot;Off for All Web Pages&quot; with &quot;Clear Activation List&quot;. </p>


<ul class="further-navigation">
<li>
<a href="/en-US/firefox/addons/versions/1843">
View Older Versions </a>
</li>
</ul>
</div> <!-- Release Notes -->

</div> <!-- primary -->

<div class="secondary" role="secondary">
Expand DownExpand Up@@ -701,7 +701,7 @@ Replaced &quot;Off for All Web Pages&quot; with &quot;Clear Activation List&quot
</form>
</div>

<a href="/en-US/firefox/users/register">Register</a> or <a href="/en-US/firefox/users/login?to=en-US%2Ffirefox%2Faddon%2F1843">Log in</a> to add tags
<a href="/en-US/firefox/users/register">Register</a> or <a href="/en-US/firefox/users/login?to=en-US%2Ffirefox%2Faddon%2F1843">Log in</a> to add tags
</div>
<!-- /.highlight-->

Expand DownExpand Up@@ -730,7 +730,7 @@ Replaced &quot;Off for All Web Pages&quot; with &quot;Clear Activation List&quot
</li>
</ul>
</div>

<div class="collections-add">
<h3 class="compact-bottom">Related Collections</h3>

Expand DownExpand Up@@ -824,7 +824,7 @@ Replaced &quot;Off for All Web Pages&quot; with &quot;Clear Activation List&quot
<button type="submit">Go</button>
</div>
</form>

<p><strong>Copyright <span title="pm-app-amo15.mozilla.org">&#169;</span> 2005&#8211;2009 Mozilla.</strong> All rights reserved.</p>
<ul>
<li><a href="/en-US/firefox/pages/privacy" >Privacy Policy</a></li>
Expand Down
12 changes: 6 additions & 6 deletions README
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
=============================
Test Driving JavaScript Book
Test Driving JavaScript Book
=============================
This is the source code and actual book in open office formate (.odt), Test Driving JavaScript (aka TD JavaScript). It is licensed under the Creative Commons Attribution-Non Commercial-Share Alike 3.0 license. http://creativecommons.org/licenses/by-sa/3.0/us/

This is the source code and actual book in open office formate (.odt), Test Driving JavaScript (aka TD JavaScript). It is licensed under the Creative Commons Attribution-Non Commercial-Share Alike 3.0 license. http://creativecommons.org/licenses/by-sa/3.0/us/

Contributors
=====================
I am interested in contributors that may have relevant experience, information, that I am not already supplying. For example, here are some possible topics/chapters that would probably improve the book:
- IE specific debugging via the IE8 JavaScript debugger would be a great addition.
- Integration with a continuous integration system.
Note that the goal of the book is to be short and sweet so contributions will need to be to the point. Given that the main document is currently using Open Office, I'd ask that contributions come in that form. I still need to research merging a .odt document, so I'm still unsure of how to go about patches/contributions (in that regard). Please email me if you're serious about contributing.
Note that the goal of the book is to be short and sweet so contributions will need to be to the point. Given that the main document is currently using Open Office, I'd ask that contributions come in that form. I still need to research merging a .odt document, so I'm still unsure of how to go about patches/contributions (in that regard). Please email me if you're serious about contributing.

Errata
=====================
If you find any technical mistakes and/or parts of the book that are in need of correction,
please email me at roblevintennis at gmail dot com to inform me.
please email me at roblevintennis at gmail dot com to inform me.

Binary file modifiedTDD JavaScript.odt
Binary file not shown.
2 changes: 1 addition & 1 deletion code/5_min_drill/README.rdoc
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@

Description

== License
== License

(The MIT License)

Expand Down
4 changes: 2 additions & 2 deletions code/5_min_drill/lib/test_js_itself.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,12 +3,12 @@ JSTest.prototype = {
constructor: JSTest,
switchTest : function(c) {
switch(c) {
case 0:
case 0:
return "zero";
break;
case 1:
return "one";
break;
break;
case "no break case":
// do nothing...testing fall through
case "next case":
Expand Down
10 changes: 5 additions & 5 deletions code/5_min_drill/spec/spec.test_js_itself.js
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
describe 'TestJsItself'
before_each
jsTest = new JSTest
before_each
jsTest = new JSTest
arr = jsTest.arrayTest()
end
end
describe '.switchTest()'
it 'should return corresponding case primitive int as a string'
jsTest.switchTest(1).should.eql "one"
jsTest.switchTest(1).should.eql "one"
end
it 'should fall through to next case when omitting a break'
jsTest.switchTest("no break case").should.eql "next case"
Expand All@@ -16,7 +16,7 @@ describe 'TestJsItself'
(typeof arr == 'object').should.eql true
end
it 'should use zero based indexing'
arr[1].should.eql 2
arr[1].should.eql 2
end
end
end
2 changes: 1 addition & 1 deletion code/binary_tree/bin_tree/README.rdoc
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@

Description

== License
== License

(The MIT License)

Expand Down
6 changes: 3 additions & 3 deletions code/binary_tree/bin_tree/lib/yourlib.core.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,7 +10,7 @@ function BSTree(n) {
this.root = n;
};
BSTree.prototype = {
// Essentially have to go past node it should be connected to
// Essentially have to go past node it should be connected to
// looking for undefined, so we always need pointer to parent node
addNode: function(node) {
var current = this.root;
Expand DownExpand Up@@ -45,10 +45,10 @@ BSTree.prototype = {
}
}
}
return null;
return null;
},
// Builds an "in order" array of the list's nodes (eg [1,2,3,4...])
traverseInOrder: function(inOrdArray, cNode) {
traverseInOrder: function(inOrdArray, cNode) {
if(cNode !== undefined) {
this.traverseInOrder(inOrdArray, cNode.left);
inOrdArray.push(cNode);
Expand Down
16 changes: 8 additions & 8 deletions code/binary_tree/bin_tree/spec/spec.core.js
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
/*
------------------------- Binary Search Tree -------------------------
------------------------- Binary Search Tree -------------------------

NOTE: This is about the simplest Binary Search Tree we could make. It does NOT implement deletion
NOTE: This is about the simplest Binary Search Tree we could make. It does NOT implement deletion
which is rather complex. However, Zakas has a series of articles online (part II does the deletiation part):
http://www.nczonline.net/blog/2009/06/16/computer-science-in-javascript-binary-search-tree-part-2/
http://www.nczonline.net/blog/2009/06/09/computer-science-in-javascript-binary-search-tree-part-1/
Expand DownExpand Up@@ -40,7 +40,7 @@ the root. If we assume the root is Level 0, its children will be Level 1, its gr
will be Level 2, and so on.

-- Keys: We’ve seen that one data item in an object is usually designated a key value. This
value is used to search for the item or perform other operations on it.
value is used to search for the item or perform other operations on it.

-- Binary Trees: If every node in a tree can have at most two children, the tree is called a binary
tree.
Expand All@@ -64,10 +64,10 @@ describe 'Binary Search Tree'
tree = new BSTree(root)
tree.addNode(leftChild)
tree.addNode(rightChild)
end
end
it 'should create a node2 with left and right nodes'
// Node should be as initialized data, left/right null
node2.data.should.be 222
node2.data.should.be 222
node2['left'].should.be_null
node2['right'].should.be_null
// After assignment, left/right should be as assigned
Expand DownExpand Up@@ -104,8 +104,8 @@ describe 'Binary Search Tree'
tree.find(10).id.should.equal 10
tree.find(16).id.should.equal 16
tree.find(17).id.should.equal 17
tree.find(888).should.be_null
tree.find('abc').should.be_null
tree.find(888).should.be_null
tree.find('abc').should.be_null
end
it 'should add and find nodes even if negative numbers'
var negNode = new Node(-10)
Expand All@@ -115,7 +115,7 @@ describe 'Binary Search Tree'
it 'should traverse in order and return in order array'
var llGrandChild = new Node(5,5)
tree.addNode(llGrandChild)
var inOrderArray = tree.traverseInOrder([], root)
var inOrderArray = tree.traverseInOrder([], root)
inOrderArray[0].id.should.equal llGrandChild.id
inOrderArray[1].id.should.equal leftChild.id
inOrderArray[2].id.should.equal root.id
Expand Down
2 changes: 1 addition & 1 deletion code/gotchas/README.rdoc
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@

Description

== License
== License

(The MIT License)

Expand Down
4 changes: 2 additions & 2 deletions code/gotchas/lib/gotchas.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,8 +17,8 @@ var privileged_singleton = function() {
var obj = SomeObject;
obj.publicVar = 'this is public';
obj.publicFunc = function() {
var message = 'publicFunc is privileged, and hereby allows you to see private var: ' +
privateVar + ', as well as see the return value of privateFunc: ' + privateFunc();
var message = 'publicFunc is privileged, and hereby allows you to see private var: ' +
privateVar + ', as well as see the return value of privateFunc: ' + privateFunc();
return message;
};
return obj;
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions Firebug Usage/fb_debug
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,8 +17,8 @@
<link rel="search" type="application/opensearchdescription+xml" title="Mozilla Add-ons"
href="/AMOSearch.xml" />

<link rel="stylesheet" type="text/css" href="/css/amo2009/style.min.css?52492" media="all" />

<link rel="stylesheet" type="text/css" href="/css/amo2009/style.min.css?52492" media="all" />
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="/css/amo2009/ie.css" media="screen,projection,tv" /> <![endif]-->
<!--[if IE 7]>
Expand DownExpand Up@@ -53,13 +53,13 @@
<li><a href="#categories">Skip to categories menu</a></li>
<li><a href="#other-apps">Skip to other applications menu</a></li>
</ul>

<div class="section">
<div id="header" role="banner">
<p id="title"><a href="/en-US/firefox/" title="Return to the Firefox Add-ons homepage">Add-ons <em>for</em> <img alt="Firefox" src="/img/amo2009/app-icons/firefox.png" /> <strong>Firefox</strong></a></p>
<p id="brand"><a href="http://www.mozilla.com/en-US/" title="Mozilla" accesskey="1">Mozilla</a></p>


<div id="aux-nav" role="navigation">
<ul id="other-apps" class="change" title="Find add-ons for other applications">
<li>
Expand All@@ -80,12 +80,12 @@
</li>
</ul>


<p class="context">
<a href="/en-US/firefox/users/register">Register</a> or <a href="/en-US/firefox/users/login?to=en-US%2Ffirefox%2Faddon%2F1843">Log in</a> </p>
</div>
</div>


<div class="stand-alone-options">
<div id="categories" class="categories">
Expand DownExpand Up@@ -154,7 +154,7 @@
</li>
</ul>
</div>

<div class="search-form expanded-search-form">
<form method="get" action="/en-US/firefox/search" id="search-form">
<div class="basic" id="search-query">
Expand All@@ -180,7 +180,7 @@
<option value="1,92">Toolbars</option>
<option value="1,4">Web Development</option>
<option value="1,73">Other</option>

<option class="cat-all" value="collections">all collections</option>
</select>
<button type="submit"><img src="/img/amo2009/blank.gif" alt="Search for add-ons"/></button>
Expand DownExpand Up@@ -295,7 +295,7 @@ versions[60] = {"0.1": "0.1", "0.7": "0.7", "1.0": "1.0", 'Any' : 'any' };

default_low = ( ('' == '-1' || '' == '') && current_app_id == 1) ? low_appversion : 'any';


$("#lver-td input").remove();

var verArr = versions[1];
Expand DownExpand Up@@ -334,7 +334,7 @@ versions[60] = {"0.1": "0.1", "0.7": "0.7", "1.0": "1.0", 'Any' : 'any' };
return true;
});


$(document).ready(function() {
var q = $("#query");
var l = $("#search-query label[for=query]");
Expand DownExpand Up@@ -406,15 +406,15 @@ Firebug 1.4 requires Firefox 3.0 or higher. </p>
<script type="text/javascript">
installVersusDownloadCheck("installTrigger65631-79ab13a7", "Add to Firefox ", "Download Now ");
</script>

<strong>recommended</strong>
</div>

<script type="text/javascript">setTimeout(function() {initExpConfirm('79554-79ab13a7');fixPlatformLinks('79554-79ab13a7', 'Firebug');addCompatibilityHints('1843', '79554-79ab13a7', '3.0', '3.5.*', '');},0);</script>

</div>


<table summary="Add-on Information">
<tbody>
<tr>
Expand DownExpand Up@@ -469,7 +469,7 @@ Firebug 1.4 requires Firefox 3.0 or higher. </p>
<a class="screenshot thumbnail" rel="lightbox" href="/en-US/firefox/images/p/9486/" title="">
<img alt="" src="/en-US/firefox/images/t/9486/" />
</a>

<div class="share-this">
<a class="share" href="#">Share this Add-on</a>
<div class="share-networks">
Expand DownExpand Up@@ -525,11 +525,11 @@ Visit the Firebug website for documentation, screen shots, and discussion forums
href="/en-US/firefox/images/p/11828/" title="Network">
<img src="/en-US/firefox/images/t/11828/" alt="" />
</a>

<h4>Support</h4>
<p>
Support for this add-on is provided by the developer at <a href="http://groups.google.com/group/firebug/topics" >http://groups.google.com/group/firebug/topics</a> </p>

<h4>Developer Comments</h4>
<p >
If you have any problems, please read the FireBug FAQ.<br />
Expand DownExpand Up@@ -572,15 +572,15 @@ I can&#039;t even think of working without this !</p>
See all 681 reviews of this add-on </a>
</p>
</div>


<h3>What do you think?</h3>
<div id="review-box" class="highlight">
<p>Please <a href="/en-US/firefox/users/login?to=en-US%2Ffirefox%2Faddon%2F1843">log in</a> to submit a review</p>

<form class="addon-feedback" method="post"
action="/en-US/firefox/reviews/add/1843">

<div class="container">
<label for="review">Review</label>
<textarea name="data[Review][body]" id="review" disabled="disabled" cols="30" rows="6"></textarea>
Expand DownExpand Up@@ -610,7 +610,7 @@ I can&#039;t even think of working without this !</p>
Detailed Review </a>
</p>
</div> <!-- highlight -->

<h3>Release Notes</h3>
<div class="article">
<a href="/en-US/firefox/addons/versions/1843#version-1.4.3" title="Permanent link to this version">Version 1.4.3</a> <span title="September 29, 2009, 11:35 AM">&mdash;
Expand All@@ -619,15 +619,15 @@ I can&#039;t even think of working without this !</p>
<br />
Replaced &quot;Off for All Web Pages&quot; with &quot;Clear Activation List&quot;. </p>


<ul class="further-navigation">
<li>
<a href="/en-US/firefox/addons/versions/1843">
View Older Versions </a>
</li>
</ul>
</div> <!-- Release Notes -->

</div> <!-- primary -->

<div class="secondary" role="secondary">
Expand DownExpand Up@@ -701,7 +701,7 @@ Replaced &quot;Off for All Web Pages&quot; with &quot;Clear Activation List&quot
</form>
</div>

<a href="/en-US/firefox/users/register">Register</a> or <a href="/en-US/firefox/users/login?to=en-US%2Ffirefox%2Faddon%2F1843">Log in</a> to add tags
<a href="/en-US/firefox/users/register">Register</a> or <a href="/en-US/firefox/users/login?to=en-US%2Ffirefox%2Faddon%2F1843">Log in</a> to add tags
</div>
<!-- /.highlight-->

Expand DownExpand Up@@ -730,7 +730,7 @@ Replaced &quot;Off for All Web Pages&quot; with &quot;Clear Activation List&quot
</li>
</ul>
</div>

<div class="collections-add">
<h3 class="compact-bottom">Related Collections</h3>

Expand DownExpand Up@@ -824,7 +824,7 @@ Replaced &quot;Off for All Web Pages&quot; with &quot;Clear Activation List&quot
<button type="submit">Go</button>
</div>
</form>

<p><strong>Copyright <span title="pm-app-amo15.mozilla.org">&#169;</span> 2005&#8211;2009 Mozilla.</strong> All rights reserved.</p>
<ul>
<li><a href="/en-US/firefox/pages/privacy" >Privacy Policy</a></li>
Expand Down
12 changes: 6 additions & 6 deletions README
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
=============================
Test Driving JavaScript Book
Test Driving JavaScript Book
=============================
This is the source code and actual book in open office formate (.odt), Test Driving JavaScript (aka TD JavaScript). It is licensed under the Creative Commons Attribution-Non Commercial-Share Alike 3.0 license. http://creativecommons.org/licenses/by-sa/3.0/us/

This is the source code and actual book in open office formate (.odt), Test Driving JavaScript (aka TD JavaScript). It is licensed under the Creative Commons Attribution-Non Commercial-Share Alike 3.0 license. http://creativecommons.org/licenses/by-sa/3.0/us/

Contributors
=====================
I am interested in contributors that may have relevant experience, information, that I am not already supplying. For example, here are some possible topics/chapters that would probably improve the book:
- IE specific debugging via the IE8 JavaScript debugger would be a great addition.
- Integration with a continuous integration system.
Note that the goal of the book is to be short and sweet so contributions will need to be to the point. Given that the main document is currently using Open Office, I'd ask that contributions come in that form. I still need to research merging a .odt document, so I'm still unsure of how to go about patches/contributions (in that regard). Please email me if you're serious about contributing.
Note that the goal of the book is to be short and sweet so contributions will need to be to the point. Given that the main document is currently using Open Office, I'd ask that contributions come in that form. I still need to research merging a .odt document, so I'm still unsure of how to go about patches/contributions (in that regard). Please email me if you're serious about contributing.

Errata
=====================
If you find any technical mistakes and/or parts of the book that are in need of correction,
please email me at roblevintennis at gmail dot com to inform me.
please email me at roblevintennis at gmail dot com to inform me.

Binary file modifiedTDD JavaScript.odt
Binary file not shown.
2 changes: 1 addition & 1 deletion code/5_min_drill/README.rdoc
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@

Description

== License
== License

(The MIT License)

Expand Down
4 changes: 2 additions & 2 deletions code/5_min_drill/lib/test_js_itself.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,12 +3,12 @@ JSTest.prototype = {
constructor: JSTest,
switchTest : function(c) {
switch(c) {
case 0:
case 0:
return "zero";
break;
case 1:
return "one";
break;
break;
case "no break case":
// do nothing...testing fall through
case "next case":
Expand Down
10 changes: 5 additions & 5 deletions code/5_min_drill/spec/spec.test_js_itself.js
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
describe 'TestJsItself'
before_each
jsTest = new JSTest
before_each
jsTest = new JSTest
arr = jsTest.arrayTest()
end
end
describe '.switchTest()'
it 'should return corresponding case primitive int as a string'
jsTest.switchTest(1).should.eql "one"
jsTest.switchTest(1).should.eql "one"
end
it 'should fall through to next case when omitting a break'
jsTest.switchTest("no break case").should.eql "next case"
Expand All@@ -16,7 +16,7 @@ describe 'TestJsItself'
(typeof arr == 'object').should.eql true
end
it 'should use zero based indexing'
arr[1].should.eql 2
arr[1].should.eql 2
end
end
end
2 changes: 1 addition & 1 deletion code/binary_tree/bin_tree/README.rdoc
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@

Description

== License
== License

(The MIT License)

Expand Down
6 changes: 3 additions & 3 deletions code/binary_tree/bin_tree/lib/yourlib.core.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,7 +10,7 @@ function BSTree(n) {
this.root = n;
};
BSTree.prototype = {
// Essentially have to go past node it should be connected to
// Essentially have to go past node it should be connected to
// looking for undefined, so we always need pointer to parent node
addNode: function(node) {
var current = this.root;
Expand DownExpand Up@@ -45,10 +45,10 @@ BSTree.prototype = {
}
}
}
return null;
return null;
},
// Builds an "in order" array of the list's nodes (eg [1,2,3,4...])
traverseInOrder: function(inOrdArray, cNode) {
traverseInOrder: function(inOrdArray, cNode) {
if(cNode !== undefined) {
this.traverseInOrder(inOrdArray, cNode.left);
inOrdArray.push(cNode);
Expand Down
16 changes: 8 additions & 8 deletions code/binary_tree/bin_tree/spec/spec.core.js
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
/*
------------------------- Binary Search Tree -------------------------
------------------------- Binary Search Tree -------------------------

NOTE: This is about the simplest Binary Search Tree we could make. It does NOT implement deletion
NOTE: This is about the simplest Binary Search Tree we could make. It does NOT implement deletion
which is rather complex. However, Zakas has a series of articles online (part II does the deletiation part):
http://www.nczonline.net/blog/2009/06/16/computer-science-in-javascript-binary-search-tree-part-2/
http://www.nczonline.net/blog/2009/06/09/computer-science-in-javascript-binary-search-tree-part-1/
Expand DownExpand Up@@ -40,7 +40,7 @@ the root. If we assume the root is Level 0, its children will be Level 1, its gr
will be Level 2, and so on.

-- Keys: We’ve seen that one data item in an object is usually designated a key value. This
value is used to search for the item or perform other operations on it.
value is used to search for the item or perform other operations on it.

-- Binary Trees: If every node in a tree can have at most two children, the tree is called a binary
tree.
Expand All@@ -64,10 +64,10 @@ describe 'Binary Search Tree'
tree = new BSTree(root)
tree.addNode(leftChild)
tree.addNode(rightChild)
end
end
it 'should create a node2 with left and right nodes'
// Node should be as initialized data, left/right null
node2.data.should.be 222
node2.data.should.be 222
node2['left'].should.be_null
node2['right'].should.be_null
// After assignment, left/right should be as assigned
Expand DownExpand Up@@ -104,8 +104,8 @@ describe 'Binary Search Tree'
tree.find(10).id.should.equal 10
tree.find(16).id.should.equal 16
tree.find(17).id.should.equal 17
tree.find(888).should.be_null
tree.find('abc').should.be_null
tree.find(888).should.be_null
tree.find('abc').should.be_null
end
it 'should add and find nodes even if negative numbers'
var negNode = new Node(-10)
Expand All@@ -115,7 +115,7 @@ describe 'Binary Search Tree'
it 'should traverse in order and return in order array'
var llGrandChild = new Node(5,5)
tree.addNode(llGrandChild)
var inOrderArray = tree.traverseInOrder([], root)
var inOrderArray = tree.traverseInOrder([], root)
inOrderArray[0].id.should.equal llGrandChild.id
inOrderArray[1].id.should.equal leftChild.id
inOrderArray[2].id.should.equal root.id
Expand Down
2 changes: 1 addition & 1 deletion code/gotchas/README.rdoc
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@

Description

== License
== License

(The MIT License)

Expand Down
4 changes: 2 additions & 2 deletions code/gotchas/lib/gotchas.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,8 +17,8 @@ var privileged_singleton = function() {
var obj = SomeObject;
obj.publicVar = 'this is public';
obj.publicFunc = function() {
var message = 'publicFunc is privileged, and hereby allows you to see private var: ' +
privateVar + ', as well as see the return value of privateFunc: ' + privateFunc();
var message = 'publicFunc is privileged, and hereby allows you to see private var: ' +
privateVar + ', as well as see the return value of privateFunc: ' + privateFunc();
return message;
};
return obj;
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions Firebug Usage/fb_debug
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,8 +17,8 @@
<link rel="search" type="application/opensearchdescription+xml" title="Mozilla Add-ons"
href="/AMOSearch.xml" />

<link rel="stylesheet" type="text/css" href="/css/amo2009/style.min.css?52492" media="all" />

<link rel="stylesheet" type="text/css" href="/css/amo2009/style.min.css?52492" media="all" />
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="/css/amo2009/ie.css" media="screen,projection,tv" /> <![endif]-->
<!--[if IE 7]>
Expand DownExpand Up@@ -53,13 +53,13 @@
<li><a href="#categories">Skip to categories menu</a></li>
<li><a href="#other-apps">Skip to other applications menu</a></li>
</ul>

<div class="section">
<div id="header" role="banner">
<p id="title"><a href="/en-US/firefox/" title="Return to the Firefox Add-ons homepage">Add-ons <em>for</em> <img alt="Firefox" src="/img/amo2009/app-icons/firefox.png" /> <strong>Firefox</strong></a></p>
<p id="brand"><a href="http://www.mozilla.com/en-US/" title="Mozilla" accesskey="1">Mozilla</a></p>


<div id="aux-nav" role="navigation">
<ul id="other-apps" class="change" title="Find add-ons for other applications">
<li>
Expand All@@ -80,12 +80,12 @@
</li>
</ul>


<p class="context">
<a href="/en-US/firefox/users/register">Register</a> or <a href="/en-US/firefox/users/login?to=en-US%2Ffirefox%2Faddon%2F1843">Log in</a> </p>
</div>
</div>


<div class="stand-alone-options">
<div id="categories" class="categories">
Expand DownExpand Up@@ -154,7 +154,7 @@
</li>
</ul>
</div>

<div class="search-form expanded-search-form">
<form method="get" action="/en-US/firefox/search" id="search-form">
<div class="basic" id="search-query">
Expand All@@ -180,7 +180,7 @@
<option value="1,92">Toolbars</option>
<option value="1,4">Web Development</option>
<option value="1,73">Other</option>

<option class="cat-all" value="collections">all collections</option>
</select>
<button type="submit"><img src="/img/amo2009/blank.gif" alt="Search for add-ons"/></button>
Expand DownExpand Up@@ -295,7 +295,7 @@ versions[60] = {"0.1": "0.1", "0.7": "0.7", "1.0": "1.0", 'Any' : 'any' };

default_low = ( ('' == '-1' || '' == '') && current_app_id == 1) ? low_appversion : 'any';


$("#lver-td input").remove();

var verArr = versions[1];
Expand DownExpand Up@@ -334,7 +334,7 @@ versions[60] = {"0.1": "0.1", "0.7": "0.7", "1.0": "1.0", 'Any' : 'any' };
return true;
});


$(document).ready(function() {
var q = $("#query");
var l = $("#search-query label[for=query]");
Expand DownExpand Up@@ -406,15 +406,15 @@ Firebug 1.4 requires Firefox 3.0 or higher. </p>
<script type="text/javascript">
installVersusDownloadCheck("installTrigger65631-79ab13a7", "Add to Firefox ", "Download Now ");
</script>

<strong>recommended</strong>
</div>

<script type="text/javascript">setTimeout(function() {initExpConfirm('79554-79ab13a7');fixPlatformLinks('79554-79ab13a7', 'Firebug');addCompatibilityHints('1843', '79554-79ab13a7', '3.0', '3.5.*', '');},0);</script>

</div>


<table summary="Add-on Information">
<tbody>
<tr>
Expand DownExpand Up@@ -469,7 +469,7 @@ Firebug 1.4 requires Firefox 3.0 or higher. </p>
<a class="screenshot thumbnail" rel="lightbox" href="/en-US/firefox/images/p/9486/" title="">
<img alt="" src="/en-US/firefox/images/t/9486/" />
</a>

<div class="share-this">
<a class="share" href="#">Share this Add-on</a>
<div class="share-networks">
Expand DownExpand Up@@ -525,11 +525,11 @@ Visit the Firebug website for documentation, screen shots, and discussion forums
href="/en-US/firefox/images/p/11828/" title="Network">
<img src="/en-US/firefox/images/t/11828/" alt="" />
</a>

<h4>Support</h4>
<p>
Support for this add-on is provided by the developer at <a href="http://groups.google.com/group/firebug/topics" >http://groups.google.com/group/firebug/topics</a> </p>

<h4>Developer Comments</h4>
<p >
If you have any problems, please read the FireBug FAQ.<br />
Expand DownExpand Up@@ -572,15 +572,15 @@ I can&#039;t even think of working without this !</p>
See all 681 reviews of this add-on </a>
</p>
</div>


<h3>What do you think?</h3>
<div id="review-box" class="highlight">
<p>Please <a href="/en-US/firefox/users/login?to=en-US%2Ffirefox%2Faddon%2F1843">log in</a> to submit a review</p>

<form class="addon-feedback" method="post"
action="/en-US/firefox/reviews/add/1843">

<div class="container">
<label for="review">Review</label>
<textarea name="data[Review][body]" id="review" disabled="disabled" cols="30" rows="6"></textarea>
Expand DownExpand Up@@ -610,7 +610,7 @@ I can&#039;t even think of working without this !</p>
Detailed Review </a>
</p>
</div> <!-- highlight -->

<h3>Release Notes</h3>
<div class="article">
<a href="/en-US/firefox/addons/versions/1843#version-1.4.3" title="Permanent link to this version">Version 1.4.3</a> <span title="September 29, 2009, 11:35 AM">&mdash;
Expand All@@ -619,15 +619,15 @@ I can&#039;t even think of working without this !</p>
<br />
Replaced &quot;Off for All Web Pages&quot; with &quot;Clear Activation List&quot;. </p>


<ul class="further-navigation">
<li>
<a href="/en-US/firefox/addons/versions/1843">
View Older Versions </a>
</li>
</ul>
</div> <!-- Release Notes -->

</div> <!-- primary -->

<div class="secondary" role="secondary">
Expand DownExpand Up@@ -701,7 +701,7 @@ Replaced &quot;Off for All Web Pages&quot; with &quot;Clear Activation List&quot
</form>
</div>

<a href="/en-US/firefox/users/register">Register</a> or <a href="/en-US/firefox/users/login?to=en-US%2Ffirefox%2Faddon%2F1843">Log in</a> to add tags
<a href="/en-US/firefox/users/register">Register</a> or <a href="/en-US/firefox/users/login?to=en-US%2Ffirefox%2Faddon%2F1843">Log in</a> to add tags
</div>
<!-- /.highlight-->

Expand DownExpand Up@@ -730,7 +730,7 @@ Replaced &quot;Off for All Web Pages&quot; with &quot;Clear Activation List&quot
</li>
</ul>
</div>

<div class="collections-add">
<h3 class="compact-bottom">Related Collections</h3>

Expand DownExpand Up@@ -824,7 +824,7 @@ Replaced &quot;Off for All Web Pages&quot; with &quot;Clear Activation List&quot
<button type="submit">Go</button>
</div>
</form>

<p><strong>Copyright <span title="pm-app-amo15.mozilla.org">&#169;</span> 2005&#8211;2009 Mozilla.</strong> All rights reserved.</p>
<ul>
<li><a href="/en-US/firefox/pages/privacy" >Privacy Policy</a></li>
Expand Down
12 changes: 6 additions & 6 deletions README
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
=============================
Test Driving JavaScript Book
Test Driving JavaScript Book
=============================
This is the source code and actual book in open office formate (.odt), Test Driving JavaScript (aka TD JavaScript). It is licensed under the Creative Commons Attribution-Non Commercial-Share Alike 3.0 license. http://creativecommons.org/licenses/by-sa/3.0/us/

This is the source code and actual book in open office formate (.odt), Test Driving JavaScript (aka TD JavaScript). It is licensed under the Creative Commons Attribution-Non Commercial-Share Alike 3.0 license. http://creativecommons.org/licenses/by-sa/3.0/us/

Contributors
=====================
I am interested in contributors that may have relevant experience, information, that I am not already supplying. For example, here are some possible topics/chapters that would probably improve the book:
- IE specific debugging via the IE8 JavaScript debugger would be a great addition.
- Integration with a continuous integration system.
Note that the goal of the book is to be short and sweet so contributions will need to be to the point. Given that the main document is currently using Open Office, I'd ask that contributions come in that form. I still need to research merging a .odt document, so I'm still unsure of how to go about patches/contributions (in that regard). Please email me if you're serious about contributing.
Note that the goal of the book is to be short and sweet so contributions will need to be to the point. Given that the main document is currently using Open Office, I'd ask that contributions come in that form. I still need to research merging a .odt document, so I'm still unsure of how to go about patches/contributions (in that regard). Please email me if you're serious about contributing.

Errata
=====================
If you find any technical mistakes and/or parts of the book that are in need of correction,
please email me at roblevintennis at gmail dot com to inform me.
please email me at roblevintennis at gmail dot com to inform me.

Binary file modifiedTDD JavaScript.odt
Binary file not shown.
2 changes: 1 addition & 1 deletion code/5_min_drill/README.rdoc
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@

Description

== License
== License

(The MIT License)

Expand Down
4 changes: 2 additions & 2 deletions code/5_min_drill/lib/test_js_itself.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,12 +3,12 @@ JSTest.prototype = {
constructor: JSTest,
switchTest : function(c) {
switch(c) {
case 0:
case 0:
return "zero";
break;
case 1:
return "one";
break;
break;
case "no break case":
// do nothing...testing fall through
case "next case":
Expand Down
10 changes: 5 additions & 5 deletions code/5_min_drill/spec/spec.test_js_itself.js
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
describe 'TestJsItself'
before_each
jsTest = new JSTest
before_each
jsTest = new JSTest
arr = jsTest.arrayTest()
end
end
describe '.switchTest()'
it 'should return corresponding case primitive int as a string'
jsTest.switchTest(1).should.eql "one"
jsTest.switchTest(1).should.eql "one"
end
it 'should fall through to next case when omitting a break'
jsTest.switchTest("no break case").should.eql "next case"
Expand All@@ -16,7 +16,7 @@ describe 'TestJsItself'
(typeof arr == 'object').should.eql true
end
it 'should use zero based indexing'
arr[1].should.eql 2
arr[1].should.eql 2
end
end
end
2 changes: 1 addition & 1 deletion code/binary_tree/bin_tree/README.rdoc
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@

Description

== License
== License

(The MIT License)

Expand Down
6 changes: 3 additions & 3 deletions code/binary_tree/bin_tree/lib/yourlib.core.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,7 +10,7 @@ function BSTree(n) {
this.root = n;
};
BSTree.prototype = {
// Essentially have to go past node it should be connected to
// Essentially have to go past node it should be connected to
// looking for undefined, so we always need pointer to parent node
addNode: function(node) {
var current = this.root;
Expand DownExpand Up@@ -45,10 +45,10 @@ BSTree.prototype = {
}
}
}
return null;
return null;
},
// Builds an "in order" array of the list's nodes (eg [1,2,3,4...])
traverseInOrder: function(inOrdArray, cNode) {
traverseInOrder: function(inOrdArray, cNode) {
if(cNode !== undefined) {
this.traverseInOrder(inOrdArray, cNode.left);
inOrdArray.push(cNode);
Expand Down
16 changes: 8 additions & 8 deletions code/binary_tree/bin_tree/spec/spec.core.js
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
/*
------------------------- Binary Search Tree -------------------------
------------------------- Binary Search Tree -------------------------

NOTE: This is about the simplest Binary Search Tree we could make. It does NOT implement deletion
NOTE: This is about the simplest Binary Search Tree we could make. It does NOT implement deletion
which is rather complex. However, Zakas has a series of articles online (part II does the deletiation part):
http://www.nczonline.net/blog/2009/06/16/computer-science-in-javascript-binary-search-tree-part-2/
http://www.nczonline.net/blog/2009/06/09/computer-science-in-javascript-binary-search-tree-part-1/
Expand DownExpand Up@@ -40,7 +40,7 @@ the root. If we assume the root is Level 0, its children will be Level 1, its gr
will be Level 2, and so on.

-- Keys: We’ve seen that one data item in an object is usually designated a key value. This
value is used to search for the item or perform other operations on it.
value is used to search for the item or perform other operations on it.

-- Binary Trees: If every node in a tree can have at most two children, the tree is called a binary
tree.
Expand All@@ -64,10 +64,10 @@ describe 'Binary Search Tree'
tree = new BSTree(root)
tree.addNode(leftChild)
tree.addNode(rightChild)
end
end
it 'should create a node2 with left and right nodes'
// Node should be as initialized data, left/right null
node2.data.should.be 222
node2.data.should.be 222
node2['left'].should.be_null
node2['right'].should.be_null
// After assignment, left/right should be as assigned
Expand DownExpand Up@@ -104,8 +104,8 @@ describe 'Binary Search Tree'
tree.find(10).id.should.equal 10
tree.find(16).id.should.equal 16
tree.find(17).id.should.equal 17
tree.find(888).should.be_null
tree.find('abc').should.be_null
tree.find(888).should.be_null
tree.find('abc').should.be_null
end
it 'should add and find nodes even if negative numbers'
var negNode = new Node(-10)
Expand All@@ -115,7 +115,7 @@ describe 'Binary Search Tree'
it 'should traverse in order and return in order array'
var llGrandChild = new Node(5,5)
tree.addNode(llGrandChild)
var inOrderArray = tree.traverseInOrder([], root)
var inOrderArray = tree.traverseInOrder([], root)
inOrderArray[0].id.should.equal llGrandChild.id
inOrderArray[1].id.should.equal leftChild.id
inOrderArray[2].id.should.equal root.id
Expand Down
2 changes: 1 addition & 1 deletion code/gotchas/README.rdoc
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@

Description

== License
== License

(The MIT License)

Expand Down
4 changes: 2 additions & 2 deletions code/gotchas/lib/gotchas.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,8 +17,8 @@ var privileged_singleton = function() {
var obj = SomeObject;
obj.publicVar = 'this is public';
obj.publicFunc = function() {
var message = 'publicFunc is privileged, and hereby allows you to see private var: ' +
privateVar + ', as well as see the return value of privateFunc: ' + privateFunc();
var message = 'publicFunc is privileged, and hereby allows you to see private var: ' +
privateVar + ', as well as see the return value of privateFunc: ' + privateFunc();
return message;
};
return obj;
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions Firebug Usage/fb_debug
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,8 +17,8 @@
<link rel="search" type="application/opensearchdescription+xml" title="Mozilla Add-ons"
href="/AMOSearch.xml" />

<link rel="stylesheet" type="text/css" href="/css/amo2009/style.min.css?52492" media="all" />

<link rel="stylesheet" type="text/css" href="/css/amo2009/style.min.css?52492" media="all" />
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="/css/amo2009/ie.css" media="screen,projection,tv" /> <![endif]-->
<!--[if IE 7]>
Expand DownExpand Up@@ -53,13 +53,13 @@
<li><a href="#categories">Skip to categories menu</a></li>
<li><a href="#other-apps">Skip to other applications menu</a></li>
</ul>

<div class="section">
<div id="header" role="banner">
<p id="title"><a href="/en-US/firefox/" title="Return to the Firefox Add-ons homepage">Add-ons <em>for</em> <img alt="Firefox" src="/img/amo2009/app-icons/firefox.png" /> <strong>Firefox</strong></a></p>
<p id="brand"><a href="http://www.mozilla.com/en-US/" title="Mozilla" accesskey="1">Mozilla</a></p>


<div id="aux-nav" role="navigation">
<ul id="other-apps" class="change" title="Find add-ons for other applications">
<li>
Expand All@@ -80,12 +80,12 @@
</li>
</ul>


<p class="context">
<a href="/en-US/firefox/users/register">Register</a> or <a href="/en-US/firefox/users/login?to=en-US%2Ffirefox%2Faddon%2F1843">Log in</a> </p>
</div>
</div>


<div class="stand-alone-options">
<div id="categories" class="categories">
Expand DownExpand Up@@ -154,7 +154,7 @@
</li>
</ul>
</div>

<div class="search-form expanded-search-form">
<form method="get" action="/en-US/firefox/search" id="search-form">
<div class="basic" id="search-query">
Expand All@@ -180,7 +180,7 @@
<option value="1,92">Toolbars</option>
<option value="1,4">Web Development</option>
<option value="1,73">Other</option>

<option class="cat-all" value="collections">all collections</option>
</select>
<button type="submit"><img src="/img/amo2009/blank.gif" alt="Search for add-ons"/></button>
Expand DownExpand Up@@ -295,7 +295,7 @@ versions[60] = {"0.1": "0.1", "0.7": "0.7", "1.0": "1.0", 'Any' : 'any' };

default_low = ( ('' == '-1' || '' == '') && current_app_id == 1) ? low_appversion : 'any';


$("#lver-td input").remove();

var verArr = versions[1];
Expand DownExpand Up@@ -334,7 +334,7 @@ versions[60] = {"0.1": "0.1", "0.7": "0.7", "1.0": "1.0", 'Any' : 'any' };
return true;
});


$(document).ready(function() {
var q = $("#query");
var l = $("#search-query label[for=query]");
Expand DownExpand Up@@ -406,15 +406,15 @@ Firebug 1.4 requires Firefox 3.0 or higher. </p>
<script type="text/javascript">
installVersusDownloadCheck("installTrigger65631-79ab13a7", "Add to Firefox ", "Download Now ");
</script>

<strong>recommended</strong>
</div>

<script type="text/javascript">setTimeout(function() {initExpConfirm('79554-79ab13a7');fixPlatformLinks('79554-79ab13a7', 'Firebug');addCompatibilityHints('1843', '79554-79ab13a7', '3.0', '3.5.*', '');},0);</script>

</div>


<table summary="Add-on Information">
<tbody>
<tr>
Expand DownExpand Up@@ -469,7 +469,7 @@ Firebug 1.4 requires Firefox 3.0 or higher. </p>
<a class="screenshot thumbnail" rel="lightbox" href="/en-US/firefox/images/p/9486/" title="">
<img alt="" src="/en-US/firefox/images/t/9486/" />
</a>

<div class="share-this">
<a class="share" href="#">Share this Add-on</a>
<div class="share-networks">
Expand DownExpand Up@@ -525,11 +525,11 @@ Visit the Firebug website for documentation, screen shots, and discussion forums
href="/en-US/firefox/images/p/11828/" title="Network">
<img src="/en-US/firefox/images/t/11828/" alt="" />
</a>

<h4>Support</h4>
<p>
Support for this add-on is provided by the developer at <a href="http://groups.google.com/group/firebug/topics" >http://groups.google.com/group/firebug/topics</a> </p>

<h4>Developer Comments</h4>
<p >
If you have any problems, please read the FireBug FAQ.<br />
Expand DownExpand Up@@ -572,15 +572,15 @@ I can&#039;t even think of working without this !</p>
See all 681 reviews of this add-on </a>
</p>
</div>


<h3>What do you think?</h3>
<div id="review-box" class="highlight">
<p>Please <a href="/en-US/firefox/users/login?to=en-US%2Ffirefox%2Faddon%2F1843">log in</a> to submit a review</p>

<form class="addon-feedback" method="post"
action="/en-US/firefox/reviews/add/1843">

<div class="container">
<label for="review">Review</label>
<textarea name="data[Review][body]" id="review" disabled="disabled" cols="30" rows="6"></textarea>
Expand DownExpand Up@@ -610,7 +610,7 @@ I can&#039;t even think of working without this !</p>
Detailed Review </a>
</p>
</div> <!-- highlight -->

<h3>Release Notes</h3>
<div class="article">
<a href="/en-US/firefox/addons/versions/1843#version-1.4.3" title="Permanent link to this version">Version 1.4.3</a> <span title="September 29, 2009, 11:35 AM">&mdash;
Expand All@@ -619,15 +619,15 @@ I can&#039;t even think of working without this !</p>
<br />
Replaced &quot;Off for All Web Pages&quot; with &quot;Clear Activation List&quot;. </p>


<ul class="further-navigation">
<li>
<a href="/en-US/firefox/addons/versions/1843">
View Older Versions </a>
</li>
</ul>
</div> <!-- Release Notes -->

</div> <!-- primary -->

<div class="secondary" role="secondary">
Expand DownExpand Up@@ -701,7 +701,7 @@ Replaced &quot;Off for All Web Pages&quot; with &quot;Clear Activation List&quot
</form>
</div>

<a href="/en-US/firefox/users/register">Register</a> or <a href="/en-US/firefox/users/login?to=en-US%2Ffirefox%2Faddon%2F1843">Log in</a> to add tags
<a href="/en-US/firefox/users/register">Register</a> or <a href="/en-US/firefox/users/login?to=en-US%2Ffirefox%2Faddon%2F1843">Log in</a> to add tags
</div>
<!-- /.highlight-->

Expand DownExpand Up@@ -730,7 +730,7 @@ Replaced &quot;Off for All Web Pages&quot; with &quot;Clear Activation List&quot
</li>
</ul>
</div>

<div class="collections-add">
<h3 class="compact-bottom">Related Collections</h3>

Expand DownExpand Up@@ -824,7 +824,7 @@ Replaced &quot;Off for All Web Pages&quot; with &quot;Clear Activation List&quot
<button type="submit">Go</button>
</div>
</form>

<p><strong>Copyright <span title="pm-app-amo15.mozilla.org">&#169;</span> 2005&#8211;2009 Mozilla.</strong> All rights reserved.</p>
<ul>
<li><a href="/en-US/firefox/pages/privacy" >Privacy Policy</a></li>
Expand Down
12 changes: 6 additions & 6 deletions README
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
=============================
Test Driving JavaScript Book
Test Driving JavaScript Book
=============================
This is the source code and actual book in open office formate (.odt), Test Driving JavaScript (aka TD JavaScript). It is licensed under the Creative Commons Attribution-Non Commercial-Share Alike 3.0 license. http://creativecommons.org/licenses/by-sa/3.0/us/

This is the source code and actual book in open office formate (.odt), Test Driving JavaScript (aka TD JavaScript). It is licensed under the Creative Commons Attribution-Non Commercial-Share Alike 3.0 license. http://creativecommons.org/licenses/by-sa/3.0/us/

Contributors
=====================
I am interested in contributors that may have relevant experience, information, that I am not already supplying. For example, here are some possible topics/chapters that would probably improve the book:
- IE specific debugging via the IE8 JavaScript debugger would be a great addition.
- Integration with a continuous integration system.
Note that the goal of the book is to be short and sweet so contributions will need to be to the point. Given that the main document is currently using Open Office, I'd ask that contributions come in that form. I still need to research merging a .odt document, so I'm still unsure of how to go about patches/contributions (in that regard). Please email me if you're serious about contributing.
Note that the goal of the book is to be short and sweet so contributions will need to be to the point. Given that the main document is currently using Open Office, I'd ask that contributions come in that form. I still need to research merging a .odt document, so I'm still unsure of how to go about patches/contributions (in that regard). Please email me if you're serious about contributing.

Errata
=====================
If you find any technical mistakes and/or parts of the book that are in need of correction,
please email me at roblevintennis at gmail dot com to inform me.
please email me at roblevintennis at gmail dot com to inform me.

Binary file modifiedTDD JavaScript.odt
Binary file not shown.
2 changes: 1 addition & 1 deletion code/5_min_drill/README.rdoc
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@

Description

== License
== License

(The MIT License)

Expand Down
4 changes: 2 additions & 2 deletions code/5_min_drill/lib/test_js_itself.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,12 +3,12 @@ JSTest.prototype = {
constructor: JSTest,
switchTest : function(c) {
switch(c) {
case 0:
case 0:
return "zero";
break;
case 1:
return "one";
break;
break;
case "no break case":
// do nothing...testing fall through
case "next case":
Expand Down
10 changes: 5 additions & 5 deletions code/5_min_drill/spec/spec.test_js_itself.js
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
describe 'TestJsItself'
before_each
jsTest = new JSTest
before_each
jsTest = new JSTest
arr = jsTest.arrayTest()
end
end
describe '.switchTest()'
it 'should return corresponding case primitive int as a string'
jsTest.switchTest(1).should.eql "one"
jsTest.switchTest(1).should.eql "one"
end
it 'should fall through to next case when omitting a break'
jsTest.switchTest("no break case").should.eql "next case"
Expand All@@ -16,7 +16,7 @@ describe 'TestJsItself'
(typeof arr == 'object').should.eql true
end
it 'should use zero based indexing'
arr[1].should.eql 2
arr[1].should.eql 2
end
end
end
2 changes: 1 addition & 1 deletion code/binary_tree/bin_tree/README.rdoc
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@

Description

== License
== License

(The MIT License)

Expand Down
6 changes: 3 additions & 3 deletions code/binary_tree/bin_tree/lib/yourlib.core.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,7 +10,7 @@ function BSTree(n) {
this.root = n;
};
BSTree.prototype = {
// Essentially have to go past node it should be connected to
// Essentially have to go past node it should be connected to
// looking for undefined, so we always need pointer to parent node
addNode: function(node) {
var current = this.root;
Expand DownExpand Up@@ -45,10 +45,10 @@ BSTree.prototype = {
}
}
}
return null;
return null;
},
// Builds an "in order" array of the list's nodes (eg [1,2,3,4...])
traverseInOrder: function(inOrdArray, cNode) {
traverseInOrder: function(inOrdArray, cNode) {
if(cNode !== undefined) {
this.traverseInOrder(inOrdArray, cNode.left);
inOrdArray.push(cNode);
Expand Down
16 changes: 8 additions & 8 deletions code/binary_tree/bin_tree/spec/spec.core.js
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
/*
------------------------- Binary Search Tree -------------------------
------------------------- Binary Search Tree -------------------------

NOTE: This is about the simplest Binary Search Tree we could make. It does NOT implement deletion
NOTE: This is about the simplest Binary Search Tree we could make. It does NOT implement deletion
which is rather complex. However, Zakas has a series of articles online (part II does the deletiation part):
http://www.nczonline.net/blog/2009/06/16/computer-science-in-javascript-binary-search-tree-part-2/
http://www.nczonline.net/blog/2009/06/09/computer-science-in-javascript-binary-search-tree-part-1/
Expand DownExpand Up@@ -40,7 +40,7 @@ the root. If we assume the root is Level 0, its children will be Level 1, its gr
will be Level 2, and so on.

-- Keys: We’ve seen that one data item in an object is usually designated a key value. This
value is used to search for the item or perform other operations on it.
value is used to search for the item or perform other operations on it.

-- Binary Trees: If every node in a tree can have at most two children, the tree is called a binary
tree.
Expand All@@ -64,10 +64,10 @@ describe 'Binary Search Tree'
tree = new BSTree(root)
tree.addNode(leftChild)
tree.addNode(rightChild)
end
end
it 'should create a node2 with left and right nodes'
// Node should be as initialized data, left/right null
node2.data.should.be 222
node2.data.should.be 222
node2['left'].should.be_null
node2['right'].should.be_null
// After assignment, left/right should be as assigned
Expand DownExpand Up@@ -104,8 +104,8 @@ describe 'Binary Search Tree'
tree.find(10).id.should.equal 10
tree.find(16).id.should.equal 16
tree.find(17).id.should.equal 17
tree.find(888).should.be_null
tree.find('abc').should.be_null
tree.find(888).should.be_null
tree.find('abc').should.be_null
end
it 'should add and find nodes even if negative numbers'
var negNode = new Node(-10)
Expand All@@ -115,7 +115,7 @@ describe 'Binary Search Tree'
it 'should traverse in order and return in order array'
var llGrandChild = new Node(5,5)
tree.addNode(llGrandChild)
var inOrderArray = tree.traverseInOrder([], root)
var inOrderArray = tree.traverseInOrder([], root)
inOrderArray[0].id.should.equal llGrandChild.id
inOrderArray[1].id.should.equal leftChild.id
inOrderArray[2].id.should.equal root.id
Expand Down
2 changes: 1 addition & 1 deletion code/gotchas/README.rdoc
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@

Description

== License
== License

(The MIT License)

Expand Down
4 changes: 2 additions & 2 deletions code/gotchas/lib/gotchas.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,8 +17,8 @@ var privileged_singleton = function() {
var obj = SomeObject;
obj.publicVar = 'this is public';
obj.publicFunc = function() {
var message = 'publicFunc is privileged, and hereby allows you to see private var: ' +
privateVar + ', as well as see the return value of privateFunc: ' + privateFunc();
var message = 'publicFunc is privileged, and hereby allows you to see private var: ' +
privateVar + ', as well as see the return value of privateFunc: ' + privateFunc();
return message;
};
return obj;
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions Firebug Usage/fb_debug
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,8 +17,8 @@
<link rel="search" type="application/opensearchdescription+xml" title="Mozilla Add-ons"
href="/AMOSearch.xml" />

<link rel="stylesheet" type="text/css" href="/css/amo2009/style.min.css?52492" media="all" />

<link rel="stylesheet" type="text/css" href="/css/amo2009/style.min.css?52492" media="all" />
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="/css/amo2009/ie.css" media="screen,projection,tv" /> <![endif]-->
<!--[if IE 7]>
Expand DownExpand Up@@ -53,13 +53,13 @@
<li><a href="#categories">Skip to categories menu</a></li>
<li><a href="#other-apps">Skip to other applications menu</a></li>
</ul>

<div class="section">
<div id="header" role="banner">
<p id="title"><a href="/en-US/firefox/" title="Return to the Firefox Add-ons homepage">Add-ons <em>for</em> <img alt="Firefox" src="/img/amo2009/app-icons/firefox.png" /> <strong>Firefox</strong></a></p>
<p id="brand"><a href="http://www.mozilla.com/en-US/" title="Mozilla" accesskey="1">Mozilla</a></p>


<div id="aux-nav" role="navigation">
<ul id="other-apps" class="change" title="Find add-ons for other applications">
<li>
Expand All@@ -80,12 +80,12 @@
</li>
</ul>


<p class="context">
<a href="/en-US/firefox/users/register">Register</a> or <a href="/en-US/firefox/users/login?to=en-US%2Ffirefox%2Faddon%2F1843">Log in</a> </p>
</div>
</div>


<div class="stand-alone-options">
<div id="categories" class="categories">
Expand DownExpand Up@@ -154,7 +154,7 @@
</li>
</ul>
</div>

<div class="search-form expanded-search-form">
<form method="get" action="/en-US/firefox/search" id="search-form">
<div class="basic" id="search-query">
Expand All@@ -180,7 +180,7 @@
<option value="1,92">Toolbars</option>
<option value="1,4">Web Development</option>
<option value="1,73">Other</option>

<option class="cat-all" value="collections">all collections</option>
</select>
<button type="submit"><img src="/img/amo2009/blank.gif" alt="Search for add-ons"/></button>
Expand DownExpand Up@@ -295,7 +295,7 @@ versions[60] = {"0.1": "0.1", "0.7": "0.7", "1.0": "1.0", 'Any' : 'any' };

default_low = ( ('' == '-1' || '' == '') && current_app_id == 1) ? low_appversion : 'any';


$("#lver-td input").remove();

var verArr = versions[1];
Expand DownExpand Up@@ -334,7 +334,7 @@ versions[60] = {"0.1": "0.1", "0.7": "0.7", "1.0": "1.0", 'Any' : 'any' };
return true;
});


$(document).ready(function() {
var q = $("#query");
var l = $("#search-query label[for=query]");
Expand DownExpand Up@@ -406,15 +406,15 @@ Firebug 1.4 requires Firefox 3.0 or higher. </p>
<script type="text/javascript">
installVersusDownloadCheck("installTrigger65631-79ab13a7", "Add to Firefox ", "Download Now ");
</script>

<strong>recommended</strong>
</div>

<script type="text/javascript">setTimeout(function() {initExpConfirm('79554-79ab13a7');fixPlatformLinks('79554-79ab13a7', 'Firebug');addCompatibilityHints('1843', '79554-79ab13a7', '3.0', '3.5.*', '');},0);</script>

</div>


<table summary="Add-on Information">
<tbody>
<tr>
Expand DownExpand Up@@ -469,7 +469,7 @@ Firebug 1.4 requires Firefox 3.0 or higher. </p>
<a class="screenshot thumbnail" rel="lightbox" href="/en-US/firefox/images/p/9486/" title="">
<img alt="" src="/en-US/firefox/images/t/9486/" />
</a>

<div class="share-this">
<a class="share" href="#">Share this Add-on</a>
<div class="share-networks">
Expand DownExpand Up@@ -525,11 +525,11 @@ Visit the Firebug website for documentation, screen shots, and discussion forums
href="/en-US/firefox/images/p/11828/" title="Network">
<img src="/en-US/firefox/images/t/11828/" alt="" />
</a>

<h4>Support</h4>
<p>
Support for this add-on is provided by the developer at <a href="http://groups.google.com/group/firebug/topics" >http://groups.google.com/group/firebug/topics</a> </p>

<h4>Developer Comments</h4>
<p >
If you have any problems, please read the FireBug FAQ.<br />
Expand DownExpand Up@@ -572,15 +572,15 @@ I can&#039;t even think of working without this !</p>
See all 681 reviews of this add-on </a>
</p>
</div>


<h3>What do you think?</h3>
<div id="review-box" class="highlight">
<p>Please <a href="/en-US/firefox/users/login?to=en-US%2Ffirefox%2Faddon%2F1843">log in</a> to submit a review</p>

<form class="addon-feedback" method="post"
action="/en-US/firefox/reviews/add/1843">

<div class="container">
<label for="review">Review</label>
<textarea name="data[Review][body]" id="review" disabled="disabled" cols="30" rows="6"></textarea>
Expand DownExpand Up@@ -610,7 +610,7 @@ I can&#039;t even think of working without this !</p>
Detailed Review </a>
</p>
</div> <!-- highlight -->

<h3>Release Notes</h3>
<div class="article">
<a href="/en-US/firefox/addons/versions/1843#version-1.4.3" title="Permanent link to this version">Version 1.4.3</a> <span title="September 29, 2009, 11:35 AM">&mdash;
Expand All@@ -619,15 +619,15 @@ I can&#039;t even think of working without this !</p>
<br />
Replaced &quot;Off for All Web Pages&quot; with &quot;Clear Activation List&quot;. </p>


<ul class="further-navigation">
<li>
<a href="/en-US/firefox/addons/versions/1843">
View Older Versions </a>
</li>
</ul>
</div> <!-- Release Notes -->

</div> <!-- primary -->

<div class="secondary" role="secondary">
Expand DownExpand Up@@ -701,7 +701,7 @@ Replaced &quot;Off for All Web Pages&quot; with &quot;Clear Activation List&quot
</form>
</div>

<a href="/en-US/firefox/users/register">Register</a> or <a href="/en-US/firefox/users/login?to=en-US%2Ffirefox%2Faddon%2F1843">Log in</a> to add tags
<a href="/en-US/firefox/users/register">Register</a> or <a href="/en-US/firefox/users/login?to=en-US%2Ffirefox%2Faddon%2F1843">Log in</a> to add tags
</div>
<!-- /.highlight-->

Expand DownExpand Up@@ -730,7 +730,7 @@ Replaced &quot;Off for All Web Pages&quot; with &quot;Clear Activation List&quot
</li>
</ul>
</div>

<div class="collections-add">
<h3 class="compact-bottom">Related Collections</h3>

Expand DownExpand Up@@ -824,7 +824,7 @@ Replaced &quot;Off for All Web Pages&quot; with &quot;Clear Activation List&quot
<button type="submit">Go</button>
</div>
</form>

<p><strong>Copyright <span title="pm-app-amo15.mozilla.org">&#169;</span> 2005&#8211;2009 Mozilla.</strong> All rights reserved.</p>
<ul>
<li><a href="/en-US/firefox/pages/privacy" >Privacy Policy</a></li>
Expand Down
12 changes: 6 additions & 6 deletions README
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
=============================
Test Driving JavaScript Book
Test Driving JavaScript Book
=============================
This is the source code and actual book in open office formate (.odt), Test Driving JavaScript (aka TD JavaScript). It is licensed under the Creative Commons Attribution-Non Commercial-Share Alike 3.0 license. http://creativecommons.org/licenses/by-sa/3.0/us/

This is the source code and actual book in open office formate (.odt), Test Driving JavaScript (aka TD JavaScript). It is licensed under the Creative Commons Attribution-Non Commercial-Share Alike 3.0 license. http://creativecommons.org/licenses/by-sa/3.0/us/

Contributors
=====================
I am interested in contributors that may have relevant experience, information, that I am not already supplying. For example, here are some possible topics/chapters that would probably improve the book:
- IE specific debugging via the IE8 JavaScript debugger would be a great addition.
- Integration with a continuous integration system.
Note that the goal of the book is to be short and sweet so contributions will need to be to the point. Given that the main document is currently using Open Office, I'd ask that contributions come in that form. I still need to research merging a .odt document, so I'm still unsure of how to go about patches/contributions (in that regard). Please email me if you're serious about contributing.
Note that the goal of the book is to be short and sweet so contributions will need to be to the point. Given that the main document is currently using Open Office, I'd ask that contributions come in that form. I still need to research merging a .odt document, so I'm still unsure of how to go about patches/contributions (in that regard). Please email me if you're serious about contributing.

Errata
=====================
If you find any technical mistakes and/or parts of the book that are in need of correction,
please email me at roblevintennis at gmail dot com to inform me.
please email me at roblevintennis at gmail dot com to inform me.

Binary file modifiedTDD JavaScript.odt
Binary file not shown.
2 changes: 1 addition & 1 deletion code/5_min_drill/README.rdoc
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@

Description

== License
== License

(The MIT License)

Expand Down
4 changes: 2 additions & 2 deletions code/5_min_drill/lib/test_js_itself.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,12 +3,12 @@ JSTest.prototype = {
constructor: JSTest,
switchTest : function(c) {
switch(c) {
case 0:
case 0:
return "zero";
break;
case 1:
return "one";
break;
break;
case "no break case":
// do nothing...testing fall through
case "next case":
Expand Down
10 changes: 5 additions & 5 deletions code/5_min_drill/spec/spec.test_js_itself.js
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
describe 'TestJsItself'
before_each
jsTest = new JSTest
before_each
jsTest = new JSTest
arr = jsTest.arrayTest()
end
end
describe '.switchTest()'
it 'should return corresponding case primitive int as a string'
jsTest.switchTest(1).should.eql "one"
jsTest.switchTest(1).should.eql "one"
end
it 'should fall through to next case when omitting a break'
jsTest.switchTest("no break case").should.eql "next case"
Expand All@@ -16,7 +16,7 @@ describe 'TestJsItself'
(typeof arr == 'object').should.eql true
end
it 'should use zero based indexing'
arr[1].should.eql 2
arr[1].should.eql 2
end
end
end
2 changes: 1 addition & 1 deletion code/binary_tree/bin_tree/README.rdoc
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@

Description

== License
== License

(The MIT License)

Expand Down
6 changes: 3 additions & 3 deletions code/binary_tree/bin_tree/lib/yourlib.core.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,7 +10,7 @@ function BSTree(n) {
this.root = n;
};
BSTree.prototype = {
// Essentially have to go past node it should be connected to
// Essentially have to go past node it should be connected to
// looking for undefined, so we always need pointer to parent node
addNode: function(node) {
var current = this.root;
Expand DownExpand Up@@ -45,10 +45,10 @@ BSTree.prototype = {
}
}
}
return null;
return null;
},
// Builds an "in order" array of the list's nodes (eg [1,2,3,4...])
traverseInOrder: function(inOrdArray, cNode) {
traverseInOrder: function(inOrdArray, cNode) {
if(cNode !== undefined) {
this.traverseInOrder(inOrdArray, cNode.left);
inOrdArray.push(cNode);
Expand Down
16 changes: 8 additions & 8 deletions code/binary_tree/bin_tree/spec/spec.core.js
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
/*
------------------------- Binary Search Tree -------------------------
------------------------- Binary Search Tree -------------------------

NOTE: This is about the simplest Binary Search Tree we could make. It does NOT implement deletion
NOTE: This is about the simplest Binary Search Tree we could make. It does NOT implement deletion
which is rather complex. However, Zakas has a series of articles online (part II does the deletiation part):
http://www.nczonline.net/blog/2009/06/16/computer-science-in-javascript-binary-search-tree-part-2/
http://www.nczonline.net/blog/2009/06/09/computer-science-in-javascript-binary-search-tree-part-1/
Expand DownExpand Up@@ -40,7 +40,7 @@ the root. If we assume the root is Level 0, its children will be Level 1, its gr
will be Level 2, and so on.

-- Keys: We’ve seen that one data item in an object is usually designated a key value. This
value is used to search for the item or perform other operations on it.
value is used to search for the item or perform other operations on it.

-- Binary Trees: If every node in a tree can have at most two children, the tree is called a binary
tree.
Expand All@@ -64,10 +64,10 @@ describe 'Binary Search Tree'
tree = new BSTree(root)
tree.addNode(leftChild)
tree.addNode(rightChild)
end
end
it 'should create a node2 with left and right nodes'
// Node should be as initialized data, left/right null
node2.data.should.be 222
node2.data.should.be 222
node2['left'].should.be_null
node2['right'].should.be_null
// After assignment, left/right should be as assigned
Expand DownExpand Up@@ -104,8 +104,8 @@ describe 'Binary Search Tree'
tree.find(10).id.should.equal 10
tree.find(16).id.should.equal 16
tree.find(17).id.should.equal 17
tree.find(888).should.be_null
tree.find('abc').should.be_null
tree.find(888).should.be_null
tree.find('abc').should.be_null
end
it 'should add and find nodes even if negative numbers'
var negNode = new Node(-10)
Expand All@@ -115,7 +115,7 @@ describe 'Binary Search Tree'
it 'should traverse in order and return in order array'
var llGrandChild = new Node(5,5)
tree.addNode(llGrandChild)
var inOrderArray = tree.traverseInOrder([], root)
var inOrderArray = tree.traverseInOrder([], root)
inOrderArray[0].id.should.equal llGrandChild.id
inOrderArray[1].id.should.equal leftChild.id
inOrderArray[2].id.should.equal root.id
Expand Down
2 changes: 1 addition & 1 deletion code/gotchas/README.rdoc
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@

Description

== License
== License

(The MIT License)

Expand Down
4 changes: 2 additions & 2 deletions code/gotchas/lib/gotchas.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,8 +17,8 @@ var privileged_singleton = function() {
var obj = SomeObject;
obj.publicVar = 'this is public';
obj.publicFunc = function() {
var message = 'publicFunc is privileged, and hereby allows you to see private var: ' +
privateVar + ', as well as see the return value of privateFunc: ' + privateFunc();
var message = 'publicFunc is privileged, and hereby allows you to see private var: ' +
privateVar + ', as well as see the return value of privateFunc: ' + privateFunc();
return message;
};
return obj;
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions Firebug Usage/fb_debug
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,8 +17,8 @@
<link rel="search" type="application/opensearchdescription+xml" title="Mozilla Add-ons"
href="/AMOSearch.xml" />

<link rel="stylesheet" type="text/css" href="/css/amo2009/style.min.css?52492" media="all" />

<link rel="stylesheet" type="text/css" href="/css/amo2009/style.min.css?52492" media="all" />
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="/css/amo2009/ie.css" media="screen,projection,tv" /> <![endif]-->
<!--[if IE 7]>
Expand DownExpand Up@@ -53,13 +53,13 @@
<li><a href="#categories">Skip to categories menu</a></li>
<li><a href="#other-apps">Skip to other applications menu</a></li>
</ul>

<div class="section">
<div id="header" role="banner">
<p id="title"><a href="/en-US/firefox/" title="Return to the Firefox Add-ons homepage">Add-ons <em>for</em> <img alt="Firefox" src="/img/amo2009/app-icons/firefox.png" /> <strong>Firefox</strong></a></p>
<p id="brand"><a href="http://www.mozilla.com/en-US/" title="Mozilla" accesskey="1">Mozilla</a></p>


<div id="aux-nav" role="navigation">
<ul id="other-apps" class="change" title="Find add-ons for other applications">
<li>
Expand All@@ -80,12 +80,12 @@
</li>
</ul>


<p class="context">
<a href="/en-US/firefox/users/register">Register</a> or <a href="/en-US/firefox/users/login?to=en-US%2Ffirefox%2Faddon%2F1843">Log in</a> </p>
</div>
</div>


<div class="stand-alone-options">
<div id="categories" class="categories">
Expand DownExpand Up@@ -154,7 +154,7 @@
</li>
</ul>
</div>

<div class="search-form expanded-search-form">
<form method="get" action="/en-US/firefox/search" id="search-form">
<div class="basic" id="search-query">
Expand All@@ -180,7 +180,7 @@
<option value="1,92">Toolbars</option>
<option value="1,4">Web Development</option>
<option value="1,73">Other</option>

<option class="cat-all" value="collections">all collections</option>
</select>
<button type="submit"><img src="/img/amo2009/blank.gif" alt="Search for add-ons"/></button>
Expand DownExpand Up@@ -295,7 +295,7 @@ versions[60] = {"0.1": "0.1", "0.7": "0.7", "1.0": "1.0", 'Any' : 'any' };

default_low = ( ('' == '-1' || '' == '') && current_app_id == 1) ? low_appversion : 'any';


$("#lver-td input").remove();

var verArr = versions[1];
Expand DownExpand Up@@ -334,7 +334,7 @@ versions[60] = {"0.1": "0.1", "0.7": "0.7", "1.0": "1.0", 'Any' : 'any' };
return true;
});


$(document).ready(function() {
var q = $("#query");
var l = $("#search-query label[for=query]");
Expand DownExpand Up@@ -406,15 +406,15 @@ Firebug 1.4 requires Firefox 3.0 or higher. </p>
<script type="text/javascript">
installVersusDownloadCheck("installTrigger65631-79ab13a7", "Add to Firefox ", "Download Now ");
</script>

<strong>recommended</strong>
</div>

<script type="text/javascript">setTimeout(function() {initExpConfirm('79554-79ab13a7');fixPlatformLinks('79554-79ab13a7', 'Firebug');addCompatibilityHints('1843', '79554-79ab13a7', '3.0', '3.5.*', '');},0);</script>

</div>


<table summary="Add-on Information">
<tbody>
<tr>
Expand DownExpand Up@@ -469,7 +469,7 @@ Firebug 1.4 requires Firefox 3.0 or higher. </p>
<a class="screenshot thumbnail" rel="lightbox" href="/en-US/firefox/images/p/9486/" title="">
<img alt="" src="/en-US/firefox/images/t/9486/" />
</a>

<div class="share-this">
<a class="share" href="#">Share this Add-on</a>
<div class="share-networks">
Expand DownExpand Up@@ -525,11 +525,11 @@ Visit the Firebug website for documentation, screen shots, and discussion forums
href="/en-US/firefox/images/p/11828/" title="Network">
<img src="/en-US/firefox/images/t/11828/" alt="" />
</a>

<h4>Support</h4>
<p>
Support for this add-on is provided by the developer at <a href="http://groups.google.com/group/firebug/topics" >http://groups.google.com/group/firebug/topics</a> </p>

<h4>Developer Comments</h4>
<p >
If you have any problems, please read the FireBug FAQ.<br />
Expand DownExpand Up@@ -572,15 +572,15 @@ I can&#039;t even think of working without this !</p>
See all 681 reviews of this add-on </a>
</p>
</div>


<h3>What do you think?</h3>
<div id="review-box" class="highlight">
<p>Please <a href="/en-US/firefox/users/login?to=en-US%2Ffirefox%2Faddon%2F1843">log in</a> to submit a review</p>

<form class="addon-feedback" method="post"
action="/en-US/firefox/reviews/add/1843">

<div class="container">
<label for="review">Review</label>
<textarea name="data[Review][body]" id="review" disabled="disabled" cols="30" rows="6"></textarea>
Expand DownExpand Up@@ -610,7 +610,7 @@ I can&#039;t even think of working without this !</p>
Detailed Review </a>
</p>
</div> <!-- highlight -->

<h3>Release Notes</h3>
<div class="article">
<a href="/en-US/firefox/addons/versions/1843#version-1.4.3" title="Permanent link to this version">Version 1.4.3</a> <span title="September 29, 2009, 11:35 AM">&mdash;
Expand All@@ -619,15 +619,15 @@ I can&#039;t even think of working without this !</p>
<br />
Replaced &quot;Off for All Web Pages&quot; with &quot;Clear Activation List&quot;. </p>


<ul class="further-navigation">
<li>
<a href="/en-US/firefox/addons/versions/1843">
View Older Versions </a>
</li>
</ul>
</div> <!-- Release Notes -->

</div> <!-- primary -->

<div class="secondary" role="secondary">
Expand DownExpand Up@@ -701,7 +701,7 @@ Replaced &quot;Off for All Web Pages&quot; with &quot;Clear Activation List&quot
</form>
</div>

<a href="/en-US/firefox/users/register">Register</a> or <a href="/en-US/firefox/users/login?to=en-US%2Ffirefox%2Faddon%2F1843">Log in</a> to add tags
<a href="/en-US/firefox/users/register">Register</a> or <a href="/en-US/firefox/users/login?to=en-US%2Ffirefox%2Faddon%2F1843">Log in</a> to add tags
</div>
<!-- /.highlight-->

Expand DownExpand Up@@ -730,7 +730,7 @@ Replaced &quot;Off for All Web Pages&quot; with &quot;Clear Activation List&quot
</li>
</ul>
</div>

<div class="collections-add">
<h3 class="compact-bottom">Related Collections</h3>

Expand DownExpand Up@@ -824,7 +824,7 @@ Replaced &quot;Off for All Web Pages&quot; with &quot;Clear Activation List&quot
<button type="submit">Go</button>
</div>
</form>

<p><strong>Copyright <span title="pm-app-amo15.mozilla.org">&#169;</span> 2005&#8211;2009 Mozilla.</strong> All rights reserved.</p>
<ul>
<li><a href="/en-US/firefox/pages/privacy" >Privacy Policy</a></li>
Expand Down
12 changes: 6 additions & 6 deletions README
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
=============================
Test Driving JavaScript Book
Test Driving JavaScript Book
=============================
This is the source code and actual book in open office formate (.odt), Test Driving JavaScript (aka TD JavaScript). It is licensed under the Creative Commons Attribution-Non Commercial-Share Alike 3.0 license. http://creativecommons.org/licenses/by-sa/3.0/us/

This is the source code and actual book in open office formate (.odt), Test Driving JavaScript (aka TD JavaScript). It is licensed under the Creative Commons Attribution-Non Commercial-Share Alike 3.0 license. http://creativecommons.org/licenses/by-sa/3.0/us/

Contributors
=====================
I am interested in contributors that may have relevant experience, information, that I am not already supplying. For example, here are some possible topics/chapters that would probably improve the book:
- IE specific debugging via the IE8 JavaScript debugger would be a great addition.
- Integration with a continuous integration system.
Note that the goal of the book is to be short and sweet so contributions will need to be to the point. Given that the main document is currently using Open Office, I'd ask that contributions come in that form. I still need to research merging a .odt document, so I'm still unsure of how to go about patches/contributions (in that regard). Please email me if you're serious about contributing.
Note that the goal of the book is to be short and sweet so contributions will need to be to the point. Given that the main document is currently using Open Office, I'd ask that contributions come in that form. I still need to research merging a .odt document, so I'm still unsure of how to go about patches/contributions (in that regard). Please email me if you're serious about contributing.

Errata
=====================
If you find any technical mistakes and/or parts of the book that are in need of correction,
please email me at roblevintennis at gmail dot com to inform me.
please email me at roblevintennis at gmail dot com to inform me.

Binary file modifiedTDD JavaScript.odt
Binary file not shown.
2 changes: 1 addition & 1 deletion code/5_min_drill/README.rdoc
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@

Description

== License
== License

(The MIT License)

Expand Down
4 changes: 2 additions & 2 deletions code/5_min_drill/lib/test_js_itself.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,12 +3,12 @@ JSTest.prototype = {
constructor: JSTest,
switchTest : function(c) {
switch(c) {
case 0:
case 0:
return "zero";
break;
case 1:
return "one";
break;
break;
case "no break case":
// do nothing...testing fall through
case "next case":
Expand Down
10 changes: 5 additions & 5 deletions code/5_min_drill/spec/spec.test_js_itself.js
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
describe 'TestJsItself'
before_each
jsTest = new JSTest
before_each
jsTest = new JSTest
arr = jsTest.arrayTest()
end
end
describe '.switchTest()'
it 'should return corresponding case primitive int as a string'
jsTest.switchTest(1).should.eql "one"
jsTest.switchTest(1).should.eql "one"
end
it 'should fall through to next case when omitting a break'
jsTest.switchTest("no break case").should.eql "next case"
Expand All@@ -16,7 +16,7 @@ describe 'TestJsItself'
(typeof arr == 'object').should.eql true
end
it 'should use zero based indexing'
arr[1].should.eql 2
arr[1].should.eql 2
end
end
end
2 changes: 1 addition & 1 deletion code/binary_tree/bin_tree/README.rdoc
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@

Description

== License
== License

(The MIT License)

Expand Down
6 changes: 3 additions & 3 deletions code/binary_tree/bin_tree/lib/yourlib.core.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,7 +10,7 @@ function BSTree(n) {
this.root = n;
};
BSTree.prototype = {
// Essentially have to go past node it should be connected to
// Essentially have to go past node it should be connected to
// looking for undefined, so we always need pointer to parent node
addNode: function(node) {
var current = this.root;
Expand DownExpand Up@@ -45,10 +45,10 @@ BSTree.prototype = {
}
}
}
return null;
return null;
},
// Builds an "in order" array of the list's nodes (eg [1,2,3,4...])
traverseInOrder: function(inOrdArray, cNode) {
traverseInOrder: function(inOrdArray, cNode) {
if(cNode !== undefined) {
this.traverseInOrder(inOrdArray, cNode.left);
inOrdArray.push(cNode);
Expand Down
16 changes: 8 additions & 8 deletions code/binary_tree/bin_tree/spec/spec.core.js
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
/*
------------------------- Binary Search Tree -------------------------
------------------------- Binary Search Tree -------------------------

NOTE: This is about the simplest Binary Search Tree we could make. It does NOT implement deletion
NOTE: This is about the simplest Binary Search Tree we could make. It does NOT implement deletion
which is rather complex. However, Zakas has a series of articles online (part II does the deletiation part):
http://www.nczonline.net/blog/2009/06/16/computer-science-in-javascript-binary-search-tree-part-2/
http://www.nczonline.net/blog/2009/06/09/computer-science-in-javascript-binary-search-tree-part-1/
Expand DownExpand Up@@ -40,7 +40,7 @@ the root. If we assume the root is Level 0, its children will be Level 1, its gr
will be Level 2, and so on.

-- Keys: We’ve seen that one data item in an object is usually designated a key value. This
value is used to search for the item or perform other operations on it.
value is used to search for the item or perform other operations on it.

-- Binary Trees: If every node in a tree can have at most two children, the tree is called a binary
tree.
Expand All@@ -64,10 +64,10 @@ describe 'Binary Search Tree'
tree = new BSTree(root)
tree.addNode(leftChild)
tree.addNode(rightChild)
end
end
it 'should create a node2 with left and right nodes'
// Node should be as initialized data, left/right null
node2.data.should.be 222
node2.data.should.be 222
node2['left'].should.be_null
node2['right'].should.be_null
// After assignment, left/right should be as assigned
Expand DownExpand Up@@ -104,8 +104,8 @@ describe 'Binary Search Tree'
tree.find(10).id.should.equal 10
tree.find(16).id.should.equal 16
tree.find(17).id.should.equal 17
tree.find(888).should.be_null
tree.find('abc').should.be_null
tree.find(888).should.be_null
tree.find('abc').should.be_null
end
it 'should add and find nodes even if negative numbers'
var negNode = new Node(-10)
Expand All@@ -115,7 +115,7 @@ describe 'Binary Search Tree'
it 'should traverse in order and return in order array'
var llGrandChild = new Node(5,5)
tree.addNode(llGrandChild)
var inOrderArray = tree.traverseInOrder([], root)
var inOrderArray = tree.traverseInOrder([], root)
inOrderArray[0].id.should.equal llGrandChild.id
inOrderArray[1].id.should.equal leftChild.id
inOrderArray[2].id.should.equal root.id
Expand Down
2 changes: 1 addition & 1 deletion code/gotchas/README.rdoc
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@

Description

== License
== License

(The MIT License)

Expand Down
4 changes: 2 additions & 2 deletions code/gotchas/lib/gotchas.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,8 +17,8 @@ var privileged_singleton = function() {
var obj = SomeObject;
obj.publicVar = 'this is public';
obj.publicFunc = function() {
var message = 'publicFunc is privileged, and hereby allows you to see private var: ' +
privateVar + ', as well as see the return value of privateFunc: ' + privateFunc();
var message = 'publicFunc is privileged, and hereby allows you to see private var: ' +
privateVar + ', as well as see the return value of privateFunc: ' + privateFunc();
return message;
};
return obj;
Expand Down
Loading