Skip to content
This repository was archived by the owner on Sep 28, 2021. It is now read-only.

Commit c5e4d2c

Browse files
committed
chore: update documentation
1 parent 7d72aa1 commit c5e4d2c

File tree

3 files changed

+22
-19
lines changed

3 files changed

+22
-19
lines changed

assets/anchor.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/* eslint-env amd, node */
77

88
// https://github.com/umdjs/umd/blob/master/templates/returnExports.js
9-
(function(root, factory) {
9+
(function (root, factory) {
1010
'use strict';
1111
if (typeof define === 'function' && define.amd) {
1212
// AMD. Register as an anonymous module.
@@ -21,7 +21,7 @@
2121
root.AnchorJS = factory();
2222
root.anchors = new root.AnchorJS();
2323
}
24-
})(this, function() {
24+
})(this, function () {
2525
'use strict';
2626
function AnchorJS(options) {
2727
this.options = options || {};
@@ -51,7 +51,7 @@
5151
* https://github.com/Modernizr/Modernizr/blob/da22eb27631fc4957f67607fe6042e85c0a84656/feature-detects/touchevents.js#L40
5252
* @returns {Boolean} - true if the current device supports touch.
5353
*/
54-
this.isTouchDevice = function() {
54+
this.isTouchDevice = function () {
5555
return !!(
5656
'ontouchstart' in window ||
5757
(window.DocumentTouch && document instanceof DocumentTouch)
@@ -64,7 +64,7 @@
6464
* to. Also accepts an array or nodeList containing the relavant elements.
6565
* @returns {this} - The AnchorJS object
6666
*/
67-
this.add = function(selector) {
67+
this.add = function (selector) {
6868
var elements,
6969
elsWithIds,
7070
idList,
@@ -193,7 +193,7 @@
193193
* OR a nodeList / array containing the DOM elements.
194194
* @returns {this} - The AnchorJS object
195195
*/
196-
this.remove = function(selector) {
196+
this.remove = function (selector) {
197197
var index,
198198
domAnchor,
199199
elements = _getElements(selector);
@@ -216,7 +216,7 @@
216216
/**
217217
* Removes all anchorjs links. Mostly used for tests.
218218
*/
219-
this.removeAll = function() {
219+
this.removeAll = function () {
220220
this.remove(this.elements);
221221
};
222222

@@ -229,7 +229,7 @@
229229
* @param {String} text - Any text. Usually pulled from the webpage element we are linking to.
230230
* @returns {String} - hyphen-delimited text for use in IDs and URLs.
231231
*/
232-
this.urlify = function(text) {
232+
this.urlify = function (text) {
233233
// Regex for finding the nonsafe URL characters (many need escaping): & +$,:;=?@"#{}|^~[`%!'<>]./()*\
234234
var nonsafeChars = /[& +$,:;=?@"#{}|^~[`%!'<>\]\.\/\(\)\*\\]/g,
235235
urlText;
@@ -260,7 +260,7 @@
260260
* @param {HTMLElemnt} el - a DOM node
261261
* @returns {Boolean} true/false
262262
*/
263-
this.hasAnchorJSLink = function(el) {
263+
this.hasAnchorJSLink = function (el) {
264264
var hasLeftAnchor =
265265
el.firstChild &&
266266
(' ' + el.firstChild.className + ' ').indexOf(' anchorjs-link ') > -1,

assets/site.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ anchors.add('h3');
77
// Filter UI
88
var tocElements = document.getElementById('toc').getElementsByTagName('li');
99

10-
document.getElementById('filter-input').addEventListener('keyup', function(e) {
10+
document.getElementById('filter-input').addEventListener('keyup', function (e) {
1111
var i, element, children;
1212

1313
// enter key
@@ -22,14 +22,14 @@ document.getElementById('filter-input').addEventListener('keyup', function(e) {
2222
}
2323
}
2424

25-
var match = function() {
25+
var match = function () {
2626
return true;
2727
};
2828

2929
var value = this.value.toLowerCase();
3030

3131
if (!value.match(/^\s*$/)) {
32-
match = function(element) {
32+
match = function (element) {
3333
var html = element.firstChild.innerHTML;
3434
return html && html.toLowerCase().indexOf(value) !== -1;
3535
};
@@ -114,12 +114,12 @@ var cw_without_sb = split_left.clientWidth;
114114
split_left.style.overflow = '';
115115

116116
Split(['#split-left', '#split-right'], {
117-
elementStyle: function(dimension, size, gutterSize) {
117+
elementStyle: function (dimension, size, gutterSize) {
118118
return {
119119
'flex-basis': 'calc(' + size + '% - ' + gutterSize + 'px)'
120120
};
121121
},
122-
gutterStyle: function(dimension, gutterSize) {
122+
gutterStyle: function (dimension, gutterSize) {
123123
return {
124124
'flex-basis': gutterSize + 'px'
125125
};
@@ -152,9 +152,9 @@ function loadState(ev) {
152152
}
153153
}
154154

155-
window.addEventListener('load', function() {
155+
window.addEventListener('load', function () {
156156
// Restore after Firefox scrolls to hash.
157-
setTimeout(function() {
157+
setTimeout(function () {
158158
loadState();
159159
// Update with initial scroll position.
160160
updateState();

index.html

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset='utf-8'>
5-
<title>ipfs-http-response 0.5.0 | Documentation</title>
5+
<title>ipfs-http-response 0.5.1 | Documentation</title>
66
<meta name='description' content='Creates an HTTP response from an IPFS Hash'>
77
<meta name='viewport' content='width=device-width,initial-scale=1'>
88
<link href='assets/bass.css' rel='stylesheet'>
@@ -15,11 +15,14 @@
1515
<div id='split-left' class='overflow-auto fs0 height-viewport-100'>
1616
<div class='py1 px2'>
1717
<h3 class='mb0 no-anchor'>ipfs-http-response</h3>
18-
<div class='mb1'><code>0.5.0</code></div>
18+
<div class='mb1'><code>0.5.1</code></div>
1919
<input
2020
placeholder='Filter'
2121
id='filter-input'
2222
class='col12 block input'
23+
spellcheck='false'
24+
autocapitalize='off'
25+
autocorrect='off'
2326
type='text' />
2427
<div id='toc'>
2528
<ul class='list-reset h5 py1-ul'>
@@ -58,10 +61,10 @@ <h2>Download</h2>
5861
<p>You can then <code>require()</code> ipfs-http-response as normal:</p>
5962
<pre class='hljs'><span class="hljs-keyword">const</span> ipfsHttpResponse = <span class="hljs-built_in">require</span>(<span class="hljs-string">'ipfs-http-response'</span>)</pre>
6063
<h2>In the Browser</h2>
61-
<p>Ipfs-http-response should work in any ES2015 environment out of the box.</p>
64+
<p><code>ipfs-http-response</code> should work in any ECMAScript 2018 environment out of the box.</p>
6265
<p>Usage:</p>
6366
<pre class='hljs'><span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"text/javascript"</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"index.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span></pre>
64-
<p>The portable versions of ipfs-http-response, including <code>index.js</code> and <code>index.min.js</code>, are included in the <code>/dist</code> folder. Ipfs-http-response can also be found on <a href="https://unpkg.com">unpkg.com</a> under</p>
67+
<p>The portable versions of <code>ipfs-http-response</code>, including <code>index.js</code> and <code>index.min.js</code>, are included in the <code>/dist</code> folder. <code>ipfs-http-response</code> can also be found on <a href="https://unpkg.com">unpkg.com</a> under</p>
6568
<ul>
6669
<li><a href="https://unpkg.com/ipfs-http-response/dist/index.min.js">https://unpkg.com/ipfs-http-response/dist/index.min.js</a></li>
6770
<li><a href="https://unpkg.com/ipfs-http-response/dist/index.js">https://unpkg.com/ipfs-http-response/dist/index.js</a></li>

0 commit comments

Comments
 (0)