kcc-gem-theme-slim 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/README.md +138 -0
  4. data/_data/cache_bust_css.yml +1 -0
  5. data/_data/navigation.yml +154 -0
  6. data/_includes/accordion.html +36 -0
  7. data/_includes/accordion_path-sorting.html +29 -0
  8. data/_includes/benefits.html +98 -0
  9. data/_includes/body.html +10 -0
  10. data/_includes/breadcrumbs.html +44 -0
  11. data/_includes/card-section.html +26 -0
  12. data/_includes/chat-now.html +8 -0
  13. data/_includes/check-mark.svg +17 -0
  14. data/_includes/contacts-tan.html +94 -0
  15. data/_includes/contacts.html +80 -0
  16. data/_includes/document-head.html +22 -0
  17. data/_includes/emergency-alerts.html +29 -0
  18. data/_includes/foot.html +3 -0
  19. data/_includes/footer.html +271 -0
  20. data/_includes/hash/theme_hash.yml +1 -0
  21. data/_includes/header-global.html +49 -0
  22. data/_includes/hero-slider.html +23 -0
  23. data/_includes/main-call-to-action.html +32 -0
  24. data/_includes/nav-global-bottom.html +44 -0
  25. data/_includes/nav-global-local.html +29 -0
  26. data/_includes/nav-global-top.html +19 -0
  27. data/_includes/preconnect.html +14 -0
  28. data/_includes/scripts/custom.html +2 -0
  29. data/_includes/scripts/emergency-alerts.html +2 -0
  30. data/_includes/scripts/google-api.html +2 -0
  31. data/_includes/scripts/google-noscript.html +9 -0
  32. data/_includes/scripts/google-tag.html +23 -0
  33. data/_includes/scripts/kcc-alerts.html +2 -0
  34. data/_includes/scripts/kcc-mega-nav.html +2 -0
  35. data/_includes/scripts/kcc-nav.html +2 -0
  36. data/_includes/scripts/kcc-theme-landing.html +2 -0
  37. data/_includes/scripts/kcc-theme.html +2 -0
  38. data/_includes/scripts/table-cdn.html +6 -0
  39. data/_includes/scripts/translate.html +11 -0
  40. data/_includes/scripts/vendor-cdn.html +5 -0
  41. data/_includes/styles/fonts.html +4 -0
  42. data/_includes/styles/main.html +8 -0
  43. data/_includes/styles/vendor.html +6 -0
  44. data/_includes/svg/check.html +20 -0
  45. data/_includes/svg/check_circle-24px.html +13 -0
  46. data/_includes/svg/email-24px.html +13 -0
  47. data/_includes/svg/goals.html +22 -0
  48. data/_includes/svg/kcc-copy.html +62 -0
  49. data/_includes/svg/kcc.html +65 -0
  50. data/_includes/svg/kcc.svg +59 -0
  51. data/_includes/svg/love.html +13 -0
  52. data/_includes/svg/place-24px.html +13 -0
  53. data/_includes/svg/save-money.html +72 -0
  54. data/_includes/tabbed-content.html +27 -0
  55. data/_includes/translate.html +3 -0
  56. data/_layouts/default.html +31 -0
  57. data/_layouts/hero-banner.html +17 -0
  58. data/_layouts/hero-slider.html +17 -0
  59. data/_layouts/markdown.html +13 -0
  60. data/assets/css/content.css +1 -0
  61. data/assets/css/kcc-theme.css +1 -0
  62. data/assets/css/main.css +1 -0
  63. data/assets/css/translate.css +1 -0
  64. data/assets/img/ATEC-DSC_1033.jpeg +0 -0
  65. data/assets/img/DSC_5650_helpful.jpg +0 -0
  66. data/assets/img/admissions-navigation-menu.jpg +0 -0
  67. data/assets/img/alert.svg +1 -0
  68. data/assets/img/arrow-right.svg +1 -0
  69. data/assets/img/arrow_right_alt.svg +1 -0
  70. data/assets/img/cavaliers-16x9-thumb.png +0 -0
  71. data/assets/img/cavaliers-logo.png +0 -0
  72. data/assets/img/cavaliers-logo_white.png +0 -0
  73. data/assets/img/d-daun2.jpg +0 -0
  74. data/assets/img/dbl-next.svg +1 -0
  75. data/assets/img/dbl-next_mobile.svg +1 -0
  76. data/assets/img/dbl-prev.svg +1 -0
  77. data/assets/img/dbl-prev_mobile.svg +1 -0
  78. data/assets/img/e-tech_a-roberts_mar2016_D41_6690.jpg +0 -0
  79. data/assets/img/facebook-f_white.svg +1 -0
  80. data/assets/img/fafsa-early-bird-banner-18.jpg +0 -0
  81. data/assets/img/go_cavs_20171002_193828-web.jpg +0 -0
  82. data/assets/img/heading-bg-underline-tan.png +0 -0
  83. data/assets/img/heading-bg-underline-transparent.png +0 -0
  84. data/assets/img/heading-bg-underline.png +0 -0
  85. data/assets/img/home.svg +8 -0
  86. data/assets/img/instagram-white.svg +1 -0
  87. data/assets/img/itransfer.png +0 -0
  88. data/assets/img/kankakee-community-college-word-logo.svg +1 -0
  89. data/assets/img/kcc-logo-inverse.svg +1 -0
  90. data/assets/img/kcc-logo.svg +1 -0
  91. data/assets/img/kcc-placeholder-square.png +0 -0
  92. data/assets/img/kcc-placeholder.png +0 -0
  93. data/assets/img/kcc-text-logo.svg +1 -0
  94. data/assets/img/keyboard_arrow_right.svg +1 -0
  95. data/assets/img/linkedin-white.svg +1 -0
  96. data/assets/img/loader.gif +0 -0
  97. data/assets/img/miguel2.jpg +0 -0
  98. data/assets/img/news.svg +1 -0
  99. data/assets/img/pause.svg +1 -0
  100. data/assets/img/pause_mobile.svg +1 -0
  101. data/assets/img/pinterest-p_white.svg +1 -0
  102. data/assets/img/placeholder_16to9.jpg +0 -0
  103. data/assets/img/placeholder_4by3.jpg +0 -0
  104. data/assets/img/placeholder_square-1by1.jpg +0 -0
  105. data/assets/img/placeholder_square.jpg +0 -0
  106. data/assets/img/play.svg +1 -0
  107. data/assets/img/play_mobile.svg +1 -0
  108. data/assets/img/search.svg +1 -0
  109. data/assets/img/social-icon.svg +1 -0
  110. data/assets/img/twitter-white.svg +1 -0
  111. data/assets/img/video.svg +1 -0
  112. data/assets/img/x.svg +1 -0
  113. data/assets/img/youtube-white.svg +1 -0
  114. data/assets/img/yt-loading.png +0 -0
  115. data/assets/img/zippia.png +0 -0
  116. data/assets/js/dist/main.bundle.js +1 -0
  117. data/assets/js/theme/alerts/alerts.js +32 -0
  118. data/assets/js/theme/alerts/cacheResponse.js +23 -0
  119. data/assets/js/theme/alerts/campusAlertsSheetsAPI.js +50 -0
  120. data/assets/js/theme/alerts/checkForPrefersReducedMotion.js +19 -0
  121. data/assets/js/theme/alerts/contentHashLink.js +97 -0
  122. data/assets/js/theme/alerts/createAlertsHtml.js +47 -0
  123. data/assets/js/theme/alerts/getCachedResponse.js +41 -0
  124. data/assets/js/theme/alerts/parseMarkdownToHTML.js +85 -0
  125. data/assets/js/theme/alerts/simpleSetSheetParameters.js +23 -0
  126. data/assets/js/theme/dist/addClassToOpenNavbar.bundle.js +1 -0
  127. data/assets/js/theme/dist/alerts.bundle.js +1 -0
  128. data/assets/js/theme/dist/campusAlertsSheetsAPI.bundle.js +1 -0
  129. data/assets/js/theme/dist/checkForPrefersReducedMotion.bundle.js +1 -0
  130. data/assets/js/theme/dist/closeMegaNavOnClick.bundle.js +1 -0
  131. data/assets/js/theme/dist/footerDate.bundle.js +1 -0
  132. data/assets/js/theme/dist/getCachedResponse.bundle.js +1 -0
  133. data/assets/js/theme/dist/googleCustomSearch.bundle.js +1 -0
  134. data/assets/js/theme/dist/kcc-mega-nav.bundle.js +1 -0
  135. data/assets/js/theme/dist/kcc-theme.bundle.js +1 -0
  136. data/assets/js/theme/dist/lazyLoad.bundle.js +1 -0
  137. data/assets/js/theme/dist/sliders.bundle.js +1 -0
  138. data/assets/js/theme/dist/toggleMenuOnWindowResize.bundle.js +1 -0
  139. data/assets/js/theme/dist/translate.bundle.js +1 -0
  140. data/assets/js/theme/dist/underlineCurrentSite.bundle.js +1 -0
  141. data/assets/js/theme/dist/vendors~campusAlertsSheetsAPI~getCachedResponse.bundle.js +1 -0
  142. data/assets/js/theme/dist/walkTex.bundle.js +1 -0
  143. data/assets/js/theme/dist/wrapPowerText.bundle.js +1 -0
  144. data/assets/js/theme/nav/megaNav/closeMegaNavOnClick.js +50 -0
  145. data/assets/js/theme/nav/megaNav/googleCustomSearch.js +66 -0
  146. data/assets/js/theme/nav/megaNav/megaNav.js +26 -0
  147. data/assets/js/theme/nav/megaNav/searchToggleMegaNav.js +87 -0
  148. data/assets/js/theme/nav/megaNav/toggleDropdownOnWindowResizeTwo.js +54 -0
  149. data/assets/js/theme/nav/megaNav/toggleMenuOnWindowResize.js +26 -0
  150. data/assets/js/theme/nav/megaNav/underlineCurrentSite.js +22 -0
  151. data/assets/js/theme/src/addClassToOpenNavbar.js +20 -0
  152. data/assets/js/theme/src/all.js +55 -0
  153. data/assets/js/theme/src/footerDate.js +7 -0
  154. data/assets/js/theme/src/lazyLoad.js +13 -0
  155. data/assets/js/theme/src/sliders.js +75 -0
  156. data/assets/js/theme/src/test.js +7 -0
  157. data/assets/js/theme/src/translate.js +58 -0
  158. data/assets/js/theme/src/walkText.js +27 -0
  159. data/assets/js/theme/src/wrapPowerText.js +21 -0
  160. data/assets/js/theme/src/ytEmbed.js +30 -0
  161. data/assets/scss/0-tools/_bootstrap-overrides.scss +36 -0
  162. data/assets/scss/0-tools/_cloudcannon.scss +16 -0
  163. data/assets/scss/0-tools/_google-translate-overrides.scss +114 -0
  164. data/assets/scss/0-tools/_gsc-overrides.scss +79 -0
  165. data/assets/scss/0-tools/_vars.scss +72 -0
  166. data/assets/scss/1-base/_background.scss +5 -0
  167. data/assets/scss/1-base/_buttons.scss +82 -0
  168. data/assets/scss/1-base/_header-global.scss +477 -0
  169. data/assets/scss/1-base/_html.scss +4 -0
  170. data/assets/scss/1-base/_img.scss +13 -0
  171. data/assets/scss/1-base/_links.scss +45 -0
  172. data/assets/scss/1-base/_svg.scss +57 -0
  173. data/assets/scss/1-base/_typography.scss +304 -0
  174. data/assets/scss/2-modules/_accordion.scss +43 -0
  175. data/assets/scss/2-modules/_benefits.scss +251 -0
  176. data/assets/scss/2-modules/_breadcrumbs.scss +32 -0
  177. data/assets/scss/2-modules/_card-section.scss +9 -0
  178. data/assets/scss/2-modules/_contacts.scss +46 -0
  179. data/assets/scss/2-modules/_footer.scss +83 -0
  180. data/assets/scss/2-modules/_hero-slider.scss +330 -0
  181. data/assets/scss/2-modules/_yt-embed.scss +14 -0
  182. data/assets/scss/3-layout/_background.scss +3 -0
  183. data/assets/scss/3-layout/_content.scss +37 -0
  184. data/assets/scss/3-layout/_margins.scss +3 -0
  185. data/assets/scss/3-layout/_positioning.scss +136 -0
  186. data/assets/scss/3-layout/_section.scss +22 -0
  187. data/assets/scss/4-pages/index/_home.scss +15 -0
  188. data/assets/scss/kcc-theme.scss +37 -0
  189. data/assets/scss/translate.scss +5 -0
  190. metadata +273 -0
Binary file
@@ -0,0 +1 @@
1
+ <svg enable-background="new 0 0 416.394 28.682" height="28.682" viewBox="0 0 416.394 28.682" width="416.394" xmlns="http://www.w3.org/2000/svg"><g fill="#0f3b63"><path d="m6.913 9.049h1.943l9.136-8.875h5.133l-11.072 10.615 7.348 11.135h-5.278l-6.025-9.309h-1.943l-1.979 9.309h-4.176l4.623-21.75h4.176z"/><path d="m30.973 20.01h-.087c-1.157 2.031-3.402 2.088-5.171 2.088-3.451 0-5.53-.725-4.655-4.842.777-3.654 2.907-4.67 6.676-4.67 1.856 0 3.677.029 4.184 1.74h.116l.419-1.973c.524-2.465.506-3.334-2.54-3.334-1.595 0-2.901.145-3.321 2.117h-3.654c.943-4.438 4.025-4.611 7.505-4.611 4.872 0 6.742.754 5.657 5.857l-2.028 9.541h-3.654zm-6.259-2.754c-.457 2.145.371 2.348 2.835 2.348 1.943 0 3.401-.174 3.863-2.348.45-2.117-1.104-2.176-2.902-2.176-1.855 0-3.334 0-3.796 2.176z"/><path d="m44.589 6.699-.486 2.291h.116c1.286-2.232 3.163-2.465 5.309-2.465 4.002 0 4.869 1.652 4.08 5.365l-2.133 10.033h-3.655l2.053-9.656c.468-2.205.136-2.959-2.213-2.959-3.19 0-3.945 1.508-4.525 4.234l-1.781 8.381h-3.654l3.236-15.225h3.653z"/><path d="m60.645 12.615h.899l5.52-5.916h4.118l-6.916 7.164 4.782 8.061h-4.408l-3.626-6.815h-.899l-1.449 6.815h-3.654l4.623-21.75h3.654z"/><path d="m81.026 20.01h-.087c-1.157 2.031-3.402 2.088-5.171 2.088-3.451 0-5.53-.725-4.655-4.842.777-3.654 2.907-4.67 6.677-4.67 1.856 0 3.677.029 4.183 1.74h.116l.419-1.973c.524-2.465.506-3.334-2.54-3.334-1.595 0-2.901.145-3.321 2.117h-3.654c.943-4.438 4.025-4.611 7.505-4.611 4.872 0 6.742.754 5.657 5.857l-2.028 9.541h-3.654zm-6.258-2.754c-.457 2.145.371 2.348 2.835 2.348 1.943 0 3.401-.174 3.863-2.348.45-2.117-1.104-2.176-2.902-2.176-1.856 0-3.335 0-3.796 2.176z"/><path d="m93.356 12.615h.899l5.521-5.916h4.118l-6.917 7.164 4.782 8.061h-4.407l-3.627-6.815h-.899l-1.449 6.815h-3.653l4.623-21.75h3.653z"/><path d="m117.955 17.082c-1.018 4.785-3.821 5.016-8.171 5.016-5.829 0-6.623-1.855-5.372-7.742 1.159-5.451 2.535-7.83 8.683-7.83 6.263 0 6.716 1.826 5.304 8.469h-10.469c-.697 3.275-.832 4.32 2.445 4.32 2.03 0 3.445.029 3.926-2.232h3.654zm-2.717-4.408c.666-3.133.251-3.365-2.736-3.365-3.161 0-3.506.668-4.079 3.365z"/><path d="m134.484 17.082c-1.017 4.785-3.82 5.016-8.171 5.016-5.829 0-6.623-1.855-5.372-7.742 1.159-5.451 2.535-7.83 8.683-7.83 6.264 0 6.716 1.826 5.305 8.469h-10.469c-.696 3.275-.831 4.32 2.445 4.32 2.03 0 3.444.029 3.926-2.232h3.653zm-2.716-4.408c.666-3.133.252-3.365-2.735-3.365-3.161 0-3.506.668-4.079 3.365z"/><path d="m162.747 7.453.253-1.189c.536-2.521-.412-2.695-4.066-2.695-4.205 0-5.078.695-5.984 4.959l-1.023 4.812c-.896 4.35-.553 5.191 3.826 5.191 3.365 0 4.897-.115 5.557-3.219l.253-1.189h4.176l-.302 1.422c-1.307 6.553-4.998 6.322-10.441 6.553-7.717.291-8.544-2.232-7.281-8.584l1.061-4.986c1.477-6.962 4.507-8.528 10.915-8.528 5.423 0 8.52.029 7.484 6.264l-.252 1.189z"/><path d="m182.254 14.326c-1.252 5.887-2.465 7.771-8.815 7.771s-6.763-1.885-5.511-7.771c1.258-5.916 2.471-7.801 8.82-7.801 6.352 0 6.763 1.885 5.506 7.801zm-10.679.029c-.862 4.061-.793 4.959 2.455 4.959s3.7-.898 4.563-4.959c.875-4.117.811-5.047-2.438-5.047-3.246.001-3.704.93-4.58 5.047z"/><path d="m190.516 6.699-.469 2.205h.115c1.226-1.943 3.377-2.379 5.291-2.379s4.014.492 3.951 2.697h.115c1.146-2.117 3.357-2.697 5.389-2.697 3.943 0 4.959 1.363 4.164 5.104l-2.189 10.295h-3.654l2.115-9.947c.32-1.914.016-2.668-1.984-2.668-2.959 0-3.822 1.334-4.396 4.031l-1.824 8.584h-3.654l2.115-9.947c.319-1.914.016-2.668-1.985-2.668-2.958 0-3.821 1.334-4.395 4.031l-1.825 8.584h-3.653l3.235-15.225z"/><path d="m217.312 6.699-.469 2.205h.115c1.225-1.943 3.377-2.379 5.291-2.379s4.012.492 3.951 2.697h.115c1.146-2.117 3.357-2.697 5.387-2.697 3.943 0 4.959 1.363 4.164 5.104l-2.188 10.295h-3.654l2.113-9.947c.32-1.914.018-2.668-1.984-2.668-2.957 0-3.82 1.334-4.395 4.031l-1.824 8.584h-3.654l2.115-9.947c.318-1.914.016-2.668-1.986-2.668-2.957 0-3.82 1.334-4.395 4.031l-1.824 8.584h-3.654l3.236-15.225z"/><path d="m247.338 21.924.5-2.348h-.117c-1.271 2.029-3.262 2.521-5.35 2.521-3.045 0-4.854-1.043-4.174-4.379l2.344-11.02h3.654l-2.041 9.6c-.463 2.174-.438 3.016 1.91 3.016 2.814 0 3.965-1.189 4.525-3.828l1.869-8.787h3.654l-3.236 15.225z"/><path d="m261.391 6.699-.486 2.291h.115c1.287-2.232 3.164-2.465 5.309-2.465 4.002 0 4.869 1.652 4.08 5.365l-2.133 10.033h-3.654l2.053-9.656c.469-2.205.137-2.959-2.213-2.959-3.189 0-3.945 1.508-4.525 4.234l-1.781 8.381h-3.656l3.236-15.225h3.655z"/><path d="m275.293 21.924h-3.654l3.236-15.225h3.654zm3.965-18.647h-3.654l.658-3.104h3.654z"/><path d="m280.066 6.699h1.914l.732-3.451h3.654l-.732 3.451h5.828l-.592 2.783h-5.828l-1.658 7.803c-.268 1.391-.402 2.029 1.135 2.029 2.059 0 2.172-1.625 2.51-3.219h3.221c-.924 4.611-2.379 6.002-6.322 6.002-4.002 0-5.023-.928-4.203-4.785l1.664-7.83h-1.914z"/><path d="m299.35 22.533c-1.574 3.451-2.844 6.148-7.107 6.148-.521 0-1.025-.088-1.541-.117l.586-2.754c.256.029.504.086.766.086 2.291 0 3.107-2.203 3.801-3.973h-1.768l-1.781-15.225h3.77l1.102 12.963h.059l5.713-12.963h3.713z"/><path d="m331.379 7.453.254-1.189c.535-2.521-.414-2.695-4.066-2.695-4.205 0-5.078.695-5.984 4.959l-1.023 4.812c-.896 4.35-.553 5.191 3.826 5.191 3.363 0 4.896-.115 5.557-3.219l.252-1.189h4.176l-.301 1.422c-1.307 6.553-4.998 6.322-10.441 6.553-7.717.291-8.545-2.232-7.281-8.584l1.061-4.986c1.476-6.962 4.505-8.528 10.915-8.528 5.422 0 8.52.029 7.484 6.264l-.254 1.189z"/><path d="m350.887 14.326c-1.252 5.887-2.465 7.771-8.814 7.771-6.352 0-6.764-1.885-5.512-7.771 1.258-5.916 2.471-7.801 8.82-7.801 6.351 0 6.764 1.885 5.506 7.801zm-10.678.029c-.863 4.061-.793 4.959 2.455 4.959 3.246 0 3.699-.898 4.562-4.959.875-4.117.811-5.047-2.438-5.047s-3.704.93-4.579 5.047z"/><path d="m356.027 21.924h-3.652l4.623-21.75h3.652z"/><path d="m363.336 21.924h-3.654l4.623-21.75h3.654z"/><path d="m381.533 17.082c-1.018 4.785-3.822 5.016-8.172 5.016-5.828 0-6.623-1.855-5.371-7.742 1.158-5.451 2.533-7.83 8.682-7.83 6.264 0 6.717 1.826 5.305 8.469h-10.469c-.697 3.275-.832 4.32 2.445 4.32 2.029 0 3.445.029 3.926-2.232h3.654zm-2.717-4.408c.666-3.133.25-3.365-2.736-3.365-3.162 0-3.506.668-4.08 3.365z"/><path d="m394.045 19.75h-.086c-1.383 2-3.4 2.348-5.256 2.348-5.221 0-5.219-2.871-4.27-7.336.992-4.67 1.924-8.236 7.58-8.236 2.145 0 3.729.465 4.23 2.465h.117l.342-2.291h3.654l-3.23 15.195c-1.166 5.482-3.182 6.787-8.75 6.787-3.713 0-6.361-.639-5.16-5.191h3.422c-.445 2.088.271 2.406 2.33 2.406 3.104 0 3.904-.637 4.459-3.248zm-5.766-5.887c-.734 3.449-1.16 5.451 2.088 5.451 3.654 0 4.043-1.826 4.812-5.451.691-3.248.475-4.555-2.686-4.555-2.522.001-3.401.727-4.214 4.555z"/><path d="m415.289 17.082c-1.018 4.785-3.822 5.016-8.172 5.016-5.828 0-6.623-1.855-5.371-7.742 1.158-5.451 2.533-7.83 8.682-7.83 6.264 0 6.717 1.826 5.305 8.469h-10.469c-.697 3.275-.832 4.32 2.445 4.32 2.029 0 3.445.029 3.926-2.232h3.654zm-2.717-4.408c.666-3.133.25-3.365-2.736-3.365-3.162 0-3.506.668-4.08 3.365z"/></g></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0V0z" fill="none"/><path fill="#666" d="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"/></svg>
@@ -0,0 +1 @@
1
+ <svg enable-background="new 0 0 512 512" height="512" viewBox="0 0 512 512" width="512" xmlns="http://www.w3.org/2000/svg"><g fill="#fff"><path d="m142.394 216.601h48.7v156.684h-48.7zm24.361-77.885c15.567 0 28.219 12.651 28.219 28.226 0 15.588-12.651 28.24-28.219 28.24-15.608 0-28.242-12.652-28.242-28.24 0-15.574 12.633-28.226 28.242-28.226"/><path d="m221.638 216.601h46.707v21.408h.65c6.502-12.316 22.385-25.305 46.076-25.305 49.314 0 58.416 32.454 58.416 74.639v85.941h-48.664v-76.199c0-18.168-.334-41.54-25.302-41.54-25.339 0-29.23 19.792-29.23 40.227v77.512h-48.653z"/></g></svg>
Binary file
Binary file
@@ -0,0 +1 @@
1
+ <svg enable-background="new 0 0 30 30" height="30" viewBox="0 0 30 30" width="30" xmlns="http://www.w3.org/2000/svg"><path d="m19.062 15.574v-1.149c0-.316.255-.574.574-.574h4.983c.316 0 .572.258.572.574v1.149c0 .317-.256.575-.572.575h-4.983c-.32 0-.574-.257-.574-.575zm0-4.445v-1.15c0-.317.255-.574.574-.574h4.983c.316 0 .572.257.572.574v1.149c0 .317-.256.577-.572.577h-4.983c-.32.001-.574-.259-.574-.576zm0 8.891v-1.148c0-.319.255-.577.574-.577h4.983c.316 0 .572.258.572.577v1.148c0 .316-.256.575-.572.575h-4.983c-.32 0-.574-.259-.574-.575zm-9.196 0v-1.148c0-.319.256-.577.574-.577h6.513c.318 0 .573.258.573.577v1.148c0 .316-.255.575-.573.575h-6.513c-.317 0-.574-.259-.574-.575zm1.915-8.7h3.833v2.913h-3.833zm-1.341 4.829h6.513c.318 0 .573-.258.573-.575v-5.595c0-.317-.255-.574-.573-.574h-6.513c-.318 0-.574.257-.574.574v5.595c0 .318.257.575.574.575zm17.05 6.744h-19.951c.017-.126.028-.252.028-.383v-15.403h19.923zm-24.982-.383v-13.871h2.76v13.871c-.015.706-2.166.383-2.377.383-.212 0-.383-.171-.383-.383zm26.133-17.701h-21.074c-.999 0-1.851.639-2.167 1.531h-4.04c-.635 0-1.149.516-1.149 1.15v15.02c0 1.483 1.2 2.682 2.681 2.682h25.75c.634 0 1.149-.514 1.149-1.148v-18.087c-.001-.635-.517-1.148-1.15-1.148z" fill="#c61f48"/></svg>
@@ -0,0 +1 @@
1
+ <svg enable-background="new 0 0 40 40" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"><ellipse cx="20" cy="20" fill="#231f20" opacity=".75" rx="19.56" ry="19.54"/><g fill="#fff"><path d="m26.14 30.11h-3.21c-.34 0-.61-.27-.61-.61v-19c0-.34.27-.61.61-.61h3.21c.34 0 .61.27.61.61v19c0 .34-.27.61-.61.61z"/><path d="m17.07 30.11h-3.21c-.34 0-.61-.27-.61-.61v-19c0-.34.27-.61.61-.61h3.21c.34 0 .61.27.61.61v19c0 .34-.28.61-.61.61z"/></g></svg>
@@ -0,0 +1 @@
1
+ <svg enable-background="new 0 0 25 25" viewBox="0 0 25 25" xmlns="http://www.w3.org/2000/svg"><ellipse cx="12.5" cy="12.5" fill="#231f20" opacity=".75" rx="12.06" ry="12.05"/><g fill="#fff"><path d="m16.06 18.74h-1.51c-.34 0-.61-.27-.61-.61v-11.26c0-.34.27-.61.61-.61h1.51c.34 0 .61.27.61.61v11.25c0 .34-.28.62-.61.62z"/><path d="m10.46 18.74h-1.52c-.34 0-.61-.27-.61-.61v-11.26c0-.34.27-.61.61-.61h1.51c.34 0 .61.27.61.61v11.25c.01.34-.27.62-.6.62z"/></g></svg>
@@ -0,0 +1 @@
1
+ <svg enable-background="new 0 0 512 512" height="512" viewBox="0 0 512 512" width="512" xmlns="http://www.w3.org/2000/svg"><path d="m256.005 105.086c-83.343 0-150.915 67.566-150.915 150.912 0 61.795 37.159 114.882 90.332 138.223-.425-10.538-.076-23.188 2.627-34.653 2.901-12.252 19.418-82.231 19.418-82.231s-4.821-9.636-4.821-23.878c0-22.363 12.962-39.066 29.104-39.066 13.727 0 20.357 10.311 20.357 22.656 0 13.8-8.8 34.439-13.326 53.557-3.781 16.008 8.026 29.065 23.819 29.065 28.593 0 47.85-36.724 47.85-80.234 0-33.075-22.276-57.832-62.794-57.832-45.778 0-74.297 34.139-74.297 72.271 0 13.147 3.877 22.42 9.949 29.599 2.791 3.298 3.18 4.625 2.168 8.411-.723 2.777-2.386 9.462-3.074 12.111-1.005 3.821-4.102 5.188-7.556 3.776-21.085-8.607-30.905-31.698-30.905-57.654 0-42.869 36.155-94.272 107.856-94.272 57.617 0 95.537 41.693 95.537 86.449 0 59.2-32.912 103.428-81.427 103.428-16.293 0-31.618-8.808-36.868-18.811 0 0-8.761 34.771-10.617 41.484-3.198 11.636-9.462 23.264-15.188 32.328 13.573 4.007 27.91 6.188 42.771 6.188 83.336 0 150.904-67.565 150.904-150.915 0-83.346-67.568-150.912-150.904-150.912z" fill="#fff"/></svg>
Binary file
Binary file
Binary file
@@ -0,0 +1 @@
1
+ <svg enable-background="new 0 0 40 40" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"><ellipse cx="20" cy="20" fill="#231f20" opacity=".75" rx="19.56" ry="19.54"/><path d="m33.63 19.46-20.02-11.12c-.41-.22-.91.07-.91.54v22.24c0 .47.5.76.91.54l20.02-11.12c.42-.24.42-.84 0-1.08z" fill="#fff"/></svg>
@@ -0,0 +1 @@
1
+ <svg enable-background="new 0 0 25 25" viewBox="0 0 25 25" xmlns="http://www.w3.org/2000/svg"><ellipse cx="12.5" cy="12.5" fill="#231f20" opacity=".75" rx="12.06" ry="12.05"/><path d="m20.54 11.96-11.63-6.45c-.41-.23-.91.06-.91.53v12.92c0 .47.5.76.91.54l11.63-6.46c.42-.24.42-.84 0-1.08z" fill="#fff"/></svg>
@@ -0,0 +1 @@
1
+ <svg enable-background="new 0 0 128 128" height="128" viewBox="0 0 128 128" width="128" xmlns="http://www.w3.org/2000/svg"><path d="m125.393 115.948c0 2.557-.936 4.771-2.805 6.641-1.87 1.868-4.082 2.804-6.639 2.804-2.657 0-4.871-.936-6.643-2.804l-25.31-25.235c-8.807 6.101-18.62 9.15-29.441 9.15-7.035 0-13.762-1.365-20.182-4.096-6.419-2.732-11.953-6.422-16.602-11.068-4.648-4.65-8.338-10.184-11.068-16.604-2.731-6.42-4.096-13.146-4.096-20.182 0-7.034 1.365-13.761 4.096-20.181 2.73-6.419 6.419-11.954 11.068-16.602 4.649-4.649 10.183-8.338 16.602-11.069 6.42-2.73 13.147-4.095 20.182-4.095 7.034 0 13.761 1.365 20.181 4.095s11.953 6.42 16.603 11.069c4.647 4.648 8.338 10.183 11.069 16.602 2.729 6.42 4.095 13.147 4.095 20.181 0 10.822-3.051 20.637-9.149 29.442l25.312 25.311c1.816 1.818 2.727 4.033 2.727 6.641zm-47.484-38.038c6.468-6.469 9.704-14.254 9.704-23.355 0-9.1-3.236-16.885-9.704-23.354-6.47-6.469-14.253-9.704-23.354-9.704-9.102 0-16.886 3.235-23.355 9.704s-9.703 14.253-9.703 23.354c0 9.102 3.234 16.888 9.703 23.355 6.469 6.468 14.253 9.701 23.355 9.701 9.101 0 16.884-3.233 23.354-9.701z" fill="#fff"/></svg>
@@ -0,0 +1 @@
1
+ <svg enable-background="new 0 0 30 30" height="30" viewBox="0 0 30 30" width="30" xmlns="http://www.w3.org/2000/svg"><path d="m25.085 3.863c0-.654-.562-1.181-1.252-1.181h-22.42c-.69 0-1.25.526-1.25 1.181v16.426c0 .654.561 1.184 1.25 1.184h1.251v-16.431h22.421zm.509 19.212h-16.039v-3.75l4.868-4.867c.139-.137.366-.137.505 0l2.745 2.745c.14.138.365.138.504 0l2.046-2.046c.139-.136.365-.139.504 0l4.868 4.866v3.052zm1.009-12.9c.558 0 1.008.45 1.008 1.007v12.902c0 .556-.45 1.008-1.008 1.008h-18.057c-.558 0-1.008-.452-1.008-1.008v-12.902c0-.557.45-1.007 1.008-1.007zm0-2.227h-18.057c-1.784 0-3.236 1.45-3.236 3.233v12.902c0 1.782 1.452 3.233 3.236 3.233h18.056c1.783 0 3.235-1.451 3.235-3.233v-12.901c.001-1.784-1.451-3.234-3.234-3.234z" fill="#c61f48"/></svg>
@@ -0,0 +1 @@
1
+ <svg enable-background="new 0 0 512 512" height="512" viewBox="0 0 512 512" width="512" xmlns="http://www.w3.org/2000/svg"><path d="m393.859 170.531c-10.142 4.498-21.039 7.539-32.479 8.905 11.677-6.998 20.642-18.081 24.865-31.286-10.925 6.48-23.028 11.187-35.91 13.723-10.315-10.991-25.015-17.858-41.278-17.858-31.234 0-56.554 25.32-56.554 56.55 0 4.433.501 8.749 1.465 12.888-47-2.358-88.67-24.873-116.562-59.087-4.868 8.354-7.656 18.067-7.656 28.432 0 19.618 9.984 36.929 25.158 47.069-9.271-.293-17.99-2.837-25.615-7.073-.004.236-.005.473-.005.712 0 27.399 19.493 50.256 45.364 55.451-4.746 1.292-9.742 1.982-14.899 1.982-3.645 0-7.187-.354-10.64-1.014 7.196 22.467 28.081 38.816 52.827 39.274-19.354 15.166-43.738 24.208-70.233 24.208-4.564 0-9.066-.269-13.489-.79 25.026 16.045 54.751 25.406 86.688 25.406 104.021 0 160.9-86.171 160.9-160.901 0-2.452-.054-4.891-.163-7.315 11.046-7.974 20.635-17.934 28.216-29.276z" fill="#fff"/></svg>
@@ -0,0 +1 @@
1
+ <svg enable-background="new 0 0 32 21.52" height="21.52" viewBox="0 0 32 21.52" width="32" xmlns="http://www.w3.org/2000/svg"><path d="m29.046 18.585h-.659l-7.169-7.167v-1.317l7.169-7.169h.659zm-10.439 0h-15.652v-15.653h15.653v15.653zm10.439-18.261h-.659c-.72 0-1.336.255-1.846.765l-5.323 5.323v-3.48c0-1.44-1.168-2.607-2.61-2.607h-15.653c-1.44 0-2.608 1.167-2.608 2.607v15.653c0 1.444 1.167 2.61 2.608 2.61h15.653c1.442 0 2.61-1.166 2.61-2.61v-3.479l5.323 5.325c.51.509 1.126.764 1.846.764h.659c1.439 0 2.607-1.166 2.607-2.61v-15.653c0-1.441-1.168-2.608-2.607-2.608z" fill="#c61f48"/></svg>
data/assets/img/x.svg ADDED
@@ -0,0 +1 @@
1
+ <svg enable-background="new 0 0 128 128" height="128" viewBox="0 0 128 128" width="128" xmlns="http://www.w3.org/2000/svg"><path d="m114.572 98.99-34.99-34.99 34.99-34.991c4.304-4.303 4.304-11.279.001-15.582s-11.279-4.303-15.583 0l-34.99 34.991-34.992-34.991c-4.303-4.303-11.278-4.303-15.581 0s-4.303 11.278 0 15.581l34.991 34.992-34.992 34.99c-4.303 4.304-4.302 11.28.001 15.583s11.278 4.303 15.581 0l34.992-34.991 34.99 34.99c4.304 4.304 11.28 4.304 15.583.001s4.303-11.279-.001-15.583z" fill="#fff"/></svg>
@@ -0,0 +1 @@
1
+ <svg enable-background="new 0 0 512 512" height="512" viewBox="0 0 512 512" width="512" xmlns="http://www.w3.org/2000/svg"><path d="m339.306 134.92h-166.615c-91.187 0-91.187 25.977-91.187 89.865v62.432c0 60.757 12.915 89.864 91.187 89.864h166.614c70.7 0 91.19-17.012 91.19-89.864v-62.432c.001-67.248-3.442-89.865-91.189-89.865zm-118.959 168.537v-98.009l94.064 48.846z" fill="#fff"/></svg>
Binary file
Binary file
@@ -0,0 +1 @@
1
+ /* This is just a placeholder file to prevent 404 errors during development */
@@ -0,0 +1,32 @@
1
+ /*
2
+ // Custom JS | written by https://github.com/wdzajicek
3
+ // © 2020 Kankakee Community College
4
+ // =================================================== */
5
+ // See https://webpack.js.org/guides/code-splitting/ and https://webpack.js.org/guides/lazy-loading/ for info on
6
+ // Dynamic imports in Webpack 5
7
+ document.addEventListener('DOMContentLoaded', () => {
8
+ import(/* webpackChunkName: 'checkForPrefersReducedMotion' */'./checkForPrefersReducedMotion')
9
+ .then(({ default: checkForPrefersReducedMotion }) => { // Webpack returns the module so the default function must be specified!
10
+ checkForPrefersReducedMotion();
11
+ }).then(() => {
12
+ import(/* webpackChunkName: 'getCachedResponse' */ './getCachedResponse')
13
+ .then(({ default: getCachedResponse }) => {
14
+ return getCachedResponse;
15
+ }).then(getCachedResponse => {
16
+ import(/* webpackChunkName: 'campusAlertsSheetsAPI' */ './campusAlertsSheetsAPI')
17
+ .then(({ default: start }) => {
18
+ ! window.sessionStorage.getItem('Alert-Content') ? // Checks if our cached alert is already in sessionStorage
19
+ gapi.load('client', start) // If not, build the alert from a new Google API response
20
+ : getCachedResponse(); // Otherwise, build the alert from our cached response
21
+ });
22
+ })
23
+ }).catch(err => {
24
+ throw new Error(`ERROR!!! \n${err.message}`)
25
+ });
26
+
27
+ //checkForPrefersReducedMotion();
28
+
29
+ // ! window.sessionStorage.getItem('Alert-Content') ? // Checks if our cached alert is already in sessionStorage
30
+ // gapi.load('client', start) // If not, build the alert from a new Google API response
31
+ // : getCachedResponse(); // Otherwise, build the alert from our cached response
32
+ });
@@ -0,0 +1,23 @@
1
+ /*
2
+ // Custom JS | written by https://github.com/wdzajicek
3
+ // © 2020 Kankakee Community College
4
+ // =================================================== */
5
+ // Modules' default function stores our Google Sheet response in sessionStorage to be retrieved later
6
+ // Each key gets set to a column in our data
7
+ // Each key's value gets set to the corresponding cell in the row below
8
+ // ====================================================================
9
+ function cacheResponse(response) { // response from Google API's spreadsheet.values.get() method
10
+ const VALUES = response.result.values; // This is where the table's data is in a Sheets response in Sheets API V4
11
+ const TABLE_HEADER_ROW = VALUES[1]; // 2nd row in the sheet (first row is instructions to the user)
12
+ const TABLE_BODY_ROW = VALUES[2]; // The only row of data in our table
13
+
14
+ for (let i = 0, len = TABLE_BODY_ROW.length; i < len; i++ ) {
15
+ const cell = TABLE_BODY_ROW[i];
16
+ const column = TABLE_HEADER_ROW[i];
17
+
18
+ window.sessionStorage.setItem(column.replace(' ', '-'), cell);
19
+ }
20
+ //window.sessionStorage.clear();
21
+ }
22
+
23
+ export default cacheResponse;
@@ -0,0 +1,50 @@
1
+ /*
2
+ // Custom JS | written by https://github.com/wdzajicek
3
+ // © 2020 Kankakee Community College
4
+ // =================================================== */
5
+ // 1. Execute Google API call to grab Google Sheet data from:
6
+ // https://docs.google.com/spreadsheets/d/1plXBiZY5pVbhNT-mszxEuqCl4zy8wMnz9gXXbbT_yLs/edit#gid=0
7
+ // 2. Build & inject the alert message into the page
8
+ // 3. Run the `contentHashLink` module after alert has painted into DOM (and altered documents hight)
9
+ // 4. Cache the API response in sessionStorage
10
+ // =================================================== //
11
+ import setSheetParameters from './simpleSetSheetParameters.js';
12
+ import createAlertsHtml from './createAlertsHtml.js';
13
+ import contentHashLink from './contentHashLink.js';
14
+ import cacheResponse from './cacheResponse.js';
15
+
16
+ const SHEET_KEY = '1plXBiZY5pVbhNT-mszxEuqCl4zy8wMnz9gXXbbT_yLs'; // Corresponds to the ID of the Google Sheet
17
+ const SHEET_TAB = 'Alerts'; // Corresponds to the tab of workbook: either 'Alerts' or 'Alerts Testing' unless you make a new one.
18
+ const EMERGENCY_ALERT_DIV_ID = 'emergencyAlerts'
19
+ const SHEET_PARAMS = setSheetParameters(SHEET_KEY, SHEET_TAB); // Configures the Object used for `sheets.spreadsheets.values.get()` parameters
20
+ const API_PARAMS = { // This is configuration for API call with spreadsheets that are setup as readonly
21
+ 'apiKey': 'AIzaSyCEBsbXfFcdbkASlg-PodD1rT_Fe3Nw62A',
22
+ 'discoveryDocs': ['https://www.googleapis.com/discovery/v1/apis/sheets/v4/rest']
23
+ };
24
+
25
+ function init() {
26
+ gapi.client.init(API_PARAMS).then(() => { // Executes an API request, and returns a Promise.
27
+ return gapi.client.sheets.spreadsheets.values.get(SHEET_PARAMS)
28
+ }).then((response) => {
29
+ createAlertsHtml(response); // Build the html & inject it into the DOM
30
+ return response;
31
+ }).then((response) => {
32
+ cacheResponse(response); // Cache the Google API response for subsequent page loads in the site
33
+ }, (err)=> {
34
+ console.error("Execute error", err);
35
+ contentHashLink();
36
+ });
37
+ }
38
+
39
+ function start() {
40
+ if ( ! document.getElementById(EMERGENCY_ALERT_DIV_ID) )
41
+ return contentHashLink();
42
+
43
+ init();
44
+ //var t1 = performance.now();
45
+ //console.info("Call to 'init' took " + (t1 - t0) + " milliseconds.");
46
+ }
47
+ // Loads the JavaScript client library and invokes `start` afterwards.
48
+ // Usage:
49
+ // gapi.load('client', start);
50
+ export default start;
@@ -0,0 +1,19 @@
1
+ function checkForPrefersReduceMotion() {
2
+ const reducedMotionMediaQuery = window.matchMedia('(prefers-reduced-motion: reduce)');
3
+ const userAgent = window.navigator.userAgent;
4
+ const msExplorer = (userAgent.search(/MSIE/g) !== -1)
5
+ let reducedMotion;
6
+
7
+ reducedMotionMediaQuery.matches ? reducedMotion = true : reducedMotion = false;
8
+ localStorage.setItem('userPrefersReducedMotion', reducedMotion);
9
+
10
+ if (msExplorer) // Bail out at this point if user is in IE
11
+ return; // IE does NOT support `mediaQueryList.onchange`
12
+
13
+ reducedMotionMediaQuery.addEventListener('change', (e) => {
14
+ reducedMotionMediaQuery.matches ? reducedMotion = true : reducedMotion = false;
15
+ localStorage.setItem('userPrefersReducedMotion', reducedMotion);
16
+ });
17
+ }
18
+
19
+ export default checkForPrefersReduceMotion;
@@ -0,0 +1,97 @@
1
+ // Custom JS to do cool stuff with BS accordions and tabs by manipulating URL hashes and query's
2
+ // EXAMPLE:
3
+ // https://<ORIGIN>/?id=course-withdrawals#tuition-payment-and-deadlines
4
+ // The above URL will:
5
+ // 1. Open the #tuition-payment-and-deadlines accordion if it exists
6
+ // 2. The ?id=course-withdrawals query will:
7
+ // - look inside the opened accordion for an element with the id 'course-withdrawals', and
8
+ // - scroll that matching element into the user's viewport (in this case it's a heading within that accordion card)
9
+ //
10
+ // This JS will allow us to link to a specific area of content in a page where a traditional hash link wouldn't work
11
+ // In this case hash links won't work because the element with he matching ID is "stuck" in a closed accordion or tab.
12
+ //
13
+ const idRegex = /^id=/g; // Lets just cache these reused regex's here
14
+ const queryStartRegex = /^\?/g;
15
+ const endingSlashRegex = /\/$/g;
16
+ const PREFERS_REDUCED_MOTION_LOCALSTORAGE_KEY = 'userPrefersReducedMotion'; // This localStorage key is set by module: './checkForPrefersReducedMotion.js'
17
+ const scrollIntoViewOptionsObject = {
18
+ behavior: 'smooth',
19
+ block: 'center'
20
+ }
21
+ const reducedMotionscrollIntoViewOptionsObject = {
22
+ block: 'center'
23
+ }
24
+
25
+ function focusElement(el) {
26
+ const prefersReducedMotion = window.localStorage.getItem(PREFERS_REDUCED_MOTION_LOCALSTORAGE_KEY);
27
+
28
+ prefersReducedMotion == 'true' ? el.scrollIntoView(reducedMotionscrollIntoViewOptionsObject) : el.scrollIntoView(scrollIntoViewOptionsObject);
29
+ return el.focus();
30
+ }
31
+
32
+ function processIdQuery(query, hash) {
33
+ let id = query.replace(idRegex, '');
34
+ const parentEl = document.querySelector(hash);
35
+ const heading = parentEl.querySelector(`#${id}`);
36
+
37
+ focusElement(heading);
38
+ }
39
+
40
+ function checkForQuery(query, hash) {
41
+ query.search(idRegex) !== -1 ?
42
+ processIdQuery(query, hash)
43
+ : null;
44
+ }
45
+
46
+ function findContentTarget(hash) {
47
+ const target = document.querySelector(hash);
48
+
49
+ focusElement(target);
50
+ }
51
+
52
+ function checkForMatchingTabOrAccordion(hash) {
53
+ if ( document.querySelector(`.nav-tabs a[href="${hash}"]`) ) { // Looks for a matching BS4 tab element
54
+ let tab = $(`.nav-tabs a[href="${hash}"]`); // **SIGH**, BS4 requires JQuery
55
+
56
+ tab
57
+ .on('shown.bs.tab', () => { // Bootstrap 4 method for tab events // Must be defined before the tab is activated
58
+ window.location.search ?
59
+ checkForQuery(window.location.search.replace(queryStartRegex, ''), hash)
60
+ : null; })
61
+ .tab('show'); // Bootstrap 4 Tab method
62
+ findContentTarget(`${hash}-label`); // You need to .scrollIntoView() & .focus() on the tab-label which is an <a href="...">. It won't work to do .scrollIntoView() and .focus() on the div
63
+ } else if ( document.querySelector(`${hash}.collapse`) ) { // Looks for a matching BS4 collapse element
64
+ let card = $(hash); // **SIGH**, BS4 requires JQuery
65
+
66
+ card
67
+ .on('shown.bs.collapse', () => { // Bootstrap 4 Collapse method // Must be defined before the collapse is activated
68
+ window.location.search ?
69
+ checkForQuery(window.location.search.replace(queryStartRegex, ''), hash)
70
+ : null; })
71
+ .collapse('show'); // Bootstrap 4 Collapse method
72
+ findContentTarget(hash);
73
+ }
74
+ }
75
+
76
+ function checkForHash(e) {
77
+ if (window.location.hash) {
78
+ let hash = window.location.hash.replace(endingSlashRegex, '');
79
+
80
+ checkForMatchingTabOrAccordion(hash);
81
+ }
82
+ return;
83
+ }
84
+
85
+ function initContentHashLink() {
86
+ checkForHash();
87
+ window.addEventListener('hashchange', checkForHash, false);
88
+ }
89
+
90
+ function contentHashLink() {
91
+ if (!document.querySelector('#accordion') && !document.querySelector('.nav.nav-tabs'))
92
+ return;
93
+
94
+ initContentHashLink();
95
+ }
96
+
97
+ export default contentHashLink;
@@ -0,0 +1,47 @@
1
+ /*
2
+ // Custom JS | written by https://github.com/wdzajicek
3
+ // © 2020 Kankakee Community College
4
+ // =================================================== */
5
+ // JS module to build alert message using data from Google Sheets API v4
6
+ //
7
+ // This exported module requires you pass it's default-function the `response` object from the API call, as the only argument
8
+ import contentHashLink from './contentHashLink.js';
9
+ import parseMarkdownToHTML from './parseMarkdownToHTML.js'; // Parses a simplified markdown into html & creates the paragraph el's with appropriate class
10
+ //
11
+ const CAMPUS_ALERTS_DIV_ID_STRING = 'emergencyAlerts'; // ID of the div to house campus alerts - already built into the page.
12
+ const ALERTS_VISIBLE_CLASS = 'position__offset-alert--visible';
13
+
14
+ function injectAlert(target, alert) {
15
+ target.innerHTML = alert;
16
+ return target.classList.add(ALERTS_VISIBLE_CLASS);
17
+ }
18
+
19
+ function createAlertsHtml(response) { // Incoming response from our Google Sheet via the Sheets API
20
+ // This is where the cell values hide in the response object from the Google API.
21
+
22
+ let [visibility, allPages, content, expire, start, end] = response.result.values[2]; // The 3rd row has our table's data
23
+ if (visibility === 'FALSE') return contentHashLink(); // Predefined dropdown options in the Sheet are `'TRUE'` & `'FALSE'`
24
+
25
+ const TARGET = document.getElementById(CAMPUS_ALERTS_DIV_ID_STRING); // This targets an element built into the DOM that we inject everything into.
26
+ let d = new Date;
27
+ let s = new Date(start);
28
+ let e = new Date(end);
29
+ const alertIsActive = expire === 'FALSE' || expire === 'TRUE' && s.getTime() <= d.getTime() && e.getTime() > d.getTime();
30
+ const indexPageOnly = allPages === 'TRUE' || allPages === 'FALSE' && window.location.pathname == '/';
31
+ let alert = `
32
+ <div class="container">
33
+ <div class="row">
34
+ <div class="col">
35
+ <div class="alert alert-warning">
36
+ ${parseMarkdownToHTML(content)}
37
+ </div>
38
+ </div>
39
+ </div>
40
+ </div>`;
41
+
42
+ [d,s,e].map(d => d.setHours(0, 0, 0, 0));
43
+ alertIsActive && indexPageOnly ? injectAlert(TARGET, alert) : null;
44
+ return contentHashLink();
45
+ }
46
+
47
+ export default createAlertsHtml;
@@ -0,0 +1,41 @@
1
+ /*
2
+ // Custom JS | written by https://github.com/wdzajicek
3
+ // © 2020 Kankakee Community College
4
+ // =================================================== */
5
+ // Module to retrieve our cached Google Sheet response from sessionStorage
6
+ // 1. Create an object that replicates an API response where `response.result.values`
7
+ // is an array containing an array representing each row in the sheet.
8
+ // 2. Then we pass our mock-sheet response object to the `createAlertsHtml` module to
9
+ // build and inject the alert into the DOM.
10
+ import createAlertsHtml from './createAlertsHtml.js';
11
+ import contentHashLink from './contentHashLink.js';
12
+ const cache = window.sessionStorage;
13
+
14
+ function processCachedResponse(response, callback) {
15
+ createAlertsHtml(response);
16
+ return callback();
17
+ }
18
+
19
+ function createCachedResponseObject() {
20
+ let cachedResponse = { // Reconstructing our own Google Sheet-like response from the sessionStorage items
21
+ result: {
22
+ values: [
23
+ 0, // First two rows aren't used by the `createAlertsHtml()` function
24
+ 0,
25
+ [ cache.Visible, cache.getItem('All-Pages'), cache.getItem('Alert-Content'), cache.getItem('Alert-Expiration'), cache.Start, cache.End ]
26
+ ]
27
+ }
28
+ }
29
+ processCachedResponse(cachedResponse, contentHashLink);
30
+ }
31
+
32
+ function getCachedResponse() {
33
+ try {
34
+ createCachedResponseObject();
35
+ } catch (error) {
36
+ contentHashLink();
37
+ console.error(`Error retrieving cached response in sessionStorage:\nName: ${error.name}\nMessage: ${error.message}\n${error}`);
38
+ }
39
+ }
40
+
41
+ export default getCachedResponse;
@@ -0,0 +1,85 @@
1
+ const INLINE_MARKDOWN_ELEMENTS_OBJECT = {
2
+ 'strong': /\*\*([^\*]*)\*\*/g,
3
+ 'em': /_([^_]*)_/g
4
+ }
5
+
6
+ function replaceRegex(string, regex, replacement) {
7
+ const newString = string.replace(regex, replacement);
8
+ return newString;
9
+ }
10
+
11
+ function escapeCharacters(string, escapeOption) {
12
+ const escapedCharactersObject = {
13
+ '\\*': '__asterisk__',
14
+ '\\_': '__underscore__',
15
+ '\\[': '__openBracket__',
16
+ '\\]': '__closeBracket__',
17
+ '\\(': '__openParenthesis__',
18
+ '\\)': '__closeParenthesis__'
19
+ }
20
+
21
+ for (let char in escapedCharactersObject) {
22
+ if (escapedCharactersObject.hasOwnProperty(char)) {
23
+ escapeOption === true ? string = replaceRegex(string, char, escapedCharactersObject[char])
24
+ : escapeOption === false ? string = replaceRegex(string, escapedCharactersObject[char], char.replace(/^\\/g, ''))
25
+ : null;
26
+ }
27
+ }
28
+ return string;
29
+ }
30
+
31
+ function createAnchorElements(string) {
32
+ return string = string.replace(/\[(?<linkText>[^\]]*)\]\((?<linkHref>[^\)]*)\)/g, '<a href="$<linkHref>" target="_blank" rel="noopener noreferrer">$<linkText></a>');
33
+ }
34
+
35
+ function replacer(match, p1) {
36
+ if ( p1 === '' ) { // Filters out the '__' (double underscore) matches.
37
+ return match;
38
+ } else {
39
+ for (var el in INLINE_MARKDOWN_ELEMENTS_OBJECT) {
40
+ if (INLINE_MARKDOWN_ELEMENTS_OBJECT.hasOwnProperty(el)) {
41
+ match = match.replace(INLINE_MARKDOWN_ELEMENTS_OBJECT[el], '<' + el + '>$1</' + el + '>' );
42
+ }
43
+ }
44
+ return match;
45
+ }
46
+ }
47
+
48
+ function createInlineElements(string) {
49
+ for (var el in INLINE_MARKDOWN_ELEMENTS_OBJECT) {
50
+ if (INLINE_MARKDOWN_ELEMENTS_OBJECT.hasOwnProperty(el)) {
51
+ string = string.replace(INLINE_MARKDOWN_ELEMENTS_OBJECT[el], replacer);
52
+ }
53
+ }
54
+ return string;
55
+ }
56
+
57
+ function paragraphReplacer(match, p1) {
58
+ if ( p1 === '' ) { // Filters out blank lines
59
+ return match;
60
+ } else {
61
+ return match.replace(/^(.*)$/gm, '<p class="typography__alert">$1</p>');
62
+ }
63
+ }
64
+
65
+ function createParagraphElements(string) {
66
+ return string = string.replace(/^(.*)$/gm, paragraphReplacer);
67
+ }
68
+
69
+ function parseMarkdownToHTML(string) {
70
+ const escapedString = escapeCharacters(string, true);
71
+ const stringWithInlineElements = createInlineElements(escapedString);
72
+ const stringWithAnchorElements = createAnchorElements(stringWithInlineElements);
73
+ const stringWithParagraphElements = createParagraphElements(stringWithAnchorElements);
74
+ const unescapedString = escapeCharacters(stringWithParagraphElements, false);
75
+ //console.log(unescapedString);
76
+ return unescapedString;
77
+ }
78
+
79
+ //
80
+ // USAGE:
81
+ // import parseMarkdownToHTML from './parseMarkdownToHTML.js';
82
+ //
83
+ // parseMarkdownToHTML(stringContainingSimplifiedMarkdown);
84
+
85
+ export default parseMarkdownToHTML;