diff --git a/docs/content/_index.md b/docs/content/_index.md
index fc733fd..2a068a7 100644
--- a/docs/content/_index.md
+++ b/docs/content/_index.md
@@ -57,7 +57,7 @@ In the above demo, the time "saved" refers to time that would have been wasted w
## Using Tachyon
-``
+``
@@ -113,7 +113,7 @@ Tachyon could be considered an alternative to projects like [instant.page](https
Size
- 723 b
+ 738 b
3.14 kb (4.3x larger)
60.1 kb (83x larger)
111 kb (153x larger)
diff --git a/docs/content/cms/copy.js b/docs/content/cms/copy.js
index 7257362..5fafd1a 100644
--- a/docs/content/cms/copy.js
+++ b/docs/content/cms/copy.js
@@ -1,7 +1,7 @@
const codeBlock = document.getElementById("codeBlock")
const copyButton = document.getElementById("copier")
-codeBlock.innerText = '';
+codeBlock.innerText = '';
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
diff --git a/readme.md b/readme.md
index 2e4e5fd..0c502f6 100644
--- a/readme.md
+++ b/readme.md
@@ -28,7 +28,7 @@ Easy Setup Instructions:
Size
- 723 b
+ 738 b
3.14 kb (4.3x larger)
60.1 kb (83x larger)
111 kb (153x larger)
@@ -75,7 +75,7 @@ Easy Setup Instructions:
Using Tachyon is unbelieveably easy. If you're not using node, you can just include it via script tags. Provided below is the script hosted by [unpkg](https://unpkg.com/). The source itself lives in the [tachyon directory](https://github.com/weebney/tachyon/tree/main/tachyon).
```html
-
+
```
If you look on the website, there are also easy install instructions for [Google Tag Manager](https://fasterthanlight.net/#easy-setup-instructions), [Shopify](https://fasterthanlight.net/#easy-setup-instructions), [WordPress](https://fasterthanlight.net/#easy-setup-instructions), and more.
@@ -91,7 +91,8 @@ npm i tachyonjs
Tachyon is super tiny, so you can also inline it. If you use the following inlined `
+
```
### Configuration
diff --git a/tachyon/package.json b/tachyon/package.json
index 7fe9a8e..52f623e 100644
--- a/tachyon/package.json
+++ b/tachyon/package.json
@@ -1,11 +1,11 @@
{
"name": "tachyonjs",
- "version": "2.0.0",
- "description": "Make your site faster than light in <1 minute; instant page loads in 723 bytes.",
+ "version": "2.0.1",
+ "description": "Make your site faster than light in <1 minute; instant page loads in 738 bytes.",
"main": "tachyon.js",
"scripts": {
"minify": "uglifyjs -c -m --module --verbose tachyon.js > tachyon.min.js",
- "test": "http-server test/ && rm test/tachyon.js"
+ "test": "cp tachyon.js test/ && http-server test/ && rm test/tachyon.js"
},
"repository": {
"type": "git",
diff --git a/tachyon/readme.md b/tachyon/readme.md
index bca0720..146cda6 100644
--- a/tachyon/readme.md
+++ b/tachyon/readme.md
@@ -1,4 +1,4 @@
# Tachyon
-## Make your site faster than light in <1 minute; instant page loads in 723 bytes.
+## Make your site faster than light in <1 minute; instant page loads in 738 bytes.
**For documentation related to Tachyon, please reference the [website](https://fasterthanlight.net/) and [github repository](https://github.com/weebney/tachyon).**
\ No newline at end of file
diff --git a/tachyon/tachyon.js b/tachyon/tachyon.js
index bd5f3b3..70f714d 100644
--- a/tachyon/tachyon.js
+++ b/tachyon/tachyon.js
@@ -1,4 +1,4 @@
-// tachyon.js 2.0.0 - @weebney - MIT License
+// tachyon.js 2.0.1 - @weebney - MIT License
const bodyDataValues = document.body.dataset;
const whitelistEnabled = 'tachyonWhitelist' in bodyDataValues;
const sameOriginOnly = 'tachyonSameOrigin' in bodyDataValues;
@@ -25,10 +25,12 @@ function toggleLinkTag() {
}
function initializeListeners(node) {
- const listed = 'tachyon' in node.dataset;
- if ((node.tagName === 'A' && node.href) && (listed === whitelistEnabled || sameOriginOnly)
- && (!sameOriginOnly || (listed || (node.origin === window.location.origin)))) {
- ['mouseover', 'mouseout', 'touchstart', 'touchend'].forEach((eventName) => node.addEventListener(eventName, toggleLinkTag, { passive: true }));
+ if (node.dataset) {
+ const listed = 'tachyon' in node.dataset;
+ if ((node.tagName === 'A' && node.href) && (listed === whitelistEnabled || sameOriginOnly)
+ && (!sameOriginOnly || (listed || (node.origin === window.location.origin)))) {
+ ['mouseover', 'mouseout', 'touchstart', 'touchend'].forEach((eventName) => node.addEventListener(eventName, toggleLinkTag, { passive: true }));
+ }
}
}
diff --git a/tachyon/tachyon.min.js b/tachyon/tachyon.min.js
index bcbf7b4..e64de0d 100644
--- a/tachyon/tachyon.min.js
+++ b/tachyon/tachyon.min.js
@@ -1 +1 @@
-var e=document.body.dataset;const o="tachyonWhitelist"in e,n="tachyonSameOrigin"in e,a=e.tachyonTimer||50;let r=null;function i(){r=r?null:this;const t="tachyon";var e=document.getElementById(t);e?e.remove():setTimeout(()=>{var e;r===this&&((e=document.createElement("link")).id=t,e.href=this.href,e.rel="prerender",document.head.appendChild(e))},a)}function t(t){var e="tachyon"in t.dataset;"A"!==t.tagName||!t.href||e!=o&&!n||n&&!e&&t.origin!==window.location.origin||["mouseover","mouseout","touchstart","touchend"].forEach(e=>t.addEventListener(e,i,{passive:!0}))}new MutationObserver(e=>e.forEach(e=>e.addedNodes.forEach(t))).observe(document.body,{childList:!0,subtree:!0}),document.querySelectorAll("a").forEach(t);
+var e=document.body.dataset;const o="tachyonWhitelist"in e,n="tachyonSameOrigin"in e,a=e.tachyonTimer||50;let r=null;function i(){r=r?null:this;const t="tachyon";var e=document.getElementById(t);e?e.remove():setTimeout(()=>{var e;r===this&&((e=document.createElement("link")).id=t,e.href=this.href,e.rel="prerender",document.head.appendChild(e))},a)}function t(t){var e;t.dataset&&(e="tachyon"in t.dataset,"A"!==t.tagName||!t.href||e!=o&&!n||n&&!e&&t.origin!==window.location.origin||["mouseover","mouseout","touchstart","touchend"].forEach(e=>t.addEventListener(e,i,{passive:!0})))}new MutationObserver(e=>e.forEach(e=>e.addedNodes.forEach(t))).observe(document.body,{childList:!0,subtree:!0}),document.querySelectorAll("a").forEach(t);
diff --git a/tachyon/wordpress/tachyon.php b/tachyon/wordpress/tachyon.php
index 0ff9e83..218461c 100644
--- a/tachyon/wordpress/tachyon.php
+++ b/tachyon/wordpress/tachyon.php
@@ -3,7 +3,7 @@
* Plugin Name: Tachyon
* Plugin URI: https://fasterthanlight.net/
* Description: Make your WordPress site faster than light.
-* Version: 2.0.0
+* Version: 2.0.1
* Author: weebney
* Author URI: https://github.com/weebney
* License: MIT
diff --git a/tachyon/wordpress/tachyon.zip b/tachyon/wordpress/tachyon.zip
index 11046b3..1d53d8d 100644
Binary files a/tachyon/wordpress/tachyon.zip and b/tachyon/wordpress/tachyon.zip differ