Skip to content

Commit ec1c278

Browse files
committed
Commit 56
1 parent ab9b04c commit ec1c278

19 files changed

+495
-56
lines changed

ChangeLog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Change Log
22

33

4+
## 3.1.5 (2022-10-07)
5+
6+
Changes:
7+
8+
* Documentation
9+
10+
411
## 3.1.4 (2022-08-06)
512

613
Changes:

dev/js-add-ons

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../dist/js-add-ons

dev/takefive-dev.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
|*|
88
|*| https://github.com/madmurphy/takefive.css/
99
|*|
10-
|*| Version 3.1.4
10+
|*| Version 3.1.5
1111
|*|
1212
|*| (c) madmurphy333@gmail.com
1313
|*|
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
window.addEventListener("DOMContentLoaded", function () {
2+
3+
var aEmptyHashLinks = document.querySelectorAll("a[href$=\"#\"]");
4+
5+
for (var nIdx = 0; nIdx < aEmptyHashLinks.length; nIdx++) {
6+
7+
aEmptyHashLinks[nIdx].addEventListener("click", function (oEvt) {
8+
9+
location.hash = "";
10+
history.replaceState(null, "", this.href.split('#')[0]);
11+
oEvt.preventDefault();
12+
13+
});
14+
15+
}
16+
17+
}, false);
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
(function () {
2+
3+
var bOpenedWithSlide = false, nHistCount = -1;
4+
5+
function newSlideClicked () {
6+
7+
nHistCount--;
8+
9+
}
10+
11+
function exitClicked (oEvt) {
12+
13+
if (bOpenedWithSlide) {
14+
15+
/* The page was loaded with a slide open */
16+
bOpenedWithSlide = false;
17+
18+
} else {
19+
20+
history.go(nHistCount);
21+
oEvt.preventDefault();
22+
23+
}
24+
25+
nHistCount = -1;
26+
27+
}
28+
29+
addEventListener("DOMContentLoaded", function () {
30+
31+
var
32+
elIter,
33+
aLinks = document.querySelectorAll("article.slide a"),
34+
elTest = document.createElement("a");
35+
36+
bOpenedWithSlide = Boolean(document.querySelector("article.slide:target"));
37+
elTest.href = location.href;
38+
39+
for (var nLen = aLinks.length, nIdx = 0; nIdx < nLen; nIdx++) {
40+
41+
elIter = aLinks[nIdx];
42+
elTest.hash = elIter.hash || "#";
43+
44+
if (elTest.href === elIter.href) {
45+
elIter.addEventListener("click",
46+
elIter.hash && document.querySelector("article.slide" + elIter.hash) ?
47+
newSlideClicked
48+
:
49+
exitClicked
50+
);
51+
}
52+
53+
}
54+
55+
}, false);
56+
57+
})();
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/* close the slide currently open or do nothing */
2+
function closeCurrentSlide () {
3+
4+
var oSlide = document.querySelector("article.slide:target");
5+
6+
if (oSlide) {
7+
8+
var oExitLink = oSlide.querySelector("nav:first-of-type a[rel~=\"parent\"]");
9+
location.assign(oExitLink ? oExitLink.href : "#");
10+
11+
}
12+
13+
}
14+
15+
window.addEventListener("keyup", function (oEvt) {
16+
17+
if (oEvt.key === "Escape") {
18+
19+
closeCurrentSlide();
20+
21+
}
22+
23+
}, false);
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
(function () {
2+
3+
var nDownX = null, nDownY = null;
4+
5+
function handleTouchStart (oEvt) {
6+
7+
const oFirstTouch = oEvt.touches[0];
8+
9+
nDownX = oFirstTouch.clientX;
10+
nDownY = oFirstTouch.clientY;
11+
12+
};
13+
14+
function handleTouchMove (oEvt) {
15+
16+
if (!nDownX || !nDownY) {
17+
18+
return;
19+
20+
}
21+
22+
var
23+
oLink, sRel = null,
24+
nDiffX = nDownX - oEvt.touches[0].clientX,
25+
nDiffY = nDownY - oEvt.touches[0].clientY;
26+
27+
switch (Math.abs(nDiffX) > Math.abs(nDiffY) ? nDiffX > 0 ? 3 : 2 : nDiffY > 0 ? 1 : 0) {
28+
29+
/* Cases: `0` -> down swipe, `1` -> up swipe, `2` -> right swipe, `3` -> left swipe */
30+
case 2: sRel = "prev"; break; /* Right swipe */
31+
case 3: sRel = "next"; break; /* Left swipe */
32+
33+
}
34+
35+
nDownX = null;
36+
nDownY = null;
37+
38+
sRel && (oLink = this.querySelector("nav:first-of-type a[href][rel~=\"" + sRel + "\"]")) && location.assign(oLink.href);
39+
40+
};
41+
42+
window.addEventListener("DOMContentLoaded", function () {
43+
44+
const aSlides = document.querySelectorAll("article.slide");
45+
46+
for (var nIdx = 0, nLen = aSlides.length; nIdx < nLen; nIdx++) {
47+
48+
aSlides[nIdx].addEventListener('touchstart', handleTouchStart, false);
49+
aSlides[nIdx].addEventListener('touchmove', handleTouchMove, false);
50+
51+
}
52+
53+
}, false);
54+
55+
})();

dist/takefive.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
|*|
88
|*| https://github.com/madmurphy/takefive.css/
99
|*|
10-
|*| Version 3.1.4
10+
|*| Version 3.1.5
1111
|*|
1212
|*| (c) madmurphy333@gmail.com
1313
|*|

dist/takefive.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/css/docs-classes.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,10 @@ table.definition th:first-child {
369369
padding-left: 1em;
370370
}
371371

372+
table.definition.longterms th:first-child {
373+
width: 13em;
374+
}
375+
372376
table.definition th,
373377
table.definition thead th:first-child {
374378
font-weight: bold;
@@ -881,6 +885,11 @@ mark, .bg0 {
881885
background-color: #87e4ff;
882886
}
883887

888+
.bg2 {
889+
background-color: rgba(255, 93, 0, .1);
890+
}
891+
892+
884893
.resultbox {
885894
box-sizing: border-box;
886895
border: 2px inset;

0 commit comments

Comments
 (0)