{"version":3,"sources":["modal.js","subpage.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACpNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"subpage.js","sourcesContent":["jQuery(document).ready(function ($) {\r\n\r\n // global variables\r\n var modalLink = undefined;\r\n var modal;\r\n var modalURL;\r\n var modalID;\r\n var modalCopy;\r\n var modalFocus;\r\n var modalHeight;\r\n\r\n // add overlay\r\n $('body').prepend('
');\r\n\r\n // collect all modals\r\n var modals = [];\r\n $('.modal').each(function () {\r\n $(this).attr('hidden', 'hidden').attr('role', 'dialog').attr('tabindex', '-1');\r\n modals.push($(this).attr('id'));\r\n });\r\n\r\n // if url has hash for modal open that modal\r\n if (window.location.hash) {\r\n var modalHash = window.location.hash.substr(1);\r\n if (jQuery.inArray(modalHash, modals) != '-1') {\r\n modalURL = '#' + modalHash;\r\n modalID = modalHash;\r\n modalCopy = $(modalURL).clone();\r\n modalHeight = $(modalURL).attr('data-modal-height');\r\n if (typeof modalHeight !== typeof undefined && modalHeight !== false) {\r\n $(modalURL).css('height', modalHeight + 'px');\r\n }\r\n if ($(modalURL).hasClass('modal-inline')) {\r\n $('html, body').toggleClass('modal-open');\r\n $('.modal-overlay').toggleClass('show-modal modal-inline');\r\n $(modalURL).toggleClass('show-modal');\r\n $(modalURL).removeAttr('hidden').attr('aria-hidden', 'false').attr('tabindex', '0');\r\n $('.modal-content .close-modal').addClass('modal-inline').attr('tabindex', '0');\r\n $(modalURL).focus();\r\n modalFocus = $(modalURL + ' > .modal-content');\r\n focusable(modalFocus);\r\n } else {\r\n modalCopy = $(modalURL).clone();\r\n $(modalURL).replaceWith('');\r\n modal(modalURL);\r\n }\r\n }\r\n }\r\n\r\n $(document).on('click', '.open-modal', function (e) {\r\n e.preventDefault();\r\n // set variables\r\n modalLink = $(this);\r\n modalURL = $(this).attr('href');\r\n modalID = modalURL.replace(/^#/, '');\r\n modalHeight = $(modalURL).attr('data-modal-height');\r\n\r\n // open modal if it exists in modals array\r\n if (jQuery.inArray(modalID, modals) != '-1') {\r\n if (typeof modalHeight !== typeof undefined && modalHeight !== false) {\r\n $(modalURL).css('height', modalHeight + 'px');\r\n }\r\n if ($(modalURL).hasClass('modal-inline')) {\r\n $('html, body').toggleClass('modal-open');\r\n $('.modal-overlay').toggleClass('show-modal modal-inline');\r\n $(modalURL).toggleClass('show-modal');\r\n $(modalURL).removeAttr('hidden').attr('aria-hidden', 'false').attr('tabindex', '0');\r\n $('.modal-content .close-modal').addClass('modal-inline').attr('tabindex', '0');\r\n $(modalURL).focus();\r\n modalFocus = $(modalURL + ' > .modal-content');\r\n focusable(modalFocus);\r\n } else {\r\n modalCopy = $(modalURL).clone();\r\n $(modalURL).replaceWith('');\r\n modal(modalURL);\r\n }\r\n }\r\n });\r\n\r\n // modal\r\n function modal() {\r\n $('.modal-overlay').after(modalCopy);\r\n $('html, body').toggleClass('modal-open');\r\n $('.modal-overlay').toggleClass('show-modal');\r\n $(modalURL).toggleClass('show-modal');\r\n $(modalURL).removeAttr('hidden').attr('aria-hidden', 'false').attr('tabindex', '0');\r\n $('.modal-content .close-modal').attr('tabindex', '0');\r\n $(modalURL).focus();\r\n modalFocus = $(modalURL + ' > .modal-content');\r\n focusable(modalFocus);\r\n }\r\n\r\n // find focusable items\r\n function focusable() {\r\n var modalFocusable = $('span.close-modal, a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]', modalFocus);\r\n var modalFocusableFirst = modalFocusable.first();\r\n var modalFocusableLast = modalFocusable.last();\r\n modalFocusableLast.on('keydown', function (e) {\r\n if ((e.which === 9 && !e.shiftKey)) {\r\n e.preventDefault();\r\n modalFocusableFirst.focus();\r\n }\r\n });\r\n modalFocusableFirst.on('keydown', function (e) {\r\n if ((e.which === 9 && e.shiftKey)) {\r\n e.preventDefault();\r\n modalFocusableLast.focus();\r\n }\r\n });\r\n }\r\n\r\n // focus to modal content\r\n $(document).keydown(function (e) {\r\n if ($(e.target).is('.modal')) {\r\n if (e.keyCode === 9) {\r\n modalFocus = $(modalURL + ' > .modal-content');\r\n focusable(modalFocus);\r\n }\r\n }\r\n });\r\n\r\n // close when clicking overlay / outside of modal window\r\n $('.modal-overlay').click(function () {\r\n $('html, body').removeClass('modal-open');\r\n $(this).removeClass('show-modal');\r\n if (!$(this).hasClass('modal-inline')) {\r\n modalCopy.remove();\r\n $('span[data-modalid=\"' + modalID + '\"]').replaceWith(modalCopy);\r\n $(modalURL).attr('hidden', 'hidden').attr('aria-hidden', 'true').attr('tabindex', '-1');\r\n $('.modal').removeClass('show-modal');\r\n } else {\r\n $(modalURL).removeClass('show-modal');\r\n $(modalURL).attr('hidden', 'hidden').attr('aria-hidden', 'true').attr('tabindex', '-1');\r\n }\r\n if (modalLink !== undefined) {\r\n modalLink.focus();\r\n modalLink = undefined;\r\n }\r\n });\r\n\r\n // dont close modal if clicking anything but close button\r\n $('.modal-content *:not(.close-modal)').click(function (e) {\r\n e.stopPropagation();\r\n });\r\n\r\n // close modal with button\r\n $(document).on('click', '.close-modal', function () {\r\n $('html, body').removeClass('modal-open');\r\n $('.modal-overlay').removeClass('show-modal');\r\n if (!$(this).hasClass('modal-inline')) {\r\n modalCopy.remove();\r\n $('span[data-modalid=\"' + modalID + '\"]').replaceWith(modalCopy);\r\n $(modalURL).attr('hidden', 'hidden').attr('aria-hidden', 'true').attr('tabindex', '-1');\r\n $('.modal').removeClass('show-modal');\r\n } else {\r\n $(modalURL).removeClass('show-modal');\r\n $(modalURL).attr('hidden', 'hidden').attr('aria-hidden', 'true').attr('tabindex', '-1');\r\n\r\n }\r\n if (modalLink != undefined) {\r\n modalLink.focus();\r\n modalLink = undefined;\r\n }\r\n });\r\n\r\n // close modal if close is focused and enter key pressed\r\n // focus to modal content\r\n $(document).keydown(function (e) {\r\n if ($(e.target).is('.close-modal')) {\r\n if (e.keyCode === 13) {\r\n $('html, body').removeClass('modal-open');\r\n $('.modal-overlay').removeClass('show-modal');\r\n if (!$('.modal-overlay').hasClass('modal-inline')) {\r\n modalCopy.remove();\r\n $('span[data-modalid=\"' + modalID + '\"]').replaceWith(modalCopy);\r\n $(modalURL).attr('hidden', 'hidden').attr('aria-hidden', 'true').attr('tabindex', '-1');\r\n $('.modal').removeClass('show-modal');\r\n } else {\r\n $(modalURL).removeClass('show-modal');\r\n $(modalURL).attr('hidden', 'hidden').attr('aria-hidden', 'true').attr('tabindex', '-1');\r\n }\r\n if (modalLink !== undefined) {\r\n modalLink.focus();\r\n modalLink = undefined;\r\n }\r\n }\r\n }\r\n });\r\n\r\n // close modal with escape key\r\n $(document).on('keyup', function (e) {\r\n if (e.keyCode === 27) {\r\n e.preventDefault();\r\n if ($('body').hasClass('modal-open')) {\r\n $('html, body').removeClass('modal-open');\r\n $('.modal-overlay').removeClass('show-modal');\r\n if (!$('.modal-overlay').hasClass('modal-inline')) {\r\n modalCopy.remove();\r\n $('span[data-modalid=\"' + modalID + '\"]').replaceWith(modalCopy);\r\n $(modalURL).attr('hidden', 'hidden').attr('aria-hidden', 'true').attr('tabindex', '-1');\r\n $('.modal').removeClass('show-modal');\r\n } else {\r\n $(modalURL).removeClass('show-modal');\r\n $(modalURL).attr('hidden', 'hidden').attr('aria-hidden', 'true').attr('tabindex', '-1');\r\n }\r\n if (modalLink !== undefined) {\r\n modalLink.focus();\r\n modalLink = undefined;\r\n }\r\n }\r\n }\r\n });\r\n});","jQuery(document).ready(function ($) {\r\n // image alt\r\n $('img').each(function () {\r\n var img = $(this);\r\n var src = $(this).attr('src');\r\n var alt = $(this).attr('alt');\r\n var filename = src.split('/').reverse()[0].replace(/\\..+$/, '');\r\n if (img.parent('a').length !== 0) {\r\n console.log('parent is a link');\r\n if (alt === '' || alt === undefined) {\r\n img.attr('alt', 'image ' + filename);\r\n }\r\n } else {\r\n if (alt === '' || alt === undefined) {\r\n img.attr('alt', '');\r\n }\r\n }\r\n });\r\n\r\n // breadcrumbs\r\n $('ul.breadcrumb').prepend('