/******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = "/"; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 0); /******/ }) /************************************************************************/ /******/ ({ /***/ "./resources/js/app.js": /*!*****************************!*\ !*** ./resources/js/app.js ***! \*****************************/ /*! no static exports found */ /***/ (function(module, exports) { // Store last key pressed to assist with accessibility JS functions var lastKeyPressed; defer(initializeMobyMenu); // Keydown listener for accessibility improvements document.onkeydown = function (e) { var activeElement = $(document.activeElement); var elementType; lastKeyPressed = e.keyCode; if (activeElement.hasClass('title') && activeElement.parent('.ui.accordion').length) { elementType = '_ACCORDION'; } if (e.keyCode === 13 || e.keyCode === 32) { // The Enter/Return OR Spacebar key activeElement.click(); } if (elementType = '_ACCORDION') { if (e.keyCode === 38) { // The Arrow Up Key // Accessible Accordion - Prev Accordion Title e.preventDefault(); var prevTitle = activeElement.prevAll('div.title:first'); if (prevTitle.length) { prevTitle.focus(); } } if (e.keyCode === 40) { // The Arrow Down Key // Accessible Accordion - Next Accordion Title e.preventDefault(); var nextTitle = activeElement.nextAll('div.title:first'); if (nextTitle.length) { nextTitle.focus(); } } } if (e.keyCode === 9) { // The Tab Key // Accessible Accordion - Allow Outlines handleTabPress(); } }; document.onkeydown = function (e) { if (e.keyCode === 13) { // The Enter/Return key document.activeElement.click(); } }; window.addEventListener('load', function (event) { $('#mainNav li').bind('touchend', function (event) { $("#mainNav li'").each(function () { $(this).removeClass('was-touched'); }); }); $('#mainNav li').bind('touchend', function (event) { $(this).toggleClass('was-touched'); }); // Initialize all non-nested accordions $('.ui.accordion:not(.nested)').accordion({ exclusive: false, onOpening: function onOpening() { // Search for a public-folder node nested in the accordion var publicFolder = $(this).children('.public-folder'); // If matching node is found, make AJAX request to list the directories' contents if (publicFolder.length & publicFolder.contents().length === 0) { var path = publicFolder.attr('data-folder-path'); if (path) { requestDirectory(publicFolder, path); } } } }); // Search input "fake" submission. Redirects to the /search // route passing in the query as a parameter $('.form--search').submit(function (e) { e.preventDefault(); var postRequest = $(this).serializeArray(); var query = null; for (i = 0; i < postRequest.length; i++) { if (postRequest[i]['name'] === 'site_query') { query = postRequest[i]['value']; } } if (query) { window.location.href = '/search?query=' + query; } }); // Event listener for focus to pass it through handleElementFocus function. window.addEventListener ? window.addEventListener('focus', handleElementFocus, true) : window.attachEvent('onfocusout', handleElementFocus); initTimeline(); // Semantic UI initialization for checkboxes & video embeds $('.ui.radio.checkbox').checkbox(); $('.ui.embed').embed(); // [Desktop] Shows the search bar when the "maginify-glass" icon is clicked $('.sb-search>.search-wrapper').on('click', function (e) { e.preventDefault(); $('#search').animate({ width: 'toggle' }, 1).focus(); $(this).toggleClass('open'); if ($(this).hasClass('open')) { $(this).find('.icon--search').hide(); $(this).find('.icon--close').show(); } else { $(this).find('.icon--close').hide(); $(this).find('.icon--search').show(); } $('.sb-search').toggleClass('sb-open'); }); // Preventing default behavior (focus & outline) on element // click due to accessible addition of tab-index=0 // TODO: Should be consolidated into single CSS class $('.ui.accordion>.title').on('mousedown', function (e) { e.preventDefault(); }); $('.ui.tabular.menu .item').on('mousedown', function (e) { e.preventDefault(); }); $('.safety-notice').css('z-index', 1000); if ($('.stock-ticker').length > 0) { updatePrices(); } }); function initializeMobyMenu() { // Initialize the mobile menu var mobyMenu = new Moby({ menu: $('#mainNav'), // The menu that will be cloned mobyTrigger: $('#mobileMenuButton'), // Button that will trigger the Moby menu to open subMenuOpenIcon: '', // icon that shows when the submenu is hidden subMenuCloseIcon: '' // icon that shows when the submenu is showing }); $('.moby-menu>nav>ul>li>a').each(function () { $(this).attr('tabindex', -1); }); $('.moby-menu>nav').attr('aria-label', 'Mobile Navigation'); $(".moby-menu input[name='site_query']").attr('tabindex', -1); $(".moby-menu input[name='site_query']").attr('id', 'mobileSearch'); $('.moby-menu .sb-search label').attr('for', 'mobileSearch'); } // Removes the "no-outline" class if tab (keycode - 9) was pressed function handleElementFocus(e) { var activeElement = $(document.activeElement); if (lastKeyPressed === 9) { activeElement.removeClass('no-outline'); } } function initTimeline() { if (!$('.timeline').length) { return; } var events = $('.timeline__marker').length; var w = parseInt($('.timeline__marker').width(), 10); $('.window--full').css({ width: events * w + $('.window--full').width() + 'px' }); $('.timeline__marker').on('click.timeline', function () { activateEventMarker($(this)); }); var activateEventMarker = function activateEventMarker($marker) { deactiveMarkers(); var key = parseInt($marker.attr('data-timeline-key'), 10); $marker.addClass('timeline__marker--current'); $('.timeline__content[data-timeline-key="' + key + '"]').removeClass('hidden').attr('aria-hidden', 'false'); if (key == 0) { key = 1; } $('.window--full').css({ marginLeft: -((key - 1) * w) }); }; var deactiveMarkers = function deactiveMarkers() { $('.timeline__marker').removeClass('timeline__marker--current').removeClass('timeline__marker--active'); $('.timeline__content').addClass('hidden').attr('aria-hidden', 'false'); }; //allow drag on timeline var eX = 0; var dimension = {}; var tracker = null; var interval = null; var intervalTime = 300; var prevX = 0; var prevY = 0; var $dragme = false; var touchEndX = 0; var touchStartX = 0; $('.window--full').on('mousedown.initDrag touchstart.initDrag', function (e) { var startCoord = {}; var startPosition = {}; var moved = {}; var originalEvent = e.originalEvent; if (typeof e.pageX === 'undefined') { eX = originalEvent.touches[0].pageX; } else { eX = e.pageX; } touchEndX = eX; $dragme = $(this); if ($dragme) { $dragme.stop(); } dimension.width = $dragme.width() - 2 * $('.timeline').width() + 100; startCoord.x = eX; touchStartX = eX; startPosition.x = parseInt($dragme.css('marginLeft'), 10); prevX = eX; clearInterval(interval); interval = setInterval(function () { prevX = eX; }, intervalTime); $(document).off('mousemove.initDrag touchmove.initDrag').on('mousemove.initDrag touchmove.initDrag', function (e) { var originalEvent = e.originalEvent; if (typeof e.pageX === 'undefined') { eX = originalEvent.touches[0].pageX; } else { eX = e.pageX; } touchEndX = eX; moved.x = startCoord.x - eX; clearTimeout(tracker); tracker = setTimeout(function () { prevX = eX; }, 100); var left = getLeftPos(startPosition.x - moved.x); $dragme.css({ marginLeft: left }); }); $(document).off('mouseup.initDrag touchend.initDrag').on('mouseup.initDrag touchend.initDrag', function (e) { $(document).off('mousemove.initDrag touchmove.initDrag'); }); }); var getLeftPos = function getLeftPos(currentLeftPos) { var left = currentLeftPos; if (left > 0) { left = 0; } else if (left < -dimension.width) { left = -dimension.width; } return left; }; } function updatePrices() { var id = $('.stock-ticker').attr('id'); // var frequency = $(".stock-ticker").attr('data-frequency'); var req = $.ajax({ method: 'GET', url: '/stock/get_price/' + id }).done(function (res) { var close = res['close']; var change = res['change'] > 0 ? '+' + res['change'] : res['change']; var percentChange = res['percent_change']; var lastChecked = res['last_checked']; if (document.getElementsByTagName('html')[0].getAttribute('lang') == 'fr') { lastChecked = lastChecked.split(' '); lastChecked.splice(1, 0, 'à'); lastChecked = lastChecked.join(' '); } if (change < 0) { $('.stock__arrow').find('img').attr('src', '/img/arrow-down.png'); } else { $('.stock__arrow').find('img').attr('src', '/img/arrow-up.png'); } $('.stock-ticker').find('.stock__close').text(close); $('.stock-ticker').find('.stock__change').text(change); $('.stock-ticker').find('.stock__percent-change').text(percentChange); $('.stock__last-updated').text(lastChecked); }); } $(".print-pdf").on("click", function (e) { e.preventDefault(); var w = window; var body = $('body').html(); w.window.print(); w.document.close(); }); /***/ }), /***/ "./resources/sass/app.scss": /*!*********************************!*\ !*** ./resources/sass/app.scss ***! \*********************************/ /*! no static exports found */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /***/ 0: /*!*************************************************************!*\ !*** multi ./resources/js/app.js ./resources/sass/app.scss ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(/*! /home/eyad/webs/site-savaria-savaria-2019/resources/js/app.js */"./resources/js/app.js"); module.exports = __webpack_require__(/*! /home/eyad/webs/site-savaria-savaria-2019/resources/sass/app.scss */"./resources/sass/app.scss"); /***/ }) /******/ });