From 734b35ecfed5aa087bb1712326d7037586da6a76 Mon Sep 17 00:00:00 2001 From: Markus Amalthea Magnuson Date: Sat, 23 Feb 2013 00:39:24 +0100 Subject: [PATCH 01/14] Fix a couple of typos. --- page/javascript-101/syntax-basics.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/page/javascript-101/syntax-basics.md b/page/javascript-101/syntax-basics.md index e7eb1b30..6cbd9780 100644 --- a/page/javascript-101/syntax-basics.md +++ b/page/javascript-101/syntax-basics.md @@ -24,7 +24,7 @@ JavaScript has support for single and multi-line comments. Comments are ignored ### Whitespace -Whitespace is also ignored in JavaScript. There are many tools that will strip out all the whitespace in a program, reducing the overall file size and improving network latency. Given the availability of tools like these, whitespace should be leveraged to make the code as readible as possible. +Whitespace is also ignored in JavaScript. There are many tools that will strip out all the whitespace in a program, reducing the overall file size and improving network latency. Given the availability of tools like these, whitespace should be leveraged to make the code as readable as possible. ``` // Whitespace is insignificant. @@ -64,7 +64,7 @@ Identifiers are used to give variables and functions a unique name so they can s * Can only be composed of letters, numbers, dollar signs, and underscores. * The first character cannot be a number. -It's a best practice to name identifers in a way that will make sense to you and other developers later on. +It's a best practice to name identifiers in a way that will make sense to you and other developers later on. ``` // Valid identifier names. From c3c79dda061976865793cc8a54eb1dffb8a7687d Mon Sep 17 00:00:00 2001 From: Markus Amalthea Magnuson Date: Sat, 23 Feb 2013 00:43:36 +0100 Subject: [PATCH 02/14] falsey -> falsy --- page/javascript-101/loops.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/page/javascript-101/loops.md b/page/javascript-101/loops.md index f06b0203..300bf129 100644 --- a/page/javascript-101/loops.md +++ b/page/javascript-101/loops.md @@ -33,7 +33,7 @@ for ( [initialisation]; [conditional]; [iteration] ) { The _initialisation_ statement is executed only once, before the loop starts. It gives you an opportunity to prepare or declare any variables. -The _conditional_ statement is executed before each iteration, and its return value decides whether the loop is to continue. If the conditional statement evaluates to a falsey value, then the loop stops. +The _conditional_ statement is executed before each iteration, and its return value decides whether the loop is to continue. If the conditional statement evaluates to a falsy value, then the loop stops. The _iteration_ statement is executed at the end of each iteration and gives you an opportunity to change the state of important variables. Typically, this will involve incrementing or decrementing a counter and thus bringing the loop closer to its end. From f216fa625c01f994cf04a5cbe574b0bf899d3d1a Mon Sep 17 00:00:00 2001 From: Markus Amalthea Magnuson Date: Sat, 23 Feb 2013 00:56:55 +0100 Subject: [PATCH 03/14] wfirst -> first --- page/using-jquery-core/selecting-elements.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/page/using-jquery-core/selecting-elements.md b/page/using-jquery-core/selecting-elements.md index 0dafe422..ac3e62da 100644 --- a/page/using-jquery-core/selecting-elements.md +++ b/page/using-jquery-core/selecting-elements.md @@ -266,7 +266,7 @@ In order to get the best performance using `:radio`, first select elements with $("form :reset"); ``` -In order to get the best performance using `:reset`, wfirst select elements with a standard jQuery selector, then use `.filter(":reset")`, or precede the pseudo-selector with a tag name or some other selector. +In order to get the best performance using `:reset`, first select elements with a standard jQuery selector, then use `.filter(":reset")`, or precede the pseudo-selector with a tag name or some other selector. **Note:** for better performance in modern browsers, use `[ type = "reset" ]` instead of the `:reset` pseudo-selector. From ffb9496194d356cf96313b4da414ccbc5db3be44 Mon Sep 17 00:00:00 2001 From: Markus Amalthea Magnuson Date: Sat, 23 Feb 2013 01:00:38 +0100 Subject: [PATCH 04/14] Fix Selecing -> Selecting and space after // --- page/using-jquery-core/traversing.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/page/using-jquery-core/traversing.md b/page/using-jquery-core/traversing.md index 1920a9b2..7c60563e 100644 --- a/page/using-jquery-core/traversing.md +++ b/page/using-jquery-core/traversing.md @@ -69,17 +69,17 @@ $("div.grandparent").find("div"); The rest of the traversal methods within jQuery all deal with finding sibling selections. There are a few basic methods as far as the direction of traversal is concerned. You can find previous elements with `$.fn.prev()`, next elements with `$.fn.next()`, and both with `$.fn.siblings()`. There are also a few other methods that build onto these basic methods: `$.fn.nextAll()`, `$.fn.nextUntil()`, `$.fn.prevAll()` and `$.fn.prevUntil()`. ``` -// Selecing a next sibling of the selectors +// Selecting a next sibling of the selectors // returns [ div.surrogateParent1 ] $("div.parent").next(); -// Selecing a prev sibling of the selectors +// Selecting a prev sibling of the selectors // returns [] as No sibling exists before div.parent $("div.parent").prev(); -//Selecting all the next siblings of the selector +// Selecting all the next siblings of the selector // returns [ div.surrogateParent1, div.surrogateParent2 ] $("div.parent").nextAll(); @@ -88,7 +88,7 @@ $("div.parent").nextAll().first(); // returns [ div.surrogateParent2 ] $("div.parent").nextAll().last(); -//Selecting all the previous siblings of the selector +// Selecting all the previous siblings of the selector // returns [ div.surrogateParent1, div.parent ] $("div.surrogateParent2").prevAll(); From 66ac8e82238c1704eff6fb156797d1dfd7cb002b Mon Sep 17 00:00:00 2001 From: Markus Amalthea Magnuson Date: Sat, 23 Feb 2013 01:10:03 +0100 Subject: [PATCH 05/14] inconsist -> inconsistent --- page/using-jquery-core/understanding-index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/page/using-jquery-core/understanding-index.md b/page/using-jquery-core/understanding-index.md index d3c9bd68..99f6b09c 100644 --- a/page/using-jquery-core/understanding-index.md +++ b/page/using-jquery-core/understanding-index.md @@ -67,7 +67,7 @@ var $div = $("#last"); console.log( "Index: " + $div.index("div") ); // 2 ``` -When `.index()` is called with a string argument, there are two things to consider. First, jQuery will implicitly call `.first()` on the original jQuery object. It will be find the index of the first element, not the last element in this case. This is inconsist, so be careful here. +When `.index()` is called with a string argument, there are two things to consider. First, jQuery will implicitly call `.first()` on the original jQuery object. It will be find the index of the first element, not the last element in this case. This is inconsistent, so be careful here. The second point to consider is that jQuery is querying the entire DOM using the passed in string selector and checking the index within that newly queried jQuery object. For example, when using `.index("div")` in the last example above, jQuery is selecting all of the `` in the document, then searching for the index that contains the first element in the jQuery object `.index()` is called on. From 3a446fd2c7be39fc041127b53306692bfc82e234 Mon Sep 17 00:00:00 2001 From: Markus Amalthea Magnuson Date: Sat, 23 Feb 2013 01:12:00 +0100 Subject: [PATCH 06/14] doesn"t -> doesn't --- ...replace-text-from-the-3rd-element-of-a-list-of-10-items.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/page/using-jquery-core/faq/how-do-i-replace-text-from-the-3rd-element-of-a-list-of-10-items.md b/page/using-jquery-core/faq/how-do-i-replace-text-from-the-3rd-element-of-a-list-of-10-items.md index 1e2c4110..37b45536 100644 --- a/page/using-jquery-core/faq/how-do-i-replace-text-from-the-3rd-element-of-a-list-of-10-items.md +++ b/page/using-jquery-core/faq/how-do-i-replace-text-from-the-3rd-element-of-a-list-of-10-items.md @@ -6,7 +6,7 @@ source: http://docs.jquery.com/Frequently_Asked_Questions Either the :eq() selector or the .eq() method will allow you to select the proper item. However, to replace the text, you must get the value before you set it: ``` -// This doesn"t work; text() returns a string, not the jQuery object +// This doesn't work; text() returns a string, not the jQuery object $( this ).find("li a").eq( 2 ).text().replace( "foo", "bar" ); // This works @@ -17,4 +17,4 @@ var linkText = $thirdLink.text().replace( "foo", "bar" ); $thirdLink.text( linkText ); ``` -The first example just discards the modified text. The second example saves the modified text and then replaces the old text with the new modified text. Remember, .text() gets; .text("foo") sets. \ No newline at end of file +The first example just discards the modified text. The second example saves the modified text and then replaces the old text with the new modified text. Remember, .text() gets; .text("foo") sets. From c866fd90afe6eadda187d58186019275be933365 Mon Sep 17 00:00:00 2001 From: Markus Amalthea Magnuson Date: Sat, 23 Feb 2013 01:26:46 +0100 Subject: [PATCH 07/14] simpiler -> simpler --- page/events/event-delegation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/page/events/event-delegation.md b/page/events/event-delegation.md index f742474b..2391af74 100644 --- a/page/events/event-delegation.md +++ b/page/events/event-delegation.md @@ -89,7 +89,7 @@ $("#list").on( "click", "a", function( event ) { ``` This simply passes the `.is()` method a selector to see if the element"s `href` attributes starts with "http". Also we have removed the `event.preventDefault();` statement, this is because we want the default action to happen (which is to following the `href`) -We can actually take this a step further and make our code simpiler and more concise by allowing the selector argument to `.on()` do our logic for us. +We can actually take this a step further and make our code simpler and more concise by allowing the selector argument to `.on()` do our logic for us. ``` // attach a delegated event with a more refined selector $("#list").on( "click", "a[href^=http]", function( event ) { From 005c7f6d2c6d01388ef03716bfb312005c77669a Mon Sep 17 00:00:00 2001 From: Markus Amalthea Magnuson Date: Sat, 23 Feb 2013 01:30:35 +0100 Subject: [PATCH 08/14] Fix a couple of typos. --- page/events/triggering-event-handlers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/page/events/triggering-event-handlers.md b/page/events/triggering-event-handlers.md index d6fc0d68..0ef21fc0 100644 --- a/page/events/triggering-event-handlers.md +++ b/page/events/triggering-event-handlers.md @@ -30,7 +30,7 @@ $("a").trigger("click"); ## How can I mimic a native browser event, if not `.trigger()`? In order to trigger a native browser event, you have to use [document.createEventObject](http://msdn.microsoft.com/en-us/library/ie/ms536390%28v=vs.85%29.aspx) for < IE9 and [document.createEvent](https://developer.mozilla.org/en/DOM/document.createEvent) for all other browsers. -Using these two APIs, you can programatically create an event that behaves exactly as if someone has actually clicked on a file input box. The default action will happen, and the browse file dialog will display. +Using these two APIs, you can programmatically create an event that behaves exactly as if someone has actually clicked on a file input box. The default action will happen, and the browse file dialog will display. The jQuery UI Team created [jquery.simulate.js](https://github.com/eduardolundgren/jquery-simulate/blob/master/jquery.simulate.js) in order to simplify triggering a native browser event for use in their automated testing. Its usage is modeled after jQuery's trigger. @@ -49,7 +49,7 @@ There are four differences between `.trigger()` and `.triggerHandler()` 1. `.triggerHandler()` only triggers the event on the first element of a jQuery object. 2. `.triggerHandler()` cannot be chained. It returns the value that is returned by the last handler, not a jQuery object. 3. `.triggerHandler()` will not cause the default behavior of the event (such as a form submission). -4. Events triggered by `.triggerHandler()`, will not bubble up the DOM heirarchy. Only the handlers on the single element will fire. +4. Events triggered by `.triggerHandler()`, will not bubble up the DOM hierarchy. Only the handlers on the single element will fire. For more information see the [triggerHandler documentation](http://api.jquery.com/triggerHandler) From 0ac8be2fb8d70ca9acfd895585131ed186afd7dc Mon Sep 17 00:00:00 2001 From: Markus Amalthea Magnuson Date: Sat, 23 Feb 2013 01:33:11 +0100 Subject: [PATCH 09/14] recieve -> receive --- page/events/history-of-events.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/page/events/history-of-events.md b/page/events/history-of-events.md index 65344de1..3ebfe1d5 100644 --- a/page/events/history-of-events.md +++ b/page/events/history-of-events.md @@ -70,7 +70,7 @@ When we use `.live()` our event is bound to `$( document )`. When the `
  • ` is * `` * *document* root -The last element to recieve the *click* event is *document*, this is where our `.live()` event is bound. `.live()` will then check to see if our selector `#list li` is the element that triggered the event, if so our event handler is executed. +The last element to receive the *click* event is *document*, this is where our `.live()` event is bound. `.live()` will then check to see if our selector `#list li` is the element that triggered the event, if so our event handler is executed. ### [.live()](http://api.jquery.com/live/) w/ context (Deprecated) From 6a9d4e31fb8212b658f1c20d807f282a34b7842e Mon Sep 17 00:00:00 2001 From: Markus Amalthea Magnuson Date: Sat, 23 Feb 2013 01:35:29 +0100 Subject: [PATCH 10/14] availble -> available --- page/events/event-extensions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/page/events/event-extensions.md b/page/events/event-extensions.md index 0013287d..314387b0 100644 --- a/page/events/event-extensions.md +++ b/page/events/event-extensions.md @@ -44,7 +44,7 @@ props: Array : Strings representing properties that should be copied from the browser's event object to the jQuery event object. If omitted, no additional properties are copied beyond the standard ones that jQuery copies and normalizes (e.g., `event.target` and `event.relatedTarget`). filter: Function( event, originalEvent ) -: jQuery calls this function after it constructs the `jQuery.Event` object, copies standard properties from `jQuery.event.props`, and copies the `fixHooks`-specific props (if any) specified above. The function can create new properties on the event object or modify existing ones. The second argument is the browser's native event object, which is also availble in `event.originalEvent`. +: jQuery calls this function after it constructs the `jQuery.Event` object, copies standard properties from `jQuery.event.props`, and copies the `fixHooks`-specific props (if any) specified above. The function can create new properties on the event object or modify existing ones. The second argument is the browser's native event object, which is also available in `event.originalEvent`. Note that for all events, the browser's native event object is available in `event.originalEvent`; if the jQuery event handler examines the properties there instead of jQuery's normalized `event` object, there is no need to create a `fixHooks` entry to copy or modify the properties. From 1c350ed9e5d0caeece3d1dccf9e122977a4cd1b1 Mon Sep 17 00:00:00 2001 From: Markus Amalthea Magnuson Date: Sat, 23 Feb 2013 01:37:01 +0100 Subject: [PATCH 11/14] milleseconds -> milliseconds --- page/effects/intro-to-effects.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/page/effects/intro-to-effects.md b/page/effects/intro-to-effects.md index 067ca8b8..a04cf3fc 100644 --- a/page/effects/intro-to-effects.md +++ b/page/effects/intro-to-effects.md @@ -41,7 +41,7 @@ $("p").hide( 500 ); $("div.hidden").show( 1250 ); ``` -Most developers pass in a number of milleseconds to have more precise control +Most developers pass in a number of milliseconds to have more precise control over the duration. ##Fade and Slide Animations From ee2dee2909f2240d1616c841760e7cae0688e429 Mon Sep 17 00:00:00 2001 From: Markus Amalthea Magnuson Date: Sat, 23 Feb 2013 01:42:12 +0100 Subject: [PATCH 12/14] Fix a few typos. --- page/plugins/basic-plugin-creation.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/page/plugins/basic-plugin-creation.md b/page/plugins/basic-plugin-creation.md index 6804b8e6..581de6ee 100644 --- a/page/plugins/basic-plugin-creation.md +++ b/page/plugins/basic-plugin-creation.md @@ -37,7 +37,7 @@ Notice that to use `css()`, another method, we use `this`, not `$( this )`. This ##Chaining -This works, but there's a couple of things we need to do for our plugin to survive in the real world. One of jQuery's features is chaining, when you link five or six actions onto one selector. This is accomplished by having all jQuery object methods return the original jQuery object again (there are a few exeptions: `width()` called without parameters returns the width of the selected element, and is not chainable). Making our plugin method chainable takes one line of code: +This works, but there's a couple of things we need to do for our plugin to survive in the real world. One of jQuery's features is chaining, when you link five or six actions onto one selector. This is accomplished by having all jQuery object methods return the original jQuery object again (there are a few exceptions: `width()` called without parameters returns the width of the selected element, and is not chainable). Making our plugin method chainable takes one line of code: ``` $.fn.greenify = function() { @@ -127,7 +127,7 @@ It would be much better to have one slot, and use parameters to control what act ## Using the `each()` Method Your typical jQuery object will contain references to any number of DOM elements, and that's why jQuery objects are often referred to as collections. -If you want to do any manipulating with specific elements (eg: getting data an attribute, calculating specific positions) then you need to use `each()` to +If you want to do any manipulating with specific elements (e.g. getting data an attribute, calculating specific positions) then you need to use `each()` to loop through the elements. ``` @@ -182,7 +182,7 @@ $("div").greenify({ }); ``` -The default value for `color` of `#556B2F` gets overriden by `$.extend()` to be orange. +The default value for `color` of `#556B2F` gets overridden by `$.extend()` to be orange. ##Putting It Together From 42bce3b22c3edd318f4ef28aa034daaae6a762f9 Mon Sep 17 00:00:00 2001 From: Markus Amalthea Magnuson Date: Sat, 23 Feb 2013 01:42:53 +0100 Subject: [PATCH 13/14] andif -> and if --- page/plugins/advanced-plugin-concepts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/page/plugins/advanced-plugin-concepts.md b/page/plugins/advanced-plugin-concepts.md index 404cac68..f31529e5 100644 --- a/page/plugins/advanced-plugin-concepts.md +++ b/page/plugins/advanced-plugin-concepts.md @@ -189,7 +189,7 @@ $.fn.hilight = function( options ) { // build element specific options // This changed line tests to see if the Metadata Plugin is installed, - // andif it is, it extends our options object with the extracted metadata. + // and if it is, it extends our options object with the extracted metadata. var o = $.meta ? $.extend( {}, opts, $this.data() ) : opts; //... From 32cec8f55bb6a5545a17c6f6d9d875a78f357ee7 Mon Sep 17 00:00:00 2001 From: Markus Amalthea Magnuson Date: Sat, 23 Feb 2013 01:52:08 +0100 Subject: [PATCH 14/14] Fix space before new sentence in two places. --- page/code-organization/deferreds.md | 2 +- page/effects/queue-and-dequeue-explained.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/page/code-organization/deferreds.md b/page/code-organization/deferreds.md index da1842bd..5e10b597 100644 --- a/page/code-organization/deferreds.md +++ b/page/code-organization/deferreds.md @@ -72,7 +72,7 @@ promise.then( function( futureValue ) { In the case of certain applications, it is necessary to have several results returned before your application can continue at all (for example, displaying a dynamic set of options on a screen before a user -is able to select the option that interests them).Where this is the +is able to select the option that interests them). Where this is the case, a method called 'when' exists, which can be used to perform some action once all the promises have been fully fulfilled: diff --git a/page/effects/queue-and-dequeue-explained.md b/page/effects/queue-and-dequeue-explained.md index d06aa700..3634c2ce 100644 --- a/page/effects/queue-and-dequeue-explained.md +++ b/page/effects/queue-and-dequeue-explained.md @@ -5,7 +5,7 @@ source: http://jqueryfordesigners.com/api-queue-dequeue/ --- When you use the animate and show, hide, slideUp, etc effect methods, you’re -adding a job on to the fx queue.By default, using queue and passing a function, +adding a job on to the fx queue. By default, using queue and passing a function, will add to the fx queue. So we’re creating our own bespoke animation step: ```