@pimaonline/pimaonline-themepack 2.1.8 → 2.1.10
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +25 -27
- package/dist/css/main.css +1 -1
- package/dist/css/routes.css +1 -3
- package/dist/css/themes/ajs/styles.css +1 -0
- package/dist/css/themes/business/styles.css +1 -0
- package/dist/css/themes/cad/styles.css +1 -0
- package/dist/css/themes/cards/styles.css +1 -1
- package/dist/css/themes/cda/styles.css +1 -0
- 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 -0
- package/dist/css/themes/fashion/styles.css +1 -1
- package/dist/css/themes/fitness/styles.css +1 -0
- 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 -0
- package/dist/css/themes/hrs/styles.css +1 -0
- package/dist/css/themes/lang/styles.css +1 -0
- package/dist/css/themes/math/styles.css +1 -0
- package/dist/css/themes/music/styles.css +1 -1
- package/dist/css/themes/philosophy/styles.css +1 -1
- package/dist/css/themes/soc/styles.css +1 -0
- package/dist/css/themes/university/styles.css +1 -1
- package/dist/css/themes/vet/styles.css +1 -0
- package/dist/css/themes/welding/styles.css +1 -1
- package/dist/img/theme-images/fitness/Chevrons.png +0 -0
- package/dist/img/theme-images/fitness/Chevrons50.png +0 -0
- package/dist/img/theme-images/fitness/bg.jpg +0 -0
- package/dist/img/theme-images/history/hisribbonv-02.png +0 -0
- package/dist/img/theme-images/img/bouncingball.png +0 -0
- package/dist/img/theme-images/vet/bouncingball.jpg +0 -0
- package/dist/img/theme-images/vet/bouncingball.png +0 -0
- package/dist/js/scripts.js +266 -197
- package/dist/js/scripts2.js +32 -4
- package/dist/plugins/fancybox/jquery.fancybox.css +5 -5
- package/dist/plugins/flashcards/README.md +0 -0
- package/dist/plugins/flashcards/config.rb +0 -0
- package/dist/plugins/flashcards/css/style.css +5 -5
- package/dist/plugins/flashcards/index.html +0 -0
- package/dist/plugins/flashcards/js/flash_cards.min.js +0 -0
- package/dist/plugins/flashcards/js/plugins/jquery.cycle.js +0 -0
- package/dist/plugins/flashcards/js/vendor/jquery-1.7.2.js +0 -0
- package/dist/plugins/flashcards/js/vendor/jquery-1.7.2.min.js +0 -0
- package/dist/plugins/flashcards/js/vendor/modernizr-2.5.3.min.js +0 -0
- package/dist/plugins/flashcards/resources/fonts/flash_cards/flash_cards.eot +0 -0
- package/dist/plugins/flashcards/resources/fonts/flash_cards/flash_cards.svg +0 -0
- package/dist/plugins/flashcards/resources/fonts/flash_cards/flash_cards.ttf +0 -0
- package/dist/plugins/flashcards/resources/fonts/flash_cards/flash_cards.woff +0 -0
- package/dist/plugins/global-homepage-overrides/global-homepage-overrides.css +2 -2
- package/dist/plugins/global-homepage-overrides/img/quicklinks-icons/ql-advising.png +0 -0
- package/dist/plugins/global-homepage-overrides/img/quicklinks-icons/ql-counseling.png +0 -0
- package/dist/plugins/global-homepage-overrides/img/quicklinks-icons/ql-research-help.png +0 -0
- package/dist/plugins/global-homepage-overrides/img/quicklinks-icons/ql-tech-support.png +0 -0
- package/dist/plugins/global-homepage-overrides/img/quicklinks-icons/ql-testing-center.png +0 -0
- package/dist/plugins/global-homepage-overrides/img/quicklinks-icons/ql-tutoring.png +0 -0
- package/package.json +6 -12
- package/dist/img/theme-images/culinary/concrete-light.png +0 -0
package/dist/js/scripts.js
CHANGED
@@ -1,80 +1,94 @@
|
|
1
1
|
/// @description Main JS file for PimaOnline Themepack
|
2
2
|
/// @dependencies jQuery 3.3.1 or later
|
3
3
|
|
4
|
-
window.addEventListener("DOMContentLoaded",
|
5
|
-
|
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
|
+
|
6
22
|
// Grid
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
}
|
20
|
-
|
21
|
-
|
22
|
-
|
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
|
+
|
23
38
|
// JS to add role and aria-label to content-wrapper, second-column, and third-column
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
// Remove role="presentation" attr
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
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
|
+
|
45
70
|
// Helper JS for Responsive Tables
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
for (var i = 0; i < headers.length; i++) {
|
56
|
-
var current = headers[i];
|
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];
|
57
79
|
headertext.push(current.textContent.replace(/\r?\n|\r/, ""));
|
58
80
|
}
|
59
|
-
for (
|
60
|
-
for (
|
81
|
+
for (let y = 0, row; row = tablebody.rows[y]; y++) {
|
82
|
+
for (let j = 0, col; col = row.cells[j]; j++) {
|
61
83
|
col.setAttribute("data-th", headertext[j]);
|
62
84
|
}
|
63
85
|
}
|
64
86
|
}
|
65
87
|
}
|
66
88
|
initResponsiveTables();
|
67
|
-
|
68
|
-
//
|
69
|
-
|
70
|
-
attributes.forEach((attribute) => element.removeAttribute(attribute));
|
71
|
-
|
72
|
-
document.querySelectorAll("table, thead, tbody, tr, th, td").forEach((elem) => {
|
73
|
-
// Function parameters: discardAttributes(element, attribute1, attribute2, attribute3, ...)
|
74
|
-
discardAttributes(elem, "cellspacing", "cellpadding", "width", "style");
|
75
|
-
});
|
76
|
-
|
77
|
-
// Append scripts-async.js to DOM
|
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
|
78
92
|
const addScript = (script) => {
|
79
93
|
let newScript = document.createElement("script");
|
80
94
|
newScript.setAttribute("src", script);
|
@@ -83,159 +97,203 @@ window.addEventListener("DOMContentLoaded", function () {
|
|
83
97
|
}
|
84
98
|
|
85
99
|
if(document.querySelector("[onclick]")) {
|
86
|
-
addScript("https://
|
100
|
+
addScript("https://cdn.jsdelivr.net/npm/@pimaonline/pimaonline-themepack/dist/js/jumpTo.js");
|
87
101
|
}
|
88
|
-
|
102
|
+
|
89
103
|
// Image gallery
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
imgBoxes
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
modalBox.classList.add('invisible');
|
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);
|
110
123
|
}
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
modalBox.
|
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
|
+
}
|
115
140
|
}
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
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();
|
128
167
|
}
|
129
|
-
|
130
|
-
// Vocab list widget
|
131
|
-
const vocabListWidget = document.querySelector("dl.vocab-list");
|
132
|
-
const vocabTerms = document.querySelectorAll("dl.vocab-list dt");
|
133
|
-
const vocabDefs = document.querySelectorAll("dl.vocab-list dd");
|
134
168
|
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
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
|
+
}});
|
145
182
|
}
|
146
|
-
}
|
147
|
-
|
183
|
+
}
|
148
184
|
for (let activeTerm = 0; activeTerm < vocabTerms.length; activeTerm++) {
|
149
185
|
vocabTerms[activeTerm].addEventListener("click", function() {
|
150
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
|
+
});
|
151
191
|
|
192
|
+
vocabTerms[activeTerm].addEventListener("keydown", function(e) {
|
193
|
+
if(e.key === "Enter") {
|
194
|
+
this.classList.toggle("active");
|
152
195
|
let termPanel = this.nextElementSibling;
|
153
196
|
if (termPanel.style.display === "block") { termPanel.removeAttribute("style"); }
|
154
197
|
else { termPanel.style.display = "block"; }
|
198
|
+
}
|
155
199
|
});
|
156
200
|
}
|
157
201
|
}
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
tabInputs
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
//Add
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
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++;
|
199
262
|
}
|
200
|
-
|
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
|
+
})
|
201
286
|
}
|
202
|
-
}
|
203
|
-
}
|
204
|
-
if (tabsWidgets) {callTabsWidget();}
|
205
|
-
|
206
|
-
// Show/Hide Toggle Button for Accordion
|
207
|
-
$('.toggle-btn').on('click', function () {
|
208
|
-
$(this).next().slideToggle(200);
|
209
|
-
});
|
210
|
-
|
211
|
-
// Show/Hide for Footnotes and Footer
|
212
|
-
$('.toggle-footnotes').on('click', function () {
|
213
|
-
$(this).next().slideToggle(200);
|
214
|
-
$(this).text($(this).text() == '[Hide Footnotes]' ? '[Show Footnotes]' : '[Hide Footnotes]');
|
215
|
-
});
|
287
|
+
}
|
216
288
|
|
289
|
+
// Call function with jQuery scripts
|
290
|
+
const callJquery = () => {
|
217
291
|
// Toggle Button's Arrow Right Points Down on Click
|
218
292
|
$('.arrow-right').on('click', function () {
|
219
293
|
$(this).toggleClass('arrow-down');
|
220
294
|
});
|
221
|
-
|
222
|
-
//
|
223
|
-
if (document.querySelector(".fancybox")) {
|
224
|
-
$("[data-fancybox]").fancybox({
|
225
|
-
idleTime: false,
|
226
|
-
topRatio: 0.1,
|
227
|
-
helpers: {
|
228
|
-
title: {
|
229
|
-
type: 'inside'
|
230
|
-
},
|
231
|
-
}
|
232
|
-
});
|
233
|
-
}
|
234
|
-
|
235
|
-
/*------WIDGET SCRIPTS------ */
|
236
|
-
/* TOOLTIP ------ */
|
237
|
-
// Allows Screen readers to toggle a tooltip on click and to say if the tooltip is collapsed or expanded.
|
238
|
-
|
295
|
+
// TOOLTIP
|
296
|
+
// Allows Screen readers to toggle a tooltip on click and to say if the tooltip is collapsed or expanded.
|
239
297
|
$(".tooltip").click(function () {
|
240
298
|
$(this).children(".tip-hover").toggle();
|
241
299
|
if ($(this).children(".tip-hover").is(':visible')) {
|
@@ -246,13 +304,24 @@ if (tabsWidgets) {callTabsWidget();}
|
|
246
304
|
$(this).addClass('hidden');
|
247
305
|
}
|
248
306
|
});
|
249
|
-
|
250
|
-
var start = 999;
|
251
|
-
|
307
|
+
let start = 999;
|
252
308
|
$('.tooltip').each(function (i) {
|
253
309
|
$(this).css('z-index', start--);
|
254
310
|
});
|
255
|
-
|
256
311
|
$(".tooltip .video-container").parent().css("width", "450px");
|
312
|
+
}
|
313
|
+
callJquery();
|
257
314
|
|
258
|
-
|
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
|
+
});
|
package/dist/js/scripts2.js
CHANGED
@@ -128,6 +128,18 @@ const callImageGallery = () => {
|
|
128
128
|
let imgCaption = this.querySelector("img").alt;
|
129
129
|
modalCaption.innerHTML = imgCaption;
|
130
130
|
}
|
131
|
+
|
132
|
+
// Make images tab-able
|
133
|
+
imgBoxes[imgBox].setAttribute("tabindex", "0");
|
134
|
+
imgBoxes[imgBox].addEventListener("keydown", function (enter) {
|
135
|
+
if (enter.key === "Enter") {
|
136
|
+
modalBox.classList.remove("invisible");
|
137
|
+
let imgSrc = this.querySelector("img").src;
|
138
|
+
modalImg.src = imgSrc;
|
139
|
+
let imgCaption = this.querySelector("img").alt;
|
140
|
+
modalCaption.innerHTML = imgCaption;
|
141
|
+
}
|
142
|
+
})
|
131
143
|
}
|
132
144
|
overlay.onclick = () => {
|
133
145
|
modalBox.classList.add("invisible");
|
@@ -137,6 +149,7 @@ const callImageGallery = () => {
|
|
137
149
|
modalBox.classList.add("invisible");
|
138
150
|
}
|
139
151
|
}
|
152
|
+
|
140
153
|
closeImg.onclick = () => {
|
141
154
|
modalBox.classList.add("invisible");
|
142
155
|
}
|
@@ -277,12 +290,27 @@ if (document.querySelector(".toggle-btn") || document.querySelector(".toggle-foo
|
|
277
290
|
}
|
278
291
|
}
|
279
292
|
|
293
|
+
// Animated border for HRS theme
|
294
|
+
const hrsBorders = document.querySelectorAll(".hrs-border");
|
295
|
+
|
296
|
+
if(hrsBorders) {
|
297
|
+
for (let hrsBorder = 0; hrsBorder < hrsBorders.length; hrsBorder++) {
|
298
|
+
const callAnimateBorder = new IntersectionObserver(entries => {
|
299
|
+
// Loop over the entries
|
300
|
+
entries.forEach(entry => {
|
301
|
+
// If the element is visible
|
302
|
+
if (entry.isIntersecting) {
|
303
|
+
// Add the animation class
|
304
|
+
entry.target.classList.add('animate-border');
|
305
|
+
}
|
306
|
+
});
|
307
|
+
});
|
308
|
+
callAnimateBorder.observe(hrsBorders[hrsBorder]);
|
309
|
+
}
|
310
|
+
};
|
311
|
+
|
280
312
|
// Call function with jQuery scripts
|
281
313
|
const callJquery = () => {
|
282
|
-
// Show/Hide Toggle Button for Accordion widget
|
283
|
-
$('.toggle-btn').on('click', function () {
|
284
|
-
$(this).next().slideToggle(200);
|
285
|
-
});
|
286
314
|
// Toggle Button's Arrow Right Points Down on Click
|
287
315
|
$('.arrow-right').on('click', function () {
|
288
316
|
$(this).toggleClass('arrow-down');
|
@@ -41,9 +41,9 @@
|
|
41
41
|
}
|
42
42
|
|
43
43
|
.fancybox-opened .fancybox-skin {
|
44
|
-
-webkit-box-shadow: 0 10px 25px rgba(
|
45
|
-
-moz-box-shadow: 0 10px 25px rgba(
|
46
|
-
box-shadow: 0 10px 25px rgba(
|
44
|
+
-webkit-box-shadow: 0 10px 25px rgba(13, 13, 13, 0.5);
|
45
|
+
-moz-box-shadow: 0 10px 25px rgba(13, 13, 13, 0.5);
|
46
|
+
box-shadow: 0 10px 25px rgba(13, 13, 13, 0.5);
|
47
47
|
}
|
48
48
|
|
49
49
|
.fancybox-outer, .fancybox-inner {
|
@@ -227,7 +227,7 @@
|
|
227
227
|
margin-right: -100%;
|
228
228
|
padding: 2px 20px;
|
229
229
|
background: transparent; /* Fallback for web browsers that doesn't support RGBa */
|
230
|
-
background: rgba(
|
230
|
+
background: rgba(13, 13, 13, 0.8);
|
231
231
|
-webkit-border-radius: 15px;
|
232
232
|
-moz-border-radius: 15px;
|
233
233
|
border-radius: 15px;
|
@@ -255,7 +255,7 @@
|
|
255
255
|
color: #fff;
|
256
256
|
padding: 10px;
|
257
257
|
background: #000;
|
258
|
-
background: rgba(
|
258
|
+
background: rgba(13, 13, 13, .8);
|
259
259
|
}
|
260
260
|
|
261
261
|
/*Retina graphics!*/
|
File without changes
|
File without changes
|
@@ -51,7 +51,7 @@
|
|
51
51
|
background-color: #fff;
|
52
52
|
background-size: 500px 30px;
|
53
53
|
background-position: 50%;
|
54
|
-
border: 1px solid rgba(
|
54
|
+
border: 1px solid rgba(13, 13, 13, .2);
|
55
55
|
height: inherit;
|
56
56
|
position: absolute;
|
57
57
|
-webkit-transition: all 0.4s ease-in-out;
|
@@ -62,9 +62,9 @@
|
|
62
62
|
width: inherit;
|
63
63
|
}
|
64
64
|
.current .side_one, .current.flip .side_two {
|
65
|
-
-webkit-box-shadow: 1px 1px 4px -1px rgba(
|
66
|
-
-moz-box-shadow: 1px 1px 4px -1px rgba(
|
67
|
-
box-shadow: 1px 1px 4px -1px rgba(
|
65
|
+
-webkit-box-shadow: 1px 1px 4px -1px rgba(13, 13, 13, 0.3);
|
66
|
+
-moz-box-shadow: 1px 1px 4px -1px rgba(13, 13, 13, 0.3);
|
67
|
+
box-shadow: 1px 1px 4px -1px rgba(13, 13, 13, 0.3);
|
68
68
|
}
|
69
69
|
.current.flip .side_one {
|
70
70
|
-webkit-box-shadow: none;
|
@@ -146,7 +146,7 @@
|
|
146
146
|
width: 1px;
|
147
147
|
}
|
148
148
|
#keyboard_shortcuts {
|
149
|
-
background: rgba(
|
149
|
+
background: rgba(13, 13, 13, 1);
|
150
150
|
bottom: 0;
|
151
151
|
display: none;
|
152
152
|
left: 0;
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|