Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Style and typography fixes, and code style adherence #270

Closed
wants to merge 7 commits into from

3 participants

Markus Amalthea Magnuson Corey Frang adam j. sontag
Markus Amalthea Magnuson

These are some style and typography fixes for the sections index, contributing, and About jQuery.

(I've decided I'm going to do these fixes section by section, opening a new pull request for each one.)

Corey Frang
Owner

This seems to be stale, or at least it's telling me things can't be merged.

Markus Amalthea Magnuson

@gnarf37 Does it work now?

Corey Frang
Owner

It does, though I'll let @ajpiano or @kswedberg or someone else review/land this one.

adam j. sontag
Collaborator

Thanks @alimony and sorry for the delay in reviewing these PRs. However, we shouldn't be using entities when we can just use the literal characters, and we don't want to switch to using to actual "fancy" apostrophes instead of a the easily-typed '. That means we should use — instead of — and not actually switch to ’ Do you think you can make those changes, @alimony ?

adam j. sontag
Collaborator

We also should make this clearer in the style guide

Markus Amalthea Magnuson

@ajpiano I've pushed some additional commits, decoding all entities and using straight apostrophes, as well as some other fixes.

I did a git rebase master on this branch after pulling all changes on master, but somehow a recent commit by @agcolom found its way here. Should I do something about that? Or: Should I in any way shuffle things around in these commits to make it more manageable?

/ Best regards, someone still not 100% comfortable with git :)

alimony added some commits
Markus Amalthea Magnuson alimony Style fixes in CONTRIBUTING.md
* e.g., -> e.g.
* Github -> GitHub
21c316e
Markus Amalthea Magnuson alimony Style fixes in index.html
* Fix unmatched <p> tag
* Always use curly apostrophe
* "just out of the reach" -> "just out of reach"
631c87d
Markus Amalthea Magnuson alimony Style fixes in about-jquery
* Curly apostrophes
* Em dashes
* Proper capitalization of abbreviations (HTML etc.)
* Linkify jsbin.com
445481c
Markus Amalthea Magnuson alimony Code style adherence in how-jquery-works.md 0e7a21e
Markus Amalthea Magnuson alimony Fix trailing whitespace. e246044
Markus Amalthea Magnuson alimony Additional style fixes.
* Decode HTML entities, also using straight apostrophes.
* Remove trailing whitespace.
* Spaces to tabs.
a74c977
Markus Amalthea Magnuson alimony Code style fixes.
* Spaces to tabs.
* More spaces around arguments.
* HTML style guide adherence.
4ad13ff
Markus Amalthea Magnuson

I just accidentally forced pushed to this branch… let me know if anything needs to be done for it to apply.

adam j. sontag ajpiano closed this in 1f48ad2
Markus Amalthea Magnuson alimony referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
Rebecca Murphey rmurphey referenced this pull request from a commit in rmurphey/learn.jquery.com
Rebecca Murphey rmurphey Merge branch 'master' into fix_method_refs
* master: (21 commits)
  0.2.7
  Remove remaining trailing whitespace from all pages. Fixes #313.
  Style and typography fixes, and code style adherence in the JavaScript 101 section. Fixes #312.
  0.2.6
  Correct comment in :input selector in Selecting Elements article. Fixes #306.
  Expand the JavaScript 101 'Scope' article with more useful information and explanations. Fixes #201.
  Added 0 to the list of falsy values in JavaScript 101 Conditional Code article. Fixes #300. Fixes #271
  Inserted missing word in the JavaScript 101 Arrays article. Fixes #299.
  Fixed inconsistency in showLinkLocation example in Basic Plugin Creation article. Fixes #307.
  Fix example and other style cleanup in Basic Plugin Creation article. Fixes #310. Fixes #311.
  Update list of reserved words in JavaScript. Fixes #301.
  Style and typography fixes and code style adherence in the Events section. Fixes #294.
  Style and typography fixes, and code style adherence in the Effects section. Fixes #290.
  Style and typography fixes, and code style adherence in the Code Organization section. Fixes #287.
  Remove double ampersands in README header. Fixes #284.
  Code and prose style improvements to all articles in Ajax chapter. Fixes #283.
  Style fixes on the About page. Fixes #279.
  Style guide fixes for the index, contributing, and About jQuery articles. Fixes #270
  relabel queue/dequeue content as advanced
  Added a missing 'i' in the for loop. Fixes #280.
  ...

Conflicts:
	page/ajax/ajax-and-forms.md
	page/ajax/jquery-ajax-methods.md
	page/effects/custom-effects.md
	page/effects/intro-to-effects.md
	page/events/event-basics.md
	page/events/event-helpers.md
	page/events/introduction-to-custom-events.md
	page/events/triggering-event-handlers.md
bac5e33
Arthur Verschaeve arthurvr referenced this pull request from a commit in arthurvr/learn.jquery.com
Markus Amalthea Magnuson alimony Style guide fixes for the index, contributing, and About jQuery artic…
…les. Fixes #270
9f37a51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 4, 2013
  1. Markus Amalthea Magnuson

    Style fixes in CONTRIBUTING.md

    alimony authored
    * e.g., -> e.g.
    * Github -> GitHub
  2. Markus Amalthea Magnuson

    Style fixes in index.html

    alimony authored
    * Fix unmatched <p> tag
    * Always use curly apostrophe
    * "just out of the reach" -> "just out of reach"
  3. Markus Amalthea Magnuson

    Style fixes in about-jquery

    alimony authored
    * Curly apostrophes
    * Em dashes
    * Proper capitalization of abbreviations (HTML etc.)
    * Linkify jsbin.com
  4. Markus Amalthea Magnuson
  5. Markus Amalthea Magnuson

    Fix trailing whitespace.

    alimony authored
  6. Markus Amalthea Magnuson

    Additional style fixes.

    alimony authored
    * Decode HTML entities, also using straight apostrophes.
    * Remove trailing whitespace.
    * Spaces to tabs.
  7. Markus Amalthea Magnuson

    Code style fixes.

    alimony authored
    * Spaces to tabs.
    * More spaces around arguments.
    * HTML style guide adherence.
This page is out of date. Refresh to see the latest.
2  CONTRIBUTING.md
View
@@ -7,7 +7,7 @@ customFields:
---
Depending on your level of experience with some of the workflows common to many
-open source projects, e.g., git/Github, the command line, and setting up a
+open source projects, e.g. git/GitHub, the command line, and setting up a
local development environment, contributing to this site may be a breeze or
come with a bit of a learning curve. If you fit into the former group, great!
Jump ahead to learn how to get started.
14 page/about-jquery/additional-support.md
View
@@ -27,7 +27,7 @@ There are many subforums where you can discuss jQuery, ask questions, talk about
* [Developing jQuery Plugins](http://forum.jquery.com/developing-jquery-plugins)
* This forum covers development of jQuery plugins.
* [Developing jQuery UI](http://forum.jquery.com/developing-jquery-ui)
- * This is the place to discuss development of [jQuery UI](http://jqueryui.com/) itself - including bugs, new plugins, and how you can help.
+ * This is the place to discuss development of [jQuery UI](http://jqueryui.com/) itself including bugs, new plugins, and how you can help.
* All jQuery UI svn commits are posted to this list to facilitate feedback, discussion, and review.
* Also note that a lot of the development and planning of jQuery UI takes place on the [jQuery UI Development and Planning Wiki](http://wiki.jqueryui.com/).
* [Developing jQuery Mobile](http://forum.jquery.com/developing-jquery-mobile)
@@ -41,12 +41,12 @@ To ensure that you'll get a useful answer in no time, please consider the follow
* Ensure your markup is valid.
* Use Firebug/Developer Tools to see if you have an exception.
-* Use Firebug/Developer Tools to inspect the html classes, css. etc.
-* Try expected resulting html and css without javascript/jQuery and see if the problem could be isolated to those two.
+* Use Firebug/Developer Tools to inspect the HTML classes, CSS, etc.
+* Try expected resulting HTML and CSS without JavaScript/jQuery and see if the problem could be isolated to those two.
* Reduce to a minimal test case (keep removing things until the problem goes away, etc.)
-* Provide that test case as part of your mail. Either upload it somewhere or post it on jsbin.com.
+* Provide that test case as part of your mail. Either upload it somewhere or post it on [jsbin.com](http://jsbin.com/).
-In general, keep your question short and focused and provide only essential details - others can be added when required.
+In general, keep your question short and focused and provide only essential details others can be added when required.
### Mailing List Archives
@@ -71,8 +71,8 @@ The IRC Channel is best if you need quick help with any of the following:
* JavaScript
* jQuery syntax
-* problem solving
-* strange bugs.
+* Problem solving
+* Strange bugs
If your problem is more in-depth, we may ask you to post to the mailing list, or the bug tracker, so that we can help you in a more-suitable environment.
128 page/about-jquery/how-jquery-works.md
View
@@ -5,22 +5,22 @@ level: beginner
### jQuery: The Basics
This is a basic tutorial, designed to help you get started using jQuery. If you
-don't have a test page setup yet, start by creating the following HTML page:
+don't have a test page setup yet, start by creating the following HTML page:
```
<!doctype html>
<html>
- <head>
- <meta charset="utf-8">
- <title>Demo</title>
- </head>
- <body>
- <a href="http://jquery.com/">jQuery</a>
- <script src="jquery.js"></script>
- <script>
- // Your code goes here
- </script>
- </body>
+<head>
+ <meta charset="utf-8">
+ <title>Demo</title>
+</head>
+<body>
+ <a href="http://jquery.com/">jQuery</a>
+ <script src="jquery.js"></script>
+ <script>
+ // Your code goes here
+ </script>
+</body>
</html>
```
@@ -30,22 +30,22 @@ and store the `jquery.js` file in the same directory as your HTML file.
### Launching Code on Document Ready
-To ensure that their code runs after the browser finishes loading the document,
+To ensure that their code runs after the browser finishes loading the document,
many JavaScript programmers wrap their code in an `onload` function:
```
window.onload = function() {
- alert("welcome");
+ alert( "welcome" );
}
```
Unfortunately, the code doesn't run until all images are finished downloading, including banner ads.
-To run code as soon as the `document` is ready to be manipulated, jQuery has a statement
-known as the [ ready event ](http://api.jquery.com/ready):
+To run code as soon as the `document` is ready to be manipulated, jQuery has a statement
+known as the [ready event](http://api.jquery.com/ready):
```
-$( document ).ready( function() {
- // Your code here
+$( document ).ready(function() {
+ // Your code here
});
```
@@ -53,25 +53,25 @@ For example, inside the `ready` event, you can add a click handler to the link:
```
$( document ).ready(function() {
- $("a").click(function( event ) {
- alert("Thanks for visiting!");
- });
+ $( "a" ).click(function( event ) {
+ alert( "Thanks for visiting!" );
+ });
});
```
-Save your HTML file and reload the test page in your browser.
-Clicking the link should now first display an alert pop-up,
+Save your HTML file and reload the test page in your browser.
+Clicking the link should now first display an alert pop-up,
then continue with the default behavior of navigating to http://jquery.com.
-For `click` and most other [events](http://api.jquery.com/category/events/),
+For `click` and most other [events](http://api.jquery.com/category/events/),
you can prevent the default behavior by calling `event.preventDefault()` in the event handler:
```
$( document ).ready(function() {
- $("a").click(function( event ) {
- alert("As you can see, the link no longer took you to jquery.com");
- event.preventDefault();
- });
+ $( "a" ).click(function( event ) {
+ alert( "As you can see, the link no longer took you to jquery.com" );
+ event.preventDefault();
+ });
});
```
@@ -79,28 +79,28 @@ $( document ).ready(function() {
The following example illustrates the click handling code discussed above,
embedded directly in the HTML `<body>`. Note that in practice,
-it is usually better to place your code in a separate JS file
+it is usually better to place your code in a separate JS file
and load it on the page with a `<script>` element's `src` attribute.
```
<!doctype html>
<html>
- <head>
- <meta charset="utf-8">
- <title>Demo</title>
- </head>
- <body>
- <a href="http://jquery.com/">jQuery</a>
- <script src="jquery.js"></script>
- <script>
- $( document ).ready(function() {
- $("a").click(function( event ) {
- alert("The link will no longer take you to jquery.com");
- event.preventDefault();
- });
- });
- </script>
- </body>
+<head>
+ <meta charset="utf-8">
+ <title>Demo</title>
+</head>
+<body>
+ <a href="http://jquery.com/">jQuery</a>
+ <script src="jquery.js"></script>
+ <script>
+ $( document ).ready(function() {
+ $( "a" ).click(function( event ) {
+ alert( "The link will no longer take you to jquery.com" );
+ event.preventDefault();
+ });
+ });
+ </script>
+</body>
</html>
```
@@ -114,16 +114,16 @@ First, add some style information into the `<head>` of the document, like this:
```
<style>
- a.test {
- font-weight: bold;
- }
+a.test {
+ font-weight: bold;
+}
</style>
```
Next, add the [addClass()](http://api.jquery.com/addClass) call to the script:
```
-$("a").addClass("test");
+$( "a" ).addClass( "test" );
```
All `a` elements are now bold.
@@ -131,7 +131,7 @@ All `a` elements are now bold.
To remove an existing `class`, use [removeClass()](http://api.jquery.com/removeClass):
```
-$("a").removeClass("test");
+$( "a" ).removeClass( "test" );
```
### Special Effects
@@ -141,9 +141,9 @@ to help you make your web sites stand out.
For example, if you create a click handler of:
```
-$("a").click(function( event ){
- event.preventDefault();
- $( this ).hide("slow");
+$( "a" ).click(function( event ){
+ event.preventDefault();
+ $( this ).hide( "slow" );
});
```
@@ -155,7 +155,7 @@ Unlike many other programming languages, JavaScript enables you to freely pass f
A *callback* is a function that is passed as an argument to another function and
is executed after its parent function has completed. Callbacks are special because
they patiently wait to execute until their parent finishes.
-Meanwhile, the browser can be executing other functions or doing all sorts of other work.
+Meanwhile, the browser can be executing other functions or doing all sorts of other work.
To use callbacks, it is important to know how to pass them into their parent function.
@@ -172,31 +172,31 @@ When [$.get](http://api.jquery.com/jQuery.get/) finishes getting the page `myhtm
### Callback *with* Arguments
-Executing callbacks with arguments can be tricky.
+Executing callbacks with arguments can be tricky.
#### Wrong
This code example will ***not*** work:
```
-$.get( "myhtmlpage.html", myCallBack(param1, param2) );
+$.get( "myhtmlpage.html", myCallBack( param1, param2 ) );
```
-The reason this fails is that the code executes `myCallBack( param1, param2 )` immediately
-and then passes the myCallBack's *return value* as the second parameter to `$.get`.
-We actually want to pass the function `myCallBack`, not `myCallBack( param1, param2)`'s return value
+The reason this fails is that the code executes `myCallBack( param1, param2 )` immediately
+and then passes myCallBack's *return value* as the second parameter to `$.get`.
+We actually want to pass the function `myCallBack`, not `myCallBack( param1, param2 )`'s return value
(which might or might not be a function). So, how to pass in `myCallBack` *and* include its arguments?
#### Right
To defer executing `myCallBack` with its parameters, you can use an anonymous function as a wrapper.
Note the use of `function() {`. The anonymous function does exactly one thing: calls
-`myCallBack`, with the values of `param1` and `param2`.
+`myCallBack`, with the values of `param1` and `param2`.
```
- $.get( "myhtmlpage.html", function() {
- myCallBack( param1, param2 );
- });
+$.get( "myhtmlpage.html", function() {
+ myCallBack( param1, param2 );
+});
```
When `$.get` finishes getting the page `myhtmlpage.html`, it executes the anonymous function,
-which executes `myCallBack( param1, param2 )`.
+which executes `myCallBack( param1, param2 )`.
36 page/index.html
View
@@ -1,26 +1,24 @@
<script>{
- "title": "jQuery Learning Site",
- "pageTemplate": "home.php",
- "customFields": [{ "key": "icon", "value": "home" }, { "key": "is_chapter", "value": 0 }]
+ "title": "jQuery Learning Site",
+ "pageTemplate": "home.php",
+ "customFields": [{ "key": "icon", "value": "home" }, { "key": "is_chapter", "value": 0 }]
}</script>
<div id="banner-secondary" class="large-banner">
- <h1>Learning Center</h1>
+ <h1>Learning Center</h1>
- <div class="row">
- <aside class="six columns" id="for-users">
- <h2>Users</h2>
- <p>
- There&rsquo;s a lot more to learn about building web sites and applications with jQuery than can fit in API documentation.
- If you&rsquo;re looking for explanations of the basics, workarounds for common problems, best practices, and how-tos, you&rsquo;re in the right place!</p>
- </p>
- </aside>
+ <div class="row">
- <aside class="six columns" id="for-authors">
- <h2>Authors</h2>
- <p>Too much good information is spread across corners of the web, languishing in blog and forum posts, often just out of the reach of
- people who need it, while the same questionable advice is duplicated across even more questionable sites. Help us stem the tide and educate today&apos;s &mdash; and tomorrow&rsquo;s &mdash; web developers.</p>
- </aside>
- </div>
+ <aside class="six columns" id="for-users">
+ <h2>Users</h2>
+ <p>There's a lot more to learn about building web sites and applications with jQuery than can fit in API documentation. If you're looking for explanations of the basics, workarounds for common problems, best practices, and how-tos, you're in the right place!</p>
+ </aside>
-</div>
+ <aside class="six columns" id="for-authors">
+ <h2>Authors</h2>
+ <p>Too much good information is spread across corners of the web, languishing in blog and forum posts, often just out of reach of people who need it, while the same questionable advice is duplicated across even more questionable sites. Help us stem the tide and educate today's — and tomorrow's — web developers.</p>
+ </aside>
+
+ </div>
+
+</div>
Something went wrong with that request. Please try again.