-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #122 from swup/svg-links
Respect swup link selector for preloaded links
- Loading branch information
Showing
10 changed files
with
863 additions
and
611 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<title>Link types</title> | ||
<link rel="stylesheet" href="/assets/style.css" /> | ||
</head> | ||
<body> | ||
<main id="swup" class="transition-main"> | ||
<h1>Link types</h1> | ||
|
||
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p> | ||
<ul> | ||
<li><a href="/page-1.html">Page 1</a></li> | ||
</ul> | ||
|
||
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> | ||
<a xlink:href="/page-2.html"> | ||
<text x="10" y="10" font-size="2">SVG link</text> | ||
</a> | ||
</svg> | ||
</main> | ||
<script src="/dist/swup.umd.js"></script> | ||
<script src="/dist/index.umd.js"></script> | ||
<script> | ||
window._swup = new Swup({ | ||
plugins: [new SwupPreloadPlugin()] | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<title>Link types</title> | ||
<link rel="stylesheet" href="/assets/style.css" /> | ||
</head> | ||
<body> | ||
<main id="swup" class="transition-main"> | ||
<h1>Link types</h1> | ||
|
||
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p> | ||
<ul> | ||
<li><a href="/page-1.html">Page 1</a></li> | ||
</ul> | ||
|
||
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> | ||
<a xlink:href="/page-2.html"> | ||
<text x="10" y="10" font-size="2">SVG link</text> | ||
</a> | ||
</svg> | ||
</main> | ||
<script src="/dist/swup.umd.js"></script> | ||
<script src="/dist/index.umd.js"></script> | ||
<script> | ||
window._swup = new Swup({ | ||
linkSelector: 'a[href], a[*|href]', | ||
plugins: [new SwupPreloadPlugin()] | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<title>Preload visible links with options</title> | ||
<link rel="stylesheet" href="/assets/style.css" /> | ||
</head> | ||
<body> | ||
<main id="swup" class="transition-main"> | ||
<h1>Preload visible links with modified selector</h1> | ||
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p> | ||
<ul> | ||
<li><a href="/page-1.html">Page 1</a></li> | ||
<li><a href="/page-2.html">Page 2</a></li> | ||
<li><a href="/page-3.html">Page 3</a></li> | ||
<li><a href="/page-4.html">Page 4</a></li> | ||
<li> | ||
<svg viewBox="0 0 300 300" xmlns="http://www.w3.org/2000/svg"> | ||
<a xlink:href="/page-5.html"><text x="10" y="10" font-size="2">Page 5</text></a> | ||
</svg> | ||
</li> | ||
</ul> | ||
</main> | ||
<script src="/dist/swup.umd.js"></script> | ||
<script src="/dist/index.umd.js"></script> | ||
<script> | ||
window._swup = new Swup({ | ||
linkSelector: 'li:nth-child(odd) a, svg a', | ||
plugins: [new SwupPreloadPlugin({ | ||
preloadVisibleLinks: { | ||
enabled: true, | ||
delay: 10 | ||
} | ||
})] | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.