Compare commits
No commits in common. "cbb0a652f7bea2e50e6405afe6ff347726caeb57" and "7a2a243013405f81ef44be6784a8cc18cb0e22a2" have entirely different histories.
cbb0a652f7
...
7a2a243013
117
books.html
|
@ -1,117 +0,0 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
<title>fateforge-tools</title>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdn.jsdelivr.net/npm/water.css@2/out/water.css"
|
||||
/>
|
||||
<link href="css/all.min.css" rel="stylesheet" />
|
||||
|
||||
<link href="css/flickity.css" rel="stylesheet" />
|
||||
<link href="css/style.css" rel="stylesheet" />
|
||||
<link
|
||||
rel="icon"
|
||||
type="image/x-icon"
|
||||
href="/img/FateforgeTool_logo_80.png"
|
||||
/>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<button onclick="changeLangEN()">
|
||||
<img
|
||||
src="https://cdn.countryflags.com/thumbs/united-kingdom/flag-400.png"
|
||||
width="20"
|
||||
/>
|
||||
English
|
||||
</button>
|
||||
<button onclick="changeLangFR()">
|
||||
<img
|
||||
src="https://cdn.countryflags.com/thumbs/france/flag-400.png"
|
||||
width="20"
|
||||
/>
|
||||
French
|
||||
</button>
|
||||
|
||||
<h1>FateforgeTools</h1>
|
||||
|
||||
<div class="gallery js-flickity">
|
||||
<div class="gallery-cell" id="ADV1">
|
||||
<div class="book-container">
|
||||
<div class="book">
|
||||
<img src="img\books\ADV1_BC_EN.jpg" />
|
||||
</div>
|
||||
<div class="book-title">Adventurer</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="gallery-cell">
|
||||
<div class="book-container">
|
||||
<div class="book">
|
||||
<img src="img\books\GRI1_BC_EN.jpg" />
|
||||
</div>
|
||||
<div class="book-title">Grimoire</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="gallery-cell" id="CRE2">
|
||||
<div class="book-container" data-localize="book-CRE2"></div>
|
||||
</div>
|
||||
<div class="gallery-cell">
|
||||
<div class="book-container">
|
||||
<div class="book">
|
||||
<img src="img\books\ENC1_BC_EN.png" />
|
||||
</div>
|
||||
<div class="book-title">Encyclopedia</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="gallery-cell">
|
||||
<div class="book-container">
|
||||
<div class="book">
|
||||
<img src="img\books\ENC2_DR.png" />
|
||||
</div>
|
||||
<div class="book-title">Encyclopedia : Netherworld</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="view-container"
|
||||
style="display: flex; align-items: center; justify-content: center"
|
||||
>
|
||||
<h1 id="view-title"></h1>
|
||||
<br />
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="lib/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="lib/jquery.localize-dev.js"></script>
|
||||
<script type="text/javascript" src="js/language.js"></script>
|
||||
<script src="lib/flickity.pkgd.min.js"></script>
|
||||
<script src="lib/flickity.hash.js"></script>
|
||||
<script>
|
||||
var lastbook;
|
||||
var flkty = new Flickity(".gallery", {
|
||||
freeScroll: true,
|
||||
wrapAround: true,
|
||||
hash: true, // options
|
||||
});
|
||||
flkty.on("select", function (index) {
|
||||
var currentbook = document
|
||||
.getElementsByClassName("gallery-cell is-selected")[0]
|
||||
.getAttribute("id");
|
||||
if (currentbook == lastbook) {
|
||||
return;
|
||||
}
|
||||
//TODO: Fill view-container with books
|
||||
setLocalizeDataAttr("view-title", currentbook + ".title");
|
||||
|
||||
lastbook = currentbook;
|
||||
refreshBooks();
|
||||
});
|
||||
flkty.on("settle", function (index) {
|
||||
console.log("Flickity settled at " + index);
|
||||
refreshBooks();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
137
css/flickity.css
|
@ -1,137 +0,0 @@
|
|||
/*! Flickity v2.3.0
|
||||
https://flickity.metafizzy.co
|
||||
---------------------------------------------- */
|
||||
|
||||
.flickity-enabled {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.flickity-enabled:focus { outline: none; }
|
||||
|
||||
.flickity-viewport {
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.flickity-slider {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* draggable */
|
||||
|
||||
.flickity-enabled.is-draggable {
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.flickity-enabled.is-draggable .flickity-viewport {
|
||||
cursor: move;
|
||||
cursor: -webkit-grab;
|
||||
cursor: grab;
|
||||
}
|
||||
|
||||
.flickity-enabled.is-draggable .flickity-viewport.is-pointer-down {
|
||||
cursor: -webkit-grabbing;
|
||||
cursor: grabbing;
|
||||
}
|
||||
|
||||
/* ---- flickity-button ---- */
|
||||
|
||||
.flickity-button {
|
||||
position: absolute;
|
||||
background: hsla(0, 0%, 100%, 0.75);
|
||||
border: none;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.flickity-button:hover {
|
||||
background: white;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.flickity-button:focus {
|
||||
outline: none;
|
||||
box-shadow: 0 0 0 5px #19F;
|
||||
}
|
||||
|
||||
.flickity-button:active {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.flickity-button:disabled {
|
||||
opacity: 0.3;
|
||||
cursor: auto;
|
||||
/* prevent disabled button from capturing pointer up event. #716 */
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.flickity-button-icon {
|
||||
fill: currentColor;
|
||||
}
|
||||
|
||||
/* ---- previous/next buttons ---- */
|
||||
|
||||
.flickity-prev-next-button {
|
||||
top: 50%;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
border-radius: 50%;
|
||||
/* vertically center */
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
.flickity-prev-next-button.previous { left: 10px; }
|
||||
.flickity-prev-next-button.next { right: 10px; }
|
||||
/* right to left */
|
||||
.flickity-rtl .flickity-prev-next-button.previous {
|
||||
left: auto;
|
||||
right: 10px;
|
||||
}
|
||||
.flickity-rtl .flickity-prev-next-button.next {
|
||||
right: auto;
|
||||
left: 10px;
|
||||
}
|
||||
|
||||
.flickity-prev-next-button .flickity-button-icon {
|
||||
position: absolute;
|
||||
left: 20%;
|
||||
top: 20%;
|
||||
width: 60%;
|
||||
height: 60%;
|
||||
}
|
||||
|
||||
/* ---- page dots ---- */
|
||||
|
||||
.flickity-page-dots {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
bottom: -25px;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
list-style: none;
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.flickity-rtl .flickity-page-dots { direction: rtl; }
|
||||
|
||||
.flickity-page-dots .dot {
|
||||
display: inline-block;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
margin: 0 8px;
|
||||
background: #333;
|
||||
border-radius: 50%;
|
||||
opacity: 0.25;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.flickity-page-dots .dot.is-selected {
|
||||
opacity: 1;
|
||||
}
|
126
css/style.css
|
@ -1,126 +0,0 @@
|
|||
/**** BOOK 3D***/
|
||||
*,
|
||||
:after,
|
||||
:before {
|
||||
box-sizing: border-box;
|
||||
border: 0 solid #e5e7eb;
|
||||
}
|
||||
|
||||
* {
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.book-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
perspective: 600px;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.book-container .book {
|
||||
width: 200px;
|
||||
height: 300px;
|
||||
position: relative;
|
||||
transform-style: preserve-3d;
|
||||
transform: rotateY(-30deg);
|
||||
transition: transform 1s ease;
|
||||
animation: 1s ease 0s 1 initAnimation-fd6a;
|
||||
margin-bottom: 15px;
|
||||
margin-top: 39px;
|
||||
}
|
||||
|
||||
.book-container .book > :first-child {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 200px;
|
||||
height: 283px;
|
||||
transform: translateZ(25px);
|
||||
background-color: #01060f;
|
||||
border-radius: 0 2px 2px 0;
|
||||
box-shadow: 5px 5px 20px #aaaaaa9d;
|
||||
background-color: #01060f;
|
||||
}
|
||||
|
||||
.book-container .book::before {
|
||||
position: absolute;
|
||||
content: " ";
|
||||
left: 0;
|
||||
top: 3px;
|
||||
width: 48px;
|
||||
height: 277px;
|
||||
transform: translateX(172px) rotateY(90deg);
|
||||
background: linear-gradient(
|
||||
90deg,
|
||||
#fff 0%,
|
||||
#f9f9f9 5%,
|
||||
#fff 10%,
|
||||
#f9f9f9 15%,
|
||||
#fff 20%,
|
||||
#f9f9f9 25%,
|
||||
#fff 30%,
|
||||
#f9f9f9 35%,
|
||||
#fff 40%,
|
||||
#f9f9f9 45%,
|
||||
#fff 50%,
|
||||
#f9f9f9 55%,
|
||||
#fff 60%,
|
||||
#f9f9f9 65%,
|
||||
#fff 70%,
|
||||
#f9f9f9 75%,
|
||||
#fff 80%,
|
||||
#f9f9f9 85%,
|
||||
#fff 90%,
|
||||
#f9f9f9 95%,
|
||||
#fff 100%
|
||||
);
|
||||
}
|
||||
.book-container .book:hover {
|
||||
transform: rotateY(0deg);
|
||||
}
|
||||
|
||||
.book-container .book::after {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
content: " ";
|
||||
width: 200px;
|
||||
height: 283px;
|
||||
transform: translateZ(-25px);
|
||||
background-color: #01060f;
|
||||
border-radius: 0 2px 2px 0;
|
||||
box-shadow: -05px 0 20px 10px #aaaaaa9d;
|
||||
}
|
||||
|
||||
.book-container .book-title {
|
||||
}
|
||||
|
||||
/**** Slideshow***/
|
||||
|
||||
.gallery {
|
||||
background: #01060f00;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
.gallery-cell {
|
||||
width: 66%;
|
||||
|
||||
margin-right: 10px;
|
||||
|
||||
counter-increment: gallery-cell;
|
||||
}
|
||||
|
||||
.flickity-viewport {
|
||||
background-color: #01060f00;
|
||||
}
|
||||
.flickity-page-dots .dot {
|
||||
background: #0093cd;
|
||||
}
|
||||
.flickity-prev-next-button {
|
||||
border-radius: 6px;
|
||||
}
|
||||
.flickity-button {
|
||||
background: #588597;
|
||||
}
|
Before Width: | Height: | Size: 253 KiB |
Before Width: | Height: | Size: 2.1 MiB |
Before Width: | Height: | Size: 298 KiB |
Before Width: | Height: | Size: 239 KiB |
Before Width: | Height: | Size: 342 KiB |
Before Width: | Height: | Size: 224 KiB |
Before Width: | Height: | Size: 401 KiB |
Before Width: | Height: | Size: 401 KiB |
Before Width: | Height: | Size: 198 KiB |
Before Width: | Height: | Size: 645 KiB |
Before Width: | Height: | Size: 590 KiB |
Before Width: | Height: | Size: 206 KiB |
Before Width: | Height: | Size: 1.7 MiB |
Before Width: | Height: | Size: 357 KiB |
Before Width: | Height: | Size: 210 KiB |
Before Width: | Height: | Size: 1 MiB |
Before Width: | Height: | Size: 520 KiB |
Before Width: | Height: | Size: 742 KiB |
Before Width: | Height: | Size: 221 KiB |
Before Width: | Height: | Size: 221 KiB |
Before Width: | Height: | Size: 427 KiB |
Before Width: | Height: | Size: 352 KiB |
Before Width: | Height: | Size: 633 KiB |
Before Width: | Height: | Size: 210 KiB |
Before Width: | Height: | Size: 429 KiB |
Before Width: | Height: | Size: 523 KiB |
|
@ -1,43 +1,17 @@
|
|||
// In a browser where the language is set to French
|
||||
$("[data-localize]")
|
||||
.localize("main", { pathPrefix: "lang" })
|
||||
.localize("books", { pathPrefix: "lang" });
|
||||
var currentLang;
|
||||
$("[data-localize]").localize("main", { pathPrefix: "lang" });
|
||||
|
||||
// You can also override the language detection, and pass in a language code
|
||||
//$("[data-localize]").localize("main", { language: "fr" });
|
||||
function changeLangFR() {
|
||||
$("[data-localize]")
|
||||
.localize("main", {
|
||||
pathPrefix: "lang",
|
||||
language: "fr",
|
||||
})
|
||||
.localize("books", {
|
||||
$("[data-localize]").localize("main", {
|
||||
pathPrefix: "lang",
|
||||
language: "fr",
|
||||
});
|
||||
currentLang = "fr";
|
||||
}
|
||||
function changeLangEN() {
|
||||
$("[data-localize]")
|
||||
.localize("main", {
|
||||
pathPrefix: "lang",
|
||||
language: "en",
|
||||
})
|
||||
.localize("books", {
|
||||
$("[data-localize]").localize("main", {
|
||||
pathPrefix: "lang",
|
||||
language: "en",
|
||||
});
|
||||
currentLang = "en";
|
||||
}
|
||||
|
||||
function refreshBooks() {
|
||||
|
||||
$("[data-localize]").localize("books", {
|
||||
pathPrefix: "lang",
|
||||
language: currentLang,
|
||||
});
|
||||
}
|
||||
|
||||
function setLocalizeDataAttr(className, dataValue) {
|
||||
$("#" + className).data("localize", dataValue).attr("data-localize", dataValue);
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
{
|
||||
"ADV1": {
|
||||
"code": "ADV1",
|
||||
"title": "Adventurers",
|
||||
"desc": [
|
||||
"*Découvrez l’univers d’Eana et ses multiples civilisations hautes en couleur, retrouvez les portails perdus des Voyageurs, gravissez les marches de la Forge du destin et mesurez-vous aux Dragons-dieux !* **Aventuriers** est le premier volume de la gamme de jeu de rôle Dragons. Destiné aux joueurs et au meneur, il se compose de trois parties :",
|
||||
"**Création de personnage.** Déterminez avec votre meneur dans quelles conditions votre personnage accède à l’éveil à la magie, et faites votre choix parmi toutes les options qui s’offrent à vous, notamment : neuf espèces jouables ; dix-huit civilisations ; un pas-à-pas pour concevoir des historiques personnalisés ; treize classes – dont le lettré, un érudit inventif et capable d’agir même dans les régions privées de magie ; de nombreux dons pour accompagner l’évolution de votre héros.",
|
||||
"**Vie quotidienne.** Découvrez la mythique Cité franche, ainsi que toutes les règles permettant de donner corps aux voyages et à la vie quotidienne. Le mystère, l’exploration et la découverte sont au cœur de l’expérience du jeu. Que vous vous déplaciez à pied, en bateau ou en nefélytre, répondez à l’appel de l’aventure !",
|
||||
"**Règles du jeu.** Le système est organisé autour de quatre pôles : les caractéristiques, l’aventure, le combat et la santé. Les règles optionnelles sont présentées à l’aide d’un système modulaire permettant à chaque meneur de définir son propre style de jeu."
|
||||
],
|
||||
"physical-link": "https://www.philibertnet.com/fr/dragons/62090-dragons-1-aventuriers-livre-de-base-9782919256365.html",
|
||||
"pdf-link": "https://www.drivethrurpg.com/product/422886/Dragons--1--Livre-de-base--Aventuriers",
|
||||
"author": [
|
||||
"Team Agate"
|
||||
],
|
||||
"published-date": "01/04/2018",
|
||||
"cf-date": "14/03/2016"
|
||||
|
||||
},
|
||||
"CRE2": {
|
||||
"code": "CRE2",
|
||||
"title": "Creature : Netherworld",
|
||||
"desc": [
|
||||
"*"
|
||||
],
|
||||
"physical-link": "",
|
||||
"pdf-link": "",
|
||||
"author": [
|
||||
"Team Agate"
|
||||
],
|
||||
"published-date": "",
|
||||
"cf-date": ""
|
||||
|
||||
}
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
{
|
||||
"ADV1": {
|
||||
"code": "ADV1",
|
||||
"title": "Aventuriers",
|
||||
"desc": [
|
||||
"*Découvrez l’univers d’Eana et ses multiples civilisations hautes en couleur, retrouvez les portails perdus des Voyageurs, gravissez les marches de la Forge du destin et mesurez-vous aux Dragons-dieux !* **Aventuriers** est le premier volume de la gamme de jeu de rôle Dragons. Destiné aux joueurs et au meneur, il se compose de trois parties :",
|
||||
"**Création de personnage.** Déterminez avec votre meneur dans quelles conditions votre personnage accède à l’éveil à la magie, et faites votre choix parmi toutes les options qui s’offrent à vous, notamment : neuf espèces jouables ; dix-huit civilisations ; un pas-à-pas pour concevoir des historiques personnalisés ; treize classes – dont le lettré, un érudit inventif et capable d’agir même dans les régions privées de magie ; de nombreux dons pour accompagner l’évolution de votre héros.",
|
||||
"**Vie quotidienne.** Découvrez la mythique Cité franche, ainsi que toutes les règles permettant de donner corps aux voyages et à la vie quotidienne. Le mystère, l’exploration et la découverte sont au cœur de l’expérience du jeu. Que vous vous déplaciez à pied, en bateau ou en nefélytre, répondez à l’appel de l’aventure !",
|
||||
"**Règles du jeu.** Le système est organisé autour de quatre pôles : les caractéristiques, l’aventure, le combat et la santé. Les règles optionnelles sont présentées à l’aide d’un système modulaire permettant à chaque meneur de définir son propre style de jeu."
|
||||
],
|
||||
"physical-link": "https://www.philibertnet.com/fr/dragons/62090-dragons-1-aventuriers-livre-de-base-9782919256365.html",
|
||||
"pdf-link": "https://www.drivethrurpg.com/product/422886/Dragons--1--Livre-de-base--Aventuriers",
|
||||
"author": [
|
||||
"Team Agate"
|
||||
],
|
||||
"published-date": "01/04/2018",
|
||||
"cf-date": "14/03/2016"
|
||||
|
||||
},
|
||||
"CRE2": {
|
||||
"code": "CRE2",
|
||||
"title": "Créature : Inframonde",
|
||||
"desc": [
|
||||
"*"
|
||||
],
|
||||
"physical-link": "",
|
||||
"pdf-link": "",
|
||||
"author": [
|
||||
"Team Agate"
|
||||
],
|
||||
"published-date": "",
|
||||
"cf-date": ""
|
||||
|
||||
}
|
||||
}
|
|
@ -9,6 +9,5 @@
|
|||
"btn-items": "Magic Items",
|
||||
"CUVD": "Unofficial site for Fateforge RPG. Uses copyrighted content © Agate RPG, courtesy of the publisher under the CUVD license.",
|
||||
"link": "Join the community: <a href='https://fateforge.org/en'>https://fateforge.org/en</a>",
|
||||
"btn-books": "Books",
|
||||
"book-CRE2": "<div class='book'> <img src='img\\books\\CRE2_BC_EN.png'></div><div class='book-title'>Creature : Netherworld</div>"
|
||||
"btn-books": "Books"
|
||||
}
|
||||
|
|
|
@ -14,6 +14,5 @@
|
|||
"somatic": "Gestuelle",
|
||||
"gridColumns":{
|
||||
"components": "Composants"
|
||||
},
|
||||
"book-CRE2": "<div class='book'> <img src='img\\books\\CRE2_BC.png'></div><div class='book-title'>Créature : Inframonde</div>"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,121 +0,0 @@
|
|||
/*!
|
||||
* Flickity hash v1.0.3
|
||||
* Enable hash navigation for Flickity
|
||||
*/
|
||||
|
||||
/*jshint browser: true, undef: true, unused: true, strict: true*/
|
||||
|
||||
( function( window, factory ) {
|
||||
// universal module definition
|
||||
/*jshint strict: false */ /*globals define, module, require */
|
||||
if ( typeof define == 'function' && define.amd ) {
|
||||
// AMD
|
||||
define( [
|
||||
'flickity/js/index',
|
||||
], factory );
|
||||
} else if ( typeof module == 'object' && module.exports ) {
|
||||
// CommonJS
|
||||
module.exports = factory(
|
||||
require('flickity')
|
||||
);
|
||||
} else {
|
||||
// browser global
|
||||
factory(
|
||||
window.Flickity
|
||||
);
|
||||
}
|
||||
|
||||
}( window, function factory( Flickity ) {
|
||||
|
||||
'use strict';
|
||||
|
||||
Flickity.createMethods.push('_createHash');
|
||||
|
||||
var proto = Flickity.prototype;
|
||||
|
||||
proto._createHash = function() {
|
||||
if ( !this.options.hash ) {
|
||||
return;
|
||||
}
|
||||
this.connectedHashLinks = [];
|
||||
// hash link listener
|
||||
// use HTML5 history pushState to prevent page scroll jump
|
||||
this.onHashLinkClick = function( event ) {
|
||||
event.preventDefault();
|
||||
this.selectCell( event.currentTarget.hash );
|
||||
history.replaceState( null, '', event.currentTarget.hash );
|
||||
}.bind( this );
|
||||
|
||||
// events
|
||||
this.on( 'activate', this.activateHash );
|
||||
this.on( 'deactivate', this.deactivateHash );
|
||||
};
|
||||
|
||||
proto.activateHash = function() {
|
||||
this.on( 'change', this.onChangeHash );
|
||||
|
||||
// overwrite initialIndex
|
||||
if ( this.options.initialIndex === undefined && location.hash ) {
|
||||
var cell = this.queryCell( location.hash );
|
||||
if ( cell ) {
|
||||
this.options.initialIndex = this.getCellSlideIndex( cell );
|
||||
}
|
||||
}
|
||||
|
||||
this.connectHashLinks();
|
||||
};
|
||||
|
||||
|
||||
proto.deactivateHash = function() {
|
||||
this.off( 'change', this.onChangeHash );
|
||||
this.disconnectHashLinks();
|
||||
};
|
||||
|
||||
proto.onChangeHash = function() {
|
||||
var id = this.selectedElement.id;
|
||||
if ( id ) {
|
||||
var url = '#' + id;
|
||||
history.replaceState( null, '', url );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
proto.connectHashLinks = function() {
|
||||
var links = document.querySelectorAll('a');
|
||||
for ( var i=0; i < links.length; i++ ) {
|
||||
this.connectHashLink( links[i] );
|
||||
}
|
||||
};
|
||||
|
||||
// used to test if link is on same page
|
||||
var proxyLink = document.createElement('a');
|
||||
|
||||
proto.connectHashLink = function( link ) {
|
||||
if ( !link.hash ) {
|
||||
return;
|
||||
}
|
||||
// check that link is for the same page
|
||||
proxyLink.href = link.href;
|
||||
if ( proxyLink.pathname != location.pathname ) {
|
||||
return;
|
||||
}
|
||||
var cell = this.queryCell( link.hash );
|
||||
if ( !cell ) {
|
||||
return;
|
||||
}
|
||||
link.addEventListener( 'click', this.onHashLinkClick );
|
||||
this.connectedHashLinks.push( link );
|
||||
};
|
||||
|
||||
proto.disconnectHashLinks = function() {
|
||||
this.connectedHashLinks.forEach( function( link ) {
|
||||
link.removeEventListener( 'click', this.onHashLinkClick );
|
||||
}, this );
|
||||
this.connectedHashLinks = [];
|
||||
};
|
||||
|
||||
// ----- ----- //
|
||||
|
||||
return Flickity;
|
||||
|
||||
}));
|