From: Pete Cooper Date: Thu, 29 May 2014 09:42:20 +0000 (+0100) Subject: Typo and wording X-Git-Tag: v5.3.0~33^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F5241%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Typo and wording --- diff --git a/doc/pages/javascript-utilities.html b/doc/pages/javascript-utilities.html index 919b6c33b..ef88d3968 100644 --- a/doc/pages/javascript-utilities.html +++ b/doc/pages/javascript-utilities.html @@ -1,12 +1,12 @@ --- -title: Javascript Utilities +title: JavaScript Utilities --- -

Foundation includes a handful of helpful Javascript utilities to help you add common functionalities to your apps and plugins.

+

Foundation includes a handful of helpful JavaScript utilities to help you add common functionalities to your apps and plugins.

*** -

Using the Javascript Utilities

+

Using the JavaScript Utilities

There are two ways to use the Foundation utilities: by calling them within the Foundation.utils namespace and by inheriting them into an object. @@ -14,7 +14,7 @@ There are two ways to use the Foundation utilities: by calling them within the F As long as foundation.js has been loaded into the page, you can access any of the Foundation utilities by calling Foundation.utils.{function_name}. -For example, if you type the following into the Javascript console it will return a 6-digit alphanumeric string. +For example, if you type the following into the JavaScript console it will return a 6-digit alphanumeric string. {{#markdown}} ```javascript @@ -25,7 +25,7 @@ Foundation.utils.random_str(6);

Method Inheritance

-If you have any plain ole’ Javascript object (a POJO), then you can inherit any of the Foundation Javascript utilities by calling the Foundation.inherit method. To use the inherit method, pass in the object you want to inherit the methods, followed by a space separated string of methods that you want to inherit. +If you have any plain ole’ JavaScript object (a POJO), then you can inherit any of the Foundation JavaScript utilities by calling the Foundation.inherit method. To use the inherit method, pass in the object you want to inherit the methods, followed by a space separated string of methods that you want to inherit. {{#markdown}} ```javascript @@ -183,7 +183,7 @@ debounce(func, delay, immediate) { ... }

Data Options

-The data_options method parses a semi-colon delimited set of values in the selected element’s data-options HTML attribute. It’s useful for allowing settings to be passed into a script or plugin from the markup. +The data_options method parses a semicolon delimited set of values in the selected element’s data-options HTML attribute. It’s useful for allowing settings to be passed into a script or plugin from the markup.
@@ -225,7 +225,7 @@ data_options(el, data_attr_name) { ... } Media queries are the backbone of most responsive CSS techniques, though they can be a bit unwieldy to deal with. To make them easier to deal with, we’ve included two helper methods (register_media and add_custom_rule), as well as polyfilled the native function matchMedia to work with all the browsers Foundation supports. -Register Media is used to add a new media query to Foundation’s list of JS accessible media queries. These can be found by calling Foundation.media_queries. The method works by appending a meta tag to the head of the document and checking the font-family of the element’s computed styles for the media query string. +Register Media is used to add a new media query to Foundation’s list of JavaScript-accessible media queries. These can be found by calling Foundation.media_queries. The method works by appending a meta tag to the head of the document and checking the font-family of the element’s computed styles for the media query string. Add Custom Rules is a method to add a custom CSS rule as a string to the document. If a media query is passed in the method will apply the style within that media query, otherwise it will be applied globally. @@ -294,7 +294,7 @@ add_custom_rule(rule, media) { ... }

Image Loaded

-While binding to the document ready event is usually good enough for most plugins that manipulate the DOM, sometimes you need ALL the content to be loaded before you start calculating things like element sizes. This is especially important with images, which can take a while to load and drastically affect the layout of the page, depending on their size. +While binding to the document ready event is usually good enough for most plugins that manipulate the DOM, sometimes you need ALL the content to be loaded before you start calculating things like element sizes. This is especially important with images, which can take a while to load and significantly affect the layout of the page, depending on their size. This can be avoided by using the image_loaded method, which lets you pass in a callback to be executed when an image has completely finished loading. Passing in a jQuery selector that matches multiple images will cause the callback to be executed when all of the images are fully loaded.