Skip to content

Commit 2f54b03

Browse files
agcolomscottgonzalez
authored andcommitted
Code indentation and formatting (f - j entries)
1 parent 4da88d3 commit 2f54b03

File tree

92 files changed

+2896
-2009
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+2896
-2009
lines changed

entries/each.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ $( "li" ).addClass( "bar" );
4444
<example>
4545
<desc>Iterate over three divs and sets their color property.</desc>
4646
<code><![CDATA[
47-
$( document.body ).click(function () {
48-
$( "div" ).each(function ( i ) {
47+
$( document.body ).click(function() {
48+
$( "div" ).each(function( i ) {
4949
if ( this.style.color != "blue" ) {
5050
this.style.color = "blue";
5151
} else {

entries/empty.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ $( ".hello" ).empty();
3131
<example>
3232
<desc>Removes all child nodes (including text nodes) from all paragraphs</desc>
3333
<code><![CDATA[
34-
$( "button" ).click(function () {
34+
$( "button" ).click(function() {
3535
$( "p" ).empty();
3636
});
3737
]]></code>

entries/fadeIn.xml

+77-45
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,18 @@
2222
<p>The <code>.fadeIn()</code> method animates the opacity of the matched elements. It is similar to the <code><a href="/fadeTo/">.fadeTo()</a></code> method but that method does not unhide the element and can specify the final opacity level.</p>
2323
<p>Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The strings <code>'fast'</code> and <code>'slow'</code> can be supplied to indicate durations of <code>200</code> and <code>600</code> milliseconds, respectively. If any other string is supplied, or if the <code>duration</code> parameter is omitted, the default duration of <code>400</code> milliseconds is used.</p>
2424
<p>We can animate any element, such as a simple image:</p>
25-
<pre><code>&lt;div id="clickme"&gt;
26-
Click here
27-
&lt;/div&gt;
28-
&lt;img id="book" src="book.png" alt="" width="100" height="123" /&gt;
29-
With the element initially hidden, we can show it slowly:
30-
$('#clickme').click(function() {
31-
$('#book').fadeIn('slow', function() {
32-
// Animation complete
33-
});
34-
});</code></pre>
25+
<pre><code>
26+
&lt;div id="clickme"&gt;
27+
Click here
28+
&lt;/div&gt;
29+
&lt;img id="book" src="book.png" alt="" width="100" height="123"&gt;
30+
With the element initially hidden, we can show it slowly:
31+
$( "#clickme" ).click(function() {
32+
$( "#book" ).fadeIn( "slow", function() {
33+
// Animation complete
34+
});
35+
});
36+
</code></pre>
3537
<p class="image four-across">
3638
<img src="/resources/0042_06_33.png" alt=""/>
3739
<img src="/resources/0042_06_34.png" alt=""/>
@@ -42,59 +44,89 @@
4244
<p><strong>As of jQuery 1.4.3</strong>, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called <code>swing</code>, and one that progresses at a constant pace, called <code>linear</code>. More easing functions are available with the use of plug-ins, most notably the <a href="http://jqueryui.com">jQuery UI suite</a>.</p>
4345
<h4 id="callback-function">Callback Function</h4>
4446
<p>If supplied, the callback is fired once the animation is complete. This can be useful for stringing different animations together in sequence. The callback is not sent any arguments, but <code>this</code> is set to the DOM element being animated. If multiple elements are animated, it is important to note that the callback is executed once per matched element, not once for the animation as a whole. </p>
45-
<p><strong>As of jQuery 1.6</strong>, the <code><a href="http://api.jquery.com/promise/">.promise()</a></code> method can be used in conjunction with the <code><a href="http://api.jquery.com/deferred.done/">deferred.done()</a></code> method to execute a single callback for the animation as a whole when <em>all</em> matching elements have completed their animations ( See the <a href="http://api.jquery.com/promise/#example-1">example for .promise()</a> ). </p>
47+
<p><strong>As of jQuery 1.6</strong>, the <code><a href="/promise/">.promise()</a></code> method can be used in conjunction with the <code><a href="/deferred.done/">deferred.done()</a></code> method to execute a single callback for the animation as a whole when <em>all</em> matching elements have completed their animations ( See the <a href="/promise/#example-1">example for .promise()</a> ). </p>
4648
</longdesc>
4749
<note id="jquery.fx.off" type="additional" data-title=".fadeIn()"/>
4850
<example>
4951
<desc>Animates hidden divs to fade in one by one, completing each animation within 600 milliseconds.</desc>
5052
<code><![CDATA[
51-
$(document.body).click(function () {
52-
$("div:hidden:first").fadeIn("slow");
53+
$( document.body ).click(function() {
54+
$( "div:hidden:first" ).fadeIn( "slow" );
5355
});
54-
]]></code>
56+
]]></code>
5557
<css><![CDATA[
56-
span { color:red; cursor:pointer; }
57-
div { margin:3px; width:80px; display:none;
58-
height:80px; float:left; }
59-
div#one { background:#f00; }
60-
div#two { background:#0f0; }
61-
div#three { background:#00f; }
58+
span {
59+
color: red;
60+
cursor: pointer;
61+
}
62+
div {
63+
margin: 3px;
64+
width: 80px;
65+
display: none;
66+
height: 80px;
67+
float: left;
68+
}
69+
div#one {
70+
background: #f00;
71+
}
72+
div#two {
73+
background: #0f0;
74+
}
75+
div#three {
76+
background: #00f;
77+
}
6278
]]></css>
63-
<html><![CDATA[<span>Click here...</span>
64-
65-
<div id="one"></div>
66-
<div id="two"></div>
67-
<div id="three"></div>]]></html>
79+
<html><![CDATA[
80+
<span>Click here...</span>
81+
<div id="one"></div>
82+
<div id="two"></div>
83+
<div id="three"></div>
84+
]]></html>
6885
</example>
6986
<example>
7087
<desc>Fades a red block in over the text. Once the animation is done, it quickly fades in more text on top.</desc>
7188
<code><![CDATA[
72-
$("a").click(function () {
73-
$("div").fadeIn(3000, function () {
74-
$("span").fadeIn(100);
89+
$( "a" ).click(function() {
90+
$( "div" ).fadeIn( 3000, function() {
91+
$( "span" ).fadeIn( 100 );
7592
});
7693
return false;
7794
});
7895
]]></code>
7996
<css><![CDATA[
80-
p { position:relative; width:400px; height:90px; }
81-
div { position:absolute; width:400px; height:65px;
82-
font-size:36px; text-align:center;
83-
color:yellow; background:red;
84-
padding-top:25px;
85-
top:0; left:0; display:none; }
86-
span { display:none; }
87-
]]></css>
88-
<html><![CDATA[<p>
89-
Let it be known that the party of the first part
90-
and the party of the second part are henceforth
91-
and hereto directed to assess the allegations
92-
for factual correctness... (<a href="#">click!</a>)
93-
<div><span>CENSORED!</span></div>
94-
95-
</p>]]></html>
97+
p {
98+
position: relative;
99+
width: 400px;
100+
height: 90px;
101+
}
102+
div {
103+
position: absolute;
104+
width: 400px;
105+
height: 65px;
106+
font-size: 36px;
107+
text-align: center;
108+
color: yellow;
109+
background: red;
110+
padding-top: 25px;
111+
top: 0;
112+
left: 0;
113+
display: none;
114+
}
115+
span {
116+
display: none;
117+
}
118+
]]></css>
119+
<html><![CDATA[
120+
<p>
121+
Let it be known that the party of the first part
122+
and the party of the second part are henceforth
123+
and hereto directed to assess the allegations
124+
for factual correctness... (<a href="#">click!</a>)
125+
<div><span>CENSORED!</span></div>
126+
</p>
127+
]]></html>
96128
</example>
97129
<category slug="effects/fading"/>
98130
<category slug="version/1.0"/>
99131
<category slug="version/1.4.3"/>
100-
</entry>
132+
</entry>

entries/fadeOut.xml

+72-50
Original file line numberDiff line numberDiff line change
@@ -22,101 +22,123 @@
2222
<p>The <code>.fadeOut()</code> method animates the opacity of the matched elements. Once the opacity reaches 0, the <code>display</code> style property is set to <code>none</code>, so the element no longer affects the layout of the page.</p>
2323
<p>Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The strings <code>'fast'</code> and <code>'slow'</code> can be supplied to indicate durations of <code>200</code> and <code>600</code> milliseconds, respectively. If any other string is supplied, or if the <code>duration</code> parameter is omitted, the default duration of <code>400</code> milliseconds is used.</p>
2424
<p>We can animate any element, such as a simple image:</p>
25-
<pre><code>&lt;div id="clickme"&gt;
25+
<pre><code>
26+
&lt;div id="clickme"&gt;
2627
Click here
2728
&lt;/div&gt;
28-
&lt;img id="book" src="book.png" alt="" width="100" height="123" /&gt;</code></pre>
29+
&lt;img id="book" src="book.png" alt="" width="100" height="123"&gt;
30+
</code></pre>
2931
<p>With the element initially shown, we can hide it slowly:</p>
30-
<pre><code>$('#clickme').click(function() {
31-
$('#book').fadeOut('slow', function() {
32+
<pre><code>
33+
$( "#clickme" ).click(function() {
34+
$( "#book" ).fadeOut( "slow", function() {
3235
// Animation complete.
3336
});
34-
});</code></pre>
37+
});
38+
</code></pre>
3539
<p class="image four-across">
3640
<img src="/resources/0042_06_37.png" alt=""/>
3741
<img src="/resources/0042_06_38.png" alt=""/>
3842
<img src="/resources/0042_06_39.png" alt=""/>
3943
<img src="/resources/0042_06_40.png" alt=""/>
4044
</p>
4145
<div class="warning">
42-
<p><strong>Note: </strong>To avoid unnecessary DOM manipulation, <code>.fadeOut()</code> will not hide an element that is already considered hidden. For information on which elements jQuery considers hidden, see <a href="http://api.jquery.com/hidden-selector"> :hidden Selector</a>.</p>
46+
<p><strong>Note: </strong>To avoid unnecessary DOM manipulation, <code>.fadeOut()</code> will not hide an element that is already considered hidden. For information on which elements jQuery considers hidden, see <a href="/hidden-selector/"> :hidden Selector</a>.</p>
4347
</div>
4448
<h4 id="easing">Easing</h4>
4549
<p><strong>As of jQuery 1.4.3</strong>, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called <code>swing</code>, and one that progresses at a constant pace, called <code>linear</code>. More easing functions are available with the use of plug-ins, most notably the <a href="http://jqueryui.com">jQuery UI suite</a>.</p>
4650
<h4 id="callback-function">Callback Function</h4>
4751
<p>If supplied, the callback is fired once the animation is complete. This can be useful for stringing different animations together in sequence. The callback is not sent any arguments, but <code>this</code> is set to the DOM element being animated. If multiple elements are animated, it is important to note that the callback is executed once per matched element, not once for the animation as a whole.</p>
48-
<p><strong>As of jQuery 1.6</strong>, the <code><a href="http://api.jquery.com/promise/">.promise()</a></code> method can be used in conjunction with the <code><a href="http://api.jquery.com/deferred.done/">deferred.done()</a></code> method to execute a single callback for the animation as a whole when <em>all</em> matching elements have completed their animations ( See the <a href="http://api.jquery.com/promise/#example-1">example for .promise()</a> ). </p>
52+
<p><strong>As of jQuery 1.6</strong>, the <code><a href="/promise/">.promise()</a></code> method can be used in conjunction with the <code><a href="/deferred.done/">deferred.done()</a></code> method to execute a single callback for the animation as a whole when <em>all</em> matching elements have completed their animations ( See the <a href="/promise/#example-1">example for .promise()</a> ). </p>
4953
</longdesc>
5054
<note id="jquery.fx.off" type="additional" data-title=".fadeOut()"/>
5155
<example>
5256
<desc>Animates all paragraphs to fade out, completing the animation within 600 milliseconds.</desc>
5357
<code><![CDATA[
54-
$("p").click(function () {
55-
$("p").fadeOut("slow");
56-
});
57-
]]></code>
58+
$( "p" ).click(function() {
59+
$( "p" ).fadeOut( "slow" );
60+
});
61+
]]></code>
5862
<css><![CDATA[
59-
p { font-size:150%; cursor:pointer; }
60-
]]></css>
61-
<html><![CDATA[<p>
63+
p {
64+
font-size: 150%;
65+
cursor: pointer;
66+
}
67+
]]></css>
68+
<html><![CDATA[
69+
<p>
6270
If you click on this paragraph
6371
you'll see it just fade away.
64-
</p>]]></html>
72+
</p>
73+
]]></html>
6574
</example>
6675
<example>
6776
<desc>Fades out spans in one section that you click on.</desc>
6877
<code><![CDATA[
69-
70-
$("span").click(function () {
71-
$(this).fadeOut(1000, function () {
72-
$("div").text("'" + $(this).text() + "' has faded!");
73-
$(this).remove();
74-
});
75-
});
76-
$("span").hover(function () {
77-
$(this).addClass("hilite");
78-
}, function () {
79-
$(this).removeClass("hilite");
78+
$( "span" ).click(function() {
79+
$( this ).fadeOut( 1000, function() {
80+
$( "div" ).text( "'" + $( this ).text() + "' has faded!" );
81+
$( this ).remove();
8082
});
81-
82-
]]></code>
83+
});
84+
$( "span" ).hover(function() {
85+
$( this ).addClass( "hilite" );
86+
}, function() {
87+
$( this ).removeClass( "hilite" );
88+
});
89+
]]></code>
8390
<css><![CDATA[
84-
span { cursor:pointer; }
85-
span.hilite { background:yellow; }
86-
div { display:inline; color:red; }
87-
]]></css>
88-
<html><![CDATA[<h3>Find the modifiers - <div></div></h3>
89-
<p>
91+
span {
92+
cursor: pointer;
93+
}
94+
span.hilite {
95+
background: yellow;
96+
}
97+
div {
98+
display: inline;
99+
color: red;
100+
}
101+
]]></css>
102+
<html><![CDATA[
103+
<h3>Find the modifiers - <div></div></h3>
104+
<p>
90105
If you <span>really</span> want to go outside
91106
<span>in the cold</span> then make sure to wear
92107
your <span>warm</span> jacket given to you by
93108
your <span>favorite</span> teacher.
94-
</p>]]></html>
109+
</p>
110+
]]></html>
95111
</example>
96112
<example>
97113
<desc>Fades out two divs, one with a "linear" easing and one with the default, "swing," easing.</desc>
98114
<code><![CDATA[
99-
$("#btn1").click(function() {
115+
$( "#btn1" ).click(function() {
100116
function complete() {
101-
$("<div/>").text(this.id).appendTo("#log");
117+
$( "<div/>" ).text( this.id ).appendTo( "#log" );
102118
}
103-
104-
$("#box1").fadeOut(1600, "linear", complete);
105-
$("#box2").fadeOut(1600, complete);
119+
$( "#box1" ).fadeOut( 1600, "linear", complete );
120+
$( "#box2" ).fadeOut( 1600, complete );
106121
});
107122
108-
$("#btn2").click(function() {
109-
$("div").show();
110-
$("#log").empty();
123+
$( "#btn2" ).click(function() {
124+
$( "div" ).show();
125+
$( "#log" ).empty();
111126
});
112-
113127
]]></code>
114128
<css><![CDATA[
115-
.box,
116-
button { float:left; margin:5px 10px 5px 0; }
117-
.box { height:80px; width:80px; background:#090; }
118-
#log { clear:left; }
119-
129+
.box,
130+
button {
131+
float: left;
132+
margin: 5px 10px 5px 0;
133+
}
134+
.box {
135+
height: 80px;
136+
width: 80px;
137+
background: #090;
138+
}
139+
#log {
140+
clear: left;
141+
}
120142
]]></css>
121143
<html><![CDATA[
122144
<button id="btn1">fade out</button>
@@ -131,4 +153,4 @@ button { float:left; margin:5px 10px 5px 0; }
131153
<category slug="effects/fading"/>
132154
<category slug="version/1.0"/>
133155
<category slug="version/1.4.3"/>
134-
</entry>
156+
</entry>

0 commit comments

Comments
 (0)