@pimaonline/pimaonline-themepack 3.12.1 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +12 -23
- package/dist/css/main.css +1 -1
- package/dist/css/plugins/alt-icons.css +1 -1
- package/dist/css/plugins/font-awesome.css +1 -1
- package/dist/css/routes.css +1 -1
- package/dist/css/themes/ait/styles.css +1 -1
- package/dist/css/themes/ajs/styles.css +1 -1
- package/dist/css/themes/ant/styles.css +1 -0
- package/dist/css/themes/art/styles.css +1 -1
- package/dist/css/themes/aviation/styles.css +1 -1
- package/dist/css/themes/bct/styles.css +1 -1
- package/dist/css/themes/bio/styles.css +1 -1
- package/dist/css/themes/business/styles.css +1 -1
- package/dist/css/themes/cad/styles.css +1 -1
- package/dist/css/themes/cards/styles.css +1 -1
- package/dist/css/themes/cas/styles.css +1 -0
- package/dist/css/themes/cda/styles.css +1 -1
- package/dist/css/themes/chm/styles.css +1 -0
- package/dist/css/themes/cis/styles.css +1 -1
- package/dist/css/themes/communication/styles.css +1 -1
- package/dist/css/themes/computer-information-systems/styles.css +1 -1
- package/dist/css/themes/culinary/styles.css +1 -1
- package/dist/css/themes/culinary/versions/black-marble.css +1 -1
- package/dist/css/themes/culinary/versions/stainless.css +1 -1
- package/dist/css/themes/culinary/versions/wood.css +1 -1
- package/dist/css/themes/dental/styles.css +1 -1
- package/dist/css/themes/ece/styles.css +1 -1
- package/dist/css/themes/ecn/styles.css +1 -1
- package/dist/css/themes/eng/styles.css +1 -1
- package/dist/css/themes/fashion/styles.css +1 -1
- package/dist/css/themes/fitness/styles.css +1 -1
- package/dist/css/themes/fsc/styles.css +1 -1
- package/dist/css/themes/geography/styles.css +1 -1
- package/dist/css/themes/geology/styles.css +1 -1
- package/dist/css/themes/health-it/styles.css +1 -1
- package/dist/css/themes/history/styles.css +1 -1
- package/dist/css/themes/hrm/styles.css +1 -1
- package/dist/css/themes/hrs/styles.css +1 -1
- package/dist/css/themes/journalism/styles.css +1 -1
- package/dist/css/themes/lang/styles.css +1 -1
- package/dist/css/themes/lgm/styles.css +1 -1
- package/dist/css/themes/machine/styles.css +1 -1
- package/dist/css/themes/math/styles.css +1 -1
- package/dist/css/themes/mgt/styles.css +1 -1
- package/dist/css/themes/minimalist/styles.css +1 -1
- package/dist/css/themes/mkt/styles.css +1 -0
- package/dist/css/themes/music/styles.css +1 -1
- package/dist/css/themes/nursing/styles.css +1 -0
- package/dist/css/themes/philosophy/styles.css +1 -1
- package/dist/css/themes/pht/styles.css +1 -1
- package/dist/css/themes/phy/styles.css +1 -0
- package/dist/css/themes/pos/styles.css +1 -0
- package/dist/css/themes/psy/styles.css +1 -1
- package/dist/css/themes/reading/styles.css +1 -0
- package/dist/css/themes/resort/styles.css +1 -1
- package/dist/css/themes/soc/styles.css +1 -1
- package/dist/css/themes/ss/styles.css +1 -1
- package/dist/css/themes/tps/styles.css +1 -0
- package/dist/css/themes/university/styles.css +1 -1
- package/dist/css/themes/vet/styles.css +1 -1
- package/dist/css/themes/welding/styles.css +1 -1
- package/dist/css/themes/writing/styles.css +1 -1
- package/dist/img/general/arrow-right-black.svg +1 -0
- package/dist/img/general/arrow-right-primary-blue.svg +1 -0
- package/dist/img/general/arrow-right-white.svg +1 -0
- package/dist/img/theme-images/ant/texture.png +0 -0
- package/dist/img/theme-images/cas/city-vector.svg +92 -0
- package/dist/img/theme-images/cas/farm-vector.svg +1 -0
- package/dist/img/theme-images/cas/ocean-vector.svg +1 -0
- package/dist/img/theme-images/cas/recycle-symbol.svg +1 -0
- package/dist/img/theme-images/chm/chem-letters/letter-a.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-b.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-c.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-d.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-e.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-f.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-g.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-h.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-i.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-j.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-k.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-l.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-m.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-n.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-o.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-p.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-q.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-r.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-s.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-t.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-u.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-v.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-w.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-x.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-y.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-z.png +0 -0
- package/dist/img/theme-images/mkt/blue/bluebars.svg +36 -0
- package/dist/img/theme-images/mkt/blue/blueheader.jpg +0 -0
- package/dist/img/theme-images/mkt/blue/bluepie.svg +42 -0
- package/dist/img/theme-images/mkt/green/greenbars.svg +36 -0
- package/dist/img/theme-images/mkt/green/greenheader.jpg +0 -0
- package/dist/img/theme-images/mkt/green/greenpie.svg +42 -0
- package/dist/img/theme-images/mkt/yellow/yellowbars.svg +36 -0
- package/dist/img/theme-images/mkt/yellow/yellowheader.jpg +0 -0
- package/dist/img/theme-images/mkt/yellow/yellowpie.svg +42 -0
- package/dist/img/theme-images/nursing/blue/bottomright-blue.svg +95 -0
- package/dist/img/theme-images/nursing/blue/topleft-blue.svg +111 -0
- package/dist/img/theme-images/nursing/green/bottomright-green.svg +95 -0
- package/dist/img/theme-images/nursing/green/topleft-green.svg +111 -0
- package/dist/img/theme-images/nursing/purple/bottomright-purple.svg +95 -0
- package/dist/img/theme-images/nursing/purple/topleft-purple.svg +111 -0
- package/dist/img/theme-images/nursing/teal/bottomright-teal.svg +95 -0
- package/dist/img/theme-images/nursing/teal/topleft-teal.svg +111 -0
- package/dist/img/theme-images/phy/background.svg +150 -0
- package/dist/img/theme-images/phy/tape-style1.svg +8 -0
- package/dist/img/theme-images/reading/bg10.jpg +0 -0
- package/dist/js/scripts2.js +1 -1552
- package/dist/js/themes/cas.js +1 -0
- package/dist/js/themes/chm.js +1 -0
- package/dist/js/themes/ecn.js +1 -13
- package/dist/js/themes/hrs.js +1 -19
- package/dist/js/themes/ss.js +1 -197
- package/dist/plugins/fancybox/fancybox-example.html +1 -1
- package/dist/plugins/fancybox/helpers/jquery.fancybox-buttons.js +2 -122
- package/dist/plugins/fancybox/helpers/jquery.fancybox-media.js +2 -201
- package/dist/plugins/fancybox/helpers/jquery.fancybox-thumbs.js +2 -165
- package/dist/plugins/fancybox/jquery.fancybox.js +2 -2018
- package/dist/plugins/fancybox/jquery.fancybox.pack.js +2 -46
- package/dist/plugins/flashcards/flashcards-example.html +1 -1
- package/dist/plugins/flashcards/js/flash_cards.min.js +1 -12
- package/dist/plugins/flashcards/js/plugins/flash_cards.js +1 -62
- package/dist/plugins/flashcards/js/plugins/jquery.cycle.js +2 -1148
- package/dist/plugins/flashcards/js/vendor/jquery-1.7.2.js +2 -9404
- package/dist/plugins/flashcards/js/vendor/jquery-1.7.2.min.js +2 -4
- package/dist/plugins/flashcards/js/vendor/modernizr-2.5.3.min.js +1 -4
- package/dist/plugins/floating-particles/floating-particles.js +1 -68
- package/dist/plugins/global-homepage-overrides/global-homepage-overrides.js +1 -53
- package/dist/plugins/preview-banner/preview-banner.js +1 -57
- package/package.json +12 -16
- package/dist/js/jumpTo.js +0 -4
- package/dist/js/scripts-ts.js +0 -1
- package/dist/js/scripts.js +0 -327
@@ -1,68 +1 @@
|
|
1
|
-
|
2
|
-
window.addEventListener("DOMContentLoaded", function() {
|
3
|
-
|
4
|
-
let particleAmount = 75;
|
5
|
-
const get_body = document.querySelector("body");
|
6
|
-
|
7
|
-
const canvas_elem = document.createElement("canvas");
|
8
|
-
const ctx = canvas_elem.getContext("2d");
|
9
|
-
|
10
|
-
canvas_elem.id = "animated-bg";
|
11
|
-
canvas_elem.width = window.innerWidth;
|
12
|
-
canvas_elem.height = window.innerHeight;
|
13
|
-
get_body.prepend(canvas_elem);
|
14
|
-
|
15
|
-
const particleArray = [];
|
16
|
-
let particleFill = "rgba(255, 255, 255, .08)";
|
17
|
-
|
18
|
-
window.addEventListener("resize", function () {
|
19
|
-
canvas_elem.width = window.innerWidth;
|
20
|
-
canvas_elem.height = window.innerHeight;
|
21
|
-
});
|
22
|
-
|
23
|
-
class Particle {
|
24
|
-
constructor() {
|
25
|
-
this.x = Math.random() * ( (canvas_elem.width - 5) - 5 ) + 5;
|
26
|
-
this.y = Math.random() * canvas_elem.height;
|
27
|
-
this.size = Math.random() * (30 - 10) + 10;
|
28
|
-
this.speedX = 0;
|
29
|
-
this.speedY = Math.random() * (5 - 2) + 2 ;
|
30
|
-
}
|
31
|
-
update() {
|
32
|
-
if (this.y + this.size > canvas_elem.height || this.y + this.size < 0) {
|
33
|
-
this.speedY = -this.speedY;
|
34
|
-
}
|
35
|
-
this.x += this.speedX;
|
36
|
-
this.y += this.speedY;
|
37
|
-
}
|
38
|
-
draw() {
|
39
|
-
ctx.fillStyle = particleFill;
|
40
|
-
ctx.beginPath();
|
41
|
-
ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);
|
42
|
-
ctx.fill();
|
43
|
-
}
|
44
|
-
}
|
45
|
-
|
46
|
-
function init() {
|
47
|
-
for (let i = 0; i < particleAmount; i++) {
|
48
|
-
particleArray.push(new Particle());
|
49
|
-
}
|
50
|
-
}
|
51
|
-
init();
|
52
|
-
|
53
|
-
function handleParticles() {
|
54
|
-
for (let i = 0; i < particleArray.length; i++) {
|
55
|
-
particleArray[i].update();
|
56
|
-
particleArray[i].draw();
|
57
|
-
}
|
58
|
-
}
|
59
|
-
|
60
|
-
function animate() {
|
61
|
-
ctx.clearRect(0, 0, canvas_elem.width, canvas_elem.height);
|
62
|
-
handleParticles();
|
63
|
-
requestAnimationFrame(animate);
|
64
|
-
}
|
65
|
-
animate();
|
66
|
-
|
67
|
-
// end event listener
|
68
|
-
});
|
1
|
+
window.addEventListener("DOMContentLoaded",(function(){const t=document.querySelector("body"),e=document.createElement("canvas"),i=e.getContext("2d");e.id="animated-bg",e.width=window.innerWidth,e.height=window.innerHeight,t.prepend(e);const n=[];window.addEventListener("resize",(function(){e.width=window.innerWidth,e.height=window.innerHeight}));class h{constructor(){this.x=Math.random()*(e.width-5-5)+5,this.y=Math.random()*e.height,this.size=20*Math.random()+10,this.speedX=0,this.speedY=3*Math.random()+2}update(){(this.y+this.size>e.height||this.y+this.size<0)&&(this.speedY=-this.speedY),this.x+=this.speedX,this.y+=this.speedY}draw(){i.fillStyle="rgba(255, 255, 255, .08)",i.beginPath(),i.arc(this.x,this.y,this.size,0,2*Math.PI),i.fill()}}!function(){for(let t=0;t<75;t++)n.push(new h)}(),function t(){i.clearRect(0,0,e.width,e.height),function(){for(let t=0;t<n.length;t++)n[t].update(),n[t].draw()}(),requestAnimationFrame(t)}()}));
|
@@ -1,53 +1 @@
|
|
1
|
-
|
2
|
-
/// then while still in the loop runs scripts through each component
|
3
|
-
|
4
|
-
window.parent.addEventListener("load", function () {
|
5
|
-
|
6
|
-
// Find all shadow-dom components and create an array
|
7
|
-
let sRoots = document.querySelectorAll("d2l-html-block");
|
8
|
-
|
9
|
-
// Loop through array
|
10
|
-
sRoots.forEach((each) => {
|
11
|
-
|
12
|
-
// Set the root element of each shadow component to a variable
|
13
|
-
let sRoot = each.shadowRoot.querySelector(".d2l-html-block-rendered");
|
14
|
-
|
15
|
-
// Create link element
|
16
|
-
let link = document.createElement("link");
|
17
|
-
link.type = "text/css";
|
18
|
-
link.rel = "stylesheet";
|
19
|
-
link.href = "https://d2l.pima.edu/shared/webdev/course-files/plugins/global-homepage-overrides/global-homepage-overrides.css";
|
20
|
-
|
21
|
-
// Append link element to root element
|
22
|
-
sRoot.append(link);
|
23
|
-
|
24
|
-
// BEGIN SCRIPTS *note: still going through forEach loop
|
25
|
-
|
26
|
-
// PCC Quicklinks
|
27
|
-
/// if the element has both scroll-right/left
|
28
|
-
if (each.shadowRoot.getElementById("pcc-ql-scroll-right") && each.shadowRoot.getElementById("pcc-ql-scroll-left")) {
|
29
|
-
|
30
|
-
const buttonRight = each.shadowRoot.getElementById("pcc-ql-scroll-right");
|
31
|
-
const buttonLeft = each.shadowRoot.getElementById("pcc-ql-scroll-left");
|
32
|
-
const mediaQuery = window.matchMedia("(min-width: 413px)");
|
33
|
-
|
34
|
-
buttonRight.onclick = function () {
|
35
|
-
if (mediaQuery.matches) {
|
36
|
-
each.shadowRoot.getElementById("pcc-ql-container").scrollLeft += 490;
|
37
|
-
} else {
|
38
|
-
each.shadowRoot.getElementById("pcc-ql-container").scrollLeft += 300;
|
39
|
-
}
|
40
|
-
};
|
41
|
-
|
42
|
-
buttonLeft.onclick = function () {
|
43
|
-
if (mediaQuery.matches) {
|
44
|
-
each.shadowRoot.getElementById("pcc-ql-container").scrollLeft -= 490;
|
45
|
-
} else {
|
46
|
-
each.shadowRoot.getElementById("pcc-ql-container").scrollLeft -= 300;
|
47
|
-
}
|
48
|
-
};
|
49
|
-
};
|
50
|
-
|
51
|
-
|
52
|
-
})
|
53
|
-
});
|
1
|
+
window.parent.addEventListener("load",(function(){document.querySelectorAll("d2l-html-block").forEach((e=>{let t=e.shadowRoot.querySelector(".d2l-html-block-rendered"),o=document.createElement("link");if(o.type="text/css",o.rel="stylesheet",o.href="https://d2l.pima.edu/shared/webdev/course-files/plugins/global-homepage-overrides/global-homepage-overrides.css",t.append(o),e.shadowRoot.getElementById("pcc-ql-scroll-right")&&e.shadowRoot.getElementById("pcc-ql-scroll-left")){const t=e.shadowRoot.getElementById("pcc-ql-scroll-right"),o=e.shadowRoot.getElementById("pcc-ql-scroll-left"),l=window.matchMedia("(min-width: 413px)");t.onclick=function(){l.matches?e.shadowRoot.getElementById("pcc-ql-container").scrollLeft+=490:e.shadowRoot.getElementById("pcc-ql-container").scrollLeft+=300},o.onclick=function(){l.matches?e.shadowRoot.getElementById("pcc-ql-container").scrollLeft-=490:e.shadowRoot.getElementById("pcc-ql-container").scrollLeft-=300}}}))}));
|
@@ -1,57 +1 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
window.parent.addEventListener("load", function () {
|
4
|
-
|
5
|
-
// Find all shadow-dom components and create an array
|
6
|
-
let sRoots = document.querySelectorAll("d2l-html-block");
|
7
|
-
|
8
|
-
// Loop through the array
|
9
|
-
sRoots.forEach((each) => {
|
10
|
-
|
11
|
-
// Set the root-element of each shadow-component to a variable
|
12
|
-
let sRoot = each.shadowRoot.querySelector(".d2l-html-block-rendered");
|
13
|
-
|
14
|
-
// Create link element
|
15
|
-
let link = document.createElement("link");
|
16
|
-
link.type = "text/css";
|
17
|
-
link.rel = "stylesheet";
|
18
|
-
link.href = "https://d2l.pima.edu/shared/webdev/course-files/plugins/preview-banner/preview-banner.css";
|
19
|
-
|
20
|
-
// Append link element to root element
|
21
|
-
sRoot.append(link);
|
22
|
-
|
23
|
-
});
|
24
|
-
|
25
|
-
});
|
26
|
-
|
27
|
-
// Click any of the left navigation links to rerun script above.
|
28
|
-
// This is done to refresh the CSS inserted into the shadow component
|
29
|
-
let refresh = document.querySelectorAll(".d2l-le-TreeAccordionItem-anchor");
|
30
|
-
|
31
|
-
refresh.forEach((each_) => {
|
32
|
-
each_.addEventListener("click", () => {
|
33
|
-
|
34
|
-
setTimeout(() => {
|
35
|
-
let d2lBlock = document.querySelectorAll("d2l-html-block");
|
36
|
-
|
37
|
-
// Loop through the array
|
38
|
-
d2lBlock.forEach((_each) => {
|
39
|
-
|
40
|
-
// Set the root-element of each shadow-component to a variable
|
41
|
-
let innerD2lBlock = _each.shadowRoot.querySelector(".d2l-html-block-rendered");
|
42
|
-
|
43
|
-
// Create link element
|
44
|
-
let _link = document.createElement("link");
|
45
|
-
_link.type = "text/css";
|
46
|
-
_link.rel = "stylesheet";
|
47
|
-
_link.href = "https://d2l.pima.edu/shared/webdev/course-files/plugins/preview-banner/preview-banner.css";
|
48
|
-
|
49
|
-
// Append link element to root element
|
50
|
-
innerD2lBlock.append(_link);
|
51
|
-
|
52
|
-
});
|
53
|
-
|
54
|
-
}, 1000);
|
55
|
-
|
56
|
-
})
|
57
|
-
});
|
1
|
+
window.parent.addEventListener("load",(function(){document.querySelectorAll("d2l-html-block").forEach((e=>{let t=e.shadowRoot.querySelector(".d2l-html-block-rendered"),r=document.createElement("link");r.type="text/css",r.rel="stylesheet",r.href="https://d2l.pima.edu/shared/webdev/course-files/plugins/preview-banner/preview-banner.css",t.append(r)}))}));let refresh=document.querySelectorAll(".d2l-le-TreeAccordionItem-anchor");refresh.forEach((e=>{e.addEventListener("click",(()=>{setTimeout((()=>{document.querySelectorAll("d2l-html-block").forEach((e=>{let t=e.shadowRoot.querySelector(".d2l-html-block-rendered"),r=document.createElement("link");r.type="text/css",r.rel="stylesheet",r.href="https://d2l.pima.edu/shared/webdev/course-files/plugins/preview-banner/preview-banner.css",t.append(r)}))}),1e3)}))}));
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@pimaonline/pimaonline-themepack",
|
3
|
-
"version": "
|
3
|
+
"version": "4.0.0",
|
4
4
|
"description": "A cloud based, course theme-pack for building courses efficiently within the D2L learning environment.",
|
5
5
|
"main": "index.js",
|
6
6
|
"files": [
|
@@ -16,18 +16,14 @@
|
|
16
16
|
"/dist/css/routes.css"
|
17
17
|
],
|
18
18
|
"scripts": {
|
19
|
-
"
|
20
|
-
"
|
21
|
-
"build-dev": "gulp build-dev",
|
19
|
+
"build": "concurrently \"npm run sass\" \"npm run webpack\"",
|
20
|
+
"dev": "concurrently \"npm run sass:watch\" \"npm run webpack:watch\" \"npm run serve\"",
|
22
21
|
"docs": "docsify serve docs",
|
23
|
-
"ts": "webpack",
|
24
|
-
"ts:watch": "webpack --watch",
|
25
22
|
"sass": "sass --no-source-map --style=compressed src/scss:dist/css",
|
26
23
|
"sass:watch": "sass --watch --no-source-map --style=compressed src/scss:dist/css",
|
27
|
-
"
|
28
|
-
"
|
29
|
-
"
|
30
|
-
"dev:beta": "concurrently \"npm run sass:watch\" \"npm run ts:watch\" \"npm run serve:beta\""
|
24
|
+
"serve": "webpack serve",
|
25
|
+
"webpack": "webpack",
|
26
|
+
"webpack:watch": "webpack --watch"
|
31
27
|
},
|
32
28
|
"repository": {
|
33
29
|
"type": "git",
|
@@ -40,17 +36,17 @@
|
|
40
36
|
},
|
41
37
|
"homepage": "https://github.com/franreyn/pimaonline-themepack",
|
42
38
|
"devDependencies": {
|
39
|
+
"@types/react": "^18.2.76",
|
40
|
+
"@types/react-dom": "^18.2.25",
|
43
41
|
"concurrently": "^8.2.2",
|
44
42
|
"copy-webpack-plugin": "^12.0.2",
|
45
|
-
"
|
46
|
-
"
|
47
|
-
"
|
48
|
-
"gulp-pug": "^5.0.0",
|
49
|
-
"gulp-sass": "^5.1.0",
|
43
|
+
"html-webpack-plugin": "^5.6.0",
|
44
|
+
"react": "^18.2.0",
|
45
|
+
"react-dom": "^18.2.0",
|
50
46
|
"sass": "^1.49.9",
|
51
47
|
"ts-loader": "^9.5.1",
|
52
48
|
"typescript": "^5.3.3",
|
53
|
-
"webpack": "^5.
|
49
|
+
"webpack": "^5.91.0",
|
54
50
|
"webpack-cli": "^5.1.4",
|
55
51
|
"webpack-dev-server": "^4.15.1"
|
56
52
|
}
|
package/dist/js/jumpTo.js
DELETED
package/dist/js/scripts-ts.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
(()=>{"use strict";var e={592:(e,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.discardAttributes=void 0,o.discardAttributes=(e,...o)=>{o.forEach((o=>e.removeAttribute(o)))}},92:(e,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0});const n=t(256);[{class:"bi-",cdn:new URL("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css")},{class:"ri-",cdn:new URL("https://cdn.jsdelivr.net/npm/remixicon@4.0.1/fonts/remixicon.css")}].forEach((e=>{var o;if(document.querySelector(`[class*='${e.class}']`)){const t=null!==(o=null===n.docHead||void 0===n.docHead?void 0:n.docHead.querySelector("meta[name='viewport']"))&&void 0!==o?o:null;t||console.warn("Document error: could not find viewport meta tag");const r=document.createElement("link");r.setAttribute("href",e.cdn.toString()),r.setAttribute("rel","stylesheet"),t&&(null===n.docHead||void 0===n.docHead||n.docHead.insertBefore(r,t.nextSibling))}}))},340:(e,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0});const n=t(256);n.contentWrapper?n.contentWrapper.setAttribute("role","main"):n.contentWrapper||console.log("Document error: does not contain #content-wrapper."),n.secondColumn&&(n.secondColumn.setAttribute("role","region"),n.secondColumn.setAttribute("aria-label","Second column")),n.thirdColumn&&(n.thirdColumn.setAttribute("role","region"),n.thirdColumn.setAttribute("aria-label","Third column"))},452:(e,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.cleanMarkup=void 0;const n=t(256),r=t(592);o.cleanMarkup=()=>{n.rolePres&&n.rolePres.forEach((e=>e.removeAttribute("role"))),document.querySelectorAll("table, thead, tbody, tr, th, td").forEach((e=>{(0,r.discardAttributes)(e,"cellspacing","cellpadding","width","style")}))},(0,o.cleanMarkup)()},100:()=>{if(document.querySelector("body[focus-reader]")){let t=!1;const n=document.querySelector("#content-wrapper"),r=document.querySelector("body[focus-reader]"),l=document.querySelector("head"),c=document.createElement("link");c.rel="stylesheet",c.href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css",l&&l.append(c);const i=document.createElement("script");i.src="https://polyfill.io/v3/polyfill.min.js?features=IntersectionObserver",l&&l.append(i);const a=document.createElement("div");a.className="focus-reader-switches",r&&r.append(a);const d=document.createElement("div");a.append(d);const s=document.createElement("p");s.innerHTML="Focus Text",d.append(s);const u=document.createElement("i");u.classList.add("fa-solid"),u.classList.add("fa-circle-info"),d.append(u);const m=document.createElement("span");m.classList.add("info-tooltip"),m.innerHTML="Highlight text as you scroll",u.append(m);const p=document.createElement("button");p.id="focus-text",p.innerHTML=t?'<i class="fas fa-toggle-on"></i>':'<i class="fas fa-toggle-off"></i>',d.append(p),p.addEventListener("click",(()=>{t?(t=!t,n&&(n.removeAttribute("on"),p.innerHTML=t?'<i class="fas fa-toggle-on"></i>':'<i class="fas fa-toggle-off"></i>',o(n))):(t=!t,n&&(n.setAttribute("on",""),p.innerHTML=t?'<i class="fas fa-toggle-on"></i>':'<i class="fas fa-toggle-off"></i>',document.querySelectorAll("#content-wrapper .content-body :is(p, li, dd, dt, blockquote)").forEach((o=>{e({node:o,focusText:f})}))))}));const f=new IntersectionObserver((e=>{e.forEach((e=>{var o,t;e.isIntersecting?null===(o=e.target.closest("span"))||void 0===o||o.classList.add("focus-text"):null===(t=e.target.closest("span"))||void 0===t||t.classList.remove("focus-text")}))}),{root:null,rootMargin:"-48.9% 0px",threshold:0})}function e({node:o,focusText:t}){var n,r;o.nodeType===Node.TEXT_NODE&&""!==(null===(n=o.textContent)||void 0===n?void 0:n.trim())?(o.textContent.split(" ").forEach((e=>{var n;if(""!==e){const r=document.createElement("span");r.textContent=e+" ",t.observe(r),null===(n=o.parentNode)||void 0===n||n.insertBefore(r,o)}})),null===(r=o.parentNode)||void 0===r||r.removeChild(o)):o.nodeType===Node.ELEMENT_NODE&&Array.from(o.childNodes).forEach((o=>{e({node:o,focusText:t})}))}function o(e){var t,n,r;if(e.nodeType===Node.ELEMENT_NODE){const l=e;if(l instanceof HTMLElement&&"SPAN"===l.tagName&&("focus-text"===l.className||""===l.className||!(null===(t=l.textContent)||void 0===t?void 0:t.trim())||0===l.attributes.length)){const e=document.createTextNode(l.textContent||"");null===(n=l.parentNode)||void 0===n||n.insertBefore(e,l),null===(r=l.parentNode)||void 0===r||r.removeChild(l)}else Array.from(l.childNodes).forEach((e=>{o(e)}))}}},568:(e,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0});const n=t(256);(()=>{if(null!==n.courseBody){n.contentWrapper&&n.secondColumn&&n.thirdColumn?n.courseBody.id="three-column":n.contentWrapper&&n.secondColumn&&!n.columnWidget?n.courseBody.id="two-column":n.contentWrapper&&n.secondColumn&&n.columnWidget?n.courseBody.id="two-col-widget":n.contentWrapper&&n.videoWrapper?n.courseBody.id="video-grid":!n.contentWrapper||n.secondColumn||n.thirdColumn||n.columnWidget||n.videoWrapper?n.contentWrapper&&!n.secondColumn&&(n.thirdColumn||n.columnWidget)?console.log("Document error: <body> is missing id because #second-column doesn't exist."):console.log("Document error: unable to determine the page layout for setting <body> id."):n.courseBody.id="one-column";const e=document.body.children;let o=!1;for(let t=0;t<e.length;t++){const n=e[t];if("content-wrapper"!==n.id&&"second-column"!==n.id&&"third-column"!==n.id&&"column-widget"!==n.id&&"HEADER"!==n.tagName&&"FOOTER"!==n.tagName&&"SCRIPT"!==n.tagName&&"loom-companion-mv3"!==n.id&&"focus-reader-switches"!==n.className){o=!0;break}}o&&console.log("Document error: Additional content outside #content-wrapper, #second-column, #third-column, or footer.")}else console.log("Document error: no <body> element found.")})()},584:(e,o,t)=>{Object.defineProperty(o,"__esModule",{value:!0});const n=t(256),r=document.querySelectorAll(".gallery-wrapper"),l=document.querySelectorAll(".image-box"),c=document.querySelectorAll(".image-gallery");r.length>0&&r.forEach((e=>{const o=e.parentNode;o instanceof Element&&o.classList.contains("image-gallery")||console.warn("Document error: parent of .gallery-wrapper does not have the .image-gallery class.")})),l.length>0&&l.forEach((e=>{const o=e.parentNode;o instanceof Element&&o.classList.contains("gallery-wrapper")||console.log("Document error: parent of .image-box does not have the .gallery-wrapper class.")})),r.length>0&&r.forEach((e=>{Array.from(e.children).every((e=>e instanceof HTMLElement&&e.classList.contains("image-box")))||console.warn("Document error: not all direct children of .gallery-wrapper have the .image-box class.")}));c.length>0&&((()=>{const e=document.createElement("link");e.rel="stylesheet",e.href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css",null===n.docHead||void 0===n.docHead||n.docHead.appendChild(e)})(),(()=>{c.forEach((e=>{e.insertAdjacentHTML("afterbegin",'<div class="modal-box invisible">\n <div class="gallery-overlay"></div>\n <figure class="modal-box--image"><i class="fa-solid fa-x close-img"></i> <img src="#" alt="image here" /><figcaption class="img-caption"></figcaption></figure>\n </div>\n <button class="hide-gallery">Hide</button>')}));const e=document.querySelector(".gallery-overlay"),o=document.querySelector(".modal-box"),t=document.querySelector(".modal-box--image img"),n=document.querySelector(".img-caption"),r=document.querySelector(".close-img"),i=document.querySelectorAll(".hide-gallery"),a=e=>{null==o||o.classList.remove("invisible"),t&&(t.src=e.imgSrc),n&&(n.innerHTML=e.imgCaption)},d=()=>{null==o||o.classList.add("invisible")};l.forEach((e=>{e.addEventListener("click",(function(){var e,o;a({imgSrc:(null===(e=this.querySelector("img"))||void 0===e?void 0:e.src)||"",imgCaption:(null===(o=this.querySelector("img"))||void 0===o?void 0:o.alt)||""})})),e.setAttribute("tabindex","0"),e.addEventListener("keydown",(function(e){var o,t;"Enter"===e.key&&a({imgSrc:(null===(o=this.querySelector("img"))||void 0===o?void 0:o.src)||"",imgCaption:(null===(t=this.querySelector("img"))||void 0===t?void 0:t.alt)||""})}))})),e&&(e.onclick=d),window.onkeydown=e=>{27===e.keyCode&&d()},r&&(r.onclick=d),i.forEach((e=>{e.addEventListener("click",(()=>{var o;null===(o=e.nextElementSibling)||void 0===o||o.classList.toggle("invisible"),e.innerHTML="Hide"===e.innerHTML?"Show":"Hide"}))}))})())},315:()=>{const e=document.querySelectorAll(".media-container");e.length>0&&e.forEach(((e,o)=>{let t=String.fromCharCode(o+65).toLowerCase(),n=e.querySelector(".media-object"),r=e.querySelector("iframe"),l=e.querySelector(".media-info");r||console.warn("Document error: no iframe found for media container"),n||console.warn("Document error: no media object found for media container"),r&&!r.hasAttribute("aria-describedby")&&l&&(r.setAttribute("aria-describedby",`${t}`),l.id=`${[t]}`)}))},832:()=>{const e=document.querySelectorAll(".display, .display-lg");e.length>0&&(console.log("Fantastic"),[...e].forEach((e=>{const o=e.querySelectorAll(".display table th, table.display th, .display-lg table th, table.display-lg th"),t=e.querySelector(".display table tbody, table.display tbody, .display-lg table tbody, table.display-lg tbody"),n=[...o].map((e=>{var o;return(null===(o=e.textContent)||void 0===o?void 0:o.replace(/\r?\n|\r/,""))||""}));t&&[...t.rows].forEach((e=>{[...e.cells].forEach(((e,o)=>{e.setAttribute("data-th",n[o])}))}))})))},256:(e,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.videoWrapper=o.rolePres=o.thirdColumn=o.secondColumn=o.docHead=o.courseBody=o.contentWrapper=o.columnWidget=void 0,o.columnWidget=document.querySelector("#column-widget"),o.contentWrapper=document.querySelector("#content-wrapper"),o.courseBody=document.querySelector("body"),o.docHead=document.querySelector("head"),o.secondColumn=document.querySelector("#second-column"),o.thirdColumn=document.querySelector("#third-column"),o.rolePres=document.querySelectorAll('[role="presentation"]'),o.videoWrapper=document.querySelector("#video-wrapper")}},o={};function t(n){var r=o[n];if(void 0!==r)return r.exports;var l=o[n]={exports:{}};return e[n](l,l.exports,t),l.exports}t(92),t(340),t(452),t(100),t(568),t(584),t(315),t(832)})();
|
package/dist/js/scripts.js
DELETED
@@ -1,327 +0,0 @@
|
|
1
|
-
/// @description Main JS file for PimaOnline Themepack
|
2
|
-
/// @dependencies jQuery 3.3.1 or later
|
3
|
-
|
4
|
-
window.addEventListener("DOMContentLoaded", () => {
|
5
|
-
|
6
|
-
const courseBody = document.querySelector("body");
|
7
|
-
const contentWrapper = document.querySelector("#content-wrapper");
|
8
|
-
const secondColumn = document.querySelector("#second-column");
|
9
|
-
const thirdColumn = document.querySelector("#third-column");
|
10
|
-
const columnWidget = document.querySelector("#column-widget");
|
11
|
-
const videoWrapper = document.querySelector("#video-wrapper");
|
12
|
-
const rolePres = document.querySelectorAll('[role="presentation"]');
|
13
|
-
const imageGallery = document.querySelector(".image-gallery");
|
14
|
-
const vocabListWidget = document.querySelector("dl.vocab-list");
|
15
|
-
const vocabTerms = document.querySelectorAll("dl.vocab-list dt");
|
16
|
-
const vocabDefs = document.querySelectorAll("dl.vocab-list dd");
|
17
|
-
const vocabCloseBtns = document.querySelectorAll("dl.vocab-list button");
|
18
|
-
const vocabLists = document.querySelectorAll("dl[class^='vocab-list']");
|
19
|
-
const mediaContainers = document.querySelectorAll(".media-container");
|
20
|
-
const tabsWidgets = document.querySelectorAll(".tabs");
|
21
|
-
|
22
|
-
// Grid
|
23
|
-
const addGrid = () => {
|
24
|
-
if (secondColumn && thirdColumn) {
|
25
|
-
courseBody.id = "three-column";
|
26
|
-
} else if (secondColumn && !columnWidget) {
|
27
|
-
courseBody.id = "two-column";
|
28
|
-
} else if (columnWidget) {
|
29
|
-
courseBody.id = "two-col-widget";
|
30
|
-
} else if (videoWrapper) {
|
31
|
-
courseBody.id = "video-grid";
|
32
|
-
} else {
|
33
|
-
courseBody.id = "one-column";
|
34
|
-
}
|
35
|
-
};
|
36
|
-
addGrid();
|
37
|
-
|
38
|
-
// JS to add role and aria-label to content-wrapper, second-column, and third-column
|
39
|
-
const addAria = () => {
|
40
|
-
contentWrapper.setAttribute("role", "main");
|
41
|
-
if (secondColumn) {
|
42
|
-
secondColumn.setAttribute("role", "region");
|
43
|
-
secondColumn.setAttribute("aria-label", "Second column");
|
44
|
-
}
|
45
|
-
if (thirdColumn) {
|
46
|
-
thirdColumn.setAttribute("role", "region");
|
47
|
-
thirdColumn.setAttribute("aria-label", "Third column");
|
48
|
-
}
|
49
|
-
};
|
50
|
-
addAria();
|
51
|
-
|
52
|
-
// Clean up HTML
|
53
|
-
const cleanMarkup = () => {
|
54
|
-
// Remove role="presentation" attr from any element that has it
|
55
|
-
if (rolePres) {
|
56
|
-
rolePres.forEach((roleElem) => roleElem.removeAttribute("role"));
|
57
|
-
}
|
58
|
-
// Set functino to remove atrributes from elements
|
59
|
-
const discardAttributes = (element, ...attributes) => {
|
60
|
-
attributes.forEach((attribute) => element.removeAttribute(attribute));
|
61
|
-
}
|
62
|
-
// Remove attributes from tables
|
63
|
-
const tableElems = document.querySelectorAll("table, thead, tbody, tr, th, td");
|
64
|
-
tableElems.forEach((elem) => {
|
65
|
-
discardAttributes(elem, "cellspacing", "cellpadding", "width", "style");
|
66
|
-
});
|
67
|
-
};
|
68
|
-
cleanMarkup();
|
69
|
-
|
70
|
-
// Helper JS for Responsive Tables
|
71
|
-
const initResponsiveTables = () => {
|
72
|
-
const tables = document.querySelectorAll(".display, .display-lg")
|
73
|
-
for (let table = 0; table < tables.length; table++) {
|
74
|
-
let headertext = [],
|
75
|
-
headers = tables[table].querySelectorAll(".display table th, table.display th, .display-lg table th, table.display-lg th"),
|
76
|
-
tablebody = tables[table].querySelector(".display table tbody, table.display tbody, .display-lg table tbody, table.display-lg tbody");
|
77
|
-
for (let header = 0; header < headers.length; header++) {
|
78
|
-
let current = headers[header];
|
79
|
-
headertext.push(current.textContent.replace(/\r?\n|\r/, ""));
|
80
|
-
}
|
81
|
-
for (let y = 0, row; row = tablebody.rows[y]; y++) {
|
82
|
-
for (let j = 0, col; col = row.cells[j]; j++) {
|
83
|
-
col.setAttribute("data-th", headertext[j]);
|
84
|
-
}
|
85
|
-
}
|
86
|
-
}
|
87
|
-
}
|
88
|
-
initResponsiveTables();
|
89
|
-
|
90
|
-
// This is called by anchor links via onlick="" in the HTML
|
91
|
-
// Added because default anchor links don't work on all browsers using D2L
|
92
|
-
const addScript = (script) => {
|
93
|
-
let newScript = document.createElement("script");
|
94
|
-
newScript.setAttribute("src", script);
|
95
|
-
|
96
|
-
document.body.append(newScript);
|
97
|
-
}
|
98
|
-
|
99
|
-
if(document.querySelector("[onclick]")) {
|
100
|
-
addScript("https://cdn.jsdelivr.net/npm/@pimaonline/pimaonline-themepack/dist/js/jumpTo.js");
|
101
|
-
}
|
102
|
-
|
103
|
-
// Image gallery
|
104
|
-
const callImageGallery = () => {
|
105
|
-
// Create link element with font-awesome cdn and append it to the <head>
|
106
|
-
const docHead = document.querySelector("head");
|
107
|
-
const fontAwesomeCdn = document.createElement("link");
|
108
|
-
fontAwesomeCdn.setAttribute("rel", "stylesheet");
|
109
|
-
fontAwesomeCdn.setAttribute("href", "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css");
|
110
|
-
docHead.appendChild(fontAwesomeCdn);
|
111
|
-
// Begin image gallery
|
112
|
-
const imgGalleries = document.querySelectorAll(".image-gallery"),
|
113
|
-
imgBoxes = document.querySelectorAll(".image-box"),
|
114
|
-
modalBoxContent = `<div class="modal-box invisible">
|
115
|
-
<div class="gallery-overlay"></div>
|
116
|
-
<figure class="modal-box--image"><i class="fa-solid fa-x close-img"></i> <img src="#" alt="image here" /><figcaption class="img-caption"></figcaption></figure>
|
117
|
-
</div>
|
118
|
-
<button class="hide-gallery">Hide</button>`;
|
119
|
-
|
120
|
-
// createModalBox.innerHTML = modalBoxContent;
|
121
|
-
for (let imgGallery = 0; imgGallery < imgGalleries.length; imgGallery++) {
|
122
|
-
imgGalleries[imgGallery].insertAdjacentHTML("afterbegin", modalBoxContent);
|
123
|
-
}
|
124
|
-
|
125
|
-
if (document.querySelector(".modal-box")) {
|
126
|
-
const overlay = document.querySelector(".gallery-overlay"),
|
127
|
-
modalBox = document.querySelector(".modal-box"),
|
128
|
-
modalImg = document.querySelector(".modal-box--image img"),
|
129
|
-
modalCaption = document.querySelector(".img-caption"),
|
130
|
-
closeImg = document.querySelector(".close-img");
|
131
|
-
|
132
|
-
for (let imgBox = 0; imgBox < imgBoxes.length; imgBox++) {
|
133
|
-
imgBoxes[imgBox].onclick = function () {
|
134
|
-
modalBox.classList.remove("invisible");
|
135
|
-
let imgSrc = this.querySelector("img").src;
|
136
|
-
modalImg.src = imgSrc;
|
137
|
-
let imgCaption = this.querySelector("img").alt;
|
138
|
-
modalCaption.innerHTML = imgCaption;
|
139
|
-
}
|
140
|
-
}
|
141
|
-
overlay.onclick = () => {
|
142
|
-
modalBox.classList.add("invisible");
|
143
|
-
}
|
144
|
-
window.onkeydown = (esc) => {
|
145
|
-
if (esc.keyCode === 27) {
|
146
|
-
modalBox.classList.add("invisible");
|
147
|
-
}
|
148
|
-
}
|
149
|
-
closeImg.onclick = () => {
|
150
|
-
modalBox.classList.add("invisible");
|
151
|
-
}
|
152
|
-
const hideGalleries = document.querySelectorAll(".hide-gallery");
|
153
|
-
for (let hideGallery = 0; hideGallery < hideGalleries.length; hideGallery++) {
|
154
|
-
hideGalleries[hideGallery].addEventListener("click", () => {
|
155
|
-
hideGalleries[hideGallery].nextElementSibling.classList.toggle("invisible");
|
156
|
-
if (hideGalleries[hideGallery].innerHTML === "Hide") {
|
157
|
-
hideGalleries[hideGallery].innerHTML = "Show";
|
158
|
-
} else {
|
159
|
-
hideGalleries[hideGallery].innerHTML = "Hide";
|
160
|
-
}
|
161
|
-
});
|
162
|
-
}
|
163
|
-
};
|
164
|
-
}
|
165
|
-
if (imageGallery) {
|
166
|
-
callImageGallery();
|
167
|
-
}
|
168
|
-
|
169
|
-
// Vocab list widget
|
170
|
-
const callVocabList = () => {
|
171
|
-
if (vocabCloseBtns) {
|
172
|
-
for(let btn = 0; btn < vocabCloseBtns.length; btn++) {
|
173
|
-
vocabCloseBtns[btn].addEventListener("click", () => {
|
174
|
-
for(let node = 0; node < vocabLists[btn].children.length;node++) {
|
175
|
-
if(vocabLists[btn].children[node].tagName == "DD") {
|
176
|
-
vocabLists[btn].children[node].removeAttribute("style");
|
177
|
-
}
|
178
|
-
if(vocabLists[btn].children[node].tagName == "DT") {
|
179
|
-
vocabLists[btn].children[node].removeAttribute("class");
|
180
|
-
}
|
181
|
-
}});
|
182
|
-
}
|
183
|
-
}
|
184
|
-
for (let activeTerm = 0; activeTerm < vocabTerms.length; activeTerm++) {
|
185
|
-
vocabTerms[activeTerm].addEventListener("click", function() {
|
186
|
-
this.classList.toggle("active");
|
187
|
-
let termPanel = this.nextElementSibling;
|
188
|
-
if (termPanel.style.display === "block") { termPanel.removeAttribute("style"); }
|
189
|
-
else { termPanel.style.display = "block"; }
|
190
|
-
});
|
191
|
-
|
192
|
-
vocabTerms[activeTerm].addEventListener("keydown", function(e) {
|
193
|
-
if(e.key === "Enter") {
|
194
|
-
this.classList.toggle("active");
|
195
|
-
let termPanel = this.nextElementSibling;
|
196
|
-
if (termPanel.style.display === "block") { termPanel.removeAttribute("style"); }
|
197
|
-
else { termPanel.style.display = "block"; }
|
198
|
-
}
|
199
|
-
});
|
200
|
-
}
|
201
|
-
}
|
202
|
-
if (vocabListWidget) {callVocabList();}
|
203
|
-
|
204
|
-
//
|
205
|
-
const addMediaContainersAria = () => {
|
206
|
-
mediaContainers.forEach((eachContainer, index) => {
|
207
|
-
// loopID: find the current index value, convert it to its letter equivalent, then convert to lowercase
|
208
|
-
let loopId = String.fromCharCode(index + 65).toLowerCase();
|
209
|
-
let mediaObject = eachContainer.querySelector(".media-object");
|
210
|
-
let iframe = mediaObject.firstElementChild;
|
211
|
-
let mediaInfo = mediaObject.nextElementSibling;
|
212
|
-
|
213
|
-
// If element DOES NOT have "aria-describedby" && it DOES have a sibling element.
|
214
|
-
if (!iframe.hasAttribute("aria-describedby") && mediaInfo != null) {
|
215
|
-
iframe.setAttribute("aria-describedby", `${loopId}`);
|
216
|
-
mediaInfo.id = `${[loopId]}`;
|
217
|
-
}
|
218
|
-
});
|
219
|
-
}
|
220
|
-
if (mediaContainers) {addMediaContainersAria();}
|
221
|
-
|
222
|
-
//Tabs Widget
|
223
|
-
const callTabsWidget = () => {
|
224
|
-
|
225
|
-
let tabsWidgetsNum = 0;
|
226
|
-
|
227
|
-
tabsWidgets.forEach((tab,index) => {
|
228
|
-
let tabInputs = tab.querySelectorAll("input")
|
229
|
-
let tabLabels = tab.querySelectorAll("label")
|
230
|
-
let tabDivs = tab.querySelectorAll("div")
|
231
|
-
|
232
|
-
let groupNum = index + 1;
|
233
|
-
|
234
|
-
//Add region and aria-label to parent div
|
235
|
-
tab.setAttribute("role", "region");
|
236
|
-
tab.setAttribute("aria-label", `tab group ${groupNum}`)
|
237
|
-
|
238
|
-
for(tabIndex = 0; tabIndex < tabInputs.length; tabIndex++) {
|
239
|
-
|
240
|
-
let tabNum = tabsWidgetsNum + 1;
|
241
|
-
|
242
|
-
//Add class, id, name, and aria-described by for inputs
|
243
|
-
tabInputs[tabIndex].classList.add("tab-input");
|
244
|
-
tabInputs[tabIndex].setAttribute("type", "radio")
|
245
|
-
tabInputs[tabIndex].setAttribute("id", `tab${tabNum}`);
|
246
|
-
tabInputs[tabIndex].setAttribute("name", `hint-group-${groupNum}` )
|
247
|
-
tabInputs[tabIndex].setAttribute("aria-describedby", `tabHeading${tabNum}`)
|
248
|
-
//Add class and for for labels
|
249
|
-
tabLabels[tabIndex].classList.add("tab-header");
|
250
|
-
tabLabels[tabIndex].setAttribute("for", `tab${tabNum}`)
|
251
|
-
//Add class, tabindex, and id for divs
|
252
|
-
tabDivs[tabIndex].classList.add("tab-panel")
|
253
|
-
tabDivs[tabIndex].setAttribute("tabindex", 0)
|
254
|
-
tabDivs[tabIndex].setAttribute("id", `tabHeading${tabNum}`)
|
255
|
-
//Add attributes for hide tab
|
256
|
-
if(tabIndex + 1 == tabInputs.length) {
|
257
|
-
tabLabels[tabIndex].classList.add("hide-tab")
|
258
|
-
tabInputs[tabIndex].checked = true;
|
259
|
-
tabDivs[tabIndex].classList.add("hide-panel")
|
260
|
-
}
|
261
|
-
tabsWidgetsNum++;
|
262
|
-
}
|
263
|
-
})
|
264
|
-
}
|
265
|
-
if (tabsWidgets) {callTabsWidget();}
|
266
|
-
|
267
|
-
// Toggle footnotes
|
268
|
-
const toggleBtns = document.querySelectorAll(".toggle-btn, .toggle-footnotes");
|
269
|
-
|
270
|
-
if (document.querySelector(".toggle-btn") || document.querySelector(".toggle-footnotes")) {
|
271
|
-
for (let toggleBtn = 0; toggleBtn < toggleBtns.length; toggleBtn++) {
|
272
|
-
// Add tabindex
|
273
|
-
toggleBtns[toggleBtn].setAttribute("tabindex", "0");
|
274
|
-
|
275
|
-
// Show/hide on click
|
276
|
-
toggleBtns[toggleBtn].addEventListener("click", () => {
|
277
|
-
toggleBtns[toggleBtn].nextElementSibling.classList.toggle("show");
|
278
|
-
})
|
279
|
-
|
280
|
-
// Show/hide on enter for users who use tab
|
281
|
-
toggleBtns[toggleBtn].addEventListener("keydown", (enter) => {
|
282
|
-
if (enter.keyCode === 13) {
|
283
|
-
toggleBtns[toggleBtn].nextElementSibling.classList.toggle("show");
|
284
|
-
}
|
285
|
-
})
|
286
|
-
}
|
287
|
-
}
|
288
|
-
|
289
|
-
// Call function with jQuery scripts
|
290
|
-
const callJquery = () => {
|
291
|
-
// Toggle Button's Arrow Right Points Down on Click
|
292
|
-
$('.arrow-right').on('click', function () {
|
293
|
-
$(this).toggleClass('arrow-down');
|
294
|
-
});
|
295
|
-
// TOOLTIP
|
296
|
-
// Allows Screen readers to toggle a tooltip on click and to say if the tooltip is collapsed or expanded.
|
297
|
-
$(".tooltip").click(function () {
|
298
|
-
$(this).children(".tip-hover").toggle();
|
299
|
-
if ($(this).children(".tip-hover").is(':visible')) {
|
300
|
-
$(this).attr('aria-expanded', 'true');
|
301
|
-
$(this).removeClass('hidden');
|
302
|
-
} else {
|
303
|
-
$(this).attr('aria-expanded', 'false');
|
304
|
-
$(this).addClass('hidden');
|
305
|
-
}
|
306
|
-
});
|
307
|
-
let start = 999;
|
308
|
-
$('.tooltip').each(function (i) {
|
309
|
-
$(this).css('z-index', start--);
|
310
|
-
});
|
311
|
-
$(".tooltip .video-container").parent().css("width", "450px");
|
312
|
-
}
|
313
|
-
callJquery();
|
314
|
-
|
315
|
-
// Fancybox
|
316
|
-
if (document.querySelector(".fancybox")) {
|
317
|
-
$("[data-fancybox]").fancybox({
|
318
|
-
idleTime: false,
|
319
|
-
topRatio: 0.1,
|
320
|
-
helpers: {
|
321
|
-
title: {
|
322
|
-
type: 'inside'
|
323
|
-
},
|
324
|
-
}
|
325
|
-
});
|
326
|
-
}
|
327
|
-
});
|