Skip to content

Commit e0244b0

Browse files
Build: Add .editorconfig file (#877)
The vast majority of XML files in the repo use two spaces today, and even the files that contain tabs, do so only among many more lines in the same file that are indented with spaces instead. As such, for now, normalize toward two spaces so that only a few files need to edited. The exception is the JS and XSL files, of which the are only two of each. In accordance with jQuery Style Guide, keep those as tabs. ``` $ git grep $'\t' | cut -d':' -f1 | sort | uniq Gruntfile.js entries2html.xsl notes.xsl resources/events.js git grep $' ' | cut -d':' -f1 | sort | uniq … ``` Closes #877. Co-authored-by: Aurelio De Rosa <aurelioderosa@gmail.com>
1 parent bd7a1a0 commit e0244b0

20 files changed

+183
-170
lines changed

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.js, *.xsl]
13+
indent_style = tab

categories.xml

+36-36
Original file line numberDiff line numberDiff line change
@@ -190,15 +190,15 @@ var files = event.originalEvent.dataTransfer.files;
190190
</category>
191191
</category>
192192
<category name="Forms" slug="forms">
193-
<desc><![CDATA[These methods and event handlers handle forms and their various elements.]]></desc>
193+
<desc><![CDATA[These methods and event handlers handle forms and their various elements.]]></desc>
194194
</category>
195195
<category name="Internals" slug="internals">
196196
<desc><![CDATA[Although this category is referred to as 'internal', any methods documented within the API site should be considered public and may be freely used. ]]></desc>
197197
</category>
198198
<category name="Manipulation" slug="manipulation">
199199
<desc><![CDATA[All of the methods in this section manipulate the DOM in some manner. A few of them simply change one of the attributes of an element (also listed in the <a href="/category/attributes/">Attributes category</a>), while others set an element's style properties (also listed in the <a href="/category/css/">CSS category</a>). Still others modify entire elements (or groups of elements) themselves&#x2014;inserting, copying, removing, and so on. All of these methods are referred to as "setters," as they change the values of properties.
200-
A few of these methods&#x2014;such as <code>.attr()</code>, <code>.html()</code>, and <code>.val()</code>&#x2014;also act as "getters," retrieving information from DOM elements for later use.
201-
]]></desc>
200+
A few of these methods&#x2014;such as <code>.attr()</code>, <code>.html()</code>, and <code>.val()</code>&#x2014;also act as "getters," retrieving information from DOM elements for later use.
201+
]]></desc>
202202
<category name="Class Attribute" slug="class-attribute">
203203
<desc><![CDATA[These methods inspect and manipulate the CSS classes assigned to elements.]]></desc>
204204
</category>
@@ -327,73 +327,73 @@ var files = event.originalEvent.dataTransfer.files;
327327
<desc/>
328328
<category name="Version 1.0" slug="1.0">
329329
<desc><![CDATA[All the aspects of the API that were added, or had a new signature added, in the corresponding version of jQuery.
330-
<a href="https://blog.jquery.com/2006/08/26/jquery-10/">jQuery 1.0 Release Notes</a>.
331-
]]></desc>
330+
<a href="https://blog.jquery.com/2006/08/26/jquery-10/">jQuery 1.0 Release Notes</a>.
331+
]]></desc>
332332
</category>
333333
<category name="Version 1.0.4" slug="1.0.4">
334334
<desc><![CDATA[All the aspects of the API that were added, or had a new signature added, in the corresponding version of jQuery.
335-
Release Notes: <a href="https://blog.jquery.com/2006/08/31/jquery-101/">1.0.1</a>, <a href="https://blog.jquery.com/2006/10/09/jquery-102/">1.0.2</a>, <a href="https://blog.jquery.com/2006/10/27/jquery-103/">1.0.3</a>, <a href="https://blog.jquery.com/2006/12/12/jquery-104/">1.0.4</a>.
336-
]]></desc>
335+
Release Notes: <a href="https://blog.jquery.com/2006/08/31/jquery-101/">1.0.1</a>, <a href="https://blog.jquery.com/2006/10/09/jquery-102/">1.0.2</a>, <a href="https://blog.jquery.com/2006/10/27/jquery-103/">1.0.3</a>, <a href="https://blog.jquery.com/2006/12/12/jquery-104/">1.0.4</a>.
336+
]]></desc>
337337
</category>
338338
<category name="Version 1.1" slug="1.1">
339339
<desc><![CDATA[All the aspects of the API that were added, or had a new signature added, in the corresponding version of jQuery.
340-
<a href="https://blog.jquery.com/2007/01/14/jquery-birthday-11-new-site-new-docs/">jQuery 1.1 Release Notes</a>.
341-
]]></desc>
340+
<a href="https://blog.jquery.com/2007/01/14/jquery-birthday-11-new-site-new-docs/">jQuery 1.1 Release Notes</a>.
341+
]]></desc>
342342
</category>
343343
<category name="Version 1.1.2" slug="1.1.2">
344344
<desc><![CDATA[All the aspects of the API that were added, or had a new signature added, in the corresponding version of jQuery.
345-
<a href="https://blog.jquery.com/2007/02/27/jquery-112/">jQuery 1.1.2 Release Notes</a>.
346-
]]></desc>
345+
<a href="https://blog.jquery.com/2007/02/27/jquery-112/">jQuery 1.1.2 Release Notes</a>.
346+
]]></desc>
347347
</category>
348348
<category name="Version 1.1.3" slug="1.1.3">
349349
<desc><![CDATA[All the aspects of the API that were added, or had a new signature added, in the corresponding version of jQuery.
350-
<a href="https://blog.jquery.com/2007/07/01/jquery-113-800-faster-still-20kb/">jQuery 1.1.3 Release Notes</a>
351-
]]></desc>
350+
<a href="https://blog.jquery.com/2007/07/01/jquery-113-800-faster-still-20kb/">jQuery 1.1.3 Release Notes</a>
351+
]]></desc>
352352
</category>
353353
<category name="Version 1.1.4" slug="1.1.4">
354354
<desc><![CDATA[All the aspects of the API that were added, or had a new signature added, in the corresponding version of jQuery.
355-
<a href="https://blog.jquery.com/2007/08/24/jquery-114-faster-more-tests-ready-for-12/">jQuery 1.1.4 Release Notes</a>.
356-
]]></desc>
355+
<a href="https://blog.jquery.com/2007/08/24/jquery-114-faster-more-tests-ready-for-12/">jQuery 1.1.4 Release Notes</a>.
356+
]]></desc>
357357
</category>
358358
<category name="Version 1.2" slug="1.2">
359359
<desc><![CDATA[All the aspects of the API that were added, or had a new signature added, in the corresponding version of jQuery.
360-
<a href="https://blog.jquery.com/2007/09/10/jquery-1-2-released/">jQuery 1.2 Release Notes</a>
361-
]]></desc>
360+
<a href="https://blog.jquery.com/2007/09/10/jquery-1-2-released/">jQuery 1.2 Release Notes</a>
361+
]]></desc>
362362
</category>
363363
<category name="Version 1.2.3" slug="1.2.3">
364364
<desc><![CDATA[All the aspects of the API that were added, or had a new signature added, in the corresponding version of jQuery.
365-
Release Notes: <a href="https://blog.jquery.com/2007/09/16/jquery-1-2-1-released/">1.2.1</a>, <a href="https://blog.jquery.com/2008/01/14/jquery-1-2-2-released/">1.2.2</a>, <a href="https://blog.jquery.com/2008/02/07/jquery-1-2-3-released/">1.2.3</a>.
366-
]]></desc>
365+
Release Notes: <a href="https://blog.jquery.com/2007/09/16/jquery-1-2-1-released/">1.2.1</a>, <a href="https://blog.jquery.com/2008/01/14/jquery-1-2-2-released/">1.2.2</a>, <a href="https://blog.jquery.com/2008/02/07/jquery-1-2-3-released/">1.2.3</a>.
366+
]]></desc>
367367
</category>
368368
<category name="Version 1.2.6" slug="1.2.6">
369369
<desc><![CDATA[All the aspects of the API that were added, or had a new signature added, in the corresponding version of jQuery.
370-
<a href="https://blog.jquery.com/2008/05/24/jquery-1-2-6-released/">jQuery 1.2.6 Release Notes</a>.
371-
]]></desc>
370+
<a href="https://blog.jquery.com/2008/05/24/jquery-1-2-6-released/">jQuery 1.2.6 Release Notes</a>.
371+
]]></desc>
372372
</category>
373373
<category name="Version 1.3" slug="1.3">
374374
<desc><![CDATA[All the aspects of the API that were added, or had a new signature added, in the corresponding version of jQuery.
375-
Release Notes: <a href="https://blog.jquery.com/2009/01/14/jquery-1-3-released/">1.3</a>, <a href="https://blog.jquery.com/2009/01/21/jquery-131-released/">1.3.1</a>, <a href="https://blog.jquery.com/2009/02/20/jquery-1-3-2-released/">1.3.2</a>
376-
]]></desc>
375+
Release Notes: <a href="https://blog.jquery.com/2009/01/14/jquery-1-3-released/">1.3</a>, <a href="https://blog.jquery.com/2009/01/21/jquery-131-released/">1.3.1</a>, <a href="https://blog.jquery.com/2009/02/20/jquery-1-3-2-released/">1.3.2</a>
376+
]]></desc>
377377
</category>
378378
<category name="Version 1.4" slug="1.4">
379379
<desc><![CDATA[All the aspects of the API that were added, or had a new signature added, in the corresponding version of jQuery.
380-
<a href="https://web.archive.org/web/20150119205819/http://jquery14.com/day-01/jquery-14">jQuery 1.4 Release Notes</a>.
381-
]]></desc>
380+
<a href="https://web.archive.org/web/20150119205819/http://jquery14.com/day-01/jquery-14">jQuery 1.4 Release Notes</a>.
381+
]]></desc>
382382
</category>
383383
<category name="Version 1.4.1" slug="1.4.1">
384384
<desc><![CDATA[All the aspects of the API that were added, or had a new signature added, in the corresponding version of jQuery.
385-
<a href="https://web.archive.org/web/20150213113058/http://jquery14.com/day-12/jquery-141-released">jQuery 1.4.1 Release Notes</a>.
386-
]]></desc>
385+
<a href="https://web.archive.org/web/20150213113058/http://jquery14.com/day-12/jquery-141-released">jQuery 1.4.1 Release Notes</a>.
386+
]]></desc>
387387
</category>
388388
<category name="Version 1.4.2" slug="1.4.2">
389389
<desc><![CDATA[All the aspects of the API that were added, or had a new signature added, in the corresponding version of jQuery.
390-
<a href="https://blog.jquery.com/2010/02/19/jquery-142-released/">jQuery 1.4.2 Release Notes</a>.
391-
]]></desc>
390+
<a href="https://blog.jquery.com/2010/02/19/jquery-142-released/">jQuery 1.4.2 Release Notes</a>.
391+
]]></desc>
392392
</category>
393393
<category name="Version 1.4.3" slug="1.4.3">
394394
<desc><![CDATA[All the aspects of the API that were added, or had a new signature added, in the corresponding version of jQuery.
395-
<a href="https://blog.jquery.com/2010/10/16/jquery-143-released/">jQuery 1.4.3 Release Notes</a>.
396-
]]></desc>
395+
<a href="https://blog.jquery.com/2010/10/16/jquery-143-released/">jQuery 1.4.3 Release Notes</a>.
396+
]]></desc>
397397
</category>
398398
<category name="Version 1.4.4" slug="1.4.4">
399399
<desc><![CDATA[All the aspects of the API that were added, or had a new signature added, in the corresponding version of jQuery. <a href="https://blog.jquery.com/2010/11/11/jquery-1-4-4-release-notes/">jQuery 1.4.4 Release Notes</a>.]]></desc>
@@ -414,11 +414,11 @@ var files = event.originalEvent.dataTransfer.files;
414414
<category name="Version 1.7" slug="1.7">
415415
<desc><![CDATA[
416416
<p>Aspects of the API that were changed in the corresponding version of jQuery. API changes in jQuery 1.7.0 dealt primarily with the new
417-
Event APIs: <code>.on()</code> and <code>.off()</code>
418-
Better Support for HTML5 in IE6/7/8
419-
<code>jQuery.Callbacks()</code>
420-
Toggling Animations Work Intuitively
421-
</p>
417+
Event APIs: <code>.on()</code> and <code>.off()</code>
418+
Better Support for HTML5 in IE6/7/8
419+
<code>jQuery.Callbacks()</code>
420+
Toggling Animations Work Intuitively
421+
</p>
422422
<p>For more information, see the Release Notes/Changelog at <a href="https://blog.jquery.com/2011/11/03/jquery-1-7-released/">https://blog.jquery.com/2011/11/03/jquery-1-7-released/</a></p>
423423
<hr/>
424424
]]></desc>

config-sample.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"url": "vagrant.api.jquery.com",
3-
"username": "admin",
4-
"password": "secret"
2+
"url": "vagrant.api.jquery.com",
3+
"username": "admin",
4+
"password": "secret"
55
}

entries/appendTo.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ $( "h2" ).appendTo( $( ".container" ) );
5454
&lt;/div&gt;
5555
</code></pre>
5656
<p>If there is more than one target element, however, cloned copies of the inserted element will be created for each target except the last, and that new set (the original element plus clones) is returned.</p>
57-
<p><strong>Before jQuery 1.9,</strong> the append-to-single-element case did not create a new set, but instead returned the original set which made it difficult to use the <code>.end()</code> method reliably when being used with an unknown number of elements.</p>
57+
<p><strong>Before jQuery 1.9,</strong> the append-to-single-element case did not create a new set, but instead returned the original set which made it difficult to use the <code>.end()</code> method reliably when being used with an unknown number of elements.</p>
5858
</longdesc>
5959
<note id="html-code-execution" type="additional"/>
6060
<note id="svg-support" type="additional"/>

entries/innerHeight.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<figcaption>Figure 1 - Illustration of the measured height</figcaption>
1717
</figure>
1818
</longdesc>
19-
<note id="dimensions-number" type="additional" data-title=".innerHeight()"/>
19+
<note id="dimensions-number" type="additional" data-title=".innerHeight()"/>
2020
<note id="hidden-element-dimensions" type="additional" data-title=".innerHeight()"/>
2121
<example>
2222
<desc>Get the innerHeight of a paragraph.</desc>

entries/innerWidth.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<figcaption>Figure 1 - Illustration of the measured width</figcaption>
1616
</figure>
1717
</longdesc>
18-
<note id="dimensions-number" type="additional" data-title=".innerWidth()"/>
18+
<note id="dimensions-number" type="additional" data-title=".innerWidth()"/>
1919
<note id="hidden-element-dimensions" type="additional" data-title=".innerWidth()"/>
2020
<example>
2121
<desc>Get the innerWidth of a paragraph.</desc>
@@ -45,9 +45,9 @@ $( "p" ).last().text( "innerWidth:" + p.innerWidth() );
4545
<signature>
4646
<added>1.8</added>
4747
<argument name="value">
48-
<type name="String"/>
49-
<type name="Number"/>
50-
<desc>A number representing the number of pixels, or a number along with an optional unit of measure appended (as a string).</desc>
48+
<type name="String"/>
49+
<type name="Number"/>
50+
<desc>A number representing the number of pixels, or a number along with an optional unit of measure appended (as a string).</desc>
5151
</argument>
5252
</signature>
5353
<signature>

entries/jQuery.parseHTML.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
<p><code>jQuery.parseHTML</code> uses native methods to convert the string to a set of DOM nodes, which can then be inserted into the document. These methods do render all trailing or leading text (even if that's just whitespace). To prevent trailing/leading whitespace from being converted to text nodes you can pass the HTML string through <a href="/jQuery.trim/"><code>jQuery.trim</code></a>.</p>
1919
<p>By default, the <code>context</code> is the current <code>document</code> if not specified or given as <code>null</code> or <code>undefined</code>. If the HTML was to be used in another document such as an iframe, that frame's document could be used.</p>
2020
<p>As of 3.0 the default behavior is changed. If the <code>context</code> is not specified or given as <code>null</code> or <code>undefined</code>, a new <code>document</code> is used. This can potentially improve security because inline events will not execute when the HTML is parsed. Once the parsed HTML is injected into a document it does execute, but this gives tools a chance to traverse the created DOM and remove anything deemed unsafe. This improvement does not apply to internal uses of <code>jQuery.parseHTML</code> as they usually pass in the current <code>document</code>. Therefore, a statement like <code>$( "#log" ).append( $( htmlString ) )</code> is still subject to the injection of malicious code.</p>
21-
<h2>Security Considerations</h2>
22-
<p>Most jQuery APIs that accept HTML strings will run scripts that are included in the HTML. <code>jQuery.parseHTML</code> does not run scripts in the parsed HTML unless <code>keepScripts</code> is explicitly <code>true</code>. However, it is still possible in most environments to execute scripts indirectly, for example via the <code>&lt;img onerror&gt;</code> attribute. The caller should be aware of this and guard against it by cleaning or escaping any untrusted inputs from sources such as the URL or cookies. For future compatibility, callers should not depend on the ability to run <em>any</em> script content when <code>keepScripts</code> is unspecified or <code>false</code>.</p>
21+
<h2>Security Considerations</h2>
22+
<p>Most jQuery APIs that accept HTML strings will run scripts that are included in the HTML. <code>jQuery.parseHTML</code> does not run scripts in the parsed HTML unless <code>keepScripts</code> is explicitly <code>true</code>. However, it is still possible in most environments to execute scripts indirectly, for example via the <code>&lt;img onerror&gt;</code> attribute. The caller should be aware of this and guard against it by cleaning or escaping any untrusted inputs from sources such as the URL or cookies. For future compatibility, callers should not depend on the ability to run <em>any</em> script content when <code>keepScripts</code> is unspecified or <code>false</code>.</p>
2323
</longdesc>
2424
<example>
2525
<desc>Create an array of DOM nodes using an HTML string and insert it into a div.</desc>

entries/offset.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
<p>The <code>.offset()</code> method allows us to retrieve the current position of an element (specifically its border box, which excludes margins) <em>relative to the document</em>. Contrast this with <code><a href="/position/">.position()</a></code>, which retrieves the current position <em>relative to the offset parent</em>. When positioning a new element on top of an existing one for global manipulation (in particular, for implementing drag-and-drop), <code>.offset()</code> is more useful.</p>
1212
<p><code>.offset()</code> returns an object containing the properties <code>top</code> and <code>left</code>.</p>
1313
<div class="warning">
14-
<p><strong>Note:</strong> jQuery does not support getting the offset coordinates of hidden elements or accounting for margins set on the <code>&lt;html&gt;</code> document element.</p>
14+
<p><strong>Note:</strong> jQuery does not support getting the offset coordinates of hidden elements or accounting for margins set on the <code>&lt;html&gt;</code> document element.</p>
1515
<p>While it is possible to get the coordinates of elements with <code>visibility:hidden</code> set, <code>display:none</code> is excluded from the rendering tree and thus has a position that is undefined.</p>
1616
</div>
1717
</longdesc>
18-
<note id="dimensions-number" type="additional" data-title=".offset()"/>
18+
<note id="dimensions-number" type="additional" data-title=".offset()"/>
1919
<example>
2020
<desc>Access the offset of the second paragraph:</desc>
2121
<code><![CDATA[
@@ -90,7 +90,7 @@ $( "*", document.body ).on( "click", function( event ) {
9090
<argument name="function" type="Function">
9191
<argument name="index" type="Integer" />
9292
<argument name="coords" type="PlainObject" />
93-
<return type="PlainObject" />
93+
<return type="PlainObject" />
9494
<desc>A function to return the coordinates to set. Receives the index of the element in the collection as the first argument and the current coordinates as the second argument. The function should return an object with the new <code>top</code> and <code>left</code> properties.</desc>
9595
</argument>
9696
</signature>

entries/outerHeight.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<figcaption>Figure 1 - Illustration of the measured height</figcaption>
1919
</figure>
2020
</longdesc>
21-
<note id="dimensions-number" type="additional" data-title=".outerHeight()"/>
21+
<note id="dimensions-number" type="additional" data-title=".outerHeight()"/>
2222
<note id="hidden-element-dimensions" type="additional" data-title=".outerHeight()"/>
2323
<example>
2424
<desc>Get the outerHeight of a paragraph.</desc>

entries/outerWidth.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<figcaption>Figure 1 - Illustration of the measured width</figcaption>
1919
</figure>
2020
</longdesc>
21-
<note id="dimensions-number" type="additional" data-title=".outerWidth()"/>
21+
<note id="dimensions-number" type="additional" data-title=".outerWidth()"/>
2222
<note id="hidden-element-dimensions" type="additional" data-title=".outerWidth()"/>
2323
<example>
2424
<desc>Get the outerWidth of a paragraph.</desc>

entries/position.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<p><strong>Note:</strong> jQuery does not support getting the position coordinates of hidden elements or accounting for margins set on the <code>&lt;html&gt;</code> document element.</p>
1313
</div>
1414
</longdesc>
15-
<note id="dimensions-number" type="additional" data-title=".position()"/>
15+
<note id="dimensions-number" type="additional" data-title=".position()"/>
1616
<example>
1717
<desc>Access the position of the second paragraph:</desc>
1818
<code><![CDATA[

0 commit comments

Comments
 (0)